PageSourceSearch

https://secure246.lansforsakringar.se/nim/js/controller-CvtPcbHt.js

js lansforsakringar.se collected 2026-10-02 03:13:17 UTC 9,767 bytes, 1 lines download raw bytes

1import{E as x,d as O,j as n,J as w,aU as y,z as k,B as S,bI as D,u as L,br as U,az as G,q as V,X as q}from"./csw-PaWQ7Lg5.js";import{ah as o}from"./index-DzOZVwEm.js";const H="/life-insurance/pension/insurance/v1/insurance-contracts",M={getInsuranceContracts:H},c={GET_INSURANCE_CONTRACTS:"getInsuranceContracts"};function R(){return{services:{getInsuranceContracts:{isCalling:!1,isRequested:!1,response:void 0,errors:[],hasRequestError:!1}}}}function F(e){return(e.status||e.status===0)&&(e.status<200||e.status>299)?{insuranceContracts:[],errors:[{code:e.status+"",message:e.statusText}]}:e.responseJSON?e.responseJSON:e}function p(e,r,t){const a=F(t);return e.services[r].response=a,e.services[r].errors=a.errors||[],e.services[r].hasRequestError=a.errors&&a.errors.length>0||!1,e.services[r].isCalling=!1,e}function $(e,r,t){return e.services[r].isCalling=t,e.services[r].isRequested=!1,e}function B(e,r,t=!0){return e.services[r].isRequested=t,e}function J(e,r){return e.services[r].isCalling}function W(e,r){const t=e.services[r];return t.isRequested&&!t.isCalling&&(!t.response||t.hasRequestError)}function E(e,r){return e.services[r].response}function T(e,r){return e.services[r].hasRequestError}function A(e,r){return e.services[r].errors?.map(t=>t.code)||[]}function _(e){return E(e,c.GET_INSURANCE_CONTRACTS)?.insuranceContracts||[]}function X(e){return _(e).length>0}function j(e){return X(e)&&T(e,c.GET_INSURANCE_CONTRACTS)}function Y(e){return A(e,c.GET_INSURANCE_CONTRACTS).every(r=>r==="10")}function K(e){return A(e,c.GET_INSURANCE_CONTRACTS).some(r=>r==="10")}function z(e){return{owner:Q(e.roles?.policyHolder)||"",name:e.insuranceProduct?.name||"",insuranceNumber:e.insuranceId,insuranceId:e.id,status:e.status,legacyCategory:e.legacyInsuranceInformation?.category,taxCategory:e.insuranceProduct?.taxCategory?.name||"",insuranceCapital:e.insuranceCapital||0,hasDetails:e.legacyInsuranceInformation?.hasDetails??!0,livSystemOpen:e.legacyInsuranceInformation?.systemOpen??!0}}function Q(e){return e?.legalPerson?e.legalPerson.name:e?.naturalPerson?`${e.naturalPerson.firstName} ${e.naturalPerson.lastName}`:null}function Z(e){return _(e).map(z)}function P(e){return Z(e).sort((r,t)=>t.insuranceCapital-r.insuranceCapital)}function ee(e){return P(e).reduce(function(r,t){return t.insuranceCapital?r+Math.floor(t.insuranceCapital):r},0)}function v(e){const r=P(e);function t(a){return a.taxCategory==="ENDOWMENT_INSURANCE"}return r.filter(t)}function ne(e){return v(e).length>0}function g(e){return e.status==="OUT_PAYMENT"&&e.legacyCategory!=="IPS"}function b(e){return e.livSystemOpen&&e.hasDetails}function re(e){return e==="INSURANCE"?o.INSURANCE_DETAILS_CHOSEN:o.LUMERA_DETAILS_CHOSEN}function te({ajax:e,profile:r,model:t}){const a={...x},l=O();function d(i){return{insuranceContracts:[],errors:[{code:i.status,message:i.statusText}]}}function f(){t.swap($,c.GET_INSURANCE_CONTRACTS,!0),e.apip({url:M.getInsuranceContracts,type:"GET",headers:{"X-LF-Profile":JSON.stringify(r)}}).done(function(i){t.swap(p,c.GET_INSURANCE_CONTRACTS,i)}).fail(function(i){t.swap(p,c.GET_INSURANCE_CONTRACTS,d(i))}).always(function(){l.resolve()})}function u(){const i=t.deref();W(i,c.GET_INSURANCE_CONTRACTS)&&f()}return{start:function(){a.listenTo(t,"change",u),u()},stop:function(){a.stopListening()},getGetInsuranceContractsPromise:()=>l}}const se={general:{header:"Vi kunde inte hämta dina pensioner.",text:"Vi jobbar på att lösa problemet. Försök igen eller kom tillbaka lite senare. Om problemet kvarstår, kontakta oss så hjälper vi dig.",accessDeniedText:"Du saknar behörighet att se pensioner."},partialContent:{header:"Just nu har vi problem att visa vissa försäkringar.",text:"Det kan innebära att du inte kan se hela ditt innehav.",accessDeniedText:"Du saknar behörighet att se vissa pensioner."}},m={errors:se};function I({errorType:e,onRetry:r}){const a=(l=>{switch(l){case"206":return{header:m.errors.partialContent.header,body:m.errors.partialContent.text};case"10":return{header:m.errors.general.header,body:m.errors.general.accessDeniedText};case"206_AND_10":return{header:m.errors.partialContent.accessDeniedText,body:""};default:return{header:m.errors.general.header,body:m.errors.general.text}}})(e);return e==="206"||e==="206_AND_10"?n.jsx(w,{dataTestId:"overview-error-alert-panel",type:"warning",headerText:a.header,alertText:a.body,textAsOneRow:!0,removeTextDivider:!0}):n.jsx(y,{icon:e==="10"?k.CO_APPLICANTS_MULTICOLOR_96:void 0,onRetry:e==="10"?void 0:r,"data-test-id":"overview-error-error-block",headerText:a.header,errorText:a.body})}const ae={columnHeaderName:"Namn",columnHeaderValue:"Aktuellt värde kr",sectionHeaderEndowment:"Kapitalförsäkring",total:"Totalt värde"},ie="Pension",oe="Försäkringsnummer",ce={outPayment:"Under utbetalning"},C={list:ae,pension:ie,insuranceNumber:oe,status:ce};function le({state:e,size:r,triggerEvent:t,enableOverviewChoice:a}){const l=D({decimals:0,currency:"kr",roundDown:!0}),d=s=>g(s)?n.jsx("div",{className:"tag tag-info",children:n.jsx("span",{className:"text-black",children:C.status.outPayment})}):null,f=({dataTestId:s,sectionHeader:N,sectionRows:h})=>n.jsxs("tbody",{"data-test-id":s,children:[n.jsx("tr",{className:"table-ignore-clickable",children:n.jsx("th",{className:"th-sub",colSpan:3,scope:"row",children:N})}),h]}),u=s=>n.jsxs("tr",{"data-test-id":s.insuranceId+"-row",onClick:()=>b(s)?t({name:re(s.legacyCategory),data:{id:s.insuranceId}}):void 0,children:[n.jsxs("td",{className:"py-05",children:[b(s)?n.jsx(S,{buttonType:"link",className:"btn btn-link text-left","data-test-id":"pension-detail
1s-link-"+s.insuranceId,label:s.owner}):n.jsx("p",{className:"mb-0 text-nowrap","data-test-id":"pension-details-disabled-"+s.insuranceId,children:s.owner}),n.jsx("div",{className:"text-muted text-sm",children:s.name}),n.jsxs("div",{className:"text-muted text-sm",children:[n.jsx("span",{children:r!=="small"?`${C.insuranceNumber} `:""}),s.insuranceNumber]})]}),g(s)&&r!=="small"?n.jsx("td",{children:d(s)}):null,n.jsxs("td",{className:"text-right py-05",colSpan:2,children:[n.jsx("span",{children:l(s.insuranceCapital)}),r==="small"&&g(s)?n.jsx("div",{className:"pt-025",children:d(s)}):null]})]},s.insuranceId),i=v(e).map(u);return n.jsx("div",{"data-test-id":"pensions-list-view",children:n.jsxs("div",{className:"card",children:[n.jsxs("table",{className:"table table-clickable mb-0","data-test-id":"pension-list-table",children:[n.jsx("thead",{children:n.jsx("tr",{children:n.jsx("td",{className:"border-0",colSpan:3,children:n.jsxs("div",{className:"d-flex justify-content-between",children:[n.jsx("strong",{className:"font-sans-serif text-nowrap",children:C.list.columnHeaderName}),n.jsx("strong",{className:"font-sans-serif text-nowrap",children:C.list.columnHeaderValue})]})})})}),ne(e)?n.jsx(f,{dataTestId:"ENDOWMENT-table-section",sectionHeader:C.list.sectionHeaderEndowment,sectionRows:i}):null,n.jsx("tbody",{children:n.jsxs("tr",{className:"table-ignore-clickable",style:{backgroundColor:"#fafafa"},children:[n.jsx("td",{colSpan:2,children:n.jsx("span",{className:"w-100 bd-highlight",children:n.jsx("strong",{children:C.list.total})})}),n.jsx("td",{className:"text-right",children:n.jsx("span",{className:"text-nowrap text-right bd-highlight",children:n.jsx("strong",{children:j(e)?"- kr":l(ee(e))})})})]})})]}),a?n.jsx("footer",{className:"text-right card-footer",children:n.jsx(S,{buttonType:"link",dataTestId:"pension-list-footer",label:C.pension,onClick:function(){t({name:o.OVERVIEW_CHOSEN})}})}):null]})})}const ue="Översikt för ditt sparande",de={overviewForYourSavings:ue},Ne={small:0,medium:550,large:650};function fe({state:e,triggerEvent:r,pensionServicePromises:t,loadOnDemand:a,headerText:l,enableOverviewChoice:d,onErrorRetry:f}){const{size:u,setRef:i}=L(Ne),s=function(){return J(e,c.GET_INSURANCE_CONTRACTS)?n.jsx("div",{className:"card",children:n.jsx("div",{className:"card-block",children:n.jsx(G,{})})}):T(e,c.GET_INSURANCE_CONTRACTS)&&v(e).length===0?n.jsx(I,{errorType:Y(e)?"10":void 0,onRetry:f}):n.jsxs("div",{className:"d-flex flex-column",children:[j(e)?n.jsx("div",{className:"card m-0 p-0",children:n.jsx("div",{className:"card-block pb-0",children:n.jsx(I,{errorType:K(e)?"206_AND_10":"206"})})}):null,n.jsx("div",{className:"m-0 p-0",children:n.jsx(le,{state:e,size:u,triggerEvent:r,enableOverviewChoice:d})})]})};return n.jsx("div",{"data-test-id":"pension-overview-panel",ref:i,children:n.jsx(U,{initiallyExpanded:!a,disabled:!1,caption:l||de.overviewForYourSavings,onClick:function(){r({name:o.PANEL_CLICKED})},promise:t,onCollapse:function(){r({name:o.PANEL_COLLAPSED})},onExpand:function(){r({name:o.PANEL_EXPANDED})},children:s()})})}function he({ajax:e,profile:r,model:t=V(R())}){const a={...x};t.swap(()=>R());const l=te({ajax:e,profile:r,model:t});l.start();const d=()=>{(!E(t.deref(),c.GET_INSURANCE_CONTRACTS)||E(t.deref(),c.GET_INSURANCE_CONTRACTS)&&T(t.deref(),c.GET_INSURANCE_CONTRACTS))&&t.swap(B,c.GET_INSURANCE_CONTRACTS,!0)};return a.overviewView={render:function(f,u){u?.loadOnDemand||d();const i=q({target:f,Component:fe,getProps:()=>({state:t.deref(),triggerEvent:({name:N,data:h})=>{N===o.PANEL_CLICKED?d():N===o.PANEL_EXPANDED?a.trigger(o.PANEL_EXPANDED):N===o.PANEL_COLLAPSED?a.trigger(o.PANEL_COLLAPSED):N===o.RETRY?a.trigger(o.RETRY):N===o.OVERVIEW_CHOSEN?a.trigger(o.OVERVIEW_CHOSEN):(a.trigger(N,h?.id),a.trigger(o.TRACKING_EVENT,{name:"showDetail
1s"}))},pensionServicePromises:l.getGetInsuranceContractsPromise(),loadOnDemand:u?.loadOnDemand,headerText:u?.headerText,enableOverviewChoice:u?.enableOverviewChoice,onErrorRetry:()=>{d()}})});i.render();const s={...x};return s.listenTo(t,"change",i.render),s.remove=function(){i.unmountComponent(),s.stopListening()},s}},a}export{he as default};

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.