PageSourceSearch

https://9c137227.albert-nz.pages.dev/_app/immutable/nodes/9.C6rO3ZVB.js

js albert-nz.pages.dev collected 2026-10-03 06:27:18 UTC 8,924 bytes, 1 lines download raw bytes

1import{s as ae,n as J,o as ze,b as te,x as he}from"../chunks/scheduler.CBToeEh8.js";import{S as se,i as le,e as y,c as P,a as v,d as p,n as i,g as O,u as Y,v as R,h as f,G as fe,s as q,k as we,f as B,l as xe,o as Me,p as V,q as Q,x as Ie,r as Ee,t as W,m as Se,b as K,D as Ge,j as $,E as He,H as Te,w as pe,F as je,z as De}from"../chunks/index.C0UaLCpe.js";import{e as me}from"../chunks/each.D6YF6ztN.js";import{m as ee,a as Ce}from"../chunks/mapbox-gl.CI96fap9.js";import{f as _e,p as ge}from"../chunks/index.CWgSDLO0.js";const Fe=async({fetch:l})=>({posts:await(await l("/api/postRoutes")).json(),title:"Adventures Map | Albert Nisbet",description:"Interactive map showing a variety of recommended tramps and hikes in New Zealand"}),Ye=Object.freeze(Object.defineProperty({__proto__:null,load:Fe},Symbol.toStringTag,{value:"Module"}));function Le(l){let e;return{c(){e=y("div"),this.h()},l(a){e=P(a,"DIV",{class:!0}),v(e).forEach(p),this.h()},h(){i(e,"class","absolute-important bottom-0 left-0 h-full w-full map-fullscreen svelte-1xsnihk")},m(a,n){O(a,e,n),l[6](e)},p:J,i:J,o:J,d(a){a&&p(e),l[6](null)}}}const ve="mapbox://styles/albertnis/ckqu1h7gs6e7x17q093ii0ltr",be="mapbox://styles/albertnis/ckqu3o4rn6np917qz18x1whbz";function qe(l,e,a){let{postMapPreviews:n}=e,r,s,{selectedGpxPath:o=null}=e,{selectedPostPath:_=null}=e,g=null;ze(()=>{if(r==null)throw new TypeError("Map div is undefined");const t=window.matchMedia("(prefers-color-scheme: dark)").matches?ve:be;window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",u=>{const h=u.matches?ve:be;s!=null&&s.loaded()&&s.setStyle(h)}),ee.accessToken="pk.eyJ1IjoiYWxiZXJ0bmlzIiwiYSI6ImNrcXUwNHlhcTJnODAydm84anEzanIwZHQifQ.B9-IeJHvH9nnfQT9QT4ouw",a(4,s=new ee.Map({container:r,style:t,center:[172.82,-40.74],zoom:5})),s.on("load",()=>{}),s.on("style.load",()=>{n.forEach(u=>{u.geo.forEach(h=>{let x=h.pathData.geoJson,I=x.type==="LineString"&&x.coordinates[0].length>=2?x.coordinates:[];s.addSource(h.metadata.gpxFilePath+"_source_path",{type:"geojson",data:x}),s.addLayer({id:h.metadata.gpxFilePath+"_layer_path",type:"line",source:h.metadata.gpxFilePath+"_source_path",layout:{"line-join":"round","line-cap":"round"},paint:{"line-color":"#f97316","line-width":5}});const S=new Ce.Marker({color:"#0ea5e9",scale:.75}).setLngLat([I[0][0],I[0][1]]).addTo(s).getElement(),G=()=>{const w=I,z=w.reduce((H,C)=>H.extend(C),new ee.LngLatBounds(w[0],w[0]));s.fitBounds(z,{padding:{top:40,right:40,bottom:200,left:40}}),a(1,o=h.metadata.gpxFilePath),a(2,_=u.path)},D=()=>{s.getCanvas().style.cursor="pointer"},N=()=>{s.getCanvas().style.cursor=""};S.addEventListener("click",G),s.on("click",h.metadata.gpxFilePath+"_layer_path",G),s.on("mouseenter",h.metadata.gpxFilePath+"_layer_path",D),s.on("mouseleave",h.metadata.gpxFilePath+"_layer_path",N)})})})});function k(t){te[t?"unshift":"push"](()=>{r=t,a(0,r)})}return l.$$set=t=>{"postMapPreviews"in t&&a(3,n=t.postMapPreviews),"selectedGpxPath"in t&&a(1,o=t.selectedGpxPath),"selectedPostPath"in t&&a(2,_=t.selectedPostPath)},l.$$.update=()=>{l.$$.dirty&50&&(g!=null&&s.setPaintProperty(g+"_layer_path","line-color","#f97316"),o==null?a(2,_=null):s.setPaintProperty(o+"_layer_path","line-color","#0ea5e9"),a(5,g=o))},[r,o,_,n,s,g,k]}class Be extends se{constructor(e){super(),le(this,e,qe,Le,ae,{postMapPreviews:3,selectedGpxPath:1,selectedPostPath:2})}}function Je(l){let e,a,n;return{c(){e=Y("svg"),a=Y("line"),n=Y("line"),this.h()},l(r){e=R(r,"svg",{xmlns:!0,width:!0,height:!0,viewBox:!0,fill:!0,stroke:!0,"stroke-width":!0,"stroke-linecap":!0,"stroke-linejoin":!0,class:!0});var s=v(e);a=R(s,"line",{x1:!0,y1:!0,x2:!0,y2:!0}),v(a).forEach(p),n=R(s,"line",{x1:!0,y1:!0,x2:!0,y2:!0}),v(n).forEach(p),s.forEach(p),this.h()},h(){i(a,"x1","18"),i(a,"y1","6"),i(a,"x2","6"),i(a,"y2","18"),i(n,"x1","6"),i(n,"y1","6"),i(n,"x2","18"),i(n,"y2","18"),i(e,"xmlns","http://www.w3.org/2000/svg"),i(e,"width","1em"),i(e,"height","1em"),i(e,"viewBox","0 0 24 24"),i(e,"fill","none"),i(e,"stroke","currentColor"),i(e,"stroke-width","2"),i(e,"stroke-linecap","round"),i(e,"stroke-linejoin","round"),i(e,"class","feather feather-x")},m(r,s){O(r,e,s),f(e,a),f(e,n)},p:J,i:J,o:J,d(r){r&&p(e)}}}class Ne extends se{constructor(e){super(),le(this,e,null,Je,ae,{})}}function ye(l,e,a){const n=l.slice();return n[7]=e[a],n}function Pe(l){let e,a,n,r,s="Selected route",o,_,g,k,t,u,h=l[3].meta.title+"",x,I,M,S=_e(ge(l[3].meta.date),"MMMM d, yyyy")+"",G,D,N,w,z,H=l[3].meta.description+"",C,A,Z,T,E,U,ne;g=new Ne({});let F=me(l[3].imagesHtml),m=[];for(let c=0;c<F.length;c+=1)m[c]=ke(ye(l,F,c));return{c(){e=y("div"),a=y("div"),n=y("div"),r=y("h2"),r.textContent=s,o=q(),_=y("button"),we(g.$$.fragment),k=q(),t=y("a"),u=y("h3"),x=W(h),I=q(),M=y("time"),G=W(S),N=q(),w=y("div"),z=y("p"),C=W(H),Z=q(),T=y("div");for(let c=0;c<m.length;c+=1)m[c].c();this.h()},l(c){e=P(c,"DIV",{class:!0});var b=v(e);a=P(b,"DIV",{class:!0});
1var d=v(a);n=P(d,"DIV",{class:!0});var j=v(n);r=P(j,"H2",{class:!0,"data-svelte-h":!0}),Se(r)!=="svelte-1lrx6cb"&&(r.textContent=s),o=B(j),_=P(j,"BUTTON",{class:!0});var oe=v(_);xe(g.$$.fragment,oe),oe.forEach(p),j.forEach(p),k=B(d),t=P(d,"A",{class:!0,href:!0});var L=v(t);u=P(L,"H3",{class:!0});var re=v(u);x=K(re,h),re.forEach(p),I=B(L),M=P(L,"TIME",{datetime:!0,class:!0});var ie=v(M);G=K(ie,S),ie.forEach(p),N=B(L),w=P(L,"DIV",{class:!0});var ce=v(w);z=P(ce,"P",{class:!0});var de=v(z);C=K(de,H),de.forEach(p),ce.forEach(p),L.forEach(p),Z=B(d),T=P(d,"DIV",{class:!0});var ue=v(T);for(let X=0;X<m.length;X+=1)m[X].l(ue);ue.forEach(p),d.forEach(p),b.forEach(p),this.h()},h(){i(r,"class","mr-1 cursor-default font-bold text-sky-600 dark:text-sky-400"),i(_,"class","cursor-pointer hover:text-sky-600 hover:dark:text-sky-400"),i(n,"class","flex items-center justify-between text-sm"),i(u,"class","inline border-b border-b-zinc-600 font-bold group-hover:border-b-2 group-hover:border-b-sky-600 dark:border-b-zinc-400 dark:group-hover:border-b-sky-400"),i(M,"datetime",D=l[3].meta.date),i(M,"class","font-bold text-zinc-600 before:mx-2 before:content-['/'] dark:text-zinc-400"),i(z,"class","text-base text-zinc-700 dark:text-zinc-300"),i(w,"class","prose prose-zinc max-w-none"),i(t,"class","group inline-block w-full"),i(t,"href",A=l[3].path),i(T,"class","post-img-carousel pointer-events-none absolute left-full top-0 z-10 hidden h-full w-[100vw] md:flex"),i(a,"class","pointer-events-auto relative w-full rounded-md bg-zinc-100 p-3 shadow-md bg-opacity-50 dark:bg-opacity-50 backdrop-blur-md dark:bg-zinc-800 sm:max-w-[500px]"),i(e,"class","pointer-events-none fixed bottom-0 left-0 z-10 flex w-full bg-gradient-to-t from-white/60 px-3 pb-10 dark:from-black/60 sm:px-10")},m(c,b){O(c,e,b),f(e,a),f(a,n),f(n,r),f(n,o),f(n,_),Me(g,_,null),f(a,k),f(a,t),f(t,u),f(u,x),f(t,I),f(t,M),f(M,G),f(t,N),f(t,w),f(w,z),f(z,C),f(a,Z),f(a,T);for(let d=0;d<m.length;d+=1)m[d]&&m[d].m(T,null);E=!0,U||(ne=Ge(_,"click",l[4]),U=!0)},p(c,b){if((!E||b&8)&&h!==(h=c[3].meta.title+"")&&$(x,h),(!E||b&8)&&S!==(S=_e(ge(c[3].meta.date),"MMMM d, yyyy")+"")&&$(G,S),(!E||b&8&&D!==(D=c[3].meta.date))&&i(M,"datetime",D),(!E||b&8)&&H!==(H=c[3].meta.description+"")&&$(C,H),(!E||b&8&&A!==(A=c[3].path))&&i(t,"href",A),b&8){F=me(c[3].imagesHtml);let d;for(d=0;d<F.length;d+=1){const j=ye(c,F,d);m[d]?m[d].p(j,b):(m[d]=ke(j),m[d].c(),m[d].m(T,null))}for(;d<m.length;d+=1)m[d].d(1);m.length=F.length}},i(c){E||(V(g.$$.fragment,c),E=!0)},o(c){Q(g.$$.fragment,c),E=!1},d(c){c&&p(e),Ee(g),He(m,c),U=!1,ne()}}}function ke(l){let e,a=l[7]+"",n;return{c(){e=new Te(!1),n=pe(),this.h()},l(r){e=je(r,!1),n=pe(),this.h()},h(){e.a=n},m(r,s){e.m(a,r,s),O(r,n,s)},p(r,s){s&8&&a!==(a=r[7]+"")&&e.p(a)},d(r){r&&(p(n),e.d())}}}function Ve(l){let e,a,n,r,s,o=l[3]!=null&&l[3]!=""&&Pe(l);function _(t){l[5](t)}function g(t){l[6](t)}let k={postMapPreviews:l[0].posts};return l[1]!==void 0&&(k.selectedPostPath=l[1]),l[2]!==void 0&&(k.selectedGpxPath=l[2]),a=new Be({props:k}),te.push(()=>fe(a,"selectedPostPath",_)),te.push(()=>fe(a,"selectedGpxPath",g)),{c(){o&&o.c(),e=q(),we(a.$$.fragment)},l(t){o&&o.l(t),e=B(t),xe(a.$$.fragment,t)},m(t,u){o&&o.m(t,u),O(t,e,u),Me(a,t,u),s=!0},p(t,[u]){t[3]!=null&&t[3]!=""?o?(o.p(t,u),u&8&&V(o,1)):(o=Pe(t),o.c(),V(o,1),o.m(e.parentNode,e)):o&&(De(),Q(o,1,1,()=>{o=null}),Ie());const h={};u&1&&(h.postMapPreviews=t[0].posts),!n&&u&2&&(n=!0,h.selectedPostPath=t[1],he(()=>n=!1)),!r&&u&4&&(r=!0,h.selectedGpxPath=t[2],he(()=>r=!1)),a.$set(h)},i(t){s||(V(o),V(a.$$.fragment,t),s=!0)},o(t){Q(o),Q(a.$$.fragment,t),s=!1},d(t){t&&p(e),o&&o.d(t),Ee(a,t)}}}function Oe(l,e,a){let n,{data:r}=e,s=null,o=null;const _=()=>a(2,s=null);function g(t){o=t,a(1,o)}function k(t){s=t,a(2,s)}return l.$$set=t=>{"data"in t&&a(0,r=t.data)},l.$$.update=()=>{l.$$.dirty&3&&a(3,n=o&&r.posts.find(t=>t.path===o))},[r,o,s,n,_,g,k]}class Re extends se{constructor(e){super(),le(this,e,Oe,Ve,ae,{data:0})}}export{Re as component,Ye as universal};

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.