"use strict";var __defProp=Object.defineProperty,__getOwnPropDesc=Object.getOwnPropertyDescriptor,__getOwnPropNames=Object.getOwnPropertyNames,__hasOwnProp=Object.prototype.hasOwnProperty,__name=(e,t)=>__defProp(e,"name",{value:t,configurable:!0}),__export=(e,t)=>{for(var s in t)__defProp(e,s,{get:t[s],enumerable:!0})},__copyProps=(e,t,s,o)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let r of __getOwnPropNames(t))__hasOwnProp.call(e,r)||r===s||__defProp(e,r,{get:()=>t[r],enumerable:!(o=__getOwnPropDesc(t,r))||o.enumerable});return e},__toCommonJS=e=>__copyProps(__defProp({},"__esModule",{value:!0}),e),__async=(e,t,s)=>new Promise((o,r)=>{var n=e=>{try{_(s.next(e))}catch(e){r(e)}},a=e=>{try{_(s.throw(e))}catch(e){r(e)}},_=e=>e.done?o(e.value):Promise.resolve(e.value).then(n,a);_((s=s.apply(e,t)).next())}),posts_exports={};__export(posts_exports,{getPosts:()=>getPosts,getSearchPosts:()=>getSearchPosts});var getPosts=__name(function(e){return __async(this,arguments,function*({filter:e,page:t,signal:s,providerContext:o}){const{getBaseUrl:r,axios:n}=o;return posts({url:`${(yield r("consumet"))+e}?page=${t}`,signal:s,axios:n})})},"getPosts"),getSearchPosts=__name(function(e){return __async(this,arguments,function*({searchQuery:e,page:t,signal:s,providerContext:o}){const{getBaseUrl:r,axios:n}=o;return posts({url:`${yield r("consumet")}/anime/zoro/${e}?page=${t}`,signal:s,axios:n})})},"getSearchPosts");function posts(e){return __async(this,arguments,function*({url:e,signal:t,axios:s}){var o;try{const r=null==(o=(yield s.get(e,{signal:t})).data)?void 0:o.results,n=[];return null==r||r.map(e=>{const t=e.title,s=e.id,o=e.image;t&&s&&o&&n.push({title:t,link:s,image:o})}),n}catch(e){return[]}})}__name(posts,"posts"),exports.getPosts=getPosts,exports.getSearchPosts=getSearchPosts;