1import{a as c}from"./chunk-3Q75T6OS.js";import{f as h,g as y,i as x}from"./chunk-73F6XTYG.js";var C=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],N=[31,29,31,30,31,30,31,31,30,31,30,31],O=/^\d{4}-\d{2}-\d{2}$/;function l(e){if(!e)return null;let t=/^(?:\d{4}|-)-(\d{2})-(\d{2})$/.exec(e);if(!t)return null;let r=Number(t[1]),n=Number(t[2]);return r<1||r>12||n<1||n>N[r-1]?null:{month:r,day:n}}var b=e=>String(e).padStart(2,"0"),L=e=>e%4===0&&e%100!==0||e%400===0;function Z(e,t){let r=t.toISOString().slice(0,10),n=e.extra?.closure;if(n?.type==="temporary"){let f=n.reopensOn&&O.test(n.reopensOn)?n.reopensOn:void 0;if(!f)return{kind:"temporary"};if(f>r)return{kind:"temporary",reopensOn:f}}let o=l(e.rules?.seasonStart),a=l(e.rules?.seasonEnd);if(!o||!a)return{kind:"open"};if(o.month===1&&o.day===1&&a.month===12&&a.day===31)return{kind:"open"};let i=(f,E)=>f*100+E,s=i(t.getUTCMonth()+1,t.getUTCDate()),u=i(o.month,o.day),p=i(a.month,a.day);if(u<=p?s>=u&&s<=p:s>=u||s<=p)return{kind:"open"};let d=t.getUTCFullYear();u<s&&(d+=1);let k=o.month===2&&o.day===29&&!L(d)?28:o.day;return{kind:"seasonal",reopensOn:`${d}-${b(o.month)}-${b(k)}`}}function M(e,t){if(!O.test(e))return"";let[r,n,o]=e.split("-").map(Number);return n<1||n>12?"":t?`${C[n-1]} ${o}, ${r}`:`${C[n-1]} ${o}`}function ee(e){return{extra:e.closure?{closure:e.closure}:void 0,rules:{seasonStart:e.seasonStart,seasonEnd:e.seasonEnd}}}function te(e){if(e.kind==="open")return null;let t=e.reopensOn?M(e.reopensOn,e.kind==="temporary"):"";return t?`Closed \xB7 reopens ${t}`:e.kind==="temporary"?"Temporarily closed":null}function ne(e){return e?String(e).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'"):""}function S(e,t){return e?e.length<=t?e:e.slice(0,t-3).trim()+"...":""}function R(e){return e?String(e).replace(/<\/(h[1-6]|p|div|section|article|blockquote|li|tr)>/gi,` 2 3`).replace(/<br\s*\/?>/gi,` 4`).replace(/<[^>]*>/g,"").replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,'"').replace(/'/g,"'").replace(/ /g," ").replace(/[^\S\n]+/g," ").replace(/\n{3,}/g,` 5 6`).trim():""}var pe={label:"Basic Listing:",body:"Only the essentials, automatically compiled from public search results. Not yet verified by the campground."};function fe(e){if(!e)return{};let t={};return e.amenity&&Object.assign(t,e.amenity),e.feature&&Object.assign(t,e.feature),e.activity&&Object.assign(t,e.activity),e.terrain&&Object.assign(t,e.terrain),e.access&&Object.assign(t,e.access),t}function U([e,t],[r,n]){if(t.isCover&&!n.isCover)return-1;if(!t.isCover&&n.isCover)return 1;let o=typeof t.order=="number"?t.order:Number.POSITIVE_INFINITY,a=typeof n.order=="number"?n.order:Number.POSITIVE_INFINITY;return o!==a?o-a:e.localeCompare(r,"en",{numeric:!0})}function P(e){return e?Object.entries(e).sort(U):[]}function v(e){return P(e).map(([,t])=>t)}function le(e){return v(e).map(t=>t.url)}function me(e){return v(e).map(t=>t.caption??t.description??"")}function de(e){if(e==null)return"";let t=Math.floor(e/100),r=e%100,n=t>=12?"pm":"am";return`${t%12||12}:${String(r).padStart(2,"0")}${n}`}function ge(e,t){let r=l(e),n=l(t);if(r&&n&&r.month===1&&r.day===1&&n.month===12&&n.day===31)return"Year-round";let o=$(r),a=$(n);return!o&&!a?"":`${o||"?"} \u2013 ${a||"?"}`}var _=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function $(e){return e?`${_[e.month-1]} ${e.day}`:""}function he(e){if(e?.name)return{name:e.name,initial:e.name.charAt(0).toUpperCase(),joinedDate:e.foundingDate,photoURL:e.image}}function ye(e){let t=e.url?.startsWith("http")&&!e.url.includes("campertunity.com")?e.url:void 0;return{phoneNumber:e.telephone,email:e.publicEmail,website:t}}var V=[/(^|\.)ssr-app-zpimxgrglq-uc\.a\.run\.app$/i,/(^|\.)campertunity\./i];function H(e){if(!e)return!1;try{let t=new URL(e).hostname;return V.some(r=>r.test(t))}catch{return!1}}function g(e){if(!e)return[];let t=new Set,r=[];for(let[n,o]of Object.entries(e))!o||typeof o!="object"||typeof o.url!="string"||t.has(o.url)||H(o.url)||w(o.url)&&(t.add(o.url),r.push({name:F(n)?void 0:B(n),url:o.url,hasReviews:o.hasReviews,booking:o.booking}));return r}function B(e){return e.replace(/_/g," ")}function F(e){return/^[a-f0-9]{6,}$/i.test(e)}function w(e){if(!e)return!1;
6try{return/^https?:$/i.test(new URL(e).protocol)}catch{return!1}}function A(e){let t=e.name?.trim();if(t&&!t.includes("."))return m(t);let n=(t??e.url).replace(/^[a-z][a-z0-9+.-]*:\/\//i,"").replace(/^www\./i,"").split("/")[0].split("?")[0].split(".")[0];return n?m(n):t??e.url}function I(e){let t=g(e.sameAs),r=t.some(a=>a.booking!==void 0),n=t.filter(a=>a.booking===!0);return(r?n:t).map(a=>({name:A(a),url:a.url}))}function j(e){return Q(e)&&!D(e)?[]:I(e)}function J(e){return j(e)[0]}function z(e){let t=new Map;for(let r of e){if(!w(r.url))continue;let n;try{n=new URL(r.url).hostname.replace(/^www\./,"")}catch{continue}let o=n.toLowerCase(),a=t.get(o);a?a.urls.includes(r.url)||a.urls.push(r.url):t.set(o,{name:A(r),host:n,urls:[r.url]})}return[...t.values()]}function G(e){return z(I(e))}function Y(e){if(D(e)||!X(e))return!1;let t=e.extra?.integrations;return!!e.email||!!e.hasEmail||!!t?.[c.Campertunity]?.id||!!t?.[c.RecreationGov]?.id}function xe(e){let t=G(e);if(Y(e)||e.contactToBook)return t;let r=J(e);return r?t.filter(n=>!n.urls.includes(r.url)):[]}var q=["hipcamp.com",".hipcamp.com"];function Ce(e){return g(e.sameAs).some(t=>{try{let r=new URL(t.url).hostname.replace(/^www\./,"");return q.some(n=>n.startsWith(".")?r.endsWith(n):r===n)}catch{return!1}})}function be(e){if(T(e))return!1;let t=e.extra?.integrations;return t?.[c.Campertunity]?.id||t?.[c.RecreationGov]?.id?!1:g(e.sameAs).length>0}function Oe(e){if(e)return{summary:e.summary,positives:e.positives,negatives:e.negatives,rating:e.sentimentRating}}function Se(e){let t=Object.values(e.aggregateRating?.review??{}).filter(n=>!!n.author?.identifier);if(t.length>0){let n=t.filter(a=>typeof a.ratingValue=="number"&&(a.ratingValue??0)>0);return{ratingValue:n.length?n.reduce((a,i)=>a+(i.ratingValue??0),0)/n.length:e.aggregateRating?.ratingValue??0,reviewCount:t.length,fromAi:!1}}let r=e.reviewSummary?.sentimentRating;if(r)return{ratingValue:r,reviewCount:0,fromAi:!0}}function Re(e){let t=e.offers,r=Object.values(e.priceRanges??{}).flatMap(u=>[u.from,u.to].filter(p=>typeof p=="number"&&Number.isFinite(p))),n=r.length>0?Math.min(...r):t?.minPrice??t?.price,o=r.length>0?Math.max(...r):t?.maxPrice;if(n==null)return;let a=e.address?.addressCountry??"CA",i=y(a)??"$",s=h(a)??"CAD";return{min:n,max:o,symbol:i,currency:s}}function T(e){return!!e.extra?.claimedDate}function Q(e){return T(e)||!!e.extra?.integrations?.[c.Campertunity]?.id}function D(e){let t=e.extra?.integrations?.[c.Campertunity];return!!t?.id&&t.canAcceptBookings===0}function X(e){return e.allowCampertunityBooking!==!1}function $e(e){let t=e.extra?.integrations;return t?Object.keys(t).some(r=>r!=="campertunity"):!1}function ve(e,t){let r;try{r=new URL(e).pathname}catch{r=e}let o=`${r.replace(/\/$/,"")}/details`;return t?`${o}?action=${t}`:o}function m(e){return e.toLowerCase().split(" ").map(t=>t.charAt(0).toUpperCase()+t.slice(1)).join(" ")}function we(e,t){let n=[m(e)],o=[];if(t?.addressLocality&&o.push(t.addressLocality),t?.addressRegion&&t?.addressCountry){let a=x(t.addressRegion.toUpperCase(),t.addressCountry.toUpperCase());a?o.push(m(a)):t.addressRegion&&o.push(t.addressRegion)}else t?.addressRegion&&o.push(t.addressRegion);return o.length>0&&n.push(o.join(", ")),n.push("Campertunity"),n.join(" | ")}function Ae(e){return e?S(R(e),155):""}function Ie(e){let t=e.aggregateRating?.review;return t?Object.values(t).filter(r=>!!r.author?.identifier).map(r=>{let n=r.author?.name??"Guest";return{authorName:n,authorInitial:n.charAt(0).toUpperCase(),rating:r.ratingValue??0,text:r.reviewBody??"",date:W(r.datePublished),photos:r.photos??[]}}):[]}function W(e){if(!e)return"";try{let t=new Date(e);return`${["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"][t.getMonth()]} ${t.getFullYear()}`}catch{return""}}var De="Promoted",ke=e=>e?.trim().toUpperCase()==="CA"?"cad":"usd";export{ne as a,S as b,R as c,l as d,Z as e,M as f,ee as g,te as h,pe as i,fe as j,P as k,v as l,le as m,me as n,de as o,ge as p,he as q,ye as r,H as s,g as t,w as u,j as v,J as w,z as x,Y as y,xe as z,Ce as A,be as B,Oe as C,Se as D,Re as E,T as F,Q as G,D as H,$e as I,ve as J,we as K,Ae as L,Ie as M,De as N,ke as O};
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.