PageSourceSearch

https://kasbu.bio/assets/js/MapKitFullscreen-CMp3PYY3.js

js kasbu.bio collected 2026-09-24 13:24:21 UTC 4,370 bytes, 1 lines download raw bytes

1import{a as e,r as t,aR as o,V as n,j as s,as as a,bV as i,aE as r,E as c}from"../index-DEUA2RFd.js";import"./cjs-helpers-BrGt3VpK.js";import"./supabase-vendor-DuR9KhUO.js";let l=null;const m="var(--ease-entrance)",p=220,d=({onClose:d,lat:u,lng:h,zoom:w,dark:y=!1,pin:x="dot",title:f,actionLabel:g})=>{const{t:k}=e(),[v,b]=t.useState(!1),[j,C]=t.useState(!1),[E,$]=t.useState(!1),z=t.useRef(null),M=v&&!j;t.useEffect(()=>{const e=requestAnimationFrame(()=>b(!0));return()=>cancelAnimationFrame(e)},[]);const P=t.useCallback(()=>{C(!0),window.setTimeout(d,p)},[d]);return t.useEffect(()=>{const e=e=>{"Escape"===e.key&&P()};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[P]),o(!0),t.useEffect(()=>{if(!M)return;const e=document.getElementById("root");if(!e)return;const t=window.setTimeout(()=>{e.style.visibility="hidden"},420);return()=>{window.clearTimeout(t),e.style.visibility=""}},[M]),t.useEffect(()=>{let e=null,t=!1;return(l??(l=new Promise((e,t)=>{const o=()=>{const t=window.mapkit;t.init({authorizationCallback:e=>{fetch("https://nsmawgvrzkryrzcvntqs.supabase.co/functions/v1/mapkit-token").then(e=>e.ok?e.json():Promise.reject(e.status)).then(t=>e(t.token)).catch(e=>console.error("[MapKitFullscreen] token fetch failed",e))}}),e(t)};if(window.mapkit)return void o();const n=document.createElement("script");n.src="https://cdn.apple-mapkit.com/mk/5.x.x/mapkit.js",n.crossOrigin="anonymous",n.async=!0,n.onload=o,n.onerror=e=>{l=null,t(e)},document.head.appendChild(n)})),l).then(o=>{if(t||!z.current)return;const n=new o.Coordinate(u,h);e=new o.Map(z.current,{center:n,colorScheme:y?o.Map.ColorSchemes.Dark:o.Map.ColorSchemes.Light,showsMapTypeControl:!1});const s=z.current.clientHeight||window.innerHeight,a=Math.min(60,s/256*(360/Math.pow(2,w)));if(e.region=new o.CoordinateRegion(n,new o.CoordinateSpan(a,a)),"none"!==x){const t="dot"!==x&&""!==x.trim();e.addAnnotation(new o.MarkerAnnotation(n,{color:"#679BFF",...f?{title:f}:{},...t?{glyphText:x}:{}}))}$(!0)}).catch(e=>console.error("[MapKitFullscreen] mapkit load failed",e)),()=>{t=!0;try{null==e||e.destroy()}catch{}}},[]),n.createPortal(s.jsxs("div",{className:`fixed inset-0 ${a.modal} flex items-center justify-center p-4 sm:p-8`,style:{background:"rgb(0, 0, 0)",paddingTop:"84px",opacity:M?1:0,transition:"opacity 220ms ease"},onClick:P,role:"dialog","aria-modal":"true",children:[s.jsx("button",{type:"button","aria-label":k("common.close"),onClick:e=>{e.stopPropagation(),P()},className:"absolute top-4 right-4 z-10 size-10 rounded-full bg-white/10 hover:bg-white/20 hover:scale-105 text-white/80 hover:text-white flex items-center justify-center active:scale-90",style:{opacity:M?1:0,transition:`opacity 200ms ease ${M?"180ms":"0ms"}, transform 150ms ease, background-color 150ms ease, color 150ms ease`},children:s.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",stroke:"currentColor",strokeWidth:"2.2",strokeLinecap:"round",children:[s.jsx("line",{x1:"2",y1:"2",x2:"12",y2:"12"}),s.jsx("line",{x1:"12",y1:"2",x2:"2",y2:"12"})]})}),s.jsxs("div",{className:"relative overflow-hidden rounded-2xl",style:{width:"min(92vw, 1400px)",height:"100%",background:y?"#1c1c1e":"#e8e8e8",boxShadow:"0 24px 80px -12px rgba(0,0,0,0.8), 0 0 0 1px rgba(255,255,255,0.06)",opacity:M?1:0,transform:M?"none":"scale(0.94) translateY(16px)",transition:M?`opacity 320ms ${m}, transform 380ms ${m}`:"opacity 220ms ease, transform 220ms ease"},onClick:e=>e.stopPropagation(),children:[!E&&s.jsx("div",{className:"absolute inset-0 flex items-center justify-center",children:s.jsx(i,{size:"lg",className:"text-white/70"})}),s.jsx("div",{ref:z,className:"absolute inset-0",style:{opacity:E?1:0,transition:"opacity 400ms ease"}})]}),s.jsx("div",{className:"absolute top-[18px] right-16 z-10",style:{opacity:M?1:0,transform:M?"none":"translateY(-8px)",transition:`opacity 220ms ease ${M?"220ms":"0ms"}, transform 220ms ease ${M?"220ms":"0ms"}`},onClick:e=>e.stopPropagation(),children:s.jsx(r,{variant:"primary",leading:s.jsx(c,{className:"size-4"}),onClick:()=>{const e=/iPhone|iPad|iPod|Macintosh/.test(navigator.userAgent)?`https://maps.apple.com/?ll=${u},${h}&z=${w}`:`https://www.google.com/maps/search/?api=1&query=${u},${h}`;window.open(e,"_blank","noopener,noreferrer")},children:g||k("mapKit.openInApp")})})]}),document.body)};export{d 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.