@gem-sdk/components 19.1.0-staging.8 → 20.0.0
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.
- package/dist/cjs/accordion/components/Accordion.liquid.js +5 -4
- package/dist/cjs/button/components/Button.liquid.js +14 -14
- package/dist/cjs/carousel/components/root/Carousel.liquid.js +4 -5
- package/dist/cjs/carousel/components/root/common/helpers.js +1 -1
- package/dist/cjs/carousel-v3/components/root/Carousel.liquid.js +5 -6
- package/dist/cjs/carousel-v3/components/root/CarouselEmbla.liquid.js +5 -6
- package/dist/cjs/carousel-v3/components/root/common/helpers.js +1 -1
- package/dist/cjs/cart/components/shop-pay-button/ShopPayButton.liquid.js +2 -2
- package/dist/cjs/collection/components/collection-description/CollectionDescription.liquid.js +8 -7
- package/dist/cjs/collection/components/collection-paginator/CollectionPaginator.liquid.js +3 -4
- package/dist/cjs/collection/components/collection-toolbar/CollectionToolbar.liquid.js +1 -1
- package/dist/cjs/countdown-timer/components/Countdown.liquid.js +15 -16
- package/dist/cjs/form/components/form-dropdown/FormDropdown.liquid.js +10 -10
- package/dist/cjs/grid/components/row/Row.liquid.js +3 -8
- package/dist/cjs/grid/components/row/common/helpers.js +1 -1
- package/dist/cjs/hero-banner/common/helpers.js +1 -1
- package/dist/cjs/hero-banner/components/HeroBanner.liquid.js +3 -3
- package/dist/cjs/icon-list-v2/components/IconList.liquid.js +7 -7
- package/dist/cjs/image/common/const.js +1 -1
- package/dist/cjs/image/common/helpers.js +2 -2
- package/dist/cjs/image-comparison/components/CompareImage.liquid.js +6 -6
- package/dist/cjs/marquee/components/Marquee.liquid.js +21 -21
- package/dist/cjs/product/components/ProductImages.liquid.js +9 -9
- package/dist/cjs/product/components/dynamic-checkout/Button.liquid.js +9 -9
- package/dist/cjs/product/components/file-upload/UploadFile.liquid.js +3 -2
- package/dist/cjs/product/components/product-badge/ProductBadge.liquid.js +5 -5
- package/dist/cjs/product/components/product-bundle/ProductBundleDiscount.liquid.js +3 -4
- package/dist/cjs/product/components/product-button/ProductButton.liquid.js +7 -8
- package/dist/cjs/product/components/product-description/ProductDescription.liquid.js +2 -2
- package/dist/cjs/product/components/product-discount-tag/ProductDiscountTag.js +1 -1
- package/dist/cjs/product/components/product-discount-tag/ProductDiscountTag.liquid.js +5 -5
- package/dist/cjs/product/components/product-images-v2/ProductImagesV2.liquid.js +9 -9
- package/dist/cjs/product/components/product-images-v3/ProductImagesV3.liquid.js +6 -6
- package/dist/cjs/product/components/product-images-v3/ProductImagesV3Embla.liquid.js +9 -9
- package/dist/cjs/product/components/product-list/ProductListCarouselItem.liquid.js +6 -5
- package/dist/cjs/product/components/product-list/ProductListGridItem.liquid.js +8 -7
- package/dist/cjs/product/components/product-list/ProductListGridLayout.liquid.js +4 -6
- package/dist/cjs/product/components/product-list-v3/ProductListCarouselItem.liquid.js +6 -6
- package/dist/cjs/product/components/product-list-v3/ProductListGridItem.liquid.js +8 -7
- package/dist/cjs/product/components/product-list-v3/ProductListGridLayout.liquid.js +4 -6
- package/dist/cjs/product/components/product-price/ProductPrice.liquid.js +4 -4
- package/dist/cjs/product/components/product-sku/Sku.liquid.js +3 -4
- package/dist/cjs/product/components/product-title/ProductTitle.liquid.js +8 -7
- package/dist/cjs/product/components/product-variants/ProductVariants.liquid.js +29 -29
- package/dist/cjs/product/components/product-wrap/Product.liquid.js +9 -9
- package/dist/cjs/sticky/components/Sticky.liquid.js +5 -4
- package/dist/cjs/tab/components/Tabs.liquid.js +6 -7
- package/dist/cjs/text/components/Text.liquid.js +3 -3
- package/dist/cjs/third-party/settings/AppstleBundlesDiscounts/index.js +2 -2
- package/dist/cjs/third-party/settings/BoldSubscriptions/index.js +1 -1
- package/dist/cjs/third-party/settings/BoldSubscriptions/uiV2.js +1 -1
- package/dist/cjs/third-party/settings/GloColorSwatchvariantImage/index.js +1 -1
- package/dist/cjs/third-party/settings/HextomCountdownTimerBar/index.js +2 -2
- package/dist/cjs/third-party/settings/LoopSubscriptions/index.js +1 -1
- package/dist/cjs/third-party/settings/LoopSubscriptions/uiV2.js +1 -1
- package/dist/cjs/third-party/settings/RechargeSubscriptions/index.js +1 -1
- package/dist/cjs/third-party/settings/SeoantTrustBadgesIcon/uiV2.js +1 -1
- package/dist/cjs/third-party/settings/ShopifyForms/uiV2.js +1 -1
- package/dist/cjs/third-party/settings/SkioSubscriptionsYcS20/index.js +2 -2
- package/dist/cjs/third-party/settings/SproutPlantTreesGrowSales/index.js +1 -1
- package/dist/cjs/third-party/settings/TrustshopProductReviews/index.js +2 -2
- package/dist/cjs/third-party/settings/WcWishlistBackInStock/index.js +2 -2
- package/dist/cjs/video/components/LiteVimeoEmbed.liquid.js +7 -8
- package/dist/cjs/video/components/LiteYouTubeEmbed.liquid.js +4 -5
- package/dist/esm/accordion/components/Accordion.liquid.js +9 -8
- package/dist/esm/button/components/Button.liquid.js +23 -23
- package/dist/esm/carousel/components/root/Carousel.liquid.js +3 -4
- package/dist/esm/carousel/components/root/common/helpers.js +1 -1
- package/dist/esm/carousel-v3/components/root/Carousel.liquid.js +3 -4
- package/dist/esm/carousel-v3/components/root/CarouselEmbla.liquid.js +3 -4
- package/dist/esm/carousel-v3/components/root/common/helpers.js +1 -1
- package/dist/esm/cart/components/shop-pay-button/ShopPayButton.liquid.js +2 -2
- package/dist/esm/collection/components/collection-description/CollectionDescription.liquid.js +7 -6
- package/dist/esm/collection/components/collection-paginator/CollectionPaginator.liquid.js +3 -4
- package/dist/esm/collection/components/collection-toolbar/CollectionToolbar.liquid.js +3 -3
- package/dist/esm/countdown-timer/components/Countdown.liquid.js +20 -21
- package/dist/esm/form/components/form-dropdown/FormDropdown.liquid.js +9 -9
- package/dist/esm/grid/components/row/Row.liquid.js +3 -8
- package/dist/esm/grid/components/row/common/helpers.js +1 -1
- package/dist/esm/hero-banner/common/helpers.js +1 -1
- package/dist/esm/hero-banner/components/HeroBanner.liquid.js +5 -5
- package/dist/esm/icon-list-v2/components/IconList.liquid.js +7 -7
- package/dist/esm/image/common/const.js +1 -1
- package/dist/esm/image/common/helpers.js +2 -2
- package/dist/esm/image-comparison/components/CompareImage.liquid.js +7 -7
- package/dist/esm/marquee/components/Marquee.liquid.js +21 -21
- package/dist/esm/product/components/ProductImages.liquid.js +12 -12
- package/dist/esm/product/components/dynamic-checkout/Button.liquid.js +14 -14
- package/dist/esm/product/components/file-upload/UploadFile.liquid.js +4 -3
- package/dist/esm/product/components/product-badge/ProductBadge.liquid.js +6 -6
- package/dist/esm/product/components/product-bundle/ProductBundleDiscount.liquid.js +7 -8
- package/dist/esm/product/components/product-button/ProductButton.liquid.js +6 -7
- package/dist/esm/product/components/product-description/ProductDescription.liquid.js +4 -4
- package/dist/esm/product/components/product-discount-tag/ProductDiscountTag.js +1 -1
- package/dist/esm/product/components/product-discount-tag/ProductDiscountTag.liquid.js +8 -8
- package/dist/esm/product/components/product-images-v2/ProductImagesV2.liquid.js +12 -12
- package/dist/esm/product/components/product-images-v3/ProductImagesV3.liquid.js +12 -12
- package/dist/esm/product/components/product-images-v3/ProductImagesV3Embla.liquid.js +14 -14
- package/dist/esm/product/components/product-list/ProductListCarouselItem.liquid.js +6 -5
- package/dist/esm/product/components/product-list/ProductListGridItem.liquid.js +8 -7
- package/dist/esm/product/components/product-list/ProductListGridLayout.liquid.js +7 -9
- package/dist/esm/product/components/product-list-v3/ProductListCarouselItem.liquid.js +6 -6
- package/dist/esm/product/components/product-list-v3/ProductListGridItem.liquid.js +8 -7
- package/dist/esm/product/components/product-list-v3/ProductListGridLayout.liquid.js +7 -9
- package/dist/esm/product/components/product-price/ProductPrice.liquid.js +3 -3
- package/dist/esm/product/components/product-sku/Sku.liquid.js +5 -6
- package/dist/esm/product/components/product-title/ProductTitle.liquid.js +6 -5
- package/dist/esm/product/components/product-variants/ProductVariants.liquid.js +44 -44
- package/dist/esm/product/components/product-wrap/Product.liquid.js +6 -6
- package/dist/esm/sticky/components/Sticky.liquid.js +12 -11
- package/dist/esm/tab/components/Tabs.liquid.js +11 -12
- package/dist/esm/text/components/Text.liquid.js +3 -3
- package/dist/esm/third-party/settings/AppstleBundlesDiscounts/index.js +2 -2
- package/dist/esm/third-party/settings/BoldSubscriptions/index.js +1 -1
- package/dist/esm/third-party/settings/BoldSubscriptions/uiV2.js +1 -1
- package/dist/esm/third-party/settings/GloColorSwatchvariantImage/index.js +1 -1
- package/dist/esm/third-party/settings/HextomCountdownTimerBar/index.js +2 -2
- package/dist/esm/third-party/settings/LoopSubscriptions/index.js +1 -1
- package/dist/esm/third-party/settings/LoopSubscriptions/uiV2.js +1 -1
- package/dist/esm/third-party/settings/RechargeSubscriptions/index.js +1 -1
- package/dist/esm/third-party/settings/SeoantTrustBadgesIcon/uiV2.js +1 -1
- package/dist/esm/third-party/settings/ShopifyForms/uiV2.js +1 -1
- package/dist/esm/third-party/settings/SkioSubscriptionsYcS20/index.js +2 -2
- package/dist/esm/third-party/settings/SproutPlantTreesGrowSales/index.js +1 -1
- package/dist/esm/third-party/settings/TrustshopProductReviews/index.js +2 -2
- package/dist/esm/third-party/settings/WcWishlistBackInStock/index.js +2 -2
- package/dist/esm/video/components/LiteVimeoEmbed.liquid.js +3 -4
- package/dist/esm/video/components/LiteYouTubeEmbed.liquid.js +4 -5
- package/package.json +3 -3
|
@@ -1,10 +1,5 @@
|
|
|
1
|
-
import{template as e,WrapRenderChildren as o,RenderChildren as s,RenderIf as r,hasTranslatedLiquid as t,isLocalEnv as i,baseAssetURL as a}from"@gem-sdk/core";import{getBackgroundTranslated as l,getSettingPreloadData as p}from"../../../helpers.js";import m from"../../../video/components/HTML5Embed.liquid.js";import{createClass as d,If as n}from"@gem-sdk/system";import{getYoutubeVideoId as c}from"../../../video/common/helpers.js";import g from"../../../video/components/LiteYouTubeEmbed.liquid.js";import{getAttr as u}from"./common/attrs.js";import{Row as f}from"../../settings/configs/row/translate.js";import{getClass as $}from"./common/classes.js";import{getRowStyle as y}from"./common/styles.js";import{getData as
|
|
2
|
-
<gp-row
|
|
3
|
-
${{..._}}
|
|
4
|
-
class="${U}"
|
|
5
|
-
style="${z()}"
|
|
6
|
-
>
|
|
7
|
-
<script gp-data type="application/json">${V}</script>
|
|
1
|
+
import{template as e,WrapRenderChildren as o,RenderChildren as s,RenderIf as r,hasTranslatedLiquid as t,isLocalEnv as i,baseAssetURL as a}from"@gem-sdk/core";import{getBackgroundTranslated as l,getSettingPreloadData as p}from"../../../helpers.js";import m from"../../../video/components/HTML5Embed.liquid.js";import{createClass as d,If as n}from"@gem-sdk/system";import{getYoutubeVideoId as c}from"../../../video/common/helpers.js";import g from"../../../video/components/LiteYouTubeEmbed.liquid.js";import{getAttr as u}from"./common/attrs.js";import{Row as f}from"../../settings/configs/row/translate.js";import{getClass as $}from"./common/classes.js";import{getRowStyle as y}from"./common/styles.js";import{getData as k,checkHasBackgroundVideo as j,isRenderHtmlVideo as v,isRenderYoutubeVideo as b}from"./common/helpers.js";import{getResponsiveSetting as w}from"../../../hero-banner/common/helpers.js";let h=h=>{let{styles:C,setting:x,rawChildren:E,builderProps:S}=h,{isSection:q}=x??{},{background:L}=C??{},P=q?"section":"div",T=l({background:L,uid:S?.uid,enableTranslate:!!f?.background?.id,pageContext:h.pageContext??{}}),{stateData:V}=k(h,T),{rowStyle:z,backgroundBoxStyle:A,embedVideoStyle:N,sectionStyle:R}=y({rowProps:h,type:"Liquid",translatedBackground:T}),{rowAttr:_}=u(h),{rowClass:G,backgroundBoxClass:I,backgroundBoxInnerClass:M,sectionClass:O,wrapperYoutubeClasses:B,iframeYoutubeClasses:H}=$(h),U=d({[G]:!0}),Y=()=>{if(!j(L))return;let e=w(L||{});if(v(L))return m({uid:S?.uid,muted:!0,loop:e.desktop?.loop,controls:!1,autoplay:!0,src:"",title:"Video",className:"gp-relative",style:N,pageContext:h.pageContext});if(b(L)){let o=e?.desktop?.video??"",s=c(o)||"",r=t(o),i=`&loop=false&playlist=${s}&showinfo=0&rel=0&fs=0&enablejsapi=1`;return g({uid:S?.uid,id:s,autoplay:!0,title:"Video",translatedVideoUrl:r?o:"",controls:!1,params:i,adNetwork:!1,noCookie:!0,muted:!0,lazy:e?.desktop?.lazyLoad??!0,style:N,wrapperClass:B,iframeClass:H,pageContext:h.pageContext})}},D=e`
|
|
2
|
+
<gp-row gp-data='${V}' ${{..._}} class="${U}" style="${z()}">
|
|
8
3
|
${n(!!Y(),e`
|
|
9
4
|
<div class="${I}" style="${A}">
|
|
10
5
|
<div class="${M}">${Y()}</div>
|
|
@@ -13,7 +8,7 @@ import{template as e,WrapRenderChildren as o,RenderChildren as s,RenderIf as r,h
|
|
|
13
8
|
|
|
14
9
|
${o({uid:S?.uid||"",customProps:E?.[0].customProps},E?.map(e=>{if(e)return s({...e,order:x?.order,layout:x?.layout,justifyContent:x?.verticalAlign})}))}
|
|
15
10
|
|
|
16
|
-
${(()=>{if(
|
|
11
|
+
${(()=>{if(j(L))return e`
|
|
17
12
|
${r(i,`<script ${p('class="gps-link" delay',"src")}="{{ 'gp-row-v7-5.js' | asset_url }}" defer="defer"></script>`,`<script ${p('class="gps-link" delay',"src")}="${a}/assets-v2/gp-row-v7-5.js?v={{ shop.metafields.GEMPAGES.ASSETS_VERSION }}" defer="defer"></script>`)}
|
|
18
13
|
`})()}
|
|
19
14
|
</gp-row>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{DEVICES as
|
|
1
|
+
import{DEVICES as e,getValueByDevice as t,dataStringify as r}from"@gem-sdk/core";import{createStateOrContext as p}from"@gem-sdk/system";let d=e=>{let t=e.desktop,r=e.tablet?e.tablet:t,p=e.mobile?e.mobile:r;return{desktop:t,tablet:r,mobile:p}},a={desktop:"1200px",tablet:"100%",mobile:"100%"},o=(e,t)=>t?.[e]==="100%"?{contentWidth:"100%",wrapperWidth:"100%",wrapperPadding:"var(--g-ct-p)"}:t?.[e]==="default"?{contentWidth:`var(--g-ct-w, ${a[e]})`,wrapperWidth:`calc(var(--g-ct-w, ${a[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, ${a[e]}) + 2 * var(--g-ct-p, 15px))`,wrapperPadding:"var(--g-ct-p, 15px)"},i=e=>{let t=o("desktop",e),r=o("tablet",e),p=o("mobile",e);return{content:{desktop:t.contentWidth,tablet:r.contentWidth,mobile:p.contentWidth},wrapper:{desktop:t.wrapperWidth,tablet:r.wrapperWidth,mobile:p.wrapperWidth},padding:{desktop:t.wrapperPadding,tablet:r.wrapperPadding,mobile:p.wrapperPadding}}},l=(e,t)=>{let{builderProps:d}=e,a=p({background:t,uid:d?.uid});return{stateData:r(a).replaceAll("'","'")}};function n(e,t){if(!e||!t)return{};let r={};return["normal","hover","active"].forEach(p=>{let d=e?.[p],a=t?.[p];d&&a&&(r[p]=function(e,t){if(!e||!t)return{};let r=("string"==typeof e?e.split(" "):[]).map(e=>parseInt(e,10)||0),p=Object.fromEntries(["btrr","bblr","bbrr","btlr"].map((e,p)=>[e,Math.max(0,(parseInt(t[e]??"0",10)||0)-(r[p]||0))+"px"]));return{...p,radiusType:t.radiusType}}(d.width,a))}),r}function b(e,t){return{desktop:n(e?.desktop,t?.desktop),tablet:n(e?.tablet??e?.desktop,t?.tablet??t?.desktop),mobile:n(e?.mobile??e?.tablet??e?.desktop,t?.mobile??t?.tablet??t?.desktop)}}let c=r=>e.some(e=>{let p=t(r,e);return!!p&&(p?.videoType==="html5"&&p?.videoHtml5||p?.videoType==="youtube"&&p?.video)}),u=e=>{let t=d(e||{}),r=t.desktop?.videoType,p=t.tablet?.videoType,a=t.mobile?.videoType;return"html5"==r||"html5"==p||"html5"==a},s=e=>{let t=d(e||{}),r=t.desktop?.videoType,p=t.tablet?.videoType,a=t.mobile?.videoType;return"youtube"==r||"youtube"==p||"youtube"==a};export{c as checkHasBackgroundVideo,i as createStyleObject,l as getData,b as getInnerRadiusExcludeBorder,u as isRenderHtmlVideo,s as isRenderYoutubeVideo};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{DEVICES as e,makeStyleResponsive as t,getValueByDevice as o,getAspectRatioGlobalSize as l,getResponsiveValueByScreen as i,cls as r,GRADIENT_BGR_KEY as a}from"@gem-sdk/core";import{getImageSrc as n,createBlurDataURL as s}from"../../image/common/helpers.js";import{HREF_TO_SALES_PAGE as p}from"../../constant.js";import{DEFAULT_CLIP_PATH as b,VIDEO_IFRAME_SCALE as g}from"./const.js";let d=(t,o,l)=>{let r={};return e.map(e=>{let a=i(t,e),n=i(o,e),s=i(l,e);r={...r,[e]:1>=(a?.cols?.length||1)?n:s}}),r},c=(e,t)=>{if(!i(m(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"},m=e=>{if(!e)return{};let t={desktop:e?.desktop?.image,tablet:e?.tablet?.image,mobile:e?.mobile?.image};return t},u=e=>{let t=m(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)}},h=(e,t,o,l)=>{if(!e)return"";let r=m(e),s=i(e,t),p=o?`url(${u(e)[t]})`:`url(${n(i(r,t),t,l)})`,b=s?.color?`, ${s.color}`:"";return s?.color?.includes(a)&&s?.type==="image"?`${p}${b}`:s?.color?.includes(a)&&s?.type!=="image"?`${s.color}`:s?.type==="image"?p:"url()"},y=(o,l=!1,i=!1)=>{if(!o)return;let r={};return e.forEach(e=>{r={...r,[e]:h(o,e,l,i)}}),t("bgi",r)},f=e=>{let t={};return["desktop","mobile","tablet"].forEach(o=>{let l=e?.[o]?.attachment;t={...t,[o]:"fixed"===l?"fixed":"absolute"}}),t},I=(e,t,o)=>S(d(e,t,o)),v=e=>e?.target?.closest("div.gp-hero-banner-row")?.scrollTo(0,0),k=(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}}},w=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]}),{}):{},C=(e,t)=>{if(!e)return t;let o=e?.shapeVideo;return"custom"===o?e?.shapeValue||t:void 0!==o?o:e?.shapeValue??t},A=({shapeByDevice:e,fallbackRatio:t,device:o,currentResult:l})=>{let i=C(e,t);return i?{...l,[o]:i}:l},j=(e,o)=>{let r=l(o);return["desktop","mobile","tablet"].forEach(t=>{let l=i(o,t),a=!!k(t,e);a&&(r=A({shapeByDevice:l,fallbackRatio:"auto",device:t,currentResult:r}))}),t("aspect",r)},S=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},Z=(e,o)=>{let l={desktop:"none",tablet:"none",mobile:"none"};return["desktop","mobile","tablet"].forEach(t=>{let r=i(e,t),a=!!k(t,o),n=r?.shape,s=r?.height;l={...l,[t]:"original"!==n||"fit-content"===s||a?"none":"block"}}),t("d",l)},B=(e,t)=>{if(!e)return;if(!t)return e.shapeValue;let o=e.shapeVideo;return"custom"===o?e.shapeValue:o},P=(t,o)=>{let l=!1,r=e.reduce((e,r)=>{let a=i(t,r),n=i(o,r),s=B(a,n?.type==="video");return s&&(e[r]=s,l=!0),e},{});return{aspectRatio:l?r:void 0}},x=(t,l,i)=>e.reduce((e,r)=>{let a=o(t,r),n=a?.type==="video"?a?.videoType:void 0,s=o(l,r),p=i?.[r];return p&&"youtube"===n&&"cover"!==s&&(e[r]=p),e},{}),$=(e,t)=>{let{aspectRatio:o}=P(e,t);return o},D=(e,t,o)=>{let l=x(e,t,o);return Object.keys(l).length?l:void 0},R=e=>{let t={};return["desktop","mobile","tablet"].forEach(o=>{let l=e?.[o];l&&(t={...t,[o]:"default"===l?"var(--g-ct-w, 1200px)":l})}),t},T=(e,t)=>{let{top:o,height:l}=e,i=-l;return o<i?0:o>t?100:Math.min(Math.max((o-i)/(t-i)*100,0),100)},V=({enableParallax:e=!1,attachment:t="scroll"})=>!!e||"fixed"===t,z=(e,o)=>{let l={};return["desktop","mobile","tablet"].forEach(t=>{let r=i(e,t),a=r?.type==="image"&&o,n=V({enableParallax:a,attachment:e[t]?.attachment});l={...l,[t]:a?"150%":n?"100vh":"100%"}}),t("h",l)},M=(e,o)=>{let l={};return["desktop","mobile","tablet"].forEach(t=>{let r=i(e,t),a=r?.type==="image"&&o,n=V({enableParallax:a,attachment:e[t]?.attachment});l={...l,[t]:n?"100vw":"100%"}}),t("w",l)},W=e=>{let o={};return["desktop","mobile","tablet"].forEach(t=>{o={...o,[t]:e[t]?.attachment==="fixed"?"0px":""}}),t("top",o)},E=(e,t)=>{let o=z(e,t),l=M(e,t),i=W(e);return{...o,...l,...i}},G=(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 r=e-i;return r>0?r:0},L=(e,t)=>{if(!t)return`${b}`;let[o,l,i,r]=(e??"0 0 0 0").split(" ").map(e=>parseInt(e??"0")||0),{btlr:a,btrr:n,bbrr:s,bblr:p}=t,g=G(parseInt(a??"0")||0,o,r),d=G(parseInt(n??"0")||0,o,l),c=G(parseInt(s??"0")||0,l,i),m=G(parseInt(p??"0")||0,i,r);return[g,d,c,m].every(e=>0===e)?`${b}`:`inset(0 0 0 round ${g}px ${d}px ${c}px ${m}px)`},H=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}),N=({device:e,settingLayoutRes:t,contentPosition1ColRes:o})=>{let l=t[e]?.cols??[],i=l.length<=1,r=o[e];if(i&&r)return["space-between","top","center","bottom"].includes(r)?r:void 0},J=(t,o)=>{let l=Y(t),i=Y(o),r={desktop:N({device:"desktop",settingLayoutRes:l,contentPosition1ColRes:i}),tablet:N({device:"tablet",settingLayoutRes:l,contentPosition1ColRes:i}),mobile:N({device:"mobile",settingLayoutRes:l,contentPosition1ColRes:i})},a={"space-between":{desktop:"!gp-h-full !gp-content-stretch [&>*]:!gp-justify-between [&>*:nth-child(3)]:gp-absolute [&>*:nth-child(3)]:gp-hidden",tablet:"tablet:!gp-h-full tablet:!gp-content-stretch tablet:[&>*]:!gp-justify-between tablet:[&>*:nth-child(3)]:gp-absolute tablet:[&>*:nth-child(3)]:gp-hidden",mobile:"mobile:!gp-h-full mobile:!gp-content-stretch mobile:[&>*]:!gp-justify-between mobile:[&>*:nth-child(3)]:gp-absolute mobile:[&>*:nth-child(3)]: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"}},n={};return e.forEach(e=>{let t=r[e],o=a?.[t]?.[e];n[o]=!0}),n},K=e=>{let t=Y(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}},O=e=>{let t={desktop:"none",tablet:"none",mobile:"none"};return["desktop","mobile","tablet"].forEach(o=>{let l=i(e,o);t={...t,[o]:l}}),r("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}`)},X=(e,t)=>{let o={desktop:!1,tablet:!1,mobile:!1};return["desktop","mobile","tablet"].forEach(l=>{let r=i(e,l),a=!!k(l,t),n=r?.shape,s=r?.height;o={...o,[l]:"original"===n&&"fit-content"!==s&&!a}}),r(o.desktop?"!gp-absolute":"",o.tablet?"tablet:!gp-absolute":"tablet:!gp-relative",o.mobile?"mobile:!gp-absolute":"mobile:!gp-relative")},F=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]}`]:!0,[`tablet:gp-justify-${t[l]}`]:!0,[`mobile:gp-justify-${t[i]}`]:!0}},Y=e=>{let t=e.desktop,o=e.tablet?e.tablet:t,l=e.mobile?e.mobile:o;return{desktop:t,tablet:o,mobile:l}},U=t=>e.some(e=>{let l=o(t,e);return l?.type!=="color"&&l?.type!=="image"&&!!l&&(l?.videoType==="html5"&&l?.videoHtml5||l?.videoType==="youtube"&&l?.video)});function Q(e,t){let o;return function(...l){clearTimeout(o),o=setTimeout(()=>e.apply(this,l),t)}}let _="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTkyMCIgaGVpZ2h0PSI5MDAiIHZlcnNpb249IjEuMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayI+CiAgICA8ZGVmcz4KICAgICAgPGxpbmVhckdyYWRpZW50IGlkPSJnLTE5MjAtOTAwIj4KICAgICAgICA8c3RvcCBzdG9wLWNvbG9yPSJyZ2JhKDUxLCA1MSwgNTEsIDApIiBvZmZzZXQ9IjIwJSIgLz4KICAgICAgICA8c3RvcCBzdG9wLWNvbG9yPSJyZ2JhKDUxLCA1MSwgNTEsIDApIiBvZmZzZXQ9IjUwJSIgLz4KICAgICAgICA8c3RvcCBzdG9wLWNvbG9yPSJyZ2JhKDUxLCA1MSwgNTEsIDApIiBvZmZzZXQ9IjcwJSIgLz4KICAgICAgPC9saW5lYXJHcmFkaWVudD4KICAgIDwvZGVmcz4KICAgIDxyZWN0IHdpZHRoPSIxOTIwIiBoZWlnaHQ9IjkwMCIgZmlsbD0icmdiYSg1MSwgNTEsIDUxLCAwKSIgLz4KICAgIDxyZWN0IGlkPSJyIiB3aWR0aD0iMTkyMCIgaGVpZ2h0PSI5MDAiIGZpbGw9InVybCgjZy0xOTIwLTkwMCkiIC8+CiAgICA8YW5pbWF0ZSB4bGluazpocmVmPSIjciIgYXR0cmlidXRlTmFtZT0ieCIgZnJvbT0iLTE5MjAiIHRvPSIxOTIwIiBkdXI9IjFzIiByZXBlYXRDb3VudD0iaW5kZWZpbml0ZSIgIC8+CiAgPC9zdmc+",q=e=>{let t=e?.link;return t?.type==="go-to-sales-page"?{type:"go-to-sales-page",link:p,target:"_self"}:t},ee=e=>e?String(e).includes("%")?`${e}`:`${e}%`:"100%",et=e=>{let{overlayColor:t,overlayOpacity:o}=e??{},l=!t?.normal||o?.normal=="0%"||!o?.normal;return{disableOpacity:l}},eo=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},el=(e,t)=>{if(!e||!t)return 16/9;let o=i(e,t),l=o?.videoCustomRatio;if(l?.width&&l?.height){let e=Number(l.width),t=Number(l.height);if(e>0&&t>0)return e/t}return 16/9},ei=e=>{e&&(e.style.removeProperty("width"),e.style.removeProperty("height"),e.style.removeProperty("top"),e.style.removeProperty("left"),e.style.removeProperty("transform"),e.style.removeProperty("position"))},er=e=>{Object.assign(e.style,{position:"absolute",top:"0",left:"0",width:"100%",height:"100%"})},ea=e=>{e.style.removeProperty("position"),e.style.removeProperty("top"),e.style.removeProperty("left"),e.style.removeProperty("width"),e.style.removeProperty("height")},en=e=>{if(!e)return 0;let{width:t,height:o}=e.getBoundingClientRect();return t&&o?t/o:0},es=e=>{switch(e){case"top":default:return{top:"0%",transform:`translate(-50%, 0%) scale(${g})`};case"bottom":return{top:"100%",transform:`translate(-50%, -100%) scale(${g})`};case"center":return{top:"50%",transform:`translate(-50%, -50%) scale(${g})`}}},ep=(e,t)=>{if(!e)return;let o=es(t);e.style.top=o.top,e.style.transform=o.transform},eb=({iframeEl:e,containerRatio:t,videoObjectFit:o,background:l,currentDevice:r,isYoutubeVideoMigrated:a})=>{let n,s;let p=el(l,r),b=i(l,r);if(!e||!t)return;let d=b?.videoAlign||"top",c=es(d);if("contain"===o){Object.assign(e.style,{position:"absolute",top:"50%",left:"50%",width:"100%",height:"100%",maxWidth:"none",transform:`translate(-50%, -50%) scale(${g})`});return}t>=p?(n=100,s=t/p*100):(s=100,n=p/t*100),Object.assign(e.style,{position:"absolute",top:c.top,left:"50%",width:a?"500%":`${n}%`,height:a?"100%":`${s}%`,maxWidth:"none",transform:c.transform})};export{P as collectAspectRatioByDevice,x as collectYoutubeAspectRatio,Q as debounce,_ as fallbackImg,ee as formatHoverScale,$ as getAspectRatio,f as getAttachmentDevice,y as getBackgroundImageHeroBanner,q as getBannerLink,m as getBgImage,H as getClassAlignBanner,F as getClassContentPosition,X as getClassForContentByFitContent,O as getClassForStretchContent,J as getClassSpaceBetween,K as getClassSpaceBetweenLeftRight,L as getClipPath,en as getContainerRatio,d as getContentPosition,k as getDataVideoHeroBannerResponsive,Z as getDisplayStyleByFitContent,c as getEnableBgImageByDevice,eo as getOpacityHover,T as getPercentageVisible,Y as getResponsiveSetting,j as getStyleAspectRatioHeroBannerCustom,E as getStyleHeroBannerBg,el as getVideoAspectRatio,w as getVisibilityStyle,R as getWidth,D as getYoutubeAspectRatio,I as horizontalAlign,u as imagePlaceholder,V as isScaleImage,S as mapContentPositionToHorizontal,et as opacityEnabledData,ei as resetVideoIframeStyle,ea as resetVideoWrapperStyle,v as scrollToContentBanner,ep as setVideoIframeAlign,er as setVideoWrapperStyle,U as showVideoType,eb as updateVideoIframeSize};
|
|
1
|
+
import{DEVICES as e,makeStyleResponsive as t,getValueByDevice as o,getAspectRatioGlobalSize as l,getResponsiveValueByScreen as i,cls as r,GRADIENT_BGR_KEY as a}from"@gem-sdk/core";import{getImageSrc as n,createBlurDataURL as s}from"../../image/common/helpers.js";import{HREF_TO_SALES_PAGE as p}from"../../constant.js";import{DEFAULT_CLIP_PATH as b,VIDEO_IFRAME_SCALE as g}from"./const.js";let d=(t,o,l)=>{let r={};return e.map(e=>{let a=i(t,e),n=i(o,e),s=i(l,e);r={...r,[e]:1>=(a?.cols?.length||1)?n:s}}),r},c=(e,t)=>{if(!i(m(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"},m=e=>{if(!e)return{};let t={desktop:e?.desktop?.image,tablet:e?.tablet?.image,mobile:e?.mobile?.image};return t},u=e=>{let t=m(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)}},h=(e,t,o,l)=>{if(!e)return"";let r=m(e),s=i(e,t),p=o?`url(${u(e)[t]})`:`url(${n(i(r,t),t,l)})`,b=s?.color?`, ${s.color}`:"";return s?.color?.includes(a)&&s?.type==="image"?`${p}${b}`:s?.color?.includes(a)&&s?.type!=="image"?`${s.color}`:s?.type==="image"?p:"url()"},y=(o,l=!1,i=!1)=>{if(!o)return;let r={};return e.forEach(e=>{r={...r,[e]:h(o,e,l,i)}}),t("bgi",r)},f=e=>{let t={};return["desktop","mobile","tablet"].forEach(o=>{let l=e?.[o]?.attachment;t={...t,[o]:"fixed"===l?"fixed":"absolute"}}),t},I=(e,t,o)=>S(d(e,t,o)),v=e=>e?.target?.closest("div.gp-hero-banner-row")?.scrollTo(0,0),k=(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}}},w=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]}),{}):{},C=(e,t)=>{if(!e)return t;let o=e?.shapeVideo;return"custom"===o?e?.shapeValue||t:void 0!==o?o:e?.shapeValue??t},A=({shapeByDevice:e,fallbackRatio:t,device:o,currentResult:l})=>{let i=C(e,t);return i?{...l,[o]:i}:l},j=(e,o)=>{let r=l(o);return["desktop","mobile","tablet"].forEach(t=>{let l=i(o,t),a=!!k(t,e);a&&(r=A({shapeByDevice:l,fallbackRatio:"auto",device:t,currentResult:r}))}),t("aspect",r)},S=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},Z=(e,o)=>{let l={desktop:"none",tablet:"none",mobile:"none"};return["desktop","mobile","tablet"].forEach(t=>{let r=i(e,t),a=!!k(t,o),n=r?.shape,s=r?.height;l={...l,[t]:"original"!==n||"fit-content"===s||a?"none":"block"}}),t("d",l)},B=(e,t)=>{if(!e)return;if(!t)return e.shapeValue;let o=e.shapeVideo;return"custom"===o?e.shapeValue:o},P=(t,o)=>{let l=!1,r=e.reduce((e,r)=>{let a=i(t,r),n=i(o,r),s=B(a,n?.type==="video");return s&&(e[r]=s,l=!0),e},{});return{aspectRatio:l?r:void 0}},x=(t,l,i)=>e.reduce((e,r)=>{let a=o(t,r),n=a?.type==="video"?a?.videoType:void 0,s=o(l,r),p=i?.[r];return p&&"youtube"===n&&"cover"!==s&&(e[r]=p),e},{}),$=(e,t)=>{let{aspectRatio:o}=P(e,t);return o},D=(e,t,o)=>{let l=x(e,t,o);return Object.keys(l).length?l:void 0},R=e=>{let t={};return["desktop","mobile","tablet"].forEach(o=>{let l=e?.[o];l&&(t={...t,[o]:"default"===l?"var(--g-ct-w, 1200px)":l})}),t},T=(e,t)=>{let{top:o,height:l}=e,i=-l;return o<i?0:o>t?100:Math.min(Math.max((o-i)/(t-i)*100,0),100)},V=({enableParallax:e=!1,attachment:t="scroll"})=>!!e||"fixed"===t,z=(e,o)=>{let l={};return["desktop","mobile","tablet"].forEach(t=>{let r=i(e,t),a=r?.type==="image"&&o,n=V({enableParallax:a,attachment:e[t]?.attachment});l={...l,[t]:a?"150%":n?"100vh":"100%"}}),t("h",l)},M=(e,o)=>{let l={};return["desktop","mobile","tablet"].forEach(t=>{let r=i(e,t),a=r?.type==="image"&&o,n=V({enableParallax:a,attachment:e[t]?.attachment});l={...l,[t]:n?"100vw":"100%"}}),t("w",l)},W=e=>{let o={};return["desktop","mobile","tablet"].forEach(t=>{o={...o,[t]:e[t]?.attachment==="fixed"?"0px":""}}),t("top",o)},E=(e,t)=>{let o=z(e,t),l=M(e,t),i=W(e);return{...o,...l,...i}},G=(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 r=e-i;return r>0?r:0},L=(e,t)=>{if(!t)return`${b}`;let[o,l,i,r]=(e??"0 0 0 0").split(" ").map(e=>parseInt(e??"0")||0),{btlr:a,btrr:n,bbrr:s,bblr:p}=t,g=G(parseInt(a??"0")||0,o,r),d=G(parseInt(n??"0")||0,o,l),c=G(parseInt(s??"0")||0,l,i),m=G(parseInt(p??"0")||0,i,r);return[g,d,c,m].every(e=>0===e)?`${b}`:`inset(0 0 0 round ${g}px ${d}px ${c}px ${m}px)`},H=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}),N=({device:e,settingLayoutRes:t,contentPosition1ColRes:o})=>{let l=t[e]?.cols??[],i=l.length<=1,r=o[e];if(i&&r)return["space-between","top","center","bottom"].includes(r)?r:void 0},J=(t,o)=>{let l=Y(t),i=Y(o),r={desktop:N({device:"desktop",settingLayoutRes:l,contentPosition1ColRes:i}),tablet:N({device:"tablet",settingLayoutRes:l,contentPosition1ColRes:i}),mobile:N({device:"mobile",settingLayoutRes:l,contentPosition1ColRes:i})},a={"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"}},n={};return e.forEach(e=>{let t=r[e],o=a?.[t]?.[e];n[o]=!0}),n},K=e=>{let t=Y(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}},O=e=>{let t={desktop:"none",tablet:"none",mobile:"none"};return["desktop","mobile","tablet"].forEach(o=>{let l=i(e,o);t={...t,[o]:l}}),r("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}`)},X=(e,t)=>{let o={desktop:!1,tablet:!1,mobile:!1};return["desktop","mobile","tablet"].forEach(l=>{let r=i(e,l),a=!!k(l,t),n=r?.shape,s=r?.height;o={...o,[l]:"original"===n&&"fit-content"!==s&&!a}}),r(o.desktop?"!gp-absolute":"",o.tablet?"tablet:!gp-absolute":"tablet:!gp-relative",o.mobile?"mobile:!gp-absolute":"mobile:!gp-relative")},F=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]}`]:!0,[`tablet:gp-justify-${t[l]}`]:!0,[`mobile:gp-justify-${t[i]}`]:!0}},Y=e=>{let t=e.desktop,o=e.tablet?e.tablet:t,l=e.mobile?e.mobile:o;return{desktop:t,tablet:o,mobile:l}},U=t=>e.some(e=>{let l=o(t,e);return l?.type!=="color"&&l?.type!=="image"&&!!l&&(l?.videoType==="html5"&&l?.videoHtml5||l?.videoType==="youtube"&&l?.video)});function Q(e,t){let o;return function(...l){clearTimeout(o),o=setTimeout(()=>e.apply(this,l),t)}}let _="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTkyMCIgaGVpZ2h0PSI5MDAiIHZlcnNpb249IjEuMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayI+CiAgICA8ZGVmcz4KICAgICAgPGxpbmVhckdyYWRpZW50IGlkPSJnLTE5MjAtOTAwIj4KICAgICAgICA8c3RvcCBzdG9wLWNvbG9yPSJyZ2JhKDUxLCA1MSwgNTEsIDApIiBvZmZzZXQ9IjIwJSIgLz4KICAgICAgICA8c3RvcCBzdG9wLWNvbG9yPSJyZ2JhKDUxLCA1MSwgNTEsIDApIiBvZmZzZXQ9IjUwJSIgLz4KICAgICAgICA8c3RvcCBzdG9wLWNvbG9yPSJyZ2JhKDUxLCA1MSwgNTEsIDApIiBvZmZzZXQ9IjcwJSIgLz4KICAgICAgPC9saW5lYXJHcmFkaWVudD4KICAgIDwvZGVmcz4KICAgIDxyZWN0IHdpZHRoPSIxOTIwIiBoZWlnaHQ9IjkwMCIgZmlsbD0icmdiYSg1MSwgNTEsIDUxLCAwKSIgLz4KICAgIDxyZWN0IGlkPSJyIiB3aWR0aD0iMTkyMCIgaGVpZ2h0PSI5MDAiIGZpbGw9InVybCgjZy0xOTIwLTkwMCkiIC8+CiAgICA8YW5pbWF0ZSB4bGluazpocmVmPSIjciIgYXR0cmlidXRlTmFtZT0ieCIgZnJvbT0iLTE5MjAiIHRvPSIxOTIwIiBkdXI9IjFzIiByZXBlYXRDb3VudD0iaW5kZWZpbml0ZSIgIC8+CiAgPC9zdmc+",q=e=>{let t=e?.link;return t?.type==="go-to-sales-page"?{type:"go-to-sales-page",link:p,target:"_self"}:t},ee=e=>e?String(e).includes("%")?`${e}`:`${e}%`:"100%",et=e=>{let{overlayColor:t,overlayOpacity:o}=e??{},l=!t?.normal||o?.normal=="0%"||!o?.normal;return{disableOpacity:l}},eo=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},el=(e,t)=>{if(!e||!t)return 16/9;let o=i(e,t),l=o?.videoCustomRatio;if(l?.width&&l?.height){let e=Number(l.width),t=Number(l.height);if(e>0&&t>0)return e/t}return 16/9},ei=e=>{e&&(e.style.removeProperty("width"),e.style.removeProperty("height"),e.style.removeProperty("top"),e.style.removeProperty("left"),e.style.removeProperty("transform"),e.style.removeProperty("position"))},er=e=>{Object.assign(e.style,{position:"absolute",top:"0",left:"0",width:"100%",height:"100%"})},ea=e=>{e.style.removeProperty("position"),e.style.removeProperty("top"),e.style.removeProperty("left"),e.style.removeProperty("width"),e.style.removeProperty("height")},en=e=>{if(!e)return 0;let{width:t,height:o}=e.getBoundingClientRect();return t&&o?t/o:0},es=e=>{switch(e){case"top":default:return{top:"0%",transform:`translate(-50%, 0%) scale(${g})`};case"bottom":return{top:"100%",transform:`translate(-50%, -100%) scale(${g})`};case"center":return{top:"50%",transform:`translate(-50%, -50%) scale(${g})`}}},ep=(e,t)=>{if(!e)return;let o=es(t);e.style.top=o.top,e.style.transform=o.transform},eb=({iframeEl:e,containerRatio:t,videoObjectFit:o,background:l,currentDevice:r,isYoutubeVideoMigrated:a})=>{let n,s;let p=el(l,r),b=i(l,r);if(!e||!t)return;let d=b?.videoAlign||"top",c=es(d);if("contain"===o){Object.assign(e.style,{position:"absolute",top:"50%",left:"50%",width:"100%",height:"100%",maxWidth:"none",transform:`translate(-50%, -50%) scale(${g})`});return}t>=p?(n=100,s=t/p*100):(s=100,n=p/t*100),Object.assign(e.style,{position:"absolute",top:c.top,left:"50%",width:a?"500%":`${n}%`,height:a?"100%":`${s}%`,maxWidth:"none",transform:c.transform})};export{P as collectAspectRatioByDevice,x as collectYoutubeAspectRatio,Q as debounce,_ as fallbackImg,ee as formatHoverScale,$ as getAspectRatio,f as getAttachmentDevice,y as getBackgroundImageHeroBanner,q as getBannerLink,m as getBgImage,H as getClassAlignBanner,F as getClassContentPosition,X as getClassForContentByFitContent,O as getClassForStretchContent,J as getClassSpaceBetween,K as getClassSpaceBetweenLeftRight,L as getClipPath,en as getContainerRatio,d as getContentPosition,k as getDataVideoHeroBannerResponsive,Z as getDisplayStyleByFitContent,c as getEnableBgImageByDevice,eo as getOpacityHover,T as getPercentageVisible,Y as getResponsiveSetting,j as getStyleAspectRatioHeroBannerCustom,E as getStyleHeroBannerBg,el as getVideoAspectRatio,w as getVisibilityStyle,R as getWidth,D as getYoutubeAspectRatio,I as horizontalAlign,u as imagePlaceholder,V as isScaleImage,S as mapContentPositionToHorizontal,et as opacityEnabledData,ei as resetVideoIframeStyle,ea as resetVideoWrapperStyle,v as scrollToContentBanner,ep as setVideoIframeAlign,er as setVideoWrapperStyle,U as showVideoType,eb as updateVideoIframeSize};
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import e from"./HeroBannerItem.liquid.js";import{getAttr as r,getAttrLink as t}from"../common/attrs.js";import{getStyle as o}from"../common/styles.js";import{getClasses as s,getLinkClasses as a}from"../common/classes.js";import{createStateOrContext as i,createAttr as n,createStyle as l,createClass as d,If as c}from"@gem-sdk/system";import{dataStringify as
|
|
1
|
+
import e from"./HeroBannerItem.liquid.js";import{getAttr as r,getAttrLink as t}from"../common/attrs.js";import{getStyle as o}from"../common/styles.js";import{getClasses as s,getLinkClasses as a}from"../common/classes.js";import{createStateOrContext as i,createAttr as n,createStyle as l,createClass as d,If as c}from"@gem-sdk/system";import{dataStringify as m,template as p,RenderIf as f,isLocalEnv as u,baseAssetURL as g}from"@gem-sdk/core";import{getBackgroundTranslated as h,getInsertLinkData as v,getSettingPreloadData as b}from"../../helpers.js";import{getResponsiveSetting as $,getBannerLink as j}from"../common/helpers.js";import{HeroBanner as k}from"../settings/configs/translate.js";let E=E=>{let{builderAttrs:y,builderProps:C,setting:P,styles:S,style:x,children:B,advanced:T,pageContext:V}=E,{enableLink:H,enableParallax:M}=P??{},N=h({background:S?.background,uid:C?.uid,enableTranslate:!!k?.background?.id,pageContext:V??{},isTranslateVideo:!0}),O=j(P),{cssClass:R}=T??{},{urlData:_}=v("",O),w=i({background:$(N||{}),uid:C?.uid,enableParallax:M&&Number(P?.speedParallax||0)>0,speedParallax:Number(P?.speedParallax)||0,hoverEffect:S?.hoverEffect,hoverEffectScale:S?.hoverEffectScale,layout:P?.layout,contentPosition1Col:S?.contentPosition1Col,contentPosition2Col:S?.contentPosition2Col,aspectRatio:P?.aspectRatio,sizeSetting:$(S?.sizeSetting||{}),videoObjectFit:$(S?.videoObjectFit||{}),target:O?.target??"_self",href:_?.href??"",linkType:O?.type??"",hoverEffectDuration:S?.hoverEffectDuration,isYoutubeVideoMigrated:P?.isYoutubeVideoMigrated}),z=!!O?.link&&H,A=n({...r({uid:C?.uid||""})}),D=n(t()),F=l({...o(S,P,x)}),G=d({...s({setting:P,builderProps:C,advancedCssClass:R})}),I=d({...a()}),Y=()=>e({setting:P,translatedBackground:N,styles:S,children:B,rawChildren:E.rawChildren,builderProps:C,pageContext:V});return p`
|
|
2
2
|
<gp-hero-banner
|
|
3
|
-
${{...
|
|
3
|
+
${{...y}}
|
|
4
4
|
${{...A}}
|
|
5
5
|
class="${G}"
|
|
6
6
|
style="${F}"
|
|
7
|
+
gp-data='${m(w)}'
|
|
7
8
|
>
|
|
8
|
-
<script gp-data type="application/json">${p(w)}</script>
|
|
9
9
|
${c(!z,Y())}
|
|
10
|
-
${c(z,
|
|
10
|
+
${c(z,p`
|
|
11
11
|
<div
|
|
12
12
|
${{...D}}
|
|
13
13
|
aria-hidden="true"
|
|
@@ -18,4 +18,4 @@ import e from"./HeroBannerItem.liquid.js";import{getAttr as r,getAttrLink as t}f
|
|
|
18
18
|
</gp-hero-banner>
|
|
19
19
|
${f(u,`<script ${b('class="gps-link" delay',"src")}="{{ 'gp-hero-banner-v2-v7-5.js' | asset_url }}" defer="defer"></script>`,`<script ${b('class="gps-link" delay',"src")}="${g}/assets-v2/gp-hero-banner-v2-v7-5.js?v={{ shop.metafields.GEMPAGES.ASSETS_VERSION }}" defer="defer"></script>
|
|
20
20
|
`)}
|
|
21
|
-
`};export{
|
|
21
|
+
`};export{E as default};
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import{dataStringify as s,template as i,RenderIf as t,isLocalEnv as e,baseAssetURL as
|
|
1
|
+
import{dataStringify as s,template as i,RenderIf as t,isLocalEnv as e,baseAssetURL as l}from"@gem-sdk/core";import{getSettingPreloadData as o}from"../../helpers.js";import r from"../../text/components/Text.liquid.js";import{createClass as a,createStyle as d,createAttr as p,If as n}from"@gem-sdk/system";import{getClassWraplistIcon as c,getClassColListIcon as m,getClassWrapItemIcon as $,getClassWrapIcon as u,getClassIcon as g,getClassTextItem as v}from"../common/classes.js";import{getStyleContainerIconlistMain as y,getStyleWraplistIcon as f,getStyleColListIcon as j,getStyleWrapIcon as h,getStyleWrapItemIcon as q,getStyleIcon as x,getStyleTypoText as S}from"../common/styles.js";import{getvalueMap as k,getTextIconTranslations as E,getTextIconNotFound as A}from"../common/helpers.js";let N=N=>{let{builderProps:T,builderAttrs:V,style:_,setting:w,styles:C,pageContext:G}=N,I=T?.builderData?.advanced,L=a({[T?.uid??""]:!0}),O=a(c()),W=a(m()),b=a($({builderProps:T})),D=a(u()),F=a(g()),M=a(v({setting:w})),P=d(y({styles:C,style:_,type:"liquid",advanced:I})),R=d(f({styles:C,uid:T?.uid??"",pageContext:G,type:"Liquid"})),z=d(j({styles:C})),B=d(h({styles:C,setting:w})),H=d(q({styles:C})),J=d(x({styles:C,setting:w})),K=S({setting:w}),Q=p({...V}),U=A("liquid"),X=k({setting:w});return i`
|
|
2
2
|
{% assign locationOrigin = request.origin | append: routes.root_url | split: '/' | join: '/' %}
|
|
3
3
|
<gp-icon-list
|
|
4
4
|
${{...Q}}
|
|
5
|
-
${{...
|
|
6
|
-
data-id="${
|
|
5
|
+
${{...T}}
|
|
6
|
+
data-id="${T?.uid}"
|
|
7
7
|
style="${P}"
|
|
8
8
|
className="${L}"
|
|
9
|
+
gp-data='${s({position:C?.position,iconWidth:w?.iconWidth}).replaceAll("'","'")}'
|
|
9
10
|
>
|
|
10
|
-
<script gp-data type="application/json">${s({position:C?.position,iconWidth:A?.iconWidth})}</script>
|
|
11
11
|
${n(!X||!X.length,i`<div>${U}</div>`,i`
|
|
12
12
|
<div class="${O}" style="${R}">
|
|
13
13
|
<div class="${W}" style="${z}">
|
|
14
|
-
${X?.map((s,t)=>{let e=E({setting:
|
|
14
|
+
${X?.map((s,t)=>{let e=E({setting:w,builderProps:T,pageContext:G,key:t,type:"liquid"});return i`
|
|
15
15
|
<div
|
|
16
16
|
key="${t}"
|
|
17
17
|
data-index="${t}"
|
|
@@ -31,5 +31,5 @@ import{dataStringify as s,template as i,RenderIf as t,isLocalEnv as e,baseAssetU
|
|
|
31
31
|
</div>
|
|
32
32
|
</div>`)}
|
|
33
33
|
</gp-icon-list>
|
|
34
|
-
${t(e,`<script ${
|
|
35
|
-
`};export{
|
|
34
|
+
${t(e,`<script ${o('class="gps-link" delay',"src")}="{{ 'gp-icon-list-v7-5.js' | asset_url }}" defer="defer"></script>`,`<script ${o('class="gps-link" delay',"src")}="${l}/assets-v2/gp-icon-list-v7-5.js?v={{ shop.metafields.GEMPAGES.ASSETS_VERSION }}" defer="defer"></script>`)}
|
|
35
|
+
`};export{N as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
let
|
|
1
|
+
let E=/\.(gif|webp|jfif|svg|tiff?)(?:\?|$)/i,f=/\.(gif|jfif|svg|tiff?)(?:\?|$)/i;export{E as REGEX_IS_NON_RESIZABLE_IMAGE,f as REGEX_IS_NON_RESIZABLE_IMAGE_BY_QUERY};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{getCornerCSSFromGlobal as e,getAspectRatioGlobalSize as t,hasTranslatedLiquid as i,makeStyleResponsive as r,DEVICES as l,getResponsiveValueByScreen as a,cloneDeep as s}from"@gem-sdk/core";import{getDynamicSourceLocales as o,createSettingId as n}from"../../helpers.js";import{Image as g}from"../settings/configs/translate.js";import{REGEX_IS_NON_RESIZABLE_IMAGE as c}from"./const.js";let
|
|
1
|
+
import{getCornerCSSFromGlobal as e,getAspectRatioGlobalSize as t,hasTranslatedLiquid as i,makeStyleResponsive as r,DEVICES as l,getResponsiveValueByScreen as a,cloneDeep as s}from"@gem-sdk/core";import{getDynamicSourceLocales as o,createSettingId as n}from"../../helpers.js";import{Image as g}from"../settings/configs/translate.js";import{REGEX_IS_NON_RESIZABLE_IMAGE as c,REGEX_IS_NON_RESIZABLE_IMAGE_BY_QUERY as d}from"./const.js";let u=t=>{let i={...t},r=!0;return i&&Object.keys(i??{}).forEach(e=>{if("bblr"===e||"bbrr"===e||"btlr"===e||"btrr"===e){let t=i[e]??{};"0px"!==t&&(r=!1)}}),r?e(i):{}},m=({styles:e,setting:i})=>{let{srcSet:r,image:l}=i??{},{customAspectRadio:a,shape:s}=e??{},o={desktop:f({device:"desktop",aspect:e?.aspectRatio,auto:i?.isAdaptive?r?.desktop:l,custom:a}),tablet:f({device:"tablet",aspect:e?.aspectRatio,auto:i?.isAdaptive?r?.tablet:l,custom:a}),mobile:f({device:"mobile",aspect:e?.aspectRatio,auto:i?.isAdaptive?r?.mobile:l,custom:a})};return s?t(s):o},f=({device:e,aspect:t,custom:i,auto:r})=>{let l=t?.[e];return"auto"===l?r?.height?`${r.width}/${r.height}`:void 0:"custom"===l?i?.[e]?.height?`${i?.[e]?.width}/${i?.[e]?.height}`:void 0:l},p=({layout:e,isDisableObjectFit:t})=>t?{}:r("objf",e),h=({isDisableAspectStyle:e,aspectRatio:t,objectFits:i,width:r,height:a})=>{if(e)return{};let s={};return l.forEach(e=>{let l=`--objf${"desktop"!==e?`-${e}`:""}`,o=i?.[l]||i?.["--objf"];if(t?.[e]==="auto"&&"contain"===o){s[e]="auto";return}s[e]=t?.[e]!=="auto"&&t?.[e]?t[e]:`${r}/${a}`}),s},b=e=>JSON.stringify(e||{}).replace(/"/g,"""),A=(e,t)=>`<svg width="${e}" height="${t}" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
|
2
2
|
<defs>
|
|
3
3
|
<linearGradient id="g-${e}-${t}">
|
|
4
4
|
<stop stop-color="rgba(51, 51, 51, 0)" offset="20%" />
|
|
@@ -9,4 +9,4 @@ import{getCornerCSSFromGlobal as e,getAspectRatioGlobalSize as t,hasTranslatedLi
|
|
|
9
9
|
<rect width="${e}" height="${t}" fill="rgba(51, 51, 51, 0)" />
|
|
10
10
|
<rect id="r" width="${e}" height="${t}" fill="url(#g-${e}-${t})" />
|
|
11
11
|
<animate xlink:href="#r" attributeName="x" from="-${e}" to="${e}" dur="1s" repeatCount="indefinite" />
|
|
12
|
-
</svg>`,
|
|
12
|
+
</svg>`,w=e=>"undefined"==typeof window?Buffer.from(e).toString("base64"):window.btoa(e),$=(e,t)=>`data:image/svg+xml;base64,${w(A(e,t))}`,_="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNkYAAAAAYAAjCB0C8AAAAASUVORK5CYII=",S="https://cdn.shopify.com/s/assets/no-image-2048-5e88c1b20e087fb7bbe9a3771824e743c244f437e4f8ba93bbf7b11b53f7824c_large.gif",E={DEFAULT_SIZES:"100vw",DEFAULT_ALT:"Alt image",DEFAULT_SRC:"https://cdn.shopify.com/s/files/1/2005/9307/files/placeholder-1.png?v=1751355990",DEFAULT_WIDTH_PROPS:800,DEFAULT_HEIGHT_PROPS:533},x=e=>{let{srcSet:t,fallbackImg:i}=e;return{getDeviceSource:e=>{let{isLiquid:r}=e??{},l=R(t?.desktop,"desktop",!r)||i||S,a=R(t?.tablet,"tablet",!r)||R(t?.desktop,"tablet",!r)||i||S,s=R(t?.mobile,"mobile",!r)||R(t?.tablet,"mobile",!r)||R(t?.desktop,"mobile",!r)||i||S;return{srcTablet:a,srcMobile:s,srcDesktop:l}}}},I=({setting:e,uid:t,pageContext:i})=>{if(!e||!g)return{};let r=s(e);for(let e in r.srcSet){let l=r.srcSet[e];if(l&&l.src){let r=o({val:l.src,uid:t,settingId:g?.srcSet?.id?`${g.srcSet.id}_${e}_src`:"",pageContext:i??{}});l.src=String(r)}}let l=o({val:r.alt,uid:t,settingId:n({id:g?.alt?.id}),pageContext:i??{}});r.alt=String(l);let a=o({val:r.title,uid:t,settingId:n({id:g?.title?.id}),pageContext:i??{}});return r.title=String(a),r},k=(e,t,i)=>e?C(e,t):F(i),v=e=>c.test(e),y=e=>d.test(e),C=(e,t)=>{let i=T(e);return v(e)?"FILE_CONTENT"==t?`{{ '${i}' | file_url }} 768w, {{ '${i}' | file_url }} 1024w, {{ '${i}' | file_url }} 1440w`:`{{ '${e}' | asset_url }} 768w, {{ '${e}' | asset_url }} 1024w, {{ '${e}' | asset_url }} 1440w`:"FILE_CONTENT"==t?`{{ '${i}' | file_img_url: '768x' }} 768w, {{ '${i}' | file_img_url: '1024x' }} 1024w, {{ '${i}' | file_img_url: 'master' }} 1440w`:`{{ '${e}' | asset_img_url: '768x' }} 768w, {{ '${e}' | asset_img_url: '1024x' }} 1024w, {{ '${e}' | asset_img_url: 'master' }} 1440w`},F=e=>e,R=(e,t,r)=>{if(e?.metafieldDefinitionKey)return N(e?.metafieldDefinitionKey);let l=e?.backupFilePath??e?.src??"";if(r)l=e?.src||"";else{let t=e?.src??"";if(i(t))return t;if(e?.backupFileKey){let t=j(e.backupFileKey,e?.src??"");"THEME"!==e.storage&&e.storage?"FILE_CONTENT"===e.storage&&(l=`{{ "${T(t)}" | file_url }}`):l=`{{ "${t}" | asset_url }}`}}if(t&&l?.includes("cdn.shopify")&&!y(l))switch(t){case"tablet":l=l?.includes("?")?`${l}&width=1024`:`${l}?width=1024`;break;case"mobile":l=l?.includes("?")?`${l}&width=768`:`${l}?width=768`}return l},N=e=>`{{${e} | file_url}}`,T=e=>e.replace(/\.jpeg|\.jfif/g,".jpg"),j=(e,t)=>{let i=t?.match(/\/files\/([^\/]+\.(jpg|jpeg|gif|png|webp|svg))/)?.[1];return i&&i!=e?i:e};function L(e,t){let i=D({str:e,reg:/_(pico|icon|thumb|small|compact|medium|large|grande|original|1024x1024|2048x2048|master)+\./g,newString:"."});if(v(i))return i;let r=D({str:i,reg:/\.jpg|\.png|\.jpeg/g,newString:t,isAdd:!0});return r}let D=e=>{let t=e.str,i=e.str.match(e.reg)?.length;if(i){let r,l=1;for(;null!==(r=e.reg.exec(e.str));){if(l===i){let i=e.reg.lastIndex,l=i-r[0].length;e.isAdd&&(e.newString="_"+e.newString+r),t=t.slice(0,l)+e.newString+t.slice(i,t.length)}l++}}return t},W=(e,t)=>{let i=z(),r=t?.[i]||"auto";if("auto"===r||r.includes("%"))return e;let l=Number(r.replace("px",""));return l>e?e:Number(r.replace("px",""))},O=e=>{let{itemWidthParam:t,imageWidthSetting:i,qualityType:r,qualityPercent:l}=e,s=z(),o=W(t,i),n=a(r,s,"finest"),g=a(l,s,100);switch(n){case"finest":default:return"auto";case"high":return Math.round(1.5*o)||1;case"medium":return Math.round(o)||1;case"custom":return Math.round(o*(Number(g)/100))||1}},B=e=>{let t={desktop:"100%",tablet:"100%",mobile:"100%"};return l.forEach(i=>{let r=a(e,i)?.width||"100%";t[i]=r}),t},K=e=>{let t={desktop:"100%",tablet:"100%",mobile:"100%"};return l.forEach(i=>{let r=a(e,i)?.width||"100%";t[i]=r}),t},P=e=>{let t=document.querySelectorAll(`.gem-slider-item-${e}.gp-gallery-image-item`),i=0;return t.forEach(e=>{e.offsetWidth>i&&(i=e.offsetWidth)}),i},U=e=>{let t=document.querySelectorAll(`.gem-slider-item-${e}.gp-ft-image-item`),i=0;return t.forEach(e=>{e.offsetWidth>i&&(i=e.offsetWidth)}),i},G=e=>{let{shapeByLayout:t,qualityType:i,qualityPercent:r,builderPropUID:l}=e,a=document.querySelectorAll(`.gem-slider-item-${l}.gp-gallery-image-item`),s=K(t),o=P(l);a.forEach(e=>{q({item:e,settingWidth:s,width:o,qualityType:i,qualityPercent:r})})},M=e=>{let{ftShape:t,qualityType:i,qualityPercent:r,builderPropUID:l}=e,a=document.querySelectorAll(`.gem-slider-item-${l}.gp-ft-image-item`),s=B(t),o=U(l);a.forEach(e=>{q({item:e,settingWidth:s,width:o,qualityType:i,qualityPercent:r})})},q=e=>{let{item:t,settingWidth:i,width:r,qualityType:l,qualityPercent:a}=e,s=z(),o=t.querySelector("img");if(o){let e=O({itemWidthParam:r,imageWidthSetting:i,qualityType:l,qualityPercent:a}),t=o.getAttribute("base-src");if(!t)return;let n=H(e,t),g=Q(t,n,s);o.setAttribute("srcset",g)}},H=(e,t)=>"auto"===e?t:L(t,`${e}x`),Q=(e,t,i)=>`${"mobile"===i&&e!==t?t:L(e,"768x")} 767w, ${"tablet"===i&&e!==t?t:L(e,"1024x")} 1023w, ${"desktop"===i&&e!==t?t:L(e,"1920x")} 1440w`,z=()=>window.innerWidth<768?"mobile":window.innerWidth>=768&&window.innerWidth<1025?"tablet":"desktop";export{S as FALLBACK_IMAGE,_ as IMAGE_PLACEHOLDER,E as NEXT_IMAGE_CONFIG,f as composeAspectRatio,$ as createBlurDataURL,x as getAdaptiveImageData,m as getAspectRatio,h as getAspectRatioNextImage,z as getCurrentDevice,R as getImageSrc,O as getImageWidthFollowByQuality,j as getNewBackupFileKey,p as getResponsiveObjectFit,I as getSettingTranslatedImageAndSeo,k as getSrcSet,M as handleSetSrcForFeatureProductImage,G as handleSetSrcForProductImageList,v as isCannotResizeImage,y as isCannotResizeImageByQuery,u as overwriteDefaultRadius,T as replaceBackupFileKeyFileContent,L as resizeImage,b as safeStringify,A as shimmer,w as toBase64};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import{template as t,isLocalEnv as i,baseAssetURL as e}from"@gem-sdk/core";import{createStyle as s,createClass as a,createAttr as r,createStateOrContext as l,If as o}from"@gem-sdk/system";import{getSettingPreloadData as m}from"../../helpers.js";import
|
|
1
|
+
import{template as t,isLocalEnv as i,baseAssetURL as e}from"@gem-sdk/core";import{createStyle as s,createClass as a,createAttr as r,createStateOrContext as l,If as o}from"@gem-sdk/system";import{getSettingPreloadData as m}from"../../helpers.js";import d from"../../image/components/NextImage.liquid.js";import{getOuterWrapperStyles as p,getWrapperWidth as c,getContainerStyles as g,getLazyPlaceholderStyle as n,getImageStyles as h,getLabelStyles as y,getArrowStyles as f,getLineStyles as $,getHandleStyles as b,getHandleCustomStyles as S,getSliderStyles as j}from"../common/styles.js";import{getOuterWrapperClasses as u,getLabelClasses as I,getLabelContainerClasses as L}from"../common/classes.js";import{getImageLiquidAttrs as v,getImagePlaceholderAttrs as w,getLabelLiquidAttrs as A,getLabelAttrs as C}from"../common/attrs.js";import{getData as q}from"../common/helpers.js";import N from"./Label.liquid.js";import k from"./SlideHandle.liquid.js";let D=D=>{let{leftImage:E,rightImage:O,advanced:x,builderData:z,pageContext:F,preload:G=!1,onSliderPositionChange:H}=D,{hover:W,styles:_,handle:J,handleSize:M,leftImageAlt:P,leftImageTitle:R,leftImageCss:T,leftImageLabel:V,rightImageAlt:B,rightImageTitle:K,rightImageCss:Q,rightImageLabel:U,sliderLineWidth:X,sliderLineColor:Y,sliderPositionPercentage:Z,vertical:tt,componentUid:ti,tempImage:te,aspectRatio:ts,defaultRatio:ta,isHorizontal:tr,hasLeftLabel:tl,hasRightLabel:to,qualityType:tm,qualityPercent:td,getLeftImageSrc:tp,getRightImageSrc:tc}=q(D),tg=tp({isLiquid:!0}),tn=tc({isLiquid:!0}),th=s({...p(_)}),ty=s({...c({width:_?.width,leftImageWidth:E?.width,rightImageWidth:O?.width})}),tf=s({...g({aspectRatio:ts,builderData:z})}),t$=s({...n(ts)}),tb=s({...h({type:"right",props:D})}),tS=s({...h({type:"left",props:D})}),tj=s({...y({styles:_,type:"left",isHorizontal:tr})}),tu=s({...y({styles:_,type:"right",isHorizontal:tr})}),tI=s({...f({type:"left"})}),tL=s({...f({type:"right"})}),tv=s({...$({isHorizontal:tr,sliderLineColor:Y,sliderLineWidth:X})}),tw=s({...b({handleSize:M,isHorizontal:tr,sliderLineColor:Y,sliderLineWidth:X})}),tA=s({...S()}),tC=s({...j({hover:W,handleSize:M,isHorizontal:tr})}),tq=a({...u(x?.cssClass)}),tN=a({...I(_)}),tk=a({...L()}),tD=C({componentUid:ti,positionId:"left",label:V??""}),tE=C({componentUid:ti,positionId:"right",label:U??""}),tO=r({...v({priority:G,src:tn,title:K,isDisableObjectFit:!0,isDisableAspectStyle:!0,id:`right-image-${ti}`})}),tx=r({...v({priority:G,src:tg,title:R,isDisableObjectFit:!0,isDisableAspectStyle:!0,id:`left-image-${ti}`})}),tz=A({pageContext:F,translateLabel:"leftImageLabel"}),tF=A({pageContext:F,translateLabel:"rightImageLabel"}),tG=r({...w({width:te?.width,height:te?.height})}),tH=l({hover:W,handle:J,vertical:tt,leftImage:E,rightImage:O,handleSize:M,aspectRatio:ts,defaultRatio:ta,componentUid:ti,leftImageCss:T,rightImageCss:Q,sliderLineColor:Y,sliderLineWidth:X,sliderPositionPercentage:Z,onSliderPositionChange:H});return t`
|
|
2
2
|
<gp-image-comparison
|
|
3
3
|
data-id="${ti}"
|
|
4
|
-
style="${
|
|
4
|
+
style="${th}"
|
|
5
5
|
class="${tq}"
|
|
6
|
+
gp-data='${JSON.stringify(tH)}'
|
|
6
7
|
>
|
|
7
|
-
<
|
|
8
|
-
<div id="img-comparison-wrapper-${ti}" style="${th}">
|
|
8
|
+
<div id="img-comparison-wrapper-${ti}" style="${ty}">
|
|
9
9
|
<div
|
|
10
10
|
id="img-comparison-container-${ti}"
|
|
11
11
|
data-testid="container"
|
|
@@ -14,10 +14,10 @@ import{template as t,isLocalEnv as i,baseAssetURL as e}from"@gem-sdk/core";impor
|
|
|
14
14
|
${t`
|
|
15
15
|
<img alt="" ${tG} style="${t$}" />
|
|
16
16
|
`}
|
|
17
|
-
${
|
|
18
|
-
${
|
|
17
|
+
${d({...tO,alt:B,style:tb,setting:{qualityType:tm,qualityPercent:td},pageContext:F,isNotLazyload:G,customAttrs:{"data-testid":"right-image"}})}
|
|
18
|
+
${d({...tx,alt:P,style:tS,setting:{qualityType:tm,qualityPercent:td},pageContext:F,isNotLazyload:G,customAttrs:{"data-testid":"left-image"}})}
|
|
19
19
|
${k({componentUid:ti,customHandle:J,lineStyles:tv,sliderStyles:tC,handleStyles:tw,customHandleStyles:tA,leftArrowStyles:tI,rightArrowStyles:tL})}
|
|
20
|
-
${o(tl,N({...tD,...tz,styles:_,childrenClass:tN,childrenStyle:
|
|
20
|
+
${o(tl,N({...tD,...tz,styles:_,childrenClass:tN,childrenStyle:tj,containerClass:tk,containerStyle:{}}),"")}
|
|
21
21
|
${o(to,N({...tE,...tF,styles:_,childrenClass:tN,childrenStyle:tu,containerClass:tk,containerStyle:{}}),"")}
|
|
22
22
|
</div>
|
|
23
23
|
</div>
|
|
@@ -1,28 +1,28 @@
|
|
|
1
|
-
import{cls as e,WrapRenderChildren as s,RenderChildren as t,template as i,RenderIf as r,isLocalEnv as o,baseAssetURL as
|
|
2
|
-
${r(o,'<script src="{{ \'gp-marquee-v7-5.js\' | asset_url }}" defer="defer"></script>',`<script src="${
|
|
3
|
-
<gp-marquee data-id="${P?.uid}"
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import{cls as e,WrapRenderChildren as s,RenderChildren as t,template as i,RenderIf as r,isLocalEnv as o,baseAssetURL as d}from"@gem-sdk/core";import a from"./MarqueeBase.liquid.js";import{useMarqueeLiquidStyles as m}from"../common/helpers.js";import{createClass as l,createStyle as p,createStateOrContext as c,If as u}from"@gem-sdk/system";import{getMarqueeStyles as n,getAlignStyles as $,getContentStyles as v,getFastMarqueeChildrenIconStyles as g}from"../common/styles.js";import{getAlignClasses as f,getContentClasses as S,getWrapperClasses as h,getFastMarqueeContentClasses as y,getFastMarqueeClasses as q,getFastMarqueeContentChildrenClasses as j,getFastMarqueeChildrenIconClasses as k}from"../common/classes.js";let w=({children:w,style:B,builderAttrs:C,rawChildren:b,advanced:E,...O})=>{let{styles:I,setting:M,builderProps:P}=O,{iconSeparatorColor:x,backgroundColor:A}=I||{},{iconSeparatorSvg:F,isShowIconSeparator:G}=M||{},H=b.length,{isFullWidth:N,getIsFullWidthValue:R}=m(M,I),{styleHeight:_,styleWidth:J,getWidthForWrapperItem:T,getHeightOfIconSeparatorSize:V,getWidthOfIconSeparatorSize:W,getIconPosition:z,getItemPaddingRightSpacingValue:D,getWidthForItem:K}=n({itemSize:H,setting:M,styles:I}),L=l(f),Q=p($(I)),U=p(v({style:B,backgroundColor:A,styleWidth:J,styleHeight:_})),X=l(S),Y=l(h(P?.uid)),Z=l(y),ee=l(q),es=l(j(N)),et=e=>p(g({index:e,itemSize:H,iconSeparatorColor:x,getHeightOfIconSeparatorSize:V,getWidthOfIconSeparatorSize:W,getIconPosition:z})),ei=l(k),er=e=>p({...D(e),"text-wrap":"wrap",...T()}),eo=p(K()),ed=c({setting:{...M,uid:P?.uid},styles:I});return i`
|
|
2
|
+
${r(o,'<script src="{{ \'gp-marquee-v7-5.js\' | asset_url }}" defer="defer"></script>',`<script src="${d}/assets-v2/gp-marquee-v7-5.js?v={{ shop.metafields.GEMPAGES.ASSETS_VERSION }}" defer="defer"></script>`)}
|
|
3
|
+
<gp-marquee data-id="${P?.uid}" gp-data='${JSON.stringify(ed)}'
|
|
4
|
+
class="${e(P?.uid,E?.cssClass)}">
|
|
5
|
+
<div class="${L}" style="${Q}">
|
|
6
6
|
<div class="${X}" style="${U}">
|
|
7
|
-
|
|
7
|
+
<div class="${Y}">
|
|
8
8
|
<div class="${ee}">
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
${a({autoFill:!0,direction:O.setting?.direction,play:(O.setting?.speed??0)>0,pauseOnHover:O.setting?.stopOnHover,isFullWidthResponsive:{desktop:R("desktop"),tablet:R("tablet"),mobile:R("mobile")},children:`
|
|
10
|
+
<div class="${Z}">
|
|
11
11
|
${b?.length?s({uid:P?.uid??"",customProps:b[0]?.customProps},b.map((e,s)=>{if(e)return i`
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
</div>
|
|
20
|
-
`})):w}
|
|
12
|
+
<div class="${es}"
|
|
13
|
+
style="${er(s)}">
|
|
14
|
+
${t({...e,index:s,itemBorderStyle:I?.itemBorderStyle,itemCorner:I?.itemCorner,itemBackgroundColor:I?.itemBackgroundColor,hasItemShadow:M?.hasItemShadow,itemShadow:I?.itemShadow,itemStyles:eo})}
|
|
15
|
+
${u(!!(G&&F),i`<span style="${et(s)}"
|
|
16
|
+
class="${ei}">
|
|
17
|
+
${F}
|
|
18
|
+
</span>`)}
|
|
21
19
|
</div>
|
|
22
|
-
|
|
20
|
+
`})):w}
|
|
21
|
+
</div>
|
|
22
|
+
`})}
|
|
23
23
|
</div>
|
|
24
|
-
|
|
24
|
+
</div>
|
|
25
25
|
</div>
|
|
26
|
-
|
|
27
|
-
|
|
26
|
+
</div>
|
|
27
|
+
</gp-marquee>
|
|
28
28
|
`};export{w as default};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import{cls as
|
|
1
|
+
import{cls as e,makeStyle as t,RenderIf as i,isLocalEnv as r,baseAssetURL as s,template as o,getResponsiveValueByScreen as l}from"@gem-sdk/core";import{getFlexDirection as a}from"../helpers/product-image.js";import{checkAddOverFlowClass as p,getStyleAlignment as d,getDisplayStyle as m}from"./product-images/common/helpers.js";import g from"./product-images/ProductFeaturedImage.liquid.js";import u from"./product-images/ProductGalleryCarousel.liquid.js";import c from"./product-images/ProductGalleryGrid.liquid.js";import{getStyleGallerySpacing as f,getStyleWidthForGallery as n}from"./product-images/common/productGallery.js";import{getSettingPreloadData as b}from"../../helpers.js";let y=y=>{let{setting:$,styles:j,builderProps:h,style:v}=y,S={...y.styles,...y.setting},w={...y.styles,...y.setting},x=e=>l(j?.position,e),I=`
|
|
2
2
|
{
|
|
3
3
|
"id":${JSON.stringify(h?.uid)},
|
|
4
|
-
"setting":${JSON.stringify(
|
|
5
|
-
"styles":${JSON.stringify(
|
|
6
|
-
"product":{{ product | json }}
|
|
4
|
+
"setting":${JSON.stringify($)},
|
|
5
|
+
"styles":${JSON.stringify(j)},
|
|
6
|
+
"product":{{ product | json | escape }}
|
|
7
7
|
}
|
|
8
8
|
`;return o`
|
|
9
9
|
{% assign featured_image = product.featured_image %}
|
|
@@ -11,19 +11,19 @@ import{cls as t,makeStyle as e,RenderIf as i,isLocalEnv as r,baseAssetURL as s,t
|
|
|
11
11
|
{% assign featured_image = variant.featured_image %}
|
|
12
12
|
{%- endif -%}
|
|
13
13
|
<gp-product-images
|
|
14
|
+
gp-data='${I}'
|
|
14
15
|
style="${{...v}}"
|
|
15
|
-
class="${
|
|
16
|
+
class="${e({"gp-overflow-hidden":p(v)})}"
|
|
16
17
|
>
|
|
17
|
-
<script gp-data type="application/json">${I}</script>
|
|
18
18
|
<div
|
|
19
|
-
class="${
|
|
20
|
-
style="${{...d(
|
|
19
|
+
class="${e("gp-flex gp-w-full",{...a(y)})}"
|
|
20
|
+
style="${{...d(j?.align,j?.position)}}"
|
|
21
21
|
>
|
|
22
22
|
${g({...S})}
|
|
23
23
|
{%- if product.media.size > 1 -%}
|
|
24
24
|
<div
|
|
25
|
-
class="${
|
|
26
|
-
style="${{...
|
|
25
|
+
class="${e("gallery-wrapper gp-product-images-gallery gp-inline-flex gp-h-fit gp-max-w-full",{"gp-justify-start":"bottom-left"==x("desktop"),"tablet:gp-justify-start":"bottom-left"==x("tablet"),"mobile:gp-justify-start":"bottom-left"==x("mobile"),"gp-justify-center":"bottom-center"==x("desktop"),"tablet:gp-justify-center":"bottom-center"==x("tablet"),"mobile:gp-justify-center":"bottom-center"==x("mobile"),"gp-mx-auto":"bottom-center"==x("desktop"),"tablet:gp-mx-auto":"bottom-center"==x("tablet"),"mobile:gp-mx-auto":"bottom-center"==x("mobile")})}"
|
|
26
|
+
style="${{...t({fs:"1.23"}),...m(e=>!!$?.galleryVisible&&!l($?.galleryVisible,e),"inline-flex"),...n({galleryVisible:$?.galleryVisible,featureImageVisible:$?.featureImageVisible,position:j?.position,width:j?.width,widthHorizontalLayout:j?.widthHorizontalLayout}),...f(j?.position,j?.gallerySpacing)}}"
|
|
27
27
|
>
|
|
28
28
|
${u({builderPropUID:h?.uid,...w})}
|
|
29
29
|
${c({builderPropUID:h?.uid,...w})}
|
|
@@ -31,5 +31,5 @@ import{cls as t,makeStyle as e,RenderIf as i,isLocalEnv as r,baseAssetURL as s,t
|
|
|
31
31
|
{%- endif -%}
|
|
32
32
|
</div>
|
|
33
33
|
</gp-product-images>
|
|
34
|
-
${i(r,`<script ${
|
|
35
|
-
`};export{
|
|
34
|
+
${i(r,`<script ${b('class="gps-link" delay',"src")}="{{ 'gp-product-images.js' | asset_url }}" defer="defer"></script>`,`<script ${b('class="gps-link" delay',"src")}="${s}/assets-v2/gp-product-images.js?v={{ shop.metafields.GEMPAGES.ASSETS_VERSION }}" defer="defer"></script>`)}
|
|
35
|
+
`};export{y as default};
|
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import{
|
|
2
|
-
${
|
|
3
|
-
${
|
|
4
|
-
${
|
|
1
|
+
import{isLocalEnv as t,baseAssetURL as s,template as a}from"@gem-sdk/core";import{createClass as i,createStateOrContext as e,Liquid as o,LiquidFor as n,If as l}from"@gem-sdk/system";import{getSettingPreloadData as r}from"../../../helpers.js";import{getButtonClasses as d}from"./common/classes.js";import{getButtonStyles as p}from"./common/styles.js";let m=({setting:m,advanced:c,styles:u,builderProps:y,className:g=""})=>{let _=i({...!!g&&{[g]:!0},...d({styles:u,uid:y?.uid})}),f=p({styles:u,uid:y?.uid}),$=e({setting:{label:m?.label},totalVariant:"{{total_combinations}}"});return a`
|
|
2
|
+
${o("{%- assign total_combinations = 1 -%}")}
|
|
3
|
+
${n("option in product.options_with_values","{%- assign total_combinations = total_combinations | times: option.values.size -%}")}
|
|
4
|
+
${o(`
|
|
5
5
|
{%- liquid
|
|
6
6
|
assign inventory_quantity = variant.inventory_quantity | default: 0
|
|
7
7
|
assign supported_payment_methods = shop.enabled_payment_types
|
|
8
8
|
-%}
|
|
9
9
|
`)}
|
|
10
|
-
<gp-product-dynamic data-id="${
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
10
|
+
<gp-product-dynamic data-id="${y?.uid}" data-translate-label='${m?.label}' class="${c?.cssClass}" gp-data='${JSON.stringify($).replaceAll("'","'")}
|
|
11
|
+
'>
|
|
12
|
+
<div class="${_}">
|
|
13
|
+
{{ form | payment_button }}
|
|
14
|
+
</div>
|
|
15
|
+
{% style %}
|
|
16
|
+
${f}
|
|
17
|
+
{% endstyle %}
|
|
18
18
|
</gp-product-dynamic>
|
|
19
|
-
${l(
|
|
20
|
-
`};export{
|
|
19
|
+
${l(t,`<script ${r('class="gps-link" delay',"src")}="{{ 'gp-product-dynamic-v7-5.js' | asset_url }}" defer="defer"></script>`,`<script ${r('class="gps-link" delay',"src")}="${s}/assets-v2/gp-product-dynamic-v7-5.js?v={{ shop.metafields.GEMPAGES.ASSETS_VERSION }}" defer="defer"></script>`)}
|
|
20
|
+
`};export{m as default};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import{template as e,RenderIf as s,isLocalEnv as i,baseAssetURL as l}from"@gem-sdk/core";import{getSettingPreloadData as r}from"../../../helpers.js";import{createClass as t,createStyle as d,createAttr as o,createStateOrContext as a,If as c}from"@gem-sdk/system";import{createLayoutClasses as v,createTypoClasses as f,createPreviewClasses as
|
|
2
|
-
<gp-file-upload
|
|
3
|
-
|
|
1
|
+
import{template as e,RenderIf as s,isLocalEnv as i,baseAssetURL as l}from"@gem-sdk/core";import{getSettingPreloadData as r}from"../../../helpers.js";import{createClass as t,createStyle as d,createAttr as o,createStateOrContext as a,If as c}from"@gem-sdk/system";import{createLayoutClasses as v,createTypoClasses as f,createPreviewClasses as m,createPreviewItemClasses as p,createPreviewRemoveClasses as $,createMessageClasses as n,createContentWidthClasses as u,createInputClasses as g,composeClasses as y,createWrapContainerClasses as b,createIconContentClasses as j}from"./common/classes.js";import{createLayoutStyles as E,createTypoStyles as H,createMessageStyles as S,createContainerStyles as h,createWrapContentWidthStyles as k,createContentWithStyles as q,createIconContainerStyles as w,createIconContentStyles as F}from"./common/style.js";import{getInputAttr as O}from"./common/attr.js";import{removeHoverStyles as x,getDisplayText as R}from"./common/helpers.js";let I=({setting:I,styles:P,builderProps:C,pageContext:J})=>{let L=t(v(I,C?.uid)),N=d({...x(E(I,P),P?.enableHoverEffect)}),U=t(f(P)),V=d({...x(H(P),P?.enableHoverEffect)}),_=t(m()),z=t(p()),A=t($()),B=t(n()),D=d(S()),G=t(u()),K=t(g()),M=t(y("gp-flex gp-items-center")),Q=o({...O(I?.isRequired,I?.numberOfFiles)}),T=d({...x(h(P?.align,P?.textColor),P?.enableHoverEffect)}),W=d({...x(k(I),P?.enableHoverEffect)}),X=t(b(C?.uid)),Y=d({...x(q(I,P),P?.enableHoverEffect)}),Z=d({...x(w(I),P?.enableHoverEffect)}),ee=t(j()),es=d({...x(F(I,P),P?.enableHoverEffect)}),ei=R("Liquid",{uid:C?.uid,setting:I,styles:P,pageContext:J}),el=a({settings:{isShowPreviewImage:I?.isShowPreviewImage,numberOfFiles:I?.numberOfFiles,isRequired:I?.isRequired}});return e`
|
|
2
|
+
<gp-file-upload
|
|
3
|
+
gp-data='${JSON.stringify(el)}'
|
|
4
|
+
>
|
|
4
5
|
<div class="${X}" style="${T}">
|
|
5
6
|
<input ${Q} class="${K}">
|
|
6
7
|
<div class="${M}" style="${W}">
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{dataStringify as e,sanitizeLiquid as t,RenderIf as s,template as i,isLocalEnv as r,baseAssetURL as a}from"@gem-sdk/core";import{getDynamicSourceLocales as o,getSettingPreloadData as c}from"../../../helpers.js";import{generateBadgeContent as n}from"./utils/generateLiquidContent.js";import{renderBadgeInFirstTime as d}from"./utils/renderBadgeLiquid.js";import{createClass as p,createStyle as l,createAttr as u,createStateOrContext as m}from"@gem-sdk/system";import{IS_LIQUID as g}from"./constants.js";import{getContainerStyle as y,getSubWrapperStyle as $,getContentStyleInternal as v,getTextBadgeWrapperStyles as f,getTextContentStyle as j,getImageContainerStyles as P}from"./common/styles.js";import{getContainerClasses as S,getWrapperClasses as D,getSubWrapperClass as V,getTextContainerClasses as b,getTextWrapperClasses as h,getTextContentClasses as C,getImageContainerClasses as I,getImageClasses as L}from"./common/classes.js";import{getSubWrapperAttrs as T,getContainerAttrs as k,getTextContentAttrs as q,getImageAttr as A}from"./common/attrs.js";import{checkDiscountContentProductBadge as E}from"./utils/common.js";import{ProductBadge as K}from"../../settings/product-badge/configs/translate.js";let N=N=>{let{styles:_,setting:B,builderProps:O,pageContext:Q}=N,w=B?.shape!=="image",G=w&&B?.displayContent?.trim()==="",H=E(B?.displayContent),J=p({...S({isInstant:!1,props:N})}),x=l({...y(N,g)}),M=p({...D(N)}),R=p({...V(N)}),Y=l({...$({props:N})}),z=u({...T(N)}),F=v(N),U=p({...b()}),W=u({...k(N)}),X=p({...h()}),Z=l({...f({setting:B,styles:_})}),ee=p({...C(_)}),et=l({...j({setting:B,styles:_})}),es=u({...q()}),ei=p({...I()}),er=l({...P({setting:B,styles:_})}),ea=p({...L()}),eo=u({...A({setting:B})}),ec=m({minPrice:"{{ minPriceValue | replace: '\"', '\\\"' | escape }}",variantIDs:'{{ product.variants | map: "id" | json | escape }}',variantInventoryQuantities:'{{ product.variants | map: "inventory_quantity" | json | escape }}',amountDiscount:"{{amountDiscountValue | replace: '\"', '\\\"' | escape }}",percentDiscount:"{{percentDiscountValue}}",price:"{{price}}",displayTrigger:JSON.parse(JSON.stringify(B?.displayTrigger).replaceAll("'","'")),uid:N.builderProps?.uid,productCreatedAt:'{{product.created_at | date: "%Y-%m-%d" }}',productTags:"{{ product.tags | join: \",\" | replace: '\"', '\\\"' | escape }}",isTextBadge:w,isSettingSameHeightProductList:"{{ isSettingSameHeightProductList }}"}),{displayContent:en}=B??{},ed=o({val:en?.trim(),uid:O?.uid,settingId:K?.displayContent?.id,isLiquid:!0,pageContext:Q});return i`
|
|
2
2
|
{% if product %}
|
|
3
|
-
${n(
|
|
4
|
-
${
|
|
3
|
+
${n(ed,Q?.isPreviewing)}
|
|
4
|
+
${d(B?.displayTrigger,!G,H)}
|
|
5
5
|
<gp-product-badge
|
|
6
6
|
${{...W}}
|
|
7
|
+
gp-data='${e(ec)}'
|
|
7
8
|
class="${J} {{ className }}"
|
|
8
9
|
style="${x}"
|
|
9
|
-
data-display-content="${Q?.isPreviewing?
|
|
10
|
+
data-display-content="${Q?.isPreviewing?ed:t(`{{${ed}}}`)}"
|
|
10
11
|
>
|
|
11
|
-
<script gp-data type="application/json">${t(ec)}</script>
|
|
12
12
|
<div class="${M}">
|
|
13
13
|
<div
|
|
14
14
|
${{...z}}
|
|
@@ -36,4 +36,4 @@ import{sanitizeLiquid as e,dataStringify as t,RenderIf as s,template as i,isLoca
|
|
|
36
36
|
</gp-product-badge>
|
|
37
37
|
${s(r,`<script ${c('class="gps-link" delay',"src")}="{{ 'gp-product-badge-v7-5.js' | asset_url }}" defer="defer"></script>`,`<script ${c('class="gps-link" delay',"src")}="${a}/assets-v2/gp-product-badge-v7-5.js?v={{ shop.metafields.GEMPAGES.ASSETS_VERSION }}" defer="defer"></script>`)}
|
|
38
38
|
{% endif %}
|
|
39
|
-
`};export{
|
|
39
|
+
`};export{N as default};
|
|
@@ -1,16 +1,15 @@
|
|
|
1
|
-
import{template as t,RenderIf as e,isLocalEnv as s,baseAssetURL as r}from"@gem-sdk/core";import{getSettingPreloadData as
|
|
1
|
+
import{template as t,RenderIf as e,isLocalEnv as s,baseAssetURL as r}from"@gem-sdk/core";import{getSettingPreloadData as d}from"../../../helpers.js";import{createStyle as a,createClass as o,createStateOrContext as i,Liquid as p,LiquidIf as n}from"@gem-sdk/system";import{getSizeSettings as l,getContainerStyles as u}from"./common/styles.js";import{getContainerClasses as c}from"./common/classes.js";import m from"./ProductBundleDiscountChildrenItem.liquid.js";let f=({rawChildren:f,setting:g,styles:I,advanced:$,style:P})=>{let y=g?.hasPreSelectItem?g?.selectItemDefault??0:-1,S=t=>y===t,_=(t,e)=>m({rawChildrenItem:f?.[e],setting:g,styles:I,isSelected:S(e),bundleItem:t}),h=a(l(I)?.gap),B=o(c(g,$?.cssClass)),A=a(u(h,I,P)),j=i({styles:I,settings:{useProductCompareAtPrice:g?.useProductCompareAtPrice,selectItemDefault:g?.selectItemDefault,hideNoDiscountItem:g?.hideNoDiscountItem,hasPreSelectItem:g?.hasPreSelectItem,iconItemColor:g?.iconItemColor,applyToInBetweenQuantities:g?.applyToInBetweenQuantities}});return t`
|
|
2
2
|
<gp-product-bundle-discount
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
${i(`
|
|
3
|
+
gp-data='${JSON.stringify(j)}'
|
|
4
|
+
style="${A}"
|
|
5
|
+
class="${B}">
|
|
6
|
+
${p(`
|
|
8
7
|
{%- assign gempages_product_bundle = product.metafields.gp_discount.gp_discount_selected_products -%}
|
|
9
8
|
{% assign productBundleItem = gempages_product_bundle | split: '($1)' %}
|
|
10
9
|
`)}
|
|
11
10
|
${f?.map((e,s)=>t`
|
|
12
11
|
{% for productBundle in productBundleItem %}
|
|
13
|
-
${
|
|
12
|
+
${p(`
|
|
14
13
|
{% assign attrs = productBundle | split: '($3)' %}
|
|
15
14
|
{% assign parsedAttrs = '' %}
|
|
16
15
|
{% for attr in attrs %}
|
|
@@ -29,6 +28,6 @@ import{template as t,RenderIf as e,isLocalEnv as s,baseAssetURL as r}from"@gem-s
|
|
|
29
28
|
</gp-product-bundle-discount>
|
|
30
29
|
|
|
31
30
|
{% if productBundleItem %}
|
|
32
|
-
${e(s,`<script ${
|
|
31
|
+
${e(s,`<script ${d('class="gps-link" delay',"src")}="{{ 'gp-product-bundle-discount-v7-5.js' | asset_url }}" defer="defer"></script>`,`<script ${d('class="gps-link" delay',"src")}="${r}/assets-v2/gp-product-bundle-discount-v7-5.js?v={{ shop.metafields.GEMPAGES.ASSETS_VERSION }}" defer="defer"></script>`)}
|
|
33
32
|
{% endif %}
|
|
34
33
|
`};export{f as default};
|