'use client';
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("@gem-sdk/core"),s=require("@gem-sdk/system"),r=require("./hooks/useProductQuantity.js"),a=require("./common/attrs.js"),l=require("./common/classes.js"),n=require("./common/styles.js"),u=require("./common/helpers.js");exports.default=o=>{let{setting:c={},styles:i={},builderProps:y,advanced:d}=o,g=t.useCurrentVariant(),{quantity:m}=t.useQuantity(),{isInStock:C,ref:S,onClickIncrement:p,onClickDecrement:b,onChangeInput:h,onFocusInput:j}=r.useProductQuantity(o),{plusIcon:B,minusIcon:I}=c,x=c.defaultQtyValue||1,{inputHeight:f,buttonBackgroundColor:q,backgroundColor:v,iconColor:A,inputBackgroundColor:N,textColor:H,align:_,borderBtn:k,buttonWidth:D,iconSizeCustom:M,corner:P}=i,Q=c?.hasButton,W=s.createAttr({...a.getContainerAttrs({isDisabled:!C,uid:y?.uid||""})}),L=s.createClass({...l.getContainerClasses(d?.cssClass)}),T=s.createStyle({...n.getContainerStyles({align:_,inputHeight:f})}),V=s.createClass({...l.getWrapperClasses()}),F=s.createStyle({...n.getWrapperStyles({backgroundColor:v,styles:i})}),O=s.createAttr({...a.getInputAttr({hasButton:Q,quantity:m,currentVariant:g,defaultQty:x})}),w=s.createClass({...l.getInputClasses({styles:i,borderBtn:k,inputBackgroundColor:N,textColor:H,isDisabled:!C})}),z=s.createStyle({...n.getInputStyle(o)}),E=s.createClass({...l.getButtonClass({borderBtn:k,buttonBackgroundColor:q,iconColor:A,buttonSide:"left",isDisabled:!C})}),G=s.createStyle({...n.getButtonStyle({borderBtn:k,buttonWidth:D,buttonBackgroundColor:q,iconColor:A,corner:P,enableHoverButton:c?.enableHoverButton})}),J=s.createAttr({...a.getButtonAttrs({buttonSide:"left"})}),K=s.createClass({...l.getButtonClass({borderBtn:k,buttonBackgroundColor:q,iconColor:A,buttonSide:"right",isDisabled:!C})}),R=s.createStyle({...n.getButtonStyle({borderBtn:k,buttonWidth:D,buttonBackgroundColor:q,iconColor:A,corner:P,flipStyle:!0,enableHoverButton:c?.enableHoverButton})}),U=s.createAttr({...a.getButtonAttrs({buttonSide:"right"})}),X=s.createClass({...l.getIconWrapperClasses()}),Y=s.createStyle({...u.getIconWidth(M)});return e.jsx("div",{ref:S,...W,className:L,style:T,children:e.jsxs("div",{className:V,style:F,children:[s.If(Q,e.jsx("button",{...J,onClick:b,className:E,style:G,children:e.jsx("span",{className:X,style:Y,dangerouslySetInnerHTML:{__html:u.getMinusIcon(I)}})})),e.jsx("input",{...O,className:w,style:z,onChange:e=>h(e),onFocus:e=>j(e)}),s.If(Q,e.jsx("button",{...U,onClick:p,className:K,style:R,children:e.jsx("span",{className:X,style:Y,dangerouslySetInnerHTML:{__html:u.getPlusIcon(B)}})}))]})})};
