@swell/apps-sdk 1.0.13 → 1.0.15

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.
Files changed (143) hide show
  1. package/dist/index.cjs +1 -1
  2. package/dist/index.cjs.map +2 -2
  3. package/dist/index.js +1 -1
  4. package/dist/index.js.map +2 -2
  5. package/dist/index.mjs +1 -1
  6. package/dist/index.mjs.map +2 -2
  7. package/dist/src/api.d.ts +91 -0
  8. package/dist/src/cache.d.ts +17 -0
  9. package/dist/src/categories.d.ts +5 -0
  10. package/dist/src/compatibility/shopify-configs.d.ts +10 -0
  11. package/dist/src/compatibility/shopify-fonts.d.ts +1 -0
  12. package/dist/src/compatibility/shopify-objects/address.d.ts +6 -0
  13. package/dist/src/compatibility/shopify-objects/article.d.ts +5 -0
  14. package/dist/src/compatibility/shopify-objects/blog.d.ts +5 -0
  15. package/dist/src/compatibility/shopify-objects/cart.d.ts +5 -0
  16. package/dist/src/compatibility/shopify-objects/collection.d.ts +5 -0
  17. package/dist/src/compatibility/shopify-objects/collections.d.ts +3 -0
  18. package/dist/src/compatibility/shopify-objects/customer.d.ts +5 -0
  19. package/dist/src/compatibility/shopify-objects/filter.d.ts +5 -0
  20. package/dist/src/compatibility/shopify-objects/font.d.ts +4 -0
  21. package/dist/src/compatibility/shopify-objects/form.d.ts +28 -0
  22. package/dist/src/compatibility/shopify-objects/image.d.ts +6 -0
  23. package/dist/src/compatibility/shopify-objects/index.d.ts +26 -0
  24. package/dist/src/compatibility/shopify-objects/line_item.d.ts +6 -0
  25. package/dist/src/compatibility/shopify-objects/link.d.ts +4 -0
  26. package/dist/src/compatibility/shopify-objects/localization.d.ts +4 -0
  27. package/dist/src/compatibility/shopify-objects/media.d.ts +4 -0
  28. package/dist/src/compatibility/shopify-objects/order.d.ts +10 -0
  29. package/dist/src/compatibility/shopify-objects/page.d.ts +4 -0
  30. package/dist/src/compatibility/shopify-objects/paginate.d.ts +4 -0
  31. package/dist/src/compatibility/shopify-objects/predictive_search.d.ts +4 -0
  32. package/dist/src/compatibility/shopify-objects/product.d.ts +6 -0
  33. package/dist/src/compatibility/shopify-objects/resource.d.ts +23 -0
  34. package/dist/src/compatibility/shopify-objects/search.d.ts +4 -0
  35. package/dist/src/compatibility/shopify-objects/shop.d.ts +4 -0
  36. package/dist/src/compatibility/shopify-objects/variant.d.ts +5 -0
  37. package/dist/src/compatibility/shopify.d.ts +71 -0
  38. package/dist/src/constants.d.ts +1 -0
  39. package/dist/src/content.d.ts +8 -0
  40. package/dist/src/easyblocks/config.d.ts +136 -0
  41. package/dist/src/easyblocks/index.d.ts +2 -0
  42. package/dist/src/easyblocks/utils.d.ts +36 -0
  43. package/dist/src/fonts.d.ts +6 -0
  44. package/dist/src/index.d.ts +14 -0
  45. package/dist/src/liquid/color.d.ts +33 -0
  46. package/dist/src/liquid/filters/asset_url.d.ts +2 -0
  47. package/dist/src/liquid/filters/brightness_difference.d.ts +2 -0
  48. package/dist/src/liquid/filters/color_brightness.d.ts +2 -0
  49. package/dist/src/liquid/filters/color_contrast.d.ts +2 -0
  50. package/dist/src/liquid/filters/color_darken.d.ts +2 -0
  51. package/dist/src/liquid/filters/color_desaturate.d.ts +2 -0
  52. package/dist/src/liquid/filters/color_difference.d.ts +2 -0
  53. package/dist/src/liquid/filters/color_extract.d.ts +4 -0
  54. package/dist/src/liquid/filters/color_lighten.d.ts +2 -0
  55. package/dist/src/liquid/filters/color_mix.d.ts +2 -0
  56. package/dist/src/liquid/filters/color_modify.d.ts +4 -0
  57. package/dist/src/liquid/filters/color_saturate.d.ts +2 -0
  58. package/dist/src/liquid/filters/color_to_hex.d.ts +2 -0
  59. package/dist/src/liquid/filters/color_to_hsl.d.ts +2 -0
  60. package/dist/src/liquid/filters/color_to_rgb.d.ts +2 -0
  61. package/dist/src/liquid/filters/date.d.ts +10 -0
  62. package/dist/src/liquid/filters/default_errors.d.ts +2 -0
  63. package/dist/src/liquid/filters/font_face.d.ts +2 -0
  64. package/dist/src/liquid/filters/font_modify.d.ts +3 -0
  65. package/dist/src/liquid/filters/font_url.d.ts +2 -0
  66. package/dist/src/liquid/filters/format_address.d.ts +6 -0
  67. package/dist/src/liquid/filters/image_tag.d.ts +2 -0
  68. package/dist/src/liquid/filters/image_url.d.ts +6 -0
  69. package/dist/src/liquid/filters/index.d.ts +88 -0
  70. package/dist/src/liquid/filters/json.d.ts +2 -0
  71. package/dist/src/liquid/filters/json_pretty.d.ts +2 -0
  72. package/dist/src/liquid/filters/money.d.ts +2 -0
  73. package/dist/src/liquid/filters/money_with_currency.d.ts +2 -0
  74. package/dist/src/liquid/filters/money_without_currency.d.ts +2 -0
  75. package/dist/src/liquid/filters/money_without_trailing_zeros.d.ts +2 -0
  76. package/dist/src/liquid/filters/shopify/default_pagination.d.ts +3 -0
  77. package/dist/src/liquid/filters/shopify/hex_to_rgba.d.ts +2 -0
  78. package/dist/src/liquid/filters/shopify/item_count_for_variant.d.ts +6 -0
  79. package/dist/src/liquid/filters/shopify/payment_button.d.ts +2 -0
  80. package/dist/src/liquid/filters/shopify/payment_terms.d.ts +2 -0
  81. package/dist/src/liquid/filters/shopify/placeholder-svgs/blog-apparel-1.d.ts +2 -0
  82. package/dist/src/liquid/filters/shopify/placeholder-svgs/blog-apparel-2.d.ts +2 -0
  83. package/dist/src/liquid/filters/shopify/placeholder-svgs/blog-apparel-3.d.ts +2 -0
  84. package/dist/src/liquid/filters/shopify/placeholder-svgs/collection-1.d.ts +2 -0
  85. package/dist/src/liquid/filters/shopify/placeholder-svgs/collection-2.d.ts +2 -0
  86. package/dist/src/liquid/filters/shopify/placeholder-svgs/collection-3.d.ts +2 -0
  87. package/dist/src/liquid/filters/shopify/placeholder-svgs/collection-4.d.ts +2 -0
  88. package/dist/src/liquid/filters/shopify/placeholder-svgs/collection-5.d.ts +2 -0
  89. package/dist/src/liquid/filters/shopify/placeholder-svgs/collection-6.d.ts +2 -0
  90. package/dist/src/liquid/filters/shopify/placeholder-svgs/collection-apparel-1.d.ts +2 -0
  91. package/dist/src/liquid/filters/shopify/placeholder-svgs/collection-apparel-2.d.ts +2 -0
  92. package/dist/src/liquid/filters/shopify/placeholder-svgs/collection-apparel-3.d.ts +2 -0
  93. package/dist/src/liquid/filters/shopify/placeholder-svgs/collection-apparel-4.d.ts +2 -0
  94. package/dist/src/liquid/filters/shopify/placeholder-svgs/detailed-apparel-1.d.ts +2 -0
  95. package/dist/src/liquid/filters/shopify/placeholder-svgs/hero-apparel-1.d.ts +2 -0
  96. package/dist/src/liquid/filters/shopify/placeholder-svgs/hero-apparel-2.d.ts +2 -0
  97. package/dist/src/liquid/filters/shopify/placeholder-svgs/hero-apparel-3.d.ts +2 -0
  98. package/dist/src/liquid/filters/shopify/placeholder-svgs/image.d.ts +2 -0
  99. package/dist/src/liquid/filters/shopify/placeholder-svgs/index.d.ts +33 -0
  100. package/dist/src/liquid/filters/shopify/placeholder-svgs/lifestyle-1.d.ts +2 -0
  101. package/dist/src/liquid/filters/shopify/placeholder-svgs/lifestyle-2.d.ts +2 -0
  102. package/dist/src/liquid/filters/shopify/placeholder-svgs/product-1.d.ts +2 -0
  103. package/dist/src/liquid/filters/shopify/placeholder-svgs/product-2.d.ts +2 -0
  104. package/dist/src/liquid/filters/shopify/placeholder-svgs/product-3.d.ts +2 -0
  105. package/dist/src/liquid/filters/shopify/placeholder-svgs/product-4.d.ts +2 -0
  106. package/dist/src/liquid/filters/shopify/placeholder-svgs/product-5.d.ts +2 -0
  107. package/dist/src/liquid/filters/shopify/placeholder-svgs/product-6.d.ts +2 -0
  108. package/dist/src/liquid/filters/shopify/placeholder-svgs/product-apparel-1.d.ts +2 -0
  109. package/dist/src/liquid/filters/shopify/placeholder-svgs/product-apparel-2.d.ts +2 -0
  110. package/dist/src/liquid/filters/shopify/placeholder-svgs/product-apparel-3.d.ts +2 -0
  111. package/dist/src/liquid/filters/shopify/placeholder-svgs/product-apparel-4.d.ts +2 -0
  112. package/dist/src/liquid/filters/shopify/placeholder_svg_tag.d.ts +2 -0
  113. package/dist/src/liquid/filters/stylesheet_tag.d.ts +2 -0
  114. package/dist/src/liquid/filters/time_tag.d.ts +2 -0
  115. package/dist/src/liquid/filters/translate.d.ts +2 -0
  116. package/dist/src/liquid/filters/where.d.ts +2 -0
  117. package/dist/src/liquid/font.d.ts +50 -0
  118. package/dist/src/liquid/form.d.ts +17 -0
  119. package/dist/src/liquid/index.d.ts +67 -0
  120. package/dist/src/liquid/operators.d.ts +4 -0
  121. package/dist/src/liquid/tags/case.d.ts +3 -0
  122. package/dist/src/liquid/tags/for.d.ts +3 -0
  123. package/dist/src/liquid/tags/form.d.ts +3 -0
  124. package/dist/src/liquid/tags/index.d.ts +28 -0
  125. package/dist/src/liquid/tags/javascript.d.ts +3 -0
  126. package/dist/src/liquid/tags/layout.d.ts +3 -0
  127. package/dist/src/liquid/tags/paginate.d.ts +3 -0
  128. package/dist/src/liquid/tags/render.d.ts +3 -0
  129. package/dist/src/liquid/tags/section.d.ts +3 -0
  130. package/dist/src/liquid/tags/sections.d.ts +3 -0
  131. package/dist/src/liquid/tags/shopify/include.d.ts +3 -0
  132. package/dist/src/liquid/tags/shopify/schema.d.ts +3 -0
  133. package/dist/src/liquid/tags/style.d.ts +3 -0
  134. package/dist/src/liquid/utils.d.ts +50 -0
  135. package/dist/src/menus.d.ts +27 -0
  136. package/dist/src/products.d.ts +9 -0
  137. package/dist/src/resources.d.ts +99 -0
  138. package/dist/src/theme.d.ts +127 -0
  139. package/dist/src/utils/index.d.ts +19 -0
  140. package/dist/src/utils/md5.d.ts +1 -0
  141. package/dist/types/shopify.d.ts +126 -0
  142. package/dist/types/swell.d.ts +341 -0
  143. package/package.json +1 -1
package/dist/index.cjs CHANGED
@@ -37,7 +37,7 @@
37
37
  `.trim(),a},{})}async renderSection(t,e){e&&this.setGlobals(e);let[l,c]=t?.split(/\_\_/).reverse(),a=await this.getThemeTemplateConfigByType(c?"templates":"sections",c||l);if(a){let s=await this.renderThemeTemplate(a.file_path,e);if(c&&s?.sections){let n={id:a.name,sections:{[l]:s?.sections?.[l]}},[r]=await this.renderPageSections(n,e);return r.output||""}return s}return""}async renderLayout(t){return this.liquidSwell.layoutName?await this.renderLayoutTemplate(this.liquidSwell.layoutName,t):t?.content_for_layout||""}getContentForHeader(){let t=`
38
38
  `;return t+=this.renderFontHeaderLinks(),this.shopifyCompatibility&&(t+=`
39
39
  ${this.shopifyCompatibility.getContentForHeader()}`),t}renderFontHeaderLinks(){let t=this.globals.settings,e=this.globals.configs?.editor?.settings||[];if(t&&e){let l=z3("font",t,e),c=[];for(let a=0;a<l.length;a++){let s=l[a].value?.id||l[a].value;if(this.shopifyCompatibility){let n=this.shopifyCompatibility.getFontFromShopifySetting(s);c.includes(n||s)||c.push(n||s)}else c.includes(s)||c.push(s)}if(l.length>0)return`<link href="${H.combinedGoogleFontUrl(c)}" rel="stylesheet">`}return""}async getTemplateSchema(t){let e,l=await this.getThemeConfig(t.file_path);if(l?.file_path?.endsWith(".liquid")){if(this.shopifyCompatibility){this.liquidSwell.lastSchema=void 0,await this.renderTemplate(l);let c=this.liquidSwell.lastSchema||{};c&&(e=this.shopifyCompatibility.getSectionConfigSchema(c),e=await this.shopifyCompatibility.renderSchemaTranslations(this,e,this.globals.request?.locale))}}else if(l?.file_data)try{e=JSON.parse(l?.file_data)||void 0}catch{}return e}async resolveSectionDefaultSettings(t,e){let l={},c=e||t?.default||{};return t?.fields&&t.fields.forEach(a=>{a.default!==void 0&&(l[a.id]=a.default)}),Object.assign(l,c.settings,{blocks:c.blocks}),l.blocks instanceof Array&&(l.blocks=l.blocks.map(a=>{let s={},n=t?.blocks?.find(r=>r.type===a.type);return n?.fields&&n.fields.forEach(r=>{r.default!==void 0&&(s[r.id]=r.default)}),{...a,settings:{...s,...a.settings||void 0}}})),l}async getAllSections(){let t=await this.getAllThemeConfigs();return await _3(t,this.getTemplateSchema.bind(this))}async getPageSections(t,e=!0){let l=await X1(t,c=>this.getSectionSchema(c));if(e)for(let c of l){let{schema:a}=c;a?.fields&&this.globals&&c.settings&&(c.settings=Y1(this,c))}return l}async getLayoutSectionGroups(t=!0){let e=await this.getAllThemeConfigs(),l=await T3(e,this.getTemplateSchema.bind(this));if(t)for(let c of l)for(let a of c.sectionConfigs){let{schema:s}=a;s?.fields&&this.globals&&a.settings&&(a.settings=Y1(this,a))}return l}async renderPageSections(t,e){let l=await this.getPageSections(t);return this.renderSectionConfigs(l,e)}async renderSectionConfigs(t,e){return await Promise.all(t.map((l,c)=>{let{section:a,schema:s}=l,{settings:n}=l;return s?.fields&&this.globals&&(n=Y1(this,l)),new Promise(async r=>{let p=await this.getThemeTemplateConfigByType("sections",`${a.type}.liquid`),w=p?await this.renderTemplate(p,{...e,...n,index:c,template:p}):"";r({...l,output:w})})}))}async renderTemplateSections(t,e){return(await this.renderPageSections(t,e)).map(c=>`<${c.tag} ${c.class?`class="${c.class}"`:""}>${c.output}</${c.tag}>`).join(`
