PageSourceSearch

https://partco.fi/assets/custom-components-DazXlHvw.js

js partco.fi collected 2026-09-25 15:14:02 UTC 12,334 bytes, 2 lines download raw bytes

1import{a as Ce,B as we}from"./pages-components-BHKSTQuG.js";import{S as ne,i as ie,s as re,T as D,d as p,t as H,b as A,F as R,aA as ae,aB as oe,G as V,c as g,a9 as U,e as k,g as T,h as S,o as y,f as C,k as w,q as E,a as ce,m as ue,H as B,j as he,p as fe,ab as Ee,U as de,L as _e,E as W,am as P,an as Me,ao as Ae,ap as De,ac as Ne,au as Ie,a1 as Ue,n as J,D as Y,z,B as j}from"./main-Cl7sqRQx.js";function K(i,e,t){const l=i.slice();return l[6]=e[t],l[8]=t,l}function Q(i,e,t){const l=i.slice();return l[9]=e[t],l}function x(i,e){let t,l,r;return l=new Ce({props:{block:e[9]}}),{key:i,first:null,c(){t=B(),fe(l.$$.fragment),this.h()},l(s){t=B(),he(l.$$.fragment,s),this.h()},h(){this.first=t},m(s,h){k(s,t,h),ue(l,s,h),r=!0},p(s,h){e=s;const b={};h&1&&(b.block=e[9]),l.$set(b)},i(s){r||(A(l.$$.fragment,s),r=!0)},o(s){H(l.$$.fragment,s),r=!1},d(s){s&&p(t),ce(l,s)}}}function $(i,e){let t,l=[],r=new Map,s,h,b,u=D(e[6].blocks||[]);const a=n=>n[9].id||n[9];for(let n=0;n<u.length;n+=1){let f=Q(e,u,n),m=a(f);r.set(m,l[n]=x(m,f))}return{key:i,first:null,c(){t=y("div");for(let n=0;n<l.length;n+=1)l[n].c();s=E(),this.h()},l(n){t=T(n,"DIV",{class:!0,style:!0});var f=S(t);for(let m=0;m<l.length;m+=1)l[m].l(f);s=w(f),f.forEach(p),this.h()},h(){g(t,"class","cms-column svelte-6yk9j6"),g(t,"style",h=e[4](e[8])),this.first=t},m(n,f){k(n,t,f);for(let m=0;m<l.length;m+=1)l[m]&&l[m].m(t,null);C(t,s),b=!0},p(n,f){e=n,f&1&&(u=D(e[6].blocks||[]),R(),l=ae(l,f,a,1,e,u,r,t,oe,x,s,Q),V()),(!b||f&1&&h!==(h=e[4](e[8])))&&g(t,"style",h)},i(n){if(!b){for(let f=0;f<u.length;f+=1)A(l[f]);b=!0}},o(n){for(let f=0;f<l.length;f+=1)H(l[f]);b=!1},d(n){n&&p(t);for(let f=0;f<l.length;f+=1)l[f].d()}}}function He(i){let e,t=[],l=new Map,r,s,h=D(i[0]);const b=u=>u[8];for(let u=0;u<h.length;u+=1){let a=K(i,h,u),n=b(a);l.set(n,t[u]=$(n,a))}return{c(){e=y("div");for(let u=0;u<t.length;u+=1)t[u].c();this.h()},l(u){e=T(u,"DIV",{class:!0,style:!0});var a=S(e);for(let n=0;n<t.length;n+=1)t[n].l(a);a.forEach(p),this.h()},h(){g(e,"class","cms-columns svelte-6yk9j6"),g(e,"style",r=`display:flex;line-height:normal;gap:${i[1]}px`),U(e,"cms-stack-tablet",i[2]==="tablet"),U(e,"cms-stack-mobile",i[2]==="mobile"),U(e,"cms-stack-reverse",i[3])},m(u,a){k(u,e,a);for(let n=0;n<t.length;n+=1)t[n]&&t[n].m(e,null);s=!0},p(u,[a]){a&17&&(h=D(u[0]),R(),t=ae(t,a,b,1,u,h,l,e,oe,$,null,K),V()),(!s||a&2&&r!==(r=`display:flex;line-height:normal;gap:${u[1]}px`))&&g(e,"style",r),(!s||a&4)&&U(e,"cms-stack-tablet",u[2]==="tablet"),(!s||a&4)&&U(e,"cms-stack-mobile",u[2]==="mobile"),(!s||a&8)&&U(e,"cms-stack-reverse",u[3])},i(u){if(!s){for(let a=0;a<h.length;a+=1)A(t[a]);s=!0}},o(u){for(let a=0;a<t.length;a+=1)H(t[a]);s=!1},d(u){u&&p(e);for(let a=0;a<t.length;a+=1)t[a].d()}}}function Le(i,e,t){let{columns:l=[]}=e,{space:r=20}=e,{stackColumnsAt:s="tablet"}=e,{reverseColumnsWhenStacked:h=!1}=e;const b=a=>l[a]&&l[a].width?l[a].width:100/l.length,u=a=>{const n=b(a),f=r*(l.length-1)*n/100;return`display:flex;flex-direction:column;align-items:stretch;width:calc(${n}% - ${f}px)`};return i.$$set=a=>{"columns"in a&&t(0,l=a.columns),"space"in a&&t(1,r=a.space),"stackColumnsAt"in a&&t(2,s=a.stackColumnsAt),"reverseColumnsWhenStacked"in a&&t(3,h=a.reverseColumnsWhenStacked)},[l,r,s,h,u]}class Be extends ne{constructor(e){super(),ie(this,e,Le,He,re,{columns:0,space:1,stackColumnsAt:2,reverseColumnsWhenStacked:3})}}function ee(i,e,t){const l=i.slice();return l[29]=e[t],l[31]=t,l}function te(i,e,t){const l=i.slice();return l[32]=e[t],l[31]=t,l}function We(i){let e,t,l,r=i[3]().length>1,s,h,b,u,a=D(i[3]()),n=[];for(let o=0;o<a.length;o+=1)n[o]=le(te(i,a,o));const f=o=>H(n[o],1,1,()=>{n[o]=null});let m=r&&Ve(i);return{c(){e=y("section"),t=y("div");for(let o=0;o<n.length;o+=1)n[o].c();l=E(),m&&m.c(),this.h()},l(o){e=T(o,"SECTION",{class:!0,"data-testid":!0,style:!0});var c=S(e);t=T(c,"DIV",{class:!0});var d=S(t);for(let v=0;v<n.length;v+=1)n[v].l(d);d.forEach(p),l=w(c),m&&m.l(c),c.forEach(p),this.h()},h(){g(t,"class","hero_slider_track no-scroll-bar svelte-1bmf0u"),g(e,"class","hero_slider svelte-1bmf0u"),g(e,"data-testid","hero-slider"),g(e,"style",s=`--hero-slider-height: ${Number(i[0])}px; --hero-slider-duration: ${Number(i[1])}s;`)},m(o,c){k(o,e,c),C(e,t);for(let d=0;d<n.length;d+=1)n[d]&&n[d].m(t,null);i[13](t),C(e,l),m&&m.m(e,null),h=!0,b||(u=[W(t,"scroll",i[14]),P(Me.call(null,t,i[15])),P(Ae.call(null,t,i[16])),P(De.call(null,t,i[17]))],b=!0)},p(o,c){if(c[0]&24){a=D(o[3]());let d;for(d=0;d<a.length;d+=1){const v=te(o,a,d);n[d]?(n[d].p(v,c),A(n[d],1)):(n[d]=le(v),n[d].c(),A(n[d],1),n[d].m(t,null))}for(R(),d=a.length;d<n.length;d+=1)f(d);V()}r&&m.p(o,c),(!h||c[0]&3&&s!==(s=`--hero-slider-height: ${Number(o[0])}px; --hero-slider-duration: ${Number(o[1])}s;`))&&g(e,"style",s)},i(o){if(!h){for(let c=0;c<a.length;c+=1)A(n[c]);h=!0}}
1,o(o){n=n.filter(Boolean);for(let c=0;c<n.length;c+=1)H(n[c]);h=!1},d(o){o&&p(e),de(n,o),i[13](null),m&&m.d(),b=!1,_e(u)}}}function Oe(i){let e,t=i[32].kicker+"",l;return{c(){e=y("p"),l=j(t),this.h()},l(r){e=T(r,"P",{class:!0});var s=S(e);l=z(s,t),s.forEach(p),this.h()},h(){g(e,"class","hero_slider_kicker svelte-1bmf0u")},m(r,s){k(r,e,s),C(e,l)},p:Y,d(r){r&&p(e)}}}function Pe(i){let e,t=i[32].title+"",l;return{c(){e=y("h1"),l=j(t),this.h()},l(r){e=T(r,"H1",{class:!0});var s=S(e);l=z(s,t),s.forEach(p),this.h()},h(){g(e,"class","hero_slider_title svelte-1bmf0u")},m(r,s){k(r,e,s),C(e,l)},p:Y,d(r){r&&p(e)}}}function Re(i){let e,t=i[32].ctaText+"",l;return{c(){e=y("a"),l=j(t),this.h()},l(r){e=T(r,"A",{class:!0,href:!0});var s=S(e);l=z(s,t),s.forEach(p),this.h()},h(){g(e,"class","hero_slider_cta svelte-1bmf0u"),g(e,"href",i[32].ctaUrl)},m(r,s){k(r,e,s),C(e,l)},p:Y,d(r){r&&p(e)}}}function le(i){let e,t,l,r,s,h,b,u,a;l=new Ie({props:{src:i[32].image,alt:i[32].title??"",title:i[32].title??"",sizes:Ue,preloadImage:!0}});let n=i[32].kicker&&Oe(i),f=i[32].title&&Pe(i),m=i[32].ctaText&&i[32].ctaUrl&&Re(i);return{c(){e=y("article"),t=y("picture"),fe(l.$$.fragment),r=E(),s=y("div"),n&&n.c(),h=E(),f&&f.c(),b=E(),m&&m.c(),u=E(),this.h()},l(o){e=T(o,"ARTICLE",{class:!0,"aria-hidden":!0});var c=S(e);t=T(c,"PICTURE",{class:!0});var d=S(t);he(l.$$.fragment,d),d.forEach(p),r=w(c),s=T(c,"DIV",{class:!0});var v=S(s);n&&n.l(v),h=w(v),f&&f.l(v),b=w(v),m&&m.l(v),v.forEach(p),u=w(c),c.forEach(p),this.h()},h(){g(t,"class","hero_slider_background svelte-1bmf0u"),g(s,"class","hero_slider_content svelte-1bmf0u"),g(e,"class","hero_slider_slide svelte-1bmf0u"),g(e,"aria-hidden",i[31]!==i[4]())},m(o,c){k(o,e,c),C(e,t),ue(l,t,null),C(e,r),C(e,s),n&&n.m(s,null),C(s,h),f&&f.m(s,null),C(s,b),m&&m.m(s,null),C(e,u),a=!0},p(o,c){o[32].kicker&&n.p(o,c),o[32].title&&f.p(o,c),o[32].ctaText&&o[32].ctaUrl&&m.p(o,c)},i(o){a||(A(l.$$.fragment,o),a=!0)},o(o){H(l.$$.fragment,o),a=!1},d(o){o&&p(e),ce(l),n&&n.d(),f&&f.d(),m&&m.d()}}}function Ve(i){let e,t='<svg width="24" height="24" fill="currentColor" viewBox="0 0 16 16"><path d="M11.354 1.646a.5.5 0 0 1 0 .708L5.707 8l5.647 5.646a.5.5 0 0 1-.708.708l-6-6a.5.5 0 0 1 0-.708l6-6a.5.5 0 0 1 .708 0z"></path></svg>',l,r,s='<svg width="24" height="24" fill="currentColor" viewBox="0 0 16 16"><path d="M4.646 1.646a.5.5 0 0 1 .708 0l6 6a.5.5 0 0 1 0 .708l-6 6a.5.5 0 0 1-.708-.708L10.293 8 4.646 2.354a.5.5 0 0 1 0-.708z"></path></svg>',h,b,u,a,n,f,m=D(i[3]()),o=[];for(let c=0;c<m.length;c+=1)o[c]=se(ee(i,m,c));return{c(){e=y("button"),e.innerHTML=t,l=E(),r=y("button"),r.innerHTML=s,h=E(),b=y("div");for(let c=0;c<o.length;c+=1)o[c].c();u=E(),a=y("div"),this.h()},l(c){e=T(c,"BUTTON",{type:!0,class:!0,"aria-label":!0,"data-svelte-h":!0}),J(e)!=="svelte-1o953y"&&(e.innerHTML=t),l=w(c),r=T(c,"BUTTON",{type:!0,class:!0,"aria-label":!0,"data-svelte-h":!0}),J(r)!=="svelte-kjx4vk"&&(r.innerHTML=s),h=w(c),b=T(c,"DIV",{class:!0});var d=S(b);for(let v=0;v<o.length;v+=1)o[v].l(d);d.forEach(p),u=w(c),a=T(c,"DIV",{class:!0}),S(a).forEach(p),this.h()},h(){g(e,"type","button"),g(e,"class","hero_slider_button previous svelte-1bmf0u"),g(e,"aria-label","Previous"),g(r,"type","button"),g(r,"class","hero_slider_button next svelte-1bmf0u"),g(r,"aria-label","Next"),g(b,"class","hero_slider_bullets svelte-1bmf0u"),g(a,"class","hero_slider_timer svelte-1bmf0u")},m(c,d){k(c,e,d),k(c,l,d),k(c,r,d),k(c,h,d),k(c,b,d);for(let v=0;v<o.length;v+=1)o[v]&&o[v].m(b,null);k(c,u,d),k(c,a,d),n||(f=[W(e,"click",i[18]),W(r,"click",i[19])],n=!0)},p(c,d){if(d[0]&48){m=D(c[3]());let v;for(v=0;v<m.length;v+=1){const N=ee(c,m,v);o[v]?o[v].p(N,d):(o[v]=se(N),o[v].c(),o[v].m(b,null))}for(;v<o.length;v+=1)o[v].d(1);o.length=m.length}},d(c){c&&(p(e),p(l),p(r),p(h),p(b),p(u),p(a)),de(o,c),n=!1,_e(f)}}}function se(i){let e,t,l;function r(){return i[20](i[31])}return{c(){e=y("button"),this.h()},l(s){e=T(s,"BUTTON",{type:!0,class:!0,"aria-label":!0}),S(e).forEach(p),this.h()},h(){g(e,"type","button"),g(e,"class","hero_slider_bullet svelte-1bmf0u"),g(e,"aria-label",`Slide ${i[31]+1}`),U(e,"active",i[31]===i[4]())},m(s,h){k(s,e,h),t||(l=W(e,"click",r),t=!0)},p(s,h){i=s}
1,d(s){s&&p(e),t=!1,l()}}}function Ye(i){let e=i[3]().length,t,l,r=e&&We(i);return{c(){r&&r.c(),t=B()},l(s){r&&r.l(s),t=B()},m(s,h){r&&r.m(s,h),k(s,t,h),l=!0},p(s,h){e&&r.p(s,h)},i(s){l||(A(r),l=!0)},o(s){H(r),l=!1},d(s){s&&p(t),r&&r.d(s)}}}function ze(i,e,t){let{slides:l=[]}=e,{heightPx:r=600}=e,{autoAdvanceSeconds:s=5}=e,h=0,b,u,a=0,n=0;const f=(_,M=!1)=>{if(_==null||_==="")return{bounded:!1};if(!/^\d{4}-\d{2}-\d{2}$/.test(_))return{invalid:!0};const L=M?"T23:59:59.999Z":"T00:00:00.000Z",I=new Date(`${_}${L}`);return Number.isNaN(I.getTime())||I.toISOString().slice(0,10)!==_?{invalid:!0}:{bounded:!0,time:I.getTime()}},m=(_,M)=>{const L=f(_.startDate),I=f(_.endDate,!0);if(L.invalid||I.invalid)return!1;const Z=M.getTime();return!(L.bounded&&Z<L.time||I.bounded&&Z>I.time)},o=()=>{const _=new Date;return(Array.isArray(l)?l:[]).filter(M=>(M==null?void 0:M.image)&&m(M,_))},c=()=>{const _=o().length;return _===0?0:Math.min(h,_-1)},d=()=>{u&&u.scrollTo({left:u.clientWidth*c(),behavior:"smooth"})},v=_=>{h=_,d()},N=()=>{const _=o().length;_<=1||(h=(c()+1)%_,d())},O=()=>{const _=o().length;_<=1||(h=(c()-1+_)%_,d())},F=_=>{a=_.touches[0].clientX,n=a},X=_=>{n=_.touches[0].clientX},q=()=>{a-n>50?N():n-a>50&&O()},G=()=>{!u||u.clientWidth===0||(h=Math.round(u.scrollLeft/u.clientWidth))},me=()=>Number(s)*1e3;Ee(()=>(b=window.setInterval(()=>N(),me()),()=>window.clearInterval(b)));function ve(_){Ne[_?"unshift":"push"](()=>{u=_,t(2,u)})}const be=()=>G(),pe=_=>F(_),ge=_=>X(_),ke=()=>q(),Te=()=>O(),ye=()=>N(),Se=_=>v(_);return i.$$set=_=>{"slides"in _&&t(12,l=_.slides),"heightPx"in _&&t(0,r=_.heightPx),"autoAdvanceSeconds"in _&&t(1,s=_.autoAdvanceSeconds)},[r,s,u,o,c,v,N,O,F,X,q,G,l,ve,be,pe,ge,ke,Te,ye,Se]}class je extends ne{constructor(e){super(),ie(this,e,ze,Ye,re,{slides:12,heightPx:0,autoAdvanceSeconds:1},null,[-1,-1])}}const Fe=(i,e)=>({name:i,friendlyName:e,type:"number"}),Xe=(i,e)=>({name:i,friendlyName:e,type:"boolean"}),qe=(i,e,t)=>({name:i,friendlyName:e,type:"string",enum:t}),Je=[...we,{component:Be,name:"Columns",friendlyName:"Columns",canHaveChildren:!1,inputs:[Fe("space","Gap"),qe("stackColumnsAt","Stack at",["tablet","mobile","never"]),Xe("reverseColumnsWhenStacked","Reverse when stacked")]},{component:je,name:"Hero Slider",friendlyName:"Hero Slider",noWrap:!0,canHaveChildren:!1,helperText:"Use this component to author a front-page hero carousel from CMS slides.",inputs:[{name:"slides",type:"list",helperText:"Slides shown in the hero carousel.",subFields:[{name:"image",type:"url",helperText:"Hero slide image URL."},{name:"kicker",type:"string",helperText:"Small text shown above the headline."},{name:"title",type:"string",helperText:"Hero headline."},{name:"ctaText",type:"string",helperText:"CTA label. Renders only with CTA URL."},{name:"ctaUrl",type:"url",helperText:"CTA URL. Renders only with CTA label."},{name:"startDate",type:"string",helperText:"Start date in YYYY-MM-DD format. Empty means no lower bound."},{name:"endDate",type:"string",helperText:"End date in YYYY-MM-DD format. Empty means no upper bound."}]},{name:"heightPx",type:"number",defaultValue:600,helperText:"Hero height in pixels."},{name:"autoAdvanceSeconds",type:"number",defaultValue:5,helperText:"Seconds between automatic slide changes."}]}];export{Je as C};
2//# sourceMappingURL=custom-components-DazXlHvw.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.