This will remove all cached pages and objects from the cache.
', 'Failed to flush all caches
'));\n flushCurrentEl === null || flushCurrentEl === void 0 ? void 0 : flushCurrentEl.addEventListener('click', clickHandler(flushCurrentEl, async () => {\n var _a, _b;\n const cacheKey = (_a = flushCurrentEl.nextSibling) === null || _a === void 0 ? void 0 : _a.getAttribute('value');\n const currentUrl = window.location.href.replace(/[?#].*$/, '');\n const resp = await restRequestTheme('POST', `cache/flush/${cacheKey}?url=${encodeURIComponent(currentUrl)}`);\n return (_b = resp === null || resp === void 0 ? void 0 : resp.payload) === null || _b === void 0 ? void 0 : _b.message_html;\n }, '', 'Failed to flush current page cache
'));\n function clickHandler(el, callback, confirmMsg, failureMsg) {\n return async (event) => {\n event.preventDefault();\n if (confirmMsg) {\n const confirm = createGenericModal({\n bodyHtml: confirmMsg,\n actions: [\n {\n title: 'No',\n handler: 'dismiss',\n fill: 'outline',\n color: 'gray',\n },\n {\n title: 'Yes',\n handler: () => true,\n handlerBehavior: 'dismiss',\n fill: 'solid',\n },\n ],\n });\n confirm.show();\n const confirmation = await confirm.dismissed();\n if (!confirmation) {\n return;\n }\n }\n el.classList.add('is--flushing');\n Object.assign(el.style, {\n pointerEvents: 'none',\n opacity: '0.5',\n });\n try {\n const msg = await callback();\n if (msg) {\n createGenericModal({\n bodyHtml: msg,\n }).show();\n }\n }\n catch (err) {\n console.error(err);\n createGenericModal({\n bodyHtml: failureMsg || 'Something went wrong
' + JSON.stringify(err) + '',\n }).show();\n }\n el.classList.remove('is--flushing');\n Object.assign(el.style, {\n pointerEvents: '',\n opacity: '',\n });\n };\n }\n}\n","import { defineComponent as _defineComponent } from 'vue';\nimport { vModelText as _vModelText, withKeys as _withKeys, createElementVNode as _createElementVNode, withDirectives as _withDirectives, unref as _unref, createVNode as _createVNode, openBlock as _openBlock, createBlock as _createBlock, createCommentVNode as _createCommentVNode, normalizeClass as _normalizeClass, createElementBlock as _createElementBlock, toDisplayString as _toDisplayString, withModifiers as _withModifiers, renderList as _renderList, Fragment as _Fragment, vShow as _vShow, withCtx as _withCtx } from \"vue\";\nconst _hoisted_1 = { class: \"siteSearch\" };\nconst _hoisted_2 = { class: \"siteSearch-inputField\" };\nconst _hoisted_3 = { class: \"siteSearch-adv-control for--dates\" };\nconst _hoisted_4 = { key: 0 };\nconst _hoisted_5 = { key: 1 };\nconst _hoisted_6 = {\n key: 2,\n class: \"siteSearch-adv-dates\"\n};\nconst _hoisted_7 = { class: \"siteSearch-adv-control for--topics\" };\nconst _hoisted_8 = { class: \"siteSearch-adv-end\" };\nconst _hoisted_9 = { class: \"siteSearch-adv-search\" };\nconst _hoisted_10 = { class: \"topicsModal-inputWrapper\" };\nconst _hoisted_11 = { class: \"topicsModal-choicesList\" };\nconst _hoisted_12 = { class: \"siteSearch-checkbox\" };\nconst _hoisted_13 = [\"checked\", \"onChange\"];\nconst _hoisted_14 = [\"innerHTML\"];\nimport { computed, nextTick, reactive, ref, shallowRef } from 'vue';\nimport { ThemeButton, ThemeIcon, ThemeModal } from '../../front/components';\nexport default /*@__PURE__*/ _defineComponent({\n __name: 'ListArticlesFilters',\n props: {\n mod: {}\n },\n setup(__props) {\n var _a, _b, _c, _d;\n const VueDatePicker = shallowRef();\n // Lazy load datepicker, since it's quite heavy\n import('@vuepic/vue-datepicker').then(module => {\n VueDatePicker.value = module.default;\n });\n const props = __props;\n const initialUrl = new URL(location.href);\n const initialArgs = {\n searchQuery: initialUrl.searchParams.get('sok') || '',\n selectedTopicsIds: (initialUrl.searchParams.get(`amne-${props.mod.json.topics.taxonomy}`) || '').split('m').map(v => parseInt(v)).filter(s => s) || [],\n dateFrom: ((_b = (_a = initialUrl.searchParams.get('stdatum')) === null || _a === void 0 ? void 0 : _a.match(/^\\d{4}-\\d{2}-\\d{2}$/)) === null || _b === void 0 ? void 0 : _b[0]) || null,\n dateTo: ((_d = (_c = initialUrl.searchParams.get('sldatum')) === null || _c === void 0 ? void 0 : _c.match(/^\\d{4}-\\d{2}-\\d{2}$/)) === null || _d === void 0 ? void 0 : _d[0]) || null,\n dateMode: initialUrl.searchParams.get('dtyp') || null,\n };\n const args = reactive(Object.assign(Object.assign({}, initialArgs), { topicsSearch: '', selectedTopicsIds: [...initialArgs.selectedTopicsIds] }));\n const topicsData = props.mod.json.topics;\n const topicsModal = ref();\n const topicsModalInput = ref();\n function showTopicSelectionUI() {\n var _a;\n args.topicsSearch = '';\n (_a = topicsModal.value) === null || _a === void 0 ? void 0 : _a.show();\n }\n function applyTopicsSelection() {\n var _a;\n (_a = topicsModal.value) === null || _a === void 0 ? void 0 : _a.dismiss();\n }\n function clearSearchQuery() {\n args.searchQuery = '';\n if (hasChanges.value) {\n commitSearch();\n }\n }\n function onTopicsModalShown() {\n nextTick(() => {\n var _a;\n (_a = topicsModalInput.value) === null || _a === void 0 ? void 0 : _a.focus();\n });\n }\n function onTopicSelectionChange(event, entry) {\n if (event.target.checked) {\n args.selectedTopicsIds.push(entry.id);\n }\n else {\n args.selectedTopicsIds = args.selectedTopicsIds.filter(v => v !== entry.id);\n }\n }\n function prepareModalTopics(values = []) {\n if (args.topicsSearch.length < 2) {\n return values.map(val => (Object.assign(Object.assign({}, val), { visible: true })));\n }\n const words = args.topicsSearch.toLowerCase().split(/[\\s._-]/).filter(w => w).slice(0, 10);\n return values.map(val => {\n const visible = words.some(w => val.label.toLowerCase().indexOf(w) >= 0);\n return Object.assign(Object.assign({}, val), { visible });\n });\n }\n const hasChanges = computed(() => {\n return (args.searchQuery !== initialArgs.searchQuery ||\n args.dateFrom !== initialArgs.dateFrom ||\n args.dateTo !== initialArgs.dateTo ||\n args.dateMode !== initialArgs.dateMode ||\n args.selectedTopicsIds.join(',') !== initialArgs.selectedTopicsIds.join(','));\n });\n function commitSearch() {\n const params = new URLSearchParams(location.search);\n for (const pkey of ['dtyp', 'stdatum', 'sldatum', `amne-${props.mod.json.topics.taxonomy}`, 'sok']) {\n if (params.has(pkey)) {\n params.delete(pkey);\n }\n }\n if (args.searchQuery) {\n params.set('sok', args.searchQuery);\n }\n if (args.dateFrom) {\n params.set('stdatum', args.dateFrom);\n }\n if (args.dateTo) {\n params.set('sldatum', args.dateTo);\n }\n if (args.dateMode) {\n params.set('dtyp', args.dateMode);\n }\n if (args.selectedTopicsIds.length) {\n params.set(`amne-${props.mod.json.topics.taxonomy}`, args.selectedTopicsIds.join('m'));\n }\n const url = new URL(location.origin + location.pathname + '?' + params.toString());\n if (url.toString() !== location.href) {\n window.location.assign(url);\n }\n }\n return (_ctx, _cache) => {\n return (_openBlock(), _createElementBlock(\"div\", _hoisted_1, [\n _createElementVNode(\"div\", _hoisted_2, [\n _withDirectives(_createElementVNode(\"input\", {\n type: \"text\",\n class: \"siteSearch-inputField-input\",\n \"onUpdate:modelValue\": _cache[0] || (_cache[0] = ($event) => ((args.searchQuery) = $event)),\n placeholder: \"Sök här...\",\n ref: \"ownQueryInputEl\",\n onKeydown: _cache[1] || (_cache[1] = _withKeys(() => (hasChanges.value && commitSearch()), [\"enter\"]))\n }, null, 544), [\n [_vModelText, args.searchQuery]\n ]),\n _createVNode(_unref(ThemeIcon), {\n class: \"siteSearch-inputField-icon\",\n name: \"magnifying-glass\"\n }),\n (args.searchQuery)\n ? (_openBlock(), _createBlock(_unref(ThemeButton), {\n key: 0,\n class: \"siteSearch-inputField-emptyBtn\",\n \"wca-title\": \"Empty search\",\n icon: \"times-round-outline\",\n color: \"primary\",\n fill: \"none\",\n onClick: clearSearchQuery\n }))\n : _createCommentVNode(\"\", true)\n ]),\n _createElementVNode(\"div\", _hoisted_3, [\n (_ctx.mod.json.post_type === 'skp_rnd_thesis')\n ? (_openBlock(), _createElementBlock(\"label\", _hoisted_4, [\n _createElementVNode(\"span\", {\n role: \"button\",\n tabindex: \"0\",\n class: _normalizeClass({ 'is--active': !args.dateMode }),\n onClick: _cache[2] || (_cache[2] = ($event) => (args.dateMode = null))\n }, \"Publiceringsdatum\", 2),\n _cache[10] || (_cache[10] = _createElementVNode(\"span\", null, \"/\", -1)),\n _createElementVNode(\"span\", {\n role: \"button\",\n tabindex: \"0\",\n class: _normalizeClass({ 'is--active': args.dateMode === 'disputationsdatum' }),\n onClick: _cache[3] || (_cache[3] = ($event) => (args.dateMode = 'disputationsdatum'))\n }, \"Disputationsdatum\", 2)\n ]))\n : (_openBlock(), _createElementBlock(\"label\", _hoisted_5, \"Publiceringsdatum\")),\n (VueDatePicker.value)\n ? (_openBlock(), _createElementBlock(\"div\", _hoisted_6, [\n _createVNode(_unref(VueDatePicker), {\n modelValue: args.dateFrom,\n \"onUpdate:modelValue\": _cache[4] || (_cache[4] = ($event) => ((args.dateFrom) = $event)),\n placeholder: \"Från datum\",\n \"model-type\": \"yyyy-MM-dd\",\n format: \"yyyy-MM-dd\",\n \"week-numbers\": \"local\",\n \"min-date\": \"2000-01-01\",\n \"max-date\": args.dateTo ? new Date(args.dateTo) : new Date(),\n \"enable-time-picker\": false,\n locale: \"sv\",\n \"cancel-text\": \"Avbryt\",\n \"select-text\": \"Välj\",\n \"now-button-label\": \"Idag\",\n \"week-num-name\": \"v.\"\n }, null, 8, [\"modelValue\", \"max-date\"]),\n _createVNode(_unref(ThemeIcon), { name: \"arrow-right-long\" }),\n _createVNode(_unref(VueDatePicker), {\n modelValue: args.dateTo,\n \"onUpdate:modelValue\": _cache[5] || (_cache[5] = ($event) => ((args.dateTo) = $event)),\n placeholder: \"Till datum\",\n \"model-type\": \"yyyy-MM-dd\",\n format: \"yyyy-MM-dd\",\n \"week-numbers\": \"local\",\n \"min-date\": args.dateFrom ? new Date(args.dateFrom) : '',\n \"max-date\": new Date(),\n \"enable-time-picker\": false,\n locale: \"sv\",\n \"cancel-text\": \"Avbryt\",\n \"select-text\": \"Välj\",\n \"now-button-label\": \"Idag\",\n \"week-num-name\": \"v.\"\n }, null, 8, [\"modelValue\", \"min-date\", \"max-date\"])\n ]))\n : _createCommentVNode(\"\", true)\n ]),\n _createElementVNode(\"div\", _hoisted_7, [\n _cache[11] || (_cache[11] = _createElementVNode(\"label\", null, \"Ämne\", -1)),\n _createElementVNode(\"div\", _hoisted_8, [\n _createElementVNode(\"button\", {\n class: \"siteSearch-fauxSelect\",\n onClick: _cache[6] || (_cache[6] = _withModifiers(($event) => (showTopicSelectionUI()), [\"prevent\"]))\n }, [\n _createElementVNode(\"span\", null, _toDisplayString(args.selectedTopicsIds.length\n ? `${args.selectedTopicsIds.length} ${args.selectedTopicsIds.length === 1\n ? 'valt' : 'valda'}` : 'Välj...'), 1),\n _createVNode(_unref(ThemeIcon), { name: \"chevron-down\" })\n ]),\n _createElementVNode(\"div\", _hoisted_9, [\n _createVNode(_unref(ThemeButton), {\n title: \"Sök\",\n color: \"primary\",\n onClick: _cache[7] || (_cache[7] = ($event) => (commitSearch())),\n disabled: !hasChanges.value\n }, null, 8, [\"disabled\"])\n ])\n ])\n ]),\n _createVNode(_unref(ThemeModal), {\n ref_key: \"topicsModal\",\n ref: topicsModal,\n classes: \"topicsModal\",\n title: `Välj ${_unref(topicsData).label}`,\n actions: [\n { title: 'Avbryt', handler: 'dismiss', color: 'neutral', iconAfter: 'times' },\n {\n title: (args === null || args === void 0 ? void 0 : args.selectedTopicsIds.length) ? `Välj ${args.selectedTopicsIds.length}st` : 'Välj',\n handler: () => applyTopicsSelection(),\n iconAfter: 'check',\n fill: 'solid'\n },\n ],\n onShown: onTopicsModalShown\n }, {\n default: _withCtx(() => [\n _createElementVNode(\"div\", _hoisted_10, [\n _withDirectives(_createElementVNode(\"input\", {\n type: \"text\",\n ref_key: \"topicsModalInput\",\n ref: topicsModalInput,\n class: _normalizeClass({ 'is--active': args.topicsSearch }),\n \"onUpdate:modelValue\": _cache[8] || (_cache[8] = ($event) => ((args.topicsSearch) = $event))\n }, null, 2), [\n [_vModelText, args.topicsSearch]\n ]),\n _createVNode(_unref(ThemeIcon), { name: \"magnifying-glass\" })\n ]),\n _createElementVNode(\"div\", _hoisted_11, [\n (_openBlock(true), _createElementBlock(_Fragment, null, _renderList(prepareModalTopics(_unref(topicsData).list), (entry) => {\n return _withDirectives((_openBlock(), _createElementBlock(\"label\", _hoisted_12, [\n _createElementVNode(\"input\", {\n type: \"checkbox\",\n checked: args.selectedTopicsIds.findIndex(v => v === entry.id) >= 0,\n onChange: ($event) => (onTopicSelectionChange($event, entry))\n }, null, 40, _hoisted_13),\n _createVNode(_unref(ThemeIcon), { name: \"check\" }),\n _createElementVNode(\"span\", {\n innerHTML: entry.label\n }, null, 8, _hoisted_14)\n ], 512)), [\n [_vShow, entry.visible]\n ]);\n }), 256))\n ]),\n _createVNode(_unref(ThemeButton), {\n class: \"topicsModal-uncheckBtn\",\n title: \"Avmarkera alla\",\n color: \"light\",\n size: \"small\",\n disabled: !args.selectedTopicsIds.length,\n onClick: _cache[9] || (_cache[9] = ($event) => (args.selectedTopicsIds = []))\n }, null, 8, [\"disabled\"])\n ]),\n _: 1\n }, 8, [\"title\", \"actions\"])\n ]));\n };\n }\n});\n","import script from \"./ListArticlesFilters.vue?vue&type=script&lang=ts&setup=true\"\nexport * from \"./ListArticlesFilters.vue?vue&type=script&lang=ts&setup=true\"\n\nconst __exports__ = script;\n\nexport default __exports__","import { ThemeLayout } from '../../front/lib/ThemeLayout';\nimport { createApp } from 'vue';\nimport ListArticlesFilters from './ListArticlesFilters.vue';\nexport class ListArticles extends ThemeLayout {\n init() {\n const filtersAppEl = this.getElementById('filtersApp');\n if (filtersAppEl) {\n this.initFiltersApp(filtersAppEl);\n }\n }\n initFiltersApp(rootEl) {\n const app = createApp(ListArticlesFilters, { mod: this });\n app.mount(rootEl);\n }\n}\n","import { defineComponent as _defineComponent } from 'vue';\nimport { unref as _unref, normalizeClass as _normalizeClass, openBlock as _openBlock, createBlock as _createBlock, createCommentVNode as _createCommentVNode, createElementVNode as _createElementVNode, vModelText as _vModelText, withKeys as _withKeys, withDirectives as _withDirectives, createVNode as _createVNode, createElementBlock as _createElementBlock, toDisplayString as _toDisplayString, withModifiers as _withModifiers, renderList as _renderList, Fragment as _Fragment, vShow as _vShow, withCtx as _withCtx } from \"vue\";\nconst _hoisted_1 = { class: \"siteSearch-adv-control for--input\" };\nconst _hoisted_2 = { class: \"siteSearch-inputField\" };\nconst _hoisted_3 = {\n key: 0,\n class: \"siteSearch-adv-control for--dates\"\n};\nconst _hoisted_4 = { key: 0 };\nconst _hoisted_5 = { key: 1 };\nconst _hoisted_6 = {\n key: 2,\n class: \"siteSearch-adv-dates\"\n};\nconst _hoisted_7 = { class: \"siteSearch-adv-control for--topics\" };\nconst _hoisted_8 = { key: 0 };\nconst _hoisted_9 = { class: \"siteSearch-adv-end\" };\nconst _hoisted_10 = { class: \"topicsModal-inputWrapper\" };\nconst _hoisted_11 = { class: \"topicsModal-choicesList\" };\nconst _hoisted_12 = { class: \"siteSearch-checkbox\" };\nconst _hoisted_13 = [\"checked\", \"onChange\"];\nconst _hoisted_14 = [\"innerHTML\"];\nimport { computed, nextTick, onMounted, onUnmounted, reactive, ref, shallowRef, watch } from 'vue';\nimport { ThemeButton, ThemeIcon, ThemeModal } from '../../front/components';\nimport { theme } from '../../front/Theme';\nimport { ThemeMediaSize } from '../../front/defs/types';\nexport default /*@__PURE__*/ _defineComponent({\n __name: 'PrimaryListSearchApp',\n props: {\n mod: {}\n },\n setup(__props) {\n var _a, _b;\n const VueDatePicker = shallowRef();\n // Lazy load datepicker, since it's quite heavy\n import('@vuepic/vue-datepicker').then(module => {\n VueDatePicker.value = module.default;\n });\n const props = __props;\n const primarySearchConfig = props.mod.json.primarySearch;\n const listingConfig = primarySearchConfig.listingConfig;\n const dateRange = reactive({\n from: listingConfig.preset.date_from,\n to: listingConfig.preset.date_to,\n });\n const searchArgs = reactive({\n searchQuery: '',\n topicsSearch: '',\n selectedTopicsIds: [],\n dateFrom: null,\n dateTo: null,\n dateMode: null,\n });\n const searchVisible = ref(false);\n const isMobile = ref(theme().mediaSize === ThemeMediaSize.MediumLarge);\n const fetchedFullSearchUrl = ref(null);\n const fullSearchUrl = computed(() => {\n return fetchedFullSearchUrl.value || listingConfig.archiveUrl || `/?s=${encodeURIComponent(searchArgs.searchQuery)}`;\n });\n const pendingTopicsIds = ref([...searchArgs.selectedTopicsIds]);\n let currentlySearching = ref(makeSearchArgsSnapshot());\n const performingSearch = ref(false);\n const hasChanges = computed(() => {\n return searchArgs.searchQuery !== currentlySearching.value.searchQuery\n || searchArgs.selectedTopicsIds.join(',') !== (currentlySearching.value.selectedTopicsIds || []).join(',')\n || searchArgs.dateFrom !== currentlySearching.value.dateFrom\n || searchArgs.dateTo !== currentlySearching.value.dateTo\n || ((searchArgs.dateFrom || searchArgs.dateTo) && searchArgs.dateMode !== currentlySearching.value.dateMode);\n });\n const hasAnySearchArgs = computed(() => {\n return !!(searchArgs.searchQuery || searchArgs.selectedTopicsIds.length || searchArgs.dateFrom || searchArgs.dateTo);\n });\n const hasTopics = ((_a = listingConfig.topics) === null || _a === void 0 ? void 0 : _a.list.length) && !((_b = listingConfig.preset.topics_ids) === null || _b === void 0 ? void 0 : _b.length);\n const topicsData = listingConfig.topics;\n const topicsModal = ref();\n const topicsModalInput = ref();\n watch(() => performingSearch.value, () => {\n props.mod.setBusyStatus(performingSearch.value);\n });\n let _autoTimeout = null;\n watch(() => hasChanges.value, () => {\n if (hasChanges.value) {\n if (_autoTimeout) {\n window.clearTimeout(_autoTimeout);\n }\n _autoTimeout = window.setTimeout(() => {\n _autoTimeout = null;\n commitSearch();\n }, 500);\n }\n });\n watch(isMobile, () => {\n if (!isMobile.value) {\n searchVisible.value = true;\n }\n });\n onMounted(() => {\n theme().attachBreakpointListener(onBreakpointChange);\n });\n onUnmounted(() => {\n theme().removeBreakpointListener(onBreakpointChange);\n });\n function onBreakpointChange(event) {\n isMobile.value = event.detail.size <= ThemeMediaSize.Medium;\n }\n function makeSearchArgsSnapshot() {\n // Scalar values are copied by value, objects has to be cloned as well\n return Object.assign(Object.assign({}, searchArgs), { selectedTopicsIds: [...searchArgs.selectedTopicsIds] });\n }\n function showTopicSelectionUI() {\n var _a;\n searchArgs.topicsSearch = '';\n (_a = topicsModal.value) === null || _a === void 0 ? void 0 : _a.show();\n }\n function applyTopicsSelection() {\n var _a;\n searchArgs.selectedTopicsIds = [...pendingTopicsIds.value];\n (_a = topicsModal.value) === null || _a === void 0 ? void 0 : _a.dismiss();\n }\n function clearSearchQuery() {\n searchArgs.searchQuery = '';\n commitSearch();\n }\n function onTopicsModalShown() {\n nextTick(() => {\n var _a;\n (_a = topicsModalInput.value) === null || _a === void 0 ? void 0 : _a.focus();\n });\n }\n function onTopicSelectionChange(event, entry) {\n if (event.target.checked) {\n pendingTopicsIds.value.push(entry.id);\n }\n else {\n pendingTopicsIds.value = pendingTopicsIds.value.filter(v => v !== entry.id);\n }\n }\n function prepareModalTopics(values = []) {\n if (searchArgs.topicsSearch.length < 2) {\n return values.map(val => (Object.assign(Object.assign({}, val), { visible: true })));\n }\n const words = searchArgs.topicsSearch.toLowerCase().split(/[\\s._-]/).filter(w => w).slice(0, 10);\n return values.map(val => {\n const visible = words.some(w => val.label.toLowerCase().indexOf(w) >= 0);\n return Object.assign(Object.assign({}, val), { visible });\n });\n }\n let _scheduleNextSearch = false;\n async function commitSearch() {\n var _a;\n if (!hasChanges.value) {\n return;\n }\n if (performingSearch.value) {\n _scheduleNextSearch = true;\n return;\n }\n performingSearch.value = true;\n currentlySearching.value = makeSearchArgsSnapshot();\n await new Promise(resolve => setTimeout(resolve, 1000));\n try {\n const resp = await props.mod.restRequest('POST', 'search', {\n init: {\n body: JSON.stringify({\n searchArgs: {\n query: currentlySearching.value.searchQuery,\n topics: topicsData ? {\n ids: currentlySearching.value.selectedTopicsIds,\n search: currentlySearching.value.topicsSearch,\n taxonomy: topicsData.taxonomy,\n } : null,\n date_from: currentlySearching.value.dateFrom,\n date_to: currentlySearching.value.dateTo,\n date_mode: currentlySearching.value.dateMode,\n },\n moduleConfig: primarySearchConfig.moduleConfig,\n listingId: primarySearchConfig.listingId,\n }),\n }\n });\n if ((_a = resp.payload) === null || _a === void 0 ? void 0 : _a.html) {\n await props.mod.replaceSearchResults(resp.payload.html);\n }\n fetchedFullSearchUrl.value = resp.payload.fullSearchUrl;\n }\n catch (err) {\n console.warn(err);\n }\n performingSearch.value = false;\n if (_scheduleNextSearch) {\n _scheduleNextSearch = false;\n return commitSearch();\n }\n }\n return (_ctx, _cache) => {\n return (_openBlock(), _createElementBlock(_Fragment, null, [\n (isMobile.value && !searchVisible.value)\n ? (_openBlock(), _createBlock(_unref(ThemeButton), {\n key: 0,\n class: _normalizeClass([\"siteSearch-mobileToggleBtn\", { 'is--mobile': isMobile.value }]),\n title: \"Sökalternativ\",\n color: \"neutral\",\n fill: \"outline\",\n size: \"small\",\n \"icon-after\": \"chevron-right\",\n variation: \"chip\",\n onClick: _cache[0] || (_cache[0] = ($event) => (searchVisible.value = true))\n }, null, 8, [\"class\"]))\n : _createCommentVNode(\"\", true),\n (searchVisible.value)\n ? (_openBlock(), _createElementBlock(\"div\", {\n key: 1,\n class: _normalizeClass([\"siteSearch\", { 'has--dates': _unref(listingConfig).dateSearch }])\n }, [\n _createElementVNode(\"div\", _hoisted_1, [\n _cache[11] || (_cache[11] = _createElementVNode(\"label\", null, \"Sök efter innehåll\", -1)),\n _createElementVNode(\"div\", _hoisted_2, [\n _withDirectives(_createElementVNode(\"input\", {\n type: \"text\",\n class: \"siteSearch-inputField-input\",\n \"onUpdate:modelValue\": _cache[1] || (_cache[1] = ($event) => ((searchArgs.searchQuery) = $event)),\n placeholder: \"Sök här...\",\n ref: \"ownQueryInputEl\",\n onKeydown: _cache[2] || (_cache[2] = _withKeys(() => commitSearch(), [\"enter\"]))\n }, null, 544), [\n [_vModelText, searchArgs.searchQuery]\n ]),\n _createVNode(_unref(ThemeIcon), {\n class: \"siteSearch-inputField-icon\",\n name: \"magnifying-glass\"\n }),\n (searchArgs.searchQuery)\n ? (_openBlock(), _createBlock(_unref(ThemeButton), {\n key: 0,\n class: \"siteSearch-inputField-emptyBtn\",\n \"wca-title\": \"Empty search\",\n icon: \"times-round-outline\",\n color: \"primary\",\n fill: \"none\",\n onClick: clearSearchQuery\n }))\n : _createCommentVNode(\"\", true)\n ])\n ]),\n (_unref(listingConfig).dateSearch)\n ? (_openBlock(), _createElementBlock(\"div\", _hoisted_3, [\n (_unref(listingConfig).postType === 'skp_rnd_thesis')\n ? (_openBlock(), _createElementBlock(\"label\", _hoisted_4, [\n _createElementVNode(\"span\", {\n role: \"button\",\n tabindex: \"0\",\n class: _normalizeClass({ 'is--active': !searchArgs.dateMode }),\n onClick: _cache[3] || (_cache[3] = ($event) => (searchArgs.dateMode = null))\n }, \"Publiceringsdatum\", 2),\n _cache[12] || (_cache[12] = _createElementVNode(\"span\", null, \"/\", -1)),\n _createElementVNode(\"span\", {\n role: \"button\",\n tabindex: \"0\",\n class: _normalizeClass({ 'is--active': searchArgs.dateMode === 'disputationsdatum' }),\n onClick: _cache[4] || (_cache[4] = ($event) => (searchArgs.dateMode = 'disputationsdatum'))\n }, \"Disputationsdatum\", 2)\n ]))\n : (_openBlock(), _createElementBlock(\"label\", _hoisted_5, \"Publiceringsdatum\")),\n (VueDatePicker.value)\n ? (_openBlock(), _createElementBlock(\"div\", _hoisted_6, [\n _createVNode(_unref(VueDatePicker), {\n modelValue: searchArgs.dateFrom,\n \"onUpdate:modelValue\": _cache[5] || (_cache[5] = ($event) => ((searchArgs.dateFrom) = $event)),\n placeholder: \"Från datum\",\n \"model-type\": \"yyyy-MM-dd\",\n format: \"yyyy-MM-dd\",\n \"week-numbers\": \"local\",\n \"start-date\": dateRange.from || undefined,\n \"min-date\": dateRange.from || '2000-01-01',\n \"max-date\": dateRange.to ? new Date(dateRange.to) : searchArgs.dateTo ? new Date(searchArgs.dateTo) : new Date(),\n \"enable-time-picker\": false,\n locale: \"sv\",\n \"cancel-text\": \"Avbryt\",\n \"select-text\": \"Välj\",\n \"now-button-label\": \"Idag\",\n \"week-num-name\": \"v.\"\n }, null, 8, [\"modelValue\", \"start-date\", \"min-date\", \"max-date\"]),\n _createVNode(_unref(ThemeIcon), { name: \"arrow-right-long\" }),\n _createVNode(_unref(VueDatePicker), {\n modelValue: searchArgs.dateTo,\n \"onUpdate:modelValue\": _cache[6] || (_cache[6] = ($event) => ((searchArgs.dateTo) = $event)),\n placeholder: \"Till datum\",\n \"model-type\": \"yyyy-MM-dd\",\n format: \"yyyy-MM-dd\",\n \"week-numbers\": \"local\",\n \"start-date\": dateRange.to || undefined,\n \"min-date\": dateRange.from ? new Date(dateRange.from) : searchArgs.dateFrom ? new Date(searchArgs.dateFrom) : '',\n \"max-date\": dateRange.to || new Date(),\n \"enable-time-picker\": false,\n locale: \"sv\",\n \"cancel-text\": \"Avbryt\",\n \"select-text\": \"Välj\",\n \"now-button-label\": \"Idag\",\n \"week-num-name\": \"v.\"\n }, null, 8, [\"modelValue\", \"start-date\", \"min-date\", \"max-date\"])\n ]))\n : _createCommentVNode(\"\", true)\n ]))\n : _createCommentVNode(\"\", true),\n _createElementVNode(\"div\", _hoisted_7, [\n (_unref(hasTopics))\n ? (_openBlock(), _createElementBlock(\"label\", _hoisted_8, \"Ämne\"))\n : _createCommentVNode(\"\", true),\n _createElementVNode(\"div\", _hoisted_9, [\n (_unref(hasTopics))\n ? (_openBlock(), _createElementBlock(\"button\", {\n key: 0,\n class: \"siteSearch-fauxSelect\",\n onClick: _cache[7] || (_cache[7] = _withModifiers(($event) => (showTopicSelectionUI()), [\"prevent\"]))\n }, [\n _createElementVNode(\"span\", null, _toDisplayString(searchArgs.selectedTopicsIds.length\n ? `${searchArgs.selectedTopicsIds.length} ${searchArgs.selectedTopicsIds.length === 1\n ? 'valt' : 'valda'}` : 'Välj...'), 1),\n _createVNode(_unref(ThemeIcon), { name: \"chevron-down\" })\n ]))\n : _createCommentVNode(\"\", true),\n (fullSearchUrl.value)\n ? (_openBlock(), _createBlock(_unref(ThemeButton), {\n key: 1,\n type: \"link\",\n class: _normalizeClass({ 'is--disabled': !hasAnySearchArgs.value }),\n fill: \"outline\",\n title: \"Se fler\",\n \"icon-after\": \"arrow-right-long\",\n href: fullSearchUrl.value\n }, null, 8, [\"class\", \"href\"]))\n : _createCommentVNode(\"\", true),\n (isMobile.value && searchVisible.value)\n ? (_openBlock(), _createBlock(_unref(ThemeButton), {\n key: 2,\n color: \"neutral\",\n wcaTitle: \"Dölj sökalternativ\",\n fill: \"outline\",\n icon: \"times\",\n onClick: _cache[8] || (_cache[8] = ($event) => (searchVisible.value = false))\n }))\n : _createCommentVNode(\"\", true)\n ])\n ]),\n (_unref(topicsData))\n ? (_openBlock(), _createBlock(_unref(ThemeModal), {\n key: 1,\n ref_key: \"topicsModal\",\n ref: topicsModal,\n classes: \"topicsModal\",\n title: `Välj ${_unref(topicsData).label}`,\n actions: [\n { title: 'Avbryt', handler: 'dismiss', color: 'neutral', iconAfter: 'times' },\n {\n title: pendingTopicsIds.value.length ? `Välj ${pendingTopicsIds.value.length}st` : 'Välj',\n handler: () => applyTopicsSelection(),\n iconAfter: 'check',\n fill: 'solid',\n },\n ],\n onShown: onTopicsModalShown\n }, {\n default: _withCtx(() => [\n _createElementVNode(\"div\", _hoisted_10, [\n _withDirectives(_createElementVNode(\"input\", {\n type: \"text\",\n ref_key: \"topicsModalInput\",\n ref: topicsModalInput,\n class: _normalizeClass({ 'is--active': searchArgs.topicsSearch }),\n \"onUpdate:modelValue\": _cache[9] || (_cache[9] = ($event) => ((searchArgs.topicsSearch) = $event))\n }, null, 2), [\n [_vModelText, searchArgs.topicsSearch]\n ]),\n _createVNode(_unref(ThemeIcon), { name: \"magnifying-glass\" })\n ]),\n _createElementVNode(\"div\", _hoisted_11, [\n (_openBlock(true), _createElementBlock(_Fragment, null, _renderList(prepareModalTopics(_unref(topicsData).list), (entry) => {\n return _withDirectives((_openBlock(), _createElementBlock(\"label\", _hoisted_12, [\n _createElementVNode(\"input\", {\n type: \"checkbox\",\n checked: pendingTopicsIds.value.findIndex(v => v === entry.id) >= 0,\n onChange: ($event) => (onTopicSelectionChange($event, entry))\n }, null, 40, _hoisted_13),\n _createVNode(_unref(ThemeIcon), { name: \"check\" }),\n _createElementVNode(\"span\", {\n innerHTML: entry.label\n }, null, 8, _hoisted_14)\n ], 512)), [\n [_vShow, entry.visible]\n ]);\n }), 256))\n ]),\n _createVNode(_unref(ThemeButton), {\n class: \"topicsModal-uncheckBtn\",\n title: \"Avmarkera alla\",\n color: \"light\",\n size: \"small\",\n disabled: !pendingTopicsIds.value.length,\n onClick: _cache[10] || (_cache[10] = ($event) => (searchArgs.selectedTopicsIds = []))\n }, null, 8, [\"disabled\"])\n ]),\n _: 1\n }, 8, [\"title\", \"actions\"]))\n : _createCommentVNode(\"\", true)\n ], 2))\n : _createCommentVNode(\"\", true)\n ], 64));\n };\n }\n});\n","import script from \"./PrimaryListSearchApp.vue?vue&type=script&lang=ts&setup=true\"\nexport * from \"./PrimaryListSearchApp.vue?vue&type=script&lang=ts&setup=true\"\n\nconst __exports__ = script;\n\nexport default __exports__","import { ThemeModule } from '../../front/lib/ThemeModule';\nimport { createApp } from 'vue';\nimport PrimaryListSearchApp from './PrimaryListSearchApp.vue';\nexport class ArticlesGrid extends ThemeModule {\n init() {\n if (this.json.primarySearch.enabled) {\n const rootEl = this.getElementById('primarySearch');\n if (rootEl) {\n this.initSearch(rootEl);\n }\n }\n }\n initSearch(rootEl) {\n const app = createApp(PrimaryListSearchApp, { mod: this });\n app.mount(rootEl);\n }\n setBusyStatus(busy) {\n if (busy) {\n this.root.classList.add('is--busy');\n }\n else {\n this.root.classList.remove('is--busy');\n }\n }\n replaceSearchResults(rawHtml) {\n // Parse the raw HTML string into a document fragment\n // then extract and replace the featured and list sections\n // let browser handle all GC\n const tpl = document.createElement('template');\n tpl.innerHTML = rawHtml;\n const fragments = [].slice.apply(tpl.content.children).filter((el) => el instanceof HTMLElement);\n for (const fragment of fragments) {\n if (['featured', 'list'].includes(fragment.dataset.section || '')) {\n const replacementTarget = this.querySelector(`[data-section=\"${fragment.dataset.section}\"]`);\n if (replacementTarget) {\n replacementTarget.replaceWith(fragment);\n }\n }\n }\n }\n}\n","var _a;\nimport 'wicg-inert';\nimport { Theme } from './front/Theme';\nimport { Advert } from './modules/Advert/Advert';\nimport { SiteHeader } from './modules/SiteHeader/SiteHeader';\nimport { FactsBox } from './modules/FactsBox/FactsBox';\nimport { FaqList } from './modules/FaqList/FaqList';\nimport { Newsletter } from \"./modules/Newsletter/Newsletter\";\nimport { SharingButtons } from './modules/SharingButtons/SharingButtons';\nimport { ConferenceBookingBtn } from './modules/ConferenceBookingBtn/ConferenceBookingBtn';\nimport { ConferenceProgramme } from \"./modules/ConferenceProgramme/ConferenceProgramme\";\nimport { MagazineIssuesList } from \"./modules/MagazineIssuesList/MagazineIssuesList\";\nimport { Card } from \"./modules/Card/Card\";\nimport { SliderCards } from \"./modules/SliderCards/SliderCards\";\nimport { Cta } from './modules/Cta/Cta';\nimport { InnerContainer } from './modules/InnerContainer/InnerContainer';\nimport { RelatedContent } from './modules/RelatedContent/RelatedContent';\nimport { Single } from './layouts/Single/Single';\nimport { SingleArticle } from './layouts/SingleArticle/SingleArticle';\nimport { ListJobs } from \"./layouts/ListJobs/ListJobs\";\nimport { SingleCourse } from \"./layouts/SingleCourse/SingleCourse\";\nimport { Search } from './layouts/Search/Search';\nimport { initCacheControls } from './front/admin/cache-controls';\nimport { onDocumentReady } from './front/lib/utils';\nimport { ListArticles } from './layouts/ListArticles/ListArticles';\nimport { ArticlesGrid } from './modules/ArticlesGrid/ArticlesGrid';\nif (((_a = document.documentElement.dataset) === null || _a === void 0 ? void 0 : _a.state) !== 'SystemError') {\n onDocumentReady(init);\n}\nfunction init() {\n Theme.init({\n modules: {\n Advert,\n ArticlesGrid,\n FactsBox,\n FaqList,\n SiteHeader,\n Newsletter,\n SharingButtons,\n ConferenceProgramme,\n ConferenceBookingBtn,\n SliderCards,\n MagazineIssuesList,\n Card,\n Cta,\n InnerContainer,\n RelatedContent,\n },\n layouts: {\n ListJobs,\n SingleCourse,\n Search,\n SingleArticle,\n Single,\n ListArticles,\n },\n });\n if (document.body.classList.contains('logged-in')) {\n initCacheControls();\n }\n document.documentElement.classList.remove('is--loading');\n}\n","'use strict';\n\nvar bind = require('function-bind');\n\nvar $apply = require('./functionApply');\nvar $call = require('./functionCall');\nvar $reflectApply = require('./reflectApply');\n\n/** @type {import('./actualApply')} */\nmodule.exports = $reflectApply || bind.call($call, $apply);\n","'use strict';\n\n/** @type {import('./functionApply')} */\nmodule.exports = Function.prototype.apply;\n","'use strict';\n\n/** @type {import('./functionCall')} */\nmodule.exports = Function.prototype.call;\n","'use strict';\n\nvar bind = require('function-bind');\nvar $TypeError = require('es-errors/type');\n\nvar $call = require('./functionCall');\nvar $actualApply = require('./actualApply');\n\n/** @type {import('.')} */\nmodule.exports = function callBindBasic(args) {\n\tif (args.length < 1 || typeof args[0] !== 'function') {\n\t\tthrow new $TypeError('a function is required');\n\t}\n\treturn $actualApply(bind, $call, args);\n};\n","'use strict';\n\n/** @type {import('./reflectApply')} */\nmodule.exports = typeof Reflect !== 'undefined' && Reflect && Reflect.apply;\n","'use strict';\n\nvar GetIntrinsic = require('get-intrinsic');\n\nvar callBindBasic = require('call-bind-apply-helpers');\n\n/** @type {(thisArg: string, searchString: string, position?: number) => number} */\nvar $indexOf = callBindBasic([GetIntrinsic('%String.prototype.indexOf%')]);\n\n/** @type {import('.')} */\nmodule.exports = function callBoundIntrinsic(name, allowMissing) {\n\t// eslint-disable-next-line no-extra-parens\n\tvar intrinsic = /** @type {Parameters