1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7385],{63759:function(e,i,t){(window.__NEXT_P=window.__NEXT_P||[]).push(["/booking/org-booking/[id]",function(){return t(57957)}])},98009:function(e,i,t){"use strict";t.r(i),i.default={src:"/_next/static/media/error-illustration.49dc1336.png",height:512,width:512,blurDataURL:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAAICAMAAADz0U65AAAASFBMVEXDZinsm5Lfzbzw///UoX/Hdj7fioLeybfhwarNbDLW1NO7iFWRpqe0ln3RhFHnUD/mTj7ZtJvG2d7V5OrQ9OnlvLnvwsDv8e4SkLgyAAAAEXRSTlM0/f399in+/P01/g/XiGr+/m7ihGkAAAAJcEhZcwAADsQAAA7EAZUrDhsAAABASURBVHicFchHEsAgDASwpdr02LT//zSDjkLprdbWC8A358sAyBnjCIA94zv2zY5xv2HVuTgh0dS5KCF4EREfflZbAoaAx4xeAAAAAElFTkSuQmCC",blurWidth:8,blurHeight:8}},15507:function(e,i,t){"use strict";t.d(i,{Q:function(){return f}});var n=t(85893),o=t(3471),r=t(80801),d=t(84176),a=t(73634),l=t(66223),s=t(14374),c=t(33299),u=t(9008),g=t.n(u),v=t(11163),m=t(67294),h=t(88821);let p=t(32125).ZP.div.withConfig({componentId:"sc-7c75535e-0"})(["min-height:100vh;display:flex;flex-direction:column;justify-content:center;align-items:center;"]);function f(e,i){let t=e.displayName||e.name||"Component",u=i=>{let{data:t,status:u}=(0,c.useSession)(),f="loading"===u,y=(0,v.useRouter)(),k=(0,s.oR)(e=>e.activeBuyerOrgId),x=(0,s.oR)(e=>e.setActiveBuyerOrgId),{data:_}=(0,a._)(),A=(0,o.useQueryClient)(),b=(0,s.oR)(e=>e.setIsAppRedirect),{config:j,isLoading:I}=(0,l.l)();(0,m.useEffect)(()=>{y.asPath.includes("?app=true")&&b(!0)},[y.asPath]),(0,m.useEffect)(()=>{var e;!_&&!k&&(null==y?void 0:null===(e=y.query)||void 0===e?void 0:e.buyerOrgId)&&x(y.query.buyerOrgId)},[y.query.buyerOrgId]),(0,m.useEffect)(()=>{I||k||h.nx.includes(y.pathname)||null==t||!t.accessToken||(null==j?void 0:j.org_id)||(console.log("Redirect to org picker"),r.kg.info("No buyer org set, redirecting to org picker page"),y.push(h.yy.organisation.picker))},[k,y.pathname,null==t?void 0:t.accessToken,j,I]),(0,m.useEffect)(()=>{t||f||(0,c.signIn)()},[f,t]);let[w,S]=(0,m.useState)(!1),C=!!t&&(!!_||h.nx.includes(y.pathname));(0,m.useEffect)(()=>{if(C||!t&&!f){S(!1);return}let e=setTimeout(()=>{r.kg.error("Auth gate stalled: session or buyer org never resolved"),S(!0)},8e3);return()=>clearTimeout(e)},[C,t,f]);let H=(0,m.useCallback)(()=>{S(!1),o.onlineManager.setOnline(!0),A.refetchQueries()},[A]),O=(0,n.jsx)(g(),{children:(0,n.jsx)("meta",{name:"robots",content:"noindex, nofollow"})});return C?(0,n.jsxs)(n.Fragment,{children:[O,(0,n.jsx)(e,{...i})]}):w?(0,n.jsxs)(n.Fragment,{children:[O,(0,n.jsxs)(p,{children:[(0,n.jsx)(d.WG,{textAlign:"center",fontSize:5,children:"Having trouble connecting"}),(0,n.jsx)(d.WG,{textAlign:"center",verticalSpacing:3,children:"We couldn't reach Agora. Check your connection and try again."}),(0,n.jsx)(d.zx,{onClick:H,children:"Try again"})]})]}):(0,n.jsxs)(n.Fragment,{children:[O,(0,n.jsxs)(p,{children:[(0,n.jsx)(d.WG,{textAlign:"center",fontSize:5,children:"Authenticating"}),(0,n.jsx)(d.nt,{size:5})]})]})};return u.displayName="withAuth(".concat(t,")"),u.overrideHeaderContent=null==i?void 0:i.overrideHeaderContent,u.hideNav=!!(null==i?void 0:i.hideNav),u.hideHeader=!!(null==i?void 0:i.hideHeader),u.hideHomeLink=!!(null==i?void 0:i.hideHomeLink),u.marketplace=!!(null==i?void 0:i.marketplace),u.app=!!(null==i?void 0:i.app),u}},450:function(e,i,t){"use strict";t.d(i,{c:function(){return l}});var n=t(3471),o=t(86881),r=t(14374),d=t(88821),a=t(41511);function l(){let{orgId:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=(0,a.j)(),t=(0,r.oR)(e=>e.activeBuyerOrgId),l=e||t;return(0,n.useQuery)([d.U7.bookingsConfig,l],()=>new o.S().bookingsApi.orgBookingConfigRetrieve({buyerOrgId:l||""}),{select:e=>e.data,enabled:i&&!!l,keepPreviousData:!0})}},57957:function(e,i,t){"use strict";t.r(i),t.d(i,{default:function(){return P}});var n=t(85893),o=t(52124),r=t(84176),d=t(87912),a=t(32125),l=t(82493),s=t(28814),c=t(11163),u=t(5957),g=t(25675),v=t.n(g),m=t(54104),h=t(67294),p=t(3471),f=t(86881),y=t(14374),k=t(88821),x=t(41511);function _(e,i){let t=(0,x.j)(),n=(0,y.oR)(e=>e.activeBuyerOrgId);return(0,p.useQuery)([k.U7.bookingHistory,e,i],()=>new f.S().BookingHistoryApi.orgBookingHistoryRetrieve({bookingId:e||"",buyerOrgId:n||"",historyId:i||""}),{select:e=>e.data,enabled:t&&!!n&&!!e&&!!i})}var A=t(82287),b=t(15507),j=t(34381),I=t(450);let w=a.ZP.div.withConfig({componentId:"sc-e4f3d970-0"})(["@media print{display:none;}"]),S=a.ZP.div.withConfig({componentId:"sc-e4f3d970-1"})(["display:flex;flex-direction:column;padding:","px;background-color:",";border-radius:20px;@media print{margin:0;padding:0;}"],e=>{let{isMobile:i}=e;return i?30:60},d._.colors.lightGray),C=a.ZP.div.withConfig({componentId:"sc-e4f3d970-2"})(["margin:60px 80px;@media screen and (max-width:","){margin:40px 10px;}@media print{margin:0;padding:0;}"],l.A.small),H=a.ZP.div.withConfig({componentId:"sc-e4f3d970-3"})(["display:flex;align-items:center;",""],e=>{let{stackOnSmall:i}=e;return i&&(0,a.iv)(["flex-direction:column;"])}),O=a.ZP.div.withConfig({componentId:"sc-e4f3d970-4"})(["width:100%;display:flex;justify-content:center;padding:"," 0;gap:",";flex-wrap:wrap;",""],d._.space[2],d._.space[1],w),N=a.ZP.div.withConfig({componentId:"sc-e4f3d970-5"})(["margin:0 auto;margin-top:",";display:flex;align-items:flex-start;object-fit:contain;@media screen and (max-width:","){max-width:300px;}> img{border-radius:6px;width:100%;
1@media print{max-width:200px;height:auto;}}"],e=>e.hasTopMargin?d._.space[2]:"",l.A.medium),E=(0,a.ZP)(r.X6).withConfig({componentId:"sc-e4f3d970-6"})(["font-weight:",";font-size:",";width:",";text-align:",";"],d._.fontWeights.semiBold,d._.fontSizes["6"],e=>{let{isMobile:i}=e;return i?"inherit":"100%"},e=>{let{isMobile:i}=e;return i?"inherit":"center"}),R=(0,a.ZP)(r.zx).withConfig({componentId:"sc-e4f3d970-7"})(["margin:20px 80px 0;color:black;background:none;&:hover{color:black;background:none;}@media screen and (max-width:","){margin:20px;}"],l.A.medium),B=(0,a.ZP)(r.zx).withConfig({componentId:"sc-e4f3d970-8"})(["@media print{display:none;}"]),L=(0,a.ZP)(r.kC).withConfig({componentId:"sc-e4f3d970-9"})(["margin-top:",";padding:"," 80px;background-color:",";"],d._.space[5],d._.space[2],e=>{let{$backgroundColor:i}=e;return i&&d._.colors[i]});var P=(0,b.Q)(()=>{var e;let i=(0,s.Z)("(max-width: ".concat(l.A.medium,")"),!1),a=(0,c.useRouter)(),{id:g,historyId:p,previousHistoryId:f}=a.query,[y,k]=(0,h.useState)(),[x,b]=(0,h.useState)(),[w,P]=(0,h.useState)(),{data:Z}=(0,j.a)(),{data:z,isLoading:W}=(0,I.c)(),{data:T,isLoading:M,error:D}=_(g||"",p||""),{data:G,isLoading:J,error:U}=_(g||"",f||"");(0,h.useEffect)(()=>{T&&(k(T),b(Object.entries(T.data).map(e=>{let[i,t]=e;return{key:i,value:t}})))},[T]),(0,h.useEffect)(()=>{G&&P(Object.entries(G.data).map(e=>{let[i,t]=e;return{key:i,value:t}}))},[T]);let F=e=>{var i,t;let n=null===(i=JSON.parse(localStorage.getItem("booking-data")))||void 0===i?void 0:i.find(i=>i.id===e.id),o={...n,readHistory:[...n.readHistory,{readHistoryId:null==e?void 0:null===(t=e.history)||void 0===t?void 0:t.id,readTime:Date.now()}]},r=JSON.parse(localStorage.getItem("booking-data")).map(i=>e.id===i.id?o:i);localStorage.setItem("booking-data",JSON.stringify(r)),a.back()},Q=e=>{var i;let t=null===(i=JSON.parse(localStorage.getItem("booking-data")))||void 0===i?void 0:i.find(i=>i.id===e.id),n=null==t?void 0:t.readHistory;n.pop();let o={...t,readHistory:n},r=JSON.parse(localStorage.getItem("booking-data")).map(i=>e.id===i.id?o:i);localStorage.setItem("booking-data",JSON.stringify(r)),a.back()},V=(e,i)=>{var t;let n=null===(t=JSON.parse(localStorage.getItem("booking-data")))||void 0===t?void 0:t.find(i=>(null==i?void 0:i.id)===(null==e?void 0:e.id));return i===(null==n?void 0:n.lastEditedUserId)},X=e=>{var i,t,n;let o=null===(i=JSON.parse(localStorage.getItem("booking-data")))||void 0===i?void 0:i.find(i=>i.id===(null==e?void 0:e.id)),r=!!(null==o?void 0:null===(t=o.readHistory)||void 0===t?void 0:t.length)&&(null==o?void 0:o.readHistory[(null==o?void 0:null===(n=o.readHistory)||void 0===n?void 0:n.length)-1]);return(null==o?void 0:o.latestId)===(null==r?void 0:r.readHistoryId)?null==r?void 0:r.readTime:null},q=(0,h.useMemo)(()=>{var e,i;let t=JSON.parse(localStorage.getItem("booking-data")).find(e=>(null==e?void 0:e.id)===(null==T?void 0:T.id));return!!(null==t?void 0:null===(e=t.readHistory)||void 0===e?void 0:e.length)&&(null==t?void 0:null===(i=t.readHistory)||void 0===i?void 0:i.pop().readHistoryId)===(null==t?void 0:t.latestId)||(null==Z?void 0:Z.user_id)===(null==t?void 0:t.lastEditedUserId)},[JSON.parse(localStorage.getItem("booking-data"))]);return!y&&D?(0,n.jsxs)(r.kC,{gap:0,direction:"column",alignItems:"center",justifyContent:"center",children:[(0,n.jsx)(v(),{src:t(98009),width:80,height:80,alt:"error-illustration"}),(0,n.jsxs)(r.kC,{direction:"column",alignItems:"center",justifyContent:"center",children:[(0,n.jsx)(r.WG,{fontSize:2,textAlign:"center",children:"We caught an unexpected error while processing you request."}),(0,n.jsx)(r.WG,{textAlign:"center",children:"Please try again later."})]})]}):(0,n.jsx)(o.A,{meta:{title:"Booking"},children:!y&&M?(0,n.jsx)(r.nt,{floating:!0}):(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(R,{size:"small",iconLeft:"LeftArrowIcon",onClick:()=>{a.back()},children:"Back"}),q&&(0,n.jsx)(L,{alignItems:"center",gap:0,stackOnSmall:!0,$backgroundColor:"highlightBar",children:(0,n.jsx)(r.WG,{fontWeight:"semiBold",fontSize:1,style:{marginLeft:d._.space[0]},maxWidth:"max-content",color:"black",children:V(T,null==Z?void 0:Z.user_id
1)?"Last edited by you":"Read -\n ".concat(!!X(T)&&(e=>{if(e)return(0,u.Z)(e,"eee, d MMM HH:mm a")})(new Date(X(T))))})}),(0,n.jsxs)(C,{children:[(0,n.jsxs)(S,{isMobile:i,children:[(0,n.jsx)(N,{hasTopMargin:!1}),(0,n.jsx)(H,{style:{padding:"".concat(d._.space[2]," 0 ").concat(d._.space[4]," 0"),justifyContent:"center"},stackOnSmall:!0,children:(0,n.jsx)(E,{level:"h1",style:{fontWeight:d._.fontWeights.semiBold},children:"Booking details"})}),y?(0,n.jsx)(n.Fragment,{children:null===(e=x.filter(e=>(null==e?void 0:e.key)!=="_id"&&(null==e?void 0:e.key)!=="_count_total"&&(null==e?void 0:e.key)!=="_count_incoming"&&(null==e?void 0:e.key)!=="_count_outgoing"&&!(null==e?void 0:e.key.includes("__"))&&(null==e?void 0:e.key)!=="_date"&&(null==e?void 0:e.key)!=="_date_from"&&(null==e?void 0:e.key)!=="_date_to"&&(null==e?void 0:e.key)!=="_date_delivery_from"&&(null==e?void 0:e.key)!=="_date_delivery_to"&&(null==e?void 0:e.key)!=="_date_kill_from"&&(null==e?void 0:e.key)!=="_date_kill_to"&&(null==e?void 0:e.key)!=="_date_transport_from"&&(null==e?void 0:e.key)!=="_date_transport_to"))||void 0===e?void 0:e.map((e,t)=>("_date_delivery"===e.key&&(e.key=null==z?void 0:z.settings.date_delivery_name),"_date_kill"===e.key&&(e.key=null==z?void 0:z.settings.date_kill_name),"_date_transport"===e.key&&(e.key=null==z?void 0:z.settings.date_transport_name),(0,n.jsx)(m.G0,{isMobile:i,label:e.key,hasValueChanged:(0,A.aR)(e.key,w,x),previousRow:w,historyValue:(0,A.g9)(e.key,w),currentValue:e.value},"".concat(e.key,"_").concat(t))))}):(0,n.jsx)(r.nt,{})]}),(0,n.jsx)(O,{children:(0,n.jsx)(B,{variant:q?"tertiaryOutlined":"primary",onClick:()=>q?Q(T):F(T),disabled:!T||V(T,null==Z?void 0:Z.user_id),children:q?"Mark as unread":"Mark as read"})})]})]})})},{hideNav:!0,overrideHeaderContent:!0,hideHomeLink:!1})}},function(e){e.O(0,[7258,5675,4232,4104,2888,9774,179],function(){return e(e.s=63759)}),_N_E=e.O()}]); 2//# sourceMappingURL=[id]-69eadfbf9b62ad0d.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.