'use client';
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("next/link"),r=require("../../text/components/Text.js"),i=require("@gem-sdk/core"),s=require("react"),l=require("../hooks/useArticleLink.js"),o=require("../../common/components/NoDataState.js");exports.default=({setting:c,styles:n,builderProps:a})=>{let u=i.useArticleStore(e=>e.article),d=i.useShopStore(e=>e.storefrontUrl),x=s.useMemo(()=>u?.content?.excerptHtml,[u]),{shopifyArticleLink:p}=l.useArticleLink(),{t:m}=i.useI18nStore();return e.jsx("div",{id:`shopify-text-element-${a?.uid}`,"data-article-id":u?.baseID?.replace("gid://shopify/OnlineStoreArticle/",""),children:u&&x?c?.linkArticle?e.jsx(t,{href:p,title:u?.title,children:e.jsx(r.default,{builderProps:a,styles:n,setting:{...c,text:x,excludeFlex:!0}})}):e.jsx(r.default,{builderProps:a,styles:n,setting:{...c,text:x,excludeFlex:!0}}):e.jsx(o.default,{elementType:"secondary",description:m("Provide a brief summary or teaser of the article. "),descriptionActions:[{text:m("Add article excerpt"),callback:()=>{if(!d)return;let e=new URL(d);window.open(`${e.protocol}//${e.host}/admin/content/articles`)}},{text:m("sync data"),callback:"syncArticle"}]})})};
