/** * Minified by jsDelivr using Terser v5.39.0. * Original file: /npm/eleventy-plugin-shopify@0.1.0/.eleventy.js * * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files */ const chalk=require("chalk"),getShopInfo=require("./src/shop"),getAllProducts=require("./src/products"),getAllCollections=require("./src/collections"),getAllPages=require("./src/pages"),getAllArticles=require("./src/articles"),defaultConfig=require("./config"),getShopifyContent=async l=>{const e=Object.assign(defaultConfig,l);console.log(chalk.yellow.bold("SHOPIFY:GETTING SHOP INFO")),console.log(chalk.yellow.bold("SHOPIFY:GETTING PRODUCTS")),console.log(chalk.yellow.bold("SHOPIFY:GETTING COLLECTIONS")),console.log(chalk.yellow.bold("SHOPIFY:GETTING PAGES")),console.log(chalk.yellow.bold("SHOPIFY:GETTING ARTICLES"));const o=await getShopInfo(e.shopQuery),t=await getAllProducts(e.productsQuery),c=await getAllCollections(e.collectionsQuery),g=await getAllPages(e.pagesQuery),n=await getAllArticles(e.articlesQuery);return console.log(chalk.greenBright.bold(`SHOPIFY:SUCCESSFULLY RETRIEVED ${o.name.toUpperCase()} INFO`)),console.log(chalk.greenBright.bold(`SHOPIFY:SUCCESSFULLY RETRIEVED ${t.length} PRODUCT${t.length>1||0==t.length?"S":""}`)),console.log(chalk.greenBright.bold(`SHOPIFY:SUCCESSFULLY RETRIEVED ${c.length} COLLECTIONS`)),console.log(chalk.greenBright.bold(`SHOPIFY:SUCCESSFULLY RETRIEVED ${g.length} PAGE${g.length>1||0==g.length?"S":""}`)),console.log(chalk.greenBright.bold(`SHOPIFY:SUCCESSFULLY RETRIEVED ${n.length} ARTICLE${n.length>1||0==n.length?"S":""}`)),console.log(chalk.yellow.bold("SHOPIFY:MAPPING PRODUCTS TO COLLECTIONS")),c.map((l=>l.products.length>0?l.products.map((l=>t.find((e=>e.id===l.id)))):l)),console.log(chalk.greenBright.bold("SHOPIFY:SUCCESSFULLY MAPPED PRODUCTS TO COLLECTIONS")),{shop:o,products:t,collections:c,pages:g,articles:n}};module.exports=(l,e)=>{l.addGlobalData("shopify",(async()=>await getShopifyContent(e||{})))}; //# sourceMappingURL=/sm/3125f92bf7711edc638b0c53437f26fb2f10b12d7a9dc35ddc571379e9ce8074.map