@gem-sdk/core 17.0.0-dev.87 → 17.0.0-dev.89

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,2 +1,2 @@
1
1
  'use client';
2
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("react");require("zustand");var i=require("../contexts/BuilderPreviewContext.js"),r=require("../contexts/PageContext.js"),o=require("./theme-section/CreateThemeSection.js"),l=require("./toolbar/Tooltip.js"),n=require("./toolbar/SectionErrorBanner.js"),a=require("./theme-section/ThemeSectionStatus.js"),s=require("./resize/Resize.js"),d=require("../hooks/useToolbarPostPurchase.js"),u=require("./constant.js"),C=require("./ai-generator/AIContentGenerator.js"),c=require("./ai-generator/AIGenContentLoading.js"),h=require("./InteractionSuffix.js"),p=require("@gem-sdk/core"),g=require("./upgrade-element/UpgradeOldElement.js"),m=require("./ai-assistant/AIAssistant.js");require("swr"),require("../graphql/queries/collection-detail-filter.generated.js"),require("../graphql/queries/collection.generated.js"),require("../graphql/queries/collections.generated.js"),require("../graphql/queries/published-theme-pages.generated.js"),require("../graphql/queries/products.generated.js"),require("../graphql/queries/store-property.generated.js"),require("../graphql/queries/preview-page.generated.js"),require("../graphql/queries/published-shop-metas.generated.js"),require("../graphql/queries/shop-shopify.generated.js"),require("../graphql/queries/articles.generated.js"),require("../graphql/queries/blogs.generated.js"),require("../graphql/queries/products-with-selling-plans.generated.js"),require("../graphql/queries/product-variant-with-selling-plans.generated.js"),require("../graphql/queries/product-variants.generated.js"),require("../graphql/queries/product-little-detail.generated.js"),require("../graphql/queries/product-medias.generated.js"),require("../helpers/convert.js"),require("crc-32");var f=require("../contexts/ShopContext.js");require("@gem-sdk/adapter-shopify"),require("swr/mutation"),require("swr/infinite"),require("vanilla-lazyload"),require("../hooks/useCartUI.js"),require("../graphql/queries/product-value-label.generated.js"),require("../hooks/useStickyStore.js"),require("../types/builder.js"),require("../types/builderUpsell.js"),require("../types/custom.js"),require("../types/animations.js");const v=e=>{let t=getComputedStyle(e).overflow;return"visible"!==t},x=e=>{let t=e.getAttribute("data-component-tag");return"Section"===t};var j=t.memo(j=>{let{t:b}=p.useI18nStore(),w=j.isThemeSection,S=!!j.isShopifySection,q=f.useShopStore(e=>e.storefrontUrl),M=f.useShopStore(e=>e.pageType),L=i.useBuilderPreviewStore(e=>e.getParents),y=i.useBuilderPreviewStore(e=>e.getItem("ROOT")),Z=i.useBuilderPreviewStore(e=>e.isThemeSectionEditor),[P,R]=t.useState(null),[E,H]=t.useState(!1),[V,A]=t.useState(!1),[T,B]=t.useState([]),[k,I]=t.useState("top"),[F,$]=t.useState(!1),[U,G]=t.useState(!1),[O,D]=t.useState(""),[N,_]=t.useState(""),[z,W]=t.useState({width:"",text:""}),[J,K]=t.useState(!1),Q=i.useBuilderPreviewStore(e=>e.errorSectionList),X=t.useMemo(()=>{if(!Q)return null;let e=Q?.find(e=>e.uid===j.uid);return e},[Q,j.uid]),Y=r.usePageStore(e=>e.interactionData),ee=t.useMemo(()=>"POST_PURCHASE"===M,[M]),{checkDisableDelete:et,getTooltipText:ei,checkDisableDuplicate:er}=d.usePostPurchase(j.uid,j.tag||""),eo=["ProductTitle","ProductDescription","ProductPrice"],el=["ArticleTitle","ArticleContent","ArticleImage","ArticleAuthor","ArticleCategory","ArticleDate","ArticleExcerpt","ArticleTags"],en=[...eo,...el],ea=(e,t)=>{let i=T.length,r=e.getBoundingClientRect(),o=t.getBoundingClientRect();return r.top-o.top<36*i},es=(e,t)=>{let i=t||e;if(e&&!x(e))return v(e)&&ea(t,e)?e:e.parentElement?es(e.parentElement,i):void 0},ed=t.useCallback(()=>y?.childrens?.length||0,[y?.childrens?.length]),eu=t.useCallback(()=>{if("Section"==j.tag)return"bottom";let e=document.body.querySelector("#storefront")?.querySelector('[data-toolbar-active="true"]');if(e){let t=e.getBoundingClientRect();t.top<60?I("bottom"):I("top")}},[j.tag]),eC=t.useMemo(()=>q?q.match(/^(?:https?:\/\/)?([^/]+)\.myshopify\.com/)?.[1]:"",[q]),ec=t.useMemo(()=>`https://admin.shopify.com/store/${eC}`,[eC]),eh=t.useMemo(()=>O?`${ec}/products/${O}`:"",[ec,O]),ep=t.useMemo(()=>N?`${ec}/articles/${N.replace("gid://shopify/Article/","")}`:"",[N,ec]),eg=t.useMemo(()=>Y?.isSelectOnPage,[Y?.isSelectOnPage]),em=t.useMemo(()=>Y?.settingType,[Y?.settingType]),ef=t.useMemo(()=>Y?.item?.targets?.find(e=>e.uid===j.uid&&e?.type!=="PAGE")&&"TARGET"===em,[Y?.item?.targets,j.uid,em]),ev=t.useMemo(()=>Y?.item?.self?.uid===j.uid&&Y?.item?.self.type!=="PAGE"&&"TRIGGER"===em,[Y?.item?.self?.type,Y?.item?.self?.uid,j.uid,em]),ex=t.useMemo(()=>!ef&&!ev,[ef,ev]),ej=t.useMemo(()=>F||S,[F,S]),eb=t.useMemo(()=>J||S||ed()>25&&"Section"===j.tag||!!X,[ed,J,S,j.tag,X]),ew=t.useCallback(e=>{let t=e.detail;if(t?.articleId&&_(t.articleId),t?.productId&&D(t.productId),t?.componentUid==j.uid){G(!0),eu(),ee&&($(et()),W(ei()),K(er()));let e=L(j.uid).filter(e=>!("ROOT"===e.uid||"Section"===e.tag&&Z||e.editorConfigs?.toolbar?.hide||e.editorConfigs?.component?.noSetting)).slice(0,3);B(e)}else G(!1),B([]),H(!1)},[j.uid,ee,L,et,ei,er,Z,eu]),eS=i.useBuilderPreviewStore(e=>e.dismissPublishError),eq=t.useCallback(()=>{eS(j.uid)},[eS,j.uid]),eM=t.useCallback(()=>"Section"!==j.tag?-1:y?.childrens?.length?y.childrens.findIndex(e=>e==j.uid):-1,[y?.childrens,j.uid,j.tag]),eL=t.useMemo(()=>eM()>=25,[eM]),ey=t.useMemo(()=>!!X||eL,[X,eL]);t.useEffect(()=>(window.addEventListener("editor:active-component",ew),()=>{window.removeEventListener("editor:active-component",ew)}),[ew]);let eZ=!!(j.tag&&u.oldElementTags.includes(j.tag));if("section"===j.type||j.editorConfigs?.toolbar?.hide)return null;let eP=e=>{let t=e?.childrens?.length??0;if("Row"===e.label){let e=1===t?b("Row {colNumber} col",{colNumber:t}):b("Row {colNumber} cols",{colNumber:t});return e}return b(e.label)},eR=e=>{if(!T.length)return;let t=e?.target||null,i=t.closest("[data-toolbar-active]");if(!t||!i)return;if(E)A(!1),H(!1);else{let e=es(i,i);if(e)A(!0);else{let e=i.getBoundingClientRect();e.top<36*T.length?A(!0):A(!1)}H(!0)}let r=new CustomEvent("editor:toolbar:show-parents",{bubbles:!0,detail:{value:!E}});window.dispatchEvent(r)},eE=e=>{e.preventDefault(),e.stopPropagation();let t=new CustomEvent("editor:toolbar:delete-component",{bubbles:!0,detail:{componentUid:j.uid,isThemeSection:w,isShopifySection:S}});return window.dispatchEvent(t),!1},eH=e=>{e.preventDefault(),e.stopPropagation();let t=new CustomEvent("editor:toolbar:duplicate-component",{bubbles:!0,detail:{componentUid:j.uid,isThemeSection:w,isShopifySection:S}});return window.dispatchEvent(t),!1},eV=e=>{e.preventDefault(),e.stopPropagation();let t=new CustomEvent("editor:toolbar:zoom-out-component",{bubbles:!0,detail:{componentUid:j.uid}});return window.dispatchEvent(t),!1},eA=()=>{R(null),window.removeEventListener("editor:close-add-section-popup",eA)},eT=(e,t)=>{if(e.preventDefault(),e.stopPropagation(),ed()>=25)return!1;let i=e.target;if(i){R(t);let e=i.getBoundingClientRect(),r=new CustomEvent("editor:toolbar:add-section",{bubbles:!0,detail:{componentUid:j.uid,position:t,top:e.top+e.height/2}});window.dispatchEvent(r),window.addEventListener("editor:close-add-section-popup",eA)}return!1},eB="Section"===j.tag&&!j.isThemeSection&&"STATIC"!==M&&"POST_PURCHASE"!==M&&!j.isShopifySection&&25>eM()&&!X;return e.jsxs(e.Fragment,{children:[!("Section"==j.tag&&Z)&&e.jsxs("div",{"data-toolbar":!0,"data-toolbar-section":"Section"==j.tag,"data-toolbar-theme-section":"Section"==j.tag&&!!w||Z,"data-toolbar-shopify-section":"Section"==j.tag&&!!S,"data-toolbar-limit":eM()>=25||!!X,children:[e.jsxs("div",{"data-toolbar-show-parent":!0,onClick:e=>eR(e),"aria-hidden":"true",children:[ev&&e.jsx("div",{className:"gp-hidden gp-w-[12px] interaction-use-custom-element",children:e.jsx("svg",{width:"12",height:"13",viewBox:"0 0 12 13",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M4.36799 0.430523C4.51596 0.205675 4.76709 0.0703125 5.03626 0.0703125H9.88576C10.2042 0.0703125 10.395 0.424378 10.2198 0.69034L8.36968 3.4992C8.28209 3.63218 8.37747 3.80922 8.53671 3.80922H10.749C11.1111 3.80922 11.2869 4.25204 11.0233 4.50036L3.03971 12.0217C2.7572 12.2878 2.29932 12.0361 2.37262 11.655L3.27994 6.93698C3.30366 6.81364 3.20915 6.69921 3.08354 6.69921H0.984651C0.66625 6.69921 0.475479 6.34529 0.650515 6.07932L4.36799 0.430523Z",fill:"#F9F9F9"})})}),ef&&e.jsx("div",{className:"gp-hidden gp-w-[14px] interaction-use-custom-element",children:e.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M7.32785 3.66159C7.87459 3.58351 8.25451 3.077 8.17643 2.53026C8.09836 1.98353 7.59184 1.6036 7.0451 1.68168C3.92866 2.12673 1.5332 4.80488 1.5332 8.04424C1.5332 11.594 4.41085 14.4716 7.9606 14.4716C11.1706 14.4716 13.8294 12.1194 14.3105 9.04446C14.3959 8.49881 14.0227 7.98727 13.4771 7.9019C12.9314 7.81654 12.4199 8.18967 12.3345 8.73531C12.0034 10.852 10.1702 12.4716 7.9606 12.4716C5.51541 12.4716 3.5332 10.4894 3.5332 8.04424C3.5332 5.81431 5.18273 3.96793 7.32785 3.66159ZM10.3432 1.97548C10.6232 1.69551 11.102 1.83654 11.1855 2.22355L11.6106 4.19339C11.6313 4.28936 11.7063 4.36432 11.8023 4.38503L13.7721 4.81013C14.1591 4.89365 14.3001 5.37247 14.0202 5.65243L12.3432 7.32945C12.1244 7.54819 11.8168 7.65338 11.5099 7.61436L10.1528 7.44178C9.84592 7.40276 9.53827 7.50795 9.31953 7.72669L8.66719 8.37903C8.35477 8.69145 7.86633 8.70954 7.57623 8.41943C7.28613 8.12933 7.30421 7.64089 7.61663 7.32847L8.26898 6.67613C8.48771 6.45739 8.5929 6.14974 8.55388 5.84287L8.38131 4.48575C8.34228 4.17888 8.44748 3.87123 8.66621 3.6525L10.3432 1.97548ZM8.19853 5.1916C8.35319 5.72179 8.04877 6.27697 7.51858 6.43163C6.83078 6.63226 6.32988 7.2683 6.32988 8.01873C6.32988 8.9316 7.06991 9.67164 7.98279 9.67164C8.73014 9.67164 9.36406 9.17486 9.56743 8.49131C9.72492 7.96195 10.2817 7.6605 10.8111 7.81799C11.3404 7.97548 11.6419 8.53227 11.4844 9.06163C11.0356 10.57 9.63916 11.6716 7.98279 11.6716C5.96535 11.6716 4.32988 10.0362 4.32988 8.01873C4.32988 6.35558 5.44054 4.95445 6.95851 4.51165C7.4887 4.35699 8.04387 4.66141 8.19853 5.1916Z",fill:"#F9F9F9"})})}),U&&ex&&e.jsx("div",{"data-toolbar-icon-drag":!0,children:e.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:[e.jsx("path",{d:"M5.5 4.5C6.32843 4.5 7 3.82843 7 3C7 2.17157 6.32843 1.5 5.5 1.5C4.67157 1.5 4 2.17157 4 3C4 3.82843 4.67157 4.5 5.5 4.5Z",fill:"currentColor"}),e.jsx("path",{d:"M5.5 9.5C6.32843 9.5 7 8.82843 7 8C7 7.17157 6.32843 6.5 5.5 6.5C4.67157 6.5 4 7.17157 4 8C4 8.82843 4.67157 9.5 5.5 9.5Z",fill:"currentColor"}),e.jsx("path",{d:"M7 13C7 13.8284 6.32843 14.5 5.5 14.5C4.67157 14.5 4 13.8284 4 13C4 12.1716 4.67157 11.5 5.5 11.5C6.32843 11.5 7 12.1716 7 13Z",fill:"currentColor"}),e.jsx("path",{d:"M10.5 4.5C11.3284 4.5 12 3.82843 12 3C12 2.17157 11.3284 1.5 10.5 1.5C9.67157 1.5 9 2.17157 9 3C9 3.82843 9.67157 4.5 10.5 4.5Z",fill:"currentColor"}),e.jsx("path",{d:"M12 8C12 8.82843 11.3284 9.5 10.5 9.5C9.67157 9.5 9 8.82843 9 8C9 7.17157 9.67157 6.5 10.5 6.5C11.3284 6.5 12 7.17157 12 8Z",fill:"currentColor"}),e.jsx("path",{d:"M10.5 14.5C11.3284 14.5 12 13.8284 12 13C12 12.1716 11.3284 11.5 10.5 11.5C9.67157 11.5 9 12.1716 9 13C9 13.8284 9.67157 14.5 10.5 14.5Z",fill:"currentColor"})]})}),"Section"==j.tag?e.jsxs("div",{"data-toolbar-name":!0,children:[(()=>{if(S)return j.name?.includes("Shopify section:")?`${b("Shopify section")}: ${j.name.replace("Shopify section:","")}`:`${b("Shopify section")}: ${j.name}`;let e=j.name&&j.name===`Section ${j.uid}`;return ed()>=20?`${e?b("Section"):j?.name} ${eM()+1}/25`:e?`${b("Section")} ${eM()+1}`:j?.name})(),U&&S&&!j.isShopifyVisibility&&e.jsxs("svg",{"data-toolbar-visibility":!0,width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[e.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M13.1252 9.99773C13.1243 8.27226 11.7248 6.87423 9.99935 6.87506C8.27386 6.87561 6.87518 8.27455 6.87518 10.0001C6.87518 11.7259 8.27429 13.1251 10.0002 13.1251C11.7257 13.1251 13.125 11.727 13.1252 10.0011V9.99773ZM9.99985 8.12506C11.035 8.12451 11.8746 8.96322 11.8752 9.99839V10.0004C11.8752 11.0357 11.0359 11.8751 10.0002 11.8751C8.96465 11.8751 8.12518 11.0356 8.12518 10.0001C8.12518 8.96472 8.96451 8.12533 9.99985 8.12506Z",fill:"#F9F9F9"}),e.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M9.99885 4.37593C5.66421 4.37604 2.80603 7.64523 1.79548 9.00983C1.35636 9.60279 1.35918 10.4 1.80012 10.9902C2.81706 12.3514 5.69374 15.6241 9.99886 15.6241C14.3806 15.6241 17.2194 12.3452 18.2168 10.9808C18.6473 10.392 18.6442 9.60472 18.211 9.01902C17.2056 7.65938 14.3429 4.37583 9.99885 4.37593ZM2.80002 9.75374C3.77049 8.44326 6.30207 5.62602 9.99888 5.62593C13.7041 5.62585 16.24 8.45598 17.206 9.76225C17.3146 9.9091 17.3149 10.0965 17.2077 10.2431C16.254 11.5477 13.7416 14.3741 9.99886 14.3741C6.33149 14.3741 3.78173 11.5541 2.80152 10.242C2.69021 10.0931 2.69001 9.90229 2.80002 9.75374Z",fill:"#F9F9F9"}),e.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M18.0763 3.26988C18.3415 3.58809 18.2985 4.06101 17.9803 4.32619L2.98032 16.8262C2.66211 17.0914 2.18919 17.0484 1.92402 16.7302C1.65884 16.412 1.70184 15.939 2.02004 15.6739L17.02 3.17385C17.3383 2.90868 17.8112 2.95167 18.0763 3.26988Z",fill:"#F9F9F9"})]})]}):e.jsx("div",{"data-toolbar-name":!0,children:b(j.customLabel||j.label)}),U&&"Section"!==j.tag&&T.length>0&&e.jsx("div",{"data-toolbar-icon-parent":!0,"data-toolbar-icon-parent-open":E,children:e.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:e.jsx("path",{d:"M5.65522 10C5.07265 10 4.7809 9.22865 5.19284 8.77753L7.53762 6.20974C7.79298 5.93009 8.20702 5.93009 8.46238 6.20974L10.8072 8.77754C11.2191 9.22866 10.9274 10 10.3448 10H5.65522Z",fill:"currentColor"})})})]}),U&&E&&T.map((t,i)=>e.jsxs("div",{"data-toolbar-parent":!0,"data-component-tag":t.tag,"data-parent-uid":t.uid,"data-toolbar-theme-section":Z,"data-toolbar-parent-revert":V,style:{top:V?`${36*(i+1)}px`:`${-36*(i+1)}px`},children:[e.jsx("div",{"data-toolbar-icon-drag":!0,children:e.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:[e.jsx("path",{d:"M5.5 4.5C6.32843 4.5 7 3.82843 7 3C7 2.17157 6.32843 1.5 5.5 1.5C4.67157 1.5 4 2.17157 4 3C4 3.82843 4.67157 4.5 5.5 4.5Z",fill:"currentColor"}),e.jsx("path",{d:"M5.5 9.5C6.32843 9.5 7 8.82843 7 8C7 7.17157 6.32843 6.5 5.5 6.5C4.67157 6.5 4 7.17157 4 8C4 8.82843 4.67157 9.5 5.5 9.5Z",fill:"currentColor"}),e.jsx("path",{d:"M7 13C7 13.8284 6.32843 14.5 5.5 14.5C4.67157 14.5 4 13.8284 4 13C4 12.1716 4.67157 11.5 5.5 11.5C6.32843 11.5 7 12.1716 7 13Z",fill:"currentColor"}),e.jsx("path",{d:"M10.5 4.5C11.3284 4.5 12 3.82843 12 3C12 2.17157 11.3284 1.5 10.5 1.5C9.67157 1.5 9 2.17157 9 3C9 3.82843 9.67157 4.5 10.5 4.5Z",fill:"currentColor"}),e.jsx("path",{d:"M12 8C12 8.82843 11.3284 9.5 10.5 9.5C9.67157 9.5 9 8.82843 9 8C9 7.17157 9.67157 6.5 10.5 6.5C11.3284 6.5 12 7.17157 12 8Z",fill:"currentColor"}),e.jsx("path",{d:"M10.5 14.5C11.3284 14.5 12 13.8284 12 13C12 12.1716 11.3284 11.5 10.5 11.5C9.67157 11.5 9 12.1716 9 13C9 13.8284 9.67157 14.5 10.5 14.5Z",fill:"currentColor"})]})}),e.jsx("div",{"data-toolbar-name":!0,children:eP(t)})]},t.uid)),U&&!eg&&e.jsxs(e.Fragment,{children:[eZ&&e.jsx(g.default,{...j}),e.jsx(m.AIAssistant,{uid:j.uid,tag:j.tag}),eB&&e.jsx(o.CreateThemeSection,{...j}),(()=>{let{isShopifySection:e,tag:t}=j;return!e&&(!w||!!Z)&&u.ableGenerateContentElements.includes(t)&&!X})()&&e.jsx(C.AIContentGenerator,{...j}),"Sticky"==j.tag&&e.jsx("div",{"data-toolbar-zoom-out":!0,onClick:e=>eV(e),"aria-hidden":"true",children:e.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M14.5 7C14.7761 7 15 6.77614 15 6.5C15 6.22386 14.7761 6 14.5 6L10.7072 6L14.8536 1.85355C15.0489 1.65829 15.0489 1.34171 14.8536 1.14645C14.6584 0.951186 14.3418 0.951185 14.1465 1.14645L10 5.29297L10 1.5C10 1.22386 9.77614 1 9.5 1C9.22386 1 9 1.22386 9 1.5L9 6.5C9 6.77614 9.22386 7 9.5 7L14.5 7ZM6 10.7073L6 14.5C6 14.7761 6.22386 15 6.5 15C6.77614 15 7 14.7761 7 14.5L7 9.5C7 9.22386 6.77614 9 6.5 9H1.5C1.22386 9 1 9.22386 1 9.5C1 9.77614 1.22386 10 1.5 10H5.29306L1.14662 14.1464C0.951353 14.3417 0.951353 14.6583 1.14662 14.8536C1.34188 15.0488 1.65846 15.0488 1.85372 14.8536L6 10.7073Z",fill:"currentColor"})})}),en.includes(j.tag)&&e.jsx(l.default,{"data-toolbar-title":!0,enable:!0,"data-toolbar-disable":!1,text:b("Edit content in Shopify"),position:"top",onClick:()=>{if(el.includes(j.tag)){window.open(ep,"_blank");return}if(eo.includes(j.tag)){window.open(eh,"_blank");return}window.open(ec,"_blank")},"aria-hidden":"true",children:e.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[e.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8.61129 2.47348C8.61129 2.47348 8.47099 2.51557 8.23248 2.59274C8.19039 2.46647 8.13427 2.30512 8.05009 2.15079C7.78352 1.6387 7.39068 1.37212 6.91366 1.36511C6.87858 1.36511 6.85052 1.36511 6.81545 1.37212C6.80843 1.36511 6.80142 1.35634 6.7944 1.34757C6.78739 1.3388 6.78037 1.33003 6.77336 1.32302C6.56992 1.09854 6.30335 0.993314 5.98768 1.00033C5.37737 1.02137 4.76706 1.46332 4.269 2.249C3.91825 2.80319 3.65869 3.49767 3.58153 4.03082C3.38823 4.09074 3.21092 4.14586 3.05516 4.19429C2.64595 4.32151 2.3851 4.40261 2.37494 4.40261C2.01718 4.51485 2.01016 4.52888 1.96106 4.85859C1.92598 5.11113 1 12.2945 1 12.2945L7.14764 13.3583C7.18955 13.118 7.30454 12.8953 7.47848 12.7214L8.70249 11.4974V2.45945C8.66741 2.45945 8.63234 2.46647 8.61129 2.47348ZM6.82948 3.02767L6.62554 3.09101C6.27515 3.19989 5.90094 3.31617 5.5317 3.42752C5.65797 2.94349 5.89648 2.46647 6.19111 2.15079C6.30335 2.03154 6.45067 1.90527 6.63306 1.8281C6.80142 2.18587 6.83649 2.68393 6.82948 3.02767ZM5.99469 1.4072C6.13499 1.4072 6.26126 1.43526 6.36649 1.50541C6.19813 1.58959 6.0438 1.71586 5.88947 1.87721C5.50364 2.29109 5.202 2.94349 5.08274 3.56783C4.74459 3.66991 4.41804 3.77199 4.10838 3.8688L4.01646 3.89753C4.22691 2.90841 5.05468 1.43526 5.99469 1.4072ZM4.80214 7.0122C4.81874 7.26957 5.09737 7.44833 5.43473 7.66478C5.95252 7.99699 6.60867 8.41798 6.66813 9.3482C6.7453 10.5548 6.02977 11.3826 4.99154 11.4457C3.7569 11.5229 3.06943 10.7933 3.06943 10.7933L3.32899 9.67791C3.32899 9.67791 4.01646 10.197 4.56363 10.1619C4.92139 10.1409 5.04767 9.84627 5.04065 9.64283C5.01607 9.26796 4.73308 9.06671 4.41569 8.84101C4.00848 8.55142 3.54465 8.22157 3.49735 7.4331C3.42018 6.24756 4.19885 5.05501 5.91051 4.94277C6.57694 4.90068 6.91366 5.06904 6.91366 5.06904L6.52082 6.53518C6.52082 6.53518 6.08589 6.33876 5.56678 6.36682C4.80915 6.41592 4.79512 6.89294 4.80214 7.0122ZM7.23635 2.9014C7.22934 2.59274 7.19426 2.15781 7.04695 1.78601C7.50994 1.87721 7.74143 2.39632 7.83964 2.71199C7.70008 2.75665 7.54275 2.80575 7.37118 2.8593L7.23635 2.9014Z",fill:"currentColor"}),e.jsx("path",{d:"M10.7719 3.44156C10.7757 3.47543 11.1733 6.16931 11.541 8.65883L8.95503 11.2448V2.57871C9.16548 2.78214 9.71265 3.31528 9.71265 3.31528C9.71265 3.31528 10.6106 3.32931 10.6597 3.33633C10.7088 3.34334 10.7649 3.37842 10.7719 3.44156Z",fill:"currentColor"}),e.jsx("path",{d:"M14.8056 8.644L14.0424 7.88088C13.7832 7.62163 13.3629 7.62163 13.1036 7.88088L12.1519 8.83258L13.8539 10.5345L14.8056 9.58282C15.0648 9.32357 15.0648 8.90325 14.8056 8.644Z",fill:"currentColor"}),e.jsx("path",{d:"M7.85018 13.0942L11.6419 9.30246L13.3438 11.0044L9.55212 14.7961C9.43782 14.9104 9.28573 14.9791 9.1244 14.9892L7.93427 15.0641C7.73484 15.0767 7.56961 14.9114 7.58216 14.712L7.65706 13.5219C7.66721 13.3606 7.73588 13.2085 7.85018 13.0942Z",fill:"currentColor"})]})}),e.jsx(l.default,{enable:"Section"==j.tag&&ed()>=25||S,text:S?b("Available in the Shopify theme editor"):b("Page has reached Shopify’s 25 section-limit"),position:"bottom",width:"200px","data-toolbar-duplicate":!0,"data-toolbar-disable":eb,onClick:eb?void 0:e=>eH(e),"aria-hidden":"true",className:eb?"!gp-cursor-not-allowed":"",children:e.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:e.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M6.08423 1.21289C5.53194 1.21289 5.08423 1.66061 5.08423 2.21289V3.78711H4.26172C3.43329 3.78711 2.76172 4.45868 2.76172 5.28711V13.2871C2.76172 14.1155 3.43329 14.7871 4.26172 14.7871H10.2617C11.0901 14.7871 11.7617 14.1155 11.7617 13.2871V12.4629H13.0842C13.6365 12.4629 14.0842 12.0152 14.0842 11.4629V2.21289C14.0842 1.66061 13.6365 1.21289 13.0842 1.21289H6.08423ZM10.7617 12.4629H6.08423C5.53194 12.4629 5.08423 12.0152 5.08423 11.4629V4.78711H4.26172C3.98558 4.78711 3.76172 5.01097 3.76172 5.28711V13.2871C3.76172 13.5633 3.98558 13.7871 4.26172 13.7871H10.2617C10.5379 13.7871 10.7617 13.5633 10.7617 13.2871V12.4629Z",fill:"currentColor"})})}),e.jsx(l.default,{"data-toolbar-delete":!0,onClick:e=>ej?null:eE(e),enable:ej,"data-toolbar-disable":ej,text:S?b("Available in the Shopify theme editor"):z.text,width:z.width,position:S?"bottom":k,"aria-hidden":"true",className:ej?"!gp-cursor-not-allowed":"",children:e.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:e.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M11 2.88965V2.38965C11 1.56122 10.3284 0.889648 9.5 0.889648H6.5C5.67157 0.889648 5 1.56122 5 2.38965V2.88965H2C1.72386 2.88965 1.5 3.11351 1.5 3.38965C1.5 3.66579 1.72386 3.88965 2 3.88965H3.21997V13.1099C3.21997 14.2144 4.1154 15.1099 5.21997 15.1099H11.22C12.3245 15.1099 13.22 14.2144 13.22 13.1099V3.88965H14C14.2761 3.88965 14.5 3.66579 14.5 3.38965C14.5 3.11351 14.2761 2.88965 14 2.88965H11ZM6 2.88965H10V2.38965C10 2.11351 9.77614 1.88965 9.5 1.88965H6.5C6.22386 1.88965 6 2.11351 6 2.38965V2.88965ZM6.24976 6.13965C6.66397 6.13965 6.99976 6.47543 6.99976 6.88965V11.3896C6.99976 11.8039 6.66397 12.1396 6.24976 12.1396C5.83554 12.1396 5.49976 11.8039 5.49976 11.3896V6.88965C5.49976 6.47543 5.83554 6.13965 6.24976 6.13965ZM10.4998 6.88965C10.4998 6.47543 10.164 6.13965 9.74976 6.13965C9.33554 6.13965 8.99976 6.47543 8.99976 6.88965V11.3896C8.99976 11.8039 9.33554 12.1396 9.74976 12.1396C10.164 12.1396 10.4998 11.8039 10.4998 11.3896V6.88965Z",fill:"currentColor"})})})]}),e.jsx(h.InteractionSuffix,{uid:j.uid})]},j.uid),"STATIC"!==M&&"POST_PURCHASE"!==M&&25>eM()&&e.jsx(a.ThemeSectionStatusWrapper,{...j}),e.jsx("div",{"data-outline":!0,"data-outline-section":"Section"==j.tag,"data-outline-theme-section":"Section"==j.tag&&!!w||Z,"data-outline-shopify-section":"Section"==j.tag&&!!S,"data-outline-limit":ey,"data-outline-error":!!X},"outline-"+j.uid),"Section"==j.tag&&!Z&&e.jsxs(e.Fragment,{children:[e.jsx(l.default,{enable:ed()>=25,text:b("Page has reached Shopify’s 25 section-limit"),position:"top","data-toolbar-add-top":!0,"data-toolbar-disable":ed()>=25,"data-toolbar-add-open":"above"==P,onClick:e=>eT(e,"above"),"aria-hidden":"true",children:e.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:e.jsx("path",{d:"M8.45 3.95C8.45 3.70147 8.24853 3.5 8 3.5C7.75147 3.5 7.55 3.70147 7.55 3.95V7.55H3.95C3.70147 7.55 3.5 7.75147 3.5 8C3.5 8.24853 3.70147 8.45 3.95 8.45H7.55V12.05C7.55 12.2985 7.75147 12.5 8 12.5C8.24853 12.5 8.45 12.2985 8.45 12.05V8.45H12.05C12.2985 8.45 12.5 8.24853 12.5 8C12.5 7.75147 12.2985 7.55 12.05 7.55H8.45V3.95Z",fill:"#212121"})})}),e.jsx(l.default,{enable:ed()>=25,text:b("Page has reached Shopify’s 25 section-limit"),position:"top","data-toolbar-add-bottom":!0,"data-toolbar-disable":ed()>=25,"data-toolbar-add-open":"below"==P,onClick:e=>eT(e,"below"),"aria-hidden":"true",children:e.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:e.jsx("path",{d:"M8.45 3.95C8.45 3.70147 8.24853 3.5 8 3.5C7.75147 3.5 7.55 3.70147 7.55 3.95V7.55H3.95C3.70147 7.55 3.5 7.75147 3.5 8C3.5 8.24853 3.70147 8.45 3.95 8.45H7.55V12.05C7.55 12.2985 7.75147 12.5 8 12.5C8.24853 12.5 8.45 12.2985 8.45 12.05V8.45H12.05C12.2985 8.45 12.5 8.24853 12.5 8C12.5 7.75147 12.2985 7.55 12.05 7.55H8.45V3.95Z",fill:"#212121"})})})]}),X&&e.jsx(n.SectionErrorBanner,{errorSectionInfo:X,onDismiss:eq}),u.ableGenerateContentElements.includes(j.tag)&&U&&e.jsx(c.AIGenContentLoading,{...j}),U&&e.jsx(s.default,{...j})]})});exports.default=j;
2
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("react");require("zustand");var i=require("../contexts/BuilderPreviewContext.js"),r=require("../contexts/PageContext.js"),o=require("./theme-section/CreateThemeSection.js"),l=require("./toolbar/Tooltip.js"),n=require("./toolbar/SectionErrorBanner.js"),a=require("./theme-section/ThemeSectionStatus.js"),s=require("./resize/Resize.js"),d=require("../hooks/useToolbarPostPurchase.js"),u=require("./constant.js"),C=require("./ai-generator/AIContentGenerator.js"),c=require("./ai-generator/AIGenContentLoading.js"),h=require("./InteractionSuffix.js"),p=require("@gem-sdk/core"),g=require("./ai-assistant/AIAssistant.js"),m=require("./upgrade-element/UpgradeElement.js");require("swr"),require("../graphql/queries/collection-detail-filter.generated.js"),require("../graphql/queries/collection.generated.js"),require("../graphql/queries/collections.generated.js"),require("../graphql/queries/published-theme-pages.generated.js"),require("../graphql/queries/products.generated.js"),require("../graphql/queries/store-property.generated.js"),require("../graphql/queries/preview-page.generated.js"),require("../graphql/queries/published-shop-metas.generated.js"),require("../graphql/queries/shop-shopify.generated.js"),require("../graphql/queries/articles.generated.js"),require("../graphql/queries/blogs.generated.js"),require("../graphql/queries/products-with-selling-plans.generated.js"),require("../graphql/queries/product-variant-with-selling-plans.generated.js"),require("../graphql/queries/product-variants.generated.js"),require("../graphql/queries/product-little-detail.generated.js"),require("../graphql/queries/product-medias.generated.js"),require("../helpers/convert.js"),require("crc-32");var f=require("../contexts/ShopContext.js");require("@gem-sdk/adapter-shopify"),require("swr/mutation"),require("swr/infinite"),require("vanilla-lazyload"),require("../hooks/useCartUI.js"),require("../graphql/queries/product-value-label.generated.js"),require("../hooks/useStickyStore.js"),require("../types/builder.js"),require("../types/builderUpsell.js"),require("../types/custom.js"),require("../types/animations.js");const v=e=>{let t=getComputedStyle(e).overflow;return"visible"!==t},x=e=>{let t=e.getAttribute("data-component-tag");return"Section"===t};var j=t.memo(j=>{let{t:b}=p.useI18nStore(),w=j.isThemeSection,S=!!j.isShopifySection,q=f.useShopStore(e=>e.storefrontUrl),M=f.useShopStore(e=>e.pageType),L=i.useBuilderPreviewStore(e=>e.getParents),y=i.useBuilderPreviewStore(e=>e.getItem("ROOT")),Z=i.useBuilderPreviewStore(e=>e.isThemeSectionEditor),[P,R]=t.useState(null),[E,H]=t.useState(!1),[V,A]=t.useState(!1),[T,B]=t.useState([]),[k,I]=t.useState("top"),[F,$]=t.useState(!1),[U,G]=t.useState(!1),[O,D]=t.useState(""),[N,_]=t.useState(""),[z,W]=t.useState({width:"",text:""}),[J,K]=t.useState(!1),Q=i.useBuilderPreviewStore(e=>e.errorSectionList),X=t.useMemo(()=>{if(!Q)return null;let e=Q?.find(e=>e.uid===j.uid);return e},[Q,j.uid]),Y=r.usePageStore(e=>e.interactionData),ee=t.useMemo(()=>"POST_PURCHASE"===M,[M]),{checkDisableDelete:et,getTooltipText:ei,checkDisableDuplicate:er}=d.usePostPurchase(j.uid,j.tag||""),eo=["ProductTitle","ProductDescription","ProductPrice"],el=["ArticleTitle","ArticleContent","ArticleImage","ArticleAuthor","ArticleCategory","ArticleDate","ArticleExcerpt","ArticleTags"],en=[...eo,...el],ea=(e,t)=>{let i=T.length,r=e.getBoundingClientRect(),o=t.getBoundingClientRect();return r.top-o.top<36*i},es=(e,t)=>{let i=t||e;if(e&&!x(e))return v(e)&&ea(t,e)?e:e.parentElement?es(e.parentElement,i):void 0},ed=t.useCallback(()=>y?.childrens?.length||0,[y?.childrens?.length]),eu=t.useCallback(()=>{if("Section"==j.tag)return"bottom";let e=document.body.querySelector("#storefront")?.querySelector('[data-toolbar-active="true"]');if(e){let t=e.getBoundingClientRect();t.top<60?I("bottom"):I("top")}},[j.tag]),eC=t.useMemo(()=>q?q.match(/^(?:https?:\/\/)?([^/]+)\.myshopify\.com/)?.[1]:"",[q]),ec=t.useMemo(()=>`https://admin.shopify.com/store/${eC}`,[eC]),eh=t.useMemo(()=>O?`${ec}/products/${O}`:"",[ec,O]),ep=t.useMemo(()=>N?`${ec}/articles/${N.replace("gid://shopify/Article/","")}`:"",[N,ec]),eg=t.useMemo(()=>Y?.isSelectOnPage,[Y?.isSelectOnPage]),em=t.useMemo(()=>Y?.settingType,[Y?.settingType]),ef=t.useMemo(()=>Y?.item?.targets?.find(e=>e.uid===j.uid&&e?.type!=="PAGE")&&"TARGET"===em,[Y?.item?.targets,j.uid,em]),ev=t.useMemo(()=>Y?.item?.self?.uid===j.uid&&Y?.item?.self.type!=="PAGE"&&"TRIGGER"===em,[Y?.item?.self?.type,Y?.item?.self?.uid,j.uid,em]),ex=t.useMemo(()=>!ef&&!ev,[ef,ev]),ej=t.useMemo(()=>F||S,[F,S]),eb=t.useMemo(()=>J||S||ed()>25&&"Section"===j.tag||!!X,[ed,J,S,j.tag,X]),ew=t.useCallback(e=>{let t=e.detail;if(t?.articleId&&_(t.articleId),t?.productId&&D(t.productId),t?.componentUid==j.uid){G(!0),eu(),ee&&($(et()),W(ei()),K(er()));let e=L(j.uid).filter(e=>!("ROOT"===e.uid||"Section"===e.tag&&Z||e.editorConfigs?.toolbar?.hide||e.editorConfigs?.component?.noSetting)).slice(0,3);B(e)}else G(!1),B([]),H(!1)},[j.uid,ee,L,et,ei,er,Z,eu]),eS=i.useBuilderPreviewStore(e=>e.dismissPublishError),eq=t.useCallback(()=>{eS(j.uid)},[eS,j.uid]),eM=t.useCallback(()=>"Section"!==j.tag?-1:y?.childrens?.length?y.childrens.findIndex(e=>e==j.uid):-1,[y?.childrens,j.uid,j.tag]),eL=t.useMemo(()=>eM()>=25,[eM]),ey=t.useMemo(()=>!!X||eL,[X,eL]);if(t.useEffect(()=>(window.addEventListener("editor:active-component",ew),()=>{window.removeEventListener("editor:active-component",ew)}),[ew]),"section"===j.type||j.editorConfigs?.toolbar?.hide)return null;let eZ=e=>{let t=e?.childrens?.length??0;if("Row"===e.label){let e=1===t?b("Row {colNumber} col",{colNumber:t}):b("Row {colNumber} cols",{colNumber:t});return e}return b(e.label)},eP=e=>{if(!T.length)return;let t=e?.target||null,i=t.closest("[data-toolbar-active]");if(!t||!i)return;if(E)A(!1),H(!1);else{let e=es(i,i);if(e)A(!0);else{let e=i.getBoundingClientRect();e.top<36*T.length?A(!0):A(!1)}H(!0)}let r=new CustomEvent("editor:toolbar:show-parents",{bubbles:!0,detail:{value:!E}});window.dispatchEvent(r)},eR=e=>{e.preventDefault(),e.stopPropagation();let t=new CustomEvent("editor:toolbar:delete-component",{bubbles:!0,detail:{componentUid:j.uid,isThemeSection:w,isShopifySection:S}});return window.dispatchEvent(t),!1},eE=e=>{e.preventDefault(),e.stopPropagation();let t=new CustomEvent("editor:toolbar:duplicate-component",{bubbles:!0,detail:{componentUid:j.uid,isThemeSection:w,isShopifySection:S}});return window.dispatchEvent(t),!1},eH=e=>{e.preventDefault(),e.stopPropagation();let t=new CustomEvent("editor:toolbar:zoom-out-component",{bubbles:!0,detail:{componentUid:j.uid}});return window.dispatchEvent(t),!1},eV=()=>{R(null),window.removeEventListener("editor:close-add-section-popup",eV)},eA=(e,t)=>{if(e.preventDefault(),e.stopPropagation(),ed()>=25)return!1;let i=e.target;if(i){R(t);let e=i.getBoundingClientRect(),r=new CustomEvent("editor:toolbar:add-section",{bubbles:!0,detail:{componentUid:j.uid,position:t,top:e.top+e.height/2}});window.dispatchEvent(r),window.addEventListener("editor:close-add-section-popup",eV)}return!1},eT="Section"===j.tag&&!j.isThemeSection&&"STATIC"!==M&&"POST_PURCHASE"!==M&&!j.isShopifySection&&25>eM()&&!X;return e.jsxs(e.Fragment,{children:[!("Section"==j.tag&&Z)&&e.jsxs("div",{"data-toolbar":!0,"data-toolbar-section":"Section"==j.tag,"data-toolbar-theme-section":"Section"==j.tag&&!!w||Z,"data-toolbar-shopify-section":"Section"==j.tag&&!!S,"data-toolbar-limit":eM()>=25||!!X,children:[e.jsxs("div",{"data-toolbar-show-parent":!0,onClick:e=>eP(e),"aria-hidden":"true",children:[ev&&e.jsx("div",{className:"gp-hidden gp-w-[12px] interaction-use-custom-element",children:e.jsx("svg",{width:"12",height:"13",viewBox:"0 0 12 13",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M4.36799 0.430523C4.51596 0.205675 4.76709 0.0703125 5.03626 0.0703125H9.88576C10.2042 0.0703125 10.395 0.424378 10.2198 0.69034L8.36968 3.4992C8.28209 3.63218 8.37747 3.80922 8.53671 3.80922H10.749C11.1111 3.80922 11.2869 4.25204 11.0233 4.50036L3.03971 12.0217C2.7572 12.2878 2.29932 12.0361 2.37262 11.655L3.27994 6.93698C3.30366 6.81364 3.20915 6.69921 3.08354 6.69921H0.984651C0.66625 6.69921 0.475479 6.34529 0.650515 6.07932L4.36799 0.430523Z",fill:"#F9F9F9"})})}),ef&&e.jsx("div",{className:"gp-hidden gp-w-[14px] interaction-use-custom-element",children:e.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M7.32785 3.66159C7.87459 3.58351 8.25451 3.077 8.17643 2.53026C8.09836 1.98353 7.59184 1.6036 7.0451 1.68168C3.92866 2.12673 1.5332 4.80488 1.5332 8.04424C1.5332 11.594 4.41085 14.4716 7.9606 14.4716C11.1706 14.4716 13.8294 12.1194 14.3105 9.04446C14.3959 8.49881 14.0227 7.98727 13.4771 7.9019C12.9314 7.81654 12.4199 8.18967 12.3345 8.73531C12.0034 10.852 10.1702 12.4716 7.9606 12.4716C5.51541 12.4716 3.5332 10.4894 3.5332 8.04424C3.5332 5.81431 5.18273 3.96793 7.32785 3.66159ZM10.3432 1.97548C10.6232 1.69551 11.102 1.83654 11.1855 2.22355L11.6106 4.19339C11.6313 4.28936 11.7063 4.36432 11.8023 4.38503L13.7721 4.81013C14.1591 4.89365 14.3001 5.37247 14.0202 5.65243L12.3432 7.32945C12.1244 7.54819 11.8168 7.65338 11.5099 7.61436L10.1528 7.44178C9.84592 7.40276 9.53827 7.50795 9.31953 7.72669L8.66719 8.37903C8.35477 8.69145 7.86633 8.70954 7.57623 8.41943C7.28613 8.12933 7.30421 7.64089 7.61663 7.32847L8.26898 6.67613C8.48771 6.45739 8.5929 6.14974 8.55388 5.84287L8.38131 4.48575C8.34228 4.17888 8.44748 3.87123 8.66621 3.6525L10.3432 1.97548ZM8.19853 5.1916C8.35319 5.72179 8.04877 6.27697 7.51858 6.43163C6.83078 6.63226 6.32988 7.2683 6.32988 8.01873C6.32988 8.9316 7.06991 9.67164 7.98279 9.67164C8.73014 9.67164 9.36406 9.17486 9.56743 8.49131C9.72492 7.96195 10.2817 7.6605 10.8111 7.81799C11.3404 7.97548 11.6419 8.53227 11.4844 9.06163C11.0356 10.57 9.63916 11.6716 7.98279 11.6716C5.96535 11.6716 4.32988 10.0362 4.32988 8.01873C4.32988 6.35558 5.44054 4.95445 6.95851 4.51165C7.4887 4.35699 8.04387 4.66141 8.19853 5.1916Z",fill:"#F9F9F9"})})}),U&&ex&&e.jsx("div",{"data-toolbar-icon-drag":!0,children:e.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:[e.jsx("path",{d:"M5.5 4.5C6.32843 4.5 7 3.82843 7 3C7 2.17157 6.32843 1.5 5.5 1.5C4.67157 1.5 4 2.17157 4 3C4 3.82843 4.67157 4.5 5.5 4.5Z",fill:"currentColor"}),e.jsx("path",{d:"M5.5 9.5C6.32843 9.5 7 8.82843 7 8C7 7.17157 6.32843 6.5 5.5 6.5C4.67157 6.5 4 7.17157 4 8C4 8.82843 4.67157 9.5 5.5 9.5Z",fill:"currentColor"}),e.jsx("path",{d:"M7 13C7 13.8284 6.32843 14.5 5.5 14.5C4.67157 14.5 4 13.8284 4 13C4 12.1716 4.67157 11.5 5.5 11.5C6.32843 11.5 7 12.1716 7 13Z",fill:"currentColor"}),e.jsx("path",{d:"M10.5 4.5C11.3284 4.5 12 3.82843 12 3C12 2.17157 11.3284 1.5 10.5 1.5C9.67157 1.5 9 2.17157 9 3C9 3.82843 9.67157 4.5 10.5 4.5Z",fill:"currentColor"}),e.jsx("path",{d:"M12 8C12 8.82843 11.3284 9.5 10.5 9.5C9.67157 9.5 9 8.82843 9 8C9 7.17157 9.67157 6.5 10.5 6.5C11.3284 6.5 12 7.17157 12 8Z",fill:"currentColor"}),e.jsx("path",{d:"M10.5 14.5C11.3284 14.5 12 13.8284 12 13C12 12.1716 11.3284 11.5 10.5 11.5C9.67157 11.5 9 12.1716 9 13C9 13.8284 9.67157 14.5 10.5 14.5Z",fill:"currentColor"})]})}),"Section"==j.tag?e.jsxs("div",{"data-toolbar-name":!0,children:[(()=>{if(S)return j.name?.includes("Shopify section:")?`${b("Shopify section")}: ${j.name.replace("Shopify section:","")}`:`${b("Shopify section")}: ${j.name}`;let e=j.name&&j.name===`Section ${j.uid}`;return ed()>=20?`${e?b("Section"):j?.name} ${eM()+1}/25`:e?`${b("Section")} ${eM()+1}`:j?.name})(),U&&S&&!j.isShopifyVisibility&&e.jsxs("svg",{"data-toolbar-visibility":!0,width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[e.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M13.1252 9.99773C13.1243 8.27226 11.7248 6.87423 9.99935 6.87506C8.27386 6.87561 6.87518 8.27455 6.87518 10.0001C6.87518 11.7259 8.27429 13.1251 10.0002 13.1251C11.7257 13.1251 13.125 11.727 13.1252 10.0011V9.99773ZM9.99985 8.12506C11.035 8.12451 11.8746 8.96322 11.8752 9.99839V10.0004C11.8752 11.0357 11.0359 11.8751 10.0002 11.8751C8.96465 11.8751 8.12518 11.0356 8.12518 10.0001C8.12518 8.96472 8.96451 8.12533 9.99985 8.12506Z",fill:"#F9F9F9"}),e.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M9.99885 4.37593C5.66421 4.37604 2.80603 7.64523 1.79548 9.00983C1.35636 9.60279 1.35918 10.4 1.80012 10.9902C2.81706 12.3514 5.69374 15.6241 9.99886 15.6241C14.3806 15.6241 17.2194 12.3452 18.2168 10.9808C18.6473 10.392 18.6442 9.60472 18.211 9.01902C17.2056 7.65938 14.3429 4.37583 9.99885 4.37593ZM2.80002 9.75374C3.77049 8.44326 6.30207 5.62602 9.99888 5.62593C13.7041 5.62585 16.24 8.45598 17.206 9.76225C17.3146 9.9091 17.3149 10.0965 17.2077 10.2431C16.254 11.5477 13.7416 14.3741 9.99886 14.3741C6.33149 14.3741 3.78173 11.5541 2.80152 10.242C2.69021 10.0931 2.69001 9.90229 2.80002 9.75374Z",fill:"#F9F9F9"}),e.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M18.0763 3.26988C18.3415 3.58809 18.2985 4.06101 17.9803 4.32619L2.98032 16.8262C2.66211 17.0914 2.18919 17.0484 1.92402 16.7302C1.65884 16.412 1.70184 15.939 2.02004 15.6739L17.02 3.17385C17.3383 2.90868 17.8112 2.95167 18.0763 3.26988Z",fill:"#F9F9F9"})]})]}):e.jsx("div",{"data-toolbar-name":!0,children:b(j.customLabel||j.label)}),U&&"Section"!==j.tag&&T.length>0&&e.jsx("div",{"data-toolbar-icon-parent":!0,"data-toolbar-icon-parent-open":E,children:e.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:e.jsx("path",{d:"M5.65522 10C5.07265 10 4.7809 9.22865 5.19284 8.77753L7.53762 6.20974C7.79298 5.93009 8.20702 5.93009 8.46238 6.20974L10.8072 8.77754C11.2191 9.22866 10.9274 10 10.3448 10H5.65522Z",fill:"currentColor"})})})]}),U&&E&&T.map((t,i)=>e.jsxs("div",{"data-toolbar-parent":!0,"data-component-tag":t.tag,"data-parent-uid":t.uid,"data-toolbar-theme-section":Z,"data-toolbar-parent-revert":V,style:{top:V?`${36*(i+1)}px`:`${-36*(i+1)}px`},children:[e.jsx("div",{"data-toolbar-icon-drag":!0,children:e.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:[e.jsx("path",{d:"M5.5 4.5C6.32843 4.5 7 3.82843 7 3C7 2.17157 6.32843 1.5 5.5 1.5C4.67157 1.5 4 2.17157 4 3C4 3.82843 4.67157 4.5 5.5 4.5Z",fill:"currentColor"}),e.jsx("path",{d:"M5.5 9.5C6.32843 9.5 7 8.82843 7 8C7 7.17157 6.32843 6.5 5.5 6.5C4.67157 6.5 4 7.17157 4 8C4 8.82843 4.67157 9.5 5.5 9.5Z",fill:"currentColor"}),e.jsx("path",{d:"M7 13C7 13.8284 6.32843 14.5 5.5 14.5C4.67157 14.5 4 13.8284 4 13C4 12.1716 4.67157 11.5 5.5 11.5C6.32843 11.5 7 12.1716 7 13Z",fill:"currentColor"}),e.jsx("path",{d:"M10.5 4.5C11.3284 4.5 12 3.82843 12 3C12 2.17157 11.3284 1.5 10.5 1.5C9.67157 1.5 9 2.17157 9 3C9 3.82843 9.67157 4.5 10.5 4.5Z",fill:"currentColor"}),e.jsx("path",{d:"M12 8C12 8.82843 11.3284 9.5 10.5 9.5C9.67157 9.5 9 8.82843 9 8C9 7.17157 9.67157 6.5 10.5 6.5C11.3284 6.5 12 7.17157 12 8Z",fill:"currentColor"}),e.jsx("path",{d:"M10.5 14.5C11.3284 14.5 12 13.8284 12 13C12 12.1716 11.3284 11.5 10.5 11.5C9.67157 11.5 9 12.1716 9 13C9 13.8284 9.67157 14.5 10.5 14.5Z",fill:"currentColor"})]})}),e.jsx("div",{"data-toolbar-name":!0,children:eZ(t)})]},t.uid)),U&&!eg&&e.jsxs(e.Fragment,{children:[e.jsx(m.default,{...j}),e.jsx(g.AIAssistant,{uid:j.uid,tag:j.tag}),eT&&e.jsx(o.CreateThemeSection,{...j}),(()=>{let{isShopifySection:e,tag:t}=j;return!e&&(!w||!!Z)&&u.ableGenerateContentElements.includes(t)&&!X})()&&e.jsx(C.AIContentGenerator,{...j}),"Sticky"==j.tag&&e.jsx("div",{"data-toolbar-zoom-out":!0,onClick:e=>eH(e),"aria-hidden":"true",children:e.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M14.5 7C14.7761 7 15 6.77614 15 6.5C15 6.22386 14.7761 6 14.5 6L10.7072 6L14.8536 1.85355C15.0489 1.65829 15.0489 1.34171 14.8536 1.14645C14.6584 0.951186 14.3418 0.951185 14.1465 1.14645L10 5.29297L10 1.5C10 1.22386 9.77614 1 9.5 1C9.22386 1 9 1.22386 9 1.5L9 6.5C9 6.77614 9.22386 7 9.5 7L14.5 7ZM6 10.7073L6 14.5C6 14.7761 6.22386 15 6.5 15C6.77614 15 7 14.7761 7 14.5L7 9.5C7 9.22386 6.77614 9 6.5 9H1.5C1.22386 9 1 9.22386 1 9.5C1 9.77614 1.22386 10 1.5 10H5.29306L1.14662 14.1464C0.951353 14.3417 0.951353 14.6583 1.14662 14.8536C1.34188 15.0488 1.65846 15.0488 1.85372 14.8536L6 10.7073Z",fill:"currentColor"})})}),en.includes(j.tag)&&e.jsx(l.default,{"data-toolbar-title":!0,enable:!0,"data-toolbar-disable":!1,text:b("Edit content in Shopify"),position:"top",onClick:()=>{if(el.includes(j.tag)){window.open(ep,"_blank");return}if(eo.includes(j.tag)){window.open(eh,"_blank");return}window.open(ec,"_blank")},"aria-hidden":"true",children:e.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[e.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8.61129 2.47348C8.61129 2.47348 8.47099 2.51557 8.23248 2.59274C8.19039 2.46647 8.13427 2.30512 8.05009 2.15079C7.78352 1.6387 7.39068 1.37212 6.91366 1.36511C6.87858 1.36511 6.85052 1.36511 6.81545 1.37212C6.80843 1.36511 6.80142 1.35634 6.7944 1.34757C6.78739 1.3388 6.78037 1.33003 6.77336 1.32302C6.56992 1.09854 6.30335 0.993314 5.98768 1.00033C5.37737 1.02137 4.76706 1.46332 4.269 2.249C3.91825 2.80319 3.65869 3.49767 3.58153 4.03082C3.38823 4.09074 3.21092 4.14586 3.05516 4.19429C2.64595 4.32151 2.3851 4.40261 2.37494 4.40261C2.01718 4.51485 2.01016 4.52888 1.96106 4.85859C1.92598 5.11113 1 12.2945 1 12.2945L7.14764 13.3583C7.18955 13.118 7.30454 12.8953 7.47848 12.7214L8.70249 11.4974V2.45945C8.66741 2.45945 8.63234 2.46647 8.61129 2.47348ZM6.82948 3.02767L6.62554 3.09101C6.27515 3.19989 5.90094 3.31617 5.5317 3.42752C5.65797 2.94349 5.89648 2.46647 6.19111 2.15079C6.30335 2.03154 6.45067 1.90527 6.63306 1.8281C6.80142 2.18587 6.83649 2.68393 6.82948 3.02767ZM5.99469 1.4072C6.13499 1.4072 6.26126 1.43526 6.36649 1.50541C6.19813 1.58959 6.0438 1.71586 5.88947 1.87721C5.50364 2.29109 5.202 2.94349 5.08274 3.56783C4.74459 3.66991 4.41804 3.77199 4.10838 3.8688L4.01646 3.89753C4.22691 2.90841 5.05468 1.43526 5.99469 1.4072ZM4.80214 7.0122C4.81874 7.26957 5.09737 7.44833 5.43473 7.66478C5.95252 7.99699 6.60867 8.41798 6.66813 9.3482C6.7453 10.5548 6.02977 11.3826 4.99154 11.4457C3.7569 11.5229 3.06943 10.7933 3.06943 10.7933L3.32899 9.67791C3.32899 9.67791 4.01646 10.197 4.56363 10.1619C4.92139 10.1409 5.04767 9.84627 5.04065 9.64283C5.01607 9.26796 4.73308 9.06671 4.41569 8.84101C4.00848 8.55142 3.54465 8.22157 3.49735 7.4331C3.42018 6.24756 4.19885 5.05501 5.91051 4.94277C6.57694 4.90068 6.91366 5.06904 6.91366 5.06904L6.52082 6.53518C6.52082 6.53518 6.08589 6.33876 5.56678 6.36682C4.80915 6.41592 4.79512 6.89294 4.80214 7.0122ZM7.23635 2.9014C7.22934 2.59274 7.19426 2.15781 7.04695 1.78601C7.50994 1.87721 7.74143 2.39632 7.83964 2.71199C7.70008 2.75665 7.54275 2.80575 7.37118 2.8593L7.23635 2.9014Z",fill:"currentColor"}),e.jsx("path",{d:"M10.7719 3.44156C10.7757 3.47543 11.1733 6.16931 11.541 8.65883L8.95503 11.2448V2.57871C9.16548 2.78214 9.71265 3.31528 9.71265 3.31528C9.71265 3.31528 10.6106 3.32931 10.6597 3.33633C10.7088 3.34334 10.7649 3.37842 10.7719 3.44156Z",fill:"currentColor"}),e.jsx("path",{d:"M14.8056 8.644L14.0424 7.88088C13.7832 7.62163 13.3629 7.62163 13.1036 7.88088L12.1519 8.83258L13.8539 10.5345L14.8056 9.58282C15.0648 9.32357 15.0648 8.90325 14.8056 8.644Z",fill:"currentColor"}),e.jsx("path",{d:"M7.85018 13.0942L11.6419 9.30246L13.3438 11.0044L9.55212 14.7961C9.43782 14.9104 9.28573 14.9791 9.1244 14.9892L7.93427 15.0641C7.73484 15.0767 7.56961 14.9114 7.58216 14.712L7.65706 13.5219C7.66721 13.3606 7.73588 13.2085 7.85018 13.0942Z",fill:"currentColor"})]})}),e.jsx(l.default,{enable:"Section"==j.tag&&ed()>=25||S,text:S?b("Available in the Shopify theme editor"):b("Page has reached Shopify’s 25 section-limit"),position:"bottom",width:"200px","data-toolbar-duplicate":!0,"data-toolbar-disable":eb,onClick:eb?void 0:e=>eE(e),"aria-hidden":"true",className:eb?"!gp-cursor-not-allowed":"",children:e.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:e.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M6.08423 1.21289C5.53194 1.21289 5.08423 1.66061 5.08423 2.21289V3.78711H4.26172C3.43329 3.78711 2.76172 4.45868 2.76172 5.28711V13.2871C2.76172 14.1155 3.43329 14.7871 4.26172 14.7871H10.2617C11.0901 14.7871 11.7617 14.1155 11.7617 13.2871V12.4629H13.0842C13.6365 12.4629 14.0842 12.0152 14.0842 11.4629V2.21289C14.0842 1.66061 13.6365 1.21289 13.0842 1.21289H6.08423ZM10.7617 12.4629H6.08423C5.53194 12.4629 5.08423 12.0152 5.08423 11.4629V4.78711H4.26172C3.98558 4.78711 3.76172 5.01097 3.76172 5.28711V13.2871C3.76172 13.5633 3.98558 13.7871 4.26172 13.7871H10.2617C10.5379 13.7871 10.7617 13.5633 10.7617 13.2871V12.4629Z",fill:"currentColor"})})}),e.jsx(l.default,{"data-toolbar-delete":!0,onClick:e=>ej?null:eR(e),enable:ej,"data-toolbar-disable":ej,text:S?b("Available in the Shopify theme editor"):z.text,width:z.width,position:S?"bottom":k,"aria-hidden":"true",className:ej?"!gp-cursor-not-allowed":"",children:e.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:e.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M11 2.88965V2.38965C11 1.56122 10.3284 0.889648 9.5 0.889648H6.5C5.67157 0.889648 5 1.56122 5 2.38965V2.88965H2C1.72386 2.88965 1.5 3.11351 1.5 3.38965C1.5 3.66579 1.72386 3.88965 2 3.88965H3.21997V13.1099C3.21997 14.2144 4.1154 15.1099 5.21997 15.1099H11.22C12.3245 15.1099 13.22 14.2144 13.22 13.1099V3.88965H14C14.2761 3.88965 14.5 3.66579 14.5 3.38965C14.5 3.11351 14.2761 2.88965 14 2.88965H11ZM6 2.88965H10V2.38965C10 2.11351 9.77614 1.88965 9.5 1.88965H6.5C6.22386 1.88965 6 2.11351 6 2.38965V2.88965ZM6.24976 6.13965C6.66397 6.13965 6.99976 6.47543 6.99976 6.88965V11.3896C6.99976 11.8039 6.66397 12.1396 6.24976 12.1396C5.83554 12.1396 5.49976 11.8039 5.49976 11.3896V6.88965C5.49976 6.47543 5.83554 6.13965 6.24976 6.13965ZM10.4998 6.88965C10.4998 6.47543 10.164 6.13965 9.74976 6.13965C9.33554 6.13965 8.99976 6.47543 8.99976 6.88965V11.3896C8.99976 11.8039 9.33554 12.1396 9.74976 12.1396C10.164 12.1396 10.4998 11.8039 10.4998 11.3896V6.88965Z",fill:"currentColor"})})})]}),e.jsx(h.InteractionSuffix,{uid:j.uid})]},j.uid),"STATIC"!==M&&"POST_PURCHASE"!==M&&25>eM()&&e.jsx(a.ThemeSectionStatusWrapper,{...j}),e.jsx("div",{"data-outline":!0,"data-outline-section":"Section"==j.tag,"data-outline-theme-section":"Section"==j.tag&&!!w||Z,"data-outline-shopify-section":"Section"==j.tag&&!!S,"data-outline-limit":ey,"data-outline-error":!!X},"outline-"+j.uid),"Section"==j.tag&&!Z&&e.jsxs(e.Fragment,{children:[e.jsx(l.default,{enable:ed()>=25,text:b("Page has reached Shopify’s 25 section-limit"),position:"top","data-toolbar-add-top":!0,"data-toolbar-disable":ed()>=25,"data-toolbar-add-open":"above"==P,onClick:e=>eA(e,"above"),"aria-hidden":"true",children:e.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:e.jsx("path",{d:"M8.45 3.95C8.45 3.70147 8.24853 3.5 8 3.5C7.75147 3.5 7.55 3.70147 7.55 3.95V7.55H3.95C3.70147 7.55 3.5 7.75147 3.5 8C3.5 8.24853 3.70147 8.45 3.95 8.45H7.55V12.05C7.55 12.2985 7.75147 12.5 8 12.5C8.24853 12.5 8.45 12.2985 8.45 12.05V8.45H12.05C12.2985 8.45 12.5 8.24853 12.5 8C12.5 7.75147 12.2985 7.55 12.05 7.55H8.45V3.95Z",fill:"#212121"})})}),e.jsx(l.default,{enable:ed()>=25,text:b("Page has reached Shopify’s 25 section-limit"),position:"top","data-toolbar-add-bottom":!0,"data-toolbar-disable":ed()>=25,"data-toolbar-add-open":"below"==P,onClick:e=>eA(e,"below"),"aria-hidden":"true",children:e.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:e.jsx("path",{d:"M8.45 3.95C8.45 3.70147 8.24853 3.5 8 3.5C7.75147 3.5 7.55 3.70147 7.55 3.95V7.55H3.95C3.70147 7.55 3.5 7.75147 3.5 8C3.5 8.24853 3.70147 8.45 3.95 8.45H7.55V12.05C7.55 12.2985 7.75147 12.5 8 12.5C8.24853 12.5 8.45 12.2985 8.45 12.05V8.45H12.05C12.2985 8.45 12.5 8.24853 12.5 8C12.5 7.75147 12.2985 7.55 12.05 7.55H8.45V3.95Z",fill:"#212121"})})})]}),X&&e.jsx(n.SectionErrorBanner,{errorSectionInfo:X,onDismiss:eq}),u.ableGenerateContentElements.includes(j.tag)&&U&&e.jsx(c.AIGenContentLoading,{...j}),U&&e.jsx(s.default,{...j})]})});exports.default=j;
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime");require("react"),require("zustand");var r=require("../../contexts/I18nContext.js");require("react-transition-group"),require("swr"),require("swr/infinite"),require("../../graphql/queries/collection-detail-filter.generated.js"),require("../../graphql/queries/collection.generated.js"),require("../../graphql/queries/collections.generated.js"),require("../../graphql/queries/published-theme-pages.generated.js"),require("../../graphql/queries/products.generated.js"),require("../../graphql/queries/store-property.generated.js"),require("../../graphql/queries/preview-page.generated.js"),require("../../graphql/queries/published-shop-metas.generated.js"),require("../../graphql/queries/shop-shopify.generated.js"),require("../../graphql/queries/articles.generated.js"),require("../../graphql/queries/blogs.generated.js"),require("../../graphql/queries/products-with-selling-plans.generated.js"),require("../../graphql/queries/product-variant-with-selling-plans.generated.js"),require("../../graphql/queries/product-little-detail.generated.js"),require("../../graphql/queries/product-medias.generated.js"),require("../../graphql/queries/product-variants.generated.js"),require("classnames"),require("dayjs"),require("@gem-sdk/core");var s=require("./icons.js");require("../../helpers/convert.js"),require("crc-32"),require("@gem-sdk/adapter-shopify"),require("swr/mutation"),require("vanilla-lazyload"),require("../../hooks/useCartUI.js"),require("../../graphql/queries/product-value-label.generated.js"),require("../../hooks/useStickyStore.js"),require("../../types/builder.js"),require("../../types/builderUpsell.js"),require("../../types/custom.js"),require("../../types/animations.js"),exports.default=({isLoading:i,isUpdated:a,onUpgrade:t})=>{let{t:l}=r.useI18nStore(),u={old:{icon:e.jsx(s.CircleUpIcon,{}),label:l("Upgrade"),className:"gp-relative",showDot:!0},loading:{icon:e.jsx(s.LoadingIcon,{}),label:"",className:"gp-animate-spin gp-ease-in-out gp-px-6",showDot:!1},updated:{icon:e.jsx(s.CheckMarkIcon,{}),label:l("Updated"),className:"",showDot:!1}},p=u[i?"loading":a?"updated":"old"];return e.jsxs("button",{disabled:i,"data-toolbar-upgrade-element":"true",className:"gp-flex gp-gap-[6px] gp-items-center hover:gp-bg-[#3B3B3B] gp-font-medium disabled:gp-opacity-60 disabled:gp-cursor-not-allowed ",onClick:t,children:[e.jsx("div",{className:`gp-shrink-0 gp-overflow-hidden ${p.className}`,children:p.icon}),p.showDot&&e.jsx("div",{className:"gp-absolute gp-left-[10px] gp-top-[-2px] gp-size-4 gp-overflow-hidden",children:e.jsx("div",{className:"gp-absolute gp-inset-1/4 gp-rounded-full gp-bg-[#3C67FF]"})}),p.label&&e.jsx("span",{className:"gp-text-[12px] gp-leading-5 gp-text-[#F9F9F9] gp-whitespace-nowrap",children:p.label})]})};
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),r=require("react");require("zustand");var s=require("../../contexts/PageContext.js");require("react-transition-group");var i=require("../constant.js");require("swr"),require("swr/infinite"),require("../../graphql/queries/collection-detail-filter.generated.js"),require("../../graphql/queries/collection.generated.js"),require("../../graphql/queries/collections.generated.js"),require("../../graphql/queries/published-theme-pages.generated.js"),require("../../graphql/queries/products.generated.js"),require("../../graphql/queries/store-property.generated.js"),require("../../graphql/queries/preview-page.generated.js"),require("../../graphql/queries/published-shop-metas.generated.js"),require("../../graphql/queries/shop-shopify.generated.js"),require("../../graphql/queries/articles.generated.js"),require("../../graphql/queries/blogs.generated.js"),require("../../graphql/queries/products-with-selling-plans.generated.js"),require("../../graphql/queries/product-variant-with-selling-plans.generated.js"),require("../../graphql/queries/product-little-detail.generated.js"),require("../../graphql/queries/product-medias.generated.js"),require("../../graphql/queries/product-variants.generated.js"),require("classnames"),require("dayjs"),require("@gem-sdk/core");var t=require("./UpgradeButton.js");require("../../helpers/convert.js"),require("crc-32"),require("@gem-sdk/adapter-shopify"),require("swr/mutation"),require("vanilla-lazyload"),require("../../hooks/useCartUI.js"),require("../../graphql/queries/product-value-label.generated.js"),require("../../hooks/useStickyStore.js"),require("../../types/builder.js"),require("../../types/builderUpsell.js"),require("../../types/custom.js"),require("../../types/animations.js"),exports.default=({tag:u,uid:a})=>{let[q,l]=r.useState(!1),o=s.usePageStore(e=>e.oldElements),n=r.useMemo(()=>!!a&&(o?.some(e=>e.uid===a)??!1),[o,a]),d=r.useMemo(()=>n&&!!u&&!i.oldElementTags.includes(u),[n,u]),p=r.useCallback(e=>{e.preventDefault(),e.stopPropagation(),l(!0),window.dispatchEvent(new CustomEvent("editor:toolbar:upgrade-old-element",{bubbles:!0,detail:{componentUid:a,fromTag:u}}))},[u,a]);return(r.useEffect(()=>{d&&l(!1)},[d]),u&&a&&n)?e.jsx(t.default,{isLoading:q,isUpdated:d,onUpgrade:p}):null};
@@ -0,0 +1,2 @@
1
+ 'use client';
2
+ "use strict";var C=require("react/jsx-runtime");exports.CheckMarkIcon=()=>C.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:C.jsx("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M12.6241 4.77571C12.8584 5.01003 12.8584 5.38993 12.6241 5.62424L7.42407 10.8242C7.18975 11.0586 6.80986 11.0586 6.57554 10.8242L3.97554 8.22424C3.74123 7.98993 3.74123 7.61003 3.97554 7.37571C4.20986 7.1414 4.58975 7.1414 4.82407 7.37571L6.9998 9.55145L11.7755 4.77571C12.0099 4.5414 12.3898 4.5414 12.6241 4.77571Z",fill:"#F9F9F9"})}),exports.CircleUpIcon=()=>C.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",children:[C.jsx("path",{d:"M6.50098 4.6583L6.50098 10.5366C6.50098 10.8128 6.72483 11.0366 7.00098 11.0366C7.27712 11.0366 7.50098 10.8128 7.50098 10.5366L7.50098 4.65845L9.01147 6.16738C9.20683 6.36254 9.52341 6.36237 9.71857 6.16701C9.91374 5.97165 9.91357 5.65506 9.71821 5.4599L7.3595 3.10364C7.33765 3.08116 7.3137 3.06073 7.28797 3.04266C7.27238 3.03172 7.25613 3.02164 7.23931 3.0125C7.16846 2.97401 7.08727 2.95215 7.00098 2.95215C6.94395 2.95215 6.88916 2.96169 6.8381 2.97928C6.76849 3.00319 6.7031 3.0429 6.64753 3.09841L4.28359 5.4599C4.08823 5.65506 4.08807 5.97165 4.28323 6.16701C4.47839 6.36237 4.79497 6.36254 4.99033 6.16738L6.50098 4.6583Z",fill:"#F9F9F9"}),C.jsx("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M0 6.9941C0 3.13088 3.13487 0 7.00083 0C10.8668 0 14.0017 3.13088 14.0017 6.9941C14.0017 10.8573 10.8668 13.9882 7.00083 13.9882C3.13487 13.9882 0 10.8573 0 6.9941ZM7.00083 1C3.68617 1 1 3.68414 1 6.9941C1 10.3041 3.68617 12.9882 7.00083 12.9882C10.3155 12.9882 13.0017 10.3041 13.0017 6.9941C13.0017 3.68414 10.3155 1 7.00083 1Z",fill:"#F9F9F9"})]}),exports.LoadingIcon=()=>C.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:C.jsx("path",{d:"M8 11.5C8.27614 11.5 8.5 11.7239 8.5 12V14.5C8.5 14.7761 8.27614 15 8 15C7.72386 15 7.5 14.7761 7.5 14.5V12C7.5 11.7239 7.72386 11.5 8 11.5ZM4.81836 10.4746C5.01355 10.2795 5.33013 10.2796 5.52539 10.4746C5.72063 10.6699 5.72059 10.9864 5.52539 11.1816L3.75781 12.9502C3.56261 13.1451 3.24598 13.1451 3.05078 12.9502C2.85552 12.7549 2.85552 12.4374 3.05078 12.2422L4.81836 10.4746ZM10.4746 10.4746C10.6699 10.2796 10.9865 10.2795 11.1816 10.4746L12.9492 12.2422C13.1445 12.4374 13.1445 12.7549 12.9492 12.9502C12.754 13.1451 12.4374 13.1451 12.2422 12.9502L10.4746 11.1816C10.2794 10.9864 10.2794 10.6699 10.4746 10.4746ZM4 7.5C4.27614 7.5 4.5 7.72386 4.5 8C4.5 8.27614 4.27614 8.5 4 8.5H1.5C1.22386 8.5 1 8.27614 1 8C1 7.72386 1.22386 7.5 1.5 7.5H4ZM14.5 7.5C14.7761 7.5 15 7.72386 15 8C15 8.27614 14.7761 8.5 14.5 8.5H12C11.7239 8.5 11.5 8.27614 11.5 8C11.5 7.72386 11.7239 7.5 12 7.5H14.5ZM3.0498 3.0498C3.24501 2.85487 3.56164 2.85487 3.75684 3.0498L5.52441 4.81836C5.71962 5.01363 5.71966 5.33015 5.52441 5.52539C5.32915 5.72039 5.01257 5.72052 4.81738 5.52539L3.0498 3.75781C2.85454 3.56255 2.85454 3.24507 3.0498 3.0498ZM12.2432 3.0498C12.4384 2.85487 12.755 2.85487 12.9502 3.0498C13.1455 3.24507 13.1455 3.56255 12.9502 3.75781L11.1826 5.52539C10.9874 5.72052 10.6708 5.72039 10.4756 5.52539C10.2803 5.33015 10.2804 5.01363 10.4756 4.81836L12.2432 3.0498ZM8 1C8.27614 1 8.5 1.22386 8.5 1.5V4C8.5 4.27614 8.27614 4.5 8 4.5C7.72386 4.5 7.5 4.27614 7.5 4V1.5C7.5 1.22386 7.72386 1 8 1Z",fill:"#F9F9F9"})});
@@ -1,2 +1,2 @@
1
1
  'use client';
2
- "use strict";var e=require("react/jsx-runtime"),t=require("react"),a=require("zustand");const i=t.createContext(null),n=e=>a.createStore((t,a)=>({...e,lazyloadSectionMeta:e.lazyloadSectionMeta??!0,setAssignedProductIds:e=>{t({assignedProductIds:e})},setIsApplyAllProducts:e=>{t({isApplyAllProducts:e})},setDynamicProduct:e=>{t({dynamicProduct:e})},setDynamicCollection:e=>{t({dynamicCollection:e})},setPostPurchaseProductOffers:e=>{t({productOffers:e})},setDynamicDiscountOffer:e=>{t({dynamicDiscountOffer:e})},setSalePageProductId:e=>{t({salePageProductId:e})},setPublicStoreFrontData:e=>{t({publicStoreFrontData:e})},setInteractionIsSelectOnPage:e=>{t(t=>({interactionData:{...t.interactionData,isSelectOnPage:e}}))},setInteractionItem:e=>{t(t=>({interactionData:{...t.interactionData,item:e,isSelectOnPage:t.interactionData?.isSelectOnPage||!1}}))},setInteractionSelectType:e=>{t(t=>({interactionData:{...t.interactionData,selectType:e}}))},setInteractionSettingType:e=>{t(t=>({interactionData:{...t.interactionData,settingType:e}}))},setSidebarMode:e=>{t(()=>({sidebarMode:e}))},setSellingPlanMeta:e=>{t({sellingPlanMeta:e})},setLazyloadSectionMeta:e=>{t({lazyloadSectionMeta:e})},setBuyerConsentChecked:e=>{t({buyerConsentChecked:e})},getBuyerConsentChecked:()=>a().buyerConsentChecked,setSubscriptionVisible:e=>{t({subscriptionVisible:e})},getSubscriptionVisible:()=>a().subscriptionVisible}));exports.PageProvider=({children:a,dynamicProduct:r,dynamicCollection:s,productOffers:o,dynamicDiscountOffer:c,publicStoreFrontData:l,assignedProductIds:u,isApplyAllProducts:d,sellingPlanMeta:P,lazyloadSectionMeta:S,buyerConsentChecked:y,...g})=>{let D=t.useMemo(()=>n({dynamicProduct:r,dynamicCollection:s,productOffers:o,assignedProductIds:u,isApplyAllProducts:d,dynamicDiscountOffer:c,publicStoreFrontData:l,interactionData:{selectType:"ELEMENT"},sellingPlanMeta:P,lazyloadSectionMeta:S,buyerConsentChecked:y}),[r,s,o,c,l,u,d,P,S,y]);return e.jsx(i.Provider,{...g,value:D,children:a})},exports.usePageStore=(e,n)=>{let r=t.useContext(i);if(!r)throw Error("usePageStore must be used within a PageProvider");return a.useStore(r,e,n)};
2
+ "use strict";var e=require("react/jsx-runtime"),t=require("react"),a=require("zustand");const i=t.createContext(null),n=e=>a.createStore((t,a)=>({...e,lazyloadSectionMeta:e.lazyloadSectionMeta??!0,setAssignedProductIds:e=>{t({assignedProductIds:e})},setIsApplyAllProducts:e=>{t({isApplyAllProducts:e})},setDynamicProduct:e=>{t({dynamicProduct:e})},setDynamicCollection:e=>{t({dynamicCollection:e})},setPostPurchaseProductOffers:e=>{t({productOffers:e})},setDynamicDiscountOffer:e=>{t({dynamicDiscountOffer:e})},setSalePageProductId:e=>{t({salePageProductId:e})},setPublicStoreFrontData:e=>{t({publicStoreFrontData:e})},setInteractionIsSelectOnPage:e=>{t(t=>({interactionData:{...t.interactionData,isSelectOnPage:e}}))},setInteractionItem:e=>{t(t=>({interactionData:{...t.interactionData,item:e,isSelectOnPage:t.interactionData?.isSelectOnPage||!1}}))},setInteractionSelectType:e=>{t(t=>({interactionData:{...t.interactionData,selectType:e}}))},setInteractionSettingType:e=>{t(t=>({interactionData:{...t.interactionData,settingType:e}}))},setOldElements:e=>{t({oldElements:e})},setSidebarMode:e=>{t(()=>({sidebarMode:e}))},setSellingPlanMeta:e=>{t({sellingPlanMeta:e})},setLazyloadSectionMeta:e=>{t({lazyloadSectionMeta:e})},setBuyerConsentChecked:e=>{t({buyerConsentChecked:e})},getBuyerConsentChecked:()=>a().buyerConsentChecked,setSubscriptionVisible:e=>{t({subscriptionVisible:e})},getSubscriptionVisible:()=>a().subscriptionVisible}));exports.PageProvider=({children:a,dynamicProduct:r,dynamicCollection:s,productOffers:o,dynamicDiscountOffer:c,publicStoreFrontData:l,assignedProductIds:u,isApplyAllProducts:d,sellingPlanMeta:P,lazyloadSectionMeta:S,buyerConsentChecked:y,...g})=>{let D=t.useMemo(()=>n({dynamicProduct:r,dynamicCollection:s,productOffers:o,assignedProductIds:u,isApplyAllProducts:d,dynamicDiscountOffer:c,publicStoreFrontData:l,interactionData:{selectType:"ELEMENT"},sellingPlanMeta:P,lazyloadSectionMeta:S,buyerConsentChecked:y}),[r,s,o,c,l,u,d,P,S,y]);return e.jsx(i.Provider,{...g,value:D,children:a})},exports.usePageStore=(e,n)=>{let r=t.useContext(i);if(!r)throw Error("usePageStore must be used within a PageProvider");return a.useStore(r,e,n)};
@@ -1 +1 @@
1
- "use strict";const e=e=>!("object"!=typeof e||Array.isArray(e))&&null!==e,t=(e,...t)=>{let r=t[0],s=[];for(let e in r)if(Object.hasOwnProperty.call(r,e)){let t=r[e];["symbol","object","function"].includes(typeof t)||(t?s.push(`${e}="${t}"`):s.push(`${e}`))}return s.join(" ")},r=(e,...t)=>{let r=t[0],s=[];for(let e in r)if(Object.hasOwnProperty.call(r,e)){let t=r[e];void 0!==t&&!1!==t&&s.push(`${e}:${t}`)}return s.join(";")};exports.RenderIf=(e,t,r)=>e?"string"==typeof t?t:t():("string"==typeof r?r:r?.())??"",exports.composeMemo=(e,t)=>e(),exports.dataStringify=e=>JSON.stringify(e).replace(/\\"/g,'"'),exports.props=t,exports.removeUndefinedValuesFromObject=e=>(Object.keys(e).forEach(t=>e?.[t]===void 0&&delete e[t]),e),exports.sanitizeLiquid=function(e){return e.replace(/\{\{\s*(.*?)\s*\}\}/g,(e,t)=>{let r=t.trim(),s=/^([a-zA-Z_][a-zA-Z0-9_-]*)(\.[a-zA-Z0-9_-]+)*$/i.test(r);return s?`{{ ${r} }}`:r})},exports.styles=r,exports.template=(s,...o)=>{let l="";return s.forEach((s,i)=>{l+=s,void 0!==o[i]&&(e(o[i])?/style=["|']/.test(s)?l+=r`${o[i]}`:l+=t`${o[i]}`:l+=o[i])}),l=(l=l.replaceAll('style=""',"")).replaceAll('class=""',"")};
1
+ "use strict";const e=e=>!("object"!=typeof e||Array.isArray(e))&&null!==e,t=(e,...t)=>{let r=t[0],l=[];for(let e in r)if(Object.hasOwnProperty.call(r,e)){let t=r[e];["symbol","object","function"].includes(typeof t)||(t?l.push(`${e}="${t}"`):l.push(`${e}`))}return l.join(" ")},r=/^(.+)-(tablet|mobile)$/,l=e=>"string"==typeof e&&-1!==e.indexOf("undefined"),o=e=>-1!==e.indexOf("undefined"),n=[{shorthand:"radius",parts:["btlr","btrr","bbrr","bblr"]},{shorthand:"p",parts:["pt","pr","pb","pl"]},{shorthand:"m",parts:["mt","mr","mb","ml"]}],i=["--","--hvr-","--focus-"],s=["","-tablet","-mobile"],f=e=>null!=e&&""!==e&&!1!==e&&!l(e),a=e=>{let t={...e};for(let e of i)for(let r of s)for(let l of n){let o=`${e}${l.shorthand}${r}`;if(o in t&&f(t[o]))continue;let n=l.parts.map(t=>`${e}${t}${r}`);if(n.every(e=>f(t[e])))for(let e of(t[o]=n.map(e=>t[e]).join(" "),n))delete t[e]}return t},p=(e,...t)=>{let n=t[0];if(!n)return"";let i=a(n),s=[],f={},p={};for(let e in i){if(!Object.hasOwnProperty.call(i,e))continue;let t=i[e];if(null==t||""===t||!1===t||l(t)||o(e))continue;let n=r.exec(e),s=n?.[1],a=n?.[2];s&&a?"tablet"===a&&(p[s]=t):f[e]=t}for(let e in i){if(!Object.hasOwnProperty.call(i,e))continue;let t=i[e];if(void 0===t||!1===t||null===t||""===t||l(t)||o(e))continue;let n=r.exec(e),a=n?.[1],c=n?.[2];if(a&&"tablet"===c){if(f[a]===t)continue}else if(a&&"mobile"===c){let e=a in p?p[a]:f[a];if(e===t)continue}s.push(`${e}:${t}`)}return s.join(";")};exports.RenderIf=(e,t,r)=>e?"string"==typeof t?t:t():("string"==typeof r?r:r?.())??"",exports.composeMemo=(e,t)=>e(),exports.dataStringify=e=>JSON.stringify(e).replace(/\\"/g,'"'),exports.props=t,exports.removeUndefinedValuesFromObject=e=>(Object.keys(e).forEach(t=>e?.[t]===void 0&&delete e[t]),e),exports.sanitizeLiquid=function(e){return e.replace(/\{\{\s*(.*?)\s*\}\}/g,(e,t)=>{let r=t.trim(),l=/^([a-zA-Z_][a-zA-Z0-9_-]*)(\.[a-zA-Z0-9_-]+)*$/i.test(r);return l?`{{ ${r} }}`:r})},exports.styles=p,exports.template=(r,...l)=>{let o="";return r.forEach((r,n)=>{o+=r,void 0!==l[n]&&(e(l[n])?/style=["|']/.test(r)?o+=p`${l[n]}`:o+=t`${l[n]}`:o+=l[n])}),o=(o=o.replaceAll('style=""',"")).replaceAll('class=""',"")};
@@ -1,2 +1,2 @@
1
1
  'use client';
2
- import{jsxs as e,Fragment as t,jsx as i}from"react/jsx-runtime";import{memo as o,useState as r,useMemo as l,useCallback as n,useEffect as a}from"react";import"zustand";import{useBuilderPreviewStore as d}from"../contexts/BuilderPreviewContext.js";import{usePageStore as s}from"../contexts/PageContext.js";import{CreateThemeSection as C}from"./theme-section/CreateThemeSection.js";import p from"./toolbar/Tooltip.js";import{SectionErrorBanner as c}from"./toolbar/SectionErrorBanner.js";import{ThemeSectionStatusWrapper as u}from"./theme-section/ThemeSectionStatus.js";import h from"./resize/Resize.js";import{usePostPurchase as m}from"../hooks/useToolbarPostPurchase.js";import{ableGenerateContentElements as g,oldElementTags as f}from"./constant.js";import{AIContentGenerator as v}from"./ai-generator/AIContentGenerator.js";import{AIGenContentLoading as b}from"./ai-generator/AIGenContentLoading.js";import{InteractionSuffix as w}from"./InteractionSuffix.js";import{useI18nStore as S}from"@gem-sdk/core";import L from"./upgrade-element/UpgradeOldElement.js";import{AIAssistant as y}from"./ai-assistant/AIAssistant.js";import"swr";import"../graphql/queries/collection-detail-filter.generated.js";import"../graphql/queries/collection.generated.js";import"../graphql/queries/collections.generated.js";import"../graphql/queries/published-theme-pages.generated.js";import"../graphql/queries/products.generated.js";import"../graphql/queries/store-property.generated.js";import"../graphql/queries/preview-page.generated.js";import"../graphql/queries/published-shop-metas.generated.js";import"../graphql/queries/shop-shopify.generated.js";import"../graphql/queries/articles.generated.js";import"../graphql/queries/blogs.generated.js";import"../graphql/queries/products-with-selling-plans.generated.js";import"../graphql/queries/product-variant-with-selling-plans.generated.js";import"../graphql/queries/product-variants.generated.js";import"../graphql/queries/product-little-detail.generated.js";import"../graphql/queries/product-medias.generated.js";import"../helpers/convert.js";import"crc-32";import{useShopStore as j}from"../contexts/ShopContext.js";import"@gem-sdk/adapter-shopify";import"swr/mutation";import"swr/infinite";import"vanilla-lazyload";import"../hooks/useCartUI.js";import"../graphql/queries/product-value-label.generated.js";import"../hooks/useStickyStore.js";import"../types/builder.js";import"../types/builderUpsell.js";import"../types/custom.js";import"../types/animations.js";let x=e=>{let t=getComputedStyle(e).overflow;return"visible"!==t},M=e=>{let t=e.getAttribute("data-component-tag");return"Section"===t};var Z=o(o=>{let{t:Z}=S(),q=o.isThemeSection,R=!!o.isShopifySection,H=j(e=>e.storefrontUrl),V=j(e=>e.pageType),E=d(e=>e.getParents),P=d(e=>e.getItem("ROOT")),T=d(e=>e.isThemeSectionEditor),[A,B]=r(null),[k,I]=r(!1),[$,F]=r(!1),[U,O]=r([]),[D,N]=r("top"),[G,z]=r(!1),[_,J]=r(!1),[K,Q]=r(""),[W,X]=r(""),[Y,ee]=r({width:"",text:""}),[et,ei]=r(!1),eo=d(e=>e.errorSectionList),er=l(()=>{if(!eo)return null;let e=eo?.find(e=>e.uid===o.uid);return e},[eo,o.uid]),el=s(e=>e.interactionData),en=l(()=>"POST_PURCHASE"===V,[V]),{checkDisableDelete:ea,getTooltipText:ed,checkDisableDuplicate:es}=m(o.uid,o.tag||""),eC=["ProductTitle","ProductDescription","ProductPrice"],ep=["ArticleTitle","ArticleContent","ArticleImage","ArticleAuthor","ArticleCategory","ArticleDate","ArticleExcerpt","ArticleTags"],ec=[...eC,...ep],eu=(e,t)=>{let i=U.length,o=e.getBoundingClientRect(),r=t.getBoundingClientRect();return o.top-r.top<36*i},eh=(e,t)=>{let i=t||e;if(e&&!M(e))return x(e)&&eu(t,e)?e:e.parentElement?eh(e.parentElement,i):void 0},em=n(()=>P?.childrens?.length||0,[P?.childrens?.length]),eg=n(()=>{if("Section"==o.tag)return"bottom";let e=document.body.querySelector("#storefront")?.querySelector('[data-toolbar-active="true"]');if(e){let t=e.getBoundingClientRect();t.top<60?N("bottom"):N("top")}},[o.tag]),ef=l(()=>H?H.match(/^(?:https?:\/\/)?([^/]+)\.myshopify\.com/)?.[1]:"",[H]),ev=l(()=>`https://admin.shopify.com/store/${ef}`,[ef]),eb=l(()=>K?`${ev}/products/${K}`:"",[ev,K]),ew=l(()=>W?`${ev}/articles/${W.replace("gid://shopify/Article/","")}`:"",[W,ev]),eS=l(()=>el?.isSelectOnPage,[el?.isSelectOnPage]),eL=l(()=>el?.settingType,[el?.settingType]),ey=l(()=>el?.item?.targets?.find(e=>e.uid===o.uid&&e?.type!=="PAGE")&&"TARGET"===eL,[el?.item?.targets,o.uid,eL]),ej=l(()=>el?.item?.self?.uid===o.uid&&el?.item?.self.type!=="PAGE"&&"TRIGGER"===eL,[el?.item?.self?.type,el?.item?.self?.uid,o.uid,eL]),ex=l(()=>!ey&&!ej,[ey,ej]),eM=l(()=>G||R,[G,R]),eZ=l(()=>et||R||em()>25&&"Section"===o.tag||!!er,[em,et,R,o.tag,er]),eq=n(e=>{let t=e.detail;if(t?.articleId&&X(t.articleId),t?.productId&&Q(t.productId),t?.componentUid==o.uid){J(!0),eg(),en&&(z(ea()),ee(ed()),ei(es()));let e=E(o.uid).filter(e=>!("ROOT"===e.uid||"Section"===e.tag&&T||e.editorConfigs?.toolbar?.hide||e.editorConfigs?.component?.noSetting)).slice(0,3);O(e)}else J(!1),O([]),I(!1)},[o.uid,en,E,ea,ed,es,T,eg]),eR=d(e=>e.dismissPublishError),eH=n(()=>{eR(o.uid)},[eR,o.uid]),eV=n(()=>"Section"!==o.tag?-1:P?.childrens?.length?P.childrens.findIndex(e=>e==o.uid):-1,[P?.childrens,o.uid,o.tag]),eE=l(()=>eV()>=25,[eV]),eP=l(()=>!!er||eE,[er,eE]);a(()=>(window.addEventListener("editor:active-component",eq),()=>{window.removeEventListener("editor:active-component",eq)}),[eq]);let eT=!!(o.tag&&f.includes(o.tag));if("section"===o.type||o.editorConfigs?.toolbar?.hide)return null;let eA=e=>{let t=e?.childrens?.length??0;if("Row"===e.label){let e=1===t?Z("Row {colNumber} col",{colNumber:t}):Z("Row {colNumber} cols",{colNumber:t});return e}return Z(e.label)},eB=e=>{if(!U.length)return;let t=e?.target||null,i=t.closest("[data-toolbar-active]");if(!t||!i)return;if(k)F(!1),I(!1);else{let e=eh(i,i);if(e)F(!0);else{let e=i.getBoundingClientRect();e.top<36*U.length?F(!0):F(!1)}I(!0)}let o=new CustomEvent("editor:toolbar:show-parents",{bubbles:!0,detail:{value:!k}});window.dispatchEvent(o)},ek=e=>{e.preventDefault(),e.stopPropagation();let t=new CustomEvent("editor:toolbar:delete-component",{bubbles:!0,detail:{componentUid:o.uid,isThemeSection:q,isShopifySection:R}});return window.dispatchEvent(t),!1},eI=e=>{e.preventDefault(),e.stopPropagation();let t=new CustomEvent("editor:toolbar:duplicate-component",{bubbles:!0,detail:{componentUid:o.uid,isThemeSection:q,isShopifySection:R}});return window.dispatchEvent(t),!1},e$=e=>{e.preventDefault(),e.stopPropagation();let t=new CustomEvent("editor:toolbar:zoom-out-component",{bubbles:!0,detail:{componentUid:o.uid}});return window.dispatchEvent(t),!1},eF=()=>{B(null),window.removeEventListener("editor:close-add-section-popup",eF)},eU=(e,t)=>{if(e.preventDefault(),e.stopPropagation(),em()>=25)return!1;let i=e.target;if(i){B(t);let e=i.getBoundingClientRect(),r=new CustomEvent("editor:toolbar:add-section",{bubbles:!0,detail:{componentUid:o.uid,position:t,top:e.top+e.height/2}});window.dispatchEvent(r),window.addEventListener("editor:close-add-section-popup",eF)}return!1},eO="Section"===o.tag&&!o.isThemeSection&&"STATIC"!==V&&"POST_PURCHASE"!==V&&!o.isShopifySection&&25>eV()&&!er;return e(t,{children:[!("Section"==o.tag&&T)&&e("div",{"data-toolbar":!0,"data-toolbar-section":"Section"==o.tag,"data-toolbar-theme-section":"Section"==o.tag&&!!q||T,"data-toolbar-shopify-section":"Section"==o.tag&&!!R,"data-toolbar-limit":eV()>=25||!!er,children:[e("div",{"data-toolbar-show-parent":!0,onClick:e=>eB(e),"aria-hidden":"true",children:[ej&&i("div",{className:"gp-hidden gp-w-[12px] interaction-use-custom-element",children:i("svg",{width:"12",height:"13",viewBox:"0 0 12 13",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:i("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M4.36799 0.430523C4.51596 0.205675 4.76709 0.0703125 5.03626 0.0703125H9.88576C10.2042 0.0703125 10.395 0.424378 10.2198 0.69034L8.36968 3.4992C8.28209 3.63218 8.37747 3.80922 8.53671 3.80922H10.749C11.1111 3.80922 11.2869 4.25204 11.0233 4.50036L3.03971 12.0217C2.7572 12.2878 2.29932 12.0361 2.37262 11.655L3.27994 6.93698C3.30366 6.81364 3.20915 6.69921 3.08354 6.69921H0.984651C0.66625 6.69921 0.475479 6.34529 0.650515 6.07932L4.36799 0.430523Z",fill:"#F9F9F9"})})}),ey&&i("div",{className:"gp-hidden gp-w-[14px] interaction-use-custom-element",children:i("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:i("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M7.32785 3.66159C7.87459 3.58351 8.25451 3.077 8.17643 2.53026C8.09836 1.98353 7.59184 1.6036 7.0451 1.68168C3.92866 2.12673 1.5332 4.80488 1.5332 8.04424C1.5332 11.594 4.41085 14.4716 7.9606 14.4716C11.1706 14.4716 13.8294 12.1194 14.3105 9.04446C14.3959 8.49881 14.0227 7.98727 13.4771 7.9019C12.9314 7.81654 12.4199 8.18967 12.3345 8.73531C12.0034 10.852 10.1702 12.4716 7.9606 12.4716C5.51541 12.4716 3.5332 10.4894 3.5332 8.04424C3.5332 5.81431 5.18273 3.96793 7.32785 3.66159ZM10.3432 1.97548C10.6232 1.69551 11.102 1.83654 11.1855 2.22355L11.6106 4.19339C11.6313 4.28936 11.7063 4.36432 11.8023 4.38503L13.7721 4.81013C14.1591 4.89365 14.3001 5.37247 14.0202 5.65243L12.3432 7.32945C12.1244 7.54819 11.8168 7.65338 11.5099 7.61436L10.1528 7.44178C9.84592 7.40276 9.53827 7.50795 9.31953 7.72669L8.66719 8.37903C8.35477 8.69145 7.86633 8.70954 7.57623 8.41943C7.28613 8.12933 7.30421 7.64089 7.61663 7.32847L8.26898 6.67613C8.48771 6.45739 8.5929 6.14974 8.55388 5.84287L8.38131 4.48575C8.34228 4.17888 8.44748 3.87123 8.66621 3.6525L10.3432 1.97548ZM8.19853 5.1916C8.35319 5.72179 8.04877 6.27697 7.51858 6.43163C6.83078 6.63226 6.32988 7.2683 6.32988 8.01873C6.32988 8.9316 7.06991 9.67164 7.98279 9.67164C8.73014 9.67164 9.36406 9.17486 9.56743 8.49131C9.72492 7.96195 10.2817 7.6605 10.8111 7.81799C11.3404 7.97548 11.6419 8.53227 11.4844 9.06163C11.0356 10.57 9.63916 11.6716 7.98279 11.6716C5.96535 11.6716 4.32988 10.0362 4.32988 8.01873C4.32988 6.35558 5.44054 4.95445 6.95851 4.51165C7.4887 4.35699 8.04387 4.66141 8.19853 5.1916Z",fill:"#F9F9F9"})})}),_&&ex&&i("div",{"data-toolbar-icon-drag":!0,children:e("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:[i("path",{d:"M5.5 4.5C6.32843 4.5 7 3.82843 7 3C7 2.17157 6.32843 1.5 5.5 1.5C4.67157 1.5 4 2.17157 4 3C4 3.82843 4.67157 4.5 5.5 4.5Z",fill:"currentColor"}),i("path",{d:"M5.5 9.5C6.32843 9.5 7 8.82843 7 8C7 7.17157 6.32843 6.5 5.5 6.5C4.67157 6.5 4 7.17157 4 8C4 8.82843 4.67157 9.5 5.5 9.5Z",fill:"currentColor"}),i("path",{d:"M7 13C7 13.8284 6.32843 14.5 5.5 14.5C4.67157 14.5 4 13.8284 4 13C4 12.1716 4.67157 11.5 5.5 11.5C6.32843 11.5 7 12.1716 7 13Z",fill:"currentColor"}),i("path",{d:"M10.5 4.5C11.3284 4.5 12 3.82843 12 3C12 2.17157 11.3284 1.5 10.5 1.5C9.67157 1.5 9 2.17157 9 3C9 3.82843 9.67157 4.5 10.5 4.5Z",fill:"currentColor"}),i("path",{d:"M12 8C12 8.82843 11.3284 9.5 10.5 9.5C9.67157 9.5 9 8.82843 9 8C9 7.17157 9.67157 6.5 10.5 6.5C11.3284 6.5 12 7.17157 12 8Z",fill:"currentColor"}),i("path",{d:"M10.5 14.5C11.3284 14.5 12 13.8284 12 13C12 12.1716 11.3284 11.5 10.5 11.5C9.67157 11.5 9 12.1716 9 13C9 13.8284 9.67157 14.5 10.5 14.5Z",fill:"currentColor"})]})}),"Section"==o.tag?e("div",{"data-toolbar-name":!0,children:[(()=>{if(R)return o.name?.includes("Shopify section:")?`${Z("Shopify section")}: ${o.name.replace("Shopify section:","")}`:`${Z("Shopify section")}: ${o.name}`;let e=o.name&&o.name===`Section ${o.uid}`;return em()>=20?`${e?Z("Section"):o?.name} ${eV()+1}/25`:e?`${Z("Section")} ${eV()+1}`:o?.name})(),_&&R&&!o.isShopifyVisibility&&e("svg",{"data-toolbar-visibility":!0,width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[i("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M13.1252 9.99773C13.1243 8.27226 11.7248 6.87423 9.99935 6.87506C8.27386 6.87561 6.87518 8.27455 6.87518 10.0001C6.87518 11.7259 8.27429 13.1251 10.0002 13.1251C11.7257 13.1251 13.125 11.727 13.1252 10.0011V9.99773ZM9.99985 8.12506C11.035 8.12451 11.8746 8.96322 11.8752 9.99839V10.0004C11.8752 11.0357 11.0359 11.8751 10.0002 11.8751C8.96465 11.8751 8.12518 11.0356 8.12518 10.0001C8.12518 8.96472 8.96451 8.12533 9.99985 8.12506Z",fill:"#F9F9F9"}),i("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M9.99885 4.37593C5.66421 4.37604 2.80603 7.64523 1.79548 9.00983C1.35636 9.60279 1.35918 10.4 1.80012 10.9902C2.81706 12.3514 5.69374 15.6241 9.99886 15.6241C14.3806 15.6241 17.2194 12.3452 18.2168 10.9808C18.6473 10.392 18.6442 9.60472 18.211 9.01902C17.2056 7.65938 14.3429 4.37583 9.99885 4.37593ZM2.80002 9.75374C3.77049 8.44326 6.30207 5.62602 9.99888 5.62593C13.7041 5.62585 16.24 8.45598 17.206 9.76225C17.3146 9.9091 17.3149 10.0965 17.2077 10.2431C16.254 11.5477 13.7416 14.3741 9.99886 14.3741C6.33149 14.3741 3.78173 11.5541 2.80152 10.242C2.69021 10.0931 2.69001 9.90229 2.80002 9.75374Z",fill:"#F9F9F9"}),i("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M18.0763 3.26988C18.3415 3.58809 18.2985 4.06101 17.9803 4.32619L2.98032 16.8262C2.66211 17.0914 2.18919 17.0484 1.92402 16.7302C1.65884 16.412 1.70184 15.939 2.02004 15.6739L17.02 3.17385C17.3383 2.90868 17.8112 2.95167 18.0763 3.26988Z",fill:"#F9F9F9"})]})]}):i("div",{"data-toolbar-name":!0,children:Z(o.customLabel||o.label)}),_&&"Section"!==o.tag&&U.length>0&&i("div",{"data-toolbar-icon-parent":!0,"data-toolbar-icon-parent-open":k,children:i("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:i("path",{d:"M5.65522 10C5.07265 10 4.7809 9.22865 5.19284 8.77753L7.53762 6.20974C7.79298 5.93009 8.20702 5.93009 8.46238 6.20974L10.8072 8.77754C11.2191 9.22866 10.9274 10 10.3448 10H5.65522Z",fill:"currentColor"})})})]}),_&&k&&U.map((t,o)=>e("div",{"data-toolbar-parent":!0,"data-component-tag":t.tag,"data-parent-uid":t.uid,"data-toolbar-theme-section":T,"data-toolbar-parent-revert":$,style:{top:$?`${36*(o+1)}px`:`${-36*(o+1)}px`},children:[i("div",{"data-toolbar-icon-drag":!0,children:e("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:[i("path",{d:"M5.5 4.5C6.32843 4.5 7 3.82843 7 3C7 2.17157 6.32843 1.5 5.5 1.5C4.67157 1.5 4 2.17157 4 3C4 3.82843 4.67157 4.5 5.5 4.5Z",fill:"currentColor"}),i("path",{d:"M5.5 9.5C6.32843 9.5 7 8.82843 7 8C7 7.17157 6.32843 6.5 5.5 6.5C4.67157 6.5 4 7.17157 4 8C4 8.82843 4.67157 9.5 5.5 9.5Z",fill:"currentColor"}),i("path",{d:"M7 13C7 13.8284 6.32843 14.5 5.5 14.5C4.67157 14.5 4 13.8284 4 13C4 12.1716 4.67157 11.5 5.5 11.5C6.32843 11.5 7 12.1716 7 13Z",fill:"currentColor"}),i("path",{d:"M10.5 4.5C11.3284 4.5 12 3.82843 12 3C12 2.17157 11.3284 1.5 10.5 1.5C9.67157 1.5 9 2.17157 9 3C9 3.82843 9.67157 4.5 10.5 4.5Z",fill:"currentColor"}),i("path",{d:"M12 8C12 8.82843 11.3284 9.5 10.5 9.5C9.67157 9.5 9 8.82843 9 8C9 7.17157 9.67157 6.5 10.5 6.5C11.3284 6.5 12 7.17157 12 8Z",fill:"currentColor"}),i("path",{d:"M10.5 14.5C11.3284 14.5 12 13.8284 12 13C12 12.1716 11.3284 11.5 10.5 11.5C9.67157 11.5 9 12.1716 9 13C9 13.8284 9.67157 14.5 10.5 14.5Z",fill:"currentColor"})]})}),i("div",{"data-toolbar-name":!0,children:eA(t)})]},t.uid)),_&&!eS&&e(t,{children:[eT&&i(L,{...o}),i(y,{uid:o.uid,tag:o.tag}),eO&&i(C,{...o}),(()=>{let{isShopifySection:e,tag:t}=o;return!e&&(!q||!!T)&&g.includes(t)&&!er})()&&i(v,{...o}),"Sticky"==o.tag&&i("div",{"data-toolbar-zoom-out":!0,onClick:e=>e$(e),"aria-hidden":"true",children:i("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:i("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M14.5 7C14.7761 7 15 6.77614 15 6.5C15 6.22386 14.7761 6 14.5 6L10.7072 6L14.8536 1.85355C15.0489 1.65829 15.0489 1.34171 14.8536 1.14645C14.6584 0.951186 14.3418 0.951185 14.1465 1.14645L10 5.29297L10 1.5C10 1.22386 9.77614 1 9.5 1C9.22386 1 9 1.22386 9 1.5L9 6.5C9 6.77614 9.22386 7 9.5 7L14.5 7ZM6 10.7073L6 14.5C6 14.7761 6.22386 15 6.5 15C6.77614 15 7 14.7761 7 14.5L7 9.5C7 9.22386 6.77614 9 6.5 9H1.5C1.22386 9 1 9.22386 1 9.5C1 9.77614 1.22386 10 1.5 10H5.29306L1.14662 14.1464C0.951353 14.3417 0.951353 14.6583 1.14662 14.8536C1.34188 15.0488 1.65846 15.0488 1.85372 14.8536L6 10.7073Z",fill:"currentColor"})})}),ec.includes(o.tag)&&i(p,{"data-toolbar-title":!0,enable:!0,"data-toolbar-disable":!1,text:Z("Edit content in Shopify"),position:"top",onClick:()=>{if(ep.includes(o.tag)){window.open(ew,"_blank");return}if(eC.includes(o.tag)){window.open(eb,"_blank");return}window.open(ev,"_blank")},"aria-hidden":"true",children:e("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[i("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8.61129 2.47348C8.61129 2.47348 8.47099 2.51557 8.23248 2.59274C8.19039 2.46647 8.13427 2.30512 8.05009 2.15079C7.78352 1.6387 7.39068 1.37212 6.91366 1.36511C6.87858 1.36511 6.85052 1.36511 6.81545 1.37212C6.80843 1.36511 6.80142 1.35634 6.7944 1.34757C6.78739 1.3388 6.78037 1.33003 6.77336 1.32302C6.56992 1.09854 6.30335 0.993314 5.98768 1.00033C5.37737 1.02137 4.76706 1.46332 4.269 2.249C3.91825 2.80319 3.65869 3.49767 3.58153 4.03082C3.38823 4.09074 3.21092 4.14586 3.05516 4.19429C2.64595 4.32151 2.3851 4.40261 2.37494 4.40261C2.01718 4.51485 2.01016 4.52888 1.96106 4.85859C1.92598 5.11113 1 12.2945 1 12.2945L7.14764 13.3583C7.18955 13.118 7.30454 12.8953 7.47848 12.7214L8.70249 11.4974V2.45945C8.66741 2.45945 8.63234 2.46647 8.61129 2.47348ZM6.82948 3.02767L6.62554 3.09101C6.27515 3.19989 5.90094 3.31617 5.5317 3.42752C5.65797 2.94349 5.89648 2.46647 6.19111 2.15079C6.30335 2.03154 6.45067 1.90527 6.63306 1.8281C6.80142 2.18587 6.83649 2.68393 6.82948 3.02767ZM5.99469 1.4072C6.13499 1.4072 6.26126 1.43526 6.36649 1.50541C6.19813 1.58959 6.0438 1.71586 5.88947 1.87721C5.50364 2.29109 5.202 2.94349 5.08274 3.56783C4.74459 3.66991 4.41804 3.77199 4.10838 3.8688L4.01646 3.89753C4.22691 2.90841 5.05468 1.43526 5.99469 1.4072ZM4.80214 7.0122C4.81874 7.26957 5.09737 7.44833 5.43473 7.66478C5.95252 7.99699 6.60867 8.41798 6.66813 9.3482C6.7453 10.5548 6.02977 11.3826 4.99154 11.4457C3.7569 11.5229 3.06943 10.7933 3.06943 10.7933L3.32899 9.67791C3.32899 9.67791 4.01646 10.197 4.56363 10.1619C4.92139 10.1409 5.04767 9.84627 5.04065 9.64283C5.01607 9.26796 4.73308 9.06671 4.41569 8.84101C4.00848 8.55142 3.54465 8.22157 3.49735 7.4331C3.42018 6.24756 4.19885 5.05501 5.91051 4.94277C6.57694 4.90068 6.91366 5.06904 6.91366 5.06904L6.52082 6.53518C6.52082 6.53518 6.08589 6.33876 5.56678 6.36682C4.80915 6.41592 4.79512 6.89294 4.80214 7.0122ZM7.23635 2.9014C7.22934 2.59274 7.19426 2.15781 7.04695 1.78601C7.50994 1.87721 7.74143 2.39632 7.83964 2.71199C7.70008 2.75665 7.54275 2.80575 7.37118 2.8593L7.23635 2.9014Z",fill:"currentColor"}),i("path",{d:"M10.7719 3.44156C10.7757 3.47543 11.1733 6.16931 11.541 8.65883L8.95503 11.2448V2.57871C9.16548 2.78214 9.71265 3.31528 9.71265 3.31528C9.71265 3.31528 10.6106 3.32931 10.6597 3.33633C10.7088 3.34334 10.7649 3.37842 10.7719 3.44156Z",fill:"currentColor"}),i("path",{d:"M14.8056 8.644L14.0424 7.88088C13.7832 7.62163 13.3629 7.62163 13.1036 7.88088L12.1519 8.83258L13.8539 10.5345L14.8056 9.58282C15.0648 9.32357 15.0648 8.90325 14.8056 8.644Z",fill:"currentColor"}),i("path",{d:"M7.85018 13.0942L11.6419 9.30246L13.3438 11.0044L9.55212 14.7961C9.43782 14.9104 9.28573 14.9791 9.1244 14.9892L7.93427 15.0641C7.73484 15.0767 7.56961 14.9114 7.58216 14.712L7.65706 13.5219C7.66721 13.3606 7.73588 13.2085 7.85018 13.0942Z",fill:"currentColor"})]})}),i(p,{enable:"Section"==o.tag&&em()>=25||R,text:R?Z("Available in the Shopify theme editor"):Z("Page has reached Shopify’s 25 section-limit"),position:"bottom",width:"200px","data-toolbar-duplicate":!0,"data-toolbar-disable":eZ,onClick:eZ?void 0:e=>eI(e),"aria-hidden":"true",className:eZ?"!gp-cursor-not-allowed":"",children:i("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:i("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M6.08423 1.21289C5.53194 1.21289 5.08423 1.66061 5.08423 2.21289V3.78711H4.26172C3.43329 3.78711 2.76172 4.45868 2.76172 5.28711V13.2871C2.76172 14.1155 3.43329 14.7871 4.26172 14.7871H10.2617C11.0901 14.7871 11.7617 14.1155 11.7617 13.2871V12.4629H13.0842C13.6365 12.4629 14.0842 12.0152 14.0842 11.4629V2.21289C14.0842 1.66061 13.6365 1.21289 13.0842 1.21289H6.08423ZM10.7617 12.4629H6.08423C5.53194 12.4629 5.08423 12.0152 5.08423 11.4629V4.78711H4.26172C3.98558 4.78711 3.76172 5.01097 3.76172 5.28711V13.2871C3.76172 13.5633 3.98558 13.7871 4.26172 13.7871H10.2617C10.5379 13.7871 10.7617 13.5633 10.7617 13.2871V12.4629Z",fill:"currentColor"})})}),i(p,{"data-toolbar-delete":!0,onClick:e=>eM?null:ek(e),enable:eM,"data-toolbar-disable":eM,text:R?Z("Available in the Shopify theme editor"):Y.text,width:Y.width,position:R?"bottom":D,"aria-hidden":"true",className:eM?"!gp-cursor-not-allowed":"",children:i("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:i("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M11 2.88965V2.38965C11 1.56122 10.3284 0.889648 9.5 0.889648H6.5C5.67157 0.889648 5 1.56122 5 2.38965V2.88965H2C1.72386 2.88965 1.5 3.11351 1.5 3.38965C1.5 3.66579 1.72386 3.88965 2 3.88965H3.21997V13.1099C3.21997 14.2144 4.1154 15.1099 5.21997 15.1099H11.22C12.3245 15.1099 13.22 14.2144 13.22 13.1099V3.88965H14C14.2761 3.88965 14.5 3.66579 14.5 3.38965C14.5 3.11351 14.2761 2.88965 14 2.88965H11ZM6 2.88965H10V2.38965C10 2.11351 9.77614 1.88965 9.5 1.88965H6.5C6.22386 1.88965 6 2.11351 6 2.38965V2.88965ZM6.24976 6.13965C6.66397 6.13965 6.99976 6.47543 6.99976 6.88965V11.3896C6.99976 11.8039 6.66397 12.1396 6.24976 12.1396C5.83554 12.1396 5.49976 11.8039 5.49976 11.3896V6.88965C5.49976 6.47543 5.83554 6.13965 6.24976 6.13965ZM10.4998 6.88965C10.4998 6.47543 10.164 6.13965 9.74976 6.13965C9.33554 6.13965 8.99976 6.47543 8.99976 6.88965V11.3896C8.99976 11.8039 9.33554 12.1396 9.74976 12.1396C10.164 12.1396 10.4998 11.8039 10.4998 11.3896V6.88965Z",fill:"currentColor"})})})]}),i(w,{uid:o.uid})]},o.uid),"STATIC"!==V&&"POST_PURCHASE"!==V&&25>eV()&&i(u,{...o}),i("div",{"data-outline":!0,"data-outline-section":"Section"==o.tag,"data-outline-theme-section":"Section"==o.tag&&!!q||T,"data-outline-shopify-section":"Section"==o.tag&&!!R,"data-outline-limit":eP,"data-outline-error":!!er},"outline-"+o.uid),"Section"==o.tag&&!T&&e(t,{children:[i(p,{enable:em()>=25,text:Z("Page has reached Shopify’s 25 section-limit"),position:"top","data-toolbar-add-top":!0,"data-toolbar-disable":em()>=25,"data-toolbar-add-open":"above"==A,onClick:e=>eU(e,"above"),"aria-hidden":"true",children:i("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:i("path",{d:"M8.45 3.95C8.45 3.70147 8.24853 3.5 8 3.5C7.75147 3.5 7.55 3.70147 7.55 3.95V7.55H3.95C3.70147 7.55 3.5 7.75147 3.5 8C3.5 8.24853 3.70147 8.45 3.95 8.45H7.55V12.05C7.55 12.2985 7.75147 12.5 8 12.5C8.24853 12.5 8.45 12.2985 8.45 12.05V8.45H12.05C12.2985 8.45 12.5 8.24853 12.5 8C12.5 7.75147 12.2985 7.55 12.05 7.55H8.45V3.95Z",fill:"#212121"})})}),i(p,{enable:em()>=25,text:Z("Page has reached Shopify’s 25 section-limit"),position:"top","data-toolbar-add-bottom":!0,"data-toolbar-disable":em()>=25,"data-toolbar-add-open":"below"==A,onClick:e=>eU(e,"below"),"aria-hidden":"true",children:i("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:i("path",{d:"M8.45 3.95C8.45 3.70147 8.24853 3.5 8 3.5C7.75147 3.5 7.55 3.70147 7.55 3.95V7.55H3.95C3.70147 7.55 3.5 7.75147 3.5 8C3.5 8.24853 3.70147 8.45 3.95 8.45H7.55V12.05C7.55 12.2985 7.75147 12.5 8 12.5C8.24853 12.5 8.45 12.2985 8.45 12.05V8.45H12.05C12.2985 8.45 12.5 8.24853 12.5 8C12.5 7.75147 12.2985 7.55 12.05 7.55H8.45V3.95Z",fill:"#212121"})})})]}),er&&i(c,{errorSectionInfo:er,onDismiss:eH}),g.includes(o.tag)&&_&&i(b,{...o}),_&&i(h,{...o})]})});export{Z as default};
2
+ import{jsxs as e,Fragment as t,jsx as i}from"react/jsx-runtime";import{memo as o,useState as r,useMemo as l,useCallback as n,useEffect as a}from"react";import"zustand";import{useBuilderPreviewStore as d}from"../contexts/BuilderPreviewContext.js";import{usePageStore as s}from"../contexts/PageContext.js";import{CreateThemeSection as C}from"./theme-section/CreateThemeSection.js";import p from"./toolbar/Tooltip.js";import{SectionErrorBanner as c}from"./toolbar/SectionErrorBanner.js";import{ThemeSectionStatusWrapper as h}from"./theme-section/ThemeSectionStatus.js";import u from"./resize/Resize.js";import{usePostPurchase as m}from"../hooks/useToolbarPostPurchase.js";import{ableGenerateContentElements as g}from"./constant.js";import{AIContentGenerator as f}from"./ai-generator/AIContentGenerator.js";import{AIGenContentLoading as v}from"./ai-generator/AIGenContentLoading.js";import{InteractionSuffix as b}from"./InteractionSuffix.js";import{useI18nStore as w}from"@gem-sdk/core";import{AIAssistant as S}from"./ai-assistant/AIAssistant.js";import L from"./upgrade-element/UpgradeElement.js";import"swr";import"../graphql/queries/collection-detail-filter.generated.js";import"../graphql/queries/collection.generated.js";import"../graphql/queries/collections.generated.js";import"../graphql/queries/published-theme-pages.generated.js";import"../graphql/queries/products.generated.js";import"../graphql/queries/store-property.generated.js";import"../graphql/queries/preview-page.generated.js";import"../graphql/queries/published-shop-metas.generated.js";import"../graphql/queries/shop-shopify.generated.js";import"../graphql/queries/articles.generated.js";import"../graphql/queries/blogs.generated.js";import"../graphql/queries/products-with-selling-plans.generated.js";import"../graphql/queries/product-variant-with-selling-plans.generated.js";import"../graphql/queries/product-variants.generated.js";import"../graphql/queries/product-little-detail.generated.js";import"../graphql/queries/product-medias.generated.js";import"../helpers/convert.js";import"crc-32";import{useShopStore as y}from"../contexts/ShopContext.js";import"@gem-sdk/adapter-shopify";import"swr/mutation";import"swr/infinite";import"vanilla-lazyload";import"../hooks/useCartUI.js";import"../graphql/queries/product-value-label.generated.js";import"../hooks/useStickyStore.js";import"../types/builder.js";import"../types/builderUpsell.js";import"../types/custom.js";import"../types/animations.js";let j=e=>{let t=getComputedStyle(e).overflow;return"visible"!==t},x=e=>{let t=e.getAttribute("data-component-tag");return"Section"===t};var M=o(o=>{let{t:M}=w(),Z=o.isThemeSection,q=!!o.isShopifySection,R=y(e=>e.storefrontUrl),H=y(e=>e.pageType),V=d(e=>e.getParents),E=d(e=>e.getItem("ROOT")),P=d(e=>e.isThemeSectionEditor),[T,A]=r(null),[B,k]=r(!1),[I,$]=r(!1),[F,U]=r([]),[O,D]=r("top"),[N,G]=r(!1),[z,_]=r(!1),[J,K]=r(""),[Q,W]=r(""),[X,Y]=r({width:"",text:""}),[ee,et]=r(!1),ei=d(e=>e.errorSectionList),eo=l(()=>{if(!ei)return null;let e=ei?.find(e=>e.uid===o.uid);return e},[ei,o.uid]),er=s(e=>e.interactionData),el=l(()=>"POST_PURCHASE"===H,[H]),{checkDisableDelete:en,getTooltipText:ea,checkDisableDuplicate:ed}=m(o.uid,o.tag||""),es=["ProductTitle","ProductDescription","ProductPrice"],eC=["ArticleTitle","ArticleContent","ArticleImage","ArticleAuthor","ArticleCategory","ArticleDate","ArticleExcerpt","ArticleTags"],ep=[...es,...eC],ec=(e,t)=>{let i=F.length,o=e.getBoundingClientRect(),r=t.getBoundingClientRect();return o.top-r.top<36*i},eh=(e,t)=>{let i=t||e;if(e&&!x(e))return j(e)&&ec(t,e)?e:e.parentElement?eh(e.parentElement,i):void 0},eu=n(()=>E?.childrens?.length||0,[E?.childrens?.length]),em=n(()=>{if("Section"==o.tag)return"bottom";let e=document.body.querySelector("#storefront")?.querySelector('[data-toolbar-active="true"]');if(e){let t=e.getBoundingClientRect();t.top<60?D("bottom"):D("top")}},[o.tag]),eg=l(()=>R?R.match(/^(?:https?:\/\/)?([^/]+)\.myshopify\.com/)?.[1]:"",[R]),ef=l(()=>`https://admin.shopify.com/store/${eg}`,[eg]),ev=l(()=>J?`${ef}/products/${J}`:"",[ef,J]),eb=l(()=>Q?`${ef}/articles/${Q.replace("gid://shopify/Article/","")}`:"",[Q,ef]),ew=l(()=>er?.isSelectOnPage,[er?.isSelectOnPage]),eS=l(()=>er?.settingType,[er?.settingType]),eL=l(()=>er?.item?.targets?.find(e=>e.uid===o.uid&&e?.type!=="PAGE")&&"TARGET"===eS,[er?.item?.targets,o.uid,eS]),ey=l(()=>er?.item?.self?.uid===o.uid&&er?.item?.self.type!=="PAGE"&&"TRIGGER"===eS,[er?.item?.self?.type,er?.item?.self?.uid,o.uid,eS]),ej=l(()=>!eL&&!ey,[eL,ey]),ex=l(()=>N||q,[N,q]),eM=l(()=>ee||q||eu()>25&&"Section"===o.tag||!!eo,[eu,ee,q,o.tag,eo]),eZ=n(e=>{let t=e.detail;if(t?.articleId&&W(t.articleId),t?.productId&&K(t.productId),t?.componentUid==o.uid){_(!0),em(),el&&(G(en()),Y(ea()),et(ed()));let e=V(o.uid).filter(e=>!("ROOT"===e.uid||"Section"===e.tag&&P||e.editorConfigs?.toolbar?.hide||e.editorConfigs?.component?.noSetting)).slice(0,3);U(e)}else _(!1),U([]),k(!1)},[o.uid,el,V,en,ea,ed,P,em]),eq=d(e=>e.dismissPublishError),eR=n(()=>{eq(o.uid)},[eq,o.uid]),eH=n(()=>"Section"!==o.tag?-1:E?.childrens?.length?E.childrens.findIndex(e=>e==o.uid):-1,[E?.childrens,o.uid,o.tag]),eV=l(()=>eH()>=25,[eH]),eE=l(()=>!!eo||eV,[eo,eV]);if(a(()=>(window.addEventListener("editor:active-component",eZ),()=>{window.removeEventListener("editor:active-component",eZ)}),[eZ]),"section"===o.type||o.editorConfigs?.toolbar?.hide)return null;let eP=e=>{let t=e?.childrens?.length??0;if("Row"===e.label){let e=1===t?M("Row {colNumber} col",{colNumber:t}):M("Row {colNumber} cols",{colNumber:t});return e}return M(e.label)},eT=e=>{if(!F.length)return;let t=e?.target||null,i=t.closest("[data-toolbar-active]");if(!t||!i)return;if(B)$(!1),k(!1);else{let e=eh(i,i);if(e)$(!0);else{let e=i.getBoundingClientRect();e.top<36*F.length?$(!0):$(!1)}k(!0)}let o=new CustomEvent("editor:toolbar:show-parents",{bubbles:!0,detail:{value:!B}});window.dispatchEvent(o)},eA=e=>{e.preventDefault(),e.stopPropagation();let t=new CustomEvent("editor:toolbar:delete-component",{bubbles:!0,detail:{componentUid:o.uid,isThemeSection:Z,isShopifySection:q}});return window.dispatchEvent(t),!1},eB=e=>{e.preventDefault(),e.stopPropagation();let t=new CustomEvent("editor:toolbar:duplicate-component",{bubbles:!0,detail:{componentUid:o.uid,isThemeSection:Z,isShopifySection:q}});return window.dispatchEvent(t),!1},ek=e=>{e.preventDefault(),e.stopPropagation();let t=new CustomEvent("editor:toolbar:zoom-out-component",{bubbles:!0,detail:{componentUid:o.uid}});return window.dispatchEvent(t),!1},eI=()=>{A(null),window.removeEventListener("editor:close-add-section-popup",eI)},e$=(e,t)=>{if(e.preventDefault(),e.stopPropagation(),eu()>=25)return!1;let i=e.target;if(i){A(t);let e=i.getBoundingClientRect(),r=new CustomEvent("editor:toolbar:add-section",{bubbles:!0,detail:{componentUid:o.uid,position:t,top:e.top+e.height/2}});window.dispatchEvent(r),window.addEventListener("editor:close-add-section-popup",eI)}return!1},eF="Section"===o.tag&&!o.isThemeSection&&"STATIC"!==H&&"POST_PURCHASE"!==H&&!o.isShopifySection&&25>eH()&&!eo;return e(t,{children:[!("Section"==o.tag&&P)&&e("div",{"data-toolbar":!0,"data-toolbar-section":"Section"==o.tag,"data-toolbar-theme-section":"Section"==o.tag&&!!Z||P,"data-toolbar-shopify-section":"Section"==o.tag&&!!q,"data-toolbar-limit":eH()>=25||!!eo,children:[e("div",{"data-toolbar-show-parent":!0,onClick:e=>eT(e),"aria-hidden":"true",children:[ey&&i("div",{className:"gp-hidden gp-w-[12px] interaction-use-custom-element",children:i("svg",{width:"12",height:"13",viewBox:"0 0 12 13",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:i("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M4.36799 0.430523C4.51596 0.205675 4.76709 0.0703125 5.03626 0.0703125H9.88576C10.2042 0.0703125 10.395 0.424378 10.2198 0.69034L8.36968 3.4992C8.28209 3.63218 8.37747 3.80922 8.53671 3.80922H10.749C11.1111 3.80922 11.2869 4.25204 11.0233 4.50036L3.03971 12.0217C2.7572 12.2878 2.29932 12.0361 2.37262 11.655L3.27994 6.93698C3.30366 6.81364 3.20915 6.69921 3.08354 6.69921H0.984651C0.66625 6.69921 0.475479 6.34529 0.650515 6.07932L4.36799 0.430523Z",fill:"#F9F9F9"})})}),eL&&i("div",{className:"gp-hidden gp-w-[14px] interaction-use-custom-element",children:i("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:i("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M7.32785 3.66159C7.87459 3.58351 8.25451 3.077 8.17643 2.53026C8.09836 1.98353 7.59184 1.6036 7.0451 1.68168C3.92866 2.12673 1.5332 4.80488 1.5332 8.04424C1.5332 11.594 4.41085 14.4716 7.9606 14.4716C11.1706 14.4716 13.8294 12.1194 14.3105 9.04446C14.3959 8.49881 14.0227 7.98727 13.4771 7.9019C12.9314 7.81654 12.4199 8.18967 12.3345 8.73531C12.0034 10.852 10.1702 12.4716 7.9606 12.4716C5.51541 12.4716 3.5332 10.4894 3.5332 8.04424C3.5332 5.81431 5.18273 3.96793 7.32785 3.66159ZM10.3432 1.97548C10.6232 1.69551 11.102 1.83654 11.1855 2.22355L11.6106 4.19339C11.6313 4.28936 11.7063 4.36432 11.8023 4.38503L13.7721 4.81013C14.1591 4.89365 14.3001 5.37247 14.0202 5.65243L12.3432 7.32945C12.1244 7.54819 11.8168 7.65338 11.5099 7.61436L10.1528 7.44178C9.84592 7.40276 9.53827 7.50795 9.31953 7.72669L8.66719 8.37903C8.35477 8.69145 7.86633 8.70954 7.57623 8.41943C7.28613 8.12933 7.30421 7.64089 7.61663 7.32847L8.26898 6.67613C8.48771 6.45739 8.5929 6.14974 8.55388 5.84287L8.38131 4.48575C8.34228 4.17888 8.44748 3.87123 8.66621 3.6525L10.3432 1.97548ZM8.19853 5.1916C8.35319 5.72179 8.04877 6.27697 7.51858 6.43163C6.83078 6.63226 6.32988 7.2683 6.32988 8.01873C6.32988 8.9316 7.06991 9.67164 7.98279 9.67164C8.73014 9.67164 9.36406 9.17486 9.56743 8.49131C9.72492 7.96195 10.2817 7.6605 10.8111 7.81799C11.3404 7.97548 11.6419 8.53227 11.4844 9.06163C11.0356 10.57 9.63916 11.6716 7.98279 11.6716C5.96535 11.6716 4.32988 10.0362 4.32988 8.01873C4.32988 6.35558 5.44054 4.95445 6.95851 4.51165C7.4887 4.35699 8.04387 4.66141 8.19853 5.1916Z",fill:"#F9F9F9"})})}),z&&ej&&i("div",{"data-toolbar-icon-drag":!0,children:e("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:[i("path",{d:"M5.5 4.5C6.32843 4.5 7 3.82843 7 3C7 2.17157 6.32843 1.5 5.5 1.5C4.67157 1.5 4 2.17157 4 3C4 3.82843 4.67157 4.5 5.5 4.5Z",fill:"currentColor"}),i("path",{d:"M5.5 9.5C6.32843 9.5 7 8.82843 7 8C7 7.17157 6.32843 6.5 5.5 6.5C4.67157 6.5 4 7.17157 4 8C4 8.82843 4.67157 9.5 5.5 9.5Z",fill:"currentColor"}),i("path",{d:"M7 13C7 13.8284 6.32843 14.5 5.5 14.5C4.67157 14.5 4 13.8284 4 13C4 12.1716 4.67157 11.5 5.5 11.5C6.32843 11.5 7 12.1716 7 13Z",fill:"currentColor"}),i("path",{d:"M10.5 4.5C11.3284 4.5 12 3.82843 12 3C12 2.17157 11.3284 1.5 10.5 1.5C9.67157 1.5 9 2.17157 9 3C9 3.82843 9.67157 4.5 10.5 4.5Z",fill:"currentColor"}),i("path",{d:"M12 8C12 8.82843 11.3284 9.5 10.5 9.5C9.67157 9.5 9 8.82843 9 8C9 7.17157 9.67157 6.5 10.5 6.5C11.3284 6.5 12 7.17157 12 8Z",fill:"currentColor"}),i("path",{d:"M10.5 14.5C11.3284 14.5 12 13.8284 12 13C12 12.1716 11.3284 11.5 10.5 11.5C9.67157 11.5 9 12.1716 9 13C9 13.8284 9.67157 14.5 10.5 14.5Z",fill:"currentColor"})]})}),"Section"==o.tag?e("div",{"data-toolbar-name":!0,children:[(()=>{if(q)return o.name?.includes("Shopify section:")?`${M("Shopify section")}: ${o.name.replace("Shopify section:","")}`:`${M("Shopify section")}: ${o.name}`;let e=o.name&&o.name===`Section ${o.uid}`;return eu()>=20?`${e?M("Section"):o?.name} ${eH()+1}/25`:e?`${M("Section")} ${eH()+1}`:o?.name})(),z&&q&&!o.isShopifyVisibility&&e("svg",{"data-toolbar-visibility":!0,width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[i("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M13.1252 9.99773C13.1243 8.27226 11.7248 6.87423 9.99935 6.87506C8.27386 6.87561 6.87518 8.27455 6.87518 10.0001C6.87518 11.7259 8.27429 13.1251 10.0002 13.1251C11.7257 13.1251 13.125 11.727 13.1252 10.0011V9.99773ZM9.99985 8.12506C11.035 8.12451 11.8746 8.96322 11.8752 9.99839V10.0004C11.8752 11.0357 11.0359 11.8751 10.0002 11.8751C8.96465 11.8751 8.12518 11.0356 8.12518 10.0001C8.12518 8.96472 8.96451 8.12533 9.99985 8.12506Z",fill:"#F9F9F9"}),i("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M9.99885 4.37593C5.66421 4.37604 2.80603 7.64523 1.79548 9.00983C1.35636 9.60279 1.35918 10.4 1.80012 10.9902C2.81706 12.3514 5.69374 15.6241 9.99886 15.6241C14.3806 15.6241 17.2194 12.3452 18.2168 10.9808C18.6473 10.392 18.6442 9.60472 18.211 9.01902C17.2056 7.65938 14.3429 4.37583 9.99885 4.37593ZM2.80002 9.75374C3.77049 8.44326 6.30207 5.62602 9.99888 5.62593C13.7041 5.62585 16.24 8.45598 17.206 9.76225C17.3146 9.9091 17.3149 10.0965 17.2077 10.2431C16.254 11.5477 13.7416 14.3741 9.99886 14.3741C6.33149 14.3741 3.78173 11.5541 2.80152 10.242C2.69021 10.0931 2.69001 9.90229 2.80002 9.75374Z",fill:"#F9F9F9"}),i("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M18.0763 3.26988C18.3415 3.58809 18.2985 4.06101 17.9803 4.32619L2.98032 16.8262C2.66211 17.0914 2.18919 17.0484 1.92402 16.7302C1.65884 16.412 1.70184 15.939 2.02004 15.6739L17.02 3.17385C17.3383 2.90868 17.8112 2.95167 18.0763 3.26988Z",fill:"#F9F9F9"})]})]}):i("div",{"data-toolbar-name":!0,children:M(o.customLabel||o.label)}),z&&"Section"!==o.tag&&F.length>0&&i("div",{"data-toolbar-icon-parent":!0,"data-toolbar-icon-parent-open":B,children:i("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:i("path",{d:"M5.65522 10C5.07265 10 4.7809 9.22865 5.19284 8.77753L7.53762 6.20974C7.79298 5.93009 8.20702 5.93009 8.46238 6.20974L10.8072 8.77754C11.2191 9.22866 10.9274 10 10.3448 10H5.65522Z",fill:"currentColor"})})})]}),z&&B&&F.map((t,o)=>e("div",{"data-toolbar-parent":!0,"data-component-tag":t.tag,"data-parent-uid":t.uid,"data-toolbar-theme-section":P,"data-toolbar-parent-revert":I,style:{top:I?`${36*(o+1)}px`:`${-36*(o+1)}px`},children:[i("div",{"data-toolbar-icon-drag":!0,children:e("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:[i("path",{d:"M5.5 4.5C6.32843 4.5 7 3.82843 7 3C7 2.17157 6.32843 1.5 5.5 1.5C4.67157 1.5 4 2.17157 4 3C4 3.82843 4.67157 4.5 5.5 4.5Z",fill:"currentColor"}),i("path",{d:"M5.5 9.5C6.32843 9.5 7 8.82843 7 8C7 7.17157 6.32843 6.5 5.5 6.5C4.67157 6.5 4 7.17157 4 8C4 8.82843 4.67157 9.5 5.5 9.5Z",fill:"currentColor"}),i("path",{d:"M7 13C7 13.8284 6.32843 14.5 5.5 14.5C4.67157 14.5 4 13.8284 4 13C4 12.1716 4.67157 11.5 5.5 11.5C6.32843 11.5 7 12.1716 7 13Z",fill:"currentColor"}),i("path",{d:"M10.5 4.5C11.3284 4.5 12 3.82843 12 3C12 2.17157 11.3284 1.5 10.5 1.5C9.67157 1.5 9 2.17157 9 3C9 3.82843 9.67157 4.5 10.5 4.5Z",fill:"currentColor"}),i("path",{d:"M12 8C12 8.82843 11.3284 9.5 10.5 9.5C9.67157 9.5 9 8.82843 9 8C9 7.17157 9.67157 6.5 10.5 6.5C11.3284 6.5 12 7.17157 12 8Z",fill:"currentColor"}),i("path",{d:"M10.5 14.5C11.3284 14.5 12 13.8284 12 13C12 12.1716 11.3284 11.5 10.5 11.5C9.67157 11.5 9 12.1716 9 13C9 13.8284 9.67157 14.5 10.5 14.5Z",fill:"currentColor"})]})}),i("div",{"data-toolbar-name":!0,children:eP(t)})]},t.uid)),z&&!ew&&e(t,{children:[i(L,{...o}),i(S,{uid:o.uid,tag:o.tag}),eF&&i(C,{...o}),(()=>{let{isShopifySection:e,tag:t}=o;return!e&&(!Z||!!P)&&g.includes(t)&&!eo})()&&i(f,{...o}),"Sticky"==o.tag&&i("div",{"data-toolbar-zoom-out":!0,onClick:e=>ek(e),"aria-hidden":"true",children:i("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:i("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M14.5 7C14.7761 7 15 6.77614 15 6.5C15 6.22386 14.7761 6 14.5 6L10.7072 6L14.8536 1.85355C15.0489 1.65829 15.0489 1.34171 14.8536 1.14645C14.6584 0.951186 14.3418 0.951185 14.1465 1.14645L10 5.29297L10 1.5C10 1.22386 9.77614 1 9.5 1C9.22386 1 9 1.22386 9 1.5L9 6.5C9 6.77614 9.22386 7 9.5 7L14.5 7ZM6 10.7073L6 14.5C6 14.7761 6.22386 15 6.5 15C6.77614 15 7 14.7761 7 14.5L7 9.5C7 9.22386 6.77614 9 6.5 9H1.5C1.22386 9 1 9.22386 1 9.5C1 9.77614 1.22386 10 1.5 10H5.29306L1.14662 14.1464C0.951353 14.3417 0.951353 14.6583 1.14662 14.8536C1.34188 15.0488 1.65846 15.0488 1.85372 14.8536L6 10.7073Z",fill:"currentColor"})})}),ep.includes(o.tag)&&i(p,{"data-toolbar-title":!0,enable:!0,"data-toolbar-disable":!1,text:M("Edit content in Shopify"),position:"top",onClick:()=>{if(eC.includes(o.tag)){window.open(eb,"_blank");return}if(es.includes(o.tag)){window.open(ev,"_blank");return}window.open(ef,"_blank")},"aria-hidden":"true",children:e("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[i("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8.61129 2.47348C8.61129 2.47348 8.47099 2.51557 8.23248 2.59274C8.19039 2.46647 8.13427 2.30512 8.05009 2.15079C7.78352 1.6387 7.39068 1.37212 6.91366 1.36511C6.87858 1.36511 6.85052 1.36511 6.81545 1.37212C6.80843 1.36511 6.80142 1.35634 6.7944 1.34757C6.78739 1.3388 6.78037 1.33003 6.77336 1.32302C6.56992 1.09854 6.30335 0.993314 5.98768 1.00033C5.37737 1.02137 4.76706 1.46332 4.269 2.249C3.91825 2.80319 3.65869 3.49767 3.58153 4.03082C3.38823 4.09074 3.21092 4.14586 3.05516 4.19429C2.64595 4.32151 2.3851 4.40261 2.37494 4.40261C2.01718 4.51485 2.01016 4.52888 1.96106 4.85859C1.92598 5.11113 1 12.2945 1 12.2945L7.14764 13.3583C7.18955 13.118 7.30454 12.8953 7.47848 12.7214L8.70249 11.4974V2.45945C8.66741 2.45945 8.63234 2.46647 8.61129 2.47348ZM6.82948 3.02767L6.62554 3.09101C6.27515 3.19989 5.90094 3.31617 5.5317 3.42752C5.65797 2.94349 5.89648 2.46647 6.19111 2.15079C6.30335 2.03154 6.45067 1.90527 6.63306 1.8281C6.80142 2.18587 6.83649 2.68393 6.82948 3.02767ZM5.99469 1.4072C6.13499 1.4072 6.26126 1.43526 6.36649 1.50541C6.19813 1.58959 6.0438 1.71586 5.88947 1.87721C5.50364 2.29109 5.202 2.94349 5.08274 3.56783C4.74459 3.66991 4.41804 3.77199 4.10838 3.8688L4.01646 3.89753C4.22691 2.90841 5.05468 1.43526 5.99469 1.4072ZM4.80214 7.0122C4.81874 7.26957 5.09737 7.44833 5.43473 7.66478C5.95252 7.99699 6.60867 8.41798 6.66813 9.3482C6.7453 10.5548 6.02977 11.3826 4.99154 11.4457C3.7569 11.5229 3.06943 10.7933 3.06943 10.7933L3.32899 9.67791C3.32899 9.67791 4.01646 10.197 4.56363 10.1619C4.92139 10.1409 5.04767 9.84627 5.04065 9.64283C5.01607 9.26796 4.73308 9.06671 4.41569 8.84101C4.00848 8.55142 3.54465 8.22157 3.49735 7.4331C3.42018 6.24756 4.19885 5.05501 5.91051 4.94277C6.57694 4.90068 6.91366 5.06904 6.91366 5.06904L6.52082 6.53518C6.52082 6.53518 6.08589 6.33876 5.56678 6.36682C4.80915 6.41592 4.79512 6.89294 4.80214 7.0122ZM7.23635 2.9014C7.22934 2.59274 7.19426 2.15781 7.04695 1.78601C7.50994 1.87721 7.74143 2.39632 7.83964 2.71199C7.70008 2.75665 7.54275 2.80575 7.37118 2.8593L7.23635 2.9014Z",fill:"currentColor"}),i("path",{d:"M10.7719 3.44156C10.7757 3.47543 11.1733 6.16931 11.541 8.65883L8.95503 11.2448V2.57871C9.16548 2.78214 9.71265 3.31528 9.71265 3.31528C9.71265 3.31528 10.6106 3.32931 10.6597 3.33633C10.7088 3.34334 10.7649 3.37842 10.7719 3.44156Z",fill:"currentColor"}),i("path",{d:"M14.8056 8.644L14.0424 7.88088C13.7832 7.62163 13.3629 7.62163 13.1036 7.88088L12.1519 8.83258L13.8539 10.5345L14.8056 9.58282C15.0648 9.32357 15.0648 8.90325 14.8056 8.644Z",fill:"currentColor"}),i("path",{d:"M7.85018 13.0942L11.6419 9.30246L13.3438 11.0044L9.55212 14.7961C9.43782 14.9104 9.28573 14.9791 9.1244 14.9892L7.93427 15.0641C7.73484 15.0767 7.56961 14.9114 7.58216 14.712L7.65706 13.5219C7.66721 13.3606 7.73588 13.2085 7.85018 13.0942Z",fill:"currentColor"})]})}),i(p,{enable:"Section"==o.tag&&eu()>=25||q,text:q?M("Available in the Shopify theme editor"):M("Page has reached Shopify’s 25 section-limit"),position:"bottom",width:"200px","data-toolbar-duplicate":!0,"data-toolbar-disable":eM,onClick:eM?void 0:e=>eB(e),"aria-hidden":"true",className:eM?"!gp-cursor-not-allowed":"",children:i("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:i("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M6.08423 1.21289C5.53194 1.21289 5.08423 1.66061 5.08423 2.21289V3.78711H4.26172C3.43329 3.78711 2.76172 4.45868 2.76172 5.28711V13.2871C2.76172 14.1155 3.43329 14.7871 4.26172 14.7871H10.2617C11.0901 14.7871 11.7617 14.1155 11.7617 13.2871V12.4629H13.0842C13.6365 12.4629 14.0842 12.0152 14.0842 11.4629V2.21289C14.0842 1.66061 13.6365 1.21289 13.0842 1.21289H6.08423ZM10.7617 12.4629H6.08423C5.53194 12.4629 5.08423 12.0152 5.08423 11.4629V4.78711H4.26172C3.98558 4.78711 3.76172 5.01097 3.76172 5.28711V13.2871C3.76172 13.5633 3.98558 13.7871 4.26172 13.7871H10.2617C10.5379 13.7871 10.7617 13.5633 10.7617 13.2871V12.4629Z",fill:"currentColor"})})}),i(p,{"data-toolbar-delete":!0,onClick:e=>ex?null:eA(e),enable:ex,"data-toolbar-disable":ex,text:q?M("Available in the Shopify theme editor"):X.text,width:X.width,position:q?"bottom":O,"aria-hidden":"true",className:ex?"!gp-cursor-not-allowed":"",children:i("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:i("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M11 2.88965V2.38965C11 1.56122 10.3284 0.889648 9.5 0.889648H6.5C5.67157 0.889648 5 1.56122 5 2.38965V2.88965H2C1.72386 2.88965 1.5 3.11351 1.5 3.38965C1.5 3.66579 1.72386 3.88965 2 3.88965H3.21997V13.1099C3.21997 14.2144 4.1154 15.1099 5.21997 15.1099H11.22C12.3245 15.1099 13.22 14.2144 13.22 13.1099V3.88965H14C14.2761 3.88965 14.5 3.66579 14.5 3.38965C14.5 3.11351 14.2761 2.88965 14 2.88965H11ZM6 2.88965H10V2.38965C10 2.11351 9.77614 1.88965 9.5 1.88965H6.5C6.22386 1.88965 6 2.11351 6 2.38965V2.88965ZM6.24976 6.13965C6.66397 6.13965 6.99976 6.47543 6.99976 6.88965V11.3896C6.99976 11.8039 6.66397 12.1396 6.24976 12.1396C5.83554 12.1396 5.49976 11.8039 5.49976 11.3896V6.88965C5.49976 6.47543 5.83554 6.13965 6.24976 6.13965ZM10.4998 6.88965C10.4998 6.47543 10.164 6.13965 9.74976 6.13965C9.33554 6.13965 8.99976 6.47543 8.99976 6.88965V11.3896C8.99976 11.8039 9.33554 12.1396 9.74976 12.1396C10.164 12.1396 10.4998 11.8039 10.4998 11.3896V6.88965Z",fill:"currentColor"})})})]}),i(b,{uid:o.uid})]},o.uid),"STATIC"!==H&&"POST_PURCHASE"!==H&&25>eH()&&i(h,{...o}),i("div",{"data-outline":!0,"data-outline-section":"Section"==o.tag,"data-outline-theme-section":"Section"==o.tag&&!!Z||P,"data-outline-shopify-section":"Section"==o.tag&&!!q,"data-outline-limit":eE,"data-outline-error":!!eo},"outline-"+o.uid),"Section"==o.tag&&!P&&e(t,{children:[i(p,{enable:eu()>=25,text:M("Page has reached Shopify’s 25 section-limit"),position:"top","data-toolbar-add-top":!0,"data-toolbar-disable":eu()>=25,"data-toolbar-add-open":"above"==T,onClick:e=>e$(e,"above"),"aria-hidden":"true",children:i("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:i("path",{d:"M8.45 3.95C8.45 3.70147 8.24853 3.5 8 3.5C7.75147 3.5 7.55 3.70147 7.55 3.95V7.55H3.95C3.70147 7.55 3.5 7.75147 3.5 8C3.5 8.24853 3.70147 8.45 3.95 8.45H7.55V12.05C7.55 12.2985 7.75147 12.5 8 12.5C8.24853 12.5 8.45 12.2985 8.45 12.05V8.45H12.05C12.2985 8.45 12.5 8.24853 12.5 8C12.5 7.75147 12.2985 7.55 12.05 7.55H8.45V3.95Z",fill:"#212121"})})}),i(p,{enable:eu()>=25,text:M("Page has reached Shopify’s 25 section-limit"),position:"top","data-toolbar-add-bottom":!0,"data-toolbar-disable":eu()>=25,"data-toolbar-add-open":"below"==T,onClick:e=>e$(e,"below"),"aria-hidden":"true",children:i("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:i("path",{d:"M8.45 3.95C8.45 3.70147 8.24853 3.5 8 3.5C7.75147 3.5 7.55 3.70147 7.55 3.95V7.55H3.95C3.70147 7.55 3.5 7.75147 3.5 8C3.5 8.24853 3.70147 8.45 3.95 8.45H7.55V12.05C7.55 12.2985 7.75147 12.5 8 12.5C8.24853 12.5 8.45 12.2985 8.45 12.05V8.45H12.05C12.2985 8.45 12.5 8.24853 12.5 8C12.5 7.75147 12.2985 7.55 12.05 7.55H8.45V3.95Z",fill:"#212121"})})})]}),eo&&i(c,{errorSectionInfo:eo,onDismiss:eR}),g.includes(o.tag)&&z&&i(v,{...o}),z&&i(u,{...o})]})});export{M as default};
@@ -0,0 +1 @@
1
+ import{jsxs as e,jsx as r}from"react/jsx-runtime";import"react";import"zustand";import{useI18nStore as t}from"../../contexts/I18nContext.js";import"react-transition-group";import"swr";import"swr/infinite";import"../../graphql/queries/collection-detail-filter.generated.js";import"../../graphql/queries/collection.generated.js";import"../../graphql/queries/collections.generated.js";import"../../graphql/queries/published-theme-pages.generated.js";import"../../graphql/queries/products.generated.js";import"../../graphql/queries/store-property.generated.js";import"../../graphql/queries/preview-page.generated.js";import"../../graphql/queries/published-shop-metas.generated.js";import"../../graphql/queries/shop-shopify.generated.js";import"../../graphql/queries/articles.generated.js";import"../../graphql/queries/blogs.generated.js";import"../../graphql/queries/products-with-selling-plans.generated.js";import"../../graphql/queries/product-variant-with-selling-plans.generated.js";import"../../graphql/queries/product-little-detail.generated.js";import"../../graphql/queries/product-medias.generated.js";import"../../graphql/queries/product-variants.generated.js";import"classnames";import"dayjs";import"@gem-sdk/core";import{CheckMarkIcon as p,LoadingIcon as s,CircleUpIcon as i}from"./icons.js";import"../../helpers/convert.js";import"crc-32";import"@gem-sdk/adapter-shopify";import"swr/mutation";import"vanilla-lazyload";import"../../hooks/useCartUI.js";import"../../graphql/queries/product-value-label.generated.js";import"../../hooks/useStickyStore.js";import"../../types/builder.js";import"../../types/builderUpsell.js";import"../../types/custom.js";import"../../types/animations.js";let a=({isLoading:a,isUpdated:o,onUpgrade:l})=>{let{t:g}=t(),d={old:{icon:r(i,{}),label:g("Upgrade"),className:"gp-relative",showDot:!0},loading:{icon:r(s,{}),label:"",className:"gp-animate-spin gp-ease-in-out gp-px-6",showDot:!1},updated:{icon:r(p,{}),label:g("Updated"),className:"",showDot:!1}},n=d[a?"loading":o?"updated":"old"];return e("button",{disabled:a,"data-toolbar-upgrade-element":"true",className:"gp-flex gp-gap-[6px] gp-items-center hover:gp-bg-[#3B3B3B] gp-font-medium disabled:gp-opacity-60 disabled:gp-cursor-not-allowed ",onClick:l,children:[r("div",{className:`gp-shrink-0 gp-overflow-hidden ${n.className}`,children:n.icon}),n.showDot&&r("div",{className:"gp-absolute gp-left-[10px] gp-top-[-2px] gp-size-4 gp-overflow-hidden",children:r("div",{className:"gp-absolute gp-inset-1/4 gp-rounded-full gp-bg-[#3C67FF]"})}),n.label&&r("span",{className:"gp-text-[12px] gp-leading-5 gp-text-[#F9F9F9] gp-whitespace-nowrap",children:n.label})]})};export{a as default};
@@ -0,0 +1 @@
1
+ import{jsx as e}from"react/jsx-runtime";import{useState as r,useMemo as t,useCallback as i,useEffect as s}from"react";import"zustand";import{usePageStore as o}from"../../contexts/PageContext.js";import"react-transition-group";import{oldElementTags as p}from"../constant.js";import"swr";import"swr/infinite";import"../../graphql/queries/collection-detail-filter.generated.js";import"../../graphql/queries/collection.generated.js";import"../../graphql/queries/collections.generated.js";import"../../graphql/queries/published-theme-pages.generated.js";import"../../graphql/queries/products.generated.js";import"../../graphql/queries/store-property.generated.js";import"../../graphql/queries/preview-page.generated.js";import"../../graphql/queries/published-shop-metas.generated.js";import"../../graphql/queries/shop-shopify.generated.js";import"../../graphql/queries/articles.generated.js";import"../../graphql/queries/blogs.generated.js";import"../../graphql/queries/products-with-selling-plans.generated.js";import"../../graphql/queries/product-variant-with-selling-plans.generated.js";import"../../graphql/queries/product-little-detail.generated.js";import"../../graphql/queries/product-medias.generated.js";import"../../graphql/queries/product-variants.generated.js";import"classnames";import"dayjs";import"@gem-sdk/core";import a from"./UpgradeButton.js";import"../../helpers/convert.js";import"crc-32";import"@gem-sdk/adapter-shopify";import"swr/mutation";import"vanilla-lazyload";import"../../hooks/useCartUI.js";import"../../graphql/queries/product-value-label.generated.js";import"../../hooks/useStickyStore.js";import"../../types/builder.js";import"../../types/builderUpsell.js";import"../../types/custom.js";import"../../types/animations.js";let l=({tag:l,uid:m})=>{let[n,d]=r(!1),g=o(e=>e.oldElements),u=t(()=>!!m&&(g?.some(e=>e.uid===m)??!1),[g,m]),q=t(()=>u&&!!l&&!p.includes(l),[u,l]),h=i(e=>{e.preventDefault(),e.stopPropagation(),d(!0),window.dispatchEvent(new CustomEvent("editor:toolbar:upgrade-old-element",{bubbles:!0,detail:{componentUid:m,fromTag:l}}))},[l,m]);return(s(()=>{q&&d(!1)},[q]),l&&m&&u)?e(a,{isLoading:n,isUpdated:q,onUpgrade:h}):null};export{l as default};
@@ -0,0 +1,2 @@
1
+ 'use client';
2
+ import{jsx as C,jsxs as l}from"react/jsx-runtime";let e=()=>l("svg",{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",children:[C("path",{d:"M6.50098 4.6583L6.50098 10.5366C6.50098 10.8128 6.72483 11.0366 7.00098 11.0366C7.27712 11.0366 7.50098 10.8128 7.50098 10.5366L7.50098 4.65845L9.01147 6.16738C9.20683 6.36254 9.52341 6.36237 9.71857 6.16701C9.91374 5.97165 9.91357 5.65506 9.71821 5.4599L7.3595 3.10364C7.33765 3.08116 7.3137 3.06073 7.28797 3.04266C7.27238 3.03172 7.25613 3.02164 7.23931 3.0125C7.16846 2.97401 7.08727 2.95215 7.00098 2.95215C6.94395 2.95215 6.88916 2.96169 6.8381 2.97928C6.76849 3.00319 6.7031 3.0429 6.64753 3.09841L4.28359 5.4599C4.08823 5.65506 4.08807 5.97165 4.28323 6.16701C4.47839 6.36237 4.79497 6.36254 4.99033 6.16738L6.50098 4.6583Z",fill:"#F9F9F9"}),C("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M0 6.9941C0 3.13088 3.13487 0 7.00083 0C10.8668 0 14.0017 3.13088 14.0017 6.9941C14.0017 10.8573 10.8668 13.9882 7.00083 13.9882C3.13487 13.9882 0 10.8573 0 6.9941ZM7.00083 1C3.68617 1 1 3.68414 1 6.9941C1 10.3041 3.68617 12.9882 7.00083 12.9882C10.3155 12.9882 13.0017 10.3041 13.0017 6.9941C13.0017 3.68414 10.3155 1 7.00083 1Z",fill:"#F9F9F9"})]}),i=()=>C("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:C("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M12.6241 4.77571C12.8584 5.01003 12.8584 5.38993 12.6241 5.62424L7.42407 10.8242C7.18975 11.0586 6.80986 11.0586 6.57554 10.8242L3.97554 8.22424C3.74123 7.98993 3.74123 7.61003 3.97554 7.37571C4.20986 7.1414 4.58975 7.1414 4.82407 7.37571L6.9998 9.55145L11.7755 4.77571C12.0099 4.5414 12.3898 4.5414 12.6241 4.77571Z",fill:"#F9F9F9"})}),n=()=>C("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:C("path",{d:"M8 11.5C8.27614 11.5 8.5 11.7239 8.5 12V14.5C8.5 14.7761 8.27614 15 8 15C7.72386 15 7.5 14.7761 7.5 14.5V12C7.5 11.7239 7.72386 11.5 8 11.5ZM4.81836 10.4746C5.01355 10.2795 5.33013 10.2796 5.52539 10.4746C5.72063 10.6699 5.72059 10.9864 5.52539 11.1816L3.75781 12.9502C3.56261 13.1451 3.24598 13.1451 3.05078 12.9502C2.85552 12.7549 2.85552 12.4374 3.05078 12.2422L4.81836 10.4746ZM10.4746 10.4746C10.6699 10.2796 10.9865 10.2795 11.1816 10.4746L12.9492 12.2422C13.1445 12.4374 13.1445 12.7549 12.9492 12.9502C12.754 13.1451 12.4374 13.1451 12.2422 12.9502L10.4746 11.1816C10.2794 10.9864 10.2794 10.6699 10.4746 10.4746ZM4 7.5C4.27614 7.5 4.5 7.72386 4.5 8C4.5 8.27614 4.27614 8.5 4 8.5H1.5C1.22386 8.5 1 8.27614 1 8C1 7.72386 1.22386 7.5 1.5 7.5H4ZM14.5 7.5C14.7761 7.5 15 7.72386 15 8C15 8.27614 14.7761 8.5 14.5 8.5H12C11.7239 8.5 11.5 8.27614 11.5 8C11.5 7.72386 11.7239 7.5 12 7.5H14.5ZM3.0498 3.0498C3.24501 2.85487 3.56164 2.85487 3.75684 3.0498L5.52441 4.81836C5.71962 5.01363 5.71966 5.33015 5.52441 5.52539C5.32915 5.72039 5.01257 5.72052 4.81738 5.52539L3.0498 3.75781C2.85454 3.56255 2.85454 3.24507 3.0498 3.0498ZM12.2432 3.0498C12.4384 2.85487 12.755 2.85487 12.9502 3.0498C13.1455 3.24507 13.1455 3.56255 12.9502 3.75781L11.1826 5.52539C10.9874 5.72052 10.6708 5.72039 10.4756 5.52539C10.2803 5.33015 10.2804 5.01363 10.4756 4.81836L12.2432 3.0498ZM8 1C8.27614 1 8.5 1.22386 8.5 1.5V4C8.5 4.27614 8.27614 4.5 8 4.5C7.72386 4.5 7.5 4.27614 7.5 4V1.5C7.5 1.22386 7.72386 1 8 1Z",fill:"#F9F9F9"})});export{i as CheckMarkIcon,e as CircleUpIcon,n as LoadingIcon};
@@ -1,2 +1,2 @@
1
1
  'use client';
2
- import{jsx as e}from"react/jsx-runtime";import{useContext as t,createContext as a,useMemo as i}from"react";import{useStore as n,createStore as r}from"zustand";let o=a(null),s=e=>r((t,a)=>({...e,lazyloadSectionMeta:e.lazyloadSectionMeta??!0,setAssignedProductIds:e=>{t({assignedProductIds:e})},setIsApplyAllProducts:e=>{t({isApplyAllProducts:e})},setDynamicProduct:e=>{t({dynamicProduct:e})},setDynamicCollection:e=>{t({dynamicCollection:e})},setPostPurchaseProductOffers:e=>{t({productOffers:e})},setDynamicDiscountOffer:e=>{t({dynamicDiscountOffer:e})},setSalePageProductId:e=>{t({salePageProductId:e})},setPublicStoreFrontData:e=>{t({publicStoreFrontData:e})},setInteractionIsSelectOnPage:e=>{t(t=>({interactionData:{...t.interactionData,isSelectOnPage:e}}))},setInteractionItem:e=>{t(t=>({interactionData:{...t.interactionData,item:e,isSelectOnPage:t.interactionData?.isSelectOnPage||!1}}))},setInteractionSelectType:e=>{t(t=>({interactionData:{...t.interactionData,selectType:e}}))},setInteractionSettingType:e=>{t(t=>({interactionData:{...t.interactionData,settingType:e}}))},setSidebarMode:e=>{t(()=>({sidebarMode:e}))},setSellingPlanMeta:e=>{t({sellingPlanMeta:e})},setLazyloadSectionMeta:e=>{t({lazyloadSectionMeta:e})},setBuyerConsentChecked:e=>{t({buyerConsentChecked:e})},getBuyerConsentChecked:()=>a().buyerConsentChecked,setSubscriptionVisible:e=>{t({subscriptionVisible:e})},getSubscriptionVisible:()=>a().subscriptionVisible})),c=({children:t,dynamicProduct:a,dynamicCollection:n,productOffers:r,dynamicDiscountOffer:c,publicStoreFrontData:l,assignedProductIds:d,isApplyAllProducts:u,sellingPlanMeta:P,lazyloadSectionMeta:y,buyerConsentChecked:S,...g})=>{let p=i(()=>s({dynamicProduct:a,dynamicCollection:n,productOffers:r,assignedProductIds:d,isApplyAllProducts:u,dynamicDiscountOffer:c,publicStoreFrontData:l,interactionData:{selectType:"ELEMENT"},sellingPlanMeta:P,lazyloadSectionMeta:y,buyerConsentChecked:S}),[a,n,r,c,l,d,u,P,y,S]);return e(o.Provider,{...g,value:p,children:t})},l=(e,a)=>{let i=t(o);if(!i)throw Error("usePageStore must be used within a PageProvider");return n(i,e,a)};export{c as PageProvider,l as usePageStore};
2
+ import{jsx as e}from"react/jsx-runtime";import{useContext as t,createContext as a,useMemo as i}from"react";import{useStore as n,createStore as r}from"zustand";let o=a(null),s=e=>r((t,a)=>({...e,lazyloadSectionMeta:e.lazyloadSectionMeta??!0,setAssignedProductIds:e=>{t({assignedProductIds:e})},setIsApplyAllProducts:e=>{t({isApplyAllProducts:e})},setDynamicProduct:e=>{t({dynamicProduct:e})},setDynamicCollection:e=>{t({dynamicCollection:e})},setPostPurchaseProductOffers:e=>{t({productOffers:e})},setDynamicDiscountOffer:e=>{t({dynamicDiscountOffer:e})},setSalePageProductId:e=>{t({salePageProductId:e})},setPublicStoreFrontData:e=>{t({publicStoreFrontData:e})},setInteractionIsSelectOnPage:e=>{t(t=>({interactionData:{...t.interactionData,isSelectOnPage:e}}))},setInteractionItem:e=>{t(t=>({interactionData:{...t.interactionData,item:e,isSelectOnPage:t.interactionData?.isSelectOnPage||!1}}))},setInteractionSelectType:e=>{t(t=>({interactionData:{...t.interactionData,selectType:e}}))},setInteractionSettingType:e=>{t(t=>({interactionData:{...t.interactionData,settingType:e}}))},setOldElements:e=>{t({oldElements:e})},setSidebarMode:e=>{t(()=>({sidebarMode:e}))},setSellingPlanMeta:e=>{t({sellingPlanMeta:e})},setLazyloadSectionMeta:e=>{t({lazyloadSectionMeta:e})},setBuyerConsentChecked:e=>{t({buyerConsentChecked:e})},getBuyerConsentChecked:()=>a().buyerConsentChecked,setSubscriptionVisible:e=>{t({subscriptionVisible:e})},getSubscriptionVisible:()=>a().subscriptionVisible})),c=({children:t,dynamicProduct:a,dynamicCollection:n,productOffers:r,dynamicDiscountOffer:c,publicStoreFrontData:l,assignedProductIds:d,isApplyAllProducts:u,sellingPlanMeta:P,lazyloadSectionMeta:y,buyerConsentChecked:S,...g})=>{let m=i(()=>s({dynamicProduct:a,dynamicCollection:n,productOffers:r,assignedProductIds:d,isApplyAllProducts:u,dynamicDiscountOffer:c,publicStoreFrontData:l,interactionData:{selectType:"ELEMENT"},sellingPlanMeta:P,lazyloadSectionMeta:y,buyerConsentChecked:S}),[a,n,r,c,l,d,u,P,y,S]);return e(o.Provider,{...g,value:m,children:t})},l=(e,a)=>{let i=t(o);if(!i)throw Error("usePageStore must be used within a PageProvider");return n(i,e,a)};export{c as PageProvider,l as usePageStore};
@@ -1 +1 @@
1
- let e=(e,t,r)=>e?"string"==typeof t?t:t():("string"==typeof r?r:r?.())??"",t=e=>!("object"!=typeof e||Array.isArray(e))&&null!==e,r=(e,...t)=>{let r=t[0],l=[];for(let e in r)if(Object.hasOwnProperty.call(r,e)){let t=r[e];["symbol","object","function"].includes(typeof t)||(t?l.push(`${e}="${t}"`):l.push(`${e}`))}return l.join(" ")},l=(e,...t)=>{let r=t[0],l=[];for(let e in r)if(Object.hasOwnProperty.call(r,e)){let t=r[e];void 0!==t&&!1!==t&&l.push(`${e}:${t}`)}return l.join(";")},o=e=>JSON.stringify(e).replace(/\\"/g,'"'),i=(e,...o)=>{let i="";return e.forEach((e,s)=>{i+=e,void 0!==o[s]&&(t(o[s])?/style=["|']/.test(e)?i+=l`${o[s]}`:i+=r`${o[s]}`:i+=o[s])}),i=(i=i.replaceAll('style=""',"")).replaceAll('class=""',"")},s=(e,t)=>e(),n=e=>(Object.keys(e).forEach(t=>e?.[t]===void 0&&delete e[t]),e);function a(e){return e.replace(/\{\{\s*(.*?)\s*\}\}/g,(e,t)=>{let r=t.trim(),l=/^([a-zA-Z_][a-zA-Z0-9_-]*)(\.[a-zA-Z0-9_-]+)*$/i.test(r);return l?`{{ ${r} }}`:r})}export{e as RenderIf,s as composeMemo,o as dataStringify,r as props,n as removeUndefinedValuesFromObject,a as sanitizeLiquid,l as styles,i as template};
1
+ let e=(e,t,r)=>e?"string"==typeof t?t:t():("string"==typeof r?r:r?.())??"",t=e=>!("object"!=typeof e||Array.isArray(e))&&null!==e,r=(e,...t)=>{let r=t[0],l=[];for(let e in r)if(Object.hasOwnProperty.call(r,e)){let t=r[e];["symbol","object","function"].includes(typeof t)||(t?l.push(`${e}="${t}"`):l.push(`${e}`))}return l.join(" ")},l=/^(.+)-(tablet|mobile)$/,n=e=>"string"==typeof e&&-1!==e.indexOf("undefined"),i=e=>-1!==e.indexOf("undefined"),o=[{shorthand:"radius",parts:["btlr","btrr","bbrr","bblr"]},{shorthand:"p",parts:["pt","pr","pb","pl"]},{shorthand:"m",parts:["mt","mr","mb","ml"]}],f=["--","--hvr-","--focus-"],s=["","-tablet","-mobile"],a=e=>null!=e&&""!==e&&!1!==e&&!n(e),c=e=>{let t={...e};for(let e of f)for(let r of s)for(let l of o){let n=`${e}${l.shorthand}${r}`;if(n in t&&a(t[n]))continue;let i=l.parts.map(t=>`${e}${t}${r}`);if(i.every(e=>a(t[e])))for(let e of(t[n]=i.map(e=>t[e]).join(" "),i))delete t[e]}return t},p=(e,...t)=>{let r=t[0];if(!r)return"";let o=c(r),f=[],s={},a={};for(let e in o){if(!Object.hasOwnProperty.call(o,e))continue;let t=o[e];if(null==t||""===t||!1===t||n(t)||i(e))continue;let r=l.exec(e),f=r?.[1],c=r?.[2];f&&c?"tablet"===c&&(a[f]=t):s[e]=t}for(let e in o){if(!Object.hasOwnProperty.call(o,e))continue;let t=o[e];if(void 0===t||!1===t||null===t||""===t||n(t)||i(e))continue;let r=l.exec(e),c=r?.[1],p=r?.[2];if(c&&"tablet"===p){if(s[c]===t)continue}else if(c&&"mobile"===p){let e=c in a?a[c]:s[c];if(e===t)continue}f.push(`${e}:${t}`)}return f.join(";")},u=e=>JSON.stringify(e).replace(/\\"/g,'"'),b=(e,...l)=>{let n="";return e.forEach((e,i)=>{n+=e,void 0!==l[i]&&(t(l[i])?/style=["|']/.test(e)?n+=p`${l[i]}`:n+=r`${l[i]}`:n+=l[i])}),n=(n=n.replaceAll('style=""',"")).replaceAll('class=""',"")},d=(e,t)=>e(),y=e=>(Object.keys(e).forEach(t=>e?.[t]===void 0&&delete e[t]),e);function h(e){return e.replace(/\{\{\s*(.*?)\s*\}\}/g,(e,t)=>{let r=t.trim(),l=/^([a-zA-Z_][a-zA-Z0-9_-]*)(\.[a-zA-Z0-9_-]+)*$/i.test(r);return l?`{{ ${r} }}`:r})}export{e as RenderIf,d as composeMemo,u as dataStringify,r as props,y as removeUndefinedValuesFromObject,h as sanitizeLiquid,p as styles,b as template};
@@ -42764,9 +42764,9 @@ type AddonProviderProps = Pick<AddonContextProps, 'components'> & {
42764
42764
 
42765
42765
  declare const AddonProvider: React.FC<AddonProviderProps>;
42766
42766
  declare const useAddons: () => Record<string, React.ComponentType<any>>;
42767
- declare const useAddon: (id?: string) => React.ComponentType<any> | React.FC<BaseProps & {
42767
+ declare const useAddon: (id?: string) => React.FC<BaseProps & {
42768
42768
  children?: React.ReactNode;
42769
- }>;
42769
+ }> | React.ComponentType<any>;
42770
42770
 
42771
42771
  type BuilderComponentProps = {
42772
42772
  components: Record<string, React.ComponentType<any>>;
@@ -42778,9 +42778,9 @@ type BuilderComponentProviderProps = Pick<BuilderComponentProps, 'components'> &
42778
42778
  };
42779
42779
 
42780
42780
  declare const BuilderComponentProvider: React.FC<BuilderComponentProviderProps>;
42781
- declare const useBuilderComponent: (id?: string) => React.FC<BaseProps & {
42781
+ declare const useBuilderComponent: (id?: string) => React.ComponentType<BaseProps> | React.FC<BaseProps & {
42782
42782
  children?: React.ReactNode;
42783
- }> | React.ComponentType<BaseProps>;
42783
+ }>;
42784
42784
 
42785
42785
  type BuilderContextProps = {
42786
42786
  state: BuilderState | SectionData;
@@ -43175,6 +43175,11 @@ type PageContextProps = {
43175
43175
  selectType?: 'ELEMENT' | 'PAGE';
43176
43176
  settingType?: 'TRIGGER' | 'TARGET';
43177
43177
  };
43178
+ oldElements?: {
43179
+ uid: string;
43180
+ label?: string;
43181
+ tag: string;
43182
+ }[];
43178
43183
  sidebarMode?: string;
43179
43184
  sellingPlanMeta?: any;
43180
43185
  lazyloadSectionMeta?: boolean;
@@ -43192,6 +43197,11 @@ type PageContextProps = {
43192
43197
  setInteractionIsSelectOnPage: (value: boolean) => void;
43193
43198
  setInteractionSelectType: (selectType: 'ELEMENT' | 'PAGE') => void;
43194
43199
  setInteractionSettingType: (settingType?: 'TRIGGER' | 'TARGET') => void;
43200
+ setOldElements: (data: {
43201
+ uid: string;
43202
+ label?: string;
43203
+ tag: string;
43204
+ }[]) => void;
43195
43205
  setSidebarMode: (mode: string) => void;
43196
43206
  setSellingPlanMeta: (value: any) => void;
43197
43207
  setLazyloadSectionMeta: (value: boolean) => void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gem-sdk/core",
3
- "version": "17.0.0-dev.87",
3
+ "version": "17.0.0-dev.89",
4
4
  "license": "MIT",
5
5
  "sideEffects": false,
6
6
  "main": "dist/cjs/index.js",
@@ -29,7 +29,7 @@
29
29
  },
30
30
  "devDependencies": {
31
31
  "@gem-sdk/adapter-shopify": "17.0.0-dev.84",
32
- "@gem-sdk/styles": "17.0.0-dev.84",
32
+ "@gem-sdk/styles": "17.0.0-dev.89",
33
33
  "@types/classnames": "^2.3.1"
34
34
  },
35
35
  "dependencies": {
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),r=require("react"),s=require("../ai-generator/icons/UpgradeIcon.js");require("zustand");var i=require("../../contexts/I18nContext.js");require("react-transition-group"),require("swr"),require("swr/infinite"),require("../../graphql/queries/collection-detail-filter.generated.js"),require("../../graphql/queries/collection.generated.js"),require("../../graphql/queries/collections.generated.js"),require("../../graphql/queries/published-theme-pages.generated.js"),require("../../graphql/queries/products.generated.js"),require("../../graphql/queries/store-property.generated.js"),require("../../graphql/queries/preview-page.generated.js"),require("../../graphql/queries/published-shop-metas.generated.js"),require("../../graphql/queries/shop-shopify.generated.js"),require("../../graphql/queries/articles.generated.js"),require("../../graphql/queries/blogs.generated.js"),require("../../graphql/queries/products-with-selling-plans.generated.js"),require("../../graphql/queries/product-variant-with-selling-plans.generated.js"),require("../../graphql/queries/product-little-detail.generated.js"),require("../../graphql/queries/product-medias.generated.js"),require("../../graphql/queries/product-variants.generated.js"),require("classnames"),require("dayjs"),require("@gem-sdk/core"),require("../../helpers/convert.js"),require("crc-32"),require("@gem-sdk/adapter-shopify"),require("swr/mutation"),require("vanilla-lazyload"),require("../../hooks/useCartUI.js"),require("../../graphql/queries/product-value-label.generated.js"),require("../../hooks/useStickyStore.js"),require("../../types/builder.js"),require("../../types/builderUpsell.js"),require("../../types/custom.js"),require("../../types/animations.js"),exports.default=t=>{let{t:a}=i.useI18nStore(),u=r.useCallback(e=>{e.preventDefault(),e.stopPropagation();let r=new CustomEvent("editor:toolbar:upgrade-old-element",{bubbles:!0,detail:{componentUid:t.uid,fromTag:t.tag}});window.dispatchEvent(r)},[t.tag,t.uid]);return t.tag?e.jsxs(e.Fragment,{children:[e.jsxs("button",{type:"button",className:"gp-p-1 gp-text-xs gp-flex gp-gap-1 gp-items-center gp-rounded-md hover:gp-bg-[#3B3B3B] gp-font-medium gp-mr-1",onClick:u,children:[e.jsx(s.UpgradeIcon,{}),a("Upgrade")]}),e.jsx("div",{className:"gp-w-px gp-self-stretch gp-bg-[#424242]"})]}):null};
@@ -1 +0,0 @@
1
- import{jsxs as e,Fragment as r,jsx as t}from"react/jsx-runtime";import{useCallback as p}from"react";import{UpgradeIcon as i}from"../ai-generator/icons/UpgradeIcon.js";import"zustand";import{useI18nStore as s}from"../../contexts/I18nContext.js";import"react-transition-group";import"swr";import"swr/infinite";import"../../graphql/queries/collection-detail-filter.generated.js";import"../../graphql/queries/collection.generated.js";import"../../graphql/queries/collections.generated.js";import"../../graphql/queries/published-theme-pages.generated.js";import"../../graphql/queries/products.generated.js";import"../../graphql/queries/store-property.generated.js";import"../../graphql/queries/preview-page.generated.js";import"../../graphql/queries/published-shop-metas.generated.js";import"../../graphql/queries/shop-shopify.generated.js";import"../../graphql/queries/articles.generated.js";import"../../graphql/queries/blogs.generated.js";import"../../graphql/queries/products-with-selling-plans.generated.js";import"../../graphql/queries/product-variant-with-selling-plans.generated.js";import"../../graphql/queries/product-little-detail.generated.js";import"../../graphql/queries/product-medias.generated.js";import"../../graphql/queries/product-variants.generated.js";import"classnames";import"dayjs";import"@gem-sdk/core";import"../../helpers/convert.js";import"crc-32";import"@gem-sdk/adapter-shopify";import"swr/mutation";import"vanilla-lazyload";import"../../hooks/useCartUI.js";import"../../graphql/queries/product-value-label.generated.js";import"../../hooks/useStickyStore.js";import"../../types/builder.js";import"../../types/builderUpsell.js";import"../../types/custom.js";import"../../types/animations.js";let o=o=>{let{t:a}=s(),l=p(e=>{e.preventDefault(),e.stopPropagation();let r=new CustomEvent("editor:toolbar:upgrade-old-element",{bubbles:!0,detail:{componentUid:o.uid,fromTag:o.tag}});window.dispatchEvent(r)},[o.tag,o.uid]);return o.tag?e(r,{children:[e("button",{type:"button",className:"gp-p-1 gp-text-xs gp-flex gp-gap-1 gp-items-center gp-rounded-md hover:gp-bg-[#3B3B3B] gp-font-medium gp-mr-1",onClick:l,children:[t(i,{}),a("Upgrade")]}),t("div",{className:"gp-w-px gp-self-stretch gp-bg-[#424242]"})]}):null};export{o as default};