PageSourceSearch

https://www.spacez.co/_next/static/chunks/4179.d9044a38bfc5bc7d.js

js spacez.co collected 2026-09-24 13:10:56 UTC 22,378 bytes, 5 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4179],{4179:(e,t,n)=>{n.r(t),n.d(t,{default:()=>N});var a=n(95155),r=n(12115),o=n(52619),i=n.n(o),l=n(30557),s=n(61116),c=n(15296),d=n(47703),u=n(63470),m=n(70579),f=n(16990),p=n(92038),x=n(11943),h=n(32227);function g(e){let t=(e.bookingStatus||"").toLowerCase();return"cancelled"===t||"canceled"===t||"no_show"===t}n(41688);var v=n(19021),y=n(44195);let b={kind:"all"},k={kind:"cancelled"};function N(){var e,t,n,o,i,s;let{stats:d,loading:x,error:g,reload:v}=(0,u.fk)(),[y,N]=(0,r.useState)(!1),[j,w]=(0,r.useState)(b),T=null!=(e=null==d?void 0:d.bookedTodayList)?e:[],C=null!=(t=null==d?void 0:d.bookedTodayCount)?t:0,S=null!=(n=null==d?void 0:d.bookedTodayValue)?n:0,I=null!=(o=null==d?void 0:d.bookedTodayBySource)?o:{},D=null!=(i=null==d?void 0:d.bookedTodayCancelledCount)?i:0,U=null!=(s=null==d?void 0:d.bookedTodayCancelledValue)?s:0,P=(0,r.useMemo)(()=>Object.entries(I).sort((e,t)=>t[1]-e[1]),[I]),O=C>0||D>0,F=e=>{w(e),N(!0)};return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(c.r,{title:"Bookings taken today",icon:(0,a.jsx)(l.Icon,{name:"calendar-check"}),loading:x&&!d,error:!!g&&!d,onRetry:v,empty:!!d&&!O,emptyText:"No bookings taken today yet",headerRight:d?(0,a.jsxs)("button",{type:"button",onClick:()=>F(b),className:"inline-flex flex-shrink-0 items-center gap-0.5 font-lexendDeca text-[12px] font-medium text-semantic_text_brand transition-opacity hover:opacity-80",children:[O?"View list":"View days",(0,a.jsx)(l.Icon,{name:"arrow-right",className:"h-3 w-3"})]}):void 0,children:O&&(0,a.jsxs)("div",{className:"flex h-full flex-col",children:[(0,a.jsxs)("div",{className:"mb-3",children:[(0,a.jsxs)("button",{type:"button",onClick:()=>F(b),className:"flex w-full items-baseline justify-between gap-2 rounded-[8px] px-1 py-1 text-left transition-colors hover:bg-semantic_background_hovered active:bg-semantic_background_hovered",children:[(0,a.jsxs)("span",{className:"flex items-baseline gap-1.5",children:[(0,a.jsx)("span",{className:"font-figtree text-[26px] font-bold leading-none tabular-nums text-semantic_text_prominent",children:C}),(0,a.jsx)("span",{className:"font-lexendDeca text-[12px] text-semantic_text_secondary",children:1===C?"booking":"bookings"})]}),S>0&&(0,a.jsxs)("span",{className:"font-lexendDeca text-[12px] text-semantic_text_secondary",children:[(0,a.jsx)("span",{className:"font-figtree font-bold tabular-nums text-semantic_text_brand",children:(0,p.vv)(S)})," ","value"]})]}),D>0&&(0,a.jsxs)("button",{type:"button",onClick:()=>F(k),className:"mt-1.5 flex min-h-[44px] w-full items-center gap-1 rounded-[8px] px-1 py-2 text-left transition-colors hover:bg-semantic_background_hovered active:bg-semantic_background_hovered lg:min-h-0 lg:py-1",children:[(0,a.jsx)(l.Icon,{name:"x-circle",className:"h-3.5 w-3.5 flex-shrink-0 text-semantic_icon"}),(0,a.jsxs)("span",{className:"font-lexendDeca text-[12px] text-semantic_text_secondary",children:[(0,a.jsx)("span",{className:"font-figtree font-semibold tabular-nums",children:D})," ","cancelled / no-show",U>0?" \xb7 ".concat((0,p.vv)(U)):""]}),(0,a.jsx)(l.Icon,{name:"arrow-right",className:"ml-auto h-3.5 w-3.5 flex-shrink-0 text-semantic_icon opacity-40 lg:opacity-0"})]})]}),(0,a.jsx)(m.To,{items:P,getKey:e=>{let[t]=e;return t},mobileCap:5,desktopMaxClass:"max-h-[280px]",renderItem:e=>{let[t,n]=e,r=C?n/C*100:0,o=(0,f.fN)(t);return(0,a.jsxs)("button",{type:"button",onClick:()=>F({kind:"platform",platform:t}),className:"group relative flex w-full items-center gap-2.5 overflow-hidden rounded-[8px] px-2 py-2 text-left transition-colors hover:bg-semantic_background_hovered active:bg-semantic_background_hovered",children:[(0,a.jsx)("span",{"aria-hidden":!0,className:"absolute inset-y-0 left-0 rounded-[8px]",style:{width:"".concat(Math.max(r,2),"%"),backgroundColor:o.color,opacity:.1}}),(0,a.jsx)("span",{className:"relative z-[1]",children:(0,a.jsx)(f.XY,{source:t,size:24})}),(0,a.jsx)("span",{className:"relative z-[1] min-w-0 flex-1 truncate font-lexendDeca text-[13px] text-semantic_text",children:t}),(0,a.jsx)("span",{className:"relative z-[1] font-figtree text-[13px] font-semibold tabular-nums text-semantic_text",children:n}),(0,a.jsxs)("span",{className:"relative z-[1] w-9 text-right font-figtree text-[11px] tabular-nums text-semantic_text_secondary",children:[r<1?"<1":Math.round(r),"%"]}),(0,a.jsx)(l.Icon,{name:"arrow-right",className:"relative z-[1] h-3.5 w-3.5 flex-shrink-0 text-semantic_icon opacity-40 transition-opacity group-hover:opacity-60 lg:opacity-0"})]})}})]})}),(0,a.jsx)(_,{open:y,onOpenChange:N,filter:j,onFilter:w,today:{date:(0,h.Pj)(new Date),count:C,value:S,bySource:I,cancelledCount:D,cancelledValue:U,list:T}})]})}function _(e){let{open:t,onOpenChange:n,filter:o,onFilter:i,today:c}=e,m=(0,v.z)(),[x,h]=(0,r.useState)(c.date);(0,r.useEffect)(()=>{t&&h(c.date)},[t,c.date]);let y=x===c.date,N=(0,u.Ge)(y?null:x),{data:_,loading:S,error:I,reload:D}=(0,d.K)(N),U=y?c:(null==_?void 0:_.date)===x?_:null,P=(0,r.useMemo)(()=>{var e;return Object.entries(null!=(e=null==U?void 0:U.bySource)?e:{}).sort((e,t)=>
1t[1]-e[1])},[U]),O=(0,r.useMemo)(()=>{var e;let t=null!=(e=null==U?void 0:U.list)?e:[];if("cancelled"===o.kind)return t.filter(g);let n=t.filter(e=>!g(e));return"platform"===o.kind?n.filter(e=>e.platform===o.platform):n},[U,o]),F=e=>{i(b),h(t=>(function(e,t){let n=new Date("".concat(e,"T12:00:00Z"));return n.setUTCDate(n.getUTCDate()+t),n.toISOString().slice(0,10)})(t,e))},z=!y&&(null==_?void 0:_.date)!==x&&!I;return(0,a.jsxs)(s.Jh,{open:t,onOpenChange:n,title:"Bookings taken",description:"".concat(C(x)).concat(y?" \xb7 Today":"").concat(U?" — ".concat(U.count," ").concat(1===U.count?"booking":"bookings").concat(U.value>0?" \xb7 ".concat((0,p.vv)(U.value)):"").concat(U.cancelledCount>0?" \xb7 ".concat(U.cancelledCount," cancelled"):""):""),size:"lg",children:[(0,a.jsx)("div",{className:"sticky top-0 z-[1] -mx-1 mb-3 flex justify-end bg-semantic_surface_raised px-1 py-1",children:(0,a.jsxs)("div",{className:"inline-flex items-center rounded-[8px] border-[0.64px] border-semantic_border bg-transparent",children:[(0,a.jsx)(j,{icon:"chevron-left",label:"Previous day",onClick:()=>F(-1)}),(0,a.jsx)("span",{className:"grid h-9 min-w-[7.5rem] place-items-center px-2.5 font-lexendDeca text-[13px] font-semibold text-semantic_text",children:y?"Today":C(x)}),(0,a.jsx)(j,{icon:"chevron-right",label:"Next day",onClick:()=>F(1),disabled:y})]})}),U&&(P.length>1||U.cancelledCount>0)&&(0,a.jsxs)("div",{className:"mb-3 flex flex-wrap gap-1.5",children:[(0,a.jsx)(w,{label:"All",count:U.count,active:"all"===o.kind,onClick:()=>i(b)}),P.map(e=>{let[t,n]=e;return(0,a.jsx)(w,{label:t,count:n,active:"platform"===o.kind&&o.platform===t,onClick:()=>i({kind:"platform",platform:t}),logo:(0,a.jsx)(f.XY,{source:t,size:16})},t)}),U.cancelledCount>0&&(0,a.jsx)(w,{label:"Cancelled / no-show",count:U.cancelledCount,active:"cancelled"===o.kind,onClick:()=>i(k),logo:(0,a.jsx)(l.Icon,{name:"x-circle",className:"h-4 w-4"})})]}),z||S&&!U?(0,a.jsxs)("div",{className:"flex items-center justify-center gap-2 py-8 text-semantic_text_secondary",children:[(0,a.jsx)(l.Icon,{name:"loader",spin:!0,className:"h-4 w-4"}),(0,a.jsx)("span",{className:"font-lexendDeca text-[13px]",children:"Loading…"})]}):I&&!U?(0,a.jsxs)("div",{className:"py-8 text-center",children:[(0,a.jsx)("p",{className:"font-lexendDeca text-[13px] text-semantic_text_secondary",children:"Couldn't load this day."}),(0,a.jsx)("button",{type:"button",onClick:D,className:"mt-2 font-lexendDeca text-[13px] font-medium text-semantic_text_brand transition-opacity hover:opacity-80",children:"Try again"})]}):0===O.length?(0,a.jsx)("p",{className:"py-8 text-center font-lexendDeca text-[13px] text-semantic_text_secondary",children:"platform"===o.kind?"No bookings for this channel on this day.":"cancelled"===o.kind?"Nothing cancelled on this day.":"No bookings taken on this day."}):(0,a.jsx)("div",{className:"space-y-0.5",children:O.map(e=>(0,a.jsx)(T,{b:e,resolveImg:m,onNavigate:()=>n(!1)},e.id))})]})}function j(e){let{icon:t,label:n,onClick:r,disabled:o}=e;return(0,a.jsx)("button",{type:"button",onClick:r,disabled:o,"aria-label":n,className:"flex h-9 w-9 flex-shrink-0 items-center justify-center rounded-[8px] text-semantic_icon transition-colors hover:bg-semantic_background_hovered active:bg-semantic_background_hovered disabled:opacity-30 disabled:hover:bg-transparent",children:(0,a.jsx)(l.Icon,{name:t,className:"h-5 w-5"})})}function w(e){let{label:t,count:n,active:r,onClick:o,logo:i}=e;return(0,a.jsxs)("button",{type:"button",onClick:o,className:(0,y.cn)("inline-flex items-center gap-1.5 rounded-[8px] border-[0.64px] px-2.5 py-1 font-lexendDeca text-[12px] transition-colors",r?"border-semantic_border_prominent bg-semantic_surface_brown font-semibold text-semantic_text_brand":"border-semantic_border bg-semantic_surface text-semantic_text_secondary hover:bg-semantic_background_hovered"),children:[i,(0,a.jsx)("span",{children:t}),(0,a.jsx)("span",{className:"font-figtree font-semibold tabular-nums",children:n})]})}function T(e){let{b:t,resolveImg:n,onNavigate:r}=e,o=function(e){let t=(e||"").trim();if(!t||"auto-sync"===t)return null;let n=(t.includes("@")?t.split("@")[0]:t).replace(/[._-]+/g," ").trim();return n?n.replace(/\b\w/g,e=>e.toUpperCase()):null}(t.bookedBy),l=function(e){if(!e)return null;let t=new Date(e);return Number.isNaN(t.getTime())?null:t.toLocaleTimeString("en-IN",{hour:"numeric",minute:"2-digit",hour12:!0,timeZone:"Asia/Kolkata"})}(t.bookedAt);return(0,a.jsxs)(i(),{href:"/pms/bookings/".concat(t.id),onClick:r,className:"flex items-center gap-3 rounded-[8px] px-2 py-2.5 transition-colors hover:bg-semantic_background_hovered active:bg-semantic_background_hovered",children:[(0,a.jsxs)("span",{className:"relative flex-shrink-0",children:[(0,a.jsx)(v.VillaThumb,{size:40,name:t.propertyName,image:n({propertyName:t.propertyName})}),t.bookedVia&&(0,a.jsx)("span",{className:"absolute -bottom-1 -right-1 overflow-hidden rounded-full bg-semantic_surface ring-2 ring-semantic_surface",children:(0,a.jsx)(f.XY,{source:t.bookedVia,size:16})})]}),(0,a.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,a.jsx)("p",{className:"truncate font-lexendDeca text-[14px] font-semibold text-semantic_text",children:t.guestName||"Guest"}),(0,a.jsxs)("p",{className:"truncate font-lexendDeca text-[12px] text-semantic_text_secondary",children:[t.propertyName,t.checkInDate?" \xb7 ".concat((0,x.Lq)(t.checkInDate)):""]}),(o||l)&&(0,a.jsxs)("p",{className:"mt-0.5 truncate font-lexendDeca text-[11px] text-semantic_text_secondary",children:[o?"by ".concat(o):"Online",l?" \xb7 ".concat(l):""]})]}),(0,a.jsxs)("div",{className:"flex flex-shrink-0 flex-col items-end gap-1",children:[t.totalAmount>0&&(0,a.jsx)("span",{className:"font-figtree text-[13px] font-bold tabular-nums text-semantic_text",children:(0,p.vv)(t.totalAmount)}),(0,a.jsx)(m.qs,{status:t.bookingStatus})]})]})}function C(e){try{return new Date("".concat(e,"T12:00:00Z")).toLocaleDateString("en-IN",{weekday:"short",day:"numeric",month:"short",timeZone:"UTC"})}catch(t){return e}}}
1,11943:(e,t,n)=>{n.d(t,{$c:()=>h,$k:()=>u,Lq:()=>p,Un:()=>s,ad:()=>v,br:()=>m,cv:()=>d,g_:()=>y,nu:()=>x,yg:()=>f});let a=/^(\d{4})-(\d{2})-(\d{2})$/,r=/^(\d{1,2})[/-](\d{1,2})[/-](\d{4})$/;function o(e){return String(e).padStart(2,"0")}function i(e){let t=a.exec(e);if(!t)return null;let[,n,r,o]=t;return new Date(Date.UTC(Number(n),Number(r)-1,Number(o)))}function l(e){var t,n,a;let r=new Intl.DateTimeFormat("en-CA",{timeZone:"Asia/Kolkata",year:"numeric",month:"2-digit",day:"2-digit"}).formatToParts(e),o=null==(t=r.find(e=>"year"===e.type))?void 0:t.value,i=null==(n=r.find(e=>"month"===e.type))?void 0:n.value,l=null==(a=r.find(e=>"day"===e.type))?void 0:a.value;return o&&i&&l?"".concat(o,"-").concat(i,"-").concat(l):""}function s(e){if("string"==typeof e){let t=e.trim(),n=a.exec(t);if(n)return"".concat(n[1],"-").concat(n[2],"-").concat(n[3]);let i=r.exec(t);if(i)return"".concat(i[3],"-").concat(o(i[2]),"-").concat(o(i[1]))}let t=function(e){if(null==e||""===e)return null;if(e instanceof Date)return Number.isNaN(e.getTime())?null:e;if("function"==typeof(null==e?void 0:e.toDate)){var t;let n=null==(t=e.toDate)?void 0:t.call(e);return n instanceof Date&&!Number.isNaN(n.getTime())?n:null}let n=new Date(e);return Number.isNaN(n.getTime())?null:n}(e);return t?l(t):""}function c(e){let t=s(e);return t?i(t):null}function d(){return l(new Date)}function u(e,t){let n=i(e);return n?(n.setUTCDate(n.getUTCDate()+t),[n.getUTCFullYear(),o(n.getUTCMonth()+1),o(n.getUTCDate())].join("-")):""}function m(e,t){let n=c(e),a=c(t);return n&&a?Math.round((a.getTime()-n.getTime())/864e5):0}function f(e,t){return Math.max(0,m(e,t))}function p(e){let t=s(e);if(!t)return"—";let[,n,a]=t.split("-");return"".concat(a,"-").concat(n,"-").concat(t.slice(0,4))}function x(e){let t=c(e);return t?new Intl.DateTimeFormat("en-IN",{timeZone:"UTC",day:"numeric",month:"short",year:"numeric"}).format(t):"—"}function h(e){let t=c(e);return t?new Intl.DateTimeFormat("en-IN",{timeZone:"UTC",day:"numeric",month:"short"}).format(t):"—"}function g(){return Number(d().slice(0,4))}function v(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=c(e);return n?new Intl.DateTimeFormat("en-IN",{timeZone:"UTC",...t.weekday?{weekday:"short"}:{},day:"numeric",month:"short",...n.getUTCFullYear()===g()?{}:{year:"numeric"}}).format(n):"—"}function y(e,t){let n=c(e),a=c(t);if(!n)return"—";let r=e=>e.getUTCDate(),o=e=>e.toLocaleDateString("en-GB",{timeZone:"UTC",month:"short"}),i=g();if(!a){let e=n.getUTCFullYear()===i?"":" ".concat(n.getUTCFullYear());return"".concat(r(n)," ").concat(o(n)).concat(e)}if(n.getUTCFullYear()!==a.getUTCFullYear())return"".concat(r(n)," ").concat(o(n)," ").concat(n.getUTCFullYear()," - ").concat(r(a)," ").concat(o(a)," ").concat(a.getUTCFullYear());let l=n.getUTCFullYear()===i?"":" ".concat(n.getUTCFullYear());return n.getUTCMonth()===a.getUTCMonth()?"".concat(r(n),"-").concat(r(a)," ").concat(o(n)).concat(l):"".concat(r(n)," ").concat(o(n)," - ").concat(r(a)," ").concat(o(a)).concat(l)}},32227:(e,t,n)=>{n.d(t,{Pj:()=>c,QQ:()=>i,S8:()=>o,dh:()=>l,k6:()=>d,tj:()=>s});let a="Asia/Kolkata";function r(e){if(null==e||""===e)return null;if(e instanceof Date)return isNaN(e.getTime())?null:e;if("function"==typeof e.toDate){let t=e.toDate();return t instanceof Date&&!isNaN(t.getTime())?t:null}let t=new Date(e);return isNaN(t.getTime())?null:t}function o(e){var t,n,o;let i=r(e);if(!i)return"—";let l=new Intl.DateTimeFormat("en-GB",{timeZone:a,day:"2-digit",month:"2-digit",year:"numeric"}).formatToParts(i),s=(null==(t=l.find(e=>"day"===e.type))?void 0:t.value)||"",c=(null==(n=l.find(e=>"month"===e.type))?void 0:n.value)||"",d=(null==(o=l.find(e=>"year"===e.type))?void 0:o.value)||"";return"".concat(s,"-").concat(c,"-").concat(d)}let i=o;function l(e){let t=r(e);return t?new Intl.DateTimeFormat("en-IN",{timeZone:a,hour:"numeric",minute:"2-digit",hour12:!0}).format(t):"—"}function s(e){let t=r(e);return t?new Intl.DateTimeFormat("en-IN",{timeZone:a,day:"2-digit",month:"short",year:"numeric",hour:"numeric",minute:"2-digit",hour12:!0}).format(t):"—"}function c(e){let t=r(e);return t?new Intl.DateTimeFormat("en-CA",{timeZone:a,year:"numeric",month:"2-digit",day:"2-digit"}).format(t):""}function d(){return new Intl.DateTimeFormat("en-CA",{timeZone:a,year:"numeric",month:"2-digit",day:"2-digit"}).format(new Date)}},43303:(e,t,n)=>{n.d(t,{q:()=>o});var a=n(25959),r=n(89863);let o=(0,a.v)()((0,r.Zr)(e=>({hidePartnerProperties:!0,toggleHidePartnerProperties:()=>e(e=>({hidePartnerProperties:!e.hidePartnerProperties})),setHidePartnerProperties:t=>e({hidePartnerProperties:t}),hideInternalBookings:!0,toggleHideInternalBookings:()=>e(e=>({hideInternalBookings:!e.hideInternalBookings})),setHideInternalBookings:t=>e({hideInternalBookings:t})}),{name:"pms-settings",version:2,migrate:(e,t)=>
1({...null!=e?e:{},hidePartnerProperties:!0,hideInternalBookings:!0})}))},63470:(e,t,n)=>{n.d(t,{Ge:()=>l,RS:()=>o,fk:()=>i});var a=n(43303),r=n(47703);function o(){let e=(0,a.q)(e=>e.hidePartnerProperties),t=(0,a.q)(e=>e.hideInternalBookings),n=new URLSearchParams;e&&n.set("scope","spacez"),t&&n.set("hideInternal","true");let r=n.toString();return r?"/api/pms/dashboard/bundle?".concat(r):"/api/pms/dashboard/bundle"}function i(){var e;let t=o(),{data:n,loading:a,error:i,reload:l}=(0,r.K)(t);return{stats:null!=(e=null==n?void 0:n.stats)?e:null,loading:a,error:i,reload:l}}function l(e){let t=(0,a.q)(e=>e.hidePartnerProperties),n=(0,a.q)(e=>e.hideInternalBookings);if(!e)return null;let r=new URLSearchParams({date:e});return t&&r.set("scope","spacez"),n&&r.set("hideInternal","true"),"/api/pms/bookings-taken?".concat(r.toString())}},89863:(e,t,n)=>{n.d(t,{Zr:()=>c,lt:()=>i});let a=e=>!!e.dispatchFromDevtools&&"function"==typeof e.dispatch,r=new Map,o=e=>{let t=r.get(e);return t?Object.fromEntries(Object.entries(t.stores).map(([e,t])=>[e,t.getState()])):{}},i=(e,t={})=>(n,i,s)=>{let c,{enabled:d,anonymousActionType:u,store:m,...f}=t;try{c=(null==d||d)&&window.__REDUX_DEVTOOLS_EXTENSION__}catch(e){}if(!c)return e(n,i,s);let{connection:p,...x}=((e,t,n)=>{if(void 0===e)return{type:"untracked",connection:t.connect(n)};let a=r.get(n.name);if(a)return{type:"tracked",store:e,...a};let o={connection:t.connect(n),stores:{}};return r.set(n.name,o),{type:"tracked",store:e,...o}})(m,c,f),h=!0;s.setState=(e,t,a)=>{let r=n(e,t);if(!h)return r;let l=void 0===a?{type:u||(e=>{var t,n;if(!e)return;let a=e.split("\n"),r=a.findIndex(e=>e.includes("api.setState"));if(r<0)return;let o=(null==(t=a[r+1])?void 0:t.trim())||"";return null==(n=/.+ (.+) .+/.exec(o))?void 0:n[1]})(Error().stack)||"anonymous"}:"string"==typeof a?{type:a}:a;return void 0===m?null==p||p.send(l,i()):null==p||p.send({...l,type:`${m}/${l.type}`},{...o(f.name),[m]:s.getState()}),r},s.devtools={cleanup:()=>{p&&"function"==typeof p.unsubscribe&&p.unsubscribe(),((e,t)=>{if(void 0===t)return;let n=r.get(e);n&&(delete n.stores[t],0===Object.keys(n.stores).length&&r.delete(e))})(f.name,m)}};let g=(...e)=>{let t=h;h=!1,n(...e),h=t},v=e(s.setState,i,s);if("untracked"===x.type?null==p||p.init(v):(x.stores[x.store]=s,null==p||p.init(Object.fromEntries(Object.entries(x.stores).map(([e,t])=>[e,e===x.store?v:t.getState()])))),a(s)){let e=!1,t=s.dispatch;s.dispatch=(...n)=>{"__setState"!==n[0].type||e||(console.warn('[zustand devtools middleware] "__setState" action type is reserved to set state from the devtools. Avoid using it.'),e=!0),t(...n)}}return p.subscribe(e=>{var t;switch(e.type){case"ACTION":if("string"!=typeof e.payload)return void console.error("[zustand devtools middleware] Unsupported action format");return l(e.payload,e=>{if("__setState"===e.type){if(void 0===m)return void g(e.state);1!==Object.keys(e.state).length&&console.error(`
2                    [zustand devtools middleware] Unsupported __setState action format.
3                    When using 'store' option in devtools(), the 'state' should have only one key, which is a value of 'store' that was passed in devtools(),
4                    and value of this only key should be a state object. Example: { "type": "__setState", "state": { "abc123Store": { "foo": "bar" } } }
5                    `);let t=e.state[m];return void(null==t||JSON.stringify(s.getState())!==JSON.stringify(t)&&g(t))}a(s)&&s.dispatch(e)});case"DISPATCH":switch(e.payload.type){case"RESET":if(g(v),void 0===m)return null==p?void 0:p.init(s.getState());return null==p?void 0:p.init(o(f.name));case"COMMIT":if(void 0===m){null==p||p.init(s.getState());break}return null==p?void 0:p.init(o(f.name));case"ROLLBACK":return l(e.state,e=>{if(void 0===m){g(e),null==p||p.init(s.getState());return}g(e[m]),null==p||p.init(o(f.name))});case"JUMP_TO_STATE":case"JUMP_TO_ACTION":return l(e.state,e=>{if(void 0===m)return void g(e);JSON.stringify(s.getState())!==JSON.stringify(e[m])&&g(e[m])});case"IMPORT_STATE":{let{nextLiftedState:n}=e.payload,a=null==(t=n.computedStates.slice(-1)[0])?void 0:t.state;if(!a)return;void 0===m?g(a):g(a[m]),null==p||p.send(null,n);break}case"PAUSE_RECORDING":return h=!h}return}}),v},l=(e,t)=>
5{let n;try{n=JSON.parse(e)}catch(e){console.error("[zustand devtools middleware] Could not parse the received json",e)}void 0!==n&&t(n)},s=e=>t=>{try{let n=e(t);if(n instanceof Promise)return n;return{then:e=>s(e)(n),catch(e){return this}}}catch(e){return{then(e){return this},catch:t=>s(t)(e)}}},c=(e,t)=>(n,a,r)=>{let o,i={storage:function(e,t){let n;try{n=e()}catch(e){return}return{getItem:e=>{var t;let a=e=>null===e?null:JSON.parse(e,void 0),r=null!=(t=n.getItem(e))?t:null;return r instanceof Promise?r.then(a):a(r)},setItem:(e,t)=>n.setItem(e,JSON.stringify(t,void 0)),removeItem:e=>n.removeItem(e)}}(()=>window.localStorage),partialize:e=>e,version:0,merge:(e,t)=>({...t,...e}),...t},l=!1,c=0,d=new Set,u=new Set,m=i.storage;if(!m)return e((...e)=>{console.warn(`[zustand persist middleware] Unable to update item '${i.name}', the given storage is currently unavailable.`),n(...e)},a,r);let f=()=>{let e=i.partialize({...a()});return m.setItem(i.name,{state:e,version:i.version})},p=r.setState;r.setState=(e,t)=>(p(e,t),f());let x=e((...e)=>(n(...e),f()),a,r);r.getInitialState=()=>x;let h=()=>{var e,t;if(!m)return;let r=++c;l=!1,d.forEach(e=>{var t;return e(null!=(t=a())?t:x)});let p=(null==(t=i.onRehydrateStorage)?void 0:t.call(i,null!=(e=a())?e:x))||void 0;return s(m.getItem.bind(m))(i.name).then(e=>{if(e)if("number"!=typeof e.version||e.version===i.version)return[!1,e.state];else{if(i.migrate){let t=i.migrate(e.state,e.version);return t instanceof Promise?t.then(e=>[!0,e]):[!0,t]}console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}return[!1,void 0]}).then(e=>{var t;if(r!==c)return;let[l,s]=e;if(n(o=i.merge(s,null!=(t=a())?t:x),!0),l)return f()}).then(()=>{r===c&&(null==p||p(o,void 0),o=a(),l=!0,u.forEach(e=>e(o)))}).catch(e=>{r===c&&(null==p||p(void 0,e))})};return r.persist={setOptions:e=>{i={...i,...e},e.storage&&(m=e.storage)},clearStorage:()=>{null==m||m.removeItem(i.name)},getOptions:()=>i,rehydrate:()=>h(),hasHydrated:()=>l,onHydrate:e=>(d.add(e),()=>{d.delete(e)}),onFinishHydration:e=>(u.add(e),()=>{u.delete(e)})},i.skipHydration||h(),o||x}}}]);

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.