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,EAAkB,GAEtB,EAAY,OAAO,CAAC,AAAC,IAEpB,GADG,QAAQ,GAAG,CAAC,GACX,EAAW,GAAG,CAAC,EAAE,GAAK,EAAY,GAAG,CAAC,EAAE,EACpC,GAAY,OAAO,CACpB,IAAM,EAAc;uEACyC,GAAY,QAAQ;yCAClD,GAAY,KAAK;;4BAE9B,GAAY,QAAQ,WAAW,QAAQ,MAAM,KAAO,EAAA;;;;yBAIvD,GAAY,QAAQ,WAAW,QAAQ,aAAe;;;;oEAIX,GAAY,QAAQ;mEACrB,AAAA,CAAA,EAAA,EAAA,YAAW,AAAX,EAAa,GAAY,QAAQ;;gFAEjB,GAAY,KAAK,UAAU,eAAe,QAAS,CAAE,SAAU,KAAM,GAAG,UAAU,EAAG;;;qBAGnJ,CAEX,GAAoC,CACtC,CAEN,GAEA,EAAa,SAAS,CAAG,CAC1B,CAAE,MAAO,EAAO,CACf,SAAS,cAAc,CAAC,uCAAuC,SAAS,CAAG,gCAC5E,CACD,CC7FA,EAAiB,AAAA,EAAA,SAAA,YAAA,CAA6C,SAAW,0CDyBzE,SAAS,gBAAgB,CAAC,mBAAoB,E","sources":["","node_modules/.pnpm/@parcel+runtime-js@2.12.0_@parcel+core@2.12.0_@swc+helpers@0.5.8__@swc+helpers@0.5.8/node_modules/@parcel/runtime-js/lib/helpers/bundle-manifest.js","node_modules/.pnpm/@parcel+runtime-js@2.12.0_@parcel+core@2.12.0_@swc+helpers@0.5.8__@swc+helpers@0.5.8/node_modules/@parcel/runtime-js/lib/helpers/bundle-url.js","node_modules/.pnpm/@parcel+runtime-js@2.12.0_@parcel+core@2.12.0_@swc+helpers@0.5.8__@swc+helpers@0.5.8/node_modules/@parcel/runtime-js/lib/runtime-8fa70aee38e2ffb8.js","assets/js/article.js","node_modules/.pnpm/@parcel+runtime-js@2.12.0_@parcel+core@2.12.0_@swc+helpers@0.5.8__@swc+helpers@0.5.8/node_modules/@parcel/runtime-js/lib/runtime-566ec76f62c05f3c.js"],"sourcesContent":["(function () {\n\nfunction $parcel$export(e, n, v, s) {\n Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});\n}\n\nfunction $parcel$interopDefault(a) {\n return a && a.__esModule ? a.default : a;\n}\n\n var $parcel$global =\n typeof globalThis !== 'undefined'\n ? globalThis\n : typeof self !== 'undefined'\n ? self\n : typeof window !== 'undefined'\n ? window\n : typeof global !== 'undefined'\n ? global\n : {};\n \nvar $parcel$modules = {};\nvar $parcel$inits = {};\n\nvar parcelRequire = $parcel$global[\"parcelRequire29f6\"];\n\nif (parcelRequire == null) {\n parcelRequire = function(id) {\n if (id in $parcel$modules) {\n return $parcel$modules[id].exports;\n }\n if (id in $parcel$inits) {\n var init = $parcel$inits[id];\n delete $parcel$inits[id];\n var module = {id: id, exports: {}};\n $parcel$modules[id] = module;\n init.call(module.exports, module, module.exports);\n return module.exports;\n }\n var err = new Error(\"Cannot find module '\" + id + \"'\");\n err.code = 'MODULE_NOT_FOUND';\n throw err;\n };\n\n parcelRequire.register = function register(id, init) {\n $parcel$inits[id] = init;\n };\n\n $parcel$global[\"parcelRequire29f6\"] = parcelRequire;\n}\n\nvar parcelRegister = parcelRequire.register;\nparcelRegister(\"3EDXW\", function(module, exports) {\n\n$parcel$export(module.exports, \"register\", function () { return $2a941bea8df0834f$export$6503ec6e8aabbaf; }, function (v) { return $2a941bea8df0834f$export$6503ec6e8aabbaf = v; });\nvar $2a941bea8df0834f$export$6503ec6e8aabbaf;\nvar $2a941bea8df0834f$export$f7ad0328861e2f03;\n\"use strict\";\nvar $2a941bea8df0834f$var$mapping = new Map();\nfunction $2a941bea8df0834f$var$register(baseUrl, manifest) {\n for(var i = 0; i < manifest.length - 1; i += 2)$2a941bea8df0834f$var$mapping.set(manifest[i], {\n baseUrl: baseUrl,\n path: manifest[i + 1]\n });\n}\nfunction $2a941bea8df0834f$var$resolve(id) {\n var resolved = $2a941bea8df0834f$var$mapping.get(id);\n if (resolved == null) throw new Error(\"Could not resolve bundle with id \" + id);\n return new URL(resolved.path, resolved.baseUrl).toString();\n}\n$2a941bea8df0834f$export$6503ec6e8aabbaf = $2a941bea8df0834f$var$register;\n$2a941bea8df0834f$export$f7ad0328861e2f03 = $2a941bea8df0834f$var$resolve;\n\n});\n\nparcelRegister(\"jeqpa\", function(module, exports) {\n\n$parcel$export(module.exports, \"getBundleURL\", function () { return $e003ce9b6e0ea8b1$export$bdfd709ae4826697; }, function (v) { return $e003ce9b6e0ea8b1$export$bdfd709ae4826697 = v; });\nvar $e003ce9b6e0ea8b1$export$bdfd709ae4826697;\nvar $e003ce9b6e0ea8b1$export$c9e73fbda7da57b6;\nvar $e003ce9b6e0ea8b1$export$5a759dc7a1cfb72a;\n\"use strict\";\nvar $e003ce9b6e0ea8b1$var$bundleURL = {};\nfunction $e003ce9b6e0ea8b1$var$getBundleURLCached(id) {\n var value = $e003ce9b6e0ea8b1$var$bundleURL[id];\n if (!value) {\n value = $e003ce9b6e0ea8b1$var$getBundleURL();\n $e003ce9b6e0ea8b1$var$bundleURL[id] = value;\n }\n return value;\n}\nfunction $e003ce9b6e0ea8b1$var$getBundleURL() {\n try {\n throw new Error();\n } catch (err) {\n var matches = (\"\" + err.stack).match(/(https?|file|ftp|(chrome|moz|safari-web)-extension):\\/\\/[^)\\n]+/g);\n if (matches) // The first two stack frames will be this function and getBundleURLCached.\n // Use the 3rd one, which will be a runtime in the original bundle.\n return $e003ce9b6e0ea8b1$var$getBaseURL(matches[2]);\n }\n return \"/\";\n}\nfunction $e003ce9b6e0ea8b1$var$getBaseURL(url) {\n return (\"\" + url).replace(/^((?:https?|file|ftp|(chrome|moz|safari-web)-extension):\\/\\/.+)\\/[^/]+$/, \"$1\") + \"/\";\n}\n// TODO: Replace uses with `new URL(url).origin` when ie11 is no longer supported.\nfunction $e003ce9b6e0ea8b1$var$getOrigin(url) {\n var matches = (\"\" + url).match(/(https?|file|ftp|(chrome|moz|safari-web)-extension):\\/\\/[^/]+/);\n if (!matches) throw new Error(\"Origin not found\");\n return matches[0];\n}\n$e003ce9b6e0ea8b1$export$bdfd709ae4826697 = $e003ce9b6e0ea8b1$var$getBundleURLCached;\n$e003ce9b6e0ea8b1$export$c9e73fbda7da57b6 = $e003ce9b6e0ea8b1$var$getBaseURL;\n$e003ce9b6e0ea8b1$export$5a759dc7a1cfb72a = $e003ce9b6e0ea8b1$var$getOrigin;\n\n});\n\nvar $be63973950877e60$exports = {};\n\n\n(parcelRequire(\"3EDXW\")).register((parcelRequire(\"jeqpa\")).getBundleURL(\"fovHA\"), JSON.parse('[\"fovHA\",\"article.5934031c.js\",\"1B73x\",\"fallback.994c57d6.webp\",\"ghiyx\",\"articles.6ddb47a2.js\"]'));\n\n\nvar $6ZLBM = parcelRequire(\"6ZLBM\");\nvar $4f7ef10c28579884$exports = {};\n\n$4f7ef10c28579884$exports = (parcelRequire(\"jeqpa\")).getBundleURL(\"fovHA\") + \"fallback.994c57d6.webp\";\n\n\nasync function $57f4de11441814ef$var$displayArticle() {\n const articleId = $57f4de11441814ef$var$getArticleIdFromUrl();\n try {\n const articles = await (0, $6ZLBM.getArticles)(5);\n if (articleId === null || articleId === undefined) {\n const article = await (0, $6ZLBM.getLatestArticle)();\n $57f4de11441814ef$var$buildMainArticle(article);\n $57f4de11441814ef$var$buildSubArticles(articles, article);\n } else {\n const article = await (0, $6ZLBM.getArticle)(articleId);\n $57f4de11441814ef$var$buildMainArticle(article);\n $57f4de11441814ef$var$buildSubArticles(articles, article);\n }\n } catch (error) {\n console.error(\"Failed to fetch articles:\", error);\n }\n}\ndocument.addEventListener(\"DOMContentLoaded\", $57f4de11441814ef$var$displayArticle);\nfunction $57f4de11441814ef$var$buildMainArticle(mainArticle) {\n try {\n const mainContainer = document.getElementById(\"article-container-single\");\n mainContainer.innerHTML = \"\";\n const mainArticleHTML = `\r\n\t\t\t
\r\n\t\t\t\t\r\n\t\t\t\t
\r\n\t\t\t\t\t

${mainArticle?.fields?.title}

\r\n\t\t\t\t\t
\r\n\t\t\t\t\t
${(0, $6ZLBM.buildPost)(mainArticle?.fields?.blogContent)}
\r\n\t\t\t\t
\r\n\t\t\t\t\r\n\t\t\t
\r\n\t\t`;\n mainContainer.innerHTML = mainArticleHTML;\n } catch (error) {\n document.getElementById(\"article-container-single\").innerHTML = \"

Error loading article.

\";\n }\n}\nfunction $57f4de11441814ef$var$buildSubArticles(subArticles, mainArticle) {\n try {\n const subContainer = document.getElementById(\"single-articles-container-secondary\");\n subContainer.innerHTML = \"\";\n let subArticlesHTML = \"\";\n subArticles.forEach((subArticle)=>{\n console.log(subArticle);\n if (subArticle.sys.id !== mainArticle.sys.id) {\n if (subArticle?.fields) {\n const articleHTML = `\r\n
\r\n \r\n
\r\n \"${subArticle?.fields?.blogImage?.fields?.description\r\n
\r\n
\r\n
\r\n

${subArticle?.fields?.title}

\r\n
${(0, $6ZLBM.buildSummary)(subArticle?.fields?.blogContent)}
\r\n
\r\n \r\n
\r\n
\r\n
`;\n subArticlesHTML = subArticlesHTML + articleHTML;\n }\n }\n });\n subContainer.innerHTML = subArticlesHTML;\n } catch (error) {\n document.getElementById(\"single-articles-container-secondary\").innerHTML = \"

Error loading articles.

\";\n }\n}\nfunction $57f4de11441814ef$var$getArticleIdFromUrl() {\n const queryParams = new URLSearchParams(window.location.search);\n const articleId = queryParams.get(\"article\");\n return articleId;\n}\n\n})();\n//# sourceMappingURL=article.5934031c.js.map\n","\"use strict\";\n\nvar mapping = new Map();\nfunction register(baseUrl, manifest) {\n for (var i = 0; i < manifest.length - 1; i += 2) {\n mapping.set(manifest[i], {\n baseUrl: baseUrl,\n path: manifest[i + 1]\n });\n }\n}\nfunction resolve(id) {\n var resolved = mapping.get(id);\n if (resolved == null) {\n throw new Error('Could not resolve bundle with id ' + id);\n }\n return new URL(resolved.path, resolved.baseUrl).toString();\n}\nmodule.exports.register = register;\nmodule.exports.resolve = resolve;","\"use strict\";\n\nvar bundleURL = {};\nfunction getBundleURLCached(id) {\n var value = bundleURL[id];\n if (!value) {\n value = getBundleURL();\n bundleURL[id] = value;\n }\n return value;\n}\nfunction getBundleURL() {\n try {\n throw new Error();\n } catch (err) {\n var matches = ('' + err.stack).match(/(https?|file|ftp|(chrome|moz|safari-web)-extension):\\/\\/[^)\\n]+/g);\n if (matches) {\n // The first two stack frames will be this function and getBundleURLCached.\n // Use the 3rd one, which will be a runtime in the original bundle.\n return getBaseURL(matches[2]);\n }\n }\n return '/';\n}\nfunction getBaseURL(url) {\n return ('' + url).replace(/^((?:https?|file|ftp|(chrome|moz|safari-web)-extension):\\/\\/.+)\\/[^/]+$/, '$1') + '/';\n}\n\n// TODO: Replace uses with `new URL(url).origin` when ie11 is no longer supported.\nfunction getOrigin(url) {\n var matches = ('' + url).match(/(https?|file|ftp|(chrome|moz|safari-web)-extension):\\/\\/[^/]+/);\n if (!matches) {\n throw new Error('Origin not found');\n }\n return matches[0];\n}\nexports.getBundleURL = getBundleURLCached;\nexports.getBaseURL = getBaseURL;\nexports.getOrigin = getOrigin;","require('./helpers/bundle-manifest').register(require('./helpers/bundle-url').getBundleURL('fovHA'),JSON.parse(\"[\\\"fovHA\\\",\\\"article.5934031c.js\\\",\\\"1B73x\\\",\\\"fallback.994c57d6.webp\\\",\\\"ghiyx\\\",\\\"articles.6ddb47a2.js\\\"]\"));","import { getArticle, getArticles, getLatestArticle, buildPost, buildSummary } from \"./contentful\";\r\nimport fallbackImage from \"./../img/articles/fallback.webp\";\r\n\r\nasync function displayArticle() {\r\n\tconst articleId = getArticleIdFromUrl();\r\n\r\n\ttry {\r\n\t\tconst articles = await getArticles(5);\r\n\r\n\t\tif (articleId === null || articleId === undefined) {\r\n\t\t\tconst article = await getLatestArticle();\r\n\r\n\t\t\tbuildMainArticle(article);\r\n\t\t\tbuildSubArticles(articles, article);\r\n\t\t} else {\r\n\t\t\tconst article = await getArticle(articleId);\r\n\r\n\t\t\tbuildMainArticle(article);\r\n\t\t\tbuildSubArticles(articles, article);\r\n\t\t}\r\n\t} catch (error) {\r\n\t\tconsole.error(\"Failed to fetch articles:\", error);\r\n\t}\r\n}\r\n\r\ndocument.addEventListener(\"DOMContentLoaded\", displayArticle);\r\n\r\nfunction buildMainArticle(mainArticle) {\r\n\ttry {\r\n\t\tconst mainContainer = document.getElementById(\"article-container-single\");\r\n\t\tmainContainer.innerHTML = \"\";\r\n\r\n\t\tconst mainArticleHTML = `\r\n\t\t\t
\r\n\t\t\t\t\r\n\t\t\t\t
\r\n\t\t\t\t\t

${mainArticle?.fields?.title}

\r\n\t\t\t\t\t
\r\n\t\t\t\t\t
${buildPost(mainArticle?.fields?.blogContent)}
\r\n\t\t\t\t
\r\n\t\t\t\t\r\n\t\t\t
\r\n\t\t`;\r\n\r\n\t\tmainContainer.innerHTML = mainArticleHTML;\r\n\t} catch (error) {\r\n\t\tdocument.getElementById(\"article-container-single\").innerHTML = \"

Error loading article.

\";\r\n\t}\r\n}\r\n\r\nfunction buildSubArticles(subArticles, mainArticle) {\r\n\ttry {\r\n\t\tconst subContainer = document.getElementById(\"single-articles-container-secondary\");\r\n\t\tsubContainer.innerHTML = \"\";\r\n\r\n\t\tlet subArticlesHTML = \"\";\r\n\r\n\t\tsubArticles.forEach((subArticle) => {\r\n console.log(subArticle);\r\n\t\t\tif (subArticle.sys.id !== mainArticle.sys.id) {\r\n if(subArticle?.fields){\r\n const articleHTML = `\r\n
\r\n \r\n
\r\n \"${subArticle?.fields?.blogImage?.fields?.description\r\n
\r\n
\r\n
\r\n

${subArticle?.fields?.title}

\r\n
${buildSummary(subArticle?.fields?.blogContent)}
\r\n
\r\n \r\n
\r\n
\r\n
`;\r\n \r\n subArticlesHTML = subArticlesHTML + articleHTML;\r\n }\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\tsubContainer.innerHTML = subArticlesHTML;\r\n\t} catch (error) {\r\n\t\tdocument.getElementById(\"single-articles-container-secondary\").innerHTML = \"

Error loading articles.

\";\r\n\t}\r\n}\r\n\r\nfunction getArticleIdFromUrl() {\r\n\tconst queryParams = new URLSearchParams(window.location.search);\r\n\tconst articleId = queryParams.get(\"article\");\r\n\treturn articleId;\r\n}\r\n","module.exports = require('./helpers/bundle-url').getBundleURL('fovHA') + \"fallback.994c57d6.webp\";"],"names":["$parcel$export","e","n","v","s","Object","defineProperty","get","set","enumerable","configurable","$parcel$interopDefault","a","__esModule","default","$parcel$global","globalThis","self","window","global","$parcel$modules","$parcel$inits","parcelRequire","id","exports","init","module","call","err","Error","code","register","parcelRegister","$2a941bea8df0834f$export$6503ec6e8aabbaf","$2a941bea8df0834f$var$mapping","Map","baseUrl","manifest","i","length","path","$e003ce9b6e0ea8b1$export$bdfd709ae4826697","$e003ce9b6e0ea8b1$var$bundleURL","value","$e003ce9b6e0ea8b1$var$getBundleURL","matches","stack","match","replace","getBundleURL","JSON","parse","$6ZLBM","$4f7ef10c28579884$exports","$57f4de11441814ef$var$displayArticle","articleId","queryParams","URLSearchParams","location","search","articles","getArticles","article","getLatestArticle","$57f4de11441814ef$var$buildMainArticle","$57f4de11441814ef$var$buildSubArticles","getArticle","error","console","mainArticle","mainContainer","document","getElementById","innerHTML","mainArticleHTML","fields","blogImage","file","url","description","title","buildPost","blogContent","sys","updatedAt","toLocaleString","timeZone","substring","subArticles","subContainer","subArticlesHTML","forEach","subArticle","log","articleHTML","buildSummary","addEventListener"],"version":3,"file":"article.5934031c.js.map"}