1import{_ as A}from"./BfKarpTb.js";import{o as a,c as u,j as t,e as V,J as O,G as j,y as q,a as i,b as g,m as h,k as S,s as B,N as E,v as x,n as _,O as I,p as D,F,l as N,w as $,t as M}from"./DOkYTTaS.js";import L from"./MWR6TY81.js";import{o as T}from"./BY31thPY.js";import"./CFq1Tu_h.js";const H=["href"],R={__name:"StreetViewLink",props:{params:{type:String,required:!0}},setup(e){const n=new URL("https://www.google.com/maps/@?api=1&map_action=pano"),[p,c,,o,l,m]=e.params.split(",");return n.searchParams.append("viewpoint",`${p},${c}`),l&&n.searchParams.append("heading",l.slice(0,-1)),m&&n.searchParams.append("pitch",Number(m.slice(0,-1))-90),o&&n.searchParams.append("fov",o.slice(0,-1)),(b,w)=>(a(),u("a",{class:"text-xs",target:"_blank",rel:"noopener noreferrer",href:t(n).toString()},"Voir sur Google Street View",8,H))}},X=()=>({fetchPanoramaxPicture:async n=>{try{const p=await fetch(`https://api.panoramax.xyz/api/search?ids=${n}`);if(!p.ok)throw new Error("Failed to fetch Panoramax item");return(await p.json()).features?.[0]||null}catch(p){return console.error(p),null}}}),W={key:0,class:"absolute inset-0 bg-black/20 group-hover:bg-black/10 transition-colors flex items-center justify-center"},G={class:"bg-white/90 text-gray-800 px-4 py-2 rounded-full font-medium shadow-lg hover:bg-white transition-all transform hover:scale-105 flex items-center gap-2"},J=["src"],K={class:"relative w-full h-full max-w-[95vw] max-h-[95vh] rounded-lg overflow-hidden flex flex-col"},Q=["src"],Y=V({__name:"PanoramaxViewer",props:{sequence:{},picture:{},style:{default:"width: 100%; height: 100%"},legendSlot:{default:"bottom-right"},zoomWithCtrl:{type:Boolean,default:!0},height:{default:"350px"},fullscreen:{type:Boolean,default:!0},triggerLoad:{type:Boolean,default:!1},preload:{type:Boolean,default:!1},showOverlay:{type:Boolean,default:!0}},setup(e){const n=e,{fetchPanoramaxPicture:p}=X(),c=x(""),o=x(!1),l=x(!1),m=x(!1),b=_(()=>typeof n.style=="string"?n.style:{...n.style}),w=_(()=>`/panoramax?${new URLSearchParams({sequence:n.sequence,picture:n.picture,zoomWithCtrl:n.zoomWithCtrl.toString()}).toString()}`),v=_(()=>n.fullscreen&&!m.value),d=()=>{o.value=!0},P=()=>{n.showOverlay&&!o.value&&(l.value=!0)},y=async()=>{const f=await p(n.picture);f&&f.assets&&f.assets.thumb&&(c.value=f.assets.thumb.href)};return O(()=>{y()}),j(()=>n.picture,()=>{o.value=!1,l.value=!1,y()}),j(()=>n.triggerLoad,f=>{f&&d()}),j(()=>n.preload,f=>{f&&(l.value=!0)}),(f,r)=>{const s=L;return a(),u("div",{class:"h-full w-full relative group",onMouseenter:P},[o.value?h("",!0):(a(),u("div",{key:0,class:"absolute inset-0 bg-cover bg-center cursor-pointer transition-opacity duration-300 z-10",style:q({backgroundImage:`url(${c.value})`}),onClick:d},[e.showOverlay?(a(),u("div",W,[i("button",G,[g(s,{name:"mdi:eye",class:"w-5 h-5"}),r[3]||(r[3]=i("span",null,"Voir panoramax",-1))])])):h("",!0),r[4]||(r[4]=i("div",{class:"absolute bottom-2 right-2 px-2 py-1 bg-black/60 text-white text-xs rounded"},"Panoramax",-1))],4)),o.value||l.value?(a(),u("iframe",{key:1,src:w.value,style:q(b.value),frameborder:"0",scrolling:"no",allowfullscreen:"",class:"w-full h-full absolute inset-0 overflow-hidden"},null,12,J)):h("",!0),o.value&&v.value?(a(),u("button",{key:2,class:"absolute top-2 right-2 p-2 h-10 bg-black/50 hover:bg-black/70 text-white rounded shadow-sm opacity-0 group-hover:opacity-100 transition-opacity z-20",title:"Plein écran",onClick:r[0]||(r[0]=k=>m.value=!0)},[g(s,{name:"mdi:fullscreen",class:"w-5 h-5"})])):h("",!0),(a(),S(E,{to:"body"},[m.value?(a(),u("div",{key:0,class:"fixed inset-0 z-[1000] flex items-center justify-center bg-black bg-opacity-90",onClick:r[2]||(r[2]=B(k=>m.value=!1,["self"]))},[i("div",K,[i("button",{class:"absolute top-4 right-4 z-[1001] flex items-center justify-center p-2 bg-white/90 backdrop-blur-sm rounded-full shadow-lg hover:bg-white hover:scale-110 active:scale-95 transition-all duration-200 focus:outline-none",title:"Fermer",onClick:r[1]||(r[1]=k=>m.value=!1)},[g(s,{name:"mdi:close",class:"w-6 h-6 text-gray-700"})]),i("iframe",{src:w.value,class:"w-full h-full flex-1 bg-black",frameborder:"0",allowfullscreen:""},null,8,Q)])])):h("",!0)]))],32)}}}),U=Object.assign(Y,{__name:"PanoramaxViewer"}),Z={class:"bg-white/90 text-gray-800 px-4 py-2 rounded-full font-medium shadow-lg hover:bg-white transition-all transform hover:scale-105 flex items-center gap-2 pointer-events-none"},ee={class:"absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 w-10 h-10 bg-white rounded-full shadow-lg flex items-center justify-center pointer-events-none"},te=V({__name:"PanoramaxBeforeAfterSlider",props:{sequence:{type:String,required:!0},picture:{type:String,required:!0},beforeSequence:{type:String,required:!0},beforePicture:{type:String,required:!0},initialPosition:{type:Number,default:50},isDialog:{type:Boolean,default:!1},height:{type:String,default:"350px"}},emits:["expand"],setup(e){const n=e,p=x(null),c=x(n.initialPosition),o=x(!1),l=x(!1),m=x(!1),b=()=>{l.value=!0,m.value=!0},w=()=>{m.value=!0},v=(r,s)=>{if(!r)return;const k=r.getBoundingClientRect(),C=(("touches"in s?s.touches[0]?.clientX??0:s.clientX)-k.left)/k.width*100;c.value=Math.max(0,Math.min(100,C))},d=r=>{r.preventDefault(),o.value=!0,v(p.value,r)},P=r=>{o.value&&(r.preventDefault(),v(p.value,r))},y=r=>{o.value&&(r.preventDefault(),v(p.value,r))},f=()=>{o.value=!1};return O(()=>{window.addEventListener("mouseup",f),window.addEventListener("touchend",f)}),I(()=>{window.removeEventListener("mouseup",f),window.removeEventListener("touchend",f)}),(r,s)=>{const k=L,z=U;return a(),u("div",{ref_key:"sliderContainer",ref:p,class:"relative w-full h-full group",onMousemove:P,onTouchmove:y,onMouseenter:w,onTouchstart:w},[t(l)?h("",!0):(a(),u("div",{key:0,class:"absolute inset-0 z-50 flex items-center justify-center bg-black/10 transition-colors cursor-pointer",onClick:b},[i("button",Z,[g(k,{name:"mdi:eye",class:"w-5 h-5"}),s[3]||(s[3]=i("span",null,"Voir Panoramax",-1))]),s[4]||(s[4]=i("div",{class:"absolute bottom-2 right-2 px-2 py-1 bg-black/60 text-white text-xs rounded"},"Panoramax",-1))])),i("div",{class:D(["absolute inset-0",{"pointer-events-none":t(o)}])},[g(z,{sequence:e.sequence,picture:e.picture,"zoom-with-ctrl":!e.isDialog,fullscreen:!1,"show-overlay":!1,"trigger-load":t(l),preload:t(m)},null,8,["sequence","picture","zoom-with-ctrl","trigger-load","preload"])],2),i("div",{class:D(["absolute inset-0",{"pointer-events-none":t(o)}]),style:q({clipPath:`inset(0 ${100-t(c)}% 0 0)`})},[g(z,{sequence:e.beforeSequence,picture:e.beforePicture,"zoom-with-ctrl":!e.isDialog,"legend-slot":"bottom-left",fullscreen:!1,"show-overlay":!1,"trigger-load":t(l),preload:t(m)},null,8,["sequence","picture","zoom-with-ctrl","trigger-load","preload"])],6),t(l)?(a(),u("div",{key:1,class:"absolute top-0 bottom-0 cursor-ew-resize select-none",style:q({left:`${t(c)}%`,width:"40px",marginLeft:"-20px"}),onMousedown:d,onTouchstart:B(d,["prevent"])},[s[5]||(s[5]=i("div",{class:"absolute top-0 bottom-0 w-1 bg-white shadow-lg left-1/2 -translate-x-1/2"},null,-1)),i("div",ee,[g(k,{name:"mdi:arrow-left-right",class:"w-6 h-6 text-gray-600"})])],36)):h("",!0),t(l)?(a(),u("div",{key:2,class:"absolute top-4 left-4 bg-black bg-opacity-60 text-white px-3 py-1 rounded text-sm font-semibold cursor-pointer hover:bg-opacity-80 transition-all",onClick:s[0]||(s[0]=C=>c.value=100)}," Avant ")):h("",!0),!e.isDialog&&t(l)?(a(),u("button",{key:3,class:"absolute top-4 left-1/2 -translate-x-1/2 bg-black bg-opacity-60 text-white p-2 rounded cursor-pointer hover:bg-opacity-80 transition-all flex items-center justify-center",title:"Agrandir",onClick:s[1]||(s[1]=C=>r.$emit("expand"))},[g(k,{name:"mdi:arrow-expand",class:"w-5 h-5"})])):h("",!0),t(l)?(a(),u("div",{key:4,class:"absolute top-4 right-4 bg-black bg-opacity-60 text-white px-3 py-1 rounded text-sm font-semibold cursor-pointer hover:bg-opacity-80 transition-all",onClick:s[2]||(s[2]=C=>c.value=0)}," Après ")):h("",!0)],544)}}}),ne=Object.assign(te,{__name:"PanoramaxBeforeAfterSlider"}),ae={class:"relative w-full h-full max-w-[95vw] max-h-[95vh] rounded-lg shadow-xl overflow-hidden"},re={class:"h-full"},oe=V({__name:"PanoramaxLink",props:{params:{type:String,required:!0},height:{type:String,default:"350px"}},setup(e){const n=(v,d)=>{const P=new RegExp(`${d}=([^;]+)`),y=v.match(P);return y?y[1]:null};function p(v){return{sequence:n(v,"seq")||"",picture:n(v,"pic")||"",beforePicture:n(v,"before-pic")||"",beforeSequence:n(v,"before-seq")||""}}const{sequence:c,picture:o,beforePicture:l,beforeSequence:m}=p(e.params),b=x(!1),w=_(()=>l&&m);return T("Escape",()=>{b.value&&(b.value=!1)}),(v,d)=>{const P=ne,y=N,f=U,r=L;return a(),u(F,null,[t(w)?(a(),u("div",{key:0,style:q({width:"100%",minHeight:e.height,height:e.height,gridColumn:"span 2",overflow:"hidden"}),class:"relative"},[g(y,null,{fallback:$(()=>[i("div",{class:"absolute inset-0 flex flex-col items-center justify-center bg-gray-100 z-10",style:q({width:"100%",minHeight:e.height})}
1,[...d[3]||(d[3]=[i("div",{class:"loader ease-linear rounded-full border-8 border-t-8 border-gray-200 h-16 w-16 mb-4"},null,-1),i("h2",{class:"text-center text-gray-700 text-xl font-semibold"},"Chargement de Panoramax...",-1)])],4)]),default:$(()=>[g(P,{sequence:t(c),picture:t(o),"before-sequence":t(m),"before-picture":t(l),"initial-position":5,height:e.height,onExpand:d[0]||(d[0]=s=>b.value=!0)},null,8,["sequence","picture","before-sequence","before-picture","height"])]),_:1})],4)):(a(),u("div",{key:1,style:q({width:"100%",minHeight:e.height,height:e.height,gridColumn:"span 2",overflow:"hidden"}),class:"relative"},[g(y,null,{fallback:$(()=>[i("div",{class:"absolute inset-0 flex flex-col items-center justify-center bg-gray-100 z-10",style:q({width:"100%",minHeight:e.height})},[...d[4]||(d[4]=[i("div",{class:"loader ease-linear rounded-full border-8 border-t-8 border-gray-200 h-16 w-16 mb-4"},null,-1),i("h2",{class:"text-center text-gray-700 text-xl font-semibold"},"Chargement de Panoramax...",-1)])],4)]),default:$(()=>[g(f,{sequence:t(c),picture:t(o),style:q({width:"100%",height:e.height,gridColumn:"span 2"}),height:e.height},null,8,["sequence","picture","style","height"])]),_:1})],4)),(a(),S(E,{to:"body"},[t(b)?(a(),u("div",{key:0,class:"fixed inset-0 z-[1000] flex items-center justify-center bg-black bg-opacity-75",onClick:d[2]||(d[2]=B(s=>b.value=!1,["self"]))},[i("div",ae,[i("button",{class:"fixed top-4 right-4 z-[1001] flex items-center justify-center p-2 bg-white/90 backdrop-blur-sm rounded-full shadow-lg hover:bg-white hover:scale-110 active:scale-95 transition-all duration-200 focus:outline-none focus:ring-2 focus:ring-lvv-blue-600 focus:ring-offset-2",title:"Fermer","aria-label":"Fermer",onClick:d[1]||(d[1]=s=>b.value=!1)},[g(r,{name:"mdi:close",class:"w-6 h-6 text-gray-700"})]),i("div",re,[g(y,null,{default:$(()=>[t(w)?(a(),S(P,{key:0,sequence:t(c),picture:t(o),"before-sequence":t(m),"before-picture":t(l),"initial-position":5,"is-dialog":!0},null,8,["sequence","picture","before-sequence","before-picture"])):(a(),S(f,{key:1,sequence:t(c),picture:t(o),fullscreen:!1},null,8,["sequence","picture"]))]),_:1})])])])):h("",!0)]))],64)}}}),le=Object.assign(oe,{__name:"PanoramaxLink"}),se={key:0,class:"grid grid-cols-1 m-0 justify-items-center"},ie={key:0,class:"text-center"},ue={key:1,class:"text-base italic"},ce={key:2},de={class:"grid w-full justify-items-center"},fe={key:1,class:"grid w-full justify-items-center grid-cols-1"},be={__name:"ContentImage",props:{imageUrl:{type:String,required:!1,default:void 0},link:{type:String,required:!1,default:void 0},caption:{type:String,required:!1,default:void 0},credit:{type:String,required:!1,default:void 0},streetView:{type:String,required:!1,default:void 0},panoramax:{type:String,required:!1,default:void 0}},setup(e){return(n,p)=>{const c=A,o=R,l=le;return a(),u(F,null,[e.imageUrl?(a(),u("figure",se,[g(c,{"image-url":e.imageUrl,alt:e.caption||"",link:e.link,"image-class":"w-full rounded-lg",clickable:!e.link},null,8,["image-url","alt","link","clickable"]),e.caption?(a(),u("figcaption",ie,M(e.caption),1)):h("",!0),e.credit?(a(),u("div",ue,"Crédit image : "+M(e.credit),1)):h("",!0),e.streetView?(a(),u("div",ce,[g(o,{params:e.streetView},null,8,["params"])])):h("",!0),i("div",de,[e.panoramax?(a(),S(l,{key:0,params:e.panoramax},null,8,["params"])):h("",!0)])])):h("",!0),e.panoramax&&!e.imageUrl?(a(),u("div",fe,[g(l,{params:e.panoramax},null,8,["params"])])):h("",!0)],64)}}};export{be 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.