import{n as e}from"./rolldown-runtime-DkW27tQK.js";import{J as t,W as n}from"./lit-runtime-BEtFSUCp.js";import{Ht as r,qt as i}from"./control-ui-core-Br5DB0Zj.js";import{Ii as a,Li as o}from"./control-ui-boot-Cdpgu1Gm.js";function s(e){return t`
    <div class="sw-diff__row sw-diff__row--${e.kind}">
      <span class="sw-diff__sign" aria-hidden="true">${u[e.kind]}</span>
      <span class="sw-diff__text">${e.kind===`skip`?``:e.text}</span>
    </div>
  `}function c(e,n){let r=a(e,n,{compactUnchanged:!0});return r.kind===`complete`&&r.lines.length===0?t`<p class="sw-muted">${i(`skillWorkshop.diff.unchanged`)}</p>`:t`
    <div class="sw-diff">
      ${r.kind===`complete`?t`<p class="sw-diff__stat">
            <span class="sw-diff__stat-add">+${r.stat.added}</span>
            <span class="sw-diff__stat-del">-${r.stat.removed}</span>
          </p>`:t`<p class="sw-muted sw-diff__notice">${i(`skillWorkshop.diff.truncated`)}</p>`}
      <div class="sw-diff__rows">${r.lines.map(s)}</div>
    </div>
  `}function l(e,n){return t`
    <section class="sw-section sw-applied-history">
      <h3 class="sw-section__label">${i(`skillWorkshop.applied.history`)}</h3>
      <div class="sw-applied-history__list">
        ${n.revisions.map(({proposal:n,operation:r,version:a})=>{let o=n.key===e.selectedKey;return t`
            <button
              class="sw-applied-history__item ${o?`is-selected`:``}"
              aria-current=${o?`true`:`false`}
              @click=${()=>e.onSelect(n.key)}
            >
              <span class="sw-applied-history__operation">
                ${i(`skillWorkshop.applied.${r}`)}
              </span>
              <span class="sw-applied-history__age">${n.ageLabel}</span>
              <span class="sw-applied-history__version">
                ${i(`skillWorkshop.applied.version`,{version:String(a)})}
              </span>
            </button>
          `})}
      </div>
    </section>
  `}var u;function d(){return(d=e((()=>{n(),r(),o(),u={add:`+`,del:`-`,ctx:` `,file:` `,skip:`⋯`}})))()}d();export{l as renderAppliedHistory,c as renderAppliedRevisionDiff};
//# sourceMappingURL=applied-history.runtime-DOjIkwDo.js.map