PageSourceSearch

https://www.saabclub.nl/apps/framework/build/web-component/g2ui-feed-container-CnM0_fpa.js

js saabclub.nl collected 2026-10-02 10:01:22 UTC 8,064 bytes, 1 lines download raw bytes

1import{p as $,y as M,F as B,L as x}from"../base-Ci7vLHE_.js";import{b as W}from"../post-GibXXg97.js";import U from"./g2ui-community-feed-D0ibhBIU.js";import N from"./g2ui-highlight-feed-BLQQbKko.js";import T from"./g2ui-message-feed-COfWz--2.js";import"../preload-helper-BVLnHgTN.js";import"../events-DNd9BXmE.js";import"./g2ui-posted-message-mGANrOaz.js";import"./g2ui-avatar-buYzc9-t.js";import"./g2ui-lightbox-BlkDBrpN.js";import"./g2ui-highlight-message-BAvnr_hU.js";import"./g2ui-input-image-C57SKrXb.js";import"../internals--3vI9LC5.js";import"./g2ui-input-checklist-BLA9WzPQ.js";var O=Object.defineProperty,D=o=>{throw TypeError(o)},P=(o,e,t)=>e in o?O(o,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):o[e]=t,j=(o,e,t)=>P(o,e+"",t),L=(o,e,t)=>e.has(o)||D("Cannot "+t),a=(o,e,t)=>(L(o,e,"read from private field"),t?t.call(o):e.get(o)),v=(o,e,t)=>e.has(o)?D("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(o):e.set(o,t),C=(o,e,t,n)=>(L(o,e,"write to private field"),e.set(o,t),t),b=(o,e,t)=>(L(o,e,"access private method"),t);let y=Object.hasOwn(HTMLElement.prototype,"popover");var m,S,l,u,w,f,R,k,q;const F=class I extends ${constructor(){super(),v(this,f),v(this,m),v(this,S),v(this,l,null),v(this,u,null),v(this,w,[]),C(this,m,M()),C(this,S,B().newFeedRouterContext().setup(this))}connectedCallback(){C(this,w,(this.getAttribute("features")||"").split(" ").map(e=>e.trim()).filter(e=>!!e)),b(this,f,R).call(this)}disconnectedCallback(){var e;(e=a(this,S))==null||e.deregister()}get currentFeed(){return a(this,l)}set title(e){if(!a(this,w).includes("menu-collapse"))return;const t=this.shadowRoot.querySelector(".wrapper");if(!t)return;const n=this.shadowRoot.querySelector("h1")||this.ownerDocument.createElement("h1");n.textContent=e,t.insertBefore(n,t.querySelector("slot"))}get title(){var e;return((e=this.shadowRoot.querySelector("h1"))==null?void 0:e.textContent)||""}set feeds(e){var t;C(this,l,null);let n=this.shadowRoot.querySelector("slot");n?n.assignedNodes().forEach(s=>s.remove()):n=this.ownerDocument.createElement("slot");let g=[],c=[];for(const s of e)if(this.appendChild(s),s.id&&s.getAttribute("name")){const i=this.ownerDocument.createElement("li"),d=this.ownerDocument.createElement("button");if(s.value.type==="community"?(d.textContent=a(this,m).lookup("all"),d.command="--feed-all"):(d.textContent=s.getAttribute("name"),d.command="--feed-open"),d.dataset.feed=s.id,i.appendChild(d),s.value.type==="community"){g.push(i);const E=this.ownerDocument.createElement("li"),p=this.ownerDocument.createElement("button");p.textContent=a(this,m).lookup("unread",s.value.unread),p.command="--feed-unread",p.dataset.feed=s.id,E.appendChild(p),g.push(E)}else c.push(i)}let h=this.shadowRoot.querySelector(".wrapper");const r=this.shadowRoot.querySelector("menu");if(e.length>1||a(this,w).includes("menu-for-single")){h=h||this.ownerDocument.createElement("div"),h.classList.add("wrapper"),(t=r.querySelector("ul"))==null||t.remove();const s=this.ownerDocument.createElement("ul");for(const i of g)s.appendChild(i);if(r.appendChild(s),c.length>0&&a(this,w).includes("menu-collapse")){const i=this.ownerDocument.createElement("div");i.setAttribute("popover","auto"),i.setAttribute("id","feeds-popover");const d=this.ownerDocument.createElement("button");d.setAttribute("popovertarget","feeds-popover"),d.setAttribute("popovertargetaction","toggle"),d.textContent=a(this,m).lookup("choose_feed");const E=this.ownerDocument.createElement("ul");for(const A of c)E.appendChild(A);const p=this.ownerDocument.createElement("li");i.appendChild(E),p.appendChild(d),p.appendChild(i),s.appendChild(p)}else if(c.length>0)for(const i of c)s.appendChild(i);h.insertBefore(r,h.firstElementChild),h.appendChild(n),this.shadowRoot.appendChild(h)}else this.shadowRoot.appendChild(r),this.shadowRoot.appendChild(n),h==null||h.remove();b(this,f,R).call(this)}get feeds(){var e;return((e=this.shadowRoot.querySelector("slot"))==null?void 0:e.assignedNodes())||[]}async activateFeed(e){await this.showFeed(e),await e.showIndex();const t=new x(e);this.dispatchEvent(new CustomEvent("route:change",{detail:{route:t,unread:!1}}))}async showFeed(e){var t,n;await b(this,f,q).call(this,e),e.applyView(),(t=this.shadowRoot.querySelector("menu li.active"))==null||t.classList.remove("active"),(n=this.shadowRoot.querySelector(`menu button[data-feed = "${e.id}"]`))==null||n.closest("li").classList.add("active")}
1async activateFeedUnread(e){await this.showFeedUnread(e),await e.showIndex();const t=new x(e);this.dispatchEvent(new CustomEvent("route:change",{detail:{route:t,unread:!0}}))}async showFeedUnread(e){var t,n;await b(this,f,q).call(this,e),e.applyView(new W),(t=this.shadowRoot.querySelector("menu li.active"))==null||t.classList.remove("active"),(n=this.shadowRoot.querySelector(`menu button[command = "--feed-unread"][data-feed = "${e.id}"]`))==null||n.closest("li").classList.add("active")}static register(){U.register(),N.register(),T.register(),customElements.get("g2ui-feed-container")||customElements.define("g2ui-feed-container",I)}};m=new WeakMap,S=new WeakMap,l=new WeakMap,u=new WeakMap,w=new WeakMap,f=new WeakSet,R=function(){var o;const e=this.shadowRoot.querySelector("menu")||this.ownerDocument.createElement("menu");e.parentNode||this.shadowRoot.appendChild(e);const t=this.shadowRoot.querySelector(".wrapper");t&&t.classList.toggle("no-popover",!y);const n=this.shadowRoot.getElementById("feeds-popover");!y&&n&&(n.hidden=!0);const g=()=>{const r=this.shadowRoot.querySelector("button[popovertarget]").closest("li").getBoundingClientRect();n.style.setProperty("--g2ui-feed-container-no-anchor-popover-inline-end",`${window.innerWidth-r.right}px`)};y?n==null||n.addEventListener("beforetoggle",g):(o=this.shadowRoot.querySelector("[popovertarget]"))==null||o.addEventListener("click",()=>{n.hidden=!1,g()});const c=[...e.querySelectorAll("button[command]")];c.forEach(r=>{r.addEventListener("click",async s=>{if(y&&!s.target.popovertarget&&(n==null||n.hidePopover()),!y&&!s.target.popovertarget&&(n.hidden=!0),s.target.command==="--feed-all"||s.target.command==="--feed-open"){const i=this.ownerDocument.getElementById(s.target.dataset.feed);i?await this.activateFeed(i):console.warn(`Cannot open inexisting feed ${s.target.dataset.feed}`)}if(s.target.command==="--feed-unread"){const i=this.ownerDocument.getElementById(s.target.dataset.feed);i?await this.activateFeedUnread(i):console.warn(`Cannot show unread messages inexisting feed ${s.target.dataset.feed}`)}s.target.hasAttribute("popovertarget")&&!y&&(n.hidden=!n.hidden)})}),e.classList.toggle("hide",!a(this,w).includes("menu-for-single")&&c.length<=1);const h=c.filter(r=>r.command==="--feed-unread");for(const r of h){const s=r.dataset.feed,i=this.ownerDocument.getElementById(s);r.textContent=a(this,m).lookup("unread",i.value.unread),i.addEventListener("streamed",()=>{const d=a(this,m).lookup("unread",i.value.unread);r.textContent!==d&&(r.textContent=d)})}C(this,u,a(this,S).register()),this.feeds.length>0&&b(this,f,k).call(this)},k=async function(){var o;if(a(this,u))if(await this.showFeed(a(this,u).feed),(o=a(this,u))!=null&&o.isMessage())if(a(this,l).value.messages.has(a(this,u).messageId)){const e=a(this,l).value.messages.get(a(this,u).messageId);a(this,l).addMessages([e]).complete(),await a(this,l).showThread(e)}else await a(this,l).fetchAndShowThread(a(this,u).messageId);else await a(this,l).showIndex()},q=async function(o){var e;a(this,l)!==o&&(this.feeds.filter(t=>
1t.classList.contains("active")).forEach(t=>{t.classList.remove("active"),t.getAttribute("stream")==="manual"&&t.stopStreaming()}),o.classList.add("active"),o.getAttribute("stream")==="manual"&&await o.startStreaming(),C(this,l,o),a(this,l).tagName.toLowerCase()==="g2ui-message-feed"?this.title=((e=this.shadowRoot.querySelector(`menu button[data-feed = "${a(this,l).id}"]`))==null?void 0:e.textContent)||"":this.title="")},j(F,"adopt",[new URL("/apps/framework/build/css/g2ui-feed-container-CEu_SIKI.css",import.meta.url)]);let se=F;export{se 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.