PageSourceSearch

https://chocozap.jp/_nuxt/OuKAhc5C.js

js chocozap.jp collected 2026-10-02 03:34:57 UTC 6,309 bytes, 1 lines download raw bytes

1import{a3 as I,a4 as m,U as b}from"./DUtOBDbA.js";import{g as C}from"./v6t0GFCJ.js";import{a as g,u as A}from"./zYn-IMj0.js";const E=3,w=e=>{if(!e)return null;const t=new Date(e).getTime();return Number.isNaN(t)?null:t},N=e=>{const t=w(e.studio_operation.grand_opening_at);return t!==null&&t>Date.now()},v=(e,t=m())=>{const n=e?.studio_operation.renewal_opening_at;if(!n)return!1;const r=m(n);return r.isValid()?!t.isBefore(r)&&t.isBefore(r.add(E,"M")):!1},O=e=>{const t=`chocoZAP ${e.studio_profile.name}`,n=e.studio_operation.renewal_opening_at,r=n||e.studio_operation.grand_opening_at;if(!r)return t;const s=w(r);if(s===null||s<=Date.now())return t;const o=n?"リニューアルOPEN":"OPEN";return`${t} ${C(r)} ${o}`},_=" ",$=e=>{const t=e.studio_nearest_stations.slice(0,1).map(r=>{const s=r.exit_name?`${_}${r.exit_name}`:"",o=r.walking_minutes!=null?`${_}徒歩${r.walking_minutes}分`:"";return`電車:${r.railway_line_names} / ${r.name}駅${s}${o}`}),n=e.studio_nearest_bus_stops.slice(0,1).map(r=>{const s=r.walking_minutes!=null?`${_}徒歩${r.walking_minutes}分`:"";return`バス:${r.name}${s}`});return[...t,...n]},M=e=>e.flatMap(t=>t.category==="machine"&&t.active_count>0&&t.thumbnail_url?[{name:t.name,imageUrl:t.thumbnail_url,count:t.active_count}]:[]),T=e=>e.filter(t=>t.category==="service"&&t.active_count>0).map(t=>({name:t.name,thumbnailUrl:t.thumbnail_url,detailsUrl:t.details_url??null})),x=e=>({id:e.id,hacomonoStudioId:e.hacomono_studio.hacomono_studio_id,fullname:O(e),address:e.studio_profile.address,accessLines:$(e),serviceIcons:e.services.filter(t=>t.category!=="machine"&&!!t.labeled_icon_url).map(t=>({name:t.name,iconUrl:t.labeled_icon_url})),hasMachine:e.services.some(t=>t.category==="machine"),is24h:e.studio_operation.always_open,notOpen:N(e),isNew:v(e),isWomenOnly:e.is_women_only,isOneShot:e.is_one_shot,latitude:e.studio_profile.latitude,longitude:e.studio_profile.longitude}),W=()=>{const{client:e}=g(),t=async(s={})=>await e("/v1/studios",{params:s});return{searchStudios:t,countStudios:async(s={})=>(await t({...s,page:1,per_page:1})).pagination.total_count,getStudioByHacomonoId:async s=>{try{return(await e(`/v1/studios/hacomono/${s}`)).studio}catch(o){if(o instanceof I&&o.statusCode===404)return null;throw o}}}};let y=null;const h=()=>{const{client:e}=g(),t=b("chococore-prefectures",()=>null),n=async()=>t.value?t.value:(y||(y=e("/v1/prefectures").then(a=>(t.value=a.prefectures,a.prefectures)).finally(()=>{y=null})),await y),r=async()=>{const a=await n(),u=[];return a.forEach(c=>{const d=c.region?.name??"その他",p=u.find(S=>S.regionName===d);p?p.prefectures.push(c):u.push({regionName:d,prefectures:[c]})}),u},s=async a=>(await n()).find(c=>Number(c.jisx0401)===Number(a)),o=async a=>(await n()).find(c=>c.id===a);return{prefectures:t,getPrefectures:n,getRegionGroups:r,findByJisCode:s,findById:o,findCityName:async(a,u)=>(await o(a))?.cities.find(d=>d.id===u)?.name??"",findCityByCode:async a=>{const u=await n();for(const c of u){const d=c.cities.find(p=>p.code===a);if(d)return{prefecture:c,city:d}}}}},R={R003:"セルフエステ",R004:"セルフ脱毛",R005:"ゴルフ",R014:"セルフネイル",R015:"セルフホワイトニング",R017:"ワークスペース",R018:"デスクバイク",R019:"マッサージチェア",4284:"カラオケ",4285:"ランドリー",4286:"ピラティス",4287:"セルフフォト",4288:"キッズパーク"},B=()=>({keyword:"",prefectureId:null,cityId:null,serviceIds:[],nearby:!1,womenOnly:!1,alwaysOpen:!1,oneShot:!1}),f=e=>!!e&&e.toUpperCase()!=="FALSE",j=e=>{const t=B();t.keyword=e.get("q")??"";const n=Array.from(new Set((e.get("select")??"").split("-").filter(Boolean)));t.nearby=f(e.get("nearby"));const r=t.nearby?null:e.get("prefecture")||null,s=t.nearby?null:e.get("municipality")||null;t.womenOnly=f(e.get("women_only")),t.alwaysOpen=f(e.get("always_open")),t.oneShot=f(e.get("one_shot"));const o=e.get("nearest_order"),i=o==="10"||o==="30"||o==="all"?o:null;return{conditions:t,prefectureJisCode:r,cityCode:s,serviceSelectValues:n,isAreaSearch:f(e.get("areasearch")),hasMap:f(e.get("map")),nearestOrder:i}},F=async(e,t)=>{if(t.length===0){e.serviceIds=[];return}const{getServices:n}=A(),r=await n(),s=[];for(const o of t){const i=R[o];if(i){const l=r.find(a=>a.name===i);l?s.push(l.id):console.error(`Error: 旧URLのサービス「${i}」がちょこあに存在しません。select=${o}`);continue}if(/^\d+$/.test(o)){const l=Number(o);r.some(a=>a.id===l)&&s.push(l)}}e.serviceIds=Array.from(new Set(s))},J=async(e,t)=>{const{findByJisCode:n,findCityByCode:r}=h();if(t.cityCode){const s=await r(t.cityCode);
1if(s){e.prefectureId=s.prefecture.id,e.cityId=s.city.id;return}e.cityId=null}if(t.prefectureJisCode){const s=await n(t.prefectureJisCode);e.prefectureId=s?.id??null,e.cityId=null}},q=async(e,t)=>{const n=(i,l)=>{l?e.set(i,l):e.delete(i)};let r,s,o=!1;if(!t.nearby&&t.prefectureId)try{const{getPrefectures:i}=h();r=(await i()).find(a=>a.id===t.prefectureId),s=t.cityId?r?.cities.find(a=>a.id===t.cityId):void 0}catch(i){console.error("Error: prefectures api request failed.",i),o=!0}n("select",t.serviceIds.length>0?t.serviceIds.join("-"):null),o||(n("prefecture",!t.nearby&&r?r.jisx0401:null),n("municipality",!t.nearby&&s?s.code:null)),n("nearby",t.nearby?"true":null),n("women_only",t.womenOnly?"true":null),n("always_open",t.alwaysOpen?"true":null),n("one_shot",t.oneShot?"true":null),n("q",t.keyword||null)},D=(e,t)=>{const n=t/111,r=t/(111*Math.cos(e.latitude*Math.PI/180));return{top_left_lat:e.latitude+n,top_left_lng:e.longitude-r,bottom_right_lat:e.latitude-n,bottom_right_lng:e.longitude+r}},G=10,H=30,P=4,K=(e,t={})=>{const n={};e.keyword&&(n.keyword=e.keyword),!e.nearby&&e.prefectureId&&(n.prefecture_id=e.prefectureId),!e.nearby&&e.cityId&&(n.city_id=e.cityId),e.serviceIds.length>0&&(n["service_ids[]"]=e.serviceIds),e.womenOnly&&(n.is_women_only=!0),e.alwaysOpen&&(n.is_always_open=!0),e.oneShot&&(n.is_one_shot=!0);const{position:r,radiusKm:s,sortNearby:o,page:i,perPage:l}=t;return r&&(e.nearby||o)&&(n.latitude=r.latitude,n.longitude=r.longitude,n.sort="nearby",n.direction="asc"),r&&s&&Object.assign(n,D(r,s)),i&&(n.page=i),l&&(n.per_page=l),n};export{G as D,P as N,H as W,h as a,K as b,B as c,O as d,M as e,T as f,q as g,F as h,v as i,j as p,J as r,x as t,W 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.