'use client';
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var jsxRuntime=require("react/jsx-runtime"),core=require("@gem-sdk/core"),Text=require("../../../text/components/Text.js"),React=require("react");const ProductVendor=({setting:e,builderProps:t,styles:r})=>{let l=core.useProduct(),s=core.useEditorMode(),[o,u]=React.useState(null),n=e?.label&&e.label.trim().length>0?`${e.label} ${l?.vendor??""}`:`${l?.vendor??""}`;return React.useEffect(()=>{let e=localStorage.getItem("shopifyDomain");e&&u(e)},[]),jsxRuntime.jsx("div",{id:`vendor-${t?.uid}`,children:l?e?.url&&"edit"!==s?jsxRuntime.jsx("a",{href:`//${o}/collections/vendors?q=${l.vendor}`,target:`${"new-tab"===e.openIn?"_blank":"_self"}`,children:jsxRuntime.jsx(Text.default,{builderProps:t,styles:r,setting:{...e,text:n,excludeFlex:!0}})}):jsxRuntime.jsx(Text.default,{builderProps:t,styles:r,setting:{...e,text:n,excludeFlex:!0}}):null})};exports.default=ProductVendor;