40
- `)}async renderTranslation(t,e,l){let c=this.globals.translations,a=this.globals.request?.locale;return this.renderTranslationValue(a,c,t,e,l)}async renderTranslationValue(t,e,l,c,a){if(l===void 0)return a||"";let s=l?.split(".")||[],n=s.pop()||"",r=s.join("."),p=(0,R.get)(e,r),w=(0,R.get)(p?.[t],n)||(0,R.get)(p?.[t.split("-")[0]],n)||p?.[n];return c?.count!==void 0&&w?.one&&(w=c.count===1?w.one:w.other),typeof w!="string"||w===""?a||"":await this.renderTemplateString(w,c)||a||""}renderCurrency(t,e){let l=this.swell.storefront.settings,c=this.swell.storefront.currency,a=l.state,s=c.code=a?.store?.currency||"USD";return c.locale=a?.store?.locale||"en-US",c.state=a?.store?.locales?.find(n=>n.code===s)||{code:s},c.format(t,e)}},P1=class{title;status=500;message;description;constructor(t="Something went wrong",e=500,l){this.title=String(t),this.status=e,this.message=this.title+(l?`: ${l}`:""),this.description=l}toString(){return this.message}},R1=class extends P1{constructor(t="Page not found",e=404,l){super(t,e,l)}};function Y1(i,t){let{settings:e,schema:l}=t;if(!e?.section?.settings||!l?.fields)return e;let c=[{label:t.id,fields:l.fields}];return{...e,section:{...e.section,settings:L1(i,e.section.settings,c),blocks:e.section.blocks?.map(a=>({...a,settings:L1(i,a.settings,l.blocks?.filter(s=>s.type===a.type))}))}}}function L1(i,t,e){let l=(0,R.cloneDeep)(t);return(0,R.each)(l,(c,a)=>{let s=e&&S3(e,a);if(Z1(c)&&!(c instanceof L)){switch(s?.type){case"color_scheme_group":(0,R.each)(c,(n,r)=>{(0,R.each)(c[r].settings,(p,w)=>{p&&(c[r].settings[w]=new T(p))})});return;default:break}l[a]=L1(i,c,e)}else switch(s?.type){case"lookup":case"product_lookup":case"category_lookup":case"customer_lookup":l[a]=i.resolveLookupSetting(s,c);break;case"color":c&&(l[a]=new T(c));break;case"font":l[a]=i.resolveFontSetting(c);break;case"menu":l[a]=i.resolveMenuSetting(c);break;case"url":l[a]=i.resolveUrlSetting(c);break}}),l}function z3(i,t,e){let l=[];return(0,R.each)(t,(c,a)=>{if(Z1(c)&&!(c instanceof H))l.push(...z3(i,c,e));else{let s=S3(e,a);s?.type===i&&l.push({setting:s,value:c})}}),l}function c4(i){if(i.collection)return i.collection;switch(i.type){case"product_lookup":return"products";case"category_lookup":return"categories";case"customer_lookup":return"accounts"}}function S3(i,t){for(let e of i||[])for(let l of e.fields)if(l.id===t)return l}function M3(i,t){let e=t.currencies.find(l=>l.code===t.currency);return new v({accepts_gift_cards:!0,address:{},brand:{},collections_count:0,currency:t.currency,customer_accounts_enabled:!0,customer_accounts_optional:!0,description:t.description,domain:t.url.replace(/^http[s]?:\/\//,""),email:t.support_email,enabled_currencies:t.currencies.map(l=>({iso_code:l.code,name:l.name,symbol:l.symbol})),enabled_payment_providers:[],id:t.id,metafields:null,metaobjects:null,money_format:t.currencies.find(l=>l.code===t.currency),money_with_currency_format:{...e,symbol:`${t.currency} ${e?.symbol||""}`},name:t.name,password_message:null,permanent_domain:`${t.id}.swell.store`,phone:t.support_phone,published_locales:t.locales.map(l=>({endonym_name:l.name,iso_code:l.code,name:l.name,primary:l.code===t.locale,root_url:t.url})),secure_url:t.url,types:[],url:t.url,vendors:[],policies:[],privacy_policy:null,refund_policy:null,shipping_policy:null,subscription_policy:null,terms_of_service:null,products_count:0})}function a4(i){let t={settings:[]};return Array.isArray(i)&&(i[0]?.name==="theme_info"&&i.shift(),i.forEach(e=>{t.settings.push(z0(e))})),t}function s4(i){return i.current||{}}function n4(i){return Object.entries(i.presets||{}).map(([t,e])=>({label:t,settings:e}))}function r4(i){return{label:i.name,type:i.type,tag:i.tag,class:i.class,enabled_on:i.enabled_on,disabled_on:i.disabled_on,fields:(i.settings||[]).map(e=>t2(e)),blocks:(i.blocks||[]).map(e=>y0(e)),presets:(i.presets||[]).map(e=>v0(e)),default:i.default}}function y0(i){return{type:i.type,label:i.name,limit:i.limit,fields:(i.settings||[]).map(e=>t2(e))}}function v0(i){return{label:i.name,settings:i.settings,blocks:i.blocks}}function z0(i){return{label:i.name,fields:(i.settings||[]).map(e=>t2(e))}}function t2(i){let t={};switch(i.type){case"text":t={type:"text"};break;case"textarea":t={type:"textarea"};break;case"select":t={type:"select",options:i.options};break;case"checkbox":t={type:"checkbox"};break;case"radio":t={type:"radio",options:i.options};break;case"number":t={type:"integer"};break;case"range":t={type:"number",min:i.min,max:i.max,increment:i.step,unit:i.unit};break;case"article":t={type:"lookup",collection:"content/blogs:posts"};break;case"blog":t={type:"lookup",collection:"content/blogs"};break;case"collection":t={type:"category_lookup"};break;case"collection_list":t={type:"category_lookup",multiple:!0,limit:i.limit};break;case"color":t={type:"color"};break;case"color_background":t={type:"color"};break;case"color_scheme":t={type:"color_scheme"};break;case"color_scheme_group":t={type:"color_scheme_group",fields:(i.definition||[]).map(e=>t2(e)),role:i.role};break;case"font_picker":t={type:"font"};break;case"html":t={type:"html"};break;case"image_picker":t={type:"image"};break;case"inline_richtext":t={type:"rich_text"};break;case"link_list":t={type:"menu"};break;case"liquid":t={type:"liquid"};break;case"page":t={type:"lookup",collection:"content/pages"};break;case"product":t={type:"product_lookup"};break;case"product_list":t={type:"product_lookup",multiple:!0,limit:i.limit};break;case"richtext":t={type:"rich_html"};break;case"text_alignment":t={type:"select",options:[{value:"left",label:"Left"},{value:"center",label:"Center"},{value:"right",label:"Right"}]};break;case"url":t={type:"url"};break;case"video":t={type:"video"};break;case"video_url":t={type:"url"};break;case"header":t={type:"header",id:i.content,label:i.content};break}return{id:i.id,label:i.label,default:i.default,description:i.info,...t}}function o4(i){let t=i.lastIndexOf("_"),e=i.substring(0,t),l=i.substring(t+1),c=S0[e];if(c){let a=c.variants[l];return`${c.family}:${a}`}return null}var S0={abel:{family:"Abel",variants:{n4:"wght@400"}},abril_fatface:{family:"Abril Fatface",variants:{n4:"wght@400"}},alegreya:{family:"Alegreya",variants:{n4:"wght@400",i4:"ital,wght@1,400",n5:"wght@500",i5:"ital,wght@1,500",n7:"wght@700",i7:"ital,wght@1,700",n8:"wght@800",i8:"ital,wght@1,800",n9:"wght@900",i9:"ital,wght@1,900"}},alegreya_sans:{family:"Alegreya Sans",variants:{n1:"wght@100",i1:"ital,wght@1,100",n3:"wght@300",i3:"ital,wght@1,300",n4:"wght@400",i4:"ital,wght@1,400",n5:"wght@500",i5:"ital,wght@1,500",n7:"wght@700",i7:"ital,wght@1,700",n8:"wght@800",i8:"ital,wght@1,800",n9:"wght@900",i9:"ital,wght@1,900"}},amiri:{family:"Amiri",variants:{n4:"wght@400",i4:"ital,wght@1,400",n7:"wght@700",i7:"ital,wght@1,700"}},anonymous_pro:{family:"Anonymous Pro",variants:{n4:"wght@400",i4:"ital,wght@1,400",n7:"wght@700",i7:"ital,wght@1,700"}},arapey:{family:"Arapey",variants:{n4:"wght@400",i4:"ital,wght@1,400"}},archivo:{family:"Archivo",variants:{n4:"wght@400",i4:"ital,wght@1,400",n5:"wght@500",i5:"ital,wght@1,500",n6:"wght@600",i6:"ital,wght@1,600",n7:"wght@700",i7:"ital,wght@1,700"}},archivo_narrow:{family:"Archivo Narrow",variants:{n4:"wght@400",i4:"ital,wght@1,400",n5:"wght@500",i5:"ital,wght@1,500",n6:"wght@600",i6:"ital,wght@1,600",n7:"wght@700",i7:"ital,wght@1,700"}},arimo:{family:"Arimo",variants:{n4:"wght@400",i4:"ital,wght@1,400",n7:"wght@700",i7:"ital,wght@1,700"}},armata:{family:"Armata",variants:{n4:"wght@400"}},arvo:{family:"Arvo",variants:{n4:"wght@400",i4:"ital,wght@1,400",n7:"wght@700",i7:"ital,wght@1,700"}},asap:{family:"Asap",variants:{n4:"wght@400",i4:"ital,wght@1,400",n5:"wght@500",i5:"ital,wght@1,500",n6:"wght@600",i6:"ital,wght@1,600",n7:"wght@700",i7:"ital,wght@1,700"}},assistant:{family:"Assistant",variants:{n2:"wght@200",n3:"wght@300",n4:"wght@400",n6:"wght@600",n7:"wght@700",n8:"wght@800"}},asul:{family:"Asul",variants:{n4:"wght@400",n7:"wght@700"}},bio_rhyme:{family:"Bio Rhyme",variants:{n2:"wght@200",n3:"wght@300",n4:"wght@400",n7:"wght@700",n8:"wght@800"}},bitter:{family:"Bitter",variants:{n4:"wght@400",i4:"ital,wght@1,400",n7:"wght@700"}},cabin:{family:"Cabin",variants:{n4:"wght@400",i4:"ital,wght@1,400",n5:"wght@500",i5:"ital,wght@1,500",n6:"wght@600",i6:"ital,wght@1,600",n7:"wght@700",i7:"ital,wght@1,700"}},cardo:{family:"Cardo",variants:{n4:"wght@400",i4:"ital,wght@1,400",n7:"wght@700"}},catamaran:{family:"Catamaran",variants:{n1:"wght@100",n2:"wght@200",n3:"wght@300",n4:"wght@400",n5:"wght@500",n6:"wght@600",n7:"wght@700",n8:"wght@800",n9:"wght@900"}},chivo:{family:"Chivo",variants:{n3:"wght@300",i3:"ital,wght@1,300",n4:"wght@400",i4:"ital,wght@1,400",n7:"wght@700",i7:"ital,wght@1,700",n9:"wght@900",i9:"ital,wght@1,900"}},cormorant:{family:"Cormorant",variants:{n3:"wght@300",i3:"ital,wght@1,300",n4:"wght@400",i4:"ital,wght@1,400",n5:"wght@500",i5:"ital,wght@1,500",n6:"wght@600",i6:"ital,wght@1,600",n7:"wght@700",i7:"ital,wght@1,700"}},crimson_text:{family:"Crimson Text",variants:{n4:"wght@400",i4:"ital,wght@1,400",n6:"wght@600",i6:"ital,wght@1,600",n7:"wght@700",i7:"ital,wght@1,700"}},dm_sans:{family:"DM Sans",variants:{n4:"wght@400",i4:"ital,wght@1,400",n5:"wght@500",i5:"ital,wght@1,500",n7:"wght@700",i7:"ital,wght@1,700"}},domine:{family:"Domine",variants:{n4:"wght@400",n7:"wght@700"}},dosis:{family:"Dosis",variants:{n2:"wght@200",n3:"wght@300",n4:"wght@400",n5:"wght@500",n6:"wght@600",n7:"wght@700",n8:"wght@800"}},eczar:{family:"Eczar",variants:{n4:"wght@400",n5:"wght@500",n6:"wght@600",n7:"wght@700",n8:"wght@800"}},fira_sans:{family:"Fira Sans",variants:{n1:"wght@100",i1:"ital,wght@1,100",n2:"wght@200",i2:"ital,wght@1,200",n3:"wght@300",i3:"ital,wght@1,300",n4:"wght@400",i4:"ital,wght@1,400",n5:"wght@500",i5:"ital,wght@1,500",n6:"wght@600",i6:"ital,wght@1,600",n7:"wght@700",i7:"ital,wght@1,700",n8:"wght@800",i8:"ital,wght@1,800",n9:"wght@900",i9:"ital,wght@1,900"}},fjalla_one:{family:"Fjalla One",variants:{n4:"wght@400"}},glegoo:{family:"Glegoo",variants:{n4:"wght@400",n7:"wght@700"}},ibm_plex_sans:{family:"IBM Plex Sans",variants:{n1:"wght@100",i1:"ital,wght@1,100",n2:"wght@200",i2:"ital,wght@1,200",n3:"wght@300",i3:"ital,wght@1,300",n4:"wght@400",i4:"ital,wght@1,400",n5:"wght@500",i5:"ital,wght@1,500",n6:"wght@600",i6:"ital,wght@1,600",n7:"wght@700",i7:"ital,wght@1,700"}},inconsolata:{family:"Inconsolata",variants:{n4:"wght@400",n7:"wght@700"}},inknut_antiqua:{family:"Inknut Antiqua",variants:{n3:"wght@300",n4:"wght@400",n5:"wght@500",n6:"wght@600",n7:"wght@700",n8:"wght@800",n9:"wght@900"}},inter:{family:"Inter",variants:{n1:"wght@100",n2:"wght@200",n3:"wght@300",n4:"wght@400",n5:"wght@500",n6:"wght@600",n7:"wght@700",n8:"wght@800",n9:"wght@900"}},josefin_sans:{family:"Josefin Sans",variants:{n1:"wght@100",i1:"ital,wght@1,100",n3:"wght@300",i3:"ital,wght@1,300",n4:"wght@400",i4:"ital,wght@1,400",n6:"wght@600",i6:"ital,wght@1,600",n7:"wght@700",i7:"ital,wght@1,700"}},josefin_slab:{family:"Josefin Slab",variants:{n1:"wght@100",i1:"ital,wght@1,100",n3:"wght@300",i3:"ital,wght@1,300",n4:"wght@400",i4:"ital,wght@1,400",n6:"wght@600",i6:"ital,wght@1,600",n7:"wght@700",i7:"ital,wght@1,700"}},kalam:{family:"Kalam",variants:{n3:"wght@300",n4:"wght@400",n7:"wght@700"}},karla:{family:"Karla",variants:{n4:"wght@400",i4:"ital,wght@1,400",n7:"wght@700",i7:"ital,wght@1,700"}},kreon:{family:"Kreon",variants:{n3:"wght@300",n4:"wght@400",n7:"wght@700"}},lato:{family:"Lato",variants:{n1:"wght@100",i1:"ital,wght@1,100",n2:"wght@200",i2:"ital,wght@1,200",n3:"wght@300",i3:"ital,wght@1,300",n4:"wght@400",i4:"ital,wght@1,400",n5:"wght@500",i5:"ital,wght@1,500",n6:"wght@600",i6:"ital,wght@1,600",n7:"wght@700",i7:"ital,wght@1,700",n8:"wght@800",i8:"ital,wght@1,800",n9:"wght@900",i9:"ital,wght@1,900"}},libre_baskerville:{family:"Libre Baskerville",variants:{n4:"wght@400",i4:"ital,wght@1,400",n7:"wght@700"}},libre_franklin:{family:"Libre Franklin",variants:{n1:"wght@100",i1:"ital,wght@1,100",n2:"wght@200",i2:"ital,wght@1,200",n3:"wght@300",i3:"ital,wght@1,300",n4:"wght@400",i4:"ital,wght@1,400",n5:"wght@500",i5:"ital,wght@1,500",n6:"wght@600",i6:"ital,wght@1,600",n7:"wght@700",i7:"ital,wght@1,700",n8:"wght@800",i8:"ital,wght@1,800",n9:"wght@900",i9:"ital,wght@1,900"}},lobster:{family:"Lobster",variants:{n4:"wght@400"}},lobster_two:{family:"Lobster Two",variants:{n4:"wght@400",i4:"ital,wght@1,400",n7:"wght@700",i7:"ital,wght@1,700"}},lora:{family:"Lora",variants:{n4:"wght@400",i4:"ital,wght@1,400",n7:"wght@700",i7:"ital,wght@1,700"}},maven_pro:{family:"Maven Pro",variants:{n4:"wght@400",n5:"wght@500",n7:"wght@700",n9:"wght@900"}},megrim:{family:"Megrim",variants:{n4:"wght@400"}},merriweather_sans:{family:"Merriweather Sans",variants:{n3:"wght@300",i3:"ital,wght@1,300",n4:"wght@400",i4:"ital,wght@1,400",n7:"wght@700",i7:"ital,wght@1,700",n8:"wght@800",i8:"ital,wght@1,800"}},montserrat:{family:"Montserrat",variants:{n1:"wght@100",i1:"ital,wght@1,100",n2:"wght@200",i2:"ital,wght@1,200",n3:"wght@300",i3:"ital,wght@1,300",n4:"wght@400",i4:"ital,wght@1,400",n5:"wght@500",i5:"ital,wght@1,500",n6:"wght@600",i6:"ital,wght@1,600",n7:"wght@700",i7:"ital,wght@1,700",n8:"wght@800",i8:"ital,wght@1,800",n9:"wght@900",i9:"ital,wght@1,900"}},mouse_memoirs:{family:"Mouse Memoirs",variants:{n4:"wght@400"}},muli:{family:"Muli",variants:{n2:"wght@200",i2:"ital,wght@1,200",n3:"wght@300",i3:"ital,wght@1,300",n4:"wght@400",i4:"ital,wght@1,400",n6:"wght@600",i6:"ital,wght@1,600",n7:"wght@700",i7:"ital,wght@1,700",n8:"wght@800",i8:"ital,wght@1,800",n9:"wght@900",i9:"ital,wght@1,900"}},neuton:{family:"Neuton",variants:{n2:"wght@200",n3:"wght@300",n4:"wght@400",i4:"ital,wght@1,400",n7:"wght@700",n8:"wght@800"}},news_cycle:{family:"News Cycle",variants:{n4:"wght@400",n7:"wght@700"}},newsreader:{family:"Newsreader",variants:{n2:"wght@200",i2:"ital,wght@1,200",n3:"wght@300",i3:"ital,wght@1,300",n4:"wght@400",i4:"ital,wght@1,400",n5:"wght@500",i5:"ital,wght@1,500",n6:"wght@600",i6:"ital,wght@1,600",n7:"wght@700",i7:"ital,wght@1,700",n8:"wght@800",i8:"ital,wght@1,800"}},nobile:{family:"Nobile",variants:{n4:"wght@400",i4:"ital,wght@1,400",n5:"wght@500",i5:"ital,wght@1,500",n7:"wght@700",i7:"ital,wght@1,700"}},noticia_text:{family:"Noticia Text",variants:{n4:"wght@400",i4:"ital,wght@1,400",n7:"wght@700",i7:"ital,wght@1,700"}},noto_serif:{family:"Noto Serif",variants:{n4:"wght@400",i4:"ital,wght@1,400",n7:"wght@700",i7:"ital,wght@1,700"}},nunito:{family:"Nunito",variants:{n2:"wght@200",i2:"ital,wght@1,200",n3:"wght@300",i3:"ital,wght@1,300",n4:"wght@400",i4:"ital,wght@1,400",n6:"wght@600",i6:"ital,wght@1,600",n7:"wght@700",i7:"ital,wght@1,700",n8:"wght@800",i8:"ital,wght@1,800",n9:"wght@900",i9:"ital,wght@1,900"}},nunito_sans:{family:"Nunito Sans",variants:{n2:"wght@200",i2:"ital,wght@1,200",n3:"wght@300",i3:"ital,wght@1,300",n4:"wght@400",i4:"ital,wght@1,400",n6:"wght@600",i6:"ital,wght@1,600",n7:"wght@700",i7:"ital,wght@1,700",n8:"wght@800",i8:"ital,wght@1,800",n9:"wght@900",i9:"ital,wght@1,900"}},old_standard_tt:{family:"Old Standard TT",variants:{n4:"wght@400",i4:"ital,wght@1,400",n7:"wght@700"}},open_sans:{family:"Open Sans",variants:{n3:"wght@300",i3:"ital,wght@1,300",n4:"wght@400",i4:"ital,wght@1,400",n6:"wght@600",i6:"ital,wght@1,600",n7:"wght@700",i7:"ital,wght@1,700",n8:"wght@800",i8:"ital,wght@1,800"}},open_sans_condensed:{family:"Open Sans Condensed",variants:{n3:"wght@300",i3:"ital,wght@1,300",n7:"wght@700"}},oswald:{family:"Oswald",variants:{n2:"wght@200",n3:"wght@300",n4:"wght@400",n5:"wght@500",n6:"wght@600",n7:"wght@700"}},ovo:{family:"Ovo",variants:{n4:"wght@400"}},oxygen:{family:"Oxygen",variants:{n3:"wght@300",n4:"wght@400",n7:"wght@700"}},pt_mono:{family:"PT Mono",variants:{n4:"wght@400"}},pt_sans:{family:"PT Sans",variants:{n4:"wght@400",i4:"ital,wght@1,400",n7:"wght@700",i7:"ital,wght@1,700"}},pt_sans_narrow:{family:"PT Sans Narrow",variants:{n4:"wght@400",n7:"wght@700"}},pt_serif:{family:"PT Serif",variants:{n4:"wght@400",i4:"ital,wght@1,400",n7:"wght@700",i7:"ital,wght@1,700"}},pacifico:{family:"Pacifico",variants:{n4:"wght@400"}},playball:{family:"Playball",variants:{n4:"wght@400"}},playfair_display:{family:"Playfair Display",variants:{n4:"wght@400",i4:"ital,wght@1,400",n7:"wght@700",i7:"ital,wght@1,700",n9:"wght@900",i9:"ital,wght@1,900"}},poppins:{family:"Poppins",variants:{n1:"wght@100",i1:"ital,wght@1,100",n2:"wght@200",i2:"ital,wght@1,200",n3:"wght@300",i3:"ital,wght@1,300",n4:"wght@400",i4:"ital,wght@1,400",n5:"wght@500",i5:"ital,wght@1,500",n6:"wght@600",i6:"ital,wght@1,600",n7:"wght@700",i7:"ital,wght@1,700",n8:"wght@800",i8:"ital,wght@1,800",n9:"wght@900",i9:"ital,wght@1,900"}},prata:{family:"Prata",variants:{n4:"wght@400"}},prompt:{family:"Prompt",variants:{n1:"wght@100",i1:"ital,wght@1,100",n2:"wght@200",i2:"ital,wght@1,200",n3:"wght@300",i3:"ital,wght@1,300",n4:"wght@400",i4:"ital,wght@1,400",n5:"wght@500",i5:"ital,wght@1,500",n6:"wght@600",i6:"ital,wght@1,600",n7:"wght@700",i7:"ital,wght@1,700",n8:"wght@800",i8:"ital,wght@1,800",n9:"wght@900",i9:"ital,wght@1,900"}},proza_libre:{family:"Proza Libre",variants:{n4:"wght@400",i4:"ital,wght@1,400",n5:"wght@500",i5:"ital,wght@1,500",n6:"wght@600",i6:"ital,wght@1,600",n7:"wght@700",i7:"ital,wght@1,700",n8:"wght@800",i8:"ital,wght@1,800"}},quantico:{family:"Quantico",variants:{n4:"wght@400",i4:"ital,wght@1,400",n7:"wght@700",i7:"ital,wght@1,700"}},quattrocento:{family:"Quattrocento",variants:{n4:"wght@400",n7:"wght@700"}},quattrocento_sans:{family:"Quattrocento Sans",variants:{n4:"wght@400",i4:"ital,wght@1,400",n7:"wght@700",i7:"ital,wght@1,700"}},questrial:{family:"Questrial",variants:{n4:"wght@400"}},quicksand:{family:"Quicksand",variants:{n3:"wght@300",n4:"wght@400",n5:"wght@500",n7:"wght@700"}},rajdhani:{family:"Rajdhani",variants:{n3:"wght@300",n4:"wght@400",n5:"wght@500",n6:"wght@600",n7:"wght@700"}},raleway:{family:"Raleway",variants:{n1:"wght@100",i1:"ital,wght@1,100",n2:"wght@200",i2:"ital,wght@1,200",n3:"wght@300",i3:"ital,wght@1,300",n4:"wght@400",i4:"ital,wght@1,400",n5:"wght@500",i5:"ital,wght@1,500",n6:"wght@600",i6:"ital,wght@1,600",n7:"wght@700",i7:"ital,wght@1,700",n8:"wght@800",i8:"ital,wght@1,800",n9:"wght@900",i9:"ital,wght@1,900"}},righteous:{family:"Righteous",variants:{n4:"wght@400"}},roboto:{family:"Roboto",variants:{n1:"wght@100",i1:"ital,wght@1,100",n3:"wght@300",i3:"ital,wght@1,300",n4:"wght@400",i4:"ital,wght@1,400",n5:"wght@500",i5:"ital,wght@1,500",n7:"wght@700",i7:"ital,wght@1,700",n9:"wght@900",i9:"ital,wght@1,900"}},roboto_condensed:{family:"Roboto Condensed",variants:{n3:"wght@300",i3:"ital,wght@1,300",n4:"wght@400",i4:"ital,wght@1,400",n7:"wght@700",i7:"ital,wght@1,700"}},roboto_mono:{family:"Roboto Mono",variants:{n1:"wght@100",i1:"ital,wght@1,100",n3:"wght@300",i3:"ital,wght@1,300",n4:"wght@400",i4:"ital,wght@1,400",n5:"wght@500",i5:"ital,wght@1,500",n7:"wght@700",i7:"ital,wght@1,700"}},roboto_slab:{family:"Roboto Slab",variants:{n1:"wght@100",n3:"wght@300",n4:"wght@400",n7:"wght@700"}},rubik:{family:"Rubik",variants:{n3:"wght@300",i3:"ital,wght@1,300",n4:"wght@400",i4:"ital,wght@1,400",n5:"wght@500",i5:"ital,wght@1,500",n7:"wght@700",i7:"ital,wght@1,700",n9:"wght@900",i9:"ital,wght@1,900"}},shadows_into_light:{family:"Shadows Into Light",variants:{n4:"wght@400"}},slabo_13px:{family:"Slabo 13px",variants:{n4:"wght@400"}},smooch:{family:"Smooch",variants:{n4:"wght@400"}},source_code_pro:{family:"Source Code Pro",variants:{n2:"wght@200",n3:"wght@300",n4:"wght@400",n5:"wght@500",n6:"wght@600",n7:"wght@700",n9:"wght@900"}},source_sans_pro:{family:"Source Sans Pro",variants:{n2:"wght@200",i2:"ital,wght@1,200",n3:"wght@300",i3:"ital,wght@1,300",n4:"wght@400",i4:"ital,wght@1,400",n6:"wght@600",i6:"ital,wght@1,600",n7:"wght@700",i7:"ital,wght@1,700",n9:"wght@900",i9:"ital,wght@1,900"}},space_mono:{family:"Space Mono",variants:{n4:"wght@400",i4:"ital,wght@1,400",n7:"wght@700",i7:"ital,wght@1,700"}},syne:{family:"Syne",variants:{n4:"wght@400",n5:"wght@500",n6:"wght@600",n7:"wght@700",n8:"wght@800"}},tenor_sans:{family:"Tenor Sans",variants:{n4:"wght@400"}},tinos:{family:"Tinos",variants:{n4:"wght@400",i4:"ital,wght@1,400",n7:"wght@700",i7:"ital,wght@1,700"}},titillium_web:{family:"Titillium Web",variants:{n2:"wght@200",i2:"ital,wght@1,200",n3:"wght@300",i3:"ital,wght@1,300",n4:"wght@400",i4:"ital,wght@1,400",n6:"wght@600",i6:"ital,wght@1,600",n7:"wght@700",i7:"ital,wght@1,700",n9:"wght@900"}},ubuntu:{family:"Ubuntu",variants:{n3:"wght@300",i3:"ital,wght@1,300",n4:"wght@400",i4:"ital,wght@1,400",n5:"wght@500",i5:"ital,wght@1,500",n7:"wght@700",i7:"ital,wght@1,700"}},unica_one:{family:"Unica One",variants:{n4:"wght@400"}},unna:{family:"Unna",variants:{n4:"wght@400",i4:"ital,wght@1,400",n7:"wght@700",i7:"ital,wght@1,700"}},varela:{family:"Varela",variants:{n4:"wght@400"}},varela_round:{family:"Varela Round",variants:{n4:"wght@400"}},vidaloka:{family:"Vidaloka",variants:{n4:"wght@400"}},volkhov:{family:"Volkhov",variants:{n4:"wght@400",i4:"ital,wght@1,400",n7:"wght@700",i7:"ital,wght@1,700"}},vollkorn:{family:"Vollkorn",variants:{n4:"wght@400",i4:"ital,wght@1,400",n6:"wght@600",i6:"ital,wght@1,600",n7:"wght@700",i7:"ital,wght@1,700",n9:"wght@900",i9:"ital,wght@1,900"}},work_sans:{family:"Work Sans",variants:{n1:"wght@100",n2:"wght@200",n3:"wght@300",n4:"wght@400",n5:"wght@500",n6:"wght@600",n7:"wght@700",n8:"wght@800",n9:"wght@900"}},biz_udpmincho:{family:"BIZ UDPMincho",variants:{n4:"wght@400",n7:"wght@700"}},dela_gothic_one:{family:"Dela Gothic One",variants:{n4:"wght@400"}},hina_mincho:{family:"Hina Mincho",variants:{n4:"wght@400"}},kaisei_decol:{family:"Kaisei Decol",variants:{n4:"wght@400",n5:"wght@500",n7:"wght@700"}},kaisei_opti:{family:"Kaisei Opti",variants:{n4:"wght@400",n5:"wght@500",n7:"wght@700"}},kaisei_tokumin:{family:"Kaisei Tokumin",variants:{n4:"wght@400",n5:"wght@500",n7:"wght@700",n8:"wght@800"}},m_plus_1:{family:"M PLUS 1",variants:{n1:"wght@100",n2:"wght@200",n3:"wght@300",n4:"wght@400",n5:"wght@500",n6:"wght@600",n7:"wght@700",n8:"wght@800",n9:"wght@900"}},m_plus_rounded_1c:{family:"M PLUS Rounded 1c",variants:{n1:"wght@100",n3:"wght@300",n4:"wght@400",n5:"wght@500",n7:"wght@700",n8:"wght@800",n9:"wght@900"}},mochiy_pop_p_one:{family:"Mochiy Pop P One",variants:{n4:"wght@400"}},murecho:{family:"Murecho",variants:{n1:"wght@100",n2:"wght@200",n3:"wght@300",n4:"wght@400",n5:"wght@500",n6:"wght@600",n7:"wght@700",n8:"wght@800",n9:"wght@900"}},noto_sans_japanese:{family:"Noto Sans Japanese",variants:{n1:"wght@100",n2:"wght@200",n3:"wght@300",n4:"wght@400",n5:"wght@500",n6:"wght@600",n7:"wght@700",n8:"wght@800",n9:"wght@900"}},noto_serif_japanese:{family:"Noto Serif Japanese",variants:{n2:"wght@200",n3:"wght@300",n4:"wght@400",n5:"wght@500",n6:"wght@600",n7:"wght@700",n9:"wght@900"}},shippori_mincho:{family:"Shippori Mincho",variants:{n4:"wght@400",n5:"wght@500",n6:"wght@600",n7:"wght@700",n8:"wght@800"}},zen_kaku_gothic_new:{family:"Zen Kaku Gothic New",variants:{n3:"wght@300",n4:"wght@400",n5:"wght@500",n7:"wght@700",n9:"wght@900"}},zen_kurenaido:{family:"Zen Kurenaido",variants:{n4:"wght@400"}},zen_maru_gothic:{family:"Zen Maru Gothic",variants:{n3:"wght@300",n4:"wght@400",n5:"wght@500",n7:"wght@700",n9:"wght@900"}},zen_old_mincho:{family:"Zen Old Mincho",variants:{n4:"wght@400",n5:"wght@500",n6:"wght@600",n7:"wght@700",n9:"wght@900"}}};var h1=class{theme;swell;pageId;pageResourceMap;objectResourceMap;formResourceMap;queryParamsMap;editorLocaleConfig;constructor(t){this.theme=t,this.swell=t.swell,this.pageResourceMap=this.getPageResourceMap(),this.objectResourceMap=this.getObjectResourceMap(),this.formResourceMap=this.getFormResourceMap(),this.queryParamsMap=this.getQueryParamsMap()}adaptGlobals(t){let{store:e,request:l,page:c,menus:a}=t;this.pageId=this.getPageType(c?.id),t.shop=this.getShopData(t),t.page={...c||void 0},t.request={...l||void 0,design_mode:this.swell.isEditor,visual_section_preview:!1,page_type:c?.id},t.linklists=a,t.current_page=this.swell.queryParams.page||1,t.routes=this.getPageRoutes(),t.localization=this.getLocalizationObject(e,l),t.all_country_option_tags=this.getAllCountryOptionTags(t.geo)}adaptPageData(t){let e=this.pageResourceMap.find(({page:l})=>l===this.pageId);if(e)for(let[l,c]of Object.entries(t)){let a=e.resources.find(({from:s})=>s===l);a&&c instanceof L&&(t[a.to]=a.object(this,c))}this.adaptObjectData(t)}adaptObjectData(t){for(let e of Object.values(t)){let l=this.objectResourceMap.find(({from:c})=>e instanceof c);if(l){let c=l.object(this,e);e instanceof L?e.setCompatibilityProps(c):Object.assign(e,c)}}}adaptQueryParams(){let t={};for(let[e,l]of Object.entries(this.swell.queryParams)){let c=this.queryParamsMap.find(({from:a})=>typeof a=="function"?a(e):a===e);if(c){let a=typeof c.to=="function"?c.to(e,l):{[c.to]:l};Object.assign(t,a)}else t[e]=l}this.swell.queryParams=t}getAdaptedFormType(t){return this.formResourceMap.find(l=>l.shopifyType===t)?.type}async getAdaptedFormClientParams(t,e,l){let c=this.formResourceMap.find(a=>a.type===t);if(c?.clientParams)return await c.clientParams(e,l)}async getAdaptedFormClientHtml(t,e,l){let c=this.formResourceMap.find(a=>a.type===t);if(c?.clientHtml)return await c.clientHtml(e,l)}async getAdaptedFormServerParams(t,e){let l=this.formResourceMap.find(c=>c.type===t||c.shopifyType===t);if(l?.serverParams)return l.serverParams(e)}async getAdaptedFormServerResponse(t,e){let l=this.formResourceMap.find(c=>c.type===t||c.shopifyType===t);if(l?.serverResponse)return await l.serverResponse(e)}getShopData({store:t}){return t?M3(this,t):{}}getContentForHeader(){return"<script>var Shopify = Shopify || {};</script>"}getMenuData(t){return S2(this,t)}getFontData(t){return b2(this,t)}getFormData(t){return _2(this,t)}getFontFromShopifySetting(t){return o4(t)}getThemeConfig(t){return s4(t)}getPresetsConfig(t){return n4(t)}getEditorConfig(t){return a4(t)}getSectionConfigSchema(t){return r4(t)}async getLocaleConfig(t,e="en",l=".json"){let a=(await t.getAllThemeConfigs()).filter(n=>n?.file_path?.startsWith("theme/locales/")&&n?.file_path?.endsWith(l)),s=a?.find(n=>n?.file_path===`theme/locales/${e}${l}`);if(!s){let n=e.split("-")[0];s=a?.find(r=>r?.file_path===`theme/locales/${n}${l}`),s||(s=a?.find(r=>r?.file_path?.endsWith(`.default${l}`)))}if(s){s=await t.getThemeConfig(s.file_path);try{return JSON.parse(s?.file_data||"")}catch{}}return{}}async getEditorLocaleConfig(t,e){if(this.editorLocaleConfig?.[e])return this.editorLocaleConfig[e];let l=await this.getLocaleConfig(t,e,".schema.json");return this.editorLocaleConfig={[e]:l},l}async renderSchemaTranslations(t,e,l="en"){if(!(0,D1.isObject)(e))return e;let c=await this.getEditorLocaleConfig(t,l);return await this.renderSchemaTranslationValue(t,e,l,c)}async renderSchemaTranslationValue(t,e,l,c){if(typeof e=="string"){if(e.startsWith("t:")){let a=e.slice(2),s=a?.split("."),n=s.pop()||"",r=s.join(".");return(0,D1.get)(c,r)?.[n]??a}}else if(e instanceof Array){let a=[];for(let s of e)a.push(await this.renderSchemaTranslationValue(t,s,l,c));return a}else if((0,D1.isObject)(e)){let a={...e};for(let[s,n]of Object.entries(e))a[s]=await this.renderSchemaTranslationValue(t,n,l,c);return a}return e}getPageType(t){return t}getPageRouteUrl(t){return t}getPageRoutes(){return{account_addresses_url:this.getPageRouteUrl("account/addresses"),account_login_url:this.getPageRouteUrl("account/login"),account_logout_url:this.getPageRouteUrl("account/logout"),account_recover_url:this.getPageRouteUrl("account/recover"),account_register_url:this.getPageRouteUrl("account/signup"),account_url:this.getPageRouteUrl("account/index"),all_products_collection_url:this.getPageRouteUrl("products/index"),cart_add_url:this.getPageRouteUrl("cart/add"),cart_change_url:this.getPageRouteUrl("cart/change"),cart_clear_url:this.getPageRouteUrl("cart/clear"),cart_update_url:this.getPageRouteUrl("cart/update"),cart_url:this.getPageRouteUrl("cart/index"),collections_url:this.getPageRouteUrl("categories/index"),predictive_search_url:this.getPageRouteUrl("search/suggest"),product_recommendations_url:this.getPageRouteUrl("products/index"),root_url:this.getPageRouteUrl("index"),search_url:this.getPageRouteUrl("search")}}getLocalizationObject(t,e){return _1(this,t,e)}getAdaptedPageUrl(t){if(!t)return;let e,l={},[c,a,s,n]=t.split("?")[0].split("/");switch(a){case"account":switch(s){case"order":e="account/order",l.id=n;break;case"register":e="account/login";break;default:break}break;case"blog":s&&(e="blogs/category",l.category=s),n&&(e="blogs/blog",l.slug=n);break;case"collections":s?s==="all"?e="products/index":(e="categories/category",l.slug=s):e="categories/index";break;case"gift_card":s&&(e="gift-card",l.code=s);break}if(e){let r=this.getPageRouteUrl(e);if(r)return r.replace(/:(\w+)/g,(p,w)=>l[w])}}getThemeFilePath(t,e){switch(t){case"assets":return`assets/${e}`;case"components":return`snippets/${e}`;case"config":return`config/${e}`;case"layouts":return`layout/${e}`;case"templates":return`templates/${this.getPageType(e)}`;case"sections":return`sections/${e}`;default:throw new Error(`Theme file type not supported: ${t}`)}}getPageResourceMap(){return[]}getObjectResourceMap(){return[]}getFormResourceMap(){return[]}getQueryParamsMap(){return[{from:"sort_by",to:"sort"},{from:t=>t.startsWith("filter.v."),to:(t,e)=>{let l=t.split("filter.v.")[1],c=e;return{[l]:c}}}]}getAllCountryOptionTags(t){return t?.countries?.map(e=>{if(!e)return;let l=[...(t?.states||[]).filter(a=>a.country===e.id).map(a=>[a.id,a.name])],c=JSON.stringify(l).replace(/"/g,"&quot;");return`<option value="${e.id}" data-provinces="${c}">${e.name}</option>`}).filter(Boolean).join(`
40
+ `)}async renderTranslation(t,e,l){let c=this.globals.translations,a=this.globals.request?.locale;return this.renderTranslationValue(a,c,t,e,l)}async renderTranslationValue(t,e,l,c,a){if(l===void 0)return a||"";let s=l?.split(".")||[],n=s.pop()||"",r=s.join("."),p=(0,R.get)(e,r),w=(0,R.get)(p?.[t],n)||(0,R.get)(p?.[t.split("-")[0]],n)||p?.[n];return c?.count!==void 0&&w?.one&&(w=c.count===1?w.one:w.other),typeof w!="string"||w===""?a||"":await this.renderTemplateString(w,c)||a||""}renderCurrency(t,e){let l=this.swell.storefront.settings,c=this.swell.storefront.currency,a=l.state,s=c.code=a?.store?.currency||"USD";return c.locale=a?.store?.locale||"en-US",c.state=a?.store?.locales?.find(n=>n.code===s)||{code:s},c.format(t,e)}},P1=class{title;status=500;message;description;constructor(t="Something went wrong",e=500,l){this.title=String(t),this.status=e,this.message=this.title+(l?`: ${l}`:""),this.description=l}toString(){return this.message}},R1=class extends P1{constructor(t="Page not found",e=404,l){super(t,e,l)}};function Y1(i,t){let{settings:e,schema:l}=t;if(!e?.section?.settings||!l?.fields)return e;let c=[{label:t.id,fields:l.fields}];return{...e,section:{...e.section,settings:L1(i,e.section.settings,c),blocks:e.section.blocks?.map(a=>({...a,settings:L1(i,a.settings,l.blocks?.filter(s=>s.type===a.type))}))}}}function L1(i,t,e){let l=(0,R.cloneDeep)(t);return(0,R.each)(l,(c,a)=>{let s=e&&S3(e,a);if(Z1(c)&&!(c instanceof L)){switch(s?.type){case"color_scheme_group":(0,R.each)(c,(n,r)=>{(0,R.each)(c[r].settings,(p,w)=>{p&&(c[r].settings[w]=new T(p))})});return;default:break}l[a]=L1(i,c,e)}else switch(s?.type){case"lookup":case"product_lookup":case"category_lookup":case"customer_lookup":l[a]=i.resolveLookupSetting(s,c);break;case"color":c&&(l[a]=new T(c));break;case"font":l[a]=i.resolveFontSetting(c);break;case"menu":l[a]=i.resolveMenuSetting(c);break;case"url":l[a]=i.resolveUrlSetting(c);break}}),l}function z3(i,t,e){let l=[];return(0,R.each)(t,(c,a)=>{if(Z1(c)&&!(c instanceof H))l.push(...z3(i,c,e));else{let s=S3(e,a);s?.type===i&&l.push({setting:s,value:c})}}),l}function c4(i){if(i.collection)return i.collection;switch(i.type){case"product_lookup":return"products";case"category_lookup":return"categories";case"customer_lookup":return"accounts"}}function S3(i,t){for(let e of i||[])for(let l of e.fields)if(l.id===t)return l}function M3(i,t){let e=t.currencies.find(l=>l.code===t.currency);return new v({accepts_gift_cards:!0,address:{},brand:{},collections_count:0,currency:t.currency,customer_accounts_enabled:!0,customer_accounts_optional:!0,description:t.description,domain:t.url.replace(/^http[s]?:\/\//,""),email:t.support_email,enabled_currencies:t.currencies.map(l=>({iso_code:l.code,name:l.name,symbol:l.symbol})),enabled_payment_providers:[],id:t.id,metafields:null,metaobjects:null,money_format:t.currencies.find(l=>l.code===t.currency),money_with_currency_format:{...e,symbol:`${t.currency} ${e?.symbol||""}`},name:t.name,password_message:null,permanent_domain:`${t.id}.swell.store`,phone:t.support_phone,published_locales:t.locales.map(l=>({endonym_name:l.name,iso_code:l.code,name:l.name,primary:l.code===t.locale,root_url:t.url})),secure_url:t.url,types:[],url:t.url,vendors:[],policies:[],privacy_policy:null,refund_policy:null,shipping_policy:null,subscription_policy:null,terms_of_service:null,products_count:0})}function a4(i){let t={settings:[]};return Array.isArray(i)&&(i[0]?.name==="theme_info"&&i.shift(),i.forEach(e=>{t.settings.push(z0(e))})),t}function s4(i){return typeof i.current=="string"&&i.presets?.[i.current]?i.presets[i.current]:typeof i.current=="object"?i.current||{}:{}}function n4(i){return Object.entries(i.presets||{}).map(([t,e])=>({label:t,settings:e}))}function r4(i){return{label:i.name,type:i.type,tag:i.tag,class:i.class,enabled_on:i.enabled_on,disabled_on:i.disabled_on,fields:(i.settings||[]).map(e=>t2(e)),blocks:(i.blocks||[]).map(e=>y0(e)),presets:(i.presets||[]).map(e=>v0(e)),default:i.default}}function y0(i){return{type:i.type,label:i.name,limit:i.limit,fields:(i.settings||[]).map(e=>t2(e))}}function v0(i){return{label:i.name,settings:i.settings,blocks:i.blocks}}function z0(i){return{label:i.name,fields:(i.settings||[]).map(e=>t2(e))}}function t2(i){let t={};switch(i.type){case"text":t={type:"text"};break;case"textarea":t={type:"textarea"};break;case"select":t={type:"select",options:i.options};break;case"checkbox":t={type:"checkbox"};break;case"radio":t={type:"radio",options:i.options};break;case"number":t={type:"integer"};break;case"range":t={type:"number",min:i.min,max:i.max,increment:i.step,unit:i.unit};break;case"article":t={type:"lookup",collection:"content/blogs:posts"};break;case"blog":t={type:"lookup",collection:"content/blogs"};break;case"collection":t={type:"category_lookup"};break;case"collection_list":t={type:"category_lookup",multiple:!0,limit:i.limit};break;case"color":t={type:"color"};break;case"color_background":t={type:"color"};break;case"color_scheme":t={type:"color_scheme"};break;case"color_scheme_group":t={type:"color_scheme_group",fields:(i.definition||[]).map(e=>t2(e)),role:i.role};break;case"font_picker":t={type:"font"};break;case"html":t={type:"html"};break;case"image_picker":t={type:"image"};break;case"inline_richtext":t={type:"rich_text"};break;case"link_list":t={type:"menu"};break;case"liquid":t={type:"liquid"};break;case"page":t={type:"lookup",collection:"content/pages"};break;case"product":t={type:"product_lookup"};break;case"product_list":t={type:"product_lookup",multiple:!0,limit:i.limit};break;case"richtext":t={type:"rich_html"};break;case"text_alignment":t={type:"select",options:[{value:"left",label:"Left"},{value:"center",label:"Center"},{value:"right",label:"Right"}]};break;case"url":t={type:"url"};break;case"video":t={type:"video"};break;case"video_url":t={type:"url"};break;case"header":t={type:"header",id:i.content,label:i.content};break}return{id:i.id,label:i.label,default:i.default,description:i.info,...t}}function o4(i){let t=i.lastIndexOf("_"),e=i.substring(0,t),l=i.substring(t+1),c=S0[e];if(c){let a=c.variants[l];return`${c.family}:${a}`}return null}var S0={abel:{family:"Abel",variants:{n4:"wght@400"}},abril_fatface:{family:"Abril Fatface",variants:{n4:"wght@400"}},alegreya:{family:"Alegreya",variants:{n4:"wght@400",i4:"ital,wght@1,400",n5:"wght@500",i5:"ital,wght@1,500",n7:"wght@700",i7:"ital,wght@1,700",n8:"wght@800",i8:"ital,wght@1,800",n9:"wght@900",i9:"ital,wght@1,900"}},alegreya_sans:{family:"Alegreya Sans",variants:{n1:"wght@100",i1:"ital,wght@1,100",n3:"wght@300",i3:"ital,wght@1,300",n4:"wght@400",i4:"ital,wght@1,400",n5:"wght@500",i5:"ital,wght@1,500",n7:"wght@700",i7:"ital,wght@1,700",n8:"wght@800",i8:"ital,wght@1,800",n9:"wght@900",i9:"ital,wght@1,900"}},amiri:{family:"Amiri",variants:{n4:"wght@400",i4:"ital,wght@1,400",n7:"wght@700",i7:"ital,wght@1,700"}},anonymous_pro:{family:"Anonymous Pro",variants:{n4:"wght@400",i4:"ital,wght@1,400",n7:"wght@700",i7:"ital,wght@1,700"}},arapey:{family:"Arapey",variants:{n4:"wght@400",i4:"ital,wght@1,400"}},archivo:{family:"Archivo",variants:{n4:"wght@400",i4:"ital,wght@1,400",n5:"wght@500",i5:"ital,wght@1,500",n6:"wght@600",i6:"ital,wght@1,600",n7:"wght@700",i7:"ital,wght@1,700"}},archivo_narrow:{family:"Archivo Narrow",variants:{n4:"wght@400",i4:"ital,wght@1,400",n5:"wght@500",i5:"ital,wght@1,500",n6:"wght@600",i6:"ital,wght@1,600",n7:"wght@700",i7:"ital,wght@1,700"}},arimo:{family:"Arimo",variants:{n4:"wght@400",i4:"ital,wght@1,400",n7:"wght@700",i7:"ital,wght@1,700"}},armata:{family:"Armata",variants:{n4:"wght@400"}},arvo:{family:"Arvo",variants:{n4:"wght@400",i4:"ital,wght@1,400",n7:"wght@700",i7:"ital,wght@1,700"}},asap:{family:"Asap",variants:{n4:"wght@400",i4:"ital,wght@1,400",n5:"wght@500",i5:"ital,wght@1,500",n6:"wght@600",i6:"ital,wght@1,600",n7:"wght@700",i7:"ital,wght@1,700"}},assistant:{family:"Assistant",variants:{n2:"wght@200",n3:"wght@300",n4:"wght@400",n6:"wght@600",n7:"wght@700",n8:"wght@800"}},asul:{family:"Asul",variants:{n4:"wght@400",n7:"wght@700"}},bio_rhyme:{family:"Bio Rhyme",variants:{n2:"wght@200",n3:"wght@300",n4:"wght@400",n7:"wght@700",n8:"wght@800"}},bitter:{family:"Bitter",variants:{n4:"wght@400",i4:"ital,wght@1,400",n7:"wght@700"}},cabin:{family:"Cabin",variants:{n4:"wght@400",i4:"ital,wght@1,400",n5:"wght@500",i5:"ital,wght@1,500",n6:"wght@600",i6:"ital,wght@1,600",n7:"wght@700",i7:"ital,wght@1,700"}},cardo:{family:"Cardo",variants:{n4:"wght@400",i4:"ital,wght@1,400",n7:"wght@700"}},catamaran:{family:"Catamaran",variants:{n1:"wght@100",n2:"wght@200",n3:"wght@300",n4:"wght@400",n5:"wght@500",n6:"wght@600",n7:"wght@700",n8:"wght@800",n9:"wght@900"}},chivo:{family:"Chivo",variants:{n3:"wght@300",i3:"ital,wght@1,300",n4:"wght@400",i4:"ital,wght@1,400",n7:"wght@700",i7:"ital,wght@1,700",n9:"wght@900",i9:"ital,wght@1,900"}},cormorant:{family:"Cormorant",variants:{n3:"wght@300",i3:"ital,wght@1,300",n4:"wght@400",i4:"ital,wght@1,400",n5:"wght@500",i5:"ital,wght@1,500",n6:"wght@600",i6:"ital,wght@1,600",n7:"wght@700",i7:"ital,wght@1,700"}},crimson_text:{family:"Crimson Text",variants:{n4:"wght@400",i4:"ital,wght@1,400",n6:"wght@600",i6:"ital,wght@1,600",n7:"wght@700",i7:"ital,wght@1,700"}},dm_sans:{family:"DM Sans",variants:{n4:"wght@400",i4:"ital,wght@1,400",n5:"wght@500",i5:"ital,wght@1,500",n7:"wght@700",i7:"ital,wght@1,700"}},domine:{family:"Domine",variants:{n4:"wght@400",n7:"wght@700"}},dosis:{family:"Dosis",variants:{n2:"wght@200",n3:"wght@300",n4:"wght@400",n5:"wght@500",n6:"wght@600",n7:"wght@700",n8:"wght@800"}},eczar:{family:"Eczar",variants:{n4:"wght@400",n5:"wght@500",n6:"wght@600",n7:"wght@700",n8:"wght@800"}},fira_sans:{family:"Fira Sans",variants:{n1:"wght@100",i1:"ital,wght@1,100",n2:"wght@200",i2:"ital,wght@1,200",n3:"wght@300",i3:"ital,wght@1,300",n4:"wght@400",i4:"ital,wght@1,400",n5:"wght@500",i5:"ital,wght@1,500",n6:"wght@600",i6:"ital,wght@1,600",n7:"wght@700",i7:"ital,wght@1,700",n8:"wght@800",i8:"ital,wght@1,800",n9:"wght@900",i9:"ital,wght@1,900"}},fjalla_one:{family:"Fjalla One",variants:{n4:"wght@400"}},glegoo:{family:"Glegoo",variants:{n4:"wght@400",n7:"wght@700"}},ibm_plex_sans:{family:"IBM Plex Sans",variants:{n1:"wght@100",i1:"ital,wght@1,100",n2:"wght@200",i2:"ital,wght@1,200",n3:"wght@300",i3:"ital,wght@1,300",n4:"wght@400",i4:"ital,wght@1,400",n5:"wght@500",i5:"ital,wght@1,500",n6:"wght@600",i6:"ital,wght@1,600",n7:"wght@700",i7:"ital,wght@1,700"}},inconsolata:{family:"Inconsolata",variants:{n4:"wght@400",n7:"wght@700"}},inknut_antiqua:{family:"Inknut Antiqua",variants:{n3:"wght@300",n4:"wght@400",n5:"wght@500",n6:"wght@600",n7:"wght@700",n8:"wght@800",n9:"wght@900"}},inter:{family:"Inter",variants:{n1:"wght@100",n2:"wght@200",n3:"wght@300",n4:"wght@400",n5:"wght@500",n6:"wght@600",n7:"wght@700",n8:"wght@800",n9:"wght@900"}},josefin_sans:{family:"Josefin Sans",variants:{n1:"wght@100",i1:"ital,wght@1,100",n3:"wght@300",i3:"ital,wght@1,300",n4:"wght@400",i4:"ital,wght@1,400",n6:"wght@600",i6:"ital,wght@1,600",n7:"wght@700",i7:"ital,wght@1,700"}},josefin_slab:{family:"Josefin Slab",variants:{n1:"wght@100",i1:"ital,wght@1,100",n3:"wght@300",i3:"ital,wght@1,300",n4:"wght@400",i4:"ital,wght@1,400",n6:"wght@600",i6:"ital,wght@1,600",n7:"wght@700",i7:"ital,wght@1,700"}},kalam:{family:"Kalam",variants:{n3:"wght@300",n4:"wght@400",n7:"wght@700"}},karla:{family:"Karla",variants:{n4:"wght@400",i4:"ital,wght@1,400",n7:"wght@700",i7:"ital,wght@1,700"}},kreon:{family:"Kreon",variants:{n3:"wght@300",n4:"wght@400",n7:"wght@700"}},lato:{family:"Lato",variants:{n1:"wght@100",i1:"ital,wght@1,100",n2:"wght@200",i2:"ital,wght@1,200",n3:"wght@300",i3:"ital,wght@1,300",n4:"wght@400",i4:"ital,wght@1,400",n5:"wght@500",i5:"ital,wght@1,500",n6:"wght@600",i6:"ital,wght@1,600",n7:"wght@700",i7:"ital,wght@1,700",n8:"wght@800",i8:"ital,wght@1,800",n9:"wght@900",i9:"ital,wght@1,900"}},libre_baskerville:{family:"Libre Baskerville",variants:{n4:"wght@400",i4:"ital,wght@1,400",n7:"wght@700"}},libre_franklin:{family:"Libre Franklin",variants:{n1:"wght@100",i1:"ital,wght@1,100",n2:"wght@200",i2:"ital,wght@1,200",n3:"wght@300",i3:"ital,wght@1,300",n4:"wght@400",i4:"ital,wght@1,400",n5:"wght@500",i5:"ital,wght@1,500",n6:"wght@600",i6:"ital,wght@1,600",n7:"wght@700",i7:"ital,wght@1,700",n8:"wght@800",i8:"ital,wght@1,800",n9:"wght@900",i9:"ital,wght@1,900"}},lobster:{family:"Lobster",variants:{n4:"wght@400"}},lobster_two:{family:"Lobster Two",variants:{n4:"wght@400",i4:"ital,wght@1,400",n7:"wght@700",i7:"ital,wght@1,700"}},lora:{family:"Lora",variants:{n4:"wght@400",i4:"ital,wght@1,400",n7:"wght@700",i7:"ital,wght@1,700"}},maven_pro:{family:"Maven Pro",variants:{n4:"wght@400",n5:"wght@500",n7:"wght@700",n9:"wght@900"}},megrim:{family:"Megrim",variants:{n4:"wght@400"}},merriweather_sans:{family:"Merriweather Sans",variants:{n3:"wght@300",i3:"ital,wght@1,300",n4:"wght@400",i4:"ital,wght@1,400",n7:"wght@700",i7:"ital,wght@1,700",n8:"wght@800",i8:"ital,wght@1,800"}},montserrat:{family:"Montserrat",variants:{n1:"wght@100",i1:"ital,wght@1,100",n2:"wght@200",i2:"ital,wght@1,200",n3:"wght@300",i3:"ital,wght@1,300",n4:"wght@400",i4:"ital,wght@1,400",n5:"wght@500",i5:"ital,wght@1,500",n6:"wght@600",i6:"ital,wght@1,600",n7:"wght@700",i7:"ital,wght@1,700",n8:"wght@800",i8:"ital,wght@1,800",n9:"wght@900",i9:"ital,wght@1,900"}},mouse_memoirs:{family:"Mouse Memoirs",variants:{n4:"wght@400"}},muli:{family:"Muli",variants:{n2:"wght@200",i2:"ital,wght@1,200",n3:"wght@300",i3:"ital,wght@1,300",n4:"wght@400",i4:"ital,wght@1,400",n6:"wght@600",i6:"ital,wght@1,600",n7:"wght@700",i7:"ital,wght@1,700",n8:"wght@800",i8:"ital,wght@1,800",n9:"wght@900",i9:"ital,wght@1,900"}},neuton:{family:"Neuton",variants:{n2:"wght@200",n3:"wght@300",n4:"wght@400",i4:"ital,wght@1,400",n7:"wght@700",n8:"wght@800"}},news_cycle:{family:"News Cycle",variants:{n4:"wght@400",n7:"wght@700"}},newsreader:{family:"Newsreader",variants:{n2:"wght@200",i2:"ital,wght@1,200",n3:"wght@300",i3:"ital,wght@1,300",n4:"wght@400",i4:"ital,wght@1,400",n5:"wght@500",i5:"ital,wght@1,500",n6:"wght@600",i6:"ital,wght@1,600",n7:"wght@700",i7:"ital,wght@1,700",n8:"wght@800",i8:"ital,wght@1,800"}},nobile:{family:"Nobile",variants:{n4:"wght@400",i4:"ital,wght@1,400",n5:"wght@500",i5:"ital,wght@1,500",n7:"wght@700",i7:"ital,wght@1,700"}},noticia_text:{family:"Noticia Text",variants:{n4:"wght@400",i4:"ital,wght@1,400",n7:"wght@700",i7:"ital,wght@1,700"}},noto_serif:{family:"Noto Serif",variants:{n4:"wght@400",i4:"ital,wght@1,400",n7:"wght@700",i7:"ital,wght@1,700"}},nunito:{family:"Nunito",variants:{n2:"wght@200",i2:"ital,wght@1,200",n3:"wght@300",i3:"ital,wght@1,300",n4:"wght@400",i4:"ital,wght@1,400",n6:"wght@600",i6:"ital,wght@1,600",n7:"wght@700",i7:"ital,wght@1,700",n8:"wght@800",i8:"ital,wght@1,800",n9:"wght@900",i9:"ital,wght@1,900"}},nunito_sans:{family:"Nunito Sans",variants:{n2:"wght@200",i2:"ital,wght@1,200",n3:"wght@300",i3:"ital,wght@1,300",n4:"wght@400",i4:"ital,wght@1,400",n6:"wght@600",i6:"ital,wght@1,600",n7:"wght@700",i7:"ital,wght@1,700",n8:"wght@800",i8:"ital,wght@1,800",n9:"wght@900",i9:"ital,wght@1,900"}},old_standard_tt:{family:"Old Standard TT",variants:{n4:"wght@400",i4:"ital,wght@1,400",n7:"wght@700"}},open_sans:{family:"Open Sans",variants:{n3:"wght@300",i3:"ital,wght@1,300",n4:"wght@400",i4:"ital,wght@1,400",n6:"wght@600",i6:"ital,wght@1,600",n7:"wght@700",i7:"ital,wght@1,700",n8:"wght@800",i8:"ital,wght@1,800"}},open_sans_condensed:{family:"Open Sans Condensed",variants:{n3:"wght@300",i3:"ital,wght@1,300",n7:"wght@700"}},oswald:{family:"Oswald",variants:{n2:"wght@200",n3:"wght@300",n4:"wght@400",n5:"wght@500",n6:"wght@600",n7:"wght@700"}},ovo:{family:"Ovo",variants:{n4:"wght@400"}},oxygen:{family:"Oxygen",variants:{n3:"wght@300",n4:"wght@400",n7:"wght@700"}},pt_mono:{family:"PT Mono",variants:{n4:"wght@400"}},pt_sans:{family:"PT Sans",variants:{n4:"wght@400",i4:"ital,wght@1,400",n7:"wght@700",i7:"ital,wght@1,700"}},pt_sans_narrow:{family:"PT Sans Narrow",variants:{n4:"wght@400",n7:"wght@700"}},pt_serif:{family:"PT Serif",variants:{n4:"wght@400",i4:"ital,wght@1,400",n7:"wght@700",i7:"ital,wght@1,700"}},pacifico:{family:"Pacifico",variants:{n4:"wght@400"}},playball:{family:"Playball",variants:{n4:"wght@400"}},playfair_display:{family:"Playfair Display",variants:{n4:"wght@400",i4:"ital,wght@1,400",n7:"wght@700",i7:"ital,wght@1,700",n9:"wght@900",i9:"ital,wght@1,900"}},poppins:{family:"Poppins",variants:{n1:"wght@100",i1:"ital,wght@1,100",n2:"wght@200",i2:"ital,wght@1,200",n3:"wght@300",i3:"ital,wght@1,300",n4:"wght@400",i4:"ital,wght@1,400",n5:"wght@500",i5:"ital,wght@1,500",n6:"wght@600",i6:"ital,wght@1,600",n7:"wght@700",i7:"ital,wght@1,700",n8:"wght@800",i8:"ital,wght@1,800",n9:"wght@900",i9:"ital,wght@1,900"}},prata:{family:"Prata",variants:{n4:"wght@400"}},prompt:{family:"Prompt",variants:{n1:"wght@100",i1:"ital,wght@1,100",n2:"wght@200",i2:"ital,wght@1,200",n3:"wght@300",i3:"ital,wght@1,300",n4:"wght@400",i4:"ital,wght@1,400",n5:"wght@500",i5:"ital,wght@1,500",n6:"wght@600",i6:"ital,wght@1,600",n7:"wght@700",i7:"ital,wght@1,700",n8:"wght@800",i8:"ital,wght@1,800",n9:"wght@900",i9:"ital,wght@1,900"}},proza_libre:{family:"Proza Libre",variants:{n4:"wght@400",i4:"ital,wght@1,400",n5:"wght@500",i5:"ital,wght@1,500",n6:"wght@600",i6:"ital,wght@1,600",n7:"wght@700",i7:"ital,wght@1,700",n8:"wght@800",i8:"ital,wght@1,800"}},quantico:{family:"Quantico",variants:{n4:"wght@400",i4:"ital,wght@1,400",n7:"wght@700",i7:"ital,wght@1,700"}},quattrocento:{family:"Quattrocento",variants:{n4:"wght@400",n7:"wght@700"}},quattrocento_sans:{family:"Quattrocento Sans",variants:{n4:"wght@400",i4:"ital,wght@1,400",n7:"wght@700",i7:"ital,wght@1,700"}},questrial:{family:"Questrial",variants:{n4:"wght@400"}},quicksand:{family:"Quicksand",variants:{n3:"wght@300",n4:"wght@400",n5:"wght@500",n7:"wght@700"}},rajdhani:{family:"Rajdhani",variants:{n3:"wght@300",n4:"wght@400",n5:"wght@500",n6:"wght@600",n7:"wght@700"}},raleway:{family:"Raleway",variants:{n1:"wght@100",i1:"ital,wght@1,100",n2:"wght@200",i2:"ital,wght@1,200",n3:"wght@300",i3:"ital,wght@1,300",n4:"wght@400",i4:"ital,wght@1,400",n5:"wght@500",i5:"ital,wght@1,500",n6:"wght@600",i6:"ital,wght@1,600",n7:"wght@700",i7:"ital,wght@1,700",n8:"wght@800",i8:"ital,wght@1,800",n9:"wght@900",i9:"ital,wght@1,900"}},righteous:{family:"Righteous",variants:{n4:"wght@400"}},roboto:{family:"Roboto",variants:{n1:"wght@100",i1:"ital,wght@1,100",n3:"wght@300",i3:"ital,wght@1,300",n4:"wght@400",i4:"ital,wght@1,400",n5:"wght@500",i5:"ital,wght@1,500",n7:"wght@700",i7:"ital,wght@1,700",n9:"wght@900",i9:"ital,wght@1,900"}},roboto_condensed:{family:"Roboto Condensed",variants:{n3:"wght@300",i3:"ital,wght@1,300",n4:"wght@400",i4:"ital,wght@1,400",n7:"wght@700",i7:"ital,wght@1,700"}},roboto_mono:{family:"Roboto Mono",variants:{n1:"wght@100",i1:"ital,wght@1,100",n3:"wght@300",i3:"ital,wght@1,300",n4:"wght@400",i4:"ital,wght@1,400",n5:"wght@500",i5:"ital,wght@1,500",n7:"wght@700",i7:"ital,wght@1,700"}},roboto_slab:{family:"Roboto Slab",variants:{n1:"wght@100",n3:"wght@300",n4:"wght@400",n7:"wght@700"}},rubik:{family:"Rubik",variants:{n3:"wght@300",i3:"ital,wght@1,300",n4:"wght@400",i4:"ital,wght@1,400",n5:"wght@500",i5:"ital,wght@1,500",n7:"wght@700",i7:"ital,wght@1,700",n9:"wght@900",i9:"ital,wght@1,900"}},shadows_into_light:{family:"Shadows Into Light",variants:{n4:"wght@400"}},slabo_13px:{family:"Slabo 13px",variants:{n4:"wght@400"}},smooch:{family:"Smooch",variants:{n4:"wght@400"}},source_code_pro:{family:"Source Code Pro",variants:{n2:"wght@200",n3:"wght@300",n4:"wght@400",n5:"wght@500",n6:"wght@600",n7:"wght@700",n9:"wght@900"}},source_sans_pro:{family:"Source Sans Pro",variants:{n2:"wght@200",i2:"ital,wght@1,200",n3:"wght@300",i3:"ital,wght@1,300",n4:"wght@400",i4:"ital,wght@1,400",n6:"wght@600",i6:"ital,wght@1,600",n7:"wght@700",i7:"ital,wght@1,700",n9:"wght@900",i9:"ital,wght@1,900"}},space_mono:{family:"Space Mono",variants:{n4:"wght@400",i4:"ital,wght@1,400",n7:"wght@700",i7:"ital,wght@1,700"}},syne:{family:"Syne",variants:{n4:"wght@400",n5:"wght@500",n6:"wght@600",n7:"wght@700",n8:"wght@800"}},tenor_sans:{family:"Tenor Sans",variants:{n4:"wght@400"}},tinos:{family:"Tinos",variants:{n4:"wght@400",i4:"ital,wght@1,400",n7:"wght@700",i7:"ital,wght@1,700"}},titillium_web:{family:"Titillium Web",variants:{n2:"wght@200",i2:"ital,wght@1,200",n3:"wght@300",i3:"ital,wght@1,300",n4:"wght@400",i4:"ital,wght@1,400",n6:"wght@600",i6:"ital,wght@1,600",n7:"wght@700",i7:"ital,wght@1,700",n9:"wght@900"}},ubuntu:{family:"Ubuntu",variants:{n3:"wght@300",i3:"ital,wght@1,300",n4:"wght@400",i4:"ital,wght@1,400",n5:"wght@500",i5:"ital,wght@1,500",n7:"wght@700",i7:"ital,wght@1,700"}},unica_one:{family:"Unica One",variants:{n4:"wght@400"}},unna:{family:"Unna",variants:{n4:"wght@400",i4:"ital,wght@1,400",n7:"wght@700",i7:"ital,wght@1,700"}},varela:{family:"Varela",variants:{n4:"wght@400"}},varela_round:{family:"Varela Round",variants:{n4:"wght@400"}},vidaloka:{family:"Vidaloka",variants:{n4:"wght@400"}},volkhov:{family:"Volkhov",variants:{n4:"wght@400",i4:"ital,wght@1,400",n7:"wght@700",i7:"ital,wght@1,700"}},vollkorn:{family:"Vollkorn",variants:{n4:"wght@400",i4:"ital,wght@1,400",n6:"wght@600",i6:"ital,wght@1,600",n7:"wght@700",i7:"ital,wght@1,700",n9:"wght@900",i9:"ital,wght@1,900"}},work_sans:{family:"Work Sans",variants:{n1:"wght@100",n2:"wght@200",n3:"wght@300",n4:"wght@400",n5:"wght@500",n6:"wght@600",n7:"wght@700",n8:"wght@800",n9:"wght@900"}},biz_udpmincho:{family:"BIZ UDPMincho",variants:{n4:"wght@400",n7:"wght@700"}},dela_gothic_one:{family:"Dela Gothic One",variants:{n4:"wght@400"}},hina_mincho:{family:"Hina Mincho",variants:{n4:"wght@400"}},kaisei_decol:{family:"Kaisei Decol",variants:{n4:"wght@400",n5:"wght@500",n7:"wght@700"}},kaisei_opti:{family:"Kaisei Opti",variants:{n4:"wght@400",n5:"wght@500",n7:"wght@700"}},kaisei_tokumin:{family:"Kaisei Tokumin",variants:{n4:"wght@400",n5:"wght@500",n7:"wght@700",n8:"wght@800"}},m_plus_1:{family:"M PLUS 1",variants:{n1:"wght@100",n2:"wght@200",n3:"wght@300",n4:"wght@400",n5:"wght@500",n6:"wght@600",n7:"wght@700",n8:"wght@800",n9:"wght@900"}},m_plus_rounded_1c:{family:"M PLUS Rounded 1c",variants:{n1:"wght@100",n3:"wght@300",n4:"wght@400",n5:"wght@500",n7:"wght@700",n8:"wght@800",n9:"wght@900"}},mochiy_pop_p_one:{family:"Mochiy Pop P One",variants:{n4:"wght@400"}},murecho:{family:"Murecho",variants:{n1:"wght@100",n2:"wght@200",n3:"wght@300",n4:"wght@400",n5:"wght@500",n6:"wght@600",n7:"wght@700",n8:"wght@800",n9:"wght@900"}},noto_sans_japanese:{family:"Noto Sans Japanese",variants:{n1:"wght@100",n2:"wght@200",n3:"wght@300",n4:"wght@400",n5:"wght@500",n6:"wght@600",n7:"wght@700",n8:"wght@800",n9:"wght@900"}},noto_serif_japanese:{family:"Noto Serif Japanese",variants:{n2:"wght@200",n3:"wght@300",n4:"wght@400",n5:"wght@500",n6:"wght@600",n7:"wght@700",n9:"wght@900"}},shippori_mincho:{family:"Shippori Mincho",variants:{n4:"wght@400",n5:"wght@500",n6:"wght@600",n7:"wght@700",n8:"wght@800"}},zen_kaku_gothic_new:{family:"Zen Kaku Gothic New",variants:{n3:"wght@300",n4:"wght@400",n5:"wght@500",n7:"wght@700",n9:"wght@900"}},zen_kurenaido:{family:"Zen Kurenaido",variants:{n4:"wght@400"}},zen_maru_gothic:{family:"Zen Maru Gothic",variants:{n3:"wght@300",n4:"wght@400",n5:"wght@500",n7:"wght@700",n9:"wght@900"}},zen_old_mincho:{family:"Zen Old Mincho",variants:{n4:"wght@400",n5:"wght@500",n6:"wght@600",n7:"wght@700",n9:"wght@900"}}};var h1=class{theme;swell;pageId;pageResourceMap;objectResourceMap;formResourceMap;queryParamsMap;editorLocaleConfig;constructor(t){this.theme=t,this.swell=t.swell,this.pageResourceMap=this.getPageResourceMap(),this.objectResourceMap=this.getObjectResourceMap(),this.formResourceMap=this.getFormResourceMap(),this.queryParamsMap=this.getQueryParamsMap()}adaptGlobals(t){let{store:e,request:l,page:c,menus:a}=t;this.pageId=this.getPageType(c?.id),t.shop=this.getShopData(t),t.page={...c||void 0},t.request={...l||void 0,design_mode:this.swell.isEditor,visual_section_preview:!1,page_type:c?.id},t.linklists=a,t.current_page=this.swell.queryParams.page||1,t.routes=this.getPageRoutes(),t.localization=this.getLocalizationObject(e,l),t.all_country_option_tags=this.getAllCountryOptionTags(t.geo)}adaptPageData(t){let e=this.pageResourceMap.find(({page:l})=>l===this.pageId);if(e)for(let[l,c]of Object.entries(t)){let a=e.resources.find(({from:s})=>s===l);a&&c instanceof L&&(t[a.to]=a.object(this,c))}this.adaptObjectData(t)}adaptObjectData(t){for(let e of Object.values(t)){let l=this.objectResourceMap.find(({from:c})=>e instanceof c);if(l){let c=l.object(this,e);e instanceof L?e.setCompatibilityProps(c):Object.assign(e,c)}}}adaptQueryParams(){let t={};for(let[e,l]of Object.entries(this.swell.queryParams)){let c=this.queryParamsMap.find(({from:a})=>typeof a=="function"?a(e):a===e);if(c){let a=typeof c.to=="function"?c.to(e,l):{[c.to]:l};Object.assign(t,a)}else t[e]=l}this.swell.queryParams=t}getAdaptedFormType(t){return this.formResourceMap.find(l=>l.shopifyType===t)?.type}async getAdaptedFormClientParams(t,e,l){let c=this.formResourceMap.find(a=>a.type===t);if(c?.clientParams)return await c.clientParams(e,l)}async getAdaptedFormClientHtml(t,e,l){let c=this.formResourceMap.find(a=>a.type===t);if(c?.clientHtml)return await c.clientHtml(e,l)}async getAdaptedFormServerParams(t,e){let l=this.formResourceMap.find(c=>c.type===t||c.shopifyType===t);if(l?.serverParams)return l.serverParams(e)}async getAdaptedFormServerResponse(t,e){let l=this.formResourceMap.find(c=>c.type===t||c.shopifyType===t);if(l?.serverResponse)return await l.serverResponse(e)}getShopData({store:t}){return t?M3(this,t):{}}getContentForHeader(){return"<script>var Shopify = Shopify || {};</script>"}getMenuData(t){return S2(this,t)}getFontData(t){return b2(this,t)}getFormData(t){return _2(this,t)}getFontFromShopifySetting(t){return o4(t)}getThemeConfig(t){return s4(t)}getPresetsConfig(t){return n4(t)}getEditorConfig(t){return a4(t)}getSectionConfigSchema(t){return r4(t)}async getLocaleConfig(t,e="en",l=".json"){let a=(await t.getAllThemeConfigs()).filter(n=>n?.file_path?.startsWith("theme/locales/")&&n?.file_path?.endsWith(l)),s=a?.find(n=>n?.file_path===`theme/locales/${e}${l}`);if(!s){let n=e.split("-")[0];s=a?.find(r=>r?.file_path===`theme/locales/${n}${l}`),s||(s=a?.find(r=>r?.file_path?.endsWith(`.default${l}`)))}if(s){s=await t.getThemeConfig(s.file_path);try{return JSON.parse(s?.file_data||"")}catch{}}return{}}async getEditorLocaleConfig(t,e){if(this.editorLocaleConfig?.[e])return this.editorLocaleConfig[e];let l=await this.getLocaleConfig(t,e,".schema.json");return this.editorLocaleConfig={[e]:l},l}async renderSchemaTranslations(t,e,l="en"){if(!(0,D1.isObject)(e))return e;let c=await this.getEditorLocaleConfig(t,l);return await this.renderSchemaTranslationValue(t,e,l,c)}async renderSchemaTranslationValue(t,e,l,c){if(typeof e=="string"){if(e.startsWith("t:")){let a=e.slice(2),s=a?.split("."),n=s.pop()||"",r=s.join(".");return(0,D1.get)(c,r)?.[n]??a}}else if(e instanceof Array){let a=[];for(let s of e)a.push(await this.renderSchemaTranslationValue(t,s,l,c));return a}else if((0,D1.isObject)(e)){let a={...e};for(let[s,n]of Object.entries(e))a[s]=await this.renderSchemaTranslationValue(t,n,l,c);return a}return e}getPageType(t){return t}getPageRouteUrl(t){return t}getPageRoutes(){return{account_addresses_url:this.getPageRouteUrl("account/addresses"),account_login_url:this.getPageRouteUrl("account/login"),account_logout_url:this.getPageRouteUrl("account/logout"),account_recover_url:this.getPageRouteUrl("account/recover"),account_register_url:this.getPageRouteUrl("account/signup"),account_url:this.getPageRouteUrl("account/index"),all_products_collection_url:this.getPageRouteUrl("products/index"),cart_add_url:this.getPageRouteUrl("cart/add"),cart_change_url:this.getPageRouteUrl("cart/change"),cart_clear_url:this.getPageRouteUrl("cart/clear"),cart_update_url:this.getPageRouteUrl("cart/update"),cart_url:this.getPageRouteUrl("cart/index"),collections_url:this.getPageRouteUrl("categories/index"),predictive_search_url:this.getPageRouteUrl("search/suggest"),product_recommendations_url:this.getPageRouteUrl("products/index"),root_url:this.getPageRouteUrl("index"),search_url:this.getPageRouteUrl("search")}}getLocalizationObject(t,e){return _1(this,t,e)}getAdaptedPageUrl(t){if(!t)return;let e,l={},[c,a,s,n]=t.split("?")[0].split("/");switch(a){case"account":switch(s){case"order":e="account/order",l.id=n;break;case"register":e="account/login";break;default:break}break;case"blog":s&&(e="blogs/category",l.category=s),n&&(e="blogs/blog",l.slug=n);break;case"collections":s?s==="all"?e="products/index":(e="categories/category",l.slug=s):e="categories/index";break;case"gift_card":s&&(e="gift-card",l.code=s);break}if(e){let r=this.getPageRouteUrl(e);if(r)return r.replace(/:(\w+)/g,(p,w)=>l[w])}}getThemeFilePath(t,e){switch(t){case"assets":return`assets/${e}`;case"components":return`snippets/${e}`;case"config":return`config/${e}`;case"layouts":return`layout/${e}`;case"templates":return`templates/${this.getPageType(e)}`;case"sections":return`sections/${e}`;default:throw new Error(`Theme file type not supported: ${t}`)}}getPageResourceMap(){return[]}getObjectResourceMap(){return[]}getFormResourceMap(){return[]}getQueryParamsMap(){return[{from:"sort_by",to:"sort"},{from:t=>t.startsWith("filter.v."),to:(t,e)=>{let l=t.split("filter.v.")[1],c=e;return{[l]:c}}}]}getAllCountryOptionTags(t){return t?.countries?.map(e=>{if(!e)return;let l=[...(t?.states||[]).filter(a=>a.country===e.id).map(a=>[a.id,a.name])],c=JSON.stringify(l).replace(/"/g,"&quot;");return`<option value="${e.id}" data-provinces="${c}">${e.name}</option>`}).filter(Boolean).join(`
41
41
  `)}};var x3=100,k3=15,e2=1e3*5,L=class{_getter;_getterHash;_result;_compatibilityProps={};constructor(t){return t&&this._setGetter(t),this._getProxy()}_getProxy(){return new Proxy(this,{get(t,e){let l=t;if(!(e==="toLiquid"||e==="next")){if(e==="then")return!1;if(e==="toJSON"||e==="toObject")return()=>l.toObject();if(typeof l[e]=="function"||e.startsWith?.("_"))return l[e];if(typeof e=="symbol"&&e===Symbol.toStringTag)return l._result instanceof Promise?"[object Promise]":l._result!==void 0?"[object Object]":"undefined";if(l._result===void 0){if(l[e]!==void 0)return l[e];l._result=l._get().catch(c=>(console.log(c),l._getCollectionResultOrProp(l,e)))}return l._result instanceof Promise?l._result.then(()=>l._getCollectionResultOrProp(l,e)).catch(c=>(console.log(c),null)):l._getCollectionResultOrProp(l,e)}},set(t,e,l){return t[e]=l,!0}})}_getCollectionResultOrProp(t,e){if(Array.isArray(t._result?.results)){let l=t._result.results.find(c=>c.slug===e||c.id===e)||t._result.results[e];if(l)return l}return e in t._compatibilityProps?t._compatibilityProps[e]:t._result&&e in t._result?t._result[e]:t[e]}async _get(...t){return this._getter&&(this._result=Promise.resolve(this._getter()).then(e=>(this._result=e,e&&Object.assign(this,e),e)).catch(e=>(console.log(e),null))),this._result}_setGetter(t){this._getter=t,this._getterHash=P3(t.toString())}async _resolve(){return this._result===void 0?await this._get():this._result}_isResultResolved(){return this._result!==void 0&&!(this._result instanceof Promise)}async resolve(){let t={},e=await this._resolve();return e===null?null:(Object.assign(t,e),Object.assign(t,this._compatibilityProps),await f1(t))}toObject(){if(this._result===null)return null;let t={};return Object.assign(t,this._result),Object.assign(t,this._compatibilityProps),t}toJSON(){return this.toObject()}valueOf(){return this.resolve()}setCompatibilityProps(t){this._compatibilityProps=t}getCompatibilityProp(t){return this._compatibilityProps[t]}},p1=class extends L{_swell;_resource;_collection;_query={};_compatibilityInstance=null;constructor(t,e,l){if(super(l),t instanceof A1)this._swell=t;else throw new Error("Storefront resource requires `swell` instance.");return this._collection=e,this._getProxy()}_getProxy(){return super._getProxy()}getResourceObject(){let{_swell:t,_collection:e}=this;if(this._resource=(t?.storefront)[e],t&&e.startsWith("content/")){let l=e.split("/")[1]?.replace(/\/$/,"").trim();this._resource={list:c=>t.storefront.content.list(l,c),get:(c,a)=>t.storefront.content.get(l,c,a)}}if(!this._resource||!this._resource.get)throw new Error(`Swell storefront resource for collection '${e}' does not exist.`);return this._resource}},P=class i extends p1{length=0;results;count;page;pages;page_count;limit=k3;constructor(t,e,l={},c){return super(t,e,c),this._query=this._initQuery(l),c||this._setGetter(this._defaultGetter()),this._getProxy()}_getProxy(){return super._getProxy()}_initQuery(t){let e=t||{};return e.limit>x3||e.limit===null?e.limit=x3:e.limit||(e.limit=k3),this.limit=e.limit,e}_defaultGetter(){let t=this.getResourceObject();return async function(){return t.list(this._query)}}async _get(t={}){return this._query={...this._query,...t},this._result=this._swell.getCachedResource("storefront-list",[this._collection,this._query,this._getterHash],async()=>(console.log("SwellStorefrontCollection._get",this._collection,this._query),this._getter.call(this))).then(e=>(this._result=e,e&&Object.assign(this,e,{length:e.results?.length||0}),e)).catch(e=>(console.log(e),null)),this._result}[Symbol.iterator](){return this.iterator()}*iterator(){for(let t of this.results||[])yield t}_clone(t){let e=new i(this._swell,this._collection,this._query,this._getter);return this._isResultResolved()&&(e._result=(0,C3.cloneDeep)(this._result)),this._compatibilityProps&&e.setCompatibilityProps(this._compatibilityProps),t!==void 0&&(Object.assign(e,t),t._getter&&e._setGetter(t._getter)),e}_cloneWithCompatibilityResult(t){let e=this._getter,l=this._clone({_getter:async()=>{let c=await e?.call(l);if(c){let a=t(c);return{...c,...a||void 0}}return c}});if(this._isResultResolved()){let c=(0,C3.cloneDeep)(this._result);if(c){let a=t(c);Object.assign(l,c),a&&Object.assign(l,a)}}return l}},D=class extends p1{_id;id;constructor(t,e,l,c={},a){return super(t,e,a),this._id=l,this._query=c,a||this._setGetter(this._defaultGetter()),this._getProxy()}_getProxy(){return super._getProxy()}_defaultGetter(){let t=this.getResourceObject();return async function(){return t.get(this._id,this._query)}}async _get(t,e={}){return this._id=t||this._id,this._query={...this._query,...e},this._result=this._swell.getCachedResource("storefront-record",[this._collection,this._id,this._query,this._getterHash],async()=>this._getter.call(this)).then(l=>(this._result=l,l&&Object.assign(this,l),l)).catch(l=>(console.log(l),null)),this._result}},m1=class extends p1{constructor(t,e,l){return super(t,e,l),l||this._setGetter(this._defaultGetter()),this._getProxy()}_getProxy(){return super._getProxy()}_defaultGetter(){let t=this.getResourceObject();return async function(){return t.get()}}async _get(){return this._result=this._getter.call(this).then(t=>(this._result=t,t&&Object.assign(this,t),t)).catch(t=>(console.log(t),null)),this._result}},T1=class{_resource;count=0;page=0;page_count=0;limit=0;pages={};next;previous;constructor(t){this._resource=t,t instanceof P&&this.setPaginationProps()}setPaginationProps(){let{_resource:t}=this;if(this.count=t.count||0,this.page=t.page||0,this.page_count=t.page_count||0,this.limit=t.limit||0,this.pages={},t.pages)for(let[c,a]of Object.entries(t.pages))this.pages[c]={start:a.start,end:a.end,url:this.getPageUrl(Number(c))};let e=this.pages[this.page+1];this.next=e?{start:e.start,end:e.end,url:this.getPageUrl(this.page+1)}:void 0;let l=this.pages[this.page-1];this.previous=l?{start:l.start,end:l.end,url:this.getPageUrl(this.page-1)}:void 0}getPageUrl(t){let{url:e,queryParams:l}=this._resource._swell;return`${e.pathname}?${N({...l,page:t})}`}setCompatibilityProps(t){Object.assign(this,t)}};var R3={aa:"ET",ab:"GE",abr:"GH",ace:"ID",ach:"UG",ada:"GH",ady:"RU",ae:"IR",aeb:"TN",af:"ZA",agq:"CM",aho:"IN",ak:"GH",akk:"IQ",aln:"XK",alt:"RU",am:"ET",amo:"NG",aoz:"ID",apd:"TG",ar:"EG",arc:"IR","arc-Nbat":"JO","arc-Palm":"SY",arn:"CL",aro:"BO",arq:"DZ",ary:"MA",arz:"EG",as:"IN",asa:"TZ",ase:"US",ast:"ES",atj:"CA",av:"RU",awa:"IN",ay:"BO",az:"AZ","az-Arab":"IR",ba:"RU",bal:"PK",ban:"ID",bap:"NP",bar:"AT",bas:"CM",bax:"CM",bbc:"ID",bbj:"CM",bci:"CI",be:"BY",bej:"SD",bem:"ZM",bew:"ID",bez:"TZ",bfd:"CM",bfq:"IN",bft:"PK",bfy:"IN",bg:"BG",bgc:"IN",bgn:"PK",bgx:"TR",bhb:"IN",bhi:"IN",bhk:"PH",bho:"IN",bi:"VU",bik:"PH",bin:"NG",bjj:"IN",bjn:"ID",bjt:"SN",bkm:"CM",bku:"PH",blt:"VN",bm:"ML",bmq:"ML",bn:"BD",bo:"CN",bpy:"IN",bqi:"IR",bqv:"CI",br:"FR",bra:"IN",brh:"PK",brx:"IN",bs:"BA",bsq:"LR",bss:"CM",bto:"PH",btv:"PK",bua:"RU",buc:"YT",bug:"ID",bum:"CM",bvb:"GQ",byn:"ER",byv:"CM",bze:"ML",ca:"ES",cch:"NG",ccp:"BD",ce:"RU",ceb:"PH",cgg:"UG",ch:"GU",chk:"FM",chm:"RU",cho:"US",chp:"CA",chr:"US",cja:"KH",cjm:"VN",ckb:"IQ",co:"FR",cop:"EG",cps:"PH",cr:"CA",crh:"UA",crj:"CA",crk:"CA",crl:"CA",crm:"CA",crs:"SC",cs:"CZ",csb:"PL",csw:"CA",ctd:"MM",cu:"RU","cu-Glag":"BG",cv:"RU",cy:"GB",da:"DK",dak:"US",dar:"RU",dav:"KE",dcc:"IN",de:"DE",den:"CA",dgr:"CA",dje:"NE",dnj:"CI",doi:"IN",dsb:"DE",dtm:"ML",dtp:"MY",dty:"NP",dua:"CM",dv:"MV",dyo:"SN",dyu:"BF",dz:"BT",ebu:"KE",ee:"GH",efi:"NG",egl:"IT",egy:"EG",eky:"MM",el:"GR",en:"US","en-Shaw":"GB",es:"ES",esu:"US",et:"EE",ett:"IT",eu:"ES",ewo:"CM",ext:"ES",fa:"IR",fan:"GQ",ff:"SN","ff-Adlm":"GN",ffm:"ML",fi:"FI",fia:"SD",fil:"PH",fit:"SE",fj:"FJ",fo:"FO",fon:"BJ",fr:"FR",frc:"US",frp:"FR",frr:"DE",frs:"DE",fub:"CM",fud:"WF",fuf:"GN",fuq:"NE",fur:"IT",fuv:"NG",fvr:"SD",fy:"NL",ga:"IE",gaa:"GH",gag:"MD",gan:"CN",gay:"ID",gbm:"IN",gbz:"IR",gcr:"GF",gd:"GB",gez:"ET",ggn:"NP",gil:"KI",gjk:"PK",gju:"PK",gl:"ES",glk:"IR",gn:"PY",gom:"IN",gon:"IN",gor:"ID",gos:"NL",got:"UA",grc:"CY","grc-Linb":"GR",grt:"IN",gsw:"CH",gu:"IN",gub:"BR",guc:"CO",gur:"GH",guz:"KE",gv:"IM",gvr:"NP",gwi:"CA",ha:"NG",hak:"CN",haw:"US",haz:"AF",he:"IL",hi:"IN",hif:"FJ",hil:"PH",hlu:"TR",hmd:"CN",hnd:"PK",hne:"IN",hnj:"LA",hnn:"PH",hno:"PK",ho:"PG",hoc:"IN",hoj:"IN",hr:"HR",hsb:"DE",hsn:"CN",ht:"HT",hu:"HU",hy:"AM",hz:"NA",ia:"FR",iba:"MY",ibb:"NG",id:"ID",ife:"TG",ig:"NG",ii:"CN",ik:"US",ikt:"CA",ilo:"PH",in:"ID",inh:"RU",is:"IS",it:"IT",iu:"CA",iw:"IL",izh:"RU",ja:"JP",jam:"JM",jgo:"CM",ji:"UA",jmc:"TZ",jml:"NP",jut:"DK",jv:"ID",jw:"ID",ka:"GE",kaa:"UZ",kab:"DZ",kac:"MM",kaj:"NG",kam:"KE",kao:"ML",kbd:"RU",kby:"NE",kcg:"NG",kck:"ZW",kde:"TZ",kdh:"TG",kdt:"TH",kea:"CV",ken:"CM",kfo:"CI",kfr:"IN",kfy:"IN",kg:"CD",kge:"ID",kgp:"BR",kha:"IN",khb:"CN",khn:"IN",khq:"ML",kht:"IN",khw:"PK",ki:"KE",kiu:"TR",kj:"NA",kjg:"LA",kk:"KZ","kk-Arab":"CN",kkj:"CM",kl:"GL",kln:"KE",km:"KH",kmb:"AO",kn:"IN",knf:"SN",ko:"KR",koi:"RU",kok:"IN",kos:"FM",kpe:"LR",krc:"RU",kri:"SL",krj:"PH",krl:"RU",kru:"IN",ks:"IN",ksb:"TZ",ksf:"CM",ksh:"DE",ku:"TR","ku-Arab":"IQ",kum:"RU",kv:"RU",kvr:"ID",kvx:"PK",kw:"GB",kxm:"TH",kxp:"PK",ky:"KG","ky-Arab":"CN","ky-Latn":"TR",la:"VA",lab:"GR",lad:"IL",lag:"TZ",lah:"PK",laj:"UG",lb:"LU",lbe:"RU",lbw:"ID",lcp:"CN",lep:"IN",lez:"RU",lg:"UG",li:"NL",lif:"NP","lif-Limb":"IN",lij:"IT",lis:"CN",ljp:"ID",lki:"IR",lkt:"US",lmn:"IN",lmo:"IT",ln:"CD",lo:"LA",lol:"CD",loz:"ZM",lrc:"IR",lt:"LT",ltg:"LV",lu:"CD",lua:"CD",luo:"KE",luy:"KE",luz:"IR",lv:"LV",lwl:"TH",lzh:"CN",lzz:"TR",mad:"ID",maf:"CM",mag:"IN",mai:"IN",mak:"ID",man:"GM","man-Nkoo":"GN",mas:"KE",maz:"MX",mdf:"RU",mdh:"PH",mdr:"ID",men:"SL",mer:"KE",mfa:"TH",mfe:"MU",mg:"MG",mgh:"MZ",mgo:"CM",mgp:"NP",mgy:"TZ",mh:"MH",mi:"NZ",min:"ID",mis:"IQ",mk:"MK",ml:"IN",mls:"SD",mn:"MN","mn-Mong":"CN",mni:"IN",mnw:"MM",moe:"CA",moh:"CA",mos:"BF",mr:"IN",mrd:"NP",mrj:"RU",mro:"BD",ms:"MY",mt:"MT",mtr:"IN",mua:"CM",mus:"US",mvy:"PK",mwk:"ML",mwr:"IN",mwv:"ID",mxc:"ZW",my:"MM",myv:"RU",myx:"UG",myz:"IR",mzn:"IR",na:"NR",nan:"CN",nap:"IT",naq:"NA",nb:"NO",nch:"MX",nd:"ZW",ndc:"MZ",nds:"DE",ne:"NP",new:"NP",ng:"NA",ngl:"MZ",nhe:"MX",nhw:"MX",nij:"ID",niu:"NU",njo:"IN",nl:"NL",nmg:"CM",nn:"NO",nnh:"CM",no:"NO",nod:"TH",noe:"IN",non:"SE",nqo:"GN",nr:"ZA",nsk:"CA",nso:"ZA",nus:"SS",nv:"US",nxq:"CN",ny:"MW",nym:"TZ",nyn:"UG",nzi:"GH",oc:"FR",om:"ET",or:"IN",os:"GE",osa:"US",otk:"MN",pa:"IN","pa-Arab":"PK",pag:"PH",pal:"IR","pal-Phlp":"CN",pam:"PH",pap:"AW",pau:"PW",pcd:"FR",pcm:"NG",pdc:"US",pdt:"CA",peo:"IR",pfl:"DE",phn:"LB",pka:"IN",pko:"KE",pl:"PL",pms:"IT",pnt:"GR",pon:"FM",pra:"PK",prd:"IR",ps:"AF",pt:"BR",puu:"GA",qu:"PE",quc:"GT",qug:"EC",raj:"IN",rcf:"RE",rej:"ID",rgn:"IT",ria:"IN",rif:"MA",rjs:"NP",rkt:"BD",rm:"CH",rmf:"FI",rmo:"CH",rmt:"IR",rmu:"SE",rn:"BI",rng:"MZ",ro:"RO",rob:"ID",rof:"TZ",rtm:"FJ",ru:"RU",rue:"UA",rug:"SB",rw:"RW",rwk:"TZ",ryu:"JP",sa:"IN",saf:"GH",sah:"RU",saq:"KE",sas:"ID",sat:"IN",sav:"SN",saz:"IN",sbp:"TZ",sc:"IT",sck:"IN",scn:"IT",sco:"GB",scs:"CA",sd:"PK","sd-Deva":"IN","sd-Khoj":"IN","sd-Sind":"IN",sdc:"IT",sdh:"IR",se:"NO",sef:"CI",seh:"MZ",sei:"MX",ses:"ML",sg:"CF",sga:"IE",sgs:"LT",shi:"MA",shn:"MM",si:"LK",sid:"ET",sk:"SK",skr:"PK",sl:"SI",sli:"PL",sly:"ID",sm:"WS",sma:"SE",smj:"SE",smn:"FI",smp:"IL",sms:"FI",sn:"ZW",snk:"ML",so:"SO",sou:"TH",sq:"AL",sr:"RS",srb:"IN",srn:"SR",srr:"SN",srx:"IN",ss:"ZA",ssy:"ER",st:"ZA",stq:"DE",su:"ID",suk:"TZ",sus:"GN",sv:"SE",sw:"TZ",swb:"YT",swc:"CD",swg:"DE",swv:"IN",sxn:"ID",syl:"BD",syr:"IQ",szl:"PL",ta:"IN",taj:"NP",tbw:"PH",tcy:"IN",tdd:"CN",tdg:"NP",tdh:"NP",te:"IN",tem:"SL",teo:"UG",tet:"TL",tg:"TJ","tg-Arab":"PK",th:"TH",thl:"NP",thq:"NP",thr:"NP",ti:"ET",tig:"ER",tiv:"NG",tk:"TM",tkl:"TK",tkr:"AZ",tkt:"NP",tl:"PH",tly:"AZ",tmh:"NE",tn:"ZA",to:"TO",tog:"MW",tpi:"PG",tr:"TR",tru:"TR",trv:"TW",ts:"ZA",tsd:"GR",tsf:"NP",tsg:"PH",tsj:"BT",tt:"RU",ttj:"UG",tts:"TH",ttt:"AZ",tum:"MW",tvl:"TV",twq:"NE",txg:"CN",ty:"PF",tyv:"RU",tzm:"MA",udm:"RU",ug:"CN","ug-Cyrl":"KZ",uga:"SY",uk:"UA",uli:"FM",umb:"AO",und:"US",unr:"IN","unr-Deva":"NP",unx:"IN",ur:"PK",uz:"UZ","uz-Arab":"AF",vai:"LR",ve:"ZA",vec:"IT",vep:"RU",vi:"VN",vic:"SX",vls:"BE",vmf:"DE",vmw:"MZ",vot:"RU",vro:"EE",vun:"TZ",wa:"BE",wae:"CH",wal:"ET",war:"PH",wbp:"AU",wbq:"IN",wbr:"IN",wls:"WF",wni:"KM",wo:"SN",wtm:"IN",wuu:"CN",xav:"BR",xcr:"TR",xh:"ZA",xlc:"TR",xld:"TR",xmf:"GE",xmn:"CN",xmr:"SD",xna:"SA",xnr:"IN",xog:"UG",xpr:"IR",xsa:"YE",xsr:"NP",yao:"MZ",yap:"FM",yav:"CM",ybb:"CM",yo:"NG",yrl:"BR",yua:"MX",yue:"HK","yue-Hans":"CN",za:"CN",zag:"SD",zdj:"KM",zea:"NL",zgh:"MA",zh:"CN","zh-Bopo":"TW","zh-Hanb":"TW","zh-Hant":"TW",zlm:"TG",zmi:"MY",zu:"ZA",zza:"TR"};function P3(i){var t="0123456789abcdef";function e(_){var b,C="";for(b=0;b<=3;b++)C+=t.charAt(_>>b*8+4&15)+t.charAt(_>>b*8&15);return C}function l(_,b){var C=(_&65535)+(b&65535),x=(_>>16)+(b>>16)+(C>>16);return x<<16|C&65535}function c(_,b){return _<<b|_>>>32-b}function a(_,b,C,x,Z,I){return l(c(l(l(b,_),l(x,I)),Z),C)}function s(_,b,C,x,Z,I,J){return a(b&C|~b&x,_,b,Z,I,J)}function n(_,b,C,x,Z,I,J){return a(b&x|C&~x,_,b,Z,I,J)}function r(_,b,C,x,Z,I,J){return a(b^C^x,_,b,Z,I,J)}function p(_,b,C,x,Z,I,J){return a(C^(b|~x),_,b,Z,I,J)}function w(_){var b,C=(_.length+8>>6)+1,x=new Array(C*16);for(b=0;b<C*16;b++)x[b]=0;for(b=0;b<_.length;b++)x[b>>2]|=_.charCodeAt(b)<<b%4*8;return x[b>>2]|=128<<b%4*8,x[C*16-2]=_.length*8,x}var m,d=w(""+i),f=1732584193,u=-271733879,g=-1732584194,o=271733878,S,z,M,k;for(m=0;m<d.length;m+=16)S=f,z=u,M=g,k=o,f=s(f,u,g,o,d[m+0],7,-680876936),o=s(o,f,u,g,d[m+1],12,-389564586),g=s(g,o,f,u,d[m+2],17,606105819),u=s(u,g,o,f,d[m+3],22,-1044525330),f=s(f,u,g,o,d[m+4],7,-176418897),o=s(o,f,u,g,d[m+5],12,1200080426),g=s(g,o,f,u,d[m+6],17,-1473231341),u=s(u,g,o,f,d[m+7],22,-45705983),f=s(f,u,g,o,d[m+8],7,1770035416),o=s(o,f,u,g,d[m+9],12,-1958414417),g=s(g,o,f,u,d[m+10],17,-42063),u=s(u,g,o,f,d[m+11],22,-1990404162),f=s(f,u,g,o,d[m+12],7,1804603682),o=s(o,f,u,g,d[m+13],12,-40341101),g=s(g,o,f,u,d[m+14],17,-1502002290),u=s(u,g,o,f,d[m+15],22,1236535329),f=n(f,u,g,o,d[m+1],5,-165796510),o=n(o,f,u,g,d[m+6],9,-1069501632),g=n(g,o,f,u,d[m+11],14,643717713),u=n(u,g,o,f,d[m+0],20,-373897302),f=n(f,u,g,o,d[m+5],5,-701558691),o=n(o,f,u,g,d[m+10],9,38016083),g=n(g,o,f,u,d[m+15],14,-660478335),u=n(u,g,o,f,d[m+4],20,-405537848),f=n(f,u,g,o,d[m+9],5,568446438),o=n(o,f,u,g,d[m+14],9,-1019803690),g=n(g,o,f,u,d[m+3],14,-187363961),u=n(u,g,o,f,d[m+8],20,1163531501),f=n(f,u,g,o,d[m+13],5,-1444681467),o=n(o,f,u,g,d[m+2],9,-51403784),g=n(g,o,f,u,d[m+7],14,1735328473),u=n(u,g,o,f,d[m+12],20,-1926607734),f=r(f,u,g,o,d[m+5],4,-378558),o=r(o,f,u,g,d[m+8],11,-2022574463),g=r(g,o,f,u,d[m+11],16,1839030562),u=r(u,g,o,f,d[m+14],23,-35309556),f=r(f,u,g,o,d[m+1],4,-1530992060),o=r(o,f,u,g,d[m+4],11,1272893353),g=r(g,o,f,u,d[m+7],16,-155497632),u=r(u,g,o,f,d[m+10],23,-1094730640),f=r(f,u,g,o,d[m+13],4,681279174),o=r(o,f,u,g,d[m+0],11,-358537222),g=r(g,o,f,u,d[m+3],16,-722521979),u=r(u,g,o,f,d[m+6],23,76029189),f=r(f,u,g,o,d[m+9],4,-640364487),o=r(o,f,u,g,d[m+12],11,-421815835),g=r(g,o,f,u,d[m+15],16,530742520),u=r(u,g,o,f,d[m+2],23,-995338651),f=p(f,u,g,o,d[m+0],6,-198630844),o=p(o,f,u,g,d[m+7],10,1126891415),g=p(g,o,f,u,d[m+14],15,-1416354905),u=p(u,g,o,f,d[m+5],21,-57434055),f=p(f,u,g,o,d[m+12],6,1700485571),o=p(o,f,u,g,d[m+3],10,-1894986606),g=p(g,o,f,u,d[m+10],15,-1051523),u=p(u,g,o,f,d[m+1],21,-2054922799),f=p(f,u,g,o,d[m+8],6,1873313359),o=p(o,f,u,g,d[m+15],10,-30611744),g=p(g,o,f,u,d[m+6],15,-1560198380),u=p(u,g,o,f,d[m+13],21,1309151649),f=p(f,u,g,o,d[m+4],6,-145523070),o=p(o,f,u,g,d[m+11],10,-1120210379),g=p(g,o,f,u,d[m+2],15,718787259),u=p(u,g,o,f,d[m+9],21,-343485551),f=l(f,S),u=l(u,z),g=l(g,M),o=l(o,k);return e(f)+e(u)+e(g)+e(o)}function b3(i){return{parent_id:i["theme-id"],branch_id:i["theme-branch-id"]||null,preview:i["deployment-mode"]==="editor"||i["deployment-mode"]==="preview"?!0:{$ne:!0}}}async function _3(i,t){let e=i.filter(c=>{if(!c.file_path?.startsWith("theme/sections/"))return!1;let a=c.file_path.endsWith(".liquid"),s=c.file_path.endsWith(".json");if(a){if(!i.find(r=>r.file_path===c.file_path.replace(/\.liquid$/,".json")))return!0}else if(s)return!0}),l=[];for(let c of e){let a=await t(c);l.push({id:c.name.split(".").pop(),...a,...a&&{presets:b0(a)}})}return l}function b0(i){return Array.isArray(i?.presets)?i.presets.map(t=>({label:t.label,settings:{...i.fields?.reduce((e,l)=>(l.id&&l.default!==void 0&&(e[l.id]=l.default),e),{}),...t.settings||void 0},blocks:t.blocks?.map(e=>{let l=i.blocks?.find(c=>c.type===e.type);return l?{...e,settings:{...l.fields.reduce((c,a)=>a.id&&a.default!==void 0?{...c,[a.id]:a.default}:c,{}),...e.settings||void 0}}:e})})):[]}async function T3(i,t){let e=i.filter(a=>a.file_path?.startsWith("theme/sections/")&&a.file_path?.endsWith(".json")&&!i.find(s=>s.file_path===a.file_path.replace(/\.json$/,".liquid"))),l=async a=>{let s=i.find(r=>{if(!r.file_path?.endsWith(`/${a}.json`)&&!r.file_path?.endsWith(`/${a}.liquid`))return!1;let p=r.file_path.endsWith(".liquid"),w=r.file_path.endsWith(".json");if(p){if(!i.find(d=>d.file_path===r.file_path.replace(/\.liquid$/,".json")))return!0}else if(w)return!0});return s?{...await t(s),id:s?.name.split(".").pop()}:void 0},c=[];for(let a of e){let s;try{s=JSON.parse(a.file_data),s?.name&&(s.label=s.name,delete s.name)}catch{}if(s?.type){let n=await X1(s,l);c.push({...s,id:a.name.split(".").pop(),sectionConfigs:n})}}return c}async function X1(i,t){let e=i.order instanceof Array?i.order:Object.keys(i.sections||{}),l=[];for(let c of e){let a=i.sections[c];if(!a)continue;let s=await t(a.type)||{id:a.type,tag:"div",class:"",fields:[],blocks:[]},n=i.id?`page__${i.id}__${c}`:s.id,p=(a.block_order instanceof Array?a.block_order:Object.keys(a.blocks||{})).map(m=>a.blocks?.[m]).filter(Boolean),w={section:{id:n,...a,blocks:p}};l.push({id:n,section:{id:n,...a},schema:s,settings:w,tag:s.tag||"div",class:s.class})}return l}function _0(i){return String(i)==="[object Array]"}function Z1(i){let t=typeof i;return i!==null&&(t==="object"||t==="function")}function L3(i){let t=new TextEncoder().encode(i),e="";for(let l=0;l<t.length;l+=3){let c=Array.from(t.slice(l,l+3));e+=btoa(String.fromCharCode(...c))}return e}function y3(i,t="id"){return(0,m4.reduce)(i,(e,l)=>(e[l[t]]=l,e),{})}function T0(i){let t=i.toUpperCase().split(/-|_/),e=t.shift(),l=t.pop(),c="";return l&&(c=l),l||(c=R3[e.toLowerCase()]||""),c.toLowerCase()}function Z3(i,t){if(!(typeof i!="object"||i===null)){for(let e in i)if(Object.prototype.hasOwnProperty.call(i,e)&&t(e,i)!==!1){let c=i[e];typeof c=="object"&&c!==null&&Z3(c,t)}}}function M0(i){let t=[];return Z3(i,(e,l)=>{if(typeof l=="object"&&l!==null){if(t.includes(l))return!1;t.push(l)}}),t}function C0(i){let t=[];return i&&JSON.parse(JSON.stringify(i,(e,l)=>{if(typeof l=="object"&&l!==null){if(t.includes(l))return JSON.parse(JSON.stringify(l));t.push(l)}return l}))}function p4(i){if(typeof i!="object"||i===null)return i;for(let t in i)t==="_swell"?i[t]=void 0:p4(i[t])}async function f1(i,t=!0){let e=i,l=t;try{if(i instanceof Promise&&(l=!1,e=await i),i instanceof L&&(l=!1,e=await f1(i.resolve(),t)),e instanceof Array){if(e=await Promise.all(e.map(c=>f1(c,t))),e.filter(c=>c!==void 0).length===0)return t?[]:void 0}else if(typeof e=="object"&&e!==null&&!e._swell){let c={};for(let[a]of Object.entries(e))!t&&(e[a]instanceof Promise||e[a]instanceof L||e instanceof v)||(c[a]=await f1(e[a],l));return!t&&Object.keys(c).length===0?void 0:c}}catch(c){return console.error(c),i}return e}function N(i){return h4.default.stringify({...i,sections:void 0,section_id:void 0},{encodeValuesOnly:!0,arrayFormat:"repeat"})}var H1=class{map=new Map;kvStore;timeoutDefault;constructor(t,e=6e4){t&&(this.kvStore=t),console.log(`Initializing cache - timeout: ${e}${t?" - KV: enabled":""}`),this.timeoutDefault=e}setValues(t){this.map=new Map(t)}getValues(){return Array.from(this.map)}async get(t){if(this.map.has(t))return this.map.get(t);if(this.kvStore){let e,l=await this.kvStore.get(t);try{l===null?e=void 0:(e=JSON.parse(l),e==="KV_NULL"&&(e=null)),this.setSync(t,e,this.timeoutDefault)}catch(c){console.error("Cache.get JSON.parse error",t,c.message,l)}return e}}getSync(t){return this.map.get(t)}async set(t,e,l=this.timeoutDefault){if(this.setSync(t,e,l),this.kvStore){let c=e;if(e instanceof Promise&&(c=await e),c instanceof L)return;c===null&&(c="KV_NULL");let a=l*10,s=a>=6e4?a/1e3:0;this.kvStore.put(t,JSON.stringify(c),{...s>0?{expirationTtl:s}:void 0})}}setSync(t,e,l=this.timeoutDefault){this.map.set(t,e),setTimeout(()=>{this.map.delete(t)},l)}async delete(t){this.map.delete(t),this.kvStore&&await this.kvStore.delete(t)}deleteSync(t){this.map.delete(t)}async has(t){return this.get(t)}hasSync(t){return this.map.has(t)}};var f4="https://api.schema.io",u4=1e3*60,g4=["swell-store-id","swell-environment-id","swell-app-id","swell-app-version","swell-theme-id","swell-theme-version","swell-theme-branch-id","swell-theme-config-version","swell-public-key","swell-admin-url","swell-vault-url","swell-deployment-mode","swell-request-id"],A1=class i{url;headers;swellHeaders;queryParams;workerEnv;config;backend;storefront;instanceId="";isPreview=!1;isEditor=!1;sentResponse=!1;static cache=new Map;constructor(t){let{url:e,config:l,headers:c,swellHeaders:a,serverHeaders:s,queryParams:n,workerEnv:r,...p}=t;if(this.url=e instanceof URL?e:new URL(e||""),this.config=l,this.queryParams=i.formatQueryParams(n||this.url.searchParams),this.workerEnv=r,s){let{headers:w,swellHeaders:m}=i.formatHeaders(s);this.headers=w,this.swellHeaders=m,this.backend=new l2({storeId:m["store-id"],accessToken:m["access-token"],apiHost:m["api-host"]}),this.storefront=this.getStorefrontInstance({...t,headers:w,swellHeaders:m}),this.instanceId=["store-id","environment-id","deployment-mode","theme-id","theme-branch-id"].map(d=>m[d]).join("|"),this.isEditor=p.isEditor??m["deployment-mode"]==="editor",this.isPreview=this.isEditor||m["deployment-mode"]==="preview",m["cache-modified"]&&(this.getCachedSync("_cache-modified")!==m["cache-modified"]&&this.clearCache(),this.getCacheInstance().set("_cache-modified",m["cache-modified"]))}else if(c&&a)Object.assign(this,p),p.cache&&this.setCacheValues(p.cache),this.headers=c,this.swellHeaders=a,this.storefront=this.getStorefrontInstance(t);else throw new Error("Swell client requires `serverHeaders` when initialized on the server-side, or `headers` and `swellHeaders` when initialized on the client-side.")}static formatHeaders(t){let e={},l={};t instanceof Headers?t.forEach((c,a)=>{e[a]=c}):t&&(e=t);for(let c in e)c.startsWith("swell-")&&(l[c.replace("swell-","")]=e[c]||"");return{headers:e,swellHeaders:l}}static formatQueryParams(t){let e={};return t instanceof URLSearchParams?e=w4.default.parse(t.toString()):t&&(e=t),e}getClientProps(){let t=g4.reduce((c,a)=>(c[a]=this.headers[a],c),{}),e=g4.reduce((c,a)=>{let s=a.replace("swell-","");return c[s]=this.swellHeaders[s],c},{}),l=this.storefront.settings;return{url:this.url,headers:t,swellHeaders:e,queryParams:this.queryParams,instanceId:this.instanceId,isPreview:this.isPreview,isEditor:this.isEditor,cache:this.getCacheInstance().getValues(),storefrontSettingStates:{state:l.state,menuState:l.menuState,paymentState:l.paymentState,subscriptionState:l.subscriptionState,sessionState:l.sessionState}}}getStorefrontInstance(t){let{swellHeaders:e,getCookie:l,setCookie:c,storefrontSettingStates:a}=t,s=d4.default.create(e["store-id"],e["public-key"],{url:e["admin-url"],vaultUrl:e["vault-url"],getCookie:l,setCookie:c&&((n,r,p)=>c(n,r,p,this))});return a&&Object.assign(s.settings,a),s.request=this.getCacheableStorefrontRequestHandler(s),s}isStorefrontRequestCacheable(t,e){if(t==="get"){let l=e.split("/")[1];return["products","categories","content","settings"].includes(l)}return!1}getCacheableStorefrontRequestHandler(t){let e=t.request;return(l,c,a=void 0,s=void 0,n=void 0)=>this.isStorefrontRequestCacheable(l,c)?this.getCached("swell",[l,c,a,s,n],()=>e(l,c,a,s,n),e2):e(l,c,a,s,n)}getCacheInstance(){let t=i.cache.get(this.instanceId);return t||(t=new H1(this.workerEnv?.THEME,u4),i.cache.set(this.instanceId,t)),t}setCacheValues(t){let e=new H1(this.workerEnv?.THEME,u4);e.setValues(t),i.cache.set(this.instanceId,e)}setCachedSync(t,e,l,c,a=!0){let s=`${this.instanceId}:${t}_${JSON.stringify(e||[])}`,n=this.getCacheInstance();return a?n.setSync(s,l,c):n.set(s,l,c)}getCachedSync(t,e,l,c,a=!0){let s=typeof e=="function"?void 0:e,n=typeof e=="function"?e:l,r=`${this.instanceId}:${t}_${JSON.stringify(s)}`,p=this.getCacheInstance();if(a){if(p.hasSync(r))return p.getSync(r);if(n)return this.resolveCacheHandler(p,r,n,c,a)}else return p.has(r).then(w=>{if(w!==void 0)return w;if(n)return this.resolveCacheHandler(p,r,n,c,a)})}resolveCacheHandler(t,e,l,c,a=!0){let s;try{s=l(),a?t.setSync(e,s,c):t.set(e,s,c),s instanceof Promise&&s.then(n=>{a?t.setSync(e,n,c):t.set(e,n,c)})}catch(n){console.error(n)}return s}async setCached(t,e,l,c){return this.setCachedSync(t,e,l,c,!1)}async getCached(t,e,l,c){return this.getCachedSync(t,e,l,c,!1)}async getCachedResource(t,e,l,c){let a=this.swellHeaders["request-id"],s=typeof e=="function"?[a]:[a,e],n=typeof e=="function"?e:l;return await this.getCachedSync(t,s,n,c||e2)}clearCache(){i.cache.delete(this.instanceId)}async getAppSettings(){return await this.get("/:storefronts/{id}/configs/settings/values",{id:this.swellHeaders["storefront-id"]})||{}}async getStorefrontSettings(){try{let{settings:t,menus:e,payments:l,subscriptions:c,session:a}=await this.storefront.request("get",`/settings/all?storefront_id=${this.swellHeaders["storefront-id"]}`),s=this.storefront.settings;s.localizedState={},s.set({value:t}),s.set({model:"menus",value:e}),s.set({model:"payments",value:l}),s.set({model:"subscriptions",value:c}),s.set({model:"session",value:a})}catch(t){console.error(`Swell: unable to load settings (${t})`)}return this.storefront.settings.get()}getStorefrontMenus(){let t=this.storefront.settings.getState("/settings/menus","menuState");return!t||t instanceof Promise?[]:t}get(...t){return this.backend?.get(...t)}put(...t){return this.backend?.put(...t)}post(...t){return this.backend?.post(...t)}delete(...t){return this.backend?.delete(...t)}},l2=class{apiHost=f4;apiAuth="";constructor({storeId:t,accessToken:e,apiHost:l}){this.apiHost=l||f4,this.apiAuth=L3(`${t}:${e}`)}async makeRequest(t,e,l){let c={method:t,headers:{Authorization:`Basic ${this.apiAuth}`,"User-Agent":"swell-functions/1.0","Content-Type":"application/json"}},a="";if(l)try{t==="GET"?a=`?${this.stringifyQuery(l)}`:(c.body=JSON.stringify(l),c.headers["Content-Length"]=String(c.body.length))}catch{throw new Error(`Error serializing data: ${l}`)}let s=String(e).startsWith("/")?e.substring(1):e,n=`${this.apiHost}/${s}${a}`,r=await fetch(n,c),p=await r.text(),w;try{w=JSON.parse(p)}catch{w=String(p||"").trim()}if(r.status>299)throw new F1(w,{status:r.status,method:t,endpointUrl:s});if(t!=="GET"&&w?.errors)throw new F1(w.errors,{status:400,method:t,endpointUrl:s});return w}stringifyQuery(t,e){let l=[];for(let[c,a]of Object.entries(t)){let s=e?`${e}[${c}]`:c,r=a!==null&&typeof a=="object"?this.stringifyQuery(a,s):`${encodeURIComponent(s)}=${a===null?"":encodeURIComponent(a)}`;l.push(r)}return l.join("&")}async get(t,e){return this.makeRequest("GET",t,e)}async put(t,e){return this.makeRequest("PUT",t,e)}async post(t,e){return this.makeRequest("POST",t,e)}async delete(t,e){return this.makeRequest("DELETE",t,e)}},F1=class extends Error{status=200;constructor(t,e={}){let l;typeof t=="string"?l=t:l=JSON.stringify(t,null,2),e.method&&e.endpointUrl&&(l=`${e.method} /${e.endpointUrl}
