PageSourceSearch

https://my.portugalvillas.nl/build/assets/Upcoming-goa4S1qE.js

js portugalvillas.nl collected 2026-10-06 11:06:34 UTC 6,892 bytes, 1 lines download raw bytes

1import{_ as T}from"./AppLayout-YRGV7z8V.js";import{u as L}from"./useLocaleFormatting-lkTkwnAI.js";import{u as M,b as H,o as i,w as V,d as e,e as r,f,t as s,F as x,B as w,i as v,n as g,j as u}from"./app-3-HEZuwY.js";import{p as F}from"./dateUtils-Bo0yQJx8.js";import"./LanguageSwitcher-D8vYLJhg.js";/* empty css            */const U={class:"py-12"},z={class:"max-w-7xl mx-auto sm:px-6 lg:px-8"},E={class:"bg-white overflow-hidden shadow-sm sm:rounded-lg"},I={class:"p-6"},N={class:"flex items-center justify-between mb-6"},A={class:"text-2xl font-bold text-gray-900"},G={href:"/owner/bookings",class:"text-indigo-600 hover:text-indigo-900 text-sm font-medium"},O={key:0,class:"space-y-4"},P={class:"flex justify-between items-start"},R={class:"flex-1"},q={class:"flex items-center space-x-2 mb-1"},J={class:"text-sm font-medium text-indigo-600"},K={class:"font-semibold"},Q={class:"text-gray-700"},W={class:"text-sm text-gray-600"},X={class:"mt-2 flex items-center space-x-4"},Y={class:"text-sm"},Z={class:"font-medium text-gray-900 ml-1"},ee={class:"text-sm"},te={class:"text-gray-700 ml-1"},se={class:"flex flex-col items-end space-y-2"},oe={class:"flex items-center space-x-2"},ne={class:"flex items-center space-x-3"},ie={key:1,class:"px-2 py-1 rounded text-xs font-medium bg-gray-100 text-gray-500"},re=["href"],ae={key:1,class:"flex items-center justify-between border-t border-gray-200 bg-white px-4 py-3 sm:px-6 mt-6"},le={class:"flex flex-1 justify-between sm:hidden"},de=["href"],ce=["href"],me={class:"hidden sm:flex sm:flex-1 sm:items-center sm:justify-between"},ge={class:"text-sm text-gray-700"},ue={class:"font-medium"},fe={class:"font-medium"},xe={class:"font-medium"},pe={class:"isolate inline-flex -space-x-px rounded-md shadow-sm","aria-label":"Pagination"},be=["href","innerHTML"],he=["innerHTML"],ye={key:2,class:"text-center py-12"},_e={class:"mt-2 text-gray-500"},Be={__name:"Upcoming",props:{bookings:Object},setup(a){const{t:d}=M(),{formatDate:p,formatBookingStatus:k}=L(),$=t=>{const o=k(t);return{confirmed:"bg-green-100 text-green-800",pending:"bg-yellow-100 text-yellow-800",cancelled:"bg-red-100 text-red-800",completed:"bg-blue-100 text-blue-800"}[o]||"bg-gray-100 text-gray-800"},S=t=>!t.resources||!t.resources.length?0:t.resources.reduce((o,c)=>{const l=c.pivot||{};return o+(l.adults||0)+(l.children||0)+(l.babies||0)},0),b=t=>{const o=new Date;o.setHours(0,0,0,0);const l=F(t)-o;return Math.ceil(l/(1e3*60*60*24))},j=t=>{const o=b(t);return o===0?d("owner.bookings.upcoming.today"):o===1?d("owner.bookings.upcoming.tomorrow"):d("owner.bookings.upcoming.inDays",{days:o})},B=t=>{const o=b(t);return o<=1?"bg-red-100 text-red-800":o<=7?"bg-yellow-100 text-yellow-800":"bg-blue-100 text-blue-800"},C=t=>({submitted:"bg-blue-100 text-blue-800",approved:"bg-green-100 text-green-800",rejected:"bg-red-100 text-red-800",draft:"bg-gray-100 text-gray-600"})[t]||"bg-gray-100 text-gray-600",D=t=>({submitted:d("owner.bookings.upcoming.sefSubmitted"),approved:d("owner.bookings.upcoming.sefApproved"),rejected:d("owner.bookings.upcoming.sefRejected"),draft:d("owner.bookings.upcoming.sefDraft")})[t]||t;return(t,o)=>(i(),H(T,null,{default:V(()=>{var c,l;return[e("div",U,[e("div",z,[e("div",E,[e("div",I,[e("div",N,[e("h1",A,s(t.$t("owner.bookings.upcoming.title")),1),e("a",G," ← "+s(t.$t("owner.bookings.upcoming.allBookings")),1)]),(l=(c=a.bookings)==null?void 0:c.data)!=null&&l.length?(i(),r("div",O,[(i(!0),r(x,null,w(a.bookings.data,n=>{var m,h,y,_;return i(),r("div",{key:n.id,class:"border border-gray-200 rounded-lg p-4 hover:shadow-md transition-shadow"},[e("div",P,[e("div",R,[e("div",q,[e("span",J,"#"+s(n.id),1),e("h3",K,s(((h=(m=n.resources)==null?void 0:m[0])==null?void 0:h.name)||t.$t("owner.bookings.upcoming.accommodation")),1)]),e("p",Q,s(n.firstname)+" "+s(n.lastname),1),e("p",W,s(S(n))+" "+s(t.$t("owner.bookings.upcoming.guests")),1),e("div",X,[e("div",Y,[o[0]||(o[0]=e("span",{class:"text-gray-500"},"Check-in:",-1)),e("span",Z,s(v(p)(n.from)),1)]),e("div",ee,[o[1]||(o[1]=e("span",{class:"text-gray-500"},"Check-out:",-1)),e("span",te,s(v(p)(n.to)),1)])])]),e("div",se,[e("div",oe,[e("span",{class:g([B(n.from),"px-2 py-1 rounded-full text-xs font-medium"])},s(j(n.from)),3),e("span",{class:g([$((y=n.booking_status)==null?void 0:y.name),"px-2 py-1 rounded-full text-xs font-medium"])},s(((_=n.booking_status)==null?void 0:_.name)||t.$t("owner.bookings.upcoming.unknown")),3)]),e("div",ne,[n.sef_form?(i(),r("span",{key:0,class:g([C(n.sef_form.status),"px-2 py-1 rounded text-xs font-medium"])}," SEF: "+s(D(n.sef_form.status)),3)):(i(),r("span",ie," SEF: "+s(t.$t("owner.bookings.upcoming.notSubmitted")),1)),e("a",{href:`/owner/bookings/${n.id}`,class:"text-indigo-600 hover:text-indigo-900 text-sm font-medium"},s(t.$t("owner.bookings.upcoming.details"))+" → ",9,re)])])])])}),128))])):f("",!0),a.bookings.links?(i(),r("div",ae,[e("div",le,[a.bookings.prev_page_url?(i(),r("a",{key:0,href:a.bookings.prev_page_url,class:"relative inline-flex items-center rounded-md border border-gray-300 bg-white px-4 py-2 text-sm font-medium text-gray-700 hover:bg-gray-50"},s(t.$t("owner.bookings.upcoming.previous")),9,de)):f("",!0),a.bookings.next_page_url?(i(),r("a",{key:1,href:a.bookings.next_page_url,class:"relative ml-3 inline-flex items-center rounded-md border border-gray-300 bg-white px-4 py-2 text-sm font-medium text-gray-700 hover:bg-gray-50"},s(t.$t("owner.bookings.upcoming.next")),9,ce)):f("",!0)]),e("div",me,[e("div",null,[e("p",ge,[u(s(t.$t("owner.bookings.upcoming.showing"))+" ",1),e("span",ue,s(a.bookings.from),1),u(" "+s(t.$t("owner.bookings.upcoming.to"))+" ",1),e("span",fe,s(a.bookings.to),1),u(" "+s(t.$t("owner.bookings.upcoming.of"))+" ",1),e("span",xe,s(a.bookings.total),1),u(" "+s(t.$t("owner.bookings.upcoming.results")),1)])]),e("div",null,[e("nav",pe,[(i(!0),r(x,null,w(a.bookings.links,(n,m)=>(i(),r(x,{key:m},[n.url?(i(),r("a",{key:0,href:n.url,class:g([n.active?"z-10 bg-indigo-600 text-white focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-indigo-600":"text-gray-900 ring-1 ring-inset ring-gray-300 hover:bg-gray-50 focus:outline-offset-0","relative inline-flex items-center px-4 py-2 text-sm font-semibold"]),innerHTML:n.label},null,10,be)):(i(),r("span",{key:1,class:"relative inline-flex items-center px-4 py-2 text-sm font-semibold text-gray-300 ring-1 ring-inset ring-gray-300",innerHTML:n.label},null,8,he))],64))),128))])])])])):(i(),r("div",ye,[o[2]||(o[2]=e("svg",{class:"mx-auto h-12 w-12 text-gray-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M8 7V3m8 4V3m-9 8h10M5 21h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z"})],-1)),e("p",_e,s(t.$t("owner.bookings.upcoming.noBookings")),1)]))])])])])]}),_:1}))}};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.