@gem-sdk/components 2.0.0-staging.1130 → 2.0.0-staging.1132

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- "use strict";var core=require("@gem-sdk/core");const MINIMUM_CHILD=1,BODY_CHILD_INDEX=0,getDataState=(t,e)=>{let{setting:r={},styles:o={},builderProps:a}=t,{activeKey:i,iconSvg:n,expandItem:l,iconPosition:s,iconCollapseSize:g,iconGlobalSize:c,iconExpand:S,iconCollapse:p,layoutHeader:d,expandedMode:m,configIconSize:u}=r,{bgColor:I,color:D,headerBorder:L,width:v,fullWidth:C,textColor:y,itemHeaderSpacing:M,contentSizePadding:_,iconColor:x,headerContentPadding:N,widthHeightSize:P}=o,b="multiple"===m,h=t=>t?t.toString().toLowerCase().split(",").map(t=>parseInt(t.trim())-1).map(t=>t.toString()):[],q=l?h(i):[],H=b?[...q]:q,U=()=>({iconSvg:n,isIconPlus:"plus"===n,activeKey:i,expanded:b,expandItem:l,iconPosition:s,iconGlobalSize:c,iconCollapse:p,iconExpand:S,iconCollapseSize:g,layoutHeader:d,expandedMode:m,configIconSize:u,parentUid:a?.uid,childListNumber:l?i?.toString().toLowerCase()==="all"?e?.map((t,e)=>e.toString()):H:[],chidlrenUid:e?.map(t=>t.uid)}),k=()=>({bgColor:I,color:D,headerBorder:L,fullWidth:C,width:v,itemHeaderSpacing:M,textColor:y,iconColor:x,contentSizePadding:_,headerContentPadding:N,widthHeightSize:P});return{uidState:a?.uid,settingState:U(),stylesState:k(),accordions:H}},getParentSettings=(t={})=>{let{iconSvg:e,titleTypo:r,layoutHeader:o,iconGlobalSize:a,iconCollapseSize:i,iconCollapse:n,iconExpand:l,alignment:s,configIconSize:g,iconPosition:c}=t,S=r?{...r,attrs:{...r.attrs}}:void 0;return S?.attrs?.color&&delete S.attrs.color,{iconSvg:e,titleTypo:S,layoutHeader:o,iconGlobalSize:a,iconCollapseSize:i,iconCollapse:n,iconExpand:l,alignment:s,configIconSize:g,iconPosition:c}},getSettingItemLiquid=t=>{let{index:e,accordions:r,parentSetting:o,parentStyle:a}=t,{titleTypo:i,iconCollapse:n,iconExpand:l,activeKey:s,expandItem:g}=o??{};delete i?.attrs?.color;let{itemContentSpacing:c,iconColor:S,contentSizePadding:p}=a??{},d=!!g&&(s?.toString()?.toLowerCase()==="all"||r?.includes(e?.toString()??"")),m=core.makeGlobalSize(p),u=()=>{let t={...p&&m.padding,...c?.type||p?{}:core.composeSize(c?.custom)};return d?t:core.removePaddingYInStyle(t)},I=()=>l&&d?l:n&&!d?n:void 0,D=I(),L=()=>{let t={normal:S?.normal??"transparent",hover:S?.hover??S?.active??S?.normal??"transparent",active:S?.active??"transparent"};return d?core.makeStyle({c:core.getSingleColorVariable(t?.active)}):core.getGlobalColorStateStyle("c",t)};return{isShow:d,composeContentSizeStyle:u,collapsibleIcon:D,composeIconColor:L(),makeIcon:I}};exports.BODY_CHILD_INDEX=0,exports.MINIMUM_CHILD=1,exports.getDataState=getDataState,exports.getParentSettings=getParentSettings,exports.getSettingItemLiquid=getSettingItemLiquid;
1
+ "use strict";var core=require("@gem-sdk/core");const MINIMUM_CHILD=1,BODY_CHILD_INDEX=0,ICON_MINUS="<svg width='16' height='16' fill='currentColor' viewBox=\"0 0 448 512\"><path fill='currentColor' d=\"M400 288h-352c-17.69 0-32-14.32-32-32.01s14.31-31.99 32-31.99h352c17.69 0 32 14.3 32 31.99S417.7 288 400 288z\"/></svg>",ICON_PLUS="<svg fill='currentColor' width='16' height='16' xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 448 512\"><path fill='currentColor' d=\"M432 256c0 17.69-14.33 32.01-32 32.01H256v144c0 17.69-14.33 31.99-32 31.99s-32-14.3-32-31.99v-144H48c-17.67 0-32-14.32-32-32.01s14.33-31.99 32-31.99H192v-144c0-17.69 14.33-32.01 32-32.01s32 14.32 32 32.01v144h144C417.7 224 432 238.3 432 256z\"/></svg>",getDataState=(t,e)=>{let{setting:r={},styles:o={},builderProps:a}=t,{activeKey:i,iconSvg:l,expandItem:s,iconPosition:n,iconCollapseSize:c,iconGlobalSize:g,iconExpand:S,iconCollapse:I,layoutHeader:p,expandedMode:m,configIconSize:u}=r,{bgColor:d,color:v,headerBorder:C,width:N,fullWidth:h,textColor:L,itemHeaderSpacing:_,contentSizePadding:M,iconColor:U,headerContentPadding:w,widthHeightSize:x}=o,D="multiple"===m,O=t=>t?t.toString().toLowerCase().split(",").map(t=>parseInt(t.trim())-1).map(t=>t.toString()):[],P=s?O(i):[],H=D?[...P]:P,y=()=>({iconSvg:l,isIconPlus:"plus"===l,activeKey:i,expanded:D,expandItem:s,iconPosition:n,iconGlobalSize:g,iconCollapse:I,iconExpand:S,iconCollapseSize:c,layoutHeader:p,expandedMode:m,configIconSize:u,parentUid:a?.uid,childListNumber:s?i?.toString().toLowerCase()==="all"?e?.map((t,e)=>e.toString()):H:[],chidlrenUid:e?.map(t=>t.uid)}),b=()=>({bgColor:d,color:v,headerBorder:C,fullWidth:h,width:N,itemHeaderSpacing:_,textColor:L,iconColor:U,contentSizePadding:M,headerContentPadding:w,widthHeightSize:x});return{uidState:a?.uid,settingState:y(),stylesState:b(),accordions:H}},getParentSettings=(t={})=>{let{iconSvg:e,titleTypo:r,layoutHeader:o,iconGlobalSize:a,iconCollapseSize:i,iconCollapse:l,iconExpand:s,alignment:n,configIconSize:c,iconPosition:g}=t,S=r?{...r,attrs:{...r.attrs}}:void 0;return S?.attrs?.color&&delete S.attrs.color,{iconSvg:e,titleTypo:S,layoutHeader:o,iconGlobalSize:a,iconCollapseSize:i,iconCollapse:l,iconExpand:s,alignment:n,configIconSize:c,iconPosition:g}},composeIconSvg=({isShow:t,iconExpand:e,iconCollapse:r,iconSvg:o})=>e&&t?e:r&&!t?r:"plus"===o?t?ICON_MINUS:ICON_PLUS:o,getSettingItemLiquid=t=>{let{index:e,accordions:r,parentSetting:o,parentStyle:a}=t,{titleTypo:i,iconCollapse:l,iconExpand:s,activeKey:n,expandItem:c,iconSvg:g}=o??{};delete i?.attrs?.color;let{itemContentSpacing:S,iconColor:I,contentSizePadding:p}=a??{},m=!!c&&(n?.toString()?.toLowerCase()==="all"||r?.includes(e?.toString()??"")),u=core.makeGlobalSize(p),d=()=>{let t={...p&&u.padding,...S?.type||p?{}:core.composeSize(S?.custom)};return m?t:core.removePaddingYInStyle(t)},v=composeIconSvg({isShow:m,iconExpand:s,iconCollapse:l,iconSvg:g}),C=()=>{let t={normal:I?.normal??"transparent",hover:I?.hover??I?.active??I?.normal??"transparent",active:I?.active??"transparent"};return m?core.makeStyle({c:core.getSingleColorVariable(t?.active)}):core.getGlobalColorStateStyle("c",t)};return{isShow:m,composeContentSizeStyle:d,collapsibleIcon:v,composeIconColor:C(),makeIcon:v}};exports.BODY_CHILD_INDEX=0,exports.ICON_MINUS=ICON_MINUS,exports.ICON_PLUS=ICON_PLUS,exports.MINIMUM_CHILD=1,exports.composeIconSvg=composeIconSvg,exports.getDataState=getDataState,exports.getParentSettings=getParentSettings,exports.getSettingItemLiquid=getSettingItemLiquid;
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var core=require("@gem-sdk/core"),Text_liquid=require("../../text/components/Text.liquid.js"),helpers=require("../common/helpers.js"),system=require("@gem-sdk/system"),classes=require("../common/classes.js"),styles=require("../common/styles.js");const AccordionItem=e=>{let{parentUid:s,childrenIcon:t,rawChildren:l,index:a,builderProps:r,title:o}=e,{iconSvg:c,titleTypo:n,layoutHeader:i,iconGlobalSize:y,iconCollapseSize:d,iconCollapse:m,iconExpand:p,alignment:g,configIconSize:$,iconPosition:C}=helpers.getParentSettings(e.parentSetting)??{},{isShow:u,composeContentSizeStyle:S,collapsibleIcon:v,composeIconColor:I,makeIcon:x}=helpers.getSettingItemLiquid(e),h=system.createClass(classes.getItemContainerClasses),q=system.createClass(classes.getDropdownClasses(e.parentStyle,{isShow:u,uniqueId:s,makeIcon:x(),index:a})),f=system.createStyle(styles.getIconGlobalSize(y)),_=system.createClass(classes.getIconClasses),D=system.createClass(classes.getIconRotateClasses(e.parentStyle,{isShow:u,iconExpand:p,iconSvg:c,iconCollapse:m})),T=system.createClass(classes.getContentClasses(s)),w=system.createClass(classes.getGapClasses),R=system.createStyle(styles.getItemContainerStyles(e.parentStyle,!1)),j=system.createStyle(styles.getDropdownStyles(e.parentStyle,{isShow:u,iconPosition:C})),L=system.createStyle(styles.getDropdownTextStyles(e.parentStyle?.textColor,u)),M=system.createStyle(styles.getIconRotateStyles(e.parentStyle,u,d)),b=system.createStyle(styles.getGapStyles(y,g)),k=system.createClass(core.composeClasses("gp-inline-flex")),G=system.createClass(u?{...core.composeClasses("!gp-text-[var(--icon-active-color)]"),...classes.getLayoutIconClasses}:classes.getLayoutIconClasses),N=system.createStyle(styles.getIconStyles(I,$)),A=system.createClass(classes.getRenderChildrenClasses(e.parentStyle,{isShow:u,hasTransitionedIn:!1,isMounted:!1})),F=system.createStyle({...styles.getTemplateRow(u),...styles.getRenderChildrenStyles()}),H=system.createClass(core.composeClasses("gp-accordion-item_body-inner gp-transition-all gp-duration-500 gp-min-h-0")),O=()=>l&&l.length>=helpers.MINIMUM_CHILD?core.RenderChildren({...l[helpers.BODY_CHILD_INDEX]}):"";return core.template`
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var core=require("@gem-sdk/core"),Text_liquid=require("../../text/components/Text.liquid.js"),helpers=require("../common/helpers.js"),system=require("@gem-sdk/system"),classes=require("../common/classes.js"),styles=require("../common/styles.js");const AccordionItem=e=>{let{parentUid:s,childrenIcon:t,rawChildren:l,index:a,builderProps:r,title:o}=e,{iconSvg:c,titleTypo:n,layoutHeader:i,iconGlobalSize:y,iconCollapseSize:d,iconCollapse:m,iconExpand:p,alignment:g,configIconSize:$,iconPosition:C}=helpers.getParentSettings(e.parentSetting)??{},{isShow:u,composeContentSizeStyle:S,collapsibleIcon:v,composeIconColor:x,makeIcon:I}=helpers.getSettingItemLiquid(e),h=system.createClass(classes.getItemContainerClasses),q=system.createClass(classes.getDropdownClasses(e.parentStyle,{isShow:u,uniqueId:s,makeIcon:I,index:a})),f=system.createStyle(styles.getIconGlobalSize(y)),_=system.createClass(classes.getIconClasses),D=system.createClass(classes.getIconRotateClasses(e.parentStyle,{isShow:u,iconExpand:p,iconSvg:c,iconCollapse:m})),T=system.createClass(classes.getContentClasses(s)),w=system.createClass(classes.getGapClasses),R=system.createStyle(styles.getItemContainerStyles(e.parentStyle,!1)),j=system.createStyle(styles.getDropdownStyles(e.parentStyle,{isShow:u,iconPosition:C})),L=system.createStyle(styles.getDropdownTextStyles(e.parentStyle?.textColor,u)),M=system.createStyle(styles.getIconRotateStyles(e.parentStyle,u,d)),b=system.createStyle(styles.getGapStyles(y,g)),G=system.createClass(core.composeClasses("gp-inline-flex")),N=system.createClass(u?{...core.composeClasses("!gp-text-[var(--icon-active-color)]"),...classes.getLayoutIconClasses}:classes.getLayoutIconClasses),k=system.createStyle(styles.getIconStyles(x,$)),A=system.createClass(classes.getRenderChildrenClasses(e.parentStyle,{isShow:u,hasTransitionedIn:!1,isMounted:!1})),F=system.createStyle({...styles.getTemplateRow(u),...styles.getRenderChildrenStyles()}),H=system.createClass(core.composeClasses("gp-accordion-item_body-inner gp-transition-all gp-duration-500 gp-min-h-0")),O=()=>l&&l.length>=helpers.MINIMUM_CHILD?core.RenderChildren({...l[helpers.BODY_CHILD_INDEX]}):"";return core.template`
2
2
  <div class="${h}" style="${R}">
3
3
  <div data-index="${a?.toString()}" class="${T}">
4
4
  <div aria-hidden uid="${r?.uid}" id="${r?.uid}" data-index="${a?.toString()}"
@@ -14,19 +14,19 @@
14
14
  `)}
15
15
  <div class="${w}" style="${b}">
16
16
  ${system.If("before-text"===i,core.template`
17
- <div class="${k}" style="${{...f}}">
17
+ <div class="${G}" style="${{...f}}">
18
18
  <span
19
- class="${G}"
20
- style="${N}">
19
+ class="${N}"
20
+ style="${k}">
21
21
  ${t??""}</span>
22
22
  </div>
23
23
  `)}
24
24
  ${Text_liquid.default({style:{...L},styles:{typo:n},setting:{htmlTag:"div",text:o,excludeFlex:!0,isForceValue:!0},className:"gp-overflow-hidden gp-accordion-text-content group-hover:[color:var(--text-hover-color)!important]"})}
25
25
  ${system.If("after-text"===i,core.template`
26
- <div class="${k}" style="${{...f}}">
26
+ <div class="${G}" style="${{...f}}">
27
27
  <span
28
- class="${G}"
29
- style="${N}">
28
+ class="${N}"
29
+ style="${k}">
30
30
  ${t??""}</span>
31
31
  </div>
32
32
  `)}
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var core=require("@gem-sdk/core"),React=require("react"),useMountTransition=require("./useMountTransition.js"),useGetProductId=require("../../hooks/useGetProductId.js");const useAccordionItem=e=>{let{accordions:t,index:r,builderProps:o,parentSetting:c={},parentStyle:a={},handleDropDown:s}=e,{iconPosition:u,titleTypo:n,iconCollapse:i,iconExpand:l}=c;delete n?.attrs?.color;let{itemContentSpacing:d,iconColor:m,contentSizePadding:p}=a,g=t?.includes(r?.toString()??""),v=core.makeGlobalSize(p),M=core.useEditorMode(),[S,R]=React.useState(g),f=useMountTransition.default(S||!1,500);React.useEffect(()=>{R(g)},[g]);let I=React.useMemo(()=>l&&g?l:i&&!g?i:void 0,[g,i,l]),y=React.useMemo(()=>core.makeStyle({fd:"left"===u?"row":"row-reverse",jc:"right"===u?"space-between":""}),[u]),G=(e,t)=>{!e.target.closest(".gp-text")&&s&&t&&(R(!S),s(t))},P=React.useMemo(()=>{let e={normal:m?.normal??"transparent",hover:m?.hover??m?.active??m?.normal??"transparent",active:m?.active??m?.normal??"transparent"};return g?core.makeStyle({c:core.getSingleColorVariable(e?.active)}):core.getGlobalColorStateStyle("c",e)},[m,g]),{refContainer:b,productID:k}=useGetProductId.useGetProductId(),h=React.useMemo(()=>{let e=`gp-accordion-item-${o?.uid}-${r}`;return k?`${e}-${k}`:e},[o?.uid,r,k]),j=React.useMemo(()=>{let e={...p&&v.padding,...d?.type||p?{}:core.composeSize(d?.custom)};return g?e:core.removePaddingYInStyle(e)},[p,d,g,v]),q=React.useMemo(()=>f||S||"edit"!==M,[f,S,M]);return{productID:k,isShow:g,getIdDropdownItem:G,makeIcon:I,refContainer:b,uniqueId:h,isRenderChildren:q,composePosition:y,composeIconColor:P,composeContentSizeStyle:j,hasTransitionedIn:f,isMounted:S}};exports.default=useAccordionItem;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var core=require("@gem-sdk/core"),React=require("react"),useMountTransition=require("./useMountTransition.js"),useGetProductId=require("../../hooks/useGetProductId.js"),helpers=require("../common/helpers.js");const useAccordionItem=e=>{let{accordions:t,index:r,builderProps:o,parentSetting:c={},parentStyle:s={},handleDropDown:a}=e,{iconPosition:u,titleTypo:n,iconCollapse:i,iconExpand:l,iconSvg:d}=c;delete n?.attrs?.color;let{itemContentSpacing:m,iconColor:p,contentSizePadding:g}=s,v=t?.includes(r?.toString()??""),M=core.makeGlobalSize(g),S=core.useEditorMode(),[R,I]=React.useState(v),f=useMountTransition.default(R||!1,500);React.useEffect(()=>{I(v)},[v]);let h=React.useMemo(()=>helpers.composeIconSvg({isShow:v,iconExpand:l,iconCollapse:i,iconSvg:d}),[v,l,i,d]),y=React.useMemo(()=>core.makeStyle({fd:"left"===u?"row":"row-reverse",jc:"right"===u?"space-between":""}),[u]),G=(e,t)=>{!e.target.closest(".gp-text")&&a&&t&&(I(!R),a(t))},P=React.useMemo(()=>{let e={normal:p?.normal??"transparent",hover:p?.hover??p?.active??p?.normal??"transparent",active:p?.active??p?.normal??"transparent"};return v?core.makeStyle({c:core.getSingleColorVariable(e?.active)}):core.getGlobalColorStateStyle("c",e)},[p,v]),{refContainer:b,productID:j}=useGetProductId.useGetProductId(),k=React.useMemo(()=>{let e=`gp-accordion-item-${o?.uid}-${r}`;return j?`${e}-${j}`:e},[o?.uid,r,j]),q=React.useMemo(()=>{let e={...g&&M.padding,...m?.type||g?{}:core.composeSize(m?.custom)};return v?e:core.removePaddingYInStyle(e)},[g,m,v,M]),$=React.useMemo(()=>f||R||"edit"!==S,[f,R,S]);return{productID:j,isShow:v,getIdDropdownItem:G,makeIcon:h,refContainer:b,uniqueId:k,isRenderChildren:$,composePosition:y,composeIconColor:P,composeContentSizeStyle:q,hasTransitionedIn:f,isMounted:R}};exports.default=useAccordionItem;
@@ -1 +1 @@
1
- "use strict";var core=require("@gem-sdk/core"),system=require("@gem-sdk/system"),helpers=require("../../../../carousel/components/arrow/common/helpers.js");const defaultWidth={desktop:"1200px",tablet:"100%",mobile:"100%"},getStyleByDevice=(e,t,r)=>t?.[e]===!0?{contentWidth:"100%",wrapperWidth:"100%",wrapperPadding:"0px"}:r?.[e]==="100%"?{contentWidth:"100%",wrapperWidth:"100%",wrapperPadding:"var(--g-ct-p)"}:r?.[e]==="default"?{contentWidth:`var(--g-ct-w, ${defaultWidth[e]})`,wrapperWidth:`calc(var(--g-ct-w, ${defaultWidth[e]}) + 2 * var(--g-ct-p, 15px))`,wrapperPadding:"var(--g-ct-p, 15px)"}:r?.[e]!==void 0?{contentWidth:r?.[e],wrapperWidth:`calc(${r?.[e]} + 2 * var(--g-ct-p, 15px))`,wrapperPadding:"var(--g-ct-p, 15px)"}:{contentWidth:void 0,wrapperWidth:`calc(var(--g-ct-w, ${defaultWidth[e]}) + 2 * var(--g-ct-p, 15px))`,wrapperPadding:"var(--g-ct-p, 15px)"},createStyleObject=(e,t)=>{let r=getStyleByDevice("desktop",t,e),d=getStyleByDevice("tablet",t,e),o=getStyleByDevice("mobile",t,e);return{content:{desktop:r.contentWidth,tablet:d.contentWidth,mobile:o.contentWidth},wrapper:{desktop:r.wrapperWidth,tablet:d.wrapperWidth,mobile:o.wrapperWidth},padding:{desktop:r.wrapperPadding,tablet:d.wrapperPadding,mobile:o.wrapperPadding}}},getData=e=>{let{styles:t,builderProps:r}=e,d=system.createStateOrContext({background:t?.background,uid:r?.uid});return{stateData:core.dataStringify(d).replaceAll("'","&#039;")}};function reduceRadiusForState(e,t){if(!e||!t)return{};let r=("string"==typeof e?e.split(" "):[]).map(e=>parseInt(e,10)||0),d=Object.fromEntries(["btrr","bblr","bbrr","btlr"].map((e,d)=>[e,Math.max(0,(parseInt(t[e]??"0",10)||0)-(r[d]||0))+"px"]));return{...d,radiusType:t.radiusType}}function reduceBorderRadiusForDevice(e,t){if(!e||!t)return{};let r={};return["normal","hover","active"].forEach(d=>{let o=e?.[d],i=t?.[d];o&&i&&(r[d]=reduceRadiusForState(o.width,i))}),r}function getInnerRadiusExcludeBorder(e,t){return{desktop:reduceBorderRadiusForDevice(e?.desktop,t?.desktop),tablet:reduceBorderRadiusForDevice(e?.tablet??e?.desktop,t?.tablet??t?.desktop),mobile:reduceBorderRadiusForDevice(e?.mobile??e?.tablet??e?.desktop,t?.mobile??t?.tablet??t?.desktop)}}const checkHasBackgroundVideo=e=>core.DEVICES.some(t=>{let r=core.getValueByDevice(e,t);return!!r&&(r?.videoType==="html5"&&r?.videoHtml5||r?.videoType==="youtube"&&r?.video)}),isRenderHtmlVideo=e=>{let t=helpers.getResponsiveSetting(e||{}),r=t.desktop?.videoType,d=t.tablet?.videoType,o=t.mobile?.videoType;return"html5"==r||"html5"==d||"html5"==o},isRenderYoutubeVideo=e=>{let t=helpers.getResponsiveSetting(e||{}),r=t.desktop?.videoType,d=t.tablet?.videoType,o=t.mobile?.videoType;return"youtube"==r||"youtube"==d||"youtube"==o};exports.checkHasBackgroundVideo=checkHasBackgroundVideo,exports.createStyleObject=createStyleObject,exports.getData=getData,exports.getInnerRadiusExcludeBorder=getInnerRadiusExcludeBorder,exports.isRenderHtmlVideo=isRenderHtmlVideo,exports.isRenderYoutubeVideo=isRenderYoutubeVideo;
1
+ "use strict";var core=require("@gem-sdk/core"),system=require("@gem-sdk/system"),helpers=require("../../../../carousel/components/arrow/common/helpers.js");const defaultWidth={desktop:"1200px",tablet:"100%",mobile:"100%"},getStyleByDevice=(e,t)=>t?.[e]==="100%"?{contentWidth:"100%",wrapperWidth:"100%",wrapperPadding:"var(--g-ct-p)"}:t?.[e]==="default"?{contentWidth:`var(--g-ct-w, ${defaultWidth[e]})`,wrapperWidth:`calc(var(--g-ct-w, ${defaultWidth[e]}) + 2 * var(--g-ct-p, 15px))`,wrapperPadding:"var(--g-ct-p, 15px)"}:t?.[e]!==void 0?{contentWidth:t?.[e],wrapperWidth:`calc(${t?.[e]} + 2 * var(--g-ct-p, 15px))`,wrapperPadding:"var(--g-ct-p, 15px)"}:{contentWidth:void 0,wrapperWidth:`calc(var(--g-ct-w, ${defaultWidth[e]}) + 2 * var(--g-ct-p, 15px))`,wrapperPadding:"var(--g-ct-p, 15px)"},createStyleObject=e=>{let t=getStyleByDevice("desktop",e),r=getStyleByDevice("tablet",e),d=getStyleByDevice("mobile",e);return{content:{desktop:t.contentWidth,tablet:r.contentWidth,mobile:d.contentWidth},wrapper:{desktop:t.wrapperWidth,tablet:r.wrapperWidth,mobile:d.wrapperWidth},padding:{desktop:t.wrapperPadding,tablet:r.wrapperPadding,mobile:d.wrapperPadding}}},getData=e=>{let{styles:t,builderProps:r}=e,d=system.createStateOrContext({background:t?.background,uid:r?.uid});return{stateData:core.dataStringify(d).replaceAll("'","&#039;")}};function reduceRadiusForState(e,t){if(!e||!t)return{};let r=("string"==typeof e?e.split(" "):[]).map(e=>parseInt(e,10)||0),d=Object.fromEntries(["btrr","bblr","bbrr","btlr"].map((e,d)=>[e,Math.max(0,(parseInt(t[e]??"0",10)||0)-(r[d]||0))+"px"]));return{...d,radiusType:t.radiusType}}function reduceBorderRadiusForDevice(e,t){if(!e||!t)return{};let r={};return["normal","hover","active"].forEach(d=>{let o=e?.[d],i=t?.[d];o&&i&&(r[d]=reduceRadiusForState(o.width,i))}),r}function getInnerRadiusExcludeBorder(e,t){return{desktop:reduceBorderRadiusForDevice(e?.desktop,t?.desktop),tablet:reduceBorderRadiusForDevice(e?.tablet??e?.desktop,t?.tablet??t?.desktop),mobile:reduceBorderRadiusForDevice(e?.mobile??e?.tablet??e?.desktop,t?.mobile??t?.tablet??t?.desktop)}}const checkHasBackgroundVideo=e=>core.DEVICES.some(t=>{let r=core.getValueByDevice(e,t);return!!r&&(r?.videoType==="html5"&&r?.videoHtml5||r?.videoType==="youtube"&&r?.video)}),isRenderHtmlVideo=e=>{let t=helpers.getResponsiveSetting(e||{}),r=t.desktop?.videoType,d=t.tablet?.videoType,o=t.mobile?.videoType;return"html5"==r||"html5"==d||"html5"==o},isRenderYoutubeVideo=e=>{let t=helpers.getResponsiveSetting(e||{}),r=t.desktop?.videoType,d=t.tablet?.videoType,o=t.mobile?.videoType;return"youtube"==r||"youtube"==d||"youtube"==o};exports.checkHasBackgroundVideo=checkHasBackgroundVideo,exports.createStyleObject=createStyleObject,exports.getData=getData,exports.getInnerRadiusExcludeBorder=getInnerRadiusExcludeBorder,exports.isRenderHtmlVideo=isRenderHtmlVideo,exports.isRenderYoutubeVideo=isRenderYoutubeVideo;
@@ -1,2 +1,2 @@
1
1
  'use client';
2
- "use strict";var core=require("@gem-sdk/core"),system=require("@gem-sdk/system"),helpers=require("./helpers.js"),helper=require("../../../../post-purchase/common/helper.js");const getRowStyle=(e,t)=>{let{children:r,setting:o,builderProps:s,styles:l,style:i,advanced:p,isNotFullWidth:a,parentStyle:c}=e,{isSection:n,layout:d,horizontalAlign:m,responsive:y,inlineAlignment:b}=o??{},{width:u,columnGap:g,rowGap:k,fullWidth:S,background:v,verticalGutter:h,verticalGutterMobile:R,enablePagePadding:f,height:x}=l??{},w=helpers.getInnerRadiusExcludeBorder(p?.border,p?.rounded),B=(e,t)=>{let r=e?.normal,o=t?.normal;if(!r||!o||o?.borderType=="none"||"square"===r.radiusType||"none"===r.radiusType)return!1;for(let e in r)if(Object.hasOwn(r,e)&&"0px"!==r[e])return!0;return!1},D=core.makeStyleResponsive("of",{desktop:B(w.desktop,core.getValueByDevice(p?.border,"desktop"))?"hidden":void 0,tablet:B(w.tablet,core.getValueByDevice(p?.border,"tablet"))?"hidden":void 0,mobile:B(w.mobile,core.getValueByDevice(p?.border,"mobile"))?"hidden":void 0}),j=s?.builderData?.childrens?.length,q={...core.makeStyleResponsive("aspect",{desktop:"16/9"})},V=core.isEmptyChildren(r)||!j,O={desktop:u?.desktop==="default"?"1200px":u?.desktop,tablet:u?.tablet==="default"?"1200px":u?.tablet,mobile:u?.mobile==="default"?"1200px":u?.mobile},T=helpers.createStyleObject(t?O:u,S),[C,E]=core.splitStyle(["pos","top","left","bottom","right","z"],i),G=()=>({...n?E:i,...core.makeStyleResponsive("cg",h),...core.makeStyleResponsive("rg",R),...d?core.composeGridLayout(d):core.makeStyleResponsive("gtc",y),...core.makeStyleResponsive("w",T.content),...core.makeStyleResponsive("h",x),...n?{}:D}),L=()=>({"--mb":"0px","--mt":"0px",...core.makeStyleResponsive("cg",g),...core.makeStyle({pc:b,rg:k?helper.postPurchaseViewSpacing[k]:"0px"})}),z=e=>({...core.getStyleBackgroundByDevice(v,e),...core.getGradientBgrStyleByDevice(v,{desktop:!0,tablet:!0,mobile:!0}),...core.makeStyleResponsive("pc",m)}),H=()=>{let e=a&&!V;return e?{marginLeft:"0px",marginRight:"0px"}:{}},I=()=>({...core.composeRadius(w)}),P=(e=!1)=>system.createStyle({...G(),...z(),...H(),...e?L():{},...o?.sameHeightSubgridContainer&&c}),Y=system.createStyle({...I()}),A=system.createStyle({...q,"pointer-events":"none",transform:"translateY(-50%)",height:"100%","object-fit":"cover",top:"50%"}),F=e=>{if(void 0!==e)return e?"var(--g-ct-p, 15px)":"none"},J={desktop:F(f?.desktop),tablet:F(f?.tablet),mobile:F(f?.mobile)},K=system.createStyle({...C,...core.makeStyleResponsive("w",T.wrapper),...core.makeStyleResponsive("pl",J),...core.makeStyleResponsive("pr",J)});return{embedVideoStyle:A,backgroundBoxStyle:Y,rowStyle:P,sectionStyle:K}};exports.getRowStyle=getRowStyle;
2
+ "use strict";var core=require("@gem-sdk/core"),system=require("@gem-sdk/system"),helpers=require("./helpers.js"),helper=require("../../../../post-purchase/common/helper.js");const getRowStyle=(e,t)=>{let{children:r,setting:o,builderProps:s,styles:l,style:i,advanced:p,isNotFullWidth:a,parentStyle:c}=e,{isSection:n,layout:d,horizontalAlign:m,responsive:y,inlineAlignment:b}=o??{},{width:u,columnGap:g,rowGap:k,background:S,verticalGutter:v,verticalGutterMobile:h,enablePagePadding:R,height:f}=l??{},x=helpers.getInnerRadiusExcludeBorder(p?.border,p?.rounded),w=(e,t)=>{let r=e?.normal,o=t?.normal;if(!r||!o||o?.borderType=="none"||"square"===r.radiusType||"none"===r.radiusType)return!1;for(let e in r)if(Object.hasOwn(r,e)&&"0px"!==r[e])return!0;return!1},B=core.makeStyleResponsive("of",{desktop:w(x.desktop,core.getValueByDevice(p?.border,"desktop"))?"hidden":void 0,tablet:w(x.tablet,core.getValueByDevice(p?.border,"tablet"))?"hidden":void 0,mobile:w(x.mobile,core.getValueByDevice(p?.border,"mobile"))?"hidden":void 0}),D=s?.builderData?.childrens?.length,j={...core.makeStyleResponsive("aspect",{desktop:"16/9"})},q=core.isEmptyChildren(r)||!D,V={desktop:u?.desktop==="default"?"1200px":u?.desktop,tablet:u?.tablet==="default"?"1200px":u?.tablet,mobile:u?.mobile==="default"?"1200px":u?.mobile},O=helpers.createStyleObject(t?V:u),[T,C]=core.splitStyle(["pos","top","left","bottom","right","z"],i),E=()=>({...n?C:i,...core.makeStyleResponsive("cg",v),...core.makeStyleResponsive("rg",h),...d?core.composeGridLayout(d):core.makeStyleResponsive("gtc",y),...core.makeStyleResponsive("w",O.content),...core.makeStyleResponsive("h",f),...n?{}:B}),G=()=>({"--mb":"0px","--mt":"0px",...core.makeStyleResponsive("cg",g),...core.makeStyle({pc:b,rg:k?helper.postPurchaseViewSpacing[k]:"0px"})}),L=e=>({...core.getStyleBackgroundByDevice(S,e),...core.getGradientBgrStyleByDevice(S,{desktop:!0,tablet:!0,mobile:!0}),...core.makeStyleResponsive("pc",m)}),z=()=>{let e=a&&!q;return e?{marginLeft:"0px",marginRight:"0px"}:{}},H=()=>({...core.composeRadius(x)}),I=(e=!1)=>system.createStyle({...E(),...L(),...z(),...e?G():{},...o?.sameHeightSubgridContainer&&c}),P=system.createStyle({...H()}),Y=system.createStyle({...j,"pointer-events":"none",transform:"translateY(-50%)",height:"100%","object-fit":"cover",top:"50%"}),A=e=>{if(void 0!==e)return e?"var(--g-ct-p, 15px)":"none"},F={desktop:A(R?.desktop),tablet:A(R?.tablet),mobile:A(R?.mobile)},J=system.createStyle({...T,...core.makeStyleResponsive("w",O.wrapper),...core.makeStyleResponsive("pl",F),...core.makeStyleResponsive("pr",F)});return{embedVideoStyle:Y,backgroundBoxStyle:P,rowStyle:I,sectionStyle:J}};exports.getRowStyle=getRowStyle;
@@ -1 +1 @@
1
- "use strict";var core=require("@gem-sdk/core"),helpers=require("./helpers.js");function composeClasses(e){return e.split(" ").reduce((e,s)=>(e[s]=!0,e),{})}const getClasses=({setting:e,builderProps:s,advancedCssClass:t})=>{let o="gp-group/hero gp-flex gp-w-full gp-flex-col gp-self-center gp-transition-colors gp-duration-200 gp-ease-in-out";return t&&(o+=` ${t}`),{...s?.uid&&{[s.uid]:!0},...composeClasses(o),...helpers.getClassAlignBanner(helpers.getResponsiveSetting(e?.alignBanner||{}))}},getLinkClasses=()=>({...composeClasses("gp-cursor-pointer gp-h-full")}),getContainerClasses=(e,s)=>({...composeClasses("gp-relative gp-flex gp-w-full gp-flex-col gp-items-center gp-overflow-hidden hero-banner-container"),...helpers.getClassContentPosition(helpers.getContentPosition(e?.layout,s?.contentPosition1Col,s?.contentPosition2Col)||{})}),enableTransitionHover=e=>{let{overlayColor:s}=e??{},t=s?.hover||s?.normal;return t&&"transparent"!==t&&"0%"!=helpers.getOpacityHover(e)},getOverlayClasses=e=>{let{overlayColor:s,hoverEffect:t}=e??{},{disableOpacity:o}=helpers.opacityEnabledData(e),a="gp-absolute gp-inset-0 gp-left-[var(--left)] gp-top-[var(--top)] gp-z-1";return enableTransitionHover(e)&&(a+=" gp-transition-all gp-duration-300"),t&&(a+=" group-hover/hero:gp-bg-[color:var(--hvr-bgc,_var(--bgc))] group-hover/hero:gp-opacity-[var(--hvr-op,_var(--op))]"),core.getGlobalColorStateClass("bg",s,o,!t)&&(a+=` ${core.getGlobalColorStateClass("bg",s,o,!t)}`),composeClasses(a)},getRowClasses=(e,s)=>{let{sizeSetting:t,background:o}=e??{},{verticalAlign:a}=s??{},l=helpers.getClassForContentByFitContent(t,o),r=helpers.getClassForStretchContent(a),g=helpers.getClassSpaceBetween(s?.layout||{},e?.contentPosition1Col||{},e?.contentPosition2Col||{}),p=helpers.getClassSpaceBetweenLeftRight(s?.layout||{}),n=`gp-hero-banner-row ${l} ${r}`;return{...composeClasses(n),...g,...p}},getAdaptiveClasses=()=>composeClasses("adaptive-hero-banner"),getAdaptivePictureClasses=()=>composeClasses("gp-w-full"),getBackgroundClasses=(e,s)=>{let t="hero-banner-bg gp-hero-banner-image-background hero-banner-bg-parallax";return s&&(t+=" gp_lazybg"),e&&(t+=" gp-duration-[var(--duration)] group-hover/hero:gp-scale-[var(--scale)] gp-transition-transform"),composeClasses(t)},getContainBackgroundClasses=()=>composeClasses("gp-hero-banner-bg gp-absolute gp-overflow-hidden gp-w-full gp-h-full top-0 left-0"),getHtml5VideoClasses=(e,s=!1)=>{let t="gp-relative",o=core.getValueByDevice(e,"tablet"),a=core.getValueByDevice(e,"mobile");return s&&(t+=" gp-hidden"),o&&(t+=" tablet:gp-h-full tablet:gp-object-cover"),a&&(t+=" mobile:gp-h-full mobile:gp-object-cover"),composeClasses(t)},getWrapperYoutubeClasses=()=>composeClasses("gp-pb-[56.25%] gp-h-full gp-w-full !gp-max-w-none gp-pointer-events-none"),getIframeYoutubeClasses=()=>composeClasses("!gp-w-[500%] !gp-ml-[-200%] !gp-h-full !gp-max-w-none gp-scale-[104%]"),getLazyBackgroundClasses=e=>{let s="gp-absolute gp-top-0 gp-invisible gp-w-full gp_lazyload gp-h-full gp_lazyforbg";return"tablet"===e&&(s+=" gp_lazybg_tl"),"mobile"===e&&(s+=" gp_lazybg_mb"),composeClasses(s)};exports.enableTransitionHover=enableTransitionHover,exports.getAdaptiveClasses=getAdaptiveClasses,exports.getAdaptivePictureClasses=getAdaptivePictureClasses,exports.getBackgroundClasses=getBackgroundClasses,exports.getClasses=getClasses,exports.getContainBackgroundClasses=getContainBackgroundClasses,exports.getContainerClasses=getContainerClasses,exports.getHtml5VideoClasses=getHtml5VideoClasses,exports.getIframeYoutubeClasses=getIframeYoutubeClasses,exports.getLazyBackgroundClasses=getLazyBackgroundClasses,exports.getLinkClasses=getLinkClasses,exports.getOverlayClasses=getOverlayClasses,exports.getRowClasses=getRowClasses,exports.getWrapperYoutubeClasses=getWrapperYoutubeClasses;
1
+ "use strict";var core=require("@gem-sdk/core"),helpers=require("./helpers.js");function composeClasses(e){return e.split(" ").reduce((e,s)=>(e[s]=!0,e),{})}const getClasses=({setting:e,builderProps:s,advancedCssClass:t})=>{let o="gp-group/hero gp-flex gp-w-full gp-flex-col gp-self-center gp-transition-colors gp-duration-200 gp-ease-in-out";return t&&(o+=` ${t}`),{...s?.uid&&{[s.uid]:!0},...composeClasses(o),...helpers.getClassAlignBanner(helpers.getResponsiveSetting(e?.alignBanner||{}))}},getLinkClasses=()=>({...composeClasses("gp-cursor-pointer gp-h-full")}),getContainerClasses=(e,s)=>({...composeClasses("gp-relative gp-flex gp-w-full gp-flex-col gp-items-center gp-overflow-hidden hero-banner-container"),...helpers.getClassContentPosition(helpers.getContentPosition(e?.layout,s?.contentPosition1Col,s?.contentPosition2Col)||{})}),enableTransitionHover=e=>{let{overlayColor:s}=e??{},t=s?.hover||s?.normal;return t&&"transparent"!==t&&"0%"!=helpers.getOpacityHover(e)},getOverlayClasses=e=>{let{overlayColor:s,hoverEffect:t}=e??{},{disableOpacity:o}=helpers.opacityEnabledData(e),a="gp-absolute gp-inset-0 gp-left-[var(--left)] gp-top-[var(--top)] gp-z-1";return enableTransitionHover(e)&&(a+=" gp-transition-all gp-duration-300"),t&&(a+=" group-hover/hero:gp-bg-[color:var(--hvr-bgc,_var(--bgc))] group-hover/hero:gp-opacity-[var(--hvr-op,_var(--op))]"),core.getGlobalColorStateClass("bg",s,o,!t)&&(a+=` ${core.getGlobalColorStateClass("bg",s,o,!t)}`),composeClasses(a)},getRowClasses=(e,s)=>{let{sizeSetting:t,background:o}=e??{},{verticalAlign:a}=s??{},l=helpers.getClassForContentByFitContent(t,o),r=helpers.getClassForStretchContent(a),g=helpers.getClassSpaceBetween(s?.layout||{},e?.contentPosition1Col||{}),p=helpers.getClassSpaceBetweenLeftRight(s?.layout||{}),n=`gp-hero-banner-row ${l} ${r}`;return{...composeClasses(n),...g,...p}},getAdaptiveClasses=()=>composeClasses("adaptive-hero-banner"),getAdaptivePictureClasses=()=>composeClasses("gp-w-full"),getBackgroundClasses=(e,s)=>{let t="hero-banner-bg gp-hero-banner-image-background hero-banner-bg-parallax";return s&&(t+=" gp_lazybg"),e&&(t+=" gp-duration-[var(--duration)] group-hover/hero:gp-scale-[var(--scale)] gp-transition-transform"),composeClasses(t)},getContainBackgroundClasses=()=>composeClasses("gp-hero-banner-bg gp-absolute gp-overflow-hidden gp-w-full gp-h-full top-0 left-0"),getHtml5VideoClasses=(e,s=!1)=>{let t="gp-relative",o=core.getValueByDevice(e,"tablet"),a=core.getValueByDevice(e,"mobile");return s&&(t+=" gp-hidden"),o&&(t+=" tablet:gp-h-full tablet:gp-object-cover"),a&&(t+=" mobile:gp-h-full mobile:gp-object-cover"),composeClasses(t)},getWrapperYoutubeClasses=()=>composeClasses("gp-pb-[56.25%] gp-h-full gp-w-full !gp-max-w-none gp-pointer-events-none"),getIframeYoutubeClasses=()=>composeClasses("!gp-w-[500%] !gp-ml-[-200%] !gp-h-full !gp-max-w-none gp-scale-[104%]"),getLazyBackgroundClasses=e=>{let s="gp-absolute gp-top-0 gp-invisible gp-w-full gp_lazyload gp-h-full gp_lazyforbg";return"tablet"===e&&(s+=" gp_lazybg_tl"),"mobile"===e&&(s+=" gp_lazybg_mb"),composeClasses(s)};exports.enableTransitionHover=enableTransitionHover,exports.getAdaptiveClasses=getAdaptiveClasses,exports.getAdaptivePictureClasses=getAdaptivePictureClasses,exports.getBackgroundClasses=getBackgroundClasses,exports.getClasses=getClasses,exports.getContainBackgroundClasses=getContainBackgroundClasses,exports.getContainerClasses=getContainerClasses,exports.getHtml5VideoClasses=getHtml5VideoClasses,exports.getIframeYoutubeClasses=getIframeYoutubeClasses,exports.getLazyBackgroundClasses=getLazyBackgroundClasses,exports.getLinkClasses=getLinkClasses,exports.getOverlayClasses=getOverlayClasses,exports.getRowClasses=getRowClasses,exports.getWrapperYoutubeClasses=getWrapperYoutubeClasses;
@@ -1 +1 @@
1
- "use strict";var core=require("@gem-sdk/core"),helpers=require("../../image/common/helpers.js"),constant=require("../../constant.js");const getContentPosition=(e,t,o)=>{let l={};return core.DEVICES.map(i=>{let n=core.getResponsiveValueByScreen(e,i),a=core.getResponsiveValueByScreen(t,i),r=core.getResponsiveValueByScreen(o,i);l={...l,[i]:1>=(n?.cols?.length||1)?a:r}}),l},getAspectRatioSettings=(e,t)=>{let o={desktop:e?.desktop?.width,tablet:e?.tablet?.width,mobile:e?.mobile?.width},l={desktop:e?.desktop?.height,tablet:e?.tablet?.height,mobile:e?.mobile?.height},i={desktop:t?.desktop==="custom"?`${core.getResponsiveValueByScreen(o,"desktop")}/${core.getResponsiveValueByScreen(l,"desktop")}`:t?.desktop==="cover"?"unset":t?.desktop,tablet:t?.tablet==="custom"?`${core.getResponsiveValueByScreen(o,"tablet")}/${core.getResponsiveValueByScreen(l,"tablet")}`:t?.tablet==="cover"?"unset":t?.tablet,mobile:t?.mobile==="custom"?`${core.getResponsiveValueByScreen(o,"mobile")}/${core.getResponsiveValueByScreen(l,"mobile")}`:t?.mobile==="cover"?"unset":t?.mobile};return i},getEnableBgImageByDevice=(e,t)=>{if(!core.getResponsiveValueByScreen(getBgImage(t),e))return!1;if(!t?.[e]){if("mobile"===e)return t?.tablet?.type==="image"||t?.desktop?.type==="image"&&!t?.tablet;if("tablet"===e)return t?.desktop?.type==="image"}return t?.[e]?.type==="image"},getBgImage=e=>{if(!e)return{};let t={desktop:e?.desktop?.image,tablet:e?.tablet?.image,mobile:e?.mobile?.image};return t},imagePlaceholder=e=>{let t=getBgImage(e);return{desktop:helpers.createBlurDataURL(t?.desktop?.width??0,t?.desktop?.height??0),tablet:helpers.createBlurDataURL(t?.tablet?.width??t?.desktop?.width??0,t?.tablet?.height??t?.desktop?.width??0),mobile:helpers.createBlurDataURL(t?.mobile?.width??t?.tablet?.width??t?.desktop?.width??0,t?.mobile?.height??t?.tablet?.height??t?.desktop?.width??0)}},getBgImageByScreen=(e,t,o,l)=>{if(!e)return"";let i=getBgImage(e),n=core.getResponsiveValueByScreen(e,t),a=o?`url(${imagePlaceholder(e)[t]})`:`url(${helpers.getImageSrc(core.getResponsiveValueByScreen(i,t),t,l)})`,r=n?.color?`, ${n.color}`:"";return n?.color?.includes(core.GRADIENT_BGR_KEY)&&n?.type==="image"?`${a}${r}`:n?.color?.includes(core.GRADIENT_BGR_KEY)&&n?.type!=="image"?`${n.color}`:n?.type==="image"?a:"url()"},getBackgroundImageHeroBanner=(e,t=!1,o=!1)=>{if(!e)return;let l={};return core.DEVICES.forEach(i=>{l={...l,[i]:getBgImageByScreen(e,i,t,o)}}),core.makeStyleResponsive("bgi",l)},getAttachmentDevice=e=>{let t={},o=["desktop","mobile","tablet"];return o.forEach(o=>{let l=e?.[o]?.attachment;t={...t,[o]:"fixed"===l?"fixed":"absolute"}}),t},horizontalAlign=(e,t,o)=>mapContentPositionToHorizontal(getContentPosition(e,t,o)),scrollToContentBanner=e=>e?.target?.closest("div.gp-hero-banner-row")?.scrollTo(0,0),getDataVideoHeroBannerResponsive=(e,t)=>{switch(e){case"desktop":if(t?.desktop?.type==="video")return{device:"desktop",data:t.desktop};break;case"tablet":if(t?.tablet?.type==="video")return{device:"tablet",data:t.tablet};if(!t?.tablet&&t?.desktop?.type==="video")return{device:"desktop",data:t.desktop};break;case"mobile":if(t?.mobile?.type==="video")return{device:"mobile",data:t.mobile};if(!t?.mobile&&t?.tablet?.type==="video")return{device:"tablet",data:t.tablet};if(!t?.mobile&&!t?.tablet?.type&&t?.desktop?.type==="video")return{device:"desktop",data:t.desktop}}},getVisibilityStyle=e=>e?Object.keys(e).filter(e=>["--d","--d-tablet","--d-mobile"].includes(e)).reduce((t,o)=>({...t,[o]:e?.[o]!=="none"?"flex":e?.[o]}),{}):{},getStyleAspectRatioHeroBannerCustom=(e,t,o)=>{let l=core.getAspectRatioGlobalSize(t),i=["desktop","mobile","tablet"];return i.forEach(i=>{let n=core.getResponsiveValueByScreen(t,i),a=!!getDataVideoHeroBannerResponsive(i,e),r=n?.shape,s=n?.height,g="original"===r&&"fit-content"!==s,p=g&&a;p&&(l={...l,[i]:"16/9"}),o&&o[i]&&getDataVideoHeroBannerResponsive(i,e)?.data?.videoType==="html5"&&(l={...l,[i]:o[i]})}),core.makeStyleResponsive("aspect",l)},mapContentPositionToHorizontal=e=>{let t={};for(let o in e)"top"===e[o]?t[o]="start":"bottom"===e[o]?t[o]="end":t[o]="center";return t},getDisplayStyleByFitContent=(e,t)=>{let o={desktop:"none",tablet:"none",mobile:"none"},l=["desktop","mobile","tablet"];return l.forEach(l=>{let i=core.getResponsiveValueByScreen(e,l),n=!!getDataVideoHeroBannerResponsive(l,t),a=i?.shape,r=i?.height,s="original"===a&&"fit-content"!==r&&!n;o={...o,[l]:s?"block":"none"}}),core.makeStyleResponsive("d",o)},getWidth=e=>{let t={},o=["desktop","mobile","tablet"];return o.forEach(o=>{let l=e?.[o];l&&(t={...t,[o]:"default"===l?"var(--g-ct-w, 1200px)":l})}),t},getPercentageVisible=(e,t)=>{let{top:o,height:l}=e,i=-l;if(o<i)return 0;if(o>t)return 100;let n=(o-i)/(t-i)*100;return Math.min(Math.max(n,0),100)},isScaleImage=({enableParallax:e=!1,attachment:t="scroll"})=>!!e||"fixed"===t,getHeightHeroBanner=(e,t)=>{let o={},l=["desktop","mobile","tablet"];return l.forEach(l=>{let i=isScaleImage({enableParallax:t,attachment:e[l]?.attachment});o={...o,[l]:t?"150%":i?"100vh":"100%"}}),core.makeStyleResponsive("h",o)},getWidthHeroBanner=(e,t)=>{let o={},l=["desktop","mobile","tablet"];return l.forEach(l=>{let i=isScaleImage({enableParallax:t,attachment:e[l]?.attachment});o={...o,[l]:i?"100vw":"100%"}}),core.makeStyleResponsive("w",o)},getTopHeroBanner=e=>{let t={},o=["desktop","mobile","tablet"];return o.forEach(o=>{t={...t,[o]:e[o]?.attachment==="fixed"?"0px":""}}),core.makeStyleResponsive("top",t)},getStyleHeroBannerBg=(e,t)=>{let o=getHeightHeroBanner(e,t),l=getWidthHeroBanner(e,t),i=getTopHeroBanner(e);return{...o,...l,...i}},calcRounderClipPath=(e,t=0,o=0)=>{let l=t,i=t;if(t>o?l=o:i=o,e>=999){let t=e-l;return t>0?t:0}let n=e-i;return n>0?n:0},getClipPath=(e,t)=>{if(!t||!e)return"inset(0 0 0)";let[o,l,i,n]=e.split(" ").map(e=>parseInt(e??"0")),{btlr:a,btrr:r,bbrr:s,bblr:g}=t,p=calcRounderClipPath(parseInt(a??"0"),o,n),c=calcRounderClipPath(parseInt(r??"0"),o,l),b=calcRounderClipPath(parseInt(s??"0"),l,i),m=calcRounderClipPath(parseInt(g??"0"),i,n);return`inset(0 0 0 round ${p}px ${c}px ${b}px ${m}px)`},getClassAlignBanner=e=>({"!gp-self-start":"left"===e.desktop,"!gp-self-center":"center"===e.desktop,"!gp-self-end":"right"===e.desktop,"tablet:!gp-self-start":"left"===e.tablet,"tablet:!gp-self-center":"center"===e.tablet,"tablet:!gp-self-end":"right"===e.tablet,"mobile:!gp-self-start":"left"===e.mobile,"mobile:!gp-self-center":"center"===e.mobile,"mobile:!gp-self-end":"right"===e.mobile}),getClassSpaceBetween=(e,t,o)=>{let l=getResponsiveSetting(e),i=getResponsiveSetting(t),n=getResponsiveSetting(o),a=1>=(l?.desktop?.cols?.length||1)?i.desktop:n.desktop,r=1>=(l?.tablet?.cols?.length||1)?i.tablet:n.tablet,s=1>=(l?.mobile?.cols?.length||1)?i.mobile:n.mobile;return{"!gp-h-full !gp-content-stretch [&>*]:!gp-justify-between [&>*:nth-child(2)]:gp-absolute [&>*:nth-child(2)]:gp-hidden":l.desktop?.cols?.length===1&&"space-between"===a,"!gp-content-stretch [&>*]:!gp-justify-start":l.desktop?.cols?.length===1&&"top"===a,"tablet:!gp-h-full tablet:!gp-content-stretch tablet:[&>*]:!gp-justify-between tablet:[&>*:nth-child(2)]:gp-absolute tablet:[&>*:nth-child(2)]:gp-hidden":l.tablet?.cols?.length===1&&"space-between"===r,"tablet:!gp-content-stretch tablet:[&>*]:!gp-justify-start":l.tablet?.cols?.length===1&&"top"===r,"tablet:!gp-content-stretch tablet:[&>*]:!gp-justify-center":l.tablet?.cols?.length===1&&"center"===r,"tablet:!gp-content-stretch tablet:[&>*]:!gp-justify-end":l.tablet?.cols?.length===1&&"bottom"===r,"mobile:!gp-h-full mobile:!gp-content-stretch mobile:[&>*]:!gp-justify-between mobile:[&>*:nth-child(2)]:gp-absolute mobile:[&>*:nth-child(2)]:gp-hidden":l.mobile?.cols?.length===1&&"space-between"===s,"mobile:[&>*]:!gp-justify-between mobile:[&>*:nth-child(2)]:gp-relative mobile:[&>*:nth-child(2)]:gp-flex":l.mobile?.cols?.length!==1,"mobile:!gp-content-stretch mobile:[&>*]:!gp-justify-start":l.mobile?.cols?.length===1&&"top"===s,"mobile:!gp-content-stretch mobile:[&>*]:!gp-justify-center":l.mobile?.cols?.length===1&&"center"===s,"mobile:!gp-content-stretch mobile:[&>*]:!gp-justify-end":l.mobile?.cols?.length===1&&"bottom"===s}},getClassSpaceBetweenLeftRight=e=>{let t=getResponsiveSetting(e),o=t?.desktop?.type=="left-distributed"||t?.desktop?.type=="right-distributed",l=t?.tablet?.type=="left-distributed"||t?.tablet?.type=="right-distributed",i=t?.mobile?.type=="left-distributed"||t?.mobile?.type=="right-distributed";return{"gp-h-full tablet:gp-h-auto mobile:gp-h-auto [&>*]:!gp-justify-between":o,"tablet:!gp-h-full tablet:[&>*]:!gp-justify-between mobile:gp-h-auto":l,"mobile:!gp-h-full mobile:[&>*]:!gp-justify-between":i,"mobile:!gp-h-auto":!i}},getClassForStretchContent=e=>{let t={desktop:"none",tablet:"none",mobile:"none"},o=["desktop","mobile","tablet"];return o.forEach(o=>{let l=core.getResponsiveValueByScreen(e,o);t={...t,[o]:l}}),core.cls("space-between"===t.desktop?"[&>*>*]:!gp-justify-between":"","space-between"===t.tablet?"tablet:[&>*>*]:!gp-justify-between ":`tablet:[&>*>*]:!gp-justify-${e?.tablet}`,"space-between"===t.mobile?"mobile:[&>*>*]:!gp-justify-between ":`mobile:[&>*>*]:!gp-justify-${e?.mobile}`)},getClassForContentByFitContent=(e,t)=>{let o={desktop:!1,tablet:!1,mobile:!1},l=["desktop","mobile","tablet"];return l.forEach(l=>{let i=core.getResponsiveValueByScreen(e,l),n=!!getDataVideoHeroBannerResponsive(l,t),a=i?.shape,r=i?.height,s="original"===a&&"fit-content"!==r;o={...o,[l]:s&&!n}}),core.cls(o.desktop?"!gp-absolute":"",o.tablet?"tablet:!gp-absolute":"tablet:!gp-relative",o.mobile?"mobile:!gp-absolute":"mobile:!gp-relative")},getClassContentPosition=e=>{let t={center:"center",top:"start",bottom:"end","space-between":"between"},o=e.desktop||"center",l=e.tablet||o,i=e.mobile||l;return{[`gp-justify-${t[o||"center"]}`]:!!o,[`tablet:gp-justify-${t[l||"center"]}`]:!!l,[`mobile:gp-justify-${t[i||"center"]}`]:!!i}},getResponsiveSetting=e=>{let t=e.desktop,o=e.tablet?e.tablet:t,l=e.mobile?e.mobile:o;return{desktop:t,tablet:o,mobile:l}},showVideoType=e=>core.DEVICES.some(t=>{let o=core.getValueByDevice(e,t);return o?.type!=="color"&&o?.type!=="image"&&!!o&&(o?.videoType==="html5"&&o?.videoHtml5||o?.videoType==="youtube"&&o?.video)});function debounce(e,t){let o;return function(...l){clearTimeout(o),o=setTimeout(()=>e.apply(this,l),t)}}const fallbackImg="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTkyMCIgaGVpZ2h0PSI5MDAiIHZlcnNpb249IjEuMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayI+CiAgICA8ZGVmcz4KICAgICAgPGxpbmVhckdyYWRpZW50IGlkPSJnLTE5MjAtOTAwIj4KICAgICAgICA8c3RvcCBzdG9wLWNvbG9yPSJyZ2JhKDUxLCA1MSwgNTEsIDApIiBvZmZzZXQ9IjIwJSIgLz4KICAgICAgICA8c3RvcCBzdG9wLWNvbG9yPSJyZ2JhKDUxLCA1MSwgNTEsIDApIiBvZmZzZXQ9IjUwJSIgLz4KICAgICAgICA8c3RvcCBzdG9wLWNvbG9yPSJyZ2JhKDUxLCA1MSwgNTEsIDApIiBvZmZzZXQ9IjcwJSIgLz4KICAgICAgPC9saW5lYXJHcmFkaWVudD4KICAgIDwvZGVmcz4KICAgIDxyZWN0IHdpZHRoPSIxOTIwIiBoZWlnaHQ9IjkwMCIgZmlsbD0icmdiYSg1MSwgNTEsIDUxLCAwKSIgLz4KICAgIDxyZWN0IGlkPSJyIiB3aWR0aD0iMTkyMCIgaGVpZ2h0PSI5MDAiIGZpbGw9InVybCgjZy0xOTIwLTkwMCkiIC8+CiAgICA8YW5pbWF0ZSB4bGluazpocmVmPSIjciIgYXR0cmlidXRlTmFtZT0ieCIgZnJvbT0iLTE5MjAiIHRvPSIxOTIwIiBkdXI9IjFzIiByZXBlYXRDb3VudD0iaW5kZWZpbml0ZSIgIC8+CiAgPC9zdmc+",getBannerLink=e=>{let t=e?.link;return t?.type==="go-to-sales-page"?{type:"go-to-sales-page",link:constant.HREF_TO_SALES_PAGE,target:"_self"}:t},formatHoverScale=e=>e?String(e).includes("%")?`${e}`:`${e}%`:"100%",opacityEnabledData=e=>{let{overlayColor:t,overlayOpacity:o}=e??{},l=!t?.normal||o?.normal=="0%"||!o?.normal;return{disableOpacity:l}},getOpacityHover=e=>{let{overlayOpacity:t}=e??{},o="number"!=typeof t?.hover||isNaN(t?.hover)?"string"==typeof t?.hover?`${parseInt(t?.hover)}%`:"":`${t?.hover}%`,l="number"!=typeof t?.normal||isNaN(t?.normal)?"string"==typeof t?.normal?`${parseInt(t?.normal)}%`:"0%":`${t?.normal}%`;return o||l};exports.debounce=debounce,exports.fallbackImg="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTkyMCIgaGVpZ2h0PSI5MDAiIHZlcnNpb249IjEuMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayI+CiAgICA8ZGVmcz4KICAgICAgPGxpbmVhckdyYWRpZW50IGlkPSJnLTE5MjAtOTAwIj4KICAgICAgICA8c3RvcCBzdG9wLWNvbG9yPSJyZ2JhKDUxLCA1MSwgNTEsIDApIiBvZmZzZXQ9IjIwJSIgLz4KICAgICAgICA8c3RvcCBzdG9wLWNvbG9yPSJyZ2JhKDUxLCA1MSwgNTEsIDApIiBvZmZzZXQ9IjUwJSIgLz4KICAgICAgICA8c3RvcCBzdG9wLWNvbG9yPSJyZ2JhKDUxLCA1MSwgNTEsIDApIiBvZmZzZXQ9IjcwJSIgLz4KICAgICAgPC9saW5lYXJHcmFkaWVudD4KICAgIDwvZGVmcz4KICAgIDxyZWN0IHdpZHRoPSIxOTIwIiBoZWlnaHQ9IjkwMCIgZmlsbD0icmdiYSg1MSwgNTEsIDUxLCAwKSIgLz4KICAgIDxyZWN0IGlkPSJyIiB3aWR0aD0iMTkyMCIgaGVpZ2h0PSI5MDAiIGZpbGw9InVybCgjZy0xOTIwLTkwMCkiIC8+CiAgICA8YW5pbWF0ZSB4bGluazpocmVmPSIjciIgYXR0cmlidXRlTmFtZT0ieCIgZnJvbT0iLTE5MjAiIHRvPSIxOTIwIiBkdXI9IjFzIiByZXBlYXRDb3VudD0iaW5kZWZpbml0ZSIgIC8+CiAgPC9zdmc+",exports.formatHoverScale=formatHoverScale,exports.getAspectRatioSettings=getAspectRatioSettings,exports.getAttachmentDevice=getAttachmentDevice,exports.getBackgroundImageHeroBanner=getBackgroundImageHeroBanner,exports.getBannerLink=getBannerLink,exports.getBgImage=getBgImage,exports.getClassAlignBanner=getClassAlignBanner,exports.getClassContentPosition=getClassContentPosition,exports.getClassForContentByFitContent=getClassForContentByFitContent,exports.getClassForStretchContent=getClassForStretchContent,exports.getClassSpaceBetween=getClassSpaceBetween,exports.getClassSpaceBetweenLeftRight=getClassSpaceBetweenLeftRight,exports.getClipPath=getClipPath,exports.getContentPosition=getContentPosition,exports.getDataVideoHeroBannerResponsive=getDataVideoHeroBannerResponsive,exports.getDisplayStyleByFitContent=getDisplayStyleByFitContent,exports.getEnableBgImageByDevice=getEnableBgImageByDevice,exports.getOpacityHover=getOpacityHover,exports.getPercentageVisible=getPercentageVisible,exports.getResponsiveSetting=getResponsiveSetting,exports.getStyleAspectRatioHeroBannerCustom=getStyleAspectRatioHeroBannerCustom,exports.getStyleHeroBannerBg=getStyleHeroBannerBg,exports.getVisibilityStyle=getVisibilityStyle,exports.getWidth=getWidth,exports.horizontalAlign=horizontalAlign,exports.imagePlaceholder=imagePlaceholder,exports.isScaleImage=isScaleImage,exports.mapContentPositionToHorizontal=mapContentPositionToHorizontal,exports.opacityEnabledData=opacityEnabledData,exports.scrollToContentBanner=scrollToContentBanner,exports.showVideoType=showVideoType;
1
+ "use strict";var core=require("@gem-sdk/core"),helpers=require("../../image/common/helpers.js"),constant=require("../../constant.js");const getContentPosition=(e,t,o)=>{let i={};return core.DEVICES.map(l=>{let n=core.getResponsiveValueByScreen(e,l),a=core.getResponsiveValueByScreen(t,l),r=core.getResponsiveValueByScreen(o,l);i={...i,[l]:1>=(n?.cols?.length||1)?a:r}}),i},getAspectRatioSettings=(e,t)=>{let o={desktop:e?.desktop?.width,tablet:e?.tablet?.width,mobile:e?.mobile?.width},i={desktop:e?.desktop?.height,tablet:e?.tablet?.height,mobile:e?.mobile?.height},l={desktop:t?.desktop==="custom"?`${core.getResponsiveValueByScreen(o,"desktop")}/${core.getResponsiveValueByScreen(i,"desktop")}`:t?.desktop==="cover"?"unset":t?.desktop,tablet:t?.tablet==="custom"?`${core.getResponsiveValueByScreen(o,"tablet")}/${core.getResponsiveValueByScreen(i,"tablet")}`:t?.tablet==="cover"?"unset":t?.tablet,mobile:t?.mobile==="custom"?`${core.getResponsiveValueByScreen(o,"mobile")}/${core.getResponsiveValueByScreen(i,"mobile")}`:t?.mobile==="cover"?"unset":t?.mobile};return l},getEnableBgImageByDevice=(e,t)=>{if(!core.getResponsiveValueByScreen(getBgImage(t),e))return!1;if(!t?.[e]){if("mobile"===e)return t?.tablet?.type==="image"||t?.desktop?.type==="image"&&!t?.tablet;if("tablet"===e)return t?.desktop?.type==="image"}return t?.[e]?.type==="image"},getBgImage=e=>{if(!e)return{};let t={desktop:e?.desktop?.image,tablet:e?.tablet?.image,mobile:e?.mobile?.image};return t},imagePlaceholder=e=>{let t=getBgImage(e);return{desktop:helpers.createBlurDataURL(t?.desktop?.width??0,t?.desktop?.height??0),tablet:helpers.createBlurDataURL(t?.tablet?.width??t?.desktop?.width??0,t?.tablet?.height??t?.desktop?.width??0),mobile:helpers.createBlurDataURL(t?.mobile?.width??t?.tablet?.width??t?.desktop?.width??0,t?.mobile?.height??t?.tablet?.height??t?.desktop?.width??0)}},getBgImageByScreen=(e,t,o,i)=>{if(!e)return"";let l=getBgImage(e),n=core.getResponsiveValueByScreen(e,t),a=o?`url(${imagePlaceholder(e)[t]})`:`url(${helpers.getImageSrc(core.getResponsiveValueByScreen(l,t),t,i)})`,r=n?.color?`, ${n.color}`:"";return n?.color?.includes(core.GRADIENT_BGR_KEY)&&n?.type==="image"?`${a}${r}`:n?.color?.includes(core.GRADIENT_BGR_KEY)&&n?.type!=="image"?`${n.color}`:n?.type==="image"?a:"url()"},getBackgroundImageHeroBanner=(e,t=!1,o=!1)=>{if(!e)return;let i={};return core.DEVICES.forEach(l=>{i={...i,[l]:getBgImageByScreen(e,l,t,o)}}),core.makeStyleResponsive("bgi",i)},getAttachmentDevice=e=>{let t={},o=["desktop","mobile","tablet"];return o.forEach(o=>{let i=e?.[o]?.attachment;t={...t,[o]:"fixed"===i?"fixed":"absolute"}}),t},horizontalAlign=(e,t,o)=>mapContentPositionToHorizontal(getContentPosition(e,t,o)),scrollToContentBanner=e=>e?.target?.closest("div.gp-hero-banner-row")?.scrollTo(0,0),getDataVideoHeroBannerResponsive=(e,t)=>{switch(e){case"desktop":if(t?.desktop?.type==="video")return{device:"desktop",data:t.desktop};break;case"tablet":if(t?.tablet?.type==="video")return{device:"tablet",data:t.tablet};if(!t?.tablet&&t?.desktop?.type==="video")return{device:"desktop",data:t.desktop};break;case"mobile":if(t?.mobile?.type==="video")return{device:"mobile",data:t.mobile};if(!t?.mobile&&t?.tablet?.type==="video")return{device:"tablet",data:t.tablet};if(!t?.mobile&&!t?.tablet?.type&&t?.desktop?.type==="video")return{device:"desktop",data:t.desktop}}},getVisibilityStyle=e=>e?Object.keys(e).filter(e=>["--d","--d-tablet","--d-mobile"].includes(e)).reduce((t,o)=>({...t,[o]:e?.[o]!=="none"?"flex":e?.[o]}),{}):{},getStyleAspectRatioHeroBannerCustom=(e,t,o)=>{let i=core.getAspectRatioGlobalSize(t),l=["desktop","mobile","tablet"];return l.forEach(l=>{let n=core.getResponsiveValueByScreen(t,l),a=!!getDataVideoHeroBannerResponsive(l,e),r=n?.shape,s=n?.height,g="original"===r&&"fit-content"!==s,p=g&&a;p&&(i={...i,[l]:"16/9"}),o&&o[l]&&getDataVideoHeroBannerResponsive(l,e)?.data?.videoType==="html5"&&(i={...i,[l]:o[l]})}),core.makeStyleResponsive("aspect",i)},mapContentPositionToHorizontal=e=>{let t={};for(let o in e)"top"===e[o]?t[o]="start":"bottom"===e[o]?t[o]="end":t[o]="center";return t},getDisplayStyleByFitContent=(e,t)=>{let o={desktop:"none",tablet:"none",mobile:"none"},i=["desktop","mobile","tablet"];return i.forEach(i=>{let l=core.getResponsiveValueByScreen(e,i),n=!!getDataVideoHeroBannerResponsive(i,t),a=l?.shape,r=l?.height,s="original"===a&&"fit-content"!==r&&!n;o={...o,[i]:s?"block":"none"}}),core.makeStyleResponsive("d",o)},getWidth=e=>{let t={},o=["desktop","mobile","tablet"];return o.forEach(o=>{let i=e?.[o];i&&(t={...t,[o]:"default"===i?"var(--g-ct-w, 1200px)":i})}),t},getPercentageVisible=(e,t)=>{let{top:o,height:i}=e,l=-i;if(o<l)return 0;if(o>t)return 100;let n=(o-l)/(t-l)*100;return Math.min(Math.max(n,0),100)},isScaleImage=({enableParallax:e=!1,attachment:t="scroll"})=>!!e||"fixed"===t,getHeightHeroBanner=(e,t)=>{let o={},i=["desktop","mobile","tablet"];return i.forEach(i=>{let l=isScaleImage({enableParallax:t,attachment:e[i]?.attachment});o={...o,[i]:t?"150%":l?"100vh":"100%"}}),core.makeStyleResponsive("h",o)},getWidthHeroBanner=(e,t)=>{let o={},i=["desktop","mobile","tablet"];return i.forEach(i=>{let l=isScaleImage({enableParallax:t,attachment:e[i]?.attachment});o={...o,[i]:l?"100vw":"100%"}}),core.makeStyleResponsive("w",o)},getTopHeroBanner=e=>{let t={},o=["desktop","mobile","tablet"];return o.forEach(o=>{t={...t,[o]:e[o]?.attachment==="fixed"?"0px":""}}),core.makeStyleResponsive("top",t)},getStyleHeroBannerBg=(e,t)=>{let o=getHeightHeroBanner(e,t),i=getWidthHeroBanner(e,t),l=getTopHeroBanner(e);return{...o,...i,...l}},calcRounderClipPath=(e,t=0,o=0)=>{let i=t,l=t;if(t>o?i=o:l=o,e>=999){let t=e-i;return t>0?t:0}let n=e-l;return n>0?n:0},getClipPath=(e,t)=>{if(!t||!e)return"inset(0 0 0)";let[o,i,l,n]=e.split(" ").map(e=>parseInt(e??"0")),{btlr:a,btrr:r,bbrr:s,bblr:g}=t,p=calcRounderClipPath(parseInt(a??"0"),o,n),c=calcRounderClipPath(parseInt(r??"0"),o,i),b=calcRounderClipPath(parseInt(s??"0"),i,l),d=calcRounderClipPath(parseInt(g??"0"),l,n);return`inset(0 0 0 round ${p}px ${c}px ${b}px ${d}px)`},getClassAlignBanner=e=>({"!gp-self-start":"left"===e.desktop,"!gp-self-center":"center"===e.desktop,"!gp-self-end":"right"===e.desktop,"tablet:!gp-self-start":"left"===e.tablet,"tablet:!gp-self-center":"center"===e.tablet,"tablet:!gp-self-end":"right"===e.tablet,"mobile:!gp-self-start":"left"===e.mobile,"mobile:!gp-self-center":"center"===e.mobile,"mobile:!gp-self-end":"right"===e.mobile}),get1ColLayout=({device:e,settingLayoutRes:t,contentPosition1ColRes:o})=>{let i=t[e]?.cols??[],l=i.length<=1,n=o[e];if(!l||!n)return;let a=["space-between","top","center","bottom"];return a.includes(n)?n:void 0},getClassSpaceBetween=(e,t)=>{let o=getResponsiveSetting(e),i=getResponsiveSetting(t),l={desktop:get1ColLayout({device:"desktop",settingLayoutRes:o,contentPosition1ColRes:i}),tablet:get1ColLayout({device:"tablet",settingLayoutRes:o,contentPosition1ColRes:i}),mobile:get1ColLayout({device:"mobile",settingLayoutRes:o,contentPosition1ColRes:i})},n={"space-between":{desktop:"!gp-h-full !gp-content-stretch [&>*]:!gp-justify-between [&>*:nth-child(2)]:gp-absolute [&>*:nth-child(2)]:gp-hidden",tablet:"tablet:!gp-h-full tablet:!gp-content-stretch tablet:[&>*]:!gp-justify-between tablet:[&>*:nth-child(2)]:gp-absolute tablet:[&>*:nth-child(2)]:gp-hidden",mobile:"mobile:!gp-h-full mobile:!gp-content-stretch mobile:[&>*]:!gp-justify-between mobile:[&>*:nth-child(2)]:gp-absolute mobile:[&>*:nth-child(2)]:gp-hidden"},top:{desktop:"!gp-content-stretch [&>*]:!gp-justify-start",tablet:"tablet:!gp-content-stretch tablet:[&>*]:!gp-justify-start",mobile:"mobile:!gp-content-stretch mobile:[&>*]:!gp-justify-start"},center:{desktop:"!gp-content-stretch [&>*]:!gp-justify-center",tablet:"tablet:!gp-content-stretch tablet:[&>*]:!gp-justify-center",mobile:"mobile:!gp-content-stretch mobile:[&>*]:!gp-justify-center"},bottom:{desktop:"!gp-content-stretch [&>*]:!gp-justify-end",tablet:"tablet:!gp-content-stretch tablet:[&>*]:!gp-justify-end",mobile:"mobile:!gp-content-stretch mobile:[&>*]:!gp-justify-end"}},a={};return core.DEVICES.forEach(e=>{let t=l[e],o=n?.[t]?.[e];a[o]=!0}),a},getClassSpaceBetweenLeftRight=e=>{let t=getResponsiveSetting(e),o=t?.desktop?.type=="left-distributed"||t?.desktop?.type=="right-distributed",i=t?.tablet?.type=="left-distributed"||t?.tablet?.type=="right-distributed",l=t?.mobile?.type=="left-distributed"||t?.mobile?.type=="right-distributed";return{"gp-h-full tablet:gp-h-auto mobile:gp-h-auto [&>*]:!gp-justify-between":o,"tablet:!gp-h-full tablet:[&>*]:!gp-justify-between mobile:gp-h-auto":i,"mobile:!gp-h-full mobile:[&>*]:!gp-justify-between":l,"mobile:!gp-h-auto":!l}},getClassForStretchContent=e=>{let t={desktop:"none",tablet:"none",mobile:"none"},o=["desktop","mobile","tablet"];return o.forEach(o=>{let i=core.getResponsiveValueByScreen(e,o);t={...t,[o]:i}}),core.cls("space-between"===t.desktop?"[&>*>*]:!gp-justify-between":"","space-between"===t.tablet?"tablet:[&>*>*]:!gp-justify-between ":`tablet:[&>*>*]:!gp-justify-${e?.tablet}`,"space-between"===t.mobile?"mobile:[&>*>*]:!gp-justify-between ":`mobile:[&>*>*]:!gp-justify-${e?.mobile}`)},getClassForContentByFitContent=(e,t)=>{let o={desktop:!1,tablet:!1,mobile:!1},i=["desktop","mobile","tablet"];return i.forEach(i=>{let l=core.getResponsiveValueByScreen(e,i),n=!!getDataVideoHeroBannerResponsive(i,t),a=l?.shape,r=l?.height,s="original"===a&&"fit-content"!==r;o={...o,[i]:s&&!n}}),core.cls(o.desktop?"!gp-absolute":"",o.tablet?"tablet:!gp-absolute":"tablet:!gp-relative",o.mobile?"mobile:!gp-absolute":"mobile:!gp-relative")},getClassContentPosition=e=>{let t={center:"center",top:"start",bottom:"end","space-between":"between"},o=e.desktop||"center",i=e.tablet||o,l=e.mobile||i;return{[`gp-justify-${t[o||"center"]}`]:!!o,[`tablet:gp-justify-${t[i||"center"]}`]:!!i,[`mobile:gp-justify-${t[l||"center"]}`]:!!l}},getResponsiveSetting=e=>{let t=e.desktop,o=e.tablet?e.tablet:t,i=e.mobile?e.mobile:o;return{desktop:t,tablet:o,mobile:i}},showVideoType=e=>core.DEVICES.some(t=>{let o=core.getValueByDevice(e,t);return o?.type!=="color"&&o?.type!=="image"&&!!o&&(o?.videoType==="html5"&&o?.videoHtml5||o?.videoType==="youtube"&&o?.video)});function debounce(e,t){let o;return function(...i){clearTimeout(o),o=setTimeout(()=>e.apply(this,i),t)}}const fallbackImg="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTkyMCIgaGVpZ2h0PSI5MDAiIHZlcnNpb249IjEuMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayI+CiAgICA8ZGVmcz4KICAgICAgPGxpbmVhckdyYWRpZW50IGlkPSJnLTE5MjAtOTAwIj4KICAgICAgICA8c3RvcCBzdG9wLWNvbG9yPSJyZ2JhKDUxLCA1MSwgNTEsIDApIiBvZmZzZXQ9IjIwJSIgLz4KICAgICAgICA8c3RvcCBzdG9wLWNvbG9yPSJyZ2JhKDUxLCA1MSwgNTEsIDApIiBvZmZzZXQ9IjUwJSIgLz4KICAgICAgICA8c3RvcCBzdG9wLWNvbG9yPSJyZ2JhKDUxLCA1MSwgNTEsIDApIiBvZmZzZXQ9IjcwJSIgLz4KICAgICAgPC9saW5lYXJHcmFkaWVudD4KICAgIDwvZGVmcz4KICAgIDxyZWN0IHdpZHRoPSIxOTIwIiBoZWlnaHQ9IjkwMCIgZmlsbD0icmdiYSg1MSwgNTEsIDUxLCAwKSIgLz4KICAgIDxyZWN0IGlkPSJyIiB3aWR0aD0iMTkyMCIgaGVpZ2h0PSI5MDAiIGZpbGw9InVybCgjZy0xOTIwLTkwMCkiIC8+CiAgICA8YW5pbWF0ZSB4bGluazpocmVmPSIjciIgYXR0cmlidXRlTmFtZT0ieCIgZnJvbT0iLTE5MjAiIHRvPSIxOTIwIiBkdXI9IjFzIiByZXBlYXRDb3VudD0iaW5kZWZpbml0ZSIgIC8+CiAgPC9zdmc+",getBannerLink=e=>{let t=e?.link;return t?.type==="go-to-sales-page"?{type:"go-to-sales-page",link:constant.HREF_TO_SALES_PAGE,target:"_self"}:t},formatHoverScale=e=>e?String(e).includes("%")?`${e}`:`${e}%`:"100%",opacityEnabledData=e=>{let{overlayColor:t,overlayOpacity:o}=e??{},i=!t?.normal||o?.normal=="0%"||!o?.normal;return{disableOpacity:i}},getOpacityHover=e=>{let{overlayOpacity:t}=e??{},o="number"!=typeof t?.hover||isNaN(t?.hover)?"string"==typeof t?.hover?`${parseInt(t?.hover)}%`:"":`${t?.hover}%`,i="number"!=typeof t?.normal||isNaN(t?.normal)?"string"==typeof t?.normal?`${parseInt(t?.normal)}%`:"0%":`${t?.normal}%`;return o||i};exports.debounce=debounce,exports.fallbackImg="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTkyMCIgaGVpZ2h0PSI5MDAiIHZlcnNpb249IjEuMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayI+CiAgICA8ZGVmcz4KICAgICAgPGxpbmVhckdyYWRpZW50IGlkPSJnLTE5MjAtOTAwIj4KICAgICAgICA8c3RvcCBzdG9wLWNvbG9yPSJyZ2JhKDUxLCA1MSwgNTEsIDApIiBvZmZzZXQ9IjIwJSIgLz4KICAgICAgICA8c3RvcCBzdG9wLWNvbG9yPSJyZ2JhKDUxLCA1MSwgNTEsIDApIiBvZmZzZXQ9IjUwJSIgLz4KICAgICAgICA8c3RvcCBzdG9wLWNvbG9yPSJyZ2JhKDUxLCA1MSwgNTEsIDApIiBvZmZzZXQ9IjcwJSIgLz4KICAgICAgPC9saW5lYXJHcmFkaWVudD4KICAgIDwvZGVmcz4KICAgIDxyZWN0IHdpZHRoPSIxOTIwIiBoZWlnaHQ9IjkwMCIgZmlsbD0icmdiYSg1MSwgNTEsIDUxLCAwKSIgLz4KICAgIDxyZWN0IGlkPSJyIiB3aWR0aD0iMTkyMCIgaGVpZ2h0PSI5MDAiIGZpbGw9InVybCgjZy0xOTIwLTkwMCkiIC8+CiAgICA8YW5pbWF0ZSB4bGluazpocmVmPSIjciIgYXR0cmlidXRlTmFtZT0ieCIgZnJvbT0iLTE5MjAiIHRvPSIxOTIwIiBkdXI9IjFzIiByZXBlYXRDb3VudD0iaW5kZWZpbml0ZSIgIC8+CiAgPC9zdmc+",exports.formatHoverScale=formatHoverScale,exports.getAspectRatioSettings=getAspectRatioSettings,exports.getAttachmentDevice=getAttachmentDevice,exports.getBackgroundImageHeroBanner=getBackgroundImageHeroBanner,exports.getBannerLink=getBannerLink,exports.getBgImage=getBgImage,exports.getClassAlignBanner=getClassAlignBanner,exports.getClassContentPosition=getClassContentPosition,exports.getClassForContentByFitContent=getClassForContentByFitContent,exports.getClassForStretchContent=getClassForStretchContent,exports.getClassSpaceBetween=getClassSpaceBetween,exports.getClassSpaceBetweenLeftRight=getClassSpaceBetweenLeftRight,exports.getClipPath=getClipPath,exports.getContentPosition=getContentPosition,exports.getDataVideoHeroBannerResponsive=getDataVideoHeroBannerResponsive,exports.getDisplayStyleByFitContent=getDisplayStyleByFitContent,exports.getEnableBgImageByDevice=getEnableBgImageByDevice,exports.getOpacityHover=getOpacityHover,exports.getPercentageVisible=getPercentageVisible,exports.getResponsiveSetting=getResponsiveSetting,exports.getStyleAspectRatioHeroBannerCustom=getStyleAspectRatioHeroBannerCustom,exports.getStyleHeroBannerBg=getStyleHeroBannerBg,exports.getVisibilityStyle=getVisibilityStyle,exports.getWidth=getWidth,exports.horizontalAlign=horizontalAlign,exports.imagePlaceholder=imagePlaceholder,exports.isScaleImage=isScaleImage,exports.mapContentPositionToHorizontal=mapContentPositionToHorizontal,exports.opacityEnabledData=opacityEnabledData,exports.scrollToContentBanner=scrollToContentBanner,exports.showVideoType=showVideoType;
@@ -1 +1 @@
1
- "use strict";var React=require("react");const useIconLineHeight=({iconWidth:e})=>{let t=React.useRef(null),[r,u]=React.useState("");return React.useEffect(()=>{if(t?.current){let e=window.getComputedStyle(t?.current).getPropertyValue("line-height");u(e)}},[e]),{ref:t,lineHeight:r}};exports.useIconLineHeight=useIconLineHeight;
1
+ "use strict";var core=require("@gem-sdk/core"),React=require("react");const useIconLineHeight=({iconWidth:e})=>{let t=React.useRef(null),[r,c]=React.useState(""),u=core.useCurrentDevice();return React.useEffect(()=>{if(t?.current){let e=window.getComputedStyle(t?.current).getPropertyValue("line-height");c(e)}},[e,u]),{ref:t,lineHeight:r}};exports.useIconLineHeight=useIconLineHeight;
@@ -1 +1 @@
1
- import{makeGlobalSize as t,composeSize as e,removePaddingYInStyle as r,makeStyle as a,getSingleColorVariable as i,getGlobalColorStateStyle as o}from"@gem-sdk/core";let MINIMUM_CHILD=1,BODY_CHILD_INDEX=0,getDataState=(t,e)=>{let{setting:r={},styles:a={},builderProps:i}=t,{activeKey:o,iconSvg:n,expandItem:l,iconPosition:s,iconCollapseSize:g,iconGlobalSize:d,iconExpand:p,iconCollapse:c,layoutHeader:m,expandedMode:u,configIconSize:I}=r,{bgColor:S,color:D,headerBorder:L,width:v,fullWidth:C,textColor:M,itemHeaderSpacing:_,contentSizePadding:N,iconColor:h,headerContentPadding:H,widthHeightSize:U}=a,w="multiple"===u,y=t=>t?t.toString().toLowerCase().split(",").map(t=>parseInt(t.trim())-1).map(t=>t.toString()):[],P=l?y(o):[],q=w?[...P]:P,B=()=>({iconSvg:n,isIconPlus:"plus"===n,activeKey:o,expanded:w,expandItem:l,iconPosition:s,iconGlobalSize:d,iconCollapse:c,iconExpand:p,iconCollapseSize:g,layoutHeader:m,expandedMode:u,configIconSize:I,parentUid:i?.uid,childListNumber:l?o?.toString().toLowerCase()==="all"?e?.map((t,e)=>e.toString()):q:[],chidlrenUid:e?.map(t=>t.uid)}),E=()=>({bgColor:S,color:D,headerBorder:L,fullWidth:C,width:v,itemHeaderSpacing:_,textColor:M,iconColor:h,contentSizePadding:N,headerContentPadding:H,widthHeightSize:U});return{uidState:i?.uid,settingState:B(),stylesState:E(),accordions:q}},getParentSettings=(t={})=>{let{iconSvg:e,titleTypo:r,layoutHeader:a,iconGlobalSize:i,iconCollapseSize:o,iconCollapse:n,iconExpand:l,alignment:s,configIconSize:g,iconPosition:d}=t,p=r?{...r,attrs:{...r.attrs}}:void 0;return p?.attrs?.color&&delete p.attrs.color,{iconSvg:e,titleTypo:p,layoutHeader:a,iconGlobalSize:i,iconCollapseSize:o,iconCollapse:n,iconExpand:l,alignment:s,configIconSize:g,iconPosition:d}},getSettingItemLiquid=n=>{let{index:l,accordions:s,parentSetting:g,parentStyle:d}=n,{titleTypo:p,iconCollapse:c,iconExpand:m,activeKey:u,expandItem:I}=g??{};delete p?.attrs?.color;let{itemContentSpacing:S,iconColor:D,contentSizePadding:L}=d??{},v=!!I&&(u?.toString()?.toLowerCase()==="all"||s?.includes(l?.toString()??"")),C=t(L),M=()=>{let t={...L&&C.padding,...S?.type||L?{}:e(S?.custom)};return v?t:r(t)},_=()=>m&&v?m:c&&!v?c:void 0,N=_(),h=()=>{let t={normal:D?.normal??"transparent",hover:D?.hover??D?.active??D?.normal??"transparent",active:D?.active??"transparent"};return v?a({c:i(t?.active)}):o("c",t)};return{isShow:v,composeContentSizeStyle:M,collapsibleIcon:N,composeIconColor:h(),makeIcon:_}};export{BODY_CHILD_INDEX,MINIMUM_CHILD,getDataState,getParentSettings,getSettingItemLiquid};
1
+ import{makeGlobalSize as t,composeSize as e,removePaddingYInStyle as r,makeStyle as o,getSingleColorVariable as i,getGlobalColorStateStyle as a}from"@gem-sdk/core";let MINIMUM_CHILD=1,BODY_CHILD_INDEX=0,ICON_MINUS="<svg width='16' height='16' fill='currentColor' viewBox=\"0 0 448 512\"><path fill='currentColor' d=\"M400 288h-352c-17.69 0-32-14.32-32-32.01s14.31-31.99 32-31.99h352c17.69 0 32 14.3 32 31.99S417.7 288 400 288z\"/></svg>",ICON_PLUS="<svg fill='currentColor' width='16' height='16' xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 448 512\"><path fill='currentColor' d=\"M432 256c0 17.69-14.33 32.01-32 32.01H256v144c0 17.69-14.33 31.99-32 31.99s-32-14.3-32-31.99v-144H48c-17.67 0-32-14.32-32-32.01s14.33-31.99 32-31.99H192v-144c0-17.69 14.33-32.01 32-32.01s32 14.32 32 32.01v144h144C417.7 224 432 238.3 432 256z\"/></svg>",getDataState=(t,e)=>{let{setting:r={},styles:o={},builderProps:i}=t,{activeKey:a,iconSvg:l,expandItem:n,iconPosition:s,iconCollapseSize:c,iconGlobalSize:g,iconExpand:I,iconCollapse:p,layoutHeader:S,expandedMode:m,configIconSize:u}=r,{bgColor:d,color:v,headerBorder:C,width:h,fullWidth:N,textColor:L,itemHeaderSpacing:_,contentSizePadding:w,iconColor:M,headerContentPadding:D,widthHeightSize:U}=o,O="multiple"===m,H=t=>t?t.toString().toLowerCase().split(",").map(t=>parseInt(t.trim())-1).map(t=>t.toString()):[],P=n?H(a):[],f=O?[...P]:P,x=()=>({iconSvg:l,isIconPlus:"plus"===l,activeKey:a,expanded:O,expandItem:n,iconPosition:s,iconGlobalSize:g,iconCollapse:p,iconExpand:I,iconCollapseSize:c,layoutHeader:S,expandedMode:m,configIconSize:u,parentUid:i?.uid,childListNumber:n?a?.toString().toLowerCase()==="all"?e?.map((t,e)=>e.toString()):f:[],chidlrenUid:e?.map(t=>t.uid)}),B=()=>({bgColor:d,color:v,headerBorder:C,fullWidth:N,width:h,itemHeaderSpacing:_,textColor:L,iconColor:M,contentSizePadding:w,headerContentPadding:D,widthHeightSize:U});return{uidState:i?.uid,settingState:x(),stylesState:B(),accordions:f}},getParentSettings=(t={})=>{let{iconSvg:e,titleTypo:r,layoutHeader:o,iconGlobalSize:i,iconCollapseSize:a,iconCollapse:l,iconExpand:n,alignment:s,configIconSize:c,iconPosition:g}=t,I=r?{...r,attrs:{...r.attrs}}:void 0;return I?.attrs?.color&&delete I.attrs.color,{iconSvg:e,titleTypo:I,layoutHeader:o,iconGlobalSize:i,iconCollapseSize:a,iconCollapse:l,iconExpand:n,alignment:s,configIconSize:c,iconPosition:g}},composeIconSvg=({isShow:t,iconExpand:e,iconCollapse:r,iconSvg:o})=>e&&t?e:r&&!t?r:"plus"===o?t?ICON_MINUS:ICON_PLUS:o,getSettingItemLiquid=l=>{let{index:n,accordions:s,parentSetting:c,parentStyle:g}=l,{titleTypo:I,iconCollapse:p,iconExpand:S,activeKey:m,expandItem:u,iconSvg:d}=c??{};delete I?.attrs?.color;let{itemContentSpacing:v,iconColor:C,contentSizePadding:h}=g??{},N=!!u&&(m?.toString()?.toLowerCase()==="all"||s?.includes(n?.toString()??"")),L=t(h),_=()=>{let t={...h&&L.padding,...v?.type||h?{}:e(v?.custom)};return N?t:r(t)},w=composeIconSvg({isShow:N,iconExpand:S,iconCollapse:p,iconSvg:d}),M=()=>{let t={normal:C?.normal??"transparent",hover:C?.hover??C?.active??C?.normal??"transparent",active:C?.active??"transparent"};return N?o({c:i(t?.active)}):a("c",t)};return{isShow:N,composeContentSizeStyle:_,collapsibleIcon:w,composeIconColor:M(),makeIcon:w}};export{BODY_CHILD_INDEX,ICON_MINUS,ICON_PLUS,MINIMUM_CHILD,composeIconSvg,getDataState,getParentSettings,getSettingItemLiquid};
@@ -1,18 +1,18 @@
1
- import{composeClasses as t,template as e,RenderChildren as s}from"@gem-sdk/core";import i from"../../text/components/Text.liquid.js";import{getParentSettings as a,getSettingItemLiquid as o,MINIMUM_CHILD as n,BODY_CHILD_INDEX as l}from"../common/helpers.js";import{createClass as d,createStyle as r,If as $}from"@gem-sdk/system";import{getItemContainerClasses as c,getDropdownClasses as p,getIconClasses as m,getIconRotateClasses as v,getContentClasses as y,getGapClasses as x,getLayoutIconClasses as g,getRenderChildrenClasses as u}from"../common/classes.js";import{getIconGlobalSize as f,getItemContainerStyles as h,getDropdownStyles as S,getDropdownTextStyles as I,getIconRotateStyles as j,getGapStyles as k,getIconStyles as T,getTemplateRow as b,getRenderChildrenStyles as q}from"../common/styles.js";let AccordionItem=w=>{let{parentUid:A,childrenIcon:F,rawChildren:C,index:M,builderProps:N,title:V}=w,{iconSvg:_,titleTypo:z,layoutHeader:B,iconGlobalSize:D,iconCollapseSize:E,iconCollapse:G,iconExpand:H,alignment:J,configIconSize:K,iconPosition:L}=a(w.parentSetting)??{},{isShow:O,composeContentSizeStyle:P,collapsibleIcon:Q,composeIconColor:R,makeIcon:U}=o(w),W=d(c),X=d(p(w.parentStyle,{isShow:O,uniqueId:A,makeIcon:U(),index:M})),Y=r(f(D)),Z=d(m),tt=d(v(w.parentStyle,{isShow:O,iconExpand:H,iconSvg:_,iconCollapse:G})),te=d(y(A)),ts=d(x),ti=r(h(w.parentStyle,!1)),ta=r(S(w.parentStyle,{isShow:O,iconPosition:L})),to=r(I(w.parentStyle?.textColor,O)),tn=r(j(w.parentStyle,O,E)),tl=r(k(D,J)),td=d(t("gp-inline-flex")),tr=d(O?{...t("!gp-text-[var(--icon-active-color)]"),...g}:g),t$=r(T(R,K)),tc=d(u(w.parentStyle,{isShow:O,hasTransitionedIn:!1,isMounted:!1})),tp=r({...b(O),...q()}),tm=d(t("gp-accordion-item_body-inner gp-transition-all gp-duration-500 gp-min-h-0")),tv=()=>C&&C.length>=n?s({...C[l]}):"";return e`
1
+ import{composeClasses as t,template as e,RenderChildren as s}from"@gem-sdk/core";import i from"../../text/components/Text.liquid.js";import{getParentSettings as a,getSettingItemLiquid as o,MINIMUM_CHILD as l,BODY_CHILD_INDEX as n}from"../common/helpers.js";import{createClass as d,createStyle as r,If as $}from"@gem-sdk/system";import{getItemContainerClasses as c,getDropdownClasses as p,getIconClasses as m,getIconRotateClasses as v,getContentClasses as y,getGapClasses as x,getLayoutIconClasses as g,getRenderChildrenClasses as u}from"../common/classes.js";import{getIconGlobalSize as f,getItemContainerStyles as h,getDropdownStyles as S,getDropdownTextStyles as j,getIconRotateStyles as I,getGapStyles as T,getIconStyles as b,getTemplateRow as k,getRenderChildrenStyles as q}from"../common/styles.js";let AccordionItem=w=>{let{parentUid:A,childrenIcon:F,rawChildren:C,index:M,builderProps:N,title:V}=w,{iconSvg:_,titleTypo:z,layoutHeader:B,iconGlobalSize:D,iconCollapseSize:E,iconCollapse:G,iconExpand:H,alignment:J,configIconSize:K,iconPosition:L}=a(w.parentSetting)??{},{isShow:O,composeContentSizeStyle:P,collapsibleIcon:Q,composeIconColor:R,makeIcon:U}=o(w),W=d(c),X=d(p(w.parentStyle,{isShow:O,uniqueId:A,makeIcon:U,index:M})),Y=r(f(D)),Z=d(m),tt=d(v(w.parentStyle,{isShow:O,iconExpand:H,iconSvg:_,iconCollapse:G})),te=d(y(A)),ts=d(x),ti=r(h(w.parentStyle,!1)),ta=r(S(w.parentStyle,{isShow:O,iconPosition:L})),to=r(j(w.parentStyle?.textColor,O)),tl=r(I(w.parentStyle,O,E)),tn=r(T(D,J)),td=d(t("gp-inline-flex")),tr=d(O?{...t("!gp-text-[var(--icon-active-color)]"),...g}:g),t$=r(b(R,K)),tc=d(u(w.parentStyle,{isShow:O,hasTransitionedIn:!1,isMounted:!1})),tp=r({...k(O),...q()}),tm=d(t("gp-accordion-item_body-inner gp-transition-all gp-duration-500 gp-min-h-0")),tv=()=>C&&C.length>=l?s({...C[n]}):"";return e`
2
2
  <div class="${W}" style="${ti}">
3
3
  <div data-index="${M?.toString()}" class="${te}">
4
4
  <div aria-hidden uid="${N?.uid}" id="${N?.uid}" data-index="${M?.toString()}"
5
5
  class="${X}" style="${ta}">
6
6
  ${$(!!Q,e`
7
7
  <div class="${Z}">
8
- <span style="${tn}"
8
+ <span style="${tl}"
9
9
  data-index="${M}"
10
10
  class="${tt}">
11
11
  ${Q}
12
12
  </span>
13
13
  </div>
14
14
  `)}
15
- <div class="${ts}" style="${tl}">
15
+ <div class="${ts}" style="${tn}">
16
16
  ${$("before-text"===B,e`
17
17
  <div class="${td}" style="${{...Y}}">
18
18
  <span
@@ -1 +1 @@
1
- import{makeGlobalSize as t,useEditorMode as e,makeStyle as r,getSingleColorVariable as o,getGlobalColorStateStyle as n,composeSize as a,removePaddingYInStyle as i}from"@gem-sdk/core";import{useState as c,useEffect as s,useMemo as l}from"react";import m from"./useMountTransition.js";import{useGetProductId as d}from"../../hooks/useGetProductId.js";let useAccordionItem=u=>{let{accordions:p,index:v,builderProps:f,parentSetting:g={},parentStyle:h={},handleDropDown:$}=u,{iconPosition:j,titleTypo:w,iconCollapse:I,iconExpand:k}=g;delete w?.attrs?.color;let{itemContentSpacing:x,iconColor:A,contentSizePadding:b}=h,y=p?.includes(v?.toString()??""),G=t(b),M=e(),[P,S]=c(y),T=m(P||!1,500);s(()=>{S(y)},[y]);let q=l(()=>k&&y?k:I&&!y?I:void 0,[y,I,k]),z=l(()=>r({fd:"left"===j?"row":"row-reverse",jc:"right"===j?"space-between":""}),[j]),B=(t,e)=>{!t.target.closest(".gp-text")&&$&&e&&(S(!P),$(e))},C=l(()=>{let t={normal:A?.normal??"transparent",hover:A?.hover??A?.active??A?.normal??"transparent",active:A?.active??A?.normal??"transparent"};return y?r({c:o(t?.active)}):n("c",t)},[A,y]),{refContainer:D,productID:E}=d(),F=l(()=>{let t=`gp-accordion-item-${f?.uid}-${v}`;return E?`${t}-${E}`:t},[f?.uid,v,E]),H=l(()=>{let t={...b&&G.padding,...x?.type||b?{}:a(x?.custom)};return y?t:i(t)},[b,x,y,G]),J=l(()=>T||P||"edit"!==M,[T,P,M]);return{productID:E,isShow:y,getIdDropdownItem:B,makeIcon:q,refContainer:D,uniqueId:F,isRenderChildren:J,composePosition:z,composeIconColor:C,composeContentSizeStyle:H,hasTransitionedIn:T,isMounted:P}};export{useAccordionItem as default};
1
+ import{makeGlobalSize as e,useEditorMode as t,makeStyle as r,getSingleColorVariable as o,getGlobalColorStateStyle as n,composeSize as a,removePaddingYInStyle as c}from"@gem-sdk/core";import{useState as i,useEffect as s,useMemo as m}from"react";import l from"./useMountTransition.js";import{useGetProductId as d}from"../../hooks/useGetProductId.js";import{composeIconSvg as p}from"../common/helpers.js";let useAccordionItem=u=>{let{accordions:f,index:g,builderProps:v,parentSetting:h={},parentStyle:j={},handleDropDown:$}=u,{iconPosition:w,titleTypo:I,iconCollapse:k,iconExpand:x,iconSvg:A}=h;delete I?.attrs?.color;let{itemContentSpacing:b,iconColor:y,contentSizePadding:G}=j,M=f?.includes(g?.toString()??""),P=e(G),S=t(),[T,q]=i(M),z=l(T||!1,500);s(()=>{q(M)},[M]);let B=m(()=>p({isShow:M,iconExpand:x,iconCollapse:k,iconSvg:A}),[M,x,k,A]),C=m(()=>r({fd:"left"===w?"row":"row-reverse",jc:"right"===w?"space-between":""}),[w]),D=(e,t)=>{!e.target.closest(".gp-text")&&$&&t&&(q(!T),$(t))},E=m(()=>{let e={normal:y?.normal??"transparent",hover:y?.hover??y?.active??y?.normal??"transparent",active:y?.active??y?.normal??"transparent"};return M?r({c:o(e?.active)}):n("c",e)},[y,M]),{refContainer:F,productID:H}=d(),J=m(()=>{let e=`gp-accordion-item-${v?.uid}-${g}`;return H?`${e}-${H}`:e},[v?.uid,g,H]),K=m(()=>{let e={...G&&P.padding,...b?.type||G?{}:a(b?.custom)};return M?e:c(e)},[G,b,M,P]),L=m(()=>z||T||"edit"!==S,[z,T,S]);return{productID:H,isShow:M,getIdDropdownItem:D,makeIcon:B,refContainer:F,uniqueId:J,isRenderChildren:L,composePosition:C,composeIconColor:E,composeContentSizeStyle:K,hasTransitionedIn:z,isMounted:T}};export{useAccordionItem as default};
@@ -1 +1 @@
1
- import{dataStringify as e,DEVICES as t,getValueByDevice as r}from"@gem-sdk/core";import{createStateOrContext as d}from"@gem-sdk/system";import{getResponsiveSetting as o}from"../../../../carousel/components/arrow/common/helpers.js";let defaultWidth={desktop:"1200px",tablet:"100%",mobile:"100%"},getStyleByDevice=(e,t,r)=>t?.[e]===!0?{contentWidth:"100%",wrapperWidth:"100%",wrapperPadding:"0px"}:r?.[e]==="100%"?{contentWidth:"100%",wrapperWidth:"100%",wrapperPadding:"var(--g-ct-p)"}:r?.[e]==="default"?{contentWidth:`var(--g-ct-w, ${defaultWidth[e]})`,wrapperWidth:`calc(var(--g-ct-w, ${defaultWidth[e]}) + 2 * var(--g-ct-p, 15px))`,wrapperPadding:"var(--g-ct-p, 15px)"}:r?.[e]!==void 0?{contentWidth:r?.[e],wrapperWidth:`calc(${r?.[e]} + 2 * var(--g-ct-p, 15px))`,wrapperPadding:"var(--g-ct-p, 15px)"}:{contentWidth:void 0,wrapperWidth:`calc(var(--g-ct-w, ${defaultWidth[e]}) + 2 * var(--g-ct-p, 15px))`,wrapperPadding:"var(--g-ct-p, 15px)"},createStyleObject=(e,t)=>{let r=getStyleByDevice("desktop",t,e),d=getStyleByDevice("tablet",t,e),o=getStyleByDevice("mobile",t,e);return{content:{desktop:r.contentWidth,tablet:d.contentWidth,mobile:o.contentWidth},wrapper:{desktop:r.wrapperWidth,tablet:d.wrapperWidth,mobile:o.wrapperWidth},padding:{desktop:r.wrapperPadding,tablet:d.wrapperPadding,mobile:o.wrapperPadding}}},getData=t=>{let{styles:r,builderProps:o}=t,a=d({background:r?.background,uid:o?.uid});return{stateData:e(a).replaceAll("'","&#039;")}};function reduceRadiusForState(e,t){if(!e||!t)return{};let r=("string"==typeof e?e.split(" "):[]).map(e=>parseInt(e,10)||0),d=Object.fromEntries(["btrr","bblr","bbrr","btlr"].map((e,d)=>[e,Math.max(0,(parseInt(t[e]??"0",10)||0)-(r[d]||0))+"px"]));return{...d,radiusType:t.radiusType}}function reduceBorderRadiusForDevice(e,t){if(!e||!t)return{};let r={};return["normal","hover","active"].forEach(d=>{let o=e?.[d],a=t?.[d];o&&a&&(r[d]=reduceRadiusForState(o.width,a))}),r}function getInnerRadiusExcludeBorder(e,t){return{desktop:reduceBorderRadiusForDevice(e?.desktop,t?.desktop),tablet:reduceBorderRadiusForDevice(e?.tablet??e?.desktop,t?.tablet??t?.desktop),mobile:reduceBorderRadiusForDevice(e?.mobile??e?.tablet??e?.desktop,t?.mobile??t?.tablet??t?.desktop)}}let checkHasBackgroundVideo=e=>t.some(t=>{let d=r(e,t);return!!d&&(d?.videoType==="html5"&&d?.videoHtml5||d?.videoType==="youtube"&&d?.video)}),isRenderHtmlVideo=e=>{let t=o(e||{}),r=t.desktop?.videoType,d=t.tablet?.videoType,a=t.mobile?.videoType;return"html5"==r||"html5"==d||"html5"==a},isRenderYoutubeVideo=e=>{let t=o(e||{}),r=t.desktop?.videoType,d=t.tablet?.videoType,a=t.mobile?.videoType;return"youtube"==r||"youtube"==d||"youtube"==a};export{checkHasBackgroundVideo,createStyleObject,getData,getInnerRadiusExcludeBorder,isRenderHtmlVideo,isRenderYoutubeVideo};
1
+ import{dataStringify as e,DEVICES as t,getValueByDevice as r}from"@gem-sdk/core";import{createStateOrContext as d}from"@gem-sdk/system";import{getResponsiveSetting as o}from"../../../../carousel/components/arrow/common/helpers.js";let defaultWidth={desktop:"1200px",tablet:"100%",mobile:"100%"},getStyleByDevice=(e,t)=>t?.[e]==="100%"?{contentWidth:"100%",wrapperWidth:"100%",wrapperPadding:"var(--g-ct-p)"}:t?.[e]==="default"?{contentWidth:`var(--g-ct-w, ${defaultWidth[e]})`,wrapperWidth:`calc(var(--g-ct-w, ${defaultWidth[e]}) + 2 * var(--g-ct-p, 15px))`,wrapperPadding:"var(--g-ct-p, 15px)"}:t?.[e]!==void 0?{contentWidth:t?.[e],wrapperWidth:`calc(${t?.[e]} + 2 * var(--g-ct-p, 15px))`,wrapperPadding:"var(--g-ct-p, 15px)"}:{contentWidth:void 0,wrapperWidth:`calc(var(--g-ct-w, ${defaultWidth[e]}) + 2 * var(--g-ct-p, 15px))`,wrapperPadding:"var(--g-ct-p, 15px)"},createStyleObject=e=>{let t=getStyleByDevice("desktop",e),r=getStyleByDevice("tablet",e),d=getStyleByDevice("mobile",e);return{content:{desktop:t.contentWidth,tablet:r.contentWidth,mobile:d.contentWidth},wrapper:{desktop:t.wrapperWidth,tablet:r.wrapperWidth,mobile:d.wrapperWidth},padding:{desktop:t.wrapperPadding,tablet:r.wrapperPadding,mobile:d.wrapperPadding}}},getData=t=>{let{styles:r,builderProps:o}=t,a=d({background:r?.background,uid:o?.uid});return{stateData:e(a).replaceAll("'","&#039;")}};function reduceRadiusForState(e,t){if(!e||!t)return{};let r=("string"==typeof e?e.split(" "):[]).map(e=>parseInt(e,10)||0),d=Object.fromEntries(["btrr","bblr","bbrr","btlr"].map((e,d)=>[e,Math.max(0,(parseInt(t[e]??"0",10)||0)-(r[d]||0))+"px"]));return{...d,radiusType:t.radiusType}}function reduceBorderRadiusForDevice(e,t){if(!e||!t)return{};let r={};return["normal","hover","active"].forEach(d=>{let o=e?.[d],a=t?.[d];o&&a&&(r[d]=reduceRadiusForState(o.width,a))}),r}function getInnerRadiusExcludeBorder(e,t){return{desktop:reduceBorderRadiusForDevice(e?.desktop,t?.desktop),tablet:reduceBorderRadiusForDevice(e?.tablet??e?.desktop,t?.tablet??t?.desktop),mobile:reduceBorderRadiusForDevice(e?.mobile??e?.tablet??e?.desktop,t?.mobile??t?.tablet??t?.desktop)}}let checkHasBackgroundVideo=e=>t.some(t=>{let d=r(e,t);return!!d&&(d?.videoType==="html5"&&d?.videoHtml5||d?.videoType==="youtube"&&d?.video)}),isRenderHtmlVideo=e=>{let t=o(e||{}),r=t.desktop?.videoType,d=t.tablet?.videoType,a=t.mobile?.videoType;return"html5"==r||"html5"==d||"html5"==a},isRenderYoutubeVideo=e=>{let t=o(e||{}),r=t.desktop?.videoType,d=t.tablet?.videoType,a=t.mobile?.videoType;return"youtube"==r||"youtube"==d||"youtube"==a};export{checkHasBackgroundVideo,createStyleObject,getData,getInnerRadiusExcludeBorder,isRenderHtmlVideo,isRenderYoutubeVideo};
@@ -1,2 +1,2 @@
1
1
  'use client';
2
- import{makeStyleResponsive as e,getValueByDevice as t,isEmptyChildren as o,splitStyle as r,composeRadius as p,composeGridLayout as i,makeStyle as l,getStyleBackgroundByDevice as d,getGradientBgrStyleByDevice as n}from"@gem-sdk/core";import{createStyle as a}from"@gem-sdk/system";import{getInnerRadiusExcludeBorder as m,createStyleObject as s}from"./helpers.js";import{postPurchaseViewSpacing as b}from"../../../../post-purchase/common/helper.js";let getRowStyle=(g,f)=>{let{children:u,setting:c,builderProps:h,styles:k,style:x,advanced:v,isNotFullWidth:w,parentStyle:y}=g,{isSection:j,layout:R,horizontalAlign:S,responsive:T,inlineAlignment:O}=c??{},{width:q,columnGap:z,rowGap:C,fullWidth:D,background:H,verticalGutter:L,verticalGutterMobile:Y,enablePagePadding:A,height:B}=k??{},E=m(v?.border,v?.rounded),F=(e,t)=>{let o=e?.normal,r=t?.normal;if(!o||!r||r?.borderType=="none"||"square"===o.radiusType||"none"===o.radiusType)return!1;for(let e in o)if(Object.hasOwn(o,e)&&"0px"!==o[e])return!0;return!1},G=e("of",{desktop:F(E.desktop,t(v?.border,"desktop"))?"hidden":void 0,tablet:F(E.tablet,t(v?.border,"tablet"))?"hidden":void 0,mobile:F(E.mobile,t(v?.border,"mobile"))?"hidden":void 0}),I=h?.builderData?.childrens?.length,J={...e("aspect",{desktop:"16/9"})},K=o(u)||!I,M={desktop:q?.desktop==="default"?"1200px":q?.desktop,tablet:q?.tablet==="default"?"1200px":q?.tablet,mobile:q?.mobile==="default"?"1200px":q?.mobile},N=s(f?M:q,D),[P,Q]=r(["pos","top","left","bottom","right","z"],x),U=()=>({...j?Q:x,...e("cg",L),...e("rg",Y),...R?i(R):e("gtc",T),...e("w",N.content),...e("h",B),...j?{}:G}),V=()=>({"--mb":"0px","--mt":"0px",...e("cg",z),...l({pc:O,rg:C?b[C]:"0px"})}),W=t=>({...d(H,t),...n(H,{desktop:!0,tablet:!0,mobile:!0}),...e("pc",S)}),X=()=>{let e=w&&!K;return e?{marginLeft:"0px",marginRight:"0px"}:{}},Z=()=>({...p(E)}),$=(e=!1)=>a({...U(),...W(),...X(),...e?V():{},...c?.sameHeightSubgridContainer&&y}),_=a({...Z()}),ee=a({...J,"pointer-events":"none",transform:"translateY(-50%)",height:"100%","object-fit":"cover",top:"50%"}),et=e=>{if(void 0!==e)return e?"var(--g-ct-p, 15px)":"none"},eo={desktop:et(A?.desktop),tablet:et(A?.tablet),mobile:et(A?.mobile)},er=a({...P,...e("w",N.wrapper),...e("pl",eo),...e("pr",eo)});return{embedVideoStyle:ee,backgroundBoxStyle:_,rowStyle:$,sectionStyle:er}};export{getRowStyle};
2
+ import{makeStyleResponsive as e,getValueByDevice as t,isEmptyChildren as o,splitStyle as r,composeRadius as p,composeGridLayout as i,makeStyle as l,getStyleBackgroundByDevice as d,getGradientBgrStyleByDevice as n}from"@gem-sdk/core";import{createStyle as a}from"@gem-sdk/system";import{getInnerRadiusExcludeBorder as m,createStyleObject as s}from"./helpers.js";import{postPurchaseViewSpacing as b}from"../../../../post-purchase/common/helper.js";let getRowStyle=(g,f)=>{let{children:u,setting:c,builderProps:h,styles:k,style:x,advanced:v,isNotFullWidth:w,parentStyle:y}=g,{isSection:j,layout:R,horizontalAlign:S,responsive:T,inlineAlignment:O}=c??{},{width:q,columnGap:z,rowGap:C,background:D,verticalGutter:H,verticalGutterMobile:L,enablePagePadding:Y,height:A}=k??{},B=m(v?.border,v?.rounded),E=(e,t)=>{let o=e?.normal,r=t?.normal;if(!o||!r||r?.borderType=="none"||"square"===o.radiusType||"none"===o.radiusType)return!1;for(let e in o)if(Object.hasOwn(o,e)&&"0px"!==o[e])return!0;return!1},F=e("of",{desktop:E(B.desktop,t(v?.border,"desktop"))?"hidden":void 0,tablet:E(B.tablet,t(v?.border,"tablet"))?"hidden":void 0,mobile:E(B.mobile,t(v?.border,"mobile"))?"hidden":void 0}),G=h?.builderData?.childrens?.length,I={...e("aspect",{desktop:"16/9"})},J=o(u)||!G,K={desktop:q?.desktop==="default"?"1200px":q?.desktop,tablet:q?.tablet==="default"?"1200px":q?.tablet,mobile:q?.mobile==="default"?"1200px":q?.mobile},M=s(f?K:q),[N,P]=r(["pos","top","left","bottom","right","z"],x),Q=()=>({...j?P:x,...e("cg",H),...e("rg",L),...R?i(R):e("gtc",T),...e("w",M.content),...e("h",A),...j?{}:F}),U=()=>({"--mb":"0px","--mt":"0px",...e("cg",z),...l({pc:O,rg:C?b[C]:"0px"})}),V=t=>({...d(D,t),...n(D,{desktop:!0,tablet:!0,mobile:!0}),...e("pc",S)}),W=()=>{let e=w&&!J;return e?{marginLeft:"0px",marginRight:"0px"}:{}},X=()=>({...p(B)}),Z=(e=!1)=>a({...Q(),...V(),...W(),...e?U():{},...c?.sameHeightSubgridContainer&&y}),$=a({...X()}),_=a({...I,"pointer-events":"none",transform:"translateY(-50%)",height:"100%","object-fit":"cover",top:"50%"}),ee=e=>{if(void 0!==e)return e?"var(--g-ct-p, 15px)":"none"},et={desktop:ee(Y?.desktop),tablet:ee(Y?.tablet),mobile:ee(Y?.mobile)},eo=a({...N,...e("w",M.wrapper),...e("pl",et),...e("pr",et)});return{embedVideoStyle:_,backgroundBoxStyle:$,rowStyle:Z,sectionStyle:eo}};export{getRowStyle};
@@ -1 +1 @@
1
- import{getGlobalColorStateClass as e,getValueByDevice as s}from"@gem-sdk/core";import{getClassAlignBanner as o,getResponsiveSetting as l,getClassContentPosition as a,getContentPosition as t,getClassForContentByFitContent as r,getClassForStretchContent as g,opacityEnabledData as p,getClassSpaceBetween as n,getClassSpaceBetweenLeftRight as i,getOpacityHover as u}from"./helpers.js";function composeClasses(e){return e.split(" ").reduce((e,s)=>(e[s]=!0,e),{})}let getClasses=({setting:e,builderProps:s,advancedCssClass:a})=>{let t="gp-group/hero gp-flex gp-w-full gp-flex-col gp-self-center gp-transition-colors gp-duration-200 gp-ease-in-out";return a&&(t+=` ${a}`),{...s?.uid&&{[s.uid]:!0},...composeClasses(t),...o(l(e?.alignBanner||{}))}},getLinkClasses=()=>({...composeClasses("gp-cursor-pointer gp-h-full")}),getContainerClasses=(e,s)=>({...composeClasses("gp-relative gp-flex gp-w-full gp-flex-col gp-items-center gp-overflow-hidden hero-banner-container"),...a(t(e?.layout,s?.contentPosition1Col,s?.contentPosition2Col)||{})}),enableTransitionHover=e=>{let{overlayColor:s}=e??{},o=s?.hover||s?.normal;return o&&"transparent"!==o&&"0%"!=u(e)},getOverlayClasses=s=>{let{overlayColor:o,hoverEffect:l}=s??{},{disableOpacity:a}=p(s),t="gp-absolute gp-inset-0 gp-left-[var(--left)] gp-top-[var(--top)] gp-z-1";return enableTransitionHover(s)&&(t+=" gp-transition-all gp-duration-300"),l&&(t+=" group-hover/hero:gp-bg-[color:var(--hvr-bgc,_var(--bgc))] group-hover/hero:gp-opacity-[var(--hvr-op,_var(--op))]"),e("bg",o,a,!l)&&(t+=` ${e("bg",o,a,!l)}`),composeClasses(t)},getRowClasses=(e,s)=>{let{sizeSetting:o,background:l}=e??{},{verticalAlign:a}=s??{},t=r(o,l),p=g(a),u=n(s?.layout||{},e?.contentPosition1Col||{},e?.contentPosition2Col||{}),c=i(s?.layout||{}),C=`gp-hero-banner-row ${t} ${p}`;return{...composeClasses(C),...u,...c}},getAdaptiveClasses=()=>composeClasses("adaptive-hero-banner"),getAdaptivePictureClasses=()=>composeClasses("gp-w-full"),getBackgroundClasses=(e,s)=>{let o="hero-banner-bg gp-hero-banner-image-background hero-banner-bg-parallax";return s&&(o+=" gp_lazybg"),e&&(o+=" gp-duration-[var(--duration)] group-hover/hero:gp-scale-[var(--scale)] gp-transition-transform"),composeClasses(o)},getContainBackgroundClasses=()=>composeClasses("gp-hero-banner-bg gp-absolute gp-overflow-hidden gp-w-full gp-h-full top-0 left-0"),getHtml5VideoClasses=(e,o=!1)=>{let l="gp-relative",a=s(e,"tablet"),t=s(e,"mobile");return o&&(l+=" gp-hidden"),a&&(l+=" tablet:gp-h-full tablet:gp-object-cover"),t&&(l+=" mobile:gp-h-full mobile:gp-object-cover"),composeClasses(l)},getWrapperYoutubeClasses=()=>composeClasses("gp-pb-[56.25%] gp-h-full gp-w-full !gp-max-w-none gp-pointer-events-none"),getIframeYoutubeClasses=()=>composeClasses("!gp-w-[500%] !gp-ml-[-200%] !gp-h-full !gp-max-w-none gp-scale-[104%]"),getLazyBackgroundClasses=e=>{let s="gp-absolute gp-top-0 gp-invisible gp-w-full gp_lazyload gp-h-full gp_lazyforbg";return"tablet"===e&&(s+=" gp_lazybg_tl"),"mobile"===e&&(s+=" gp_lazybg_mb"),composeClasses(s)};export{enableTransitionHover,getAdaptiveClasses,getAdaptivePictureClasses,getBackgroundClasses,getClasses,getContainBackgroundClasses,getContainerClasses,getHtml5VideoClasses,getIframeYoutubeClasses,getLazyBackgroundClasses,getLinkClasses,getOverlayClasses,getRowClasses,getWrapperYoutubeClasses};
1
+ import{getGlobalColorStateClass as e,getValueByDevice as s}from"@gem-sdk/core";import{getClassAlignBanner as o,getResponsiveSetting as l,getClassContentPosition as a,getContentPosition as t,getClassForContentByFitContent as r,getClassForStretchContent as g,getClassSpaceBetween as p,opacityEnabledData as n,getClassSpaceBetweenLeftRight as i,getOpacityHover as u}from"./helpers.js";function composeClasses(e){return e.split(" ").reduce((e,s)=>(e[s]=!0,e),{})}let getClasses=({setting:e,builderProps:s,advancedCssClass:a})=>{let t="gp-group/hero gp-flex gp-w-full gp-flex-col gp-self-center gp-transition-colors gp-duration-200 gp-ease-in-out";return a&&(t+=` ${a}`),{...s?.uid&&{[s.uid]:!0},...composeClasses(t),...o(l(e?.alignBanner||{}))}},getLinkClasses=()=>({...composeClasses("gp-cursor-pointer gp-h-full")}),getContainerClasses=(e,s)=>({...composeClasses("gp-relative gp-flex gp-w-full gp-flex-col gp-items-center gp-overflow-hidden hero-banner-container"),...a(t(e?.layout,s?.contentPosition1Col,s?.contentPosition2Col)||{})}),enableTransitionHover=e=>{let{overlayColor:s}=e??{},o=s?.hover||s?.normal;return o&&"transparent"!==o&&"0%"!=u(e)},getOverlayClasses=s=>{let{overlayColor:o,hoverEffect:l}=s??{},{disableOpacity:a}=n(s),t="gp-absolute gp-inset-0 gp-left-[var(--left)] gp-top-[var(--top)] gp-z-1";return enableTransitionHover(s)&&(t+=" gp-transition-all gp-duration-300"),l&&(t+=" group-hover/hero:gp-bg-[color:var(--hvr-bgc,_var(--bgc))] group-hover/hero:gp-opacity-[var(--hvr-op,_var(--op))]"),e("bg",o,a,!l)&&(t+=` ${e("bg",o,a,!l)}`),composeClasses(t)},getRowClasses=(e,s)=>{let{sizeSetting:o,background:l}=e??{},{verticalAlign:a}=s??{},t=r(o,l),n=g(a),u=p(s?.layout||{},e?.contentPosition1Col||{}),c=i(s?.layout||{}),C=`gp-hero-banner-row ${t} ${n}`;return{...composeClasses(C),...u,...c}},getAdaptiveClasses=()=>composeClasses("adaptive-hero-banner"),getAdaptivePictureClasses=()=>composeClasses("gp-w-full"),getBackgroundClasses=(e,s)=>{let o="hero-banner-bg gp-hero-banner-image-background hero-banner-bg-parallax";return s&&(o+=" gp_lazybg"),e&&(o+=" gp-duration-[var(--duration)] group-hover/hero:gp-scale-[var(--scale)] gp-transition-transform"),composeClasses(o)},getContainBackgroundClasses=()=>composeClasses("gp-hero-banner-bg gp-absolute gp-overflow-hidden gp-w-full gp-h-full top-0 left-0"),getHtml5VideoClasses=(e,o=!1)=>{let l="gp-relative",a=s(e,"tablet"),t=s(e,"mobile");return o&&(l+=" gp-hidden"),a&&(l+=" tablet:gp-h-full tablet:gp-object-cover"),t&&(l+=" mobile:gp-h-full mobile:gp-object-cover"),composeClasses(l)},getWrapperYoutubeClasses=()=>composeClasses("gp-pb-[56.25%] gp-h-full gp-w-full !gp-max-w-none gp-pointer-events-none"),getIframeYoutubeClasses=()=>composeClasses("!gp-w-[500%] !gp-ml-[-200%] !gp-h-full !gp-max-w-none gp-scale-[104%]"),getLazyBackgroundClasses=e=>{let s="gp-absolute gp-top-0 gp-invisible gp-w-full gp_lazyload gp-h-full gp_lazyforbg";return"tablet"===e&&(s+=" gp_lazybg_tl"),"mobile"===e&&(s+=" gp_lazybg_mb"),composeClasses(s)};export{enableTransitionHover,getAdaptiveClasses,getAdaptivePictureClasses,getBackgroundClasses,getClasses,getContainBackgroundClasses,getContainerClasses,getHtml5VideoClasses,getIframeYoutubeClasses,getLazyBackgroundClasses,getLinkClasses,getOverlayClasses,getRowClasses,getWrapperYoutubeClasses};
@@ -1 +1 @@
1
- import{getResponsiveValueByScreen as e,getAspectRatioGlobalSize as t,makeStyleResponsive as o,DEVICES as l,getValueByDevice as i,GRADIENT_BGR_KEY as n,cls as a}from"@gem-sdk/core";import{getImageSrc as r,createBlurDataURL as s}from"../../image/common/helpers.js";import{HREF_TO_SALES_PAGE as g}from"../../constant.js";let getContentPosition=(t,o,i)=>{let n={};return l.map(l=>{let a=e(t,l),r=e(o,l),s=e(i,l);n={...n,[l]:1>=(a?.cols?.length||1)?r:s}}),n},getAspectRatioSettings=(t,o)=>{let l={desktop:t?.desktop?.width,tablet:t?.tablet?.width,mobile:t?.mobile?.width},i={desktop:t?.desktop?.height,tablet:t?.tablet?.height,mobile:t?.mobile?.height},n={desktop:o?.desktop==="custom"?`${e(l,"desktop")}/${e(i,"desktop")}`:o?.desktop==="cover"?"unset":o?.desktop,tablet:o?.tablet==="custom"?`${e(l,"tablet")}/${e(i,"tablet")}`:o?.tablet==="cover"?"unset":o?.tablet,mobile:o?.mobile==="custom"?`${e(l,"mobile")}/${e(i,"mobile")}`:o?.mobile==="cover"?"unset":o?.mobile};return n},getEnableBgImageByDevice=(t,o)=>{if(!e(getBgImage(o),t))return!1;if(!o?.[t]){if("mobile"===t)return o?.tablet?.type==="image"||o?.desktop?.type==="image"&&!o?.tablet;if("tablet"===t)return o?.desktop?.type==="image"}return o?.[t]?.type==="image"},getBgImage=e=>{if(!e)return{};let t={desktop:e?.desktop?.image,tablet:e?.tablet?.image,mobile:e?.mobile?.image};return t},imagePlaceholder=e=>{let t=getBgImage(e);return{desktop:s(t?.desktop?.width??0,t?.desktop?.height??0),tablet:s(t?.tablet?.width??t?.desktop?.width??0,t?.tablet?.height??t?.desktop?.width??0),mobile:s(t?.mobile?.width??t?.tablet?.width??t?.desktop?.width??0,t?.mobile?.height??t?.tablet?.height??t?.desktop?.width??0)}},getBgImageByScreen=(t,o,l,i)=>{if(!t)return"";let a=getBgImage(t),s=e(t,o),g=l?`url(${imagePlaceholder(t)[o]})`:`url(${r(e(a,o),o,i)})`,p=s?.color?`, ${s.color}`:"";return s?.color?.includes(n)&&s?.type==="image"?`${g}${p}`:s?.color?.includes(n)&&s?.type!=="image"?`${s.color}`:s?.type==="image"?g:"url()"},getBackgroundImageHeroBanner=(e,t=!1,i=!1)=>{if(!e)return;let n={};return l.forEach(o=>{n={...n,[o]:getBgImageByScreen(e,o,t,i)}}),o("bgi",n)},getAttachmentDevice=e=>{let t={},o=["desktop","mobile","tablet"];return o.forEach(o=>{let l=e?.[o]?.attachment;t={...t,[o]:"fixed"===l?"fixed":"absolute"}}),t},horizontalAlign=(e,t,o)=>mapContentPositionToHorizontal(getContentPosition(e,t,o)),scrollToContentBanner=e=>e?.target?.closest("div.gp-hero-banner-row")?.scrollTo(0,0),getDataVideoHeroBannerResponsive=(e,t)=>{switch(e){case"desktop":if(t?.desktop?.type==="video")return{device:"desktop",data:t.desktop};break;case"tablet":if(t?.tablet?.type==="video")return{device:"tablet",data:t.tablet};if(!t?.tablet&&t?.desktop?.type==="video")return{device:"desktop",data:t.desktop};break;case"mobile":if(t?.mobile?.type==="video")return{device:"mobile",data:t.mobile};if(!t?.mobile&&t?.tablet?.type==="video")return{device:"tablet",data:t.tablet};if(!t?.mobile&&!t?.tablet?.type&&t?.desktop?.type==="video")return{device:"desktop",data:t.desktop}}},getVisibilityStyle=e=>e?Object.keys(e).filter(e=>["--d","--d-tablet","--d-mobile"].includes(e)).reduce((t,o)=>({...t,[o]:e?.[o]!=="none"?"flex":e?.[o]}),{}):{},getStyleAspectRatioHeroBannerCustom=(l,i,n)=>{let a=t(i),r=["desktop","mobile","tablet"];return r.forEach(t=>{let o=e(i,t),r=!!getDataVideoHeroBannerResponsive(t,l),s=o?.shape,g=o?.height,p="original"===s&&"fit-content"!==g,b=p&&r;b&&(a={...a,[t]:"16/9"}),n&&n[t]&&getDataVideoHeroBannerResponsive(t,l)?.data?.videoType==="html5"&&(a={...a,[t]:n[t]})}),o("aspect",a)},mapContentPositionToHorizontal=e=>{let t={};for(let o in e)"top"===e[o]?t[o]="start":"bottom"===e[o]?t[o]="end":t[o]="center";return t},getDisplayStyleByFitContent=(t,l)=>{let i={desktop:"none",tablet:"none",mobile:"none"},n=["desktop","mobile","tablet"];return n.forEach(o=>{let n=e(t,o),a=!!getDataVideoHeroBannerResponsive(o,l),r=n?.shape,s=n?.height,g="original"===r&&"fit-content"!==s&&!a;i={...i,[o]:g?"block":"none"}}),o("d",i)},getWidth=e=>{let t={},o=["desktop","mobile","tablet"];return o.forEach(o=>{let l=e?.[o];l&&(t={...t,[o]:"default"===l?"var(--g-ct-w, 1200px)":l})}),t},getPercentageVisible=(e,t)=>{let{top:o,height:l}=e,i=-l;if(o<i)return 0;if(o>t)return 100;let n=(o-i)/(t-i)*100;return Math.min(Math.max(n,0),100)},isScaleImage=({enableParallax:e=!1,attachment:t="scroll"})=>!!e||"fixed"===t,getHeightHeroBanner=(e,t)=>{let l={},i=["desktop","mobile","tablet"];return i.forEach(o=>{let i=isScaleImage({enableParallax:t,attachment:e[o]?.attachment});l={...l,[o]:t?"150%":i?"100vh":"100%"}}),o("h",l)},getWidthHeroBanner=(e,t)=>{let l={},i=["desktop","mobile","tablet"];return i.forEach(o=>{let i=isScaleImage({enableParallax:t,attachment:e[o]?.attachment});l={...l,[o]:i?"100vw":"100%"}}),o("w",l)},getTopHeroBanner=e=>{let t={},l=["desktop","mobile","tablet"];return l.forEach(o=>{t={...t,[o]:e[o]?.attachment==="fixed"?"0px":""}}),o("top",t)},getStyleHeroBannerBg=(e,t)=>{let o=getHeightHeroBanner(e,t),l=getWidthHeroBanner(e,t),i=getTopHeroBanner(e);return{...o,...l,...i}},calcRounderClipPath=(e,t=0,o=0)=>{let l=t,i=t;if(t>o?l=o:i=o,e>=999){let t=e-l;return t>0?t:0}let n=e-i;return n>0?n:0},getClipPath=(e,t)=>{if(!t||!e)return"inset(0 0 0)";let[o,l,i,n]=e.split(" ").map(e=>parseInt(e??"0")),{btlr:a,btrr:r,bbrr:s,bblr:g}=t,p=calcRounderClipPath(parseInt(a??"0"),o,n),b=calcRounderClipPath(parseInt(r??"0"),o,l),c=calcRounderClipPath(parseInt(s??"0"),l,i),d=calcRounderClipPath(parseInt(g??"0"),i,n);return`inset(0 0 0 round ${p}px ${b}px ${c}px ${d}px)`},getClassAlignBanner=e=>({"!gp-self-start":"left"===e.desktop,"!gp-self-center":"center"===e.desktop,"!gp-self-end":"right"===e.desktop,"tablet:!gp-self-start":"left"===e.tablet,"tablet:!gp-self-center":"center"===e.tablet,"tablet:!gp-self-end":"right"===e.tablet,"mobile:!gp-self-start":"left"===e.mobile,"mobile:!gp-self-center":"center"===e.mobile,"mobile:!gp-self-end":"right"===e.mobile}),getClassSpaceBetween=(e,t,o)=>{let l=getResponsiveSetting(e),i=getResponsiveSetting(t),n=getResponsiveSetting(o),a=1>=(l?.desktop?.cols?.length||1)?i.desktop:n.desktop,r=1>=(l?.tablet?.cols?.length||1)?i.tablet:n.tablet,s=1>=(l?.mobile?.cols?.length||1)?i.mobile:n.mobile;return{"!gp-h-full !gp-content-stretch [&>*]:!gp-justify-between [&>*:nth-child(2)]:gp-absolute [&>*:nth-child(2)]:gp-hidden":l.desktop?.cols?.length===1&&"space-between"===a,"!gp-content-stretch [&>*]:!gp-justify-start":l.desktop?.cols?.length===1&&"top"===a,"tablet:!gp-h-full tablet:!gp-content-stretch tablet:[&>*]:!gp-justify-between tablet:[&>*:nth-child(2)]:gp-absolute tablet:[&>*:nth-child(2)]:gp-hidden":l.tablet?.cols?.length===1&&"space-between"===r,"tablet:!gp-content-stretch tablet:[&>*]:!gp-justify-start":l.tablet?.cols?.length===1&&"top"===r,"tablet:!gp-content-stretch tablet:[&>*]:!gp-justify-center":l.tablet?.cols?.length===1&&"center"===r,"tablet:!gp-content-stretch tablet:[&>*]:!gp-justify-end":l.tablet?.cols?.length===1&&"bottom"===r,"mobile:!gp-h-full mobile:!gp-content-stretch mobile:[&>*]:!gp-justify-between mobile:[&>*:nth-child(2)]:gp-absolute mobile:[&>*:nth-child(2)]:gp-hidden":l.mobile?.cols?.length===1&&"space-between"===s,"mobile:[&>*]:!gp-justify-between mobile:[&>*:nth-child(2)]:gp-relative mobile:[&>*:nth-child(2)]:gp-flex":l.mobile?.cols?.length!==1,"mobile:!gp-content-stretch mobile:[&>*]:!gp-justify-start":l.mobile?.cols?.length===1&&"top"===s,"mobile:!gp-content-stretch mobile:[&>*]:!gp-justify-center":l.mobile?.cols?.length===1&&"center"===s,"mobile:!gp-content-stretch mobile:[&>*]:!gp-justify-end":l.mobile?.cols?.length===1&&"bottom"===s}},getClassSpaceBetweenLeftRight=e=>{let t=getResponsiveSetting(e),o=t?.desktop?.type=="left-distributed"||t?.desktop?.type=="right-distributed",l=t?.tablet?.type=="left-distributed"||t?.tablet?.type=="right-distributed",i=t?.mobile?.type=="left-distributed"||t?.mobile?.type=="right-distributed";return{"gp-h-full tablet:gp-h-auto mobile:gp-h-auto [&>*]:!gp-justify-between":o,"tablet:!gp-h-full tablet:[&>*]:!gp-justify-between mobile:gp-h-auto":l,"mobile:!gp-h-full mobile:[&>*]:!gp-justify-between":i,"mobile:!gp-h-auto":!i}},getClassForStretchContent=t=>{let o={desktop:"none",tablet:"none",mobile:"none"},l=["desktop","mobile","tablet"];return l.forEach(l=>{let i=e(t,l);o={...o,[l]:i}}),a("space-between"===o.desktop?"[&>*>*]:!gp-justify-between":"","space-between"===o.tablet?"tablet:[&>*>*]:!gp-justify-between ":`tablet:[&>*>*]:!gp-justify-${t?.tablet}`,"space-between"===o.mobile?"mobile:[&>*>*]:!gp-justify-between ":`mobile:[&>*>*]:!gp-justify-${t?.mobile}`)},getClassForContentByFitContent=(t,o)=>{let l={desktop:!1,tablet:!1,mobile:!1},i=["desktop","mobile","tablet"];return i.forEach(i=>{let n=e(t,i),a=!!getDataVideoHeroBannerResponsive(i,o),r=n?.shape,s=n?.height,g="original"===r&&"fit-content"!==s;l={...l,[i]:g&&!a}}),a(l.desktop?"!gp-absolute":"",l.tablet?"tablet:!gp-absolute":"tablet:!gp-relative",l.mobile?"mobile:!gp-absolute":"mobile:!gp-relative")},getClassContentPosition=e=>{let t={center:"center",top:"start",bottom:"end","space-between":"between"},o=e.desktop||"center",l=e.tablet||o,i=e.mobile||l;return{[`gp-justify-${t[o||"center"]}`]:!!o,[`tablet:gp-justify-${t[l||"center"]}`]:!!l,[`mobile:gp-justify-${t[i||"center"]}`]:!!i}},getResponsiveSetting=e=>{let t=e.desktop,o=e.tablet?e.tablet:t,l=e.mobile?e.mobile:o;return{desktop:t,tablet:o,mobile:l}},showVideoType=e=>l.some(t=>{let o=i(e,t);return o?.type!=="color"&&o?.type!=="image"&&!!o&&(o?.videoType==="html5"&&o?.videoHtml5||o?.videoType==="youtube"&&o?.video)});function debounce(e,t){let o;return function(...l){clearTimeout(o),o=setTimeout(()=>e.apply(this,l),t)}}let fallbackImg="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTkyMCIgaGVpZ2h0PSI5MDAiIHZlcnNpb249IjEuMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayI+CiAgICA8ZGVmcz4KICAgICAgPGxpbmVhckdyYWRpZW50IGlkPSJnLTE5MjAtOTAwIj4KICAgICAgICA8c3RvcCBzdG9wLWNvbG9yPSJyZ2JhKDUxLCA1MSwgNTEsIDApIiBvZmZzZXQ9IjIwJSIgLz4KICAgICAgICA8c3RvcCBzdG9wLWNvbG9yPSJyZ2JhKDUxLCA1MSwgNTEsIDApIiBvZmZzZXQ9IjUwJSIgLz4KICAgICAgICA8c3RvcCBzdG9wLWNvbG9yPSJyZ2JhKDUxLCA1MSwgNTEsIDApIiBvZmZzZXQ9IjcwJSIgLz4KICAgICAgPC9saW5lYXJHcmFkaWVudD4KICAgIDwvZGVmcz4KICAgIDxyZWN0IHdpZHRoPSIxOTIwIiBoZWlnaHQ9IjkwMCIgZmlsbD0icmdiYSg1MSwgNTEsIDUxLCAwKSIgLz4KICAgIDxyZWN0IGlkPSJyIiB3aWR0aD0iMTkyMCIgaGVpZ2h0PSI5MDAiIGZpbGw9InVybCgjZy0xOTIwLTkwMCkiIC8+CiAgICA8YW5pbWF0ZSB4bGluazpocmVmPSIjciIgYXR0cmlidXRlTmFtZT0ieCIgZnJvbT0iLTE5MjAiIHRvPSIxOTIwIiBkdXI9IjFzIiByZXBlYXRDb3VudD0iaW5kZWZpbml0ZSIgIC8+CiAgPC9zdmc+",getBannerLink=e=>{let t=e?.link;return t?.type==="go-to-sales-page"?{type:"go-to-sales-page",link:g,target:"_self"}:t},formatHoverScale=e=>e?String(e).includes("%")?`${e}`:`${e}%`:"100%",opacityEnabledData=e=>{let{overlayColor:t,overlayOpacity:o}=e??{},l=!t?.normal||o?.normal=="0%"||!o?.normal;return{disableOpacity:l}},getOpacityHover=e=>{let{overlayOpacity:t}=e??{},o="number"!=typeof t?.hover||isNaN(t?.hover)?"string"==typeof t?.hover?`${parseInt(t?.hover)}%`:"":`${t?.hover}%`,l="number"!=typeof t?.normal||isNaN(t?.normal)?"string"==typeof t?.normal?`${parseInt(t?.normal)}%`:"0%":`${t?.normal}%`;return o||l};export{debounce,fallbackImg,formatHoverScale,getAspectRatioSettings,getAttachmentDevice,getBackgroundImageHeroBanner,getBannerLink,getBgImage,getClassAlignBanner,getClassContentPosition,getClassForContentByFitContent,getClassForStretchContent,getClassSpaceBetween,getClassSpaceBetweenLeftRight,getClipPath,getContentPosition,getDataVideoHeroBannerResponsive,getDisplayStyleByFitContent,getEnableBgImageByDevice,getOpacityHover,getPercentageVisible,getResponsiveSetting,getStyleAspectRatioHeroBannerCustom,getStyleHeroBannerBg,getVisibilityStyle,getWidth,horizontalAlign,imagePlaceholder,isScaleImage,mapContentPositionToHorizontal,opacityEnabledData,scrollToContentBanner,showVideoType};
1
+ import{getResponsiveValueByScreen as e,getAspectRatioGlobalSize as t,makeStyleResponsive as o,DEVICES as l,getValueByDevice as i,GRADIENT_BGR_KEY as a,cls as n}from"@gem-sdk/core";import{getImageSrc as r,createBlurDataURL as s}from"../../image/common/helpers.js";import{HREF_TO_SALES_PAGE as g}from"../../constant.js";let getContentPosition=(t,o,i)=>{let a={};return l.map(l=>{let n=e(t,l),r=e(o,l),s=e(i,l);a={...a,[l]:1>=(n?.cols?.length||1)?r:s}}),a},getAspectRatioSettings=(t,o)=>{let l={desktop:t?.desktop?.width,tablet:t?.tablet?.width,mobile:t?.mobile?.width},i={desktop:t?.desktop?.height,tablet:t?.tablet?.height,mobile:t?.mobile?.height},a={desktop:o?.desktop==="custom"?`${e(l,"desktop")}/${e(i,"desktop")}`:o?.desktop==="cover"?"unset":o?.desktop,tablet:o?.tablet==="custom"?`${e(l,"tablet")}/${e(i,"tablet")}`:o?.tablet==="cover"?"unset":o?.tablet,mobile:o?.mobile==="custom"?`${e(l,"mobile")}/${e(i,"mobile")}`:o?.mobile==="cover"?"unset":o?.mobile};return a},getEnableBgImageByDevice=(t,o)=>{if(!e(getBgImage(o),t))return!1;if(!o?.[t]){if("mobile"===t)return o?.tablet?.type==="image"||o?.desktop?.type==="image"&&!o?.tablet;if("tablet"===t)return o?.desktop?.type==="image"}return o?.[t]?.type==="image"},getBgImage=e=>{if(!e)return{};let t={desktop:e?.desktop?.image,tablet:e?.tablet?.image,mobile:e?.mobile?.image};return t},imagePlaceholder=e=>{let t=getBgImage(e);return{desktop:s(t?.desktop?.width??0,t?.desktop?.height??0),tablet:s(t?.tablet?.width??t?.desktop?.width??0,t?.tablet?.height??t?.desktop?.width??0),mobile:s(t?.mobile?.width??t?.tablet?.width??t?.desktop?.width??0,t?.mobile?.height??t?.tablet?.height??t?.desktop?.width??0)}},getBgImageByScreen=(t,o,l,i)=>{if(!t)return"";let n=getBgImage(t),s=e(t,o),g=l?`url(${imagePlaceholder(t)[o]})`:`url(${r(e(n,o),o,i)})`,p=s?.color?`, ${s.color}`:"";return s?.color?.includes(a)&&s?.type==="image"?`${g}${p}`:s?.color?.includes(a)&&s?.type!=="image"?`${s.color}`:s?.type==="image"?g:"url()"},getBackgroundImageHeroBanner=(e,t=!1,i=!1)=>{if(!e)return;let a={};return l.forEach(o=>{a={...a,[o]:getBgImageByScreen(e,o,t,i)}}),o("bgi",a)},getAttachmentDevice=e=>{let t={},o=["desktop","mobile","tablet"];return o.forEach(o=>{let l=e?.[o]?.attachment;t={...t,[o]:"fixed"===l?"fixed":"absolute"}}),t},horizontalAlign=(e,t,o)=>mapContentPositionToHorizontal(getContentPosition(e,t,o)),scrollToContentBanner=e=>e?.target?.closest("div.gp-hero-banner-row")?.scrollTo(0,0),getDataVideoHeroBannerResponsive=(e,t)=>{switch(e){case"desktop":if(t?.desktop?.type==="video")return{device:"desktop",data:t.desktop};break;case"tablet":if(t?.tablet?.type==="video")return{device:"tablet",data:t.tablet};if(!t?.tablet&&t?.desktop?.type==="video")return{device:"desktop",data:t.desktop};break;case"mobile":if(t?.mobile?.type==="video")return{device:"mobile",data:t.mobile};if(!t?.mobile&&t?.tablet?.type==="video")return{device:"tablet",data:t.tablet};if(!t?.mobile&&!t?.tablet?.type&&t?.desktop?.type==="video")return{device:"desktop",data:t.desktop}}},getVisibilityStyle=e=>e?Object.keys(e).filter(e=>["--d","--d-tablet","--d-mobile"].includes(e)).reduce((t,o)=>({...t,[o]:e?.[o]!=="none"?"flex":e?.[o]}),{}):{},getStyleAspectRatioHeroBannerCustom=(l,i,a)=>{let n=t(i),r=["desktop","mobile","tablet"];return r.forEach(t=>{let o=e(i,t),r=!!getDataVideoHeroBannerResponsive(t,l),s=o?.shape,g=o?.height,p="original"===s&&"fit-content"!==g,b=p&&r;b&&(n={...n,[t]:"16/9"}),a&&a[t]&&getDataVideoHeroBannerResponsive(t,l)?.data?.videoType==="html5"&&(n={...n,[t]:a[t]})}),o("aspect",n)},mapContentPositionToHorizontal=e=>{let t={};for(let o in e)"top"===e[o]?t[o]="start":"bottom"===e[o]?t[o]="end":t[o]="center";return t},getDisplayStyleByFitContent=(t,l)=>{let i={desktop:"none",tablet:"none",mobile:"none"},a=["desktop","mobile","tablet"];return a.forEach(o=>{let a=e(t,o),n=!!getDataVideoHeroBannerResponsive(o,l),r=a?.shape,s=a?.height,g="original"===r&&"fit-content"!==s&&!n;i={...i,[o]:g?"block":"none"}}),o("d",i)},getWidth=e=>{let t={},o=["desktop","mobile","tablet"];return o.forEach(o=>{let l=e?.[o];l&&(t={...t,[o]:"default"===l?"var(--g-ct-w, 1200px)":l})}),t},getPercentageVisible=(e,t)=>{let{top:o,height:l}=e,i=-l;if(o<i)return 0;if(o>t)return 100;let a=(o-i)/(t-i)*100;return Math.min(Math.max(a,0),100)},isScaleImage=({enableParallax:e=!1,attachment:t="scroll"})=>!!e||"fixed"===t,getHeightHeroBanner=(e,t)=>{let l={},i=["desktop","mobile","tablet"];return i.forEach(o=>{let i=isScaleImage({enableParallax:t,attachment:e[o]?.attachment});l={...l,[o]:t?"150%":i?"100vh":"100%"}}),o("h",l)},getWidthHeroBanner=(e,t)=>{let l={},i=["desktop","mobile","tablet"];return i.forEach(o=>{let i=isScaleImage({enableParallax:t,attachment:e[o]?.attachment});l={...l,[o]:i?"100vw":"100%"}}),o("w",l)},getTopHeroBanner=e=>{let t={},l=["desktop","mobile","tablet"];return l.forEach(o=>{t={...t,[o]:e[o]?.attachment==="fixed"?"0px":""}}),o("top",t)},getStyleHeroBannerBg=(e,t)=>{let o=getHeightHeroBanner(e,t),l=getWidthHeroBanner(e,t),i=getTopHeroBanner(e);return{...o,...l,...i}},calcRounderClipPath=(e,t=0,o=0)=>{let l=t,i=t;if(t>o?l=o:i=o,e>=999){let t=e-l;return t>0?t:0}let a=e-i;return a>0?a:0},getClipPath=(e,t)=>{if(!t||!e)return"inset(0 0 0)";let[o,l,i,a]=e.split(" ").map(e=>parseInt(e??"0")),{btlr:n,btrr:r,bbrr:s,bblr:g}=t,p=calcRounderClipPath(parseInt(n??"0"),o,a),b=calcRounderClipPath(parseInt(r??"0"),o,l),c=calcRounderClipPath(parseInt(s??"0"),l,i),d=calcRounderClipPath(parseInt(g??"0"),i,a);return`inset(0 0 0 round ${p}px ${b}px ${c}px ${d}px)`},getClassAlignBanner=e=>({"!gp-self-start":"left"===e.desktop,"!gp-self-center":"center"===e.desktop,"!gp-self-end":"right"===e.desktop,"tablet:!gp-self-start":"left"===e.tablet,"tablet:!gp-self-center":"center"===e.tablet,"tablet:!gp-self-end":"right"===e.tablet,"mobile:!gp-self-start":"left"===e.mobile,"mobile:!gp-self-center":"center"===e.mobile,"mobile:!gp-self-end":"right"===e.mobile}),get1ColLayout=({device:e,settingLayoutRes:t,contentPosition1ColRes:o})=>{let l=t[e]?.cols??[],i=l.length<=1,a=o[e];if(!i||!a)return;let n=["space-between","top","center","bottom"];return n.includes(a)?a:void 0},getClassSpaceBetween=(e,t)=>{let o=getResponsiveSetting(e),i=getResponsiveSetting(t),a={desktop:get1ColLayout({device:"desktop",settingLayoutRes:o,contentPosition1ColRes:i}),tablet:get1ColLayout({device:"tablet",settingLayoutRes:o,contentPosition1ColRes:i}),mobile:get1ColLayout({device:"mobile",settingLayoutRes:o,contentPosition1ColRes:i})},n={"space-between":{desktop:"!gp-h-full !gp-content-stretch [&>*]:!gp-justify-between [&>*:nth-child(2)]:gp-absolute [&>*:nth-child(2)]:gp-hidden",tablet:"tablet:!gp-h-full tablet:!gp-content-stretch tablet:[&>*]:!gp-justify-between tablet:[&>*:nth-child(2)]:gp-absolute tablet:[&>*:nth-child(2)]:gp-hidden",mobile:"mobile:!gp-h-full mobile:!gp-content-stretch mobile:[&>*]:!gp-justify-between mobile:[&>*:nth-child(2)]:gp-absolute mobile:[&>*:nth-child(2)]:gp-hidden"},top:{desktop:"!gp-content-stretch [&>*]:!gp-justify-start",tablet:"tablet:!gp-content-stretch tablet:[&>*]:!gp-justify-start",mobile:"mobile:!gp-content-stretch mobile:[&>*]:!gp-justify-start"},center:{desktop:"!gp-content-stretch [&>*]:!gp-justify-center",tablet:"tablet:!gp-content-stretch tablet:[&>*]:!gp-justify-center",mobile:"mobile:!gp-content-stretch mobile:[&>*]:!gp-justify-center"},bottom:{desktop:"!gp-content-stretch [&>*]:!gp-justify-end",tablet:"tablet:!gp-content-stretch tablet:[&>*]:!gp-justify-end",mobile:"mobile:!gp-content-stretch mobile:[&>*]:!gp-justify-end"}},r={};return l.forEach(e=>{let t=a[e],o=n?.[t]?.[e];r[o]=!0}),r},getClassSpaceBetweenLeftRight=e=>{let t=getResponsiveSetting(e),o=t?.desktop?.type=="left-distributed"||t?.desktop?.type=="right-distributed",l=t?.tablet?.type=="left-distributed"||t?.tablet?.type=="right-distributed",i=t?.mobile?.type=="left-distributed"||t?.mobile?.type=="right-distributed";return{"gp-h-full tablet:gp-h-auto mobile:gp-h-auto [&>*]:!gp-justify-between":o,"tablet:!gp-h-full tablet:[&>*]:!gp-justify-between mobile:gp-h-auto":l,"mobile:!gp-h-full mobile:[&>*]:!gp-justify-between":i,"mobile:!gp-h-auto":!i}},getClassForStretchContent=t=>{let o={desktop:"none",tablet:"none",mobile:"none"},l=["desktop","mobile","tablet"];return l.forEach(l=>{let i=e(t,l);o={...o,[l]:i}}),n("space-between"===o.desktop?"[&>*>*]:!gp-justify-between":"","space-between"===o.tablet?"tablet:[&>*>*]:!gp-justify-between ":`tablet:[&>*>*]:!gp-justify-${t?.tablet}`,"space-between"===o.mobile?"mobile:[&>*>*]:!gp-justify-between ":`mobile:[&>*>*]:!gp-justify-${t?.mobile}`)},getClassForContentByFitContent=(t,o)=>{let l={desktop:!1,tablet:!1,mobile:!1},i=["desktop","mobile","tablet"];return i.forEach(i=>{let a=e(t,i),n=!!getDataVideoHeroBannerResponsive(i,o),r=a?.shape,s=a?.height,g="original"===r&&"fit-content"!==s;l={...l,[i]:g&&!n}}),n(l.desktop?"!gp-absolute":"",l.tablet?"tablet:!gp-absolute":"tablet:!gp-relative",l.mobile?"mobile:!gp-absolute":"mobile:!gp-relative")},getClassContentPosition=e=>{let t={center:"center",top:"start",bottom:"end","space-between":"between"},o=e.desktop||"center",l=e.tablet||o,i=e.mobile||l;return{[`gp-justify-${t[o||"center"]}`]:!!o,[`tablet:gp-justify-${t[l||"center"]}`]:!!l,[`mobile:gp-justify-${t[i||"center"]}`]:!!i}},getResponsiveSetting=e=>{let t=e.desktop,o=e.tablet?e.tablet:t,l=e.mobile?e.mobile:o;return{desktop:t,tablet:o,mobile:l}},showVideoType=e=>l.some(t=>{let o=i(e,t);return o?.type!=="color"&&o?.type!=="image"&&!!o&&(o?.videoType==="html5"&&o?.videoHtml5||o?.videoType==="youtube"&&o?.video)});function debounce(e,t){let o;return function(...l){clearTimeout(o),o=setTimeout(()=>e.apply(this,l),t)}}let fallbackImg="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTkyMCIgaGVpZ2h0PSI5MDAiIHZlcnNpb249IjEuMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayI+CiAgICA8ZGVmcz4KICAgICAgPGxpbmVhckdyYWRpZW50IGlkPSJnLTE5MjAtOTAwIj4KICAgICAgICA8c3RvcCBzdG9wLWNvbG9yPSJyZ2JhKDUxLCA1MSwgNTEsIDApIiBvZmZzZXQ9IjIwJSIgLz4KICAgICAgICA8c3RvcCBzdG9wLWNvbG9yPSJyZ2JhKDUxLCA1MSwgNTEsIDApIiBvZmZzZXQ9IjUwJSIgLz4KICAgICAgICA8c3RvcCBzdG9wLWNvbG9yPSJyZ2JhKDUxLCA1MSwgNTEsIDApIiBvZmZzZXQ9IjcwJSIgLz4KICAgICAgPC9saW5lYXJHcmFkaWVudD4KICAgIDwvZGVmcz4KICAgIDxyZWN0IHdpZHRoPSIxOTIwIiBoZWlnaHQ9IjkwMCIgZmlsbD0icmdiYSg1MSwgNTEsIDUxLCAwKSIgLz4KICAgIDxyZWN0IGlkPSJyIiB3aWR0aD0iMTkyMCIgaGVpZ2h0PSI5MDAiIGZpbGw9InVybCgjZy0xOTIwLTkwMCkiIC8+CiAgICA8YW5pbWF0ZSB4bGluazpocmVmPSIjciIgYXR0cmlidXRlTmFtZT0ieCIgZnJvbT0iLTE5MjAiIHRvPSIxOTIwIiBkdXI9IjFzIiByZXBlYXRDb3VudD0iaW5kZWZpbml0ZSIgIC8+CiAgPC9zdmc+",getBannerLink=e=>{let t=e?.link;return t?.type==="go-to-sales-page"?{type:"go-to-sales-page",link:g,target:"_self"}:t},formatHoverScale=e=>e?String(e).includes("%")?`${e}`:`${e}%`:"100%",opacityEnabledData=e=>{let{overlayColor:t,overlayOpacity:o}=e??{},l=!t?.normal||o?.normal=="0%"||!o?.normal;return{disableOpacity:l}},getOpacityHover=e=>{let{overlayOpacity:t}=e??{},o="number"!=typeof t?.hover||isNaN(t?.hover)?"string"==typeof t?.hover?`${parseInt(t?.hover)}%`:"":`${t?.hover}%`,l="number"!=typeof t?.normal||isNaN(t?.normal)?"string"==typeof t?.normal?`${parseInt(t?.normal)}%`:"0%":`${t?.normal}%`;return o||l};export{debounce,fallbackImg,formatHoverScale,getAspectRatioSettings,getAttachmentDevice,getBackgroundImageHeroBanner,getBannerLink,getBgImage,getClassAlignBanner,getClassContentPosition,getClassForContentByFitContent,getClassForStretchContent,getClassSpaceBetween,getClassSpaceBetweenLeftRight,getClipPath,getContentPosition,getDataVideoHeroBannerResponsive,getDisplayStyleByFitContent,getEnableBgImageByDevice,getOpacityHover,getPercentageVisible,getResponsiveSetting,getStyleAspectRatioHeroBannerCustom,getStyleHeroBannerBg,getVisibilityStyle,getWidth,horizontalAlign,imagePlaceholder,isScaleImage,mapContentPositionToHorizontal,opacityEnabledData,scrollToContentBanner,showVideoType};
@@ -1 +1 @@
1
- import{useRef as e,useState as t,useEffect as r}from"react";let useIconLineHeight=({iconWidth:n})=>{let i=e(null),[l,o]=t("");return r(()=>{if(i?.current){let e=window.getComputedStyle(i?.current).getPropertyValue("line-height");o(e)}},[n]),{ref:i,lineHeight:l}};export{useIconLineHeight};
1
+ import{useCurrentDevice as e}from"@gem-sdk/core";import{useRef as t,useState as r,useEffect as o}from"react";let useIconLineHeight=({iconWidth:i})=>{let n=t(null),[l,u]=r(""),c=e();return o(()=>{if(n?.current){let e=window.getComputedStyle(n?.current).getPropertyValue("line-height");u(e)}},[i,c]),{ref:n,lineHeight:l}};export{useIconLineHeight};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gem-sdk/components",
3
- "version": "2.0.0-staging.1130",
3
+ "version": "2.0.0-staging.1132",
4
4
  "license": "MIT",
5
5
  "sideEffects": false,
6
6
  "main": "dist/cjs/index.js",