{"version":3,"file":"ShortlistSource.CCMLOxbt.mjs","names":["__esmMin","window","init_ssg_sandbox_shims","c","init_jsx_runtime","labelFor","path","en","label","wrap","target","a","SOURCE_KEY","Component","props","withShortlistSource","withShortlistSourceAbonnemang","init_ShortlistSource"],"sources":["https:/framerusercontent.com/modules/rXALb1FpcQvOKczxHxIb/kt3GY1LZ2qsaZB7L3jbw/ShortlistSource.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";// Kommer ihåg från vilken sida besökaren klickade sig till Shortlist-testet.\n// Testet läser värdet och skickar det som \"Källa\" till kalkylarket.\nconst SOURCE_KEY=\"crux-shortlist-fran\";function labelFor(label){const path=(typeof window!==\"undefined\"?window.location.pathname:\"\").replace(/^\\/+|\\/+$/g,\"\");const en=path===\"en\"||path.indexOf(\"en/\")===0;if(label)return en?\"en/\"+label:label;if(path===\"\")return\"startsidan\";if(path===\"en\")return\"en/startsidan\";return path;}function wrap(Component,label){return props=>/*#__PURE__*/_jsx(\"div\",{style:{display:\"contents\"},onClickCapture:e=>{const target=e.target;const a=target&&target.closest?target.closest(\"a\"):null;if(!a||!/shortlist-test/.test(a.getAttribute(\"href\")||\"\"))return;try{window.sessionStorage.setItem(SOURCE_KEY,JSON.stringify({l:labelFor(label),t:Date.now()}));}catch(err){}},children:/*#__PURE__*/_jsx(Component,{...props})});}export function withShortlistSource(Component){return wrap(Component);}export function withShortlistSourceAbonnemang(Component){return wrap(Component,\"abonnemang\");}\nexport const __FramerMetadata__ = {\"exports\":{\"withShortlistSourceAbonnemang\":{\"type\":\"reactHoc\",\"name\":\"withShortlistSourceAbonnemang\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withShortlistSource\":{\"type\":\"reactHoc\",\"name\":\"withShortlistSource\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./ShortlistSource.map"],"mappings":"A,kHAEuC,SAASK,EAAS,EAAM,CAAC,IAAMC,GAAaL,IAAS,OAAqC,GAAzBA,EAAO,SAAS,SAAS,CAAI,QAAQ,aAAa,EAAE,EAAQM,EAAGD,IAAO,MAAMA,EAAK,QAAQ,KAAK,IAAI,EAA4G,OAAvGE,EAAaD,EAAG,MAAMC,EAAMA,EAASF,IAAO,GAAS,aAAgBA,IAAO,KAAW,gBAAuBA,CAAK,CAAC,SAASG,EAAK,EAAU,EAAM,CAAC,MAAO,IAAoB,gBAAK,MAAM,CAAC,MAAM,CAAC,QAAQ,UAAU,EAAE,eAAe,GAAG,CAAC,IAAMC,EAAO,EAAE,OAAaC,EAAED,GAAQA,EAAO,QAAQA,EAAO,QAAQ,GAAG,EAAE,KAAK,GAAIC,GAAI,iBAAiB,KAAKA,EAAE,aAAa,MAAM,GAAG,EAAE,EAAS,GAAG,CAACV,EAAO,eAAe,QAAQW,EAAW,KAAK,UAAU,CAAC,EAAEP,EAASG,CAAK,EAAE,EAAE,KAAK,IAAI,CAAC,CAAC,CAAC,CAAE,MAAW,CAAC,CAAC,EAAE,SAAsB,gBAAKK,EAAU,CAAC,GAAGC,CAAK,CAAC,CAAC,CAAC,CAAE,CAAC,SAAgBC,EAAoB,EAAU,CAAC,OAAON,EAAKI,CAAS,CAAE,CAAC,SAAgBG,EAA8B,EAAU,CAAC,OAAOP,EAAKI,EAAU,YAAY,CAAE,C,4CAAt4B,EAAW,qB"}