import{a as x,_ as C}from"./app-MrAtUXr3.js";import{_ as S}from"./app-DxjODhok.js";import{_ as T,r as f,J as E,C as R,o as l,g as u,c as _,w as p,h,a as n,d as V,u as c,t as B,j as b,n as w,b as $,K as H,M,N as U,ao as z}from"./app-BYcXwl4U.js";const g=s=>(M("data-v-e275c57c"),s=s(),U(),s),D={key:0},j=g(()=>n("i",{class:"pi pi-angle-right"},null,-1)),A={key:0,xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",class:"size-4"},F=g(()=>n("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"m2.25 12 8.954-8.955c.44-.439 1.152-.439 1.591 0L21.75 12M4.5 9.75v10.125c0 .621.504 1.125 1.125 1.125H9.75v-4.875c0-.621.504-1.125 1.125-1.125h2.25c.621 0 1.125.504 1.125 1.125V21h4.125c.621 0 1.125-.504 1.125-1.125V9.75M8.25 21h8.25"},null,-1)),L=[F],J={class:"name-box"},K=["href"],O=g(()=>n("i",{class:"pi pi-arrow-left"},null,-1)),P=[O],q={class:"flex items-center gap-2 md:absolute md:top-0 md:right-2 md:bottom-0"},G={class:"flex flex-wrap gap-4"},Q={__name:"Navbar",props:{activeTab:{type:String,default:""},disableSpacing:{type:Boolean,default:!1},contentName:{type:String,default:""},parentItems:{type:Array,default:[]},secondary:{type:Boolean,default:!1}},setup(s,{expose:y}){const t=s,r=f(t.activeTab);E(()=>t.activeTab,()=>{r.value=t.activeTab});let i=[t.activeTab];const k=e=>{i.push(e.value)};let d="",m="";window.location.search.length>0&&window.location.search.substring(1).split("&").forEach(e=>{const o=e.indexOf("=");if(o>0)switch(e.substring(0,o)){case"REFER":d=window.decodeURIComponent(e.substring(o+1));break;case"REFERNAME":m=window.decodeURIComponent(e.substring(o+1));break}});const a=f([]);t.parentItems.length>0&&(a.value.push({name:t.parentItems[0][0],isHome:!0,url:t.parentItems[0][1]}),t.parentItems.length>1&&t.parentItems.slice(1).forEach(e=>{a.value.push({name:e[0],url:e[1]})}),t.contentName.length>0&&a.value.push({name:t.contentName,disabled:!t.secondary,class:t.secondary?"font-medium":""}));const I=z();return H("$navbar",I),y({goPrevTab(){i.pop(),r.value=i[i.length-1]},goTab(e){i.push(e),r.value=e}}),(e,o)=>{const N=R("tooltip");return l(),u("div",{class:w(["wrapper",{"no-spacing":s.disableSpacing,secondary:s.secondary}])},[s.contentName.length>0&&a.value.length>0?(l(),u("div",D,[a.value.length>0&&!s.secondary?(l(),_(S,{key:0,items:a.value,class:"!pl-0"},{separator:p(()=>[j]),itemicon:p(({item:v})=>[v.isHome?(l(),u("svg",A,L)):h("",!0)]),_:1},8,["items"])):h("",!0),n("div",{class:w(["relative",{"pt-4":a.value.length==0}])},[n("span",J,[V((l(),u("a",{href:c(d).length>0?c(d):a.value[a.value.length-2].url,class:"flex py-2 pr-4 z-10 hover:bg-gray-200 dark:hover:bg-gray-700 rounded-md"},P,8,K)),[[N,"返回"+(c(m).length>0?c(m):c(d).length==0?a.value[a.value.length-2].name:""),void 0,{top:!0}]]),n("span",null,B(s.contentName),1)]),n("div",q,[n("div",G,[b(e.$slots,"buttons",{},void 0,!0)])])],2)])):h("",!0),e.$slots.tabs?(l(),_(C,{key:1,modelValue:r.value,"onUpdate:modelValue":o[0]||(o[0]=v=>r.value=v),onChange:k},{default:p(()=>[$(x,null,{default:p(()=>[b(e.$slots,"tabs",{},void 0,!0)]),_:3})]),_:3},8,["modelValue"])):h("",!0)],2)}}},Z=T(Q,[["__scopeId","data-v-e275c57c"]]);export{Z as N};