42
42
  ${l}`),super(l),this.name="SwellError",this.status=e.status||500}};function D3(i,t){return new P(i,"products",t)}function x0(i,t,e){return new D(i,"products",t,e)}function k0(i,{search:t,filter:e,sort:l}){return new P(i,"products",{search:t,filter:e,sort:l})}function P0(i,t){return new P(i,"categories",t)}function y4(i,t,e){return new D(i,"categories",t,e)}async function R0(i,t,e){let l=y4(i,t,e),c=await l.id;return l.products=D3(i,{category:c}),l}async function L0(i,t){return await i.getCached("content-model",[t],()=>i.get("/:content/{name}",{name:t,public:!0,"storefront.enabled":!0}))}async function v4(i,t,e){return new P(i,`content/${t}`,e)}async function A3(i,t,e,l){return new D(i,`content/${t}`,e,l)}async function Z0(i,t,e){return await A3(i,"pages",t,e)}async function D0(i,t){return await v4(i,"blogs",t)}async function A0(i,t,e){return await A3(i,"blogs",t,e)}var j=require("lodash-es");async function z4(i,t){return await i.renderPageTemplate(t)}async function S4(i,t){let e=t.filter(c=>F0(c,t)),l=[];for(let c of e){let a=await F3(i,c);l.push({id:c.name.split(".").pop(),...a})}return l}async function H3(i,t,e=H0){let l=t.order instanceof Array?t.order:Object.keys(t.sections||{}),c=[];for(let a of l){let s=t.sections[a],n=await e(i,s.type);if(!n)continue;let r=t.id?`page__${t.id}__${a}`:n.id,w=(s.block_order instanceof Array?s.block_order:Object.keys(s.blocks||{})).map(d=>s.blocks?.[d]).filter(Boolean),m={section:{id:r,...s,blocks:w}};c.push({id:r,settings:m,section:{id:r,...s},tag:n.tag||"div",class:n.class,schema:n})}return c}async function b4(i,t){let e=t.filter(a=>q0(a,t)),l=async(a,s)=>{let n=t.find(p=>E0(p,t,s));return{...await F3(a,n),id:n?.name.split(".").pop()}},c=[];for(let a of e){let s;try{s=JSON.parse(a.file_data),s?.name&&(s.label=s.name,delete s.name)}catch{}if(s?.type){let n=await H3(i,s,l);c.push({...s,id:a.name.split(".").pop(),sectionConfigs:n})}}return c}async function H0(i,t){let e=await i.getThemeTemplateConfigByType("sections",t);return F3(i,e)}async function F3(i,t){let e={};if(t?.file_path?.endsWith(".liquid")){if(i.shopifyCompatibility){i.liquidSwell.lastSchema=void 0,await i.renderTemplate(t);let l=i.liquidSwell.lastSchema||{};l&&(e=i.shopifyCompatibility.getSectionConfigSchema(l))}}else if(t?.file_data)try{e=JSON.parse(t?.file_data)||void 0}catch{}return e}function F0(i,t){return i.file_path?.startsWith("theme/sections/")?_4(i,t):!1}function q0(i,t){return i.file_path?.startsWith("theme/sections/")&&i.file_path?.endsWith(".json")&&!t.find(e=>e.file_path===i.file_path.replace(/\.json$/,".liquid"))}function E0(i,t,e){return!i.file_path?.endsWith(`/${e}.json`)&&!i.file_path?.endsWith(`/${e}.liquid`)?!1:_4(i,t)}function _4(i,t){let e=i.file_path.endsWith(".liquid"),l=i.file_path.endsWith(".json");if(e){if(!t.find(a=>a.file_path===i.file_path.replace(/\.liquid$/,".json")))return!0}else if(l)return!0;return!1}function i2(i){let t={description:i.description,defaultValue:i.default!==void 0?i.default:null,isLabelHidden:!0,layout:"column",params:i},e;switch(i?.type){case"text":case"short_text":e={type:"swell_short_text"};break;case"textarea":case"long_text":case"liquid":e={type:"swell_long_text"};break;case"basic_html":case"rich_text":case"rich_html":case"markdown":e={type:"swell_editor"};break;case"number":e={type:"swell_number"};break;case"select":e={type:"swell_select"};break;case"radio":e={type:"swell_radio"};break;case"checkbox":e={type:"swell_boolean"};break;case"color":e={type:"swell_color"};break;case"color_scheme":e={type:"swell_color_scheme"};break;case"color_scheme_group":e={type:"swell_color_scheme_group"};break;case"font":e={type:"swell_font"};break;case"header":e={type:"swell_header"};break;case"icon":e={type:"swell_menu"};break;case"menu":e={type:"swell_menu"};break;case"url":e={type:"swell_url"};break;case"lookup":case"generic_lookup":case"product_lookup":case"category_lookup":case"customer_lookup":e={type:"swell_lookup"};break;case"image":e={type:"swell_image",defaultValue:""};break;case"asset":case"document":case"video":e={type:"swell_file"};break;default:e={type:"swell_short_text"};break}return{...t,...e}}function V(i,t,e){if(e===void 0)return null;switch(i?.find(c=>c.id===t)?.type){default:return e}}function T4(i,t){return t?.reduce((e,l)=>{for(let c of l.fields||[])c?.id&&(e[c.id]=i[c.id]);return e},{})}function M4(i,t){return t?{settings:t.fields?.reduce((e,l)=>(l?.id&&(e[l.id]=i[l.id]),e),{}),blocks:i.Blocks?.filter(e=>e.props.compiled?._component).map(e=>{let l=e.props.compiled.props,c=e.props.compiled._component.split("__")[2],a=t.blocks?.find(s=>s.type===c);return{type:c,settings:a?.fields?.reduce((s,n)=>(n?.id&&(s[n.id]=l[n.id]),s),{})}})}:{}}async function B0(i,t,e){let l=await z4(i,e),c=await S4(i,t),a=await H3(i,l),s=await b4(i,t);return{pageTemplate:l,allSections:c,pageSections:a,layoutSectionGroups:s}}function V0(i,t,e,l,c){let a=()=>l.map(o=>({prop:`SectionGroup_${o.id}`,type:"component-collection",required:!0,accepts:r(o.type)})),s=(o,S,z)=>!!(o.templates==="*"||o[S]?.includes(z)),n=()=>t.reduce((o,S)=>(S.enabled_on?s(S.enabled_on,"templates",c)&&o.push(S.id):S.disabled_on?s(S.disabled_on,"templates",c)||o.push(S.id):l.map(({type:z})=>z).includes(S.id)||o.push(S.id),o),[]).map(o=>`${o}`),r=o=>t.reduce((S,z)=>(z.enabled_on?s(z.enabled_on,"groups",o)&&S.push(z.id):z.disabled_on?s(z.disabled_on,"groups",o)||S.push(z.id):z.id===o&&S.push(z.id),S),[]).map(S=>`${S}`),p=()=>i?.configs?.editor?.settings?.reduce((o,S)=>{for(let z of S.fields||[])z?.id&&o.push({prop:z.id,label:z.label,optional:!0,group:S.label,...i2(z)});return o},[])||[],w=()=>[...t.map(o=>({id:`${o.id}`,label:o.label,schema:[...(o.fields||[]).map(S=>{if(!(!S.id||!S.type))return{prop:S.id,label:S.label,optional:!0,...i2(S)}}).filter(Boolean),...o?.blocks?[{prop:"Blocks",type:"component-collection",required:!0,accepts:o.blocks.map(S=>`Block__${o.id}__${S.type}`),defaultValue:o.presets?.[0]?.blocks?.map(S=>{let z=o.blocks?.find(({type:M})=>M===S.type);if(z)return{_component:`Block__${o.id}__${S.type}`,...(0,j.reduce)(z.fields.filter(M=>M.id),(M,k)=>({...M,[k.id]:V(z.fields,k.id,k.default)}),{})}}),placeholderAppearance:{height:50,label:"Add block",aspectRatio:1}}]:[]],styles:()=>({styled:{Root:{}}})})),...t.reduce((o,S)=>(S.blocks&&o.push(...S.blocks.map(z=>({id:`Block__${S.id}__${z.type}`,label:z.label,schema:[...(z.fields||[]).map(M=>{if(!(!M.id||!M.type))return{prop:M.id,label:M.label,optional:!0,...i2(M)}}).filter(Boolean)],styles:()=>({styled:{Root:{}}})}))),o),[])],m=[{id:"swell_page",label:"Theme settings",schema:[{prop:"ContentSections",type:"component-collection",required:!0,accepts:n(),placeholderAppearance:{height:250,label:"Add section",aspectRatio:1}},...a(),...p()],groups:[...i?.configs?.editor?.settings?.reduce((o,S)=>(o.push({key:S.label,label:S.label,collapsable:!0,collapsed:!0}),o),[])||[]],allowSave:!0,styles:()=>({styled:{Root:{}}})},...w()],d=()=>l.reduce((o,S)=>({...o,[`SectionGroup_${S.id}`]:S.sectionConfigs.map(({section:z,settings:M,schema:k})=>({_id:`SectionGroup__${z.type}_${Math.random()}`,_component:`${z.type}`,...(0,j.reduce)(M?.section.settings,(_,b,C)=>({..._,[C]:V(k?.fields,C,b)}),{}),...M?.section.blocks?{Blocks:M.section.blocks.map(_=>({_id:`Block__${z.type}__${_.type}_${Math.random()}`,_component:`Block__${z.type}__${_.type}`,...(0,j.reduce)(_.settings,(b,C,x)=>({...b,[x]:V(k?.blocks?.find(({type:Z})=>Z===_.type)?.fields,x,C)}),{})}))}:{}}))}),{}),f=()=>i?.configs?.editor?.settings?.reduce((o,S)=>{for(let z of S.fields||[])z?.id&&(o[z.id]=V(S.fields,z.id,i?.configs?.theme?.[z.id]));return o},{}),u=()=>{let o=S=>Object.keys(S.entry).some(z=>z!=="_id"&&z!=="_component");return[...t.reduce((S,z)=>[...S,...z.presets?.map((M,k)=>({id:`${z.id}__preset_${k}`,entry:{_id:`${z.id}__preset_${k}`,_component:z.id,...(0,j.reduce)(z.fields,(_,b)=>({..._,[b.id]:V(z.fields,b.id,M.settings?.[b.id])}),{}),Blocks:M.blocks?.reduce((_,b)=>{let C=z.blocks?.find(({type:x})=>x===b.type);return C?[..._,{_id:`Block__${z.id}__${b.type}__preset_${k}`,_component:`Block__${z.id}__${b.type}`,...(0,j.reduce)(C.fields.filter(x=>x.id),(x,Z)=>({...x,[Z.id]:V(C.fields,Z.id,b.settings?.[Z.id])}),{})}]:_},[])}}))||[]],[]).filter(o),...t.reduce((S,z)=>[...S,...z.blocks?.map(M=>({id:`Block__${z.id}__${M.type}`,entry:{_id:`Block__${z.id}__${M.type}`,_component:`Block__${z.id}__${M.type}`,...(0,j.reduce)(M.fields,(k,_)=>_.id&&_.default!==void 0?{...k,[_.id]:V(M.fields,_.id,_.default)}:k,{})}}))||[]],[]).filter(o)]},g=[{id:"swell_page",entry:{_id:"swell_page",_component:"swell_page",ContentSections:e.map(({section:o,settings:S,schema:z})=>({_id:`${o.type}_${Math.random()}`,_component:`${o.type}`,...(0,j.reduce)(z?.fields,(M,k)=>k?.id?{...M,[k.id]:V(z?.fields,k.id,S?.section?.settings?.[k.id])}:M,{}),...o?.blocks?{Blocks:Object.keys(o.blocks).map(M=>{if(!o.blocks)return;let k=o.blocks[M];return{_id:`Block__${M}__${k.type}_${Math.random()}`,_component:`Block__${o.type}__${k.type}`,...(0,j.reduce)(k.settings,(_,b,C)=>({..._,[C]:V(z?.blocks?.find(({type:x})=>x===k.type)?.fields,C,b)}),{})}})}:{}})),...d(),...f()}},...u()];return{easyblocksConfig:{components:m,templates:g,backend:C4(),hideCloseButton:!0,allowSave:!0,readOnly:!1,locales:[{code:"en-US",isDefault:!0}],types:{swell_boolean:{type:"inline",widget:{id:"SwellBoolean"}},swell_color:{type:"inline",widget:{id:"SwellColor"}},swell_color_scheme:{type:"inline",widget:{id:"SwellColorScheme"}},swell_color_scheme_group:{type:"inline",widget:{id:"SwellColorSchemeGroup"}},swell_font:{type:"inline",widget:{id:"SwellFont"}},swell_header:{type:"inline",widget:{id:"SwellHeader"}},swell_icon:{type:"inline",widget:{id:"SwellIcon"}},swell_lookup:{type:"inline",widget:{id:"SwellLookup"}},swell_menu:{type:"inline",widget:{id:"SwellMenu"}},swell_url:{type:"inline",widget:{id:"SwellUrl"}},swell_number:{type:"inline",widget:{id:"SwellNumber"}},swell_select:{type:"inline",widget:{id:"SwellSelect"}},swell_short_text:{type:"inline",widget:{id:"SwellText"}},swell_long_text:{type:"inline",widget:{id:"SwellTextarea"}},swell_editor:{type:"inline",widget:{id:"SwellEditor"}},swell_file:{type:"inline",widget:{id:"SwellFile"}},swell_image:{type:"inline",widget:{id:"SwellImage"}}},tokens:{colors:[],fonts:[]}}}}function I0(i,t){let{allSections:e,layoutSectionGroups:l}=i,c=e.reduce((n,r)=>(n[`${r.id}`]=t("pageSection",r),n),{}),a=l.reduce((n,r)=>(n[`SectionGroup___${r.id}`]=t("layoutSectionGroup",r),n),{}),s=e.reduce((n,r)=>{if(r.blocks)for(let p of r.blocks){let w=`Block__${r.id}__${p.type}`;n[w]=t("block",{section:r,block:p})}return n},{});return{...c,...a,...s,swell_page:t("root")}}function C4(){return{documents:{get:async({id:t})=>(console.log("Easyblocks backend documents.get()",t),{id:t,version:1,entry:{_id:"page",_component:"swell_page"}}),create:async t=>(console.log("Easyblocks backend documents.create()",t),{}),update:async t=>(console.log("Easyblocks backend documents.update()",t),{})},templates:{get:async t=>(console.log("Easyblocks backend templates.get()",t),{}),getAll:async()=>(console.log("Easyblocks backend get templates.getAll()"),[]),create:async t=>(console.log("Easyblocks backend get templates.create()",t),{}),update:async t=>(console.log("Easyblocks backend get templates.update()",t),{}),delete:async t=>{console.log("Easyblocks backend get templates.delete()",t)}}}}0&&(module.exports={CACHE_TIMEOUT_RESOURCES,DEFAULT_QUERY_PAGE_LIMIT,DeferredShopifyResource,LANG_TO_COUNTRY_CODES,LiquidSwell,MAX_QUERY_PAGE_LIMIT,PageError,PageNotFound,ShopifyArticle,ShopifyBlog,ShopifyCart,ShopifyCollection,ShopifyCollections,ShopifyCompatibility,ShopifyCustomer,ShopifyFont,ShopifyForm,ShopifyLink,ShopifyLocalization,ShopifyOrder,ShopifyPage,ShopifyPaginate,ShopifyPredictiveSearch,ShopifyProduct,ShopifyResource,ShopifySearch,ShopifyVariant,StorefrontResource,Swell,SwellBackendAPI,SwellError,SwellStorefrontCollection,SwellStorefrontPagination,SwellStorefrontRecord,SwellStorefrontResource,SwellStorefrontSingleton,SwellTheme,ThemeColor,ThemeFont,ThemeForm,ThemeFormErrors,adaptShopifyFontData,adaptShopifyFormData,adaptShopifyMenuData,arrayToObject,brightness,deferMenuItemUrlAndResource,dehydrateSwellRefsInStorefrontResources,diff,findCircularReferences,findEditorSetting,findThemeSettingsByType,fontMap,forEachKeyDeep,getAllSections,getBlog,getBlogs,getCategories,getCategory,getCategoryWithProducts,getContentEntry,getContentList,getContentModel,getCountryCodeFromLocale,getEasyblocksBackend,getEasyblocksComponentDefinitions,getEasyblocksPagePropsWithConfigs,getEasyblocksPropsFromThemeConfigs,getLayoutSectionGroups,getMenuItemStorefrontUrl,getMenuItemUrlAndResource,getMenuItemValueId,getPage,getPageSections,getProduct,getProducts,getProductsFiltered,getSectionSettingsFromProps,getThemeSettingsFromProps,isArray,isObject,md5,mix,removeCircularReferences,resolveAsyncResources,resolveLookupCollection,resolveMenuItemUrlAndResource,resolveMenuItems,resolveMenuSettings,resolveSectionSettings,resolveThemeSettings,stringifyQueryParams,systemFonts,themeConfigQuery,toBase64});
43
43
  //# sourceMappingURL=index.cjs.map