import{r as i,j as e,q as Y,Y as j,b as Yt}from"./app-CffHYkHW.js";import{u as K,c as Xt,a as _,S as ge,b as Zt}from"./utils-C8zp8JNC.js";import{c as Xe,B as H}from"./button-qhe8lrPU.js";import{S as Ze,a as Qe,b as Je,c as Qt,d as et,e as Jt}from"./sheet-Bisw0FSz.js";import{c as je,u as be,a as ye,b as A,P as X,d as en,D as tt,e as W,f as U}from"./index-Cy5bElus.js";import{c as nt,R as tn,A as nn,a as rn,C as an,u as sn,b as rt}from"./index-C9NeyPdJ.js";import{P as I,d as Fe,R as on}from"./index-DPkgfxsD.js";import{R as at,C as cn,u as ln}from"./index-CjqRk3xD.js";import{c as T}from"./createLucideIcon-DAR-hy5d.js";import{T as dn,a as un,S as hn}from"./truck-DnoS8QCL.js";import{P as pn}from"./package-BHw0cifz.js";import{C as st,S as ze,L as xn}from"./shopping-bag-AryJS2XX.js";import{S as fn,A as vn}from"./app-logo-icon-D3Jzt_fn.js";import{D as mn,a as $e,b as gn,c as We,u as jn,B as bn,d as ot,e as it,f as ct,g as yn}from"./bluetooth-context-CLrE8g1i.js";import{T as wn}from"./sonner-CPUj7IiR.js";/**
 * @license lucide-react v0.475.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const kn=[["rect",{width:"20",height:"5",x:"2",y:"3",rx:"1",key:"1wp1u1"}],["path",{d:"M4 8v11a2 2 0 0 0 2 2h2",key:"tvwodi"}],["path",{d:"M20 8v11a2 2 0 0 1-2 2h-2",key:"1gkqxj"}],["path",{d:"m9 15 3-3 3 3",key:"1pd0qc"}],["path",{d:"M12 12v9",key:"192myk"}]],He=T("ArchiveRestore",kn);/**
 * @license lucide-react v0.475.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Cn=[["path",{d:"M12 7v14",key:"1akyts"}],["path",{d:"M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z",key:"ruj8y"}]],Nn=T("BookOpen",Cn);/**
 * @license lucide-react v0.475.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Mn=[["path",{d:"M15 13a3 3 0 1 0-6 0",key:"10j68g"}],["path",{d:"M4 19.5v-15A2.5 2.5 0 0 1 6.5 2H19a1 1 0 0 1 1 1v18a1 1 0 0 1-1 1H6.5a1 1 0 0 1 0-5H20",key:"k3hazp"}],["circle",{cx:"12",cy:"8",r:"2",key:"1822b1"}]],_n=T("BookUser",Mn);/**
 * @license lucide-react v0.475.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const En=[["path",{d:"M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z",key:"hh9hay"}],["path",{d:"m3.3 7 8.7 5 8.7-5",key:"g66t2b"}],["path",{d:"M12 22V12",key:"d0xqtd"}]],lt=T("Box",En);/**
 * @license lucide-react v0.475.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Tn=[["path",{d:"M3 3v16a2 2 0 0 0 2 2h16",key:"c24i48"}],["path",{d:"M7 11h8",key:"1feolt"}],["path",{d:"M7 16h3",key:"ur6vzw"}],["path",{d:"M7 6h12",key:"sz5b0d"}]],Sn=T("ChartBarDecreasing",Tn);/**
 * @license lucide-react v0.475.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Rn=[["path",{d:"M9 5v4",key:"14uxtq"}],["rect",{width:"4",height:"6",x:"7",y:"9",rx:"1",key:"f4fvz0"}],["path",{d:"M9 15v2",key:"r5rk32"}],["path",{d:"M17 3v2",key:"1l2re6"}],["rect",{width:"4",height:"8",x:"15",y:"5",rx:"1",key:"z38je5"}],["path",{d:"M17 13v3",key:"5l0wba"}],["path",{d:"M3 3v16a2 2 0 0 0 2 2h16",key:"c24i48"}]],An=T("ChartCandlestick",Rn);/**
 * @license lucide-react v0.475.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Pn=[["path",{d:"m13.11 7.664 1.78 2.672",key:"go2gg9"}],["path",{d:"m14.162 12.788-3.324 1.424",key:"11x848"}],["path",{d:"m20 4-6.06 1.515",key:"1wxxh7"}],["path",{d:"M3 3v16a2 2 0 0 0 2 2h16",key:"c24i48"}],["circle",{cx:"12",cy:"6",r:"2",key:"1jj5th"}],["circle",{cx:"16",cy:"12",r:"2",key:"4ma0v8"}],["circle",{cx:"9",cy:"15",r:"2",key:"lf2ghp"}]],In=T("ChartNetwork",Pn);/**
 * @license lucide-react v0.475.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Ln=[["path",{d:"M12 16v5",key:"zza2cw"}],["path",{d:"M16 14v7",key:"1g90b9"}],["path",{d:"M20 10v11",key:"1iqoj0"}],["path",{d:"m22 3-8.646 8.646a.5.5 0 0 1-.708 0L9.354 8.354a.5.5 0 0 0-.707 0L2 15",key:"1fw8x9"}],["path",{d:"M4 18v3",key:"1yp0dc"}],["path",{d:"M8 14v7",key:"n3cwzv"}]],Dn=T("ChartNoAxesCombined",Ln);/**
 * @license lucide-react v0.475.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const On=[["path",{d:"M3 3v16a2 2 0 0 0 2 2h16",key:"c24i48"}],["path",{d:"M7 16c.5-2 1.5-7 4-7 2 0 2 3 4 3 2.5 0 4.5-5 5-7",key:"lw07rv"}]],Fn=T("ChartSpline",On);/**
 * @license lucide-react v0.475.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const zn=[["path",{d:"M17 21a1 1 0 0 0 1-1v-5.35c0-.457.316-.844.727-1.041a4 4 0 0 0-2.134-7.589 5 5 0 0 0-9.186 0 4 4 0 0 0-2.134 7.588c.411.198.727.585.727 1.041V20a1 1 0 0 0 1 1Z",key:"1qvrer"}],["path",{d:"M6 17h12",key:"1jwigz"}]],dt=T("ChefHat",zn);/**
 * @license lucide-react v0.475.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const $n=[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"7 10 12 15 17 10",key:"2ggqvy"}],["line",{x1:"12",x2:"12",y1:"15",y2:"3",key:"1vk2je"}]],Wn=T("Download",$n);/**
 * @license lucide-react v0.475.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Hn=[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]],ut=T("Folder",Hn);/**
 * @license lucide-react v0.475.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Bn=[["path",{d:"M12 3v18",key:"108xh3"}],["path",{d:"M3 12h18",key:"1i2n21"}],["rect",{x:"3",y:"3",width:"18",height:"18",rx:"2",key:"h1oib"}]],Kn=T("Grid2x2",Bn);/**
 * @license lucide-react v0.475.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Vn=[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M12 7v5l4 2",key:"1fdv2h"}]],Un=T("History",Vn);/**
 * @license lucide-react v0.475.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Gn=[["rect",{width:"7",height:"7",x:"3",y:"3",rx:"1",key:"1g98yp"}],["rect",{width:"7",height:"7",x:"14",y:"3",rx:"1",key:"6d4xhi"}],["rect",{width:"7",height:"7",x:"14",y:"14",rx:"1",key:"nxv5o0"}],["rect",{width:"7",height:"7",x:"3",y:"14",rx:"1",key:"1bb6yr"}]],ht=T("LayoutGrid",Gn);/**
 * @license lucide-react v0.475.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const qn=[["line",{x1:"4",x2:"20",y1:"12",y2:"12",key:"1e0a9i"}],["line",{x1:"4",x2:"20",y1:"6",y2:"6",key:"1owob3"}],["line",{x1:"4",x2:"20",y1:"18",y2:"18",key:"yk5zj1"}]],Yn=T("Menu",qn);/**
 * @license lucide-react v0.475.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Xn=[["path",{d:"M2 6h4",key:"aawbzj"}],["path",{d:"M2 10h4",key:"l0bgd4"}],["path",{d:"M2 14h4",key:"1gsvsf"}],["path",{d:"M2 18h4",key:"1bu2t1"}],["rect",{width:"16",height:"20",x:"4",y:"2",rx:"2",key:"1nb95v"}],["path",{d:"M9.5 8h5",key:"11mslq"}],["path",{d:"M9.5 12H16",key:"ktog6x"}],["path",{d:"M9.5 16H14",key:"p1seyn"}]],Zn=T("NotebookText",Xn);/**
 * @license lucide-react v0.475.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Qn=[["path",{d:"m16 16 2 2 4-4",key:"gfu2re"}],["path",{d:"M21 10V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l2-1.14",key:"e7tb2h"}],["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}],["polyline",{points:"3.29 7 12 12 20.71 7",key:"ousv84"}],["line",{x1:"12",x2:"12",y1:"22",y2:"12",key:"a4e8g8"}]],Jn=T("PackageCheck",Qn);/**
 * @license lucide-react v0.475.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const er=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]],tr=T("PanelLeft",er);/**
 * @license lucide-react v0.475.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const nr=[["line",{x1:"19",x2:"5",y1:"5",y2:"19",key:"1x9vlm"}],["circle",{cx:"6.5",cy:"6.5",r:"2.5",key:"4mh3h7"}],["circle",{cx:"17.5",cy:"17.5",r:"2.5",key:"1mdrzq"}]],rr=T("Percent",nr);/**
 * @license lucide-react v0.475.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const ar=[["path",{d:"M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z",key:"vktsd0"}],["circle",{cx:"7.5",cy:"7.5",r:".5",fill:"currentColor",key:"kqv944"}]],sr=T("Tag",ar);/**
 * @license lucide-react v0.475.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const or=[["path",{d:"m15 5 6.3 6.3a2.4 2.4 0 0 1 0 3.4L17 19",key:"1cbfv1"}],["path",{d:"M9.586 5.586A2 2 0 0 0 8.172 5H3a1 1 0 0 0-1 1v5.172a2 2 0 0 0 .586 1.414L8.29 18.29a2.426 2.426 0 0 0 3.42 0l3.58-3.58a2.426 2.426 0 0 0 0-3.42z",key:"135mg7"}],["circle",{cx:"6.5",cy:"9.5",r:".5",fill:"currentColor",key:"5pm5xn"}]],ir=T("Tags",or);/**
 * @license lucide-react v0.475.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const cr=[["path",{d:"M14.828 14.828 21 21",key:"ar5fw7"}],["path",{d:"M21 16v5h-5",key:"1ck2sf"}],["path",{d:"m21 3-9 9-4-4-6 6",key:"1h02xo"}],["path",{d:"M21 8V3h-5",key:"1qoq8a"}]],lr=T("TrendingUpDown",cr);/**
 * @license lucide-react v0.475.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const dr=[["circle",{cx:"18",cy:"15",r:"3",key:"gjjjvw"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["path",{d:"M10 15H6a4 4 0 0 0-4 4v2",key:"1nfge6"}],["path",{d:"m21.7 16.4-.9-.3",key:"12j9ji"}],["path",{d:"m15.2 13.9-.9-.3",key:"1fdjdi"}],["path",{d:"m16.6 18.7.3-.9",key:"heedtr"}],["path",{d:"m19.1 12.2.3-.9",key:"1af3ki"}],["path",{d:"m19.6 18.7-.4-1",key:"1x9vze"}],["path",{d:"m16.8 12.3-.4-1",key:"vqeiwj"}],["path",{d:"m14.3 16.6 1-.4",key:"1qlj63"}],["path",{d:"m20.7 13.8 1-.4",key:"1v5t8k"}]],pt=T("UserCog",dr);/**
 * @license lucide-react v0.475.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const ur=[["path",{d:"M2 21a8 8 0 0 1 13.292-6",key:"bjp14o"}],["circle",{cx:"10",cy:"8",r:"5",key:"o932ke"}],["path",{d:"m16 19 2 2 4-4",key:"1b14m6"}]],hr=T("UserRoundCheck",ur);/**
 * @license lucide-react v0.475.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const pr=[["path",{d:"M18 21a8 8 0 0 0-16 0",key:"3ypg7q"}],["circle",{cx:"10",cy:"8",r:"5",key:"o932ke"}],["path",{d:"M22 20c0-3.37-2-6.5-4-8a5 5 0 0 0-.45-8.3",key:"10s06x"}]],xr=T("UsersRound",pr);/**
 * @license lucide-react v0.475.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const fr=[["path",{d:"M19 7V4a1 1 0 0 0-1-1H5a2 2 0 0 0 0 4h15a1 1 0 0 1 1 1v4h-3a2 2 0 0 0 0 4h3a1 1 0 0 0 1-1v-2a1 1 0 0 0-1-1",key:"18etb6"}],["path",{d:"M3 5v14a2 2 0 0 0 2 2h15a1 1 0 0 0 1-1v-4",key:"xoc0q4"}]],vr=T("Wallet",fr);/**
 * @license lucide-react v0.475.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const mr=[["path",{d:"M22 8.35V20a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V8.35A2 2 0 0 1 3.26 6.5l8-3.2a2 2 0 0 1 1.48 0l8 3.2A2 2 0 0 1 22 8.35Z",key:"gksnxg"}],["path",{d:"M6 18h12",key:"9pbo8z"}],["path",{d:"M6 14h12",key:"4cwo0f"}],["rect",{width:"12",height:"12",x:"6",y:"10",key:"apd30q"}]],gr=T("Warehouse",mr);function jr(){const[t,n]=i.useState(null),[r,s]=i.useState(!1);i.useEffect(()=>{const o=c=>{c.preventDefault(),n(c),s(!0)};return window.addEventListener("beforeinstallprompt",o),()=>window.removeEventListener("beforeinstallprompt",o)},[]);const a=()=>{t&&(t.prompt(),t.userChoice.then(()=>n(null)),s(!1))};return r?e.jsxs("button",{onClick:a,className:`
                fixed bottom-4 right-4 flex items-center gap-2
                px-4 py-2 rounded-full shadow-lg
                bg-gray-700/60 hover:bg-gray-700/80
                text-white dark:bg-gray-600/60 dark:hover:bg-gray-600/80
                backdrop-blur-md transition-all duration-200
            `,children:[e.jsx(Wn,{className:"w-4 h-4"}),e.jsx("span",{className:"text-sm font-medium",children:"Install Aplikasi"})]}):null}const ie=768;function br(){const[t,n]=i.useState();return i.useEffect(()=>{const r=window.matchMedia(`(max-width: ${ie-1}px)`),s=()=>{n(window.innerWidth<ie)};return r.addEventListener("change",s),n(window.innerWidth<ie),()=>r.removeEventListener("change",s)},[]),!!t}var[re,Ms]=je("Tooltip",[nt]),ae=nt(),xt="TooltipProvider",yr=700,de="tooltip.open",[wr,we]=re(xt),ft=t=>{const{__scopeTooltip:n,delayDuration:r=yr,skipDelayDuration:s=300,disableHoverableContent:a=!1,children:o}=t,c=i.useRef(!0),h=i.useRef(!1),d=i.useRef(0);return i.useEffect(()=>{const x=d.current;return()=>window.clearTimeout(x)},[]),e.jsx(wr,{scope:n,isOpenDelayedRef:c,delayDuration:r,onOpen:i.useCallback(()=>{window.clearTimeout(d.current),c.current=!1},[]),onClose:i.useCallback(()=>{window.clearTimeout(d.current),d.current=window.setTimeout(()=>c.current=!0,s)},[s]),isPointerInTransitRef:h,onPointerInTransitChange:i.useCallback(x=>{h.current=x},[]),disableHoverableContent:a,children:o})};ft.displayName=xt;var Z="Tooltip",[kr,Q]=re(Z),vt=t=>{const{__scopeTooltip:n,children:r,open:s,defaultOpen:a,onOpenChange:o,disableHoverableContent:c,delayDuration:h}=t,d=we(Z,t.__scopeTooltip),x=ae(n),[u,p]=i.useState(null),f=be(),v=i.useRef(0),g=c??d.disableHoverableContent,m=h??d.delayDuration,b=i.useRef(!1),[w,E]=ye({prop:s,defaultProp:a??!1,onChange:P=>{P?(d.onOpen(),document.dispatchEvent(new CustomEvent(de))):d.onClose(),o==null||o(P)},caller:Z}),k=i.useMemo(()=>w?b.current?"delayed-open":"instant-open":"closed",[w]),C=i.useCallback(()=>{window.clearTimeout(v.current),v.current=0,b.current=!1,E(!0)},[E]),y=i.useCallback(()=>{window.clearTimeout(v.current),v.current=0,E(!1)},[E]),R=i.useCallback(()=>{window.clearTimeout(v.current),v.current=window.setTimeout(()=>{b.current=!0,E(!0),v.current=0},m)},[m,E]);return i.useEffect(()=>()=>{v.current&&(window.clearTimeout(v.current),v.current=0)},[]),e.jsx(tn,{...x,children:e.jsx(kr,{scope:n,contentId:f,open:w,stateAttribute:k,trigger:u,onTriggerChange:p,onTriggerEnter:i.useCallback(()=>{d.isOpenDelayedRef.current?R():C()},[d.isOpenDelayedRef,R,C]),onTriggerLeave:i.useCallback(()=>{g?y():(window.clearTimeout(v.current),v.current=0)},[y,g]),onOpen:C,onClose:y,disableHoverableContent:g,children:r})})};vt.displayName=Z;var ue="TooltipTrigger",mt=i.forwardRef((t,n)=>{const{__scopeTooltip:r,...s}=t,a=Q(ue,r),o=we(ue,r),c=ae(r),h=i.useRef(null),d=K(n,h,a.onTriggerChange),x=i.useRef(!1),u=i.useRef(!1),p=i.useCallback(()=>x.current=!1,[]);return i.useEffect(()=>()=>document.removeEventListener("pointerup",p),[p]),e.jsx(nn,{asChild:!0,...c,children:e.jsx(I.button,{"aria-describedby":a.open?a.contentId:void 0,"data-state":a.stateAttribute,...s,ref:d,onPointerMove:A(t.onPointerMove,f=>{f.pointerType!=="touch"&&!u.current&&!o.isPointerInTransitRef.current&&(a.onTriggerEnter(),u.current=!0)}),onPointerLeave:A(t.onPointerLeave,()=>{a.onTriggerLeave(),u.current=!1}),onPointerDown:A(t.onPointerDown,()=>{a.open&&a.onClose(),x.current=!0,document.addEventListener("pointerup",p,{once:!0})}),onFocus:A(t.onFocus,()=>{x.current||a.onOpen()}),onBlur:A(t.onBlur,a.onClose),onClick:A(t.onClick,a.onClose)})})});mt.displayName=ue;var ke="TooltipPortal",[Cr,Nr]=re(ke,{forceMount:void 0}),gt=t=>{const{__scopeTooltip:n,forceMount:r,children:s,container:a}=t,o=Q(ke,n);return e.jsx(Cr,{scope:n,forceMount:r,children:e.jsx(X,{present:r||o.open,children:e.jsx(en,{asChild:!0,container:a,children:s})})})};gt.displayName=ke;var G="TooltipContent",jt=i.forwardRef((t,n)=>{const r=Nr(G,t.__scopeTooltip),{forceMount:s=r.forceMount,side:a="top",...o}=t,c=Q(G,t.__scopeTooltip);return e.jsx(X,{present:s||c.open,children:c.disableHoverableContent?e.jsx(bt,{side:a,...o,ref:n}):e.jsx(Mr,{side:a,...o,ref:n})})}),Mr=i.forwardRef((t,n)=>{const r=Q(G,t.__scopeTooltip),s=we(G,t.__scopeTooltip),a=i.useRef(null),o=K(n,a),[c,h]=i.useState(null),{trigger:d,onClose:x}=r,u=a.current,{onPointerInTransitChange:p}=s,f=i.useCallback(()=>{h(null),p(!1)},[p]),v=i.useCallback((g,m)=>{const b=g.currentTarget,w={x:g.clientX,y:g.clientY},E=Sr(w,b.getBoundingClientRect()),k=Rr(w,E),C=Ar(m.getBoundingClientRect()),y=Ir([...k,...C]);h(y),p(!0)},[p]);return i.useEffect(()=>()=>f(),[f]),i.useEffect(()=>{if(d&&u){const g=b=>v(b,u),m=b=>v(b,d);return d.addEventListener("pointerleave",g),u.addEventListener("pointerleave",m),()=>{d.removeEventListener("pointerleave",g),u.removeEventListener("pointerleave",m)}}},[d,u,v,f]),i.useEffect(()=>{if(c){const g=m=>{const b=m.target,w={x:m.clientX,y:m.clientY},E=(d==null?void 0:d.contains(b))||(u==null?void 0:u.contains(b)),k=!Pr(w,c);E?f():k&&(f(),x())};return document.addEventListener("pointermove",g),()=>document.removeEventListener("pointermove",g)}},[d,u,c,x,f]),e.jsx(bt,{...t,ref:o})}),[_r,Er]=re(Z,{isInside:!1}),Tr=Xt("TooltipContent"),bt=i.forwardRef((t,n)=>{const{__scopeTooltip:r,children:s,"aria-label":a,onEscapeKeyDown:o,onPointerDownOutside:c,...h}=t,d=Q(G,r),x=ae(r),{onClose:u}=d;return i.useEffect(()=>(document.addEventListener(de,u),()=>document.removeEventListener(de,u)),[u]),i.useEffect(()=>{if(d.trigger){const p=f=>{const v=f.target;v!=null&&v.contains(d.trigger)&&u()};return window.addEventListener("scroll",p,{capture:!0}),()=>window.removeEventListener("scroll",p,{capture:!0})}},[d.trigger,u]),e.jsx(tt,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:o,onPointerDownOutside:c,onFocusOutside:p=>p.preventDefault(),onDismiss:u,children:e.jsxs(an,{"data-state":d.stateAttribute,...x,...h,ref:n,style:{...h.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[e.jsx(Tr,{children:s}),e.jsx(_r,{scope:r,isInside:!0,children:e.jsx(at,{id:d.contentId,role:"tooltip",children:a||s})})]})})});jt.displayName=G;var yt="TooltipArrow",wt=i.forwardRef((t,n)=>{const{__scopeTooltip:r,...s}=t,a=ae(r);return Er(yt,r).isInside?null:e.jsx(rn,{...a,...s,ref:n})});wt.displayName=yt;function Sr(t,n){const r=Math.abs(n.top-t.y),s=Math.abs(n.bottom-t.y),a=Math.abs(n.right-t.x),o=Math.abs(n.left-t.x);switch(Math.min(r,s,a,o)){case o:return"left";case a:return"right";case r:return"top";case s:return"bottom";default:throw new Error("unreachable")}}function Rr(t,n,r=5){const s=[];switch(n){case"top":s.push({x:t.x-r,y:t.y+r},{x:t.x+r,y:t.y+r});break;case"bottom":s.push({x:t.x-r,y:t.y-r},{x:t.x+r,y:t.y-r});break;case"left":s.push({x:t.x+r,y:t.y-r},{x:t.x+r,y:t.y+r});break;case"right":s.push({x:t.x-r,y:t.y-r},{x:t.x-r,y:t.y+r});break}return s}function Ar(t){const{top:n,right:r,bottom:s,left:a}=t;return[{x:a,y:n},{x:r,y:n},{x:r,y:s},{x:a,y:s}]}function Pr(t,n){const{x:r,y:s}=t;let a=!1;for(let o=0,c=n.length-1;o<n.length;c=o++){const h=n[o],d=n[c],x=h.x,u=h.y,p=d.x,f=d.y;u>s!=f>s&&r<(p-x)*(s-u)/(f-u)+x&&(a=!a)}return a}function Ir(t){const n=t.slice();return n.sort((r,s)=>r.x<s.x?-1:r.x>s.x?1:r.y<s.y?-1:r.y>s.y?1:0),Lr(n)}function Lr(t){if(t.length<=1)return t.slice();const n=[];for(let s=0;s<t.length;s++){const a=t[s];for(;n.length>=2;){const o=n[n.length-1],c=n[n.length-2];if((o.x-c.x)*(a.y-c.y)>=(o.y-c.y)*(a.x-c.x))n.pop();else break}n.push(a)}n.pop();const r=[];for(let s=t.length-1;s>=0;s--){const a=t[s];for(;r.length>=2;){const o=r[r.length-1],c=r[r.length-2];if((o.x-c.x)*(a.y-c.y)>=(o.y-c.y)*(a.x-c.x))r.pop();else break}r.push(a)}return r.pop(),n.length===1&&r.length===1&&n[0].x===r[0].x&&n[0].y===r[0].y?n:n.concat(r)}var Dr=ft,Or=vt,Fr=mt,zr=gt,$r=jt,Wr=wt;function se({delayDuration:t=0,...n}){return e.jsx(Dr,{"data-slot":"tooltip-provider",delayDuration:t,...n})}function Ce({...t}){return e.jsx(se,{children:e.jsx(Or,{"data-slot":"tooltip",...t})})}function Ne({...t}){return e.jsx(Fr,{"data-slot":"tooltip-trigger",...t})}function Me({className:t,sideOffset:n=4,children:r,...s}){return e.jsx(zr,{children:e.jsxs($r,{"data-slot":"tooltip-content",sideOffset:n,className:_("bg-primary text-primary-foreground animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 max-w-sm rounded-md px-3 py-1.5 text-xs",t),...s,children:[r,e.jsx(Wr,{className:"bg-primary fill-primary z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px]"})]})})}const Hr="sidebar_state",Br=60*60*24*7,Kr="16rem",Vr="18rem",Ur="3rem",Gr="b",kt=i.createContext(null);function J(){const t=i.useContext(kt);if(!t)throw new Error("useSidebar must be used within a SidebarProvider.");return t}function qr({defaultOpen:t=!0,open:n,onOpenChange:r,className:s,style:a,children:o,...c}){const h=br(),[d,x]=i.useState(!1),[u,p]=i.useState(t),f=n??u,v=i.useCallback(w=>{const E=typeof w=="function"?w(f):w;r?r(E):p(E),document.cookie=`${Hr}=${E}; path=/; max-age=${Br}`},[r,f]),g=i.useCallback(()=>h?x(w=>!w):v(w=>!w),[h,v,x]);i.useEffect(()=>{const w=E=>{E.key===Gr&&(E.metaKey||E.ctrlKey)&&(E.preventDefault(),g())};return window.addEventListener("keydown",w),()=>window.removeEventListener("keydown",w)},[g]);const m=f?"expanded":"collapsed",b=i.useMemo(()=>({state:m,open:f,setOpen:v,isMobile:h,openMobile:d,setOpenMobile:x,toggleSidebar:g}),[m,f,v,h,d,x,g]);return e.jsx(kt.Provider,{value:b,children:e.jsx(se,{delayDuration:0,children:e.jsx("div",{"data-slot":"sidebar-wrapper",style:{"--sidebar-width":Kr,"--sidebar-width-icon":Ur,...a},className:_("group/sidebar-wrapper has-data-[variant=inset]:bg-sidebar flex min-h-svh w-full",s),...c,children:o})})})}function Yr({side:t="left",variant:n="sidebar",collapsible:r="offcanvas",className:s,children:a,...o}){const{isMobile:c,state:h,openMobile:d,setOpenMobile:x}=J();return r==="none"?e.jsx("div",{"data-slot":"sidebar",className:_("bg-sidebar text-sidebar-foreground flex h-full w-(--sidebar-width) flex-col",s),...o,children:a}):c?e.jsxs(Ze,{open:d,onOpenChange:x,...o,children:[e.jsxs(Qe,{className:"sr-only",children:[e.jsx(Je,{children:"Sidebar"}),e.jsx(Qt,{children:"Displays the mobile sidebar."})]}),e.jsx(et,{"data-sidebar":"sidebar","data-slot":"sidebar","data-mobile":"true",className:"bg-sidebar text-sidebar-foreground w-(--sidebar-width) p-0 [&>button]:hidden",style:{"--sidebar-width":Vr},side:t,children:e.jsx("div",{className:"flex h-full w-full flex-col",children:a})})]}):e.jsxs("div",{className:"group peer text-sidebar-foreground hidden md:block","data-state":h,"data-collapsible":h==="collapsed"?r:"","data-variant":n,"data-side":t,"data-slot":"sidebar",children:[e.jsx("div",{className:_("relative h-svh w-(--sidebar-width) bg-transparent transition-[width] duration-200 ease-linear","group-data-[collapsible=offcanvas]:w-0","group-data-[side=right]:rotate-180",n==="floating"||n==="inset"?"group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4)))]":"group-data-[collapsible=icon]:w-(--sidebar-width-icon)")}),e.jsx("div",{className:_("fixed inset-y-0 z-10 hidden h-svh w-(--sidebar-width) transition-[left,right,width] duration-200 ease-linear md:flex",t==="left"?"left-0 group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)]":"right-0 group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)]",n==="floating"||n==="inset"?"p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4))+2px)]":"group-data-[collapsible=icon]:w-(--sidebar-width-icon) group-data-[side=left]:border-r group-data-[side=right]:border-l",s),...o,children:e.jsx("div",{"data-sidebar":"sidebar",className:"bg-sidebar group-data-[variant=floating]:border-sidebar-border flex h-full w-full flex-col group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:border group-data-[variant=floating]:shadow-sm",children:a})})]})}function Xr({className:t,onClick:n,...r}){const{toggleSidebar:s}=J();return e.jsxs(H,{"data-sidebar":"trigger","data-slot":"sidebar-trigger",variant:"ghost",size:"icon",className:_("h-7 w-7",t),onClick:a=>{n==null||n(a),s()},...r,children:[e.jsx(tr,{}),e.jsx("span",{className:"sr-only",children:"Toggle Sidebar"})]})}function Zr({className:t,...n}){return e.jsx("main",{"data-slot":"sidebar-inset",className:_("bg-background relative flex max-w-full min-h-svh flex-1 flex-col","peer-data-[variant=inset]:min-h-[calc(100svh-(--spacing(4)))] md:peer-data-[variant=inset]:m-2 md:peer-data-[variant=inset]:ml-0 md:peer-data-[variant=inset]:rounded-xl md:peer-data-[variant=inset]:shadow-sm md:peer-data-[variant=inset]:peer-data-[state=collapsed]:ml-0",t),...n})}function Qr({className:t,...n}){return e.jsx("div",{"data-slot":"sidebar-header","data-sidebar":"header",className:_("flex flex-col gap-2 p-2",t),...n})}function Jr({className:t,...n}){return e.jsx("div",{"data-slot":"sidebar-footer","data-sidebar":"footer",className:_("flex flex-col gap-2 p-2",t),...n})}function ea({className:t,...n}){return e.jsx("div",{"data-slot":"sidebar-content","data-sidebar":"content",className:_("flex min-h-0 flex-1 flex-col gap-1 overflow-auto group-data-[collapsible=icon]:overflow-y-auto hide-scrollbar",t),...n})}function O({className:t,...n}){return e.jsx("div",{"data-slot":"sidebar-group","data-sidebar":"group",className:_("relative flex w-full min-w-0 flex-col p-2",t),...n})}function F({className:t,asChild:n=!1,children:r,...s}){const a=n?ge:"div",{state:o}=J(),c=o==="collapsed",d=typeof r=="string"?(x=>x.split(" ").map(u=>{var p;return(p=u[0])==null?void 0:p.toUpperCase()}).join(""))(r):r;return e.jsx(a,{"data-slot":"sidebar-group-label","data-sidebar":"group-label",className:_("text-sidebar-foreground/70 ring-sidebar-ring flex h-8 shrink-0 items-center rounded-md px-2 text-xs font-medium outline-hidden transition-[margin,opacity] duration-200 ease-linear focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0",!c&&"group-data-[collapsible=icon]:-mt-8 group-data-[collapsible=icon]:opacity-0",t),...s,children:c&&typeof r=="string"?e.jsx(se,{children:e.jsxs(Ce,{children:[e.jsx(Ne,{asChild:!0,children:e.jsx("span",{children:d})}),e.jsx(Me,{side:"right",children:r})]})}):r})}function z({className:t,...n}){return e.jsx("div",{"data-slot":"sidebar-group-content","data-sidebar":"group-content",className:_("w-full text-sm",t),...n})}function L({className:t,...n}){return e.jsx("ul",{"data-slot":"sidebar-menu","data-sidebar":"menu",className:_("flex w-full min-w-0 flex-col gap-0",t),...n})}function N({className:t,...n}){return e.jsx("li",{"data-slot":"sidebar-menu-item","data-sidebar":"menu-item",className:_("group/menu-item relative",t),...n})}const ta=Xe("peer/menu-button flex w-full items-center gap-2 overflow-hidden rounded-md p-2 text-left text-sm outline-hidden ring-sidebar-ring transition-[width,height,padding] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 group-has-data-[sidebar=menu-action]/menu-item:pr-8 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-[active=true]:bg-sidebar-accent data-[active=true]:font-medium data-[active=true]:text-sidebar-accent-foreground data-[state=open]:hover:bg-sidebar-accent data-[state=open]:hover:text-sidebar-accent-foreground group-data-[collapsible=icon]:size-8! group-data-[collapsible=icon]:p-2! [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0",{variants:{variant:{default:"hover:bg-sidebar-accent hover:text-sidebar-accent-foreground",outline:"bg-background shadow-[0_0_0_1px_hsl(var(--sidebar-border))] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:shadow-[0_0_0_1px_hsl(var(--sidebar-accent))]"},size:{default:"h-8 text-sm",sm:"h-7 text-xs",lg:"h-12 text-sm group-data-[collapsible=icon]:p-0!"}},defaultVariants:{variant:"default",size:"default"}});function M({asChild:t=!1,isActive:n=!1,variant:r="default",size:s="default",tooltip:a,className:o,...c}){const h=t?ge:"button",{isMobile:d,state:x}=J(),u=e.jsx(h,{"data-slot":"sidebar-menu-button","data-sidebar":"menu-button","data-size":s,"data-active":n,className:_(ta({variant:r,size:s}),o),...c});return a?(typeof a=="string"&&(a={children:a}),e.jsxs(Ce,{children:[e.jsx(Ne,{asChild:!0,children:u}),e.jsx(Me,{side:"right",align:"center",hidden:x!=="collapsed"||d,...a})]})):u}function Ct({variant:t="header",children:n,...r}){return t==="sidebar"?e.jsx(Zr,{...r,children:n}):e.jsx("main",{className:"mx-auto flex h-full w-full max-w-7xl flex-1 flex-col gap-4 rounded-xl",...r,children:n})}function Nt({children:t,variant:n="header"}){const r=Y().props.sidebarOpen;return n==="header"?e.jsx("div",{className:"flex min-h-screen w-full flex-col",children:t}):e.jsx(qr,{defaultOpen:r,children:t})}function l(t){const{auth:n}=Y().props;return n.super?!0:t.some(r=>{if(r.startsWith("*-")){const s=r.slice(1);return Object.keys(n.permissions).some(a=>a.endsWith(s)&&n.permissions[a])}return n.permissions[r]===!0})}function na({url:t,setOpenMobile:n}){return e.jsxs(O,{children:[l(["dashboard-data"])&&e.jsx(F,{children:"Main"}),e.jsx(z,{children:e.jsx(L,{children:l(["dashboard-data"])&&e.jsx(N,{children:e.jsx(M,{asChild:!0,tooltip:"Dashboard",isActive:t.startsWith("/dashboard")&&!0,children:e.jsxs(j,{href:route("apps.dashboard"),onClick:()=>n(!1),children:[e.jsx(ht,{}),e.jsx("span",{children:"Dashboard"})]})})})})})]})}function Mt(){const{settings:t}=Y().props,n=t==null?void 0:t.find(o=>o.code==="NAME"),r=t==null?void 0:t.find(o=>o.code==="LOGO"),s=(n==null?void 0:n.value)??"My App",a=(r==null?void 0:r.value)??"Logo.jpg";return e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"flex aspect-square size-8 items-center justify-center rounded-md",children:e.jsx("img",{src:a,alt:s,className:"object-cover w-full h-full"})}),e.jsx("div",{className:"ml-1 grid flex-1 text-left text-sm",children:e.jsx("span",{className:"mb-0.5 truncate leading-none font-semibold",children:s})})]})}function ra({url:t,setOpenMobile:n}){return e.jsxs(O,{children:[(l(["permissions-data"])||l(["users-data"])||l(["roles-data"]))&&e.jsx(F,{children:"User Management"}),e.jsx(z,{children:e.jsxs(L,{children:[l(["roles-data"])&&e.jsx(N,{children:e.jsx(M,{asChild:!0,tooltip:"Permissions",isActive:t.startsWith("/apps/permissions")&&!0,children:e.jsxs(j,{href:route("apps.permissions.index"),onClick:()=>n(!1),children:[e.jsx(pt,{}),e.jsx("span",{children:"Permissions"})]})})}),l(["permissions-data"])&&e.jsx(N,{children:e.jsx(M,{asChild:!0,tooltip:"Roles",isActive:t.startsWith("/apps/roles")&&!0,children:e.jsxs(j,{href:route("apps.roles.index"),onClick:()=>n(!1),children:[e.jsx(hr,{}),e.jsx("span",{children:"Roles"})]})})}),l(["users-data"])&&e.jsx(N,{children:e.jsx(M,{asChild:!0,tooltip:"Users",isActive:t.startsWith("/apps/users")&&!0,children:e.jsxs(j,{href:route("apps.users.index"),onClick:()=>n(!1),children:[e.jsx(xr,{}),e.jsx("span",{children:"Users"})]})})})]})})]})}function aa({url:t,setOpenMobile:n}){return e.jsxs(O,{children:[(l(["units-data"])||l(["suppliers-data"])||l(["tables-data"])||l(["customers-data"]))&&e.jsx(F,{children:"Master Data"}),e.jsx(z,{children:e.jsxs(L,{children:[l(["units-data"])&&e.jsx(N,{children:e.jsx(M,{asChild:!0,tooltip:"Satuan",isActive:t.startsWith("/units")&&!0,children:e.jsxs(j,{href:route("apps.units.index"),onClick:()=>n(!1),children:[e.jsx(lt,{}),e.jsx("span",{children:"Satuan"})]})})}),l(["suppliers-data"])&&e.jsx(N,{children:e.jsx(M,{asChild:!0,tooltip:"Supplier",isActive:t.startsWith("/suppliers")&&!0,children:e.jsxs(j,{href:route("apps.suppliers.index"),onClick:()=>n(!1),children:[e.jsx(dn,{}),e.jsx("span",{children:"Supplier"})]})})}),l(["tables-data"])&&e.jsx(N,{children:e.jsx(M,{asChild:!0,tooltip:"Meja",isActive:t.startsWith("/tables")&&!0,children:e.jsxs(j,{href:route("apps.tables.index"),onClick:()=>n(!1),children:[e.jsx(Kn,{}),e.jsx("span",{children:"Meja"})]})})}),l(["customers-data"])&&e.jsx(N,{children:e.jsx(M,{asChild:!0,tooltip:"Pelanggan",isActive:t.startsWith("/customers")&&!0,children:e.jsxs(j,{href:route("apps.customers.index"),onClick:()=>n(!1),children:[e.jsx(_n,{}),e.jsx("span",{children:"Pelanggan"})]})})})]})})]})}function sa({url:t,setOpenMobile:n}){return e.jsxs(O,{children:[(l(["materials-data"])||l(["categories-data"])||l(["menus-data"])||l(["products-data"]))&&e.jsx(F,{children:"Menu & Inventory"}),e.jsx(z,{children:e.jsxs(L,{children:[l(["categories-data"])&&e.jsx(N,{children:e.jsx(M,{asChild:!0,tooltip:"Categories",isActive:t.startsWith("/categories")&&!0,children:e.jsxs(j,{href:route("apps.categories.index"),onClick:()=>n(!1),children:[e.jsx(ut,{}),e.jsx("span",{children:"Kategori"})]})})}),l(["materials-data"])&&e.jsx(N,{children:e.jsx(M,{asChild:!0,tooltip:"Ingredients",isActive:t.startsWith("/materials")&&!0,children:e.jsxs(j,{href:route("apps.materials.index"),onClick:()=>n(!1),children:[e.jsx(lt,{}),e.jsx("span",{children:"Bahan Baku"})]})})}),l(["menus-data"])&&e.jsx(N,{children:e.jsx(M,{asChild:!0,tooltip:"Menus",isActive:t.startsWith("/menus")&&!0,children:e.jsxs(j,{href:route("apps.menus.index"),onClick:()=>n(!1),children:[e.jsx(Zn,{}),e.jsx("span",{children:"Menu Resep"})]})})}),l(["products-data"])&&e.jsx(N,{children:e.jsx(M,{asChild:!0,tooltip:"Products",isActive:t.startsWith("/products")&&!0,children:e.jsxs(j,{href:route("apps.products.index"),onClick:()=>n(!1),children:[e.jsx(pn,{}),e.jsx("span",{children:"Produk"})]})})})]})})]})}function oa({url:t,setOpenMobile:n}){return e.jsxs(e.Fragment,{children:[e.jsxs(O,{children:[(l(["transactions-data"])||l(["transaction-kitchens-data"])||l(["transactions-data"])||l(["purhcase-returns-data"]))&&e.jsx(F,{children:"Penjualan"}),e.jsx(z,{children:e.jsxs(L,{children:[l(["pos-data"])&&e.jsx(N,{children:e.jsx(M,{asChild:!0,tooltip:"pos",isActive:t.startsWith("/pos")&&!0,children:e.jsxs(j,{href:route("apps.pos.index"),onClick:()=>n(!1),children:[e.jsx(st,{}),e.jsx("span",{children:"Kasir"})]})})}),l(["transaction-kitchens-data"])&&e.jsx(N,{children:e.jsx(M,{asChild:!0,tooltip:"Dapur",isActive:t.startsWith("/kitchen")&&!0,children:e.jsxs(j,{href:route("apps.kitchen.index"),onClick:()=>n(!1),children:[e.jsx(dt,{}),e.jsx("span",{children:"Dapur"})]})})}),l(["transactions-data"])&&e.jsx(N,{children:e.jsx(M,{asChild:!0,tooltip:"Penjualan",isActive:t.startsWith("/transactions"),children:e.jsxs(j,{href:route("apps.transactions.index"),onClick:()=>n(!1),children:[e.jsx(ze,{}),e.jsx("span",{children:"Penjualan"})]})})}),l(["transaction-returns-data"])&&e.jsx(N,{children:e.jsx(M,{asChild:!0,tooltip:"Retur Penjualan",isActive:t.startsWith("/transaction-returns"),children:e.jsxs(j,{href:route("apps.transaction-returns.index"),onClick:()=>n(!1),children:[e.jsx(He,{}),e.jsx("span",{children:"Retur Penjualan"})]})})})]})})]}),e.jsxs(O,{children:[l(["orders-data"])&&e.jsx(F,{children:"Pembelian"}),e.jsx(z,{children:e.jsxs(L,{children:[l(["orders-data"])&&e.jsx(N,{children:e.jsx(M,{asChild:!0,tooltip:"Pembelian",isActive:t.startsWith("/orders"),children:e.jsxs(j,{href:route("apps.orders.index"),onClick:()=>n(!1),children:[e.jsx(ze,{}),e.jsx("span",{children:"Pembelian"})]})})}),l(["purchase-returns-data"])&&e.jsx(N,{children:e.jsx(M,{asChild:!0,tooltip:"Retur Pembelian",isActive:t.startsWith("/purchase-returns"),children:e.jsxs(j,{href:route("apps.purchase-returns.index"),onClick:()=>n(!1),children:[e.jsx(He,{}),e.jsx("span",{children:"Retur Pembelian"})]})})})]})})]})]})}function ia({url:t,setOpenMobile:n}){return e.jsxs(O,{children:[l(["checking-stocks-data"])&&e.jsx(F,{children:"Stock Management"}),e.jsx(z,{children:e.jsx(L,{children:l(["checking-stocks-data"])&&e.jsx(N,{children:e.jsx(M,{asChild:!0,tooltip:"Stok Opname",isActive:t.startsWith("/checking-stocks")&&!0,children:e.jsxs(j,{href:route("apps.checking-stocks.index"),onClick:()=>n(!1),children:[e.jsx(gr,{}),e.jsx("span",{children:"Stok Opname"})]})})})})})]})}function ca({url:t,setOpenMobile:n}){return e.jsxs(O,{children:[(l(["expense-categories-data"])||l(["expense-subcategories-data"])||l(["expenses-data"]))&&e.jsx(F,{children:"Operasional"}),e.jsx(z,{children:e.jsxs(L,{children:[l(["expense-categories-data"])&&e.jsx(N,{children:e.jsx(M,{asChild:!0,tooltip:"Kategori Pengeluaran",isActive:t.startsWith("/expense-categories"),children:e.jsxs(j,{href:route("apps.expense-categories.index"),onClick:()=>n(!1),children:[e.jsx(sr,{}),e.jsx("span",{children:"Kategori Pengeluaran"})]})})}),l(["expense-subcategories-data"])&&e.jsx(N,{children:e.jsx(M,{asChild:!0,tooltip:"Subkategori Pengeluaran",isActive:t.startsWith("/expense-subcategories"),children:e.jsxs(j,{href:route("apps.expense-subcategories.index"),onClick:()=>n(!1),children:[e.jsx(ir,{}),e.jsx("span",{children:"Subkategori Pengeluaran"})]})})}),l(["expenses-data"])&&e.jsx(N,{children:e.jsx(M,{asChild:!0,tooltip:"Pengeluaran",isActive:t.startsWith("/expenses"),children:e.jsxs(j,{href:route("apps.expenses.index"),onClick:()=>n(!1),children:[e.jsx(vr,{}),e.jsx("span",{children:"Pengeluaran"})]})})})]})})]})}function la({url:t,setOpenMobile:n}){return e.jsxs(O,{children:[(l(["coupons-data"])||l(["discount-packages-data"])||l(["discount-products-data"]))&&e.jsx(F,{children:"Master Promo"}),e.jsx(z,{children:e.jsxs(L,{children:[l(["coupons-data"])&&e.jsx(N,{children:e.jsx(M,{asChild:!0,tooltip:"Diskon",isActive:t.startsWith("/coupons")&&!0,children:e.jsxs(j,{href:route("apps.coupons.index"),onClick:()=>n(!1),children:[e.jsx(un,{}),e.jsx("span",{children:"Diskon Voucher"})]})})}),l(["discount-packages-data"])&&e.jsx(N,{children:e.jsx(M,{asChild:!0,tooltip:"Diskon Paket",isActive:t.startsWith("/discount-packages")&&!0,children:e.jsxs(j,{href:route("apps.discount-packages.index"),onClick:()=>n(!1),children:[e.jsx(rr,{}),e.jsx("span",{children:"Diskon Paket"})]})})}),l(["discount-products-data"])&&e.jsx(N,{children:e.jsx(M,{asChild:!0,tooltip:"Diskon Produk",isActive:t.startsWith("/discount-products")&&!0,children:e.jsxs(j,{href:route("apps.discount-products.index"),onClick:()=>n(!1),children:[e.jsx(Jn,{}),e.jsx("span",{children:"Diskon Produk"})]})})})]})})]})}function da({url:t,setOpenMobile:n}){return e.jsxs(O,{children:[l(["report-cash-flow"])&&e.jsx(F,{children:"Laporan"}),e.jsx(z,{children:e.jsxs(L,{children:[(l(["report-cash-flow"])||l(["report-purchase"])||l(["report-sale"])||l(["report-stock"])||l(["report-audit-logs"]))&&e.jsx(N,{children:e.jsx(M,{asChild:!0,tooltip:"Laporan Arus Kas",isActive:t.startsWith("/reports/cash-flow"),children:e.jsxs(j,{href:route("apps.reports.cash-flows"),onClick:()=>n(!1),children:[e.jsx(lr,{}),e.jsx("span",{children:"Laporan Arus Kas"})]})})}),l(["report-purchase"])&&e.jsx(N,{children:e.jsx(M,{asChild:!0,tooltip:"Laporan Pembelian",isActive:t.startsWith("/reports/purchase"),children:e.jsxs(j,{href:route("apps.reports.purchases"),onClick:()=>n(!1),children:[e.jsx(Fn,{}),e.jsx("span",{children:"Laporan Pembelian"})]})})}),l(["report-sale"])&&e.jsx(N,{children:e.jsx(M,{asChild:!0,tooltip:"Laporan Penjualan",isActive:t.startsWith("/reports/sale"),children:e.jsxs(j,{href:route("apps.reports.sales"),onClick:()=>n(!1),children:[e.jsx(Dn,{}),e.jsx("span",{children:"Laporan Penjualan"})]})})}),l(["report-stock"])&&e.jsx(N,{children:e.jsx(M,{asChild:!0,tooltip:"Laporan Sisa Stok",isActive:t.startsWith("/reports/stock"),children:e.jsxs(j,{href:route("apps.reports.stocks"),onClick:()=>n(!1),children:[e.jsx(An,{}),e.jsx("span",{children:"Laporan Sisa Stok"})]})})}),l(["report-card-stock"])&&e.jsx(N,{children:e.jsx(M,{asChild:!0,tooltip:"Laporan Kartu Stok",isActive:t.startsWith("/reports/card-stock"),children:e.jsxs(j,{href:route("apps.reports.card-stocks"),onClick:()=>n(!1),children:[e.jsx(Sn,{}),e.jsx("span",{children:"Laporan Kartu Stok"})]})})}),l(["report-profit-loss"])&&e.jsx(N,{children:e.jsx(M,{asChild:!0,tooltip:"Laporan Laba Rugi",isActive:t.startsWith("/reports/profit-loss"),children:e.jsxs(j,{href:route("apps.reports.profit-loss"),onClick:()=>n(!1),children:[e.jsx(In,{}),e.jsx("span",{children:"Laporan Laba Rugi"})]})})}),l(["report-audit-logs"])&&e.jsx(N,{children:e.jsx(M,{asChild:!0,tooltip:"Laporan Audit Log",isActive:t.startsWith("/audit-logs"),children:e.jsxs(j,{href:route("apps.audit-logs.index"),onClick:()=>n(!1),children:[e.jsx(Un,{}),e.jsx("span",{children:"Laporan Audit Log"})]})})})]})})]})}function ua(){const{url:t}=Y(),{setOpenMobile:n}=J();return e.jsxs(Yr,{collapsible:"icon",variant:"sidebar",children:[e.jsx(Qr,{children:e.jsx(L,{children:e.jsx(N,{children:e.jsx(M,{size:"lg",asChild:!0,children:e.jsx(j,{href:"/dashboard",prefetch:!0,children:e.jsx(Mt,{})})})})})}),e.jsxs(ea,{children:[l(["dashboard-data"])&&e.jsx(na,{url:t,setOpenMobile:n}),(l(["units-data"])||l(["suppliers-data"])||l(["tables-data"])||l(["customers-data"]))&&e.jsx(aa,{url:t,setOpenMobile:n}),(l(["materials-data"])||l(["categories-data"])||l(["menus-data"])||l(["products-data"]))&&e.jsx(sa,{url:t,setOpenMobile:n}),(l(["coupons-data"])||l(["discount-packages-data"])||l(["discount-products-data"]))&&e.jsx(la,{url:t,setOpenMobile:n}),l(["checking-stocks-data"])&&e.jsx(ia,{url:t,setOpenMobile:n}),(l(["transactions-data"])||l(["pos-data"])||l(["transaction-kitchens-data"])||l(["purchase-returns-data"]))&&e.jsx(oa,{url:t,setOpenMobile:n}),(l(["expense-categories-data"])||l(["expense-subcategories-data"])||l(["expeses-data"]))&&e.jsx(ca,{url:t,setOpenMobile:n}),(l(["report-cash-flow"])||l(["report-purchase"])||l(["report-sale"])||l(["report-stock"])||l(["report-card-stock"])||l(["report-profit-loss"]))&&e.jsx(da,{url:t,setOpenMobile:n}),(l(["roles-data"])||l(["permissions-data"])||l(["users-data"]))&&e.jsx(ra,{url:t,setOpenMobile:n})]}),(l(["setting-data"])||l(["settings-bank"])||l(["settings-shifts"])||l(["settings-setting"])||l(["settings-loyalty"]))&&e.jsx(Jr,{children:e.jsx(L,{children:e.jsx(N,{children:e.jsx(M,{asChild:!0,tooltip:"Laporan Arus Kas",isActive:t.startsWith("/reports/cash-flow"),children:e.jsxs(j,{className:"block w-full",href:route("apps.setting-stores.index"),as:"button",children:[e.jsx(fn,{className:"mr-2"}),"Pengaturan Toko"]})})})})})]})}function ha({...t}){return e.jsx("nav",{"aria-label":"breadcrumb","data-slot":"breadcrumb",...t})}function pa({className:t,...n}){return e.jsx("ol",{"data-slot":"breadcrumb-list",className:_("text-muted-foreground flex flex-wrap items-center gap-1.5 text-sm break-words sm:gap-2.5",t),...n})}function xa({className:t,...n}){return e.jsx("li",{"data-slot":"breadcrumb-item",className:_("inline-flex items-center gap-1.5",t),...n})}function fa({asChild:t,className:n,...r}){const s=t?ge:"a";return e.jsx(s,{"data-slot":"breadcrumb-link",className:_("hover:text-foreground transition-colors",n),...r})}function va({className:t,...n}){return e.jsx("span",{"data-slot":"breadcrumb-page",role:"link","aria-disabled":"true","aria-current":"page",className:_("text-foreground font-normal",t),...n})}function ma({children:t,className:n,...r}){return e.jsx("li",{"data-slot":"breadcrumb-separator",role:"presentation","aria-hidden":"true",className:_("[&>svg]:size-3.5",n),...r,children:t??e.jsx(cn,{})})}function he({breadcrumbs:t}){return e.jsx(e.Fragment,{children:t.length>0&&e.jsx(ha,{children:e.jsx(pa,{children:t.map((n,r)=>{const s=r===t.length-1;return e.jsxs(i.Fragment,{children:[e.jsx(xa,{children:s?e.jsx(va,{children:n.title}):e.jsx(fa,{asChild:!0,children:e.jsx(j,{href:n.href,children:n.title})})}),!s&&e.jsx(ma,{})]},r)})})})})}var ce={exports:{}},le={};/**
 * @license React
 * use-sync-external-store-shim.production.js
 *
 * Copyright (c) Meta Platforms, Inc. and affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */var Be;function ga(){if(Be)return le;Be=1;var t=Yt();function n(p,f){return p===f&&(p!==0||1/p===1/f)||p!==p&&f!==f}var r=typeof Object.is=="function"?Object.is:n,s=t.useState,a=t.useEffect,o=t.useLayoutEffect,c=t.useDebugValue;function h(p,f){var v=f(),g=s({inst:{value:v,getSnapshot:f}}),m=g[0].inst,b=g[1];return o(function(){m.value=v,m.getSnapshot=f,d(m)&&b({inst:m})},[p,v,f]),a(function(){return d(m)&&b({inst:m}),p(function(){d(m)&&b({inst:m})})},[p]),c(v),v}function d(p){var f=p.getSnapshot;p=p.value;try{var v=f();return!r(p,v)}catch{return!0}}function x(p,f){return f()}var u=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?x:h;return le.useSyncExternalStore=t.useSyncExternalStore!==void 0?t.useSyncExternalStore:u,le}var Ke;function ja(){return Ke||(Ke=1,ce.exports=ga()),ce.exports}var ba=ja();function ya(){return ba.useSyncExternalStore(wa,()=>!0,()=>!1)}function wa(){return()=>{}}var _e="Avatar",[ka,_s]=je(_e),[Ca,_t]=ka(_e),Et=i.forwardRef((t,n)=>{const{__scopeAvatar:r,...s}=t,[a,o]=i.useState("idle");return e.jsx(Ca,{scope:r,imageLoadingStatus:a,onImageLoadingStatusChange:o,children:e.jsx(I.span,{...s,ref:n})})});Et.displayName=_e;var Tt="AvatarImage",St=i.forwardRef((t,n)=>{const{__scopeAvatar:r,src:s,onLoadingStatusChange:a=()=>{},...o}=t,c=_t(Tt,r),h=Na(s,o),d=W(x=>{a(x),c.onImageLoadingStatusChange(x)});return U(()=>{h!=="idle"&&d(h)},[h,d]),h==="loaded"?e.jsx(I.img,{...o,ref:n,src:s}):null});St.displayName=Tt;var Rt="AvatarFallback",At=i.forwardRef((t,n)=>{const{__scopeAvatar:r,delayMs:s,...a}=t,o=_t(Rt,r),[c,h]=i.useState(s===void 0);return i.useEffect(()=>{if(s!==void 0){const d=window.setTimeout(()=>h(!0),s);return()=>window.clearTimeout(d)}},[s]),c&&o.imageLoadingStatus!=="loaded"?e.jsx(I.span,{...a,ref:n}):null});At.displayName=Rt;function Ve(t,n){return t?n?(t.src!==n&&(t.src=n),t.complete&&t.naturalWidth>0?"loaded":"loading"):"error":"idle"}function Na(t,{referrerPolicy:n,crossOrigin:r}){const s=ya(),a=i.useRef(null),o=s?(a.current||(a.current=new window.Image),a.current):null,[c,h]=i.useState(()=>Ve(o,t));return U(()=>{h(Ve(o,t))},[o,t]),U(()=>{const d=p=>()=>{h(p)};if(!o)return;const x=d("loaded"),u=d("error");return o.addEventListener("load",x),o.addEventListener("error",u),n&&(o.referrerPolicy=n),typeof r=="string"&&(o.crossOrigin=r),()=>{o.removeEventListener("load",x),o.removeEventListener("error",u)}},[o,r,n]),c}var Ma=Et,_a=St,Ea=At;function Ee({className:t,...n}){return e.jsx(Ma,{"data-slot":"avatar",className:_("relative flex size-8 shrink-0 overflow-hidden rounded-full",t),...n})}function Te({className:t,...n}){return e.jsx(_a,{"data-slot":"avatar-image",className:_("aspect-square size-full",t),...n})}function Se({className:t,...n}){return e.jsx(Ea,{"data-slot":"avatar-fallback",className:_("bg-muted flex size-full items-center justify-center rounded-full",t),...n})}function Re(){return i.useCallback(n=>{const r=n.trim().split(" ");if(r.length===0)return"";if(r.length===1)return r[0].charAt(0).toUpperCase();const s=r[0].charAt(0),a=r[r.length-1].charAt(0);return`${s}${a}`.toUpperCase()},[])}function Ta({user:t,showEmail:n=!1}){const r=Re();return e.jsxs(e.Fragment,{children:[e.jsxs(Ee,{className:"h-8 w-8 overflow-hidden rounded-full",children:[e.jsx(Te,{src:t.avatar,alt:t.name}),e.jsx(Se,{className:"rounded-lg bg-neutral-200 text-black dark:bg-neutral-700 dark:text-white",children:r(t.name)})]}),e.jsxs("div",{className:"grid flex-1 text-left text-sm leading-tight",children:[e.jsx("span",{className:"truncate font-medium",children:t.name}),n&&e.jsx("span",{className:"text-muted-foreground truncate text-xs",children:t.email})]})]})}function Sa(){return i.useCallback(()=>{document.body.style.removeProperty("pointer-events")},[])}function Pt({user:t}){const n=Sa();return e.jsxs(e.Fragment,{children:[e.jsx(mn,{className:"p-0 font-normal",children:e.jsx("div",{className:"flex items-center gap-2 px-1 py-1.5 text-left text-sm",children:e.jsx(Ta,{user:t,showEmail:!0})})}),e.jsx($e,{}),e.jsx(gn,{children:e.jsx(We,{asChild:!0,children:e.jsxs(j,{className:"block w-full",href:route("profile.edit"),as:"button",prefetch:!0,onClick:n,children:[e.jsx(pt,{className:"mr-2"}),"Profile"]})})}),e.jsx($e,{}),e.jsx(We,{asChild:!0,children:e.jsxs(j,{className:"block w-full",method:"post",href:route("logout"),as:"button",onClick:n,children:[e.jsx(xn,{className:"mr-2"}),"Log out"]})})]})}function Ra(){const{isBluetoothConnected:t,connectBluetoothPrinter:n}=jn(),r=Y(),{auth:s}=r.props,a=Re();return e.jsxs("div",{className:"flex items-center gap-2 ml-auto",children:[e.jsx("div",{className:"flex items-center gap-2",children:e.jsx(H,{variant:"ghost",size:"icon",className:`border rounded-md ${t?"bg-green-500 hover:bg-green-600 text-white":"bg-red-500 hover:bg-red-600 text-white"}`,onClick:n,title:t?"Bluetooth Terhubung":"Hubungkan Printer",children:e.jsx(bn,{className:"w-5 h-5"})})}),e.jsxs("div",{className:"flex items-center overflow-hidden rounded-full border",children:[l(["pos-data"])&&e.jsx(j,{href:route("apps.pos.index"),children:e.jsxs(H,{variant:"ghost",size:"sm",className:"flex items-center gap-2 rounded-none px-3 py-1",children:[e.jsx(st,{className:"w-4 h-4"}),e.jsx("span",{className:"text-sm font-medium",children:"POS"})]})}),l(["transaction-kitchens-data"])&&e.jsx(j,{href:route("apps.kitchen.index"),children:e.jsxs(H,{variant:"ghost",size:"sm",className:"flex items-center gap-2 rounded-none px-3 py-1",children:[e.jsx(dt,{className:"w-4 h-4"}),e.jsx("span",{className:"text-sm font-medium",children:"Dapur"})]})})]}),e.jsxs(ot,{children:[e.jsx(it,{asChild:!0,children:e.jsx(H,{variant:"ghost",className:"size-10 rounded-full p-1",children:e.jsxs(Ee,{className:"size-8 overflow-hidden rounded-full",children:[e.jsx(Te,{src:s.user.avatar,alt:s.user.name}),e.jsx(Se,{className:"rounded-lg bg-neutral-200 text-black dark:bg-neutral-700 dark:text-white",children:a(s.user.name)})]})})}),e.jsx(ct,{className:"w-56",align:"end",children:e.jsx(Pt,{user:s.user})})]})]})}function Aa({breadcrumbs:t=[]}){return e.jsxs(e.Fragment,{children:[e.jsxs("header",{className:"border-sidebar-border/50 flex h-16 shrink-0 items-center justify-between gap-2 border-b px-6 transition-[width,height] ease-linear group-has-data-[collapsible=icon]/sidebar-wrapper:h-12 md:px-4 bg-sidebar",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Xr,{className:"-ml-1"}),e.jsx("div",{className:"hidden md:block",children:e.jsx(he,{breadcrumbs:t})})]}),e.jsx(Ra,{})]}),e.jsx("div",{className:"block border-b border-sidebar-border/50 px-6 py-2 md:hidden",children:e.jsx(he,{breadcrumbs:t})})]})}function Pa({children:t,breadcrumbs:n=[]}){return e.jsxs(Nt,{variant:"sidebar",children:[e.jsx(ua,{}),e.jsxs(Ct,{variant:"sidebar",children:[e.jsx(Aa,{breadcrumbs:n}),t]})]})}function ee({iconNode:t,className:n,...r}){return e.jsx(t,{className:_("h-4 w-4",n),...r})}var V="NavigationMenu",[Ae,It,Ia]=rt(V),[pe,La,Da]=rt(V),[Pe,Es]=je(V,[Ia,Da]),[Oa,D]=Pe(V),[Fa,za]=Pe(V),Lt=i.forwardRef((t,n)=>{const{__scopeNavigationMenu:r,value:s,onValueChange:a,defaultValue:o,delayDuration:c=200,skipDelayDuration:h=300,orientation:d="horizontal",dir:x,...u}=t,[p,f]=i.useState(null),v=K(n,S=>f(S)),g=sn(x),m=i.useRef(0),b=i.useRef(0),w=i.useRef(0),[E,k]=i.useState(!0),[C,y]=ye({prop:s,onChange:S=>{const B=S!=="",oe=h>0;B?(window.clearTimeout(w.current),oe&&k(!1)):(window.clearTimeout(w.current),w.current=window.setTimeout(()=>k(!0),h)),a==null||a(S)},defaultProp:o??"",caller:V}),R=i.useCallback(()=>{window.clearTimeout(b.current),b.current=window.setTimeout(()=>y(""),150)},[y]),P=i.useCallback(S=>{window.clearTimeout(b.current),y(S)},[y]),$=i.useCallback(S=>{C===S?window.clearTimeout(b.current):m.current=window.setTimeout(()=>{window.clearTimeout(b.current),y(S)},c)},[C,y,c]);return i.useEffect(()=>()=>{window.clearTimeout(m.current),window.clearTimeout(b.current),window.clearTimeout(w.current)},[]),e.jsx(Dt,{scope:r,isRootMenu:!0,value:C,dir:g,orientation:d,rootNavigationMenu:p,onTriggerEnter:S=>{window.clearTimeout(m.current),E?$(S):P(S)},onTriggerLeave:()=>{window.clearTimeout(m.current),R()},onContentEnter:()=>window.clearTimeout(b.current),onContentLeave:R,onItemSelect:S=>{y(B=>B===S?"":S)},onItemDismiss:()=>y(""),children:e.jsx(I.nav,{"aria-label":"Main","data-orientation":d,dir:g,...u,ref:v})})});Lt.displayName=V;var xe="NavigationMenuSub",$a=i.forwardRef((t,n)=>{const{__scopeNavigationMenu:r,value:s,onValueChange:a,defaultValue:o,orientation:c="horizontal",...h}=t,d=D(xe,r),[x,u]=ye({prop:s,onChange:a,defaultProp:o??"",caller:xe});return e.jsx(Dt,{scope:r,isRootMenu:!1,value:x,dir:d.dir,orientation:c,rootNavigationMenu:d.rootNavigationMenu,onTriggerEnter:p=>u(p),onItemSelect:p=>u(p),onItemDismiss:()=>u(""),children:e.jsx(I.div,{"data-orientation":c,...h,ref:n})})});$a.displayName=xe;var Dt=t=>{const{scope:n,isRootMenu:r,rootNavigationMenu:s,dir:a,orientation:o,children:c,value:h,onItemSelect:d,onItemDismiss:x,onTriggerEnter:u,onTriggerLeave:p,onContentEnter:f,onContentLeave:v}=t,[g,m]=i.useState(null),[b,w]=i.useState(new Map),[E,k]=i.useState(null);return e.jsx(Oa,{scope:n,isRootMenu:r,rootNavigationMenu:s,value:h,previousValue:ln(h),baseId:be(),dir:a,orientation:o,viewport:g,onViewportChange:m,indicatorTrack:E,onIndicatorTrackChange:k,onTriggerEnter:W(u),onTriggerLeave:W(p),onContentEnter:W(f),onContentLeave:W(v),onItemSelect:W(d),onItemDismiss:W(x),onViewportContentChange:i.useCallback((C,y)=>{w(R=>(R.set(C,y),new Map(R)))},[]),onViewportContentRemove:i.useCallback(C=>{w(y=>y.has(C)?(y.delete(C),new Map(y)):y)},[]),children:e.jsx(Ae.Provider,{scope:n,children:e.jsx(Fa,{scope:n,items:b,children:c})})})},Ot="NavigationMenuList",Ft=i.forwardRef((t,n)=>{const{__scopeNavigationMenu:r,...s}=t,a=D(Ot,r),o=e.jsx(I.ul,{"data-orientation":a.orientation,...s,ref:n});return e.jsx(I.div,{style:{position:"relative"},ref:a.onIndicatorTrackChange,children:e.jsx(Ae.Slot,{scope:r,children:a.isRootMenu?e.jsx(Kt,{asChild:!0,children:o}):o})})});Ft.displayName=Ot;var zt="NavigationMenuItem",[Wa,$t]=Pe(zt),Wt=i.forwardRef((t,n)=>{const{__scopeNavigationMenu:r,value:s,...a}=t,o=be(),c=s||o||"LEGACY_REACT_AUTO_VALUE",h=i.useRef(null),d=i.useRef(null),x=i.useRef(null),u=i.useRef(()=>{}),p=i.useRef(!1),f=i.useCallback((g="start")=>{if(h.current){u.current();const m=ve(h.current);m.length&&De(g==="start"?m:m.reverse())}},[]),v=i.useCallback(()=>{if(h.current){const g=ve(h.current);g.length&&(u.current=Qa(g))}},[]);return e.jsx(Wa,{scope:r,value:c,triggerRef:d,contentRef:h,focusProxyRef:x,wasEscapeCloseRef:p,onEntryKeyDown:f,onFocusProxyEnter:f,onRootContentClose:v,onContentFocusOutside:v,children:e.jsx(I.li,{...a,ref:n})})});Wt.displayName=zt;var fe="NavigationMenuTrigger",Ha=i.forwardRef((t,n)=>{const{__scopeNavigationMenu:r,disabled:s,...a}=t,o=D(fe,t.__scopeNavigationMenu),c=$t(fe,t.__scopeNavigationMenu),h=i.useRef(null),d=K(h,c.triggerRef,n),x=Ut(o.baseId,c.value),u=Gt(o.baseId,c.value),p=i.useRef(!1),f=i.useRef(!1),v=c.value===o.value;return e.jsxs(e.Fragment,{children:[e.jsx(Ae.ItemSlot,{scope:r,value:c.value,children:e.jsx(Vt,{asChild:!0,children:e.jsx(I.button,{id:x,disabled:s,"data-disabled":s?"":void 0,"data-state":Oe(v),"aria-expanded":v,"aria-controls":u,...a,ref:d,onPointerEnter:A(t.onPointerEnter,()=>{f.current=!1,c.wasEscapeCloseRef.current=!1}),onPointerMove:A(t.onPointerMove,ne(()=>{s||f.current||c.wasEscapeCloseRef.current||p.current||(o.onTriggerEnter(c.value),p.current=!0)})),onPointerLeave:A(t.onPointerLeave,ne(()=>{s||(o.onTriggerLeave(),p.current=!1)})),onClick:A(t.onClick,()=>{o.onItemSelect(c.value),f.current=v}),onKeyDown:A(t.onKeyDown,g=>{const b={horizontal:"ArrowDown",vertical:o.dir==="rtl"?"ArrowLeft":"ArrowRight"}[o.orientation];v&&g.key===b&&(c.onEntryKeyDown(),g.preventDefault())})})})}),v&&e.jsxs(e.Fragment,{children:[e.jsx(at,{"aria-hidden":!0,tabIndex:0,ref:c.focusProxyRef,onFocus:g=>{const m=c.contentRef.current,b=g.relatedTarget,w=b===h.current,E=m==null?void 0:m.contains(b);(w||!E)&&c.onFocusProxyEnter(w?"start":"end")}}),o.viewport&&e.jsx("span",{"aria-owns":u})]})]})});Ha.displayName=fe;var Ba="NavigationMenuLink",Ue="navigationMenu.linkSelect",Ka=i.forwardRef((t,n)=>{const{__scopeNavigationMenu:r,active:s,onSelect:a,...o}=t;return e.jsx(Vt,{asChild:!0,children:e.jsx(I.a,{"data-active":s?"":void 0,"aria-current":s?"page":void 0,...o,ref:n,onClick:A(t.onClick,c=>{const h=c.target,d=new CustomEvent(Ue,{bubbles:!0,cancelable:!0});if(h.addEventListener(Ue,x=>a==null?void 0:a(x),{once:!0}),Fe(h,d),!d.defaultPrevented&&!c.metaKey){const x=new CustomEvent(te,{bubbles:!0,cancelable:!0});Fe(h,x)}},{checkForDefaultPrevented:!1})})})});Ka.displayName=Ba;var Ie="NavigationMenuIndicator",Va=i.forwardRef((t,n)=>{const{forceMount:r,...s}=t,a=D(Ie,t.__scopeNavigationMenu),o=!!a.value;return a.indicatorTrack?on.createPortal(e.jsx(X,{present:r||o,children:e.jsx(Ua,{...s,ref:n})}),a.indicatorTrack):null});Va.displayName=Ie;var Ua=i.forwardRef((t,n)=>{const{__scopeNavigationMenu:r,...s}=t,a=D(Ie,r),o=It(r),[c,h]=i.useState(null),[d,x]=i.useState(null),u=a.orientation==="horizontal",p=!!a.value;i.useEffect(()=>{var m;const g=(m=o().find(b=>b.value===a.value))==null?void 0:m.ref.current;g&&h(g)},[o,a.value]);const f=()=>{c&&x({size:u?c.offsetWidth:c.offsetHeight,offset:u?c.offsetLeft:c.offsetTop})};return me(c,f),me(a.indicatorTrack,f),d?e.jsx(I.div,{"aria-hidden":!0,"data-state":p?"visible":"hidden","data-orientation":a.orientation,...s,ref:n,style:{position:"absolute",...u?{left:0,width:d.size+"px",transform:`translateX(${d.offset}px)`}:{top:0,height:d.size+"px",transform:`translateY(${d.offset}px)`},...s.style}}):null}),q="NavigationMenuContent",Ga=i.forwardRef((t,n)=>{const{forceMount:r,...s}=t,a=D(q,t.__scopeNavigationMenu),o=$t(q,t.__scopeNavigationMenu),c=K(o.contentRef,n),h=o.value===a.value,d={value:o.value,triggerRef:o.triggerRef,focusProxyRef:o.focusProxyRef,wasEscapeCloseRef:o.wasEscapeCloseRef,onContentFocusOutside:o.onContentFocusOutside,onRootContentClose:o.onRootContentClose,...s};return a.viewport?e.jsx(qa,{forceMount:r,...d,ref:c}):e.jsx(X,{present:r||h,children:e.jsx(Ht,{"data-state":Oe(h),...d,ref:c,onPointerEnter:A(t.onPointerEnter,a.onContentEnter),onPointerLeave:A(t.onPointerLeave,ne(a.onContentLeave)),style:{pointerEvents:!h&&a.isRootMenu?"none":void 0,...d.style}})})});Ga.displayName=q;var qa=i.forwardRef((t,n)=>{const r=D(q,t.__scopeNavigationMenu),{onViewportContentChange:s,onViewportContentRemove:a}=r;return U(()=>{s(t.value,{ref:n,...t})},[t,n,s]),U(()=>()=>a(t.value),[t.value,a]),null}),te="navigationMenu.rootContentDismiss",Ht=i.forwardRef((t,n)=>{const{__scopeNavigationMenu:r,value:s,triggerRef:a,focusProxyRef:o,wasEscapeCloseRef:c,onRootContentClose:h,onContentFocusOutside:d,...x}=t,u=D(q,r),p=i.useRef(null),f=K(p,n),v=Ut(u.baseId,s),g=Gt(u.baseId,s),m=It(r),b=i.useRef(null),{onItemDismiss:w}=u;i.useEffect(()=>{const k=p.current;if(u.isRootMenu&&k){const C=()=>{var y;w(),h(),k.contains(document.activeElement)&&((y=a.current)==null||y.focus())};return k.addEventListener(te,C),()=>k.removeEventListener(te,C)}},[u.isRootMenu,t.value,a,w,h]);const E=i.useMemo(()=>{const C=m().map(B=>B.value);u.dir==="rtl"&&C.reverse();const y=C.indexOf(u.value),R=C.indexOf(u.previousValue),P=s===u.value,$=R===C.indexOf(s);if(!P&&!$)return b.current;const S=(()=>{if(y!==R){if(P&&R!==-1)return y>R?"from-end":"from-start";if($&&y!==-1)return y>R?"to-start":"to-end"}return null})();return b.current=S,S},[u.previousValue,u.value,u.dir,m,s]);return e.jsx(Kt,{asChild:!0,children:e.jsx(tt,{id:g,"aria-labelledby":v,"data-motion":E,"data-orientation":u.orientation,...x,ref:f,disableOutsidePointerEvents:!1,onDismiss:()=>{var C;const k=new Event(te,{bubbles:!0,cancelable:!0});(C=p.current)==null||C.dispatchEvent(k)},onFocusOutside:A(t.onFocusOutside,k=>{var y;d();const C=k.target;(y=u.rootNavigationMenu)!=null&&y.contains(C)&&k.preventDefault()}),onPointerDownOutside:A(t.onPointerDownOutside,k=>{var P;const C=k.target,y=m().some($=>{var S;return(S=$.ref.current)==null?void 0:S.contains(C)}),R=u.isRootMenu&&((P=u.viewport)==null?void 0:P.contains(C));(y||R||!u.isRootMenu)&&k.preventDefault()}),onKeyDown:A(t.onKeyDown,k=>{var R;const C=k.altKey||k.ctrlKey||k.metaKey;if(k.key==="Tab"&&!C){const P=ve(k.currentTarget),$=document.activeElement,S=P.findIndex(qt=>qt===$),oe=k.shiftKey?P.slice(0,S).reverse():P.slice(S+1,P.length);De(oe)?k.preventDefault():(R=o.current)==null||R.focus()}}),onEscapeKeyDown:A(t.onEscapeKeyDown,k=>{c.current=!0})})})}),Le="NavigationMenuViewport",Bt=i.forwardRef((t,n)=>{const{forceMount:r,...s}=t,o=!!D(Le,t.__scopeNavigationMenu).value;return e.jsx(X,{present:r||o,children:e.jsx(Ya,{...s,ref:n})})});Bt.displayName=Le;var Ya=i.forwardRef((t,n)=>{const{__scopeNavigationMenu:r,children:s,...a}=t,o=D(Le,r),c=K(n,o.onViewportChange),h=za(q,t.__scopeNavigationMenu),[d,x]=i.useState(null),[u,p]=i.useState(null),f=d?(d==null?void 0:d.width)+"px":void 0,v=d?(d==null?void 0:d.height)+"px":void 0,g=!!o.value,m=g?o.value:o.previousValue;return me(u,()=>{u&&x({width:u.offsetWidth,height:u.offsetHeight})}),e.jsx(I.div,{"data-state":Oe(g),"data-orientation":o.orientation,...a,ref:c,style:{pointerEvents:!g&&o.isRootMenu?"none":void 0,"--radix-navigation-menu-viewport-width":f,"--radix-navigation-menu-viewport-height":v,...a.style},onPointerEnter:A(t.onPointerEnter,o.onContentEnter),onPointerLeave:A(t.onPointerLeave,ne(o.onContentLeave)),children:Array.from(h.items).map(([w,{ref:E,forceMount:k,...C}])=>{const y=m===w;return e.jsx(X,{present:k||y,children:e.jsx(Ht,{...C,ref:Zt(E,R=>{y&&R&&p(R)})})},w)})})}),Xa="FocusGroup",Kt=i.forwardRef((t,n)=>{const{__scopeNavigationMenu:r,...s}=t,a=D(Xa,r);return e.jsx(pe.Provider,{scope:r,children:e.jsx(pe.Slot,{scope:r,children:e.jsx(I.div,{dir:a.dir,...s,ref:n})})})}),Ge=["ArrowRight","ArrowLeft","ArrowUp","ArrowDown"],Za="FocusGroupItem",Vt=i.forwardRef((t,n)=>{const{__scopeNavigationMenu:r,...s}=t,a=La(r),o=D(Za,r);return e.jsx(pe.ItemSlot,{scope:r,children:e.jsx(I.button,{...s,ref:n,onKeyDown:A(t.onKeyDown,c=>{if(["Home","End",...Ge].includes(c.key)){let d=a().map(p=>p.ref.current);if([o.dir==="rtl"?"ArrowRight":"ArrowLeft","ArrowUp","End"].includes(c.key)&&d.reverse(),Ge.includes(c.key)){const p=d.indexOf(c.currentTarget);d=d.slice(p+1)}setTimeout(()=>De(d)),c.preventDefault()}})})})});function ve(t){const n=[],r=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode:s=>{const a=s.tagName==="INPUT"&&s.type==="hidden";return s.disabled||s.hidden||a?NodeFilter.FILTER_SKIP:s.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;r.nextNode();)n.push(r.currentNode);return n}function De(t){const n=document.activeElement;return t.some(r=>r===n?!0:(r.focus(),document.activeElement!==n))}function Qa(t){return t.forEach(n=>{n.dataset.tabindex=n.getAttribute("tabindex")||"",n.setAttribute("tabindex","-1")}),()=>{t.forEach(n=>{const r=n.dataset.tabindex;n.setAttribute("tabindex",r)})}}function me(t,n){const r=W(n);U(()=>{let s=0;if(t){const a=new ResizeObserver(()=>{cancelAnimationFrame(s),s=window.requestAnimationFrame(r)});return a.observe(t),()=>{window.cancelAnimationFrame(s),a.unobserve(t)}}},[t,r])}function Oe(t){return t?"open":"closed"}function Ut(t,n){return`${t}-trigger-${n}`}function Gt(t,n){return`${t}-content-${n}`}function ne(t){return n=>n.pointerType==="mouse"?t(n):void 0}var Ja=Lt,es=Ft,ts=Wt,ns=Bt;function rs({className:t,children:n,viewport:r=!0,...s}){return e.jsxs(Ja,{"data-slot":"navigation-menu","data-viewport":r,className:_("group/navigation-menu relative flex max-w-max flex-1 items-center justify-center",t),...s,children:[n,r&&e.jsx(is,{})]})}function as({className:t,...n}){return e.jsx(es,{"data-slot":"navigation-menu-list",className:_("group flex flex-1 list-none items-center justify-center gap-1",t),...n})}function ss({className:t,...n}){return e.jsx(ts,{"data-slot":"navigation-menu-item",className:_("relative",t),...n})}const os=Xe("group inline-flex h-9 w-max items-center justify-center rounded-md bg-background px-4 py-2 text-sm font-medium hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground disabled:pointer-events-none disabled:opacity-50 data-[active=true]:bg-accent/50 data-[state=open]:bg-accent/50 data-[active=true]:text-accent-foreground ring-ring/10 dark:ring-ring/20 dark:outline-ring/40 outline-ring/50 transition-[color,box-shadow] focus-visible:ring-4 focus-visible:outline-1");function is({className:t,...n}){return e.jsx("div",{className:_("absolute top-full left-0 isolate z-50 flex justify-center"),children:e.jsx(ns,{"data-slot":"navigation-menu-viewport",className:_("origin-top-center bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-90 relative mt-1.5 h-[var(--radix-navigation-menu-viewport-height)] w-full overflow-hidden rounded-md border shadow md:w-[var(--radix-navigation-menu-viewport-width)]",t),...n})})}const qe=[{title:"Dashboard",href:"/dashboard",icon:ht}],Ye=[{title:"Repository",href:"https://github.com/laravel/react-starter-kit",icon:ut},{title:"Documentation",href:"https://laravel.com/docs/starter-kits",icon:Nn}],cs="text-neutral-900 dark:bg-neutral-800 dark:text-neutral-100";function ls({breadcrumbs:t=[]}){const n=Y(),{auth:r}=n.props,s=Re();return e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"border-sidebar-border/80 border-b",children:e.jsxs("div",{className:"mx-auto flex h-16 items-center px-4 md:max-w-7xl",children:[e.jsx("div",{className:"lg:hidden",children:e.jsxs(Ze,{children:[e.jsx(Jt,{asChild:!0,children:e.jsx(H,{variant:"ghost",size:"icon",className:"mr-2 h-[34px] w-[34px]",children:e.jsx(Yn,{className:"h-5 w-5"})})}),e.jsxs(et,{side:"left",className:"bg-sidebar flex h-full w-64 flex-col items-stretch justify-between",children:[e.jsx(Je,{className:"sr-only",children:"Navigation Menu"}),e.jsx(Qe,{className:"flex justify-start text-left",children:e.jsx(vn,{className:"h-6 w-6 fill-current text-black dark:text-white"})}),e.jsx("div",{className:"flex h-full flex-1 flex-col space-y-4 p-4",children:e.jsxs("div",{className:"flex h-full flex-col justify-between text-sm",children:[e.jsx("div",{className:"flex flex-col space-y-4",children:qe.map(a=>e.jsxs(j,{href:a.href,className:"flex items-center space-x-2 font-medium",children:[a.icon&&e.jsx(ee,{iconNode:a.icon,className:"h-5 w-5"}),e.jsx("span",{children:a.title})]},a.title))}),e.jsx("div",{className:"flex flex-col space-y-4",children:Ye.map(a=>e.jsxs("a",{href:a.href,target:"_blank",rel:"noopener noreferrer",className:"flex items-center space-x-2 font-medium",children:[a.icon&&e.jsx(ee,{iconNode:a.icon,className:"h-5 w-5"}),e.jsx("span",{children:a.title})]},a.title))})]})})]})]})}),e.jsx(j,{href:"/dashboard",prefetch:!0,className:"flex items-center space-x-2",children:e.jsx(Mt,{})}),e.jsx("div",{className:"ml-6 hidden h-full items-center space-x-6 lg:flex",children:e.jsx(rs,{className:"flex h-full items-stretch",children:e.jsx(as,{className:"flex h-full items-stretch space-x-2",children:qe.map((a,o)=>e.jsxs(ss,{className:"relative flex h-full items-center",children:[e.jsxs(j,{href:a.href,className:_(os(),n.url===a.href&&cs,"h-9 cursor-pointer px-3"),children:[a.icon&&e.jsx(ee,{iconNode:a.icon,className:"mr-2 h-4 w-4"}),a.title]}),n.url===a.href&&e.jsx("div",{className:"absolute bottom-0 left-0 h-0.5 w-full translate-y-px bg-black dark:bg-white"})]},o))})})}),e.jsxs("div",{className:"ml-auto flex items-center space-x-2",children:[e.jsxs("div",{className:"relative flex items-center space-x-1",children:[e.jsx(H,{variant:"ghost",size:"icon",className:"group h-9 w-9 cursor-pointer",children:e.jsx(hn,{className:"!size-5 opacity-80 group-hover:opacity-100"})}),e.jsx("div",{className:"hidden lg:flex",children:Ye.map(a=>e.jsx(se,{delayDuration:0,children:e.jsxs(Ce,{children:[e.jsx(Ne,{children:e.jsxs("a",{href:a.href,target:"_blank",rel:"noopener noreferrer",className:"group text-accent-foreground ring-offset-background hover:bg-accent hover:text-accent-foreground focus-visible:ring-ring ml-1 inline-flex h-9 w-9 items-center justify-center rounded-md bg-transparent p-0 text-sm font-medium transition-colors focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:outline-none disabled:pointer-events-none disabled:opacity-50",children:[e.jsx("span",{className:"sr-only",children:a.title}),a.icon&&e.jsx(ee,{iconNode:a.icon,className:"size-5 opacity-80 group-hover:opacity-100"})]})}),e.jsx(Me,{children:e.jsx("p",{children:a.title})})]})},a.title))})]}),e.jsxs(ot,{children:[e.jsx(it,{asChild:!0,children:e.jsx(H,{variant:"ghost",className:"size-10 rounded-full p-1",children:e.jsxs(Ee,{className:"size-8 overflow-hidden rounded-full",children:[e.jsx(Te,{src:r.user.avatar,alt:r.user.name}),e.jsx(Se,{className:"rounded-lg bg-neutral-200 text-black dark:bg-neutral-700 dark:text-white",children:s(r.user.name)})]})})}),e.jsx(ct,{className:"w-56",align:"end",children:e.jsx(Pt,{user:r.user})})]})]})]})}),t.length>1&&e.jsx("div",{className:"border-sidebar-border/70 flex w-full border-b",children:e.jsx("div",{className:"mx-auto flex h-12 w-full items-center justify-start px-4 text-neutral-500 md:max-w-7xl",children:e.jsx(he,{breadcrumbs:t})})})]})}function ds({children:t,breadcrumbs:n}){return e.jsxs(Nt,{children:[e.jsx(ls,{breadcrumbs:n}),e.jsx(Ct,{children:t})]})}function Ts({children:t,breadcrumbs:n,...r}){const[s,a]=i.useState("sidebar");i.useEffect(()=>{const c=localStorage.getItem("appLayout");a(c||"sidebar")},[]);const o=s==="header"?ds:Pa;return e.jsx(yn,{children:e.jsxs(o,{breadcrumbs:n,...r,children:[t,e.jsx(wn,{}),e.jsx(jr,{})]})})}export{Ts as A,Wn as D,rr as P,sr as T,gr as W,vr as a,Ce as b,Ne as c,Me as d,Jn as e,l as u};
