'use client';
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var jsxRuntime=require("react/jsx-runtime"),core=require("@gem-sdk/core"),NoDataState=require("../../../common/components/NoDataState.js"),TooltipHover=require("../../../common/components/TooltipHover.js"),Text=require("../../../text/components/Text.js"),system=require("@gem-sdk/system"),styles=require("./common/styles.js"),classes=require("./common/classes.js"),useGpDiscountTag=require("./hooks/useGpDiscountTag.js");const ProductTag=({setting:e,styles:s,builderProps:t,...i})=>{let{customContent:a}=e??{},l=i["bundle-item"],{textAlign:o}=s??{},{mode:r,product:u,salePrice:n,priceSave:d,currentProductId:c,unitCustomDisplay:x,shouldPlaceholderNoDiscount:m}=useGpDiscountTag.useGpDiscountTag({setting:e,styles:s,builderProps:t,...i});if(m)return jsxRuntime.jsx(TooltipHover.default,{enable:!0,text:"Not be displayed when published",position:"bottom",width:"205px",children:jsxRuntime.jsx(NoDataState.default,{builderAttrs:t?.builderData,elementType:"secondary",description:"No discount",rawMode:!0,customClass:"!gp-p-[5px]"})});let p=system.createStyle(styles.getWrapperTextStyle(s)),y=system.createStyle(styles.getContainerStyle(s)),j=system.createClass(classes.getWrapperTextClass(s)),g=system.createClass(classes.getContainerClass()),f=system.createClass(classes.getRootClass({mode:r,salePrice:n,priceSave:d,bundleItem:l}));return jsxRuntime.jsx("div",{className:f,style:{...core.makeStyleResponsive("ta",o)},id:`shopify-text-element-${t?.uid}`,"data-id":t?.uid,"data-product-id":c,"gp-data-hidden":"false",children:system.If(!u," ",jsxRuntime.jsx("div",{className:g,style:y,children:jsxRuntime.jsx("div",{className:j,style:p,children:jsxRuntime.jsxs("div",{className:"gp-flex gp-break-all",children:[jsxRuntime.jsx(Text.default,{styles:s,setting:{...e,text:a?.prefix?.replaceAll(" ","&nbsp;"),options:{useState:!0,uniqueId:`${t?.uid}-prefix`},excludeFlex:!0}}),jsxRuntime.jsx(Text.default,{styles:s,setting:{...e,text:x,options:{isCannotEditing:!0},excludeFlex:!0}}),jsxRuntime.jsx(Text.default,{styles:s,setting:{...e,text:a?.suffix?.replaceAll(" ","&nbsp;"),excludeFlex:!0,options:{useState:!0,uniqueId:`${t?.uid}-suffix`}}})]})})}))})};exports.default=ProductTag;
