'use client';
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("@gem-sdk/core"),r=require("react");exports.default=({blogHandle:o,articlePickType:i,builderAttrs:s,children:n})=>{let l="STATIC"===t.usePageType(),d=t.useShopStore(e=>e.storefrontToken),a=t.useShopStore(e=>e.storefrontUrl),p="latest"===i,{t:c}=t.useI18nStore(),g=r.useMemo(()=>l&&!d?c("We can not get your articles from Shopify"):p?o?c("Have you add articles to this blog? We couldn’t find any."):c("Have you create blog in your store? We couldn’t find any."):c("Have you added articles to your store? We couldn’t find any."),[l,d,p,o]),u=r.useMemo(()=>p?o?c("Add articles to blog"):c("Add blog to Shopify"):c("Add articles to Shopify"),[p,o]),h=r.useMemo(()=>{if(!a)return;let e=new URL(a);return p?`${e.protocol}//${e.host}/admin/blogs`:`${e.protocol}//${e.host}/admin/articles`},[p,a]);return e.jsxs("div",{...s,className:"gp-relative gp-flex gp-h-[98px] gp-flex-col gp-items-center gp-justify-center gp-rounded gp-border-dotted gp-border-[#676767] gp-border",children:[e.jsxs("div",{className:"gp-flex gp-items-center gp-justify-center",children:[e.jsx("span",{className:"gp-mr-2",children:e.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"21",height:"21",viewBox:"0 0 21 21",fill:"none",children:[e.jsx("g",{clipPath:"url(#clip0_9546_221079)",children:e.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M11.5728 3.86863C11.0976 3.04379 9.90241 3.04379 9.4272 3.86863L1.91575 16.9064C1.44289 17.7271 2.0381 18.75 2.98855 18.75H18.0114C18.9619 18.75 19.5571 17.7271 19.0842 16.9064L11.5728 3.86863ZM10.5 6.43064C10.8452 6.43064 11.125 6.7092 11.125 7.05282V12.6524C11.125 12.996 10.8452 13.2746 10.5 13.2746C10.1548 13.2746 9.875 12.996 9.875 12.6524V7.05282C9.875 6.7092 10.1548 6.43064 10.5 6.43064ZM10.5 14.7678C9.94771 14.7678 9.5 15.2135 9.5 15.7633C9.5 16.3131 9.94771 16.7588 10.5 16.7588C11.0523 16.7588 11.5 16.3131 11.5 15.7633C11.5 15.2135 11.0523 14.7678 10.5 14.7678Z",fill:"#494949"})}),e.jsx("defs",{children:e.jsx("clipPath",{id:"clip0_9546_221079",children:e.jsx("rect",{width:"20",height:"21",fill:"white",transform:"translate(0.5)"})})})]})}),e.jsx("span",{className:"gp-text-sm gp-font-normal gp-text-[#212121]",children:g})]}),l?e.jsx("div",{children:d?e.jsx("div",{onClick:()=>{h&&window.open(h,"_blank")},"aria-hidden":"true",className:"gp-cursor-pointer gp-text-sm gp-font-medium gp-text-[#3C67FF] gp-no-underline",children:u}):e.jsx("div",{onClick:()=>{window.parent.postMessage("toggleImportProductModal")},"aria-hidden":"true",className:"gp-cursor-pointer gp-text-sm gp-font-medium gp-text-[#3C67FF] gp-no-underline",children:c("Import from Shopify")})}):e.jsxs("div",{className:"gp-text-sm gp-font-normal gp-text-[#212121]",children:[e.jsx("span",{"aria-hidden":!0,onClick:()=>{h&&window.open(h,"_blank")},className:"gp-cursor-pointer gp-font-medium gp-text-[#3C67FF] hover:gp-underline",children:u})," ",p?c("or pick another blog"):c("or pick another article")]}),t.filterToolbarPreview(n,!0)]})};
