PageSourceSearch

https://ntmg-book-eizandensha.vercel.app/_next/static/chunks/pages…/productGroupCalendar-be6b0fe51467b3fe.js

js ntmg-book-eizandensha.vercel.app collected 2026-10-03 07:25:57 UTC 17,264 bytes, 2 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2372],{8923:e=>{e.exports={dimmer:"MultiProductDateForm_dimmer__9OeB_"}},31102:(e,t,l)=>{"use strict";l.d(t,{m:()=>a});let a=(e,t)=>t?e.includes("?")?"".concat(e,"&").concat(t):"".concat(e,"?").concat(t):e},33035:(e,t,l)=>{"use strict";l.d(t,{l:()=>n});var a=l(81585),i=l(89099),s=l(85698);let n=()=>{let{i18n:e}=(0,a.B)(),t=(0,i.useRouter)();return(0,s.s)(null==t?void 0:t.query,e.language)}},44679:(e,t,l)=>{"use strict";l.d(t,{D:()=>s});var a=l(14232),i=l(7223);let s=e=>{let{apiKey:t,useApiKeyInPaths:l}=a.useContext(i.P);return l?"/".concat(t).concat(e):e}},51436:(e,t,l)=>{"use strict";l.d(t,{DF:()=>m,Fm:()=>g,LS:()=>o,Nk:()=>p,W2:()=>h,ai:()=>w,rU:()=>_,wn:()=>c});var a=l(6897),i=l(77547),s=l(1479),n=l.n(s),d=l(6847),r=l(43660);let o=e=>{let t=n()(e).startOf("month");for(;0!==t.day();)t=t.subtract(1,"day");let l=n()(e).endOf("month");for(;6!==l.day();)l=l.add(1,"day");let a=[];for(let e=n()(t);e.isSameOrBefore(l);e=e.add(7,"days")){let t=[];for(let l=0;l<7;l++)t.push(n()(e).day(l).format("YYYY-MM-DD"));a.push({days:t})}return a},_=(e,t)=>
1n()(e).format("YYYY-MM")===n()(t).format("YYYY-MM"),c=e=>n()().format("YYYY-MM")===n()(e).format("YYYY-MM"),m=(e,t,l)=>{let s={},d=e.filter(e=>(0,r.Mo)(e,t)).map(e=>n().tz(e.start_date_time_utc,t).format("YYYY-MM-DD")),o=e.filter(e=>(0,r.jj)(e,t)).map(e=>n().tz(e.start_date_time_utc,t).format("YYYY-MM-DD")),_=e.filter(e=>e.is_closed).map(e=>n().tz(e.start_date_time_utc,t).format("YYYY-MM-DD")),c=e.filter(e=>e.is_fully_booked&&!e.is_closed).map(e=>n().tz(e.start_date_time_utc,t).format("YYYY-MM-DD")),m=e.filter(e=>e.promotions.length>0).map(e=>n().tz(e.start_date_time_utc,t).format("YYYY-MM-DD")),u=l?e.filter(e=>e.available_slots&&e.available_slots>0&&e.available_slots<=l).map(e=>n().tz(e.start_date_time_utc,t).format("YYYY-MM-DD")):[];for(let e of c)s[e]={status:"fully_booked",hasPromo:!1,isLimitedAvailability:!1};for(let e of d)s[e]={status:"request",hasPromo:!1,isLimitedAvailability:!1};for(let e of o)s[e]={status:"instant",hasPromo:!1,isLimitedAvailability:!1};for(let e of _)e in s||(s[e]={status:"closed",hasPromo:!1,isLimitedAvailability:!1});for(let e of m)s[e]=(0,i._)((0,a._)({},s[e]),{hasPromo:!0});for(let e of u)s[e]=(0,i._)((0,a._)({},s[e]),{isLimitedAvailability:!0});return s},u=e=>{let t=e.units||[];for(let e of t)if(e.guest_type&&(0,d.WS)(e.guest_type))return e.gross;return t.length>0?t[0].gross:""},h=(e,t)=>{let l={};for(let a of e){let e=n().tz(a.start_date_time_utc,t).format("YYYY-MM-DD"),i=u(a);(!(e in l)||(0,d.CY)(l[e])>(0,d.CY)(i))&&(l[e]=i)}return l},g=e=>Object.values(e).some(e=>e.isLimitedAvailability&&("instant"===e.status||"request"===e.status)),p=e=>Object.values(e).some(e=>e.hasPromo&&("instant"===e.status||"request"===e.status)),w=e=>Object.values(e).some(e=>"fully_booked"===e.status)},53344:(e,t,l)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/embed/[apiKey]/productGroupCalendar",function(){return l(87968)}])},58568:(e,t,l)=>{"use strict";l.d(t,{l:()=>i});var a=l(37876);let i=()=>(0,a.jsxs)("svg",{className:"ic_instant",id:"レイヤー_1","data-name":"レイヤー 1",xmlns:"http://www.w3.org/2000/svg",width:"32",height:"32",viewBox:"0 0 32 32",children:[(0,a.jsx)("title",{children:"ic_ok"}),(0,a.jsx)("path",{d:"M32,16A16,16,0,1,1,16,0,16,16,0,0,1,32,16ZM16,4A12,12,0,1,0,28,16,12,12,0,0,0,16,4Z",fill:"#0094cc"})]})},76735:(e,t,l)=>{"use strict";l.d(t,{J:()=>n});var a=l(41946),i=l.n(a),s=l(14232);let n=()=>{let e=s.createRef(),[t,l]=s.useState({left:0,right:0,top:0,bottom:0,height:0,width:0});return s.useLayoutEffect(()=>{if(e.current){let{left:a,right:s,top:n,bottom:d,width:r,height:o}=e.current.getBoundingClientRect();i()({left:a,right:s,top:n,bottom:d,height:o,width:r},t)||l({left:a,right:s,top:n,bottom:d,height:o,width:r})}},[e,t]),[e,t]}},80428:(e,t,l)=>{"use strict";l.d(t,{j:()=>i});var a=l(37876);let i=()=>(0,a.jsxs)("svg",{className:"ic_request",id:"レイヤー_1","data-name":"レイヤー 1",xmlns:"http://www.w3.org/2000/svg",width:"32",height:"32",viewBox:"0 0 32 32",children:[(0,a.jsx)("title",{children:"ic_request"}),(0,a.jsx)("rect",{width:"32",height:"32",fill:"none"}),(0,a.jsx)("path",{d:"M16.87,2.51l15,26A1,1,0,0,1,31,30H1a1,1,0,0,1-.86-1.5l15-26A1,1,0,0,1,16.87,2.51Zm-1.3,9-7.52,13a.5.5,0,0,0,.43.75h15a.5.5,0,0,0,.43-.75l-7.52-13A.49.49,0,0,0,15.57,11.54Z",fill:"#fc0"})]})},83191:(e,t,l)=>{"use strict";l.d(t,{j:()=>n});var a=l(33035),i=l(44679),s=l(31102);let n=e=>{let t=(0,a.l)(),l=(0,i.D)(e);return(0,s.m)(l,t)}},85698:(e,t,l)=>{"use strict";l.d(t,{f:()=>i,s:()=>a});let a=(e,t)=>{let l=i(e,t);return Object.keys(l).map(e=>"".concat(e,"=").concat(encodeURIComponent(l[e]))).join("&")},i=(e,t)=>{let l={};return Object.keys(e).forEach(t=>{["primary","secondary","bg","sh","thm","hbg","fbg","cbg","defCol"].includes(t)?l[t]=e[t]:t.startsWith("utm")&&(l[t]=e[t])}),l.lng=t,l}},87968:(e,t,l)=>{"use strict";l.r(t),l.d(t,{__N_SSP:()=>E,default:()=>q});var a=l(37876),i=l(5031),s=l.n(i),n=l(14232),d=l(89099),r=l(7223),o=l(93174),_=l(81585),c=l(2171),m=l(49995),u=l(26167),h=l(6995),g=l(1479),p=l.n(g),w=l(39660),x=l(46354),v=l(51436),j=l(38478),f=l(80428),y=l(58568);let b=e=>{let{loading:t,month:l,attrByDateMap:i,onPrevMonthClick:s,onNextMonthClick:n,onDateClick:d}=e,{i18n:r,t:o}=(0,_.B)(),c=r.language,m=(0,v.LS)(l);return(0,a.jsxs)("div",{className:"widget-multi-calendar__month",children:[t&&(0,a.jsx)(x.A,{sx:{position:"absolute",top:"50%",left:"50%",marginTop:"-20px",marginLeft:"-20px"}}),(0,a.jsxs)("div",{className:"widget-multi-calendar__month__nav",children:[(0,a.jsx)("p",{className:"widget-multi-calendar__month__nav__title",children:p()(l).locale(c).format((0,j.lg)(c))}),s&&(0,a.jsx)("button",{disabled:(0,v.wn)(l),className:"widget-multi-calendar__month__nav__button prev",onClick:s}),n&&(0,a.jsx)("button",{className:"widget-multi-calendar__month__nav__button next",onClick:n})]}),(0,a.jsxs)("ul",{className:"widget-multi-calendar__month__title",children:[(0,a.jsx)("li",{children:o("Sun")}),(0,a.jsx)("li",{children:o("Mon")}),(0,a.jsx)("li",{children:o("Tue")}),(0,a.jsx)("li",{children:o("Wed")}),(0,a.jsx)("li",{children:o("Thu")}),(0,a.jsx)("li",{children:o("Fri")}),(0,a.jsx)("li",{children:o("Sat")})]}),m.map((e,t)=>(0,a.jsx)("ul",{className:"widget-multi-calendar__month__week",children:e.days.map(e=>{var t,s;if(!(0,v.rU)(l,e))return(0,a.jsx)("li",{className:"blank"},e);let n=null==i||null==(t=i[e])?void 0:t.status,r=null==i||null==(s=i[e])?void 0:s.hasPromo;return n?"request"===n?(0,a.jsxs)("li",{className:"request",onClick:()=>d(e),children:[(0,a.jsx)("p",{className:"widget-multi-calendar__month__week__date",children:p()(e).format("D")}),(0,a.jsx)("p",{className:"widget-multi-calendar__month__week__ic",children:(0,a.jsx)(f.j,{})}),r&&(0,a.jsx)("p",{className:"widget-multi-calendar__month__week__promo",children:(0,a.jsx)("img",{src:"/static/images/ic_promo.svg"})})]},e):"instant"===n?(0,a.jsxs)("li",{className:"instant",onClick:()=>d(e),children:[(0,a.jsx)("p",{className:"widget-multi-calendar__month__week__date",children:p()(e).format("D")}),(0,a.jsx)("p",{className:"widget-multi-calendar__month__week__ic",children:(0,a.jsx)(y.l,{})}),r&&(0,a.jsx)("p",{className:"widget-multi-calendar__month__week__promo",children:(0,a.jsx)("img",{src:"/static/images/ic_promo.svg"})})]},e):"fully_booked"===n?(0,a.jsxs)("li",{children:[(0,a.jsx)("p",{className:"widget-multi-calendar__month__week__date",children:p()(e).format("D")}),(0,a.jsx)("p",{className:"widget-multi-calendar__month__week__ic",children:(0,a.jsx)("img",{src:"/static/images/ic_fullybooked.svg",alt:"closed"})}),(0,a.jsx)("p",{className:"widget-multi-calendar__month__week__price"})]},e):(0,a.jsxs)("li",{children:[(0,a.jsx)("p",{className:"widget-multi-calendar__month__week__date",children:p()(e).format("D")}),(0,a.jsx)("p",{className:"widget-multi-calendar__month__week__ic",children:(0,a.jsx)("img",{src:"/static/images/ic_ng.svg",alt:"closed"})}),(0,a.jsx)("p",{className:"widget-multi-calendar__month__week__price"})]},e):(0,a.jsx)("li",{className:"past",children:(0,a.jsx)("p",{className:"widget-multi-calendar__month__week__date",children:p()(e).format("D")})},e)})},t)),4===m.length&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("ul",{className:"widget-multi-calendar__month__week"}),(0,a.jsx)("ul",{className:"widget-multi-calendar__month__week"})]}),5===m.length&&(0,a.jsx)("ul",{className:"widget-multi-calendar__month__week"})]})},Y=e=>{let{onDateClick:t,productGroup:l}=e,{i18n:i}=(0,_.B)(),{apiKey:s}=n.useContext(r.P),d=(0,c.wA)(),o=i.language,m=(0,c.d4)(e=>e.productInstances.loading),u=(0,c.d4)(e=>e.server.productSummaries.all),g=(0,c.d4)(e=>e.productInstances.productGroup),x=u.filter(e=>{var t;return null==l||null==(t=l.product_ids)?void 0:t.includes(e.id)}),[j,f]=n.useState(p()().format("YYYY-MM-DD")),[y,Y]=n.useState(p()(j).date(1)),[N,k]=n.useState(p()(j).endOf("month").add(1,"day")),M=(0,h.A)("(max-width: 600px)")?1:2;n.useEffect(()=>{var e;let t=null!=(e=null==l?void 0:l.product_ids)?e:[],a=p()(j).date(1),i=p()(j).endOf("month").add(1,"day");2===M&&(i=i.endOf("month").add(1,"day")),Y(a),k(i),0!==t.length&&d((0,w.rl)(s,t,a.format("YYYY-MM-DD"),i.format("YYYY-MM-DD"),o))},[s,o,j,l,M]);let D=()=>{let e=p()(j).endOf("month").add(1,"day");2===M&&(e=e.endOf("month").add(1,"day")),f(e.format("YYYY-MM-DD"))},C=g?null==g?void 0:g.map(e=>{var t,l;let a=(null==(t=x.find(t=>
1t.id===e.product_id))?void 0:t.start_timezone)||"";return(0,v.DF)(null!=(l=e.product_instances)?l:[],a,0)}):[],O={};for(let e=y.clone();e.isBefore(N);e.add(1,"days")){let t=e.format("YYYY-MM-DD");if(O[t]={status:"closed",hasPromo:!1},null==C?void 0:C.some(e=>{var l;return(null==(l=e[t])?void 0:l.status)==="instant"})){O[t].status="instant",(null==C?void 0:C.some(e=>{var l,a;return(null==(l=e[t])?void 0:l.status)==="instant"&&(null==(a=e[t])?void 0:a.hasPromo)}))&&(O[t].hasPromo=!0);continue}if(null==C?void 0:C.some(e=>{var l;return(null==(l=e[t])?void 0:l.status)==="request"})){O[t].status="request",(null==C?void 0:C.some(e=>{var l,a;return(null==(l=e[t])?void 0:l.status)==="request"&&(null==(a=e[t])?void 0:a.hasPromo)}))&&(O[t].hasPromo=!0);continue}if(null==C?void 0:C.every(e=>{var l;return(null==(l=e[t])?void 0:l.status)==="fully_booked"})){O[t].status="fully_booked";continue}}return(0,a.jsx)(a.Fragment,{children:(0,a.jsxs)("div",{className:"widget-multi-calendar__body__main",children:[(0,a.jsx)(b,{month:j,loading:m,attrByDateMap:(null==g?void 0:g.length)!=0?O:{},onPrevMonthClick:()=>{let e=p()(j).startOf("month").subtract(1,"day");2===M&&(e=e.startOf("month").subtract(1,"day")),f(e.format("YYYY-MM-DD"))},onNextMonthClick:1===M?D:void 0,onDateClick:t}),2===M&&(0,a.jsx)(b,{loading:m,month:p()(j).endOf("month").add(1,"day").format("YYYY-MM-DD"),attrByDateMap:(null==g?void 0:g.length)!=0?O:{},onNextMonthClick:D,onDateClick:t})]})})};var N=l(76735),k=l(83191),M=l(8923),D=l.n(M);let C=e=>{window.parent.postMessage({type:"HEIGHT_CHANGED",height:e},"*")},O=e=>{window.parent.postMessage({type:"OPEN_GUEST_SELECT_MODAL",url:e},"*")},P=()=>{var e,t;let{t:l}=(0,_.B)(),i=(0,c.d4)(e=>e.server.productSummaries.all),s=(0,c.d4)(e=>e.server.settings.all),r=(0,c.d4)(e=>e.productInstances.productGroup),o=s.booking_widget_calendar_product_groups,h=(0,d.useRouter)(),[g,p]=n.useState(""),[w,x]=n.useState(!1),[j,b]=n.useState(null!=(e=null==o?void 0:o[0])?e:{}),[M,P]=(0,N.J)();n.useEffect(()=>{var e;b(null!=(e=null==o?void 0:o[0])?e:{})},[o]),n.useEffect(()=>{C(P.height)},[P.height]);let S=i.filter(e=>{var t;return null==j||null==(t=j.product_ids)?void 0:t.includes(e.id)}),A=!!(null==h?void 0:h.query.isModal),E=null==r?void 0:r.map(e=>{var t,l,a;return(0,v.DF)(null!=(l=null==e?void 0:e.product_instances)?l:[],null!=(a=null==(t=S.find(t=>t.id===e.product_id))?void 0:t.start_timezone)?a:"",0)}),q=(0,k.j)("/productSelect");if(0===i.length)return null;let B=()=>{window.parent.postMessage({type:"CLOSE_MODAL"},"*")},L=!!S.some(e=>{var t,l;return(null==e||null==(t=e.booking_widget_settings)?void 0:t.is_visible)&&!(null==e||null==(l=e.booking_widget_settings)?void 0:l.is_view_only)}),F=null==E?void 0:E.some(e=>(0,v.Nk)(e)),G=null==E?void 0:E.some(e=>(0,v.ai)(e));return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("div",{className:"widget-multi-calendar--frame",children:(0,a.jsxs)("div",{ref:M,className:"widget-multi-calendar",children:[w&&(0,a.jsx)("div",{className:D().dimmer}),(0,a.jsxs)("div",{className:"widget-multi-calendar__header",children:[l("Make a booking"),A&&(0,a.jsx)("p",{className:"widget-multi-calendar__header__close",onClick:()=>{window.location!==window.parent.location?B():h.back()},children:(0,a.jsx)("span",{})})]}),(0,a.jsxs)("div",{className:"widget-multi-calendar__body",children:[(0,a.jsxs)("div",{className:"widget-multi-calendar__body__tour",children:[(0,a.jsx)("p",{className:"widget-multi-calendar__body__tour__title",children:l("Select Plan Type")}),(0,a.jsx)("label",{className:"widget-multi-calendar__body__tour__select",children:(0,a.jsx)("select",{className:"widget-multi-calendar__body__tour__select__item",value:null!=(t=null==j?void 0:j.product_group_name)?t:"",onChange:e=>{var t;return b(null!=(t=null==o?void 0:o.find(t=>t.product_group_name===e.target.value))?t:{})},children:null==o?void 0:o.map((e,t)=>(0,a.jsx)("option",{value:null==e?void 0:e.product_group_name,children:null==e?void 0:e.product_group_name},t))})})]}),!L&&(0,a.jsx)("div",{className:"widget-multi-calendar__body__tour",style:{borderBottom:"none",backgroundColor:"white"},children:(0,a.jsx)("p",{className:"widget-multi-calendar__body__tour__title",style:{color:"red"},children:l("Sorry, this product is currently not available.")})}),L&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(Y,{productGroup:j,onDateClick:e=>{var t,l;let a="/embed".concat(q);a=a.includes("?")?"".concat(a,"&date=").concat(e,"&productGroup=").concat(null!=(t=null==j?void 0:j.product_group_name)?t:""):"".concat(a,"?date=").concat(e,"&productGroup=").concat(null!=(l=null==j?void 0:j.product_group_name)?l:"");let i=window.location!==window.parent.location;A?(p(e),x(!0)):i?O("".concat(window.location.origin).concat(a)):h.replace(a)}}),(0,a.jsxs)("ul",{className:"widget-multi-calendar__body__comment",children:[(0,a.jsxs)("li",{className:"widget-multi-calendar__body__comment__item",children:[(0,a.jsx)("p",{className:"widget-multi-calendar__body__comment__item__ic",children:(0,a.jsx)(y.l,{})}),(0,a.jsxs)("p",{className:"widget-multi-calendar__body__comment__item__name",children:[" ",": ",l("Instant")]}),(0,a.jsx)("p",{className:"widget-multi-calendar__body__comment__item__hatena",children:"?"}),(0,a.jsx)("p",{className:"widget-multi-calendar__body__comment__item__info",children:l("Instant bookings will be confirmed automatically within seconds of submission")})]}),(0,a.jsxs)("li",{className:"widget-multi-calendar__body__comment__item",children:[(0,a.jsx)("p",{className:"widget-multi-calendar__body__comment__item__ic",children:(0,a.jsx)(f.j,{})}),(0,a.jsxs)("p",{className:"widget-multi-calendar__body__comment__item__name",children:[" ",": ",l("Request")]}),(0,a.jsx)("p",{className:"widget-multi-calendar__body__comment__item__hatena",children:"?"}),(0,a.jsx)("p",{className:"widget-multi-calendar__body__comment__item__info",children:l("Request-only bookings require explicit confirmation from supplier")})]}),G&&(0,a.jsxs)("li",{className:"widget-multi-calendar__body__comment__item",children:[(0,a.jsx)("p",{className:"widget-multi-calendar__body__comment__item__ic",children:(0,a.jsx)("img",{src:"/static/images/ic_fullybooked.svg",alt:"closed"})}),(0,a.jsxs)("p",{className:"widget-multi-calendar__body__comment__item__name",children:[" ",": ",l("Fully Booked")]})]}),F&&(0,a.jsxs)("li",{className:"widget-multi-calendar__body__comment__item",children:[(0,a.jsx)("p",{className:(0,m.A)("widget-multi-calendar__body__comment__item__ic","promo"),children:(0,a.jsx)("img",{src:"/static/images/ic_promo.svg"})}),(0,a.jsxs)("p",{className:"widget-multi-calendar__body__comment__item__name",children:[" ",": ",l("Campaign")]}),(0,a.jsx)("p",{className:"widget-multi-calendar__body__comment__item__hatena",children:"?"}),(0,a.jsx)("p",{className:"widget-multi-calendar__body__comment__item__info",children:l("One or more campaigns apply to bookings on this date")})]}),(0,a.jsxs)("li",{className:"widget-multi-calendar__body__comment__item",children:[(0,a.jsx)("p",{className:"widget-multi-calendar__body__comment__item__ic",children:(0,a.jsx)("img",{src:"/static/images/ic_ng.svg",alt:"closed"})}),(0,a.jsxs)("p",{className:"widget-multi-calendar__body__comment__item__name",children:[" ",": ",l("Closed")]})]})]})]})]})]})}),w&&(0,a.jsx)(u.s,{productGroup:null!=j?j:null,date:g,onClose:()=>x(!1)})]})},S=()=>(0,a.jsx)(P,{});var A=l(31636),E=!0;let q=(0,A.d)()(()=>{let e=(0,d.useRouter)().query.apiKey;return(0,a.jsx)(r.P.Provider,{value:{apiKey:e,useApiKeyInPaths:!0},children:(0,a.jsxs)(o.F,{children:[(0,a.jsx)(s(),{id:"4703b59e0127d17d",children:"body{background-color:transparent!important}"}),(0,a.jsx)(S,{})]})})})}},e=>{var t=t=>e(e.s=t);e.O(0,[1231,1514,3336,3043,2639,6092,8176,1014,479,2551,4213,8548,636,6593,8792],()=>t(53344)),_N_E=e.O()}]);
2//# sourceMappingURL=productGroupCalendar-be6b0fe51467b3fe.js.map

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.