eligius 1.1.4 → 1.1.5
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/README.md +8 -7
- package/dist/chunk-CTAAG5j7.js +13 -0
- package/dist/index.d.ts +2984 -22
- package/dist/index.js +5857 -7
- package/dist/index.js.map +1 -0
- package/package.json +53 -44
- package/dist/action/action.d.ts +0 -17
- package/dist/action/endable-action.d.ts +0 -9
- package/dist/action/index.d.ts +0 -3
- package/dist/action/timeline-action.d.ts +0 -14
- package/dist/action/types.d.ts +0 -17
- package/dist/build/generate-importer-source-code.d.ts +0 -15
- package/dist/build/index.d.ts +0 -1
- package/dist/configuration/api/action-creator-factory.d.ts +0 -31
- package/dist/configuration/api/action-editor.d.ts +0 -44
- package/dist/configuration/api/configuration-factory.d.ts +0 -135
- package/dist/configuration/api/index.d.ts +0 -7
- package/dist/configuration/api/label-editor.d.ts +0 -11
- package/dist/configuration/api/name-providers.d.ts +0 -13
- package/dist/configuration/api/subtitle-converter.d.ts +0 -11
- package/dist/configuration/api/subtitle-editor.d.ts +0 -24
- package/dist/configuration/api/timeline-provider-settings-editor.d.ts +0 -22
- package/dist/configuration/configuration-resolver.d.ts +0 -18
- package/dist/configuration/types.d.ts +0 -102
- package/dist/controllers/event-listener-controller.d.ts +0 -36
- package/dist/controllers/index.d.ts +0 -7
- package/dist/controllers/label-controller.d.ts +0 -31
- package/dist/controllers/lottie-controller.d.ts +0 -47
- package/dist/controllers/metadata/event-listener-controller.d.ts +0 -4
- package/dist/controllers/metadata/index.d.ts +0 -7
- package/dist/controllers/metadata/label-controller.d.ts +0 -4
- package/dist/controllers/metadata/lottie-controller.d.ts +0 -4
- package/dist/controllers/metadata/navigation-controller.d.ts +0 -4
- package/dist/controllers/metadata/progressbar-controller.d.ts +0 -4
- package/dist/controllers/metadata/routing-controller.d.ts +0 -4
- package/dist/controllers/metadata/subtitles-controller.d.ts +0 -4
- package/dist/controllers/metadata/types.d.ts +0 -6
- package/dist/controllers/navigation-controller.d.ts +0 -39
- package/dist/controllers/progressbar-controller.d.ts +0 -26
- package/dist/controllers/routing-controller.d.ts +0 -27
- package/dist/controllers/subtitles-controller.d.ts +0 -27
- package/dist/controllers/types.d.ts +0 -8
- package/dist/diagnostics/devtool-event-listener.d.ts +0 -7
- package/dist/diagnostics/diagnostics.d.ts +0 -5
- package/dist/diagnostics/index.d.ts +0 -3
- package/dist/diagnostics/types.d.ts +0 -28
- package/dist/eligius-engine.d.ts +0 -88
- package/dist/eligius-flow-controller.d.ts +0 -8
- package/dist/engine-factory.d.ts +0 -38
- package/dist/eventbus/actionregistry-eventbus-listener.d.ts +0 -11
- package/dist/eventbus/eventbus.d.ts +0 -18
- package/dist/eventbus/index.d.ts +0 -4
- package/dist/eventbus/request-video-uri-interceptor.d.ts +0 -6
- package/dist/eventbus/types.d.ts +0 -18
- package/dist/importer/eligius-resource-importer.d.ts +0 -9
- package/dist/importer/index.d.ts +0 -1
- package/dist/index.cjs +0 -6417
- package/dist/index.cjs.map +0 -7
- package/dist/index.cjs.min.js +0 -8
- package/dist/index.cjs.min.js.map +0 -7
- package/dist/index.esm.js +0 -8
- package/dist/index.esm.js.map +0 -7
- package/dist/language-manager.d.ts +0 -24
- package/dist/operation/add-class.d.ts +0 -14
- package/dist/operation/add-controller-to-element.d.ts +0 -15
- package/dist/operation/add-globals-to-operation.d.ts +0 -12
- package/dist/operation/animate-with-class.d.ts +0 -17
- package/dist/operation/animate.d.ts +0 -17
- package/dist/operation/broadcast-event.d.ts +0 -13
- package/dist/operation/calc.d.ts +0 -14
- package/dist/operation/clear-element.d.ts +0 -11
- package/dist/operation/clear-operation-data.d.ts +0 -10
- package/dist/operation/create-element.d.ts +0 -18
- package/dist/operation/custom-function.d.ts +0 -12
- package/dist/operation/end-action.d.ts +0 -17
- package/dist/operation/end-for-each.d.ts +0 -8
- package/dist/operation/end-when.d.ts +0 -8
- package/dist/operation/extend-controller.d.ts +0 -10
- package/dist/operation/for-each.d.ts +0 -19
- package/dist/operation/get-attributes-from-element.d.ts +0 -21
- package/dist/operation/get-controller-from-element.d.ts +0 -16
- package/dist/operation/get-controller-instance.d.ts +0 -17
- package/dist/operation/get-element-dimensions.d.ts +0 -30
- package/dist/operation/get-import.d.ts +0 -13
- package/dist/operation/get-query-params.d.ts +0 -28
- package/dist/operation/helper/attach-controller-to-element.d.ts +0 -3
- package/dist/operation/helper/deep-copy.d.ts +0 -1
- package/dist/operation/helper/find-matching-operation-index.d.ts +0 -35
- package/dist/operation/helper/get-element-data.d.ts +0 -7
- package/dist/operation/helper/get-property-chain-value.d.ts +0 -24
- package/dist/operation/helper/globals.d.ts +0 -4
- package/dist/operation/helper/internal-resolve.d.ts +0 -2
- package/dist/operation/helper/merge-operation-data.d.ts +0 -2
- package/dist/operation/helper/modify-dimensions.d.ts +0 -20
- package/dist/operation/helper/remove-event-data-from-operation-data.d.ts +0 -2
- package/dist/operation/helper/remove-global.d.ts +0 -1
- package/dist/operation/helper/resolve-event-arguments.d.ts +0 -2
- package/dist/operation/helper/resolve-external-property-chain.d.ts +0 -14
- package/dist/operation/helper/resolve-property-chain.d.ts +0 -23
- package/dist/operation/helper/resolve-property-values.d.ts +0 -11
- package/dist/operation/helper/set-global.d.ts +0 -1
- package/dist/operation/index.d.ts +0 -46
- package/dist/operation/invoke-object-method.d.ts +0 -28
- package/dist/operation/load-json.d.ts +0 -28
- package/dist/operation/log.d.ts +0 -8
- package/dist/operation/math.d.ts +0 -12
- package/dist/operation/metadata/add-class.d.ts +0 -4
- package/dist/operation/metadata/add-controller-to-element.d.ts +0 -4
- package/dist/operation/metadata/add-globals-to-operation.d.ts +0 -4
- package/dist/operation/metadata/animate-with-class.d.ts +0 -4
- package/dist/operation/metadata/animate.d.ts +0 -4
- package/dist/operation/metadata/broadcast-event.d.ts +0 -4
- package/dist/operation/metadata/calc.d.ts +0 -4
- package/dist/operation/metadata/clear-element.d.ts +0 -4
- package/dist/operation/metadata/clear-operation-data.d.ts +0 -4
- package/dist/operation/metadata/create-element.d.ts +0 -4
- package/dist/operation/metadata/custom-function.d.ts +0 -4
- package/dist/operation/metadata/end-action.d.ts +0 -4
- package/dist/operation/metadata/end-for-each.d.ts +0 -3
- package/dist/operation/metadata/end-when.d.ts +0 -3
- package/dist/operation/metadata/extend-controller.d.ts +0 -4
- package/dist/operation/metadata/for-each.d.ts +0 -4
- package/dist/operation/metadata/get-attributes-from-element.d.ts +0 -4
- package/dist/operation/metadata/get-controller-from-element.d.ts +0 -4
- package/dist/operation/metadata/get-controller-instance.d.ts +0 -4
- package/dist/operation/metadata/get-element-dimensions.d.ts +0 -4
- package/dist/operation/metadata/get-import.d.ts +0 -4
- package/dist/operation/metadata/get-query-params.d.ts +0 -4
- package/dist/operation/metadata/index.d.ts +0 -45
- package/dist/operation/metadata/invoke-object-method.d.ts +0 -4
- package/dist/operation/metadata/load-json.d.ts +0 -4
- package/dist/operation/metadata/log.d.ts +0 -3
- package/dist/operation/metadata/math.d.ts +0 -4
- package/dist/operation/metadata/otherwise.d.ts +0 -3
- package/dist/operation/metadata/remove-class.d.ts +0 -4
- package/dist/operation/metadata/remove-controller-from-element.d.ts +0 -4
- package/dist/operation/metadata/remove-element.d.ts +0 -4
- package/dist/operation/metadata/remove-properties-from-operation-data.d.ts +0 -4
- package/dist/operation/metadata/reparent-element.d.ts +0 -4
- package/dist/operation/metadata/request-action.d.ts +0 -4
- package/dist/operation/metadata/resize-action.d.ts +0 -4
- package/dist/operation/metadata/select-element.d.ts +0 -4
- package/dist/operation/metadata/set-data.d.ts +0 -4
- package/dist/operation/metadata/set-element-attributes.d.ts +0 -4
- package/dist/operation/metadata/set-element-content.d.ts +0 -4
- package/dist/operation/metadata/set-global-data.d.ts +0 -4
- package/dist/operation/metadata/set-operation-data.d.ts +0 -4
- package/dist/operation/metadata/set-style.d.ts +0 -4
- package/dist/operation/metadata/start-action.d.ts +0 -4
- package/dist/operation/metadata/toggle-class.d.ts +0 -4
- package/dist/operation/metadata/toggle-element.d.ts +0 -4
- package/dist/operation/metadata/types.d.ts +0 -29
- package/dist/operation/metadata/wait.d.ts +0 -4
- package/dist/operation/metadata/when.d.ts +0 -4
- package/dist/operation/otherwise.d.ts +0 -9
- package/dist/operation/remove-class.d.ts +0 -14
- package/dist/operation/remove-controller-from-element.d.ts +0 -14
- package/dist/operation/remove-element.d.ts +0 -13
- package/dist/operation/remove-properties-from-operation-data.d.ts +0 -12
- package/dist/operation/reparent-element.d.ts +0 -15
- package/dist/operation/request-action.d.ts +0 -14
- package/dist/operation/resize-action.d.ts +0 -12
- package/dist/operation/select-element.d.ts +0 -19
- package/dist/operation/set-data.d.ts +0 -21
- package/dist/operation/set-element-attributes.d.ts +0 -14
- package/dist/operation/set-element-content.d.ts +0 -21
- package/dist/operation/set-global-data.d.ts +0 -11
- package/dist/operation/set-operation-data.d.ts +0 -13
- package/dist/operation/set-style.d.ts +0 -15
- package/dist/operation/start-action.d.ts +0 -17
- package/dist/operation/toggle-class.d.ts +0 -23
- package/dist/operation/toggle-element.d.ts +0 -19
- package/dist/operation/types.d.ts +0 -55
- package/dist/operation/wait.d.ts +0 -14
- package/dist/operation/when.d.ts +0 -21
- package/dist/test/integration/create-language-selector.spec.d.ts +0 -1
- package/dist/test/integration/end-in-correct-order.spec.d.ts +0 -1
- package/dist/test/integration/for-each-loop.spec.d.ts +0 -1
- package/dist/test/integration/re-use-image-action.spec.d.ts +0 -1
- package/dist/test/integration/when-construction.spec.d.ts +0 -1
- package/dist/test/unit/action/action.spec.d.ts +0 -1
- package/dist/test/unit/build/generate-importer-source-code.spec.d.ts +0 -1
- package/dist/test/unit/chrono-trigger-engine.spec.d.ts +0 -1
- package/dist/test/unit/configuration/api/action-editor.spec.d.ts +0 -1
- package/dist/test/unit/configuration/api/configuration-factory.spec.d.ts +0 -1
- package/dist/test/unit/configuration/api/endable-action-editor.spec.d.ts +0 -1
- package/dist/test/unit/configuration/api/name-providers.spec.d.ts +0 -1
- package/dist/test/unit/configuration/api/subtitle-editor.spec.d.ts +0 -1
- package/dist/test/unit/configuration/api/timeline-action-editor.spec.d.ts +0 -1
- package/dist/test/unit/configuration/api/timeline-provider-settings-editor.spec.d.ts +0 -1
- package/dist/test/unit/configuration/configuration-resolver.spec.d.ts +0 -1
- package/dist/test/unit/controllers/EventListenerController.spec.d.ts +0 -1
- package/dist/test/unit/controllers/LabelController.spec.d.ts +0 -1
- package/dist/test/unit/engine-factory.spec.d.ts +0 -1
- package/dist/test/unit/eventbus/eventbus.spec.d.ts +0 -1
- package/dist/test/unit/importer/eligius-resource-importer.spec.d.ts +0 -1
- package/dist/test/unit/language-manager.spec.d.ts +0 -1
- package/dist/test/unit/operation/_operation-metadata.spec.d.ts +0 -1
- package/dist/test/unit/operation/add-class.spec.d.ts +0 -1
- package/dist/test/unit/operation/add-controller-to-element.spec.d.ts +0 -1
- package/dist/test/unit/operation/add-globals-to-operation.spec.d.ts +0 -1
- package/dist/test/unit/operation/animate-with-class.spec.d.ts +0 -1
- package/dist/test/unit/operation/animate.spec.d.ts +0 -1
- package/dist/test/unit/operation/broadcast-event.spec.d.ts +0 -1
- package/dist/test/unit/operation/calc.spec.d.ts +0 -1
- package/dist/test/unit/operation/clear-element.spec.d.ts +0 -1
- package/dist/test/unit/operation/clear-operation-data.spec.d.ts +0 -1
- package/dist/test/unit/operation/create-element.spec.d.ts +0 -1
- package/dist/test/unit/operation/custom-function.spec.d.ts +0 -1
- package/dist/test/unit/operation/end-action.spec.d.ts +0 -1
- package/dist/test/unit/operation/end-for-each.spec.d.ts +0 -1
- package/dist/test/unit/operation/end-when.spec.d.ts +0 -1
- package/dist/test/unit/operation/extend-controller.spec.d.ts +0 -1
- package/dist/test/unit/operation/for-each.spec.d.ts +0 -1
- package/dist/test/unit/operation/get-attributes-from-element.spec.d.ts +0 -1
- package/dist/test/unit/operation/get-controller-from-element.spec.d.ts +0 -1
- package/dist/test/unit/operation/get-controller-instance.spec.d.ts +0 -1
- package/dist/test/unit/operation/get-element-dimensions.spec.d.ts +0 -1
- package/dist/test/unit/operation/get-query-params.spec.d.ts +0 -1
- package/dist/test/unit/operation/helper/attach-controller-to-element.spec.d.ts +0 -1
- package/dist/test/unit/operation/helper/get-element-data.spec.d.ts +0 -1
- package/dist/test/unit/operation/helper/get-property-chain-value.spec.d.ts +0 -1
- package/dist/test/unit/operation/helper/globals.spec.d.ts +0 -1
- package/dist/test/unit/operation/helper/internal-resolve.spec.d.ts +0 -1
- package/dist/test/unit/operation/helper/merge-operation-data.spec.d.ts +0 -1
- package/dist/test/unit/operation/helper/modify-dimensions.spec.d.ts +0 -1
- package/dist/test/unit/operation/helper/remove-event-data-from-operation-data.spec.d.ts +0 -1
- package/dist/test/unit/operation/helper/remove-global.spec.d.ts +0 -1
- package/dist/test/unit/operation/helper/resolve-event-arguments.spec.d.ts +0 -1
- package/dist/test/unit/operation/helper/resolve-external-property-chain.spec.d.ts +0 -1
- package/dist/test/unit/operation/helper/resolve-property-values.spec.d.ts +0 -1
- package/dist/test/unit/operation/helper/set-global.spec.d.ts +0 -1
- package/dist/test/unit/operation/invoke-object-method.spec.d.ts +0 -1
- package/dist/test/unit/operation/load-json.spec.d.ts +0 -1
- package/dist/test/unit/operation/log.spec.d.ts +0 -1
- package/dist/test/unit/operation/math.spec.d.ts +0 -1
- package/dist/test/unit/operation/otherwise.spec.d.ts +0 -1
- package/dist/test/unit/operation/remove-class.spec.d.ts +0 -1
- package/dist/test/unit/operation/remove-properties-from-operation-data.spec.d.ts +0 -1
- package/dist/test/unit/operation/reparent-element.spec.d.ts +0 -1
- package/dist/test/unit/operation/request-action.spec.d.ts +0 -1
- package/dist/test/unit/operation/resize-action.spec.d.ts +0 -1
- package/dist/test/unit/operation/select-element.spec.d.ts +0 -1
- package/dist/test/unit/operation/set-data.spec.d.ts +0 -1
- package/dist/test/unit/operation/set-element-attributes.spec.d.ts +0 -1
- package/dist/test/unit/operation/set-element-content.spec.d.ts +0 -1
- package/dist/test/unit/operation/set-global-data.spec.d.ts +0 -1
- package/dist/test/unit/operation/set-operation-data.spec.d.ts +0 -1
- package/dist/test/unit/operation/set-style.spec.d.ts +0 -1
- package/dist/test/unit/operation/start-action.spec.d.ts +0 -1
- package/dist/test/unit/operation/toggle-class.spec.d.ts +0 -1
- package/dist/test/unit/operation/toggle-element.spec.d.ts +0 -1
- package/dist/test/unit/operation/wait.spec.d.ts +0 -1
- package/dist/test/unit/operation/when.spec.d.ts +0 -1
- package/dist/test/unit/timelineproviders/request-animation-frame-timeline-provider.spec.d.ts +0 -1
- package/dist/test/unit/util/prepare-value-for-serialization.spec.d.ts +0 -1
- package/dist/timeline-event-names.d.ts +0 -81
- package/dist/timelineproviders/index.d.ts +0 -2
- package/dist/timelineproviders/request-animation-frame-timeline-provider.d.ts +0 -40
- package/dist/timelineproviders/types.d.ts +0 -21
- package/dist/timelineproviders/video-js-timeline-provider.d.ts +0 -39
- package/dist/tools/doc-tools/generate-readmes.d.ts +0 -1
- package/dist/tools/schema-tools/generate-operation-schemas.d.ts +0 -1
- package/dist/tools/schema-tools/html-tag-names.d.ts +0 -1
- package/dist/types.d.ts +0 -103
- package/dist/util/animation-interval.d.ts +0 -1
- package/dist/util/apply-operation.d.ts +0 -3
- package/dist/util/camel-case-to-dash.d.ts +0 -1
- package/dist/util/dash-to-camel-case.d.ts +0 -1
- package/dist/util/guards/is-function.d.ts +0 -1
- package/dist/util/guards/is-object.d.ts +0 -1
- package/dist/util/guards/is-promise.d.ts +0 -1
- package/dist/util/guards/is-string.d.ts +0 -1
- package/dist/util/prepare-value-for-serialization.d.ts +0 -1
package/dist/index.cjs.min.js
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
"use strict";var hi=Object.create;var Ne=Object.defineProperty;var gi=Object.getOwnPropertyDescriptor;var vi=Object.getOwnPropertyNames;var Ii=Object.getPrototypeOf,Ei=Object.prototype.hasOwnProperty;var ke=(n,e)=>()=>(e||n((e={exports:{}}).exports,e),e.exports),J=(n,e)=>{for(var t in e)Ne(n,t,{get:e[t],enumerable:!0})},Tn=(n,e,t,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of vi(e))!Ei.call(n,i)&&i!==t&&Ne(n,i,{get:()=>e[i],enumerable:!(r=gi(e,i))||r.enumerable});return n};var b=(n,e,t)=>(t=n!=null?hi(Ii(n)):{},Tn(e||!n||!n.__esModule?Ne(t,"default",{value:n,enumerable:!0}):t,n)),yi=n=>Tn(Ne({},"__esModule",{value:!0}),n);var Fe=ke(_=>{"use strict";Object.defineProperty(_,"__esModule",{value:!0});_.hasValueAtKey=_.hasPresentKey=_.isFilled=_.isDefined=_.isPresent=void 0;function Ti(n){return n!=null}_.isPresent=Ti;function Oi(n){return n!==void 0}_.isDefined=Oi;function xi(n){return n!==null}_.isFilled=xi;function Ci(n){return function(e){return e[n]!==void 0&&e[n]!==null}}_.hasPresentKey=Ci;function _i(n,e){return function(t){return t[n]===e}}_.hasValueAtKey=_i});var Br=ke((ed,Wr)=>{"use strict";var pn=typeof navigator<"u"&&0<navigator.userAgent.toLowerCase().indexOf("firefox");function un(n,e,t,r){n.addEventListener?n.addEventListener(e,t,r):n.attachEvent&&n.attachEvent("on".concat(e),function(){t(window.event)})}function Gr(n,e){for(var t=e.slice(0,e.length-1),r=0;r<t.length;r++)t[r]=n[t[r].toLowerCase()];return t}function Hr(n){for(var e=(n=(n=typeof n!="string"?"":n).replace(/\s/g,"")).split(","),t=e.lastIndexOf("");0<=t;)e[t-1]+=",",e.splice(t,1),t=e.lastIndexOf("");return e}function ea(n,e){for(var t=n.length<e.length?e:n,r=n.length<e.length?n:e,i=!0,o=0;o<t.length;o++)~r.indexOf(t[o])||(i=!1);return i}for(oe={backspace:8,"\u232B":8,tab:9,clear:12,enter:13,"\u21A9":13,return:13,esc:27,escape:27,space:32,left:37,up:38,right:39,down:40,del:46,delete:46,ins:45,insert:45,home:36,end:35,pageup:33,pagedown:34,capslock:20,num_0:96,num_1:97,num_2:98,num_3:99,num_4:100,num_5:101,num_6:102,num_7:103,num_8:104,num_9:105,num_multiply:106,num_add:107,num_enter:108,num_subtract:109,num_decimal:110,num_divide:111,"\u21EA":20,",":188,".":190,"/":191,"`":192,"-":pn?173:189,"=":pn?61:187,";":pn?59:186,"'":222,"[":219,"]":221,"\\":220},P={"\u21E7":16,shift:16,"\u2325":18,alt:18,option:18,"\u2303":17,ctrl:17,control:17,"\u2318":91,cmd:91,command:91},ze={16:"shiftKey",18:"altKey",17:"ctrlKey",91:"metaKey",shiftKey:16,ctrlKey:17,altKey:18,metaKey:91},y={16:!1,18:!1,17:!1,91:!1},v={},_e=1;_e<20;_e++)oe["f".concat(_e)]=111+_e;var oe,P,ze,y,v,_e,d=[],qr=!1,Vr="all",zr=[],De=function(n){return oe[n.toLowerCase()]||P[n.toLowerCase()]||n.toUpperCase().charCodeAt(0)},ta=function(n){return Object.keys(oe).find(function(e){return oe[e]===n})},na=function(n){return Object.keys(P).find(function(e){return P[e]===n})};function Jr(n){Vr=n||"all"}function Ae(){return Vr||"all"}function ra(){return d.slice(0)}function ia(){return d.map(function(n){return ta(n)||na(n)||String.fromCharCode(n)})}function oa(){var n=[];return Object.keys(v).forEach(function(e){v[e].forEach(function(t){var r=t.key;n.push({scope:t.scope,shortcut:t.shortcut,mods:t.mods,keys:r.split("+").map(function(i){return De(i)})})})}),n}function aa(e){var e=e.target||e.srcElement,t=e.tagName;return!!(!e.isContentEditable&&(t!=="INPUT"&&t!=="TEXTAREA"&&t!=="SELECT"||e.readOnly))}function sa(n){return typeof n=="string"&&(n=De(n)),!!~d.indexOf(n)}function la(n,e){var t,r,i;for(i in n=n||Ae(),v)if(Object.prototype.hasOwnProperty.call(v,i))for(t=v[i],r=0;r<t.length;)t[r].scope===n?t.splice(r,1):r++;Ae()===n&&Jr(e||"all")}function ca(n){var e=n.keyCode||n.which||n.charCode,t=d.indexOf(e);if(t<0||d.splice(t,1),n.key&&n.key.toLowerCase()=="meta"&&d.splice(0,d.length),(e=e!==93&&e!==224?e:91)in y)for(var r in y[e]=!1,P)P[r]===e&&(L[r]=!1)}function pa(n){if(n===void 0)Object.keys(v).forEach(function(a){return delete v[a]});else if(Array.isArray(n))n.forEach(function(a){a.key&&mn(a)});else if(typeof n=="object")n.key&&mn(n);else if(typeof n=="string"){for(var e=arguments.length,t=Array(1<e?e-1:0),r=1;r<e;r++)t[r-1]=arguments[r];var i=t[0],o=t[1];typeof i=="function"&&(o=i,i=""),mn({key:n,scope:i,method:o,splitKey:"+"})}}var mn=function(n){var e=n.scope,t=n.method,r=n.splitKey,i=r===void 0?"+":r;Hr(n.key).forEach(function(s){var a,s=s.split(i),c=s.length,p=s[c-1],p=p==="*"?"*":De(p);v[p]&&(e=e||Ae(),a=1<c?Gr(P,s):[],v[p]=v[p].filter(function(u){return!((!t||u.method===t)&&u.scope===e&&ea(u.mods,a))}))})};function $r(n,e,t,r){var i;if(e.element===r&&(e.scope===t||e.scope==="all")){for(var o in i=0<e.mods.length,y)Object.prototype.hasOwnProperty.call(y,o)&&(!y[o]&&~e.mods.indexOf(+o)||y[o]&&!~e.mods.indexOf(+o))&&(i=!1);(e.mods.length!==0||y[16]||y[18]||y[17]||y[91])&&!i&&e.shortcut!=="*"||(e.keys=[],e.keys=e.keys.concat(d),e.method(n,e)===!1&&(n.preventDefault?n.preventDefault():n.returnValue=!1,n.stopPropagation&&n.stopPropagation(),n.cancelBubble)&&(n.cancelBubble=!0))}}function Qr(n,e){var t=v["*"],r=n.keyCode||n.which||n.charCode;if(L.filter.call(this,n)){if(~d.indexOf(r=r!==93&&r!==224?r:91)||r===229||d.push(r),["ctrlKey","altKey","shiftKey","metaKey"].forEach(function(A){var C=ze[A];n[A]&&!~d.indexOf(C)?d.push(C):!n[A]&&~d.indexOf(C)?d.splice(d.indexOf(C),1):A!=="metaKey"||!n[A]||d.length!==3||n.ctrlKey||n.shiftKey||n.altKey||(d=d.slice(d.indexOf(C)))}),r in y){for(var i in y[r]=!0,P)P[i]===r&&(L[i]=!0);if(!t)return}for(var o in y)Object.prototype.hasOwnProperty.call(y,o)&&(y[o]=n[ze[o]]);n.getModifierState&&(!n.altKey||n.ctrlKey)&&n.getModifierState("AltGraph")&&(~d.indexOf(17)||d.push(17),~d.indexOf(18)||d.push(18),y[17]=!0,y[18]=!0);var a=Ae();if(t)for(var s=0;s<t.length;s++)t[s].scope===a&&(n.type==="keydown"&&t[s].keydown||n.type==="keyup"&&t[s].keyup)&&$r(n,t[s],a,e);if(r in v){for(var c=0;c<v[r].length;c++)if((n.type==="keydown"&&v[r][c].keydown||n.type==="keyup"&&v[r][c].keyup)&&v[r][c].key){for(var p=v[r][c],u=p.key.split(p.splitKey),m=[],E=0;E<u.length;E++)m.push(De(u[E]));m.sort().join("")===d.sort().join("")&&$r(n,p,a,e)}}}}function ua(n){return!!~zr.indexOf(n)}function L(n,e,t){d=[];var r=Hr(n),i=[],o="all",a=document,s=0,c=!1,p=!0,u="+",m=!1;for(t===void 0&&typeof e=="function"&&(t=e),Object.prototype.toString.call(e)==="[object Object]"&&(e.scope&&(o=e.scope),e.element&&(a=e.element),e.keyup&&(c=e.keyup),e.keydown!==void 0&&(p=e.keydown),e.capture!==void 0&&(m=e.capture),typeof e.splitKey=="string")&&(u=e.splitKey),typeof e=="string"&&(o=e);s<r.length;s++)i=[],1<(n=r[s].split(u)).length&&(i=Gr(P,n)),(n=(n=n[n.length-1])==="*"?"*":De(n))in v||(v[n]=[]),v[n].push({keyup:c,keydown:p,scope:o,mods:i,shortcut:r[s],method:t,key:r[s],splitKey:u,element:a});a!==void 0&&!ua(a)&&window&&(zr.push(a),un(a,"keydown",function(E){Qr(E,a)},m),qr||(qr=!0,un(window,"focus",function(){d=[]},m)),un(a,"keyup",function(E){Qr(E,a),ca(E)},m))}function ma(n){var e=1<arguments.length&&arguments[1]!==void 0?arguments[1]:"all";Object.keys(v).forEach(function(t){v[t].filter(function(r){return r.scope===e&&r.shortcut===n}).forEach(function(r){r&&r.method&&r.method()})})}var Ve,Kr,dn={getPressedKeyString:ia,setScope:Jr,getScope:Ae,deleteScope:la,getPressedKeyCodes:ra,getAllKeyCodes:oa,isPressed:sa,filter:aa,trigger:ma,unbind:pa,keyMap:oe,modifier:P,modifierMap:ze};for(Ve in dn)Object.prototype.hasOwnProperty.call(dn,Ve)&&(L[Ve]=dn[Ve]);typeof window<"u"&&(Kr=window.hotkeys,L.noConflict=function(n){return n&&window.hotkeys===L&&(window.hotkeys=Kr),L},window.hotkeys=L),Wr.exports=L});var si=ke((td,ai)=>{"use strict";var fn=typeof navigator<"u"?navigator.userAgent.toLowerCase().indexOf("firefox")>0:!1;function hn(n,e,t,r){n.addEventListener?n.addEventListener(e,t,r):n.attachEvent&&n.attachEvent("on".concat(e),function(){t(window.event)})}function ti(n,e){for(var t=e.slice(0,e.length-1),r=0;r<t.length;r++)t[r]=n[t[r].toLowerCase()];return t}function ni(n){typeof n!="string"&&(n=""),n=n.replace(/\s/g,"");for(var e=n.split(","),t=e.lastIndexOf("");t>=0;)e[t-1]+=",",e.splice(t,1),t=e.lastIndexOf("");return e}function da(n,e){for(var t=n.length>=e.length?n:e,r=n.length>=e.length?e:n,i=!0,o=0;o<t.length;o++)r.indexOf(t[o])===-1&&(i=!1);return i}var Re={backspace:8,"\u232B":8,tab:9,clear:12,enter:13,"\u21A9":13,return:13,esc:27,escape:27,space:32,left:37,up:38,right:39,down:40,del:46,delete:46,ins:45,insert:45,home:36,end:35,pageup:33,pagedown:34,capslock:20,num_0:96,num_1:97,num_2:98,num_3:99,num_4:100,num_5:101,num_6:102,num_7:103,num_8:104,num_9:105,num_multiply:106,num_add:107,num_enter:108,num_subtract:109,num_decimal:110,num_divide:111,"\u21EA":20,",":188,".":190,"/":191,"`":192,"-":fn?173:189,"=":fn?61:187,";":fn?59:186,"'":222,"[":219,"]":221,"\\":220},S={"\u21E7":16,shift:16,"\u2325":18,alt:18,option:18,"\u2303":17,ctrl:17,control:17,"\u2318":91,cmd:91,command:91},In={16:"shiftKey",18:"altKey",17:"ctrlKey",91:"metaKey",shiftKey:16,ctrlKey:17,altKey:18,metaKey:91},T={16:!1,18:!1,17:!1,91:!1},I={};for(Pe=1;Pe<20;Pe++)Re["f".concat(Pe)]=111+Pe;var Pe,f=[],Yr=!1,ri="all",ii=[],we=function(e){return Re[e.toLowerCase()]||S[e.toLowerCase()]||e.toUpperCase().charCodeAt(0)},fa=function(e){return Object.keys(Re).find(function(t){return Re[t]===e})},ha=function(e){return Object.keys(S).find(function(t){return S[t]===e})};function oi(n){ri=n||"all"}function Se(){return ri||"all"}function ga(){return f.slice(0)}function va(){return f.map(function(n){return fa(n)||ha(n)||String.fromCharCode(n)})}function Ia(){var n=[];return Object.keys(I).forEach(function(e){I[e].forEach(function(t){var r=t.key,i=t.scope,o=t.mods,a=t.shortcut;n.push({scope:i,shortcut:a,mods:o,keys:r.split("+").map(function(s){return we(s)})})})}),n}function Ea(n){var e=n.target||n.srcElement,t=e.tagName,r=!0;return(e.isContentEditable||(t==="INPUT"||t==="TEXTAREA"||t==="SELECT")&&!e.readOnly)&&(r=!1),r}function ya(n){return typeof n=="string"&&(n=we(n)),f.indexOf(n)!==-1}function ba(n,e){var t,r;n||(n=Se());for(var i in I)if(Object.prototype.hasOwnProperty.call(I,i))for(t=I[i],r=0;r<t.length;)t[r].scope===n?t.splice(r,1):r++;Se()===n&&oi(e||"all")}function Ta(n){var e=n.keyCode||n.which||n.charCode,t=f.indexOf(e);if(t>=0&&f.splice(t,1),n.key&&n.key.toLowerCase()==="meta"&&f.splice(0,f.length),(e===93||e===224)&&(e=91),e in T){T[e]=!1;for(var r in S)S[r]===e&&(N[r]=!1)}}function Oa(n){if(typeof n>"u")Object.keys(I).forEach(function(a){return delete I[a]});else if(Array.isArray(n))n.forEach(function(a){a.key&&gn(a)});else if(typeof n=="object")n.key&&gn(n);else if(typeof n=="string"){for(var e=arguments.length,t=new Array(e>1?e-1:0),r=1;r<e;r++)t[r-1]=arguments[r];var i=t[0],o=t[1];typeof i=="function"&&(o=i,i=""),gn({key:n,scope:i,method:o,splitKey:"+"})}}var gn=function(e){var t=e.key,r=e.scope,i=e.method,o=e.splitKey,a=o===void 0?"+":o,s=ni(t);s.forEach(function(c){var p=c.split(a),u=p.length,m=p[u-1],E=m==="*"?"*":we(m);if(I[E]){r||(r=Se());var A=u>1?ti(S,p):[];I[E]=I[E].filter(function(C){var q=i?C.method===i:!0;return!(q&&C.scope===r&&da(C.mods,A))})}})};function Xr(n,e,t,r){if(e.element===r){var i;if(e.scope===t||e.scope==="all"){i=e.mods.length>0;for(var o in T)Object.prototype.hasOwnProperty.call(T,o)&&(!T[o]&&e.mods.indexOf(+o)>-1||T[o]&&e.mods.indexOf(+o)===-1)&&(i=!1);(e.mods.length===0&&!T[16]&&!T[18]&&!T[17]&&!T[91]||i||e.shortcut==="*")&&(e.keys=[],e.keys=e.keys.concat(f),e.method(n,e)===!1&&(n.preventDefault?n.preventDefault():n.returnValue=!1,n.stopPropagation&&n.stopPropagation(),n.cancelBubble&&(n.cancelBubble=!0)))}}}function Zr(n,e){var t=I["*"],r=n.keyCode||n.which||n.charCode;if(N.filter.call(this,n)){if((r===93||r===224)&&(r=91),f.indexOf(r)===-1&&r!==229&&f.push(r),["ctrlKey","altKey","shiftKey","metaKey"].forEach(function(C){var q=In[C];n[C]&&f.indexOf(q)===-1?f.push(q):!n[C]&&f.indexOf(q)>-1?f.splice(f.indexOf(q),1):C==="metaKey"&&n[C]&&f.length===3&&(n.ctrlKey||n.shiftKey||n.altKey||(f=f.slice(f.indexOf(q))))}),r in T){T[r]=!0;for(var i in S)S[i]===r&&(N[i]=!0);if(!t)return}for(var o in T)Object.prototype.hasOwnProperty.call(T,o)&&(T[o]=n[In[o]]);n.getModifierState&&!(n.altKey&&!n.ctrlKey)&&n.getModifierState("AltGraph")&&(f.indexOf(17)===-1&&f.push(17),f.indexOf(18)===-1&&f.push(18),T[17]=!0,T[18]=!0);var a=Se();if(t)for(var s=0;s<t.length;s++)t[s].scope===a&&(n.type==="keydown"&&t[s].keydown||n.type==="keyup"&&t[s].keyup)&&Xr(n,t[s],a,e);if(r in I){for(var c=0;c<I[r].length;c++)if((n.type==="keydown"&&I[r][c].keydown||n.type==="keyup"&&I[r][c].keyup)&&I[r][c].key){for(var p=I[r][c],u=p.splitKey,m=p.key.split(u),E=[],A=0;A<m.length;A++)E.push(we(m[A]));E.sort().join("")===f.sort().join("")&&Xr(n,p,a,e)}}}}function xa(n){return ii.indexOf(n)>-1}function N(n,e,t){f=[];var r=ni(n),i=[],o="all",a=document,s=0,c=!1,p=!0,u="+",m=!1;for(t===void 0&&typeof e=="function"&&(t=e),Object.prototype.toString.call(e)==="[object Object]"&&(e.scope&&(o=e.scope),e.element&&(a=e.element),e.keyup&&(c=e.keyup),e.keydown!==void 0&&(p=e.keydown),e.capture!==void 0&&(m=e.capture),typeof e.splitKey=="string"&&(u=e.splitKey)),typeof e=="string"&&(o=e);s<r.length;s++)n=r[s].split(u),i=[],n.length>1&&(i=ti(S,n)),n=n[n.length-1],n=n==="*"?"*":we(n),n in I||(I[n]=[]),I[n].push({keyup:c,keydown:p,scope:o,mods:i,shortcut:r[s],method:t,key:r[s],splitKey:u,element:a});typeof a<"u"&&!xa(a)&&window&&(ii.push(a),hn(a,"keydown",function(E){Zr(E,a)},m),Yr||(Yr=!0,hn(window,"focus",function(){f=[]},m)),hn(a,"keyup",function(E){Zr(E,a),Ta(E)},m))}function Ca(n){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"all";Object.keys(I).forEach(function(t){var r=I[t].filter(function(i){return i.scope===e&&i.shortcut===n});r.forEach(function(i){i&&i.method&&i.method()})})}var vn={getPressedKeyString:va,setScope:oi,getScope:Se,deleteScope:ba,getPressedKeyCodes:ga,getAllKeyCodes:Ia,isPressed:ya,filter:Ea,trigger:Ca,unbind:Oa,keyMap:Re,modifier:S,modifierMap:In};for(Je in vn)Object.prototype.hasOwnProperty.call(vn,Je)&&(N[Je]=vn[Je]);var Je;typeof window<"u"&&(ei=window.hotkeys,N.noConflict=function(n){return n&&window.hotkeys===N&&(window.hotkeys=ei),N},window.hotkeys=N);var ei;ai.exports=N});var li=ke((nd,En)=>{process.env.NODE_ENV==="production"?En.exports=Br():En.exports=si()});var Aa={};J(Aa,{Action:()=>F,ActionCreator:()=>le,ActionCreatorFactory:()=>se,ActionEditor:()=>ne,ActionRegistryEventbusListener:()=>H,ConfigurationFactory:()=>Zt,ConfigurationResolver:()=>re,ControllerNamesProvider:()=>tn,DEV_TOOLS_KEY:()=>Me,DevToolEventListener:()=>X,Diagnostics:()=>h,EligiusEngine:()=>ie,EligiusResourceImporter:()=>Le,EndableAction:()=>U,EndableActionCreator:()=>te,EndableActionEditor:()=>Q,EngineFactory:()=>We,EventListenerController:()=>ve,Eventbus:()=>V,LabelController:()=>Ie,LanguageManager:()=>ae,LottieController:()=>Ee,NavigationController:()=>ye,OperationEditor:()=>K,OperationMetadataProvider:()=>nn,OperationNamesProvider:()=>en,ProgressbarController:()=>be,RequestAnimationFrameTimelineProvider:()=>ue,RequestVideoUriInterceptor:()=>z,RoutingController:()=>Te,SubtitleEditor:()=>sn,SubtitleImporter:()=>on,SubtitlesController:()=>Oe,TimeLineEventNamesProvider:()=>rn,TimelineAction:()=>Z,TimelineActionCreator:()=>Ke,TimelineActionEditor:()=>pe,TimelineEventNames:()=>l,TimelineProviderSettingsEditor:()=>he,TimelineProvidersSettingsEditor:()=>fe,VideoJsTimelineProvider:()=>me,addClass:()=>it,addControllerToElement:()=>ot,animate:()=>at,animateWithClass:()=>st,broadcastEvent:()=>lt,calc:()=>pt,clearElement:()=>ut,clearOperationData:()=>mt,createElement:()=>ft,customFunction:()=>ht,endAction:()=>gt,endForEach:()=>vt,endWhen:()=>It,extendController:()=>Et,forEach:()=>Be,generateImporterSourceCode:()=>Pn,getAttributesFromElement:()=>yt,getControllerFromElement:()=>bt,getControllerInstance:()=>Tt,getElementDimensions:()=>Ot,getImport:()=>xt,getQueryParams:()=>Ct,invokeObjectMethod:()=>_t,loadJSON:()=>Dt,log:()=>Pt,math:()=>Rt,metadata:()=>Ce,otherwise:()=>St,removeClass:()=>wt,removeControllerFromElement:()=>Lt,removeElement:()=>Nt,removePropertiesFromOperationData:()=>kt,reparentElement:()=>Mt,requestAction:()=>Ft,resizeAction:()=>Ut,selectElement:()=>jt,setData:()=>qt,setElementAttributes:()=>$t,setElementContent:()=>Qt,setGlobalData:()=>Kt,setOperationData:()=>Gt,setStyle:()=>Ht,startAction:()=>Vt,toggleClass:()=>zt,toggleElement:()=>Jt,wait:()=>Wt,when:()=>et});module.exports=yi(Aa);var On=b(require("jquery"));function W(n){return typeof n=="function"}function B(n){return n!==null&&typeof n=="object"}function Y(n){if(Array.isArray(n))return n.map(Y);if(n instanceof On.default)return"jQuery object";if(B(n)){if(n.constructor.toString().substring(0,5)==="class"||!n.constructor.toString().startsWith("function Object()")){let e=n.constructor.toString();return e.substring(0,e.indexOf("{")+1)}return Object.fromEntries(Object.entries(n).map(([e,t])=>[e,Y(t)]))}else if(W(n)){let e=n.toString();return e.indexOf("{")>-1?e.substring(0,e.indexOf("{")+1):e}return n}var X=class{constructor(e){this.agent=e}handleEvent(e,t,r){let i={eventName:e,eventTopic:t,args:Y(r)};try{this.agent.postMessage("eligius-diagnostics-event",i)}catch(o){console.error("postmessage failed"),console.error(o),console.log("message",i)}}};var h=class{static send(e,t){console.log(e,t)}};var Me="__ELIGIUS_DEV_TOOLS__";function $(n){return n.systemName===this.self?(this.counter=this.counter+1,!1):n.systemName===this.matchingName&&this.counter===0?!0:(n.systemName===this.matchingName&&this.counter>0&&(this.counter=this.counter-1),!1)}var Be=function(n){let{collection:e}=n;if(e!==null&&!Array.isArray(e))throw new Error("Expected collection to be array type, string value was probably not resolved correctly");return this.loopIndex===void 0&&(this.loopEndIndex=bi(this),e?.length?(this.loopIndex=0,this.loopLength=e.length-1,this.loopStartIndex=this.currentIndex):(this.newIndex=this.loopEndIndex,delete this.loopIndex,delete this.loopLength,delete this.loopStartIndex,delete this.loopEndIndex)),e?.length&&this.loopIndex!==void 0&&(this.currentItem=e[this.loopIndex]),n};function bi(n){let e=n.currentIndex+1,r=n.operations.slice(e).findIndex($.bind({counter:0,self:Ye,matchingName:Xe}));return r>-1?r+e:n.operations.length}var Ye="forEach",Xe="endForEach";var xn=b(Fe()),Ai=typeof structuredClone<"u"?structuredClone:n=>JSON.parse(JSON.stringify(n));function g(n){return(0,xn.isDefined)(n)?Ai(n):n}function w(n){return typeof n=="string"}function k(n,e){let t=e,r=null;return n.forEach((i,o)=>{if(!t)throw new Error(`Property chain '${n.join(".")}' cannot be resolved.`);if(o===n.length-1){let a=i.split("+");a.length>1&&(i=a[0],r=a[1])}t=t[i]}),r?`${t}${r}`:t}var Ze={};function Di(n,e){let t=e?n[e]:n;return t&&t!==n?g(t):t}function Pi(n,e){Object.entries(e).forEach(([t,r])=>n[t]=r)}function Ri(n){Object.keys(n).forEach(t=>delete n[t])}var M=Di.bind(null,Ze),Cn=Pi.bind(null,Ze),Ba=Ri.bind(null,Ze);function D(n,e,t){if(w(t)){let r=t.split(".");switch(r.shift()?.toLowerCase()){case"operationdata":return k(r,n);case"globaldata":return k(r,M());case"context":return k(r,e)}}return t}var et=function(n){let[e,t,r]=Si(n.expression,n,this);return this.whenEvaluation=wi[t](e,r),this.whenEvaluation||(this.newIndex=Li(this)),delete n.expression,n};function Si(n,e,t){let[r,i]=n.split(/!=|==|>=|<=|>|</),o=n.substring(r.length,n.length-i.length),a=+r,s=+i;return[isNaN(a)?D(e,t,r):a,o,isNaN(s)?D(e,t,i):s]}var wi={"==":(n,e)=>n===e,"!=":(n,e)=>n!==e,">=":(n,e)=>n>=e,"<=":(n,e)=>n<=e,">":(n,e)=>n>e,"<":(n,e)=>n<e};function Li(n){let e=n.currentIndex+1,t=n.operations.slice(e),r=t.findIndex($.bind({counter:0,self:Ue,matchingName:Ni}));if(r>-1)return r+e;let i=t.findIndex($.bind({counter:0,self:Ue,matchingName:tt}));return i>-1?i+e:n.operations.length}var Ue="when",Ni="otherwise",tt="endWhen";function _n(n){return typeof n=="object"&&typeof n.then=="function"}var F=class{constructor(e,t,r){this.name=e;this.startOperations=t;this.eventbus=r;this.id="";this._contextStack=[]}start(e){h.active&&h.send("eligius-diagnostics-action",`${this.name??"Action"} begins executing start operations`),this._initializeContextStack();let t=new Promise((r,i)=>{this.executeOperation(this.startOperations,0,r,i,e)}).catch(r=>{throw h.active&&h.send("eligius-diagnostics-action-error",{name:this.name,error:r}),console.error(`Error in action start '${this.name}'`),console.error(r),r});return h.active?t.then(r=>(h.send("eligius-diagnostics-action",`${this.name??"Action"} finished executing start operations`),r)):t}_initializeContextStack(){this._contextStack=[{currentIndex:-1,eventbus:this.eventbus,operations:this.startOperations}]}_pushContext(e){let t={get currentIndex(){return e.currentIndex},set currentIndex(r){e.currentIndex=r},get eventbus(){return e.eventbus},get operations(){return e.operations},parent:e};return this._contextStack.push(t),t}_popContext(){this._contextStack.pop()}executeOperation(e,t,r,i,o={}){let a=this._contextStack[this._contextStack.length-1];if(a.newIndex!==void 0&&(t=a.newIndex,delete a.newIndex),a.currentIndex=t,t<e.length){let s=e[t],c=g(s.operationData??{}),p=Object.assign(o,c);s.systemName===Ue?a=this._pushContext(a):s.systemName===Ye&&a.owner!==s&&(a=this._pushContext(a),a.owner=s),h.active&&h.send("eligius-diagnostics-operation",{systemName:s.systemName,operationData:p,context:{...a,eventbus:void 0}});let u=s.instance.call(a,p);(s.systemName===tt||s.systemName===Xe&&a.newIndex===void 0)&&this._popContext(),_n(u)?u.then(m=>this.executeOperation(e,++t,r,i,m)).catch(m=>{i(m)}):this.executeOperation(e,++t,r,i,u)}else r(o)}};var U=class extends F{constructor(t,r,i,o){super(t,r,o);this.endOperations=i}end(t){if(h.active&&h.send("eligius-diagnostics-action",`${this.name??"Action"} begins executing end operations`),!this.endOperations.length)return Promise.resolve(t??{});this._initializeContextStack();let r=new Promise((i,o)=>{this.executeOperation(this.endOperations,0,i,o,t)}).catch(i=>{throw h.active&&h.send("eligius-diagnostics-action-error",{name:this.name,error:i}),console.error(`Error in action end '${this.name}'`),i});return h.active?r.then(i=>(h.send("eligius-diagnostics-action",`${this.name??"Action"} finished executing start operations`),i)):r}};var Z=class extends U{constructor(t,r,i,o,a){super(t,r,i,a);this.duration=o;this._active=!1}get active(){return this._active}start(t){return this.active?Promise.resolve({}):(this._active=!!this.endOperations.length,super.start(t))}end(t){return super.end(t).then(r=>(this._active=!1,r))}};var Dn=b(require("fs")),rt=b(require("path"));function nt(n){return n.replace(/-([a-z])/g,e=>e[1].toUpperCase())}function Pn(n,e,t){let r=Mi(n,e,t);return ki(r)}function ki(n){let e=n.filter(t=>t.defaultImport).map(t=>`import ${t.systemName} from '${t.path}';`).concat(n.filter(t=>!t.defaultImport).map(t=>`import {${t.systemName}} from '${t.path??"eligius"}';`));return e.push("import { ISimpleResourceImporter } from 'eligius';"),e.push(""),e.push("const imports: Record<string, any> = {"),e.push(...n.map(t=>`${t.systemName}: { '${t.systemName}': ${t.systemName} },`)),e.push("};"),e.push(""),e.push("class EligiusResourceImporter implements ISimpleResourceImporter {"),e.push("import(name: string): Record<string, any> {"),e.push("if (imports.hasOwnProperty(name)) { return imports[name]; }"),e.push("throw Error(`Unknown systemName: ${name}`);"),e.push("}}"),e.push(""),e.push("export default EligiusResourceImporter;"),e.join(`
|
|
2
|
-
`)}function Mi(n,e,t){return[...$i(n),...t.flatMap(r=>Fi(e,r.path,r.extension)),...Ui(n),...ji(n),...qi(n)]}function Fi(n,e,t){return Dn.default.readdirSync(rt.default.join(n,e)).map(i=>({systemName:`${nt(rt.default.basename(i,t))}`,path:`./${e}/${i}`,defaultImport:!0}))}function Ui(n){let e=[];return e.push(...je(n.initActions)),e.push(...je(n.actions)),e.push(...je(n.timelines.flatMap(t=>t.timelineActions))),e.push(...je(n.eventActions)),e=Rn(e),e}function ji(n){return n.timelineProviderSettings?Object.values(n.timelineProviderSettings).map(e=>({systemName:e.systemName})):[]}function qi(n){if(n.engine){let{systemName:e}=n.engine;return[{systemName:e}]}return[]}function $i(n){let e=An(n.initActions.concat(n.actions).concat(n.eventActions??[]));if(n.timelines){let t=n.timelines.flatMap(r=>r.timelineActions);e=e.concat(An(t))}return Rn(e)}function je(n){if(!n)return[];let e=n.flatMap(t=>[...t.startOperations,...t.endOperations??[]]);return Qi(e)}function An(n){if(!n)return[];let e=n.flatMap(t=>[...t.startOperations,...t.endOperations??[]]);return Ki(e)}function Qi(n){return n?n.filter(e=>e.operationData?.hasOwnProperty("systemName")?e.operationData.systemName.endsWith("Controller"):!1).map(e=>{let{systemName:t}=e.operationData??{};return{systemName:t}}):[]}function Ki(n){return n?n.map(e=>{let{systemName:t}=e;return{systemName:t}}):[]}function Rn(n){let e={};return n.filter(t=>e[t.systemName]?!1:(e[t.systemName]=!0,!0))}var Qe=require("uuid");var x={};J(x,{addClass:()=>it,addControllerToElement:()=>ot,animate:()=>at,animateWithClass:()=>st,broadcastEvent:()=>lt,calc:()=>pt,clearElement:()=>ut,clearOperationData:()=>mt,createElement:()=>ft,customFunction:()=>ht,endAction:()=>gt,endForEach:()=>vt,endWhen:()=>It,extendController:()=>Et,forEach:()=>Be,getAttributesFromElement:()=>yt,getControllerFromElement:()=>bt,getControllerInstance:()=>Tt,getElementDimensions:()=>Ot,getImport:()=>xt,getQueryParams:()=>Ct,invokeObjectMethod:()=>_t,loadJSON:()=>Dt,log:()=>Pt,math:()=>Rt,otherwise:()=>St,removeClass:()=>wt,removeControllerFromElement:()=>Lt,removeElement:()=>Nt,removePropertiesFromOperationData:()=>kt,reparentElement:()=>Mt,requestAction:()=>Ft,resizeAction:()=>Ut,selectElement:()=>jt,setData:()=>qt,setElementAttributes:()=>$t,setElementContent:()=>Qt,setGlobalData:()=>Kt,setOperationData:()=>Gt,setStyle:()=>Ht,startAction:()=>Vt,toggleClass:()=>zt,toggleElement:()=>Jt,wait:()=>Wt,when:()=>et});var it=function(n){let{selectedElement:e,className:t}=n;return e.addClass(t),n};var qe="eligiusEngineControllers";function Gi(n,e){return e.data(n)}var ee=Gi.bind(null,qe);function Sn(n,e){n.data(qe)||n.data(qe,[]);let t=ee(n);t&&t.push(e)}function j(n,e){return{...n,...e}}function O(n,e,t){n(t?j(e,t):e)}var ot=function(n){let{selectedElement:e,controllerInstance:t}=n;Sn(e,t),t.init(n);let r=t.attach(this.eventbus);return r?new Promise((i,o)=>{r.then(a=>{O(i,n,a)},o)}):n};var at=function(n){let{animationEasing:e,selectedElement:t,animationProperties:r,animationDuration:i}=n;return new Promise((a,s)=>{try{e?t.animate(r,i,e,()=>{O(a,{},n)}):t.animate(r,i,()=>{O(a,{},n)})}catch(c){s(c)}})};var st=function(n){let{selectedElement:e,className:t,removeClass:r}=n;r=r!==void 0?r:!0;let i=new Promise((o,a)=>{try{e.one("webkitAnimationEnd oanimationend oAnimationEnd msAnimationEnd animationEnd",()=>{r&&e.removeClass(t),O(o,{},n)})}catch(s){a(s)}});return e.addClass(t),i};function wn(n){delete n.eventName,delete n.eventTopic,delete n.eventArgs}function Ln(n,e,t){if(!t)return;let r=D.bind(null,n,e);return t.map(r)}var lt=function(n){let{eventArgs:e,eventTopic:t,eventName:r}=n,i=Ln(n,this,e);return t?this.eventbus.broadcastForTopic(r,t,i):this.eventbus.broadcast(r,i),wn(n),n};var Nn=b(require("jquery"));var $e=[];function R(n,e,t){let r=t!==n?g(t):t,i=D.bind(null,n,e);return ct(t,r,i),r}function ct(n,e,t){if(!($e.indexOf(n)>-1)){$e.push(n);try{Object.entries(n).forEach(([r,i])=>{i instanceof Nn.default||(w(i)?e[r]=t(i):Array.isArray(i)?i.forEach((o,a,s)=>{w(o)?s[a]=t(o):ct(o,o,t)}):B(i)?ct(i,i,t):e[r]=i)})}finally{let r=$e.indexOf(n);$e.splice(r,1)}}}var Hi={"+":(n,e)=>n+e,"-":(n,e)=>n-e,"*":(n,e)=>n*e,"/":(n,e)=>n/e,"%":(n,e)=>n%e,"**":(n,e)=>n**e},pt=function(n){n=R(n,this,n);let{left:e,right:t,operator:r}=n;return n.calculationResult=Hi[r](+e,+t),n};var ut=function(n){let{selectedElement:e}=n;return e.empty(),n};var mt=function(n){let{properties:e}=n;return e?(e.forEach(t=>{delete n[t]}),delete n.properties,n):{}};var dt=b(require("jquery"));var ft=function(n){n=R(n,this,n);let{elementName:e,attributes:t,text:r}=n,i=t?` ${Object.entries(t).filter(([a,s])=>!!s).map(([a,s])=>`${a}="${s}"`).join(" ")}`:"",o=r?(0,dt.default)(`<${e}${i}>${r}</${e}>`):(0,dt.default)(`<${e}${i}/>`);return n.template=o,n};var l=class{static{this.PLAY_TOGGLE_REQUEST="timeline-play-toggle-request"}static{this.PLAY_REQUEST="timeline-play-request"}static{this.STOP_REQUEST="timeline-stop-request"}static{this.PAUSE_REQUEST="timeline-pause-request"}static{this.SEEK_REQUEST="timeline-seek-request"}static{this.RESIZE_REQUEST="timeline-resize-request"}static{this.CONTAINER_REQUEST="timeline-container-request"}static{this.DURATION_REQUEST="timeline-duration-request"}static{this.REQUEST_CURRENT_TIMELINE="timeline-request-current-timeline"}static{this.DURATION="timeline-duration"}static{this.TIME="timeline-time"}static{this.SEEKED="timeline-seeked"}static{this.COMPLETE="timeline-complete"}static{this.RESTART="timeline-restart"}static{this.PLAY="timeline-play"}static{this.STOP="timeline-stop"}static{this.PAUSE="timeline-pause"}static{this.SEEK="timeline-seek"}static{this.RESIZE="timeline-resize"}static{this.CURRENT_TIMELINE_CHANGE="timeline-current-timeline-change"}static{this.FIRST_FRAME="timeline-firstframe"}static{this.REQUEST_INSTANCE="request-instance"}static{this.REQUEST_ACTION="request-action"}static{this.REQUEST_FUNCTION="request-function"}static{this.REQUEST_TIMELINE_URI="request-timeline-uri"}static{this.BEFORE_REQUEST_TIMELINE_URI="before-request-timeline-uri"}static{this.REQUEST_ENGINE_ROOT="request-engine-root"}static{this.REQUEST_CURRENT_TIMELINE_POSITION="request-current-timeline-position"}static{this.REQUEST_TIMELINE_CLEANUP="request-timeline-cleanup"}static{this.REQUEST_LABEL_COLLECTION="request-label-collection"}static{this.REQUEST_LABEL_COLLECTIONS="request-label-collections"}static{this.REQUEST_CURRENT_LANGUAGE="request-current-language"}static{this.LANGUAGE_CHANGE="language-change"}};var ht=function(n){let{systemName:e}=n;return new Promise((t,r)=>{let i=o=>{let a=o.apply(this,[n]);a?a.then(()=>{O(t,{},n)},r):O(t,{},n)};this.eventbus.broadcast(l.REQUEST_FUNCTION,[e,i])})};var gt=function(n){let{actionInstance:e,actionOperationData:t}=n;return delete n.actionOperationData,new Promise((r,i)=>{n=j(n,t),e.end(n).then(()=>{Object.keys(t).forEach(o=>{delete n[o]}),O(r,n)},i)})};var vt=function(n){return this.loopIndex!==void 0&&this.loopLength!==void 0&&this.loopIndex<this.loopLength&&(this.loopIndex=this.loopIndex+1,this.newIndex=this.loopStartIndex,delete this.currentItem),n};var It=function(n){return delete this.whenEvaluation,n};var Et=function(n){let{controllerInstance:e,controllerExtension:t}=n;return n.controllerInstance=Object.assign(e,t),n};var yt=function(n){let{selectedElement:e,attributeNames:t}=n;return n.attributeValues=t.reduce((r,i)=>(i!=="value"?r[i]=e?.attr(i):r[i]=e?.val(),r),{}),n};var bt=function(n){let{selectedElement:e,controllerName:t}=n,i=ee(e)?.find(o=>o.name===t);return i||console.warn(`controller for name '${t}' was not found on the given element`),n.controllerInstance=i,n};var Tt=function(n){let{systemName:e}=n;n.controllerInstance=void 0;let t=r=>{n.controllerInstance=r};return this.eventbus.broadcast(l.REQUEST_INSTANCE,[e,t]),n};function Vi(n,e){let t={...e},r=n.substring(0,1),i=n.substring(n.indexOf("[")+1,n.indexOf("]")-(n.indexOf("[")-1)),o=i.split("=")[1].split("-");if(o.filter(Boolean).length!==2)throw new Error(`Badly formatted modifier, expect two ratios: ${i}`);return r==="h"?t.height=t.width/+o[0]*+o[1]:r==="w"&&(t.width=t.height/+o[1]*+o[0]),t}function zi(n){let e=1,t=n.substring(n.length-e,n.length);t!=="h"&&t!=="w"&&t!=="%"&&(t=null);let r=t==="%";return r&&(t=n.substring(n.length-e,n.length-(e+1)),t!=="h"&&t!=="w"&&(t=null)),[t,e,r]}function Ji(n,e,t,r,i){let o={...n};switch(e){case"+":switch(t){case"h":o.height+=i;break;case"w":o.width+=r;break;default:o.height+=i,o.width+=r}break;case"-":switch(t){case"h":o.height-=i;break;case"w":o.width-=r;break;default:o.height-=i,o.width-=r}break;case"/":switch(t){case"h":o.height/=i;break;case"w":o.width/=r;break;default:o.height/=i,o.width/=r}break;case"*":switch(t){case"h":o.height*=i;break;case"w":o.width*=r;break;default:o.height*=i,o.width*=r}break;default:console.error(`Unknown operator found: ${e}`)}return o}function kn(n,e){let t={...n},r=null;e.indexOf("|")>-1&&([e,r]=e.split("|"));let i=e.substring(0,1),[o,a,s]=zi(e),c=parseInt(o!==null?e.substring(1,e.length-(a-1)):e.substring(1),10),p=c,u=c;s&&(p=t.width/100*c,u=t.height/100*c);let m=Ji(t,i,o,p,u);return r?Vi(r,m):m}var Ot=function(n){let{selectedElement:e,modifier:t}=n,r={width:e.innerWidth()??0,height:e.innerHeight()??0};return r.height===0&&(r.height=r.width),t&&(r=kn(r,t)),n.dimensions=r,n};var xt=function(n){let{systemName:e}=n,t=r=>{n.importedInstance=r};return this.eventbus.broadcast(l.REQUEST_FUNCTION,[e,t]),delete n.systemName,n};var Ct=function(n){let e=new URLSearchParams(window.location.search),t=Object.fromEntries(e.entries()),{defaultValues:r={}}=n;return delete n.defaultValues,n.queryParams={...r,...t},n};var _t=function(n){let{methodName:e,methodArguments:t}=n;return delete n.methodName,delete n.methodArguments,n.methodResult=n.instance[e].apply(n.instance,t??[]),n};var At={};var Wi=(n,e)=>{At[n]=e},Dt=async function(n){let{url:e,cache:t}=n;if(t&&At[e])return n.json=At[e],n;let i=await(await fetch(e)).json(),o=n.json=i;return t&&Wi(e,o),n};var Pt=function(n){let e=M();return console.group("Operation info"),console.log("context",this),console.log("operationData",n),console.log("globalData",e),console.groupEnd(),n};var Rt=function(n){n=R(n,this,n),n.args=Bi(n.args);let{args:e,functionName:t}=n;return n.mathResult=Math[t].apply(null,e),n};function Bi(n){return n.map(e=>Yi(e)?Math[e]:e)}function Yi(n){return w(n)&&n in Math&&!W(Math[n])}var St=function(n){return this.whenEvaluation&&(this.newIndex=Xi(this)),n};function Xi(n){let e=n.currentIndex+1,r=n.operations.slice(e).findIndex($.bind({counter:0,self:"when",matchingName:"endWhen"}));return r>-1?r+e:n.operations.length}var wt=function(n){let{selectedElement:e,className:t}=n;return e.removeClass(t),n};var Lt=function(n){let{selectedElement:e,controllerName:t}=n,r=ee(e),i=r?.find(o=>o.name===t);if(i&&r){let o=r.indexOf(i);r.splice(o,1),i.detach(this.eventbus)}else console.warn(`controller for name '${t}' was not found on the given element`);return n};var Nt=function(n){let{selectedElement:e}=n;return e.remove(),n};var kt=function(n){let{propertyNames:e}=n;return e.indexOf("propertyNames")<0&&e.push("propertyNames"),Object.fromEntries(Object.entries(n).filter(([t,r])=>!e.includes(t)))};var Mt=function(n){let{selectedElement:e,newParentSelector:t}=n;return e.remove().appendTo(t),n};var Ft=function(n){let{systemName:e}=n,t=r=>{n.actionInstance=r};return this.eventbus.broadcast(l.REQUEST_ACTION,[e,t]),n};var Ut=function(n){let{actionInstance:e,actionOperationData:t}=n;return n=j(n,t),e.resize?e.resize(n):n};function Mn(n,e){let t=n.find(e);return t.length||console.warn(`selector '${e}' wasn't found!`),t}var jt=function(n){n.selector=D(n,this,n.selector);let{selector:e,useSelectedElementAsRoot:t=!1}=n;if(!e)throw new Error("selectElement: selector is either empty or not defined.");if(t&&n.selectedElement){let i=n.selectedElement;return n.selectedElement=Mn(i,e),n}let r=i=>{n.selectedElement=Mn(i,e)};return this.eventbus.broadcast(l.REQUEST_ENGINE_ROOT,[r]),n};var qt=function(n){let{properties:e}=n;return delete n.properties,Zi(e,n,this),n};function Zi(n,e,t){return Object.keys(n).forEach(i=>{let o=i.split("."),a=o.shift()?.toLowerCase()??"";if(!eo(a))throw new Error(`Unrecognized target: ${a}, known targets are: ${Fn.join(", ")}`);let s=o.pop()??"",c=D(e,t,n[i]),p={context:t,operationdata:e,globaldata:M()},u=k(o,p[a]);u[s]=c})}var Fn=["context","operationdata","globaldata"];function eo(n){return Fn.includes(n)}var $t=function(n){let{attributes:e,selectedElement:t}=n;return t.attr(e),n};var Qt=function(n){let{insertionType:e="overwrite",selectedElement:t,template:r}=n;switch(!0){case e==="overwrite":t.html(r);break;case e==="append":t.append(r);break;case e==="prepend":t.prepend(r);break}return delete n.insertionType,n};var Kt=function(n){let{properties:e}=n,t=Object.fromEntries(Object.entries(n).filter(([r,i])=>e.includes(r)));return Cn(t),delete n.properties,n};var Gt=function(n){let{override:e=!1,properties:t}=n;delete n.properties,delete n.override;let r=R(n,this,t);return e?r:{...n,...r}};var Ht=function(n){let e=R(n,this,n.properties);return n.selectedElement.css(e),n};var Vt=function(n){let{actionInstance:e,actionOperationData:t}=n;return delete n.actionOperationData,new Promise((r,i)=>{n=j(n,t),e.start(n).then(()=>{Object.keys(t).forEach(o=>{delete n[o]}),O(r,n)},i)})};var zt=function(n){let{selectedElement:e,className:t}=n;return e.toggleClass(t),n};var Jt=function(e){return e.selectedElement.toggle(),e};var Wt=function(n){let{milliseconds:e}=n;return new Promise(t=>{setTimeout(()=>{O(t,n)},e)})};var se=class{constructor(e){this.configurationfactory=e}createAction(e){let t=new te(e,this);return this.configurationfactory.addAction(t.actionConfig),t}createInitAction(e){let t=new te(e,this);return this.configurationfactory.addInitAction(t.actionConfig),t}createEventAction(e){let t=new le(e,this);return this.configurationfactory.addEventAction(t.actionConfig),t}createTimelineAction(e,t){let r=new Ke(t,this);return this.configurationfactory.addTimelineAction(e,r.actionConfig),r}end(){return this.configurationfactory}},le=class{constructor(e,t){this.factory=t;this.actionConfig={name:"",id:(0,Qe.v4)(),startOperations:[]},e?.length&&(this.actionConfig.name=e)}getId(){return this.actionConfig.id}setName(e){return this.actionConfig.name=e,this}getConfiguration(e){let t=g(this.actionConfig),r=e.call(this,t);return r&&(this.actionConfig=r),this}addStartOperationByType(e,t){let r=Object.entries(x).find(([,i])=>i===e);if(r)return this.addStartOperation(r[0],t);throw new Error(`Operation class not found: ${e.toString()}`)}addStartOperation(e,t){if(!x[e])throw Error(`Unknown operation: ${e}`);let{startOperations:r}=this.actionConfig;return r.push({id:(0,Qe.v4)(),systemName:e,operationData:t}),this}next(){return this.factory}},te=class extends le{constructor(e,t){super(e,t),this.actionConfig.endOperations=[]}addEndOperationByType(e,t){let r=Object.entries(x).find(([,i])=>i===e);if(r)return this.addEndOperation(r[0],t);throw new Error(`Operation class not found: ${e.toString()}`)}addEndOperation(e,t){if(!x[e])throw Error(`Unknown operation: ${e}`);let{endOperations:r}=this.actionConfig;return r||(r=this.actionConfig.endOperations=[]),r.push({id:(0,Qe.v4)(),systemName:e,operationData:t}),this}},Ke=class extends te{addDuration(e,t){return this.actionConfig.duration={start:e},t&&(this.actionConfig.duration.end=t),this}};var ce=b(Fe()),Bt=require("uuid");function Un(n,e,t){t>=n.length?t=0:t<0&&(t=n.length-1),n.splice(t,0,n.splice(e,1)[0])}var ne=class{constructor(e,t){this.actionConfig=e;this.configurationFactory=t}updateConfiguration(){this.actionConfig={...this.actionConfig}}getConfiguration(e){let t=g(this.actionConfig),r=e.call(this,t);return r&&(this.actionConfig=r),this}setName(e){return this.actionConfig={...this.actionConfig,name:e},this}getName(){return this.actionConfig.name}addStartOperationByType(e,t){let r=Object.entries(x).find(([,i])=>i===e);if(r)return this.addStartOperation(r[0],t);throw new Error(`Operation class not found: ${e.toString()}`)}addStartOperation(e,t,r){if(!x[e])throw Error(`Unknown operation: ${e}`);let i=this.actionConfig.startOperations?this.actionConfig.startOperations.slice():[],o={id:r??(0,Bt.v4)(),systemName:e,operationData:t};return i.push(o),this.actionConfig={...this.actionConfig,startOperations:i},new K(o,this)}editStartOperation(e){let{startOperations:t}=this.actionConfig,r=t.find(i=>i.id===e);if((0,ce.isDefined)(r))return new K(r,this);throw new Error(`start operation not found for id ${e}`)}removeStartOperation(e){let t=this.actionConfig.startOperations?this.actionConfig.startOperations.slice():[],r=t.find(o=>o.id===e);if(!r)throw new Error(`start operation not found for id ${e}`);let i=t.indexOf(r);return i>-1&&(t.splice(i,1),this.actionConfig={...this.actionConfig,startOperations:t}),this}moveStartOperation(e,t){let r=this.actionConfig.startOperations?this.actionConfig.startOperations.slice():[],i=r.find(a=>a.id===e);if(!i)throw new Error(`start operation not found for id ${e}`);let o=r.indexOf(i);if(o>-1){let a=t==="up"?o+1:o-1;Un(r,o,a),this.actionConfig={...this.actionConfig,startOperations:r}}return this}next(){return this.configurationFactory}},Q=class extends ne{addEndOperationByType(e,t){let r=Object.entries(x).find(([,i])=>i===e);if(r)return this.addEndOperation(r[0],t);throw new Error(`Operation class not found: ${e.toString()}`)}addEndOperation(e,t){if(!x[e])throw Error(`Unknown operation: ${e}`);let r=this.actionConfig.endOperations?this.actionConfig.endOperations.slice():[],i={id:(0,Bt.v4)(),systemName:e,operationData:t};return r.push(i),this.actionConfig.endOperations=r,new K(i,this)}editEndOperation(e){let{endOperations:t}=this.actionConfig,r=t.find(i=>i.id===e);if((0,ce.isDefined)(r))return new K(r,this);throw new Error(`operation not found for id ${e}`)}removeEndOperation(e){let t=this.actionConfig.endOperations?this.actionConfig.endOperations.slice():[],r=t.find(o=>o.id===e);if(!(0,ce.isDefined)(r))throw new Error(`operation not found for id ${e}`);let i=t.indexOf(r);return i>-1&&(t.splice(i,1),this.actionConfig={...this.actionConfig,endOperations:t}),this}moveEndOperation(e,t){let r=this.actionConfig.endOperations?this.actionConfig.endOperations.slice():[],i=r.find(a=>a.id===e);if(!(0,ce.isDefined)(i))throw new Error(`operation not found for id ${e}`);let o=r.indexOf(i);if(o>-1){let a=t==="up"?o+1:o-1;Un(r,o,a),this.actionConfig={...this.actionConfig,endOperations:r}}return this}},pe=class extends Q{setDuration(e,t){if(t!=null&&e>t)throw Error("start position cannot be higher than end position");let r={start:e};return t&&(r.end=t),this.actionConfig={...this.actionConfig,duration:r},this}},K=class{constructor(e,t){this.operationConfig=e;this.actionEditor=t}getConfiguration(e){let t=g(this.operationConfig),r=e.call(this,t);return r&&(this.operationConfig=r),this}getSystemName(){return this.operationConfig.systemName}setSystemName(e){if(!x[e])throw Error(`Unknown operation: ${e}`);return this.operationConfig.systemName=e,this.actionEditor.updateConfiguration(),this}setOperationData(e){return this.operationConfig.operationData=e,this.actionEditor.updateConfiguration(),this}setOperationDataItem(e,t){let{operationData:r={}}=this.operationConfig;return r[e]=t,this.setOperationData(r)}getOperationDataKeys(){let{operationData:e}=this.operationConfig;return e?Object.keys(e):[]}getOperationDataValue(e){let{operationData:t}=this.operationConfig;return t?.[e]}next(){return this.actionEditor}};var ge=require("uuid");var Ge=class{constructor(e,t){this.factory=e;this.languageLabel=t}_internalGetLabel(e){return this.languageLabel.labels.find(t=>t.languageCode===e)}setLabel(e,t){let r=this._internalGetLabel(e);if(r)r.label;else throw new Error(`No label found for language code '${e}'`);return this}removeLabel(e){let t=this.languageLabel.labels.findIndex(r=>r.languageCode===e);if(t>-1)this.languageLabel.labels.splice(t,1);else throw new Error(`No label found for language code '${e}'`);return this}end(){return this.factory}};var Qn=require("uuid");var de={};J(de,{RequestAnimationFrameTimelineProvider:()=>ue,VideoJsTimelineProvider:()=>me});var qn=b(require("jquery"));function jn(n,e,t){let r=document?.timeline?.currentTime,i=r?Number(r):performance.now();function o(s){e.aborted||(t(s),a(s))}function a(s){let c=s-i,p=Math.round(c/n)*n,m=i+p+n-performance.now();setTimeout(()=>requestAnimationFrame(o),m)}a(i)}var ue=class{constructor(e){this._currentPosition=0;this._updateBound=this._update.bind(this);this._firstFramePending=!0;this._tickInterval=1e3;this.loop=!1;this._playState="stopped";this._playlist=this._extractPlaylist(e),this._currentPlaylistItem=this._playlist[0]}get playState(){return this._playState}_extractPlaylist(e){return e.timelines.filter(r=>r.type==="animation")}onTime(e){this._onTime=e}onComplete(e){this._onComplete=e}onRestart(e){this._onRestart=e}onFirstFrame(e){this._onFirstFrame=e}playlistItem(e){if(e===null||!e.length||this._playlist.length===0)return;let t=this._playlist.find(r=>r.uri===e);if(!t)throw new Error(`Unknown playlist uri: ${e}`);this._currentPlaylistItem=t}_update(e){if(this.playState==="running"){if(this._currentPosition++,this._currentPosition>this._currentPlaylistItem.duration)if(this.loop)this._resetToStartPosition(),this._onRestart?.(),this._callbackPosition();else{this.stop(),this._onComplete?.();return}this._callbackPosition()}}_callbackPosition(){this._onTime?.(this._currentPosition)}start(){if(this.playState==="running"){this._currentPosition==0&&this._callbackPosition();return}this._playState="running",this._abortController?.abort(),this._abortController=new AbortController,this._firstFramePending&&(this._firstFramePending=!1,this._onFirstFrame?.()),this._currentPosition==0&&this._callbackPosition(),jn(this._tickInterval,this._abortController.signal,this._updateBound)}_resetToStartPosition(){this._currentPosition=0}getContainer(){return this._containerElement}_stopAnimationInterval(e=!0){this._abortController?.abort(),this._abortController=void 0,e&&this._resetToStartPosition()}init(){if(this._currentPlaylistItem=this._playlist[0],this._containerElement=(0,qn.default)(this._currentPlaylistItem.selector),!this._containerElement.length)throw new Error(`timeline selector '${this._currentPlaylistItem.selector}' not found`);return Promise.resolve()}destroy(){this.stop(),this._containerElement=void 0}stop(){this._stopAnimationInterval(),this._playState="stopped"}pause(){this._stopAnimationInterval(!1),this._playState="stopped"}seek(e){return e<0||e>this._currentPlaylistItem.duration?Promise.resolve(this._currentPosition):(this._currentPosition=e,Promise.resolve(e))}getPosition(){return this._currentPosition}getDuration(){return this._currentPlaylistItem.duration}};var Yt=b(require("jquery")),$n=require("uuid"),Xt=b(require("video.js")),me=class{constructor(e){this.config=e;this._videoElementId=(0,$n.v4)();this._eventHandlers=[];this._playState="stopped";this.loop=!1;this._urls=[]}get playState(){return this._playState}init(){Xt.default.log.level("all");let e=this.config.timelineProviderSettings.mediaplayer?.selector??"";this._urls=this._extractUrls(this.config),this._addVideoElements(e,this._urls);let t=this;return new Promise(i=>{setTimeout(()=>{this._player=(0,Xt.default)(this._videoElementId,{controls:!1,controlBar:!1,liveui:!1,autoplay:!1,preload:"auto",loop:this.loop,src:this._urls[0]},function(){this.one("firstplay",()=>t._onFirstFrame?.()),this.one("canplay",()=>i()),t._addPlayerListener(this,"ended",t._handleEnded.bind(t)),t._addPlayerListener(this,"timeupdate",t._handleTimeUpdate.bind(t)),this.load()})},0)})}_addPlayerListener(e,t,r){e.on(t,r),this._eventHandlers.push(()=>e.off(t,r))}_handleEnded(){this._player?.loop?this._onRestart?.():this._onComplete?.()}_handleTimeUpdate(){if(this._player){let e=this._player.currentTime();e!==void 0&&this._onTime?.(e)}}start(){this._player?.play()}stop(){this._player?.pause(),this._player?.currentTime(0)}pause(){this._player?.pause()}seek(e){return new Promise(t=>{this._player.one("seeked",()=>{t(this._player?.currentTime()??0)}),this._player?.currentTime(e)})}playlistItem(e){this._urls.includes(e)&&this._player?.selectSource([e])}getPosition(){return this._player?.currentTime()??0}getDuration(){return this._player?.duration()??0}getContainer(){let e=this.config.timelineProviderSettings.mediaplayer?.selector??"";return(0,Yt.default)(e)}destroy(){this._eventHandlers.forEach(e=>e()),this._eventHandlers.length=0}onTime(e){this._onTime=e}onComplete(e){this._onComplete=e}onRestart(e){this._onRestart=e}onFirstFrame(e){this._onFirstFrame=e}_extractUrls(e){return e.timelines.filter(r=>r.type==="mediaplayer").map(r=>r.uri)}_addVideoElements(e,t){let r=[`<video id=${this._videoElementId}>`];t.forEach(i=>{r.push(`<source src='${i}' type='${this._extractFileType(i)}'/>`)}),r.push("</video>"),(0,Yt.default)(e).append(r.join(""))}_extractFileType(e){let t=e.lastIndexOf(".");return`video/${e.substring(t+1)}`}};var fe=class{constructor(e,t){this.providersSettings=e;this.configurationFactory=t}addProvider(e){if(this.providersSettings[e])throw new Error(`Settings for a '${e}' provider already exist`);let t={id:(0,Qn.v4)(),poster:void 0,selector:void 0,systemName:"",vendor:""};return this.providersSettings[e]=t,new he(t,this,this.configurationFactory)}editProvider(e){if(!this.providersSettings[e])throw new Error(`No settings for a '${e}' provider exist yet`);return new he(this.providersSettings[e],this,this.configurationFactory)}next(){return this.configurationFactory}},he=class{constructor(e,t,r){this.providerSettings=e;this.providersSettingsEditor=t;this.configurationFactory=r}setVendor(e){return this.providerSettings.vendor=e,this}setSelector(e){return this.providerSettings.selector=e,this}setSystemName(e){if(!de[e])throw new Error(`Unknown timeline provider system name: ${e}`);return this.providerSettings.systemName=e,this}next(){return this.providersSettingsEditor}end(){return this.configurationFactory}};var Zt=class n{constructor(e){this.configuration=e||{},this.actionCreatorFactory=new se(this)}static extend(e,t,r){return e[t]=r.bind(e),e}static extendMultiple(e,t){return Object.entries(t).forEach(([r,i])=>n.extend(e,r,i)),e}init(e){return this.configuration={id:(0,ge.v4)(),engine:{systemName:"EligiusEngine"},containerSelector:"[data-ct-container=true]",timelineProviderSettings:{},language:e,availableLanguages:[],layoutTemplate:"",initActions:[],actions:[],timelines:[],labels:[]},this}setEngine(e){return this.configuration.engine.systemName=e,this}setLayoutTemplate(e){return this.configuration.layoutTemplate=e,this}setDefaultLanguage(e){return this.configuration.language=e,this}setContainerSelector(e){return this.configuration.containerSelector=e,this}editTimelineProviderSettings(){return new fe(this.configuration.timelineProviderSettings||{},this)}getConfiguration(e){let t=g(this.configuration);if(e){let r=e.call(this,t);this.configuration=g(r)}return t}addLanguage(e,t){let r=this._initializeCollection(this.configuration,"availableLanguages");if(r.find(o=>o.languageCode===e))throw new Error(`Language code '${e}' already exists`);return r.push({id:(0,ge.v4)(),languageCode:e,label:t}),this}_internalAddAction(e,t){this._initializeCollection(this.configuration,e)?.push(t)}_initializeCollection(e,t){return e[t]||(e[t]=[]),e[t]}addAction(e){this._internalAddAction("actions",e)}addInitAction(e){this._internalAddAction("initActions",e)}addEventAction(e){this._internalAddAction("eventActions",e)}addTimelineAction(e,t){let r=this.getTimeline(e);if(r)this._initializeCollection(r,"timelineActions").push(t);else throw Error(`No timeline found for uri '${e}'`)}createAction(e){return this.actionCreatorFactory.createAction(e)}createInitAction(e){return this.actionCreatorFactory.createInitAction(e)}createEventAction(e){return this.actionCreatorFactory.createEventAction(e)}createTimelineAction(e,t){return this.actionCreatorFactory.createTimelineAction(e,t)}addTimeline(e,t,r,i,o){let a=this._initializeCollection(this.configuration,"timelines");if(this.getTimeline(e))throw Error(`timeline for uri ${e} already exists`);let c={id:(0,ge.v4)(),type:t,uri:e,duration:r,loop:i,selector:o,timelineActions:[]};return a.push(c),this}getTimeline(e){return this.configuration.timelines.find(t=>t.uri===e)}removeTimeline(e){let t=this.getTimeline(e);if(t){let r=this.configuration.timelines.indexOf(t);r>-1&&this.configuration.timelines.splice(r,1)}return this}_initializeLabel(e,t){let r=t.find(i=>i.id===e);return r||(t.push({id:e,labels:[]}),r=t[t.length-1]),r}_getLabelTranslation(e,t){let r=e.find(i=>i.languageCode===t);return r||(r={id:(0,ge.v4)(),languageCode:t,label:""},e.push(r)),r}editLabel(e){let t=this.configuration.labels?.find(r=>r.id===e);if(t)return new Ge(this,t);throw new Error(`Language label with id '${e}' not found`)}addLabel(e,t,r){let i=this._initializeCollection(this.configuration,"labels"),o=this._initializeLabel(e,i),a=this._getLabelTranslation(o.labels,t);return a.label=r,this}addLabels(e,t){return Object.entries(t).forEach(([r,i])=>this.addLabel(e,r,i)),this}removeLabel(e){let t=this.configuration.labels.findIndex(r=>r.id===e);if(t>-1)this.configuration.labels.splice(t,1);else throw new Error(`Label with id '${e}' not found!`);return this}editAction(e){let t=this.configuration.actions.find(r=>r.id===e);if(t)return new Q(t,this);throw new Error(`Action not found for id ${e}`)}editEventAction(e){let t=this.configuration.eventActions?.find(r=>r.id===e);if(t)return new ne(t,this);throw new Error(`Event action not found for id ${e}`)}editInitAction(e){let t=this.configuration.initActions.find(r=>r.id===e);if(t)return new Q(t,this);throw new Error(`Init action not found for id ${e}`)}editTimelineAction(e,t){let r=this.getTimeline(e);if(!r)throw new Error(`Timeline not found for id ${t}`);let i=r.timelineActions.find(o=>o.id===t);if(i)return new pe(i,this);throw new Error(`Timeline action not found for id ${t}`)}};var xe={};J(xe,{EventListenerController:()=>ve,LabelController:()=>Ie,LottieController:()=>Ee,NavigationController:()=>ye,ProgressbarController:()=>be,RoutingController:()=>Te,SubtitlesController:()=>Oe});var ve=class{constructor(){this.name="EventListenerController"}init(e){this.operationData={selectedElement:e.selectedElement,eventName:e.eventName,actions:e.actions.slice(),actionOperationData:g(e.actionOperationData)}}attach(e){if(!this.operationData)return;let{selectedElement:t,actions:r,eventName:i}=this.operationData;if(!this.actionInstanceInfos){this.actionInstanceInfos=[];let o=a=>s=>{this.actionInstanceInfos?.push({start:a,action:s})};r.forEach(a=>{let[s,c]=this._isStartAction(a);e.broadcast(l.REQUEST_ACTION,[c,o(s)])}),t.on(i,this._eventHandler.bind(this))}}_isStartAction(e){return e.substring(0,4)==="end:"?[!1,e.substring(4)]:[!0,e]}_eventHandler(e){if(!this.operationData||!this.actionInstanceInfos)return;let t=this.operationData.actionOperationData?g(this.operationData.actionOperationData):{};e.target&&(t.eventTarget=e.target),this._executeAction(this.actionInstanceInfos,t,0)}async _executeAction(e,t,r){if(r<e.length){let i=e[r],{action:o}=i,s=await(i.start?o.start.bind(o):o.end.bind(o))(t);this._executeAction(e,Object.assign(t,s),++r)}}detach(e){this.operationData?.selectedElement.off(this.operationData.eventName)}};var Ie=class{constructor(){this.listeners=[];this.currentLanguage=null;this.operationData=null;this.labelData={};this.name="LabelController"}init(e){this.operationData=Object.assign({},e)}setLabelId(e){this.requestLabelDataBound&&(this.requestLabelDataBound(e),this._setLabel())}attach(e){this.operationData&&(e.broadcast(l.REQUEST_CURRENT_LANGUAGE,[t=>{this.currentLanguage=t}]),this.requestLabelDataBound=this._requestLabelData.bind(this,e),this.requestLabelDataBound(this.operationData.labelId),this._setLabel(),this.listeners.push(e.on(l.LANGUAGE_CHANGE,this._handleLanguageChange.bind(this))))}_requestLabelData(e,t){e.broadcast(l.REQUEST_LABEL_COLLECTION,[t,r=>{if(r)this._createTextDataLookup(r);else throw new Error(`Label id '${t}' does not exist!`)}])}_setLabel(){if(this.currentLanguage){let e=this.labelData[this.currentLanguage];this.operationData?.attributeName?this.operationData?.selectedElement.attr(this.operationData?.attributeName,e):this.operationData?.selectedElement.html(e)}}detach(e){this.listeners.forEach(t=>t()),this.requestLabelDataBound=void 0}_handleLanguageChange(e){this.currentLanguage=e,this._setLabel()}_createTextDataLookup(e){e.forEach(t=>{this.labelData[t.languageCode]=t.label})}};var Kn=b(require("lottie-web"));var Ee=class{constructor(){this.name="LottieController";this.currentLanguage="nl-NL";this.labelData={};this.eventbusRemovers=[];this.animationItem=null;this.operationData=null;this.serializedData=null;this.serializedIEData=null;this.freezePosition=-1;this.endPosition=-1}init(e){this.operationData={...e},e.url.indexOf("[")>-1&&this._parseFilename(e.url),this.serializedData=this.operationData.json?JSON.stringify(this.operationData.json):JSON.stringify(this.operationData.animationData),this.operationData.iefallback&&(this.serializedIEData=JSON.stringify(this.operationData.iefallback))}_parseFilename(e){e.substring(e.indexOf("[")+1,e.indexOf("]")-e.indexOf("[")-1).split(",").forEach(i=>{let o=i.split("=");o[0]==="freeze"?this.freezePosition=+o[1]:o[0]==="end"&&(this.endPosition=+o[1])})}attach(e){if(!this.operationData)return;let{labelIds:t}=this.operationData;if(t&&t.length){let r={};e.broadcast(l.REQUEST_CURRENT_LANGUAGE,[r]),this.currentLanguage=r.language,this.eventbusRemovers.push(e.on(l.LANGUAGE_CHANGE,this._handleLanguageChange.bind(this))),e.broadcast(l.REQUEST_LABEL_COLLECTIONS,[this.operationData.labelIds,r]),this._createTextDataLookup(r.labelCollections)}this._createAnimation()}detach(e){this.eventbusRemovers.forEach(t=>{t()}),this.animationItem&&(this.endPosition>-1?(this.animationItem.addEventListener("complete",this._destroy.bind(this)),this.animationItem.playSegments([this.freezePosition,this.endPosition],!0)):this.animationItem.destroy())}_destroy(){this.animationItem&&(this.animationItem.destroy(),this.animationItem=null)}_createAnimation(){if(!this.operationData||!this.serializedData)return;this.animationItem?.destroy();let e=this._isIE()&&this.serializedIEData?this.serializedIEData:this.serializedData,{labelIds:t}=this.operationData;t&&t.length&&t.forEach(o=>{e=e.split(`!!${o}!!`).join(this.labelData[o][this.currentLanguage])});let r=JSON.parse(e),i={autoplay:this.operationData.autoplay,container:this.operationData.selectedElement[0],loop:this.operationData.loop,rendererSettings:this.operationData.renderer,animationData:r};this.animationItem=Kn.default.loadAnimation(i),this.endPosition<0&&(this.endPosition=this.animationItem.timeCompleted),this.freezePosition>-1&&this.animationItem.playSegments([0,this.freezePosition],!0),this.operationData.viewBox&&this.operationData.selectedElement.find("svg").attr("viewBox",this.operationData.viewBox)}_createTextDataLookup(e){e.forEach((t,r)=>{t.forEach(i=>{this.operationData&&(this.labelData[this.operationData.labelIds[r]][i.code]=i.label)})})}_handleLanguageChange(e){this.currentLanguage=e,this._createAnimation()}_isIE(){let e=!!window.document.documentMode;return!e&&!!window.StyleMedia||e}};var G=b(require("jquery")),ye=class{constructor(){this.name="NavigationController";this.navigation=[];this.navLookup={};this.navVidIdLookup={};this.ctrlLookup={};this.activeNavigationPoint=null;this.labelControllers=[];this.eventhandlers=[];this.eventbus=null;this.container=null}init(e){this.container=e.selectedElement,this.navigation=this._buildNavigationData(e.json)}attach(e){this.container&&(this.eventbus=e,this.eventhandlers.push(e.on("navigate-to-video-url",this._handleNavigateVideoUrl.bind(this))),this.eventhandlers.push(e.on("highlight-navigation",this._highlightMenu.bind(this))),this.eventhandlers.push(e.on("request-current-navigation",this._handleRequestCurrentNavigation.bind(this))),this.eventhandlers.push(e.on("video-complete",this._handleVideoComplete.bind(this))),this._buildHtml(this.container,this.navigation),this._initHistory.bind(this))}_initHistory(){this.activeNavigationPoint=this.navVidIdLookup[0];let e=this._getQueryVariable(0),t=0;e&&(t=this.navLookup[e].videoUrlIndex),this._highlightMenu(t)}_getQueryVariable(e){let t=window.location.href,r=t.indexOf("#");if(r>-1){let i=t.substring(r+2);if(i)return i.split("/")[e]}return null}_handleRequestCurrentNavigation(e){if(this.activeNavigationPoint){let t=this.ctrlLookup[this.activeNavigationPoint.labelId];e({navigationData:this.activeNavigationPoint,title:t.labelData[t.currentLanguage||""]})}else e(null)}detach(e){this.eventhandlers.forEach(t=>{t()}),this.labelControllers.forEach(t=>{t.detach(e)}),this.labelControllers.length=0,this.eventbus=null,this.container=null,window.onpopstate=null}_pushCurrentState(e=-1){if(!this.activeNavigationPoint)return;let t=this.ctrlLookup[this.activeNavigationPoint.labelId];if(!t)return;let r={navigationData:this.activeNavigationPoint,title:t.labelData[t.currentLanguage||""],position:-1};e>-1&&(r.position=e),this.eventbus?.broadcast("push-history-state",[r])}_buildHtml(e,t){let r=(0,G.default)("<ul/>");t.forEach(this._addNavElement.bind(this,r)),e.append(r)}_addNavElement(e,t){if(t.visible){let r=(0,G.default)("<li/>"),i=(0,G.default)(`<a href='javascript:;' id='nav_${t.videoUrlIndex}'/>`);if(r.append(i),this._addLabel(i,t.labelId),this._addClickHandler(i,t.videoUrlIndex),t.children){let o=(0,G.default)("<ul/>");t.children.forEach(this._addNavElement.bind(this,o)),r.append(o)}e.append(r)}}_addClickHandler(e,t){e.mouseup(this._menuMouseupHandler.bind(this,t))}_menuMouseupHandler(e){let t=this.navVidIdLookup[e];t&&(this.eventbus?.broadcast("request-video-url",[t.videoUrlIndex]),this._handleNavigateVideoUrl(t.videoUrlIndex))}_handleNavigateVideoUrl(e,t=0){this._highlightMenu(e),this.eventbus?.broadcast("request-video-url",[e,t]),this.activeNavigationPoint=this.navVidIdLookup[e],this._pushCurrentState(t)}_highlightMenu(e){let t=(0,G.default)(`#nav_${e}`);t.length&&((0,G.default)(".current-menu-item").removeClass("current-menu-item"),t.addClass("current-menu-item"))}_handleVideoComplete(e){let t=this.navVidIdLookup[e];t.autoNext?this.eventbus?.broadcast("request-video-url",[t.next.videoUrlIndex]):this.eventbus?.broadcast("request-video-cleanup")}_addLabel(e,t){let r={selectedElement:e,labelId:t},i=o=>{o.init(r),o.attach(this.eventbus),this.labelControllers.push(o),this.ctrlLookup[t]=o};this.eventbus?.broadcast("request-instance",["LabelController",i])}_buildNavigationData(e){let t=[];return e.navigationData.forEach((r,i)=>{this.navLookup[r.id]=r,this.navVidIdLookup[r.videoUrlIndex]=r,r.previous=e.navigationData[i-1]}),e.navigationData.forEach((r,i)=>{r.nextId?(r.next=this.navLookup[r.nextId],delete r.nextId):r.next=e.navigationData[i+1]}),e.roots.forEach(r=>{let i=this.navLookup[r];i.children&&(i.children=i.children.map(o=>this.navLookup[o])),t.push(i)}),t}};var be=class{constructor(){this.name="ProgressbarController";this.selectedElement=null;this.textElement=null;this.eventbusRemovers=[];this.duration=0}init(e){this.selectedElement=e.selectedElement,this.textElement=e.textElement}attach(e){this.eventbusRemovers.push(e.on(l.TIME,this._positionUpdateHandler.bind(this))),e.broadcast(l.DURATION_REQUEST,[r=>this.duration=r]),this.selectedElement?.css({"pointer-events":"none"});let t=this.selectedElement?.parent();if(t){let r=this._clickHandler.bind(this,e);t.on("click",r),this.eventbusRemovers.push(()=>t.off("click",r))}}detach(e){this.eventbusRemovers.forEach(t=>{t()})}_positionUpdateHandler(e){let t=100/this.duration*e;this.selectedElement?.css("width",`${t}%`),this.textElement?.text(`${Math.floor(t)}%`)}_clickHandler(e,t){let i=t.target.getBoundingClientRect(),o=t.clientX-i.left,a=100/i.width*o;e.broadcast(l.SEEK_REQUEST,[Math.round(this.duration/100*a)])}};var Te=class{constructor(){this.name="RoutingController";this.navLookup={};this.navVidIdLookup={};this.navigation=null;this.eventhandlers=[];this.eventbus=null}init(e){this.navigation=this._buildNavigationData(e.json)}attach(e){this.eventhandlers.push(e.on("before-request-video-url",this._handleBeforeRequestVideoUrl.bind(this))),this.eventhandlers.push(e.on("push-history-state",this._handlePushHistoryState.bind(this))),this.eventbus=e,window.onpopstate=this._handlePopstate.bind(this);let t=this._getQueryVariable(0);if(t){let r=this.navLookup[t],i=+this._getQueryVariable(1);this.eventbus.broadcast("request-video-url",[r.videoUrlIndex,i,!0])}else window.history.pushState({navigationId:this.navigation[0].id},"",`#/${this.navigation[0].id}`)}_handlePopstate(e){let t=e.state?e.state.navigationId:this.navigation[0].id,r=e.state?.position??0,i=this.navLookup[t];this.eventbus?.broadcast("highlight-navigation",[i.videoUrlIndex]),this.eventbus?.broadcast("request-video-url",[i.videoUrlIndex,r,!0])}detach(e){this.eventhandlers&&this.eventhandlers.forEach(t=>{t()}),this.eventbus=null}_handleBeforeRequestVideoUrl(e,t=0,r=!1){if(r=r!==void 0?r:!1,!r){let i=o=>{this._pushState(o)};this.eventbus?.broadcast("request-current-navigation",[i])}}_getQueryVariable(e){let t=window.location.href,r=t.indexOf("#");if(r>-1){let i=t.substring(r+2);if(i)return i.split("/")[e]}return""}_handlePushHistoryState(e){this._pushState(e)}_pushState(e){if(e&&e.navigationData&&e.navigationData.visible){let t=e.position!==void 0?e.position:-1;if(t<0){let i=o=>{t=o>3?o-3:0};this.eventbus?.broadcast("request-current-video-position",[i])}let r=window.history.state;r&&r.navigationId!==e.navigationData.id?window.history.pushState({navigationId:e.navigationData.id,position:t},e.title,`#/${e.navigationData.id}/${t}`):r&&r.navigationId===e.navigationData.id?window.history.replaceState({navigationId:r.navigationId,position:t},e.title,`#/${r.navigationId}/${t}`):window.history.pushState({navigationId:e.navigationData.id,position:t},e.title,`#/${e.navigationData.id}/${t}`),window.document.title=e.title}}_buildNavigationData(e){let t=[];return e.navigationData.forEach((r,i)=>{this.navLookup[r.id]=r,this.navVidIdLookup[r.videoUrlIndex]=r,r.previous=e.navigationData[i-1]}),e.navigationData.forEach((r,i)=>{r.nextId?(r.next=this.navLookup[r.nextId],delete r.nextId):r.next=e.navigationData[i+1]}),e.roots.forEach(r=>{let i=this.navLookup[r];i.children&&(i.children=i.children.map(o=>this.navLookup[o])),t.push(i)}),t}};var Oe=class{constructor(){this.actionLookup={};this.currentLanguage=null;this.lastFunc=null;this.name="SubtitlesController";this.subtitleDurations=null}attach(e){let t=e.on(l.TIME,this.onTimeHandler.bind(this)),r=e.on(l.SEEKED,this.onSeekedHandler.bind(this)),i=e.on(l.LANGUAGE_CHANGE,this.languageChangeHandler.bind(this));this.internalDetach=this.internalDetach.bind(this,[t,i,r])}detach(e){this.internalDetach()}internalDetach(e){e&&e.forEach(t=>{t()})}languageChangeHandler(e){this.currentLanguage=e,this.lastFunc&&this.lastFunc()}removeTitle(e){e?.empty(),this.lastFunc=null}onTimeHandler(e){let t=this.actionLookup[e];t&&this.lastFunc!==t&&(this.lastFunc=t,t())}onSeekedHandler(e){let t=e[0],r=this.subtitleDurations?.find(o=>o.start<=t||o.end>=t),i=r?this.actionLookup[r.start??-1]:void 0;i&&this.lastFunc!==i?(this.lastFunc=i,i()):i||this.removeTitle()}setTitle(e,t){this.currentLanguage&&e.html(t[this.currentLanguage])}createActionLookup(e,t){let r=e.subtitleData,i=r[0].titles,o={};for(let a=0,s=i.length;a<s;a++){let c={};for(let p=0,u=r.length;p<u;p++){let m=r[p];c[m.languageCode]=m.titles[a].text}o[i[a].duration.start]=this.setTitle.bind(this,t,c),o[i[a].duration.end]=this.removeTitle.bind(this,t)}return o}init(e){let t=e.selectedElement;this.removeTitle=this.removeTitle.bind(this,t),this.currentLanguage=e.language,this.actionLookup=this.createActionLookup(e,t),this.subtitleDurations=e.subtitleData?.[0].titles.map(r=>r.duration)}};var Ce={};J(Ce,{addClass:()=>Gn,addControllerToElement:()=>Hn,animate:()=>Vn,animateWithClass:()=>zn,broadcastEvent:()=>Jn,calc:()=>Wn,clearElement:()=>Bn,clearOperationData:()=>Yn,createElement:()=>Xn,customFunction:()=>Zn,endAction:()=>er,endForEach:()=>tr,endWhen:()=>nr,extendController:()=>rr,forEach:()=>ir,getAttributesFromElement:()=>or,getControllerFromElement:()=>ar,getControllerInstance:()=>sr,getElementDimensions:()=>lr,getImport:()=>cr,getQueryParams:()=>pr,invokeObjectMethod:()=>ur,loadJSON:()=>mr,log:()=>dr,math:()=>fr,otherwise:()=>hr,removeClass:()=>gr,removeControllerFromElement:()=>vr,removeElement:()=>Ir,removePropertiesFromOperationData:()=>Er,reparentElement:()=>yr,requestAction:()=>br,resizeAction:()=>Tr,selectElement:()=>Or,setData:()=>xr,setElementAttributes:()=>Cr,setElementContent:()=>_r,setGlobalData:()=>Ar,setOperationData:()=>Dr,setStyle:()=>Pr,startAction:()=>Rr,toggleClass:()=>Sr,toggleElement:()=>wr,wait:()=>Lr,when:()=>Nr});function to(){return{description:"Add a class to the selected element.",dependentProperties:["selectedElement"],properties:{className:{type:"ParameterType:className",required:!0}}}}var Gn=to;function no(){return{description:"Adds the current controller to the selected element(s)",dependentProperties:["selectedElement","controllerInstance"]}}var Hn=no;function ro(){return{description:"Animates the selected element with the given animation settings.",dependentProperties:["selectedElement"],properties:{animationEasing:"ParameterType:boolean",animationProperties:{type:"ParameterType:object",required:!0},animationDuration:{type:"ParameterType:number",required:!0}}}}var Vn=ro;function io(){return{description:"Animates the selected element by adding the given animation class.",dependentProperties:["selectedElement"],properties:{className:{type:"ParameterType:className",required:!0},removeClass:"ParameterType:boolean"}}}var zn=io;function oo(){return{description:"Broadcasts an eventbus event with the given type, topic and optional arguments",properties:{eventArgs:"ParameterType:array",eventTopic:"ParameterType:eventTopic",eventName:{type:"ParameterType:eventName",required:!0}}}}var Jn=oo;function ao(){return{description:"Calculates the given left and right hand sides using the specified operator",properties:{left:{type:"ParameterType:number",description:"The left operand",required:!0},right:{type:"ParameterType:number",description:"The right operand",required:!0},operator:[{value:"+",description:"Adds the left and right operands"},{value:"-",description:"Subtracts the left and right operands"},{value:"*",description:"Multiplies the left and right operands"},{value:"/",description:"Divides the left and right operands"},{value:"%",description:"Returns the remainder left over after the left number is divided into a number of integer portions equal to the right number"},{value:"**",description:"Exponent: Raises a base number to the exponent power, that is, the base number multiplied by itself, exponent times."}]},outputProperties:{calculationResult:"ParameterType:number"}}}var Wn=ao;function so(){return{description:"clears the given element",dependentProperties:["selectedElement"]}}var Bn=so;function lo(){return{description:"clears the current operation data",properties:{properties:"ParameterType:array"}}}var Yn=lo;function co(){return{description:"Creates an HTML element with the given name and optionally adds the given attributes",properties:{elementName:{type:"ParameterType:htmlElementName",required:!0},attributes:"ParameterType:object",text:"ParameterType:string"},outputProperties:{template:"ParameterType:object"}}}var Xn=co;function po(){return{description:"Executes the specified custom function",properties:{systemName:{type:"ParameterType:systemName",required:!0}}}}var Zn=po;function uo(){return{description:"Ends the current action",dependentProperties:["actionInstance"],properties:{actionOperationData:"ParameterType:object"}}}var er=uo;function mo(){return{description:"Ends the current loop"}}var tr=mo;function fo(){return{description:"Ends the current when block"}}var nr=fo;function ho(){return{description:"Extends the current controller",dependentProperties:["controllerInstance"],properties:{controllerExtension:"ParameterType:object"}}}var rr=ho;function go(){return{description:"Starts a loop over the given collection",properties:{collection:{type:"ParameterType:array",required:!0}}}}var ir=go;function vo(){return{description:"Retrieves the values for the specified attribute names from the given selected element.",dependentProperties:["selectedElement"],properties:{attributeNames:{type:"ParameterType:array",itemType:"ParameterType:string",required:!0}},outputProperties:{attributeValues:"ParameterType:object"}}}var or=vo;function Io(){return{description:"Retrieves the specified controller from the current element",dependentProperties:["selectedElement"],properties:{controllerName:{type:"ParameterType:controllerName",required:!0}},outputProperties:{controllerInstance:"ParameterType:object"}}}var ar=Io;function Eo(){return{description:"Retrieves an instance of the specified controller",properties:{systemName:{type:"ParameterType:controllerName",required:!0}},outputProperties:{controllerInstance:"ParameterType:object"}}}var sr=Eo;function yo(){return{description:"Calculates the dimensions for the current element",dependentProperties:["selectedElement"],properties:{modifier:"ParameterType:dimensionsModifier"},outputProperties:{dimensions:"ParameterType:dimensions"}}}var lr=yo;function bo(){return{description:"Retrieves a javascript import specified by the given system name",properties:{systemName:{type:"ParameterType:systemName",required:!0}},outputProperties:{importedInstance:"ParameterType:object"}}}var cr=bo;function To(){return{description:"Retrieves the current query parameters from the browser's address bar",outputProperties:{queryParams:"ParameterType:object"}}}var pr=To;function Oo(){return{description:"Invokes the specified method on the given object with the optional specified arguments",properties:{instance:{type:"ParameterType:object",required:!0},methodName:{type:"ParameterType:string",required:!0},methodArguments:"ParameterType:array"},outputProperties:{methodResult:"ParameterType:object"}}}var ur=Oo;function xo(){return{description:"Load JSON from the given url",properties:{url:{type:"ParameterType:url",required:!0},cache:"ParameterType:boolean"},outputProperties:{json:"ParameterType:object"}}}var mr=xo;function Co(){return{description:"Logs the current context and operation data to the console"}}var dr=Co;function _o(){return{description:"This operation performs the given math function of the specified arguments.",properties:{args:{type:"ParameterType:array",required:!0},functionName:Ao(),mathResult:"ParameterType:number"}}}function Ao(){return Object.getOwnPropertyNames(Math).filter(n=>W(Math[n])).map(n=>({value:n}))}var fr=_o;function Do(){return{description:"Inverts the control flow for `when` logic"}}var hr=Do;function Po(){return{description:"Removes the specified class from the selected element",dependentProperties:["selectedElement"],properties:{className:{type:"ParameterType:className",required:!0}}}}var gr=Po;function Ro(){return{description:"Removes the specified controller from the selected element",dependentProperties:["selectedElement"],properties:{controllerName:{type:"ParameterType:controllerName",required:!0}}}}var vr=Ro;function So(){return{description:"Removes the selected element from the DOM",dependentProperties:["selectedElement"]}}var Ir=So;function wo(){return{description:"Removes the specified properties from the current operation data",properties:{propertyNames:"ParameterType:array"}}}var Er=wo;function Lo(){return{description:"Moves the selected element to the new location described by the given selector",dependentProperties:["selectedElement"],properties:{newParentSelector:{type:"ParameterType:selector",required:!0}}}}var yr=Lo;function No(){return{description:"Retrieves an instance of the specified action",properties:{systemName:{type:"ParameterType:actionName",required:!0}},outputProperties:{actionInstance:"ParameterType:object"}}}var br=No;function ko(){return{description:"Triggers a resize on the current action",dependentProperties:["actionInstance"],properties:{actionOperationData:"ParameterType:object"}}}var Tr=ko;function Mo(){return{description:"Selects an element using the given selector",properties:{selector:{type:"ParameterType:selector",required:!0},useSelectedElementAsRoot:"ParameterType:boolean"},outputProperties:{selectedElement:"ParameterType:jQuery"}}}var Or=Mo;function Fo(){return{description:"Copies the specified values to the specified targets",properties:{properties:{type:"ParameterType:object",required:!0}}}}var xr=Fo;function Uo(){return{description:"Sets the given attributes on the selected element",dependentProperties:["selectedElement"],properties:{attributes:{type:"ParameterType:object",required:!0}}}}var Cr=Uo;function jo(){return{description:"Sets the given HTML content in the selected element",dependentProperties:["selectedElement","template"],properties:{insertionType:[{value:"overwrite",description:"the contents of the selected element are replaced by the given template",default:!0},{value:"append",description:"the new content will be inserted after the current content"},{value:"prepend",description:"the new content will be inserted before the current content"}]}}}var _r=jo;function qo(){return{description:"Copies the specified values from the operationData to the global data",properties:{properties:{type:"ParameterType:array",required:!0}}}}var Ar=qo;function $o(){return{description:"Sets the given properties on the current operation data",properties:{properties:{type:"ParameterType:object",required:!0},override:"ParameterType:boolean"}}}var Dr=$o;function Qo(){return{description:"Sets the given style properties on the selected element",properties:{properties:{type:"ParameterType:object",required:!0},selectedElement:"ParameterType:jQuery"}}}var Pr=Qo;function Ko(){return{description:"Starts the selected action",dependentProperties:["actionInstance"],properties:{actionOperationData:"ParameterType:object"}}}var Rr=Ko;function Go(){return{description:"Toggles the given class on the selected element",dependentProperties:["selectedElement"],properties:{className:{type:"ParameterType:className",required:!0}}}}var Sr=Go;function Ho(){return{description:"Toggles the selected element",dependentProperties:["selectedElement"]}}var wr=Ho;function Vo(){return{description:"Waits the given amount of milliseconds before the action continues",properties:{milliseconds:{type:"ParameterType:number",required:!0}}}}var Lr=Vo;function zo(){return{description:"Evaluates the given expression, when it evaluates to false context.skipNextOperation will be set to true",properties:{expression:{type:"ParameterType:expression",required:!0}}}}var Nr=zo;var en=class{getOperationNames(){return Object.keys(x)}},tn=class{getControllerNames(){return Object.keys(xe)}},nn=class{getOperationMetadata(e){let t=Ce[e];if(!t)throw new Error(`Could not find metadata for operation called ${e}`);return t()}},rn=class{getEventNames(){return Object.values(l)}};var on=class{importSubtitles(e){let t=[],r=[];for(let o=0,a=e.length;o<a;o++){let s=this.stripNewlineChars(e[o].toString());this.isValidLine(s)&&r.push(s)}for(r[0]===""&&r.splice(0,1);r[r.length-1]==="";)r.pop();let i=null;return r.forEach(o=>{o.length===0||!i?(i={text:""},o.length&&(i.duration=this.convertDuration(o)),t.push(i)):i.hasOwnProperty("duration")?i.text+=o:i.duration=this.convertDuration(o)}),t}stripNewlineChars(e){let t="";for(let r=0,i=e.length;r<i;r++)e.charCodeAt(r)!==13&&e.charCodeAt(r)!==0&&(t+=e.charAt(r));return t}isValidLine(e){return!e.startsWith("@")&&!e.startsWith("<begin subtitles>")&&!e.startsWith("<end subtitles>")}convertDuration(e){let t=e.split(" ");return{start:this.convertTimeToSeconds(t[0]),end:this.convertTimeToSeconds(t[1])}}convertTimeToSeconds(e){let t=e.split(":");return parseInt(t[0],10)*3600+parseInt(t[1],10)*60+parseInt(t[2],10)}};var an=require("uuid"),sn=class{constructor(e=[]){this.collection=e}_getLanguage(e){return this.collection.find(t=>t.languageCode===e)}addLanguage(e){if(this._getLanguage(e))throw new Error(`Language ${e} already exists.`);let r=this.collection.length?{...this.collection[0],languageCode:e,titles:this.collection[0].titles.map(i=>({id:(0,an.v4)(),duration:{...i.duration},text:""}))}:{languageCode:e,titles:[]};return this.collection.push(r),this}addSubtitle(e,t){let r=this._getLanguage(e);if(!r)throw new Error(`Language ${e} does not exist.`);return r.titles.push(t),this}addSubtitles(e,t){return Object.entries(t).forEach(([r,i])=>this.addSubtitle(r,{id:(0,an.v4)(),duration:{...e},text:i})),this}setSubtitle(e,t){let r=this._getLanguage(e);if(!r)throw new Error(`Language ${e} does not exist.`);let i=r.titles.findIndex(o=>o.id===t.id);if(i<0)throw new Error(`Subtitle with id '${t.id}' was not found in language with code ${e}.`);return r.titles[i]={...t,duration:{...t.duration}},this}export(){return this.collection}};var ln=b(Fe());function kr(n,e){let t=n.split(".");return k(t,e)}var re=class{constructor(e,t){this.importer=e;this.eventbus=t}process(e,t){if(cn(e,e,this.importer),!(0,ln.isDefined)(e.timelineProviderSettings))throw new Error("Configuration incomplete: it needs to have at least one timeline provider setting");let r={id:e.id,engine:{...e.engine},timelineProviderSettings:g(e.timelineProviderSettings),containerSelector:e.containerSelector,language:e.language,layoutTemplate:e.layoutTemplate,availableLanguages:g(e.availableLanguages),actions:Mr(e.actions,this.importer,this.eventbus),initActions:Mr(e.initActions,this.importer,this.eventbus),labels:g(e.labels),timelineFlow:g(e.timelineFlow),timelines:Wo(e.timelines,this.importer,this.eventbus)},i=[];return e.eventActions?.length&&t&&(i=Jo(e.eventActions,t,this.importer,this.eventbus)),[r.actions.concat(i).reduce((a,s)=>({...a,[s.name]:s}),{}),r]}};function Jo(n,e,t,r){return n.map(o=>Ur(o,t)).map((o,a)=>{let{eventName:s,eventTopic:c}=n[a],p=new F(o.name,o.startOperations,r);return e.registerAction(p,s,c),p})}function Wo(n,e,t){let r=Bo.bind(null,e,t);return n.map(i=>({...i,timelineActions:i.timelineActions.map(r)}))}function Fr(n,e){return{id:e.id,systemName:e.systemName,operationData:g(e.operationData)??{},instance:n.import(e.systemName)[e.systemName]}}function Ur(n,e){let t=Fr.bind(null,e);return{id:n.id,name:n.name,startOperations:n.startOperations.map(t)}}function jr(n,e){let t=Fr.bind(null,e);return{...Ur(n,e),endOperations:n.endOperations.map(t)}}function Bo(n,e,t){let r=jr(t,n),i={end:t.duration.end??-1,start:t.duration.start},{id:o,name:a,endOperations:s,startOperations:c}=r,p=new Z(a,c,s,i,e);return p.id=o,p}function Mr(n,e,t){return n.map(i=>jr(i,e)).map(i=>{let{name:o,endOperations:a,startOperations:s}=i,c=new U(o,s,a,t);return c.id=i.id,c})}function cn(n,e,t){(0,ln.isDefined)(n)&&(Array.isArray(n)?n.forEach(r=>{cn(r,e,t)}):Object.keys(n).forEach(r=>{Yo(r,n,e,t)}))}function Yo(n,e,t,r){let i=e[n];if(w(i)){if(i.startsWith("config:")){let o=i.substring(7,i.length);e[n]=kr(o,t)}else if(i.startsWith("template:")){let o=i.substring(9,i.length),a=r.import(o)[o];e[n]=a}else if(i.startsWith("json:")){let o=i.substring(5,i.length),a=r.import(o)[o];e[n]=a}}else B(i)&&cn(i,t,r)}var He=b(require("jquery"));var ie=class n{constructor(e,t,r,i){this.configuration=e;this.eventbus=t;this.timelineProviders=r;this.languageManager=i;this._timeLineActionsLookup={};this._eventbusRemovers=[];this._currentTimelineUri="";this._activeTimelineProvider=void 0;this._lastPosition=-1}init(){this._createLayoutTemplate(),this._addEventbusListeners();let{timelines:e}=this.configuration;return this._currentTimelineUri=e?.[0].uri??"",this._createTimelineLookup(),this._initializeTimelineProvider()}_createLayoutTemplate(){let{containerSelector:e}=this.configuration,t=(0,He.default)(e);if(!t||!t.length)throw new Error(`Container selector not found: ${e}`);let{layoutTemplate:r}=this.configuration;r&&r.length?t.html(r):console.warn("layoutTemplate is empty, unable to create layout")}async _initializeTimelineProvider(){if(!this.configuration.timelines?.length)throw new Error("No timelines present");let e=this.configuration.timelines[0],t=this.timelineProviders[e.type];if(!t)throw new Error(`No timeline provider configured for type ${e.type}`);if(this._activeTimelineProvider?.destroy(),this._activeTimelineProvider=t.provider,!this._activeTimelineProvider)throw new Error("NO ACTIVE TIMELINE PROVIDER");return this._activeTimelineProvider.onTime(this._onTimeHandler.bind(this,Math.floor)),this._activeTimelineProvider.onComplete(this._onCompleteCallback.bind(this)),this._activeTimelineProvider.onFirstFrame(this._onFirstFrameCallback.bind(this)),this._activeTimelineProvider.onRestart(this._onRestartCallback.bind(this)),await this._activeTimelineProvider.init(),await this._executeActions(this.configuration.initActions,"start"),this._activeTimelineProvider}_onCompleteCallback(){this.eventbus.broadcast(l.COMPLETE)}_onFirstFrameCallback(){this.eventbus.broadcast(l.FIRST_FRAME),this.eventbus.broadcast(l.DURATION,[this._activeTimelineProvider?.getDuration])}_onRestartCallback(){this.eventbus.broadcast(l.RESTART)}async _cleanUp(){await this._cleanUpTimeline(),await this._executeActions([...this.configuration.initActions].reverse(),"end")}async destroy(){await this._cleanUp(),this.languageManager.destroy(),this._activeTimelineProvider=void 0,this._eventbusRemovers.forEach(r=>r()),this.timelineProviders&&Object.values(this.timelineProviders).forEach(r=>r.provider.destroy());let{containerSelector:e}=this.configuration;(0,He.default)(e).empty()}_addEventListener(e,t,r){this._eventbusRemovers.push(this.eventbus.on(e,t,r))}_addEventbusListeners(){this._addEventListener(l.REQUEST_ENGINE_ROOT,this._handleRequestEngineRoot.bind(this,this.configuration.containerSelector)),this._addEventListener(l.REQUEST_TIMELINE_URI,this._handleRequestTimelineUri.bind(this)),this._addEventListener(l.REQUEST_CURRENT_TIMELINE_POSITION,this._handleRequestTimelinePosition.bind(this,Math.floor)),this._addEventListener(l.REQUEST_TIMELINE_CLEANUP,this._handleTimelineComplete.bind(this)),this._addEventListener(l.REQUEST_CURRENT_TIMELINE,this._requestCurrentTimeline.bind(this)),this._addEventListener(l.PLAY_TOGGLE_REQUEST,this._toggleplay.bind(this)),this._addEventListener(l.PLAY_REQUEST,this._playRequest.bind(this)),this._addEventListener(l.STOP_REQUEST,this._stopRequest.bind(this)),this._addEventListener(l.PAUSE_REQUEST,this._pauseRequest.bind(this)),this._addEventListener(l.CONTAINER_REQUEST,this.containerRequest.bind(this)),this._addEventListener(l.DURATION_REQUEST,this.durationRequest.bind(this)),this._addEventListener(l.SEEK_REQUEST,this.seekRequest.bind(this))}async seekRequest(e){if(!this._activeTimelineProvider)return;let t=Math.floor(e),r=this._activeTimelineProvider.getDuration(),i=this._activeTimelineProvider.getPosition();t<0||t>r||(this.eventbus.broadcast(l.SEEK,[t,i,r]),await this._activeTimelineProvider.seek(t),await this._executeSeekActions(t),this.eventbus.broadcast(l.SEEKED,[this._activeTimelineProvider.getPosition(),r]),this.eventbus.broadcast(l.TIME,[this._activeTimelineProvider.getPosition()]),this._activeTimelineProvider?.playState==="running"&&this._activeTimelineProvider?.start())}durationRequest(e){e(this._activeTimelineProvider?.getDuration())}containerRequest(e){e(this._activeTimelineProvider?.getContainer())}_pauseRequest(){this._activeTimelineProvider&&(this._activeTimelineProvider.pause(),this.eventbus.broadcast(l.PAUSE))}_stopRequest(){this._activeTimelineProvider&&(this._activeTimelineProvider.stop(),this.eventbus.broadcast(l.STOP))}_playRequest(){this._activeTimelineProvider&&(this._activeTimelineProvider.start(),this.eventbus.broadcast(l.PLAY))}_toggleplay(){this._activeTimelineProvider&&(this._activeTimelineProvider.playState==="running"?this._activeTimelineProvider.pause():this._activeTimelineProvider.start())}_createTimelineLookup(){this.configuration.timelines&&(this.configuration.timelines.forEach(e=>{e.timelineActions.forEach(this._addTimelineActionStart.bind(this,e.uri))}),this.configuration.timelines.forEach(e=>{e.timelineActions.forEach(this._addTimelineActionEnd.bind(this,e.uri))}),n.sortTimelines(Object.values(this._timeLineActionsLookup)))}static sortTimelines(e){e.forEach(t=>{Object.keys(t).forEach(r=>t[r]=n.sortActionsPerPosition(t[r]))})}static sortActionsPerPosition(e){let[t,r]=e.reduce((i,o)=>(o.isStart?i[0].push(o):i[1].push(o),i),[[],[]]);return[...r.sort(Zo),...t]}_addTimelineActionStart(e,t){let r=t.duration.start,i=this._initializeTimelinePosition(this._initializeUriLookup(this._timeLineActionsLookup,e),r),o=t.start.bind(t);t.id?.length&&(o.id=t.id),o.isStart=!0,i.push(o)}_addTimelineActionEnd(e,t){let r=t.duration.end;if(r<0&&(r=t.duration.end=1/0),isFinite(r)){let i=this._initializeTimelinePosition(this._timeLineActionsLookup[e],r),o=t.end.bind(t);t.id?.length&&(o.id=t.id,o.startPosition=t.duration.start),o.isStart=!1,i.push(o)}}_initializeUriLookup(e,t){return e[t]||(e[t]={}),e[t]}_initializeTimelinePosition(e,t){return e[t]||(e[t]=[]),e[t]}async _executeActions(e,t,r=0){return e&&r<e.length?(await e[r][t](),this._executeActions(e,t,++r)):Promise.resolve()}_handleRequestEngineRoot(e,t){t((0,He.default)(e))}async _handleRequestTimelineUri(e,t=0){if(!this._activeTimelineProvider)return;this._activeTimelineProvider.stop(),await this._cleanUpTimeline();let r=this.configuration.timelines.find(o=>o.uri===e);if(!r||!this._activeTimelineProvider||this._currentTimelineUri===r.uri)return;this._currentTimelineUri=r.uri,this.eventbus.broadcast(l.CURRENT_TIMELINE_CHANGE,[this._currentTimelineUri]);let i=this.timelineProviders[r.type];this._activeTimelineProvider!==i.provider&&(this._activeTimelineProvider.destroy(),this._activeTimelineProvider=i.provider),this._activeTimelineProvider.loop=r.loop,!this._activeTimelineProvider.loop&&t>0&&this.eventbus.once(l.FIRST_FRAME,async()=>{if(!this._activeTimelineProvider)return;this._activeTimelineProvider.pause(),this.eventbus.broadcast(l.DURATION,[this._activeTimelineProvider.getDuration()]),await this._executeStartActions();let o=await this._activeTimelineProvider.seek(t);this.seekRequest(o)}),this._activeTimelineProvider.playlistItem(e)}_cleanUpTimeline(){return this._executeRelevantActions(this._getActiveActions,"end")}_executeStartActions(){return this._executeRelevantActions(this._getActionsForPosition.bind(this,0),"start")}_getActionsForPosition(e,t){return t.filter(r=>!r.active&&r.duration.start<=e&&r.duration.end>=e)}_getActiveActions(e){return e.filter(r=>r.active).sort(Xo)}_executeRelevantActions(e,t){let r=this._getTimelineActionsForCurrentTimeline(),i=e.apply(this,[r]);return this._executeActions(i,t,0)}_handleRequestTimelinePosition(e,t){t(e(this._activeTimelineProvider?.getPosition()||-1))}_handleTimelineComplete(){this._cleanUpTimeline()}_getTimelineActionsForCurrentTimeline(){return this._getTimelineActionsForUri(this._currentTimelineUri)}_requestCurrentTimeline(e){e(this._currentTimelineUri)}_getTimelineActionsForUri(e){return this.configuration.timelines.find(r=>r.uri===e)?.timelineActions??[]}_onTimeHandler(e,t){if(!isNaN(t)){let r=e(t);this._lastPosition!==r&&(this._executeActionsForPosition(r),this.eventbus.broadcast(l.TIME,[r]))}}_executeActionsForPosition(e){this._lastPosition=e;let t=this._timeLineActionsLookup[this._currentTimelineUri];t&&t[e]?.forEach(i=>i())}async _executeSeekActions(e){let t=this._getTimelineActionsForCurrentTimeline();if(!t)return Promise.resolve();let r=this._getActiveActions(t).filter(a=>!(a.duration.start<=e&&a.duration.end>=e)),i=this._getActionsForPosition(e,t);return await this._executeActions(r,"end",0),this._executeActions(i,"start",0)}},Xo=(n,e)=>e.duration.start<n.duration.start?-1:e.duration.start>n.duration.start?1:0,Zo=(n,e)=>e.startPosition===void 0||n.startPosition===void 0?0:e.startPosition<n.startPosition?-1:e.startPosition>n.startPosition?1:0;var bn=b(li()),ui=b(require("jquery"));var yn={};J(yn,{ActionRegistryEventbusListener:()=>H,Eventbus:()=>V,RequestVideoUriInterceptor:()=>z});var H=class{constructor(){this._actionRegistry=new Map}registerAction(e,t,r){r&&r.length&&(t=`${t}:${r}`),this._actionRegistry.has(t)||this._actionRegistry.set(t,[]),this._actionRegistry.get(t)?.push(e)}handleEvent(e,t,r){t&&(e=`${e}:${t}`);let i=this._actionRegistry.get(e);if(i){let o={eventArgs:r};i.forEach(a=>{a.start(o)})}}};var V=class{constructor(){this.eventHandlers=new Map;this.eventInterceptors=new Map;this.eventListeners=[];this.clear()}clear(){this.eventHandlers=new Map,this.eventListeners=[],this.eventInterceptors=new Map}_getEventInterceptors(e,t){return t&&(e=`${e}:${t}`),this.eventInterceptors.has(e)||this.eventInterceptors.set(e,[]),this.eventInterceptors.get(e)}_getEventHandlers(e,t){return t&&(e=`${e}:${t}`),this.eventHandlers.has(e)||this.eventHandlers.set(e,[]),this.eventHandlers.get(e)}on(e,t,r){return this._getEventHandlers(e,r).push(t),()=>{this.off(e,t,r)}}once(e,t,r){let i=(...o)=>{t(...o),this.off(e,i,r)};return this.on(e,i,r),()=>{this.off(e,i,r)}}off(e,t,r){let i=this._getEventHandlers(e,r);if(i){let o=i.indexOf(t);o>-1&&i.splice(o,1)}}broadcast(e,t){this._callHandlers(e,void 0,t)}broadcastForTopic(e,t,r){this._callHandlers(e,t,r)}registerEventlistener(e){return this.eventListeners.push(e),()=>{let t=this.eventListeners.indexOf(e);t>-1&&this.eventListeners.splice(t,1)}}registerInterceptor(e,t,r){let i=this._getEventInterceptors(e,r);return i.push(t),()=>{let o=i.indexOf(t);o>-1&&i.splice(o,1)}}_callHandlers(e,t,r=[]){let i=this._getEventHandlers(e,t);i&&(this._getEventInterceptors(e,t).forEach(a=>{r=a.intercept(r)}),this.eventListeners.forEach(a=>{a.handleEvent(e,t,r)}),r?.length?i.forEach(a=>a(...r)):i.forEach(a=>a()))}};var z=class{constructor(e){this.eventbus=e}intercept(e){return this.eventbus.broadcast(l.BEFORE_REQUEST_TIMELINE_URI,e.slice()),e}};var pi=b(require("jquery"));function ci(n,e){let t=M();t[n]=e}var ae=class{constructor(e,t,r){this._currentLanguage=e;this._eventbus=r;this._eventbusRemovers=[];if(!e)throw new Error("language ctor arg cannot have zero length");ci("defaultLanguage",e),this._setRootElementLang(e),this._labelLookup=this._createLabelLookup(t),this._addEventbusListeners(r)}destroy(){this._eventbusRemovers.forEach(e=>e())}_addEventbusListeners(e){this._eventbusRemovers.push(e.on(l.REQUEST_LABEL_COLLECTION,this._handleRequestLabelCollection.bind(this))),this._eventbusRemovers.push(e.on(l.REQUEST_LABEL_COLLECTIONS,this._handleRequestLabelCollections.bind(this))),this._eventbusRemovers.push(e.on(l.REQUEST_CURRENT_LANGUAGE,this._handleRequestCurrentLanguage.bind(this))),this._eventbusRemovers.push(e.on(l.LANGUAGE_CHANGE,this._handleLanguageChange.bind(this)))}_handleRequestCurrentLanguage(e){e(this._currentLanguage)}_handleRequestLabelCollection(e,t){t(this._labelLookup[e])}_handleRequestLabelCollections(e,t){let r=e.map(i=>this._labelLookup[i]);t(r)}_handleLanguageChange(e){e&&e.length?(this._currentLanguage=e,this._setRootElementLang(this._currentLanguage)):console.error("Language cannot be changed to null or empty string")}_setRootElementLang(e){let t=r=>{let i=this._extractLanguageFromCulture(e);(0,pi.default)(r).attr("lang",i)};this._eventbus.broadcast(l.REQUEST_ENGINE_ROOT,[t])}_extractLanguageFromCulture(e){return e.indexOf("-")>-1?e.split("-").shift():e}_createLabelLookup(e){return e.reduce((t,r)=>(t[r.id]=r.labels,t),{})}};var We=class{constructor(e,t,r){this._actionsLookup={};this._eventRemovers=[];this._resizeTimeout=-1;this._importer=e,this._eventbus=r?.eventbus??new V,h.active=r?.devtools??!1,h.active&&this._initializeDevtools(this._eventbus),this._eventRemovers.push(this._eventbus.on(l.REQUEST_INSTANCE,this._requestInstanceHandler.bind(this))),this._eventRemovers.push(this._eventbus.on(l.REQUEST_ACTION,this._requestActionHandler.bind(this))),this._eventRemovers.push(this._eventbus.on(l.REQUEST_FUNCTION,this._requestFunctionHandler.bind(this)));let i=this._handleSpacePress.bind(this);(0,bn.default)("space",i),this._eventRemovers.push(()=>bn.default.unbind("space",i));let o=this._resizeHandler.bind(this),a=(0,ui.default)(t);a.on("resize",o),this._eventRemovers.push(()=>a.off("resize",o))}_handleSpacePress(e,t){return e.preventDefault(),this._eventbus.broadcast(l.PLAY_TOGGLE_REQUEST),!1}_initializeDevtools(e){let t=window[Me];if(t){let{agent:r}=t;this._eventRemovers.push(e.registerEventlistener(new X(r))),this._eventRemovers.push(r.subscribe(i=>{if(i.type==="playcontrol")switch(i.data.kind){case"play":this._eventbus.broadcast(l.PLAY_REQUEST);break;case"stop":this._eventbus.broadcast(l.STOP_REQUEST);break;case"pause":this._eventbus.broadcast(l.PAUSE_REQUEST);break;case"seek":this._eventbus.broadcast(l.SEEK_REQUEST,[i.data.args]);break}})),h.send=(i,o)=>{let a=Y(o);try{r.postMessage(i,a)}catch(s){console.error("postmessage failed"),console.error(s),console.log("message",a)}},h.send("eligius-diagnostics-factory","Diagnostics initialized")}else console.warn(`${Me} property not found on window, please install the Eligius Devtools extension.`)}destroy(){this._eventRemovers.forEach(e=>e())}_resizeHandler(){this._resizeTimeout&&(clearTimeout(this._resizeTimeout),this._resizeTimeout=-1),this._resizeTimeout=setTimeout(()=>{this._eventbus.broadcast(l.RESIZE)},200)}_importSystemEntryWithEventbusDependency(e){let t=this._importSystemEntry(e);return new t(this._eventbus)}_importSystemEntry(e){return this._importer.import(e)[e]}_requestInstanceHandler(e,t){t(this._importSystemEntryWithEventbusDependency(e))}_requestFunctionHandler(e,t){t(this._importSystemEntry(e))}_requestActionHandler(e,t){let r=this._actionsLookup[e];r?t(r):(console.error(`Unknown action: ${e}`),t(null))}createEngine(e,t){let{systemName:r}=e.engine,i=this._importSystemEntry(r),o;e.eventActions?.length&&(o=new H,this._eventRemovers.push(this._eventbus.registerEventlistener(o))),this._eventRemovers.push(this._eventbus.registerInterceptor(l.REQUEST_TIMELINE_URI,new z(this._eventbus))),t=t||new re(this._importer,this._eventbus);let[a,s]=t.process(e,o);this._actionsLookup=a;let c=this._createTimelineProviders(s),{language:p,labels:u}=e,m=new ae(p,u,this._eventbus);return new i(s,this._eventbus,c,m)}_createTimelineProviders(e){let{timelineProviderSettings:t}=e;return Object.entries(t).reduce((i,[o,a])=>{if(!a)return i;let s=this._importSystemEntry(a.systemName);return i[o]={id:a.id,vendor:a.vendor,provider:new s(e)},i},{})}};var mi=x,di=xe,fi=de,_a=yn,Le=class{constructor(){this.engines=new Map;this.engines.set("EligiusEngine",ie)}getOperationNames(){return Object.keys(mi)}getControllerNames(){return Object.keys(di)}getProviderNames(){return Object.keys(fi)}import(e){let t=mi[e]??di[e]??fi[e]??_a[e]??this.engines.get(e);return{[e]:t}}};0&&(module.exports={Action,ActionCreator,ActionCreatorFactory,ActionEditor,ActionRegistryEventbusListener,ConfigurationFactory,ConfigurationResolver,ControllerNamesProvider,DEV_TOOLS_KEY,DevToolEventListener,Diagnostics,EligiusEngine,EligiusResourceImporter,EndableAction,EndableActionCreator,EndableActionEditor,EngineFactory,EventListenerController,Eventbus,LabelController,LanguageManager,LottieController,NavigationController,OperationEditor,OperationMetadataProvider,OperationNamesProvider,ProgressbarController,RequestAnimationFrameTimelineProvider,RequestVideoUriInterceptor,RoutingController,SubtitleEditor,SubtitleImporter,SubtitlesController,TimeLineEventNamesProvider,TimelineAction,TimelineActionCreator,TimelineActionEditor,TimelineEventNames,TimelineProviderSettingsEditor,TimelineProvidersSettingsEditor,VideoJsTimelineProvider,addClass,addControllerToElement,animate,animateWithClass,broadcastEvent,calc,clearElement,clearOperationData,createElement,customFunction,endAction,endForEach,endWhen,extendController,forEach,generateImporterSourceCode,getAttributesFromElement,getControllerFromElement,getControllerInstance,getElementDimensions,getImport,getQueryParams,invokeObjectMethod,loadJSON,log,math,metadata,otherwise,removeClass,removeControllerFromElement,removeElement,removePropertiesFromOperationData,reparentElement,requestAction,resizeAction,selectElement,setData,setElementAttributes,setElementContent,setGlobalData,setOperationData,setStyle,startAction,toggleClass,toggleElement,wait,when});
|
|
3
|
-
/*! Bundled license information:
|
|
4
|
-
|
|
5
|
-
hotkeys-js/dist/hotkeys.common.min.js:
|
|
6
|
-
(*! hotkeys-js v3.12.0 | MIT © 2023 kenny wong <wowohoo@qq.com> https://jaywcjlove.github.io/hotkeys-js *)
|
|
7
|
-
*/
|
|
8
|
-
//# sourceMappingURL=index.cjs.min.js.map
|