1import{_ as f,a as g,s as m}from"./app.js";import{P as i}from"./PostShortcut.js";import{L as _}from"./LoadMoreButton.js";import"./swiper.js";import"./CroppedText.js";const w={name:"SoylentPostShortcutList",components:{LoadMoreButton:_,PostShortcut:i},data:function(){return{pageItems:[],page:1,archiveUrl:null,loading:!1}},props:["element"],computed:{postShortcutComponent(){return m.getByName("postShortcut",i)},amount:function(){return this.element.data.amount?this.element.data.amount:10},postShortcut:function(){return m.getByName("postShortcut",i)},total:function(){return this.element.data.total?this.element.data.total:0}},watch:{element(){this.setDataSettings()}},methods:{handleResponse:function(e){let t=!1;if(e.data.template==="not-found"){this.archiveUrl=null;return}e.data.data.blocks.forEach(n=>{n.elements.forEach(a=>{a.subtype==="postShortcutList"&&a.data.items.forEach(l=>{t=!0,this.pageItems.push(l)})})}),(!t||this.pageItems.length>=this.total)&&(this.archiveUrl=null)},loadMore:function(){this.loading=!0,this.page++;const e=this.archiveUrl+"page/"+this.page+"/";g.get("/headless"+e).then(t=>this.handleResponse(t)).catch(t=>{if(!t.response){console.debug(t);return}this.archiveUrl=null}).finally(()=>{this.loading=!1})},setDataSettings:function(){this.pageItems=this.element.data.items,this.page=this.element.data.page,this.pageItems.length!==this.total&&(this.archiveUrl=this.element.data.archive_url)}},mounted(){this.setDataSettings()}},v=window.Vue.renderList,V=window.Vue.Fragment,o=window.Vue.openBlock,r=window.Vue.createElementBlock,y=window.Vue.resolveDynamicComponent,d=window.Vue.createBlock,s=window.Vue.createElementVNode,S=window.Vue.resolveComponent,h=window.Vue.createCommentVNode,k=window.Vue.normalizeClass,C={class:"post-shortcuts -col-4"},B={key:1,class:"loading-state"};function L(e,t,n,a,l,c){const p=S("LoadMoreButton");return o(),r("div",{class:k(["element",n.element.type,n.element.subtype])},[s("div",C,[(o(!0),r(V,null,v(e.pageItems,u=>(o(),d(y(c.postShortcut),{post:u,key:u.post_id},null,8,["post"]))),128))]),!e.loading&&e.archiveUrl?(o(),d(p,{key:0,onClick:c.loadMore},null,8,["onClick"])):h("",!0),e.loading?(o(),r("div",B,[...t[0]||(t[0]=[s("div",{class:"button"},[s("span",{class:"button__label"},[s("span",{class:"button__text"},"WIRD GELADEN")])],-1)])])):h("",!0)],2)}const U=f(w,[["render",L]]);export{U 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.