1import{Y as C,_ as L}from"../post-GibXXg97.js";import{F as S}from"../base-Ci7vLHE_.js";import q from"./g2ui-posted-message-mGANrOaz.js";import A from"./g2ui-highlight-message-BAvnr_hU.js";import"../events-DNd9BXmE.js";import"../preload-helper-BVLnHgTN.js";import"./g2ui-avatar-buYzc9-t.js";import"./g2ui-lightbox-BlkDBrpN.js";var R=Object.defineProperty,w=t=>{throw TypeError(t)},M=(t,e,s)=>e in t?R(t,e,{enumerable:!0,configurable:!0,writable:!0,value:s}):t[e]=s,x=(t,e,s)=>M(t,e+"",s),g=(t,e,s)=>e.has(t)||w("Cannot "+s),d=(t,e,s)=>(g(t,e,"read from private field"),e.get(t)),h=(t,e,s)=>e.has(t)?w("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,s),v=(t,e,s,a)=>(g(t,e,"write to private field"),e.set(t,s),s),m=(t,e,s)=>(g(t,e,"access private method"),s),n,r,l,p,b;const f=class y extends C{constructor(){super(),h(this,l),h(this,n),h(this,r,!1),v(this,n,S().newTranslator())}connectedCallback(){super.connectedCallback(),m(this,l,p).call(this),d(this,r)||v(this,r,!0)}attributeChangedCallback(e,s,a){var o,c;if(d(this,r)&&(super.attributeChangedCallback(e,s,a),(e==="features"||e==="display"||e==="user-id")&&s!==a)){for(const i of this.value.messages.values())((o=this.value.thread)==null?void 0:o.id)===i.id&&this.showThread(i,{force:!0});(c=this.shadowRoot.querySelector("div.post"))==null||c.remove(),m(this,l,p).call(this)}}static register(){q.register(),A.register(),L(),customElements.get("g2ui-community-feed")||customElements.define("g2ui-community-feed",y)}};n=new WeakMap,r=new WeakMap,l=new WeakSet,p=async function(){await this.whenSetup(),m(this,l,b).call(this)},b=function(){const t=this.value.display;if(this.value.info.post.feed.length>0&&this.getAttribute("user-id")&&!this.shadowRoot.querySelector("div.post")){const e=this.shadowRoot.ownerDocument.createElement("div");e.classList.add("post");const s=this.listenerRegistry.get(e);e.innerHTML=` 2 ${t.includes("compose")?'<button type="button" class="new">+</button>':""} 3 <dialog> 4 <header> 5 <h2>${d(this,n).lookup("post_a_message")}</h2> 6 <button type="button" class="close">${d(this,n).lookup("close")}</button> 7 </header> 8 </dialog> 9 `;const a=e.querySelector("button.new"),o=e.querySelector("dialog"),c=e.querySelector("button.close");s.getChildListener(c).addEventListener("click",()=>o.close()),s.getChildListener(o).addEventListener("close",()=>{o.dispatchEvent(new Event("modal:close",{bubbles:!0,composed:!0}))}),a&&s.getChildListener(a).addEventListener("click",()=>{let i=o.querySelector("g2ui-post-message");i||(i=this.ownerDocument.createElement("g2ui-post-message"),i.setAttribute("user-id",this.getAttribute("user-id")),i.setAttribute("user-name",this.getAttribute("user-name")),i.setAttribute("user-avatar",this.getAttribute("user-avatar")),i.setAttribute("features","feed-select"),s.getChildListener(i).addEventListener("posted",async({detail:{formData:E,message:u}})=>{const k=this.addMessages([u.value]);o.close(),await this.value.postMessage(u.value,E),k.complete(),u.classList.remove("loading")}),o.appendChild(i)),o.showModal(),o.dispatchEvent(new Event("modal:open",{bubbles:!0,composed:!0}))}),this.shadowRoot.insertBefore(e,this.shadowRoot.querySelector(".wrapper")||this.shadowRoot.querySelector("link").nextElementSibling)}},x(f,"adopt",[new URL("/apps/framework/build/css/g2ui-community-feed-BiYwEtcn.css",import.meta.url)]);let F=f;export{F as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.