import{e as V,f as m,q as B,B as L,A as x,v as c,R as P,F,u as q,c as C,o as d,y as b,C as z,t as v,x as D,K as U,h as j,a0 as A}from"./iframe-Bl-fVlm8.js";import{P as E}from"./PzText-D5PUnIjq.js";import{_ as W}from"./_plugin-vue_export-helper-DlAUqK2U.js";import"./preload-helper-C1FmrZbK.js";const y={label:"Головна",to:"/"},H={class:"pz-breadcrumb","aria-label":"Breadcrumb"},J={class:"pz-breadcrumb__list"},K={class:"pz-breadcrumb__item"},G={key:0,class:"pz-breadcrumb__link pz-breadcrumb__link--current","aria-current":"page"},l=V({name:"PzBreadcrumb",__name:"PzBreadcrumb",props:{items:{}},setup(a){const n=U(),o=a,f=e=>typeof e!="string"?e:e.split("/").map(t=>{if(!t.startsWith(":"))return t;const r=n.params[t.slice(1)];return Array.isArray(r)?r.join("/"):r??t}).join("/"),O=C(()=>{const e=[];return n.matched.forEach(t=>{const r=t.meta,s=String(r.breadcrumb??r.name??t.name??"").trim();!s||t.path==="/"||e.push({label:s,to:f(t.path)})}),e}),_=C(()=>{var e;return(e=o.items)!=null&&e.length?o.items.map(t=>({...t,to:f(t.to)})):O.value}),g=e=>e===_.value.length-1;return(e,t)=>(d(),m("nav",H,[B("ul",J,[B("li",K,[L(c(P),{to:c(y).to,class:"pz-breadcrumb__link"},{default:x(()=>[b(e.$slots,"home",{data:c(y),index:-1,isCurrent:!1},()=>[z(v(c(y).label),1)],!0)]),_:3},8,["to"])]),(d(!0),m(F,null,q(_.value,(r,s)=>(d(),m("li",{key:`${r.label}-${s}`,class:"pz-breadcrumb__item"},[g(s)||!r.to?(d(),m("span",G,[b(e.$slots,"view",{data:r,isCurrent:g(s)||!r.to,index:s},()=>[z(v(r.label),1)],!0)])):(d(),D(c(P),{key:1,to:r.to,class:"pz-breadcrumb__link"},{default:x(()=>[b(e.$slots,"view",{data:r,isCurrent:!1,index:s},()=>[z(v(r.label),1)],!0)]),_:2},1032,["to"]))]))),128))])]))}}),h=W(l,[["__scopeId","data-v-1817047b"]]);l.__docgenInfo=Object.assign({displayName:l.name??l.__name},{name:"PzBreadcrumb",exportName:"default",displayName:"PzBreadcrumb",description:"",tags:{},props:[{name:"items",required:!1,type:{name:"Array",elements:[{name:"PzBreadcrumbItem"}]}}],slots:[{name:"home",scoped:!0,bindings:[{name:"data",title:"binding"},{name:"index",title:"binding"},{name:"is-current",title:"binding"}]},{name:"view",scoped:!0,bindings:[{name:"data",title:"binding"},{name:"is-current",title:"binding"},{name:"index",title:"binding"}]}],sourceFiles:["/builds/Web-Projects/client-services/prozorro-ui/src/components/Navigation/PzBreadcrumb/PzBreadcrumb.vue"]});const Q=[{label:"Тендери",to:"/breadcrumbs/tenders"},{label:"Транспорт",to:"/breadcrumbs/tenders/transport"},{label:"Автомобіль ВАЗ 21703"}],X=[{label:"Закупівлі",to:"/breadcrumbs/procedures"},{label:"Товари",to:"/breadcrumbs/procedures/products"},{label:"Легковий транспорт",to:"/breadcrumbs/procedures/products/cars"},{label:"Автомобіль ВАЗ 21703"}],Y=a=>{var o;return(o=a.items)!=null&&o.length?`<template>
  <PzBreadcrumb :items='${JSON.stringify(a.items,null,2)}' />
</template>`:`<template>
  <PzBreadcrumb />
</template>`},Z=()=>`<template>
  <PzBreadcrumb>
    <template #home="{ data }">
      <strong>{{ data.label }}</strong>
    </template>

    <template #view="{ data, isCurrent }">
      <span :style="{ opacity: isCurrent ? 0.7 : 1 }">{{ data.label }}</span>
    </template>
  </PzBreadcrumb>
</template>`,ee={title:"Components/Navigation/PzBreadcrumb",component:h,parameters:{prototype:{caption:"Breadcrumb component",note:"This version stays close to the old app breadcrumb: the home crumb is rendered first, intermediate crumbs are links, the last crumb is plain text, and route-derived breadcrumbs come from vue-router metadata."},docs:{description:{component:"Use `PzBreadcrumb` with no props to derive crumbs from `route.matched` via `route.meta.breadcrumb` or `route.meta.name`. Pass `items` only when you need to override the route-derived trail."},source:{transform:(a,n)=>Y(n.args??ee.args)}}},args:{items:void 0},argTypes:{items:{control:"object",description:"Optional manual breadcrumb override. If omitted, the component reads crumbs from vue-router."}},render:a=>({components:{pzBreadcrumb:h,pzText:E},setup(){const n=A();return j(async()=>{await n.push("/breadcrumbs/tenders/transport/vaz-21703")}),{args:a,deepItems:X}},template:`
      <div class="pz-breadcrumb-story">
        <section class="pz-breadcrumb-story-frame">
          <div class="pz-breadcrumb-story-header">
            <div>
              <span class="pz-breadcrumb-story-eyebrow">Vue Router</span>
              <pz-text variant="h4-bold">Breadcrumb from route metadata</pz-text>
            </div>
            <span class="pz-breadcrumb-story-chip">node 111:2205</span>
          </div>

          <div class="pz-breadcrumb-story-surface">
            <pz-breadcrumb :items="args.items" />
          </div>
        </section>

        <section class="pz-breadcrumb-story-grid">
          <article class="pz-breadcrumb-story-card">
            <div class="pz-breadcrumb-story-copy">
              <pz-text variant="body-semibold">Manual override</pz-text>
              <pz-text variant="small-regular">
                If items is passed, the component renders that list instead of reading vue-router.
              </pz-text>
            </div>

            <div class="pz-breadcrumb-story-card-surface">
              <pz-breadcrumb :items="deepItems" />
            </div>
          </article>
        </section>
      </div>
    `})},i={},u={args:{items:Q}},p={parameters:{docs:{source:{code:Z()}}},render:()=>({components:{pzBreadcrumb:h,pzText:E},setup(){const a=A();return j(async()=>{await a.push("/breadcrumbs/tenders/transport/vaz-21703")}),{}},template:`
      <div class="pz-breadcrumb-story">
        <section class="pz-breadcrumb-story-frame">
          <div class="pz-breadcrumb-story-header">
            <div>
              <span class="pz-breadcrumb-story-eyebrow">Slots</span>
              <pz-text variant="h4-bold">Custom home and item content</pz-text>
            </div>
            <span class="pz-breadcrumb-story-chip">home + view</span>
          </div>

          <div class="pz-breadcrumb-story-surface">
            <pz-breadcrumb>
              <template #home="{ data }">
                <span>{{ data.label }}</span>
              </template>

              <template #view="{ data, isCurrent }">
                <span :style="{ opacity: isCurrent ? 0.65 : 1 }">{{ data.label }}</span>
              </template>
            </pz-breadcrumb>
          </div>
        </section>
      </div>
    `})};var w,S,k;i.parameters={...i.parameters,docs:{...(w=i.parameters)==null?void 0:w.docs,source:{originalSource:"{}",...(k=(S=i.parameters)==null?void 0:S.docs)==null?void 0:k.source}}};var I,N,R;u.parameters={...u.parameters,docs:{...(I=u.parameters)==null?void 0:I.docs,source:{originalSource:`{
  args: {
    items: manualItems
  }
}`,...(R=(N=u.parameters)==null?void 0:N.docs)==null?void 0:R.source}}};var T,M,$;p.parameters={...p.parameters,docs:{...(T=p.parameters)==null?void 0:T.docs,source:{originalSource:`{
  parameters: {
    docs: {
      source: {
        code: buildSlotSource()
      }
    }
  },
  render: () => ({
    components: {
      pzBreadcrumb: PzBreadcrumb,
      pzText: PzText
    },
    setup() {
      const router = useRouter();
      onMounted(async () => {
        await router.push("/breadcrumbs/tenders/transport/vaz-21703");
      });
      return {};
    },
    template: \`
      <div class="pz-breadcrumb-story">
        <section class="pz-breadcrumb-story-frame">
          <div class="pz-breadcrumb-story-header">
            <div>
              <span class="pz-breadcrumb-story-eyebrow">Slots</span>
              <pz-text variant="h4-bold">Custom home and item content</pz-text>
            </div>
            <span class="pz-breadcrumb-story-chip">home + view</span>
          </div>

          <div class="pz-breadcrumb-story-surface">
            <pz-breadcrumb>
              <template #home="{ data }">
                <span>{{ data.label }}</span>
              </template>

              <template #view="{ data, isCurrent }">
                <span :style="{ opacity: isCurrent ? 0.65 : 1 }">{{ data.label }}</span>
              </template>
            </pz-breadcrumb>
          </div>
        </section>
      </div>
    \`
  })
}`,...($=(M=p.parameters)==null?void 0:M.docs)==null?void 0:$.source}}};const ne=["Playground","ManualItems","CustomSlots"];export{p as CustomSlots,u as ManualItems,i as Playground,ne as __namedExportsOrder,ee as default};
