PageSourceSearch

https://www.industrienspension.dk/assets/scripts/ip.135.f62b340b42a0a2df9a16.chunk.js

js industrienspension.dk collected 2026-10-04 22:22:57 UTC 7,322 bytes, 2 lines download raw bytes

1"use strict";(globalThis.webpackChunkindustrienspension=globalThis.webpackChunkindustrienspension||[]).push([[135,4068],{4068:(e,n,t)=>{t.r(n),t.d(n,{default:()=>s});var o=t(5253),a=t(3427);const r="data-pensionsplan-input",i=(e,n)=>{if(null==e)return null;switch(n){case"text":return""===e?null:e.trim();case"int":{const n=Number.parseInt(null==e?void 0:e.replaceAll(".",""),10);return Number.isNaN(n)?null:n}case"float":{const n=Number.parseFloat(e);return Number.isNaN(n)?null:n}case"checkbox":return"checked"===e.toLowerCase();case"boolAsNum":if(!0===e||1===e||"1"===e||"ja"===e.toLowerCase()||"yes"===e.toLowerCase())return 1;if(!1===e||0===e||"0"===e||"nej"===e.toLowerCase()||"no"===e.toLowerCase())return 0;if(""===e)return null;throw Error(`Cannot convert value ${e} to boolean number.`);default:throw Error(`Value type (${n}) not supported.`)}};class s{constructor(){this.init()}init(){o.default.isDevelopment&&console.log("Start:pensionsplan:data-handler"),window.pensionsplan||(window.pensionsplan={}),this.bindRadioButtonsToHiddenInputs(),window.pensionsplan.saveAndContinue=this.saveAndContinue,window.pensionsplan.saveData=this.saveData,window.pensionsplan.getDataFromInputFields=this.getDataFromInputFields,window.pensionsplan.onFieldsChange=s.onFieldsChange,window.pensionsplan.onRadioBtnClicked=s.onRadioBtnClicked,window.pensionsplan.getRadioBtnValue=s.getRadioBtnValue}static onFieldsChange(e,n,t=!1){Array.isArray(e)||(e=[e]);const o=e.map((e=>{const n=document.getElementById(e);return n||(console.warn(`Field with ID ${e} was not found. If you have a # in front of the ID you should remove it. If this is a partner field and the user has no partner, this might cause this warning to spawn.`),null)})),a=o.filter((e=>!!e));if(0===a.length)return void console.warn(`None of the elements with the given IDs [${e.join(", ")}] were found. On change listeners will not be added.`);const r=e=>{const n=e.map((e=>e.value||null));return 1===n.length?n[0]:n};if(a.forEach((e=>((e,n,t)=>{e.addEventListener("change",(function(){const e=r(n);t(e)}))})(e,o,n))),!t){const e=r(o);n(e)}}static onSelectChange(e,n,t=!1){const o=document.getElementById(e);if(!o)return void console.warn(`Select element with ID ${e} was not found and the event listener is therefore not added.`);if(!(o instanceof HTMLSelectElement))return void console.warn(`Element with ID ${e} is not a select element and the event listener is therefore not added.`);const a=()=>o.options[o.selectedIndex];if(o.addEventListener("change",(function(){const e=a();n(e)})),!t){const e=a();n(e)}}static onCheckboxCheckedChange(e,n){const t=document.getElementById(e);t?t.addEventListener("change",(e=>{n(t.checked)})):console.warn(`Checkbox element with ID ${e} was not found and the event listener is therefore not added.`)}static onRadioBtnClicked(e,n,t=!1){if([...document.querySelectorAll(`[name=${e}]`)].forEach((e=>{e.addEventListener("click",(e=>{const t=e.target.value;n(t)}))})),!t){const t=document.querySelector(`[name=${e}]:checked`);if(t){const e=t.value;n(e)}}}static getRadioBtnValue(e,n=!1){const t=(n=>{const t=[...document.querySelectorAll(`[name=${e}]`)];return n?t.filter((e=>(0,a.xj)(e))):t})(n),o=t.find((e=>e.checked));return o?o.value:null}bindRadioButtonsToHiddenInputs(){[...document.querySelectorAll(`input[type="hidden"][${r}][data-pensionsplan-radio-autolink]`)].forEach((e=>{const n=e.getAttribute(r);[...document.querySelectorAll(`input[type="radio"][${r}="${n}"]`)].forEach((n=>{n.addEventListener("click",(()=>{e.value=n.value})),n.checked&&(e.value=n.value)}))}))}getDataFromInputFields(){return[...document.querySelectorAll(`[${r}]:not([type="radio"])`)].reduce(((e,n)=>{const t=n.getAttribute(r);if(!t)throw Error(`Element ${n} must have attribute ${r}`);const o=n.getAttribute("data-pensionsplan-input-type")||"text";if("radio"===n.type&&!n.checked)return Object.assign(Object.assign({},e),{[t]:null});const s=(o,a,r)=>"checkbox"===n.type?n.checked?i("checked",a):i("",a):r?i(o,a):""!==e[t]&&void 0!==e[t]?e[t]:null,l=!(0,a.xj)(n.parentElement||n);var d;return null!=n.value&&null!=n.value?d=s(n.value,o,l):null!=n.innerText&&null!=n.innerText&&(d=s(n.innerText,o,l)),Object.assign(Object.assign({},e),{[t]:d})}),{})}saveAndContinue(e,n,t){n.preventDefault();if(!App.ipvalidationAuto.IPValidateElements(".ipvalidateenabled:visible"))return console.warn("Not all inputs are valid"),!1;window.dialog.spinnerOld("Gemmer...");const o=e.getAttribute("href"),a=window.pensionsplan.getDataFromInputFields();return this.saveData("/api/sitecore/PensionsplanMedAnbefaling/SaveStepData",a,t).then((e=>{if(!e.Ok)throw console.error(e),e.Message;window.dialog.close("spinner"),window.dialog.spinnerOld("Næste...",null,{id:"spinner2"}),window.location=o})).catch((e=>{window.dialog.alert(`<h3>Fejl ved gem af data</h3><p>${e}</p>`)})).finally((()=>{window.dialog.close("spinner"),window.dialog.close("spinner2")}))}static checkAndCorrectCurrencyFieldsForDecimals(e){if(!e.value)return;const n=e.hasAttribute("data-decimals"),t=e.value.replaceAll(".",""),o=n?t.replaceAll(",","."):t,a=parseFloat(parseFloat(o).toFixed(2)),r=n?t.replaceAll(".",","):a;e.value=r.toString()}saveData(e,n,t,o){if(!e)throw Error("URL may not be null or undefined.");if(!n)throw Error("Data map may not be null. To save empty values, give a datamap with a key pointing to null.");if(null==t)throw Error("Step may not be null or undefined. Step must be a number representing the step.");const a=new URLSearchParams;return a.append("data",JSON.stringify(n)),a.append("step",t),fetch(e,{method:"POST",body:a,headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"}}).then((e=>e.json())).then((e=>(void 0!==o&&o&&o(e),e))).catch((e=>{throw console.error("Error occurred while saving pensionsplan data: ",e),e}))}}},135:(e,n,t)=>{t.r(n),t.d(n,{default:()=>r});var o=t(5253),a=t(4068);
1class r{constructor(){this.init()}init(){o.default.isDevelopment&&console.log("Start:pensionsplan:step5"),this.setupEventListeners()}setupEventListeners(){var e;e="currency-field",[...document.getElementsByClassName(e)].forEach((e=>{e.addEventListener("change",(function(e){a.default.checkAndCorrectCurrencyFieldsForDecimals(e.target)}))}))}}},3427:(e,n,t)=>{t.d(n,{AJ:()=>r,C0:()=>w,C7:()=>s,H:()=>h,HY:()=>c,T7:()=>u,iI:()=>l,mZ:()=>i,og:()=>a,u9:()=>d,uV:()=>p,xj:()=>o});const o=e=>null===e.offsetParent,a=(e,n)=>{e.classList.contains(n)?e.classList.remove(n):e.classList.add(n)},r=e=>e instanceof HTMLElement,i=e=>document.getElementById(e),s=(e,n,t={})=>{const o=document.getElementById(e);if(o)n(o);else{const{errorMessage:n,throwErrorOnNotFound:o}=t,a=null!=n?n:`Could not find element with ID "${e}".`;if(o)throw Error(a);console.warn(a)}},l=(e,n=!1)=>e.map((e=>{const t=i(e);if(!t&&n)throw Error(`The element with ID ${e} couldn't be found in the dom.`);return t})),d=(e,n)=>{if(!e)throw Error("Element may not be null or undefined.");return Array.isArray(n)||(n=[n]),n.map((n=>e.getAttribute(n)))},c=(e,n)=>{const t=i(e);return null==t?void 0:t.getAttribute(n)},u=(e,n,t,o=!1)=>{if(e)e.style[n]=t;else if(o)throw Error("Element may not be null or undefined.")},p=(e,n,t,o=!1)=>{const a=i(e);u(a,n,t,o)},h=(e,n)=>{e&&(e.disabled=!n)},w=(e,n)=>{e.style.display=n?"none":"block"}}}]);
2//# sourceMappingURL=ip.135.f62b340b42a0a2df9a16.chunk.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.