eligius 2.0.0 → 2.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.mts +602 -235
- package/dist/index.mjs +639 -331
- package/dist/index.mjs.map +1 -1
- package/jsonschema/eligius-configuration.json +708 -81
- package/jsonschema/operations/add-class.json +20 -23
- package/jsonschema/operations/add-controller-to-element.json +13 -12
- package/jsonschema/operations/animate-with-class.json +21 -25
- package/jsonschema/operations/animate.json +23 -31
- package/jsonschema/operations/announce-to-screen-reader.json +20 -24
- package/jsonschema/operations/broadcast-event.json +19 -31
- package/jsonschema/operations/calc.json +24 -30
- package/jsonschema/operations/clear-element.json +24 -13
- package/jsonschema/operations/clear-operation-data.json +15 -18
- package/jsonschema/operations/compare-date.json +51 -23
- package/jsonschema/operations/concatenate-strings.json +22 -24
- package/jsonschema/operations/create-element.json +11 -144
- package/jsonschema/operations/custom-function.json +15 -22
- package/jsonschema/operations/end-action.json +19 -22
- package/jsonschema/operations/extend-controller.json +19 -22
- package/jsonschema/operations/filter-array.json +40 -26
- package/jsonschema/operations/find-in-array.json +40 -26
- package/jsonschema/operations/for-each.json +23 -22
- package/jsonschema/operations/format-date.json +33 -22
- package/jsonschema/operations/format-text.json +22 -20
- package/jsonschema/operations/get-attributes-from-element.json +28 -22
- package/jsonschema/operations/get-controller-from-element.json +23 -34
- package/jsonschema/operations/get-controller-instance.json +11 -25
- package/jsonschema/operations/get-current-time.json +23 -13
- package/jsonschema/operations/get-element-dimensions.json +30 -20
- package/jsonschema/operations/get-focused-element.json +20 -13
- package/jsonschema/operations/get-form-data.json +27 -13
- package/jsonschema/operations/get-import.json +17 -23
- package/jsonschema/operations/get-query-params.json +17 -18
- package/jsonschema/operations/get-scroll-position.json +23 -13
- package/jsonschema/operations/get-text-content.json +27 -13
- package/jsonschema/operations/http-delete.json +20 -24
- package/jsonschema/operations/http-post.json +21 -30
- package/jsonschema/operations/http-put.json +21 -30
- package/jsonschema/operations/invoke-object-method.json +26 -24
- package/jsonschema/operations/is-element-in-viewport.json +27 -13
- package/jsonschema/operations/load-from-storage.json +19 -26
- package/jsonschema/operations/load-json.json +21 -24
- package/jsonschema/operations/log.json +13 -26
- package/jsonschema/operations/map-array.json +39 -22
- package/jsonschema/operations/math.json +33 -27
- package/jsonschema/operations/remove-class.json +20 -23
- package/jsonschema/operations/remove-controller-from-element.json +20 -34
- package/jsonschema/operations/remove-element.json +24 -13
- package/jsonschema/operations/remove-properties-from-operation-data.json +18 -22
- package/jsonschema/operations/reparent-element.json +20 -22
- package/jsonschema/operations/replace-string.json +32 -25
- package/jsonschema/operations/replace-text.json +32 -25
- package/jsonschema/operations/request-action.json +18 -22
- package/jsonschema/operations/save-to-storage.json +19 -32
- package/jsonschema/operations/scroll-to-element.json +21 -22
- package/jsonschema/operations/scroll-to-position.json +18 -29
- package/jsonschema/operations/select-element.json +19 -24
- package/jsonschema/operations/set-data.json +15 -22
- package/jsonschema/operations/set-element-attributes.json +20 -22
- package/jsonschema/operations/set-element-content.json +36 -20
- package/jsonschema/operations/set-focus.json +24 -13
- package/jsonschema/operations/set-form-value.json +24 -20
- package/jsonschema/operations/set-global-data.json +18 -22
- package/jsonschema/operations/set-style.json +20 -22
- package/jsonschema/operations/set-variable.json +17 -31
- package/jsonschema/operations/set.json +40 -0
- package/jsonschema/operations/sort-array.json +39 -22
- package/jsonschema/operations/split-string.json +34 -22
- package/jsonschema/operations/start-action.json +19 -20
- package/jsonschema/operations/substring-text.json +23 -24
- package/jsonschema/operations/toggle-class.json +21 -23
- package/jsonschema/operations/toggle-element.json +24 -13
- package/jsonschema/operations/toggle-form-element.json +20 -22
- package/jsonschema/operations/validate-form.json +25 -18
- package/jsonschema/operations/wait.json +16 -22
- package/jsonschema/operations/when.json +15 -22
- package/package.json +4 -2
- package/jsonschema/endable-action-template.json +0 -525
- package/jsonschema/endable-action.json +0 -525
- package/jsonschema/engine-config.json +0 -21
- package/jsonschema/event-action.json +0 -293
- package/jsonschema/mediaplayer-timeline-provider-settings.json +0 -40
- package/jsonschema/operation-templates/add-class.json +0 -40
- package/jsonschema/operation-templates/add-controller-to-element.json +0 -26
- package/jsonschema/operation-templates/add-globals-to-operation.json +0 -39
- package/jsonschema/operation-templates/animate-with-class.json +0 -44
- package/jsonschema/operation-templates/animate.json +0 -51
- package/jsonschema/operation-templates/announce-to-screen-reader.json +0 -43
- package/jsonschema/operation-templates/break-for-each.json +0 -26
- package/jsonschema/operation-templates/broadcast-event.json +0 -51
- package/jsonschema/operation-templates/calc.json +0 -49
- package/jsonschema/operation-templates/clear-element.json +0 -26
- package/jsonschema/operation-templates/clear-operation-data.json +0 -37
- package/jsonschema/operation-templates/clear-storage.json +0 -41
- package/jsonschema/operation-templates/compare-date.json +0 -41
- package/jsonschema/operation-templates/concatenate-strings.json +0 -43
- package/jsonschema/operation-templates/continue-for-each.json +0 -26
- package/jsonschema/operation-templates/create-element.json +0 -156
- package/jsonschema/operation-templates/custom-function.json +0 -39
- package/jsonschema/operation-templates/end-action.json +0 -39
- package/jsonschema/operation-templates/end-for-each.json +0 -26
- package/jsonschema/operation-templates/end-when.json +0 -26
- package/jsonschema/operation-templates/extend-controller.json +0 -39
- package/jsonschema/operation-templates/filter-array.json +0 -47
- package/jsonschema/operation-templates/find-in-array.json +0 -47
- package/jsonschema/operation-templates/for-each.json +0 -40
- package/jsonschema/operation-templates/format-date.json +0 -39
- package/jsonschema/operation-templates/format-text.json +0 -37
- package/jsonschema/operation-templates/get-attributes-from-element.json +0 -39
- package/jsonschema/operation-templates/get-controller-from-element.json +0 -51
- package/jsonschema/operation-templates/get-controller-instance.json +0 -37
- package/jsonschema/operation-templates/get-current-time.json +0 -26
- package/jsonschema/operation-templates/get-element-dimensions.json +0 -39
- package/jsonschema/operation-templates/get-focused-element.json +0 -26
- package/jsonschema/operation-templates/get-form-data.json +0 -26
- package/jsonschema/operation-templates/get-import.json +0 -39
- package/jsonschema/operation-templates/get-query-params.json +0 -37
- package/jsonschema/operation-templates/get-scroll-position.json +0 -26
- package/jsonschema/operation-templates/get-text-content.json +0 -26
- package/jsonschema/operation-templates/http-delete.json +0 -43
- package/jsonschema/operation-templates/http-post.json +0 -49
- package/jsonschema/operation-templates/http-put.json +0 -49
- package/jsonschema/operation-templates/invoke-object-method.json +0 -43
- package/jsonschema/operation-templates/is-element-in-viewport.json +0 -26
- package/jsonschema/operation-templates/load-from-storage.json +0 -43
- package/jsonschema/operation-templates/load-json.json +0 -43
- package/jsonschema/operation-templates/log.json +0 -47
- package/jsonschema/operation-templates/map-array.json +0 -39
- package/jsonschema/operation-templates/math.json +0 -45
- package/jsonschema/operation-templates/otherwise.json +0 -26
- package/jsonschema/operation-templates/remove-class.json +0 -40
- package/jsonschema/operation-templates/remove-controller-from-element.json +0 -51
- package/jsonschema/operation-templates/remove-element.json +0 -26
- package/jsonschema/operation-templates/remove-properties-from-operation-data.json +0 -39
- package/jsonschema/operation-templates/reparent-element.json +0 -39
- package/jsonschema/operation-templates/replace-string.json +0 -43
- package/jsonschema/operation-templates/replace-text.json +0 -43
- package/jsonschema/operation-templates/request-action.json +0 -39
- package/jsonschema/operation-templates/save-to-storage.json +0 -49
- package/jsonschema/operation-templates/scroll-to-element.json +0 -45
- package/jsonschema/operation-templates/scroll-to-position.json +0 -49
- package/jsonschema/operation-templates/select-element.json +0 -43
- package/jsonschema/operation-templates/set-data.json +0 -39
- package/jsonschema/operation-templates/set-element-attributes.json +0 -39
- package/jsonschema/operation-templates/set-element-content.json +0 -41
- package/jsonschema/operation-templates/set-focus.json +0 -26
- package/jsonschema/operation-templates/set-form-value.json +0 -37
- package/jsonschema/operation-templates/set-global-data.json +0 -39
- package/jsonschema/operation-templates/set-operation-data.json +0 -43
- package/jsonschema/operation-templates/set-style.json +0 -39
- package/jsonschema/operation-templates/set-variable.json +0 -49
- package/jsonschema/operation-templates/sort-array.json +0 -45
- package/jsonschema/operation-templates/split-string.json +0 -41
- package/jsonschema/operation-templates/start-action.json +0 -39
- package/jsonschema/operation-templates/substring-text.json +0 -43
- package/jsonschema/operation-templates/toggle-class.json +0 -40
- package/jsonschema/operation-templates/toggle-element.json +0 -26
- package/jsonschema/operation-templates/toggle-form-element.json +0 -39
- package/jsonschema/operation-templates/validate-form.json +0 -37
- package/jsonschema/operation-templates/wait.json +0 -39
- package/jsonschema/operation-templates/when.json +0 -39
- package/jsonschema/operations/add-globals-to-operation.json +0 -43
- package/jsonschema/operations/break-for-each.json +0 -26
- package/jsonschema/operations/clear-storage.json +0 -45
- package/jsonschema/operations/continue-for-each.json +0 -26
- package/jsonschema/operations/end-for-each.json +0 -26
- package/jsonschema/operations/end-when.json +0 -26
- package/jsonschema/operations/otherwise.json +0 -26
- package/jsonschema/operations/set-operation-data.json +0 -47
- package/jsonschema/raf-timeline-provider-settings.json +0 -29
- package/jsonschema/timeline-action.json +0 -540
- package/jsonschema/timeline-provider-settings.json +0 -16
- package/jsonschema/timeline.json +0 -52
package/dist/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","names":["cache: TGlobalCache","cache","getGlobals: (name?: string) => TGlobalCache | any","setGlobals: (newValues: TGlobalCache) => void","clearGlobals: () => void","forEach: TOperation<IForEachOperationData>","when: TOperation<\n IWhenOperationData,\n Omit<IWhenOperationData, 'expression'>\n>","evaluations: Record<\n TOperator,\n (left: string | number, right: string | number) => boolean\n>","name: string","startOperations: IResolvedOperation[]","eventbus: IEventbus","operations","endOperations: IResolvedOperation[]","duration: IStrictDuration","_engine: IEligiusEngine","_eventbus: IEventbus","_engine: IEligiusEngine","_eventbus: IEventbus","_windowRef: Window","_languageManager: ILanguageManager","_eventbus: IEventbus","_engine: IEligiusEngine","addClass: TOperation<\n IAddClassOperationData,\n Omit<IAddClassOperationData, 'className'>\n>","controllers","addControllerToElement: TOperation<IAddControllerToElementOperationData>","addGlobalsToOperation: TOperation<\n IAddGlobalsToOperationData,\n Omit<IAddGlobalsToOperationData, 'globalProperties'>\n>","animate: TOperation<\n IAnimateOperationData,\n Omit<\n IAnimateOperationData,\n 'animationEasing' | 'animationProperties' | 'animationDuration'\n >\n>","animateWithClass: TOperation<\n IAnimateWithClassOperationData,\n Promise<IAnimateWithClassOperationData>\n>","removeClass","announceToScreenReader: TOperation<\n IAnnounceToScreenReaderOperationData,\n Omit<IAnnounceToScreenReaderOperationData, 'message' | 'priority'>\n>","breakForEach: TOperation<TOperationData>","broadcastEvent: TOperation<\n IBroadcastEventOperationData,\n Omit<IBroadcastEventOperationData, 'eventArgs' | 'eventTopic' | 'eventName'>\n>","cache: any[]","resolvePropertyChain","calcFunctions: Record<\n TCalculationOperator,\n (left: number, right: number) => number\n>","calc: TOperation<\n ICalcOperationData,\n Omit<ICalcOperationData, 'left' | 'right' | 'operator'>\n>","clearElement: TOperation<IClearElementOperationData>","clearOperationData: TOperation<\n IClearOperationDataOperationData,\n Omit<IClearOperationDataOperationData, 'properties'>\n>","clearStorage: TOperation<\n IClearStorageOperationData,\n Omit<IClearStorageOperationData, 'key' | 'storageType'>\n>","compareDate: TOperation<\n ICompareDateOperationData,\n Omit<ICompareDateOperationData, 'date1' | 'date2'>\n>","concatenateStrings: TOperation<\n IConcatenateStringsOperationData,\n Omit<IConcatenateStringsOperationData, 'strings' | 'separator'>\n>","continueForEach: TOperation<TOperationData>","createElement: TOperation<\n ICreateElementOperationData<TTagNames>,\n Omit<\n RequireKeys<ICreateElementOperationData<TTagNames>, 'template'>,\n 'elementName' | 'text' | 'attributes'\n >\n>","customFunction: TOperation<\n ICustomFunctionOperationData,\n Omit<ICustomFunctionOperationData, 'systemName'>\n>","endAction: TOperation<\n IEndActionOperationData,\n Omit<IEndActionOperationData, 'actionOperationData'>\n>","endForEach: TOperation<TOperationData>","endWhen: TOperation<Record<string, unknown>>","extendController: TOperation<\n IExtendControllerOperationData,\n Omit<IExtendControllerOperationData, 'controllerExtension'>\n>","filterArray: TOperation<\n IFilterArrayOperationData,\n Omit<\n IFilterArrayOperationData,\n 'filterProperty' | 'filterValue' | 'filterPredicate'\n >\n>","filtered: any[]","findInArray: TOperation<\n IFindInArrayOperationData,\n Omit<\n IFindInArrayOperationData,\n 'findProperty' | 'findValue' | 'findPredicate'\n >\n>","foundItem: any | undefined","formatDate: TOperation<\n IFormatDateOperationData,\n Omit<IFormatDateOperationData, 'format'>\n>","formatText: TOperation<\n IFormatTextOperationData,\n Omit<IFormatTextOperationData, 'transformation'>\n>","getAttributesFromElement: TOperation<\n IGetAttributesFromElementOperationData,\n Omit<IGetAttributesFromElementOperationData, 'attributeNames'>\n>","getControllerFromElement: TOperation<\n IGetControllerFromElementOperationData,\n Omit<IGetControllerFromElementOperationData, 'controllerName'>\n>","getControllerInstance: TOperation<\n IGetControllerInstanceOperationData,\n Omit<IGetControllerInstanceOperationData, 'systemName'>\n>","getCurrentTime: TOperation<\n IGetCurrentTimeOperationData,\n IGetCurrentTimeOperationData\n>","suffix: string | null","ratioModifier: string | null","getElementDimensions: TOperation<\n IGetElementDimensionsOperationData,\n Omit<IGetElementDimensionsOperationData, 'modifier'>\n>","getFocusedElement: TOperation<\n IGetFocusedElementOperationData,\n IGetFocusedElementOperationData\n>","getFormData: TOperation<\n IGetFormDataOperationData,\n IGetFormDataOperationData\n>","formData: Record<string, any>","getImport: TOperation<\n IGetImportOperationData,\n Omit<RequireKeys<IGetImportOperationData, 'importedInstance'>, 'systemName'>\n>","getQueryParams: TOperation<\n IGetQueryParamsOperationData,\n Omit<IGetQueryParamsOperationData, 'defaultValues'>\n>","getScrollPosition: TOperation<\n IGetScrollPositionOperationData,\n IGetScrollPositionOperationData\n>","getTextContent: TOperation<\n IGetTextContentOperationData,\n IGetTextContentOperationData\n>","httpDelete: TOperation<\n IHttpDeleteOperationData,\n Omit<IHttpDeleteOperationData, 'url' | 'headers'>\n>","httpPost: TOperation<\n IHttpPostOperationData,\n Omit<IHttpPostOperationData, 'url' | 'body' | 'headers'>\n>","httpPut: TOperation<\n IHttpPutOperationData,\n Omit<IHttpPutOperationData, 'url' | 'body' | 'headers'>\n>","invokeObjectMethod: TOperation<\n IInvokeObjectMethodOperationData,\n Omit<IInvokeObjectMethodOperationData, 'methodName' | 'methodArguments'>\n>","isElementInViewport: TOperation<\n IIsElementInViewportOperationData,\n IIsElementInViewportOperationData\n>","loadFromStorage: TOperation<\n ILoadFromStorageOperationData,\n Omit<ILoadFromStorageOperationData, 'storageType'>\n>","jsonCache: Record<string, unknown>","loadJson: TOperation<\n ILoadJSONOperationData,\n Omit<ILoadJSONOperationData, 'url' | 'cache'>\n>","cache","log: TOperation<\n ILogOperationData,\n Omit<ILogOperationData, 'logValue' | 'logName'>\n>","mapArray: TOperation<\n IMapArrayOperationData,\n Omit<IMapArrayOperationData, 'mapFunction'>\n>","math: TOperation<\n IMathOperationData,\n Omit<IMathOperationData, 'args' | 'functionName'>\n>","otherwise: TOperation<Record<string, unknown>>","removeClass: TOperation<\n IRemoveClassOperationData,\n Omit<IRemoveClassOperationData, 'className'>\n>","removeControllerFromElement: TOperation<\n IRemoveControllerFromElementOperationData,\n Omit<IRemoveControllerFromElementOperationData, 'controllerName'>\n>","controllers","removeElement: TOperation<IRemoveElementOperationData>","removePropertiesFromOperationData: TOperation<\n IRemovePropertiesFromOperationDataOperationData,\n Omit<IRemovePropertiesFromOperationDataOperationData, 'propertyNames'>\n>","reparentElement: TOperation<\n IReparentElementOperationData,\n Omit<IReparentElementOperationData, 'newParentSelector'>\n>","replaceString: TOperation<\n IReplaceStringOperationData,\n Omit<IReplaceStringOperationData, 'pattern' | 'replacement'>\n>","replaceText: TOperation<\n IReplaceTextOperationData,\n Omit<IReplaceTextOperationData, 'searchPattern' | 'replacement'>\n>","newText: string","requestAction: TOperation<\n IRequestActionOperationData,\n Omit<Required<IRequestActionOperationData>, 'systemName'>\n>","saveToStorage: TOperation<\n ISaveToStorageOperationData,\n Omit<ISaveToStorageOperationData, 'value' | 'storageType'>\n>","scrollToElement: TOperation<\n IScrollToElementOperationData,\n Omit<IScrollToElementOperationData, 'behavior' | 'block' | 'inline'>\n>","scrollToPosition: TOperation<\n IScrollToPositionOperationData,\n Omit<IScrollToPositionOperationData, 'x' | 'y' | 'behavior'>\n>","selectElement: TOperation<\n ISelectElementOperationData,\n Omit<ISelectElementOperationData, 'selector' | 'useSelectedElementAsRoot'>\n>","setData: TOperation<\n ISetDataOperationData,\n Omit<ISetDataOperationData, 'properties'>\n>","setElementAttributes: TOperation<\n ISetElementAttributesOperationData,\n Omit<ISetElementAttributesOperationData, 'attributes'>\n>","setElementContent: TOperation<\n ISetElementContentOperationData,\n Omit<ISetElementContentOperationData, 'template' | 'insertionType'>\n>","setFocus: TOperation<\n ISetFocusOperationData,\n ISetFocusOperationData\n>","setFormValue: TOperation<\n ISetFormValueOperationData,\n Omit<ISetFormValueOperationData, 'value'>\n>","setGlobalData: TOperation<\n ISetGlobalDataOperationData,\n Omit<ISetGlobalDataOperationData, 'propertyNames'>\n>","setOperationData: TOperation<\n ISetOperationData,\n Omit<ISetOperationData, 'override' | 'properties'>\n>","setStyle: TOperation<\n ISetStyleOperationData,\n Omit<ISetStyleOperationData, 'properties'>\n>","setVariable: TOperation<\n ISetVariableOperationData,\n Omit<ISetVariableOperationData, 'name' | 'value'>\n>","sortArray: TOperation<\n ISortArrayOperationData,\n Omit<ISortArrayOperationData, 'sortProperty' | 'sortOrder' | 'sortComparator'>\n>","splitString: TOperation<\n ISplitStringOperationData,\n Omit<ISplitStringOperationData, 'delimiter' | 'limit'>\n>","startAction: TOperation<\n IStartActionOperationData,\n Omit<IStartActionOperationData, 'actionOperationData'>\n>","substringText: TOperation<\n ISubstringTextOperationData,\n Omit<ISubstringTextOperationData, 'start' | 'end'>\n>","toggleClass: TOperation<\n IToggleClassOperationData,\n Omit<IToggleClassOperationData, 'className'>\n>","toggleElement: TOperation<IToggleElementOperationData>","toggleElement","toggleFormElement: TOperation<\n IToggleFormElementOperationData,\n Omit<IToggleFormElementOperationData, 'enabled'>\n>","validateForm: TOperation<\n IValidateFormOperationData,\n Omit<IValidateFormOperationData, 'validationRules'>\n>","validationErrors: Record<string, string>","wait: TOperation<\n IWaitOperationData,\n Omit<IWaitOperationData, 'milliseconds'>\n>","configurationfactory: ConfigurationFactory","factory: ActionCreatorFactory","uuidv4","operations","actionConfig: T","configurationFactory: ConfigurationFactory","operations","uuidv4","duration: IDuration","operationConfig: IOperationConfiguration<\n ExtractOperationDataType<O>\n >","actionEditor: T","configurationFactory: ConfigurationFactory","languageLabel: ILanguageLabel","DEFAULT_POSITION_SOURCES: Record<string, string>","providersSettings: TTimelineProviderSettings","configurationFactory: ConfigurationFactory","settings: ITimelineProviderSettings","providerSettings: ITimelineProviderSettings","providersSettingsEditor: TimelineProvidersSettingsEditor","configuration: IEngineConfiguration","newConfiguration: IEngineConfiguration","uuidv4","timelineConfig: ITimelineConfiguration","eventbus","eventbus","eventbus","eventbus","animationSettings: AnimationConfigWithData<'svg'>","eventbus","payload: IMutationEventPayload","eventbus","labelCtrl: LabelController","result: any[]","eventbus","eventbus","result: any[]","eventbus","subtitleTimeLookup: Record<number, () => void>","titleLanguageLookup: Record<string, string>","addClass","addControllerToElement","addGlobalsToOperation","animateWithClass","animate","announceToScreenReader","breakForEach","broadcastEvent","calc","clearElement","clearOperationData","clearStorage","compareDate","concatenateStrings","continueForEach","createElement","customFunction","endAction","endForEach","endWhen","extendController","filterArray","findInArray","forEach","formatDate","formatText","getAttributesFromElement","getControllerFromElement","getControllerInstance","getCurrentTime","getElementDimensions","getFocusedElement","getFormData","getImport","getQueryParams","getScrollPosition","getTextContent","httpDelete","httpPost","httpPut","invokeObjectMethod","isElementInViewport","loadFromStorage","loadJson","log","mapArray","math","otherwise","removeClass","removeControllerFromElement","removeElement","removePropertiesFromOperationData","reparentElement","replaceString","replaceText","requestAction","saveToStorage","scrollToElement","scrollToPosition","selectElement","setData","setElementAttributes","setElementContent","setFocus","setFormValue","setGlobalData","setOperationData","setStyle","setVariable","sortArray","splitString","startAction","substringText","toggleClass","toggleElement","toggleFormElement","validateForm","wait","when","operations","controllers","operationMetadata","result: ISubtitle[]","lines: string[]","i: number","l: number","rawLine: string","caption: Partial<ISubtitle> | null","res: string","times: string[]","parts: string[]","collection: ISubtitleCollection[]","newLanguage: ISubtitleCollection","uuidv4","importer: ISimpleResourceImporter","eventbus: IEventbus","resolvedConfig: IResolvedEngineConfiguration","eventActions: IAction[]","eventbus","DOMEventListenerController","LabelController","LottieController","MutationObserverController","NavigationController","ProgressbarController","RoutingController","SubtitlesController","requestAction","eventbus: IEventbus","onceHandler: EventHandler<T[K]>","isSeekable","configuration: IResolvedEngineConfiguration","eventbus: IEventbus","timelineProviders: Record<TimelineTypes, ITimelineProviderInfo>","languageManager: LanguageManager","operations: Record<string, TOperation<any>>","ops","controllers: Record<string, any>","ctrls","providers: Record<string, any>","prvdrs","eventbus: Record<string, any>","evtb","cache","_currentLanguage: TLanguageCode","actionRegistryListener: ActionRegistryEventbusListener | undefined"],"sources":["../src/operation/helper/find-matching-operation-index.ts","../src/operation/helper/get-property-chain-value.ts","../src/operation/helper/deep-copy.ts","../src/operation/helper/globals.ts","../src/operation/helper/resolve-external-property-chain.ts","../src/operation/for-each.ts","../src/operation/helper/remove-operation-properties.ts","../src/operation/when.ts","../src/util/guards/is-promise.ts","../src/action/action.ts","../src/action/endable-action.ts","../src/action/timeline-action.ts","../src/adapters/engine-eventbus-adapter.ts","../src/adapters/engine-input-adapter.ts","../src/adapters/language-eventbus-adapter.ts","../src/operation/add-class.ts","../src/operation/helper/get-element-data.ts","../src/operation/helper/attach-controller-to-element.ts","../src/operation/helper/merge-operation-data.ts","../src/operation/helper/internal-resolve.ts","../src/operation/add-controller-to-element.ts","../src/operation/add-globals-to-operation.ts","../src/operation/animate.ts","../src/operation/animate-with-class.ts","../src/operation/announce-to-screen-reader.ts","../src/operation/break-for-each.ts","../src/operation/helper/resolve-event-arguments.ts","../src/operation/broadcast-event.ts","../src/util/guards/is-object.ts","../src/operation/helper/resolve-property-values.ts","../src/operation/calc.ts","../src/operation/clear-element.ts","../src/operation/clear-operation-data.ts","../src/operation/clear-storage.ts","../src/operation/compare-date.ts","../src/operation/concatenate-strings.ts","../src/operation/continue-for-each.ts","../src/operation/create-element.ts","../src/operation/custom-function.ts","../src/operation/end-action.ts","../src/operation/end-for-each.ts","../src/operation/end-when.ts","../src/operation/extend-controller.ts","../src/operation/filter-array.ts","../src/operation/find-in-array.ts","../src/operation/format-date.ts","../src/operation/format-text.ts","../src/operation/get-attributes-from-element.ts","../src/operation/get-controller-from-element.ts","../src/operation/get-controller-instance.ts","../src/operation/get-current-time.ts","../src/operation/helper/modify-dimensions.ts","../src/operation/get-element-dimensions.ts","../src/operation/get-focused-element.ts","../src/operation/get-form-data.ts","../src/operation/get-import.ts","../src/operation/get-query-params.ts","../src/operation/get-scroll-position.ts","../src/operation/get-text-content.ts","../src/operation/http-delete.ts","../src/operation/http-post.ts","../src/operation/http-put.ts","../src/operation/invoke-object-method.ts","../src/operation/is-element-in-viewport.ts","../src/operation/load-from-storage.ts","../src/operation/load-json.ts","../src/operation/log.ts","../src/operation/map-array.ts","../src/util/guards/is-function.ts","../src/util/guards/is-string.ts","../src/operation/math.ts","../src/operation/otherwise.ts","../src/operation/remove-class.ts","../src/operation/remove-controller-from-element.ts","../src/operation/remove-element.ts","../src/operation/remove-properties-from-operation-data.ts","../src/operation/reparent-element.ts","../src/operation/replace-string.ts","../src/operation/replace-text.ts","../src/operation/request-action.ts","../src/operation/save-to-storage.ts","../src/operation/scroll-to-element.ts","../src/operation/scroll-to-position.ts","../src/operation/select-element.ts","../src/operation/set-data.ts","../src/operation/set-element-attributes.ts","../src/operation/set-element-content.ts","../src/operation/set-focus.ts","../src/operation/set-form-value.ts","../src/operation/set-global-data.ts","../src/operation/set-operation-data.ts","../src/operation/set-style.ts","../src/operation/set-variable.ts","../src/operation/sort-array.ts","../src/operation/split-string.ts","../src/operation/start-action.ts","../src/operation/substring-text.ts","../src/operation/toggle-class.ts","../src/operation/toggle-element.ts","../src/operation/toggle-form-element.ts","../src/operation/validate-form.ts","../src/operation/wait.ts","../src/operation/index.ts","../src/configuration/api/action-creator-factory.ts","../src/configuration/api/action-editor.ts","../src/configuration/api/label-editor.ts","../src/configuration/api/timeline-provider-settings-editor.ts","../src/util/merge-if-missing.ts","../src/configuration/api/configuration-factory.ts","../src/controllers/dom-event-listener-controller.ts","../src/controllers/base-controller.ts","../src/controllers/label-controller.ts","../src/controllers/lottie-controller.ts","../src/controllers/mutation-observer-controller.ts","../src/controllers/navigation-controller.ts","../src/controllers/progressbar-controller.ts","../src/controllers/routing-controller.ts","../src/controllers/subtitles-controller.ts","../src/controllers/index.ts","../src/operation/metadata/add-class.ts","../src/operation/metadata/add-controller-to-element.ts","../src/operation/metadata/add-globals-to-operation.ts","../src/operation/metadata/animate-with-class.ts","../src/operation/metadata/animate.ts","../src/operation/metadata/announce-to-screen-reader.ts","../src/operation/metadata/break-for-each.ts","../src/operation/metadata/broadcast-event.ts","../src/operation/metadata/calc.ts","../src/operation/metadata/clear-element.ts","../src/operation/metadata/clear-operation-data.ts","../src/operation/metadata/clear-storage.ts","../src/operation/metadata/compare-date.ts","../src/operation/metadata/concatenate-strings.ts","../src/operation/metadata/continue-for-each.ts","../src/operation/metadata/create-element.ts","../src/operation/metadata/custom-function.ts","../src/operation/metadata/end-action.ts","../src/operation/metadata/end-for-each.ts","../src/operation/metadata/end-when.ts","../src/operation/metadata/extend-controller.ts","../src/operation/metadata/filter-array.ts","../src/operation/metadata/find-in-array.ts","../src/operation/metadata/for-each.ts","../src/operation/metadata/format-date.ts","../src/operation/metadata/format-text.ts","../src/operation/metadata/get-attributes-from-element.ts","../src/operation/metadata/get-controller-from-element.ts","../src/operation/metadata/get-controller-instance.ts","../src/operation/metadata/get-current-time.ts","../src/operation/metadata/get-element-dimensions.ts","../src/operation/metadata/get-focused-element.ts","../src/operation/metadata/get-form-data.ts","../src/operation/metadata/get-import.ts","../src/operation/metadata/get-query-params.ts","../src/operation/metadata/get-scroll-position.ts","../src/operation/metadata/get-text-content.ts","../src/operation/metadata/http-delete.ts","../src/operation/metadata/http-post.ts","../src/operation/metadata/http-put.ts","../src/operation/metadata/invoke-object-method.ts","../src/operation/metadata/is-element-in-viewport.ts","../src/operation/metadata/load-from-storage.ts","../src/operation/metadata/load-json.ts","../src/operation/metadata/log.ts","../src/operation/metadata/map-array.ts","../src/operation/metadata/math.ts","../src/operation/metadata/otherwise.ts","../src/operation/metadata/remove-class.ts","../src/operation/metadata/remove-controller-from-element.ts","../src/operation/metadata/remove-element.ts","../src/operation/metadata/remove-properties-from-operation-data.ts","../src/operation/metadata/reparent-element.ts","../src/operation/metadata/replace-string.ts","../src/operation/metadata/replace-text.ts","../src/operation/metadata/request-action.ts","../src/operation/metadata/save-to-storage.ts","../src/operation/metadata/scroll-to-element.ts","../src/operation/metadata/scroll-to-position.ts","../src/operation/metadata/select-element.ts","../src/operation/metadata/set-data.ts","../src/operation/metadata/set-element-attributes.ts","../src/operation/metadata/set-element-content.ts","../src/operation/metadata/set-focus.ts","../src/operation/metadata/set-form-value.ts","../src/operation/metadata/set-global-data.ts","../src/operation/metadata/set-operation-data.ts","../src/operation/metadata/set-style.ts","../src/operation/metadata/set-variable.ts","../src/operation/metadata/sort-array.ts","../src/operation/metadata/split-string.ts","../src/operation/metadata/start-action.ts","../src/operation/metadata/substring-text.ts","../src/operation/metadata/toggle-class.ts","../src/operation/metadata/toggle-element.ts","../src/operation/metadata/toggle-form-element.ts","../src/operation/metadata/validate-form.ts","../src/operation/metadata/wait.ts","../src/operation/metadata/when.ts","../src/operation/metadata/index.ts","../src/configuration/api/name-providers.ts","../src/configuration/api/subtitle-converter.ts","../src/configuration/api/subtitle-editor.ts","../src/operation/helper/resolve-property-chain.ts","../src/configuration/configuration-resolver.ts","../src/controllers/metadata/dom-event-listener-controller.ts","../src/controllers/metadata/label-controller.ts","../src/controllers/metadata/lottie-controller.ts","../src/controllers/metadata/mutation-observer-controller.ts","../src/controllers/metadata/navigation-controller.ts","../src/controllers/metadata/progressbar-controller.ts","../src/controllers/metadata/routing-controller.ts","../src/controllers/metadata/subtitles-controller.ts","../src/controllers/metadata/index.ts","../src/eventbus/events/metadata/before-request-timeline-uri.ts","../src/eventbus/events/metadata/before-request-video-url.ts","../src/eventbus/events/metadata/dom-mutation.ts","../src/eventbus/events/metadata/highlight-navigation.ts","../src/eventbus/events/metadata/language-change.ts","../src/eventbus/events/metadata/navigate-to-video-url.ts","../src/eventbus/events/metadata/push-history-state.ts","../src/eventbus/events/metadata/request-action.ts","../src/eventbus/events/metadata/request-current-language.ts","../src/eventbus/events/metadata/request-current-navigation.ts","../src/eventbus/events/metadata/request-current-timeline-position.ts","../src/eventbus/events/metadata/request-current-video-position.ts","../src/eventbus/events/metadata/request-engine-root.ts","../src/eventbus/events/metadata/request-function.ts","../src/eventbus/events/metadata/request-instance.ts","../src/eventbus/events/metadata/request-label-collection.ts","../src/eventbus/events/metadata/request-label-collections.ts","../src/eventbus/events/metadata/request-timeline-cleanup.ts","../src/eventbus/events/metadata/request-timeline-uri.ts","../src/eventbus/events/metadata/request-video-cleanup.ts","../src/eventbus/events/metadata/request-video-url.ts","../src/eventbus/events/metadata/timeline-complete.ts","../src/eventbus/events/metadata/timeline-container-request.ts","../src/eventbus/events/metadata/timeline-current-timeline-change.ts","../src/eventbus/events/metadata/timeline-duration-request.ts","../src/eventbus/events/metadata/timeline-duration.ts","../src/eventbus/events/metadata/timeline-firstframe.ts","../src/eventbus/events/metadata/timeline-pause-request.ts","../src/eventbus/events/metadata/timeline-pause.ts","../src/eventbus/events/metadata/timeline-play-request.ts","../src/eventbus/events/metadata/timeline-play-toggle-request.ts","../src/eventbus/events/metadata/timeline-play.ts","../src/eventbus/events/metadata/timeline-request-current-timeline.ts","../src/eventbus/events/metadata/timeline-resize-request.ts","../src/eventbus/events/metadata/timeline-resize.ts","../src/eventbus/events/metadata/timeline-restart.ts","../src/eventbus/events/metadata/timeline-seek-request.ts","../src/eventbus/events/metadata/timeline-seek.ts","../src/eventbus/events/metadata/timeline-seeked.ts","../src/eventbus/events/metadata/timeline-stop-request.ts","../src/eventbus/events/metadata/timeline-stop.ts","../src/eventbus/events/metadata/timeline-time.ts","../src/eventbus/events/metadata/video-complete.ts","../src/eventbus/events/metadata/index.ts","../src/eventbus/actionregistry-eventbus-listener.ts","../src/eventbus/eventbus.ts","../src/eventbus/request-video-uri-interceptor.ts","../src/eventbus/index.ts","../src/timelineproviders/types.ts","../src/timelineproviders/position-sources/base-position-source.ts","../src/util/animation-interval.ts","../src/timelineproviders/position-sources/raf-position-source.ts","../src/timelineproviders/position-sources/scroll-position-source.ts","../src/timelineproviders/position-sources/video-position-source.ts","../src/timelineproviders/container-providers/dom-container-provider.ts","../src/timelineproviders/playlist/simple-playlist.ts","../src/timelineproviders/index.ts","../src/util/typed-event-emitter.ts","../src/eligius-engine.ts","../src/importer/eligius-resource-importer.ts","../src/operation/helper/set-global.ts","../src/language-manager.ts","../src/engine-factory.ts"],"sourcesContent":["import type {IResolvedOperation} from '@configuration/types.ts';\n\n/**\n * This function can be used to find the index of a matching closing operation within a list of operations.\n *\n * Assume the following array of operations:\n * ```ts\n * [\n * {systemName:'name1'}, // index 0\n * {systemName:'forEach'}, // index 1\n * {systemName:'name2'}, // index 2\n * {systemName:'forEach'} // index 3\n * {systemName:'name3'} // index 4\n * {systemName:'endForEach'} // index 5\n * {systemName:'endForEach'} // index 6\n * {systemName:'name3'} // index 7\n * ]\n * ```\n *\n * Given the `forEach` instance at index 1, this function will return index 6. Given the `forEach` at index 3, it will yield index 5.\n *\n * Returns `true` when the given `operation.systemName` equals the specified `matchingName` and the current counter value is zero.\n *\n * If the `matchingName` matches `operation.systemName` but the counter is greater than zero, the counter is decremented.\n *\n * If the `operation.systemName` equals `self` (the name of the operation that requires to find its match), then counter is incremented.\n *\n * @param this\n * @param operation\n *\n */\nexport function findMatchingOperationIndex(\n this: {counter: number; self: string; matchingName: string},\n operation: IResolvedOperation\n) {\n if (operation.systemName === this.self) {\n this.counter = this.counter + 1;\n return false;\n }\n\n if (operation.systemName === this.matchingName && this.counter === 0) {\n return true;\n }\n\n if (operation.systemName === this.matchingName && this.counter > 0) {\n this.counter = this.counter - 1;\n }\n\n return false;\n}\n","/**\n /**\n * Gets the value for the given property chain. A property chain is defined by a string array.\n *\n * For example, this property chain: `[mySource, subSource, element, value]` should be extracted from an object of this shape:\n * ```ts\n * const foo = {\n * mySource: {\n * subSource: {\n * element: {\n * value: 'bar'\n * }\n * }\n * }\n * }\n * ```\n *\n * The result of the invocation `getPropertyChainValue([mySource, subSource, element, value], foo)` would then yield the value `bar`.\n */\nexport function getPropertyChainValue(\n propertyChain: string[],\n sourceObject: Record<string, any>\n) {\n let suffix = null;\n\n const result = propertyChain.reduce((currentInstance, prop, index) => {\n if (!currentInstance) {\n throw new Error(\n `Property chain '${propertyChain.join('.')}' cannot be resolved.`\n );\n }\n\n if (index === propertyChain.length - 1) {\n const parts = prop.split('+');\n if (parts.length > 1) {\n prop = parts[0];\n suffix = parts[1];\n }\n }\n return currentInstance[prop];\n }, sourceObject);\n\n return suffix ? `${result}${suffix}` : result;\n}\n","import {isDefined} from 'ts-is-present';\n\nconst copyFunction =\n typeof structuredClone !== 'undefined'\n ? structuredClone\n : <T>(original: any) => JSON.parse(JSON.stringify(original)) as T;\n\nexport function deepCopy<T>(original: T): T {\n if (isDefined(original)) {\n return copyFunction<T>(original);\n }\n return original;\n}\n","import {deepCopy} from '@operation/helper/deep-copy.ts';\nexport type TGlobalCache = Record<string, any>;\nconst cache: TGlobalCache = {};\n\nfunction _getGlobals(\n cache: TGlobalCache,\n name?: string\n): Record<string, any> | any {\n const value = name ? cache[name] : cache;\n return value && value !== cache ? deepCopy(value) : value;\n}\n\nfunction _setGlobals(cache: TGlobalCache, newValues: TGlobalCache): void {\n Object.entries(newValues).forEach(([name, value]) => (cache[name] = value));\n}\n\nfunction _clearGlobals(cache: TGlobalCache): void {\n const keys = Object.keys(cache);\n keys.forEach(key => delete cache[key]);\n}\n\nexport const getGlobals: (name?: string) => TGlobalCache | any =\n _getGlobals.bind(null, cache);\n\nexport const setGlobals: (newValues: TGlobalCache) => void = _setGlobals.bind(\n null,\n cache\n);\n\nexport const clearGlobals: () => void = _clearGlobals.bind(null, cache);\n","import {getPropertyChainValue} from '@operation/helper/get-property-chain-value.ts';\nimport {getGlobals} from '@operation/helper/globals.ts';\nimport type {IOperationScope, TOperationData} from '@operation/types.ts';\n\n/**\n * Resolves operation and global data property chains.\n *\n * An operation data property chain is designated by a `operationdata.` suffix, followed by an arbitrary property chain.\n * For global data the suffix should be `globaldata.`\n *\n * If the propertyChainOrRegularObject is not a property chain, this value is returned instead.\n */\nexport function resolveExternalPropertyChain(\n sourceObject: TOperationData,\n operationScope: IOperationScope,\n propertyChainOrRegularObject:\n | ExternalProperty\n | Record<string, any>\n | null\n | undefined\n) {\n if (\n propertyChainOrRegularObject === null ||\n propertyChainOrRegularObject === undefined\n ) {\n return null;\n }\n\n if (isExternalProperty(propertyChainOrRegularObject)) {\n const propNames = propertyChainOrRegularObject.split('.');\n const prefix = propNames.shift()!.toLowerCase();\n switch (prefix) {\n case '$operationdata':\n return getPropertyChainValue(propNames, sourceObject);\n case '$globaldata':\n return getPropertyChainValue(propNames, getGlobals());\n case '$scope':\n return getPropertyChainValue(propNames, operationScope);\n }\n }\n\n return propertyChainOrRegularObject;\n}\n\nexport function isExternalProperty(\n value: ExternalProperty | Record<string, any>\n): value is ExternalProperty {\n return (\n typeof value === 'string' &&\n (value.toLocaleLowerCase().startsWith('$operationdata.') ||\n value.toLocaleLowerCase().startsWith('$globaldata.') ||\n value.toLocaleLowerCase().startsWith('$scope.'))\n );\n}\n\nexport type ExternalProperty =\n | `$operationdata.${string}`\n | `$globaldata.${string}`\n | `$scope.${string}`;\n","import type {breakForEach} from '@operation/break-for-each.ts';\nimport type {continueForEach} from '@operation/continue-for-each.ts';\nimport {findMatchingOperationIndex} from '@operation/helper/find-matching-operation-index.ts';\nimport {\n type ExternalProperty,\n resolveExternalPropertyChain,\n} from '@operation/helper/resolve-external-property-chain.ts';\nimport type {IOperationScope, TOperation} from '@operation/types.ts';\n\nexport interface IForEachOperationData {\n /**\n * @type=ParameterType:array|ParameterType:string\n * @required\n */\n collection: unknown[] | string;\n}\n\n/**\n * This operation iterates over the given collection.\n *\n * Each iteration the current item from the specified collection is\n * assigned to the {@link IOperationScope.currentItem|currentItem} property on the {@link IOperationScope|operation scope}.\n *\n * At the start of the loop, the associated {@link endForEach} operation is determined and when\n * the last iteration is completed the flow control is set to the index of that operation.\n *\n * The {@link continueForEach|continue} and {@link breakForEach|break} operations can be used to control the\n * loop iterations.\n *\n * @category Control Flow\n */\nexport const forEach: TOperation<IForEachOperationData> = function (\n operationData: IForEachOperationData\n) {\n const {collection} = operationData;\n const resolvedCollection =\n typeof collection === 'string'\n ? (resolveExternalPropertyChain(\n operationData,\n this,\n collection as ExternalProperty\n ) as any[])\n : collection;\n\n if (\n resolvedCollection !== null &&\n resolvedCollection !== undefined &&\n !Array.isArray(resolvedCollection)\n ) {\n throw new Error(\n 'Expected resolved collection property to be array type, string value was probably not resolved correctly'\n );\n }\n\n // First iteration of the loop\n if (this.loopIndex === undefined) {\n this.loopEndIndex = findEndForEachIndex(this);\n if (resolvedCollection?.length) {\n this.loopIndex = 0;\n this.loopLength = resolvedCollection.length - 1;\n this.loopStartIndex = this.currentIndex;\n } else {\n this.newIndex = this.loopEndIndex;\n\n delete this.loopIndex;\n delete this.loopLength;\n delete this.loopStartIndex;\n delete this.loopEndIndex;\n }\n }\n\n if (resolvedCollection?.length && this.loopIndex !== undefined) {\n this.currentItem = resolvedCollection[this.loopIndex];\n }\n\n return operationData;\n};\n\nfunction findEndForEachIndex(scope: IOperationScope) {\n const currentIndex = scope.currentIndex + 1;\n const list = scope.operations.slice(currentIndex);\n\n const index = list.findIndex(\n findMatchingOperationIndex.bind({\n counter: 0,\n self: forEachSystemName,\n matchingName: endForEachSystemName,\n })\n );\n const endLoopIndex =\n index > -1 ? index + currentIndex : scope.operations.length;\n\n return endLoopIndex;\n}\n\nexport const forEachSystemName = 'forEach';\nexport const endForEachSystemName = 'endForEach';\n","/**\n * Removes specified properties from an operation data object.\n * This is a helper function to eliminate repetitive property deletion code across operations.\n *\n * @template T - The type of the operation data object\n * @template K - The keys to remove from the object (must be keys of T)\n * @param operationData - The operation data object to mutate\n * @param keys - The property keys to delete from the object\n * @returns The mutated operation data object with specified properties removed (typed as Omit<T, K>)\n *\n * @example\n * ```typescript\n * interface IMyOperationData {\n * selectedElement: JQuery;\n * animationDuration: number;\n * animationEasing: string;\n * }\n *\n * const data: IMyOperationData = {\n * selectedElement: $element,\n * animationDuration: 500,\n * animationEasing: 'ease-in'\n * };\n *\n * // Remove multiple properties at once\n * const result = removeProperties(data, 'animationDuration', 'animationEasing');\n * // result is typed as Omit<IMyOperationData, 'animationDuration' | 'animationEasing'>\n * // result = { selectedElement: $element }\n * ```\n */\nexport function removeProperties<T extends object, K extends keyof T>(\n operationData: T,\n ...keys: K[]\n): Omit<T, K> {\n for (const key of keys) {\n delete (operationData as any)[key];\n }\n return operationData as Omit<T, K>;\n}\n","import {findMatchingOperationIndex} from '@operation/helper/find-matching-operation-index.ts';\nimport {removeProperties} from '@operation/helper/remove-operation-properties.ts';\nimport {\n type ExternalProperty,\n resolveExternalPropertyChain,\n} from '@operation/helper/resolve-external-property-chain.ts';\nimport type {IOperationScope, TOperation} from '@operation/types.ts';\n\ntype TOperator = '!=' | '==' | '>=' | '<=' | '>' | '<';\ntype TValue =\n | `'${string}'`\n | number\n | `$operationdata.${string}`\n | `$globaldata.${string}`\n | `$scope.${string}`;\n\ntype TExpression = `${TValue}${TOperator}${TValue}`;\n\nexport interface IWhenOperationData {\n /**\n * @type=ParameterType:expression\n * @required\n * @erased\n */\n expression: TExpression;\n}\n\n/**\n * When the given expression evaluates to false, subsequent operations will be skipped\n * until an {@link endWhen} or {@link otherwise} operation is encountered.\n *\n * Practically, this means an `if` or `if`/`else` statement control flow implementation in a list of operations.\n *\n * The expression is passed in as a formatted string.\n * The left and right values of the expression can be defined like this:\n *\n * 'constant': for a constant string\n * 100: for a constant number\n * $operationData.foo: for an operation data value\n * $globaldata.foo: for a global data value\n * $scope.loopIndex: for a scope value\n * @foo: for a variable value\n *\n * @example\n * $scope.variables.foo=='bar'\n * @example\n * $globalData.foo>$scope.variables.bar\n * @example\n * $operationData.foo!=100\n *\n * @param operationData\n * @returns\n *\n * @category Control Flow\n */\nexport const when: TOperation<\n IWhenOperationData,\n Omit<IWhenOperationData, 'expression'>\n> = function (operationData: IWhenOperationData) {\n const [left, operator, right] = parseExpression(\n operationData.expression,\n operationData,\n this\n );\n\n removeProperties(operationData, 'expression');\n\n this.whenEvaluation = evaluations[operator](left, right);\n\n if (!this.whenEvaluation) {\n this.newIndex = findNextFlowControlIndex(this);\n }\n\n return operationData;\n};\n\nfunction parseExpression(\n expression: TExpression,\n operationData: IWhenOperationData,\n operationScope: IOperationScope\n): [TValue, TOperator, TValue] {\n const [left, right] = expression.split(/!=|==|>=|<=|>|</);\n\n const operator = expression.substring(\n left.length,\n expression.length - right.length\n ) as TOperator;\n\n const leftNr = parseFloat(left);\n const rightNr = parseFloat(right);\n\n return [\n (Number.isNaN(leftNr)\n ? resolveExternalPropertyChain(\n operationData,\n operationScope,\n left as ExternalProperty\n )\n : leftNr) as TValue,\n operator,\n (Number.isNaN(rightNr)\n ? resolveExternalPropertyChain(\n operationData,\n operationScope,\n right as ExternalProperty\n )\n : rightNr) as TValue,\n ];\n}\n\nconst evaluations: Record<\n TOperator,\n (left: string | number, right: string | number) => boolean\n> = {\n '==': (left: string | number, right: string | number) => left === right,\n '!=': (left: string | number, right: string | number) => left !== right,\n '>=': (left: string | number, right: string | number) => left >= right,\n '<=': (left: string | number, right: string | number) => left <= right,\n '>': (left: string | number, right: string | number) => left > right,\n '<': (left: string | number, right: string | number) => left < right,\n};\n\nfunction findNextFlowControlIndex(scope: IOperationScope) {\n const currentIndex = scope.currentIndex + 1;\n const list = scope.operations.slice(currentIndex);\n\n const otherWiseIndex = list.findIndex(\n findMatchingOperationIndex.bind({\n counter: 0,\n self: whenSystemName,\n matchingName: otherwiseSystemName,\n })\n );\n if (otherWiseIndex > -1) {\n return otherWiseIndex + currentIndex;\n }\n\n const endWhenIndex = list.findIndex(\n findMatchingOperationIndex.bind({\n counter: 0,\n self: whenSystemName,\n matchingName: endWhenSystemName,\n })\n );\n\n return endWhenIndex > -1\n ? endWhenIndex + currentIndex\n : scope.operations.length;\n}\n\nexport const whenSystemName = 'when';\nexport const otherwiseSystemName = 'otherwise';\nexport const endWhenSystemName = 'endWhen';\n","export function isPromise(obj: any): obj is Promise<unknown> {\n return typeof obj === 'object' && typeof obj.then === 'function';\n}\n","import type {IAction} from '@action/types.ts';\nimport type {IResolvedOperation} from '@configuration/types.ts';\nimport type {IEventbus} from '@eventbus/types.ts';\nimport {endForEachSystemName, forEachSystemName} from '@operation/for-each.ts';\nimport {deepCopy} from '@operation/helper/deep-copy.ts';\nimport type {IOperationScope, TOperationData} from '@operation/types.ts';\nimport {endWhenSystemName, whenSystemName} from '@operation/when.ts';\nimport {isPromise} from '@util/guards/is-promise.ts';\n\nexport class Action implements IAction {\n public id = '';\n protected _scopeStack: IOperationScope[] = [];\n\n constructor(\n public name: string,\n public startOperations: IResolvedOperation[],\n protected eventbus: IEventbus\n ) {}\n\n start(initOperationData?: TOperationData): Promise<TOperationData> {\n this._initializeScopeStack();\n\n return new Promise<TOperationData>((resolve, reject) => {\n this.executeOperation(\n this.startOperations,\n 0,\n resolve,\n reject,\n initOperationData\n );\n }).catch(e => {\n console.error(`Error in action start '${this.name}'`);\n console.error(e);\n throw e;\n });\n }\n\n protected _initializeScopeStack() {\n this._scopeStack = [\n {\n currentIndex: -1,\n eventbus: this.eventbus,\n operations: this.startOperations,\n },\n ];\n }\n\n private _pushScope(parentScope: IOperationScope): IOperationScope {\n const newScope = {\n get currentIndex() {\n return parentScope.currentIndex;\n },\n set currentIndex(value: number) {\n parentScope.currentIndex = value;\n },\n get eventbus() {\n return parentScope.eventbus;\n },\n get operations() {\n return parentScope.operations;\n },\n parent: parentScope,\n };\n this._scopeStack.push(newScope);\n return newScope;\n }\n\n private _popScope() {\n this._scopeStack.pop();\n }\n\n executeOperation(\n operations: IResolvedOperation[],\n operationIndex: number,\n resolve: (value?: any | PromiseLike<any>) => void,\n reject: (reason?: any) => void,\n previousOperationData: TOperationData | undefined = {}\n ): void {\n let scope = this._scopeStack[this._scopeStack.length - 1];\n if (scope.newIndex !== undefined) {\n operationIndex = scope.newIndex;\n delete scope.newIndex;\n }\n\n scope.currentIndex = operationIndex;\n\n if (operationIndex < operations.length) {\n const operationInfo = operations[operationIndex];\n\n const copy = deepCopy(operationInfo.operationData ?? {});\n\n const mergedOperationData = Object.assign(previousOperationData, copy);\n\n if (operationInfo.systemName === whenSystemName) {\n scope = this._pushScope(scope);\n } else if (\n operationInfo.systemName === forEachSystemName &&\n scope.owner !== operationInfo\n ) {\n scope = this._pushScope(scope);\n scope.owner = operationInfo;\n }\n\n const operationResult = operationInfo.instance.call(\n scope,\n mergedOperationData\n );\n\n if (\n operationInfo.systemName === endWhenSystemName ||\n (operationInfo.systemName === endForEachSystemName &&\n scope.newIndex === undefined)\n ) {\n this._popScope();\n }\n\n if (isPromise(operationResult)) {\n operationResult\n .then(promisedOperationResult =>\n this.executeOperation(\n operations,\n ++operationIndex,\n resolve,\n reject,\n promisedOperationResult as TOperationData\n )\n )\n .catch((error: any) => {\n reject(error);\n });\n } else {\n this.executeOperation(\n operations,\n ++operationIndex,\n resolve,\n reject,\n operationResult\n );\n }\n } else {\n resolve(previousOperationData);\n }\n }\n}\n","import {Action} from '@action/action.ts';\nimport type {IResolvedOperation} from '@configuration/types.ts';\nimport type {IEventbus} from '@eventbus/types.ts';\nimport type {TOperationData} from '@operation/types.ts';\n\nexport class EndableAction extends Action {\n constructor(\n name: string,\n startOperations: IResolvedOperation[],\n public endOperations: IResolvedOperation[],\n eventBus: IEventbus\n ) {\n super(name, startOperations, eventBus);\n }\n\n end(initOperationData?: TOperationData): Promise<TOperationData> {\n if (!this.endOperations.length) {\n return Promise.resolve(initOperationData ?? {});\n }\n\n this._initializeScopeStack();\n\n return new Promise<TOperationData>((resolve, reject) => {\n this.executeOperation(\n this.endOperations,\n 0,\n resolve,\n reject,\n initOperationData\n );\n }).catch(e => {\n console.error(`Error in action end '${this.name}'`);\n throw e;\n });\n }\n}\n","import {EndableAction} from '@action/endable-action.ts';\nimport type {ITimelineAction} from '@action/types.ts';\nimport type {IResolvedOperation} from '@configuration/types.ts';\nimport type {IEventbus} from '@eventbus/types.ts';\nimport type {TOperationData} from '@operation/types.ts';\nimport type {IStrictDuration} from '../types.ts';\n\nexport class TimelineAction extends EndableAction implements ITimelineAction {\n private _active: boolean = false;\n public get active() {\n return this._active;\n }\n\n constructor(\n name: string,\n startOperations: IResolvedOperation[],\n endOperations: IResolvedOperation[],\n public duration: IStrictDuration,\n eventBus: IEventbus\n ) {\n super(name, startOperations, endOperations, eventBus);\n }\n\n start(initOperationData?: TOperationData): Promise<TOperationData> {\n if (!this.active) {\n this._active = Boolean(this.endOperations.length);\n return super.start(initOperationData);\n }\n\n return Promise.resolve({});\n }\n\n end(initOperationData: TOperationData): Promise<TOperationData> {\n return super.end(initOperationData).then(result => {\n this._active = false;\n return result;\n });\n }\n}\n","import type {EventName, IEventbus, TEventbusRemover} from '@eventbus/types.ts';\nimport type {EngineEvents, IEligiusEngine} from '../types.ts';\nimport type {IAdapter} from './types.ts';\n\n/**\n * Bridges EligiusEngine to/from the eventbus.\n *\n * This adapter:\n * - Forwards engine events to eventbus broadcasts\n * - Forwards eventbus commands to engine methods\n * - Handles eventbus state queries by reading engine properties\n */\nexport class EngineEventbusAdapter implements IAdapter {\n private _engineEventRemovers: Array<() => void> = [];\n private _eventbusRemovers: TEventbusRemover[] = [];\n\n constructor(\n private _engine: IEligiusEngine,\n private _eventbus: IEventbus\n ) {}\n\n /**\n * Connect adapter - start listening and forwarding\n */\n connect(): void {\n this._subscribeToEngineEvents();\n this._subscribeToEventbusEvents();\n }\n\n /**\n * Disconnect adapter - stop all listeners\n */\n disconnect(): void {\n this._engineEventRemovers.forEach(remove => remove());\n this._engineEventRemovers = [];\n\n this._eventbusRemovers.forEach(remove => remove());\n this._eventbusRemovers = [];\n }\n\n // ─────────────────────────────────────────────────────────────────────────\n // Engine Events → Eventbus Broadcasts\n // ─────────────────────────────────────────────────────────────────────────\n\n private _subscribeToEngineEvents(): void {\n this._onEngineEvent('start', () => {\n this._eventbus.broadcast('timeline-play', []);\n });\n\n this._onEngineEvent('pause', () => {\n this._eventbus.broadcast('timeline-pause', []);\n });\n\n this._onEngineEvent('stop', () => {\n this._eventbus.broadcast('timeline-stop', []);\n });\n\n this._onEngineEvent('time', (position: number) => {\n this._eventbus.broadcast('timeline-time', [position]);\n });\n\n this._onEngineEvent('duration', (duration: number) => {\n this._eventbus.broadcast('timeline-duration', [() => duration]);\n });\n\n this._onEngineEvent(\n 'seekStart',\n (target: number, current: number, duration: number) => {\n this._eventbus.broadcast('timeline-seek', [target, current, duration]);\n }\n );\n\n this._onEngineEvent(\n 'seekComplete',\n (position: number, duration: number) => {\n this._eventbus.broadcast('timeline-seeked', [position, duration]);\n }\n );\n\n this._onEngineEvent('timelineChange', (uri: string) => {\n this._eventbus.broadcast('timeline-current-timeline-change', [uri]);\n });\n\n this._onEngineEvent('timelineComplete', () => {\n this._eventbus.broadcast('timeline-complete', []);\n });\n\n this._onEngineEvent('timelineFirstFrame', () => {\n this._eventbus.broadcast('timeline-firstframe', []);\n });\n\n this._onEngineEvent('timelineRestart', () => {\n this._eventbus.broadcast('timeline-restart', []);\n });\n }\n\n private _onEngineEvent<K extends keyof EngineEvents>(\n event: K,\n handler: (...args: EngineEvents[K]) => void\n ): void {\n const remover = this._engine.on(event, handler);\n this._engineEventRemovers.push(remover);\n }\n\n // ─────────────────────────────────────────────────────────────────────────\n // Eventbus Commands → Engine Methods\n // ─────────────────────────────────────────────────────────────────────────\n\n private _subscribeToEventbusEvents(): void {\n // Playback commands\n this._onEventbusEvent('timeline-play-request', () => {\n this._engine.start();\n });\n\n this._onEventbusEvent('timeline-pause-request', () => {\n this._engine.pause();\n });\n\n this._onEventbusEvent('timeline-stop-request', () => {\n this._engine.stop();\n });\n\n this._onEventbusEvent('timeline-seek-request', (position: number) => {\n this._engine.seek(position);\n });\n\n this._onEventbusEvent('timeline-play-toggle-request', () => {\n if (this._engine.playState === 'playing') {\n this._engine.pause();\n } else {\n this._engine.start();\n }\n });\n\n // Timeline management\n this._onEventbusEvent(\n 'request-timeline-uri',\n (uri: string, position: number = 0) => {\n this._engine.switchTimeline(uri, position);\n }\n );\n\n // State queries - using onRequest for synchronous responses\n this._registerRequest('request-current-timeline-position', () => {\n return this._engine.position;\n });\n\n this._registerRequest('timeline-duration-request', () => {\n return this._engine.duration;\n });\n\n this._registerRequest('timeline-container-request', () => {\n return this._engine.container;\n });\n\n this._registerRequest('request-engine-root', () => {\n return this._engine.engineRoot;\n });\n\n this._registerRequest('timeline-request-current-timeline', () => {\n return this._engine.currentTimelineUri;\n });\n }\n\n private _onEventbusEvent(\n eventName: EventName,\n handler: (...args: any[]) => void\n ): void {\n const remover = this._eventbus.on(eventName, handler);\n this._eventbusRemovers.push(remover);\n }\n\n private _registerRequest<T>(\n eventName: string,\n responder: (...args: any[]) => T\n ): void {\n const remover = this._eventbus.onRequest(eventName, responder);\n this._eventbusRemovers.push(remover);\n }\n}\n","import type {IEventbus, TEventbusRemover} from '@eventbus/types.ts';\nimport hk, {type HotkeysEvent} from 'hotkeys-js';\nimport type {IEligiusEngine} from '../types.ts';\nimport type {IAdapter} from './types.ts';\n\nconst hotkeys = hk.default || hk;\n\n/**\n * Handles external input sources (hotkeys, resize).\n *\n * This adapter:\n * - Registers keyboard hotkeys (space for play/pause toggle)\n * - Handles window resize events with debouncing\n */\nexport class EngineInputAdapter implements IAdapter {\n private _removers: Array<TEventbusRemover | (() => void)> = [];\n private _resizeTimeout: ReturnType<typeof setTimeout> | undefined;\n private _resizeHandler: (() => void) | undefined;\n\n constructor(\n private _engine: IEligiusEngine,\n private _eventbus: IEventbus,\n private _windowRef: Window\n ) {}\n\n /**\n * Connect adapter - start listening to inputs\n */\n connect(): void {\n this._registerHotkeys();\n this._registerResizeHandler();\n }\n\n /**\n * Disconnect adapter - stop all listeners\n */\n disconnect(): void {\n if (this._resizeTimeout) {\n clearTimeout(this._resizeTimeout);\n this._resizeTimeout = undefined;\n }\n\n this._removers.forEach(remove => remove());\n this._removers = [];\n }\n\n // ─────────────────────────────────────────────────────────────────────────\n // Hotkey Handling\n // ─────────────────────────────────────────────────────────────────────────\n\n private _registerHotkeys(): void {\n const handleSpaceBound = this._handleSpacePress.bind(this);\n hotkeys('space', handleSpaceBound);\n this._removers.push(() => hotkeys.unbind('space', handleSpaceBound));\n }\n\n private _handleSpacePress(\n keyboardEvent: KeyboardEvent,\n _hotkeysEvent: HotkeysEvent\n ): void | boolean {\n keyboardEvent.preventDefault();\n\n if (this._engine.playState === 'playing') {\n this._engine.pause();\n } else {\n this._engine.start();\n }\n\n return false;\n }\n\n // ─────────────────────────────────────────────────────────────────────────\n // Resize Handling\n // ─────────────────────────────────────────────────────────────────────────\n\n private _registerResizeHandler(): void {\n this._resizeHandler = this._handleResize.bind(this);\n this._windowRef.addEventListener('resize', this._resizeHandler);\n this._removers.push(() => {\n if (this._resizeHandler) {\n this._windowRef.removeEventListener('resize', this._resizeHandler);\n }\n });\n }\n\n private _handleResize(): void {\n if (this._resizeTimeout) {\n clearTimeout(this._resizeTimeout);\n this._resizeTimeout = undefined;\n }\n\n this._resizeTimeout = setTimeout(() => {\n this._eventbus.broadcast('timeline-resize', []);\n }, 200);\n }\n}\n","import type {EventName, IEventbus, TEventbusRemover} from '@eventbus/types.ts';\nimport type {\n IEligiusEngine,\n ILabel,\n ILanguageManager,\n LanguageEvents,\n TLanguageCode,\n} from '../types.ts';\nimport type {IAdapter} from './types.ts';\n\n/**\n * Bridges LanguageManager to/from the eventbus.\n *\n * This adapter:\n * - Forwards language manager events to eventbus broadcasts\n * - Forwards eventbus language commands to language manager methods\n * - Handles eventbus state queries by reading language manager properties\n * - Updates DOM lang attribute when language changes\n *\n * Note: Requires engine reference to update DOM lang attribute on language change\n */\nexport class LanguageEventbusAdapter implements IAdapter {\n private _languageEventRemovers: Array<() => void> = [];\n private _eventbusRemovers: TEventbusRemover[] = [];\n\n constructor(\n private _languageManager: ILanguageManager,\n private _eventbus: IEventbus,\n private _engine: IEligiusEngine\n ) {}\n\n /**\n * Connect adapter - start listening and forwarding\n */\n connect(): void {\n this._subscribeToLanguageManagerEvents();\n this._subscribeToEventbusEvents();\n }\n\n /**\n * Disconnect adapter - stop all listeners\n */\n disconnect(): void {\n this._languageEventRemovers.forEach(remove => remove());\n this._languageEventRemovers = [];\n\n this._eventbusRemovers.forEach(remove => remove());\n this._eventbusRemovers = [];\n }\n\n // ─────────────────────────────────────────────────────────────────────────\n // LanguageManager Events → Eventbus Broadcasts\n // ─────────────────────────────────────────────────────────────────────────\n\n private _subscribeToLanguageManagerEvents(): void {\n this._onLanguageEvent(\n 'change',\n (language: TLanguageCode, _previousLanguage: TLanguageCode) => {\n this._setRootElementLang(language);\n this._eventbus.broadcast('language-change', [language]);\n }\n );\n }\n\n private _onLanguageEvent<K extends keyof LanguageEvents>(\n event: K,\n handler: (...args: LanguageEvents[K]) => void\n ): void {\n const remover = this._languageManager.on(event, handler);\n this._languageEventRemovers.push(remover);\n }\n\n // ─────────────────────────────────────────────────────────────────────────\n // Eventbus Commands → LanguageManager Methods\n // ─────────────────────────────────────────────────────────────────────────\n\n private _subscribeToEventbusEvents(): void {\n // Language change command\n this._onEventbusEvent('language-change', (language: TLanguageCode) => {\n this._languageManager.setLanguage(language);\n this._setRootElementLang(language);\n });\n\n // State queries - using onRequest for synchronous responses\n this._registerRequest('request-current-language', () => {\n return this._languageManager.language;\n });\n\n this._registerRequest(\n 'request-label-collection',\n (labelId: string): ILabel[] | undefined => {\n return this._languageManager.getLabelCollection(labelId);\n }\n );\n\n this._registerRequest(\n 'request-label-collections',\n (labelIds: string[]): (ILabel[] | undefined)[] => {\n return this._languageManager.getLabelCollections(labelIds);\n }\n );\n }\n\n private _onEventbusEvent(\n eventName: EventName,\n handler: (...args: any[]) => void\n ): void {\n const remover = this._eventbus.on(eventName, handler);\n this._eventbusRemovers.push(remover);\n }\n\n private _registerRequest<T>(\n eventName: string,\n responder: (...args: any[]) => T\n ): void {\n const remover = this._eventbus.onRequest(eventName, responder);\n this._eventbusRemovers.push(remover);\n }\n\n // ─────────────────────────────────────────────────────────────────────────\n // DOM Updates\n // ─────────────────────────────────────────────────────────────────────────\n\n private _setRootElementLang(language: TLanguageCode): void {\n const lang = this._extractPrimaryLanguage(language);\n this._engine.engineRoot.attr('lang', lang);\n }\n\n private _extractPrimaryLanguage(culture: TLanguageCode): string {\n return culture.split('-').shift() as string;\n }\n}\n","import type {TOperation} from '@operation/types.ts';\n\nexport interface IAddClassOperationData {\n /**\n * @dependency\n */\n selectedElement: JQuery;\n /**\n * @type=ParameterType:className\n * @required\n * @erased\n */\n className: string;\n}\n\n/**\n * This operation adds the specified class name to the specified selected element.\n *\n * @category DOM\n */\nexport const addClass: TOperation<\n IAddClassOperationData,\n Omit<IAddClassOperationData, 'className'>\n> = operationData => {\n const {selectedElement, className} = operationData;\n delete (operationData as any).className;\n selectedElement.addClass(className);\n\n return operationData;\n};\n","import type {IController} from '@controllers/types.ts';\n\nconst controllersDataName = 'eligiusEngineControllers';\n\nfunction getElementData(\n name: string,\n element: JQuery\n): IController<any>[] | undefined {\n return element.data(name);\n}\n\nconst getElementControllers = getElementData.bind(null, controllersDataName);\n\nexport {getElementData, getElementControllers, controllersDataName};\n","import {\n controllersDataName,\n getElementControllers,\n} from '@operation/helper/get-element-data.ts';\n\nexport function attachControllerToElement(element: JQuery, controller: any) {\n if (!element.data(controllersDataName)) {\n element.data(controllersDataName, []);\n }\n const controllers = getElementControllers(element);\n if (controllers) {\n controllers.push(controller);\n }\n}\n","import type {TOperationData} from '@operation/types.ts';\n\nexport function mergeOperationData<T extends TOperationData>(\n operationData: T,\n newOperationData: TOperationData\n): T & TOperationData {\n return {...operationData, ...newOperationData};\n}\n","import {mergeOperationData} from '@operation/helper/merge-operation-data.ts';\nimport type {TOperationData} from '@operation/types.ts';\n\nexport function internalResolve<T extends TOperationData = TOperationData>(\n resolve: (data: T | PromiseLike<T>) => void,\n operationData: TOperationData,\n newOperationData?: TOperationData\n) {\n if (newOperationData) {\n resolve(mergeOperationData(operationData, newOperationData) as T);\n } else {\n resolve(operationData as T);\n }\n}\n","import type {IController} from '@controllers/types.ts';\nimport {attachControllerToElement} from '@operation/helper/attach-controller-to-element.ts';\nimport {internalResolve} from '@operation/helper/internal-resolve.ts';\nimport type {\n IOperationScope,\n TOperation,\n TOperationData,\n} from '@operation/types.ts';\n\nexport type IAddControllerToElementOperationData<\n T extends TOperationData = TOperationData,\n> = {\n /**\n * @dependency\n */\n selectedElement: JQuery;\n /**\n * @dependency\n */\n controllerInstance: IController<T>;\n} & T;\n\n/**\n * This operation adds the specified controller instance to the given selected element.\n *\n * @category Controller\n */\nexport const addControllerToElement: TOperation<IAddControllerToElementOperationData> =\n function <T extends TOperationData = TOperationData>(\n this: IOperationScope,\n operationData: IAddControllerToElementOperationData<T>\n ) {\n const {selectedElement, controllerInstance} = operationData;\n\n attachControllerToElement(selectedElement, controllerInstance);\n\n controllerInstance.init(operationData);\n\n const promise = controllerInstance.attach(this.eventbus);\n\n if (promise) {\n return new Promise((resolve, reject) => {\n promise.then((newOperationData: TOperationData) => {\n internalResolve(resolve, operationData, newOperationData);\n }, reject);\n });\n } else {\n return operationData;\n }\n };\n","import {getGlobals} from '@operation/helper/globals.ts';\nimport {removeProperties} from '@operation/helper/remove-operation-properties.ts';\nimport type {TOperation} from '@operation/types.ts';\n\nexport interface IAddGlobalsToOperationData {\n /**\n * The names of the global properties that will be copied onto the current operation data\n *\n * @required\n * @erased\n */\n globalProperties: string[];\n}\n\n/**\n * This operation adds the specified global property names to the current operation data.\n * It finally removes the `globalProperties` property from the current operation data.\n *\n * @category Data\n */\nexport const addGlobalsToOperation: TOperation<\n IAddGlobalsToOperationData,\n Omit<IAddGlobalsToOperationData, 'globalProperties'>\n> = (operationData: IAddGlobalsToOperationData) => {\n const {globalProperties} = operationData;\n\n const globalValues = globalProperties.reduce<Record<string, any>>(\n (prev, current) => {\n prev[current] = getGlobals(current);\n return prev;\n },\n {}\n );\n removeProperties(operationData, 'globalProperties');\n\n return Object.assign(operationData, globalValues);\n};\n","import {internalResolve} from '@operation/helper/internal-resolve.ts';\nimport {removeProperties} from '@operation/helper/remove-operation-properties.ts';\nimport type {TOperation} from '@operation/types.ts';\n\nexport interface IAnimateOperationData {\n /**\n * @type=ParameterType:boolean\n * @erased\n */\n animationEasing?: string;\n /**\n * @dependency\n */\n selectedElement: JQuery;\n /**\n * @required\n * @erased\n */\n animationProperties: Record<string, unknown>;\n /**\n * @type=ParameterType:number\n * @required\n * @erased\n */\n animationDuration: JQuery.Duration;\n}\n\n/**\n * This operation animates the specified selected element with the given [jQuery animation](https://api.jquery.com/animate/) properties, duration and easing.\n * It resolves after the animation completes.\n *\n * @param operationData\n * @returns\n *\n * @category Animation\n */\nexport const animate: TOperation<\n IAnimateOperationData,\n Omit<\n IAnimateOperationData,\n 'animationEasing' | 'animationProperties' | 'animationDuration'\n >\n> = (operationData: IAnimateOperationData) => {\n const {\n selectedElement,\n animationEasing,\n animationProperties,\n animationDuration,\n } = operationData;\n\n removeProperties(\n operationData,\n 'animationEasing',\n 'animationProperties',\n 'animationDuration'\n );\n\n const promise = new Promise<IAnimateOperationData>((resolve, reject) => {\n try {\n if (animationEasing) {\n selectedElement.animate(\n animationProperties,\n animationDuration,\n animationEasing,\n () => {\n internalResolve(resolve, {}, operationData);\n }\n );\n } else {\n selectedElement.animate(animationProperties, animationDuration, () => {\n internalResolve(resolve, {}, operationData);\n });\n }\n } catch (e) {\n reject(e);\n }\n });\n return promise;\n};\n","import {internalResolve} from '@operation/helper/internal-resolve.ts';\nimport type {TOperation} from '@operation/types.ts';\n\nexport interface IAnimateWithClassOperationData {\n /**\n * @dependency\n */\n selectedElement: JQuery;\n /**\n * @type=ParameterType:className\n * @required\n */\n className: string;\n removeClass?: boolean;\n}\n\n/**\n * This operation adds the specified class name to the specified selected element and assumes that this\n * class triggers and animation on the selected element. It then waits for this animation to complete\n * before it resolves.\n *\n * @category Animation\n */\nexport const animateWithClass: TOperation<\n IAnimateWithClassOperationData,\n Promise<IAnimateWithClassOperationData>\n> = (operationData: IAnimateWithClassOperationData) => {\n let {selectedElement, className, removeClass} = operationData;\n removeClass = removeClass !== undefined ? removeClass : true;\n\n const promise = new Promise<IAnimateWithClassOperationData>(\n (resolve, reject) => {\n try {\n selectedElement.one(\n 'webkitAnimationEnd oanimationend oAnimationEnd msAnimationEnd animationEnd',\n () => {\n if (removeClass) {\n selectedElement.removeClass(className);\n }\n internalResolve(resolve, {}, operationData);\n }\n );\n } catch (e) {\n reject(e);\n }\n }\n );\n\n selectedElement.addClass(className);\n\n return promise;\n};\n","import {removeProperties} from '@operation/helper/remove-operation-properties.ts';\nimport type {TOperation} from '@operation/types.ts';\n\nexport interface IAnnounceToScreenReaderOperationData {\n /**\n * @required\n * @erased\n */\n message: string;\n /**\n * @optional\n * @erased\n */\n priority?: 'polite' | 'assertive';\n}\n\n/**\n * Announces a message to screen readers using an ARIA live region.\n *\n * @category Accessibility\n */\nexport const announceToScreenReader: TOperation<\n IAnnounceToScreenReaderOperationData,\n Omit<IAnnounceToScreenReaderOperationData, 'message' | 'priority'>\n> = (operationData: IAnnounceToScreenReaderOperationData) => {\n const {message, priority = 'polite'} = operationData;\n\n if (!message || message.trim() === '') {\n throw new Error('announceToScreenReader: message is required');\n }\n\n // Create or get existing live region\n let liveRegion = document.getElementById('aria-live-region');\n if (!liveRegion) {\n liveRegion = document.createElement('div');\n liveRegion.id = 'aria-live-region';\n liveRegion.setAttribute('aria-live', priority);\n liveRegion.style.position = 'absolute';\n liveRegion.style.left = '-10000px';\n liveRegion.style.width = '1px';\n liveRegion.style.height = '1px';\n liveRegion.style.overflow = 'hidden';\n document.body.appendChild(liveRegion);\n } else {\n liveRegion.setAttribute('aria-live', priority);\n }\n\n liveRegion.textContent = message;\n\n removeProperties(operationData, 'message', 'priority');\n\n return operationData;\n};\n","import type {endForEach} from '@operation/end-for-each.ts';\nimport type {forEach} from '@operation/for-each.ts';\nimport type {TOperation, TOperationData} from '@operation/types.ts';\n\n/**\n *\n * This operation should only be used within a loop, so between a {@link forEach} and {@link endForEach}\n * operation. This operation immediately moves to the loop end index, effectively stopping the loop.\n *\n * @category Control Flow\n */\nexport const breakForEach: TOperation<TOperationData> = function (\n operationData: TOperationData\n) {\n if (this.loopIndex !== undefined && this.loopLength !== undefined) {\n this.newIndex = this.loopEndIndex;\n\n delete this.loopIndex;\n delete this.loopLength;\n delete this.loopStartIndex;\n delete this.loopEndIndex;\n delete this.currentItem;\n }\n return operationData;\n};\n","import {resolveExternalPropertyChain} from '@operation/helper/resolve-external-property-chain.ts';\nimport type {IOperationScope, TOperationData} from '@operation/types.ts';\n\nexport function resolveEventArguments(\n operationData: TOperationData,\n operationScope: IOperationScope,\n eventArgs?: any[]\n) {\n if (!eventArgs) {\n return;\n }\n const resolve = resolveExternalPropertyChain.bind(\n null,\n operationData,\n operationScope\n );\n return eventArgs.map(resolve);\n}\n","import type {EventName} from '@eventbus/types.ts';\nimport {removeProperties} from '@operation/helper/remove-operation-properties.ts';\nimport {resolveEventArguments} from '@operation/helper/resolve-event-arguments.ts';\nimport type {TOperation} from '@operation/types.ts';\n\nexport interface IBroadcastEventOperationData {\n /**\n * @required\n * @erased\n */\n eventArgs: unknown[];\n /**\n * @type=ParameterType:eventTopic\n * @erased\n */\n eventTopic?: string;\n /**\n * @type=ParameterType:eventName\n * @required\n * @erased\n */\n eventName: string;\n}\n\n/**\n * This operation broadcasts the given event through the eventbus, along with the\n * event arguments and optional event topic.\n *\n * @category Utility\n */\nexport const broadcastEvent: TOperation<\n IBroadcastEventOperationData,\n Omit<IBroadcastEventOperationData, 'eventArgs' | 'eventTopic' | 'eventName'>\n> = function (operationData: IBroadcastEventOperationData) {\n const {eventArgs, eventTopic, eventName} = operationData;\n\n removeProperties(operationData, 'eventArgs', 'eventTopic', 'eventName');\n\n const eventArguments = resolveEventArguments(operationData, this, eventArgs);\n if (eventTopic) {\n this.eventbus.broadcastForTopic(\n eventName as EventName,\n eventTopic,\n eventArguments as any\n );\n } else {\n this.eventbus.broadcast(eventName as EventName, eventArguments as any);\n }\n\n return operationData;\n};\n","export function isObject(\n value: unknown\n): value is Record<PropertyKey, unknown> {\n return !!value && typeof value === 'object' && !Array.isArray(value);\n}\n","import {deepCopy} from '@operation/helper/deep-copy.ts';\nimport type {ExternalProperty} from '@operation/helper/resolve-external-property-chain.ts';\nimport {\n isExternalProperty,\n resolveExternalPropertyChain,\n} from '@operation/helper/resolve-external-property-chain.ts';\nimport type {IOperationScope, TOperationData} from '@operation/types.ts';\nimport {isObject} from '@util/guards/is-object.ts';\nimport $ from 'jquery';\n\nconst cache: any[] = [];\n\n/**\n * This takes a `newProperties` instance, resolves all of the properties on this object and then\n * assigns these properties to the given operationData.\n */\nexport function resolvePropertyValues<T extends TOperationData>(\n operationData: T,\n operationScope: IOperationScope,\n newProperties: Record<string, any>\n): T {\n const copy =\n newProperties !== operationData ? deepCopy(newProperties) : newProperties;\n\n const resolvePropertyChain = resolveExternalPropertyChain.bind(\n null,\n operationData,\n operationScope\n );\n\n resolveNewProperties(newProperties, copy, resolvePropertyChain);\n\n return copy as T;\n}\n\nfunction resolveNewProperties(\n properties: Record<string, any>,\n copy: Record<string, any>,\n resolvePropertyChain: (\n propertyChain: ExternalProperty | Record<string, any>\n ) => any\n) {\n // Prevent recursive looping\n if (cache.indexOf(properties) > -1) {\n return;\n }\n\n cache.push(properties);\n\n try {\n Object.entries(properties).forEach(([key, value]) => {\n if (value instanceof $) {\n return;\n }\n\n if (isExternalProperty(value)) {\n copy[key] = resolvePropertyChain(value);\n } else if (Array.isArray(value)) {\n value.forEach((item, index, arr) => {\n if (isExternalProperty(item)) {\n arr[index] = resolvePropertyChain(item);\n } else if (isObject(item)) {\n resolveNewProperties(item, item, resolvePropertyChain);\n }\n });\n } else if (isObject(value)) {\n resolveNewProperties(value, value, resolvePropertyChain);\n } else {\n copy[key] = value;\n }\n });\n } finally {\n const index = cache.indexOf(properties);\n cache.splice(index, 1);\n }\n}\n","import {removeProperties} from '@operation/helper/remove-operation-properties.ts';\nimport {resolvePropertyValues} from '@operation/helper/resolve-property-values.ts';\nimport type {TOperation} from '@operation/types.ts';\n\nexport type TCalculationOperator = '+' | '-' | '*' | '/' | '%' | '**';\n\nexport interface ICalcOperationData {\n /**\n * The left operand\n * @type=ParameterType:number\n * @required\n * @erased\n */\n left: string | number;\n /**\n * The right operand\n * @type=ParameterType:number\n * @required\n * @erased\n */\n right: string | number;\n /**\n * @required\n * @erased\n */\n operator: TCalculationOperator;\n /**\n * @output\n */\n calculationResult?: number;\n}\n\nconst calcFunctions: Record<\n TCalculationOperator,\n (left: number, right: number) => number\n> = {\n '+': (left: number, right: number) => left + right,\n '-': (left: number, right: number) => left - right,\n '*': (left: number, right: number) => left * right,\n '/': (left: number, right: number) => left / right,\n '%': (left: number, right: number) => left % right,\n '**': (left: number, right: number) => left ** right,\n};\n\n/**\n * This operation calculates the given left and right hand operands using the specified operator.\n *\n * @param operationData\n *\n * @category Utility\n */\nexport const calc: TOperation<\n ICalcOperationData,\n Omit<ICalcOperationData, 'left' | 'right' | 'operator'>\n> = function (operationData: ICalcOperationData) {\n operationData = resolvePropertyValues(operationData, this, operationData);\n\n const {left, right, operator} = operationData;\n\n removeProperties(operationData, 'left', 'right', 'operator');\n\n operationData.calculationResult = calcFunctions[operator](+left, +right);\n\n return operationData;\n};\n","import type {TOperation} from '@operation/types.ts';\n\nexport interface IClearElementOperationData {\n /**\n * @dependency\n */\n selectedElement: JQuery;\n}\n\n/**\n * This operation removes all of the children from the given selected element.\n *\n * @category DOM\n */\nexport const clearElement: TOperation<IClearElementOperationData> = (\n operationData: IClearElementOperationData\n) => {\n const {selectedElement} = operationData;\n selectedElement.empty();\n return operationData;\n};\n","import {removeProperties} from '@operation/helper/remove-operation-properties.ts';\nimport type {TOperation} from '@operation/types.ts';\n\nexport interface IClearOperationDataOperationData {\n /**\n * @erased\n */\n properties?: string[];\n}\n\n/**\n * This operation removes all of the properties on the current operation date.\n * Or, if the `properties` property is set only removes the properties defined by that list.\n *\n * @category Data\n */\nexport const clearOperationData: TOperation<\n IClearOperationDataOperationData,\n Omit<IClearOperationDataOperationData, 'properties'>\n> = (operationData: IClearOperationDataOperationData) => {\n const {properties} = operationData;\n\n if (properties) {\n properties.forEach(name => {\n delete (operationData as any)[name];\n });\n removeProperties(operationData, 'properties');\n return operationData;\n }\n\n return {};\n};\n","import {removeProperties} from '@operation/helper/remove-operation-properties.ts';\nimport type {TOperation} from '@operation/types.ts';\n\nexport type StorageType = 'local' | 'session';\n\nexport interface IClearStorageOperationData {\n /**\n * @optional\n * @erased\n */\n key?: string;\n /**\n * @required\n * @erased\n */\n storageType: StorageType;\n}\n\n/**\n * Clears data from browser storage (localStorage or sessionStorage).\n *\n * If `key` is provided, removes only that key. If `key` is omitted, clears all storage.\n *\n * @returns Operation data with storage properties erased\n *\n * @example\n * ```typescript\n * // Clear specific key\n * const result = clearStorage({\n * key: 'user-settings',\n * storageType: 'local'\n * });\n * ```\n *\n * @example\n * ```typescript\n * // Clear all localStorage\n * const result = clearStorage({\n * storageType: 'local'\n * });\n * ```\n *\n * @category Data\n */\nexport const clearStorage: TOperation<\n IClearStorageOperationData,\n Omit<IClearStorageOperationData, 'key' | 'storageType'>\n> = (operationData: IClearStorageOperationData) => {\n const {key, storageType} = operationData;\n\n const storage = storageType === 'session' ? sessionStorage : localStorage;\n\n if (key && key.trim() !== '') {\n storage.removeItem(key);\n } else {\n storage.clear();\n }\n\n removeProperties(operationData, 'key', 'storageType');\n\n return operationData;\n};\n","import {removeProperties} from '@operation/helper/remove-operation-properties.ts';\nimport type {TOperation} from '@operation/types.ts';\n\nexport interface ICompareDateOperationData {\n /**\n * @required\n * @erased\n */\n date1: Date | string | number;\n /**\n * @required\n * @erased\n */\n date2: Date | string | number;\n /**\n * @output\n */\n comparison: number;\n /**\n * @output\n */\n isEqual: boolean;\n /**\n * @output\n */\n isBefore: boolean;\n /**\n * @output\n */\n isAfter: boolean;\n}\n\n/**\n * Compares two dates.\n * comparison: -1 (before), 0 (equal), 1 (after)\n *\n * @category Date\n */\nexport const compareDate: TOperation<\n ICompareDateOperationData,\n Omit<ICompareDateOperationData, 'date1' | 'date2'>\n> = (operationData: ICompareDateOperationData) => {\n const {date1, date2} = operationData;\n\n if (!date1 || !date2) {\n throw new Error('compareDate: both dates are required');\n }\n\n const dateObj1 = date1 instanceof Date ? date1 : new Date(date1);\n const dateObj2 = date2 instanceof Date ? date2 : new Date(date2);\n\n if (Number.isNaN(dateObj1.getTime()) || Number.isNaN(dateObj2.getTime())) {\n throw new Error('compareDate: invalid date');\n }\n\n const time1 = dateObj1.getTime();\n const time2 = dateObj2.getTime();\n\n operationData.comparison = time1 < time2 ? -1 : time1 > time2 ? 1 : 0;\n operationData.isEqual = time1 === time2;\n operationData.isBefore = time1 < time2;\n operationData.isAfter = time1 > time2;\n\n removeProperties(operationData, 'date1', 'date2');\n\n return operationData;\n};\n","import {removeProperties} from '@operation/helper/remove-operation-properties.ts';\nimport type {TOperation} from '@operation/types.ts';\n\nexport interface IConcatenateStringsOperationData {\n /**\n * @required\n * @erased\n */\n strings: string[];\n /**\n * @optional\n * @erased\n */\n separator?: string;\n /**\n * @output\n */\n result: string;\n}\n\n/**\n * Concatenates multiple strings with an optional separator.\n *\n * @returns Operation data with `result` containing the concatenated string\n *\n * @example\n * ```typescript\n * const result = concatenateStrings({\n * strings: ['Hello', 'World'],\n * separator: ' '\n * });\n * // result.result = \"Hello World\"\n * ```\n *\n * @category String\n */\nexport const concatenateStrings: TOperation<\n IConcatenateStringsOperationData,\n Omit<IConcatenateStringsOperationData, 'strings' | 'separator'>\n> = (operationData: IConcatenateStringsOperationData) => {\n const {strings, separator = ''} = operationData;\n\n if (!Array.isArray(strings)) {\n throw new Error('concatenateStrings: strings must be an array');\n }\n\n operationData.result = strings.join(separator);\n\n removeProperties(operationData, 'strings', 'separator');\n\n return operationData;\n};\n","import type {endForEach} from '@operation/end-for-each.ts';\nimport type {forEach} from '@operation/for-each.ts';\nimport type {TOperation, TOperationData} from '@operation/types.ts';\n\n/**\n *\n * This operation should only be used within a loop, so between a {@link forEach} and {@link endForEach}\n * operation. This operation immediately moves to the next loop index, effectively canceling the rest\n * of the operations in the current iteration.\n *\n * @category Control Flow\n */\nexport const continueForEach: TOperation<TOperationData> = function (\n operationData: TOperationData\n) {\n if (this.loopIndex !== undefined && this.loopLength !== undefined) {\n this.newIndex = this.loopEndIndex;\n delete this.currentItem;\n }\n return operationData;\n};\n","import {removeProperties} from '@operation/helper/remove-operation-properties.ts';\nimport {resolvePropertyValues} from '@operation/helper/resolve-property-values.ts';\nimport type {IOperationScope, TOperation} from '@operation/types.ts';\nimport $ from 'jquery';\nimport type {RequireKeys} from '@/types.ts';\n\nexport type TTagNames = keyof HTMLElementTagNameMap;\n\nexport interface ICreateElementOperationData<T extends TTagNames> {\n /**\n * @type=ParameterType:htmlElementName\n * @required\n * @erased\n */\n elementName: T;\n /**\n * @erased\n */\n text?: string;\n /**\n * @type=ParameterType:object\n * @erased\n */\n attributes?: Partial<HTMLElementTagNameMap[T]>;\n /**\n * @type=ParameterType:object\n * @output\n */\n template?: JQuery;\n}\n\n/**\n * This operation creates the DOM element described by the given elementName and attributes and assigns\n * the instance to the `template` property on the current operation data.\n *\n * @param operationData\n * @returns\n * @category DOM\n */\nexport const createElement: TOperation<\n ICreateElementOperationData<TTagNames>,\n Omit<\n RequireKeys<ICreateElementOperationData<TTagNames>, 'template'>,\n 'elementName' | 'text' | 'attributes'\n >\n> = function <T extends TTagNames>(\n this: IOperationScope,\n operationData: ICreateElementOperationData<T>\n) {\n operationData = resolvePropertyValues(operationData, this, operationData);\n\n const {elementName, attributes, text} = operationData;\n\n removeProperties(operationData, 'elementName', 'attributes', 'text');\n\n const serializedAttrs = attributes\n ? ` ${Object.entries(attributes)\n .filter(([_, value]) => Boolean(value))\n .map(([key, value]) => `${key}=\"${value}\"`)\n .join(' ')}`\n : '';\n\n const template = text\n ? $(`<${elementName}${serializedAttrs}>${text}</${elementName}>`)\n : $(`<${elementName}${serializedAttrs}/>`);\n\n operationData.template = template;\n\n return operationData as RequireKeys<\n ICreateElementOperationData<TTagNames>,\n 'template'\n >;\n};\n","import {internalResolve} from '@operation/helper/internal-resolve.ts';\nimport {removeProperties} from '@operation/helper/remove-operation-properties.ts';\nimport type {TOperation} from '@operation/types.ts';\n\nexport interface ICustomFunctionOperationData {\n /**\n * @type=ParameterType:systemName\n * @erased\n * @required\n */\n systemName: string;\n}\n\n/**\n * This operation retrieves a custom function defined by the given system name\n * and invokes it with the current operation data and eventbus.\n *\n * @param operationData\n *\n * @category Utility\n */\nexport const customFunction: TOperation<\n ICustomFunctionOperationData,\n Omit<ICustomFunctionOperationData, 'systemName'>\n> = function (operationData: ICustomFunctionOperationData) {\n const {systemName} = operationData;\n\n removeProperties(operationData, 'systemName');\n\n const func = this.eventbus.request<TOperation>(\n 'request-function',\n systemName\n );\n\n if (!func) {\n return operationData;\n }\n\n const promise = func.apply(this, [operationData]);\n if (promise) {\n return new Promise<ICustomFunctionOperationData>((resolve, reject) => {\n promise.then(() => {\n internalResolve(resolve, {}, operationData);\n }, reject);\n });\n }\n\n return operationData;\n};\n","import type {IEndableAction} from '@action/types.ts';\nimport {internalResolve} from '@operation/helper/internal-resolve.ts';\nimport {mergeOperationData} from '@operation/helper/merge-operation-data.ts';\nimport type {TOperation} from '@operation/types.ts';\n\nexport interface IEndActionOperationData {\n /**\n * @dependency\n */\n actionInstance: IEndableAction;\n /**\n * @required\n * @erased\n */\n actionOperationData: Record<string, unknown>;\n}\n\n/**\n * This operation invokes the {@link EndableAction}.end method on the specified action instance.\n *\n * The action operation data is first merged with the current operation data before it is\n * passed on to the action. After the action has completed the action operation data properties\n * are removed from the current operation data.\n *\n * @category Action\n */\nexport const endAction: TOperation<\n IEndActionOperationData,\n Omit<IEndActionOperationData, 'actionOperationData'>\n> = (operationData: IEndActionOperationData) => {\n let {actionOperationData, ...newOperationData} = operationData;\n\n return new Promise<IEndActionOperationData>((resolve, reject) => {\n newOperationData = mergeOperationData(\n newOperationData,\n actionOperationData\n );\n\n newOperationData.actionInstance.end(newOperationData).then(() => {\n const sanitizedData = Object.keys(newOperationData)\n .filter(key => !(key in actionOperationData))\n .reduce(\n (acc, key) => {\n (acc as any)[key] = (newOperationData as any)[key];\n return acc;\n },\n {} as typeof newOperationData\n );\n internalResolve(resolve, sanitizedData);\n }, reject);\n });\n};\n","import type {TOperation, TOperationData} from '@operation/types.ts';\n\n/**\n * This operation checks if the current loop should end or start the next iteration.\n *\n * @category Control Flow\n */\nexport const endForEach: TOperation<TOperationData> = function (\n operationData: TOperationData\n) {\n if (\n this.loopIndex !== undefined &&\n this.loopLength !== undefined &&\n this.loopIndex < this.loopLength\n ) {\n this.loopIndex = this.loopIndex + 1;\n this.newIndex = this.loopStartIndex;\n delete this.currentItem;\n }\n\n return operationData;\n};\n","import type {TOperation} from '@operation/types.ts';\n\n/**\n * This operation cleans up after the {@link when}/{@link otherwise}/{@link endWhen} control flow ends.\n *\n * @category Control Flow\n */\nexport const endWhen: TOperation<Record<string, unknown>> = function (\n operationData: Record<string, unknown>\n) {\n delete this.whenEvaluation;\n return operationData;\n};\n","import type {IController} from '@controllers/types.ts';\nimport {removeProperties} from '@operation/helper/remove-operation-properties.ts';\nimport type {TOperation, TOperationData} from '@operation/types.ts';\n\n/**\n * This operation extends the specified controller instance with the specified extension.\n */\nexport interface IExtendControllerOperationData {\n /**\n * @dependency\n */\n controllerInstance: IController<TOperationData>;\n /**\n * @erased\n * @required\n */\n controllerExtension: Record<PropertyKey, unknown>;\n}\n\n/**\n * Extends the current controller with given extension.\n *\n * @category Controller\n */\nexport const extendController: TOperation<\n IExtendControllerOperationData,\n Omit<IExtendControllerOperationData, 'controllerExtension'>\n> = (operationData: IExtendControllerOperationData) => {\n const {controllerInstance, controllerExtension} = operationData;\n\n removeProperties(operationData, 'controllerExtension');\n\n operationData.controllerInstance = Object.assign(\n controllerInstance,\n controllerExtension\n );\n\n return operationData;\n};\n","import {removeProperties} from '@operation/helper/remove-operation-properties.ts';\nimport type {TOperation} from '@operation/types.ts';\n\nexport interface IFilterArrayOperationData {\n /**\n * @required\n * @dependency\n */\n arrayData: any[];\n /**\n * @optional\n * @erased\n */\n filterProperty?: string;\n /**\n * @optional\n * @erased\n */\n filterValue?: any;\n /**\n * @optional\n * @erased\n */\n filterPredicate?: (item: any, index?: number) => boolean;\n /**\n * @output\n */\n filteredArray: any[];\n}\n\n/**\n * Filters an array based on property equality or custom predicate function.\n *\n * Operates on arrayData passed from previous operations.\n * Supports two filtering modes:\n * 1. Property equality: `filterProperty` and `filterValue` to filter by property match\n * 2. Custom predicate: `filterPredicate` function for complex filtering logic\n *\n * @returns Operation data with `filteredArray` containing filtered results\n *\n * @example\n * ```typescript\n * // Filter by property equality\n * const result = filterArray({\n * arrayData: [{name: 'Alice', age: 25}, {name: 'Bob', age: 30}],\n * filterProperty: 'age',\n * filterValue: 25\n * });\n * // result.filteredArray = [{name: 'Alice', age: 25}]\n * ```\n *\n * @example\n * ```typescript\n * // Filter with custom predicate\n * const result = filterArray({\n * arrayData: [1, 2, 3, 4, 5],\n * filterPredicate: (item) => item % 2 === 0\n * });\n * // result.filteredArray = [2, 4]\n * ```\n *\n * @category Array\n */\nexport const filterArray: TOperation<\n IFilterArrayOperationData,\n Omit<\n IFilterArrayOperationData,\n 'filterProperty' | 'filterValue' | 'filterPredicate'\n >\n> = (operationData: IFilterArrayOperationData) => {\n const {arrayData, filterProperty, filterValue, filterPredicate} =\n operationData;\n\n if (!Array.isArray(arrayData)) {\n throw new Error('filterArray: arrayData is required and must be an array');\n }\n\n if (!filterPredicate && (!filterProperty || filterValue === undefined)) {\n throw new Error(\n 'filterArray: filterProperty/filterValue or filterPredicate is required'\n );\n }\n\n let filtered: any[];\n\n if (filterPredicate) {\n filtered = arrayData.filter(filterPredicate);\n } else {\n filtered = arrayData.filter(item => {\n if (typeof item === 'object' && item !== null) {\n return item[filterProperty!] === filterValue;\n }\n return false;\n });\n }\n\n operationData.filteredArray = filtered;\n\n removeProperties(\n operationData,\n 'filterProperty',\n 'filterValue',\n 'filterPredicate'\n );\n\n return operationData;\n};\n","import {removeProperties} from '@operation/helper/remove-operation-properties.ts';\nimport type {TOperation} from '@operation/types.ts';\n\nexport interface IFindInArrayOperationData {\n /**\n * @required\n * @dependency\n */\n arrayData: any[];\n /**\n * @optional\n * @erased\n */\n findProperty?: string;\n /**\n * @optional\n * @erased\n */\n findValue?: any;\n /**\n * @optional\n * @erased\n */\n findPredicate?: (item: any, index?: number) => boolean;\n /**\n * @output\n */\n foundItem: any | undefined;\n /**\n * @output\n */\n foundIndex: number;\n}\n\n/**\n * Finds the first element in an array matching criteria.\n *\n * Operates on arrayData passed from previous operations.\n * Supports two search modes:\n * 1. Property equality: `findProperty` and `findValue` to find by property match\n * 2. Custom predicate: `findPredicate` function for complex search logic\n *\n * Returns `undefined` for `foundItem` and `-1` for `foundIndex` if no match found.\n *\n * @returns Operation data with `foundItem` (the matching element) and `foundIndex` (its position)\n *\n * @example\n * ```typescript\n * // Find by property equality\n * const result = findInArray({\n * arrayData: [{id: 1, name: 'Alice'}, {id: 2, name: 'Bob'}],\n * findProperty: 'id',\n * findValue: 2\n * });\n * // result.foundItem = {id: 2, name: 'Bob'}\n * // result.foundIndex = 1\n * ```\n *\n * @example\n * ```typescript\n * // Find with custom predicate\n * const result = findInArray({\n * arrayData: [10, 25, 30, 45],\n * findPredicate: (item) => item > 30\n * });\n * // result.foundItem = 45\n * // result.foundIndex = 3\n * ```\n *\n * @category Array\n */\nexport const findInArray: TOperation<\n IFindInArrayOperationData,\n Omit<\n IFindInArrayOperationData,\n 'findProperty' | 'findValue' | 'findPredicate'\n >\n> = (operationData: IFindInArrayOperationData) => {\n const {arrayData, findProperty, findValue, findPredicate} = operationData;\n\n if (!Array.isArray(arrayData)) {\n throw new Error('findInArray: arrayData is required and must be an array');\n }\n\n if (!findPredicate && (!findProperty || findValue === undefined)) {\n throw new Error(\n 'findInArray: findProperty/findValue or findPredicate is required'\n );\n }\n\n let foundItem: any | undefined;\n let foundIndex = -1;\n\n if (findPredicate) {\n foundIndex = arrayData.findIndex(findPredicate);\n foundItem = foundIndex !== -1 ? arrayData[foundIndex] : undefined;\n } else {\n foundIndex = arrayData.findIndex(item => {\n if (typeof item === 'object' && item !== null) {\n return item[findProperty!] === findValue;\n }\n return item === findValue;\n });\n foundItem = foundIndex !== -1 ? arrayData[foundIndex] : undefined;\n }\n\n operationData.foundItem = foundItem;\n operationData.foundIndex = foundIndex;\n\n removeProperties(operationData, 'findProperty', 'findValue', 'findPredicate');\n\n return operationData;\n};\n","import {removeProperties} from '@operation/helper/remove-operation-properties.ts';\nimport type {TOperation} from '@operation/types.ts';\n\nexport interface IFormatDateOperationData {\n /**\n * @required\n * @dependency\n */\n date: Date | string | number;\n /**\n * @required\n * @erased\n */\n format: string;\n /**\n * @output\n */\n formattedDate: string;\n}\n\n/**\n * Formats a date using Intl.DateTimeFormat or simple patterns.\n *\n * @category Date\n */\nexport const formatDate: TOperation<\n IFormatDateOperationData,\n Omit<IFormatDateOperationData, 'format'>\n> = (operationData: IFormatDateOperationData) => {\n const {date, format} = operationData;\n\n if (!date) {\n throw new Error('formatDate: date is required');\n }\n\n const dateObj = date instanceof Date ? date : new Date(date);\n\n if (Number.isNaN(dateObj.getTime())) {\n throw new Error('formatDate: invalid date');\n }\n\n // Simple format patterns\n const year = dateObj.getFullYear();\n const month = String(dateObj.getMonth() + 1).padStart(2, '0');\n const day = String(dateObj.getDate()).padStart(2, '0');\n const hours = String(dateObj.getHours()).padStart(2, '0');\n const minutes = String(dateObj.getMinutes()).padStart(2, '0');\n const seconds = String(dateObj.getSeconds()).padStart(2, '0');\n\n let formatted = format;\n formatted = formatted.replace('YYYY', String(year));\n formatted = formatted.replace('MM', month);\n formatted = formatted.replace('DD', day);\n formatted = formatted.replace('HH', hours);\n formatted = formatted.replace('mm', minutes);\n formatted = formatted.replace('ss', seconds);\n\n operationData.formattedDate = formatted;\n\n removeProperties(operationData, 'format');\n\n return operationData;\n};\n","import {removeProperties} from '@operation/helper/remove-operation-properties.ts';\nimport type {TOperation} from '@operation/types.ts';\n\nexport type TextTransformation =\n | 'uppercase'\n | 'lowercase'\n | 'capitalize'\n | 'titlecase'\n | 'trim';\n\nexport interface IFormatTextOperationData {\n /**\n * @required\n * @dependency\n */\n textContent: string;\n /**\n * @required\n * @erased\n */\n transformation: TextTransformation;\n /**\n * @output\n */\n formattedText: string;\n}\n\n/**\n * Transforms text using format operations: uppercase, lowercase, capitalize, titlecase, or trim.\n *\n * Operates on textContent passed from previous operations (e.g., getTextContent).\n *\n * Transformations:\n * - `uppercase`: Convert all characters to uppercase\n * - `lowercase`: Convert all characters to lowercase\n * - `capitalize`: Capitalize only the first letter\n * - `titlecase`: Capitalize first letter of each word\n * - `trim`: Remove leading and trailing whitespace\n *\n * @returns Operation data with `formattedText` containing the transformed text\n *\n * @example\n * ```typescript\n * // Convert to uppercase\n * const result = formatText({\n * textContent: 'hello',\n * transformation: 'uppercase'\n * });\n * // result.formattedText = \"HELLO\"\n * ```\n *\n * @example\n * ```typescript\n * // Title case\n * const result = formatText({\n * textContent: 'hello world',\n * transformation: 'titlecase'\n * });\n * // result.formattedText = \"Hello World\"\n * ```\n *\n * @category Text\n */\nexport const formatText: TOperation<\n IFormatTextOperationData,\n Omit<IFormatTextOperationData, 'transformation'>\n> = (operationData: IFormatTextOperationData) => {\n const {textContent, transformation} = operationData;\n\n if (textContent === undefined || textContent === null) {\n throw new Error('formatText: textContent is required');\n }\n\n let text = textContent;\n\n switch (transformation) {\n case 'uppercase':\n text = text.toUpperCase();\n break;\n case 'lowercase':\n text = text.toLowerCase();\n break;\n case 'capitalize':\n text = text.charAt(0).toUpperCase() + text.slice(1);\n break;\n case 'titlecase':\n text = text.replace(/\\b\\w/g, char => char.toUpperCase());\n break;\n case 'trim':\n text = text.trim();\n break;\n default:\n throw new Error(\n `formatText: unknown transformation type \"${transformation}\"`\n );\n }\n\n operationData.formattedText = text;\n\n removeProperties(operationData, 'transformation');\n\n return operationData;\n};\n","import {removeProperties} from '@operation/helper/remove-operation-properties.ts';\nimport type {TOperation} from '@operation/types.ts';\n\nexport interface IGetAttributesFromElementOperationData {\n /**\n * The HTML element whose attributes will be retrieved\n * @dependency\n */\n selectedElement: JQuery;\n /**\n * The specified attribute names that will be retrieved\n * @required\n * @erased\n */\n attributeNames: string[];\n /**\n * The retrieved attributes\n * @output\n */\n attributeValues?: Record<string, unknown>;\n}\n\n/**\n * This operation retrieves the values for the specified attribute names from the given selected element.\n *\n * @category DOM\n */\nexport const getAttributesFromElement: TOperation<\n IGetAttributesFromElementOperationData,\n Omit<IGetAttributesFromElementOperationData, 'attributeNames'>\n> = (operationData: IGetAttributesFromElementOperationData) => {\n const {selectedElement, attributeNames} = operationData;\n\n removeProperties(operationData, 'attributeNames');\n\n operationData.attributeValues = attributeNames.reduce(\n (acc, attrName) => {\n if (attrName !== 'value') {\n acc[attrName] = selectedElement.attr(attrName);\n } else {\n acc[attrName] = selectedElement.val();\n }\n return acc;\n },\n {} as Record<string, unknown>\n );\n\n return operationData;\n};\n","import type {IController} from '@controllers/types.ts';\nimport {getElementControllers} from '@operation/helper/get-element-data.ts';\nimport {removeProperties} from '@operation/helper/remove-operation-properties.ts';\nimport type {TOperation} from '@operation/types.ts';\n\nexport interface IGetControllerFromElementOperationData {\n /**\n * @dependency\n */\n selectedElement: JQuery;\n /**\n * @type=ParameterType:controllerName\n * @required\n * @erased\n */\n controllerName: string;\n /**\n * @type=ParameterType:object\n * @output\n */\n controllerInstance?: IController<any>;\n}\n\n/**\n * This operation retrieves the controller instance with the specified name that is assigned to the given selected element.\n *\n * @param operationData\n * @returns\n *\n * @category Controller\n */\nexport const getControllerFromElement: TOperation<\n IGetControllerFromElementOperationData,\n Omit<IGetControllerFromElementOperationData, 'controllerName'>\n> = (operationData: IGetControllerFromElementOperationData) => {\n const {selectedElement, controllerName} = operationData;\n\n removeProperties(operationData, 'controllerName');\n\n const controllers = getElementControllers(selectedElement);\n const controller = controllers?.find(ctrl => ctrl.name === controllerName);\n\n if (!controller) {\n console.warn(\n `controller for name '${controllerName}' was not found on the given element`\n );\n }\n\n operationData.controllerInstance = controller;\n return operationData;\n};\n","import type * as controllers from '@controllers/index.ts';\nimport type {IController} from '@controllers/types.ts';\nimport {removeProperties} from '@operation/helper/remove-operation-properties.ts';\nimport type {TOperation, TOperationData} from '@operation/types.ts';\n\ntype TSystemName = keyof typeof controllers;\nexport interface IGetControllerInstanceOperationData {\n /**\n * @required\n * @erased\n */\n systemName: TSystemName;\n /**\n * @type=ParameterType:object\n * @output\n */\n controllerInstance?: IController<TOperationData>;\n}\n\n/**\n * This operation retrieves an instance of the given controller name.\n * It assigns this instance to the `controllerInstance` property on the current operation data\n *\n * @category Controller\n */\nexport const getControllerInstance: TOperation<\n IGetControllerInstanceOperationData,\n Omit<IGetControllerInstanceOperationData, 'systemName'>\n> = function (operationData: IGetControllerInstanceOperationData) {\n const {systemName} = operationData;\n\n removeProperties(operationData, 'systemName');\n\n operationData.controllerInstance = this.eventbus.request<\n IController<TOperationData>\n >('request-instance', systemName);\n\n return operationData;\n};\n","import type {TOperation} from '@operation/types.ts';\n\nexport interface IGetCurrentTimeOperationData {\n /**\n * @output\n */\n timestamp: number;\n /**\n * @output\n */\n date: Date;\n}\n\n/**\n * Gets the current time as timestamp and Date object.\n *\n * @category Date\n */\nexport const getCurrentTime: TOperation<\n IGetCurrentTimeOperationData,\n IGetCurrentTimeOperationData\n> = (operationData: IGetCurrentTimeOperationData) => {\n const now = new Date();\n operationData.timestamp = now.getTime();\n operationData.date = now;\n return operationData;\n};\n","import type {IDimensions} from '../../types.ts';\n\nfunction _modifyDimensionsByRatio(\n ratioModifier: string,\n dimensions: IDimensions\n) {\n const modifiedDimensions = {...dimensions};\n //h[ar=8-1]\n const prefix = ratioModifier.substring(0, 1);\n\n const ratio = ratioModifier.substring(\n ratioModifier.indexOf('[') + 1,\n ratioModifier.indexOf(']') - (ratioModifier.indexOf('[') - 1)\n );\n\n const ratios = ratio.split('=')[1].split('-');\n\n if (ratios.filter(Boolean).length !== 2) {\n throw new Error(`Badly formatted modifier, expect two ratios: ${ratio}`);\n }\n\n if (prefix === 'h') {\n modifiedDimensions.height =\n (modifiedDimensions.width / +ratios[0]) * +ratios[1];\n } else if (prefix === 'w') {\n modifiedDimensions.width =\n (modifiedDimensions.height / +ratios[1]) * +ratios[0];\n }\n\n return modifiedDimensions;\n}\n\nfunction _getModifierSuffix(\n modifier: string //*100h%\n): [string | null, number, boolean] {\n const endIdx = 1;\n let suffix: string | null = modifier.substring(\n modifier.length - endIdx,\n modifier.length\n );\n\n if (suffix !== 'h' && suffix !== 'w' && suffix !== '%') {\n suffix = null;\n }\n\n const isPercent = suffix === '%';\n\n if (isPercent) {\n suffix = modifier.substring(\n modifier.length - endIdx,\n modifier.length - (endIdx + 1)\n );\n\n if (suffix !== 'h' && suffix !== 'w') {\n suffix = null;\n }\n }\n\n return [suffix, endIdx, isPercent];\n}\n\nfunction _modifyDimensions(\n dimensions: IDimensions,\n prefix: string,\n suffix: string | null,\n widthModifier: number,\n heightModifier: number\n) {\n const modifiedDimension = {...dimensions};\n switch (prefix) {\n case '+':\n switch (suffix) {\n case 'h':\n modifiedDimension.height += heightModifier;\n break;\n case 'w':\n modifiedDimension.width += widthModifier;\n break;\n default:\n modifiedDimension.height += heightModifier;\n modifiedDimension.width += widthModifier;\n }\n break;\n case '-':\n switch (suffix) {\n case 'h':\n modifiedDimension.height -= heightModifier;\n break;\n case 'w':\n modifiedDimension.width -= widthModifier;\n break;\n default:\n modifiedDimension.height -= heightModifier;\n modifiedDimension.width -= widthModifier;\n }\n break;\n case '/':\n switch (suffix) {\n case 'h':\n modifiedDimension.height /= heightModifier;\n break;\n case 'w':\n modifiedDimension.width /= widthModifier;\n break;\n default:\n modifiedDimension.height /= heightModifier;\n modifiedDimension.width /= widthModifier;\n }\n break;\n case '*':\n switch (suffix) {\n case 'h':\n modifiedDimension.height *= heightModifier;\n break;\n case 'w':\n modifiedDimension.width *= widthModifier;\n break;\n default:\n modifiedDimension.height *= heightModifier;\n modifiedDimension.width *= widthModifier;\n }\n break;\n default:\n console.error(`Unknown operator found: ${prefix}`);\n }\n return modifiedDimension;\n}\n\n/**\n * Modifies the given dimensions using the given modifier string.\n * The modifier string is formatted in the following way:\n *\n * <operator><amount><optional-side><optional-precentage>|<ratio-definition>\n *\n * Where the ratio modifier is formatted in the following way:\n * <side>[ar=<ratio-left>-<ratio-right>]\n *\n * For example, this modifier '+100h|w[ar=8-1]' will modifiy the dimensions like this:\n * it will add a value of 100 to the height and modify the width by a ration of 8 to 1 relative to the height.\n *\n * @param dimensions\n * @param modifier\n */\nexport function modifyDimensions(dimensions: IDimensions, modifier: string) {\n const clonedDimensions = {...dimensions};\n let ratioModifier: string | null = null;\n if (modifier.indexOf('|') > -1) {\n [modifier, ratioModifier] = modifier.split('|');\n }\n\n const prefix = modifier.substring(0, 1);\n const [suffix, endIdx, isPercent] = _getModifierSuffix(modifier);\n\n const value = parseInt(\n suffix !== null\n ? modifier.substring(1, modifier.length - (endIdx - 1))\n : modifier.substring(1),\n 10\n );\n\n let widthModifier = value;\n let heightModifier = value;\n if (isPercent) {\n widthModifier = (clonedDimensions.width / 100) * value;\n heightModifier = (clonedDimensions.height / 100) * value;\n }\n\n const modifiedDimension = _modifyDimensions(\n clonedDimensions,\n prefix,\n suffix,\n widthModifier,\n heightModifier\n );\n\n if (ratioModifier) {\n return _modifyDimensionsByRatio(ratioModifier, modifiedDimension);\n }\n\n return modifiedDimension;\n}\n","import {modifyDimensions} from '@operation/helper/modify-dimensions.ts';\nimport {removeProperties} from '@operation/helper/remove-operation-properties.ts';\nimport type {TOperation} from '@operation/types.ts';\n\nexport interface IGetElementDimensionsOperationData {\n /**\n * @dependency\n */\n selectedElement: JQuery;\n /**\n * @type=ParameterType:dimensionsModifier\n * @erased\n */\n modifier?: string;\n /**\n * @type=ParameterType:object\n * @output\n */\n dimensions?: {width?: number; height?: number};\n}\n\n/**\n * This operation calculates the width and height of the given selected element.\n * It assigns this struct to the dimensions property on the current operation data.\n * Optionally the width and height can be modified using the given modifier string.\n *\n * The modifier string is formatted in the following way:\n *\n * <operator><amount><optional-side><optional-precentage>|<ratio-definition>\n *\n * Where the ratio modifier is formatted in the following way:\n * <side>[ar=<ratio-left>-<ratio-right>]\n *\n * For example, this modifier '+100h|w[ar=8-1]' will modifiy the dimensions like this:\n * it will add a value of 100 to the height and modify the width by a ratio of 8 to 1 relative to the height.\n *\n * @category DOM\n */\nexport const getElementDimensions: TOperation<\n IGetElementDimensionsOperationData,\n Omit<IGetElementDimensionsOperationData, 'modifier'>\n> = (operationData: IGetElementDimensionsOperationData) => {\n const {selectedElement, modifier} = operationData;\n\n removeProperties(operationData, 'modifier');\n\n let dimensions = {\n width: selectedElement.innerWidth() ?? 0,\n height: selectedElement.innerHeight() ?? 0,\n };\n\n if (dimensions.height === 0) {\n dimensions.height = dimensions.width;\n }\n\n if (modifier) {\n dimensions = modifyDimensions(dimensions, modifier);\n }\n\n operationData.dimensions = dimensions;\n return operationData;\n};\n","import type {TOperation} from '@operation/types.ts';\nimport $ from 'jquery';\n\nexport interface IGetFocusedElementOperationData {\n /**\n * @type=ParameterType:jQuery\n * @output\n */\n focusedElement: JQuery;\n}\n\n/**\n * Gets the currently focused element.\n *\n * @category Focus\n */\nexport const getFocusedElement: TOperation<\n IGetFocusedElementOperationData,\n IGetFocusedElementOperationData\n> = (operationData: IGetFocusedElementOperationData) => {\n operationData.focusedElement = document.activeElement\n ? $(document.activeElement as HTMLElement)\n : $();\n return operationData;\n};\n","import type {TOperation} from '@operation/types.ts';\n\nexport interface IGetFormDataOperationData {\n /**\n * @required\n * @dependency\n */\n selectedElement: JQuery;\n /**\n * @output\n * @type=ParameterType:object\n */\n formData?: Record<string, any>;\n}\n\n/**\n * Extracts all input, select, and textarea values from form element into operation data.\n *\n * This operation reads form field values and returns them as an object with field names as keys.\n * Only processes form elements that are enabled and not hidden. Handles checkboxes, radio buttons,\n * select elements, textareas, and text inputs.\n *\n * @returns Operation data with `formData` object containing field values\n *\n * @example\n * ```typescript\n * // Given a form with fields: name=\"John\", email=\"john@example.com\"\n * const result = getFormData({selectedElement: $form});\n * // Returns: {selectedElement: $form, formData: {name: \"John\", email: \"john@example.com\"}}\n * ```\n *\n * @category Form\n */\nexport const getFormData: TOperation<\n IGetFormDataOperationData,\n IGetFormDataOperationData\n> = (operationData: IGetFormDataOperationData) => {\n const {selectedElement} = operationData;\n\n // Validate selectedElement exists\n if (!selectedElement || selectedElement.length === 0) {\n throw new Error('getFormData: selectedElement is required');\n }\n\n // Validate selectedElement is a form\n if (!selectedElement.is('form')) {\n throw new Error('getFormData: selectedElement must be a form element');\n }\n\n // Use jQuery's serializeArray to get form data\n const formArray = selectedElement.serializeArray();\n const formData: Record<string, any> = {};\n\n // Convert array format to object format\n for (const field of formArray) {\n // Handle multiple values for same name (checkboxes)\n if (formData[field.name] !== undefined) {\n // Convert to array if not already\n if (!Array.isArray(formData[field.name])) {\n formData[field.name] = [formData[field.name]];\n }\n formData[field.name].push(field.value);\n } else {\n formData[field.name] = field.value;\n }\n }\n\n operationData.formData = formData;\n\n return operationData;\n};\n","import type {TOperation} from '@operation/types.ts';\nimport type {RequireKeys} from '@/types.ts';\n\nexport interface IGetImportOperationData {\n /**\n * @type=ParameterType:systemName\n * @required\n * @erased\n */\n systemName: string;\n /**\n * @output\n */\n importedInstance?: unknown;\n}\n\n/**\n * This operation retrieves the import specified by the given `systemName` and\n * assigns it to the `importedInstance` property on the current operaton date.\n *\n * @param operationData\n *\n * @category Utility\n */\nexport const getImport: TOperation<\n IGetImportOperationData,\n Omit<RequireKeys<IGetImportOperationData, 'importedInstance'>, 'systemName'>\n> = function (operationData: IGetImportOperationData) {\n const {systemName} = operationData;\n\n delete (operationData as any).systemName;\n\n operationData.importedInstance = this.eventbus.request<unknown>(\n 'request-function',\n systemName\n );\n\n return operationData as Omit<\n RequireKeys<IGetImportOperationData, 'importedInstance'>,\n 'systemName'\n >;\n};\n","import {removeProperties} from '@operation/helper/remove-operation-properties.ts';\nimport type {TOperation} from '@operation/types.ts';\n\nexport interface IGetQueryParamsOperationData {\n /**\n * The query params will be added as property/values to this object.\n * So, the query string `?foo=bar&bar=foo` will result in:\n * ```json\n * {\n * foo: \"bar\",\n * bar: \"foo\"\n * }\n * ```\n * This object will be assigned to the `queryParams` property.\n * @output\n */\n queryParams?: Record<string, string>;\n /**\n * The properties on this object will be assigned to the queryParams result\n * when the given property name is not part of the query string.\n *\n * @erased\n *\n */\n defaultValues?: Record<string, string>;\n}\n\n/**\n * This operation retrieves the current query parameters from the browser's address bar and places\n * them on the returned operation data.\n *\n * @category Utility\n */\nexport const getQueryParams: TOperation<\n IGetQueryParamsOperationData,\n Omit<IGetQueryParamsOperationData, 'defaultValues'>\n> = (operationData: IGetQueryParamsOperationData) => {\n const searchParams = new URLSearchParams(window.location.search);\n const queryParams = Object.fromEntries(searchParams.entries());\n\n const {defaultValues = {}} = operationData;\n\n removeProperties(operationData, 'defaultValues');\n\n operationData.queryParams = {\n ...defaultValues,\n ...queryParams,\n };\n\n return operationData;\n};\n","import type {TOperation} from '@operation/types.ts';\n\nexport interface IGetScrollPositionOperationData {\n /**\n * @output\n */\n scrollX: number;\n /**\n * @output\n */\n scrollY: number;\n}\n\n/**\n * Gets the current scroll position of the viewport.\n *\n * Returns x (horizontal) and y (vertical) scroll positions in pixels.\n * Uses cross-browser compatible methods to retrieve scroll position.\n *\n * @returns Operation data with `scrollX` and `scrollY` values\n *\n * @example\n * ```typescript\n * // Get current scroll position\n * const result = getScrollPosition({});\n * // result.scrollX = 150\n * // result.scrollY = 400\n * ```\n *\n * @category Scroll\n */\nexport const getScrollPosition: TOperation<\n IGetScrollPositionOperationData,\n IGetScrollPositionOperationData\n> = (operationData: IGetScrollPositionOperationData) => {\n // Cross-browser scroll position detection\n const scrollX =\n window.pageXOffset !== undefined\n ? window.pageXOffset\n : (window as any).scrollX !== undefined\n ? (window as any).scrollX\n : document.documentElement?.scrollLeft || 0;\n\n const scrollY =\n window.pageYOffset !== undefined\n ? window.pageYOffset\n : (window as any).scrollY !== undefined\n ? (window as any).scrollY\n : document.documentElement?.scrollTop || 0;\n\n operationData.scrollX = scrollX;\n operationData.scrollY = scrollY;\n\n return operationData;\n};\n","import type {TOperation} from '@operation/types.ts';\n\nexport interface IGetTextContentOperationData {\n /**\n * @required\n * @dependency\n */\n selectedElement: JQuery;\n /**\n * @output\n */\n textContent?: string;\n}\n\n/**\n * Extracts text content from element, stripping all HTML markup.\n *\n * Uses jQuery's `.text()` method which is XSS-safe and returns only the text content\n * without any HTML tags. Preserves whitespace and text from nested elements.\n *\n * @returns Operation data with `textContent` containing the extracted plain text\n *\n * @example\n * ```typescript\n * // Extract text from element with HTML\n * const result = getTextContent({selectedElement: $div});\n * // Given: <div>Hello <strong>World</strong>!</div>\n * // Returns: {textContent: \"Hello World!\"}\n * ```\n *\n * @category Text\n */\nexport const getTextContent: TOperation<\n IGetTextContentOperationData,\n IGetTextContentOperationData\n> = (operationData: IGetTextContentOperationData) => {\n const {selectedElement} = operationData;\n\n if (!selectedElement || selectedElement.length === 0) {\n throw new Error('getTextContent: selectedElement is required');\n }\n\n operationData.textContent = selectedElement.text();\n\n return operationData;\n};\n","import {removeProperties} from '@operation/helper/remove-operation-properties.ts';\nimport type {TOperation} from '@operation/types.ts';\n\nexport interface IHttpDeleteOperationData {\n /**\n * @required\n * @erased\n */\n url: string;\n /**\n * @optional\n * @erased\n */\n headers?: Record<string, string>;\n /**\n * @output\n */\n response: any;\n /**\n * @output\n */\n status: number;\n}\n\n/**\n * Performs an HTTP DELETE request to the specified URL.\n *\n * @returns Operation data with `response` (parsed JSON or empty) and `status` (HTTP status code)\n *\n * @example\n * ```typescript\n * const result = await httpDelete({\n * url: 'https://api.example.com/users/123',\n * headers: { 'Authorization': 'Bearer token' }\n * });\n * // result.response = {} or null\n * // result.status = 204\n * ```\n *\n * @category HTTP\n */\nexport const httpDelete: TOperation<\n IHttpDeleteOperationData,\n Omit<IHttpDeleteOperationData, 'url' | 'headers'>\n> = async (operationData: IHttpDeleteOperationData) => {\n const {url, headers = {}} = operationData;\n\n if (!url || url.trim() === '') {\n throw new Error('httpDelete: url is required');\n }\n\n try {\n const response = await fetch(url, {\n method: 'DELETE',\n headers,\n });\n\n operationData.status = response.status;\n\n if (!response.ok) {\n throw new Error(\n `httpDelete: HTTP error ${response.status} ${response.statusText}`\n );\n }\n\n // DELETE may return empty body (204 No Content)\n const contentType = response.headers.get('content-type');\n if (contentType?.includes('application/json')) {\n const data = await response.json();\n operationData.response = data;\n } else {\n operationData.response = null;\n }\n\n removeProperties(operationData, 'url', 'headers');\n\n return operationData;\n } catch (error) {\n throw new Error(`httpDelete: ${(error as Error).message}`);\n }\n};\n","import {removeProperties} from '@operation/helper/remove-operation-properties.ts';\nimport type {TOperation} from '@operation/types.ts';\n\nexport interface IHttpPostOperationData {\n /**\n * @required\n * @erased\n */\n url: string;\n /**\n * @optional\n * @erased\n */\n body?: any;\n /**\n * @optional\n * @erased\n */\n headers?: Record<string, string>;\n /**\n * @output\n */\n response: any;\n /**\n * @output\n */\n status: number;\n}\n\n/**\n * Performs an HTTP POST request to the specified URL.\n *\n * @returns Operation data with `response` (parsed JSON) and `status` (HTTP status code)\n *\n * @example\n * ```typescript\n * const result = await httpPost({\n * url: 'https://api.example.com/users',\n * body: { name: 'John', email: 'john@example.com' },\n * headers: { 'Content-Type': 'application/json' }\n * });\n * // result.response = { id: 123, name: 'John', ... }\n * // result.status = 201\n * ```\n *\n * @category HTTP\n */\nexport const httpPost: TOperation<\n IHttpPostOperationData,\n Omit<IHttpPostOperationData, 'url' | 'body' | 'headers'>\n> = async (operationData: IHttpPostOperationData) => {\n const {url, body, headers = {}} = operationData;\n\n if (!url || url.trim() === '') {\n throw new Error('httpPost: url is required');\n }\n\n try {\n const response = await fetch(url, {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json',\n ...headers,\n },\n body: JSON.stringify(body),\n });\n\n operationData.status = response.status;\n\n if (!response.ok) {\n throw new Error(\n `httpPost: HTTP error ${response.status} ${response.statusText}`\n );\n }\n\n const data = await response.json();\n operationData.response = data;\n\n removeProperties(operationData, 'url', 'body', 'headers');\n\n return operationData;\n } catch (error) {\n throw new Error(`httpPost: ${(error as Error).message}`);\n }\n};\n","import {removeProperties} from '@operation/helper/remove-operation-properties.ts';\nimport type {TOperation} from '@operation/types.ts';\n\nexport interface IHttpPutOperationData {\n /**\n * @required\n * @erased\n */\n url: string;\n /**\n * @optional\n * @erased\n */\n body?: any;\n /**\n * @optional\n * @erased\n */\n headers?: Record<string, string>;\n /**\n * @output\n */\n response: any;\n /**\n * @output\n */\n status: number;\n}\n\n/**\n * Performs an HTTP PUT request to the specified URL.\n *\n * @returns Operation data with `response` (parsed JSON) and `status` (HTTP status code)\n *\n * @example\n * ```typescript\n * const result = await httpPut({\n * url: 'https://api.example.com/users/123',\n * body: { name: 'John Updated', email: 'john.new@example.com' },\n * headers: { 'Content-Type': 'application/json' }\n * });\n * // result.response = { id: 123, name: 'John Updated', ... }\n * // result.status = 200\n * ```\n *\n * @category HTTP\n */\nexport const httpPut: TOperation<\n IHttpPutOperationData,\n Omit<IHttpPutOperationData, 'url' | 'body' | 'headers'>\n> = async (operationData: IHttpPutOperationData) => {\n const {url, body, headers = {}} = operationData;\n\n if (!url || url.trim() === '') {\n throw new Error('httpPut: url is required');\n }\n\n try {\n const response = await fetch(url, {\n method: 'PUT',\n headers: {\n 'Content-Type': 'application/json',\n ...headers,\n },\n body: JSON.stringify(body),\n });\n\n operationData.status = response.status;\n\n if (!response.ok) {\n throw new Error(\n `httpPut: HTTP error ${response.status} ${response.statusText}`\n );\n }\n\n const data = await response.json();\n operationData.response = data;\n\n removeProperties(operationData, 'url', 'body', 'headers');\n\n return operationData;\n } catch (error) {\n throw new Error(`httpPut: ${(error as Error).message}`);\n }\n};\n","import type {TOperation} from '@operation/types.ts';\n\nexport interface IInvokeObjectMethodOperationData {\n /**\n *\n * The given object instance\n * @dependency\n *\n */\n instance: any;\n /**\n * The method name on the given object that will be invoked\n * @required\n * @erased\n */\n methodName: string;\n /**\n * Arguments that will be passed to the specified method\n * @erased\n */\n methodArguments?: unknown[];\n /**\n * If any, the results of the method invocation are assigned to the property\n * @output\n */\n methodResult?: unknown;\n}\n\n/**\n * This operation invokes the specified method on the given object with the given optional arguments\n * and assigns the result to the `methodResult` operationdata property.\n *\n * @param operationData\n *\n * @category Utility\n */\nexport const invokeObjectMethod: TOperation<\n IInvokeObjectMethodOperationData,\n Omit<IInvokeObjectMethodOperationData, 'methodName' | 'methodArguments'>\n> = (operationData: IInvokeObjectMethodOperationData) => {\n const {methodName, methodArguments, ...newOperationData} = operationData;\n\n delete (operationData as any).methodName;\n delete (operationData as any).methodArguments;\n\n const func = operationData.instance[methodName];\n if (typeof func === 'function') {\n newOperationData.methodResult = func.apply(\n operationData.instance,\n methodArguments ?? []\n );\n } else {\n console.error(`The given member name ${methodName} is not a function`);\n }\n\n return newOperationData;\n};\n","import type {TOperation} from '@operation/types.ts';\n\nexport interface IIsElementInViewportOperationData {\n /**\n * @required\n * @dependency\n */\n selectedElement: JQuery;\n /**\n * @output\n */\n isInViewport: boolean;\n}\n\n/**\n * Checks if an element is currently visible within the viewport.\n *\n * Uses `getBoundingClientRect()` to determine if the element is within the viewport boundaries.\n *\n * @returns Operation data with `isInViewport` boolean indicating visibility\n *\n * @example\n * ```typescript\n * // Check if element is in view\n * const result = isElementInViewport({\n * selectedElement: $targetElement\n * });\n * // result.isInViewport = true or false\n * ```\n *\n * @category DOM\n */\nexport const isElementInViewport: TOperation<\n IIsElementInViewportOperationData,\n IIsElementInViewportOperationData\n> = (operationData: IIsElementInViewportOperationData) => {\n const {selectedElement} = operationData;\n\n if (!selectedElement || selectedElement.length === 0) {\n throw new Error('isElementInViewport: selectedElement is required');\n }\n\n const element = selectedElement[0];\n const rect = element.getBoundingClientRect();\n\n const isInViewport =\n rect.top >= 0 &&\n rect.left >= 0 &&\n rect.bottom <=\n (window.innerHeight || document.documentElement.clientHeight) &&\n rect.right <= (window.innerWidth || document.documentElement.clientWidth);\n\n operationData.isInViewport = isInViewport;\n\n return operationData;\n};\n","import {removeProperties} from '@operation/helper/remove-operation-properties.ts';\nimport type {TOperation} from '@operation/types.ts';\n\nexport type StorageType = 'local' | 'session';\n\nexport interface ILoadFromStorageOperationData {\n /**\n * @required\n * @erased\n */\n key: string;\n /**\n * @required\n * @erased\n */\n storageType: StorageType;\n /**\n * @output\n */\n loadedValue: any;\n}\n\n/**\n * Loads data from browser storage (localStorage or sessionStorage).\n *\n * Deserializes the stored JSON value. Returns `null` if key doesn't exist.\n *\n * @returns Operation data with `loadedValue` containing the deserialized data\n *\n * @example\n * ```typescript\n * // Load user settings from localStorage\n * const result = loadFromStorage({\n * key: 'user-settings',\n * storageType: 'local'\n * });\n * // result.loadedValue = { theme: 'dark', language: 'en' }\n * ```\n *\n * @example\n * ```typescript\n * // Load session data\n * const result = loadFromStorage({\n * key: 'session-id',\n * storageType: 'session'\n * });\n * // result.loadedValue = 'abc123' or null if not found\n * ```\n *\n * @category Data\n */\nexport const loadFromStorage: TOperation<\n ILoadFromStorageOperationData,\n Omit<ILoadFromStorageOperationData, 'storageType'>\n> = (operationData: ILoadFromStorageOperationData) => {\n const {key, storageType} = operationData;\n\n if (!key || key.trim() === '') {\n throw new Error('loadFromStorage: key is required');\n }\n\n const storage = storageType === 'session' ? sessionStorage : localStorage;\n const stored = storage.getItem(key);\n\n if (stored === null) {\n operationData.loadedValue = null;\n } else {\n try {\n operationData.loadedValue = JSON.parse(stored);\n } catch {\n throw new Error(\n `loadFromStorage: failed to parse stored value for key \"${key}\"`\n );\n }\n }\n\n removeProperties(operationData, 'storageType');\n\n return operationData;\n};\n","import {removeProperties} from '@operation/helper/remove-operation-properties.ts';\nimport type {TOperation} from '@operation/types.ts';\n\nconst jsonCache: Record<string, unknown> = {};\n\nexport interface ILoadJSONOperationData {\n /**\n * The URL where the JSON will be retrieved from\n * @required\n * @erased\n */\n url: string;\n /**\n * If true, the results will be added to the cache and any subsequent call will use this cache\n * @erased\n */\n cache?: boolean;\n /**\n * The JSON retrieved from the given URL\n * @output\n */\n json?: any;\n}\n\nconst addToCache = (key: string, value: any) => {\n jsonCache[key] = value;\n};\n\n/**\n * This operation loads a JSON file from the specified url and assigns it to the json\n * property on the current operation data.\n *\n * If the cache property is set to true and a cached value already exists, this is assigned\n * instead of re-retrieving it from the url.\n *\n * @category Utility\n */\nexport const loadJson: TOperation<\n ILoadJSONOperationData,\n Omit<ILoadJSONOperationData, 'url' | 'cache'>\n> = async (operationData: ILoadJSONOperationData) => {\n const {url, cache} = operationData;\n\n removeProperties(operationData, 'url', 'cache');\n\n if (cache && jsonCache[url]) {\n operationData.json = jsonCache[url];\n return operationData;\n }\n\n const response = await fetch(url);\n const json = await response.json();\n const cacheValue = (operationData.json = json);\n\n if (cache) {\n addToCache(url, cacheValue);\n }\n\n return operationData;\n};\n\nexport const clearCache = () => {\n for (const p in jsonCache) {\n delete jsonCache[p];\n }\n};\n","import {getGlobals} from '@operation/helper/globals.ts';\nimport {removeProperties} from '@operation/helper/remove-operation-properties.ts';\nimport type {TOperation} from '@operation/types.ts';\n\nexport interface ILogOperationData {\n /**\n * @type=ParameterType:object|ParameterType:string|ParameterType:number|ParameterType:boolean|ParameterType:array\n * @erased\n */\n logValue?: any;\n /**\n * @erased\n */\n logName?: string;\n}\n\n/**\n * This operation logs the specified value, or, when no logValue property has been assigned\n * it will log the current operation data, global data and scope to the console\n *\n * @category Utility\n */\nexport const log: TOperation<\n ILogOperationData,\n Omit<ILogOperationData, 'logValue' | 'logName'>\n> = function (operationData: ILogOperationData) {\n if ('logValue' in operationData) {\n console.log(operationData.logName ?? 'logValue', operationData.logValue);\n removeProperties(operationData, 'logValue', 'logName');\n } else {\n const globalData = getGlobals();\n\n console.group('Operation info');\n console.log('scope', this);\n console.log('operationData', operationData);\n console.log('globalData', globalData);\n console.groupEnd();\n }\n\n return operationData;\n};\n","import {removeProperties} from '@operation/helper/remove-operation-properties.ts';\nimport type {TOperation} from '@operation/types.ts';\n\nexport interface IMapArrayOperationData {\n /**\n * @required\n * @dependency\n */\n arrayData: any[];\n /**\n * @required\n * @erased\n */\n mapFunction: (item: any, index?: number) => any;\n /**\n * @output\n */\n mappedArray?: any[];\n}\n\n/**\n * Transforms each element of an array using a mapping function.\n *\n * Operates on arrayData passed from previous operations.\n * The mapFunction receives each item and optionally its index.\n *\n * @returns Operation data with `mappedArray` containing transformed elements\n *\n * @example\n * ```typescript\n * // Double each number\n * const result = mapArray({\n * arrayData: [1, 2, 3, 4],\n * mapFunction: (item) => item * 2\n * });\n * // result.mappedArray = [2, 4, 6, 8]\n * ```\n *\n * @example\n * ```typescript\n * // Extract property from objects\n * const result = mapArray({\n * arrayData: [{name: 'Alice', age: 25}, {name: 'Bob', age: 30}],\n * mapFunction: (item) => item.name\n * });\n * // result.mappedArray = ['Alice', 'Bob']\n * ```\n *\n * @example\n * ```typescript\n * // Use index in transformation\n * const result = mapArray({\n * arrayData: ['a', 'b', 'c'],\n * mapFunction: (item, index) => `${index}-${item}`\n * });\n * // result.mappedArray = ['0-a', '1-b', '2-c']\n * ```\n *\n * @category Array\n */\nexport const mapArray: TOperation<\n IMapArrayOperationData,\n Omit<IMapArrayOperationData, 'mapFunction'>\n> = (operationData: IMapArrayOperationData) => {\n const {arrayData, mapFunction} = operationData;\n\n if (!Array.isArray(arrayData)) {\n throw new Error('mapArray: arrayData is required and must be an array');\n }\n\n if (typeof mapFunction !== 'function') {\n throw new Error('mapArray: mapFunction is required and must be a function');\n }\n\n operationData.mappedArray = arrayData.map(mapFunction);\n\n removeProperties(operationData, 'mapFunction');\n\n return operationData;\n};\n","export function isFunction(value: any): value is (...arg: any) => any {\n return typeof value === 'function';\n}\n","export function isString(value: any): value is string {\n return typeof value === 'string';\n}\n","import {resolvePropertyValues} from '@operation/helper/resolve-property-values.ts';\nimport type {TOperation} from '@operation/types.ts';\nimport {isFunction} from '@util/guards/is-function.ts';\nimport {isString} from '@util/guards/is-string.ts';\n\nexport type MathFunctionKeys = {\n [K in keyof Math]: Math[K] extends (...args: any) => any ? K : never;\n}[keyof Math];\n\nexport type MathNonFunctionKeys = {\n [K in keyof Math]: Math[K] extends (...args: any) => any ? never : K;\n}[keyof Math];\n\nexport interface IMathOperationData {\n /**\n * @type=ParameterType:array\n * @required\n * @erased\n */\n args: (number | string | MathNonFunctionKeys)[];\n /**\n * @type=ParameterType:mathfunction\n * @required\n * @erased\n */\n functionName: MathFunctionKeys;\n /**\n * @output\n */\n mathResult?: number;\n}\n\n/**\n * This operation performs the given math function with the specified arguments.\n *\n * @category Utility\n */\nexport const math: TOperation<\n IMathOperationData,\n Omit<IMathOperationData, 'args' | 'functionName'>\n> = function (operationData: IMathOperationData) {\n operationData = resolvePropertyValues(operationData, this, operationData);\n operationData.args = resolveMathConstants(operationData.args);\n\n const {args, functionName, ...newOperationData} = operationData;\n\n newOperationData.mathResult = (\n Math[functionName] as (...args: any[]) => any\n ).apply(null, args);\n\n return newOperationData;\n};\n\nfunction resolveMathConstants(args: any[]) {\n return args.map((arg: any) => {\n if (isMathProperty(arg)) {\n return Math[arg];\n }\n return arg;\n });\n}\n\nfunction isMathProperty(value: string | symbol): value is keyof Math {\n return (\n isString(value) && value in Math && !isFunction(Math[value as keyof Math])\n );\n}\n","import {findMatchingOperationIndex} from '@operation/helper/find-matching-operation-index.ts';\nimport type {IOperationScope, TOperation} from '@operation/types.ts';\n\n/**\n * If the preceeding {@link when} operation evaluates to `true` subsequent operations will\n * be skipped until an {@link endWhen} operation is encountered.\n *\n * @category Control Flow\n */\nexport const otherwise: TOperation<Record<string, unknown>> = function (\n operationData: Record<string, unknown>\n) {\n if (this.whenEvaluation) {\n this.newIndex = findEndWhenIndex(this);\n }\n return operationData;\n};\n\nfunction findEndWhenIndex(scope: IOperationScope) {\n const currentIndex = scope.currentIndex + 1;\n const list = scope.operations.slice(currentIndex);\n\n const endWhenIndex = list.findIndex(\n findMatchingOperationIndex.bind({\n counter: 0,\n self: 'when',\n matchingName: 'endWhen',\n })\n );\n\n return endWhenIndex > -1\n ? endWhenIndex + currentIndex\n : scope.operations.length;\n}\n","import type {TOperation} from '@operation/types.ts';\n\nexport interface IRemoveClassOperationData {\n /**\n * @dependency\n */\n selectedElement: JQuery;\n /**\n * @type=ParameterType:className\n * @required\n * @erased\n */\n className: string;\n}\n\n/**\n * This operation removes the spcified class name from the given selected element.\n *\n * @param operationData\n * @returns\n * @category DOM\n */\nexport const removeClass: TOperation<\n IRemoveClassOperationData,\n Omit<IRemoveClassOperationData, 'className'>\n> = (operationData: IRemoveClassOperationData) => {\n const {selectedElement, className} = operationData;\n delete (operationData as any).className;\n selectedElement.removeClass(className);\n return operationData;\n};\n","import type {IController} from '@controllers/types.ts';\nimport {getElementControllers} from '@operation/helper/get-element-data.ts';\nimport type {TOperation} from '@operation/types.ts';\n\nexport interface IRemoveControllerFromElementOperationData {\n /**\n * @dependency\n */\n selectedElement: JQuery;\n /**\n * @type=ParameterType:controllerName\n * @required\n * @erased\n */\n controllerName: string;\n}\n\n/**\n * This operation removes the controller with the specified name from the given selected element.\n *\n * @param operationData\n * @returns\n *\n * @category Controller\n */\nexport const removeControllerFromElement: TOperation<\n IRemoveControllerFromElementOperationData,\n Omit<IRemoveControllerFromElementOperationData, 'controllerName'>\n> = function (operationData: IRemoveControllerFromElementOperationData) {\n const {selectedElement, controllerName} = operationData;\n\n delete (operationData as any).controllerName;\n\n const controllers = getElementControllers(selectedElement);\n const controller = controllers?.find(\n (ctrl: IController<any>) => ctrl.name === controllerName\n );\n\n if (controller && controllers) {\n const idx = controllers.indexOf(controller);\n controllers.splice(idx, 1);\n controller.detach(this.eventbus);\n } else {\n console.warn(\n `controller for name '${controllerName}' was not found on the given element`\n );\n }\n\n return operationData;\n};\n","import type {TOperation} from '@operation/types.ts';\n\nexport interface IRemoveElementOperationData {\n /**\n * @dependency\n */\n selectedElement: JQuery;\n}\n\n/**\n * This operation removes the given selected element from the DOM.\n *\n * @category DOM\n */\nexport const removeElement: TOperation<IRemoveElementOperationData> = (\n operationData: IRemoveElementOperationData\n) => {\n const {selectedElement} = operationData;\n selectedElement.remove();\n return operationData;\n};\n","import type {TOperation} from '@operation/types.ts';\n\nexport interface IRemovePropertiesFromOperationDataOperationData {\n /**\n * @required\n * @erased\n */\n propertyNames: string[];\n}\n\n/**\n * This operation removes the given list of properties from the current operation data.\n * It will also remove the property `propertyNames` from the result.\n *\n * @category Data\n */\nexport const removePropertiesFromOperationData: TOperation<\n IRemovePropertiesFromOperationDataOperationData,\n Omit<IRemovePropertiesFromOperationDataOperationData, 'propertyNames'>\n> = (operationData: IRemovePropertiesFromOperationDataOperationData) => {\n const {propertyNames} = operationData;\n if (propertyNames.indexOf('propertyNames') < 0) {\n propertyNames.push('propertyNames');\n }\n\n return Object.fromEntries(\n Object.entries(operationData).filter(\n ([name, _value]) => !propertyNames.includes(name)\n )\n );\n};\n","import {removeProperties} from '@operation/helper/remove-operation-properties.ts';\nimport type {TOperation} from '@operation/types.ts';\n\nexport interface IReparentElementOperationData {\n /**\n * @dependency\n */\n selectedElement: JQuery;\n /**\n * @type=ParameterType:selector\n * @required\n * @erased\n */\n newParentSelector: string;\n}\n\n/**\n * This operation moves the given selected element to the new parent that is defined\n * by the specified `newParentSelector`.\n *\n * @param operationData\n * @returns\n *\n * @category DOM\n */\nexport const reparentElement: TOperation<\n IReparentElementOperationData,\n Omit<IReparentElementOperationData, 'newParentSelector'>\n> = (operationData: IReparentElementOperationData) => {\n const {selectedElement, newParentSelector} = operationData;\n removeProperties(operationData, 'newParentSelector');\n selectedElement.remove().appendTo(newParentSelector);\n return operationData;\n};\n","import {removeProperties} from '@operation/helper/remove-operation-properties.ts';\nimport type {TOperation} from '@operation/types.ts';\n\nexport interface IReplaceStringOperationData {\n /**\n * @required\n * @dependency\n */\n textContent: string;\n /**\n * @required\n * @erased\n */\n pattern: string | RegExp;\n /**\n * @required\n * @erased\n */\n replacement: string;\n /**\n * @output\n */\n result: string;\n}\n\n/**\n * Replaces occurrences of a pattern in a string (alias for replaceText for string context).\n *\n * @returns Operation data with `result` containing the replaced string\n *\n * @example\n * ```typescript\n * const result = replaceString({\n * textContent: 'Hello World',\n * pattern: 'World',\n * replacement: 'Universe'\n * });\n * // result.result = \"Hello Universe\"\n * ```\n *\n * @category String\n */\nexport const replaceString: TOperation<\n IReplaceStringOperationData,\n Omit<IReplaceStringOperationData, 'pattern' | 'replacement'>\n> = (operationData: IReplaceStringOperationData) => {\n const {textContent, pattern, replacement} = operationData;\n\n if (textContent === undefined || textContent === null) {\n throw new Error('replaceString: textContent is required');\n }\n\n operationData.result = textContent.replace(pattern, replacement);\n\n removeProperties(operationData, 'pattern', 'replacement');\n\n return operationData;\n};\n","import {removeProperties} from '@operation/helper/remove-operation-properties.ts';\nimport type {TOperation} from '@operation/types.ts';\n\nexport interface IReplaceTextOperationData {\n /**\n * @required\n * @dependency\n */\n textContent: string;\n /**\n * @required\n * @erased\n */\n searchPattern: string | RegExp;\n /**\n * @required\n * @erased\n */\n replacement: string;\n /**\n * @output\n */\n replacementCount: number;\n}\n\n/**\n * Finds and replaces text using literal string or regex pattern.\n *\n * Operates on textContent passed from previous operations (e.g., getTextContent).\n * Supports regex patterns with global flag for multiple replacements.\n * Updates textContent with replaced text and sets replacementCount.\n *\n * @returns Operation data with updated `textContent` and `replacementCount` indicating number of replacements made\n *\n * @example\n * ```typescript\n * // Replace placeholder with value\n * const result = replaceText({\n * textContent: 'Hello {{name}}',\n * searchPattern: '{{name}}',\n * replacement: 'John'\n * });\n * // result.textContent = \"Hello John\"\n * // result.replacementCount = 1\n * ```\n *\n * @example\n * ```typescript\n * // Replace with regex pattern\n * const result = replaceText({\n * textContent: 'Test 123 and 456',\n * searchPattern: /\\d+/g,\n * replacement: 'NUM'\n * });\n * // result.textContent = \"Test NUM and NUM\"\n * // result.replacementCount = 2\n * ```\n *\n * @category Text\n */\nexport const replaceText: TOperation<\n IReplaceTextOperationData,\n Omit<IReplaceTextOperationData, 'searchPattern' | 'replacement'>\n> = (operationData: IReplaceTextOperationData) => {\n const {textContent, searchPattern, replacement} = operationData;\n\n if (textContent === undefined || textContent === null) {\n throw new Error('replaceText: textContent is required');\n }\n\n let newText: string;\n let count = 0;\n\n if (searchPattern instanceof RegExp) {\n // Count matches for regex\n const matches = textContent.match(searchPattern);\n count = matches ? matches.length : 0;\n newText = textContent.replace(searchPattern, replacement);\n } else {\n // Count matches for string\n const parts = textContent.split(searchPattern);\n count = parts.length - 1;\n newText = parts.join(replacement);\n }\n\n operationData.textContent = newText;\n operationData.replacementCount = count;\n\n removeProperties(operationData, 'searchPattern', 'replacement');\n\n return operationData;\n};\n","import type {IAction} from '@action/types.ts';\nimport {removeProperties} from '@operation/helper/remove-operation-properties.ts';\nimport type {TOperation} from '@operation/types.ts';\n\nexport interface IRequestActionOperationData {\n /**\n * @type=ParameterType:actionName\n * @required\n * @erased\n */\n systemName: string;\n /**\n * @type=ParameterType:object\n * @output\n */\n actionInstance?: IAction;\n}\n\n/**\n * This operation requests an action instance with the specified name and assigns it\n * to the `actionInstance` property on the current operation data.\n *\n * @category Action\n */\nexport const requestAction: TOperation<\n IRequestActionOperationData,\n Omit<Required<IRequestActionOperationData>, 'systemName'>\n> = function (operationData: IRequestActionOperationData) {\n const {systemName} = operationData;\n\n removeProperties(operationData, 'systemName');\n\n operationData.actionInstance = this.eventbus.request<IAction>(\n 'request-action',\n systemName\n );\n\n return operationData as Required<IRequestActionOperationData>;\n};\n","import {removeProperties} from '@operation/helper/remove-operation-properties.ts';\nimport type {TOperation} from '@operation/types.ts';\n\nexport type StorageType = 'local' | 'session';\n\nexport interface ISaveToStorageOperationData {\n /**\n * @required\n * @erased\n */\n key: string;\n /**\n * @required\n * @erased\n */\n value: any;\n /**\n * @required\n * @erased\n */\n storageType: StorageType;\n}\n\n/**\n * Saves data to browser storage (localStorage or sessionStorage).\n *\n * Serializes the value as JSON before storing. Supports any JSON-serializable data type.\n *\n * @returns Operation data with storage properties erased\n *\n * @example\n * ```typescript\n * // Save user settings to localStorage\n * const result = saveToStorage({\n * key: 'user-settings',\n * value: { theme: 'dark', language: 'en' },\n * storageType: 'local'\n * });\n * ```\n *\n * @example\n * ```typescript\n * // Save session data\n * const result = saveToStorage({\n * key: 'session-id',\n * value: 'abc123',\n * storageType: 'session'\n * });\n * ```\n *\n * @category Data\n */\nexport const saveToStorage: TOperation<\n ISaveToStorageOperationData,\n Omit<ISaveToStorageOperationData, 'value' | 'storageType'>\n> = (operationData: ISaveToStorageOperationData) => {\n const {key, value, storageType} = operationData;\n\n if (!key || key.trim() === '') {\n throw new Error('saveToStorage: key is required');\n }\n\n const storage = storageType === 'session' ? sessionStorage : localStorage;\n const serialized = JSON.stringify(value);\n storage.setItem(key, serialized);\n\n removeProperties(operationData, 'value', 'storageType');\n\n return operationData;\n};\n","import {removeProperties} from '@operation/helper/remove-operation-properties.ts';\nimport type {TOperation} from '@operation/types.ts';\n\nexport type ScrollBehavior = 'auto' | 'smooth';\nexport type ScrollLogicalPosition = 'start' | 'center' | 'end' | 'nearest';\n\nexport interface IScrollToElementOperationData {\n /**\n * @required\n * @dependency\n */\n selectedElement: JQuery;\n /**\n * @optional\n * @erased\n */\n behavior?: ScrollBehavior;\n /**\n * @optional\n * @erased\n */\n block?: ScrollLogicalPosition;\n /**\n * @optional\n * @erased\n */\n inline?: ScrollLogicalPosition;\n}\n\n/**\n * Scrolls the viewport to bring the selected element into view.\n *\n * Uses the browser's `scrollIntoView` API with configurable behavior.\n *\n * @returns Operation data with scroll properties erased\n *\n * @example\n * ```typescript\n * // Smooth scroll to element at top of viewport\n * const result = scrollToElement({\n * selectedElement: $targetElement,\n * behavior: 'smooth',\n * block: 'start'\n * });\n * ```\n *\n * @example\n * ```typescript\n * // Center element in viewport\n * const result = scrollToElement({\n * selectedElement: $targetElement,\n * behavior: 'smooth',\n * block: 'center'\n * });\n * ```\n *\n * @category Scroll\n */\nexport const scrollToElement: TOperation<\n IScrollToElementOperationData,\n Omit<IScrollToElementOperationData, 'behavior' | 'block' | 'inline'>\n> = (operationData: IScrollToElementOperationData) => {\n const {\n selectedElement,\n behavior = 'auto',\n block = 'start',\n inline = 'nearest',\n } = operationData;\n\n if (!selectedElement || selectedElement.length === 0) {\n throw new Error('scrollToElement: selectedElement is required');\n }\n\n const element = selectedElement[0];\n element.scrollIntoView({\n behavior,\n block,\n inline,\n });\n\n removeProperties(operationData, 'behavior', 'block', 'inline');\n\n return operationData;\n};\n","import {removeProperties} from '@operation/helper/remove-operation-properties.ts';\nimport type {TOperation} from '@operation/types.ts';\n\nexport type ScrollBehavior = 'auto' | 'smooth';\n\nexport interface IScrollToPositionOperationData {\n /**\n * @required\n * @erased\n */\n x: number;\n /**\n * @required\n * @erased\n */\n y: number;\n /**\n * @optional\n * @erased\n */\n behavior?: ScrollBehavior;\n}\n\n/**\n * Scrolls the viewport to a specific x,y coordinate position.\n *\n * Uses the browser's `window.scrollTo` API with configurable behavior.\n *\n * @returns Operation data with scroll properties erased\n *\n * @example\n * ```typescript\n * // Smooth scroll to position\n * const result = scrollToPosition({\n * x: 0,\n * y: 500,\n * behavior: 'smooth'\n * });\n * ```\n *\n * @example\n * ```typescript\n * // Instant scroll to top\n * const result = scrollToPosition({\n * x: 0,\n * y: 0\n * });\n * ```\n *\n * @category Scroll\n */\nexport const scrollToPosition: TOperation<\n IScrollToPositionOperationData,\n Omit<IScrollToPositionOperationData, 'x' | 'y' | 'behavior'>\n> = (operationData: IScrollToPositionOperationData) => {\n const {x, y, behavior = 'auto'} = operationData;\n\n if (typeof x !== 'number' || typeof y !== 'number') {\n throw new Error('scrollToPosition: x and y coordinates are required');\n }\n\n window.scrollTo({\n left: x,\n top: y,\n behavior,\n });\n\n removeProperties(operationData, 'x', 'y', 'behavior');\n\n return operationData;\n};\n","import {removeProperties} from '@operation/helper/remove-operation-properties.ts';\nimport {\n type ExternalProperty,\n resolveExternalPropertyChain,\n} from '@operation/helper/resolve-external-property-chain.ts';\nimport type {TOperation} from '@operation/types.ts';\n\nfunction findElementBySelector(root: JQuery, selector: string) {\n const element = root.find(selector);\n if (!element.length) {\n console.warn(`selector '${selector}' wasn't found!`);\n }\n return element;\n}\n\nexport interface ISelectElementOperationData {\n /**\n * @type=ParameterType:selector\n * @required\n * @erased\n */\n selector: string;\n /**\n * @erased\n */\n useSelectedElementAsRoot?: boolean;\n /**\n * @type=ParameterType:object\n * @output\n */\n selectedElement?: JQuery;\n}\n\n/**\n * This operation selects one or more elements using the specified selector.\n *\n * If `useSelectedElementAsRoot` is set to true and a valid DOM element is assigned\n * to the current operation data's `selectedElement` property\n * then the element will be looked for only in the descendant elements of this DOM element.\n *\n * @category DOM\n */\nexport const selectElement: TOperation<\n ISelectElementOperationData,\n Omit<ISelectElementOperationData, 'selector' | 'useSelectedElementAsRoot'>\n> = function (operationData: ISelectElementOperationData) {\n operationData.selector = resolveExternalPropertyChain(\n operationData,\n this,\n operationData.selector as ExternalProperty\n ) as string;\n\n const {selector, useSelectedElementAsRoot = false} = operationData;\n\n removeProperties(operationData, 'selector', 'useSelectedElementAsRoot');\n\n if (!selector) {\n throw new Error('selectElement: selector is either empty or not defined.');\n }\n\n if (useSelectedElementAsRoot && operationData.selectedElement) {\n const currentRoot = operationData.selectedElement;\n operationData.selectedElement = findElementBySelector(\n currentRoot,\n selector\n );\n return operationData;\n }\n\n const root = this.eventbus.request<JQuery>('request-engine-root');\n if (root) {\n operationData.selectedElement = findElementBySelector(root, selector);\n }\n\n return operationData;\n};\n","import {getPropertyChainValue} from '@operation/helper/get-property-chain-value.ts';\nimport {getGlobals, type TGlobalCache} from '@operation/helper/globals.ts';\nimport {removeProperties} from '@operation/helper/remove-operation-properties.ts';\nimport {resolveExternalPropertyChain} from '@operation/helper/resolve-external-property-chain.ts';\nimport type {\n IOperationScope,\n TOperation,\n TOperationData,\n} from '@operation/types.ts';\n\nexport type TDataTarget =\n | `$scope.${string}`\n | `$operationdata.${string}`\n | `$globaldata.${string}`;\n\nexport interface ISetDataOperationData {\n /**\n * @required\n * @erased\n */\n properties: Record<TDataTarget, any>;\n}\n\n/**\n * This operation assigns the specified properties to the specified data targets.\n *\n * @example The various ways of assigning data\n * ```ts\n * setData({\n * '$operationdata.foo': '$scope.currentItem', // $scope.currentItem will be assigned to $operationdata.foo\n * '$globaldata.foo': '$scope.currentItem', // $scope.currentItem will be assigned to $globaldata.foo\n * '$scope.newIndex': 100, // The constant 100 will be assigned to $scope.newIndex\n * })\n * ```\n *\n * @category Data\n */\nexport const setData: TOperation<\n ISetDataOperationData,\n Omit<ISetDataOperationData, 'properties'>\n> = function (operationData: ISetDataOperationData) {\n const {properties} = operationData;\n removeProperties(operationData, 'properties');\n\n resolveTargets(properties, operationData, this);\n\n return operationData;\n};\n\nfunction resolveTargets(\n data: Record<TDataTarget, any>,\n operationData: Record<string, any>,\n scope: IOperationScope\n) {\n const propertyChains = Object.keys(data);\n\n return propertyChains.forEach(item => {\n const path = item.split('.');\n const rootTarget = path.shift()?.toLowerCase().substring(1) ?? '';\n if (!isDataTarget(rootTarget)) {\n throw new Error(\n `Unrecognized target: ${rootTarget}, known targets are: ${knownTargets.join(\n ', '\n )}`\n );\n }\n const property = path.pop() ?? '';\n const propertyValue = resolveExternalPropertyChain(\n operationData,\n scope,\n (data as any)[item]\n );\n\n const targets: {\n scope: IOperationScope;\n operationdata: TOperationData;\n globaldata: TGlobalCache;\n } = {\n scope,\n operationdata: operationData,\n globaldata: getGlobals(),\n };\n\n const propertyTarget = getPropertyChainValue(\n path,\n (targets as any)[rootTarget]\n ) as Record<string, any>;\n\n propertyTarget[property] = propertyValue;\n });\n}\n\nconst knownTargets = ['scope', 'operationdata', 'globaldata'];\nfunction isDataTarget(value: string): value is TDataTarget {\n return knownTargets.includes(value);\n}\n","import {removeProperties} from '@operation/helper/remove-operation-properties.ts';\nimport type {TOperation} from '@operation/types.ts';\n\nexport interface ISetElementAttributesOperationData {\n /**\n * @required\n * @erased\n */\n attributes: Record<string, unknown>;\n /**\n * @dependency\n */\n selectedElement: JQuery;\n}\n\n/**\n * This operation sets the specified set of attributes on the given selected element.\n *\n * @category DOM\n */\nexport const setElementAttributes: TOperation<\n ISetElementAttributesOperationData,\n Omit<ISetElementAttributesOperationData, 'attributes'>\n> = (operationData: ISetElementAttributesOperationData) => {\n const {attributes, selectedElement} = operationData;\n removeProperties(operationData, 'attributes');\n selectedElement.attr(attributes);\n return operationData;\n};\n","import {removeProperties} from '@operation/helper/remove-operation-properties.ts';\nimport type {TOperation} from '@operation/types.ts';\n\nexport interface ISetElementContentOperationData {\n /**\n * @dependency\n */\n selectedElement: JQuery;\n /**\n * @erased\n */\n template: string | JQuery.Node;\n /**\n * overwite = the contents of the selected element are replaced by the given template\n *\n * append = the new content will be inserted after the current content\n *\n * prepend = the new content will be inserted before the current content\n *\n * @erased\n */\n insertionType: 'overwrite' | 'append' | 'prepend';\n}\n\n/**\n * This operation sets the specified content defined by the value assigned to the template property\n * to the given selected element.\n *\n * When the `insertionType` is set to `overwrite` the contents of the selected element are replaced\n * by the given template.\n * When set to `append` the new content will be inserted after the current content.\n * When set to `prepend` the new content will be inserted before the current content.\n *\n * @category DOM\n */\nexport const setElementContent: TOperation<\n ISetElementContentOperationData,\n Omit<ISetElementContentOperationData, 'template' | 'insertionType'>\n> = (operationData: ISetElementContentOperationData) => {\n const {\n insertionType = 'overwrite',\n selectedElement,\n template,\n } = operationData;\n\n switch (true) {\n case insertionType === 'overwrite':\n selectedElement.html(template);\n break;\n case insertionType === 'append':\n selectedElement.append(template);\n break;\n case insertionType === 'prepend':\n selectedElement.prepend(template);\n break;\n }\n\n removeProperties(operationData, 'insertionType', 'template');\n\n return operationData;\n};\n","import type {TOperation} from '@operation/types.ts';\n\nexport interface ISetFocusOperationData {\n /**\n * @required\n * @dependency\n */\n selectedElement: JQuery;\n}\n\n/**\n * Sets focus to the selected element.\n *\n * @category Focus\n */\nexport const setFocus: TOperation<\n ISetFocusOperationData,\n ISetFocusOperationData\n> = (operationData: ISetFocusOperationData) => {\n const {selectedElement} = operationData;\n\n if (!selectedElement || selectedElement.length === 0) {\n throw new Error('setFocus: selectedElement is required');\n }\n\n selectedElement[0].focus();\n\n return operationData;\n};\n","import {removeProperties} from '@operation/helper/remove-operation-properties.ts';\nimport type {TOperation} from '@operation/types.ts';\n\nexport interface ISetFormValueOperationData {\n /**\n * @required\n * @dependency\n */\n selectedElement: JQuery;\n /**\n * @required\n * @erased\n */\n value: string | number | boolean;\n}\n\n/**\n * Sets the value of an input, select, or textarea element.\n *\n * Handles different input types appropriately:\n * - Text inputs, textareas, selects: sets value directly\n * - Checkboxes: sets checked property for boolean values\n * - Radio buttons: sets checked property for boolean values\n * - Number inputs: converts to string\n *\n * @example\n * ```typescript\n * // Set text input value\n * const result = setFormValue({selectedElement: $input, value: 'test@example.com'});\n * // Element value is now 'test@example.com'\n * ```\n *\n * @example\n * ```typescript\n * // Set checkbox checked state\n * const result = setFormValue({selectedElement: $checkbox, value: true});\n * // Checkbox is now checked\n * ```\n *\n * @category Form\n */\nexport const setFormValue: TOperation<\n ISetFormValueOperationData,\n Omit<ISetFormValueOperationData, 'value'>\n> = (operationData: ISetFormValueOperationData) => {\n const {selectedElement, value} = operationData;\n\n // Validate selectedElement exists\n if (!selectedElement || selectedElement.length === 0) {\n throw new Error('setFormValue: selectedElement is required');\n }\n\n // Handle checkboxes and radio buttons with boolean values\n if (\n typeof value === 'boolean' &&\n (selectedElement.is(':checkbox') || selectedElement.is(':radio'))\n ) {\n selectedElement.prop('checked', value);\n } else {\n // Handle all other inputs with val()\n selectedElement.val(value as any);\n }\n\n removeProperties(operationData, 'value');\n\n return operationData;\n};\n","import {setGlobals} from '@operation/helper/globals.ts';\nimport type {TOperation} from '@operation/types.ts';\n\nexport interface ISetGlobalDataOperationData {\n /**\n * @required\n * @erased\n */\n propertyNames: string[];\n}\n\n/**\n * This operation copies the specified properties from the operationData to the global data.\n *\n * @category Data\n */\nexport const setGlobalData: TOperation<\n ISetGlobalDataOperationData,\n Omit<ISetGlobalDataOperationData, 'propertyNames'>\n> = (operationData: ISetGlobalDataOperationData) => {\n const {propertyNames, ...newOperationData} = operationData;\n const newGlobals = Object.fromEntries(\n Object.entries(operationData).filter(([name, _value]) =>\n propertyNames.includes(name)\n )\n );\n\n setGlobals(newGlobals);\n\n return newOperationData;\n};\n","import {resolvePropertyValues} from '@operation/helper/resolve-property-values.ts';\nimport type {TOperation} from '@operation/types.ts';\n\nexport interface ISetOperationData {\n /**\n * If set to true, the plucked properties replace the current operation data.\n * @erased\n */\n override?: boolean;\n /**\n * @required\n * @erased\n */\n properties: Record<string, any>;\n}\n\n/**\n * This operation assigns the specified properties to the current operation data.\n * When override is set to true the properties replace the current operation data entirely.\n *\n * @category Data\n */\nexport const setOperationData: TOperation<\n ISetOperationData,\n Omit<ISetOperationData, 'override' | 'properties'>\n> = function (operationData: ISetOperationData) {\n const {override = false, properties, ...newOperationData} = operationData;\n\n const resolvedProperties = resolvePropertyValues(\n newOperationData,\n this,\n properties\n );\n\n if (override) {\n return resolvedProperties;\n }\n\n return {\n ...newOperationData,\n ...resolvedProperties,\n };\n};\n","import {removeProperties} from '@operation/helper/remove-operation-properties.ts';\nimport {resolvePropertyValues} from '@operation/helper/resolve-property-values.ts';\nimport type {TOperation} from '@operation/types.ts';\n\nexport interface ISetStyleOperationData {\n /**\n * @type=ParameterType:cssProperties\n * @required\n * @erased\n */\n properties: Record<string, any>;\n /**\n * @dependency\n */\n selectedElement: JQuery;\n}\n\n/**\n * This operation assigns the specified CSS style properties to the\n * given selected element.\n *\n * @category DOM\n */\nexport const setStyle: TOperation<\n ISetStyleOperationData,\n Omit<ISetStyleOperationData, 'properties'>\n> = function (operationData: ISetStyleOperationData) {\n const properties = resolvePropertyValues(\n operationData,\n this,\n operationData.properties\n );\n operationData.selectedElement.css(properties as JQuery.PlainObject);\n\n removeProperties(operationData, 'properties');\n\n return operationData;\n};\n","import {removeProperties} from '@operation/helper/remove-operation-properties.ts';\nimport type {TOperation} from '@operation/types.ts';\n\nexport interface ISetVariableOperationData {\n /**\n * @required\n * @erased\n */\n name: string;\n /**\n * @type=ParameterType:object|ParameterType:string|ParameterType:number|ParameterType:boolean|ParameterType:array\n * @required\n * @erased\n */\n value: any;\n}\n\n/**\n * This operation sets a variable with the specified name on the scope with the specified value.\n *\n * @category Data\n */\nexport const setVariable: TOperation<\n ISetVariableOperationData,\n Omit<ISetVariableOperationData, 'name' | 'value'>\n> = function (operationData: ISetVariableOperationData) {\n const {name, value} = operationData;\n\n if (!this.variables) {\n this.variables = {};\n }\n\n this.variables[name] = value;\n\n removeProperties(operationData, 'name', 'value');\n\n return operationData;\n};\n","import {removeProperties} from '@operation/helper/remove-operation-properties.ts';\nimport type {TOperation} from '@operation/types.ts';\n\nexport type SortOrder = 'asc' | 'desc';\n\nexport interface ISortArrayOperationData {\n /**\n * @required\n * @dependency\n */\n arrayData: any[];\n /**\n * @optional\n * @erased\n */\n sortProperty?: string;\n /**\n * @optional\n * @erased\n */\n sortOrder?: SortOrder;\n /**\n * @optional\n * @erased\n */\n sortComparator?: (a: any, b: any) => number;\n /**\n * @output\n */\n sortedArray: any[];\n}\n\n/**\n * Sorts an array by property, natural order, or custom comparator function.\n *\n * Operates on arrayData passed from previous operations.\n * Supports three sorting modes:\n * 1. Property sort: `sortProperty` and `sortOrder` to sort objects by property\n * 2. Natural sort: `sortOrder` alone for primitive arrays\n * 3. Custom comparator: `sortComparator` function for complex sorting logic\n *\n * @returns Operation data with `sortedArray` containing sorted results\n *\n * @example\n * ```typescript\n * // Sort objects by property\n * const result = sortArray({\n * arrayData: [{name: 'Bob', age: 30}, {name: 'Alice', age: 25}],\n * sortProperty: 'age',\n * sortOrder: 'asc'\n * });\n * // result.sortedArray = [{name: 'Alice', age: 25}, {name: 'Bob', age: 30}]\n * ```\n *\n * @example\n * ```typescript\n * // Sort primitives\n * const result = sortArray({\n * arrayData: [5, 2, 8, 1],\n * sortOrder: 'desc'\n * });\n * // result.sortedArray = [8, 5, 2, 1]\n * ```\n *\n * @example\n * ```typescript\n * // Custom comparator\n * const result = sortArray({\n * arrayData: ['apple', 'Banana', 'cherry'],\n * sortComparator: (a, b) => a.toLowerCase().localeCompare(b.toLowerCase())\n * });\n * ```\n *\n * @category Array\n */\nexport const sortArray: TOperation<\n ISortArrayOperationData,\n Omit<ISortArrayOperationData, 'sortProperty' | 'sortOrder' | 'sortComparator'>\n> = (operationData: ISortArrayOperationData) => {\n const {arrayData, sortProperty, sortOrder, sortComparator} = operationData;\n\n if (!Array.isArray(arrayData)) {\n throw new Error('sortArray: arrayData is required and must be an array');\n }\n\n // Create a copy to avoid mutating original\n const sorted = [...arrayData];\n\n if (sortComparator) {\n sorted.sort(sortComparator);\n } else if (sortProperty) {\n sorted.sort((a, b) => {\n const aVal = a[sortProperty];\n const bVal = b[sortProperty];\n\n if (aVal < bVal) return sortOrder === 'desc' ? 1 : -1;\n if (aVal > bVal) return sortOrder === 'desc' ? -1 : 1;\n return 0;\n });\n } else {\n // Natural sort for primitives\n sorted.sort((a, b) => {\n if (a < b) return sortOrder === 'desc' ? 1 : -1;\n if (a > b) return sortOrder === 'desc' ? -1 : 1;\n return 0;\n });\n }\n\n operationData.sortedArray = sorted;\n\n removeProperties(\n operationData,\n 'sortProperty',\n 'sortOrder',\n 'sortComparator'\n );\n\n return operationData;\n};\n","import {removeProperties} from '@operation/helper/remove-operation-properties.ts';\nimport type {TOperation} from '@operation/types.ts';\n\nexport interface ISplitStringOperationData {\n /**\n * @required\n * @dependency\n */\n textContent: string;\n /**\n * @required\n * @erased\n */\n delimiter: string | RegExp;\n /**\n * @optional\n * @erased\n */\n limit?: number;\n /**\n * @output\n */\n resultArray: string[];\n}\n\n/**\n * Splits a string into an array by delimiter (string or regex).\n *\n * @returns Operation data with `resultArray` containing the split strings\n *\n * @example\n * ```typescript\n * const result = splitString({\n * textContent: 'apple,banana,cherry',\n * delimiter: ','\n * });\n * // result.resultArray = ['apple', 'banana', 'cherry']\n * ```\n *\n * @category String\n */\nexport const splitString: TOperation<\n ISplitStringOperationData,\n Omit<ISplitStringOperationData, 'delimiter' | 'limit'>\n> = (operationData: ISplitStringOperationData) => {\n const {textContent, delimiter, limit} = operationData;\n\n if (textContent === undefined || textContent === null) {\n throw new Error('splitString: textContent is required');\n }\n\n operationData.resultArray = textContent.split(delimiter, limit);\n\n removeProperties(operationData, 'delimiter', 'limit');\n\n return operationData;\n};\n","import type {IAction} from '@action/types.ts';\nimport {internalResolve} from '@operation/helper/internal-resolve.ts';\nimport {mergeOperationData} from '@operation/helper/merge-operation-data.ts';\nimport type {TOperation, TOperationData} from '@operation/types.ts';\n\nexport interface IStartActionOperationData {\n /**\n * @dependency\n */\n actionInstance: IAction;\n /**\n * @type=ParameterType:object\n * @erased\n */\n actionOperationData: TOperationData;\n}\n\n/**\n * This operation starts the specified action instance using the given action operation data.\n *\n * The action operation data is first merged with the current operation data before it is\n * passed on to the action. After the action has completed the action operation data properties\n * are removed from the current operation data.\n *\n * @category Action\n */\nexport const startAction: TOperation<\n IStartActionOperationData,\n Omit<IStartActionOperationData, 'actionOperationData'>\n> = (operationData: IStartActionOperationData) => {\n let {actionInstance, actionOperationData, ...newOperationData} =\n operationData;\n\n return new Promise((resolve, reject) => {\n newOperationData = mergeOperationData(\n newOperationData,\n actionOperationData\n );\n\n actionInstance.start(newOperationData).then(() => {\n Object.keys(actionOperationData).forEach(key => {\n delete (newOperationData as any)[key];\n });\n internalResolve(resolve, {...newOperationData, actionInstance});\n }, reject);\n });\n};\n","import {removeProperties} from '@operation/helper/remove-operation-properties.ts';\nimport type {TOperation} from '@operation/types.ts';\n\nexport interface ISubstringTextOperationData {\n /**\n * @required\n * @dependency\n */\n textContent: string;\n /**\n * @required\n * @erased\n */\n start: number;\n /**\n * @optional\n * @erased\n */\n end?: number;\n /**\n * @output\n */\n substring: string;\n}\n\n/**\n * Extracts a substring from text between start and end indices.\n *\n * @returns Operation data with `substring` containing the extracted text\n *\n * @example\n * ```typescript\n * const result = substringText({\n * textContent: 'Hello World',\n * start: 0,\n * end: 5\n * });\n * // result.substring = \"Hello\"\n * ```\n *\n * @category Text\n */\nexport const substringText: TOperation<\n ISubstringTextOperationData,\n Omit<ISubstringTextOperationData, 'start' | 'end'>\n> = (operationData: ISubstringTextOperationData) => {\n const {textContent, start, end} = operationData;\n\n if (textContent === undefined || textContent === null) {\n throw new Error('substringText: textContent is required');\n }\n\n if (typeof start !== 'number') {\n throw new Error('substringText: start must be a number');\n }\n\n operationData.substring = textContent.substring(start, end);\n\n removeProperties(operationData, 'start', 'end');\n\n return operationData;\n};\n","import type {TOperation} from '@operation/types.ts';\n\nexport interface IToggleClassOperationData {\n /**\n * The element on which the class will be toggled\n * @dependency\n */\n selectedElement: JQuery;\n /**\n * The class that will be toggled\n * @type=ParameterType:className\n * @required\n * @erased\n */\n className: string;\n}\n\n/**\n * This operation toggles the specfied class name on the given selected element.\n *\n * Meaning, if the specified class name exists on the given element it will be removed,\n * otherwise it will be added.\n *\n * @category DOM\n */\nexport const toggleClass: TOperation<\n IToggleClassOperationData,\n Omit<IToggleClassOperationData, 'className'>\n> = (operationData: IToggleClassOperationData) => {\n const {selectedElement, className} = operationData;\n selectedElement.toggleClass(className);\n delete (operationData as any).className;\n return operationData;\n};\n","import type {TOperation} from '@operation/types.ts';\n\nexport interface IToggleElementOperationData {\n /**\n * The element whose visibility will be toggled\n * @dependency\n */\n selectedElement: JQuery;\n}\n\n/**\n * This operation toggles the visibility of the given selected element.\n *\n * Meaning, if the element is hidden, it will be made visible, otherwise\n * it will be hidden.\n *\n * @category DOM\n */\nexport const toggleElement: TOperation<IToggleElementOperationData> =\n function toggleElement(operationData: IToggleElementOperationData) {\n operationData.selectedElement.toggle();\n return operationData;\n };\n","import {removeProperties} from '@operation/helper/remove-operation-properties.ts';\nimport type {TOperation} from '@operation/types.ts';\n\nexport interface IToggleFormElementOperationData {\n /**\n * @required\n * @dependency\n */\n selectedElement: JQuery;\n /**\n * @required\n * @erased\n */\n enabled: boolean;\n}\n\n/**\n * Enables or disables form input elements (inputs, selects, textareas, buttons).\n *\n * Sets the `disabled` property on the element. When `enabled` is true, removes the disabled\n * attribute; when false, adds the disabled attribute.\n *\n * @example\n * ```typescript\n * // Disable an input field\n * toggleFormElement({selectedElement: $input, enabled: false});\n * // Input is now disabled\n * ```\n *\n * @example\n * ```typescript\n * // Enable a previously disabled button\n * toggleFormElement({selectedElement: $button, enabled: true});\n * // Button is now enabled\n * ```\n *\n * @category Form\n */\nexport const toggleFormElement: TOperation<\n IToggleFormElementOperationData,\n Omit<IToggleFormElementOperationData, 'enabled'>\n> = (operationData: IToggleFormElementOperationData) => {\n const {selectedElement, enabled} = operationData;\n\n if (!selectedElement || selectedElement.length === 0) {\n throw new Error('toggleFormElement: selectedElement is required');\n }\n\n // Set disabled property (disabled = !enabled)\n selectedElement.prop('disabled', !enabled);\n\n removeProperties(operationData, 'enabled');\n\n return operationData;\n};\n","import {removeProperties} from '@operation/helper/remove-operation-properties.ts';\nimport type {TOperation} from '@operation/types.ts';\nimport $ from 'jquery';\n\nexport interface IValidationRules {\n required?: boolean;\n minLength?: number;\n maxLength?: number;\n pattern?: string | RegExp;\n email?: boolean;\n}\n\nexport interface IValidateFormOperationData {\n /**\n * @required\n * @dependency\n */\n selectedElement: JQuery;\n /**\n * @erased\n */\n validationRules?: Record<string, IValidationRules>;\n /**\n * @output\n * @type=ParameterType:object\n */\n validationErrors?: Record<string, string>;\n /**\n * @output\n */\n isValid?: boolean;\n}\n\n/**\n * Validates form fields against HTML5 validation and custom rules.\n *\n * Uses HTML5 validation API (checkValidity()) for native validation, and supports\n * custom validation rules for: required, minLength, maxLength, pattern (regex), and email format.\n *\n * @returns Operation data with `validationErrors` object (field names → error messages) and `isValid` boolean\n *\n * @example\n * ```typescript\n * // Validate with HTML5 validation\n * const result = validateForm({selectedElement: $form});\n * // Returns: {isValid: true, validationErrors: {}}\n * ```\n *\n * @example\n * ```typescript\n * // Validate with custom rules\n * const result = validateForm({\n * selectedElement: $form,\n * validationRules: {\n * password: { required: true, minLength: 8 },\n * email: { email: true }\n * }\n * });\n * // Returns: {isValid: false, validationErrors: {password: \"Must be at least 8 characters\"}}\n * ```\n *\n * @category Form\n */\nexport const validateForm: TOperation<\n IValidateFormOperationData,\n Omit<IValidateFormOperationData, 'validationRules'>\n> = (operationData: IValidateFormOperationData) => {\n const {selectedElement, validationRules} = operationData;\n\n if (!selectedElement || selectedElement.length === 0) {\n throw new Error('validateForm: selectedElement is required');\n }\n\n if (!selectedElement.is('form')) {\n throw new Error('validateForm: selectedElement must be a form element');\n }\n\n const validationErrors: Record<string, string> = {};\n const emailRegex = /^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$/;\n\n // Get all form inputs\n const inputs = selectedElement.find('input, select, textarea');\n\n inputs.each((_, element) => {\n const $input = $(element);\n const name = $input.attr('name');\n\n if (!name) return; // Skip inputs without name attribute\n\n const value = $input.val() as string;\n const rules = validationRules?.[name];\n\n // HTML5 validation first\n const inputElement = element as\n | HTMLInputElement\n | HTMLTextAreaElement\n | HTMLSelectElement;\n if (inputElement.checkValidity && !inputElement.checkValidity()) {\n validationErrors[name] =\n inputElement.validationMessage || 'Invalid value';\n return;\n }\n\n // Custom validation rules\n if (rules) {\n if (rules.required && (!value || value.trim() === '')) {\n validationErrors[name] = 'This field is required';\n return;\n }\n\n if (rules.minLength && value.length < rules.minLength) {\n validationErrors[name] =\n `Must be at least ${rules.minLength} characters`;\n return;\n }\n\n if (rules.maxLength && value.length > rules.maxLength) {\n validationErrors[name] =\n `Must be no more than ${rules.maxLength} characters`;\n return;\n }\n\n if (rules.pattern) {\n const pattern =\n typeof rules.pattern === 'string'\n ? new RegExp(rules.pattern)\n : rules.pattern;\n if (!pattern.test(value)) {\n validationErrors[name] = 'Invalid format';\n return;\n }\n }\n\n if (rules.email && !emailRegex.test(value)) {\n validationErrors[name] = 'Must be a valid email address';\n return;\n }\n }\n });\n\n operationData.validationErrors = validationErrors;\n operationData.isValid = Object.keys(validationErrors).length === 0;\n\n removeProperties(operationData, 'validationRules');\n\n return operationData;\n};\n","import {internalResolve} from '@operation/helper/internal-resolve.ts';\nimport type {TOperation} from '@operation/types.ts';\n\nexport interface IWaitOperationData {\n /**\n * The amount of milliseconds the operation will wait for.\n * @required\n * @erased\n */\n milliseconds: number;\n}\n\n/**\n * This operation waits for the specified amount of milliseconds.\n *\n * @category Utility\n */\nexport const wait: TOperation<\n IWaitOperationData,\n Omit<IWaitOperationData, 'milliseconds'>\n> = (operationData: IWaitOperationData) => {\n const {milliseconds, ...newOperationData} = operationData;\n\n return new Promise(resolve => {\n setTimeout(() => {\n internalResolve(resolve, newOperationData);\n }, milliseconds);\n });\n};\n","export type {IAddClassOperationData} from '@operation/add-class.ts';\nexport {addClass} from '@operation/add-class.ts';\nexport type {IAddControllerToElementOperationData} from '@operation/add-controller-to-element.ts';\nexport {addControllerToElement} from '@operation/add-controller-to-element.ts';\nexport {addGlobalsToOperation} from '@operation/add-globals-to-operation.ts';\nexport type {IAnimateOperationData} from '@operation/animate.ts';\nexport {animate} from '@operation/animate.ts';\nexport type {IAnimateWithClassOperationData} from '@operation/animate-with-class.ts';\nexport {animateWithClass} from '@operation/animate-with-class.ts';\nexport type {IAnnounceToScreenReaderOperationData} from '@operation/announce-to-screen-reader.ts';\nexport {announceToScreenReader} from '@operation/announce-to-screen-reader.ts';\nexport {breakForEach} from '@operation/break-for-each.ts';\nexport type {IBroadcastEventOperationData} from '@operation/broadcast-event.ts';\nexport {broadcastEvent} from '@operation/broadcast-event.ts';\nexport type {ICalcOperationData} from '@operation/calc.ts';\nexport {calc} from '@operation/calc.ts';\nexport type {IClearElementOperationData} from '@operation/clear-element.ts';\nexport {clearElement} from '@operation/clear-element.ts';\nexport type {IClearOperationDataOperationData} from '@operation/clear-operation-data.ts';\nexport {clearOperationData} from '@operation/clear-operation-data.ts';\nexport type {\n IClearStorageOperationData,\n StorageType,\n} from '@operation/clear-storage.ts';\nexport {clearStorage} from '@operation/clear-storage.ts';\nexport type {ICompareDateOperationData} from '@operation/compare-date.ts';\nexport {compareDate} from '@operation/compare-date.ts';\nexport type {IConcatenateStringsOperationData} from '@operation/concatenate-strings.ts';\nexport {concatenateStrings} from '@operation/concatenate-strings.ts';\nexport {continueForEach} from '@operation/continue-for-each.ts';\nexport type {ICreateElementOperationData} from '@operation/create-element.ts';\nexport {createElement} from '@operation/create-element.ts';\nexport type {ICustomFunctionOperationData} from '@operation/custom-function.ts';\nexport {customFunction} from '@operation/custom-function.ts';\nexport type {IEndActionOperationData} from '@operation/end-action.ts';\nexport {endAction} from '@operation/end-action.ts';\nexport {endForEach} from '@operation/end-for-each.ts';\nexport {endWhen} from '@operation/end-when.ts';\nexport type {IExtendControllerOperationData} from '@operation/extend-controller.ts';\nexport {extendController} from '@operation/extend-controller.ts';\nexport type {IFilterArrayOperationData} from '@operation/filter-array.ts';\nexport {filterArray} from '@operation/filter-array.ts';\nexport type {IFindInArrayOperationData} from '@operation/find-in-array.ts';\nexport {findInArray} from '@operation/find-in-array.ts';\nexport type {IForEachOperationData} from '@operation/for-each.ts';\nexport {forEach} from '@operation/for-each.ts';\nexport type {IFormatDateOperationData} from '@operation/format-date.ts';\nexport {formatDate} from '@operation/format-date.ts';\nexport type {IFormatTextOperationData} from '@operation/format-text.ts';\nexport {formatText} from '@operation/format-text.ts';\nexport type {IGetAttributesFromElementOperationData} from '@operation/get-attributes-from-element.ts';\nexport {getAttributesFromElement} from '@operation/get-attributes-from-element.ts';\nexport type {IGetControllerFromElementOperationData} from '@operation/get-controller-from-element.ts';\nexport {getControllerFromElement} from '@operation/get-controller-from-element.ts';\nexport type {IGetControllerInstanceOperationData} from '@operation/get-controller-instance.ts';\nexport {getControllerInstance} from '@operation/get-controller-instance.ts';\nexport type {IGetCurrentTimeOperationData} from '@operation/get-current-time.ts';\nexport {getCurrentTime} from '@operation/get-current-time.ts';\nexport type {IGetElementDimensionsOperationData} from '@operation/get-element-dimensions.ts';\nexport {getElementDimensions} from '@operation/get-element-dimensions.ts';\nexport type {IGetFocusedElementOperationData} from '@operation/get-focused-element.ts';\nexport {getFocusedElement} from '@operation/get-focused-element.ts';\nexport type {IGetFormDataOperationData} from '@operation/get-form-data.ts';\nexport {getFormData} from '@operation/get-form-data.ts';\nexport type {IGetImportOperationData} from '@operation/get-import.ts';\nexport {getImport} from '@operation/get-import.ts';\nexport type {IGetQueryParamsOperationData} from '@operation/get-query-params.ts';\nexport {getQueryParams} from '@operation/get-query-params.ts';\nexport type {IGetScrollPositionOperationData} from '@operation/get-scroll-position.ts';\nexport {getScrollPosition} from '@operation/get-scroll-position.ts';\nexport type {IGetTextContentOperationData} from '@operation/get-text-content.ts';\nexport {getTextContent} from '@operation/get-text-content.ts';\nexport type {IHttpDeleteOperationData} from '@operation/http-delete.ts';\nexport {httpDelete} from '@operation/http-delete.ts';\nexport type {IHttpPostOperationData} from '@operation/http-post.ts';\nexport {httpPost} from '@operation/http-post.ts';\nexport type {IHttpPutOperationData} from '@operation/http-put.ts';\nexport {httpPut} from '@operation/http-put.ts';\nexport type {IInvokeObjectMethodOperationData} from '@operation/invoke-object-method.ts';\nexport {invokeObjectMethod} from '@operation/invoke-object-method.ts';\nexport type {IIsElementInViewportOperationData} from '@operation/is-element-in-viewport.ts';\nexport {isElementInViewport} from '@operation/is-element-in-viewport.ts';\nexport type {ILoadFromStorageOperationData} from '@operation/load-from-storage.ts';\nexport {loadFromStorage} from '@operation/load-from-storage.ts';\nexport type {ILoadJSONOperationData} from '@operation/load-json.ts';\nexport {loadJson} from '@operation/load-json.ts';\nexport type {ILogOperationData} from '@operation/log.ts';\nexport {log} from '@operation/log.ts';\nexport type {IMapArrayOperationData} from '@operation/map-array.ts';\nexport {mapArray} from '@operation/map-array.ts';\nexport type {IMathOperationData} from '@operation/math.ts';\nexport {math} from '@operation/math.ts';\nexport {otherwise} from '@operation/otherwise.ts';\nexport type {IRemoveClassOperationData} from '@operation/remove-class.ts';\nexport {removeClass} from '@operation/remove-class.ts';\nexport type {IRemoveControllerFromElementOperationData} from '@operation/remove-controller-from-element.ts';\nexport {removeControllerFromElement} from '@operation/remove-controller-from-element.ts';\nexport type {IRemoveElementOperationData} from '@operation/remove-element.ts';\nexport {removeElement} from '@operation/remove-element.ts';\nexport type {IRemovePropertiesFromOperationDataOperationData} from '@operation/remove-properties-from-operation-data.ts';\nexport {removePropertiesFromOperationData} from '@operation/remove-properties-from-operation-data.ts';\nexport type {IReparentElementOperationData} from '@operation/reparent-element.ts';\nexport {reparentElement} from '@operation/reparent-element.ts';\nexport type {IReplaceStringOperationData} from '@operation/replace-string.ts';\nexport {replaceString} from '@operation/replace-string.ts';\nexport type {IReplaceTextOperationData} from '@operation/replace-text.ts';\nexport {replaceText} from '@operation/replace-text.ts';\nexport type {IRequestActionOperationData} from '@operation/request-action.ts';\nexport {requestAction} from '@operation/request-action.ts';\nexport type {ISaveToStorageOperationData} from '@operation/save-to-storage.ts';\nexport {saveToStorage} from '@operation/save-to-storage.ts';\nexport type {IScrollToElementOperationData} from '@operation/scroll-to-element.ts';\nexport {scrollToElement} from '@operation/scroll-to-element.ts';\nexport type {IScrollToPositionOperationData} from '@operation/scroll-to-position.ts';\nexport {scrollToPosition} from '@operation/scroll-to-position.ts';\nexport type {ISelectElementOperationData} from '@operation/select-element.ts';\nexport {selectElement} from '@operation/select-element.ts';\nexport type {ISetDataOperationData} from '@operation/set-data.ts';\nexport {setData} from '@operation/set-data.ts';\nexport type {ISetElementAttributesOperationData} from '@operation/set-element-attributes.ts';\nexport {setElementAttributes} from '@operation/set-element-attributes.ts';\nexport type {ISetElementContentOperationData} from '@operation/set-element-content.ts';\nexport {setElementContent} from '@operation/set-element-content.ts';\nexport type {ISetFocusOperationData} from '@operation/set-focus.ts';\nexport {setFocus} from '@operation/set-focus.ts';\nexport type {ISetFormValueOperationData} from '@operation/set-form-value.ts';\nexport {setFormValue} from '@operation/set-form-value.ts';\nexport type {ISetGlobalDataOperationData} from '@operation/set-global-data.ts';\nexport {setGlobalData} from '@operation/set-global-data.ts';\nexport type {ISetOperationData} from '@operation/set-operation-data.ts';\nexport {setOperationData} from '@operation/set-operation-data.ts';\nexport type {ISetStyleOperationData} from '@operation/set-style.ts';\nexport {setStyle} from '@operation/set-style.ts';\nexport type {ISetVariableOperationData} from '@operation/set-variable.ts';\nexport {setVariable} from '@operation/set-variable.ts';\nexport type {ISortArrayOperationData} from '@operation/sort-array.ts';\nexport {sortArray} from '@operation/sort-array.ts';\nexport type {ISplitStringOperationData} from '@operation/split-string.ts';\nexport {splitString} from '@operation/split-string.ts';\nexport type {IStartActionOperationData} from '@operation/start-action.ts';\nexport {startAction} from '@operation/start-action.ts';\nexport type {ISubstringTextOperationData} from '@operation/substring-text.ts';\nexport {substringText} from '@operation/substring-text.ts';\nexport type {IToggleClassOperationData} from '@operation/toggle-class.ts';\nexport {toggleClass} from '@operation/toggle-class.ts';\nexport type {IToggleElementOperationData} from '@operation/toggle-element.ts';\nexport {toggleElement} from '@operation/toggle-element.ts';\nexport type {IToggleFormElementOperationData} from '@operation/toggle-form-element.ts';\nexport {toggleFormElement} from '@operation/toggle-form-element.ts';\nexport type * from '@operation/types.ts';\nexport type {IValidateFormOperationData} from '@operation/validate-form.ts';\nexport {validateForm} from '@operation/validate-form.ts';\nexport type {IWaitOperationData} from '@operation/wait.ts';\nexport {wait} from '@operation/wait.ts';\nexport type {IWhenOperationData} from '@operation/when.ts';\nexport {when} from '@operation/when.ts';\n","import type {ConfigurationFactory} from '@configuration/api/configuration-factory.ts';\nimport type {\n ExtractOperationDataType,\n GetOperationByName,\n IActionConfiguration,\n IEndableActionConfiguration,\n ITimelineActionConfiguration,\n TOperationName,\n TOperationType,\n} from '@configuration/types.ts';\nimport {deepCopy} from '@operation/helper/deep-copy.ts';\nimport * as operations from '@operation/index.ts';\nimport {v4 as uuidv4} from 'uuid';\n\n/**\n *\n * Container factory capable of creating the different kinds of actions.\n * For each type of action a dedicated factory will be returned.\n *\n */\nexport class ActionCreatorFactory {\n constructor(private readonly configurationfactory: ConfigurationFactory) {}\n\n /**\n *\n * Starts the creation of an action in the `actions` list with the specified name\n *\n * @param name\n * @returns\n */\n createAction(name: string): EndableActionCreator {\n const creator = new EndableActionCreator(name, this);\n this.configurationfactory.addAction(creator.actionConfig);\n return creator;\n }\n\n /**\n *\n * Starts the creation of an action in the `initActions` list with the specified name\n *\n * @param name\n * @returns\n */\n createInitAction(name: string): EndableActionCreator {\n const creator = new EndableActionCreator(name, this);\n this.configurationfactory.addInitAction(creator.actionConfig);\n return creator;\n }\n\n /**\n *\n * Starts the creation of an action in the `eventActions` list with the specified name\n *\n * @param name\n * @returns\n */\n createEventAction(name: string): ActionCreator {\n const creator = new ActionCreator(name, this);\n this.configurationfactory.addEventAction(creator.actionConfig);\n return creator;\n }\n\n /**\n *\n * Starts the creation of an action in the `timelineActions` list with the specified name and uri\n *\n * @param uri\n * @param name\n * @returns\n */\n createTimelineAction(uri: string, name: string): TimelineActionCreator {\n const creator = new TimelineActionCreator(name, this);\n this.configurationfactory.addTimelineAction(uri, creator.actionConfig);\n return creator;\n }\n\n /**\n *\n * Returns the fluent scope back to the `Configurationfactory`\n *\n * @returns\n */\n end() {\n return this.configurationfactory;\n }\n}\n\n/**\n *\n * A factory that assists in creating an action\n *\n */\nexport class ActionCreator<\n T extends IActionConfiguration = IActionConfiguration,\n> {\n actionConfig: T;\n\n /**\n *\n * Initializes an action configuration with the given name\n *\n * @param name\n * @param factory\n */\n constructor(\n name: string | undefined,\n private readonly factory: ActionCreatorFactory\n ) {\n this.actionConfig = {\n name: name ?? '',\n id: uuidv4(),\n startOperations: [],\n } as unknown as T;\n }\n\n /**\n *\n * The unique id of the action\n *\n * @returns\n */\n getId() {\n return this.actionConfig.id;\n }\n\n /**\n *\n * Sets the name of the action\n *\n * @param name\n * @returns\n */\n setName(name: string) {\n this.actionConfig.name = name;\n return this;\n }\n\n /**\n *\n * Returns a copy of the internal state of the `ActionCreator`\n *\n * @param callBack\n * @returns\n */\n getConfiguration(callBack: (config: T) => T) {\n const copy = deepCopy(this.actionConfig);\n const newConfig = callBack.call(this, copy);\n if (newConfig) {\n this.actionConfig = newConfig;\n }\n return this;\n }\n\n /**\n *\n * Adds the operation data for a start operation specified by the given type\n *\n * @param operationClass\n * @param operationData\n * @returns\n */\n addStartOperationByType<\n T extends TOperationType,\n Dt extends Partial<ExtractOperationDataType<T>>,\n >(operationClass: T, operationData: Dt) {\n const entries = Object.entries(operations).find(\n ([, value]) => value === operationClass\n );\n\n if (entries) {\n return this.addStartOperation(\n entries[0] as TOperationName,\n operationData\n );\n }\n\n throw new Error(`Operation class not found: ${operationClass.toString()}`);\n }\n\n /**\n *\n * Adds the operation data for a start operation specified by the given system name\n *\n * @param systemName\n * @param operationData\n * @returns\n */\n addStartOperation<\n T extends TOperationName,\n O extends Partial<ExtractOperationDataType<GetOperationByName<T>>>,\n >(systemName: T, operationData: O) {\n if (!(operations as Record<string, any>)[systemName]) {\n throw Error(`Unknown operation: ${systemName}`);\n }\n\n const {startOperations} = this.actionConfig;\n startOperations.push({\n id: uuidv4(),\n systemName: systemName,\n operationData: operationData,\n });\n return this;\n }\n\n /**\n *\n * Returns the fluent scope back to the `ActionCreatorFactory`\n *\n * @returns\n */\n next() {\n return this.factory;\n }\n}\n\n/**\n *\n * A factory that assists in creating an endable action\n *\n */\nexport class EndableActionCreator<\n T extends IEndableActionConfiguration = IEndableActionConfiguration,\n> extends ActionCreator<T> {\n constructor(name: string | undefined, factory: ActionCreatorFactory) {\n super(name, factory);\n this.actionConfig.endOperations = [];\n }\n\n /**\n *\n * Adds the operation data for an end operation specified by the given type\n *\n * @param operationClass\n * @param operationData\n * @returns\n */\n addEndOperationByType<\n T extends TOperationType,\n Dt extends Partial<ExtractOperationDataType<T>>,\n >(operationClass: T, operationData: Dt) {\n const entries = Object.entries(operations).find(\n ([, value]) => value === operationClass\n );\n\n if (entries) {\n return this.addEndOperation(entries[0] as TOperationName, operationData);\n }\n\n throw new Error(`Operation class not found: ${operationClass.toString()}`);\n }\n\n /**\n *\n * Adds the operation data for an end operation specified by the given system name\n *\n * @param systemName\n * @param operationData\n * @returns\n */\n addEndOperation<\n T extends TOperationName,\n O extends Partial<ExtractOperationDataType<GetOperationByName<T>>>,\n >(systemName: TOperationName, operationData: O) {\n // biome-ignore lint/performance/noDynamicNamespaceImportAccess: Dynamic operation lookup is intentional for configuration API\n if (!operations[systemName]) {\n throw Error(`Unknown operation: ${systemName}`);\n }\n\n let {endOperations} = this.actionConfig;\n if (!endOperations) {\n endOperations = this.actionConfig.endOperations = [];\n }\n endOperations.push({\n id: uuidv4(),\n systemName: systemName,\n operationData: operationData,\n });\n return this;\n }\n}\n\n/**\n *\n * A factory that assists in creating a timeline action\n *\n */\nexport class TimelineActionCreator extends EndableActionCreator<ITimelineActionConfiguration> {\n /**\n *\n * Sets the duration specified by the given start and optional end positions\n *\n * @param start\n * @param end\n * @returns\n */\n addDuration(start: number, end?: number) {\n this.actionConfig.duration = {\n start: start,\n };\n if (end) {\n this.actionConfig.duration.end = end;\n }\n return this;\n }\n}\n","import type {ConfigurationFactory} from '@configuration/api/configuration-factory.ts';\nimport type {\n ExtractOperationDataType,\n GetOperationByName,\n IActionConfiguration,\n IEndableActionConfiguration,\n IOperationConfiguration,\n ITimelineActionConfiguration,\n TOperationName,\n TOperationType,\n} from '@configuration/types.ts';\nimport {deepCopy} from '@operation/helper/deep-copy.ts';\nimport * as operations from '@operation/index.ts';\nimport type {TOperation, TOperationData} from '@operation/types.ts';\nimport {isDefined} from 'ts-is-present';\nimport {v4 as uuidv4} from 'uuid';\nimport type {IDuration} from '../../types.ts';\n\nfunction array_move(arr: any[], old_index: number, new_index: number) {\n if (new_index >= arr.length) {\n new_index = 0;\n } else if (new_index < 0) {\n new_index = arr.length - 1;\n }\n arr.splice(new_index, 0, arr.splice(old_index, 1)[0]);\n}\n\n/**\n *\n * A factory that assists in editing an action\n *\n */\nexport class ActionEditor<\n T extends IActionConfiguration = IActionConfiguration,\n> {\n constructor(\n protected actionConfig: T,\n protected readonly configurationFactory: ConfigurationFactory\n ) {}\n\n updateConfiguration() {\n this.actionConfig = structuredClone(this.actionConfig);\n }\n\n /**\n *\n * Returns a copy of the current internal state of the factory\n *\n * @param callBack\n * @returns\n */\n getConfiguration(callBack: (config: T) => T | undefined) {\n const copy = deepCopy(this.actionConfig);\n const newConfig = callBack.call(this, copy);\n if (newConfig) {\n this.actionConfig = newConfig;\n }\n return this;\n }\n\n /**\n *\n * Sets the action name\n *\n * @param name\n * @returns\n */\n setName(name: string) {\n this.actionConfig = {\n ...this.actionConfig,\n name,\n };\n return this;\n }\n\n /**\n *\n * Gets the action name\n *\n * @returns\n */\n getName() {\n return this.actionConfig.name;\n }\n\n /**\n *\n * Adds the operation data for a start operation specified by the given type\n *\n * @param operationClass\n * @param operationData\n * @returns\n */\n addStartOperationByType<T extends TOperation<TOperationData>>(\n operationClass: T,\n operationData: Partial<ExtractOperationDataType<T>>\n ): OperationEditor<this, T> {\n const entries = Object.entries(operations).find(\n ([, value]) => value === operationClass\n );\n\n if (entries) {\n return this.addStartOperation(\n entries[0] as TOperationName,\n operationData\n ) as OperationEditor<this, T>;\n }\n\n throw new Error(`Operation class not found: ${operationClass.toString()}`);\n }\n\n /**\n *\n * Adds the operation data for a start operation specified by the given system name\n *\n * @param systemName\n * @param operationData\n * @param id\n * @returns\n */\n addStartOperation(\n systemName: TOperationName,\n operationData: TOperationData,\n id: string = uuidv4()\n ): OperationEditor<this, TOperation<TOperationData>> {\n if (!(operations as any)[systemName]) {\n throw Error(`Unknown operation: ${systemName}`);\n }\n\n const startOperations = this.actionConfig.startOperations\n ? this.actionConfig.startOperations.slice()\n : [];\n\n const newConfig = {\n id,\n systemName: systemName,\n operationData: operationData,\n } as IOperationConfiguration<TOperation<TOperationData>>;\n\n startOperations.push(newConfig);\n\n this.actionConfig = {\n ...this.actionConfig,\n startOperations,\n };\n\n return new OperationEditor<this, TOperation<TOperationData>>(\n newConfig,\n this\n );\n }\n\n /**\n *\n * Starts an editor for the start operation associated with the given id\n *\n * @param id\n * @returns\n */\n editStartOperation(id: string) {\n const {startOperations} = this.actionConfig;\n const operation = startOperations.find(o => o.id === id);\n\n if (isDefined(operation)) {\n return new OperationEditor<ActionEditor<T>, TOperation<TOperationData>>(\n operation,\n this\n );\n }\n\n throw new Error(`start operation not found for id ${id}`);\n }\n\n /**\n *\n * Removes the start operation associated with the given id\n *\n * @param id\n * @returns\n */\n removeStartOperation(id: string) {\n const startOperations = this.actionConfig.startOperations\n ? this.actionConfig.startOperations.slice()\n : [];\n const operation = startOperations.find(o => o.id === id);\n\n if (!operation) {\n throw new Error(`start operation not found for id ${id}`);\n }\n\n const idx = startOperations.indexOf(operation);\n\n if (idx > -1) {\n startOperations.splice(idx, 1);\n this.actionConfig = {\n ...this.actionConfig,\n startOperations,\n };\n }\n\n return this;\n }\n\n /**\n *\n * Moves the start operation associated with the given id in the given direction\n *\n * @param id\n * @param direction\n * @returns\n */\n moveStartOperation(id: string, direction: 'up' | 'down') {\n const startOperations = this.actionConfig.startOperations\n ? this.actionConfig.startOperations.slice()\n : [];\n const operation = startOperations.find(o => o.id === id);\n\n if (!operation) {\n throw new Error(`start operation not found for id ${id}`);\n }\n\n const idx = startOperations.indexOf(operation);\n\n if (idx > -1) {\n const newIdx = direction === 'up' ? idx + 1 : idx - 1;\n array_move(startOperations, idx, newIdx);\n this.actionConfig = {\n ...this.actionConfig,\n startOperations,\n };\n }\n\n return this;\n }\n\n /**\n *\n * Return the fluent scopt to the `ConfigurationFactory`\n *\n * @returns\n */\n next() {\n return this.configurationFactory;\n }\n}\n\n/**\n *\n * A factory that assists in editing an endable action\n *\n */\nexport class EndableActionEditor<\n T extends IEndableActionConfiguration = IEndableActionConfiguration,\n> extends ActionEditor<T> {\n /**\n *\n * Adds the operation data for a end operation specified by the given type\n *\n * @param operationClass\n * @param operationData\n * @returns\n */\n addEndOperationByType<\n T extends TOperationType,\n Dt extends Partial<ExtractOperationDataType<T>>,\n >(\n operationClass: T,\n operationData: Dt\n ): OperationEditor<this, TOperationType> {\n const entries = Object.entries(operations).find(\n ([, value]) => value === operationClass\n );\n\n if (entries) {\n return this.addEndOperation(entries[0] as TOperationName, operationData);\n }\n\n throw new Error(`Operation class not found: ${operationClass.toString()}`);\n }\n\n /**\n *\n * Adds the operation data for a start operation specified by the given system name\n *\n * @param systemName\n * @param operationData\n * @returns\n */\n addEndOperation<\n T extends TOperationName,\n O extends Partial<ExtractOperationDataType<GetOperationByName<T>>>,\n >(systemName: TOperationName, operationData: O) {\n // biome-ignore lint/performance/noDynamicNamespaceImportAccess: Dynamic operation lookup is intentional for configuration API\n if (!operations[systemName]) {\n throw Error(`Unknown operation: ${systemName}`);\n }\n\n const endOperations = this.actionConfig.endOperations\n ? this.actionConfig.endOperations.slice()\n : [];\n\n const newConfig = {\n id: uuidv4(),\n systemName: systemName,\n operationData: operationData,\n };\n\n endOperations.push(newConfig);\n\n this.actionConfig.endOperations = endOperations;\n\n // biome-ignore lint/performance/noDynamicNamespaceImportAccess: Dynamic operation lookup is intentional for configuration API\n const operationCsl = operations[systemName];\n return new OperationEditor<this, typeof operationCsl>(newConfig, this);\n }\n\n /**\n *\n * Starts an editor for the end operation associated with the given id\n *\n * @param id\n * @returns\n */\n editEndOperation(id: string) {\n const {endOperations} = this.actionConfig;\n const operationConfig = endOperations.find(o => o.id === id);\n\n if (isDefined(operationConfig)) {\n return new OperationEditor<this>(operationConfig, this);\n }\n\n throw new Error(`operation not found for id ${id}`);\n }\n\n /**\n *\n * Removes the end operation associated with the given id\n *\n * @param id\n * @returns\n */\n removeEndOperation(id: string) {\n const endOperations = this.actionConfig.endOperations\n ? this.actionConfig.endOperations.slice()\n : [];\n const operation = endOperations.find(o => o.id === id);\n\n if (!isDefined(operation)) {\n throw new Error(`operation not found for id ${id}`);\n }\n\n const idx = endOperations.indexOf(operation);\n\n if (idx > -1) {\n endOperations.splice(idx, 1);\n this.actionConfig = {\n ...this.actionConfig,\n endOperations,\n };\n }\n\n return this;\n }\n\n /**\n *\n * Moves the end operation associated with the given id in the specified direction\n *\n * @param id\n * @param direction\n * @returns\n */\n moveEndOperation(id: string, direction: 'up' | 'down') {\n const endOperations = this.actionConfig.endOperations\n ? this.actionConfig.endOperations.slice()\n : [];\n const operation = endOperations.find(o => o.id === id);\n\n if (!isDefined(operation)) {\n throw new Error(`operation not found for id ${id}`);\n }\n\n const idx = endOperations.indexOf(operation);\n\n if (idx > -1) {\n const newIdx = direction === 'up' ? idx + 1 : idx - 1;\n array_move(endOperations, idx, newIdx);\n this.actionConfig = {\n ...this.actionConfig,\n endOperations,\n };\n }\n return this;\n }\n}\n\n/**\n *\n * A factory that assists in editing a timeline action\n *\n */\nexport class TimelineActionEditor extends EndableActionEditor<ITimelineActionConfiguration> {\n /**\n *\n * Sets the duration specified by the given start and optional end positions\n *\n * @param start\n * @param end\n * @returns\n */\n setDuration(start: number, end?: number) {\n if (end !== undefined && start > end) {\n throw Error('start position cannot be higher than end position');\n }\n\n const duration: IDuration = {\n start,\n };\n\n if (end) {\n duration.end = end;\n }\n\n this.actionConfig = {\n ...this.actionConfig,\n duration,\n };\n return this;\n }\n}\n\n/**\n *\n * A factory that assists in editing an operation\n *\n */\nexport class OperationEditor<\n T extends ActionEditor,\n O extends TOperationType = TOperation<TOperationData>,\n> {\n constructor(\n private operationConfig: IOperationConfiguration<\n ExtractOperationDataType<O>\n >,\n private actionEditor: T\n ) {}\n\n /**\n *\n * Invokes the given callback with a copy of the internal state of the factory\n *\n * @param callBack\n * @returns\n */\n getConfiguration(\n callBack: (\n config: IOperationConfiguration<ExtractOperationDataType<O>>\n ) => IOperationConfiguration<ExtractOperationDataType<O>>\n ) {\n const copy = deepCopy(this.operationConfig);\n const newConfig = callBack.call(this, copy);\n\n if (newConfig) {\n this.operationConfig = newConfig;\n }\n\n return this;\n }\n\n /**\n *\n * Gets the system name\n *\n * @returns\n */\n getSystemName() {\n return this.operationConfig.systemName;\n }\n\n /**\n *\n * Sets the system name\n *\n * @param systemName\n * @returns\n */\n setSystemName(systemName: TOperationName) {\n // biome-ignore lint/performance/noDynamicNamespaceImportAccess: Dynamic operation lookup is intentional for configuration API\n if (!operations[systemName]) {\n throw Error(`Unknown operation: ${systemName}`);\n }\n\n this.operationConfig.systemName = systemName;\n this.actionEditor.updateConfiguration();\n return this;\n }\n\n /**\n *\n * Sets the operation data\n *\n * @param operationData\n * @returns\n */\n setOperationData(operationData: ExtractOperationDataType<O>) {\n this.operationConfig.operationData = operationData;\n this.actionEditor.updateConfiguration();\n return this;\n }\n\n /**\n *\n * Sets the value on the current `operationData` with the given key\n *\n * @param key\n * @param value\n * @returns\n */\n setOperationDataItem(\n key: keyof ExtractOperationDataType<O>,\n value: ExtractOperationDataType<O>[keyof ExtractOperationDataType<O>]\n ) {\n let {operationData} = this.operationConfig;\n if (!operationData) {\n operationData = {} as ExtractOperationDataType<O>;\n }\n operationData[key] = value;\n return this.setOperationData(operationData);\n }\n\n /**\n *\n * returns all of the defined property names on the current `operationData`\n *\n * @returns\n */\n getOperationDataKeys(): keyof ExtractOperationDataType<O> {\n const {operationData} = this.operationConfig;\n return (operationData\n ? Object.keys(operationData)\n : []) as unknown as keyof ExtractOperationDataType<O>;\n }\n\n /**\n *\n * Gets the value of the given key on the current `operationData`\n *\n * @param key\n * @returns\n */\n getOperationDataValue(key: keyof ExtractOperationDataType<O>) {\n const {operationData} = this.operationConfig;\n return operationData?.[key];\n }\n\n /**\n *\n * Returns the fluent scope back to the action editor\n *\n * @returns\n */\n next() {\n return this.actionEditor;\n }\n}\n","import type {ConfigurationFactory} from '@configuration/api/configuration-factory.ts';\nimport type {ILanguageLabel, TLanguageCode} from '../../types.ts';\n\n/**\n * Factory that assists with editing a label\n */\nexport class LabelEditor {\n constructor(\n private configurationFactory: ConfigurationFactory,\n private languageLabel: ILanguageLabel\n ) {}\n\n private _internalGetLabel(languageCode: string) {\n return this.languageLabel.labels.find(x => x.languageCode === languageCode);\n }\n\n /**\n *\n * Set the translation associated with the given language code\n *\n * @param languageCode\n * @param translation\n * @returns\n */\n setLabel(languageCode: TLanguageCode, translation: string) {\n const label = this._internalGetLabel(languageCode);\n if (label) {\n label.label === translation;\n } else {\n throw new Error(`No label found for language code '${languageCode}'`);\n }\n return this;\n }\n\n /**\n *\n * Remove all of the translations for the given language code\n *\n * @param languageCode\n * @returns\n */\n removeLabel(languageCode: TLanguageCode) {\n const idx = this.languageLabel.labels.findIndex(\n x => x.languageCode === languageCode\n );\n if (idx > -1) {\n this.languageLabel.labels.splice(idx, 1);\n } else {\n throw new Error(`No label found for language code '${languageCode}'`);\n }\n return this;\n }\n\n /**\n *\n * Returns the fluent scope back to the `ConfigurationFactory`\n *\n * @returns\n */\n end() {\n return this.configurationFactory;\n }\n}\n","import type {ConfigurationFactory} from '@configuration/api/configuration-factory.ts';\nimport type {\n IContainerProviderConfig,\n IPlaylistConfig,\n IPositionSourceConfig,\n ITimelineProviderSettings,\n TTimelineProviderSettings,\n} from '@configuration/types.ts';\nimport type {TimelineTypes} from '../../types.ts';\n\n/**\n * Default position source system names for convenience methods.\n */\nconst DEFAULT_POSITION_SOURCES: Record<string, string> = {\n raf: 'RafPositionSource',\n scroll: 'ScrollPositionSource',\n video: 'VideoPositionSource',\n};\n\n/**\n * Default container provider system name.\n */\nconst DEFAULT_CONTAINER_PROVIDER = 'DomContainerProvider';\n\n/**\n * Default playlist system name.\n */\nconst DEFAULT_PLAYLIST = 'SimplePlaylist';\n\nexport class TimelineProvidersSettingsEditor {\n constructor(\n private providersSettings: TTimelineProviderSettings,\n private configurationFactory: ConfigurationFactory\n ) {}\n\n /**\n * Adds a new provider for the specified timeline type.\n *\n * @param timelineType - The timeline type (e.g., 'animation', 'mediaplayer')\n * @param positionSourceSystemName - System name of the position source class (default: 'RafPositionSource')\n * @returns A TimelineProviderSettingsEditor for further configuration\n */\n addProvider(\n timelineType: TimelineTypes,\n positionSourceSystemName = 'RafPositionSource'\n ) {\n if (this.providersSettings[timelineType]) {\n throw new Error(\n `Settings for a '${timelineType}' provider already exist`\n );\n }\n\n const settings: ITimelineProviderSettings = {\n positionSource: {systemName: positionSourceSystemName},\n };\n this.providersSettings[timelineType] = settings;\n return new TimelineProviderSettingsEditor(\n settings,\n this,\n this.configurationFactory\n );\n }\n\n editProvider(timelineType: TimelineTypes) {\n if (!this.providersSettings[timelineType]) {\n throw new Error(`No settings for a '${timelineType}' provider exist yet`);\n }\n\n return new TimelineProviderSettingsEditor(\n this.providersSettings[timelineType] as ITimelineProviderSettings,\n this,\n this.configurationFactory\n );\n }\n\n next() {\n return this.configurationFactory;\n }\n}\n\nexport class TimelineProviderSettingsEditor {\n constructor(\n private providerSettings: ITimelineProviderSettings,\n private providersSettingsEditor: TimelineProvidersSettingsEditor,\n private configurationFactory: ConfigurationFactory\n ) {}\n\n /**\n * Sets the position source configuration with full config object.\n * @param config - Position source configuration with systemName and options\n */\n setPositionSource(config: IPositionSourceConfig) {\n this.providerSettings.positionSource = config;\n return this;\n }\n\n /**\n * Sets the position source by system name with optional configuration.\n * @param systemName - The position source class name (e.g., 'RafPositionSource')\n * @param options - Additional options passed to the position source constructor\n */\n setPositionSourceByName(\n systemName: string,\n options?: Record<string, unknown>\n ) {\n this.providerSettings.positionSource = {\n systemName,\n ...options,\n };\n return this;\n }\n\n /**\n * Convenience method to set position source using shorthand type names.\n * @param type - Shorthand type ('raf', 'scroll', 'video')\n * @param options - Type-specific options\n * @deprecated Use setPositionSourceByName for explicit control\n */\n setPositionSourceType(\n type: 'raf' | 'scroll' | 'video',\n options?: {selector?: string; tickInterval?: number; poster?: string}\n ) {\n const systemName = DEFAULT_POSITION_SOURCES[type];\n if (!systemName) {\n throw new Error(`Unknown position source type: ${type}`);\n }\n\n this.providerSettings.positionSource = {\n systemName,\n ...options,\n };\n return this;\n }\n\n /**\n * Sets the container provider configuration by selector.\n * Uses DomContainerProvider by default.\n * @param selector - CSS selector for the container element\n */\n setContainer(selector: string) {\n this.providerSettings.container = {\n systemName: DEFAULT_CONTAINER_PROVIDER,\n selector,\n };\n return this;\n }\n\n /**\n * Sets the container provider configuration with full config object.\n * @param config - Container provider configuration with systemName\n */\n setContainerConfig(config: IContainerProviderConfig) {\n this.providerSettings.container = config;\n return this;\n }\n\n /**\n * Sets the container provider by system name with options.\n * @param systemName - The container provider class name\n * @param options - Additional options passed to the container provider constructor\n */\n setContainerByName(systemName: string, options: Record<string, unknown>) {\n this.providerSettings.container = {\n systemName,\n ...options,\n } as IContainerProviderConfig;\n return this;\n }\n\n /**\n * Sets the playlist configuration.\n * Uses SimplePlaylist by default.\n * @param items - Array of playlist items\n * @param identifierKey - Key used to identify items (default: 'uri')\n */\n setPlaylist<T>(items: readonly T[], identifierKey = 'uri') {\n this.providerSettings.playlist = {\n systemName: DEFAULT_PLAYLIST,\n items,\n identifierKey,\n } as IPlaylistConfig;\n return this;\n }\n\n /**\n * Sets the playlist configuration with full config object.\n * @param config - Playlist configuration with systemName\n */\n setPlaylistConfig(config: IPlaylistConfig) {\n this.providerSettings.playlist = config;\n return this;\n }\n\n /**\n * Sets the playlist by system name with options.\n * @param systemName - The playlist class name\n * @param options - Additional options including items and identifierKey\n */\n setPlaylistByName(\n systemName: string,\n options: {items: unknown[]; identifierKey: string; [key: string]: unknown}\n ) {\n this.providerSettings.playlist = {\n systemName,\n ...options,\n } as IPlaylistConfig;\n return this;\n }\n\n next() {\n return this.providersSettingsEditor;\n }\n\n end() {\n return this.configurationFactory;\n }\n}\n","/**\n *\n * Merges the properties of the target object into the source object, only the properties that do not exist yet on the source.\n *\n * This function is pure, so it returns a new instance that reflects the merging of the two objects.\n *\n * The merge is shallow.\n *\n * @param target\n * @param source\n * @returns\n */\nexport const mergeIfMissing = <\n Src extends Record<PropertyKey, any>,\n Trg extends Partial<Src> & Record<PropertyKey, any>,\n>(\n target: Src,\n source: Trg\n): Src & Trg =>\n Object.entries(source).reduce(\n (acc, [key, value]) => (key in acc ? acc : {...acc, [key]: value}),\n target\n );\n","import {ActionCreatorFactory} from '@configuration/api/action-creator-factory.ts';\nimport {\n ActionEditor,\n EndableActionEditor,\n TimelineActionEditor,\n} from '@configuration/api/action-editor.ts';\nimport {LabelEditor} from '@configuration/api/label-editor.ts';\nimport {TimelineProvidersSettingsEditor} from '@configuration/api/timeline-provider-settings-editor.ts';\nimport type {\n IActionConfiguration,\n IEngineConfiguration,\n ITimelineActionConfiguration,\n ITimelineConfiguration,\n} from '@configuration/types.ts';\nimport {deepCopy} from '@operation/helper/deep-copy.ts';\nimport {mergeIfMissing} from '@util/merge-if-missing.ts';\nimport {v4 as uuidv4} from 'uuid';\nimport type {\n ILabel,\n ILanguageLabel,\n KeysOfType,\n TimelineTypes,\n TLanguageCode,\n} from '../../types.ts';\n\n/** */\nexport type TEngineConfigurationLists = KeysOfType<IEngineConfiguration, any[]>;\n\ntype ConfigurationFactoryExtension<NewFactory extends ConfigurationFactory> = (\n this: NewFactory,\n ...rest: any[]\n) => void;\n\n/**\n * This class offers a fluent, extensible and strongly typed DSL for creating Eligius configurations.\n *\n * @example Building a configuration using the factory\n * To initialize a basic configuration to start off of:\n * ```ts\n * const factory = new ConfigurationFactory()\n * .init(\"en-US\") // Define the default language\n * .addLanguage(\"en-US\", \"English\") // Add English as a supported language\n * .addLanguage(\"nl-NL\", \"Nederlands\") // Add Dutch as a supported language\n * .setLayoutTemplate(\"<div class=\\\"main.container\\\"></div>\") // Add the main container for the presentation\n * .setContainerSelector(\"#ct-container\") // Selector for the element in the body that will contain the presentation\n * .addTimeline( // Add a first timeline\n * 'timeline-1', // Give it a name\n * \"animation\", // This is RAF based timeline\n * 200, // The duration of the timeline in seconds\n * false, // The presentation does NOT play in a loop\n * \".timeline-container\" // The element within the main layout (defined by the layoutTemplate) in which the timeline will be rendered\n * )\n * .editTimelineProviderSettings() // Add a timeline provider\n * .addProvider(\"animation\") // One that provides timelines for type 'animation'\n * .setSystemName(\"RequestAnimationFrameTimelineProvider\") // The system name of the provider\n * .setVendor(\"eligius\") // Eligius is the vendor in this case\n * .end(); // This finally returns the ConfigurationFactory instance\n * ```\n *\n * Then to add an init action:\n * ```ts\n * factory\n * .createInitAction(\"GetUserName\")\n * .addStartOperationByType(getQueryParams, {\n * defaultValues: { username: \"guest\" },\n * })\n * .addStartOperationByType(setGlobalData, { properties: [\"queryParams\"] });\n * ```\n *\n * After that, add a timeline action:\n * ```ts\n * factory.createTimelineAction(\"timeline-1\", \"AddIntroContainer\")\n * .addDuration(0, 10)\n * .addStartOperationByType(selectElement, { selector: \".timeline-container\" })\n * .addStartOperationByType(setElementContent, {\n * template: '<div class=\"intro-text\"></div>',\n * })\n * .addEndOperationByType(selectElement, { selector: \".intro-text\" })\n * .addEndOperationByType(removeElement, {});\n * ```\n *\n * It also possible to extend the factory with specialized creation methods for the particular\n * configuration you are building:\n * ```ts\n * function addImage(this: ConfigurationFactory, actionName: string, imageSrc: string, imageId: string) {\n * this.createInitAction(actionName)\n * .addStartOperationByType(selectElement, { selector: \".timeline-container\" })\n * .addStartOperationByType(createElement, { element: 'img', attributes: {src: imageSrc, imageId} })\n * .addStartOperationByType(setElementContent, { insertionType: \"append\" })\n * .addEndOperationByType(selectElement, { selector: `#${imageId}` })\n * .addEndOperationByType(removeElement, {});\n * }\n *\n * const customFactory = ConfigurationFactory.extend(factory, \"addImage\", addImage);\n *\n * customFactory.addImage(\"MyImageActionName\", \"my-image.png\", \"my-image-id\");\n * ```\n *\n * Finally, retrieve the configuration and save it:\n * ```ts\n * import fs from \"node:fs\";\n *\n * const configuration = customFactory.getConfiguration();\n *\n * fs.writeFileSync(\"/my/path/configuration.json\", JSON.stringify(configuration), {encoding:'utf-8'})\n * ```\n *\n * The `ConfigurationFactory` can also be used to edit an existing configuration. In this case, simply\n * pass the JSON configuration to the `ConfigurationFactory`'s constructor:\n * ```ts\n * import myConfiguration from './my-configuration.json';\n *\n * const factory = new ConfigurationFactory(myConfiguration);\n *\n * factory.editInitAction(\"existingActionName\")\n * .removeEndOperation(\"475fd0ab-5755-4e60-8f7c-e1988a109678\");\n * ```\n */\nexport class ConfigurationFactory {\n actionCreatorFactory: ActionCreatorFactory;\n\n /**\n * Constructs a new `ConfigurationFactory`\n * @param config an optional existing configuration that will be used as a starting point\n */\n constructor(public configuration: IEngineConfiguration = {} as any) {\n this.actionCreatorFactory = new ActionCreatorFactory(this);\n }\n\n /**\n * Add specialized method to a factory\n *\n * @param factory\n * @param extensionMethodName\n * @param extensionMethod\n * @returns\n */\n static extend<\n T extends ConfigurationFactory,\n K extends PropertyKey,\n C extends (this: T & {[P in K]: C}, ...args: any[]) => any,\n >(factory: T, extensionMethodName: K, extensionMethod: C): T & {[P in K]: C} {\n return Object.defineProperty<T & {[P in K]: C}>(\n factory as any,\n extensionMethodName,\n {\n value: function (this: T & {[P in K]: C}, ...args: Parameters<C>) {\n return extensionMethod.apply(this, args);\n },\n writable: true,\n configurable: true,\n }\n );\n }\n\n /**\n * Add specialized methods to a factory\n *\n * @param factory\n * @param extensions\n * @returns\n */\n static extendMultiple<\n T extends ConfigurationFactory,\n C extends ConfigurationFactoryExtension<T>,\n D extends {[name: string]: C},\n >(factory: T, extensions: D) {\n return Object.entries(extensions).reduce<T & typeof extensions>(\n (acc, [name, method]) =>\n ConfigurationFactory.extend(acc, name, method) as T & typeof extensions,\n factory as T & typeof extensions\n );\n }\n\n /**\n * Initialize the configuration with a minimal shape.\n *\n * It assigns an ID, sets the engine to `EligiusEngine`, default the containerSelector `[data-ct-container=true]`\n * and initializes all of the list properties with empty arrays.\n * @param defaultLanguage\n * @returns\n */\n init(defaultLanguage: TLanguageCode) {\n const newConfiguration: IEngineConfiguration = {\n id: uuidv4(),\n engine: {\n systemName: 'EligiusEngine',\n },\n containerSelector: '[data-ct-container=true]',\n cssFiles: [],\n timelineProviderSettings: {},\n language: defaultLanguage,\n availableLanguages: [],\n layoutTemplate: '',\n initActions: [],\n actions: [],\n timelines: [],\n labels: [],\n };\n\n this.configuration = mergeIfMissing(this.configuration, newConfiguration);\n\n return this;\n }\n\n /**\n * Assigns the engine system name\n * @param systemName\n * @returns\n */\n setEngine(systemName: string) {\n this.configuration.engine.systemName = systemName;\n return this;\n }\n\n /**\n * Assigns a string representation of the HTML layout template for the engine.\n *\n * @param layoutTemplate\n * @returns\n */\n setLayoutTemplate(layoutTemplate: string) {\n this.configuration.layoutTemplate = layoutTemplate;\n return this;\n }\n\n /**\n *\n * Assigns the default language\n *\n * @param defaultLanguage\n * @returns\n */\n setDefaultLanguage(defaultLanguage: TLanguageCode) {\n this.configuration.language = defaultLanguage;\n return this;\n }\n\n /**\n *\n * Assign the css selector that specifies the DOM location where the engine renders its output\n *\n * @param selector\n * @returns\n */\n setContainerSelector(selector: string) {\n this.configuration.containerSelector = selector;\n return this;\n }\n\n /**\n *\n * Starts an editing process for the timeline provider settings.\n *\n * @returns\n */\n editTimelineProviderSettings() {\n return new TimelineProvidersSettingsEditor(\n this.configuration.timelineProviderSettings || {},\n this\n );\n }\n\n /**\n *\n * Return a copy of the current state of the configuration\n *\n * @param callBack the callback receives the configuration as well and can return a mutated version wich will be assigned to the factory's internal state\n * @returns\n */\n getConfiguration(\n callBack?: (copy: IEngineConfiguration) => IEngineConfiguration\n ) {\n const copy = deepCopy<IEngineConfiguration>(this.configuration);\n if (callBack) {\n const newConfig = callBack.call(this, copy);\n this.configuration = deepCopy<IEngineConfiguration>(newConfig);\n }\n return copy;\n }\n\n /**\n *\n * Adds a language to the `availableLanguages` list.\n * The label represents the name of the language.\n *\n * An error is thrown if a language with the given language code already exists\n *\n * @example\n * factory.addLanguage('en-GB', 'English');\n *\n * @param languageCode The given alnguage code\n * @param languageLabel The human readable name of the language\n * @returns\n */\n addLanguage(languageCode: TLanguageCode, languageLabel: string) {\n const languages = this._initializeCollection(\n this.configuration,\n 'availableLanguages'\n );\n const existing = languages.find(lang => lang.languageCode === languageCode);\n\n if (existing) {\n throw new Error(`Language code '${languageCode}' already exists`);\n }\n\n languages.push({\n id: uuidv4(),\n languageCode: languageCode,\n label: languageLabel,\n });\n return this;\n }\n\n private _internalAddAction(\n collectionName: TEngineConfigurationLists,\n action: IActionConfiguration\n ) {\n const actions = this._initializeCollection(\n this.configuration,\n collectionName\n );\n actions?.push(action as any);\n }\n\n private _initializeCollection<T, K extends keyof T>(\n parent: T,\n name: K\n ): T[K] {\n if (!parent[name]) {\n (parent[name] as any) = [];\n }\n return parent[name] as T[K];\n }\n\n /**\n *\n * Adds the specified action to the `actions` list.\n *\n * @param action\n */\n addAction(action: IActionConfiguration) {\n this._internalAddAction('actions', action);\n }\n\n /**\n *\n * Adds the specified action to the `initActions` list\n *\n * @param action\n */\n addInitAction(action: IActionConfiguration) {\n this._internalAddAction('initActions', action);\n }\n\n /**\n *\n * Adds the specified action to the `eventActions` list\n *\n * @param action\n */\n addEventAction(action: IActionConfiguration) {\n this._internalAddAction('eventActions', action);\n }\n\n /**\n *\n * Adds the given actions to `timelineActions` list that is associated with the specified uri\n *\n * @param uri\n * @param action\n */\n addTimelineAction(uri: string, action: ITimelineActionConfiguration) {\n const timeline = this.getTimeline(uri);\n if (timeline) {\n const timelineActions = this._initializeCollection(\n timeline,\n 'timelineActions'\n );\n timelineActions.push(action);\n } else {\n throw Error(`No timeline found for uri '${uri}'`);\n }\n }\n\n /**\n *\n * Starts the creation of a new action with the specified name that gets added to the `actions` list\n *\n * @param name\n * @returns\n */\n createAction(name: string) {\n return this.actionCreatorFactory.createAction(name);\n }\n\n /**\n *\n * Starts the creation of a new action with the specified name that gets added to the `initActions` list\n *\n * @param name\n * @returns\n */\n createInitAction(name: string) {\n return this.actionCreatorFactory.createInitAction(name);\n }\n\n /**\n *\n * Starts the creation of a new action with the specified name that gets added to the `eventActions` list\n *\n * @param name\n * @returns\n */\n createEventAction(name: string) {\n return this.actionCreatorFactory.createEventAction(name);\n }\n\n /**\n *\n * Starts the creation of a new action with the specified name that gets added to the `timelineActions` list that is associated with the specified uri\n *\n * @param uri\n * @param name\n * @returns\n */\n createTimelineAction(uri: string, name: string) {\n return this.actionCreatorFactory.createTimelineAction(uri, name);\n }\n\n /**\n * Add a timeline with the given data\n *\n * @param uri identifier for the timeline\n * @param type animation or mediaplayer\n * @param duration the duration of the timeline in seconds\n * @param isLooped True if the timeline should automatically restart at the end\n * @param selector css selector for the container where the timeline will be rendered\n * @returns\n */\n addTimeline(\n uri: string,\n type: TimelineTypes,\n duration: number,\n isLooped: boolean,\n selector: string\n ) {\n const timelines = this._initializeCollection(\n this.configuration,\n 'timelines'\n );\n const timeline = this.getTimeline(uri);\n if (timeline) {\n throw Error(`timeline for uri ${uri} already exists`);\n }\n const timelineConfig: ITimelineConfiguration = {\n id: uuidv4(),\n type: type,\n uri: uri,\n duration: duration,\n loop: isLooped,\n selector: selector,\n timelineActions: [],\n };\n timelines.push(timelineConfig);\n return this;\n }\n\n /**\n *\n * Gets the timeline associated with the specified uri\n *\n * @param uri\n * @returns\n */\n getTimeline(uri: string) {\n return this.configuration.timelines.find(t => t.uri === uri);\n }\n\n /**\n *\n * Removes the timeline associated with the specified uri\n *\n * @param uri\n * @returns\n */\n removeTimeline(uri: string) {\n const timelineConfig = this.getTimeline(uri);\n if (timelineConfig) {\n const idx = this.configuration.timelines.indexOf(timelineConfig);\n if (idx > -1) {\n this.configuration.timelines.splice(idx, 1);\n }\n }\n return this;\n }\n\n private _initializeLabel(id: string, labels: ILanguageLabel[]) {\n let label = labels.find(l => l.id === id);\n if (!label) {\n labels.push({\n id: id,\n labels: [],\n });\n label = labels[labels.length - 1];\n }\n return label;\n }\n\n private _getLabelTranslation(\n labelTranslations: ILabel[],\n languageCode: TLanguageCode\n ) {\n let translation = labelTranslations.find(\n l => l.languageCode === languageCode\n );\n if (!translation) {\n translation = {\n id: uuidv4(),\n languageCode: languageCode,\n label: '',\n };\n labelTranslations.push(translation);\n }\n return translation;\n }\n\n /**\n *\n * Starts an editor for the label that is associated with the specified id\n *\n * @param id\n * @returns\n */\n editLabel(id: string) {\n const label = this.configuration.labels?.find(x => x.id === id);\n if (label) {\n return new LabelEditor(this, label);\n } else {\n throw new Error(`Language label with id '${id}' not found`);\n }\n }\n\n /**\n *\n * Adds a label translation with the specified data\n *\n * @param id The id for the label\n * @param languageCode The language code associated with the label\n * @param translation The label text in the language specified by the language code\n * @returns\n */\n addLabel(id: string, languageCode: TLanguageCode, translation: string) {\n const labels = this._initializeCollection(this.configuration, 'labels');\n const labelConfig = this._initializeLabel(id, labels);\n const labelTranslation = this._getLabelTranslation(\n labelConfig.labels,\n languageCode\n );\n labelTranslation.label = translation;\n return this;\n }\n\n /**\n *\n * Adds multiple translations with the specified data\n *\n * @param id The id for the label\n * @param translations A record that holds language code to translations lookups\n * @returns\n */\n addLabels(id: string, translations: Record<TLanguageCode, string>) {\n Object.entries(translations).forEach(([code, translation]) =>\n this.addLabel(id, code as TLanguageCode, translation)\n );\n return this;\n }\n\n /**\n *\n * Removes all translations with the given id\n *\n * @param id the id for the label\n * @returns\n */\n removeLabel(id: string) {\n const idx = this.configuration.labels.findIndex(x => x.id === id);\n if (idx > -1) {\n this.configuration.labels.splice(idx, 1);\n } else {\n throw new Error(`Label with id '${id}' not found!`);\n }\n return this;\n }\n\n /**\n *\n * Starts an editor for the action from the `actions` list associated with the given id\n *\n * @param id\n * @returns\n */\n editAction(id: string) {\n const actionConfig = this.configuration.actions.find(a => a.id === id);\n if (actionConfig) {\n return new EndableActionEditor(actionConfig, this);\n }\n throw new Error(`Action not found for id ${id}`);\n }\n\n /**\n *\n * Starts an editor for the action from the `eventActions` list associated with the given id\n *\n * @param id\n * @returns\n */\n editEventAction(id: string) {\n const actionConfig = this.configuration.eventActions?.find(\n a => a.id === id\n );\n if (actionConfig) {\n return new ActionEditor(actionConfig, this);\n }\n throw new Error(`Event action not found for id ${id}`);\n }\n\n /**\n *\n * Starts an editor for the action from the `initActions` list associated with the given id\n *\n * @param id\n * @returns\n */\n editInitAction(id: string) {\n const actionConfig = this.configuration.initActions.find(a => a.id === id);\n if (actionConfig) {\n return new EndableActionEditor(actionConfig, this);\n }\n throw new Error(`Init action not found for id ${id}`);\n }\n\n /**\n *\n * Starts an editor for the action from the `timelineActions` list associated with the given uri and id\n *\n * @param uri\n * @param id\n * @returns\n */\n editTimelineAction(uri: string, id: string) {\n const timeline = this.getTimeline(uri);\n if (!timeline) {\n throw new Error(`Timeline not found for id ${id}`);\n }\n const actionConfig = timeline.timelineActions.find(a => a.id === id);\n if (actionConfig) {\n return new TimelineActionEditor(actionConfig, this);\n }\n throw new Error(`Timeline action not found for id ${id}`);\n }\n}\n","import type {IEndableAction} from '@action/types.ts';\nimport type {IController} from '@controllers/types.ts';\nimport type {IEventbus} from '@eventbus/types.ts';\nimport {deepCopy} from '@operation/helper/deep-copy.ts';\nimport type {TOperationData} from '@operation/types.ts';\n\ninterface IActionInstanceInfo {\n start: boolean;\n action: IEndableAction;\n}\n\nexport interface IDOMEventListenerControllerOperationData {\n /**\n * @dependency\n */\n selectedElement: JQuery;\n /**\n * @type=ParameterType:eventName\n * @required\n */\n eventName: string;\n actions: string[];\n /**\n * @type=ParameterType:object\n */\n actionOperationData?: TOperationData;\n}\n\n/**\n * This controller attaches to the given selected element and adds a DOM event listener for the specified event name that\n * executes the given actions with the given operation data.\n *\n * By default the `start` operations of the specified actions are executed. To execute the `end` operations instead,\n * prefix the action name with `end:`.\n */\nexport class DOMEventListenerController\n implements IController<IDOMEventListenerControllerOperationData>\n{\n operationData?: IDOMEventListenerControllerOperationData;\n actionInstanceInfos?: IActionInstanceInfo[];\n name = 'DOMEventListenerController';\n\n init(operationData: IDOMEventListenerControllerOperationData) {\n this.operationData = {\n selectedElement: operationData.selectedElement,\n eventName: operationData.eventName,\n actions: operationData.actions.slice(),\n actionOperationData: deepCopy(operationData.actionOperationData),\n };\n }\n\n attach(eventbus: IEventbus) {\n if (!this.operationData) {\n return;\n }\n\n const {selectedElement, actions, eventName} = this.operationData;\n if (!this.actionInstanceInfos) {\n this.actionInstanceInfos = [];\n\n actions.forEach((actionName: string) => {\n const [isStart, name] = this._isStartAction(actionName);\n const actionInstance = eventbus.request<IEndableAction>(\n 'request-action',\n name\n );\n if (actionInstance) {\n this.actionInstanceInfos?.push({\n start: isStart,\n action: actionInstance,\n });\n }\n });\n\n selectedElement.on(eventName, this._eventHandler.bind(this));\n }\n }\n\n private _isStartAction(actionName: string): [boolean, string] {\n const prefix = actionName.substring(0, 'end:'.length);\n if (prefix === 'end:') {\n return [false, actionName.substring('end:'.length)];\n } else {\n return [true, actionName];\n }\n }\n\n private _eventHandler(event: any) {\n if (!this.operationData || !this.actionInstanceInfos) {\n return;\n }\n\n const actionOperationData = this.operationData.actionOperationData\n ? deepCopy(this.operationData.actionOperationData)\n : {};\n\n if (event.target) {\n actionOperationData.eventTarget = event.target;\n }\n\n this._executeAction(this.actionInstanceInfos, actionOperationData, 0);\n }\n\n private async _executeAction(\n actions: IActionInstanceInfo[],\n operationData: TOperationData,\n idx: number\n ) {\n if (idx < actions.length) {\n const actionInfo = actions[idx];\n const {action} = actionInfo;\n const method = actionInfo.start\n ? action.start.bind(action)\n : action.end.bind(action);\n const resultOperationData = await method(operationData);\n this._executeAction(\n actions,\n Object.assign(operationData, resultOperationData),\n ++idx\n );\n }\n }\n\n detach(_eventbus: IEventbus) {\n this.operationData?.selectedElement.off(this.operationData.eventName);\n }\n}\n","import type {IController} from '@controllers/types.js';\nimport type {EventName, IEventbus, TEventbusRemover} from '@eventbus/types.js';\nimport type {TOperationData} from '@operation/types.js';\n\n/**\n * Abstract base class for controllers providing standardized event listener management\n *\n * Benefits:\n * - Eliminates boilerplate event listener tracking code\n * - Automatic binding of event handlers to controller instance\n * - Centralized cleanup preventing memory leaks\n * - Consistent event management pattern across all controllers\n *\n * @example\n * ```typescript\n * class MyController extends BaseController<IMyOperationData> {\n * name = 'MyController';\n *\n * init(operationData: IMyOperationData): void {\n * this.operationData = operationData;\n * }\n *\n * attach(eventbus: IEventbus): void {\n * this.addListener(eventbus, 'my-event', this.handleMyEvent);\n * // Handler automatically bound, cleanup tracked\n * }\n *\n * private handleMyEvent(): void {\n * // 'this' context preserved\n * }\n * }\n * ```\n */\nexport abstract class BaseController<T extends TOperationData>\n implements IController<T>\n{\n // Public properties (required by IController)\n public operationData: T | null = null;\n public abstract name: string;\n\n // Protected state\n protected eventListeners: TEventbusRemover[] = [];\n\n /**\n * Register event listener with automatic binding and cleanup tracking\n *\n * @param eventbus - The eventbus to register with\n * @param eventName - Name of the event to listen for\n * @param handler - Event handler function (will be bound to this controller)\n */\n protected addListener(\n eventbus: IEventbus,\n eventName: EventName,\n handler: (...args: any[]) => void\n ): void {\n const boundHandler = handler.bind(this);\n const remover = eventbus.on(eventName, boundHandler as any);\n this.eventListeners.push(remover);\n }\n\n /**\n * Register multiple event listeners at once\n *\n * @param eventbus - The eventbus to register with\n * @param listeners - Array of {eventName, handler} pairs\n */\n protected attachMultiple(\n eventbus: IEventbus,\n listeners: Array<{eventName: string; handler: (...args: any[]) => void}>\n ): void {\n listeners.forEach(({eventName, handler}) => {\n this.addListener(eventbus, eventName as EventName, handler);\n });\n }\n\n /**\n * Clean up all tracked event listeners\n * Prevents memory leaks by removing all registered handlers\n *\n * @param _eventbus - The eventbus (ignored, included for IController compatibility)\n */\n public detach(_eventbus: IEventbus): void {\n this.eventListeners.forEach(remover => remover());\n this.eventListeners = [];\n }\n\n // Abstract methods (must be implemented by subclasses)\n public abstract init(operationData: T): void;\n public abstract attach(eventbus: IEventbus): Promise<any> | void;\n}\n","import {BaseController} from '@controllers/base-controller.ts';\nimport type {IEventbus} from '@eventbus/types.ts';\nimport type {ILabel} from '../types.ts';\n\nexport interface ILabelControllerMetadata {\n /**\n * @dependency\n */\n selectedElement: JQuery;\n /**\n * @type=ParameterType:labelId\n * @required\n */\n labelId: string;\n /**\n * By default the label is added to the inner HTML of the `selectedElement`,\n * otherwise if this property is set, the label text is added to the specified attribute\n * of the `selectedElement`.\n */\n attributeName?: string;\n}\n\n/**\n * This controller attaches to the given selected element and renders the text associated with the given label id in it.\n *\n * The controller also listen for the `LANGUAGE_CHANGE` event and re-renders the text with the new language after such an event.\n *\n */\nexport class LabelController extends BaseController<ILabelControllerMetadata> {\n currentLanguage: string | null = null;\n labelData: Record<string, string> = {};\n name = 'LabelController';\n requestLabelDataBound?: (labelId: string) => void;\n\n init(operationData: ILabelControllerMetadata) {\n this.operationData = Object.assign({}, operationData);\n }\n\n setLabelId(newLabelId: string) {\n if (this.requestLabelDataBound) {\n this.requestLabelDataBound(newLabelId);\n this._setLabel();\n }\n }\n\n attach(eventbus: IEventbus) {\n if (!this.operationData) {\n return;\n }\n\n this.currentLanguage =\n eventbus.request<string>('request-current-language') ?? null;\n\n this.requestLabelDataBound = this._requestLabelData.bind(this, eventbus);\n this.requestLabelDataBound(this.operationData.labelId);\n\n this._setLabel();\n this.addListener(eventbus, 'language-change', this._handleLanguageChange);\n }\n\n private _requestLabelData(eventbus: IEventbus, labelId: string) {\n const labelCollection = eventbus.request<ILabel[]>(\n 'request-label-collection',\n labelId\n );\n if (labelCollection) {\n this._createTextDataLookup(labelCollection);\n } else {\n throw new Error(`Label id '${labelId}' does not exist!`);\n }\n }\n\n private _setLabel() {\n if (this.currentLanguage) {\n const text = this.labelData[this.currentLanguage];\n if (!this.operationData?.attributeName) {\n this.operationData?.selectedElement.html(text);\n } else {\n this.operationData?.selectedElement.attr(\n this.operationData?.attributeName,\n text\n );\n }\n }\n }\n\n detach(eventbus: IEventbus) {\n super.detach(eventbus);\n this.requestLabelDataBound = undefined;\n }\n\n private _handleLanguageChange(code: string) {\n this.currentLanguage = code;\n this._setLabel();\n }\n\n private _createTextDataLookup(data: ILabel[]) {\n data.forEach(d => {\n this.labelData[d.languageCode] = d.label;\n });\n }\n}\n","import {BaseController} from '@controllers/base-controller.ts';\nimport type {IEventbus} from '@eventbus/types.ts';\nimport type {\n AnimationConfigWithData,\n AnimationItem,\n CanvasRendererConfig,\n HTMLRendererConfig,\n SVGRendererConfig,\n} from 'lottie-web';\nimport lt from 'lottie-web';\nimport type {TLanguageCode} from '../types.ts';\n\nconst lottie = lt.default ?? lt;\n\nexport interface IInnerMetadata {\n /**\n * @dependency\n */\n selectedElement: JQuery;\n /**\n * @type=ParameterType:string\n */\n renderer: SVGRendererConfig | CanvasRendererConfig | HTMLRendererConfig;\n loop: boolean;\n autoplay: boolean;\n /**\n * ParameterType:object\n */\n animationData: any;\n /**\n * @required\n */\n json: any;\n /**\n * @type=ParameterType:array\n * @itemType=ParameterType:labelId\n */\n labelIds: string[];\n viewBox: string;\n iefallback: any;\n}\n\nexport interface ILottieControllerMetadata extends IInnerMetadata {\n /**\n * @type=ParameterType:url\n * @required\n */\n url: string;\n}\n\n/**\n * This controller renders a [lottie-web](https://github.com/airbnb/lottie-web) animation inside the given selected element.\n *\n * The url may encode freeze and end positions like this: my-url/filename[freeze=10,end=21].json\n *\n */\nexport class LottieController extends BaseController<ILottieControllerMetadata> {\n name = 'LottieController';\n currentLanguage: TLanguageCode = 'nl-NL';\n labelData: Record<string, Record<string, string>> = {};\n animationItem: AnimationItem | null = null;\n serializedData: string | null = null;\n serializedIEData: string | null = null;\n freezePosition = -1;\n endPosition = -1;\n\n init(operationData: ILottieControllerMetadata) {\n this.operationData = {...operationData};\n\n if (operationData.url.indexOf('[') > -1) {\n this._parseFilename(operationData.url);\n }\n\n this.serializedData = this.operationData.json\n ? JSON.stringify(this.operationData.json)\n : JSON.stringify(this.operationData.animationData);\n\n if (this.operationData.iefallback) {\n this.serializedIEData = JSON.stringify(this.operationData.iefallback);\n }\n }\n\n private _parseFilename(name: string) {\n const startIndex = name.indexOf('[') + 1;\n const endIndex = name.indexOf(']');\n const params = name.substring(startIndex, endIndex);\n\n const settings = params.split(',');\n\n settings.forEach(setting => {\n const values = setting.split('=');\n if (values[0] === 'freeze') {\n this.freezePosition = +values[1];\n } else if (values[0] === 'end') {\n this.endPosition = +values[1];\n }\n });\n }\n\n attach(eventbus: IEventbus) {\n if (!this.operationData) {\n return;\n }\n\n const {labelIds} = this.operationData;\n if (labelIds?.length) {\n this.currentLanguage =\n eventbus.request<TLanguageCode>('request-current-language') ?? 'en-US';\n this.addListener(eventbus, 'language-change', this._handleLanguageChange);\n const labelCollections =\n eventbus.request<any[]>(\n 'request-label-collections',\n this.operationData.labelIds\n ) ?? [];\n this._createTextDataLookup(labelCollections);\n }\n this._createAnimation();\n this._createAnimation();\n }\n\n detach(eventbus: IEventbus) {\n super.detach(eventbus);\n\n if (this.animationItem) {\n if (this.endPosition > -1) {\n this.animationItem.addEventListener(\n 'complete',\n this._destroy.bind(this)\n );\n this.animationItem.playSegments(\n [this.freezePosition, this.endPosition],\n true\n );\n } else {\n this.animationItem.destroy();\n }\n }\n }\n\n private _destroy() {\n if (this.animationItem) {\n this.animationItem.destroy();\n this.animationItem = null;\n }\n }\n\n private _createAnimation() {\n if (!this.operationData || !this.serializedData) {\n return;\n }\n\n this.animationItem?.destroy();\n let serialized =\n this._isIE() && this.serializedIEData\n ? this.serializedIEData\n : this.serializedData;\n\n const {labelIds} = this.operationData;\n if (labelIds?.length) {\n // O(n) regex-based replacement - single pass through string\n // Replaces all !!labelId!! patterns in one operation\n serialized = serialized.replace(/!!([^!]+)!!/g, (match, labelId) => {\n return this.labelData[labelId]?.[this.currentLanguage] ?? match;\n });\n }\n const animationData = JSON.parse(serialized);\n\n const animationSettings: AnimationConfigWithData<'svg'> = {\n autoplay: this.operationData.autoplay,\n container: this.operationData.selectedElement[0],\n loop: this.operationData.loop,\n rendererSettings: this.operationData.renderer,\n animationData,\n };\n\n this.animationItem = lottie.loadAnimation(animationSettings);\n if (this.endPosition < 0) {\n this.endPosition = this.animationItem.timeCompleted;\n }\n\n if (this.freezePosition > -1) {\n this.animationItem.playSegments([0, this.freezePosition], true);\n }\n if (this.operationData.viewBox) {\n this.operationData.selectedElement\n .find('svg')\n .attr('viewBox', this.operationData.viewBox);\n }\n }\n\n private _createTextDataLookup(data: any[]) {\n data.forEach((infos, index) => {\n infos.forEach((d: any) => {\n if (this.operationData) {\n this.labelData[this.operationData.labelIds[index]][d.code] = d.label;\n }\n });\n });\n }\n\n private _handleLanguageChange(code: TLanguageCode) {\n this.currentLanguage = code;\n this._createAnimation();\n }\n\n private _isIE() {\n const isIE = false || !!(window.document as any).documentMode;\n\n // Edge 20+\n const isEdge = !isIE && !!(window as any).StyleMedia;\n\n return isEdge || isIE;\n }\n}\n","import {BaseController} from '@controllers/base-controller.ts';\nimport type {IEventbus} from '@eventbus/types.ts';\n\n/**\n * Metadata configuration for MutationObserverController\n *\n * Configures what types of DOM mutations to observe and how to observe them.\n */\nexport interface IMutationObserverControllerMetadata {\n /**\n * jQuery-wrapped DOM element to observe for mutations\n * @dependency\n * @required\n */\n selectedElement: JQuery;\n\n /**\n * Observe changes to element attributes\n * @optional\n * @default true\n */\n observeAttributes?: boolean;\n\n /**\n * Observe additions and removals of child nodes\n * @optional\n * @default true\n */\n observeChildList?: boolean;\n\n /**\n * Observe changes to text content (character data)\n * @optional\n * @default true\n */\n observeCharacterData?: boolean;\n\n /**\n * Observe mutations in the entire subtree (all descendants)\n * @optional\n * @default false\n */\n observeSubtree?: boolean;\n\n /**\n * Record the previous value of attributes that change\n * Requires observeAttributes to be true\n * @optional\n * @default false\n */\n attributeOldValue?: boolean;\n\n /**\n * Record the previous value of text content that changes\n * Requires observeCharacterData to be true\n * @optional\n * @default false\n */\n characterDataOldValue?: boolean;\n\n /**\n * Array of specific attribute local names to observe\n * If omitted, all attribute changes are observed when observeAttributes is true\n * @optional\n */\n attributeFilter?: string[];\n}\n\n/**\n * Mutation event payload broadcasted through Eligius eventbus\n */\nexport interface IMutationEventPayload {\n /**\n * Array of mutation records from the MutationObserver callback\n */\n mutations: MutationRecord[];\n\n /**\n * Reference to the observed element (native DOM node)\n */\n target: Element;\n\n /**\n * Timestamp when the mutations were detected\n */\n timestamp: number;\n}\n\n/**\n * Controller that observes DOM mutations on a selected element and broadcasts events.\n *\n * This controller creates a MutationObserver to monitor DOM changes (attributes, child nodes,\n * text content) on a specified element. All detected mutations are broadcasted through the\n * Eligius eventbus, enabling reactive behavior in response to DOM changes.\n *\n * The controller follows the standard Eligius lifecycle:\n * - init(): Store configuration metadata\n * - attach(): Create and start the MutationObserver\n * - detach(): Disconnect the observer and clean up resources\n *\n * @example\n * ```typescript\n * // JSON configuration\n * {\n * \"systemName\": \"addControllerToElement\",\n * \"operationData\": {\n * \"controllerName\": \"MutationObserverController\",\n * \"observeAttributes\": true,\n * \"observeChildList\": true,\n * \"observeCharacterData\": false\n * }\n * }\n *\n * // Listen for mutations\n * eventbus.on('dom-mutation', (payload: IMutationEventPayload) => {\n * console.log('Mutations detected:', payload.mutations);\n * });\n * ```\n */\nexport class MutationObserverController extends BaseController<IMutationObserverControllerMetadata> {\n name = 'MutationObserverController';\n private observer: MutationObserver | null = null;\n\n /**\n * Initialize the controller with configuration metadata.\n *\n * @param operationData - Configuration for observation behavior\n */\n init(operationData: IMutationObserverControllerMetadata): void {\n this.operationData = Object.assign({}, operationData);\n }\n\n /**\n * Attach the controller and start observing mutations.\n * Creates MutationObserver instance and begins monitoring the target element.\n *\n * @param eventbus - Eligius eventbus for broadcasting mutation events\n */\n attach(eventbus: IEventbus): void {\n if (!this.operationData) {\n return;\n }\n\n // Unwrap jQuery element to get native DOM node\n const nativeElement = this.operationData.selectedElement.get(0);\n if (!nativeElement) {\n return;\n }\n\n // Build observer options from metadata\n const options = this._buildObserverOptions();\n\n // Create MutationObserver with bound callback\n this.observer = new MutationObserver(\n this._handleMutations.bind(this, eventbus, nativeElement)\n );\n\n // Start observing the target element\n this.observer.observe(nativeElement, options);\n }\n\n /**\n * Detach the controller and stop observing mutations.\n * Disconnects MutationObserver and cleans up resources.\n *\n * @param eventbus - Eligius eventbus (used by BaseController for cleanup)\n */\n detach(eventbus: IEventbus): void {\n // Disconnect and clean up observer\n if (this.observer) {\n this.observer.disconnect();\n this.observer = null;\n }\n\n // Call parent detach for event listener cleanup\n super.detach(eventbus);\n }\n\n /**\n * Build MutationObserverInit options from controller metadata.\n * Applies default values for optional configuration properties.\n *\n * @returns MutationObserverInit options object\n * @private\n */\n private _buildObserverOptions(): MutationObserverInit {\n if (!this.operationData) {\n return {};\n }\n\n const {\n observeAttributes = true,\n observeChildList = true,\n observeCharacterData = true,\n observeSubtree = false,\n attributeOldValue = false,\n characterDataOldValue = false,\n attributeFilter,\n } = this.operationData;\n\n return {\n attributes: observeAttributes,\n childList: observeChildList,\n characterData: observeCharacterData,\n subtree: observeSubtree,\n attributeOldValue,\n characterDataOldValue,\n attributeFilter,\n };\n }\n\n /**\n * Handle mutations detected by the MutationObserver.\n * Broadcasts mutation events through the eventbus with mutation details.\n *\n * @param eventbus - Eligius eventbus for broadcasting\n * @param target - The observed element\n * @param mutations - Array of mutation records from observer callback\n * @private\n */\n private _handleMutations(\n eventbus: IEventbus,\n target: Element,\n mutations: MutationRecord[]\n ): void {\n const payload: IMutationEventPayload = {\n mutations,\n target,\n timestamp: Date.now(),\n };\n\n eventbus.broadcast('dom-mutation', [payload]);\n }\n}\n","import {BaseController} from '@controllers/base-controller.ts';\nimport type {LabelController} from '@controllers/label-controller.ts';\nimport type {IEventbus} from '@eventbus/types.ts';\nimport type {TOperationData} from '@operation/types.ts';\nimport $ from 'jquery';\nimport type {TResultCallback} from '../types.ts';\n\nexport interface INavigationControllerOperationData {\n /**\n * @dependency\n */\n selectedElement: JQuery;\n /**\n * @required\n */\n json: any;\n}\n\nexport class NavigationController extends BaseController<INavigationControllerOperationData> {\n name: string = 'NavigationController';\n navigation: any[] = [];\n navLookup: Record<string, any> = {};\n navVidIdLookup: Record<string, any> = {};\n ctrlLookup: Record<string, LabelController> = {};\n activeNavigationPoint: any | null = null;\n labelControllers: LabelController[] = [];\n eventbus: IEventbus | null = null;\n container: JQuery | null = null;\n\n init(operationData: TOperationData) {\n this.container = operationData.selectedElement;\n this.navigation = this._buildNavigationData(operationData.json);\n }\n\n attach(eventbus: IEventbus) {\n if (!this.container) {\n return;\n }\n\n this.eventbus = eventbus;\n\n this.addListener(\n eventbus,\n 'navigate-to-video-url',\n this._handleNavigateVideoUrl\n );\n this.addListener(eventbus, 'highlight-navigation', this._highlightMenu);\n this.addListener(\n eventbus,\n 'request-current-navigation',\n this._handleRequestCurrentNavigation\n );\n this.addListener(eventbus, 'video-complete', this._handleVideoComplete);\n\n this._buildHtml(this.container, this.navigation);\n this._initHistory.bind(this);\n }\n\n private _initHistory() {\n this.activeNavigationPoint = this.navVidIdLookup[0];\n const navId = this._getQueryVariable(0);\n let videoIndex = 0;\n if (navId) {\n const nav = this.navLookup[navId];\n videoIndex = nav.videoUrlIndex;\n }\n this._highlightMenu(videoIndex);\n }\n\n private _getQueryVariable(variableIdx: number) {\n const href = window.location.href;\n const hashIndex = href.indexOf('#');\n if (hashIndex > -1) {\n const query = href.substring(hashIndex + 2);\n if (query) {\n const vars = query.split('/');\n return vars[variableIdx];\n }\n }\n return null;\n }\n\n private _handleRequestCurrentNavigation(\n resultCallback: TResultCallback<{navigationData: any; title: string} | null>\n ) {\n if (this.activeNavigationPoint) {\n const labelCtrl = this.ctrlLookup[this.activeNavigationPoint.labelId];\n resultCallback({\n navigationData: this.activeNavigationPoint,\n title: labelCtrl.labelData[labelCtrl.currentLanguage || ''],\n });\n } else {\n resultCallback(null);\n }\n }\n\n detach(eventbus: IEventbus) {\n super.detach(eventbus);\n\n this.labelControllers.forEach(ctrl => {\n ctrl.detach(eventbus);\n });\n\n this.labelControllers.length = 0;\n this.eventbus = null;\n this.container = null;\n window.onpopstate = null;\n }\n\n private _pushCurrentState(position = -1) {\n if (!this.activeNavigationPoint) {\n return;\n }\n const labelCtrl: LabelController =\n this.ctrlLookup[this.activeNavigationPoint.labelId];\n\n if (!labelCtrl) {\n return;\n }\n\n const state = {\n navigationData: this.activeNavigationPoint,\n title: labelCtrl.labelData[labelCtrl.currentLanguage || ''],\n position: -1,\n };\n if (position > -1) {\n state.position = position;\n }\n this.eventbus?.broadcast('push-history-state', [state]);\n }\n\n private _buildHtml(parentElm: JQuery, data: any) {\n const ul = $('<ul/>');\n data.forEach(this._addNavElement.bind(this, ul));\n parentElm.append(ul);\n }\n\n private _addNavElement(parentElm: JQuery, data: any) {\n if (data.visible) {\n const li = $('<li/>');\n const a = $(`<a href='javascript:;' id='nav_${data.videoUrlIndex}'/>`);\n li.append(a);\n this._addLabel(a, data.labelId);\n this._addClickHandler(a, data.videoUrlIndex);\n\n if (data.children) {\n const ul = $('<ul/>');\n data.children.forEach(this._addNavElement.bind(this, ul));\n li.append(ul);\n }\n\n parentElm.append(li);\n }\n }\n\n private _addClickHandler(parentElm: JQuery, videoIndex: number) {\n parentElm.mouseup(this._menuMouseupHandler.bind(this, videoIndex));\n }\n\n private _menuMouseupHandler(videoIndex: number) {\n const navdata = this.navVidIdLookup[videoIndex];\n if (navdata) {\n this.eventbus?.broadcast('request-video-url', [navdata.videoUrlIndex]);\n this._handleNavigateVideoUrl(navdata.videoUrlIndex);\n }\n }\n\n private _handleNavigateVideoUrl(\n index: number,\n requestedVideoPosition: number = 0\n ) {\n this._highlightMenu(index);\n this.eventbus?.broadcast('request-video-url', [\n index,\n requestedVideoPosition,\n ]);\n this.activeNavigationPoint = this.navVidIdLookup[index];\n this._pushCurrentState(requestedVideoPosition);\n }\n\n private _highlightMenu(index: number) {\n const navElm = $(`#nav_${index}`);\n\n if (navElm.length) {\n $('.current-menu-item').removeClass('current-menu-item');\n navElm.addClass('current-menu-item');\n }\n }\n\n private _handleVideoComplete(index: number) {\n const navData = this.navVidIdLookup[index];\n if (navData.autoNext) {\n this.eventbus?.broadcast('request-video-url', [\n navData.next.videoUrlIndex,\n ]);\n } else {\n this.eventbus?.broadcast('request-video-cleanup', []);\n }\n }\n\n private _addLabel(parentElm: JQuery, labelId: string) {\n const data = {\n selectedElement: parentElm,\n labelId: labelId,\n };\n const instance = this.eventbus?.request<LabelController>(\n 'request-instance',\n 'LabelController'\n );\n if (instance) {\n instance.init(data);\n instance.attach(this.eventbus as IEventbus);\n this.labelControllers.push(instance);\n this.ctrlLookup[labelId] = instance;\n }\n }\n\n private _buildNavigationData(data: any) {\n const result: any[] = [];\n data.navigationData.forEach((nav: any, index: number) => {\n this.navLookup[nav.id] = nav;\n this.navVidIdLookup[nav.videoUrlIndex] = nav;\n nav.previous = data.navigationData[index - 1];\n });\n\n data.navigationData.forEach((nav: any, index: number) => {\n if (nav.nextId) {\n nav.next = this.navLookup[nav.nextId];\n delete nav.nextId;\n } else {\n nav.next = data.navigationData[index + 1];\n }\n });\n\n data.roots.forEach((id: string) => {\n const nav = this.navLookup[id];\n if (nav.children) {\n nav.children = nav.children.map((childId: string) => {\n return this.navLookup[childId];\n });\n }\n result.push(nav);\n });\n return result;\n }\n}\n","import {BaseController} from '@controllers/base-controller.ts';\nimport type {IEventbus} from '@eventbus/types.ts';\nimport type {TOperationData} from '@operation/types.ts';\n\nexport interface IProgressbarControllerOperationData {\n /**\n * @dependency\n */\n selectedElement: JQuery;\n /**\n * @dependency\n */\n textElement: JQuery;\n}\n\n/**\n * This controller renders a progressbar that displays the progress of the current timeline in the given selected element.\n *\n * The current progress as a percentage is rendered in the given text element.\n */\nexport class ProgressbarController extends BaseController<IProgressbarControllerOperationData> {\n name: string = 'ProgressbarController';\n selectedElement: JQuery | null = null;\n textElement: JQuery | null = null;\n duration: number = 0;\n\n init(operationData: TOperationData) {\n this.selectedElement = operationData.selectedElement;\n this.textElement = operationData.textElement;\n }\n\n attach(eventbus: IEventbus) {\n this.addListener(eventbus, 'timeline-time', this._positionUpdateHandler);\n\n this.duration = eventbus.request<number>('timeline-duration-request') ?? 0;\n\n this.selectedElement?.css({'pointer-events': 'none'});\n\n const container = this.selectedElement?.parent();\n\n if (container) {\n const clickHandler = this._clickHandler.bind(this, eventbus);\n container.on('click', clickHandler);\n this.eventListeners.push(() => container.off('click', clickHandler));\n }\n }\n\n detach(eventbus: IEventbus) {\n super.detach(eventbus);\n }\n\n private _positionUpdateHandler(position: number) {\n const percentage = (100 / this.duration) * position;\n this.selectedElement?.css('width', `${percentage}%`);\n this.textElement?.text(`${Math.floor(percentage)}%`);\n }\n\n private _clickHandler(eventbus: IEventbus, event: any) {\n const element = event.target as HTMLElement;\n const rect = element.getBoundingClientRect();\n\n const x = event.clientX - rect.left; //x position within the element.\n\n const percentage = (100 / rect.width) * x;\n\n eventbus.broadcast('timeline-seek-request', [\n Math.round((this.duration / 100) * percentage),\n ]);\n }\n}\n","import {BaseController} from '@controllers/base-controller.ts';\nimport type {IEventbus} from '@eventbus/types.ts';\nimport type {TOperationData} from '@operation/types.ts';\n\nexport interface IRoutingControllerOperationData {\n /**\n * @required\n */\n json: any;\n}\n\n/**\n * This is a work in progress, do not use this yet please....\n */\nexport class RoutingController extends BaseController<IRoutingControllerOperationData> {\n name = 'RoutingController';\n navLookup: Record<string, any> = {};\n navVidIdLookup: Record<string, any> = {};\n navigation: any = null;\n eventbus: IEventbus | null = null;\n\n init(operationData: TOperationData) {\n this.navigation = this._buildNavigationData(operationData.json);\n }\n\n attach(eventbus: IEventbus) {\n this.addListener(\n eventbus,\n 'before-request-video-url',\n this._handleBeforeRequestVideoUrl\n );\n this.addListener(\n eventbus,\n 'push-history-state',\n this._handlePushHistoryState\n );\n this.eventbus = eventbus;\n window.onpopstate = this._handlePopstate.bind(this);\n\n const navId = this._getQueryVariable(0);\n if (navId) {\n const nav = this.navLookup[navId];\n const pos = +this._getQueryVariable(1);\n this.eventbus.broadcast('request-video-url', [\n nav.videoUrlIndex,\n pos,\n true,\n ]);\n } else {\n window.history.pushState(\n {navigationId: this.navigation[0].id},\n '',\n `#/${this.navigation[0].id}`\n );\n }\n }\n\n private _handlePopstate(event: any) {\n const navigationId = event.state\n ? event.state.navigationId\n : this.navigation[0].id;\n const position = event.state?.position ?? 0;\n const nav = this.navLookup[navigationId];\n this.eventbus?.broadcast('highlight-navigation', [nav.videoUrlIndex]);\n this.eventbus?.broadcast('request-video-url', [\n nav.videoUrlIndex,\n position,\n true,\n ]);\n }\n\n detach(eventbus: IEventbus) {\n super.detach(eventbus);\n window.onpopstate = null;\n this.eventbus = null;\n }\n\n private _handleBeforeRequestVideoUrl(\n _index: number,\n _requestedVideoPosition: number = 0,\n isHistoryRequest: boolean = false\n ) {\n isHistoryRequest =\n isHistoryRequest !== undefined ? isHistoryRequest : false;\n if (!isHistoryRequest) {\n const resultCallback = (item: any) => {\n this._pushState(item);\n };\n this.eventbus?.broadcast('request-current-navigation', [resultCallback]);\n }\n }\n\n private _getQueryVariable(variableIdx: number) {\n const href = window.location.href;\n const hashIndex = href.indexOf('#');\n if (hashIndex > -1) {\n const query = href.substring(hashIndex + 2);\n if (query) {\n const vars = query.split('/');\n return vars[variableIdx];\n }\n }\n return '';\n }\n\n private _handlePushHistoryState(state: any) {\n this._pushState(state);\n }\n\n private _pushState(state: any) {\n if (state?.navigationData?.visible) {\n let currentPosition = state.position !== undefined ? state.position : -1;\n if (currentPosition < 0) {\n const resultCallback = (position: number) => {\n currentPosition = position > 3 ? position - 3 : 0;\n };\n this.eventbus?.broadcast('request-current-video-position', [\n resultCallback,\n ]);\n }\n\n const currentState = window.history.state;\n if (\n currentState &&\n currentState.navigationId !== state.navigationData.id\n ) {\n window.history.pushState(\n {navigationId: state.navigationData.id, position: currentPosition},\n state.title,\n `#/${state.navigationData.id}/${currentPosition}`\n );\n } else if (\n currentState &&\n currentState.navigationId === state.navigationData.id\n ) {\n window.history.replaceState(\n {\n navigationId: currentState.navigationId,\n position: currentPosition,\n },\n state.title,\n `#/${currentState.navigationId}/${currentPosition}`\n );\n } else {\n window.history.pushState(\n {navigationId: state.navigationData.id, position: currentPosition},\n state.title,\n `#/${state.navigationData.id}/${currentPosition}`\n );\n }\n window.document.title = state.title;\n }\n }\n\n private _buildNavigationData(data: any) {\n const result: any[] = [];\n data.navigationData.forEach((nav: any, index: any) => {\n this.navLookup[nav.id] = nav;\n this.navVidIdLookup[nav.videoUrlIndex] = nav;\n nav.previous = data.navigationData[index - 1];\n });\n\n data.navigationData.forEach((nav: any, index: number) => {\n if (nav.nextId) {\n nav.next = this.navLookup[nav.nextId];\n delete nav.nextId;\n } else {\n nav.next = data.navigationData[index + 1];\n }\n });\n\n data.roots.forEach((id: string) => {\n const nav = this.navLookup[id];\n if (nav.children) {\n nav.children = nav.children.map((childId: string) => {\n return this.navLookup[childId];\n });\n }\n result.push(nav);\n });\n return result;\n }\n}\n","import {BaseController} from '@controllers/base-controller.ts';\nimport type {IEventbus} from '@eventbus/types.ts';\nimport type {\n IStrictDuration,\n ISubtitleCollection,\n TLanguageCode,\n} from '../types.ts';\n\nexport interface ISubtitlesControllerOperationData {\n /**\n * @dependency\n */\n selectedElement: JQuery;\n /**\n * @type=ParameterType:languagecode\n */\n language: TLanguageCode;\n /**\n * @type=ParameterType:array\n * @itemType=ParameterType:object\n */\n subtitleData: ISubtitleCollection[];\n}\n\nexport class SubtitlesController extends BaseController<ISubtitlesControllerOperationData> {\n actionLookup: Record<string, any> = {};\n currentLanguage: TLanguageCode | null = null;\n lastFunc: (() => void) | null = null;\n name = 'SubtitlesController';\n subtitleDurations: IStrictDuration[] | null = null;\n\n attach(eventbus: IEventbus) {\n this.addListener(eventbus, 'timeline-time', this.onTimeHandler);\n this.addListener(eventbus, 'timeline-seeked', this.onSeekedHandler);\n this.addListener(eventbus, 'language-change', this.languageChangeHandler);\n }\n\n detach(eventbus: IEventbus) {\n super.detach(eventbus);\n }\n\n languageChangeHandler(newLanguage: TLanguageCode) {\n this.currentLanguage = newLanguage;\n if (this.lastFunc) {\n this.lastFunc();\n }\n }\n\n removeTitle(container?: JQuery) {\n container?.empty();\n this.lastFunc = null;\n }\n\n onTimeHandler(position: number) {\n const func = this.actionLookup[position];\n if (func && this.lastFunc !== func) {\n this.lastFunc = func;\n func();\n }\n }\n\n onSeekedHandler(position: number, _duration: number) {\n const subtitleDuration = this.subtitleDurations?.find(\n x => x.start <= position && x.end >= position\n );\n\n const func = subtitleDuration\n ? this.actionLookup[subtitleDuration.start ?? -1]\n : undefined;\n if (func && this.lastFunc !== func) {\n this.lastFunc = func;\n func();\n } else if (!func) {\n this.removeTitle();\n }\n }\n\n setTitle(container: JQuery, titleLanguageLookup: Record<string, string>) {\n if (this.currentLanguage) {\n container.html(titleLanguageLookup[this.currentLanguage]);\n }\n }\n\n createActionLookup(\n operationData: ISubtitlesControllerOperationData,\n container: JQuery\n ) {\n const subtitleData = operationData.subtitleData;\n const titles = subtitleData[0].titles;\n const subtitleTimeLookup: Record<number, () => void> = {};\n\n for (let i = 0, ii = titles.length; i < ii; i++) {\n const titleLanguageLookup: Record<string, string> = {};\n\n for (let j = 0, jj = subtitleData.length; j < jj; j++) {\n const subs = subtitleData[j];\n titleLanguageLookup[subs.languageCode] = subs.titles[i].text;\n }\n\n subtitleTimeLookup[titles[i].duration.start] = this.setTitle.bind(\n this,\n container,\n titleLanguageLookup\n );\n subtitleTimeLookup[titles[i].duration.end] = this.removeTitle.bind(\n this,\n container\n );\n }\n\n return subtitleTimeLookup;\n }\n\n init(operationData: ISubtitlesControllerOperationData) {\n const container = operationData.selectedElement;\n this.removeTitle = this.removeTitle.bind(this, container);\n this.currentLanguage = operationData.language;\n this.actionLookup = this.createActionLookup(operationData, container);\n this.subtitleDurations = operationData.subtitleData?.[0].titles.map(\n x => x.duration\n );\n }\n}\n","export type {IDOMEventListenerControllerOperationData} from '@controllers/dom-event-listener-controller.ts';\nexport {DOMEventListenerController} from '@controllers/dom-event-listener-controller.ts';\nexport type {ILabelControllerMetadata} from '@controllers/label-controller.ts';\nexport {LabelController} from '@controllers/label-controller.ts';\nexport type {ILottieControllerMetadata} from '@controllers/lottie-controller.ts';\nexport {LottieController} from '@controllers/lottie-controller.ts';\nexport type {\n IMutationEventPayload,\n IMutationObserverControllerMetadata,\n} from '@controllers/mutation-observer-controller.ts';\nexport {MutationObserverController} from '@controllers/mutation-observer-controller.ts';\nexport type {INavigationControllerOperationData} from '@controllers/navigation-controller.ts';\nexport {NavigationController} from '@controllers/navigation-controller.ts';\nexport type {IProgressbarControllerOperationData} from '@controllers/progressbar-controller.ts';\nexport {ProgressbarController} from '@controllers/progressbar-controller.ts';\nexport type {IRoutingControllerOperationData} from '@controllers/routing-controller.ts';\nexport {RoutingController} from '@controllers/routing-controller.ts';\nexport type {ISubtitlesControllerOperationData} from '@controllers/subtitles-controller.ts';\nexport {SubtitlesController} from '@controllers/subtitles-controller.ts';\n","import { type IAddClassOperationData } from \"@operation/add-class.ts\";\nimport { type IOperationMetadata } from \"@operation/metadata/types.ts\";\n\nexport function addClass(): IOperationMetadata<IAddClassOperationData> {\n return {\n description: `This operation adds the specified class name to the specified selected element.`,\n category: `DOM`,\n dependentProperties: ['selectedElement'],\n properties: {\n className: {\n type: 'ParameterType:className',\n required: true,\n erased: true\n }\n },\n };\n}\n","import { type IAddControllerToElementOperationData } from \"@operation/add-controller-to-element.ts\";\nimport { type IOperationMetadata } from \"@operation/metadata/types.ts\";\nimport { type TOperationData } from \"@operation/types.ts\";\n\nexport function addControllerToElement(): IOperationMetadata<IAddControllerToElementOperationData<TOperationData>> {\n return {\n description: `This operation adds the specified controller instance to the given selected element.`,\n category: `Controller`,\n dependentProperties: ['selectedElement', 'controllerInstance'],\n };\n}\n","import { type IAddGlobalsToOperationData } from \"@operation/add-globals-to-operation.ts\";\nimport { type IOperationMetadata } from \"@operation/metadata/types.ts\";\n\nexport function addGlobalsToOperation(): IOperationMetadata<IAddGlobalsToOperationData> {\n return {\n description: `This operation adds the specified global property names to the current operation data.\nIt finally removes the \\`globalProperties\\` property from the current operation data.`,\n category: `Data`,\n properties: {\n globalProperties: {\n type: 'ParameterType:array',\n itemType: 'ParameterType:string',\n required: true,\n erased: true\n }\n },\n };\n}\n","import { type IAnimateWithClassOperationData } from \"@operation/animate-with-class.ts\";\nimport { type IOperationMetadata } from \"@operation/metadata/types.ts\";\n\nexport function animateWithClass(): IOperationMetadata<IAnimateWithClassOperationData> {\n return {\n description: `This operation adds the specified class name to the specified selected element and assumes that this\nclass triggers and animation on the selected element. It then waits for this animation to complete\nbefore it resolves.`,\n category: `Animation`,\n dependentProperties: ['selectedElement'],\n properties: {\n className: {\n type: 'ParameterType:className',\n required: true\n },\n removeClass: {\n type: [\n { value: 'undefined' },\n { value: 'false' },\n { value: 'true' }\n ]\n }\n },\n };\n}\n","import { type IAnimateOperationData } from \"@operation/animate.ts\";\nimport { type IOperationMetadata } from \"@operation/metadata/types.ts\";\n\nexport function animate(): IOperationMetadata<IAnimateOperationData> {\n return {\n description: `This operation animates the specified selected element with the given [jQuery animation](https://api.jquery.com/animate/) properties, duration and easing.\nIt resolves after the animation completes.`,\n category: `Animation`,\n dependentProperties: ['selectedElement'],\n properties: {\n animationEasing: {\n type: 'ParameterType:boolean',\n erased: true\n },\n animationProperties: {\n type: 'ParameterType:object',\n required: true,\n erased: true\n },\n animationDuration: {\n type: 'ParameterType:number',\n required: true,\n erased: true\n }\n },\n };\n}\n","import { type IAnnounceToScreenReaderOperationData } from \"@operation/announce-to-screen-reader.ts\";\nimport { type IOperationMetadata } from \"@operation/metadata/types.ts\";\n\nexport function announceToScreenReader(): IOperationMetadata<IAnnounceToScreenReaderOperationData> {\n return {\n description: `Announces a message to screen readers using an ARIA live region.`,\n category: `Accessibility`,\n properties: {\n message: {\n type: 'ParameterType:string',\n required: true,\n erased: true\n },\n priority: {\n type: [\n { value: 'undefined' },\n { value: 'polite' },\n { value: 'assertive' }\n ],\n erased: true\n }\n },\n };\n}\n","import { type IOperationMetadata } from \"@operation/metadata/types.ts\";\n\nexport function breakForEach(): IOperationMetadata<undefined> {\n return {\n description: `This operation should only be used within a loop, so between a {@link forEach} and {@link endForEach}\noperation. This operation immediately moves to the loop end index, effectively stopping the loop.`,\n category: `Control Flow`,\n };\n}\n","import { type IBroadcastEventOperationData } from \"@operation/broadcast-event.ts\";\nimport { type IOperationMetadata } from \"@operation/metadata/types.ts\";\n\nexport function broadcastEvent(): IOperationMetadata<IBroadcastEventOperationData> {\n return {\n description: `This operation broadcasts the given event through the eventbus, along with the\nevent arguments and optional event topic.`,\n category: `Utility`,\n properties: {\n eventArgs: {\n type: 'ParameterType:array',\n required: true,\n erased: true\n },\n eventTopic: {\n type: 'ParameterType:eventTopic',\n erased: true\n },\n eventName: {\n type: 'ParameterType:eventName',\n required: true,\n erased: true\n }\n },\n };\n}\n","import { type ICalcOperationData } from \"@operation/calc.ts\";\nimport { type IOperationMetadata } from \"@operation/metadata/types.ts\";\n\nexport function calc(): IOperationMetadata<ICalcOperationData> {\n return {\n description: `This operation calculates the given left and right hand operands using the specified operator.`,\n category: `Utility`,\n properties: {\n left: {\n type: 'ParameterType:number',\n required: true,\n erased: true\n },\n right: {\n type: 'ParameterType:number',\n required: true,\n erased: true\n },\n operator: {\n type: [\n { value: '+' },\n { value: '-' },\n { value: '*' },\n { value: '/' },\n { value: '%' },\n { value: '**' }\n ],\n required: true,\n erased: true\n }\n },\n outputProperties: {\n calculationResult: {\n type: [\n { value: 'undefined' },\n { value: 'number' }\n ]\n }\n }\n };\n}\n","import { type IClearElementOperationData } from \"@operation/clear-element.ts\";\nimport { type IOperationMetadata } from \"@operation/metadata/types.ts\";\n\nexport function clearElement(): IOperationMetadata<IClearElementOperationData> {\n return {\n description: `This operation removes all of the children from the given selected element.`,\n category: `DOM`,\n dependentProperties: ['selectedElement'],\n };\n}\n","import { type IClearOperationDataOperationData } from \"@operation/clear-operation-data.ts\";\nimport { type IOperationMetadata } from \"@operation/metadata/types.ts\";\n\nexport function clearOperationData(): IOperationMetadata<IClearOperationDataOperationData> {\n return {\n description: `This operation removes all of the properties on the current operation date.\nOr, if the \\`properties\\` property is set only removes the properties defined by that list.`,\n category: `Data`,\n properties: {\n properties: {\n type: [\n { value: 'undefined' },\n { value: 'string[]' }\n ],\n erased: true\n }\n },\n };\n}\n","import { type IClearStorageOperationData } from \"@operation/clear-storage.ts\";\nimport { type IOperationMetadata } from \"@operation/metadata/types.ts\";\n\nexport function clearStorage(): IOperationMetadata<IClearStorageOperationData> {\n return {\n description: `Clears data from browser storage (localStorage or sessionStorage).\n\nIf \\`key\\` is provided, removes only that key. If \\`key\\` is omitted, clears all storage.`,\n category: `Data`,\n properties: {\n key: {\n type: [\n { value: 'undefined' },\n { value: 'string' }\n ],\n erased: true\n },\n storageType: {\n type: [\n { value: 'local' },\n { value: 'session' }\n ],\n required: true,\n erased: true\n }\n },\n };\n}\n","import { type ICompareDateOperationData } from \"@operation/compare-date.ts\";\nimport { type IOperationMetadata } from \"@operation/metadata/types.ts\";\n\nexport function compareDate(): IOperationMetadata<ICompareDateOperationData> {\n return {\n description: `Compares two dates.\ncomparison: -1 (before), 0 (equal), 1 (after)`,\n category: `Date`,\n properties: {\n date1: {\n type: [\n { value: 'string' },\n { value: 'number' },\n { value: 'Date' }\n ],\n required: true,\n erased: true\n },\n date2: {\n type: [\n { value: 'string' },\n { value: 'number' },\n { value: 'Date' }\n ],\n required: true,\n erased: true\n }\n },\n outputProperties: {\n comparison: {\n type: 'ParameterType:number'\n },\n isEqual: {\n type: 'ParameterType:boolean'\n },\n isBefore: {\n type: 'ParameterType:boolean'\n },\n isAfter: {\n type: 'ParameterType:boolean'\n }\n }\n };\n}\n","import { type IConcatenateStringsOperationData } from \"@operation/concatenate-strings.ts\";\nimport { type IOperationMetadata } from \"@operation/metadata/types.ts\";\n\nexport function concatenateStrings(): IOperationMetadata<IConcatenateStringsOperationData> {\n return {\n description: `Concatenates multiple strings with an optional separator.`,\n category: `String`,\n properties: {\n strings: {\n type: 'ParameterType:array',\n itemType: 'ParameterType:string',\n required: true,\n erased: true\n },\n separator: {\n type: [\n { value: 'undefined' },\n { value: 'string' }\n ],\n erased: true\n }\n },\n outputProperties: {\n result: {\n type: 'ParameterType:string'\n }\n }\n };\n}\n","import { type IOperationMetadata } from \"@operation/metadata/types.ts\";\n\nexport function continueForEach(): IOperationMetadata<undefined> {\n return {\n description: `This operation should only be used within a loop, so between a {@link forEach} and {@link endForEach}\noperation. This operation immediately moves to the next loop index, effectively canceling the rest\nof the operations in the current iteration.`,\n category: `Control Flow`,\n };\n}\n","import { type ICreateElementOperationData, type TTagNames } from \"@operation/create-element.ts\";\nimport { type IOperationMetadata } from \"@operation/metadata/types.ts\";\n\nexport function createElement(): IOperationMetadata<ICreateElementOperationData<TTagNames>> {\n return {\n description: `This operation creates the DOM element described by the given elementName and attributes and assigns\nthe instance to the \\`template\\` property on the current operation data.`,\n category: `DOM`,\n properties: {\n elementName: {\n type: 'ParameterType:htmlElementName',\n required: true,\n erased: true\n },\n text: {\n type: [\n { value: 'undefined' },\n { value: 'string' }\n ],\n erased: true\n },\n attributes: {\n type: 'ParameterType:object',\n erased: true\n }\n },\n outputProperties: {\n template: {\n type: 'ParameterType:object'\n }\n }\n };\n}\n","import { type ICustomFunctionOperationData } from \"@operation/custom-function.ts\";\nimport { type IOperationMetadata } from \"@operation/metadata/types.ts\";\n\nexport function customFunction(): IOperationMetadata<ICustomFunctionOperationData> {\n return {\n description: `This operation retrieves a custom function defined by the given system name\nand invokes it with the current operation data and eventbus.`,\n category: `Utility`,\n properties: {\n systemName: {\n type: 'ParameterType:systemName',\n required: true,\n erased: true\n }\n },\n };\n}\n","import { type IEndActionOperationData } from \"@operation/end-action.ts\";\nimport { type IOperationMetadata } from \"@operation/metadata/types.ts\";\n\nexport function endAction(): IOperationMetadata<IEndActionOperationData> {\n return {\n description: `This operation invokes the {@link EndableAction}.end method on the specified action instance.\n\nThe action operation data is first merged with the current operation data before it is\npassed on to the action. After the action has completed the action operation data properties\nare removed from the current operation data.`,\n category: `Action`,\n dependentProperties: ['actionInstance'],\n properties: {\n actionOperationData: {\n type: 'ParameterType:object',\n required: true,\n erased: true\n }\n },\n };\n}\n","import { type IOperationMetadata } from \"@operation/metadata/types.ts\";\n\nexport function endForEach(): IOperationMetadata<undefined> {\n return {\n description: `This operation checks if the current loop should end or start the next iteration.`,\n category: `Control Flow`,\n };\n}\n","import { type IOperationMetadata } from \"@operation/metadata/types.ts\";\n\nexport function endWhen(): IOperationMetadata<undefined> {\n return {\n description: `This operation cleans up after the {@link when}/{@link otherwise}/{@link endWhen} control flow ends.`,\n category: `Control Flow`,\n };\n}\n","import { type IExtendControllerOperationData } from \"@operation/extend-controller.ts\";\nimport { type IOperationMetadata } from \"@operation/metadata/types.ts\";\n\nexport function extendController(): IOperationMetadata<IExtendControllerOperationData> {\n return {\n description: `Extends the current controller with given extension.`,\n category: `Controller`,\n dependentProperties: ['controllerInstance'],\n properties: {\n controllerExtension: {\n type: 'ParameterType:object',\n required: true,\n erased: true\n }\n },\n };\n}\n","import { type IFilterArrayOperationData } from \"@operation/filter-array.ts\";\nimport { type IOperationMetadata } from \"@operation/metadata/types.ts\";\n\nexport function filterArray(): IOperationMetadata<IFilterArrayOperationData> {\n return {\n description: `Filters an array based on property equality or custom predicate function.\n\nOperates on arrayData passed from previous operations.\nSupports two filtering modes:\n1. Property equality: \\`filterProperty\\` and \\`filterValue\\` to filter by property match\n2. Custom predicate: \\`filterPredicate\\` function for complex filtering logic`,\n category: `Array`,\n dependentProperties: ['arrayData'],\n properties: {\n filterProperty: {\n type: [\n { value: 'undefined' },\n { value: 'string' }\n ],\n erased: true\n },\n filterValue: {\n type: 'ParameterType:object',\n erased: true\n },\n filterPredicate: {\n type: [\n { value: 'undefined' },\n { value: '(item: any, index?: number | undefined) => boolean' }\n ],\n erased: true\n }\n },\n outputProperties: {\n filteredArray: {\n type: 'ParameterType:array'\n }\n }\n };\n}\n","import { type IFindInArrayOperationData } from \"@operation/find-in-array.ts\";\nimport { type IOperationMetadata } from \"@operation/metadata/types.ts\";\n\nexport function findInArray(): IOperationMetadata<IFindInArrayOperationData> {\n return {\n description: `Finds the first element in an array matching criteria.\n\nOperates on arrayData passed from previous operations.\nSupports two search modes:\n1. Property equality: \\`findProperty\\` and \\`findValue\\` to find by property match\n2. Custom predicate: \\`findPredicate\\` function for complex search logic\n\nReturns \\`undefined\\` for \\`foundItem\\` and \\`-1\\` for \\`foundIndex\\` if no match found.`,\n category: `Array`,\n dependentProperties: ['arrayData'],\n properties: {\n findProperty: {\n type: [\n { value: 'undefined' },\n { value: 'string' }\n ],\n erased: true\n },\n findValue: {\n type: 'ParameterType:object',\n erased: true\n },\n findPredicate: {\n type: [\n { value: 'undefined' },\n { value: '(item: any, index?: number | undefined) => boolean' }\n ],\n erased: true\n }\n },\n outputProperties: {\n foundItem: {\n type: 'ParameterType:object'\n },\n foundIndex: {\n type: 'ParameterType:number'\n }\n }\n };\n}\n","import { type IForEachOperationData } from \"@operation/for-each.ts\";\nimport { type IOperationMetadata } from \"@operation/metadata/types.ts\";\n\nexport function forEach(): IOperationMetadata<IForEachOperationData> {\n return {\n description: `This operation iterates over the given collection.\n\nEach iteration the current item from the specified collection is\nassigned to the {@link IOperationScope.currentItem |currentItem} property on the {@link IOperationScope |operation scope}.\n\nAt the start of the loop, the associated {@link endForEach} operation is determined and when\nthe last iteration is completed the flow control is set to the index of that operation.\n\nThe {@link continueForEach |continue} and {@link breakForEach |break} operations can be used to control the\nloop iterations.`,\n category: `Control Flow`,\n properties: {\n collection: {\n type: 'ParameterType:array|ParameterType:string',\n required: true\n }\n },\n };\n}\n","import { type IFormatDateOperationData } from \"@operation/format-date.ts\";\nimport { type IOperationMetadata } from \"@operation/metadata/types.ts\";\n\nexport function formatDate(): IOperationMetadata<IFormatDateOperationData> {\n return {\n description: `Formats a date using Intl.DateTimeFormat or simple patterns.`,\n category: `Date`,\n dependentProperties: ['date'],\n properties: {\n format: {\n type: 'ParameterType:string',\n required: true,\n erased: true\n }\n },\n outputProperties: {\n formattedDate: {\n type: 'ParameterType:string'\n }\n }\n };\n}\n","import { type IFormatTextOperationData } from \"@operation/format-text.ts\";\nimport { type IOperationMetadata } from \"@operation/metadata/types.ts\";\n\nexport function formatText(): IOperationMetadata<IFormatTextOperationData> {\n return {\n description: `Transforms text using format operations: uppercase, lowercase, capitalize, titlecase, or trim.\n\nOperates on textContent passed from previous operations (e.g., getTextContent).\n\nTransformations:\n- \\`uppercase\\`: Convert all characters to uppercase\n- \\`lowercase\\`: Convert all characters to lowercase\n- \\`capitalize\\`: Capitalize only the first letter\n- \\`titlecase\\`: Capitalize first letter of each word\n- \\`trim\\`: Remove leading and trailing whitespace`,\n category: `Text`,\n dependentProperties: ['textContent'],\n properties: {\n transformation: {\n type: [\n { value: 'uppercase' },\n { value: 'lowercase' },\n { value: 'capitalize' },\n { value: 'titlecase' },\n { value: 'trim' }\n ],\n required: true,\n erased: true\n }\n },\n outputProperties: {\n formattedText: {\n type: 'ParameterType:string'\n }\n }\n };\n}\n","import { type IGetAttributesFromElementOperationData } from \"@operation/get-attributes-from-element.ts\";\nimport { type IOperationMetadata } from \"@operation/metadata/types.ts\";\n\nexport function getAttributesFromElement(): IOperationMetadata<IGetAttributesFromElementOperationData> {\n return {\n description: `This operation retrieves the values for the specified attribute names from the given selected element.`,\n category: `DOM`,\n dependentProperties: ['selectedElement'],\n properties: {\n attributeNames: {\n type: 'ParameterType:array',\n itemType: 'ParameterType:string',\n required: true,\n erased: true\n }\n },\n outputProperties: {\n attributeValues: {\n type: [\n { value: 'undefined' },\n { value: 'Record<string, unknown>' }\n ]\n }\n }\n };\n}\n","import { type IGetControllerFromElementOperationData } from \"@operation/get-controller-from-element.ts\";\nimport { type IOperationMetadata } from \"@operation/metadata/types.ts\";\n\nexport function getControllerFromElement(): IOperationMetadata<IGetControllerFromElementOperationData> {\n return {\n description: `This operation retrieves the controller instance with the specified name that is assigned to the given selected element.`,\n category: `Controller`,\n dependentProperties: ['selectedElement'],\n properties: {\n controllerName: {\n type: 'ParameterType:controllerName',\n required: true,\n erased: true\n }\n },\n outputProperties: {\n controllerInstance: {\n type: 'ParameterType:object'\n }\n }\n };\n}\n","import { type IGetControllerInstanceOperationData } from \"@operation/get-controller-instance.ts\";\nimport { type IOperationMetadata } from \"@operation/metadata/types.ts\";\n\nexport function getControllerInstance(): IOperationMetadata<IGetControllerInstanceOperationData> {\n return {\n description: `This operation retrieves an instance of the given controller name.\nIt assigns this instance to the \\`controllerInstance\\` property on the current operation data`,\n category: `Controller`,\n properties: {\n systemName: {\n type: [\n { value: 'DOMEventListenerController' },\n { value: 'LabelController' },\n { value: 'LottieController' },\n { value: 'MutationObserverController' },\n { value: 'NavigationController' },\n { value: 'ProgressbarController' },\n { value: 'RoutingController' },\n { value: 'SubtitlesController' }\n ],\n required: true,\n erased: true\n }\n },\n outputProperties: {\n controllerInstance: {\n type: 'ParameterType:object'\n }\n }\n };\n}\n","import { type IGetCurrentTimeOperationData } from \"@operation/get-current-time.ts\";\nimport { type IOperationMetadata } from \"@operation/metadata/types.ts\";\n\nexport function getCurrentTime(): IOperationMetadata<IGetCurrentTimeOperationData> {\n return {\n description: `Gets the current time as timestamp and Date object.`,\n category: `Date`,\n outputProperties: {\n timestamp: {\n type: 'ParameterType:number'\n },\n date: {\n type: 'ParameterType:Date'\n }\n }\n };\n}\n","import { type IGetElementDimensionsOperationData } from \"@operation/get-element-dimensions.ts\";\nimport { type IOperationMetadata } from \"@operation/metadata/types.ts\";\n\nexport function getElementDimensions(): IOperationMetadata<IGetElementDimensionsOperationData> {\n return {\n description: `This operation calculates the width and height of the given selected element.\nIt assigns this struct to the dimensions property on the current operation data.\nOptionally the width and height can be modified using the given modifier string.\n\nThe modifier string is formatted in the following way:\n\n<operator><amount><optional-side><optional-precentage>|<ratio-definition>\n\nWhere the ratio modifier is formatted in the following way:\n<side>[ar=<ratio-left>-<ratio-right>]\n\nFor example, this modifier '+100h|w[ar=8-1]' will modifiy the dimensions like this:\nit will add a value of 100 to the height and modify the width by a ratio of 8 to 1 relative to the height.`,\n category: `DOM`,\n dependentProperties: ['selectedElement'],\n properties: {\n modifier: {\n type: 'ParameterType:dimensionsModifier',\n erased: true\n }\n },\n outputProperties: {\n dimensions: {\n type: 'ParameterType:object'\n }\n }\n };\n}\n","import { type IGetFocusedElementOperationData } from \"@operation/get-focused-element.ts\";\nimport { type IOperationMetadata } from \"@operation/metadata/types.ts\";\n\nexport function getFocusedElement(): IOperationMetadata<IGetFocusedElementOperationData> {\n return {\n description: `Gets the currently focused element.`,\n category: `Focus`,\n outputProperties: {\n focusedElement: {\n type: 'ParameterType:jQuery'\n }\n }\n };\n}\n","import { type IGetFormDataOperationData } from \"@operation/get-form-data.ts\";\nimport { type IOperationMetadata } from \"@operation/metadata/types.ts\";\n\nexport function getFormData(): IOperationMetadata<IGetFormDataOperationData> {\n return {\n description: `Extracts all input, select, and textarea values from form element into operation data.\n\nThis operation reads form field values and returns them as an object with field names as keys.\nOnly processes form elements that are enabled and not hidden. Handles checkboxes, radio buttons,\nselect elements, textareas, and text inputs.`,\n category: `Form`,\n dependentProperties: ['selectedElement'],\n outputProperties: {\n formData: {\n type: 'ParameterType:object'\n }\n }\n };\n}\n","import { type IGetImportOperationData } from \"@operation/get-import.ts\";\nimport { type IOperationMetadata } from \"@operation/metadata/types.ts\";\n\nexport function getImport(): IOperationMetadata<IGetImportOperationData> {\n return {\n description: `This operation retrieves the import specified by the given \\`systemName\\` and\nassigns it to the \\`importedInstance\\` property on the current operaton date.`,\n category: `Utility`,\n properties: {\n systemName: {\n type: 'ParameterType:systemName',\n required: true,\n erased: true\n }\n },\n outputProperties: {\n importedInstance: {\n type: 'ParameterType:object'\n }\n }\n };\n}\n","import { type IGetQueryParamsOperationData } from \"@operation/get-query-params.ts\";\nimport { type IOperationMetadata } from \"@operation/metadata/types.ts\";\n\nexport function getQueryParams(): IOperationMetadata<IGetQueryParamsOperationData> {\n return {\n description: `This operation retrieves the current query parameters from the browser's address bar and places\nthem on the returned operation data.`,\n category: `Utility`,\n properties: {\n defaultValues: {\n type: [\n { value: 'undefined' },\n { value: 'Record<string, string>' }\n ],\n erased: true\n }\n },\n outputProperties: {\n queryParams: {\n type: [\n { value: 'undefined' },\n { value: 'Record<string, string>' }\n ]\n }\n }\n };\n}\n","import { type IGetScrollPositionOperationData } from \"@operation/get-scroll-position.ts\";\nimport { type IOperationMetadata } from \"@operation/metadata/types.ts\";\n\nexport function getScrollPosition(): IOperationMetadata<IGetScrollPositionOperationData> {\n return {\n description: `Gets the current scroll position of the viewport.\n\nReturns x (horizontal) and y (vertical) scroll positions in pixels.\nUses cross-browser compatible methods to retrieve scroll position.`,\n category: `Scroll`,\n outputProperties: {\n scrollX: {\n type: 'ParameterType:number'\n },\n scrollY: {\n type: 'ParameterType:number'\n }\n }\n };\n}\n","import { type IGetTextContentOperationData } from \"@operation/get-text-content.ts\";\nimport { type IOperationMetadata } from \"@operation/metadata/types.ts\";\n\nexport function getTextContent(): IOperationMetadata<IGetTextContentOperationData> {\n return {\n description: `Extracts text content from element, stripping all HTML markup.\n\nUses jQuery's \\`.text()\\` method which is XSS-safe and returns only the text content\nwithout any HTML tags. Preserves whitespace and text from nested elements.`,\n category: `Text`,\n dependentProperties: ['selectedElement'],\n outputProperties: {\n textContent: {\n type: [\n { value: 'undefined' },\n { value: 'string' }\n ]\n }\n }\n };\n}\n","import { type IHttpDeleteOperationData } from \"@operation/http-delete.ts\";\nimport { type IOperationMetadata } from \"@operation/metadata/types.ts\";\n\nexport function httpDelete(): IOperationMetadata<IHttpDeleteOperationData> {\n return {\n description: `Performs an HTTP DELETE request to the specified URL.`,\n category: `HTTP`,\n properties: {\n url: {\n type: 'ParameterType:string',\n required: true,\n erased: true\n },\n headers: {\n type: [\n { value: 'undefined' },\n { value: 'Record<string, string>' }\n ],\n erased: true\n }\n },\n outputProperties: {\n response: {\n type: 'ParameterType:object'\n },\n status: {\n type: 'ParameterType:number'\n }\n }\n };\n}\n","import { type IHttpPostOperationData } from \"@operation/http-post.ts\";\nimport { type IOperationMetadata } from \"@operation/metadata/types.ts\";\n\nexport function httpPost(): IOperationMetadata<IHttpPostOperationData> {\n return {\n description: `Performs an HTTP POST request to the specified URL.`,\n category: `HTTP`,\n properties: {\n url: {\n type: 'ParameterType:string',\n required: true,\n erased: true\n },\n body: {\n type: 'ParameterType:object',\n erased: true\n },\n headers: {\n type: [\n { value: 'undefined' },\n { value: 'Record<string, string>' }\n ],\n erased: true\n }\n },\n outputProperties: {\n response: {\n type: 'ParameterType:object'\n },\n status: {\n type: 'ParameterType:number'\n }\n }\n };\n}\n","import { type IHttpPutOperationData } from \"@operation/http-put.ts\";\nimport { type IOperationMetadata } from \"@operation/metadata/types.ts\";\n\nexport function httpPut(): IOperationMetadata<IHttpPutOperationData> {\n return {\n description: `Performs an HTTP PUT request to the specified URL.`,\n category: `HTTP`,\n properties: {\n url: {\n type: 'ParameterType:string',\n required: true,\n erased: true\n },\n body: {\n type: 'ParameterType:object',\n erased: true\n },\n headers: {\n type: [\n { value: 'undefined' },\n { value: 'Record<string, string>' }\n ],\n erased: true\n }\n },\n outputProperties: {\n response: {\n type: 'ParameterType:object'\n },\n status: {\n type: 'ParameterType:number'\n }\n }\n };\n}\n","import { type IInvokeObjectMethodOperationData } from \"@operation/invoke-object-method.ts\";\nimport { type IOperationMetadata } from \"@operation/metadata/types.ts\";\n\nexport function invokeObjectMethod(): IOperationMetadata<IInvokeObjectMethodOperationData> {\n return {\n description: `This operation invokes the specified method on the given object with the given optional arguments\nand assigns the result to the \\`methodResult\\` operationdata property.`,\n category: `Utility`,\n dependentProperties: ['instance'],\n properties: {\n methodName: {\n type: 'ParameterType:string',\n required: true,\n erased: true\n },\n methodArguments: {\n type: [\n { value: 'undefined' },\n { value: 'unknown[]' }\n ],\n erased: true\n }\n },\n outputProperties: {\n methodResult: {\n type: 'ParameterType:object'\n }\n }\n };\n}\n","import { type IIsElementInViewportOperationData } from \"@operation/is-element-in-viewport.ts\";\nimport { type IOperationMetadata } from \"@operation/metadata/types.ts\";\n\nexport function isElementInViewport(): IOperationMetadata<IIsElementInViewportOperationData> {\n return {\n description: `Checks if an element is currently visible within the viewport.\n\nUses \\`getBoundingClientRect()\\` to determine if the element is within the viewport boundaries.`,\n category: `DOM`,\n dependentProperties: ['selectedElement'],\n outputProperties: {\n isInViewport: {\n type: 'ParameterType:boolean'\n }\n }\n };\n}\n","import { type ILoadFromStorageOperationData } from \"@operation/load-from-storage.ts\";\nimport { type IOperationMetadata } from \"@operation/metadata/types.ts\";\n\nexport function loadFromStorage(): IOperationMetadata<ILoadFromStorageOperationData> {\n return {\n description: `Loads data from browser storage (localStorage or sessionStorage).\n\nDeserializes the stored JSON value. Returns \\`null\\` if key doesn't exist.`,\n category: `Data`,\n properties: {\n key: {\n type: 'ParameterType:string',\n required: true,\n erased: true\n },\n storageType: {\n type: [\n { value: 'local' },\n { value: 'session' }\n ],\n required: true,\n erased: true\n }\n },\n outputProperties: {\n loadedValue: {\n type: 'ParameterType:object'\n }\n }\n };\n}\n","import { type ILoadJSONOperationData } from \"@operation/load-json.ts\";\nimport { type IOperationMetadata } from \"@operation/metadata/types.ts\";\n\nexport function loadJson(): IOperationMetadata<ILoadJSONOperationData> {\n return {\n description: `This operation loads a JSON file from the specified url and assigns it to the json\nproperty on the current operation data.\n\nIf the cache property is set to true and a cached value already exists, this is assigned\ninstead of re-retrieving it from the url.`,\n category: `Utility`,\n properties: {\n url: {\n type: 'ParameterType:string',\n required: true,\n erased: true\n },\n cache: {\n type: [\n { value: 'undefined' },\n { value: 'false' },\n { value: 'true' }\n ],\n erased: true\n }\n },\n outputProperties: {\n json: {\n type: 'ParameterType:object'\n }\n }\n };\n}\n","import { type ILogOperationData } from \"@operation/log.ts\";\nimport { type IOperationMetadata } from \"@operation/metadata/types.ts\";\n\nexport function log(): IOperationMetadata<ILogOperationData> {\n return {\n description: `This operation logs the specified value, or, when no logValue property has been assigned\nit will log the current operation data, global data and scope to the console`,\n category: `Utility`,\n properties: {\n logValue: {\n type: 'ParameterType:object|ParameterType:string|ParameterType:number|ParameterType:boolean|ParameterType:array',\n erased: true\n },\n logName: {\n type: [\n { value: 'undefined' },\n { value: 'string' }\n ],\n erased: true\n }\n },\n };\n}\n","import { type IMapArrayOperationData } from \"@operation/map-array.ts\";\nimport { type IOperationMetadata } from \"@operation/metadata/types.ts\";\n\nexport function mapArray(): IOperationMetadata<IMapArrayOperationData> {\n return {\n description: `Transforms each element of an array using a mapping function.\n\nOperates on arrayData passed from previous operations.\nThe mapFunction receives each item and optionally its index.`,\n category: `Array`,\n dependentProperties: ['arrayData'],\n properties: {\n mapFunction: {\n type: 'ParameterType:function',\n required: true,\n erased: true\n }\n },\n outputProperties: {\n mappedArray: {\n type: [\n { value: 'undefined' },\n { value: 'any[]' }\n ]\n }\n }\n };\n}\n","import { type IMathOperationData } from \"@operation/math.ts\";\nimport { type IOperationMetadata } from \"@operation/metadata/types.ts\";\n\nexport function math(): IOperationMetadata<IMathOperationData> {\n return {\n description: `This operation performs the given math function with the specified arguments.`,\n category: `Utility`,\n properties: {\n args: {\n type: 'ParameterType:array',\n required: true,\n erased: true\n },\n functionName: {\n type: 'ParameterType:mathfunction',\n required: true,\n erased: true\n }\n },\n outputProperties: {\n mathResult: {\n type: [\n { value: 'undefined' },\n { value: 'number' }\n ]\n }\n }\n };\n}\n","import { type IOperationMetadata } from \"@operation/metadata/types.ts\";\n\nexport function otherwise(): IOperationMetadata<undefined> {\n return {\n description: `If the preceeding {@link when} operation evaluates to \\`true\\` subsequent operations will\nbe skipped until an {@link endWhen} operation is encountered.`,\n category: `Control Flow`,\n };\n}\n","import { type IOperationMetadata } from \"@operation/metadata/types.ts\";\nimport { type IRemoveClassOperationData } from \"@operation/remove-class.ts\";\n\nexport function removeClass(): IOperationMetadata<IRemoveClassOperationData> {\n return {\n description: `This operation removes the spcified class name from the given selected element.`,\n category: `DOM`,\n dependentProperties: ['selectedElement'],\n properties: {\n className: {\n type: 'ParameterType:className',\n required: true,\n erased: true\n }\n },\n };\n}\n","import { type IOperationMetadata } from \"@operation/metadata/types.ts\";\nimport { type IRemoveControllerFromElementOperationData } from \"@operation/remove-controller-from-element.ts\";\n\nexport function removeControllerFromElement(): IOperationMetadata<IRemoveControllerFromElementOperationData> {\n return {\n description: `This operation removes the controller with the specified name from the given selected element.`,\n category: `Controller`,\n dependentProperties: ['selectedElement'],\n properties: {\n controllerName: {\n type: 'ParameterType:controllerName',\n required: true,\n erased: true\n }\n },\n };\n}\n","import { type IOperationMetadata } from \"@operation/metadata/types.ts\";\nimport { type IRemoveElementOperationData } from \"@operation/remove-element.ts\";\n\nexport function removeElement(): IOperationMetadata<IRemoveElementOperationData> {\n return {\n description: `This operation removes the given selected element from the DOM.`,\n category: `DOM`,\n dependentProperties: ['selectedElement'],\n };\n}\n","import { type IOperationMetadata } from \"@operation/metadata/types.ts\";\nimport { type IRemovePropertiesFromOperationDataOperationData } from \"@operation/remove-properties-from-operation-data.ts\";\n\nexport function removePropertiesFromOperationData(): IOperationMetadata<IRemovePropertiesFromOperationDataOperationData> {\n return {\n description: `This operation removes the given list of properties from the current operation data.\nIt will also remove the property \\`propertyNames\\` from the result.`,\n category: `Data`,\n properties: {\n propertyNames: {\n type: 'ParameterType:array',\n itemType: 'ParameterType:string',\n required: true,\n erased: true\n }\n },\n };\n}\n","import { type IOperationMetadata } from \"@operation/metadata/types.ts\";\nimport { type IReparentElementOperationData } from \"@operation/reparent-element.ts\";\n\nexport function reparentElement(): IOperationMetadata<IReparentElementOperationData> {\n return {\n description: `This operation moves the given selected element to the new parent that is defined\nby the specified \\`newParentSelector\\`.`,\n category: `DOM`,\n dependentProperties: ['selectedElement'],\n properties: {\n newParentSelector: {\n type: 'ParameterType:selector',\n required: true,\n erased: true\n }\n },\n };\n}\n","import { type IOperationMetadata } from \"@operation/metadata/types.ts\";\nimport { type IReplaceStringOperationData } from \"@operation/replace-string.ts\";\n\nexport function replaceString(): IOperationMetadata<IReplaceStringOperationData> {\n return {\n description: `Replaces occurrences of a pattern in a string (alias for replaceText for string context).`,\n category: `String`,\n dependentProperties: ['textContent'],\n properties: {\n pattern: {\n type: [\n { value: 'string' },\n { value: 'RegExp' }\n ],\n required: true,\n erased: true\n },\n replacement: {\n type: 'ParameterType:string',\n required: true,\n erased: true\n }\n },\n outputProperties: {\n result: {\n type: 'ParameterType:string'\n }\n }\n };\n}\n","import { type IOperationMetadata } from \"@operation/metadata/types.ts\";\nimport { type IReplaceTextOperationData } from \"@operation/replace-text.ts\";\n\nexport function replaceText(): IOperationMetadata<IReplaceTextOperationData> {\n return {\n description: `Finds and replaces text using literal string or regex pattern.\n\nOperates on textContent passed from previous operations (e.g., getTextContent).\nSupports regex patterns with global flag for multiple replacements.\nUpdates textContent with replaced text and sets replacementCount.`,\n category: `Text`,\n dependentProperties: ['textContent'],\n properties: {\n searchPattern: {\n type: [\n { value: 'string' },\n { value: 'RegExp' }\n ],\n required: true,\n erased: true\n },\n replacement: {\n type: 'ParameterType:string',\n required: true,\n erased: true\n }\n },\n outputProperties: {\n replacementCount: {\n type: 'ParameterType:number'\n }\n }\n };\n}\n","import { type IOperationMetadata } from \"@operation/metadata/types.ts\";\nimport { type IRequestActionOperationData } from \"@operation/request-action.ts\";\n\nexport function requestAction(): IOperationMetadata<IRequestActionOperationData> {\n return {\n description: `This operation requests an action instance with the specified name and assigns it\nto the \\`actionInstance\\` property on the current operation data.`,\n category: `Action`,\n properties: {\n systemName: {\n type: 'ParameterType:actionName',\n required: true,\n erased: true\n }\n },\n outputProperties: {\n actionInstance: {\n type: 'ParameterType:object'\n }\n }\n };\n}\n","import { type IOperationMetadata } from \"@operation/metadata/types.ts\";\nimport { type ISaveToStorageOperationData } from \"@operation/save-to-storage.ts\";\n\nexport function saveToStorage(): IOperationMetadata<ISaveToStorageOperationData> {\n return {\n description: `Saves data to browser storage (localStorage or sessionStorage).\n\nSerializes the value as JSON before storing. Supports any JSON-serializable data type.`,\n category: `Data`,\n properties: {\n key: {\n type: 'ParameterType:string',\n required: true,\n erased: true\n },\n value: {\n type: 'ParameterType:object',\n required: true,\n erased: true\n },\n storageType: {\n type: [\n { value: 'local' },\n { value: 'session' }\n ],\n required: true,\n erased: true\n }\n },\n };\n}\n","import { type IOperationMetadata } from \"@operation/metadata/types.ts\";\nimport { type IScrollToElementOperationData } from \"@operation/scroll-to-element.ts\";\n\nexport function scrollToElement(): IOperationMetadata<IScrollToElementOperationData> {\n return {\n description: `Scrolls the viewport to bring the selected element into view.\n\nUses the browser's \\`scrollIntoView\\` API with configurable behavior.`,\n category: `Scroll`,\n dependentProperties: ['selectedElement'],\n properties: {\n behavior: {\n type: [\n { value: 'undefined' },\n { value: 'auto' },\n { value: 'smooth' }\n ],\n erased: true\n },\n block: {\n type: [\n { value: 'undefined' },\n { value: 'start' },\n { value: 'center' },\n { value: 'end' },\n { value: 'nearest' }\n ],\n erased: true\n },\n inline: {\n type: [\n { value: 'undefined' },\n { value: 'start' },\n { value: 'center' },\n { value: 'end' },\n { value: 'nearest' }\n ],\n erased: true\n }\n },\n };\n}\n","import { type IOperationMetadata } from \"@operation/metadata/types.ts\";\nimport { type IScrollToPositionOperationData } from \"@operation/scroll-to-position.ts\";\n\nexport function scrollToPosition(): IOperationMetadata<IScrollToPositionOperationData> {\n return {\n description: `Scrolls the viewport to a specific x,y coordinate position.\n\nUses the browser's \\`window.scrollTo\\` API with configurable behavior.`,\n category: `Scroll`,\n properties: {\n x: {\n type: 'ParameterType:number',\n required: true,\n erased: true\n },\n y: {\n type: 'ParameterType:number',\n required: true,\n erased: true\n },\n behavior: {\n type: [\n { value: 'undefined' },\n { value: 'auto' },\n { value: 'smooth' }\n ],\n erased: true\n }\n },\n };\n}\n","import { type IOperationMetadata } from \"@operation/metadata/types.ts\";\nimport { type ISelectElementOperationData } from \"@operation/select-element.ts\";\n\nexport function selectElement(): IOperationMetadata<ISelectElementOperationData> {\n return {\n description: `This operation selects one or more elements using the specified selector.\n\nIf \\`useSelectedElementAsRoot\\` is set to true and a valid DOM element is assigned\nto the current operation data's \\`selectedElement\\` property\nthen the element will be looked for only in the descendant elements of this DOM element.`,\n category: `DOM`,\n properties: {\n selector: {\n type: 'ParameterType:selector',\n required: true,\n erased: true\n },\n useSelectedElementAsRoot: {\n type: [\n { value: 'undefined' },\n { value: 'false' },\n { value: 'true' }\n ],\n erased: true\n }\n },\n outputProperties: {\n selectedElement: {\n type: 'ParameterType:object'\n }\n }\n };\n}\n","import { type IOperationMetadata } from \"@operation/metadata/types.ts\";\nimport { type ISetDataOperationData } from \"@operation/set-data.ts\";\n\nexport function setData(): IOperationMetadata<ISetDataOperationData> {\n return {\n description: `This operation assigns the specified properties to the specified data targets.`,\n category: `Data`,\n properties: {\n properties: {\n type: 'ParameterType:object',\n required: true,\n erased: true\n }\n },\n };\n}\n","import { type IOperationMetadata } from \"@operation/metadata/types.ts\";\nimport { type ISetElementAttributesOperationData } from \"@operation/set-element-attributes.ts\";\n\nexport function setElementAttributes(): IOperationMetadata<ISetElementAttributesOperationData> {\n return {\n description: `This operation sets the specified set of attributes on the given selected element.`,\n category: `DOM`,\n dependentProperties: ['selectedElement'],\n properties: {\n attributes: {\n type: 'ParameterType:object',\n required: true,\n erased: true\n }\n },\n };\n}\n","import { type IOperationMetadata } from \"@operation/metadata/types.ts\";\nimport { type ISetElementContentOperationData } from \"@operation/set-element-content.ts\";\n\nexport function setElementContent(): IOperationMetadata<ISetElementContentOperationData> {\n return {\n description: `This operation sets the specified content defined by the value assigned to the template property\nto the given selected element.\n\nWhen the \\`insertionType\\` is set to \\`overwrite\\` the contents of the selected element are replaced\nby the given template.\nWhen set to \\`append\\` the new content will be inserted after the current content.\nWhen set to \\`prepend\\` the new content will be inserted before the current content.`,\n category: `DOM`,\n dependentProperties: ['selectedElement'],\n properties: {\n template: {\n type: [\n { value: 'string' },\n { value: 'Element' },\n { value: 'Text' },\n { value: 'Comment' },\n { value: 'Document' },\n { value: 'DocumentFragment' }\n ],\n erased: true\n },\n insertionType: {\n type: [\n { value: 'overwrite' },\n { value: 'append' },\n { value: 'prepend' }\n ],\n erased: true\n }\n },\n };\n}\n","import { type IOperationMetadata } from \"@operation/metadata/types.ts\";\nimport { type ISetFocusOperationData } from \"@operation/set-focus.ts\";\n\nexport function setFocus(): IOperationMetadata<ISetFocusOperationData> {\n return {\n description: `Sets focus to the selected element.`,\n category: `Focus`,\n dependentProperties: ['selectedElement'],\n };\n}\n","import { type IOperationMetadata } from \"@operation/metadata/types.ts\";\nimport { type ISetFormValueOperationData } from \"@operation/set-form-value.ts\";\n\nexport function setFormValue(): IOperationMetadata<ISetFormValueOperationData> {\n return {\n description: `Sets the value of an input, select, or textarea element.\n\nHandles different input types appropriately:\n- Text inputs, textareas, selects: sets value directly\n- Checkboxes: sets checked property for boolean values\n- Radio buttons: sets checked property for boolean values\n- Number inputs: converts to string`,\n category: `Form`,\n dependentProperties: ['selectedElement'],\n properties: {\n value: {\n type: [\n { value: 'string' },\n { value: 'number' },\n { value: 'false' },\n { value: 'true' }\n ],\n required: true,\n erased: true\n }\n },\n };\n}\n","import { type IOperationMetadata } from \"@operation/metadata/types.ts\";\nimport { type ISetGlobalDataOperationData } from \"@operation/set-global-data.ts\";\n\nexport function setGlobalData(): IOperationMetadata<ISetGlobalDataOperationData> {\n return {\n description: `This operation copies the specified properties from the operationData to the global data.`,\n category: `Data`,\n properties: {\n propertyNames: {\n type: 'ParameterType:array',\n itemType: 'ParameterType:string',\n required: true,\n erased: true\n }\n },\n };\n}\n","import { type IOperationMetadata } from \"@operation/metadata/types.ts\";\nimport { type ISetOperationData } from \"@operation/set-operation-data.ts\";\n\nexport function setOperationData(): IOperationMetadata<ISetOperationData> {\n return {\n description: `This operation assigns the specified properties to the current operation data.\nWhen override is set to true the properties replace the current operation data entirely.`,\n category: `Data`,\n properties: {\n override: {\n type: [\n { value: 'undefined' },\n { value: 'false' },\n { value: 'true' }\n ],\n erased: true\n },\n properties: {\n type: 'ParameterType:object',\n required: true,\n erased: true\n }\n },\n };\n}\n","import { type IOperationMetadata } from \"@operation/metadata/types.ts\";\nimport { type ISetStyleOperationData } from \"@operation/set-style.ts\";\n\nexport function setStyle(): IOperationMetadata<ISetStyleOperationData> {\n return {\n description: `This operation assigns the specified CSS style properties to the\ngiven selected element.`,\n category: `DOM`,\n dependentProperties: ['selectedElement'],\n properties: {\n properties: {\n type: 'ParameterType:cssProperties',\n required: true,\n erased: true\n }\n },\n };\n}\n","import { type IOperationMetadata } from \"@operation/metadata/types.ts\";\nimport { type ISetVariableOperationData } from \"@operation/set-variable.ts\";\n\nexport function setVariable(): IOperationMetadata<ISetVariableOperationData> {\n return {\n description: `This operation sets a variable with the specified name on the scope with the specified value.`,\n category: `Data`,\n properties: {\n name: {\n type: 'ParameterType:string',\n required: true,\n erased: true\n },\n value: {\n type: 'ParameterType:object|ParameterType:string|ParameterType:number|ParameterType:boolean|ParameterType:array',\n required: true,\n erased: true\n }\n },\n };\n}\n","import { type IOperationMetadata } from \"@operation/metadata/types.ts\";\nimport { type ISortArrayOperationData } from \"@operation/sort-array.ts\";\n\nexport function sortArray(): IOperationMetadata<ISortArrayOperationData> {\n return {\n description: `Sorts an array by property, natural order, or custom comparator function.\n\nOperates on arrayData passed from previous operations.\nSupports three sorting modes:\n1. Property sort: \\`sortProperty\\` and \\`sortOrder\\` to sort objects by property\n2. Natural sort: \\`sortOrder\\` alone for primitive arrays\n3. Custom comparator: \\`sortComparator\\` function for complex sorting logic`,\n category: `Array`,\n dependentProperties: ['arrayData'],\n properties: {\n sortProperty: {\n type: [\n { value: 'undefined' },\n { value: 'string' }\n ],\n erased: true\n },\n sortOrder: {\n type: [\n { value: 'undefined' },\n { value: 'asc' },\n { value: 'desc' }\n ],\n erased: true\n },\n sortComparator: {\n type: [\n { value: 'undefined' },\n { value: '(a: any, b: any) => number' }\n ],\n erased: true\n }\n },\n outputProperties: {\n sortedArray: {\n type: 'ParameterType:array'\n }\n }\n };\n}\n","import { type IOperationMetadata } from \"@operation/metadata/types.ts\";\nimport { type ISplitStringOperationData } from \"@operation/split-string.ts\";\n\nexport function splitString(): IOperationMetadata<ISplitStringOperationData> {\n return {\n description: `Splits a string into an array by delimiter (string or regex).`,\n category: `String`,\n dependentProperties: ['textContent'],\n properties: {\n delimiter: {\n type: [\n { value: 'string' },\n { value: 'RegExp' }\n ],\n required: true,\n erased: true\n },\n limit: {\n type: [\n { value: 'undefined' },\n { value: 'number' }\n ],\n erased: true\n }\n },\n outputProperties: {\n resultArray: {\n type: 'ParameterType:array',\n itemType: 'ParameterType:string'\n }\n }\n };\n}\n","import { type IOperationMetadata } from \"@operation/metadata/types.ts\";\nimport { type IStartActionOperationData } from \"@operation/start-action.ts\";\n\nexport function startAction(): IOperationMetadata<IStartActionOperationData> {\n return {\n description: `This operation starts the specified action instance using the given action operation data.\n\nThe action operation data is first merged with the current operation data before it is\npassed on to the action. After the action has completed the action operation data properties\nare removed from the current operation data.`,\n category: `Action`,\n dependentProperties: ['actionInstance'],\n properties: {\n actionOperationData: {\n type: 'ParameterType:object',\n erased: true\n }\n },\n };\n}\n","import { type IOperationMetadata } from \"@operation/metadata/types.ts\";\nimport { type ISubstringTextOperationData } from \"@operation/substring-text.ts\";\n\nexport function substringText(): IOperationMetadata<ISubstringTextOperationData> {\n return {\n description: `Extracts a substring from text between start and end indices.`,\n category: `Text`,\n dependentProperties: ['textContent'],\n properties: {\n start: {\n type: 'ParameterType:number',\n required: true,\n erased: true\n },\n end: {\n type: [\n { value: 'undefined' },\n { value: 'number' }\n ],\n erased: true\n }\n },\n outputProperties: {\n substring: {\n type: 'ParameterType:string'\n }\n }\n };\n}\n","import { type IOperationMetadata } from \"@operation/metadata/types.ts\";\nimport { type IToggleClassOperationData } from \"@operation/toggle-class.ts\";\n\nexport function toggleClass(): IOperationMetadata<IToggleClassOperationData> {\n return {\n description: `This operation toggles the specfied class name on the given selected element.\n\nMeaning, if the specified class name exists on the given element it will be removed,\notherwise it will be added.`,\n category: `DOM`,\n dependentProperties: ['selectedElement'],\n properties: {\n className: {\n type: 'ParameterType:className',\n required: true,\n erased: true\n }\n },\n };\n}\n","import { type IOperationMetadata } from \"@operation/metadata/types.ts\";\nimport { type IToggleElementOperationData } from \"@operation/toggle-element.ts\";\n\nexport function toggleElement(): IOperationMetadata<IToggleElementOperationData> {\n return {\n description: `This operation toggles the visibility of the given selected element.\n\nMeaning, if the element is hidden, it will be made visible, otherwise\nit will be hidden.`,\n category: `DOM`,\n dependentProperties: ['selectedElement'],\n };\n}\n","import { type IOperationMetadata } from \"@operation/metadata/types.ts\";\nimport { type IToggleFormElementOperationData } from \"@operation/toggle-form-element.ts\";\n\nexport function toggleFormElement(): IOperationMetadata<IToggleFormElementOperationData> {\n return {\n description: `Enables or disables form input elements (inputs, selects, textareas, buttons).\n\nSets the \\`disabled\\` property on the element. When \\`enabled\\` is true, removes the disabled\nattribute; when false, adds the disabled attribute.`,\n category: `Form`,\n dependentProperties: ['selectedElement'],\n properties: {\n enabled: {\n type: 'ParameterType:boolean',\n required: true,\n erased: true\n }\n },\n };\n}\n","import { type IOperationMetadata } from \"@operation/metadata/types.ts\";\nimport { type IValidateFormOperationData } from \"@operation/validate-form.ts\";\n\nexport function validateForm(): IOperationMetadata<IValidateFormOperationData> {\n return {\n description: `Validates form fields against HTML5 validation and custom rules.\n\nUses HTML5 validation API (checkValidity()) for native validation, and supports\ncustom validation rules for: required, minLength, maxLength, pattern (regex), and email format.`,\n category: `Form`,\n dependentProperties: ['selectedElement'],\n properties: {\n validationRules: {\n type: [\n { value: 'undefined' },\n { value: 'Record<string, import(\"/home/runner/work/eligius/eligius/src/operation/validate-form\").IValidationRules>' }\n ],\n erased: true\n }\n },\n outputProperties: {\n validationErrors: {\n type: 'ParameterType:object'\n },\n isValid: {\n type: [\n { value: 'undefined' },\n { value: 'false' },\n { value: 'true' }\n ]\n }\n }\n };\n}\n","import { type IOperationMetadata } from \"@operation/metadata/types.ts\";\nimport { type IWaitOperationData } from \"@operation/wait.ts\";\n\nexport function wait(): IOperationMetadata<IWaitOperationData> {\n return {\n description: `This operation waits for the specified amount of milliseconds.`,\n category: `Utility`,\n properties: {\n milliseconds: {\n type: 'ParameterType:number',\n required: true,\n erased: true\n }\n },\n };\n}\n","import { type IOperationMetadata } from \"@operation/metadata/types.ts\";\nimport { type IWhenOperationData } from \"@operation/when.ts\";\n\nexport function when(): IOperationMetadata<IWhenOperationData> {\n return {\n description: `When the given expression evaluates to false, subsequent operations will be skipped\nuntil an {@link endWhen} or {@link otherwise} operation is encountered.\n\nPractically, this means an \\`if\\` or \\`if\\`/\\`else\\` statement control flow implementation in a list of operations.\n\nThe expression is passed in as a formatted string.\nThe left and right values of the expression can be defined like this:\n\n'constant': for a constant string\n100: for a constant number\n$operationData.foo: for an operation data value\n$globaldata.foo: for a global data value\n$scope.loopIndex: for a scope value`,\n category: `Control Flow`,\n properties: {\n expression: {\n type: 'ParameterType:expression',\n required: true,\n erased: true\n }\n },\n };\n}\n","export { addClass } from \"@operation/metadata/add-class.ts\";\nexport { addControllerToElement } from \"@operation/metadata/add-controller-to-element.ts\";\nexport { addGlobalsToOperation } from \"@operation/metadata/add-globals-to-operation.ts\";\nexport { animateWithClass } from \"@operation/metadata/animate-with-class.ts\";\nexport { animate } from \"@operation/metadata/animate.ts\";\nexport { announceToScreenReader } from \"@operation/metadata/announce-to-screen-reader.ts\";\nexport { breakForEach } from \"@operation/metadata/break-for-each.ts\";\nexport { broadcastEvent } from \"@operation/metadata/broadcast-event.ts\";\nexport { calc } from \"@operation/metadata/calc.ts\";\nexport { clearElement } from \"@operation/metadata/clear-element.ts\";\nexport { clearOperationData } from \"@operation/metadata/clear-operation-data.ts\";\nexport { clearStorage } from \"@operation/metadata/clear-storage.ts\";\nexport { compareDate } from \"@operation/metadata/compare-date.ts\";\nexport { concatenateStrings } from \"@operation/metadata/concatenate-strings.ts\";\nexport { continueForEach } from \"@operation/metadata/continue-for-each.ts\";\nexport { createElement } from \"@operation/metadata/create-element.ts\";\nexport { customFunction } from \"@operation/metadata/custom-function.ts\";\nexport { endAction } from \"@operation/metadata/end-action.ts\";\nexport { endForEach } from \"@operation/metadata/end-for-each.ts\";\nexport { endWhen } from \"@operation/metadata/end-when.ts\";\nexport { extendController } from \"@operation/metadata/extend-controller.ts\";\nexport { filterArray } from \"@operation/metadata/filter-array.ts\";\nexport { findInArray } from \"@operation/metadata/find-in-array.ts\";\nexport { forEach } from \"@operation/metadata/for-each.ts\";\nexport { formatDate } from \"@operation/metadata/format-date.ts\";\nexport { formatText } from \"@operation/metadata/format-text.ts\";\nexport { getAttributesFromElement } from \"@operation/metadata/get-attributes-from-element.ts\";\nexport { getControllerFromElement } from \"@operation/metadata/get-controller-from-element.ts\";\nexport { getControllerInstance } from \"@operation/metadata/get-controller-instance.ts\";\nexport { getCurrentTime } from \"@operation/metadata/get-current-time.ts\";\nexport { getElementDimensions } from \"@operation/metadata/get-element-dimensions.ts\";\nexport { getFocusedElement } from \"@operation/metadata/get-focused-element.ts\";\nexport { getFormData } from \"@operation/metadata/get-form-data.ts\";\nexport { getImport } from \"@operation/metadata/get-import.ts\";\nexport { getQueryParams } from \"@operation/metadata/get-query-params.ts\";\nexport { getScrollPosition } from \"@operation/metadata/get-scroll-position.ts\";\nexport { getTextContent } from \"@operation/metadata/get-text-content.ts\";\nexport { httpDelete } from \"@operation/metadata/http-delete.ts\";\nexport { httpPost } from \"@operation/metadata/http-post.ts\";\nexport { httpPut } from \"@operation/metadata/http-put.ts\";\nexport { invokeObjectMethod } from \"@operation/metadata/invoke-object-method.ts\";\nexport { isElementInViewport } from \"@operation/metadata/is-element-in-viewport.ts\";\nexport { loadFromStorage } from \"@operation/metadata/load-from-storage.ts\";\nexport { loadJson } from \"@operation/metadata/load-json.ts\";\nexport { log } from \"@operation/metadata/log.ts\";\nexport { mapArray } from \"@operation/metadata/map-array.ts\";\nexport { math } from \"@operation/metadata/math.ts\";\nexport { otherwise } from \"@operation/metadata/otherwise.ts\";\nexport { removeClass } from \"@operation/metadata/remove-class.ts\";\nexport { removeControllerFromElement } from \"@operation/metadata/remove-controller-from-element.ts\";\nexport { removeElement } from \"@operation/metadata/remove-element.ts\";\nexport { removePropertiesFromOperationData } from \"@operation/metadata/remove-properties-from-operation-data.ts\";\nexport { reparentElement } from \"@operation/metadata/reparent-element.ts\";\nexport { replaceString } from \"@operation/metadata/replace-string.ts\";\nexport { replaceText } from \"@operation/metadata/replace-text.ts\";\nexport { requestAction } from \"@operation/metadata/request-action.ts\";\nexport { saveToStorage } from \"@operation/metadata/save-to-storage.ts\";\nexport { scrollToElement } from \"@operation/metadata/scroll-to-element.ts\";\nexport { scrollToPosition } from \"@operation/metadata/scroll-to-position.ts\";\nexport { selectElement } from \"@operation/metadata/select-element.ts\";\nexport { setData } from \"@operation/metadata/set-data.ts\";\nexport { setElementAttributes } from \"@operation/metadata/set-element-attributes.ts\";\nexport { setElementContent } from \"@operation/metadata/set-element-content.ts\";\nexport { setFocus } from \"@operation/metadata/set-focus.ts\";\nexport { setFormValue } from \"@operation/metadata/set-form-value.ts\";\nexport { setGlobalData } from \"@operation/metadata/set-global-data.ts\";\nexport { setOperationData } from \"@operation/metadata/set-operation-data.ts\";\nexport { setStyle } from \"@operation/metadata/set-style.ts\";\nexport { setVariable } from \"@operation/metadata/set-variable.ts\";\nexport { sortArray } from \"@operation/metadata/sort-array.ts\";\nexport { splitString } from \"@operation/metadata/split-string.ts\";\nexport { startAction } from \"@operation/metadata/start-action.ts\";\nexport { substringText } from \"@operation/metadata/substring-text.ts\";\nexport { toggleClass } from \"@operation/metadata/toggle-class.ts\";\nexport { toggleElement } from \"@operation/metadata/toggle-element.ts\";\nexport { toggleFormElement } from \"@operation/metadata/toggle-form-element.ts\";\nexport { validateForm } from \"@operation/metadata/validate-form.ts\";\nexport { wait } from \"@operation/metadata/wait.ts\";\nexport { when } from \"@operation/metadata/when.ts\";\nexport * from \"@operation/metadata/types.ts\";\n","import type {TControllerName, TOperationName} from '@configuration/types.ts';\nimport * as controllers from '@controllers/index.ts';\nimport type {EventName} from '@eventbus/events/types.ts';\nimport * as operations from '@operation/index.ts';\nimport * as operationMetadata from '@operation/metadata/index.ts';\nimport type {IOperationMetadata} from '@operation/metadata/types.ts';\n\n/**\n *\n * Provider for all the available operation names\n *\n */\nexport class OperationNamesProvider {\n getOperationNames(): TOperationName {\n return Object.keys(operations) as unknown as TOperationName;\n }\n}\n\n/**\n *\n * Provider for all the available controller names\n *\n */\nexport class ControllerNamesProvider {\n getControllerNames(): TControllerName {\n return Object.keys(controllers) as unknown as TControllerName;\n }\n}\n\n/**\n *\n * Provider that can retrieve the metadata associated with a given operation name\n *\n */\nexport class OperationMetadataProvider {\n getOperationMetadata(operationName: TOperationName) {\n const getMetadata = (\n operationMetadata as Record<\n TOperationName,\n () => IOperationMetadata<operations.TOperationData>\n >\n )[operationName];\n if (!getMetadata) {\n throw new Error(\n `Could not find metadata for operation called ${operationName}`\n );\n }\n return getMetadata();\n }\n}\n\n/**\n *\n * Provider for all the available event names\n *\n */\nexport class TimeLineEventNamesProvider {\n getEventNames() {\n return [\n 'timeline-play-toggle-request',\n 'timeline-play-request',\n 'timeline-stop-request',\n 'timeline-pause-request',\n 'timeline-seek-request',\n 'timeline-resize-request',\n 'timeline-container-request',\n 'timeline-duration-request',\n 'timeline-request-current-timeline',\n 'timeline-duration',\n 'timeline-time',\n 'timeline-seeked',\n 'timeline-complete',\n 'timeline-restart',\n 'timeline-play',\n 'timeline-stop',\n 'timeline-pause',\n 'timeline-seek',\n 'timeline-resize',\n 'timeline-current-timeline-change',\n 'timeline-firstframe',\n 'request-instance',\n 'request-action',\n 'request-function',\n 'request-timeline-uri',\n 'before-request-timeline-uri',\n 'request-engine-root',\n 'request-current-timeline-position',\n 'request-timeline-cleanup',\n 'request-label-collection',\n 'request-label-collections',\n 'request-current-language',\n 'language-change',\n 'dom-mutation',\n ] as unknown as EventName[];\n }\n}\n","import type {IStrictDuration, ISubtitle} from '../../types.ts';\n\n/**\n * This class converts an AVID subtitle file to an `ISubtitle` array.\n */\nexport class SubtitleImporter {\n importSubtitles(rawLines: string[]): ISubtitle[] {\n const result: ISubtitle[] = [];\n const lines: string[] = [];\n for (let i: number = 0, l: number = rawLines.length; i < l; i++) {\n const rawLine: string = this.stripNewlineChars(rawLines[i].toString());\n if (this.isValidLine(rawLine)) {\n lines.push(rawLine);\n }\n }\n if (lines[0] === '') {\n lines.splice(0, 1);\n }\n while (lines[lines.length - 1] === '') {\n lines.pop();\n }\n let caption: Partial<ISubtitle> | null = null;\n lines.forEach((line: string) => {\n if (line.length === 0 || !caption) {\n caption = {text: ''};\n if (line.length) {\n //this happens for first caption only\n caption.duration = this.convertDuration(line);\n }\n result.push(caption as ISubtitle);\n } else {\n if (!Object.hasOwn(caption, 'duration')) {\n caption.duration = this.convertDuration(line);\n } else {\n caption.text += line;\n }\n }\n });\n return result;\n }\n\n stripNewlineChars(str: string): string {\n let res: string = '';\n for (let i: number = 0, l: number = str.length; i < l; i++) {\n if (str.charCodeAt(i) !== 13 && str.charCodeAt(i) !== 0) {\n res += str.charAt(i);\n }\n }\n return res;\n }\n\n isValidLine(line: string): boolean {\n return (\n !line.startsWith('@') &&\n !line.startsWith('<begin subtitles>') &&\n !line.startsWith('<end subtitles>')\n );\n }\n\n convertDuration(time: string): IStrictDuration {\n const times: string[] = time.split(' ');\n return {\n start: this.convertTimeToSeconds(times[0]),\n end: this.convertTimeToSeconds(times[1]),\n };\n }\n\n convertTimeToSeconds(time: string): number {\n const parts: string[] = time.split(':');\n return (\n parseInt(parts[0], 10) * 3600 +\n parseInt(parts[1], 10) * 60 +\n parseInt(parts[2], 10)\n );\n }\n}\n","import {v4 as uuidv4} from 'uuid';\nimport type {\n IStrictDuration,\n ISubtitle,\n ISubtitleCollection,\n TLanguageCode,\n} from '../../types.ts';\n\n/**\n * Used to edit and add to an {@link ISubtitleCollection}.\n */\nexport class SubtitleEditor {\n constructor(private collection: ISubtitleCollection[] = []) {}\n\n private _getLanguage(languageCode: string) {\n return this.collection.find(x => x.languageCode === languageCode);\n }\n\n /**\n * Adds a new {@link ISubtitleCollection} for the given `languageCode`.\n *\n * If collections already exist for existing language codes then a duplicate\n * of these collections is created with the same duration info but all of the\n * text is left empty.\n *\n * @param languageCode\n * @returns\n */\n addLanguage(languageCode: TLanguageCode) {\n const language = this._getLanguage(languageCode);\n if (language) {\n throw new Error(`Language ${languageCode} already exists.`);\n }\n const newLanguage: ISubtitleCollection = this.collection.length\n ? {\n ...this.collection[0],\n languageCode,\n titles: this.collection[0].titles.map(x => ({\n id: uuidv4(),\n duration: {...x.duration},\n text: '',\n })),\n }\n : {\n languageCode,\n titles: [],\n };\n this.collection.push(newLanguage);\n return this;\n }\n\n /**\n *\n * Add a single subtitle line that is associated with the given `languageCode`\n *\n * @param languageCode\n * @param subtitle\n * @returns\n */\n addSubtitle(languageCode: TLanguageCode, subtitle: ISubtitle) {\n const language = this._getLanguage(languageCode);\n if (!language) {\n throw new Error(`Language ${languageCode} does not exist.`);\n }\n language.titles.push(subtitle);\n return this;\n }\n\n addSubtitles(\n duration: IStrictDuration,\n subtitles: Record<TLanguageCode, string>\n ) {\n Object.entries(subtitles).forEach(([languageCode, subtitle]) =>\n this.addSubtitle(languageCode as TLanguageCode, {\n id: uuidv4(),\n duration: {...duration},\n text: subtitle,\n })\n );\n return this;\n }\n\n setSubtitle(languageCode: TLanguageCode, subtitle: ISubtitle) {\n const language = this._getLanguage(languageCode);\n if (!language) {\n throw new Error(`Language ${languageCode} does not exist.`);\n }\n\n const titleIdx = language.titles.findIndex(x => x.id === subtitle.id);\n if (titleIdx < 0) {\n throw new Error(\n `Subtitle with id '${subtitle.id}' was not found in language with code ${languageCode}.`\n );\n }\n\n language.titles[titleIdx] = {\n ...subtitle,\n duration: {...subtitle.duration},\n };\n return this;\n }\n\n export() {\n return this.collection;\n }\n}\n","import {getPropertyChainValue} from '@operation/helper/get-property-chain-value.ts';\n\n/**\n * Gets the value for the given property chain. A property chain is defined by a period delimited string.\n *\n * For example, this property chain: `mySource.subSource.element.value` should be extracted from an object of this shape:\n * ```ts\n * const foo = {\n * mySource: {\n * subSource: {\n * element: {\n * value: 'bar'\n * }\n * }\n * }\n * }\n * ```\n *\n * The result of the invocation `resolvePropertyChain('mySource.subSource.element.value', foo)` would then yield the value `bar`.\n */\nexport function resolvePropertyChain(propertyChain: string, sourceObject: any) {\n const properties = propertyChain.split('.');\n return getPropertyChainValue(properties, sourceObject);\n}\n","import {Action, EndableAction, TimelineAction} from '@action/index.ts';\nimport type {IAction} from '@action/types.ts';\nimport type {\n IActionConfiguration,\n IEndableActionConfiguration,\n IEngineConfiguration,\n IEventActionConfiguration,\n IOperationConfiguration,\n IResolvedActionConfiguration,\n IResolvedEndableActionConfiguration,\n IResolvedEngineConfiguration,\n IResolvedOperation,\n IResolvedTimelineConfiguration,\n ITimelineActionConfiguration,\n ITimelineConfiguration,\n} from '@configuration/types.ts';\nimport type {ActionRegistryEventbusListener} from '@eventbus/index.ts';\nimport type {IEventbus} from '@eventbus/types.ts';\nimport {deepCopy} from '@operation/helper/deep-copy.ts';\nimport {resolvePropertyChain} from '@operation/helper/resolve-property-chain.ts';\nimport type {TOperationData} from '@operation/types.ts';\nimport {isObject} from '@util/guards/is-object.ts';\nimport {isString} from '@util/guards/is-string.ts';\nimport {isDefined} from 'ts-is-present';\nimport type {\n IConfigurationResolver,\n ISimpleResourceImporter,\n} from '../types.ts';\n\n/**\n * Takes an `IEngineConfiguration` instance and return an `IResolvedEngineConfiguration`.\n * This means all system names within the configuration will be resolved to their associated instances.\n *\n * If the given configuration includes event actions, then those will be registered in the given `ActionRegistryEventbusListener`.\n *\n */\nexport class ConfigurationResolver implements IConfigurationResolver {\n constructor(\n private importer: ISimpleResourceImporter,\n private eventbus: IEventbus\n ) {}\n\n process(\n configuration: IEngineConfiguration,\n actionRegistryListener?: ActionRegistryEventbusListener\n ): [Record<string, IAction>, IResolvedEngineConfiguration] {\n resolvePlaceholders(configuration, configuration, this.importer);\n\n if (!isDefined(configuration.timelineProviderSettings)) {\n throw new Error(\n 'Configuration incomplete: it needs to have at least one timeline provider setting'\n );\n }\n\n const resolvedConfig: IResolvedEngineConfiguration = {\n id: configuration.id,\n engine: {...configuration.engine},\n timelineProviderSettings: deepCopy(\n configuration.timelineProviderSettings\n ),\n containerSelector: configuration.containerSelector,\n cssFiles: configuration.cssFiles,\n language: configuration.language,\n layoutTemplate: configuration.layoutTemplate,\n availableLanguages: deepCopy(configuration.availableLanguages),\n actions: resolveActions(\n configuration.actions,\n this.importer,\n this.eventbus\n ),\n initActions: resolveActions(\n configuration.initActions,\n this.importer,\n this.eventbus\n ),\n labels: deepCopy(configuration.labels),\n timelineFlow: deepCopy(configuration.timelineFlow),\n timelines: resolveTimelines(\n configuration.timelines,\n this.importer,\n this.eventbus\n ),\n };\n\n let eventActions: IAction[] = [];\n if (configuration.eventActions?.length && actionRegistryListener) {\n eventActions = resolveEventActions(\n configuration.eventActions,\n actionRegistryListener,\n this.importer,\n this.eventbus\n );\n }\n\n const actionsLookup = (resolvedConfig.actions as IAction[])\n .concat(eventActions)\n .reduce<Record<string, IAction>>(\n (aggr, action) => ({\n ...aggr,\n [action.name]: action,\n }),\n {}\n );\n\n return [actionsLookup, resolvedConfig];\n }\n}\n\nfunction resolveEventActions(\n eventActionConfigurations: IEventActionConfiguration[],\n actionRegistryListener: ActionRegistryEventbusListener,\n importer: ISimpleResourceImporter,\n eventbus: IEventbus\n) {\n const resolvedConfigs =\n eventActionConfigurations.map<IResolvedActionConfiguration>(config =>\n resolveActionConfiguration(config, importer)\n );\n\n return resolvedConfigs.map((config, index) => {\n const {eventName, eventTopic} = eventActionConfigurations[index];\n const eventAction = new Action(\n config.name,\n config.startOperations,\n eventbus\n );\n actionRegistryListener.registerAction(eventAction, eventName, eventTopic);\n return eventAction;\n });\n}\n\nfunction resolveTimelines(\n timelines: ITimelineConfiguration[],\n importer: ISimpleResourceImporter,\n eventbus: IEventbus\n) {\n const resolve = resolveTimelineAction.bind(null, importer, eventbus);\n\n return timelines.map<IResolvedTimelineConfiguration>(config => ({\n ...config,\n timelineActions: config.timelineActions.map(resolve),\n }));\n}\n\nfunction resolveOperation(\n importer: ISimpleResourceImporter,\n operationConfig: IOperationConfiguration<TOperationData>\n): IResolvedOperation {\n return {\n id: operationConfig.id,\n systemName: operationConfig.systemName,\n operationData: deepCopy(operationConfig.operationData) ?? {},\n instance: importer.import(operationConfig.systemName)[\n operationConfig.systemName\n ],\n };\n}\n\nfunction resolveActionConfiguration(\n config: IActionConfiguration,\n importer: ISimpleResourceImporter\n): IResolvedActionConfiguration {\n const resolve = resolveOperation.bind(null, importer);\n\n return {\n id: config.id,\n name: config.name,\n startOperations: config.startOperations.map(resolve),\n };\n}\n\nfunction resolveEndableActionConfiguration(\n config: IEndableActionConfiguration,\n importer: ISimpleResourceImporter\n): IResolvedEndableActionConfiguration {\n const resolve = resolveOperation.bind(null, importer);\n\n const action = resolveActionConfiguration(config, importer);\n\n return {\n ...action,\n endOperations: config.endOperations.map(resolve),\n };\n}\n\nfunction resolveTimelineAction(\n importer: ISimpleResourceImporter,\n eventbus: IEventbus,\n actionConfiguration: ITimelineActionConfiguration\n) {\n const resolvedConfig = resolveEndableActionConfiguration(\n actionConfiguration,\n importer\n );\n const duration = {\n end: actionConfiguration.duration.end ?? -1,\n start: actionConfiguration.duration.start,\n };\n\n const {id, name, endOperations, startOperations} = resolvedConfig;\n const action = new TimelineAction(\n name,\n startOperations,\n endOperations,\n duration,\n eventbus\n );\n action.id = id;\n return action;\n}\n\nfunction resolveActions(\n actionConfigurations: IEndableActionConfiguration[],\n importer: ISimpleResourceImporter,\n eventbus: IEventbus\n) {\n const resolvedConfigs =\n actionConfigurations.map<IResolvedEndableActionConfiguration>(config => {\n return resolveEndableActionConfiguration(config, importer);\n });\n\n return resolvedConfigs.map<EndableAction>(resolvedConfig => {\n const {name, endOperations, startOperations} = resolvedConfig;\n const action = new EndableAction(\n name,\n startOperations,\n endOperations,\n eventbus\n );\n action.id = resolvedConfig.id;\n return action;\n });\n}\n\nfunction resolvePlaceholders(\n configFragment: Record<string, any> | any[],\n rootConfig: any,\n importer: ISimpleResourceImporter\n) {\n if (!isDefined(configFragment)) {\n return;\n }\n\n if (Array.isArray(configFragment)) {\n configFragment.forEach(item => {\n resolvePlaceholders(item, rootConfig, importer);\n });\n } else if (isObject(configFragment)) {\n Object.keys(configFragment).forEach(key => {\n resolvePlaceholder(key, configFragment, rootConfig, importer);\n });\n }\n}\n\nfunction resolvePlaceholder(\n key: PropertyKey,\n configFragment: any,\n rootConfig: any,\n importer: ISimpleResourceImporter\n) {\n const configValue = configFragment[key];\n if (isString(configValue)) {\n if (configValue.startsWith('config:')) {\n const configProperty = configValue.substring(7, configValue.length);\n configFragment[key] = resolvePropertyChain(configProperty, rootConfig);\n } else if (configValue.startsWith('template:')) {\n const templateKey = configValue.substring(9, configValue.length);\n const template = importer.import(templateKey)[templateKey];\n configFragment[key] = template;\n } else if (configValue.startsWith('json:')) {\n const jsonKey = configValue.substring(5, configValue.length);\n const json = importer.import(jsonKey)[jsonKey];\n configFragment[key] = json;\n }\n } else if (isObject(configValue) || Array.isArray(configValue)) {\n resolvePlaceholders(configValue, rootConfig, importer);\n }\n}\n","import { type IDOMEventListenerControllerOperationData } from \"@controllers/dom-event-listener-controller.ts\";\nimport { type IControllerMetadata } from \"@controllers/metadata/types.ts\";\n\nexport function DOMEventListenerController(): IControllerMetadata<IDOMEventListenerControllerOperationData> {\n return {\n description: `This controller attaches to the given selected element and adds a DOM event listener for the specified event name that\nexecutes the given actions with the given operation data.\n\nBy default the \\`start\\` operations of the specified actions are executed. To execute the \\`end\\` operations instead,\nprefix the action name with \\`end:\\`.`,\n dependentProperties: ['selectedElement'],\n properties: {\n eventName: {\n type: 'ParameterType:eventName',\n required: true,\n },\n actions: {\n type: 'ParameterType:array',\n itemType: 'ParameterType:string',\n },\n actionOperationData: {\n type: 'ParameterType:object',\n }\n },\n };\n}\n","import { type ILabelControllerMetadata } from \"@controllers/label-controller.ts\";\nimport { type IControllerMetadata } from \"@controllers/metadata/types.ts\";\n\nexport function LabelController(): IControllerMetadata<ILabelControllerMetadata> {\n return {\n description: `This controller attaches to the given selected element and renders the text associated with the given label id in it.\n\nThe controller also listen for the \\`LANGUAGE_CHANGE\\` event and re-renders the text with the new language after such an event.`,\n dependentProperties: ['selectedElement'],\n properties: {\n labelId: {\n type: 'ParameterType:labelId',\n required: true,\n },\n attributeName: {\n type: [\n { value: 'undefined' },\n { value: 'string' }\n ],\n }\n },\n };\n}\n","import { type ILottieControllerMetadata } from \"@controllers/lottie-controller.ts\";\nimport { type IControllerMetadata } from \"@controllers/metadata/types.ts\";\n\nexport function LottieController(): IControllerMetadata<ILottieControllerMetadata> {\n return {\n description: `This controller renders a [lottie-web](https://github.com/airbnb/lottie-web) animation inside the given selected element.\n\nThe url may encode freeze and end positions like this: my-url/filename[freeze=10,end=21].json`,\n properties: {\n url: {\n type: 'ParameterType:url',\n required: true,\n }\n },\n };\n}\n","import { type IControllerMetadata } from \"@controllers/metadata/types.ts\";\nimport { type IMutationObserverControllerMetadata } from \"@controllers/mutation-observer-controller.ts\";\n\nexport function MutationObserverController(): IControllerMetadata<IMutationObserverControllerMetadata> {\n return {\n description: `Controller that observes DOM mutations on a selected element and broadcasts events.\n\nThis controller creates a MutationObserver to monitor DOM changes (attributes, child nodes,\ntext content) on a specified element. All detected mutations are broadcasted through the\nEligius eventbus, enabling reactive behavior in response to DOM changes.\n\nThe controller follows the standard Eligius lifecycle:\n- init(): Store configuration metadata\n- attach(): Create and start the MutationObserver\n- detach(): Disconnect the observer and clean up resources`,\n dependentProperties: ['selectedElement'],\n properties: {\n observeAttributes: {\n type: [\n { value: 'undefined' },\n { value: 'false' },\n { value: 'true' }\n ],\n },\n observeChildList: {\n type: [\n { value: 'undefined' },\n { value: 'false' },\n { value: 'true' }\n ],\n },\n observeCharacterData: {\n type: [\n { value: 'undefined' },\n { value: 'false' },\n { value: 'true' }\n ],\n },\n observeSubtree: {\n type: [\n { value: 'undefined' },\n { value: 'false' },\n { value: 'true' }\n ],\n },\n attributeOldValue: {\n type: [\n { value: 'undefined' },\n { value: 'false' },\n { value: 'true' }\n ],\n },\n characterDataOldValue: {\n type: [\n { value: 'undefined' },\n { value: 'false' },\n { value: 'true' }\n ],\n },\n attributeFilter: {\n type: [\n { value: 'undefined' },\n { value: 'string[]' }\n ],\n }\n },\n };\n}\n","import { type IControllerMetadata } from \"@controllers/metadata/types.ts\";\nimport { type INavigationControllerOperationData } from \"@controllers/navigation-controller.ts\";\n\nexport function NavigationController(): IControllerMetadata<INavigationControllerOperationData> {\n return {\n description: ``,\n dependentProperties: ['selectedElement'],\n properties: {\n json: {\n type: 'ParameterType:object',\n required: true,\n }\n },\n };\n}\n","import { type IControllerMetadata } from \"@controllers/metadata/types.ts\";\nimport { type IProgressbarControllerOperationData } from \"@controllers/progressbar-controller.ts\";\n\nexport function ProgressbarController(): IControllerMetadata<IProgressbarControllerOperationData> {\n return {\n description: `This controller renders a progressbar that displays the progress of the current timeline in the given selected element.\n\nThe current progress as a percentage is rendered in the given text element.`,\n dependentProperties: ['selectedElement', 'textElement'],\n };\n}\n","import { type IControllerMetadata } from \"@controllers/metadata/types.ts\";\nimport { type IRoutingControllerOperationData } from \"@controllers/routing-controller.ts\";\n\nexport function RoutingController(): IControllerMetadata<IRoutingControllerOperationData> {\n return {\n description: `This is a work in progress, do not use this yet please....`,\n properties: {\n json: {\n type: 'ParameterType:object',\n required: true,\n }\n },\n };\n}\n","import { type IControllerMetadata } from \"@controllers/metadata/types.ts\";\nimport { type ISubtitlesControllerOperationData } from \"@controllers/subtitles-controller.ts\";\n\nexport function SubtitlesController(): IControllerMetadata<ISubtitlesControllerOperationData> {\n return {\n description: ``,\n dependentProperties: ['selectedElement'],\n properties: {\n language: {\n type: 'ParameterType:languagecode',\n },\n subtitleData: {\n type: 'ParameterType:array',\n }\n },\n };\n}\n","export { DOMEventListenerController } from \"@controllers/metadata/dom-event-listener-controller.ts\";\nexport { LabelController } from \"@controllers/metadata/label-controller.ts\";\nexport { LottieController } from \"@controllers/metadata/lottie-controller.ts\";\nexport { MutationObserverController } from \"@controllers/metadata/mutation-observer-controller.ts\";\nexport { NavigationController } from \"@controllers/metadata/navigation-controller.ts\";\nexport { ProgressbarController } from \"@controllers/metadata/progressbar-controller.ts\";\nexport { RoutingController } from \"@controllers/metadata/routing-controller.ts\";\nexport { SubtitlesController } from \"@controllers/metadata/subtitles-controller.ts\";\nexport * from \"@controllers/metadata/types.ts\";\n","import { type BeforeRequestTimelineUriEvent } from \"@eventbus/events/before-request-timeline-uri.ts\";\nimport { type IEventMetadata } from \"@eventbus/events/metadata/types.ts\";\n\nexport function beforeRequestTimelineUri(): IEventMetadata<BeforeRequestTimelineUriEvent['args']> {\n return {\n description: `Event: before-request-timeline-uri`,\n category: `Timeline`,\n args: []\n };\n}\n","import { type BeforeRequestVideoUrlEvent } from \"@eventbus/events/before-request-video-url.ts\";\nimport { type IEventMetadata } from \"@eventbus/events/metadata/types.ts\";\n\nexport function beforeRequestVideoUrl(): IEventMetadata<BeforeRequestVideoUrlEvent['args']> {\n return {\n description: `Event: before-request-video-url`,\n category: `Navigation`,\n args: [\n {\n name: 'index',\n type: 'number'\n },\n {\n name: 'requestedVideoPosition',\n type: 'number'\n },\n {\n name: 'isHistoryRequest',\n type: 'boolean'\n }]\n };\n}\n","import { type DomMutationEvent } from \"@eventbus/events/dom-mutation.ts\";\nimport { type IEventMetadata } from \"@eventbus/events/metadata/types.ts\";\n\nexport function domMutation(): IEventMetadata<DomMutationEvent['args']> {\n return {\n description: `Event: dom-mutation`,\n category: `Controller`,\n args: [\n {\n name: 'payload',\n type: 'any'\n }]\n };\n}\n","import { type HighlightNavigationEvent } from \"@eventbus/events/highlight-navigation.ts\";\nimport { type IEventMetadata } from \"@eventbus/events/metadata/types.ts\";\n\nexport function highlightNavigation(): IEventMetadata<HighlightNavigationEvent['args']> {\n return {\n description: `Event: highlight-navigation`,\n category: `Navigation`,\n args: [\n {\n name: 'videoUrlIndex',\n type: 'number'\n }]\n };\n}\n","import { type LanguageChangeEvent } from \"@eventbus/events/language-change.ts\";\nimport { type IEventMetadata } from \"@eventbus/events/metadata/types.ts\";\n\nexport function languageChange(): IEventMetadata<LanguageChangeEvent['args']> {\n return {\n description: `Event: language-change`,\n category: `Language Manager`,\n args: [\n {\n name: 'language',\n type: 'TLanguageCode'\n }]\n };\n}\n","import { type IEventMetadata } from \"@eventbus/events/metadata/types.ts\";\nimport { type NavigateToVideoUrlEvent } from \"@eventbus/events/navigate-to-video-url.ts\";\n\nexport function navigateToVideoUrl(): IEventMetadata<NavigateToVideoUrlEvent['args']> {\n return {\n description: `Event: navigate-to-video-url`,\n category: `Navigation`,\n args: [\n {\n name: 'index',\n type: 'number'\n },\n {\n name: 'requestedVideoPosition',\n type: 'number'\n }]\n };\n}\n","import { type IEventMetadata } from \"@eventbus/events/metadata/types.ts\";\nimport { type PushHistoryStateEvent } from \"@eventbus/events/push-history-state.ts\";\n\nexport function pushHistoryState(): IEventMetadata<PushHistoryStateEvent['args']> {\n return {\n description: `Event: push-history-state`,\n category: `Navigation`,\n args: [\n {\n name: 'state',\n type: 'any'\n }]\n };\n}\n","import { type IEventMetadata } from \"@eventbus/events/metadata/types.ts\";\nimport { type RequestActionEvent } from \"@eventbus/events/request-action.ts\";\n\nexport function requestAction(): IEventMetadata<RequestActionEvent['args']> {\n return {\n description: `Event: request-action`,\n category: `Engine Request`,\n args: [\n {\n name: 'actionName',\n type: 'string'\n },\n {\n name: 'callback',\n type: '(actionInstance: any) => void'\n }]\n };\n}\n","import { type IEventMetadata } from \"@eventbus/events/metadata/types.ts\";\nimport { type RequestCurrentLanguageEvent } from \"@eventbus/events/request-current-language.ts\";\n\nexport function requestCurrentLanguage(): IEventMetadata<RequestCurrentLanguageEvent['args']> {\n return {\n description: `Event: request-current-language`,\n category: `Engine Request`,\n args: [\n {\n name: 'callback',\n type: '(language: TLanguageCode) => void'\n }]\n };\n}\n","import { type IEventMetadata } from \"@eventbus/events/metadata/types.ts\";\nimport { type RequestCurrentNavigationEvent } from \"@eventbus/events/request-current-navigation.ts\";\n\nexport function requestCurrentNavigation(): IEventMetadata<RequestCurrentNavigationEvent['args']> {\n return {\n description: `Event: request-current-navigation`,\n category: `Navigation`,\n args: [\n {\n name: 'callback',\n type: '(navigation: any) => void'\n }]\n };\n}\n","import { type IEventMetadata } from \"@eventbus/events/metadata/types.ts\";\nimport { type RequestCurrentTimelinePositionEvent } from \"@eventbus/events/request-current-timeline-position.ts\";\n\nexport function requestCurrentTimelinePosition(): IEventMetadata<RequestCurrentTimelinePositionEvent['args']> {\n return {\n description: `Event: request-current-timeline-position`,\n category: `Engine Request`,\n args: [\n {\n name: 'callback',\n type: 'TResultCallback<number>'\n }]\n };\n}\n","import { type IEventMetadata } from \"@eventbus/events/metadata/types.ts\";\nimport { type RequestCurrentVideoPositionEvent } from \"@eventbus/events/request-current-video-position.ts\";\n\nexport function requestCurrentVideoPosition(): IEventMetadata<RequestCurrentVideoPositionEvent['args']> {\n return {\n description: `Event: request-current-video-position`,\n category: `Navigation`,\n args: [\n {\n name: 'callback',\n type: '(position: number) => void'\n }]\n };\n}\n","import { type IEventMetadata } from \"@eventbus/events/metadata/types.ts\";\nimport { type RequestEngineRootEvent } from \"@eventbus/events/request-engine-root.ts\";\n\nexport function requestEngineRoot(): IEventMetadata<RequestEngineRootEvent['args']> {\n return {\n description: `Event: request-engine-root`,\n category: `Engine Request`,\n args: [\n {\n name: 'callback',\n type: '(root: any) => void'\n }]\n };\n}\n","import { type IEventMetadata } from \"@eventbus/events/metadata/types.ts\";\nimport { type RequestFunctionEvent } from \"@eventbus/events/request-function.ts\";\n\nexport function requestFunction(): IEventMetadata<RequestFunctionEvent['args']> {\n return {\n description: `Event: request-function`,\n category: `Engine Request`,\n args: [\n {\n name: 'systemName',\n type: 'string'\n },\n {\n name: 'callback',\n type: '(fn: any) => void'\n }]\n };\n}\n","import { type IEventMetadata } from \"@eventbus/events/metadata/types.ts\";\nimport { type RequestInstanceEvent } from \"@eventbus/events/request-instance.ts\";\n\nexport function requestInstance(): IEventMetadata<RequestInstanceEvent['args']> {\n return {\n description: `Event: request-instance`,\n category: `Engine Request`,\n args: [\n {\n name: 'instanceName',\n type: 'string'\n },\n {\n name: 'callback',\n type: '(instance: any) => void'\n }]\n };\n}\n","import { type IEventMetadata } from \"@eventbus/events/metadata/types.ts\";\nimport { type RequestLabelCollectionEvent } from \"@eventbus/events/request-label-collection.ts\";\n\nexport function requestLabelCollection(): IEventMetadata<RequestLabelCollectionEvent['args']> {\n return {\n description: `Event: request-label-collection`,\n category: `Engine Request`,\n args: [\n {\n name: 'language',\n type: 'string'\n },\n {\n name: 'callback',\n type: '(collection: any) => void'\n }]\n };\n}\n","import { type IEventMetadata } from \"@eventbus/events/metadata/types.ts\";\nimport { type RequestLabelCollectionsEvent } from \"@eventbus/events/request-label-collections.ts\";\n\nexport function requestLabelCollections(): IEventMetadata<RequestLabelCollectionsEvent['args']> {\n return {\n description: `Event: request-label-collections`,\n category: `Engine Request`,\n args: [\n {\n name: 'labelIds',\n type: 'string[]'\n },\n {\n name: 'callback',\n type: '(collections: any) => void'\n }]\n };\n}\n","import { type IEventMetadata } from \"@eventbus/events/metadata/types.ts\";\nimport { type RequestTimelineCleanupEvent } from \"@eventbus/events/request-timeline-cleanup.ts\";\n\nexport function requestTimelineCleanup(): IEventMetadata<RequestTimelineCleanupEvent['args']> {\n return {\n description: `Event: request-timeline-cleanup`,\n category: `Engine Request`,\n args: []\n };\n}\n","import { type IEventMetadata } from \"@eventbus/events/metadata/types.ts\";\nimport { type RequestTimelineUriEvent } from \"@eventbus/events/request-timeline-uri.ts\";\n\nexport function requestTimelineUri(): IEventMetadata<RequestTimelineUriEvent['args']> {\n return {\n description: `Event: request-timeline-uri`,\n category: `Engine Request`,\n args: [\n {\n name: 'uri',\n type: 'string'\n },\n {\n name: 'position',\n type: 'number'\n }]\n };\n}\n","import { type IEventMetadata } from \"@eventbus/events/metadata/types.ts\";\nimport { type RequestVideoCleanupEvent } from \"@eventbus/events/request-video-cleanup.ts\";\n\nexport function requestVideoCleanup(): IEventMetadata<RequestVideoCleanupEvent['args']> {\n return {\n description: `Event: request-video-cleanup`,\n category: `Navigation`,\n args: []\n };\n}\n","import { type IEventMetadata } from \"@eventbus/events/metadata/types.ts\";\nimport { type RequestVideoUrlEvent } from \"@eventbus/events/request-video-url.ts\";\n\nexport function requestVideoUrl(): IEventMetadata<RequestVideoUrlEvent['args']> {\n return {\n description: `Event: request-video-url`,\n category: `Navigation`,\n args: [\n {\n name: 'videoUrlIndex',\n type: 'number'\n },\n {\n name: 'requestedVideoPosition',\n type: 'number'\n },\n {\n name: 'fromRouting',\n type: 'boolean'\n }]\n };\n}\n","import { type IEventMetadata } from \"@eventbus/events/metadata/types.ts\";\nimport { type CompleteEvent } from \"@eventbus/events/timeline-complete.ts\";\n\nexport function timelineComplete(): IEventMetadata<CompleteEvent['args']> {\n return {\n description: `Event: timeline-complete`,\n category: `Timeline`,\n args: []\n };\n}\n","import { type IEventMetadata } from \"@eventbus/events/metadata/types.ts\";\nimport { type ContainerRequestEvent } from \"@eventbus/events/timeline-container-request.ts\";\n\nexport function timelineContainerRequest(): IEventMetadata<ContainerRequestEvent['args']> {\n return {\n description: `Event: timeline-container-request`,\n category: `Timeline`,\n args: [\n {\n name: 'callback',\n type: '(element: HTMLElement) => void'\n }]\n };\n}\n","import { type IEventMetadata } from \"@eventbus/events/metadata/types.ts\";\nimport { type CurrentTimelineChangeEvent } from \"@eventbus/events/timeline-current-timeline-change.ts\";\n\nexport function timelineCurrentTimelineChange(): IEventMetadata<CurrentTimelineChangeEvent['args']> {\n return {\n description: `Event: timeline-current-timeline-change`,\n category: `Timeline`,\n args: [\n {\n name: 'timelineUri',\n type: 'string'\n }]\n };\n}\n","import { type IEventMetadata } from \"@eventbus/events/metadata/types.ts\";\nimport { type DurationRequestEvent } from \"@eventbus/events/timeline-duration-request.ts\";\n\nexport function timelineDurationRequest(): IEventMetadata<DurationRequestEvent['args']> {\n return {\n description: `Event: timeline-duration-request`,\n category: `Timeline`,\n args: [\n {\n name: 'callback',\n type: '(duration: number) => void'\n }]\n };\n}\n","import { type IEventMetadata } from \"@eventbus/events/metadata/types.ts\";\nimport { type DurationEvent } from \"@eventbus/events/timeline-duration.ts\";\n\nexport function timelineDuration(): IEventMetadata<DurationEvent['args']> {\n return {\n description: `Event: timeline-duration`,\n category: `Timeline`,\n args: [\n {\n name: 'getDuration',\n type: '(() => number) | undefined'\n }]\n };\n}\n","import { type IEventMetadata } from \"@eventbus/events/metadata/types.ts\";\nimport { type FirstFrameEvent } from \"@eventbus/events/timeline-firstframe.ts\";\n\nexport function timelineFirstframe(): IEventMetadata<FirstFrameEvent['args']> {\n return {\n description: `Event: timeline-firstframe`,\n category: `Timeline`,\n args: []\n };\n}\n","import { type IEventMetadata } from \"@eventbus/events/metadata/types.ts\";\nimport { type PauseRequestEvent } from \"@eventbus/events/timeline-pause-request.ts\";\n\nexport function timelinePauseRequest(): IEventMetadata<PauseRequestEvent['args']> {\n return {\n description: `Event: timeline-pause-request`,\n category: `Timeline`,\n args: []\n };\n}\n","import { type IEventMetadata } from \"@eventbus/events/metadata/types.ts\";\nimport { type PauseEvent } from \"@eventbus/events/timeline-pause.ts\";\n\nexport function timelinePause(): IEventMetadata<PauseEvent['args']> {\n return {\n description: `Event: timeline-pause`,\n category: `Timeline`,\n args: []\n };\n}\n","import { type IEventMetadata } from \"@eventbus/events/metadata/types.ts\";\nimport { type PlayRequestEvent } from \"@eventbus/events/timeline-play-request.ts\";\n\nexport function timelinePlayRequest(): IEventMetadata<PlayRequestEvent['args']> {\n return {\n description: `Event: timeline-play-request`,\n category: `Timeline`,\n args: []\n };\n}\n","import { type IEventMetadata } from \"@eventbus/events/metadata/types.ts\";\nimport { type PlayToggleRequestEvent } from \"@eventbus/events/timeline-play-toggle-request.ts\";\n\nexport function timelinePlayToggleRequest(): IEventMetadata<PlayToggleRequestEvent['args']> {\n return {\n description: `Event: timeline-play-toggle-request`,\n category: `Timeline`,\n args: []\n };\n}\n","import { type IEventMetadata } from \"@eventbus/events/metadata/types.ts\";\nimport { type PlayEvent } from \"@eventbus/events/timeline-play.ts\";\n\nexport function timelinePlay(): IEventMetadata<PlayEvent['args']> {\n return {\n description: `Event: timeline-play`,\n category: `Timeline`,\n args: []\n };\n}\n","import { type IEventMetadata } from \"@eventbus/events/metadata/types.ts\";\nimport { type RequestCurrentTimelineEvent } from \"@eventbus/events/timeline-request-current-timeline.ts\";\n\nexport function timelineRequestCurrentTimeline(): IEventMetadata<RequestCurrentTimelineEvent['args']> {\n return {\n description: `Event: timeline-request-current-timeline`,\n category: `Engine Request`,\n args: [\n {\n name: 'callback',\n type: 'TResultCallback<string>'\n }]\n };\n}\n","import { type IEventMetadata } from \"@eventbus/events/metadata/types.ts\";\nimport { type ResizeRequestEvent } from \"@eventbus/events/timeline-resize-request.ts\";\n\nexport function timelineResizeRequest(): IEventMetadata<ResizeRequestEvent['args']> {\n return {\n description: `Event: timeline-resize-request`,\n category: `Timeline`,\n args: []\n };\n}\n","import { type IEventMetadata } from \"@eventbus/events/metadata/types.ts\";\nimport { type ResizeEvent } from \"@eventbus/events/timeline-resize.ts\";\n\nexport function timelineResize(): IEventMetadata<ResizeEvent['args']> {\n return {\n description: `Event: timeline-resize`,\n category: `Timeline`,\n args: []\n };\n}\n","import { type IEventMetadata } from \"@eventbus/events/metadata/types.ts\";\nimport { type RestartEvent } from \"@eventbus/events/timeline-restart.ts\";\n\nexport function timelineRestart(): IEventMetadata<RestartEvent['args']> {\n return {\n description: `Event: timeline-restart`,\n category: `Timeline`,\n args: []\n };\n}\n","import { type IEventMetadata } from \"@eventbus/events/metadata/types.ts\";\nimport { type SeekRequestEvent } from \"@eventbus/events/timeline-seek-request.ts\";\n\nexport function timelineSeekRequest(): IEventMetadata<SeekRequestEvent['args']> {\n return {\n description: `Event: timeline-seek-request`,\n category: `Timeline`,\n args: [\n {\n name: 'position',\n type: 'number'\n }]\n };\n}\n","import { type IEventMetadata } from \"@eventbus/events/metadata/types.ts\";\nimport { type SeekEvent } from \"@eventbus/events/timeline-seek.ts\";\n\nexport function timelineSeek(): IEventMetadata<SeekEvent['args']> {\n return {\n description: `Event: timeline-seek`,\n category: `Timeline`,\n args: [\n {\n name: 'seekPosition',\n type: 'number'\n },\n {\n name: 'currentPosition',\n type: 'number'\n },\n {\n name: 'duration',\n type: 'number'\n }]\n };\n}\n","import { type IEventMetadata } from \"@eventbus/events/metadata/types.ts\";\nimport { type SeekedEvent } from \"@eventbus/events/timeline-seeked.ts\";\n\nexport function timelineSeeked(): IEventMetadata<SeekedEvent['args']> {\n return {\n description: `Event: timeline-seeked`,\n category: `Timeline`,\n args: [\n {\n name: 'position',\n type: 'number'\n },\n {\n name: 'duration',\n type: 'number'\n }]\n };\n}\n","import { type IEventMetadata } from \"@eventbus/events/metadata/types.ts\";\nimport { type StopRequestEvent } from \"@eventbus/events/timeline-stop-request.ts\";\n\nexport function timelineStopRequest(): IEventMetadata<StopRequestEvent['args']> {\n return {\n description: `Event: timeline-stop-request`,\n category: `Timeline`,\n args: []\n };\n}\n","import { type IEventMetadata } from \"@eventbus/events/metadata/types.ts\";\nimport { type StopEvent } from \"@eventbus/events/timeline-stop.ts\";\n\nexport function timelineStop(): IEventMetadata<StopEvent['args']> {\n return {\n description: `Event: timeline-stop`,\n category: `Timeline`,\n args: []\n };\n}\n","import { type IEventMetadata } from \"@eventbus/events/metadata/types.ts\";\nimport { type TimeEvent } from \"@eventbus/events/timeline-time.ts\";\n\nexport function timelineTime(): IEventMetadata<TimeEvent['args']> {\n return {\n description: `Event: timeline-time`,\n category: `Timeline`,\n args: [\n {\n name: 'position',\n type: 'number'\n }]\n };\n}\n","import { type IEventMetadata } from \"@eventbus/events/metadata/types.ts\";\nimport { type VideoCompleteEvent } from \"@eventbus/events/video-complete.ts\";\n\nexport function videoComplete(): IEventMetadata<VideoCompleteEvent['args']> {\n return {\n description: `Event: video-complete`,\n category: `Navigation`,\n args: [\n {\n name: 'index',\n type: 'number'\n }]\n };\n}\n","export { beforeRequestTimelineUri } from \"@eventbus/events/metadata/before-request-timeline-uri.ts\";\nexport { beforeRequestVideoUrl } from \"@eventbus/events/metadata/before-request-video-url.ts\";\nexport { domMutation } from \"@eventbus/events/metadata/dom-mutation.ts\";\nexport { highlightNavigation } from \"@eventbus/events/metadata/highlight-navigation.ts\";\nexport { languageChange } from \"@eventbus/events/metadata/language-change.ts\";\nexport { navigateToVideoUrl } from \"@eventbus/events/metadata/navigate-to-video-url.ts\";\nexport { pushHistoryState } from \"@eventbus/events/metadata/push-history-state.ts\";\nexport { requestAction } from \"@eventbus/events/metadata/request-action.ts\";\nexport { requestCurrentLanguage } from \"@eventbus/events/metadata/request-current-language.ts\";\nexport { requestCurrentNavigation } from \"@eventbus/events/metadata/request-current-navigation.ts\";\nexport { requestCurrentTimelinePosition } from \"@eventbus/events/metadata/request-current-timeline-position.ts\";\nexport { requestCurrentVideoPosition } from \"@eventbus/events/metadata/request-current-video-position.ts\";\nexport { requestEngineRoot } from \"@eventbus/events/metadata/request-engine-root.ts\";\nexport { requestFunction } from \"@eventbus/events/metadata/request-function.ts\";\nexport { requestInstance } from \"@eventbus/events/metadata/request-instance.ts\";\nexport { requestLabelCollection } from \"@eventbus/events/metadata/request-label-collection.ts\";\nexport { requestLabelCollections } from \"@eventbus/events/metadata/request-label-collections.ts\";\nexport { requestTimelineCleanup } from \"@eventbus/events/metadata/request-timeline-cleanup.ts\";\nexport { requestTimelineUri } from \"@eventbus/events/metadata/request-timeline-uri.ts\";\nexport { requestVideoCleanup } from \"@eventbus/events/metadata/request-video-cleanup.ts\";\nexport { requestVideoUrl } from \"@eventbus/events/metadata/request-video-url.ts\";\nexport { timelineComplete } from \"@eventbus/events/metadata/timeline-complete.ts\";\nexport { timelineContainerRequest } from \"@eventbus/events/metadata/timeline-container-request.ts\";\nexport { timelineCurrentTimelineChange } from \"@eventbus/events/metadata/timeline-current-timeline-change.ts\";\nexport { timelineDurationRequest } from \"@eventbus/events/metadata/timeline-duration-request.ts\";\nexport { timelineDuration } from \"@eventbus/events/metadata/timeline-duration.ts\";\nexport { timelineFirstframe } from \"@eventbus/events/metadata/timeline-firstframe.ts\";\nexport { timelinePauseRequest } from \"@eventbus/events/metadata/timeline-pause-request.ts\";\nexport { timelinePause } from \"@eventbus/events/metadata/timeline-pause.ts\";\nexport { timelinePlayRequest } from \"@eventbus/events/metadata/timeline-play-request.ts\";\nexport { timelinePlayToggleRequest } from \"@eventbus/events/metadata/timeline-play-toggle-request.ts\";\nexport { timelinePlay } from \"@eventbus/events/metadata/timeline-play.ts\";\nexport { timelineRequestCurrentTimeline } from \"@eventbus/events/metadata/timeline-request-current-timeline.ts\";\nexport { timelineResizeRequest } from \"@eventbus/events/metadata/timeline-resize-request.ts\";\nexport { timelineResize } from \"@eventbus/events/metadata/timeline-resize.ts\";\nexport { timelineRestart } from \"@eventbus/events/metadata/timeline-restart.ts\";\nexport { timelineSeekRequest } from \"@eventbus/events/metadata/timeline-seek-request.ts\";\nexport { timelineSeek } from \"@eventbus/events/metadata/timeline-seek.ts\";\nexport { timelineSeeked } from \"@eventbus/events/metadata/timeline-seeked.ts\";\nexport { timelineStopRequest } from \"@eventbus/events/metadata/timeline-stop-request.ts\";\nexport { timelineStop } from \"@eventbus/events/metadata/timeline-stop.ts\";\nexport { timelineTime } from \"@eventbus/events/metadata/timeline-time.ts\";\nexport { videoComplete } from \"@eventbus/events/metadata/video-complete.ts\";\nexport * from \"@eventbus/events/metadata/types.ts\";\n","import type {IAction} from '@action/types.ts';\nimport type {IEventbusListener} from '@eventbus/types.ts';\n\n/**\n * The `IEventbusListener` first registers a number of actions that are then\n * executed when the specified event is broadcast.\n */\nexport class ActionRegistryEventbusListener implements IEventbusListener {\n private _actionRegistry = new Map<string, IAction[]>();\n\n registerAction(\n action: IAction,\n eventName: string,\n eventTopic?: string\n ): void {\n if (eventTopic?.length) {\n eventName = `${eventName}:${eventTopic}`;\n }\n if (!this._actionRegistry.has(eventName)) {\n this._actionRegistry.set(eventName, []);\n }\n this._actionRegistry.get(eventName)?.push(action);\n }\n\n handleEvent(\n eventName: string,\n eventTopic: string | undefined,\n args: any[]\n ): void {\n if (eventTopic) {\n eventName = `${eventName}:${eventTopic}`;\n }\n const actions = this._actionRegistry.get(eventName);\n if (actions) {\n const operationData = {\n eventArgs: args,\n };\n actions.forEach(action => {\n action.start(operationData);\n });\n }\n }\n}\n","import type {\n IEventbus,\n IEventbusInterceptor,\n IEventbusListener,\n TEventbusRemover,\n TEventHandler,\n TRequestResponder,\n} from '@eventbus/types.ts';\n\n/**\n * Central event bus for pub/sub communication and synchronous request/response queries.\n *\n * The eventbus supports:\n * - **Pub/Sub**: `on()`, `once()`, `off()`, `broadcast()`, `broadcastForTopic()`\n * - **Request/Response**: `onRequest()`, `request()`, `requestForTopic()` for synchronous queries\n * - **Interceptors**: Transform event arguments before handlers receive them\n * - **Listeners**: Global event observers for logging/debugging\n *\n * @example Pub/Sub pattern\n * ```ts\n * const remover = eventbus.on('timeline-play', () => console.log('Playing'));\n * eventbus.broadcast('timeline-play', []);\n * remover(); // Unsubscribe\n * ```\n *\n * @example Request/Response pattern\n * ```ts\n * eventbus.onRequest('request-instance', (name) => new MyClass(name));\n * const instance = eventbus.request<MyClass>('request-instance', 'test');\n * ```\n */\nexport class Eventbus implements IEventbus {\n private eventHandlers = new Map<string, TEventHandler[]>();\n private eventInterceptors = new Map<string, IEventbusInterceptor[]>();\n private eventListeners: IEventbusListener[] = [];\n private requestResponders = new Map<string, TRequestResponder[]>();\n\n constructor() {\n this.clear();\n }\n\n /**\n * Clears all handlers, listeners, interceptors, and request responders.\n */\n clear() {\n this.eventHandlers = new Map<string, TEventHandler[]>();\n this.eventListeners = [];\n this.eventInterceptors = new Map<string, IEventbusInterceptor[]>();\n this.requestResponders = new Map<string, TRequestResponder[]>();\n }\n\n _getEventInterceptors(\n eventName: string,\n eventTopic?: string\n ): IEventbusInterceptor[] {\n if (eventTopic) {\n eventName = `${eventName}:${eventTopic}`;\n }\n if (!this.eventInterceptors.has(eventName)) {\n this.eventInterceptors.set(eventName, []);\n }\n return this.eventInterceptors.get(eventName) as IEventbusInterceptor[];\n }\n\n _getEventHandlers(eventName: string, eventTopic?: string): TEventHandler[] {\n if (eventTopic) {\n eventName = `${eventName}:${eventTopic}`;\n }\n if (!this.eventHandlers.has(eventName)) {\n this.eventHandlers.set(eventName, []);\n }\n return this.eventHandlers.get(eventName) as TEventHandler[];\n }\n\n on(\n eventName: string,\n eventHandler: TEventHandler,\n eventTopic?: string\n ): TEventbusRemover {\n this._getEventHandlers(eventName, eventTopic).push(eventHandler);\n return () => {\n this.off(eventName, eventHandler, eventTopic);\n };\n }\n\n once(\n eventName: string,\n eventHandler: TEventHandler,\n eventTopic?: string\n ): TEventbusRemover {\n const eventHandlerDecorator = (...args: any[]) => {\n eventHandler(...args);\n this.off(eventName, eventHandlerDecorator, eventTopic);\n };\n this.on(eventName, eventHandlerDecorator, eventTopic);\n return () => {\n this.off(eventName, eventHandlerDecorator, eventTopic);\n };\n }\n\n off(\n eventName: string,\n eventHandler: TEventHandler,\n eventTopic?: string\n ): void {\n const handlers = this._getEventHandlers(eventName, eventTopic);\n if (handlers) {\n const idx = handlers.indexOf(eventHandler);\n if (idx > -1) {\n handlers.splice(idx, 1);\n }\n }\n }\n\n broadcast(eventName: string, args: any[]): void {\n this._callHandlers(eventName, undefined, args);\n }\n\n broadcastForTopic(eventName: string, eventTopic: string, args: any[]): void {\n this._callHandlers(eventName, eventTopic, args);\n }\n\n registerEventlistener(eventbusListener: IEventbusListener): TEventbusRemover {\n this.eventListeners.push(eventbusListener);\n return () => {\n const index = this.eventListeners.indexOf(eventbusListener);\n if (index > -1) {\n this.eventListeners.splice(index, 1);\n }\n };\n }\n\n registerInterceptor(\n eventName: string,\n interceptor: IEventbusInterceptor,\n eventTopic?: string\n ): TEventbusRemover {\n const interceptors = this._getEventInterceptors(eventName, eventTopic);\n interceptors.push(interceptor);\n return () => {\n const index = interceptors.indexOf(interceptor);\n if (index > -1) {\n interceptors.splice(index, 1);\n }\n };\n }\n\n onRequest<T>(\n eventName: string,\n responder: TRequestResponder<T>,\n eventTopic?: string\n ): TEventbusRemover {\n const responders = this._getRequestResponders(eventName, eventTopic);\n responders.push(responder);\n return () => {\n const index = responders.indexOf(responder);\n if (index > -1) {\n responders.splice(index, 1);\n }\n };\n }\n\n request<T>(eventName: string, ...args: unknown[]): T | undefined {\n return this._callResponder<T>(eventName, undefined, args);\n }\n\n requestForTopic<T>(\n eventName: string,\n eventTopic: string,\n ...args: unknown[]\n ): T | undefined {\n return this._callResponder<T>(eventName, eventTopic, args);\n }\n\n private _getRequestResponders(\n eventName: string,\n eventTopic?: string\n ): TRequestResponder[] {\n if (eventTopic) {\n eventName = `${eventName}:${eventTopic}`;\n }\n if (!this.requestResponders.has(eventName)) {\n this.requestResponders.set(eventName, []);\n }\n return this.requestResponders.get(eventName) as TRequestResponder[];\n }\n\n private _callResponder<T>(\n eventName: string,\n eventTopic: string | undefined,\n args: unknown[]\n ): T | undefined {\n const responders = this._getRequestResponders(eventName, eventTopic);\n if (responders.length === 0) {\n return undefined;\n }\n // First responder wins\n return responders[0](...args) as T;\n }\n\n _callHandlers(\n eventName: string,\n eventTopic: string | undefined,\n args: any = []\n ): void {\n const handlers = this._getEventHandlers(eventName, eventTopic);\n\n if (handlers) {\n const interceptors = this._getEventInterceptors(eventName, eventTopic);\n\n interceptors.forEach(interceptor => {\n args = interceptor.intercept(args);\n });\n\n this.eventListeners.forEach((listener: IEventbusListener) => {\n listener.handleEvent(eventName, eventTopic, args);\n });\n\n if (args?.length) {\n handlers.forEach((handler: TEventHandler) => handler(...args));\n } else {\n handlers.forEach((handler: TEventHandler) => handler());\n }\n }\n }\n}\n","import type {IEventbus, IEventbusInterceptor} from '@eventbus/types.ts';\n\nexport class RequestVideoUriInterceptor implements IEventbusInterceptor {\n constructor(private eventbus: IEventbus) {}\n\n intercept(args: any[]): any[] {\n this.eventbus.broadcast('before-request-timeline-uri', args.slice() as any);\n return args;\n }\n}\n","export {ActionRegistryEventbusListener} from '@eventbus/actionregistry-eventbus-listener.ts';\nexport {Eventbus} from '@eventbus/eventbus.ts';\nexport * from '@eventbus/events/index.ts';\nexport type {IEventMetadata} from '@eventbus/events/metadata/types.ts';\nexport {RequestVideoUriInterceptor} from '@eventbus/request-video-uri-interceptor.ts';\nexport * from '@eventbus/types.ts';\n","/**\n * Position source state.\n * - `active`: Source is emitting position updates\n * - `suspended`: Source is paused, position preserved\n * - `inactive`: Source is stopped, position reset to initial state\n */\nexport type TSourceState = 'active' | 'suspended' | 'inactive';\n\n/**\n * Boundary type for position source events.\n * - `start`: Position reached the beginning (e.g., after reverse or loop)\n * - `end`: Position reached the end of duration\n */\nexport type TBoundary = 'start' | 'end';\n\n// ─────────────────────────────────────────────────────────────────────────────\n// IPositionSource\n// ─────────────────────────────────────────────────────────────────────────────\n\n/**\n * Core interface for timeline position sources.\n *\n * A position source provides the current position within a timeline and emits\n * position updates. The source of position can vary: elapsed time (RAF),\n * media playback (video), scroll position, mouse position, external data, etc.\n *\n * @example\n * ```typescript\n * // RAF-based position source\n * const source = new RafPositionSource(config);\n * await source.init();\n *\n * source.onPosition((position) => {\n * console.log(`Current position: ${position}`);\n * });\n *\n * source.onBoundaryReached((boundary) => {\n * if (boundary === 'end') console.log('Reached end');\n * });\n *\n * await source.activate();\n * ```\n */\nexport interface IPositionSource {\n // ───────────────────────────────────────────────────────────────────────────\n // STATE\n // ───────────────────────────────────────────────────────────────────────────\n\n /** Current state of the position source */\n readonly state: TSourceState;\n\n /**\n * Whether to loop when reaching the end boundary.\n *\n * When `true`, the source resets to position 0 and continues.\n * When `false`, the source emits `'end'` boundary and deactivates.\n *\n * For sources where looping is not applicable (e.g., mouse position),\n * this property has no effect.\n */\n loop: boolean;\n\n // ───────────────────────────────────────────────────────────────────────────\n // LIFECYCLE\n // ───────────────────────────────────────────────────────────────────────────\n\n /**\n * Initialize the position source.\n *\n * Performs any async setup required before the source can be activated.\n * For example: loading media, binding event listeners, establishing connections.\n *\n * @throws If initialization fails (e.g., media load error, connection refused)\n */\n init(): Promise<void>;\n\n /**\n * Destroy the position source and release all resources.\n *\n * After calling destroy, the source cannot be reused.\n * Removes event listeners, closes connections, clears timers.\n */\n destroy(): void;\n\n // ───────────────────────────────────────────────────────────────────────────\n // TRANSPORT\n // ───────────────────────────────────────────────────────────────────────────\n\n /**\n * Activate the position source to begin emitting position updates.\n *\n * Transitions state from `inactive` or `suspended` to `active`.\n *\n * @throws If activation fails (e.g., autoplay blocked, permission denied)\n */\n activate(): Promise<void>;\n\n /**\n * Suspend the position source, preserving current position.\n *\n * Transitions state from `active` to `suspended`.\n * Position updates stop but position is preserved for later resumption.\n */\n suspend(): void;\n\n /**\n * Deactivate the position source and reset to initial state.\n *\n * Transitions state to `inactive`.\n * Position is reset (typically to 0).\n */\n deactivate(): void;\n\n // ───────────────────────────────────────────────────────────────────────────\n // POSITION\n // ───────────────────────────────────────────────────────────────────────────\n\n /**\n * Get the current position.\n *\n * @returns Current position in seconds (or source-specific units)\n */\n getPosition(): number;\n\n /**\n * Get the total duration.\n *\n * @returns Duration in seconds (or source-specific units), or `Infinity` for unbounded sources\n */\n getDuration(): number;\n\n // ───────────────────────────────────────────────────────────────────────────\n // EVENTS\n // ───────────────────────────────────────────────────────────────────────────\n\n /**\n * Register a callback for position updates.\n *\n * Called whenever the position changes while the source is active.\n * Frequency depends on the source type (e.g., RAF tick, video timeupdate).\n *\n * @param callback - Function receiving the current position\n */\n onPosition(callback: (position: number) => void): void;\n\n /**\n * Register a callback for boundary events.\n *\n * Called when position reaches a boundary (start or end).\n * For looping sources, `'end'` is emitted before reset.\n *\n * @param callback - Function receiving the boundary type\n */\n onBoundaryReached(callback: (boundary: TBoundary) => void): void;\n\n /**\n * Register a callback for when the source becomes active.\n *\n * Called once each time the source transitions to the `active` state.\n * This is equivalent to \"first frame\" semantics - for RAF sources it's\n * the first tick, for video sources it's when playback actually starts.\n *\n * @param callback - Function called when source becomes active\n */\n onActivated(callback: () => void): void;\n}\n\n// ─────────────────────────────────────────────────────────────────────────────\n// ISeekable\n// ─────────────────────────────────────────────────────────────────────────────\n\n/**\n * Interface for position sources that support seeking to arbitrary positions.\n *\n * Not all position sources are seekable. For example:\n * - Seekable: RAF, video, scroll (programmatic), step-based\n * - Not seekable: mouse position, external WebSocket, live streams\n *\n * @example\n * ```typescript\n * if (isSeekable(source)) {\n * const actualPosition = await source.seek(30.5);\n * console.log(`Seeked to: ${actualPosition}`);\n * }\n * ```\n */\nexport interface ISeekable {\n /**\n * Seek to a specific position.\n *\n * @param position - Target position in seconds (or source-specific units)\n * @returns Actual position after seek (may differ from requested if clamped)\n */\n seek(position: number): Promise<number>;\n}\n\n/**\n * Type guard to check if a position source is seekable.\n *\n * @param source - Position source to check\n * @returns `true` if source implements ISeekable\n */\nexport function isSeekable(\n source: IPositionSource\n): source is IPositionSource & ISeekable {\n return 'seek' in source && typeof (source as ISeekable).seek === 'function';\n}\n\n// ─────────────────────────────────────────────────────────────────────────────\n// IPlaylist\n// ─────────────────────────────────────────────────────────────────────────────\n\n/**\n * Interface for managing a collection of timeline items.\n *\n * A playlist allows switching between multiple timeline configurations\n * (e.g., multiple videos, multiple animation sequences).\n *\n * @typeParam TItem - Type of playlist items (default: unknown)\n *\n * @example\n * ```typescript\n * playlist.onItemChange((item) => {\n * console.log(`Switched to: ${item.uri}`);\n * });\n *\n * playlist.selectItem('chapter-2');\n * ```\n */\nexport interface IPlaylist<TItem = unknown> {\n /** Currently active playlist item */\n readonly currentItem: TItem;\n\n /** All items in the playlist */\n readonly items: readonly TItem[];\n\n /**\n * Select a playlist item by identifier.\n *\n * @param identifier - Unique identifier for the item (e.g., URI, ID)\n * @throws If no item matches the identifier\n */\n selectItem(identifier: string): void;\n\n /**\n * Register a callback for item changes.\n *\n * Called whenever the current item changes via `selectItem()`.\n *\n * @param callback - Function receiving the new current item\n */\n onItemChange(callback: (item: TItem) => void): void;\n}\n\n// ─────────────────────────────────────────────────────────────────────────────\n// IContainerProvider\n// ─────────────────────────────────────────────────────────────────────────────\n\n/**\n * Interface for providing the DOM container where content is rendered.\n *\n * The container is where operations render their output (elements, animations, etc.).\n * For some sources (video), the container is intrinsic. For others (WebSocket),\n * the container is a separate concern configured independently.\n *\n * @example\n * ```typescript\n * containerProvider.onContainerReady(() => {\n * const $container = containerProvider.getContainer();\n * $container?.append('<div class=\"content\">Loaded!</div>');\n * });\n * ```\n */\nexport interface IContainerProvider {\n /**\n * Get the container element.\n *\n * @returns jQuery-wrapped container element, or `undefined` if not available\n */\n getContainer(): JQuery<HTMLElement> | undefined;\n\n /**\n * Register a callback for when the container is ready.\n *\n * Called once when the container becomes available and ready for content.\n * For video sources, this corresponds to the first frame.\n * For DOM containers, this is called after the element is found/created.\n *\n * @param callback - Function called when container is ready\n */\n onContainerReady(callback: () => void): void;\n}\n","import type {\n IPositionSource,\n TBoundary,\n TSourceState,\n} from '@timelineproviders/types.ts';\n\n/**\n * Abstract base class for position sources.\n *\n * Provides shared state management, lifecycle handling, and callback\n * registration for concrete position source implementations.\n *\n * Subclasses must implement:\n * - `doInit()` - Source-specific initialization\n * - `doDestroy()` - Source-specific cleanup\n * - `startTicking()` - Start emitting position updates\n * - `stopTicking()` - Stop emitting position updates\n *\n * @example\n * ```typescript\n * class MyPositionSource extends BasePositionSource {\n * protected doInit(): Promise<void> {\n * // Initialize resources\n * return Promise.resolve();\n * }\n *\n * protected doDestroy(): void {\n * // Clean up resources\n * }\n *\n * protected startTicking(): void {\n * // Start position updates\n * }\n *\n * protected stopTicking(): void {\n * // Stop position updates\n * }\n * }\n * ```\n */\nexport abstract class BasePositionSource implements IPositionSource {\n // ─────────────────────────────────────────────────────────────────────────\n // State\n // ─────────────────────────────────────────────────────────────────────────\n\n private _state: TSourceState = 'inactive';\n private _position = 0;\n private readonly _duration: number;\n private _loop = false;\n\n // ─────────────────────────────────────────────────────────────────────────\n // Callbacks\n // ─────────────────────────────────────────────────────────────────────────\n\n private readonly _positionCallbacks: Array<(position: number) => void> = [];\n private readonly _boundaryCallbacks: Array<(boundary: TBoundary) => void> =\n [];\n private readonly _activatedCallbacks: Array<() => void> = [];\n\n // ─────────────────────────────────────────────────────────────────────────\n // Constructor\n // ─────────────────────────────────────────────────────────────────────────\n\n /**\n * Create a new position source.\n *\n * @param duration - Total duration in seconds (or `Infinity` for unbounded)\n */\n constructor(duration: number) {\n this._duration = duration;\n }\n\n // ─────────────────────────────────────────────────────────────────────────\n // IPositionSource - State\n // ─────────────────────────────────────────────────────────────────────────\n\n get state(): TSourceState {\n return this._state;\n }\n\n get loop(): boolean {\n return this._loop;\n }\n\n set loop(value: boolean) {\n this._loop = value;\n }\n\n // ─────────────────────────────────────────────────────────────────────────\n // IPositionSource - Lifecycle\n // ─────────────────────────────────────────────────────────────────────────\n\n async init(): Promise<void> {\n await this.doInit();\n }\n\n destroy(): void {\n if (this._state === 'active') {\n this.stopTicking();\n }\n this._state = 'inactive';\n this._position = 0;\n this.doDestroy();\n }\n\n // ─────────────────────────────────────────────────────────────────────────\n // IPositionSource - Transport\n // ─────────────────────────────────────────────────────────────────────────\n\n async activate(): Promise<void> {\n if (this._state === 'active') {\n // Already active, no-op\n return;\n }\n\n this._state = 'active';\n this.startTicking();\n\n // Emit activated callbacks (first frame semantics)\n for (const callback of this._activatedCallbacks) {\n callback();\n }\n }\n\n suspend(): void {\n if (this._state !== 'active') {\n // Can only suspend from active state\n return;\n }\n\n this._state = 'suspended';\n this.stopTicking();\n // Position is preserved\n }\n\n deactivate(): void {\n if (this._state === 'inactive') {\n // Already inactive, no-op\n return;\n }\n\n if (this._state === 'active') {\n this.stopTicking();\n }\n\n this._state = 'inactive';\n this._position = 0;\n }\n\n // ─────────────────────────────────────────────────────────────────────────\n // IPositionSource - Position\n // ─────────────────────────────────────────────────────────────────────────\n\n getPosition(): number {\n return this._position;\n }\n\n getDuration(): number {\n return this._duration;\n }\n\n // ─────────────────────────────────────────────────────────────────────────\n // IPositionSource - Events\n // ─────────────────────────────────────────────────────────────────────────\n\n onPosition(callback: (position: number) => void): void {\n this._positionCallbacks.push(callback);\n }\n\n onBoundaryReached(callback: (boundary: TBoundary) => void): void {\n this._boundaryCallbacks.push(callback);\n }\n\n onActivated(callback: () => void): void {\n this._activatedCallbacks.push(callback);\n }\n\n // ─────────────────────────────────────────────────────────────────────────\n // Protected - For Subclasses\n // ─────────────────────────────────────────────────────────────────────────\n\n /**\n * Set the current position and emit to callbacks.\n *\n * Only emits if the source is active.\n *\n * @param position - New position value\n */\n protected setPosition(position: number): void {\n this._position = position;\n if (this._state === 'active') {\n for (const callback of this._positionCallbacks) {\n callback(position);\n }\n }\n }\n\n /**\n * Emit a boundary event to all registered callbacks.\n *\n * @param boundary - The boundary type ('start' or 'end')\n */\n protected emitBoundary(boundary: TBoundary): void {\n for (const callback of this._boundaryCallbacks) {\n callback(boundary);\n }\n }\n\n // ─────────────────────────────────────────────────────────────────────────\n // Abstract - Must Implement\n // ─────────────────────────────────────────────────────────────────────────\n\n /**\n * Perform source-specific initialization.\n *\n * Called by `init()`. Override to load resources, bind listeners, etc.\n */\n protected abstract doInit(): Promise<void>;\n\n /**\n * Perform source-specific cleanup.\n *\n * Called by `destroy()`. Override to release resources, unbind listeners, etc.\n */\n protected abstract doDestroy(): void;\n\n /**\n * Start emitting position updates.\n *\n * Called when transitioning to `active` state.\n * Override to start timers, begin listening to events, etc.\n */\n protected abstract startTicking(): void;\n\n /**\n * Stop emitting position updates.\n *\n * Called when transitioning from `active` to `suspended` or `inactive`.\n * Override to stop timers, pause listening, etc.\n */\n protected abstract stopTicking(): void;\n}\n","// https://gist.github.com/jakearchibald/cb03f15670817001b1157e62a076fe95\nexport function animationInterval(\n ms: number,\n signal: AbortSignal,\n callback: (time: number) => void\n) {\n // Prefer currentTime, as it'll better sync animations queued in the\n // same frame, but if it isn't supported, performance.now() is fine.\n const currentTime = document?.timeline?.currentTime;\n const start = currentTime ? Number(currentTime) : performance.now();\n\n const frame = (time: number) => {\n if (signal.aborted) return;\n callback(time);\n scheduleFrame(time);\n };\n\n const {round} = Math;\n const scheduleFrame = (time: number) => {\n const elapsed = time - start;\n const roundedElapsed = round(elapsed / ms) * ms;\n const targetNext = start + roundedElapsed + ms;\n const delay = targetNext - performance.now();\n setTimeout(() => requestAnimationFrame(frame), delay);\n };\n\n scheduleFrame(start);\n}\n","import {BasePositionSource} from '@timelineproviders/position-sources/base-position-source.ts';\nimport type {ISeekable} from '@timelineproviders/types.ts';\nimport {animationInterval} from '@util/animation-interval.ts';\n\n/**\n * Configuration for RafPositionSource.\n */\nexport interface RafPositionSourceConfig {\n /**\n * Total duration in seconds.\n */\n duration: number;\n\n /**\n * Interval between position ticks in milliseconds.\n * @default 1000 (1 second)\n */\n tickInterval?: number;\n}\n\n/**\n * RequestAnimationFrame-based position source.\n *\n * Uses the `animationInterval` utility to emit position updates at a regular\n * interval (default: 1 second). Position increments by 1 per second, making\n * position values equivalent to elapsed seconds.\n *\n * Implements both `IPositionSource` (via `BasePositionSource`) and `ISeekable`.\n *\n * @example\n * ```typescript\n * const source = new RafPositionSource({ duration: 60 });\n * await source.init();\n *\n * source.onPosition((position) => {\n * console.log(`Position: ${position}s`);\n * });\n *\n * source.onBoundaryReached((boundary) => {\n * if (boundary === 'end') {\n * console.log('Timeline complete');\n * }\n * });\n *\n * await source.activate();\n *\n * // Seek to 30 seconds\n * await source.seek(30);\n * ```\n */\nexport class RafPositionSource extends BasePositionSource implements ISeekable {\n // ─────────────────────────────────────────────────────────────────────────\n // State\n // ─────────────────────────────────────────────────────────────────────────\n\n private readonly _tickInterval: number;\n private _abortController: AbortController | null = null;\n private _startTimeOffset = 0;\n\n // ─────────────────────────────────────────────────────────────────────────\n // Constructor\n // ─────────────────────────────────────────────────────────────────────────\n\n /**\n * Create a new RAF-based position source.\n *\n * @param config - Configuration options\n */\n constructor(config: RafPositionSourceConfig) {\n super(config.duration);\n this._tickInterval = config.tickInterval ?? 1000;\n }\n\n // ─────────────────────────────────────────────────────────────────────────\n // BasePositionSource Implementation\n // ─────────────────────────────────────────────────────────────────────────\n\n protected doInit(): Promise<void> {\n // RAF-based source requires no async initialization\n return Promise.resolve();\n }\n\n protected doDestroy(): void {\n this._abortTicking();\n }\n\n protected startTicking(): void {\n // Emit initial position immediately\n this.setPosition(this.getPosition());\n\n // Create new abort controller for this ticking session\n this._abortController = new AbortController();\n\n // Start the animation interval\n animationInterval(\n this._tickInterval,\n this._abortController.signal,\n this._onTick.bind(this)\n );\n }\n\n protected stopTicking(): void {\n this._abortTicking();\n }\n\n // ─────────────────────────────────────────────────────────────────────────\n // ISeekable Implementation\n // ─────────────────────────────────────────────────────────────────────────\n\n /**\n * Seek to a specific position.\n *\n * Position is clamped to the valid range [0, duration].\n *\n * @param position - Target position in seconds\n * @returns Actual position after seek (may be clamped)\n */\n async seek(position: number): Promise<number> {\n // Clamp position to valid range\n const clampedPosition = Math.max(0, Math.min(position, this.getDuration()));\n\n // Update position (setPosition will emit callback if active)\n this.setPosition(clampedPosition);\n\n return clampedPosition;\n }\n\n // ─────────────────────────────────────────────────────────────────────────\n // Private Methods\n // ─────────────────────────────────────────────────────────────────────────\n\n /**\n * Handle a tick from animationInterval.\n *\n * The time parameter represents elapsed milliseconds since the animation\n * interval started. Position is calculated in seconds, rounded to the\n * precision determined by tickInterval.\n *\n * @param time - Elapsed time in milliseconds from animationInterval\n */\n private _onTick(time: number): void {\n // Skip if not active (safety check)\n if (this.state !== 'active') {\n return;\n }\n\n // Calculate new position based on elapsed time since start/reset\n // First, floor to the nearest tick boundary in milliseconds\n // Then convert to seconds for the position value\n const elapsedSinceStart = time - this._startTimeOffset;\n const ticksElapsed = Math.floor(elapsedSinceStart / this._tickInterval);\n const newPosition = (ticksElapsed * this._tickInterval) / 1000;\n const duration = this.getDuration();\n\n // Check if we've reached or exceeded the end\n if (newPosition >= duration) {\n // Emit end boundary\n this.emitBoundary('end');\n\n if (this.loop) {\n // Update offset to current time for next loop iteration\n this._startTimeOffset = time;\n // Reset to start and emit start boundary\n this.setPosition(0);\n this.emitBoundary('start');\n } else {\n // Set position to duration and deactivate\n this.setPosition(duration);\n this.deactivate();\n }\n } else {\n // Normal position update\n this.setPosition(newPosition);\n }\n }\n\n /**\n * Abort the current ticking session.\n */\n private _abortTicking(): void {\n if (this._abortController) {\n this._abortController.abort();\n this._abortController = null;\n }\n }\n}\n","import {BasePositionSource} from '@timelineproviders/position-sources/base-position-source.ts';\nimport type {ISeekable} from '@timelineproviders/types.ts';\nimport $ from 'jquery';\n\n/**\n * Configuration for ScrollPositionSource.\n */\nexport interface ScrollPositionSourceConfig {\n /**\n * CSS selector for the scrollable container element.\n */\n selector: string;\n\n /**\n * Duration in seconds that the scroll represents.\n * Position is calculated as: (scrollTop / scrollableHeight) * duration\n */\n duration: number;\n}\n\n/**\n * Scroll-based position source.\n *\n * Maps scroll position to a timeline position. The position is calculated\n * as a percentage of the scroll progress multiplied by the configured duration.\n *\n * Implements `IPositionSource` and `ISeekable`.\n *\n * @example\n * ```typescript\n * const source = new ScrollPositionSource({\n * selector: '#scroll-container',\n * duration: 100, // 100 seconds timeline\n * });\n *\n * await source.init();\n *\n * source.onPosition((position) => {\n * console.log(`Scroll at ${position}s of 100s`);\n * });\n *\n * source.onBoundaryReached((boundary) => {\n * if (boundary === 'end') {\n * console.log('Scrolled to bottom');\n * }\n * });\n *\n * await source.activate();\n * ```\n */\nexport class ScrollPositionSource\n extends BasePositionSource\n implements ISeekable\n{\n // ─────────────────────────────────────────────────────────────────────────\n // State\n // ─────────────────────────────────────────────────────────────────────────\n\n private readonly _config: ScrollPositionSourceConfig;\n private _element: HTMLElement | null = null;\n private _boundScrollHandler: ((event: Event) => void) | null = null;\n private _lastPosition = 0;\n private _wasAtStart = true;\n\n // ─────────────────────────────────────────────────────────────────────────\n // Constructor\n // ─────────────────────────────────────────────────────────────────────────\n\n /**\n * Create a new scroll-based position source.\n *\n * @param config - Configuration options\n */\n constructor(config: ScrollPositionSourceConfig) {\n super(config.duration);\n this._config = config;\n }\n\n // ─────────────────────────────────────────────────────────────────────────\n // BasePositionSource Implementation\n // ─────────────────────────────────────────────────────────────────────────\n\n protected doInit(): Promise<void> {\n return new Promise<void>((resolve, reject) => {\n const $element = $(this._config.selector);\n\n if ($element.length === 0) {\n reject(new Error(`Element not found: ${this._config.selector}`));\n return;\n }\n\n this._element = $element.get(0) as HTMLElement;\n resolve();\n });\n }\n\n protected doDestroy(): void {\n if (this._element && this._boundScrollHandler) {\n this._element.removeEventListener('scroll', this._boundScrollHandler, {\n passive: true,\n } as EventListenerOptions);\n this._boundScrollHandler = null;\n }\n this._element = null;\n }\n\n protected startTicking(): void {\n if (!this._element) {\n return;\n }\n\n this._boundScrollHandler = this._handleScroll.bind(this);\n this._element.addEventListener('scroll', this._boundScrollHandler, {\n passive: true,\n });\n }\n\n protected stopTicking(): void {\n if (this._element && this._boundScrollHandler) {\n this._element.removeEventListener('scroll', this._boundScrollHandler, {\n passive: true,\n } as EventListenerOptions);\n this._boundScrollHandler = null;\n }\n }\n\n // ─────────────────────────────────────────────────────────────────────────\n // ISeekable Implementation\n // ─────────────────────────────────────────────────────────────────────────\n\n /**\n * Seek to a specific position by programmatically scrolling.\n *\n * @param position - Target position in seconds (0 to duration)\n * @returns Actual position after scroll\n */\n async seek(position: number): Promise<number> {\n if (!this._element || this.state === 'inactive') {\n return this.getPosition();\n }\n\n const scrollableHeight = this._getScrollableHeight();\n const targetScrollTop =\n (position / this._config.duration) * scrollableHeight;\n\n this._element.scrollTo({\n top: targetScrollTop,\n behavior: 'smooth',\n });\n\n // Return the calculated position (actual may differ slightly due to smooth scrolling)\n return position;\n }\n\n // ─────────────────────────────────────────────────────────────────────────\n // Private Methods\n // ─────────────────────────────────────────────────────────────────────────\n\n /**\n * Handle scroll events and update position.\n */\n private _handleScroll(_event: Event): void {\n if (this.state !== 'active' || !this._element) {\n return;\n }\n\n const position = this._calculatePosition();\n const duration = this._config.duration;\n\n // Store last position for boundary detection\n const previousPosition = this._lastPosition;\n this._lastPosition = position;\n\n // Update position\n this.setPosition(position);\n\n // Check for end boundary\n if (position >= duration && previousPosition < duration) {\n this.emitBoundary('end');\n\n if (this.loop) {\n // Reset to start\n this._element.scrollTo({\n top: 0,\n behavior: 'smooth',\n });\n }\n }\n\n // Check for start boundary (only if we were not already at start)\n if (position === 0 && previousPosition > 0 && !this._wasAtStart) {\n this.emitBoundary('start');\n }\n\n this._wasAtStart = position === 0;\n }\n\n /**\n * Calculate position from scroll percentage.\n */\n private _calculatePosition(): number {\n if (!this._element) {\n return 0;\n }\n\n const scrollTop = this._element.scrollTop;\n const scrollableHeight = this._getScrollableHeight();\n\n if (scrollableHeight <= 0) {\n return 0;\n }\n\n const scrollPercentage = scrollTop / scrollableHeight;\n return scrollPercentage * this._config.duration;\n }\n\n /**\n * Get the scrollable height (total scroll distance).\n */\n private _getScrollableHeight(): number {\n if (!this._element) {\n return 0;\n }\n\n return this._element.scrollHeight - this._element.clientHeight;\n }\n}\n","import {BasePositionSource} from '@timelineproviders/position-sources/base-position-source.ts';\nimport type {IContainerProvider, ISeekable} from '@timelineproviders/types.ts';\nimport $ from 'jquery';\nimport vjs from 'video.js';\n\nconst videojs = vjs.default ?? vjs;\n\n/**\n * Video source configuration for VideoPositionSource.\n */\nexport interface VideoSource {\n /**\n * URL of the video file.\n */\n src: string;\n\n /**\n * MIME type of the video (e.g., 'video/mp4').\n */\n type: string;\n}\n\n/**\n * Configuration for VideoPositionSource.\n */\nexport interface VideoPositionSourceConfig {\n /**\n * CSS selector for the container where the video player will be created.\n */\n selector: string;\n\n /**\n * Video sources to load.\n */\n sources: VideoSource[];\n\n /**\n * Optional video.js player options.\n */\n options?: Record<string, unknown>;\n}\n\n/**\n * Video.js-based position source.\n *\n * Wraps a video.js player to provide position updates based on video playback.\n * Implements `IPositionSource`, `ISeekable`, and `IContainerProvider`.\n *\n * @example\n * ```typescript\n * const source = new VideoPositionSource({\n * selector: '#video-container',\n * sources: [\n * { src: 'video.mp4', type: 'video/mp4' },\n * { src: 'video.webm', type: 'video/webm' },\n * ],\n * });\n *\n * await source.init();\n *\n * source.onPosition((position) => {\n * console.log(`Video at ${position}s`);\n * });\n *\n * source.onContainerReady(() => {\n * console.log('Video ready for display');\n * });\n *\n * await source.activate();\n * ```\n */\nexport class VideoPositionSource\n extends BasePositionSource\n implements ISeekable, IContainerProvider\n{\n // ─────────────────────────────────────────────────────────────────────────\n // State\n // ─────────────────────────────────────────────────────────────────────────\n\n private readonly _config: VideoPositionSourceConfig;\n private _player: ReturnType<typeof videojs> | null = null;\n private _videoElementId: string;\n private readonly _containerReadyCallbacks: Array<() => void> = [];\n private readonly _eventHandlers: Array<() => void> = [];\n\n // ─────────────────────────────────────────────────────────────────────────\n // Constructor\n // ─────────────────────────────────────────────────────────────────────────\n\n /**\n * Create a new video.js-based position source.\n *\n * @param config - Configuration options\n */\n constructor(config: VideoPositionSourceConfig) {\n // Duration starts at 0 and will be updated from video\n super(0);\n this._config = config;\n this._videoElementId = `video-${crypto.randomUUID?.() ?? Math.random().toString(36).slice(2)}`;\n }\n\n // ─────────────────────────────────────────────────────────────────────────\n // BasePositionSource Implementation\n // ─────────────────────────────────────────────────────────────────────────\n\n protected doInit(): Promise<void> {\n return new Promise<void>(resolve => {\n // Create video element in container\n this._createVideoElement();\n\n // Initialize video.js player\n setTimeout(() => {\n this._player = videojs(\n this._videoElementId,\n {\n controls: false,\n controlBar: false,\n liveui: false,\n autoplay: false,\n preload: 'auto',\n loop: this.loop,\n sources: this._config.sources,\n ...this._config.options,\n },\n () => {\n // Player ready callback\n if (this._player) {\n // Register event handlers\n this._addPlayerListener(\n 'timeupdate',\n this._handleTimeUpdate.bind(this)\n );\n this._addPlayerListener('ended', this._handleEnded.bind(this));\n\n // Register one-time handlers\n this._player.one('firstplay', () => {\n this._notifyContainerReady();\n });\n\n this._player.one('canplay', () => {\n resolve();\n });\n\n this._player.load();\n }\n }\n );\n }, 0);\n });\n }\n\n protected doDestroy(): void {\n // Remove all event listeners\n for (const removeHandler of this._eventHandlers) {\n removeHandler();\n }\n this._eventHandlers.length = 0;\n\n // Dispose of player\n if (this._player) {\n this._player.dispose?.();\n this._player = null;\n }\n\n // Remove video element\n $(`#${this._videoElementId}`).remove();\n }\n\n protected startTicking(): void {\n // Video.js handles ticking via timeupdate event\n // Just start playback\n this._player?.play();\n }\n\n protected stopTicking(): void {\n // Pause the video\n this._player?.pause();\n }\n\n // ─────────────────────────────────────────────────────────────────────────\n // ISeekable Implementation\n // ─────────────────────────────────────────────────────────────────────────\n\n /**\n * Seek to a specific position in the video.\n *\n * @param position - Target position in seconds\n * @returns Actual position after seek\n */\n async seek(position: number): Promise<number> {\n if (!this._player) {\n return this.getPosition();\n }\n\n return new Promise<number>(resolve => {\n this._player!.one('seeked', () => {\n const actualPosition = this._player?.currentTime() ?? 0;\n this.setPosition(actualPosition);\n resolve(actualPosition);\n });\n\n this._player!.currentTime(position);\n });\n }\n\n // ─────────────────────────────────────────────────────────────────────────\n // IContainerProvider Implementation\n // ─────────────────────────────────────────────────────────────────────────\n\n /**\n * Get the container element.\n *\n * @returns jQuery-wrapped container element\n */\n getContainer(): JQuery<HTMLElement> | undefined {\n return $(this._config.selector);\n }\n\n /**\n * Register a callback for when the container is ready.\n *\n * @param callback - Function called when container is ready\n */\n onContainerReady(callback: () => void): void {\n this._containerReadyCallbacks.push(callback);\n }\n\n // ─────────────────────────────────────────────────────────────────────────\n // Overrides\n // ─────────────────────────────────────────────────────────────────────────\n\n /**\n * Get the video duration.\n *\n * @returns Duration in seconds from video.js player\n */\n override getDuration(): number {\n return this._player?.duration() ?? 0;\n }\n\n /**\n * Deactivate the source and reset position.\n *\n * Overrides base to also reset video currentTime.\n */\n override deactivate(): void {\n if (this.state === 'inactive') {\n return;\n }\n\n if (this.state === 'active') {\n this.stopTicking();\n }\n\n // Reset video position\n this._player?.currentTime(0);\n\n // Call base class deactivate to update state\n super.deactivate();\n }\n\n // ─────────────────────────────────────────────────────────────────────────\n // Private Methods\n // ─────────────────────────────────────────────────────────────────────────\n\n /**\n * Create the video element in the container.\n */\n private _createVideoElement(): void {\n const $container = $(this._config.selector);\n const videoHtml = `<video id=\"${this._videoElementId}\" class=\"video-js\"></video>`;\n $container.append(videoHtml);\n }\n\n /**\n * Add an event listener to the player and track for cleanup.\n *\n * @param event - Event name\n * @param handler - Event handler\n */\n private _addPlayerListener(\n event: string,\n handler: (...args: unknown[]) => void\n ): void {\n if (this._player) {\n this._player.on(event, handler);\n this._eventHandlers.push(() => {\n this._player?.off(event, handler);\n });\n }\n }\n\n /**\n * Handle timeupdate event from video.js.\n */\n private _handleTimeUpdate(): void {\n if (this.state !== 'active' || !this._player) {\n return;\n }\n\n const currentTime = this._player.currentTime();\n if (currentTime !== undefined) {\n this.setPosition(currentTime);\n }\n }\n\n /**\n * Handle ended event from video.js.\n */\n private _handleEnded(): void {\n if (this.state !== 'active') {\n return;\n }\n\n // Emit end boundary\n this.emitBoundary('end');\n\n if (this.loop) {\n // Reset position and emit start boundary\n this._player?.currentTime(0);\n this.setPosition(0);\n this.emitBoundary('start');\n\n // Continue playing\n this._player?.play();\n } else {\n // Deactivate\n this.deactivate();\n }\n }\n\n /**\n * Notify all container ready callbacks.\n */\n private _notifyContainerReady(): void {\n for (const callback of this._containerReadyCallbacks) {\n callback();\n }\n }\n}\n","import type {IContainerProvider} from '@timelineproviders/types.ts';\nimport $ from 'jquery';\n\n/**\n * Configuration for DomContainerProvider.\n */\nexport interface DomContainerProviderConfig {\n /**\n * CSS selector for the container element.\n */\n selector: string;\n}\n\n/**\n * DOM selector-based container provider.\n *\n * Provides access to a DOM container element via a CSS selector.\n * Implements `IContainerProvider` for use with position sources that\n * don't have an intrinsic container (e.g., RAF-based sources, WebSocket sources).\n *\n * @example\n * ```typescript\n * const containerProvider = new DomContainerProvider({\n * selector: '#timeline-container',\n * });\n *\n * containerProvider.onContainerReady(() => {\n * const $container = containerProvider.getContainer();\n * $container?.append('<div class=\"content\">Ready!</div>');\n * });\n *\n * await containerProvider.init();\n * ```\n */\nexport class DomContainerProvider implements IContainerProvider {\n // ─────────────────────────────────────────────────────────────────────────\n // State\n // ─────────────────────────────────────────────────────────────────────────\n\n private readonly _config: DomContainerProviderConfig;\n private _container: JQuery<HTMLElement> | undefined;\n private _isReady = false;\n private _isDestroyed = false;\n private readonly _readyCallbacks: Array<() => void> = [];\n\n // ─────────────────────────────────────────────────────────────────────────\n // Constructor\n // ─────────────────────────────────────────────────────────────────────────\n\n /**\n * Create a new DOM container provider.\n *\n * @param config - Configuration options\n */\n constructor(config: DomContainerProviderConfig) {\n this._config = config;\n }\n\n // ─────────────────────────────────────────────────────────────────────────\n // Lifecycle\n // ─────────────────────────────────────────────────────────────────────────\n\n /**\n * Initialize the container provider.\n *\n * Looks up the container element using the configured selector.\n *\n * @throws Error if the element is not found\n */\n async init(): Promise<void> {\n if (this._isReady) {\n return;\n }\n\n const $element = $(this._config.selector);\n\n if ($element.length === 0) {\n throw new Error(`Container element not found: ${this._config.selector}`);\n }\n\n this._container = $element;\n this._isReady = true;\n\n // Notify all ready callbacks\n this._notifyReady();\n }\n\n /**\n * Destroy the container provider and release resources.\n */\n destroy(): void {\n this._container = undefined;\n this._isReady = false;\n this._isDestroyed = true;\n this._readyCallbacks.length = 0;\n }\n\n // ─────────────────────────────────────────────────────────────────────────\n // IContainerProvider Implementation\n // ─────────────────────────────────────────────────────────────────────────\n\n /**\n * Get the container element.\n *\n * @returns jQuery-wrapped container element, or `undefined` if not initialized\n */\n getContainer(): JQuery<HTMLElement> | undefined {\n return this._container;\n }\n\n /**\n * Register a callback for when the container is ready.\n *\n * If the container is already ready, the callback is invoked immediately.\n *\n * @param callback - Function called when container is ready\n */\n onContainerReady(callback: () => void): void {\n if (this._isDestroyed) {\n return;\n }\n\n if (this._isReady) {\n callback();\n } else {\n this._readyCallbacks.push(callback);\n }\n }\n\n // ─────────────────────────────────────────────────────────────────────────\n // Private Methods\n // ─────────────────────────────────────────────────────────────────────────\n\n /**\n * Notify all registered ready callbacks.\n */\n private _notifyReady(): void {\n for (const callback of this._readyCallbacks) {\n callback();\n }\n }\n}\n","import type {IPlaylist} from '@timelineproviders/types.ts';\n\n/**\n * Configuration for SimplePlaylist.\n *\n * @typeParam TItem - Type of playlist items\n */\nexport interface SimplePlaylistConfig<TItem> {\n /**\n * Array of items in the playlist.\n * Must contain at least one item.\n */\n items: TItem[];\n\n /**\n * Key of the item to use as identifier for `selectItem()`.\n * The value at this key is coerced to a string for comparison.\n */\n identifierKey: keyof TItem;\n}\n\n/**\n * Simple playlist implementation.\n *\n * Manages a collection of timeline items and allows switching between them.\n * Implements `IPlaylist<TItem>` for use with timeline providers that\n * support multiple content sources.\n *\n * @typeParam TItem - Type of playlist items\n *\n * @example\n * ```typescript\n * interface VideoItem {\n * id: string;\n * uri: string;\n * title: string;\n * }\n *\n * const playlist = new SimplePlaylist<VideoItem>({\n * items: [\n * { id: 'intro', uri: '/videos/intro.mp4', title: 'Introduction' },\n * { id: 'ch1', uri: '/videos/chapter-1.mp4', title: 'Chapter 1' },\n * ],\n * identifierKey: 'id',\n * });\n *\n * playlist.onItemChange((item) => {\n * console.log(`Now playing: ${item.title}`);\n * });\n *\n * playlist.selectItem('ch1');\n * ```\n */\nexport class SimplePlaylist<TItem = unknown> implements IPlaylist<TItem> {\n // ─────────────────────────────────────────────────────────────────────────\n // State\n // ─────────────────────────────────────────────────────────────────────────\n\n private readonly _items: readonly TItem[];\n private readonly _identifierKey: keyof TItem;\n private _currentIndex = 0;\n private readonly _changeCallbacks: Array<(item: TItem) => void> = [];\n\n // ─────────────────────────────────────────────────────────────────────────\n // Constructor\n // ─────────────────────────────────────────────────────────────────────────\n\n /**\n * Create a new simple playlist.\n *\n * @param config - Configuration options\n * @throws Error if items array is empty\n */\n constructor(config: SimplePlaylistConfig<TItem>) {\n if (!config.items || config.items.length === 0) {\n throw new Error('Playlist must have at least one item');\n }\n\n this._items = Object.freeze([...config.items]);\n this._identifierKey = config.identifierKey;\n }\n\n // ─────────────────────────────────────────────────────────────────────────\n // IPlaylist Implementation\n // ─────────────────────────────────────────────────────────────────────────\n\n /**\n * Get the currently active item.\n */\n get currentItem(): TItem {\n return this._items[this._currentIndex];\n }\n\n /**\n * Get all items in the playlist.\n *\n * Returns a readonly array to prevent external modification.\n */\n get items(): readonly TItem[] {\n return this._items;\n }\n\n /**\n * Select an item by identifier.\n *\n * Looks up the item using the configured identifier key and switches\n * to it if found. Triggers item change callbacks if the selection changes.\n *\n * @param identifier - Unique identifier for the item\n * @throws Error if no item matches the identifier\n */\n selectItem(identifier: string): void {\n const index = this._items.findIndex(\n item => String(item[this._identifierKey]) === identifier\n );\n\n if (index === -1) {\n throw new Error(`Playlist item not found: ${identifier}`);\n }\n\n // Only notify if actually changing\n if (index !== this._currentIndex) {\n this._currentIndex = index;\n this._notifyChange();\n }\n }\n\n /**\n * Register a callback for item changes.\n *\n * Called whenever the current item changes via `selectItem()`.\n *\n * @param callback - Function receiving the new current item\n */\n onItemChange(callback: (item: TItem) => void): void {\n this._changeCallbacks.push(callback);\n }\n\n // ─────────────────────────────────────────────────────────────────────────\n // Private Methods\n // ─────────────────────────────────────────────────────────────────────────\n\n /**\n * Notify all registered change callbacks.\n */\n private _notifyChange(): void {\n const currentItem = this.currentItem;\n for (const callback of this._changeCallbacks) {\n callback(currentItem);\n }\n }\n}\n","// =============================================================================\n// DECOMPOSED INTERFACES (new architecture)\n// =============================================================================\n\nexport type {\n IContainerProvider,\n IPlaylist,\n IPositionSource,\n ISeekable,\n TBoundary,\n TSourceState,\n} from '@timelineproviders/types.ts';\n\nexport {isSeekable} from '@timelineproviders/types.ts';\n\n// =============================================================================\n// DECOMPOSED POSITION SOURCES (new architecture)\n// =============================================================================\n\nexport {BasePositionSource} from '@timelineproviders/position-sources/base-position-source.ts';\nexport type {RafPositionSourceConfig} from '@timelineproviders/position-sources/raf-position-source.ts';\nexport {RafPositionSource} from '@timelineproviders/position-sources/raf-position-source.ts';\nexport type {ScrollPositionSourceConfig} from '@timelineproviders/position-sources/scroll-position-source.ts';\nexport {ScrollPositionSource} from '@timelineproviders/position-sources/scroll-position-source.ts';\nexport type {\n VideoPositionSourceConfig,\n VideoSource,\n} from '@timelineproviders/position-sources/video-position-source.ts';\nexport {VideoPositionSource} from '@timelineproviders/position-sources/video-position-source.ts';\n\n// =============================================================================\n// DECOMPOSED CONTAINER PROVIDERS (new architecture)\n// =============================================================================\n\nexport type {DomContainerProviderConfig} from '@timelineproviders/container-providers/dom-container-provider.ts';\nexport {DomContainerProvider} from '@timelineproviders/container-providers/dom-container-provider.ts';\n\n// =============================================================================\n// DECOMPOSED PLAYLIST (new architecture)\n// =============================================================================\n\nexport type {SimplePlaylistConfig} from '@timelineproviders/playlist/simple-playlist.ts';\nexport {SimplePlaylist} from '@timelineproviders/playlist/simple-playlist.ts';\n","/**\n * Handler function for a specific event\n */\nexport type EventHandler<T extends unknown[]> = (...args: T) => void;\n\n/**\n * Interface for a type-safe event emitter\n * @typeParam T - Event map object where keys are event names and values are argument tuples\n *\n * Note: Use `type` aliases (not `interface`) for your event maps to avoid\n * \"Index signature is missing\" errors. TypeScript treats them differently.\n */\nexport interface ITypedEventEmitter<T extends Record<keyof T, unknown[]>> {\n /**\n * Subscribe to an event\n * @param event - Event name\n * @param handler - Event handler\n * @returns Unsubscribe function\n */\n on<K extends keyof T>(event: K, handler: EventHandler<T[K]>): () => void;\n\n /**\n * Subscribe to an event for one-time execution\n * @param event - Event name\n * @param handler - Event handler\n * @returns Unsubscribe function\n */\n once<K extends keyof T>(event: K, handler: EventHandler<T[K]>): () => void;\n\n /**\n * Unsubscribe from an event\n * @param event - Event name\n * @param handler - Event handler to remove\n */\n off<K extends keyof T>(event: K, handler: EventHandler<T[K]>): void;\n\n /**\n * Emit an event to all subscribers\n * @param event - Event name\n * @param args - Event arguments\n */\n emit<K extends keyof T>(event: K, ...args: T[K]): void;\n\n /**\n * Remove all listeners for a specific event or all events\n * @param event - Optional event name. If not provided, removes all listeners.\n */\n removeAllListeners(event?: keyof T): void;\n}\n\n/**\n * Type-safe event emitter implementation\n *\n * Features:\n * - Generic type parameter for event map\n * - Handler execution order preserved (registration order)\n * - Errors in handlers caught and logged (don't break other handlers)\n * - Copy handlers array during emit (safe removal during iteration)\n *\n * @example\n * ```typescript\n * interface MyEvents {\n * start: [];\n * data: [value: string];\n * progress: [current: number, total: number];\n * }\n *\n * const emitter = new TypedEventEmitter<MyEvents>();\n *\n * const unsubscribe = emitter.on('data', (value) => {\n * console.log('Received:', value);\n * });\n *\n * emitter.emit('data', 'hello');\n * unsubscribe();\n * ```\n */\nexport class TypedEventEmitter<T extends Record<keyof T, unknown[]>>\n implements ITypedEventEmitter<T>\n{\n private handlers: Map<keyof T, Array<EventHandler<T[keyof T]>>> = new Map();\n\n /**\n * Subscribe to an event\n * @param event - Event name\n * @param handler - Event handler\n * @returns Unsubscribe function\n */\n on<K extends keyof T>(event: K, handler: EventHandler<T[K]>): () => void {\n if (!this.handlers.has(event)) {\n this.handlers.set(event, []);\n }\n\n const eventHandlers = this.handlers.get(event)!;\n eventHandlers.push(handler as EventHandler<T[keyof T]>);\n\n return () => this.off(event, handler);\n }\n\n /**\n * Subscribe to an event for one-time execution\n * @param event - Event name\n * @param handler - Event handler\n * @returns Unsubscribe function\n */\n once<K extends keyof T>(event: K, handler: EventHandler<T[K]>): () => void {\n const onceHandler: EventHandler<T[K]> = (...args) => {\n this.off(event, onceHandler);\n handler(...args);\n };\n\n return this.on(event, onceHandler);\n }\n\n /**\n * Unsubscribe from an event\n * @param event - Event name\n * @param handler - Event handler to remove\n */\n off<K extends keyof T>(event: K, handler: EventHandler<T[K]>): void {\n const eventHandlers = this.handlers.get(event);\n if (!eventHandlers) {\n return;\n }\n\n const index = eventHandlers.indexOf(handler as EventHandler<T[keyof T]>);\n if (index !== -1) {\n eventHandlers.splice(index, 1);\n }\n }\n\n /**\n * Emit an event to all subscribers\n *\n * Features:\n * - Copies handlers array to allow safe removal during iteration\n * - Isolates errors - one failing handler doesn't break others\n * - Logs errors to console for debugging\n *\n * @param event - Event name\n * @param args - Event arguments\n */\n emit<K extends keyof T>(event: K, ...args: T[K]): void {\n const eventHandlers = this.handlers.get(event);\n if (!eventHandlers || eventHandlers.length === 0) {\n return;\n }\n\n // Copy array to allow safe removal during iteration\n const handlersCopy = [...eventHandlers];\n\n for (const handler of handlersCopy) {\n try {\n handler(...(args as T[keyof T]));\n } catch (error) {\n console.error(`Error in event handler for \"${String(event)}\":`, error);\n }\n }\n }\n\n /**\n * Remove all listeners for a specific event or all events\n * @param event - Optional event name. If not provided, removes all listeners.\n */\n removeAllListeners(event?: keyof T): void {\n if (event !== undefined) {\n this.handlers.delete(event);\n } else {\n this.handlers.clear();\n }\n }\n}\n","import type {IEndableAction, ITimelineAction} from '@action/types.ts';\nimport type {\n IResolvedEngineConfiguration,\n IResolvedTimelineConfiguration,\n} from '@configuration/types.ts';\nimport type {\n EventName,\n IEventbus,\n TEventbusRemover,\n TEventHandler,\n} from '@eventbus/types.ts';\nimport type {\n IContainerProvider,\n IPlaylist,\n IPositionSource,\n ISeekable,\n} from '@timelineproviders/types.ts';\nimport {TypedEventEmitter} from '@util/typed-event-emitter.ts';\nimport $ from 'jquery';\nimport type {LanguageManager} from './language-manager.ts';\nimport type {\n EngineEvents,\n IEligiusEngine,\n ITimelineProviderInfo,\n TimelineTypes,\n TResultCallback,\n} from './types.ts';\n\n// ─────────────────────────────────────────────────────────────────────────────\n// Type Guards\n// ─────────────────────────────────────────────────────────────────────────────\n\n/**\n * Type guard to check if a position source supports seeking.\n */\nfunction isSeekable(\n source: IPositionSource\n): source is IPositionSource & ISeekable {\n return 'seek' in source && typeof (source as ISeekable).seek === 'function';\n}\n\n/**\n * Maps position source state to engine play state.\n */\nfunction mapSourceStateToPlayState(\n sourceState: IPositionSource['state']\n): 'playing' | 'paused' | 'stopped' {\n switch (sourceState) {\n case 'active':\n return 'playing';\n case 'suspended':\n return 'paused';\n case 'inactive':\n return 'stopped';\n }\n}\n\ntype ActionMethod =\n | (IEndableAction['start'] & ActionMethodMetadata)\n | (IEndableAction['end'] & ActionMethodMetadata);\n\ninterface ActionMethodMetadata {\n id: string;\n isStart: boolean;\n startPosition?: number;\n}\n\n/**\n * The Eligius timeline engine with explicit, testable API.\n *\n * This engine is responsible for starting and stopping the given timeline provider\n * and triggering the actions associated with positions along the timeline.\n */\nexport class EligiusEngine implements IEligiusEngine {\n private _timeLineActionsLookup: Record<\n string,\n Record<number, ActionMethod[]>\n > = {};\n private _timelineLookupCache: Map<string, IResolvedTimelineConfiguration> =\n new Map();\n private _eventbusRemovers: TEventbusRemover[] = [];\n private _currentTimelineUri: string = '';\n\n // Decomposed timeline provider components\n private _activePositionSource: IPositionSource | undefined = undefined;\n private _activeContainerProvider: IContainerProvider | undefined = undefined;\n private _activePlaylist: IPlaylist | undefined = undefined;\n\n private _lastPosition: number = -1;\n private _emitter = new TypedEventEmitter<EngineEvents>();\n\n // ─────────────────────────────────────────────────────────────────────────\n // STATE (synchronous reads) - IEligiusEngine interface\n // ─────────────────────────────────────────────────────────────────────────\n\n /** Current timeline position in seconds (supports fractional values) */\n get position(): number {\n return this._activePositionSource?.getPosition() ?? 0;\n }\n\n /** Timeline duration in seconds, undefined if not yet available */\n get duration(): number | undefined {\n return this._activePositionSource?.getDuration();\n }\n\n /** Current playback state (derived from position source state) */\n get playState(): 'playing' | 'paused' | 'stopped' {\n if (!this._activePositionSource) {\n return 'stopped';\n }\n return mapSourceStateToPlayState(this._activePositionSource.state);\n }\n\n /** URI of the currently active timeline */\n get currentTimelineUri(): string {\n return this._currentTimelineUri;\n }\n\n /** Container element for the active timeline provider */\n get container(): JQuery<HTMLElement> | undefined {\n return this._activeContainerProvider?.getContainer();\n }\n\n /** Root element of the engine (container selector) */\n get engineRoot(): JQuery<HTMLElement> {\n return $(this.configuration.containerSelector);\n }\n\n constructor(\n private configuration: IResolvedEngineConfiguration,\n private eventbus: IEventbus,\n private timelineProviders: Record<TimelineTypes, ITimelineProviderInfo>,\n private languageManager: LanguageManager\n ) {}\n\n // ─────────────────────────────────────────────────────────────────────────\n // EVENTS - IEligiusEngine interface\n // ─────────────────────────────────────────────────────────────────────────\n\n /**\n * Subscribe to engine events\n * @param event - Event name\n * @param handler - Event handler\n * @returns Unsubscribe function\n */\n on<K extends keyof EngineEvents>(\n event: K,\n handler: (...args: EngineEvents[K]) => void\n ): () => void {\n return this._emitter.on(event, handler);\n }\n\n // ─────────────────────────────────────────────────────────────────────────\n // PLAYBACK COMMANDS - IEligiusEngine interface\n // ─────────────────────────────────────────────────────────────────────────\n\n /**\n * Start playback\n * @throws If autoplay is blocked (video provider)\n */\n async start(): Promise<void> {\n if (!this._activePositionSource) {\n return;\n }\n\n await this._activePositionSource.activate();\n this._emitter.emit('start');\n this.eventbus.broadcast('timeline-play', []);\n }\n\n /**\n * Pause playback\n */\n pause(): void {\n if (!this._activePositionSource) {\n return;\n }\n\n this._activePositionSource.suspend();\n this._emitter.emit('pause');\n this.eventbus.broadcast('timeline-pause', []);\n }\n\n /**\n * Stop playback and reset to beginning\n */\n stop(): void {\n if (!this._activePositionSource) {\n return;\n }\n\n this._activePositionSource.deactivate();\n this._emitter.emit('stop');\n this.eventbus.broadcast('timeline-stop', []);\n }\n\n /**\n * Seek to a specific position\n * @param position - Target position in seconds\n * @returns Actual position after seek\n */\n async seek(position: number): Promise<number> {\n if (!this._activePositionSource) {\n return 0;\n }\n\n const seekPosition = position;\n const duration = this._activePositionSource.getDuration();\n const currentPosition = this._activePositionSource.getPosition();\n\n if (seekPosition < 0 || seekPosition > duration) {\n return currentPosition;\n }\n\n this._emitter.emit('seekStart', seekPosition, currentPosition, duration);\n this.eventbus.broadcast('timeline-seek', [\n seekPosition,\n currentPosition,\n duration,\n ]);\n\n // Only seek if position source supports it\n if (isSeekable(this._activePositionSource)) {\n await this._activePositionSource.seek(seekPosition);\n }\n await this._executeSeekActions(seekPosition);\n\n const finalPosition = this._activePositionSource.getPosition();\n\n this._emitter.emit('seekComplete', finalPosition, duration);\n this.eventbus.broadcast('timeline-seeked', [finalPosition, duration]);\n\n this._emitter.emit('time', finalPosition);\n this.eventbus.broadcast('timeline-time', [finalPosition]);\n\n // Resume if was active before seek\n if (this._activePositionSource.state === 'active') {\n await this._activePositionSource.activate();\n }\n\n return finalPosition;\n }\n\n // ─────────────────────────────────────────────────────────────────────────\n // TIMELINE MANAGEMENT - IEligiusEngine interface\n // ─────────────────────────────────────────────────────────────────────────\n\n /**\n * Switch to a different timeline\n * @param uri - Timeline URI to switch to\n * @param position - Optional starting position\n */\n async switchTimeline(uri: string, position: number = 0): Promise<void> {\n if (!this._activePositionSource) {\n return;\n }\n\n const timelineConfig = this._timelineLookupCache.get(uri);\n if (!timelineConfig || this._currentTimelineUri === timelineConfig.uri) {\n return;\n }\n\n this._activePositionSource.deactivate();\n await this._cleanUpTimeline();\n\n this._currentTimelineUri = timelineConfig.uri;\n this._emitter.emit('timelineChange', this._currentTimelineUri);\n this.eventbus.broadcast('timeline-current-timeline-change', [\n this._currentTimelineUri,\n ]);\n\n const newProviderSettings = this.timelineProviders[timelineConfig.type];\n\n // Switch to new position source if different\n if (this._activePositionSource !== newProviderSettings.positionSource) {\n this._activePositionSource.destroy();\n this._activePositionSource = newProviderSettings.positionSource;\n this._activeContainerProvider = newProviderSettings.containerProvider;\n this._activePlaylist = newProviderSettings.playlist;\n }\n\n this._activePositionSource.loop = timelineConfig.loop;\n\n if (!this._activePositionSource.loop && position > 0) {\n this.eventbus.once('timeline-firstframe', async () => {\n if (!this._activePositionSource) {\n return;\n }\n\n this._activePositionSource.suspend();\n this.eventbus.broadcast('timeline-duration', [\n this._activePositionSource.getDuration,\n ]);\n\n await this._executeStartActions();\n\n if (isSeekable(this._activePositionSource)) {\n await this._activePositionSource.seek(position);\n }\n await this._executeSeekActions(position);\n });\n }\n\n // Select playlist item if playlist is available\n if (this._activePlaylist) {\n this._activePlaylist.selectItem(uri);\n }\n }\n\n /**\n * Initializes the engine by creating the HTML layout and the first time line\n * by executing its initActions.\n */\n init(): Promise<IPositionSource> {\n this._createLayoutTemplate();\n\n this._addEventbusListeners();\n\n const {timelines} = this.configuration;\n\n this._currentTimelineUri = timelines?.[0].uri ?? '';\n\n this._createTimelineLookup();\n\n return this._initializeTimelineProvider();\n }\n\n private _createLayoutTemplate() {\n const {containerSelector} = this.configuration;\n const container = $(containerSelector);\n\n if (!container || !container.length) {\n throw new Error(`Container selector not found: ${containerSelector}`);\n }\n\n const {layoutTemplate} = this.configuration;\n\n if (layoutTemplate?.length) {\n container.html(layoutTemplate);\n } else {\n console.warn('layoutTemplate is empty, unable to create layout');\n }\n }\n\n private async _initializeTimelineProvider(): Promise<IPositionSource> {\n if (!this.configuration.timelines?.length) {\n throw new Error('No timelines present');\n }\n\n const firstTimeline = this.configuration.timelines[0];\n const providerSettings = this.timelineProviders[firstTimeline.type];\n\n if (!providerSettings) {\n throw new Error(\n `No timeline provider configured for type ${firstTimeline.type}`\n );\n }\n\n // Destroy existing components if any\n this._activePositionSource?.destroy();\n\n // Set up decomposed components\n this._activePositionSource = providerSettings.positionSource;\n this._activeContainerProvider = providerSettings.containerProvider;\n this._activePlaylist = providerSettings.playlist;\n\n if (!this._activePositionSource) {\n throw new Error('NO ACTIVE POSITION SOURCE');\n }\n\n // Register callbacks using new interface\n this._activePositionSource.onPosition(\n this._onTimeHandler.bind(this, (x: number) => x)\n );\n this._activePositionSource.onBoundaryReached(boundary => {\n if (boundary === 'end') {\n this._onCompleteCallback();\n } else if (boundary === 'start') {\n this._onRestartCallback();\n }\n });\n this._activePositionSource.onActivated(\n this._onFirstFrameCallback.bind(this)\n );\n\n await this._activePositionSource.init();\n await this._executeActions(this.configuration.initActions, 'start');\n this._emitter.emit('initialized');\n return this._activePositionSource;\n }\n\n private _onCompleteCallback() {\n // playState is now derived from position source state\n this._emitter.emit('timelineComplete');\n this.eventbus.broadcast('timeline-complete', []);\n }\n\n private _onFirstFrameCallback() {\n this._emitter.emit('timelineFirstFrame');\n this.eventbus.broadcast('timeline-firstframe', []);\n\n const duration = this._activePositionSource?.getDuration();\n if (duration !== undefined) {\n this._emitter.emit('duration', duration);\n }\n this.eventbus.broadcast('timeline-duration', [\n this._activePositionSource?.getDuration,\n ]);\n }\n\n private _onRestartCallback() {\n this._emitter.emit('timelineRestart');\n this.eventbus.broadcast('timeline-restart', []);\n }\n\n private async _cleanUp() {\n await this._cleanUpTimeline();\n await this._executeActions(\n [...this.configuration.initActions].reverse(),\n 'end'\n );\n }\n\n /**\n * Cleans up all the necessary parts that the engine initialized.\n * - It ends the currently active operations and the init actions.\n * - It removes all its eventbus listeners, handlers and interceptors.\n * - It destroys all of its timeline providers\n * - It empties the HTML element indicated by the containerSelector configuration property.\n *\n */\n async destroy() {\n await this._cleanUp();\n\n this.languageManager.destroy();\n\n this._activePositionSource = undefined;\n this._activeContainerProvider = undefined;\n this._activePlaylist = undefined;\n this._eventbusRemovers.forEach(remover => remover());\n\n if (this.timelineProviders) {\n Object.values(this.timelineProviders).forEach(providerInfo =>\n providerInfo.positionSource.destroy()\n );\n }\n\n const {containerSelector} = this.configuration;\n const container = $(containerSelector);\n container.empty();\n\n this._emitter.emit('destroyed');\n this._emitter.removeAllListeners();\n }\n\n private _addEventListener(\n eventName: string,\n eventHandler: TEventHandler,\n eventTopic?: string\n ) {\n this._eventbusRemovers.push(\n this.eventbus.on(eventName as EventName, eventHandler, eventTopic)\n );\n }\n\n private _addEventbusListeners() {\n this._addEventListener(\n 'request-engine-root',\n this._handleRequestEngineRoot.bind(\n this,\n this.configuration.containerSelector\n )\n );\n this._addEventListener(\n 'request-timeline-uri',\n this._handleRequestTimelineUri.bind(this)\n );\n this._addEventListener(\n 'request-current-timeline-position',\n this._handleRequestTimelinePosition.bind(this, (x: number) => x)\n );\n this._addEventListener(\n 'request-timeline-cleanup',\n this._handleTimelineComplete.bind(this)\n );\n this._addEventListener(\n 'timeline-request-current-timeline',\n this._requestCurrentTimeline.bind(this)\n );\n this._addEventListener(\n 'timeline-play-toggle-request',\n this._toggleplay.bind(this)\n );\n\n this._addEventListener(\n 'timeline-play-request',\n this._playRequest.bind(this)\n );\n\n this._addEventListener(\n 'timeline-stop-request',\n this._stopRequest.bind(this)\n );\n\n this._addEventListener(\n 'timeline-pause-request',\n this._pauseRequest.bind(this)\n );\n\n this._addEventListener(\n 'timeline-container-request',\n this._containerRequest.bind(this)\n );\n\n this._addEventListener(\n 'timeline-duration-request',\n this._durationRequest.bind(this)\n );\n\n this._addEventListener(\n 'timeline-seek-request',\n this._seekRequest.bind(this)\n );\n }\n\n // Legacy eventbus handlers - delegate to public API methods\n private async _seekRequest(position: number) {\n await this.seek(position);\n }\n\n private _durationRequest(callBack: TResultCallback<number | undefined>) {\n callBack(this.duration);\n }\n\n private _containerRequest(\n callBack: TResultCallback<JQuery<HTMLElement> | undefined>\n ) {\n callBack(this.container);\n }\n\n private _pauseRequest() {\n this.pause();\n }\n\n private _stopRequest() {\n this.stop();\n }\n\n private async _playRequest() {\n await this.start();\n }\n\n private async _toggleplay() {\n if (this._activePositionSource?.state === 'active') {\n this.pause();\n } else {\n await this.start();\n }\n }\n\n private _createTimelineLookup() {\n if (!this.configuration.timelines) {\n return;\n }\n\n // Consolidated loop: process both start and end actions in a single pass\n this.configuration.timelines.forEach(timelineInfo => {\n // Populate timeline lookup cache for O(1) access\n this._timelineLookupCache.set(timelineInfo.uri, timelineInfo);\n\n timelineInfo.timelineActions.forEach(timelineAction => {\n this._addTimelineActionStart(timelineInfo.uri, timelineAction);\n this._addTimelineActionEnd(timelineInfo.uri, timelineAction);\n });\n });\n\n EligiusEngine.sortTimelines(Object.values(this._timeLineActionsLookup));\n }\n\n static sortTimelines(timelines: Record<number, ActionMethod[]>[]) {\n timelines.forEach(timelineActions => {\n Object.keys(timelineActions).forEach(key => {\n const numericKey = Number(key);\n timelineActions[numericKey] = EligiusEngine.sortActionsPerPosition(\n timelineActions[numericKey]\n );\n });\n });\n }\n\n static sortActionsPerPosition(actions: ActionMethod[]) {\n const [startMethods, endMethods] = actions.reduce(\n (acc, item) => {\n if (item.isStart) {\n acc[0].push(item);\n } else {\n acc[1].push(item);\n }\n return acc;\n },\n [[], []] as [ActionMethod[], ActionMethod[]]\n );\n return [\n ...endMethods.sort(sortActionMethodsHighestStartPositionFirst),\n ...startMethods,\n ];\n }\n\n private _addTimelineActionStart(\n uri: string,\n timeLineAction: ITimelineAction\n ) {\n const startPosition = timeLineAction.duration.start;\n const timelineStartPositions = this._initializeTimelinePosition(\n this._initializeUriLookup(this._timeLineActionsLookup, uri),\n startPosition\n );\n const startMethod = timeLineAction.start.bind(\n timeLineAction\n ) as ActionMethod;\n\n if (timeLineAction.id?.length) {\n startMethod.id = timeLineAction.id;\n }\n startMethod.isStart = true;\n\n timelineStartPositions.push(startMethod);\n }\n\n private _addTimelineActionEnd(uri: string, timeLineAction: ITimelineAction) {\n let end = timeLineAction.duration.end;\n if (end < 0) {\n end = timeLineAction.duration.end = Infinity;\n }\n\n if (Number.isFinite(end)) {\n const timelineEndPositions = this._initializeTimelinePosition(\n this._timeLineActionsLookup[uri],\n end\n );\n const endMethod = timeLineAction.end.bind(timeLineAction) as ActionMethod;\n\n if (timeLineAction.id?.length) {\n endMethod.id = timeLineAction.id;\n endMethod.startPosition = timeLineAction.duration.start;\n }\n endMethod.isStart = false;\n\n timelineEndPositions.push(endMethod);\n }\n }\n\n private _initializeUriLookup(\n lookup: Record<string, Record<number, ActionMethod[]>>,\n uri: string\n ): Record<number, ActionMethod[]> {\n if (!lookup[uri]) {\n lookup[uri] = {};\n }\n\n return lookup[uri];\n }\n\n private _initializeTimelinePosition(\n lookup: Record<number, ActionMethod[]>,\n position: number\n ): ActionMethod[] {\n if (!lookup[position]) {\n lookup[position] = [] as ActionMethod[];\n }\n\n return lookup[position];\n }\n\n private async _executeActions(\n actions: IEndableAction[],\n methodName: 'start' | 'end'\n ): Promise<void> {\n // Iterative implementation (converted from recursive)\n if (actions.length === 0) {\n return;\n }\n\n for (const action of actions) {\n await action[methodName]();\n }\n }\n\n private _handleRequestEngineRoot(\n engineRootSelector: string,\n resultCallback: TResultCallback<JQuery<HTMLElement>>\n ) {\n resultCallback($(engineRootSelector));\n }\n\n private async _handleRequestTimelineUri(uri: string, position: number = 0) {\n await this.switchTimeline(uri, position);\n }\n\n private _cleanUpTimeline() {\n return this._executeRelevantActions(this._getActiveActions, 'end');\n }\n\n private _executeStartActions() {\n return this._executeRelevantActions(\n this._getActionsForPosition.bind(this, 0),\n 'start'\n );\n }\n\n /**\n * Gets all of the inactive actions whose duration falls within the given timeline position.\n *\n * @param position the given position\n * @param actions all of the relevant actions\n * @returns\n */\n private _getActionsForPosition(position: number, actions: ITimelineAction[]) {\n return actions.filter(\n action =>\n !action.active &&\n action.duration.start <= position &&\n action.duration.end >= position\n );\n }\n\n private _getActiveActions(allActions: ITimelineAction[]) {\n const actions = allActions.filter(action => action.active);\n return actions.sort(sortActionsHighestStartPositionFirst);\n }\n\n private _executeRelevantActions(\n filter: (actions: ITimelineAction[]) => ITimelineAction[],\n executionType: 'start' | 'end'\n ) {\n const timelineActions = this._getTimelineActionsForCurrentTimeline();\n const currentActions = filter.apply(this, [timelineActions]);\n return this._executeActions(currentActions, executionType);\n }\n\n private _handleRequestTimelinePosition(\n floor: (x: number) => number,\n resultCallback: TResultCallback<number>\n ) {\n resultCallback(floor(this._activePositionSource?.getPosition() || -1));\n }\n\n private _handleTimelineComplete() {\n this._cleanUpTimeline();\n }\n\n private _getTimelineActionsForCurrentTimeline() {\n return this._getTimelineActionsForUri(this._currentTimelineUri);\n }\n\n private _requestCurrentTimeline(resultCallback: TResultCallback<string>) {\n resultCallback(this._currentTimelineUri);\n }\n\n private _getTimelineActionsForUri(uri: string): ITimelineAction[] {\n const info = this._timelineLookupCache.get(uri);\n return info?.timelineActions ?? [];\n }\n\n private _onTimeHandler(floor: (x: number) => number, position: number) {\n if (!Number.isNaN(position)) {\n const pos = floor(position);\n\n if (this._lastPosition !== pos) {\n this._executeActionsForPosition(pos);\n this._emitter.emit('time', pos);\n this.eventbus.broadcast('timeline-time', [pos]);\n }\n }\n }\n\n private _executeActionsForPosition(position: number) {\n this._lastPosition = position;\n const actions = this._timeLineActionsLookup[this._currentTimelineUri];\n\n if (actions) {\n const executions = actions[position];\n executions?.forEach(exec => exec());\n }\n }\n\n private async _executeSeekActions(position: number) {\n const timelineActions = this._getTimelineActionsForCurrentTimeline();\n const currentActions = this._getActiveActions(timelineActions).filter(\n action =>\n !(action.duration.start <= position && action.duration.end >= position)\n );\n const newActions = this._getActionsForPosition(position, timelineActions);\n await this._executeActions(currentActions, 'end');\n await this._executeActions(newActions, 'start');\n }\n}\n\nconst sortActionsHighestStartPositionFirst = (\n a: ITimelineAction,\n b: ITimelineAction\n) => b.duration.start - a.duration.start;\n\nconst sortActionMethodsHighestStartPositionFirst = (\n a: ActionMethod,\n b: ActionMethod\n) => {\n if (a.startPosition === undefined || b.startPosition === undefined) {\n return 0;\n }\n return b.startPosition - a.startPosition;\n};\n","import * as ctrls from '@controllers/index.ts';\nimport * as evtb from '@eventbus/index.ts';\nimport * as ops from '@operation/index.ts';\nimport type {TOperation} from '@operation/types.ts';\nimport * as prvdrs from '@timelineproviders/index.ts';\nimport {EligiusEngine} from '../eligius-engine.ts';\nimport type {IResourceImporter} from '../types.ts';\n\nconst operations: Record<string, TOperation<any>> = ops as any;\nconst controllers: Record<string, any> = ctrls;\nconst providers: Record<string, any> = prvdrs;\nconst eventbus: Record<string, any> = evtb;\n\nexport class EligiusResourceImporter implements IResourceImporter {\n engines = new Map();\n constructor() {\n this.engines.set('EligiusEngine', EligiusEngine);\n }\n\n getOperationNames(): string[] {\n return Object.keys(operations);\n }\n\n getControllerNames(): string[] {\n return Object.keys(controllers);\n }\n\n getProviderNames(): string[] {\n return Object.keys(providers);\n }\n\n import(name: string): Record<string, any> {\n const value =\n operations[name] ??\n controllers[name] ??\n providers[name] ??\n eventbus[name] ??\n this.engines.get(name);\n\n return {[name]: value};\n }\n}\n","import {getGlobals} from '@operation/helper/globals.ts';\n\nexport function setGlobal(name: string, value: any) {\n const cache = getGlobals();\n cache[name] = value;\n}\n","import {setGlobal} from '@operation/helper/set-global.ts';\nimport {TypedEventEmitter} from '@util/typed-event-emitter.ts';\nimport type {\n ILabel,\n ILanguageLabel,\n ILanguageManager,\n LanguageEvents,\n TLanguageCode,\n} from './types.ts';\n\n/**\n * Manages multi-language labels with explicit, testable API.\n *\n * This class manages the labels for an {@link IEligiusEngine} instance.\n * It provides a pure API for language management and emits events for language changes.\n *\n * Eventbus integration is handled by LanguageEventbusAdapter.\n */\nexport class LanguageManager implements ILanguageManager {\n private _labelLookup: Record<string, ILabel[]>;\n private _emitter = new TypedEventEmitter<LanguageEvents>();\n private _availableLanguages: string[] = [];\n\n // ─────────────────────────────────────────────────────────────────────────\n // STATE - ILanguageManager interface\n // ─────────────────────────────────────────────────────────────────────────\n\n /** Current language code (e.g., 'en-US', 'nl-NL') */\n get language(): string {\n return this._currentLanguage;\n }\n\n /** List of available language codes, derived from unique languages in label collections */\n get availableLanguages(): string[] {\n return this._availableLanguages;\n }\n\n constructor(\n private _currentLanguage: TLanguageCode,\n labels: ILanguageLabel[]\n ) {\n if (!_currentLanguage) {\n throw new Error('language ctor arg cannot have zero length');\n }\n setGlobal('defaultLanguage', _currentLanguage);\n this._labelLookup = this._createLabelLookup(labels);\n this._availableLanguages = this._extractAvailableLanguages(labels);\n }\n\n // ─────────────────────────────────────────────────────────────────────────\n // EVENTS - ILanguageManager interface\n // ─────────────────────────────────────────────────────────────────────────\n\n /**\n * Subscribe to language manager events\n * @param event - Event name\n * @param handler - Event handler\n * @returns Unsubscribe function\n */\n on<K extends keyof LanguageEvents>(\n event: K,\n handler: (...args: LanguageEvents[K]) => void\n ): () => void {\n return this._emitter.on(event, handler);\n }\n\n // ─────────────────────────────────────────────────────────────────────────\n // COMMANDS - ILanguageManager interface\n // ─────────────────────────────────────────────────────────────────────────\n\n /**\n * Change the current language\n * @param language - New language code\n * @throws If language code is empty or null\n */\n setLanguage(language: TLanguageCode): void {\n if (!language || language.length === 0) {\n throw new Error('Language cannot be empty');\n }\n\n const previousLanguage = this._currentLanguage;\n this._currentLanguage = language;\n\n this._emitter.emit('change', language, previousLanguage);\n }\n\n /**\n * Get a label collection by ID\n * @param collectionId - Label collection ID\n * @returns Label array or undefined if not found\n */\n getLabelCollection(collectionId: string): ILabel[] | undefined {\n return this._labelLookup[collectionId];\n }\n\n /**\n * Get multiple label collections by IDs\n * @param collectionIds - Array of label collection IDs\n * @returns Array of label arrays (undefined for not found collections)\n */\n getLabelCollections(collectionIds: string[]): (ILabel[] | undefined)[] {\n return collectionIds.map(id => this._labelLookup[id]);\n }\n\n // ─────────────────────────────────────────────────────────────────────────\n // LIFECYCLE - ILanguageManager interface\n // ─────────────────────────────────────────────────────────────────────────\n\n /**\n * Clean up resources\n */\n destroy(): void {\n this._emitter.removeAllListeners();\n }\n\n // ─────────────────────────────────────────────────────────────────────────\n // Private helpers\n // ─────────────────────────────────────────────────────────────────────────\n\n private _createLabelLookup(labels: ILanguageLabel[]) {\n return labels.reduce<Record<string, ILabel[]>>((acc, label) => {\n acc[label.id] = label.labels;\n return acc;\n }, {});\n }\n\n private _extractAvailableLanguages(labels: ILanguageLabel[]): string[] {\n const languages = new Set<string>();\n for (const labelCollection of labels) {\n for (const label of labelCollection.labels) {\n languages.add(label.languageCode);\n }\n }\n return Array.from(languages);\n }\n}\n","import type {IAction} from '@action/types.ts';\nimport {\n EngineEventbusAdapter,\n EngineInputAdapter,\n LanguageEventbusAdapter,\n} from '@adapters/index.ts';\nimport {ConfigurationResolver} from '@configuration/configuration-resolver.ts';\nimport type {\n IEngineConfiguration,\n IResolvedEngineConfiguration,\n ITimelineProviderSettings,\n} from '@configuration/types.ts';\nimport {\n ActionRegistryEventbusListener,\n Eventbus,\n type IEventbus,\n RequestVideoUriInterceptor,\n type TEventbusRemover,\n} from '@eventbus/index.ts';\nimport type {\n IContainerProvider,\n IPlaylist,\n IPositionSource,\n} from '@timelineproviders/types.ts';\nimport {LanguageManager} from './language-manager.ts';\nimport type {\n IConfigurationResolver,\n IEngineFactory,\n IEngineFactoryOptions,\n IEngineFactoryResult,\n ISimpleResourceImporter,\n ITimelineProviderInfo,\n TimelineTypes,\n} from './types.ts';\n\n/**\n * The EngineFactory is used to create and initialize an {@link IEligiusEngine} instance.\n *\n * It prepares a resolved configuration and creates the engine based on the class defined in the configuration.\n *\n * @example Loading a configuration and creating an IEligiusEngine instance\n * ```ts\n * import { IEngineConfiguration, EngineFactory, EligiusResourceImporter } from 'eligius';\n * import * as engineConfig from './my-eligius-config.json';\n *\n * const factory = new EngineFactory(new EligiusResourceImporter(), window);\n *\n * const { engine } = factory.createEngine((engineConfig as unknown) as IEngineConfiguration);\n *\n * engine.init().then(()=> {console.log('Eligius engine ready for business');});\n * ```\n */\nexport class EngineFactory implements IEngineFactory {\n private _actionsLookup: Record<string, IAction> = {};\n private _eventbus: IEventbus;\n private _eventRemovers: TEventbusRemover[] = [];\n private _importer: ISimpleResourceImporter;\n private _windowRef: Window;\n\n constructor(\n importer: ISimpleResourceImporter,\n windowRef: Window,\n options?: IEngineFactoryOptions\n ) {\n this._importer = importer;\n this._windowRef = windowRef;\n this._eventbus = options?.eventbus ?? new Eventbus();\n\n this._eventRemovers.push(\n this._eventbus.onRequest(\n 'request-instance',\n this._requestInstanceHandler.bind(this)\n )\n );\n this._eventRemovers.push(\n this._eventbus.onRequest(\n 'request-action',\n this._requestActionHandler.bind(this)\n )\n );\n this._eventRemovers.push(\n this._eventbus.onRequest(\n 'request-function',\n this._requestFunctionHandler.bind(this)\n )\n );\n }\n\n /**\n * Destroys the factory and cleans up all registered request handlers.\n */\n destroy() {\n this._eventRemovers.forEach(x => x());\n this._eventRemovers = [];\n this._actionsLookup = {};\n }\n\n private _importSystemEntryWithEventbusDependency(systemName: string): any {\n const ctor = this._importSystemEntry(systemName);\n return new ctor(this._eventbus);\n }\n\n private _importSystemEntry(systemName: string): any {\n const module = this._importer.import(systemName);\n const entry = module?.[systemName];\n if (!entry) {\n throw new Error(\n `Failed to import '${systemName}': module does not export '${systemName}'`\n );\n }\n return entry;\n }\n\n private _requestInstanceHandler(systemName: string): any {\n return this._importSystemEntryWithEventbusDependency(systemName);\n }\n\n private _requestFunctionHandler(systemName: string): any {\n return this._importSystemEntry(systemName);\n }\n\n private _requestActionHandler(systemName: string): IAction | null {\n const action = this._actionsLookup[systemName];\n if (action) {\n return action;\n } else {\n console.error(`Unknown action: ${systemName}`);\n return null;\n }\n }\n\n /**\n * Creates a fully wired engine with adapters and event handlers.\n *\n * This method:\n * - Resolves the configuration\n * - Creates timeline providers\n * - Instantiates the engine and language manager\n * - Creates and connects adapters for eventbus integration\n *\n * @param configuration - The engine configuration\n * @param resolver - Optional custom configuration resolver\n * @returns Engine result with engine, language manager, eventbus, and destroy function\n */\n createEngine(\n configuration: IEngineConfiguration,\n resolver?: IConfigurationResolver\n ): IEngineFactoryResult {\n const {systemName} = configuration.engine;\n const EngineClass = this._importSystemEntry(systemName);\n\n let actionRegistryListener: ActionRegistryEventbusListener | undefined;\n if (configuration.eventActions?.length) {\n actionRegistryListener = new ActionRegistryEventbusListener();\n this._eventRemovers.push(\n this._eventbus.registerEventlistener(actionRegistryListener)\n );\n }\n\n this._eventRemovers.push(\n this._eventbus.registerInterceptor(\n 'request-timeline-uri',\n new RequestVideoUriInterceptor(this._eventbus)\n )\n );\n\n resolver =\n resolver || new ConfigurationResolver(this._importer, this._eventbus);\n const [actionLookup, resolvedConfiguration] = resolver.process(\n configuration,\n actionRegistryListener\n );\n this._actionsLookup = actionLookup;\n\n const timelineProviders = this._createTimelineProviders(\n resolvedConfiguration\n );\n\n const {language, labels} = configuration;\n const languageManager = new LanguageManager(language, labels);\n\n const engineInstance = new EngineClass(\n resolvedConfiguration,\n this._eventbus,\n timelineProviders,\n languageManager\n );\n\n // Create and connect adapters\n const engineEventbusAdapter = new EngineEventbusAdapter(\n engineInstance,\n this._eventbus\n );\n const languageEventbusAdapter = new LanguageEventbusAdapter(\n languageManager,\n this._eventbus,\n engineInstance\n );\n const engineInputAdapter = new EngineInputAdapter(\n engineInstance,\n this._eventbus,\n this._windowRef\n );\n\n // Connect all adapters\n engineEventbusAdapter.connect();\n languageEventbusAdapter.connect();\n engineInputAdapter.connect();\n\n // Return the factory result\n return {\n engine: engineInstance,\n languageManager,\n eventbus: this._eventbus,\n destroy: async () => {\n // Disconnect adapters first\n engineInputAdapter.disconnect();\n languageEventbusAdapter.disconnect();\n engineEventbusAdapter.disconnect();\n\n // Destroy engine (which also destroys languageManager internally)\n await engineInstance.destroy();\n // Note: languageManager.destroy() is NOT called here because\n // engineInstance.destroy() already calls it\n },\n };\n }\n\n private _createTimelineProviders(\n configuration: IResolvedEngineConfiguration\n ): Record<TimelineTypes, ITimelineProviderInfo> {\n // Delegate to the new config-driven method\n return this.createTimelineProvidersForConfig(configuration);\n }\n\n // ─────────────────────────────────────────────────────────────────────────\n // Config-Driven Factory Methods\n // ─────────────────────────────────────────────────────────────────────────\n\n /**\n * Creates a position source for a specific timeline based on configuration.\n *\n * The position source class is resolved dynamically via the resource importer\n * using the `systemName` property from the configuration.\n *\n * @param timeline - The resolved timeline configuration\n * @param settings - The timeline provider settings containing position source config\n * @returns A configured position source\n * @throws Error if the position source class cannot be resolved\n */\n createPositionSourceForTimeline(\n timeline: IResolvedEngineConfiguration['timelines'][number],\n settings: ITimelineProviderSettings\n ): IPositionSource {\n const config = settings.positionSource;\n const {systemName, ...options} = config;\n\n const PositionSourceClass = this._importSystemEntry(systemName);\n\n // Merge timeline-specific values with config options\n const constructorConfig = {\n ...options,\n duration: timeline.duration,\n };\n\n return new PositionSourceClass(constructorConfig);\n }\n\n /**\n * Creates a container provider based on timeline provider settings.\n *\n * The container provider class is resolved dynamically via the resource importer\n * using the `systemName` property from the configuration.\n *\n * @param settings - The timeline provider settings\n * @returns A container provider, or undefined if not configured\n * @throws Error if the container provider class cannot be resolved\n */\n createContainerProviderForTimeline(\n settings: ITimelineProviderSettings\n ): IContainerProvider | undefined {\n if (!settings.container) {\n return undefined;\n }\n\n const {systemName, ...options} = settings.container;\n const ContainerProviderClass = this._importSystemEntry(systemName);\n\n return new ContainerProviderClass(options);\n }\n\n /**\n * Creates a playlist based on timeline provider settings.\n *\n * The playlist class is resolved dynamically via the resource importer\n * using the `systemName` property from the configuration.\n *\n * @param settings - The timeline provider settings\n * @returns A playlist, or undefined if not configured\n * @throws Error if the playlist class cannot be resolved\n */\n createPlaylistForTimeline(\n settings: ITimelineProviderSettings\n ): IPlaylist | undefined {\n if (!settings.playlist) {\n return undefined;\n }\n\n const {systemName, ...options} = settings.playlist;\n const PlaylistClass = this._importSystemEntry(systemName);\n\n return new PlaylistClass(options);\n }\n\n /**\n * Assembles a complete ITimelineProviderInfo from timeline and settings.\n *\n * This is the main entry point for creating provider info with the new\n * configuration-driven architecture.\n *\n * @param timeline - The resolved timeline configuration\n * @param settings - The timeline provider settings\n * @returns A complete timeline provider info with all components\n */\n createTimelineProviderInfo(\n timeline: IResolvedEngineConfiguration['timelines'][number],\n settings: ITimelineProviderSettings\n ): ITimelineProviderInfo {\n return {\n positionSource: this.createPositionSourceForTimeline(timeline, settings),\n containerProvider: this.createContainerProviderForTimeline(settings),\n playlist: this.createPlaylistForTimeline(settings),\n };\n }\n\n /**\n * Creates timeline providers for all configured timeline types using the new\n * configuration-driven architecture.\n *\n * This method iterates over timelineProviderSettings and creates a\n * ITimelineProviderInfo for each configured timeline type by:\n * 1. Finding the first timeline that matches the type\n * 2. Using the timeline's duration for the position source\n * 3. Assembling components from the settings\n *\n * @param configuration - The resolved engine configuration\n * @returns A record of timeline types to their provider info\n * @throws Error if a provider setting has no matching timeline in config\n */\n createTimelineProvidersForConfig(\n configuration: IResolvedEngineConfiguration\n ): Record<TimelineTypes, ITimelineProviderInfo> {\n const {timelineProviderSettings, timelines} = configuration;\n\n const result = Object.entries(timelineProviderSettings).reduce<\n Record<TimelineTypes, ITimelineProviderInfo>\n >(\n (acc, [timelineType, settings]) => {\n if (!settings) {\n return acc;\n }\n\n // Find the first timeline that matches this type\n const matchingTimeline = timelines.find(t => t.type === timelineType);\n if (!matchingTimeline) {\n throw new Error(\n `Timeline provider settings for '${timelineType}' has no matching timeline in configuration`\n );\n }\n\n acc[timelineType as TimelineTypes] = this.createTimelineProviderInfo(\n matchingTimeline,\n settings\n );\n return acc;\n },\n {} as Record<Timel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MAAM,EAAC,YAAY,GAAG,YADP,SAAS;AAWxB,SAAO,KARqB,KAAK,mBAAmB,WAAW,EAGrC;GACxB,GAAG;GACH,UAAU,SAAS;GACpB,CAEgD;;;;;;;;;;;;CAanD,mCACE,UACgC;AAChC,MAAI,CAAC,SAAS,UACZ;EAGF,MAAM,EAAC,YAAY,GAAG,YAAW,SAAS;AAG1C,SAAO,KAFwB,KAAK,mBAAmB,WAAW,EAEhC,QAAQ;;;;;;;;;;;;CAa5C,0BACE,UACuB;AACvB,MAAI,CAAC,SAAS,SACZ;EAGF,MAAM,EAAC,YAAY,GAAG,YAAW,SAAS;AAG1C,SAAO,KAFe,KAAK,mBAAmB,WAAW,EAEhC,QAAQ;;;;;;;;;;;;CAanC,2BACE,UACA,UACuB;AACvB,SAAO;GACL,gBAAgB,KAAK,gCAAgC,UAAU,SAAS;GACxE,mBAAmB,KAAK,mCAAmC,SAAS;GACpE,UAAU,KAAK,0BAA0B,SAAS;GACnD;;;;;;;;;;;;;;;;CAiBH,iCACE,eAC8C;EAC9C,MAAM,EAAC,0BAA0B,cAAa;AA2B9C,SAzBe,OAAO,QAAQ,yBAAyB,CAAC,QAGrD,KAAK,CAAC,cAAc,cAAc;AACjC,OAAI,CAAC,SACH,QAAO;GAIT,MAAM,mBAAmB,UAAU,MAAK,MAAK,EAAE,SAAS,aAAa;AACrE,OAAI,CAAC,iBACH,OAAM,IAAI,MACR,mCAAmC,aAAa,6CACjD;AAGH,OAAI,gBAAiC,KAAK,2BACxC,kBACA,SACD;AACD,UAAO;KAET,EAAE,CACH"}
|
|
1
|
+
{"version":3,"file":"index.mjs","names":["cache: TGlobalCache","cache","getGlobals: (name?: string) => TGlobalCache | any","setGlobals: (newValues: TGlobalCache) => void","clearGlobals: () => void","forEach: TOperation<IForEachOperationData>","when: TOperation<\n IWhenOperationData,\n Omit<IWhenOperationData, 'expression'>\n>","evaluations: Record<\n TOperator,\n (left: string | number, right: string | number) => boolean\n>","name: string","startOperations: IResolvedOperation[]","eventbus: IEventbus","operations","endOperations: IResolvedOperation[]","duration: IStrictDuration","_engine: IEligiusEngine","_eventbus: IEventbus","hotkeys","_engine: IEligiusEngine","_eventbus: IEventbus","_windowRef: Window","_localeManager: ILocaleManager","_eventbus: IEventbus","_engine: IEligiusEngine","addClass: TOperation<\n IAddClassOperationData,\n Omit<IAddClassOperationData, 'className'>\n>","controllers","addControllerToElement: TOperation<IAddControllerToElementOperationData>","addGlobalsToOperation: TOperation<\n IAddGlobalsToOperationData,\n Omit<IAddGlobalsToOperationData, 'globalProperties'>\n>","animate: TOperation<\n IAnimateOperationData,\n Omit<\n IAnimateOperationData,\n 'animationEasing' | 'animationProperties' | 'animationDuration'\n >\n>","animateWithClass: TOperation<\n IAnimateWithClassOperationData,\n Promise<IAnimateWithClassOperationData>\n>","removeClass","announceToScreenReader: TOperation<\n IAnnounceToScreenReaderOperationData,\n Omit<IAnnounceToScreenReaderOperationData, 'message' | 'priority'>\n>","breakForEach: TOperation<TOperationData>","broadcastEvent: TOperation<\n IBroadcastEventOperationData,\n Omit<IBroadcastEventOperationData, 'eventArgs' | 'eventTopic' | 'eventName'>\n>","cache: any[]","resolvePropertyChain","calcFunctions: Record<\n TCalculationOperator,\n (left: number, right: number) => number\n>","calc: TOperation<\n ICalcOperationData,\n Omit<ICalcOperationData, 'left' | 'right' | 'operator'>\n>","clearElement: TOperation<IClearElementOperationData>","clearOperationData: TOperation<\n IClearOperationDataOperationData,\n Omit<IClearOperationDataOperationData, 'properties'>\n>","clearStorage: TOperation<\n IClearStorageOperationData,\n Omit<IClearStorageOperationData, 'key' | 'storageType'>\n>","compareDate: TOperation<\n ICompareDateOperationData,\n Omit<ICompareDateOperationData, 'date1' | 'date2'>\n>","concatenateStrings: TOperation<\n IConcatenateStringsOperationData,\n Omit<IConcatenateStringsOperationData, 'strings' | 'separator'>\n>","continueForEach: TOperation<TOperationData>","createElement: TOperation<\n ICreateElementOperationData<TTagNames>,\n Omit<\n RequireKeys<ICreateElementOperationData<TTagNames>, 'template'>,\n 'elementName' | 'text' | 'attributes'\n >\n>","customFunction: TOperation<\n ICustomFunctionOperationData,\n Omit<ICustomFunctionOperationData, 'systemName'>\n>","endAction: TOperation<\n IEndActionOperationData,\n Omit<IEndActionOperationData, 'actionOperationData'>\n>","endForEach: TOperation<TOperationData>","endWhen: TOperation<Record<string, unknown>>","extendController: TOperation<\n IExtendControllerOperationData,\n Omit<IExtendControllerOperationData, 'controllerExtension'>\n>","filterArray: TOperation<\n IFilterArrayOperationData,\n Omit<\n IFilterArrayOperationData,\n 'filterProperty' | 'filterValue' | 'filterPredicate'\n >\n>","filtered: any[]","findInArray: TOperation<\n IFindInArrayOperationData,\n Omit<\n IFindInArrayOperationData,\n 'findProperty' | 'findValue' | 'findPredicate'\n >\n>","foundItem: any | undefined","formatDate: TOperation<\n IFormatDateOperationData,\n Omit<IFormatDateOperationData, 'format'>\n>","formatText: TOperation<\n IFormatTextOperationData,\n Omit<IFormatTextOperationData, 'transformation'>\n>","getAttributesFromElement: TOperation<\n IGetAttributesFromElementOperationData,\n Omit<IGetAttributesFromElementOperationData, 'attributeNames'>\n>","getControllerFromElement: TOperation<\n IGetControllerFromElementOperationData,\n Omit<IGetControllerFromElementOperationData, 'controllerName'>\n>","getControllerInstance: TOperation<\n IGetControllerInstanceOperationData,\n Omit<IGetControllerInstanceOperationData, 'systemName'>\n>","getCurrentTime: TOperation<\n IGetCurrentTimeOperationData,\n IGetCurrentTimeOperationData\n>","suffix: string | null","ratioModifier: string | null","getElementDimensions: TOperation<\n IGetElementDimensionsOperationData,\n Omit<IGetElementDimensionsOperationData, 'modifier'>\n>","getFocusedElement: TOperation<\n IGetFocusedElementOperationData,\n IGetFocusedElementOperationData\n>","getFormData: TOperation<\n IGetFormDataOperationData,\n IGetFormDataOperationData\n>","formData: Record<string, any>","getImport: TOperation<\n IGetImportOperationData,\n Omit<RequireKeys<IGetImportOperationData, 'importedInstance'>, 'systemName'>\n>","getQueryParams: TOperation<\n IGetQueryParamsOperationData,\n Omit<IGetQueryParamsOperationData, 'defaultValues'>\n>","getScrollPosition: TOperation<\n IGetScrollPositionOperationData,\n IGetScrollPositionOperationData\n>","getTextContent: TOperation<\n IGetTextContentOperationData,\n IGetTextContentOperationData\n>","httpDelete: TOperation<\n IHttpDeleteOperationData,\n Omit<IHttpDeleteOperationData, 'url' | 'headers'>\n>","httpPost: TOperation<\n IHttpPostOperationData,\n Omit<IHttpPostOperationData, 'url' | 'body' | 'headers'>\n>","httpPut: TOperation<\n IHttpPutOperationData,\n Omit<IHttpPutOperationData, 'url' | 'body' | 'headers'>\n>","invokeObjectMethod: TOperation<\n IInvokeObjectMethodOperationData,\n Omit<IInvokeObjectMethodOperationData, 'methodName' | 'methodArguments'>\n>","isElementInViewport: TOperation<\n IIsElementInViewportOperationData,\n IIsElementInViewportOperationData\n>","loadFromStorage: TOperation<\n ILoadFromStorageOperationData,\n Omit<ILoadFromStorageOperationData, 'storageType'>\n>","jsonCache: Record<string, unknown>","loadJson: TOperation<\n ILoadJSONOperationData,\n Omit<ILoadJSONOperationData, 'url' | 'cache'>\n>","cache","log: TOperation<\n ILogOperationData,\n Omit<ILogOperationData, 'logValue' | 'logName'>\n>","mapArray: TOperation<\n IMapArrayOperationData,\n Omit<IMapArrayOperationData, 'mapFunction'>\n>","math: TOperation<\n IMathOperationData,\n Omit<IMathOperationData, 'args' | 'functionName'>\n>","otherwise: TOperation<Record<string, unknown>>","removeClass: TOperation<\n IRemoveClassOperationData,\n Omit<IRemoveClassOperationData, 'className'>\n>","removeControllerFromElement: TOperation<\n IRemoveControllerFromElementOperationData,\n Omit<IRemoveControllerFromElementOperationData, 'controllerName'>\n>","controllers","removeElement: TOperation<IRemoveElementOperationData>","removePropertiesFromOperationData: TOperation<\n IRemovePropertiesFromOperationDataOperationData,\n Omit<IRemovePropertiesFromOperationDataOperationData, 'propertyNames'>\n>","reparentElement: TOperation<\n IReparentElementOperationData,\n Omit<IReparentElementOperationData, 'newParentSelector'>\n>","replaceString: TOperation<\n IReplaceStringOperationData,\n Omit<IReplaceStringOperationData, 'pattern' | 'replacement'>\n>","replaceText: TOperation<\n IReplaceTextOperationData,\n Omit<IReplaceTextOperationData, 'searchPattern' | 'replacement'>\n>","newText: string","requestAction: TOperation<\n IRequestActionOperationData,\n Omit<Required<IRequestActionOperationData>, 'systemName'>\n>","saveToStorage: TOperation<\n ISaveToStorageOperationData,\n Omit<ISaveToStorageOperationData, 'value' | 'storageType'>\n>","scrollToElement: TOperation<\n IScrollToElementOperationData,\n Omit<IScrollToElementOperationData, 'behavior' | 'block' | 'inline'>\n>","scrollToPosition: TOperation<\n IScrollToPositionOperationData,\n Omit<IScrollToPositionOperationData, 'x' | 'y' | 'behavior'>\n>","selectElement: TOperation<\n ISelectElementOperationData,\n Omit<ISelectElementOperationData, 'selector' | 'useSelectedElementAsRoot'>\n>","setData: TOperation<\n ISetDataOperationData,\n Omit<ISetDataOperationData, 'properties'>\n>","setElementAttributes: TOperation<\n ISetElementAttributesOperationData,\n Omit<ISetElementAttributesOperationData, 'attributes'>\n>","setElementContent: TOperation<\n ISetElementContentOperationData,\n Omit<ISetElementContentOperationData, 'template' | 'insertionType'>\n>","setFocus: TOperation<\n ISetFocusOperationData,\n ISetFocusOperationData\n>","setFormValue: TOperation<\n ISetFormValueOperationData,\n Omit<ISetFormValueOperationData, 'value'>\n>","setGlobalData: TOperation<\n ISetGlobalDataOperationData,\n Omit<ISetGlobalDataOperationData, 'propertyNames'>\n>","setOperationData: TOperation<\n ISetOperationData,\n Omit<ISetOperationData, 'override' | 'properties'>\n>","setStyle: TOperation<\n ISetStyleOperationData,\n Omit<ISetStyleOperationData, 'properties'>\n>","setVariable: TOperation<\n ISetVariableOperationData,\n Omit<ISetVariableOperationData, 'name' | 'value'>\n>","sortArray: TOperation<\n ISortArrayOperationData,\n Omit<ISortArrayOperationData, 'sortProperty' | 'sortOrder' | 'sortComparator'>\n>","splitString: TOperation<\n ISplitStringOperationData,\n Omit<ISplitStringOperationData, 'delimiter' | 'limit'>\n>","startAction: TOperation<\n IStartActionOperationData,\n Omit<IStartActionOperationData, 'actionOperationData'>\n>","substringText: TOperation<\n ISubstringTextOperationData,\n Omit<ISubstringTextOperationData, 'start' | 'end'>\n>","toggleClass: TOperation<\n IToggleClassOperationData,\n Omit<IToggleClassOperationData, 'className'>\n>","toggleElement: TOperation<IToggleElementOperationData>","toggleElement","toggleFormElement: TOperation<\n IToggleFormElementOperationData,\n Omit<IToggleFormElementOperationData, 'enabled'>\n>","validateForm: TOperation<\n IValidateFormOperationData,\n Omit<IValidateFormOperationData, 'validationRules'>\n>","validationErrors: Record<string, string>","wait: TOperation<\n IWaitOperationData,\n Omit<IWaitOperationData, 'milliseconds'>\n>","configurationfactory: ConfigurationFactory","factory: ActionCreatorFactory","uuidv4","operations","actionConfig: T","configurationFactory: ConfigurationFactory","operations","uuidv4","duration: IDuration","operationConfig: IOperationConfiguration<\n ExtractOperationDataType<O>\n >","actionEditor: T","DEFAULT_POSITION_SOURCES: Record<string, string>","providersSettings: TTimelineProviderSettings","configurationFactory: ConfigurationFactory","settings: ITimelineProviderSettings","providerSettings: ITimelineProviderSettings","providersSettingsEditor: TimelineProvidersSettingsEditor","configuration: IEngineConfiguration","newConfiguration: IEngineConfiguration","uuidv4","timelineConfig: ITimelineConfiguration","eventbus","eventbus","eventbus","eventbus","animationSettings: AnimationConfigWithData<'svg'>","eventbus","payload: IMutationEventPayload","eventbus","result: any[]","eventbus","eventbus","result: any[]","eventbus","subtitleTimeLookup: Record<number, () => void>","titleLanguageLookup: Record<string, string>","addClass","addControllerToElement","addGlobalsToOperation","animateWithClass","animate","announceToScreenReader","breakForEach","broadcastEvent","calc","clearElement","clearOperationData","clearStorage","compareDate","concatenateStrings","continueForEach","createElement","customFunction","endAction","endForEach","endWhen","extendController","filterArray","findInArray","forEach","formatDate","formatText","getAttributesFromElement","getControllerFromElement","getControllerInstance","getCurrentTime","getElementDimensions","getFocusedElement","getFormData","getImport","getQueryParams","getScrollPosition","getTextContent","httpDelete","httpPost","httpPut","invokeObjectMethod","isElementInViewport","loadFromStorage","loadJson","log","mapArray","math","otherwise","removeClass","removeControllerFromElement","removeElement","removePropertiesFromOperationData","reparentElement","replaceString","replaceText","requestAction","saveToStorage","scrollToElement","scrollToPosition","selectElement","setData","setElementAttributes","setElementContent","setFocus","setFormValue","setGlobalData","setOperationData","setStyle","setVariable","sortArray","splitString","startAction","substringText","toggleClass","toggleElement","toggleFormElement","validateForm","wait","when","operations","controllers","operationMetadata","result: ISubtitle[]","lines: string[]","i: number","l: number","rawLine: string","caption: Partial<ISubtitle> | null","res: string","times: string[]","parts: string[]","collection: ISubtitleCollection[]","newLanguage: ISubtitleCollection","uuidv4","importer: ISimpleResourceImporter","eventbus: IEventbus","resolvedConfig: IResolvedEngineConfiguration","eventActions: IAction[]","eventbus","DOMEventListenerController","LabelController","LottieController","MutationObserverController","NavigationController","ProgressbarController","RoutingController","SubtitlesController","requestAction","eventbus: IEventbus","uuidv4","options: {scope: string; element?: HTMLElement}","targetIndex: number","onceHandler: EventHandler<T[K]>","isSeekable","configuration: IResolvedEngineConfiguration","eventbus: IEventbus","timelineProviders: Record<TimelineTypes, ITimelineProviderInfo>","localeManager: ILocaleManager","operations: Record<string, TOperation<any>>","ops","controllers: Record<string, any>","ctrls","providers: Record<string, any>","prvdrs","eventbus: Record<string, any>","evtb","requiredVars: string[]","match: RegExpExecArray | null","current: unknown","actionRegistryListener: ActionRegistryEventbusListener | undefined","promises: Promise<ILocaleLoadResult>[]"],"sources":["../src/operation/helper/find-matching-operation-index.ts","../src/operation/helper/get-property-chain-value.ts","../src/operation/helper/deep-copy.ts","../src/operation/helper/globals.ts","../src/operation/helper/resolve-external-property-chain.ts","../src/operation/for-each.ts","../src/operation/helper/remove-operation-properties.ts","../src/operation/when.ts","../src/util/guards/is-promise.ts","../src/action/action.ts","../src/action/endable-action.ts","../src/action/timeline-action.ts","../src/adapters/engine-eventbus-adapter.ts","../src/adapters/engine-input-adapter.ts","../src/adapters/locale-eventbus-adapter.ts","../src/operation/add-class.ts","../src/operation/helper/get-element-data.ts","../src/operation/helper/attach-controller-to-element.ts","../src/operation/helper/merge-operation-data.ts","../src/operation/helper/internal-resolve.ts","../src/operation/add-controller-to-element.ts","../src/operation/add-globals-to-operation.ts","../src/operation/animate.ts","../src/operation/animate-with-class.ts","../src/operation/announce-to-screen-reader.ts","../src/operation/break-for-each.ts","../src/operation/helper/resolve-event-arguments.ts","../src/operation/broadcast-event.ts","../src/util/guards/is-object.ts","../src/operation/helper/resolve-property-values.ts","../src/operation/calc.ts","../src/operation/clear-element.ts","../src/operation/clear-operation-data.ts","../src/operation/clear-storage.ts","../src/operation/compare-date.ts","../src/operation/concatenate-strings.ts","../src/operation/continue-for-each.ts","../src/operation/create-element.ts","../src/operation/custom-function.ts","../src/operation/end-action.ts","../src/operation/end-for-each.ts","../src/operation/end-when.ts","../src/operation/extend-controller.ts","../src/operation/filter-array.ts","../src/operation/find-in-array.ts","../src/operation/format-date.ts","../src/operation/format-text.ts","../src/operation/get-attributes-from-element.ts","../src/operation/get-controller-from-element.ts","../src/operation/get-controller-instance.ts","../src/operation/get-current-time.ts","../src/operation/helper/modify-dimensions.ts","../src/operation/get-element-dimensions.ts","../src/operation/get-focused-element.ts","../src/operation/get-form-data.ts","../src/operation/get-import.ts","../src/operation/get-query-params.ts","../src/operation/get-scroll-position.ts","../src/operation/get-text-content.ts","../src/operation/http-delete.ts","../src/operation/http-post.ts","../src/operation/http-put.ts","../src/operation/invoke-object-method.ts","../src/operation/is-element-in-viewport.ts","../src/operation/load-from-storage.ts","../src/operation/load-json.ts","../src/operation/log.ts","../src/operation/map-array.ts","../src/util/guards/is-function.ts","../src/util/guards/is-string.ts","../src/operation/math.ts","../src/operation/otherwise.ts","../src/operation/remove-class.ts","../src/operation/remove-controller-from-element.ts","../src/operation/remove-element.ts","../src/operation/remove-properties-from-operation-data.ts","../src/operation/reparent-element.ts","../src/operation/replace-string.ts","../src/operation/replace-text.ts","../src/operation/request-action.ts","../src/operation/save-to-storage.ts","../src/operation/scroll-to-element.ts","../src/operation/scroll-to-position.ts","../src/operation/select-element.ts","../src/operation/set-data.ts","../src/operation/set-element-attributes.ts","../src/operation/set-element-content.ts","../src/operation/set-focus.ts","../src/operation/set-form-value.ts","../src/operation/set-global-data.ts","../src/operation/set-operation-data.ts","../src/operation/set-style.ts","../src/operation/set-variable.ts","../src/operation/sort-array.ts","../src/operation/split-string.ts","../src/operation/start-action.ts","../src/operation/substring-text.ts","../src/operation/toggle-class.ts","../src/operation/toggle-element.ts","../src/operation/toggle-form-element.ts","../src/operation/validate-form.ts","../src/operation/wait.ts","../src/operation/index.ts","../src/configuration/api/action-creator-factory.ts","../src/configuration/api/action-editor.ts","../src/configuration/api/timeline-provider-settings-editor.ts","../src/util/merge-if-missing.ts","../src/configuration/api/configuration-factory.ts","../src/controllers/dom-event-listener-controller.ts","../src/controllers/base-controller.ts","../src/controllers/label-controller.ts","../src/controllers/lottie-controller.ts","../src/controllers/mutation-observer-controller.ts","../src/controllers/navigation-controller.ts","../src/controllers/progressbar-controller.ts","../src/controllers/routing-controller.ts","../src/controllers/subtitles-controller.ts","../src/controllers/index.ts","../src/operation/metadata/add-class.ts","../src/operation/metadata/add-controller-to-element.ts","../src/operation/metadata/add-globals-to-operation.ts","../src/operation/metadata/animate-with-class.ts","../src/operation/metadata/animate.ts","../src/operation/metadata/announce-to-screen-reader.ts","../src/operation/metadata/break-for-each.ts","../src/operation/metadata/broadcast-event.ts","../src/operation/metadata/calc.ts","../src/operation/metadata/clear-element.ts","../src/operation/metadata/clear-operation-data.ts","../src/operation/metadata/clear-storage.ts","../src/operation/metadata/compare-date.ts","../src/operation/metadata/concatenate-strings.ts","../src/operation/metadata/continue-for-each.ts","../src/operation/metadata/create-element.ts","../src/operation/metadata/custom-function.ts","../src/operation/metadata/end-action.ts","../src/operation/metadata/end-for-each.ts","../src/operation/metadata/end-when.ts","../src/operation/metadata/extend-controller.ts","../src/operation/metadata/filter-array.ts","../src/operation/metadata/find-in-array.ts","../src/operation/metadata/for-each.ts","../src/operation/metadata/format-date.ts","../src/operation/metadata/format-text.ts","../src/operation/metadata/get-attributes-from-element.ts","../src/operation/metadata/get-controller-from-element.ts","../src/operation/metadata/get-controller-instance.ts","../src/operation/metadata/get-current-time.ts","../src/operation/metadata/get-element-dimensions.ts","../src/operation/metadata/get-focused-element.ts","../src/operation/metadata/get-form-data.ts","../src/operation/metadata/get-import.ts","../src/operation/metadata/get-query-params.ts","../src/operation/metadata/get-scroll-position.ts","../src/operation/metadata/get-text-content.ts","../src/operation/metadata/http-delete.ts","../src/operation/metadata/http-post.ts","../src/operation/metadata/http-put.ts","../src/operation/metadata/invoke-object-method.ts","../src/operation/metadata/is-element-in-viewport.ts","../src/operation/metadata/load-from-storage.ts","../src/operation/metadata/load-json.ts","../src/operation/metadata/log.ts","../src/operation/metadata/map-array.ts","../src/operation/metadata/math.ts","../src/operation/metadata/otherwise.ts","../src/operation/metadata/remove-class.ts","../src/operation/metadata/remove-controller-from-element.ts","../src/operation/metadata/remove-element.ts","../src/operation/metadata/remove-properties-from-operation-data.ts","../src/operation/metadata/reparent-element.ts","../src/operation/metadata/replace-string.ts","../src/operation/metadata/replace-text.ts","../src/operation/metadata/request-action.ts","../src/operation/metadata/save-to-storage.ts","../src/operation/metadata/scroll-to-element.ts","../src/operation/metadata/scroll-to-position.ts","../src/operation/metadata/select-element.ts","../src/operation/metadata/set-data.ts","../src/operation/metadata/set-element-attributes.ts","../src/operation/metadata/set-element-content.ts","../src/operation/metadata/set-focus.ts","../src/operation/metadata/set-form-value.ts","../src/operation/metadata/set-global-data.ts","../src/operation/metadata/set-operation-data.ts","../src/operation/metadata/set-style.ts","../src/operation/metadata/set-variable.ts","../src/operation/metadata/sort-array.ts","../src/operation/metadata/split-string.ts","../src/operation/metadata/start-action.ts","../src/operation/metadata/substring-text.ts","../src/operation/metadata/toggle-class.ts","../src/operation/metadata/toggle-element.ts","../src/operation/metadata/toggle-form-element.ts","../src/operation/metadata/validate-form.ts","../src/operation/metadata/wait.ts","../src/operation/metadata/when.ts","../src/operation/metadata/index.ts","../src/configuration/api/name-providers.ts","../src/configuration/api/subtitle-converter.ts","../src/configuration/api/subtitle-editor.ts","../src/operation/helper/resolve-property-chain.ts","../src/configuration/configuration-resolver.ts","../src/controllers/metadata/dom-event-listener-controller.ts","../src/controllers/metadata/label-controller.ts","../src/controllers/metadata/lottie-controller.ts","../src/controllers/metadata/mutation-observer-controller.ts","../src/controllers/metadata/navigation-controller.ts","../src/controllers/metadata/progressbar-controller.ts","../src/controllers/metadata/routing-controller.ts","../src/controllers/metadata/subtitles-controller.ts","../src/controllers/metadata/index.ts","../src/eventbus/events/metadata/before-request-timeline-uri.ts","../src/eventbus/events/metadata/before-request-video-url.ts","../src/eventbus/events/metadata/dom-mutation.ts","../src/eventbus/events/metadata/highlight-navigation.ts","../src/eventbus/events/metadata/language-change.ts","../src/eventbus/events/metadata/navigate-to-video-url.ts","../src/eventbus/events/metadata/push-history-state.ts","../src/eventbus/events/metadata/request-action.ts","../src/eventbus/events/metadata/request-current-language.ts","../src/eventbus/events/metadata/request-current-navigation.ts","../src/eventbus/events/metadata/request-current-timeline-position.ts","../src/eventbus/events/metadata/request-current-video-position.ts","../src/eventbus/events/metadata/request-engine-root.ts","../src/eventbus/events/metadata/request-function.ts","../src/eventbus/events/metadata/request-instance.ts","../src/eventbus/events/metadata/request-label-collection.ts","../src/eventbus/events/metadata/request-label-collections.ts","../src/eventbus/events/metadata/request-timeline-cleanup.ts","../src/eventbus/events/metadata/request-timeline-uri.ts","../src/eventbus/events/metadata/request-video-cleanup.ts","../src/eventbus/events/metadata/request-video-url.ts","../src/eventbus/events/metadata/timeline-complete.ts","../src/eventbus/events/metadata/timeline-container-request.ts","../src/eventbus/events/metadata/timeline-current-timeline-change.ts","../src/eventbus/events/metadata/timeline-duration-request.ts","../src/eventbus/events/metadata/timeline-duration.ts","../src/eventbus/events/metadata/timeline-firstframe.ts","../src/eventbus/events/metadata/timeline-pause-request.ts","../src/eventbus/events/metadata/timeline-pause.ts","../src/eventbus/events/metadata/timeline-play-request.ts","../src/eventbus/events/metadata/timeline-play-toggle-request.ts","../src/eventbus/events/metadata/timeline-play.ts","../src/eventbus/events/metadata/timeline-request-current-timeline.ts","../src/eventbus/events/metadata/timeline-resize-request.ts","../src/eventbus/events/metadata/timeline-resize.ts","../src/eventbus/events/metadata/timeline-restart.ts","../src/eventbus/events/metadata/timeline-seek-request.ts","../src/eventbus/events/metadata/timeline-seek.ts","../src/eventbus/events/metadata/timeline-seeked.ts","../src/eventbus/events/metadata/timeline-stop-request.ts","../src/eventbus/events/metadata/timeline-stop.ts","../src/eventbus/events/metadata/timeline-time.ts","../src/eventbus/events/metadata/video-complete.ts","../src/eventbus/events/metadata/index.ts","../src/eventbus/actionregistry-eventbus-listener.ts","../src/eventbus/eventbus.ts","../src/eventbus/request-video-uri-interceptor.ts","../src/eventbus/index.ts","../src/timelineproviders/types.ts","../src/timelineproviders/position-sources/base-position-source.ts","../src/timelineproviders/position-sources/keyboard-step-source.ts","../src/util/animation-interval.ts","../src/timelineproviders/position-sources/raf-position-source.ts","../src/timelineproviders/position-sources/scroll-position-source.ts","../src/timelineproviders/position-sources/video-position-source.ts","../src/timelineproviders/container-providers/dom-container-provider.ts","../src/timelineproviders/playlist/simple-playlist.ts","../src/timelineproviders/index.ts","../src/util/typed-event-emitter.ts","../src/eligius-engine.ts","../src/importer/eligius-resource-importer.ts","../src/locale/locale-manager.ts","../src/engine-factory.ts","../src/locale/locale-loader.ts","../src/locale/types.ts"],"sourcesContent":["import type {IResolvedOperation} from '@configuration/types.ts';\n\n/**\n * This function can be used to find the index of a matching closing operation within a list of operations.\n *\n * Assume the following array of operations:\n * ```ts\n * [\n * {systemName:'name1'}, // index 0\n * {systemName:'forEach'}, // index 1\n * {systemName:'name2'}, // index 2\n * {systemName:'forEach'} // index 3\n * {systemName:'name3'} // index 4\n * {systemName:'endForEach'} // index 5\n * {systemName:'endForEach'} // index 6\n * {systemName:'name3'} // index 7\n * ]\n * ```\n *\n * Given the `forEach` instance at index 1, this function will return index 6. Given the `forEach` at index 3, it will yield index 5.\n *\n * Returns `true` when the given `operation.systemName` equals the specified `matchingName` and the current counter value is zero.\n *\n * If the `matchingName` matches `operation.systemName` but the counter is greater than zero, the counter is decremented.\n *\n * If the `operation.systemName` equals `self` (the name of the operation that requires to find its match), then counter is incremented.\n *\n * @param this\n * @param operation\n *\n */\nexport function findMatchingOperationIndex(\n this: {counter: number; self: string; matchingName: string},\n operation: IResolvedOperation\n) {\n if (operation.systemName === this.self) {\n this.counter = this.counter + 1;\n return false;\n }\n\n if (operation.systemName === this.matchingName && this.counter === 0) {\n return true;\n }\n\n if (operation.systemName === this.matchingName && this.counter > 0) {\n this.counter = this.counter - 1;\n }\n\n return false;\n}\n","/**\n /**\n * Gets the value for the given property chain. A property chain is defined by a string array.\n *\n * For example, this property chain: `[mySource, subSource, element, value]` should be extracted from an object of this shape:\n * ```ts\n * const foo = {\n * mySource: {\n * subSource: {\n * element: {\n * value: 'bar'\n * }\n * }\n * }\n * }\n * ```\n *\n * The result of the invocation `getPropertyChainValue([mySource, subSource, element, value], foo)` would then yield the value `bar`.\n */\nexport function getPropertyChainValue(\n propertyChain: string[],\n sourceObject: Record<string, any>\n) {\n let suffix = null;\n\n const result = propertyChain.reduce((currentInstance, prop, index) => {\n if (!currentInstance) {\n throw new Error(\n `Property chain '${propertyChain.join('.')}' cannot be resolved.`\n );\n }\n\n if (index === propertyChain.length - 1) {\n const parts = prop.split('+');\n if (parts.length > 1) {\n prop = parts[0];\n suffix = parts[1];\n }\n }\n return currentInstance[prop];\n }, sourceObject);\n\n return suffix ? `${result}${suffix}` : result;\n}\n","import {isDefined} from 'ts-is-present';\n\nconst copyFunction =\n typeof structuredClone !== 'undefined'\n ? structuredClone\n : <T>(original: any) => JSON.parse(JSON.stringify(original)) as T;\n\nexport function deepCopy<T>(original: T): T {\n if (isDefined(original)) {\n return copyFunction<T>(original);\n }\n return original;\n}\n","import {deepCopy} from '@operation/helper/deep-copy.ts';\nexport type TGlobalCache = Record<string, any>;\nconst cache: TGlobalCache = {};\n\nfunction _getGlobals(\n cache: TGlobalCache,\n name?: string\n): Record<string, any> | any {\n const value = name ? cache[name] : cache;\n return value && value !== cache ? deepCopy(value) : value;\n}\n\nfunction _setGlobals(cache: TGlobalCache, newValues: TGlobalCache): void {\n Object.entries(newValues).forEach(([name, value]) => (cache[name] = value));\n}\n\nfunction _clearGlobals(cache: TGlobalCache): void {\n const keys = Object.keys(cache);\n keys.forEach(key => delete cache[key]);\n}\n\nexport const getGlobals: (name?: string) => TGlobalCache | any =\n _getGlobals.bind(null, cache);\n\nexport const setGlobals: (newValues: TGlobalCache) => void = _setGlobals.bind(\n null,\n cache\n);\n\nexport const clearGlobals: () => void = _clearGlobals.bind(null, cache);\n","import {getPropertyChainValue} from '@operation/helper/get-property-chain-value.ts';\nimport {getGlobals} from '@operation/helper/globals.ts';\nimport type {IOperationScope, TOperationData} from '@operation/types.ts';\n\n/**\n * Resolves operation and global data property chains.\n *\n * An operation data property chain is designated by a `operationdata.` suffix, followed by an arbitrary property chain.\n * For global data the suffix should be `globaldata.`\n *\n * If the propertyChainOrRegularObject is not a property chain, this value is returned instead.\n */\nexport function resolveExternalPropertyChain(\n sourceObject: TOperationData,\n operationScope: IOperationScope,\n propertyChainOrRegularObject:\n | ExternalProperty\n | Record<string, any>\n | null\n | undefined\n) {\n if (\n propertyChainOrRegularObject === null ||\n propertyChainOrRegularObject === undefined\n ) {\n return null;\n }\n\n if (isExternalProperty(propertyChainOrRegularObject)) {\n const propNames = propertyChainOrRegularObject.split('.');\n const prefix = propNames.shift()!.toLowerCase();\n switch (prefix) {\n case '$operationdata':\n return getPropertyChainValue(propNames, sourceObject);\n case '$globaldata':\n return getPropertyChainValue(propNames, getGlobals());\n case '$scope':\n return getPropertyChainValue(propNames, operationScope);\n }\n }\n\n return propertyChainOrRegularObject;\n}\n\nexport function isExternalProperty(\n value: ExternalProperty | Record<string, any>\n): value is ExternalProperty {\n return (\n typeof value === 'string' &&\n (value.toLocaleLowerCase().startsWith('$operationdata.') ||\n value.toLocaleLowerCase().startsWith('$globaldata.') ||\n value.toLocaleLowerCase().startsWith('$scope.'))\n );\n}\n\nexport type ExternalProperty =\n | `$operationdata.${string}`\n | `$globaldata.${string}`\n | `$scope.${string}`;\n","import type {breakForEach} from '@operation/break-for-each.ts';\nimport type {continueForEach} from '@operation/continue-for-each.ts';\nimport {findMatchingOperationIndex} from '@operation/helper/find-matching-operation-index.ts';\nimport {\n type ExternalProperty,\n resolveExternalPropertyChain,\n} from '@operation/helper/resolve-external-property-chain.ts';\nimport type {IOperationScope, TOperation} from '@operation/types.ts';\n\nexport interface IForEachOperationData {\n /**\n * @type=ParameterType:array|ParameterType:string\n * @required\n */\n collection: unknown[] | string;\n}\n\n/**\n * This operation iterates over the given collection.\n *\n * Each iteration the current item from the specified collection is\n * assigned to the {@link IOperationScope.currentItem|currentItem} property on the {@link IOperationScope|operation scope}.\n *\n * At the start of the loop, the associated {@link endForEach} operation is determined and when\n * the last iteration is completed the flow control is set to the index of that operation.\n *\n * The {@link continueForEach|continue} and {@link breakForEach|break} operations can be used to control the\n * loop iterations.\n *\n * @category Control Flow\n */\nexport const forEach: TOperation<IForEachOperationData> = function (\n operationData: IForEachOperationData\n) {\n const {collection} = operationData;\n const resolvedCollection =\n typeof collection === 'string'\n ? (resolveExternalPropertyChain(\n operationData,\n this,\n collection as ExternalProperty\n ) as any[])\n : collection;\n\n if (\n resolvedCollection !== null &&\n resolvedCollection !== undefined &&\n !Array.isArray(resolvedCollection)\n ) {\n throw new Error(\n 'Expected resolved collection property to be array type, string value was probably not resolved correctly'\n );\n }\n\n // First iteration of the loop\n if (this.loopIndex === undefined) {\n this.loopEndIndex = findEndForEachIndex(this);\n if (resolvedCollection?.length) {\n this.loopIndex = 0;\n this.loopLength = resolvedCollection.length - 1;\n this.loopStartIndex = this.currentIndex;\n } else {\n this.newIndex = this.loopEndIndex;\n\n delete this.loopIndex;\n delete this.loopLength;\n delete this.loopStartIndex;\n delete this.loopEndIndex;\n }\n }\n\n if (resolvedCollection?.length && this.loopIndex !== undefined) {\n this.currentItem = resolvedCollection[this.loopIndex];\n }\n\n return operationData;\n};\n\nfunction findEndForEachIndex(scope: IOperationScope) {\n const currentIndex = scope.currentIndex + 1;\n const list = scope.operations.slice(currentIndex);\n\n const index = list.findIndex(\n findMatchingOperationIndex.bind({\n counter: 0,\n self: forEachSystemName,\n matchingName: endForEachSystemName,\n })\n );\n const endLoopIndex =\n index > -1 ? index + currentIndex : scope.operations.length;\n\n return endLoopIndex;\n}\n\nexport const forEachSystemName = 'forEach';\nexport const endForEachSystemName = 'endForEach';\n","/**\n * Removes specified properties from an operation data object.\n * This is a helper function to eliminate repetitive property deletion code across operations.\n *\n * @template T - The type of the operation data object\n * @template K - The keys to remove from the object (must be keys of T)\n * @param operationData - The operation data object to mutate\n * @param keys - The property keys to delete from the object\n * @returns The mutated operation data object with specified properties removed (typed as Omit<T, K>)\n *\n * @example\n * ```typescript\n * interface IMyOperationData {\n * selectedElement: JQuery;\n * animationDuration: number;\n * animationEasing: string;\n * }\n *\n * const data: IMyOperationData = {\n * selectedElement: $element,\n * animationDuration: 500,\n * animationEasing: 'ease-in'\n * };\n *\n * // Remove multiple properties at once\n * const result = removeProperties(data, 'animationDuration', 'animationEasing');\n * // result is typed as Omit<IMyOperationData, 'animationDuration' | 'animationEasing'>\n * // result = { selectedElement: $element }\n * ```\n */\nexport function removeProperties<T extends object, K extends keyof T>(\n operationData: T,\n ...keys: K[]\n): Omit<T, K> {\n for (const key of keys) {\n delete (operationData as any)[key];\n }\n return operationData as Omit<T, K>;\n}\n","import {findMatchingOperationIndex} from '@operation/helper/find-matching-operation-index.ts';\nimport {removeProperties} from '@operation/helper/remove-operation-properties.ts';\nimport {\n type ExternalProperty,\n resolveExternalPropertyChain,\n} from '@operation/helper/resolve-external-property-chain.ts';\nimport type {IOperationScope, TOperation} from '@operation/types.ts';\n\ntype TOperator = '!=' | '==' | '>=' | '<=' | '>' | '<';\ntype TValue =\n | `'${string}'`\n | number\n | `$operationdata.${string}`\n | `$globaldata.${string}`\n | `$scope.${string}`;\n\ntype TExpression = `${TValue}${TOperator}${TValue}`;\n\nexport interface IWhenOperationData {\n /**\n * @type=ParameterType:expression\n * @required\n * @erased\n */\n expression: TExpression;\n}\n\n/**\n * When the given expression evaluates to false, subsequent operations will be skipped\n * until an {@link endWhen} or {@link otherwise} operation is encountered.\n *\n * Practically, this means an `if` or `if`/`else` statement control flow implementation in a list of operations.\n *\n * The expression is passed in as a formatted string.\n * The left and right values of the expression can be defined like this:\n *\n * 'constant': for a constant string\n * 100: for a constant number\n * $operationData.foo: for an operation data value\n * $globaldata.foo: for a global data value\n * $scope.loopIndex: for a scope value\n * @foo: for a variable value\n *\n * @example\n * $scope.variables.foo=='bar'\n * @example\n * $globalData.foo>$scope.variables.bar\n * @example\n * $operationData.foo!=100\n *\n * @param operationData\n * @returns\n *\n * @category Control Flow\n */\nexport const when: TOperation<\n IWhenOperationData,\n Omit<IWhenOperationData, 'expression'>\n> = function (operationData: IWhenOperationData) {\n const [left, operator, right] = parseExpression(\n operationData.expression,\n operationData,\n this\n );\n\n removeProperties(operationData, 'expression');\n\n this.whenEvaluation = evaluations[operator](left, right);\n\n if (!this.whenEvaluation) {\n this.newIndex = findNextFlowControlIndex(this);\n }\n\n return operationData;\n};\n\nfunction parseExpression(\n expression: TExpression,\n operationData: IWhenOperationData,\n operationScope: IOperationScope\n): [TValue, TOperator, TValue] {\n const [left, right] = expression.split(/!=|==|>=|<=|>|</);\n\n const operator = expression.substring(\n left.length,\n expression.length - right.length\n ) as TOperator;\n\n const leftNr = parseFloat(left);\n const rightNr = parseFloat(right);\n\n return [\n (Number.isNaN(leftNr)\n ? resolveExternalPropertyChain(\n operationData,\n operationScope,\n left as ExternalProperty\n )\n : leftNr) as TValue,\n operator,\n (Number.isNaN(rightNr)\n ? resolveExternalPropertyChain(\n operationData,\n operationScope,\n right as ExternalProperty\n )\n : rightNr) as TValue,\n ];\n}\n\nconst evaluations: Record<\n TOperator,\n (left: string | number, right: string | number) => boolean\n> = {\n '==': (left: string | number, right: string | number) => left === right,\n '!=': (left: string | number, right: string | number) => left !== right,\n '>=': (left: string | number, right: string | number) => left >= right,\n '<=': (left: string | number, right: string | number) => left <= right,\n '>': (left: string | number, right: string | number) => left > right,\n '<': (left: string | number, right: string | number) => left < right,\n};\n\nfunction findNextFlowControlIndex(scope: IOperationScope) {\n const currentIndex = scope.currentIndex + 1;\n const list = scope.operations.slice(currentIndex);\n\n const otherWiseIndex = list.findIndex(\n findMatchingOperationIndex.bind({\n counter: 0,\n self: whenSystemName,\n matchingName: otherwiseSystemName,\n })\n );\n if (otherWiseIndex > -1) {\n return otherWiseIndex + currentIndex;\n }\n\n const endWhenIndex = list.findIndex(\n findMatchingOperationIndex.bind({\n counter: 0,\n self: whenSystemName,\n matchingName: endWhenSystemName,\n })\n );\n\n return endWhenIndex > -1\n ? endWhenIndex + currentIndex\n : scope.operations.length;\n}\n\nexport const whenSystemName = 'when';\nexport const otherwiseSystemName = 'otherwise';\nexport const endWhenSystemName = 'endWhen';\n","export function isPromise(obj: any): obj is Promise<unknown> {\n return typeof obj === 'object' && typeof obj.then === 'function';\n}\n","import type {IAction} from '@action/types.ts';\nimport type {IResolvedOperation} from '@configuration/types.ts';\nimport type {IEventbus} from '@eventbus/types.ts';\nimport {endForEachSystemName, forEachSystemName} from '@operation/for-each.ts';\nimport {deepCopy} from '@operation/helper/deep-copy.ts';\nimport type {IOperationScope, TOperationData} from '@operation/types.ts';\nimport {endWhenSystemName, whenSystemName} from '@operation/when.ts';\nimport {isPromise} from '@util/guards/is-promise.ts';\n\nexport class Action implements IAction {\n public id = '';\n protected _scopeStack: IOperationScope[] = [];\n\n constructor(\n public name: string,\n public startOperations: IResolvedOperation[],\n protected eventbus: IEventbus\n ) {}\n\n start(initOperationData?: TOperationData): Promise<TOperationData> {\n this._initializeScopeStack();\n\n return new Promise<TOperationData>((resolve, reject) => {\n this.executeOperation(\n this.startOperations,\n 0,\n resolve,\n reject,\n initOperationData\n );\n }).catch(e => {\n console.error(`Error in action start '${this.name}'`);\n console.error(e);\n throw e;\n });\n }\n\n protected _initializeScopeStack() {\n this._scopeStack = [\n {\n currentIndex: -1,\n eventbus: this.eventbus,\n operations: this.startOperations,\n },\n ];\n }\n\n private _pushScope(parentScope: IOperationScope): IOperationScope {\n const newScope = {\n get currentIndex() {\n return parentScope.currentIndex;\n },\n set currentIndex(value: number) {\n parentScope.currentIndex = value;\n },\n get eventbus() {\n return parentScope.eventbus;\n },\n get operations() {\n return parentScope.operations;\n },\n parent: parentScope,\n };\n this._scopeStack.push(newScope);\n return newScope;\n }\n\n private _popScope() {\n this._scopeStack.pop();\n }\n\n executeOperation(\n operations: IResolvedOperation[],\n operationIndex: number,\n resolve: (value?: any | PromiseLike<any>) => void,\n reject: (reason?: any) => void,\n previousOperationData: TOperationData | undefined = {}\n ): void {\n let scope = this._scopeStack[this._scopeStack.length - 1];\n if (scope.newIndex !== undefined) {\n operationIndex = scope.newIndex;\n delete scope.newIndex;\n }\n\n scope.currentIndex = operationIndex;\n\n if (operationIndex < operations.length) {\n const operationInfo = operations[operationIndex];\n\n const copy = deepCopy(operationInfo.operationData ?? {});\n\n const mergedOperationData = Object.assign(previousOperationData, copy);\n\n if (operationInfo.systemName === whenSystemName) {\n scope = this._pushScope(scope);\n } else if (\n operationInfo.systemName === forEachSystemName &&\n scope.owner !== operationInfo\n ) {\n scope = this._pushScope(scope);\n scope.owner = operationInfo;\n }\n\n const operationResult = operationInfo.instance.call(\n scope,\n mergedOperationData\n );\n\n if (\n operationInfo.systemName === endWhenSystemName ||\n (operationInfo.systemName === endForEachSystemName &&\n scope.newIndex === undefined)\n ) {\n this._popScope();\n }\n\n if (isPromise(operationResult)) {\n operationResult\n .then(promisedOperationResult =>\n this.executeOperation(\n operations,\n ++operationIndex,\n resolve,\n reject,\n promisedOperationResult as TOperationData\n )\n )\n .catch((error: any) => {\n reject(error);\n });\n } else {\n this.executeOperation(\n operations,\n ++operationIndex,\n resolve,\n reject,\n operationResult\n );\n }\n } else {\n resolve(previousOperationData);\n }\n }\n}\n","import {Action} from '@action/action.ts';\nimport type {IResolvedOperation} from '@configuration/types.ts';\nimport type {IEventbus} from '@eventbus/types.ts';\nimport type {TOperationData} from '@operation/types.ts';\n\nexport class EndableAction extends Action {\n constructor(\n name: string,\n startOperations: IResolvedOperation[],\n public endOperations: IResolvedOperation[],\n eventBus: IEventbus\n ) {\n super(name, startOperations, eventBus);\n }\n\n end(initOperationData?: TOperationData): Promise<TOperationData> {\n if (!this.endOperations.length) {\n return Promise.resolve(initOperationData ?? {});\n }\n\n this._initializeScopeStack();\n\n return new Promise<TOperationData>((resolve, reject) => {\n this.executeOperation(\n this.endOperations,\n 0,\n resolve,\n reject,\n initOperationData\n );\n }).catch(e => {\n console.error(`Error in action end '${this.name}'`);\n throw e;\n });\n }\n}\n","import {EndableAction} from '@action/endable-action.ts';\nimport type {ITimelineAction} from '@action/types.ts';\nimport type {IResolvedOperation} from '@configuration/types.ts';\nimport type {IEventbus} from '@eventbus/types.ts';\nimport type {TOperationData} from '@operation/types.ts';\nimport type {IStrictDuration} from '../types.ts';\n\nexport class TimelineAction extends EndableAction implements ITimelineAction {\n private _active: boolean = false;\n public get active() {\n return this._active;\n }\n\n constructor(\n name: string,\n startOperations: IResolvedOperation[],\n endOperations: IResolvedOperation[],\n public duration: IStrictDuration,\n eventBus: IEventbus\n ) {\n super(name, startOperations, endOperations, eventBus);\n }\n\n start(initOperationData?: TOperationData): Promise<TOperationData> {\n if (!this.active) {\n this._active = Boolean(this.endOperations.length);\n return super.start(initOperationData);\n }\n\n return Promise.resolve({});\n }\n\n end(initOperationData: TOperationData): Promise<TOperationData> {\n return super.end(initOperationData).then(result => {\n this._active = false;\n return result;\n });\n }\n}\n","import type {EventName, IEventbus, TEventbusRemover} from '@eventbus/types.ts';\nimport type {EngineEvents, IEligiusEngine} from '../types.ts';\nimport type {IAdapter} from './types.ts';\n\n/**\n * Bridges EligiusEngine to/from the eventbus.\n *\n * This adapter:\n * - Forwards engine events to eventbus broadcasts\n * - Forwards eventbus commands to engine methods\n * - Handles eventbus state queries by reading engine properties\n */\nexport class EngineEventbusAdapter implements IAdapter {\n private _engineEventRemovers: Array<() => void> = [];\n private _eventbusRemovers: TEventbusRemover[] = [];\n\n constructor(\n private _engine: IEligiusEngine,\n private _eventbus: IEventbus\n ) {}\n\n /**\n * Connect adapter - start listening and forwarding\n */\n connect(): void {\n this._subscribeToEngineEvents();\n this._subscribeToEventbusEvents();\n }\n\n /**\n * Disconnect adapter - stop all listeners\n */\n disconnect(): void {\n this._engineEventRemovers.forEach(remove => remove());\n this._engineEventRemovers = [];\n\n this._eventbusRemovers.forEach(remove => remove());\n this._eventbusRemovers = [];\n }\n\n // ─────────────────────────────────────────────────────────────────────────\n // Engine Events → Eventbus Broadcasts\n // ─────────────────────────────────────────────────────────────────────────\n\n private _subscribeToEngineEvents(): void {\n this._onEngineEvent('start', () => {\n this._eventbus.broadcast('timeline-play', []);\n });\n\n this._onEngineEvent('pause', () => {\n this._eventbus.broadcast('timeline-pause', []);\n });\n\n this._onEngineEvent('stop', () => {\n this._eventbus.broadcast('timeline-stop', []);\n });\n\n this._onEngineEvent('time', (position: number) => {\n this._eventbus.broadcast('timeline-time', [position]);\n });\n\n this._onEngineEvent('duration', (duration: number) => {\n this._eventbus.broadcast('timeline-duration', [() => duration]);\n });\n\n this._onEngineEvent(\n 'seekStart',\n (target: number, current: number, duration: number) => {\n this._eventbus.broadcast('timeline-seek', [target, current, duration]);\n }\n );\n\n this._onEngineEvent(\n 'seekComplete',\n (position: number, duration: number) => {\n this._eventbus.broadcast('timeline-seeked', [position, duration]);\n }\n );\n\n this._onEngineEvent('timelineChange', (uri: string) => {\n this._eventbus.broadcast('timeline-current-timeline-change', [uri]);\n });\n\n this._onEngineEvent('timelineComplete', () => {\n this._eventbus.broadcast('timeline-complete', []);\n });\n\n this._onEngineEvent('timelineFirstFrame', () => {\n this._eventbus.broadcast('timeline-firstframe', []);\n });\n\n this._onEngineEvent('timelineRestart', () => {\n this._eventbus.broadcast('timeline-restart', []);\n });\n }\n\n private _onEngineEvent<K extends keyof EngineEvents>(\n event: K,\n handler: (...args: EngineEvents[K]) => void\n ): void {\n const remover = this._engine.on(event, handler);\n this._engineEventRemovers.push(remover);\n }\n\n // ─────────────────────────────────────────────────────────────────────────\n // Eventbus Commands → Engine Methods\n // ─────────────────────────────────────────────────────────────────────────\n\n private _subscribeToEventbusEvents(): void {\n // Playback commands\n this._onEventbusEvent('timeline-play-request', () => {\n this._engine.start();\n });\n\n this._onEventbusEvent('timeline-pause-request', () => {\n this._engine.pause();\n });\n\n this._onEventbusEvent('timeline-stop-request', () => {\n this._engine.stop();\n });\n\n this._onEventbusEvent('timeline-seek-request', (position: number) => {\n this._engine.seek(position);\n });\n\n this._onEventbusEvent('timeline-play-toggle-request', () => {\n if (this._engine.playState === 'playing') {\n this._engine.pause();\n } else {\n this._engine.start();\n }\n });\n\n // Timeline management\n this._onEventbusEvent(\n 'request-timeline-uri',\n (uri: string, position: number = 0) => {\n this._engine.switchTimeline(uri, position);\n }\n );\n\n // State queries - using onRequest for synchronous responses\n this._registerRequest('request-current-timeline-position', () => {\n return this._engine.position;\n });\n\n this._registerRequest('timeline-duration-request', () => {\n return this._engine.duration;\n });\n\n this._registerRequest('timeline-container-request', () => {\n return this._engine.container;\n });\n\n this._registerRequest('request-engine-root', () => {\n return this._engine.engineRoot;\n });\n\n this._registerRequest('timeline-request-current-timeline', () => {\n return this._engine.currentTimelineUri;\n });\n }\n\n private _onEventbusEvent(\n eventName: EventName,\n handler: (...args: any[]) => void\n ): void {\n const remover = this._eventbus.on(eventName, handler);\n this._eventbusRemovers.push(remover);\n }\n\n private _registerRequest<T>(\n eventName: string,\n responder: (...args: any[]) => T\n ): void {\n const remover = this._eventbus.onRequest(eventName, responder);\n this._eventbusRemovers.push(remover);\n }\n}\n","import type {IEventbus, TEventbusRemover} from '@eventbus/types.ts';\nimport hk, {type HotkeysEvent} from 'hotkeys-js';\nimport type {IEligiusEngine} from '../types.ts';\nimport type {IAdapter} from './types.ts';\n\nconst hotkeys = hk.default || hk;\n\n/**\n * Handles external input sources (hotkeys, resize).\n *\n * This adapter:\n * - Registers keyboard hotkeys (space for play/pause toggle)\n * - Handles window resize events with debouncing\n */\nexport class EngineInputAdapter implements IAdapter {\n private _removers: Array<TEventbusRemover | (() => void)> = [];\n private _resizeTimeout: ReturnType<typeof setTimeout> | undefined;\n private _resizeHandler: (() => void) | undefined;\n\n constructor(\n private _engine: IEligiusEngine,\n private _eventbus: IEventbus,\n private _windowRef: Window\n ) {}\n\n /**\n * Connect adapter - start listening to inputs\n */\n connect(): void {\n this._registerHotkeys();\n this._registerResizeHandler();\n }\n\n /**\n * Disconnect adapter - stop all listeners\n */\n disconnect(): void {\n if (this._resizeTimeout) {\n clearTimeout(this._resizeTimeout);\n this._resizeTimeout = undefined;\n }\n\n this._removers.forEach(remove => remove());\n this._removers = [];\n }\n\n // ─────────────────────────────────────────────────────────────────────────\n // Hotkey Handling\n // ─────────────────────────────────────────────────────────────────────────\n\n private _registerHotkeys(): void {\n const handleSpaceBound = this._handleSpacePress.bind(this);\n hotkeys('space', handleSpaceBound);\n this._removers.push(() => hotkeys.unbind('space', handleSpaceBound));\n }\n\n private _handleSpacePress(\n keyboardEvent: KeyboardEvent,\n _hotkeysEvent: HotkeysEvent\n ): void | boolean {\n keyboardEvent.preventDefault();\n\n if (this._engine.playState === 'playing') {\n this._engine.pause();\n } else {\n this._engine.start();\n }\n\n return false;\n }\n\n // ─────────────────────────────────────────────────────────────────────────\n // Resize Handling\n // ─────────────────────────────────────────────────────────────────────────\n\n private _registerResizeHandler(): void {\n this._resizeHandler = this._handleResize.bind(this);\n this._windowRef.addEventListener('resize', this._resizeHandler);\n this._removers.push(() => {\n if (this._resizeHandler) {\n this._windowRef.removeEventListener('resize', this._resizeHandler);\n }\n });\n }\n\n private _handleResize(): void {\n if (this._resizeTimeout) {\n clearTimeout(this._resizeTimeout);\n this._resizeTimeout = undefined;\n }\n\n this._resizeTimeout = setTimeout(() => {\n this._eventbus.broadcast('timeline-resize', []);\n }, 200);\n }\n}\n","/**\n * LocaleEventbusAdapter - Bridges LocaleManager to/from the eventbus\n * Feature: 005-rosetta-locale-manager\n *\n * This adapter:\n * - Forwards LocaleManager events to eventbus broadcasts\n * - Forwards eventbus language commands to LocaleManager methods\n * - Handles eventbus state queries by reading LocaleManager properties\n * - Updates DOM lang attribute when locale changes\n */\n\nimport type {IAdapter} from '@adapters/types.ts';\nimport type {EventName, IEventbus, TEventbusRemover} from '@eventbus/types.ts';\nimport type {\n ILocaleManager,\n LocaleEvents,\n TLanguageCode,\n} from '@locale/types.ts';\nimport type {IEligiusEngine} from '@/types.ts';\n\n/**\n * Bridges LocaleManager to/from the eventbus.\n *\n * Note: Requires engine reference to update DOM lang attribute on locale change.\n */\nexport class LocaleEventbusAdapter implements IAdapter {\n private _localeEventRemovers: Array<() => void> = [];\n private _eventbusRemovers: TEventbusRemover[] = [];\n\n constructor(\n private _localeManager: ILocaleManager,\n private _eventbus: IEventbus,\n private _engine: IEligiusEngine\n ) {}\n\n /**\n * Connect adapter - start listening and forwarding\n */\n connect(): void {\n this._subscribeToLocaleManagerEvents();\n this._subscribeToEventbusEvents();\n }\n\n /**\n * Disconnect adapter - stop all listeners\n */\n disconnect(): void {\n this._localeEventRemovers.forEach(remove => remove());\n this._localeEventRemovers = [];\n\n this._eventbusRemovers.forEach(remove => remove());\n this._eventbusRemovers = [];\n }\n\n // ─────────────────────────────────────────────────────────────────────────\n // LocaleManager Events → Eventbus Broadcasts\n // ─────────────────────────────────────────────────────────────────────────\n\n private _subscribeToLocaleManagerEvents(): void {\n this._onLocaleEvent(\n 'change',\n (newLocale: TLanguageCode, _oldLocale: TLanguageCode) => {\n this._setRootElementLang(newLocale);\n this._eventbus.broadcast('language-change', [newLocale]);\n }\n );\n }\n\n private _onLocaleEvent<K extends keyof LocaleEvents>(\n event: K,\n handler: (...args: LocaleEvents[K]) => void\n ): void {\n const remover = this._localeManager.on(event, handler);\n this._localeEventRemovers.push(remover);\n }\n\n // ─────────────────────────────────────────────────────────────────────────\n // Eventbus Commands → LocaleManager Methods\n // ─────────────────────────────────────────────────────────────────────────\n\n private _subscribeToEventbusEvents(): void {\n // Language change command\n this._onEventbusEvent('language-change', (language: TLanguageCode) => {\n // Check if locale is available before switching\n if (!this._localeManager.availableLocales.includes(language)) {\n console.warn(\n `[LocaleEventbusAdapter] Locale '${language}' is not available. Available locales: ${this._localeManager.availableLocales.join(', ')}`\n );\n return;\n }\n\n this._localeManager.setLocale(language);\n this._setRootElementLang(language);\n });\n\n // State queries - using onRequest for synchronous responses\n this._registerRequest('request-current-language', () => {\n return this._localeManager.locale;\n });\n\n // Translation request - exposes t() method via eventbus\n this._registerRequest(\n 'request-translation',\n (key: string | string[], params?: Record<string, unknown>) => {\n return this._localeManager.t(key, params);\n }\n );\n }\n\n private _onEventbusEvent(\n eventName: EventName,\n handler: (...args: any[]) => void\n ): void {\n const remover = this._eventbus.on(eventName, handler);\n this._eventbusRemovers.push(remover);\n }\n\n private _registerRequest<T>(\n eventName: string,\n responder: (...args: any[]) => T\n ): void {\n const remover = this._eventbus.onRequest(eventName, responder);\n this._eventbusRemovers.push(remover);\n }\n\n // ─────────────────────────────────────────────────────────────────────────\n // DOM Updates\n // ─────────────────────────────────────────────────────────────────────────\n\n private _setRootElementLang(locale: TLanguageCode): void {\n const lang = this._extractPrimaryLanguage(locale);\n this._engine.engineRoot.attr('lang', lang);\n }\n\n private _extractPrimaryLanguage(locale: TLanguageCode): string {\n return locale.split('-').shift() as string;\n }\n}\n","import type {TOperation} from '@operation/types.ts';\n\nexport interface IAddClassOperationData {\n /**\n * @dependency\n */\n selectedElement: JQuery;\n /**\n * @type=ParameterType:className\n * @required\n * @erased\n */\n className: string;\n}\n\n/**\n * This operation adds the specified class name to the specified selected element.\n *\n * @category DOM\n */\nexport const addClass: TOperation<\n IAddClassOperationData,\n Omit<IAddClassOperationData, 'className'>\n> = operationData => {\n const {selectedElement, className} = operationData;\n delete (operationData as any).className;\n selectedElement.addClass(className);\n\n return operationData;\n};\n","import type {IController} from '@controllers/types.ts';\n\nconst controllersDataName = 'eligiusEngineControllers';\n\nfunction getElementData(\n name: string,\n element: JQuery\n): IController<any>[] | undefined {\n return element.data(name);\n}\n\nconst getElementControllers = getElementData.bind(null, controllersDataName);\n\nexport {getElementData, getElementControllers, controllersDataName};\n","import {\n controllersDataName,\n getElementControllers,\n} from '@operation/helper/get-element-data.ts';\n\nexport function attachControllerToElement(element: JQuery, controller: any) {\n if (!element.data(controllersDataName)) {\n element.data(controllersDataName, []);\n }\n const controllers = getElementControllers(element);\n if (controllers) {\n controllers.push(controller);\n }\n}\n","import type {TOperationData} from '@operation/types.ts';\n\nexport function mergeOperationData<T extends TOperationData>(\n operationData: T,\n newOperationData: TOperationData\n): T & TOperationData {\n return {...operationData, ...newOperationData};\n}\n","import {mergeOperationData} from '@operation/helper/merge-operation-data.ts';\nimport type {TOperationData} from '@operation/types.ts';\n\nexport function internalResolve<T extends TOperationData = TOperationData>(\n resolve: (data: T | PromiseLike<T>) => void,\n operationData: TOperationData,\n newOperationData?: TOperationData\n) {\n if (newOperationData) {\n resolve(mergeOperationData(operationData, newOperationData) as T);\n } else {\n resolve(operationData as T);\n }\n}\n","import type {IController} from '@controllers/types.ts';\nimport {attachControllerToElement} from '@operation/helper/attach-controller-to-element.ts';\nimport {internalResolve} from '@operation/helper/internal-resolve.ts';\nimport type {\n IOperationScope,\n TOperation,\n TOperationData,\n} from '@operation/types.ts';\n\nexport type IAddControllerToElementOperationData<\n T extends TOperationData = TOperationData,\n> = {\n /**\n * @dependency\n */\n selectedElement: JQuery;\n /**\n * @dependency\n */\n controllerInstance: IController<T>;\n} & T;\n\n/**\n * This operation adds the specified controller instance to the given selected element.\n *\n * @category Controller\n */\nexport const addControllerToElement: TOperation<IAddControllerToElementOperationData> =\n function <T extends TOperationData = TOperationData>(\n this: IOperationScope,\n operationData: IAddControllerToElementOperationData<T>\n ) {\n const {selectedElement, controllerInstance} = operationData;\n\n attachControllerToElement(selectedElement, controllerInstance);\n\n controllerInstance.init(operationData);\n\n const promise = controllerInstance.attach(this.eventbus);\n\n if (promise) {\n return new Promise((resolve, reject) => {\n promise.then((newOperationData: TOperationData) => {\n internalResolve(resolve, operationData, newOperationData);\n }, reject);\n });\n } else {\n return operationData;\n }\n };\n","import {getGlobals} from '@operation/helper/globals.ts';\nimport {removeProperties} from '@operation/helper/remove-operation-properties.ts';\nimport type {TOperation} from '@operation/types.ts';\n\nexport interface IAddGlobalsToOperationData {\n /**\n * The names of the global properties that will be copied onto the current operation data\n *\n * @required\n * @erased\n */\n globalProperties: string[];\n}\n\n/**\n * This operation adds the specified global property names to the current operation data.\n * It finally removes the `globalProperties` property from the current operation data.\n *\n * @category Data\n */\nexport const addGlobalsToOperation: TOperation<\n IAddGlobalsToOperationData,\n Omit<IAddGlobalsToOperationData, 'globalProperties'>\n> = (operationData: IAddGlobalsToOperationData) => {\n const {globalProperties} = operationData;\n\n const globalValues = globalProperties.reduce<Record<string, any>>(\n (prev, current) => {\n prev[current] = getGlobals(current);\n return prev;\n },\n {}\n );\n removeProperties(operationData, 'globalProperties');\n\n return Object.assign(operationData, globalValues);\n};\n","import {internalResolve} from '@operation/helper/internal-resolve.ts';\nimport {removeProperties} from '@operation/helper/remove-operation-properties.ts';\nimport type {TOperation} from '@operation/types.ts';\n\nexport interface IAnimateOperationData {\n /**\n * @type=ParameterType:boolean\n * @erased\n */\n animationEasing?: string;\n /**\n * @dependency\n */\n selectedElement: JQuery;\n /**\n * @required\n * @erased\n */\n animationProperties: Record<string, unknown>;\n /**\n * @type=ParameterType:number\n * @required\n * @erased\n */\n animationDuration: JQuery.Duration;\n}\n\n/**\n * This operation animates the specified selected element with the given [jQuery animation](https://api.jquery.com/animate/) properties, duration and easing.\n * It resolves after the animation completes.\n *\n * @param operationData\n * @returns\n *\n * @category Animation\n */\nexport const animate: TOperation<\n IAnimateOperationData,\n Omit<\n IAnimateOperationData,\n 'animationEasing' | 'animationProperties' | 'animationDuration'\n >\n> = (operationData: IAnimateOperationData) => {\n const {\n selectedElement,\n animationEasing,\n animationProperties,\n animationDuration,\n } = operationData;\n\n removeProperties(\n operationData,\n 'animationEasing',\n 'animationProperties',\n 'animationDuration'\n );\n\n const promise = new Promise<IAnimateOperationData>((resolve, reject) => {\n try {\n if (animationEasing) {\n selectedElement.animate(\n animationProperties,\n animationDuration,\n animationEasing,\n () => {\n internalResolve(resolve, {}, operationData);\n }\n );\n } else {\n selectedElement.animate(animationProperties, animationDuration, () => {\n internalResolve(resolve, {}, operationData);\n });\n }\n } catch (e) {\n reject(e);\n }\n });\n return promise;\n};\n","import {internalResolve} from '@operation/helper/internal-resolve.ts';\nimport type {TOperation} from '@operation/types.ts';\n\nexport interface IAnimateWithClassOperationData {\n /**\n * @dependency\n */\n selectedElement: JQuery;\n /**\n * @type=ParameterType:className\n * @required\n */\n className: string;\n removeClass?: boolean;\n}\n\n/**\n * This operation adds the specified class name to the specified selected element and assumes that this\n * class triggers and animation on the selected element. It then waits for this animation to complete\n * before it resolves.\n *\n * @category Animation\n */\nexport const animateWithClass: TOperation<\n IAnimateWithClassOperationData,\n Promise<IAnimateWithClassOperationData>\n> = (operationData: IAnimateWithClassOperationData) => {\n let {selectedElement, className, removeClass} = operationData;\n removeClass = removeClass !== undefined ? removeClass : true;\n\n const promise = new Promise<IAnimateWithClassOperationData>(\n (resolve, reject) => {\n try {\n selectedElement.one(\n 'webkitAnimationEnd oanimationend oAnimationEnd msAnimationEnd animationEnd',\n () => {\n if (removeClass) {\n selectedElement.removeClass(className);\n }\n internalResolve(resolve, {}, operationData);\n }\n );\n } catch (e) {\n reject(e);\n }\n }\n );\n\n selectedElement.addClass(className);\n\n return promise;\n};\n","import {removeProperties} from '@operation/helper/remove-operation-properties.ts';\nimport type {TOperation} from '@operation/types.ts';\n\nexport interface IAnnounceToScreenReaderOperationData {\n /**\n * @required\n * @erased\n */\n message: string;\n /**\n * @optional\n * @erased\n */\n priority?: 'polite' | 'assertive';\n}\n\n/**\n * Announces a message to screen readers using an ARIA live region.\n *\n * @category Accessibility\n */\nexport const announceToScreenReader: TOperation<\n IAnnounceToScreenReaderOperationData,\n Omit<IAnnounceToScreenReaderOperationData, 'message' | 'priority'>\n> = (operationData: IAnnounceToScreenReaderOperationData) => {\n const {message, priority = 'polite'} = operationData;\n\n if (!message || message.trim() === '') {\n throw new Error('announceToScreenReader: message is required');\n }\n\n // Create or get existing live region\n let liveRegion = document.getElementById('aria-live-region');\n if (!liveRegion) {\n liveRegion = document.createElement('div');\n liveRegion.id = 'aria-live-region';\n liveRegion.setAttribute('aria-live', priority);\n liveRegion.style.position = 'absolute';\n liveRegion.style.left = '-10000px';\n liveRegion.style.width = '1px';\n liveRegion.style.height = '1px';\n liveRegion.style.overflow = 'hidden';\n document.body.appendChild(liveRegion);\n } else {\n liveRegion.setAttribute('aria-live', priority);\n }\n\n liveRegion.textContent = message;\n\n removeProperties(operationData, 'message', 'priority');\n\n return operationData;\n};\n","import type {endForEach} from '@operation/end-for-each.ts';\nimport type {forEach} from '@operation/for-each.ts';\nimport type {TOperation, TOperationData} from '@operation/types.ts';\n\n/**\n *\n * This operation should only be used within a loop, so between a {@link forEach} and {@link endForEach}\n * operation. This operation immediately moves to the loop end index, effectively stopping the loop.\n *\n * @category Control Flow\n */\nexport const breakForEach: TOperation<TOperationData> = function (\n operationData: TOperationData\n) {\n if (this.loopIndex !== undefined && this.loopLength !== undefined) {\n this.newIndex = this.loopEndIndex;\n\n delete this.loopIndex;\n delete this.loopLength;\n delete this.loopStartIndex;\n delete this.loopEndIndex;\n delete this.currentItem;\n }\n return operationData;\n};\n","import {resolveExternalPropertyChain} from '@operation/helper/resolve-external-property-chain.ts';\nimport type {IOperationScope, TOperationData} from '@operation/types.ts';\n\nexport function resolveEventArguments(\n operationData: TOperationData,\n operationScope: IOperationScope,\n eventArgs?: any[]\n) {\n if (!eventArgs) {\n return;\n }\n const resolve = resolveExternalPropertyChain.bind(\n null,\n operationData,\n operationScope\n );\n return eventArgs.map(resolve);\n}\n","import type {EventName} from '@eventbus/types.ts';\nimport {removeProperties} from '@operation/helper/remove-operation-properties.ts';\nimport {resolveEventArguments} from '@operation/helper/resolve-event-arguments.ts';\nimport type {TOperation} from '@operation/types.ts';\n\nexport interface IBroadcastEventOperationData {\n /**\n * @required\n * @erased\n */\n eventArgs: unknown[];\n /**\n * @type=ParameterType:eventTopic\n * @erased\n */\n eventTopic?: string;\n /**\n * @type=ParameterType:eventName\n * @required\n * @erased\n */\n eventName: string;\n}\n\n/**\n * This operation broadcasts the given event through the eventbus, along with the\n * event arguments and optional event topic.\n *\n * @category Utility\n */\nexport const broadcastEvent: TOperation<\n IBroadcastEventOperationData,\n Omit<IBroadcastEventOperationData, 'eventArgs' | 'eventTopic' | 'eventName'>\n> = function (operationData: IBroadcastEventOperationData) {\n const {eventArgs, eventTopic, eventName} = operationData;\n\n removeProperties(operationData, 'eventArgs', 'eventTopic', 'eventName');\n\n const eventArguments = resolveEventArguments(operationData, this, eventArgs);\n if (eventTopic) {\n this.eventbus.broadcastForTopic(\n eventName as EventName,\n eventTopic,\n eventArguments as any\n );\n } else {\n this.eventbus.broadcast(eventName as EventName, eventArguments as any);\n }\n\n return operationData;\n};\n","export function isObject(\n value: unknown\n): value is Record<PropertyKey, unknown> {\n return !!value && typeof value === 'object' && !Array.isArray(value);\n}\n","import {deepCopy} from '@operation/helper/deep-copy.ts';\nimport type {ExternalProperty} from '@operation/helper/resolve-external-property-chain.ts';\nimport {\n isExternalProperty,\n resolveExternalPropertyChain,\n} from '@operation/helper/resolve-external-property-chain.ts';\nimport type {IOperationScope, TOperationData} from '@operation/types.ts';\nimport {isObject} from '@util/guards/is-object.ts';\nimport $ from 'jquery';\n\nconst cache: any[] = [];\n\n/**\n * This takes a `newProperties` instance, resolves all of the properties on this object and then\n * assigns these properties to the given operationData.\n */\nexport function resolvePropertyValues<T extends TOperationData>(\n operationData: T,\n operationScope: IOperationScope,\n newProperties: Record<string, any>\n): T {\n const copy =\n newProperties !== operationData ? deepCopy(newProperties) : newProperties;\n\n const resolvePropertyChain = resolveExternalPropertyChain.bind(\n null,\n operationData,\n operationScope\n );\n\n resolveNewProperties(newProperties, copy, resolvePropertyChain);\n\n return copy as T;\n}\n\nfunction resolveNewProperties(\n properties: Record<string, any>,\n copy: Record<string, any>,\n resolvePropertyChain: (\n propertyChain: ExternalProperty | Record<string, any>\n ) => any\n) {\n // Prevent recursive looping\n if (cache.indexOf(properties) > -1) {\n return;\n }\n\n cache.push(properties);\n\n try {\n Object.entries(properties).forEach(([key, value]) => {\n if (value instanceof $) {\n return;\n }\n\n if (isExternalProperty(value)) {\n copy[key] = resolvePropertyChain(value);\n } else if (Array.isArray(value)) {\n value.forEach((item, index, arr) => {\n if (isExternalProperty(item)) {\n arr[index] = resolvePropertyChain(item);\n } else if (isObject(item)) {\n resolveNewProperties(item, item, resolvePropertyChain);\n }\n });\n } else if (isObject(value)) {\n resolveNewProperties(value, value, resolvePropertyChain);\n } else {\n copy[key] = value;\n }\n });\n } finally {\n const index = cache.indexOf(properties);\n cache.splice(index, 1);\n }\n}\n","import {removeProperties} from '@operation/helper/remove-operation-properties.ts';\nimport {resolvePropertyValues} from '@operation/helper/resolve-property-values.ts';\nimport type {TOperation} from '@operation/types.ts';\n\nexport type TCalculationOperator = '+' | '-' | '*' | '/' | '%' | '**';\n\nexport interface ICalcOperationData {\n /**\n * The left operand\n * @type=ParameterType:number\n * @required\n * @erased\n */\n left: string | number;\n /**\n * The right operand\n * @type=ParameterType:number\n * @required\n * @erased\n */\n right: string | number;\n /**\n * @required\n * @erased\n */\n operator: TCalculationOperator;\n /**\n * @output\n */\n calculationResult?: number;\n}\n\nconst calcFunctions: Record<\n TCalculationOperator,\n (left: number, right: number) => number\n> = {\n '+': (left: number, right: number) => left + right,\n '-': (left: number, right: number) => left - right,\n '*': (left: number, right: number) => left * right,\n '/': (left: number, right: number) => left / right,\n '%': (left: number, right: number) => left % right,\n '**': (left: number, right: number) => left ** right,\n};\n\n/**\n * This operation calculates the given left and right hand operands using the specified operator.\n *\n * @param operationData\n *\n * @category Utility\n */\nexport const calc: TOperation<\n ICalcOperationData,\n Omit<ICalcOperationData, 'left' | 'right' | 'operator'>\n> = function (operationData: ICalcOperationData) {\n operationData = resolvePropertyValues(operationData, this, operationData);\n\n const {left, right, operator} = operationData;\n\n removeProperties(operationData, 'left', 'right', 'operator');\n\n operationData.calculationResult = calcFunctions[operator](+left, +right);\n\n return operationData;\n};\n","import type {TOperation} from '@operation/types.ts';\n\nexport interface IClearElementOperationData {\n /**\n * @dependency\n */\n selectedElement: JQuery;\n}\n\n/**\n * This operation removes all of the children from the given selected element.\n *\n * @category DOM\n */\nexport const clearElement: TOperation<IClearElementOperationData> = (\n operationData: IClearElementOperationData\n) => {\n const {selectedElement} = operationData;\n selectedElement.empty();\n return operationData;\n};\n","import {removeProperties} from '@operation/helper/remove-operation-properties.ts';\nimport type {TOperation} from '@operation/types.ts';\n\nexport interface IClearOperationDataOperationData {\n /**\n * @erased\n */\n properties?: string[];\n}\n\n/**\n * This operation removes all of the properties on the current operation date.\n * Or, if the `properties` property is set only removes the properties defined by that list.\n *\n * @category Data\n */\nexport const clearOperationData: TOperation<\n IClearOperationDataOperationData,\n Omit<IClearOperationDataOperationData, 'properties'>\n> = (operationData: IClearOperationDataOperationData) => {\n const {properties} = operationData;\n\n if (properties) {\n properties.forEach(name => {\n delete (operationData as any)[name];\n });\n removeProperties(operationData, 'properties');\n return operationData;\n }\n\n return {};\n};\n","import {removeProperties} from '@operation/helper/remove-operation-properties.ts';\nimport type {TOperation} from '@operation/types.ts';\n\nexport type StorageType = 'local' | 'session';\n\nexport interface IClearStorageOperationData {\n /**\n * @optional\n * @erased\n */\n key?: string;\n /**\n * @required\n * @erased\n */\n storageType: StorageType;\n}\n\n/**\n * Clears data from browser storage (localStorage or sessionStorage).\n *\n * If `key` is provided, removes only that key. If `key` is omitted, clears all storage.\n *\n * @returns Operation data with storage properties erased\n *\n * @example\n * ```typescript\n * // Clear specific key\n * const result = clearStorage({\n * key: 'user-settings',\n * storageType: 'local'\n * });\n * ```\n *\n * @example\n * ```typescript\n * // Clear all localStorage\n * const result = clearStorage({\n * storageType: 'local'\n * });\n * ```\n *\n * @category Data\n */\nexport const clearStorage: TOperation<\n IClearStorageOperationData,\n Omit<IClearStorageOperationData, 'key' | 'storageType'>\n> = (operationData: IClearStorageOperationData) => {\n const {key, storageType} = operationData;\n\n const storage = storageType === 'session' ? sessionStorage : localStorage;\n\n if (key && key.trim() !== '') {\n storage.removeItem(key);\n } else {\n storage.clear();\n }\n\n removeProperties(operationData, 'key', 'storageType');\n\n return operationData;\n};\n","import {removeProperties} from '@operation/helper/remove-operation-properties.ts';\nimport type {TOperation} from '@operation/types.ts';\n\nexport interface ICompareDateOperationData {\n /**\n * @required\n * @erased\n */\n date1: Date | string | number;\n /**\n * @required\n * @erased\n */\n date2: Date | string | number;\n /**\n * @output\n */\n comparison: number;\n /**\n * @output\n */\n isEqual: boolean;\n /**\n * @output\n */\n isBefore: boolean;\n /**\n * @output\n */\n isAfter: boolean;\n}\n\n/**\n * Compares two dates.\n * comparison: -1 (before), 0 (equal), 1 (after)\n *\n * @category Date\n */\nexport const compareDate: TOperation<\n ICompareDateOperationData,\n Omit<ICompareDateOperationData, 'date1' | 'date2'>\n> = (operationData: ICompareDateOperationData) => {\n const {date1, date2} = operationData;\n\n if (!date1 || !date2) {\n throw new Error('compareDate: both dates are required');\n }\n\n const dateObj1 = date1 instanceof Date ? date1 : new Date(date1);\n const dateObj2 = date2 instanceof Date ? date2 : new Date(date2);\n\n if (Number.isNaN(dateObj1.getTime()) || Number.isNaN(dateObj2.getTime())) {\n throw new Error('compareDate: invalid date');\n }\n\n const time1 = dateObj1.getTime();\n const time2 = dateObj2.getTime();\n\n operationData.comparison = time1 < time2 ? -1 : time1 > time2 ? 1 : 0;\n operationData.isEqual = time1 === time2;\n operationData.isBefore = time1 < time2;\n operationData.isAfter = time1 > time2;\n\n removeProperties(operationData, 'date1', 'date2');\n\n return operationData;\n};\n","import {removeProperties} from '@operation/helper/remove-operation-properties.ts';\nimport type {TOperation} from '@operation/types.ts';\n\nexport interface IConcatenateStringsOperationData {\n /**\n * @required\n * @erased\n */\n strings: string[];\n /**\n * @optional\n * @erased\n */\n separator?: string;\n /**\n * @output\n */\n result: string;\n}\n\n/**\n * Concatenates multiple strings with an optional separator.\n *\n * @returns Operation data with `result` containing the concatenated string\n *\n * @example\n * ```typescript\n * const result = concatenateStrings({\n * strings: ['Hello', 'World'],\n * separator: ' '\n * });\n * // result.result = \"Hello World\"\n * ```\n *\n * @category String\n */\nexport const concatenateStrings: TOperation<\n IConcatenateStringsOperationData,\n Omit<IConcatenateStringsOperationData, 'strings' | 'separator'>\n> = (operationData: IConcatenateStringsOperationData) => {\n const {strings, separator = ''} = operationData;\n\n if (!Array.isArray(strings)) {\n throw new Error('concatenateStrings: strings must be an array');\n }\n\n operationData.result = strings.join(separator);\n\n removeProperties(operationData, 'strings', 'separator');\n\n return operationData;\n};\n","import type {endForEach} from '@operation/end-for-each.ts';\nimport type {forEach} from '@operation/for-each.ts';\nimport type {TOperation, TOperationData} from '@operation/types.ts';\n\n/**\n *\n * This operation should only be used within a loop, so between a {@link forEach} and {@link endForEach}\n * operation. This operation immediately moves to the next loop index, effectively canceling the rest\n * of the operations in the current iteration.\n *\n * @category Control Flow\n */\nexport const continueForEach: TOperation<TOperationData> = function (\n operationData: TOperationData\n) {\n if (this.loopIndex !== undefined && this.loopLength !== undefined) {\n this.newIndex = this.loopEndIndex;\n delete this.currentItem;\n }\n return operationData;\n};\n","import {removeProperties} from '@operation/helper/remove-operation-properties.ts';\nimport {resolvePropertyValues} from '@operation/helper/resolve-property-values.ts';\nimport type {IOperationScope, TOperation} from '@operation/types.ts';\nimport $ from 'jquery';\nimport type {RequireKeys} from '@/types.ts';\n\nexport type TTagNames = keyof HTMLElementTagNameMap;\n\nexport interface ICreateElementOperationData<T extends TTagNames> {\n /**\n * @type=ParameterType:htmlElementName\n * @required\n * @erased\n */\n elementName: T;\n /**\n * @erased\n */\n text?: string;\n /**\n * @type=ParameterType:object\n * @erased\n */\n attributes?: Partial<HTMLElementTagNameMap[T]>;\n /**\n * @type=ParameterType:object\n * @output\n */\n template?: JQuery;\n}\n\n/**\n * This operation creates the DOM element described by the given elementName and attributes and assigns\n * the instance to the `template` property on the current operation data.\n *\n * @param operationData\n * @returns\n * @category DOM\n */\nexport const createElement: TOperation<\n ICreateElementOperationData<TTagNames>,\n Omit<\n RequireKeys<ICreateElementOperationData<TTagNames>, 'template'>,\n 'elementName' | 'text' | 'attributes'\n >\n> = function <T extends TTagNames>(\n this: IOperationScope,\n operationData: ICreateElementOperationData<T>\n) {\n operationData = resolvePropertyValues(operationData, this, operationData);\n\n const {elementName, attributes, text} = operationData;\n\n removeProperties(operationData, 'elementName', 'attributes', 'text');\n\n const serializedAttrs = attributes\n ? ` ${Object.entries(attributes)\n .filter(([_, value]) => Boolean(value))\n .map(([key, value]) => `${key}=\"${value}\"`)\n .join(' ')}`\n : '';\n\n const template = text\n ? $(`<${elementName}${serializedAttrs}>${text}</${elementName}>`)\n : $(`<${elementName}${serializedAttrs}/>`);\n\n operationData.template = template;\n\n return operationData as RequireKeys<\n ICreateElementOperationData<TTagNames>,\n 'template'\n >;\n};\n","import {internalResolve} from '@operation/helper/internal-resolve.ts';\nimport {removeProperties} from '@operation/helper/remove-operation-properties.ts';\nimport type {TOperation} from '@operation/types.ts';\n\nexport interface ICustomFunctionOperationData {\n /**\n * @type=ParameterType:systemName\n * @erased\n * @required\n */\n systemName: string;\n}\n\n/**\n * This operation retrieves a custom function defined by the given system name\n * and invokes it with the current operation data and eventbus.\n *\n * @param operationData\n *\n * @category Utility\n */\nexport const customFunction: TOperation<\n ICustomFunctionOperationData,\n Omit<ICustomFunctionOperationData, 'systemName'>\n> = function (operationData: ICustomFunctionOperationData) {\n const {systemName} = operationData;\n\n removeProperties(operationData, 'systemName');\n\n const func = this.eventbus.request<TOperation>(\n 'request-function',\n systemName\n );\n\n if (!func) {\n return operationData;\n }\n\n const promise = func.apply(this, [operationData]);\n if (promise) {\n return new Promise<ICustomFunctionOperationData>((resolve, reject) => {\n promise.then(() => {\n internalResolve(resolve, {}, operationData);\n }, reject);\n });\n }\n\n return operationData;\n};\n","import type {IEndableAction} from '@action/types.ts';\nimport {internalResolve} from '@operation/helper/internal-resolve.ts';\nimport {mergeOperationData} from '@operation/helper/merge-operation-data.ts';\nimport type {TOperation} from '@operation/types.ts';\n\nexport interface IEndActionOperationData {\n /**\n * @dependency\n */\n actionInstance: IEndableAction;\n /**\n * @required\n * @erased\n */\n actionOperationData: Record<string, unknown>;\n}\n\n/**\n * This operation invokes the {@link EndableAction}.end method on the specified action instance.\n *\n * The action operation data is first merged with the current operation data before it is\n * passed on to the action. After the action has completed the action operation data properties\n * are removed from the current operation data.\n *\n * @category Action\n */\nexport const endAction: TOperation<\n IEndActionOperationData,\n Omit<IEndActionOperationData, 'actionOperationData'>\n> = (operationData: IEndActionOperationData) => {\n let {actionOperationData, ...newOperationData} = operationData;\n\n return new Promise<IEndActionOperationData>((resolve, reject) => {\n newOperationData = mergeOperationData(\n newOperationData,\n actionOperationData\n );\n\n newOperationData.actionInstance.end(newOperationData).then(() => {\n const sanitizedData = Object.keys(newOperationData)\n .filter(key => !(key in actionOperationData))\n .reduce(\n (acc, key) => {\n (acc as any)[key] = (newOperationData as any)[key];\n return acc;\n },\n {} as typeof newOperationData\n );\n internalResolve(resolve, sanitizedData);\n }, reject);\n });\n};\n","import type {TOperation, TOperationData} from '@operation/types.ts';\n\n/**\n * This operation checks if the current loop should end or start the next iteration.\n *\n * @category Control Flow\n */\nexport const endForEach: TOperation<TOperationData> = function (\n operationData: TOperationData\n) {\n if (\n this.loopIndex !== undefined &&\n this.loopLength !== undefined &&\n this.loopIndex < this.loopLength\n ) {\n this.loopIndex = this.loopIndex + 1;\n this.newIndex = this.loopStartIndex;\n delete this.currentItem;\n }\n\n return operationData;\n};\n","import type {TOperation} from '@operation/types.ts';\n\n/**\n * This operation cleans up after the {@link when}/{@link otherwise}/{@link endWhen} control flow ends.\n *\n * @category Control Flow\n */\nexport const endWhen: TOperation<Record<string, unknown>> = function (\n operationData: Record<string, unknown>\n) {\n delete this.whenEvaluation;\n return operationData;\n};\n","import type {IController} from '@controllers/types.ts';\nimport {removeProperties} from '@operation/helper/remove-operation-properties.ts';\nimport type {TOperation, TOperationData} from '@operation/types.ts';\n\n/**\n * This operation extends the specified controller instance with the specified extension.\n */\nexport interface IExtendControllerOperationData {\n /**\n * @dependency\n */\n controllerInstance: IController<TOperationData>;\n /**\n * @erased\n * @required\n */\n controllerExtension: Record<PropertyKey, unknown>;\n}\n\n/**\n * Extends the current controller with given extension.\n *\n * @category Controller\n */\nexport const extendController: TOperation<\n IExtendControllerOperationData,\n Omit<IExtendControllerOperationData, 'controllerExtension'>\n> = (operationData: IExtendControllerOperationData) => {\n const {controllerInstance, controllerExtension} = operationData;\n\n removeProperties(operationData, 'controllerExtension');\n\n operationData.controllerInstance = Object.assign(\n controllerInstance,\n controllerExtension\n );\n\n return operationData;\n};\n","import {removeProperties} from '@operation/helper/remove-operation-properties.ts';\nimport type {TOperation} from '@operation/types.ts';\n\nexport interface IFilterArrayOperationData {\n /**\n * @required\n * @dependency\n */\n arrayData: any[];\n /**\n * @optional\n * @erased\n */\n filterProperty?: string;\n /**\n * @optional\n * @erased\n */\n filterValue?: any;\n /**\n * @optional\n * @erased\n */\n filterPredicate?: (item: any, index?: number) => boolean;\n /**\n * @output\n */\n filteredArray: any[];\n}\n\n/**\n * Filters an array based on property equality or custom predicate function.\n *\n * Operates on arrayData passed from previous operations.\n * Supports two filtering modes:\n * 1. Property equality: `filterProperty` and `filterValue` to filter by property match\n * 2. Custom predicate: `filterPredicate` function for complex filtering logic\n *\n * @returns Operation data with `filteredArray` containing filtered results\n *\n * @example\n * ```typescript\n * // Filter by property equality\n * const result = filterArray({\n * arrayData: [{name: 'Alice', age: 25}, {name: 'Bob', age: 30}],\n * filterProperty: 'age',\n * filterValue: 25\n * });\n * // result.filteredArray = [{name: 'Alice', age: 25}]\n * ```\n *\n * @example\n * ```typescript\n * // Filter with custom predicate\n * const result = filterArray({\n * arrayData: [1, 2, 3, 4, 5],\n * filterPredicate: (item) => item % 2 === 0\n * });\n * // result.filteredArray = [2, 4]\n * ```\n *\n * @category Array\n */\nexport const filterArray: TOperation<\n IFilterArrayOperationData,\n Omit<\n IFilterArrayOperationData,\n 'filterProperty' | 'filterValue' | 'filterPredicate'\n >\n> = (operationData: IFilterArrayOperationData) => {\n const {arrayData, filterProperty, filterValue, filterPredicate} =\n operationData;\n\n if (!Array.isArray(arrayData)) {\n throw new Error('filterArray: arrayData is required and must be an array');\n }\n\n if (!filterPredicate && (!filterProperty || filterValue === undefined)) {\n throw new Error(\n 'filterArray: filterProperty/filterValue or filterPredicate is required'\n );\n }\n\n let filtered: any[];\n\n if (filterPredicate) {\n filtered = arrayData.filter(filterPredicate);\n } else {\n filtered = arrayData.filter(item => {\n if (typeof item === 'object' && item !== null) {\n return item[filterProperty!] === filterValue;\n }\n return false;\n });\n }\n\n operationData.filteredArray = filtered;\n\n removeProperties(\n operationData,\n 'filterProperty',\n 'filterValue',\n 'filterPredicate'\n );\n\n return operationData;\n};\n","import {removeProperties} from '@operation/helper/remove-operation-properties.ts';\nimport type {TOperation} from '@operation/types.ts';\n\nexport interface IFindInArrayOperationData {\n /**\n * @required\n * @dependency\n */\n arrayData: any[];\n /**\n * @optional\n * @erased\n */\n findProperty?: string;\n /**\n * @optional\n * @erased\n */\n findValue?: any;\n /**\n * @optional\n * @erased\n */\n findPredicate?: (item: any, index?: number) => boolean;\n /**\n * @output\n */\n foundItem: any | undefined;\n /**\n * @output\n */\n foundIndex: number;\n}\n\n/**\n * Finds the first element in an array matching criteria.\n *\n * Operates on arrayData passed from previous operations.\n * Supports two search modes:\n * 1. Property equality: `findProperty` and `findValue` to find by property match\n * 2. Custom predicate: `findPredicate` function for complex search logic\n *\n * Returns `undefined` for `foundItem` and `-1` for `foundIndex` if no match found.\n *\n * @returns Operation data with `foundItem` (the matching element) and `foundIndex` (its position)\n *\n * @example\n * ```typescript\n * // Find by property equality\n * const result = findInArray({\n * arrayData: [{id: 1, name: 'Alice'}, {id: 2, name: 'Bob'}],\n * findProperty: 'id',\n * findValue: 2\n * });\n * // result.foundItem = {id: 2, name: 'Bob'}\n * // result.foundIndex = 1\n * ```\n *\n * @example\n * ```typescript\n * // Find with custom predicate\n * const result = findInArray({\n * arrayData: [10, 25, 30, 45],\n * findPredicate: (item) => item > 30\n * });\n * // result.foundItem = 45\n * // result.foundIndex = 3\n * ```\n *\n * @category Array\n */\nexport const findInArray: TOperation<\n IFindInArrayOperationData,\n Omit<\n IFindInArrayOperationData,\n 'findProperty' | 'findValue' | 'findPredicate'\n >\n> = (operationData: IFindInArrayOperationData) => {\n const {arrayData, findProperty, findValue, findPredicate} = operationData;\n\n if (!Array.isArray(arrayData)) {\n throw new Error('findInArray: arrayData is required and must be an array');\n }\n\n if (!findPredicate && (!findProperty || findValue === undefined)) {\n throw new Error(\n 'findInArray: findProperty/findValue or findPredicate is required'\n );\n }\n\n let foundItem: any | undefined;\n let foundIndex = -1;\n\n if (findPredicate) {\n foundIndex = arrayData.findIndex(findPredicate);\n foundItem = foundIndex !== -1 ? arrayData[foundIndex] : undefined;\n } else {\n foundIndex = arrayData.findIndex(item => {\n if (typeof item === 'object' && item !== null) {\n return item[findProperty!] === findValue;\n }\n return item === findValue;\n });\n foundItem = foundIndex !== -1 ? arrayData[foundIndex] : undefined;\n }\n\n operationData.foundItem = foundItem;\n operationData.foundIndex = foundIndex;\n\n removeProperties(operationData, 'findProperty', 'findValue', 'findPredicate');\n\n return operationData;\n};\n","import {removeProperties} from '@operation/helper/remove-operation-properties.ts';\nimport type {TOperation} from '@operation/types.ts';\n\nexport interface IFormatDateOperationData {\n /**\n * @required\n * @dependency\n */\n date: Date | string | number;\n /**\n * @required\n * @erased\n */\n format: string;\n /**\n * @output\n */\n formattedDate: string;\n}\n\n/**\n * Formats a date using Intl.DateTimeFormat or simple patterns.\n *\n * @category Date\n */\nexport const formatDate: TOperation<\n IFormatDateOperationData,\n Omit<IFormatDateOperationData, 'format'>\n> = (operationData: IFormatDateOperationData) => {\n const {date, format} = operationData;\n\n if (!date) {\n throw new Error('formatDate: date is required');\n }\n\n const dateObj = date instanceof Date ? date : new Date(date);\n\n if (Number.isNaN(dateObj.getTime())) {\n throw new Error('formatDate: invalid date');\n }\n\n // Simple format patterns\n const year = dateObj.getFullYear();\n const month = String(dateObj.getMonth() + 1).padStart(2, '0');\n const day = String(dateObj.getDate()).padStart(2, '0');\n const hours = String(dateObj.getHours()).padStart(2, '0');\n const minutes = String(dateObj.getMinutes()).padStart(2, '0');\n const seconds = String(dateObj.getSeconds()).padStart(2, '0');\n\n let formatted = format;\n formatted = formatted.replace('YYYY', String(year));\n formatted = formatted.replace('MM', month);\n formatted = formatted.replace('DD', day);\n formatted = formatted.replace('HH', hours);\n formatted = formatted.replace('mm', minutes);\n formatted = formatted.replace('ss', seconds);\n\n operationData.formattedDate = formatted;\n\n removeProperties(operationData, 'format');\n\n return operationData;\n};\n","import {removeProperties} from '@operation/helper/remove-operation-properties.ts';\nimport type {TOperation} from '@operation/types.ts';\n\nexport type TextTransformation =\n | 'uppercase'\n | 'lowercase'\n | 'capitalize'\n | 'titlecase'\n | 'trim';\n\nexport interface IFormatTextOperationData {\n /**\n * @required\n * @dependency\n */\n textContent: string;\n /**\n * @required\n * @erased\n */\n transformation: TextTransformation;\n /**\n * @output\n */\n formattedText: string;\n}\n\n/**\n * Transforms text using format operations: uppercase, lowercase, capitalize, titlecase, or trim.\n *\n * Operates on textContent passed from previous operations (e.g., getTextContent).\n *\n * Transformations:\n * - `uppercase`: Convert all characters to uppercase\n * - `lowercase`: Convert all characters to lowercase\n * - `capitalize`: Capitalize only the first letter\n * - `titlecase`: Capitalize first letter of each word\n * - `trim`: Remove leading and trailing whitespace\n *\n * @returns Operation data with `formattedText` containing the transformed text\n *\n * @example\n * ```typescript\n * // Convert to uppercase\n * const result = formatText({\n * textContent: 'hello',\n * transformation: 'uppercase'\n * });\n * // result.formattedText = \"HELLO\"\n * ```\n *\n * @example\n * ```typescript\n * // Title case\n * const result = formatText({\n * textContent: 'hello world',\n * transformation: 'titlecase'\n * });\n * // result.formattedText = \"Hello World\"\n * ```\n *\n * @category Text\n */\nexport const formatText: TOperation<\n IFormatTextOperationData,\n Omit<IFormatTextOperationData, 'transformation'>\n> = (operationData: IFormatTextOperationData) => {\n const {textContent, transformation} = operationData;\n\n if (textContent === undefined || textContent === null) {\n throw new Error('formatText: textContent is required');\n }\n\n let text = textContent;\n\n switch (transformation) {\n case 'uppercase':\n text = text.toUpperCase();\n break;\n case 'lowercase':\n text = text.toLowerCase();\n break;\n case 'capitalize':\n text = text.charAt(0).toUpperCase() + text.slice(1);\n break;\n case 'titlecase':\n text = text.replace(/\\b\\w/g, char => char.toUpperCase());\n break;\n case 'trim':\n text = text.trim();\n break;\n default:\n throw new Error(\n `formatText: unknown transformation type \"${transformation}\"`\n );\n }\n\n operationData.formattedText = text;\n\n removeProperties(operationData, 'transformation');\n\n return operationData;\n};\n","import {removeProperties} from '@operation/helper/remove-operation-properties.ts';\nimport type {TOperation} from '@operation/types.ts';\n\nexport interface IGetAttributesFromElementOperationData {\n /**\n * The HTML element whose attributes will be retrieved\n * @dependency\n */\n selectedElement: JQuery;\n /**\n * The specified attribute names that will be retrieved\n * @required\n * @erased\n */\n attributeNames: string[];\n /**\n * The retrieved attributes\n * @output\n */\n attributeValues?: Record<string, unknown>;\n}\n\n/**\n * This operation retrieves the values for the specified attribute names from the given selected element.\n *\n * @category DOM\n */\nexport const getAttributesFromElement: TOperation<\n IGetAttributesFromElementOperationData,\n Omit<IGetAttributesFromElementOperationData, 'attributeNames'>\n> = (operationData: IGetAttributesFromElementOperationData) => {\n const {selectedElement, attributeNames} = operationData;\n\n removeProperties(operationData, 'attributeNames');\n\n operationData.attributeValues = attributeNames.reduce(\n (acc, attrName) => {\n if (attrName !== 'value') {\n acc[attrName] = selectedElement.attr(attrName);\n } else {\n acc[attrName] = selectedElement.val();\n }\n return acc;\n },\n {} as Record<string, unknown>\n );\n\n return operationData;\n};\n","import type {IController} from '@controllers/types.ts';\nimport {getElementControllers} from '@operation/helper/get-element-data.ts';\nimport {removeProperties} from '@operation/helper/remove-operation-properties.ts';\nimport type {TOperation} from '@operation/types.ts';\n\nexport interface IGetControllerFromElementOperationData {\n /**\n * @dependency\n */\n selectedElement: JQuery;\n /**\n * @type=ParameterType:controllerName\n * @required\n * @erased\n */\n controllerName: string;\n /**\n * @type=ParameterType:object\n * @output\n */\n controllerInstance?: IController<any>;\n}\n\n/**\n * This operation retrieves the controller instance with the specified name that is assigned to the given selected element.\n *\n * @param operationData\n * @returns\n *\n * @category Controller\n */\nexport const getControllerFromElement: TOperation<\n IGetControllerFromElementOperationData,\n Omit<IGetControllerFromElementOperationData, 'controllerName'>\n> = (operationData: IGetControllerFromElementOperationData) => {\n const {selectedElement, controllerName} = operationData;\n\n removeProperties(operationData, 'controllerName');\n\n const controllers = getElementControllers(selectedElement);\n const controller = controllers?.find(ctrl => ctrl.name === controllerName);\n\n if (!controller) {\n console.warn(\n `controller for name '${controllerName}' was not found on the given element`\n );\n }\n\n operationData.controllerInstance = controller;\n return operationData;\n};\n","import type * as controllers from '@controllers/index.ts';\nimport type {IController} from '@controllers/types.ts';\nimport {removeProperties} from '@operation/helper/remove-operation-properties.ts';\nimport type {TOperation, TOperationData} from '@operation/types.ts';\n\ntype TSystemName = keyof typeof controllers;\nexport interface IGetControllerInstanceOperationData {\n /**\n * @required\n * @erased\n */\n systemName: TSystemName;\n /**\n * @type=ParameterType:object\n * @output\n */\n controllerInstance?: IController<TOperationData>;\n}\n\n/**\n * This operation retrieves an instance of the given controller name.\n * It assigns this instance to the `controllerInstance` property on the current operation data\n *\n * @category Controller\n */\nexport const getControllerInstance: TOperation<\n IGetControllerInstanceOperationData,\n Omit<IGetControllerInstanceOperationData, 'systemName'>\n> = function (operationData: IGetControllerInstanceOperationData) {\n const {systemName} = operationData;\n\n removeProperties(operationData, 'systemName');\n\n operationData.controllerInstance = this.eventbus.request<\n IController<TOperationData>\n >('request-instance', systemName);\n\n return operationData;\n};\n","import type {TOperation} from '@operation/types.ts';\n\nexport interface IGetCurrentTimeOperationData {\n /**\n * @output\n */\n timestamp: number;\n /**\n * @output\n */\n date: Date;\n}\n\n/**\n * Gets the current time as timestamp and Date object.\n *\n * @category Date\n */\nexport const getCurrentTime: TOperation<\n IGetCurrentTimeOperationData,\n IGetCurrentTimeOperationData\n> = (operationData: IGetCurrentTimeOperationData) => {\n const now = new Date();\n operationData.timestamp = now.getTime();\n operationData.date = now;\n return operationData;\n};\n","import type {IDimensions} from '../../types.ts';\n\nfunction _modifyDimensionsByRatio(\n ratioModifier: string,\n dimensions: IDimensions\n) {\n const modifiedDimensions = {...dimensions};\n //h[ar=8-1]\n const prefix = ratioModifier.substring(0, 1);\n\n const ratio = ratioModifier.substring(\n ratioModifier.indexOf('[') + 1,\n ratioModifier.indexOf(']') - (ratioModifier.indexOf('[') - 1)\n );\n\n const ratios = ratio.split('=')[1].split('-');\n\n if (ratios.filter(Boolean).length !== 2) {\n throw new Error(`Badly formatted modifier, expect two ratios: ${ratio}`);\n }\n\n if (prefix === 'h') {\n modifiedDimensions.height =\n (modifiedDimensions.width / +ratios[0]) * +ratios[1];\n } else if (prefix === 'w') {\n modifiedDimensions.width =\n (modifiedDimensions.height / +ratios[1]) * +ratios[0];\n }\n\n return modifiedDimensions;\n}\n\nfunction _getModifierSuffix(\n modifier: string //*100h%\n): [string | null, number, boolean] {\n const endIdx = 1;\n let suffix: string | null = modifier.substring(\n modifier.length - endIdx,\n modifier.length\n );\n\n if (suffix !== 'h' && suffix !== 'w' && suffix !== '%') {\n suffix = null;\n }\n\n const isPercent = suffix === '%';\n\n if (isPercent) {\n suffix = modifier.substring(\n modifier.length - endIdx,\n modifier.length - (endIdx + 1)\n );\n\n if (suffix !== 'h' && suffix !== 'w') {\n suffix = null;\n }\n }\n\n return [suffix, endIdx, isPercent];\n}\n\nfunction _modifyDimensions(\n dimensions: IDimensions,\n prefix: string,\n suffix: string | null,\n widthModifier: number,\n heightModifier: number\n) {\n const modifiedDimension = {...dimensions};\n switch (prefix) {\n case '+':\n switch (suffix) {\n case 'h':\n modifiedDimension.height += heightModifier;\n break;\n case 'w':\n modifiedDimension.width += widthModifier;\n break;\n default:\n modifiedDimension.height += heightModifier;\n modifiedDimension.width += widthModifier;\n }\n break;\n case '-':\n switch (suffix) {\n case 'h':\n modifiedDimension.height -= heightModifier;\n break;\n case 'w':\n modifiedDimension.width -= widthModifier;\n break;\n default:\n modifiedDimension.height -= heightModifier;\n modifiedDimension.width -= widthModifier;\n }\n break;\n case '/':\n switch (suffix) {\n case 'h':\n modifiedDimension.height /= heightModifier;\n break;\n case 'w':\n modifiedDimension.width /= widthModifier;\n break;\n default:\n modifiedDimension.height /= heightModifier;\n modifiedDimension.width /= widthModifier;\n }\n break;\n case '*':\n switch (suffix) {\n case 'h':\n modifiedDimension.height *= heightModifier;\n break;\n case 'w':\n modifiedDimension.width *= widthModifier;\n break;\n default:\n modifiedDimension.height *= heightModifier;\n modifiedDimension.width *= widthModifier;\n }\n break;\n default:\n console.error(`Unknown operator found: ${prefix}`);\n }\n return modifiedDimension;\n}\n\n/**\n * Modifies the given dimensions using the given modifier string.\n * The modifier string is formatted in the following way:\n *\n * <operator><amount><optional-side><optional-precentage>|<ratio-definition>\n *\n * Where the ratio modifier is formatted in the following way:\n * <side>[ar=<ratio-left>-<ratio-right>]\n *\n * For example, this modifier '+100h|w[ar=8-1]' will modifiy the dimensions like this:\n * it will add a value of 100 to the height and modify the width by a ration of 8 to 1 relative to the height.\n *\n * @param dimensions\n * @param modifier\n */\nexport function modifyDimensions(dimensions: IDimensions, modifier: string) {\n const clonedDimensions = {...dimensions};\n let ratioModifier: string | null = null;\n if (modifier.indexOf('|') > -1) {\n [modifier, ratioModifier] = modifier.split('|');\n }\n\n const prefix = modifier.substring(0, 1);\n const [suffix, endIdx, isPercent] = _getModifierSuffix(modifier);\n\n const value = parseInt(\n suffix !== null\n ? modifier.substring(1, modifier.length - (endIdx - 1))\n : modifier.substring(1),\n 10\n );\n\n let widthModifier = value;\n let heightModifier = value;\n if (isPercent) {\n widthModifier = (clonedDimensions.width / 100) * value;\n heightModifier = (clonedDimensions.height / 100) * value;\n }\n\n const modifiedDimension = _modifyDimensions(\n clonedDimensions,\n prefix,\n suffix,\n widthModifier,\n heightModifier\n );\n\n if (ratioModifier) {\n return _modifyDimensionsByRatio(ratioModifier, modifiedDimension);\n }\n\n return modifiedDimension;\n}\n","import {modifyDimensions} from '@operation/helper/modify-dimensions.ts';\nimport {removeProperties} from '@operation/helper/remove-operation-properties.ts';\nimport type {TOperation} from '@operation/types.ts';\n\nexport interface IGetElementDimensionsOperationData {\n /**\n * @dependency\n */\n selectedElement: JQuery;\n /**\n * @type=ParameterType:dimensionsModifier\n * @erased\n */\n modifier?: string;\n /**\n * @type=ParameterType:object\n * @output\n */\n dimensions?: {width?: number; height?: number};\n}\n\n/**\n * This operation calculates the width and height of the given selected element.\n * It assigns this struct to the dimensions property on the current operation data.\n * Optionally the width and height can be modified using the given modifier string.\n *\n * The modifier string is formatted in the following way:\n *\n * <operator><amount><optional-side><optional-precentage>|<ratio-definition>\n *\n * Where the ratio modifier is formatted in the following way:\n * <side>[ar=<ratio-left>-<ratio-right>]\n *\n * For example, this modifier '+100h|w[ar=8-1]' will modifiy the dimensions like this:\n * it will add a value of 100 to the height and modify the width by a ratio of 8 to 1 relative to the height.\n *\n * @category DOM\n */\nexport const getElementDimensions: TOperation<\n IGetElementDimensionsOperationData,\n Omit<IGetElementDimensionsOperationData, 'modifier'>\n> = (operationData: IGetElementDimensionsOperationData) => {\n const {selectedElement, modifier} = operationData;\n\n removeProperties(operationData, 'modifier');\n\n let dimensions = {\n width: selectedElement.innerWidth() ?? 0,\n height: selectedElement.innerHeight() ?? 0,\n };\n\n if (dimensions.height === 0) {\n dimensions.height = dimensions.width;\n }\n\n if (modifier) {\n dimensions = modifyDimensions(dimensions, modifier);\n }\n\n operationData.dimensions = dimensions;\n return operationData;\n};\n","import type {TOperation} from '@operation/types.ts';\nimport $ from 'jquery';\n\nexport interface IGetFocusedElementOperationData {\n /**\n * @type=ParameterType:jQuery\n * @output\n */\n focusedElement: JQuery;\n}\n\n/**\n * Gets the currently focused element.\n *\n * @category Focus\n */\nexport const getFocusedElement: TOperation<\n IGetFocusedElementOperationData,\n IGetFocusedElementOperationData\n> = (operationData: IGetFocusedElementOperationData) => {\n operationData.focusedElement = document.activeElement\n ? $(document.activeElement as HTMLElement)\n : $();\n return operationData;\n};\n","import type {TOperation} from '@operation/types.ts';\n\nexport interface IGetFormDataOperationData {\n /**\n * @required\n * @dependency\n */\n selectedElement: JQuery;\n /**\n * @output\n * @type=ParameterType:object\n */\n formData?: Record<string, any>;\n}\n\n/**\n * Extracts all input, select, and textarea values from form element into operation data.\n *\n * This operation reads form field values and returns them as an object with field names as keys.\n * Only processes form elements that are enabled and not hidden. Handles checkboxes, radio buttons,\n * select elements, textareas, and text inputs.\n *\n * @returns Operation data with `formData` object containing field values\n *\n * @example\n * ```typescript\n * // Given a form with fields: name=\"John\", email=\"john@example.com\"\n * const result = getFormData({selectedElement: $form});\n * // Returns: {selectedElement: $form, formData: {name: \"John\", email: \"john@example.com\"}}\n * ```\n *\n * @category Form\n */\nexport const getFormData: TOperation<\n IGetFormDataOperationData,\n IGetFormDataOperationData\n> = (operationData: IGetFormDataOperationData) => {\n const {selectedElement} = operationData;\n\n // Validate selectedElement exists\n if (!selectedElement || selectedElement.length === 0) {\n throw new Error('getFormData: selectedElement is required');\n }\n\n // Validate selectedElement is a form\n if (!selectedElement.is('form')) {\n throw new Error('getFormData: selectedElement must be a form element');\n }\n\n // Use jQuery's serializeArray to get form data\n const formArray = selectedElement.serializeArray();\n const formData: Record<string, any> = {};\n\n // Convert array format to object format\n for (const field of formArray) {\n // Handle multiple values for same name (checkboxes)\n if (formData[field.name] !== undefined) {\n // Convert to array if not already\n if (!Array.isArray(formData[field.name])) {\n formData[field.name] = [formData[field.name]];\n }\n formData[field.name].push(field.value);\n } else {\n formData[field.name] = field.value;\n }\n }\n\n operationData.formData = formData;\n\n return operationData;\n};\n","import type {TOperation} from '@operation/types.ts';\nimport type {RequireKeys} from '@/types.ts';\n\nexport interface IGetImportOperationData {\n /**\n * @type=ParameterType:systemName\n * @required\n * @erased\n */\n systemName: string;\n /**\n * @output\n */\n importedInstance?: unknown;\n}\n\n/**\n * This operation retrieves the import specified by the given `systemName` and\n * assigns it to the `importedInstance` property on the current operaton date.\n *\n * @param operationData\n *\n * @category Utility\n */\nexport const getImport: TOperation<\n IGetImportOperationData,\n Omit<RequireKeys<IGetImportOperationData, 'importedInstance'>, 'systemName'>\n> = function (operationData: IGetImportOperationData) {\n const {systemName} = operationData;\n\n delete (operationData as any).systemName;\n\n operationData.importedInstance = this.eventbus.request<unknown>(\n 'request-function',\n systemName\n );\n\n return operationData as Omit<\n RequireKeys<IGetImportOperationData, 'importedInstance'>,\n 'systemName'\n >;\n};\n","import {removeProperties} from '@operation/helper/remove-operation-properties.ts';\nimport type {TOperation} from '@operation/types.ts';\n\nexport interface IGetQueryParamsOperationData {\n /**\n * The query params will be added as property/values to this object.\n * So, the query string `?foo=bar&bar=foo` will result in:\n * ```json\n * {\n * foo: \"bar\",\n * bar: \"foo\"\n * }\n * ```\n * This object will be assigned to the `queryParams` property.\n * @output\n */\n queryParams?: Record<string, string>;\n /**\n * The properties on this object will be assigned to the queryParams result\n * when the given property name is not part of the query string.\n *\n * @erased\n *\n */\n defaultValues?: Record<string, string>;\n}\n\n/**\n * This operation retrieves the current query parameters from the browser's address bar and places\n * them on the returned operation data.\n *\n * @category Utility\n */\nexport const getQueryParams: TOperation<\n IGetQueryParamsOperationData,\n Omit<IGetQueryParamsOperationData, 'defaultValues'>\n> = (operationData: IGetQueryParamsOperationData) => {\n const searchParams = new URLSearchParams(window.location.search);\n const queryParams = Object.fromEntries(searchParams.entries());\n\n const {defaultValues = {}} = operationData;\n\n removeProperties(operationData, 'defaultValues');\n\n operationData.queryParams = {\n ...defaultValues,\n ...queryParams,\n };\n\n return operationData;\n};\n","import type {TOperation} from '@operation/types.ts';\n\nexport interface IGetScrollPositionOperationData {\n /**\n * @output\n */\n scrollX: number;\n /**\n * @output\n */\n scrollY: number;\n}\n\n/**\n * Gets the current scroll position of the viewport.\n *\n * Returns x (horizontal) and y (vertical) scroll positions in pixels.\n * Uses cross-browser compatible methods to retrieve scroll position.\n *\n * @returns Operation data with `scrollX` and `scrollY` values\n *\n * @example\n * ```typescript\n * // Get current scroll position\n * const result = getScrollPosition({});\n * // result.scrollX = 150\n * // result.scrollY = 400\n * ```\n *\n * @category Scroll\n */\nexport const getScrollPosition: TOperation<\n IGetScrollPositionOperationData,\n IGetScrollPositionOperationData\n> = (operationData: IGetScrollPositionOperationData) => {\n // Cross-browser scroll position detection\n const scrollX =\n window.pageXOffset !== undefined\n ? window.pageXOffset\n : (window as any).scrollX !== undefined\n ? (window as any).scrollX\n : document.documentElement?.scrollLeft || 0;\n\n const scrollY =\n window.pageYOffset !== undefined\n ? window.pageYOffset\n : (window as any).scrollY !== undefined\n ? (window as any).scrollY\n : document.documentElement?.scrollTop || 0;\n\n operationData.scrollX = scrollX;\n operationData.scrollY = scrollY;\n\n return operationData;\n};\n","import type {TOperation} from '@operation/types.ts';\n\nexport interface IGetTextContentOperationData {\n /**\n * @required\n * @dependency\n */\n selectedElement: JQuery;\n /**\n * @output\n */\n textContent?: string;\n}\n\n/**\n * Extracts text content from element, stripping all HTML markup.\n *\n * Uses jQuery's `.text()` method which is XSS-safe and returns only the text content\n * without any HTML tags. Preserves whitespace and text from nested elements.\n *\n * @returns Operation data with `textContent` containing the extracted plain text\n *\n * @example\n * ```typescript\n * // Extract text from element with HTML\n * const result = getTextContent({selectedElement: $div});\n * // Given: <div>Hello <strong>World</strong>!</div>\n * // Returns: {textContent: \"Hello World!\"}\n * ```\n *\n * @category Text\n */\nexport const getTextContent: TOperation<\n IGetTextContentOperationData,\n IGetTextContentOperationData\n> = (operationData: IGetTextContentOperationData) => {\n const {selectedElement} = operationData;\n\n if (!selectedElement || selectedElement.length === 0) {\n throw new Error('getTextContent: selectedElement is required');\n }\n\n operationData.textContent = selectedElement.text();\n\n return operationData;\n};\n","import {removeProperties} from '@operation/helper/remove-operation-properties.ts';\nimport type {TOperation} from '@operation/types.ts';\n\nexport interface IHttpDeleteOperationData {\n /**\n * @required\n * @erased\n */\n url: string;\n /**\n * @optional\n * @erased\n */\n headers?: Record<string, string>;\n /**\n * @output\n */\n response: any;\n /**\n * @output\n */\n status: number;\n}\n\n/**\n * Performs an HTTP DELETE request to the specified URL.\n *\n * @returns Operation data with `response` (parsed JSON or empty) and `status` (HTTP status code)\n *\n * @example\n * ```typescript\n * const result = await httpDelete({\n * url: 'https://api.example.com/users/123',\n * headers: { 'Authorization': 'Bearer token' }\n * });\n * // result.response = {} or null\n * // result.status = 204\n * ```\n *\n * @category HTTP\n */\nexport const httpDelete: TOperation<\n IHttpDeleteOperationData,\n Omit<IHttpDeleteOperationData, 'url' | 'headers'>\n> = async (operationData: IHttpDeleteOperationData) => {\n const {url, headers = {}} = operationData;\n\n if (!url || url.trim() === '') {\n throw new Error('httpDelete: url is required');\n }\n\n try {\n const response = await fetch(url, {\n method: 'DELETE',\n headers,\n });\n\n operationData.status = response.status;\n\n if (!response.ok) {\n throw new Error(\n `httpDelete: HTTP error ${response.status} ${response.statusText}`\n );\n }\n\n // DELETE may return empty body (204 No Content)\n const contentType = response.headers.get('content-type');\n if (contentType?.includes('application/json')) {\n const data = await response.json();\n operationData.response = data;\n } else {\n operationData.response = null;\n }\n\n removeProperties(operationData, 'url', 'headers');\n\n return operationData;\n } catch (error) {\n throw new Error(`httpDelete: ${(error as Error).message}`);\n }\n};\n","import {removeProperties} from '@operation/helper/remove-operation-properties.ts';\nimport type {TOperation} from '@operation/types.ts';\n\nexport interface IHttpPostOperationData {\n /**\n * @required\n * @erased\n */\n url: string;\n /**\n * @optional\n * @erased\n */\n body?: any;\n /**\n * @optional\n * @erased\n */\n headers?: Record<string, string>;\n /**\n * @output\n */\n response: any;\n /**\n * @output\n */\n status: number;\n}\n\n/**\n * Performs an HTTP POST request to the specified URL.\n *\n * @returns Operation data with `response` (parsed JSON) and `status` (HTTP status code)\n *\n * @example\n * ```typescript\n * const result = await httpPost({\n * url: 'https://api.example.com/users',\n * body: { name: 'John', email: 'john@example.com' },\n * headers: { 'Content-Type': 'application/json' }\n * });\n * // result.response = { id: 123, name: 'John', ... }\n * // result.status = 201\n * ```\n *\n * @category HTTP\n */\nexport const httpPost: TOperation<\n IHttpPostOperationData,\n Omit<IHttpPostOperationData, 'url' | 'body' | 'headers'>\n> = async (operationData: IHttpPostOperationData) => {\n const {url, body, headers = {}} = operationData;\n\n if (!url || url.trim() === '') {\n throw new Error('httpPost: url is required');\n }\n\n try {\n const response = await fetch(url, {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json',\n ...headers,\n },\n body: JSON.stringify(body),\n });\n\n operationData.status = response.status;\n\n if (!response.ok) {\n throw new Error(\n `httpPost: HTTP error ${response.status} ${response.statusText}`\n );\n }\n\n const data = await response.json();\n operationData.response = data;\n\n removeProperties(operationData, 'url', 'body', 'headers');\n\n return operationData;\n } catch (error) {\n throw new Error(`httpPost: ${(error as Error).message}`);\n }\n};\n","import {removeProperties} from '@operation/helper/remove-operation-properties.ts';\nimport type {TOperation} from '@operation/types.ts';\n\nexport interface IHttpPutOperationData {\n /**\n * @required\n * @erased\n */\n url: string;\n /**\n * @optional\n * @erased\n */\n body?: any;\n /**\n * @optional\n * @erased\n */\n headers?: Record<string, string>;\n /**\n * @output\n */\n response: any;\n /**\n * @output\n */\n status: number;\n}\n\n/**\n * Performs an HTTP PUT request to the specified URL.\n *\n * @returns Operation data with `response` (parsed JSON) and `status` (HTTP status code)\n *\n * @example\n * ```typescript\n * const result = await httpPut({\n * url: 'https://api.example.com/users/123',\n * body: { name: 'John Updated', email: 'john.new@example.com' },\n * headers: { 'Content-Type': 'application/json' }\n * });\n * // result.response = { id: 123, name: 'John Updated', ... }\n * // result.status = 200\n * ```\n *\n * @category HTTP\n */\nexport const httpPut: TOperation<\n IHttpPutOperationData,\n Omit<IHttpPutOperationData, 'url' | 'body' | 'headers'>\n> = async (operationData: IHttpPutOperationData) => {\n const {url, body, headers = {}} = operationData;\n\n if (!url || url.trim() === '') {\n throw new Error('httpPut: url is required');\n }\n\n try {\n const response = await fetch(url, {\n method: 'PUT',\n headers: {\n 'Content-Type': 'application/json',\n ...headers,\n },\n body: JSON.stringify(body),\n });\n\n operationData.status = response.status;\n\n if (!response.ok) {\n throw new Error(\n `httpPut: HTTP error ${response.status} ${response.statusText}`\n );\n }\n\n const data = await response.json();\n operationData.response = data;\n\n removeProperties(operationData, 'url', 'body', 'headers');\n\n return operationData;\n } catch (error) {\n throw new Error(`httpPut: ${(error as Error).message}`);\n }\n};\n","import type {TOperation} from '@operation/types.ts';\n\nexport interface IInvokeObjectMethodOperationData {\n /**\n *\n * The given object instance\n * @dependency\n *\n */\n instance: any;\n /**\n * The method name on the given object that will be invoked\n * @required\n * @erased\n */\n methodName: string;\n /**\n * Arguments that will be passed to the specified method\n * @erased\n */\n methodArguments?: unknown[];\n /**\n * If any, the results of the method invocation are assigned to the property\n * @output\n */\n methodResult?: unknown;\n}\n\n/**\n * This operation invokes the specified method on the given object with the given optional arguments\n * and assigns the result to the `methodResult` operationdata property.\n *\n * @param operationData\n *\n * @category Utility\n */\nexport const invokeObjectMethod: TOperation<\n IInvokeObjectMethodOperationData,\n Omit<IInvokeObjectMethodOperationData, 'methodName' | 'methodArguments'>\n> = (operationData: IInvokeObjectMethodOperationData) => {\n const {methodName, methodArguments, ...newOperationData} = operationData;\n\n delete (operationData as any).methodName;\n delete (operationData as any).methodArguments;\n\n const func = operationData.instance[methodName];\n if (typeof func === 'function') {\n newOperationData.methodResult = func.apply(\n operationData.instance,\n methodArguments ?? []\n );\n } else {\n console.error(`The given member name ${methodName} is not a function`);\n }\n\n return newOperationData;\n};\n","import type {TOperation} from '@operation/types.ts';\n\nexport interface IIsElementInViewportOperationData {\n /**\n * @required\n * @dependency\n */\n selectedElement: JQuery;\n /**\n * @output\n */\n isInViewport: boolean;\n}\n\n/**\n * Checks if an element is currently visible within the viewport.\n *\n * Uses `getBoundingClientRect()` to determine if the element is within the viewport boundaries.\n *\n * @returns Operation data with `isInViewport` boolean indicating visibility\n *\n * @example\n * ```typescript\n * // Check if element is in view\n * const result = isElementInViewport({\n * selectedElement: $targetElement\n * });\n * // result.isInViewport = true or false\n * ```\n *\n * @category DOM\n */\nexport const isElementInViewport: TOperation<\n IIsElementInViewportOperationData,\n IIsElementInViewportOperationData\n> = (operationData: IIsElementInViewportOperationData) => {\n const {selectedElement} = operationData;\n\n if (!selectedElement || selectedElement.length === 0) {\n throw new Error('isElementInViewport: selectedElement is required');\n }\n\n const element = selectedElement[0];\n const rect = element.getBoundingClientRect();\n\n const isInViewport =\n rect.top >= 0 &&\n rect.left >= 0 &&\n rect.bottom <=\n (window.innerHeight || document.documentElement.clientHeight) &&\n rect.right <= (window.innerWidth || document.documentElement.clientWidth);\n\n operationData.isInViewport = isInViewport;\n\n return operationData;\n};\n","import {removeProperties} from '@operation/helper/remove-operation-properties.ts';\nimport type {TOperation} from '@operation/types.ts';\n\nexport type StorageType = 'local' | 'session';\n\nexport interface ILoadFromStorageOperationData {\n /**\n * @required\n * @erased\n */\n key: string;\n /**\n * @required\n * @erased\n */\n storageType: StorageType;\n /**\n * @output\n */\n loadedValue: any;\n}\n\n/**\n * Loads data from browser storage (localStorage or sessionStorage).\n *\n * Deserializes the stored JSON value. Returns `null` if key doesn't exist.\n *\n * @returns Operation data with `loadedValue` containing the deserialized data\n *\n * @example\n * ```typescript\n * // Load user settings from localStorage\n * const result = loadFromStorage({\n * key: 'user-settings',\n * storageType: 'local'\n * });\n * // result.loadedValue = { theme: 'dark', language: 'en' }\n * ```\n *\n * @example\n * ```typescript\n * // Load session data\n * const result = loadFromStorage({\n * key: 'session-id',\n * storageType: 'session'\n * });\n * // result.loadedValue = 'abc123' or null if not found\n * ```\n *\n * @category Data\n */\nexport const loadFromStorage: TOperation<\n ILoadFromStorageOperationData,\n Omit<ILoadFromStorageOperationData, 'storageType'>\n> = (operationData: ILoadFromStorageOperationData) => {\n const {key, storageType} = operationData;\n\n if (!key || key.trim() === '') {\n throw new Error('loadFromStorage: key is required');\n }\n\n const storage = storageType === 'session' ? sessionStorage : localStorage;\n const stored = storage.getItem(key);\n\n if (stored === null) {\n operationData.loadedValue = null;\n } else {\n try {\n operationData.loadedValue = JSON.parse(stored);\n } catch {\n throw new Error(\n `loadFromStorage: failed to parse stored value for key \"${key}\"`\n );\n }\n }\n\n removeProperties(operationData, 'storageType');\n\n return operationData;\n};\n","import {removeProperties} from '@operation/helper/remove-operation-properties.ts';\nimport type {TOperation} from '@operation/types.ts';\n\nconst jsonCache: Record<string, unknown> = {};\n\nexport interface ILoadJSONOperationData {\n /**\n * The URL where the JSON will be retrieved from\n * @required\n * @erased\n */\n url: string;\n /**\n * If true, the results will be added to the cache and any subsequent call will use this cache\n * @erased\n */\n cache?: boolean;\n /**\n * The JSON retrieved from the given URL\n * @output\n */\n json?: any;\n}\n\nconst addToCache = (key: string, value: any) => {\n jsonCache[key] = value;\n};\n\n/**\n * This operation loads a JSON file from the specified url and assigns it to the json\n * property on the current operation data.\n *\n * If the cache property is set to true and a cached value already exists, this is assigned\n * instead of re-retrieving it from the url.\n *\n * @category Utility\n */\nexport const loadJson: TOperation<\n ILoadJSONOperationData,\n Omit<ILoadJSONOperationData, 'url' | 'cache'>\n> = async (operationData: ILoadJSONOperationData) => {\n const {url, cache} = operationData;\n\n removeProperties(operationData, 'url', 'cache');\n\n if (cache && jsonCache[url]) {\n operationData.json = jsonCache[url];\n return operationData;\n }\n\n const response = await fetch(url);\n const json = await response.json();\n const cacheValue = (operationData.json = json);\n\n if (cache) {\n addToCache(url, cacheValue);\n }\n\n return operationData;\n};\n\nexport const clearCache = () => {\n for (const p in jsonCache) {\n delete jsonCache[p];\n }\n};\n","import {getGlobals} from '@operation/helper/globals.ts';\nimport {removeProperties} from '@operation/helper/remove-operation-properties.ts';\nimport type {TOperation} from '@operation/types.ts';\n\nexport interface ILogOperationData {\n /**\n * @type=ParameterType:object|ParameterType:string|ParameterType:number|ParameterType:boolean|ParameterType:array\n * @erased\n */\n logValue?: any;\n /**\n * @erased\n */\n logName?: string;\n}\n\n/**\n * This operation logs the specified value, or, when no logValue property has been assigned\n * it will log the current operation data, global data and scope to the console\n *\n * @category Utility\n */\nexport const log: TOperation<\n ILogOperationData,\n Omit<ILogOperationData, 'logValue' | 'logName'>\n> = function (operationData: ILogOperationData) {\n if ('logValue' in operationData) {\n console.log(operationData.logName ?? 'logValue', operationData.logValue);\n removeProperties(operationData, 'logValue', 'logName');\n } else {\n const globalData = getGlobals();\n\n console.group('Operation info');\n console.log('scope', this);\n console.log('operationData', operationData);\n console.log('globalData', globalData);\n console.groupEnd();\n }\n\n return operationData;\n};\n","import {removeProperties} from '@operation/helper/remove-operation-properties.ts';\nimport type {TOperation} from '@operation/types.ts';\n\nexport interface IMapArrayOperationData {\n /**\n * @required\n * @dependency\n */\n arrayData: any[];\n /**\n * @required\n * @erased\n */\n mapFunction: (item: any, index?: number) => any;\n /**\n * @output\n */\n mappedArray?: any[];\n}\n\n/**\n * Transforms each element of an array using a mapping function.\n *\n * Operates on arrayData passed from previous operations.\n * The mapFunction receives each item and optionally its index.\n *\n * @returns Operation data with `mappedArray` containing transformed elements\n *\n * @example\n * ```typescript\n * // Double each number\n * const result = mapArray({\n * arrayData: [1, 2, 3, 4],\n * mapFunction: (item) => item * 2\n * });\n * // result.mappedArray = [2, 4, 6, 8]\n * ```\n *\n * @example\n * ```typescript\n * // Extract property from objects\n * const result = mapArray({\n * arrayData: [{name: 'Alice', age: 25}, {name: 'Bob', age: 30}],\n * mapFunction: (item) => item.name\n * });\n * // result.mappedArray = ['Alice', 'Bob']\n * ```\n *\n * @example\n * ```typescript\n * // Use index in transformation\n * const result = mapArray({\n * arrayData: ['a', 'b', 'c'],\n * mapFunction: (item, index) => `${index}-${item}`\n * });\n * // result.mappedArray = ['0-a', '1-b', '2-c']\n * ```\n *\n * @category Array\n */\nexport const mapArray: TOperation<\n IMapArrayOperationData,\n Omit<IMapArrayOperationData, 'mapFunction'>\n> = (operationData: IMapArrayOperationData) => {\n const {arrayData, mapFunction} = operationData;\n\n if (!Array.isArray(arrayData)) {\n throw new Error('mapArray: arrayData is required and must be an array');\n }\n\n if (typeof mapFunction !== 'function') {\n throw new Error('mapArray: mapFunction is required and must be a function');\n }\n\n operationData.mappedArray = arrayData.map(mapFunction);\n\n removeProperties(operationData, 'mapFunction');\n\n return operationData;\n};\n","export function isFunction(value: any): value is (...arg: any) => any {\n return typeof value === 'function';\n}\n","export function isString(value: any): value is string {\n return typeof value === 'string';\n}\n","import {resolvePropertyValues} from '@operation/helper/resolve-property-values.ts';\nimport type {TOperation} from '@operation/types.ts';\nimport {isFunction} from '@util/guards/is-function.ts';\nimport {isString} from '@util/guards/is-string.ts';\n\nexport type MathFunctionKeys = {\n [K in keyof Math]: Math[K] extends (...args: any) => any ? K : never;\n}[keyof Math];\n\nexport type MathNonFunctionKeys = {\n [K in keyof Math]: Math[K] extends (...args: any) => any ? never : K;\n}[keyof Math];\n\nexport interface IMathOperationData {\n /**\n * @type=ParameterType:array\n * @required\n * @erased\n */\n args: (number | string | MathNonFunctionKeys)[];\n /**\n * @type=ParameterType:mathfunction\n * @required\n * @erased\n */\n functionName: MathFunctionKeys;\n /**\n * @output\n */\n mathResult?: number;\n}\n\n/**\n * This operation performs the given math function with the specified arguments.\n *\n * @category Utility\n */\nexport const math: TOperation<\n IMathOperationData,\n Omit<IMathOperationData, 'args' | 'functionName'>\n> = function (operationData: IMathOperationData) {\n operationData = resolvePropertyValues(operationData, this, operationData);\n operationData.args = resolveMathConstants(operationData.args);\n\n const {args, functionName, ...newOperationData} = operationData;\n\n newOperationData.mathResult = (\n Math[functionName] as (...args: any[]) => any\n ).apply(null, args);\n\n return newOperationData;\n};\n\nfunction resolveMathConstants(args: any[]) {\n return args.map((arg: any) => {\n if (isMathProperty(arg)) {\n return Math[arg];\n }\n return arg;\n });\n}\n\nfunction isMathProperty(value: string | symbol): value is keyof Math {\n return (\n isString(value) && value in Math && !isFunction(Math[value as keyof Math])\n );\n}\n","import {findMatchingOperationIndex} from '@operation/helper/find-matching-operation-index.ts';\nimport type {IOperationScope, TOperation} from '@operation/types.ts';\n\n/**\n * If the preceeding {@link when} operation evaluates to `true` subsequent operations will\n * be skipped until an {@link endWhen} operation is encountered.\n *\n * @category Control Flow\n */\nexport const otherwise: TOperation<Record<string, unknown>> = function (\n operationData: Record<string, unknown>\n) {\n if (this.whenEvaluation) {\n this.newIndex = findEndWhenIndex(this);\n }\n return operationData;\n};\n\nfunction findEndWhenIndex(scope: IOperationScope) {\n const currentIndex = scope.currentIndex + 1;\n const list = scope.operations.slice(currentIndex);\n\n const endWhenIndex = list.findIndex(\n findMatchingOperationIndex.bind({\n counter: 0,\n self: 'when',\n matchingName: 'endWhen',\n })\n );\n\n return endWhenIndex > -1\n ? endWhenIndex + currentIndex\n : scope.operations.length;\n}\n","import type {TOperation} from '@operation/types.ts';\n\nexport interface IRemoveClassOperationData {\n /**\n * @dependency\n */\n selectedElement: JQuery;\n /**\n * @type=ParameterType:className\n * @required\n * @erased\n */\n className: string;\n}\n\n/**\n * This operation removes the spcified class name from the given selected element.\n *\n * @param operationData\n * @returns\n * @category DOM\n */\nexport const removeClass: TOperation<\n IRemoveClassOperationData,\n Omit<IRemoveClassOperationData, 'className'>\n> = (operationData: IRemoveClassOperationData) => {\n const {selectedElement, className} = operationData;\n delete (operationData as any).className;\n selectedElement.removeClass(className);\n return operationData;\n};\n","import type {IController} from '@controllers/types.ts';\nimport {getElementControllers} from '@operation/helper/get-element-data.ts';\nimport type {TOperation} from '@operation/types.ts';\n\nexport interface IRemoveControllerFromElementOperationData {\n /**\n * @dependency\n */\n selectedElement: JQuery;\n /**\n * @type=ParameterType:controllerName\n * @required\n * @erased\n */\n controllerName: string;\n}\n\n/**\n * This operation removes the controller with the specified name from the given selected element.\n *\n * @param operationData\n * @returns\n *\n * @category Controller\n */\nexport const removeControllerFromElement: TOperation<\n IRemoveControllerFromElementOperationData,\n Omit<IRemoveControllerFromElementOperationData, 'controllerName'>\n> = function (operationData: IRemoveControllerFromElementOperationData) {\n const {selectedElement, controllerName} = operationData;\n\n delete (operationData as any).controllerName;\n\n const controllers = getElementControllers(selectedElement);\n const controller = controllers?.find(\n (ctrl: IController<any>) => ctrl.name === controllerName\n );\n\n if (controller && controllers) {\n const idx = controllers.indexOf(controller);\n controllers.splice(idx, 1);\n controller.detach(this.eventbus);\n } else {\n console.warn(\n `controller for name '${controllerName}' was not found on the given element`\n );\n }\n\n return operationData;\n};\n","import type {TOperation} from '@operation/types.ts';\n\nexport interface IRemoveElementOperationData {\n /**\n * @dependency\n */\n selectedElement: JQuery;\n}\n\n/**\n * This operation removes the given selected element from the DOM.\n *\n * @category DOM\n */\nexport const removeElement: TOperation<IRemoveElementOperationData> = (\n operationData: IRemoveElementOperationData\n) => {\n const {selectedElement} = operationData;\n selectedElement.remove();\n return operationData;\n};\n","import type {TOperation} from '@operation/types.ts';\n\nexport interface IRemovePropertiesFromOperationDataOperationData {\n /**\n * @required\n * @erased\n */\n propertyNames: string[];\n}\n\n/**\n * This operation removes the given list of properties from the current operation data.\n * It will also remove the property `propertyNames` from the result.\n *\n * @category Data\n */\nexport const removePropertiesFromOperationData: TOperation<\n IRemovePropertiesFromOperationDataOperationData,\n Omit<IRemovePropertiesFromOperationDataOperationData, 'propertyNames'>\n> = (operationData: IRemovePropertiesFromOperationDataOperationData) => {\n const {propertyNames} = operationData;\n if (propertyNames.indexOf('propertyNames') < 0) {\n propertyNames.push('propertyNames');\n }\n\n return Object.fromEntries(\n Object.entries(operationData).filter(\n ([name, _value]) => !propertyNames.includes(name)\n )\n );\n};\n","import {removeProperties} from '@operation/helper/remove-operation-properties.ts';\nimport type {TOperation} from '@operation/types.ts';\n\nexport interface IReparentElementOperationData {\n /**\n * @dependency\n */\n selectedElement: JQuery;\n /**\n * @type=ParameterType:selector\n * @required\n * @erased\n */\n newParentSelector: string;\n}\n\n/**\n * This operation moves the given selected element to the new parent that is defined\n * by the specified `newParentSelector`.\n *\n * @param operationData\n * @returns\n *\n * @category DOM\n */\nexport const reparentElement: TOperation<\n IReparentElementOperationData,\n Omit<IReparentElementOperationData, 'newParentSelector'>\n> = (operationData: IReparentElementOperationData) => {\n const {selectedElement, newParentSelector} = operationData;\n removeProperties(operationData, 'newParentSelector');\n selectedElement.remove().appendTo(newParentSelector);\n return operationData;\n};\n","import {removeProperties} from '@operation/helper/remove-operation-properties.ts';\nimport type {TOperation} from '@operation/types.ts';\n\nexport interface IReplaceStringOperationData {\n /**\n * @required\n * @dependency\n */\n textContent: string;\n /**\n * @required\n * @erased\n */\n pattern: string | RegExp;\n /**\n * @required\n * @erased\n */\n replacement: string;\n /**\n * @output\n */\n result: string;\n}\n\n/**\n * Replaces occurrences of a pattern in a string (alias for replaceText for string context).\n *\n * @returns Operation data with `result` containing the replaced string\n *\n * @example\n * ```typescript\n * const result = replaceString({\n * textContent: 'Hello World',\n * pattern: 'World',\n * replacement: 'Universe'\n * });\n * // result.result = \"Hello Universe\"\n * ```\n *\n * @category String\n */\nexport const replaceString: TOperation<\n IReplaceStringOperationData,\n Omit<IReplaceStringOperationData, 'pattern' | 'replacement'>\n> = (operationData: IReplaceStringOperationData) => {\n const {textContent, pattern, replacement} = operationData;\n\n if (textContent === undefined || textContent === null) {\n throw new Error('replaceString: textContent is required');\n }\n\n operationData.result = textContent.replace(pattern, replacement);\n\n removeProperties(operationData, 'pattern', 'replacement');\n\n return operationData;\n};\n","import {removeProperties} from '@operation/helper/remove-operation-properties.ts';\nimport type {TOperation} from '@operation/types.ts';\n\nexport interface IReplaceTextOperationData {\n /**\n * @required\n * @dependency\n */\n textContent: string;\n /**\n * @required\n * @erased\n */\n searchPattern: string | RegExp;\n /**\n * @required\n * @erased\n */\n replacement: string;\n /**\n * @output\n */\n replacementCount: number;\n}\n\n/**\n * Finds and replaces text using literal string or regex pattern.\n *\n * Operates on textContent passed from previous operations (e.g., getTextContent).\n * Supports regex patterns with global flag for multiple replacements.\n * Updates textContent with replaced text and sets replacementCount.\n *\n * @returns Operation data with updated `textContent` and `replacementCount` indicating number of replacements made\n *\n * @example\n * ```typescript\n * // Replace placeholder with value\n * const result = replaceText({\n * textContent: 'Hello {{name}}',\n * searchPattern: '{{name}}',\n * replacement: 'John'\n * });\n * // result.textContent = \"Hello John\"\n * // result.replacementCount = 1\n * ```\n *\n * @example\n * ```typescript\n * // Replace with regex pattern\n * const result = replaceText({\n * textContent: 'Test 123 and 456',\n * searchPattern: /\\d+/g,\n * replacement: 'NUM'\n * });\n * // result.textContent = \"Test NUM and NUM\"\n * // result.replacementCount = 2\n * ```\n *\n * @category Text\n */\nexport const replaceText: TOperation<\n IReplaceTextOperationData,\n Omit<IReplaceTextOperationData, 'searchPattern' | 'replacement'>\n> = (operationData: IReplaceTextOperationData) => {\n const {textContent, searchPattern, replacement} = operationData;\n\n if (textContent === undefined || textContent === null) {\n throw new Error('replaceText: textContent is required');\n }\n\n let newText: string;\n let count = 0;\n\n if (searchPattern instanceof RegExp) {\n // Count matches for regex\n const matches = textContent.match(searchPattern);\n count = matches ? matches.length : 0;\n newText = textContent.replace(searchPattern, replacement);\n } else {\n // Count matches for string\n const parts = textContent.split(searchPattern);\n count = parts.length - 1;\n newText = parts.join(replacement);\n }\n\n operationData.textContent = newText;\n operationData.replacementCount = count;\n\n removeProperties(operationData, 'searchPattern', 'replacement');\n\n return operationData;\n};\n","import type {IAction} from '@action/types.ts';\nimport {removeProperties} from '@operation/helper/remove-operation-properties.ts';\nimport type {TOperation} from '@operation/types.ts';\n\nexport interface IRequestActionOperationData {\n /**\n * @type=ParameterType:actionName\n * @required\n * @erased\n */\n systemName: string;\n /**\n * @type=ParameterType:object\n * @output\n */\n actionInstance?: IAction;\n}\n\n/**\n * This operation requests an action instance with the specified name and assigns it\n * to the `actionInstance` property on the current operation data.\n *\n * @category Action\n */\nexport const requestAction: TOperation<\n IRequestActionOperationData,\n Omit<Required<IRequestActionOperationData>, 'systemName'>\n> = function (operationData: IRequestActionOperationData) {\n const {systemName} = operationData;\n\n removeProperties(operationData, 'systemName');\n\n operationData.actionInstance = this.eventbus.request<IAction>(\n 'request-action',\n systemName\n );\n\n return operationData as Required<IRequestActionOperationData>;\n};\n","import {removeProperties} from '@operation/helper/remove-operation-properties.ts';\nimport type {TOperation} from '@operation/types.ts';\n\nexport type StorageType = 'local' | 'session';\n\nexport interface ISaveToStorageOperationData {\n /**\n * @required\n * @erased\n */\n key: string;\n /**\n * @required\n * @erased\n */\n value: any;\n /**\n * @required\n * @erased\n */\n storageType: StorageType;\n}\n\n/**\n * Saves data to browser storage (localStorage or sessionStorage).\n *\n * Serializes the value as JSON before storing. Supports any JSON-serializable data type.\n *\n * @returns Operation data with storage properties erased\n *\n * @example\n * ```typescript\n * // Save user settings to localStorage\n * const result = saveToStorage({\n * key: 'user-settings',\n * value: { theme: 'dark', language: 'en' },\n * storageType: 'local'\n * });\n * ```\n *\n * @example\n * ```typescript\n * // Save session data\n * const result = saveToStorage({\n * key: 'session-id',\n * value: 'abc123',\n * storageType: 'session'\n * });\n * ```\n *\n * @category Data\n */\nexport const saveToStorage: TOperation<\n ISaveToStorageOperationData,\n Omit<ISaveToStorageOperationData, 'value' | 'storageType'>\n> = (operationData: ISaveToStorageOperationData) => {\n const {key, value, storageType} = operationData;\n\n if (!key || key.trim() === '') {\n throw new Error('saveToStorage: key is required');\n }\n\n const storage = storageType === 'session' ? sessionStorage : localStorage;\n const serialized = JSON.stringify(value);\n storage.setItem(key, serialized);\n\n removeProperties(operationData, 'value', 'storageType');\n\n return operationData;\n};\n","import {removeProperties} from '@operation/helper/remove-operation-properties.ts';\nimport type {TOperation} from '@operation/types.ts';\n\nexport type ScrollBehavior = 'auto' | 'smooth';\nexport type ScrollLogicalPosition = 'start' | 'center' | 'end' | 'nearest';\n\nexport interface IScrollToElementOperationData {\n /**\n * @required\n * @dependency\n */\n selectedElement: JQuery;\n /**\n * @optional\n * @erased\n */\n behavior?: ScrollBehavior;\n /**\n * @optional\n * @erased\n */\n block?: ScrollLogicalPosition;\n /**\n * @optional\n * @erased\n */\n inline?: ScrollLogicalPosition;\n}\n\n/**\n * Scrolls the viewport to bring the selected element into view.\n *\n * Uses the browser's `scrollIntoView` API with configurable behavior.\n *\n * @returns Operation data with scroll properties erased\n *\n * @example\n * ```typescript\n * // Smooth scroll to element at top of viewport\n * const result = scrollToElement({\n * selectedElement: $targetElement,\n * behavior: 'smooth',\n * block: 'start'\n * });\n * ```\n *\n * @example\n * ```typescript\n * // Center element in viewport\n * const result = scrollToElement({\n * selectedElement: $targetElement,\n * behavior: 'smooth',\n * block: 'center'\n * });\n * ```\n *\n * @category Scroll\n */\nexport const scrollToElement: TOperation<\n IScrollToElementOperationData,\n Omit<IScrollToElementOperationData, 'behavior' | 'block' | 'inline'>\n> = (operationData: IScrollToElementOperationData) => {\n const {\n selectedElement,\n behavior = 'auto',\n block = 'start',\n inline = 'nearest',\n } = operationData;\n\n if (!selectedElement || selectedElement.length === 0) {\n throw new Error('scrollToElement: selectedElement is required');\n }\n\n const element = selectedElement[0];\n element.scrollIntoView({\n behavior,\n block,\n inline,\n });\n\n removeProperties(operationData, 'behavior', 'block', 'inline');\n\n return operationData;\n};\n","import {removeProperties} from '@operation/helper/remove-operation-properties.ts';\nimport type {TOperation} from '@operation/types.ts';\n\nexport type ScrollBehavior = 'auto' | 'smooth';\n\nexport interface IScrollToPositionOperationData {\n /**\n * @required\n * @erased\n */\n x: number;\n /**\n * @required\n * @erased\n */\n y: number;\n /**\n * @optional\n * @erased\n */\n behavior?: ScrollBehavior;\n}\n\n/**\n * Scrolls the viewport to a specific x,y coordinate position.\n *\n * Uses the browser's `window.scrollTo` API with configurable behavior.\n *\n * @returns Operation data with scroll properties erased\n *\n * @example\n * ```typescript\n * // Smooth scroll to position\n * const result = scrollToPosition({\n * x: 0,\n * y: 500,\n * behavior: 'smooth'\n * });\n * ```\n *\n * @example\n * ```typescript\n * // Instant scroll to top\n * const result = scrollToPosition({\n * x: 0,\n * y: 0\n * });\n * ```\n *\n * @category Scroll\n */\nexport const scrollToPosition: TOperation<\n IScrollToPositionOperationData,\n Omit<IScrollToPositionOperationData, 'x' | 'y' | 'behavior'>\n> = (operationData: IScrollToPositionOperationData) => {\n const {x, y, behavior = 'auto'} = operationData;\n\n if (typeof x !== 'number' || typeof y !== 'number') {\n throw new Error('scrollToPosition: x and y coordinates are required');\n }\n\n window.scrollTo({\n left: x,\n top: y,\n behavior,\n });\n\n removeProperties(operationData, 'x', 'y', 'behavior');\n\n return operationData;\n};\n","import {removeProperties} from '@operation/helper/remove-operation-properties.ts';\nimport {\n type ExternalProperty,\n resolveExternalPropertyChain,\n} from '@operation/helper/resolve-external-property-chain.ts';\nimport type {TOperation} from '@operation/types.ts';\n\nfunction findElementBySelector(root: JQuery, selector: string) {\n const element = root.find(selector);\n if (!element.length) {\n console.warn(`selector '${selector}' wasn't found!`);\n }\n return element;\n}\n\nexport interface ISelectElementOperationData {\n /**\n * @type=ParameterType:selector\n * @required\n * @erased\n */\n selector: string;\n /**\n * @erased\n */\n useSelectedElementAsRoot?: boolean;\n /**\n * @type=ParameterType:object\n * @output\n */\n selectedElement?: JQuery;\n}\n\n/**\n * This operation selects one or more elements using the specified selector.\n *\n * If `useSelectedElementAsRoot` is set to true and a valid DOM element is assigned\n * to the current operation data's `selectedElement` property\n * then the element will be looked for only in the descendant elements of this DOM element.\n *\n * @category DOM\n */\nexport const selectElement: TOperation<\n ISelectElementOperationData,\n Omit<ISelectElementOperationData, 'selector' | 'useSelectedElementAsRoot'>\n> = function (operationData: ISelectElementOperationData) {\n operationData.selector = resolveExternalPropertyChain(\n operationData,\n this,\n operationData.selector as ExternalProperty\n ) as string;\n\n const {selector, useSelectedElementAsRoot = false} = operationData;\n\n removeProperties(operationData, 'selector', 'useSelectedElementAsRoot');\n\n if (!selector) {\n throw new Error('selectElement: selector is either empty or not defined.');\n }\n\n if (useSelectedElementAsRoot && operationData.selectedElement) {\n const currentRoot = operationData.selectedElement;\n operationData.selectedElement = findElementBySelector(\n currentRoot,\n selector\n );\n return operationData;\n }\n\n const root = this.eventbus.request<JQuery>('request-engine-root');\n if (root) {\n operationData.selectedElement = findElementBySelector(root, selector);\n }\n\n return operationData;\n};\n","import {getPropertyChainValue} from '@operation/helper/get-property-chain-value.ts';\nimport {getGlobals, type TGlobalCache} from '@operation/helper/globals.ts';\nimport {removeProperties} from '@operation/helper/remove-operation-properties.ts';\nimport {resolveExternalPropertyChain} from '@operation/helper/resolve-external-property-chain.ts';\nimport type {\n IOperationScope,\n TOperation,\n TOperationData,\n} from '@operation/types.ts';\n\nexport type TDataTarget =\n | `$scope.${string}`\n | `$operationdata.${string}`\n | `$globaldata.${string}`;\n\nexport interface ISetDataOperationData {\n /**\n * @required\n * @erased\n */\n properties: Record<TDataTarget, any>;\n}\n\n/**\n * This operation assigns the specified properties to the specified data targets.\n *\n * @example The various ways of assigning data\n * ```ts\n * setData({\n * '$operationdata.foo': '$scope.currentItem', // $scope.currentItem will be assigned to $operationdata.foo\n * '$globaldata.foo': '$scope.currentItem', // $scope.currentItem will be assigned to $globaldata.foo\n * '$scope.newIndex': 100, // The constant 100 will be assigned to $scope.newIndex\n * })\n * ```\n *\n * @category Data\n */\nexport const setData: TOperation<\n ISetDataOperationData,\n Omit<ISetDataOperationData, 'properties'>\n> = function (operationData: ISetDataOperationData) {\n const {properties} = operationData;\n removeProperties(operationData, 'properties');\n\n resolveTargets(properties, operationData, this);\n\n return operationData;\n};\n\nfunction resolveTargets(\n data: Record<TDataTarget, any>,\n operationData: Record<string, any>,\n scope: IOperationScope\n) {\n const propertyChains = Object.keys(data);\n\n return propertyChains.forEach(item => {\n const path = item.split('.');\n const rootTarget = path.shift()?.toLowerCase().substring(1) ?? '';\n if (!isDataTarget(rootTarget)) {\n throw new Error(\n `Unrecognized target: ${rootTarget}, known targets are: ${knownTargets.join(\n ', '\n )}`\n );\n }\n const property = path.pop() ?? '';\n const propertyValue = resolveExternalPropertyChain(\n operationData,\n scope,\n (data as any)[item]\n );\n\n const targets: {\n scope: IOperationScope;\n operationdata: TOperationData;\n globaldata: TGlobalCache;\n } = {\n scope,\n operationdata: operationData,\n globaldata: getGlobals(),\n };\n\n const propertyTarget = getPropertyChainValue(\n path,\n (targets as any)[rootTarget]\n ) as Record<string, any>;\n\n propertyTarget[property] = propertyValue;\n });\n}\n\nconst knownTargets = ['scope', 'operationdata', 'globaldata'];\nfunction isDataTarget(value: string): value is TDataTarget {\n return knownTargets.includes(value);\n}\n","import {removeProperties} from '@operation/helper/remove-operation-properties.ts';\nimport type {TOperation} from '@operation/types.ts';\n\nexport interface ISetElementAttributesOperationData {\n /**\n * @required\n * @erased\n */\n attributes: Record<string, unknown>;\n /**\n * @dependency\n */\n selectedElement: JQuery;\n}\n\n/**\n * This operation sets the specified set of attributes on the given selected element.\n *\n * @category DOM\n */\nexport const setElementAttributes: TOperation<\n ISetElementAttributesOperationData,\n Omit<ISetElementAttributesOperationData, 'attributes'>\n> = (operationData: ISetElementAttributesOperationData) => {\n const {attributes, selectedElement} = operationData;\n removeProperties(operationData, 'attributes');\n selectedElement.attr(attributes);\n return operationData;\n};\n","import {removeProperties} from '@operation/helper/remove-operation-properties.ts';\nimport type {TOperation} from '@operation/types.ts';\n\nexport interface ISetElementContentOperationData {\n /**\n * @dependency\n */\n selectedElement: JQuery;\n /**\n * @erased\n */\n template: string | JQuery.Node;\n /**\n * overwite = the contents of the selected element are replaced by the given template\n *\n * append = the new content will be inserted after the current content\n *\n * prepend = the new content will be inserted before the current content\n *\n * @erased\n */\n insertionType: 'overwrite' | 'append' | 'prepend';\n}\n\n/**\n * This operation sets the specified content defined by the value assigned to the template property\n * to the given selected element.\n *\n * When the `insertionType` is set to `overwrite` the contents of the selected element are replaced\n * by the given template.\n * When set to `append` the new content will be inserted after the current content.\n * When set to `prepend` the new content will be inserted before the current content.\n *\n * @category DOM\n */\nexport const setElementContent: TOperation<\n ISetElementContentOperationData,\n Omit<ISetElementContentOperationData, 'template' | 'insertionType'>\n> = (operationData: ISetElementContentOperationData) => {\n const {\n insertionType = 'overwrite',\n selectedElement,\n template,\n } = operationData;\n\n switch (true) {\n case insertionType === 'overwrite':\n selectedElement.html(template);\n break;\n case insertionType === 'append':\n selectedElement.append(template);\n break;\n case insertionType === 'prepend':\n selectedElement.prepend(template);\n break;\n }\n\n removeProperties(operationData, 'insertionType', 'template');\n\n return operationData;\n};\n","import type {TOperation} from '@operation/types.ts';\n\nexport interface ISetFocusOperationData {\n /**\n * @required\n * @dependency\n */\n selectedElement: JQuery;\n}\n\n/**\n * Sets focus to the selected element.\n *\n * @category Focus\n */\nexport const setFocus: TOperation<\n ISetFocusOperationData,\n ISetFocusOperationData\n> = (operationData: ISetFocusOperationData) => {\n const {selectedElement} = operationData;\n\n if (!selectedElement || selectedElement.length === 0) {\n throw new Error('setFocus: selectedElement is required');\n }\n\n selectedElement[0].focus();\n\n return operationData;\n};\n","import {removeProperties} from '@operation/helper/remove-operation-properties.ts';\nimport type {TOperation} from '@operation/types.ts';\n\nexport interface ISetFormValueOperationData {\n /**\n * @required\n * @dependency\n */\n selectedElement: JQuery;\n /**\n * @required\n * @erased\n */\n value: string | number | boolean;\n}\n\n/**\n * Sets the value of an input, select, or textarea element.\n *\n * Handles different input types appropriately:\n * - Text inputs, textareas, selects: sets value directly\n * - Checkboxes: sets checked property for boolean values\n * - Radio buttons: sets checked property for boolean values\n * - Number inputs: converts to string\n *\n * @example\n * ```typescript\n * // Set text input value\n * const result = setFormValue({selectedElement: $input, value: 'test@example.com'});\n * // Element value is now 'test@example.com'\n * ```\n *\n * @example\n * ```typescript\n * // Set checkbox checked state\n * const result = setFormValue({selectedElement: $checkbox, value: true});\n * // Checkbox is now checked\n * ```\n *\n * @category Form\n */\nexport const setFormValue: TOperation<\n ISetFormValueOperationData,\n Omit<ISetFormValueOperationData, 'value'>\n> = (operationData: ISetFormValueOperationData) => {\n const {selectedElement, value} = operationData;\n\n // Validate selectedElement exists\n if (!selectedElement || selectedElement.length === 0) {\n throw new Error('setFormValue: selectedElement is required');\n }\n\n // Handle checkboxes and radio buttons with boolean values\n if (\n typeof value === 'boolean' &&\n (selectedElement.is(':checkbox') || selectedElement.is(':radio'))\n ) {\n selectedElement.prop('checked', value);\n } else {\n // Handle all other inputs with val()\n selectedElement.val(value as any);\n }\n\n removeProperties(operationData, 'value');\n\n return operationData;\n};\n","import {setGlobals} from '@operation/helper/globals.ts';\nimport type {TOperation} from '@operation/types.ts';\n\nexport interface ISetGlobalDataOperationData {\n /**\n * @required\n * @erased\n */\n propertyNames: string[];\n}\n\n/**\n * This operation copies the specified properties from the operationData to the global data.\n *\n * @category Data\n */\nexport const setGlobalData: TOperation<\n ISetGlobalDataOperationData,\n Omit<ISetGlobalDataOperationData, 'propertyNames'>\n> = (operationData: ISetGlobalDataOperationData) => {\n const {propertyNames, ...newOperationData} = operationData;\n const newGlobals = Object.fromEntries(\n Object.entries(operationData).filter(([name, _value]) =>\n propertyNames.includes(name)\n )\n );\n\n setGlobals(newGlobals);\n\n return newOperationData;\n};\n","import {resolvePropertyValues} from '@operation/helper/resolve-property-values.ts';\nimport type {TOperation} from '@operation/types.ts';\n\nexport interface ISetOperationData {\n /**\n * If set to true, the plucked properties replace the current operation data.\n * @erased\n */\n override?: boolean;\n /**\n * @required\n * @erased\n */\n properties: Record<string, any>;\n}\n\n/**\n * This operation assigns the specified properties to the current operation data.\n * When override is set to true the properties replace the current operation data entirely.\n *\n * @category Data\n */\nexport const setOperationData: TOperation<\n ISetOperationData,\n Omit<ISetOperationData, 'override' | 'properties'>\n> = function (operationData: ISetOperationData) {\n const {override = false, properties, ...newOperationData} = operationData;\n\n const resolvedProperties = resolvePropertyValues(\n newOperationData,\n this,\n properties\n );\n\n if (override) {\n return resolvedProperties;\n }\n\n return {\n ...newOperationData,\n ...resolvedProperties,\n };\n};\n","import {removeProperties} from '@operation/helper/remove-operation-properties.ts';\nimport {resolvePropertyValues} from '@operation/helper/resolve-property-values.ts';\nimport type {TOperation} from '@operation/types.ts';\n\nexport interface ISetStyleOperationData {\n /**\n * @type=ParameterType:cssProperties\n * @required\n * @erased\n */\n properties: Record<string, any>;\n /**\n * @dependency\n */\n selectedElement: JQuery;\n}\n\n/**\n * This operation assigns the specified CSS style properties to the\n * given selected element.\n *\n * @category DOM\n */\nexport const setStyle: TOperation<\n ISetStyleOperationData,\n Omit<ISetStyleOperationData, 'properties'>\n> = function (operationData: ISetStyleOperationData) {\n const properties = resolvePropertyValues(\n operationData,\n this,\n operationData.properties\n );\n operationData.selectedElement.css(properties as JQuery.PlainObject);\n\n removeProperties(operationData, 'properties');\n\n return operationData;\n};\n","import {removeProperties} from '@operation/helper/remove-operation-properties.ts';\nimport type {TOperation} from '@operation/types.ts';\n\nexport interface ISetVariableOperationData {\n /**\n * @required\n * @erased\n */\n name: string;\n /**\n * @type=ParameterType:object|ParameterType:string|ParameterType:number|ParameterType:boolean|ParameterType:array\n * @required\n * @erased\n */\n value: any;\n}\n\n/**\n * This operation sets a variable with the specified name on the scope with the specified value.\n *\n * @category Data\n */\nexport const setVariable: TOperation<\n ISetVariableOperationData,\n Omit<ISetVariableOperationData, 'name' | 'value'>\n> = function (operationData: ISetVariableOperationData) {\n const {name, value} = operationData;\n\n if (!this.variables) {\n this.variables = {};\n }\n\n this.variables[name] = value;\n\n removeProperties(operationData, 'name', 'value');\n\n return operationData;\n};\n","import {removeProperties} from '@operation/helper/remove-operation-properties.ts';\nimport type {TOperation} from '@operation/types.ts';\n\nexport type SortOrder = 'asc' | 'desc';\n\nexport interface ISortArrayOperationData {\n /**\n * @required\n * @dependency\n */\n arrayData: any[];\n /**\n * @optional\n * @erased\n */\n sortProperty?: string;\n /**\n * @optional\n * @erased\n */\n sortOrder?: SortOrder;\n /**\n * @optional\n * @erased\n */\n sortComparator?: (a: any, b: any) => number;\n /**\n * @output\n */\n sortedArray: any[];\n}\n\n/**\n * Sorts an array by property, natural order, or custom comparator function.\n *\n * Operates on arrayData passed from previous operations.\n * Supports three sorting modes:\n * 1. Property sort: `sortProperty` and `sortOrder` to sort objects by property\n * 2. Natural sort: `sortOrder` alone for primitive arrays\n * 3. Custom comparator: `sortComparator` function for complex sorting logic\n *\n * @returns Operation data with `sortedArray` containing sorted results\n *\n * @example\n * ```typescript\n * // Sort objects by property\n * const result = sortArray({\n * arrayData: [{name: 'Bob', age: 30}, {name: 'Alice', age: 25}],\n * sortProperty: 'age',\n * sortOrder: 'asc'\n * });\n * // result.sortedArray = [{name: 'Alice', age: 25}, {name: 'Bob', age: 30}]\n * ```\n *\n * @example\n * ```typescript\n * // Sort primitives\n * const result = sortArray({\n * arrayData: [5, 2, 8, 1],\n * sortOrder: 'desc'\n * });\n * // result.sortedArray = [8, 5, 2, 1]\n * ```\n *\n * @example\n * ```typescript\n * // Custom comparator\n * const result = sortArray({\n * arrayData: ['apple', 'Banana', 'cherry'],\n * sortComparator: (a, b) => a.toLowerCase().localeCompare(b.toLowerCase())\n * });\n * ```\n *\n * @category Array\n */\nexport const sortArray: TOperation<\n ISortArrayOperationData,\n Omit<ISortArrayOperationData, 'sortProperty' | 'sortOrder' | 'sortComparator'>\n> = (operationData: ISortArrayOperationData) => {\n const {arrayData, sortProperty, sortOrder, sortComparator} = operationData;\n\n if (!Array.isArray(arrayData)) {\n throw new Error('sortArray: arrayData is required and must be an array');\n }\n\n // Create a copy to avoid mutating original\n const sorted = [...arrayData];\n\n if (sortComparator) {\n sorted.sort(sortComparator);\n } else if (sortProperty) {\n sorted.sort((a, b) => {\n const aVal = a[sortProperty];\n const bVal = b[sortProperty];\n\n if (aVal < bVal) return sortOrder === 'desc' ? 1 : -1;\n if (aVal > bVal) return sortOrder === 'desc' ? -1 : 1;\n return 0;\n });\n } else {\n // Natural sort for primitives\n sorted.sort((a, b) => {\n if (a < b) return sortOrder === 'desc' ? 1 : -1;\n if (a > b) return sortOrder === 'desc' ? -1 : 1;\n return 0;\n });\n }\n\n operationData.sortedArray = sorted;\n\n removeProperties(\n operationData,\n 'sortProperty',\n 'sortOrder',\n 'sortComparator'\n );\n\n return operationData;\n};\n","import {removeProperties} from '@operation/helper/remove-operation-properties.ts';\nimport type {TOperation} from '@operation/types.ts';\n\nexport interface ISplitStringOperationData {\n /**\n * @required\n * @dependency\n */\n textContent: string;\n /**\n * @required\n * @erased\n */\n delimiter: string | RegExp;\n /**\n * @optional\n * @erased\n */\n limit?: number;\n /**\n * @output\n */\n resultArray: string[];\n}\n\n/**\n * Splits a string into an array by delimiter (string or regex).\n *\n * @returns Operation data with `resultArray` containing the split strings\n *\n * @example\n * ```typescript\n * const result = splitString({\n * textContent: 'apple,banana,cherry',\n * delimiter: ','\n * });\n * // result.resultArray = ['apple', 'banana', 'cherry']\n * ```\n *\n * @category String\n */\nexport const splitString: TOperation<\n ISplitStringOperationData,\n Omit<ISplitStringOperationData, 'delimiter' | 'limit'>\n> = (operationData: ISplitStringOperationData) => {\n const {textContent, delimiter, limit} = operationData;\n\n if (textContent === undefined || textContent === null) {\n throw new Error('splitString: textContent is required');\n }\n\n operationData.resultArray = textContent.split(delimiter, limit);\n\n removeProperties(operationData, 'delimiter', 'limit');\n\n return operationData;\n};\n","import type {IAction} from '@action/types.ts';\nimport {internalResolve} from '@operation/helper/internal-resolve.ts';\nimport {mergeOperationData} from '@operation/helper/merge-operation-data.ts';\nimport type {TOperation, TOperationData} from '@operation/types.ts';\n\nexport interface IStartActionOperationData {\n /**\n * @dependency\n */\n actionInstance: IAction;\n /**\n * @type=ParameterType:object\n * @erased\n */\n actionOperationData: TOperationData;\n}\n\n/**\n * This operation starts the specified action instance using the given action operation data.\n *\n * The action operation data is first merged with the current operation data before it is\n * passed on to the action. After the action has completed the action operation data properties\n * are removed from the current operation data.\n *\n * @category Action\n */\nexport const startAction: TOperation<\n IStartActionOperationData,\n Omit<IStartActionOperationData, 'actionOperationData'>\n> = (operationData: IStartActionOperationData) => {\n let {actionInstance, actionOperationData, ...newOperationData} =\n operationData;\n\n return new Promise((resolve, reject) => {\n newOperationData = mergeOperationData(\n newOperationData,\n actionOperationData\n );\n\n actionInstance.start(newOperationData).then(() => {\n Object.keys(actionOperationData).forEach(key => {\n delete (newOperationData as any)[key];\n });\n internalResolve(resolve, {...newOperationData, actionInstance});\n }, reject);\n });\n};\n","import {removeProperties} from '@operation/helper/remove-operation-properties.ts';\nimport type {TOperation} from '@operation/types.ts';\n\nexport interface ISubstringTextOperationData {\n /**\n * @required\n * @dependency\n */\n textContent: string;\n /**\n * @required\n * @erased\n */\n start: number;\n /**\n * @optional\n * @erased\n */\n end?: number;\n /**\n * @output\n */\n substring: string;\n}\n\n/**\n * Extracts a substring from text between start and end indices.\n *\n * @returns Operation data with `substring` containing the extracted text\n *\n * @example\n * ```typescript\n * const result = substringText({\n * textContent: 'Hello World',\n * start: 0,\n * end: 5\n * });\n * // result.substring = \"Hello\"\n * ```\n *\n * @category Text\n */\nexport const substringText: TOperation<\n ISubstringTextOperationData,\n Omit<ISubstringTextOperationData, 'start' | 'end'>\n> = (operationData: ISubstringTextOperationData) => {\n const {textContent, start, end} = operationData;\n\n if (textContent === undefined || textContent === null) {\n throw new Error('substringText: textContent is required');\n }\n\n if (typeof start !== 'number') {\n throw new Error('substringText: start must be a number');\n }\n\n operationData.substring = textContent.substring(start, end);\n\n removeProperties(operationData, 'start', 'end');\n\n return operationData;\n};\n","import type {TOperation} from '@operation/types.ts';\n\nexport interface IToggleClassOperationData {\n /**\n * The element on which the class will be toggled\n * @dependency\n */\n selectedElement: JQuery;\n /**\n * The class that will be toggled\n * @type=ParameterType:className\n * @required\n * @erased\n */\n className: string;\n}\n\n/**\n * This operation toggles the specfied class name on the given selected element.\n *\n * Meaning, if the specified class name exists on the given element it will be removed,\n * otherwise it will be added.\n *\n * @category DOM\n */\nexport const toggleClass: TOperation<\n IToggleClassOperationData,\n Omit<IToggleClassOperationData, 'className'>\n> = (operationData: IToggleClassOperationData) => {\n const {selectedElement, className} = operationData;\n selectedElement.toggleClass(className);\n delete (operationData as any).className;\n return operationData;\n};\n","import type {TOperation} from '@operation/types.ts';\n\nexport interface IToggleElementOperationData {\n /**\n * The element whose visibility will be toggled\n * @dependency\n */\n selectedElement: JQuery;\n}\n\n/**\n * This operation toggles the visibility of the given selected element.\n *\n * Meaning, if the element is hidden, it will be made visible, otherwise\n * it will be hidden.\n *\n * @category DOM\n */\nexport const toggleElement: TOperation<IToggleElementOperationData> =\n function toggleElement(operationData: IToggleElementOperationData) {\n operationData.selectedElement.toggle();\n return operationData;\n };\n","import {removeProperties} from '@operation/helper/remove-operation-properties.ts';\nimport type {TOperation} from '@operation/types.ts';\n\nexport interface IToggleFormElementOperationData {\n /**\n * @required\n * @dependency\n */\n selectedElement: JQuery;\n /**\n * @required\n * @erased\n */\n enabled: boolean;\n}\n\n/**\n * Enables or disables form input elements (inputs, selects, textareas, buttons).\n *\n * Sets the `disabled` property on the element. When `enabled` is true, removes the disabled\n * attribute; when false, adds the disabled attribute.\n *\n * @example\n * ```typescript\n * // Disable an input field\n * toggleFormElement({selectedElement: $input, enabled: false});\n * // Input is now disabled\n * ```\n *\n * @example\n * ```typescript\n * // Enable a previously disabled button\n * toggleFormElement({selectedElement: $button, enabled: true});\n * // Button is now enabled\n * ```\n *\n * @category Form\n */\nexport const toggleFormElement: TOperation<\n IToggleFormElementOperationData,\n Omit<IToggleFormElementOperationData, 'enabled'>\n> = (operationData: IToggleFormElementOperationData) => {\n const {selectedElement, enabled} = operationData;\n\n if (!selectedElement || selectedElement.length === 0) {\n throw new Error('toggleFormElement: selectedElement is required');\n }\n\n // Set disabled property (disabled = !enabled)\n selectedElement.prop('disabled', !enabled);\n\n removeProperties(operationData, 'enabled');\n\n return operationData;\n};\n","import {removeProperties} from '@operation/helper/remove-operation-properties.ts';\nimport type {TOperation} from '@operation/types.ts';\nimport $ from 'jquery';\n\nexport interface IValidationRules {\n required?: boolean;\n minLength?: number;\n maxLength?: number;\n pattern?: string | RegExp;\n email?: boolean;\n}\n\nexport interface IValidateFormOperationData {\n /**\n * @required\n * @dependency\n */\n selectedElement: JQuery;\n /**\n * @erased\n */\n validationRules?: Record<string, IValidationRules>;\n /**\n * @output\n * @type=ParameterType:object\n */\n validationErrors?: Record<string, string>;\n /**\n * @output\n */\n isValid?: boolean;\n}\n\n/**\n * Validates form fields against HTML5 validation and custom rules.\n *\n * Uses HTML5 validation API (checkValidity()) for native validation, and supports\n * custom validation rules for: required, minLength, maxLength, pattern (regex), and email format.\n *\n * @returns Operation data with `validationErrors` object (field names → error messages) and `isValid` boolean\n *\n * @example\n * ```typescript\n * // Validate with HTML5 validation\n * const result = validateForm({selectedElement: $form});\n * // Returns: {isValid: true, validationErrors: {}}\n * ```\n *\n * @example\n * ```typescript\n * // Validate with custom rules\n * const result = validateForm({\n * selectedElement: $form,\n * validationRules: {\n * password: { required: true, minLength: 8 },\n * email: { email: true }\n * }\n * });\n * // Returns: {isValid: false, validationErrors: {password: \"Must be at least 8 characters\"}}\n * ```\n *\n * @category Form\n */\nexport const validateForm: TOperation<\n IValidateFormOperationData,\n Omit<IValidateFormOperationData, 'validationRules'>\n> = (operationData: IValidateFormOperationData) => {\n const {selectedElement, validationRules} = operationData;\n\n if (!selectedElement || selectedElement.length === 0) {\n throw new Error('validateForm: selectedElement is required');\n }\n\n if (!selectedElement.is('form')) {\n throw new Error('validateForm: selectedElement must be a form element');\n }\n\n const validationErrors: Record<string, string> = {};\n const emailRegex = /^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$/;\n\n // Get all form inputs\n const inputs = selectedElement.find('input, select, textarea');\n\n inputs.each((_, element) => {\n const $input = $(element);\n const name = $input.attr('name');\n\n if (!name) return; // Skip inputs without name attribute\n\n const value = $input.val() as string;\n const rules = validationRules?.[name];\n\n // HTML5 validation first\n const inputElement = element as\n | HTMLInputElement\n | HTMLTextAreaElement\n | HTMLSelectElement;\n if (inputElement.checkValidity && !inputElement.checkValidity()) {\n validationErrors[name] =\n inputElement.validationMessage || 'Invalid value';\n return;\n }\n\n // Custom validation rules\n if (rules) {\n if (rules.required && (!value || value.trim() === '')) {\n validationErrors[name] = 'This field is required';\n return;\n }\n\n if (rules.minLength && value.length < rules.minLength) {\n validationErrors[name] =\n `Must be at least ${rules.minLength} characters`;\n return;\n }\n\n if (rules.maxLength && value.length > rules.maxLength) {\n validationErrors[name] =\n `Must be no more than ${rules.maxLength} characters`;\n return;\n }\n\n if (rules.pattern) {\n const pattern =\n typeof rules.pattern === 'string'\n ? new RegExp(rules.pattern)\n : rules.pattern;\n if (!pattern.test(value)) {\n validationErrors[name] = 'Invalid format';\n return;\n }\n }\n\n if (rules.email && !emailRegex.test(value)) {\n validationErrors[name] = 'Must be a valid email address';\n return;\n }\n }\n });\n\n operationData.validationErrors = validationErrors;\n operationData.isValid = Object.keys(validationErrors).length === 0;\n\n removeProperties(operationData, 'validationRules');\n\n return operationData;\n};\n","import {internalResolve} from '@operation/helper/internal-resolve.ts';\nimport type {TOperation} from '@operation/types.ts';\n\nexport interface IWaitOperationData {\n /**\n * The amount of milliseconds the operation will wait for.\n * @required\n * @erased\n */\n milliseconds: number;\n}\n\n/**\n * This operation waits for the specified amount of milliseconds.\n *\n * @category Utility\n */\nexport const wait: TOperation<\n IWaitOperationData,\n Omit<IWaitOperationData, 'milliseconds'>\n> = (operationData: IWaitOperationData) => {\n const {milliseconds, ...newOperationData} = operationData;\n\n return new Promise(resolve => {\n setTimeout(() => {\n internalResolve(resolve, newOperationData);\n }, milliseconds);\n });\n};\n","export type {IAddClassOperationData} from '@operation/add-class.ts';\nexport {addClass} from '@operation/add-class.ts';\nexport type {IAddControllerToElementOperationData} from '@operation/add-controller-to-element.ts';\nexport {addControllerToElement} from '@operation/add-controller-to-element.ts';\nexport {addGlobalsToOperation} from '@operation/add-globals-to-operation.ts';\nexport type {IAnimateOperationData} from '@operation/animate.ts';\nexport {animate} from '@operation/animate.ts';\nexport type {IAnimateWithClassOperationData} from '@operation/animate-with-class.ts';\nexport {animateWithClass} from '@operation/animate-with-class.ts';\nexport type {IAnnounceToScreenReaderOperationData} from '@operation/announce-to-screen-reader.ts';\nexport {announceToScreenReader} from '@operation/announce-to-screen-reader.ts';\nexport {breakForEach} from '@operation/break-for-each.ts';\nexport type {IBroadcastEventOperationData} from '@operation/broadcast-event.ts';\nexport {broadcastEvent} from '@operation/broadcast-event.ts';\nexport type {ICalcOperationData} from '@operation/calc.ts';\nexport {calc} from '@operation/calc.ts';\nexport type {IClearElementOperationData} from '@operation/clear-element.ts';\nexport {clearElement} from '@operation/clear-element.ts';\nexport type {IClearOperationDataOperationData} from '@operation/clear-operation-data.ts';\nexport {clearOperationData} from '@operation/clear-operation-data.ts';\nexport type {\n IClearStorageOperationData,\n StorageType,\n} from '@operation/clear-storage.ts';\nexport {clearStorage} from '@operation/clear-storage.ts';\nexport type {ICompareDateOperationData} from '@operation/compare-date.ts';\nexport {compareDate} from '@operation/compare-date.ts';\nexport type {IConcatenateStringsOperationData} from '@operation/concatenate-strings.ts';\nexport {concatenateStrings} from '@operation/concatenate-strings.ts';\nexport {continueForEach} from '@operation/continue-for-each.ts';\nexport type {ICreateElementOperationData} from '@operation/create-element.ts';\nexport {createElement} from '@operation/create-element.ts';\nexport type {ICustomFunctionOperationData} from '@operation/custom-function.ts';\nexport {customFunction} from '@operation/custom-function.ts';\nexport type {IEndActionOperationData} from '@operation/end-action.ts';\nexport {endAction} from '@operation/end-action.ts';\nexport {endForEach} from '@operation/end-for-each.ts';\nexport {endWhen} from '@operation/end-when.ts';\nexport type {IExtendControllerOperationData} from '@operation/extend-controller.ts';\nexport {extendController} from '@operation/extend-controller.ts';\nexport type {IFilterArrayOperationData} from '@operation/filter-array.ts';\nexport {filterArray} from '@operation/filter-array.ts';\nexport type {IFindInArrayOperationData} from '@operation/find-in-array.ts';\nexport {findInArray} from '@operation/find-in-array.ts';\nexport type {IForEachOperationData} from '@operation/for-each.ts';\nexport {forEach} from '@operation/for-each.ts';\nexport type {IFormatDateOperationData} from '@operation/format-date.ts';\nexport {formatDate} from '@operation/format-date.ts';\nexport type {IFormatTextOperationData} from '@operation/format-text.ts';\nexport {formatText} from '@operation/format-text.ts';\nexport type {IGetAttributesFromElementOperationData} from '@operation/get-attributes-from-element.ts';\nexport {getAttributesFromElement} from '@operation/get-attributes-from-element.ts';\nexport type {IGetControllerFromElementOperationData} from '@operation/get-controller-from-element.ts';\nexport {getControllerFromElement} from '@operation/get-controller-from-element.ts';\nexport type {IGetControllerInstanceOperationData} from '@operation/get-controller-instance.ts';\nexport {getControllerInstance} from '@operation/get-controller-instance.ts';\nexport type {IGetCurrentTimeOperationData} from '@operation/get-current-time.ts';\nexport {getCurrentTime} from '@operation/get-current-time.ts';\nexport type {IGetElementDimensionsOperationData} from '@operation/get-element-dimensions.ts';\nexport {getElementDimensions} from '@operation/get-element-dimensions.ts';\nexport type {IGetFocusedElementOperationData} from '@operation/get-focused-element.ts';\nexport {getFocusedElement} from '@operation/get-focused-element.ts';\nexport type {IGetFormDataOperationData} from '@operation/get-form-data.ts';\nexport {getFormData} from '@operation/get-form-data.ts';\nexport type {IGetImportOperationData} from '@operation/get-import.ts';\nexport {getImport} from '@operation/get-import.ts';\nexport type {IGetQueryParamsOperationData} from '@operation/get-query-params.ts';\nexport {getQueryParams} from '@operation/get-query-params.ts';\nexport type {IGetScrollPositionOperationData} from '@operation/get-scroll-position.ts';\nexport {getScrollPosition} from '@operation/get-scroll-position.ts';\nexport type {IGetTextContentOperationData} from '@operation/get-text-content.ts';\nexport {getTextContent} from '@operation/get-text-content.ts';\nexport type {IHttpDeleteOperationData} from '@operation/http-delete.ts';\nexport {httpDelete} from '@operation/http-delete.ts';\nexport type {IHttpPostOperationData} from '@operation/http-post.ts';\nexport {httpPost} from '@operation/http-post.ts';\nexport type {IHttpPutOperationData} from '@operation/http-put.ts';\nexport {httpPut} from '@operation/http-put.ts';\nexport type {IInvokeObjectMethodOperationData} from '@operation/invoke-object-method.ts';\nexport {invokeObjectMethod} from '@operation/invoke-object-method.ts';\nexport type {IIsElementInViewportOperationData} from '@operation/is-element-in-viewport.ts';\nexport {isElementInViewport} from '@operation/is-element-in-viewport.ts';\nexport type {ILoadFromStorageOperationData} from '@operation/load-from-storage.ts';\nexport {loadFromStorage} from '@operation/load-from-storage.ts';\nexport type {ILoadJSONOperationData} from '@operation/load-json.ts';\nexport {loadJson} from '@operation/load-json.ts';\nexport type {ILogOperationData} from '@operation/log.ts';\nexport {log} from '@operation/log.ts';\nexport type {IMapArrayOperationData} from '@operation/map-array.ts';\nexport {mapArray} from '@operation/map-array.ts';\nexport type {IMathOperationData} from '@operation/math.ts';\nexport {math} from '@operation/math.ts';\nexport {otherwise} from '@operation/otherwise.ts';\nexport type {IRemoveClassOperationData} from '@operation/remove-class.ts';\nexport {removeClass} from '@operation/remove-class.ts';\nexport type {IRemoveControllerFromElementOperationData} from '@operation/remove-controller-from-element.ts';\nexport {removeControllerFromElement} from '@operation/remove-controller-from-element.ts';\nexport type {IRemoveElementOperationData} from '@operation/remove-element.ts';\nexport {removeElement} from '@operation/remove-element.ts';\nexport type {IRemovePropertiesFromOperationDataOperationData} from '@operation/remove-properties-from-operation-data.ts';\nexport {removePropertiesFromOperationData} from '@operation/remove-properties-from-operation-data.ts';\nexport type {IReparentElementOperationData} from '@operation/reparent-element.ts';\nexport {reparentElement} from '@operation/reparent-element.ts';\nexport type {IReplaceStringOperationData} from '@operation/replace-string.ts';\nexport {replaceString} from '@operation/replace-string.ts';\nexport type {IReplaceTextOperationData} from '@operation/replace-text.ts';\nexport {replaceText} from '@operation/replace-text.ts';\nexport type {IRequestActionOperationData} from '@operation/request-action.ts';\nexport {requestAction} from '@operation/request-action.ts';\nexport type {ISaveToStorageOperationData} from '@operation/save-to-storage.ts';\nexport {saveToStorage} from '@operation/save-to-storage.ts';\nexport type {IScrollToElementOperationData} from '@operation/scroll-to-element.ts';\nexport {scrollToElement} from '@operation/scroll-to-element.ts';\nexport type {IScrollToPositionOperationData} from '@operation/scroll-to-position.ts';\nexport {scrollToPosition} from '@operation/scroll-to-position.ts';\nexport type {ISelectElementOperationData} from '@operation/select-element.ts';\nexport {selectElement} from '@operation/select-element.ts';\nexport type {ISetDataOperationData} from '@operation/set-data.ts';\nexport {setData} from '@operation/set-data.ts';\nexport type {ISetElementAttributesOperationData} from '@operation/set-element-attributes.ts';\nexport {setElementAttributes} from '@operation/set-element-attributes.ts';\nexport type {ISetElementContentOperationData} from '@operation/set-element-content.ts';\nexport {setElementContent} from '@operation/set-element-content.ts';\nexport type {ISetFocusOperationData} from '@operation/set-focus.ts';\nexport {setFocus} from '@operation/set-focus.ts';\nexport type {ISetFormValueOperationData} from '@operation/set-form-value.ts';\nexport {setFormValue} from '@operation/set-form-value.ts';\nexport type {ISetGlobalDataOperationData} from '@operation/set-global-data.ts';\nexport {setGlobalData} from '@operation/set-global-data.ts';\nexport type {ISetOperationData} from '@operation/set-operation-data.ts';\nexport {setOperationData} from '@operation/set-operation-data.ts';\nexport type {ISetStyleOperationData} from '@operation/set-style.ts';\nexport {setStyle} from '@operation/set-style.ts';\nexport type {ISetVariableOperationData} from '@operation/set-variable.ts';\nexport {setVariable} from '@operation/set-variable.ts';\nexport type {ISortArrayOperationData} from '@operation/sort-array.ts';\nexport {sortArray} from '@operation/sort-array.ts';\nexport type {ISplitStringOperationData} from '@operation/split-string.ts';\nexport {splitString} from '@operation/split-string.ts';\nexport type {IStartActionOperationData} from '@operation/start-action.ts';\nexport {startAction} from '@operation/start-action.ts';\nexport type {ISubstringTextOperationData} from '@operation/substring-text.ts';\nexport {substringText} from '@operation/substring-text.ts';\nexport type {IToggleClassOperationData} from '@operation/toggle-class.ts';\nexport {toggleClass} from '@operation/toggle-class.ts';\nexport type {IToggleElementOperationData} from '@operation/toggle-element.ts';\nexport {toggleElement} from '@operation/toggle-element.ts';\nexport type {IToggleFormElementOperationData} from '@operation/toggle-form-element.ts';\nexport {toggleFormElement} from '@operation/toggle-form-element.ts';\nexport type * from '@operation/types.ts';\nexport type {IValidateFormOperationData} from '@operation/validate-form.ts';\nexport {validateForm} from '@operation/validate-form.ts';\nexport type {IWaitOperationData} from '@operation/wait.ts';\nexport {wait} from '@operation/wait.ts';\nexport type {IWhenOperationData} from '@operation/when.ts';\nexport {when} from '@operation/when.ts';\n","import type {ConfigurationFactory} from '@configuration/api/configuration-factory.ts';\nimport type {\n ExtractOperationDataType,\n GetOperationByName,\n IActionConfiguration,\n IEndableActionConfiguration,\n ITimelineActionConfiguration,\n TOperationName,\n TOperationType,\n} from '@configuration/types.ts';\nimport {deepCopy} from '@operation/helper/deep-copy.ts';\nimport * as operations from '@operation/index.ts';\nimport {v4 as uuidv4} from 'uuid';\n\n/**\n *\n * Container factory capable of creating the different kinds of actions.\n * For each type of action a dedicated factory will be returned.\n *\n */\nexport class ActionCreatorFactory {\n constructor(private readonly configurationfactory: ConfigurationFactory) {}\n\n /**\n *\n * Starts the creation of an action in the `actions` list with the specified name\n *\n * @param name\n * @returns\n */\n createAction(name: string): EndableActionCreator {\n const creator = new EndableActionCreator(name, this);\n this.configurationfactory.addAction(creator.actionConfig);\n return creator;\n }\n\n /**\n *\n * Starts the creation of an action in the `initActions` list with the specified name\n *\n * @param name\n * @returns\n */\n createInitAction(name: string): EndableActionCreator {\n const creator = new EndableActionCreator(name, this);\n this.configurationfactory.addInitAction(creator.actionConfig);\n return creator;\n }\n\n /**\n *\n * Starts the creation of an action in the `eventActions` list with the specified name\n *\n * @param name\n * @returns\n */\n createEventAction(name: string): ActionCreator {\n const creator = new ActionCreator(name, this);\n this.configurationfactory.addEventAction(creator.actionConfig);\n return creator;\n }\n\n /**\n *\n * Starts the creation of an action in the `timelineActions` list with the specified name and uri\n *\n * @param uri\n * @param name\n * @returns\n */\n createTimelineAction(uri: string, name: string): TimelineActionCreator {\n const creator = new TimelineActionCreator(name, this);\n this.configurationfactory.addTimelineAction(uri, creator.actionConfig);\n return creator;\n }\n\n /**\n *\n * Returns the fluent scope back to the `Configurationfactory`\n *\n * @returns\n */\n end() {\n return this.configurationfactory;\n }\n}\n\n/**\n *\n * A factory that assists in creating an action\n *\n */\nexport class ActionCreator<\n T extends IActionConfiguration = IActionConfiguration,\n> {\n actionConfig: T;\n\n /**\n *\n * Initializes an action configuration with the given name\n *\n * @param name\n * @param factory\n */\n constructor(\n name: string | undefined,\n private readonly factory: ActionCreatorFactory\n ) {\n this.actionConfig = {\n name: name ?? '',\n id: uuidv4(),\n startOperations: [],\n } as unknown as T;\n }\n\n /**\n *\n * The unique id of the action\n *\n * @returns\n */\n getId() {\n return this.actionConfig.id;\n }\n\n /**\n *\n * Sets the name of the action\n *\n * @param name\n * @returns\n */\n setName(name: string) {\n this.actionConfig.name = name;\n return this;\n }\n\n /**\n *\n * Returns a copy of the internal state of the `ActionCreator`\n *\n * @param callBack\n * @returns\n */\n getConfiguration(callBack: (config: T) => T) {\n const copy = deepCopy(this.actionConfig);\n const newConfig = callBack.call(this, copy);\n if (newConfig) {\n this.actionConfig = newConfig;\n }\n return this;\n }\n\n /**\n *\n * Adds the operation data for a start operation specified by the given type\n *\n * @param operationClass\n * @param operationData\n * @returns\n */\n addStartOperationByType<\n T extends TOperationType,\n Dt extends Partial<ExtractOperationDataType<T>>,\n >(operationClass: T, operationData: Dt) {\n const entries = Object.entries(operations).find(\n ([, value]) => value === operationClass\n );\n\n if (entries) {\n return this.addStartOperation(\n entries[0] as TOperationName,\n operationData\n );\n }\n\n throw new Error(`Operation class not found: ${operationClass.toString()}`);\n }\n\n /**\n *\n * Adds the operation data for a start operation specified by the given system name\n *\n * @param systemName\n * @param operationData\n * @returns\n */\n addStartOperation<\n T extends TOperationName,\n O extends Partial<ExtractOperationDataType<GetOperationByName<T>>>,\n >(systemName: T, operationData: O) {\n if (!(operations as Record<string, any>)[systemName]) {\n throw Error(`Unknown operation: ${systemName}`);\n }\n\n const {startOperations} = this.actionConfig;\n startOperations.push({\n id: uuidv4(),\n systemName: systemName,\n operationData: operationData,\n });\n return this;\n }\n\n /**\n *\n * Returns the fluent scope back to the `ActionCreatorFactory`\n *\n * @returns\n */\n next() {\n return this.factory;\n }\n}\n\n/**\n *\n * A factory that assists in creating an endable action\n *\n */\nexport class EndableActionCreator<\n T extends IEndableActionConfiguration = IEndableActionConfiguration,\n> extends ActionCreator<T> {\n constructor(name: string | undefined, factory: ActionCreatorFactory) {\n super(name, factory);\n this.actionConfig.endOperations = [];\n }\n\n /**\n *\n * Adds the operation data for an end operation specified by the given type\n *\n * @param operationClass\n * @param operationData\n * @returns\n */\n addEndOperationByType<\n T extends TOperationType,\n Dt extends Partial<ExtractOperationDataType<T>>,\n >(operationClass: T, operationData: Dt) {\n const entries = Object.entries(operations).find(\n ([, value]) => value === operationClass\n );\n\n if (entries) {\n return this.addEndOperation(entries[0] as TOperationName, operationData);\n }\n\n throw new Error(`Operation class not found: ${operationClass.toString()}`);\n }\n\n /**\n *\n * Adds the operation data for an end operation specified by the given system name\n *\n * @param systemName\n * @param operationData\n * @returns\n */\n addEndOperation<\n T extends TOperationName,\n O extends Partial<ExtractOperationDataType<GetOperationByName<T>>>,\n >(systemName: TOperationName, operationData: O) {\n // biome-ignore lint/performance/noDynamicNamespaceImportAccess: Dynamic operation lookup is intentional for configuration API\n if (!operations[systemName]) {\n throw Error(`Unknown operation: ${systemName}`);\n }\n\n let {endOperations} = this.actionConfig;\n if (!endOperations) {\n endOperations = this.actionConfig.endOperations = [];\n }\n endOperations.push({\n id: uuidv4(),\n systemName: systemName,\n operationData: operationData,\n });\n return this;\n }\n}\n\n/**\n *\n * A factory that assists in creating a timeline action\n *\n */\nexport class TimelineActionCreator extends EndableActionCreator<ITimelineActionConfiguration> {\n /**\n *\n * Sets the duration specified by the given start and optional end positions\n *\n * @param start\n * @param end\n * @returns\n */\n addDuration(start: number, end?: number) {\n this.actionConfig.duration = {\n start: start,\n };\n if (end) {\n this.actionConfig.duration.end = end;\n }\n return this;\n }\n}\n","import type {ConfigurationFactory} from '@configuration/api/configuration-factory.ts';\nimport type {\n ExtractOperationDataType,\n GetOperationByName,\n IActionConfiguration,\n IEndableActionConfiguration,\n IOperationConfiguration,\n ITimelineActionConfiguration,\n TOperationName,\n TOperationType,\n} from '@configuration/types.ts';\nimport {deepCopy} from '@operation/helper/deep-copy.ts';\nimport * as operations from '@operation/index.ts';\nimport type {TOperation, TOperationData} from '@operation/types.ts';\nimport {isDefined} from 'ts-is-present';\nimport {v4 as uuidv4} from 'uuid';\nimport type {IDuration} from '../../types.ts';\n\nfunction array_move(arr: any[], old_index: number, new_index: number) {\n if (new_index >= arr.length) {\n new_index = 0;\n } else if (new_index < 0) {\n new_index = arr.length - 1;\n }\n arr.splice(new_index, 0, arr.splice(old_index, 1)[0]);\n}\n\n/**\n *\n * A factory that assists in editing an action\n *\n */\nexport class ActionEditor<\n T extends IActionConfiguration = IActionConfiguration,\n> {\n constructor(\n protected actionConfig: T,\n protected readonly configurationFactory: ConfigurationFactory\n ) {}\n\n updateConfiguration() {\n this.actionConfig = structuredClone(this.actionConfig);\n }\n\n /**\n *\n * Returns a copy of the current internal state of the factory\n *\n * @param callBack\n * @returns\n */\n getConfiguration(callBack: (config: T) => T | undefined) {\n const copy = deepCopy(this.actionConfig);\n const newConfig = callBack.call(this, copy);\n if (newConfig) {\n this.actionConfig = newConfig;\n }\n return this;\n }\n\n /**\n *\n * Sets the action name\n *\n * @param name\n * @returns\n */\n setName(name: string) {\n this.actionConfig = {\n ...this.actionConfig,\n name,\n };\n return this;\n }\n\n /**\n *\n * Gets the action name\n *\n * @returns\n */\n getName() {\n return this.actionConfig.name;\n }\n\n /**\n *\n * Adds the operation data for a start operation specified by the given type\n *\n * @param operationClass\n * @param operationData\n * @returns\n */\n addStartOperationByType<T extends TOperation<TOperationData>>(\n operationClass: T,\n operationData: Partial<ExtractOperationDataType<T>>\n ): OperationEditor<this, T> {\n const entries = Object.entries(operations).find(\n ([, value]) => value === operationClass\n );\n\n if (entries) {\n return this.addStartOperation(\n entries[0] as TOperationName,\n operationData\n ) as OperationEditor<this, T>;\n }\n\n throw new Error(`Operation class not found: ${operationClass.toString()}`);\n }\n\n /**\n *\n * Adds the operation data for a start operation specified by the given system name\n *\n * @param systemName\n * @param operationData\n * @param id\n * @returns\n */\n addStartOperation(\n systemName: TOperationName,\n operationData: TOperationData,\n id: string = uuidv4()\n ): OperationEditor<this, TOperation<TOperationData>> {\n if (!(operations as any)[systemName]) {\n throw Error(`Unknown operation: ${systemName}`);\n }\n\n const startOperations = this.actionConfig.startOperations\n ? this.actionConfig.startOperations.slice()\n : [];\n\n const newConfig = {\n id,\n systemName: systemName,\n operationData: operationData,\n } as IOperationConfiguration<TOperation<TOperationData>>;\n\n startOperations.push(newConfig);\n\n this.actionConfig = {\n ...this.actionConfig,\n startOperations,\n };\n\n return new OperationEditor<this, TOperation<TOperationData>>(\n newConfig,\n this\n );\n }\n\n /**\n *\n * Starts an editor for the start operation associated with the given id\n *\n * @param id\n * @returns\n */\n editStartOperation(id: string) {\n const {startOperations} = this.actionConfig;\n const operation = startOperations.find(o => o.id === id);\n\n if (isDefined(operation)) {\n return new OperationEditor<ActionEditor<T>, TOperation<TOperationData>>(\n operation,\n this\n );\n }\n\n throw new Error(`start operation not found for id ${id}`);\n }\n\n /**\n *\n * Removes the start operation associated with the given id\n *\n * @param id\n * @returns\n */\n removeStartOperation(id: string) {\n const startOperations = this.actionConfig.startOperations\n ? this.actionConfig.startOperations.slice()\n : [];\n const operation = startOperations.find(o => o.id === id);\n\n if (!operation) {\n throw new Error(`start operation not found for id ${id}`);\n }\n\n const idx = startOperations.indexOf(operation);\n\n if (idx > -1) {\n startOperations.splice(idx, 1);\n this.actionConfig = {\n ...this.actionConfig,\n startOperations,\n };\n }\n\n return this;\n }\n\n /**\n *\n * Moves the start operation associated with the given id in the given direction\n *\n * @param id\n * @param direction\n * @returns\n */\n moveStartOperation(id: string, direction: 'up' | 'down') {\n const startOperations = this.actionConfig.startOperations\n ? this.actionConfig.startOperations.slice()\n : [];\n const operation = startOperations.find(o => o.id === id);\n\n if (!operation) {\n throw new Error(`start operation not found for id ${id}`);\n }\n\n const idx = startOperations.indexOf(operation);\n\n if (idx > -1) {\n const newIdx = direction === 'up' ? idx + 1 : idx - 1;\n array_move(startOperations, idx, newIdx);\n this.actionConfig = {\n ...this.actionConfig,\n startOperations,\n };\n }\n\n return this;\n }\n\n /**\n *\n * Return the fluent scopt to the `ConfigurationFactory`\n *\n * @returns\n */\n next() {\n return this.configurationFactory;\n }\n}\n\n/**\n *\n * A factory that assists in editing an endable action\n *\n */\nexport class EndableActionEditor<\n T extends IEndableActionConfiguration = IEndableActionConfiguration,\n> extends ActionEditor<T> {\n /**\n *\n * Adds the operation data for a end operation specified by the given type\n *\n * @param operationClass\n * @param operationData\n * @returns\n */\n addEndOperationByType<\n T extends TOperationType,\n Dt extends Partial<ExtractOperationDataType<T>>,\n >(\n operationClass: T,\n operationData: Dt\n ): OperationEditor<this, TOperationType> {\n const entries = Object.entries(operations).find(\n ([, value]) => value === operationClass\n );\n\n if (entries) {\n return this.addEndOperation(entries[0] as TOperationName, operationData);\n }\n\n throw new Error(`Operation class not found: ${operationClass.toString()}`);\n }\n\n /**\n *\n * Adds the operation data for a start operation specified by the given system name\n *\n * @param systemName\n * @param operationData\n * @returns\n */\n addEndOperation<\n T extends TOperationName,\n O extends Partial<ExtractOperationDataType<GetOperationByName<T>>>,\n >(systemName: TOperationName, operationData: O) {\n // biome-ignore lint/performance/noDynamicNamespaceImportAccess: Dynamic operation lookup is intentional for configuration API\n if (!operations[systemName]) {\n throw Error(`Unknown operation: ${systemName}`);\n }\n\n const endOperations = this.actionConfig.endOperations\n ? this.actionConfig.endOperations.slice()\n : [];\n\n const newConfig = {\n id: uuidv4(),\n systemName: systemName,\n operationData: operationData,\n };\n\n endOperations.push(newConfig);\n\n this.actionConfig.endOperations = endOperations;\n\n // biome-ignore lint/performance/noDynamicNamespaceImportAccess: Dynamic operation lookup is intentional for configuration API\n const operationCsl = operations[systemName];\n return new OperationEditor<this, typeof operationCsl>(newConfig, this);\n }\n\n /**\n *\n * Starts an editor for the end operation associated with the given id\n *\n * @param id\n * @returns\n */\n editEndOperation(id: string) {\n const {endOperations} = this.actionConfig;\n const operationConfig = endOperations.find(o => o.id === id);\n\n if (isDefined(operationConfig)) {\n return new OperationEditor<this>(operationConfig, this);\n }\n\n throw new Error(`operation not found for id ${id}`);\n }\n\n /**\n *\n * Removes the end operation associated with the given id\n *\n * @param id\n * @returns\n */\n removeEndOperation(id: string) {\n const endOperations = this.actionConfig.endOperations\n ? this.actionConfig.endOperations.slice()\n : [];\n const operation = endOperations.find(o => o.id === id);\n\n if (!isDefined(operation)) {\n throw new Error(`operation not found for id ${id}`);\n }\n\n const idx = endOperations.indexOf(operation);\n\n if (idx > -1) {\n endOperations.splice(idx, 1);\n this.actionConfig = {\n ...this.actionConfig,\n endOperations,\n };\n }\n\n return this;\n }\n\n /**\n *\n * Moves the end operation associated with the given id in the specified direction\n *\n * @param id\n * @param direction\n * @returns\n */\n moveEndOperation(id: string, direction: 'up' | 'down') {\n const endOperations = this.actionConfig.endOperations\n ? this.actionConfig.endOperations.slice()\n : [];\n const operation = endOperations.find(o => o.id === id);\n\n if (!isDefined(operation)) {\n throw new Error(`operation not found for id ${id}`);\n }\n\n const idx = endOperations.indexOf(operation);\n\n if (idx > -1) {\n const newIdx = direction === 'up' ? idx + 1 : idx - 1;\n array_move(endOperations, idx, newIdx);\n this.actionConfig = {\n ...this.actionConfig,\n endOperations,\n };\n }\n return this;\n }\n}\n\n/**\n *\n * A factory that assists in editing a timeline action\n *\n */\nexport class TimelineActionEditor extends EndableActionEditor<ITimelineActionConfiguration> {\n /**\n *\n * Sets the duration specified by the given start and optional end positions\n *\n * @param start\n * @param end\n * @returns\n */\n setDuration(start: number, end?: number) {\n if (end !== undefined && start > end) {\n throw Error('start position cannot be higher than end position');\n }\n\n const duration: IDuration = {\n start,\n };\n\n if (end) {\n duration.end = end;\n }\n\n this.actionConfig = {\n ...this.actionConfig,\n duration,\n };\n return this;\n }\n}\n\n/**\n *\n * A factory that assists in editing an operation\n *\n */\nexport class OperationEditor<\n T extends ActionEditor,\n O extends TOperationType = TOperation<TOperationData>,\n> {\n constructor(\n private operationConfig: IOperationConfiguration<\n ExtractOperationDataType<O>\n >,\n private actionEditor: T\n ) {}\n\n /**\n *\n * Invokes the given callback with a copy of the internal state of the factory\n *\n * @param callBack\n * @returns\n */\n getConfiguration(\n callBack: (\n config: IOperationConfiguration<ExtractOperationDataType<O>>\n ) => IOperationConfiguration<ExtractOperationDataType<O>>\n ) {\n const copy = deepCopy(this.operationConfig);\n const newConfig = callBack.call(this, copy);\n\n if (newConfig) {\n this.operationConfig = newConfig;\n }\n\n return this;\n }\n\n /**\n *\n * Gets the system name\n *\n * @returns\n */\n getSystemName() {\n return this.operationConfig.systemName;\n }\n\n /**\n *\n * Sets the system name\n *\n * @param systemName\n * @returns\n */\n setSystemName(systemName: TOperationName) {\n // biome-ignore lint/performance/noDynamicNamespaceImportAccess: Dynamic operation lookup is intentional for configuration API\n if (!operations[systemName]) {\n throw Error(`Unknown operation: ${systemName}`);\n }\n\n this.operationConfig.systemName = systemName;\n this.actionEditor.updateConfiguration();\n return this;\n }\n\n /**\n *\n * Sets the operation data\n *\n * @param operationData\n * @returns\n */\n setOperationData(operationData: ExtractOperationDataType<O>) {\n this.operationConfig.operationData = operationData;\n this.actionEditor.updateConfiguration();\n return this;\n }\n\n /**\n *\n * Sets the value on the current `operationData` with the given key\n *\n * @param key\n * @param value\n * @returns\n */\n setOperationDataItem(\n key: keyof ExtractOperationDataType<O>,\n value: ExtractOperationDataType<O>[keyof ExtractOperationDataType<O>]\n ) {\n let {operationData} = this.operationConfig;\n if (!operationData) {\n operationData = {} as ExtractOperationDataType<O>;\n }\n operationData[key] = value;\n return this.setOperationData(operationData);\n }\n\n /**\n *\n * returns all of the defined property names on the current `operationData`\n *\n * @returns\n */\n getOperationDataKeys(): keyof ExtractOperationDataType<O> {\n const {operationData} = this.operationConfig;\n return (operationData\n ? Object.keys(operationData)\n : []) as unknown as keyof ExtractOperationDataType<O>;\n }\n\n /**\n *\n * Gets the value of the given key on the current `operationData`\n *\n * @param key\n * @returns\n */\n getOperationDataValue(key: keyof ExtractOperationDataType<O>) {\n const {operationData} = this.operationConfig;\n return operationData?.[key];\n }\n\n /**\n *\n * Returns the fluent scope back to the action editor\n *\n * @returns\n */\n next() {\n return this.actionEditor;\n }\n}\n","import type {ConfigurationFactory} from '@configuration/api/configuration-factory.ts';\nimport type {\n IContainerProviderConfig,\n IPlaylistConfig,\n IPositionSourceConfig,\n ITimelineProviderSettings,\n TTimelineProviderSettings,\n} from '@configuration/types.ts';\nimport type {TimelineTypes} from '../../types.ts';\n\n/**\n * Default position source system names for convenience methods.\n */\nconst DEFAULT_POSITION_SOURCES: Record<string, string> = {\n raf: 'RafPositionSource',\n scroll: 'ScrollPositionSource',\n video: 'VideoPositionSource',\n};\n\n/**\n * Default container provider system name.\n */\nconst DEFAULT_CONTAINER_PROVIDER = 'DomContainerProvider';\n\n/**\n * Default playlist system name.\n */\nconst DEFAULT_PLAYLIST = 'SimplePlaylist';\n\nexport class TimelineProvidersSettingsEditor {\n constructor(\n private providersSettings: TTimelineProviderSettings,\n private configurationFactory: ConfigurationFactory\n ) {}\n\n /**\n * Adds a new provider for the specified timeline type.\n *\n * @param timelineType - The timeline type (e.g., 'animation', 'mediaplayer')\n * @param positionSourceSystemName - System name of the position source class (default: 'RafPositionSource')\n * @returns A TimelineProviderSettingsEditor for further configuration\n */\n addProvider(\n timelineType: TimelineTypes,\n positionSourceSystemName = 'RafPositionSource'\n ) {\n if (this.providersSettings[timelineType]) {\n throw new Error(\n `Settings for a '${timelineType}' provider already exist`\n );\n }\n\n const settings: ITimelineProviderSettings = {\n positionSource: {systemName: positionSourceSystemName},\n };\n this.providersSettings[timelineType] = settings;\n return new TimelineProviderSettingsEditor(\n settings,\n this,\n this.configurationFactory\n );\n }\n\n editProvider(timelineType: TimelineTypes) {\n if (!this.providersSettings[timelineType]) {\n throw new Error(`No settings for a '${timelineType}' provider exist yet`);\n }\n\n return new TimelineProviderSettingsEditor(\n this.providersSettings[timelineType] as ITimelineProviderSettings,\n this,\n this.configurationFactory\n );\n }\n\n next() {\n return this.configurationFactory;\n }\n}\n\nexport class TimelineProviderSettingsEditor {\n constructor(\n private providerSettings: ITimelineProviderSettings,\n private providersSettingsEditor: TimelineProvidersSettingsEditor,\n private configurationFactory: ConfigurationFactory\n ) {}\n\n /**\n * Sets the position source configuration with full config object.\n * @param config - Position source configuration with systemName and options\n */\n setPositionSource(config: IPositionSourceConfig) {\n this.providerSettings.positionSource = config;\n return this;\n }\n\n /**\n * Sets the position source by system name with optional configuration.\n * @param systemName - The position source class name (e.g., 'RafPositionSource')\n * @param options - Additional options passed to the position source constructor\n */\n setPositionSourceByName(\n systemName: string,\n options?: Record<string, unknown>\n ) {\n this.providerSettings.positionSource = {\n systemName,\n ...options,\n };\n return this;\n }\n\n /**\n * Convenience method to set position source using shorthand type names.\n * @param type - Shorthand type ('raf', 'scroll', 'video')\n * @param options - Type-specific options\n * @deprecated Use setPositionSourceByName for explicit control\n */\n setPositionSourceType(\n type: 'raf' | 'scroll' | 'video',\n options?: {selector?: string; tickInterval?: number; poster?: string}\n ) {\n const systemName = DEFAULT_POSITION_SOURCES[type];\n if (!systemName) {\n throw new Error(`Unknown position source type: ${type}`);\n }\n\n this.providerSettings.positionSource = {\n systemName,\n ...options,\n };\n return this;\n }\n\n /**\n * Sets the container provider configuration by selector.\n * Uses DomContainerProvider by default.\n * @param selector - CSS selector for the container element\n */\n setContainer(selector: string) {\n this.providerSettings.container = {\n systemName: DEFAULT_CONTAINER_PROVIDER,\n selector,\n };\n return this;\n }\n\n /**\n * Sets the container provider configuration with full config object.\n * @param config - Container provider configuration with systemName\n */\n setContainerConfig(config: IContainerProviderConfig) {\n this.providerSettings.container = config;\n return this;\n }\n\n /**\n * Sets the container provider by system name with options.\n * @param systemName - The container provider class name\n * @param options - Additional options passed to the container provider constructor\n */\n setContainerByName(systemName: string, options: Record<string, unknown>) {\n this.providerSettings.container = {\n systemName,\n ...options,\n } as IContainerProviderConfig;\n return this;\n }\n\n /**\n * Sets the playlist configuration.\n * Uses SimplePlaylist by default.\n * @param items - Array of playlist items\n * @param identifierKey - Key used to identify items (default: 'uri')\n */\n setPlaylist<T>(items: readonly T[], identifierKey = 'uri') {\n this.providerSettings.playlist = {\n systemName: DEFAULT_PLAYLIST,\n items,\n identifierKey,\n } as IPlaylistConfig;\n return this;\n }\n\n /**\n * Sets the playlist configuration with full config object.\n * @param config - Playlist configuration with systemName\n */\n setPlaylistConfig(config: IPlaylistConfig) {\n this.providerSettings.playlist = config;\n return this;\n }\n\n /**\n * Sets the playlist by system name with options.\n * @param systemName - The playlist class name\n * @param options - Additional options including items and identifierKey\n */\n setPlaylistByName(\n systemName: string,\n options: {items: unknown[]; identifierKey: string; [key: string]: unknown}\n ) {\n this.providerSettings.playlist = {\n systemName,\n ...options,\n } as IPlaylistConfig;\n return this;\n }\n\n next() {\n return this.providersSettingsEditor;\n }\n\n end() {\n return this.configurationFactory;\n }\n}\n","/**\n *\n * Merges the properties of the target object into the source object, only the properties that do not exist yet on the source.\n *\n * This function is pure, so it returns a new instance that reflects the merging of the two objects.\n *\n * The merge is shallow.\n *\n * @param target\n * @param source\n * @returns\n */\nexport const mergeIfMissing = <\n Src extends Record<PropertyKey, any>,\n Trg extends Partial<Src> & Record<PropertyKey, any>,\n>(\n target: Src,\n source: Trg\n): Src & Trg =>\n Object.entries(source).reduce(\n (acc, [key, value]) => (key in acc ? acc : {...acc, [key]: value}),\n target\n );\n","import {ActionCreatorFactory} from '@configuration/api/action-creator-factory.ts';\nimport {\n ActionEditor,\n EndableActionEditor,\n TimelineActionEditor,\n} from '@configuration/api/action-editor.ts';\nimport {TimelineProvidersSettingsEditor} from '@configuration/api/timeline-provider-settings-editor.ts';\nimport type {\n IActionConfiguration,\n IEngineConfiguration,\n ITimelineActionConfiguration,\n ITimelineConfiguration,\n} from '@configuration/types.ts';\nimport {deepCopy} from '@operation/helper/deep-copy.ts';\nimport {mergeIfMissing} from '@util/merge-if-missing.ts';\nimport {v4 as uuidv4} from 'uuid';\nimport type {KeysOfType, TimelineTypes, TLanguageCode} from '../../types.ts';\n\n/** */\nexport type TEngineConfigurationLists = KeysOfType<IEngineConfiguration, any[]>;\n\ntype ConfigurationFactoryExtension<NewFactory extends ConfigurationFactory> = (\n this: NewFactory,\n ...rest: any[]\n) => void;\n\n/**\n * This class offers a fluent, extensible and strongly typed DSL for creating Eligius configurations.\n *\n * @example Building a configuration using the factory\n * To initialize a basic configuration to start off of:\n * ```ts\n * const factory = new ConfigurationFactory()\n * .init(\"en-US\") // Define the default language\n * .addLanguage(\"en-US\", \"English\") // Add English as a supported language\n * .addLanguage(\"nl-NL\", \"Nederlands\") // Add Dutch as a supported language\n * .setLayoutTemplate(\"<div class=\\\"main.container\\\"></div>\") // Add the main container for the presentation\n * .setContainerSelector(\"#ct-container\") // Selector for the element in the body that will contain the presentation\n * .addTimeline( // Add a first timeline\n * 'timeline-1', // Give it a name\n * \"animation\", // This is RAF based timeline\n * 200, // The duration of the timeline in seconds\n * false, // The presentation does NOT play in a loop\n * \".timeline-container\" // The element within the main layout (defined by the layoutTemplate) in which the timeline will be rendered\n * )\n * .editTimelineProviderSettings() // Add a timeline provider\n * .addProvider(\"animation\") // One that provides timelines for type 'animation'\n * .setSystemName(\"RequestAnimationFrameTimelineProvider\") // The system name of the provider\n * .setVendor(\"eligius\") // Eligius is the vendor in this case\n * .end(); // This finally returns the ConfigurationFactory instance\n * ```\n *\n * Then to add an init action:\n * ```ts\n * factory\n * .createInitAction(\"GetUserName\")\n * .addStartOperationByType(getQueryParams, {\n * defaultValues: { username: \"guest\" },\n * })\n * .addStartOperationByType(setGlobalData, { properties: [\"queryParams\"] });\n * ```\n *\n * After that, add a timeline action:\n * ```ts\n * factory.createTimelineAction(\"timeline-1\", \"AddIntroContainer\")\n * .addDuration(0, 10)\n * .addStartOperationByType(selectElement, { selector: \".timeline-container\" })\n * .addStartOperationByType(setElementContent, {\n * template: '<div class=\"intro-text\"></div>',\n * })\n * .addEndOperationByType(selectElement, { selector: \".intro-text\" })\n * .addEndOperationByType(removeElement, {});\n * ```\n *\n * It also possible to extend the factory with specialized creation methods for the particular\n * configuration you are building:\n * ```ts\n * function addImage(this: ConfigurationFactory, actionName: string, imageSrc: string, imageId: string) {\n * this.createInitAction(actionName)\n * .addStartOperationByType(selectElement, { selector: \".timeline-container\" })\n * .addStartOperationByType(createElement, { element: 'img', attributes: {src: imageSrc, imageId} })\n * .addStartOperationByType(setElementContent, { insertionType: \"append\" })\n * .addEndOperationByType(selectElement, { selector: `#${imageId}` })\n * .addEndOperationByType(removeElement, {});\n * }\n *\n * const customFactory = ConfigurationFactory.extend(factory, \"addImage\", addImage);\n *\n * customFactory.addImage(\"MyImageActionName\", \"my-image.png\", \"my-image-id\");\n * ```\n *\n * Finally, retrieve the configuration and save it:\n * ```ts\n * import fs from \"node:fs\";\n *\n * const configuration = customFactory.getConfiguration();\n *\n * fs.writeFileSync(\"/my/path/configuration.json\", JSON.stringify(configuration), {encoding:'utf-8'})\n * ```\n *\n * The `ConfigurationFactory` can also be used to edit an existing configuration. In this case, simply\n * pass the JSON configuration to the `ConfigurationFactory`'s constructor:\n * ```ts\n * import myConfiguration from './my-configuration.json';\n *\n * const factory = new ConfigurationFactory(myConfiguration);\n *\n * factory.editInitAction(\"existingActionName\")\n * .removeEndOperation(\"475fd0ab-5755-4e60-8f7c-e1988a109678\");\n * ```\n */\nexport class ConfigurationFactory {\n actionCreatorFactory: ActionCreatorFactory;\n\n /**\n * Constructs a new `ConfigurationFactory`\n * @param config an optional existing configuration that will be used as a starting point\n */\n constructor(public configuration: IEngineConfiguration = {} as any) {\n this.actionCreatorFactory = new ActionCreatorFactory(this);\n }\n\n /**\n * Add specialized method to a factory\n *\n * @param factory\n * @param extensionMethodName\n * @param extensionMethod\n * @returns\n */\n static extend<\n T extends ConfigurationFactory,\n K extends PropertyKey,\n C extends (this: T & {[P in K]: C}, ...args: any[]) => any,\n >(factory: T, extensionMethodName: K, extensionMethod: C): T & {[P in K]: C} {\n return Object.defineProperty<T & {[P in K]: C}>(\n factory as any,\n extensionMethodName,\n {\n value: function (this: T & {[P in K]: C}, ...args: Parameters<C>) {\n return extensionMethod.apply(this, args);\n },\n writable: true,\n configurable: true,\n }\n );\n }\n\n /**\n * Add specialized methods to a factory\n *\n * @param factory\n * @param extensions\n * @returns\n */\n static extendMultiple<\n T extends ConfigurationFactory,\n C extends ConfigurationFactoryExtension<T>,\n D extends {[name: string]: C},\n >(factory: T, extensions: D) {\n return Object.entries(extensions).reduce<T & typeof extensions>(\n (acc, [name, method]) =>\n ConfigurationFactory.extend(acc, name, method) as T & typeof extensions,\n factory as T & typeof extensions\n );\n }\n\n /**\n * Initialize the configuration with a minimal shape.\n *\n * It assigns an ID, sets the engine to `EligiusEngine`, default the containerSelector `[data-ct-container=true]`\n * and initializes all of the list properties with empty arrays.\n * @param defaultLanguage\n * @returns\n */\n init(defaultLanguage: TLanguageCode) {\n const newConfiguration: IEngineConfiguration = {\n id: uuidv4(),\n engine: {\n systemName: 'EligiusEngine',\n },\n containerSelector: '[data-ct-container=true]',\n cssFiles: [],\n timelineProviderSettings: {},\n language: defaultLanguage,\n availableLanguages: [],\n layoutTemplate: '',\n initActions: [],\n actions: [],\n timelines: [],\n };\n\n this.configuration = mergeIfMissing(this.configuration, newConfiguration);\n\n return this;\n }\n\n /**\n * Assigns the engine system name\n * @param systemName\n * @returns\n */\n setEngine(systemName: string) {\n this.configuration.engine.systemName = systemName;\n return this;\n }\n\n /**\n * Assigns a string representation of the HTML layout template for the engine.\n *\n * @param layoutTemplate\n * @returns\n */\n setLayoutTemplate(layoutTemplate: string) {\n this.configuration.layoutTemplate = layoutTemplate;\n return this;\n }\n\n /**\n *\n * Assigns the default language\n *\n * @param defaultLanguage\n * @returns\n */\n setDefaultLanguage(defaultLanguage: TLanguageCode) {\n this.configuration.language = defaultLanguage;\n return this;\n }\n\n /**\n *\n * Assign the css selector that specifies the DOM location where the engine renders its output\n *\n * @param selector\n * @returns\n */\n setContainerSelector(selector: string) {\n this.configuration.containerSelector = selector;\n return this;\n }\n\n /**\n *\n * Starts an editing process for the timeline provider settings.\n *\n * @returns\n */\n editTimelineProviderSettings() {\n return new TimelineProvidersSettingsEditor(\n this.configuration.timelineProviderSettings || {},\n this\n );\n }\n\n /**\n *\n * Return a copy of the current state of the configuration\n *\n * @param callBack the callback receives the configuration as well and can return a mutated version wich will be assigned to the factory's internal state\n * @returns\n */\n getConfiguration(\n callBack?: (copy: IEngineConfiguration) => IEngineConfiguration\n ) {\n const copy = deepCopy<IEngineConfiguration>(this.configuration);\n if (callBack) {\n const newConfig = callBack.call(this, copy);\n this.configuration = deepCopy<IEngineConfiguration>(newConfig);\n }\n return copy;\n }\n\n /**\n *\n * Adds a language to the `availableLanguages` list.\n * The label represents the name of the language.\n *\n * An error is thrown if a language with the given language code already exists\n *\n * @example\n * factory.addLanguage('en-GB', 'English');\n *\n * @param languageCode The given alnguage code\n * @param languageLabel The human readable name of the language\n * @returns\n */\n addLanguage(languageCode: TLanguageCode, languageLabel: string) {\n const languages = this._initializeCollection(\n this.configuration,\n 'availableLanguages'\n );\n const existing = languages.find(lang => lang.languageCode === languageCode);\n\n if (existing) {\n throw new Error(`Language code '${languageCode}' already exists`);\n }\n\n languages.push({\n id: uuidv4(),\n languageCode: languageCode,\n label: languageLabel,\n });\n return this;\n }\n\n private _internalAddAction(\n collectionName: TEngineConfigurationLists,\n action: IActionConfiguration\n ) {\n const actions = this._initializeCollection(\n this.configuration,\n collectionName\n );\n actions?.push(action as any);\n }\n\n private _initializeCollection<T, K extends keyof T>(\n parent: T,\n name: K\n ): T[K] {\n if (!parent[name]) {\n (parent[name] as any) = [];\n }\n return parent[name] as T[K];\n }\n\n /**\n *\n * Adds the specified action to the `actions` list.\n *\n * @param action\n */\n addAction(action: IActionConfiguration) {\n this._internalAddAction('actions', action);\n }\n\n /**\n *\n * Adds the specified action to the `initActions` list\n *\n * @param action\n */\n addInitAction(action: IActionConfiguration) {\n this._internalAddAction('initActions', action);\n }\n\n /**\n *\n * Adds the specified action to the `eventActions` list\n *\n * @param action\n */\n addEventAction(action: IActionConfiguration) {\n this._internalAddAction('eventActions', action);\n }\n\n /**\n *\n * Adds the given actions to `timelineActions` list that is associated with the specified uri\n *\n * @param uri\n * @param action\n */\n addTimelineAction(uri: string, action: ITimelineActionConfiguration) {\n const timeline = this.getTimeline(uri);\n if (timeline) {\n const timelineActions = this._initializeCollection(\n timeline,\n 'timelineActions'\n );\n timelineActions.push(action);\n } else {\n throw Error(`No timeline found for uri '${uri}'`);\n }\n }\n\n /**\n *\n * Starts the creation of a new action with the specified name that gets added to the `actions` list\n *\n * @param name\n * @returns\n */\n createAction(name: string) {\n return this.actionCreatorFactory.createAction(name);\n }\n\n /**\n *\n * Starts the creation of a new action with the specified name that gets added to the `initActions` list\n *\n * @param name\n * @returns\n */\n createInitAction(name: string) {\n return this.actionCreatorFactory.createInitAction(name);\n }\n\n /**\n *\n * Starts the creation of a new action with the specified name that gets added to the `eventActions` list\n *\n * @param name\n * @returns\n */\n createEventAction(name: string) {\n return this.actionCreatorFactory.createEventAction(name);\n }\n\n /**\n *\n * Starts the creation of a new action with the specified name that gets added to the `timelineActions` list that is associated with the specified uri\n *\n * @param uri\n * @param name\n * @returns\n */\n createTimelineAction(uri: string, name: string) {\n return this.actionCreatorFactory.createTimelineAction(uri, name);\n }\n\n /**\n * Add a timeline with the given data\n *\n * @param uri identifier for the timeline\n * @param type animation or mediaplayer\n * @param duration the duration of the timeline in seconds\n * @param isLooped True if the timeline should automatically restart at the end\n * @param selector css selector for the container where the timeline will be rendered\n * @returns\n */\n addTimeline(\n uri: string,\n type: TimelineTypes,\n duration: number,\n isLooped: boolean,\n selector: string\n ) {\n const timelines = this._initializeCollection(\n this.configuration,\n 'timelines'\n );\n const timeline = this.getTimeline(uri);\n if (timeline) {\n throw Error(`timeline for uri ${uri} already exists`);\n }\n const timelineConfig: ITimelineConfiguration = {\n id: uuidv4(),\n type: type,\n uri: uri,\n duration: duration,\n loop: isLooped,\n selector: selector,\n timelineActions: [],\n };\n timelines.push(timelineConfig);\n return this;\n }\n\n /**\n *\n * Gets the timeline associated with the specified uri\n *\n * @param uri\n * @returns\n */\n getTimeline(uri: string) {\n return this.configuration.timelines.find(t => t.uri === uri);\n }\n\n /**\n *\n * Removes the timeline associated with the specified uri\n *\n * @param uri\n * @returns\n */\n removeTimeline(uri: string) {\n const timelineConfig = this.getTimeline(uri);\n if (timelineConfig) {\n const idx = this.configuration.timelines.indexOf(timelineConfig);\n if (idx > -1) {\n this.configuration.timelines.splice(idx, 1);\n }\n }\n return this;\n }\n\n /**\n *\n * Starts an editor for the action from the `actions` list associated with the given id\n *\n * @param id\n * @returns\n */\n editAction(id: string) {\n const actionConfig = this.configuration.actions.find(a => a.id === id);\n if (actionConfig) {\n return new EndableActionEditor(actionConfig, this);\n }\n throw new Error(`Action not found for id ${id}`);\n }\n\n /**\n *\n * Starts an editor for the action from the `eventActions` list associated with the given id\n *\n * @param id\n * @returns\n */\n editEventAction(id: string) {\n const actionConfig = this.configuration.eventActions?.find(\n a => a.id === id\n );\n if (actionConfig) {\n return new ActionEditor(actionConfig, this);\n }\n throw new Error(`Event action not found for id ${id}`);\n }\n\n /**\n *\n * Starts an editor for the action from the `initActions` list associated with the given id\n *\n * @param id\n * @returns\n */\n editInitAction(id: string) {\n const actionConfig = this.configuration.initActions.find(a => a.id === id);\n if (actionConfig) {\n return new EndableActionEditor(actionConfig, this);\n }\n throw new Error(`Init action not found for id ${id}`);\n }\n\n /**\n *\n * Starts an editor for the action from the `timelineActions` list associated with the given uri and id\n *\n * @param uri\n * @param id\n * @returns\n */\n editTimelineAction(uri: string, id: string) {\n const timeline = this.getTimeline(uri);\n if (!timeline) {\n throw new Error(`Timeline not found for id ${id}`);\n }\n const actionConfig = timeline.timelineActions.find(a => a.id === id);\n if (actionConfig) {\n return new TimelineActionEditor(actionConfig, this);\n }\n throw new Error(`Timeline action not found for id ${id}`);\n }\n}\n","import type {IEndableAction} from '@action/types.ts';\nimport type {IController} from '@controllers/types.ts';\nimport type {IEventbus} from '@eventbus/types.ts';\nimport {deepCopy} from '@operation/helper/deep-copy.ts';\nimport type {TOperationData} from '@operation/types.ts';\n\ninterface IActionInstanceInfo {\n start: boolean;\n action: IEndableAction;\n}\n\nexport interface IDOMEventListenerControllerOperationData {\n /**\n * @dependency\n */\n selectedElement: JQuery;\n /**\n * @type=ParameterType:eventName\n * @required\n */\n eventName: string;\n actions: string[];\n /**\n * @type=ParameterType:object\n */\n actionOperationData?: TOperationData;\n}\n\n/**\n * This controller attaches to the given selected element and adds a DOM event listener for the specified event name that\n * executes the given actions with the given operation data.\n *\n * By default the `start` operations of the specified actions are executed. To execute the `end` operations instead,\n * prefix the action name with `end:`.\n */\nexport class DOMEventListenerController\n implements IController<IDOMEventListenerControllerOperationData>\n{\n operationData?: IDOMEventListenerControllerOperationData;\n actionInstanceInfos?: IActionInstanceInfo[];\n name = 'DOMEventListenerController';\n\n init(operationData: IDOMEventListenerControllerOperationData) {\n this.operationData = {\n selectedElement: operationData.selectedElement,\n eventName: operationData.eventName,\n actions: operationData.actions.slice(),\n actionOperationData: deepCopy(operationData.actionOperationData),\n };\n }\n\n attach(eventbus: IEventbus) {\n if (!this.operationData) {\n return;\n }\n\n const {selectedElement, actions, eventName} = this.operationData;\n if (!this.actionInstanceInfos) {\n this.actionInstanceInfos = [];\n\n actions.forEach((actionName: string) => {\n const [isStart, name] = this._isStartAction(actionName);\n const actionInstance = eventbus.request<IEndableAction>(\n 'request-action',\n name\n );\n if (actionInstance) {\n this.actionInstanceInfos?.push({\n start: isStart,\n action: actionInstance,\n });\n }\n });\n\n selectedElement.on(eventName, this._eventHandler.bind(this));\n }\n }\n\n private _isStartAction(actionName: string): [boolean, string] {\n const prefix = actionName.substring(0, 'end:'.length);\n if (prefix === 'end:') {\n return [false, actionName.substring('end:'.length)];\n } else {\n return [true, actionName];\n }\n }\n\n private _eventHandler(event: any) {\n if (!this.operationData || !this.actionInstanceInfos) {\n return;\n }\n\n const actionOperationData = this.operationData.actionOperationData\n ? deepCopy(this.operationData.actionOperationData)\n : {};\n\n if (event.target) {\n actionOperationData.eventTarget = event.target;\n }\n\n this._executeAction(this.actionInstanceInfos, actionOperationData, 0);\n }\n\n private async _executeAction(\n actions: IActionInstanceInfo[],\n operationData: TOperationData,\n idx: number\n ) {\n if (idx < actions.length) {\n const actionInfo = actions[idx];\n const {action} = actionInfo;\n const method = actionInfo.start\n ? action.start.bind(action)\n : action.end.bind(action);\n const resultOperationData = await method(operationData);\n this._executeAction(\n actions,\n Object.assign(operationData, resultOperationData),\n ++idx\n );\n }\n }\n\n detach(_eventbus: IEventbus) {\n this.operationData?.selectedElement.off(this.operationData.eventName);\n }\n}\n","import type {IController} from '@controllers/types.js';\nimport type {EventName, IEventbus, TEventbusRemover} from '@eventbus/types.js';\nimport type {TOperationData} from '@operation/types.js';\n\n/**\n * Abstract base class for controllers providing standardized event listener management\n *\n * Benefits:\n * - Eliminates boilerplate event listener tracking code\n * - Automatic binding of event handlers to controller instance\n * - Centralized cleanup preventing memory leaks\n * - Consistent event management pattern across all controllers\n *\n * @example\n * ```typescript\n * class MyController extends BaseController<IMyOperationData> {\n * name = 'MyController';\n *\n * init(operationData: IMyOperationData): void {\n * this.operationData = operationData;\n * }\n *\n * attach(eventbus: IEventbus): void {\n * this.addListener(eventbus, 'my-event', this.handleMyEvent);\n * // Handler automatically bound, cleanup tracked\n * }\n *\n * private handleMyEvent(): void {\n * // 'this' context preserved\n * }\n * }\n * ```\n */\nexport abstract class BaseController<T extends TOperationData>\n implements IController<T>\n{\n // Public properties (required by IController)\n public operationData: T | null = null;\n public abstract name: string;\n\n // Protected state\n protected eventListeners: TEventbusRemover[] = [];\n\n /**\n * Register event listener with automatic binding and cleanup tracking\n *\n * @param eventbus - The eventbus to register with\n * @param eventName - Name of the event to listen for\n * @param handler - Event handler function (will be bound to this controller)\n */\n protected addListener(\n eventbus: IEventbus,\n eventName: EventName,\n handler: (...args: any[]) => void\n ): void {\n const boundHandler = handler.bind(this);\n const remover = eventbus.on(eventName, boundHandler as any);\n this.eventListeners.push(remover);\n }\n\n /**\n * Register multiple event listeners at once\n *\n * @param eventbus - The eventbus to register with\n * @param listeners - Array of {eventName, handler} pairs\n */\n protected attachMultiple(\n eventbus: IEventbus,\n listeners: Array<{eventName: string; handler: (...args: any[]) => void}>\n ): void {\n listeners.forEach(({eventName, handler}) => {\n this.addListener(eventbus, eventName as EventName, handler);\n });\n }\n\n /**\n * Clean up all tracked event listeners\n * Prevents memory leaks by removing all registered handlers\n *\n * @param _eventbus - The eventbus (ignored, included for IController compatibility)\n */\n public detach(_eventbus: IEventbus): void {\n this.eventListeners.forEach(remover => remover());\n this.eventListeners = [];\n }\n\n // Abstract methods (must be implemented by subclasses)\n public abstract init(operationData: T): void;\n public abstract attach(eventbus: IEventbus): Promise<any> | void;\n}\n","import {BaseController} from '@controllers/base-controller.ts';\nimport type {IEventbus} from '@eventbus/types.ts';\n\nexport interface ILabelControllerMetadata {\n /**\n * @dependency\n */\n selectedElement: JQuery;\n /**\n * Translation key for rosetta-based locale system.\n * Example: 'nav.home', 'buttons.submit'\n * @required\n */\n translationKey: string;\n /**\n * By default the label is added to the inner HTML of the `selectedElement`,\n * otherwise if this property is set, the label text is added to the specified attribute\n * of the `selectedElement`.\n */\n attributeName?: string;\n}\n\n/**\n * This controller attaches to the given selected element and renders the text\n * associated with the given translation key.\n *\n * The controller listens for the `language-change` event and re-renders the text\n * with the new language after such an event.\n *\n * Uses the rosetta-based locale system via `request-translation` event.\n */\nexport class LabelController extends BaseController<ILabelControllerMetadata> {\n name = 'LabelController';\n private _eventbus: IEventbus | null = null;\n\n init(operationData: ILabelControllerMetadata) {\n this.operationData = Object.assign({}, operationData);\n }\n\n /**\n * Sets the translation key and re-renders the label.\n */\n setTranslationKey(newKey: string) {\n if (this.operationData) {\n this.operationData.translationKey = newKey;\n this._setLabel();\n }\n }\n\n attach(eventbus: IEventbus) {\n if (!this.operationData) {\n return;\n }\n\n this._eventbus = eventbus;\n this._setLabel();\n this.addListener(eventbus, 'language-change', this._handleLanguageChange);\n }\n\n private _setLabel() {\n if (!this._eventbus || !this.operationData?.translationKey) {\n return;\n }\n\n const text =\n this._eventbus.request<string>(\n 'request-translation',\n this.operationData.translationKey\n ) ?? '';\n this._applyText(text);\n }\n\n private _applyText(text: string) {\n if (!this.operationData?.attributeName) {\n this.operationData?.selectedElement.html(text);\n } else {\n this.operationData?.selectedElement.attr(\n this.operationData?.attributeName,\n text\n );\n }\n }\n\n detach(eventbus: IEventbus) {\n super.detach(eventbus);\n this._eventbus = null;\n }\n\n private _handleLanguageChange(_code: string) {\n this._setLabel();\n }\n}\n","import {BaseController} from '@controllers/base-controller.ts';\nimport type {IEventbus} from '@eventbus/types.ts';\nimport type {\n AnimationConfigWithData,\n AnimationItem,\n CanvasRendererConfig,\n HTMLRendererConfig,\n SVGRendererConfig,\n} from 'lottie-web';\nimport lt from 'lottie-web';\nimport type {TLanguageCode} from '../types.ts';\n\nconst lottie = lt.default ?? lt;\n\nexport interface IInnerMetadata {\n /**\n * @dependency\n */\n selectedElement: JQuery;\n /**\n * @type=ParameterType:string\n */\n renderer: SVGRendererConfig | CanvasRendererConfig | HTMLRendererConfig;\n loop: boolean;\n autoplay: boolean;\n /**\n * ParameterType:object\n */\n animationData: any;\n /**\n * @required\n */\n json: any;\n /**\n * @type=ParameterType:array\n * @itemType=ParameterType:labelId\n */\n labelIds: string[];\n viewBox: string;\n iefallback: any;\n}\n\nexport interface ILottieControllerMetadata extends IInnerMetadata {\n /**\n * @type=ParameterType:url\n * @required\n */\n url: string;\n}\n\n/**\n * This controller renders a [lottie-web](https://github.com/airbnb/lottie-web) animation inside the given selected element.\n *\n * The url may encode freeze and end positions like this: my-url/filename[freeze=10,end=21].json\n *\n */\nexport class LottieController extends BaseController<ILottieControllerMetadata> {\n name = 'LottieController';\n currentLanguage: TLanguageCode = 'nl-NL';\n labelData: Record<string, Record<string, string>> = {};\n animationItem: AnimationItem | null = null;\n serializedData: string | null = null;\n serializedIEData: string | null = null;\n freezePosition = -1;\n endPosition = -1;\n\n init(operationData: ILottieControllerMetadata) {\n this.operationData = {...operationData};\n\n if (operationData.url.indexOf('[') > -1) {\n this._parseFilename(operationData.url);\n }\n\n this.serializedData = this.operationData.json\n ? JSON.stringify(this.operationData.json)\n : JSON.stringify(this.operationData.animationData);\n\n if (this.operationData.iefallback) {\n this.serializedIEData = JSON.stringify(this.operationData.iefallback);\n }\n }\n\n private _parseFilename(name: string) {\n const startIndex = name.indexOf('[') + 1;\n const endIndex = name.indexOf(']');\n const params = name.substring(startIndex, endIndex);\n\n const settings = params.split(',');\n\n settings.forEach(setting => {\n const values = setting.split('=');\n if (values[0] === 'freeze') {\n this.freezePosition = +values[1];\n } else if (values[0] === 'end') {\n this.endPosition = +values[1];\n }\n });\n }\n\n attach(eventbus: IEventbus) {\n if (!this.operationData) {\n return;\n }\n\n const {labelIds} = this.operationData;\n if (labelIds?.length) {\n this.currentLanguage =\n eventbus.request<TLanguageCode>('request-current-language') ?? 'en-US';\n this.addListener(eventbus, 'language-change', this._handleLanguageChange);\n const labelCollections =\n eventbus.request<any[]>(\n 'request-label-collections',\n this.operationData.labelIds\n ) ?? [];\n this._createTextDataLookup(labelCollections);\n }\n this._createAnimation();\n this._createAnimation();\n }\n\n detach(eventbus: IEventbus) {\n super.detach(eventbus);\n\n if (this.animationItem) {\n if (this.endPosition > -1) {\n this.animationItem.addEventListener(\n 'complete',\n this._destroy.bind(this)\n );\n this.animationItem.playSegments(\n [this.freezePosition, this.endPosition],\n true\n );\n } else {\n this.animationItem.destroy();\n }\n }\n }\n\n private _destroy() {\n if (this.animationItem) {\n this.animationItem.destroy();\n this.animationItem = null;\n }\n }\n\n private _createAnimation() {\n if (!this.operationData || !this.serializedData) {\n return;\n }\n\n this.animationItem?.destroy();\n let serialized =\n this._isIE() && this.serializedIEData\n ? this.serializedIEData\n : this.serializedData;\n\n const {labelIds} = this.operationData;\n if (labelIds?.length) {\n // O(n) regex-based replacement - single pass through string\n // Replaces all !!labelId!! patterns in one operation\n serialized = serialized.replace(/!!([^!]+)!!/g, (match, labelId) => {\n return this.labelData[labelId]?.[this.currentLanguage] ?? match;\n });\n }\n const animationData = JSON.parse(serialized);\n\n const animationSettings: AnimationConfigWithData<'svg'> = {\n autoplay: this.operationData.autoplay,\n container: this.operationData.selectedElement[0],\n loop: this.operationData.loop,\n rendererSettings: this.operationData.renderer,\n animationData,\n };\n\n this.animationItem = lottie.loadAnimation(animationSettings);\n if (this.endPosition < 0) {\n this.endPosition = this.animationItem.timeCompleted;\n }\n\n if (this.freezePosition > -1) {\n this.animationItem.playSegments([0, this.freezePosition], true);\n }\n if (this.operationData.viewBox) {\n this.operationData.selectedElement\n .find('svg')\n .attr('viewBox', this.operationData.viewBox);\n }\n }\n\n private _createTextDataLookup(data: any[]) {\n data.forEach((infos, index) => {\n infos.forEach((d: any) => {\n if (this.operationData) {\n this.labelData[this.operationData.labelIds[index]][d.code] = d.label;\n }\n });\n });\n }\n\n private _handleLanguageChange(code: TLanguageCode) {\n this.currentLanguage = code;\n this._createAnimation();\n }\n\n private _isIE() {\n const isIE = false || !!(window.document as any).documentMode;\n\n // Edge 20+\n const isEdge = !isIE && !!(window as any).StyleMedia;\n\n return isEdge || isIE;\n }\n}\n","import {BaseController} from '@controllers/base-controller.ts';\nimport type {IEventbus} from '@eventbus/types.ts';\n\n/**\n * Metadata configuration for MutationObserverController\n *\n * Configures what types of DOM mutations to observe and how to observe them.\n */\nexport interface IMutationObserverControllerMetadata {\n /**\n * jQuery-wrapped DOM element to observe for mutations\n * @dependency\n * @required\n */\n selectedElement: JQuery;\n\n /**\n * Observe changes to element attributes\n * @optional\n * @default true\n */\n observeAttributes?: boolean;\n\n /**\n * Observe additions and removals of child nodes\n * @optional\n * @default true\n */\n observeChildList?: boolean;\n\n /**\n * Observe changes to text content (character data)\n * @optional\n * @default true\n */\n observeCharacterData?: boolean;\n\n /**\n * Observe mutations in the entire subtree (all descendants)\n * @optional\n * @default false\n */\n observeSubtree?: boolean;\n\n /**\n * Record the previous value of attributes that change\n * Requires observeAttributes to be true\n * @optional\n * @default false\n */\n attributeOldValue?: boolean;\n\n /**\n * Record the previous value of text content that changes\n * Requires observeCharacterData to be true\n * @optional\n * @default false\n */\n characterDataOldValue?: boolean;\n\n /**\n * Array of specific attribute local names to observe\n * If omitted, all attribute changes are observed when observeAttributes is true\n * @optional\n */\n attributeFilter?: string[];\n}\n\n/**\n * Mutation event payload broadcasted through Eligius eventbus\n */\nexport interface IMutationEventPayload {\n /**\n * Array of mutation records from the MutationObserver callback\n */\n mutations: MutationRecord[];\n\n /**\n * Reference to the observed element (native DOM node)\n */\n target: Element;\n\n /**\n * Timestamp when the mutations were detected\n */\n timestamp: number;\n}\n\n/**\n * Controller that observes DOM mutations on a selected element and broadcasts events.\n *\n * This controller creates a MutationObserver to monitor DOM changes (attributes, child nodes,\n * text content) on a specified element. All detected mutations are broadcasted through the\n * Eligius eventbus, enabling reactive behavior in response to DOM changes.\n *\n * The controller follows the standard Eligius lifecycle:\n * - init(): Store configuration metadata\n * - attach(): Create and start the MutationObserver\n * - detach(): Disconnect the observer and clean up resources\n *\n * @example\n * ```typescript\n * // JSON configuration\n * {\n * \"systemName\": \"addControllerToElement\",\n * \"operationData\": {\n * \"controllerName\": \"MutationObserverController\",\n * \"observeAttributes\": true,\n * \"observeChildList\": true,\n * \"observeCharacterData\": false\n * }\n * }\n *\n * // Listen for mutations\n * eventbus.on('dom-mutation', (payload: IMutationEventPayload) => {\n * console.log('Mutations detected:', payload.mutations);\n * });\n * ```\n */\nexport class MutationObserverController extends BaseController<IMutationObserverControllerMetadata> {\n name = 'MutationObserverController';\n private observer: MutationObserver | null = null;\n\n /**\n * Initialize the controller with configuration metadata.\n *\n * @param operationData - Configuration for observation behavior\n */\n init(operationData: IMutationObserverControllerMetadata): void {\n this.operationData = Object.assign({}, operationData);\n }\n\n /**\n * Attach the controller and start observing mutations.\n * Creates MutationObserver instance and begins monitoring the target element.\n *\n * @param eventbus - Eligius eventbus for broadcasting mutation events\n */\n attach(eventbus: IEventbus): void {\n if (!this.operationData) {\n return;\n }\n\n // Unwrap jQuery element to get native DOM node\n const nativeElement = this.operationData.selectedElement.get(0);\n if (!nativeElement) {\n return;\n }\n\n // Build observer options from metadata\n const options = this._buildObserverOptions();\n\n // Create MutationObserver with bound callback\n this.observer = new MutationObserver(\n this._handleMutations.bind(this, eventbus, nativeElement)\n );\n\n // Start observing the target element\n this.observer.observe(nativeElement, options);\n }\n\n /**\n * Detach the controller and stop observing mutations.\n * Disconnects MutationObserver and cleans up resources.\n *\n * @param eventbus - Eligius eventbus (used by BaseController for cleanup)\n */\n detach(eventbus: IEventbus): void {\n // Disconnect and clean up observer\n if (this.observer) {\n this.observer.disconnect();\n this.observer = null;\n }\n\n // Call parent detach for event listener cleanup\n super.detach(eventbus);\n }\n\n /**\n * Build MutationObserverInit options from controller metadata.\n * Applies default values for optional configuration properties.\n *\n * @returns MutationObserverInit options object\n * @private\n */\n private _buildObserverOptions(): MutationObserverInit {\n if (!this.operationData) {\n return {};\n }\n\n const {\n observeAttributes = true,\n observeChildList = true,\n observeCharacterData = true,\n observeSubtree = false,\n attributeOldValue = false,\n characterDataOldValue = false,\n attributeFilter,\n } = this.operationData;\n\n return {\n attributes: observeAttributes,\n childList: observeChildList,\n characterData: observeCharacterData,\n subtree: observeSubtree,\n attributeOldValue,\n characterDataOldValue,\n attributeFilter,\n };\n }\n\n /**\n * Handle mutations detected by the MutationObserver.\n * Broadcasts mutation events through the eventbus with mutation details.\n *\n * @param eventbus - Eligius eventbus for broadcasting\n * @param target - The observed element\n * @param mutations - Array of mutation records from observer callback\n * @private\n */\n private _handleMutations(\n eventbus: IEventbus,\n target: Element,\n mutations: MutationRecord[]\n ): void {\n const payload: IMutationEventPayload = {\n mutations,\n target,\n timestamp: Date.now(),\n };\n\n eventbus.broadcast('dom-mutation', [payload]);\n }\n}\n","import {BaseController} from '@controllers/base-controller.ts';\nimport type {LabelController} from '@controllers/label-controller.ts';\nimport type {IEventbus} from '@eventbus/types.ts';\nimport type {TOperationData} from '@operation/types.ts';\nimport $ from 'jquery';\nimport type {TResultCallback} from '../types.ts';\n\nexport interface INavigationControllerOperationData {\n /**\n * @dependency\n */\n selectedElement: JQuery;\n /**\n * @required\n */\n json: any;\n}\n\nexport class NavigationController extends BaseController<INavigationControllerOperationData> {\n name: string = 'NavigationController';\n navigation: any[] = [];\n navLookup: Record<string, any> = {};\n navVidIdLookup: Record<string, any> = {};\n ctrlLookup: Record<string, LabelController> = {};\n activeNavigationPoint: any | null = null;\n labelControllers: LabelController[] = [];\n eventbus: IEventbus | null = null;\n container: JQuery | null = null;\n\n init(operationData: TOperationData) {\n this.container = operationData.selectedElement;\n this.navigation = this._buildNavigationData(operationData.json);\n }\n\n attach(eventbus: IEventbus) {\n if (!this.container) {\n return;\n }\n\n this.eventbus = eventbus;\n\n this.addListener(\n eventbus,\n 'navigate-to-video-url',\n this._handleNavigateVideoUrl\n );\n this.addListener(eventbus, 'highlight-navigation', this._highlightMenu);\n this.addListener(\n eventbus,\n 'request-current-navigation',\n this._handleRequestCurrentNavigation\n );\n this.addListener(eventbus, 'video-complete', this._handleVideoComplete);\n\n this._buildHtml(this.container, this.navigation);\n this._initHistory.bind(this);\n }\n\n private _initHistory() {\n this.activeNavigationPoint = this.navVidIdLookup[0];\n const navId = this._getQueryVariable(0);\n let videoIndex = 0;\n if (navId) {\n const nav = this.navLookup[navId];\n videoIndex = nav.videoUrlIndex;\n }\n this._highlightMenu(videoIndex);\n }\n\n private _getQueryVariable(variableIdx: number) {\n const href = window.location.href;\n const hashIndex = href.indexOf('#');\n if (hashIndex > -1) {\n const query = href.substring(hashIndex + 2);\n if (query) {\n const vars = query.split('/');\n return vars[variableIdx];\n }\n }\n return null;\n }\n\n private _handleRequestCurrentNavigation(\n resultCallback: TResultCallback<{navigationData: any; title: string} | null>\n ) {\n if (this.activeNavigationPoint) {\n const title =\n this.eventbus?.request<string>(\n 'request-translation',\n this.activeNavigationPoint.labelId\n ) ?? '';\n resultCallback({\n navigationData: this.activeNavigationPoint,\n title,\n });\n } else {\n resultCallback(null);\n }\n }\n\n detach(eventbus: IEventbus) {\n super.detach(eventbus);\n\n this.labelControllers.forEach(ctrl => {\n ctrl.detach(eventbus);\n });\n\n this.labelControllers.length = 0;\n this.eventbus = null;\n this.container = null;\n window.onpopstate = null;\n }\n\n private _pushCurrentState(position = -1) {\n if (!this.activeNavigationPoint) {\n return;\n }\n\n const title =\n this.eventbus?.request<string>(\n 'request-translation',\n this.activeNavigationPoint.labelId\n ) ?? '';\n\n const state = {\n navigationData: this.activeNavigationPoint,\n title,\n position: -1,\n };\n if (position > -1) {\n state.position = position;\n }\n this.eventbus?.broadcast('push-history-state', [state]);\n }\n\n private _buildHtml(parentElm: JQuery, data: any) {\n const ul = $('<ul/>');\n data.forEach(this._addNavElement.bind(this, ul));\n parentElm.append(ul);\n }\n\n private _addNavElement(parentElm: JQuery, data: any) {\n if (data.visible) {\n const li = $('<li/>');\n const a = $(`<a href='javascript:;' id='nav_${data.videoUrlIndex}'/>`);\n li.append(a);\n this._addLabel(a, data.labelId);\n this._addClickHandler(a, data.videoUrlIndex);\n\n if (data.children) {\n const ul = $('<ul/>');\n data.children.forEach(this._addNavElement.bind(this, ul));\n li.append(ul);\n }\n\n parentElm.append(li);\n }\n }\n\n private _addClickHandler(parentElm: JQuery, videoIndex: number) {\n parentElm.mouseup(this._menuMouseupHandler.bind(this, videoIndex));\n }\n\n private _menuMouseupHandler(videoIndex: number) {\n const navdata = this.navVidIdLookup[videoIndex];\n if (navdata) {\n this.eventbus?.broadcast('request-video-url', [navdata.videoUrlIndex]);\n this._handleNavigateVideoUrl(navdata.videoUrlIndex);\n }\n }\n\n private _handleNavigateVideoUrl(\n index: number,\n requestedVideoPosition: number = 0\n ) {\n this._highlightMenu(index);\n this.eventbus?.broadcast('request-video-url', [\n index,\n requestedVideoPosition,\n ]);\n this.activeNavigationPoint = this.navVidIdLookup[index];\n this._pushCurrentState(requestedVideoPosition);\n }\n\n private _highlightMenu(index: number) {\n const navElm = $(`#nav_${index}`);\n\n if (navElm.length) {\n $('.current-menu-item').removeClass('current-menu-item');\n navElm.addClass('current-menu-item');\n }\n }\n\n private _handleVideoComplete(index: number) {\n const navData = this.navVidIdLookup[index];\n if (navData.autoNext) {\n this.eventbus?.broadcast('request-video-url', [\n navData.next.videoUrlIndex,\n ]);\n } else {\n this.eventbus?.broadcast('request-video-cleanup', []);\n }\n }\n\n private _addLabel(parentElm: JQuery, translationKey: string) {\n const data = {\n selectedElement: parentElm,\n translationKey,\n };\n const instance = this.eventbus?.request<LabelController>(\n 'request-instance',\n 'LabelController'\n );\n if (instance) {\n instance.init(data);\n instance.attach(this.eventbus as IEventbus);\n this.labelControllers.push(instance);\n this.ctrlLookup[translationKey] = instance;\n }\n }\n\n private _buildNavigationData(data: any) {\n const result: any[] = [];\n data.navigationData.forEach((nav: any, index: number) => {\n this.navLookup[nav.id] = nav;\n this.navVidIdLookup[nav.videoUrlIndex] = nav;\n nav.previous = data.navigationData[index - 1];\n });\n\n data.navigationData.forEach((nav: any, index: number) => {\n if (nav.nextId) {\n nav.next = this.navLookup[nav.nextId];\n delete nav.nextId;\n } else {\n nav.next = data.navigationData[index + 1];\n }\n });\n\n data.roots.forEach((id: string) => {\n const nav = this.navLookup[id];\n if (nav.children) {\n nav.children = nav.children.map((childId: string) => {\n return this.navLookup[childId];\n });\n }\n result.push(nav);\n });\n return result;\n }\n}\n","import {BaseController} from '@controllers/base-controller.ts';\nimport type {IEventbus} from '@eventbus/types.ts';\nimport type {TOperationData} from '@operation/types.ts';\n\nexport interface IProgressbarControllerOperationData {\n /**\n * @dependency\n */\n selectedElement: JQuery;\n /**\n * @dependency\n */\n textElement: JQuery;\n}\n\n/**\n * This controller renders a progressbar that displays the progress of the current timeline in the given selected element.\n *\n * The current progress as a percentage is rendered in the given text element.\n */\nexport class ProgressbarController extends BaseController<IProgressbarControllerOperationData> {\n name: string = 'ProgressbarController';\n selectedElement: JQuery | null = null;\n textElement: JQuery | null = null;\n duration: number = 0;\n\n init(operationData: TOperationData) {\n this.selectedElement = operationData.selectedElement;\n this.textElement = operationData.textElement;\n }\n\n attach(eventbus: IEventbus) {\n this.addListener(eventbus, 'timeline-time', this._positionUpdateHandler);\n\n this.duration = eventbus.request<number>('timeline-duration-request') ?? 0;\n\n this.selectedElement?.css({'pointer-events': 'none'});\n\n const container = this.selectedElement?.parent();\n\n if (container) {\n const clickHandler = this._clickHandler.bind(this, eventbus);\n container.on('click', clickHandler);\n this.eventListeners.push(() => container.off('click', clickHandler));\n }\n }\n\n detach(eventbus: IEventbus) {\n super.detach(eventbus);\n }\n\n private _positionUpdateHandler(position: number) {\n const percentage = (100 / this.duration) * position;\n this.selectedElement?.css('width', `${percentage}%`);\n this.textElement?.text(`${Math.floor(percentage)}%`);\n }\n\n private _clickHandler(eventbus: IEventbus, event: any) {\n const element = event.target as HTMLElement;\n const rect = element.getBoundingClientRect();\n\n const x = event.clientX - rect.left; //x position within the element.\n\n const percentage = (100 / rect.width) * x;\n\n eventbus.broadcast('timeline-seek-request', [\n Math.round((this.duration / 100) * percentage),\n ]);\n }\n}\n","import {BaseController} from '@controllers/base-controller.ts';\nimport type {IEventbus} from '@eventbus/types.ts';\nimport type {TOperationData} from '@operation/types.ts';\n\nexport interface IRoutingControllerOperationData {\n /**\n * @required\n */\n json: any;\n}\n\n/**\n * This is a work in progress, do not use this yet please....\n */\nexport class RoutingController extends BaseController<IRoutingControllerOperationData> {\n name = 'RoutingController';\n navLookup: Record<string, any> = {};\n navVidIdLookup: Record<string, any> = {};\n navigation: any = null;\n eventbus: IEventbus | null = null;\n\n init(operationData: TOperationData) {\n this.navigation = this._buildNavigationData(operationData.json);\n }\n\n attach(eventbus: IEventbus) {\n this.addListener(\n eventbus,\n 'before-request-video-url',\n this._handleBeforeRequestVideoUrl\n );\n this.addListener(\n eventbus,\n 'push-history-state',\n this._handlePushHistoryState\n );\n this.eventbus = eventbus;\n window.onpopstate = this._handlePopstate.bind(this);\n\n const navId = this._getQueryVariable(0);\n if (navId) {\n const nav = this.navLookup[navId];\n const pos = +this._getQueryVariable(1);\n this.eventbus.broadcast('request-video-url', [\n nav.videoUrlIndex,\n pos,\n true,\n ]);\n } else {\n window.history.pushState(\n {navigationId: this.navigation[0].id},\n '',\n `#/${this.navigation[0].id}`\n );\n }\n }\n\n private _handlePopstate(event: any) {\n const navigationId = event.state\n ? event.state.navigationId\n : this.navigation[0].id;\n const position = event.state?.position ?? 0;\n const nav = this.navLookup[navigationId];\n this.eventbus?.broadcast('highlight-navigation', [nav.videoUrlIndex]);\n this.eventbus?.broadcast('request-video-url', [\n nav.videoUrlIndex,\n position,\n true,\n ]);\n }\n\n detach(eventbus: IEventbus) {\n super.detach(eventbus);\n window.onpopstate = null;\n this.eventbus = null;\n }\n\n private _handleBeforeRequestVideoUrl(\n _index: number,\n _requestedVideoPosition: number = 0,\n isHistoryRequest: boolean = false\n ) {\n isHistoryRequest =\n isHistoryRequest !== undefined ? isHistoryRequest : false;\n if (!isHistoryRequest) {\n const resultCallback = (item: any) => {\n this._pushState(item);\n };\n this.eventbus?.broadcast('request-current-navigation', [resultCallback]);\n }\n }\n\n private _getQueryVariable(variableIdx: number) {\n const href = window.location.href;\n const hashIndex = href.indexOf('#');\n if (hashIndex > -1) {\n const query = href.substring(hashIndex + 2);\n if (query) {\n const vars = query.split('/');\n return vars[variableIdx];\n }\n }\n return '';\n }\n\n private _handlePushHistoryState(state: any) {\n this._pushState(state);\n }\n\n private _pushState(state: any) {\n if (state?.navigationData?.visible) {\n let currentPosition = state.position !== undefined ? state.position : -1;\n if (currentPosition < 0) {\n const resultCallback = (position: number) => {\n currentPosition = position > 3 ? position - 3 : 0;\n };\n this.eventbus?.broadcast('request-current-video-position', [\n resultCallback,\n ]);\n }\n\n const currentState = window.history.state;\n if (\n currentState &&\n currentState.navigationId !== state.navigationData.id\n ) {\n window.history.pushState(\n {navigationId: state.navigationData.id, position: currentPosition},\n state.title,\n `#/${state.navigationData.id}/${currentPosition}`\n );\n } else if (\n currentState &&\n currentState.navigationId === state.navigationData.id\n ) {\n window.history.replaceState(\n {\n navigationId: currentState.navigationId,\n position: currentPosition,\n },\n state.title,\n `#/${currentState.navigationId}/${currentPosition}`\n );\n } else {\n window.history.pushState(\n {navigationId: state.navigationData.id, position: currentPosition},\n state.title,\n `#/${state.navigationData.id}/${currentPosition}`\n );\n }\n window.document.title = state.title;\n }\n }\n\n private _buildNavigationData(data: any) {\n const result: any[] = [];\n data.navigationData.forEach((nav: any, index: any) => {\n this.navLookup[nav.id] = nav;\n this.navVidIdLookup[nav.videoUrlIndex] = nav;\n nav.previous = data.navigationData[index - 1];\n });\n\n data.navigationData.forEach((nav: any, index: number) => {\n if (nav.nextId) {\n nav.next = this.navLookup[nav.nextId];\n delete nav.nextId;\n } else {\n nav.next = data.navigationData[index + 1];\n }\n });\n\n data.roots.forEach((id: string) => {\n const nav = this.navLookup[id];\n if (nav.children) {\n nav.children = nav.children.map((childId: string) => {\n return this.navLookup[childId];\n });\n }\n result.push(nav);\n });\n return result;\n }\n}\n","import {BaseController} from '@controllers/base-controller.ts';\nimport type {IEventbus} from '@eventbus/types.ts';\nimport type {\n IStrictDuration,\n ISubtitleCollection,\n TLanguageCode,\n} from '../types.ts';\n\nexport interface ISubtitlesControllerOperationData {\n /**\n * @dependency\n */\n selectedElement: JQuery;\n /**\n * @type=ParameterType:languagecode\n */\n language: TLanguageCode;\n /**\n * @type=ParameterType:array\n * @itemType=ParameterType:object\n */\n subtitleData: ISubtitleCollection[];\n}\n\nexport class SubtitlesController extends BaseController<ISubtitlesControllerOperationData> {\n actionLookup: Record<string, any> = {};\n currentLanguage: TLanguageCode | null = null;\n lastFunc: (() => void) | null = null;\n name = 'SubtitlesController';\n subtitleDurations: IStrictDuration[] | null = null;\n\n attach(eventbus: IEventbus) {\n this.addListener(eventbus, 'timeline-time', this.onTimeHandler);\n this.addListener(eventbus, 'timeline-seeked', this.onSeekedHandler);\n this.addListener(eventbus, 'language-change', this.languageChangeHandler);\n }\n\n detach(eventbus: IEventbus) {\n super.detach(eventbus);\n }\n\n languageChangeHandler(newLanguage: TLanguageCode) {\n this.currentLanguage = newLanguage;\n if (this.lastFunc) {\n this.lastFunc();\n }\n }\n\n removeTitle(container?: JQuery) {\n container?.empty();\n this.lastFunc = null;\n }\n\n onTimeHandler(position: number) {\n const func = this.actionLookup[position];\n if (func && this.lastFunc !== func) {\n this.lastFunc = func;\n func();\n }\n }\n\n onSeekedHandler(position: number, _duration: number) {\n const subtitleDuration = this.subtitleDurations?.find(\n x => x.start <= position && x.end >= position\n );\n\n const func = subtitleDuration\n ? this.actionLookup[subtitleDuration.start ?? -1]\n : undefined;\n if (func && this.lastFunc !== func) {\n this.lastFunc = func;\n func();\n } else if (!func) {\n this.removeTitle();\n }\n }\n\n setTitle(container: JQuery, titleLanguageLookup: Record<string, string>) {\n if (this.currentLanguage) {\n container.html(titleLanguageLookup[this.currentLanguage]);\n }\n }\n\n createActionLookup(\n operationData: ISubtitlesControllerOperationData,\n container: JQuery\n ) {\n const subtitleData = operationData.subtitleData;\n const titles = subtitleData[0].titles;\n const subtitleTimeLookup: Record<number, () => void> = {};\n\n for (let i = 0, ii = titles.length; i < ii; i++) {\n const titleLanguageLookup: Record<string, string> = {};\n\n for (let j = 0, jj = subtitleData.length; j < jj; j++) {\n const subs = subtitleData[j];\n titleLanguageLookup[subs.languageCode] = subs.titles[i].text;\n }\n\n subtitleTimeLookup[titles[i].duration.start] = this.setTitle.bind(\n this,\n container,\n titleLanguageLookup\n );\n subtitleTimeLookup[titles[i].duration.end] = this.removeTitle.bind(\n this,\n container\n );\n }\n\n return subtitleTimeLookup;\n }\n\n init(operationData: ISubtitlesControllerOperationData) {\n const container = operationData.selectedElement;\n this.removeTitle = this.removeTitle.bind(this, container);\n this.currentLanguage = operationData.language;\n this.actionLookup = this.createActionLookup(operationData, container);\n this.subtitleDurations = operationData.subtitleData?.[0].titles.map(\n x => x.duration\n );\n }\n}\n","export type {IDOMEventListenerControllerOperationData} from '@controllers/dom-event-listener-controller.ts';\nexport {DOMEventListenerController} from '@controllers/dom-event-listener-controller.ts';\nexport type {ILabelControllerMetadata} from '@controllers/label-controller.ts';\nexport {LabelController} from '@controllers/label-controller.ts';\nexport type {ILottieControllerMetadata} from '@controllers/lottie-controller.ts';\nexport {LottieController} from '@controllers/lottie-controller.ts';\nexport type {\n IMutationEventPayload,\n IMutationObserverControllerMetadata,\n} from '@controllers/mutation-observer-controller.ts';\nexport {MutationObserverController} from '@controllers/mutation-observer-controller.ts';\nexport type {INavigationControllerOperationData} from '@controllers/navigation-controller.ts';\nexport {NavigationController} from '@controllers/navigation-controller.ts';\nexport type {IProgressbarControllerOperationData} from '@controllers/progressbar-controller.ts';\nexport {ProgressbarController} from '@controllers/progressbar-controller.ts';\nexport type {IRoutingControllerOperationData} from '@controllers/routing-controller.ts';\nexport {RoutingController} from '@controllers/routing-controller.ts';\nexport type {ISubtitlesControllerOperationData} from '@controllers/subtitles-controller.ts';\nexport {SubtitlesController} from '@controllers/subtitles-controller.ts';\n","import { type IAddClassOperationData } from \"@operation/add-class.ts\";\nimport { type IOperationMetadata } from \"@operation/metadata/types.ts\";\n\nexport function addClass(): IOperationMetadata<IAddClassOperationData> {\n return {\n description: `This operation adds the specified class name to the specified selected element.`,\n category: `DOM`,\n dependentProperties: ['selectedElement'],\n properties: {\n className: {\n type: 'ParameterType:className',\n required: true,\n erased: true\n }\n },\n };\n}\n","import { type IAddControllerToElementOperationData } from \"@operation/add-controller-to-element.ts\";\nimport { type IOperationMetadata } from \"@operation/metadata/types.ts\";\nimport { type TOperationData } from \"@operation/types.ts\";\n\nexport function addControllerToElement(): IOperationMetadata<IAddControllerToElementOperationData<TOperationData>> {\n return {\n description: `This operation adds the specified controller instance to the given selected element.`,\n category: `Controller`,\n dependentProperties: ['selectedElement', 'controllerInstance'],\n };\n}\n","import { type IAddGlobalsToOperationData } from \"@operation/add-globals-to-operation.ts\";\nimport { type IOperationMetadata } from \"@operation/metadata/types.ts\";\n\nexport function addGlobalsToOperation(): IOperationMetadata<IAddGlobalsToOperationData> {\n return {\n description: `This operation adds the specified global property names to the current operation data.\nIt finally removes the \\`globalProperties\\` property from the current operation data.`,\n category: `Data`,\n properties: {\n globalProperties: {\n type: 'ParameterType:array',\n itemType: 'ParameterType:string',\n required: true,\n erased: true\n }\n },\n };\n}\n","import { type IAnimateWithClassOperationData } from \"@operation/animate-with-class.ts\";\nimport { type IOperationMetadata } from \"@operation/metadata/types.ts\";\n\nexport function animateWithClass(): IOperationMetadata<IAnimateWithClassOperationData> {\n return {\n description: `This operation adds the specified class name to the specified selected element and assumes that this\nclass triggers and animation on the selected element. It then waits for this animation to complete\nbefore it resolves.`,\n category: `Animation`,\n dependentProperties: ['selectedElement'],\n properties: {\n className: {\n type: 'ParameterType:className',\n required: true\n },\n removeClass: {\n type: [\n { value: 'undefined' },\n { value: 'false' },\n { value: 'true' }\n ]\n }\n },\n };\n}\n","import { type IAnimateOperationData } from \"@operation/animate.ts\";\nimport { type IOperationMetadata } from \"@operation/metadata/types.ts\";\n\nexport function animate(): IOperationMetadata<IAnimateOperationData> {\n return {\n description: `This operation animates the specified selected element with the given [jQuery animation](https://api.jquery.com/animate/) properties, duration and easing.\nIt resolves after the animation completes.`,\n category: `Animation`,\n dependentProperties: ['selectedElement'],\n properties: {\n animationEasing: {\n type: 'ParameterType:boolean',\n erased: true\n },\n animationProperties: {\n type: 'ParameterType:object',\n required: true,\n erased: true\n },\n animationDuration: {\n type: 'ParameterType:number',\n required: true,\n erased: true\n }\n },\n };\n}\n","import { type IAnnounceToScreenReaderOperationData } from \"@operation/announce-to-screen-reader.ts\";\nimport { type IOperationMetadata } from \"@operation/metadata/types.ts\";\n\nexport function announceToScreenReader(): IOperationMetadata<IAnnounceToScreenReaderOperationData> {\n return {\n description: `Announces a message to screen readers using an ARIA live region.`,\n category: `Accessibility`,\n properties: {\n message: {\n type: 'ParameterType:string',\n required: true,\n erased: true\n },\n priority: {\n type: [\n { value: 'undefined' },\n { value: 'polite' },\n { value: 'assertive' }\n ],\n erased: true\n }\n },\n };\n}\n","import { type IOperationMetadata } from \"@operation/metadata/types.ts\";\n\nexport function breakForEach(): IOperationMetadata<undefined> {\n return {\n description: `This operation should only be used within a loop, so between a {@link forEach} and {@link endForEach}\noperation. This operation immediately moves to the loop end index, effectively stopping the loop.`,\n category: `Control Flow`,\n };\n}\n","import { type IBroadcastEventOperationData } from \"@operation/broadcast-event.ts\";\nimport { type IOperationMetadata } from \"@operation/metadata/types.ts\";\n\nexport function broadcastEvent(): IOperationMetadata<IBroadcastEventOperationData> {\n return {\n description: `This operation broadcasts the given event through the eventbus, along with the\nevent arguments and optional event topic.`,\n category: `Utility`,\n properties: {\n eventArgs: {\n type: 'ParameterType:array',\n required: true,\n erased: true\n },\n eventTopic: {\n type: 'ParameterType:eventTopic',\n erased: true\n },\n eventName: {\n type: 'ParameterType:eventName',\n required: true,\n erased: true\n }\n },\n };\n}\n","import { type ICalcOperationData } from \"@operation/calc.ts\";\nimport { type IOperationMetadata } from \"@operation/metadata/types.ts\";\n\nexport function calc(): IOperationMetadata<ICalcOperationData> {\n return {\n description: `This operation calculates the given left and right hand operands using the specified operator.`,\n category: `Utility`,\n properties: {\n left: {\n type: 'ParameterType:number',\n required: true,\n erased: true\n },\n right: {\n type: 'ParameterType:number',\n required: true,\n erased: true\n },\n operator: {\n type: [\n { value: '+' },\n { value: '-' },\n { value: '*' },\n { value: '/' },\n { value: '%' },\n { value: '**' }\n ],\n required: true,\n erased: true\n }\n },\n outputProperties: {\n calculationResult: {\n type: [\n { value: 'undefined' },\n { value: 'number' }\n ]\n }\n }\n };\n}\n","import { type IClearElementOperationData } from \"@operation/clear-element.ts\";\nimport { type IOperationMetadata } from \"@operation/metadata/types.ts\";\n\nexport function clearElement(): IOperationMetadata<IClearElementOperationData> {\n return {\n description: `This operation removes all of the children from the given selected element.`,\n category: `DOM`,\n dependentProperties: ['selectedElement'],\n };\n}\n","import { type IClearOperationDataOperationData } from \"@operation/clear-operation-data.ts\";\nimport { type IOperationMetadata } from \"@operation/metadata/types.ts\";\n\nexport function clearOperationData(): IOperationMetadata<IClearOperationDataOperationData> {\n return {\n description: `This operation removes all of the properties on the current operation date.\nOr, if the \\`properties\\` property is set only removes the properties defined by that list.`,\n category: `Data`,\n properties: {\n properties: {\n type: [\n { value: 'undefined' },\n { value: 'string[]' }\n ],\n erased: true\n }\n },\n };\n}\n","import { type IClearStorageOperationData } from \"@operation/clear-storage.ts\";\nimport { type IOperationMetadata } from \"@operation/metadata/types.ts\";\n\nexport function clearStorage(): IOperationMetadata<IClearStorageOperationData> {\n return {\n description: `Clears data from browser storage (localStorage or sessionStorage).\n\nIf \\`key\\` is provided, removes only that key. If \\`key\\` is omitted, clears all storage.`,\n category: `Data`,\n properties: {\n key: {\n type: [\n { value: 'undefined' },\n { value: 'string' }\n ],\n erased: true\n },\n storageType: {\n type: [\n { value: 'local' },\n { value: 'session' }\n ],\n required: true,\n erased: true\n }\n },\n };\n}\n","import { type ICompareDateOperationData } from \"@operation/compare-date.ts\";\nimport { type IOperationMetadata } from \"@operation/metadata/types.ts\";\n\nexport function compareDate(): IOperationMetadata<ICompareDateOperationData> {\n return {\n description: `Compares two dates.\ncomparison: -1 (before), 0 (equal), 1 (after)`,\n category: `Date`,\n properties: {\n date1: {\n type: [\n { value: 'string' },\n { value: 'number' },\n { value: 'Date' }\n ],\n required: true,\n erased: true\n },\n date2: {\n type: [\n { value: 'string' },\n { value: 'number' },\n { value: 'Date' }\n ],\n required: true,\n erased: true\n }\n },\n outputProperties: {\n comparison: {\n type: 'ParameterType:number'\n },\n isEqual: {\n type: 'ParameterType:boolean'\n },\n isBefore: {\n type: 'ParameterType:boolean'\n },\n isAfter: {\n type: 'ParameterType:boolean'\n }\n }\n };\n}\n","import { type IConcatenateStringsOperationData } from \"@operation/concatenate-strings.ts\";\nimport { type IOperationMetadata } from \"@operation/metadata/types.ts\";\n\nexport function concatenateStrings(): IOperationMetadata<IConcatenateStringsOperationData> {\n return {\n description: `Concatenates multiple strings with an optional separator.`,\n category: `String`,\n properties: {\n strings: {\n type: 'ParameterType:array',\n itemType: 'ParameterType:string',\n required: true,\n erased: true\n },\n separator: {\n type: [\n { value: 'undefined' },\n { value: 'string' }\n ],\n erased: true\n }\n },\n outputProperties: {\n result: {\n type: 'ParameterType:string'\n }\n }\n };\n}\n","import { type IOperationMetadata } from \"@operation/metadata/types.ts\";\n\nexport function continueForEach(): IOperationMetadata<undefined> {\n return {\n description: `This operation should only be used within a loop, so between a {@link forEach} and {@link endForEach}\noperation. This operation immediately moves to the next loop index, effectively canceling the rest\nof the operations in the current iteration.`,\n category: `Control Flow`,\n };\n}\n","import { type ICreateElementOperationData, type TTagNames } from \"@operation/create-element.ts\";\nimport { type IOperationMetadata } from \"@operation/metadata/types.ts\";\n\nexport function createElement(): IOperationMetadata<ICreateElementOperationData<TTagNames>> {\n return {\n description: `This operation creates the DOM element described by the given elementName and attributes and assigns\nthe instance to the \\`template\\` property on the current operation data.`,\n category: `DOM`,\n properties: {\n elementName: {\n type: 'ParameterType:htmlElementName',\n required: true,\n erased: true\n },\n text: {\n type: [\n { value: 'undefined' },\n { value: 'string' }\n ],\n erased: true\n },\n attributes: {\n type: 'ParameterType:object',\n erased: true\n }\n },\n outputProperties: {\n template: {\n type: 'ParameterType:object'\n }\n }\n };\n}\n","import { type ICustomFunctionOperationData } from \"@operation/custom-function.ts\";\nimport { type IOperationMetadata } from \"@operation/metadata/types.ts\";\n\nexport function customFunction(): IOperationMetadata<ICustomFunctionOperationData> {\n return {\n description: `This operation retrieves a custom function defined by the given system name\nand invokes it with the current operation data and eventbus.`,\n category: `Utility`,\n properties: {\n systemName: {\n type: 'ParameterType:systemName',\n required: true,\n erased: true\n }\n },\n };\n}\n","import { type IEndActionOperationData } from \"@operation/end-action.ts\";\nimport { type IOperationMetadata } from \"@operation/metadata/types.ts\";\n\nexport function endAction(): IOperationMetadata<IEndActionOperationData> {\n return {\n description: `This operation invokes the {@link EndableAction}.end method on the specified action instance.\n\nThe action operation data is first merged with the current operation data before it is\npassed on to the action. After the action has completed the action operation data properties\nare removed from the current operation data.`,\n category: `Action`,\n dependentProperties: ['actionInstance'],\n properties: {\n actionOperationData: {\n type: 'ParameterType:object',\n required: true,\n erased: true\n }\n },\n };\n}\n","import { type IOperationMetadata } from \"@operation/metadata/types.ts\";\n\nexport function endForEach(): IOperationMetadata<undefined> {\n return {\n description: `This operation checks if the current loop should end or start the next iteration.`,\n category: `Control Flow`,\n };\n}\n","import { type IOperationMetadata } from \"@operation/metadata/types.ts\";\n\nexport function endWhen(): IOperationMetadata<undefined> {\n return {\n description: `This operation cleans up after the {@link when}/{@link otherwise}/{@link endWhen} control flow ends.`,\n category: `Control Flow`,\n };\n}\n","import { type IExtendControllerOperationData } from \"@operation/extend-controller.ts\";\nimport { type IOperationMetadata } from \"@operation/metadata/types.ts\";\n\nexport function extendController(): IOperationMetadata<IExtendControllerOperationData> {\n return {\n description: `Extends the current controller with given extension.`,\n category: `Controller`,\n dependentProperties: ['controllerInstance'],\n properties: {\n controllerExtension: {\n type: 'ParameterType:object',\n required: true,\n erased: true\n }\n },\n };\n}\n","import { type IFilterArrayOperationData } from \"@operation/filter-array.ts\";\nimport { type IOperationMetadata } from \"@operation/metadata/types.ts\";\n\nexport function filterArray(): IOperationMetadata<IFilterArrayOperationData> {\n return {\n description: `Filters an array based on property equality or custom predicate function.\n\nOperates on arrayData passed from previous operations.\nSupports two filtering modes:\n1. Property equality: \\`filterProperty\\` and \\`filterValue\\` to filter by property match\n2. Custom predicate: \\`filterPredicate\\` function for complex filtering logic`,\n category: `Array`,\n dependentProperties: ['arrayData'],\n properties: {\n filterProperty: {\n type: [\n { value: 'undefined' },\n { value: 'string' }\n ],\n erased: true\n },\n filterValue: {\n type: 'ParameterType:object',\n erased: true\n },\n filterPredicate: {\n type: [\n { value: 'undefined' },\n { value: '(item: any, index?: number | undefined) => boolean' }\n ],\n erased: true\n }\n },\n outputProperties: {\n filteredArray: {\n type: 'ParameterType:array'\n }\n }\n };\n}\n","import { type IFindInArrayOperationData } from \"@operation/find-in-array.ts\";\nimport { type IOperationMetadata } from \"@operation/metadata/types.ts\";\n\nexport function findInArray(): IOperationMetadata<IFindInArrayOperationData> {\n return {\n description: `Finds the first element in an array matching criteria.\n\nOperates on arrayData passed from previous operations.\nSupports two search modes:\n1. Property equality: \\`findProperty\\` and \\`findValue\\` to find by property match\n2. Custom predicate: \\`findPredicate\\` function for complex search logic\n\nReturns \\`undefined\\` for \\`foundItem\\` and \\`-1\\` for \\`foundIndex\\` if no match found.`,\n category: `Array`,\n dependentProperties: ['arrayData'],\n properties: {\n findProperty: {\n type: [\n { value: 'undefined' },\n { value: 'string' }\n ],\n erased: true\n },\n findValue: {\n type: 'ParameterType:object',\n erased: true\n },\n findPredicate: {\n type: [\n { value: 'undefined' },\n { value: '(item: any, index?: number | undefined) => boolean' }\n ],\n erased: true\n }\n },\n outputProperties: {\n foundItem: {\n type: 'ParameterType:object'\n },\n foundIndex: {\n type: 'ParameterType:number'\n }\n }\n };\n}\n","import { type IForEachOperationData } from \"@operation/for-each.ts\";\nimport { type IOperationMetadata } from \"@operation/metadata/types.ts\";\n\nexport function forEach(): IOperationMetadata<IForEachOperationData> {\n return {\n description: `This operation iterates over the given collection.\n\nEach iteration the current item from the specified collection is\nassigned to the {@link IOperationScope.currentItem |currentItem} property on the {@link IOperationScope |operation scope}.\n\nAt the start of the loop, the associated {@link endForEach} operation is determined and when\nthe last iteration is completed the flow control is set to the index of that operation.\n\nThe {@link continueForEach |continue} and {@link breakForEach |break} operations can be used to control the\nloop iterations.`,\n category: `Control Flow`,\n properties: {\n collection: {\n type: 'ParameterType:array|ParameterType:string',\n required: true\n }\n },\n };\n}\n","import { type IFormatDateOperationData } from \"@operation/format-date.ts\";\nimport { type IOperationMetadata } from \"@operation/metadata/types.ts\";\n\nexport function formatDate(): IOperationMetadata<IFormatDateOperationData> {\n return {\n description: `Formats a date using Intl.DateTimeFormat or simple patterns.`,\n category: `Date`,\n dependentProperties: ['date'],\n properties: {\n format: {\n type: 'ParameterType:string',\n required: true,\n erased: true\n }\n },\n outputProperties: {\n formattedDate: {\n type: 'ParameterType:string'\n }\n }\n };\n}\n","import { type IFormatTextOperationData } from \"@operation/format-text.ts\";\nimport { type IOperationMetadata } from \"@operation/metadata/types.ts\";\n\nexport function formatText(): IOperationMetadata<IFormatTextOperationData> {\n return {\n description: `Transforms text using format operations: uppercase, lowercase, capitalize, titlecase, or trim.\n\nOperates on textContent passed from previous operations (e.g., getTextContent).\n\nTransformations:\n- \\`uppercase\\`: Convert all characters to uppercase\n- \\`lowercase\\`: Convert all characters to lowercase\n- \\`capitalize\\`: Capitalize only the first letter\n- \\`titlecase\\`: Capitalize first letter of each word\n- \\`trim\\`: Remove leading and trailing whitespace`,\n category: `Text`,\n dependentProperties: ['textContent'],\n properties: {\n transformation: {\n type: [\n { value: 'uppercase' },\n { value: 'lowercase' },\n { value: 'capitalize' },\n { value: 'titlecase' },\n { value: 'trim' }\n ],\n required: true,\n erased: true\n }\n },\n outputProperties: {\n formattedText: {\n type: 'ParameterType:string'\n }\n }\n };\n}\n","import { type IGetAttributesFromElementOperationData } from \"@operation/get-attributes-from-element.ts\";\nimport { type IOperationMetadata } from \"@operation/metadata/types.ts\";\n\nexport function getAttributesFromElement(): IOperationMetadata<IGetAttributesFromElementOperationData> {\n return {\n description: `This operation retrieves the values for the specified attribute names from the given selected element.`,\n category: `DOM`,\n dependentProperties: ['selectedElement'],\n properties: {\n attributeNames: {\n type: 'ParameterType:array',\n itemType: 'ParameterType:string',\n required: true,\n erased: true\n }\n },\n outputProperties: {\n attributeValues: {\n type: [\n { value: 'undefined' },\n { value: 'Record<string, unknown>' }\n ]\n }\n }\n };\n}\n","import { type IGetControllerFromElementOperationData } from \"@operation/get-controller-from-element.ts\";\nimport { type IOperationMetadata } from \"@operation/metadata/types.ts\";\n\nexport function getControllerFromElement(): IOperationMetadata<IGetControllerFromElementOperationData> {\n return {\n description: `This operation retrieves the controller instance with the specified name that is assigned to the given selected element.`,\n category: `Controller`,\n dependentProperties: ['selectedElement'],\n properties: {\n controllerName: {\n type: 'ParameterType:controllerName',\n required: true,\n erased: true\n }\n },\n outputProperties: {\n controllerInstance: {\n type: 'ParameterType:object'\n }\n }\n };\n}\n","import { type IGetControllerInstanceOperationData } from \"@operation/get-controller-instance.ts\";\nimport { type IOperationMetadata } from \"@operation/metadata/types.ts\";\n\nexport function getControllerInstance(): IOperationMetadata<IGetControllerInstanceOperationData> {\n return {\n description: `This operation retrieves an instance of the given controller name.\nIt assigns this instance to the \\`controllerInstance\\` property on the current operation data`,\n category: `Controller`,\n properties: {\n systemName: {\n type: [\n { value: 'DOMEventListenerController' },\n { value: 'LabelController' },\n { value: 'LottieController' },\n { value: 'MutationObserverController' },\n { value: 'NavigationController' },\n { value: 'ProgressbarController' },\n { value: 'RoutingController' },\n { value: 'SubtitlesController' }\n ],\n required: true,\n erased: true\n }\n },\n outputProperties: {\n controllerInstance: {\n type: 'ParameterType:object'\n }\n }\n };\n}\n","import { type IGetCurrentTimeOperationData } from \"@operation/get-current-time.ts\";\nimport { type IOperationMetadata } from \"@operation/metadata/types.ts\";\n\nexport function getCurrentTime(): IOperationMetadata<IGetCurrentTimeOperationData> {\n return {\n description: `Gets the current time as timestamp and Date object.`,\n category: `Date`,\n outputProperties: {\n timestamp: {\n type: 'ParameterType:number'\n },\n date: {\n type: 'ParameterType:Date'\n }\n }\n };\n}\n","import { type IGetElementDimensionsOperationData } from \"@operation/get-element-dimensions.ts\";\nimport { type IOperationMetadata } from \"@operation/metadata/types.ts\";\n\nexport function getElementDimensions(): IOperationMetadata<IGetElementDimensionsOperationData> {\n return {\n description: `This operation calculates the width and height of the given selected element.\nIt assigns this struct to the dimensions property on the current operation data.\nOptionally the width and height can be modified using the given modifier string.\n\nThe modifier string is formatted in the following way:\n\n<operator><amount><optional-side><optional-precentage>|<ratio-definition>\n\nWhere the ratio modifier is formatted in the following way:\n<side>[ar=<ratio-left>-<ratio-right>]\n\nFor example, this modifier '+100h|w[ar=8-1]' will modifiy the dimensions like this:\nit will add a value of 100 to the height and modify the width by a ratio of 8 to 1 relative to the height.`,\n category: `DOM`,\n dependentProperties: ['selectedElement'],\n properties: {\n modifier: {\n type: 'ParameterType:dimensionsModifier',\n erased: true\n }\n },\n outputProperties: {\n dimensions: {\n type: 'ParameterType:object'\n }\n }\n };\n}\n","import { type IGetFocusedElementOperationData } from \"@operation/get-focused-element.ts\";\nimport { type IOperationMetadata } from \"@operation/metadata/types.ts\";\n\nexport function getFocusedElement(): IOperationMetadata<IGetFocusedElementOperationData> {\n return {\n description: `Gets the currently focused element.`,\n category: `Focus`,\n outputProperties: {\n focusedElement: {\n type: 'ParameterType:jQuery'\n }\n }\n };\n}\n","import { type IGetFormDataOperationData } from \"@operation/get-form-data.ts\";\nimport { type IOperationMetadata } from \"@operation/metadata/types.ts\";\n\nexport function getFormData(): IOperationMetadata<IGetFormDataOperationData> {\n return {\n description: `Extracts all input, select, and textarea values from form element into operation data.\n\nThis operation reads form field values and returns them as an object with field names as keys.\nOnly processes form elements that are enabled and not hidden. Handles checkboxes, radio buttons,\nselect elements, textareas, and text inputs.`,\n category: `Form`,\n dependentProperties: ['selectedElement'],\n outputProperties: {\n formData: {\n type: 'ParameterType:object'\n }\n }\n };\n}\n","import { type IGetImportOperationData } from \"@operation/get-import.ts\";\nimport { type IOperationMetadata } from \"@operation/metadata/types.ts\";\n\nexport function getImport(): IOperationMetadata<IGetImportOperationData> {\n return {\n description: `This operation retrieves the import specified by the given \\`systemName\\` and\nassigns it to the \\`importedInstance\\` property on the current operaton date.`,\n category: `Utility`,\n properties: {\n systemName: {\n type: 'ParameterType:systemName',\n required: true,\n erased: true\n }\n },\n outputProperties: {\n importedInstance: {\n type: 'ParameterType:object'\n }\n }\n };\n}\n","import { type IGetQueryParamsOperationData } from \"@operation/get-query-params.ts\";\nimport { type IOperationMetadata } from \"@operation/metadata/types.ts\";\n\nexport function getQueryParams(): IOperationMetadata<IGetQueryParamsOperationData> {\n return {\n description: `This operation retrieves the current query parameters from the browser's address bar and places\nthem on the returned operation data.`,\n category: `Utility`,\n properties: {\n defaultValues: {\n type: [\n { value: 'undefined' },\n { value: 'Record<string, string>' }\n ],\n erased: true\n }\n },\n outputProperties: {\n queryParams: {\n type: [\n { value: 'undefined' },\n { value: 'Record<string, string>' }\n ]\n }\n }\n };\n}\n","import { type IGetScrollPositionOperationData } from \"@operation/get-scroll-position.ts\";\nimport { type IOperationMetadata } from \"@operation/metadata/types.ts\";\n\nexport function getScrollPosition(): IOperationMetadata<IGetScrollPositionOperationData> {\n return {\n description: `Gets the current scroll position of the viewport.\n\nReturns x (horizontal) and y (vertical) scroll positions in pixels.\nUses cross-browser compatible methods to retrieve scroll position.`,\n category: `Scroll`,\n outputProperties: {\n scrollX: {\n type: 'ParameterType:number'\n },\n scrollY: {\n type: 'ParameterType:number'\n }\n }\n };\n}\n","import { type IGetTextContentOperationData } from \"@operation/get-text-content.ts\";\nimport { type IOperationMetadata } from \"@operation/metadata/types.ts\";\n\nexport function getTextContent(): IOperationMetadata<IGetTextContentOperationData> {\n return {\n description: `Extracts text content from element, stripping all HTML markup.\n\nUses jQuery's \\`.text()\\` method which is XSS-safe and returns only the text content\nwithout any HTML tags. Preserves whitespace and text from nested elements.`,\n category: `Text`,\n dependentProperties: ['selectedElement'],\n outputProperties: {\n textContent: {\n type: [\n { value: 'undefined' },\n { value: 'string' }\n ]\n }\n }\n };\n}\n","import { type IHttpDeleteOperationData } from \"@operation/http-delete.ts\";\nimport { type IOperationMetadata } from \"@operation/metadata/types.ts\";\n\nexport function httpDelete(): IOperationMetadata<IHttpDeleteOperationData> {\n return {\n description: `Performs an HTTP DELETE request to the specified URL.`,\n category: `HTTP`,\n properties: {\n url: {\n type: 'ParameterType:string',\n required: true,\n erased: true\n },\n headers: {\n type: [\n { value: 'undefined' },\n { value: 'Record<string, string>' }\n ],\n erased: true\n }\n },\n outputProperties: {\n response: {\n type: 'ParameterType:object'\n },\n status: {\n type: 'ParameterType:number'\n }\n }\n };\n}\n","import { type IHttpPostOperationData } from \"@operation/http-post.ts\";\nimport { type IOperationMetadata } from \"@operation/metadata/types.ts\";\n\nexport function httpPost(): IOperationMetadata<IHttpPostOperationData> {\n return {\n description: `Performs an HTTP POST request to the specified URL.`,\n category: `HTTP`,\n properties: {\n url: {\n type: 'ParameterType:string',\n required: true,\n erased: true\n },\n body: {\n type: 'ParameterType:object',\n erased: true\n },\n headers: {\n type: [\n { value: 'undefined' },\n { value: 'Record<string, string>' }\n ],\n erased: true\n }\n },\n outputProperties: {\n response: {\n type: 'ParameterType:object'\n },\n status: {\n type: 'ParameterType:number'\n }\n }\n };\n}\n","import { type IHttpPutOperationData } from \"@operation/http-put.ts\";\nimport { type IOperationMetadata } from \"@operation/metadata/types.ts\";\n\nexport function httpPut(): IOperationMetadata<IHttpPutOperationData> {\n return {\n description: `Performs an HTTP PUT request to the specified URL.`,\n category: `HTTP`,\n properties: {\n url: {\n type: 'ParameterType:string',\n required: true,\n erased: true\n },\n body: {\n type: 'ParameterType:object',\n erased: true\n },\n headers: {\n type: [\n { value: 'undefined' },\n { value: 'Record<string, string>' }\n ],\n erased: true\n }\n },\n outputProperties: {\n response: {\n type: 'ParameterType:object'\n },\n status: {\n type: 'ParameterType:number'\n }\n }\n };\n}\n","import { type IInvokeObjectMethodOperationData } from \"@operation/invoke-object-method.ts\";\nimport { type IOperationMetadata } from \"@operation/metadata/types.ts\";\n\nexport function invokeObjectMethod(): IOperationMetadata<IInvokeObjectMethodOperationData> {\n return {\n description: `This operation invokes the specified method on the given object with the given optional arguments\nand assigns the result to the \\`methodResult\\` operationdata property.`,\n category: `Utility`,\n dependentProperties: ['instance'],\n properties: {\n methodName: {\n type: 'ParameterType:string',\n required: true,\n erased: true\n },\n methodArguments: {\n type: [\n { value: 'undefined' },\n { value: 'unknown[]' }\n ],\n erased: true\n }\n },\n outputProperties: {\n methodResult: {\n type: 'ParameterType:object'\n }\n }\n };\n}\n","import { type IIsElementInViewportOperationData } from \"@operation/is-element-in-viewport.ts\";\nimport { type IOperationMetadata } from \"@operation/metadata/types.ts\";\n\nexport function isElementInViewport(): IOperationMetadata<IIsElementInViewportOperationData> {\n return {\n description: `Checks if an element is currently visible within the viewport.\n\nUses \\`getBoundingClientRect()\\` to determine if the element is within the viewport boundaries.`,\n category: `DOM`,\n dependentProperties: ['selectedElement'],\n outputProperties: {\n isInViewport: {\n type: 'ParameterType:boolean'\n }\n }\n };\n}\n","import { type ILoadFromStorageOperationData } from \"@operation/load-from-storage.ts\";\nimport { type IOperationMetadata } from \"@operation/metadata/types.ts\";\n\nexport function loadFromStorage(): IOperationMetadata<ILoadFromStorageOperationData> {\n return {\n description: `Loads data from browser storage (localStorage or sessionStorage).\n\nDeserializes the stored JSON value. Returns \\`null\\` if key doesn't exist.`,\n category: `Data`,\n properties: {\n key: {\n type: 'ParameterType:string',\n required: true,\n erased: true\n },\n storageType: {\n type: [\n { value: 'local' },\n { value: 'session' }\n ],\n required: true,\n erased: true\n }\n },\n outputProperties: {\n loadedValue: {\n type: 'ParameterType:object'\n }\n }\n };\n}\n","import { type ILoadJSONOperationData } from \"@operation/load-json.ts\";\nimport { type IOperationMetadata } from \"@operation/metadata/types.ts\";\n\nexport function loadJson(): IOperationMetadata<ILoadJSONOperationData> {\n return {\n description: `This operation loads a JSON file from the specified url and assigns it to the json\nproperty on the current operation data.\n\nIf the cache property is set to true and a cached value already exists, this is assigned\ninstead of re-retrieving it from the url.`,\n category: `Utility`,\n properties: {\n url: {\n type: 'ParameterType:string',\n required: true,\n erased: true\n },\n cache: {\n type: [\n { value: 'undefined' },\n { value: 'false' },\n { value: 'true' }\n ],\n erased: true\n }\n },\n outputProperties: {\n json: {\n type: 'ParameterType:object'\n }\n }\n };\n}\n","import { type ILogOperationData } from \"@operation/log.ts\";\nimport { type IOperationMetadata } from \"@operation/metadata/types.ts\";\n\nexport function log(): IOperationMetadata<ILogOperationData> {\n return {\n description: `This operation logs the specified value, or, when no logValue property has been assigned\nit will log the current operation data, global data and scope to the console`,\n category: `Utility`,\n properties: {\n logValue: {\n type: 'ParameterType:object|ParameterType:string|ParameterType:number|ParameterType:boolean|ParameterType:array',\n erased: true\n },\n logName: {\n type: [\n { value: 'undefined' },\n { value: 'string' }\n ],\n erased: true\n }\n },\n };\n}\n","import { type IMapArrayOperationData } from \"@operation/map-array.ts\";\nimport { type IOperationMetadata } from \"@operation/metadata/types.ts\";\n\nexport function mapArray(): IOperationMetadata<IMapArrayOperationData> {\n return {\n description: `Transforms each element of an array using a mapping function.\n\nOperates on arrayData passed from previous operations.\nThe mapFunction receives each item and optionally its index.`,\n category: `Array`,\n dependentProperties: ['arrayData'],\n properties: {\n mapFunction: {\n type: 'ParameterType:function',\n required: true,\n erased: true\n }\n },\n outputProperties: {\n mappedArray: {\n type: [\n { value: 'undefined' },\n { value: 'any[]' }\n ]\n }\n }\n };\n}\n","import { type IMathOperationData } from \"@operation/math.ts\";\nimport { type IOperationMetadata } from \"@operation/metadata/types.ts\";\n\nexport function math(): IOperationMetadata<IMathOperationData> {\n return {\n description: `This operation performs the given math function with the specified arguments.`,\n category: `Utility`,\n properties: {\n args: {\n type: 'ParameterType:array',\n required: true,\n erased: true\n },\n functionName: {\n type: 'ParameterType:mathfunction',\n required: true,\n erased: true\n }\n },\n outputProperties: {\n mathResult: {\n type: [\n { value: 'undefined' },\n { value: 'number' }\n ]\n }\n }\n };\n}\n","import { type IOperationMetadata } from \"@operation/metadata/types.ts\";\n\nexport function otherwise(): IOperationMetadata<undefined> {\n return {\n description: `If the preceeding {@link when} operation evaluates to \\`true\\` subsequent operations will\nbe skipped until an {@link endWhen} operation is encountered.`,\n category: `Control Flow`,\n };\n}\n","import { type IOperationMetadata } from \"@operation/metadata/types.ts\";\nimport { type IRemoveClassOperationData } from \"@operation/remove-class.ts\";\n\nexport function removeClass(): IOperationMetadata<IRemoveClassOperationData> {\n return {\n description: `This operation removes the spcified class name from the given selected element.`,\n category: `DOM`,\n dependentProperties: ['selectedElement'],\n properties: {\n className: {\n type: 'ParameterType:className',\n required: true,\n erased: true\n }\n },\n };\n}\n","import { type IOperationMetadata } from \"@operation/metadata/types.ts\";\nimport { type IRemoveControllerFromElementOperationData } from \"@operation/remove-controller-from-element.ts\";\n\nexport function removeControllerFromElement(): IOperationMetadata<IRemoveControllerFromElementOperationData> {\n return {\n description: `This operation removes the controller with the specified name from the given selected element.`,\n category: `Controller`,\n dependentProperties: ['selectedElement'],\n properties: {\n controllerName: {\n type: 'ParameterType:controllerName',\n required: true,\n erased: true\n }\n },\n };\n}\n","import { type IOperationMetadata } from \"@operation/metadata/types.ts\";\nimport { type IRemoveElementOperationData } from \"@operation/remove-element.ts\";\n\nexport function removeElement(): IOperationMetadata<IRemoveElementOperationData> {\n return {\n description: `This operation removes the given selected element from the DOM.`,\n category: `DOM`,\n dependentProperties: ['selectedElement'],\n };\n}\n","import { type IOperationMetadata } from \"@operation/metadata/types.ts\";\nimport { type IRemovePropertiesFromOperationDataOperationData } from \"@operation/remove-properties-from-operation-data.ts\";\n\nexport function removePropertiesFromOperationData(): IOperationMetadata<IRemovePropertiesFromOperationDataOperationData> {\n return {\n description: `This operation removes the given list of properties from the current operation data.\nIt will also remove the property \\`propertyNames\\` from the result.`,\n category: `Data`,\n properties: {\n propertyNames: {\n type: 'ParameterType:array',\n itemType: 'ParameterType:string',\n required: true,\n erased: true\n }\n },\n };\n}\n","import { type IOperationMetadata } from \"@operation/metadata/types.ts\";\nimport { type IReparentElementOperationData } from \"@operation/reparent-element.ts\";\n\nexport function reparentElement(): IOperationMetadata<IReparentElementOperationData> {\n return {\n description: `This operation moves the given selected element to the new parent that is defined\nby the specified \\`newParentSelector\\`.`,\n category: `DOM`,\n dependentProperties: ['selectedElement'],\n properties: {\n newParentSelector: {\n type: 'ParameterType:selector',\n required: true,\n erased: true\n }\n },\n };\n}\n","import { type IOperationMetadata } from \"@operation/metadata/types.ts\";\nimport { type IReplaceStringOperationData } from \"@operation/replace-string.ts\";\n\nexport function replaceString(): IOperationMetadata<IReplaceStringOperationData> {\n return {\n description: `Replaces occurrences of a pattern in a string (alias for replaceText for string context).`,\n category: `String`,\n dependentProperties: ['textContent'],\n properties: {\n pattern: {\n type: [\n { value: 'string' },\n { value: 'RegExp' }\n ],\n required: true,\n erased: true\n },\n replacement: {\n type: 'ParameterType:string',\n required: true,\n erased: true\n }\n },\n outputProperties: {\n result: {\n type: 'ParameterType:string'\n }\n }\n };\n}\n","import { type IOperationMetadata } from \"@operation/metadata/types.ts\";\nimport { type IReplaceTextOperationData } from \"@operation/replace-text.ts\";\n\nexport function replaceText(): IOperationMetadata<IReplaceTextOperationData> {\n return {\n description: `Finds and replaces text using literal string or regex pattern.\n\nOperates on textContent passed from previous operations (e.g., getTextContent).\nSupports regex patterns with global flag for multiple replacements.\nUpdates textContent with replaced text and sets replacementCount.`,\n category: `Text`,\n dependentProperties: ['textContent'],\n properties: {\n searchPattern: {\n type: [\n { value: 'string' },\n { value: 'RegExp' }\n ],\n required: true,\n erased: true\n },\n replacement: {\n type: 'ParameterType:string',\n required: true,\n erased: true\n }\n },\n outputProperties: {\n replacementCount: {\n type: 'ParameterType:number'\n }\n }\n };\n}\n","import { type IOperationMetadata } from \"@operation/metadata/types.ts\";\nimport { type IRequestActionOperationData } from \"@operation/request-action.ts\";\n\nexport function requestAction(): IOperationMetadata<IRequestActionOperationData> {\n return {\n description: `This operation requests an action instance with the specified name and assigns it\nto the \\`actionInstance\\` property on the current operation data.`,\n category: `Action`,\n properties: {\n systemName: {\n type: 'ParameterType:actionName',\n required: true,\n erased: true\n }\n },\n outputProperties: {\n actionInstance: {\n type: 'ParameterType:object'\n }\n }\n };\n}\n","import { type IOperationMetadata } from \"@operation/metadata/types.ts\";\nimport { type ISaveToStorageOperationData } from \"@operation/save-to-storage.ts\";\n\nexport function saveToStorage(): IOperationMetadata<ISaveToStorageOperationData> {\n return {\n description: `Saves data to browser storage (localStorage or sessionStorage).\n\nSerializes the value as JSON before storing. Supports any JSON-serializable data type.`,\n category: `Data`,\n properties: {\n key: {\n type: 'ParameterType:string',\n required: true,\n erased: true\n },\n value: {\n type: 'ParameterType:object',\n required: true,\n erased: true\n },\n storageType: {\n type: [\n { value: 'local' },\n { value: 'session' }\n ],\n required: true,\n erased: true\n }\n },\n };\n}\n","import { type IOperationMetadata } from \"@operation/metadata/types.ts\";\nimport { type IScrollToElementOperationData } from \"@operation/scroll-to-element.ts\";\n\nexport function scrollToElement(): IOperationMetadata<IScrollToElementOperationData> {\n return {\n description: `Scrolls the viewport to bring the selected element into view.\n\nUses the browser's \\`scrollIntoView\\` API with configurable behavior.`,\n category: `Scroll`,\n dependentProperties: ['selectedElement'],\n properties: {\n behavior: {\n type: [\n { value: 'undefined' },\n { value: 'auto' },\n { value: 'smooth' }\n ],\n erased: true\n },\n block: {\n type: [\n { value: 'undefined' },\n { value: 'start' },\n { value: 'center' },\n { value: 'end' },\n { value: 'nearest' }\n ],\n erased: true\n },\n inline: {\n type: [\n { value: 'undefined' },\n { value: 'start' },\n { value: 'center' },\n { value: 'end' },\n { value: 'nearest' }\n ],\n erased: true\n }\n },\n };\n}\n","import { type IOperationMetadata } from \"@operation/metadata/types.ts\";\nimport { type IScrollToPositionOperationData } from \"@operation/scroll-to-position.ts\";\n\nexport function scrollToPosition(): IOperationMetadata<IScrollToPositionOperationData> {\n return {\n description: `Scrolls the viewport to a specific x,y coordinate position.\n\nUses the browser's \\`window.scrollTo\\` API with configurable behavior.`,\n category: `Scroll`,\n properties: {\n x: {\n type: 'ParameterType:number',\n required: true,\n erased: true\n },\n y: {\n type: 'ParameterType:number',\n required: true,\n erased: true\n },\n behavior: {\n type: [\n { value: 'undefined' },\n { value: 'auto' },\n { value: 'smooth' }\n ],\n erased: true\n }\n },\n };\n}\n","import { type IOperationMetadata } from \"@operation/metadata/types.ts\";\nimport { type ISelectElementOperationData } from \"@operation/select-element.ts\";\n\nexport function selectElement(): IOperationMetadata<ISelectElementOperationData> {\n return {\n description: `This operation selects one or more elements using the specified selector.\n\nIf \\`useSelectedElementAsRoot\\` is set to true and a valid DOM element is assigned\nto the current operation data's \\`selectedElement\\` property\nthen the element will be looked for only in the descendant elements of this DOM element.`,\n category: `DOM`,\n properties: {\n selector: {\n type: 'ParameterType:selector',\n required: true,\n erased: true\n },\n useSelectedElementAsRoot: {\n type: [\n { value: 'undefined' },\n { value: 'false' },\n { value: 'true' }\n ],\n erased: true\n }\n },\n outputProperties: {\n selectedElement: {\n type: 'ParameterType:object'\n }\n }\n };\n}\n","import { type IOperationMetadata } from \"@operation/metadata/types.ts\";\nimport { type ISetDataOperationData } from \"@operation/set-data.ts\";\n\nexport function setData(): IOperationMetadata<ISetDataOperationData> {\n return {\n description: `This operation assigns the specified properties to the specified data targets.`,\n category: `Data`,\n properties: {\n properties: {\n type: 'ParameterType:object',\n required: true,\n erased: true\n }\n },\n };\n}\n","import { type IOperationMetadata } from \"@operation/metadata/types.ts\";\nimport { type ISetElementAttributesOperationData } from \"@operation/set-element-attributes.ts\";\n\nexport function setElementAttributes(): IOperationMetadata<ISetElementAttributesOperationData> {\n return {\n description: `This operation sets the specified set of attributes on the given selected element.`,\n category: `DOM`,\n dependentProperties: ['selectedElement'],\n properties: {\n attributes: {\n type: 'ParameterType:object',\n required: true,\n erased: true\n }\n },\n };\n}\n","import { type IOperationMetadata } from \"@operation/metadata/types.ts\";\nimport { type ISetElementContentOperationData } from \"@operation/set-element-content.ts\";\n\nexport function setElementContent(): IOperationMetadata<ISetElementContentOperationData> {\n return {\n description: `This operation sets the specified content defined by the value assigned to the template property\nto the given selected element.\n\nWhen the \\`insertionType\\` is set to \\`overwrite\\` the contents of the selected element are replaced\nby the given template.\nWhen set to \\`append\\` the new content will be inserted after the current content.\nWhen set to \\`prepend\\` the new content will be inserted before the current content.`,\n category: `DOM`,\n dependentProperties: ['selectedElement'],\n properties: {\n template: {\n type: [\n { value: 'string' },\n { value: 'Element' },\n { value: 'Text' },\n { value: 'Comment' },\n { value: 'Document' },\n { value: 'DocumentFragment' }\n ],\n erased: true\n },\n insertionType: {\n type: [\n { value: 'overwrite' },\n { value: 'append' },\n { value: 'prepend' }\n ],\n erased: true\n }\n },\n };\n}\n","import { type IOperationMetadata } from \"@operation/metadata/types.ts\";\nimport { type ISetFocusOperationData } from \"@operation/set-focus.ts\";\n\nexport function setFocus(): IOperationMetadata<ISetFocusOperationData> {\n return {\n description: `Sets focus to the selected element.`,\n category: `Focus`,\n dependentProperties: ['selectedElement'],\n };\n}\n","import { type IOperationMetadata } from \"@operation/metadata/types.ts\";\nimport { type ISetFormValueOperationData } from \"@operation/set-form-value.ts\";\n\nexport function setFormValue(): IOperationMetadata<ISetFormValueOperationData> {\n return {\n description: `Sets the value of an input, select, or textarea element.\n\nHandles different input types appropriately:\n- Text inputs, textareas, selects: sets value directly\n- Checkboxes: sets checked property for boolean values\n- Radio buttons: sets checked property for boolean values\n- Number inputs: converts to string`,\n category: `Form`,\n dependentProperties: ['selectedElement'],\n properties: {\n value: {\n type: [\n { value: 'string' },\n { value: 'number' },\n { value: 'false' },\n { value: 'true' }\n ],\n required: true,\n erased: true\n }\n },\n };\n}\n","import { type IOperationMetadata } from \"@operation/metadata/types.ts\";\nimport { type ISetGlobalDataOperationData } from \"@operation/set-global-data.ts\";\n\nexport function setGlobalData(): IOperationMetadata<ISetGlobalDataOperationData> {\n return {\n description: `This operation copies the specified properties from the operationData to the global data.`,\n category: `Data`,\n properties: {\n propertyNames: {\n type: 'ParameterType:array',\n itemType: 'ParameterType:string',\n required: true,\n erased: true\n }\n },\n };\n}\n","import { type IOperationMetadata } from \"@operation/metadata/types.ts\";\nimport { type ISetOperationData } from \"@operation/set-operation-data.ts\";\n\nexport function setOperationData(): IOperationMetadata<ISetOperationData> {\n return {\n description: `This operation assigns the specified properties to the current operation data.\nWhen override is set to true the properties replace the current operation data entirely.`,\n category: `Data`,\n properties: {\n override: {\n type: [\n { value: 'undefined' },\n { value: 'false' },\n { value: 'true' }\n ],\n erased: true\n },\n properties: {\n type: 'ParameterType:object',\n required: true,\n erased: true\n }\n },\n };\n}\n","import { type IOperationMetadata } from \"@operation/metadata/types.ts\";\nimport { type ISetStyleOperationData } from \"@operation/set-style.ts\";\n\nexport function setStyle(): IOperationMetadata<ISetStyleOperationData> {\n return {\n description: `This operation assigns the specified CSS style properties to the\ngiven selected element.`,\n category: `DOM`,\n dependentProperties: ['selectedElement'],\n properties: {\n properties: {\n type: 'ParameterType:cssProperties',\n required: true,\n erased: true\n }\n },\n };\n}\n","import { type IOperationMetadata } from \"@operation/metadata/types.ts\";\nimport { type ISetVariableOperationData } from \"@operation/set-variable.ts\";\n\nexport function setVariable(): IOperationMetadata<ISetVariableOperationData> {\n return {\n description: `This operation sets a variable with the specified name on the scope with the specified value.`,\n category: `Data`,\n properties: {\n name: {\n type: 'ParameterType:string',\n required: true,\n erased: true\n },\n value: {\n type: 'ParameterType:object|ParameterType:string|ParameterType:number|ParameterType:boolean|ParameterType:array',\n required: true,\n erased: true\n }\n },\n };\n}\n","import { type IOperationMetadata } from \"@operation/metadata/types.ts\";\nimport { type ISortArrayOperationData } from \"@operation/sort-array.ts\";\n\nexport function sortArray(): IOperationMetadata<ISortArrayOperationData> {\n return {\n description: `Sorts an array by property, natural order, or custom comparator function.\n\nOperates on arrayData passed from previous operations.\nSupports three sorting modes:\n1. Property sort: \\`sortProperty\\` and \\`sortOrder\\` to sort objects by property\n2. Natural sort: \\`sortOrder\\` alone for primitive arrays\n3. Custom comparator: \\`sortComparator\\` function for complex sorting logic`,\n category: `Array`,\n dependentProperties: ['arrayData'],\n properties: {\n sortProperty: {\n type: [\n { value: 'undefined' },\n { value: 'string' }\n ],\n erased: true\n },\n sortOrder: {\n type: [\n { value: 'undefined' },\n { value: 'asc' },\n { value: 'desc' }\n ],\n erased: true\n },\n sortComparator: {\n type: [\n { value: 'undefined' },\n { value: '(a: any, b: any) => number' }\n ],\n erased: true\n }\n },\n outputProperties: {\n sortedArray: {\n type: 'ParameterType:array'\n }\n }\n };\n}\n","import { type IOperationMetadata } from \"@operation/metadata/types.ts\";\nimport { type ISplitStringOperationData } from \"@operation/split-string.ts\";\n\nexport function splitString(): IOperationMetadata<ISplitStringOperationData> {\n return {\n description: `Splits a string into an array by delimiter (string or regex).`,\n category: `String`,\n dependentProperties: ['textContent'],\n properties: {\n delimiter: {\n type: [\n { value: 'string' },\n { value: 'RegExp' }\n ],\n required: true,\n erased: true\n },\n limit: {\n type: [\n { value: 'undefined' },\n { value: 'number' }\n ],\n erased: true\n }\n },\n outputProperties: {\n resultArray: {\n type: 'ParameterType:array',\n itemType: 'ParameterType:string'\n }\n }\n };\n}\n","import { type IOperationMetadata } from \"@operation/metadata/types.ts\";\nimport { type IStartActionOperationData } from \"@operation/start-action.ts\";\n\nexport function startAction(): IOperationMetadata<IStartActionOperationData> {\n return {\n description: `This operation starts the specified action instance using the given action operation data.\n\nThe action operation data is first merged with the current operation data before it is\npassed on to the action. After the action has completed the action operation data properties\nare removed from the current operation data.`,\n category: `Action`,\n dependentProperties: ['actionInstance'],\n properties: {\n actionOperationData: {\n type: 'ParameterType:object',\n erased: true\n }\n },\n };\n}\n","import { type IOperationMetadata } from \"@operation/metadata/types.ts\";\nimport { type ISubstringTextOperationData } from \"@operation/substring-text.ts\";\n\nexport function substringText(): IOperationMetadata<ISubstringTextOperationData> {\n return {\n description: `Extracts a substring from text between start and end indices.`,\n category: `Text`,\n dependentProperties: ['textContent'],\n properties: {\n start: {\n type: 'ParameterType:number',\n required: true,\n erased: true\n },\n end: {\n type: [\n { value: 'undefined' },\n { value: 'number' }\n ],\n erased: true\n }\n },\n outputProperties: {\n substring: {\n type: 'ParameterType:string'\n }\n }\n };\n}\n","import { type IOperationMetadata } from \"@operation/metadata/types.ts\";\nimport { type IToggleClassOperationData } from \"@operation/toggle-class.ts\";\n\nexport function toggleClass(): IOperationMetadata<IToggleClassOperationData> {\n return {\n description: `This operation toggles the specfied class name on the given selected element.\n\nMeaning, if the specified class name exists on the given element it will be removed,\notherwise it will be added.`,\n category: `DOM`,\n dependentProperties: ['selectedElement'],\n properties: {\n className: {\n type: 'ParameterType:className',\n required: true,\n erased: true\n }\n },\n };\n}\n","import { type IOperationMetadata } from \"@operation/metadata/types.ts\";\nimport { type IToggleElementOperationData } from \"@operation/toggle-element.ts\";\n\nexport function toggleElement(): IOperationMetadata<IToggleElementOperationData> {\n return {\n description: `This operation toggles the visibility of the given selected element.\n\nMeaning, if the element is hidden, it will be made visible, otherwise\nit will be hidden.`,\n category: `DOM`,\n dependentProperties: ['selectedElement'],\n };\n}\n","import { type IOperationMetadata } from \"@operation/metadata/types.ts\";\nimport { type IToggleFormElementOperationData } from \"@operation/toggle-form-element.ts\";\n\nexport function toggleFormElement(): IOperationMetadata<IToggleFormElementOperationData> {\n return {\n description: `Enables or disables form input elements (inputs, selects, textareas, buttons).\n\nSets the \\`disabled\\` property on the element. When \\`enabled\\` is true, removes the disabled\nattribute; when false, adds the disabled attribute.`,\n category: `Form`,\n dependentProperties: ['selectedElement'],\n properties: {\n enabled: {\n type: 'ParameterType:boolean',\n required: true,\n erased: true\n }\n },\n };\n}\n","import { type IOperationMetadata } from \"@operation/metadata/types.ts\";\nimport { type IValidateFormOperationData } from \"@operation/validate-form.ts\";\n\nexport function validateForm(): IOperationMetadata<IValidateFormOperationData> {\n return {\n description: `Validates form fields against HTML5 validation and custom rules.\n\nUses HTML5 validation API (checkValidity()) for native validation, and supports\ncustom validation rules for: required, minLength, maxLength, pattern (regex), and email format.`,\n category: `Form`,\n dependentProperties: ['selectedElement'],\n properties: {\n validationRules: {\n type: [\n { value: 'undefined' },\n { value: 'Record<string, import(\"/home/runner/work/eligius/eligius/src/operation/validate-form\").IValidationRules>' }\n ],\n erased: true\n }\n },\n outputProperties: {\n validationErrors: {\n type: 'ParameterType:object'\n },\n isValid: {\n type: [\n { value: 'undefined' },\n { value: 'false' },\n { value: 'true' }\n ]\n }\n }\n };\n}\n","import { type IOperationMetadata } from \"@operation/metadata/types.ts\";\nimport { type IWaitOperationData } from \"@operation/wait.ts\";\n\nexport function wait(): IOperationMetadata<IWaitOperationData> {\n return {\n description: `This operation waits for the specified amount of milliseconds.`,\n category: `Utility`,\n properties: {\n milliseconds: {\n type: 'ParameterType:number',\n required: true,\n erased: true\n }\n },\n };\n}\n","import { type IOperationMetadata } from \"@operation/metadata/types.ts\";\nimport { type IWhenOperationData } from \"@operation/when.ts\";\n\nexport function when(): IOperationMetadata<IWhenOperationData> {\n return {\n description: `When the given expression evaluates to false, subsequent operations will be skipped\nuntil an {@link endWhen} or {@link otherwise} operation is encountered.\n\nPractically, this means an \\`if\\` or \\`if\\`/\\`else\\` statement control flow implementation in a list of operations.\n\nThe expression is passed in as a formatted string.\nThe left and right values of the expression can be defined like this:\n\n'constant': for a constant string\n100: for a constant number\n$operationData.foo: for an operation data value\n$globaldata.foo: for a global data value\n$scope.loopIndex: for a scope value`,\n category: `Control Flow`,\n properties: {\n expression: {\n type: 'ParameterType:expression',\n required: true,\n erased: true\n }\n },\n };\n}\n","export { addClass } from \"@operation/metadata/add-class.ts\";\nexport { addControllerToElement } from \"@operation/metadata/add-controller-to-element.ts\";\nexport { addGlobalsToOperation } from \"@operation/metadata/add-globals-to-operation.ts\";\nexport { animateWithClass } from \"@operation/metadata/animate-with-class.ts\";\nexport { animate } from \"@operation/metadata/animate.ts\";\nexport { announceToScreenReader } from \"@operation/metadata/announce-to-screen-reader.ts\";\nexport { breakForEach } from \"@operation/metadata/break-for-each.ts\";\nexport { broadcastEvent } from \"@operation/metadata/broadcast-event.ts\";\nexport { calc } from \"@operation/metadata/calc.ts\";\nexport { clearElement } from \"@operation/metadata/clear-element.ts\";\nexport { clearOperationData } from \"@operation/metadata/clear-operation-data.ts\";\nexport { clearStorage } from \"@operation/metadata/clear-storage.ts\";\nexport { compareDate } from \"@operation/metadata/compare-date.ts\";\nexport { concatenateStrings } from \"@operation/metadata/concatenate-strings.ts\";\nexport { continueForEach } from \"@operation/metadata/continue-for-each.ts\";\nexport { createElement } from \"@operation/metadata/create-element.ts\";\nexport { customFunction } from \"@operation/metadata/custom-function.ts\";\nexport { endAction } from \"@operation/metadata/end-action.ts\";\nexport { endForEach } from \"@operation/metadata/end-for-each.ts\";\nexport { endWhen } from \"@operation/metadata/end-when.ts\";\nexport { extendController } from \"@operation/metadata/extend-controller.ts\";\nexport { filterArray } from \"@operation/metadata/filter-array.ts\";\nexport { findInArray } from \"@operation/metadata/find-in-array.ts\";\nexport { forEach } from \"@operation/metadata/for-each.ts\";\nexport { formatDate } from \"@operation/metadata/format-date.ts\";\nexport { formatText } from \"@operation/metadata/format-text.ts\";\nexport { getAttributesFromElement } from \"@operation/metadata/get-attributes-from-element.ts\";\nexport { getControllerFromElement } from \"@operation/metadata/get-controller-from-element.ts\";\nexport { getControllerInstance } from \"@operation/metadata/get-controller-instance.ts\";\nexport { getCurrentTime } from \"@operation/metadata/get-current-time.ts\";\nexport { getElementDimensions } from \"@operation/metadata/get-element-dimensions.ts\";\nexport { getFocusedElement } from \"@operation/metadata/get-focused-element.ts\";\nexport { getFormData } from \"@operation/metadata/get-form-data.ts\";\nexport { getImport } from \"@operation/metadata/get-import.ts\";\nexport { getQueryParams } from \"@operation/metadata/get-query-params.ts\";\nexport { getScrollPosition } from \"@operation/metadata/get-scroll-position.ts\";\nexport { getTextContent } from \"@operation/metadata/get-text-content.ts\";\nexport { httpDelete } from \"@operation/metadata/http-delete.ts\";\nexport { httpPost } from \"@operation/metadata/http-post.ts\";\nexport { httpPut } from \"@operation/metadata/http-put.ts\";\nexport { invokeObjectMethod } from \"@operation/metadata/invoke-object-method.ts\";\nexport { isElementInViewport } from \"@operation/metadata/is-element-in-viewport.ts\";\nexport { loadFromStorage } from \"@operation/metadata/load-from-storage.ts\";\nexport { loadJson } from \"@operation/metadata/load-json.ts\";\nexport { log } from \"@operation/metadata/log.ts\";\nexport { mapArray } from \"@operation/metadata/map-array.ts\";\nexport { math } from \"@operation/metadata/math.ts\";\nexport { otherwise } from \"@operation/metadata/otherwise.ts\";\nexport { removeClass } from \"@operation/metadata/remove-class.ts\";\nexport { removeControllerFromElement } from \"@operation/metadata/remove-controller-from-element.ts\";\nexport { removeElement } from \"@operation/metadata/remove-element.ts\";\nexport { removePropertiesFromOperationData } from \"@operation/metadata/remove-properties-from-operation-data.ts\";\nexport { reparentElement } from \"@operation/metadata/reparent-element.ts\";\nexport { replaceString } from \"@operation/metadata/replace-string.ts\";\nexport { replaceText } from \"@operation/metadata/replace-text.ts\";\nexport { requestAction } from \"@operation/metadata/request-action.ts\";\nexport { saveToStorage } from \"@operation/metadata/save-to-storage.ts\";\nexport { scrollToElement } from \"@operation/metadata/scroll-to-element.ts\";\nexport { scrollToPosition } from \"@operation/metadata/scroll-to-position.ts\";\nexport { selectElement } from \"@operation/metadata/select-element.ts\";\nexport { setData } from \"@operation/metadata/set-data.ts\";\nexport { setElementAttributes } from \"@operation/metadata/set-element-attributes.ts\";\nexport { setElementContent } from \"@operation/metadata/set-element-content.ts\";\nexport { setFocus } from \"@operation/metadata/set-focus.ts\";\nexport { setFormValue } from \"@operation/metadata/set-form-value.ts\";\nexport { setGlobalData } from \"@operation/metadata/set-global-data.ts\";\nexport { setOperationData } from \"@operation/metadata/set-operation-data.ts\";\nexport { setStyle } from \"@operation/metadata/set-style.ts\";\nexport { setVariable } from \"@operation/metadata/set-variable.ts\";\nexport { sortArray } from \"@operation/metadata/sort-array.ts\";\nexport { splitString } from \"@operation/metadata/split-string.ts\";\nexport { startAction } from \"@operation/metadata/start-action.ts\";\nexport { substringText } from \"@operation/metadata/substring-text.ts\";\nexport { toggleClass } from \"@operation/metadata/toggle-class.ts\";\nexport { toggleElement } from \"@operation/metadata/toggle-element.ts\";\nexport { toggleFormElement } from \"@operation/metadata/toggle-form-element.ts\";\nexport { validateForm } from \"@operation/metadata/validate-form.ts\";\nexport { wait } from \"@operation/metadata/wait.ts\";\nexport { when } from \"@operation/metadata/when.ts\";\nexport * from \"@operation/metadata/types.ts\";\n","import type {TControllerName, TOperationName} from '@configuration/types.ts';\nimport * as controllers from '@controllers/index.ts';\nimport * as operations from '@operation/index.ts';\nimport * as operationMetadata from '@operation/metadata/index.ts';\nimport type {IOperationMetadata} from '@operation/metadata/types.ts';\n\n/**\n *\n * Provider for all the available operation names\n *\n */\nexport class OperationNamesProvider {\n getOperationNames(): TOperationName {\n return Object.keys(operations) as unknown as TOperationName;\n }\n}\n\n/**\n *\n * Provider for all the available controller names\n *\n */\nexport class ControllerNamesProvider {\n getControllerNames(): TControllerName {\n return Object.keys(controllers) as unknown as TControllerName;\n }\n}\n\n/**\n *\n * Provider that can retrieve the metadata associated with a given operation name\n *\n */\nexport class OperationMetadataProvider {\n getOperationMetadata(operationName: TOperationName) {\n const getMetadata = (\n operationMetadata as Record<\n TOperationName,\n () => IOperationMetadata<operations.TOperationData>\n >\n )[operationName];\n if (!getMetadata) {\n throw new Error(\n `Could not find metadata for operation called ${operationName}`\n );\n }\n return getMetadata();\n }\n}\n","import type {IStrictDuration, ISubtitle} from '../../types.ts';\n\n/**\n * This class converts an AVID subtitle file to an `ISubtitle` array.\n */\nexport class SubtitleImporter {\n importSubtitles(rawLines: string[]): ISubtitle[] {\n const result: ISubtitle[] = [];\n const lines: string[] = [];\n for (let i: number = 0, l: number = rawLines.length; i < l; i++) {\n const rawLine: string = this.stripNewlineChars(rawLines[i].toString());\n if (this.isValidLine(rawLine)) {\n lines.push(rawLine);\n }\n }\n if (lines[0] === '') {\n lines.splice(0, 1);\n }\n while (lines[lines.length - 1] === '') {\n lines.pop();\n }\n let caption: Partial<ISubtitle> | null = null;\n lines.forEach((line: string) => {\n if (line.length === 0 || !caption) {\n caption = {text: ''};\n if (line.length) {\n //this happens for first caption only\n caption.duration = this.convertDuration(line);\n }\n result.push(caption as ISubtitle);\n } else {\n if (!Object.hasOwn(caption, 'duration')) {\n caption.duration = this.convertDuration(line);\n } else {\n caption.text += line;\n }\n }\n });\n return result;\n }\n\n stripNewlineChars(str: string): string {\n let res: string = '';\n for (let i: number = 0, l: number = str.length; i < l; i++) {\n if (str.charCodeAt(i) !== 13 && str.charCodeAt(i) !== 0) {\n res += str.charAt(i);\n }\n }\n return res;\n }\n\n isValidLine(line: string): boolean {\n return (\n !line.startsWith('@') &&\n !line.startsWith('<begin subtitles>') &&\n !line.startsWith('<end subtitles>')\n );\n }\n\n convertDuration(time: string): IStrictDuration {\n const times: string[] = time.split(' ');\n return {\n start: this.convertTimeToSeconds(times[0]),\n end: this.convertTimeToSeconds(times[1]),\n };\n }\n\n convertTimeToSeconds(time: string): number {\n const parts: string[] = time.split(':');\n return (\n parseInt(parts[0], 10) * 3600 +\n parseInt(parts[1], 10) * 60 +\n parseInt(parts[2], 10)\n );\n }\n}\n","import {v4 as uuidv4} from 'uuid';\nimport type {\n IStrictDuration,\n ISubtitle,\n ISubtitleCollection,\n TLanguageCode,\n} from '../../types.ts';\n\n/**\n * Used to edit and add to an {@link ISubtitleCollection}.\n */\nexport class SubtitleEditor {\n constructor(private collection: ISubtitleCollection[] = []) {}\n\n private _getLanguage(languageCode: string) {\n return this.collection.find(x => x.languageCode === languageCode);\n }\n\n /**\n * Adds a new {@link ISubtitleCollection} for the given `languageCode`.\n *\n * If collections already exist for existing language codes then a duplicate\n * of these collections is created with the same duration info but all of the\n * text is left empty.\n *\n * @param languageCode\n * @returns\n */\n addLanguage(languageCode: TLanguageCode) {\n const language = this._getLanguage(languageCode);\n if (language) {\n throw new Error(`Language ${languageCode} already exists.`);\n }\n const newLanguage: ISubtitleCollection = this.collection.length\n ? {\n ...this.collection[0],\n languageCode,\n titles: this.collection[0].titles.map(x => ({\n id: uuidv4(),\n duration: {...x.duration},\n text: '',\n })),\n }\n : {\n languageCode,\n titles: [],\n };\n this.collection.push(newLanguage);\n return this;\n }\n\n /**\n *\n * Add a single subtitle line that is associated with the given `languageCode`\n *\n * @param languageCode\n * @param subtitle\n * @returns\n */\n addSubtitle(languageCode: TLanguageCode, subtitle: ISubtitle) {\n const language = this._getLanguage(languageCode);\n if (!language) {\n throw new Error(`Language ${languageCode} does not exist.`);\n }\n language.titles.push(subtitle);\n return this;\n }\n\n addSubtitles(\n duration: IStrictDuration,\n subtitles: Record<TLanguageCode, string>\n ) {\n Object.entries(subtitles).forEach(([languageCode, subtitle]) =>\n this.addSubtitle(languageCode as TLanguageCode, {\n id: uuidv4(),\n duration: {...duration},\n text: subtitle,\n })\n );\n return this;\n }\n\n setSubtitle(languageCode: TLanguageCode, subtitle: ISubtitle) {\n const language = this._getLanguage(languageCode);\n if (!language) {\n throw new Error(`Language ${languageCode} does not exist.`);\n }\n\n const titleIdx = language.titles.findIndex(x => x.id === subtitle.id);\n if (titleIdx < 0) {\n throw new Error(\n `Subtitle with id '${subtitle.id}' was not found in language with code ${languageCode}.`\n );\n }\n\n language.titles[titleIdx] = {\n ...subtitle,\n duration: {...subtitle.duration},\n };\n return this;\n }\n\n export() {\n return this.collection;\n }\n}\n","import {getPropertyChainValue} from '@operation/helper/get-property-chain-value.ts';\n\n/**\n * Gets the value for the given property chain. A property chain is defined by a period delimited string.\n *\n * For example, this property chain: `mySource.subSource.element.value` should be extracted from an object of this shape:\n * ```ts\n * const foo = {\n * mySource: {\n * subSource: {\n * element: {\n * value: 'bar'\n * }\n * }\n * }\n * }\n * ```\n *\n * The result of the invocation `resolvePropertyChain('mySource.subSource.element.value', foo)` would then yield the value `bar`.\n */\nexport function resolvePropertyChain(propertyChain: string, sourceObject: any) {\n const properties = propertyChain.split('.');\n return getPropertyChainValue(properties, sourceObject);\n}\n","import {Action, EndableAction, TimelineAction} from '@action/index.ts';\nimport type {IAction} from '@action/types.ts';\nimport type {\n IActionConfiguration,\n IEndableActionConfiguration,\n IEngineConfiguration,\n IEventActionConfiguration,\n IOperationConfiguration,\n IResolvedActionConfiguration,\n IResolvedEndableActionConfiguration,\n IResolvedEngineConfiguration,\n IResolvedOperation,\n IResolvedTimelineConfiguration,\n ITimelineActionConfiguration,\n ITimelineConfiguration,\n} from '@configuration/types.ts';\nimport type {ActionRegistryEventbusListener} from '@eventbus/index.ts';\nimport type {IEventbus} from '@eventbus/types.ts';\nimport {deepCopy} from '@operation/helper/deep-copy.ts';\nimport {resolvePropertyChain} from '@operation/helper/resolve-property-chain.ts';\nimport type {TOperationData} from '@operation/types.ts';\nimport {isObject} from '@util/guards/is-object.ts';\nimport {isString} from '@util/guards/is-string.ts';\nimport {isDefined} from 'ts-is-present';\nimport type {\n IConfigurationResolver,\n ISimpleResourceImporter,\n} from '../types.ts';\n\n/**\n * Takes an `IEngineConfiguration` instance and return an `IResolvedEngineConfiguration`.\n * This means all system names within the configuration will be resolved to their associated instances.\n *\n * If the given configuration includes event actions, then those will be registered in the given `ActionRegistryEventbusListener`.\n *\n */\nexport class ConfigurationResolver implements IConfigurationResolver {\n constructor(\n private importer: ISimpleResourceImporter,\n private eventbus: IEventbus\n ) {}\n\n process(\n configuration: IEngineConfiguration,\n actionRegistryListener?: ActionRegistryEventbusListener\n ): [Record<string, IAction>, IResolvedEngineConfiguration] {\n resolvePlaceholders(configuration, configuration, this.importer);\n\n if (!isDefined(configuration.timelineProviderSettings)) {\n throw new Error(\n 'Configuration incomplete: it needs to have at least one timeline provider setting'\n );\n }\n\n const resolvedConfig: IResolvedEngineConfiguration = {\n id: configuration.id,\n engine: {...configuration.engine},\n timelineProviderSettings: deepCopy(\n configuration.timelineProviderSettings\n ),\n containerSelector: configuration.containerSelector,\n cssFiles: configuration.cssFiles,\n language: configuration.language,\n layoutTemplate: configuration.layoutTemplate,\n availableLanguages: deepCopy(configuration.availableLanguages),\n actions: resolveActions(\n configuration.actions,\n this.importer,\n this.eventbus\n ),\n initActions: resolveActions(\n configuration.initActions,\n this.importer,\n this.eventbus\n ),\n timelineFlow: deepCopy(configuration.timelineFlow),\n timelines: resolveTimelines(\n configuration.timelines,\n this.importer,\n this.eventbus\n ),\n };\n\n let eventActions: IAction[] = [];\n if (configuration.eventActions?.length && actionRegistryListener) {\n eventActions = resolveEventActions(\n configuration.eventActions,\n actionRegistryListener,\n this.importer,\n this.eventbus\n );\n }\n\n const actionsLookup = (resolvedConfig.actions as IAction[])\n .concat(eventActions)\n .reduce<Record<string, IAction>>(\n (aggr, action) => ({\n ...aggr,\n [action.name]: action,\n }),\n {}\n );\n\n return [actionsLookup, resolvedConfig];\n }\n}\n\nfunction resolveEventActions(\n eventActionConfigurations: IEventActionConfiguration[],\n actionRegistryListener: ActionRegistryEventbusListener,\n importer: ISimpleResourceImporter,\n eventbus: IEventbus\n) {\n const resolvedConfigs =\n eventActionConfigurations.map<IResolvedActionConfiguration>(config =>\n resolveActionConfiguration(config, importer)\n );\n\n return resolvedConfigs.map((config, index) => {\n const {eventName, eventTopic} = eventActionConfigurations[index];\n const eventAction = new Action(\n config.name,\n config.startOperations,\n eventbus\n );\n actionRegistryListener.registerAction(eventAction, eventName, eventTopic);\n return eventAction;\n });\n}\n\nfunction resolveTimelines(\n timelines: ITimelineConfiguration[],\n importer: ISimpleResourceImporter,\n eventbus: IEventbus\n) {\n const resolve = resolveTimelineAction.bind(null, importer, eventbus);\n\n return timelines.map<IResolvedTimelineConfiguration>(config => ({\n ...config,\n timelineActions: config.timelineActions.map(resolve),\n }));\n}\n\nfunction resolveOperation(\n importer: ISimpleResourceImporter,\n operationConfig: IOperationConfiguration<TOperationData>\n): IResolvedOperation {\n return {\n id: operationConfig.id,\n systemName: operationConfig.systemName,\n operationData: deepCopy(operationConfig.operationData) ?? {},\n instance: importer.import(operationConfig.systemName)[\n operationConfig.systemName\n ],\n };\n}\n\nfunction resolveActionConfiguration(\n config: IActionConfiguration,\n importer: ISimpleResourceImporter\n): IResolvedActionConfiguration {\n const resolve = resolveOperation.bind(null, importer);\n\n return {\n id: config.id,\n name: config.name,\n startOperations: config.startOperations.map(resolve),\n };\n}\n\nfunction resolveEndableActionConfiguration(\n config: IEndableActionConfiguration,\n importer: ISimpleResourceImporter\n): IResolvedEndableActionConfiguration {\n const resolve = resolveOperation.bind(null, importer);\n\n const action = resolveActionConfiguration(config, importer);\n\n return {\n ...action,\n endOperations: config.endOperations.map(resolve),\n };\n}\n\nfunction resolveTimelineAction(\n importer: ISimpleResourceImporter,\n eventbus: IEventbus,\n actionConfiguration: ITimelineActionConfiguration\n) {\n const resolvedConfig = resolveEndableActionConfiguration(\n actionConfiguration,\n importer\n );\n const duration = {\n end: actionConfiguration.duration.end ?? -1,\n start: actionConfiguration.duration.start,\n };\n\n const {id, name, endOperations, startOperations} = resolvedConfig;\n const action = new TimelineAction(\n name,\n startOperations,\n endOperations,\n duration,\n eventbus\n );\n action.id = id;\n return action;\n}\n\nfunction resolveActions(\n actionConfigurations: IEndableActionConfiguration[],\n importer: ISimpleResourceImporter,\n eventbus: IEventbus\n) {\n const resolvedConfigs =\n actionConfigurations.map<IResolvedEndableActionConfiguration>(config => {\n return resolveEndableActionConfiguration(config, importer);\n });\n\n return resolvedConfigs.map<EndableAction>(resolvedConfig => {\n const {name, endOperations, startOperations} = resolvedConfig;\n const action = new EndableAction(\n name,\n startOperations,\n endOperations,\n eventbus\n );\n action.id = resolvedConfig.id;\n return action;\n });\n}\n\nfunction resolvePlaceholders(\n configFragment: Record<string, any> | any[],\n rootConfig: any,\n importer: ISimpleResourceImporter\n) {\n if (!isDefined(configFragment)) {\n return;\n }\n\n if (Array.isArray(configFragment)) {\n configFragment.forEach(item => {\n resolvePlaceholders(item, rootConfig, importer);\n });\n } else if (isObject(configFragment)) {\n Object.keys(configFragment).forEach(key => {\n resolvePlaceholder(key, configFragment, rootConfig, importer);\n });\n }\n}\n\nfunction resolvePlaceholder(\n key: PropertyKey,\n configFragment: any,\n rootConfig: any,\n importer: ISimpleResourceImporter\n) {\n const configValue = configFragment[key];\n if (isString(configValue)) {\n if (configValue.startsWith('config:')) {\n const configProperty = configValue.substring(7, configValue.length);\n configFragment[key] = resolvePropertyChain(configProperty, rootConfig);\n } else if (configValue.startsWith('template:')) {\n const templateKey = configValue.substring(9, configValue.length);\n const template = importer.import(templateKey)[templateKey];\n configFragment[key] = template;\n } else if (configValue.startsWith('json:')) {\n const jsonKey = configValue.substring(5, configValue.length);\n const json = importer.import(jsonKey)[jsonKey];\n configFragment[key] = json;\n }\n } else if (isObject(configValue) || Array.isArray(configValue)) {\n resolvePlaceholders(configValue, rootConfig, importer);\n }\n}\n","import { type IDOMEventListenerControllerOperationData } from \"@controllers/dom-event-listener-controller.ts\";\nimport { type IControllerMetadata } from \"@controllers/metadata/types.ts\";\n\nexport function DOMEventListenerController(): IControllerMetadata<IDOMEventListenerControllerOperationData> {\n return {\n description: `This controller attaches to the given selected element and adds a DOM event listener for the specified event name that\nexecutes the given actions with the given operation data.\n\nBy default the \\`start\\` operations of the specified actions are executed. To execute the \\`end\\` operations instead,\nprefix the action name with \\`end:\\`.`,\n dependentProperties: ['selectedElement'],\n properties: {\n eventName: {\n type: 'ParameterType:eventName',\n required: true,\n },\n actions: {\n type: 'ParameterType:array',\n itemType: 'ParameterType:string',\n },\n actionOperationData: {\n type: 'ParameterType:object',\n }\n },\n };\n}\n","import { type ILabelControllerMetadata } from \"@controllers/label-controller.ts\";\nimport { type IControllerMetadata } from \"@controllers/metadata/types.ts\";\n\nexport function LabelController(): IControllerMetadata<ILabelControllerMetadata> {\n return {\n description: `This controller attaches to the given selected element and renders the text\nassociated with the given translation key.\n\nThe controller listens for the \\`language-change\\` event and re-renders the text\nwith the new language after such an event.\n\nUses the rosetta-based locale system via \\`request-translation\\` event.`,\n dependentProperties: ['selectedElement'],\n properties: {\n translationKey: {\n type: 'ParameterType:string',\n required: true,\n },\n attributeName: {\n type: [\n { value: 'undefined' },\n { value: 'string' }\n ],\n }\n },\n };\n}\n","import { type ILottieControllerMetadata } from \"@controllers/lottie-controller.ts\";\nimport { type IControllerMetadata } from \"@controllers/metadata/types.ts\";\n\nexport function LottieController(): IControllerMetadata<ILottieControllerMetadata> {\n return {\n description: `This controller renders a [lottie-web](https://github.com/airbnb/lottie-web) animation inside the given selected element.\n\nThe url may encode freeze and end positions like this: my-url/filename[freeze=10,end=21].json`,\n properties: {\n url: {\n type: 'ParameterType:url',\n required: true,\n }\n },\n };\n}\n","import { type IControllerMetadata } from \"@controllers/metadata/types.ts\";\nimport { type IMutationObserverControllerMetadata } from \"@controllers/mutation-observer-controller.ts\";\n\nexport function MutationObserverController(): IControllerMetadata<IMutationObserverControllerMetadata> {\n return {\n description: `Controller that observes DOM mutations on a selected element and broadcasts events.\n\nThis controller creates a MutationObserver to monitor DOM changes (attributes, child nodes,\ntext content) on a specified element. All detected mutations are broadcasted through the\nEligius eventbus, enabling reactive behavior in response to DOM changes.\n\nThe controller follows the standard Eligius lifecycle:\n- init(): Store configuration metadata\n- attach(): Create and start the MutationObserver\n- detach(): Disconnect the observer and clean up resources`,\n dependentProperties: ['selectedElement'],\n properties: {\n observeAttributes: {\n type: [\n { value: 'undefined' },\n { value: 'false' },\n { value: 'true' }\n ],\n },\n observeChildList: {\n type: [\n { value: 'undefined' },\n { value: 'false' },\n { value: 'true' }\n ],\n },\n observeCharacterData: {\n type: [\n { value: 'undefined' },\n { value: 'false' },\n { value: 'true' }\n ],\n },\n observeSubtree: {\n type: [\n { value: 'undefined' },\n { value: 'false' },\n { value: 'true' }\n ],\n },\n attributeOldValue: {\n type: [\n { value: 'undefined' },\n { value: 'false' },\n { value: 'true' }\n ],\n },\n characterDataOldValue: {\n type: [\n { value: 'undefined' },\n { value: 'false' },\n { value: 'true' }\n ],\n },\n attributeFilter: {\n type: [\n { value: 'undefined' },\n { value: 'string[]' }\n ],\n }\n },\n };\n}\n","import { type IControllerMetadata } from \"@controllers/metadata/types.ts\";\nimport { type INavigationControllerOperationData } from \"@controllers/navigation-controller.ts\";\n\nexport function NavigationController(): IControllerMetadata<INavigationControllerOperationData> {\n return {\n description: ``,\n dependentProperties: ['selectedElement'],\n properties: {\n json: {\n type: 'ParameterType:object',\n required: true,\n }\n },\n };\n}\n","import { type IControllerMetadata } from \"@controllers/metadata/types.ts\";\nimport { type IProgressbarControllerOperationData } from \"@controllers/progressbar-controller.ts\";\n\nexport function ProgressbarController(): IControllerMetadata<IProgressbarControllerOperationData> {\n return {\n description: `This controller renders a progressbar that displays the progress of the current timeline in the given selected element.\n\nThe current progress as a percentage is rendered in the given text element.`,\n dependentProperties: ['selectedElement', 'textElement'],\n };\n}\n","import { type IControllerMetadata } from \"@controllers/metadata/types.ts\";\nimport { type IRoutingControllerOperationData } from \"@controllers/routing-controller.ts\";\n\nexport function RoutingController(): IControllerMetadata<IRoutingControllerOperationData> {\n return {\n description: `This is a work in progress, do not use this yet please....`,\n properties: {\n json: {\n type: 'ParameterType:object',\n required: true,\n }\n },\n };\n}\n","import { type IControllerMetadata } from \"@controllers/metadata/types.ts\";\nimport { type ISubtitlesControllerOperationData } from \"@controllers/subtitles-controller.ts\";\n\nexport function SubtitlesController(): IControllerMetadata<ISubtitlesControllerOperationData> {\n return {\n description: ``,\n dependentProperties: ['selectedElement'],\n properties: {\n language: {\n type: 'ParameterType:languagecode',\n },\n subtitleData: {\n type: 'ParameterType:array',\n }\n },\n };\n}\n","export { DOMEventListenerController } from \"@controllers/metadata/dom-event-listener-controller.ts\";\nexport { LabelController } from \"@controllers/metadata/label-controller.ts\";\nexport { LottieController } from \"@controllers/metadata/lottie-controller.ts\";\nexport { MutationObserverController } from \"@controllers/metadata/mutation-observer-controller.ts\";\nexport { NavigationController } from \"@controllers/metadata/navigation-controller.ts\";\nexport { ProgressbarController } from \"@controllers/metadata/progressbar-controller.ts\";\nexport { RoutingController } from \"@controllers/metadata/routing-controller.ts\";\nexport { SubtitlesController } from \"@controllers/metadata/subtitles-controller.ts\";\nexport * from \"@controllers/metadata/types.ts\";\n","import { type BeforeRequestTimelineUriEvent } from \"@eventbus/events/before-request-timeline-uri.ts\";\nimport { type IEventMetadata } from \"@eventbus/events/metadata/types.ts\";\n\nexport function beforeRequestTimelineUri(): IEventMetadata<BeforeRequestTimelineUriEvent['args']> {\n return {\n description: `Event: before-request-timeline-uri`,\n category: `Timeline`,\n args: []\n };\n}\n","import { type BeforeRequestVideoUrlEvent } from \"@eventbus/events/before-request-video-url.ts\";\nimport { type IEventMetadata } from \"@eventbus/events/metadata/types.ts\";\n\nexport function beforeRequestVideoUrl(): IEventMetadata<BeforeRequestVideoUrlEvent['args']> {\n return {\n description: `Event: before-request-video-url`,\n category: `Navigation`,\n args: [\n {\n name: 'index',\n type: 'number'\n },\n {\n name: 'requestedVideoPosition',\n type: 'number'\n },\n {\n name: 'isHistoryRequest',\n type: 'boolean'\n }]\n };\n}\n","import { type DomMutationEvent } from \"@eventbus/events/dom-mutation.ts\";\nimport { type IEventMetadata } from \"@eventbus/events/metadata/types.ts\";\n\nexport function domMutation(): IEventMetadata<DomMutationEvent['args']> {\n return {\n description: `Event: dom-mutation`,\n category: `Controller`,\n args: [\n {\n name: 'payload',\n type: 'any'\n }]\n };\n}\n","import { type HighlightNavigationEvent } from \"@eventbus/events/highlight-navigation.ts\";\nimport { type IEventMetadata } from \"@eventbus/events/metadata/types.ts\";\n\nexport function highlightNavigation(): IEventMetadata<HighlightNavigationEvent['args']> {\n return {\n description: `Event: highlight-navigation`,\n category: `Navigation`,\n args: [\n {\n name: 'videoUrlIndex',\n type: 'number'\n }]\n };\n}\n","import { type LanguageChangeEvent } from \"@eventbus/events/language-change.ts\";\nimport { type IEventMetadata } from \"@eventbus/events/metadata/types.ts\";\n\nexport function languageChange(): IEventMetadata<LanguageChangeEvent['args']> {\n return {\n description: `Event: language-change`,\n category: `Language Manager`,\n args: [\n {\n name: 'language',\n type: 'TLanguageCode'\n }]\n };\n}\n","import { type IEventMetadata } from \"@eventbus/events/metadata/types.ts\";\nimport { type NavigateToVideoUrlEvent } from \"@eventbus/events/navigate-to-video-url.ts\";\n\nexport function navigateToVideoUrl(): IEventMetadata<NavigateToVideoUrlEvent['args']> {\n return {\n description: `Event: navigate-to-video-url`,\n category: `Navigation`,\n args: [\n {\n name: 'index',\n type: 'number'\n },\n {\n name: 'requestedVideoPosition',\n type: 'number'\n }]\n };\n}\n","import { type IEventMetadata } from \"@eventbus/events/metadata/types.ts\";\nimport { type PushHistoryStateEvent } from \"@eventbus/events/push-history-state.ts\";\n\nexport function pushHistoryState(): IEventMetadata<PushHistoryStateEvent['args']> {\n return {\n description: `Event: push-history-state`,\n category: `Navigation`,\n args: [\n {\n name: 'state',\n type: 'any'\n }]\n };\n}\n","import { type IEventMetadata } from \"@eventbus/events/metadata/types.ts\";\nimport { type RequestActionEvent } from \"@eventbus/events/request-action.ts\";\n\nexport function requestAction(): IEventMetadata<RequestActionEvent['args']> {\n return {\n description: `Event: request-action`,\n category: `Engine Request`,\n args: [\n {\n name: 'actionName',\n type: 'string'\n },\n {\n name: 'callback',\n type: '(actionInstance: any) => void'\n }]\n };\n}\n","import { type IEventMetadata } from \"@eventbus/events/metadata/types.ts\";\nimport { type RequestCurrentLanguageEvent } from \"@eventbus/events/request-current-language.ts\";\n\nexport function requestCurrentLanguage(): IEventMetadata<RequestCurrentLanguageEvent['args']> {\n return {\n description: `Event: request-current-language`,\n category: `Engine Request`,\n args: [\n {\n name: 'callback',\n type: '(language: TLanguageCode) => void'\n }]\n };\n}\n","import { type IEventMetadata } from \"@eventbus/events/metadata/types.ts\";\nimport { type RequestCurrentNavigationEvent } from \"@eventbus/events/request-current-navigation.ts\";\n\nexport function requestCurrentNavigation(): IEventMetadata<RequestCurrentNavigationEvent['args']> {\n return {\n description: `Event: request-current-navigation`,\n category: `Navigation`,\n args: [\n {\n name: 'callback',\n type: '(navigation: any) => void'\n }]\n };\n}\n","import { type IEventMetadata } from \"@eventbus/events/metadata/types.ts\";\nimport { type RequestCurrentTimelinePositionEvent } from \"@eventbus/events/request-current-timeline-position.ts\";\n\nexport function requestCurrentTimelinePosition(): IEventMetadata<RequestCurrentTimelinePositionEvent['args']> {\n return {\n description: `Event: request-current-timeline-position`,\n category: `Engine Request`,\n args: [\n {\n name: 'callback',\n type: 'TResultCallback<number>'\n }]\n };\n}\n","import { type IEventMetadata } from \"@eventbus/events/metadata/types.ts\";\nimport { type RequestCurrentVideoPositionEvent } from \"@eventbus/events/request-current-video-position.ts\";\n\nexport function requestCurrentVideoPosition(): IEventMetadata<RequestCurrentVideoPositionEvent['args']> {\n return {\n description: `Event: request-current-video-position`,\n category: `Navigation`,\n args: [\n {\n name: 'callback',\n type: '(position: number) => void'\n }]\n };\n}\n","import { type IEventMetadata } from \"@eventbus/events/metadata/types.ts\";\nimport { type RequestEngineRootEvent } from \"@eventbus/events/request-engine-root.ts\";\n\nexport function requestEngineRoot(): IEventMetadata<RequestEngineRootEvent['args']> {\n return {\n description: `Event: request-engine-root`,\n category: `Engine Request`,\n args: [\n {\n name: 'callback',\n type: '(root: any) => void'\n }]\n };\n}\n","import { type IEventMetadata } from \"@eventbus/events/metadata/types.ts\";\nimport { type RequestFunctionEvent } from \"@eventbus/events/request-function.ts\";\n\nexport function requestFunction(): IEventMetadata<RequestFunctionEvent['args']> {\n return {\n description: `Event: request-function`,\n category: `Engine Request`,\n args: [\n {\n name: 'systemName',\n type: 'string'\n },\n {\n name: 'callback',\n type: '(fn: any) => void'\n }]\n };\n}\n","import { type IEventMetadata } from \"@eventbus/events/metadata/types.ts\";\nimport { type RequestInstanceEvent } from \"@eventbus/events/request-instance.ts\";\n\nexport function requestInstance(): IEventMetadata<RequestInstanceEvent['args']> {\n return {\n description: `Event: request-instance`,\n category: `Engine Request`,\n args: [\n {\n name: 'instanceName',\n type: 'string'\n },\n {\n name: 'callback',\n type: '(instance: any) => void'\n }]\n };\n}\n","import { type IEventMetadata } from \"@eventbus/events/metadata/types.ts\";\nimport { type RequestLabelCollectionEvent } from \"@eventbus/events/request-label-collection.ts\";\n\nexport function requestLabelCollection(): IEventMetadata<RequestLabelCollectionEvent['args']> {\n return {\n description: `Event: request-label-collection`,\n category: `Engine Request`,\n args: [\n {\n name: 'language',\n type: 'string'\n },\n {\n name: 'callback',\n type: '(collection: any) => void'\n }]\n };\n}\n","import { type IEventMetadata } from \"@eventbus/events/metadata/types.ts\";\nimport { type RequestLabelCollectionsEvent } from \"@eventbus/events/request-label-collections.ts\";\n\nexport function requestLabelCollections(): IEventMetadata<RequestLabelCollectionsEvent['args']> {\n return {\n description: `Event: request-label-collections`,\n category: `Engine Request`,\n args: [\n {\n name: 'labelIds',\n type: 'string[]'\n },\n {\n name: 'callback',\n type: '(collections: any) => void'\n }]\n };\n}\n","import { type IEventMetadata } from \"@eventbus/events/metadata/types.ts\";\nimport { type RequestTimelineCleanupEvent } from \"@eventbus/events/request-timeline-cleanup.ts\";\n\nexport function requestTimelineCleanup(): IEventMetadata<RequestTimelineCleanupEvent['args']> {\n return {\n description: `Event: request-timeline-cleanup`,\n category: `Engine Request`,\n args: []\n };\n}\n","import { type IEventMetadata } from \"@eventbus/events/metadata/types.ts\";\nimport { type RequestTimelineUriEvent } from \"@eventbus/events/request-timeline-uri.ts\";\n\nexport function requestTimelineUri(): IEventMetadata<RequestTimelineUriEvent['args']> {\n return {\n description: `Event: request-timeline-uri`,\n category: `Engine Request`,\n args: [\n {\n name: 'uri',\n type: 'string'\n },\n {\n name: 'position',\n type: 'number'\n }]\n };\n}\n","import { type IEventMetadata } from \"@eventbus/events/metadata/types.ts\";\nimport { type RequestVideoCleanupEvent } from \"@eventbus/events/request-video-cleanup.ts\";\n\nexport function requestVideoCleanup(): IEventMetadata<RequestVideoCleanupEvent['args']> {\n return {\n description: `Event: request-video-cleanup`,\n category: `Navigation`,\n args: []\n };\n}\n","import { type IEventMetadata } from \"@eventbus/events/metadata/types.ts\";\nimport { type RequestVideoUrlEvent } from \"@eventbus/events/request-video-url.ts\";\n\nexport function requestVideoUrl(): IEventMetadata<RequestVideoUrlEvent['args']> {\n return {\n description: `Event: request-video-url`,\n category: `Navigation`,\n args: [\n {\n name: 'videoUrlIndex',\n type: 'number'\n },\n {\n name: 'requestedVideoPosition',\n type: 'number'\n },\n {\n name: 'fromRouting',\n type: 'boolean'\n }]\n };\n}\n","import { type IEventMetadata } from \"@eventbus/events/metadata/types.ts\";\nimport { type CompleteEvent } from \"@eventbus/events/timeline-complete.ts\";\n\nexport function timelineComplete(): IEventMetadata<CompleteEvent['args']> {\n return {\n description: `Event: timeline-complete`,\n category: `Timeline`,\n args: []\n };\n}\n","import { type IEventMetadata } from \"@eventbus/events/metadata/types.ts\";\nimport { type ContainerRequestEvent } from \"@eventbus/events/timeline-container-request.ts\";\n\nexport function timelineContainerRequest(): IEventMetadata<ContainerRequestEvent['args']> {\n return {\n description: `Event: timeline-container-request`,\n category: `Timeline`,\n args: [\n {\n name: 'callback',\n type: '(element: HTMLElement) => void'\n }]\n };\n}\n","import { type IEventMetadata } from \"@eventbus/events/metadata/types.ts\";\nimport { type CurrentTimelineChangeEvent } from \"@eventbus/events/timeline-current-timeline-change.ts\";\n\nexport function timelineCurrentTimelineChange(): IEventMetadata<CurrentTimelineChangeEvent['args']> {\n return {\n description: `Event: timeline-current-timeline-change`,\n category: `Timeline`,\n args: [\n {\n name: 'timelineUri',\n type: 'string'\n }]\n };\n}\n","import { type IEventMetadata } from \"@eventbus/events/metadata/types.ts\";\nimport { type DurationRequestEvent } from \"@eventbus/events/timeline-duration-request.ts\";\n\nexport function timelineDurationRequest(): IEventMetadata<DurationRequestEvent['args']> {\n return {\n description: `Event: timeline-duration-request`,\n category: `Timeline`,\n args: [\n {\n name: 'callback',\n type: '(duration: number) => void'\n }]\n };\n}\n","import { type IEventMetadata } from \"@eventbus/events/metadata/types.ts\";\nimport { type DurationEvent } from \"@eventbus/events/timeline-duration.ts\";\n\nexport function timelineDuration(): IEventMetadata<DurationEvent['args']> {\n return {\n description: `Event: timeline-duration`,\n category: `Timeline`,\n args: [\n {\n name: 'getDuration',\n type: '(() => number) | undefined'\n }]\n };\n}\n","import { type IEventMetadata } from \"@eventbus/events/metadata/types.ts\";\nimport { type FirstFrameEvent } from \"@eventbus/events/timeline-firstframe.ts\";\n\nexport function timelineFirstframe(): IEventMetadata<FirstFrameEvent['args']> {\n return {\n description: `Event: timeline-firstframe`,\n category: `Timeline`,\n args: []\n };\n}\n","import { type IEventMetadata } from \"@eventbus/events/metadata/types.ts\";\nimport { type PauseRequestEvent } from \"@eventbus/events/timeline-pause-request.ts\";\n\nexport function timelinePauseRequest(): IEventMetadata<PauseRequestEvent['args']> {\n return {\n description: `Event: timeline-pause-request`,\n category: `Timeline`,\n args: []\n };\n}\n","import { type IEventMetadata } from \"@eventbus/events/metadata/types.ts\";\nimport { type PauseEvent } from \"@eventbus/events/timeline-pause.ts\";\n\nexport function timelinePause(): IEventMetadata<PauseEvent['args']> {\n return {\n description: `Event: timeline-pause`,\n category: `Timeline`,\n args: []\n };\n}\n","import { type IEventMetadata } from \"@eventbus/events/metadata/types.ts\";\nimport { type PlayRequestEvent } from \"@eventbus/events/timeline-play-request.ts\";\n\nexport function timelinePlayRequest(): IEventMetadata<PlayRequestEvent['args']> {\n return {\n description: `Event: timeline-play-request`,\n category: `Timeline`,\n args: []\n };\n}\n","import { type IEventMetadata } from \"@eventbus/events/metadata/types.ts\";\nimport { type PlayToggleRequestEvent } from \"@eventbus/events/timeline-play-toggle-request.ts\";\n\nexport function timelinePlayToggleRequest(): IEventMetadata<PlayToggleRequestEvent['args']> {\n return {\n description: `Event: timeline-play-toggle-request`,\n category: `Timeline`,\n args: []\n };\n}\n","import { type IEventMetadata } from \"@eventbus/events/metadata/types.ts\";\nimport { type PlayEvent } from \"@eventbus/events/timeline-play.ts\";\n\nexport function timelinePlay(): IEventMetadata<PlayEvent['args']> {\n return {\n description: `Event: timeline-play`,\n category: `Timeline`,\n args: []\n };\n}\n","import { type IEventMetadata } from \"@eventbus/events/metadata/types.ts\";\nimport { type RequestCurrentTimelineEvent } from \"@eventbus/events/timeline-request-current-timeline.ts\";\n\nexport function timelineRequestCurrentTimeline(): IEventMetadata<RequestCurrentTimelineEvent['args']> {\n return {\n description: `Event: timeline-request-current-timeline`,\n category: `Engine Request`,\n args: [\n {\n name: 'callback',\n type: 'TResultCallback<string>'\n }]\n };\n}\n","import { type IEventMetadata } from \"@eventbus/events/metadata/types.ts\";\nimport { type ResizeRequestEvent } from \"@eventbus/events/timeline-resize-request.ts\";\n\nexport function timelineResizeRequest(): IEventMetadata<ResizeRequestEvent['args']> {\n return {\n description: `Event: timeline-resize-request`,\n category: `Timeline`,\n args: []\n };\n}\n","import { type IEventMetadata } from \"@eventbus/events/metadata/types.ts\";\nimport { type ResizeEvent } from \"@eventbus/events/timeline-resize.ts\";\n\nexport function timelineResize(): IEventMetadata<ResizeEvent['args']> {\n return {\n description: `Event: timeline-resize`,\n category: `Timeline`,\n args: []\n };\n}\n","import { type IEventMetadata } from \"@eventbus/events/metadata/types.ts\";\nimport { type RestartEvent } from \"@eventbus/events/timeline-restart.ts\";\n\nexport function timelineRestart(): IEventMetadata<RestartEvent['args']> {\n return {\n description: `Event: timeline-restart`,\n category: `Timeline`,\n args: []\n };\n}\n","import { type IEventMetadata } from \"@eventbus/events/metadata/types.ts\";\nimport { type SeekRequestEvent } from \"@eventbus/events/timeline-seek-request.ts\";\n\nexport function timelineSeekRequest(): IEventMetadata<SeekRequestEvent['args']> {\n return {\n description: `Event: timeline-seek-request`,\n category: `Timeline`,\n args: [\n {\n name: 'position',\n type: 'number'\n }]\n };\n}\n","import { type IEventMetadata } from \"@eventbus/events/metadata/types.ts\";\nimport { type SeekEvent } from \"@eventbus/events/timeline-seek.ts\";\n\nexport function timelineSeek(): IEventMetadata<SeekEvent['args']> {\n return {\n description: `Event: timeline-seek`,\n category: `Timeline`,\n args: [\n {\n name: 'seekPosition',\n type: 'number'\n },\n {\n name: 'currentPosition',\n type: 'number'\n },\n {\n name: 'duration',\n type: 'number'\n }]\n };\n}\n","import { type IEventMetadata } from \"@eventbus/events/metadata/types.ts\";\nimport { type SeekedEvent } from \"@eventbus/events/timeline-seeked.ts\";\n\nexport function timelineSeeked(): IEventMetadata<SeekedEvent['args']> {\n return {\n description: `Event: timeline-seeked`,\n category: `Timeline`,\n args: [\n {\n name: 'position',\n type: 'number'\n },\n {\n name: 'duration',\n type: 'number'\n }]\n };\n}\n","import { type IEventMetadata } from \"@eventbus/events/metadata/types.ts\";\nimport { type StopRequestEvent } from \"@eventbus/events/timeline-stop-request.ts\";\n\nexport function timelineStopRequest(): IEventMetadata<StopRequestEvent['args']> {\n return {\n description: `Event: timeline-stop-request`,\n category: `Timeline`,\n args: []\n };\n}\n","import { type IEventMetadata } from \"@eventbus/events/metadata/types.ts\";\nimport { type StopEvent } from \"@eventbus/events/timeline-stop.ts\";\n\nexport function timelineStop(): IEventMetadata<StopEvent['args']> {\n return {\n description: `Event: timeline-stop`,\n category: `Timeline`,\n args: []\n };\n}\n","import { type IEventMetadata } from \"@eventbus/events/metadata/types.ts\";\nimport { type TimeEvent } from \"@eventbus/events/timeline-time.ts\";\n\nexport function timelineTime(): IEventMetadata<TimeEvent['args']> {\n return {\n description: `Event: timeline-time`,\n category: `Timeline`,\n args: [\n {\n name: 'position',\n type: 'number'\n }]\n };\n}\n","import { type IEventMetadata } from \"@eventbus/events/metadata/types.ts\";\nimport { type VideoCompleteEvent } from \"@eventbus/events/video-complete.ts\";\n\nexport function videoComplete(): IEventMetadata<VideoCompleteEvent['args']> {\n return {\n description: `Event: video-complete`,\n category: `Navigation`,\n args: [\n {\n name: 'index',\n type: 'number'\n }]\n };\n}\n","export { beforeRequestTimelineUri } from \"@eventbus/events/metadata/before-request-timeline-uri.ts\";\nexport { beforeRequestVideoUrl } from \"@eventbus/events/metadata/before-request-video-url.ts\";\nexport { domMutation } from \"@eventbus/events/metadata/dom-mutation.ts\";\nexport { highlightNavigation } from \"@eventbus/events/metadata/highlight-navigation.ts\";\nexport { languageChange } from \"@eventbus/events/metadata/language-change.ts\";\nexport { navigateToVideoUrl } from \"@eventbus/events/metadata/navigate-to-video-url.ts\";\nexport { pushHistoryState } from \"@eventbus/events/metadata/push-history-state.ts\";\nexport { requestAction } from \"@eventbus/events/metadata/request-action.ts\";\nexport { requestCurrentLanguage } from \"@eventbus/events/metadata/request-current-language.ts\";\nexport { requestCurrentNavigation } from \"@eventbus/events/metadata/request-current-navigation.ts\";\nexport { requestCurrentTimelinePosition } from \"@eventbus/events/metadata/request-current-timeline-position.ts\";\nexport { requestCurrentVideoPosition } from \"@eventbus/events/metadata/request-current-video-position.ts\";\nexport { requestEngineRoot } from \"@eventbus/events/metadata/request-engine-root.ts\";\nexport { requestFunction } from \"@eventbus/events/metadata/request-function.ts\";\nexport { requestInstance } from \"@eventbus/events/metadata/request-instance.ts\";\nexport { requestLabelCollection } from \"@eventbus/events/metadata/request-label-collection.ts\";\nexport { requestLabelCollections } from \"@eventbus/events/metadata/request-label-collections.ts\";\nexport { requestTimelineCleanup } from \"@eventbus/events/metadata/request-timeline-cleanup.ts\";\nexport { requestTimelineUri } from \"@eventbus/events/metadata/request-timeline-uri.ts\";\nexport { requestVideoCleanup } from \"@eventbus/events/metadata/request-video-cleanup.ts\";\nexport { requestVideoUrl } from \"@eventbus/events/metadata/request-video-url.ts\";\nexport { timelineComplete } from \"@eventbus/events/metadata/timeline-complete.ts\";\nexport { timelineContainerRequest } from \"@eventbus/events/metadata/timeline-container-request.ts\";\nexport { timelineCurrentTimelineChange } from \"@eventbus/events/metadata/timeline-current-timeline-change.ts\";\nexport { timelineDurationRequest } from \"@eventbus/events/metadata/timeline-duration-request.ts\";\nexport { timelineDuration } from \"@eventbus/events/metadata/timeline-duration.ts\";\nexport { timelineFirstframe } from \"@eventbus/events/metadata/timeline-firstframe.ts\";\nexport { timelinePauseRequest } from \"@eventbus/events/metadata/timeline-pause-request.ts\";\nexport { timelinePause } from \"@eventbus/events/metadata/timeline-pause.ts\";\nexport { timelinePlayRequest } from \"@eventbus/events/metadata/timeline-play-request.ts\";\nexport { timelinePlayToggleRequest } from \"@eventbus/events/metadata/timeline-play-toggle-request.ts\";\nexport { timelinePlay } from \"@eventbus/events/metadata/timeline-play.ts\";\nexport { timelineRequestCurrentTimeline } from \"@eventbus/events/metadata/timeline-request-current-timeline.ts\";\nexport { timelineResizeRequest } from \"@eventbus/events/metadata/timeline-resize-request.ts\";\nexport { timelineResize } from \"@eventbus/events/metadata/timeline-resize.ts\";\nexport { timelineRestart } from \"@eventbus/events/metadata/timeline-restart.ts\";\nexport { timelineSeekRequest } from \"@eventbus/events/metadata/timeline-seek-request.ts\";\nexport { timelineSeek } from \"@eventbus/events/metadata/timeline-seek.ts\";\nexport { timelineSeeked } from \"@eventbus/events/metadata/timeline-seeked.ts\";\nexport { timelineStopRequest } from \"@eventbus/events/metadata/timeline-stop-request.ts\";\nexport { timelineStop } from \"@eventbus/events/metadata/timeline-stop.ts\";\nexport { timelineTime } from \"@eventbus/events/metadata/timeline-time.ts\";\nexport { videoComplete } from \"@eventbus/events/metadata/video-complete.ts\";\nexport * from \"@eventbus/events/metadata/types.ts\";\n","import type {IAction} from '@action/types.ts';\nimport type {IEventbusListener} from '@eventbus/types.ts';\n\n/**\n * The `IEventbusListener` first registers a number of actions that are then\n * executed when the specified event is broadcast.\n */\nexport class ActionRegistryEventbusListener implements IEventbusListener {\n private _actionRegistry = new Map<string, IAction[]>();\n\n registerAction(\n action: IAction,\n eventName: string,\n eventTopic?: string\n ): void {\n if (eventTopic?.length) {\n eventName = `${eventName}:${eventTopic}`;\n }\n if (!this._actionRegistry.has(eventName)) {\n this._actionRegistry.set(eventName, []);\n }\n this._actionRegistry.get(eventName)?.push(action);\n }\n\n handleEvent(\n eventName: string,\n eventTopic: string | undefined,\n args: any[]\n ): void {\n if (eventTopic) {\n eventName = `${eventName}:${eventTopic}`;\n }\n const actions = this._actionRegistry.get(eventName);\n if (actions) {\n const operationData = {\n eventArgs: args,\n };\n actions.forEach(action => {\n action.start(operationData);\n });\n }\n }\n}\n","import type {\n IEventbus,\n IEventbusInterceptor,\n IEventbusListener,\n TEventbusRemover,\n TEventHandler,\n TRequestResponder,\n} from '@eventbus/types.ts';\n\n/**\n * Central event bus for pub/sub communication and synchronous request/response queries.\n *\n * The eventbus supports:\n * - **Pub/Sub**: `on()`, `once()`, `off()`, `broadcast()`, `broadcastForTopic()`\n * - **Request/Response**: `onRequest()`, `request()`, `requestForTopic()` for synchronous queries\n * - **Interceptors**: Transform event arguments before handlers receive them\n * - **Listeners**: Global event observers for logging/debugging\n *\n * @example Pub/Sub pattern\n * ```ts\n * const remover = eventbus.on('timeline-play', () => console.log('Playing'));\n * eventbus.broadcast('timeline-play', []);\n * remover(); // Unsubscribe\n * ```\n *\n * @example Request/Response pattern\n * ```ts\n * eventbus.onRequest('request-instance', (name) => new MyClass(name));\n * const instance = eventbus.request<MyClass>('request-instance', 'test');\n * ```\n */\nexport class Eventbus implements IEventbus {\n private eventHandlers = new Map<string, TEventHandler[]>();\n private eventInterceptors = new Map<string, IEventbusInterceptor[]>();\n private eventListeners: IEventbusListener[] = [];\n private requestResponders = new Map<string, TRequestResponder[]>();\n\n constructor() {\n this.clear();\n }\n\n /**\n * Clears all handlers, listeners, interceptors, and request responders.\n */\n clear() {\n this.eventHandlers = new Map<string, TEventHandler[]>();\n this.eventListeners = [];\n this.eventInterceptors = new Map<string, IEventbusInterceptor[]>();\n this.requestResponders = new Map<string, TRequestResponder[]>();\n }\n\n _getEventInterceptors(\n eventName: string,\n eventTopic?: string\n ): IEventbusInterceptor[] {\n if (eventTopic) {\n eventName = `${eventName}:${eventTopic}`;\n }\n if (!this.eventInterceptors.has(eventName)) {\n this.eventInterceptors.set(eventName, []);\n }\n return this.eventInterceptors.get(eventName) as IEventbusInterceptor[];\n }\n\n _getEventHandlers(eventName: string, eventTopic?: string): TEventHandler[] {\n if (eventTopic) {\n eventName = `${eventName}:${eventTopic}`;\n }\n if (!this.eventHandlers.has(eventName)) {\n this.eventHandlers.set(eventName, []);\n }\n return this.eventHandlers.get(eventName) as TEventHandler[];\n }\n\n on(\n eventName: string,\n eventHandler: TEventHandler,\n eventTopic?: string\n ): TEventbusRemover {\n this._getEventHandlers(eventName, eventTopic).push(eventHandler);\n return () => {\n this.off(eventName, eventHandler, eventTopic);\n };\n }\n\n once(\n eventName: string,\n eventHandler: TEventHandler,\n eventTopic?: string\n ): TEventbusRemover {\n const eventHandlerDecorator = (...args: any[]) => {\n eventHandler(...args);\n this.off(eventName, eventHandlerDecorator, eventTopic);\n };\n this.on(eventName, eventHandlerDecorator, eventTopic);\n return () => {\n this.off(eventName, eventHandlerDecorator, eventTopic);\n };\n }\n\n off(\n eventName: string,\n eventHandler: TEventHandler,\n eventTopic?: string\n ): void {\n const handlers = this._getEventHandlers(eventName, eventTopic);\n if (handlers) {\n const idx = handlers.indexOf(eventHandler);\n if (idx > -1) {\n handlers.splice(idx, 1);\n }\n }\n }\n\n broadcast(eventName: string, args: any[]): void {\n this._callHandlers(eventName, undefined, args);\n }\n\n broadcastForTopic(eventName: string, eventTopic: string, args: any[]): void {\n this._callHandlers(eventName, eventTopic, args);\n }\n\n registerEventlistener(eventbusListener: IEventbusListener): TEventbusRemover {\n this.eventListeners.push(eventbusListener);\n return () => {\n const index = this.eventListeners.indexOf(eventbusListener);\n if (index > -1) {\n this.eventListeners.splice(index, 1);\n }\n };\n }\n\n registerInterceptor(\n eventName: string,\n interceptor: IEventbusInterceptor,\n eventTopic?: string\n ): TEventbusRemover {\n const interceptors = this._getEventInterceptors(eventName, eventTopic);\n interceptors.push(interceptor);\n return () => {\n const index = interceptors.indexOf(interceptor);\n if (index > -1) {\n interceptors.splice(index, 1);\n }\n };\n }\n\n onRequest<T>(\n eventName: string,\n responder: TRequestResponder<T>,\n eventTopic?: string\n ): TEventbusRemover {\n const responders = this._getRequestResponders(eventName, eventTopic);\n responders.push(responder);\n return () => {\n const index = responders.indexOf(responder);\n if (index > -1) {\n responders.splice(index, 1);\n }\n };\n }\n\n request<T>(eventName: string, ...args: unknown[]): T | undefined {\n return this._callResponder<T>(eventName, undefined, args);\n }\n\n requestForTopic<T>(\n eventName: string,\n eventTopic: string,\n ...args: unknown[]\n ): T | undefined {\n return this._callResponder<T>(eventName, eventTopic, args);\n }\n\n private _getRequestResponders(\n eventName: string,\n eventTopic?: string\n ): TRequestResponder[] {\n if (eventTopic) {\n eventName = `${eventName}:${eventTopic}`;\n }\n if (!this.requestResponders.has(eventName)) {\n this.requestResponders.set(eventName, []);\n }\n return this.requestResponders.get(eventName) as TRequestResponder[];\n }\n\n private _callResponder<T>(\n eventName: string,\n eventTopic: string | undefined,\n args: unknown[]\n ): T | undefined {\n const responders = this._getRequestResponders(eventName, eventTopic);\n if (responders.length === 0) {\n return undefined;\n }\n // First responder wins\n return responders[0](...args) as T;\n }\n\n _callHandlers(\n eventName: string,\n eventTopic: string | undefined,\n args: any = []\n ): void {\n const handlers = this._getEventHandlers(eventName, eventTopic);\n\n if (handlers) {\n const interceptors = this._getEventInterceptors(eventName, eventTopic);\n\n interceptors.forEach(interceptor => {\n args = interceptor.intercept(args);\n });\n\n this.eventListeners.forEach((listener: IEventbusListener) => {\n listener.handleEvent(eventName, eventTopic, args);\n });\n\n if (args?.length) {\n handlers.forEach((handler: TEventHandler) => handler(...args));\n } else {\n handlers.forEach((handler: TEventHandler) => handler());\n }\n }\n }\n}\n","import type {IEventbus, IEventbusInterceptor} from '@eventbus/types.ts';\n\nexport class RequestVideoUriInterceptor implements IEventbusInterceptor {\n constructor(private eventbus: IEventbus) {}\n\n intercept(args: any[]): any[] {\n this.eventbus.broadcast('before-request-timeline-uri', args.slice() as any);\n return args;\n }\n}\n","export {ActionRegistryEventbusListener} from '@eventbus/actionregistry-eventbus-listener.ts';\nexport {Eventbus} from '@eventbus/eventbus.ts';\nexport * from '@eventbus/events/index.ts';\nexport type {IEventMetadata} from '@eventbus/events/metadata/types.ts';\nexport {RequestVideoUriInterceptor} from '@eventbus/request-video-uri-interceptor.ts';\nexport * from '@eventbus/types.ts';\n","/**\n * Position source state.\n * - `active`: Source is emitting position updates\n * - `suspended`: Source is paused, position preserved\n * - `inactive`: Source is stopped, position reset to initial state\n */\nexport type TSourceState = 'active' | 'suspended' | 'inactive';\n\n/**\n * Boundary type for position source events.\n * - `start`: Position reached the beginning (e.g., after reverse or loop)\n * - `end`: Position reached the end of duration\n */\nexport type TBoundary = 'start' | 'end';\n\n// ─────────────────────────────────────────────────────────────────────────────\n// IPositionSource\n// ─────────────────────────────────────────────────────────────────────────────\n\n/**\n * Core interface for timeline position sources.\n *\n * A position source provides the current position within a timeline and emits\n * position updates. The source of position can vary: elapsed time (RAF),\n * media playback (video), scroll position, mouse position, external data, etc.\n *\n * @example\n * ```typescript\n * // RAF-based position source\n * const source = new RafPositionSource(config);\n * await source.init();\n *\n * source.onPosition((position) => {\n * console.log(`Current position: ${position}`);\n * });\n *\n * source.onBoundaryReached((boundary) => {\n * if (boundary === 'end') console.log('Reached end');\n * });\n *\n * await source.activate();\n * ```\n */\nexport interface IPositionSource {\n // ───────────────────────────────────────────────────────────────────────────\n // STATE\n // ───────────────────────────────────────────────────────────────────────────\n\n /** Current state of the position source */\n readonly state: TSourceState;\n\n /**\n * Whether to loop when reaching the end boundary.\n *\n * When `true`, the source resets to position 0 and continues.\n * When `false`, the source emits `'end'` boundary and deactivates.\n *\n * For sources where looping is not applicable (e.g., mouse position),\n * this property has no effect.\n */\n loop: boolean;\n\n // ───────────────────────────────────────────────────────────────────────────\n // LIFECYCLE\n // ───────────────────────────────────────────────────────────────────────────\n\n /**\n * Initialize the position source.\n *\n * Performs any async setup required before the source can be activated.\n * For example: loading media, binding event listeners, establishing connections.\n *\n * @throws If initialization fails (e.g., media load error, connection refused)\n */\n init(): Promise<void>;\n\n /**\n * Destroy the position source and release all resources.\n *\n * After calling destroy, the source cannot be reused.\n * Removes event listeners, closes connections, clears timers.\n */\n destroy(): void;\n\n // ───────────────────────────────────────────────────────────────────────────\n // TRANSPORT\n // ───────────────────────────────────────────────────────────────────────────\n\n /**\n * Activate the position source to begin emitting position updates.\n *\n * Transitions state from `inactive` or `suspended` to `active`.\n *\n * @throws If activation fails (e.g., autoplay blocked, permission denied)\n */\n activate(): Promise<void>;\n\n /**\n * Suspend the position source, preserving current position.\n *\n * Transitions state from `active` to `suspended`.\n * Position updates stop but position is preserved for later resumption.\n */\n suspend(): void;\n\n /**\n * Deactivate the position source and reset to initial state.\n *\n * Transitions state to `inactive`.\n * Position is reset (typically to 0).\n */\n deactivate(): void;\n\n // ───────────────────────────────────────────────────────────────────────────\n // POSITION\n // ───────────────────────────────────────────────────────────────────────────\n\n /**\n * Get the current position.\n *\n * @returns Current position in seconds (or source-specific units)\n */\n getPosition(): number;\n\n /**\n * Get the total duration.\n *\n * @returns Duration in seconds (or source-specific units), or `Infinity` for unbounded sources\n */\n getDuration(): number;\n\n // ───────────────────────────────────────────────────────────────────────────\n // EVENTS\n // ───────────────────────────────────────────────────────────────────────────\n\n /**\n * Register a callback for position updates.\n *\n * Called whenever the position changes while the source is active.\n * Frequency depends on the source type (e.g., RAF tick, video timeupdate).\n *\n * @param callback - Function receiving the current position\n */\n onPosition(callback: (position: number) => void): void;\n\n /**\n * Register a callback for boundary events.\n *\n * Called when position reaches a boundary (start or end).\n * For looping sources, `'end'` is emitted before reset.\n *\n * @param callback - Function receiving the boundary type\n */\n onBoundaryReached(callback: (boundary: TBoundary) => void): void;\n\n /**\n * Register a callback for when the source becomes active.\n *\n * Called once each time the source transitions to the `active` state.\n * This is equivalent to \"first frame\" semantics - for RAF sources it's\n * the first tick, for video sources it's when playback actually starts.\n *\n * @param callback - Function called when source becomes active\n */\n onActivated(callback: () => void): void;\n}\n\n// ─────────────────────────────────────────────────────────────────────────────\n// ISeekable\n// ─────────────────────────────────────────────────────────────────────────────\n\n/**\n * Interface for position sources that support seeking to arbitrary positions.\n *\n * Not all position sources are seekable. For example:\n * - Seekable: RAF, video, scroll (programmatic), step-based\n * - Not seekable: mouse position, external WebSocket, live streams\n *\n * @example\n * ```typescript\n * if (isSeekable(source)) {\n * const actualPosition = await source.seek(30.5);\n * console.log(`Seeked to: ${actualPosition}`);\n * }\n * ```\n */\nexport interface ISeekable {\n /**\n * Seek to a specific position.\n *\n * @param position - Target position in seconds (or source-specific units)\n * @returns Actual position after seek (may differ from requested if clamped)\n */\n seek(position: number): Promise<number>;\n}\n\n/**\n * Type guard to check if a position source is seekable.\n *\n * @param source - Position source to check\n * @returns `true` if source implements ISeekable\n */\nexport function isSeekable(\n source: IPositionSource\n): source is IPositionSource & ISeekable {\n return 'seek' in source && typeof (source as ISeekable).seek === 'function';\n}\n\n// ─────────────────────────────────────────────────────────────────────────────\n// IPlaylist\n// ─────────────────────────────────────────────────────────────────────────────\n\n/**\n * Interface for managing a collection of timeline items.\n *\n * A playlist allows switching between multiple timeline configurations\n * (e.g., multiple videos, multiple animation sequences).\n *\n * @typeParam TItem - Type of playlist items (default: unknown)\n *\n * @example\n * ```typescript\n * playlist.onItemChange((item) => {\n * console.log(`Switched to: ${item.uri}`);\n * });\n *\n * playlist.selectItem('chapter-2');\n * ```\n */\nexport interface IPlaylist<TItem = unknown> {\n /** Currently active playlist item */\n readonly currentItem: TItem;\n\n /** All items in the playlist */\n readonly items: readonly TItem[];\n\n /**\n * Select a playlist item by identifier.\n *\n * @param identifier - Unique identifier for the item (e.g., URI, ID)\n * @throws If no item matches the identifier\n */\n selectItem(identifier: string): void;\n\n /**\n * Register a callback for item changes.\n *\n * Called whenever the current item changes via `selectItem()`.\n *\n * @param callback - Function receiving the new current item\n */\n onItemChange(callback: (item: TItem) => void): void;\n}\n\n// ─────────────────────────────────────────────────────────────────────────────\n// IContainerProvider\n// ─────────────────────────────────────────────────────────────────────────────\n\n/**\n * Interface for providing the DOM container where content is rendered.\n *\n * The container is where operations render their output (elements, animations, etc.).\n * For some sources (video), the container is intrinsic. For others (WebSocket),\n * the container is a separate concern configured independently.\n *\n * @example\n * ```typescript\n * containerProvider.onContainerReady(() => {\n * const $container = containerProvider.getContainer();\n * $container?.append('<div class=\"content\">Loaded!</div>');\n * });\n * ```\n */\nexport interface IContainerProvider {\n /**\n * Get the container element.\n *\n * @returns jQuery-wrapped container element, or `undefined` if not available\n */\n getContainer(): JQuery<HTMLElement> | undefined;\n\n /**\n * Register a callback for when the container is ready.\n *\n * Called once when the container becomes available and ready for content.\n * For video sources, this corresponds to the first frame.\n * For DOM containers, this is called after the element is found/created.\n *\n * @param callback - Function called when container is ready\n */\n onContainerReady(callback: () => void): void;\n}\n","import type {\n IPositionSource,\n TBoundary,\n TSourceState,\n} from '@timelineproviders/types.ts';\n\n/**\n * Abstract base class for position sources.\n *\n * Provides shared state management, lifecycle handling, and callback\n * registration for concrete position source implementations.\n *\n * Subclasses must implement:\n * - `doInit()` - Source-specific initialization\n * - `doDestroy()` - Source-specific cleanup\n * - `startTicking()` - Start emitting position updates\n * - `stopTicking()` - Stop emitting position updates\n *\n * @example\n * ```typescript\n * class MyPositionSource extends BasePositionSource {\n * protected doInit(): Promise<void> {\n * // Initialize resources\n * return Promise.resolve();\n * }\n *\n * protected doDestroy(): void {\n * // Clean up resources\n * }\n *\n * protected startTicking(): void {\n * // Start position updates\n * }\n *\n * protected stopTicking(): void {\n * // Stop position updates\n * }\n * }\n * ```\n */\nexport abstract class BasePositionSource implements IPositionSource {\n // ─────────────────────────────────────────────────────────────────────────\n // State\n // ─────────────────────────────────────────────────────────────────────────\n\n private _state: TSourceState = 'inactive';\n private _position = 0;\n private readonly _duration: number;\n private _loop = false;\n\n // ─────────────────────────────────────────────────────────────────────────\n // Callbacks\n // ─────────────────────────────────────────────────────────────────────────\n\n private readonly _positionCallbacks: Array<(position: number) => void> = [];\n private readonly _boundaryCallbacks: Array<(boundary: TBoundary) => void> =\n [];\n private readonly _activatedCallbacks: Array<() => void> = [];\n\n // ─────────────────────────────────────────────────────────────────────────\n // Constructor\n // ─────────────────────────────────────────────────────────────────────────\n\n /**\n * Create a new position source.\n *\n * @param duration - Total duration in seconds (or `Infinity` for unbounded)\n */\n constructor(duration: number) {\n this._duration = duration;\n }\n\n // ─────────────────────────────────────────────────────────────────────────\n // IPositionSource - State\n // ─────────────────────────────────────────────────────────────────────────\n\n get state(): TSourceState {\n return this._state;\n }\n\n get loop(): boolean {\n return this._loop;\n }\n\n set loop(value: boolean) {\n this._loop = value;\n }\n\n // ─────────────────────────────────────────────────────────────────────────\n // IPositionSource - Lifecycle\n // ─────────────────────────────────────────────────────────────────────────\n\n async init(): Promise<void> {\n await this.doInit();\n }\n\n destroy(): void {\n if (this._state === 'active') {\n this.stopTicking();\n }\n this._state = 'inactive';\n this._position = 0;\n this.doDestroy();\n }\n\n // ─────────────────────────────────────────────────────────────────────────\n // IPositionSource - Transport\n // ─────────────────────────────────────────────────────────────────────────\n\n async activate(): Promise<void> {\n if (this._state === 'active') {\n // Already active, no-op\n return;\n }\n\n this._state = 'active';\n this.startTicking();\n\n // Emit activated callbacks (first frame semantics)\n for (const callback of this._activatedCallbacks) {\n callback();\n }\n }\n\n suspend(): void {\n if (this._state !== 'active') {\n // Can only suspend from active state\n return;\n }\n\n this._state = 'suspended';\n this.stopTicking();\n // Position is preserved\n }\n\n deactivate(): void {\n if (this._state === 'inactive') {\n // Already inactive, no-op\n return;\n }\n\n if (this._state === 'active') {\n this.stopTicking();\n }\n\n this._state = 'inactive';\n this._position = 0;\n }\n\n // ─────────────────────────────────────────────────────────────────────────\n // IPositionSource - Position\n // ─────────────────────────────────────────────────────────────────────────\n\n getPosition(): number {\n return this._position;\n }\n\n getDuration(): number {\n return this._duration;\n }\n\n // ─────────────────────────────────────────────────────────────────────────\n // IPositionSource - Events\n // ─────────────────────────────────────────────────────────────────────────\n\n onPosition(callback: (position: number) => void): void {\n this._positionCallbacks.push(callback);\n }\n\n onBoundaryReached(callback: (boundary: TBoundary) => void): void {\n this._boundaryCallbacks.push(callback);\n }\n\n onActivated(callback: () => void): void {\n this._activatedCallbacks.push(callback);\n }\n\n // ─────────────────────────────────────────────────────────────────────────\n // Protected - For Subclasses\n // ─────────────────────────────────────────────────────────────────────────\n\n /**\n * Set the current position and emit to callbacks.\n *\n * Only emits if the source is active.\n *\n * @param position - New position value\n */\n protected setPosition(position: number): void {\n this._position = position;\n if (this._state === 'active') {\n for (const callback of this._positionCallbacks) {\n callback(position);\n }\n }\n }\n\n /**\n * Emit a boundary event to all registered callbacks.\n *\n * @param boundary - The boundary type ('start' or 'end')\n */\n protected emitBoundary(boundary: TBoundary): void {\n for (const callback of this._boundaryCallbacks) {\n callback(boundary);\n }\n }\n\n // ─────────────────────────────────────────────────────────────────────────\n // Abstract - Must Implement\n // ─────────────────────────────────────────────────────────────────────────\n\n /**\n * Perform source-specific initialization.\n *\n * Called by `init()`. Override to load resources, bind listeners, etc.\n */\n protected abstract doInit(): Promise<void>;\n\n /**\n * Perform source-specific cleanup.\n *\n * Called by `destroy()`. Override to release resources, unbind listeners, etc.\n */\n protected abstract doDestroy(): void;\n\n /**\n * Start emitting position updates.\n *\n * Called when transitioning to `active` state.\n * Override to start timers, begin listening to events, etc.\n */\n protected abstract startTicking(): void;\n\n /**\n * Stop emitting position updates.\n *\n * Called when transitioning from `active` to `suspended` or `inactive`.\n * Override to stop timers, pause listening, etc.\n */\n protected abstract stopTicking(): void;\n}\n","import {BasePositionSource} from '@timelineproviders/position-sources/base-position-source.ts';\nimport type {ISeekable} from '@timelineproviders/types.ts';\nimport hk from 'hotkeys-js';\nimport {v4 as uuidv4} from 'uuid';\n\n// Handle both ESM and CommonJS imports\nconst hotkeys = hk.default || hk;\n\n/**\n * Vertical axis mode for keyboard navigation.\n *\n * - `timeline-switch`: Up/Down arrows emit timeline change requests\n * - `chapter-navigation`: Up/Down arrows jump between markers\n * - `disabled`: Up/Down arrows do nothing\n */\nexport type TVerticalMode =\n | 'timeline-switch'\n | 'chapter-navigation'\n | 'disabled';\n\n/**\n * Configuration for KeyboardStepSource.\n */\nexport interface KeyboardStepSourceConfig {\n /**\n * Total duration in seconds.\n */\n duration: number;\n\n /**\n * Vertical axis behavior.\n */\n verticalMode: TVerticalMode;\n\n /**\n * Step size for Left/Right arrows in seconds.\n * @default 1\n */\n stepSize?: number;\n\n /**\n * Large step size for Shift+Left/Right arrows in seconds.\n * @default 10\n */\n largeStepSize?: number;\n\n /**\n * Marker positions for chapter navigation mode (in seconds).\n * Will be auto-sorted ascending on init.\n */\n markers?: number[];\n\n /**\n * Target element to scope keyboard bindings.\n * Can be an HTMLElement or a CSS selector string.\n * If not provided, bindings are global (document).\n */\n targetElement?: HTMLElement | string;\n\n /**\n * Whether navigation wraps at boundaries.\n * @default true\n */\n wrapNavigation?: boolean;\n}\n\n/**\n * Key bindings used by KeyboardStepSource.\n */\nconst KEY_BINDINGS = {\n stepForward: 'right',\n stepBackward: 'left',\n largeStepForward: 'shift+right',\n largeStepBackward: 'shift+left',\n jumpToStart: 'home',\n jumpToEnd: 'end',\n verticalPrev: 'up',\n verticalNext: 'down',\n} as const;\n\n/**\n * Keyboard-based position source for stepping through a timeline.\n *\n * Supports:\n * - Left/Right arrows: step by `stepSize` (default 1s)\n * - Shift+Left/Right: large step by `largeStepSize` (default 10s)\n * - Home/End: jump to start/end\n * - Up/Down: configurable (timeline switch, chapter navigation, or disabled)\n *\n * @example\n * ```typescript\n * const source = new KeyboardStepSource({\n * duration: 60,\n * verticalMode: 'chapter-navigation',\n * markers: [0, 10, 20, 30, 40, 50],\n * });\n *\n * await source.init();\n *\n * source.onPosition((position) => {\n * console.log(`Position: ${position}s`);\n * });\n *\n * source.onMarkerJump((index, position) => {\n * console.log(`Jumped to marker ${index} at ${position}s`);\n * });\n *\n * await source.activate();\n * ```\n */\nexport class KeyboardStepSource\n extends BasePositionSource\n implements ISeekable\n{\n // ─────────────────────────────────────────────────────────────────────────\n // Configuration\n // ─────────────────────────────────────────────────────────────────────────\n\n private readonly _stepSize: number;\n private readonly _largeStepSize: number;\n private readonly _verticalMode: TVerticalMode;\n private readonly _wrapNavigation: boolean;\n private _markers: number[];\n private readonly _targetElementConfig?: HTMLElement | string;\n private _targetElement?: HTMLElement;\n private readonly _scopeId: string;\n\n // ─────────────────────────────────────────────────────────────────────────\n // Callbacks\n // ─────────────────────────────────────────────────────────────────────────\n\n private readonly _timelineChangeCallbacks: Array<\n (direction: 'prev' | 'next') => void\n > = [];\n private readonly _markerJumpCallbacks: Array<\n (markerIndex: number, position: number) => void\n > = [];\n\n // ─────────────────────────────────────────────────────────────────────────\n // Constructor\n // ─────────────────────────────────────────────────────────────────────────\n\n /**\n * Create a new keyboard-based position source.\n *\n * @param config - Configuration options\n */\n constructor(config: KeyboardStepSourceConfig) {\n super(config.duration);\n this._stepSize = config.stepSize ?? 1;\n this._largeStepSize = config.largeStepSize ?? 10;\n this._verticalMode = config.verticalMode;\n this._wrapNavigation = config.wrapNavigation ?? true;\n this._markers = config.markers ? [...config.markers] : [];\n this._targetElementConfig = config.targetElement;\n this._scopeId = `keyboard-step-source-${uuidv4()}`;\n }\n\n // ─────────────────────────────────────────────────────────────────────────\n // BasePositionSource Implementation\n // ─────────────────────────────────────────────────────────────────────────\n\n protected doInit(): Promise<void> {\n // Sort markers ascending\n this._markers.sort((a, b) => a - b);\n\n // Resolve target element if string selector provided\n if (typeof this._targetElementConfig === 'string') {\n const element = document.querySelector(this._targetElementConfig);\n if (element instanceof HTMLElement) {\n this._targetElement = element;\n }\n } else if (this._targetElementConfig instanceof HTMLElement) {\n this._targetElement = this._targetElementConfig;\n }\n\n return Promise.resolve();\n }\n\n protected doDestroy(): void {\n this._unbindKeys();\n }\n\n protected startTicking(): void {\n this._bindKeys();\n }\n\n protected stopTicking(): void {\n this._unbindKeys();\n }\n\n // ─────────────────────────────────────────────────────────────────────────\n // ISeekable Implementation\n // ─────────────────────────────────────────────────────────────────────────\n\n /**\n * Seek to a specific position.\n *\n * Position is clamped to the valid range [0, duration].\n *\n * @param position - Target position in seconds\n * @returns Actual position after seek (may be clamped)\n */\n async seek(position: number): Promise<number> {\n const clampedPosition = Math.max(0, Math.min(position, this.getDuration()));\n this.setPosition(clampedPosition);\n return clampedPosition;\n }\n\n // ─────────────────────────────────────────────────────────────────────────\n // Additional Callbacks\n // ─────────────────────────────────────────────────────────────────────────\n\n /**\n * Register callback for timeline change requests (timeline-switch mode).\n *\n * @param callback - Called with 'prev' or 'next' when Up/Down is pressed\n */\n onTimelineChangeRequest(\n callback: (direction: 'prev' | 'next') => void\n ): void {\n this._timelineChangeCallbacks.push(callback);\n }\n\n /**\n * Register callback for marker jumps (chapter-navigation mode).\n *\n * @param callback - Called with marker index and position when jumping\n */\n onMarkerJump(\n callback: (markerIndex: number, position: number) => void\n ): void {\n this._markerJumpCallbacks.push(callback);\n }\n\n // ─────────────────────────────────────────────────────────────────────────\n // Private Methods - Key Binding\n // ─────────────────────────────────────────────────────────────────────────\n\n /**\n * Bind all keyboard handlers.\n */\n private _bindKeys(): void {\n const options: {scope: string; element?: HTMLElement} = {\n scope: this._scopeId,\n };\n if (this._targetElement) {\n options.element = this._targetElement;\n }\n\n // Set the scope as active so handlers trigger\n hotkeys.setScope(this._scopeId);\n\n // Horizontal navigation\n hotkeys(KEY_BINDINGS.stepForward, options, event => {\n event.preventDefault();\n this._handleStepForward();\n });\n\n hotkeys(KEY_BINDINGS.stepBackward, options, event => {\n event.preventDefault();\n this._handleStepBackward();\n });\n\n hotkeys(KEY_BINDINGS.largeStepForward, options, event => {\n event.preventDefault();\n this._handleLargeStepForward();\n });\n\n hotkeys(KEY_BINDINGS.largeStepBackward, options, event => {\n event.preventDefault();\n this._handleLargeStepBackward();\n });\n\n // Jump to start/end\n hotkeys(KEY_BINDINGS.jumpToStart, options, event => {\n event.preventDefault();\n this._handleJumpToStart();\n });\n\n hotkeys(KEY_BINDINGS.jumpToEnd, options, event => {\n event.preventDefault();\n this._handleJumpToEnd();\n });\n\n // Vertical navigation (only if mode is not disabled)\n if (this._verticalMode !== 'disabled') {\n hotkeys(KEY_BINDINGS.verticalPrev, options, event => {\n event.preventDefault();\n this._handleVerticalPrev();\n });\n\n hotkeys(KEY_BINDINGS.verticalNext, options, event => {\n event.preventDefault();\n this._handleVerticalNext();\n });\n }\n }\n\n /**\n * Unbind all keyboard handlers.\n */\n private _unbindKeys(): void {\n // Delete the scope which removes all handlers bound to it\n hotkeys.deleteScope(this._scopeId);\n }\n\n // ─────────────────────────────────────────────────────────────────────────\n // Private Methods - Navigation Handlers\n // ─────────────────────────────────────────────────────────────────────────\n\n private _handleStepForward(): void {\n const currentPosition = this.getPosition();\n const duration = this.getDuration();\n let newPosition = currentPosition + this._stepSize;\n\n if (newPosition > duration) {\n if (this._wrapNavigation) {\n newPosition = 0;\n this.setPosition(newPosition);\n this.emitBoundary('start');\n }\n // If clamping, do nothing (already at end)\n } else {\n this.setPosition(newPosition);\n }\n }\n\n private _handleStepBackward(): void {\n const currentPosition = this.getPosition();\n const duration = this.getDuration();\n let newPosition = currentPosition - this._stepSize;\n\n if (newPosition < 0) {\n if (this._wrapNavigation) {\n newPosition = duration;\n this.setPosition(newPosition);\n this.emitBoundary('end');\n }\n // If clamping, do nothing (already at start)\n } else {\n this.setPosition(newPosition);\n }\n }\n\n private _handleLargeStepForward(): void {\n const currentPosition = this.getPosition();\n const duration = this.getDuration();\n let newPosition = currentPosition + this._largeStepSize;\n\n if (newPosition > duration) {\n if (this._wrapNavigation) {\n newPosition = 0;\n this.setPosition(newPosition);\n this.emitBoundary('start');\n } else {\n newPosition = duration;\n this.setPosition(newPosition);\n }\n } else {\n this.setPosition(newPosition);\n }\n }\n\n private _handleLargeStepBackward(): void {\n const currentPosition = this.getPosition();\n const duration = this.getDuration();\n let newPosition = currentPosition - this._largeStepSize;\n\n if (newPosition < 0) {\n if (this._wrapNavigation) {\n newPosition = duration;\n this.setPosition(newPosition);\n this.emitBoundary('end');\n } else {\n newPosition = 0;\n this.setPosition(newPosition);\n }\n } else {\n this.setPosition(newPosition);\n }\n }\n\n private _handleJumpToStart(): void {\n this.setPosition(0);\n this.emitBoundary('start');\n }\n\n private _handleJumpToEnd(): void {\n this.setPosition(this.getDuration());\n this.emitBoundary('end');\n }\n\n private _handleVerticalPrev(): void {\n if (this._verticalMode === 'timeline-switch') {\n this._emitTimelineChange('prev');\n } else if (this._verticalMode === 'chapter-navigation') {\n this._jumpToPreviousMarker();\n }\n }\n\n private _handleVerticalNext(): void {\n if (this._verticalMode === 'timeline-switch') {\n this._emitTimelineChange('next');\n } else if (this._verticalMode === 'chapter-navigation') {\n this._jumpToNextMarker();\n }\n }\n\n // ─────────────────────────────────────────────────────────────────────────\n // Private Methods - Timeline Switch\n // ─────────────────────────────────────────────────────────────────────────\n\n private _emitTimelineChange(direction: 'prev' | 'next'): void {\n for (const callback of this._timelineChangeCallbacks) {\n callback(direction);\n }\n }\n\n // ─────────────────────────────────────────────────────────────────────────\n // Private Methods - Chapter Navigation\n // ─────────────────────────────────────────────────────────────────────────\n\n private _jumpToPreviousMarker(): void {\n if (this._markers.length === 0) return;\n\n const currentPosition = this.getPosition();\n const currentMarkerIndex = this._findCurrentMarkerIndex(currentPosition);\n\n let targetIndex: number;\n\n // Check if we're exactly on a marker or between markers\n const exactlyOnMarker =\n this._markers[currentMarkerIndex] === currentPosition;\n\n if (exactlyOnMarker) {\n // Exactly on a marker - go to previous marker\n if (currentMarkerIndex <= 0) {\n if (this._wrapNavigation) {\n targetIndex = this._markers.length - 1;\n } else {\n return; // Already at first marker\n }\n } else {\n targetIndex = currentMarkerIndex - 1;\n }\n } else {\n // Between markers - go to the start of current section (marker at currentMarkerIndex)\n targetIndex = currentMarkerIndex;\n }\n\n const targetPosition = this._markers[targetIndex];\n this.setPosition(targetPosition);\n this._emitMarkerJump(targetIndex, targetPosition);\n }\n\n private _jumpToNextMarker(): void {\n if (this._markers.length === 0) return;\n\n const currentPosition = this.getPosition();\n const currentMarkerIndex = this._findCurrentMarkerIndex(currentPosition);\n\n let targetIndex: number;\n\n if (currentMarkerIndex >= this._markers.length - 1) {\n // At or after last marker\n if (this._wrapNavigation) {\n targetIndex = 0;\n } else {\n // Already at last marker, do nothing\n return;\n }\n } else {\n targetIndex = currentMarkerIndex + 1;\n }\n\n const targetPosition = this._markers[targetIndex];\n this.setPosition(targetPosition);\n this._emitMarkerJump(targetIndex, targetPosition);\n }\n\n /**\n * Find the index of the current or previous marker.\n *\n * If position matches a marker exactly, returns that marker's index.\n * Otherwise, returns the index of the marker before the current position.\n * Returns 0 if before first marker.\n */\n private _findCurrentMarkerIndex(position: number): number {\n if (this._markers.length === 0) return -1;\n\n for (let i = this._markers.length - 1; i >= 0; i--) {\n if (position >= this._markers[i]) {\n return i;\n }\n }\n\n return 0;\n }\n\n private _emitMarkerJump(markerIndex: number, position: number): void {\n for (const callback of this._markerJumpCallbacks) {\n callback(markerIndex, position);\n }\n }\n}\n","// https://gist.github.com/jakearchibald/cb03f15670817001b1157e62a076fe95\nexport function animationInterval(\n ms: number,\n signal: AbortSignal,\n callback: (time: number) => void\n) {\n // Prefer currentTime, as it'll better sync animations queued in the\n // same frame, but if it isn't supported, performance.now() is fine.\n const currentTime = document?.timeline?.currentTime;\n const start = currentTime ? Number(currentTime) : performance.now();\n\n const frame = (time: number) => {\n if (signal.aborted) return;\n callback(time);\n scheduleFrame(time);\n };\n\n const {round} = Math;\n const scheduleFrame = (time: number) => {\n const elapsed = time - start;\n const roundedElapsed = round(elapsed / ms) * ms;\n const targetNext = start + roundedElapsed + ms;\n const delay = targetNext - performance.now();\n setTimeout(() => requestAnimationFrame(frame), delay);\n };\n\n scheduleFrame(start);\n}\n","import {BasePositionSource} from '@timelineproviders/position-sources/base-position-source.ts';\nimport type {ISeekable} from '@timelineproviders/types.ts';\nimport {animationInterval} from '@util/animation-interval.ts';\n\n/**\n * Configuration for RafPositionSource.\n */\nexport interface RafPositionSourceConfig {\n /**\n * Total duration in seconds.\n */\n duration: number;\n\n /**\n * Interval between position ticks in milliseconds.\n * @default 1000 (1 second)\n */\n tickInterval?: number;\n}\n\n/**\n * RequestAnimationFrame-based position source.\n *\n * Uses the `animationInterval` utility to emit position updates at a regular\n * interval (default: 1 second). Position increments by 1 per second, making\n * position values equivalent to elapsed seconds.\n *\n * Implements both `IPositionSource` (via `BasePositionSource`) and `ISeekable`.\n *\n * @example\n * ```typescript\n * const source = new RafPositionSource({ duration: 60 });\n * await source.init();\n *\n * source.onPosition((position) => {\n * console.log(`Position: ${position}s`);\n * });\n *\n * source.onBoundaryReached((boundary) => {\n * if (boundary === 'end') {\n * console.log('Timeline complete');\n * }\n * });\n *\n * await source.activate();\n *\n * // Seek to 30 seconds\n * await source.seek(30);\n * ```\n */\nexport class RafPositionSource extends BasePositionSource implements ISeekable {\n // ─────────────────────────────────────────────────────────────────────────\n // State\n // ─────────────────────────────────────────────────────────────────────────\n\n private readonly _tickInterval: number;\n private _abortController: AbortController | null = null;\n private _startTimeOffset = 0;\n\n // ─────────────────────────────────────────────────────────────────────────\n // Constructor\n // ─────────────────────────────────────────────────────────────────────────\n\n /**\n * Create a new RAF-based position source.\n *\n * @param config - Configuration options\n */\n constructor(config: RafPositionSourceConfig) {\n super(config.duration);\n this._tickInterval = config.tickInterval ?? 1000;\n }\n\n // ─────────────────────────────────────────────────────────────────────────\n // BasePositionSource Implementation\n // ─────────────────────────────────────────────────────────────────────────\n\n protected doInit(): Promise<void> {\n // RAF-based source requires no async initialization\n return Promise.resolve();\n }\n\n protected doDestroy(): void {\n this._abortTicking();\n }\n\n protected startTicking(): void {\n // Emit initial position immediately\n this.setPosition(this.getPosition());\n\n // Create new abort controller for this ticking session\n this._abortController = new AbortController();\n\n // Start the animation interval\n animationInterval(\n this._tickInterval,\n this._abortController.signal,\n this._onTick.bind(this)\n );\n }\n\n protected stopTicking(): void {\n this._abortTicking();\n }\n\n // ─────────────────────────────────────────────────────────────────────────\n // ISeekable Implementation\n // ─────────────────────────────────────────────────────────────────────────\n\n /**\n * Seek to a specific position.\n *\n * Position is clamped to the valid range [0, duration].\n *\n * @param position - Target position in seconds\n * @returns Actual position after seek (may be clamped)\n */\n async seek(position: number): Promise<number> {\n // Clamp position to valid range\n const clampedPosition = Math.max(0, Math.min(position, this.getDuration()));\n\n // Update position (setPosition will emit callback if active)\n this.setPosition(clampedPosition);\n\n return clampedPosition;\n }\n\n // ─────────────────────────────────────────────────────────────────────────\n // Private Methods\n // ─────────────────────────────────────────────────────────────────────────\n\n /**\n * Handle a tick from animationInterval.\n *\n * The time parameter represents elapsed milliseconds since the animation\n * interval started. Position is calculated in seconds, rounded to the\n * precision determined by tickInterval.\n *\n * @param time - Elapsed time in milliseconds from animationInterval\n */\n private _onTick(time: number): void {\n // Skip if not active (safety check)\n if (this.state !== 'active') {\n return;\n }\n\n // Calculate new position based on elapsed time since start/reset\n // First, floor to the nearest tick boundary in milliseconds\n // Then convert to seconds for the position value\n const elapsedSinceStart = time - this._startTimeOffset;\n const ticksElapsed = Math.floor(elapsedSinceStart / this._tickInterval);\n const newPosition = (ticksElapsed * this._tickInterval) / 1000;\n const duration = this.getDuration();\n\n // Check if we've reached or exceeded the end\n if (newPosition >= duration) {\n // Emit end boundary\n this.emitBoundary('end');\n\n if (this.loop) {\n // Update offset to current time for next loop iteration\n this._startTimeOffset = time;\n // Reset to start and emit start boundary\n this.setPosition(0);\n this.emitBoundary('start');\n } else {\n // Set position to duration and deactivate\n this.setPosition(duration);\n this.deactivate();\n }\n } else {\n // Normal position update\n this.setPosition(newPosition);\n }\n }\n\n /**\n * Abort the current ticking session.\n */\n private _abortTicking(): void {\n if (this._abortController) {\n this._abortController.abort();\n this._abortController = null;\n }\n }\n}\n","import {BasePositionSource} from '@timelineproviders/position-sources/base-position-source.ts';\nimport type {ISeekable} from '@timelineproviders/types.ts';\nimport $ from 'jquery';\n\n/**\n * Configuration for ScrollPositionSource.\n */\nexport interface ScrollPositionSourceConfig {\n /**\n * CSS selector for the scrollable container element.\n */\n selector: string;\n\n /**\n * Duration in seconds that the scroll represents.\n * Position is calculated as: (scrollTop / scrollableHeight) * duration\n */\n duration: number;\n}\n\n/**\n * Scroll-based position source.\n *\n * Maps scroll position to a timeline position. The position is calculated\n * as a percentage of the scroll progress multiplied by the configured duration.\n *\n * Implements `IPositionSource` and `ISeekable`.\n *\n * @example\n * ```typescript\n * const source = new ScrollPositionSource({\n * selector: '#scroll-container',\n * duration: 100, // 100 seconds timeline\n * });\n *\n * await source.init();\n *\n * source.onPosition((position) => {\n * console.log(`Scroll at ${position}s of 100s`);\n * });\n *\n * source.onBoundaryReached((boundary) => {\n * if (boundary === 'end') {\n * console.log('Scrolled to bottom');\n * }\n * });\n *\n * await source.activate();\n * ```\n */\nexport class ScrollPositionSource\n extends BasePositionSource\n implements ISeekable\n{\n // ─────────────────────────────────────────────────────────────────────────\n // State\n // ─────────────────────────────────────────────────────────────────────────\n\n private readonly _config: ScrollPositionSourceConfig;\n private _element: HTMLElement | null = null;\n private _boundScrollHandler: ((event: Event) => void) | null = null;\n private _lastPosition = 0;\n private _wasAtStart = true;\n\n // ─────────────────────────────────────────────────────────────────────────\n // Constructor\n // ─────────────────────────────────────────────────────────────────────────\n\n /**\n * Create a new scroll-based position source.\n *\n * @param config - Configuration options\n */\n constructor(config: ScrollPositionSourceConfig) {\n super(config.duration);\n this._config = config;\n }\n\n // ─────────────────────────────────────────────────────────────────────────\n // BasePositionSource Implementation\n // ─────────────────────────────────────────────────────────────────────────\n\n protected doInit(): Promise<void> {\n return new Promise<void>((resolve, reject) => {\n const $element = $(this._config.selector);\n\n if ($element.length === 0) {\n reject(new Error(`Element not found: ${this._config.selector}`));\n return;\n }\n\n this._element = $element.get(0) as HTMLElement;\n resolve();\n });\n }\n\n protected doDestroy(): void {\n if (this._element && this._boundScrollHandler) {\n this._element.removeEventListener('scroll', this._boundScrollHandler, {\n passive: true,\n } as EventListenerOptions);\n this._boundScrollHandler = null;\n }\n this._element = null;\n }\n\n protected startTicking(): void {\n if (!this._element) {\n return;\n }\n\n this._boundScrollHandler = this._handleScroll.bind(this);\n this._element.addEventListener('scroll', this._boundScrollHandler, {\n passive: true,\n });\n }\n\n protected stopTicking(): void {\n if (this._element && this._boundScrollHandler) {\n this._element.removeEventListener('scroll', this._boundScrollHandler, {\n passive: true,\n } as EventListenerOptions);\n this._boundScrollHandler = null;\n }\n }\n\n // ─────────────────────────────────────────────────────────────────────────\n // ISeekable Implementation\n // ─────────────────────────────────────────────────────────────────────────\n\n /**\n * Seek to a specific position by programmatically scrolling.\n *\n * @param position - Target position in seconds (0 to duration)\n * @returns Actual position after scroll\n */\n async seek(position: number): Promise<number> {\n if (!this._element || this.state === 'inactive') {\n return this.getPosition();\n }\n\n const scrollableHeight = this._getScrollableHeight();\n const targetScrollTop =\n (position / this._config.duration) * scrollableHeight;\n\n this._element.scrollTo({\n top: targetScrollTop,\n behavior: 'smooth',\n });\n\n // Return the calculated position (actual may differ slightly due to smooth scrolling)\n return position;\n }\n\n // ─────────────────────────────────────────────────────────────────────────\n // Private Methods\n // ─────────────────────────────────────────────────────────────────────────\n\n /**\n * Handle scroll events and update position.\n */\n private _handleScroll(_event: Event): void {\n if (this.state !== 'active' || !this._element) {\n return;\n }\n\n const position = this._calculatePosition();\n const duration = this._config.duration;\n\n // Store last position for boundary detection\n const previousPosition = this._lastPosition;\n this._lastPosition = position;\n\n // Update position\n this.setPosition(position);\n\n // Check for end boundary\n if (position >= duration && previousPosition < duration) {\n this.emitBoundary('end');\n\n if (this.loop) {\n // Reset to start\n this._element.scrollTo({\n top: 0,\n behavior: 'smooth',\n });\n }\n }\n\n // Check for start boundary (only if we were not already at start)\n if (position === 0 && previousPosition > 0 && !this._wasAtStart) {\n this.emitBoundary('start');\n }\n\n this._wasAtStart = position === 0;\n }\n\n /**\n * Calculate position from scroll percentage.\n */\n private _calculatePosition(): number {\n if (!this._element) {\n return 0;\n }\n\n const scrollTop = this._element.scrollTop;\n const scrollableHeight = this._getScrollableHeight();\n\n if (scrollableHeight <= 0) {\n return 0;\n }\n\n const scrollPercentage = scrollTop / scrollableHeight;\n return scrollPercentage * this._config.duration;\n }\n\n /**\n * Get the scrollable height (total scroll distance).\n */\n private _getScrollableHeight(): number {\n if (!this._element) {\n return 0;\n }\n\n return this._element.scrollHeight - this._element.clientHeight;\n }\n}\n","import {BasePositionSource} from '@timelineproviders/position-sources/base-position-source.ts';\nimport type {IContainerProvider, ISeekable} from '@timelineproviders/types.ts';\nimport $ from 'jquery';\nimport vjs from 'video.js';\n\nconst videojs = vjs.default ?? vjs;\n\n/**\n * Video source configuration for VideoPositionSource.\n */\nexport interface VideoSource {\n /**\n * URL of the video file.\n */\n src: string;\n\n /**\n * MIME type of the video (e.g., 'video/mp4').\n */\n type: string;\n}\n\n/**\n * Configuration for VideoPositionSource.\n */\nexport interface VideoPositionSourceConfig {\n /**\n * CSS selector for the container where the video player will be created.\n */\n selector: string;\n\n /**\n * Video sources to load.\n */\n sources: VideoSource[];\n\n /**\n * Optional video.js player options.\n */\n options?: Record<string, unknown>;\n}\n\n/**\n * Video.js-based position source.\n *\n * Wraps a video.js player to provide position updates based on video playback.\n * Implements `IPositionSource`, `ISeekable`, and `IContainerProvider`.\n *\n * @example\n * ```typescript\n * const source = new VideoPositionSource({\n * selector: '#video-container',\n * sources: [\n * { src: 'video.mp4', type: 'video/mp4' },\n * { src: 'video.webm', type: 'video/webm' },\n * ],\n * });\n *\n * await source.init();\n *\n * source.onPosition((position) => {\n * console.log(`Video at ${position}s`);\n * });\n *\n * source.onContainerReady(() => {\n * console.log('Video ready for display');\n * });\n *\n * await source.activate();\n * ```\n */\nexport class VideoPositionSource\n extends BasePositionSource\n implements ISeekable, IContainerProvider\n{\n // ─────────────────────────────────────────────────────────────────────────\n // State\n // ─────────────────────────────────────────────────────────────────────────\n\n private readonly _config: VideoPositionSourceConfig;\n private _player: ReturnType<typeof videojs> | null = null;\n private _videoElementId: string;\n private readonly _containerReadyCallbacks: Array<() => void> = [];\n private readonly _eventHandlers: Array<() => void> = [];\n\n // ─────────────────────────────────────────────────────────────────────────\n // Constructor\n // ─────────────────────────────────────────────────────────────────────────\n\n /**\n * Create a new video.js-based position source.\n *\n * @param config - Configuration options\n */\n constructor(config: VideoPositionSourceConfig) {\n // Duration starts at 0 and will be updated from video\n super(0);\n this._config = config;\n this._videoElementId = `video-${crypto.randomUUID?.() ?? Math.random().toString(36).slice(2)}`;\n }\n\n // ─────────────────────────────────────────────────────────────────────────\n // BasePositionSource Implementation\n // ─────────────────────────────────────────────────────────────────────────\n\n protected doInit(): Promise<void> {\n return new Promise<void>(resolve => {\n // Create video element in container\n this._createVideoElement();\n\n // Initialize video.js player\n setTimeout(() => {\n this._player = videojs(\n this._videoElementId,\n {\n controls: false,\n controlBar: false,\n liveui: false,\n autoplay: false,\n preload: 'auto',\n loop: this.loop,\n sources: this._config.sources,\n ...this._config.options,\n },\n () => {\n // Player ready callback\n if (this._player) {\n // Register event handlers\n this._addPlayerListener(\n 'timeupdate',\n this._handleTimeUpdate.bind(this)\n );\n this._addPlayerListener('ended', this._handleEnded.bind(this));\n\n // Register one-time handlers\n this._player.one('firstplay', () => {\n this._notifyContainerReady();\n });\n\n this._player.one('canplay', () => {\n resolve();\n });\n\n this._player.load();\n }\n }\n );\n }, 0);\n });\n }\n\n protected doDestroy(): void {\n // Remove all event listeners\n for (const removeHandler of this._eventHandlers) {\n removeHandler();\n }\n this._eventHandlers.length = 0;\n\n // Dispose of player\n if (this._player) {\n this._player.dispose?.();\n this._player = null;\n }\n\n // Remove video element\n $(`#${this._videoElementId}`).remove();\n }\n\n protected startTicking(): void {\n // Video.js handles ticking via timeupdate event\n // Just start playback\n this._player?.play();\n }\n\n protected stopTicking(): void {\n // Pause the video\n this._player?.pause();\n }\n\n // ─────────────────────────────────────────────────────────────────────────\n // ISeekable Implementation\n // ─────────────────────────────────────────────────────────────────────────\n\n /**\n * Seek to a specific position in the video.\n *\n * @param position - Target position in seconds\n * @returns Actual position after seek\n */\n async seek(position: number): Promise<number> {\n if (!this._player) {\n return this.getPosition();\n }\n\n return new Promise<number>(resolve => {\n this._player!.one('seeked', () => {\n const actualPosition = this._player?.currentTime() ?? 0;\n this.setPosition(actualPosition);\n resolve(actualPosition);\n });\n\n this._player!.currentTime(position);\n });\n }\n\n // ─────────────────────────────────────────────────────────────────────────\n // IContainerProvider Implementation\n // ─────────────────────────────────────────────────────────────────────────\n\n /**\n * Get the container element.\n *\n * @returns jQuery-wrapped container element\n */\n getContainer(): JQuery<HTMLElement> | undefined {\n return $(this._config.selector);\n }\n\n /**\n * Register a callback for when the container is ready.\n *\n * @param callback - Function called when container is ready\n */\n onContainerReady(callback: () => void): void {\n this._containerReadyCallbacks.push(callback);\n }\n\n // ─────────────────────────────────────────────────────────────────────────\n // Overrides\n // ─────────────────────────────────────────────────────────────────────────\n\n /**\n * Get the video duration.\n *\n * @returns Duration in seconds from video.js player\n */\n override getDuration(): number {\n return this._player?.duration() ?? 0;\n }\n\n /**\n * Deactivate the source and reset position.\n *\n * Overrides base to also reset video currentTime.\n */\n override deactivate(): void {\n if (this.state === 'inactive') {\n return;\n }\n\n if (this.state === 'active') {\n this.stopTicking();\n }\n\n // Reset video position\n this._player?.currentTime(0);\n\n // Call base class deactivate to update state\n super.deactivate();\n }\n\n // ─────────────────────────────────────────────────────────────────────────\n // Private Methods\n // ─────────────────────────────────────────────────────────────────────────\n\n /**\n * Create the video element in the container.\n */\n private _createVideoElement(): void {\n const $container = $(this._config.selector);\n const videoHtml = `<video id=\"${this._videoElementId}\" class=\"video-js\"></video>`;\n $container.append(videoHtml);\n }\n\n /**\n * Add an event listener to the player and track for cleanup.\n *\n * @param event - Event name\n * @param handler - Event handler\n */\n private _addPlayerListener(\n event: string,\n handler: (...args: unknown[]) => void\n ): void {\n if (this._player) {\n this._player.on(event, handler);\n this._eventHandlers.push(() => {\n this._player?.off(event, handler);\n });\n }\n }\n\n /**\n * Handle timeupdate event from video.js.\n */\n private _handleTimeUpdate(): void {\n if (this.state !== 'active' || !this._player) {\n return;\n }\n\n const currentTime = this._player.currentTime();\n if (currentTime !== undefined) {\n this.setPosition(currentTime);\n }\n }\n\n /**\n * Handle ended event from video.js.\n */\n private _handleEnded(): void {\n if (this.state !== 'active') {\n return;\n }\n\n // Emit end boundary\n this.emitBoundary('end');\n\n if (this.loop) {\n // Reset position and emit start boundary\n this._player?.currentTime(0);\n this.setPosition(0);\n this.emitBoundary('start');\n\n // Continue playing\n this._player?.play();\n } else {\n // Deactivate\n this.deactivate();\n }\n }\n\n /**\n * Notify all container ready callbacks.\n */\n private _notifyContainerReady(): void {\n for (const callback of this._containerReadyCallbacks) {\n callback();\n }\n }\n}\n","import type {IContainerProvider} from '@timelineproviders/types.ts';\nimport $ from 'jquery';\n\n/**\n * Configuration for DomContainerProvider.\n */\nexport interface DomContainerProviderConfig {\n /**\n * CSS selector for the container element.\n */\n selector: string;\n}\n\n/**\n * DOM selector-based container provider.\n *\n * Provides access to a DOM container element via a CSS selector.\n * Implements `IContainerProvider` for use with position sources that\n * don't have an intrinsic container (e.g., RAF-based sources, WebSocket sources).\n *\n * @example\n * ```typescript\n * const containerProvider = new DomContainerProvider({\n * selector: '#timeline-container',\n * });\n *\n * containerProvider.onContainerReady(() => {\n * const $container = containerProvider.getContainer();\n * $container?.append('<div class=\"content\">Ready!</div>');\n * });\n *\n * await containerProvider.init();\n * ```\n */\nexport class DomContainerProvider implements IContainerProvider {\n // ─────────────────────────────────────────────────────────────────────────\n // State\n // ─────────────────────────────────────────────────────────────────────────\n\n private readonly _config: DomContainerProviderConfig;\n private _container: JQuery<HTMLElement> | undefined;\n private _isReady = false;\n private _isDestroyed = false;\n private readonly _readyCallbacks: Array<() => void> = [];\n\n // ─────────────────────────────────────────────────────────────────────────\n // Constructor\n // ─────────────────────────────────────────────────────────────────────────\n\n /**\n * Create a new DOM container provider.\n *\n * @param config - Configuration options\n */\n constructor(config: DomContainerProviderConfig) {\n this._config = config;\n }\n\n // ─────────────────────────────────────────────────────────────────────────\n // Lifecycle\n // ─────────────────────────────────────────────────────────────────────────\n\n /**\n * Initialize the container provider.\n *\n * Looks up the container element using the configured selector.\n *\n * @throws Error if the element is not found\n */\n async init(): Promise<void> {\n if (this._isReady) {\n return;\n }\n\n const $element = $(this._config.selector);\n\n if ($element.length === 0) {\n throw new Error(`Container element not found: ${this._config.selector}`);\n }\n\n this._container = $element;\n this._isReady = true;\n\n // Notify all ready callbacks\n this._notifyReady();\n }\n\n /**\n * Destroy the container provider and release resources.\n */\n destroy(): void {\n this._container = undefined;\n this._isReady = false;\n this._isDestroyed = true;\n this._readyCallbacks.length = 0;\n }\n\n // ─────────────────────────────────────────────────────────────────────────\n // IContainerProvider Implementation\n // ─────────────────────────────────────────────────────────────────────────\n\n /**\n * Get the container element.\n *\n * @returns jQuery-wrapped container element, or `undefined` if not initialized\n */\n getContainer(): JQuery<HTMLElement> | undefined {\n return this._container;\n }\n\n /**\n * Register a callback for when the container is ready.\n *\n * If the container is already ready, the callback is invoked immediately.\n *\n * @param callback - Function called when container is ready\n */\n onContainerReady(callback: () => void): void {\n if (this._isDestroyed) {\n return;\n }\n\n if (this._isReady) {\n callback();\n } else {\n this._readyCallbacks.push(callback);\n }\n }\n\n // ─────────────────────────────────────────────────────────────────────────\n // Private Methods\n // ─────────────────────────────────────────────────────────────────────────\n\n /**\n * Notify all registered ready callbacks.\n */\n private _notifyReady(): void {\n for (const callback of this._readyCallbacks) {\n callback();\n }\n }\n}\n","import type {IPlaylist} from '@timelineproviders/types.ts';\n\n/**\n * Configuration for SimplePlaylist.\n *\n * @typeParam TItem - Type of playlist items\n */\nexport interface SimplePlaylistConfig<TItem> {\n /**\n * Array of items in the playlist.\n * Must contain at least one item.\n */\n items: TItem[];\n\n /**\n * Key of the item to use as identifier for `selectItem()`.\n * The value at this key is coerced to a string for comparison.\n */\n identifierKey: keyof TItem;\n}\n\n/**\n * Simple playlist implementation.\n *\n * Manages a collection of timeline items and allows switching between them.\n * Implements `IPlaylist<TItem>` for use with timeline providers that\n * support multiple content sources.\n *\n * @typeParam TItem - Type of playlist items\n *\n * @example\n * ```typescript\n * interface VideoItem {\n * id: string;\n * uri: string;\n * title: string;\n * }\n *\n * const playlist = new SimplePlaylist<VideoItem>({\n * items: [\n * { id: 'intro', uri: '/videos/intro.mp4', title: 'Introduction' },\n * { id: 'ch1', uri: '/videos/chapter-1.mp4', title: 'Chapter 1' },\n * ],\n * identifierKey: 'id',\n * });\n *\n * playlist.onItemChange((item) => {\n * console.log(`Now playing: ${item.title}`);\n * });\n *\n * playlist.selectItem('ch1');\n * ```\n */\nexport class SimplePlaylist<TItem = unknown> implements IPlaylist<TItem> {\n // ─────────────────────────────────────────────────────────────────────────\n // State\n // ─────────────────────────────────────────────────────────────────────────\n\n private readonly _items: readonly TItem[];\n private readonly _identifierKey: keyof TItem;\n private _currentIndex = 0;\n private readonly _changeCallbacks: Array<(item: TItem) => void> = [];\n\n // ─────────────────────────────────────────────────────────────────────────\n // Constructor\n // ─────────────────────────────────────────────────────────────────────────\n\n /**\n * Create a new simple playlist.\n *\n * @param config - Configuration options\n * @throws Error if items array is empty\n */\n constructor(config: SimplePlaylistConfig<TItem>) {\n if (!config.items || config.items.length === 0) {\n throw new Error('Playlist must have at least one item');\n }\n\n this._items = Object.freeze([...config.items]);\n this._identifierKey = config.identifierKey;\n }\n\n // ─────────────────────────────────────────────────────────────────────────\n // IPlaylist Implementation\n // ─────────────────────────────────────────────────────────────────────────\n\n /**\n * Get the currently active item.\n */\n get currentItem(): TItem {\n return this._items[this._currentIndex];\n }\n\n /**\n * Get all items in the playlist.\n *\n * Returns a readonly array to prevent external modification.\n */\n get items(): readonly TItem[] {\n return this._items;\n }\n\n /**\n * Select an item by identifier.\n *\n * Looks up the item using the configured identifier key and switches\n * to it if found. Triggers item change callbacks if the selection changes.\n *\n * @param identifier - Unique identifier for the item\n * @throws Error if no item matches the identifier\n */\n selectItem(identifier: string): void {\n const index = this._items.findIndex(\n item => String(item[this._identifierKey]) === identifier\n );\n\n if (index === -1) {\n throw new Error(`Playlist item not found: ${identifier}`);\n }\n\n // Only notify if actually changing\n if (index !== this._currentIndex) {\n this._currentIndex = index;\n this._notifyChange();\n }\n }\n\n /**\n * Register a callback for item changes.\n *\n * Called whenever the current item changes via `selectItem()`.\n *\n * @param callback - Function receiving the new current item\n */\n onItemChange(callback: (item: TItem) => void): void {\n this._changeCallbacks.push(callback);\n }\n\n // ─────────────────────────────────────────────────────────────────────────\n // Private Methods\n // ─────────────────────────────────────────────────────────────────────────\n\n /**\n * Notify all registered change callbacks.\n */\n private _notifyChange(): void {\n const currentItem = this.currentItem;\n for (const callback of this._changeCallbacks) {\n callback(currentItem);\n }\n }\n}\n","// =============================================================================\n// DECOMPOSED INTERFACES (new architecture)\n// =============================================================================\n\nexport type {\n IContainerProvider,\n IPlaylist,\n IPositionSource,\n ISeekable,\n TBoundary,\n TSourceState,\n} from '@timelineproviders/types.ts';\n\nexport {isSeekable} from '@timelineproviders/types.ts';\n\n// =============================================================================\n// DECOMPOSED POSITION SOURCES (new architecture)\n// =============================================================================\n\nexport {BasePositionSource} from '@timelineproviders/position-sources/base-position-source.ts';\nexport type {\n KeyboardStepSourceConfig,\n TVerticalMode,\n} from '@timelineproviders/position-sources/keyboard-step-source.ts';\nexport {KeyboardStepSource} from '@timelineproviders/position-sources/keyboard-step-source.ts';\nexport type {RafPositionSourceConfig} from '@timelineproviders/position-sources/raf-position-source.ts';\nexport {RafPositionSource} from '@timelineproviders/position-sources/raf-position-source.ts';\nexport type {ScrollPositionSourceConfig} from '@timelineproviders/position-sources/scroll-position-source.ts';\nexport {ScrollPositionSource} from '@timelineproviders/position-sources/scroll-position-source.ts';\nexport type {\n VideoPositionSourceConfig,\n VideoSource,\n} from '@timelineproviders/position-sources/video-position-source.ts';\nexport {VideoPositionSource} from '@timelineproviders/position-sources/video-position-source.ts';\n\n// =============================================================================\n// DECOMPOSED CONTAINER PROVIDERS (new architecture)\n// =============================================================================\n\nexport type {DomContainerProviderConfig} from '@timelineproviders/container-providers/dom-container-provider.ts';\nexport {DomContainerProvider} from '@timelineproviders/container-providers/dom-container-provider.ts';\n\n// =============================================================================\n// DECOMPOSED PLAYLIST (new architecture)\n// =============================================================================\n\nexport type {SimplePlaylistConfig} from '@timelineproviders/playlist/simple-playlist.ts';\nexport {SimplePlaylist} from '@timelineproviders/playlist/simple-playlist.ts';\n","/**\n * Handler function for a specific event\n */\nexport type EventHandler<T extends unknown[]> = (...args: T) => void;\n\n/**\n * Interface for a type-safe event emitter\n * @typeParam T - Event map object where keys are event names and values are argument tuples\n *\n * Note: Use `type` aliases (not `interface`) for your event maps to avoid\n * \"Index signature is missing\" errors. TypeScript treats them differently.\n */\nexport interface ITypedEventEmitter<T extends Record<keyof T, unknown[]>> {\n /**\n * Subscribe to an event\n * @param event - Event name\n * @param handler - Event handler\n * @returns Unsubscribe function\n */\n on<K extends keyof T>(event: K, handler: EventHandler<T[K]>): () => void;\n\n /**\n * Subscribe to an event for one-time execution\n * @param event - Event name\n * @param handler - Event handler\n * @returns Unsubscribe function\n */\n once<K extends keyof T>(event: K, handler: EventHandler<T[K]>): () => void;\n\n /**\n * Unsubscribe from an event\n * @param event - Event name\n * @param handler - Event handler to remove\n */\n off<K extends keyof T>(event: K, handler: EventHandler<T[K]>): void;\n\n /**\n * Emit an event to all subscribers\n * @param event - Event name\n * @param args - Event arguments\n */\n emit<K extends keyof T>(event: K, ...args: T[K]): void;\n\n /**\n * Remove all listeners for a specific event or all events\n * @param event - Optional event name. If not provided, removes all listeners.\n */\n removeAllListeners(event?: keyof T): void;\n}\n\n/**\n * Type-safe event emitter implementation\n *\n * Features:\n * - Generic type parameter for event map\n * - Handler execution order preserved (registration order)\n * - Errors in handlers caught and logged (don't break other handlers)\n * - Copy handlers array during emit (safe removal during iteration)\n *\n * @example\n * ```typescript\n * interface MyEvents {\n * start: [];\n * data: [value: string];\n * progress: [current: number, total: number];\n * }\n *\n * const emitter = new TypedEventEmitter<MyEvents>();\n *\n * const unsubscribe = emitter.on('data', (value) => {\n * console.log('Received:', value);\n * });\n *\n * emitter.emit('data', 'hello');\n * unsubscribe();\n * ```\n */\nexport class TypedEventEmitter<T extends Record<keyof T, unknown[]>>\n implements ITypedEventEmitter<T>\n{\n private handlers: Map<keyof T, Array<EventHandler<T[keyof T]>>> = new Map();\n\n /**\n * Subscribe to an event\n * @param event - Event name\n * @param handler - Event handler\n * @returns Unsubscribe function\n */\n on<K extends keyof T>(event: K, handler: EventHandler<T[K]>): () => void {\n if (!this.handlers.has(event)) {\n this.handlers.set(event, []);\n }\n\n const eventHandlers = this.handlers.get(event)!;\n eventHandlers.push(handler as EventHandler<T[keyof T]>);\n\n return () => this.off(event, handler);\n }\n\n /**\n * Subscribe to an event for one-time execution\n * @param event - Event name\n * @param handler - Event handler\n * @returns Unsubscribe function\n */\n once<K extends keyof T>(event: K, handler: EventHandler<T[K]>): () => void {\n const onceHandler: EventHandler<T[K]> = (...args) => {\n this.off(event, onceHandler);\n handler(...args);\n };\n\n return this.on(event, onceHandler);\n }\n\n /**\n * Unsubscribe from an event\n * @param event - Event name\n * @param handler - Event handler to remove\n */\n off<K extends keyof T>(event: K, handler: EventHandler<T[K]>): void {\n const eventHandlers = this.handlers.get(event);\n if (!eventHandlers) {\n return;\n }\n\n const index = eventHandlers.indexOf(handler as EventHandler<T[keyof T]>);\n if (index !== -1) {\n eventHandlers.splice(index, 1);\n }\n }\n\n /**\n * Emit an event to all subscribers\n *\n * Features:\n * - Copies handlers array to allow safe removal during iteration\n * - Isolates errors - one failing handler doesn't break others\n * - Logs errors to console for debugging\n *\n * @param event - Event name\n * @param args - Event arguments\n */\n emit<K extends keyof T>(event: K, ...args: T[K]): void {\n const eventHandlers = this.handlers.get(event);\n if (!eventHandlers || eventHandlers.length === 0) {\n return;\n }\n\n // Copy array to allow safe removal during iteration\n const handlersCopy = [...eventHandlers];\n\n for (const handler of handlersCopy) {\n try {\n handler(...(args as T[keyof T]));\n } catch (error) {\n console.error(`Error in event handler for \"${String(event)}\":`, error);\n }\n }\n }\n\n /**\n * Remove all listeners for a specific event or all events\n * @param event - Optional event name. If not provided, removes all listeners.\n */\n removeAllListeners(event?: keyof T): void {\n if (event !== undefined) {\n this.handlers.delete(event);\n } else {\n this.handlers.clear();\n }\n }\n}\n","import type {IEndableAction, ITimelineAction} from '@action/types.ts';\nimport type {\n IResolvedEngineConfiguration,\n IResolvedTimelineConfiguration,\n} from '@configuration/types.ts';\nimport type {\n EventName,\n IEventbus,\n TEventbusRemover,\n TEventHandler,\n} from '@eventbus/types.ts';\nimport type {\n IContainerProvider,\n IPlaylist,\n IPositionSource,\n ISeekable,\n} from '@timelineproviders/types.ts';\nimport {TypedEventEmitter} from '@util/typed-event-emitter.ts';\nimport $ from 'jquery';\nimport type {ILocaleManager} from './locale/types.ts';\nimport type {\n EngineEvents,\n IEligiusEngine,\n ITimelineProviderInfo,\n TimelineTypes,\n TResultCallback,\n} from './types.ts';\n\n// ─────────────────────────────────────────────────────────────────────────────\n// Type Guards\n// ─────────────────────────────────────────────────────────────────────────────\n\n/**\n * Type guard to check if a position source supports seeking.\n */\nfunction isSeekable(\n source: IPositionSource\n): source is IPositionSource & ISeekable {\n return 'seek' in source && typeof (source as ISeekable).seek === 'function';\n}\n\n/**\n * Maps position source state to engine play state.\n */\nfunction mapSourceStateToPlayState(\n sourceState: IPositionSource['state']\n): 'playing' | 'paused' | 'stopped' {\n switch (sourceState) {\n case 'active':\n return 'playing';\n case 'suspended':\n return 'paused';\n case 'inactive':\n return 'stopped';\n }\n}\n\ntype ActionMethod =\n | (IEndableAction['start'] & ActionMethodMetadata)\n | (IEndableAction['end'] & ActionMethodMetadata);\n\ninterface ActionMethodMetadata {\n id: string;\n isStart: boolean;\n startPosition?: number;\n}\n\n/**\n * The Eligius timeline engine with explicit, testable API.\n *\n * This engine is responsible for starting and stopping the given timeline provider\n * and triggering the actions associated with positions along the timeline.\n */\nexport class EligiusEngine implements IEligiusEngine {\n private _timeLineActionsLookup: Record<\n string,\n Record<number, ActionMethod[]>\n > = {};\n private _timelineLookupCache: Map<string, IResolvedTimelineConfiguration> =\n new Map();\n private _eventbusRemovers: TEventbusRemover[] = [];\n private _currentTimelineUri: string = '';\n\n // Decomposed timeline provider components\n private _activePositionSource: IPositionSource | undefined = undefined;\n private _activeContainerProvider: IContainerProvider | undefined = undefined;\n private _activePlaylist: IPlaylist | undefined = undefined;\n\n private _lastPosition: number = -1;\n private _emitter = new TypedEventEmitter<EngineEvents>();\n\n // ─────────────────────────────────────────────────────────────────────────\n // STATE (synchronous reads) - IEligiusEngine interface\n // ─────────────────────────────────────────────────────────────────────────\n\n /** Current timeline position in seconds (supports fractional values) */\n get position(): number {\n return this._activePositionSource?.getPosition() ?? 0;\n }\n\n /** Timeline duration in seconds, undefined if not yet available */\n get duration(): number | undefined {\n return this._activePositionSource?.getDuration();\n }\n\n /** Current playback state (derived from position source state) */\n get playState(): 'playing' | 'paused' | 'stopped' {\n if (!this._activePositionSource) {\n return 'stopped';\n }\n return mapSourceStateToPlayState(this._activePositionSource.state);\n }\n\n /** URI of the currently active timeline */\n get currentTimelineUri(): string {\n return this._currentTimelineUri;\n }\n\n /** Container element for the active timeline provider */\n get container(): JQuery<HTMLElement> | undefined {\n return this._activeContainerProvider?.getContainer();\n }\n\n /** Root element of the engine (container selector) */\n get engineRoot(): JQuery<HTMLElement> {\n return $(this.configuration.containerSelector);\n }\n\n constructor(\n private configuration: IResolvedEngineConfiguration,\n private eventbus: IEventbus,\n private timelineProviders: Record<TimelineTypes, ITimelineProviderInfo>,\n private localeManager: ILocaleManager\n ) {}\n\n // ─────────────────────────────────────────────────────────────────────────\n // EVENTS - IEligiusEngine interface\n // ─────────────────────────────────────────────────────────────────────────\n\n /**\n * Subscribe to engine events\n * @param event - Event name\n * @param handler - Event handler\n * @returns Unsubscribe function\n */\n on<K extends keyof EngineEvents>(\n event: K,\n handler: (...args: EngineEvents[K]) => void\n ): () => void {\n return this._emitter.on(event, handler);\n }\n\n // ─────────────────────────────────────────────────────────────────────────\n // PLAYBACK COMMANDS - IEligiusEngine interface\n // ─────────────────────────────────────────────────────────────────────────\n\n /**\n * Start playback\n * @throws If autoplay is blocked (video provider)\n */\n async start(): Promise<void> {\n if (!this._activePositionSource) {\n return;\n }\n\n await this._activePositionSource.activate();\n this._emitter.emit('start');\n this.eventbus.broadcast('timeline-play', []);\n }\n\n /**\n * Pause playback\n */\n pause(): void {\n if (!this._activePositionSource) {\n return;\n }\n\n this._activePositionSource.suspend();\n this._emitter.emit('pause');\n this.eventbus.broadcast('timeline-pause', []);\n }\n\n /**\n * Stop playback and reset to beginning\n */\n stop(): void {\n if (!this._activePositionSource) {\n return;\n }\n\n this._activePositionSource.deactivate();\n this._emitter.emit('stop');\n this.eventbus.broadcast('timeline-stop', []);\n }\n\n /**\n * Seek to a specific position\n * @param position - Target position in seconds\n * @returns Actual position after seek\n */\n async seek(position: number): Promise<number> {\n if (!this._activePositionSource) {\n return 0;\n }\n\n const seekPosition = position;\n const duration = this._activePositionSource.getDuration();\n const currentPosition = this._activePositionSource.getPosition();\n\n if (seekPosition < 0 || seekPosition > duration) {\n return currentPosition;\n }\n\n this._emitter.emit('seekStart', seekPosition, currentPosition, duration);\n this.eventbus.broadcast('timeline-seek', [\n seekPosition,\n currentPosition,\n duration,\n ]);\n\n // Only seek if position source supports it\n if (isSeekable(this._activePositionSource)) {\n await this._activePositionSource.seek(seekPosition);\n }\n await this._executeSeekActions(seekPosition);\n\n const finalPosition = this._activePositionSource.getPosition();\n\n this._emitter.emit('seekComplete', finalPosition, duration);\n this.eventbus.broadcast('timeline-seeked', [finalPosition, duration]);\n\n this._emitter.emit('time', finalPosition);\n this.eventbus.broadcast('timeline-time', [finalPosition]);\n\n // Resume if was active before seek\n if (this._activePositionSource.state === 'active') {\n await this._activePositionSource.activate();\n }\n\n return finalPosition;\n }\n\n // ─────────────────────────────────────────────────────────────────────────\n // TIMELINE MANAGEMENT - IEligiusEngine interface\n // ─────────────────────────────────────────────────────────────────────────\n\n /**\n * Switch to a different timeline\n * @param uri - Timeline URI to switch to\n * @param position - Optional starting position\n */\n async switchTimeline(uri: string, position: number = 0): Promise<void> {\n if (!this._activePositionSource) {\n return;\n }\n\n const timelineConfig = this._timelineLookupCache.get(uri);\n if (!timelineConfig || this._currentTimelineUri === timelineConfig.uri) {\n return;\n }\n\n this._activePositionSource.deactivate();\n await this._cleanUpTimeline();\n\n this._currentTimelineUri = timelineConfig.uri;\n this._emitter.emit('timelineChange', this._currentTimelineUri);\n this.eventbus.broadcast('timeline-current-timeline-change', [\n this._currentTimelineUri,\n ]);\n\n const newProviderSettings = this.timelineProviders[timelineConfig.type];\n\n // Switch to new position source if different\n if (this._activePositionSource !== newProviderSettings.positionSource) {\n this._activePositionSource.destroy();\n this._activePositionSource = newProviderSettings.positionSource;\n this._activeContainerProvider = newProviderSettings.containerProvider;\n this._activePlaylist = newProviderSettings.playlist;\n }\n\n this._activePositionSource.loop = timelineConfig.loop;\n\n if (!this._activePositionSource.loop && position > 0) {\n this.eventbus.once('timeline-firstframe', async () => {\n if (!this._activePositionSource) {\n return;\n }\n\n this._activePositionSource.suspend();\n this.eventbus.broadcast('timeline-duration', [\n this._activePositionSource.getDuration,\n ]);\n\n await this._executeStartActions();\n\n if (isSeekable(this._activePositionSource)) {\n await this._activePositionSource.seek(position);\n }\n await this._executeSeekActions(position);\n });\n }\n\n // Select playlist item if playlist is available\n if (this._activePlaylist) {\n this._activePlaylist.selectItem(uri);\n }\n }\n\n /**\n * Initializes the engine by creating the HTML layout and the first time line\n * by executing its initActions.\n */\n init(): Promise<IPositionSource> {\n this._createLayoutTemplate();\n\n this._addEventbusListeners();\n\n const {timelines} = this.configuration;\n\n this._currentTimelineUri = timelines?.[0].uri ?? '';\n\n this._createTimelineLookup();\n\n return this._initializeTimelineProvider();\n }\n\n private _createLayoutTemplate() {\n const {containerSelector} = this.configuration;\n const container = $(containerSelector);\n\n if (!container || !container.length) {\n throw new Error(`Container selector not found: ${containerSelector}`);\n }\n\n const {layoutTemplate} = this.configuration;\n\n if (layoutTemplate?.length) {\n container.html(layoutTemplate);\n } else {\n console.warn('layoutTemplate is empty, unable to create layout');\n }\n }\n\n private async _initializeTimelineProvider(): Promise<IPositionSource> {\n if (!this.configuration.timelines?.length) {\n throw new Error('No timelines present');\n }\n\n const firstTimeline = this.configuration.timelines[0];\n const providerSettings = this.timelineProviders[firstTimeline.type];\n\n if (!providerSettings) {\n throw new Error(\n `No timeline provider configured for type ${firstTimeline.type}`\n );\n }\n\n // Destroy existing components if any\n this._activePositionSource?.destroy();\n\n // Set up decomposed components\n this._activePositionSource = providerSettings.positionSource;\n this._activeContainerProvider = providerSettings.containerProvider;\n this._activePlaylist = providerSettings.playlist;\n\n if (!this._activePositionSource) {\n throw new Error('NO ACTIVE POSITION SOURCE');\n }\n\n // Register callbacks using new interface\n this._activePositionSource.onPosition(\n this._onTimeHandler.bind(this, (x: number) => x)\n );\n this._activePositionSource.onBoundaryReached(boundary => {\n if (boundary === 'end') {\n this._onCompleteCallback();\n } else if (boundary === 'start') {\n this._onRestartCallback();\n }\n });\n this._activePositionSource.onActivated(\n this._onFirstFrameCallback.bind(this)\n );\n\n await this._activePositionSource.init();\n await this._executeActions(this.configuration.initActions, 'start');\n this._emitter.emit('initialized');\n return this._activePositionSource;\n }\n\n private _onCompleteCallback() {\n // playState is now derived from position source state\n this._emitter.emit('timelineComplete');\n this.eventbus.broadcast('timeline-complete', []);\n }\n\n private _onFirstFrameCallback() {\n this._emitter.emit('timelineFirstFrame');\n this.eventbus.broadcast('timeline-firstframe', []);\n\n const duration = this._activePositionSource?.getDuration();\n if (duration !== undefined) {\n this._emitter.emit('duration', duration);\n }\n this.eventbus.broadcast('timeline-duration', [\n this._activePositionSource?.getDuration,\n ]);\n }\n\n private _onRestartCallback() {\n this._emitter.emit('timelineRestart');\n this.eventbus.broadcast('timeline-restart', []);\n }\n\n private async _cleanUp() {\n await this._cleanUpTimeline();\n await this._executeActions(\n [...this.configuration.initActions].reverse(),\n 'end'\n );\n }\n\n /**\n * Cleans up all the necessary parts that the engine initialized.\n * - It ends the currently active operations and the init actions.\n * - It removes all its eventbus listeners, handlers and interceptors.\n * - It destroys all of its timeline providers\n * - It empties the HTML element indicated by the containerSelector configuration property.\n *\n */\n async destroy() {\n await this._cleanUp();\n\n this.localeManager.destroy();\n\n this._activePositionSource = undefined;\n this._activeContainerProvider = undefined;\n this._activePlaylist = undefined;\n this._eventbusRemovers.forEach(remover => remover());\n\n if (this.timelineProviders) {\n Object.values(this.timelineProviders).forEach(providerInfo =>\n providerInfo.positionSource.destroy()\n );\n }\n\n const {containerSelector} = this.configuration;\n const container = $(containerSelector);\n container.empty();\n\n this._emitter.emit('destroyed');\n this._emitter.removeAllListeners();\n }\n\n private _addEventListener(\n eventName: string,\n eventHandler: TEventHandler,\n eventTopic?: string\n ) {\n this._eventbusRemovers.push(\n this.eventbus.on(eventName as EventName, eventHandler, eventTopic)\n );\n }\n\n private _addEventbusListeners() {\n this._addEventListener(\n 'request-engine-root',\n this._handleRequestEngineRoot.bind(\n this,\n this.configuration.containerSelector\n )\n );\n this._addEventListener(\n 'request-timeline-uri',\n this._handleRequestTimelineUri.bind(this)\n );\n this._addEventListener(\n 'request-current-timeline-position',\n this._handleRequestTimelinePosition.bind(this, (x: number) => x)\n );\n this._addEventListener(\n 'request-timeline-cleanup',\n this._handleTimelineComplete.bind(this)\n );\n this._addEventListener(\n 'timeline-request-current-timeline',\n this._requestCurrentTimeline.bind(this)\n );\n this._addEventListener(\n 'timeline-play-toggle-request',\n this._toggleplay.bind(this)\n );\n\n this._addEventListener(\n 'timeline-play-request',\n this._playRequest.bind(this)\n );\n\n this._addEventListener(\n 'timeline-stop-request',\n this._stopRequest.bind(this)\n );\n\n this._addEventListener(\n 'timeline-pause-request',\n this._pauseRequest.bind(this)\n );\n\n this._addEventListener(\n 'timeline-container-request',\n this._containerRequest.bind(this)\n );\n\n this._addEventListener(\n 'timeline-duration-request',\n this._durationRequest.bind(this)\n );\n\n this._addEventListener(\n 'timeline-seek-request',\n this._seekRequest.bind(this)\n );\n }\n\n // Legacy eventbus handlers - delegate to public API methods\n private async _seekRequest(position: number) {\n await this.seek(position);\n }\n\n private _durationRequest(callBack: TResultCallback<number | undefined>) {\n callBack(this.duration);\n }\n\n private _containerRequest(\n callBack: TResultCallback<JQuery<HTMLElement> | undefined>\n ) {\n callBack(this.container);\n }\n\n private _pauseRequest() {\n this.pause();\n }\n\n private _stopRequest() {\n this.stop();\n }\n\n private async _playRequest() {\n await this.start();\n }\n\n private async _toggleplay() {\n if (this._activePositionSource?.state === 'active') {\n this.pause();\n } else {\n await this.start();\n }\n }\n\n private _createTimelineLookup() {\n if (!this.configuration.timelines) {\n return;\n }\n\n // Consolidated loop: process both start and end actions in a single pass\n this.configuration.timelines.forEach(timelineInfo => {\n // Populate timeline lookup cache for O(1) access\n this._timelineLookupCache.set(timelineInfo.uri, timelineInfo);\n\n timelineInfo.timelineActions.forEach(timelineAction => {\n this._addTimelineActionStart(timelineInfo.uri, timelineAction);\n this._addTimelineActionEnd(timelineInfo.uri, timelineAction);\n });\n });\n\n EligiusEngine.sortTimelines(Object.values(this._timeLineActionsLookup));\n }\n\n static sortTimelines(timelines: Record<number, ActionMethod[]>[]) {\n timelines.forEach(timelineActions => {\n Object.keys(timelineActions).forEach(key => {\n const numericKey = Number(key);\n timelineActions[numericKey] = EligiusEngine.sortActionsPerPosition(\n timelineActions[numericKey]\n );\n });\n });\n }\n\n static sortActionsPerPosition(actions: ActionMethod[]) {\n const [startMethods, endMethods] = actions.reduce(\n (acc, item) => {\n if (item.isStart) {\n acc[0].push(item);\n } else {\n acc[1].push(item);\n }\n return acc;\n },\n [[], []] as [ActionMethod[], ActionMethod[]]\n );\n return [\n ...endMethods.sort(sortActionMethodsHighestStartPositionFirst),\n ...startMethods,\n ];\n }\n\n private _addTimelineActionStart(\n uri: string,\n timeLineAction: ITimelineAction\n ) {\n const startPosition = timeLineAction.duration.start;\n const timelineStartPositions = this._initializeTimelinePosition(\n this._initializeUriLookup(this._timeLineActionsLookup, uri),\n startPosition\n );\n const startMethod = timeLineAction.start.bind(\n timeLineAction\n ) as ActionMethod;\n\n if (timeLineAction.id?.length) {\n startMethod.id = timeLineAction.id;\n }\n startMethod.isStart = true;\n\n timelineStartPositions.push(startMethod);\n }\n\n private _addTimelineActionEnd(uri: string, timeLineAction: ITimelineAction) {\n let end = timeLineAction.duration.end;\n if (end < 0) {\n end = timeLineAction.duration.end = Infinity;\n }\n\n if (Number.isFinite(end)) {\n const timelineEndPositions = this._initializeTimelinePosition(\n this._timeLineActionsLookup[uri],\n end\n );\n const endMethod = timeLineAction.end.bind(timeLineAction) as ActionMethod;\n\n if (timeLineAction.id?.length) {\n endMethod.id = timeLineAction.id;\n endMethod.startPosition = timeLineAction.duration.start;\n }\n endMethod.isStart = false;\n\n timelineEndPositions.push(endMethod);\n }\n }\n\n private _initializeUriLookup(\n lookup: Record<string, Record<number, ActionMethod[]>>,\n uri: string\n ): Record<number, ActionMethod[]> {\n if (!lookup[uri]) {\n lookup[uri] = {};\n }\n\n return lookup[uri];\n }\n\n private _initializeTimelinePosition(\n lookup: Record<number, ActionMethod[]>,\n position: number\n ): ActionMethod[] {\n if (!lookup[position]) {\n lookup[position] = [] as ActionMethod[];\n }\n\n return lookup[position];\n }\n\n private async _executeActions(\n actions: IEndableAction[],\n methodName: 'start' | 'end'\n ): Promise<void> {\n // Iterative implementation (converted from recursive)\n if (actions.length === 0) {\n return;\n }\n\n for (const action of actions) {\n await action[methodName]();\n }\n }\n\n private _handleRequestEngineRoot(\n engineRootSelector: string,\n resultCallback: TResultCallback<JQuery<HTMLElement>>\n ) {\n resultCallback($(engineRootSelector));\n }\n\n private async _handleRequestTimelineUri(uri: string, position: number = 0) {\n await this.switchTimeline(uri, position);\n }\n\n private _cleanUpTimeline() {\n return this._executeRelevantActions(this._getActiveActions, 'end');\n }\n\n private _executeStartActions() {\n return this._executeRelevantActions(\n this._getActionsForPosition.bind(this, 0),\n 'start'\n );\n }\n\n /**\n * Gets all of the inactive actions whose duration falls within the given timeline position.\n *\n * @param position the given position\n * @param actions all of the relevant actions\n * @returns\n */\n private _getActionsForPosition(position: number, actions: ITimelineAction[]) {\n return actions.filter(\n action =>\n !action.active &&\n action.duration.start <= position &&\n action.duration.end >= position\n );\n }\n\n private _getActiveActions(allActions: ITimelineAction[]) {\n const actions = allActions.filter(action => action.active);\n return actions.sort(sortActionsHighestStartPositionFirst);\n }\n\n private _executeRelevantActions(\n filter: (actions: ITimelineAction[]) => ITimelineAction[],\n executionType: 'start' | 'end'\n ) {\n const timelineActions = this._getTimelineActionsForCurrentTimeline();\n const currentActions = filter.apply(this, [timelineActions]);\n return this._executeActions(currentActions, executionType);\n }\n\n private _handleRequestTimelinePosition(\n floor: (x: number) => number,\n resultCallback: TResultCallback<number>\n ) {\n resultCallback(floor(this._activePositionSource?.getPosition() || -1));\n }\n\n private _handleTimelineComplete() {\n this._cleanUpTimeline();\n }\n\n private _getTimelineActionsForCurrentTimeline() {\n return this._getTimelineActionsForUri(this._currentTimelineUri);\n }\n\n private _requestCurrentTimeline(resultCallback: TResultCallback<string>) {\n resultCallback(this._currentTimelineUri);\n }\n\n private _getTimelineActionsForUri(uri: string): ITimelineAction[] {\n const info = this._timelineLookupCache.get(uri);\n return info?.timelineActions ?? [];\n }\n\n private _onTimeHandler(floor: (x: number) => number, position: number) {\n if (!Number.isNaN(position)) {\n const pos = floor(position);\n\n if (this._lastPosition !== pos) {\n this._executeActionsForPosition(pos);\n this._emitter.emit('time', pos);\n this.eventbus.broadcast('timeline-time', [pos]);\n }\n }\n }\n\n private _executeActionsForPosition(position: number) {\n this._lastPosition = position;\n const actions = this._timeLineActionsLookup[this._currentTimelineUri];\n\n if (actions) {\n const executions = actions[position];\n executions?.forEach(exec => exec());\n }\n }\n\n private async _executeSeekActions(position: number) {\n const timelineActions = this._getTimelineActionsForCurrentTimeline();\n const currentActions = this._getActiveActions(timelineActions).filter(\n action =>\n !(action.duration.start <= position && action.duration.end >= position)\n );\n const newActions = this._getActionsForPosition(position, timelineActions);\n await this._executeActions(currentActions, 'end');\n await this._executeActions(newActions, 'start');\n }\n}\n\nconst sortActionsHighestStartPositionFirst = (\n a: ITimelineAction,\n b: ITimelineAction\n) => b.duration.start - a.duration.start;\n\nconst sortActionMethodsHighestStartPositionFirst = (\n a: ActionMethod,\n b: ActionMethod\n) => {\n if (a.startPosition === undefined || b.startPosition === undefined) {\n return 0;\n }\n return b.startPosition - a.startPosition;\n};\n","import * as ctrls from '@controllers/index.ts';\nimport * as evtb from '@eventbus/index.ts';\nimport * as ops from '@operation/index.ts';\nimport type {TOperation} from '@operation/types.ts';\nimport * as prvdrs from '@timelineproviders/index.ts';\nimport {EligiusEngine} from '../eligius-engine.ts';\nimport type {IResourceImporter} from '../types.ts';\n\nconst operations: Record<string, TOperation<any>> = ops as any;\nconst controllers: Record<string, any> = ctrls;\nconst providers: Record<string, any> = prvdrs;\nconst eventbus: Record<string, any> = evtb;\n\nexport class EligiusResourceImporter implements IResourceImporter {\n engines = new Map();\n constructor() {\n this.engines.set('EligiusEngine', EligiusEngine);\n }\n\n getOperationNames(): string[] {\n return Object.keys(operations);\n }\n\n getControllerNames(): string[] {\n return Object.keys(controllers);\n }\n\n getProviderNames(): string[] {\n return Object.keys(providers);\n }\n\n import(name: string): Record<string, any> {\n const value =\n operations[name] ??\n controllers[name] ??\n providers[name] ??\n eventbus[name] ??\n this.engines.get(name);\n\n return {[name]: value};\n }\n}\n","/**\n * LocaleManager - Core locale management class wrapping rosetta\n * Feature: 005-rosetta-locale-manager\n *\n * Provides translation retrieval, locale switching, and event emission\n * for the Eligius timeline engine.\n */\n\nimport rosetta from 'rosetta';\nimport type {\n ILocaleManager,\n ILocaleManagerOptions,\n LocaleEvents,\n TLanguageCode,\n TLocaleData,\n} from './types.ts';\n\n/**\n * LocaleManager wraps the rosetta library to provide translation management\n * with event-based locale switching support.\n */\nexport class LocaleManager implements ILocaleManager {\n private readonly _rosetta: ReturnType<typeof rosetta>;\n private readonly _listeners: Map<\n keyof LocaleEvents,\n Set<(...args: LocaleEvents[keyof LocaleEvents]) => void>\n >;\n private _locale: TLanguageCode;\n private _availableLocales: Set<TLanguageCode>;\n private readonly _debug: boolean;\n /** Raw locale data for debug mode variable checking (rosetta interpolates on access) */\n private readonly _rawLocaleData: Map<TLanguageCode, TLocaleData>;\n\n /**\n * Creates a new LocaleManager instance.\n *\n * @param options - Configuration options for the locale manager\n */\n constructor(options: ILocaleManagerOptions) {\n this._rosetta = rosetta();\n this._listeners = new Map();\n this._locale = options.defaultLocale;\n this._availableLocales = new Set();\n this._debug = options.debug ?? false;\n this._rawLocaleData = new Map();\n\n // Set initial locale in rosetta\n this._rosetta.locale(this._locale);\n }\n\n /**\n * Gets the current locale.\n */\n get locale(): TLanguageCode {\n return this._locale;\n }\n\n /**\n * Gets the list of available locales.\n */\n get availableLocales(): ReadonlyArray<TLanguageCode> {\n return Array.from(this._availableLocales);\n }\n\n /**\n * Loads translation data for a specific locale.\n *\n * @param locale - The locale code (e.g., 'en-US', 'nl-NL')\n * @param data - The translation data object\n */\n loadLocale(locale: TLanguageCode, data: TLocaleData): void {\n this._rosetta.set(locale, data);\n this._availableLocales.add(locale);\n\n // Store raw data for debug mode variable checking\n if (this._debug) {\n this._rawLocaleData.set(locale, data);\n console.log(`[LocaleManager] Loaded locale: ${locale}`);\n }\n }\n\n /**\n * Retrieves a translation for the given key.\n *\n * @param key - The translation key (string or array of strings for nested keys)\n * @param params - Optional parameters for interpolation\n * @param locale - Optional locale override (uses current locale if not specified)\n * @returns The translated string, or empty string if key not found\n */\n t(\n key: string | string[],\n params?: Record<string, unknown>,\n locale?: TLanguageCode\n ): string {\n const targetLocale = locale ?? this._locale;\n\n // Temporarily switch locale if override provided\n if (locale && locale !== this._locale) {\n this._rosetta.locale(targetLocale);\n }\n\n // In debug mode, check for missing interpolation variables before rosetta interpolates\n if (this._debug && params) {\n this._checkMissingInterpolationVars(key, params);\n }\n\n const result = this._rosetta.t(key, params) ?? '';\n\n // Switch back to current locale if we temporarily changed it\n if (locale && locale !== this._locale) {\n this._rosetta.locale(this._locale);\n }\n\n if (this._debug && result === '') {\n console.warn(\n `[LocaleManager] Missing translation for key: ${Array.isArray(key) ? key.join('.') : key}`\n );\n }\n\n return result;\n }\n\n /**\n * Checks for missing interpolation variables in debug mode.\n * Extracts {{variable}} patterns from raw translation and compares with provided params.\n */\n private _checkMissingInterpolationVars(\n key: string | string[],\n params: Record<string, unknown>\n ): void {\n // Get raw translation from stored data (rosetta interpolates on access)\n const rawTranslation = this._getRawTranslation(key);\n if (typeof rawTranslation !== 'string') {\n return;\n }\n\n // Extract all {{variable}} patterns\n const variablePattern = /\\{\\{(\\w+)\\}\\}/g;\n const requiredVars: string[] = [];\n let match: RegExpExecArray | null;\n\n while ((match = variablePattern.exec(rawTranslation)) !== null) {\n requiredVars.push(match[1]);\n }\n\n // Check which variables are missing from params\n const missingVars = requiredVars.filter(varName => !(varName in params));\n\n if (missingVars.length > 0) {\n const keyStr = Array.isArray(key) ? key.join('.') : key;\n console.warn(\n `[LocaleManager] Missing interpolation variable(s) for key '${keyStr}': ${missingVars.join(', ')}`\n );\n }\n }\n\n /**\n * Gets raw translation value from stored locale data (without interpolation).\n */\n private _getRawTranslation(key: string | string[]): unknown {\n const localeData = this._rawLocaleData.get(this._locale);\n if (!localeData) {\n return undefined;\n }\n\n // Navigate through nested keys\n const keyPath = Array.isArray(key) ? key : key.split('.');\n let current: unknown = localeData;\n\n for (const segment of keyPath) {\n if (current === null || typeof current !== 'object') {\n return undefined;\n }\n current = (current as Record<string, unknown>)[segment];\n }\n\n return current;\n }\n\n /**\n * Sets the current locale and emits a change event.\n *\n * @param locale - The new locale to set\n */\n setLocale(locale: TLanguageCode): void {\n const previousLocale = this._locale;\n this._locale = locale;\n this._rosetta.locale(locale);\n\n this._emit('change', locale, previousLocale);\n\n if (this._debug) {\n console.log(\n `[LocaleManager] Locale changed: ${previousLocale} -> ${locale}`\n );\n }\n }\n\n /**\n * Subscribes to a locale event.\n *\n * @param event - The event name to subscribe to\n * @param handler - The event handler function\n * @returns An unsubscribe function\n */\n on<K extends keyof LocaleEvents>(\n event: K,\n handler: (...args: LocaleEvents[K]) => void\n ): () => void {\n if (!this._listeners.has(event)) {\n this._listeners.set(event, new Set());\n }\n\n const handlers = this._listeners.get(event)!;\n handlers.add(\n handler as (...args: LocaleEvents[keyof LocaleEvents]) => void\n );\n\n // Return unsubscribe function\n return () => {\n handlers.delete(\n handler as (...args: LocaleEvents[keyof LocaleEvents]) => void\n );\n };\n }\n\n /**\n * Destroys the LocaleManager, cleaning up all listeners and data.\n */\n destroy(): void {\n this._listeners.clear();\n this._availableLocales.clear();\n this._rawLocaleData.clear();\n\n if (this._debug) {\n console.log('[LocaleManager] Destroyed');\n }\n }\n\n /**\n * Emits an event to all registered listeners.\n *\n * @param event - The event name\n * @param args - The event arguments\n */\n private _emit<K extends keyof LocaleEvents>(\n event: K,\n ...args: LocaleEvents[K]\n ): void {\n const handlers = this._listeners.get(event);\n if (handlers) {\n for (const handler of handlers) {\n (handler as (...args: LocaleEvents[K]) => void)(...args);\n }\n }\n }\n}\n","import type {IAction} from '@action/types.ts';\nimport {\n EngineEventbusAdapter,\n EngineInputAdapter,\n LocaleEventbusAdapter,\n} from '@adapters/index.ts';\nimport {ConfigurationResolver} from '@configuration/configuration-resolver.ts';\nimport type {\n IEngineConfiguration,\n IResolvedEngineConfiguration,\n ITimelineProviderSettings,\n} from '@configuration/types.ts';\nimport {\n ActionRegistryEventbusListener,\n Eventbus,\n type IEventbus,\n RequestVideoUriInterceptor,\n type TEventbusRemover,\n} from '@eventbus/index.ts';\nimport type {\n IContainerProvider,\n IPlaylist,\n IPositionSource,\n} from '@timelineproviders/types.ts';\nimport {LocaleManager} from './locale/locale-manager.ts';\nimport type {TLanguageCode, TLocaleData} from './locale/types.ts';\nimport type {\n IConfigurationResolver,\n IEngineFactory,\n IEngineFactoryOptions,\n IEngineFactoryResult,\n ISimpleResourceImporter,\n ITimelineProviderInfo,\n TimelineTypes,\n} from './types.ts';\n\n/**\n * The EngineFactory is used to create and initialize an {@link IEligiusEngine} instance.\n *\n * It prepares a resolved configuration and creates the engine based on the class defined in the configuration.\n *\n * @example Loading a configuration and creating an IEligiusEngine instance\n * ```ts\n * import { IEngineConfiguration, EngineFactory, EligiusResourceImporter } from 'eligius';\n * import * as engineConfig from './my-eligius-config.json';\n *\n * const factory = new EngineFactory(new EligiusResourceImporter(), window);\n *\n * const { engine } = factory.createEngine((engineConfig as unknown) as IEngineConfiguration);\n *\n * engine.init().then(()=> {console.log('Eligius engine ready for business');});\n * ```\n */\nexport class EngineFactory implements IEngineFactory {\n private _actionsLookup: Record<string, IAction> = {};\n private _eventbus: IEventbus;\n private _eventRemovers: TEventbusRemover[] = [];\n private _importer: ISimpleResourceImporter;\n private _windowRef: Window;\n\n constructor(\n importer: ISimpleResourceImporter,\n windowRef: Window,\n options?: IEngineFactoryOptions\n ) {\n this._importer = importer;\n this._windowRef = windowRef;\n this._eventbus = options?.eventbus ?? new Eventbus();\n\n this._eventRemovers.push(\n this._eventbus.onRequest(\n 'request-instance',\n this._requestInstanceHandler.bind(this)\n )\n );\n this._eventRemovers.push(\n this._eventbus.onRequest(\n 'request-action',\n this._requestActionHandler.bind(this)\n )\n );\n this._eventRemovers.push(\n this._eventbus.onRequest(\n 'request-function',\n this._requestFunctionHandler.bind(this)\n )\n );\n }\n\n /**\n * Destroys the factory and cleans up all registered request handlers.\n */\n destroy() {\n this._eventRemovers.forEach(x => x());\n this._eventRemovers = [];\n this._actionsLookup = {};\n }\n\n private _importSystemEntryWithEventbusDependency(systemName: string): any {\n const ctor = this._importSystemEntry(systemName);\n return new ctor(this._eventbus);\n }\n\n private _importSystemEntry(systemName: string): any {\n const module = this._importer.import(systemName);\n const entry = module?.[systemName];\n if (!entry) {\n throw new Error(\n `Failed to import '${systemName}': module does not export '${systemName}'`\n );\n }\n return entry;\n }\n\n private _requestInstanceHandler(systemName: string): any {\n return this._importSystemEntryWithEventbusDependency(systemName);\n }\n\n private _requestFunctionHandler(systemName: string): any {\n return this._importSystemEntry(systemName);\n }\n\n private _requestActionHandler(systemName: string): IAction | null {\n const action = this._actionsLookup[systemName];\n if (action) {\n return action;\n } else {\n console.error(`Unknown action: ${systemName}`);\n return null;\n }\n }\n\n /**\n * Creates a fully wired engine with adapters and event handlers.\n *\n * This method:\n * - Resolves the configuration\n * - Creates timeline providers\n * - Instantiates the engine and locale manager\n * - Creates and connects adapters for eventbus integration\n *\n * @param configuration - The engine configuration\n * @param resolver - Optional custom configuration resolver\n * @returns Engine result with engine, locale manager, eventbus, and destroy function\n */\n createEngine(\n configuration: IEngineConfiguration,\n resolver?: IConfigurationResolver\n ): IEngineFactoryResult {\n const {systemName} = configuration.engine;\n const EngineClass = this._importSystemEntry(systemName);\n\n let actionRegistryListener: ActionRegistryEventbusListener | undefined;\n if (configuration.eventActions?.length) {\n actionRegistryListener = new ActionRegistryEventbusListener();\n this._eventRemovers.push(\n this._eventbus.registerEventlistener(actionRegistryListener)\n );\n }\n\n this._eventRemovers.push(\n this._eventbus.registerInterceptor(\n 'request-timeline-uri',\n new RequestVideoUriInterceptor(this._eventbus)\n )\n );\n\n resolver =\n resolver || new ConfigurationResolver(this._importer, this._eventbus);\n const [actionLookup, resolvedConfiguration] = resolver.process(\n configuration,\n actionRegistryListener\n );\n this._actionsLookup = actionLookup;\n\n const timelineProviders = this._createTimelineProviders(\n resolvedConfiguration\n );\n\n // Initialize locale manager with locales from configuration\n const {language, locales} = configuration;\n const localeManager = new LocaleManager({\n defaultLocale: language as TLanguageCode,\n });\n\n // Load locales from configuration\n if (locales) {\n for (const [locale, data] of Object.entries(locales)) {\n localeManager.loadLocale(locale as TLanguageCode, data as TLocaleData);\n }\n }\n\n const engineInstance = new EngineClass(\n resolvedConfiguration,\n this._eventbus,\n timelineProviders,\n localeManager\n );\n\n // Create and connect adapters\n const engineEventbusAdapter = new EngineEventbusAdapter(\n engineInstance,\n this._eventbus\n );\n const localeEventbusAdapter = new LocaleEventbusAdapter(\n localeManager,\n this._eventbus,\n engineInstance\n );\n const engineInputAdapter = new EngineInputAdapter(\n engineInstance,\n this._eventbus,\n this._windowRef\n );\n\n // Connect all adapters\n engineEventbusAdapter.connect();\n localeEventbusAdapter.connect();\n engineInputAdapter.connect();\n\n // Return the factory result\n return {\n engine: engineInstance,\n localeManager,\n eventbus: this._eventbus,\n destroy: async () => {\n // Disconnect adapters first\n engineInputAdapter.disconnect();\n localeEventbusAdapter.disconnect();\n engineEventbusAdapter.disconnect();\n\n // Destroy engine (which also destroys localeManager internally)\n await engineInstance.destroy();\n // Note: localeManager.destroy() is NOT called here because\n // engineInstance.destroy() already calls it\n },\n };\n }\n\n private _createTimelineProviders(\n configuration: IResolvedEngineConfiguration\n ): Record<TimelineTypes, ITimelineProviderInfo> {\n // Delegate to the new config-driven method\n return this.createTimelineProvidersForConfig(configuration);\n }\n\n // ─────────────────────────────────────────────────────────────────────────\n // Config-Driven Factory Methods\n // ─────────────────────────────────────────────────────────────────────────\n\n /**\n * Creates a position source for a specific timeline based on configuration.\n *\n * The position source class is resolved dynamically via the resource importer\n * using the `systemName` property from the configuration.\n *\n * @param timeline - The resolved timeline configuration\n * @param settings - The timeline provider settings containing position source config\n * @returns A configured position source\n * @throws Error if the position source class cannot be resolved\n */\n createPositionSourceForTimeline(\n timeline: IResolvedEngineConfiguration['timelines'][number],\n settings: ITimelineProviderSettings\n ): IPositionSource {\n const config = settings.positionSource;\n const {systemName, ...options} = config;\n\n const PositionSourceClass = this._importSystemEntry(systemName);\n\n // Merge timeline-specific values with config options\n const constructorConfig = {\n ...options,\n duration: timeline.duration,\n };\n\n return new PositionSourceClass(constructorConfig);\n }\n\n /**\n * Creates a container provider based on timeline provider settings.\n *\n * The container provider class is resolved dynamically via the resource importer\n * using the `systemName` property from the configuration.\n *\n * @param settings - The timeline provider settings\n * @returns A container provider, or undefined if not configured\n * @throws Error if the container provider class cannot be resolved\n */\n createContainerProviderForTimeline(\n settings: ITimelineProviderSettings\n ): IContainerProvider | undefined {\n if (!settings.container) {\n return undefined;\n }\n\n const {systemName, ...options} = settings.container;\n const ContainerProviderClass = this._importSystemEntry(systemName);\n\n return new ContainerProviderClass(options);\n }\n\n /**\n * Creates a playlist based on timeline provider settings.\n *\n * The playlist class is resolved dynamically via the resource importer\n * using the `systemName` property from the configuration.\n *\n * @param settings - The timeline provider settings\n * @returns A playlist, or undefined if not configured\n * @throws Error if the playlist class cannot be resolved\n */\n createPlaylistForTimeline(\n settings: ITimelineProviderSettings\n ): IPlaylist | undefined {\n if (!settings.playlist) {\n return undefined;\n }\n\n const {systemName, ...options} = settings.playlist;\n const PlaylistClass = this._importSystemEntry(systemName);\n\n return new PlaylistClass(options);\n }\n\n /**\n * Assembles a complete ITimelineProviderInfo from timeline and settings.\n *\n * This is the main entry point for creating provider info with the new\n * configuration-driven architecture.\n *\n * @param timeline - The resolved timeline configuration\n * @param settings - The timeline provider settings\n * @returns A complete timeline provider info with all components\n */\n createTimelineProviderInfo(\n timeline: IResolvedEngineConfiguration['timelines'][number],\n settings: ITimelineProviderSettings\n ): ITimelineProviderInfo {\n return {\n positionSource: this.createPositionSourceForTimeline(timeline, settings),\n containerProvider: this.createContainerProviderForTimeline(settings),\n playlist: this.createPlaylistForTimeline(settings),\n };\n }\n\n /**\n * Creates timeline providers for all configured timeline types using the new\n * configuration-driven architecture.\n *\n * This method iterates over timelineProviderSettings and creates a\n * ITimelineProviderInfo for each configured timeline type by:\n * 1. Finding the first timeline that matches the type\n * 2. Using the timeline's duration for the position source\n * 3. Assembling components from the settings\n *\n * @param configuration - The resolved engine configuration\n * @returns A record of timeline types to their provider info\n * @throws Error if a provider setting has no matching timeline in config\n */\n createTimelineProvidersForConfig(\n configuration: IResolvedEngineConfiguration\n ): Record<TimelineTypes, ITimelineProviderInfo> {\n const {timelineProviderSettings, timelines} = configuration;\n\n const result = Object.entries(timelineProviderSettings).reduce<\n Record<TimelineTypes, ITimelineProviderInfo>\n >(\n (acc, [timelineType, settings]) => {\n if (!settings) {\n return acc;\n }\n\n // Find the first timeline that matches this type\n const matchingTimeline = timelines.find(t => t.type === timelineType);\n if (!matchingTimeline) {\n throw new Error(\n `Timeline provider settings for '${timelineType}' has no matching timeline in configuration`\n );\n }\n\n acc[timelineType as TimelineTypes] = this.createTimelineProviderInfo(\n matchingTimeline,\n settings\n );\n return acc;\n },\n {} as Record<TimelineTypes, ITimelineProviderInfo>\n );\n\n return result;\n }\n}\n","/**\n * LocaleLoader - External locale file loading with $ref resolution\n * Feature: 005-rosetta-locale-manager\n *\n * Handles loading external JSON locale files referenced via $ref syntax.\n * Supports caching, parallel loading, and circular reference detection.\n */\n\nimport type {\n ILocaleLoader,\n ILocaleLoaderOptions,\n ILocaleLoadResult,\n ILocaleReference,\n TLanguageCode,\n TLocaleData,\n} from './types.ts';\n\n/**\n * LocaleLoader loads external locale files referenced via $ref syntax.\n *\n * Features:\n * - Fetches JSON locale files from URLs\n * - Caches results to avoid redundant fetches\n * - Detects circular references\n * - Supports baseUrl for relative path resolution\n */\nexport class LocaleLoader implements ILocaleLoader {\n private readonly _fetch: typeof globalThis.fetch;\n private readonly _baseUrl: string;\n private readonly _cache: Map<string, TLocaleData>;\n private readonly _loading: Map<string, Promise<TLocaleData>>;\n\n /**\n * Creates a new LocaleLoader instance.\n *\n * @param options - Configuration options\n */\n constructor(options: ILocaleLoaderOptions = {}) {\n this._fetch = options.fetch ?? globalThis.fetch;\n this._baseUrl = options.baseUrl ?? '';\n this._cache = new Map();\n this._loading = new Map();\n }\n\n /**\n * Loads a single locale from an external reference.\n *\n * @param locale - The locale code\n * @param reference - The external reference to load\n * @returns The loaded locale data\n * @throws If file cannot be loaded, parsed, or circular reference detected\n */\n async load(\n locale: TLanguageCode,\n reference: ILocaleReference\n ): Promise<ILocaleLoadResult> {\n // Use per-load-chain visited paths to detect circular refs\n const visitedPaths = new Set<string>();\n return this._loadWithVisited(locale, reference, visitedPaths);\n }\n\n /**\n * Internal load method with visited path tracking.\n */\n private async _loadWithVisited(\n locale: TLanguageCode,\n reference: ILocaleReference,\n visitedPaths: Set<string>\n ): Promise<ILocaleLoadResult> {\n const url = this._resolveUrl(reference.$ref);\n\n // Check for circular reference within this load chain\n if (visitedPaths.has(url)) {\n throw new Error(\n `[LocaleLoader] Circular reference detected: ${url} has already been visited`\n );\n }\n\n visitedPaths.add(url);\n\n const data = await this._fetchWithCache(url);\n\n // Check for nested $ref in loaded data (recursive references)\n await this._resolveNestedRefs(data, url, visitedPaths);\n\n return {locale, data};\n }\n\n /**\n * Loads multiple locales in parallel.\n *\n * @param entries - Map of locale codes to references\n * @returns Array of loaded locale data\n */\n async loadAll(\n entries: Map<TLanguageCode, ILocaleReference>\n ): Promise<ILocaleLoadResult[]> {\n // Each load gets its own visitedPaths set for circular detection\n // Cache handles deduplication of same URLs across different locales\n const promises: Promise<ILocaleLoadResult>[] = [];\n\n for (const [locale, reference] of entries) {\n promises.push(this.load(locale, reference));\n }\n\n return Promise.all(promises);\n }\n\n /**\n * Fetches URL with caching to avoid redundant requests.\n */\n private async _fetchWithCache(url: string): Promise<TLocaleData> {\n // Return from cache if available\n if (this._cache.has(url)) {\n return this._cache.get(url)!;\n }\n\n // Return existing promise if already loading\n if (this._loading.has(url)) {\n return this._loading.get(url)!;\n }\n\n // Start new fetch\n const promise = this._doFetch(url);\n this._loading.set(url, promise);\n\n try {\n const data = await promise;\n this._cache.set(url, data);\n return data;\n } finally {\n this._loading.delete(url);\n }\n }\n\n /**\n * Performs the actual fetch request.\n */\n private async _doFetch(url: string): Promise<TLocaleData> {\n try {\n const response = await this._fetch(url);\n\n if (!response.ok) {\n throw new Error(\n `[LocaleLoader] Failed to load locale file '${url}': ${response.status} ${response.statusText}`\n );\n }\n\n const data = await response.json();\n return data as TLocaleData;\n } catch (error) {\n if (error instanceof Error && error.message.includes('[LocaleLoader]')) {\n throw error;\n }\n throw new Error(\n `[LocaleLoader] Failed to load locale file '${url}': ${error instanceof Error ? error.message : String(error)}`\n );\n }\n }\n\n /**\n * Resolves a potentially relative URL using the baseUrl.\n */\n private _resolveUrl(ref: string): string {\n if (!this._baseUrl) {\n return ref;\n }\n\n // If ref is already absolute, return as-is\n if (\n ref.startsWith('http://') ||\n ref.startsWith('https://') ||\n ref.startsWith('/')\n ) {\n return ref;\n }\n\n // Combine baseUrl and ref\n const base = this._baseUrl.endsWith('/')\n ? this._baseUrl\n : `${this._baseUrl}/`;\n return `${base}${ref}`;\n }\n\n /**\n * Recursively resolves nested $ref references in loaded data.\n */\n private async _resolveNestedRefs(\n data: TLocaleData,\n parentUrl: string,\n visitedPaths: Set<string>\n ): Promise<void> {\n for (const key of Object.keys(data)) {\n const value = data[key];\n\n if (this._isReference(value)) {\n const nestedUrl = this._resolveRelativeToParent(value.$ref, parentUrl);\n\n // Check for circular reference\n if (visitedPaths.has(nestedUrl)) {\n throw new Error(\n `[LocaleLoader] Circular reference detected: ${nestedUrl} has already been visited (referenced from ${parentUrl})`\n );\n }\n\n visitedPaths.add(nestedUrl);\n const nestedData = await this._fetchWithCache(nestedUrl);\n await this._resolveNestedRefs(nestedData, nestedUrl, visitedPaths);\n\n // Replace the $ref with actual data\n data[key] = nestedData;\n } else if (\n typeof value === 'object' &&\n value !== null &&\n !Array.isArray(value)\n ) {\n // Recurse into nested objects\n await this._resolveNestedRefs(\n value as TLocaleData,\n parentUrl,\n visitedPaths\n );\n }\n }\n }\n\n /**\n * Type guard for reference objects.\n */\n private _isReference(value: unknown): value is ILocaleReference {\n return (\n typeof value === 'object' &&\n value !== null &&\n '$ref' in value &&\n typeof (value as ILocaleReference).$ref === 'string'\n );\n }\n\n /**\n * Resolves a relative path relative to a parent URL.\n */\n private _resolveRelativeToParent(ref: string, parentUrl: string): string {\n // If ref is absolute, return as-is\n if (\n ref.startsWith('http://') ||\n ref.startsWith('https://') ||\n ref.startsWith('/')\n ) {\n return ref;\n }\n\n // Get directory of parent URL\n const lastSlash = parentUrl.lastIndexOf('/');\n if (lastSlash === -1) {\n return ref;\n }\n\n const parentDir = parentUrl.substring(0, lastSlash + 1);\n return `${parentDir}${ref}`;\n }\n}\n","/**\n * Locale Types\n * Feature: 005-rosetta-locale-manager\n *\n * These types define the public API for the locale management system.\n */\n\n// =============================================================================\n// Core Types\n// =============================================================================\n\n/**\n * IETF language tag format (e.g., 'en-US', 'nl-NL')\n */\nexport type TLanguageCode = `${Lowercase<string>}-${Uppercase<string>}`;\n\n/**\n * Recursive interface for nested translation data.\n * Compatible with rosetta's expected format.\n * Uses interface to support recursive definition.\n */\nexport interface TLocaleData {\n [key: string]:\n | string\n | ((params: Record<string, unknown>) => string)\n | TLocaleData;\n}\n\n/**\n * Valid values in locale data:\n * - string: Simple translation text (may contain {{interpolation}})\n * - function: Dynamic translation that receives params\n * - nested object: Nested translation keys\n */\nexport type TLocaleValue = TLocaleData[keyof TLocaleData];\n\n// =============================================================================\n// Configuration Types\n// =============================================================================\n\n/**\n * External locale file reference using JSON Reference syntax.\n * The loader resolves these to TLocaleData at initialization.\n */\nexport interface ILocaleReference {\n /** URL or relative path to JSON locale file */\n $ref: string;\n}\n\n/**\n * Type guard for ILocaleReference\n */\nexport function isLocaleReference(\n value: TLocaleData | ILocaleReference\n): value is ILocaleReference {\n return (\n typeof value === 'object' &&\n value !== null &&\n '$ref' in value &&\n typeof (value as ILocaleReference).$ref === 'string'\n );\n}\n\n/**\n * A single locale entry can be inline data or an external reference.\n */\nexport type TLocaleEntry = TLocaleData | ILocaleReference;\n\n/**\n * Top-level configuration object for all locales.\n * Keys are language codes, values are inline data or external references.\n */\nexport interface ILocalesConfiguration {\n [locale: TLanguageCode]: TLocaleEntry;\n}\n\n// =============================================================================\n// LocaleManager Types\n// =============================================================================\n\n/**\n * Options for LocaleManager initialization.\n */\nexport interface ILocaleManagerOptions {\n /** Default locale to use at startup */\n defaultLocale: TLanguageCode;\n /** Enable debug mode (logs missing translation keys) */\n debug?: boolean;\n}\n\n/**\n * Events emitted by LocaleManager.\n */\nexport type LocaleEvents = {\n /** Emitted when locale changes: [newLocale, previousLocale] */\n change: [locale: TLanguageCode, previousLocale: TLanguageCode];\n};\n\n/**\n * Main LocaleManager interface.\n * Wraps rosetta with type safety and event emission.\n */\nexport interface ILocaleManager {\n // =========================================================================\n // State (read-only)\n // =========================================================================\n\n /** Current active locale */\n readonly locale: TLanguageCode;\n\n /** List of all loaded locale codes */\n readonly availableLocales: ReadonlyArray<TLanguageCode>;\n\n // =========================================================================\n // Translation\n // =========================================================================\n\n /**\n * Get translated string for key.\n *\n * @param key - Dot-notation key (e.g., 'nav.home') or array (['nav', 'home'])\n * @param params - Optional interpolation parameters\n * @param locale - Optional locale override (defaults to current locale)\n * @returns Translated string, or empty string if key not found\n */\n t(\n key: string | string[],\n params?: Record<string, unknown>,\n locale?: TLanguageCode\n ): string;\n\n // =========================================================================\n // Locale Management\n // =========================================================================\n\n /**\n * Change the active locale.\n * Emits 'change' event if locale differs from current.\n * Falls back to default locale if requested locale is unavailable.\n *\n * @param locale - New locale to activate\n */\n setLocale(locale: TLanguageCode): void;\n\n /**\n * Load or merge locale data.\n * Can be called after initialization to add translations.\n *\n * @param locale - Locale code to load data for\n * @param data - Translation data to merge\n */\n loadLocale(locale: TLanguageCode, data: TLocaleData): void;\n\n // =========================================================================\n // Events\n // =========================================================================\n\n /**\n * Subscribe to locale events.\n *\n * @param event - Event name ('change')\n * @param handler - Event handler function\n * @returns Unsubscribe function\n */\n on<K extends keyof LocaleEvents>(\n event: K,\n handler: (...args: LocaleEvents[K]) => void\n ): () => void;\n\n // =========================================================================\n // Lifecycle\n // =========================================================================\n\n /**\n * Clean up resources and remove all listeners.\n */\n destroy(): void;\n}\n\n// =============================================================================\n// LocaleLoader Types\n// =============================================================================\n\n/**\n * Options for LocaleLoader.\n */\nexport interface ILocaleLoaderOptions {\n /** Base URL for resolving relative paths */\n baseUrl?: string;\n /** Custom fetch function (for testing or SSR) */\n fetch?: typeof globalThis.fetch;\n}\n\n/**\n * Result of loading a locale file.\n */\nexport interface ILocaleLoadResult {\n locale: TLanguageCode;\n data: TLocaleData;\n}\n\n/**\n * LocaleLoader interface for resolving external locale references.\n */\nexport interface ILocaleLoader {\n /**\n * Load a single locale from external reference.\n *\n * @param locale - Locale code\n * @param reference - External reference to resolve\n * @returns Resolved locale data\n * @throws If file cannot be loaded or parsed\n */\n load(\n locale: TLanguageCode,\n reference: ILocaleReference\n ): Promise<ILocaleLoadResult>;\n\n /**\n * Load multiple locales in parallel.\n *\n * @param entries - Map of locale codes to references\n * @returns Array of resolved locale data\n */\n loadAll(\n entries: Map<TLanguageCode, ILocaleReference>\n ): Promise<ILocaleLoadResult[]>;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA+BA,SAAgB,2BAEd,WACA;AACA,KAAI,UAAU,eAAe,KAAK,MAAM;AACtC,OAAK,UAAU,KAAK,UAAU;AAC9B,SAAO;;AAGT,KAAI,UAAU,eAAe,KAAK,gBAAgB,KAAK,YAAY,EACjE,QAAO;AAGT,KAAI,UAAU,eAAe,KAAK,gBAAgB,KAAK,UAAU,EAC/D,MAAK,UAAU,KAAK,UAAU;AAGhC,QAAO;;;;;;;;;;;;;;;;;;;;;;;;AC7BT,SAAgB,sBACd,eACA,cACA;CACA,IAAI,SAAS;CAEb,MAAM,SAAS,cAAc,QAAQ,iBAAiB,MAAM,UAAU;AACpE,MAAI,CAAC,gBACH,OAAM,IAAI,MACR,mBAAmB,cAAc,KAAK,IAAI,CAAC,uBAC5C;AAGH,MAAI,UAAU,cAAc,SAAS,GAAG;GACtC,MAAM,QAAQ,KAAK,MAAM,IAAI;AAC7B,OAAI,MAAM,SAAS,GAAG;AACpB,WAAO,MAAM;AACb,aAAS,MAAM;;;AAGnB,SAAO,gBAAgB;IACtB,aAAa;AAEhB,QAAO,SAAS,GAAG,SAAS,WAAW;;;;;ACxCzC,MAAM,eACJ,OAAO,oBAAoB,cACvB,mBACI,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