UNPKG

openclaw

Version:

Multi-channel AI gateway with extensible messaging integrations

56 lines 5.03 kB
import{n as e}from"./rolldown-runtime-DkW27tQK.js";import{wr as t}from"./control-ui-foundation-Cydpkyqa.js";import{Sc as n,bc as r,cn as i}from"./control-ui-core-Rwzhj6nO.js";import{$ as a,K as o,X as s,at as c,q as l}from"./lit-runtime-CV_MH99K.js";import{_n as u,jn as d}from"./control-ui-core-YphAl4aM.js";import{Gt as f,Qt as p,Wt as m,Yt as h,en as g}from"./control-ui-core-vvcQQV2m.js";import{C as _,D as v,E as y,M as b,N as x,O as S,S as C,T as w,b as T,k as E,w as D}from"./control-ui-boot-shared-DfZ39Yj9.js";import{n as O,t as k}from"./settings-workspace-Bseic8Tf.js";function A(e){return new Date(e).toLocaleDateString(p.getLocale())}function j(e,t={}){let n=w.filter(t=>e.has(t.id)).length,r=n===w.length,i=g(`quickSettings.appearance.lobsterdexSeen`,{seen:String(n),total:String(w.length)});return s` <section class="lobsterdex-page"> <header class="lobsterdex-page__header ${r?`lobsterdex-page__header--complete`:``}" > <div> <h2>${g(`tabs.lobsterdex`)}</h2> <p>${g(`subtitles.lobsterdex`)}</p> </div> <span class="lobsterdex-page__count">${i}</span> </header> ${t.copyFeedback?.status===`error`?s`<div class="callout danger" role="alert">${g(`common.copyFailed`)}</div>`:l} <div class="lobsterdex-page__grid" aria-label=${i}> ${w.map(n=>{let r=T(n),i=e.get(n.id),a=i!==void 0,o=a?i.name??E(n.id):`?`,c=v[n.id],u=a&&i.firstSeenAt!==null?g(`quickSettings.appearance.lobsterdexCardFirstVisited`,{date:A(i.firstSeenAt)}):null,d=i?.shinySeenAt==null?null:g(`quickSettings.appearance.lobsterdexCardShinySeen`,{date:A(i.shinySeenAt)});return s` <article id="lobsterdex-${n.id}" class="lobsterdex-page__card ${a?``:`lobsterdex-page__card--unseen`}" > <button type="button" class="lobsterdex-page__copy-link" aria-label=${g(`quickSettings.appearance.lobsterdexCardCopyLink`)} @click=${()=>t.onCopyLink?.(n.id)} > <span aria-hidden="true" >${t.copyFeedback?.status===`copied`&&t.copyFeedback.paletteId===n.id?m.check:m.link}</span > </button> <div class="lobsterdex-page__sprite lobster-pet lobster-pet--palette-${n.id} ${a?``:`lobsterdex__mini--unseen`}" style=${_(r)} > ${D(r,{standalone:!0})} ${i?.shinySeenAt==null?l:s`<span class="lobsterdex__mini-star lobsterdex-page__star" aria-hidden="true" >✦</span >`} </div> <h3>${o}</h3> <p class="lobsterdex-page__lore">${a?c.flavor:c.hint}</p> <div class="lobsterdex-page__dates"> ${u?s`<p class="lobsterdex-page__date"><time>${u}</time></p>`:l} ${d?s`<p class="lobsterdex-page__date"><time>${d}</time></p>`:l} </div> </article> `})} </div> </section> `}function M(){return(M=e((()=>{o(),f(),C(),S(),y(),h()})))()}var N;function P(){return(P=e((()=>{o(),a(),u(),x(),y(),k(),n(),M(),N=class extends r{constructor(...e){super(...e),this.copyFeedback=null,this.copyAttempt=0,this.copyResetTimer=null,this.copyLink=async e=>{let t=++this.copyAttempt;this.copyFeedback=null,this.copyResetTimer!==null&&(window.clearTimeout(this.copyResetTimer),this.copyResetTimer=null);let n=`${location.origin}${location.pathname}#lobsterdex-${e}`,r=await i(n,()=>this.isConnected&&t===this.copyAttempt);!this.isConnected||t!==this.copyAttempt||(this.copyFeedback={paletteId:e,status:r?`copied`:`error`},this.copyResetTimer=window.setTimeout(()=>{this.copyFeedback=null,this.copyResetTimer=null},1500))}}disconnectedCallback(){this.copyAttempt+=1,this.copyFeedback=null,this.copyResetTimer!==null&&(window.clearTimeout(this.copyResetTimer),this.copyResetTimer=null),super.disconnectedCallback()}firstUpdated(){if(!location.hash.startsWith(`#lobsterdex-`))return;let e=w.find(e=>e.id===location.hash.slice(12));if(!e)return;let t=this.querySelector(`#lobsterdex-${e.id}`);if(!t)return;let n=e=>{e.target===t&&e.animationName===`lobsterdex-card-highlight`&&(t.classList.remove(`lobsterdex-page__card--highlight`),t.removeEventListener(`animationend`,n))};t.addEventListener(`animationend`,n),t.classList.add(`lobsterdex-page__card--highlight`),requestAnimationFrame(()=>{requestAnimationFrame(()=>t.scrollIntoView({block:`center`}))})}render(){return s` <section class="content-header"> <div class="page-title">${d(`lobsterdex`)}</div> </section> ${O(j(b(),{copyFeedback:this.copyFeedback,onCopyLink:e=>void this.copyLink(e)}))} `}},t([c()],N.prototype,`copyFeedback`,void 0),customElements.get(`openclaw-lobsterdex-page`)||customElements.define(`openclaw-lobsterdex-page`,N)})))()}P(); //# sourceMappingURL=lobsterdex-page-BcrqPRj9.js.map