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,IAAMJ,EAAUG,EAAIC,EAAS,IAAMJ,EAAUG,EAAIC,EAAS,IAAM,IAAMJ,EAAUG,EAAIC,EAAS,KAAOJ,EAAUG,EAAIC,EAAS,KAAOJ,EAAUG,EAAIC,EAAS,KAAOJ,EAAUG,EAAIC,EAAS,KAAOJ,EAAUG,EAAIC,EAAS,KAAOJ,EAAUG,EAAIC,EAAS,MAAMrB,cAMzf,IAAKuB,EAASR,GACZ,MAAMS,UAAU,+BAGlB,OAAOT,CACR,EEJD,MApBA,SAAYrQ,EAAS+Q,EAAKJ,GAExB,IAAIK,GADJhR,EAAUA,GAAW,CAAC,GACH4J,SAAW5J,EAAQkQ,KAAOA,KAK7C,GAHAc,EAAK,GAAe,GAAVA,EAAK,GAAY,GAC3BA,EAAK,GAAe,GAAVA,EAAK,GAAY,IAEvBD,EAAK,CACPJ,EAASA,GAAU,EAEnB,IAAK,IAAIxI,EAAI,EAAGA,EAAI,KAAMA,EACxB4I,EAAIJ,EAASxI,GAAK6I,EAAK7I,GAGzB,OAAO4I,CACR,CAED,OAAOE,EAAUD,EAClB,C","sources":["plugins/DocumentHandler/DocumentHandlerModel.js","plugins/DocumentHandler/documentSearch/DocumentSearchModel.js","plugins/DocumentHandler/documentSearch/MatchSearch.js","plugins/DocumentHandler/utils/htmlToMaterialUiParser.js","../node_modules/uuid/dist/esm-browser/rng.js","../node_modules/uuid/dist/esm-browser/regex.js","../node_modules/uuid/dist/esm-browser/stringify.js","../node_modules/uuid/dist/esm-browser/validate.js","../node_modules/uuid/dist/esm-browser/v4.js"],"sourcesContent":["import React from \"react\";\nimport htmlToMaterialUiParser from \"./utils/htmlToMaterialUiParser\";\n\nimport {\n Paragraph,\n ULComponent,\n OLComponent,\n CustomLink,\n Figure,\n Heading,\n Strong,\n Italic,\n Underline,\n Img,\n BlockQuote,\n LineBreak,\n Video,\n Audio,\n Source,\n AccordionSection,\n} from \"./utils/ContentComponentFactory\";\n\nimport DocumentSearchModel from \"./documentSearch/DocumentSearchModel\";\nimport { hfetch } from \"utils/FetchWrapper\";\n\n/**\n * @summary DocumentHandler model that doesn't do much.\n * @description This model exposes only one method, getMap(),\n * so it does not do anything crucial. But you can see it\n * as an example of how a plugin can be separated in different\n * components.\n *\n * @class DocumentHandlerModel\n */\n\nexport default class DocumentHandlerModel {\n internalId = 0;\n\n constructor(settings) {\n this.mapServiceUrl =\n settings.app.config.appConfig.proxy +\n settings.app.config.appConfig.mapserviceBase;\n this.settings = settings;\n this.app = settings.app;\n this.allDocuments = [];\n this.chaptersMatchSearch = [];\n this.chapterInfo = [];\n this.chapterNumber = 0;\n this.localObserver = settings.localObserver;\n this.options = settings.options;\n }\n\n init = () => {\n return this.getAllDocumentsContainedInMenu()\n .then((allDocuments) => {\n this.allDocuments = allDocuments;\n this.documentSearchmodel = new DocumentSearchModel({\n allDocuments: allDocuments,\n globalSearchModel: this.app.searchModel,\n app: this.app,\n localObserver: this.localObserver,\n });\n this.settings.resolveSearchInterface(\n this.documentSearchmodel.implementSearchInterface()\n );\n })\n .then(() => {\n return this;\n });\n };\n\n warnNoCustomThemeUrl = () => {\n console.warn(\n \"Could not find valid url for custom theme in documenthandler, check customThemeUrl\"\n );\n };\n\n fetchCustomThemeJson = () => {\n if (!this.options.customThemeUrl) {\n this.warnNoCustomThemeUrl();\n return Promise.resolve(\"\");\n }\n return hfetch(this.options.customThemeUrl)\n .then((res) => {\n return res.json();\n })\n .catch(() => {\n this.warnNoCustomThemeUrl();\n return null;\n });\n };\n\n flattenMenu = (menuItems) => {\n return menuItems.reduce((menu, menuItem) => {\n if (menuItem.menu && menuItem.menu.length > 0) {\n menu = [...menu, ...this.flattenMenu(menuItem.menu)];\n }\n return [...menu, menuItem];\n }, []);\n };\n\n getAllDocumentsContainedInMenu() {\n return new Promise((resolve, reject) => {\n if (this.allDocuments.length > 0) {\n resolve(this.allDocuments);\n }\n\n const menuItemsWithDocumentConnection = this.flattenMenu(\n this.settings.menu\n ).filter((menuItem) => {\n return menuItem.document;\n });\n\n Promise.all(\n menuItemsWithDocumentConnection.map((menuItem) => {\n return this.fetchJsonDocument(menuItem.document).then((doc) => {\n if (!doc.title) {\n console.warn(\n `The document ${menuItem.document} is missing a title`\n );\n }\n\n return {\n ...doc,\n documentColor: menuItem.color,\n documentFileName: menuItem.document,\n documentTitle: doc.title,\n menuItemId: menuItem.id,\n };\n });\n })\n )\n .then((documents) => {\n resolve(documents);\n })\n .catch((err) => {\n reject(err);\n });\n });\n }\n\n getDocuments(fileNames) {\n let documents = [];\n fileNames.forEach((fileName) => {\n let document = this.allDocuments.find(\n (document) => document.documentFileName === fileName\n );\n documents = [...documents, document];\n });\n\n return documents;\n }\n\n getAllChapterInfo() {\n if (this.chapterInfo.length === 0) {\n this.allDocuments.forEach((document, index) => {\n document.chapters.forEach((mainChapter) => {\n this.setChapterInfo(\n mainChapter,\n 0,\n document.documentColor,\n document.documentFileName\n );\n });\n });\n this.mergeChapterInfo();\n }\n return this.chapterInfo;\n }\n\n getParentIdentifier(chapter) {\n if (chapter.parent) {\n if (chapter.parent.headerIdentifier) {\n return chapter.parent.headerIdentifier;\n }\n return this.getParentIdentifier(chapter.parent);\n }\n }\n\n setChapterInfo(chapter, level, color, documentFileName) {\n let getParentIdentifier = this.getParentIdentifier(chapter);\n let chapterInfo = {};\n chapterInfo.documentFileName = documentFileName;\n chapterInfo.id = ++this.chapterNumber;\n chapterInfo.level = level;\n chapterInfo.html = chapter.html;\n chapterInfo.parent = chapter.parent;\n chapterInfo.color = color;\n chapterInfo.header = chapter.header;\n chapterInfo.headerIdentifier = chapter.headerIdentifier;\n chapterInfo.chosenForPrint = false;\n chapterInfo.parent = getParentIdentifier;\n\n if (chapter.chapters && chapter.chapters.length > 0) {\n chapterInfo.hasSubChapters = true;\n this.chapterInfo = [...this.chapterInfo, chapterInfo];\n level = level + 1;\n chapter.chapters.forEach((subChapter) => {\n subChapter = this.setChapterInfo(\n subChapter,\n level,\n color,\n documentFileName\n );\n });\n } else {\n chapterInfo.hasSubChapters = false;\n this.chapterInfo = [...this.chapterInfo, chapterInfo];\n }\n }\n\n mergeChapterInfo() {\n this.chapterInfo.forEach((item) => {\n if (item.hasSubChapters && item.headerIdentifier) {\n item.chapters = this.chapterInfo.filter(\n (chapterItem) => chapterItem.parent === item.headerIdentifier\n );\n this.chapterInfo = this.chapterInfo.filter(\n (chapterItem) => chapterItem.parent !== item.headerIdentifier\n );\n }\n });\n }\n\n getChapterById(chapters, id) {\n for (let i = 0; i < chapters.length; i++) {\n if (chapters[i].id === id) {\n return chapters[i];\n } else if (chapters[i].chapters && chapters[i].chapters.length > 0) {\n let foundSubChapter = this.getChapterById(chapters[i].chapters, id);\n if (foundSubChapter) {\n return foundSubChapter;\n }\n }\n }\n }\n\n async fetchJsonDocument(title) {\n let response;\n try {\n response = await hfetch(\n `${this.mapServiceUrl}/informative/load/${title}`\n );\n const text = await response.text();\n if (text === \"File not found\") {\n throw new Error(\n `Could not find document with title ${title} in folder with documents`\n );\n }\n const document = await JSON.parse(text);\n this.internalId = 0;\n document.chapters.forEach((chapter) => {\n this.setParentChapter(chapter, undefined);\n this.setInternalId(chapter);\n this.setScrollReferences(chapter);\n this.appendComponentsToChapter(chapter);\n this.internalId = this.internalId + 1;\n });\n\n return document;\n } catch (err) {\n console.warn(\n `Kunde inte parsa JSON-dokumentet ${document}, kontrollera så att filen finns och är en .json-fil `\n );\n throw new Error(err);\n }\n }\n\n findChapters = (chapters, headerIdentifierToFind) => {\n return chapters.reduce((chaptersFound, chapter) => {\n if (chapter.chapters && chapter.chapters.length > 0) {\n chaptersFound = [\n ...chaptersFound,\n ...this.findChapters(chapter.chapters, headerIdentifierToFind),\n ];\n }\n if (chapter.headerIdentifier === headerIdentifierToFind) {\n return [...chaptersFound, chapter];\n }\n return chaptersFound;\n }, []);\n };\n\n /**\n * @summary method to find a certain chapter in a fetched document with a unique headerGUID.\n * it is used when user clicks a text-link to a certain document and header in the text in the document-window\n *\n * @memberof DocumentHandlerModel\n */\n getHeaderRef = (activeDocument, headerIdentifierToFind) => {\n const foundChapters = this.findChapters(\n activeDocument.chapters,\n headerIdentifierToFind\n );\n\n if (foundChapters.length > 1) {\n throw new Error(\"Two chapters with same header identifier found\");\n } else {\n return foundChapters[0];\n }\n };\n\n /**\n * @summary Dynamically adds a React referenceObject to each chapter in fetched document.\n * it is used by scrollIntoView in the plugin to be able to scroll to a certain chapter/header\n *\n * @memberof DocumentHandlerModel\n */\n setScrollReferences = (chapter) => {\n chapter.scrollRef = React.createRef();\n if (chapter.chapters.length > 0) {\n chapter.chapters.forEach((child) => {\n this.setScrollReferences(child);\n });\n }\n };\n\n setInternalId(chapter) {\n chapter.id = this.internalId;\n if (chapter.chapters.length > 0) {\n chapter.chapters.forEach((child) => {\n this.internalId = this.internalId + 1;\n this.setInternalId(child);\n });\n }\n }\n\n getCustomLink = (e) => {\n return (\n \n );\n };\n\n /**\n * Private help method that adds all allowed html tags.\n *\n * @memberof Contents\n */\n getTagSpecificCallbacks = () => {\n let allowedHtmlTags = [];\n allowedHtmlTags.push({\n tagType: \"br\",\n callback: () => {\n return ;\n },\n });\n allowedHtmlTags.push({\n tagType: \"ul\",\n callback: (e) => {\n return ;\n },\n });\n allowedHtmlTags.push({\n tagType: \"ol\",\n callback: (e) => ,\n });\n allowedHtmlTags.push({\n tagType: \"li\",\n callback: () => {},\n });\n allowedHtmlTags.push({\n tagType: \"blockquote\",\n callback: (e) => {\n if (e.attributes[\"data-accordion\"]?.value === \"true\") {\n return (\n \n );\n } else {\n return (\n \n );\n }\n },\n });\n allowedHtmlTags.push({\n tagType: \"h1\",\n callback: (e) => {\n return ;\n },\n });\n allowedHtmlTags.push({\n tagType: \"h2\",\n callback: (e) => {\n return ;\n },\n });\n allowedHtmlTags.push({\n tagType: \"h3\",\n callback: (e) => {\n return ;\n },\n });\n allowedHtmlTags.push({\n tagType: \"h4\",\n callback: (e) => {\n return ;\n },\n });\n allowedHtmlTags.push({\n tagType: \"h5\",\n callback: (e) => {\n return ;\n },\n });\n allowedHtmlTags.push({\n tagType: \"h6\",\n callback: (e) => {\n return ;\n },\n });\n allowedHtmlTags.push({\n tagType: \"a\",\n callback: (e) => {\n this.getCustomLink.bind(this);\n return this.getCustomLink(e);\n },\n });\n allowedHtmlTags.push({\n tagType: \"img\",\n callback: (e) => {\n const dataType = e.dataset.type || \"image\";\n if (dataType === \"image\")\n return (\n \n );\n else if (dataType === \"video\")\n return (\n \n );\n else if (dataType === \"audio\")\n return (\n \n );\n },\n });\n allowedHtmlTags.push({\n tagType: \"source\",\n callback: (e) => {\n return ;\n },\n });\n allowedHtmlTags.push({\n tagType: \"p\",\n callback: (e) => {\n return ;\n },\n });\n allowedHtmlTags.push({\n tagType: \"figure\",\n callback: (e) => {\n return
;\n },\n });\n allowedHtmlTags.push({\n tagType: \"strong\",\n callback: (e) => {\n return ;\n },\n });\n allowedHtmlTags.push({\n tagType: \"u\",\n callback: (e) => {\n return ;\n },\n });\n allowedHtmlTags.push({\n tagType: \"em\",\n callback: (e) => {\n return ;\n },\n });\n\n return allowedHtmlTags;\n };\n\n getMaterialUIComponentsForChapter = (chapter) => {\n return htmlToMaterialUiParser(\n chapter.html,\n this.getTagSpecificCallbacks()\n ).map((component, index) => {\n return {component};\n });\n };\n\n hasSubChapters = (chapter) => {\n return chapter.chapters && chapter.chapters.length > 0;\n };\n\n appendComponentsToChapter = (chapter) => {\n if (this.hasSubChapters(chapter)) {\n chapter.chapters.forEach((subChapter) => {\n subChapter.components =\n this.getMaterialUIComponentsForChapter(subChapter);\n if (this.hasSubChapters(subChapter)) {\n this.appendComponentsToChapter(subChapter);\n }\n });\n }\n\n let chapterComponents = this.getMaterialUIComponentsForChapter(chapter);\n chapter.components = chapterComponents;\n };\n\n appendParsedComponentsToDocument = () => {\n const { activeDocument } = this.props;\n let content = { ...activeDocument };\n content.chapters.forEach((chapter, index) => {\n this.appendComponentsToChapter(chapter);\n });\n this.setState({ activeContent: content });\n };\n\n /**\n * @summary Dynamically adds a object to each chapter in fetched document.\n * it is used to keep track of the parent when changing menu-views in application\n *\n * @memberof DocumentHandlerModel\n */\n setParentChapter(chapter, parent) {\n chapter.parent = parent;\n if (chapter.chapters.length > 0) {\n chapter.chapters.forEach((child) => {\n this.setParentChapter(child, chapter);\n });\n }\n }\n}\n","import MatchSearch from \"./MatchSearch\";\nimport { v4 as uuidv4 } from \"uuid\";\nimport { splitAndTrimOnCommas } from \"../utils/helpers\";\nimport { decodeCommas } from \"../../../utils/StringCommaCoder\";\n\nexport default class DocumentSearchModel {\n constructor(settings) {\n this.globalSearchModel = settings.globalSearchModel;\n this.documentCollections = this.createDocumentCollectionsToSearch(\n settings.allDocuments\n );\n this.localObserver = settings.localObserver;\n this.app = settings.app;\n this.bindListenForSearchResultClick();\n }\n\n bindListenForSearchResultClick = () => {\n // The event published from the search component will be prepended\n // with \"search.featureClicked\", therefore we have to subscribe\n // to search.featureClicked.onClickName to catch the event.\n this.app.globalObserver.subscribe(\n \"search.featureClicked.documentHandlerSearchResultClicked\",\n (searchResultClick) => {\n this.localObserver.publish(\"document-link-clicked\", {\n documentName: searchResultClick.properties.documentFileName,\n headerIdentifier: searchResultClick.properties.headerIdentifier,\n });\n }\n );\n };\n\n createDocumentCollectionsToSearch = (allDocuments) => {\n return allDocuments.reduce((documentCollection, document) => {\n return [\n ...documentCollection,\n {\n documentFileName: document.documentFileName,\n documentTitle: document.documentTitle,\n features: [\n ...this.getFeatures(document.chapters, document),\n this.getSpecialTitleFeature(\n document\n ) /*We need to add a special feature that is not working the same way \n when autocomplete is initiated and when a search is initiated.*/,\n ],\n },\n ];\n }, []);\n };\n\n getFeatures = (chapters, document) => {\n return chapters.reduce((features, chapter) => {\n if (chapter.chapters) {\n features = [\n ...features,\n ...this.getFeatures(chapter.chapters, document),\n ];\n }\n features = [\n ...features,\n this.createFeatureFromChapter(chapter, document),\n ];\n return features;\n }, []);\n };\n\n /*We add a special feature to with only document.title as searchfield.\n this feature is used when user is getting an autocomplete. \n See method handleSpecialCaseWithTitleHit for more information.\n */\n\n getSpecialTitleFeature = (document) => {\n let properties = {\n header: document.documentTitle,\n geoids: [],\n headerIdentifier: document.documentTitle,\n documentTitle: document.documentTitle,\n documentFileName: document.documentFileName,\n };\n\n const id = `${document.documentTitle}${Math.floor(Math.random() * 1000)}`;\n\n return {\n type: \"Feature\",\n isTitleFeature: true,\n geometry: null,\n searchValues: [document.title],\n id: id,\n onClickName: \"documentHandlerSearchResultClicked\",\n properties: properties,\n get: (p) => properties[p],\n getGeometry: () => null,\n getId: () => id,\n setStyle: () => null,\n };\n };\n\n createFeatureFromChapter = (chapter, document) => {\n let searchValues = [];\n\n if (chapter.header) {\n searchValues.push(chapter.header);\n }\n if (chapter.keywords && chapter.keywords.length > 0) {\n searchValues = [...searchValues, ...chapter.keywords];\n }\n\n const properties = {\n header: chapter.header,\n geoids: chapter.geoids,\n headerIdentifier: chapter.headerIdentifier,\n documentTitle: document.documentTitle,\n documentFileName: document.documentFileName,\n };\n\n const id = `${chapter.headerIdentifier}${Math.floor(Math.random() * 1000)}`;\n\n return {\n type: \"Feature\",\n geometry: null,\n isTitleFeature: false,\n searchValues: searchValues,\n id: id,\n onClickName: \"documentHandlerSearchResultClicked\",\n properties: properties,\n get: (p) => properties[p],\n getGeometry: () => null,\n getId: () => id,\n setStyle: () => null,\n };\n };\n\n implementSearchInterface = () => {\n return {\n getResults: this.getResults,\n getFunctionality: this.getFunctionality,\n };\n };\n\n // getFunctionality is called by searchComponent in core (Part of searchInterface)\n // The search-component demands this method, and if it is not present in the interface,\n // the plugin will not be used in the search-component at all.\n // The getFunctionality-method is supposed to return an object as follows:\n // return {\n // name: \"TOOL DISPLAY NAME\",\n // icon: TOOL ICON,\n // type: \"EXTERNAL_PLUGIN\",\n // searchFunctionalityClickName: \"GLOBAL OBSERVER EVENT NAME\",\n // };\n // If we want to make use of the plugin in the search-component regardless (without the functionality)\n // we can just let the method return null.\n getFunctionality = () => {\n return null;\n };\n\n //Method called by searchComponent in core (Part of searchInterface)\n getResults = (searchString, searchOptions) => {\n this.matchSearch = new MatchSearch(searchOptions);\n this.searchOptions = searchOptions;\n return this.getDocumentHandlerResults(searchString);\n };\n\n getDocumentHandlerResults = (searchString) => {\n return new Promise((resolve, reject) => {\n if (searchString === \"\") {\n resolve({ featureCollections: [], errors: [] });\n }\n let possibleSearchCombinations = this.searchOptions\n .getPossibleCombinations\n ? this.globalSearchModel.getPossibleSearchCombinations(searchString)\n : [splitAndTrimOnCommas(searchString)];\n\n // The searchString will be encoded if the search has been initiated\n // by selecting an alternative in the autocomplete.\n possibleSearchCombinations =\n this.decodePotentialSpecialCharsFromFeatureProps(\n possibleSearchCombinations\n );\n\n resolve({\n featureCollections: this.getFeatureCollectionsForMatchingDocuments(\n possibleSearchCombinations\n ),\n errors: [],\n });\n });\n };\n\n decodePotentialSpecialCharsFromFeatureProps = (searchCombinations) => {\n return searchCombinations.map((combination) => {\n return combination.map((word) => {\n return decodeCommas(word);\n });\n });\n };\n\n getSearchFields = (matchedFeatures) => {\n return matchedFeatures.reduce((searchFields, feature) => {\n if (feature.matchedSearchValues.length > 0) {\n searchFields = [\n ...searchFields,\n ...this.getMockedSearchFieldForChapter(feature),\n ];\n }\n return searchFields;\n }, []);\n };\n\n /*When a search is initiated for autocomplete we search for the title of the document\n only in the special features created in getSpecialTitleFeature. When the user then\n clicks this feature in the searchresultlist, we add the documenttitle as a searchfield\n for all chapters/features in that document because we want to show the user all\n the chapters in that document*/\n\n getMatchedFeatures = (docFeatureCollection, possibleSearchCombinations) => {\n const { initiator } = this.searchOptions;\n return docFeatureCollection.features.reduce((matchedFeatures, feature) => {\n if (initiator === \"search\") {\n if (feature.isTitleFeature) {\n //If feature is a special titleFeature and we are making a search, it is not supposed to be in the resultlist\n return matchedFeatures;\n }\n feature.searchValues.push(docFeatureCollection.documentTitle);\n }\n\n if (initiator === \"autocomplete\" && !feature.isTitleFeature) {\n feature.searchValues = feature.searchValues.filter((searchValue) => {\n return searchValue !== docFeatureCollection.documentTitle;\n });\n }\n\n feature.matchedSearchValues = this.getMatchedSearchValues(\n possibleSearchCombinations,\n feature.searchValues\n );\n\n return feature.matchedSearchValues.length > 0\n ? [...matchedFeatures, feature]\n : matchedFeatures;\n }, []);\n };\n\n createFeatureCollection = (\n matchedFeatures,\n searchFields,\n docFeatureCollection\n ) => {\n return {\n value: {\n status: \"fulfilled\",\n type: \"FeatureCollection\",\n crs: { type: null, properties: { name: null } },\n features: matchedFeatures,\n numberMatched: matchedFeatures.length,\n numberReturned: matchedFeatures.length,\n timeStamp: new Date().toISOString(),\n totalFeatures: matchedFeatures.length,\n },\n source: {\n id:\n docFeatureCollection.documentTitle ||\n docFeatureCollection.documentFileName,\n caption:\n docFeatureCollection.documentTitle ||\n docFeatureCollection.documentFileName,\n displayFields: [\"header\"],\n searchFields: [...searchFields],\n },\n origin: \"DOCUMENT\",\n };\n };\n\n getFeatureCollectionsForMatchingDocuments = (possibleSearchCombinations) => {\n return this.documentCollections.reduce(\n (featureCollections, documentCollection) => {\n const matchedFeatures = this.getMatchedFeatures(\n documentCollection,\n possibleSearchCombinations\n );\n const searchFields = this.getSearchFields(matchedFeatures);\n const featureCollection = this.createFeatureCollection(\n matchedFeatures,\n searchFields,\n documentCollection\n );\n\n return featureCollection\n ? [...featureCollections, featureCollection]\n : featureCollections;\n },\n []\n );\n };\n\n getMockedSearchFieldForChapter = (feature) => {\n return feature.matchedSearchValues.reduce((searchFields, searchValue) => {\n const searchField = uuidv4();\n feature.properties[searchField] = searchValue;\n return [...searchFields, searchField];\n }, []);\n };\n\n getAllMatchedSearchValues = (word, searchValues) => {\n const allMatched = new Set();\n const matchedSearchValues = this.getMatched(word, searchValues);\n\n matchedSearchValues.forEach((matched) => {\n allMatched.add(matched);\n });\n\n return allMatched;\n };\n\n /**\n * TODO - Try to refactor, difficult though\n * If any (some-function) of the searchcombinations is hit, that is a match\n * a searchCombination can be a hit if the documentTitle is present in the combination, results in adding all as matched\n * a searchCombination can be hit if every combination has a searchhit\n */\n getMatchedSearchValues = (searchCombinations, searchValues) => {\n let allMatched = new Set();\n let match = searchCombinations.some((searchCombination) => {\n return searchCombination.every((word) => {\n let matchedSet = this.getAllMatchedSearchValues(word, searchValues);\n allMatched = new Set([...allMatched, ...matchedSet]);\n return matchedSet.size > 0;\n });\n });\n return match ? Array.from(allMatched) : [];\n };\n\n getMatched = (searchString, searchFields) => {\n return searchFields.reduce((matchedSearchFields, searchField) => {\n if (this.matchSearch.compare(searchString, searchField)) {\n return [...matchedSearchFields, searchField];\n }\n return matchedSearchFields;\n }, []);\n };\n}\n","export default class MatchSearch {\n constructor(searchOptions) {\n this.searchOptions = searchOptions;\n }\n\n getMatchRegexp = (searchString) => {\n const { wildcardAtEnd, wildcardAtStart, matchCase } = this.searchOptions;\n\n let regexpOptions = matchCase ? \"g\" : \"gi\";\n if (wildcardAtStart && !wildcardAtEnd) {\n return new RegExp(`.*${searchString}$`, regexpOptions);\n }\n\n if (!wildcardAtStart && wildcardAtEnd) {\n return new RegExp(`^${searchString}.*`, regexpOptions);\n }\n\n if (wildcardAtStart && wildcardAtEnd) {\n return new RegExp(`${searchString}`, regexpOptions);\n }\n return new RegExp(`^${searchString}$`, regexpOptions);\n };\n\n escapeSpecialChars = (string) => {\n return string.replace(/([.*+?^=!:${}()|[\\]/\\\\])/g, \"\\\\$1\");\n };\n\n compare = (searchString, searchword) => {\n const toSearchIn = this.escapeSpecialChars(searchString);\n const match = this.getMatchRegexp(toSearchIn).test(searchword);\n\n return match;\n };\n}\n","import { v4 as uuidv4 } from \"uuid\";\n\n/**\n * Default export of function that takes a html-string as input and returns array with MaterialUIComponents\n * @param {string} html String with html that needs to be converted to materialUIComponents\n * @param {Array} tagSpecificCallbacks Tags that should be interpreted to Material UI components, the rest will be ignored.\n * @returns {Array} Returns array with MaterialUI Components - see getTagSpecificCallbacks to see the translation used\n * @memberof htmlToMaterialUiParser\n */\nconst htmlToMaterialUIParser = (html, tagSpecificCallbacks) => {\n let parser = new DOMParser();\n let htmlDoc = parser.parseFromString(html, \"text/html\");\n for (const child of htmlDoc.body.children) {\n parseChild(child, tagSpecificCallbacks);\n }\n\n let generatedHtml = [...htmlDoc.body.children];\n return generatedHtml.map((tag) => {\n if (tag.callback) return tag.callback(tag);\n return null;\n });\n};\n\nconst parseChild = (child, tagSpecificCallbacks) => {\n let callbackObject = tagSpecificCallbacks.find((object) => {\n return object.tagType.toLowerCase() === child.tagName.toLowerCase();\n });\n\n // We only provide callbacks for a portion of allowed HTML\n // tags in tagSpecificCallbacks. Only supply a callback\n // if it was defined.\n child.callback = callbackObject?.callback;\n\n child.componentId = uuidv4();\n if (child.children.length > 0) {\n for (const subChild of child.children) {\n parseChild(subChild, tagSpecificCallbacks);\n }\n }\n};\n\nexport default htmlToMaterialUIParser;\n","// Unique ID creation requires a high quality random # generator. In the browser we therefore\n// require the crypto API and do not support built-in fallback to lower quality random number\n// generators (like Math.random()).\nvar getRandomValues;\nvar rnds8 = new Uint8Array(16);\nexport default function rng() {\n // lazy load so that environments that need to polyfill have a chance to do so\n if (!getRandomValues) {\n // getRandomValues needs to be invoked in a context where \"this\" is a Crypto implementation. Also,\n // find the complete implementation of crypto (msCrypto) on IE11.\n getRandomValues = typeof crypto !== 'undefined' && crypto.getRandomValues && crypto.getRandomValues.bind(crypto) || typeof msCrypto !== 'undefined' && typeof msCrypto.getRandomValues === 'function' && msCrypto.getRandomValues.bind(msCrypto);\n\n if (!getRandomValues) {\n throw new Error('crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported');\n }\n }\n\n return getRandomValues(rnds8);\n}","export default /^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;","import validate from './validate.js';\n/**\n * Convert array of 16 byte values to UUID string format of the form:\n * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX\n */\n\nvar byteToHex = [];\n\nfor (var i = 0; i < 256; ++i) {\n byteToHex.push((i + 0x100).toString(16).substr(1));\n}\n\nfunction stringify(arr) {\n var offset = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;\n // Note: Be careful editing this code! It's been tuned for performance\n // and works in ways you may not expect. See https://github.com/uuidjs/uuid/pull/434\n var uuid = (byteToHex[arr[offset + 0]] + byteToHex[arr[offset + 1]] + byteToHex[arr[offset + 2]] + byteToHex[arr[offset + 3]] + '-' + byteToHex[arr[offset + 4]] + byteToHex[arr[offset + 5]] + '-' + byteToHex[arr[offset + 6]] + byteToHex[arr[offset + 7]] + '-' + byteToHex[arr[offset + 8]] + byteToHex[arr[offset + 9]] + '-' + byteToHex[arr[offset + 10]] + byteToHex[arr[offset + 11]] + byteToHex[arr[offset + 12]] + byteToHex[arr[offset + 13]] + byteToHex[arr[offset + 14]] + byteToHex[arr[offset + 15]]).toLowerCase(); // Consistency check for valid UUID. If this throws, it's likely due to one\n // of the following:\n // - One or more input array values don't map to a hex octet (leading to\n // \"undefined\" in the uuid)\n // - Invalid input values for the RFC `version` or `variant` fields\n\n if (!validate(uuid)) {\n throw TypeError('Stringified UUID is invalid');\n }\n\n return uuid;\n}\n\nexport default stringify;","import REGEX from './regex.js';\n\nfunction validate(uuid) {\n return typeof uuid === 'string' && REGEX.test(uuid);\n}\n\nexport default validate;","import rng from './rng.js';\nimport stringify from './stringify.js';\n\nfunction v4(options, buf, offset) {\n options = options || {};\n var rnds = options.random || (options.rng || rng)(); // Per 4.4, set bits for version and `clock_seq_hi_and_reserved`\n\n rnds[6] = rnds[6] & 0x0f | 0x40;\n rnds[8] = rnds[8] & 0x3f | 0x80; // Copy bytes to buffer, if provided\n\n if (buf) {\n offset = offset || 0;\n\n for (var i = 0; i < 16; ++i) {\n buf[offset + i] = rnds[i];\n }\n\n return buf;\n }\n\n return stringify(rnds);\n}\n\nexport default v4;"],"names":["DocumentHandlerModel","constructor","settings","internalId","init","this","getAllDocumentsContainedInMenu","then","allDocuments","documentSearchmodel","DocumentSearchModel","globalSearchModel","app","searchModel","localObserver","resolveSearchInterface","implementSearchInterface","warnNoCustomThemeUrl","console","warn","fetchCustomThemeJson","options","customThemeUrl","hfetch","res","json","catch","Promise","resolve","flattenMenu","menuItems","reduce","menu","menuItem","length","findChapters","chapters","headerIdentifierToFind","chaptersFound","chapter","headerIdentifier","getHeaderRef","activeDocument","foundChapters","Error","setScrollReferences","scrollRef","React","forEach","child","getCustomLink","e","CustomLink","aTag","bottomMargin","getTagSpecificCallbacks","allowedHtmlTags","push","tagType","callback","LineBreak","ULComponent","ulComponent","OLComponent","olComponent","attributes","value","AccordionSection","blockQuoteTag","defaultColors","defaultDocumentColorSettings","BlockQuote","Heading","headingTag","bind","dataType","dataset","type","Img","componentId","imgTag","baseUrl","mapServiceUrl","Video","Audio","Source","sourceTag","Paragraph","pTag","Figure","figureTag","Strong","strongTag","Underline","uTag","Italic","emTag","getMaterialUIComponentsForChapter","htmlToMaterialUiParser","html","map","component","index","hasSubChapters","appendComponentsToChapter","subChapter","components","chapterComponents","appendParsedComponentsToDocument","props","content","setState","activeContent","config","appConfig","proxy","mapserviceBase","chaptersMatchSearch","chapterInfo","chapterNumber","reject","menuItemsWithDocumentConnection","filter","document","all","fetchJsonDocument","doc","title","documentColor","color","documentFileName","documentTitle","menuItemId","id","documents","err","getDocuments","fileNames","fileName","find","getAllChapterInfo","mainChapter","setChapterInfo","mergeChapterInfo","getParentIdentifier","parent","level","header","chosenForPrint","item","chapterItem","getChapterById","i","foundSubChapter","response","text","JSON","parse","setParentChapter","undefined","setInternalId","bindListenForSearchResultClick","globalObserver","subscribe","searchResultClick","publish","documentName","properties","createDocumentCollectionsToSearch","documentCollection","features","getFeatures","getSpecialTitleFeature","createFeatureFromChapter","geoids","Math","floor","random","isTitleFeature","geometry","searchValues","onClickName","get","p","getGeometry","getId","setStyle","keywords","getResults","getFunctionality","searchString","searchOptions","matchSearch","MatchSearch","getDocumentHandlerResults","featureCollections","errors","possibleSearchCombinations","getPossibleCombinations","getPossibleSearchCombinations","splitAndTrimOnCommas","decodePotentialSpecialCharsFromFeatureProps","getFeatureCollectionsForMatchingDocuments","searchCombinations","combination","word","decodeCommas","getSearchFields","matchedFeatures","searchFields","feature","matchedSearchValues","getMockedSearchFieldForChapter","getMatchedFeatures","docFeatureCollection","initiator","searchValue","getMatchedSearchValues","createFeatureCollection","status","crs","name","numberMatched","numberReturned","timeStamp","Date","toISOString","totalFeatures","source","caption","displayFields","origin","documentCollections","featureCollection","searchField","uuidv4","getAllMatchedSearchValues","allMatched","Set","getMatched","matched","add","some","searchCombination","every","matchedSet","size","Array","from","matchedSearchFields","compare","getMatchRegexp","wildcardAtEnd","wildcardAtStart","matchCase","regexpOptions","RegExp","escapeSpecialChars","string","replace","searchword","toSearchIn","test","parseChild","tagSpecificCallbacks","callbackObject","object","toLowerCase","tagName","children","subChild","htmlDoc","DOMParser","parseFromString","body","tag","getRandomValues","rnds8","Uint8Array","rng","crypto","msCrypto","uuid","REGEX","byteToHex","toString","substr","arr","offset","arguments","validate","TypeError","buf","rnds","stringify"],"sourceRoot":""}