{"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///./src/styles/buttons.ts","webpack:///./src/api/query-error.ts","webpack:///./src/utils/tracking.ts","webpack:///./src/application/modules-utils.ts","webpack:///./src/components/RichText/RichText.tsx","webpack:///./src/components/Placeholder/Placeholder.tsx","webpack:///./src/styles/colors.ts","webpack:///./src/components/Spinner/Spinner.tsx","webpack:///./src/components/Anchor/Anchor.tsx","webpack:///./src/utils/motion.ts","webpack:///./src/api/hooks/useUser.ts","webpack:///./src/api/hooks/useParties.ts","webpack:///./src/view-models/MessageStatusTypes.ts","webpack:///./src/styles/breakpoints.ts","webpack:///./src/application/DocumentTitle.tsx","webpack:///./src/view-models/ModuleTypes.ts","webpack:///./src/utils/url-helpers.ts","webpack:///./src/application/Router.tsx","webpack:///./src/api/AuthProvider.tsx","webpack:///./src/modules/dynamicModulesMap.ts","webpack:///./src/components/AuthMessages/AuthMessages.tsx","webpack:///./src/components/StatusMessages/StatusMessages.tsx","webpack:///./src/styles/cookiebot-style.ts","webpack:///./src/styles/fonts/roboto-mono-v7-latin-500.woff","webpack:///./src/styles/fonts/roboto-mono-v7-latin-500.woff2","webpack:///./src/styles/fonts/roboto-mono-v7-latin-regular.woff","webpack:///./src/styles/fonts/roboto-mono-v7-latin-regular.woff2","webpack:///./src/styles/fonts/rubik-v9-latin-500.woff","webpack:///./src/styles/fonts/rubik-v9-latin-500.woff2","webpack:///./src/styles/fonts/rubik-v9-latin-700.woff","webpack:///./src/styles/fonts/rubik-v9-latin-700.woff2","webpack:///./src/styles/fonts/rubik-v9-latin-italic.woff","webpack:///./src/styles/fonts/rubik-v9-latin-italic.woff2","webpack:///./src/styles/fonts/rubik-v9-latin-regular.woff","webpack:///./src/styles/fonts/rubik-v9-latin-regular.woff2","webpack:///./src/styles/fonts.ts","webpack:///./src/styles/global-styles.ts","webpack:///./src/styles/theme.ts","webpack:///./src/components/SkipLink/SkipLink.tsx","webpack:///./src/application/ErrorBoundary.tsx","webpack:///./src/application/Modules.tsx","webpack:///./src/utils/scroll-to-element.ts","webpack:///./src/application/ScrollRestoration.tsx","webpack:///./src/styles/emotion-cache.ts","webpack:///./src/application/App.tsx","webpack:///./src/application/sentry.ts","webpack:///./src/utils/polyfills.ts","webpack:///./src/client.tsx","webpack:///./src/utils/polyfills/shims.ts","webpack:///./src/styles/typography.ts","webpack:///./src/api/hooks/usePageData.tsx","webpack:///./src/hooks/helpers/interpolate.ts","webpack:///./src/hooks/useDictionary.tsx","webpack:///./src/api/fetcher.ts"],"names":["webpackJsonpCallback","data","moduleId","chunkId","chunkIds","moreModules","executeModules","i","resolves","length","Object","prototype","hasOwnProperty","call","installedChunks","push","modules","parentJsonpFunction","shift","deferredModules","apply","checkDeferredModules","result","deferredModule","fulfilled","j","depId","splice","__webpack_require__","s","installedModules","7","exports","module","l","e","promises","installedChunkData","promise","Promise","resolve","reject","onScriptComplete","script","document","createElement","charset","timeout","nc","setAttribute","src","p","jsonpScriptSrc","error","Error","event","onerror","onload","clearTimeout","chunk","errorType","type","realSrc","target","message","name","request","undefined","setTimeout","head","appendChild","all","m","c","d","getter","o","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","object","property","oe","err","console","jsonpArray","window","oldJsonpFunction","slice","ButtonVariant","buttons","Primary","background","Colors","White","border","textTransform","fontWeight","FontWeight","Medium","letterSpacing","paddingTop","paddingBottom","lineHeight","fontSize","rem","color","Black","borderColor","transition","LightGrey","BattleshipGrey","Secondary","Flat","Link","textDecoration","handleQueryError","logMessage","status","withScope","scope","setTag","setExtra","response","details","captureMessage","Severity","Warning","PlausibleGoals","instance","initPlausible","domain","Plausible","trackLocalhost","enableAutoPageviews","trackEvent","eventName","options","eventData","preloadModules","a","loadedModules","dynamicModulesMap","require","default","item","loader","RichTextHtml","memo","children","variant","params","headingsOffset","rest","trimmedHtml","replace","split","join","trim","sx","mt","mb","parseHtml","replaceHTML","attribs","parent","hasInterpolationValue","interpolate","keys","forEach","asString","domToReact","level","Math","min","parseInt","substr","element","as","TextVariant","H4","H3","my","RichText","test","defaultProps","Paragraph","Placeholder","className","size","css","position","height","maxHeight","colors","VeryLightPink","PureWhite","Grey","BorderGrey","InfoGreen","DisabledGreen","DisabledGreenText","fade","keyframes","rotate","Spinner","instant","width","display","left","top","transform","transformOrigin","borderTop","borderRight","borderBottom","borderLeft","borderRadius","animationDelay","animation","willChange","Anchor","forwardRef","ref","href","label","title","onClick","replaceHistory","prefetch","external","whileHover","useRouter","pathname","search","useInView","threshold","triggerOnce","inViewRef","inView","normalized","normalizeUrl","isLocal","isLocalUrl","format","setRef","useCallback","node","current","currentPage","useEffect","prefetchPageDataCache","aria-current","rel","overflowWrap","props","url","defaultPrevented","button","metaKey","altKey","ctrlKey","shiftKey","isModifiedEvent","preventDefault","to","hash","MotionAnchor","motion","custom","displayName","div","createDomMotionComponent","span","article","header","svg","path","originalMotion","userQueryKey","useUser","useAuth","userState","updateUserState","enabled","UserState","LoggedIn","useQuery","fetcher","refetchOnWindowFocus","refetchInterval","refetchIntervalInBackground","staleTime","onError","SessionExpired","Forbidden","LoggedOut","retry","failureCount","user","userReady","isSuccess","loadParties","prefetchParties","queryCache","prefetchQuery","useParties","items","filter","party","MessageStatusTypes","Breakpoint","breakpoints","sm","md","lg","xl","DocumentTitle","usePageData","meta","metaTitle","siteName","generateTitle","ModuleTypes","fileName","externalPaths","parsed","parse","protocol","host","generateRedirectUrl","redirectUrl","location","returnUrl","includes","encodeURIComponent","URLSearchParams","set","toString","normalizePathname","addTrailingSlash","endsWith","RouteContext","createContext","Router","history","React","useRef","hydrated","useClientHydrated","createHistory","createBrowserHistory","currentHistory","useState","locationChanged","loadedLocation","listener","listen","assign","searchParams","useMemo","updateSearchParams","values","newParams","has","delete","state","Provider","action","context","useContext","AuthContext","AuthProvider","loginUrl","logoutUrl","authCookie","initialToken","setUserState","urls","setUrls","Cookies","loggedIn","configureScope","process","env","STORYBOOK","invalidateQueries","remove","ArticlePage","ContactPage","CookieDeclaration","ElectionTypePage","Footer","FrontPage","Header","HelpPage","MitIdPage","NotFound","PartyPage","ThePartiesPage","Unavailable","getModule","Modal","lazy","AuthMessages","useDictionary","showMessage","setShowMessage","fallback","isOpen","onDismiss","actions","variation","StatusMessageOverlay","StatusMessages","showModal","setShowModal","setOverlayMessage","isDataInitialized","messageState","cancelled","shouldShowMessage","cookieBotStyles","fonts","robotoMono_woff2","robotoMono_woff","robotoMonoMedium_woff2","robotoMonoMedium_woff","rubik_woff2","rubik_woff","rubikItalic_woff2","rubikItalic_woff","rubikMedium_woff2","rubikMedium_woff","rubikBold_woff2","rubikBold_woff","theme","space","sizes","container","variants","px","layout","grid","gridGap","gridColumns","typography","SkipLink","FriendlyError","ErrorBoundary","errorInfo","this","setState","Sentry","moduleName","child","only","moduleProps","handleRetry","renderModule","id","properties","schema","dangerouslySetInnerHTML","__html","Modules","preparedModules","mod","footer","buildModuleStructure","keyMap","tabIndex","outline","flex","backgroundColor","map","moduleCount","scrollToElement","behavior","focus","getElementById","charAt","y","scrollY","focusNode","closest","scroll","scrollIntoView","block","ScrollRestoration","prevLocation","useLayoutEffect","Action","Push","emotionCache","createCache","compat","App","initialData","config","dictionary","initSentry","environment","startsWith","match","findEnvironment","dsn","ignoreErrors","blacklistUrls","integrations","release","beforeSend","hint","loadPolyfills","requestIdleCallback","cb","start","Date","now","didTimeout","timeRemaining","max","cancelIdleCallback","Element","matches","msMatchesSelector","webkitMatchesSelector","el","documentElement","contains","parentElement","parentNode","nodeType","NodeList","Array","Document","DocumentFragment","configurable","writable","argArr","arguments","docFrag","createDocumentFragment","argItem","isNode","Node","createTextNode","String","polyfills","fetch","IntersectionObserverEntry","nativeURL","URL","sp1","sp2","supportsUrlSearchParams","queryConfig","queries","cacheTime","init","JSON","querySelector","innerHTML","plausible","then","root","setPageDataCache","content","ReactDOM","hydrate","renderApp","VERSION","FontFamily","fontSizes","Heading","Body","Mono","text","H1","fontFamily","H2","Normal","Paragraph17","Paragraph12","Alert","setQueryData","loadPageData","Infinity","cacheData","getQuery","preloadedModules","Critical","missingMap","output","index","param","setExtras","missingParamHandler","isValidElement","cloneElement","Children","toArray","defaultValue","DictionaryContext","DictionaryProvider","currentItems","getProp","paths","isArray","findKeyValue","extraItems","isNested","missingKeyHandler","exists","headersToObject","headers","serializeResponse","statusText","ok","pragma","credentials","method","body","json","catch","msg","CancelledError"],"mappings":"aACE,SAASA,EAAqBC,GAQ7B,IAPA,IAMIC,EAAUC,EANVC,EAAWH,EAAK,GAChBI,EAAcJ,EAAK,GACnBK,EAAiBL,EAAK,GAIHM,EAAI,EAAGC,EAAW,GACpCD,EAAIH,EAASK,OAAQF,IACzBJ,EAAUC,EAASG,GAChBG,OAAOC,UAAUC,eAAeC,KAAKC,EAAiBX,IAAYW,EAAgBX,IACpFK,EAASO,KAAKD,EAAgBX,GAAS,IAExCW,EAAgBX,GAAW,EAE5B,IAAID,KAAYG,EACZK,OAAOC,UAAUC,eAAeC,KAAKR,EAAaH,KACpDc,EAAQd,GAAYG,EAAYH,IAKlC,IAFGe,GAAqBA,EAAoBhB,GAEtCO,EAASC,QACdD,EAASU,OAATV,GAOD,OAHAW,EAAgBJ,KAAKK,MAAMD,EAAiBb,GAAkB,IAGvDe,IAER,SAASA,IAER,IADA,IAAIC,EACIf,EAAI,EAAGA,EAAIY,EAAgBV,OAAQF,IAAK,CAG/C,IAFA,IAAIgB,EAAiBJ,EAAgBZ,GACjCiB,GAAY,EACRC,EAAI,EAAGA,EAAIF,EAAed,OAAQgB,IAAK,CAC9C,IAAIC,EAAQH,EAAeE,GACG,IAA3BX,EAAgBY,KAAcF,GAAY,GAE3CA,IACFL,EAAgBQ,OAAOpB,IAAK,GAC5Be,EAASM,EAAoBA,EAAoBC,EAAIN,EAAe,KAItE,OAAOD,EAIR,IAAIQ,EAAmB,GAKnBhB,EAAkB,CACrBiB,EAAG,GAGAZ,EAAkB,GAQtB,SAASS,EAAoB1B,GAG5B,GAAG4B,EAAiB5B,GACnB,OAAO4B,EAAiB5B,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B,GAAON,KAEhB,MAAOhD,IACT,OAAO0jB,EAGT,SAASuB,EAAkB7e,GACzB,MAAO,CACLL,OAAQK,EAASL,OACjBmf,WAAY9e,EAAS8e,WACrBzW,IAAKrI,EAAS+e,GACdzjB,KAAM0E,EAAS1E,KACfsjB,QAASD,EAAgB3e,EAAS4e,UAO/B,SAAevU,EAAtB,kC,4CAAO,WACLhC,GADK,2CAAApH,EAAA,6DAELH,EAFK,+BAEkB,GAEjB8d,EAJD,aAKH,eAAgB,mBAEhB,gBAAiB,WACjBI,OAAQ,WAERC,YAAa,eACVne,aAXA,EAWAA,EAAS8d,SASRjjB,EApBD,yBAqBHujB,OAAQpe,EAAQqe,KAAO,OAAS,OAC7Bre,GAtBA,IAuBH8d,YAvBG,SA0BkBlE,MAAMrS,EAAK1M,GA1B7B,cA0BCqE,EA1BD,gBA2BsBA,EAASof,OAAOC,OAAM,WAE/C,MAAO,MA7BJ,UA2BCD,EA3BD,QAgCDpf,EAAS+e,GAhCR,0CAiCIK,GAjCJ,iBAmCkBxS,YAAMvE,GAAnBvB,EAnCL,EAmCKA,SACFwY,EApCH,WAoCatf,EAASL,OApCtB,aAoCiCmH,IAI9BhM,EAAgB,IAAIykB,KACpB9jB,QAAU6jB,EAChBxkB,EAAM6E,OAASK,EAASL,OACxB7E,EAAMgM,SAAWA,GAAY,GAC7BhM,EAAMkF,SAAWrE,EACjBb,EAAMkF,SAAW6e,EAAkB7e,GACnClF,EAAMmF,QAAUmf,EA9Cb,kBAgDIplB,QAAQE,OAAOY,IAhDnB,6C","file":"static/scripts/client-34206046f09985fef551.js","sourcesContent":[" \t// install a JSONP callback for chunk loading\n \tfunction webpackJsonpCallback(data) {\n \t\tvar chunkIds = data[0];\n \t\tvar moreModules = data[1];\n \t\tvar executeModules = data[2];\n\n \t\t// add \"moreModules\" to the modules object,\n \t\t// then flag all \"chunkIds\" as loaded and fire callback\n \t\tvar moduleId, chunkId, i = 0, resolves = [];\n \t\tfor(;i < chunkIds.length; i++) {\n \t\t\tchunkId = chunkIds[i];\n \t\t\tif(Object.prototype.hasOwnProperty.call(installedChunks, chunkId) && installedChunks[chunkId]) {\n \t\t\t\tresolves.push(installedChunks[chunkId][0]);\n \t\t\t}\n \t\t\tinstalledChunks[chunkId] = 0;\n \t\t}\n \t\tfor(moduleId in moreModules) {\n \t\t\tif(Object.prototype.hasOwnProperty.call(moreModules, moduleId)) {\n \t\t\t\tmodules[moduleId] = moreModules[moduleId];\n \t\t\t}\n \t\t}\n \t\tif(parentJsonpFunction) parentJsonpFunction(data);\n\n \t\twhile(resolves.length) {\n \t\t\tresolves.shift()();\n \t\t}\n\n \t\t// add entry modules from loaded chunk to deferred list\n \t\tdeferredModules.push.apply(deferredModules, executeModules || []);\n\n \t\t// run deferred modules when all chunks ready\n \t\treturn checkDeferredModules();\n \t};\n \tfunction checkDeferredModules() {\n \t\tvar result;\n \t\tfor(var i = 0; i < deferredModules.length; i++) {\n \t\t\tvar deferredModule = deferredModules[i];\n \t\t\tvar fulfilled = true;\n \t\t\tfor(var j = 1; j < deferredModule.length; j++) {\n \t\t\t\tvar depId = deferredModule[j];\n \t\t\t\tif(installedChunks[depId] !== 0) fulfilled = false;\n \t\t\t}\n \t\t\tif(fulfilled) {\n \t\t\t\tdeferredModules.splice(i--, 1);\n \t\t\t\tresult = __webpack_require__(__webpack_require__.s = deferredModule[0]);\n \t\t\t}\n \t\t}\n\n \t\treturn result;\n \t}\n\n \t// The module cache\n \tvar installedModules = {};\n\n \t// object to store loaded and loading chunks\n \t// undefined = chunk not loaded, null = chunk preloaded/prefetched\n \t// Promise = chunk loading, 0 = chunk loaded\n \tvar installedChunks = {\n \t\t7: 0\n \t};\n\n \tvar deferredModules = [];\n\n \t// script path function\n \tfunction jsonpScriptSrc(chunkId) {\n \t\treturn __webpack_require__.p + \"static/scripts/\" + ({\"0\":\"shared\",\"6\":\"article-page\",\"8\":\"contact-page\",\"9\":\"cookie-declaration\",\"10\":\"election-type-page\",\"11\":\"footer\",\"12\":\"front-page\",\"13\":\"header\",\"14\":\"help-page\",\"15\":\"mit-id-page\",\"16\":\"not-found\",\"17\":\"party-page\",\"19\":\"the-parties-page\",\"20\":\"unavailable\"}[chunkId]||chunkId) + \"-\" + {\"0\":\"3f86b863192ea422298b\",\"1\":\"ae487670aa2734e024b8\",\"2\":\"51662ab0eca63bedbb3e\",\"3\":\"1cb57981c2e0be699d4a\",\"4\":\"07620f8445d33d7910e9\",\"5\":\"c2bcc1fb130420f33ef6\",\"6\":\"7d3fa30d0a3713aeea24\",\"8\":\"0d4d9ec4e86e53d869a8\",\"9\":\"7490b161e49346e2c47d\",\"10\":\"26ec76fd2d3ed31e4d20\",\"11\":\"0f558c95bb606e4693e2\",\"12\":\"b1bc910449bbb43e3cb5\",\"13\":\"5519f9d595fa146986b4\",\"14\":\"5e133614bdd13cc7ce18\",\"15\":\"43762f0e2f130decc2d7\",\"16\":\"ac3191a638ad0ff2e818\",\"17\":\"5fa34d69dc35294c1118\",\"19\":\"dd1c968f32f5d0dc3ffe\",\"20\":\"23e53c4c8e8f340e26c7\",\"22\":\"3fec6b80e6a41418ade1\",\"23\":\"a602ba0f2a467b620c9c\",\"24\":\"a60b2b4dd0c455591206\",\"25\":\"9dea68f2d1f5dd3e2e01\"}[chunkId] + \".js\"\n \t}\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n \t// This file contains only the entry chunk.\n \t// The chunk loading function for additional chunks\n \t__webpack_require__.e = function requireEnsure(chunkId) {\n \t\tvar promises = [];\n\n\n \t\t// JSONP chunk loading for javascript\n\n \t\tvar installedChunkData = installedChunks[chunkId];\n \t\tif(installedChunkData !== 0) { // 0 means \"already installed\".\n\n \t\t\t// a Promise means \"currently loading\".\n \t\t\tif(installedChunkData) {\n \t\t\t\tpromises.push(installedChunkData[2]);\n \t\t\t} else {\n \t\t\t\t// setup Promise in chunk cache\n \t\t\t\tvar promise = new Promise(function(resolve, reject) {\n \t\t\t\t\tinstalledChunkData = installedChunks[chunkId] = [resolve, reject];\n \t\t\t\t});\n \t\t\t\tpromises.push(installedChunkData[2] = promise);\n\n \t\t\t\t// start chunk loading\n \t\t\t\tvar script = document.createElement('script');\n \t\t\t\tvar onScriptComplete;\n\n \t\t\t\tscript.charset = 'utf-8';\n \t\t\t\tscript.timeout = 120;\n \t\t\t\tif (__webpack_require__.nc) {\n \t\t\t\t\tscript.setAttribute(\"nonce\", __webpack_require__.nc);\n \t\t\t\t}\n \t\t\t\tscript.src = jsonpScriptSrc(chunkId);\n\n \t\t\t\t// create error before stack unwound to get useful stacktrace later\n \t\t\t\tvar error = new Error();\n \t\t\t\tonScriptComplete = function (event) {\n \t\t\t\t\t// avoid mem leaks in IE.\n \t\t\t\t\tscript.onerror = script.onload = null;\n \t\t\t\t\tclearTimeout(timeout);\n \t\t\t\t\tvar chunk = installedChunks[chunkId];\n \t\t\t\t\tif(chunk !== 0) {\n \t\t\t\t\t\tif(chunk) {\n \t\t\t\t\t\t\tvar errorType = event && (event.type === 'load' ? 'missing' : event.type);\n \t\t\t\t\t\t\tvar realSrc = event && event.target && event.target.src;\n \t\t\t\t\t\t\terror.message = 'Loading chunk ' + chunkId + ' failed.\\n(' + errorType + ': ' + realSrc + ')';\n \t\t\t\t\t\t\terror.name = 'ChunkLoadError';\n \t\t\t\t\t\t\terror.type = errorType;\n \t\t\t\t\t\t\terror.request = realSrc;\n \t\t\t\t\t\t\tchunk[1](error);\n \t\t\t\t\t\t}\n \t\t\t\t\t\tinstalledChunks[chunkId] = undefined;\n \t\t\t\t\t}\n \t\t\t\t};\n \t\t\t\tvar timeout = setTimeout(function(){\n \t\t\t\t\tonScriptComplete({ type: 'timeout', target: script });\n \t\t\t\t}, 120000);\n \t\t\t\tscript.onerror = script.onload = onScriptComplete;\n \t\t\t\tdocument.head.appendChild(script);\n \t\t\t}\n \t\t}\n \t\treturn Promise.all(promises);\n \t};\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"/\";\n\n \t// on error function for async loading\n \t__webpack_require__.oe = function(err) { console.error(err); throw err; };\n\n \tvar jsonpArray = window[\"webpackJsonp\"] = window[\"webpackJsonp\"] || [];\n \tvar oldJsonpFunction = jsonpArray.push.bind(jsonpArray);\n \tjsonpArray.push = webpackJsonpCallback;\n \tjsonpArray = jsonpArray.slice();\n \tfor(var i = 0; i < jsonpArray.length; i++) webpackJsonpCallback(jsonpArray[i]);\n \tvar parentJsonpFunction = oldJsonpFunction;\n\n\n \t// add entry module to deferred list\n \tdeferredModules.push([247,18,21]);\n \t// run deferred modules when ready\n \treturn checkDeferredModules();\n","import { rem } from 'polished';\nimport { ObjectOrArray } from 'styled-system';\nimport { StandardProperties } from 'csstype';\n\nimport { Colors } from './colors';\nimport { FontWeight } from './typography';\n\nexport enum ButtonVariant {\n Primary = 'primary',\n Secondary = 'secondary',\n Flat = 'flat',\n Link = 'link',\n}\n\nexport const buttons: ObjectOrArray = {\n [ButtonVariant.Primary]: {\n background: Colors.White,\n border: 'solid 2px',\n textTransform: 'uppercase',\n fontWeight: FontWeight.Medium,\n letterSpacing: '1.2px',\n paddingTop: '1rem',\n paddingBottom: '1rem',\n lineHeight: 1.6,\n fontSize: rem(13),\n color: Colors.Black,\n borderColor: Colors.Primary,\n transition: 'border-color .3s ease',\n '&:hover': {\n borderColor: Colors.Black,\n },\n '&[disabled]': {\n borderColor: Colors.LightGrey,\n color: Colors.BattleshipGrey,\n },\n },\n [ButtonVariant.Secondary]: {\n background: Colors.White,\n border: 'solid 2px',\n textTransform: 'uppercase',\n fontWeight: FontWeight.Medium,\n letterSpacing: '1.2px',\n paddingTop: '1rem',\n paddingBottom: '1rem',\n lineHeight: 1.6,\n fontSize: rem(13),\n color: Colors.Secondary,\n borderColor: Colors.Secondary,\n transition: 'border-color .3s ease, color 0.3s ease',\n '&:hover': {\n color: Colors.Black,\n borderColor: Colors.Black,\n },\n '&[disabled]': {\n borderColor: Colors.LightGrey,\n color: Colors.BattleshipGrey,\n },\n },\n [ButtonVariant.Flat]: {\n color: Colors.Secondary,\n background: 'transparent',\n textTransform: 'uppercase',\n border: 'none',\n fontWeight: FontWeight.Medium,\n transition: 'color 0.3s ease',\n fontSize: rem(13),\n letterSpacing: '1.2px',\n paddingTop: '1rem',\n paddingBottom: '1rem',\n lineHeight: 1.6,\n '&:hover': {\n color: Colors.Black,\n },\n },\n [ButtonVariant.Link]: {\n color: Colors.Secondary,\n background: 'transparent',\n border: 'none',\n textDecoration: 'underline',\n textTransform: 'none',\n fontWeight: FontWeight.Medium,\n transition: 'color 0.3s ease',\n fontSize: rem(13),\n letterSpacing: '1.2px',\n lineHeight: 1,\n '&:hover': {\n color: Colors.Black,\n },\n },\n};\n\nexport default buttons;\n","import { captureMessage, Severity, withScope } from '@sentry/browser';\n\nimport { IError } from './api-types';\n\nexport function handleQueryError(err: IError) {\n let logMessage = true;\n switch (err.status) {\n case 401:\n case 403:\n case 404:\n // Don't report these errors. They are expected.\n logMessage = false;\n break;\n }\n\n if (logMessage) {\n withScope((scope) => {\n scope.setTag('type', 'fetch');\n scope.setExtra('request', err.request);\n scope.setExtra('response', err.response);\n scope.setExtra('json', err.details);\n captureMessage(err.message || 'Query error', Severity.Warning);\n });\n }\n}\n","import Plausible, { PlausibleOptions } from 'plausible-tracker';\nimport { EventOptions } from 'plausible-tracker/src/lib/request';\n\nexport enum PlausibleGoals {\n Party = 'Parti visninger',\n}\n\nlet instance: ReturnType | undefined;\n\nexport function initPlausible(domain?: string) {\n if (!domain) return;\n instance = Plausible({\n trackLocalhost: true,\n domain,\n });\n\n // This tracks the current page view and all future ones as well\n instance.enableAutoPageviews();\n}\n\nexport function trackEvent(\n eventName: PlausibleGoals | string,\n options?: EventOptions,\n eventData?: PlausibleOptions,\n) {\n if (process.env.NODE_ENV === 'development') {\n // eslint-disable-next-line no-console\n console.info('plausible', eventName, options);\n } else if (instance) {\n return instance.trackEvent(eventName, options, eventData);\n }\n}\n","import { ComponentType, FunctionComponent } from 'react';\n\nimport { ModuleViewModel } from '../view-models/ModuleViewModel';\n\nexport type ModuleInstance = ModuleViewModel & {\n module: FunctionComponent | ComponentType | undefined;\n};\n/**\n * Flatten and return all unique module names\n **/\nexport function flatModulesList(\n modules: ModuleViewModel[] = [],\n): Array {\n return Array.from(new Set(modules.map((module) => module.name)).values());\n}\n\n/**\n * Ensure the modules are ready to render, by fetching the component constructor function\n * @param modules\n */\nexport function staticModuleInstances(\n modules: Array = [],\n): ModuleInstance[] {\n if (process.env.SERVER || process.env.NODE_ENV === 'test') {\n // Ensure we only load the static modules map on the server\n const staticModulesMap = require('../modules/staticModulesMap').default;\n return modules.reduce((acc, item) => {\n const module = staticModulesMap(item.name);\n acc.push({\n ...item,\n module,\n });\n if (!module) {\n // eslint-disable-next-line no-console\n console.error(`Tried to preload unknown React module: \"${item.name}\"`);\n }\n\n return acc;\n }, []);\n }\n\n return [];\n}\n\n/**\n * Ensure the modules are ready to render, by fetching the component constructor function\n * This is done lazy when rendering client side, so we can lazy import the modules we need\n * @param modules\n */\nexport async function preloadModules(\n modules: Array = [],\n): Promise {\n const loadedModules: ModuleInstance[] = [];\n\n if (!process.env.SERVER) {\n // Ensure we only load the dynamic modules map on the client\n const dynamicModulesMap = require('../modules/dynamicModulesMap').default;\n\n for (let i = 0; i < modules.length; i++) {\n const item = modules[i];\n const loader = dynamicModulesMap(item.name);\n const module = loader ? await loader() : undefined;\n loadedModules.push({\n ...item,\n module: module && module.default,\n });\n if (!module) {\n // eslint-disable-next-line no-console\n console.error(`Tried to preload unknown React module: \"${item.name}\"`);\n }\n }\n }\n\n return loadedModules;\n}\n","import React, { memo } from 'react';\nimport { Heading, Text } from '@charlietango/ui';\nimport parseHtml, { DomElement, domToReact } from 'html-react-parser';\nimport { default as StyledSystem } from 'styled-system';\n\nimport {\n hasInterpolationValue,\n interpolate,\n} from '../../hooks/helpers/interpolate';\nimport { TextVariant } from '../../styles/typography';\nimport Anchor from '../Anchor/Anchor';\n\ntype Props = {\n className?: string;\n children?: string;\n /** Interpolation params that the should be replaced in the RichText */\n params?: Record;\n variant?: StyledSystem.ResponsiveValue;\n headingsOffset?: number;\n};\n\nconst isHtml = (html: string) => /<\\/?[a-z][\\s\\S]*>/i.test(html);\n\n/**\n * Use the `` component to convert Rich Text HTML into React components from our UI library.\n * */\nconst RichTextHtml = memo(\n ({ children, variant, params, headingsOffset = 0, ...rest }: Props) => {\n if (!children) return null;\n\n const trimmedHtml = children\n // Normalize whitespace\n .replace(/[\\f\\n\\r\\t\\v ]{2,}/g, ' ')\n // Remove linebreaks\n .split('\\n')\n .join('')\n // FIX - Umbraco insists on outputting a '/' in links, making it impossible to create valid hrefs in Rich Text with\n // interpolated values. This ensures we remove any leading \"/\" from the href=\"\" values.\n .replace(/href=\"\\/{{?\\s?(\\w+)\\s?}?}\"/g, 'href=\"{$1}\"')\n // Trim any extra whitespace\n .trim();\n\n function replaceHTML({\n attribs,\n children,\n name,\n data,\n parent,\n type,\n }: DomElement) {\n if (type === 'text') {\n if (params && hasInterpolationValue(data)) {\n return <>{interpolate(data as string, params)};\n }\n if (!parent) return false;\n }\n\n // Don't modify these tags\n if (!attribs || !name || !children) return false;\n switch (name) {\n case 'a':\n if (params) {\n Object.keys(attribs).forEach((key) => {\n if (hasInterpolationValue(attribs[key])) {\n attribs[key] = interpolate(attribs[key], {\n asString: true,\n ...params,\n });\n }\n });\n }\n return (\n \n {domToReact(children, { replace: replaceHTML })}\n \n );\n case 'h1':\n case 'h2':\n case 'h3':\n case 'h4':\n const level = Math.min(2, parseInt(name.substr(1, 1)));\n const element = `h${level + headingsOffset}`;\n\n return (\n = 3 ? TextVariant.H4 : TextVariant.H3}\n sx={{ mt: 7, mb: 4 }}\n >\n {domToReact(children, { replace: replaceHTML })}\n \n );\n case 'ul':\n case 'ol':\n case 'p':\n return (\n \n {domToReact(children, { replace: replaceHTML })}\n \n );\n case 'li':\n return (\n \n {domToReact(children, { replace: replaceHTML })}\n \n );\n }\n\n return false;\n }\n\n return (\n *:first-child': {\n mt: 0,\n },\n '> *:last-child': {\n mb: 0,\n },\n }}\n >\n {parseHtml(trimmedHtml, {\n replace: replaceHTML,\n })}\n \n );\n },\n);\n\n/**\n * The `` component takes an HTML string and renders the HTML tags using our React components.\n * If the children doesn't contain any HTML tags, it will still be wrapped in a ``,\n * so you can safely use it to render text from the CMS that may or may not be HTML.\n **/\nexport const RichText = ({\n children,\n variant,\n params,\n headingsOffset,\n ...rest\n}: Props) => {\n if (!children) return null;\n\n if (!isHtml(children)) {\n // If the children isn't actually HTML, we should just return the text wrapped in a `

`.\n return (\n \n {params ? interpolate(children, params) : children}\n \n );\n }\n\n return (\n \n {children}\n \n );\n};\n\nRichText.defaultProps = {\n variant: TextVariant.Paragraph,\n};\n\nexport default RichText;\n","import React from 'react';\n\nimport Spinner from '../Spinner/Spinner';\n\nexport type PlaceholderProps = {\n className?: string;\n size?: 'small' | 'normal' | 'fullscreen';\n};\n\n/**\n *\n * The `` is meant to be used when fetching or waiting for any of api request.\n * It can be used to substitute an area of content or the whole page if needed.\n * A spinner will be shown inside the Placeholder, and will always be centered.\n * You can style the placeholder, to accomodate the content it's substituting, with fx a custom height, or what is needed.\n */\n\nfunction Placeholder({ className, size }: PlaceholderProps) {\n if (size === 'fullscreen') {\n return (\n \n \n \n );\n }\n\n return (\n \n \n \n );\n}\n\nexport default Placeholder;\n","export enum Colors {\n Primary = 'primary',\n Secondary = 'secondary',\n Black = 'black',\n VeryLightPink = 'veryLightPink',\n White = 'white',\n LightGrey = 'lightGrey',\n Grey = 'grey',\n PureWhite = 'pureWhite',\n BorderGrey = 'borderGrey',\n InfoGreen = 'infoGreen',\n DisabledGreen = 'disabledGreen',\n DisabledGreenText = 'disabledGreenText',\n BattleshipGrey = 'battleshipGrey',\n Warning = 'warning',\n}\n\nconst colors = {\n [Colors.Primary]: '#00b9b0',\n [Colors.Secondary]: '#6d6d6d', // This replaces instances of Battleship Grey when it's used on a white background. The contrast would be too low.\n [Colors.BattleshipGrey]: '#757676',\n [Colors.Black]: '#333333',\n [Colors.VeryLightPink]: '#eeeeee', // Background color for the page, not fully White\n [Colors.White]: '#fafafa',\n [Colors.PureWhite]: '#fff',\n [Colors.LightGrey]: '#e2e2e2',\n [Colors.Grey]: '#d6d6d6',\n [Colors.PureWhite]: '#ffffff',\n [Colors.BorderGrey]: '#dde2e2',\n [Colors.InfoGreen]: '#ddf4f3',\n [Colors.DisabledGreen]: '#f2fbfb',\n [Colors.DisabledGreenText]: '#657171',\n [Colors.Warning]: '#fbf5d8',\n text: '#333333',\n background: '#fafafa',\n};\n\nexport default colors;\n","import React from 'react';\nimport { keyframes } from '@emotion/react';\nimport { rem } from 'polished';\n\ntype Props = {\n className?: string;\n instant?: boolean;\n size?: string | number;\n};\n\nconst fade = keyframes`\n 0% {\n opacity: 0;\n }\n 100% {\n opacity: 1;\n }\n`;\n\nconst rotate = keyframes`\n 0% {\n transform: rotate(0deg)\n }\n 100% {\n transform: rotate(360deg)\n }\n`;\n\nfunction Spinner({ className, instant, size = rem(56) }: Props) {\n return (\n \n \n \n );\n}\n\nexport default Spinner;\n","import React, { forwardRef, useCallback, useEffect } from 'react';\nimport { useInView } from 'react-intersection-observer';\nimport { format } from 'url';\n\nimport { prefetchPageDataCache } from '../../api/hooks/usePageData';\nimport { useRouter } from '../../application/Router';\nimport { motion } from '../../utils/motion';\nimport { isLocalUrl, normalizeUrl } from '../../utils/url-helpers';\nimport LinkViewModel from '../../view-models/LinkViewModel';\nimport { trackEvent } from '../../utils/tracking';\n\nexport type NativeMotionTypes =\n | 'style'\n | 'onUpdate'\n | 'onDragStart'\n | 'onDrag'\n | 'onDragEnd'\n | 'onAnimationStart'\n | 'onAnimationComplete'\n | 'onTap';\n\nexport type AnchorProps = LinkViewModel & {\n replaceHistory?: boolean;\n prefetch?: boolean;\n /** This Anchor is always going to be an External page */\n external?: boolean;\n /** @internal Intercept the Motion prop, so it's not added to the DOM */\n whileHover?: string;\n} & Omit, NativeMotionTypes>;\n\nfunction isModifiedEvent(event) {\n return !!(event.metaKey || event.altKey || event.ctrlKey || event.shiftKey);\n}\n\nconst Anchor = forwardRef(\n (\n {\n href,\n children,\n label,\n title,\n target,\n onClick,\n replaceHistory,\n prefetch,\n external,\n whileHover,\n ...rest\n }: AnchorProps,\n ref: any,\n ) => {\n const { replace, push, pathname, search } = useRouter();\n const [inViewRef, inView] = useInView({\n threshold: 0.5,\n triggerOnce: true,\n });\n\n const normalized = normalizeUrl(href);\n const isLocal = !external && isLocalUrl(normalized, target);\n\n if (isLocal && normalized.pathname) {\n // If the URL is relative to the current site, sanitize the href\n href = format(normalized);\n }\n\n const setRef = useCallback(\n (node) => {\n if (prefetch && isLocal) inViewRef(node);\n if (typeof ref === 'function') ref(node);\n else if (ref) ref.current = node;\n },\n [ref, inViewRef, prefetch, isLocal],\n );\n\n const currentPage =\n isLocal &&\n pathname === normalized.pathname &&\n (normalized.search ? search === normalized.search : true)\n ? 'page'\n : undefined;\n\n useEffect(() => {\n // Prefetch the next page once the link enters the viewport\n if (inView && normalized.pathname)\n prefetchPageDataCache(normalized.pathname);\n }, [inView, normalized.pathname]);\n\n const handleClick = (event) => {\n if (onClick) {\n onClick(event);\n }\n\n if (href && !isLocal) {\n trackEvent('Outbound Link: Click', { props: { url: href } });\n }\n\n if (\n href &&\n isLocal &&\n !event.defaultPrevented && // onClick prevented default\n event.button === 0 && // ignore everything but left clicks\n target !== '_blank' && // let browser handle \"target=_blank\" etc.\n !isModifiedEvent(event) // ignore clicks with modifier keys\n ) {\n // Block the normal anchor event\n event.preventDefault();\n\n // Create a To object with the URL values. This ensures the correct values are used when we update the router location.\n const to = {\n hash: normalized.hash || undefined,\n pathname: normalized.pathname || undefined,\n search: normalized.search || undefined,\n };\n\n if (replaceHistory && replace) {\n replace(to);\n } else {\n push(to);\n }\n }\n };\n\n return (\n \n {children || label}\n \n );\n },\n);\n\n/**\n * Version of the Anchor that supports framer-motion\n * */\nexport const MotionAnchor = motion.custom(Anchor);\n\nAnchor.displayName = 'Anchor';\n\nexport default Anchor;\n","import React from 'react';\n// eslint-disable-next-line no-restricted-imports\nimport {\n createDomMotionComponent,\n motion as originalMotion,\n} from 'framer-motion';\nimport { CustomDomComponent } from 'framer-motion/types/render/dom';\nimport {\n HTMLMotionComponents,\n SVGMotionComponents,\n} from 'framer-motion/types/render/dom/types';\n\ntype CustomMotionType = {\n custom: (\n Component:\n | string\n | React.ComponentClass\n | React.FunctionComponent,\n ) => CustomDomComponent;\n};\n\ntype ValidMotionTypes = CustomMotionType &\n Pick<\n HTMLMotionComponents & SVGMotionComponents,\n // List all the exported HTML/SVG tags here. This ensures\n 'div' | 'span' | 'button' | 'a' | 'article' | 'header' | 'svg' | 'path'\n >;\n\n/**\n * Export a custom motion component to enable IE11 support.\n * Make sure to always use this object\n */\nexport const motion = {\n div: createDomMotionComponent('div'),\n span: createDomMotionComponent('span'),\n button: createDomMotionComponent('button'),\n a: createDomMotionComponent('a'),\n article: createDomMotionComponent('article'),\n header: createDomMotionComponent('header'),\n svg: createDomMotionComponent('svg'),\n path: createDomMotionComponent('path'),\n custom: originalMotion.custom,\n} as ValidMotionTypes;\n\n// re-export everything\nexport * from 'framer-motion'; // eslint-disable-line no-restricted-imports\n","import { useQuery } from 'react-query';\n\nimport { SchemaFrontendUserDataViewModel } from '../api-schema';\nimport { IError } from '../api-types';\nimport { UserState, useAuth } from '../AuthProvider';\nimport { fetcher } from '../fetcher';\nimport { handleQueryError } from '../query-error';\n\n/**\n * Get the logged in user - Undefined if user is not logged in\n * */\nexport const userQueryKey = 'user';\n\nexport function useUser() {\n const { userState, updateUserState } = useAuth();\n const enabled = userState === UserState.LoggedIn;\n\n const result = useQuery(\n [userQueryKey, enabled],\n async (key) => {\n return fetcher('/api/v1/userdata');\n },\n {\n enabled,\n // Validate once focus is restored to the window\n refetchOnWindowFocus: true,\n // Validate the user every 10 minutes\n refetchInterval: 1000 * 60 * 10,\n // Don't validate in the background - User needs to interact with the site\n refetchIntervalInBackground: false,\n staleTime: 1000 * 30,\n onError: (error) => {\n handleQueryError(error);\n if (updateUserState) {\n if (error.status === 401) updateUserState(UserState.SessionExpired);\n else if (error.status === 403) updateUserState(UserState.Forbidden);\n else updateUserState(UserState.LoggedOut);\n }\n },\n retry: (failureCount, error) => {\n if (failureCount >= 2) return false;\n // Never retry if the error is because of missing credentials\n if (error.status === 401 || error.status === 403) return false;\n // retry after 5 seconds\n return true;\n },\n },\n );\n\n return {\n user: result.data,\n userReady:\n userState === UserState.LoggedIn\n ? // If the user is logged in, wait for the result\n result.isSuccess\n : // Else wait for the userState to be determined\n userState !== undefined,\n };\n}\n\nuseUser.displayName = 'useUser';\n","import { QueryResult, queryCache, useQuery } from 'react-query';\n\nimport { SchemaPartiesResponse } from '../api-schema';\nimport { ElectionType, IError } from '../api-types';\nimport { fetcher } from '../fetcher';\n\nconst queryKey = 'parties';\n\nfunction loadParties(key: string) {\n return fetcher('/api/v1/parties');\n}\n\nexport async function prefetchParties() {\n try {\n return queryCache.prefetchQuery(queryKey, loadParties, {\n staleTime: 1000 * 60 * 5,\n retry: false,\n });\n } catch (e) {}\n}\n\n/**\n * Get a list of all parties\n * */\nexport function useParties(\n type?: ElectionType,\n): QueryResult {\n const result = useQuery(queryKey, loadParties);\n\n let items = result.data?.items;\n\n if (result.data && type !== undefined) {\n items = result.data?.items?.filter((party) => party.type === type);\n return { ...result, data: { items } };\n }\n\n return result;\n}\n\nuseParties.displayName = 'useParties';\n","export enum MessageStatusTypes {\n ok = 'ok',\n error = 'error',\n cancelled = 'cancelled',\n}\n","const breakpoints = [\n '48em', // 768px - Tablets portrait and above\n '62em', // 992px - Tablets landscape and above\n '80em', // 1280px - Desktops up to 13' and above\n '90em', // 1440px - Max width, desktops HD and above\n];\n\nexport enum Breakpoint {\n sm = 'sm',\n md = 'md',\n lg = 'lg',\n xl = 'xl',\n}\n\n/**\n * Map the breakpoints to a key, so they can be used with the object syntax\n */\nbreakpoints[Breakpoint.sm] = breakpoints[0];\nbreakpoints[Breakpoint.md] = breakpoints[1];\nbreakpoints[Breakpoint.lg] = breakpoints[2];\nbreakpoints[Breakpoint.xl] = breakpoints[3];\n\nexport const queries = {\n [Breakpoint.sm]: `(min-width: ${breakpoints[0]})`,\n [Breakpoint.md]: `(min-width: ${breakpoints[1]})`,\n [Breakpoint.lg]: `(min-width: ${breakpoints[2]})`,\n [Breakpoint.xl]: `(min-width: ${breakpoints[3]})`,\n};\n\nexport type QueryMatch = {\n [key in Breakpoint]?: boolean;\n};\n\nexport default breakpoints;\n","import { useEffect } from 'react';\n\nimport usePageData from '../api/hooks/usePageData';\nimport { MetaViewModel } from '../view-models/MetaViewModel';\nimport { useRouter } from './Router';\n\nexport function generateTitle(meta: MetaViewModel): string | undefined {\n if (!meta) return '';\n return meta.title\n ? meta.title !== meta.siteName && meta.siteName\n ? `${meta.title} | ${meta.siteName}`\n : meta.title\n : meta.siteName;\n}\n\ntype Props = {\n value?: string | null;\n};\n\n/**\n * Update the document title whenever the meta data changes\n */\nfunction DocumentTitle({ value }: Props) {\n const { pathname } = useRouter();\n\n const { data } = usePageData(pathname);\n const meta = data?.meta;\n\n useEffect(() => {\n if (!meta) return;\n const metaTitle = generateTitle(meta);\n\n if (metaTitle) {\n document.title = value ? value + ' | ' + metaTitle : metaTitle;\n }\n }, [meta, value]);\n return null;\n}\n\nexport default DocumentTitle;\n","// GENERATED FILE\n// This file is automatically generated by \"create-modules.ts\" whenever you add or remove a module.\n\n/**\n * All the known modules in the application\n */\nenum ModuleTypes {\n Unknown = 'unknown',\n ArticlePage = 'ArticlePage',\n ContactPage = 'ContactPage',\n CookieDeclaration = 'CookieDeclaration',\n ElectionTypePage = 'ElectionTypePage',\n Footer = 'Footer',\n FrontPage = 'FrontPage',\n Header = 'Header',\n HelpPage = 'HelpPage',\n MitIdPage = 'MitIdPage',\n NotFound = 'NotFound',\n PartyPage = 'PartyPage',\n ThePartiesPage = 'ThePartiesPage',\n Unavailable = 'Unavailable',\n}\n\nexport default ModuleTypes;\n","import { Url, parse } from 'url';\n\n// Exclude filenames\nconst fileName = /\\/?[\\w\\d]+\\.\\w+$/;\n// These paths are always external, even if they are under our domain. `/saml` paths are where we host Nemlogin\nconst externalPaths = /^\\/(saml|api|static)/;\n\nexport function isLocalUrl(url: Url | string, target?: string): boolean {\n const parsed = typeof url === 'string' ? parse(url, false) : url;\n if (parsed.pathname) {\n if (fileName.test(parsed.pathname)) return false;\n if (externalPaths.test(parsed.pathname)) return false;\n }\n\n return !parsed.protocol && !parsed.host && (!target || target === '_self');\n}\n\nexport function generateRedirectUrl(\n url: string,\n redirectUrl: string = document.location.href,\n) {\n if (!url) {\n throw new Error('Tried to generated a redirect URL using a missing URL');\n }\n const { pathname = '/', search } = parse(redirectUrl, false);\n\n const returnUrl = pathname + (search || '');\n\n if (url.includes('##redirect##')) {\n // If the URL contains a \"##redirect\"\" variable, just replace that and return the url.\n return url.replace('##redirect##', encodeURIComponent(returnUrl));\n }\n\n const parsed = parse(url);\n const params = new URLSearchParams(parsed.search || '');\n params.set('ReturnUrl', returnUrl);\n parsed.search = params.toString();\n\n return (\n (parsed.host ? `${parsed.protocol}//${parsed.host}` : '') +\n `${parsed.pathname}?${parsed.search}`\n );\n}\n\nexport function normalizePathname(\n pathname: string | null,\n addTrailingSlash: boolean = false,\n) {\n if (!pathname) return pathname;\n if (addTrailingSlash) {\n if (!pathname.endsWith('/')) {\n return pathname + '/';\n }\n } else if (pathname !== '/' && pathname.endsWith('/')) {\n return pathname.substr(0, pathname.length - 1);\n }\n\n return pathname;\n}\n\nexport function normalizeUrl(\n url: string = '/',\n addTrailingSlash: boolean = false,\n): Url {\n const parsed = parse(url, false);\n\n parsed.pathname = normalizePathname(parsed.pathname, addTrailingSlash);\n // Remove standalone '#' - Leftover from Umbraco\n if (parsed.hash === '#') parsed.hash = '';\n\n return parsed;\n}\n","import React, {\n createContext,\n useCallback,\n useContext,\n useEffect,\n useMemo,\n useRef,\n} from 'react';\nimport { hot } from 'react-hot-loader/root';\nimport useClientHydrated from '@charlietango/use-client-hydrated';\nimport { Action, History, Location, State, To } from 'history';\nimport { ReactQueryDevtools } from 'react-query-devtools';\n\nimport usePageData from '../api/hooks/usePageData';\nimport { normalizePathname, normalizeUrl } from '../utils/url-helpers';\n\nexport type RouteContextType = {\n action: Action;\n push: (path: To, state?: State) => void;\n replace: (path: To, state?: State) => void;\n pathname: string;\n search: string;\n /** The current search params for the URL */\n searchParams?: URLSearchParams;\n /** Update a set of KeyValues in the URL */\n updateSearchParams: (values: { key: string; value?: string }[]) => void;\n location: Location;\n};\n\nexport const RouteContext = createContext(\n undefined,\n);\n\nexport type RouterProps = {\n location?: string;\n children?: React.ReactNode;\n};\n\n/***\n * Router exposes the history instance, allowing you to consume it with the Context API.\n * We are not using `react-router`, since we don't need the actual routing functionality - just the history.\n * ```\n */\nfunction Router(props: RouterProps) {\n const history = React.useRef();\n const hydrated = useClientHydrated();\n\n if (!history.current) {\n if (process.env.SERVER) {\n const createHistory = require('history').createMemoryHistory;\n\n history.current = createHistory({\n // Set the initial pathname from the current location.\n // It's important to set a valid value, since the server will crash otherwise\n initialEntries: [normalizeUrl(props.location).pathname || '/'],\n }) as History;\n } else {\n const createHistory = require('history').createBrowserHistory;\n history.current = createHistory() as History;\n if (props.location) history.current.replace(props.location);\n }\n }\n\n const currentHistory = history.current;\n const [, locationChanged] = React.useState(null);\n const loadedLocation = useRef(currentHistory.location);\n\n useEffect(() => {\n if (!history.current) return;\n const listener = history.current.listen(({ location }) => {\n if (history.current) locationChanged(location);\n });\n\n // We have been hydrated correctly now\n locationChanged(history.current.location);\n\n return () => listener();\n }, []);\n\n // Check if the page is still loading, and delay updating the location until the new data is ready.\n const { status } = usePageData(currentHistory.location.pathname, {\n // Skip this step when performing a test, since it causes an extra `act()`\n enabled:\n process.env.NODE_ENV !== 'test' && !!currentHistory.location.pathname,\n onError: () => {\n const location = currentHistory.location;\n if (location.pathname !== loadedLocation.current.pathname) {\n // If we didn't get a valid result, do a hard page refresh (but only if the page changed from the current one, e.g. don't do it on the initial route)\n window.location.assign(\n `${location.pathname}${location.search || ''}${location.hash || ''}`,\n );\n }\n },\n });\n\n if (status === 'success') {\n loadedLocation.current = currentHistory.location;\n }\n\n // We now know if the new location is ready or not. We use the currently loaded location until then.\n const location = loadedLocation.current;\n\n // Cache the search params so it's only update if the search string changes\n const searchParams = useMemo(() => new URLSearchParams(location.search), [\n location.search,\n ]);\n\n const updateSearchParams = useCallback(\n (values: { key: string; value?: string }[]) => {\n const newParams = new URLSearchParams(searchParams);\n values.forEach(({ key, value }) => {\n if (value) newParams.set(key, value);\n else if (newParams.has(key)) newParams.delete(key);\n });\n\n if (history.current) {\n const search = newParams.toString();\n const { pathname, hash, state } = loadedLocation.current;\n\n history.current.replace(\n {\n pathname,\n hash,\n search: search ? `?${search}` : undefined,\n },\n state,\n );\n }\n },\n [searchParams],\n );\n\n return (\n \n {props.children}\n {!process.env.SERVER &&\n process.env.NODE_ENV === 'development' &&\n !process.env.STORYBOOK &&\n hydrated ? (\n \n ) : null}\n \n );\n}\n\nRouter.displayName = 'Router';\n\nexport function useRouter(): RouteContextType {\n const context = useContext(RouteContext);\n if (!context) {\n throw new Error('useRouter must be used inside a valid Router');\n }\n return context;\n}\n\nexport default !process.env.HOT ? Router : hot(Router);\n","import React, { createContext, useContext, useEffect, useState } from 'react';\nimport { configureScope } from '@sentry/browser';\nimport Cookies from 'js-cookie';\nimport { queryCache } from 'react-query';\n\nimport { useRouter } from '../application/Router';\nimport { generateRedirectUrl } from '../utils/url-helpers';\n\nexport enum UserState {\n LoggedOut = 'loggedout',\n LoggedIn = 'loggedin',\n SessionExpired = 'expired',\n Forbidden = 'forbidden',\n}\n\ntype Auth = {\n /** Undefined until we know for sure if the user logged in cookie is set. */\n userState?: UserState;\n /** URL to send the user to when they need to login */\n loginUrl?: string;\n /** URL to send the user to when they need to logout */\n logoutUrl?: string;\n /** update the user state */\n updateUserState?: (state: UserState) => void;\n};\n\nexport const AuthContext = createContext({\n // Default to a logged out state if trying to render component outside the AuthContext\n userState: UserState.LoggedOut,\n});\n\ntype Props = {\n children: React.ReactNode;\n /** Name of cookie that should exist if the user is authenticated */\n authCookie?: string;\n /** Url to send the user to when they want to log in */\n loginUrl?: string;\n /** Url to send the user to when logging out */\n logoutUrl?: string;\n /** @internal */\n initialToken?: string;\n};\n\nexport type AuthUrls = {\n loginUrl?: string;\n logoutUrl?: string;\n};\n\nexport function AuthProvider({\n loginUrl,\n logoutUrl,\n authCookie,\n initialToken,\n children,\n}: Props) {\n const { pathname } = useRouter();\n const [userState, setUserState] = useState(undefined);\n const [urls, setUrls] = useState({});\n\n useEffect(() => {\n if (!authCookie) return;\n // Check if the Cookie exists. If it does, assume the user is logged in.\n if (initialToken) {\n Cookies.set(authCookie, initialToken);\n }\n\n const loggedIn = !!Cookies.get(authCookie);\n\n setUserState((state) => {\n if (state) return state;\n return loggedIn ? UserState.LoggedIn : UserState.LoggedOut;\n });\n configureScope((scope) => {\n scope.setExtra('logged-in', loggedIn);\n });\n\n if (process.env.STORYBOOK) {\n // Refresh the userdata in the storybook, since it can change value.\n queryCache.invalidateQueries('user');\n }\n\n return () => {\n if (initialToken) {\n Cookies.remove(authCookie);\n }\n };\n }, [authCookie, initialToken]);\n\n useEffect(() => {\n setUrls({\n // Format the auth urls so they contain the current redirect URL\n loginUrl: loginUrl && generateRedirectUrl(loginUrl),\n logoutUrl: logoutUrl && generateRedirectUrl(logoutUrl, '/'),\n });\n }, [pathname, loginUrl, logoutUrl]);\n\n return (\n {\n if (\n state === UserState.SessionExpired ||\n state === UserState.LoggedOut\n ) {\n if (authCookie) Cookies.remove(authCookie);\n }\n setUserState(state);\n },\n }}\n >\n {children}\n \n );\n}\n\nexport function useAuth() {\n return useContext(AuthContext);\n}\n\nuseAuth.displayName = 'useAuth';\n","// GENERATED FILE\n// This file is automatically generated by \"create-modules.ts\" whenever you add or remove a module.\n\nimport ModuleTypes from '../view-models/ModuleTypes';\n\n/**\n * List all Modules that can be imported here.\n * Use `import()` to enable async loading of only the modules we need on a page.\n */\nconst dynamicModulesMap: { [key: string]: () => Promise } = {\n [ModuleTypes.ArticlePage]: () =>\n import(/* webpackChunkName: 'article-page' */ './ArticlePage/ArticlePage'),\n [ModuleTypes.ContactPage]: () =>\n import(/* webpackChunkName: 'contact-page' */ './ContactPage/ContactPage'),\n [ModuleTypes.CookieDeclaration]: () =>\n import(\n /* webpackChunkName: 'cookie-declaration' */ './CookieDeclaration/CookieDeclaration'\n ),\n [ModuleTypes.ElectionTypePage]: () =>\n import(\n /* webpackChunkName: 'election-type-page' */ './ElectionTypePage/ElectionTypePage'\n ),\n [ModuleTypes.Footer]: () =>\n import(/* webpackChunkName: 'footer' */ './Footer/Footer'),\n [ModuleTypes.FrontPage]: () =>\n import(/* webpackChunkName: 'front-page' */ './FrontPage/FrontPage'),\n [ModuleTypes.Header]: () =>\n import(/* webpackChunkName: 'header' */ './Header/Header'),\n [ModuleTypes.HelpPage]: () =>\n import(/* webpackChunkName: 'help-page' */ './HelpPage/HelpPage'),\n [ModuleTypes.MitIdPage]: () =>\n import(/* webpackChunkName: 'mit-id-page' */ './MitIdPage/MitIdPage'),\n [ModuleTypes.NotFound]: () =>\n import(/* webpackChunkName: 'not-found' */ './NotFound/NotFound'),\n [ModuleTypes.PartyPage]: () =>\n import(/* webpackChunkName: 'party-page' */ './PartyPage/PartyPage'),\n [ModuleTypes.ThePartiesPage]: () =>\n import(\n /* webpackChunkName: 'the-parties-page' */ './ThePartiesPage/ThePartiesPage'\n ),\n [ModuleTypes.Unavailable]: () =>\n import(/* webpackChunkName: 'unavailable' */ './Unavailable/Unavailable'),\n};\n\nexport default function getModule(name: ModuleTypes) {\n return dynamicModulesMap[name];\n}\n","import React, { Suspense, useEffect, useState } from 'react';\n\nimport { UserState, useAuth } from '../../api/AuthProvider';\nimport { useDictionary } from '../../hooks/useDictionary';\nimport { ButtonVariant } from '../../styles/buttons';\nimport RichText from '../RichText/RichText';\n\nexport type AuthMessagesProps = {};\n\n// We lazy load the Modal - We most likely won't need it\nconst Modal = !process.env.SERVER\n ? React.lazy(() => import('../Modal/Modal'))\n : null;\n\n/**\n * Show messages to user, relating to the authentication state.\n * Right now this is limited to session expired.\n */\nfunction AuthMessages(props: AuthMessagesProps) {\n const { t } = useDictionary();\n const { userState, logoutUrl } = useAuth();\n const [showMessage, setShowMessage] = useState(false);\n\n useEffect(() => {\n if (userState === UserState.SessionExpired) {\n setShowMessage(true);\n }\n }, [userState]);\n\n if (userState === UserState.SessionExpired && Modal !== null) {\n return (\n \n setShowMessage(false)}\n title={t('errors.session_expired_title')}\n >\n {t('errors.session_expired_text')}\n \n \n );\n }\n\n if (userState === UserState.Forbidden && Modal !== null) {\n return (\n \n \n {t('errors.forbidden_text')}\n \n \n );\n }\n\n return null;\n}\n\nexport default AuthMessages;\n","import React, { Suspense, useEffect, useState } from 'react';\n\nimport { useRouter } from '../../application/Router';\nimport { useUser } from '../../api/hooks/useUser';\nimport { DeclarationActionTypes } from '../../view-models/DeclarationActionTypes';\nimport { MessageStatusTypes } from '../../view-models/MessageStatusTypes';\nimport Placeholder from '../Placeholder/Placeholder';\nimport { CollectionState } from '../../api/api-types';\n\nconst StatusMessageOverlay = !process.env.SERVER\n ? React.lazy(() => import('./StatusMessageOverlay'))\n : null;\n\nexport type StatusMessagesProps = {};\n\nexport type OverlayMessage = {\n status: MessageStatusTypes | null;\n action: DeclarationActionTypes | null;\n state?: CollectionState;\n};\n\nfunction shouldShowMessage(message: OverlayMessage) {\n // Always show error status, regardless of action\n if (message.status === 'error' && !message.state) return true;\n\n return (\n message.status &&\n message.action &&\n // If the user cancelled an action, we don't show anything.\n message.status !== MessageStatusTypes.cancelled\n );\n}\n\nfunction StatusMessages(props: StatusMessagesProps) {\n const { searchParams, updateSearchParams, replace } = useRouter();\n const { user } = useUser();\n const [showModal, setShowModal] = useState(false);\n const [message, setOverlayMessage] = useState(\n undefined,\n );\n const isDataInitialized: boolean = user?.isDataInitialized ?? true;\n\n useEffect(() => {\n if (isDataInitialized) setShowModal(true);\n }, [user, isDataInitialized]);\n\n useEffect(() => {\n if (searchParams && searchParams.has('status')) {\n // We get the state if it is passed\n const messageState = searchParams.get('state');\n\n let message: OverlayMessage = { status: null, action: null };\n\n message = {\n action: searchParams.get('action') as DeclarationActionTypes,\n status: searchParams.get('status') as MessageStatusTypes,\n state: (messageState as unknown) as CollectionState,\n };\n\n updateSearchParams([\n {\n key: 'action',\n value: undefined,\n },\n { key: 'status', value: undefined },\n { key: 'state', value: undefined },\n ]);\n\n if (\n message.hasOwnProperty('action') &&\n message.hasOwnProperty('status') &&\n shouldShowMessage(message)\n ) {\n setOverlayMessage(message);\n setShowModal(true);\n }\n }\n }, [replace, searchParams, updateSearchParams]);\n\n //For the cases when there was an error initializing user's data\n if (StatusMessageOverlay !== null && !isDataInitialized) {\n return (\n }>\n {\n setShowModal(false);\n }}\n />\n \n );\n }\n\n if (\n message &&\n message.status &&\n StatusMessageOverlay !== null &&\n isDataInitialized\n ) {\n return (\n }>\n {\n setShowModal(false);\n }}\n />\n \n );\n }\n\n return null;\n}\n\nexport default StatusMessages;\n","import { css } from '@emotion/core';\n\nexport const cookieBotStyles = css`\n #CybotCookiebotDialog .CookieCard {\n border-bottom: none !important;\n }\n\n #CybotCookiebotDialog .CookieCard:not(:first-child) {\n display: none;\n }\n\n a#CybotCookiebotDialogPoweredbyCybot {\n display: none;\n }\n`;\n","export default __webpack_public_path__ + \"static/fonts/roboto-mono-v7-latin-500_143DLq.woff\";","export default __webpack_public_path__ + \"static/fonts/roboto-mono-v7-latin-500_2F1w3v.woff2\";","export default __webpack_public_path__ + \"static/fonts/roboto-mono-v7-latin-regular_1whq51.woff\";","export default __webpack_public_path__ + \"static/fonts/roboto-mono-v7-latin-regular_3KyElB.woff2\";","export default __webpack_public_path__ + \"static/fonts/rubik-v9-latin-500_1Pas3B.woff\";","export default __webpack_public_path__ + \"static/fonts/rubik-v9-latin-500_1BXkOv.woff2\";","export default __webpack_public_path__ + \"static/fonts/rubik-v9-latin-700_3JjK4M.woff\";","export default __webpack_public_path__ + \"static/fonts/rubik-v9-latin-700_1_T4lw.woff2\";","export default __webpack_public_path__ + \"static/fonts/rubik-v9-latin-italic_3a07zD.woff\";","export default __webpack_public_path__ + \"static/fonts/rubik-v9-latin-italic_3gLNeJ.woff2\";","export default __webpack_public_path__ + \"static/fonts/rubik-v9-latin-regular_30K7Tc.woff\";","export default __webpack_public_path__ + \"static/fonts/rubik-v9-latin-regular_1NBufJ.woff2\";","import { css } from '@emotion/react';\n\nimport robotoMonoMedium_woff from './fonts/roboto-mono-v7-latin-500.woff';\nimport robotoMonoMedium_woff2 from './fonts/roboto-mono-v7-latin-500.woff2';\nimport robotoMono_woff from './fonts/roboto-mono-v7-latin-regular.woff';\nimport robotoMono_woff2 from './fonts/roboto-mono-v7-latin-regular.woff2';\nimport rubikMedium_woff from './fonts/rubik-v9-latin-500.woff';\nimport rubikMedium_woff2 from './fonts/rubik-v9-latin-500.woff2';\nimport rubikBold_woff from './fonts/rubik-v9-latin-700.woff';\nimport rubikBold_woff2 from './fonts/rubik-v9-latin-700.woff2';\nimport rubikItalic_woff from './fonts/rubik-v9-latin-italic.woff';\nimport rubikItalic_woff2 from './fonts/rubik-v9-latin-italic.woff2';\nimport rubik_woff from './fonts/rubik-v9-latin-regular.woff';\nimport rubik_woff2 from './fonts/rubik-v9-latin-regular.woff2';\n\nexport const preloadFonts = [robotoMonoMedium_woff2, rubik_woff2];\n\nexport const fonts = css`\n @font-face {\n font-family: 'Roboto Mono';\n src: local('Roboto Mono'), local('RobotoMono-Regular'),\n url(${robotoMono_woff2}) format('woff2'),\n url(${robotoMono_woff}) format('woff');\n font-weight: 400;\n font-style: normal;\n font-display: fallback;\n }\n @font-face {\n font-family: 'Roboto Mono';\n src: local('Roboto Mono Medium'), local('RobotoMono-Medium'),\n url(${robotoMonoMedium_woff2}) format('woff2'),\n url(${robotoMonoMedium_woff}) format('woff');\n font-weight: 500;\n font-style: normal;\n font-display: fallback;\n }\n @font-face {\n font-family: 'Rubik';\n src: url(${rubik_woff2}) format('woff2'), url(${rubik_woff}) format('woff');\n font-weight: 400;\n font-style: normal;\n font-display: fallback;\n }\n @font-face {\n font-family: 'Rubik';\n src: url(${rubikItalic_woff2}) format('woff2'),\n url(${rubikItalic_woff}) format('woff');\n font-weight: 400;\n font-style: italic;\n font-display: fallback;\n }\n @font-face {\n font-family: 'Rubik';\n src: url(${rubikMedium_woff2}) format('woff2'),\n url(${rubikMedium_woff}) format('woff');\n font-weight: 500;\n font-style: normal;\n font-display: fallback;\n }\n @font-face {\n font-family: 'Rubik';\n src: url(${rubikBold_woff2}) format('woff2'),\n url(${rubikBold_woff}) format('woff');\n font-weight: 700;\n font-style: normal;\n font-display: fallback;\n }\n`;\n","import { css } from '@emotion/react';\n\nimport { cookieBotStyles } from './cookiebot-style';\nimport { fonts } from './fonts';\n\nexport const globalStyles = css`\n ${fonts};\n ${cookieBotStyles}\n\n /*\n This will hide the focus indicator if the element receives focus via the mouse,\n but it will still show up on keyboard focus.\n */\n :focus:not([data-focus-visible-added]) {\n outline: none;\n }\n\n dd,\n dd,\n dt {\n margin: 0;\n }\n`;\n","import { Theme } from '@emotion/react';\n\nimport breakpoints from './breakpoints';\nimport buttons from './buttons';\nimport colors from './colors';\nimport typography from './typography';\n\n/**\n * The theme should follow the System UI Theme Specification:\n * https://system-ui.com/theme/\n * and https://styled-system.com/theme-specification\n **/\nconst theme: Theme = {\n breakpoints,\n colors,\n space: [\n '0', // 0px\n '0.25rem', // 4px\n '0.5rem', // 8px\n '0.75rem', // 12px\n '1rem', // 16px\n '1.25rem', // 20px\n '1.5rem', // 24px\n '2rem', // 32px\n '2.5rem', // 40px\n '3rem', // 48px\n '4rem', // 64px\n ],\n buttons,\n sizes: {\n container: '80rem', // 1280px\n },\n variants: {\n container: {\n px: ['1.25rem', '2rem'],\n },\n },\n layout: {\n grid: {\n gridGap: ['1rem', '2rem'],\n gridColumns: [4, 8, 12],\n },\n },\n ...typography,\n};\n\nexport default theme;\n","import React from 'react';\n\ntype Props = {\n children: React.ReactNode;\n /** Href is the hash URL that skiplink should jump to. Most likely it will be main \"#main\" */\n href?: string;\n className?: string;\n};\n\n/**\n * Skip link allows the user to jump directly to the main content on the page, bypassing the header navigation.\n * It activates automatically on keyboard focus.\n * https://a11yproject.com/posts/skip-nav-links/\n **/\nconst SkipLink = ({ children, href = '#main', ...props }: Props) => (\n \n {children}\n \n);\n\nSkipLink.displayName = 'SkipLink';\n\nexport default SkipLink;\n","import * as React from 'react';\nimport { ErrorInfo } from 'react';\nimport * as Sentry from '@sentry/browser';\n\nconst FriendlyError = !process.env.SERVER\n ? React.lazy(() => import('../components/FriendlyError/FriendlyError'))\n : null;\n\ntype Props = {\n moduleName: string;\n children?: React.ReactNode;\n};\n\ntype State = {\n error?: Error;\n errorInfo?: ErrorInfo;\n};\n\nclass ErrorBoundary extends React.Component {\n static displayName = 'ErrorBoundary';\n static defaultProps = {\n moduleName: 'Unknown',\n };\n\n state: State = {\n error: undefined,\n errorInfo: undefined,\n };\n\n componentDidCatch(\n error: Error,\n errorInfo: {\n componentStack: string;\n },\n ) {\n this.setState({ error, errorInfo });\n\n Sentry.withScope((scope) => {\n Object.keys(errorInfo).forEach((key) => {\n scope.setExtra(key, errorInfo[key]);\n });\n scope.setTag('module', this.props.moduleName);\n Sentry.captureException(error);\n });\n }\n\n render() {\n if (this.state.error) {\n const child = React.Children.only(this.props.children);\n const props = React.isValidElement(child) ? child.props : {};\n const { error, errorInfo } = this.state;\n\n return (\n FriendlyError && (\n }>\n {\n this.setState({ error: undefined, errorInfo: undefined });\n }}\n />\n \n )\n );\n }\n\n return this.props.children;\n }\n}\n\nexport default ErrorBoundary;\n","import React, { useEffect, useMemo } from 'react';\nimport { Severity, captureMessage, withScope } from '@sentry/browser';\n\nimport SkipLink from '../components/SkipLink/SkipLink';\nimport { useDictionary } from '../hooks/useDictionary';\nimport { Colors } from '../styles/colors';\nimport ModuleTypes from '../view-models/ModuleTypes';\nimport ErrorBoundary from './ErrorBoundary';\nimport { ModuleInstance } from './modules-utils';\n\ntype Props = {\n id?: string;\n modules: ModuleInstance[];\n};\n\ntype PreparedModules = {\n header?: ModuleInstance;\n footer?: ModuleInstance;\n modules: ModuleInstance[];\n};\n\ntype PartialRecord = {\n [P in K]?: T;\n};\n\n/**\n * Extract the modules that need special rules when rendering.\n * This allows us to maintain the header/footer between renders, and place them outside the

\n * */\nfunction buildModuleStructure(modules: ModuleInstance[] = []): PreparedModules {\n const result: PreparedModules = {\n modules: [],\n };\n\n modules.forEach((mod) => {\n switch (mod.name) {\n case ModuleTypes.Header:\n result.header = mod;\n break;\n case ModuleTypes.Footer:\n result.footer = mod;\n break;\n default:\n result.modules.push(mod);\n break;\n }\n });\n\n return result;\n}\n\nfunction renderModule(item?: ModuleInstance, id?: string) {\n if (!item) return null;\n if (item.module) {\n const result = React.createElement(\n ErrorBoundary,\n { key: id || item.name, moduleName: item.name },\n React.createElement(item.module, item.properties),\n );\n\n if (item.schema) {\n return [\n result,\n ,\n ];\n }\n\n return result;\n }\n\n // No matching module found - Log an error\n return process.env.NODE_ENV === 'development' ? (\n
Module {item.name} not found/ready
\n ) : null;\n}\n\n/**\n * Render all the modules on a single page.\n **/\nexport function Modules({ id, modules }: Props) {\n const { t } = useDictionary();\n const preparedModules = useMemo(() => buildModuleStructure(modules), [\n modules,\n ]);\n\n useEffect(() => {\n if (!preparedModules.header || !preparedModules.footer) {\n // Somethings missing!\n withScope((scope) => {\n scope.setExtra('modules', modules);\n if (!modules.length) {\n captureMessage('No modules in page data', Severity.Error);\n } else {\n captureMessage(\n 'No Header and Footer module in page data',\n Severity.Error,\n );\n }\n });\n }\n }, [preparedModules, modules]);\n\n const keyMap: PartialRecord = {};\n\n return (\n
\n {t('ui.skipNavigation')}\n {renderModule(preparedModules.header)}\n \n {preparedModules.modules.map((item) => {\n // Count the number of instances of each module type, so we can generate a unique key for each type,\n // while allowing a module to persist between pages.\n const moduleCount = keyMap[item.name] || 0;\n keyMap[item.name] = moduleCount + 1;\n\n return renderModule(item, `${id}_${item.name}_${moduleCount}`);\n })}\n
\n {renderModule(preparedModules.footer)}\n \n );\n}\n","/**\n * Scroll to a DOM element, and sets focus to the closest tabIndex\n **/\nexport function scrollToElement(\n /* Either the element id or a reference to the node */\n element: string | HTMLElement,\n behavior?: ScrollBehavior,\n focus: boolean = true,\n) {\n const node =\n typeof element === 'string'\n ? document.getElementById(\n element.charAt(0) === '#' ? element.substr(1) : element,\n )\n : element;\n\n if (node) {\n // Store the current scroll position, before we mess with the focus\n const y = window.scrollY;\n\n if (focus) {\n const focusNode: HTMLElement | null = node.closest('[tabindex]');\n\n // Set focus to the area we deeplinked to. This will move the scroll position\n if (focusNode) focusNode.focus();\n // Reset the scroll position after setting focus, so we can animate the transition\n window.scroll(0, y);\n }\n\n // Scroll the element into view\n node.scrollIntoView({\n behavior,\n block: 'start',\n });\n } else {\n // Scroll the element to top if node is null\n window.scroll(0, 0);\n }\n}\n","import { useEffect, useLayoutEffect, useRef } from 'react';\nimport { Action } from 'history';\n\nimport { scrollToElement } from '../utils/scroll-to-element';\nimport { useRouter } from './Router';\n\n/**\n * Small component that listens for changes in the Router location, and ensures the viewport\n * is scrolled to the to top when changing path. Only runs when a new path is pushed (e.g. the user clicked a link).\n */\nfunction ScrollRestoration() {\n const { action, location } = useRouter();\n const prevLocation = useRef(location);\n\n useLayoutEffect(() => {\n // The layout effect runs before rendering, so we can use this to update the scroll position early.\n if (\n action === Action.Push &&\n !location.hash &&\n location.pathname !== prevLocation.current.pathname\n ) {\n // Reset scroll to the top when PUSHing a new path\n scrollToElement('#app', undefined, true);\n }\n\n // Store a reference to location, so we can compare the pathname on a new render\n prevLocation.current = location;\n\n return () => {};\n }, [location, action]);\n\n useEffect(() => {\n if (action === Action.Push && location.hash) {\n // If the hash value changes, perform a smooth scroll\n scrollToElement(location.hash, 'smooth', true);\n }\n }, [location, action]);\n\n return null;\n}\n\nexport default ScrollRestoration;\n","// Create a cache to hydrate the SSR rendered styles\nimport createCache from '@emotion/cache';\n\n/**\n * Shared instance of Emotion cache. This should be the same on the server/client\n */\nexport const emotionCache = createCache({\n key: 'css',\n});\n\n// https://github.com/emotion-js/emotion/issues/1105#issuecomment-557457527\nemotionCache.compat = true;\n","import React, { useEffect } from 'react';\nimport { BaseCss } from '@charlietango/ui';\nimport { IdProvider } from '@charlietango/use-id';\nimport { CacheProvider, Global, ThemeProvider } from '@emotion/react';\n\nimport { AuthProvider } from '../api/AuthProvider';\nimport usePageData, { PageResult } from '../api/hooks/usePageData';\nimport { prefetchParties } from '../api/hooks/useParties';\nimport AuthMessages from '../components/AuthMessages/AuthMessages';\nimport StatusMessages from '../components/StatusMessages/StatusMessages';\nimport { DictionaryProvider } from '../hooks/useDictionary';\nimport { globalStyles } from '../styles/global-styles';\nimport theme from '../styles/theme';\nimport { HtmlConfigViewModel } from '../view-models/HtmlConfigViewModel';\nimport DocumentTitle from './DocumentTitle';\nimport { Modules } from './Modules';\nimport { useRouter } from './Router';\nimport ScrollRestoration from './ScrollRestoration';\nimport { emotionCache } from '../styles/emotion-cache';\n\ntype Props = {\n config: HtmlConfigViewModel;\n initialData: PageResult;\n};\n\nfunction App({ initialData, config }: Props) {\n const { pathname } = useRouter();\n const { data } = usePageData(pathname, {\n initialData,\n });\n\n useEffect(() => {\n // Regardless of the page we land on, start prefetching the parties so they are ready.\n prefetchParties();\n }, []);\n\n return (\n \n \n \n \n \n \n {/* We only need to render the BaseCss on the server, since the global styles shouldn't change. If they could (e.g. the theme changes), then always output the */}\n {process.env.SERVER ? (\n <>\n \n \n \n ) : (\n // Likewise we only need to render ScrollRestoration on the client\n \n )}\n {data && }\n \n \n \n \n \n \n \n );\n}\n\nexport default App;\n","import * as Sentry from '@sentry/browser';\nimport { Severity } from '@sentry/browser';\n\n/**\n * Determine the current environment by looking at the host\n * */\nfunction findEnvironment(host: string) {\n if (\n host.startsWith('localhost') ||\n host.match(/^\\d/) ||\n process.env.NODE_ENV !== 'production'\n ) {\n return 'local';\n }\n // Extract the env from the first part of the hostname.\n const [, env] =\n (host.includes('ve-website')\n ? host.match(/^(\\w+)-ve-website/)\n : host.match(/(\\w+).vaelgererklaering.dk/)) || [];\n return env && env !== 'www' ? env : 'production';\n}\n\nexport function initSentry() {\n const environment = findEnvironment(document.location.host);\n\n Sentry.init({\n // Our Sentry DSN, indicating the URL that should handle our logging.\n dsn:\n 'https://7fbc75a6b2ba454c96a60559efe68127@o20326.ingest.sentry.io/5202290',\n environment,\n ignoreErrors: [\n 'Non-Error exception captured',\n 'Non-Error promise',\n 'Invariant Violation',\n 'ResizeObserver loop limit exceeded',\n 'document.getElementsByClassName.ToString is not a function',\n ],\n blacklistUrls: [\n // Facebook flakiness\n /graph\\.facebook\\.com/i,\n // Facebook blocked\n /connect\\.facebook\\.net\\/en_US\\/all\\.js/i,\n // Chrome extensions\n /extensions\\//i,\n /^chrome:\\/\\//i,\n ],\n integrations:\n process.env.NODE_ENV !== 'production'\n ? [new Sentry.Integrations.Breadcrumbs({ console: false })]\n : undefined,\n release: process.env.VERSION,\n beforeSend: (event, hint) => {\n if (process.env.NODE_ENV !== 'production') {\n if (event.level === Severity.Warning) {\n // eslint-disable-next-line no-console\n console.warn(event.message, event.extra);\n } else {\n // eslint-disable-next-line no-console\n console.error(\n hint?.originalException ||\n hint?.syntheticException ||\n event.message,\n event.extra,\n );\n }\n return null; // this drops the event and nothing will be sent to sentry\n }\n if (environment === 'local') return null;\n return event;\n },\n });\n}\n","import addShims from './polyfills/shims';\n\n/**\n * Load additional polyfills here\n **/\nfunction loadPolyfills(): Promise {\n addShims();\n const polyfills: Promise[] = [];\n\n if (!window.fetch) {\n polyfills.push(import('unfetch/polyfill/index'));\n }\n\n if (!supportsIntersectionObserver()) {\n polyfills.push(\n import(\n /* webpackChunkName: 'intersection-observer' */ 'intersection-observer'\n ),\n );\n }\n\n if (!supportsUrlSearchParams()) {\n polyfills.push(\n import(/* webpackChunkName: 'url-polyfill' */ 'url-polyfill'),\n );\n }\n\n return Promise.all(polyfills);\n}\n\nfunction supportsIntersectionObserver() {\n return (\n 'IntersectionObserver' in window &&\n 'IntersectionObserverEntry' in window &&\n 'intersectionRatio' in window.IntersectionObserverEntry.prototype\n );\n}\n\nfunction supportsUrlSearchParams() {\n try {\n const nativeURL = new window.URL('http://example.com');\n\n if ('href' in nativeURL && 'searchParams' in nativeURL) {\n const url = new URL('http://example.com');\n url.search = 'a=1&b=2';\n if (url.href === 'http://example.com/?a=1&b=2') {\n url.search = '';\n // @ts-ignore\n if (url.href === 'http://example.com/') {\n const sp1 = new window.URLSearchParams('a=1');\n const sp2 = new window.URLSearchParams(sp1);\n if (String(sp2) === 'a=1') {\n return true;\n }\n }\n }\n }\n return false;\n } catch (error) {\n return false;\n }\n}\n\nexport default loadPolyfills;\n","// It's important that we import 'core-js' before everything else, including React.\n// Importing it later will break React in IE11\nimport 'core-js/stable';\nimport 'regenerator-runtime/runtime';\nimport 'focus-visible';\n\nimport React from 'react';\nimport ReactDOM from 'react-dom';\nimport { ReactQueryConfig, ReactQueryConfigProvider } from 'react-query';\n\nimport { IError } from './api/api-types';\nimport { setPageDataCache } from './api/hooks/usePageData';\nimport { handleQueryError } from './api/query-error';\nimport App from './application/App';\nimport { ModuleInstance, preloadModules } from './application/modules-utils';\nimport Router from './application/Router';\nimport { initSentry } from './application/sentry';\nimport loadPolyfills from './utils/polyfills';\nimport { normalizePathname } from './utils/url-helpers';\nimport { HeadlessViewModel } from './view-models/HeadlessViewModel';\nimport { HtmlConfigViewModel } from './view-models/HtmlConfigViewModel';\nimport { initPlausible } from './utils/tracking';\n\n/**\n * Define the default rules for how we query data in the application.\n *\n */\nlet queryConfig: ReactQueryConfig = {\n queries: {\n staleTime: 1000 * 60 * 5,\n cacheTime: 300000,\n refetchOnWindowFocus: false,\n retry: (failureCount, { status }) => {\n if (failureCount >= 2) return false;\n // Retry on an invalid server response\n if (status) return status >= 500;\n // retry after retryDelay\n return true;\n },\n onError: handleQueryError,\n },\n};\n\n/**\n * Initialize the client code.\n */\nexport function init(data: HeadlessViewModel) {\n // Init sentry error tracking\n if (process.env.NODE_ENV !== 'test') {\n initSentry();\n }\n\n // Initial data is JSON string, so let's parse it now.\n const config: HtmlConfigViewModel = JSON.parse(\n document.querySelector('script[data-config]')?.innerHTML ?? '\"{}\"',\n );\n\n initPlausible(config.keys?.plausible);\n\n // Preload polyfills and modules before rendering the app\n return Promise.all([preloadModules(data.modules), loadPolyfills()]).then(\n ([moduleInstances]) => {\n renderApp(moduleInstances, data, config);\n },\n );\n}\n\nfunction renderApp(\n modules: ModuleInstance[],\n { meta }: HeadlessViewModel,\n config: HtmlConfigViewModel,\n) {\n const root = document.getElementById('app');\n\n const initialData = {\n pathname: normalizePathname(window.location.pathname) || '/',\n meta,\n modules,\n };\n\n // Set Initial data for the route here, so it's ready for all consumers.\n setPageDataCache(initialData.pathname, initialData);\n\n // Add the initial data to the page cache, so we don't preload it again.\n if (root) {\n const content = (\n \n \n \n \n \n );\n if (process.env.NODE_ENV !== 'test') {\n ReactDOM.hydrate(content, root);\n } else {\n // When rendering in the test, we aren't rehydrating sever output, so use the render method.\n // This could also be done as a check that only uses hydrate if #app contains children\n ReactDOM.render(content, root);\n }\n } else {\n throw new Error('Failed to find #app');\n }\n}\n\nif (process.env.NODE_ENV !== 'test') {\n // Init the client now - Moved inside init function to make it testable :)\n if (!window.VERSION) {\n window.VERSION = process.env.VERSION;\n\n const initialData = JSON.parse(\n document.querySelector('script[data-initial]')?.innerHTML ?? '\"{}\"',\n );\n\n init(initialData);\n }\n}\n","/* eslint-disable no-extend-native */\n\nexport default function addShims() {\n /**\n * Shim the requestIdleCallback method if needed\n **/\n window.requestIdleCallback =\n window.requestIdleCallback ||\n function (cb) {\n const start = Date.now();\n return setTimeout(function () {\n cb({\n didTimeout: false,\n timeRemaining: function () {\n return Math.max(0, 50 - (Date.now() - start));\n },\n });\n }, 1);\n };\n\n window.cancelIdleCallback =\n window.cancelIdleCallback ||\n function (id) {\n clearTimeout(id);\n };\n\n if (!Element.prototype.matches) {\n Element.prototype.matches =\n // @ts-ignore\n Element.prototype.msMatchesSelector ||\n Element.prototype.webkitMatchesSelector;\n }\n\n if (!Element.prototype.closest) {\n Element.prototype.closest = function (s) {\n var el = this;\n if (!document.documentElement.contains(el)) return null;\n do {\n if (el.matches(s)) return el;\n el = el.parentElement || el.parentNode;\n } while (el !== null && el.nodeType === 1);\n return null;\n };\n }\n\n if (window.NodeList && !NodeList.prototype.forEach) {\n // @ts-ignore\n NodeList.prototype.forEach = Array.prototype.forEach;\n }\n\n // Source: https://github.com/jserz/js_piece/blob/master/DOM/ParentNode/append()/append().md\n (function (arr) {\n arr.forEach(function (item) {\n if (item.hasOwnProperty('append')) {\n return;\n }\n Object.defineProperty(item, 'append', {\n configurable: true,\n enumerable: true,\n writable: true,\n value: function append() {\n var argArr = Array.prototype.slice.call(arguments),\n docFrag = document.createDocumentFragment();\n\n argArr.forEach(function (argItem) {\n var isNode = argItem instanceof Node;\n docFrag.appendChild(\n isNode ? argItem : document.createTextNode(String(argItem)),\n );\n });\n\n this.appendChild(docFrag);\n },\n });\n });\n })([Element.prototype, Document.prototype, DocumentFragment.prototype]);\n}\n","import { Theme } from '@emotion/react';\nimport { rem } from 'polished';\n\nimport { Colors } from './colors';\n\nexport enum TextVariant {\n H1 = 'h1',\n H2 = 'h2',\n H3 = 'h3',\n H4 = 'h4',\n Paragraph17 = 'paragraph-17',\n Paragraph = 'paragraph',\n Paragraph12 = 'paragraph-12',\n Alert = 'alert',\n}\n\nexport enum FontWeight {\n Hairline = 100,\n Thin = 200,\n Light = 300,\n Normal = 400,\n Medium = 500,\n SemiBold = 600,\n Bold = 700,\n ExtraBold = 800,\n Black = 900,\n}\n\nexport enum FontFamily {\n Body = 'body',\n Heading = 'heading',\n Mono = 'mono',\n}\n\nconst typography: Omit = {\n fontSizes: [\n '0.75rem', // 12px\n '0.875rem', // 14px\n '1rem', // 16px\n '1.25rem', // 20px\n '1.5rem', //24px\n '1.75rem', //28px\n '2rem', // 32px\n '2.5rem', // 40px,\n '3rem', // 48px,\n '4rem', // 64px,\n ],\n fonts: {\n [FontFamily.Heading]: 'inherit',\n [FontFamily.Body]:\n 'Rubik, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Helvetica, Arial, sans-serif',\n [FontFamily.Mono]: `\"Roboto Mono\", SFMono-Regular, Menlo, Monaco, Consolas, \"Liberation Mono\", \"Courier New\", monospace`,\n },\n text: {\n [TextVariant.H1]: {\n fontFamily: FontFamily.Mono,\n fontWeight: FontWeight.Medium,\n fontSize: [rem(30), null, rem(40), rem(52)],\n lineHeight: [1.27, 1.38],\n overflowWrap: 'break-word',\n },\n [TextVariant.H2]: {\n fontFamily: FontFamily.Mono,\n fontWeight: FontWeight.Medium,\n fontSize: [rem(26), rem(44)],\n lineHeight: 1.32,\n overflowWrap: 'break-word',\n },\n [TextVariant.H3]: {\n fontWeight: FontWeight.Medium,\n fontSize: [rem(18), rem(20)],\n lineHeight: [1.33, 1.5],\n overflowWrap: 'break-word',\n },\n [TextVariant.H4]: {\n fontWeight: FontWeight.Medium,\n fontSize: rem(15),\n lineHeight: 1.47,\n overflowWrap: 'break-word',\n },\n [TextVariant.Paragraph]: {\n fontWeight: FontWeight.Normal,\n fontSize: rem(15),\n lineHeight: 1.6,\n overflowWrap: 'break-word',\n },\n [TextVariant.Paragraph17]: {\n fontWeight: FontWeight.Normal,\n fontSize: rem(17),\n lineHeight: 1.53,\n overflowWrap: 'break-word',\n },\n [TextVariant.Paragraph12]: {\n fontWeight: FontWeight.Normal,\n color: Colors.Secondary,\n fontSize: rem(12),\n lineHeight: 1.6,\n overflowWrap: 'break-word',\n },\n [TextVariant.Alert]: {\n fontWeight: FontWeight.Normal,\n fontSize: rem(15),\n lineHeight: 1.3,\n overflowWrap: 'break-word',\n },\n },\n};\n\nexport default typography;\n","import { QueryConfig, queryCache, useQuery } from 'react-query';\n\nimport {\n ModuleInstance,\n preloadModules,\n} from '../../application/modules-utils';\nimport { normalizePathname } from '../../utils/url-helpers';\nimport { HeadlessViewModel } from '../../view-models/HeadlessViewModel';\nimport { MetaViewModel } from '../../view-models/MetaViewModel';\nimport { IError } from '../api-types';\nimport { fetcher } from '../fetcher';\nimport { captureMessage, Severity, withScope } from '@sentry/browser';\n\nexport type PageResult = {\n pathname: string;\n meta: MetaViewModel;\n modules: ModuleInstance[];\n};\n\nexport function setPageDataCache(pathname: string, data: PageResult) {\n const normalized = normalizePathname(pathname);\n if (normalized) queryCache.setQueryData(normalized, data);\n}\n\nexport function prefetchPageDataCache(pathname: string) {\n return queryCache.prefetchQuery(normalizePathname(pathname), loadPageData, {\n staleTime: Infinity,\n retry: false,\n });\n}\n\nasync function loadPageData(pathname: string): Promise {\n const cacheData = queryCache.getQuery(pathname);\n // For some reason initialData isn't detected correctly when fetching the page.\n // Check if the page is already cached, and use the result\n if (cacheData && cacheData.state.status === 'success') {\n return cacheData.state.data as PageResult;\n }\n\n const result = await fetcher(pathname + '?json');\n // Preload the modules on the page, so all the scripts are ready\n const preloadedModules = await preloadModules(result.modules);\n // If the result has required fields, update the page.\n\n if (normalizePathname(result.meta.pathname || '') !== pathname) {\n withScope((scope) => {\n scope.setTag('type', 'fetch');\n scope.setExtra('pathname', pathname);\n scope.setExtra('result', result);\n captureMessage(\n 'Mismatch between \"pathname\" of client and returned data. This indicates an async data problem on the server.',\n Severity.Critical,\n );\n });\n }\n\n return {\n meta: result.meta,\n modules: preloadedModules,\n pathname,\n };\n}\n\nexport default function usePageData(\n pathname: string | null,\n options?: QueryConfig,\n) {\n return useQuery(normalizePathname(pathname), loadPageData, {\n staleTime: Infinity,\n enabled: !!pathname,\n retry: false,\n ...options,\n });\n}\n","/* eslint-disable no-redeclare */\nimport React from 'react';\nimport { Severity, captureMessage, withScope } from '@sentry/browser';\n\nlet missingMap: Object;\n\ntype InterpolationOptions = { asString?: boolean };\nexport type InterpolationParams = Record &\n InterpolationOptions;\n\nexport function hasInterpolationValue(value: string) {\n return /{{?\\s?(\\w+)\\s?}?}/.test(value);\n}\n\nfunction missingParamHandler(\n param: string,\n label: string,\n params?: InterpolationParams,\n) {\n const key = `${label}_${param}`;\n if (!process.env.SERVER && (!missingMap || !missingMap[key])) {\n withScope((scope) => {\n scope.setExtras({\n params,\n param,\n label,\n });\n captureMessage(\n `Missing interpolation value for \"${param}\"`,\n Severity.Warning,\n );\n });\n\n if (process.env.NODE_ENV !== 'test') {\n if (!missingMap) missingMap = {};\n missingMap[key] = true;\n }\n }\n}\n\n/*\n * Convert an array of children into a string\n * */\nexport function childrenToString(children: React.ReactNode): string {\n if (typeof children === 'string') return children;\n const resultArray = React.Children.toArray(children);\n return resultArray\n .map((child) => {\n if (React.isValidElement(child)) {\n return child.props.children;\n }\n return child;\n })\n .filter((child) => {\n return typeof child === 'string';\n })\n .join('');\n}\n\nexport function interpolate(label: string, params: undefined): string;\n\nexport function interpolate(\n label: string,\n params: InterpolationParams & { asString: true },\n): string;\nexport function interpolate(\n label: string,\n params: InterpolationParams,\n): React.ReactNode;\nexport function interpolate(label: string): string;\nexport function interpolate(\n label: string,\n params?: InterpolationParams,\n): React.ReactNode {\n const split = label.split(/{{?\\s?(\\w+)\\s?}?}/g);\n\n // No params to interpolate\n if (split.length === 1) return label;\n\n const output = split.map((match, index) => {\n // Because we are using split, only every second item is the actual match.\n if (index % 2 === 1) {\n if (!params || !params.hasOwnProperty(match)) {\n // The expect param is not part of the provided params\n missingParamHandler(match, label, params);\n return `{${match}}`;\n }\n // See if the params contain the match value. Otherwise we output the variable as is.\n let child = params[match];\n\n if (React.isValidElement(child)) {\n // If this is a valid React component, inject the \"key\" into the interpolated value.\n // This is needed because we return an array of children.\n return React.cloneElement(child, { key: index });\n }\n\n return child;\n } else {\n // This is a string value located in between the params.\n return match || null;\n }\n });\n\n if (!params || params.asString) {\n return childrenToString(output);\n }\n\n return output;\n}\n","import React, { createContext, useCallback, useContext } from 'react';\nimport { Severity, captureMessage } from '@sentry/browser';\n\nimport { interpolate } from './helpers/interpolate';\n\nconst defaultValue = {};\nexport const DictionaryContext = createContext(defaultValue);\n\n/* Map of all the missing keys, so we don't log any missing values more then once */\nlet missingMap: Object;\n\nfunction missingKeyHandler(key: string) {\n if (!process.env.SERVER && (!missingMap || !missingMap[key])) {\n captureMessage(`Missing dictionary key: ${key}`, Severity.Warning);\n\n if (process.env.NODE_ENV !== 'test') {\n if (!missingMap) missingMap = { key: true };\n else missingMap[key] = true;\n }\n }\n}\n\ntype DictionaryProviderProps = {\n items: Object;\n children?: React.ReactNode;\n};\n\nexport const DictionaryProvider = ({\n items,\n children,\n}: DictionaryProviderProps) => {\n const currentItems = useContext(DictionaryContext);\n\n return (\n \n {children}\n \n );\n};\n\n/**\n * Recursively find a nested object by using the dot notation path.\n * This is a light version of the lodash _.get method.\n * If nothing is found on the path, it will return undefined.\n * */\nfunction getProp(\n object: Object,\n path: string | string[],\n): Object | string | undefined {\n const paths = Array.isArray(path)\n ? path\n : path.split('.').filter((i) => i.length);\n if (!paths.length) {\n return object;\n }\n const key = paths.shift();\n if (object === null || object === undefined || typeof key === 'undefined') {\n return undefined;\n }\n return getProp(object[key], paths) as string;\n}\n\nfunction findKeyValue(key: string, dictionary: Object, extraItems?: Object) {\n const isNested = key.includes('.');\n let value = isNested ? getProp(dictionary, key) : dictionary[key];\n if (!value && extraItems) {\n value = isNested ? getProp(extraItems, key) : extraItems[key];\n }\n\n return value;\n}\n\n/** Overload the `t` method so we get the correct Type back if `asString` is true. */\ntype IDictionaryOverload = {\n (\n key: string,\n params: Record & { asString: true },\n ): string;\n (key: string, params?: undefined): string;\n (key: string, params?: Record): React.ReactNode;\n};\n\n/**\n * useDictionary returns a `t` function that allows you to request the value of a Dictionary key.\n *\n * @example\n * ```\n * const {t} = useDictionary()\n * return t(Dictionary.login)\n * ```\n * */\nexport function useDictionary(extraItems?: Object) {\n const dictionary = useContext(DictionaryContext);\n if (process.env.NODE_ENV !== 'production' && dictionary === defaultValue) {\n throw new Error('useDictionary must be used within DictionaryContext');\n }\n\n const t = useCallback(\n (key, params) => {\n const value = findKeyValue(key, dictionary, extraItems);\n\n if (!value) {\n // Handle a missing dictionary key\n missingKeyHandler(key);\n return `#${key}#`;\n }\n\n // Return the interpolated value. It's not strictly speaking correct to cast it as a `string`,\n // since it could be a ReactNode if it contains params. We'd have to assert this to determine what type of value.\n return interpolate(value, params);\n },\n [dictionary, extraItems],\n );\n\n /**\n * Check that a dictionary key exists\n * @param key\n */\n const exists = (key: string) => {\n return !!findKeyValue(key, dictionary, extraItems);\n };\n\n return { t, exists };\n}\n","import { CancelledError } from 'react-query';\nimport { parse } from 'url';\n\nimport { IError } from './api-types';\n\nfunction headersToObject(headers: Headers) {\n const output = {};\n try {\n // `forEach` might not be supported in all browsers (like IE11)\n headers.forEach((value, key) => {\n output[key] = value;\n });\n } catch (e) {}\n return output;\n}\n\nfunction serializeResponse(response: Response) {\n return {\n status: response.status,\n statusText: response.statusText,\n url: response.ok,\n type: response.type,\n headers: headersToObject(response.headers),\n };\n}\n\n/**\n * Fetcher that enables SWR to fetch data from our API endpoints\n */\nexport async function fetcher(\n url: string,\n options: RequestInit = {},\n) {\n const headers: HeadersInit = {\n 'content-type': 'application/json',\n // Never cache the requests locally.\n 'cache-control': 'no-cache',\n pragma: 'no-cache',\n // Set credentials to ensure cookies are transferred\n credentials: 'same-origin',\n ...options?.headers,\n };\n\n if (!process.env.PROD && !!document.cookie) {\n // Make sure the cookie is sent along. This allows us to access it when using `fetch-mock` to mock the API calls.\n // It should only be done in production, when we are not using `fetch-mock`.\n headers['cookie'] = document.cookie;\n }\n\n const request: RequestInit = {\n method: options.body ? 'POST' : 'GET',\n ...options,\n headers,\n };\n // See if we can get a valid JSON error message from the response.\n const response = await fetch(url, request);\n const json: Result = await response.json().catch(() => {\n // Failed to parse a JSON response. Return an empty object instead.\n return {};\n });\n\n if (response.ok) {\n return json;\n } else {\n const { pathname } = parse(url);\n const msg = `[${response.status}] ${pathname}`;\n\n // Use a CancelledError here. Otherwise `react-query` logs out the message with `console.error`,\n // resulting a double log entry (since Sentry also captures those)\n const error: IError = new CancelledError();\n error.message = msg;\n error.status = response.status;\n error.pathname = pathname || '';\n error.response = request;\n error.response = serializeResponse(response);\n error.details = json;\n\n return Promise.reject(error);\n }\n}\n"],"sourceRoot":""}