PageSourceSearch

https://heritage-navigator.com/_next/static/chunks/8559.b71fd274ba014fac.js

js heritage-navigator.com collected 2026-10-02 22:27:10 UTC 14,408 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8559],{88559:(e,t,a)=>{a.r(t),a.d(t,{default:()=>K});var i=a(95155),n=a(76561),s=a(38707),l=a(52619),o=a.n(l),r=a(83457),c=a(27937),d=a(21873),u=a(26983),p=a(39347),m=a(37232),g=a(68276),x=a(97849),h=a(12115),f=a(44089),v=a(64269),y=a(28720),b=a(63511),w=a(2765),j=a(82931),N=a(41747),k=a(37929),_=a(94144),E=a(7768),A=a(60258),I=a(33215),M=a(30871);let S=(0,h.memo)(e=>{var t;let{site:a,cityId:s,isFavorite:l=!1,showDistance:S=!0,periods:T,userCoordinates:C,isLoadingPosition:L,className:O,language:z,priority:D,onFavorite:F,onShowOnMap:B}=e,[P,R]=(0,h.useState)(null),[H,V]=(0,h.useState)(null),[Y,q]=(0,h.useState)(!1),$=(0,_.Y)(null==H?void 0:H.periods,null==H?void 0:H.timezone,null!=(t=null==H?void 0:H.isOpen)&&t),G=C?{latitude:C[0],longitude:C[1]}:null,{translate:K}=(0,y.HI)(),{language:W}=(0,E.o)(),{narration:J,cityName:Q}=(0,A.$)(a.id);(0,h.useEffect)(()=>{(async()=>{try{let e=await (0,f.a$)(a.id,s);e.length>0?R(e[0]):R(null)}catch(e){console.error("Error fetching image:",e),R(null)}})()},[a.id,s]),(0,h.useEffect)(()=>{(async()=>{if(a.id)try{let e=await fetch("/api/sites/".concat(s,"/").concat(a.id,"/opening-hours"));if(e.ok){let t=await e.json();V(t)}}catch(e){console.error("Error fetching opening hours:",e)}})()},[s,a.id]);let U=T.find(e=>e.id===a.primaryPeriod),X=U?(0,g.bT)(U.translations,z,"name"):"",Z=()=>{(0,b.d)(a.id,s,z)},ee=S&&C?(0,w.gd)(C[0],C[1],a.location.latitude,a.location.longitude):null;return(0,i.jsxs)(M.P.div,{className:(0,v.cn)("bg-background-primary rounded-2xl shadow-[0_4px_16px_rgba(200,190,170,0.6)] hover:shadow-[0_8px_24px_rgba(200,190,170,0.75)] overflow-hidden relative","[content-visibility:auto] [contain-intrinsic-size:auto_350px]",O),children:[(0,i.jsxs)("div",{className:"relative aspect-[3/2] w-full overflow-hidden bg-background-secondary",children:[P?(0,i.jsxs)(o(),{href:"/".concat(z,"/").concat(s,"/site/").concat(a.id),prefetch:!0,onMouseEnter:Z,className:(0,v.cn)("relative block w-full h-full transform transition-all duration-200","hover:scale-[1.02]","active:scale-95"),children:[(0,i.jsx)("img",{className:"object-cover w-full h-full",alt:(0,g.bT)(a.translations,z,"name")||"Site image",src:P.thumbnail_url||P.image_url||"",loading:D?"eager":"lazy",width:"400",height:"266"}),(P.artist||P.credit||P.year)&&(0,i.jsx)("div",{className:(0,v.cn)("absolute bottom-0 left-0 right-0 z-10 truncate text-[11px] leading-snug text-white/90 px-2 pt-4 pb-1","bg-gradient-to-t from-black/50 via-black/25 to-transparent","[&_a]:text-white/90 [&_a]:no-underline [&_a:hover]:underline","transition-opacity duration-300"),dangerouslySetInnerHTML:{__html:j.A.sanitize("\xa9 ".concat(P.artist||P.credit||""," ").concat(P.year?"(".concat(P.year,")"):"").trim(),{ADD_ATTR:["target","rel","class","href"],ADD_TAGS:["a"]}).replace(/<a /g,'<a target="_blank" rel="noopener noreferrer" ')}})]}):(0,i.jsx)("div",{className:"relative aspect-[3/2] w-full bg-gray-200 flex items-center justify-center",children:(0,i.jsx)("span",{className:"text-gray-500",children:K("imageNotAvailable")})}),(0,i.jsx)("button",{type:"button","aria-label":l?K("removeFavorite"):K("addFavorite"),onClick:"function"==typeof F?F:void 0,className:(0,v.cn)("absolute top-4 right-4 z-20 rounded-full","hover:scale-110 transition-transform","focus:outline-none","flex items-center justify-center w-11 h-11","bg-white/35 backdrop-blur","shadow-[0_2px_4px_-1px_rgba(0,0,0,0.18)]"),children:(0,i.jsx)(r.A,{className:(0,v.cn)("w-6 h-6 drop-shadow-[0_2px_2px_rgba(0,0,0,0.7)]",l?"text-red-500 fill-red-500":"text-white"),strokeWidth:2.5,fill:l?"currentColor":"none"})}),(0,i.jsx)(o(),{href:"/".concat(z,"/").concat(s,"/site/").concat(a.id),prefetch:!0,className:(0,v.cn)("absolute top-4 left-4 z-20 rounded-full","hover:scale-110 transition-transform","focus:outline-none","flex items-center justify-center w-11 h-11","bg-white/35 backdrop-blur","shadow-[0_2px_4px_-1px_rgba(0,0,0,0.18)]"),"aria-label":K("readMore"),children:(0,i.jsx)(c.A,{className:"w-6 h-6 text-white stroke-[2.5px] drop-shadow-[0_2px_2px_rgba(0,0,0,0.7)]"})})]}),(0,i.jsxs)("div",{className:"p-3 space-y-3",children:[(0,i.jsx)(o(),{href:"/".concat(z,"/").concat(s,"/site/").concat(a.id),prefetch:!0,className:"block transform transition-all duration-200 active:scale-98 active:bg-gray-50 rounded-lg mb-1",onMouseEnter:Z,children:(0,i.jsx)("h3",{className:"font-sans font-medium text-lg lg:text-base text-gray-900 group-hover:text-primary-600 truncate",children:(0,g.bT)(a.translations,z,"name")||"[Navn mangler]"})}),(0,i.jsxs)("div",{className:"flex flex-wrap items-center gap-x-4 gap-y-2 text-sm text-gray-500 mb-2",children:[J&&(0,i.jsx)(I.default,{narration:J,siteName:(0,g.bT)(a.translations,z,"name")||"",cityName:Q}),S&&a.location&&(L||null!==ee)&&(0,i.jsxs)("button",{onClick:()=>{var e,t;if(!(null==(e=a.location)?void 0:e.latitude)||!(null==(t=a.location)?void 0:t.longitude))return void console.error("Lokation mangler for dette sted");if(G){let e="https://www.google.com/maps/dir/?api=1&origin=".concat(G.latitude,",").concat(G.longitude,"&destination=").concat(a.location.latitude,",").concat(a.location.longitude,"&travelmode=walking");window.open(e,"_blank")}else{let e="https://www.google.com/maps/search/?api=1&query=".concat(a.location.latitude,",").concat(a.location.longitude);window.open(e,"_blank")}},disabled:L,className:"flex items-center gap-2 text-gray-600 hover:text-blue-600 transition-colors p-1 rounded-md -m-1","aria-label":K("showDirections"),children:[(0,i.jsx)(n.A,{className:"h-5 w-5"}),(0,i.jsx)(()=>L?(0,i.jsx)("span",{className:"text-sm",children:K("findingDistance")}):null!==ee?(0,i.jsx)("span",{className:"text-sm",children:(0,x.BO)(ee,z)}):null,{})]}),a.location&&(B?(0,i.jsxs)("button",{type:"button",className:"flex items-center gap-2 text-gray-600 hover:text-primary-600 transition-colors p-1 rounded-md -m-1","aria-label":K("showOnMap"),onClick:e=>{e.stopPropagation(),B(a.id)},children:[(0,i.jsx)(d.A,{className:"h-5 w-5"}),(0,i.jsx)("span",{className:"font-sans",children:K("showOnMap")})]}):(0,i.jsxs)(o(),{href:"/".concat(z,"/").concat(s,"/map?site=").concat(a.id),className:"flex items-center gap-2 text-gray-600 hover:text-primary-600 transition-colors p-1 rounded-md -m-1","aria-label":K("showOnMap"),onClick:e=>e.stopPropagation(),children:[(0,i.jsx)(d.A,{className:"h-5 w-5"}),(0,i.jsx)("span",{className:"font-sans",children:K("showOnMap")})]})),H&&H.periods.length>0&&(0,i.jsxs)("button",{onClick:e=>{e.preventDefault(),e.stopPropagation(),q(!0)},className:"flex items-center gap-2 hover:text-gray-900 transition-colors p-1 rounded-md -m-1",children:[(0,i.jsx)(u.A,{className:"h-5 w-5"}),(0,i.jsx)("span",{className:"font-sans ".concat($?"text-green-600":""),style:$?void 0:{color:m.Tj.accent},children:$?K("openNow"):K("closed")})]}),((null==H?void 0:H.accessType)==="exterior"||(null==H?void 0:H.accessType)==="limited")&&(0,i.jsx)(k.Y,{accessType:H.accessType,iconClassName:"h-5 w-5 mr-2"}),U&&(0,i.jsx)("div",{className:"flex items-center gap-1",children:(0,i.jsxs)("span",{className:"flex items-center gap-1",children:[(0,i.jsx)("span",{className:"w-2 h-2 rounded-full mr-1",style:{backgroundColor:U.color}}),(0,i.jsx)("span",{className:"font-sans",children:X})]})}),"number"==typeof a.googleMapsRating&&a.googleMapsRating>=3.5&&(0,i.jsxs)("div",{className:"flex items-center gap-1","aria-label":"".concat(a.googleMapsRating.toFixed(1)," / 5"),
1children:[(0,i.jsx)(p.A,{className:"h-4 w-4 text-amber-500 fill-amber-500","aria-hidden":"true"}),(0,i.jsx)("span",{className:"font-sans",children:a.googleMapsRating.toLocaleString(z,{minimumFractionDigits:1,maximumFractionDigits:1})})]})]}),(0,i.jsx)("p",{className:"text-gray-600 line-clamp-2 mt-1",children:(0,g.bT)(a.translations,z,"description")||"[Beskrivelse mangler]"})]}),H&&(0,i.jsx)(N.F,{isOpen:Y,onClose:()=>q(!1),data:H})]})});var T=a(57615),C=a(46074),L=a(2318),O=a(85203),z=a.n(O),D=a(20063),F=a(74869),B=a(20419),P=a(3668),R=a(57376),H=a(56080),V=a(76268),Y=a(42155),q=a(75395),$=a(82599),G=a(28634);function K(e){var t,a,l,r,c;let{sites:d,selectedLanguage:u="en",onSiteSelect:p,onFavorite:m,isFavorite:g,showOnlyFavorites:x=!1,city:f,periods:v,loadMoreSites:y,isLoadingMore:b=!1,isReloadingLanguage:j=!1,hasMore:N=!1,listClassName:k,isStandaloneList:_=!1,adConfig:E,onShowOnMap:A}=e,I=(0,D.useParams)().locale;(0,F.T)(I);let M={da:R,en:H,de:V,es:Y,fr:q,pt:$,it:G},O=M[u]||M.en,{coordinates:K,error:W,loading:J,retry:Q}=(0,L.m)({mode:"low",once:!0}),U=(0,h.useMemo)(()=>x?d.filter(e=>g(e.id)):d,[d,x,g]),X=(0,h.useMemo)(()=>K?{latitude:K[0],longitude:K[1]}:null,[K]),Z=(0,h.useMemo)(()=>U.map(e=>{if(X&&e.location){let t=(0,w.gd)(X.latitude,X.longitude,e.location.latitude,e.location.longitude);return{...e,distance:t}}return e}),[U,X]),ee=(0,h.useMemo)(()=>X?[...Z].sort((e,t)=>void 0!==e.distance&&void 0!==t.distance?e.distance-t.distance:void 0!==e.distance?-1:+(void 0!==t.distance)):Z,[Z,X]);(0,h.useEffect)(()=>{X&&0!==ee.length&&(0,P.Kc)(f.id,ee,[X.latitude,X.longitude])},[f.id,ee,X]),(0,h.useLayoutEffect)(()=>{_&&!J&&0!==ee.length&&function(e){let t=e.getElementById("critical-sites-container"),a=e.getElementById("client-sites-container");t&&a&&(a.style.visibility="visible",a.setAttribute("data-client-sites-ready","true"),t.style.display="none",t.setAttribute("aria-hidden","true"))}(document)},[_,J,ee.length]);let et=(0,h.useRef)(null),ea=(0,C.Te)({count:_||j?0:ee.length,getScrollElement:()=>_?null:et.current,estimateSize:(0,h.useCallback)(()=>450*!_,[_]),measureElement:_?void 0:e=>e.getBoundingClientRect().height,overscan:5*!_});(0,h.useEffect)(()=>{if(_)return;let e=ea.getVirtualItems();if(0===e.length||!y||b||!N)return;let t=e[e.length-1];t&&t.index>=ee.length-5&&y()},[_,ea.getVirtualItems,y,b,N,ee.length]);let ei=(0,h.useRef)(null);if((0,h.useEffect)(()=>{if(!_||!y||!N||b)return;let e=ei.current;if(!e)return;let t=new IntersectionObserver(e=>{var t;(null==(t=e[0])?void 0:t.isIntersecting)&&y()},{rootMargin:"600px 0px"});return t.observe(e),()=>t.disconnect()},[_,y,N,b,ee.length]),_){if(j)return(0,i.jsx)("div",{className:z()("w-full px-4 py-2 space-y-4",k),children:[void 0,void 0,void 0,void 0,void 0].map((e,t)=>(0,i.jsx)(T.A,{},"skeleton-".concat(t)))});let e=ee.slice(0,4),c=ee.slice(4),d=E&&E.adsEnabled&&E.mainAdBlock&&ee.length>=4,p=null;if(d){let e=E.mainAdBlock;p={type:e.type,numberOfItems:e.numberOfItems||1,..."activities"===e.type&&{q:f.id},..."availability"===e.type&&{tourId:e.tourId,variant:e.variant},..."city"===e.type&&{locationId:e.locationId}}}let x=!J&&!X&&ee.length>0;return(0,i.jsxs)("div",{className:k,children:[" ",x&&("PERMISSION_DENIED"===W?(0,i.jsxs)("p",{className:"flex items-start gap-1.5 px-4 pt-3 text-sm text-gray-500",children:[(0,i.jsx)(n.A,{className:"h-4 w-4 shrink-0 mt-0.5","aria-hidden":"true"}),(null==(t=O.siteList)?void 0:t.locationBlockedHint)||"Location access is blocked – allow it in your browser settings to see distances"]}):(0,i.jsx)("div",{className:"px-4 pt-3",children:(0,i.jsxs)("button",{type:"button",onClick:Q,className:"inline-flex items-center gap-1.5 rounded-full border border-gray-300 bg-white/70 px-3 py-1.5 text-sm text-text-dark shadow-sm active:scale-95 transition-transform",children:[(0,i.jsx)(n.A,{className:"h-4 w-4 shrink-0 text-accent","aria-hidden":"true"}),(null==(a=O.siteList)?void 0:a.enableLocationHint)||"Enable location to see distances"]})})),e.map((e,t)=>(0,i.jsxs)("div",{className:"px-4 py-4",children:[" ",(0,i.jsx)(S,{site:e,periods:v,isFavorite:g(e.id),userCoordinates:X?[X.latitude,X.longitude]:null,geolocationError:W,isLoadingPosition:J,cityId:f.id,language:u,priority:t<3,onFavorite:()=>m(e.id),onShowOnMap:A})]},e.id)),d&&p&&(0,i.jsx)("div",{className:"px-4 py-4 gyg-widget-wrapper",children:(0,i.jsx)(B.A,{widgetConfig:p,gygConfig:E.gyg})},"".concat(f.id,"-main-ad")),c.map((t,a)=>(0,i.jsxs)("div",{className:"px-4 py-4",children:[" ",(0,i.jsx)(S,{site:t,periods:v,isFavorite:g(t.id),userCoordinates:X?[X.latitude,X.longitude]:null,geolocationError:W,isLoadingPosition:J,cityId:f.id,language:u,priority:e.length+a<3,onFavorite:()=>m(t.id),onShowOnMap:A})]},t.id)),N&&y&&(0,i.jsx)("div",{ref:ei,"aria-hidden":"true"}),b&&(0,i.jsxs)("div",{className:"px-4 py-2",children:[" ",(0,i.jsx)(T.A,{},"loading-skeleton-1")]}),!1,!b&&!j&&!N&&ee.length>0&&(0,i.jsxs)("div",{className:"px-4 pt-4 pb-8 text-center space-y-4",children:[(0,i.jsx)("p",{className:"text-sm text-gray-500",children:(null==(l=O.siteList)?void 0:l.noMoreSites)||"Ingen flere sev\xe6rdigheder fundet."}),!A&&(0,i.jsxs)(o(),{href:"/".concat(I||u,"/").concat(f.id,"/map"),className:"inline-flex items-center gap-2 rounded-full bg-primary px-5 py-2.5 text-sm font-medium text-white shadow-md active:scale-95 transition-transform",children:[(0,i.jsx)(s.A,{className:"h-4 w-4","aria-hidden":"true"}),(null==(r=O.siteList)?void 0:r.seeOnMap)||"See them on the map"]})]})]})}{let e=z()("w-full h-full overflow-auto px-0 py-2 bg-[#EAE6DB]",k);return(0,i.jsx)("div",{ref:et,className:e,style:{contain:"strict"},children:j?(0,i.jsx)("div",{className:"relative w-full px-4 pt-1 space-y-4",children:[void 0,void 0,void 0,void 0,void 0].map((e,t)=>(0,i.jsx)(T.A,{},"skeleton-".concat(t)))}):(0,i.jsxs)("div",{style:{height:"".concat(ea.getTotalSize(),"px"),width:"100%",position:"relative"},children:[ea.getVirtualItems().map(e=>{let t=ee[e.index];return t?(0,i.jsx)("div",{ref:ea.measureElement,"data-index":e.index,style:{position:"absolute",top:0,left:0,width:"100%",height:"".concat(e.size,"px"),transform:"translateY(".concat(e.start,"px)"),paddingTop:"4px",paddingBottom:"12px",paddingLeft:"16px",paddingRight:"16px"},children:(0,i.jsx)(S,{site:t,periods:v,isFavorite:g(t.id),userCoordinates:X?[X.latitude,X.longitude]:null,geolocationError:W,isLoadingPosition:J,cityId:f.id,language:u,priority:e.index<3})},t.id):(console.warn("Site not found at index: ".concat(e.index)),null)}),b&&(0,i.jsx)("div",{className:"px-4 pt-1 space-y-4",style:{position:"absolute",top:"".concat(ea.getTotalSize(),"px"),left:0,width:"100%"},children:(0,i.jsx)(T.A,{},"loading-skeleton-1")}),!b&&!j&&!N&&ee.length>0&&(0,i.jsx)("div",{className:"text-center p-4 text-gray-500",style:{position:"absolute",top:"".concat(ea.getTotalSize()+100*!!b,"px"),left:0,width:"100%"},children:(null==(c=O.siteList)?void 0:c.noMoreSites)||"Ingen flere sev\xe6rdigheder fundet."})]})})}}}}]);

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.