PageSourceSearch

https://pb.carnegie.se/assets/ArticleDrawer-UrPHY4QZ.js

js carnegie.se collected 2026-09-24 23:26:39 UTC 4,417 bytes, 16 lines download raw bytes

1import{n as r,r as d,t as c}from"./emotion-react-jsx-runtime.browser.esm-BmijSlgY.js";import{i as b}from"./i18next-DWwX__3I.js";import{t as k}from"./link-tLekbh5y.js";import{r as v}from"./useDrawerStore-D_TmFO-r.js";import{t as y}from"./display-text-t7AAPgLX.js";import{t as h}from"./paragraph-cB6MzNM3.js";import{t as T}from"./heading-MRBENOc_.js";import{t as z}from"./useHttpSwr-Cd5Ps4HJ.js";import{t as C}from"./label-date-row-DLpEMTdq.js";import{n as a,t as w}from"./esm-BfsJSBnP.js";import{t as E}from"./CarnegieMaterialSimpleHtml-DAwQArsz.js";function I(t){const{data:e,error:s}=z(`/content/article/${t}`);return{article:e?.item,error:s}}function f(t){return t instanceof a.Element?!0:typeof t=="object"&&t!==null&&"name"in t&&"attribs"in t}function p(t){return t.type==="text"&&t.data.replace(/\u00a0/g," ").trim().length>0}function N(t){return!t.some(e=>f(e)?e.name!=="br":p(e))}function S(t){const e=t.findIndex(f);if(e===-1)return null;const s=t[e];if(!f(s)||s.name!=="strong"||t.slice(0,e).some(p))return null;let n=e+1;const i=t[n];return f(i)&&i.name==="br"&&(n+=1),{strong:s,rest:t.slice(n)}}function H(t){const e=t.filter(f);return e.length!==1||e[0].name!=="em"||t.some(s=>p(s))?null:e[0]}function P(t){return t?t.includes("cta")||t.includes("alignfull")||t.includes("white-bg"):!1}function R({html:t}){const e={replace:s=>{if(s instanceof a.Element){const{attribs:n,children:i,name:l}=s;if(n?.class==="cta"||l==="div"&&P(n?.class))return n?.class==="cta"?r(c,{}):r(c,{children:(0,a.domToReact)(i,e)});if(n?.class?.includes("embed-message--youtube")&&n["data-content"])return r(c,{children:w(n["data-content"],e)});if(l==="blockquote")return r(y,{size:"s",children:(0,a.domToReact)(i,e)});if(l==="cite")return r("span",{className:"text-[20px]/6 font-medium",children:(0,a.domToReact)(i,e)});if(l==="h1")return r(c,{});if(l==="em")return r("em",{className:"italic",children:(0,a.domToReact)(i,e)});if(l==="p"){const m=i;if(N(m))return r(c,{});const o=H(m);if(o)return r(h,{size:"l",className:"my-6 italic",children:(0,a.domToReact)(o.children,e)});const u=S(m);if(u){const g=!N(u.rest);return d(c,{children:[r(T,{as:"h2",size:"xl",className:"mt-6 mb-2 font-medium",children:(0,a.domToReact)(u.strong.children,e)}),g?r(h,{size:"l",className:"mb-4",children:(0,a.domToReact)(u.rest,e)}):null]})}return r(h,{size:"l",className:"mb-4",children:(0,a.domToReact)(i,e)})}if(l==="figure")return r("figure",{className:"mb-4",children:(0,a.domToReact)(i,e)});if(l==="img")return r("img",{className:"h-auto w-full max-w-full",src:n?.src,alt:n?.alt??"",decoding:n.decoding});if(l==="ul")return r("ul",{className:"mb-4 ml-4 list-outside list-disc",children:(0,a.domToReact)(i,e)});if(l==="li")return r("li",{className:"ml-4",children:(0,a.domToReact)(i,e)});if(l==="iframe"&&(n.width="100%",n.height="100%",n.border="none"),l==="a"){const m=i&&i[0],o=m instanceof a.Element&&m?.name==="img";return r(k,{href:n?.href??"#",size:"lg",children:o?r("img",{className:`
2                    h-auto w-full max-w-[321px]
3                    sm:max-w-[480px]
4                  `,src:m.attribs.src,alt:""}):(0,a.domToReact)(i,e)})}}}};return r(c,{children:w(t,e)})}R.displayName="CarnegieMaterialHtml";var G=()=>{const{routeProps:t=""}=v(),{article:e}=I(t);if(!e)return null;const{author:s,date:n,message:i,messageImage:l,messageIntroduction:m,thumbnail:o,title:u}=e,g=(e?.formattedCategories?.[0]?.name??"")+(s?` - ${s}`:""),x=l??o??null;return d("article",{className:`
5        flex w-full flex-col px-6
6        md:px-0
7      `,children:[d("div",{className:"mx-auto w-full",children:[d("header",{children:[r(C,{label:g,date:n}),r(T,{as:"h1",size:"xxl",className:"mt-4 font-display font-normal",children:u})]}),r("section",{"aria-label":b("Introduktion"),className:"mt-4",children:r(h,{as:"div",size:"xl",children:r(E,{convertLinks:!0,html:m??""})})})]}),x&&r("figure",{className:`
8            -mx-6 mt-4 aspect-video w-[calc(100%+3rem)] overflow-hidden
9            md:-mx-12 md:mt-6 md:w-[calc(100%+6rem)]
10          `,children:r("img",{src:x,alt:"",className:"size-full object-cover object-center"})}),r("div",{className:"mx-auto w-full",children:r("section",{className:`
11            mt-4 w-full
12            md:mt-6
13            [&_iframe]:h-[372px] [&_iframe]:w-full
14          `,"aria-label":b("Innehåll i artikeln"),children:r(R,{html:i??""})})})]})};export{G as default};
15
16//# sourceMappingURL=ArticleDrawer-UrPHY4QZ.js.map

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.