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AMnE,EAAMmE,aAAe,IACjFmD,WAAkC,GAAtBtH,EAAMmE,c,gBAEjBnD,MAAG,CAACC,UAAU,sB,gBACVgD,EAAAA,EAAoB,CACjBM,kBAAmBvE,EAAMkJ,kBACzB1E,oBAAqBxE,EAAMmJ,gBAAgB3E,yBAIrDxE,EAAMoJ,mBAAiB,gBACpBlE,EAAAA,EAAG,CACAtE,MAAOZ,EAAMqJ,YACb5B,gBACsCwB,IAAlCjJ,EAAM8H,wBACA,KACA,IAAM9H,EAAM8H,wBAA0B,IAEhDR,WAA6C,GAAjCtH,EAAM8H,yB,gBAEjB9G,MAAG,CAACC,UAAU,sB,gBACVW,EAAAA,EAAoB,CACjBlB,WAAYV,EAAM8H,wBAClBnH,SAAUX,EAAMsJ,gBAChB/H,oBAAqBvB,EAAMuJ,oBAC3B7H,gBAAiB1B,EAAMwJ,gBACvB3I,oBAAqBb,EAAMyJ,oBAC3B1F,iBAAkB/D,EAAM0J,2B,gNClExD,IAEA,EAFuB1J,SAAAA,GAAS,OAAM,gBAAL2J,EAAU,KAAK3J","sources":["webpack://gyldendal-uddannelse/./src/Foundation/Frontend/ReactComponents/Search/search-pagination.js","webpack://gyldendal-uddannelse/./src/Foundation/Frontend/ReactComponents/Search/content-search-results.js","webpack://gyldendal-uddannelse/./src/Foundation/Frontend/ReactComponents/Search/product-search-results.js","webpack://gyldendal-uddannelse/./src/Foundation/Frontend/ReactComponents/Search/search-box.js","webpack://gyldendal-uddannelse/./src/Foundation/Frontend/ReactComponents/Tabs/tab.js","webpack://gyldendal-uddannelse/./src/Foundation/Frontend/ReactComponents/Tabs/tabs.js","webpack://gyldendal-uddannelse/./src/Foundation/Frontend/ReactReducers/Search/search-composer.js","webpack://gyldendal-uddannelse/./src/Foundation/Frontend/ReactComponents/Search/site-search.js","webpack://gyldendal-uddannelse/./src/Foundation/Frontend/ReactViews/SiteSearch/site-search-view.js"],"sourcesContent":["import React, { Component } from \"react\";\r\n\r\nclass SearchPagination extends Component {\r\n constructor(props) {\r\n super(props);\r\n\r\n this.onClickPrevious = this.onClickPrevious.bind(this);\r\n this.onClickNext = this.onClickNext.bind(this);\r\n }\r\n\r\n onClickPrevious() {\r\n this.props.scrollToTop();\r\n this.props.onClickPrevious();\r\n }\r\n\r\n onClickNext() {\r\n this.props.scrollToTop();\r\n this.props.onClickNext();\r\n }\r\n\r\n render() {\r\n const totalPages = Math.ceil(this.props.totalCount / this.props.pageSize);\r\n const label = this.props.paginationIndicator\r\n .replace(\"{x}\", this.props.pageIndex)\r\n .replace(\"{y}\", totalPages);\r\n\r\n return (\r\n <div className=\"searchpage-pagination\">\r\n {this.props.hasPrevious && (\r\n <button\r\n type=\"button\"\r\n className=\"button-hollow searchpage-pagination__prev\"\r\n onClick={this.onClickPrevious}\r\n aria-label={`Gå tilbage til side ${this.props.pageIndex - 1} ud af ${totalPages}`}\r\n >\r\n {this.props.previousButtonLabel}\r\n </button>\r\n )}\r\n {(this.props.hasPrevious || this.props.hasNext) && (\r\n <span className=\"searchpage-pagination__label\">{label}</span>\r\n )}\r\n {this.props.hasNext && (\r\n <button\r\n type=\"button\"\r\n className=\"button-hollow searchpage-pagination__next\"\r\n onClick={this.onClickNext}\r\n aria-label={`Gå frem til side ${this.props.pageIndex + 1} ud af ${totalPages}`}\r\n >\r\n {this.props.nextButtonLabel}\r\n </button>\r\n )}\r\n </div>\r\n );\r\n }\r\n}\r\n\r\nexport default SearchPagination;\r\n","import React, { Component } from \"react\";\r\nimport { searchComposer } from \"ReactReducers/Search/search-composer\";\r\nimport SearchPagination from \"ReactComponents/Search/search-pagination\";\r\n\r\nclass ContentSearchResults extends Component {\r\n constructor(props) {\r\n super(props);\r\n this.state = {\r\n isMounted: false\r\n };\r\n\r\n this.scrollToTop = this.scrollToTop.bind(this);\r\n }\r\n\r\n componentDidMount() {\r\n this.setState({\r\n isMounted: true\r\n });\r\n }\r\n\r\n scrollToTop() {\r\n if (!this.state.isMounted) {\r\n return;\r\n }\r\n\r\n const el = document.querySelector(\".searchpage-results__content\");\r\n\r\n if (!el) {\r\n return;\r\n }\r\n\r\n window.scrollTo({ top: el.offsetTop - 200, behavior: \"smooth\" });\r\n }\r\n\r\n render() {\r\n const resultList = this.props.contentSearchResults;\r\n\r\n return (\r\n <div className=\"searchpage-results__content\">\r\n {resultList.length > 0 ? (\r\n <div>\r\n <ul className=\"searchpage-results__content-list\">\r\n {resultList.map((result, index) => {\r\n return (\r\n <li key={index} className=\"searchpage-results__content-list__item\">\r\n <a href={result.Url}>\r\n <span dangerouslySetInnerHTML={{ __html: result.Title }} />\r\n </a>\r\n <p dangerouslySetInnerHTML={{ __html: result.Snippet }} />\r\n </li>\r\n );\r\n })}\r\n </ul>\r\n <SearchPagination\r\n hasPrevious={this.props.contentSearchHasPrevious}\r\n onClickPrevious={this.props.contentSearchPrevious}\r\n hasNext={this.props.contentSearchHasNext}\r\n onClickNext={this.props.contentSearchNext}\r\n pageIndex={this.props.contentSearchPage + 1}\r\n totalCount={this.props.totalCount}\r\n pageSize={this.props.pageSize}\r\n previousButtonLabel={this.props.previousButtonLabel}\r\n nextButtonLabel={this.props.nextButtonLabel}\r\n paginationIndicator={this.props.paginationIndicator}\r\n scrollToTop={this.scrollToTop}\r\n />\r\n </div>\r\n ) : (\r\n <div className=\"searchpage-results__empty-text\">{this.props.emptyContentText}</div>\r\n )}\r\n </div>\r\n );\r\n }\r\n}\r\n\r\nexport default searchComposer(ContentSearchResults);\r\n","import React, { Component } from \"react\";\r\nimport { searchComposer } from \"ReactReducers/Search/search-composer\";\r\nimport { productListComposer } from \"ReactReducers/ProductList/product-list-composer\";\r\nimport ProductListComponent from \"ReactComponents/ProductList/product-list-component\";\r\n\r\nclass ProductSearchResults extends Component {\r\n constructor(props) {\r\n super(props);\r\n }\r\n\r\n render() {\r\n const noSearchResults = !this.props.TotalResults && this.props.FacetGroupsActive.length == 0;\r\n return (\r\n <div className=\"searchpage-results__products\">\r\n <ProductListComponent\r\n noSearchResults={noSearchResults}\r\n noSearchResultsText={this.props.emptyProductsText}\r\n ProductDeliveryInfo={this.props.ProductDeliveryInfo}\r\n />\r\n </div>\r\n );\r\n }\r\n}\r\nexport default searchComposer(productListComposer(ProductSearchResults));\r\n","import React, { Component } from \"react\";\r\nimport IconSearch from \"ReactComponents/Shared/Icons/icon-search\";\r\nimport { searchComposer } from \"../../ReactReducers/Search/search-composer\";\r\n\r\n/**\r\n * @param SearchBoxText (string) the placeholder text\r\n *\r\n */\r\n\r\nclass SearchBox extends Component {\r\n constructor(props) {\r\n super(props);\r\n this.submitHandler = this.submitHandler.bind(this);\r\n }\r\n\r\n submitHandler(e) {\r\n e.preventDefault();\r\n\r\n if (window) {\r\n //window.location = '/soeg?q=' + this.props.query;\r\n if (window.location.pathname.indexOf(\"/soeg\") != -1) {\r\n window.history.replaceState({}, \"\", \"/soeg?q=\" + this.props.query);\r\n this.props.searchSubmit(this.props);\r\n } else {\r\n window.location = \"/soeg?q=\" + this.props.query;\r\n }\r\n }\r\n }\r\n\r\n searchChange(event) {\r\n this.props.queryChanged(event.target.value);\r\n }\r\n\r\n render() {\r\n return (\r\n <div className=\"search-box\">\r\n <form onSubmit={this.submitHandler}>\r\n <input\r\n type=\"text\"\r\n className=\"search-box__input\"\r\n placeholder={this.props.SearchBoxText}\r\n value={this.props.query}\r\n onChange={event => this.searchChange(event)}\r\n />\r\n <button aria-label=\"Søg\" type=\"submit\" className=\"search-box__submit\">\r\n <IconSearch />\r\n </button>\r\n </form>\r\n </div>\r\n );\r\n }\r\n}\r\n\r\nexport default searchComposer(SearchBox);\r\n","import React, { Component } from \"react\";\r\n\r\nclass Tab extends Component {\r\n render() {\r\n return (\r\n <div\r\n role=\"tabpanel\"\r\n id={\"panel\"}\r\n tabIndex={0}\r\n aria-labelledby={`tab-${this.props.label}`}\r\n aria-label={this.props.label}\r\n className=\"tabs__content-inner\"\r\n >\r\n {this.props.children}\r\n </div>\r\n );\r\n }\r\n}\r\n\r\nexport default Tab;\r\n","import React, { Component } from \"react\";\r\nimport classNames from \"classnames\";\r\n\r\nclass Tabs extends Component {\r\n constructor() {\r\n super();\r\n\r\n this.state = {\r\n isCurrent: 0,\r\n counter: 0\r\n };\r\n\r\n this.setCurrent = this.setCurrent.bind(this);\r\n this.onKeyDown = this.onKeyDown.bind(this);\r\n }\r\n\r\n componentDidUpdate(prevProps) {\r\n if (prevProps.initialCurrentIndex !== this.props.initialCurrentIndex) {\r\n this.setState({\r\n isCurrent: this.props.initialCurrentIndex,\r\n counter: this.props.initialCurrentIndex\r\n });\r\n }\r\n }\r\n\r\n setCurrent(tab, counter) {\r\n this.setState({\r\n isCurrent: tab,\r\n counter: counter\r\n });\r\n }\r\n\r\n onKeyDown(e) {\r\n const tabs = document.querySelectorAll('[role=\"tab\"]');\r\n\r\n let tabFocus = this.state.isCurrent;\r\n let counter = this.state.counter;\r\n\r\n const availableFocusIndex = [];\r\n\r\n tabs.forEach((item, index) => {\r\n if (!item.disabled) {\r\n availableFocusIndex.push(index);\r\n }\r\n });\r\n\r\n if (e.key === \"ArrowRight\" || e.key === \"ArrowLeft\" || e.key === \"ArrowUp\" || e.key === \"ArrowDown\") {\r\n tabs[tabFocus].setAttribute(\"tabindex\", -1);\r\n // Move right\r\n if (e.key === \"ArrowRight\" || e.key === \"ArrowUp\") {\r\n counter++;\r\n tabFocus = availableFocusIndex[counter];\r\n // If we're at the end, go to the start\r\n if (counter >= availableFocusIndex.length) {\r\n tabFocus = 0;\r\n counter = 0;\r\n }\r\n // Move left\r\n } else if (e.key === \"ArrowLeft\" || e.key === \"ArrowDown\") {\r\n counter--;\r\n tabFocus = availableFocusIndex[counter];\r\n // If we're at the start, move to the end\r\n if (counter < 0) {\r\n tabFocus = tabs.length - 1;\r\n counter = availableFocusIndex.length - 1;\r\n }\r\n }\r\n\r\n tabs[tabFocus].setAttribute(\"tabindex\", 0);\r\n tabs[tabFocus].focus();\r\n this.setCurrent(tabFocus, counter);\r\n }\r\n }\r\n\r\n componentDidMount() {\r\n const tabList = document.querySelector('[role=\"tablist\"]');\r\n tabList.addEventListener(\"keydown\", this.onKeyDown, false);\r\n }\r\n\r\n componentWillUnmount() {\r\n const tabList = document.querySelector('[role=\"tablist\"]');\r\n tabList.removeEventListener(\"keydown\", this.onKeyDown, false);\r\n }\r\n\r\n render() {\r\n const childTabs = this.props.children.filter(child => {\r\n return child != false;\r\n });\r\n\r\n return (\r\n <div role=\"tablist\" className=\"tabs-container\">\r\n <div className=\"tabs__menu\">\r\n <div className=\"tabs__menu-inner\">\r\n {childTabs.map((child, index) => {\r\n const tabClasses = classNames({\r\n tabs__menu__tab: true,\r\n active: this.state.isCurrent == index,\r\n disabled: child.props.isDisabled\r\n });\r\n return (\r\n <button\r\n role=\"tab\"\r\n aria-selected={this.state.isCurrent == index}\r\n aria-controls={\"panel\"}\r\n key={index}\r\n disabled={child.props.isDisabled}\r\n id={`tab-${child.props.label}`}\r\n className={tabClasses}\r\n onClick={child.props.isDisabled ? null : () => this.setCurrent(index)}\r\n >\r\n {child.props.label}\r\n {child.props.labelCount && <span>{child.props.labelCount}</span>}\r\n </button>\r\n );\r\n })}\r\n </div>\r\n </div>\r\n\r\n <div className=\"tabs__content\">{childTabs[this.state.isCurrent]}</div>\r\n </div>\r\n );\r\n }\r\n}\r\n\r\nexport default Tabs;\r\n","import { connect } from \"react-redux\";\r\nimport { searchSelector, searchActions as actions } from \"./search-reducer\";\r\n\r\nexport function searchComposer(Component) {\r\n const mapStateToProps = function (state) {\r\n return {\r\n query: searchSelector.query(state),\r\n pending: searchSelector.pending(state),\r\n contentSearchResults: searchSelector.contentSearchResults(state),\r\n contentSearchPage: searchSelector.contentSearchPage(state),\r\n contentSearchHasPrevious: searchSelector.contentSearchHasPrevious(state),\r\n contentSearchHasNext: searchSelector.contentSearchHasNext(state),\r\n contentSearchTotalCount: searchSelector.contentSearchTotalCount(state),\r\n\r\n productSearchResults: searchSelector.productSearchResults(state),\r\n productSearchPage: searchSelector.productSearchPage(state),\r\n productSearchHasPrevious: searchSelector.productSearchHasPrevious(state),\r\n productSearchHasNext: searchSelector.productSearchHasNext(state),\r\n productSearchTotalCount: searchSelector.productSearchTotalCount(state)\r\n };\r\n };\r\n\r\n const mapDispatchToProps = function (dispatch) {\r\n return {\r\n queryChanged: query => dispatch(actions.queryChanged(query)),\r\n searchSubmit: propsObj => dispatch(actions.searchSubmit(propsObj)),\r\n\r\n contentSearchPrevious: () => dispatch(actions.contentSearchPrevious()),\r\n contentSearchNext: () => dispatch(actions.contentSearchNext()),\r\n contentSearchSubmit: () => dispatch(actions.contentSearchSubmit()),\r\n\r\n productSearchPrevious: () => dispatch(actions.productSearchPrevious()),\r\n productSearchNext: () => dispatch(actions.productSearchNext()),\r\n productSearchSubmit: () => dispatch(actions.productSearchSubmit())\r\n };\r\n };\r\n\r\n return connect(mapStateToProps, mapDispatchToProps)(Component);\r\n}\r\n","import React, { useMemo } from \"react\";\r\nimport { searchComposer } from \"ReactReducers/Search/search-composer\";\r\nimport { productListComposer } from \"ReactReducers/ProductList/product-list-composer\";\r\nimport Tabs from \"ReactComponents/Tabs/tabs\";\r\nimport Tab from \"ReactComponents/Tabs/tab\";\r\nimport SearchBox from \"ReactComponents/Search/search-box\";\r\nimport ProductSearchResults from \"ReactComponents/Search/product-search-results\";\r\nimport ContentSearchResults from \"ReactComponents/Search/content-search-results\";\r\n\r\nfunction SiteSearch(props) {\r\n const initialCurrentIndex = useMemo(() => {\r\n if (\r\n typeof props.TotalResults === \"undefined\" &&\r\n typeof props.contentSearchTotalCount === \"undefined\"\r\n ) {\r\n return undefined;\r\n }\r\n if (typeof props.TotalResults !== \"undefined\" && props.TotalResults > 0) {\r\n return 0; // pick first tab\r\n }\r\n if (typeof props.contentSearchTotalCount !== \"undefined\" && props.contentSearchTotalCount > 0) {\r\n return 1; // pick second tab\r\n }\r\n\r\n return undefined;\r\n }, [props.TotalResults, props.contentSearchTotalCount]);\r\n\r\n return (\r\n <div className=\"searchpage\">\r\n <div className=\"searchpage-header\">\r\n <div className=\"content-row\">\r\n <div className=\"searchpage-header__content\">\r\n <h1 className=\"content-header\">\r\n <span>{props.TitleText}</span>\r\n </h1>\r\n <SearchBox SearchBoxText={props.SearchBoxText} />\r\n </div>\r\n </div>\r\n </div>\r\n <Tabs initialCurrentIndex={initialCurrentIndex}>\r\n <Tab\r\n label={props.ProductsText}\r\n labelCount={props.TotalResults === undefined ? null : \"(\" + props.TotalResults + \")\"}\r\n isDisabled={props.TotalResults == 0}\r\n >\r\n <div className=\"searchpage-results\">\r\n <ProductSearchResults\r\n emptyProductsText={props.EmptyProductsText}\r\n ProductDeliveryInfo={props.ProductListData.ProductDeliveryInfo}\r\n />\r\n </div>\r\n </Tab>\r\n {!props.DisableSiteSearch && (\r\n <Tab\r\n label={props.ContentText}\r\n labelCount={\r\n props.contentSearchTotalCount === undefined\r\n ? null\r\n : \"(\" + props.contentSearchTotalCount + \")\"\r\n }\r\n isDisabled={props.contentSearchTotalCount == 0}\r\n >\r\n <div className=\"searchpage-results\">\r\n <ContentSearchResults\r\n totalCount={props.contentSearchTotalCount}\r\n pageSize={props.ContentPageSize}\r\n previousButtonLabel={props.PreviousButtonLabel}\r\n nextButtonLabel={props.NextButtonLabel}\r\n paginationIndicator={props.PaginationIndicator}\r\n emptyContentText={props.EmptyContentText}\r\n />\r\n </div>\r\n </Tab>\r\n )}\r\n </Tabs>\r\n </div>\r\n );\r\n}\r\n\r\nexport default searchComposer(productListComposer(SiteSearch));\r\n","import * as React from \"react\";\r\nimport SiteSearch from \"@/ReactComponents/Search/site-search\";\r\n\r\nconst SiteSearchView = props => <SiteSearch {...props} />;\r\n\r\nexport default SiteSearchView;\r\n"],"names":["SearchPagination","props","onClickPrevious","bind","onClickNext","this","scrollToTop","render","totalPages","Math","ceil","totalCount","pageSize","label","paginationIndicator","replace","pageIndex","div","className","hasPrevious","button","type","onClick","aria-label","previousButtonLabel","hasNext","span","nextButtonLabel","Component","ContentSearchResults","state","isMounted","componentDidMount","setState","el","document","querySelector","window","scrollTo","top","offsetTop","behavior","resultList","contentSearchResults","length","ul","map","result","index","li","key","a","href","Url","dangerouslySetInnerHTML","__html","Title","p","Snippet","contentSearchHasPrevious","contentSearchPrevious","contentSearchHasNext","contentSearchNext","contentSearchPage","emptyContentText","searchComposer","ProductSearchResults","noSearchResults","TotalResults","FacetGroupsActive","ProductListComponent","noSearchResultsText","emptyProductsText","ProductDeliveryInfo","productListComposer","SearchBox","submitHandler","location","SearchBoxText","value","onChange","event","searchChange","Tab","role","id","tabIndex","aria-labelledby","children","Tabs","isCurrent","counter","setCurrent","onKeyDown","componentDidUpdate","prevProps","initialCurrentIndex","tab","e","tabs","querySelectorAll","tabFocus","availableFocusIndex","forEach","item","disabled","push","setAttribute","focus","addEventListener","componentWillUnmount","removeEventListener","childTabs","filter","child","tabClasses","classNames","tabs__menu__tab","active","isDisabled","aria-selected","aria-controls","labelCount","connect","query","searchSelector","pending","contentSearchTotalCount","productSearchResults","productSearchPage","productSearchHasPrevious","productSearchHasNext","productSearchTotalCount","dispatch","queryChanged","actions","searchSubmit","propsObj","contentSearchSubmit","productSearchPrevious","productSearchNext","productSearchSubmit","useMemo","h1","TitleText","ProductsText","undefined","EmptyProductsText","ProductListData","DisableSiteSearch","ContentText","ContentPageSize","PreviousButtonLabel","NextButtonLabel","PaginationIndicator","EmptyContentText","SiteSearch"],"sourceRoot":""}