1"use strict";(()=>{(self.webpackChunkdomstolno_spa_frontend=self.webpackChunkdomstolno_spa_frontend||[]).push([[1028],{1709(ue,K,r){r.r(K),r.d(K,{NewsListPage:()=>A,default:()=>Z});var s=r(4922),a=r(8184),b=r(5921),L=r(6852),W=r(8323),R=r(7272),g=r(6700),u=r(7810),w=r(3926),P=r(8167),F=r(4448),V=r(3278),z=r(2992),H=r(1467),X=r(8689),k=r(3420),m=r(7214),J=Object.defineProperty,I=Object.getOwnPropertySymbols,Q=Object.prototype.hasOwnProperty,Y=Object.prototype.propertyIsEnumerable,S=(l,d,t)=>d in l?J(l,d,{enumerable:!0,configurable:!0,writable:!0,value:t}):l[d]=t,G=(l,d)=>{for(var t in d||(d={}))Q.call(d,t)&&S(l,t,d[t]);if(I)for(var t of I(d))Y.call(d,t)&&S(l,t,d[t]);return l};const A=({data:l})=>{var d;const{t}=(0,m.Bd)(),B=(0,L.rO)(),q=(0,X.useNavigate)(),{language:i}=l,[x,ee]=(0,u.useState)(null),[v,p]=(0,u.useState)(null),[f,T]=(0,u.useState)(null),[N,se]=(0,u.useState)(g.$.Newest),[C,ne]=(0,u.useState)([]),[h,te]=(0,u.useState)(10),[E,le]=(0,u.useState)(0),[ae,oe]=(0,u.useState)(!1);(0,u.useEffect)(()=>{let e=!1;const n=`/api/episerver/v3/newslistpage/${l.contentLink.guidValue}?lang=${i.name}`;return H.A.get(n).then(o=>{if(!e&&o.data!=null&&o.data.length>0){const c=new Array;o.data.map(y=>{c.push(y)}),ee(c),T([...c]);let _=[...c];h*E>0&&_.splice(0,h*E),_=_.slice(0,h),p(_),oe(!0)}}),()=>{e=!0}},[i==null?void 0:i.name]),(0,u.useEffect)(()=>{(0,F.F9)({navigate:q})});function O(e){const n=[...C];n.includes(e)?n.splice(n.indexOf(e),1):n.push(e),ne(n);const o=D([...x],N,n,h,E);p(o)}function j(e){if(e.target.defaultValue===g.$.Newest||e.target.defaultValue===g.$.Oldest)se(e.target.defaultValue);else return;if(!v||v.length<2)return;const n=D([...x],e.target.defaultValue,C,h,E);p(n)}function re(e){const n=e.value;te(n);const o=D([...x],N,C,n,E);p(o)}function ie(e){const n=e-1;le(n);const o=D([...x],N,C,h,n);p(o)}function D(e,n,o,c,_){const $=[...e],y=ce($,o);T(y);const me=de(y,n),U=c*_;let M=[...me];return U>0&&M.splice(0,U),M=M.slice(0,c),M}function de(e,n){return n===g.$.Newest?e.sort((o,c)=>(0,w.U)(c,o)):n===g.$.Oldest?e.sort((o,c)=>(0,w.U)(o,c)):e}function ce(e,n){if(n.length===1&&(e=e.filter(o=>o.Category.split(",").includes(n[0]))),n.length>1){const o=[];e.forEach(c=>{for(const _ of n)if(c.Category.split(",").includes(_)){o.push(c);break}}),e=o}return e}return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(z.default,{currentContent:l}),(0,s.jsx)(b.DefaultPageContainer,{className:"news-list-page",iContent:l,heading:l.heading.value,children:(0,s.jsxs)("div",{className:"row newslist-page-container page-type-margin-bottom",children:[(0,s.jsx)("div",{className:"col-12 col-lg-6",children:(0,s.jsx)(V.Heading,G({},l))}),(l.mainIntro&&l.mainIntro.value!==""||B.isInEditMode())&&(0,s.jsx)("div",{id:"ingress",className:"col-12 col-lg-6",children:(0,s.jsx)(a.o5u,{className:"ingress-lead",typographyType:"leadMedium",as:"div",children:(0,s.jsx)(L.XF.mA,{className:"xhtml-container",iContent:l,field:"mainIntro"})})}),(l.mainBody&&l.mainBody.value!==""||B.isInEditMode())&&(0,s.jsx)("div",{id:"main-body",className:"col-12 col-lg-6",children:(0,s.jsx)(a.o5u,{className:"my-3",typographyType:"bodyLongMedium",as:"div",children:(0,s.jsx)(L.XF.mA,{className:"xhtml-container",iContent:l,field:"mainBody"})})}),(0,s.jsx)("div",{className:"col-12 col-lg-6 mt-4 mb-2",children:((d=l==null?void 0:l.newsListFilterCategory)==null?void 0:d.value)==20?(0,s.jsxs)(a.WKD,{label:t(`${m.Kn}.Filter`,i.name),children:[(0,s.jsx)(a.ffE,{label:t(`${m.Kn}.Advokat`,i.name),htmlProps:{onClick:()=>O(P.K.Advokat)}}),(0,s.jsx)(a.ffE,{label:t(`${m.Kn}.Meddommer`,i.name),htmlProps:{onClick:()=>O(P.K.Meddommer)}}),(0,s.jsx)(a.ffE,{label:t(`${m.Kn}.Selvprosederende`,i.name),htmlProps:{onClick:()=>O(P.K.Selvprosederende)}})]}):(0,s.jsxs)(a.WKD,{label:t(`${m.Kn}.Filter`,i.name),children:[(0,s.jsx)(a.ffE,{label:t(`${m.Kn}.NewsName`,i.name),htmlProps:{onClick:()=>O(P.K.News)}}),(0,s.jsx)(a.ffE,{label:t(`${m.Kn}.Statement`,i.name),htmlProps:{onClick:()=>O(P.K.Statement)}})]})}),f&&f.length>0&&(0,s.jsx)("div",{className:"col-12 col-lg-6",children:(0,s.jsxs)("div",{className:"row justify-content-between-newspage py-4",children:[(0,s.jsx)("div",{className:"col-5 d-flex flex-column-reverse",children:(0,s.jsxs)(a.o5u,{typographyType:"labelMedium",children:[t(`${a.vji}.Showing`,i.name)," ",h*E+1," -"," ",Math.min(h*(E+1),f.length)," ",t(`${m.Bz}.Of`,i.name)," ",f.length]})}),(0,s.jsx)("div",{className:"col-7",children:(0,s.jsxs)(a.zWQ,{id:"radio-button-news",label:t(`${m.Kn}.SortBy`,i.name),className:"news-radio-group",children:[(0,s.jsx)(a.aaP,{checked:N==g.$.Newest,htmlProps:{tabIndex:0,onKeyPress:e=>{e.key==="Enter"&&j(e)}},onChange:e=>j(e),label:t(`${m.Bz}.Newest`,i.name),value:g.$.Newest}),(0,s.jsx)(a.aaP,{checked:N==g.$.Oldest,htmlProps:{tabIndex:0,onKeyPress:e=>{e.key==="Enter"&&j(e)}},onChange:e=>j(e),label:t(`${m.Bz}.Oldest`,i.name),value:g.$.Oldest})]})})]})}),ae&&(0,s.jsx)(s.Fragment,{children:v&&v.length>0?(0,s.jsx)("div",{className:"news-list col-12 col-lg-6",children:v.map(e=>(0,s.jsx)("div",{className:"news-card",children:(0,s.jsx)(k.default,{href:e.Url,className:"d-block news-card-item",children:(0,s.jsxs)("div",{className:"row mx-0 px-0",children:[(0,s.jsxs)("div",{className:"col-11 mx-0 ps-1 pe-0",children:[(0,s.jsx)(a.o
15u,{typographyType:"headingMedium",as:"h2",children:e.Header}),(0,s.jsx)(a.o5u,{typographyType:"bodyShortMedium",className:"news-description",children:(0,R.Kn)(e)}),(0,s.jsx)(W.DateAndNewsCategory,{language:l.language.name,publishedDate:e.PublishedDate.toString(),category:e.Category?e.Category:null})]}),(0,s.jsx)("div",{className:"col-1 news-icon",children:(0,s.jsx)(a.Int,{icon:a.flY})})]})})},e.Id))}):(0,s.jsx)("div",{className:"col-12 col-lg-6 mt-4",children:(0,s.jsx)(a.JNP,{children:t(`${m.Kn}.NoNews`,i.name)})})}),f&&f.length>10&&(0,s.jsx)("div",{className:"col-12 col-lg-6 news-pagination",children:(0,s.jsx)(a.dKS,{className:"pagination-adjustment",itemsAmount:f.length,withCounter:!0,withSelect:!0,selectOptions:[{label:"10",value:10},{label:"25",value:25},{label:"50",value:50}],onChange:(e,n)=>ie(n),onSelectOptionChange:e=>re(e)})})]})})]})},Z=A}}]);})(); 2 3//# sourceMappingURL=components.page.newslistpage.e9e0c17f.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.