'use client';
import{jsx as t}from"react/jsx-runtime";import e from"next/link";import{useRenderMode as r,useProduct as o,useEditorMode as i}from"@gem-sdk/core";import{urlJoin as m}from"../../../link/common/helpers.js";import d from"../../../text/components/Text.js";import{createClass as l,createAttr as p,Unless as s,If as c}from"@gem-sdk/system";import{getTextProps as n}from"./common/helpers.js";let ProductTitle=a=>{let{setting:u,builderProps:f}=a,{isPreviewSharePageMode:h}=r(),k=o(),x=h?`/products/${k?.handle}`:k?.handle?m("/products",k.handle):"#",g=k?.baseID?.replace("gid://shopify/Product/",""),j=i(),P=()=>t(d,{...n(a,k?.title)}),y={href:x,title:k?.title},T=u?.linkProduct,$=l({"gp-product-title-link-wrapper":!0}),b=p({id:`shopify-text-element-${f?.uid}`,...g&&{"data-product-id":g}});return t("div",{..."edit"===j&&b,children:s(!!k,"",c(T,t(e,{...y,className:$,children:P()}),P()))})};export{ProductTitle as default};
