PageSourceSearch

https://doghealthy.netlify.app/_nuxt/CI36eZX6.js

js doghealthy.netlify.app collected 2026-10-03 10:39:52 UTC 4,445 bytes, 1 lines download raw bytes

1import{N as g}from"#entry";const u=(e,t,c,o=80)=>{try{const a=new URL(e);return a.searchParams.set("auto","format"),a.searchParams.set("fit","crop"),a.searchParams.set("w",String(t)),c&&a.searchParams.set("h",String(c)),a.searchParams.set("q",String(o)),a.toString()}catch{return e}},w={hero:{id:"photo-1552053831-71594a27632d",author:"Jamie Street",description:"Happy golden retriever"},health:{id:"photo-1587300003388-59208cc962cb",author:"Victor Grabarczyk",description:"Healthy dog outdoors"},vaccination:{id:"photo-1601758228041-f3b2795255f1",author:"Hannah Lim",description:"Dog with caring hands"},medication:{id:"photo-1548199973-03cce0bbc87b",author:"Gilberto Reyes",description:"Dogs together"},appointment:{id:"photo-1477884213360-7e9d7dcc1e48",author:"Cristian Castillo",description:"Dog portrait"},vet:{id:"photo-1450778869180-41d0601e046e",author:"Jamie Street",description:"Dog with owner"},food:{id:"photo-1587300003388-59208cc962cb",author:"Victor Grabarczyk",description:"Dog outdoors"},weight:{id:"photo-1530281700549-e82e7bf110d6",author:"Richard Brutyo",description:"Dog running and exercising"},community:{id:"photo-1544568100-847a948585b9",author:"Alvan Nee",description:"Dogs in a park"},puppy:{id:"photo-1561037404-61cd46aa615b",author:"Jamie Street",description:"Cute puppy"},default:{id:"photo-1518717758536-85ae29035b6d",author:"Sarah Brown",description:"Friendly dog"}},y=e=>{const t=e.toLowerCase();return t.includes("happy")||t.includes("hero")?"hero":t.includes("vaccin")||t.includes("immun")?"vaccination":t.includes("medic")||t.includes("pill")?"medication":t.includes("appoint")||t.includes("clinic")?"appointment":t.includes("vet")||t.includes("veterinar")?"vet":t.includes("food")||t.includes("nutrition")||t.includes("bowl")||t.includes("eat")?"food":t.includes("weight")||t.includes("exercise")||t.includes("run")?"weight":t.includes("community")||t.includes("group")||t.includes("playing")?"community":t.includes("puppy")||t.includes("cute")||t.includes("breeder")?"puppy":t.includes("health")||t.includes("checkup")?"health":t.includes("owner")?"vet":"default"},m=(e,t=1200,c=800)=>{const o=y(e),a=w[o],d=`https://images.unsplash.com/${a.id}`;return{url:u(d,t,c),thumb:u(d,200,200),small:u(d,400,300),author:a.author,authorUrl:`https://unsplash.com/photos/${a.id.replace("photo-","")}`,description:a.description}},b=(e,t,c)=>{const o=e.urls?.regular||e.urls?.full||"";return{url:t?u(o,t,c):u(o,1200,800),thumb:e.urls?.thumb||u(o,200,200),small:e.urls?.small||u(o,400,300),author:e.user?.name||"Unsplash",authorUrl:e.user?.links?.html||"https://unsplash.com",description:e.description||e.alt_description||null}},S=(e,t,c)=>`dh_unsplash:${e}:${t}x${c}`,U=e=>{if(typeof window>"u")return null;try{const t=sessionStorage.getItem(e);return t?JSON.parse(t):null}catch{return null}},k=(e,t)=>{if(!(typeof window>"u"))try{sessionStorage.setItem(e,JSON.stringify(t))}catch{}},v=()=>{const t=g().public.unsplashAccessKey||"",c=async(s,r)=>{try{const n=new URLSearchParams({query:s,orientation:r.orientation||"landscape"});r.width&&n.set("w",String(r.width)),r.height&&n.set("h",String(r.height));const i=await $fetch(`/.netlify/functions/unsplash-image?${n.toString()}`);if(!i?.url)return null;const l=i.url;return{url:u(l,r.width||1200,r.height),thumb:u(l,200,200),small:u(l,400,300),author:i.author||"Unsplash",authorUrl:i.authorUrl||"https://unsplash.com",description:i.description||null}}catch{return null}},o=async(s,r)=>{if(!t)return null;const n=new URLSearchParams({query:s,orientation:r.orientation||"landscape"}),i=await fetch(`https://api.unsplash.com/photos/random?${n.toString()}`,{headers:{Authorization:`Client-ID ${t}`,"Accept-Version":"v1"}});if(!i.ok){const p=await i.text().catch(()=>"Unknown error");return console.warn(`Unsplash API ${i.status}:`,p.slice(0,200)),null}const l=await i.json();return b(l,r.width,r.height)};return{fetchImageWithFallback:async(s,r={})=>{const n=r.width||1200,i=r.height||800,l=S(s,n,i),p=U(l);if(p)return p;let h=await c(s,{...r,width:n,height:i});if(!h)try{h=await o(s,{...r,width:n,height:i})}catch(f){console.warn("Unsplash client fetch failed:",f)}return h||(h=m(s,n,i)),k(l,h),h},getCuratedImage:(s,r=1200,n=800)=>m(s,r,n),curatedUnsplashImage:m,searchPhotos:async(s,r=12)=>{const n=await $fetch(`/.netlify/functions/unsplash-search?query=${encodeURIComponent(s.trim())}&per_page=${r}`);return{results:n.results||[],fallback:!!n.fallback}}}};export{v as u};

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.