{"version":3,"file":"index-18f51492.js","sources":["../../../../../../node_modules/@itslearning/atlas/network/postMessage.js","../../../../../../node_modules/@itslearning/atlas/frames/IframeClickEventHelper.js","../../../../../../node_modules/svelte/src/runtime/internal/utils.js","../../../../../../node_modules/svelte/src/runtime/internal/environment.js","../../../../../../node_modules/svelte/src/runtime/internal/loop.js","../../../../../../node_modules/svelte/src/runtime/internal/globals.js","../../../../../../node_modules/svelte/src/runtime/internal/dom.js","../../../../../../node_modules/svelte/src/runtime/internal/style_manager.js","../../../../../../node_modules/svelte/src/runtime/internal/lifecycle.js","../../../../../../node_modules/svelte/src/runtime/internal/scheduler.js","../../../../../../node_modules/svelte/src/runtime/internal/transitions.js","../../../../../../node_modules/svelte/src/runtime/internal/each.js","../../../../../../node_modules/svelte/src/runtime/internal/spread.js","../../../../../../node_modules/svelte/src/runtime/internal/Component.js","../../../../../../node_modules/svelte/src/shared/version.js","../../../../../../node_modules/svelte/src/runtime/internal/disclose-version/index.js","../../../../../../node_modules/@itslearning/atlas/strings/format.js","../../../../../../node_modules/@itslearning/prometheus/lib/helpers/TabTrapHelper.js","../../../../../../node_modules/@itslearning/atlas/keyboard/keys.js","../../../../../../node_modules/@itslearning/atlas/keyboard/normalize.js","../../../../../../node_modules/@itslearning/prometheus/assets/inputs/Button/v1/Button.svelte","../../../../../../node_modules/@itslearning/prometheus/assets/modals/Modal/v2/Modal.svelte","../../../../../../node_modules/@itslearning/prometheus/assets/Navigation/Link/v1/Link.svelte","../../../../../../node_modules/@itslearning/prometheus/assets/nodes/EmptyState/v1/EmptyState.svelte","../../../../../../node_modules/@itslearning/prometheus/assets/inputs/IconButton/v1/IconButton.svelte","../../../../../../node_modules/@itslearning/prometheus/assets/dropdowns/Dropdown/v1/dropdownHelper.js","../../../../../../node_modules/@itslearning/prometheus/assets/dropdowns/Dropdown/v1/AnchorItem.svelte","../../../../../../node_modules/@itslearning/prometheus/assets/dropdowns/Dropdown/v1/ButtonItem.svelte","../../../../../../node_modules/@itslearning/atlas/detectors/UserAgentHelper.js","../../../../../../node_modules/@itslearning/prometheus/assets/dropdowns/Dropdown/v1/navigationHelper.js","../../../../../../node_modules/@itslearning/prometheus/assets/dropdowns/Dropdown/v1/ListItem.svelte","../../../../../../node_modules/@itslearning/atlas/generate/guid.js","../../../../../../node_modules/@itslearning/prometheus/assets/dropdowns/Dropdown/v1/List.svelte","../../../../../../node_modules/@itslearning/prometheus/assets/dropdowns/Dropdown/v1/Dropdown.svelte","../../../../../../node_modules/@itslearning/prometheus/assets/dropdowns/ButtonDropdown/v1/ButtonDropdown.svelte","../../../../../../node_modules/@itslearning/prometheus/assets/patterns/PageHeader/v1/PageHeader.svelte","../../../../../../node_modules/@itslearning/prometheus/assets/templates/Page/v1/Page.svelte","../../../../../../node_modules/@itslearning/prometheus/assets/inputs/TextField/v1/TextInput.svelte","../../../../../../node_modules/@itslearning/prometheus/assets/inputs/TextField/v1/TextField.svelte","../../../../../../node_modules/@itslearning/prometheus/assets/inputs/ColorPicker/v1/ColorPicker.svelte","../../../planner-common/config.js","../../../planner-common/i18n.js","../../../planner-common/constants.js","../../../planner-common/components/EditTopicModal/EditTopicModal.svelte","../../../../../../node_modules/svelte/src/runtime/store/index.js","../../../../../../node_modules/@itslearning/prometheus/assets/inputs/Checkbox/v1/Checkbox.svelte","../../../../../../node_modules/@itslearning/prometheus/assets/inputs/DatePicker/v1/dateHelpers.js","../../../../../../node_modules/@itslearning/prometheus/assets/inputs/DatePicker/v1/DatePicker.svelte","../../../../../../node_modules/@itslearning/prometheus/assets/inputs/DatePickerField/v1/DatePickerField.svelte","../../../../../../node_modules/@itslearning/prometheus/assets/feedback/Banner/v1/Banner.svelte","../../../planner-common/components/ConnectToCalendarModal/ConnectToCalendarModalError.svelte","../../../../../../node_modules/@itslearning/prometheus/assets/inputs/Select/v1/Select.svelte","../../../planner-common/components/ConnectToCalendarModal/ConnectToCalendarSelector.svelte","../../../../../../node_modules/@itslearning/atlas/network/NetworkError.js","../../../../../../node_modules/@itslearning/atlas/network/responseStatuses.js","../../../../../../node_modules/@itslearning/atlas/network/fetch.js","../../../planner-common/api.js","../../../planner-common/helpers/planImageHelper.js","../../../planner-common/helpers/loadPlansHelper.js","../../../planner-common/helpers/dateHelper.js","../../../planner-common/components/ConnectToCalendarModal/ConnectToCalendarModal.svelte","../../../planner-common/components/CopyConfirmAndErrorModal/CopyConfirmAndErrorModal.svelte","../../../planner-common/components/DateTimePicker/TimeSelector.svelte","../../../planner-common/components/SetDatesModal/SetDatesModalError.svelte","../../../planner-common/components/SetDatesModal/SetDatesModal.svelte","../../../../../../node_modules/@itslearning/atlas/network/kpi.js","../../../planner-common/helpers/kpiHelper.js","../../../planner-common/logic/planPage/stores.js","../../../planner-common/controllers/updatePlanController.js","../../../planner-common/helpers/converters.js","../../../planner-common/helpers/makeCourseForDropdownHelper.js","../../../planner-common/helpers/visibilityHelper.js","../../../planner-common/components/PlanActions/PlanActions.svelte","../../../../../../node_modules/@itslearning/prometheus/assets/modals/Tooltip/v1/Tooltip.svelte","../../../planner-common/components/ElementProgress/ElementProgress.svelte","../../../planner-common/components/PlanCompleted/PlanCompleted.svelte","../../../planner-common/helpers/backLinkHelper.js","../../../planner-common/components/ProgressPlanLink/ProgressPlanLink.svelte","../../../planner-common/components/ProgressBar/ProgressBar.svelte","../../../planner-common/helpers/isPlanCompletedHelper.js","../../../planner-common/components/PlanCard/PlanCard.svelte","../../../../../../node_modules/@itslearning/prometheus/assets/inputs/Switch/v1/Switch.svelte","../../../planner-common/helpers/loadTopicsHelper.js","../../../planner-common/logic/plans/stores.js","../../../planner-common/logic/plans/loadDataController.js","../../../../../../node_modules/@itslearning/atlas/dom/Ratecontrol.js","../../../planner-common/logic/topicPage/stores.js","../../../planner-common/components/PlansView/PlansView.svelte","../../../planner-common/components/TableViewLink/TableViewLink.svelte","../../../planner-common/components/UseReadyMadeContentLink/UseReadyMadeContentLink.svelte","../../../planner-common/components/RichText/RichText.svelte","../../../planner-common/controllers/topicController.js","../../src/lib/TextField/TextField.svelte","../../../../../../node_modules/@itslearning/prometheus/assets/inputs/Combobox/v1/helpers.js","../../../../../../node_modules/@itslearning/prometheus/assets/inputs/Combobox/v1/ComboboxValueContainer.svelte","../../../../../../node_modules/@itslearning/prometheus/assets/inputs/Combobox/v1/ComboboxPopupContainer.svelte","../../../../../../node_modules/@itslearning/prometheus/assets/inputs/Combobox/v1/standard.provider.js","../../../../../../node_modules/@itslearning/prometheus/assets/inputs/Combobox/v1/Combobox.svelte","../../../../../../node_modules/@itslearning/prometheus/assets/modals/Modal/v1/ModalEvents.js","../../../../../../node_modules/@itslearning/prometheus/assets/modals/Modal/v1/Modal.svelte","../../../planner-common/components/AddTermModal/AddTermModalEmptyState.svelte","../../../planner-common/components/AddTermModal/TermsDataProvider.js","../../../planner-common/components/AddTermModal/AddTermModal.svelte","../../../planner-common/components/Button/PlainButton.svelte","../../src/lib/TopicTerm/TopicTerm.svelte","../../../../../../node_modules/@itslearning/prometheus/assets/lists/List/v1/List.svelte","../../../../../../node_modules/@itslearning/prometheus/assets/lists/ListElement/v1/ListElement.svelte","../../../../../../node_modules/@itslearning/prometheus/assets/lists/Cell/v1/Cell.svelte","../../../../../../node_modules/@itslearning/prometheus/assets/lists/CheckboxCell/v1/CheckboxCell.svelte","../../../../../../node_modules/@itslearning/prometheus/assets/lists/LearningObjectiveCell/v1/LearningObjectiveCell.svelte","../../../../../../node_modules/svelte/src/runtime/easing/index.js","../../../../../../node_modules/svelte/src/runtime/transition/index.js","../../../../../../node_modules/@itslearning/prometheus/assets/modals/LearningObjectivePicker/v1/LearningObjectiveTreeItem.svelte","../../../../../../node_modules/@itslearning/prometheus/assets/modals/LearningObjectivePicker/v1/LearningObjectivePicker.svelte","../../../planner-common/components/LearningObjective/LearningObjective.svelte","../../../planner-common/components/TooltipDialog/TooltipDialog.svelte","../../../planner-common/controllers/learningObjectivesController.js","../../src/lib/LearningObjectives/LearningObjectives.svelte","../../src/lib/TopicRubric/TopicRubric.svelte","../../src/lib/CustomFields/CustomFields.svelte","../../src/lib/PlanOrderSelector/PlanOrderSelector.svelte","../../src/lib/helpers/showCustomFieldsSectionHelper.js","../../src/lib/App/App.svelte","../../../planner-common/helpers/CommonFunctions.js","../../../planner-common/helpers/TextEditor.js","../../src/main.js"],"sourcesContent":["/**\r\n * @module network/postMessage\r\n */\r\n\r\n/**\r\n * Executes a PostMessage to the current parent.\r\n * @param {*} message The message to be sent.\r\n */\r\nexport function postMessage(message, parentFrame = window.parent) {\r\n if (window.self !== window.top) {\r\n parentFrame.postMessage(JSON.stringify(message), '*');\r\n }\r\n}\r\n\r\n/**\r\n * Executes a PostMessage to the topmost frame.\r\n * @param {*} message The message to be sent.\r\n */\r\nexport function postMessageToTopmostFrame(message, parentFrame = window.parent) {\r\n postMessage(message);\r\n\r\n if (parentFrame !== parentFrame.top) {\r\n postMessageToTopmostFrame(message, parentFrame.parent);\r\n }\r\n}\r\n\r\n/**\r\n * Attach to a post message\r\n * @param {*} window Window instance to which the listener will be attached\r\n * @param {*} messageName Name of message(event)\r\n * @param {*} handler Callback\r\n */\r\nexport function attachPostMessageEventListener(window, messageName, handler) {\r\n window.addEventListener('message', (event) => {\r\n if (event.data) {\r\n try {\r\n const message = JSON.parse(event.data);\r\n\r\n if (message && message.messageName && message.messageName === messageName) {\r\n handler(message);\r\n }\r\n } catch (e) {\r\n // ignore calls with incorrect json\r\n }\r\n }\r\n });\r\n}\r\n","import { postMessageToTopmostFrame } from '../network/postMessage';\r\n\r\n/**\r\n * Helper class for bubbling up client script click event to the top frame from inner iframe.\r\n * @module frames/IFrameClickEventHelper\r\n */\r\n\r\n/**\r\n * Allows click events to bubble up to the parent frame.\r\n */\r\nexport const registerDocumentClickBubblingOnTop = () => {\r\n const deviceAgent = navigator.userAgent.toLowerCase();\r\n const agentId = deviceAgent.match(/(iphone|ipod|ipad)/);\r\n\r\n const iframeClickBubbleMessage = { messageName: 'iframeClickBubble' };\r\n document.addEventListener('click', () => { postMessageToTopmostFrame(iframeClickBubbleMessage); });\r\n\r\n if (!agentId) {\r\n const iframeTouchstartBubbleMessage = { messageName: 'iframeTouchstartBubble' };\r\n document.addEventListener('touchstart', () => { postMessageToTopmostFrame(iframeTouchstartBubbleMessage); });\r\n }\r\n};","/** @returns {void} */\nexport function noop() {}\n\nexport const identity = (x) => x;\n\n/**\n * @template T\n * @template S\n * @param {T} tar\n * @param {S} src\n * @returns {T & S}\n */\nexport function assign(tar, src) {\n\t// @ts-ignore\n\tfor (const k in src) tar[k] = src[k];\n\treturn /** @type {T & S} */ (tar);\n}\n\n// Adapted from https://github.com/then/is-promise/blob/master/index.js\n// Distributed under MIT License https://github.com/then/is-promise/blob/master/LICENSE\n/**\n * @param {any} value\n * @returns {value is PromiseLike<any>}\n */\nexport function is_promise(value) {\n\treturn (\n\t\t!!value &&\n\t\t(typeof value === 'object' || typeof value === 'function') &&\n\t\ttypeof (/** @type {any} */ (value).then) === 'function'\n\t);\n}\n\n/** @returns {void} */\nexport function add_location(element, file, line, column, char) {\n\telement.__svelte_meta = {\n\t\tloc: { file, line, column, char }\n\t};\n}\n\nexport function run(fn) {\n\treturn fn();\n}\n\nexport function blank_object() {\n\treturn Object.create(null);\n}\n\n/**\n * @param {Function[]} fns\n * @returns {void}\n */\nexport function run_all(fns) {\n\tfns.forEach(run);\n}\n\n/**\n * @param {any} thing\n * @returns {thing is Function}\n */\nexport function is_function(thing) {\n\treturn typeof thing === 'function';\n}\n\n/** @returns {boolean} */\nexport function safe_not_equal(a, b) {\n\treturn a != a ? b == b : a !== b || (a && typeof a === 'object') || typeof a === 'function';\n}\n\nlet src_url_equal_anchor;\n\n/**\n * @param {string} element_src\n * @param {string} url\n * @returns {boolean}\n */\nexport function src_url_equal(element_src, url) {\n\tif (element_src === url) return true;\n\tif (!src_url_equal_anchor) {\n\t\tsrc_url_equal_anchor = document.createElement('a');\n\t}\n\t// This is actually faster than doing URL(..).href\n\tsrc_url_equal_anchor.href = url;\n\treturn element_src === src_url_equal_anchor.href;\n}\n\n/** @param {string} srcset */\nfunction split_srcset(srcset) {\n\treturn srcset.split(',').map((src) => src.trim().split(' ').filter(Boolean));\n}\n\n/**\n * @param {HTMLSourceElement | HTMLImageElement} element_srcset\n * @param {string | undefined | null} srcset\n * @returns {boolean}\n */\nexport function srcset_url_equal(element_srcset, srcset) {\n\tconst element_urls = split_srcset(element_srcset.srcset);\n\tconst urls = split_srcset(srcset || '');\n\n\treturn (\n\t\turls.length === element_urls.length &&\n\t\turls.every(\n\t\t\t([url, width], i) =>\n\t\t\t\twidth === element_urls[i][1] &&\n\t\t\t\t// We need to test both ways because Vite will create an a full URL with\n\t\t\t\t// `new URL(asset, import.meta.url).href` for the client when `base: './'`, and the\n\t\t\t\t// relative URLs inside srcset are not automatically resolved to absolute URLs by\n\t\t\t\t// browsers (in contrast to img.src). This means both SSR and DOM code could\n\t\t\t\t// contain relative or absolute URLs.\n\t\t\t\t(src_url_equal(element_urls[i][0], url) || src_url_equal(url, element_urls[i][0]))\n\t\t)\n\t);\n}\n\n/** @returns {boolean} */\nexport function not_equal(a, b) {\n\treturn a != a ? b == b : a !== b;\n}\n\n/** @returns {boolean} */\nexport function is_empty(obj) {\n\treturn Object.keys(obj).length === 0;\n}\n\n/** @returns {void} */\nexport function validate_store(store, name) {\n\tif (store != null && typeof store.subscribe !== 'function') {\n\t\tthrow new Error(`'${name}' is not a store with a 'subscribe' method`);\n\t}\n}\n\nexport function subscribe(store, ...callbacks) {\n\tif (store == null) {\n\t\tfor (const callback of callbacks) {\n\t\t\tcallback(undefined);\n\t\t}\n\t\treturn noop;\n\t}\n\tconst unsub = store.subscribe(...callbacks);\n\treturn unsub.unsubscribe ? () => unsub.unsubscribe() : unsub;\n}\n\n/**\n * Get the current value from a store by subscribing and immediately unsubscribing.\n *\n * https://svelte.dev/docs/svelte-store#get\n * @template T\n * @param {import('../store/public.js').Readable<T>} store\n * @returns {T}\n */\nexport function get_store_value(store) {\n\tlet value;\n\tsubscribe(store, (_) => (value = _))();\n\treturn value;\n}\n\n/** @returns {void} */\nexport function component_subscribe(component, store, callback) {\n\tcomponent.$$.on_destroy.push(subscribe(store, callback));\n}\n\nexport function create_slot(definition, ctx, $$scope, fn) {\n\tif (definition) {\n\t\tconst slot_ctx = get_slot_context(definition, ctx, $$scope, fn);\n\t\treturn definition[0](slot_ctx);\n\t}\n}\n\nfunction get_slot_context(definition, ctx, $$scope, fn) {\n\treturn definition[1] && fn ? assign($$scope.ctx.slice(), definition[1](fn(ctx))) : $$scope.ctx;\n}\n\nexport function get_slot_changes(definition, $$scope, dirty, fn) {\n\tif (definition[2] && fn) {\n\t\tconst lets = definition[2](fn(dirty));\n\t\tif ($$scope.dirty === undefined) {\n\t\t\treturn lets;\n\t\t}\n\t\tif (typeof lets === 'object') {\n\t\t\tconst merged = [];\n\t\t\tconst len = Math.max($$scope.dirty.length, lets.length);\n\t\t\tfor (let i = 0; i < len; i += 1) {\n\t\t\t\tmerged[i] = $$scope.dirty[i] | lets[i];\n\t\t\t}\n\t\t\treturn merged;\n\t\t}\n\t\treturn $$scope.dirty | lets;\n\t}\n\treturn $$scope.dirty;\n}\n\n/** @returns {void} */\nexport function update_slot_base(\n\tslot,\n\tslot_definition,\n\tctx,\n\t$$scope,\n\tslot_changes,\n\tget_slot_context_fn\n) {\n\tif (slot_changes) {\n\t\tconst slot_context = get_slot_context(slot_definition, ctx, $$scope, get_slot_context_fn);\n\t\tslot.p(slot_context, slot_changes);\n\t}\n}\n\n/** @returns {void} */\nexport function update_slot(\n\tslot,\n\tslot_definition,\n\tctx,\n\t$$scope,\n\tdirty,\n\tget_slot_changes_fn,\n\tget_slot_context_fn\n) {\n\tconst slot_changes = get_slot_changes(slot_definition, $$scope, dirty, get_slot_changes_fn);\n\tupdate_slot_base(slot, slot_definition, ctx, $$scope, slot_changes, get_slot_context_fn);\n}\n\n/** @returns {any[] | -1} */\nexport function get_all_dirty_from_scope($$scope) {\n\tif ($$scope.ctx.length > 32) {\n\t\tconst dirty = [];\n\t\tconst length = $$scope.ctx.length / 32;\n\t\tfor (let i = 0; i < length; i++) {\n\t\t\tdirty[i] = -1;\n\t\t}\n\t\treturn dirty;\n\t}\n\treturn -1;\n}\n\n/** @returns {{}} */\nexport function exclude_internal_props(props) {\n\tconst result = {};\n\tfor (const k in props) if (k[0] !== '$') result[k] = props[k];\n\treturn result;\n}\n\n/** @returns {{}} */\nexport function compute_rest_props(props, keys) {\n\tconst rest = {};\n\tkeys = new Set(keys);\n\tfor (const k in props) if (!keys.has(k) && k[0] !== '$') rest[k] = props[k];\n\treturn rest;\n}\n\n/** @returns {{}} */\nexport function compute_slots(slots) {\n\tconst result = {};\n\tfor (const key in slots) {\n\t\tresult[key] = true;\n\t}\n\treturn result;\n}\n\n/** @returns {(this: any, ...args: any[]) => void} */\nexport function once(fn) {\n\tlet ran = false;\n\treturn function (...args) {\n\t\tif (ran) return;\n\t\tran = true;\n\t\tfn.call(this, ...args);\n\t};\n}\n\nexport function null_to_empty(value) {\n\treturn value == null ? '' : value;\n}\n\nexport function set_store_value(store, ret, value) {\n\tstore.set(value);\n\treturn ret;\n}\n\nexport const has_prop = (obj, prop) => Object.prototype.hasOwnProperty.call(obj, prop);\n\nexport function action_destroyer(action_result) {\n\treturn action_result && is_function(action_result.destroy) ? action_result.destroy : noop;\n}\n\n/** @param {number | string} value\n * @returns {[number, string]}\n */\nexport function split_css_unit(value) {\n\tconst split = typeof value === 'string' && value.match(/^\\s*(-?[\\d.]+)([^\\s]*)\\s*$/);\n\treturn split ? [parseFloat(split[1]), split[2] || 'px'] : [/** @type {number} */ (value), 'px'];\n}\n\nexport const contenteditable_truthy_values = ['', true, 1, 'true', 'contenteditable'];\n","import { noop } from './utils.js';\n\nexport const is_client = typeof window !== 'undefined';\n\n/** @type {() => number} */\nexport let now = is_client ? () => window.performance.now() : () => Date.now();\n\nexport let raf = is_client ? (cb) => requestAnimationFrame(cb) : noop;\n\n// used internally for testing\n/** @returns {void} */\nexport function set_now(fn) {\n\tnow = fn;\n}\n\n/** @returns {void} */\nexport function set_raf(fn) {\n\traf = fn;\n}\n","import { raf } from './environment.js';\n\nconst tasks = new Set();\n\n/**\n * @param {number} now\n * @returns {void}\n */\nfunction run_tasks(now) {\n\ttasks.forEach((task) => {\n\t\tif (!task.c(now)) {\n\t\t\ttasks.delete(task);\n\t\t\ttask.f();\n\t\t}\n\t});\n\tif (tasks.size !== 0) raf(run_tasks);\n}\n\n/**\n * For testing purposes only!\n * @returns {void}\n */\nexport function clear_loops() {\n\ttasks.clear();\n}\n\n/**\n * Creates a new task that runs on each raf frame\n * until it returns a falsy value or is aborted\n * @param {import('./private.js').TaskCallback} callback\n * @returns {import('./private.js').Task}\n */\nexport function loop(callback) {\n\t/** @type {import('./private.js').TaskEntry} */\n\tlet task;\n\tif (tasks.size === 0) raf(run_tasks);\n\treturn {\n\t\tpromise: new Promise((fulfill) => {\n\t\t\ttasks.add((task = { c: callback, f: fulfill }));\n\t\t}),\n\t\tabort() {\n\t\t\ttasks.delete(task);\n\t\t}\n\t};\n}\n","/** @type {typeof globalThis} */\nexport const globals =\n\ttypeof window !== 'undefined'\n\t\t? window\n\t\t: typeof globalThis !== 'undefined'\n\t\t? globalThis\n\t\t: // @ts-ignore Node typings have this\n\t\t global;\n","import { contenteditable_truthy_values, has_prop } from './utils.js';\n\nimport { ResizeObserverSingleton } from './ResizeObserverSingleton.js';\n\n// Track which nodes are claimed during hydration. Unclaimed nodes can then be removed from the DOM\n// at the end of hydration without touching the remaining nodes.\nlet is_hydrating = false;\n\n/**\n * @returns {void}\n */\nexport function start_hydrating() {\n\tis_hydrating = true;\n}\n\n/**\n * @returns {void}\n */\nexport function end_hydrating() {\n\tis_hydrating = false;\n}\n\n/**\n * @param {number} low\n * @param {number} high\n * @param {(index: number) => number} key\n * @param {number} value\n * @returns {number}\n */\nfunction upper_bound(low, high, key, value) {\n\t// Return first index of value larger than input value in the range [low, high)\n\twhile (low < high) {\n\t\tconst mid = low + ((high - low) >> 1);\n\t\tif (key(mid) <= value) {\n\t\t\tlow = mid + 1;\n\t\t} else {\n\t\t\thigh = mid;\n\t\t}\n\t}\n\treturn low;\n}\n\n/**\n * @param {NodeEx} target\n * @returns {void}\n */\nfunction init_hydrate(target) {\n\tif (target.hydrate_init) return;\n\ttarget.hydrate_init = true;\n\t// We know that all children have claim_order values since the unclaimed have been detached if target is not <head>\n\n\tlet children = /** @type {ArrayLike<NodeEx2>} */ (target.childNodes);\n\t// If target is <head>, there may be children without claim_order\n\tif (target.nodeName === 'HEAD') {\n\t\tconst my_children = [];\n\t\tfor (let i = 0; i < children.length; i++) {\n\t\t\tconst node = children[i];\n\t\t\tif (node.claim_order !== undefined) {\n\t\t\t\tmy_children.push(node);\n\t\t\t}\n\t\t}\n\t\tchildren = my_children;\n\t}\n\t/*\n\t * Reorder claimed children optimally.\n\t * We can reorder claimed children optimally by finding the longest subsequence of\n\t * nodes that are already claimed in order and only moving the rest. The longest\n\t * subsequence of nodes that are claimed in order can be found by\n\t * computing the longest increasing subsequence of .claim_order values.\n\t *\n\t * This algorithm is optimal in generating the least amount of reorder operations\n\t * possible.\n\t *\n\t * Proof:\n\t * We know that, given a set of reordering operations, the nodes that do not move\n\t * always form an increasing subsequence, since they do not move among each other\n\t * meaning that they must be already ordered among each other. Thus, the maximal\n\t * set of nodes that do not move form a longest increasing subsequence.\n\t */\n\t// Compute longest increasing subsequence\n\t// m: subsequence length j => index k of smallest value that ends an increasing subsequence of length j\n\tconst m = new Int32Array(children.length + 1);\n\t// Predecessor indices + 1\n\tconst p = new Int32Array(children.length);\n\tm[0] = -1;\n\tlet longest = 0;\n\tfor (let i = 0; i < children.length; i++) {\n\t\tconst current = children[i].claim_order;\n\t\t// Find the largest subsequence length such that it ends in a value less than our current value\n\t\t// upper_bound returns first greater value, so we subtract one\n\t\t// with fast path for when we are on the current longest subsequence\n\t\tconst seq_len =\n\t\t\t(longest > 0 && children[m[longest]].claim_order <= current\n\t\t\t\t? longest + 1\n\t\t\t\t: upper_bound(1, longest, (idx) => children[m[idx]].claim_order, current)) - 1;\n\t\tp[i] = m[seq_len] + 1;\n\t\tconst new_len = seq_len + 1;\n\t\t// We can guarantee that current is the smallest value. Otherwise, we would have generated a longer sequence.\n\t\tm[new_len] = i;\n\t\tlongest = Math.max(new_len, longest);\n\t}\n\t// The longest increasing subsequence of nodes (initially reversed)\n\n\t/**\n\t * @type {NodeEx2[]}\n\t */\n\tconst lis = [];\n\t// The rest of the nodes, nodes that will be moved\n\n\t/**\n\t * @type {NodeEx2[]}\n\t */\n\tconst to_move = [];\n\tlet last = children.length - 1;\n\tfor (let cur = m[longest] + 1; cur != 0; cur = p[cur - 1]) {\n\t\tlis.push(children[cur - 1]);\n\t\tfor (; last >= cur; last--) {\n\t\t\tto_move.push(children[last]);\n\t\t}\n\t\tlast--;\n\t}\n\tfor (; last >= 0; last--) {\n\t\tto_move.push(children[last]);\n\t}\n\tlis.reverse();\n\t// We sort the nodes being moved to guarantee that their insertion order matches the claim order\n\tto_move.sort((a, b) => a.claim_order - b.claim_order);\n\t// Finally, we move the nodes\n\tfor (let i = 0, j = 0; i < to_move.length; i++) {\n\t\twhile (j < lis.length && to_move[i].claim_order >= lis[j].claim_order) {\n\t\t\tj++;\n\t\t}\n\t\tconst anchor = j < lis.length ? lis[j] : null;\n\t\ttarget.insertBefore(to_move[i], anchor);\n\t}\n}\n\n/**\n * @param {Node} target\n * @param {Node} node\n * @returns {void}\n */\nexport function append(target, node) {\n\ttarget.appendChild(node);\n}\n\n/**\n * @param {Node} target\n * @param {string} style_sheet_id\n * @param {string} styles\n * @returns {void}\n */\nexport function append_styles(target, style_sheet_id, styles) {\n\tconst append_styles_to = get_root_for_style(target);\n\tif (!append_styles_to.getElementById(style_sheet_id)) {\n\t\tconst style = element('style');\n\t\tstyle.id = style_sheet_id;\n\t\tstyle.textContent = styles;\n\t\tappend_stylesheet(append_styles_to, style);\n\t}\n}\n\n/**\n * @param {Node} node\n * @returns {ShadowRoot | Document}\n */\nexport function get_root_for_style(node) {\n\tif (!node) return document;\n\tconst root = node.getRootNode ? node.getRootNode() : node.ownerDocument;\n\tif (root && /** @type {ShadowRoot} */ (root).host) {\n\t\treturn /** @type {ShadowRoot} */ (root);\n\t}\n\treturn node.ownerDocument;\n}\n\n/**\n * @param {Node} node\n * @returns {CSSStyleSheet}\n */\nexport function append_empty_stylesheet(node) {\n\tconst style_element = element('style');\n\t// For transitions to work without 'style-src: unsafe-inline' Content Security Policy,\n\t// these empty tags need to be allowed with a hash as a workaround until we move to the Web Animations API.\n\t// Using the hash for the empty string (for an empty tag) works in all browsers except Safari.\n\t// So as a workaround for the workaround, when we append empty style tags we set their content to /* empty */.\n\t// The hash 'sha256-9OlNO0DNEeaVzHL4RZwCLsBHA8WBQ8toBp/4F5XV2nc=' will then work even in Safari.\n\tstyle_element.textContent = '/* empty */';\n\tappend_stylesheet(get_root_for_style(node), style_element);\n\treturn style_element.sheet;\n}\n\n/**\n * @param {ShadowRoot | Document} node\n * @param {HTMLStyleElement} style\n * @returns {CSSStyleSheet}\n */\nfunction append_stylesheet(node, style) {\n\tappend(/** @type {Document} */ (node).head || node, style);\n\treturn style.sheet;\n}\n\n/**\n * @param {NodeEx} target\n * @param {NodeEx} node\n * @returns {void}\n */\nexport function append_hydration(target, node) {\n\tif (is_hydrating) {\n\t\tinit_hydrate(target);\n\t\tif (\n\t\t\ttarget.actual_end_child === undefined ||\n\t\t\t(target.actual_end_child !== null && target.actual_end_child.parentNode !== target)\n\t\t) {\n\t\t\ttarget.actual_end_child = target.firstChild;\n\t\t}\n\t\t// Skip nodes of undefined ordering\n\t\twhile (target.actual_end_child !== null && target.actual_end_child.claim_order === undefined) {\n\t\t\ttarget.actual_end_child = target.actual_end_child.nextSibling;\n\t\t}\n\t\tif (node !== target.actual_end_child) {\n\t\t\t// We only insert if the ordering of this node should be modified or the parent node is not target\n\t\t\tif (node.claim_order !== undefined || node.parentNode !== target) {\n\t\t\t\ttarget.insertBefore(node, target.actual_end_child);\n\t\t\t}\n\t\t} else {\n\t\t\ttarget.actual_end_child = node.nextSibling;\n\t\t}\n\t} else if (node.parentNode !== target || node.nextSibling !== null) {\n\t\ttarget.appendChild(node);\n\t}\n}\n\n/**\n * @param {Node} target\n * @param {Node} node\n * @param {Node} [anchor]\n * @returns {void}\n */\nexport function insert(target, node, anchor) {\n\ttarget.insertBefore(node, anchor || null);\n}\n\n/**\n * @param {NodeEx} target\n * @param {NodeEx} node\n * @param {NodeEx} [anchor]\n * @returns {void}\n */\nexport function insert_hydration(target, node, anchor) {\n\tif (is_hydrating && !anchor) {\n\t\tappend_hydration(target, node);\n\t} else if (node.parentNode !== target || node.nextSibling != anchor) {\n\t\ttarget.insertBefore(node, anchor || null);\n\t}\n}\n\n/**\n * @param {Node} node\n * @returns {void}\n */\nexport function detach(node) {\n\tif (node.parentNode) {\n\t\tnode.parentNode.removeChild(node);\n\t}\n}\n\n/**\n * @returns {void} */\nexport function destroy_each(iterations, detaching) {\n\tfor (let i = 0; i < iterations.length; i += 1) {\n\t\tif (iterations[i]) iterations[i].d(detaching);\n\t}\n}\n\n/**\n * @template {keyof HTMLElementTagNameMap} K\n * @param {K} name\n * @returns {HTMLElementTagNameMap[K]}\n */\nexport function element(name) {\n\treturn document.createElement(name);\n}\n\n/**\n * @template {keyof HTMLElementTagNameMap} K\n * @param {K} name\n * @param {string} is\n * @returns {HTMLElementTagNameMap[K]}\n */\nexport function element_is(name, is) {\n\treturn document.createElement(name, { is });\n}\n\n/**\n * @template T\n * @template {keyof T} K\n * @param {T} obj\n * @param {K[]} exclude\n * @returns {Pick<T, Exclude<keyof T, K>>}\n */\nexport function object_without_properties(obj, exclude) {\n\tconst target = /** @type {Pick<T, Exclude<keyof T, K>>} */ ({});\n\tfor (const k in obj) {\n\t\tif (\n\t\t\thas_prop(obj, k) &&\n\t\t\t// @ts-ignore\n\t\t\texclude.indexOf(k) === -1\n\t\t) {\n\t\t\t// @ts-ignore\n\t\t\ttarget[k] = obj[k];\n\t\t}\n\t}\n\treturn target;\n}\n\n/**\n * @template {keyof SVGElementTagNameMap} K\n * @param {K} name\n * @returns {SVGElement}\n */\nexport function svg_element(name) {\n\treturn document.createElementNS('http://www.w3.org/2000/svg', name);\n}\n\n/**\n * @param {string} data\n * @returns {Text}\n */\nexport function text(data) {\n\treturn document.createTextNode(data);\n}\n\n/**\n * @returns {Text} */\nexport function space() {\n\treturn text(' ');\n}\n\n/**\n * @returns {Text} */\nexport function empty() {\n\treturn text('');\n}\n\n/**\n * @param {string} content\n * @returns {Comment}\n */\nexport function comment(content) {\n\treturn document.createComment(content);\n}\n\n/**\n * @param {EventTarget} node\n * @param {string} event\n * @param {EventListenerOrEventListenerObject} handler\n * @param {boolean | AddEventListenerOptions | EventListenerOptions} [options]\n * @returns {() => void}\n */\nexport function listen(node, event, handler, options) {\n\tnode.addEventListener(event, handler, options);\n\treturn () => node.removeEventListener(event, handler, options);\n}\n\n/**\n * @returns {(event: any) => any} */\nexport function prevent_default(fn) {\n\treturn function (event) {\n\t\tevent.preventDefault();\n\t\t// @ts-ignore\n\t\treturn fn.call(this, event);\n\t};\n}\n\n/**\n * @returns {(event: any) => any} */\nexport function stop_propagation(fn) {\n\treturn function (event) {\n\t\tevent.stopPropagation();\n\t\t// @ts-ignore\n\t\treturn fn.call(this, event);\n\t};\n}\n\n/**\n * @returns {(event: any) => any} */\nexport function stop_immediate_propagation(fn) {\n\treturn function (event) {\n\t\tevent.stopImmediatePropagation();\n\t\t// @ts-ignore\n\t\treturn fn.call(this, event);\n\t};\n}\n\n/**\n * @returns {(event: any) => void} */\nexport function self(fn) {\n\treturn function (event) {\n\t\t// @ts-ignore\n\t\tif (event.target === this) fn.call(this, event);\n\t};\n}\n\n/**\n * @returns {(event: any) => void} */\nexport function trusted(fn) {\n\treturn function (event) {\n\t\t// @ts-ignore\n\t\tif (event.isTrusted) fn.call(this, event);\n\t};\n}\n\n/**\n * @param {Element} node\n * @param {string} attribute\n * @param {string} [value]\n * @returns {void}\n */\nexport function attr(node, attribute, value) {\n\tif (value == null) node.removeAttribute(attribute);\n\telse if (node.getAttribute(attribute) !== value) node.setAttribute(attribute, value);\n}\n/**\n * List of attributes that should always be set through the attr method,\n * because updating them through the property setter doesn't work reliably.\n * In the example of `width`/`height`, the problem is that the setter only\n * accepts numeric values, but the attribute can also be set to a string like `50%`.\n * If this list becomes too big, rethink this approach.\n */\nconst always_set_through_set_attribute = ['width', 'height'];\n\n/**\n * @param {Element & ElementCSSInlineStyle} node\n * @param {{ [x: string]: string }} attributes\n * @returns {void}\n */\nexport function set_attributes(node, attributes) {\n\t// @ts-ignore\n\tconst descriptors = Object.getOwnPropertyDescriptors(node.__proto__);\n\tfor (const key in attributes) {\n\t\tif (attributes[key] == null) {\n\t\t\tnode.removeAttribute(key);\n\t\t} else if (key === 'style') {\n\t\t\tnode.style.cssText = attributes[key];\n\t\t} else if (key === '__value') {\n\t\t\t/** @type {any} */ (node).value = node[key] = attributes[key];\n\t\t} else if (\n\t\t\tdescriptors[key] &&\n\t\t\tdescriptors[key].set &&\n\t\t\talways_set_through_set_attribute.indexOf(key) === -1\n\t\t) {\n\t\t\tnode[key] = attributes[key];\n\t\t} else {\n\t\t\tattr(node, key, attributes[key]);\n\t\t}\n\t}\n}\n\n/**\n * @param {Element & ElementCSSInlineStyle} node\n * @param {{ [x: string]: string }} attributes\n * @returns {void}\n */\nexport function set_svg_attributes(node, attributes) {\n\tfor (const key in attributes) {\n\t\tattr(node, key, attributes[key]);\n\t}\n}\n\n/**\n * @param {Record<string, unknown>} data_map\n * @returns {void}\n */\nexport function set_custom_element_data_map(node, data_map) {\n\tObject.keys(data_map).forEach((key) => {\n\t\tset_custom_element_data(node, key, data_map[key]);\n\t});\n}\n\n/**\n * @returns {void} */\nexport function set_custom_element_data(node, prop, value) {\n\tconst lower = prop.toLowerCase(); // for backwards compatibility with existing behavior we do lowercase first\n\tif (lower in node) {\n\t\tnode[lower] = typeof node[lower] === 'boolean' && value === '' ? true : value;\n\t} else if (prop in node) {\n\t\tnode[prop] = typeof node[prop] === 'boolean' && value === '' ? true : value;\n\t} else {\n\t\tattr(node, prop, value);\n\t}\n}\n\n/**\n * @param {string} tag\n */\nexport function set_dynamic_element_data(tag) {\n\treturn /-/.test(tag) ? set_custom_element_data_map : set_attributes;\n}\n\n/**\n * @returns {void}\n */\nexport function xlink_attr(node, attribute, value) {\n\tnode.setAttributeNS('http://www.w3.org/1999/xlink', attribute, value);\n}\n\n/**\n * @param {HTMLElement} node\n * @returns {string}\n */\nexport function get_svelte_dataset(node) {\n\treturn node.dataset.svelteH;\n}\n\n/**\n * @returns {unknown[]} */\nexport function get_binding_group_value(group, __value, checked) {\n\tconst value = new Set();\n\tfor (let i = 0; i < group.length; i += 1) {\n\t\tif (group[i].checked) value.add(group[i].__value);\n\t}\n\tif (!checked) {\n\t\tvalue.delete(__value);\n\t}\n\treturn Array.from(value);\n}\n\n/**\n * @param {HTMLInputElement[]} group\n * @returns {{ p(...inputs: HTMLInputElement[]): void; r(): void; }}\n */\nexport function init_binding_group(group) {\n\t/**\n\t * @type {HTMLInputElement[]} */\n\tlet _inputs;\n\treturn {\n\t\t/* push */ p(...inputs) {\n\t\t\t_inputs = inputs;\n\t\t\t_inputs.forEach((input) => group.push(input));\n\t\t},\n\t\t/* remove */ r() {\n\t\t\t_inputs.forEach((input) => group.splice(group.indexOf(input), 1));\n\t\t}\n\t};\n}\n\n/**\n * @param {number[]} indexes\n * @returns {{ u(new_indexes: number[]): void; p(...inputs: HTMLInputElement[]): void; r: () => void; }}\n */\nexport function init_binding_group_dynamic(group, indexes) {\n\t/**\n\t * @type {HTMLInputElement[]} */\n\tlet _group = get_binding_group(group);\n\n\t/**\n\t * @type {HTMLInputElement[]} */\n\tlet _inputs;\n\n\tfunction get_binding_group(group) {\n\t\tfor (let i = 0; i < indexes.length; i++) {\n\t\t\tgroup = group[indexes[i]] = group[indexes[i]] || [];\n\t\t}\n\t\treturn group;\n\t}\n\n\t/**\n\t * @returns {void} */\n\tfunction push() {\n\t\t_inputs.forEach((input) => _group.push(input));\n\t}\n\n\t/**\n\t * @returns {void} */\n\tfunction remove() {\n\t\t_inputs.forEach((input) => _group.splice(_group.indexOf(input), 1));\n\t}\n\treturn {\n\t\t/* update */ u(new_indexes) {\n\t\t\tindexes = new_indexes;\n\t\t\tconst new_group = get_binding_group(group);\n\t\t\tif (new_group !== _group) {\n\t\t\t\tremove();\n\t\t\t\t_group = new_group;\n\t\t\t\tpush();\n\t\t\t}\n\t\t},\n\t\t/* push */ p(...inputs) {\n\t\t\t_inputs = inputs;\n\t\t\tpush();\n\t\t},\n\t\t/* remove */ r: remove\n\t};\n}\n\n/** @returns {number} */\nexport function to_number(value) {\n\treturn value === '' ? null : +value;\n}\n\n/** @returns {any[]} */\nexport function time_ranges_to_array(ranges) {\n\tconst array = [];\n\tfor (let i = 0; i < ranges.length; i += 1) {\n\t\tarray.push({ start: ranges.start(i), end: ranges.end(i) });\n\t}\n\treturn array;\n}\n\n/**\n * @param {Element} element\n * @returns {ChildNode[]}\n */\nexport function children(element) {\n\treturn Array.from(element.childNodes);\n}\n\n/**\n * @param {ChildNodeArray} nodes\n * @returns {void}\n */\nfunction init_claim_info(nodes) {\n\tif (nodes.claim_info === undefined) {\n\t\tnodes.claim_info = { last_index: 0, total_claimed: 0 };\n\t}\n}\n\n/**\n * @template {ChildNodeEx} R\n * @param {ChildNodeArray} nodes\n * @param {(node: ChildNodeEx) => node is R} predicate\n * @param {(node: ChildNodeEx) => ChildNodeEx | undefined} process_node\n * @param {() => R} create_node\n * @param {boolean} dont_update_last_index\n * @returns {R}\n */\nfunction claim_node(nodes, predicate, process_node, create_node, dont_update_last_index = false) {\n\t// Try to find nodes in an order such that we lengthen the longest increasing subsequence\n\tinit_claim_info(nodes);\n\tconst result_node = (() => {\n\t\t// We first try to find an element after the previous one\n\t\tfor (let i = nodes.claim_info.last_index; i < nodes.length; i++) {\n\t\t\tconst node = nodes[i];\n\t\t\tif (predicate(node)) {\n\t\t\t\tconst replacement = process_node(node);\n\t\t\t\tif (replacement === undefined) {\n\t\t\t\t\tnodes.splice(i, 1);\n\t\t\t\t} else {\n\t\t\t\t\tnodes[i] = replacement;\n\t\t\t\t}\n\t\t\t\tif (!dont_update_last_index) {\n\t\t\t\t\tnodes.claim_info.last_index = i;\n\t\t\t\t}\n\t\t\t\treturn node;\n\t\t\t}\n\t\t}\n\t\t// Otherwise, we try to find one before\n\t\t// We iterate in reverse so that we don't go too far back\n\t\tfor (let i = nodes.claim_info.last_index - 1; i >= 0; i--) {\n\t\t\tconst node = nodes[i];\n\t\t\tif (predicate(node)) {\n\t\t\t\tconst replacement = process_node(node);\n\t\t\t\tif (replacement === undefined) {\n\t\t\t\t\tnodes.splice(i, 1);\n\t\t\t\t} else {\n\t\t\t\t\tnodes[i] = replacement;\n\t\t\t\t}\n\t\t\t\tif (!dont_update_last_index) {\n\t\t\t\t\tnodes.claim_info.last_index = i;\n\t\t\t\t} else if (replacement === undefined) {\n\t\t\t\t\t// Since we spliced before the last_index, we decrease it\n\t\t\t\t\tnodes.claim_info.last_index--;\n\t\t\t\t}\n\t\t\t\treturn node;\n\t\t\t}\n\t\t}\n\t\t// If we can't find any matching node, we create a new one\n\t\treturn create_node();\n\t})();\n\tresult_node.claim_order = nodes.claim_info.total_claimed;\n\tnodes.claim_info.total_claimed += 1;\n\treturn result_node;\n}\n\n/**\n * @param {ChildNodeArray} nodes\n * @param {string} name\n * @param {{ [key: string]: boolean }} attributes\n * @param {(name: string) => Element | SVGElement} create_element\n * @returns {Element | SVGElement}\n */\nfunction claim_element_base(nodes, name, attributes, create_element) {\n\treturn claim_node(\n\t\tnodes,\n\t\t/** @returns {node is Element | SVGElement} */\n\t\t(node) => node.nodeName === name,\n\t\t/** @param {Element} node */\n\t\t(node) => {\n\t\t\tconst remove = [];\n\t\t\tfor (let j = 0; j < node.attributes.length; j++) {\n\t\t\t\tconst attribute = node.attributes[j];\n\t\t\t\tif (!attributes[attribute.name]) {\n\t\t\t\t\tremove.push(attribute.name);\n\t\t\t\t}\n\t\t\t}\n\t\t\tremove.forEach((v) => node.removeAttribute(v));\n\t\t\treturn undefined;\n\t\t},\n\t\t() => create_element(name)\n\t);\n}\n\n/**\n * @param {ChildNodeArray} nodes\n * @param {string} name\n * @param {{ [key: string]: boolean }} attributes\n * @returns {Element | SVGElement}\n */\nexport function claim_element(nodes, name, attributes) {\n\treturn claim_element_base(nodes, name, attributes, element);\n}\n\n/**\n * @param {ChildNodeArray} nodes\n * @param {string} name\n * @param {{ [key: string]: boolean }} attributes\n * @returns {Element | SVGElement}\n */\nexport function claim_svg_element(nodes, name, attributes) {\n\treturn claim_element_base(nodes, name, attributes, svg_element);\n}\n\n/**\n * @param {ChildNodeArray} nodes\n * @returns {Text}\n */\nexport function claim_text(nodes, data) {\n\treturn claim_node(\n\t\tnodes,\n\t\t/** @returns {node is Text} */\n\t\t(node) => node.nodeType === 3,\n\t\t/** @param {Text} node */\n\t\t(node) => {\n\t\t\tconst data_str = '' + data;\n\t\t\tif (node.data.startsWith(data_str)) {\n\t\t\t\tif (node.data.length !== data_str.length) {\n\t\t\t\t\treturn node.splitText(data_str.length);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tnode.data = data_str;\n\t\t\t}\n\t\t},\n\t\t() => text(data),\n\t\ttrue // Text nodes should not update last index since it is likely not worth it to eliminate an increasing subsequence of actual elements\n\t);\n}\n\n/**\n * @returns {Text} */\nexport function claim_space(nodes) {\n\treturn claim_text(nodes, ' ');\n}\n\n/**\n * @param {ChildNodeArray} nodes\n * @returns {Comment}\n */\nexport function claim_comment(nodes, data) {\n\treturn claim_node(\n\t\tnodes,\n\t\t/** @returns {node is Comment} */\n\t\t(node) => node.nodeType === 8,\n\t\t/** @param {Comment} node */\n\t\t(node) => {\n\t\t\tnode.data = '' + data;\n\t\t\treturn undefined;\n\t\t},\n\t\t() => comment(data),\n\t\ttrue\n\t);\n}\n\nfunction get_comment_idx(nodes, text, start) {\n\tfor (let i = start; i < nodes.length; i += 1) {\n\t\tconst node = nodes[i];\n\t\tif (node.nodeType === 8 /* comment node */ && node.textContent.trim() === text) {\n\t\t\treturn i;\n\t\t}\n\t}\n\treturn -1;\n}\n\n/**\n * @param {boolean} is_svg\n * @returns {HtmlTagHydration}\n */\nexport function claim_html_tag(nodes, is_svg) {\n\t// find html opening tag\n\tconst start_index = get_comment_idx(nodes, 'HTML_TAG_START', 0);\n\tconst end_index = get_comment_idx(nodes, 'HTML_TAG_END', start_index + 1);\n\tif (start_index === -1 || end_index === -1) {\n\t\treturn new HtmlTagHydration(is_svg);\n\t}\n\n\tinit_claim_info(nodes);\n\tconst html_tag_nodes = nodes.splice(start_index, end_index - start_index + 1);\n\tdetach(html_tag_nodes[0]);\n\tdetach(html_tag_nodes[html_tag_nodes.length - 1]);\n\tconst claimed_nodes = html_tag_nodes.slice(1, html_tag_nodes.length - 1);\n\tfor (const n of claimed_nodes) {\n\t\tn.claim_order = nodes.claim_info.total_claimed;\n\t\tnodes.claim_info.total_claimed += 1;\n\t}\n\treturn new HtmlTagHydration(is_svg, claimed_nodes);\n}\n\n/**\n * @param {Text} text\n * @param {unknown} data\n * @returns {void}\n */\nexport function set_data(text, data) {\n\tdata = '' + data;\n\tif (text.data === data) return;\n\ttext.data = /** @type {string} */ (data);\n}\n\n/**\n * @param {Text} text\n * @param {unknown} data\n * @returns {void}\n */\nexport function set_data_contenteditable(text, data) {\n\tdata = '' + data;\n\tif (text.wholeText === data) return;\n\ttext.data = /** @type {string} */ (data);\n}\n\n/**\n * @param {Text} text\n * @param {unknown} data\n * @param {string} attr_value\n * @returns {void}\n */\nexport function set_data_maybe_contenteditable(text, data, attr_value) {\n\tif (~contenteditable_truthy_values.indexOf(attr_value)) {\n\t\tset_data_contenteditable(text, data);\n\t} else {\n\t\tset_data(text, data);\n\t}\n}\n\n/**\n * @returns {void} */\nexport function set_input_value(input, value) {\n\tinput.value = value == null ? '' : value;\n}\n\n/**\n * @returns {void} */\nexport function set_input_type(input, type) {\n\ttry {\n\t\tinput.type = type;\n\t} catch (e) {\n\t\t// do nothing\n\t}\n}\n\n/**\n * @returns {void} */\nexport function set_style(node, key, value, important) {\n\tif (value == null) {\n\t\tnode.style.removeProperty(key);\n\t} else {\n\t\tnode.style.setProperty(key, value, important ? 'important' : '');\n\t}\n}\n\n/**\n * @returns {void} */\nexport function select_option(select, value, mounting) {\n\tfor (let i = 0; i < select.options.length; i += 1) {\n\t\tconst option = select.options[i];\n\t\tif (option.__value === value) {\n\t\t\toption.selected = true;\n\t\t\treturn;\n\t\t}\n\t}\n\tif (!mounting || value !== undefined) {\n\t\tselect.selectedIndex = -1; // no option should be selected\n\t}\n}\n\n/**\n * @returns {void} */\nexport function select_options(select, value) {\n\tfor (let i = 0; i < select.options.length; i += 1) {\n\t\tconst option = select.options[i];\n\t\toption.selected = ~value.indexOf(option.__value);\n\t}\n}\n\nexport function select_value(select) {\n\tconst selected_option = select.querySelector(':checked');\n\treturn selected_option && selected_option.__value;\n}\n\nexport function select_multiple_value(select) {\n\treturn [].map.call(select.querySelectorAll(':checked'), (option) => option.__value);\n}\n// unfortunately this can't be a constant as that wouldn't be tree-shakeable\n// so we cache the result instead\n\n/**\n * @type {boolean} */\nlet crossorigin;\n\n/**\n * @returns {boolean} */\nexport function is_crossorigin() {\n\tif (crossorigin === undefined) {\n\t\tcrossorigin = false;\n\t\ttry {\n\t\t\tif (typeof window !== 'undefined' && window.parent) {\n\t\t\t\tvoid window.parent.document;\n\t\t\t}\n\t\t} catch (error) {\n\t\t\tcrossorigin = true;\n\t\t}\n\t}\n\treturn crossorigin;\n}\n\n/**\n * @param {HTMLElement} node\n * @param {() => void} fn\n * @returns {() => void}\n */\nexport function add_iframe_resize_listener(node, fn) {\n\tconst computed_style = getComputedStyle(node);\n\tif (computed_style.position === 'static') {\n\t\tnode.style.position = 'relative';\n\t}\n\tconst iframe = element('iframe');\n\tiframe.setAttribute(\n\t\t'style',\n\t\t'display: block; position: absolute; top: 0; left: 0; width: 100%; height: 100%; ' +\n\t\t\t'overflow: hidden; border: 0; opacity: 0; pointer-events: none; z-index: -1;'\n\t);\n\tiframe.setAttribute('aria-hidden', 'true');\n\tiframe.tabIndex = -1;\n\tconst crossorigin = is_crossorigin();\n\n\t/**\n\t * @type {() => void}\n\t */\n\tlet unsubscribe;\n\tif (crossorigin) {\n\t\tiframe.src = \"data:text/html,<script>onresize=function(){parent.postMessage(0,'*')}</script>\";\n\t\tunsubscribe = listen(\n\t\t\twindow,\n\t\t\t'message',\n\t\t\t/** @param {MessageEvent} event */ (event) => {\n\t\t\t\tif (event.source === iframe.contentWindow) fn();\n\t\t\t}\n\t\t);\n\t} else {\n\t\tiframe.src = 'about:blank';\n\t\tiframe.onload = () => {\n\t\t\tunsubscribe = listen(iframe.contentWindow, 'resize', fn);\n\t\t\t// make sure an initial resize event is fired _after_ the iframe is loaded (which is asynchronous)\n\t\t\t// see https://github.com/sveltejs/svelte/issues/4233\n\t\t\tfn();\n\t\t};\n\t}\n\tappend(node, iframe);\n\treturn () => {\n\t\tif (crossorigin) {\n\t\t\tunsubscribe();\n\t\t} else if (unsubscribe && iframe.contentWindow) {\n\t\t\tunsubscribe();\n\t\t}\n\t\tdetach(iframe);\n\t};\n}\nexport const resize_observer_content_box = /* @__PURE__ */ new ResizeObserverSingleton({\n\tbox: 'content-box'\n});\nexport const resize_observer_border_box = /* @__PURE__ */ new ResizeObserverSingleton({\n\tbox: 'border-box'\n});\nexport const resize_observer_device_pixel_content_box = /* @__PURE__ */ new ResizeObserverSingleton(\n\t{ box: 'device-pixel-content-box' }\n);\nexport { ResizeObserverSingleton };\n\n/**\n * @returns {void} */\nexport function toggle_class(element, name, toggle) {\n\t// The `!!` is required because an `undefined` flag means flipping the current state.\n\telement.classList.toggle(name, !!toggle);\n}\n\n/**\n * @template T\n * @param {string} type\n * @param {T} [detail]\n * @param {{ bubbles?: boolean, cancelable?: boolean }} [options]\n * @returns {CustomEvent<T>}\n */\nexport function custom_event(type, detail, { bubbles = false, cancelable = false } = {}) {\n\treturn new CustomEvent(type, { detail, bubbles, cancelable });\n}\n\n/**\n * @param {string} selector\n * @param {HTMLElement} parent\n * @returns {ChildNodeArray}\n */\nexport function query_selector_all(selector, parent = document.body) {\n\treturn Array.from(parent.querySelectorAll(selector));\n}\n\n/**\n * @param {string} nodeId\n * @param {HTMLElement} head\n * @returns {any[]}\n */\nexport function head_selector(nodeId, head) {\n\tconst result = [];\n\tlet started = 0;\n\tfor (const node of head.childNodes) {\n\t\tif (node.nodeType === 8 /* comment node */) {\n\t\t\tconst comment = node.textContent.trim();\n\t\t\tif (comment === `HEAD_${nodeId}_END`) {\n\t\t\t\tstarted -= 1;\n\t\t\t\tresult.push(node);\n\t\t\t} else if (comment === `HEAD_${nodeId}_START`) {\n\t\t\t\tstarted += 1;\n\t\t\t\tresult.push(node);\n\t\t\t}\n\t\t} else if (started > 0) {\n\t\t\tresult.push(node);\n\t\t}\n\t}\n\treturn result;\n}\n/** */\nexport class HtmlTag {\n\t/**\n\t * @private\n\t * @default false\n\t */\n\tis_svg = false;\n\t/** parent for creating node */\n\te = undefined;\n\t/** html tag nodes */\n\tn = undefined;\n\t/** target */\n\tt = undefined;\n\t/** anchor */\n\ta = undefined;\n\tconstructor(is_svg = false) {\n\t\tthis.is_svg = is_svg;\n\t\tthis.e = this.n = null;\n\t}\n\n\t/**\n\t * @param {string} html\n\t * @returns {void}\n\t */\n\tc(html) {\n\t\tthis.h(html);\n\t}\n\n\t/**\n\t * @param {string} html\n\t * @param {HTMLElement | SVGElement} target\n\t * @param {HTMLElement | SVGElement} anchor\n\t * @returns {void}\n\t */\n\tm(html, target, anchor = null) {\n\t\tif (!this.e) {\n\t\t\tif (this.is_svg)\n\t\t\t\tthis.e = svg_element(/** @type {keyof SVGElementTagNameMap} */ (target.nodeName));\n\t\t\t/** #7364 target for <template> may be provided as #document-fragment(11) */ else\n\t\t\t\tthis.e = element(\n\t\t\t\t\t/** @type {keyof HTMLElementTagNameMap} */ (\n\t\t\t\t\t\ttarget.nodeType === 11 ? 'TEMPLATE' : target.nodeName\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\tthis.t =\n\t\t\t\ttarget.tagName !== 'TEMPLATE'\n\t\t\t\t\t? target\n\t\t\t\t\t: /** @type {HTMLTemplateElement} */ (target).content;\n\t\t\tthis.c(html);\n\t\t}\n\t\tthis.i(anchor);\n\t}\n\n\t/**\n\t * @param {string} html\n\t * @returns {void}\n\t */\n\th(html) {\n\t\tthis.e.innerHTML = html;\n\t\tthis.n = Array.from(\n\t\t\tthis.e.nodeName === 'TEMPLATE' ? this.e.content.childNodes : this.e.childNodes\n\t\t);\n\t}\n\n\t/**\n\t * @returns {void} */\n\ti(anchor) {\n\t\tfor (let i = 0; i < this.n.length; i += 1) {\n\t\t\tinsert(this.t, this.n[i], anchor);\n\t\t}\n\t}\n\n\t/**\n\t * @param {string} html\n\t * @returns {void}\n\t */\n\tp(html) {\n\t\tthis.d();\n\t\tthis.h(html);\n\t\tthis.i(this.a);\n\t}\n\n\t/**\n\t * @returns {void} */\n\td() {\n\t\tthis.n.forEach(detach);\n\t}\n}\n\nexport class HtmlTagHydration extends HtmlTag {\n\t/** @type {Element[]} hydration claimed nodes */\n\tl = undefined;\n\n\tconstructor(is_svg = false, claimed_nodes) {\n\t\tsuper(is_svg);\n\t\tthis.e = this.n = null;\n\t\tthis.l = claimed_nodes;\n\t}\n\n\t/**\n\t * @param {string} html\n\t * @returns {void}\n\t */\n\tc(html) {\n\t\tif (this.l) {\n\t\t\tthis.n = this.l;\n\t\t} else {\n\t\t\tsuper.c(html);\n\t\t}\n\t}\n\n\t/**\n\t * @returns {void} */\n\ti(anchor) {\n\t\tfor (let i = 0; i < this.n.length; i += 1) {\n\t\t\tinsert_hydration(this.t, this.n[i], anchor);\n\t\t}\n\t}\n}\n\n/**\n * @param {NamedNodeMap} attributes\n * @returns {{}}\n */\nexport function attribute_to_object(attributes) {\n\tconst result = {};\n\tfor (const attribute of attributes) {\n\t\tresult[attribute.name] = attribute.value;\n\t}\n\treturn result;\n}\n\n/**\n * @param {HTMLElement} element\n * @returns {{}}\n */\nexport function get_custom_elements_slots(element) {\n\tconst result = {};\n\telement.childNodes.forEach(\n\t\t/** @param {Element} node */ (node) => {\n\t\t\tresult[node.slot || 'default'] = true;\n\t\t}\n\t);\n\treturn result;\n}\n\nexport function construct_svelte_component(component, props) {\n\treturn new component(props);\n}\n\n/**\n * @typedef {Node & {\n * \tclaim_order?: number;\n * \thydrate_init?: true;\n * \tactual_end_child?: NodeEx;\n * \tchildNodes: NodeListOf<NodeEx>;\n * }} NodeEx\n */\n\n/** @typedef {ChildNode & NodeEx} ChildNodeEx */\n\n/** @typedef {NodeEx & { claim_order: number }} NodeEx2 */\n\n/**\n * @typedef {ChildNodeEx[] & {\n * \tclaim_info?: {\n * \t\tlast_index: number;\n * \t\ttotal_claimed: number;\n * \t};\n * }} ChildNodeArray\n */\n","import { append_empty_stylesheet, detach, get_root_for_style } from './dom.js';\nimport { raf } from './environment.js';\n\n// we need to store the information for multiple documents because a Svelte application could also contain iframes\n// https://github.com/sveltejs/svelte/issues/3624\n/** @type {Map<Document | ShadowRoot, import('./private.d.ts').StyleInformation>} */\nconst managed_styles = new Map();\n\nlet active = 0;\n\n// https://github.com/darkskyapp/string-hash/blob/master/index.js\n/**\n * @param {string} str\n * @returns {number}\n */\nfunction hash(str) {\n\tlet hash = 5381;\n\tlet i = str.length;\n\twhile (i--) hash = ((hash << 5) - hash) ^ str.charCodeAt(i);\n\treturn hash >>> 0;\n}\n\n/**\n * @param {Document | ShadowRoot} doc\n * @param {Element & ElementCSSInlineStyle} node\n * @returns {{ stylesheet: any; rules: {}; }}\n */\nfunction create_style_information(doc, node) {\n\tconst info = { stylesheet: append_empty_stylesheet(node), rules: {} };\n\tmanaged_styles.set(doc, info);\n\treturn info;\n}\n\n/**\n * @param {Element & ElementCSSInlineStyle} node\n * @param {number} a\n * @param {number} b\n * @param {number} duration\n * @param {number} delay\n * @param {(t: number) => number} ease\n * @param {(t: number, u: number) => string} fn\n * @param {number} uid\n * @returns {string}\n */\nexport function create_rule(node, a, b, duration, delay, ease, fn, uid = 0) {\n\tconst step = 16.666 / duration;\n\tlet keyframes = '{\\n';\n\tfor (let p = 0; p <= 1; p += step) {\n\t\tconst t = a + (b - a) * ease(p);\n\t\tkeyframes += p * 100 + `%{${fn(t, 1 - t)}}\\n`;\n\t}\n\tconst rule = keyframes + `100% {${fn(b, 1 - b)}}\\n}`;\n\tconst name = `__svelte_${hash(rule)}_${uid}`;\n\tconst doc = get_root_for_style(node);\n\tconst { stylesheet, rules } = managed_styles.get(doc) || create_style_information(doc, node);\n\tif (!rules[name]) {\n\t\trules[name] = true;\n\t\tstylesheet.insertRule(`@keyframes ${name} ${rule}`, stylesheet.cssRules.length);\n\t}\n\tconst animation = node.style.animation || '';\n\tnode.style.animation = `${\n\t\tanimation ? `${animation}, ` : ''\n\t}${name} ${duration}ms linear ${delay}ms 1 both`;\n\tactive += 1;\n\treturn name;\n}\n\n/**\n * @param {Element & ElementCSSInlineStyle} node\n * @param {string} [name]\n * @returns {void}\n */\nexport function delete_rule(node, name) {\n\tconst previous = (node.style.animation || '').split(', ');\n\tconst next = previous.filter(\n\t\tname\n\t\t\t? (anim) => anim.indexOf(name) < 0 // remove specific animation\n\t\t\t: (anim) => anim.indexOf('__svelte') === -1 // remove all Svelte animations\n\t);\n\tconst deleted = previous.length - next.length;\n\tif (deleted) {\n\t\tnode.style.animation = next.join(', ');\n\t\tactive -= deleted;\n\t\tif (!active) clear_rules();\n\t}\n}\n\n/** @returns {void} */\nexport function clear_rules() {\n\traf(() => {\n\t\tif (active) return;\n\t\tmanaged_styles.forEach((info) => {\n\t\t\tconst { ownerNode } = info.stylesheet;\n\t\t\t// there is no ownerNode if it runs on jsdom.\n\t\t\tif (ownerNode) detach(ownerNode);\n\t\t});\n\t\tmanaged_styles.clear();\n\t});\n}\n","import { custom_event } from './dom.js';\n\nexport let current_component;\n\n/** @returns {void} */\nexport function set_current_component(component) {\n\tcurrent_component = component;\n}\n\nexport function get_current_component() {\n\tif (!current_component) throw new Error('Function called outside component initialization');\n\treturn current_component;\n}\n\n/**\n * Schedules a callback to run immediately before the component is updated after any state change.\n *\n * The first time the callback runs will be before the initial `onMount`\n *\n * https://svelte.dev/docs/svelte#beforeupdate\n * @param {() => any} fn\n * @returns {void}\n */\nexport function beforeUpdate(fn) {\n\tget_current_component().$$.before_update.push(fn);\n}\n\n/**\n * The `onMount` function schedules a callback to run as soon as the component has been mounted to the DOM.\n * It must be called during the component's initialisation (but doesn't need to live *inside* the component;\n * it can be called from an external module).\n *\n * If a function is returned _synchronously_ from `onMount`, it will be called when the component is unmounted.\n *\n * `onMount` does not run inside a [server-side component](/docs#run-time-server-side-component-api).\n *\n * https://svelte.dev/docs/svelte#onmount\n * @template T\n * @param {() => import('./private.js').NotFunction<T> | Promise<import('./private.js').NotFunction<T>> | (() => any)} fn\n * @returns {void}\n */\nexport function onMount(fn) {\n\tget_current_component().$$.on_mount.push(fn);\n}\n\n/**\n * Schedules a callback to run immediately after the component has been updated.\n *\n * The first time the callback runs will be after the initial `onMount`\n *\n * https://svelte.dev/docs/svelte#afterupdate\n * @param {() => any} fn\n * @returns {void}\n */\nexport function afterUpdate(fn) {\n\tget_current_component().$$.after_update.push(fn);\n}\n\n/**\n * Schedules a callback to run immediately before the component is unmounted.\n *\n * Out of `onMount`, `beforeUpdate`, `afterUpdate` and `onDestroy`, this is the\n * only one that runs inside a server-side component.\n *\n * https://svelte.dev/docs/svelte#ondestroy\n * @param {() => any} fn\n * @returns {void}\n */\nexport function onDestroy(fn) {\n\tget_current_component().$$.on_destroy.push(fn);\n}\n\n/**\n * Creates an event dispatcher that can be used to dispatch [component events](/docs#template-syntax-component-directives-on-eventname).\n * Event dispatchers are functions that can take two arguments: `name` and `detail`.\n *\n * Component events created with `createEventDispatcher` create a\n * [CustomEvent](https://developer.mozilla.org/en-US/docs/Web/API/CustomEvent).\n * These events do not [bubble](https://developer.mozilla.org/en-US/docs/Learn/JavaScript/Building_blocks/Events#Event_bubbling_and_capture).\n * The `detail` argument corresponds to the [CustomEvent.detail](https://developer.mozilla.org/en-US/docs/Web/API/CustomEvent/detail)\n * property and can contain any type of data.\n *\n * The event dispatcher can be typed to narrow the allowed event names and the type of the `detail` argument:\n * ```ts\n * const dispatch = createEventDispatcher<{\n * loaded: never; // does not take a detail argument\n * change: string; // takes a detail argument of type string, which is required\n * optional: number | null; // takes an optional detail argument of type number\n * }>();\n * ```\n *\n * https://svelte.dev/docs/svelte#createeventdispatcher\n * @template {Record<string, any>} [EventMap=any]\n * @returns {import('./public.js').EventDispatcher<EventMap>}\n */\nexport function createEventDispatcher() {\n\tconst component = get_current_component();\n\treturn (type, detail, { cancelable = false } = {}) => {\n\t\tconst callbacks = component.$$.callbacks[type];\n\t\tif (callbacks) {\n\t\t\t// TODO are there situations where events could be dispatched\n\t\t\t// in a server (non-DOM) environment?\n\t\t\tconst event = custom_event(/** @type {string} */ (type), detail, { cancelable });\n\t\t\tcallbacks.slice().forEach((fn) => {\n\t\t\t\tfn.call(component, event);\n\t\t\t});\n\t\t\treturn !event.defaultPrevented;\n\t\t}\n\t\treturn true;\n\t};\n}\n\n/**\n * Associates an arbitrary `context` object with the current component and the specified `key`\n * and returns that object. The context is then available to children of the component\n * (including slotted content) with `getContext`.\n *\n * Like lifecycle functions, this must be called during component initialisation.\n *\n * https://svelte.dev/docs/svelte#setcontext\n * @template T\n * @param {any} key\n * @param {T} context\n * @returns {T}\n */\nexport function setContext(key, context) {\n\tget_current_component().$$.context.set(key, context);\n\treturn context;\n}\n\n/**\n * Retrieves the context that belongs to the closest parent component with the specified `key`.\n * Must be called during component initialisation.\n *\n * https://svelte.dev/docs/svelte#getcontext\n * @template T\n * @param {any} key\n * @returns {T}\n */\nexport function getContext(key) {\n\treturn get_current_component().$$.context.get(key);\n}\n\n/**\n * Retrieves the whole context map that belongs to the closest parent component.\n * Must be called during component initialisation. Useful, for example, if you\n * programmatically create a component and want to pass the existing context to it.\n *\n * https://svelte.dev/docs/svelte#getallcontexts\n * @template {Map<any, any>} [T=Map<any, any>]\n * @returns {T}\n */\nexport function getAllContexts() {\n\treturn get_current_component().$$.context;\n}\n\n/**\n * Checks whether a given `key` has been set in the context of a parent component.\n * Must be called during component initialisation.\n *\n * https://svelte.dev/docs/svelte#hascontext\n * @param {any} key\n * @returns {boolean}\n */\nexport function hasContext(key) {\n\treturn get_current_component().$$.context.has(key);\n}\n\n// TODO figure out if we still want to support\n// shorthand events, or if we want to implement\n// a real bubbling mechanism\n/**\n * @param component\n * @param event\n * @returns {void}\n */\nexport function bubble(component, event) {\n\tconst callbacks = component.$$.callbacks[event.type];\n\tif (callbacks) {\n\t\t// @ts-ignore\n\t\tcallbacks.slice().forEach((fn) => fn.call(this, event));\n\t}\n}\n","import { run_all } from './utils.js';\nimport { current_component, set_current_component } from './lifecycle.js';\n\nexport const dirty_components = [];\nexport const intros = { enabled: false };\nexport const binding_callbacks = [];\n\nlet render_callbacks = [];\n\nconst flush_callbacks = [];\n\nconst resolved_promise = /* @__PURE__ */ Promise.resolve();\n\nlet update_scheduled = false;\n\n/** @returns {void} */\nexport function schedule_update() {\n\tif (!update_scheduled) {\n\t\tupdate_scheduled = true;\n\t\tresolved_promise.then(flush);\n\t}\n}\n\n/** @returns {Promise<void>} */\nexport function tick() {\n\tschedule_update();\n\treturn resolved_promise;\n}\n\n/** @returns {void} */\nexport function add_render_callback(fn) {\n\trender_callbacks.push(fn);\n}\n\n/** @returns {void} */\nexport function add_flush_callback(fn) {\n\tflush_callbacks.push(fn);\n}\n\n// flush() calls callbacks in this order:\n// 1. All beforeUpdate callbacks, in order: parents before children\n// 2. All bind:this callbacks, in reverse order: children before parents.\n// 3. All afterUpdate callbacks, in order: parents before children. EXCEPT\n// for afterUpdates called during the initial onMount, which are called in\n// reverse order: children before parents.\n// Since callbacks might update component values, which could trigger another\n// call to flush(), the following steps guard against this:\n// 1. During beforeUpdate, any updated components will be added to the\n// dirty_components array and will cause a reentrant call to flush(). Because\n// the flush index is kept outside the function, the reentrant call will pick\n// up where the earlier call left off and go through all dirty components. The\n// current_component value is saved and restored so that the reentrant call will\n// not interfere with the \"parent\" flush() call.\n// 2. bind:this callbacks cannot trigger new flush() calls.\n// 3. During afterUpdate, any updated components will NOT have their afterUpdate\n// callback called a second time; the seen_callbacks set, outside the flush()\n// function, guarantees this behavior.\nconst seen_callbacks = new Set();\n\nlet flushidx = 0; // Do *not* move this inside the flush() function\n\n/** @returns {void} */\nexport function flush() {\n\t// Do not reenter flush while dirty components are updated, as this can\n\t// result in an infinite loop. Instead, let the inner flush handle it.\n\t// Reentrancy is ok afterwards for bindings etc.\n\tif (flushidx !== 0) {\n\t\treturn;\n\t}\n\tconst saved_component = current_component;\n\tdo {\n\t\t// first, call beforeUpdate functions\n\t\t// and update components\n\t\ttry {\n\t\t\twhile (flushidx < dirty_components.length) {\n\t\t\t\tconst component = dirty_components[flushidx];\n\t\t\t\tflushidx++;\n\t\t\t\tset_current_component(component);\n\t\t\t\tupdate(component.$$);\n\t\t\t}\n\t\t} catch (e) {\n\t\t\t// reset dirty state to not end up in a deadlocked state and then rethrow\n\t\t\tdirty_components.length = 0;\n\t\t\tflushidx = 0;\n\t\t\tthrow e;\n\t\t}\n\t\tset_current_component(null);\n\t\tdirty_components.length = 0;\n\t\tflushidx = 0;\n\t\twhile (binding_callbacks.length) binding_callbacks.pop()();\n\t\t// then, once components are updated, call\n\t\t// afterUpdate functions. This may cause\n\t\t// subsequent updates...\n\t\tfor (let i = 0; i < render_callbacks.length; i += 1) {\n\t\t\tconst callback = render_callbacks[i];\n\t\t\tif (!seen_callbacks.has(callback)) {\n\t\t\t\t// ...so guard against infinite loops\n\t\t\t\tseen_callbacks.add(callback);\n\t\t\t\tcallback();\n\t\t\t}\n\t\t}\n\t\trender_callbacks.length = 0;\n\t} while (dirty_components.length);\n\twhile (flush_callbacks.length) {\n\t\tflush_callbacks.pop()();\n\t}\n\tupdate_scheduled = false;\n\tseen_callbacks.clear();\n\tset_current_component(saved_component);\n}\n\n/** @returns {void} */\nfunction update($$) {\n\tif ($$.fragment !== null) {\n\t\t$$.update();\n\t\trun_all($$.before_update);\n\t\tconst dirty = $$.dirty;\n\t\t$$.dirty = [-1];\n\t\t$$.fragment && $$.fragment.p($$.ctx, dirty);\n\t\t$$.after_update.forEach(add_render_callback);\n\t}\n}\n\n/**\n * Useful for example to execute remaining `afterUpdate` callbacks before executing `destroy`.\n * @param {Function[]} fns\n * @returns {void}\n */\nexport function flush_render_callbacks(fns) {\n\tconst filtered = [];\n\tconst targets = [];\n\trender_callbacks.forEach((c) => (fns.indexOf(c) === -1 ? filtered.push(c) : targets.push(c)));\n\ttargets.forEach((c) => c());\n\trender_callbacks = filtered;\n}\n","import { identity as linear, is_function, noop, run_all } from './utils.js';\nimport { now } from './environment.js';\nimport { loop } from './loop.js';\nimport { create_rule, delete_rule } from './style_manager.js';\nimport { custom_event } from './dom.js';\nimport { add_render_callback } from './scheduler.js';\n\n/**\n * @type {Promise<void> | null}\n */\nlet promise;\n\n/**\n * @returns {Promise<void>}\n */\nfunction wait() {\n\tif (!promise) {\n\t\tpromise = Promise.resolve();\n\t\tpromise.then(() => {\n\t\t\tpromise = null;\n\t\t});\n\t}\n\treturn promise;\n}\n\n/**\n * @param {Element} node\n * @param {INTRO | OUTRO | boolean} direction\n * @param {'start' | 'end'} kind\n * @returns {void}\n */\nfunction dispatch(node, direction, kind) {\n\tnode.dispatchEvent(custom_event(`${direction ? 'intro' : 'outro'}${kind}`));\n}\n\nconst outroing = new Set();\n\n/**\n * @type {Outro}\n */\nlet outros;\n\n/**\n * @returns {void} */\nexport function group_outros() {\n\toutros = {\n\t\tr: 0,\n\t\tc: [],\n\t\tp: outros // parent group\n\t};\n}\n\n/**\n * @returns {void} */\nexport function check_outros() {\n\tif (!outros.r) {\n\t\trun_all(outros.c);\n\t}\n\toutros = outros.p;\n}\n\n/**\n * @param {import('./private.js').Fragment} block\n * @param {0 | 1} [local]\n * @returns {void}\n */\nexport function transition_in(block, local) {\n\tif (block && block.i) {\n\t\toutroing.delete(block);\n\t\tblock.i(local);\n\t}\n}\n\n/**\n * @param {import('./private.js').Fragment} block\n * @param {0 | 1} local\n * @param {0 | 1} [detach]\n * @param {() => void} [callback]\n * @returns {void}\n */\nexport function transition_out(block, local, detach, callback) {\n\tif (block && block.o) {\n\t\tif (outroing.has(block)) return;\n\t\toutroing.add(block);\n\t\toutros.c.push(() => {\n\t\t\toutroing.delete(block);\n\t\t\tif (callback) {\n\t\t\t\tif (detach) block.d(1);\n\t\t\t\tcallback();\n\t\t\t}\n\t\t});\n\t\tblock.o(local);\n\t} else if (callback) {\n\t\tcallback();\n\t}\n}\n\n/**\n * @type {import('../transition/public.js').TransitionConfig}\n */\nconst null_transition = { duration: 0 };\n\n/**\n * @param {Element & ElementCSSInlineStyle} node\n * @param {TransitionFn} fn\n * @param {any} params\n * @returns {{ start(): void; invalidate(): void; end(): void; }}\n */\nexport function create_in_transition(node, fn, params) {\n\t/**\n\t * @type {TransitionOptions} */\n\tconst options = { direction: 'in' };\n\tlet config = fn(node, params, options);\n\tlet running = false;\n\tlet animation_name;\n\tlet task;\n\tlet uid = 0;\n\n\t/**\n\t * @returns {void} */\n\tfunction cleanup() {\n\t\tif (animation_name) delete_rule(node, animation_name);\n\t}\n\n\t/**\n\t * @returns {void} */\n\tfunction go() {\n\t\tconst {\n\t\t\tdelay = 0,\n\t\t\tduration = 300,\n\t\t\teasing = linear,\n\t\t\ttick = noop,\n\t\t\tcss\n\t\t} = config || null_transition;\n\t\tif (css) animation_name = create_rule(node, 0, 1, duration, delay, easing, css, uid++);\n\t\ttick(0, 1);\n\t\tconst start_time = now() + delay;\n\t\tconst end_time = start_time + duration;\n\t\tif (task) task.abort();\n\t\trunning = true;\n\t\tadd_render_callback(() => dispatch(node, true, 'start'));\n\t\ttask = loop((now) => {\n\t\t\tif (running) {\n\t\t\t\tif (now >= end_time) {\n\t\t\t\t\ttick(1, 0);\n\t\t\t\t\tdispatch(node, true, 'end');\n\t\t\t\t\tcleanup();\n\t\t\t\t\treturn (running = false);\n\t\t\t\t}\n\t\t\t\tif (now >= start_time) {\n\t\t\t\t\tconst t = easing((now - start_time) / duration);\n\t\t\t\t\ttick(t, 1 - t);\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn running;\n\t\t});\n\t}\n\tlet started = false;\n\treturn {\n\t\tstart() {\n\t\t\tif (started) return;\n\t\t\tstarted = true;\n\t\t\tdelete_rule(node);\n\t\t\tif (is_function(config)) {\n\t\t\t\tconfig = config(options);\n\t\t\t\twait().then(go);\n\t\t\t} else {\n\t\t\t\tgo();\n\t\t\t}\n\t\t},\n\t\tinvalidate() {\n\t\t\tstarted = false;\n\t\t},\n\t\tend() {\n\t\t\tif (running) {\n\t\t\t\tcleanup();\n\t\t\t\trunning = false;\n\t\t\t}\n\t\t}\n\t};\n}\n\n/**\n * @param {Element & ElementCSSInlineStyle} node\n * @param {TransitionFn} fn\n * @param {any} params\n * @returns {{ end(reset: any): void; }}\n */\nexport function create_out_transition(node, fn, params) {\n\t/** @type {TransitionOptions} */\n\tconst options = { direction: 'out' };\n\tlet config = fn(node, params, options);\n\tlet running = true;\n\tlet animation_name;\n\tconst group = outros;\n\tgroup.r += 1;\n\t/** @type {boolean} */\n\tlet original_inert_value;\n\n\t/**\n\t * @returns {void} */\n\tfunction go() {\n\t\tconst {\n\t\t\tdelay = 0,\n\t\t\tduration = 300,\n\t\t\teasing = linear,\n\t\t\ttick = noop,\n\t\t\tcss\n\t\t} = config || null_transition;\n\n\t\tif (css) animation_name = create_rule(node, 1, 0, duration, delay, easing, css);\n\n\t\tconst start_time = now() + delay;\n\t\tconst end_time = start_time + duration;\n\t\tadd_render_callback(() => dispatch(node, false, 'start'));\n\n\t\tif ('inert' in node) {\n\t\t\toriginal_inert_value = /** @type {HTMLElement} */ (node).inert;\n\t\t\tnode.inert = true;\n\t\t}\n\n\t\tloop((now) => {\n\t\t\tif (running) {\n\t\t\t\tif (now >= end_time) {\n\t\t\t\t\ttick(0, 1);\n\t\t\t\t\tdispatch(node, false, 'end');\n\t\t\t\t\tif (!--group.r) {\n\t\t\t\t\t\t// this will result in `end()` being called,\n\t\t\t\t\t\t// so we don't need to clean up here\n\t\t\t\t\t\trun_all(group.c);\n\t\t\t\t\t}\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\tif (now >= start_time) {\n\t\t\t\t\tconst t = easing((now - start_time) / duration);\n\t\t\t\t\ttick(1 - t, t);\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn running;\n\t\t});\n\t}\n\n\tif (is_function(config)) {\n\t\twait().then(() => {\n\t\t\t// @ts-ignore\n\t\t\tconfig = config(options);\n\t\t\tgo();\n\t\t});\n\t} else {\n\t\tgo();\n\t}\n\n\treturn {\n\t\tend(reset) {\n\t\t\tif (reset && 'inert' in node) {\n\t\t\t\tnode.inert = original_inert_value;\n\t\t\t}\n\t\t\tif (reset && config.tick) {\n\t\t\t\tconfig.tick(1, 0);\n\t\t\t}\n\t\t\tif (running) {\n\t\t\t\tif (animation_name) delete_rule(node, animation_name);\n\t\t\t\trunning = false;\n\t\t\t}\n\t\t}\n\t};\n}\n\n/**\n * @param {Element & ElementCSSInlineStyle} node\n * @param {TransitionFn} fn\n * @param {any} params\n * @param {boolean} intro\n * @returns {{ run(b: 0 | 1): void; end(): void; }}\n */\nexport function create_bidirectional_transition(node, fn, params, intro) {\n\t/**\n\t * @type {TransitionOptions} */\n\tconst options = { direction: 'both' };\n\tlet config = fn(node, params, options);\n\tlet t = intro ? 0 : 1;\n\n\t/**\n\t * @type {Program | null} */\n\tlet running_program = null;\n\n\t/**\n\t * @type {PendingProgram | null} */\n\tlet pending_program = null;\n\tlet animation_name = null;\n\n\t/** @type {boolean} */\n\tlet original_inert_value;\n\n\t/**\n\t * @returns {void} */\n\tfunction clear_animation() {\n\t\tif (animation_name) delete_rule(node, animation_name);\n\t}\n\n\t/**\n\t * @param {PendingProgram} program\n\t * @param {number} duration\n\t * @returns {Program}\n\t */\n\tfunction init(program, duration) {\n\t\tconst d = /** @type {Program['d']} */ (program.b - t);\n\t\tduration *= Math.abs(d);\n\t\treturn {\n\t\t\ta: t,\n\t\t\tb: program.b,\n\t\t\td,\n\t\t\tduration,\n\t\t\tstart: program.start,\n\t\t\tend: program.start + duration,\n\t\t\tgroup: program.group\n\t\t};\n\t}\n\n\t/**\n\t * @param {INTRO | OUTRO} b\n\t * @returns {void}\n\t */\n\tfunction go(b) {\n\t\tconst {\n\t\t\tdelay = 0,\n\t\t\tduration = 300,\n\t\t\teasing = linear,\n\t\t\ttick = noop,\n\t\t\tcss\n\t\t} = config || null_transition;\n\n\t\t/**\n\t\t * @type {PendingProgram} */\n\t\tconst program = {\n\t\t\tstart: now() + delay,\n\t\t\tb\n\t\t};\n\n\t\tif (!b) {\n\t\t\t// @ts-ignore todo: improve typings\n\t\t\tprogram.group = outros;\n\t\t\toutros.r += 1;\n\t\t}\n\n\t\tif ('inert' in node) {\n\t\t\tif (b) {\n\t\t\t\tif (original_inert_value !== undefined) {\n\t\t\t\t\t// aborted/reversed outro — restore previous inert value\n\t\t\t\t\tnode.inert = original_inert_value;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\toriginal_inert_value = /** @type {HTMLElement} */ (node).inert;\n\t\t\t\tnode.inert = true;\n\t\t\t}\n\t\t}\n\n\t\tif (running_program || pending_program) {\n\t\t\tpending_program = program;\n\t\t} else {\n\t\t\t// if this is an intro, and there's a delay, we need to do\n\t\t\t// an initial tick and/or apply CSS animation immediately\n\t\t\tif (css) {\n\t\t\t\tclear_animation();\n\t\t\t\tanimation_name = create_rule(node, t, b, duration, delay, easing, css);\n\t\t\t}\n\t\t\tif (b) tick(0, 1);\n\t\t\trunning_program = init(program, duration);\n\t\t\tadd_render_callback(() => dispatch(node, b, 'start'));\n\t\t\tloop((now) => {\n\t\t\t\tif (pending_program && now > pending_program.start) {\n\t\t\t\t\trunning_program = init(pending_program, duration);\n\t\t\t\t\tpending_program = null;\n\t\t\t\t\tdispatch(node, running_program.b, 'start');\n\t\t\t\t\tif (css) {\n\t\t\t\t\t\tclear_animation();\n\t\t\t\t\t\tanimation_name = create_rule(\n\t\t\t\t\t\t\tnode,\n\t\t\t\t\t\t\tt,\n\t\t\t\t\t\t\trunning_program.b,\n\t\t\t\t\t\t\trunning_program.duration,\n\t\t\t\t\t\t\t0,\n\t\t\t\t\t\t\teasing,\n\t\t\t\t\t\t\tconfig.css\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (running_program) {\n\t\t\t\t\tif (now >= running_program.end) {\n\t\t\t\t\t\ttick((t = running_program.b), 1 - t);\n\t\t\t\t\t\tdispatch(node, running_program.b, 'end');\n\t\t\t\t\t\tif (!pending_program) {\n\t\t\t\t\t\t\t// we're done\n\t\t\t\t\t\t\tif (running_program.b) {\n\t\t\t\t\t\t\t\t// intro — we can tidy up immediately\n\t\t\t\t\t\t\t\tclear_animation();\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t// outro — needs to be coordinated\n\t\t\t\t\t\t\t\tif (!--running_program.group.r) run_all(running_program.group.c);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\trunning_program = null;\n\t\t\t\t\t} else if (now >= running_program.start) {\n\t\t\t\t\t\tconst p = now - running_program.start;\n\t\t\t\t\t\tt = running_program.a + running_program.d * easing(p / running_program.duration);\n\t\t\t\t\t\ttick(t, 1 - t);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn !!(running_program || pending_program);\n\t\t\t});\n\t\t}\n\t}\n\treturn {\n\t\trun(b) {\n\t\t\tif (is_function(config)) {\n\t\t\t\twait().then(() => {\n\t\t\t\t\tconst opts = { direction: b ? 'in' : 'out' };\n\t\t\t\t\t// @ts-ignore\n\t\t\t\t\tconfig = config(opts);\n\t\t\t\t\tgo(b);\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\tgo(b);\n\t\t\t}\n\t\t},\n\t\tend() {\n\t\t\tclear_animation();\n\t\t\trunning_program = pending_program = null;\n\t\t}\n\t};\n}\n\n/** @typedef {1} INTRO */\n/** @typedef {0} OUTRO */\n/** @typedef {{ direction: 'in' | 'out' | 'both' }} TransitionOptions */\n/** @typedef {(node: Element, params: any, options: TransitionOptions) => import('../transition/public.js').TransitionConfig} TransitionFn */\n\n/**\n * @typedef {Object} Outro\n * @property {number} r\n * @property {Function[]} c\n * @property {Object} p\n */\n\n/**\n * @typedef {Object} PendingProgram\n * @property {number} start\n * @property {INTRO|OUTRO} b\n * @property {Outro} [group]\n */\n\n/**\n * @typedef {Object} Program\n * @property {number} a\n * @property {INTRO|OUTRO} b\n * @property {1|-1} d\n * @property {number} duration\n * @property {number} start\n * @property {number} end\n * @property {Outro} [group]\n */\n","import { transition_in, transition_out } from './transitions.js';\nimport { run_all } from './utils.js';\n\n// general each functions:\n\nexport function ensure_array_like(array_like_or_iterator) {\n\treturn array_like_or_iterator?.length !== undefined\n\t\t? array_like_or_iterator\n\t\t: Array.from(array_like_or_iterator);\n}\n\n// keyed each functions:\n\n/** @returns {void} */\nexport function destroy_block(block, lookup) {\n\tblock.d(1);\n\tlookup.delete(block.key);\n}\n\n/** @returns {void} */\nexport function outro_and_destroy_block(block, lookup) {\n\ttransition_out(block, 1, 1, () => {\n\t\tlookup.delete(block.key);\n\t});\n}\n\n/** @returns {void} */\nexport function fix_and_destroy_block(block, lookup) {\n\tblock.f();\n\tdestroy_block(block, lookup);\n}\n\n/** @returns {void} */\nexport function fix_and_outro_and_destroy_block(block, lookup) {\n\tblock.f();\n\toutro_and_destroy_block(block, lookup);\n}\n\n/** @returns {any[]} */\nexport function update_keyed_each(\n\told_blocks,\n\tdirty,\n\tget_key,\n\tdynamic,\n\tctx,\n\tlist,\n\tlookup,\n\tnode,\n\tdestroy,\n\tcreate_each_block,\n\tnext,\n\tget_context\n) {\n\tlet o = old_blocks.length;\n\tlet n = list.length;\n\tlet i = o;\n\tconst old_indexes = {};\n\twhile (i--) old_indexes[old_blocks[i].key] = i;\n\tconst new_blocks = [];\n\tconst new_lookup = new Map();\n\tconst deltas = new Map();\n\tconst updates = [];\n\ti = n;\n\twhile (i--) {\n\t\tconst child_ctx = get_context(ctx, list, i);\n\t\tconst key = get_key(child_ctx);\n\t\tlet block = lookup.get(key);\n\t\tif (!block) {\n\t\t\tblock = create_each_block(key, child_ctx);\n\t\t\tblock.c();\n\t\t} else if (dynamic) {\n\t\t\t// defer updates until all the DOM shuffling is done\n\t\t\tupdates.push(() => block.p(child_ctx, dirty));\n\t\t}\n\t\tnew_lookup.set(key, (new_blocks[i] = block));\n\t\tif (key in old_indexes) deltas.set(key, Math.abs(i - old_indexes[key]));\n\t}\n\tconst will_move = new Set();\n\tconst did_move = new Set();\n\t/** @returns {void} */\n\tfunction insert(block) {\n\t\ttransition_in(block, 1);\n\t\tblock.m(node, next);\n\t\tlookup.set(block.key, block);\n\t\tnext = block.first;\n\t\tn--;\n\t}\n\twhile (o && n) {\n\t\tconst new_block = new_blocks[n - 1];\n\t\tconst old_block = old_blocks[o - 1];\n\t\tconst new_key = new_block.key;\n\t\tconst old_key = old_block.key;\n\t\tif (new_block === old_block) {\n\t\t\t// do nothing\n\t\t\tnext = new_block.first;\n\t\t\to--;\n\t\t\tn--;\n\t\t} else if (!new_lookup.has(old_key)) {\n\t\t\t// remove old block\n\t\t\tdestroy(old_block, lookup);\n\t\t\to--;\n\t\t} else if (!lookup.has(new_key) || will_move.has(new_key)) {\n\t\t\tinsert(new_block);\n\t\t} else if (did_move.has(old_key)) {\n\t\t\to--;\n\t\t} else if (deltas.get(new_key) > deltas.get(old_key)) {\n\t\t\tdid_move.add(new_key);\n\t\t\tinsert(new_block);\n\t\t} else {\n\t\t\twill_move.add(old_key);\n\t\t\to--;\n\t\t}\n\t}\n\twhile (o--) {\n\t\tconst old_block = old_blocks[o];\n\t\tif (!new_lookup.has(old_block.key)) destroy(old_block, lookup);\n\t}\n\twhile (n) insert(new_blocks[n - 1]);\n\trun_all(updates);\n\treturn new_blocks;\n}\n\n/** @returns {void} */\nexport function validate_each_keys(ctx, list, get_context, get_key) {\n\tconst keys = new Map();\n\tfor (let i = 0; i < list.length; i++) {\n\t\tconst key = get_key(get_context(ctx, list, i));\n\t\tif (keys.has(key)) {\n\t\t\tlet value = '';\n\t\t\ttry {\n\t\t\t\tvalue = `with value '${String(key)}' `;\n\t\t\t} catch (e) {\n\t\t\t\t// can't stringify\n\t\t\t}\n\t\t\tthrow new Error(\n\t\t\t\t`Cannot have duplicate keys in a keyed each: Keys at index ${keys.get(\n\t\t\t\t\tkey\n\t\t\t\t)} and ${i} ${value}are duplicates`\n\t\t\t);\n\t\t}\n\t\tkeys.set(key, i);\n\t}\n}\n","/** @returns {{}} */\nexport function get_spread_update(levels, updates) {\n\tconst update = {};\n\tconst to_null_out = {};\n\tconst accounted_for = { $$scope: 1 };\n\tlet i = levels.length;\n\twhile (i--) {\n\t\tconst o = levels[i];\n\t\tconst n = updates[i];\n\t\tif (n) {\n\t\t\tfor (const key in o) {\n\t\t\t\tif (!(key in n)) to_null_out[key] = 1;\n\t\t\t}\n\t\t\tfor (const key in n) {\n\t\t\t\tif (!accounted_for[key]) {\n\t\t\t\t\tupdate[key] = n[key];\n\t\t\t\t\taccounted_for[key] = 1;\n\t\t\t\t}\n\t\t\t}\n\t\t\tlevels[i] = n;\n\t\t} else {\n\t\t\tfor (const key in o) {\n\t\t\t\taccounted_for[key] = 1;\n\t\t\t}\n\t\t}\n\t}\n\tfor (const key in to_null_out) {\n\t\tif (!(key in update)) update[key] = undefined;\n\t}\n\treturn update;\n}\n\nexport function get_spread_object(spread_props) {\n\treturn typeof spread_props === 'object' && spread_props !== null ? spread_props : {};\n}\n","import {\n\tadd_render_callback,\n\tflush,\n\tflush_render_callbacks,\n\tschedule_update,\n\tdirty_components\n} from './scheduler.js';\nimport { current_component, set_current_component } from './lifecycle.js';\nimport { blank_object, is_empty, is_function, run, run_all, noop } from './utils.js';\nimport {\n\tchildren,\n\tdetach,\n\tstart_hydrating,\n\tend_hydrating,\n\tget_custom_elements_slots,\n\tinsert,\n\telement,\n\tattr\n} from './dom.js';\nimport { transition_in } from './transitions.js';\n\n/** @returns {void} */\nexport function bind(component, name, callback) {\n\tconst index = component.$$.props[name];\n\tif (index !== undefined) {\n\t\tcomponent.$$.bound[index] = callback;\n\t\tcallback(component.$$.ctx[index]);\n\t}\n}\n\n/** @returns {void} */\nexport function create_component(block) {\n\tblock && block.c();\n}\n\n/** @returns {void} */\nexport function claim_component(block, parent_nodes) {\n\tblock && block.l(parent_nodes);\n}\n\n/** @returns {void} */\nexport function mount_component(component, target, anchor) {\n\tconst { fragment, after_update } = component.$$;\n\tfragment && fragment.m(target, anchor);\n\t// onMount happens before the initial afterUpdate\n\tadd_render_callback(() => {\n\t\tconst new_on_destroy = component.$$.on_mount.map(run).filter(is_function);\n\t\t// if the component was destroyed immediately\n\t\t// it will update the `$$.on_destroy` reference to `null`.\n\t\t// the destructured on_destroy may still reference to the old array\n\t\tif (component.$$.on_destroy) {\n\t\t\tcomponent.$$.on_destroy.push(...new_on_destroy);\n\t\t} else {\n\t\t\t// Edge case - component was destroyed immediately,\n\t\t\t// most likely as a result of a binding initialising\n\t\t\trun_all(new_on_destroy);\n\t\t}\n\t\tcomponent.$$.on_mount = [];\n\t});\n\tafter_update.forEach(add_render_callback);\n}\n\n/** @returns {void} */\nexport function destroy_component(component, detaching) {\n\tconst $$ = component.$$;\n\tif ($$.fragment !== null) {\n\t\tflush_render_callbacks($$.after_update);\n\t\trun_all($$.on_destroy);\n\t\t$$.fragment && $$.fragment.d(detaching);\n\t\t// TODO null out other refs, including component.$$ (but need to\n\t\t// preserve final state?)\n\t\t$$.on_destroy = $$.fragment = null;\n\t\t$$.ctx = [];\n\t}\n}\n\n/** @returns {void} */\nfunction make_dirty(component, i) {\n\tif (component.$$.dirty[0] === -1) {\n\t\tdirty_components.push(component);\n\t\tschedule_update();\n\t\tcomponent.$$.dirty.fill(0);\n\t}\n\tcomponent.$$.dirty[(i / 31) | 0] |= 1 << i % 31;\n}\n\n// TODO: Document the other params\n/**\n * @param {SvelteComponent} component\n * @param {import('./public.js').ComponentConstructorOptions} options\n *\n * @param {import('./utils.js')['not_equal']} not_equal Used to compare props and state values.\n * @param {(target: Element | ShadowRoot) => void} [append_styles] Function that appends styles to the DOM when the component is first initialised.\n * This will be the `add_css` function from the compiled component.\n *\n * @returns {void}\n */\nexport function init(\n\tcomponent,\n\toptions,\n\tinstance,\n\tcreate_fragment,\n\tnot_equal,\n\tprops,\n\tappend_styles = null,\n\tdirty = [-1]\n) {\n\tconst parent_component = current_component;\n\tset_current_component(component);\n\t/** @type {import('./private.js').T$$} */\n\tconst $$ = (component.$$ = {\n\t\tfragment: null,\n\t\tctx: [],\n\t\t// state\n\t\tprops,\n\t\tupdate: noop,\n\t\tnot_equal,\n\t\tbound: blank_object(),\n\t\t// lifecycle\n\t\ton_mount: [],\n\t\ton_destroy: [],\n\t\ton_disconnect: [],\n\t\tbefore_update: [],\n\t\tafter_update: [],\n\t\tcontext: new Map(options.context || (parent_component ? parent_component.$$.context : [])),\n\t\t// everything else\n\t\tcallbacks: blank_object(),\n\t\tdirty,\n\t\tskip_bound: false,\n\t\troot: options.target || parent_component.$$.root\n\t});\n\tappend_styles && append_styles($$.root);\n\tlet ready = false;\n\t$$.ctx = instance\n\t\t? instance(component, options.props || {}, (i, ret, ...rest) => {\n\t\t\t\tconst value = rest.length ? rest[0] : ret;\n\t\t\t\tif ($$.ctx && not_equal($$.ctx[i], ($$.ctx[i] = value))) {\n\t\t\t\t\tif (!$$.skip_bound && $$.bound[i]) $$.bound[i](value);\n\t\t\t\t\tif (ready) make_dirty(component, i);\n\t\t\t\t}\n\t\t\t\treturn ret;\n\t\t })\n\t\t: [];\n\t$$.update();\n\tready = true;\n\trun_all($$.before_update);\n\t// `false` as a special case of no DOM component\n\t$$.fragment = create_fragment ? create_fragment($$.ctx) : false;\n\tif (options.target) {\n\t\tif (options.hydrate) {\n\t\t\tstart_hydrating();\n\t\t\t// TODO: what is the correct type here?\n\t\t\t// @ts-expect-error\n\t\t\tconst nodes = children(options.target);\n\t\t\t$$.fragment && $$.fragment.l(nodes);\n\t\t\tnodes.forEach(detach);\n\t\t} else {\n\t\t\t// eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n\t\t\t$$.fragment && $$.fragment.c();\n\t\t}\n\t\tif (options.intro) transition_in(component.$$.fragment);\n\t\tmount_component(component, options.target, options.anchor);\n\t\tend_hydrating();\n\t\tflush();\n\t}\n\tset_current_component(parent_component);\n}\n\nexport let SvelteElement;\n\nif (typeof HTMLElement === 'function') {\n\tSvelteElement = class extends HTMLElement {\n\t\t/** The Svelte component constructor */\n\t\t$$ctor;\n\t\t/** Slots */\n\t\t$$s;\n\t\t/** The Svelte component instance */\n\t\t$$c;\n\t\t/** Whether or not the custom element is connected */\n\t\t$$cn = false;\n\t\t/** Component props data */\n\t\t$$d = {};\n\t\t/** `true` if currently in the process of reflecting component props back to attributes */\n\t\t$$r = false;\n\t\t/** @type {Record<string, CustomElementPropDefinition>} Props definition (name, reflected, type etc) */\n\t\t$$p_d = {};\n\t\t/** @type {Record<string, Function[]>} Event listeners */\n\t\t$$l = {};\n\t\t/** @type {Map<Function, Function>} Event listener unsubscribe functions */\n\t\t$$l_u = new Map();\n\n\t\tconstructor($$componentCtor, $$slots, use_shadow_dom) {\n\t\t\tsuper();\n\t\t\tthis.$$ctor = $$componentCtor;\n\t\t\tthis.$$s = $$slots;\n\t\t\tif (use_shadow_dom) {\n\t\t\t\tthis.attachShadow({ mode: 'open' });\n\t\t\t}\n\t\t}\n\n\t\taddEventListener(type, listener, options) {\n\t\t\t// We can't determine upfront if the event is a custom event or not, so we have to\n\t\t\t// listen to both. If someone uses a custom event with the same name as a regular\n\t\t\t// browser event, this fires twice - we can't avoid that.\n\t\t\tthis.$$l[type] = this.$$l[type] || [];\n\t\t\tthis.$$l[type].push(listener);\n\t\t\tif (this.$$c) {\n\t\t\t\tconst unsub = this.$$c.$on(type, listener);\n\t\t\t\tthis.$$l_u.set(listener, unsub);\n\t\t\t}\n\t\t\tsuper.addEventListener(type, listener, options);\n\t\t}\n\n\t\tremoveEventListener(type, listener, options) {\n\t\t\tsuper.removeEventListener(type, listener, options);\n\t\t\tif (this.$$c) {\n\t\t\t\tconst unsub = this.$$l_u.get(listener);\n\t\t\t\tif (unsub) {\n\t\t\t\t\tunsub();\n\t\t\t\t\tthis.$$l_u.delete(listener);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tasync connectedCallback() {\n\t\t\tthis.$$cn = true;\n\t\t\tif (!this.$$c) {\n\t\t\t\t// We wait one tick to let possible child slot elements be created/mounted\n\t\t\t\tawait Promise.resolve();\n\t\t\t\tif (!this.$$cn) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tfunction create_slot(name) {\n\t\t\t\t\treturn () => {\n\t\t\t\t\t\tlet node;\n\t\t\t\t\t\tconst obj = {\n\t\t\t\t\t\t\tc: function create() {\n\t\t\t\t\t\t\t\tnode = element('slot');\n\t\t\t\t\t\t\t\tif (name !== 'default') {\n\t\t\t\t\t\t\t\t\tattr(node, 'name', name);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t/**\n\t\t\t\t\t\t\t * @param {HTMLElement} target\n\t\t\t\t\t\t\t * @param {HTMLElement} [anchor]\n\t\t\t\t\t\t\t */\n\t\t\t\t\t\t\tm: function mount(target, anchor) {\n\t\t\t\t\t\t\t\tinsert(target, node, anchor);\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\td: function destroy(detaching) {\n\t\t\t\t\t\t\t\tif (detaching) {\n\t\t\t\t\t\t\t\t\tdetach(node);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t};\n\t\t\t\t\t\treturn obj;\n\t\t\t\t\t};\n\t\t\t\t}\n\t\t\t\tconst $$slots = {};\n\t\t\t\tconst existing_slots = get_custom_elements_slots(this);\n\t\t\t\tfor (const name of this.$$s) {\n\t\t\t\t\tif (name in existing_slots) {\n\t\t\t\t\t\t$$slots[name] = [create_slot(name)];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tfor (const attribute of this.attributes) {\n\t\t\t\t\t// this.$$data takes precedence over this.attributes\n\t\t\t\t\tconst name = this.$$g_p(attribute.name);\n\t\t\t\t\tif (!(name in this.$$d)) {\n\t\t\t\t\t\tthis.$$d[name] = get_custom_element_value(name, attribute.value, this.$$p_d, 'toProp');\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tthis.$$c = new this.$$ctor({\n\t\t\t\t\ttarget: this.shadowRoot || this,\n\t\t\t\t\tprops: {\n\t\t\t\t\t\t...this.$$d,\n\t\t\t\t\t\t$$slots,\n\t\t\t\t\t\t$$scope: {\n\t\t\t\t\t\t\tctx: []\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t});\n\n\t\t\t\t// Reflect component props as attributes\n\t\t\t\tconst reflect_attributes = () => {\n\t\t\t\t\tthis.$$r = true;\n\t\t\t\t\tfor (const key in this.$$p_d) {\n\t\t\t\t\t\tthis.$$d[key] = this.$$c.$$.ctx[this.$$c.$$.props[key]];\n\t\t\t\t\t\tif (this.$$p_d[key].reflect) {\n\t\t\t\t\t\t\tconst attribute_value = get_custom_element_value(\n\t\t\t\t\t\t\t\tkey,\n\t\t\t\t\t\t\t\tthis.$$d[key],\n\t\t\t\t\t\t\t\tthis.$$p_d,\n\t\t\t\t\t\t\t\t'toAttribute'\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\tif (attribute_value == null) {\n\t\t\t\t\t\t\t\tthis.removeAttribute(this.$$p_d[key].attribute || key);\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tthis.setAttribute(this.$$p_d[key].attribute || key, attribute_value);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tthis.$$r = false;\n\t\t\t\t};\n\t\t\t\tthis.$$c.$$.after_update.push(reflect_attributes);\n\t\t\t\treflect_attributes(); // once initially because after_update is added too late for first render\n\n\t\t\t\tfor (const type in this.$$l) {\n\t\t\t\t\tfor (const listener of this.$$l[type]) {\n\t\t\t\t\t\tconst unsub = this.$$c.$on(type, listener);\n\t\t\t\t\t\tthis.$$l_u.set(listener, unsub);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tthis.$$l = {};\n\t\t\t}\n\t\t}\n\n\t\t// We don't need this when working within Svelte code, but for compatibility of people using this outside of Svelte\n\t\t// and setting attributes through setAttribute etc, this is helpful\n\t\tattributeChangedCallback(attr, _oldValue, newValue) {\n\t\t\tif (this.$$r) return;\n\t\t\tattr = this.$$g_p(attr);\n\t\t\tthis.$$d[attr] = get_custom_element_value(attr, newValue, this.$$p_d, 'toProp');\n\t\t\tthis.$$c?.$set({ [attr]: this.$$d[attr] });\n\t\t}\n\n\t\tdisconnectedCallback() {\n\t\t\tthis.$$cn = false;\n\t\t\t// In a microtask, because this could be a move within the DOM\n\t\t\tPromise.resolve().then(() => {\n\t\t\t\tif (!this.$$cn) {\n\t\t\t\t\tthis.$$c.$destroy();\n\t\t\t\t\tthis.$$c = undefined;\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\n\t\t$$g_p(attribute_name) {\n\t\t\treturn (\n\t\t\t\tObject.keys(this.$$p_d).find(\n\t\t\t\t\t(key) =>\n\t\t\t\t\t\tthis.$$p_d[key].attribute === attribute_name ||\n\t\t\t\t\t\t(!this.$$p_d[key].attribute && key.toLowerCase() === attribute_name)\n\t\t\t\t) || attribute_name\n\t\t\t);\n\t\t}\n\t};\n}\n\n/**\n * @param {string} prop\n * @param {any} value\n * @param {Record<string, CustomElementPropDefinition>} props_definition\n * @param {'toAttribute' | 'toProp'} [transform]\n */\nfunction get_custom_element_value(prop, value, props_definition, transform) {\n\tconst type = props_definition[prop]?.type;\n\tvalue = type === 'Boolean' && typeof value !== 'boolean' ? value != null : value;\n\tif (!transform || !props_definition[prop]) {\n\t\treturn value;\n\t} else if (transform === 'toAttribute') {\n\t\tswitch (type) {\n\t\t\tcase 'Object':\n\t\t\tcase 'Array':\n\t\t\t\treturn value == null ? null : JSON.stringify(value);\n\t\t\tcase 'Boolean':\n\t\t\t\treturn value ? '' : null;\n\t\t\tcase 'Number':\n\t\t\t\treturn value == null ? null : value;\n\t\t\tdefault:\n\t\t\t\treturn value;\n\t\t}\n\t} else {\n\t\tswitch (type) {\n\t\t\tcase 'Object':\n\t\t\tcase 'Array':\n\t\t\t\treturn value && JSON.parse(value);\n\t\t\tcase 'Boolean':\n\t\t\t\treturn value; // conversion already handled above\n\t\t\tcase 'Number':\n\t\t\t\treturn value != null ? +value : value;\n\t\t\tdefault:\n\t\t\t\treturn value;\n\t\t}\n\t}\n}\n\n/**\n * @internal\n *\n * Turn a Svelte component into a custom element.\n * @param {import('./public.js').ComponentType} Component A Svelte component constructor\n * @param {Record<string, CustomElementPropDefinition>} props_definition The props to observe\n * @param {string[]} slots The slots to create\n * @param {string[]} accessors Other accessors besides the ones for props the component has\n * @param {boolean} use_shadow_dom Whether to use shadow DOM\n * @param {(ce: new () => HTMLElement) => new () => HTMLElement} [extend]\n */\nexport function create_custom_element(\n\tComponent,\n\tprops_definition,\n\tslots,\n\taccessors,\n\tuse_shadow_dom,\n\textend\n) {\n\tlet Class = class extends SvelteElement {\n\t\tconstructor() {\n\t\t\tsuper(Component, slots, use_shadow_dom);\n\t\t\tthis.$$p_d = props_definition;\n\t\t}\n\t\tstatic get observedAttributes() {\n\t\t\treturn Object.keys(props_definition).map((key) =>\n\t\t\t\t(props_definition[key].attribute || key).toLowerCase()\n\t\t\t);\n\t\t}\n\t};\n\tObject.keys(props_definition).forEach((prop) => {\n\t\tObject.defineProperty(Class.prototype, prop, {\n\t\t\tget() {\n\t\t\t\treturn this.$$c && prop in this.$$c ? this.$$c[prop] : this.$$d[prop];\n\t\t\t},\n\t\t\tset(value) {\n\t\t\t\tvalue = get_custom_element_value(prop, value, props_definition);\n\t\t\t\tthis.$$d[prop] = value;\n\t\t\t\tthis.$$c?.$set({ [prop]: value });\n\t\t\t}\n\t\t});\n\t});\n\taccessors.forEach((accessor) => {\n\t\tObject.defineProperty(Class.prototype, accessor, {\n\t\t\tget() {\n\t\t\t\treturn this.$$c?.[accessor];\n\t\t\t}\n\t\t});\n\t});\n\tif (extend) {\n\t\t// @ts-expect-error - assigning here is fine\n\t\tClass = extend(Class);\n\t}\n\tComponent.element = /** @type {any} */ (Class);\n\treturn Class;\n}\n\n/**\n * Base class for Svelte components. Used when dev=false.\n *\n * @template {Record<string, any>} [Props=any]\n * @template {Record<string, any>} [Events=any]\n */\nexport class SvelteComponent {\n\t/**\n\t * ### PRIVATE API\n\t *\n\t * Do not use, may change at any time\n\t *\n\t * @type {any}\n\t */\n\t$$ = undefined;\n\t/**\n\t * ### PRIVATE API\n\t *\n\t * Do not use, may change at any time\n\t *\n\t * @type {any}\n\t */\n\t$$set = undefined;\n\n\t/** @returns {void} */\n\t$destroy() {\n\t\tdestroy_component(this, 1);\n\t\tthis.$destroy = noop;\n\t}\n\n\t/**\n\t * @template {Extract<keyof Events, string>} K\n\t * @param {K} type\n\t * @param {((e: Events[K]) => void) | null | undefined} callback\n\t * @returns {() => void}\n\t */\n\t$on(type, callback) {\n\t\tif (!is_function(callback)) {\n\t\t\treturn noop;\n\t\t}\n\t\tconst callbacks = this.$$.callbacks[type] || (this.$$.callbacks[type] = []);\n\t\tcallbacks.push(callback);\n\t\treturn () => {\n\t\t\tconst index = callbacks.indexOf(callback);\n\t\t\tif (index !== -1) callbacks.splice(index, 1);\n\t\t};\n\t}\n\n\t/**\n\t * @param {Partial<Props>} props\n\t * @returns {void}\n\t */\n\t$set(props) {\n\t\tif (this.$$set && !is_empty(props)) {\n\t\t\tthis.$$.skip_bound = true;\n\t\t\tthis.$$set(props);\n\t\t\tthis.$$.skip_bound = false;\n\t\t}\n\t}\n}\n\n/**\n * @typedef {Object} CustomElementPropDefinition\n * @property {string} [attribute]\n * @property {boolean} [reflect]\n * @property {'String'|'Boolean'|'Number'|'Array'|'Object'} [type]\n */\n","// generated during release, do not modify\n\n/**\n * The current version, as set in package.json.\n *\n * https://svelte.dev/docs/svelte-compiler#svelte-version\n * @type {string}\n */\nexport const VERSION = '4.2.2';\nexport const PUBLIC_VERSION = '4';\n","import { PUBLIC_VERSION } from '../../../shared/version.js';\n\nif (typeof window !== 'undefined')\n\t// @ts-ignore\n\t(window.__svelte || (window.__svelte = { v: new Set() })).v.add(PUBLIC_VERSION);\n","// @ts-check\r\n\r\n/**\r\n * @module strings/format\r\n */\r\n\r\n/**\r\n * Replaces placeholders within a template string with corresponding values.\r\n *\r\n * @param {string} template - Template string.\r\n * @param {RegExp} regex - Regular expression to detect placeholders within template.\r\n * @param {string[]} values - Template replacement values.\r\n *\r\n * Template string placeholder format is specified by the `regex` parameter.\r\n */\r\nexport function formatString(template, regex, ...values) {\r\n if (!template) {\r\n throw TypeError('Template not specified');\r\n }\r\n\r\n if (typeof template !== 'string') {\r\n throw TypeError('Template is not a string');\r\n }\r\n\r\n return template.replace(\r\n regex,\r\n (match, number) => number in values ? values[number] : match\r\n );\r\n}\r\n\r\n/**\r\n * Replaces placeholders within a template string with corresponding values.\r\n *\r\n * @param {string} template - Template string.\r\n * @param {string[]} values - Template replacement values.\r\n *\r\n * Template string placeholder format: {n}, where n >= 0 and n < values.length\r\n */\r\nexport function formatLanguageString(template, ...values) {\r\n const regex = /\\{(\\d+)\\}/g;\r\n\r\n return formatString(template, regex, ...values);\r\n}\r\n","/**\n * Make tab navigation loop within an element.\n */\n\n// Create attribute selectors to ignore when trying to find tabbables.\n/** @type {string} */\nconst nonTabbables = [\n '[aria-hidden=\"true\"]',\n '[disabled]',\n '[hidden]',\n '[type=\"hidden\"]',\n '[tabindex=\"-1\"]'\n]\n .map(selector => `:not(${selector})`)\n .join('');\n\n// Select elements that are by default tabbable when tab navigating and\n// append the nonTabbables selectors to each.\n/** @type {string} */\nconst tabbables = [\n `button`,\n `[role=\"button\"]`,\n `a[href]`,\n `input`,\n `[contentEditable=true]`,\n `select`,\n `textarea`,\n `iframe`,\n `[tabindex=\"0\"]`,\n `audio`,\n `video`\n]\n .map(selector => `${selector}${nonTabbables}`)\n .join(',');\n\nclass TabTrapper {\n /**\n * @param {HTMLElement} element\n */\n constructor(element) {\n /** @type {Array<HTMLElement>} */\n this.tabbables = [];\n\n /** @type {HTMLElement} */\n this.element = element;\n\n /** @type {HTMLElement} */\n this.innerDocBody = null;\n\n this.element.addEventListener('keydown', this.maybeLoopFocus.bind(this));\n }\n\n teardown() {\n this.element.removeEventListener('keydown', this.maybeLoopFocus);\n\n if (this.innerDocBody) {\n this.innerDocBody.removeEventListener('keydown', this.maybeLoopFocus.bind(this));\n }\n }\n\n /**\n * Reselects tabbable elements. This function should be called on each\n * update of element contents.\n */\n init() {\n /** @type {NodeListOf<Element>} */\n const elements = this.element.querySelectorAll(tabbables);\n\n /** @type {Array<HTMLElement>} */\n const visibleTabbables = removeInvisibles(elements);\n\n /** @type {HTMLElement} */\n this.firstTabbable = visibleTabbables[0];\n\n /** @type {HTMLElement} */\n this.lastTabbable = visibleTabbables[visibleTabbables.length - 1];\n }\n\n /**\n * Advance focus to next tabbable element if the event is a TAB key press\n *\n * @param {KeyboardEvent} event\n */\n maybeLoopFocus(event) {\n if (event.key !== 'Tab') {\n return;\n }\n\n if (!event.shiftKey && event.target === this.lastTabbable) {\n event.preventDefault();\n if (this.firstTabbable.nodeName === 'INPUT' && this.firstTabbable.type === 'radio') {\n const selectedElement = document.querySelector(`input[name=\"${this.firstTabbable.name}\"]:checked`);\n selectedElement\n ? selectedElement.focus()\n : this.firstTabbable.focus();\n } else {\n this.firstTabbable.focus();\n }\n }\n\n if (event.shiftKey && (event.target === this.firstTabbable || isInSameRadioGroup(event.target, this.firstTabbable))) {\n event.preventDefault();\n this.lastTabbable.focus();\n }\n }\n\n /**\n * Update last tabbable if the last element is an iframe\n *\n * @param {HTMLElement} innerDocBody document body of inner iframe\n */\n updateLastTabbableIfIframeIsTheLastElement(innerDocBody) {\n this.innerDocBody = innerDocBody;\n\n const elements = innerDocBody.querySelectorAll(tabbables);\n const visibleTabbables = removeInvisibles(elements);\n\n if (visibleTabbables.length === 0) {\n this.lastTabbable = innerDocBody;\n } else {\n this.lastTabbable = visibleTabbables[visibleTabbables.length - 1];\n }\n\n innerDocBody.addEventListener('keydown', this.maybeLoopFocus.bind(this));\n }\n}\n\nexport default TabTrapper;\n\n/**\n * This may have an issue with screen reader only elements, it needs to be tested.\n *\n * @param {NodeListOf<Element>} elements\n * @return {Array<HTMLElement>} All elements that have computed style of visisble.\n */\nfunction removeInvisibles(elements) {\n return [].filter.call(elements, element => {\n return element.style.visibility !== 'hidden' &&\n element.style.display !== 'none';\n });\n}\n\nfunction isInSameRadioGroup(element1, element2) {\n return element1.nodeName === 'INPUT' && element1.type === 'radio' &&\n element2.nodeName === 'INPUT' && element2.type === 'radio' && element1.name === element2.name;\n}\n","/**\n * Known keys. You don't need to import this as you would still be able to use normalized string.\n * @module keyboard/keys\n */\nexport const Keys = {\n BACKSPACE: 'Backspace',\n DOWN: 'Down',\n ENTER: 'Enter',\n ESCAPE: 'Escape',\n LEFT: 'Left',\n RIGHT: 'Right',\n SHIFT: 'Shift',\n SPACE: 'Space',\n TAB: 'Tab',\n UP: 'Up',\n};\n","/**\n * Helper function to normalize key string identifiers.\n * @module keyboard/normalize\n */\n\nimport { Keys } from './keys';\n\n/**\n * Normalizes keys for convenience.\n *\n * @param {string} key The key that should be normalized.\n * @return {string} A normalized representation of the requested key.\n */\nexport function normalizeKey(key) {\n switch (key) {\n case 'Down':\n case 'ArrowDown':\n return Keys.DOWN;\n case 'Left':\n case 'ArrowLeft':\n return Keys.LEFT;\n case 'Right':\n case 'ArrowRight':\n return Keys.RIGHT;\n case 'Up':\n case 'ArrowUp':\n return Keys.UP;\n case 'Enter':\n return Keys.ENTER;\n case 'Esc':\n case 'Escape':\n return Keys.ESCAPE;\n case 'Spacebar':\n case ' ':\n return Keys.SPACE;\n case 'Tab':\n return Keys.TAB;\n case 'Backspace':\n return Keys.BACKSPACE;\n\n default:\n return key;\n }\n}\n","<script>\n /** @type {'basic'|'basic-negative'|'primary'|'secondary'|'destructive'|'plain'} */\n export let type = \"basic\";\n\n /** @type {boolean} */\n export let iconOnly = false;\n\n /** @type {string} */\n export let id = undefined;\n\n /** @type {string} */\n export let cssClass = \"\";\n\n /** @type {string} */\n export let text = \"\";\n\n /** @type {boolean} */\n export let large = false;\n\n /** @type {boolean} */\n export let disabled = false;\n\n /** @type {boolean} */\n export let loading = false;\n\n /** @type {'submit'|'button'|'reset'} */\n export let htmlType = \"submit\";\n\n /** @type {'false'|'true'|'menu'|'listbox'|'tree'|'grid'|'dialog'} */\n export let haspopup = undefined;\n\n /** @type {boolean} */\n export let expanded = undefined;\n\n /** @type {string | undefined} */\n export let ariaLabel = undefined;\n\n /** @type {string | undefined} */\n export let describedby = undefined;\n\n /** @type {string | undefined} */\n export let labelledby = undefined;\n\n $: visuallyHidden = iconOnly ? \"prom-button__text--hidden\" : \"\";\n $: isLarge = large ? \"prom-button--large\" : \"\";\n $: isLoading = loading ? \"prom-button--loading\" : \"\";\n $: isActive = !loading && !disabled;\n $: ariaLabelText = ariaLabel \n ? ariaLabel\n : (iconOnly ? text : undefined);\n</script>\n\n<button\n aria-haspopup={haspopup}\n aria-expanded={expanded}\n aria-label={ariaLabelText}\n aria-labelledby={labelledby}\n aria-describedby={describedby}\n {id}\n type={htmlType}\n class=\"prom-button prom-button__{type} {cssClass} {isLoading} {isLarge}\"\n {disabled}\n data-active={isActive}\n on:click\n on:focus\n on:blur\n on:keyup\n on:keydown\n>\n <span class=\"prom-button__text\">\n <span class={visuallyHidden}>{text}</span>\n </span>\n</button>\n","<!--htmlhint inline-style-disabled:false -->\n\n<svelte:window on:keyup={keyUpHandler} on:resize={windowResize} />\n\n{#if enabled}\n <div class=\"prom-modal2__wrapper\">\n <div class=\"prom-modal2__backdrop\" on:click={() => clickOutsideCloses && cancel()}></div>\n <section\n {id}\n bind:this={dialogElement}\n role=\"dialog\"\n class=\"prom-modal2__dialog\"\n class:prom-modal2__dialog--wide={wide}\n style={modalStyle}\n aria-labelledby=\"{id}-header\"\n aria-describedby={describedById}\n aria-modal=\"true\">\n\n <h1 id=\"{id}-header\" class=\"prom-modal2__header\">\n <slot name=\"title\" />\n {#if titleText}{titleText}{/if}\n </h1>\n\n <div class=\"prom-modal2__inner\">\n <div\n class=\"prom-modal2__content\"\n bind:this={contentElement}\n on:scroll={contentScroll}>\n\n {#if $$slots.banner}\n <div class=\"prom-modal2__banner-slot\">\n <slot name=\"banner\" />\n </div>\n {/if}\n\n {#if !titleOnly}\n <div id=\"{id}-body\" class=\"prom-modal2__body\" class:prom-modal2__body--scroll={scrollBody}>\n <slot name=\"body\" />\n {#if bodyText}{bodyText}{/if}\n {#if bodyHtml}{@html bodyHtml}{/if}\n </div>\n {/if}\n </div>\n\n <div class=\"prom-modal2__content-gradient\">\n <div\n class=\"prom-modal2__content-gradient--inner\"\n style={gradientStyle}\n ></div>\n </div>\n\n <div class=\"prom-modal2__footer\">\n <slot name=\"footer\">\n <Button\n type={confirmButtonType}\n htmlType=\"button\"\n on:click={confirm}\n text={confirmText}\n large\n />\n {#if showCancel}\n <Button\n type={cancelButtonType}\n htmlType=\"button\"\n on:click={cancel}\n text={cancelText}\n large\n />\n {/if}\n </slot>\n </div>\n\n </div>\n </section>\n </div>\n{/if}\n\n<script>\n import TabTrapHelper from '../../../../lib/helpers/TabTrapHelper';\n import { normalizeKey } from '@itslearning/atlas/keyboard/normalize';\n import { Keys } from '@itslearning/atlas/keyboard/keys';\n import Button from '../../../inputs/Button/v1/Button.svelte';\n import { createEventDispatcher } from 'svelte';\n\n const dispatch = createEventDispatcher();\n\n /** @type {string} Defaults to a random string */\n export let id = Math.random().toString(36).substr(2, 16);\n /** @type {boolean} */\n export let enabled = false;\n /** @type {boolean} */\n export let wide = false;\n /** @type {boolean} */\n export let titleOnly = false;\n /** @type {string} */\n export let confirmText = undefined;\n /** @type {string} */\n export let cancelText = undefined;\n /** @type {string} */\n export let titleText = undefined;\n /** @type {string} */\n export let bodyText = undefined;\n /** @type {string} */\n export let bodyHtml = undefined;\n /** @type {boolean} If the cancel button should be included, remember even without it\n * the modal can still be canceled with escape or clicking the backdrop.*/\n export let showCancel = true;\n /** @type {boolean} If the body slot should scroll on its own without the title.*/\n export let scrollBody = false;\n /** @type {string} */\n export let describedBy = undefined;\n\n /** @type {string|'basic'|'basic-negative'|'primary'|'secondary'|'destructive'|'plain'} */\n export let confirmButtonType = 'primary';\n /** @type {string|'basic'|'basic-negative'|'primary'|'secondary'|'destructive'|'plain'} */\n export let cancelButtonType = 'secondary';\n\n /** @type {boolean} */\n export let clickOutsideCloses = true;\n\n let hasScroll = false;\n let contentScrollRemaining = 50;\n let scrollContainer = document.querySelector('html');\n let promptResolve = undefined;\n let modalStyle = '';\n\n let focusedBeforeModal = undefined;\n let tabTrapper = undefined;\n\n let dialogElement;\n let contentElement;\n\n let gradientStyle;\n\n $: {\n let height = 0;\n\n if (hasScroll) {\n height = Math.min(contentScrollRemaining, 30);\n }\n\n gradientStyle = `height: ${height}px;`;\n }\n\n $: describedById =describedBy || `${id}-body`;\n\n let previouslyEnabled = false;\n\n $: if (enabled && !previouslyEnabled) {\n previouslyEnabled = enabled;\n onOpen();\n } else if (!enabled && previouslyEnabled) {\n previouslyEnabled = enabled;\n onClose();\n }\n\n $: if (enabled && wide) {\n windowResize();\n }\n\n function onOpen() {\n focusedBeforeModal = document.activeElement;\n\n scrollContainer.classList.add('prom-modal2--open-within');\n\n // Run window resize in case window sizes have changed while\n // the modal was disabled\n windowResize();\n\n // Set timeout to let the dialog enter the DOM\n setTimeout(() => {\n if (dialogElement) {\n const buttons = dialogElement.querySelectorAll('button');\n tabTrapper = new TabTrapHelper(dialogElement);\n\n tabTrapper.init();\n\n // Focus the last button in the dialog, either the cancel button\n // or confirm if there is only one\n if (buttons.length) {\n buttons[buttons.length - 1].focus();\n }\n }\n }, 0);\n\n // Run windowResize again after animations have completed\n setTimeout(() => windowResize(), 300);\n }\n\n export function reinitTabTrapper() {\n if (tabTrapper) {\n tabTrapper.init();\n }\n }\n\n function onClose() {\n scrollContainer.classList.remove('prom-modal2--open-within');\n\n // Return focus to the element that was focused before opening\n if (focusedBeforeModal) {\n focusedBeforeModal.focus();\n }\n\n // Disable the tab trap\n if (tabTrapper) {\n tabTrapper.teardown();\n }\n }\n\n function keyUpHandler(event) {\n if (enabled && (normalizeKey(event.key) === Keys.ESCAPE)) {\n cancel(event);\n }\n }\n\n function windowResize() {\n if (!enabled) {\n return;\n }\n\n // size-700 from top and bottom\n const verticalGap = 24 * 2;\n\n // Max modal height is 600 and the page height\n // Do not apply the 600 height limit on small screens, let\n // the modal fill the screen in all dimensions\n let maxHeight = window.innerWidth > 640\n ? Math.min(window.innerHeight - verticalGap, wide ? 1200 : 600)\n : window.innerHeight - verticalGap;\n\n modalStyle = `max-height: ${maxHeight}px;`;\n\n setTimeout(() => {\n if (contentElement) {\n hasScroll = contentElement.clientHeight !== contentElement.scrollHeight;\n }\n }, 0);\n }\n\n function cancel() {\n enabled = false;\n\n dispatch('close', { confirmed: false });\n dispatch('cancel');\n\n if (promptResolve) {\n promptResolve(false);\n }\n }\n\n function confirm() {\n enabled = false;\n\n dispatch('close', { confirmed: true });\n dispatch('confirm');\n\n if (promptResolve) {\n promptResolve(true);\n }\n }\n\n export function prompt(properties) {\n if (properties.titleOnly !== undefined) titleOnly = properties.titleOnly;\n if (properties.confirmText !== undefined) confirmText = properties.confirmText;\n if (properties.cancelText !== undefined) cancelText = properties.cancelText;\n if (properties.titleText !== undefined) titleText = properties.titleText;\n if (properties.bodyText !== undefined) bodyText = properties.bodyText;\n if (properties.bodyHtml !== undefined) bodyHtml = properties.bodyHtml;\n if (properties.titleOnly !== undefined) titleOnly = properties.titleOnly;\n if (properties.showCancel !== undefined) showCancel = properties.showCancel;\n if (properties.describedBy !== undefined) describedBy = properties.describedBy;\n if (properties.confirmButtonType !== undefined) confirmButtonType = properties.confirmButtonType;\n if (properties.cancelButtonType !== undefined) cancelButtonType = properties.cancelButtonType;\n\n enabled = true;\n\n return new Promise(resolve => {\n promptResolve = resolve;\n });\n }\n\n function contentScroll() {\n const scrollHeight = contentElement.scrollHeight;\n const clientHeight = contentElement.clientHeight;\n const scrollTop = contentElement.scrollTop;\n\n contentScrollRemaining = scrollHeight - (clientHeight + scrollTop);\n }\n</script>\n","<script>\n /** @type {'primary'|'secondary'|'standalone'|'primary-standalone'} */\n export let kind = 'primary';\n /** @type {string} */\n export let href = '#';\n /** @type {string} */\n export let rel = '';\n /** @type {string} */\n export let iconClass = '';\n /** @type {'start'|'end'} */\n export let iconPlacement = 'start';\n /** @type {string} */\n export let target = '_self';\n /** @type {boolean} */\n export let large = false;\n /** @type {string} */\n export let label = null;\n /** @type {string} */\n export let text = undefined;\n /** @type {string} */\n export let ping = undefined;\n /** @type {boolean} */\n export let standalone = false;\n /** @type {boolean} */\n export let downloadable = false;\n /** @type {string} */\n export let fileName = null;\n\n $: download = downloadable ? fileName || '' : null;\n\n $: icon =\n kind === 'standalone' && iconClass\n ? 'prom-link--icon ' + iconPlacementClass + iconClass\n : '';\n\n $: iconPlacementClass =\n iconPlacement === 'start'\n ? 'prom-link--icon-start '\n : 'prom-link--icon-end ';\n\n if (standalone) {\n kind = 'standalone';\n }\n\n $: {\n if (iconClass && kind !== 'standalone') {\n console.warn(\n \"Icons can only be added to links in 'standalone' mode.\"\n );\n }\n\n if (iconClass && !text && !label) {\n console.warn(\n \"Links must have discernible text. If it is an icon-only link, use 'label' to add hidden text.\"\n );\n }\n }\n</script>\n\n<a\n class=\"prom-link prom-link--{kind} {icon}\"\n class:prom-link--large={large}\n {href}\n {rel}\n {target}\n {ping}\n {download}\n aria-label={label}\n on:click\n>\n <slot />\n {#if text}{text}{/if}\n</a>\n","<script>\n import Link from '../../../Navigation/Link/v1/Link.svelte';\n import Button from '../../../inputs/Button/v1/Button.svelte';\n\n /** @type {string} */\n export let description = '';\n /** @type {string} */\n export let title = '';\n /** @type {'h2'|'h3'|'h4'}*/\n export let headingLevel = 'h2';\n /** @type {string} **/\n export let iconName = 'default';\n /** @type {'vertical'|'horizontal'} */\n export let orientation = 'vertical';\n /** @type {'center'|'left'} */\n export let alignment = 'center';\n /** @type {boolean} */\n export let showButton = false;\n /** @type {string} */\n export let buttonText = undefined;\n /** @type {'submit'|'button'|'reset'} */\n export let buttonHtmlType = 'submit';\n /** @type {boolean} */\n export let showLink = false;\n /** @type {'standalone'|'primary-standalone'} */\n export let linkType = 'standalone';\n /** @type {string} */\n export let linkText = undefined;\n /** @type {boolean} */\n export let showLoadingIndicator = false;\n /** @type {string} */\n export let href = '';\n /** @type {string} */\n export let target = '_self';\n\n let iconCssClass = '';\n let cssClass = '';\n\n $: {\n switch (iconName) {\n case '360reports':\n case 'behaviour-overview':\n case 'courses':\n case 'default':\n case 'empty-folder':\n case 'events':\n case 'files':\n case 'follow-up-task':\n case 'learning-objective':\n case 'messages':\n case 'news':\n case 'notifications':\n case 'plan-topics':\n case 'plans':\n case 'portfolio':\n case 'project':\n case 'question-category':\n case 'search-no-result':\n case 'test-questions':\n case 'test-results':\n case 'trash':\n case 'user-groups':\n case 'user':\n iconCssClass = `prom-empty-state__icon--${iconName}`;\n break;\n default:\n console.warn('Please provide proper icon iconName');\n iconCssClass = `prom-empty-state__icon--default`;\n }\n }\n\n $: if (!['h2', 'h3', 'h4'].some((l) => l === headingLevel)) {\n console.warn('Valid heading levels are h2, h3 and h4');\n }\n\n $: if (showButton && !buttonText) {\n console.warn('Please provide button text');\n }\n\n $: if (showLink && !href) {\n console.warn('Please provide a valid url for the href attribute');\n }\n\n $: if (showLink && !linkText) {\n console.warn('Please provide a link text');\n }\n\n $: {\n if (orientation !== 'horizontal' && orientation !== 'vertical') {\n console.warn('Please provide a proper orientation');\n }\n\n if (orientation !== 'vertical' && alignment !== 'center') {\n console.warn(\n 'Empty state does not support alignment for non-vertical state'\n );\n }\n\n if (orientation === 'vertical' && alignment === 'left') {\n cssClass = 'prom-empty-state--aligned-left';\n } else {\n cssClass =\n orientation === 'horizontal'\n ? `prom-empty-state--${orientation}`\n : '';\n }\n }\n</script>\n\n<section class=\"prom-empty-state {cssClass}\">\n {#if showLoadingIndicator}\n <span class=\"prom-empty-state__icon prom-loading-spinner__spinner\"></span>\n {:else}\n <span class=\"prom-empty-state__icon {iconCssClass}\"></span>\n {/if}\n <div class=\"prom-empty-state__content-container\">\n <svelte:element this=\"{headingLevel}\" class=\"prom-empty-state__title\">\n {title}\n </svelte:element>\n <p class=\"prom-empty-state__description\">{description}</p>\n {#if showButton}\n <Button\n text={buttonText}\n type=\"primary\"\n htmlType={buttonHtmlType}\n on:click\n />\n {:else if showLink}\n <Link\n {href}\n kind={linkType}\n text={linkText}\n {target}\n on:click\n />\n {/if}\n </div>\n</section>\n","{#if textOnly && iconOnly}\n <Button\n cssClass=\"prom-icon-button {iconPlacementClass} {iconClass}\"\n {disabled}\n {haspopup}\n {expanded}\n {id}\n {large}\n {loading}\n {text}\n {type}\n {htmlType}\n {ariaLabel}\n {labelledby}\n {describedby}\n on:blur\n on:click\n on:focus\n on:keyup\n on:keydown\n >\n </Button>\n{:else if textOnly}\n <Button\n cssClass=\"prom-icon-button {textOnlyClass}\"\n {disabled}\n {haspopup}\n {expanded}\n {iconOnly}\n {id}\n {large}\n {loading}\n {text}\n {type}\n {htmlType}\n {ariaLabel}\n {labelledby}\n {describedby}\n on:blur\n on:click\n on:focus\n on:keyup\n on:keydown\n >\n </Button>\n{:else}\n <Button\n cssClass=\"prom-icon-button {iconOnlyClass} {iconPlacementClass} {iconClass}\"\n {disabled}\n {haspopup}\n {expanded}\n {iconOnly}\n {id}\n {large}\n {loading}\n {text}\n {type}\n {htmlType}\n {ariaLabel}\n {labelledby}\n {describedby}\n on:blur\n on:click\n on:focus\n on:keyup\n on:keydown\n >\n </Button>\n{/if}\n\n<script>\n import Button from '../../Button/v1/Button.svelte';\n\n /** @type {boolean} */\n export let disabled = false;\n /** @type {'false'|'true'|'menu'|'listbox'|'tree'|'grid'|'dialog'} */\n export let haspopup = undefined;\n /** @type {boolean} */\n export let expanded = undefined;\n /** @type {'submit'|'button'|'reset'} */\n export let htmlType = 'submit';\n /** @type {string} */\n export let iconClass = '';\n /** @type {boolean} */\n export let iconOnly = false;\n /** @type {'start'|'end'} */\n export let iconPlacement = 'start';\n /** @type {string} */\n export let id = undefined;\n /** @type {boolean} */\n export let large = false;\n /** @type {boolean} */\n export let loading = false;\n /** @type {string} */\n export let text = '';\n /** @type {boolean} */\n export let textOnly = false;\n /** @type {'basic'|'basic-negative'| 'primary'|'secondary'|'destructive'|'plain'} */\n export let type = 'basic';\n /** @type {string | undefined} */\n export let ariaLabel = undefined;\n /** @type {string | undefined} */\n export let labelledby = undefined;\n /** @type {string} */\n export let describedby = undefined;\n\n $: {\n if (iconOnly && textOnly) {\n console.warn('The attributes iconOnly and textOnly cannot be both set to false.');\n }\n }\n\n $: {\n if (!iconPlacement || typeof iconPlacement !== 'string' || (iconPlacement !== 'start' && iconPlacement !== 'end')) {\n console.warn('Valid values for iconPlacement is \"start\" and \"end\".');\n }\n }\n\n $: iconOnlyClass = iconOnly ? 'prom-icon-button--icon-only' : '';\n $: textOnlyClass = textOnly ? 'prom-icon-button--text-only' : '';\n $: iconPlacementClass = iconPlacement === 'end' ? 'prom-icon-button--icon-end' : '';\n</script>\n","/**\n* Focus first item in dropdown\n*\n* @param {Element} dropdown\n*/\n\nexport function focusFirstItemIn(dropdown) {\n const firstItem = dropdown.querySelector('li > .prom-dropdown__listitem');\n\n // @ts-ignore\n firstItem.focus();\n}\n\n/**\n* Focus last item in dropdown\n*\n* @param {Element} dropdown\n*/\nexport function focusLastItemIn(dropdown) {\n const lastItem = dropdown.children[dropdown.children.length - 1];\n\n // @ts-ignore\n lastItem.querySelector('.prom-dropdown__listitem').focus();\n}\n\n/**\n * Return focus to the parent dropdown when closing a submenu\n *\n */\nexport function returnFocusToParentDropdown() {\n const button = document.querySelector('.prom-dropdown__listitems-menu.open');\n\n if (button) {\n // @ts-ignore\n button.focus();\n removeFocusFromParentDropdown();\n }\n}\n\nexport function removeFocusFromParentDropdown() {\n const button = document.querySelector('.prom-dropdown__listitems-menu.open');\n\n if (button) {\n button.classList.remove('open');\n }\n}\n\n/**\n* Hide dropdown\n*\n* @param {HTMLElement} submenu\n*/\nexport function hide(submenu) {\n submenu.setAttribute('hidden', 'hidden');\n}\n\n/**\n* Is submenu hidden?\n*\n* @param {HTMLElement} submenu\n* @returns {boolean}\n*/\nexport function hidden(submenu) {\n return submenu && submenu.hasAttribute('hidden');\n}\n\n/**\n * Hide open submenus\n *\n */\nexport function hideOpenSubmenus() {\n const submenus = Array.prototype.slice.call(document.querySelectorAll('.prom-dropdown__submenu'));\n\n for (let i = 0; i < submenus.length; i++) {\n hide(submenus[i]);\n }\n\n const menuButtons = document.querySelectorAll('.prom-dropdown__listitems-menu');\n\n for (let i = 0; i < menuButtons.length; i++) {\n menuButtons[i].setAttribute('aria-expanded', 'false');\n }\n}\n\n/**\n* Show submenu\n*\n* @param {HTMLElement} submenu\n*/\nexport function show(submenu) {\n submenu.style.right = null;\n submenu.style.left = null;\n submenu.style.top = null;\n\n if (window.innerWidth > 480) {\n const openerRect = submenu.parentElement.getBoundingClientRect();\n const dropdownBody = getClosestParentByClass(submenu, 'prom-dropdown__body');\n\n // If there is space to the right open there, otherwise open to the left\n if (window.innerWidth - openerRect.right >= openerRect.width) {\n submenu.style.left = openerRect.width + 'px';\n } else {\n submenu.style.right = openerRect.width + 'px';\n }\n\n // Set the submenu's top style to line up with the element that opened it\n submenu.style.top = openerRect.top - dropdownBody.getBoundingClientRect().top - 5 + 'px';\n }\n\n submenu.removeAttribute('hidden');\n}\n\nfunction getClosestParentByClass(element, matchClass) {\n while (element.parentElement !== null) {\n element = element.parentElement;\n\n if (element.classList.contains(matchClass)) {\n return element;\n }\n }\n\n return null;\n}\n\n/**\n * Are there any open submenus?\n *\n * @returns {boolean} True if open submenus\n */\nexport function openSubmenus() {\n const submenus = document.querySelectorAll('.prom-dropdown__submenu');\n\n let open = false;\n\n if (submenus.length > 0) {\n submenus.forEach((submenu) => {\n if (submenu.hasAttribute('aria-expanded')) {\n const expanded = submenu.getAttribute('aria-expanded');\n\n if (expanded === 'true') {\n open = true;\n }\n }\n });\n }\n\n return open;\n}\n\nexport function isMenuItem(button) {\n return button.classList.contains('prom-dropdown__listitems-menu');\n}\n","<a\n class=\"prom-dropdown__listitem prom-dropdown__listitem-link\"\n href={option.url}\n ping={option.ping}\n id={option.id}\n tabindex=\"-1\"\n target={option.target ? option.target : 'mainmenu'}\n on:click={onClick}\n on:mouseenter={event => dispatch('mouseenter', { event, data: option })}\n on:mouseleave={event => dispatch('mouseleave', { event, data: option })}\n>\n\n {#if option.icon}\n <img\n alt=\"\"\n class=\"prom-dropdown__listitems-icon\"\n src=\"{option.icon}\"\n height=\"{option.iconsize}\"\n width=\"{option.iconsize}\" />\n {:else if option.iconCssClass}\n <span\n class=\"{option.iconCssClass}\">\n </span>\n {/if}\n\n <span class=\"prom-dropdown__listitems-text\">{option.label}\n {#if option.ellipsis}\n …\n {/if}\n </span>\n</a>\n\n<script>\n import { createEventDispatcher } from 'svelte';\n const dispatch = createEventDispatcher();\n\n /** @type {object} */\n export let option = null;\n\n function onClick(event) {\n dispatch('dropdownClose', event)\n if (option && option.value) {\n dispatch('click', { data: option });\n }\n }\n</script>\n","<button\n class=\"prom-dropdown__listitem prom-dropdown__listitem-action {cssClass}\"\n tabindex=\"-1\"\n type=\"button\"\n id={option.id}\n aria-haspopup={hasPopup}\n aria-expanded={hasPopup ? expanded : null}\n on:click={event => dispatch('click', { event, data: option })}\n on:mouseenter={event => dispatch('mouseenter', { event, data: option })}\n on:mouseleave={event => dispatch('mouseleave', { event, data: option })}\n>\n {#if option.icon}\n <img\n alt=\"\"\n class=\"prom-dropdown__listitems-icon\"\n src={option.icon}\n height={option.iconsize}\n width={option.iconsize} />\n {:else if option.iconCssClass}\n <span\n class={option.iconCssClass}>\n </span>\n {/if}\n\n <span class=\"prom-dropdown__listitems-text\">{option.label}\n {#if option.ellipsis}\n …\n {/if}\n </span>\n\n <span class=\"prom-dropdown__listitems-menuicon\"></span>\n</button>\n\n\n<script>\n import { createEventDispatcher } from 'svelte';\n const dispatch = createEventDispatcher();\n\n /** @type {string} */\n export let cssClass = '';\n /** @type {boolean} */\n export let expanded = false;\n /** @type {boolean} */\n export let hasPopup = false;\n /** @type {object} */\n export let option = null;\n</script>\n","// @ts-check\r\n\r\n/**\r\n * Helper class detecting current device and browser.\r\n * @module detectors/UserAgentHelper\r\n */\r\n\r\n/** The current user agent. */\r\nconst ua = window.navigator.userAgent;\r\n\r\n/** Detects if browser is run on iOS device.\r\n *\r\n * @returns {boolean} True if the user agent contains iPod|iPhone|iPad\r\n */\r\nexport function isIos() {\r\n return /(iPod|iPhone|iPad)/i.test(ua);\r\n}\r\n\r\n/** Detects if browser is run on iPadOS device or older iPad.\r\n *\r\n * @returns {boolean} True if the user agent contains iPad or is a \"Mac\" with touch points, ie iPadOS.\r\n */\r\nexport function isIpad() {\r\n const isIpad = ua.toLowerCase().indexOf('ipad') !== -1;\r\n\r\n if (!isIpad && ua.match(/Mac/) && navigator.maxTouchPoints && navigator.maxTouchPoints > 2) {\r\n return true;\r\n }\r\n\r\n return isIpad;\r\n}\r\n\r\n/**\r\n * Detects if the user's device is a mobile device and not a 'computer'\r\n * @returns {boolean} True if the user agent contains a mobile value\r\n */\r\nexport function isMobile() {\r\n return !!/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(ua);\r\n}\r\n\r\n/**\r\n * Detects if the user's device is a chromebook\r\n * @returns {boolean} True if the user agent contains CrOS\r\n */\r\nexport function isChromeBook() {\r\n return !!ua.match(/(CrOS)/g);\r\n}\r\n\r\n/**\r\n * Detects if the user's browser is IE10 or greater\r\n @returns {boolean} True if the user agent is IE10 or greater\r\n */\r\nexport function isIE() {\r\n return document.body.style.msTouchAction !== undefined;\r\n}\r\n\r\n/**\r\n * Detects if the user's browser is Edge\r\n @returns {boolean} True if the user agent is Edge\r\n */\r\nexport function isEdge() {\r\n return ua.indexOf('Edge') > -1;\r\n}","import { focusFirstItemIn, focusLastItemIn } from './dropdownHelper.js';\n\n/**\n* Get lists of items\n*\n* @param {HTMLElement} currentItem\n* @returns\n*/\nfunction getLists(currentItem) {\n const parentItem = currentItem.parentElement;\n const children = parentItem.parentElement.parentElement.children;\n\n if (children.length === 0) {\n return;\n }\n\n const lists = [];\n\n for (let i = 0; i < children.length; i++) {\n const child = children[i];\n\n if (child.nodeName.toLowerCase() === 'ul') {\n lists.push(child);\n }\n }\n\n return lists;\n}\n\n/**\n* Focus first item in next list\n*\n* @param {HTMLElement} currentItem\n*/\nexport function goToNextList(currentItem) {\n const lists = getLists(currentItem);\n\n if (lists.length <= 1) {\n focusFirstItemIn(lists[0]);\n }\n\n const parentItem = currentItem.parentElement;\n\n let nextSibling = parentItem.parentElement.nextElementSibling;\n\n if (nextSibling) {\n if (nextSibling.nodeName.toLowerCase() !== 'ul') {\n nextSibling = nextSibling.nextElementSibling;\n }\n\n focusFirstItemIn(nextSibling);\n } else {\n focusFirstItemIn(lists[0]);\n }\n}\n\n/**\n* Focus last item in previous list\n*\n* @param {HTMLElement} currentItem\n*/\nexport function goToPreviousList(currentItem) {\n const lists = getLists(currentItem);\n\n if (lists.length <= 1) {\n focusLastItemIn(lists[0]);\n } else {\n const parentItem = currentItem.parentElement;\n\n let previousSibling = parentItem.parentElement.previousElementSibling;\n\n if (previousSibling) {\n if (previousSibling.nodeName.toLowerCase() === 'h2') {\n previousSibling = previousSibling.previousElementSibling;\n }\n\n if (previousSibling.nodeName.toLowerCase() === 'ul') {\n focusLastItemIn(previousSibling);\n } else {\n focusLastItemIn(lists[lists.length - 1]);\n }\n } else {\n focusLastItemIn(lists[lists.length - 1]);\n }\n }\n}\n\n/**\n *\n *\n * @param {HTMLElement} currentItem\n * @returns {boolean}\n */\nexport function focusPreviousListItem(currentItem) {\n const parentItem = currentItem.parentElement;\n const previousItem = parentItem.previousElementSibling;\n\n if (previousItem) {\n // @ts-ignore\n previousItem.querySelector('.prom-dropdown__listitem').focus();\n\n return true;\n }\n\n return false;\n}\n\n/**\n *\n *\n * @param {HTMLElement} currentItem\n * @returns {boolean}\n */\nexport function focusNextListItem(currentItem) {\n const parentItem = currentItem.parentElement;\n const nextItem = parentItem.nextElementSibling;\n\n if (nextItem) {\n // @ts-ignore\n nextItem.querySelector('.prom-dropdown__listitem').focus();\n\n return true;\n }\n\n return false;\n}\n","<li class=\"prom-dropdown__listitems {option.cssClass || ''}\"\n class:prom-dropdown__listitems--divider={option.divider}\n class:prom-dropdown__listitems--menu={option.items}\n on:keyup={keyHandlerUp}\n on:keydown={keyHandlerDown}\n role=\"menuitem\"\n>\n {#if option.link}\n <AnchorItem\n {option}\n on:click\n on:dropdownClose\n on:mouseenter={mouseenterHandler}\n on:mouseleave={mouseleaveHandler}\n />\n {:else}\n {#if option.items}\n <ButtonItem\n {option}\n cssClass=\"prom-dropdown__listitems-menu\"\n hasPopup={true}\n on:click={clickHandler}\n on:mouseenter={mouseenterHandler}\n on:mouseleave={mouseleaveHandler}\n />\n\n <section\n hidden\n class=\"prom-dropdown prom-dropdown__submenu\"\n >\n <section class=\"prom-dropdown__body\">\n {#each option.items as list, index}\n <List\n {index}\n {list}\n isSubmenu=\"true\"\n on:click\n on:dropdownClose\n on:keyup\n />\n {/each}\n </section>\n </section>\n {:else}\n <ButtonItem\n {option}\n hasPopup={false}\n on:click\n on:mouseenter={mouseenterHandler}\n on:mouseleave={mouseleaveHandler}\n />\n {/if}\n {/if}\n</li>\n\n<script>\n import AnchorItem from './AnchorItem.svelte';\n import ButtonItem from './ButtonItem.svelte';\n import List from './List.svelte';\n import { Keys } from '@itslearning/atlas/keyboard/keys';\n import { isMobile } from '@itslearning/atlas/detectors/UserAgentHelper';\n import { normalizeKey } from '@itslearning/atlas/keyboard/normalize';\n import { focusPreviousListItem, focusNextListItem, goToNextList,\n goToPreviousList } from './navigationHelper.js';\n import { focusFirstItemIn, hide, hidden, hideOpenSubmenus, returnFocusToParentDropdown,\n show, isMenuItem, removeFocusFromParentDropdown } from './dropdownHelper.js';\n\n export let isSubmenu = false;\n\n export let option = null;\n\n function clickHandler({ detail: { event } }) {\n const button = event.currentTarget;\n const submenu = event.currentTarget.nextElementSibling;\n\n toggleMenu(button, submenu, false);\n }\n\n function mouseenterHandler({ detail: { event } }) {\n // TODO: should be removed in https://jira.itslearning.com/browse/TRK-6805\n if (isMobile()) {\n return;\n }\n\n const item = event.currentTarget;\n const submenu = event.currentTarget.nextElementSibling;\n\n if (isMenuItem(item)) {\n openMenu(item, submenu, true);\n } else if (!isSubmenu) {\n hideOpenSubmenus();\n }\n }\n\n function mouseleaveHandler({ detail: { event } }) {\n // TODO: should be removed in https://jira.itslearning.com/browse/TRK-6805\n if (isMobile()) {\n return;\n }\n\n const submenu = event.currentTarget.nextElementSibling;\n\n if (!isSubmenu && submenu && !submenu.contains(event.relatedTarget)) {\n closeMenu(submenu, false);\n }\n }\n\n function moveToNextItem(currentItem){\n const nextItemFocused = focusNextListItem(currentItem);\n\n if (!nextItemFocused) { goToNextList(currentItem); }\n }\n\n function moveToPreviousItem(currentItem){\n const previousItemFocused = focusPreviousListItem(currentItem);\n\n if (!previousItemFocused) { goToPreviousList(currentItem); }\n }\n\n function keyHandlerDown(event) {\n const { key } = event;\n const button = event.target;\n\n switch (normalizeKey(key)) {\n case Keys.UP:\n event.preventDefault();\n moveToPreviousItem(button);\n break;\n case Keys.DOWN:\n event.preventDefault();\n moveToNextItem(button);\n break;\n default:\n return;\n }\n }\n\n function keyHandlerUp(event) {\n const { key } = event;\n const button = event.target;\n const submenu = event.target.nextElementSibling;\n\n switch (normalizeKey(key)) {\n case Keys.LEFT:\n hideOpenSubmenus();\n returnFocusToParentDropdown();\n break;\n case Keys.RIGHT:\n if (isMenuItem(button)) {\n toggleMenu(button, submenu, false);\n }\n break;\n default:\n return;\n }\n }\n\n function openMenu(button, submenu, isHover) {\n hideOpenSubmenus();\n removeFocusFromParentDropdown();\n show(submenu);\n\n button.classList.add('open');\n button.setAttribute('aria-expanded', true);\n\n if (!isHover) {\n focusFirstItemIn(submenu);\n }\n }\n\n function closeMenu(submenu, isHover) {\n if (!hidden(submenu)) {\n hide(submenu);\n const button = document.querySelector('.prom-dropdown__listitems-menu.open');\n button.setAttribute('aria-expanded', false);\n button.classList.remove('open');\n\n if (!isHover) {\n returnFocusToParentDropdown();\n }\n }\n }\n\n function toggleMenu(button, submenu, isHover) {\n hidden(submenu) ?\n openMenu(button, submenu, isHover) :\n closeMenu(submenu, true);\n }\n</script>\n","/**\r\n * @module generate/guid\r\n */\r\n\r\n/**\r\n * Generates a valid v4 GUID as per http://www.ietf.org/rfc/rfc4122.txt\r\n *\r\n * <p>Important parts: xxxxxxxx-xxxx-Mxxx-Nxxx-xxxxxxxxxxxx</p>\r\n * <p>Where M represents the version and the most significant bits of N represent the variant.</p>\r\n * <p>See http://guid.one/guid and http://guid.one/guid/make for more info.</p>\r\n *\r\n * @returns {string} a valid V4 GUID\r\n */\r\nexport function guidV4() {\r\n // In Internet Explorer crypto is implemented as experimental so it is only available as msCrypto\r\n const crypto = window.crypto || window.msCrypto;\r\n const bytes = crypto.getRandomValues(new Uint8Array(16));\r\n\r\n // Add version data to the byte at index 6\r\n bytes[6] = (bytes[6] & 0x0f) | 0x40;\r\n // Add variant data to the byte at index 8\r\n bytes[8] = (bytes[8] & 0x3f) | 0x80;\r\n\r\n let i = 0;\r\n\r\n // Replace each x with 2 characters per byte from bytes to create a guid string\r\n return ('xxxx-xx-xx-xx-xxxxxx').replace(/x/g, () => {\r\n // Left-pad with 0 for single character values\r\n const value = ('0' + bytes[i].toString(16)).slice(-2);\r\n\r\n i += 1;\r\n\r\n return value;\r\n });\r\n}\r\n","{#if list.label}\n <h2 id=\"{id}{index+1}\" class=\"prom-dropdown__listheader\">{list.label}</h2>\n{/if}\n\n<ul\n on:keyup={(event) => dispatch('keyup', event)}\n aria-labelledby=\"{list.label ? id + (index+1) : null}\"\n role=\"menu\"\n>\n\n {#each list.options as option}\n <ListItem\n {isSubmenu}\n {option}\n on:dropdownClose\n on:click\n />\n {/each}\n</ul>\n\n<script>\n import ListItem from './ListItem.svelte';\n import { guidV4 } from '@itslearning/atlas/generate/guid';\n import { createEventDispatcher } from 'svelte';\n\n const dispatch = createEventDispatcher();\n\n /** @type {string} */\n export let id = guidV4();\n /** @type {number} */\n export let index = 0;\n /** @type {boolean} */\n export let isSubmenu = false;\n /** @type {object} */\n export let list = null;\n</script>\n","<svelte:window on:click={clickHandler} on:keyup={globalKeyHandler} />\n\n<section class=\"prom-dropdown {notResponsiveClass}\" {hidden} bind:this={root}>\n <section class=\"{arrowClass}\"></section>\n <header class=\"prom-dropdown__header\">\n <slot name=\"header\"></slot>\n </header>\n\n <section class=\"prom-dropdown__body\">\n <section class=\"prom-dropdown__bodygradient-top\"></section>\n {#if items.length}\n {#each items as list, index}\n <List\n {id}\n {index}\n {list}\n on:click={selectOption}\n on:dropdownClose\n on:keyup={keyHandler}\n />\n {/each}\n {:else}\n <slot name=\"body\"></slot>\n {/if}\n\n </section>\n\n <footer class=\"prom-dropdown__footer\">\n <slot name=\"footer\"></slot>\n </footer>\n</section>\n\n<script>\n import { Keys } from '@itslearning/atlas/keyboard/keys';\n import { normalizeKey } from '@itslearning/atlas/keyboard/normalize';\n import TabTrapHelper from '../../../../lib/helpers/TabTrapHelper';\n import { hideOpenSubmenus, openSubmenus, returnFocusToParentDropdown } from './dropdownHelper.js';\n import List from './List.svelte';\n import { createEventDispatcher, onMount } from 'svelte';\n\n const dispatch = createEventDispatcher();\n\n let root;\n let tabTrapper;\n\n /** @type {boolean} */\n export let arrow = true;\n /** @type {('top'|'bottom')} */\n export let arrowPosition = 'top';\n /** @type {boolean} */\n export let expanded = false;\n /** @type {string} */\n export let id = 'prom-dropdown__list';\n /** @type {{label: string, options: {icon: string, iconsize: number, label: string, link: boolean, url: string, ellipsis: boolean, divider: boolean, iconCssClass: string, target: string, value: string, options: [], cssClass: string } }[]} */\n export let items = [];\n /** @type {boolean} */\n export let responsive = true;\n\n $: arrowClass = arrow ? `arrow-${arrowPosition}` : '';\n\n $: hidden = expanded ? '' : 'hidden';\n\n $: notResponsiveClass = responsive ? '' : 'prom-dropdown--not-responsive';\n\n $: if (items || expanded !== null) {\n setTimeout(() => {\n tabTrapper.init();\n }, 0);\n }\n\n function clickHandler(event) {\n if (!root.contains(event.target)) {\n dispatch('dropdownClose', event);\n }\n }\n\n function globalKeyHandler(event) {\n const { key } = event;\n\n switch (normalizeKey(key)) {\n case Keys.ESCAPE:\n if (expanded) {\n keyHandler(event);\n }\n break;\n case Keys.TAB:\n dispatch('dropdownClose', event);\n break;\n default:\n return;\n }\n }\n\n function keyHandler(event) {\n const { key } = event;\n\n switch (normalizeKey(key)) {\n case Keys.ESCAPE:\n if (openSubmenus()) {\n hideOpenSubmenus();\n returnFocusToParentDropdown();\n event.stopPropagation();\n } else {\n dispatch('dropdownClose', event);\n }\n break;\n case Keys.UP:\n break;\n case Keys.DOWN:\n break;\n default:\n return;\n }\n }\n\n function selectOption(event) {\n dispatch('selectedOption', { event, data: event.detail.data.value });\n dispatch('dropdownClose', event);\n }\n\n onMount(() => {\n tabTrapper = new TabTrapHelper(root);\n });\n</script>\n","<section\n class=\"prom-button-dropdown-overlay {overlayClass}\"\n on:click={toggle}\n>\n</section>\n\n<section\n class=\"prom-button-dropdown prom-dropdown__{position}\"\n {id}\n>\n <IconButton\n iconClass={cssClass}\n id=\"{id}-button\"\n {iconOnly}\n {iconPlacement}\n {expanded}\n {large}\n {text}\n {textOnly}\n {type}\n {disabled}\n {ariaLabel}\n haspopup\n htmlType=\"button\"\n on:click={toggle}\n on:keyup={keyUpHandler}\n on:keydown={keyDownHandler}\n />\n\n <Dropdown\n {arrow}\n {arrowPosition}\n {expanded}\n {items}\n {responsive}\n id=\"{id}-list\"\n on:dropdownClose={closeHandler}\n on:submenuClose={submenuHandler}\n on:selectedOption\n >\n\n <section slot=\"header\">\n <slot name=\"header\"></slot>\n </section>\n\n <section slot=\"footer\">\n <slot name=\"footer\"></slot>\n </section>\n </Dropdown>\n\n</section>\n\n<script>\n import IconButton from '../../../inputs/IconButton/v1/IconButton.svelte';\n import Dropdown from '../../Dropdown/v1/Dropdown.svelte';\n import { focusFirstItemIn, hideOpenSubmenus, removeFocusFromParentDropdown } from '../../Dropdown/v1/dropdownHelper.js';\n import { Keys } from '@itslearning/atlas/keyboard/keys';\n import { normalizeKey } from '@itslearning/atlas/keyboard/normalize';\n import { createEventDispatcher } from 'svelte';\n\n const dispatch = createEventDispatcher();\n\n $: arrowPosition = position === 'up' ? 'bottom' : 'top';\n $: cssClass = textOnly ? '' : iconClass;\n $: overlayClass = responsive && expanded ? 'prom-button-dropdown-overlay--visible' : '';\n\n /** @type {boolean} */\n export let arrow = true;\n /** @type {string} */\n export let iconClass = 'prom-button-dropdown-icon';\n /** @type {boolean} */\n export let expanded = false;\n /** @type {boolean} */\n export let disabled = false;\n /** @type {boolean} */\n export let iconOnly = false;\n /** @type {'start'|'end'} */\n export let iconPlacement = 'start';\n /** @type {string} */\n export let id = 'button-dropdown';\n /** @type {Object[]} */\n export let items = [];\n /** @type {boolean} */\n export let large = false;\n /** @type {string} */\n export let position = 'down';\n /** @type {boolean} */\n export let responsive = true;\n /** @type {string} */\n export let text = 'ChangeMe';\n /** @type {boolean} */\n export let textOnly = true;\n /** @type {string} */\n export let type = 'primary';\n /** @type {string} */\n export let ariaLabel = undefined;\n\n function closeHandler({ detail: event }) {\n const buttonElement = document.querySelector('#' + id + '-button');\n\n if (buttonElement && buttonElement.contains(event.target)) {\n return;\n }\n\n const { key } = event;\n\n expanded = false;\n\n switch (normalizeKey(key)) {\n case Keys.ESCAPE:\n returnFocus();\n break;\n default:\n return;\n }\n }\n\n function submenuHandler(event) {\n event.stopPropagation();\n hideOpenSubmenus();\n }\n\n function keyDownHandler(event) {\n const { key } = event;\n\n switch (normalizeKey(key)) {\n case Keys.DOWN: {\n event.preventDefault();\n expanded = true;\n const dropdown = document.querySelector('#' + id);\n\n setTimeout(() => focusFirstItemIn(dropdown), 0);\n break;\n }\n case Keys.TAB:\n hideOpenSubmenus();\n removeFocusFromParentDropdown();\n expanded = false;\n break;\n case Keys.ENTER:\n case Keys.SPACE:\n event.preventDefault();\n toggle(event, true);\n break;\n default:\n return;\n }\n }\n\n function keyUpHandler(event) {\n const { key } = event;\n\n switch (normalizeKey(key)) {\n case Keys.ESCAPE:\n expanded = false;\n returnFocus();\n break;\n default:\n return;\n }\n }\n\n function toggle(event, setFocus = false) {\n event.preventDefault();\n dispatch('beforeToggle', event);\n\n expanded = !expanded;\n\n if (items.length && setFocus) {\n const dropdown = document.querySelector('#' + id);\n\n setTimeout(() => focusFirstItemIn(dropdown), 0);\n }\n }\n\n function returnFocus() {\n const buttonElement = document.querySelector('#' + id + '-button');\n\n buttonElement.focus();\n }\n</script>\n","<script>\n // @ts-nocheck\n\n import { createEventDispatcher } from 'svelte';\n\n import ButtonDropdown from \"../../../dropdowns/ButtonDropdown/v1/ButtonDropdown.svelte\";\n import Link from \"../../../Navigation/Link/v1/Link.svelte\";\n import IconButton from \"../../../inputs/IconButton/v1/IconButton.svelte\";\n\n /** @type {'h1' | 'h2'} */\n export let headingLevel = 'h1';\n\n /** @type {string} */\n export let title;\n\n /** @type {string} */\n export let backLinkText = undefined;\n\n /** @type {string} */\n export let backLinkUrl = undefined;\n\n /** @type {string} */\n export let backLinkTarget = '_self';\n\n /** @type {string} */\n export let backButtonText = undefined;\n\n /** @type {object[]} */\n export let menuItems = undefined;\n\n /** @type {boolean} */\n export let responsiveDropdown = true;\n\n /** @type {object} */\n export let i18n = {\n showMoreOptions: 'Show more options'\n }\n\n /** @type {boolean} */\n export let fixedHeaderSize = false;\n\n /** @type {string} */\n export let buttonDropdownId = \"rnd\" + Math.random().toString(36).replace('.', '');\n\n export let iconSrc = '';\n\n const dispatch = createEventDispatcher();\n\n $: {\n if (backLinkUrl && !backLinkText) {\n console.error('Back link text is mandatory if there is a back link url.');\n }\n\n if (backLinkUrl && backButtonText) {\n console.error('Use either backLinkUrl or backButtonText.');\n }\n }\n\n $: textBoldCss = fixedHeaderSize ? 'text-bold-800' : 'text-bold-600';\n</script>\n\n<header class=\"prom-page-header\">\n {#if backLinkUrl}\n <div class=\"prom-page-header__back-link\">\n <Link standalone={true} href={backLinkUrl} text={backLinkText} target={backLinkTarget}\n iconClass=\"prom-page-header__back-link-icon\" iconPlacement=\"start\" />\n </div>\n {:else if backButtonText}\n <div class=\"prom-page-header__back-button-container\">\n <IconButton text={backButtonText} on:click={() => dispatch('pageHeaderBack')} iconClass=\"prom-page-header__back-button-icon\" htmlType=\"button\" type=\"plain\" large={true} />\n </div>\n {/if}\n\n <div class=\"prom-page-header__header\">\n <div class=\"prom-page-header__header-title\">\n {#if iconSrc}\n <img class=\"prom-page-icon\" width=\"32\" height=\"32\" src={iconSrc} alt=\"\" />\n {/if}\n {#if headingLevel === 'h1'}\n <h1 class=\"prom-page-header__header-title-text | text-bold-800\">{title}</h1>\n {/if}\n {#if headingLevel === 'h2'}\n <h2 class=\"prom-page-header__header-title-text | {textBoldCss}\">{title}</h2>\n {/if}\n </div>\n\n <div class=\"prom-page-header__header-menu\">\n {#if menuItems}\n <ButtonDropdown\n id={buttonDropdownId}\n large={true}\n arrow={false}\n iconOnly={true}\n iconClass=\"prom-page-header__header-menu-options\"\n items={menuItems}\n ariaLabel={i18n.showMoreOptions}\n type=\"secondary\"\n textOnly={false}\n position=\"down\"\n responsive={responsiveDropdown}\n on:selectedOption/>\n {:else}\n <slot name=\"header-menu\" />\n {/if}\n </div>\n </div>\n\n {#if $$slots.subHeader}\n <div class=\"prom-page-header__sub-header\">\n <slot name=\"subHeader\" />\n </div>\n {/if}\n</header>\n","<script>\n /** @type {'full'|'wide'|'narrow'} */\n export let contentAreaLayout = 'full';\n</script>\n\n<div class:content-area={contentAreaLayout !== 'full'}\n class:content-area-full={contentAreaLayout === 'full'}\n class:content-area--wide={contentAreaLayout === 'wide'}\n class:content-area--narrow={contentAreaLayout === 'narrow'}>\n {#if contentAreaLayout !== 'full'}\n <div class=\"content\">\n <slot />\n </div>\n {:else}\n <slot />\n {/if}\n</div>\n","<script>\n export let value;\n export let type;\n export let classText;\n export let disabled;\n export let describedby;\n export let placeholder;\n export let required;\n export let hasError = false;\n export let autocomplete;\n export let id;\n export let step;\n export let min;\n export let max;\n export let minlength = 0;\n export let maxlength = 99;\n export let spellcheck;\n export let cols = 20;\n export let rows = 2;\n\n let conditionalAttributes;\n\n $: {\n const attributes = {};\n\n if (spellcheck !== null && spellcheck !== undefined) {\n attributes.spellcheck = spellcheck;\n }\n\n conditionalAttributes = attributes;\n }\n</script>\n\n{#if type === 'text'}\n <input\n id=\"{id}\"\n class=\"{classText}\"\n disabled=\"{disabled}\"\n placeholder=\"{placeholder}\"\n required=\"{required}\"\n class:prom-input-field__input--has-error={hasError}\n type=\"text\"\n autocomplete=\"{autocomplete}\"\n aria-describedby=\"{describedby}\"\n minlength=\"{minlength}\"\n maxlength=\"{maxlength}\"\n bind:value\n on:focus\n on:blur\n on:click\n on:keyup\n on:input\n on:paste\n {...conditionalAttributes} />\n{:else if type === 'email'}\n <input\n id=\"{id}\"\n class=\"{classText}\"\n disabled=\"{disabled}\"\n placeholder=\"{placeholder}\"\n required=\"{required}\"\n class:prom-input-field__input--has-error={hasError}\n type=\"email\"\n autocomplete=\"{autocomplete}\"\n aria-describedby=\"{describedby}\"\n minlength=\"{minlength}\"\n maxlength=\"{maxlength}\"\n bind:value\n on:focus\n on:blur\n on:click\n on:keyup\n on:input\n on:paste\n {...conditionalAttributes} />\n{:else if type === 'password'}\n <input\n id=\"{id}\"\n class=\"{classText}\"\n disabled=\"{disabled}\"\n placeholder=\"{placeholder}\"\n required=\"{required}\"\n class:prom-input-field__input--has-error={hasError}\n type=\"password\"\n autocomplete=\"{autocomplete}\"\n aria-describedby=\"{describedby}\"\n minlength=\"{minlength}\"\n maxlength=\"{maxlength}\"\n bind:value\n on:focus\n on:blur\n on:click\n on:keyup\n on:input\n on:paste\n {...conditionalAttributes} />\n{:else if type === 'url'}\n <input\n id=\"{id}\"\n class=\"{classText}\"\n disabled=\"{disabled}\"\n placeholder=\"{placeholder}\"\n required=\"{required}\"\n class:prom-input-field__input--has-error={hasError}\n type=\"url\"\n autocomplete=\"{autocomplete}\"\n aria-describedby=\"{describedby}\"\n minlength=\"{minlength}\"\n maxlength=\"{maxlength}\"\n bind:value\n on:focus\n on:blur\n on:click\n on:keyup\n on:input\n on:paste\n {...conditionalAttributes} />\n{:else if type === 'tel'}\n <input\n id=\"{id}\"\n class=\"{classText}\"\n disabled=\"{disabled}\"\n placeholder=\"{placeholder}\"\n required=\"{required}\"\n class:prom-input-field__input--has-error={hasError}\n type=\"tel\"\n autocomplete=\"{autocomplete}\"\n aria-describedby=\"{describedby}\"\n minlength=\"{minlength}\"\n maxlength=\"{maxlength}\"\n bind:value\n on:focus\n on:blur\n on:click\n on:keyup\n on:input\n on:paste\n {...conditionalAttributes} />\n{:else if type === 'number'}\n <input\n id=\"{id}\"\n class=\"{classText}\"\n disabled=\"{disabled}\"\n placeholder=\"{placeholder}\"\n required=\"{required}\"\n class:prom-input-field__input--has-error={hasError}\n type=\"number\"\n autocomplete=\"{autocomplete}\"\n aria-describedby=\"{describedby}\"\n step=\"{step}\"\n min=\"{min}\"\n max=\"{max}\"\n minlength=\"{minlength}\"\n maxlength=\"{maxlength}\"\n bind:value\n on:focus\n on:blur\n on:click\n on:keyup\n on:input\n on:paste\n {...conditionalAttributes} />\n{:else if type === 'area'}\n <textarea\n id=\"{id}\"\n class=\"{classText}\"\n disabled=\"{disabled}\"\n placeholder=\"{placeholder}\"\n required=\"{required}\"\n class:prom-input-field__input--has-error={hasError}\n autocomplete=\"{autocomplete}\"\n aria-describedby=\"{describedby}\"\n minlength=\"{minlength}\"\n maxlength=\"{maxlength}\"\n cols=\"{cols}\"\n rows=\"{rows}\"\n bind:value\n on:focus\n on:blur\n on:click\n on:keyup\n on:input\n on:paste\n {...conditionalAttributes}></textarea>\n{/if}\n","<script>\n import TextInput from './TextInput.svelte';\n\n /** @type {string} */\n export let id = 'rnd' + Math.random().toString(36).substring(7);\n\n /** @type {string} */\n export let label;\n\n /** @type {'text'|'email'|'password'|'url'|'tel'|'area'|'number'} */\n export let type = 'text';\n\n /** @type {boolean} */\n export let required = false;\n\n /** @type {string} */\n export let placeholder;\n\n /** @type {boolean} */\n export let disabled = false;\n\n /** @type {string} */\n export let value = null;\n\n /** @type {string} */\n export let hint = null;\n\n /** @type {boolean} */\n export let hasError = false;\n\n /** @type {string} */\n export let errorMessage = undefined;\n\n /** @type {undefined|'small'|'medium'|'large'} */\n export let height = null;\n\n /** @type {string} */\n export let step = 'any';\n\n /** @type {number} */\n export let min = undefined;\n\n /** @type {number} */\n export let max = undefined;\n\n /** @type {number} */\n export let minlength = 1;\n\n /** @type {number} */\n export let maxlength = 99;\n\n /** @type {boolean} */\n export let labelHidden = false;\n\n /** @type {string} */\n export let autocomplete = 'off';\n\n /** @type {boolean|undefined} */\n export let spellcheck = undefined;\n\n /** @type {number} */\n export let cols = 20;\n\n /** @type {number} */\n export let rows = 2;\n\n /** @type {'left' | 'top'} */\n export let labelPosition = 'top';\n\n /** @type {undefined | 'off' | 'polite' | 'assertive'} */\n export let ariaLiveUpdateType = null;\n\n $: areaSizeClass =\n type === 'area' && height\n ? 'prom-input-field--' + height + '-area'\n : '';\n\n $: hasErrorClass = hasError ? 'prom-input-field--has-error' : '';\n\n $: labelText =\n !label || typeof label !== 'string'\n ? console.warn('Label must be supplied')\n : label;\n\n $: errorMessageId = id + '__error-message';\n\n $: labelHiddenClass = labelHidden ? 'screen-reader' : '';\n</script>\n\n<div id=\"{id}\" class=\"prom-input-field {hasErrorClass}\">\n <!-- Ignore this a11y warning because it is incorrect, the label contains the control -->\n <!-- svelte-ignore a11y-label-has-associated-control -->\n <label class:prom-input-field--label-left={labelPosition === 'left'}>\n <span class=\"prom-input-field__label {labelHiddenClass}\">\n {labelText}\n {#if required}\n <span aria-hidden=\"true\" class=\"prom-input__required-star\"\n >*</span>\n {/if}\n {#if hint}<span class=\"prom-input-field__hint\">{hint}</span>{/if}\n </span>\n\n <TextInput\n type=\"{type}\"\n id=\"prom-input-{id}\"\n classText=\"prom-input-field__input {areaSizeClass}\"\n disabled=\"{disabled}\"\n placeholder=\"{placeholder}\"\n required=\"{required}\"\n {hasError}\n spellcheck=\"{spellcheck}\"\n autocomplete=\"{autocomplete}\"\n describedby=\"{errorMessageId}\"\n cols=\"{cols}\"\n rows=\"{rows}\"\n step=\"{step}\"\n min=\"{min}\"\n max=\"{max}\"\n minlength=\"{minlength}\"\n maxlength=\"{maxlength}\"\n bind:value\n on:focus\n on:blur\n on:click\n on:keyup\n on:input\n on:paste />\n </label>\n\n <div\n aria-live={ariaLiveUpdateType}\n class=\"prom-error-message\"\n class:prom-error-message--shown={hasError && errorMessage}\n id=\"{errorMessageId}\">\n {#if hasError && errorMessage}\n {errorMessage}\n {/if}\n </div>\n</div>\n","<fieldset class=\"prom-colorpicker\">\n <legend class=\"prom-colorpicker__legend\">\n <span class=\"prom-colorpicker__title\">{label}</span>\n {#if description}\n <span class=\"prom-colorpicker__description\">{description}</span>\n {/if}\n </legend>\n <div class=\"prom-colorpicker__wrapper\">\n {#each colours as colour}\n <label class=\"prom-colorpicker__option\">\n <input\n checked={selected === colour.className}\n class=\"prom-colorpicker__input | screen-reader\"\n disabled={disabled}\n name=\"colorpicker_{name}\"\n type=\"radio\"\n value={colour.className}\n on:change = {select}>\n <span class=\"prom-colorpicker__labelwrapper\">\n <span class=\"prom-colorpicker__label {colour.className}\">{colour.className} ({colour.hexCode})</span>\n </span>\n </label>\n {/each}\n </div>\n</fieldset>\n\n<script>\n import { createEventDispatcher } from 'svelte';\n\n const dispatch = createEventDispatcher();\n\n export let colours = [];\n export let description = '';\n export let disabled = false;\n export let label = '';\n export let name = '';\n export let selected = '';\n\n function select(event) {\n selected = event.currentTarget.defaultValue;\n dispatch('change', event);\n }\n</script>\n","const config = window.plansConfig;\r\n\r\nexport default config;\r\n","const i18n = window.plansConfig.i18n;\r\n\r\nexport default i18n;\r\n","/**\r\n * Constants used in the App\r\n * (ie: endpoints, images, ...)\r\n */\r\n\r\nexport const backLinkDestinations = {\r\n current: 0,\r\n past: 1,\r\n withoutDate: 2,\r\n topic: 3,\r\n topics: 4,\r\n overview: 5,\r\n calendar: 6,\r\n myPage: 7,\r\n parentDashboard: 8,\r\n all: 10,\r\n tableView: 11\r\n};\r\n\r\nexport const plannerViews = {\r\n notDefined: 0,\r\n current: 1,\r\n past: 2,\r\n withoutDate: 3,\r\n topic: 4,\r\n tableView: 5\r\n};\r\n\r\nexport const plannerTabIds = {\r\n current: 0,\r\n past: 1,\r\n withoutDate: 2,\r\n topics: 3,\r\n all: 10\r\n};\r\n\r\nexport const readyMadeContentImportStatus = {\r\n none: 0,\r\n notImported: 1,\r\n fullyImported: 2\r\n}\r\n\r\nexport const plannerSelfPacedTabIds = {\r\n topics: 0,\r\n all: 1\r\n};\r\n\r\nexport const readyMadeContentTemplateTypes = {\r\n yourCourses: 0,\r\n courseTemplates: 1,\r\n fromPublishers: 2,\r\n otherSites: 3\r\n};\r\n\r\nexport const endpoints = {\r\n // API Endpoints\r\n addCloudFilesToCourseFolder: planId =>\r\n `/restapi/personal/courses/{courseId}/folders/{folderId}/file/cloud/v1?planId=${planId}`,\r\n addFileRepoFilesToCourseFolder: planId =>\r\n `/restapi/personal/courses/{courseId}/folders/{folderId}/file/filerepo/v1?planId=${planId}`,\r\n getRecentCloudElements:\r\n \"/restapi/personal/cloudproxy/recentfiles/{cloudService}/{filesCount}/{includeFolders}/{includeSharedFiles}\",\r\n getRecentElements:\r\n \"/restapi/personal/courses/{courseId}/resources/lastupdated/v1?elementType={elementType}\",\r\n printPlans: (courseId, planIds, selectedView) =>\r\n `/plans/courses/${courseId}/printPlans?planIds=${planIds.join()}&selectedView=${selectedView}`,\r\n printPlansTbl: (courseId, planIds, selectedView) =>\r\n `/plans/courses/${courseId}/printPlansTbl?planIds=${planIds.join()}&selectedView=${selectedView}`,\r\n printAllPlansTbl: (courseId, topicIds, selectedView) =>\r\n `/plans/courses/${courseId}/printAllPlansTbl?topicIds=${topicIds.join()}&selectedView=${selectedView}`,\r\n printTopics: (courseId, topicIds, planIds) =>\r\n `/plans/courses/${courseId}/printTopics?topicIds=${topicIds.join()}${\r\n planIds && planIds.length ? `&planIds=${planIds.join()}` : \"\"\r\n }`,\r\n hasAnyPlan: courseId => `/plans/courses/${courseId}/hasAnyPlan`,\r\n getAvailabilityOfTemplateTypes: (courseId, topicId) =>\r\n `/restapi/personal/course/${courseId}/plans/availableTemplates/v1?topicId=${topicId}`,\r\n searchForCourses: (options, paging) =>\r\n `/restapi/course/templates/v1?search=${options.title}&PageNumber=${paging.pageIndex}&PageSize=${paging.pageSize}&sortDescending=${options.sortDescending}&availabilityType=${options.availabilityType}&organisationId=${options.organisationId}&selectedCourseId=${options.selectedCourseId}&selectedTopicId=${options.selectedTopicId}&isPush=${options.isPush}&requireTopics=${options.requireTopics}`,\r\n searchForPlannerTemplates: (options, paging) =>\r\n `/restapi/course/templates/shareableplanner/v1?search=${options.title}&PageNumber=${paging.pageIndex}&PageSize=${paging.pageSize}&sortDescending=${options.sortDescending}&publishersOnly=${options.publishersOnly}&organisationId=${options.organisationId}`,\r\n getTopicsFromCourse: (courseId, templateCourseId, paging) =>\r\n `/restapi/course/${courseId}/import/templates/course/${templateCourseId}/topics/v2?PageIndex=${paging.pageIndex}&PageSize=${paging.pageSize}`,\r\n getTopicsFromShareablePlanner: (courseId, templateCourseId, type) =>\r\n `/restapi/course/${courseId}/import/templates/shareableplanner/${templateCourseId}/topics/v1?elementType=${type}`,\r\n getPlansInTopicFromCourse: (courseId, templateCourseId, topicId, paging) =>\r\n `/restapi/course/${courseId}/import/templates/course/${templateCourseId}/topics/${topicId}/plans/v1?PageIndex=${paging.pageIndex}&PageSize=${paging.pageSize}`,\r\n getResourcesFromTemplateCourse: (courseId, templateCourseId, topicId, planId, paging, type) =>\r\n `/restapi/course/${courseId}/import/templates/course/${templateCourseId}/topics/${topicId}/plans/${planId}/resources/v1?PageIndex=${paging.pageIndex}&PageSize=${paging.pageSize}&type=${type}`,\r\n importResources: courseId => `/restapi/personal/course/${courseId}/plans/importResources/v1`,\r\n saveUserPreferencePageSize: courseId =>\r\n `/restapi/course/${courseId}/import/preferences/readymadecontent/pagesize/v1`\r\n};\r\n\r\nexport const pages = {\r\n addTopic: courseId => `/plans/courses/${courseId}/addedittopic`,\r\n editTopic: (courseId, topicId) => `/plans/courses/${courseId}/addedittopic/${topicId}`\r\n};\r\n\r\nexport const icons = {\r\n assignment: \"icons/assignment.svg\",\r\n course: \"icons/graduation_cap.svg\",\r\n googleDrive: \"icons/xp/googledrive.svg\",\r\n googleDriveDefault: \"icons/xp/google_file.svg\",\r\n library: \"icons/library.svg\",\r\n office365: \"icons/office365.svg\",\r\n onedrive: \"icons/microsoft-onedrive-2019.svg\",\r\n task: \"icons/task.svg\",\r\n test: \"icons/test.svg\",\r\n readyMadeContent: \"icons/graduation_cap.svg\"\r\n};\r\n\r\nexport const resourceIcons = {\r\n AssignmentApp: icons.assignment,\r\n Assignment: icons.assignment,\r\n CustomActivity: icons.task,\r\n TestApp: icons.test,\r\n Test: icons.test\r\n};\r\n\r\n// Map received assignment and test element names to both possible menu items\r\n// because the endpoint does not differentiate between the two so it could be either\r\nexport const elementNameMenuNameMap = {\r\n Assignment: [\"AssignmentApp\", \"Assignment\"],\r\n Test: [\"TestApp\", \"Test\"],\r\n CustomActivity: [\"CustomActivity\"],\r\n Note: [\"Note\"],\r\n Lesson: [\"Page\"],\r\n WebLink: [\"Link\"]\r\n};\r\n\r\nexport const courseResourcesPageSize = 24;\r\nexport const getCoursesForCopyPageSize = 100;\r\nexport const pageSizeInCalendar = 3;\r\nexport const plansForTopicPageSize = 50;\r\nexport const defaultPageSize = 8;\r\nexport const defaultPageSizePaginationTableView = 15;\r\n\r\nexport const columnTypes = {\r\n RichText: 0,\r\n Topic: 1,\r\n Plan: 3,\r\n PlanDescription: 4,\r\n Date: 5,\r\n ClassHours: 6,\r\n LearningObjectives: 7,\r\n Resources: 8,\r\n Activities: 9,\r\n Term: 10,\r\n Rubric: 11,\r\n Elements: 12,\r\n Thumbnail: 13,\r\n TopicThumbnail: 14\r\n};\r\n\r\nexport const columnVisibility = {\r\n All: 1,\r\n Teacher: 0,\r\n Nobody: 2\r\n};\r\n\r\nexport const learningObjectiveType = {\r\n Subject: 1,\r\n Folder: 2,\r\n LearningObjective: 3,\r\n Category: 4\r\n};\r\n\r\nexport const plannerFieldType = {\r\n RichText: 0,\r\n Topic: 1,\r\n PlanTitle: 3,\r\n PlanDescription: 4,\r\n Date: 5,\r\n ClassHours: 6,\r\n LearningObjectives: 7,\r\n Resources: 8,\r\n Activities: 9,\r\n Term: 10,\r\n Rubric: 11,\r\n Elements: 12,\r\n Thumbnail: 13,\r\n TopicThumbnail: 14\r\n};\r\n\r\nexport const resourceTypeToShow = {\r\n everything: 0,\r\n resources: 1,\r\n activities: 2\r\n};\r\n\r\nexport const elementCategory = {\r\n Resource: 0,\r\n Activity: 1\r\n};\r\n\r\nexport const courseAvailabilityType = {\r\n all: \"All\",\r\n mineOnly: \"MineOnly\",\r\n other: \"Other\"\r\n};\r\n\r\nexport const listTypes = {\r\n courseList: 0,\r\n topicList: 1,\r\n planList: 2,\r\n resourceList: 3\r\n};\r\n\r\nexport const plannerFieldTypeReversed = reverseObject(plannerFieldType);\r\n\r\nfunction reverseObject(obj) {\r\n const newObj = {};\r\n\r\n Object.keys(obj).forEach(key => (newObj[obj[key]] = key));\r\n\r\n return newObj;\r\n}\r\n\r\nexport const defaultFromHour = \"08\";\r\nexport const defaultToHour = \"09\";\r\n\r\nexport const plannerFilesUploadStatus = {\r\n none: 0,\r\n inProgress: 1,\r\n success: 2,\r\n error: 3\r\n};\r\n\r\nexport const minTitleLength = 1;\r\nexport const maxTitleLength = 255;\r\n\r\nexport const topicsActionType = {\r\n Copy: 0,\r\n Print: 1,\r\n Delete: 2\r\n};\r\n\r\nexport const plansActionType = {\r\n MakeVisible: 0,\r\n MakeNotVisible: 1,\r\n SetDate: 2,\r\n Copy: 3,\r\n Print: 4,\r\n Delete: 5,\r\n ConnectToCalendar: 6\r\n};\r\n\r\nexport const plansCopyActionModal = {\r\n SelectCourse: 0,\r\n SelectTopic: 1,\r\n SelectWithoutTopic: 2\r\n};\r\n\r\nexport const weekDays = {\r\n // for setPlansTimeSpan and setPlansWeekAndDay api\r\n Monday: 1,\r\n Tuesday: 2,\r\n Wednesday: 4,\r\n Thursday: 8,\r\n Friday: 16,\r\n Saturday: 32,\r\n Sunday: 64\r\n};\r\n\r\nexport const planSorting = {\r\n NotSetValue: 1,\r\n CreationDateValue: 2,\r\n DateAscendingValue: 3,\r\n DateDescendingValue: 4,\r\n AlphabeticallyAZValue: 5,\r\n AlphabeticallyZAValue: 6,\r\n YourOwnSortingValue: 7\r\n};\r\n\r\nexport const plansOrder = Object.freeze({\r\n default: 0,\r\n topic: 1,\r\n tableView: 2\r\n});\r\n\r\nexport const TABLE_VIEW_PLANS_REFRESH_RESOURCES_EVENT_NAME =\r\n \"itsl-tableview-plans-refresh-resources\";\r\n\r\nexport const dateTimePickerModalFromSection = \"datetime-picker-modal__from\";\r\nexport const dateTimePickerModalToSection = \"datetime-picker-modal__to\";\r\nexport const datePickerButton = \"prom-date-picker__picker-button\";\r\nexport const fromDatePickerInputField = \"prom-input-date-picker-from-input\";\r\nexport const toDatePickerInputField = \"prom-input-date-picker-to-input\";\r\n\r\nexport const noTopicTopicId = 0;\r\n\r\nexport const BACK_DESTINATION_QUERY_STRING_PARAMETER = \"BackDestination\";\r\nexport const TABLE_VIEW_MODE_QUERY_STRING_PARAMETER = \"TableViewMode\";\r\nexport const TOPIC_ID_DESTINATION_QUERY_STRING_PARAMETER = \"TopicId\";\r\n\r\nexport const planType = Object.freeze({\r\n deadLineDriven: 0,\r\n onePlanAtATime: 1,\r\n allPlansAtOnce: 2\r\n});\r\n\r\nexport const onePlanAtATimePlanStatus = Object.freeze({\r\n locked: 0,\r\n unlocked: 1,\r\n inProgress: 2,\r\n reopened: 3,\r\n completed: 4\r\n});\r\n","<Modal describedBy=\"edit-topic-modal-description\" bind:enabled clickOutsideCloses={false}>\r\n <span slot=\"title\">{modalTitle}</span>\r\n <div slot=\"body\" class=\"its-plans__edit-topic-body\">\r\n <span id=\"edit-topic-modal-description\">{i18n.topicInformation}</span>\r\n <TextField\r\n label={i18n.titleHeader}\r\n labelHidden={false}\r\n bind:value={name}\r\n type=\"text\"\r\n placeholder={i18n.editTopicTitlePlaceholder}\r\n required={true}\r\n minlength={minTitleLength}\r\n maxlength={maxTitleLength}\r\n />\r\n <ColorPicker\r\n colours={config.topicColours}\r\n label={i18n.topicColourText}\r\n bind:selected={colorClass}\r\n />\r\n </div>\r\n\r\n <div slot=\"footer\">\r\n <Button\r\n type=\"primary\"\r\n htmlType=\"button\"\r\n on:click={save}\r\n text={i18n.save}\r\n disabled={!name || !name.length || loading}\r\n {loading}\r\n large\r\n />\r\n <Button\r\n type=\"secondary\"\r\n htmlType=\"button\"\r\n on:click={cancel}\r\n text={i18n.cancel}\r\n disabled={loading}\r\n {loading}\r\n large\r\n />\r\n </div>\r\n</Modal>\r\n\r\n<script>\r\n import Modal from \"@itslearning/prometheus/assets/modals/Modal/v2/Modal.svelte\";\r\n import TextField from \"@itslearning/prometheus/assets/inputs/TextField/v1/TextField.svelte\";\r\n import Button from \"@itslearning/prometheus/assets/inputs/Button/v1/Button.svelte\";\r\n import ColorPicker from \"@itslearning/prometheus/assets/inputs/ColorPicker/v1/ColorPicker.svelte\";\r\n import config from \"../../config\";\r\n import i18n from \"../../i18n\";\r\n import { minTitleLength, maxTitleLength } from \"../../constants\";\r\n import { createEventDispatcher } from \"svelte\";\r\n import { formatLanguageString } from \"@itslearning/atlas/strings/format\";\r\n\r\n const dispatch = createEventDispatcher();\r\n\r\n export let enabled;\r\n export let topic;\r\n\r\n let name;\r\n let colorClass;\r\n let loading = false;\r\n\r\n $: modalTitle = formatLanguageString(i18n.editX, config.topicName);\r\n\r\n $: if (topic && enabled) {\r\n setInitialValues();\r\n }\r\n\r\n // To avoid changing the topic model until save is clicked this copies the values\r\n // locally for editing\r\n function setInitialValues() {\r\n name = topic.name;\r\n\r\n // Use the hex code on the topic model to find the corresponding color in the config\r\n const matchingColor = config.topicColours.find(c => c.hexCode === topic.color);\r\n\r\n colorClass = matchingColor ? matchingColor.className : \"smog-1\";\r\n\r\n loading = false;\r\n }\r\n\r\n // On save dispatch the changed values to the parent component so they can be saved\r\n function save() {\r\n // Find the color in the config matching the one picked in the picker to return\r\n const color = config.topicColours.find(c => c.className === colorClass);\r\n\r\n dispatch(\"save\", { name, color });\r\n\r\n // Loading is set to true and the modal stays open\r\n // it is up to the parent component to save, then close the modal\r\n loading = true;\r\n }\r\n\r\n function cancel() {\r\n enabled = false;\r\n }\r\n</script>\r\n","import {\n\trun_all,\n\tsubscribe,\n\tnoop,\n\tsafe_not_equal,\n\tis_function,\n\tget_store_value\n} from '../internal/index.js';\n\nconst subscriber_queue = [];\n\n/**\n * Creates a `Readable` store that allows reading by subscription.\n *\n * https://svelte.dev/docs/svelte-store#readable\n * @template T\n * @param {T} [value] initial value\n * @param {import('./public.js').StartStopNotifier<T>} [start]\n * @returns {import('./public.js').Readable<T>}\n */\nexport function readable(value, start) {\n\treturn {\n\t\tsubscribe: writable(value, start).subscribe\n\t};\n}\n\n/**\n * Create a `Writable` store that allows both updating and reading by subscription.\n *\n * https://svelte.dev/docs/svelte-store#writable\n * @template T\n * @param {T} [value] initial value\n * @param {import('./public.js').StartStopNotifier<T>} [start]\n * @returns {import('./public.js').Writable<T>}\n */\nexport function writable(value, start = noop) {\n\t/** @type {import('./public.js').Unsubscriber} */\n\tlet stop;\n\t/** @type {Set<import('./private.js').SubscribeInvalidateTuple<T>>} */\n\tconst subscribers = new Set();\n\t/** @param {T} new_value\n\t * @returns {void}\n\t */\n\tfunction set(new_value) {\n\t\tif (safe_not_equal(value, new_value)) {\n\t\t\tvalue = new_value;\n\t\t\tif (stop) {\n\t\t\t\t// store is ready\n\t\t\t\tconst run_queue = !subscriber_queue.length;\n\t\t\t\tfor (const subscriber of subscribers) {\n\t\t\t\t\tsubscriber[1]();\n\t\t\t\t\tsubscriber_queue.push(subscriber, value);\n\t\t\t\t}\n\t\t\t\tif (run_queue) {\n\t\t\t\t\tfor (let i = 0; i < subscriber_queue.length; i += 2) {\n\t\t\t\t\t\tsubscriber_queue[i][0](subscriber_queue[i + 1]);\n\t\t\t\t\t}\n\t\t\t\t\tsubscriber_queue.length = 0;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * @param {import('./public.js').Updater<T>} fn\n\t * @returns {void}\n\t */\n\tfunction update(fn) {\n\t\tset(fn(value));\n\t}\n\n\t/**\n\t * @param {import('./public.js').Subscriber<T>} run\n\t * @param {import('./private.js').Invalidator<T>} [invalidate]\n\t * @returns {import('./public.js').Unsubscriber}\n\t */\n\tfunction subscribe(run, invalidate = noop) {\n\t\t/** @type {import('./private.js').SubscribeInvalidateTuple<T>} */\n\t\tconst subscriber = [run, invalidate];\n\t\tsubscribers.add(subscriber);\n\t\tif (subscribers.size === 1) {\n\t\t\tstop = start(set, update) || noop;\n\t\t}\n\t\trun(value);\n\t\treturn () => {\n\t\t\tsubscribers.delete(subscriber);\n\t\t\tif (subscribers.size === 0 && stop) {\n\t\t\t\tstop();\n\t\t\t\tstop = null;\n\t\t\t}\n\t\t};\n\t}\n\treturn { set, update, subscribe };\n}\n\n/**\n * Derived value store by synchronizing one or more readable stores and\n * applying an aggregation function over its input values.\n *\n * https://svelte.dev/docs/svelte-store#derived\n * @template {import('./private.js').Stores} S\n * @template T\n * @overload\n * @param {S} stores - input stores\n * @param {(values: import('./private.js').StoresValues<S>, set: (value: T) => void, update: (fn: import('./public.js').Updater<T>) => void) => import('./public.js').Unsubscriber | void} fn - function callback that aggregates the values\n * @param {T} [initial_value] - initial value\n * @returns {import('./public.js').Readable<T>}\n */\n\n/**\n * Derived value store by synchronizing one or more readable stores and\n * applying an aggregation function over its input values.\n *\n * https://svelte.dev/docs/svelte-store#derived\n * @template {import('./private.js').Stores} S\n * @template T\n * @overload\n * @param {S} stores - input stores\n * @param {(values: import('./private.js').StoresValues<S>) => T} fn - function callback that aggregates the values\n * @param {T} [initial_value] - initial value\n * @returns {import('./public.js').Readable<T>}\n */\n\n/**\n * @template {import('./private.js').Stores} S\n * @template T\n * @param {S} stores\n * @param {Function} fn\n * @param {T} [initial_value]\n * @returns {import('./public.js').Readable<T>}\n */\nexport function derived(stores, fn, initial_value) {\n\tconst single = !Array.isArray(stores);\n\t/** @type {Array<import('./public.js').Readable<any>>} */\n\tconst stores_array = single ? [stores] : stores;\n\tif (!stores_array.every(Boolean)) {\n\t\tthrow new Error('derived() expects stores as input, got a falsy value');\n\t}\n\tconst auto = fn.length < 2;\n\treturn readable(initial_value, (set, update) => {\n\t\tlet started = false;\n\t\tconst values = [];\n\t\tlet pending = 0;\n\t\tlet cleanup = noop;\n\t\tconst sync = () => {\n\t\t\tif (pending) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tcleanup();\n\t\t\tconst result = fn(single ? values[0] : values, set, update);\n\t\t\tif (auto) {\n\t\t\t\tset(result);\n\t\t\t} else {\n\t\t\t\tcleanup = is_function(result) ? result : noop;\n\t\t\t}\n\t\t};\n\t\tconst unsubscribers = stores_array.map((store, i) =>\n\t\t\tsubscribe(\n\t\t\t\tstore,\n\t\t\t\t(value) => {\n\t\t\t\t\tvalues[i] = value;\n\t\t\t\t\tpending &= ~(1 << i);\n\t\t\t\t\tif (started) {\n\t\t\t\t\t\tsync();\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\t() => {\n\t\t\t\t\tpending |= 1 << i;\n\t\t\t\t}\n\t\t\t)\n\t\t);\n\t\tstarted = true;\n\t\tsync();\n\t\treturn function stop() {\n\t\t\trun_all(unsubscribers);\n\t\t\tcleanup();\n\t\t\t// We need to set this to false because callbacks can still happen despite having unsubscribed:\n\t\t\t// Callbacks might already be placed in the queue which doesn't know it should no longer\n\t\t\t// invoke this derived store.\n\t\t\tstarted = false;\n\t\t};\n\t});\n}\n\n/**\n * Takes a store and returns a new one derived from the old one that is readable.\n *\n * https://svelte.dev/docs/svelte-store#readonly\n * @template T\n * @param {import('./public.js').Readable<T>} store - store to make readonly\n * @returns {import('./public.js').Readable<T>}\n */\nexport function readonly(store) {\n\treturn {\n\t\tsubscribe: store.subscribe.bind(store)\n\t};\n}\n\nexport { get_store_value as get };\n","<script>\n import { createEventDispatcher } from 'svelte';\n import { guidV4 } from '@itslearning/atlas/generate/guid';\n\n const dispatch = createEventDispatcher();\n\n /** @type {boolean} */\n export let checked = false;\n /** @type {boolean} */\n export let disabled = false;\n /** @type {string} */\n export let label = undefined;\n /** @type {string} */\n export let id = undefined;\n /** @type {string} */\n export let name = undefined;\n /** @type {boolean} */\n export let labelHidden = false;\n /** @type {boolean} */\n export let small = false;\n /** @type {boolean} */\n export let required = false;\n /** @type {string} */\n export let description = undefined;\n /** @type {string} */\n export let describedBy = undefined;\n /** @type {string} */\n export let elementLegacyColor = '';\n /** @type {string} */\n export let courseColor = '';\n /** @type {string} */\n export let value = '';\n\n let checkbox;\n\n $: disabledClass = disabled ? 'disabled' : '';\n\n $: smallClass = small ? 'prom-checkbox--small' : '';\n\n let labelText;\n\n $: customColor = courseColor ? courseColor : elementLegacyColor;\n\n $: {\n if (!label || typeof label !== 'string') {\n throw new TypeError('Label must be supplied');\n }\n\n labelText = label;\n }\n\n $: labelHiddenClass = labelHidden ? 'screen-reader' : '';\n\n if (description && !describedBy) {\n describedBy = 'prom-checkbox__information_id-' + guidV4();\n }\n\n /** @private */\n function handleChanged() {\n dispatch('change', { checked });\n }\n</script>\n\n<label class=\"prom-checkbox {disabledClass} {smallClass}\">\n <input\n bind:this={checkbox}\n class=\"prom-checkbox__input\"\n type=\"checkbox\"\n bind:checked\n {disabled}\n {name}\n {value}\n {id}\n {required}\n on:change={handleChanged}\n aria-describedby={description ? describedBy : undefined} />\n\n <span class=\"prom-checkbox__custom-check {customColor}\"></span>\n\n <span class=\"prom-checkbox__label-text {labelHiddenClass}\">\n {labelText}\n {#if required}\n <span aria-hidden=\"true\" class=\"prom-input__required-star\">*</span>\n {/if}\n </span>\n</label>\n\n{#if description}\n <span id={describedBy} class=\"prom-checkbox__description\">\n\t\t{description}\n\t</span>\n{/if}\n","/**\n * @param {Date} date\n */\nexport function idForDay(date) {\n return `${date.getFullYear()}-${date.getMonth()}-${date.getDate()}`;\n}\n\n/**\n * @param {Date} a\n * @param {Date} b\n */\nexport function isSameDate(a, b) {\n if (!a || !b) {\n return !!a === !!b;\n }\n\n return a.getFullYear() === b.getFullYear() &&\n a.getMonth() === b.getMonth() &&\n a.getDate() === b.getDate();\n}\n\n/**\n * @param {Date} date\n * @param {string} format\n */\nexport function dateToString(date, format) {\n if (!date) {\n return '';\n }\n\n const year = date.getFullYear().toString();\n const month = (date.getMonth() + 1).toString();\n const day = date.getDate().toString();\n\n return format\n .replace('YYYY', year)\n .replace('YYY', year.slice(1, 3))\n .replace('YY', year.slice(2, 3))\n .replace('MM', (month.length === 1 ? `0${month}` : month))\n .replace('M', month)\n .replace('DD', (day.length === 1 ? `0${day}` : day))\n .replace('D', day);\n}\n\n/**\n * @param {string} dateString\n * @param {string} format\n */\nexport function dateFromString(dateString, format) {\n const indexes = [\n { id: 'day', index: format.indexOf('D') },\n { id: 'month', index: format.indexOf('M') },\n { id: 'year', index: format.indexOf('Y') },\n ].sort((a, b) => a.index - b.index);\n\n const date = {};\n\n try {\n indexes.forEach(element => {\n dateString = dateString.replace(/(?:^|\\D+)(\\d+)(?:\\D+|$)/, (_match, p1) => {\n date[element.id] = parseInt(p1);\n\n return '-';\n });\n });\n } catch (_e) {\n return null;\n }\n\n if (date.year !== undefined && date.month !== undefined && date.day !== undefined) {\n return new Date(date.year, date.month - 1, date.day);\n } else {\n return null;\n }\n}\n","<div\n class=\"prom-date-picker\"\n role=\"dialog\"\n aria-modal=\"true\"\n aria-label={i18n.datepickerTitle}\n on:keydown={onKeyPress}\n>\n <div class=\"prom-date-picker__header\">\n <button type=\"button\" class=\"prom-date-picker__previous-month prom-date-picker__icon\" on:click={(e) => changePage(-1, e)}>\n <span class=\"screen-reader\">{i18n.previousMonth}</span>\n </button>\n <span>\n {i18n['month' + selectorStartDate.getMonth()]}\n {selectorStartDate.getFullYear()}\n </span>\n <button type=\"button\" class=\"prom-date-picker__next-month prom-date-picker__icon\" on:click={(e) => changePage(1, e)}>\n <span class=\"screen-reader\">{i18n.nextMonth}</span>\n </button>\n </div>\n <table bind:this={calendarElement} class=\"prom-date-picker__calendar\">\n <thead class=\"prom-date-picker__calendar-row\">\n <th class=\"prom-date-picker__calendar-header\" >{i18n.week}</th>\n {#each daysOfWeek as day}\n <th class=\"prom-date-picker__calendar-header\" >{i18n['day' + day]}</th>\n {/each}\n </thead>\n {#each weeksToShow as week (week[0].id)}\n <tr class=\"prom-date-picker__calendar-row\">\n <td class=\"prom-date-picker__calendar-cell-week\">\n <span class=\"screen-reader\">\n {i18n.week}\n </span>\n <span class=\"prom-date-picker__week\">\n {week[0].weekNumber}\n </span>\n </td>\n {#each week as day (day.id)}\n <td class=\"prom-date-picker__calendar-cell\">\n <button\n type=\"button\"\n class=\"prom-date-picker__day prom-date-picker__{day.id}\"\n class:prom-date-picker__day--today={day.isToday}\n class:prom-date-picker__day--selected-month={day.isThisMonth}\n class:prom-date-picker__day--selected={isSameDate(day.date, value)}\n class:prom-date-picker__day--highlighted={day.highlighted}\n tabindex={isSameDate(day.date, value) ? 0 : -1}\n aria-label={day.dateString}\n aria-describedby=\"day-{day.id}-description\"\n on:click={(e) => setValue(day.date, e)}\n >\n {day.date.getDate()}\n\n <span id=\"day-{day.id}-description\" class=\"screen-reader\">\n {#if day.highlighted}\n {i18n.highlightedDateDescription}\n {/if}\n </span>\n </button>\n </td>\n {/each}\n </tr>\n {/each}\n </table>\n <div class=\"prom-date-picker__footer\">\n <button class=\"prom-date-picker__today\" type=\"button\" on:click={setValueToday}>\n {i18n.today}\n </button>\n {#if highlightedDates && highlightedDates.length}\n <div class=\"prom-date-picker__highlight-legend\">\n <span>{i18n.highlightedDatesLabel}</span>\n </div>\n {/if}\n </div>\n</div>\n\n<script>\n import { normalizeKey } from '@itslearning/atlas/keyboard/normalize';\n import { Keys } from '@itslearning/atlas/keyboard/keys';\n import { idForDay, isSameDate } from './dateHelpers';\n import { createEventDispatcher } from 'svelte';\n\n const dispatch = createEventDispatcher();\n\n export let value = null;\n export let firstDayOfWeek = 1;\n export let selectorStartDate = new Date();\n export let locale = 'en-US';\n export let i18n = {};\n export let highlightedDates = [];\n\n /**\n * @description Gets week number from a given input date\n * @param {Date} inputDate - The date to get the week number from.\n */\n function getWeek(inputDate) {\n const date = new Date(Date.UTC(inputDate.getFullYear(), inputDate.getMonth(), inputDate.getDate()));\n const dayNumber = date.getUTCDay() || 7;\n date.setUTCDate(date.getUTCDate() + 4 - dayNumber);\n const firstDayOfYear = new Date(Date.UTC(date.getUTCFullYear(), 0, 1));\n return Math.ceil((((+date - +firstDayOfYear) / 86400000) + 1) / 7)\n }\n\n let calendarElement;\n\n $: if (value) {\n selectorStartDate = new Date(value.getFullYear(), value.getMonth(), 1);\n }\n\n let weeksToShow;\n\n $: {\n const firstDateOfMonth = new Date(selectorStartDate.getFullYear(), selectorStartDate.getMonth(), 1);\n\n let diff = firstDayOfWeek - firstDateOfMonth.getDay();\n\n if (diff > 0) {\n diff -= 7;\n }\n\n const firstDateToDisplay = new Date(firstDateOfMonth);\n\n firstDateToDisplay.setDate(firstDateOfMonth.getDate() + diff);\n\n const day = new Date(firstDateToDisplay);\n const weeks = [];\n const today = new Date();\n\n for (let i = 0; i < 6; i++) {\n const week = [];\n\n for (let i = 0; i < 7; i++) {\n const date = new Date(day);\n week.push({\n id: idForDay(date),\n date,\n isToday: isSameDate(date, today),\n isThisMonth: date.getMonth() === firstDateOfMonth.getMonth(),\n dateString: date.toLocaleDateString(locale, { dateStyle: 'full' }),\n weekNumber: getWeek(date),\n weekString: i18n.week + getWeek(date),\n highlighted: highlightedDates.some(i => isSameDate(i, date)),\n });\n\n day.setDate(day.getDate() + 1);\n }\n\n if (week.some(day => day.isThisMonth)) {\n weeks.push(week);\n }\n }\n\n weeksToShow = weeks;\n }\n\n const days = [0, 1, 2, 3, 4, 5, 6];\n\n $: daysOfWeek = firstDayOfWeek === 0 ? days : [...days.slice(firstDayOfWeek), ...days.slice(0, firstDayOfWeek)];\n\n function changePage(months, event) {\n const newSelectorStartDate = new Date(selectorStartDate);\n\n newSelectorStartDate.setDate(1);\n newSelectorStartDate.setMonth(selectorStartDate.getMonth() + months);\n\n selectorStartDate = newSelectorStartDate;\n\n // If keyboard click\n if (event.screenX === 0 && event.screenY === 0) {\n setValue(selectorStartDate, event);\n }\n }\n\n function setValue(date, event) {\n value = date;\n\n const selector = `.prom-date-picker__${idForDay(date)}`;\n\n setTimeout(() => {\n calendarElement.querySelector(selector).focus();\n dispatch('select', event);\n }, 0);\n }\n\n function setValueToday(event) {\n setValue(new Date(), event);\n }\n\n function onKeyPress(event) {\n const { key } = event;\n\n const newValue = value ? new Date(value) : new Date();\n\n switch (normalizeKey(key)) {\n case Keys.DOWN:\n newValue.setDate(newValue.getDate() + 7);\n break;\n case Keys.UP:\n newValue.setDate(newValue.getDate() - 7);\n break;\n case Keys.RIGHT:\n newValue.setDate(newValue.getDate() + 1);\n break;\n case Keys.LEFT:\n newValue.setDate(newValue.getDate() - 1);\n break;\n case Keys.PAGEUP:\n newValue.setDate(1);\n newValue.setMonth(newValue.getMonth() - 1);\n break;\n case Keys.PAGEDOWN:\n newValue.setDate(1);\n newValue.setMonth(newValue.getMonth() + 1);\n break;\n case Keys.ESCAPE:\n break;\n case Keys.SPACE:\n case Keys.ENTER:\n if (!calendarElement.contains(event.target)) {\n return;\n }\n\n break;\n default:\n return;\n }\n\n event.preventDefault();\n setValue(newValue, event);\n }\n</script>\n","<script>\n import { normalizeKey } from '@itslearning/atlas/keyboard/normalize';\n import { Keys } from '@itslearning/atlas/keyboard/keys';\n import TabTrapHelper from '../../../../lib/helpers/TabTrapHelper';\n import {\n idForDay,\n isSameDate,\n dateFromString,\n dateToString,\n } from '../../DatePicker/v1/dateHelpers';\n import TextField from '../../TextField/v1/TextField.svelte';\n import DatePicker from '../../DatePicker/v1/DatePicker.svelte';\n import { createEventDispatcher, onMount } from 'svelte';\n\n export let autocomplete = 'off';\n export let closeOnSelect = true;\n export let disabled = false;\n export let expanded = false;\n export let firstDayOfWeek = 1;\n export let format = 'MM.DD.YYYY';\n export let highlightedDates = [];\n export let i18n = {};\n export let id = 'date-picker';\n export let inputValue = '';\n export let label = undefined;\n export let labelHidden = false;\n /** @type {'left' | 'top'} */\n export let labelPosition = 'top';\n export let locale = 'en-US';\n export let placeholder = '';\n export let hasError = false;\n export let errorMessage = undefined;\n export let value = null;\n\n let position = { x: 0, y: 0 };\n let wrapperElement;\n let inputElement;\n let tabTrapElement;\n let selectorStartDate;\n let tabTrapper;\n\n const dispatch = createEventDispatcher();\n\n onMount(() => {\n tabTrapper = new TabTrapHelper(tabTrapElement);\n });\n\n $: valueChanged(value);\n\n function valueChanged(value) {\n const newInputValue = dateToString(value, format);\n\n if (inputValue !== newInputValue) {\n inputValue = newInputValue;\n }\n }\n\n $: inputValueChanged(inputValue);\n\n function inputValueChanged(inputValue) {\n const newValue = dateFromString(inputValue, format);\n\n if (newValue !== null) {\n if (!isSameDate(value, newValue)) {\n selectorStartDate = newValue;\n }\n } else {\n selectorStartDate = new Date();\n }\n\n if (value !== newValue) {\n value = newValue;\n }\n }\n\n $: if (expanded) {\n setTimeout(() => {\n tabTrapper.init();\n }, 0);\n }\n\n $: style = `left: ${position.x}px; top: ${position.y}px;`;\n\n function focusValue() {\n if (!value) {\n value = new Date();\n }\n\n const selector = `.prom-date-picker__${idForDay(value)}`;\n\n setTimeout(() => {\n if (expanded) {\n tabTrapElement.querySelector(selector).focus();\n }\n }, 0);\n }\n\n function onInputBlurred() {\n if (value !== null) {\n const dateString = dateToString(value, format);\n\n if (dateString !== inputValue) {\n inputValue = dateString;\n }\n }\n }\n\n function dateSelected({ detail: event }) {\n if (event.type === 'click' && closeOnSelect) {\n // If this is a mouse click screen X and Y will be set, if not do not close\n if (event.screenX !== 0 && event.screenY !== 0) {\n setExpanded(false);\n }\n } else if (event.type === 'keydown') {\n const key = normalizeKey(event.key);\n\n if (\n key === Keys.SPACE ||\n key === Keys.ENTER ||\n key === Keys.ESCAPE\n ) {\n setExpanded(false);\n }\n }\n\n dispatch('select', event);\n }\n\n function setExpanded(newExpanded) {\n if (newExpanded && disabled) {\n return;\n }\n\n const inputElementInner = inputElement.querySelector(`input`);\n\n if (newExpanded === expanded) {\n return;\n }\n\n if (newExpanded) {\n const wrapperRect = wrapperElement.getBoundingClientRect();\n const inputRect = inputElementInner.getBoundingClientRect();\n\n position = {\n x: inputRect.left - wrapperRect.left,\n y: inputRect.top + inputRect.height - wrapperRect.top,\n };\n\n focusValue();\n expanded = newExpanded;\n } else {\n setTimeout(() => {\n inputElementInner.focus();\n expanded = newExpanded;\n }, 0);\n }\n }\n\n function onInputKeyPress(event) {\n const { key } = event;\n\n switch (normalizeKey(key)) {\n case Keys.ENTER:\n dispatch('select', event);\n\n break;\n }\n }\n</script>\n\n{#if expanded}\n <div\n class=\"prom-date-picker__overlay\"\n on:click={() => setExpanded(false)}>\n </div>\n{/if}\n\n<div bind:this={wrapperElement} class=\"prom-date-picker__wrapper\">\n <div bind:this={inputElement} class=\"prom-date-picker__input\">\n <TextField\n id=\"{id}-input\"\n type=\"text\"\n hint={null}\n {label}\n {autocomplete}\n {disabled}\n {labelHidden}\n {labelPosition}\n {placeholder}\n {hasError}\n {errorMessage}\n bind:value={inputValue}\n on:keyup={onInputKeyPress}\n on:blur={onInputBlurred} \n on:blur\n />\n <button\n {disabled}\n type=\"button\"\n class=\"prom-date-picker__picker-button\"\n class:prom-date-picker__picker-button--top={labelPosition ===\n 'top'}\n on:click={() => setExpanded(true)}>\n <span class=\"screen-reader\"\n >{i18n.openDatePicker}</span>\n </button>\n </div>\n\n <div\n class=\"prom-date-picker__popup\"\n {style}\n bind:this={tabTrapElement}>\n {#if expanded}\n <div\n role=\"dialog\"\n aria-label={i18n.datePickerTitle}\n aria-modal=\"true\">\n <DatePicker\n bind:value\n {firstDayOfWeek}\n {locale}\n {i18n}\n on:select={dateSelected}\n {selectorStartDate}\n {highlightedDates} \n />\n </div>\n {/if}\n </div>\n</div>\n","<script>\n import { onMount, createEventDispatcher } from 'svelte';\n import IconButton from './../../../inputs/IconButton/v1/IconButton.svelte';\n\n const dispatch = createEventDispatcher();\n\n /** @type {'info'|'warning'|'loading'|'success'} */\n export let type = 'info';\n /** @type {boolean} */\n export let visible = false;\n /** @type {string} */\n export let text = null;\n /** @type {string} */\n export let html = null;\n /** @type {string} */\n export let close = null;\n /** @type {boolean} */\n export let closable = true;\n /** @type {'icon'|'secondary'} */\n export let closeButtonType = 'icon';\n /** @type {string} */\n export let infoText = 'information';\n /** @type {string} */\n export let warningText = 'warning';\n /** @type {string} */\n export let loadingText = 'loading';\n /** @type {string} */\n export let successText = 'success';\n\n /** internal */\n let showMessage = false;\n\n $: closeText =\n close ||\n !closable ||\n console.warn('Banner close text is required but not included!');\n\n let ariaLive = '';\n\n $: {\n ariaLive = { info: 'polite', warning: 'assertive' }[type] || 'polite';\n }\n\n let role = '';\n\n $: {\n role = { info: 'status', warning: 'alert' }[type] || 'status';\n }\n\n $: roleText = { info: infoText, warning: warningText, loading: loadingText, success: successText }[type];\n\n $: onMount(() => {\n if (visible) {\n // Render the live-area container first, then show the message inside on the next frame\n setTimeout(() => {\n showMessage = visible;\n }, 200);\n }\n });\n\n $: {\n // If the banner has been made visible show the message on the next frame\n if (visible) {\n setTimeout(() => {\n showMessage = true;\n }, 100);\n } else {\n showMessage = false;\n }\n }\n\n function hide(event) {\n visible = false;\n dispatch('hidden', { event });\n }\n</script>\n\n{#if visible}\n <div class=\"prom-banner prom-banner--{type}\">\n <div class=\"prom-banner__icon\" aria-hidden=\"true\"></div>\n <span\n class=\"prom-banner__message\"\n aria-live=\"{ariaLive}\"\n role=\"{role}\"\n aria-atomic=\"true\">\n {#if showMessage}\n <span class=\"screen-reader\">{roleText}</span>\n {#if text} {text} {/if}\n {#if html} {@html html} {/if}\n <slot />\n {/if}\n </span>\n {#if closable}\n <IconButton type=\"plain\" htmlType=\"button\" iconOnly={true} iconClass=\"close-button\" on:click=\"{hide}\"></IconButton> \n {/if}\n </div>\n{/if}\n","<div\r\n class=\"datetime-picker-modal__error\"\r\n class:datetime-picker-modal__error--hidden={!setValidDatesErrorMessage}\r\n aria-live=\"assertive\"\r\n role=\"alert\"\r\n>\r\n {i18n.youMustSetValidDates}\r\n</div>\r\n<div\r\n class=\"datetime-picker-modal__error\"\r\n class:datetime-picker-modal__error--hidden={!(\r\n showStartStopErrorMessage ||\r\n showStartInvalidMessage ||\r\n showStopInvalidMessage\r\n )}\r\n aria-live=\"assertive\"\r\n role=\"alert\"\r\n>\r\n {showStartStopErrorMessage\r\n ? i18n.errorStopDateLessThanStartDate\r\n : showStartInvalidMessage\r\n ? i18n.calendar_Recurring_invalid_from_date\r\n : i18n.calendar_Recurring_invalid_to_date}\r\n</div>\r\n\r\n<script>\r\n export let showStartStopErrorMessage;\r\n export let setValidDatesErrorMessage;\r\n export let showStartInvalidMessage;\r\n export let showStopInvalidMessage;\r\n export let i18n;\r\n</script>\r\n","<script>\n import { createEventDispatcher } from 'svelte';\n import { guidV4 } from '@itslearning/atlas/generate/guid';\n\n const dispatch = createEventDispatcher();\n /** @type {string} */\n export let label;\n /** @type {string} */\n export let id = 'rnd' + Math.random().toString(36);\n /** @type {string} */\n export let value = undefined;\n /** @type {string} */\n export let name = undefined;\n /** @type {boolean} */\n export let hasError = false;\n /** @type {string} */\n export let errorMessage = undefined;\n /** @type {boolean} */\n export let required = false;\n /** @type {boolean} */\n export let disabled = false;\n /** @type {string} */\n export let description = undefined;\n /** @type {string} */\n export let describedBy = undefined;\n /** @type {'left' | 'top'} */\n export let labelPosition = 'top';\n /** @type {boolean} */\n export let labelHidden = false;\n\n describedBy =\n description && !describedBy\n ? 'prom-checkbox__information_id-' + guidV4()\n : describedBy;\n\n $: labelText = label || console.warn('Select label text was not supplied!');\n $: hasErrorClass = hasError ? 'prom-select--has-error' : '';\n</script>\n\n<div class=\"prom-select\">\n <div class=\"prom-select__wrapper {hasErrorClass}\" class:prom-select__wrapper--label-left={labelPosition === 'left'}>\n <label for=\"{id}\" class:screen-reader={labelHidden} class=\"prom-select__label-text\">\n {labelText}\n\n {#if required}\n <span aria-hidden=\"true\" class=\"prom-select__required-star\">*</span>\n {/if}\n </label>\n <div class=\"prom-select__select-container\">\n <select\n id=\"{id}\"\n bind:value=\"{value}\"\n name=\"{name}\"\n required=\"{required}\"\n disabled=\"{disabled}\"\n class=\"prom-select__select\"\n on:change=\"{() => dispatch('change', value)}\"\n aria-describedby=\"{describedBy}\">\n <slot />\n </select>\n <div class=\"prom-select__focus-wrapper\"></div>\n </div>\n </div>\n\n {#if hasError && errorMessage}\n <div id=\"{describedBy}\" class=\"prom-error-message\">{errorMessage}</div>\n {:else if description}\n <div id=\"{describedBy}\" class=\"prom-select__description\"\n >{description}</div>\n {/if}\n</div>\n","{#if hasGroupData}\r\n <Select\r\n label={i18n.participants}\r\n labelPosition=\"left\"\r\n id=\"ParticipantsConnectToCalendarId\"\r\n bind:value={participants}\r\n on:change={changeValue}\r\n >\r\n {#if hasAllParticipantsData}\r\n <option value=\"0\">\r\n {i18n.allParticipants}\r\n </option>\r\n {/if}\r\n\r\n {#if hasGroupData}\r\n {#each [...courseGroups] as [key, value]}\r\n <option value={key}>\r\n {value.groupName}\r\n </option>\r\n {/each}\r\n {/if}\r\n </Select>\r\n{/if}\r\n\r\n<script>\r\n import Select from \"@itslearning/prometheus/assets/inputs/Select/v1/Select.svelte\";\r\n import { createEventDispatcher } from \"svelte\";\r\n\r\n export let i18n;\r\n export let participants;\r\n export let availableEvents;\r\n\r\n let courseGroups = new Map();\r\n let numberOfCourseGroups = 0;\r\n let numberOfAllParticipantsEvents = 0;\r\n\r\n const dispatch = createEventDispatcher();\r\n\r\n $: if (availableEvents) {\r\n const updatedCourseGroups = new Map();\r\n\r\n let firstAllParticpantsEventId = 0;\r\n let firstGroupEventId = 0;\r\n\r\n numberOfCourseGroups = 0;\r\n numberOfAllParticipantsEvents = 0;\r\n\r\n availableEvents.forEach(event => {\r\n if (!event.eventOccupied) {\r\n if (event.groupId > 0) {\r\n if (!updatedCourseGroups.get(event.groupId)) {\r\n updatedCourseGroups.set(event.groupId, {\r\n eventId: event.eventId,\r\n groupName: event.participants\r\n });\r\n\r\n numberOfCourseGroups = numberOfCourseGroups + 1;\r\n\r\n if (firstGroupEventId === 0) {\r\n firstGroupEventId = event.eventId;\r\n }\r\n }\r\n } else {\r\n numberOfAllParticipantsEvents = numberOfAllParticipantsEvents + 1;\r\n\r\n if (firstAllParticpantsEventId === 0) {\r\n firstAllParticpantsEventId = event.eventId;\r\n }\r\n }\r\n }\r\n });\r\n courseGroups = updatedCourseGroups;\r\n\r\n // Default setting after events reload\r\n if (firstAllParticpantsEventId !== 0) {\r\n dispatch(\"firstEventIdBySelection\", {\r\n firstEventId: firstAllParticpantsEventId\r\n });\r\n } else if (firstGroupEventId !== 0) {\r\n dispatch(\"firstEventIdBySelection\", {\r\n firstEventId: firstGroupEventId\r\n });\r\n } else {\r\n dispatch(\"firstEventIdBySelection\", {\r\n firstEventId: null\r\n });\r\n }\r\n }\r\n\r\n $: hasGroupData = numberOfCourseGroups > 0;\r\n\r\n $: hasAllParticipantsData = numberOfAllParticipantsEvents > 0;\r\n\r\n const changeValue = async event => {\r\n const groupId = event.detail;\r\n\r\n if (groupId) {\r\n const groupObject = courseGroups.get(groupId);\r\n\r\n if (groupObject.eventId) {\r\n dispatch(\"firstEventIdBySelection\", {\r\n firstEventId: groupObject.eventId\r\n });\r\n }\r\n }\r\n };\r\n</script>\r\n","// @ts-check\r\n\r\n/**\r\n * @module network/NetworkError\r\n */\r\n\r\n/** Class representing a network error */\r\nexport default class NetworkError extends Error {\r\n /**\r\n * Create a NetworkError\r\n * @param {string} message - Error description (inherited from Error)\r\n * @param {Object} response - HTTP response object\r\n */\r\n constructor(\r\n message,\r\n response\r\n ) {\r\n super(message);\r\n\r\n this.response = response;\r\n }\r\n};\r\n","/**\r\n * HTTP Status Codes.\r\n * @module network/responseStatuses\r\n */\r\nexport const ResponseStatuses = Object.freeze({\r\n // Success\r\n ok: 200,\r\n created: 201,\r\n accepted: 202,\r\n nonAuthoritativeInformation: 203,\r\n noContent: 204,\r\n resetContent: 205,\r\n partialContent: 206,\r\n // Redirection\r\n multipleChoices: 300,\r\n movedPermanently: 301,\r\n found: 302,\r\n seeOther: 303,\r\n notModified: 304,\r\n useProxy: 305,\r\n temporaryRedirect: 307,\r\n // Client error\r\n badRequest: 400,\r\n unauthorized: 401,\r\n paymentRequired: 402,\r\n forbidden: 403,\r\n notFound: 404,\r\n methodNotAllowed: 405,\r\n notAcceptable: 406,\r\n proxyAuthenticationRequired: 407,\r\n requestTimeout: 408,\r\n conflict: 409,\r\n gone: 410,\r\n // Server error\r\n internalServerError: 500,\r\n notImplemented: 501,\r\n badGateway: 502,\r\n serviceUnavailable: 503,\r\n gatewayTimeout: 504,\r\n httpVersionNotSupported: 505,\r\n});\r\n","// @ts-check\r\n\r\n/**\r\n * @module network/fetch\r\n */\r\n\r\nimport NetworkError from './NetworkError';\r\nimport { ResponseStatuses } from './responseStatuses';\r\n\r\n/**\r\n * Fires a networked POST request with data serialized to json to an api\r\n * endpoint with the required options for api calls in itslearning\r\n * @param {string} url - the url of the endpoint to post the data to\r\n * @param {object} data - data object to post with the request (will be JSON stringified)\r\n * @param {object} [options] - Optional options for overriding the fetch defaults\r\n * @param {string} [options.cache='default'] - cache mode of the request: default, reload, no-cache\r\n * @param {string} [options.mode=cors] - mode of the request: cors, no-cors, same-origin, navigate\r\n * @param {string} [options.credentials=same-origin] - credentials of the request: omit, same-origin, include\r\n * @param {object} [options.headers] - additional headers for the request\r\n * @returns {Promise} the json response returned by the api or the text if the response is not json\r\n */\r\nexport function post(url, data, options = {}) {\r\n return new Promise((resolve, reject) => {\r\n fetch(url, fetchOptions('POST', JSON.stringify(data), options))\r\n .then(tryParseResponse)\r\n .then(resolve)\r\n .catch(reject);\r\n });\r\n}\r\n\r\n/**\r\n * Fires a networked PUT request with data serialized to json to an api\r\n * endpoint with the required options for api calls in itslearning\r\n * @param {string} url - the url of the endpoint to post the data to\r\n * @param {object} data - data object to post with the request (will be JSON stringified)\r\n * @param {object} [options] - Optional options for overriding the fetch defaults\r\n * @param {string} [options.cache='default'] - cache mode of the request: default, reload, no-cache\r\n * @param {string} [options.mode=cors] - mode of the request: cors, no-cors, same-origin, navigate\r\n * @param {string} [options.credentials=same-origin] - credentials of the request: omit, same-origin, include\r\n * @param {object} [options.headers] - additional headers for the request\r\n * @returns {Promise} the json response returned by the api or the text if the response is not json\r\n */\r\nexport function put(url, data, options = {}) {\r\n return new Promise((resolve, reject) => {\r\n fetch(url, fetchOptions('PUT', JSON.stringify(data), options))\r\n .then(tryParseResponse)\r\n .then(resolve)\r\n .catch(reject);\r\n });\r\n}\r\n\r\n/**\r\n * Fires a networked PATCH request with data serialized to json to an api endpoint\r\n * @param {string} url - the url of the endpoint to post the data to\r\n * @param {object} data - data object to post with the request (will be JSON stringified)\r\n * @param {object} [options] - Optional options for overriding the fetch defaults\r\n * @param {string} [options.cache='default'] - cache mode of the request: default, reload, no-cache\r\n * @param {string} [options.mode=cors] - mode of the request: cors, no-cors, same-origin, navigate\r\n * @param {string} [options.credentials=same-origin] - credentials of the request: omit, same-origin, include\r\n * @param {object} [options.headers] - additional headers for the request\r\n * @returns {Promise} the json response returned by the api or the text if the response is not json\r\n */\r\nexport function patch(url, data, options = {}) {\r\n return new Promise((resolve, reject) => {\r\n fetch(url, fetchOptions('PATCH', JSON.stringify(data), options))\r\n .then(tryParseResponse)\r\n .then(resolve)\r\n .catch(reject);\r\n });\r\n}\r\n\r\n/**\r\n * Fires a networked DELETE request with data serialized to json to an api endpoint - delete is a reserved\r\n * word in javascript so this method is called del\r\n * @param {string} url - the url of the endpoint to post the data to\r\n * @param {object} data - data object to post with the request (will be JSON stringified)\r\n * @param {object} [options] - Optional options for overriding the fetch defaults\r\n * @param {string} [options.cache='default'] - cache mode of the request: default, reload, no-cache\r\n * @param {string} [options.mode=cors] - mode of the request: cors, no-cors, same-origin, navigate\r\n * @param {string} [options.credentials=same-origin] - credentials of the request: omit, same-origin, include\r\n * @param {object} [options.headers] - additional headers for the request\r\n * @returns {Promise} the json response returned by the api or the text if the response is not json\r\n */\r\nexport function del(url, data, options = {}) {\r\n return new Promise((resolve, reject) => {\r\n fetch(url, fetchOptions('DELETE', JSON.stringify(data), options))\r\n .then(tryParseResponse)\r\n .then(resolve)\r\n .catch(reject);\r\n });\r\n}\r\n\r\n/**\r\n * Fires a networked GET request to an endpoint\r\n * @param {string} url - the url of the endpoint to GET\r\n * @param {object} [options] - Optional options for overriding the fetch defaults\r\n * @param {string} [options.cache='default'] - cache mode of the request: default, reload, no-cache\r\n * @param {string} [options.mode=cors] - mode of the request: cors, no-cors, same-origin, navigate\r\n * @param {string} [options.credentials=same-origin] - credentials of the request: omit, same-origin, include\r\n * @param {object} [options.headers] - additional headers for the request\r\n * @returns {Promise} the json response returned by the api or the text if the response is not json\r\n */\r\nexport function get(url, options = {}) {\r\n return new Promise((resolve, reject) => {\r\n fetch(url, fetchOptions('GET', undefined, options))\r\n .then(tryParseResponse)\r\n .then(resolve)\r\n .catch(reject);\r\n });\r\n}\r\n\r\n/**\r\n * @param {Response} response The fetch response which may or may not be json\r\n * @returns {any} The parsed JSON response, undefined if there is no content or the text content of the response\r\n * @throws {Error} When response is not OK. And error object would have its response property initialized with rejected resonse object.\r\n */\r\nexport function tryParseResponse(response) {\r\n if (!response.ok) {\r\n throw new NetworkError(response.statusText, response);\r\n }\r\n\r\n // In case of 204 - NO CONTENT return undefined\r\n if (response.status === ResponseStatuses.noContent) {\r\n return new Promise((resolve) => resolve(undefined));\r\n }\r\n\r\n // response body can only be read once so clone before trying .json()\r\n // so that we can fall back to .text() if needed\r\n return response.clone().json().catch(() => response.text());\r\n}\r\n\r\n/**\r\n * Fires a networked GET request to an endpoint with the required options for\r\n * api calls in itslearning\r\n * @param {string} method - The method this fetch request will use (GET, PATCH, POST, DELETE, PUT)\r\n * @param {string} [body] - What to send as the fetch request's body\r\n * @param {object} [options] - Optional options for overriding the fetch defaults\r\n * @param {string} [options.cache='default'] - cache mode of the request: default, reload, no-cache\r\n * @param {string} [options.mode=cors] - mode of the request: cors, no-cors, same-origin, navigate\r\n * @param {string} [options.credentials=same-origin] - credentials of the request: omit, same-origin, include\r\n * @param {object} [options.headers] - additional headers for the request\r\n * @returns {object} A RequestInit object for fetch request options\r\n */\r\nexport function fetchOptions(method, body, options) {\r\n return {\r\n method,\r\n mode: options.mode !== undefined ? options.mode : 'cors',\r\n cache: options.cache !== undefined ? options.cache : 'default',\r\n credentials: options.credentials !== undefined ? options.credentials : 'same-origin',\r\n headers: Object.assign({\r\n 'Content-Type': 'application/json; charset=utf-8',\r\n }, options.headers),\r\n body,\r\n };\r\n}\r\n","/**\r\n * Api handlers for the App.\r\n * These will expose functions using the endpoints to call itslearning api's\r\n */\r\nimport { del, get, post, put } from \"@itslearning/atlas/network/fetch\";\r\nimport config from \"./config\";\r\nimport {\r\n endpoints,\r\n pageSizeInCalendar,\r\n planSorting,\r\n plansForTopicPageSize,\r\n defaultPageSize,\r\n defaultPageSizePaginationTableView\r\n} from \"./constants.js\";\r\n\r\nconst headers = () => ({\r\n headers: {\r\n [config.antiForgeryHeaderName]: config.antiForgeryHeaderValue\r\n }\r\n});\r\n\r\nconst pageSize = defaultPageSize;\r\nconst pageSizeTableView = defaultPageSizePaginationTableView;\r\n\r\nconst getQueryStringPaging = (pageIndex, pageSize, childId) =>\r\n `&PageIndex=${pageIndex}&PageSize=${pageSize}&ChildId=${childId}`;\r\n\r\n/**\r\n * Gets a dictionary containing all the counts for plans in a course (All plans, current plans, past plans, plans without date)\r\n *\r\n * @export\r\n * @return {Dictionary} All plan counts\r\n */\r\nexport const getAllPlanCounts = () =>\r\n get(`/restapi/personal/course/${config.courseId}/plans/counts/v1`);\r\n\r\n/**\r\n * For public link, gets a dictionary containing all the counts for plans in a course (All plans, current plans, past plans, plans without date)\r\n *\r\n * @export\r\n * @return {Dictionary} All plan counts\r\n */\r\nexport const getAllPlanCountsPublic = () =>\r\n get(`/restapi/planner/anonymous2/${config.publicAccessKey}/counts/v1`);\r\n\r\n/**\r\n * Gets plans for this week\r\n */\r\nexport const getPlansThisWeek = () =>\r\n get(`/restapi/personal/course/${config.courseId}/plans/week/v1`);\r\n\r\n/**\r\n * Gets last opened plan\r\n */\r\nexport const getLastOpenedPlan = () =>\r\n get(`/restapi/personal/course/${config.courseId}/plans/lastOpened/v1`);\r\n\r\nexport const getSelfPacedPlansToWorkOn = () =>\r\n get(`/restapi/personal/course/${config.courseId}/plans/selfpaced/toworkon/v1`);\r\n\r\n/**\r\n * Gets all plans\r\n *\r\n * @export\r\n * @param {number} [pageIndex=0] - Current page index\r\n * @return {JSON entity list} - All plans\r\n */\r\nexport const getAllPlans = (pageIndex = 0) =>\r\n get(\r\n `/restapi/personal/course/${config.courseId}/plans/all/v1?${getQueryStringPaging(\r\n pageIndex,\r\n pageSize,\r\n config.childId\r\n )}`\r\n );\r\n\r\n/**\r\n * Gets all plans for public link\r\n *\r\n * @export\r\n * @param {number} [pageIndex=0] - Current page index\r\n * @return {JSON entity list} - All public plans\r\n */\r\n\r\nexport const getAllPlansPublic = (pageIndex = 0) =>\r\n get(\r\n `/restapi/planner/anonymous2/${config.publicAccessKey}/all/v1?&PageIndex=${pageIndex}&PageSize=${pageSize}`\r\n );\r\n\r\n/**\r\n * Gets plans by their IDs.\r\n */\r\nexport const getPlansForCalendar = (courseId, childId, planIds, viewForPersonId, pageIndex = 0) =>\r\n get(\r\n `/restapi/personal/course/${courseId}/plans/selected/v1?ChildId=${childId}&planIds=${planIds.join()}&viewForPersonId=${viewForPersonId}&PageIndex=${pageIndex}&PageSize=${pageSizeInCalendar}`\r\n );\r\n\r\n/**\r\n * Gets plans for printing by their IDs.\r\n */\r\nexport const getPlansForPrinting = (planIds, selectedView) =>\r\n get(\r\n `/restapi/personal/course/${\r\n config.courseId\r\n }/plans/print/v1?planIds=${planIds.join()}&selectedView=${selectedView}`\r\n );\r\n\r\n/**\r\n * Gets plans for printing by their IDs.\r\n */\r\nexport const getPlansForPrintingTable = planIds =>\r\n get(\r\n `/restapi/personal/course/${config.courseId}/plans/print/table/v1?planIds=${planIds.join()}`\r\n );\r\n\r\n/**\r\n * Gets topics and their plans. Only single topic ID can be passed if topicIds is not null.\r\n */\r\nexport function getTopicsWithPlansForPrinting(topicIds, planIds) {\r\n const planIdsParameter = planIds && planIds.length ? `&planIds=${planIds.join()}` : \"\";\r\n\r\n return get(\r\n `/restapi/personal/course/${config.courseId}/plans/print/topics/v1?topicIds=${topicIds}${planIdsParameter}`\r\n );\r\n}\r\n\r\n/**\r\n * Gets plans that are ongoing or haven't started yet\r\n */\r\nexport const getCurrentPlans = (pageIndex = 0) =>\r\n get(\r\n `/restapi/personal/course/${config.courseId}/plans/current/v1?${getQueryStringPaging(\r\n pageIndex,\r\n pageSize,\r\n config.childId\r\n )}`\r\n );\r\n\r\n/**\r\n * Gets plans that are ongoing or haven't started yet\r\n */\r\nexport const getCurrentPlansPublic = (pageIndex = 0) =>\r\n get(\r\n `/restapi/planner/anonymous2/${config.publicAccessKey}/current/v1?&PageIndex=${pageIndex}&PageSize=${pageSize}`\r\n );\r\n\r\n/**\r\n * Gets plans that have no dates\r\n */\r\nexport const getWithoutDatePlans = (pageIndex = 0) =>\r\n get(\r\n `/restapi/personal/course/${config.courseId}/plans/without-date/v1?${getQueryStringPaging(\r\n pageIndex,\r\n pageSize,\r\n config.childId\r\n )}`\r\n );\r\n\r\n/**\r\n * Gets plans that have no dates\r\n */\r\nexport const getWithoutDatePlansPublic = (pageIndex = 0) =>\r\n get(\r\n `/restapi/planner/anonymous2/${config.publicAccessKey}/without-date/v1?&PageIndex=${pageIndex}&PageSize=${pageSize}`\r\n );\r\n\r\n/**\r\n * Gets plans that have already finished\r\n */\r\nexport const getPastPlans = (pageIndex = 0) =>\r\n get(\r\n `/restapi/personal/course/${config.courseId}/plans/past/v1?${getQueryStringPaging(\r\n pageIndex,\r\n pageSize,\r\n config.childId\r\n )}`\r\n );\r\n\r\n/**\r\n * Gets plans that have already finished\r\n */\r\nexport const getPastPlansPublic = (pageIndex = 0) =>\r\n get(\r\n `/restapi/planner/anonymous2/${config.publicAccessKey}/past/v1?&PageIndex=${pageIndex}&PageSize=${pageSize}`\r\n );\r\n\r\n/**\r\n * Gets all Topics for plans\r\n */\r\nexport const getTopics = () =>\r\n get(`/restapi/personal/course/${config.courseId}/plans/topics/v1?ChildId=${config.childId}`);\r\n\r\n/**\r\n * Gets all Topics for plans\r\n */\r\nexport const getTopicsPublic = () =>\r\n get(`/restapi/planner/anonymous2/${config.publicAccessKey}/topics/v1`);\r\n\r\n/**\r\n * Gets a single plan by its id\r\n */\r\nexport const getPlan = (planId = config.planId) =>\r\n get(`/restapi/personal/course/${config.courseId}/plans/${planId}/v2?ChildId=${config.childId}`);\r\n\r\n/**\r\n * Gets a single plan by its id\r\n */\r\nexport const getPlanPublic = (planId = config.planId) =>\r\n get(`/restapi/planner/anonymous2/${config.publicAccessKey}/${planId}/v2`);\r\n\r\n/**\r\n * Gets a single topic by its id\r\n */\r\nexport const getTopic = (topicId = config.topic) =>\r\n get(\r\n `/restapi/personal/course/${config.courseId}/plans/topics/${topicId}/v1?ChildId=${config.childId}`\r\n );\r\n\r\n/**\r\n * Gets a single topic by its id\r\n */\r\nexport const getTopicPublic = (topicId = config.topic) =>\r\n get(`/restapi/planner/anonymous2/${config.publicAccessKey}/topics/${topicId}/v1`);\r\n\r\n/**\r\n * Gets a random colour for topic\r\n * Re-using endpoint for old planner\r\n * First parameter in post is endpoint, second data (undefined), third is options\r\n * There is a tech-debt for anti-forgery check (TRK-6737, or this could be a GET instead).\r\n */\r\nexport const getTopicRandomColour = () =>\r\n post(\r\n `/restapi/planner/topic/getRandomColorSchemeForNewTopic/${config.courseId}`,\r\n undefined,\r\n headers()\r\n );\r\n\r\nexport const createTopic = (title, colour) =>\r\n post(\r\n `/restapi/planner/topic/addTopic`,\r\n { CourseId: config.courseId, topicName: title, topicColorSchema: colour },\r\n headers()\r\n );\r\n\r\nexport const updateTopicColor = (topicId, colorId) =>\r\n post(\r\n `/restapi/planner/topic/setTopicColorSchema`,\r\n { CourseId: config.courseId, topicId, topicColorSchema: colorId },\r\n headers()\r\n );\r\n\r\nexport const updateTopicTitle = (topicId, title) =>\r\n post(\r\n `/restapi/planner/column/updatetopictitle/v2`,\r\n { courseId: config.courseId, topicId, data: title },\r\n headers()\r\n );\r\n\r\nexport const getPlansInTopic = (topicId, pageIndex = 0, planOrder = planSorting.NotSetValue) =>\r\n get(\r\n `/restapi/personal/course/${\r\n config.courseId\r\n }/plans/topics/${topicId}/plans/v1?${getQueryStringPaging(\r\n pageIndex,\r\n pageSize,\r\n config.childId\r\n )}&PlanOrder=${planOrder}`\r\n );\r\n\r\nexport const getPlansInTopicPublic = (\r\n topicId,\r\n pageIndex = 0,\r\n planOrder = planSorting.NotSetValue\r\n) =>\r\n get(\r\n `/restapi/planner/anonymous2/${config.publicAccessKey}/topics/${topicId}/plans/v1?PageIndex=${pageIndex}&PageSize=${pageSize}&PlanOrder=${planOrder}`\r\n );\r\n\r\nexport const setPlanTitle = (planId, title) =>\r\n post(\r\n \"/restapi/planner/column/updateplantitle/v2\",\r\n { courseId: config.courseId, planId: planId, data: title },\r\n headers()\r\n );\r\n\r\nexport const setPlanClassHours = (planId, classHours) =>\r\n post(\r\n \"/restapi/planner/column/updateplanclasshours/v2\",\r\n { courseId: config.courseId, planId: planId, data: classHours },\r\n headers()\r\n );\r\n\r\nexport const setPlanDescription = (planId, description) =>\r\n post(\r\n \"/restapi/planner/column/updateplandescription\",\r\n {\r\n courseId: config.courseId,\r\n planId: planId,\r\n data: description,\r\n skipPlainTextDataTrimming: true\r\n },\r\n headers()\r\n );\r\n\r\nexport const setPlanTimeSpan = (planId, startTime, stopTime) =>\r\n put(\r\n \"/restapi/planner/plandate/timespan/v2\",\r\n {\r\n courseId: config.courseId,\r\n planId,\r\n showPlanDates: true,\r\n start: startTime,\r\n stop: stopTime\r\n },\r\n headers()\r\n );\r\n\r\nexport const setPlanWeekAndDay = (planId, startTime, stopTime) =>\r\n post(\r\n \"/restapi/planner/plandate/weekandday\",\r\n {\r\n CourseId: config.courseId,\r\n PlanId: planId,\r\n showPlanDates: true,\r\n start: startTime,\r\n stop: stopTime\r\n },\r\n headers()\r\n );\r\n\r\n/**\r\n * Update the course events.\r\n * If array of activity ids is empty, all existing connections will be removed.\r\n */\r\nexport const updatePlanEvents = (planId, activityIds) =>\r\n post(\r\n `/restapi/planner/planDate/events`,\r\n {\r\n courseId: config.courseId,\r\n planId: planId,\r\n activityIds: activityIds,\r\n filterStartDate: null,\r\n filterStopDate: null,\r\n showPlanDates: true\r\n },\r\n headers()\r\n );\r\n\r\nexport const createPlan = planParams =>\r\n post(\r\n \"/restapi/planner/plan/add\",\r\n {\r\n TopicId: planParams.topic ? planParams.topic.id : null,\r\n Start: planParams.start,\r\n End: planParams.stop,\r\n CourseId: config.courseId\r\n },\r\n headers()\r\n );\r\n\r\nexport const startPlan = (courseId, planId) =>\r\n put(`/restapi/course/${courseId}/plans/${planId}/progress/start/v1`, undefined, headers());\r\n\r\nexport const completePlan = (courseId, planId) =>\r\n put(`/restapi/course/${courseId}/plans/${planId}/progress/completion/v1`, undefined, headers());\r\n\r\nexport const uncompletePlan = (courseId, planId) =>\r\n del(`/restapi/course/${courseId}/plans/${planId}/progress/completion/v1`, undefined, headers());\r\n\r\nexport const togglePlansStatus = (\r\n planIds,\r\n activate,\r\n toggleElementsActivation,\r\n isBulkAction,\r\n executeForAllPlans = false,\r\n topicIds = []\r\n) => {\r\n const requestModel = {\r\n courseId: config.courseId,\r\n activate,\r\n toggleElementsActivation,\r\n isBulkAction\r\n };\r\n\r\n if (executeForAllPlans) {\r\n requestModel.executeForAllPlans = true;\r\n requestModel.topicIds = topicIds;\r\n } else {\r\n requestModel.planIds = planIds;\r\n }\r\n\r\n return put(\"/restapi/planner/plan/multiple/status/v2\", requestModel, headers());\r\n};\r\n\r\nexport function getLearningObjectives(nodeId, params = {}) {\r\n const loPageSize = 100;\r\n const pageIndex = 0;\r\n\r\n const defaultParams = {\r\n omitItems: false,\r\n omitFolders: false,\r\n includeUnpublished: false,\r\n setRootAsParent: false,\r\n selectableCategory: false,\r\n selectableLearningObjective: true,\r\n SelectableSubject: false,\r\n cutOffLoStructure: true,\r\n encoding: 1\r\n };\r\n\r\n params = { ...defaultParams, ...params };\r\n\r\n const paramString = Object.keys(params)\r\n .map(p => `${p}=${params[p]}`)\r\n .join(\"&\");\r\n\r\n return get(\r\n `/restapi/course/learningobjective/repository/all/v1?CourseID=${config.courseId}&nodeId=${nodeId}&page=${pageIndex}&pageSize=${loPageSize}&${paramString}`\r\n );\r\n}\r\n\r\nexport const setPlanLearningObjectives = (planId, learningObjectiveIds) =>\r\n post(\r\n \"/restapi/planner/learningObjective/plan\",\r\n { courseId: config.courseId, planId, learningObjectiveIds },\r\n headers()\r\n );\r\n\r\nexport const removePlanLearningObjective = (planId, learningObjectiveId) =>\r\n del(\r\n \"/restapi/planner/learningObjective/plan\",\r\n { courseId: config.courseId, planId, learningObjectiveId },\r\n headers()\r\n );\r\n\r\nexport async function setPlanImage(planId, file) {\r\n const formData = new FormData();\r\n\r\n formData.append(\"file\", file, file.name);\r\n\r\n const rawResult = await fetch(\r\n `/restapi/planner/plan/thumbnail/${config.courseId}/${planId}/v1`,\r\n {\r\n body: formData,\r\n method: \"post\",\r\n mode: \"cors\",\r\n cache: \"default\",\r\n credentials: \"same-origin\",\r\n headers: { [config.antiForgeryHeaderName]: config.antiForgeryHeaderValue }\r\n }\r\n );\r\n\r\n return await rawResult.json();\r\n}\r\n\r\nexport const uploadPlanImage = (planId, uploadImageFileRepoId, uploadImageSignedFileRepoId, uploadImageDescriptionText, uploadImageChanged) =>\r\n post(\r\n `/restapi/planner/plan/planImage/v1`,\r\n { planId, courseId: config.courseId, uploadImageFileRepoId, uploadImageSignedFileRepoId, uploadImageDescriptionText, uploadImageChanged },\r\n headers()\r\n );\r\n\r\nexport const removePlanImage = planId =>\r\n del(\r\n config.isImageUploaderInPlansEnabled\r\n ? \"/restapi/planner/plan/planImage/v1\"\r\n : \"/restapi/planner/plan/thumbnail/v1\",\r\n { PlanId: planId, CourseId: config.courseId },\r\n headers()\r\n );\r\n\r\nexport const addElementsToPlan = (elementIds, planId, columnId, partialUpdate) =>\r\n post(\r\n `/restapi/planner/element/updatePlanElements`,\r\n { planId, courseId: config.courseId, columnId, elementIds, partialUpdate },\r\n headers()\r\n );\r\n\r\nexport async function getRecentElements(elementType) {\r\n const endpoint = endpoints.getRecentElements\r\n .replace(\"{courseId}\", config.courseId)\r\n .replace(\"{elementType}\", elementType);\r\n\r\n const result = await get(endpoint);\r\n\r\n return result.EntityArray;\r\n}\r\n\r\nexport const getRecentCloudElements = async (cloudService, recentCloudElementsSettings) =>\r\n get(\r\n endpoints.getRecentCloudElements\r\n .replace(\"{cloudService}\", cloudService)\r\n .replace(\"{filesCount}\", recentCloudElementsSettings.filesCount)\r\n .replace(\"{includeSharedFiles}\", recentCloudElementsSettings.includeSharedFiles)\r\n .replace(\"{includeFolders}\", recentCloudElementsSettings.includeFolders)\r\n );\r\n\r\n/**\r\n * Connect plan to a topic\r\n */\r\nexport const connectToTopic = (planId, topicId) =>\r\n post(\r\n `/restapi/planner/plan/connectToTopic`,\r\n { CourseId: config.courseId, PlanId: planId, TopicId: topicId },\r\n headers()\r\n );\r\n\r\n/**\r\n * Connect plan to a topic with option to move elements to new topic folder\r\n */\r\nexport const connectToTopicV2 = (planId, sourceTopicId, destinationTopicId) =>\r\n post(\r\n `/restapi/planner/plan/connectToTopic/v2`,\r\n { CourseId: config.courseId, PlanId: planId, SourceTopicId: sourceTopicId, DestinationTopicId: destinationTopicId },\r\n headers()\r\n );\r\n\r\n/**\r\n * Move any elements that could be moved to new folder when changing topic in plan\r\n */\r\nexport const moveElementsInTopicFolderForPlan = (planId, sourceTopicId, destinationTopicId) =>\r\n post(\r\n `/restapi/planner/plan/moveElementsInTopicFolderForPlan`,\r\n { CourseId: config.courseId, PlanId: planId, SourceTopicId: sourceTopicId, DestinationTopicId: destinationTopicId },\r\n headers()\r\n );\r\n\r\n/**\r\n * Remove topic from a plan\r\n */\r\nexport const removeTopic = planId =>\r\n post(\r\n `/restapi/planner/plan/removeTopic`,\r\n { CourseId: config.courseId, PlanId: planId },\r\n headers()\r\n );\r\n\r\nexport const deletePlanElement = (planId, elementId) =>\r\n post(\r\n `/restapi/planner/element/deletePlanElement`,\r\n {\r\n CourseId: config.courseId,\r\n PlanId: planId,\r\n ElementId: elementId,\r\n DeleteFromCourse: false\r\n },\r\n headers()\r\n );\r\n\r\nexport function deletePlanElementFromCourse(planId, elementId) {\r\n return post(\r\n `/restapi/planner/element/deletePlanElement`,\r\n {\r\n CourseId: config.courseId,\r\n PlanId: planId,\r\n ElementId: elementId,\r\n DeleteFromCourse: true\r\n },\r\n { headers: { [config.antiForgeryHeaderName]: config.antiForgeryHeaderValue } }\r\n );\r\n}\r\n\r\nexport function getCourseResources(elementType, learningToolType, pageIndex, pageSize) {\r\n const queryParams = [\r\n `PageIndex=${pageIndex}`,\r\n `PageSize=${pageSize}`,\r\n elementType !== undefined && `ElementType=${elementType}`,\r\n learningToolType !== undefined && `LearningToolType=${learningToolType}`\r\n ]\r\n .filter(p => !!p)\r\n .join(\"&\");\r\n\r\n return get(`/restapi/personal/courses/${config.courseId}/resources/v1?${queryParams}`);\r\n}\r\n\r\nexport function getCourseFolderResources(\r\n folderId,\r\n elementType,\r\n learningToolType,\r\n pageIndex,\r\n pageSize\r\n) {\r\n const queryParams = [\r\n `PageIndex=${pageIndex}`,\r\n `PageSize=${pageSize}`,\r\n elementType !== undefined && `ElementType=${elementType}`,\r\n learningToolType !== undefined && `LearningToolType=${learningToolType}`\r\n ]\r\n .filter(p => !!p)\r\n .join(\"&\");\r\n\r\n return get(\r\n `/restapi/personal/courses/${config.courseId}/folders/${folderId}/resources/v1?${queryParams}`\r\n );\r\n}\r\n\r\n/**\r\n * Get terms for course\r\n */\r\nexport const getCourseTerms = () =>\r\n get(`/restapi/terms/current/${config.courseId}/v1`);\r\n\r\n\r\n/**\r\n * Update the term for a topic\r\n */\r\nexport const updateTopicTerm = (termId) =>\r\n put(\r\n `/restapi/planner/topicTerm/set`,\r\n { CourseId: config.courseId, TermId: termId, TopicId: config.topicId },\r\n headers()\r\n );\r\n\r\n/**\r\n * Temove the term for a topic\r\n */\r\nexport const removeTopicTerm = () =>\r\n del(\r\n `/restapi/planner/topicTerm/remove`,\r\n { CourseId: config.courseId, CourseTermId: 0, TopicId: config.topicId },\r\n headers()\r\n );\r\n\r\n/**\r\n * Remove single plan from course (i.e. when cancel a new plan creation)\r\n */\r\nexport const removePlan = planId =>\r\n post(\r\n `/restapi/planner/plan/multiple/remove`,\r\n { CourseId: config.courseId, PlanIds: planId, IsBulkAction: false },\r\n headers()\r\n );\r\n\r\n/**\r\n * Remove multiple plans from course\r\n */\r\nexport const removePlans = (planIds, executeForAllPlans = false, topicIds = []) => {\r\n const requestModel = { courseId: config.courseId, isBulkAction: true };\r\n\r\n if (executeForAllPlans) {\r\n requestModel.executeForAllPlans = true;\r\n requestModel.topicIds = topicIds;\r\n } else {\r\n requestModel.planIds = planIds;\r\n }\r\n\r\n return del(`/restapi/planner/plan/multiple/remove/v2`, requestModel, headers());\r\n};\r\n\r\nexport const setCustomFieldText = (entityId, columnId, data) =>\r\n post(\r\n `/restapi/planner/column/updatecustomcolumncontent`,\r\n {\r\n courseId: config.courseId,\r\n columnId: columnId,\r\n entityId: entityId,\r\n data: data,\r\n replaceElementsWithPlaceholders: false,\r\n skipPlainTextDataTrimming: true\r\n },\r\n headers()\r\n );\r\n\r\nexport const setTopicLearningObjectives = (topicId, columnId, learningObjectiveIds) =>\r\n post(\r\n \"/restapi/planner/learningObjective/topic\",\r\n { courseId: config.courseId, topicId, columnId, learningObjectiveIds },\r\n headers()\r\n );\r\n\r\nexport const removeTopicLearningObjective = (topicId, columnId, learningObjectiveId) =>\r\n del(\r\n \"/restapi/planner/learningObjective/topic\",\r\n { courseId: config.courseId, topicId, columnId, learningObjectiveId },\r\n headers()\r\n );\r\n\r\n/**\r\n * Gets status of uploaded files to the plan\r\n */\r\nexport const getPlanFilesUploadStatus = planId =>\r\n get(\r\n `/restapi/planner/element/planFilesUploadStatus?courseId=${config.courseId}&planId=${planId}`\r\n );\r\n\r\nexport const setElementOrder = (planId, columnId, elementId, elementIds) =>\r\n post(\r\n \"/restapi/planner/element/movePlanElement\",\r\n {\r\n courseId: config.courseId,\r\n sourcePlanId: planId,\r\n targetPlanId: planId,\r\n columnId,\r\n elementId,\r\n elementIds\r\n },\r\n headers()\r\n );\r\n\r\nexport const setTopicOrder = topicIds =>\r\n put(\"/restapi/planner/topic/reorder\", { courseId: config.courseId, topicIds }, headers());\r\n\r\n/**\r\n * Gets courses for a person, with a small set of details. Used for copy plans.\r\n */\r\nexport async function getCourses(pageIndex = 0) {\r\n const result = await get(`/restapi/personal/courses/basicinfo/v1?PageIndex=${pageIndex}`);\r\n\r\n return result.EntityArray;\r\n}\r\n\r\n/**\r\n * Copy plan(s) from course\r\n */\r\nexport const copyPlans = (\r\n targetCourseId,\r\n targetTopicId,\r\n copyDates,\r\n copyResourcesAndActivities,\r\n overwriteAssessmentCriteria,\r\n plansIds,\r\n copyWithoutTopic,\r\n executeForAllPlans = false,\r\n topicIds = []\r\n) => {\r\n return post(\r\n `/restapi/planner/copyPlanner/copyPlans/v2`,\r\n {\r\n SourceCourseId: config.courseId,\r\n targetCourseId,\r\n targetTopicId,\r\n copyDates,\r\n copyResourcesAndActivities,\r\n overwriteAssessmentCriteria,\r\n ElementIds: executeForAllPlans ? [] : plansIds,\r\n copyWithoutTopic,\r\n executeForAllPlans,\r\n topicIds\r\n },\r\n headers()\r\n );\r\n};\r\n\r\n/**\r\n * Gets topics name and id for a specific course (used in copy plans)\r\n */\r\nexport const getTopicsForCopyPlans = (\r\n targetCourseId,\r\n originalTopicId = 0 // TODO: Change this value when adding the logic to create new topic, 0 = Without topic\r\n) =>\r\n post(\r\n `/restapi/planner/copyPlanner/getTopicsForCopyPlans`,\r\n {\r\n CourseId: config.courseId,\r\n TargetCourseId: targetCourseId,\r\n OriginalTopicId: originalTopicId\r\n },\r\n { headers: { [config.antiForgeryHeaderName]: config.antiForgeryHeaderValue } }\r\n );\r\n\r\n/**\r\n * Get available course event dates.\r\n */\r\nexport const getCalendarAvailableDates = (start, end) =>\r\n post(\r\n `/restapi/calendar/courseEventsInTimeFrame`,\r\n {\r\n CourseId: config.courseId,\r\n StartDate: JSON.stringify(start),\r\n EndDate: JSON.stringify(end)\r\n },\r\n headers()\r\n );\r\n\r\n/**\r\n * Delete topics (move to trash can)\r\n */\r\nexport const deleteTopics = topicIds =>\r\n post(\r\n `/restapi/planner/topic/deleteTopics`,\r\n { CourseId: config.courseId, TopicIds: topicIds },\r\n headers()\r\n );\r\n\r\n/**\r\n * Copy topics\r\n */\r\nexport const copyTopics = (\r\n targetCourseId,\r\n copyDates,\r\n copyResourcesAndActivities,\r\n overwriteAssessmentCriteria,\r\n topicIds\r\n) =>\r\n post(\r\n `/restapi/planner/copyPlanner/copyTopics`,\r\n {\r\n SourceCourseId: config.courseId,\r\n TargetCourseId: targetCourseId,\r\n TargetTopicId: null,\r\n CopyDates: copyDates,\r\n CopyResourcesAndActivities: copyResourcesAndActivities,\r\n OverwriteAssessmentCriteria: overwriteAssessmentCriteria,\r\n ElementIds: topicIds\r\n },\r\n headers()\r\n );\r\n\r\n/**\r\n * Set plan order for plans (i.e. under \"Without date\", \"All plans\" tabs)\r\n */\r\nexport function dragAndDropPlanInLesson(sourceId, targetId, topicId, after) {\r\n if (sourceId === targetId) {\r\n return;\r\n }\r\n\r\n return post(\r\n `/restapi/planner/plan/dragAndDrop`,\r\n {\r\n sourceId: sourceId,\r\n targetId: targetId,\r\n insertAfterTargetItem: after,\r\n courseId: config.courseId,\r\n topicId: topicId\r\n },\r\n headers()\r\n );\r\n}\r\n\r\n/**\r\n * Set plan order for a (single) topic after drag and drop\r\n */\r\nexport function dragAndDropPlanInTopic(sourceId, targetId, topicId, after, order) {\r\n if (sourceId === targetId) {\r\n return;\r\n }\r\n\r\n return post(\r\n `/restapi/planner/plan/dragAndDropInTopic`,\r\n {\r\n sourceId,\r\n targetId,\r\n insertAfterTargetItem: after,\r\n courseId: config.courseId,\r\n topicId,\r\n plansInTopicOrder: order\r\n },\r\n headers()\r\n );\r\n}\r\n\r\n/**\r\n * Gets the plan Id for plan that is last in order\r\n */\r\nexport const getPlanLastInOrder = () =>\r\n get(`/restapi/planner/plan/course/${config.courseId}/noTopic/order/last`);\r\n\r\n/**\r\n * Gets the plan Id for plan that is last in order for a topic\r\n */\r\nexport const getPlanLastInOrderTopic = topicId =>\r\n get(`/restapi/planner/plan/course/${config.courseId}/topic/${topicId}/order/last`);\r\n\r\n/**\r\n * Toggle element activation\r\n */\r\nexport const activatePlanElement = (\r\n elementId,\r\n activate,\r\n isFolder,\r\n changeActivationForFolderContent\r\n) =>\r\n put(\r\n `/restapi/elements/${elementId}/activation/v1`,\r\n {\r\n IsFolder: isFolder,\r\n Activate: activate,\r\n ChangeActivationForFolderContent: changeActivationForFolderContent\r\n },\r\n headers()\r\n );\r\n\r\n/**\r\n * Gets count of usages of element across plans in a course.\r\n */\r\nexport const getElementUsageCount = elementId =>\r\n get(`/restapi/planner/element/getElementUsageCount?elementId=${elementId}`);\r\n\r\n/**\r\n * KPI for opening a plan card.\r\n */\r\nexport const measurePlanCardKpi = () =>\r\n post(`/restapi/personal/course/${config.courseId}/plans/measurePlanCardKpi/v1`, {}, headers());\r\n\r\n/**\r\n * Gets the plan that is pinned.\r\n */\r\nexport const getPinnedPlan = () => get(`/restapi/planner/plan/pinned?courseId=${config.courseId}`);\r\n\r\n/**\r\n * Sets the pinned field for the given plan id.\r\n */\r\nexport const updatePlanPinned = (planId, pinned) =>\r\n put(\r\n `/restapi/planner/plan/pinned`,\r\n {\r\n CourseId: config.courseId,\r\n PlanId: planId,\r\n Pinned: pinned\r\n },\r\n { headers: { [config.antiForgeryHeaderName]: config.antiForgeryHeaderValue } }\r\n );\r\n\r\nexport const setPlansTimeSpan = (\r\n planIds,\r\n startDate,\r\n stopDate,\r\n weekNumber,\r\n weekDays,\r\n order,\r\n executeForAllPlans,\r\n topicIds\r\n) =>\r\n post(\r\n `/restapi/planner/planDate/timeSpan/multiple/v2`,\r\n getSetDateRequestModel(\r\n planIds,\r\n startDate,\r\n stopDate,\r\n weekNumber,\r\n weekDays,\r\n order,\r\n executeForAllPlans,\r\n topicIds\r\n ),\r\n headers()\r\n );\r\n\r\nexport const setPlansWeekAndDay = (\r\n planIds,\r\n startDate,\r\n stopDate,\r\n weekNumber,\r\n weekDays,\r\n order,\r\n executeForAllPlans,\r\n topicIds\r\n) =>\r\n post(\r\n `/restapi/planner/planDate/weekAndDay/multiple/v2`,\r\n getSetDateRequestModel(\r\n planIds,\r\n startDate,\r\n stopDate,\r\n weekNumber,\r\n weekDays,\r\n order,\r\n executeForAllPlans,\r\n topicIds\r\n ),\r\n headers()\r\n );\r\n\r\nexport const setPlansTimeSpanEvents = (\r\n planIds,\r\n firstPlanEventIds,\r\n executeForAllPlans = false,\r\n topicIds = []\r\n) => {\r\n const requestModel = {\r\n courseId: config.courseId,\r\n firstPlanEventIds,\r\n filterStartDate: \"\",\r\n filterStopDate: \"\",\r\n isDateColumnDisplayed: true\r\n };\r\n\r\n if (executeForAllPlans) {\r\n requestModel.executeForAllPlans = true;\r\n requestModel.topicIds = topicIds;\r\n } else {\r\n requestModel.planIds = planIds;\r\n }\r\n\r\n return post(`/restapi/planner/planDate/events/multiple/v3`, requestModel, headers());\r\n};\r\n/**\r\n * Checks if plans has been reordered in topic\r\n */\r\nexport const hasPlansForTopicBeenReordered = topicId =>\r\n get(\r\n `/restapi/planner/plan/hasPlansForTopicBeenReordered?courseId=${config.courseId}&topicId=${topicId}`\r\n );\r\n\r\n/**\r\n * Get plan order within topic\r\n */\r\nexport const getPlanOrderInTopic = topicId =>\r\n get(`/restapi/planner/topic/planOrder?courseId=${config.courseId}&topicId=${topicId}`);\r\n\r\n/**\r\n * Set plan order within topic\r\n */\r\nexport const setPlanOrderInTopic = (topicId, planOrder) =>\r\n put(\r\n `/restapi/planner/topic/planOrder`,\r\n {\r\n CourseId: config.courseId,\r\n TopicId: topicId,\r\n PlanOrder: planOrder\r\n },\r\n headers()\r\n );\r\n\r\n/**\r\n * Reset plan order within topic\r\n */\r\nexport const resetPlansInTopicOrder = (topicId, plansInTopicOrder) =>\r\n put(\r\n `/restapi/planner/plan/resetPlansInTopicOrder`,\r\n {\r\n CourseId: config.courseId,\r\n TopicId: topicId,\r\n PlansInTopicOrder: plansInTopicOrder\r\n },\r\n headers()\r\n );\r\n\r\n/**\r\n * Copy the current order to the order in topic (e.g. case when switching from old to new planner)\r\n */\r\nexport const copyOrderToOrderInTopic = topicId =>\r\n put(\r\n `/restapi/planner/plan/copyOrderToOrderInTopic`,\r\n {\r\n CourseId: config.courseId,\r\n TopicId: topicId\r\n },\r\n headers()\r\n );\r\n\r\n/**\r\n * Stop sharing planner\r\n */\r\nexport const stopSharingPlanner = plannerShareableObjectId =>\r\n post(\r\n `/restapi/planner/shareablePlanner/stop`,\r\n {\r\n CourseId: config.courseId,\r\n plannerShareableObjectId: plannerShareableObjectId\r\n },\r\n headers()\r\n );\r\n\r\nexport const togglePlanElementsActivation = (planId, activate) =>\r\n put(\r\n \"/restapi/planner/plan/elements/activation\",\r\n {\r\n courseId: config.courseId,\r\n planId: planId,\r\n activateElements: activate\r\n },\r\n headers()\r\n );\r\n\r\nexport const getTopicsForTableView = (pageIndex = 0, pageSize = pageSizeTableView) =>\r\n get(\r\n `/restapi/course/${config.courseId}/plans/tableview/topics/v1?PageIndex=${pageIndex}&PageSize=${pageSize}`\r\n );\r\n\r\nexport const getPlansForTopicInTableView = (courseId, topicId, pageIndex) =>\r\n get(\r\n `/restapi/course/${courseId}/plans/tableview/topics/${topicId}/plans/v1?pageIndex=${pageIndex}&pageSize=${pageSize}`\r\n );\r\n\r\nexport const getPlansWithoutTopicInTableView = (courseId, pageIndex) =>\r\n get(\r\n `/restapi/course/${courseId}/plans/tableview/topics/withoutTopic/plans/v1?pageIndex=${pageIndex}&pageSize=${pageSize}`\r\n );\r\n\r\nexport const getTableViewPlans = (topicIds = [], pageIndex = 0, pageSize = pageSizeTableView) =>\r\n post(\r\n `/restapi/course/${config.courseId}/plans/tableview/v1?PageIndex=${pageIndex}&PageSize=${pageSize}&ChildId=${config.childId}`,\r\n {\r\n topicIds\r\n },\r\n headers()\r\n );\r\n\r\nconst getSetDateRequestModel = (\r\n planIds,\r\n startDate,\r\n stopDate,\r\n weekNumber,\r\n weekDays,\r\n order,\r\n executeForAllPlans,\r\n topicIds\r\n) => {\r\n const requestModel = {\r\n courseId: config.courseId,\r\n start: startDate,\r\n stop: stopDate,\r\n weekNumber: weekNumber,\r\n weekDays: JSON.stringify(weekDays),\r\n order\r\n };\r\n\r\n if (executeForAllPlans) {\r\n requestModel.executeForAllPlans = true;\r\n requestModel.topicIds = topicIds;\r\n } else {\r\n requestModel.planIds = planIds;\r\n }\r\n\r\n return requestModel;\r\n};\r\n\r\nexport const getAllPlansForPrintingTable = topicIds =>\r\n get(\r\n `/restapi/personal/course/${config.courseId}/plans/print/table/all/v1?topicIds=${topicIds.join()}`\r\n );\r\n\r\nexport const getTopicCurrentPlans = (\r\n topicId,\r\n pageIndex = 0,\r\n pageSize = plansForTopicPageSize,\r\n planOrder = planSorting.NotSetValue\r\n) =>\r\n get(\r\n `/restapi/personal/course/${\r\n config.courseId\r\n }/plans/topics/${topicId}/current/v1?${getQueryStringPaging(\r\n pageIndex,\r\n pageSize,\r\n config.childId\r\n )}&PlanOrder=${planOrder}`\r\n );\r\n\r\nexport const getTopicPastPlans = (\r\n topicId,\r\n pageIndex = 0,\r\n pageSize = plansForTopicPageSize,\r\n planOrder = planSorting.NotSetValue\r\n) =>\r\n get(\r\n `/restapi/personal/course/${\r\n config.courseId\r\n }/plans/topics/${topicId}/past/v1?${getQueryStringPaging(\r\n pageIndex,\r\n pageSize,\r\n config.childId\r\n )}&PlanOrder=${planOrder}`\r\n );\r\n\r\nexport const getTopicWithoutDatePlans = (\r\n topicId,\r\n pageIndex = 0,\r\n pageSize = plansForTopicPageSize,\r\n planOrder = planSorting.NotSetValue\r\n) =>\r\n get(\r\n `/restapi/personal/course/${\r\n config.courseId\r\n }/plans/topics/${topicId}/without-date/v1?${getQueryStringPaging(\r\n pageIndex,\r\n pageSize,\r\n config.childId\r\n )}&PlanOrder=${planOrder}`\r\n );\r\n\r\nexport const getTopicAllPlans = (\r\n topicId,\r\n pageIndex = 0,\r\n pageSize = plansForTopicPageSize,\r\n planOrder = planSorting.NotSetValue\r\n) =>\r\n get(\r\n `/restapi/personal/course/${\r\n config.courseId\r\n }/plans/topics/${topicId}/all/v1?${getQueryStringPaging(\r\n pageIndex,\r\n pageSize,\r\n config.childId\r\n )}&PlanOrder=${planOrder}`\r\n );\r\n\r\n/**\r\n * Move element to another plan\r\n */\r\nexport const moveElementToPlan = (\r\n elementId,\r\n targetPlanId,\r\n sourcePlanId = config.planId,\r\n columnId = config.elementColumnId\r\n) =>\r\n post(\r\n `/restapi/planner/element/moveElementToPlan`,\r\n {\r\n courseId: config.courseId,\r\n elementId: elementId,\r\n sourcePlanId: sourcePlanId,\r\n targetPlanId: targetPlanId,\r\n columnId: columnId\r\n },\r\n headers()\r\n );\r\n\r\n/**\r\n * Gets all available course template types\r\n */\r\nexport const getAvailabilityOfTemplateTypes = (courseId, topicId) =>\r\n get(endpoints.getAvailabilityOfTemplateTypes(courseId, topicId));\r\n\r\n/**\r\n * Gets my or other course templates\r\n */\r\nexport const searchForCourses = async (options, paging) =>\r\n get(endpoints.searchForCourses(options, paging));\r\n\r\n/**\r\n * Gets from publishers or other templates\r\n */\r\nexport const searchForPlannerTemplates = async (options, paging) =>\r\n get(endpoints.searchForPlannerTemplates(options, paging));\r\n\r\n/**\r\n * Gets topics from course\r\n */\r\nexport const getTopicsFromCourse = (courseId, templateCourseId, paging) =>\r\n get(endpoints.getTopicsFromCourse(courseId, templateCourseId, paging));\r\n\r\n/**\r\n * Gets topics from shareable planner\r\n */\r\nexport const getTopicsFromShareablePlanner = (courseId, templateCourseId, type) =>\r\n get(endpoints.getTopicsFromShareablePlanner(courseId, templateCourseId, type));\r\n\r\n/**\r\n * Gets plans in topic from course\r\n */\r\nexport const getPlansInTopicFromCourse = (courseId, templateCourseId, topicId, paging) =>\r\n get(endpoints.getPlansInTopicFromCourse(courseId, templateCourseId, topicId, paging));\r\n\r\n/**\r\n * Gets resourses from plan.\r\n * type parameter is of type ElementCategory.\r\n */\r\nexport const getResourcesFromTemplateCourse = (courseId, templateCourseId, topicId, planId, paging, type) =>\r\n get(endpoints.getResourcesFromTemplateCourse(courseId, templateCourseId, topicId, planId, paging, type)\r\n );\r\n\r\n/**\r\n * Import resourses\r\n */\r\nexport const importResources = (courseId, importResourcesModel) =>\r\n post(\r\n endpoints.importResources(courseId),\r\n importResourcesModel,\r\n headers()\r\n );\r\n\r\n/**\r\n * Save user preference page size.\r\n */\r\nexport const saveUserPreferencePageSize = (courseId, pageSize) =>\r\n put(\r\n endpoints.saveUserPreferencePageSize(courseId),\r\n pageSize,\r\n headers()\r\n );\r\n\r\n/**\r\n * Get assigned plan participants\r\n */\r\nexport const getAssignedPlanParticipants = (planId = config.planId) =>\r\n get(`/restapi/personal/course/${config.courseId}/plans/${planId}/assigned/participants/v1`);\r\n\r\n/**\r\n * Get assigned plan groups\r\n */\r\nexport const getAssignedPlanGroups = (planId = config.planId) =>\r\n get(`/restapi/personal/course/${config.courseId}/plans/${planId}/assigned/groups/v1`);\r\n\r\n/**\r\n * Create new plan V2\r\n */\r\nexport const createPlanV2 = planParams =>\r\n post(\r\n \"/restapi/planner/plan/add/v2\",\r\n {\r\n TopicId: planParams.topic ? planParams.topic.id : null,\r\n Start: planParams.start,\r\n End: planParams.stop,\r\n CourseId: config.courseId\r\n },\r\n headers()\r\n );\r\n\r\n/**\r\n * Assign a plan\r\n */\r\nexport const assignPlan = (planId, participantIds, groupIds) =>\r\n post(\r\n \"/restapi/planner/plan/assignto\",\r\n {\r\n PlanId: planId,\r\n ParticipantIds: participantIds,\r\n GroupIds: groupIds,\r\n CourseId: config.courseId\r\n },\r\n headers()\r\n );\r\n\r\n","const NO_TOPIC = Symbol(\"NoTopicImages\");\r\n\r\nexport function createPlaceholderImagesProvider(topicColours, defaultPlanImages) {\r\n if (!defaultPlanImages) {\r\n new Error(\"Default plan images are required.\");\r\n }\r\n\r\n const topicPlaceholderLookup = new Map([\r\n ...defaultPlanImages.topicColourImages.map(tc => [\r\n tc.colorSchemaName,\r\n {\r\n imageIndex: getRandomImageIndex(tc.imageUrls.length),\r\n imageUrls: tc.imageUrls\r\n }\r\n ]),\r\n [\r\n NO_TOPIC,\r\n {\r\n imageIndex: getRandomImageIndex(defaultPlanImages.noTopicImages.length),\r\n imageUrls: defaultPlanImages.noTopicImages\r\n }\r\n ]\r\n ]);\r\n\r\n return {\r\n getImageForTopic: topic => {\r\n if (topic && !topic.color) {\r\n return null;\r\n }\r\n\r\n let topicColor = NO_TOPIC;\r\n\r\n if (topic) {\r\n const matchingColor = topicColours.find(c => c.hexCode === topic.color);\r\n\r\n if (matchingColor) {\r\n topicColor = matchingColor.className;\r\n }\r\n }\r\n\r\n const defaultImages = topicPlaceholderLookup.get(topicColor);\r\n\r\n if (!defaultImages) {\r\n return null;\r\n }\r\n\r\n const currentImageIndex = defaultImages.imageIndex;\r\n\r\n topicPlaceholderLookup.set(topicColor, {\r\n ...defaultImages,\r\n imageIndex:\r\n currentImageIndex + 1 >= defaultImages.imageUrls.length\r\n ? 0\r\n : currentImageIndex + 1\r\n });\r\n\r\n return defaultImages.imageUrls[currentImageIndex];\r\n }\r\n };\r\n}\r\n\r\nconst getRandomImageIndex = maxAllowedIndex => Math.floor(Math.random() * maxAllowedIndex);\r\n","import { get } from \"svelte/store\";\r\nimport {\r\n getPlan,\r\n getPlanPublic,\r\n getPlansInTopic,\r\n getPlansInTopicPublic,\r\n getTopicCurrentPlans,\r\n getTopicPastPlans,\r\n getTopicWithoutDatePlans,\r\n getTopicAllPlans\r\n} from \"../api\";\r\nimport config from \"../config\";\r\nimport { createPlaceholderImagesProvider } from \"./planImageHelper\";\r\n\r\nexport const loadPlansForTableView = async ({ store, apiMethod } = {}) =>\r\n loadTableViewModePlans(store, apiMethod);\r\n\r\nexport const loadPlansForPrintTbl = async (store, apiMethod, ids) => {\r\n startLoading(store);\r\n\r\n store.update(data => {\r\n data.plans = [];\r\n data.placeholderImagesProvider = createPlaceholderImagesProvider(\r\n config.topicColours,\r\n config.defaultPlanImages\r\n );\r\n\r\n return data;\r\n });\r\n\r\n try {\r\n const result = await apiMethod(ids);\r\n\r\n applyResult(store, result);\r\n } catch (error) {\r\n handleError(store, error);\r\n }\r\n};\r\n\r\nexport async function loadPlanCounts(store, apiMethod) {\r\n startLoading(store);\r\n\r\n store.update(data => {\r\n data.planCounts = {};\r\n\r\n return data;\r\n });\r\n\r\n const result = await apiMethod();\r\n\r\n applyResultPlanCounts(store, result);\r\n\r\n return result;\r\n}\r\n\r\nexport async function loadPlans(store, apiMethod, append) {\r\n startLoading(store);\r\n\r\n let index = 0;\r\n\r\n if (append) {\r\n const { currentPageIndex } = get(store);\r\n\r\n index = currentPageIndex + 1;\r\n } else {\r\n store.update(data => {\r\n data.plans = [];\r\n data.placeholderImagesProvider = createPlaceholderImagesProvider(\r\n config.topicColours,\r\n config.defaultPlanImages\r\n );\r\n\r\n return data;\r\n });\r\n }\r\n\r\n try {\r\n const result = await apiMethod(index);\r\n\r\n applyResult(store, result, append);\r\n } catch (error) {\r\n handleError(store, error);\r\n }\r\n}\r\n\r\nexport async function loadTableViewModePlans(store, apiMethod) {\r\n startLoading(store);\r\n\r\n const { currentPageIndex, pageSize } = get(store);\r\n\r\n store.update(data => {\r\n data.plans = [];\r\n data.placeholderImagesProvider = createPlaceholderImagesProvider(\r\n config.topicColours,\r\n config.defaultPlanImages\r\n );\r\n\r\n return data;\r\n });\r\n\r\n try {\r\n const result = await apiMethod(currentPageIndex, pageSize);\r\n\r\n applyResult(store, result);\r\n } catch (error) {\r\n handleError(store, error);\r\n }\r\n}\r\n\r\nexport async function loadPlansForTopic(store, publicAccessKey, topicId, append, planOrder) {\r\n startLoading(store);\r\n\r\n let index = 0;\r\n\r\n if (append) {\r\n const { currentPageIndex } = get(store);\r\n\r\n index = currentPageIndex + 1;\r\n } else {\r\n store.update(data => {\r\n data.plans = [];\r\n data.placeholderImagesProvider = createPlaceholderImagesProvider(\r\n config.topicColours,\r\n config.defaultPlanImages\r\n );\r\n\r\n return data;\r\n });\r\n }\r\n\r\n const apiMethod = publicAccessKey ? getPlansInTopicPublic : getPlansInTopic;\r\n\r\n try {\r\n const result = await apiMethod(topicId, index, planOrder);\r\n\r\n applyResult(store, result, append, planOrder);\r\n } catch (error) {\r\n handleError(store, error);\r\n }\r\n}\r\n\r\nexport async function loadPlan(store, publicAccessKey, planId) {\r\n startLoading(store);\r\n\r\n const apiMethod = publicAccessKey ? getPlanPublic : getPlan;\r\n\r\n try {\r\n const result = await apiMethod(planId);\r\n\r\n store.update(data => {\r\n if (result.start) {\r\n result.start = adjustToTimezone(result.start);\r\n }\r\n\r\n if (result.stop) {\r\n result.stop = adjustToTimezone(result.stop);\r\n }\r\n\r\n if (result.activeFromDT) {\r\n result.activeFromDT = adjustToTimezone(result.activeFromDT);\r\n }\r\n\r\n data.plan = result;\r\n data.loading = false;\r\n\r\n return data;\r\n });\r\n } catch (error) {\r\n handleError(store, error);\r\n }\r\n}\r\n\r\nexport async function loadTopicCurrentPlans(store, topicId) {\r\n startLoading(store);\r\n\r\n store.update(data => {\r\n data.plans = [];\r\n data.placeholderImagesProvider = createPlaceholderImagesProvider(\r\n config.topicColours,\r\n config.defaultPlanImages\r\n );\r\n\r\n return data;\r\n });\r\n\r\n const apiMethod = getTopicCurrentPlans;\r\n\r\n try {\r\n const result = await apiMethod(topicId ? topicId : 0);\r\n\r\n applyResult(store, result, false);\r\n } catch (error) {\r\n handleError(store, error);\r\n }\r\n}\r\n\r\nexport async function loadTopicWithoutDatePlans(store, topicId) {\r\n startLoading(store);\r\n\r\n store.update(data => {\r\n data.plans = [];\r\n data.placeholderImagesProvider = createPlaceholderImagesProvider(\r\n config.topicColours,\r\n config.defaultPlanImages\r\n );\r\n\r\n return data;\r\n });\r\n\r\n const apiMethod = getTopicWithoutDatePlans;\r\n\r\n try {\r\n const result = await apiMethod(topicId ? topicId : 0);\r\n\r\n applyResult(store, result, false);\r\n } catch (error) {\r\n handleError(store, error);\r\n }\r\n}\r\n\r\nexport async function loadTopicPastPlans(store, topicId) {\r\n startLoading(store);\r\n\r\n store.update(data => {\r\n data.plans = [];\r\n data.placeholderImagesProvider = createPlaceholderImagesProvider(\r\n config.topicColours,\r\n config.defaultPlanImages\r\n );\r\n\r\n return data;\r\n });\r\n\r\n const apiMethod = getTopicPastPlans;\r\n\r\n try {\r\n const result = await apiMethod(topicId ? topicId : 0);\r\n\r\n applyResult(store, result, false);\r\n } catch (error) {\r\n handleError(store, error);\r\n }\r\n}\r\n\r\nexport async function loadTopicAllPlans(store, topicId) {\r\n startLoading(store);\r\n\r\n store.update(data => {\r\n data.plans = [];\r\n data.placeholderImagesProvider = createPlaceholderImagesProvider(\r\n config.topicColours,\r\n config.defaultPlanImages\r\n );\r\n\r\n return data;\r\n });\r\n\r\n const apiMethod = getTopicAllPlans;\r\n\r\n try {\r\n const result = await apiMethod(topicId ? topicId : 0);\r\n\r\n applyResult(store, result);\r\n } catch (error) {\r\n handleError(store, error);\r\n }\r\n}\r\n\r\nfunction startLoading(store) {\r\n store.update(data => {\r\n data.loading = true;\r\n data.error = undefined;\r\n\r\n return data;\r\n });\r\n}\r\n\r\nfunction applyResult(store, result, append = false) {\r\n store.update(data => {\r\n const plans = buildUpPlans(result, data.placeholderImagesProvider);\r\n\r\n result.plans = append ? [...data.plans, ...plans] : plans;\r\n result.placeholderImagesProvider = data.placeholderImagesProvider;\r\n data = result;\r\n data.loading = false;\r\n\r\n return data;\r\n });\r\n}\r\n\r\nfunction applyResultPlanCounts(store, result) {\r\n store.update(data => {\r\n data = result;\r\n\r\n return data;\r\n });\r\n}\r\n\r\nfunction handleError(store, error) {\r\n store.update(data => {\r\n data.loading = false;\r\n data.error = error;\r\n\r\n return data;\r\n });\r\n\r\n return { error };\r\n}\r\n\r\nexport function buildUpPlans(plans, placeholderImagesProvider) {\r\n return plans.entityArray.map(plan => {\r\n if (plan.start) {\r\n plan.start = adjustToTimezone(plan.start);\r\n }\r\n\r\n if (plan.stop) {\r\n plan.stop = adjustToTimezone(plan.stop);\r\n }\r\n\r\n if (plan.activeFromDT) {\r\n plan.activeFromDT = adjustToTimezone(plan.activeFromDT);\r\n }\r\n\r\n setPlaceholderImageUrl(plan, placeholderImagesProvider);\r\n\r\n return plan;\r\n });\r\n}\r\n\r\n/**\r\n * Set time according to configured timezone (and not current browser location)\r\n * @param {Date} date\r\n * @returns {Date}\r\n */\r\nexport function adjustToTimezone(date) {\r\n const newDate = new Date(date);\r\n const userTimezoneOffset = newDate.getTimezoneOffset() * 60000;\r\n const adjustedDate = new Date(newDate.getTime() + userTimezoneOffset);\r\n\r\n return adjustedDate;\r\n}\r\n\r\nfunction setPlaceholderImageUrl(plan, placeholderImagesProvider) {\r\n if (!plan || !placeholderImagesProvider) {\r\n return;\r\n }\r\n\r\n plan.placeholderImageUrl = plan.imageUrl\r\n ? null\r\n : placeholderImagesProvider.getImageForTopic(plan.topic);\r\n}\r\n","import config from \"../config\";\r\nimport { adjustToTimezone } from \"./loadPlansHelper\";\r\nimport {\r\n dateTimePickerModalFromSection,\r\n dateTimePickerModalToSection,\r\n datePickerButton,\r\n fromDatePickerInputField,\r\n toDatePickerInputField\r\n} from \"../constants\";\r\n\r\n/**\r\n * Gets a date range string for displaying two dates as a range\r\n * @param {Date} from\r\n * @param {Date} to\r\n * @param {string} locale\r\n * @param {bool} singlePlan\r\n * @returns {string}\r\n */\r\nexport function getDateRangeString(from, to, locale, singlePlan = false) {\r\n let fromString;\r\n let toString;\r\n\r\n if (typeof from !== \"object\") {\r\n from = adjustToTimezone(new Date(from));\r\n }\r\n\r\n if (typeof to !== \"object\") {\r\n to = adjustToTimezone(new Date(to));\r\n }\r\n\r\n // Not all browsers support the locale and options parameters for\r\n // toLocaleDateString so catch exceptions and use the default\r\n try {\r\n const isSameYear = from.getFullYear() === to.getFullYear();\r\n const isToCurrentYear = new Date().getFullYear() === to.getFullYear();\r\n\r\n const yearOption = isSameYear && isToCurrentYear ? undefined : \"numeric\";\r\n const options = { day: \"numeric\", month: \"short\", year: yearOption };\r\n\r\n fromString = from.toLocaleDateString(locale, options);\r\n toString = to.toLocaleDateString(locale, options);\r\n } catch {\r\n fromString = from.toLocaleDateString();\r\n toString = to.toLocaleDateString();\r\n }\r\n\r\n if (isDateOnlyMode(from.getUTCMinutes(), to.getUTCMinutes())) {\r\n const dayInMilliseconds = 1000 * 60 * 60 * 24;\r\n\r\n if (to.getTime() - from.getTime() < dayInMilliseconds) {\r\n return fromString;\r\n }\r\n }\r\n\r\n let startTime;\r\n let endTime;\r\n\r\n try {\r\n const timeStringOptions = {\r\n minute: \"numeric\",\r\n hour: \"numeric\",\r\n hour12: config.useTwelveHourFormat\r\n };\r\n\r\n startTime = from.toLocaleTimeString(locale, timeStringOptions);\r\n endTime = to.toLocaleTimeString(locale, timeStringOptions);\r\n } catch {\r\n startTime = from.toLocaleTimeString();\r\n endTime = to.toLocaleTimeString();\r\n }\r\n\r\n if (fromString === toString) {\r\n return `${fromString} ${startTime}–${endTime}`;\r\n } else {\r\n if (singlePlan) {\r\n if (isDateOnlyMode(from.getUTCMinutes(), to.getUTCMinutes())) {\r\n return `${fromString}–${toString}`;\r\n } else {\r\n return `${fromString} ${startTime}–${toString} ${endTime}`;\r\n }\r\n } else {\r\n return `${fromString}-${toString}`;\r\n }\r\n }\r\n}\r\n\r\n/**\r\n * Gets a date range string for events\r\n * @param {Date} from\r\n * @param {Date} to\r\n * @param {string} locale\r\n\r\n * @returns {string}\r\n */\r\nexport function getEventsDateRangeString(from, to, locale, multipleDayPlan) {\r\n let fromString;\r\n let toString;\r\n\r\n // Not all browsers support the locale and options parameters for\r\n // toLocaleDateString so catch exceptions and use the default\r\n try {\r\n const yearOption = from.getFullYear() === to.getFullYear() ? undefined : \"numeric\";\r\n const options = { day: \"numeric\", month: \"short\", year: yearOption };\r\n\r\n fromString = from.toLocaleDateString(locale, options);\r\n toString = to.toLocaleDateString(locale, options);\r\n } catch {\r\n fromString = from.toLocaleDateString();\r\n toString = to.toLocaleDateString();\r\n }\r\n\r\n let startTime;\r\n let endTime;\r\n\r\n try {\r\n const timeStringOptions = {\r\n minute: \"numeric\",\r\n hour: \"numeric\",\r\n hour12: config.useTwelveHourFormat\r\n };\r\n\r\n startTime = from.toLocaleTimeString(locale, timeStringOptions);\r\n endTime = to.toLocaleTimeString(locale, timeStringOptions);\r\n } catch {\r\n startTime = from.toLocaleTimeString();\r\n endTime = to.toLocaleTimeString();\r\n }\r\n\r\n // Only return time if plan is within one day, otherwise include date\r\n if (!multipleDayPlan) {\r\n return `${startTime}–${endTime}`;\r\n } else {\r\n if (fromString === toString) {\r\n return `${fromString} ${startTime}-${endTime}`;\r\n } else {\r\n return `${fromString} ${startTime}–${toString} ${endTime}`;\r\n }\r\n }\r\n}\r\n\r\n/**\r\n * Gets a date range string for displaying the start date of an upcoming plan (visibility section)\r\n * @param {Date} from\r\n * @param {Date} to\r\n * @param {string} locale\r\n * @returns {string}\r\n */\r\nexport function getDateStartString(from, to, locale) {\r\n let fromString;\r\n\r\n // Not all browsers support the locale and options parameters for\r\n // toLocaleDateString so catch exceptions and use the default\r\n try {\r\n const yearOption = from.getFullYear() === to.getFullYear() ? undefined : \"numeric\";\r\n const options = { day: \"numeric\", month: \"short\", year: yearOption };\r\n\r\n fromString = from.toLocaleDateString(locale, options);\r\n } catch {\r\n fromString = from.toLocaleDateString();\r\n }\r\n\r\n return fromString;\r\n}\r\n\r\n/**\r\n * Format date in YYYY-MM-DD HH:MM:SS\r\n * @param {Date} date\r\n * @returns {string}\r\n */\r\nexport function formatDateForApi(date) {\r\n const month = addLeadingZero(date.getMonth() + 1);\r\n const day = addLeadingZero(date.getDate());\r\n const year = date.getFullYear();\r\n const hours = addLeadingZero(date.getHours());\r\n const minutes = addLeadingZero(date.getMinutes());\r\n const seconds = \"00\";\r\n\r\n const dateString = [year, month, day].join(\"-\") + \" \" + [hours, minutes, seconds].join(\":\");\r\n\r\n return dateString;\r\n}\r\n\r\n/**\r\n * Format date in YYYY-MM-DD\r\n * @param {Date} date\r\n * @returns {string}\r\n */\r\nexport function formatDateOnlyForApi(date) {\r\n const month = addLeadingZero(date.getMonth() + 1);\r\n const day = addLeadingZero(date.getDate());\r\n const year = date.getFullYear();\r\n\r\n const dateString = [year, month, day].join(\"-\");\r\n\r\n return dateString;\r\n}\r\n\r\n/**\r\n * Add leading zero to time (e.g hours or minutes)\r\n * @param {Date} number\r\n * @returns {string}\r\n */\r\nexport function addLeadingZero(number) {\r\n const zero = 2 - number.toString().length + 1;\r\n\r\n return Array(+(zero > 0 && zero)).join(\"0\") + number;\r\n}\r\n\r\n/**\r\n * Return true if the day period is PM\r\n * @param {Date} time\r\n * @returns {bool}\r\n */\r\nexport function isPM(time) {\r\n const hour = time.getHours();\r\n\r\n if (hour > 11) {\r\n return true;\r\n }\r\n\r\n return false;\r\n}\r\n\r\n/**\r\n * Get the hours\r\n * @param {Date} time\r\n * @param {bool} twelveHourFormat\r\n * @returns {string}\r\n */\r\nexport function getCurrentHours(time, twelveHourFormat) {\r\n let hour = time.getHours();\r\n\r\n if (twelveHourFormat) {\r\n if (hour === 0) {\r\n hour = 12;\r\n } else if (hour > 11) {\r\n hour = hour - 12;\r\n }\r\n }\r\n\r\n return addLeadingZero(hour);\r\n}\r\n\r\n/**\r\n * Get the minutes\r\n * @param {Date} time\r\n * @returns {string}\r\n */\r\nexport function getCurrentMinutes(time) {\r\n const minute = time.getMinutes();\r\n\r\n return addLeadingZero(minute);\r\n}\r\n\r\n/**\r\n * Return true if date only mode.\r\n * Date mode sets minutes to :01 and :59 to indicate the time is not relevant\r\n * @param {Date} fromMinutes\r\n * @param {Date} toMinutes\r\n * @returns {bool}\r\n */\r\nexport function isDateOnlyMode(fromMinutes, toMinutes) {\r\n return fromMinutes === 1 || toMinutes === 59;\r\n}\r\n\r\n/**\r\n * Return true if proper date syntax (or empty date).\r\n * @param {Date} dateValue\r\n * @param {string} dateFormat\r\n * @returns {bool}\r\n */\r\nexport function validateDateFormat(dateValue, dateFormat) {\r\n if (dateValue === \"\") {\r\n return true;\r\n } else {\r\n let findSeparator = \"\";\r\n\r\n for (let i = 0; i < dateFormat.length; i++) {\r\n if (dateFormat.substring(i, i + 1) !== dateFormat.substring(0, 1)) {\r\n findSeparator = dateFormat.substring(i, i + 1);\r\n break;\r\n }\r\n }\r\n\r\n const separator = findSeparator;\r\n\r\n const dateArray = dateValue.split(separator);\r\n const formatArray = dateFormat.split(separator);\r\n\r\n let day = \"\";\r\n let month = \"\";\r\n let year = \"\";\r\n\r\n if (dateArray.length !== formatArray.length) {\r\n return false;\r\n }\r\n\r\n for (let i = 0; i < formatArray.length; i++) {\r\n if (formatArray[i] && formatArray[i].toUpperCase().includes(\"D\")) {\r\n day = dateArray[i].length === 1 ? addLeadingZero(dateArray[i]) : dateArray[i];\r\n } else if (formatArray[i] && formatArray[i].toUpperCase().includes(\"M\")) {\r\n month = dateArray[i].length === 1 ? addLeadingZero(dateArray[i]) : dateArray[i];\r\n } else if (formatArray[i] && formatArray[i].toUpperCase().includes(\"Y\")) {\r\n if (formatArray[i].length === dateArray[i].length) {\r\n year = dateArray[i];\r\n }\r\n }\r\n }\r\n\r\n const date = new Date(year + \"-\" + month + \"-\" + day);\r\n const missingDateValue = !day || !month || !year;\r\n\r\n return !isNaN(date) && !missingDateValue;\r\n }\r\n}\r\n\r\nfunction checkAutoSuggestFromDate(dateValueTo, dateValueFrom, dateValueFromInitially) {\r\n if (dateValueTo && !dateValueFromInitially) {\r\n dateValueFrom = dateValueTo;\r\n }\r\n\r\n dateValueFromInitially = dateValueFrom;\r\n}\r\n\r\nfunction checkAutoSuggestToDate(dateValueFrom, dateValueTo, dateValueToInitially) {\r\n if (dateValueFrom && !dateValueToInitially) {\r\n dateValueTo = dateValueFrom;\r\n }\r\n\r\n dateValueToInitially = dateValueTo;\r\n}\r\n\r\n/**\r\n * Init auto suggest from-date.\r\n * @param {Date} dateValueFrom\r\n * @param {Date} dateValueTo\r\n * @param {Date} dateValueFromInitially\r\n */\r\nexport function initAutoSuggestFromDate(dateValueFrom, dateValueTo, dateValueFromInitially) {\r\n document.querySelector(\r\n `div[class^=${dateTimePickerModalFromSection}] button[class^=${datePickerButton}]`\r\n ).onmousedown = checkAutoSuggestFromDate(dateValueTo, dateValueFrom, dateValueFromInitially);\r\n document.querySelector(\r\n `div[class^=${dateTimePickerModalFromSection}] button[class^=${datePickerButton}]`\r\n ).onkeydown = checkAutoSuggestFromDate(dateValueTo, dateValueFrom, dateValueFromInitially);\r\n document.querySelector(\r\n `div[class^=${dateTimePickerModalFromSection}] input[id^=${fromDatePickerInputField}]`\r\n ).onmousedown = checkAutoSuggestFromDate(dateValueTo, dateValueFrom, dateValueFromInitially);\r\n}\r\n\r\n/**\r\n * Init auto suggest to-date.\r\n * @param {Date} dateValueFrom\r\n * @param {Date} dateValueTo\r\n * @param {Date} dateValueToInitially\r\n */\r\nexport function initAutoSuggestToDate(dateValueFrom, dateValueTo, dateValueToInitially) {\r\n document.querySelector(\r\n `div[class^=${dateTimePickerModalToSection}] button[class^=${datePickerButton}]`\r\n ).onmousedown = checkAutoSuggestToDate(dateValueFrom, dateValueTo, dateValueToInitially);\r\n document.querySelector(\r\n `div[class^=${dateTimePickerModalToSection}] button[class^=${datePickerButton}]`\r\n ).onkeydown = checkAutoSuggestToDate(dateValueFrom, dateValueTo, dateValueToInitially);\r\n document.querySelector(\r\n `div[class^=${dateTimePickerModalToSection}] input[id^=${toDatePickerInputField}]`\r\n ).onmousedown = checkAutoSuggestToDate(dateValueFrom, dateValueTo, dateValueToInitially);\r\n}\r\n","<div class=\"connect-to-calendar-modal\" {planIds}>\r\n <Modal\r\n id=\"connect-to-calendar-modal-id\"\r\n bind:enabled={showConnectToCalendarModal}\r\n titleText={i18n.connectToCalendar}\r\n confirmText={i18n.connect}\r\n cancelText={i18n.cancel}\r\n on:close={connectToCalendarModalClicked}\r\n >\r\n <div slot=\"body\">\r\n <Banner\r\n visible={bannerVisible}\r\n type=\"warning\"\r\n closable={false}\r\n text={i18n.connectToCalendarBannerWarningText}\r\n />\r\n <div class=\"connect-calendar-modal-section__description\">\r\n {i18n.connectToCalendar_Description}\r\n </div>\r\n <div class={dateTimePickerModalFromSection}>\r\n <DatePickerField\r\n bind:value={dateValueFrom}\r\n bind:expanded={datePickerFromExpanded}\r\n bind:highlightedDates\r\n firstDayOfWeek={config.firstDayOfWeek}\r\n locale={config.locale}\r\n id=\"date-picker-from\"\r\n label={i18n.calendarFrom}\r\n labelPosition=\"left\"\r\n placeholder={i18n.datePickerPlaceholder}\r\n format={dateFormat}\r\n closeOnSelect={true}\r\n {i18n}\r\n />\r\n </div>\r\n <div class={dateTimePickerModalToSection}>\r\n <DatePickerField\r\n bind:value={dateValueTo}\r\n bind:expanded={datePickerToExpanded}\r\n bind:highlightedDates\r\n firstDayOfWeek={config.firstDayOfWeek}\r\n locale={config.locale}\r\n id=\"date-picker-to\"\r\n label={i18n.calendarTo}\r\n labelPosition=\"left\"\r\n placeholder={i18n.datePickerPlaceholder}\r\n format={dateFormat}\r\n closeOnSelect={true}\r\n {i18n}\r\n />\r\n </div>\r\n <ConnectToCalendarModalError\r\n {showStartStopErrorMessage}\r\n {setValidDatesErrorMessage}\r\n {showStartInvalidMessage}\r\n {showStopInvalidMessage}\r\n {i18n}\r\n />\r\n <ConnectToCalendarSelector\r\n bind:availableEvents\r\n {i18n}\r\n on:firstEventIdBySelection={changeFirstEventId}\r\n />\r\n {#if showEmptyState}\r\n <EmptyState\r\n iconName=\"events\"\r\n title={i18n.connectToCalendarEmptyStateHeading}\r\n description={i18n.connectToCalendarEmptyStateDescription}\r\n showLink={true}\r\n linkText={i18n.connectToCalendarEmptyStateLinkText}\r\n href={config.calendarUrl}\r\n />\r\n {/if}\r\n </div>\r\n </Modal>\r\n</div>\r\n\r\n<script>\r\n import DatePickerField from \"@itslearning/prometheus/assets/inputs/DatePickerField/v1/DatePickerField.svelte\";\r\n import Modal from \"@itslearning/prometheus/assets/modals/Modal/v2/Modal.svelte\";\r\n import Banner from \"@itslearning/prometheus/assets/feedback/Banner/v1/Banner.svelte\";\r\n import EmptyState from \"@itslearning/prometheus/assets/nodes/EmptyState/v1/EmptyState.svelte\";\r\n import ConnectToCalendarModalError from \"./ConnectToCalendarModalError.svelte\";\r\n import ConnectToCalendarSelector from \"./ConnectToCalendarSelector.svelte\";\r\n import config from \"../../config\";\r\n import { dateTimePickerModalFromSection, dateTimePickerModalToSection } from \"../../constants\";\r\n import {\r\n formatDateOnlyForApi,\r\n getEventsDateRangeString,\r\n validateDateFormat\r\n } from \"../../helpers/dateHelper\";\r\n import { createEventDispatcher, onMount } from \"svelte\";\r\n import { getCalendarAvailableDates } from \"../../api\";\r\n\r\n export let showConnectToCalendarModal;\r\n export let i18n;\r\n export let planIds;\r\n\r\n let dateValueFrom;\r\n let dateValueFromInitially;\r\n let datePickerFromExpanded = false;\r\n let dateValueTo;\r\n let dateValueToInitially;\r\n let datePickerToExpanded = false;\r\n\r\n let mountComplete = false;\r\n let showStartStopErrorMessage = false;\r\n let setValidDatesErrorMessage = false;\r\n let showStartInvalidMessage = false;\r\n let showStopInvalidMessage = false;\r\n let showEmptyState = false;\r\n\r\n let allEvents = [];\r\n let availableEvents = [];\r\n let highlightedDates = [];\r\n\r\n let firstEventId = undefined;\r\n let bannerVisible = false;\r\n\r\n const dateFormat = config.currentDateFormat;\r\n\r\n const dispatch = createEventDispatcher();\r\n\r\n $: showEmptyState =\r\n !firstEventId &&\r\n dateValueFrom &&\r\n dateValueTo &&\r\n !showStartStopErrorMessage &&\r\n !showStartInvalidMessage &&\r\n !showStopInvalidMessage &&\r\n !setValidDatesErrorMessage;\r\n\r\n $: {\r\n const datePickerFrom = dateValueFrom ? new Date(dateValueFrom) : undefined;\r\n const datePickerTo = dateValueTo ? new Date(dateValueTo) : undefined;\r\n\r\n if (!datePickerFrom || !datePickerTo) {\r\n showStartStopErrorMessage = false;\r\n showStartInvalidMessage = false;\r\n showStopInvalidMessage = false;\r\n } else {\r\n // Use epoch time to compare time (ms since 1970)\r\n const epochStart = datePickerFrom.valueOf();\r\n const epochStop = datePickerTo.valueOf();\r\n\r\n setValidDatesErrorMessage = false;\r\n showStartInvalidMessage = false;\r\n showStopInvalidMessage = false;\r\n showStartStopErrorMessage = epochStart > epochStop;\r\n }\r\n }\r\n\r\n $: if (\r\n mountComplete &&\r\n dateValueFrom &&\r\n dateValueFromInitially !== dateValueFrom &&\r\n !datePickerFromExpanded\r\n ) {\r\n getCourseEventsInCurrentTimespan(false);\r\n }\r\n\r\n $: if (\r\n mountComplete &&\r\n dateValueTo &&\r\n dateValueToInitially !== dateValueTo &&\r\n !datePickerToExpanded\r\n ) {\r\n getCourseEventsInCurrentTimespan(false);\r\n }\r\n\r\n onMount(async () => {\r\n dateValueFrom = new Date(Date.now());\r\n\r\n await getAllCourseEvents();\r\n\r\n mountComplete = true;\r\n });\r\n\r\n function connectToCalendarModalClicked(event) {\r\n if (event.detail.confirmed === true) {\r\n if (!dateValueFrom || !dateValueTo) {\r\n setValidDatesErrorMessage = true;\r\n showConnectToCalendarModal = true;\r\n } else {\r\n setValidDatesErrorMessage = false;\r\n\r\n const datePickerFrom = new Date(dateValueFrom);\r\n const datePickerTo = new Date(dateValueTo);\r\n\r\n const fromDatePickerInputField = \"prom-input-date-picker-from-input\";\r\n const toDatePickerInputField = \"prom-input-date-picker-to-input\";\r\n\r\n const dateFrom = document.getElementById(fromDatePickerInputField).value;\r\n const dateTo = document.getElementById(toDatePickerInputField).value;\r\n\r\n const validateDateToFormat = validateDateFormat(dateTo, dateFormat);\r\n const validateDateFromFormat = validateDateFormat(dateFrom, dateFormat);\r\n\r\n if (!validateDateFromFormat) {\r\n showStartInvalidMessage = true;\r\n showStopInvalidMessage = false;\r\n showConnectToCalendarModal = true;\r\n\r\n return;\r\n }\r\n\r\n if (!validateDateToFormat) {\r\n showStopInvalidMessage = true;\r\n showStartInvalidMessage = false;\r\n showConnectToCalendarModal = true;\r\n\r\n return;\r\n }\r\n\r\n if (!firstEventId) {\r\n bannerVisible = true;\r\n showConnectToCalendarModal = true;\r\n\r\n return;\r\n }\r\n\r\n // Only whole days\r\n datePickerFrom.setHours(0, 1);\r\n datePickerTo.setHours(23, 59);\r\n\r\n // Use epoch time to compare time (ms since 1970)\r\n const epochStart = datePickerFrom.valueOf();\r\n const epochStop = datePickerTo.valueOf();\r\n\r\n // We need to check that the selected time is valid as well\r\n showStartStopErrorMessage = epochStart > epochStop ? true : false;\r\n\r\n if (showStartStopErrorMessage) {\r\n showConnectToCalendarModal = true;\r\n }\r\n\r\n if (firstEventId > 0) {\r\n // Only possible to have one item in new planner (despite use of array)\r\n const activityArray = [];\r\n\r\n activityArray.push(firstEventId.toString());\r\n\r\n dispatch(\"connectToCalendar\", {\r\n activityIds: activityArray\r\n });\r\n }\r\n }\r\n } else {\r\n dispatch(\"close\");\r\n }\r\n }\r\n\r\n // Function to get course events in the currently selected timespan\r\n // As long as selected start or stop time is within event range it should also appear\r\n function getCourseEventsInCurrentTimespan(setConnectingEvents) {\r\n const datePickerFrom = dateValueFrom ? new Date(dateValueFrom) : undefined;\r\n const datePickerTo = dateValueTo ? new Date(dateValueTo) : undefined;\r\n\r\n if (!datePickerFrom || !datePickerTo) {\r\n return;\r\n }\r\n\r\n // Only whole days\r\n datePickerFrom.setHours(0, 1);\r\n datePickerTo.setHours(23, 59);\r\n\r\n const updatedAvailableEvents = [];\r\n\r\n allEvents.forEach(function (event) {\r\n if (\r\n (datePickerFrom >= event.eventFrom && datePickerFrom <= event.eventTo) ||\r\n (datePickerTo >= event.eventFrom && datePickerTo <= event.eventTo) ||\r\n (event.eventFrom >= datePickerFrom && event.eventTo <= datePickerTo)\r\n ) {\r\n updatedAvailableEvents.push({\r\n eventId: event.eventId,\r\n eventOccupied: event.eventOccupied,\r\n eventConnected: setConnectingEvents ? event.eventConnected : false,\r\n eventDate: event.eventDate,\r\n eventTitle: event.eventTitle,\r\n groupId: event.groupId,\r\n participants: event.participants,\r\n eventFrom: event.eventFrom,\r\n eventTo: event.eventTo\r\n });\r\n }\r\n });\r\n availableEvents = updatedAvailableEvents;\r\n }\r\n\r\n // Function to get all available course events\r\n async function getAllCourseEvents() {\r\n if (!config.hasFunctionalityCalendar) {\r\n return;\r\n }\r\n\r\n const datePickerMin = new Date(1999, 1, 1);\r\n const datePickerMax = new Date(2999, 12, 31);\r\n\r\n formatDateOnlyForApi(datePickerMin, datePickerMax);\r\n\r\n const events = await getCalendarAvailableDates(datePickerMin, datePickerMax);\r\n\r\n const pickerHighlightedDates = [];\r\n const allCourseEvents = [];\r\n\r\n let multipleDaysPlan = false;\r\n let firstEventStartDate = null;\r\n let firstEventStopDate = null;\r\n\r\n if (events.length > 0) {\r\n firstEventStartDate = new Date(events[0].Start);\r\n firstEventStopDate = new Date(events[0].Stop);\r\n\r\n if (firstEventStartDate != firstEventStopDate) {\r\n multipleDaysPlan = true;\r\n }\r\n }\r\n\r\n // Check if any of the dates differs so we need to include date (in addition to time)\r\n if (firstEventStartDate && !multipleDaysPlan) {\r\n let curentEventStartDate = null;\r\n let currentEventStopDate = null;\r\n\r\n events.forEach(function (event) {\r\n curentEventStartDate = new Date(event.Start);\r\n currentEventStopDate = new Date(event.Stop);\r\n\r\n if (\r\n curentEventStartDate !== firstEventStartDate ||\r\n currentEventStopDate !== firstEventStartDate\r\n ) {\r\n multipleDaysPlan = true;\r\n }\r\n });\r\n }\r\n\r\n events.forEach(function (event) {\r\n const eventFrom = event.Start ? new Date(event.Start) : undefined;\r\n const eventTo = event.Stop ? new Date(event.Stop) : undefined;\r\n\r\n if (eventFrom && eventTo) {\r\n const formattedDate = getEventsDateRangeString(\r\n eventFrom,\r\n eventTo,\r\n config.locale,\r\n multipleDaysPlan\r\n );\r\n\r\n let isOccupied = false;\r\n let isConnected = false;\r\n\r\n if (event.PlanId === config.planId) {\r\n isConnected = true;\r\n } else {\r\n if (event.PlanId && event.PlanId !== 0 && !event.PlanDeleted) {\r\n isOccupied = true;\r\n }\r\n }\r\n\r\n allCourseEvents.push({\r\n eventId: event.EventId,\r\n eventOccupied: isOccupied,\r\n eventConnected: isConnected,\r\n eventDate: formattedDate,\r\n eventTitle: event.EventTitle,\r\n groupId: event.GroupId,\r\n participants: event.GroupTitle,\r\n eventFrom: eventFrom,\r\n eventTo: eventTo\r\n });\r\n\r\n if (\r\n event &&\r\n (event.PlanId === 0 || event.PlanId === config.planId || event.PlanDeleted)\r\n ) {\r\n const epochStart = eventFrom.valueOf();\r\n const epochStop = eventTo.valueOf();\r\n\r\n const dayCounter = Math.floor((epochStop - epochStart) / (1000 * 60 * 60 * 24));\r\n\r\n if (dayCounter > 0) {\r\n for (let i = 0; i <= dayCounter; i++) {\r\n const currentDatePointer = new Date();\r\n\r\n currentDatePointer.setTime(epochStart + i * (1000 * 60 * 60 * 24));\r\n pickerHighlightedDates.push(currentDatePointer);\r\n }\r\n } else {\r\n pickerHighlightedDates.push(eventFrom);\r\n }\r\n }\r\n }\r\n });\r\n highlightedDates = pickerHighlightedDates;\r\n allEvents = allCourseEvents;\r\n getCourseEventsInCurrentTimespan(true);\r\n }\r\n\r\n function changeFirstEventId(event) {\r\n firstEventId = event.detail.firstEventId;\r\n bannerVisible = false;\r\n }\r\n</script>\r\n","<Modal\r\n id=\"show-copy-plans-confirm-modal-id\"\r\n bind:enabled={showCopyConfirmModal}\r\n titleText={i18n.copy}\r\n confirmText={i18n.close}\r\n showCancel={false}\r\n on:close={close}\r\n>\r\n <div slot=\"body\">\r\n <!-- eslint-disable-next-line svelte/no-at-html-tags -->\r\n <div class=\"copy-plans-confirm-modal__body\">{@html confirmModalBody}</div>\r\n <Banner visible={bannerVisible} type=\"warning\" closable={false} html={bannerText} />\r\n </div>\r\n</Modal>\r\n\r\n<script>\r\n import Modal from \"@itslearning/prometheus/assets/modals/Modal/v2/Modal.svelte\";\r\n import Banner from \"@itslearning/prometheus/assets/feedback/Banner/v1/Banner.svelte\";\r\n import { createEventDispatcher } from \"svelte\";\r\n\r\n export let showCopyConfirmModal;\r\n export let confirmModalBody;\r\n export let i18n;\r\n export let bannerVisible;\r\n export let bannerText;\r\n\r\n const dispatch = createEventDispatcher();\r\n\r\n function close() {\r\n dispatch(\"close\");\r\n }\r\n</script>\r\n","<span {hourId} {hourLabel} {minuteId} {isDisabled} class=\"time-select-section\">\r\n {#if config.useTwelveHourFormat}\r\n <span>\r\n <Select label={hourLabel} bind:value={hours} disabled={isDisabled}>\r\n {#each twelvehoursArray as hour}\r\n <option value={hour}>\r\n {hour}\r\n </option>\r\n {/each}\r\n </Select>\r\n </span>\r\n {:else}\r\n <span>\r\n <Select label={hourLabel} id={hourId} bind:value={hours} disabled={isDisabled}>\r\n {#each hoursArray as hour}\r\n <option value={hour}>\r\n {hour}\r\n </option>\r\n {/each}\r\n </Select>\r\n </span>\r\n {/if}\r\n <span>\r\n <Select label={minuteLabel} id={minuteId} bind:value={minutes} disabled={isDisabled}>\r\n {#each minutesArray as minute}\r\n <option value={minute}>\r\n {minute}\r\n </option>\r\n {/each}\r\n </Select>\r\n </span>\r\n {#if config.useTwelveHourFormat}\r\n <span class=\"time-select-section__period\">\r\n <Select label={periodLabel} id={periodId} bind:value={isPMstr} disabled={isDisabled}>\r\n <option value=\"false\"> AM </option>\r\n <option value=\"true\"> PM </option>\r\n </Select>\r\n </span>\r\n {/if}\r\n</span>\r\n\r\n<script>\r\n import Select from \"@itslearning/prometheus/assets/inputs/Select/v1/Select.svelte\";\r\n\r\n const hoursArray = [\r\n \"00\",\r\n \"01\",\r\n \"02\",\r\n \"03\",\r\n \"04\",\r\n \"05\",\r\n \"06\",\r\n \"07\",\r\n \"08\",\r\n \"09\",\r\n \"10\",\r\n \"11\",\r\n \"12\",\r\n \"13\",\r\n \"14\",\r\n \"15\",\r\n \"16\",\r\n \"17\",\r\n \"18\",\r\n \"19\",\r\n \"20\",\r\n \"21\",\r\n \"22\",\r\n \"23\"\r\n ];\r\n const twelvehoursArray = [\r\n \"12\",\r\n \"01\",\r\n \"02\",\r\n \"03\",\r\n \"04\",\r\n \"05\",\r\n \"06\",\r\n \"07\",\r\n \"08\",\r\n \"09\",\r\n \"10\",\r\n \"11\"\r\n ];\r\n const minutesArray = [\"00\", \"05\", \"10\", \"15\", \"20\", \"25\", \"30\", \"35\", \"40\", \"45\", \"50\", \"55\"];\r\n\r\n export let hourId;\r\n export let hourLabel;\r\n export let minuteId;\r\n export let minuteLabel;\r\n export let periodId;\r\n export let periodLabel;\r\n export let hours;\r\n export let minutes;\r\n export let isPM;\r\n export let isDisabled;\r\n export let config;\r\n\r\n let isPMstr = isPM ? \"true\" : \"false\"; // For the first load, the boolean received is converted to string.\r\n\r\n $: {\r\n // This is needed as the value in the Select component cannot accept booleans (see prometheus rep.).\r\n if (isPMstr === \"true\") {\r\n isPM = true;\r\n } else {\r\n isPM = false;\r\n }\r\n }\r\n</script>\r\n","<div\r\n class=\"datetime-picker-modal__error\"\r\n aria-live=\"assertive\"\r\n role=\"alert\"\r\n hidden={setValidDatesErrorMessage ? \"\" : \"hidden\"}\r\n>\r\n {i18n.youMustSetValidDates}\r\n</div>\r\n<div\r\n class=\"datetime-picker-modal__error\"\r\n aria-live=\"assertive\"\r\n role=\"alert\"\r\n hidden={showStartStopErrorMessage || showStartInvalidMessage || showStopInvalidMessage\r\n ? \"\"\r\n : \"hidden\"}\r\n>\r\n {showStartStopErrorMessage\r\n ? i18n.errorStopDateLessThanStartDate\r\n : showStartInvalidMessage\r\n ? i18n.calendar_Recurring_invalid_from_date\r\n : i18n.calendar_Recurring_invalid_to_date}\r\n</div>\r\n<div\r\n class=\"datetime-picker-modal__error\"\r\n aria-live=\"assertive\"\r\n role=\"alert\"\r\n hidden={showRecurrenceErrorMessage ? \"\" : \"hidden\"}\r\n>\r\n {i18n.recurrence_TimeIntervalIsTooBig}\r\n</div>\r\n\r\n<script>\r\n export let showStartStopErrorMessage;\r\n export let setValidDatesErrorMessage;\r\n export let showStartInvalidMessage;\r\n export let showStopInvalidMessage;\r\n export let showRecurrenceErrorMessage;\r\n export let i18n;\r\n</script>\r\n","<div class=\"set-dates-modal\">\r\n <Modal\r\n id=\"set-dates-modal-id\"\r\n bind:enabled={showSetDatesModal}\r\n titleText={i18n.setDate}\r\n confirmText={i18n.save}\r\n cancelText={i18n.cancel}\r\n on:close={setDatesModalClicked}\r\n >\r\n <div slot=\"body\">\r\n <h2 class=\"set-dates-modal-section__heading\">{i18n.dateOfFirstPlan}</h2>\r\n <div class={dateTimePickerModalFromSection}>\r\n <DatePickerField\r\n bind:value={dateValueFrom}\r\n bind:expanded={datePickerFromExpanded}\r\n firstDayOfWeek={config.firstDayOfWeek}\r\n locale={config.locale}\r\n id=\"date-picker-from\"\r\n label={i18n.datePickerLabelStart}\r\n labelPosition=\"left\"\r\n placeholder={i18n.datePickerPlaceholder}\r\n format={dateFormat}\r\n closeOnSelect={true}\r\n {i18n}\r\n on:select={dataSelected}\r\n />\r\n {#if dateTimeSet && showTimeSelector}\r\n <TimeSelector\r\n hourLabel={i18n.hour}\r\n minuteLabel={i18n.minute}\r\n periodLabel=\" \"\r\n {config}\r\n bind:hours={hoursFrom}\r\n bind:minutes={minutesFrom}\r\n bind:isPM={isPMFrom}\r\n bind:dateTimeSet\r\n bind:isDisabled={isTimeSpanDisabled}\r\n />\r\n {:else}\r\n <Button\r\n type=\"plain\"\r\n htmlType=\"button\"\r\n text={i18n.setTime}\r\n on:click={toggleTimeSpanSetting}\r\n />\r\n {/if}\r\n </div>\r\n <div class={dateTimePickerModalToSection}>\r\n <DatePickerField\r\n bind:value={dateValueTo}\r\n bind:expanded={datePickerToExpanded}\r\n firstDayOfWeek={config.firstDayOfWeek}\r\n locale={config.locale}\r\n id=\"date-picker-to\"\r\n label={i18n.datePickerLabelStop}\r\n labelPosition=\"left\"\r\n placeholder={i18n.datePickerPlaceholder}\r\n format={dateFormat}\r\n closeOnSelect={true}\r\n {i18n}\r\n on:select={dataSelected}\r\n />\r\n {#if dateTimeSet && showTimeSelector}\r\n <TimeSelector\r\n hourLabel={i18n.hour}\r\n minuteLabel={i18n.minute}\r\n periodLabel=\" \"\r\n {config}\r\n bind:hours={hoursTo}\r\n bind:minutes={minutesTo}\r\n bind:isPM={isPMTo}\r\n bind:dateTimeSet\r\n bind:isDisabled={isTimeSpanDisabled}\r\n />\r\n {:else}\r\n <Button\r\n type=\"plain\"\r\n htmlType=\"button\"\r\n text={i18n.setTime}\r\n on:click={toggleTimeSpanSetting}\r\n />\r\n {/if}\r\n\r\n <SetDatesModalError\r\n {showStartStopErrorMessage}\r\n {setValidDatesErrorMessage}\r\n {showStartInvalidMessage}\r\n {showStopInvalidMessage}\r\n {showRecurrenceErrorMessage}\r\n {i18n}\r\n />\r\n </div>\r\n\r\n <h2 class=\"set-dates-modal-section__heading\">{i18n.recurrence}</h2>\r\n {#if isRecurrenceSectionVisible}\r\n <div class=\"set-dates-modal-section__options\">\r\n <Select label={i18n.every} bind:value={weeksDropDownValue}>\r\n {#each recurrenceArray.slice(weekCount) as recurrence}\r\n <!-- The content of the dropdown changes according to the selected interval of dates -->\r\n <option value={recurrence}>\r\n {recurrence}\r\n </option>\r\n {/each}\r\n </Select>\r\n <span>{i18n.on}</span>\r\n </div>\r\n <div class=\"set-dates-modal-section__checkbox-group\">\r\n <!-- All checkboxes are disabled if the selected interval is more than a day. Otherwise only the checkbox for that weekday is disabled.-->\r\n {#each daysArray as day}\r\n {#if !day.disabled}\r\n <!--Not disabled-->\r\n <Checkbox\r\n label={day.text}\r\n bind:checked={day.checked}\r\n disabled={day.disabled}\r\n small\r\n />\r\n {:else}\r\n <Checkbox\r\n label={day.text}\r\n checked={day.checked}\r\n disabled={true}\r\n small\r\n />\r\n {/if}\r\n {/each}\r\n </div>\r\n {#if currentDayDiff > 0}\r\n <div class=\"set-dates-modal-section__info\">\r\n {i18n.recurrence_BothDatesSelectedInfoMessage}\r\n </div>\r\n {/if}\r\n {:else}\r\n <div class=\"set-dates-modal-section__info\">\r\n {i18n.recurrence_PlanDateNotSetWarning}\r\n </div>\r\n {/if}\r\n </div>\r\n </Modal>\r\n</div>\r\n\r\n<script>\r\n import Button from \"@itslearning/prometheus/assets/inputs/Button/v1/Button.svelte\";\r\n import Checkbox from \"@itslearning/prometheus/assets/inputs/Checkbox/v1/Checkbox.svelte\";\r\n import DatePickerField from \"@itslearning/prometheus/assets/inputs/DatePickerField/v1/DatePickerField.svelte\";\r\n import Modal from \"@itslearning/prometheus/assets/modals/Modal/v2/Modal.svelte\";\r\n import Select from \"@itslearning/prometheus/assets/inputs/Select/v1/Select.svelte\";\r\n import TimeSelector from \"../DateTimePicker/TimeSelector.svelte\";\r\n import SetDatesModalError from \"./SetDatesModalError.svelte\";\r\n import config from \"../../config\";\r\n import {\r\n isDateOnlyMode,\r\n validateDateFormat,\r\n initAutoSuggestFromDate,\r\n initAutoSuggestToDate\r\n } from \"../../helpers/dateHelper\";\r\n import {\r\n defaultFromHour,\r\n defaultToHour,\r\n weekDays,\r\n dateTimePickerModalFromSection,\r\n dateTimePickerModalToSection,\r\n fromDatePickerInputField,\r\n toDatePickerInputField\r\n } from \"../../constants\";\r\n import { createEventDispatcher, onMount } from \"svelte\";\r\n\r\n export let showSetDatesModal;\r\n export let i18n;\r\n\r\n let dateValueFrom;\r\n let dateValueFromInitially;\r\n let datePickerFromExpanded = false;\r\n let dateValueTo;\r\n let dateValueToInitially;\r\n let datePickerToExpanded = false;\r\n\r\n // Default time selection will be 08-16 or 08 AM-04 PM if using 12h format\r\n let hoursFrom = defaultFromHour;\r\n let minutesFrom = \"00\";\r\n let isPMFrom = false;\r\n let hoursTo = defaultToHour;\r\n let minutesTo = \"00\";\r\n let isPMTo = false;\r\n\r\n let mountComplete = false;\r\n let showStartStopErrorMessage = false;\r\n let setValidDatesErrorMessage = false;\r\n let showStartInvalidMessage = false;\r\n let showStopInvalidMessage = false;\r\n let showTimeSelector = false;\r\n let dateTimeSet = false;\r\n let isTimeSpanDisabled = true;\r\n\r\n let weeksDropDownValue;\r\n let daysArray = [\r\n { const: weekDays.Sunday, text: i18n.sunday, checked: false, disabled: false },\r\n { const: weekDays.Monday, text: i18n.monday, checked: false, disabled: false },\r\n { const: weekDays.Tuesday, text: i18n.tuesday, checked: false, disabled: false },\r\n { const: weekDays.Wednesday, text: i18n.wednesday, checked: false, disabled: false },\r\n { const: weekDays.Thursday, text: i18n.thursday, checked: false, disabled: false },\r\n { const: weekDays.Friday, text: i18n.friday, checked: false, disabled: false },\r\n { const: weekDays.Saturday, text: i18n.saturday, checked: false, disabled: false }\r\n ];\r\n\r\n const recurrenceArray = [\r\n i18n.week,\r\n i18n.week2,\r\n i18n.week3,\r\n i18n.week4,\r\n i18n.week5,\r\n i18n.week6,\r\n i18n.week7,\r\n i18n.week8,\r\n i18n.week9,\r\n i18n.week10\r\n ];\r\n\r\n const dateFormat = config.currentDateFormat;\r\n\r\n const dispatch = createEventDispatcher();\r\n\r\n $: isTimeSpanDisabled = !showTimeSelector;\r\n\r\n $: isRecurrenceSectionVisible =\r\n dateValueFrom &&\r\n dateValueTo &&\r\n !showStartStopErrorMessage &&\r\n !showStartInvalidMessage &&\r\n !showStopInvalidMessage &&\r\n !showRecurrenceErrorMessage;\r\n\r\n $: currentDayDiff =\r\n dateValueFrom && dateValueTo\r\n ? Math.floor((dateValueTo - dateValueFrom) / (1000 * 60 * 60 * 24))\r\n : -1;\r\n\r\n $: weekCount = currentDayDiff !== -1 ? Math.floor(currentDayDiff / daysArray.length) : 0;\r\n\r\n $: showRecurrenceErrorMessage = currentDayDiff > 0 && weekCount >= 10 ? true : false; // Recurrence can be set only when the date interval is less than 10 weeks\r\n\r\n $: {\r\n const datePickerFrom = dateValueFrom ? new Date(dateValueFrom) : undefined;\r\n const datePickerTo = dateValueTo ? new Date(dateValueTo) : undefined;\r\n\r\n if (!datePickerFrom || !datePickerTo) {\r\n showStartStopErrorMessage = false;\r\n } else {\r\n insertHoursAndMinutes(datePickerFrom, datePickerTo);\r\n\r\n // Use epoch time to compare time (ms since 1970)\r\n const epochStart = datePickerFrom.valueOf();\r\n const epochStop = datePickerTo.valueOf();\r\n\r\n setValidDatesErrorMessage = false;\r\n showStartStopErrorMessage = epochStart > epochStop ? true : false;\r\n }\r\n }\r\n\r\n $: if (\r\n mountComplete &&\r\n dateValueFrom &&\r\n dateValueFromInitially !== dateValueFrom &&\r\n !datePickerFromExpanded\r\n ) {\r\n checkAutoSuggestToDate();\r\n }\r\n\r\n $: if (\r\n mountComplete &&\r\n dateValueTo &&\r\n dateValueToInitially !== dateValueTo &&\r\n !datePickerToExpanded\r\n ) {\r\n checkAutoSuggestFromDate();\r\n }\r\n\r\n onMount(() => {\r\n if (dateTimeSet === true && !isDateOnlyMode(parseInt(minutesFrom), parseInt(minutesTo))) {\r\n showTimeSelector = true;\r\n isTimeSpanDisabled = false;\r\n } else {\r\n showTimeSelector = false;\r\n isTimeSpanDisabled = true;\r\n }\r\n\r\n dateValueFromInitially = dateValueFrom;\r\n initAutoSuggestFromDate(dateValueFrom, dateValueTo, dateValueFromInitially);\r\n\r\n dateValueToInitially = dateValueTo;\r\n initAutoSuggestToDate(dateValueFrom, dateValueTo, dateValueToInitially);\r\n\r\n // Decide daysarray order according to config.firstDayOfWeek\r\n daysArray = rotateArray(daysArray, config.firstDayOfWeek);\r\n\r\n mountComplete = true;\r\n });\r\n\r\n function checkAutoSuggestFromDate() {\r\n if (dateValueTo && !dateValueFromInitially) {\r\n dateValueFrom = dateValueTo;\r\n updateDaysArray(dateValueFrom);\r\n }\r\n\r\n dateValueFromInitially = dateValueFrom;\r\n }\r\n\r\n function checkAutoSuggestToDate() {\r\n const dateFrom = document.getElementById(fromDatePickerInputField).value;\r\n\r\n if (!validateDateFormat(dateFrom, config.currentDateFormat)) {\r\n return;\r\n }\r\n\r\n if (dateValueFrom && (!dateValueToInitially || dateValueFrom > dateValueTo)) {\r\n dateValueTo = dateValueFrom;\r\n updateDaysArray(dateValueTo);\r\n }\r\n\r\n dateValueToInitially = dateValueTo;\r\n }\r\n\r\n function rotateArray(array, position) {\r\n for (let i = 0; i < position; i++) {\r\n array.push(array.shift());\r\n }\r\n\r\n return array;\r\n }\r\n\r\n // Case 1: when clicking outside the DatePicker, the autosuggest picks the same date for both fields.\r\n // Case 2: first modal load, one date is selected, the other date is still undefined.\r\n // Action: we consider this case as if the same day is selected and update daysArray.\r\n function updateDaysArray(dateValue) {\r\n const datePicker = dateValue ? new Date(dateValue) : undefined;\r\n\r\n if (datePicker) {\r\n const checkedDay =\r\n (datePicker.getDay() - config.firstDayOfWeek + daysArray.length) % daysArray.length;\r\n\r\n if (checkedDay >= 0) {\r\n daysArray[checkedDay].checked = true;\r\n daysArray[checkedDay].disabled = true;\r\n }\r\n }\r\n\r\n daysArray = daysArray; // Needed to trigger the update in the checkboxes\r\n updateweeksDropDownValue();\r\n }\r\n\r\n // When the weeks dropdown updates without the user selecting an option, \"weeksDropDownValue\" needs to be updated too, otherwise it will always be \"Week\".\r\n function updateweeksDropDownValue() {\r\n if (currentDayDiff > 0) {\r\n // More than one day interval\r\n weeksDropDownValue = recurrenceArray.slice(weekCount)[0];\r\n }\r\n }\r\n\r\n function toggleTimeSpanSetting() {\r\n if (showTimeSelector === true) {\r\n showTimeSelector = false;\r\n } else {\r\n if (isDateOnlyMode(parseInt(minutesFrom), parseInt(minutesTo))) {\r\n hoursFrom = defaultFromHour;\r\n minutesFrom = \"00\";\r\n hoursTo = defaultToHour;\r\n minutesTo = \"00\";\r\n }\r\n\r\n showTimeSelector = true;\r\n }\r\n\r\n dateTimeSet = showTimeSelector;\r\n }\r\n\r\n function dataSelected() {\r\n // Filtering the week days included in the selected interval. These days will be checked and disabled.\r\n const datePickerFrom = dateValueFrom ? new Date(dateValueFrom) : undefined;\r\n const datePickerTo = dateValueTo ? new Date(dateValueTo) : undefined;\r\n\r\n // Reset\r\n daysArray.map(d => (d.checked = false));\r\n daysArray.map(d => (d.disabled = false));\r\n\r\n if (!datePickerFrom || !datePickerTo) {\r\n // First modal load, one date is selected, the other date is still undefined, so we consider this case as if the same day is selected.\r\n if (datePickerFrom) updateDaysArray(datePickerFrom);\r\n if (datePickerTo) updateDaysArray(datePickerTo);\r\n }\r\n\r\n if (datePickerFrom && datePickerTo) {\r\n // Same logic as old planner\r\n const startDay =\r\n (datePickerFrom.getDay() - config.firstDayOfWeek + daysArray.length) %\r\n daysArray.length;\r\n const stopDay =\r\n (datePickerTo.getDay() - config.firstDayOfWeek + daysArray.length) %\r\n daysArray.length;\r\n\r\n if (isTheSameDay(datePickerFrom, datePickerTo)) {\r\n daysArray[startDay].checked = true;\r\n daysArray[startDay].disabled = true;\r\n } else {\r\n if (\r\n currentDayDiff >= daysArray.length ||\r\n (currentDayDiff === daysArray.length - 1 && startDay === stopDay)\r\n ) {\r\n daysArray.map(d => (d.checked = true));\r\n } else {\r\n if (startDay < stopDay) {\r\n for (let i = startDay; i <= stopDay; i++) {\r\n daysArray[i].checked = true;\r\n }\r\n }\r\n\r\n if (startDay > stopDay) {\r\n for (let i = 0; i <= stopDay; i++) {\r\n daysArray[i].checked = true;\r\n }\r\n\r\n for (let i = startDay; i < daysArray.length; i++) {\r\n daysArray[i].checked = true;\r\n }\r\n }\r\n }\r\n\r\n daysArray.map(d => (d.disabled = true));\r\n }\r\n }\r\n\r\n daysArray = daysArray; // Needed to trigger the update in the checkboxes\r\n updateweeksDropDownValue();\r\n }\r\n\r\n function isTheSameDay(start, stop) {\r\n return (\r\n start &&\r\n stop &&\r\n start.getFullYear() === stop.getFullYear() &&\r\n start.getMonth() === stop.getMonth() &&\r\n start.getDate() === stop.getDate()\r\n );\r\n }\r\n\r\n function insertHoursAndMinutes(datePickerFrom, datePickerTo) {\r\n if (showTimeSelector) {\r\n let hoursFromVal = parseInt(hoursFrom);\r\n\r\n if (config.useTwelveHourFormat) {\r\n if (hoursFromVal === 12) {\r\n hoursFromVal = 0;\r\n }\r\n\r\n if (isPMFrom) {\r\n hoursFromVal = hoursFromVal + 12;\r\n }\r\n }\r\n\r\n datePickerFrom.setHours(hoursFromVal, parseInt(minutesFrom));\r\n\r\n let hoursToVal = parseInt(hoursTo);\r\n\r\n if (config.useTwelveHourFormat) {\r\n if (hoursToVal === 12) {\r\n hoursToVal = 0;\r\n }\r\n\r\n if (isPMTo) {\r\n hoursToVal = hoursToVal + 12;\r\n }\r\n }\r\n\r\n datePickerTo.setHours(hoursToVal, parseInt(minutesTo));\r\n } else {\r\n datePickerFrom.setHours(0, 1);\r\n datePickerTo.setHours(23, 59);\r\n }\r\n }\r\n\r\n function setDatesModalClicked(event) {\r\n if (event.detail.confirmed === true) {\r\n if (!dateValueFrom || !dateValueTo) {\r\n setValidDatesErrorMessage = true;\r\n showSetDatesModal = true;\r\n } else {\r\n setValidDatesErrorMessage = false;\r\n\r\n const datePickerFrom = new Date(dateValueFrom);\r\n const datePickerTo = new Date(dateValueTo);\r\n\r\n const dateFrom = document.getElementById(fromDatePickerInputField).value;\r\n const dateTo = document.getElementById(toDatePickerInputField).value;\r\n\r\n const validateDateToFormat = validateDateFormat(dateTo, dateFormat);\r\n const validateDateFromFormat = validateDateFormat(dateFrom, dateFormat);\r\n\r\n if (!validateDateFromFormat) {\r\n showStartInvalidMessage = true;\r\n showStopInvalidMessage = false;\r\n\r\n return;\r\n }\r\n\r\n if (!validateDateToFormat) {\r\n showStopInvalidMessage = true;\r\n showStartInvalidMessage = false;\r\n\r\n return;\r\n }\r\n\r\n insertHoursAndMinutes(datePickerFrom, datePickerTo);\r\n\r\n // Use epoch time to compare time (ms since 1970)\r\n const epochStart = datePickerFrom.valueOf();\r\n const epochStop = datePickerTo.valueOf();\r\n\r\n showStartStopErrorMessage = epochStart > epochStop ? true : false; // We need to check that the selected time is valid as well\r\n\r\n if (showStartStopErrorMessage || showRecurrenceErrorMessage) {\r\n showSetDatesModal = true;\r\n }\r\n\r\n if (!showStartStopErrorMessage && !showRecurrenceErrorMessage) {\r\n const checkedDays = daysArray.filter(d => d.checked);\r\n\r\n dispatch(\"setDates\", {\r\n start: datePickerFrom,\r\n stop: datePickerTo,\r\n weekDaysAPI: checkedDays.map(d => d.const),\r\n weekNumber: recurrenceArray.indexOf(weeksDropDownValue) + 1 // The existing endpoint requires numbers to start from 1\r\n });\r\n }\r\n }\r\n } else {\r\n dispatch(\"close\");\r\n }\r\n }\r\n</script>\r\n","// @ts-check\r\n\r\n/**\r\n * @module network/kpi\r\n */\r\n\r\nimport { post } from './fetch';\r\n\r\n/**\r\n * Fires a POST to register a kpi\r\n * @param {object} options\r\n * @param {string} options.url - the url of the kpi service\r\n * @param {string} options.section - the kpi section\r\n * @param {string} options.measurement - the kpi measurement\r\n * @param {string} options.context - the kpi context\r\n */\r\nexport function postKpi({\r\n url = '/restapi/common/kpi/v1',\r\n section,\r\n measurement,\r\n context = null,\r\n}) {\r\n return post(url, {\r\n measureSection: section,\r\n measurement: measurement,\r\n measureContext: context\r\n });\r\n}\r\n","import config from \"../config\";\r\nimport { postKpi } from \"@itslearning/atlas/network/kpi\";\r\n\r\nexport const postNewPlannerKpi = async measurementId => {\r\n // Failed attempt to post KPI should not intyerrupt interaction with planner.\r\n try {\r\n await postKpi({\r\n url: config.kpi.kpiUrl,\r\n context: config.kpi.kpiContext,\r\n section: config.kpi.kpiSectionNewPlanner,\r\n measurement: measurementId\r\n });\r\n } catch (error) {\r\n // So just log error into browser console.\r\n console.log(error);\r\n }\r\n};\r\n","import { writable } from \"svelte/store\";\r\n\r\n/** @type {import(\"svelte/store\").Writable<any>} */\r\nexport const planData = writable({});\r\n\r\nexport const backLink = writable({ url: \"\", label: \"\" });\r\n\r\nconst defaultPlansData = {\r\n plans: [],\r\n total: 0,\r\n currentPageIndex: 0,\r\n loading: true\r\n};\r\n\r\nconst createPlanFilesStatusStore = () => {\r\n const { subscribe, update } = writable(new Map());\r\n\r\n const updateFileStatus = (file, planId, columnId) =>\r\n update(files => {\r\n files.set(file.name, { ...file, planId, columnId });\r\n\r\n return files;\r\n });\r\n\r\n const dismissError = fileName =>\r\n update(files => {\r\n files.delete(fileName);\r\n\r\n return files;\r\n });\r\n\r\n return {\r\n subscribe,\r\n updateFileStatus,\r\n dismissError\r\n };\r\n};\r\n\r\nconst createPlansStore = () => {\r\n const plansStore = writable(defaultPlansData);\r\n\r\n return {\r\n ...plansStore,\r\n reset: () => plansStore.set(defaultPlansData)\r\n };\r\n};\r\n\r\nexport const planFilesStatus = createPlanFilesStatusStore();\r\n\r\nexport const topicCurrentPlansData = createPlansStore();\r\n\r\nexport const topicWithoutDatePlansData = createPlansStore();\r\n\r\nexport const topicPastPlansData = createPlansStore();\r\n\r\nexport const topicAllPlansData = createPlansStore();\r\n","import {\r\n setPlanDescription,\r\n setPlanTimeSpan,\r\n setPlanWeekAndDay,\r\n updatePlanEvents,\r\n setPlanTitle,\r\n setPlanClassHours,\r\n createPlan,\r\n togglePlansStatus,\r\n createTopic,\r\n connectToTopic,\r\n connectToTopicV2,\r\n moveElementsInTopicFolderForPlan,\r\n getTopic,\r\n removeTopic,\r\n deletePlanElement,\r\n setPlanImage,\r\n removePlanImage,\r\n removePlan,\r\n removePlans,\r\n copyPlans,\r\n setCustomFieldText,\r\n activatePlanElement,\r\n getCourses,\r\n deletePlanElementFromCourse,\r\n setPlansTimeSpan,\r\n setPlansWeekAndDay,\r\n setPlansTimeSpanEvents,\r\n uploadPlanImage,\r\n createPlanV2\r\n} from \"../api\";\r\n\r\nimport { formatDateForApi, formatDateOnlyForApi, isDateOnlyMode } from \"../helpers/dateHelper\";\r\nimport config from \"../config\";\r\nimport { postNewPlannerKpi } from \"../helpers/kpiHelper\";\r\nimport { planData } from \"../logic/planPage/stores\";\r\nimport { getCoursesForCopyPageSize as pageSize } from \"../constants\";\r\n\r\nexport function updatePlanTitle(planId, title) {\r\n return setPlanTitle(planId, title);\r\n}\r\n\r\nexport function updatePlanClassHours(planId, classHours) {\r\n return setPlanClassHours(planId, classHours);\r\n}\r\n\r\nexport async function updatePlanDescription(planId, description) {\r\n const result = await setPlanDescription(planId, description);\r\n\r\n // Use the resulting safeHtml to set the display description\r\n planData.update(data => {\r\n data.plan.displayDescription = result.SafeHtml;\r\n data.plan.isDescriptionPlainText = result.CustomData.isPlainText;\r\n\r\n window.loadIframelyEmbedJs && setTimeout(() => window.loadIframelyEmbedJs(), 100);\r\n\r\n return data;\r\n });\r\n\r\n return result;\r\n}\r\n\r\nfunction getDatesForApi(start, stop) {\r\n let dateOnlyMode;\r\n\r\n if (start && stop) {\r\n if (isDateOnlyMode(start.getUTCMinutes(), stop.getUTCMinutes())) {\r\n start = formatDateOnlyForApi(start);\r\n stop = formatDateOnlyForApi(stop);\r\n dateOnlyMode = true;\r\n } else {\r\n start = formatDateForApi(start);\r\n stop = formatDateForApi(stop);\r\n dateOnlyMode = false;\r\n }\r\n } else {\r\n const emptyDateStr = \"0000-00-00 00:00:00\";\r\n\r\n start = emptyDateStr;\r\n stop = emptyDateStr;\r\n }\r\n\r\n return { start, stop, dateOnlyMode };\r\n}\r\n\r\nexport async function updatePlanDates(planId, start, stop, connectedToEvent, activityIds) {\r\n if (connectedToEvent) {\r\n await updatePlanEvents(planId, activityIds);\r\n } else {\r\n const datesForApi = getDatesForApi(start, stop);\r\n\r\n // clear all connected events\r\n const activityIdArray = [];\r\n\r\n await updatePlanEvents(planId, activityIdArray);\r\n\r\n if (datesForApi.dateOnlyMode) {\r\n await setPlanWeekAndDay(planId, datesForApi.start, datesForApi.stop);\r\n } else {\r\n await setPlanTimeSpan(planId, datesForApi.start, datesForApi.stop);\r\n }\r\n }\r\n}\r\n\r\nexport function createNewPlan(plan) {\r\n const datesForApi = getDatesForApi(plan.start, plan.stop);\r\n\r\n return createPlan({\r\n ...plan,\r\n start: datesForApi.start,\r\n stop: datesForApi.stop\r\n });\r\n}\r\n\r\nexport function setPlanActive(planId, active, toggleElementsActivation) {\r\n return togglePlansStatus([planId], active, toggleElementsActivation, false);\r\n}\r\n\r\nexport const setPlansActive = (\r\n planIds,\r\n active,\r\n toggleElementsActivation,\r\n isBulkAction = true,\r\n executeForAllPlans = false,\r\n topicIds = []\r\n) =>\r\n togglePlansStatus(\r\n planIds,\r\n active,\r\n toggleElementsActivation,\r\n isBulkAction,\r\n executeForAllPlans,\r\n topicIds\r\n );\r\n\r\nexport async function setImage(planId, file) {\r\n await postNewPlannerKpi(config.kpi.kpiMeasurementAddPlanImage);\r\n\r\n return await setPlanImage(planId, file);\r\n}\r\n\r\nexport async function setPlanImageUpload(planId, uploadImageFileRepoId, uploadImageSignedFileRepoId, uploadImageDescriptionText, uploadImageChanged) {\r\n await postNewPlannerKpi(config.kpi.kpiMeasurementAddPlanImage);\r\n\r\n return await uploadPlanImage(planId, uploadImageFileRepoId, uploadImageSignedFileRepoId, uploadImageDescriptionText, uploadImageChanged);\r\n}\r\n\r\nexport function deleteImage(planId) {\r\n return removePlanImage(planId);\r\n}\r\n\r\nexport function createNewTopic(title, colour) {\r\n return createTopic(title, colour);\r\n}\r\n\r\nexport function connectPlanToTopic(planId, topicId) {\r\n return connectToTopic(planId, topicId);\r\n}\r\n\r\nexport function connectPlanToTopicV2(planId, sourceTopicId, destinationTopicId, moveResources) {\r\n return connectToTopicV2(planId, sourceTopicId, destinationTopicId, moveResources);\r\n}\r\n\r\nexport function moveElementsInFolderForPlan(planId, sourceTopicId, destinationTopicId) {\r\n return moveElementsInTopicFolderForPlan(planId, sourceTopicId, destinationTopicId);\r\n}\r\n\r\nexport function getTopicForPlan(topicId) {\r\n return getTopic(topicId);\r\n}\r\n\r\nexport function removeTopicFromPlan(planId) {\r\n return removeTopic(planId);\r\n}\r\n\r\nexport function deleteResourceFromPlan(planId, elementId) {\r\n return deletePlanElement(planId, elementId);\r\n}\r\n\r\nexport function deleteResourceFromCourse(planId, elementId) {\r\n return deletePlanElementFromCourse(planId, elementId);\r\n}\r\n\r\nexport function removePlanFromCourse(planId) {\r\n return removePlan([planId]);\r\n}\r\n\r\nexport function removePlansFromCourse(planIds, executeForAllPlans = false, topicIds = []) {\r\n return removePlans(planIds, executeForAllPlans, topicIds);\r\n}\r\n\r\nexport async function getCoursesForCopy() {\r\n let pageIndex = 0;\r\n let result = await getCourses(pageIndex);\r\n let allCourses = result;\r\n\r\n while (result.length === pageSize) {\r\n pageIndex++;\r\n result = await getCourses(pageIndex);\r\n allCourses = [...allCourses, ...result];\r\n }\r\n\r\n return allCourses;\r\n}\r\n\r\nexport async function copyPlansFromCourse(\r\n targetCourseId,\r\n targetTopicId,\r\n copyDates,\r\n copyResourcesAndActivities,\r\n overwriteAssessmentCriteria,\r\n plansIds,\r\n copyWithoutTopic,\r\n executeForAllPlans = false,\r\n topicIds = []\r\n) {\r\n const result = await copyPlans(\r\n targetCourseId,\r\n targetTopicId,\r\n copyDates,\r\n copyResourcesAndActivities,\r\n overwriteAssessmentCriteria,\r\n plansIds,\r\n copyWithoutTopic,\r\n executeForAllPlans,\r\n topicIds\r\n );\r\n\r\n return result;\r\n}\r\n\r\nexport async function updateCustomPlanField(planId, columnId, text) {\r\n const result = await setCustomFieldText(planId, columnId, text);\r\n\r\n // Use the resulting safeHtml to set the field's text for display\r\n planData.update(data => {\r\n const fieldIndex = data.plan.fields.findIndex(f => f.columnId === columnId);\r\n\r\n if (fieldIndex !== -1) {\r\n data.plan.fields[fieldIndex].displayText = result.SafeHtml;\r\n data.plan.fields[fieldIndex].isPlainText = result.CustomData.isPlainText;\r\n }\r\n\r\n return data;\r\n });\r\n\r\n return result;\r\n}\r\n\r\nexport function activateResourceFromPlan(\r\n elementId,\r\n activate,\r\n isFolder,\r\n changeActivationForFolderContent\r\n) {\r\n return activatePlanElement(elementId, activate, isFolder, changeActivationForFolderContent);\r\n}\r\n\r\nexport async function updatePlansDates(\r\n planIds,\r\n start,\r\n stop,\r\n weekNumber,\r\n weekDays,\r\n order,\r\n executeForAllPlans,\r\n topicIds\r\n) {\r\n const { start: startDate, stop: stopDate, dateOnlyMode } = getDatesForApi(start, stop);\r\n\r\n return await (dateOnlyMode\r\n ? setPlansWeekAndDay(\r\n planIds,\r\n startDate,\r\n stopDate,\r\n weekNumber,\r\n weekDays,\r\n order,\r\n executeForAllPlans,\r\n topicIds\r\n )\r\n : setPlansTimeSpan(\r\n planIds,\r\n startDate,\r\n stopDate,\r\n weekNumber,\r\n weekDays,\r\n order,\r\n executeForAllPlans,\r\n topicIds\r\n ));\r\n}\r\n\r\nexport const updatePlansDatesEvents = (\r\n planIds,\r\n firstPlanEventIds,\r\n executeForAllPlans = false,\r\n topicIds = []\r\n) => setPlansTimeSpanEvents(planIds, firstPlanEventIds, executeForAllPlans, topicIds);\r\n\r\nexport function createNewPlanV2(plan) {\r\n const datesForApi = getDatesForApi(plan.start, plan.stop);\r\n\r\n return createPlanV2({\r\n ...plan,\r\n start: datesForApi.start,\r\n stop: datesForApi.stop\r\n });\r\n}\r\n","import { plannerViews, plansOrder } from \"../constants\";\r\n\r\n/**\r\n * Gets planner view by selected tab index\r\n * @param {number} tabIndex\r\n */\r\nexport function getPlannerView(tabIndex) {\r\n switch (tabIndex) {\r\n case 0:\r\n return plannerViews.current;\r\n case 1:\r\n return plannerViews.past;\r\n case 2:\r\n return plannerViews.withoutDate;\r\n default:\r\n return plannerViews.notDefined;\r\n }\r\n}\r\n\r\nexport function getPlansOrderFromPlansView(plansView) {\r\n switch (plansView) {\r\n case plannerViews.topic: {\r\n return plansOrder.topic;\r\n }\r\n\r\n case plannerViews.tableView: {\r\n return plansOrder.tableView;\r\n }\r\n\r\n default: {\r\n return plansOrder.default;\r\n }\r\n }\r\n}\r\n","export const makeCourseForDropdown = (course, actionSource, archivedText) => {\r\n const courseTitle = !course.Status\r\n ? course.CourseTitle\r\n : course.CourseTitle + \" (\" + archivedText + \")\";\r\n\r\n return {\r\n icon: \"\",\r\n label: courseTitle,\r\n link: false,\r\n target: \"_self\",\r\n value: {\r\n source: actionSource,\r\n title: courseTitle,\r\n id: course.CourseId,\r\n hasUseTopics: course.HasCourseSettingUseTopics\r\n }\r\n };\r\n};\r\n","import config from \"../config\";\r\nimport { columnTypes, columnVisibility } from \"../constants\";\r\n\r\nexport function isDateVisible(columnVisibilities = undefined, canEdit = undefined) {\r\n return isPlanColumnVisible(columnTypes.Date, true, columnVisibilities, canEdit);\r\n}\r\n\r\nexport function isClassHoursVisible(classHours) {\r\n const isValueViewableForAll = classHours != 0;\r\n\r\n return isPlanColumnVisible(columnTypes.ClassHours, isValueViewableForAll, undefined, undefined);\r\n}\r\n\r\nexport function getInvalidClassHoursMessageVisibility(classHours) {\r\n return classHours < 0 || classHours > 100 || !/^[0-9]+$/.test(classHours);\r\n}\r\n\r\nfunction isPlanColumnVisible(\r\n columnType,\r\n isValueViewableForAll,\r\n columnVisibilities = undefined,\r\n canEdit = undefined\r\n) {\r\n let planColumnVisibility = config.columnVisibilities\r\n ? config.columnVisibilities[columnType]\r\n : undefined;\r\n\r\n if (\r\n !config.columnVisibilities ||\r\n planColumnVisibility === undefined ||\r\n config.canEdit === undefined\r\n ) {\r\n // Check if calendar\r\n if (columnVisibilities) {\r\n planColumnVisibility = columnVisibilities[columnType];\r\n\r\n // Check if teacher\r\n return canEdit\r\n ? planColumnVisibility !== columnVisibility.Nobody\r\n : planColumnVisibility === columnVisibility.All && isValueViewableForAll;\r\n } else {\r\n return true;\r\n }\r\n }\r\n\r\n // Check if teacher\r\n return config.canEdit\r\n ? planColumnVisibility !== columnVisibility.Nobody\r\n : planColumnVisibility === columnVisibility.All && isValueViewableForAll;\r\n}\r\n","<div class=\"its-plans-action__options\">\r\n {#if config.canEdit}\r\n <div class=\"copy-plans-modal\">\r\n <Modal\r\n id=\"show-copy-plans-modal-id\"\r\n bind:enabled={showCopyPlansModal}\r\n titleText={i18n.copy}\r\n {body}\r\n confirmText={i18n.copy}\r\n cancelText={i18n.cancel}\r\n on:close={copyPlansModalClicked}\r\n >\r\n <div slot=\"body\">\r\n <h2 class=\"copy-plans-modal__section-title\">{i18n.copyTheSelectedPlansTo}</h2>\r\n <ButtonDropdown\r\n arrow={false}\r\n disabled={dropDownCoursesLoading}\r\n iconClass={dropDownCoursesLoading ? 'prom-button--loading' : 'prom-button-dropdown-icon'}\r\n iconPlacement=\"end\"\r\n id=\"copy-plans-modal__courses-dropdown\"\r\n textOnly={false}\r\n text={coursesDropdownText}\r\n responsive={false}\r\n items={coursesItems}\r\n type=\"secondary\"\r\n on:beforeToggle={loadCourses}\r\n on:beforeToggle={addScrollCourseDropdown}\r\n on:selectedOption={selectCourse}\r\n />\r\n <div\r\n class=\"copy-plans-modal__error\"\r\n hidden={errorNoCourseSelected ? \"\" : \"hidden\"}\r\n >\r\n {i18n.selectACourse}\r\n </div>\r\n {#if courseIsSelected}\r\n {#if courseHasUseTopics}\r\n <h2 class=\"copy-plans-modal__section-title\">{i18n.selectATopic}</h2>\r\n <Checkbox\r\n checked={checkedKeepExistingTopic}\r\n label={i18n.keepExisting}\r\n small\r\n on:change={updateSelectATopicSection}\r\n />\r\n <ButtonDropdown\r\n arrow={false}\r\n disabled={checkedKeepExistingTopic}\r\n iconPlacement=\"end\"\r\n id=\"copy-plans-modal__topics-dropdown\"\r\n textOnly={false}\r\n text={topicsDropdownText}\r\n responsive={false}\r\n items={topicsItems}\r\n type=\"secondary\"\r\n on:beforeToggle={addScrollTopicDropdown}\r\n on:selectedOption={selectTopic}\r\n />\r\n <div\r\n class=\"copy-plans-modal__error\"\r\n hidden={errorNoTopicSelected ? \"\" : \"hidden\"}\r\n >\r\n {i18n.warning_SelectTopic}\r\n </div>\r\n {/if}\r\n <h2 class=\"copy-plans-modal__section-title\">{i18n.options}</h2>\r\n {#if isDateVisible()}\r\n <div class=\"copy-plans-modal__options-checkbox\">\r\n <Checkbox\r\n checked={checkedCopyDates}\r\n label={i18n.copyDatesForNewPlans}\r\n small\r\n on:change={updateCheckedStatusCopyDates}\r\n />\r\n </div>\r\n {/if}\r\n <div class=\"copy-plans-modal__options-checkbox\">\r\n <Checkbox\r\n checked={checkedConnectedResources}\r\n label={i18n.copyConnectedResources}\r\n small\r\n on:change={updateCheckedStatusConnectedResources}\r\n />\r\n <div class=\"copy-plans-modal__options-checkbox-info\">\r\n {i18n.copyConnectedResourcesInfoMessage}\r\n </div>\r\n </div>\r\n {#if showAssessmentCriteriaSection}\r\n <div class=\"copy-plans-modal__options-checkbox\">\r\n <Checkbox\r\n checked={checkedAssessmentCriteria}\r\n label={i18n.replaceExistingAssesmentCriteria}\r\n small\r\n on:change={updateCheckedStatusAssessmentCriteria}\r\n />\r\n </div>\r\n {/if}\r\n {/if}\r\n </div>\r\n </Modal>\r\n </div>\r\n\r\n <Modal\r\n id=\"copy-in-progress-modal-id\"\r\n bind:enabled={showCopyInProgress}\r\n titleText={i18n.copy}\r\n confirmText={i18n.close}\r\n showCancel={false}\r\n >\r\n <div slot=\"body\">\r\n <div class=\"copy-plans__copy-in-progress\">\r\n <span class=\"screen-reader\">{i18n.copyInProgress}</span>\r\n </div>\r\n </div>\r\n </Modal>\r\n\r\n {#if showSetDatesModal}\r\n <SetDatesModal\r\n {showSetDatesModal}\r\n {i18n}\r\n on:setDates={saveSetDatesModalClicked}\r\n on:close={closeSetDatesModalClicked}\r\n />\r\n {/if}\r\n\r\n {#if showConnectToCalendarModal}\r\n <ConnectToCalendarModal\r\n {showConnectToCalendarModal}\r\n {i18n}\r\n planIds={$selectedPlanIds}\r\n on:connectToCalendar={saveConnectToCalendarModalClicked}\r\n on:close={closeSetDatesModalClicked}\r\n />\r\n {/if}\r\n\r\n <CopyConfirmAndErrorModal\r\n {showCopyConfirmModal}\r\n {i18n}\r\n {confirmModalBody}\r\n bannerVisible={confirmModalBannerVisibility}\r\n bannerText={confirmModalBannerText}\r\n on:close={closeCopyPlansConfirmModalClicked}\r\n />\r\n\r\n <Modal\r\n id=\"show-delete-plans-confirm-modal-id\"\r\n bind:enabled={showDeletePlansConfirmModal}\r\n titleText={i18n.deletePlansConfirmDialog_Heading}\r\n bodyHtml={i18n.deletePlansConfirmDialog_Text}\r\n confirmText={i18n.confirm}\r\n cancelText={i18n.cancel}\r\n confirmButtonType=\"destructive\"\r\n on:close={deletePlansModalClicked}\r\n />\r\n\r\n <Modal\r\n id=\"show-deactivate-elements-modal-id\"\r\n bind:enabled={showDisableElementsConfirmModal}\r\n titleText={i18n.pleaseConfirm}\r\n bodyText={i18n.plannerPlanDeactivatedWithElementsWarning}\r\n confirmText={i18n.yes}\r\n cancelText={i18n.no}\r\n on:close={confirmModalClicked}\r\n />\r\n\r\n <Modal\r\n id=\"no-plans-selected-modal-id\"\r\n bind:enabled={showNoPlansSelectedModal}\r\n showCancel={false}\r\n confirmText={i18n.ok}\r\n titleText={i18n.deletePlansNonSelectedDialog_Heading}\r\n bodyText={i18n.deletePlansNonSelectedDialog_Text}\r\n confirmButtonType=\"primary\"\r\n on:close={noPlansModalClicked}\r\n />\r\n\r\n <ButtonDropdown\r\n arrow={false}\r\n iconPlacement=\"end\"\r\n id=\"plans-actions-dropdown\"\r\n items={getActions()}\r\n large={true}\r\n responsive={false}\r\n textOnly={false}\r\n text={i18n.actions}\r\n type=\"secondary\"\r\n on:selectedOption={selectedAction}\r\n />\r\n {/if}\r\n</div>\r\n\r\n<script>\r\n import { createEventDispatcher, onMount, tick } from \"svelte\";\r\n import { get } from \"svelte/store\";\r\n import { isMobile } from \"@itslearning/atlas/detectors/UserAgentHelper\";\r\n import ButtonDropdown from \"@itslearning/prometheus/assets/dropdowns/ButtonDropdown/v1/ButtonDropdown.svelte\";\r\n import Checkbox from \"@itslearning/prometheus/assets/inputs/Checkbox/v1/Checkbox.svelte\";\r\n import Modal from \"@itslearning/prometheus/assets/modals/Modal/v2/Modal.svelte\";\r\n import ConnectToCalendarModal from \"../ConnectToCalendarModal/ConnectToCalendarModal.svelte\";\r\n import CopyConfirmAndErrorModal from \"../CopyConfirmAndErrorModal/CopyConfirmAndErrorModal.svelte\";\r\n import SetDatesModal from \"../SetDatesModal/SetDatesModal.svelte\";\r\n import {\r\n removePlansFromCourse,\r\n copyPlansFromCourse,\r\n getCoursesForCopy,\r\n setPlanActive,\r\n setPlansActive,\r\n updatePlansDates,\r\n updatePlansDatesEvents\r\n } from \"../../controllers/updatePlanController\";\r\n import { getTopicsForCopyPlans } from \"../../api\";\r\n import config from \"../../config\";\r\n import {\r\n endpoints,\r\n plansActionType,\r\n plansCopyActionModal,\r\n columnTypes,\r\n columnVisibility,\r\n plannerViews\r\n } from \"../../constants\";\r\n import { getPlansOrderFromPlansView } from \"../../helpers/converters.js\";\r\n import { makeCourseForDropdown } from \"../../helpers/makeCourseForDropdownHelper\";\r\n import { isDateVisible } from \"../../helpers/visibilityHelper\";\r\n import i18n from \"../../i18n.js\";\r\n\r\n const dispatch = createEventDispatcher();\r\n\r\n export let printAsTopic = false;\r\n export let selectedView = 0;\r\n export let data;\r\n export let areAllPlansSelected = false;\r\n export let topicFilterIds = [];\r\n export let selectedPlanIds = {\r\n set: () => {}\r\n };\r\n\r\n let showCopyPlansModal = false;\r\n let showCopyConfirmModal = false;\r\n let showDeletePlansConfirmModal = false;\r\n let showNoPlansSelectedModal = false;\r\n let showSetDatesModal = false;\r\n let showConnectToCalendarModal = false;\r\n\r\n let body;\r\n let errorNoCourseSelected = false;\r\n let errorNoTopicSelected = false;\r\n let dropDownCourses = [];\r\n let dropDownCoursesLoading = true;\r\n let coursesItems;\r\n let courseIsSelected = false;\r\n let selectedCourseTitle = \"\";\r\n let selectedCourseId;\r\n let topicsItems;\r\n let courseHasUseTopics = false;\r\n let checkedKeepExistingTopic = false;\r\n let topicIsSelected = false;\r\n let selectedTopic = \"\";\r\n let selectedTopicId = 0; // IMPORTANT, if no topic is selected, then no topic is copied\r\n let copyWithoutTopic = false; // IMPORTANT, if the option \"Without topic\" is selected, then the plans will be copied without topic\r\n let checkedCopyDates = false;\r\n let checkedConnectedResources = true; // IMPORTANT, checked by default\r\n let checkedAssessmentCriteria = false;\r\n let showCopyInProgress = false;\r\n let confirmModalBody;\r\n let confirmModalBannerVisibility = false;\r\n let confirmModalBannerText;\r\n let showDisableElementsConfirmModal = false;\r\n let selectedPlanIdsToMakeNotVisible;\r\n\r\n onMount(() => {\r\n getCoursesForCopy()\r\n .then(data => dropDownCourses = data)\r\n .finally(() => dropDownCoursesLoading = false);\r\n });\r\n\r\n const isSelfPaceCourse =\r\n config.columnVisibilities[columnTypes.Date] === columnVisibility.Nobody;\r\n const canConnectToCalendar = config.hasFunctionalityCalendar;\r\n\r\n $: coursesDropdownText = !courseIsSelected ? i18n.selectACourse : selectedCourseTitle;\r\n\r\n $: topicsDropdownText = !topicIsSelected ? i18n.selectATopic : selectedTopic;\r\n\r\n $: showAssessmentCriteriaSection =\r\n config.showAssessmentCriteriaSection &&\r\n selectedCourseId !== null &&\r\n selectedCourseId !== config.courseId;\r\n\r\n async function selectedAction(event) {\r\n const planIds = get(selectedPlanIds);\r\n const actionData = event.detail.data;\r\n\r\n switch (actionData.source) {\r\n case plansActionType.SetDate:\r\n if (!areAllPlansSelected && planIds && planIds.size === 0) {\r\n showNoPlansSelectedModal = true;\r\n } else {\r\n showSetDatesModal = true;\r\n }\r\n\r\n break;\r\n case plansActionType.ConnectToCalendar:\r\n if (planIds && planIds.size === 0) {\r\n showNoPlansSelectedModal = true;\r\n } else {\r\n showConnectToCalendarModal = true;\r\n }\r\n\r\n break;\r\n case plansActionType.Copy:\r\n if (!areAllPlansSelected && planIds && planIds.size === 0) {\r\n showNoPlansSelectedModal = true;\r\n } else {\r\n showCopyPlansModal = true;\r\n setTimeout(() => openModalInMobile(), 100);\r\n }\r\n\r\n break;\r\n case plansActionType.Delete:\r\n if (!areAllPlansSelected && planIds && planIds.size === 0) {\r\n showNoPlansSelectedModal = true;\r\n } else {\r\n showDeletePlansConfirmModal = true;\r\n }\r\n\r\n break;\r\n case plansActionType.MakeVisible:\r\n if (!areAllPlansSelected && planIds && planIds.size === 0) {\r\n showNoPlansSelectedModal = true;\r\n } else {\r\n makeVisible();\r\n }\r\n\r\n break;\r\n case plansActionType.MakeNotVisible:\r\n if (!areAllPlansSelected && planIds && planIds.size === 0) {\r\n showNoPlansSelectedModal = true;\r\n } else {\r\n makeNotVisible();\r\n }\r\n\r\n break;\r\n case plansActionType.Print:\r\n if ((!areAllPlansSelected && !planIds) || planIds.size === 0) {\r\n showNoPlansSelectedModal = true;\r\n } else {\r\n window.open(\r\n selectedView === plannerViews.tableView\r\n ? areAllPlansSelected\r\n ? endpoints.printAllPlansTbl(\r\n config.courseId,\r\n topicFilterIds,\r\n selectedView\r\n )\r\n : endpoints.printPlansTbl(\r\n config.courseId,\r\n [...planIds],\r\n selectedView\r\n )\r\n : printAsTopic\r\n ? endpoints.printTopics(\r\n config.courseId,\r\n [config.topicId],\r\n [...planIds]\r\n )\r\n : endpoints.printPlans(config.courseId, [...planIds], selectedView)\r\n );\r\n }\r\n\r\n break;\r\n }\r\n }\r\n\r\n /** Plan action options **/\r\n function getActions() {\r\n const options = [\r\n {\r\n icon: \"\",\r\n label: i18n.makeVisible,\r\n link: false,\r\n target: \"_self\",\r\n value: { source: plansActionType.MakeVisible }\r\n },\r\n {\r\n icon: \"\",\r\n label: i18n.makeNotVisible,\r\n link: false,\r\n target: \"_self\",\r\n value: { source: plansActionType.MakeNotVisible }\r\n },\r\n ...(!isSelfPaceCourse\r\n ? [\r\n {\r\n icon: \"\",\r\n label: i18n.setDate,\r\n link: false,\r\n target: \"_self\",\r\n value: { source: plansActionType.SetDate }\r\n }\r\n ]\r\n : []),\r\n ...(canConnectToCalendar && !isSelfPaceCourse\r\n ? [\r\n {\r\n icon: \"\",\r\n label: i18n.connectToCalendar,\r\n link: false,\r\n target: \"_self\",\r\n value: { source: plansActionType.ConnectToCalendar }\r\n }\r\n ]\r\n : []),\r\n {\r\n icon: \"\",\r\n label: i18n.copy,\r\n link: false,\r\n target: \"_self\",\r\n value: { source: plansActionType.Copy }\r\n },\r\n {\r\n icon: \"\",\r\n label: i18n.print,\r\n link: false,\r\n target: \"_self\",\r\n value: { source: plansActionType.Print }\r\n },\r\n {\r\n icon: \"\",\r\n label: i18n.delete,\r\n link: false,\r\n target: \"_self\",\r\n value: { source: plansActionType.Delete }\r\n }\r\n ];\r\n\r\n return [{ options: options }];\r\n }\r\n\r\n function loadCourses() {\r\n const starredCoursesList = [];\r\n const otherCoursesList = [];\r\n\r\n // Selects the arrays for starred and other courses, indicates which courses are archived\r\n dropDownCourses.forEach(course => {\r\n if (course.HasCourseSettingPlanner) {\r\n const courseForDropdown =\r\n makeCourseForDropdown(course, plansCopyActionModal.SelectCourse, i18n.archived);\r\n\r\n course.IsFavourite\r\n ? starredCoursesList.push(courseForDropdown)\r\n : otherCoursesList.push(courseForDropdown);\r\n }\r\n });\r\n\r\n /** Courses dropdown options **/\r\n coursesItems = [\r\n {\r\n label: i18n.starred,\r\n options: starredCoursesList\r\n },\r\n {\r\n label: i18n.otherCourses,\r\n options: otherCoursesList\r\n }\r\n ];\r\n }\r\n\r\n function selectCourse(event) {\r\n const actionData = event.detail.data;\r\n\r\n if (actionData.source === plansCopyActionModal.SelectCourse) {\r\n errorNoCourseSelected = false;\r\n errorNoTopicSelected = false;\r\n courseIsSelected = true;\r\n selectedCourseTitle = actionData.title;\r\n selectedCourseId = actionData.id;\r\n courseHasUseTopics = false;\r\n topicIsSelected = false;\r\n selectedTopicId = 0; // Without topic\r\n\r\n loadTopics(actionData.id, actionData.hasUseTopics);\r\n }\r\n }\r\n\r\n async function loadTopics(courseId, hasUseTopics) {\r\n const topicsList = [];\r\n const topics = await getTopicsForCopyPlans(courseId);\r\n\r\n if (hasUseTopics) courseHasUseTopics = true;\r\n\r\n topics.forEach(topic => {\r\n topicsList.push({\r\n icon: \"\",\r\n label: topic.Name,\r\n link: false,\r\n target: \"_self\",\r\n value: {\r\n source: plansCopyActionModal.SelectTopic,\r\n name: topic.Name,\r\n id: topic.TopicId\r\n }\r\n });\r\n });\r\n\r\n topicsList.push({\r\n // Option to choose to copy the plan without topic\r\n icon: \"\",\r\n label: config.withoutTopic,\r\n link: false,\r\n target: \"_self\",\r\n value: {\r\n source: plansCopyActionModal.SelectWithoutTopic,\r\n name: config.withoutTopic,\r\n id: 0\r\n }\r\n });\r\n\r\n /** Topics dropdown options **/\r\n topicsItems = [\r\n {\r\n options: topicsList\r\n }\r\n ];\r\n }\r\n\r\n function selectTopic(event) {\r\n const actionData = event.detail.data;\r\n\r\n switch (actionData.source) {\r\n case plansCopyActionModal.SelectTopic:\r\n errorNoTopicSelected = false;\r\n topicIsSelected = true;\r\n selectedTopic = actionData.name;\r\n selectedTopicId = actionData.id;\r\n copyWithoutTopic = false;\r\n break;\r\n case plansCopyActionModal.SelectWithoutTopic:\r\n errorNoTopicSelected = false;\r\n topicIsSelected = true;\r\n selectedTopic = actionData.name;\r\n selectedTopicId = actionData.id;\r\n copyWithoutTopic = true;\r\n break;\r\n default:\r\n break;\r\n }\r\n }\r\n\r\n function updateSelectATopicSection() {\r\n // If \"Keep existing\" is checked/unchecked, then we reset the entire dropdown\r\n topicIsSelected = false;\r\n selectedTopic = \"\";\r\n selectedTopicId = 0;\r\n copyWithoutTopic = false;\r\n\r\n if (checkedKeepExistingTopic) {\r\n checkedKeepExistingTopic = false;\r\n } else {\r\n checkedKeepExistingTopic = true;\r\n errorNoTopicSelected = false;\r\n }\r\n }\r\n\r\n function updateCheckedStatusCopyDates() {\r\n if (checkedCopyDates) {\r\n checkedCopyDates = false;\r\n } else {\r\n checkedCopyDates = true;\r\n }\r\n }\r\n\r\n function updateCheckedStatusConnectedResources() {\r\n if (checkedConnectedResources) {\r\n checkedConnectedResources = false;\r\n } else {\r\n checkedConnectedResources = true;\r\n }\r\n }\r\n\r\n function updateCheckedStatusAssessmentCriteria() {\r\n if (checkedAssessmentCriteria) {\r\n checkedAssessmentCriteria = false;\r\n } else {\r\n checkedAssessmentCriteria = true;\r\n }\r\n }\r\n\r\n async function copyPlansModalClicked(event) {\r\n if (event.detail.confirmed === true) {\r\n if (!courseIsSelected) {\r\n // If Copy is pressed, but no course is selected\r\n showCopyPlansModal = true;\r\n errorNoCourseSelected = true;\r\n } else if (courseHasUseTopics && !checkedKeepExistingTopic && !topicIsSelected) {\r\n // If Copy is pressed, but \"Keep existing is not checked\" and no topic is selected\r\n showCopyPlansModal = true;\r\n errorNoTopicSelected = true;\r\n } else {\r\n showCopyInProgress = true;\r\n\r\n const planIds = get(selectedPlanIds);\r\n\r\n if (planIds && planIds.size > 0) {\r\n const copyPlansData = await copyPlansFromCourse(\r\n selectedCourseId,\r\n selectedTopicId,\r\n checkedCopyDates,\r\n checkedConnectedResources,\r\n checkedAssessmentCriteria,\r\n [...planIds],\r\n copyWithoutTopic,\r\n areAllPlansSelected,\r\n topicFilterIds\r\n );\r\n\r\n confirmModalBody = copyPlansData.ResultMessage;\r\n\r\n if (copyPlansData.ResultWarningNotes) {\r\n // If there is a warning note, then it is displayed in the banner\r\n confirmModalBannerVisibility = true;\r\n confirmModalBannerText = copyPlansData.ResultWarningNotes;\r\n }\r\n }\r\n\r\n showCopyInProgress = false;\r\n showCopyConfirmModal = true;\r\n }\r\n } else {\r\n // On Cancel, the Plans page gets reloaded, to reset all parameters\r\n completePlanAction();\r\n }\r\n }\r\n\r\n function closeCopyPlansConfirmModalClicked() {\r\n showCopyConfirmModal = false;\r\n completePlanAction();\r\n }\r\n\r\n async function deletePlansModalClicked({ detail: { confirmed: isPlansDeleteConfirmed } }) {\r\n if (isPlansDeleteConfirmed) {\r\n if (areAllPlansSelected) {\r\n await removePlansFromCourse([], true, topicFilterIds);\r\n } else {\r\n const planIds = get(selectedPlanIds);\r\n\r\n if (planIds.size > 0) {\r\n await removePlansFromCourse([...planIds]);\r\n }\r\n }\r\n\r\n completePlanAction();\r\n }\r\n\r\n showDeletePlansConfirmModal = false;\r\n }\r\n\r\n async function saveSetDatesModalClicked({ detail }) {\r\n const planIds = get(selectedPlanIds);\r\n\r\n if (areAllPlansSelected || planIds.size > 0) {\r\n await updatePlansDates(\r\n [...planIds],\r\n detail.start,\r\n detail.stop,\r\n detail.weekNumber,\r\n detail.weekDaysAPI,\r\n getPlansOrderFromPlansView(selectedView),\r\n areAllPlansSelected,\r\n topicFilterIds\r\n );\r\n completePlanAction();\r\n }\r\n }\r\n\r\n async function saveConnectToCalendarModalClicked({ detail: { activityIds } }) {\r\n if (activityIds.length > 0) {\r\n if (areAllPlansSelected) {\r\n await updatePlansDatesEvents([], activityIds, true, topicFilterIds);\r\n } else {\r\n const planIds = get(selectedPlanIds);\r\n\r\n if (planIds.size > 0) {\r\n await updatePlansDatesEvents([...planIds], activityIds);\r\n }\r\n }\r\n\r\n completePlanAction();\r\n }\r\n }\r\n\r\n // On Cancel, the Plans page gets reloaded, to reset all parameters\r\n function closeSetDatesModalClicked() {\r\n completePlanAction();\r\n }\r\n\r\n function noPlansModalClicked() {\r\n showNoPlansSelectedModal = false;\r\n }\r\n\r\n // Make visible only the selected plans that are not visible, ignore the rest.\r\n async function makeVisible() {\r\n if (areAllPlansSelected) {\r\n await setPlansActive(\r\n [],\r\n true,\r\n config.activateElementsByPlan,\r\n true,\r\n areAllPlansSelected,\r\n topicFilterIds\r\n );\r\n await tick();\r\n completePlanAction();\r\n } else {\r\n const planIds = get(selectedPlanIds);\r\n\r\n // From the list of plans we extract the selected ones which are NOT visible\r\n const plansNotVisible_Selected = data.plans\r\n ? data.plans.filter(p => !p.isActive && planIds.has(p.id))\r\n : [];\r\n\r\n if (plansNotVisible_Selected.length !== 0) {\r\n if (plansNotVisible_Selected.length === 1) {\r\n await setPlanActive(\r\n plansNotVisible_Selected[0].id,\r\n true,\r\n config.activateElementsByPlan\r\n );\r\n } else if (plansNotVisible_Selected.length > 1) {\r\n const planIds = [];\r\n\r\n plansNotVisible_Selected.forEach(plan => {\r\n planIds.push(plan.id);\r\n });\r\n await setPlansActive(planIds, true, config.activateElementsByPlan);\r\n }\r\n\r\n await tick();\r\n }\r\n\r\n completePlanAction();\r\n }\r\n }\r\n\r\n // Make not visible only the selected plans that are visible, ignore the rest.\r\n async function makeNotVisible() {\r\n if (areAllPlansSelected) {\r\n // If the planner setting 'Activate connected elements when the plan is activated' is enabled and the selected plans have connected elements, a confim dialog will appear\r\n if (config.activateElementsByPlan) {\r\n showDisableElementsConfirmModal = true;\r\n } else {\r\n await setPlansActive(\r\n [],\r\n false,\r\n config.activateElementsByPlan,\r\n true,\r\n areAllPlansSelected,\r\n topicFilterIds\r\n );\r\n await tick();\r\n completePlanAction();\r\n }\r\n } else {\r\n const planIds = get(selectedPlanIds);\r\n\r\n // From the list of plans we extract the selected ones which are visible\r\n const plansVisible_Selected = data.plans\r\n ? data.plans.filter(p => p.isActive && planIds.has(p.id))\r\n : [];\r\n const plansVisible_Selected_WithElements = plansVisible_Selected.filter(\r\n p => p.elements.length >= 1\r\n );\r\n\r\n if (plansVisible_Selected.length !== 0) {\r\n // If the planner setting 'Activate connected elements when the plan is activated' is enabled and the selected plans have connected elements, a confim dialog will appear\r\n if (\r\n config.activateElementsByPlan &&\r\n plansVisible_Selected_WithElements.length !== 0\r\n ) {\r\n selectedPlanIdsToMakeNotVisible = plansVisible_Selected;\r\n showDisableElementsConfirmModal = true;\r\n } else {\r\n if (plansVisible_Selected.length === 1) {\r\n await setPlanActive(\r\n plansVisible_Selected[0].id,\r\n false,\r\n config.activateElementsByPlan\r\n );\r\n } else if (plansVisible_Selected.length > 1) {\r\n const planIds = [];\r\n\r\n plansVisible_Selected.forEach(plan => {\r\n planIds.push(plan.id);\r\n });\r\n await setPlansActive(planIds, false, config.activateElementsByPlan);\r\n }\r\n\r\n await tick();\r\n completePlanAction();\r\n }\r\n } else {\r\n completePlanAction();\r\n }\r\n }\r\n }\r\n\r\n // A confirmation modal appears when plans are deactivated\r\n // \"Do you want to deactivate all elements connected to this plan?\"\r\n async function confirmModalClicked(event) {\r\n const toggleElementsActivation = event.detail.confirmed;\r\n\r\n if (areAllPlansSelected) {\r\n await setPlansActive(\r\n [],\r\n false,\r\n toggleElementsActivation,\r\n true,\r\n areAllPlansSelected,\r\n topicFilterIds\r\n );\r\n } else if (selectedPlanIdsToMakeNotVisible.length === 1) {\r\n await setPlanActive(\r\n selectedPlanIdsToMakeNotVisible[0].id,\r\n false,\r\n toggleElementsActivation\r\n );\r\n } else if (selectedPlanIdsToMakeNotVisible.length > 1) {\r\n const planIds = [];\r\n\r\n selectedPlanIdsToMakeNotVisible.forEach(plan => {\r\n planIds.push(plan.id);\r\n });\r\n await setPlansActive(planIds, false, toggleElementsActivation);\r\n }\r\n\r\n showDisableElementsConfirmModal = false;\r\n completePlanAction();\r\n }\r\n\r\n const modalId = \"#show-copy-plans-modal-id\";\r\n\r\n function openModalInMobile() {\r\n if (isMobile()) {\r\n if (document.querySelector(modalId) !== null) {\r\n document.querySelector(modalId).style.minHeight = \"100%\";\r\n }\r\n }\r\n }\r\n\r\n window.addEventListener(\"orientationchange\", function () {\r\n if (document.querySelector(modalId) !== null) {\r\n setTimeout(() => openModalInMobile(), 300);\r\n }\r\n });\r\n\r\n const dropdownCopyPlanSection =\r\n \"#copy-plans-modal__courses-dropdown > section > section.prom-dropdown__body\";\r\n const dropdownCopyTopicSection =\r\n \"#copy-plans-modal__topics-dropdown > section > section.prom-dropdown__body\";\r\n const dropdownHeight = \"150px\";\r\n\r\n // Add a scroll bar to the courses dropdown in copy plan modal\r\n function addScrollCourseDropdown() {\r\n if (document.querySelector(dropdownCopyPlanSection).style.height === \"\") {\r\n document.querySelector(dropdownCopyPlanSection).style.height = dropdownHeight;\r\n }\r\n }\r\n\r\n // Add a scroll bar to the topics dropdown in copy plan modal\r\n function addScrollTopicDropdown() {\r\n if (document.querySelector(dropdownCopyTopicSection).style.height === \"\") {\r\n document.querySelector(dropdownCopyTopicSection).style.height = dropdownHeight;\r\n }\r\n }\r\n\r\n const completePlanAction = () => {\r\n selectedPlanIds.set(new Set([]));\r\n dispatch(\"endOfActionOnSelectedPlans\");\r\n };\r\n</script>\r\n","<svelte:window on:keyup={onWindowKeyUp} />\n\n<div\n bind:this={tooltip}\n id=\"{id}-{role}\"\n class=\"prom-tooltip prom-tooltip-{id} prom-tooltip--{placement} {displayClass}\"\n role=\"{role}\"\n on:mouseenter={hoverTooltip}\n on:mouseleave={unhoverTooltip}\n>\n <div bind:this={arrow} id=\"tooltip-arrow\" class=\"prom-tooltip__arrow\"></div>\n <div bind:this={tooltipContent} id=\"tooltip-content\" class=\"prom-tooltip__content\">\n {#if text}\n {text}\n {:else}\n <slot></slot>\n {/if}\n </div>\n</div>\n\n<script>\n import { Keys } from '@itslearning/atlas/keyboard/keys';\n import { normalizeKey } from '@itslearning/atlas/keyboard/normalize';\n import { onDestroy, onMount } from 'svelte';\n\n /** @type {Element} */\n export let element = null;\n /** @type {string} */\n export let id = 'mytooltip';\n /** @type {'top'|'left'|'right'|'bottom'} */\n export let placement = 'top';\n /** @type {string} */\n export let role = 'tooltip';\n /** @type {boolean} */\n export let show = false;\n /** @type {string} */\n export let text = '';\n export let hover = false;\n\n let tooltip;\n let arrow;\n let tooltipContent;\n\n $: displayClass = show ? '' : 'prom-tooltip__hidden';\n\n $: if (show) {\n updateTooltip(show);\n }\n\n onMount(() => {\n setElementAttribute(show);\n });\n\n onDestroy(() => {\n setElementAttribute(false);\n });\n\n function onWindowKeyUp(event) {\n const key = normalizeKey(event.key);\n\n if (key === Keys.ESCAPE) {\n show = false;\n }\n }\n\n function hoverTooltip() {\n hover = true;\n show = true;\n }\n\n function unhoverTooltip() {\n hover = false;\n show = false;\n }\n\n function updateTooltip(show) {\n setElementAttribute(show);\n\n if (show) {\n setTimeout(setPosition, 0);\n }\n }\n\n function setElementAttribute(isTooltipShown) {\n if (isTooltipShown) {\n if (element && role === 'tooltip') {\n const describedBy = id + '-' + role;\n\n element.setAttribute('aria-describedby', describedBy);\n }\n } else {\n if (element && element.hasAttribute('aria-describedby')) {\n element.removeAttribute('aria-describedby');\n }\n }\n }\n\n function setPosition() {\n\n if (!element) {\n return;\n }\n\n const rect = element.getBoundingClientRect();\n const tooltipHeight = tooltip.offsetHeight;\n const tooltipWidth = tooltip.offsetWidth;\n const horizontalPlacementOffset = 15;\n const verticalPlacementOffset = 15;\n\n let left, top;\n\n switch (placement) {\n case 'top':\n left = rect.left - tooltipWidth / 2 + rect.width / 2;\n top = rect.top - tooltipHeight - horizontalPlacementOffset + window.pageYOffset;\n break;\n case 'bottom':\n left = rect.left - tooltipWidth / 2 + rect.width / 2;\n top = rect.bottom + horizontalPlacementOffset + window.pageYOffset;\n break;\n case 'left':\n left = rect.left - tooltipWidth - verticalPlacementOffset;\n top = rect.top + (rect.height - tooltipHeight) / 2 + window.pageYOffset;\n break;\n case 'right':\n left = rect.right + verticalPlacementOffset;\n top = rect.top + (rect.height - tooltipHeight) / 2 + window.pageYOffset;\n break;\n default:\n break;\n }\n\n tooltip.style.left = left + 'px';\n tooltip.style.top = top + 'px';\n }\n</script>\n","<div class=\"its-plans__element-progress\" class:complete>\r\n <span class=\"screen-reader\">{complete ? i18n.completed : i18n.notCompleted}</span>\r\n</div>\r\n\r\n<script>\r\n export let complete;\r\n export let i18n;\r\n</script>\r\n","<div class={\"itsl-plan-completed\"}>\r\n <ElementProgress {i18n} complete={true} />\r\n <span aria-hidden=\"true\">{labelText}</span>\r\n</div>\r\n\r\n<script>\r\n import ElementProgress from \"@its-ui/planner-common/components/ElementProgress/ElementProgress.svelte\";\r\n import i18n from \"../../i18n\";\r\n\r\n export let labelText = i18n.completed;\r\n</script>\r\n","import { backLinkDestinations } from \"../constants\";\r\nimport config from \"../config\";\r\n\r\nexport function addBackDestinationParam(destinationUrl, extraParams) {\r\n const url = new URL(location.origin + destinationUrl);\r\n const plansRegex = /plans\\/(?:courses|public)\\/\\w+\\/(current|past|withoutdate|all)\\//i;\r\n const tableViewRegex = /plans\\/courses\\/(\\d+)\\/tableView/;\r\n const tableViewRegexMatch = location.pathname.match(tableViewRegex);\r\n const plansRegexMatch = location.pathname.match(plansRegex);\r\n const topicRegex = /\\/plans\\/(?:courses|public)\\/\\w+\\/topics\\/(\\d+)/i;\r\n const topicRegexMatch = location.href.match(topicRegex);\r\n const topicsRegex = /\\/plans\\/(?:courses|public)\\/\\w+\\/topics(?:[/]|[?]).*$/i;\r\n const topicsRegexMatch = location.href.match(topicsRegex);\r\n const parentDashboardRegex = /.+LocationId=(\\d+).+&SummaryDashboardType=Parent/i;\r\n const dashboardUrl = \"/Dashboard/Dashboard.aspx\";\r\n\r\n if (plansRegexMatch) {\r\n switch (plansRegexMatch[1]) {\r\n case \"current\":\r\n url.searchParams.append(\"BackDestination\", backLinkDestinations.current);\r\n break;\r\n case \"past\":\r\n url.searchParams.append(\"BackDestination\", backLinkDestinations.past);\r\n break;\r\n case \"withoutdate\":\r\n url.searchParams.append(\"BackDestination\", backLinkDestinations.withoutDate);\r\n break;\r\n case \"all\":\r\n url.searchParams.append(\"BackDestination\", backLinkDestinations.all);\r\n break;\r\n default:\r\n url.searchParams.append(\"BackDestination\", backLinkDestinations.current);\r\n break;\r\n }\r\n } else if (topicRegexMatch) {\r\n url.searchParams.append(\"BackDestination\", backLinkDestinations.topic);\r\n\r\n if (!url.searchParams.get(\"TopicId\")) {\r\n url.searchParams.append(\"TopicId\", topicRegexMatch[1]);\r\n }\r\n } else if (topicsRegexMatch) {\r\n url.searchParams.append(\"BackDestination\", backLinkDestinations.topics);\r\n } else if (tableViewRegexMatch) {\r\n url.searchParams.append(\"BackDestination\", backLinkDestinations.tableView);\r\n\r\n if (extraParams) {\r\n url.searchParams.append(\"BackData\", JSON.stringify(extraParams));\r\n }\r\n } else if (location.pathname.includes(\"Course/course.aspx\")) {\r\n url.searchParams.append(\"BackDestination\", backLinkDestinations.overview);\r\n } else if (location.pathname.includes(config.calendarUrl)) {\r\n url.searchParams.append(\"BackDestination\", backLinkDestinations.calendar);\r\n url.searchParams.append(\"BackData\", JSON.stringify(extraParams));\r\n } else if (\r\n location.pathname.includes(config.dashboardUrl ? config.dashboardUrl : dashboardUrl)\r\n ) {\r\n const parentDashboardRegexMatch = location.href.match(parentDashboardRegex);\r\n\r\n if (parentDashboardRegexMatch) {\r\n url.searchParams.append(\"BackDestination\", backLinkDestinations.parentDashboard);\r\n url.searchParams.append(\r\n \"BackData\",\r\n JSON.stringify({ HierarchyId: parentDashboardRegexMatch[1] })\r\n );\r\n const queryString = window.location.search;\r\n const urlParams = new URLSearchParams(queryString);\r\n const childIdFromQueryParameter = urlParams.get(\"ChildId\");\r\n\r\n if (childIdFromQueryParameter && childIdFromQueryParameter > 0) {\r\n url.searchParams.append(\"ChildId\", childIdFromQueryParameter);\r\n }\r\n } else {\r\n url.searchParams.append(\"BackDestination\", backLinkDestinations.myPage);\r\n }\r\n } else if (location.pathname.includes(\"tableView\")) {\r\n url.searchParams.append(\"BackDestination\", backLinkDestinations.tableView);\r\n } else {\r\n url.searchParams.set(\"BackDestination\", backLinkDestinations.current);\r\n\r\n if (extraParams) {\r\n url.searchParams.append(\"BackData\", JSON.stringify(extraParams));\r\n }\r\n }\r\n\r\n if (!url.searchParams.get(\"ChildId\") && config.childId > 0) {\r\n url.searchParams.append(\"ChildId\", config.childId);\r\n }\r\n\r\n return url.href;\r\n}\r\n\r\nexport const getAllQueryStringParametersFromCurrentUrl = () => {\r\n const urlSearchParams = new URLSearchParams(window.location.search);\r\n\r\n if (urlSearchParams.size > 0) {\r\n const queryStringParameters = {};\r\n\r\n for (const [parameterKey, parameterValue] of urlSearchParams) {\r\n queryStringParameters[parameterKey] = parameterValue;\r\n }\r\n\r\n return queryStringParameters;\r\n }\r\n\r\n return null;\r\n};\r\n\r\nexport const getDestinationUrlWithExtraParametersFromCurrentUrl = (\r\n destinationUrl,\r\n queryStringParameters = null\r\n) => {\r\n if (!destinationUrl) {\r\n return;\r\n }\r\n\r\n const urlSearchParams = new URLSearchParams(window.location.search);\r\n\r\n const url = new URL(location.origin + destinationUrl);\r\n\r\n const addQueryStringParameters = queryStringParameters => {\r\n if (!queryStringParameters) {\r\n return;\r\n }\r\n\r\n for (const [parameterKey, parameterValue] of Object.entries(queryStringParameters)) {\r\n url.searchParams.set(parameterKey, parameterValue);\r\n }\r\n };\r\n\r\n const backdataQueryStringParameter = urlSearchParams.get(\"BackData\");\r\n\r\n if (backdataQueryStringParameter) {\r\n addQueryStringParameters(JSON.parse(backdataQueryStringParameter));\r\n }\r\n\r\n addQueryStringParameters(queryStringParameters);\r\n\r\n return url.href;\r\n};\r\n\r\nexport const hasParam = (destinationUrl, param) => {\r\n const urlSegments = destinationUrl.split('?');\r\n const urlSearchParams = new URLSearchParams(urlSegments[1]);\r\n\r\n return urlSearchParams.has(param);\r\n};\r\n\r\nexport const removeParam = (destinationUrl, param) => {\r\n const urlSegments = destinationUrl.split('?');\r\n const urlSearchParams = new URLSearchParams(urlSegments[1]);\r\n\r\n urlSearchParams.delete(param);\r\n\r\n return urlSegments[0]+'?'+decodeURIComponent(urlSearchParams.toString());\r\n};\r\n\r\nexport const setParam = (destinationUrl, param, value) => {\r\n const urlSegments = destinationUrl.split('?');\r\n const urlSearchParams = new URLSearchParams(urlSegments[1]);\r\n\r\n urlSearchParams.set(param, value);\r\n\r\n return urlSegments[0]+'?'+decodeURIComponent(urlSearchParams.toString());\r\n};\r\n","{#if showLink}\n <div class={`itsl-progess-plan-link ${containerClass} ${secondaryStandaloneClass}`}>\n <Link\n href={linkUrl}\n {iconClass}\n iconPlacement=\"end\"\n {kind}\n on:click={handleLinkClick}\n >\n <span class=\"screen-reader\">\n {linkScreenReaderText}\n </span>\n <span aria-hidden=\"true\">\n {linkText}\n </span>\n </Link>\n </div>\n{/if}\n\n<script>\n import { onMount } from \"svelte\";\n import Link from \"@itslearning/prometheus/assets/Navigation/Link/v1/Link.svelte\";\n import { completePlan, uncompletePlan } from \"@its-ui/planner-common/api\";\n import config from \"../../config\";\n import {\n columnTypes,\n columnVisibility,\n onePlanAtATimePlanStatus,\n planType,\n } from \"../../constants\";\n import { addBackDestinationParam } from \"../../helpers/backLinkHelper\";\n import { postNewPlannerKpi } from \"../../helpers/kpiHelper\";\n import i18n from \"../../i18n\";\n\n export let backExtraParams = {};\n export let columnVisibilities = undefined;\n export let containerClass = \"\";\n export let courseId = undefined;\n export let iconClass = \"\";\n export let isPlanCard = false;\n export let kind = \"primary-standalone\";\n export let kpiContinue = config.kpi.kpiMeasurementContinuePlanCard;\n export let kpiStart = config.kpi.kpiMeasurementStartPlanCard;\n export let plan = undefined;\n export let startAtPlanPage = false;\n export let useGenericResourceColumn = false;\n export let useNextPlanFeature = true;\n\n let isContinue = false;\n let isNextPlan = false;\n let isStart = true;\n let linkText = i18n.start;\n let linkUrl = \"\";\n let linkScreenReaderText = i18n.startPlan;\n let showLink = false;\n\n const isComplete = plan.planStatus === onePlanAtATimePlanStatus.completed;\n const isLast = config.nextAvailablePlanId == null;\n const isReopened = plan.planStatus === onePlanAtATimePlanStatus.reopened;\n const secondaryStandaloneClass = \"\";\n const useBetterProgressionBetweenPlansWithoutDate = plan.useBetterProgressionBetweenPlansWithoutDate;\n\n let resourcesVisibility = config.columnVisibilities\n ? config.columnVisibilities[columnTypes.Resources]\n : undefined;\n let activitiesVisibility = config.columnVisibilities\n ? config.columnVisibilities[columnTypes.Activities]\n : undefined;\n let elementsVisibility = config.columnVisibilities\n ? config.columnVisibilities[columnTypes.Elements]\n : undefined;\n\n const hasElements = plan.elements.filter(e => !e.isFolder).length > 0;\n const allActivities = hasElements ? plan.elements.filter(e => !e.isResource && !e.isFolder) : [];\n const allResources = hasElements ? plan.elements.filter(e => e.isResource && !e.isFolder) : [];\n const isAllActivitiesCompleted = allActivities.every(e => e.isCompleted);\n const isAllResourcesCompleted = allResources.every(e => e.isCompleted);\n const isAllElementsCompleted = plan.elements.every(e => e.isCompleted || e.isFolder);\n const isNoResourcesCompleted = allResources.every(e => !e.isCompleted);\n const isNoActivitiesCompleted = allActivities.every(e => !e.isCompleted);\n\n let handleLinkClick = () => {};\n\n onMount(async () => {\n if((hasElements && isAllActivitiesCompleted) // Plan completed\n || (!hasElements && !isPlanCard && (config.planType == planType.deadLineDriven || config.planType == planType.allPlansAtOnce)) // Plans view, no elements, deadline-driven or all plans at once\n || (!hasElements && !isPlanCard && isLast)) { // Plans view, no elements, last plan\n handleCompletePlan();\n }\n\n isReopened && handleUncompletePlan();\n });\n\n $: canPlanBeSetAsCompleted =\n config.planType === planType.onePlanAtATime &&\n (plan.elements.length === 0 || plan.elements.every(e => e.isCompleted)) &&\n !isComplete;\n\n $: {\n if (resourcesVisibility === undefined && columnVisibilities) {\n resourcesVisibility = columnVisibilities[columnTypes.Resources];\n activitiesVisibility = columnVisibilities[columnTypes.Activities];\n elementsVisibility = columnVisibilities[columnTypes.Elements];\n }\n }\n\n $: areResourcesVisible = resourcesVisibility === columnVisibility.All;\n $: areActivitiesVisible = activitiesVisibility === columnVisibility.All;\n $: areElementsVisible = elementsVisibility === columnVisibility.All;\n\n $: {\n // Set link text\n let isLinkTextStart = false;\n let isLinkTextContinue = false;\n let isLinkTextNext = false;\n\n if (useGenericResourceColumn) {\n if (areElementsVisible) {\n isLinkTextContinue = plan.elements.some(e => e.isCompleted && !e.isFolder);\n isLinkTextNext = isAllElementsCompleted;\n } else {\n isLinkTextNext = true;\n }\n } else {\n isLinkTextContinue =\n (areResourcesVisible && !isAllResourcesCompleted) ||\n (areActivitiesVisible && !isAllActivitiesCompleted);\n isLinkTextNext =\n (!areResourcesVisible && !areActivitiesVisible) ||\n (areResourcesVisible && !areActivitiesVisible && isAllResourcesCompleted) ||\n (!areResourcesVisible && areActivitiesVisible && isAllActivitiesCompleted) ||\n (areResourcesVisible &&\n isAllResourcesCompleted &&\n areActivitiesVisible &&\n isAllActivitiesCompleted);\n isLinkTextStart = areResourcesVisible && isNoResourcesCompleted && areActivitiesVisible && isNoActivitiesCompleted;\n }\n\n isLinkTextStart ? setLinkStart() :\n isLinkTextNext && useNextPlanFeature\n ? setLinkNextPlan()\n : isLinkTextContinue\n ? setLinkContinue()\n : setLinkStart();\n }\n\n $: {\n let url = \"\";\n\n if (startAtPlanPage && isStart) {\n url = addBackDestinationParam(plan.url, backExtraParams);\n } else if (isNextPlan) {\n url = addBackDestinationParam(config.nextAvailablePlanUrl, backExtraParams);\n } else {\n let nextResource = undefined;\n\n if (useGenericResourceColumn && areElementsVisible) {\n nextResource = plan.elements.find(e => !e.isCompleted);\n } else {\n nextResource = areResourcesVisible && !isAllResourcesCompleted\n ? allResources.find(e => !e.isCompleted)\n : areActivitiesVisible && !isAllActivitiesCompleted\n ? allActivities.find(e => !e.isCompleted)\n : undefined;\n }\n\n if (nextResource) {\n url = addBackDestinationParam(\n `${plan.url}/element/${nextResource.id}`,\n backExtraParams,\n );\n } else if (canPlanBeSetAsCompleted && plan.elements.length > 0) {\n url = addBackDestinationParam(\n `${plan.url}/element/${plan.elements[plan.elements.length - 1].id}`,\n backExtraParams,\n );\n }\n }\n\n linkUrl = url;\n }\n\n $: {\n showLink =\n // Plan is completed or link is next plan and plan type deadline-driven\n ((isComplete || (hasElements && isAllElementsCompleted)) && !useNextPlanFeature)\n || (isNextPlan && config.planType == planType.deadLineDriven)\n ? false\n : isStart || isContinue || (isNextPlan && config.nextAvailablePlanId);\n\n // Hide start/continue link for plans without resources when \"Better Progression Between Plans Without Date\" is off\n if (!hasElements && !useBetterProgressionBetweenPlansWithoutDate) {\n showLink = false;\n }\n }\n\n const setLinkStart = () => {\n linkText = i18n.start;\n linkScreenReaderText = i18n.startPlan;\n isStart = true;\n isContinue = isNextPlan = false;\n handleLinkClick = redirect(handleCourseStartOrContinue);\n };\n\n const setLinkContinue = () => {\n linkText = i18n.continue;\n linkScreenReaderText = i18n.continuePlan;\n isContinue = true;\n isStart = isNextPlan = false;\n handleLinkClick = redirect(handleCourseStartOrContinue);\n };\n\n const setLinkNextPlan = () => {\n linkText = i18n.nextPlan;\n linkScreenReaderText = i18n.nextPlan;\n isNextPlan = true;\n isStart = isContinue = false;\n handleLinkClick = redirect(handleCompletePlan);\n };\n\n const handleCourseStartOrContinue = async () => {\n await postNewPlannerKpi(isContinue ? kpiContinue : kpiStart);\n };\n\n const handleCompletePlan = async () => {\n if (!isComplete) await completePlan(courseId, plan.id);\n };\n\n const handleUncompletePlan = async () => {\n if (isReopened) await uncompletePlan(courseId, plan.id);\n };\n\n const redirect = func => async (e) => {\n e.preventDefault();\n await func();\n window.location.href = linkUrl;\n };\n</script>\n","<div {id} class=\"itsl-progress-bar {cssClass}\">\r\n <label for=\"{id}-progress\">\r\n <span aria-hidden={validAccessibleTextString}>{value}/{max}</span>\r\n <span class=\"screen-reader\">{accessibleTextString}</span>\r\n </label>\r\n\r\n <progress\r\n id=\"{id}-progress\"\r\n {max}\r\n {value}\r\n aria-label={accessibleTextString}\r\n aria-valuenow={value}\r\n class=\"itsl-progress-bar__progress {progressCssClass}\"\r\n class:itsl-progress-bar__progress--full={value >= max}\r\n />\r\n</div>\r\n\r\n<script>\r\n import { formatLanguageString } from \"@itslearning/atlas/strings/format\";\r\n\r\n export let id = Math.random().toString(36).substring(2, 15);\r\n export let value = 0;\r\n export let max;\r\n export let cssClass = \"\";\r\n export let progressCssClass = \"\";\r\n export let accessibleText;\r\n\r\n $: accessibleTextString = accessibleText && formatLanguageString(accessibleText, value, max);\r\n $: validAccessibleTextString = accessibleTextString ? true : false;\r\n</script>\r\n","import { onePlanAtATimePlanStatus } from \"../constants\";\r\n\r\nexport const isPlanCompletedHelper = (plan) => {\r\n let isPlanCompleted = plan.planStatus === onePlanAtATimePlanStatus.completed;\r\n\r\n if(!isPlanCompleted && plan.elements?.some(e => !e.isFolder)) {\r\n isPlanCompleted = plan.elements.every(e => e.isFolder || e.isCompleted);\r\n }\r\n\r\n return isPlanCompleted;\r\n};\r\n","<li\n bind:this={cardElement}\n id=\"itsl-plan-card-{plan.id}\"\n class=\"itsl-plan-card {hiddenClass} {hoverSupportClass}\"\n role={keyboardReorder ? \"option\" : undefined}\n class:itsl-plan-card--shadow={dragAndDropSelected}\n class:itsl-plan-card--drag={keyboardReorderSelected}\n aria-selected={keyboardReorder ? keyboardReorderSelected : undefined}\n on:click={measurePlanOpensFromCalendar}\n>\n {#if isPlanClickable}\n <a\n tabindex={disabled ? -1 : 0}\n href={destinationUrl}\n class=\"itsl-plan-card__link\"\n aria-labelledby=\"{id}--title\"\n {target}\n rel=\"noopener\"\n on:click\n >\n <span class=\"screen-reader\">{titleText}</span>\n </a>\n {/if}\n {#if showSelect || showDrag}\n <div class=\"itsl-plan-card__controls\">\n {#if showSelect}\n <Checkbox\n bind:checked\n label=\"{i18n.select} {titleText}\"\n labelHidden\n small\n describedBy={null}\n on:change={updateCheckedStatus(plan.id, checked)}\n />\n {/if}\n {#if showDrag}\n <button\n bind:this={dragButton}\n id=\"{id}--drag\"\n class=\"itsl-plan-card__drag\"\n on:mousedown={mouseDownDragButton}\n on:touchstart={mouseDownDragButton}\n on:click={clickDragButton}\n on:keyup={keyUpDragButton}\n on:blur={blurDragButton}\n aria-labelledby=\"{id}--title\"\n aria-pressed={keyboardReorderSelected}\n ></button>\n <div\n class=\"itsl-plan-card__tooltip-container\"\n aria-live=\"polite\"\n class:itsl-plan-card__tooltip-container--visible={tooltipVisible}\n >\n {#if tooltipVisible}\n <Tooltip\n element={dragButton}\n id=\"{id}-drag-tip\"\n placement=\"bottom\"\n role=\"tooltip\"\n show={tooltipVisible}\n text={i18n.elementDragHandleTooltip}\n />\n {/if}\n </div>\n {/if}\n </div>\n {/if}\n\n <div class=\"itsl-plan-card__image\" style=\"{topicColorStyle} {imageStyle}\" role=\"img\" aria-label={plan.imageDescription}>\n {#if !canEdit && userCanStartPlan && isLearner}\n <ProgressPlanLink\n {backExtraParams}\n {columnVisibilities}\n containerClass=\"itsl-plan-card__image-button\"\n courseId={config.courseId}\n iconClass=\"itsl-plan-card__image-button-icon\"\n isPlanCard={true}\n kind=\"standalone\"\n {plan}\n startAtPlanPage={true}\n useNextPlanFeature={false}\n useGenericResourceColumn={config.useGenericResourceColumn ||\n useGenericResourceColumn}\n />\n {/if}\n\n {#if !plan.imageUrl && !plan.placeholderImageUrl}\n <div class=\"itsl-plan-card__image-icon\"></div>\n {/if}\n </div>\n\n <div class=\"itsl-plan-card__info\">\n <div class=\"itsl-plan-card__header\">\n <div class=\"itsl-plan-card__title\" id=\"{id}--title\">\n <h3>\n {titleText}\n </h3>\n <div class=\"itsl-plan-card__hidden-indicator\">\n <span class=\"screen-reader\">{i18n ? i18n.hidden : undefined}</span>\n </div>\n </div>\n {#if plan.topic}\n {#if hasAccessToPlan && showTopicAsLink}\n <a\n tabindex={disabled ? -1 : 0}\n href={plan.topic.url}\n style={topicColorStyle}\n class=\"itsl-plan-card__topic\"\n {target}\n rel=\"noopener\"\n >\n <span>{plan.topic.name}</span>\n <span class=\"screen-reader\">: {topicName}</span>\n </a>\n {:else}\n <span style={topicColorStyle} class=\"itsl-plan-card__topic\">\n <span>{plan.topic.name}</span>\n <span class=\"screen-reader\">: {topicName}</span>\n </span>\n {/if}\n {/if}\n {#if isCourseOverviewPage && !isSelfPacedCourseOnePlanAtATime && plan.pinned}\n <div class=\"pinned-mark\">{i18n.pinned}</div>\n {/if}\n </div>\n\n <p class=\"itsl-plan-card__body\">\n {#if plan.description}\n {#if plan.isDescriptionPlainText}\n {plan.description}\n {:else}\n {getShortDescription()}\n {/if}\n {/if}\n </p>\n\n <footer class=\"itsl-plan-card__footer\">\n {#if plan.start && plan.stop && isDateVisible(columnVisibilities, canEdit)}\n <div class=\"itsl-plan-card__footer-item itsl-plan-card__footer-item--calendar\">\n <div>{dateText}</div>\n </div>\n {/if}\n {#if events}\n <div class=\"itsl-plan-card__footer-item itsl-plan-card__footer-item--event\">\n <div>{events}</div>\n </div>\n {/if}\n {#if linkedCourses}\n <div class=\"itsl-plan-card__footer-item itsl-plan-card__footer-item--link\">\n <div>{linkedCourses}</div>\n </div>\n {/if}\n {#if canCurrentUserCompleteElements}\n {#if isPlanLocked}\n <div\n class=\"itsl-plan-card__footer-item itsl-plan-card__footer-item--locked-status\"\n >\n <div class=\"itsl-plan-card__status\">{i18n.locked}</div>\n </div>\n {:else if isPlanCompleted}\n <PlanCompleted />\n {/if}\n {/if}\n {#if showResources() && !isPlanCompleted}\n {#if userCanStartPlan && canCurrentUserCompleteElements && resourcesCompleted !== undefined}\n <div class=\"itsl-plan-card__footer-item\">\n <ProgressBar\n value={resourcesActivitiesCompleted()}\n max={countMaxProgressBar()}\n accessibleText={i18n.xOfYCompleted}\n />\n </div>\n {:else}\n <div class=\"itsl-plan-card__footer-item itsl-plan-card__footer-item--file\">\n <div>{resources}</div>\n </div>\n {/if}\n {/if}\n </footer>\n </div>\n\n <div class=\"itsl-plan-card__spread\"></div>\n</li>\n\n<script>\n import { onMount, createEventDispatcher } from \"svelte\";\n import { get } from \"svelte/store\";\n import { isMobile, isIpad } from \"@itslearning/atlas/detectors/UserAgentHelper\";\n import { Keys } from \"@itslearning/atlas/keyboard/keys\";\n import { normalizeKey } from \"@itslearning/atlas/keyboard/normalize\";\n import { formatLanguageString } from \"@itslearning/atlas/strings/format.js\";\n import Checkbox from \"@itslearning/prometheus/assets/inputs/Checkbox/v1/Checkbox.svelte\";\n import Tooltip from \"@itslearning/prometheus/assets/modals/Tooltip/v1/Tooltip.svelte\";\n import PlanCompleted from \"@its-ui/planner-common/components/PlanCompleted/PlanCompleted.svelte\";\n import ProgressPlanLink from \"@its-ui/planner-common/components/ProgressPlanLink/ProgressPlanLink.svelte\";\n import ProgressBar from \"../ProgressBar/ProgressBar.svelte\";\n import { addBackDestinationParam } from \"../../helpers/backLinkHelper\";\n import { getDateRangeString } from \"../../helpers/dateHelper\";\n import { isPlanCompletedHelper } from \"../../helpers/isPlanCompletedHelper\";\n import { postNewPlannerKpi } from \"../../helpers/kpiHelper\";\n import { isDateVisible } from \"../../helpers/visibilityHelper\";\n import config from \"../../config\";\n import {\n columnTypes,\n columnVisibility,\n resourceTypeToShow,\n planType,\n onePlanAtATimePlanStatus,\n } from \"../../constants\";\n import i18n from \"../../i18n\";\n\n const getPlanBackgroundImageStyle = backgroundImageUrl =>\n `background-image: url('${backgroundImageUrl}'); background-color: transparent;`;\n\n export let plan = undefined;\n export let id = Math.random().toString(36).substr(2, 9);\n export let checked = false;\n export let eventsCount = 0;\n export let linkedCoursesCount = 0;\n export let showSelect = false;\n export let showDrag = false;\n export let locale = undefined;\n export let disabled = false;\n export let hasAccessToPlan = true;\n export let canEdit = false;\n export let isLearner = false;\n export let topicName = \"\";\n export let showTopicAsLink = true;\n export let target = \"_self\";\n export let backExtraParams = {};\n export let keyboardReorderSelected;\n export let dragAndDropSelected;\n export let keyboardReorder;\n export let columnVisibilities;\n export let useGenericResourceColumn;\n export let selectedPlanIds = {\n set: () => {},\n };\n export let isCourseOverviewPage = false;\n\n const resourceCount = plan.elements.filter(\n planElement => planElement.isResource && !planElement.isFolder\n ).length;\n const activityCount = plan.elements.filter(planElement => !planElement.isResource).length;\n const resourcesCompleted = plan.elements.filter(\n planElement => planElement.isResource && !planElement.isFolder && planElement.isCompleted\n ).length;\n const activitiesCompleted = plan.elements.filter(\n planElement => !planElement.isResource && planElement.isCompleted\n ).length;\n\n const isPlanLocked =\n config.planType === planType.onePlanAtATime &&\n plan.planStatus === onePlanAtATimePlanStatus.locked;\n\n let cardElement;\n let dragButton;\n let isPlanCompleted = false;\n let tooltipVisible = false;\n let isSelfPacedCourseOnePlanAtATime = config.isNewPlannerBetterProgressionBetweenPlansEnabled && config.planType === planType.onePlanAtATime;\n\n onMount(async () => {\n if (window.loadIframelyEmbedJs) {\n window.loadIframelyEmbedJs();\n }\n\n isPlanCompleted = isPlanCompletedHelper(plan);\n });\n\n const dispatch = createEventDispatcher();\n\n $: dateText =\n plan.start && plan.stop ? getDateRangeString(plan.start, plan.stop, locale) : i18n.noDate;\n $: destinationUrl = addBackDestinationParam(plan.url, backExtraParams);\n $: imageStyle = plan.imageUrl\n ? getPlanBackgroundImageStyle(plan.imageUrl)\n : plan.placeholderImageUrl\n ? getPlanBackgroundImageStyle(plan.placeholderImageUrl)\n : \"\";\n $: hiddenClass = plan.isActive ? \"\" : \"itsl-plan-card--hidden\";\n $: hoverSupportClass =\n isMobile() || isIpad() || !userCanStartPlan ? \"\" : \"itsl-plan-card--hover-support\";\n $: titleText = plan.title || (i18n ? i18n.noTitle : \"\");\n $: topicColorStyle = plan.topic ? `background-color: ${plan.topic.color};` : \"\";\n\n let events;\n\n $: {\n if (eventsCount === 1) {\n events = i18n ? i18n.oneEvent : undefined;\n } else if (eventsCount > 1 && i18n && i18n.multipleEvents) {\n events = i18n.multipleEvents.replace(\"{0}\", eventsCount);\n } else {\n events = undefined;\n }\n }\n\n /**\n * Return an int that will describe what type of resource has to be shown;\n * @returns {int} 0 it shows resources and activities, 1 just resources, 2 just activities\n */\n let resources;\n let areResourcesAndActivitiesCombined;\n\n $: areResourcesAndActivitiesCombined =\n config.useGenericResourceColumn === true || useGenericResourceColumn === true;\n\n $: {\n const typeToShow = isResourceOrActivities();\n\n if (areResourcesAndActivitiesCombined) {\n if (resourceCount + activityCount > 1) {\n resources = formatLanguageString(\n i18n.multipleResources,\n resourceCount + activityCount,\n );\n } else if (resourceCount + activityCount === 1) {\n resources = i18n ? i18n.oneResource : undefined;\n } else {\n resources = undefined;\n }\n } else {\n if (\n (resourceCount + activityCount === 1 &&\n typeToShow === resourceTypeToShow.everything) ||\n (resourceCount === 1 && typeToShow === resourceTypeToShow.resources) ||\n (activityCount === 1 && typeToShow === resourceTypeToShow.activities)\n ) {\n resources = i18n ? i18n.oneResource : undefined;\n } else if (resourceCount + activityCount > 1 && i18n && i18n.multipleResources) {\n if (typeToShow === resourceTypeToShow.everything) {\n resources = formatLanguageString(\n i18n.multipleResources,\n resourceCount + activityCount,\n );\n } else if (typeToShow === resourceTypeToShow.resources) {\n if (resourceCount > 1) {\n resources = formatLanguageString(i18n.multipleResources, resourceCount);\n } else {\n resources = undefined;\n }\n } else if (typeToShow === resourceTypeToShow.activities) {\n if (activityCount > 1) {\n resources = formatLanguageString(i18n.multipleResources, activityCount);\n } else {\n resources = undefined;\n }\n }\n } else {\n resources = undefined;\n }\n }\n }\n\n let linkedCourses;\n\n $: {\n if (linkedCoursesCount === 1) {\n linkedCourses = i18n ? i18n.oneLinkedCourse : undefined;\n } else if (linkedCoursesCount > 1 && i18n && i18n.multipleLinkedCourses) {\n linkedCourses = i18n.multipleLinkedCourses.replace(\"{0}\", linkedCoursesCount);\n } else {\n linkedCourses = undefined;\n }\n }\n\n $: canCurrentUserCompleteElements = !canEdit && isLearner;\n\n $: userCanStartPlan = !canCurrentUserCompleteElements || !isPlanLocked;\n\n $: isPlanClickable = hasAccessToPlan && userCanStartPlan;\n\n function updateCheckedStatus(id, checked) {\n const selectedPlans = get(selectedPlanIds);\n\n if (!checked) {\n selectedPlans.delete(id);\n } else {\n selectedPlans.add(id);\n }\n\n selectedPlanIds.set(selectedPlans);\n }\n\n function mouseDownDragButton(e) {\n dispatch(\"dragStart\", e);\n }\n\n function clickDragButton(e) {\n dispatch(\"keyboardDragStart\", e);\n }\n\n function keyUpDragButton(e) {\n if (normalizeKey(e.key) === Keys.TAB) {\n tooltipVisible = true;\n }\n }\n\n function blurDragButton() {\n tooltipVisible = false;\n }\n\n /**\n * Return a boolean that tells if 'resources' section has to be shown;\n * @returns {boolean} `true` it shows 'resources' section, `false` it does not show.\n */\n function isResourceVisible() {\n let resourcesVisibility = config.columnVisibilities\n ? config.columnVisibilities[columnTypes.Resources]\n : undefined;\n let activitiesVisibility = config.columnVisibilities\n ? config.columnVisibilities[columnTypes.Activities]\n : undefined;\n\n if (\n !config.columnVisibilities ||\n resourcesVisibility === undefined ||\n config.canEdit === undefined\n ) {\n // Check if calendar\n if (columnVisibilities) {\n resourcesVisibility = columnVisibilities[columnTypes.Resources];\n activitiesVisibility = columnVisibilities[columnTypes.Activities];\n\n // Check if teacher logged in\n if (!isLearner) {\n return !(\n resourcesVisibility === columnVisibility.Nobody &&\n activitiesVisibility === columnVisibility.Nobody\n );\n } else if (isLearner) {\n // If student\n return (\n resourcesVisibility === columnVisibility.All ||\n activitiesVisibility === columnVisibility.All\n );\n }\n } else {\n return true;\n }\n }\n\n // Check if teacher logged in\n if (config.canEdit) {\n return !(\n resourcesVisibility === columnVisibility.Nobody &&\n activitiesVisibility === columnVisibility.Nobody\n );\n } else if (config.canEdit === false) {\n // If student\n return (\n resourcesVisibility === columnVisibility.All ||\n activitiesVisibility === columnVisibility.All\n );\n }\n }\n\n /**\n * When to show when there is one field for resources and activities.\n * @returns {boolean} `true` it shows resources and activities, `false` does not show.\n */\n function isResourceActivitiesVisible() {\n let resourcesVisibility = config.columnVisibilities\n ? config.columnVisibilities[columnTypes.Elements]\n : undefined;\n\n if (\n !config.columnVisibilities ||\n resourcesVisibility === undefined ||\n config.canEdit === undefined\n ) {\n // Check if calendar\n if (columnVisibilities) {\n resourcesVisibility = columnVisibilities[columnTypes.Elements];\n\n // Check if teacher logged in\n if (!isLearner) {\n return !(resourcesVisibility === columnVisibility.Nobody);\n } else if (isLearner) {\n // If student\n return resourcesVisibility === columnVisibility.All;\n }\n } else {\n return true;\n }\n }\n\n // Check if teacher logged in\n if (config.canEdit) {\n return !(resourcesVisibility === columnVisibility.Nobody);\n } else if (config.canEdit === false) {\n // If student\n return resourcesVisibility === columnVisibility.All;\n }\n }\n\n /**\n * Return an int that will describe what type of resource has to be shown;\n * @returns {int} 0 it shows resources and activities, 1 just resources, 2 just activities\n */\n function isResourceOrActivities() {\n let resourcesVisibility = config.columnVisibilities\n ? config.columnVisibilities[columnTypes.Resources]\n : undefined;\n let activitiesVisibility = config.columnVisibilities\n ? config.columnVisibilities[columnTypes.Activities]\n : undefined;\n\n if (!config.columnVisibilities || resourcesVisibility === undefined) {\n // Check if calendar\n if (columnVisibilities) {\n resourcesVisibility = columnVisibilities[columnTypes.Resources];\n activitiesVisibility = columnVisibilities[columnTypes.Activities];\n\n if (!isLearner) {\n if (\n (resourcesVisibility === columnVisibility.Teacher ||\n resourcesVisibility === columnVisibility.All) &&\n activitiesVisibility === columnVisibility.Nobody\n ) {\n return resourceTypeToShow.resources;\n }\n\n if (\n (activitiesVisibility === columnVisibility.Teacher ||\n activitiesVisibility === columnVisibility.All) &&\n resourcesVisibility === columnVisibility.Nobody\n ) {\n return resourceTypeToShow.activities;\n }\n } else if (isLearner) {\n // If student\n if (\n (activitiesVisibility === columnVisibility.Teacher ||\n activitiesVisibility === columnVisibility.Nobody) &&\n resourcesVisibility === columnVisibility.All\n ) {\n return resourceTypeToShow.resources;\n } else if (\n (resourcesVisibility === columnVisibility.Nobody ||\n resourcesVisibility === columnVisibility.Teacher) &&\n activitiesVisibility === columnVisibility.All\n ) {\n return resourceTypeToShow.activities;\n }\n }\n\n return resourceTypeToShow.everything;\n } else {\n return resourceTypeToShow.everything;\n }\n }\n\n // Check if Teacher logged in\n if (config.canEdit) {\n if (\n (resourcesVisibility === columnVisibility.Teacher ||\n resourcesVisibility === columnVisibility.All) &&\n activitiesVisibility === columnVisibility.Nobody\n ) {\n return resourceTypeToShow.resources;\n }\n\n if (\n (activitiesVisibility === columnVisibility.Teacher ||\n activitiesVisibility === columnVisibility.All) &&\n resourcesVisibility === columnVisibility.Nobody\n ) {\n return resourceTypeToShow.activities;\n }\n }\n // If student\n else if (!config.canEdit) {\n if (\n (activitiesVisibility === columnVisibility.Teacher ||\n activitiesVisibility === columnVisibility.Nobody) &&\n resourcesVisibility === columnVisibility.All\n ) {\n return resourceTypeToShow.resources;\n } else if (\n (resourcesVisibility === columnVisibility.Nobody ||\n resourcesVisibility === columnVisibility.Teacher) &&\n activitiesVisibility === columnVisibility.All\n ) {\n return resourceTypeToShow.activities;\n }\n }\n\n return resourceTypeToShow.everything;\n }\n\n function countMaxProgressBar() {\n const typeToShow = isResourceOrActivities();\n\n if (areResourcesAndActivitiesCombined) {\n return resourceCount + activityCount;\n } else if (typeToShow === resourceTypeToShow.everything) {\n return resourceCount + activityCount;\n } else if (typeToShow === resourceTypeToShow.resources) {\n return resourceCount;\n } else if (typeToShow === resourceTypeToShow.activities) {\n return activityCount;\n }\n }\n\n function resourcesActivitiesCompleted() {\n const typeToShow = isResourceOrActivities();\n\n if (areResourcesAndActivitiesCombined) {\n return resourcesCompleted + activitiesCompleted;\n } else if (typeToShow === resourceTypeToShow.everything) {\n return resourcesCompleted + activitiesCompleted;\n } else if (typeToShow === resourceTypeToShow.resources) {\n return resourcesCompleted;\n } else if (typeToShow === resourceTypeToShow.activities) {\n return activitiesCompleted;\n }\n }\n\n function showResources() {\n return (\n (isResourceVisible() &&\n resources &&\n (config.useGenericResourceColumn === false ||\n useGenericResourceColumn === false)) ||\n (isResourceActivitiesVisible() && resources && areResourcesAndActivitiesCombined)\n );\n }\n\n const getShortDescription = () => {\n if (plan.description === null || plan.description === undefined) {\n return \"\";\n }\n\n const temporaryElement = document.createElement(\"div\");\n\n temporaryElement.innerHTML = plan.description;\n\n return temporaryElement.textContent.trim();\n };\n\n function measurePlanOpensFromCalendar(event) {\n if (!isPlanClickable) {\n event.stopPropagation();\n event.preventDefault();\n\n return;\n }\n\n if (config.redirectFromCalendar) {\n postNewPlannerKpi(config.kpi.kpiMeasurementOpenPlanFromCalendar);\n }\n }\n</script>\n","<label {id} class=\"prom-switch {cssClass}\">\n <input\n type=\"checkbox\"\n class=\"prom-switch__input | screen-reader\"\n {disabled}\n name=\"{nameText}\"\n value=\"{value}\"\n bind:checked\n on:click={handleClick}\n />\n <span class=\"prom-switch__custom-button\">\n <span class=\"prom-switch__custom-button-inner\"></span>\n </span>\n <span class=\"prom-switch__label-text\">\n {labelText}\n </span>\n</label>\n\n<script>\n import { createEventDispatcher } from 'svelte';\n\n const dispatch = createEventDispatcher();\n\n /** @type {boolean} */\n export let checked = false;\n\n /** @type {boolean} */\n export let disabled = false;\n\n /** @type {string} */\n export let id = '';\n\n /** @type {string} */\n export let label = undefined;\n\n /** @type {string} */\n export let name = undefined;\n\n /** @type {string} */\n export let value = undefined;\n\n let cssClass\n\n $ : {\n cssClass = disabled ? 'disabled' : '';\n }\n\n let labelText;\n\n $: {\n if (!label || typeof label !== 'string') {\n throw new TypeError('Label must be supplied');\n }\n\n labelText = label;\n }\n\n let nameText;\n\n $: {\n if (!name || typeof name !== 'string') {\n throw new TypeError('Name must be supplied');\n }\n\n nameText = name;\n }\n\n function handleClick() {\n dispatch('click', { checked });\n }\n</script>\n","import { get } from \"svelte/store\";\r\nimport {\r\n getPlansInTopic,\r\n getPlansInTopicPublic,\r\n getTopic,\r\n getTopicPublic,\r\n getTopics,\r\n getTopicsPublic\r\n} from \"../api\";\r\nimport config from \"../config\";\r\nimport { createPlaceholderImagesProvider } from \"./planImageHelper\";\r\n\r\nexport function loadTopics(store, publicAccessKey) {\r\n store.update(data => {\r\n data.loading = true;\r\n data.error = undefined;\r\n\r\n return data;\r\n });\r\n\r\n store.update(data => {\r\n data.topics = [];\r\n\r\n return data;\r\n });\r\n\r\n const getPlansApiMethod = publicAccessKey ? getPlansInTopicPublic : getPlansInTopic;\r\n\r\n getPlansApiMethod(0)\r\n .then(result => {\r\n store.update(data => {\r\n data.plansWithoutTopicCount = result.total;\r\n\r\n return data;\r\n });\r\n })\r\n .catch(error => {\r\n store.update(data => {\r\n data.error = error;\r\n\r\n return data;\r\n });\r\n });\r\n\r\n const getTopicsApiMethod = publicAccessKey ? getTopicsPublic : getTopics;\r\n\r\n getTopicsApiMethod()\r\n .then(result => {\r\n store.update(data => {\r\n result = result.map(p => {\r\n if (p.start) {\r\n p.start = new Date(p.start);\r\n p.stop = new Date(p.stop);\r\n }\r\n\r\n return p;\r\n });\r\n\r\n data.topics = result;\r\n data.loading = false;\r\n\r\n return data;\r\n });\r\n })\r\n .catch(error => {\r\n store.update(data => {\r\n data.loading = false;\r\n data.error = error;\r\n\r\n return data;\r\n });\r\n });\r\n}\r\n\r\nexport function loadTopic(store, publicAccessKey, id) {\r\n store.update(data => {\r\n data.loading = true;\r\n data.error = undefined;\r\n data.topic = undefined;\r\n\r\n return data;\r\n });\r\n\r\n const apiMethod = publicAccessKey ? getTopicPublic : getTopic;\r\n\r\n return apiMethod(id)\r\n .then(result => {\r\n store.update(data => {\r\n if (result.start) {\r\n result.start = new Date(result.start);\r\n result.stop = new Date(result.stop);\r\n }\r\n\r\n data.topic = result;\r\n data.loading = false;\r\n\r\n return data;\r\n });\r\n })\r\n .catch(error => {\r\n store.update(data => {\r\n data.loading = false;\r\n data.error = error;\r\n\r\n return data;\r\n });\r\n });\r\n}\r\n\r\nexport const loadTopicsForTableView = async ({ store, apiMethod } = {}) =>\r\n await loadTableViewModeTopics(store, apiMethod);\r\n\r\nexport async function loadPagedTopics(store, apiMethod, append) {\r\n startLoading(store);\r\n let index = 0;\r\n\r\n if (append) {\r\n const { currentPageIndex } = get(store);\r\n\r\n index = currentPageIndex + 1;\r\n } else {\r\n store.update(data => {\r\n data.topics = [];\r\n data.placeholderImagesProvider = createPlaceholderImagesProvider(\r\n config.topicColours,\r\n config.defaultPlanImages\r\n );\r\n\r\n return data;\r\n });\r\n }\r\n\r\n try {\r\n const result = await apiMethod(index);\r\n\r\n applyResult(store, result, append);\r\n } catch (error) {\r\n handleError(store, error);\r\n }\r\n}\r\n\r\nexport async function loadTableViewModeTopics(store, apiMethod) {\r\n startLoading(store);\r\n\r\n const { currentPageIndex, pageSize } = get(store);\r\n\r\n store.update(data => {\r\n data.topics = [];\r\n data.placeholderImagesProvider = createPlaceholderImagesProvider(\r\n config.topicColours,\r\n config.defaultPlanImages\r\n );\r\n\r\n return data;\r\n });\r\n\r\n try {\r\n const result = await apiMethod(currentPageIndex, pageSize);\r\n\r\n applyResult(store, result);\r\n } catch (error) {\r\n handleError(store, error);\r\n }\r\n}\r\n\r\nfunction startLoading(store) {\r\n store.update(data => {\r\n data.loading = true;\r\n data.error = undefined;\r\n\r\n return data;\r\n });\r\n}\r\n\r\nfunction applyResult(store, result, append = false) {\r\n store.update(data => {\r\n const topics = buildUpTopics(result, data.placeholderImagesProvider);\r\n\r\n result.topics = append ? [...data.topics, ...topics] : topics;\r\n data = result;\r\n data.loading = false;\r\n\r\n return data;\r\n });\r\n}\r\n\r\nfunction buildUpTopics(topics, placeholderImagesProvider) {\r\n return topics.entityArray.map(topic => {\r\n setPlaceholderImageUrl(topic, placeholderImagesProvider);\r\n\r\n return topic;\r\n });\r\n}\r\n\r\nfunction setPlaceholderImageUrl(topic, placeholderImagesProvider) {\r\n if (!topic || !placeholderImagesProvider) {\r\n return;\r\n }\r\n\r\n topic.placeholderImageUrl = topic.imageUrl\r\n ? null\r\n : placeholderImagesProvider.getImageForTopic(topic);\r\n}\r\n\r\nfunction handleError(store, error) {\r\n console.error(error);\r\n\r\n store.update(data => {\r\n data.loading = false;\r\n data.error = error;\r\n\r\n return data;\r\n });\r\n\r\n return { error };\r\n}\r\n","import { writable } from \"svelte/store\";\r\n\r\nconst defaultPlanCounts = {\r\n planCounts: {\r\n currentPlansCount: 0,\r\n pastPlansCount: 0,\r\n withoutDatePlansCount: 0,\r\n topicsCount: 0,\r\n allPlansCount: 0\r\n },\r\n loading: true\r\n};\r\n\r\nconst defaultPlansData = {\r\n plans: [],\r\n total: 0,\r\n currentPageIndex: 0,\r\n loading: true\r\n};\r\n\r\nconst defaultTopicsData = {\r\n topics: [],\r\n loading: true\r\n};\r\n\r\nexport const currentPlansData = writable(defaultPlansData);\r\n\r\nexport const withoutDatePlansData = writable(defaultPlansData);\r\n\r\nexport const pastPlansData = writable(defaultPlansData);\r\n\r\nexport const topicsData = writable(defaultTopicsData);\r\n\r\nexport const selectedPlanIds = writable(new Set([]));\r\n\r\nexport const selectedTopicIds = writable(new Set([]));\r\n\r\nexport const allPlanCountsData = writable(defaultPlanCounts);\r\n\r\nexport const allPlansData = writable(defaultPlansData);\r\n","import {\r\n getCurrentPlans,\r\n getCurrentPlansPublic,\r\n getWithoutDatePlans,\r\n getWithoutDatePlansPublic,\r\n getPastPlans,\r\n getPastPlansPublic,\r\n getAllPlanCounts,\r\n getAllPlanCountsPublic,\r\n getAllPlans,\r\n getAllPlansPublic\r\n} from \"../../api\";\r\nimport { loadPlans, loadPlanCounts } from \"../../helpers/loadPlansHelper\";\r\nimport { loadTopics as loadTopicsHelper } from \"../../helpers/loadTopicsHelper\";\r\nimport {\r\n currentPlansData,\r\n withoutDatePlansData,\r\n pastPlansData,\r\n topicsData,\r\n allPlansData,\r\n allPlanCountsData\r\n} from \"./stores\";\r\n\r\nexport const loadCurrentPlans = (publicAccessKey = \"\", append = false) =>\r\n loadPlans(currentPlansData, publicAccessKey ? getCurrentPlansPublic : getCurrentPlans, append);\r\n\r\nexport const loadWithoutDatePlans = (publicAccessKey = \"\", append = false) =>\r\n loadPlans(\r\n withoutDatePlansData,\r\n publicAccessKey ? getWithoutDatePlansPublic : getWithoutDatePlans,\r\n append\r\n );\r\n\r\nexport const loadPastPlans = (publicAccessKey = \"\", append = false) =>\r\n loadPlans(pastPlansData, publicAccessKey ? getPastPlansPublic : getPastPlans, append);\r\n\r\nexport const loadTopics = (publicAccessKey = \"\") => loadTopicsHelper(topicsData, publicAccessKey);\r\n\r\nexport const loadAllPlanCounts = (publicAccessKey = \"\") =>\r\n loadPlanCounts(allPlanCountsData, publicAccessKey ? getAllPlanCountsPublic : getAllPlanCounts);\r\n\r\nexport const loadAllPlans = (publicAccessKey = \"\", append = false) =>\r\n loadPlans(allPlansData, publicAccessKey ? getAllPlansPublic : getAllPlans, append);\r\n","// @ts-check\n\n/**\n * @module dom/Ratecontrol\n */\n\n/**\n * Delay the execution of the function\n *\n * @export\n * @param {function} callback - Callback function\n * @param {number} wait - Time to wait (in miliseconds) before function is called\n * @param {*} immediate - Call function immediately\n * @returns {function}\n */\nexport function debounce(callback, wait, immediate) {\n let timeout;\n\n return function (...args) {\n const callNow = immediate && !timeout;\n\n window.clearTimeout(timeout);\n\n timeout = window.setTimeout(() => {\n timeout = null;\n\n if (!immediate) {\n callback.apply(this, args);\n }\n }, wait);\n\n if (callNow) {\n callback.apply(this, args);\n }\n };\n}\n\n/**\n * Limit the rate at which a function can fire.\n *\n * @export\n * @param {function} callback - Callback function\n * @param {number} thold - Time to wait (in miliseconds)\n * @param {*} scope\n * @returns {function}\n */\nexport function throttle(callback, thold, scope) {\n let last;\n let deferTimer;\n\n const threshold = thold || 250;\n\n return function (...args) {\n const context = scope || this;\n const now = Number(new Date());\n\n if (last && now < last + threshold) {\n // Hold on to it\n window.clearTimeout(deferTimer);\n\n deferTimer = window.setTimeout(() => {\n last = now;\n callback.apply(context, args);\n }, threshold);\n } else {\n last = now;\n callback.apply(context, args);\n }\n };\n}\n","import { writable } from \"svelte/store\";\r\n\r\nexport const plansData = writable({});\r\n\r\nexport const topicData = writable({});\r\n\r\nexport const selectedPlanIds = writable(new Set([]));\r\n","<svelte:window\r\n on:scroll={onScroll}\r\n on:mousemove={pointerMove}\r\n on:mouseup={dragEnd}\r\n on:touchend={dragEnd}\r\n on:touchmove={pointerMove}\r\n/>\r\n\r\n{#if data.plans.length < data.total}\r\n <Switch\r\n id=\"its-plans__autoloading-id\"\r\n name=\"its-plans__autoloading-toggle\"\r\n label={i18n.toggleAutoloadingOfPlans}\r\n bind:checked={isAutoloadingOn}\r\n on:click={toggleAutoloading}\r\n />\r\n{/if}\r\n\r\n<Modal\r\n id=\"show-replace-sorting-confirm-modal-id\"\r\n bind:enabled={showReplaceSortingConfirmModal}\r\n titleText={i18n.replaceSortingDialog_Heading}\r\n bodyHtml={i18n.replaceSortingDialog_Text}\r\n confirmText={i18n.replace}\r\n cancelText={i18n.cancel}\r\n confirmButtonType=\"destructive\"\r\n on:close={replaceSortingModalClicked}\r\n/>\r\n\r\n<section class=\"its-plans__list-section\" bind:this={listSection}>\r\n <ul\r\n class=\"its-plans__list\"\r\n tabindex=\"-1\"\r\n aria-labelledby=\"plans\"\r\n bind:this={listElement}\r\n role={keyboardReorder ? \"listbox\" : undefined}\r\n aria-activedescendant={keyboardReorderActiveId\r\n ? `itsl-plan-card-${keyboardReorderActiveId}`\r\n : undefined}\r\n on:keydown={listKeyDown}\r\n on:blur={listBlur}\r\n >\r\n {#each mainPlans as plan (plan.id)}\r\n <PlanCard\r\n {plan}\r\n showSelect={config.canEdit}\r\n locale={config.locale}\r\n showDrag={config.canEdit &&\r\n !isMobile() &&\r\n (isDraggable ||\r\n (config.enableTopicPlansOwnSortingFixedOption && plan.topic === null)) &&\r\n data.plans.length > 1}\r\n on:dragStart={e => dragStart(e.detail, plan)}\r\n on:keyboardDragStart={() => keyboardDragStart(plan)}\r\n keyboardReorderSelected={keyboardReorder && keyboardReorderActiveId === plan.id}\r\n keyboardReorderActive={keyboardReorder}\r\n dragAndDropSelected={dragSelectedPlan && plan.id === dragSelectedPlan.id}\r\n canEdit={config.canEdit}\r\n topicName={config.topicName}\r\n isLearner={config.isLearner}\r\n {selectedPlanIds}\r\n {columnVisibilities}\r\n {useGenericResourceColumn}\r\n ></PlanCard>\r\n {/each}\r\n </ul>\r\n {#if dragSelectedPlan}\r\n <div class=\"its-plans__plan-dragging\" style={draggedElementStyle}>\r\n <PlanCard\r\n plan={dragSelectedPlan}\r\n color={dragSelectedPlan.borderColor}\r\n showSelect={true}\r\n locale={config.locale}\r\n showDrag={true}\r\n canEdit={config.canEdit}\r\n topicName={config.topicName}\r\n isLearner={config.isLearner}\r\n {selectedPlanIds}\r\n {columnVisibilities}\r\n {useGenericResourceColumn}\r\n />\r\n </div>\r\n {/if}\r\n</section>\r\n\r\n{#if upcomingPlans.length}\r\n <div class=\"its-plans__upcoming-plans-divider\">\r\n <h3>{i18n.upcomingPlans}</h3>\r\n </div>\r\n\r\n <ul class=\"its-plans__list\">\r\n {#each upcomingPlans as plan (plan.id)}\r\n <li>\r\n <PlanCard\r\n {plan}\r\n {i18n}\r\n showSelect={config.canEdit}\r\n locale={config.locale}\r\n showDrag={config.canEdit && isDraggable}\r\n canEdit={config.canEdit}\r\n topicName={config.topicName}\r\n isLearner={config.isLearner}\r\n {selectedPlanIds}\r\n {columnVisibilities}\r\n {useGenericResourceColumn}\r\n ></PlanCard>\r\n </li>\r\n {/each}\r\n </ul>\r\n{/if}\r\n\r\n<div aria-live=\"polite\" aria-atomic=\"true\">\r\n {#if showLoading}\r\n <div class=\"its-plans__loading\" aria-busy={data.loading}>\r\n <span class=\"screen-reader\">{i18n.loading}</span>\r\n </div>\r\n {/if}\r\n</div>\r\n\r\n{#if (!data.loading || !isAutoloadingOn) && data.plans.length < data.total}\r\n <div class=\"its-plans__show-more\">\r\n {#if loadingError}\r\n <span class=\"its-plans__show-more-error\">{i18n.friendlyUnknownError}</span>\r\n {/if}\r\n <Button type=\"plain\" htmlType=\"button\" text={i18n.showMore} on:click={showMore} />\r\n </div>\r\n{/if}\r\n\r\n<script>\r\n import PlanCard from \"../PlanCard/PlanCard.svelte\";\r\n import i18n from \"../../i18n\";\r\n import config from \"../../config\";\r\n import Button from \"@itslearning/prometheus/assets/inputs/Button/v1/Button.svelte\";\r\n import Switch from \"@itslearning/prometheus/assets/inputs/Switch/v1/Switch.svelte\";\r\n import Modal from \"@itslearning/prometheus/assets/modals/Modal/v2/Modal.svelte\";\r\n import {\r\n dragAndDropPlanInLesson,\r\n setPlanOrderInTopic,\r\n getPlanOrderInTopic,\r\n dragAndDropPlanInTopic\r\n } from \"../../api\";\r\n import { loadAllPlans, loadWithoutDatePlans } from \"../../logic/plans/loadDataController\";\r\n import { normalizeKey } from \"@itslearning/atlas/keyboard/normalize\";\r\n import { Keys } from \"@itslearning/atlas/keyboard/keys\";\r\n import { debounce } from \"@itslearning/atlas/dom/Ratecontrol\";\r\n import { onMount, createEventDispatcher } from \"svelte\";\r\n import { isMobile } from \"@itslearning/atlas/detectors/UserAgentHelper\";\r\n import { loadPlansForTopic } from \"../../helpers/loadPlansHelper\";\r\n import { plansData } from \"../../logic/topicPage/stores\";\r\n import { planSorting } from \"../../constants\";\r\n\r\n export let selectedPlanIds = {\r\n set: () => {}\r\n };\r\n\r\n const upcomingSplitTime = new Date(config.endOfCurrentDay).getTime();\r\n const dispatch = createEventDispatcher();\r\n\r\n export let columnVisibilities;\r\n export let data;\r\n export let drag;\r\n export let loadMethod;\r\n export let separateUpcomingPlans = false;\r\n export let useGenericResourceColumn;\r\n\r\n let showLoading;\r\n let scrollBottom;\r\n let loadingError;\r\n let orderDirty = false;\r\n let keyboardReorder = false;\r\n let keyboardReorderActiveId;\r\n let reorderDragHandleId;\r\n let draggedElementTop;\r\n let dragSelectedPlan = undefined;\r\n let sourceSelectedPlan = undefined;\r\n let targetSelectedPlan = undefined;\r\n let targetSelectedPlanAfter = false;\r\n let debounceSavePlanOrder;\r\n let listSection;\r\n let listElement;\r\n let dragScrolling = false;\r\n let newPlanUpdatePerformed = false;\r\n let isAutoloadingOn = true;\r\n\r\n const isDraggable = loadMethod === loadWithoutDatePlans || loadMethod === loadAllPlans || drag;\r\n\r\n let showReplaceSortingConfirmModal = false;\r\n let dragConfirmed = false;\r\n let currentPlanOrder = planSorting.NotSetValue;\r\n let dragIconElements = null;\r\n\r\n $: mainPlans = separateUpcomingPlans\r\n ? data.plans.filter(p => p.start && p.start.getTime() <= upcomingSplitTime)\r\n : data.plans;\r\n $: upcomingPlans = separateUpcomingPlans\r\n ? data.plans.filter(p => p.start && p.start.getTime() > upcomingSplitTime)\r\n : [];\r\n\r\n $: if (data.loading) {\r\n setTimeout(() => {\r\n showLoading = data.loading;\r\n }, 100);\r\n } else {\r\n if (!newPlanUpdatePerformed) {\r\n newPlanUpdatePerformed = true;\r\n const queryString = window.location.search;\r\n const urlParams = new URLSearchParams(queryString);\r\n const planIdParam = urlParams.get(\"createdPlanId\");\r\n\r\n if (planIdParam) {\r\n urlParams.delete(\"createdPlanId\");\r\n }\r\n }\r\n\r\n showLoading = false;\r\n }\r\n\r\n $: if (orderDirty) {\r\n dragIconElements = document.getElementsByClassName(\"itsl-plan-card__drag\");\r\n\r\n if (dragIconElements) {\r\n for (let i = 0; i < dragIconElements.length; i++) {\r\n dragIconElements[i].setAttribute(\"disabled\", true);\r\n dragIconElements[i].classList.add(\"itsl-plan-card__drag--dirtystate\");\r\n }\r\n }\r\n } else {\r\n dragIconElements = document.getElementsByClassName(\"itsl-plan-card__drag\");\r\n\r\n if (dragIconElements) {\r\n for (let i = 0; i < dragIconElements.length; i++) {\r\n dragIconElements[i].removeAttribute(\"disabled\");\r\n dragIconElements[i].classList.remove(\"itsl-plan-card__drag--dirtystate\");\r\n }\r\n }\r\n }\r\n\r\n $: draggedElementStyle = dragSelectedPlan ? `top: ${draggedElementTop}px;` : \"\";\r\n\r\n onMount(() => {\r\n // Debounce saves to the plan order to limit requests and to avoid race conditions\r\n // when two changes are made in quick succession.\r\n const runDebounceSavePlansOrder = debounce(savePlanOrder, 1000);\r\n\r\n debounceSavePlanOrder = () => {\r\n orderDirty = true;\r\n\r\n runDebounceSavePlansOrder();\r\n };\r\n });\r\n\r\n async function showMore() {\r\n loadingError = null;\r\n const index = data.plans.length;\r\n\r\n const result = await loadMethod(config.publicAccessKey, true);\r\n\r\n if (result && result.error) {\r\n loadingError = result.error;\r\n }\r\n\r\n if (data.plans.length >= index && !isAutoloadingOn) {\r\n changeFocus(index);\r\n }\r\n }\r\n\r\n function changeFocus(index) {\r\n const planId = data.plans[index].id;\r\n const elementId = `#itsl-plan-card-${planId} > a`;\r\n\r\n if (document.querySelector(elementId) !== null) {\r\n document.querySelector(elementId).focus();\r\n }\r\n }\r\n\r\n function moveDown(element, index) {\r\n if (index >= data.plans.length - 1) {\r\n return;\r\n }\r\n\r\n const target = data.plans[index + 1];\r\n\r\n movePlan(element, target, false);\r\n\r\n debounceSavePlanOrder();\r\n }\r\n\r\n function moveUp(element, index) {\r\n if (index <= 0) {\r\n return;\r\n }\r\n\r\n const target = data.plans[index - 1];\r\n\r\n movePlan(element, target, true);\r\n\r\n debounceSavePlanOrder();\r\n }\r\n\r\n // Moves one plan to a target plan's position in the list, inserting\r\n // it either immediately before or after depending on insertBefore\r\n function movePlan(plan, target, insertBefore) {\r\n const newElements = [...data.plans];\r\n const fromIndex = newElements.findIndex(e => e.id === plan.id);\r\n\r\n newElements.splice(fromIndex, 1);\r\n\r\n const toIndex = newElements.findIndex(e => e.id === target.id) + (insertBefore ? 0 : 1);\r\n\r\n newElements.splice(toIndex, 0, plan);\r\n\r\n data.plans = newElements;\r\n }\r\n\r\n function keyboardDragStart(plan) {\r\n reorderDragHandleId = document.activeElement.id;\r\n\r\n keyboardReorder = true;\r\n keyboardReorderActiveId = plan.id;\r\n\r\n setTimeout(() => listElement.focus(), 0);\r\n }\r\n\r\n function listKeyDown(event) {\r\n if (!keyboardReorder) {\r\n return;\r\n }\r\n\r\n const index = data.plans.findIndex(e => e.id === keyboardReorderActiveId);\r\n const activePlan = data.plans[index];\r\n\r\n let targetPlanIndex;\r\n\r\n switch (normalizeKey(event.key)) {\r\n case Keys.UP:\r\n moveUp(activePlan, index);\r\n event.preventDefault();\r\n scrollPlanToView(activePlan.id);\r\n break;\r\n case Keys.DOWN:\r\n moveDown(activePlan, index);\r\n event.preventDefault();\r\n scrollPlanToView(activePlan.id);\r\n break;\r\n case Keys.ESCAPE:\r\n case Keys.SPACE:\r\n case Keys.TAB:\r\n event.stopPropagation();\r\n event.preventDefault();\r\n\r\n keyboardReorder = false;\r\n keyboardReorderActiveId = undefined;\r\n\r\n sourceSelectedPlan = data.plans.filter(e => e.id === activePlan.id);\r\n targetPlanIndex = data.plans.findIndex(e => e.id === activePlan.id) + 1;\r\n\r\n // Check if plan card will be placed last\r\n if (targetPlanIndex === data.plans.length) {\r\n targetPlanIndex = data.plans.findIndex(e => e.id === activePlan.id) - 1;\r\n targetSelectedPlanAfter = true;\r\n } else {\r\n targetSelectedPlanAfter = false;\r\n }\r\n\r\n targetSelectedPlan = data.plans.filter(\r\n e => e.id === data.plans[targetPlanIndex].id\r\n );\r\n debounceSavePlanOrder();\r\n\r\n if (reorderDragHandleId) {\r\n setTimeout(() => document.getElementById(reorderDragHandleId).focus(), 0);\r\n }\r\n\r\n break;\r\n }\r\n }\r\n\r\n function scrollPlanToView(planId) {\r\n setTimeout(() => {\r\n document\r\n .getElementById(`itsl-plan-card-${planId}`)\r\n .scrollIntoView({ behavior: \"smooth\", block: \"center\" });\r\n }, 0);\r\n }\r\n\r\n function listBlur() {\r\n keyboardReorder = false;\r\n keyboardReorderActiveId = undefined;\r\n }\r\n\r\n // Start dragging by setting the dragSelectedplan and call pointerMove to position it correctly\r\n function dragStart(event, plan) {\r\n dragSelectedPlan = plan;\r\n\r\n pointerMove(event);\r\n }\r\n\r\n // While dragging an plan set its y position to the cursor's y pos and check for\r\n // other plans under the pointer to re-order the list\r\n function pointerMove(event) {\r\n if (dragSelectedPlan) {\r\n event.preventDefault();\r\n event.stopPropagation();\r\n\r\n const cursorPosY = event.touches ? event.touches[0].pageY : event.pageY;\r\n const scrollTop = document.body.parentElement.scrollTop;\r\n const offsetTop = scrollTop + listSection.getBoundingClientRect().y;\r\n\r\n draggedElementTop = cursorPosY - offsetTop;\r\n\r\n let elementRect;\r\n let elementTop;\r\n let dragOverElement;\r\n\r\n // Iterate over <li>s in the list and check if the pointer is within any of them\r\n for (let i = 0; i < listElement.children.length; i++) {\r\n elementRect = listElement.children[i].getBoundingClientRect();\r\n elementTop = elementRect.y + scrollTop;\r\n\r\n if (cursorPosY > elementTop && cursorPosY < elementTop + elementRect.height) {\r\n dragOverElement = data.plans[i];\r\n\r\n break;\r\n }\r\n }\r\n\r\n // If a plan (other than the dragged one) is hovered re-order the list to place the\r\n // dragged plan above or below the dragOverElement depending on pointer position.\r\n if (dragOverElement && dragOverElement.id !== dragSelectedPlan.id) {\r\n const insertBefore = cursorPosY - elementTop < elementRect.height / 2;\r\n\r\n movePlan(dragSelectedPlan, dragOverElement, insertBefore);\r\n }\r\n\r\n // If dragged element is at the bottom or top of the page start the scroll function\r\n if (cursorPosY - scrollTop > window.innerHeight - elementRect.height) {\r\n if (!dragScrolling) {\r\n dragScrolling = true;\r\n scrollWithDrag(true, cursorPosY);\r\n }\r\n } else if (cursorPosY - scrollTop < elementRect.height) {\r\n if (!dragScrolling) {\r\n dragScrolling = true;\r\n scrollWithDrag(false, cursorPosY);\r\n }\r\n } else {\r\n // Stop the scroll function when the cursor is out of the scroll area\r\n dragScrolling = false;\r\n }\r\n }\r\n }\r\n\r\n function scrollWithDrag(down) {\r\n // When scrolling down, if the bottom of the list is 25px above the bottom of the page\r\n if (down && listSection.getBoundingClientRect().bottom + 25 <= window.innerHeight) {\r\n dragScrolling = false;\r\n }\r\n\r\n // When scrolling up, if the page is already at the top, stop scrolling\r\n if (!down && document.body.parentElement.scrollTop <= 0) {\r\n dragScrolling = false;\r\n }\r\n\r\n if (!dragScrolling) {\r\n return;\r\n }\r\n\r\n const scrollAmount = down ? 3 : -3;\r\n\r\n document.body.parentElement.scrollTop += scrollAmount;\r\n\r\n // Move the dragged element to keep up with the moving page\r\n draggedElementTop += scrollAmount;\r\n\r\n // This function keeps calling itself until the max scroll is reached or dragScrolling is\r\n // false. This keeps the scroll smooth instead of jumping only when the pointer moves.\r\n setTimeout(() => {\r\n scrollWithDrag(down);\r\n }, 5);\r\n }\r\n\r\n // The list is reordered while dragging so once it is released trigger a save and stop\r\n // dragging the element\r\n function dragEnd() {\r\n if (dragSelectedPlan) {\r\n debounceSavePlanOrder();\r\n\r\n sourceSelectedPlan = data.plans.filter(e => e.id === dragSelectedPlan.id);\r\n let targetPlanIndex = data.plans.findIndex(e => e.id === dragSelectedPlan.id) + 1;\r\n\r\n // Check if plan card will be placed last\r\n if (targetPlanIndex === data.plans.length) {\r\n targetPlanIndex = data.plans.findIndex(e => e.id === dragSelectedPlan.id) - 1;\r\n targetSelectedPlanAfter = true;\r\n } else {\r\n targetSelectedPlanAfter = false;\r\n }\r\n\r\n targetSelectedPlan = data.plans.filter(e => e.id === data.plans[targetPlanIndex].id);\r\n\r\n dragSelectedPlan = null;\r\n dragScrolling = false;\r\n }\r\n }\r\n\r\n // Show \"Own sorting\" confirm modal if needed after drag & drop (for plans within single topic only)\r\n async function savePlanOrder() {\r\n if (isPlansInTopicView()) {\r\n const planOrder = await getPlanOrderInTopic(config.topicId);\r\n\r\n currentPlanOrder = planOrder;\r\n\r\n if (\r\n planOrder !== planSorting.YourOwnSortingValue &&\r\n !config.enableTopicPlansOwnSortingFixedOption\r\n ) {\r\n showReplaceSortingConfirmModal = true;\r\n } else {\r\n dragConfirmed = true;\r\n await savePlanOrderAfterConfirmation();\r\n }\r\n } else {\r\n dragConfirmed = true;\r\n await savePlanOrderAfterConfirmation();\r\n }\r\n }\r\n\r\n // Posts the new plan order to the API\r\n async function savePlanOrderAfterConfirmation() {\r\n orderDirty = true;\r\n\r\n if (isPlansInTopicView()) {\r\n if (!dragConfirmed) {\r\n await loadPlansForTopic(plansData, config.publicAccessKey, config.topicId);\r\n\r\n return;\r\n } else if (sourceSelectedPlan && targetSelectedPlan) {\r\n await dragAndDropPlanInTopic(\r\n sourceSelectedPlan[0].id,\r\n targetSelectedPlan[0].id,\r\n sourceSelectedPlan[0].topic ? sourceSelectedPlan[0].topic.id : null,\r\n targetSelectedPlanAfter,\r\n currentPlanOrder\r\n );\r\n\r\n await setPlanOrderInTopic(\r\n sourceSelectedPlan[0].topic.id,\r\n planSorting.YourOwnSortingValue\r\n );\r\n dispatch(\"plansForTopicHasBeenReordered\");\r\n }\r\n } else if (sourceSelectedPlan && targetSelectedPlan) {\r\n await dragAndDropPlanInLesson(\r\n sourceSelectedPlan[0].id,\r\n targetSelectedPlan[0].id,\r\n sourceSelectedPlan[0].topic ? sourceSelectedPlan[0].topic.id : null,\r\n targetSelectedPlanAfter\r\n );\r\n }\r\n\r\n sourceSelectedPlan = undefined;\r\n targetSelectedPlan = undefined;\r\n targetSelectedPlanAfter = false;\r\n\r\n orderDirty = false;\r\n }\r\n\r\n function isPlansInTopicView() {\r\n return (\r\n !(loadMethod === loadWithoutDatePlans || loadMethod === loadAllPlans) &&\r\n config.topicId &&\r\n config.topicId > 0\r\n );\r\n }\r\n\r\n // On scroll check how far the scroll is from the bottom, when it enters the bottom\r\n // 100 px of the scrollable area, load more plans if there are more to load.\r\n async function onScroll() {\r\n const maxScroll = document.body.scrollHeight - window.innerHeight;\r\n\r\n if (document.documentElement.scrollTop > maxScroll - 100) {\r\n if (!scrollBottom) {\r\n scrollBottom = true;\r\n\r\n if (!data.loading && data.plans.length < data.total && isAutoloadingOn) {\r\n await showMore();\r\n }\r\n }\r\n } else {\r\n scrollBottom = false;\r\n }\r\n }\r\n\r\n function toggleAutoloading() {\r\n isAutoloadingOn = !isAutoloadingOn;\r\n }\r\n\r\n async function replaceSortingModalClicked(event) {\r\n dragConfirmed = event.detail.confirmed;\r\n showReplaceSortingConfirmModal = false;\r\n await savePlanOrderAfterConfirmation();\r\n }\r\n</script>\r\n","{#if (config.canEdit || showTableViewLinkForReadOnlyMode)}\r\n {#if !isDataLoading}\r\n <div class=\"its-plans__switch\">\r\n <Link\r\n kind=\"standalone\"\r\n href={destinationUrl}\r\n rel=\"noopener\"\r\n iconClass=\"its-plans__switch-table-iconLink\"\r\n iconPlacement=\"start\"\r\n target=\"_self\"\r\n text={i18n.tableView}\r\n on:click\r\n />\r\n </div>\r\n {/if}\r\n{/if}\r\n\r\n<script>\r\n import Link from \"@itslearning/prometheus/assets/Navigation/Link/v1/Link.svelte\";\r\n import { addBackDestinationParam } from \"../../helpers/backLinkHelper\";\r\n import { planType } from \"../../constants\";\r\n\r\n export let config;\r\n export let i18n;\r\n export let isDataLoading;\r\n export let backExtraParams;\r\n\r\n const showTableViewLinkForReadOnlyMode = config.showReadOnlyTableView && config.planType !== planType.onePlanAtATime && !config.publicAccessKey;\r\n\r\n $: destinationUrl = addBackDestinationParam(\r\n `/plans/courses/${config.courseId}/tableView`,\r\n backExtraParams\r\n );\r\n</script>\r\n","<div class=\"use-ready-made-content {emptyState ? 'use-ready-made-content-emptystate' : ''}\">\r\n <a class=\"use-ready-made-content-link\" {href} aria-label={linktext}>\r\n <span class=\"use-ready-made-content-link--icon\" />\r\n <span class=\"use-ready-made-content-link--text\">{linktext}</span>\r\n </a>\r\n</div>\r\n\r\n<script>\r\n export let href;\r\n export let linktext;\r\n export let emptyState;\r\n</script>\r\n","<div\r\n class=\"itsl-plans-rich-text-field\"\r\n class:itsl-plans-rich-text-field--can-edit={config.canEdit && !isValueBeingUpdated}\r\n class:itsl-plans-rich-text-field--is-being-updated={isValueBeingUpdated}\r\n>\r\n {#if config.canEdit && (!value || showTextArea)}\r\n <div\r\n class=\"itsl-plans-rich-text-field__text-area-wrapper\"\r\n class:itsl-plans-rich-text-field__text-area-wrapper--is-being-updated={isValueBeingUpdated}\r\n >\r\n <textarea\r\n aria-labelledby={labelledBy}\r\n aria-label={!labelledBy ? title : null}\r\n class=\"itsl-plans-rich-text-field__text-area\"\r\n class:itsl-plans-rich-text-field__text-area--is-being-updated={isValueBeingUpdated}\r\n readonly={isValueBeingUpdated}\r\n {value}\r\n bind:this={textArea}\r\n on:input={onTextAreaInput}\r\n on:blur={handleInputBlur}\r\n {placeholder}\r\n />\r\n </div>\r\n {:else}\r\n <!-- svelte-ignore a11y-no-noninteractive-tabindex -->\r\n <!-- svelte-ignore a11y-no-noninteractive-element-interactions -->\r\n <div\r\n aria-labelledby={labelledBy}\r\n aria-label={!labelledBy ? title : null}\r\n role=\"group\"\r\n tabindex=\"0\"\r\n class=\"itsl-plans-rich-text-field__html-content\"\r\n on:click={onClickEdit}\r\n on:keydown={onEditorKeyDown}\r\n >\r\n {#if displayValue && displayValue.length}\r\n <!-- eslint-disable-next-line svelte/no-at-html-tags -->\r\n {@html displayValue}\r\n {:else}\r\n {placeholder}\r\n {/if}\r\n </div>\r\n {/if}\r\n\r\n {#if config.canEdit}\r\n {#if !hideEditButton}\r\n <button\r\n type=\"button\"\r\n class=\"itsl-plans-rich-text-field__edit-button\"\r\n disabled={isValueBeingUpdated}\r\n on:click={onClickEdit}\r\n aria-describedby={labelledBy}\r\n >\r\n <span class=\"screen-reader\">{i18n.editRichText}</span>\r\n </button>\r\n {/if}\r\n\r\n <Modal\r\n confirmText={i18n.save}\r\n cancelText={i18n.cancel}\r\n bind:enabled={editModalEnabled}\r\n on:close={onModalClosed}\r\n clickOutsideCloses={false}\r\n >\r\n <span slot=\"title\">{title}</span>\r\n <!-- svelte-ignore a11y-no-static-element-interactions -->\r\n <div slot=\"body\" on:keydown={keyDownWrapper}>\r\n {#if editModalLoading}\r\n <div class=\"itsl-plans-rich-text-field__edit-loading\"></div>\r\n {/if}\r\n <div\r\n class:itsl-plans-rich-text-field__content-loading={editModalLoading}\r\n bind:this={richTextContent}\r\n >\r\n <!-- eslint-disable-next-line svelte/no-at-html-tags -->\r\n {@html richTextEditorValue}\r\n </div>\r\n </div>\r\n </Modal>\r\n {/if}\r\n <span aria-live=\"polite\" role=\"status\" class=\"screen-reader\">\r\n {editModalLoading ? i18n.loading : i18n.loaded}\r\n </span>\r\n</div>\r\n\r\n<script>\r\n import Modal from \"@itslearning/prometheus/assets/modals/Modal/v2/Modal.svelte\";\r\n\r\n import { onMount, tick } from \"svelte\";\r\n import { Keys } from \"@itslearning/atlas/keyboard/keys\";\r\n import { normalizeKey } from \"@itslearning/atlas/keyboard/normalize\";\r\n\r\n export let config;\r\n export let i18n;\r\n export let value;\r\n export let displayValue;\r\n export let labelledBy;\r\n export let title;\r\n export let placeholder = \"\";\r\n export let safeHtmlProvider = html => Promise.resolve({ value: html });\r\n export let showTextArea = true;\r\n export let hideEditButton = false;\r\n\r\n let textArea;\r\n let richTextContent;\r\n let editorInstance;\r\n let ckEditorGlobal;\r\n let ckScript;\r\n let editModalEnabled = false;\r\n let editModalLoading = false;\r\n let isValueBeingUpdated = false;\r\n\r\n onMount(() => setTimeout(textAreaInputResize, 0));\r\n\r\n $: richTextEditorValue = showTextArea ? replaceLineBreaksWithBrTags(htmlEncode(value)) : value;\r\n\r\n const onTextAreaInput = () => textAreaInputResize();\r\n\r\n const textAreaInputResize = () => {\r\n if (textArea) {\r\n textArea.style.height = `${textArea.scrollHeight}px`;\r\n }\r\n };\r\n\r\n const onClickEdit = async () => {\r\n if (!config.canEdit || isValueBeingUpdated) {\r\n return;\r\n }\r\n\r\n if (textArea && value != textArea.value) {\r\n await handleInputBlur();\r\n }\r\n\r\n editModalEnabled = true;\r\n editModalLoading = true;\r\n\r\n ckEditorGlobal = await loadCkScript();\r\n\r\n setTimeout(() => {\r\n // It's necessary to define the jquery global because the ckEditor config includes a call to $\r\n // which fails without it. It doesn't do anything though.\r\n window[\"$\"] = () => {};\r\n\r\n editorInstance = ckEditorGlobal.replace(richTextContent, {\r\n customConfig: `/restapi/ckeditor/configuration/v1?RenderCommonScriptPart=1&Toolbar=${config.editorToolbarType}&LocationId=${config.courseId}&LocationType=${config.locationType}&EnableSlideshow=0&EnableAutoGrow=0&ShowTreeLinkButton=1&StoreImagesWithContent=1`\r\n });\r\n\r\n editModalLoading = false;\r\n }, 0);\r\n };\r\n\r\n const onModalClosed = async event => {\r\n editorInstance.commands[\"a11ychecker.close\"] &&\r\n editorInstance.commands[\"a11ychecker.close\"].exec();\r\n\r\n if (event.detail.confirmed) {\r\n const editorHtml = editorInstance.getData();\r\n // This is required to prevent redundnat line breakes - see Itsolutions.Itslearning.Web.UI.Controls.Editor.CKEditor\r\n const newValue = editorHtml\r\n ? editorHtml.replace(/\\t/g, \" \").replace(/\\n\\n/g, \"\\n\")\r\n : \"\";\r\n\r\n await updateHtml(newValue);\r\n await tick();\r\n textAreaInputResize();\r\n }\r\n };\r\n\r\n const loadCkScript = () =>\r\n new Promise(resolve => {\r\n if (window[\"CKEDITOR\"]) {\r\n resolve(window[\"CKEDITOR\"]);\r\n }\r\n\r\n ckScript = document.createElement(\"script\");\r\n\r\n ckScript.onload = () => resolve(window[\"CKEDITOR\"]);\r\n ckScript.setAttribute(\"src\", config.richTextEditorBasePath + \"/ckeditor.js?t=N8K3\");\r\n\r\n document.getElementsByTagName(\"head\").item(0).appendChild(ckScript);\r\n });\r\n\r\n const keyDownWrapper = event => {\r\n if (editorInstance) {\r\n const key = normalizeKey(event.key);\r\n\r\n if (key !== Keys.TAB && key !== Keys.ESCAPE) {\r\n editorInstance.focus();\r\n }\r\n }\r\n };\r\n\r\n const onEditorKeyDown = async event => {\r\n const key = normalizeKey(event.key);\r\n\r\n if (key === Keys.ENTER) {\r\n await onClickEdit();\r\n }\r\n };\r\n\r\n const handleInputBlur = async () => {\r\n if (textArea.value === value) {\r\n return;\r\n }\r\n\r\n await updateHtml(htmlEncode(textArea.value));\r\n await tick();\r\n textAreaInputResize();\r\n };\r\n\r\n const updateHtml = async newValue => {\r\n if (!showTextArea && areValuesTheSame(newValue)) {\r\n return;\r\n }\r\n\r\n try {\r\n isValueBeingUpdated = true;\r\n\r\n const {\r\n Value: updatedValue,\r\n SafeHtml: updatedDisplayValue,\r\n CustomData: { isPlainText }\r\n } = await safeHtmlProvider(newValue);\r\n\r\n value = updatedValue;\r\n displayValue = updatedDisplayValue;\r\n showTextArea = isPlainText;\r\n } finally {\r\n isValueBeingUpdated = false;\r\n }\r\n };\r\n\r\n const areValuesTheSame = newValue => {\r\n return newValue.trimEnd() === value && value.trimEnd();\r\n };\r\n\r\n export const replaceLineBreaksWithBrTags = valueToChange => {\r\n if (valueToChange === null || valueToChange === undefined) {\r\n return valueToChange;\r\n }\r\n\r\n // This corresponds to replaceLineBreaksWithBrTags from Common.ts file from common controls.\r\n const lineBreakToBrRegex = /\\r?\\n/g;\r\n const brTagString = \"<br />\";\r\n\r\n return valueToChange.replace(lineBreakToBrRegex, brTagString);\r\n };\r\n\r\n const htmlEncode = text => {\r\n const textArea = document.createElement(\"textarea\");\r\n\r\n textArea.innerText = text;\r\n\r\n return textArea.innerHTML.split(\"<br>\").join(\"\\n\");\r\n };\r\n\r\n export function edit() {\r\n onClickEdit();\r\n }\r\n</script>\r\n","import {\r\n setTopicLearningObjectives,\r\n removeTopicLearningObjective,\r\n setCustomFieldText,\r\n} from \"../api\";\r\nimport { topicData } from \"../logic/topicPage/stores\";\r\n\r\nexport async function updateTopicFieldLearningObjectives(topicId, columnId, learningObjectives) {\r\n const loIds = learningObjectives.map(lo => lo.id);\r\n\r\n return setTopicLearningObjectives(topicId, columnId, loIds);\r\n}\r\n\r\nexport async function removeTopicFieldLearningObjective(topicId, columnId, learningObjectiveId) {\r\n return removeTopicLearningObjective(topicId, columnId, learningObjectiveId);\r\n}\r\n\r\nexport async function updateTopicFieldText(topicId, columnId, text) {\r\n const result = await setCustomFieldText(topicId, columnId, text);\r\n\r\n // Use the resulting safeHtml to set display text\r\n topicData.update(data => {\r\n const fieldIndex = data.topic.customFields.findIndex(f => f.id === columnId);\r\n\r\n if (fieldIndex !== -1) {\r\n data.topic.customFields[fieldIndex].displayText = result.SafeHtml;\r\n data.topic.customFields[fieldIndex].isPlainText = result.CustomData.isPlainText;\r\n }\r\n\r\n return data;\r\n });\r\n\r\n return result;\r\n}\r\n\r\nexport async function updateTopicFieldTerm(columnId, term) {\r\n topicData.update(data => {\r\n const fieldIndex = data.topic.customFields.findIndex(f => f.id === columnId);\r\n\r\n if (fieldIndex !== -1) {\r\n data.topic.customFields[fieldIndex].term = term;\r\n }\r\n\r\n return data;\r\n });\r\n}\r\n\r\nexport async function removeTopicFieldTerm(columnId) {\r\n updateTopicFieldTerm(columnId, null);\r\n}\r\n","<RichText\r\n bind:value={field.text}\r\n displayValue={field.displayText}\r\n showTextArea={field.isPlainText}\r\n {i18n}\r\n {config}\r\n title={field.title}\r\n labelledBy=\"field-title-{field.id}\"\r\n placeholder={i18n.addText}\r\n safeHtmlProvider={html => updateTopicFieldText(topic.id, field.id, html)}\r\n/>\r\n\r\n<script>\r\n import RichText from \"@its-ui/planner-common/components/RichText/RichText.svelte\";\r\n import { updateTopicFieldText } from \"@its-ui/planner-common/controllers/topicController\";\r\n\r\n export let field;\r\n export let config;\r\n export let i18n;\r\n export let topic;\r\n</script>\r\n","/**\n * Case-insensitive comparison function\n * @param {string} optionStr string which is used for filtering\n * @param {string} filter filter string\n * @returns {boolean} true if string mathes the filter string\n */\nexport function checkFilterMatch(optionStr, filter) {\n const o = optionStr ? optionStr.toLocaleLowerCase() : '';\n const f = filter.toLocaleLowerCase();\n return o.startsWith(f);\n}\n\n/**\n * Check if string contain printable character\n * @param {string} str \n * @returns {boolean}\n */\nexport function isPrintableCharacter(str) {\n return str.length === 1 && !!str.match(/\\S| /);\n}\n","<!-- svelte-ignore a11y-no-noninteractive-tabindex -->\n<!-- svelte-ignore a11y-click-events-have-key-events -->\n<div class=\"prom-combo__value\"\n id={id_Container}\n class:focused={expanded}\n class:prom-combo__value--chevron-visible={chevronVisible}\n bind:this={mainContainer}\n on:click={onClick}\n aria-controls={listboxID_forContainer}>\n\n <input class=\"prom-combo__value-input\"\n id={id}\n bind:this={inputElement}\n on:keyup={keyUp}\n on:keydown={keyDown}\n required=\"{required}\"\n role=\"combobox\"\n aria-controls={listboxID_forInput}\n aria-expanded={expanded}\n aria-haspopup={inputAriaHasPopup}\n aria-autocomplete={ariaAutocomplete}\n aria-activedescendant={listboxFocusedID}/>\n\n <div class=\"prom-combo__focus-wrapper\"></div>\n</div>\n\n<script>\n import { Keys } from '@itslearning/atlas/keyboard/keys';\n import { normalizeKey } from '@itslearning/atlas/keyboard/normalize';\n import { isPrintableCharacter } from './helpers';\n\n import { createEventDispatcher } from 'svelte';\n\n export let id;\n export let enableAutoComplete;\n export let enableInlineAutoComplete;\n export let listboxFocusedID = undefined;\n export let expanded;\n export let dataProvider;\n export let chevronVisible;\n export let required;\n\n let value;\n let filter = '';\n\n $: id_Container = `container_${id}`;\n\n /** @type {'listbox'} */\n $: inputAriaHasPopup = expanded ? 'listbox' : undefined;\n\n /** @type {'both' | 'list' | 'none'} */\n $: ariaAutocomplete = enableAutoComplete\n ? (enableInlineAutoComplete ? 'both' : 'list')\n : 'none';\n\n $: listboxID_forContainer = `listbox_${id}`;\n $: listboxID_forInput = expanded ? 'listbox_' + id : undefined;\n\n let mainContainer, inputElement;\n let displayValue;\n\n const dispatch = createEventDispatcher();\n\n export function checkIfFocused() {\n return document.activeElement === mainContainer || document.activeElement === inputElement;\n }\n\n export function containsTarget(target) {\n return mainContainer === target || mainContainer.contains(target);\n }\n\n export function focus() {\n inputElement.focus();\n }\n\n export function reset() {\n value = undefined;\n setDisplayValue(null);\n }\n\n export function getStrValue() {\n return inputElement.value;\n }\n\n export function setDisplayValue(value) {\n displayValue = value;\n if (inputElement) {\n inputElement.value = value ? value : null;\n }\n }\n\n export function setValue(newValue) {\n value = newValue;\n }\n\n export function checkIfEmpty() {\n return !inputElement.value;\n }\n\n function keyDown(event) {\n if (normalizeKey(event.key) === Keys.TAB) {\n value = inputElement.value;\n }\n }\n\n async function keyUp(event) {\n let preventDispatchFilter = false;\n let preventInlineGuess = false;\n const char = event.key;\n\n if (isPrintableCharacter(char)) {\n filter += char;\n } else {\n preventInlineGuess = true;\n }\n\n if (inputElement.value.length < filter.length) {\n filter = inputElement.value;\n }\n\n switch (normalizeKey(event.key)) {\n case Keys.ENTER: {\n value = inputElement.value;\n createSelection(0, value.length);\n dispatch('commit', value);\n dispatch('closePopup', value);\n preventInlineGuess = true;\n preventDispatchFilter = true;\n break;\n }\n case Keys.TAB:\n case Keys.UP:\n case Keys.DOWN:\n case Keys.ESCAPE:\n case 'Control':\n case 'Alt':\n case 'Shift': {\n preventDispatchFilter = true;\n break;\n }\n }\n\n if (!preventDispatchFilter) {\n dispatch('filter', filter);\n }\n\n if (!preventInlineGuess && enableInlineAutoComplete) {\n await displayInlineGuess();\n }\n }\n\n function createSelection(start, end) {\n inputElement.focus();\n inputElement.setSelectionRange(start, end);\n }\n\n async function displayInlineGuess() {\n const inlineGuess = await getInlineGues(filter);\n if (inlineGuess) {\n inputElement.value = inlineGuess.guess;\n createSelection(inlineGuess.index, inlineGuess.guess.length);\n }\n }\n\n async function getInlineGues(filter) {\n const filtered = await Promise.resolve(dataProvider.getOptions(filter));\n if (filtered.length === 0) {\n return null;\n }\n\n const first = filtered[0];\n\n return {\n guess: first.label,\n index: filter.length\n };\n }\n\n function onClick(event) {\n if (event.target !== inputElement) {\n inputElement.focus();\n }\n }\n</script>\n","<svelte:window on:keydown={keyDown} />\n\n<div class=\"prom-combo__list-box\" bind:this={listBoxContainer}\n role=\"listbox\"\n id={listboxID}\n aria-labelledby={labelID}\n tabindex=\"-1\">\n\n {#each options as option, i}\n <!-- svelte-ignore a11y-click-events-have-key-events -->\n <!-- svelte-ignore a11y-interactive-supports-focus -->\n <div class=\"prom-combo__option-container\" \n role=\"option\"\n id=\"option_{i}\"\n aria-selected={option.value === selected}\n on:click={() => select(option)}>\n <div class=\"prom-combo__option-content\">{option.label}</div>\n </div>\n {/each}\n</div>\n\n<script>\n import { createEventDispatcher, onMount } from 'svelte';\n\n import { Keys } from '@itslearning/atlas/keyboard/keys';\n import { normalizeKey } from '@itslearning/atlas/keyboard/normalize';\n import { isPrintableCharacter } from './helpers';\n\n export let id;\n export let options;\n export let selected;\n\n let listBoxContainer;\n let focusedIndex;\n\n $: labelID = 'label_' + id;\n $: listboxID = 'listbox_' + id;\n\n const dispatch = createEventDispatcher();\n\n onMount(() => {\n setSelectedElementToBeFocused();\n });\n\n function select(selectedOption) {\n dispatch('select', selectedOption);\n }\n\n export function checkIfFocused() {\n return document.activeElement === listBoxContainer;\n }\n\n function keyDown(event) {\n const key = normalizeKey(event.key);\n\n if (isPrintableCharacter(key)) {\n removeCurrentFocus();\n dispatch('returnFocusAfterKeyPressed', key);\n return;\n }\n\n if (event.shiftKey) {\n return;\n }\n\n switch (key) {\n case Keys.DOWN: {\n setNextElementToBeFocused('down', 'single');\n event.preventDefault();\n break;\n }\n case Keys.UP: {\n setNextElementToBeFocused('up', 'single');\n event.preventDefault();\n break;\n }\n case 'PageDown':\n setNextElementToBeFocused('down', 'page');\n event.preventDefault();\n break;\n case 'PageUp':\n setNextElementToBeFocused('up', 'page');\n event.preventDefault();\n break;\n case 'Home':\n setNextElementToBeFocused('up', 'all');\n event.preventDefault();\n break;\n case 'End':\n setNextElementToBeFocused('down', 'all');\n event.preventDefault();\n break;\n case Keys.ENTER: {\n const items = Array.from(listBoxContainer.querySelectorAll('.prom-combo__option-container'));\n const focusedItem = listBoxContainer.querySelector('.focused');\n const focusedIndex = items.findIndex(e => e === focusedItem);\n if (focusedIndex >= 0) {\n event.preventDefault();\n event.stopPropagation();\n dispatch('select', options[focusedIndex]);\n }\n break;\n }\n }\n }\n\n function setElementToBeFocused(index) {\n if (index >= 0) {\n removeCurrentFocus();\n const optionID = `option_${index}`;\n const focusedItem = listBoxContainer.querySelector('#' + optionID);\n changeFocused(focusedItem, index);\n scroll(focusedItem);\n }\n }\n\n function removeCurrentFocus() {\n const current = listBoxContainer.querySelector('.focused');\n if (current) {\n current.classList.remove('focused');\n }\n }\n\n function setSelectedElementToBeFocused() {\n focusedIndex = selected \n ? options.findIndex(option => option.value === selected)\n : 0;\n \n setElementToBeFocused(focusedIndex);\n }\n\n /** \n * Set next element in popup to be focused\n * @param {'single'|'page'|'all'} change single, page or an entire list depending on Arrow keys, page up/down or home/end keys pressed\n * @param {'down'|'up'} direction of focus change\n */\n function setNextElementToBeFocused(direction, change) {\n if (listBoxContainer) {\n /** @type {Array.<HTMLElement>} */\n const items = Array.from(listBoxContainer.querySelectorAll('.prom-combo__option-container'));\n const focusedItem = listBoxContainer.querySelector('.focused');\n if (items.length > 0) {\n const focusedIndex = focusedItem \n ? items.findIndex(e => e === focusedItem)\n : 0;\n \n const nextFocusedIndex = focusedItem \n ? getNextFocusedIndex(items.length, focusedIndex, direction, change)\n : 0;\n const nextFocused = items[nextFocusedIndex];\n changeFocused(nextFocused, nextFocusedIndex);\n \n scroll(nextFocused);\n\n handleNextFocusedOption(options[nextFocusedIndex]);\n }\n }\n }\n\n function handleNextFocusedOption(option) {\n dispatch('focusedOptionChanged', option);\n }\n\n /**\n * Get positions of option items\n * @returns {Array.<number>}\n */\n function getItemsPositions() {\n const items = listBoxContainer.querySelectorAll('.prom-combo__option-container');\n const positions = [];\n for (let i = 0; i < items.length; i++) {\n const item = /** @type {HTMLElement} */ (items[i]);\n positions.push(item.offsetTop);\n }\n return positions;\n }\n\n /** \n * Get an index of next focused option\n * @param {number} length suggested itsms length\n * @param {number} index index of current focused element\n * @param {'down'|'up'} direction direction of focus change\n * @param {'single'|'page'|'all'} change single, page or all depending on Arrow keys, page up/down or home/end keys pressed\n */\n function getNextFocusedIndex(length, index, direction, change) {\n switch (change) {\n case 'all':\n return direction === 'down' ? length - 1 : 0;\n case 'page':\n return getNextFocusedIndexForPage(length, index, direction);\n case 'single':\n return getNextFocusedForSingleChange(length, index, direction);\n }\n }\n\n /**\n * Get an index of next focused option in case of single change\n * @param {number} length suggested itsms length\n * @param {number} index index of current focused element\n * @param {'down'|'up'} direction direction of focus change\n */\n function getNextFocusedForSingleChange(length, index, direction) {\n switch (direction) {\n case 'down':\n return index === length - 1\n ? 0\n : index + 1 >= length ? length - 1 : index + 1;\n case 'up':\n return index === 0\n ? length - 1\n : index - 1 < 0 ? 0 : index - 1;\n }\n }\n\n /** \n * Get an index of next focused option if page changed\n * @param {number} length suggested itsms length\n * @param {number} index index of current focused element\n * @param {'down'|'up'} direction direction of focus change\n */\n function getNextFocusedIndexForPage(length, index, direction) {\n const popupHeight = listBoxContainer.offsetHeight;\n const positions = getItemsPositions();\n const currentPosition = positions[index];\n /** @type {number} */\n let nextPosition;\n /** @type {number} */\n let nextPositionIndex;\n /** @type {Array.<number>} */\n let positionsBefore;\n switch (direction) {\n case 'down':\n nextPosition = currentPosition + popupHeight;\n positionsBefore = positions.filter(p => p <= nextPosition);\n nextPositionIndex = positionsBefore.length - 1;\n return nextPositionIndex === index\n ? 0\n : nextPositionIndex;\n case 'up':\n nextPosition = currentPosition - popupHeight;\n positionsBefore = positions.filter(p => p <= nextPosition);\n nextPositionIndex = positionsBefore.length - 1 < 0\n ? 0\n : positionsBefore.length - 1;\n return nextPositionIndex === index\n ? length - 1\n : nextPositionIndex;\n }\n }\n\n /**\n * Scroll to the focused item\n * @param {HTMLElement} focusedItem element which should become visible after scrolling\n */\n function scroll(focusedItem) {\n const top = focusedItem.offsetTop;\n const bottom = top + focusedItem.offsetHeight + 1;\n if (bottom > listBoxContainer.scrollTop + listBoxContainer.offsetHeight) {\n listBoxContainer.scrollTop = bottom - listBoxContainer.offsetHeight + 1;\n }\n if (top < listBoxContainer.scrollTop) {\n listBoxContainer.scrollTop = top;\n }\n }\n\n /**\n * Set focused element in the popup\n * @param {HTMLElement} element which should be focused\n * @param {number} index of that element\n */\n function changeFocused(element, index = 0) {\n const previous = listBoxContainer.querySelector('.focused');\n if (previous) {\n previous.classList.remove('focused');\n previous.removeAttribute('aria-selected');\n }\n\n element.classList.add('focused');\n element.setAttribute('aria-selected', 'true');\n focusedIndex = index;\n }\n</script>","import { checkFilterMatch } from './helpers';\n\nexport class ComboboxStandardDataProvider {\n constructor(options) {\n /** @type {Object[]} */\n this.options = options\n ? options \n : [];\n }\n\n setOptions(items) {\n this.options = items;\n }\n\n getOptions(searchText = undefined) {\n if (searchText) {\n const filtered = this.options.filter(e => checkFilterMatch(e.label, searchText));\n return filtered;\n }\n return this.options;\n }\n\n createNewItem(strValue) {\n const item = {\n value: Math.random().toString(36),\n label: strValue\n };\n this.options.push(item);\n return item;\n }\n\n getNameById(id) {\n const resultItem = this.options.find(e => e.value === id);\n return resultItem ? resultItem.label : undefined;\n }\n}\n","<svelte:window on:click={clickHandler} on:keydown={keyDown} />\n\n<div class=\"prom-combo {cssClass}\">\n {#if label}\n <label class=\"prom-combo__label-text\" id={labelID} for={id}>\n {label}\n {#if required}\n <span aria-hidden=\"true\" class=\"prom-input__required-star\">*</span>\n {/if}\n </label>\n {/if}\n\n <div class=\"prom-combo__container\"\n class:prom-combo_has_error={hasError}>\n\n <ComboboxValueContainer bind:this={container}\n {id}\n {dataProvider}\n {enableAutoComplete}\n {enableInlineAutoComplete}\n {expanded}\n {listboxFocusedID}\n {chevronVisible}\n {required}\n on:filter={applyFilter}\n on:commit={event => commitNewValue(event.detail)}\n on:closePopup={closePopup} />\n\n {#if expanded}\n <ComboboxPopupContainer bind:this={popup}\n {id}\n options={internalOptions}\n {selected}\n on:select={select}\n on:returnFocusAfterKeyPressed={returnFocusAfterKeyPressed}\n on:focusedOptionChanged={focusedOptionChanged}\n on:activedescendantChanged={activedescendantChanged}/>\n {/if}\n </div>\n\n\n {#if hasError && errorMessage}\n <div class=\"prom-combo__error-message\" id={errorMessageID}>\n {errorMessage}\n </div>\n {/if}\n</div>\n\n<script>\n import { createEventDispatcher, tick } from \"svelte\";\n\n import ComboboxValueContainer from \"./ComboboxValueContainer.svelte\";\n import ComboboxPopupContainer from \"./ComboboxPopupContainer.svelte\";\n\n import { normalizeKey } from \"@itslearning/atlas/keyboard/normalize\";\n import { Keys } from \"@itslearning/atlas/keyboard/keys\";\n\n import { ComboboxStandardDataProvider } from \"./standard.provider\";\n\n /** @type {String} */\n export let id = \"rnd\" + Math.random().toString(36);\n\n /** @type {String}*/\n export let label;\n\n /** @type {(String | Object)[]} */\n export let options = [];\n\n /** @type {boolean} */\n export let required = false;\n\n export let selected = undefined;\n\n /** @type {Boolean} */\n export let enableNewValues = false;\n\n /** @type {Boolean} */\n export let enableAutoComplete = true;\n\n /** @type {Boolean} */\n export let enableInlineAutoComplete = false;\n\n /** @type {String} */\n export let cssClass = '';\n\n /** @type {Boolean} */\n export let hasError = false;\n\n /** @type {String} */\n export let errorMessage = undefined;\n\n /** @type {boolean} */\n export let chevronVisible = true;\n\n /** @type {Object} */\n export let dataProvider = new ComboboxStandardDataProvider(options);\n\n\n /** @type {Object[]} */\n let internalOptions = undefined;\n\n // $: visibleOptions = getVisibleOptions(selectOnly, enableAutoComplete, filter);\n $: errorMessageID = `errormessage_${id}`;\n\n let prevOptions;\n $: {\n if (prevOptions !== options) {\n if (dataProvider.setOptions) {\n dataProvider.setOptions(options);\n }\n prevOptions = options;\n }\n }\n\n $: {\n if (!options) {\n console.warn('Options is required');\n }\n }\n\n let prevSelected = undefined;\n $: {\n if (prevSelected !== selected) {\n setDisplayValue();\n prevSelected = selected;\n }\n }\n\n $: labelID = 'label_' + id;\n\n /** @type {ComboboxValueContainer} */\n let container;\n\n /** @type {ComboboxPopupContainer} */\n let popup;\n\n let expanded = false;\n let filter = '';\n let listboxFocusedID = undefined;\n let displayValue;\n\n const dispatch = createEventDispatcher();\n\n async function setDisplayValue() {\n displayValue = await getDisplayValue(selected);\n if (container) {\n container.setDisplayValue(displayValue);\n }\n }\n\n async function clickHandler(event) {\n if (container.containsTarget(event.target)) {\n if (!expanded) {\n internalOptions = await requestForOptions();\n }\n expanded = !expanded;\n if (expanded && internalOptions.length === 0) {\n expanded = false;\n }\n } else {\n if (expanded) {\n commitNewValue(container.getStrValue());\n } else {\n if (container.checkIfEmpty()) {\n selected = undefined;\n }\n }\n closePopup();\n }\n }\n\n async function select(event) {\n const newValue = event.detail.value;\n await changeValue(newValue);\n await tick();\n closePopup();\n filter = '';\n container.focus();\n }\n\n async function resetFilter() {\n await setFilter('');\n }\n\n async function setFilter(filterValue) {\n filter = filterValue;\n }\n\n async function changeValue(newValue) {\n container.setValue(newValue);\n\n if (newValue !== selected) {\n selected = newValue;\n dispatch('change', selected);\n filter = '';\n }\n }\n\n async function reset() {\n container.reset();\n changeValue(undefined);\n await resetFilter();\n }\n\n async function getDisplayValue(value) {\n if (!options) {\n return '';\n }\n\n if (value === null || value === undefined) {\n return '';\n }\n\n return await Promise.resolve(dataProvider.getNameById(value));\n }\n\n function keyDown(event) {\n switch (normalizeKey(event.key)) {\n case Keys.TAB:\n if (!internalOptions) {\n return;\n }\n closePopup();\n if (checkIfFocused()) {\n commitNewValue(container.getStrValue());\n }\n break;\n\n case Keys.ESCAPE: {\n const shouldBeFocused = expanded;\n closePopup();\n if (shouldBeFocused) {\n container.focus();\n }\n break;\n }\n case Keys.DOWN:\n case Keys.UP:\n case Keys.ENTER:\n case Keys.SPACE: {\n openPopupByKey(event);\n break;\n }\n }\n }\n\n function openPopupByKey(event) {\n if (checkIfFocused() && !expanded) {\n const key = normalizeKey(event.key);\n if (key === Keys.UP || key === Keys.DOWN) {\n event.preventDefault();\n }\n if ((key === Keys.ENTER || key === Keys.SPACE)) {\n return;\n }\n\n openPopup();\n }\n }\n\n async function openPopup() {\n await setFilter();\n internalOptions = await requestForOptions();\n if (internalOptions.length > 0) {\n expanded = true;\n }\n }\n\n function closePopup() {\n if (expanded) {\n expanded = false;\n listboxFocusedID = undefined;\n }\n }\n\n function checkIfFocused() {\n return container.checkIfFocused() || (popup && popup.checkIfFocused());\n }\n\n async function applyFilter(event) {\n const oldFilter = filter || '';\n filter = event.detail;\n filter = filter.toLocaleLowerCase();\n internalOptions = await requestForOptions(filter);\n if (filter.length > oldFilter.length && internalOptions.length > 0) {\n expanded = true;\n }\n dispatch('filterChanged', event.detail);\n }\n\n async function commitNewValue(strValue) {\n if (!strValue) {\n reset();\n } else {\n const item = internalOptions.find(e => e.label.toLocaleLowerCase() === strValue.toLocaleLowerCase());\n if (item) {\n changeValue(item.value);\n } else if (enableNewValues) {\n const item = await Promise.resolve(dataProvider.createNewItem(strValue));\n changeValue(item.value);\n } else {\n reset();\n }\n\n closePopup();\n await tick();\n filter = '';\n container.focus();\n }\n }\n\n async function requestForOptions(searchText) {\n const options = await Promise.resolve(dataProvider.getOptions(searchText));\n\n return options;\n }\n\n function returnFocusAfterKeyPressed() {\n container.focus();\n }\n\n function focusedOptionChanged(event) {\n const option = event.detail;\n\n if (enableInlineAutoComplete) {\n container.setValue(option.label);\n }\n\n container.focus();\n }\n\n function activedescendantChanged(event) {\n listboxFocusedID = event.detail;\n }\n</script>\n","export default {\n CLOSED: 'modalClosed',\n CONFIRMED: 'modalConfirmed',\n CANCELLED: 'modalCancelled'\n};\n","<svelte:window on:keyup={onWindowKeyUp} on:resize={onWindowResize} />\n\n<section\n bind:this={rootElement}\n class=\"prom-modal\"\n on:click={closeHandler}\n role={rootElementRole}\n aria-labelledby={hideHeader ? null : headerClientId}\n aria-describedby={bodyClientId}\n>\n <div\n class=\"prom-modal__dialog {scrollModiferClass}\"\n role=\"document\"\n >\n {#if !hideHeader}\n <header class=\"prom-modal__header\">\n <h1 id=\"{headerClientId}\" class=\"prom-modal__heading\">{heading}</h1>\n {#if showCloseButton}\n <button\n bind:this={closeElement}\n class=\"prom-modal__close\"\n type=\"button\"\n on:click={closeHandler}\n >\n <span class=\"screen-reader\">{translations.CLOSE}</span>\n </button>\n {/if}\n </header>\n {/if}\n\n <div\n bind:this={bodyElement}\n id={bodyClientId}\n class=\"prom-modal__body\"\n >\n <div class=\"prom-modal__body__content\">\n {#if body}\n {@html body}\n {/if}\n\n <slot name=\"body\"></slot>\n </div>\n </div>\n\n <footer class=\"prom-modal__footer\">\n <slot name=\"footer\"></slot>\n </footer>\n </div>\n\n</section>\n\n<script>\n import ModalEvent from './ModalEvents';\n\n import TabTrapHelper from '../../../../lib/helpers/TabTrapHelper';\n import { isIE, isEdge } from '../../../../lib/helpers/UAHelper';\n import { Keys } from '@itslearning/atlas/keyboard/keys';\n import { normalizeKey } from '@itslearning/atlas/keyboard/normalize';\n import { debounce } from '@itslearning/atlas/dom/Ratecontrol';\n\n import { onMount, onDestroy, afterUpdate, createEventDispatcher } from 'svelte';\n\n const dispatch = createEventDispatcher();\n\n const defaultI18n = {\n CLOSE: 'Close'\n };\n\n /** @type {string} Used for header ({id}__label) and body ({id}__body) Optional, default value is 'prom-modal'. */\n export let id = 'prom-modal';\n /** @type {Object} */\n export let i18n = {};\n /** @type {string} The accessibility role attribute for the modal. */\n export let role = '';\n /** @type {string} The title of the modal, displayed as a heading tag.*/\n export let heading = '';\n /** @type {string} The content of the modal, i.e. message. You can also use the slots. Optional, better to use slot=\"body\" */\n export let body = '';\n /** @type {boolean} Flag, which indicates that this modal dialog can be closable by a user. */\n export let closeable = true;\n /** @type {boolean} Flag, which indicates that this modal dialog has a close button. */\n export let showCloseButton = false;\n /** @type {boolean} Hide the dialog header. */\n export let hideHeader = false;\n\n let tabTrapper;\n let rootElement;\n let closeElement;\n let bodyElement;\n let scrollModiferClass;\n\n onMount(() => {\n tabTrapper = new TabTrapHelper(rootElement);\n });\n\n onDestroy(() => {\n tabTrapper.teardown();\n });\n\n afterUpdate(() => {\n setTimeout(() => {\n setScroll();\n tabTrapper.init();\n }, 0);\n })\n\n $: headerClientId = `${id}__label`;\n\n $: {\n if (!hideHeader && (!heading || typeof heading !== 'string')) {\n console.warn('`heading` must be supplied or `hideHeader` must be true');\n }\n }\n\n let rootElementRole;\n\n $: {\n const defaultRole = 'dialog';\n const roles = [defaultRole, 'alertdialog'];\n\n if (roles.indexOf(role) >= 0) {\n rootElementRole = role;\n } else {\n rootElementRole = defaultRole;\n }\n }\n\n $: translations = { ...defaultI18n, ...i18n };\n\n $: headerClientId = `${id}__label`;\n\n $: bodyClientId = `${id}__body`;\n\n /**\n * This function should only run for browsers that have buggy implementations of flex.\n * So, IE11 and Edge at this time. It should be called when `maybeStyleForScroll`\n * has finished running.\n */\n function maybeSetBodyHeight() {\n if (!isIE() && !isEdge()) {\n return;\n }\n\n // Due to the 'async' nature of this code, it is possible for any\n // synchronous code to have altered the DOM.\n if (!bodyElement) {\n return;\n }\n\n // This is a little bit of layout thrashing,\n // but it is debounced. In most use cases this is\n // easily good enough.\n bodyElement.style.height = 'auto';\n\n // The act of \"getting\" the client height is all that\n // seems to be required here. We don't need to use it.\n bodyElement.clientHeight; //eslint-disable-line\n\n bodyElement.style.height = '100%';\n }\n\n function maybeStyleForScroll() {\n // Due to the 'async' nature of this code, it is possible for any\n // synchronous code to have altered the DOM.\n if (!bodyElement) {\n return;\n }\n\n // +1 due to IE and Edge zoom rounding error.\n const hasScroll = bodyElement.scrollHeight > bodyElement.clientHeight + 1;\n scrollModiferClass = hasScroll ? 'prom-modal__dialog--has-scroll' : '';\n }\n\n function setScroll() {\n debounce(function () {\n maybeSetBodyHeight();\n maybeStyleForScroll();\n }, 100);\n }\n\n\n /**\n * @param {MouseEvent} event\n */\n function closeHandler(event) {\n const validCloseElements = [closeElement, rootElement];\n const shouldIgnore = validCloseElements.indexOf(event.target) < 0;\n\n if (shouldIgnore) {\n return;\n }\n\n if (event.target === closeElement) {\n event.stopPropagation();\n }\n\n close(event);\n }\n\n /**\n * @param {KeyboardEvent | MouseEvent} event\n */\n function close(event) {\n if (closeable) {\n dispatch(ModalEvent.CLOSED, { event });\n }\n }\n\n /**\n * @param {KeyboardEvent} event\n */\n function onWindowKeyUp(event) {\n const key = normalizeKey(event.key);\n\n if (key === Keys.ESCAPE) {\n dispatch(ModalEvent.CLOSED, { event });\n }\n }\n\n function onWindowResize() {\n setScroll();\n }\n</script>\n","{#if enabled}\n<Modal\n id={modalId}\n closeable={false}\n hideHeader={true}\n role=\"dialog\"\n>\n <div slot=\"body\">\n <EmptyState\n buttonHtmlType=\"button\"\n {buttonText}\n description={i18n.topicTermEmptyStateDescription}\n headingLevel=\"h2\"\n iconName=\"search-no-result\"\n showButton={true}\n title={i18n.topicTermEmptyStateTitle}\n on:click={handleClick}\n >\n </EmptyState>\n </div>\n</Modal>\n{/if}\n\n<script>\n import { tick } from \"svelte\";\n import Modal from \"@itslearning/prometheus/assets/modals/Modal/v1/Modal.svelte\";\n import EmptyState from \"@itslearning/prometheus/assets/nodes/EmptyState/v1/EmptyState.svelte\";\n import i18n from \"../../i18n\";\n\n export let buttonText = i18n.cancel;\n export let dispatch;\n export let enabled = false;\n\n let modalId = \"add-term-modal-empty-state-id\";\n\n $: {\n enabled && makeButtonSecondary();\n };\n\n const makeButtonSecondary = async () => {\n await tick();\n const button = document.querySelector(`#${modalId}__body button`);\n button.classList.add('prom-button__secondary');\n };\n\n const handleClick = () => dispatch(\"close\");\n</script>\n","import { getCourseTerms } from \"../../api\";\n\nexport class TermsDataProvider {\n constructor() {\n this.options = [];\n }\n\n async populateOptions() {\n const terms = await getCourseTerms();\n\n this.options = terms.map(({ TermId, Name }) => ({\n label: Name,\n value: TermId,\n }));\n this.options.sort((a, b) => a.value - b.value);\n\n return this.options;\n }\n\n async getOptions(searchText = undefined) {\n if (searchText === undefined) {\n return this.options;\n }\n\n return this.options.filter(({ label }) => label.toLowerCase().includes(searchText.toLowerCase()));\n }\n\n getNameById(id) {\n const resultItem = this.options.find(t => t.value === id);\n\n return resultItem ? resultItem.label : undefined;\n }\n}\n","<div class=\"add-term-modal\">\n {#if isEmpty}\n <EmptyStateModal\n {dispatch}\n {enabled}\n on:close\n on:cancel\n />\n {:else}\n <Modal\n id={addTermModalId}\n {enabled}\n confirmText={confirmText}\n cancelText={i18n.cancel}\n titleText={titleText}\n clickOutsideCloses={false}\n on:close\n on:cancel\n on:confirm={handleConfirm}\n >\n <p slot=\"body\">\n <Combobox\n id={comboboxId}\n cssClass=\"its-add-term-modal-terms-combobox\"\n label={termTitle}\n required\n bind:selected={selectedTermId}\n enableAutoComplete\n dataProvider={provider}\n />\n <span class=\"its-add-term-modal-spacer\"></span>\n </p>\n </Modal>\n {/if}\n</div>\n\n<script>\n import { createEventDispatcher, onMount, tick } from \"svelte\";\n import { formatLanguageString } from '@itslearning/atlas/strings/format.js';\n import Combobox from \"@itslearning/prometheus/assets/inputs/Combobox/v1/Combobox.svelte\";\n import Modal from \"@itslearning/prometheus/assets/modals/Modal/v2/Modal.svelte\";\n import EmptyStateModal from \"@its-ui/planner-common/components/AddTermModal/AddTermModalEmptyState.svelte\";\n import i18n from \"../../i18n\";\n import { TermsDataProvider } from \"./TermsDataProvider\";\n\n export let enabled = false;\n export let selectedTermId;\n export let termTitle;\n\n /** @type {'add'|'change'} */\n export let type = 'add';\n\n let isEmpty = true;\n\n const addTermModalId = \"add-term-modal-id\";\n const comboboxId = \"add-term-modal-terms-combobox-id\";\n const dispatch = createEventDispatcher();\n const provider = new TermsDataProvider();\n\n onMount(() => {\n provider.populateOptions()\n .finally(e => isEmpty = provider.options.length == 0);\n });\n\n $: isAdd = type == 'add';\n $: isChange = type == 'change';\n\n $: confirmText = isAdd ? i18n.add : isChange ? i18n.change : \"\";\n $: titleText = isAdd\n ? formatLanguageString(i18n.addWithPlaceholder, termTitle)\n : isChange\n ? formatLanguageString(i18n.changeWithPlaceholder, termTitle)\n : \"\";\n \n $: {\n if (!isEmpty && enabled) {\n addComboboxPlaceholder();\n toggleAddButton(!Boolean(selectedTermId));\n }\n }\n\n const toggleAddButton = async (disabled) => {\n await tick();\n const addButton = document.querySelector(`#${addTermModalId} .prom-modal2__footer .prom-button__primary`);\n addButton.disabled = disabled;\n };\n\n const addComboboxPlaceholder = async () => {\n await tick();\n const combobox = document.querySelector(`#${comboboxId}`);\n combobox.placeholder = i18n.select;\n };\n\n const handleConfirm = () => dispatch(\"confirm\", { termId: selectedTermId });\n</script>\n","{#if iconType != iconless}\n<IconButton\n {...$$restProps}\n {type}\n {htmlType}\n iconPlacement=\"start\"\n iconClass={`its-plans__${iconType}-icon`}\n {text}\n on:click\n/>\n{:else}\n<Button\n {...$$restProps}\n {type}\n {htmlType}\n {text}\n on:click\n/>\n{/if}\n\n<script>\n import Button from \"@itslearning/prometheus/assets/inputs/Button/v1/Button.svelte\";\n import IconButton from \"@itslearning/prometheus/assets/inputs/IconButton/v1/IconButton.svelte\";\n\n const type = 'plain';\n const htmlType = 'button';\n const iconless = 'none';\n\n /** @type {'none'|'add'|'change'|'delete'} */\n export let iconType = iconless;\n \n /** @type {string} */\n export let text;\n</script>\n","{#if field.term}\n<div class=\"its-plans__topic-term-container\">\n <p class=\"its-plans__topic-term\">{termDisplayName}</p>\n {#if canEdit}\n <PlainButton ariaLabel={removeLabel} text={i18n.remove} iconType=\"delete\" on:click={removeTerm} />\n <PlainButton ariaLabel={changeLabel} text={i18n.change} iconType=\"change\" on:click={openChangeTermModal} />\n {/if}\n</div>\n{:else if canEdit}\n <PlainButton ariaLabel={addLabel} text={i18n.add} iconType=\"add\" on:click={openAddTermModal} />\n{/if}\n\n<AddTermModal\n selectedTermId={selectedTermId}\n termTitle={field.title}\n type={addTermModalType}\n bind:enabled={addTermModalEnabled}\n on:close={closeAddTermModal}\n on:confirm={updateTerm}\n/>\n\n<script>\n import { formatLanguageString } from \"@itslearning/atlas/strings/format\";\n import AddTermModal from \"@its-ui/planner-common/components/AddTermModal/AddTermModal.svelte\";\n import PlainButton from \"@its-ui/planner-common/components/Button/PlainButton.svelte\";\n import { removeTopicTerm, updateTopicTerm } from \"@its-ui/planner-common/api\";\n import { removeTopicFieldTerm, updateTopicFieldTerm } from \"@its-ui/planner-common/controllers/topicController\";\n\n export let canEdit = false;\n export let field;\n export let i18n;\n\n let addTermModalEnabled = false;\n /** @type {'add'|'change'} */\n let addTermModalType = 'add';\n let selectedTermId = field.term?.id\n\n const termLabel = field.title.toLowerCase();\n const addLabel = formatLanguageString(i18n.addWithPlaceholder, termLabel);\n const changeLabel = formatLanguageString(i18n.changeWithPlaceholder, termLabel);\n const removeLabel = formatLanguageString(i18n.removeWithPlaceholder, termLabel);\n\n $: termDisplayName = field && field.term ? field.term.Text || field.term.text : \"\";\n\n const closeAddTermModal = () => addTermModalEnabled = false;\n const openChangeTermModal = () => {\n addTermModalType = 'change';\n addTermModalEnabled = true;\n }\n const openAddTermModal = () => {\n addTermModalType = 'add';\n addTermModalEnabled = true;\n }\n\n const updateTerm = e => {\n updateTopicTerm(e.detail.termId)\n .then(term => updateTopicFieldTerm(field.id, term));\n };\n const removeTerm = () => {\n removeTopicTerm()\n .then(() => removeTopicFieldTerm(field.id));\n };\n</script>\n","\n<table class=\"prom-list\" aria-describedby={aria_describedby}>\n <slot name=\"header\" />\n <slot name=\"body\" />\n</table>\n\n<script>\n export let aria_describedby = undefined;\n</script>\n","<tr\n class=\"prom-list-element\"\n class:prom-list-element--checked={checked}\n class:prom-list-element--header={header}\n class:prom-list-element--right={alignTextRight}\n class:prom-list-element--dragged={dragged}\n on:click={click}\n>\n <slot />\n</tr>\n\n<script>\n import { createEventDispatcher } from 'svelte';\n\n const dispatch = createEventDispatcher();\n\n /** @type {boolean} */\n export let checked = false;\n /** @type {boolean} */\n export let dragged = false;\n /** @type {boolean} */\n export let header = false;\n /** @type {boolean} */\n export let alignTextRight = false;\n /** @type {boolean} */\n export let checkOnClick = false;\n\n function click() {\n if (checkOnClick) {\n checked = !checked;\n }\n dispatch('click', { checked });\n }\n</script>\n","{#if header}\n <th\n class=\"prom-cell__header prom-cell prom-cell__{type} prom-cell--priority-{priority}\"\n scope=\"col\"\n {colspan}\n {rowspan}>\n <slot name=\"header\" />\n <slot name=\"header-data\" />\n </th>\n{:else}\n <td\n class=\"prom-cell__data prom-cell prom-cell__{type} prom-cell--priority-{priority}\"\n {colspan}\n {rowspan}>\n <slot name=\"data\" />\n <slot name=\"header-data\" />\n </td>\n{/if}\n\n<script>\n /** @type {boolean} */\n export let header = false;\n /** @type {string} */\n export let type = undefined;\n /** @type {number} */\n export let colspan = 1;\n /** @type {number} */\n export let rowspan = 1;\n /** @type {1|2|3} */\n export let priority = 1;\n</script>\n\n\n","<Cell {header} {priority} type=\"checkbox\" {colspan} {rowspan}>\n <div slot=\"header-data\">\n <!-- Stop mouse click propagation on this element so\n that it doesnt double toggle the check box -->\n <div class=\"prom-cell__checkbox\" on:click|stopPropagation>\n <Checkbox bind:checked label={text} small {disabled} {name} labelHidden on:change />\n </div>\n </div>\n</Cell>\n\n<script>\n import Cell from '../../Cell/v1/Cell.svelte';\n import Checkbox from '../../../inputs/Checkbox/v1/Checkbox.svelte';\n\n /** @type {string} */\n export let text = '';\n /** @type {boolean} */\n export let checked = false;\n /** @type {boolean} */\n export let header = false;\n /** @type {1|2|3} */\n export let priority = 1;\n /** @type {number} */\n export let colspan = 1;\n /** @type {number} */\n export let rowspan = 1;\n /** @type {boolean} */\n export let disabled = false;\n /** @type {string} */\n export let name = undefined;\n</script>\n","<Cell {header} {priority} type=\"learning-objective\" {colspan} {rowspan}>\n <span slot=\"header\">{text}</span>\n <div slot=\"data\">\n <div\n tabindex={selectable ? undefined : 0}\n class=\"prom-cell__lo-title prom-cell__lo-title--{cssClass.toLowerCase()}\"\n on:keypress={keyPress}\n >\n {#if renderLoTitleHtml}\n <span>{@html title}</span>\n {:else}\n <span>{title}</span>\n {/if}\n </div>\n {#if description}\n {#if renderLoDescriptionHtml}\n <p class=\"prom-cell__lo-description\">{@html description}</p>\n {:else}\n <p class=\"prom-cell__lo-description\">{description}</p>\n {/if}\n {/if}\n </div>\n</Cell>\n\n<script>\n import Cell from '../../Cell/v1/Cell.svelte';\n import { Keys } from '@itslearning/atlas/keyboard/keys';\n import { normalizeKey } from '@itslearning/atlas/keyboard/normalize';\n import { createEventDispatcher } from 'svelte';\n\n const dispatch = createEventDispatcher();\n\n /** @type {string} */\n export let text = '';\n /** @type {string} */\n export let title = '';\n /** @type {boolean} */\n export let renderLoTitleHtml = false;\n /** @type {string} */\n export let description = '';\n /** @type {boolean} */\n export let renderLoDescriptionHtml = false;\n /** @type {boolean} */\n export let header = false;\n /** @type {boolean} */\n export let selectable = false;\n /** @type {string} */\n export let cssClass = '';\n /** @type {1|2|3} */\n export let priority = 1;\n /** @type {number} */\n export let colspan = 1;\n /** @type {number} */\n export let rowspan = 1;\n\n function keyPress(event) {\n switch (normalizeKey(event.key)) {\n case Keys.ENTER:\n case Keys.SPACE:\n dispatch('click', event);\n break;\n default:\n return;\n }\n }\n</script>\n","/*\nAdapted from https://github.com/mattdesl\nDistributed under MIT License https://github.com/mattdesl/eases/blob/master/LICENSE.md\n*/\nexport { identity as linear } from '../internal/index.js';\n\n/**\n * https://svelte.dev/docs/svelte-easing\n * @param {number} t\n * @returns {number}\n */\nexport function backInOut(t) {\n\tconst s = 1.70158 * 1.525;\n\tif ((t *= 2) < 1) return 0.5 * (t * t * ((s + 1) * t - s));\n\treturn 0.5 * ((t -= 2) * t * ((s + 1) * t + s) + 2);\n}\n\n/**\n * https://svelte.dev/docs/svelte-easing\n * @param {number} t\n * @returns {number}\n */\nexport function backIn(t) {\n\tconst s = 1.70158;\n\treturn t * t * ((s + 1) * t - s);\n}\n\n/**\n * https://svelte.dev/docs/svelte-easing\n * @param {number} t\n * @returns {number}\n */\nexport function backOut(t) {\n\tconst s = 1.70158;\n\treturn --t * t * ((s + 1) * t + s) + 1;\n}\n\n/**\n * https://svelte.dev/docs/svelte-easing\n * @param {number} t\n * @returns {number}\n */\nexport function bounceOut(t) {\n\tconst a = 4.0 / 11.0;\n\tconst b = 8.0 / 11.0;\n\tconst c = 9.0 / 10.0;\n\tconst ca = 4356.0 / 361.0;\n\tconst cb = 35442.0 / 1805.0;\n\tconst cc = 16061.0 / 1805.0;\n\tconst t2 = t * t;\n\treturn t < a\n\t\t? 7.5625 * t2\n\t\t: t < b\n\t\t? 9.075 * t2 - 9.9 * t + 3.4\n\t\t: t < c\n\t\t? ca * t2 - cb * t + cc\n\t\t: 10.8 * t * t - 20.52 * t + 10.72;\n}\n\n/**\n * https://svelte.dev/docs/svelte-easing\n * @param {number} t\n * @returns {number}\n */\nexport function bounceInOut(t) {\n\treturn t < 0.5 ? 0.5 * (1.0 - bounceOut(1.0 - t * 2.0)) : 0.5 * bounceOut(t * 2.0 - 1.0) + 0.5;\n}\n\n/**\n * https://svelte.dev/docs/svelte-easing\n * @param {number} t\n * @returns {number}\n */\nexport function bounceIn(t) {\n\treturn 1.0 - bounceOut(1.0 - t);\n}\n\n/**\n * https://svelte.dev/docs/svelte-easing\n * @param {number} t\n * @returns {number}\n */\nexport function circInOut(t) {\n\tif ((t *= 2) < 1) return -0.5 * (Math.sqrt(1 - t * t) - 1);\n\treturn 0.5 * (Math.sqrt(1 - (t -= 2) * t) + 1);\n}\n\n/**\n * https://svelte.dev/docs/svelte-easing\n * @param {number} t\n * @returns {number}\n */\nexport function circIn(t) {\n\treturn 1.0 - Math.sqrt(1.0 - t * t);\n}\n\n/**\n * https://svelte.dev/docs/svelte-easing\n * @param {number} t\n * @returns {number}\n */\nexport function circOut(t) {\n\treturn Math.sqrt(1 - --t * t);\n}\n\n/**\n * https://svelte.dev/docs/svelte-easing\n * @param {number} t\n * @returns {number}\n */\nexport function cubicInOut(t) {\n\treturn t < 0.5 ? 4.0 * t * t * t : 0.5 * Math.pow(2.0 * t - 2.0, 3.0) + 1.0;\n}\n\n/**\n * https://svelte.dev/docs/svelte-easing\n * @param {number} t\n * @returns {number}\n */\nexport function cubicIn(t) {\n\treturn t * t * t;\n}\n\n/**\n * https://svelte.dev/docs/svelte-easing\n * @param {number} t\n * @returns {number}\n */\nexport function cubicOut(t) {\n\tconst f = t - 1.0;\n\treturn f * f * f + 1.0;\n}\n\n/**\n * https://svelte.dev/docs/svelte-easing\n * @param {number} t\n * @returns {number}\n */\nexport function elasticInOut(t) {\n\treturn t < 0.5\n\t\t? 0.5 * Math.sin(((+13.0 * Math.PI) / 2) * 2.0 * t) * Math.pow(2.0, 10.0 * (2.0 * t - 1.0))\n\t\t: 0.5 *\n\t\t\t\tMath.sin(((-13.0 * Math.PI) / 2) * (2.0 * t - 1.0 + 1.0)) *\n\t\t\t\tMath.pow(2.0, -10.0 * (2.0 * t - 1.0)) +\n\t\t\t\t1.0;\n}\n\n/**\n * https://svelte.dev/docs/svelte-easing\n * @param {number} t\n * @returns {number}\n */\nexport function elasticIn(t) {\n\treturn Math.sin((13.0 * t * Math.PI) / 2) * Math.pow(2.0, 10.0 * (t - 1.0));\n}\n\n/**\n * https://svelte.dev/docs/svelte-easing\n * @param {number} t\n * @returns {number}\n */\nexport function elasticOut(t) {\n\treturn Math.sin((-13.0 * (t + 1.0) * Math.PI) / 2) * Math.pow(2.0, -10.0 * t) + 1.0;\n}\n\n/**\n * https://svelte.dev/docs/svelte-easing\n * @param {number} t\n * @returns {number}\n */\nexport function expoInOut(t) {\n\treturn t === 0.0 || t === 1.0\n\t\t? t\n\t\t: t < 0.5\n\t\t? +0.5 * Math.pow(2.0, 20.0 * t - 10.0)\n\t\t: -0.5 * Math.pow(2.0, 10.0 - t * 20.0) + 1.0;\n}\n\n/**\n * https://svelte.dev/docs/svelte-easing\n * @param {number} t\n * @returns {number}\n */\nexport function expoIn(t) {\n\treturn t === 0.0 ? t : Math.pow(2.0, 10.0 * (t - 1.0));\n}\n\n/**\n * https://svelte.dev/docs/svelte-easing\n * @param {number} t\n * @returns {number}\n */\nexport function expoOut(t) {\n\treturn t === 1.0 ? t : 1.0 - Math.pow(2.0, -10.0 * t);\n}\n\n/**\n * https://svelte.dev/docs/svelte-easing\n * @param {number} t\n * @returns {number}\n */\nexport function quadInOut(t) {\n\tt /= 0.5;\n\tif (t < 1) return 0.5 * t * t;\n\tt--;\n\treturn -0.5 * (t * (t - 2) - 1);\n}\n\n/**\n * https://svelte.dev/docs/svelte-easing\n * @param {number} t\n * @returns {number}\n */\nexport function quadIn(t) {\n\treturn t * t;\n}\n\n/**\n * https://svelte.dev/docs/svelte-easing\n * @param {number} t\n * @returns {number}\n */\nexport function quadOut(t) {\n\treturn -t * (t - 2.0);\n}\n\n/**\n * https://svelte.dev/docs/svelte-easing\n * @param {number} t\n * @returns {number}\n */\nexport function quartInOut(t) {\n\treturn t < 0.5 ? +8.0 * Math.pow(t, 4.0) : -8.0 * Math.pow(t - 1.0, 4.0) + 1.0;\n}\n\n/**\n * https://svelte.dev/docs/svelte-easing\n * @param {number} t\n * @returns {number}\n */\nexport function quartIn(t) {\n\treturn Math.pow(t, 4.0);\n}\n\n/**\n * https://svelte.dev/docs/svelte-easing\n * @param {number} t\n * @returns {number}\n */\nexport function quartOut(t) {\n\treturn Math.pow(t - 1.0, 3.0) * (1.0 - t) + 1.0;\n}\n\n/**\n * https://svelte.dev/docs/svelte-easing\n * @param {number} t\n * @returns {number}\n */\nexport function quintInOut(t) {\n\tif ((t *= 2) < 1) return 0.5 * t * t * t * t * t;\n\treturn 0.5 * ((t -= 2) * t * t * t * t + 2);\n}\n\n/**\n * https://svelte.dev/docs/svelte-easing\n * @param {number} t\n * @returns {number}\n */\nexport function quintIn(t) {\n\treturn t * t * t * t * t;\n}\n\n/**\n * https://svelte.dev/docs/svelte-easing\n * @param {number} t\n * @returns {number}\n */\nexport function quintOut(t) {\n\treturn --t * t * t * t * t + 1;\n}\n\n/**\n * https://svelte.dev/docs/svelte-easing\n * @param {number} t\n * @returns {number}\n */\nexport function sineInOut(t) {\n\treturn -0.5 * (Math.cos(Math.PI * t) - 1);\n}\n\n/**\n * https://svelte.dev/docs/svelte-easing\n * @param {number} t\n * @returns {number}\n */\nexport function sineIn(t) {\n\tconst v = Math.cos(t * Math.PI * 0.5);\n\tif (Math.abs(v) < 1e-14) return 1;\n\telse return 1 - v;\n}\n\n/**\n * https://svelte.dev/docs/svelte-easing\n * @param {number} t\n * @returns {number}\n */\nexport function sineOut(t) {\n\treturn Math.sin((t * Math.PI) / 2);\n}\n","import { cubicOut, cubicInOut, linear } from '../easing/index.js';\nimport { assign, split_css_unit, is_function } from '../internal/index.js';\n\n/**\n * Animates a `blur` filter alongside an element's opacity.\n *\n * https://svelte.dev/docs/svelte-transition#blur\n * @param {Element} node\n * @param {import('./public').BlurParams} [params]\n * @returns {import('./public').TransitionConfig}\n */\nexport function blur(\n\tnode,\n\t{ delay = 0, duration = 400, easing = cubicInOut, amount = 5, opacity = 0 } = {}\n) {\n\tconst style = getComputedStyle(node);\n\tconst target_opacity = +style.opacity;\n\tconst f = style.filter === 'none' ? '' : style.filter;\n\tconst od = target_opacity * (1 - opacity);\n\tconst [value, unit] = split_css_unit(amount);\n\treturn {\n\t\tdelay,\n\t\tduration,\n\t\teasing,\n\t\tcss: (_t, u) => `opacity: ${target_opacity - od * u}; filter: ${f} blur(${u * value}${unit});`\n\t};\n}\n\n/**\n * Animates the opacity of an element from 0 to the current opacity for `in` transitions and from the current opacity to 0 for `out` transitions.\n *\n * https://svelte.dev/docs/svelte-transition#fade\n * @param {Element} node\n * @param {import('./public').FadeParams} [params]\n * @returns {import('./public').TransitionConfig}\n */\nexport function fade(node, { delay = 0, duration = 400, easing = linear } = {}) {\n\tconst o = +getComputedStyle(node).opacity;\n\treturn {\n\t\tdelay,\n\t\tduration,\n\t\teasing,\n\t\tcss: (t) => `opacity: ${t * o}`\n\t};\n}\n\n/**\n * Animates the x and y positions and the opacity of an element. `in` transitions animate from the provided values, passed as parameters to the element's default values. `out` transitions animate from the element's default values to the provided values.\n *\n * https://svelte.dev/docs/svelte-transition#fly\n * @param {Element} node\n * @param {import('./public').FlyParams} [params]\n * @returns {import('./public').TransitionConfig}\n */\nexport function fly(\n\tnode,\n\t{ delay = 0, duration = 400, easing = cubicOut, x = 0, y = 0, opacity = 0 } = {}\n) {\n\tconst style = getComputedStyle(node);\n\tconst target_opacity = +style.opacity;\n\tconst transform = style.transform === 'none' ? '' : style.transform;\n\tconst od = target_opacity * (1 - opacity);\n\tconst [xValue, xUnit] = split_css_unit(x);\n\tconst [yValue, yUnit] = split_css_unit(y);\n\treturn {\n\t\tdelay,\n\t\tduration,\n\t\teasing,\n\t\tcss: (t, u) => `\n\t\t\ttransform: ${transform} translate(${(1 - t) * xValue}${xUnit}, ${(1 - t) * yValue}${yUnit});\n\t\t\topacity: ${target_opacity - od * u}`\n\t};\n}\n\n/**\n * Slides an element in and out.\n *\n * https://svelte.dev/docs/svelte-transition#slide\n * @param {Element} node\n * @param {import('./public').SlideParams} [params]\n * @returns {import('./public').TransitionConfig}\n */\nexport function slide(node, { delay = 0, duration = 400, easing = cubicOut, axis = 'y' } = {}) {\n\tconst style = getComputedStyle(node);\n\tconst opacity = +style.opacity;\n\tconst primary_property = axis === 'y' ? 'height' : 'width';\n\tconst primary_property_value = parseFloat(style[primary_property]);\n\tconst secondary_properties = axis === 'y' ? ['top', 'bottom'] : ['left', 'right'];\n\tconst capitalized_secondary_properties = secondary_properties.map(\n\t\t(e) => `${e[0].toUpperCase()}${e.slice(1)}`\n\t);\n\tconst padding_start_value = parseFloat(style[`padding${capitalized_secondary_properties[0]}`]);\n\tconst padding_end_value = parseFloat(style[`padding${capitalized_secondary_properties[1]}`]);\n\tconst margin_start_value = parseFloat(style[`margin${capitalized_secondary_properties[0]}`]);\n\tconst margin_end_value = parseFloat(style[`margin${capitalized_secondary_properties[1]}`]);\n\tconst border_width_start_value = parseFloat(\n\t\tstyle[`border${capitalized_secondary_properties[0]}Width`]\n\t);\n\tconst border_width_end_value = parseFloat(\n\t\tstyle[`border${capitalized_secondary_properties[1]}Width`]\n\t);\n\treturn {\n\t\tdelay,\n\t\tduration,\n\t\teasing,\n\t\tcss: (t) =>\n\t\t\t'overflow: hidden;' +\n\t\t\t`opacity: ${Math.min(t * 20, 1) * opacity};` +\n\t\t\t`${primary_property}: ${t * primary_property_value}px;` +\n\t\t\t`padding-${secondary_properties[0]}: ${t * padding_start_value}px;` +\n\t\t\t`padding-${secondary_properties[1]}: ${t * padding_end_value}px;` +\n\t\t\t`margin-${secondary_properties[0]}: ${t * margin_start_value}px;` +\n\t\t\t`margin-${secondary_properties[1]}: ${t * margin_end_value}px;` +\n\t\t\t`border-${secondary_properties[0]}-width: ${t * border_width_start_value}px;` +\n\t\t\t`border-${secondary_properties[1]}-width: ${t * border_width_end_value}px;`\n\t};\n}\n\n/**\n * Animates the opacity and scale of an element. `in` transitions animate from an element's current (default) values to the provided values, passed as parameters. `out` transitions animate from the provided values to an element's default values.\n *\n * https://svelte.dev/docs/svelte-transition#scale\n * @param {Element} node\n * @param {import('./public').ScaleParams} [params]\n * @returns {import('./public').TransitionConfig}\n */\nexport function scale(\n\tnode,\n\t{ delay = 0, duration = 400, easing = cubicOut, start = 0, opacity = 0 } = {}\n) {\n\tconst style = getComputedStyle(node);\n\tconst target_opacity = +style.opacity;\n\tconst transform = style.transform === 'none' ? '' : style.transform;\n\tconst sd = 1 - start;\n\tconst od = target_opacity * (1 - opacity);\n\treturn {\n\t\tdelay,\n\t\tduration,\n\t\teasing,\n\t\tcss: (_t, u) => `\n\t\t\ttransform: ${transform} scale(${1 - sd * u});\n\t\t\topacity: ${target_opacity - od * u}\n\t\t`\n\t};\n}\n\n/**\n * Animates the stroke of an SVG element, like a snake in a tube. `in` transitions begin with the path invisible and draw the path to the screen over time. `out` transitions start in a visible state and gradually erase the path. `draw` only works with elements that have a `getTotalLength` method, like `<path>` and `<polyline>`.\n *\n * https://svelte.dev/docs/svelte-transition#draw\n * @param {SVGElement & { getTotalLength(): number }} node\n * @param {import('./public').DrawParams} [params]\n * @returns {import('./public').TransitionConfig}\n */\nexport function draw(node, { delay = 0, speed, duration, easing = cubicInOut } = {}) {\n\tlet len = node.getTotalLength();\n\tconst style = getComputedStyle(node);\n\tif (style.strokeLinecap !== 'butt') {\n\t\tlen += parseInt(style.strokeWidth);\n\t}\n\tif (duration === undefined) {\n\t\tif (speed === undefined) {\n\t\t\tduration = 800;\n\t\t} else {\n\t\t\tduration = len / speed;\n\t\t}\n\t} else if (typeof duration === 'function') {\n\t\tduration = duration(len);\n\t}\n\treturn {\n\t\tdelay,\n\t\tduration,\n\t\teasing,\n\t\tcss: (_, u) => `\n\t\t\tstroke-dasharray: ${len};\n\t\t\tstroke-dashoffset: ${u * len};\n\t\t`\n\t};\n}\n\n/**\n * The `crossfade` function creates a pair of [transitions](/docs#template-syntax-element-directives-transition-fn) called `send` and `receive`. When an element is 'sent', it looks for a corresponding element being 'received', and generates a transition that transforms the element to its counterpart's position and fades it out. When an element is 'received', the reverse happens. If there is no counterpart, the `fallback` transition is used.\n *\n * https://svelte.dev/docs/svelte-transition#crossfade\n * @param {import('./public').CrossfadeParams & {\n * \tfallback?: (node: Element, params: import('./public').CrossfadeParams, intro: boolean) => import('./public').TransitionConfig;\n * }} params\n * @returns {[(node: any, params: import('./public').CrossfadeParams & { key: any; }) => () => import('./public').TransitionConfig, (node: any, params: import('./public').CrossfadeParams & { key: any; }) => () => import('./public').TransitionConfig]}\n */\nexport function crossfade({ fallback, ...defaults }) {\n\t/** @type {Map<any, Element>} */\n\tconst to_receive = new Map();\n\t/** @type {Map<any, Element>} */\n\tconst to_send = new Map();\n\t/**\n\t * @param {Element} from_node\n\t * @param {Element} node\n\t * @param {import('./public').CrossfadeParams} params\n\t * @returns {import('./public').TransitionConfig}\n\t */\n\tfunction crossfade(from_node, node, params) {\n\t\tconst {\n\t\t\tdelay = 0,\n\t\t\tduration = (d) => Math.sqrt(d) * 30,\n\t\t\teasing = cubicOut\n\t\t} = assign(assign({}, defaults), params);\n\t\tconst from = from_node.getBoundingClientRect();\n\t\tconst to = node.getBoundingClientRect();\n\t\tconst dx = from.left - to.left;\n\t\tconst dy = from.top - to.top;\n\t\tconst dw = from.width / to.width;\n\t\tconst dh = from.height / to.height;\n\t\tconst d = Math.sqrt(dx * dx + dy * dy);\n\t\tconst style = getComputedStyle(node);\n\t\tconst transform = style.transform === 'none' ? '' : style.transform;\n\t\tconst opacity = +style.opacity;\n\t\treturn {\n\t\t\tdelay,\n\t\t\tduration: is_function(duration) ? duration(d) : duration,\n\t\t\teasing,\n\t\t\tcss: (t, u) => `\n\t\t\t\topacity: ${t * opacity};\n\t\t\t\ttransform-origin: top left;\n\t\t\t\ttransform: ${transform} translate(${u * dx}px,${u * dy}px) scale(${t + (1 - t) * dw}, ${\n\t\t\t\tt + (1 - t) * dh\n\t\t\t});\n\t\t\t`\n\t\t};\n\t}\n\n\t/**\n\t * @param {Map<any, Element>} items\n\t * @param {Map<any, Element>} counterparts\n\t * @param {boolean} intro\n\t * @returns {(node: any, params: import('./public').CrossfadeParams & { key: any; }) => () => import('./public').TransitionConfig}\n\t */\n\tfunction transition(items, counterparts, intro) {\n\t\treturn (node, params) => {\n\t\t\titems.set(params.key, node);\n\t\t\treturn () => {\n\t\t\t\tif (counterparts.has(params.key)) {\n\t\t\t\t\tconst other_node = counterparts.get(params.key);\n\t\t\t\t\tcounterparts.delete(params.key);\n\t\t\t\t\treturn crossfade(other_node, node, params);\n\t\t\t\t}\n\t\t\t\t// if the node is disappearing altogether\n\t\t\t\t// (i.e. wasn't claimed by the other list)\n\t\t\t\t// then we need to supply an outro\n\t\t\t\titems.delete(params.key);\n\t\t\t\treturn fallback && fallback(node, params, intro);\n\t\t\t};\n\t\t};\n\t}\n\treturn [transition(to_send, to_receive, false), transition(to_receive, to_send, true)];\n}\n","<li\n {id}\n role=\"treeitem\"\n on:click={toggleExpanded}\n on:keydown={keyHandler}\n tabindex={selected ? 0 : -1}\n class=\"prom-lo-tree-item\"\n aria-expanded={expanded}\n aria-busy={learningObjective.childrenLoading && !children.length}\n>\n <div\n class=\"prom-lo-tree-item__title {cssClass}\"\n class:prom-lo-tree-item__title--root={isRoot}\n class:prom-lo-tree-item__title--selected={selected}\n class:prom-lo-tree-item__title--is-folder={learningObjective.isFolder}\n class:prom-lo-tree-item__title--is-loading={learningObjective.childrenLoading && !children.length}\n class:prom-lo-tree-item__title--no-items={learningObjective.childrenLoaded && !children.length}\n class:prom-lo-tree-item__title--expanded={expanded}\n >\n <div class=\"prom-lo-tree-item__icon\"></div>\n <span>{learningObjective.title}</span>\n </div>\n {#if expanded}\n <ul role=\"group\" class=\"prom-lo-tree-item__children\" in:slide>\n {#each children as lo (lo.id)}\n <svelte:self\n learningObjective={lo}\n {selectedLearningObjective}\n {learningObjectives}\n on:select\n />\n {/each}\n </ul>\n {/if}\n</li>\n\n<script>\n import { Keys } from '@itslearning/atlas/keyboard/keys';\n import { normalizeKey } from '@itslearning/atlas/keyboard/normalize';\n import { slide } from 'svelte/transition';\n import { createEventDispatcher } from 'svelte';\n\n const dispatch = createEventDispatcher();\n\n /**\n * @typedef LearningObjective\n * @type {object}\n * @property {number} id\n * @property {number} parentId\n * @property {string} title\n * @property {string} cssClass\n * @property {boolean} isFolder\n * @property {boolean} [childrenLoading]\n * @property {boolean} [childrenLoaded]\n */\n\n /** @type { LearningObjective }*/\n export let learningObjective;\n /** @type { LearningObjective }*/\n export let selectedLearningObjective = null;\n /** @type { LearningObjective[] }*/\n export let learningObjectives = [];\n\n let expanded = learningObjective.id === 0;\n\n $: id = `lo-tree-item-${learningObjective.id}`;\n $: selected = selectedLearningObjective && selectedLearningObjective.id === learningObjective.id;\n $: isRoot = learningObjective.id === 0;\n $: children = learningObjectives.filter(lo => lo.parentId === learningObjective.id && lo.isFolder);\n $: cssClass = learningObjective.cssClass ? 'prom-lo-tree-item__title--' + learningObjective.cssClass.toLowerCase() : '';\n\n $: if (selectedLearningObjective && selectedLearningObjective.parentId === learningObjective.id) {\n expanded = true;\n }\n\n function toggleExpanded(e) {\n e.preventDefault();\n e.stopPropagation();\n\n if (!isRoot && learningObjective.isFolder) {\n expanded = !expanded;\n }\n\n dispatch('select', learningObjective);\n }\n\n function keyHandler(event) {\n const { key } = event;\n\n switch (normalizeKey(key)) {\n case Keys.SPACE:\n case Keys.ENTER:\n toggleExpanded(event);\n break;\n case Keys.RIGHT:\n onRight(event);\n break;\n case Keys.LEFT:\n onLeft(event);\n break;\n case Keys.DOWN:\n selectRelative(event, 1);\n break;\n case Keys.UP:\n selectRelative(event, -1);\n break;\n case Keys.TAB:\n onTab(event);\n \n break;\n }\n }\n\n function onTab(event) {\n if (event.shiftKey) {\n const items = [...document.querySelector('.prom-lo-tree').querySelectorAll('.prom-lo-tree-item')];\n const root = items[0];\n\n if (root.id !== id) {\n event.preventDefault();\n event.stopPropagation();\n\n // @ts-ignore .focus for the element\n root.focus();\n }\n }\n }\n\n function onLeft(event) {\n if (expanded) {\n toggleExpanded(event);\n } else {\n const items = [...document.querySelector('.prom-lo-tree').querySelectorAll('.prom-lo-tree-item')];\n const parent = items.find(i => i.id === `lo-tree-item-${learningObjective.parentId}`);\n\n if (parent) {\n // @ts-ignore .focus for the element\n parent.focus();\n }\n }\n }\n\n function onRight(event) {\n if (expanded) {\n selectRelative(event, 1);\n } else {\n toggleExpanded(event);\n }\n }\n\n function selectRelative(event, offset) {\n event.preventDefault();\n event.stopPropagation();\n\n const items = [...document.querySelector('.prom-lo-tree').querySelectorAll('.prom-lo-tree-item')];\n const itemIndex = items.findIndex(i => i.id === id);\n\n if (itemIndex + offset < items.length && itemIndex + offset >= 0) {\n // @ts-ignore .focus for the element\n items[itemIndex + offset].focus();\n }\n }\n</script>\n","<svelte:window on:resize={resize} />\n\n<Modal\n {id}\n wide\n bind:enabled\n titleText={i18n.addLearningObjectives}\n cancelText={i18n.cancel}\n confirmText={i18n.save}\n describedBy=\"{id}-picker-description\"\n on:close={(e) => onClose(e.detail)}\n>\n <div bind:this={loPicker} class=\"prom-lo-picker\" slot=\"body\" style={loPickerStyle}>\n <ul class=\"prom-lo-tree\" role=\"tree\" aria-labelledby=\"{id}-header\">\n <LearningObjectiveTreeItem\n learningObjective={rootLearningObjective}\n {selectedLearningObjective}\n {learningObjectives}\n on:select={(e) => selectLO(e.detail)}\n />\n </ul>\n <section class=\"prom-lo-selected\">\n {#if selectedLearningObjective}\n <h2>{selectedLearningObjective.title}</h2>\n {#if selectedDescription}\n {#if renderLoDescriptionHtml}\n <p id=\"{id}-picker-description\">{@html selectedDescription}</p>\n {:else}\n <p id=\"{id}-picker-description\">{selectedDescription}</p>\n {/if}\n {/if}\n\n <div class=\"prom-lo-selected__list\">\n {#if selectedLearningObjective.childrenLoading}\n <div class=\"prom-lo__loading\">\n <span class=\"screen-reader\">{i18n.loading}</span>\n </div>\n {:else if !selectedLearningObjective.isFolder}\n {i18n.noItems}\n {:else if selectedChildren && selectedChildren.length}\n <List>\n <thead slot=\"header\">\n <ListElement header>\n <CheckboxCell\n bind:checked={headerChecked}\n text={i18n.selectAll}\n header\n on:change={(e) => headerCheckedChanged(e.detail)}\n />\n <LearningObjectiveCell text={i18n.learningObjectiveHeader} header />\n </ListElement>\n </thead>\n\n <tbody slot=\"body\">\n {#each selectedChildren as lo (lo.id)}\n <ListElement bind:checked={lo.checked} checkOnClick={lo.selectable && !lo.disabled} on:click={() => itemClicked(lo)}>\n {#if lo.selectable}\n <CheckboxCell bind:checked={lo.checked} text={i18n.selected} on:change={checkedItemsChanged} disabled={lo.disabled}/>\n {:else}\n <Cell />\n {/if}\n <LearningObjectiveCell\n title={lo.title}\n {renderLoTitleHtml}\n description={lo.description}\n {renderLoDescriptionHtml}\n cssClass={lo.cssClass}\n selectable={lo.selectable}\n on:click={() => itemClicked(lo)}\n />\n </ListElement>\n {/each}\n </tbody>\n </List>\n {/if}\n </div>\n {/if}\n </section>\n </div>\n</Modal>\n\n<script>\n import Modal from '../../Modal/v2/Modal.svelte';\n import List from '../../../lists/List/v1/List.svelte';\n import ListElement from '../../../lists/ListElement/v1/ListElement.svelte';\n import CheckboxCell from '../../../lists/CheckboxCell/v1/CheckboxCell.svelte';\n import Cell from '../../../lists/Cell/v1/Cell.svelte';\n import LearningObjectiveCell from '../../../lists/LearningObjectiveCell/v1/LearningObjectiveCell.svelte';\n import LearningObjectiveTreeItem from './LearningObjectiveTreeItem.svelte';\n import { createEventDispatcher } from 'svelte';\n\n const dispatch = createEventDispatcher();\n\n /**\n * @typedef LearningObjective\n * @type {object}\n * @property {number} id\n * @property {number} parentId\n * @property {string} title\n * @property {string} description\n * @property {string} cssClass\n * @property {boolean} isFolder - If the lo contains other items within it\n * @property {boolean} [checked]\n * @property {boolean} [childrenLoading]\n * @property {boolean} [childrenLoaded]\n * @property {boolean} [disabled]\n */\n\n /** @type {string} Defaults to a random string */\n export let id = Math.random().toString(36).substr(2, 16);\n\n /** @type {boolean} */\n export let enabled = false;\n\n /** @type {boolean} */\n export let initialSelectionDisabled = false;\n\n /** @type {boolean} */\n export let renderLoTitleHtml = false;\n\n /** @type {boolean} */\n export let renderLoDescriptionHtml = false;\n\n /**\n * @callback getLearningObjectives\n * @param {number} nodeId - The parent id to return learning objectives for\n * @returns {Promise<LearningObjective[]>} Promise object resolving to an array of learning objectives\n */\n\n /** @type {getLearningObjectives} A method returning learning objectives for a parent */\n export let getLearningObjectives;\n /** @type { LearningObjective[] }*/\n export let initialLearningObjectives = [];\n\n /** @type {LearningObjective}*/\n export let rootLearningObjective = {\n id: 0,\n parentId: undefined,\n cssClass: '',\n title: '',\n description: '',\n isFolder: true,\n };\n\n /**\n * @typedef LearningObjectivePickerTerms\n * @type {object}\n * @property {string} [learningObjectivesConnectedToCourse]\n * @property {string} [save]\n * @property {string} [cancel]\n * @property {string} [addLearningObjectives]\n * @property {string} [selectAll]\n * @property {string} [learningObjectiveHeader]\n * @property {string} [selected]\n * @property {string} [noItems]\n * @property {string} [loading]\n */\n\n /** @type {LearningObjectivePickerTerms} i18n terms for the component */\n export let i18n = {};\n\n let loPicker;\n let reservedHeight = 150;\n let selectedChildren = [];\n let headerChecked = false;\n let learningObjectives = [];\n let selectedLearningObjective = null;\n\n $: if (enabled) {\n onEnable();\n }\n\n $: selectedDescription = selectedLearningObjective ? selectedLearningObjective.description : '';\n\n $: loPickerStyle = reservedHeight ? `height: calc(100vh - ${reservedHeight}px);` : '';\n\n function onEnable() {\n learningObjectives = [];\n selectedChildren = [];\n\n rootLearningObjective.checked = false;\n rootLearningObjective.childrenLoading = false;\n rootLearningObjective.childrenLoaded = false;\n rootLearningObjective.isFolder = true;\n\n selectLO(rootLearningObjective);\n setTimeout(resize, 0);\n }\n\n function selectLO(lo) {\n if (lo.id === 0 || !selectedLearningObjective || selectedLearningObjective.id !== lo.id) {\n selectedLearningObjective = lo;\n\n if (lo.isFolder && !lo.childrenLoading && !lo.childrenLoaded) {\n lo.childrenLoading = true;\n learningObjectives = [...learningObjectives];\n\n getLearningObjectives(lo.id || 0).then(newLOs => {\n // Use the initialLearningObjectives array to pre-check LOs that are already selected\n newLOs = newLOs.map(newLO => {\n newLO.checked = initialLearningObjectives.some(initialLO => initialLO.id === newLO.id);\n\n // If the initialSelectionDisabled setting is used then LO from the\n // initialLearningObjectives are marked disabled and cannot be unchecked.\n if (initialSelectionDisabled) {\n newLO.disabled = newLO.checked;\n }\n\n return newLO;\n });\n\n lo.childrenLoading = false;\n lo.childrenLoaded = true;\n learningObjectives = [...learningObjectives, ...newLOs];\n\n setSelectedChildren();\n });\n } else {\n setSelectedChildren();\n }\n }\n }\n\n function resize() {\n if (!enabled) {\n return;\n }\n\n // If the window width is smaller than the breakpoint do not set the height\n // instead the breakpoint will wrap the layout and the whole thing will scroll\n if (window.innerWidth < 640) {\n reservedHeight = null;\n\n return;\n }\n\n const modal = document.getElementById(id);\n const content = modal.querySelector('.prom-modal2__content');\n\n const scrollOverflow = content.scrollHeight - content.clientHeight;\n const totalModalHeight = modal.getBoundingClientRect().height;\n const loPickerHeight = loPicker.getBoundingClientRect().height;\n\n reservedHeight = totalModalHeight - (loPickerHeight - scrollOverflow);\n\n // If less than 250px space remain do not limit the height and let it overflow instead\n if (window.innerHeight - reservedHeight < 250) {\n reservedHeight = null;\n }\n }\n\n function setSelectedChildren() {\n selectedChildren = learningObjectives.filter(lo => lo.parentId === selectedLearningObjective.id);\n checkedItemsChanged();\n }\n\n function itemClicked(lo) {\n if (lo.selectable) {\n if (!lo.disabled) {\n checkedItemsChanged();\n }\n } else {\n selectLO(lo);\n }\n }\n\n function headerCheckedChanged({ checked }) {\n learningObjectives.filter(lo => lo.parentId === selectedLearningObjective.id).forEach((item) => {\n if (!item.disabled) {\n item.checked = checked && item.selectable;\n }\n });\n\n setSelectedChildren();\n }\n\n function checkedItemsChanged() {\n headerChecked = selectedChildren.every(i => i.checked || !i.selectable) && selectedChildren.some(i => i.checked);\n }\n\n function onClose({ confirmed }) {\n if (confirmed) {\n const checkedLO = learningObjectives.filter(lo => lo.checked);\n\n // If any of the initial LO were never loaded, include them in the return since they had\n // to chance to be unchecked but were never loaded into the learningObjectives array\n initialLearningObjectives.forEach(initialLO => {\n if (!learningObjectives.find(lo => initialLO.id === lo.id)) {\n checkedLO.push(initialLO);\n }\n });\n\n dispatch('apply', checkedLO);\n }\n }\n</script>\n","<button\r\n id={LO_ID}\r\n class=\"plan__learning-objective\"\r\n aria-haspopup=\"dialog\"\r\n bind:this={element}\r\n on:click={!isTooltipDialogOpened ? openTooltipDialog : closeTooltipDialog}\r\n>\r\n <span class=\"lo-icon {isFolder ? 'lo-icon--folder' : ''}\"></span>\r\n <span class=\"plan__learning-objective-title\">{title}</span>\r\n</button>\r\n\r\n<script>\r\n import { createEventDispatcher } from \"svelte\";\r\n import { guidV4 } from \"@itslearning/atlas/generate/guid\";\r\n\r\n const dispatch = createEventDispatcher();\r\n\r\n export let id;\r\n export let title;\r\n export let description;\r\n export let isFolder;\r\n export let isTooltipDialogOpened = false;\r\n\r\n const LO_ID = `lo-${guidV4()}`;\r\n\r\n let element = null;\r\n let tooltipDialogPlacement;\r\n\r\n $: element;\r\n\r\n // Show the tooltip dialog\r\n function openTooltipDialog() {\r\n dispatch(\"openTooltipDialog\", {\r\n learningObjectiveElement: element,\r\n id: id,\r\n heading: title,\r\n text: description,\r\n placement: tooltipDialogPlacement\r\n });\r\n }\r\n\r\n // Close the tooltip dialog\r\n function closeTooltipDialog(event) {\r\n event.stopPropagation();\r\n dispatch(\"closeTooltipDialog\");\r\n }\r\n</script>\r\n","<svelte:window\r\n on:click={clickHandler}\r\n on:keyup={onWindowKeyUp}\r\n on:scroll={onScrollChange}\r\n on:resize={updateTooltipDialogPosition}\r\n/>\r\n\r\n<div\r\n bind:this={tooltipdialog}\r\n id=\"{id}-{role}\"\r\n class=\"itsl-tooltipdialog itsl-tooltipdialog-{id} itsl-tooltipdialog--{placement} {displayClass}\"\r\n {role}\r\n>\r\n <div class=\"itsl-tooltipdialog__arrow\"></div>\r\n <div class=\"itsl-tooltipdialog__content\">\r\n <div class=\"its-tooltipdialog__content-headingrow\">\r\n <div class=\"its-tooltipdialog__content-headingrow-text\">{heading}</div>\r\n <div class=\"itsl-tooltipdialog__content-headingrow-closebutton-container\">\r\n <IconButton\r\n htmlType=\"button\"\r\n iconClass={closeButtonClass}\r\n iconOnly={true}\r\n text={closeButtonText}\r\n type=\"plain\"\r\n on:click={() => dispatch(\"close\")}\r\n />\r\n </div>\r\n </div>\r\n {#if text}\r\n <div>{text}</div>\r\n {/if}\r\n </div>\r\n {#if showActions}\r\n <div class=\"itsl-tooltipdialog__footer\">\r\n <Link\r\n kind=\"standalone\"\r\n href={new URL(location.origin + destinationUrl)}\r\n text={linkText}\r\n />\r\n <IconButton\r\n describedby={removeButtonId}\r\n htmlType=\"button\"\r\n iconClass=\"itsl-tooltipdialog__footer-removebutton\"\r\n text={actionButtonText}\r\n type=\"plain\"\r\n on:click={() => dispatch(\"delete\")}\r\n />\r\n <span id={removeButtonId} class=\"screen-reader\">\r\n {actionButtonLabel}\r\n </span>\r\n </div>\r\n {/if}\r\n</div>\r\n\r\n<script>\r\n import { Keys } from \"@itslearning/atlas/keyboard/keys\";\r\n import { normalizeKey } from \"@itslearning/atlas/keyboard/normalize\";\r\n import { guidV4 } from \"@itslearning/atlas/generate/guid\";\r\n import { createEventDispatcher } from \"svelte\";\r\n import IconButton from \"@itslearning/prometheus/assets/inputs/IconButton/v1/IconButton.svelte\";\r\n import TabTrapHelper from \"@itslearning/prometheus/lib/helpers/TabTrapHelper.js\";\r\n import Link from \"@itslearning/prometheus/assets/Navigation/Link/v1/Link.svelte\";\r\n\r\n const dispatch = createEventDispatcher();\r\n\r\n /** @type {Element} */\r\n export let element = null;\r\n /** @type {'top'|'bottom'} */\r\n export let placement = \"bottom\";\r\n /** @type {boolean} */\r\n export let show = false;\r\n /** @type {string} */\r\n export let idLO = \"\";\r\n /** @type {string} */\r\n export let heading = \"\";\r\n /** @type {string} */\r\n export let text = \"\";\r\n /** @type {string} */\r\n export let closeButtonText = \"\";\r\n /** @type {boolean} */\r\n export let showActions = false;\r\n /** @type {string} */\r\n export let linkText = \"\";\r\n /** @type {string} */\r\n export let actionButtonText = \"\";\r\n /** @type {string} */\r\n export let actionButtonLabel = \"\";\r\n /** @type {string} */\r\n export let courseId = \"\";\r\n /** @type {boolean} */\r\n export let tableViewParent;\r\n\r\n const id = guidV4();\r\n const removeButtonId = `removeButton-${guidV4()}`;\r\n const closeButtonClass = \"itsl-tooltipdialog__content-headingrow-closebutton\";\r\n const role = \"dialog\";\r\n\r\n let tooltipdialog;\r\n let focusedBeforeTooltipDialog = undefined;\r\n let tabTrapper = undefined;\r\n\r\n $: displayClass = show ? \"\" : \"itsl-tooltipdialog__hidden\";\r\n\r\n $: if (show) {\r\n onOpen();\r\n } else {\r\n onClose();\r\n }\r\n\r\n $: destinationUrl = `/LearningObjective/AssessmentReport/SingleLearningObjectiveProgressReport.aspx?LearningObjectiveId=${idLO}&CourseID=${courseId}&ReturnUrl=${encodeURIComponent(\r\n window.location.href\r\n )}`;\r\n\r\n function onOpen() {\r\n focusedBeforeTooltipDialog = document.activeElement;\r\n updateTooltipDialog(show);\r\n\r\n setTimeout(() => {\r\n if (tooltipdialog) {\r\n // Enable the tab trap and set focus on close button\r\n tabTrapper = new TabTrapHelper(tooltipdialog);\r\n tabTrapper.init();\r\n tooltipdialog.querySelector(`.${closeButtonClass}`).focus();\r\n }\r\n }, 0);\r\n }\r\n\r\n function onClose() {\r\n // Return focus to the element that was focused before opening\r\n\r\n if (!tableViewParent) {\r\n if (focusedBeforeTooltipDialog) {\r\n focusedBeforeTooltipDialog.focus();\r\n }\r\n\r\n // Disable the tab trap\r\n if (tabTrapper) {\r\n tabTrapper.teardown();\r\n }\r\n }\r\n }\r\n\r\n function onWindowKeyUp(event) {\r\n const key = normalizeKey(event.key);\r\n\r\n if (key === Keys.ESCAPE) {\r\n dispatch(\"close\", event);\r\n }\r\n }\r\n\r\n function clickHandler(event) {\r\n if (element && tooltipdialog) {\r\n if (!element.contains(event.target) && !tooltipdialog.contains(event.target)) {\r\n dispatch(\"close\", event);\r\n }\r\n }\r\n }\r\n\r\n function onScrollChange() {\r\n updateTooltipDialogPosition();\r\n }\r\n\r\n function updateTooltipDialog(show) {\r\n if (show) {\r\n setTimeout(updateTooltipDialogPosition, 0);\r\n }\r\n }\r\n\r\n function updateTooltipDialogPosition() {\r\n if (element) {\r\n const rect = element.getBoundingClientRect();\r\n const elementInFirstHalfOfThePage = rect.top <= window.innerHeight / 2;\r\n const scrollAtTheBottom =\r\n window.scrollY + window.innerHeight + 200 > document.body.scrollHeight; // at the bottom of the page\r\n\r\n if (window.scrollY !== 0) {\r\n // there is a scrollbar\r\n if (scrollAtTheBottom) {\r\n placement = \"top\";\r\n tooltipdialog.style.left = element.getBoundingClientRect().left + \"px\";\r\n tooltipdialog.style.top =\r\n element.getBoundingClientRect().top -\r\n tooltipdialog.offsetHeight -\r\n 10 +\r\n \"px\";\r\n } else {\r\n placement = \"bottom\";\r\n tooltipdialog.style.left = element.getBoundingClientRect().left + \"px\";\r\n tooltipdialog.style.top = element.getBoundingClientRect().top + 30 + \"px\";\r\n }\r\n } else {\r\n if (!elementInFirstHalfOfThePage) {\r\n placement = \"top\";\r\n tooltipdialog.style.left = element.getBoundingClientRect().left + \"px\";\r\n tooltipdialog.style.top =\r\n element.getBoundingClientRect().top -\r\n tooltipdialog.offsetHeight -\r\n 10 +\r\n \"px\";\r\n } else {\r\n placement = \"bottom\";\r\n tooltipdialog.style.left = element.getBoundingClientRect().left + \"px\";\r\n tooltipdialog.style.top = element.getBoundingClientRect().top + 30 + \"px\";\r\n }\r\n }\r\n }\r\n }\r\n</script>\r\n","import {\r\n getLearningObjectives,\r\n setPlanLearningObjectives,\r\n removePlanLearningObjective\r\n} from \"../api\";\r\n\r\nexport async function loadLearningObjectives(parentId, selectableCategory = false) {\r\n const learningObjectiveResponse = await getLearningObjectives(parentId, { selectableCategory });\r\n\r\n return learningObjectiveResponse.Items.map(lo => {\r\n const intId = parseInt(lo.Id);\r\n\r\n // The items returned from this endpoint have string IDs but the\r\n // learning objectives' ids are actually ints and need to be sent\r\n // to the API and compared as integers\r\n if (!Number.isNaN(intId)) {\r\n lo.Id = intId;\r\n }\r\n\r\n return {\r\n id: lo.Id,\r\n title: lo.Title,\r\n description: lo.Description,\r\n selectable: lo.Selectable,\r\n selectedByDefault: lo.SelectedByDefault,\r\n setRootAsParent: lo.SetRootAsParent,\r\n isFolder: lo.IsFolder,\r\n cssClass: lo.CssClass,\r\n parentId\r\n };\r\n });\r\n}\r\n\r\nexport function updateLearningObjectives(planId, learningObjectiveIds) {\r\n return setPlanLearningObjectives(planId, learningObjectiveIds);\r\n}\r\n\r\nexport function removeLearningObjective(planId, learningObjectiveId) {\r\n return removePlanLearningObjective(planId, learningObjectiveId);\r\n}\r\n","<div class=\"its-plans__topic-learning-objectives\">\r\n {#if field.learningObjectives}\r\n {#each field.learningObjectives as lo (lo.id)}\r\n <LearningObjective\r\n id={lo.id}\r\n title={lo.title}\r\n description={lo.description}\r\n isFolder={lo.cssClass === \"Category\" || lo.type === learningObjectiveType.Category}\r\n isTooltipDialogOpened={showTooltipDialog}\r\n on:openTooltipDialog={openTooltipDialog}\r\n on:closeTooltipDialog={closeTooltipDialog}\r\n />\r\n {/each}\r\n <div class=\"its-plans__topic-learning-objectives__tooltipdialog-container\">\r\n <TooltipDialog\r\n show={showTooltipDialog}\r\n element={learningObjectiveElement}\r\n placement={tooltipDialogPlacement}\r\n idLO={idLearningObjective}\r\n heading={headingTooltipDialog}\r\n text={textTooltipDialog}\r\n closeButtonText={i18n.close}\r\n showActions={config.canEdit}\r\n linkText={i18n.goToProgressReport}\r\n actionButtonText={i18n.remove}\r\n actionButtonLabel={i18n.removeFromTopic}\r\n courseId={config.courseId}\r\n on:delete={removeLearningObjective(idLearningObjective)}\r\n on:close={closeTooltipDialog}\r\n />\r\n </div>\r\n {/if}\r\n {#if canEdit}\r\n <IconButton\r\n type=\"plain\"\r\n htmlType=\"button\"\r\n iconClass=\"add-lo-button\"\r\n text={i18n.addLearningObjectives}\r\n on:click={showAddLOModal}\r\n disabled={losDirty}\r\n loading={losDirty}\r\n />\r\n <LearningObjectivePicker\r\n bind:enabled={loPickerEnabled}\r\n {rootLearningObjective}\r\n initialLearningObjectives={field.learningObjectives}\r\n {getLearningObjectives}\r\n initialSelectionDisabled={true}\r\n {i18n}\r\n on:apply={e => applyNewLearningObjectives(e.detail)}\r\n />\r\n {/if}\r\n</div>\r\n\r\n<script>\r\n import IconButton from \"@itslearning/prometheus/assets/inputs/IconButton/v1/IconButton.svelte\";\r\n import LearningObjectivePicker from \"@itslearning/prometheus/assets/modals/LearningObjectivePicker/v1/LearningObjectivePicker.svelte\";\r\n\r\n import { formatLanguageString } from \"@itslearning/atlas/strings/format\";\r\n\r\n import LearningObjective from \"@its-ui/planner-common/components/LearningObjective/LearningObjective.svelte\";\r\n import TooltipDialog from \"@its-ui/planner-common/components/TooltipDialog/TooltipDialog.svelte\";\r\n import { loadLearningObjectives } from \"@its-ui/planner-common/controllers/learningObjectivesController\";\r\n import {\r\n updateTopicFieldLearningObjectives,\r\n removeTopicFieldLearningObjective\r\n } from \"@its-ui/planner-common/controllers/topicController\";\r\n import { learningObjectiveType } from \"@its-ui/planner-common/constants\";\r\n\r\n export let field;\r\n export let topic;\r\n export let canEdit;\r\n export let i18n;\r\n export let config;\r\n\r\n let losDirty = false;\r\n let loPickerEnabled = false;\r\n\r\n // TooltipDialog vars\r\n let learningObjectiveElement = null;\r\n let showTooltipDialog = false;\r\n let idLearningObjective;\r\n let headingTooltipDialog;\r\n let textTooltipDialog;\r\n let tooltipDialogPlacement;\r\n\r\n $: rootLearningObjective = {\r\n id: 0,\r\n title: config.courseTitle,\r\n description: formatLanguageString(\r\n i18n.learningObjectivesConnectedToCourse,\r\n config.courseTitle\r\n )\r\n };\r\n\r\n async function removeLearningObjective(loId) {\r\n closeTooltipDialog();\r\n field.learningObjectives = field.learningObjectives.filter(i => i.id !== loId);\r\n\r\n losDirty = true;\r\n\r\n await removeTopicFieldLearningObjective(topic.id, field.id, loId);\r\n\r\n losDirty = false;\r\n }\r\n\r\n function showAddLOModal() {\r\n loPickerEnabled = true;\r\n }\r\n\r\n function getLearningObjectives(parentId) {\r\n return loadLearningObjectives(parentId, true);\r\n }\r\n\r\n async function applyNewLearningObjectives(newLearningObjectives) {\r\n field.learningObjectives = newLearningObjectives;\r\n\r\n losDirty = true;\r\n\r\n await updateTopicFieldLearningObjectives(topic.id, field.id, newLearningObjectives);\r\n\r\n losDirty = false;\r\n }\r\n\r\n export function isDirty() {\r\n return losDirty;\r\n }\r\n\r\n // Open/close the tooltip dialog\r\n function openTooltipDialog({ detail }) {\r\n if (detail.learningObjectiveElement) {\r\n learningObjectiveElement = detail.learningObjectiveElement;\r\n idLearningObjective = detail.id;\r\n headingTooltipDialog = detail.heading;\r\n textTooltipDialog = detail.text;\r\n showTooltipDialog = true;\r\n tooltipDialogPlacement = detail.placement;\r\n }\r\n }\r\n\r\n function closeTooltipDialog() {\r\n showTooltipDialog = false;\r\n }\r\n</script>\r\n","<Button text={title} type=\"plain\" htmlType=\"button\" on:click={onClick} />\r\n\r\n<Modal bind:this={rubricModal} confirmText={i18n.close} showCancel={false} wide>\r\n <span slot=\"title\">{title}</span>\r\n <div slot=\"body\">\r\n <iframe class=\"its-plans__rubric-frame\" src={rubricUrl} {title} />\r\n </div>\r\n</Modal>\r\n\r\n<script>\r\n import Button from \"@itslearning/prometheus/assets/inputs/Button/v1/Button.svelte\";\r\n import Modal from \"@itslearning/prometheus/assets/modals/Modal/v2/Modal.svelte\";\r\n\r\n export let canEdit;\r\n export let i18n;\r\n export let config;\r\n export let rubricUrl;\r\n\r\n let rubricModal;\r\n\r\n if (!rubricUrl) {\r\n rubricUrl = config.rubricUrl;\r\n }\r\n\r\n $: title = canEdit ? i18n.manageRubric : i18n.viewRubric;\r\n\r\n function onClick() {\r\n // This is a modal with an iframe where the user can view or edit the\r\n // rubric. We do not need to do anything when they confirm/cancel it.\r\n rubricModal.prompt({});\r\n }\r\n</script>\r\n","<svelte:window on:beforeunload={onBeforeUnload} />\r\n{#if showCustomFields && customFieldsVisible.some(a => !!a)}\r\n <div class=\"its-plans__topic-fields\">\r\n {#each topic.customFields as field, i}\r\n {#if showCustomField(i)}\r\n {#if field.type !== columnTypes.Topic && customFieldsVisible[i]}\r\n <div class=\"its-plans__topic-field\">\r\n <h2 class=\"its-plans__topic-field-label\" id=\"field-title-{field.id}\">\r\n {field.title}\r\n </h2>\r\n {#if field.type === columnTypes.RichText}\r\n <TextField\r\n bind:field\r\n bind:this={fieldElements[i]}\r\n {config}\r\n {topic}\r\n {i18n}\r\n />\r\n {:else if field.type === columnTypes.LearningObjectives}\r\n <LearningObjectives\r\n bind:field\r\n bind:this={fieldElements[i]}\r\n canEdit={config.canEdit}\r\n {config}\r\n {topic}\r\n {i18n}\r\n />\r\n {:else if field.type === columnTypes.Term}\r\n <TopicTerm\r\n bind:field\r\n canEdit={config.canEdit}\r\n {topic}\r\n {i18n}\r\n />\r\n {:else if field.type === columnTypes.Rubric}\r\n <TopicRubric canEdit={config.canEdit} {topic} {i18n} {config} />\r\n {/if}\r\n </div>\r\n {/if}\r\n {/if}\r\n {/each}\r\n </div>\r\n{/if}\r\n\r\n<script>\r\n import { columnTypes, columnVisibility } from \"@its-ui/planner-common/constants\";\r\n import TextField from \"../TextField/TextField.svelte\";\r\n import TopicTerm from \"../TopicTerm/TopicTerm.svelte\";\r\n import LearningObjectives from \"../LearningObjectives/LearningObjectives.svelte\";\r\n import TopicRubric from \"../TopicRubric/TopicRubric.svelte\";\r\n\r\n export let topic;\r\n export let i18n;\r\n export let config;\r\n\r\n const fieldElements = [];\r\n\r\n $: showCustomFields =\r\n topic &&\r\n topic.customFields &&\r\n topic.customFields.some(\r\n f => f.type !== columnTypes.Topic && f.type !== columnTypes.TopicThumbnail\r\n );\r\n\r\n $: customFieldsVisible =\r\n showCustomFields &&\r\n topic.customFields.map(field => {\r\n if (\r\n (field.type === columnTypes.Rubric && !config.isRubricForTopicEnabled) ||\r\n field.type === columnTypes.TopicThumbnail\r\n ) {\r\n return false;\r\n }\r\n\r\n if (config.canEdit) {\r\n return true;\r\n }\r\n\r\n if (field.type === columnTypes.RichText) {\r\n return field.text && field.text.length;\r\n }\r\n\r\n if (field.type === columnTypes.LearningObjectives) {\r\n return field.learningObjectives && field.learningObjectives.length;\r\n }\r\n\r\n if (field.type === columnTypes.Term) {\r\n return !!field.term;\r\n }\r\n\r\n if (field.type === columnTypes.Rubric) {\r\n return field.learningObjectives && field.learningObjectives.length;\r\n }\r\n });\r\n\r\n // Fired when the window is being closed or the user is navigating away\r\n function onBeforeUnload(event) {\r\n // Check if any of the fields have `isDirty` defined and if they return true prevent uoloading\r\n if (fieldElements.some(e => e && e.isDirty && e.isDirty())) {\r\n // Prompt the user there may be unsaved changes\r\n event.preventDefault();\r\n event.returnValue = \"\";\r\n }\r\n }\r\n\r\n /**\r\n * When to show when there is one field with visibility set for all or teacher.\r\n * @returns {boolean} `true` it shows topic field, `false` does not show.\r\n */\r\n function showCustomField(index) {\r\n return (\r\n ((topic.customFields[index].columnVisibility === columnVisibility.All ||\r\n topic.customFields[index].columnVisibility === columnVisibility.Teacher) &&\r\n topic.customFields[index].type !== columnTypes.Term) ||\r\n (topic.customFields[index].type === columnTypes.Term &&\r\n config.isTermInTopicsVisible === true)\r\n );\r\n }\r\n\r\n /**\r\n * When to show topic fields section.\r\n * @returns {boolean} `true` it shows topic fields section, `false` does not show.\r\n */\r\n function showCustomFieldSection() {\r\n return (\r\n topic.customFields.length === 2 &&\r\n topic.customFields[0].type === columnTypes.Topic &&\r\n topic.customFields[1].type === columnTypes.Term &&\r\n config.isTermInTopicsVisible === false\r\n );\r\n }\r\n</script>\r\n","<div class=\"itsl-topic__plans-sorting\">\r\n {#if config.canEdit}\r\n <Select\r\n label={i18n.sortBy}\r\n id=\"SortById\"\r\n bind:value={planOrder}\r\n disabled={false}\r\n on:change={changeValue}\r\n >\r\n <option value={planSorting.CreationDateValue}>\r\n {i18n.creationDate}\r\n </option>\r\n {#if !isSelfPacedCourse}\r\n <option value={planSorting.DateAscendingValue}>\r\n {i18n.dateAscending}\r\n </option>\r\n <option value={planSorting.DateDescendingValue}>\r\n {i18n.dateDescending}\r\n </option>\r\n {/if}\r\n <option value={planSorting.AlphabeticallyAZValue}>\r\n {i18n.alphabeticallyAZ}\r\n </option>\r\n <option value={planSorting.AlphabeticallyZAValue}>\r\n {i18n.alphabeticallyZA}\r\n </option>\r\n {#if showYourOwnSorting}\r\n <option value={planSorting.YourOwnSortingValue}>\r\n {i18n.yourOwnSorting}\r\n </option>\r\n {/if}\r\n </Select>\r\n {/if}\r\n</div>\r\n\r\n<script>\r\n import { createEventDispatcher } from \"svelte\";\r\n\r\n import Select from \"@itslearning/prometheus/assets/inputs/Select/v1/Select.svelte\";\r\n import config from \"@its-ui/planner-common/config\";\r\n import { planSorting, columnTypes, columnVisibility } from \"@its-ui/planner-common/constants\";\r\n\r\n import { setPlanOrderInTopic } from \"@its-ui/planner-common/api\";\r\n\r\n export let i18n;\r\n export let topicId;\r\n export let planOrder;\r\n export let showYourOwnSorting;\r\n\r\n const isSelfPacedCourse =\r\n config.columnVisibilities[columnTypes.Date] === columnVisibility.Nobody;\r\n\r\n const dispatch = createEventDispatcher();\r\n\r\n const changeValue = async event => {\r\n if (event.detail) {\r\n await setPlanOrderInTopic(topicId, event.detail);\r\n\r\n dispatch(\"changePlanOrder\", { planOrder: event.detail });\r\n }\r\n };\r\n</script>\r\n","import { columnTypes, columnVisibility } from \"@its-ui/planner-common/constants\";\n\nexport const showCustomFieldsSectionHelper = (customFields) => customFields?.some(\n f => f.columnVisibility != columnVisibility.Nobody // Must be visible to someone\n && f.type !== columnTypes.Topic\n && f.type !== columnTypes.TopicThumbnail);\n","<Page contentAreaLayout=\"wide\">\r\n <div class=\"its-plans__topic\">\r\n <PageHeader\r\n title={topicName}\r\n backLinkUrl={breadcrumbsHref}\r\n backLinkText={backLinkText}\r\n menuItems={settingsDropdownItems}\r\n i18n\r\n buttonDropdownId=\"topic-menu-button\"\r\n on:selectedOption={dropdownOptionSelected}\r\n />\r\n {#if showCustomFieldsSection }\r\n <div class=\"content-block content-block--secondary\">\r\n <CustomFields\r\n bind:topic={$topicData.topic}\r\n {i18n}\r\n {config}\r\n />\r\n </div>\r\n {/if}\r\n <h2 class=\"screen-reader\">{i18n.plans}</h2>\r\n <div class=\"its-plans__topic-plans\">\r\n <div\r\n class=\"its-plans__topic-plans-toolbar-container\"\r\n class:its-plans__topic-plans-toolbar-container--readonly={!isEditPlansToolbarAvailable}\r\n >\r\n {#if isEditPlansToolbarAvailable}\r\n <div class=\"its-plans__topic-plans-toolbar\">\r\n <Link kind=\"primary-standalone\" href={createNewPlanUrl} on:click={addPlan}>\r\n {i18n.addPlan}\r\n </Link>\r\n <PlanActions\r\n printAsTopic={config.topicId !== 0}\r\n data={$plansData}\r\n on:endOfActionOnSelectedPlans={updateAfterAction}\r\n selectedView={plannerViews.topic}\r\n {selectedPlanIds}\r\n ></PlanActions>\r\n {#if config.topicId}\r\n <PlanOrderSelector\r\n topicId={config.topicId}\r\n {i18n}\r\n {planOrder}\r\n {showYourOwnSorting}\r\n on:changePlanOrder={changePlanOrder}\r\n ></PlanOrderSelector>\r\n {/if}\r\n {#if config.canEdit && config.isImportEnabled}\r\n <UseReadyMadeContentLink\r\n href={`/Courses/${\r\n config.courseId\r\n }/ImportContent?importTopic=false&topicId=${\r\n config.topicId\r\n }&returnUrl=${encodeURI(window.location.href)}`}\r\n linktext={i18n.useReadyMadeContent}\r\n emptyState={false}\r\n ></UseReadyMadeContentLink>\r\n {/if}\r\n </div>\r\n {/if}\r\n <div>\r\n <TableViewLink\r\n {config}\r\n {i18n}\r\n isDataLoading={false}\r\n backExtraParams={tableViewLinkBackExtraParams}\r\n />\r\n </div>\r\n </div>\r\n\r\n {#if $plansData.plans && $plansData.plans.length === 0 && !$plansData.loading}\r\n <!-- Need to check 'loading', otherwise EmptyState will appear while loading a page -->\r\n <EmptyState\r\n {iconName}\r\n title={titleEmptyTopicPage}\r\n description={descriptionEmptyTopicPage}\r\n showLink={config.canEdit}\r\n linkText={i18n.addPlan}\r\n href={createNewPlanUrl}\r\n on:click={addPlan}\r\n />\r\n {#if config.canEdit && config.isImportEnabled}\r\n <UseReadyMadeContentLink\r\n href={`/Courses/${config.courseId}/ImportContent?importTopic=false&topicId=${\r\n config.topicId\r\n }&returnUrl=${encodeURI(window.location.href)}`}\r\n linktext={i18n.useReadyMadeContent}\r\n emptyState={true}\r\n ></UseReadyMadeContentLink>\r\n {/if}\r\n {/if}\r\n\r\n {#if $plansData.plans && $plansData.plans.length}\r\n <PlansView\r\n data={$plansData}\r\n loadMethod={loadMore}\r\n on:plansForTopicHasBeenReordered={plansForTopicHasBeenReordered}\r\n drag={!config.enableTopicPlansOwnSortingFixedOption ||\r\n planOrder === planSorting.YourOwnSortingValue}\r\n {selectedPlanIds}\r\n {columnVisibilities}\r\n {useGenericResourceColumn}\r\n />\r\n {/if}\r\n </div>\r\n\r\n <EditTopicModal\r\n bind:topic={$topicData.topic}\r\n bind:enabled={editTopicModalEnabled}\r\n on:save={e => saveTopicChanges(e.detail)}\r\n />\r\n\r\n <Modal bind:this={errorModal} showCancel={false} confirmText={i18n.ok} />\r\n </div>\r\n</Page>\r\n\r\n<script>\r\n import { formatLanguageString } from \"@itslearning/atlas/strings/format\";\r\n import Modal from \"@itslearning/prometheus/assets/modals/Modal/v2/Modal.svelte\";\r\n import Link from \"@itslearning/prometheus/assets/Navigation/Link/v1/Link.svelte\";\r\n import EmptyState from \"@itslearning/prometheus/assets/nodes/EmptyState/v1/EmptyState.svelte\";\r\n import PageHeader from \"@itslearning/prometheus/assets/patterns/PageHeader/v1/PageHeader.svelte\";\r\n import Page from \"@itslearning/prometheus/assets/templates/Page/v1/Page.svelte\";\r\n\r\n import EditTopicModal from \"@its-ui/planner-common/components/EditTopicModal/EditTopicModal.svelte\";\r\n import PlanActions from \"@its-ui/planner-common/components/PlanActions/PlanActions.svelte\";\r\n import PlansView from \"@its-ui/planner-common/components/PlansView/PlansView.svelte\";\r\n import TableViewLink from \"@its-ui/planner-common/components/TableViewLink/TableViewLink.svelte\";\r\n import UseReadyMadeContentLink from \"@its-ui/planner-common/components/UseReadyMadeContentLink/UseReadyMadeContentLink.svelte\";\r\n\r\n import CustomFields from \"../CustomFields/CustomFields.svelte\";\r\n import PlanOrderSelector from \"../PlanOrderSelector/PlanOrderSelector.svelte\";\r\n import { showCustomFieldsSectionHelper } from \"../helpers/showCustomFieldsSectionHelper.js\";\r\n\r\n import i18n from \"@its-ui/planner-common/i18n\";\r\n import config from \"@its-ui/planner-common/config\";\r\n import {\r\n createPlan,\r\n createPlanV2,\r\n connectToTopic,\r\n updateTopicColor,\r\n updateTopicTitle,\r\n getPlanOrderInTopic,\r\n setPlanOrderInTopic,\r\n resetPlansInTopicOrder\r\n } from \"@its-ui/planner-common/api\";\r\n import { plansData, topicData, selectedPlanIds } from \"@its-ui/planner-common/logic/topicPage/stores\";\r\n import { loadPlansForTopic } from \"@its-ui/planner-common/helpers/loadPlansHelper\";\r\n import {\r\n addBackDestinationParam,\r\n getAllQueryStringParametersFromCurrentUrl\r\n } from \"@its-ui/planner-common/helpers/backLinkHelper\";\r\n import {\r\n plannerViews,\r\n planSorting,\r\n columnTypes,\r\n columnVisibility,\r\n backLinkDestinations,\r\n noTopicTopicId,\r\n BACK_DESTINATION_QUERY_STRING_PARAMETER\r\n } from \"@its-ui/planner-common/constants\";\r\n import { onMount } from \"svelte\";\r\n\r\n /** Empty state variables **/\r\n const backLinkText = formatLanguageString(i18n.backTo, i18n.plansHeader.toLowerCase());\r\n const descriptionEmptyTopicPage = config.canEdit\r\n ? i18n.emptyState_TopicPage_Description_Teacher\r\n : i18n.emptyState_TopicPage_Description_Student;\r\n const iconName = \"plans\";\r\n const titleEmptyTopicPage = config.canEdit\r\n ? i18n.emptyState_Tab_Title_Teacher\r\n : i18n.emptyState_Title_Student;\r\n const isSelfPacedCourse =\r\n config.columnVisibilities[columnTypes.Date] === columnVisibility.Nobody;\r\n\r\n const columnVisibilities = config.columnVisibilities;\r\n const useGenericResourceColumn = config.useGenericResourceColumn;\r\n\r\n let editTopicModalEnabled = false;\r\n let planOrder = planSorting.NotSetValue;\r\n let showYourOwnSorting = false;\r\n let errorModal;\r\n let createNewPlanUrl = \"#\";\r\n let tableViewLinkBackExtraParams;\r\n\r\n $: topicName =\r\n config.topicId === noTopicTopicId\r\n ? config.withoutTopic\r\n : $topicData.topic\r\n ? $topicData.topic.name\r\n : \"\";\r\n\r\n $: settingsDropdownItems = config.canEdit && config.topicId\r\n ? [\r\n {\r\n options: [\r\n {\r\n icon: \"\",\r\n label: formatLanguageString(i18n.editX, config.topicName),\r\n link: false,\r\n value: { source: \"edit\" }\r\n }\r\n ]\r\n }\r\n ]\r\n : undefined;\r\n\r\n $: breadcrumbsHref = config.publicAccessKey\r\n ? `/plans/public/${config.publicAccessKey}/topics`\r\n : `/plans/courses/${config.courseId}/topics?ChildId=${config.childId}`;\r\n\r\n $: {\r\n let backLinkParameters = {\r\n [BACK_DESTINATION_QUERY_STRING_PARAMETER]: backLinkDestinations.topic\r\n };\r\n\r\n const currentUrlQueryStringParameters = getAllQueryStringParametersFromCurrentUrl();\r\n\r\n if (currentUrlQueryStringParameters) {\r\n backLinkParameters = {\r\n ...backLinkParameters,\r\n ...currentUrlQueryStringParameters\r\n };\r\n }\r\n\r\n tableViewLinkBackExtraParams = backLinkParameters;\r\n }\r\n\r\n $: isEditPlansToolbarAvailable =\r\n config.canEdit && $plansData.plans && $plansData.plans.length !== 0;\r\n\r\n $: showCustomFieldsSection = $topicData.topic?.customFields\r\n ? showCustomFieldsSectionHelper($topicData.topic?.customFields)\r\n : false;\r\n\r\n onMount(async () => {\r\n if (config.topicId > 0 && config.canEdit) {\r\n const result = await getPlanOrderInTopic(config.topicId);\r\n\r\n planOrder = result;\r\n\r\n if (planOrder === planSorting.YourOwnSortingValue) {\r\n showYourOwnSorting = true;\r\n } else if (\r\n planOrder === planSorting.NotSetValue &&\r\n !config.enableTopicPlansOwnSortingFixedOption\r\n ) {\r\n // Default for new topics: \"Date ascending\" for deadline-driven and \"Creation date\" for self-pace mode\r\n showYourOwnSorting = false;\r\n await setPlanOrderInTopic(config.topicId, isSelfPacedCourse ? planSorting.CreationDateValue : planSorting.DateAscendingValue);\r\n planOrder = isSelfPacedCourse ? planSorting.CreationDateValue : planSorting.DateAscendingValue;\r\n await updateAfterAction();\r\n } else if (\r\n isSelfPacedCourse &&\r\n (planOrder === planSorting.DateAscendingValue ||\r\n planOrder === planSorting.DateDescendingValue)\r\n ) {\r\n // In the case when you switch to SelfPace mode, sorting by date is not allowed\r\n showYourOwnSorting = true;\r\n await resetPlansInTopicOrder(config.topicId, planOrder);\r\n await setPlanOrderInTopic(config.topicId, planSorting.YourOwnSortingValue);\r\n planOrder = planSorting.YourOwnSortingValue;\r\n await updateAfterAction();\r\n } else if (config.enableTopicPlansOwnSortingFixedOption) {\r\n showYourOwnSorting = true;\r\n\r\n if (planOrder === planSorting.NotSetValue) {\r\n await setPlanOrderInTopic(config.topicId, isSelfPacedCourse ? planSorting.CreationDateValue : planSorting.DateAscendingValue);\r\n planOrder = isSelfPacedCourse ? planSorting.CreationDateValue : planSorting.DateAscendingValue;\r\n await updateAfterAction();\r\n }\r\n }\r\n }\r\n });\r\n\r\n const loadMore = () =>\r\n loadPlansForTopic(plansData, config.publicAccessKey, config.topicId, true, planOrder);\r\n\r\n function dropdownOptionSelected(event) {\r\n const data = event.detail.data;\r\n\r\n switch (data.source) {\r\n case \"edit\":\r\n editTopicModalEnabled = true;\r\n break;\r\n }\r\n }\r\n\r\n async function addPlan(event) {\r\n event.preventDefault();\r\n\r\n const topicId = config.assignToEnabled ? config.topicId : null;\r\n\r\n const planParams = {\r\n topic: {\r\n id: topicId\r\n },\r\n start: \"0000-00-00 00:00:00\",\r\n stop: \"0000-00-00 00:00:00\"\r\n };\r\n\r\n const planData = config.assignToEnabled ? await createPlanV2(planParams) : await createPlan(planParams);\r\n\r\n // It's possible this is the \"without topic\" page in which case topic id is 0 and we should\r\n // not connect any topic\r\n if (config.topicId) {\r\n await connectToTopic(planData.planId, config.topicId);\r\n }\r\n\r\n const newPlanUrlWithPlanId = config.newPlanUrl.replace(\"/new\", \"/new/\" + planData.planId);\r\n\r\n createNewPlanUrl = addBackDestinationParam(\r\n `${newPlanUrlWithPlanId}?pendingPlanId=${planData.planId}`\r\n );\r\n\r\n window.location.href = createNewPlanUrl;\r\n\r\n return false;\r\n }\r\n\r\n async function updateAfterAction() {\r\n await loadPlansForTopic(\r\n plansData,\r\n config.publicAccessKey,\r\n config.topicId,\r\n false,\r\n planOrder\r\n );\r\n }\r\n\r\n async function plansForTopicHasBeenReordered() {\r\n showYourOwnSorting = true;\r\n planOrder = await getPlanOrderInTopic(config.topicId);\r\n }\r\n\r\n function changePlanOrder(event) {\r\n planOrder = event.detail.planOrder;\r\n updateAfterAction();\r\n }\r\n\r\n async function saveTopicChanges({ name, color }) {\r\n try {\r\n if (name !== $topicData.topic.name) {\r\n await updateTopicTitle(config.topicId, name);\r\n }\r\n\r\n if ($topicData.topic.color !== color.hexCode) {\r\n await updateTopicColor(config.topicId, color.id);\r\n }\r\n } catch (e) {\r\n // If there is any error while saving log the error to the\r\n // console and show an error modal with an unknown error\r\n console.error(e);\r\n errorModal.prompt({ titleOnly: true, titleText: i18n.unknownError });\r\n\r\n return;\r\n } finally {\r\n editTopicModalEnabled = false;\r\n }\r\n\r\n // Apply the saved changes to the topic and plan models\r\n $topicData.topic.name = name;\r\n $topicData.topic.color = color.hexCode;\r\n $topicData.topic.borderColor = color.borderHexCode;\r\n\r\n if ($plansData.plans) {\r\n $plansData.plans = $plansData.plans.map(plan => ({ ...plan, topic: $topicData.topic }));\r\n }\r\n }\r\n</script>\r\n","const CommonFunctions = {\r\n isEdge: () => {\r\n // This is not used anymore - Edge here was old Edge not supported anymore\r\n return false;\r\n },\r\n makePostMessageCall: (parentFrame, data) => {\r\n parentFrame.postMessage(JSON.stringify(data), \"*\");\r\n },\r\n attachPostMessageEventListener: (window, messageNames, callbackFunction) => {\r\n window.addEventListener(\"message\", function (e) {\r\n let data;\r\n\r\n const originWindow = e.source;\r\n\r\n try {\r\n if (\r\n e.data &&\r\n (data = JSON.parse(e.data)) &&\r\n data.messageName &&\r\n (typeof messageNames === \"string\"\r\n ? data.messageName === messageNames\r\n : messageNames.includes(data.messageName))\r\n ) {\r\n callbackFunction(data, originWindow);\r\n }\r\n } catch {\r\n // do nothing\r\n }\r\n });\r\n },\r\n safeAjax: settings => {\r\n const data = settings.data !== undefined && settings.data !== null ? settings.data : {};\r\n const method = settings.type ? settings.type : \"GET\";\r\n\r\n return fetch(settings.url, {\r\n method: method,\r\n headers: {\r\n Accept: \"application/json\",\r\n \"Content-Type\": \"application/json\"\r\n },\r\n body: JSON.stringify(data)\r\n });\r\n },\r\n safeAjaxPost: settings => {\r\n // eslint-disable-next-line no-undef\r\n const postSettings = $.extend({}, settings, { type: \"POST\" });\r\n\r\n return CommonFunctions.safeAjax(postSettings);\r\n },\r\n measureKpi: (url, section, measurement, context) => {\r\n if (context === void 0) {\r\n context = null;\r\n }\r\n\r\n try {\r\n return CommonFunctions.safeAjaxPost({\r\n url: url,\r\n data: {\r\n measureSection: section,\r\n measurement: measurement,\r\n measureContext: context\r\n }\r\n });\r\n } catch {\r\n // do nothing\r\n }\r\n }\r\n};\r\n\r\nwindow.CommonFunctions = CommonFunctions;\r\n\r\nconst CommonConstants = {\r\n keyCodes: {\r\n escape: 27\r\n }\r\n};\r\n\r\nwindow.CommonConstants = CommonConstants;\r\n\r\nconst MessageNames = {\r\n textEditorInteraction: \"textEditorInteraction\",\r\n editEmbededContent: \"editEmbededContent\"\r\n};\r\n\r\nwindow.MessageNames = MessageNames;\r\n\r\nconst __extends =\r\n (this && this.__extends) ||\r\n function (d, b) {\r\n // eslint-disable-next-line no-prototype-builtins\r\n for (const p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\r\n\r\n function __() {\r\n this.constructor = d;\r\n }\r\n\r\n d.prototype = b === null ? Object.create(b) : ((__.prototype = b.prototype), new __());\r\n };\r\n\r\nconst CommonWindowMessages = new Object();\r\n\r\nCommonWindowMessages.MessageNames = MessageNames;\r\n\r\nconst GenericMessage = (function () {\r\n function GenericMessage(messageName) {\r\n this.messageName = messageName;\r\n }\r\n\r\n return GenericMessage;\r\n})();\r\n\r\nCommonWindowMessages.GenericMessage = GenericMessage;\r\nconst GenericMessageWithData = (function (_super) {\r\n __extends(GenericMessageWithData, _super);\r\n\r\n function GenericMessageWithData(messageName, extendedData) {\r\n _super.call(this, messageName);\r\n this.extendedData = extendedData;\r\n }\r\n\r\n return GenericMessageWithData;\r\n})(GenericMessage);\r\n\r\nCommonWindowMessages.GenericMessageWithData = GenericMessageWithData;\r\n\r\nconst TextEditorBaseInteractionMessage = (function (_super) {\r\n __extends(TextEditorBaseInteractionMessage, _super);\r\n\r\n function TextEditorBaseInteractionMessage(\r\n interactionType,\r\n closeDialogAfterPerformingOperation,\r\n editorInstanceId\r\n ) {\r\n if (closeDialogAfterPerformingOperation === void 0) {\r\n closeDialogAfterPerformingOperation = false;\r\n }\r\n\r\n if (editorInstanceId === void 0) {\r\n editorInstanceId = \"\";\r\n }\r\n\r\n _super.call(this, MessageNames.textEditorInteraction);\r\n this.interactionType = interactionType;\r\n this.closeDialogAfterPerformingOperation = closeDialogAfterPerformingOperation;\r\n this.editorInstanceId = editorInstanceId;\r\n }\r\n\r\n return TextEditorBaseInteractionMessage;\r\n})(GenericMessage);\r\n\r\n/** Generic message with data for any text editor interactions. **/\r\nconst TextEditorBaseInteractionWithDataMessage = (function (_super) {\r\n __extends(TextEditorBaseInteractionWithDataMessage, _super);\r\n\r\n function TextEditorBaseInteractionWithDataMessage(\r\n interactionType,\r\n extendedData,\r\n closeDialogAfterPerformingOperation,\r\n editorInstanceId\r\n ) {\r\n if (closeDialogAfterPerformingOperation === void 0) {\r\n closeDialogAfterPerformingOperation = false;\r\n }\r\n\r\n if (editorInstanceId === void 0) {\r\n editorInstanceId = \"\";\r\n }\r\n\r\n _super.call(this, interactionType, closeDialogAfterPerformingOperation, editorInstanceId);\r\n this.extendedData = extendedData;\r\n }\r\n\r\n return TextEditorBaseInteractionWithDataMessage;\r\n})(TextEditorBaseInteractionMessage);\r\n\r\n/** Sent to text editor from inner frame to close dialog **/\r\nconst TextEditorCloseDialogMessage = (function (_super) {\r\n __extends(TextEditorCloseDialogMessage, _super);\r\n\r\n function TextEditorCloseDialogMessage() {\r\n _super.call(this, TextEditorInteractionType.CloseDialog, true);\r\n }\r\n\r\n return TextEditorCloseDialogMessage;\r\n})(TextEditorBaseInteractionMessage);\r\n\r\nCommonWindowMessages.TextEditorCloseDialogMessage = TextEditorCloseDialogMessage;\r\n\r\n/** Sent to text editor from inner frame to insert given HTML text **/\r\nconst TextEditorInsertHtmlMessage = (function (_super) {\r\n __extends(TextEditorInsertHtmlMessage, _super);\r\n\r\n function TextEditorInsertHtmlMessage(\r\n htmlContent,\r\n closeDialogAfterPerformingOperation,\r\n editorInstanceId,\r\n isEmbeddedImage\r\n ) {\r\n if (closeDialogAfterPerformingOperation === void 0) {\r\n closeDialogAfterPerformingOperation = false;\r\n }\r\n\r\n if (editorInstanceId === void 0) {\r\n editorInstanceId = \"\";\r\n }\r\n\r\n if (isEmbeddedImage === void 0) {\r\n isEmbeddedImage = false;\r\n }\r\n\r\n _super.call(\r\n this,\r\n TextEditorInteractionType.InsertHtml,\r\n closeDialogAfterPerformingOperation\r\n );\r\n this.htmlContent = htmlContent;\r\n this.editorInstanceId = editorInstanceId;\r\n this.isEmbeddedImage = isEmbeddedImage;\r\n }\r\n\r\n return TextEditorInsertHtmlMessage;\r\n})(TextEditorBaseInteractionMessage);\r\n\r\nCommonWindowMessages.TextEditorInsertHtmlMessage = TextEditorInsertHtmlMessage;\r\n/** Sent to text editor from inner frame to insert the HTML of hyperlink to file **/\r\nconst TextEditorInsertLinkToFileMessage = (function (_super) {\r\n __extends(TextEditorInsertLinkToFileMessage, _super);\r\n\r\n function TextEditorInsertLinkToFileMessage(\r\n linkUrl,\r\n linkName,\r\n closeDialogAfterPerformingOperation\r\n ) {\r\n if (closeDialogAfterPerformingOperation === void 0) {\r\n closeDialogAfterPerformingOperation = false;\r\n }\r\n\r\n _super.call(\r\n this,\r\n TextEditorInteractionType.InsertLinkToFile,\r\n closeDialogAfterPerformingOperation\r\n );\r\n this.linkUrl = linkUrl;\r\n this.linkName = linkName;\r\n }\r\n\r\n return TextEditorInsertLinkToFileMessage;\r\n})(TextEditorBaseInteractionMessage);\r\n\r\nCommonWindowMessages.TextEditorInsertLinkToFileMessage = TextEditorInsertLinkToFileMessage;\r\n/** Sent to text editor from inner frame to гpdate list of plugins with deleted or added list items **/\r\nconst TextEditorUpdateItslPluginListMessage = (function (_super) {\r\n __extends(TextEditorUpdateItslPluginListMessage, _super);\r\n\r\n function TextEditorUpdateItslPluginListMessage(pluginId) {\r\n _super.call(this, TextEditorInteractionType.UpdateItslPluginsList, true);\r\n this.pluginId = pluginId;\r\n }\r\n\r\n return TextEditorUpdateItslPluginListMessage;\r\n})(TextEditorBaseInteractionMessage);\r\n\r\nCommonWindowMessages.TextEditorUpdateItslPluginListMessage = TextEditorUpdateItslPluginListMessage;\r\n/** Send to ImageProperties dialog image settings **/\r\nconst TextEditorSendImageSettingsMessage = (function (_super) {\r\n __extends(TextEditorSendImageSettingsMessage, _super);\r\n\r\n function TextEditorSendImageSettingsMessage(extendedData) {\r\n _super.call(\r\n this,\r\n TextEditorInteractionType.SendImageSettingsToImagePropertiesDialog,\r\n extendedData\r\n );\r\n }\r\n\r\n return TextEditorSendImageSettingsMessage;\r\n})(TextEditorBaseInteractionWithDataMessage);\r\n\r\nCommonWindowMessages.TextEditorSendImageSettingsMessage = TextEditorSendImageSettingsMessage;\r\n/** Insert image to slideshow **/\r\nconst TextEditorInsertImageToSlideshow = (function (_super) {\r\n __extends(TextEditorInsertImageToSlideshow, _super);\r\n\r\n function TextEditorInsertImageToSlideshow(extendedData) {\r\n _super.call(this, TextEditorInteractionType.InsertImageToSlideshow, extendedData, true);\r\n }\r\n\r\n return TextEditorInsertImageToSlideshow;\r\n})(TextEditorBaseInteractionWithDataMessage);\r\n\r\nCommonWindowMessages.TextEditorInsertImageToSlideshow = TextEditorInsertImageToSlideshow;\r\n/** Inserts the HTML of hyperlink regarding selected text **/\r\nconst TextEditorInsertTextLink = (function (_super) {\r\n __extends(TextEditorInsertTextLink, _super);\r\n\r\n function TextEditorInsertTextLink(\r\n url,\r\n text,\r\n target,\r\n additionalAttributes,\r\n closeDialogAfterPerformingOperation\r\n ) {\r\n if (closeDialogAfterPerformingOperation === void 0) {\r\n closeDialogAfterPerformingOperation = false;\r\n }\r\n\r\n _super.call(\r\n this,\r\n TextEditorInteractionType.InsertTextLink,\r\n closeDialogAfterPerformingOperation\r\n );\r\n this.linkUrl = url;\r\n this.linkText = text;\r\n this.linkTarget = target;\r\n this.linkAdditionalAttributes = additionalAttributes;\r\n }\r\n\r\n return TextEditorInsertTextLink;\r\n})(TextEditorBaseInteractionMessage);\r\n\r\nCommonWindowMessages.TextEditorInsertTextLink = TextEditorInsertTextLink;\r\n/** Scales current dialog. **/\r\n// eslint-disable-next-line no-unused-vars\r\nconst TextEditorScaleDialog = (function (_super) {\r\n __extends(TextEditorScaleDialog, _super);\r\n\r\n function TextEditorScaleDialog() {\r\n _super.call(this, TextEditorInteractionType.ScaleDialog, true);\r\n }\r\n\r\n return TextEditorScaleDialog;\r\n})(TextEditorBaseInteractionMessage);\r\n\r\n/** Defines the list of possible text editor interactions via postMessage **/\r\n(function (TextEditorInteractionType) {\r\n /** Closes current dialog. **/\r\n TextEditorInteractionType[(TextEditorInteractionType[\"CloseDialog\"] = 0)] = \"CloseDialog\";\r\n /** Inserts given HTML string into editor **/\r\n TextEditorInteractionType[(TextEditorInteractionType[\"InsertHtml\"] = 1)] = \"InsertHtml\";\r\n /** Inserts the HTML of hyperlink to file **/\r\n TextEditorInteractionType[(TextEditorInteractionType[\"InsertLinkToFile\"] = 2)] =\r\n \"InsertLinkToFile\";\r\n /** Updates list of plugins with deleted or added list items**/\r\n TextEditorInteractionType[(TextEditorInteractionType[\"UpdateItslPluginsList\"] = 3)] =\r\n \"UpdateItslPluginsList\";\r\n /** Send image settings to opened image properties dialog **/\r\n TextEditorInteractionType[\r\n (TextEditorInteractionType[\"SendImageSettingsToImagePropertiesDialog\"] = 4)\r\n ] = \"SendImageSettingsToImagePropertiesDialog\";\r\n /** Insert image to slideshow **/\r\n TextEditorInteractionType[(TextEditorInteractionType[\"InsertImageToSlideshow\"] = 5)] =\r\n \"InsertImageToSlideshow\";\r\n /** Inserts the HTML of hyperlink regarding selected text **/\r\n TextEditorInteractionType[(TextEditorInteractionType[\"InsertTextLink\"] = 6)] = \"InsertTextLink\";\r\n /** Scales current dialog. **/\r\n TextEditorInteractionType[(TextEditorInteractionType[\"ScaleDialog\"] = 7)] = \"ScaleDialog\";\r\n})(\r\n CommonWindowMessages.TextEditorInteractionType ||\r\n (CommonWindowMessages.TextEditorInteractionType = {})\r\n);\r\n\r\nconst TextEditorInteractionType = CommonWindowMessages.TextEditorInteractionType;\r\n\r\nwindow.CommonWindowMessages = CommonWindowMessages;\r\n\r\nif (!String.prototype.setQueryStringParameter) {\r\n String.prototype.setQueryStringParameter = function (name, value) {\r\n const url = this;\r\n\r\n if (value) {\r\n if (url.indexOf(name + \"=\") > -1) {\r\n // Modify param value in the URL\r\n return url.replace(\r\n new RegExp(name + \"=[^&]*(&|$)\"),\r\n name + \"=\" + encodeURIComponent(value) + \"&\"\r\n );\r\n } else {\r\n // Insert the param into the URL\r\n return (\r\n url.slice(0, url.indexOf(\"?\") + 1) +\r\n name +\r\n \"=\" +\r\n encodeURIComponent(value) +\r\n \"&\" +\r\n url.slice(url.indexOf(\"?\") + 1)\r\n );\r\n }\r\n } else if (url.indexOf(name + \"=\") > -1) {\r\n // If there's param in the url, remove it\r\n return url.replace(new RegExp(name + \"=[^&]*(&|$)\"), \"\");\r\n }\r\n\r\n return url.toString();\r\n };\r\n}\r\n","/**\r\n * File: TextEditor.js\r\n *\r\n * A control that wraps CKEditor.\r\n *\r\n * This script creates some helper methods that can be added globally\r\n */\r\n\r\n/**\r\n * Sets up every text editor (common for all editors).\r\n */\r\n\r\n/* Copy-pasted from \\Itslearning\\UI\\Itslearning.Web.UI.Controls.Common\\javascript\\TextEditor.js */\r\n\r\n/*global CKEDITOR TextEditorManager CommonFunctions CommonWindowMessages CommonConstants editorInstance IsEditorEmpty*/\r\n\r\n/* eslint-disable */\r\n(function (window) {\r\n let startupFunctions = {},\r\n setupDone = false,\r\n style,\r\n manager = (window.TextEditorManager = {\r\n /**\r\n * JSON-serialized settings, which are common for all editor instances.\r\n */\r\n commonSettings: undefined,\r\n\r\n /**\r\n * Adds startup function, which will be called on CKEditor instanceReady event.\r\n */\r\n addStartupFunction: function (editorName, callbackFunction) {\r\n startupFunctions[editorName] = callbackFunction;\r\n },\r\n\r\n /**\r\n * Initial setup of all instances of Text Editor.\r\n */\r\n textEditorSetup: function () {\r\n if (setupDone) {\r\n return;\r\n }\r\n\r\n setupDone = true;\r\n\r\n if (!window.CKEDITOR) return;\r\n\r\n CKEDITOR.on(\"dialogDefinition\", function (e) {\r\n const definition = e.data.definition,\r\n loadFunction = definition.onLoad,\r\n showFunction = definition.onShow;\r\n\r\n definition.onLoad = function () {\r\n const instance = this;\r\n\r\n setupButton(instance, \"ok\", manager.commonSettings.cssClasses.ok);\r\n setupButton(instance, \"cancel\", manager.commonSettings.cssClasses.cancel);\r\n\r\n if (loadFunction) {\r\n return loadFunction.apply(instance, arguments);\r\n }\r\n };\r\n\r\n definition.onShow = function () {\r\n const instance = this;\r\n\r\n if (!(CKEDITOR.env.iOS && /OS 1[0-2]_/.test(navigator.userAgent))) {\r\n const dialogElement = instance.getElement();\r\n\r\n if (dialogElement && dialogElement.$) {\r\n const table = dialogElement.$.querySelector(\"table\");\r\n\r\n if (table) {\r\n table.scrollIntoView();\r\n }\r\n }\r\n }\r\n\r\n if (showFunction) {\r\n return showFunction.apply(instance, arguments);\r\n }\r\n };\r\n });\r\n\r\n CKEDITOR.on(\"instanceReady\", function (e) {\r\n const callbackFunction = startupFunctions[e.editor.name];\r\n\r\n if (callbackFunction) {\r\n callbackFunction();\r\n }\r\n\r\n e.editor.on(\"fileUploadRequest\", function (evt) {\r\n const xhr = evt.data.fileLoader.xhr;\r\n\r\n xhr.setRequestHeader(\r\n TextEditorManager.commonSettings.antiForgeryHeader.name,\r\n TextEditorManager.commonSettings.antiForgeryHeader.value\r\n );\r\n });\r\n });\r\n\r\n CommonFunctions.attachPostMessageEventListener(\r\n window,\r\n CommonWindowMessages.MessageNames.textEditorInteraction,\r\n function (data) {\r\n switch (data.interactionType) {\r\n case CommonWindowMessages.TextEditorInteractionType.CloseDialog:\r\n if (data.needExpandAndCollapseExtensionIframe) {\r\n collapseExtensionIframe();\r\n }\r\n\r\n window.CloseDialog();\r\n\r\n return;\r\n case CommonWindowMessages.TextEditorInteractionType.InsertHtml:\r\n window.InsertHtml(\r\n data.htmlContent,\r\n data.editorInstanceId,\r\n data.isEmbeddedImage\r\n );\r\n break;\r\n case CommonWindowMessages.TextEditorInteractionType.InsertLinkToFile:\r\n var attributes = {\r\n href: data.linkUrl,\r\n target: \"_blank\"\r\n };\r\n insertLink(\r\n CKEDITOR.dialog.getCurrent()._.editor,\r\n data.linkName,\r\n attributes\r\n );\r\n break;\r\n case CommonWindowMessages.TextEditorInteractionType\r\n .UpdateItslPluginsList:\r\n if (data.editorInstanceId && data.editorInstanceId != \"\") {\r\n window.editorInstance =\r\n CKEDITOR.instances[data.editorInstanceId];\r\n } else {\r\n window.editorInstance = CKEDITOR.dialog.getCurrent()._.editor;\r\n }\r\n\r\n if (editorInstance.plugins.itslpluginlist) {\r\n editorInstance.plugins.itslpluginlist.update(\r\n editorInstance,\r\n data.pluginId\r\n );\r\n }\r\n\r\n break;\r\n case CommonWindowMessages.TextEditorInteractionType\r\n .InsertImageToSlideshow:\r\n var editor = null;\r\n\r\n if (data.editorInstanceId && data.editorInstanceId.length > 0) {\r\n editor = CKEDITOR.instances[data.editorInstanceId];\r\n } else {\r\n editor = CKEDITOR.dialog.getCurrent()._.editor;\r\n }\r\n\r\n if (editor != null) {\r\n if (data.closeDialogAfterPerformingOperation) {\r\n window.CloseDialog();\r\n data.closeDialogAfterPerformingOperation = false;\r\n }\r\n\r\n CKEDITOR.dialog\r\n .getCurrent()\r\n .insertImageToSlideshow(data.extendedData);\r\n }\r\n\r\n break;\r\n case CommonWindowMessages.TextEditorInteractionType.InsertTextLink:\r\n var linkAttributes = {\r\n href: data.linkUrl,\r\n target: data.linkTarget,\r\n \"data-cke-saved-href\": \"\"\r\n };\r\n\r\n if (data.linkAdditionalAttributes) {\r\n Object.assign(linkAttributes, data.linkAdditionalAttributes);\r\n }\r\n\r\n insertLink(\r\n CKEDITOR.dialog.getCurrent()._.editor,\r\n data.linkText,\r\n linkAttributes\r\n );\r\n\r\n if (data.needExpandAndCollapseExtensionIframe) {\r\n collapseExtensionIframe();\r\n }\r\n\r\n break;\r\n case CommonWindowMessages.TextEditorInteractionType.ScaleDialog:\r\n if (data.needExpandAndCollapseExtensionIframe) {\r\n CommonFunctions.makePostMessageCallRecursivelyToTopmostFrame(\r\n window.parent,\r\n new CommonWindowMessages.GenericMessage(\r\n CommonWindowMessages.MessageNames.expandExtensionIframe\r\n )\r\n );\r\n }\r\n\r\n var viewSize = CKEDITOR.document.getWindow().getViewPaneSize();\r\n var dialog = CKEDITOR.dialog.getCurrent();\r\n var dialogSize = dialog.getSize();\r\n\r\n var parentWidth = viewSize.width;\r\n var parentHeight = viewSize.height;\r\n var newDialogWidth = dialogSize.width;\r\n var newDialogHeight = dialogSize.height;\r\n\r\n if (dialogSize.width > parentWidth) {\r\n const contentWidth = dialog._.contentSize.width;\r\n const contentOffsetWidth = dialogSize.width - contentWidth;\r\n\r\n newDialogWidth = parentWidth - contentOffsetWidth;\r\n dialog.parts.contents.setStyle(\r\n \"width\",\r\n CKEDITOR.tools.cssLength(newDialogWidth)\r\n );\r\n dialog.parts.contents.getFirst().setStyle(\"width\", \"100%\");\r\n TextEditorManager.getIframeFromDialog(dialog)\r\n .contents()\r\n .find(\"section.main\")\r\n .width(CKEDITOR.tools.cssLength(newDialogWidth));\r\n }\r\n\r\n if (dialogSize.height > parentHeight) {\r\n const contentHeight = dialog._.contentSize.height;\r\n\r\n const contentOffsetHeight = dialogSize.height - contentHeight;\r\n\r\n newDialogHeight = parentHeight - contentOffsetHeight;\r\n }\r\n\r\n if (\r\n newDialogWidth != dialogSize.width ||\r\n newDialogHeight != dialogSize.height\r\n ) {\r\n dialog.resize(newDialogWidth, newDialogHeight);\r\n }\r\n\r\n var dialogPosition = dialog.getPosition();\r\n\r\n if (dialogSize.height > parentHeight || dialogPosition.y < 0) {\r\n dialog.move(dialogPosition.x, 0);\r\n }\r\n\r\n break;\r\n }\r\n\r\n if (data.closeDialogAfterPerformingOperation) {\r\n window.CloseDialog();\r\n }\r\n }\r\n );\r\n\r\n CommonFunctions.attachPostMessageEventListener(\r\n window,\r\n CommonWindowMessages.MessageNames.expandExtensionIframeDone,\r\n function () {\r\n setTimeout(function () {\r\n const viewSize = CKEDITOR.document.getWindow().getViewPaneSize();\r\n const dialog = CKEDITOR.dialog.getCurrent();\r\n const dialogSize = dialog.getSize();\r\n\r\n const dialogOffsetLeft = (viewSize.width - dialogSize.width) / 2;\r\n\r\n dialog.move(dialogOffsetLeft, 0, true);\r\n }, 100);\r\n }\r\n );\r\n\r\n function setupButton(instance, name, cssClasses) {\r\n const buttonDefinition = instance.getButton(name);\r\n\r\n if (buttonDefinition) {\r\n const button = document.getElementById(buttonDefinition.domId);\r\n\r\n button.className = cssClasses;\r\n button.removeAttribute(\"title\");\r\n const span = button.getElementsByTagName(\"span\")[0];\r\n\r\n span.className = \"\";\r\n button.append(document.createTextNode(span.innerHTML));\r\n span.innerHTML = \"\";\r\n }\r\n }\r\n\r\n function collapseExtensionIframe() {\r\n CommonFunctions.makePostMessageCallRecursivelyToTopmostFrame(\r\n window.parent,\r\n new CommonWindowMessages.GenericMessage(\r\n CommonWindowMessages.MessageNames.collapseExtensionIframe\r\n )\r\n );\r\n }\r\n\r\n function insertLink(editor, linkText, attributes) {\r\n const selection = editor.getSelection(),\r\n ranges = selection.getRanges(),\r\n link = CKEDITOR.plugins.link.getSelectedLink(editor);\r\n\r\n if (link) {\r\n ranges[0].selectNodeContents(link);\r\n }\r\n\r\n if (ranges.length === 1) {\r\n const range = ranges[0],\r\n text = new CKEDITOR.dom.text(linkText, editor.document);\r\n\r\n if (range.collapsed) {\r\n range.insertNode(text);\r\n range.selectNodeContents(text);\r\n } else {\r\n // Fix for image2 plugin (ITS-74173)\r\n const widget = editor.widgets.focused;\r\n\r\n if (widget && widget.name === \"image\") {\r\n if (widget.parts.link) {\r\n widget.setData(\"link\", null);\r\n }\r\n\r\n // Fix for ITS-74173\r\n if (widget.data.align === \"center\") {\r\n widget.data.link = {\r\n linkText: linkText,\r\n type: \"itslearningTreeLink\"\r\n };\r\n Object.assign(widget.data.link, attributes);\r\n\r\n widget.shiftState({\r\n widget: widget,\r\n element: widget.element,\r\n oldData: widget.oldData,\r\n newData: widget.data\r\n });\r\n }\r\n }\r\n }\r\n\r\n // Apply style\r\n style = new CKEDITOR.style({\r\n element: \"a\",\r\n type: CKEDITOR.STYLE_INLINE,\r\n attributes: attributes\r\n });\r\n style.applyToRange(range);\r\n\r\n selection.selectRanges(ranges);\r\n editor.fire(\"saveSnapshot\");\r\n }\r\n }\r\n },\r\n\r\n getIframeFromDialog: function (dialog) {\r\n return document.getElementById(dialog._.contents.iframe.undefined.domId);\r\n }\r\n });\r\n\r\n manager.getOnContentLoadFunctionForIframeDialog = function (setupIframeCallback) {\r\n return function () {\r\n // Function to be run when the iframe has finished loading ( unfortunelty in case of picture plugin it takes some seconds )\r\n const dialog = CKEDITOR.dialog.getCurrent();\r\n\r\n // This check is for image dialog, if you open the plugin, and then choose upload and insert\r\n // When you upload a pic and press insert you would get a js error that null is not an object\r\n // Seems like the upload window open the plugin dialog again and use the insertimage and close the dialog before the content is fully loaded\r\n if (dialog) {\r\n const iframe = manager.getIframeFromDialog(dialog);\r\n const attrs = {\r\n webkitallowfullscreen: \"true\",\r\n mozallowfullscreen: \"true\",\r\n allowfullscreen: \"true\",\r\n allow: \"microphone *; camera *\"\r\n };\r\n\r\n for (const key in attrs) {\r\n iframe.setAttribute(key, attrs[key]);\r\n }\r\n\r\n if (setupIframeCallback) {\r\n setupIframeCallback(iframe);\r\n }\r\n\r\n try {\r\n iframe.contentDocument.addEventListener(\"keydown\", e => {\r\n if (e.which === CommonConstants.keyCodes.escape) {\r\n window.CloseDialog();\r\n }\r\n });\r\n\r\n // Sets focus to iframe so user can close it with esc without clicking in\r\n iframe[0].contentWindow.focus();\r\n } catch (ex) {\r\n // do nothing\r\n } // Iframe belongs to another domain\r\n }\r\n };\r\n };\r\n\r\n manager.setupIframePlugin = function (configSectionName, externalOptions) {\r\n const extend = (a, b) => {\r\n \r\n for (const key in b) if (b.hasOwnProperty(key)) a[key] = b[key];\r\n\r\n return a;\r\n };\r\n\r\n const options = extend(\r\n {\r\n addToolBarButton: true,\r\n dialogName: undefined,\r\n dialogSrcReplacementFunction: undefined,\r\n beforeInitComplete: undefined,\r\n dialogContentLoad: undefined,\r\n emptyIframeOnClose: false,\r\n useBuiltInCloseButton: false\r\n },\r\n externalOptions\r\n );\r\n\r\n return {\r\n requires: [\"iframedialog\"],\r\n init: function (editor) {\r\n let pluginConfig = editor.config[configSectionName],\r\n dialogDefinition = {\r\n width: pluginConfig.DialogWidth,\r\n height: pluginConfig.DialogHeight,\r\n name: options.dialogName\r\n },\r\n counter = 0,\r\n onContentLoad = manager.getOnContentLoadFunctionForIframeDialog(\r\n function (iframe) {\r\n // This is a cssClass for plugins in dashboard or page\r\n if (\r\n pluginConfig.IsEditorDialogTransparent &&\r\n pluginConfig.IframeCssClass\r\n ) {\r\n iframe.classList.add(pluginConfig.IframeCssClass);\r\n }\r\n\r\n if (options.dialogContentLoad) {\r\n options.dialogContentLoad(editor, pluginConfig, iframe);\r\n }\r\n }\r\n );\r\n\r\n editor.addCommand(pluginConfig.Id, {\r\n startDisabled: pluginConfig.Disabled,\r\n exec: function (e) {\r\n const customDialogDefinition = {\r\n onShow: function () {\r\n const dialog = CKEDITOR.dialog.getCurrent(),\r\n parts = dialog.parts;\r\n\r\n if (options.useBuiltInCloseButton === false) {\r\n parts.close.hide(); // hide iframe x-button (close)\r\n }\r\n\r\n parts.footer.hide(); // hide iframe submit and cancel buttons\r\n parts.title.hide(); // hide iframe title\r\n\r\n if (pluginConfig.IsEditorDialogTransparent) {\r\n dialog._.element.addClass(\"hiddenDialog\");\r\n }\r\n\r\n // ITS-31370: Set exact width because width=100% doesn't work properly in maximized mode\r\n const iframe = TextEditorManager.getIframeFromDialog(dialog);\r\n const parentDocument =\r\n (iframe.contentWindow &&\r\n iframe.contentWindow.parent.document) ||\r\n iframe.ownerDocument;\r\n const ckeDialogPageContents = parentDocument.querySelectorAll(\r\n \"div.cke_dialog_page_contents\"\r\n );\r\n\r\n ckeDialogPageContents.forEach(p => {\r\n p.style.width = pluginConfig.DialogWidth + \"px\";\r\n });\r\n\r\n if (pluginConfig.DialogClass) {\r\n parentDocument\r\n .querySelectorAll(\"table.cke_dialog_contents\")\r\n .forEach(p => {\r\n p.classList.add(pluginConfig.DialogClass);\r\n });\r\n }\r\n },\r\n onHide: function () {\r\n if (options.emptyIframeOnClose) {\r\n const iframe = TextEditorManager.getIframeFromDialog(\r\n CKEDITOR.dialog.getCurrent()\r\n );\r\n\r\n iframe.setAttribute(\"src\", \"\");\r\n }\r\n }\r\n };\r\n\r\n // Add iframe each time (will overwrite) since src may change depending on whether it's contextmenu or just the button click\r\n\r\n // Note: small hack - we create a new iframe each time to change the source of the iframe.\r\n // We were able to change it, but it uses the one registered the first time on addIframe method call.\r\n // To circumvent, we create a new one each time.\r\n const iframeId = dialogDefinition.name + counter++;\r\n const dialogSrc = !options.dialogSrcReplacementFunction\r\n ? pluginConfig.DialogSrc\r\n : options.dialogSrcReplacementFunction(editor, pluginConfig, e);\r\n\r\n if (!dialogSrc) {\r\n return;\r\n }\r\n\r\n // Add new iframe to ckeditor, and open it\r\n CKEDITOR.dialog.addIframe(\r\n iframeId,\r\n \"\",\r\n dialogSrc,\r\n dialogDefinition.width,\r\n dialogDefinition.height,\r\n onContentLoad,\r\n customDialogDefinition\r\n );\r\n e.openDialog(iframeId);\r\n }\r\n });\r\n\r\n if (options.addToolBarButton) {\r\n // Add button to toolbar - icon from css search for .cke_button_<pluginConfig.Id>\r\n // or pass parameter \"icon\"\r\n const buttonConfig = {\r\n label: pluginConfig.Text,\r\n command: pluginConfig.Id\r\n };\r\n\r\n if (typeof options.icon === \"string\") {\r\n buttonConfig.icon = options.icon;\r\n }\r\n\r\n editor.ui.addButton(pluginConfig.Id, buttonConfig);\r\n }\r\n\r\n if (options.beforeInitComplete) {\r\n options.beforeInitComplete(editor, pluginConfig);\r\n }\r\n }\r\n };\r\n };\r\n\r\n manager.setupContentForIframe = function () {\r\n window.document.addEventListener(\"keydown\", function (e) {\r\n if (e.which === CommonConstants.keyCodes.escape) {\r\n CommonFunctions.makePostMessageCall(\r\n window.parent,\r\n new CommonWindowMessages.TextEditorCloseDialogMessage()\r\n );\r\n }\r\n });\r\n\r\n // Sets focus to iframe so user can close it with esc without clicking in\r\n window.focus();\r\n };\r\n\r\n /**\r\n * Extracts extension id from idStr (ex 'extension:1234'). Used by editextension and oembed plugins.\r\n */\r\n manager.getExtensionIdFromIdString = function (idStr) {\r\n const firstColon = idStr.indexOf(\":\", 0);\r\n\r\n if (firstColon < 0) {\r\n return null;\r\n }\r\n\r\n const secondColon = idStr.indexOf(\":\", firstColon + 1);\r\n\r\n if (secondColon < 0) {\r\n return null;\r\n }\r\n\r\n return idStr.substring(firstColon + 1, secondColon);\r\n };\r\n})(window);\r\n\r\n/**\r\n * Inserts html into a ckeditor instance\r\n */\r\nwindow.InsertHtml = function InsertHtml(html, id, isEmbeddedImage) {\r\n let editor = null;\r\n\r\n if (id && id.length > 0) {\r\n editor = CKEDITOR.instances[id];\r\n } else {\r\n editor = CKEDITOR.dialog.getCurrent()._.editor;\r\n }\r\n\r\n if (editor != null) {\r\n // For embedded images we cannot send the url to the properties iframe (too long), so we only\r\n // send 'data:', and replace it now with the original url from the CKEditor selection\r\n if (isEmbeddedImage) {\r\n let oldImage = editor.getSelection().getSelectedElement();\r\n\r\n if (oldImage) {\r\n oldImage = oldImage.getAscendant(\"img\", true);\r\n\r\n const oldUrl = oldImage.getAttribute(\"src\");\r\n\r\n html = html.replace(\"src='data:'\", \"src='\" + oldUrl + \"'\");\r\n }\r\n }\r\n\r\n // This is a hack for webkit\r\n // In Chrome and Safari the plugin content couldn't be inserted in empty editor\r\n // That is why we need to use SetHtml on empty editor or else the plugin would not be added.\r\n if (\"WebkitAppearance\" in document.documentElement.style) {\r\n if (editor.config.mask && IsEditorEmpty(editor.name, editor.config.mask)) {\r\n window.SetHtml(html, id);\r\n window.checkForMaskAndDelete(editor.name);\r\n } else {\r\n editor.insertHtml(html);\r\n }\r\n } else {\r\n if (CKEDITOR.env.gecko && editor.config.mask) {\r\n window.checkForMaskAndDelete(editor.name);\r\n }\r\n\r\n editor.insertHtml(html);\r\n }\r\n }\r\n};\r\n\r\n/**\r\n * Closes the current dialog\r\n */\r\nwindow.CloseDialog = function CloseDialog() {\r\n if (window.CKEDITOR.env.webkit) {\r\n window.closeRecorderIfExists();\r\n }\r\n\r\n CKEDITOR.dialog.getCurrent().hide();\r\n};\r\n\r\n/**\r\n * Deletes current content of editor and inserts html instead\r\n */\r\nwindow.SetHtml = function SetHtml(html, id, doNotSetFocus) {\r\n if (id && id.length > 0) {\r\n CKEDITOR.instances[id].setData(html, function () {\r\n if (!doNotSetFocus) {\r\n window.SetTextEditorFocus(id);\r\n }\r\n });\r\n } else {\r\n CKEDITOR.dialog.getCurrent()._.editor.setData(html, function () {\r\n if (!doNotSetFocus) {\r\n this.focus();\r\n }\r\n });\r\n }\r\n};\r\n\r\n/**\r\n * Get the content in the text editor\r\n */\r\nwindow.GetTextEditorContent = function GetTextEditorContent(id) {\r\n if (!window.CKEDITOR) {\r\n const hidden = document.querySelector(`div[data-ck-id=${id}] > input[type=hidden]`);\r\n\r\n if (hidden.length === 1) {\r\n return hidden.value;\r\n }\r\n\r\n return null;\r\n }\r\n\r\n if (id && id.length > 0) {\r\n return CKEDITOR.instances[id].getData();\r\n }\r\n\r\n if (CKEDITOR.dialog.getCurrent()) {\r\n return CKEDITOR.dialog.getCurrent()._.editor.getData();\r\n }\r\n\r\n return null;\r\n};\r\n\r\n/**\r\n * Set focus to a text editor\r\n */\r\nwindow.SetTextEditorFocus = function SetTextEditorFocus(id) {\r\n CKEDITOR.instances[id].focus();\r\n};\r\n\r\n/**\r\n * Destroys CKeditor in a correct manner\r\n */\r\nwindow.RemoveEditorInstance = function RemoveEditorInstance(id) {\r\n if (CKEDITOR.instances[id]) {\r\n // This is a hack, without setting hasFocus to be false this would not work properly\r\n // We would get a java script fail on CKEDITOR tries to set blur it self from destroy function.\r\n const editable = CKEDITOR.instances[id].editable();\r\n\r\n if (editable.hasFocus) {\r\n editable.blur();\r\n editable.hasFocus = false;\r\n }\r\n\r\n CKEDITOR.instances[id].destroy();\r\n }\r\n};\r\n\r\n/**\r\n * Checks if editor is empty. If supplying a mask argument, the editor is also empty if the text in the editor is the same as the mask\r\n */\r\nwindow.IsEditorEmpty = function IsEditorEmpty(id, mask) {\r\n const editor = CKEDITOR.instances[id];\r\n\r\n if (!editor) return;\r\n const txt = editor.getData().replace(\"\\n\", \"\");\r\n\r\n const encodedText = CommonFunctions.htmlEncode(txt);\r\n const encodedMask = CommonFunctions.htmlEncode(mask);\r\n\r\n return (\r\n \"\" == txt ||\r\n (mask && encodedText === encodedMask) ||\r\n \"<p> </p>\" === txt ||\r\n \"<div> </div>\" === txt ||\r\n \"<p> </p>\" === txt ||\r\n \"<p></p>\" === txt ||\r\n `<p>${encodedMask}</p>` === txt\r\n );\r\n};\r\n\r\n/**\r\n * Checks if editor contains mask\r\n */\r\nwindow.IsEditorContainsMask = function IsEditorContainsMask(id, mask) {\r\n const editor = CKEDITOR.instances[id];\r\n\r\n if (!editor) return;\r\n const txt = editor.getData();\r\n\r\n return txt.indexOf(mask) > -1;\r\n};\r\n\r\n/**\r\n * Check if user has changed content in the editor\r\n */\r\nwindow.isTextEditorDirty = function isTextEditorDirty(id) {\r\n let editor;\r\n\r\n if (id && id.length > 0 && (editor = CKEDITOR.instances[id])) {\r\n return editor.checkDirty();\r\n }\r\n\r\n if (CKEDITOR.dialog.getCurrent()) {\r\n return CKEDITOR.dialog.getCurrent()._.editor.checkDirty();\r\n }\r\n};\r\n\r\n/**\r\n * Check if user has changed content in any the editor\r\n */\r\nwindow.isAnyTextEditorDirty = function isAnyTextEditorDirty() {\r\n if (window.CKEDITOR) {\r\n for (const i in CKEDITOR.instances) {\r\n if (CKEDITOR.instances[i].checkDirty() === true) {\r\n return true;\r\n }\r\n }\r\n }\r\n\r\n return false;\r\n};\r\n\r\n/**\r\n * reset the flag if editor is dirty (sets it to false)\r\n */\r\nwindow.resetEditorIsDirty = function resetEditorIsDirty(id) {\r\n if (id && id.length > 0) {\r\n return CKEDITOR.instances[id].resetDirty();\r\n }\r\n\r\n if (CKEDITOR.dialog.getCurrent()) {\r\n return CKEDITOR.dialog.getCurrent()._.editor.resetDirty();\r\n }\r\n};\r\n\r\n/**\r\n * Resets dirty status for all editors\r\n */\r\nwindow.resetAllTextEditorsIsDirty = function resetAllTextEditorsIsDirty() {\r\n if (window.CKEDITOR) {\r\n for (const i in CKEDITOR.instances) {\r\n CKEDITOR.instances[i].resetDirty();\r\n }\r\n }\r\n\r\n return false;\r\n};\r\n\r\n/**\r\n * set the text color (fore color) in the text editor\r\n */\r\nwindow.setTextEditorTextColor = function setTextEditorTextColor(id, color) {\r\n const editor = CKEDITOR.instances[id],\r\n style = new CKEDITOR.style(CKEDITOR.config[\"colorButton_foreStyle\"], { color: color });\r\n\r\n editor.applyStyle(style);\r\n};\r\n\r\n/**\r\n * set the text size in the text editor\r\n */\r\nwindow.setTextEditorTextSize = function setTextEditorTextSize(id, size) {\r\n const editor = CKEDITOR.instances[id],\r\n style = new CKEDITOR.style(CKEDITOR.config[\"fontSize_style\"], { size: size });\r\n\r\n editor.applyStyle(style);\r\n};\r\n\r\n/**\r\n * cleanOnFocusEvent attaches a listener for watermarking with the mask text\r\n */\r\nconst focusListener = function (event) {\r\n const mask = event.editor.config.mask;\r\n\r\n let contentChanged = false;\r\n\r\n if (IsEditorEmpty(event.editor.name, mask)) {\r\n window.toggleWatermark(false, event.editor);\r\n contentChanged = true;\r\n } else if (window.IsEditorContainsMask(event.editor.name, mask)) {\r\n const body = event.editor.getData().replace(mask, \"\");\r\n\r\n event.editor.document.getBody().setHtml(body);\r\n contentChanged = true;\r\n }\r\n\r\n if (contentChanged) {\r\n // When the user actually clicks in the editor then the mayBeDirty must be set to true for the onBeforeUnload\r\n event.editor.mayBeDirty = true;\r\n // Also, we resetDirty here so that if someone focus the editor and then clicked cancel/another link\r\n // it wouldn't give goAwayWarning on an empty editor\r\n window.resetEditorIsDirty(event.editor.name);\r\n }\r\n};\r\n\r\nconst blurListener = function (event) {\r\n if (IsEditorEmpty(event.editor.name)) {\r\n if (event.editor.config.mask && event.editor.config.mask.length > 0) {\r\n window.toggleWatermark(true, event.editor);\r\n window.resetEditorIsDirty(event.editor.name);\r\n }\r\n }\r\n};\r\n\r\nconst modeListener = function (event) {\r\n if (IsEditorEmpty(event.editor.name, event.editor.config.mask)) {\r\n window.toggleWatermark(event.editor.mode != \"source\", event.editor);\r\n }\r\n};\r\n\r\nwindow.toggleWatermark = function toggleWatermark(showWatermark, editor) {\r\n if (editor.mode === \"wysiwyg\") {\r\n const watermarkedClass = \"watermarked\";\r\n const editorBody = editor.document.getBody();\r\n\r\n if (showWatermark) {\r\n editorBody.setHtml(editor.config.mask);\r\n editorBody.addClass(watermarkedClass);\r\n } else {\r\n editorBody.setHtml(\"\");\r\n editorBody.removeClass(watermarkedClass);\r\n }\r\n } else {\r\n if (!showWatermark) {\r\n editor.setData(\"\");\r\n }\r\n }\r\n};\r\n\r\nwindow.cleanOnFocusEvent = function cleanOnFocusEvent(customMask, id, forceSetHtml) {\r\n const editor = CKEDITOR.instances[id];\r\n\r\n if (!editor) {\r\n return;\r\n }\r\n\r\n editor.config.mask = customMask;\r\n\r\n if (forceSetHtml || IsEditorEmpty(editor.name, editor.config.mask)) {\r\n if (!editor.focusManager.hasFocus) {\r\n setTimeout(function () {\r\n window.toggleWatermark(true, editor);\r\n // This mayBeDirty needs to be set to false here, because the resetDirty doesn't work correctly the first time\r\n // for editor with mask, the value whould be \"\" instead the mask it can be set too true after first focus event\r\n // No need to set it to false after blur again as the resetDirty there will work properly\r\n editor.mayBeDirty = false;\r\n window.resetEditorIsDirty(editor.name);\r\n }, 50);\r\n }\r\n }\r\n\r\n editor.on(\"focus\", focusListener);\r\n editor.on(\"blur\", blurListener);\r\n editor.on(\"mode\", modeListener);\r\n};\r\n\r\n/**\r\n * For Safari the audio recorder needs to be closed separately, otherwise it would hang on the page\r\n */\r\nwindow.closeRecorderIfExists = function closeRecorderIfExists() {\r\n const iframe = TextEditorManager.getIframeFromDialog(CKEDITOR.dialog.getCurrent());\r\n\r\n try {\r\n let recorder;\r\n\r\n const parentDocument = iframe.contentWindow.parent.document;\r\n\r\n \r\n if ((recorder = parentDocument.querySelector(\"object\"))) {\r\n // id is always recorder for both audio and video\r\n recorder.style.display = \"none\";\r\n }\r\n } catch (e) {\r\n // do nothing\r\n } // Cross-domain issue - can't get iframe.contents() if iframe content is in another domain\r\n};\r\n\r\n/**\r\n * This is a cleanup function, if something where about to be inserted in the editor,\r\n * but the mask was not deleted the function will delete the mask\r\n */\r\nwindow.checkForMaskAndDelete = function checkForMaskAndDelete(id) {\r\n let editor = null;\r\n\r\n if (id && id.length > 0) {\r\n editor = CKEDITOR.instances[id];\r\n } else if (CKEDITOR.dialog.getCurrent()) {\r\n editor = CKEDITOR.dialog.getCurrent()._.editor;\r\n }\r\n\r\n if (editor != null && editor.config.mask) {\r\n if (IsEditorEmpty(editor.name, editor.config.mask)) {\r\n editor.document.getBody().setHtml(\"\");\r\n }\r\n }\r\n};\r\n","import 'prometheus.aaa.scss';\r\nimport 'prometheus.modern.scss';\r\n\r\nimport './theme.aaa.scss';\r\nimport './theme.modern.scss';\r\n\r\nimport { registerDocumentClickBubblingOnTop } from \"@itslearning/atlas/frames/IframeClickEventHelper\";\r\nimport App from \"./lib/App/App.svelte\";\r\nimport { plansData, topicData } from \"@its-ui/planner-common/logic/topicPage/stores\";\r\nimport { loadPlansForTopic } from \"@its-ui/planner-common/helpers/loadPlansHelper\";\r\nimport { loadTopic } from \"@its-ui/planner-common/helpers/loadTopicsHelper\";\r\nimport i18n from \"@its-ui/planner-common/i18n\";\r\nimport config from \"@its-ui/planner-common/config\";\r\nimport \"@its-ui/planner-common/helpers/CommonFunctions.js\";\r\nimport \"@its-ui/planner-common/helpers/TextEditor.js\";\r\n\r\nregisterDocumentClickBubblingOnTop();\r\n\r\n// @ts-ignore\r\nconst topPage = window.itslTop || window.top;\r\n\r\n// If plans is opened in an itslearning iFrame set the selected menu item and collapse the tree menu\r\nif (topPage) {\r\n if (typeof topPage.hideContentAreaTreeMenu === \"function\") {\r\n topPage.hideContentAreaTreeMenu();\r\n }\r\n\r\n if (typeof topPage.SelectCurrentNavigationItem === \"function\") {\r\n topPage.SelectCurrentNavigationItem(\"planner\");\r\n }\r\n}\r\n\r\nparentPostMessage(\"askIfCustomTreeLinkNavigationRequired\");\r\n\r\nparentPostMessage(\"setIFrameTitleMessage\", { iFrameTitle: i18n.title });\r\n\r\n// Get the mount point for the App\r\nconst target = document.getElementById(\"plans\");\r\n\r\n \r\nconst app = new App({ target });\r\n\r\nif (config.topicId) {\r\n loadTopic(topicData, config.publicAccessKey, config.topicId);\r\n}\r\n\r\nloadPlansForTopic(plansData, config.publicAccessKey, config.topicId, false);\r\n\r\nfunction parentPostMessage(name, data = {}) {\r\n window.parent.postMessage(JSON.stringify({ messageName: name, ...data }), \"*\");\r\n}\r\n\r\nexport default app;\r\n"],"names":["postMessage","message","parentFrame","postMessageToTopmostFrame","registerDocumentClickBubblingOnTop","agentId","iframeClickBubbleMessage","iframeTouchstartBubbleMessage","noop","identity","x","assign","tar","src","k","run","fn","blank_object","run_all","fns","is_function","thing","safe_not_equal","a","b","src_url_equal_anchor","src_url_equal","element_src","url","is_empty","obj","subscribe","store","callbacks","callback","unsub","get_store_value","value","_","component_subscribe","component","create_slot","definition","ctx","$$scope","slot_ctx","get_slot_context","get_slot_changes","dirty","lets","merged","len","i","update_slot_base","slot","slot_definition","slot_changes","get_slot_context_fn","slot_context","get_all_dirty_from_scope","length","exclude_internal_props","props","result","compute_rest_props","keys","rest","compute_slots","slots","key","set_store_value","ret","is_client","now","raf","cb","tasks","run_tasks","task","loop","fulfill","globals","append","target","node","get_root_for_style","root","append_empty_stylesheet","style_element","element","append_stylesheet","style","insert","anchor","detach","destroy_each","iterations","detaching","name","svg_element","text","data","space","empty","listen","event","handler","options","stop_propagation","attr","attribute","always_set_through_set_attribute","set_attributes","attributes","descriptors","set_custom_element_data_map","data_map","set_custom_element_data","prop","lower","set_dynamic_element_data","tag","to_number","children","set_data","set_input_value","input","select_option","select","mounting","option","select_value","selected_option","toggle_class","toggle","custom_event","type","detail","bubbles","cancelable","HtmlTag","is_svg","__publicField","html","managed_styles","active","hash","str","create_style_information","doc","info","create_rule","duration","delay","ease","uid","step","keyframes","p","t","rule","stylesheet","rules","animation","delete_rule","previous","next","anim","deleted","clear_rules","ownerNode","current_component","set_current_component","get_current_component","onMount","afterUpdate","onDestroy","createEventDispatcher","bubble","dirty_components","binding_callbacks","render_callbacks","flush_callbacks","resolved_promise","update_scheduled","schedule_update","flush","tick","add_render_callback","add_flush_callback","seen_callbacks","flushidx","saved_component","update","$$","flush_render_callbacks","filtered","targets","c","promise","wait","dispatch","direction","kind","outroing","outros","group_outros","check_outros","transition_in","block","local","transition_out","null_transition","create_in_transition","params","config","running","animation_name","cleanup","go","easing","linear","css","start_time","end_time","started","ensure_array_like","array_like_or_iterator","destroy_block","lookup","outro_and_destroy_block","update_keyed_each","old_blocks","get_key","dynamic","list","destroy","create_each_block","get_context","o","n","old_indexes","new_blocks","new_lookup","deltas","updates","child_ctx","will_move","did_move","new_block","old_block","new_key","old_key","get_spread_update","levels","to_null_out","accounted_for","get_spread_object","spread_props","bind","index","create_component","mount_component","fragment","after_update","new_on_destroy","destroy_component","make_dirty","init","instance","create_fragment","not_equal","append_styles","parent_component","ready","nodes","SvelteComponent","PUBLIC_VERSION","formatString","template","regex","values","match","number","formatLanguageString","nonTabbables","selector","tabbables","TabTrapper","elements","visibleTabbables","removeInvisibles","selectedElement","isInSameRadioGroup","innerDocBody","element1","element2","Keys","normalizeKey","button","button_class_value","span1","span0","$$props","iconOnly","id","cssClass","large","disabled","loading","htmlType","haspopup","expanded","ariaLabel","describedby","labelledby","visuallyHidden","isLarge","isLoading","$$invalidate","isActive","ariaLabelText","create_if_block_6","if_block1","create_if_block_5","create_if_block_2","div6","div0","section","h1","div5","div1","div3","div2","div4","div","create_if_block_4","create_if_block_3","create_if_block_1","create_if_block","enabled","wide","titleOnly","confirmText","cancelText","titleText","bodyText","bodyHtml","showCancel","scrollBody","describedBy","confirmButtonType","cancelButtonType","clickOutsideCloses","hasScroll","contentScrollRemaining","scrollContainer","promptResolve","modalStyle","focusedBeforeModal","tabTrapper","dialogElement","contentElement","gradientStyle","previouslyEnabled","onOpen","windowResize","buttons","TabTrapHelper","reinitTabTrapper","onClose","keyUpHandler","cancel","verticalGap","maxHeight","confirm","prompt","properties","resolve","contentScroll","scrollHeight","clientHeight","scrollTop","click_handler","$$value","height","describedById","a_class_value","current","href","rel","iconClass","iconPlacement","label","ping","standalone","downloadable","fileName","download","iconPlacementClass","icon","span","svelte_element","create_dynamic_element","description","title","headingLevel","iconName","orientation","alignment","showButton","buttonText","buttonHtmlType","showLink","linkType","linkText","showLoadingIndicator","iconCssClass","l","button_changes","textOnly","iconOnlyClass","textOnlyClass","focusFirstItemIn","dropdown","focusLastItemIn","returnFocusToParentDropdown","removeFocusFromParentDropdown","hide","submenu","hidden","hideOpenSubmenus","submenus","menuButtons","show","openerRect","dropdownBody","getClosestParentByClass","matchClass","openSubmenus","open","isMenuItem","span_class_value","img","img_src_value","img_height_value","img_width_value","t1_value","a_href_value","a_ping_value","a_id_value","a_target_value","t1","onClick","button_id_value","hasPopup","ua","isIpad","isMobile","getLists","currentItem","lists","child","goToNextList","nextSibling","goToPreviousList","previousSibling","focusPreviousListItem","previousItem","focusNextListItem","nextItem","each_value","section1","section0","each_blocks","li","isSubmenu","clickHandler","toggleMenu","mouseenterHandler","item","openMenu","mouseleaveHandler","closeMenu","moveToNextItem","moveToPreviousItem","keyHandlerDown","keyHandlerUp","isHover","guidV4","bytes","t_value","h2","if_block","ul","ul_aria_labelledby_value","keyup_handler","section3","header","section2","footer","arrow","arrowPosition","items","responsive","globalKeyHandler","keyHandler","selectOption","arrowClass","notResponsiveClass","position","closeHandler","buttonElement","returnFocus","submenuHandler","keyDownHandler","setFocus","overlayClass","buttondropdown_changes","if_block2","if_block3","if_block5","backLinkText","backLinkUrl","backLinkTarget","backButtonText","menuItems","responsiveDropdown","i18n","fixedHeaderSize","buttonDropdownId","iconSrc","textBoldCss","contentAreaLayout","textarea","classText","placeholder","required","hasError","autocomplete","min","max","minlength","maxlength","spellcheck","cols","rows","conditionalAttributes","label_1","hint","errorMessage","labelHidden","labelPosition","ariaLiveUpdateType","areaSizeClass","hasErrorClass","labelText","errorMessageId","labelHiddenClass","t3_value","input_value_value","span0_class_value","t3","fieldset","legend","colours","selected","backLinkDestinations","plannerViews","endpoints","planId","courseId","planIds","selectedView","topicIds","topicId","paging","templateCourseId","getCoursesForCopyPageSize","defaultPageSize","columnTypes","columnVisibility","learningObjectiveType","plannerFieldType","resourceTypeToShow","reverseObject","newObj","defaultFromHour","defaultToHour","minTitleLength","maxTitleLength","plansActionType","plansCopyActionModal","weekDays","planSorting","plansOrder","dateTimePickerModalFromSection","dateTimePickerModalToSection","datePickerButton","fromDatePickerInputField","toDatePickerInputField","noTopicTopicId","BACK_DESTINATION_QUERY_STRING_PARAMETER","planType","onePlanAtATimePlanStatus","button0_changes","topic","colorClass","setInitialValues","matchingColor","save","color","modalTitle","subscriber_queue","writable","start","stop","subscribers","set","new_value","run_queue","subscriber","invalidate","label_1_class_value","checked","small","elementLegacyColor","courseColor","checkbox","handleChanged","disabledClass","smallClass","customColor","idForDay","date","isSameDate","dateToString","format","year","month","day","dateFromString","dateString","indexes","_match","p1","th","span_id_value","button_tabindex_value","button_aria_label_value","button_aria_describedby_value","td","t0","t0_value","tr","t2","t2_value","t4_value","t6_value","t8_value","t12_value","div2_aria_label_value","button0","button1","span2","table","thead","button2","t4","t6","t8","t12","getWeek","inputDate","dayNumber","firstDayOfYear","firstDayOfWeek","selectorStartDate","locale","highlightedDates","calendarElement","weeksToShow","days","changePage","months","newSelectorStartDate","setValue","setValueToday","onKeyPress","newValue","e","click_handler_1","click_handler_2","firstDateOfMonth","diff","firstDateToDisplay","weeks","today","week","daysOfWeek","div_aria_label_value","closeOnSelect","inputValue","wrapperElement","inputElement","tabTrapElement","valueChanged","newInputValue","inputValueChanged","focusValue","onInputBlurred","dateSelected","setExpanded","newExpanded","inputElementInner","wrapperRect","inputRect","onInputKeyPress","visible","close","closable","closeButtonType","infoText","warningText","loadingText","successText","showMessage","ariaLive","role","roleText","showStartStopErrorMessage","setValidDatesErrorMessage","showStartInvalidMessage","showStopInvalidMessage","select_changes","participants","availableEvents","courseGroups","numberOfCourseGroups","numberOfAllParticipantsEvents","changeValue","groupId","groupObject","updatedCourseGroups","firstAllParticpantsEventId","firstGroupEventId","hasGroupData","hasAllParticipantsData","NetworkError","response","ResponseStatuses","post","reject","fetchOptions","tryParseResponse","put","del","get","method","body","headers","pageSize","getQueryStringPaging","pageIndex","childId","getAllPlans","getAllPlansPublic","getWithoutDatePlans","getWithoutDatePlansPublic","getTopic","getTopicPublic","updateTopicColor","colorId","updateTopicTitle","getPlansInTopic","planOrder","getPlansInTopicPublic","createPlan","planParams","completePlan","uncompletePlan","togglePlansStatus","activate","toggleElementsActivation","isBulkAction","executeForAllPlans","requestModel","getLearningObjectives","nodeId","paramString","connectToTopic","getCourseTerms","updateTopicTerm","termId","removeTopicTerm","removePlans","setCustomFieldText","entityId","columnId","setTopicLearningObjectives","learningObjectiveIds","removeTopicLearningObjective","learningObjectiveId","getCourses","copyPlans","targetCourseId","targetTopicId","copyDates","copyResourcesAndActivities","overwriteAssessmentCriteria","plansIds","copyWithoutTopic","getTopicsForCopyPlans","originalTopicId","getCalendarAvailableDates","end","dragAndDropPlanInLesson","sourceId","targetId","after","dragAndDropPlanInTopic","order","setPlansTimeSpan","startDate","stopDate","weekNumber","getSetDateRequestModel","setPlansWeekAndDay","setPlansTimeSpanEvents","firstPlanEventIds","getPlanOrderInTopic","setPlanOrderInTopic","resetPlansInTopicOrder","plansInTopicOrder","createPlanV2","NO_TOPIC","createPlaceholderImagesProvider","topicColours","defaultPlanImages","topicPlaceholderLookup","tc","getRandomImageIndex","topicColor","defaultImages","currentImageIndex","maxAllowedIndex","loadPlans","apiMethod","startLoading","currentPageIndex","applyResult","error","handleError","loadPlansForTopic","publicAccessKey","plans","buildUpPlans","placeholderImagesProvider","plan","adjustToTimezone","setPlaceholderImageUrl","newDate","userTimezoneOffset","getDateRangeString","from","to","singlePlan","fromString","toString","isSameYear","isToCurrentYear","isDateOnlyMode","startTime","endTime","timeStringOptions","getEventsDateRangeString","multipleDayPlan","formatDateForApi","addLeadingZero","hours","minutes","seconds","formatDateOnlyForApi","zero","fromMinutes","toMinutes","validateDateFormat","dateValue","dateFormat","findSeparator","separator","dateArray","formatArray","missingDateValue","initAutoSuggestFromDate","dateValueFrom","dateValueTo","dateValueFromInitially","initAutoSuggestToDate","dateValueToInitially","emptystate_changes","banner_changes","datepickerfield0_changes","datepickerfield1_changes","modal_changes","showConnectToCalendarModal","datePickerFromExpanded","datePickerToExpanded","mountComplete","showEmptyState","allEvents","firstEventId","bannerVisible","getAllCourseEvents","connectToCalendarModalClicked","datePickerFrom","datePickerTo","dateFrom","dateTo","validateDateToFormat","epochStart","epochStop","activityArray","getCourseEventsInCurrentTimespan","setConnectingEvents","updatedAvailableEvents","datePickerMin","datePickerMax","events","pickerHighlightedDates","allCourseEvents","multipleDaysPlan","firstEventStartDate","firstEventStopDate","curentEventStartDate","currentEventStopDate","eventFrom","eventTo","formattedDate","isOccupied","isConnected","dayCounter","currentDatePointer","changeFirstEventId","showCopyConfirmModal","confirmModalBody","bannerText","option0","option1","hoursArray","twelvehoursArray","minutesArray","hourId","hourLabel","minuteId","minuteLabel","periodId","periodLabel","isPM","isDisabled","isPMstr","showRecurrenceErrorMessage","timeselector_changes","checkbox_changes","checkbox_props","t7_value","h20","h21","t7","rotateArray","array","isTheSameDay","showSetDatesModal","hoursFrom","minutesFrom","isPMFrom","hoursTo","minutesTo","isPMTo","showTimeSelector","dateTimeSet","isTimeSpanDisabled","weeksDropDownValue","daysArray","recurrenceArray","checkAutoSuggestFromDate","updateDaysArray","checkAutoSuggestToDate","datePicker","checkedDay","updateweeksDropDownValue","currentDayDiff","weekCount","toggleTimeSpanSetting","dataSelected","d","startDay","stopDay","insertHoursAndMinutes","hoursFromVal","hoursToVal","setDatesModalClicked","checkedDays","$$self","isRecurrenceSectionVisible","postKpi","measurement","context","postNewPlannerKpi","measurementId","defaultPlansData","createPlansStore","plansStore","getDatesForApi","dateOnlyMode","emptyDateStr","setPlanActive","setPlansActive","removePlansFromCourse","getCoursesForCopy","allCourses","copyPlansFromCourse","updatePlansDates","updatePlansDatesEvents","getPlansOrderFromPlansView","plansView","makeCourseForDropdown","course","actionSource","archivedText","courseTitle","isDateVisible","columnVisibilities","canEdit","isPlanColumnVisible","columnType","isValueViewableForAll","planColumnVisibility","addScrollTopicDropdown","addScrollCourseDropdown","modalId","dropdownCopyPlanSection","dropdownCopyTopicSection","dropdownHeight","printAsTopic","areAllPlansSelected","topicFilterIds","selectedPlanIds","showCopyPlansModal","showDeletePlansConfirmModal","showNoPlansSelectedModal","errorNoCourseSelected","errorNoTopicSelected","dropDownCourses","dropDownCoursesLoading","coursesItems","courseIsSelected","selectedCourseTitle","selectedCourseId","topicsItems","courseHasUseTopics","checkedKeepExistingTopic","topicIsSelected","selectedTopic","selectedTopicId","checkedCopyDates","checkedConnectedResources","checkedAssessmentCriteria","showCopyInProgress","confirmModalBannerVisibility","confirmModalBannerText","showDisableElementsConfirmModal","selectedPlanIdsToMakeNotVisible","isSelfPaceCourse","canConnectToCalendar","selectedAction","openModalInMobile","makeVisible","makeNotVisible","getActions","loadCourses","starredCoursesList","otherCoursesList","courseForDropdown","selectCourse","actionData","loadTopics","hasUseTopics","topicsList","topics","selectTopic","updateSelectATopicSection","updateCheckedStatusCopyDates","updateCheckedStatusConnectedResources","updateCheckedStatusAssessmentCriteria","copyPlansModalClicked","copyPlansData","completePlanAction","closeCopyPlansConfirmModalClicked","deletePlansModalClicked","isPlansDeleteConfirmed","saveSetDatesModalClicked","saveConnectToCalendarModalClicked","activityIds","closeSetDatesModalClicked","noPlansModalClicked","plansNotVisible_Selected","plansVisible_Selected","plansVisible_Selected_WithElements","confirmModalClicked","coursesDropdownText","topicsDropdownText","showAssessmentCriteriaSection","div2_id_value","placement","hover","tooltip","tooltipContent","setElementAttribute","onWindowKeyUp","hoverTooltip","unhoverTooltip","updateTooltip","setPosition","isTooltipShown","rect","tooltipHeight","tooltipWidth","horizontalPlacementOffset","verticalPlacementOffset","left","top","displayClass","complete","addBackDestinationParam","destinationUrl","extraParams","plansRegex","tableViewRegex","tableViewRegexMatch","plansRegexMatch","topicRegex","topicRegexMatch","topicsRegex","topicsRegexMatch","parentDashboardRegex","dashboardUrl","parentDashboardRegexMatch","queryString","childIdFromQueryParameter","getAllQueryStringParametersFromCurrentUrl","urlSearchParams","queryStringParameters","parameterKey","parameterValue","div_class_value","secondaryStandaloneClass","backExtraParams","containerClass","isPlanCard","kpiContinue","kpiStart","startAtPlanPage","useGenericResourceColumn","useNextPlanFeature","isContinue","isNextPlan","isStart","linkUrl","linkScreenReaderText","isComplete","isLast","isReopened","useBetterProgressionBetweenPlansWithoutDate","resourcesVisibility","activitiesVisibility","elementsVisibility","hasElements","allActivities","allResources","isAllActivitiesCompleted","isAllResourcesCompleted","isAllElementsCompleted","isNoResourcesCompleted","isNoActivitiesCompleted","handleLinkClick","handleCompletePlan","handleUncompletePlan","setLinkStart","redirect","handleCourseStartOrContinue","setLinkContinue","setLinkNextPlan","func","canPlanBeSetAsCompleted","areResourcesVisible","areActivitiesVisible","areElementsVisible","isLinkTextStart","isLinkTextContinue","isLinkTextNext","nextResource","progress","progressCssClass","accessibleText","accessibleTextString","validAccessibleTextString","isPlanCompletedHelper","isPlanCompleted","_a","create_if_block_18","create_if_block_16","create_if_block_17","create_if_block_12","create_if_block_9","show_if","create_if_block_19","create_if_block_15","create_if_block_14","create_if_block_13","if_block4","create_if_block_11","create_if_block_10","if_block6","create_if_block_8","div0_style_value","div0_aria_label_value","li_id_value","li_class_value","h3","getPlanBackgroundImageStyle","backgroundImageUrl","eventsCount","linkedCoursesCount","showSelect","showDrag","hasAccessToPlan","isLearner","topicName","showTopicAsLink","keyboardReorderSelected","dragAndDropSelected","keyboardReorder","isCourseOverviewPage","resourceCount","planElement","activityCount","resourcesCompleted","activitiesCompleted","isPlanLocked","cardElement","dragButton","tooltipVisible","isSelfPacedCourseOnePlanAtATime","resources","areResourcesAndActivitiesCombined","linkedCourses","updateCheckedStatus","selectedPlans","mouseDownDragButton","clickDragButton","keyUpDragButton","blurDragButton","isResourceVisible","isResourceActivitiesVisible","isResourceOrActivities","countMaxProgressBar","typeToShow","resourcesActivitiesCompleted","showResources","getShortDescription","temporaryElement","measurePlanOpensFromCalendar","isPlanClickable","dateText","imageStyle","hiddenClass","canCurrentUserCompleteElements","userCanStartPlan","hoverSupportClass","topicColorStyle","nameText","handleClick","loadTopic","withoutDatePlansData","allPlansData","loadWithoutDatePlans","loadAllPlans","debounce","immediate","timeout","args","callNow","plansData","topicData","plancard_changes","div_aria_busy_value","if_block0","scrollPlanToView","upcomingSplitTime","drag","loadMethod","separateUpcomingPlans","showLoading","scrollBottom","loadingError","orderDirty","keyboardReorderActiveId","reorderDragHandleId","draggedElementTop","dragSelectedPlan","sourceSelectedPlan","targetSelectedPlan","targetSelectedPlanAfter","debounceSavePlanOrder","listSection","listElement","dragScrolling","newPlanUpdatePerformed","isAutoloadingOn","isDraggable","showReplaceSortingConfirmModal","dragConfirmed","currentPlanOrder","dragIconElements","runDebounceSavePlansOrder","savePlanOrder","showMore","changeFocus","elementId","moveDown","movePlan","moveUp","insertBefore","newElements","fromIndex","toIndex","keyboardDragStart","listKeyDown","activePlan","targetPlanIndex","listBlur","dragStart","pointerMove","cursorPosY","offsetTop","elementRect","elementTop","dragOverElement","scrollWithDrag","down","scrollAmount","dragEnd","isPlansInTopicView","savePlanOrderAfterConfirmation","onScroll","maxScroll","toggleAutoloading","replaceSortingModalClicked","dragStart_handler","keyboardDragStart_handler","mainPlans","upcomingPlans","urlParams","draggedElementStyle","link_changes","isDataLoading","showTableViewLinkForReadOnlyMode","linktext","emptyState","displayValue","labelledBy","safeHtmlProvider","showTextArea","hideEditButton","textArea","richTextContent","editorInstance","ckEditorGlobal","ckScript","editModalEnabled","editModalLoading","isValueBeingUpdated","textAreaInputResize","onTextAreaInput","onClickEdit","handleInputBlur","loadCkScript","onModalClosed","editorHtml","updateHtml","keyDownWrapper","onEditorKeyDown","htmlEncode","areValuesTheSame","updatedValue","updatedDisplayValue","isPlainText","replaceLineBreaksWithBrTags","valueToChange","lineBreakToBrRegex","brTagString","edit","richTextEditorValue","updateTopicFieldLearningObjectives","learningObjectives","loIds","lo","removeTopicFieldLearningObjective","updateTopicFieldText","fieldIndex","f","updateTopicFieldTerm","term","removeTopicFieldTerm","richtext_props","richtext_changes","field","checkFilterMatch","optionStr","filter","isPrintableCharacter","enableAutoComplete","enableInlineAutoComplete","listboxFocusedID","dataProvider","chevronVisible","mainContainer","checkIfFocused","containsTarget","focus","reset","setDisplayValue","getStrValue","checkIfEmpty","keyDown","keyUp","preventDispatchFilter","preventInlineGuess","char","createSelection","displayInlineGuess","inlineGuess","getInlineGues","id_Container","inputAriaHasPopup","ariaAutocomplete","listboxID_forContainer","listboxID_forInput","getNextFocusedForSingleChange","listBoxContainer","focusedIndex","setSelectedElementToBeFocused","selectedOption","removeCurrentFocus","setNextElementToBeFocused","focusedItem","setElementToBeFocused","optionID","changeFocused","scroll","change","nextFocusedIndex","getNextFocusedIndex","nextFocused","handleNextFocusedOption","getItemsPositions","positions","getNextFocusedIndexForPage","popupHeight","currentPosition","nextPosition","nextPositionIndex","positionsBefore","bottom","labelID","listboxID","ComboboxStandardDataProvider","searchText","strValue","resultItem","enableNewValues","internalOptions","prevOptions","prevSelected","container","popup","getDisplayValue","requestForOptions","commitNewValue","closePopup","resetFilter","setFilter","filterValue","shouldBeFocused","openPopupByKey","openPopup","applyFilter","oldFilter","returnFocusAfterKeyPressed","focusedOptionChanged","activedescendantChanged","commit_handler","errorMessageID","ModalEvent","defaultI18n","heading","closeable","showCloseButton","hideHeader","rootElement","closeElement","bodyElement","scrollModiferClass","rootElementRole","onWindowResize","headerClientId","defaultRole","translations","bodyClientId","makeButtonSecondary","TermsDataProvider","terms","TermId","Name","addTermModalId","comboboxId","selectedTermId","termTitle","isEmpty","provider","toggleAddButton","addButton","addComboboxPlaceholder","combobox","handleConfirm","isAdd","isChange","iconless","iconType","plainbutton_changes","plainbutton0_changes","plainbutton1_changes","addtermmodal_changes","addTermModalEnabled","addTermModalType","termLabel","addLabel","changeLabel","removeLabel","closeAddTermModal","openChangeTermModal","openAddTermModal","updateTerm","removeTerm","termDisplayName","aria_describedby","dragged","alignTextRight","checkOnClick","click","td_class_value","th_class_value","colspan","rowspan","priority","div0_class_value","renderLoTitleHtml","renderLoDescriptionHtml","selectable","keyPress","cubicOut","slide","axis","opacity","primary_property","primary_property_value","secondary_properties","capitalized_secondary_properties","padding_start_value","padding_end_value","margin_start_value","margin_end_value","border_width_start_value","border_width_end_value","li_aria_busy_value","learningObjective","selectedLearningObjective","toggleExpanded","isRoot","onRight","onLeft","selectRelative","onTab","parent","offset","itemIndex","checkboxcell_changes","learningobjectivecell_changes","checkboxcell_props","listelement_props","listelement_changes","tbody","initialSelectionDisabled","initialLearningObjectives","rootLearningObjective","loPicker","reservedHeight","selectedChildren","headerChecked","onEnable","selectLO","resize","newLOs","newLO","initialLO","setSelectedChildren","modal","content","scrollOverflow","totalModalHeight","loPickerHeight","checkedItemsChanged","itemClicked","headerCheckedChanged","confirmed","checkedLO","select_handler","change_handler","close_handler","selectedDescription","loPickerStyle","isFolder","isTooltipDialogOpened","LO_ID","tooltipDialogPlacement","openTooltipDialog","closeTooltipDialog","closeButtonClass","idLO","closeButtonText","showActions","actionButtonText","actionButtonLabel","tableViewParent","removeButtonId","tooltipdialog","focusedBeforeTooltipDialog","updateTooltipDialog","onScrollChange","updateTooltipDialogPosition","elementInFirstHalfOfThePage","scrollAtTheBottom","loadLearningObjectives","parentId","selectableCategory","intId","tooltipdialog_changes","learningobjective_changes","iconbutton_changes","learningobjectivepicker_changes","losDirty","loPickerEnabled","learningObjectiveElement","showTooltipDialog","idLearningObjective","headingTooltipDialog","textTooltipDialog","removeLearningObjective","loId","showAddLOModal","applyNewLearningObjectives","newLearningObjectives","isDirty","apply_handler","iframe","iframe_src_value","rubricUrl","rubricModal","h2_id_value","topicrubric_changes","topicterm_changes","learningobjectives_changes","fieldElements","onBeforeUnload","showCustomField","showCustomFields","customFieldsVisible","t5_value","option2","t5","showYourOwnSorting","isSelfPacedCourse","showCustomFieldsSectionHelper","customFields","customfields_props","customfields_changes","plansview_changes","edittopicmodal_props","edittopicmodal_changes","descriptionEmptyTopicPage","titleEmptyTopicPage","editTopicModalEnabled","errorModal","createNewPlanUrl","tableViewLinkBackExtraParams","updateAfterAction","loadMore","dropdownOptionSelected","addPlan","planData","newPlanUrlWithPlanId","plansForTopicHasBeenReordered","changePlanOrder","saveTopicChanges","$topicData","$plansData","save_handler","isEditPlansToolbarAvailable","showCustomFieldsSection","_b","settingsDropdownItems","breadcrumbsHref","backLinkParameters","currentUrlQueryStringParameters","CommonFunctions","window","messageNames","callbackFunction","originWindow","settings","postSettings","CommonConstants","MessageNames","__extends","this","__","CommonWindowMessages","GenericMessage","messageName","GenericMessageWithData","_super","extendedData","TextEditorBaseInteractionMessage","interactionType","closeDialogAfterPerformingOperation","editorInstanceId","TextEditorBaseInteractionWithDataMessage","TextEditorCloseDialogMessage","TextEditorInteractionType","TextEditorInsertHtmlMessage","htmlContent","isEmbeddedImage","TextEditorInsertLinkToFileMessage","linkName","TextEditorUpdateItslPluginListMessage","pluginId","TextEditorSendImageSettingsMessage","TextEditorInsertImageToSlideshow","TextEditorInsertTextLink","additionalAttributes","TextEditorScaleDialog","startupFunctions","setupDone","manager","editorName","loadFunction","showFunction","setupButton","evt","collapseExtensionIframe","insertLink","editor","linkAttributes","viewSize","dialog","dialogSize","parentWidth","parentHeight","newDialogWidth","newDialogHeight","contentWidth","contentOffsetWidth","contentHeight","contentOffsetHeight","dialogPosition","dialogOffsetLeft","cssClasses","buttonDefinition","selection","ranges","link","range","widget","setupIframeCallback","attrs","configSectionName","externalOptions","pluginConfig","dialogDefinition","counter","onContentLoad","customDialogDefinition","parts","parentDocument","iframeId","dialogSrc","buttonConfig","idStr","firstColon","secondColon","oldImage","oldUrl","doNotSetFocus","editable","mask","txt","encodedText","encodedMask","size","focusListener","contentChanged","blurListener","modeListener","showWatermark","watermarkedClass","editorBody","customMask","forceSetHtml","recorder","topPage","parentPostMessage","App"],"mappings":"i7BAQO,SAASA,GAAYC,EAASC,EAAc,OAAO,OAAQ,CAC1D,OAAO,OAAS,OAAO,KACvBA,EAAY,YAAY,KAAK,UAAUD,CAAO,EAAG,GAAG,CAE5D,CAMO,SAASE,GAA0BF,EAASC,EAAc,OAAO,OAAQ,CAC5EF,GAAYC,CAAO,EAEfC,IAAgBA,EAAY,KAC5BC,GAA0BF,EAASC,EAAY,MAAM,CAE7D,CCdO,MAAME,GAAqC,IAAM,CAEpD,MAAMC,EADc,UAAU,UAAU,YAAW,EACvB,MAAM,oBAAoB,EAEhDC,EAA2B,CAAE,YAAa,qBAGhD,GAFA,SAAS,iBAAiB,QAAS,IAAM,CAAEH,GAA0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