@lightspeed/crane 1.1.0 → 1.1.2

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 (51) hide show
  1. package/dist/app.d.mts +198 -11
  2. package/dist/app.d.ts +198 -11
  3. package/dist/app.mjs +1 -1
  4. package/dist/cli.mjs +22 -11
  5. package/package.json +5 -2
  6. package/template/footers/example-footer/ExampleFooter.vue +40 -1
  7. package/template/footers/example-footer/component/LegalLinks.vue +20 -0
  8. package/template/footers/example-footer/component/ReportAbuse.vue +18 -0
  9. package/template/footers/example-footer/entity/color.ts +4 -0
  10. package/template/footers/{settings/translations.ts → example-footer/settings/content.ts} +0 -2
  11. package/template/footers/example-footer/settings/design.ts +11 -0
  12. package/template/footers/example-footer/settings/translations.ts +12 -0
  13. package/template/footers/example-footer/showcases/1.ts +2 -0
  14. package/template/footers/example-footer/showcases/translations.ts +9 -0
  15. package/template/footers/example-footer/type.ts +2 -2
  16. package/template/headers/example-header/ExampleHeader.vue +39 -7
  17. package/template/headers/example-header/assets/account_icon.svg +11 -0
  18. package/template/headers/example-header/assets/cart.svg +20 -0
  19. package/template/headers/example-header/assets/lightspeed_logo.png +0 -0
  20. package/template/headers/example-header/assets/search.svg +13 -0
  21. package/template/headers/example-header/component/Account.vue +20 -0
  22. package/template/headers/example-header/component/Cart.vue +64 -0
  23. package/template/headers/example-header/component/Logo.vue +95 -0
  24. package/template/headers/example-header/component/NavigationMenu.vue +53 -0
  25. package/template/headers/example-header/component/SearchForm.vue +89 -0
  26. package/template/headers/example-header/settings/content.ts +9 -0
  27. package/template/headers/example-header/settings/design.ts +23 -0
  28. package/template/headers/example-header/settings/translations.ts +9 -0
  29. package/template/headers/example-header/showcases/1.ts +40 -0
  30. package/template/headers/example-header/showcases/2.ts +42 -0
  31. package/template/headers/example-header/showcases/translations.ts +17 -0
  32. package/template/headers/example-header/type.ts +2 -2
  33. package/template/package.json +3 -2
  34. package/template/sections/example-section/component/image/ImagesGrid.vue +18 -37
  35. package/template/sections/example-section/settings/content.ts +53 -55
  36. package/template/sections/example-section/settings/translations.ts +27 -24
  37. package/template/sections/example-section/showcases/1.ts +143 -103
  38. package/template/sections/example-section/showcases/2.ts +127 -103
  39. package/template/sections/example-section/showcases/translations.ts +4 -0
  40. package/template/shared/LanguageSelector.vue +75 -0
  41. package/template/templates/template.ts +128 -104
  42. package/types.d.ts +262 -152
  43. package/template/footers/example-footer/component/SampleComponent.vue +0 -11
  44. package/template/footers/settings/content.ts +0 -1
  45. package/template/footers/settings/design.ts +0 -1
  46. package/template/headers/example-header/component/SampleComponent.vue +0 -11
  47. package/template/headers/settings/content.ts +0 -1
  48. package/template/headers/settings/design.ts +0 -1
  49. package/template/headers/settings/layout.ts +0 -1
  50. package/template/headers/settings/translations.ts +0 -5
  51. /package/template/{footers → headers/example-header}/settings/layout.ts +0 -0
package/dist/cli.mjs CHANGED
@@ -1,12 +1,23 @@
1
- import We from"cac";import h from"node:fs";import T from"node:path";import{fileURLToPath as P}from"node:url";import*as _ from"fs";import{rmSync as Ve,rename as Ye,unlink as Qe,existsSync as S,statSync as et,writeFileSync as tt,createReadStream as st}from"fs";import*as D from"path";import{resolve as m,parse as I,dirname as ot,sep as nt}from"path";import{red as it,yellow as rt,green as x}from"kolorist";import*as z from"node:process";import w from"node:process";import{glob as u,globSync as K}from"glob";import{build as J,defineConfig as H}from"vite";import{pathToFileURL as v}from"url";import{builtinModules as Z}from"module";import W from"@vitejs/plugin-vue";import R from"vite-tsconfig-paths";import at from"vite-plugin-checker";import{viteExternalsPlugin as ct}from"vite-plugin-externals";import pt from"ajv/dist/2020.js";import lt from"ajv-formats";import{readFile as V}from"fs/promises";import dt,{AxiosError as Y}from"axios";import{inc as mt}from"semver";import*as l from"process";import{ConcurrencyManager as ft}from"axios-concurrency";import ut from"tinycolor2";import yt from"prompts";function Q(e,t){_.statSync(e).isDirectory()?(_.mkdirSync(t,{recursive:!0}),_.readdirSync(e).forEach(s=>{const o=D.resolve(e,s),n=D.resolve(t,s);Q(o,n)})):_.copyFileSync(e,t)}function k(e,t,s,o){const n=D.join(e,o?.[s]??s);Q(D.join(t,s),n)}function ee(e,t=2){if(!+e)return"0 Bytes";const s=1024,o=t<0?0:t,n=["Bytes","KiB","MiB","GiB","TiB","PiB","EiB","ZiB","YiB"],i=Math.floor(Math.log(e)/Math.log(s));return`${parseFloat((e/Math.pow(s,i)).toFixed(o))} ${n[i]}`}const p={error:e=>console.log(it(e)),warn:e=>console.log(rt(e)),info:e=>console.log(x(e))},b="_temp",a="dist/sections",C="dist/templates",te=2*1024*1024;function B(e){return!!e}function se(){const e=["|","/","-","\\"];let t=0;return setInterval(()=>{process.stdout.write(`\r${e[t]}`),t=(t+1)%e.length},100)}function U(e){clearInterval(e),process.stdout.write("\r")}async function oe(e){try{const t=e,s=w.cwd(),o=T.join(s,t),n=["templates"],i={_gitignore:".gitignore"};h.existsSync(o)?(p.error(`App with the name: ${e} already exists. If you'd like to override it, delete previous version first`),w.exit(1)):h.mkdirSync(o);const c=T.resolve(P(import.meta.url),"../..","template");h.readdirSync(c).filter(g=>g!=="package.json").filter(g=>!n.includes(g)).forEach(async g=>k(o,c,g,i));const r=JSON.parse(h.readFileSync(T.join(c,"package.json"),"utf-8"));r.name=e;const E=T.join(o,"package.json");h.writeFileSync(E,`${JSON.stringify(r,null,2)}
2
- `),p.info(`App ${e} created`)}catch(t){p.error(`Error while creating app: ${t.message}`),w.exit(1)}}async function ne(e){try{const t=e,s=w.cwd(),o=T.join(s,"sections",t);h.existsSync(o)?(p.error(`Section with the name: ${e} already exists. If you'd like to override it, delete previous version first`),w.exit(1)):h.mkdirSync(o);const n=T.resolve(P(import.meta.url),"../..","template/sections/example-section");h.readdirSync(n).forEach(async i=>k(o,n,i)),p.info(`Section ${e} created`)}catch(t){p.error(`Error while creating section: ${t.message}`),w.exit(1)}}async function ie(e){try{const t=w.cwd(),s=T.join(t,"templates"),o={"template.ts":`${e}.ts`};h.existsSync(s)?h.existsSync(T.join(s,`${e}.ts`))&&(p.error(`Template with the name: ${e} already exists. If you'd like to override it, delete previous version first`),w.exit(1)):h.mkdirSync(s);const n=T.resolve(P(import.meta.url),"../..","template/templates");h.readdirSync(n).forEach(async i=>k(s,n,i,o)),p.info(`Template descriptor file [${e}.ts] has been created`)}catch(t){p.error(`Error while creating template descriptors: ${t.message}`),w.exit(1)}}var f=(e=>(e[e.Server=0]="Server",e[e.Client=1]="Client",e[e.SectionSetting=2]="SectionSetting",e[e.SectionShowcase=3]="SectionShowcase",e[e.SectionAsset=4]="SectionAsset",e[e.TemplateDescriptor=5]="TemplateDescriptor",e[e.TemplateAsset=6]="TemplateAsset",e))(f||{}),$=(e=>(e[e.Server=0]="Server",e[e.Client=1]="Client",e[e.Misc=2]="Misc",e))($||{});const ht={[$.Server]:[W(),R()],[$.Client]:[W(),R(),ae(),ct({vue:"EcVue"})],[$.Misc]:[R(),ae()]},re={"process.env":{NODE_ENV:"production"}},j={[f.Server]:{pluginType:$.Server,define:re,ssr:!0,ssrOptions:{noExternal:!0},outDir:e=>`./${a}/${e}/js/main/server`,externalOption:[...Z,...Z.map(e=>`node:${e}`)],entryFileNames:"[name].js"},[f.Client]:{pluginType:$.Client,define:re,ssr:!1,outDir:e=>`./${a}/${e}/js/main/client`,entryFileNames:"[name].js",chunkFileNames:"[name].js",assetFileNames:"assets/[name].[ext]"},[f.SectionSetting]:{pluginType:$.Misc,ssr:!1,outDir:e=>`./${a}/${e}/js/settings`,entryFileNames:"[name].mjs"},[f.SectionShowcase]:{pluginType:$.Misc,ssr:!1,outDir:e=>`./${a}/${e}/js/showcases`,entryFileNames:"[name].mjs"},[f.SectionAsset]:{pluginType:$.Misc,ssr:!1,outDir:e=>`./${a}/${e}/assets`,assetFileNames:"[name].[ext]"},[f.TemplateDescriptor]:{pluginType:$.Misc,ssr:!1,outDir:()=>`./${C}/js`,entryFileNames:`[name]${b}.mjs`},[f.TemplateAsset]:{pluginType:$.Misc,ssr:!1,outDir:()=>`./${C}/assets`,assetFileNames:"[name].[ext]"}};function gt(e){switch(typeof e){case"string":return[m(process.cwd(),e)];case"object":return e.map(t=>m(process.cwd(),t));default:return[]}}function ae(){const e=process.env.npm_lifecycle_event;return at({typescript:!0,vueTsc:!1,eslint:{lintCommand:`eslint --max-warnings=0 "./sections/**/*.{js,ts,vue}" --cache --cache-location "./build/eslintcache/${e}.json"`}})}function ce(e,t,s){const o=j[s].define,n=j[s].ssrOptions,i=j[s].externalOption,c=j[s].entryFileNames,r=j[s].chunkFileNames,E=j[s].assetFileNames;return{plugins:ht[j[s].pluginType],...o!=null&&{define:o},...n!=null&&{ssr:n},resolve:{alias:{"@":"/src"}},build:{ssr:j[s].ssr,outDir:j[s].outDir(e),emptyOutDir:!0,rollupOptions:{...i!=null&&{external:i},preserveEntrySignatures:"strict",input:gt(t),output:{validate:!0,...c!=null&&{entryFileNames:c},...r!=null&&{chunkFileNames:r},...E!=null&&{assetFileNames:E}}}}}}const pe="https://json-schema.org/draft/2020-12/schema",le="https://lightspeedhq.com/template.schema.json",de="Custom Template",me="A custom template enclosing the necessary custom and default blocks",fe="object",ue={metadata:{type:"object",properties:{name:{description:"Name of the template",type:"string",minLength:2,maxLength:60},description:{description:"Short description of the template",type:"string",minLength:2,maxLength:150},preview_url:{description:"Preview url of the demo website",type:"string",format:"uri",pattern:"^(https?)://([^.]+?\\.)company\\.site($|/[A-Za-z0-9\\-._~:/?#\\[\\]@!$&'()*+,;=]*)?$"},cover_image:{type:"object",properties:{set:{description:"Name of the image set",type:"object",patternProperties:{".*":{type:"object",properties:{url:{description:"Path to the preview image relative to the 'assets' folder for a specific resolution",type:"string"}},required:["url"],additionalProperties:!1}}}},required:["set"],additionalProperties:!1}},required:["name","description","cover_image"],additionalProperties:!1},sections:{description:"List of sections contained by this template",type:"array",items:{type:"object",properties:{type:{description:"Type of the section",type:"string",enum:["custom","default"]}},allOf:[{if:{properties:{type:{const:"default"}}},then:{$ref:"template-default.schema.json#/$defs/default-section"}},{if:{properties:{type:{const:"custom"}}},then:{$ref:"template-custom.schema.json#/$defs/custom-section"}}]},minItems:1,uniqueItems:!1}},ye=["metadata","sections"],$t={$schema:pe,$id:le,title:de,description:me,type:fe,properties:ue,required:ye},he={__proto__:null,$id:le,$schema:pe,default:$t,description:me,properties:ue,required:ye,title:de,type:fe},ge="https://json-schema.org/draft/2020-12/schema",$e="https://lightspeedhq.com/template-default.schema.json",Ee="Default Section",Te="Default section for a Custom Template",we="object",je={"default-section":{type:"object",properties:{type:{description:"Type of the section",type:"string",enum:["custom","default"]},id:{description:"Identification of the section",type:"string",pattern:"^((header|cover|announcement_bar|slider|special_offer|customer_review|company_info|shipping_payment|location|store|footer)(_\\d{3})?)$"}},required:["type","id"],additionalProperties:!1}},Et={$schema:ge,$id:$e,title:Ee,description:Te,type:we,$defs:je},Tt={__proto__:null,$defs:je,$id:$e,$schema:ge,default:Et,description:Te,title:Ee,type:we},Oe="https://json-schema.org/draft/2020-12/schema",ve="https://lightspeedhq.com/template-custom.schema.json",Se="Custom Section",be="Custom section for a Custom Template",Ce="object",Ae={"custom-section":{type:"object",properties:{type:{description:"Type of the section",type:"string",enum:["custom","default"]},id:{description:"Identification of the section",type:"string"},showcase_id:{description:"Showcase id of the section",type:"string"},showcase_overrides:{type:"object",description:"Overrides for the showcase",properties:{content:{type:"object",patternProperties:{".*":{type:"object",properties:{type:{description:"Type of the content configuration element",type:"string",enum:["INPUTBOX","TEXTAREA","BUTTON","IMAGE","TOGGLE","SELECTBOX"]}},allOf:[{if:{properties:{type:{const:"INPUTBOX"}}},then:{$ref:"template-custom-content.schema.json#/$defs/input_box"}},{if:{properties:{type:{const:"TEXTAREA"}}},then:{$ref:"template-custom-content.schema.json#/$defs/text_area"}},{if:{properties:{type:{const:"BUTTON"}}},then:{$ref:"template-custom-content.schema.json#/$defs/button"}},{if:{properties:{type:{const:"IMAGE"}}},then:{$ref:"template-custom-content.schema.json#/$defs/image"}},{if:{properties:{type:{const:"TOGGLE"}}},then:{$ref:"template-custom-content.schema.json#/$defs/toggle"}},{if:{properties:{type:{const:"SELECTBOX"}}},then:{$ref:"template-custom-content.schema.json#/$defs/select_box"}}]}},minProperties:1},design:{type:"object",patternProperties:{".*":{type:"object",properties:{type:{description:"Type of the design configuration element",type:"string",enum:["TEXT","BUTTON","IMAGE","TOGGLE","SELECTBOX","BACKGROUND"]}},allOf:[{if:{properties:{type:{const:"TEXT"}}},then:{$ref:"template-custom-design.schema.json#/$defs/text"}},{if:{properties:{type:{const:"BUTTON"}}},then:{$ref:"template-custom-design.schema.json#/$defs/button"}},{if:{properties:{type:{const:"IMAGE"}}},then:{$ref:"template-custom-design.schema.json#/$defs/image"}},{if:{properties:{type:{const:"TOGGLE"}}},then:{$ref:"template-custom-design.schema.json#/$defs/toggle"}},{if:{properties:{type:{const:"SELECTBOX"}}},then:{$ref:"template-custom-design.schema.json#/$defs/select_box"}},{if:{properties:{type:{const:"BACKGROUND"}}},then:{$ref:"template-custom-design.schema.json#/$defs/background"}}]}},minProperties:1},layoutId:{description:"Layout ID for the showcase",type:"string"},blockName:{description:"Section name for the showcase",type:"string"}},required:["content","design"]}},required:["type","id"],additionalProperties:!1}},wt={$schema:Oe,$id:ve,title:Se,description:be,type:Ce,$defs:Ae},jt={__proto__:null,$defs:Ae,$id:ve,$schema:Oe,default:wt,description:be,title:Se,type:Ce},Ne="https://json-schema.org/draft/2020-12/schema",Le="https://lightspeedhq.com/template-custom-content.schema.json",_e="Custom Section :: Content Configuration",De="Content tab configuration of a Custom Section for a Custom Template",Ie="object",xe={input_box:{type:"object",properties:{type:{description:"Type of the content configuration element",type:"string",enum:["INPUTBOX","TEXTAREA","BUTTON","IMAGE","TOGGLE","SELECTBOX"]},text:{type:"string"}},required:["type","text"],additionalProperties:!1},text_area:{type:"object",properties:{type:{description:"Type of the content configuration element",type:"string",enum:["INPUTBOX","TEXTAREA","BUTTON","IMAGE","TOGGLE","SELECTBOX"]},text:{type:"string"}},required:["type","text"],additionalProperties:!1},button:{type:"object",properties:{type:{description:"Type of the content configuration element",type:"string",enum:["INPUTBOX","TEXTAREA","BUTTON","IMAGE","TOGGLE","SELECTBOX"]},title:{type:"string"},buttonType:{type:"string",enum:["SCROLL_TO_TILE","HYPER_LINK","MAIL_LINK","TEL_LINK","GO_TO_STORE_LINK","GO_TO_PAGE"]},link:{type:"string",format:"uri"},linkTarget:{type:"string"},email:{type:"string"},phone:{type:"string"},tileId:{type:"string"}},required:["type","title"],additionalProperties:!1},image:{type:"object",properties:{type:{description:"Type of the content configuration element",type:"string",enum:["INPUTBOX","TEXTAREA","BUTTON","IMAGE","TOGGLE","SELECTBOX"]},imageData:{type:"object",properties:{set:{type:"object"},borderInfo:{type:"object"},bucket:{type:"string"}},required:["set"]}},required:["type"],additionalProperties:!1},toggle:{type:"object",properties:{type:{description:"Type of the content configuration element",type:"string",enum:["INPUTBOX","TEXTAREA","BUTTON","IMAGE","TOGGLE","SELECTBOX"]},enabled:{type:"boolean"}},required:["type"],additionalProperties:!1},select_box:{type:"object",properties:{type:{description:"Type of the content configuration element",type:"string",enum:["INPUTBOX","TEXTAREA","BUTTON","IMAGE","TOGGLE","SELECTBOX"]},value:{type:"string"}},required:["type"],additionalProperties:!1}},Ot={$schema:Ne,$id:Le,title:_e,description:De,type:Ie,$defs:xe},vt={__proto__:null,$defs:xe,$id:Le,$schema:Ne,default:Ot,description:De,title:_e,type:Ie},Ge="https://json-schema.org/draft/2020-12/schema",Pe="https://lightspeedhq.com/template-custom-design.schema.json",Re="Custom Section :: Design Configuration",ke="Design tab configuration of a Custom Section for a Custom Template",Be="object",Ue={text:{type:"object",properties:{type:{description:"Type of the text",type:"string",enum:["TEXT","BUTTON","IMAGE","TOGGLE","SELECTBOX","BACKGROUND"]},font:{description:"Default font for the text",type:"string"},size:{description:"Default size for the text",type:"integer",minimum:1,exclusiveMaximum:50},bold:{description:"Default boldness for the text",type:"boolean"},italic:{description:"Default italic style for the text",type:"boolean"},color:{description:"Default color for the text",type:"string",pattern:"^#([a-fA-F0-9]{8}|[a-fA-F0-9]{6}|[a-fA-F0-9]{3})$"},visible:{description:"Default visibility for the text",type:"boolean"}},additionalProperties:!1},button:{type:"object",properties:{type:{description:"Type of the button",type:"string",enum:["TEXT","BUTTON","IMAGE","TOGGLE","SELECTBOX","BACKGROUND"]},font:{description:"Default font for the button",type:"string"},size:{description:"Default size for the button",type:"string",enum:["SMALL","MEDIUM","LARGE"]},appearance:{description:"Default appearance for the button",type:"string",enum:["SOLID","OUTLINE","TEXT"]},shape:{description:"Default shape for the button",type:"string",enum:["ROUND_CORNER","RECTANGLE","PILL"]},color:{description:"Default color for the button",type:"string",pattern:"^#([a-fA-F0-9]{8}|[a-fA-F0-9]{6}|[a-fA-F0-9]{3})$"}},additionalProperties:!1},image:{type:"object",properties:{type:{description:"Type of the image",type:"string",enum:["TEXT","BUTTON","IMAGE","TOGGLE","SELECTBOX","BACKGROUND"]},overlay:{description:"Default overlay for the image",type:"string",enum:["COLOR","GRADIENT","NONE"]}},if:{properties:{overlay:{const:"GRADIENT"}}},then:{properties:{color:{description:"Default color for the image",type:"array",items:{type:"string",pattern:"^#([a-fA-F0-9]{8}|[a-fA-F0-9]{6}|[a-fA-F0-9]{3})$"},minItems:2,maxItems:2}}},else:{properties:{color:{description:"Default color for the image",type:"string",pattern:"^#([a-fA-F0-9]{8}|[a-fA-F0-9]{6}|[a-fA-F0-9]{3})$"}}}},toggle:{type:"object",properties:{type:{description:"Type of the toggle",type:"string",enum:["TEXT","BUTTON","IMAGE","TOGGLE","SELECTBOX","BACKGROUND"]},enabled:{description:"Default enabled status for the toggle",type:"boolean"}},additionalProperties:!1},select_box:{type:"object",properties:{type:{description:"Type of the checkbox",type:"string",enum:["TEXT","BUTTON","IMAGE","TOGGLE","SELECTBOX","BACKGROUND"]},value:{description:"Default option for the checkbox",type:"string"}},additionalProperties:!1},background:{type:"object",properties:{type:{description:"Type of the background",type:"string",enum:["TEXT","BUTTON","IMAGE","TOGGLE","SELECTBOX","BACKGROUND"]},style:{description:"Default style for the background",type:"string",enum:["COLOR","GRADIENT"]}},if:{properties:{style:{const:"GRADIENT"}}},then:{properties:{color:{description:"Default colors for the image",type:"array",items:{type:"string",pattern:"^#([a-fA-F0-9]{8}|[a-fA-F0-9]{6}|[a-fA-F0-9]{3})$"},minItems:2,maxItems:2}}},else:{properties:{color:{description:"Default color for the image",type:"string"}}}}},St={$schema:Ge,$id:Pe,title:Re,description:ke,type:Be,$defs:Ue},bt={__proto__:null,$defs:Ue,$id:Pe,$schema:Ge,default:St,description:ke,title:Re,type:Be};async function Ct(){const e=await u("**/server.{js,ts}",{ignore:["node_modules/**","dist/**","headers/**","footers/**"]});return Promise.all(e.map(async t=>{const s=ot(t).split(nt).pop()??"default",o=await u(`**/${s}/client.{js,ts}`,{ignore:["node_modules/**","dist/**"]}),n=await u(`**/${s}/settings/content.{js,ts}`,{ignore:["node_modules/**","dist/**"]}),i=await u(`**/${s}/settings/design.{js,ts}`,{ignore:["node_modules/**","dist/**"]}),c=await u(`**/${s}/settings/layout.{js,ts}`,{ignore:["node_modules/**","dist/**"]}),r=await u(`**/${s}/settings/translations.{js,ts}`,{ignore:["node_modules/**","dist/**"]}),E=await u(`**/${s}/showcases/*.{js,ts}`,{ignore:["node_modules/**","dist/**",`**/${s}/showcases/translations.{js,ts}`]}),g=await u(`**/${s}/showcases/translations.{js,ts}`,{ignore:["node_modules/**","dist/**"]}),G=await u(`**/${s}/assets/*`,{ignore:["node_modules/**","dist/**"]});return{name:s,serverEntrypoint:t,clientEntrypoint:o.at(0),contentSettingsEntrypoint:n.at(0),designSettingsEntrypoint:i.at(0),layoutSettingsEntrypoint:c.at(0),settingsTranslationsEntrypoint:r.at(0),showcasesEntrypoints:E,showcasesTranslationsEntrypoint:g.at(0),assetsEntrypoints:G}}))}async function At(){const e=await u("./templates/**.{js,ts}",{ignore:["node_modules/**","dist/**"]}),t=await u("./templates/assets/*",{ignore:["node_modules/**","dist/**"]});return{templates:e,assets:t}}async function M(e,t){try{const s=m(z.cwd(),t?`${e}${b}.mjs`:`${e}.mjs`);return(await import(v(s).href)).default}catch{throw new Error(`File [${e}${b}.mjs] is either invalid or undefined`)}}async function Nt(){let e=new pt({allErrors:!0,schemas:[he,Tt,jt,vt,bt]});return lt(e),e.compile(he)}async function Lt(e,t,s,o){if(e(t)&&o===void 0)new Promise(n=>{Ye(`${s}${b}.mjs`,`${s}.mjs`,function(i){i&&n(i)})});else throw new Promise(n=>{Qe(`${s}${b}.mjs`,function(i){i&&n(i)})}),new Error(`Invalid file [${I(s).name}].
1
+ import En from"cac";import Cn from"prompts";import{red as On,yellow as wn,green as Z}from"kolorist";import A from"node:fs";import k from"node:path";import*as Ue from"node:process";import D from"node:process";import{fileURLToPath as V}from"node:url";import*as Q from"fs";import de,{existsSync as L,rename as vn,unlink as $n,statSync as Tn,promises as jn,writeFileSync as An,createReadStream as Sn}from"fs";import*as ee from"path";import te,{resolve as C,parse as ne,dirname as Nn,sep as kn}from"path";import{glob as T,globSync as Xe}from"glob";import{normalizePath as ze,build as qe,defineConfig as Ke}from"vite";import{pathToFileURL as P}from"url";import{builtinModules as He}from"module";import Ve from"@vitejs/plugin-vue";import me from"vite-tsconfig-paths";import{viteExternalsPlugin as xn}from"vite-plugin-externals";import se from"fs-extra";import In from"os";import Je from"tty";import G from"zlib";import Fn from"util";import Ln from"vite-plugin-checker";import _n from"ajv/dist/2020.js";import Rn from"ajv-formats";import{readFile as We}from"fs/promises";import Mn,{AxiosError as Ye}from"axios";import{inc as Dn}from"semver";import*as E from"process";import{ConcurrencyManager as Gn}from"axios-concurrency";import Bn from"tinycolor2";function Ze(e,t){Q.statSync(e).isDirectory()?(Q.mkdirSync(t,{recursive:!0}),Q.readdirSync(e).forEach(s=>{const r=ee.resolve(e,s),n=ee.resolve(t,s);Ze(r,n)})):Q.copyFileSync(e,t)}function oe(e,t,s,r){const n=ee.join(e,r?.[s]??s);Ze(ee.join(t,s),n)}function Qe(e,t=2){if(!+e)return"0 Bytes";const s=1024,r=t<0?0:t,n=["Bytes","KiB","MiB","GiB","TiB","PiB","EiB","ZiB","YiB"],o=Math.floor(Math.log(e)/Math.log(s));return`${parseFloat((e/s**o).toFixed(r))} ${n[o]}`}const b={error:e=>console.log(On(e)),warn:e=>console.log(wn(e)),info:e=>console.log(Z(e))},X="_temp",S="dist/sections",he="dist/headers",ye="dist/footers",z="dist/templates",et=2*1024*1024;function ge(e){return!!e}function tt(){const e=["|","/","-","\\"];let t=0;return setInterval(()=>{process.stdout.write(`\r${e[t]}`),t=(t+1)%e.length},100)}function be(e){clearInterval(e),process.stdout.write("\r")}async function nt(e){try{const t=e,s=D.cwd(),r=k.join(s,t),n=["templates","headers","footers"],o={_gitignore:".gitignore"};A.existsSync(r)?(b.error(`App with the name: ${e} already exists. If you'd like to override it, delete previous version first`),D.exit(1)):A.mkdirSync(r);const i=k.resolve(V(import.meta.url),"../..","template");A.readdirSync(i).filter(p=>p!=="package.json").filter(p=>!n.includes(p)).forEach(async p=>oe(r,i,p,o));const c=JSON.parse(A.readFileSync(k.join(i,"package.json"),"utf-8"));c.name=e;const a=k.join(r,"package.json");A.writeFileSync(a,`${JSON.stringify(c,null,2)}
2
+ `),b.info(`App ${e} created`)}catch(t){b.error(`Error while creating app: ${t.message}`),D.exit(1)}}async function st(e){try{const t=e,s=D.cwd(),r=k.join(s,"sections",t);A.existsSync(r)?(b.error(`Section with the name: ${e} already exists. If you'd like to override it, delete previous version first`),D.exit(1)):A.mkdirSync(r);const n=k.resolve(V(import.meta.url),"../..","template/sections/example-section");A.readdirSync(n).forEach(async o=>oe(r,n,o)),b.info(`Section ${e} created`)}catch(t){b.error(`Error while creating section: ${t.message}`),D.exit(1)}}async function ot(e,t=!1){try{const s=D.cwd(),r=k.join(s,"templates"),n={"template.ts":`${e}.ts`};A.existsSync(r)?A.existsSync(k.join(r,`${e}.ts`))&&(b.error(`Template with the name: ${e} already exists. If you'd like to override it, delete previous version first`),D.exit(1)):A.mkdirSync(r);const o=k.resolve(V(import.meta.url),"../..","template/templates");if(A.readdirSync(o).forEach(async i=>oe(r,o,i,n)),t){const i={headers:k.resolve(V(import.meta.url),"../..","template/headers"),footers:k.resolve(V(import.meta.url),"../..","template/footers")};["headers","footers"].forEach(c=>{const a=k.join(s,c);if(!A.existsSync(a)){A.mkdirSync(a);const p=i[c];A.readdirSync(p).forEach(async u=>oe(a,p,u))}})}b.info(`Template descriptor file [${e}.ts] has been created`)}catch(s){b.error(`Error while creating template descriptors: ${s.message}`),D.exit(1)}}var j=(e=>(e[e.Server=0]="Server",e[e.Client=1]="Client",e[e.SectionSetting=2]="SectionSetting",e[e.SectionShowcase=3]="SectionShowcase",e[e.SectionAsset=4]="SectionAsset",e[e.TemplateDescriptor=5]="TemplateDescriptor",e[e.TemplateAsset=6]="TemplateAsset",e))(j||{}),I=(e=>(e[e.Server=0]="Server",e[e.Client=1]="Client",e[e.Misc=2]="Misc",e))(I||{});function rt(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Ee={exports:{}},Ce,it;function Pn(){return it||(it=1,Ce={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]}),Ce}var Oe,at;function ct(){if(at)return Oe;at=1;const e=Pn(),t={};for(const n of Object.keys(e))t[e[n]]=n;const s={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"},hsv:{channels:3,labels:"hsv"},hwb:{channels:3,labels:"hwb"},cmyk:{channels:4,labels:"cmyk"},xyz:{channels:3,labels:"xyz"},lab:{channels:3,labels:"lab"},lch:{channels:3,labels:"lch"},hex:{channels:1,labels:["hex"]},keyword:{channels:1,labels:["keyword"]},ansi16:{channels:1,labels:["ansi16"]},ansi256:{channels:1,labels:["ansi256"]},hcg:{channels:3,labels:["h","c","g"]},apple:{channels:3,labels:["r16","g16","b16"]},gray:{channels:1,labels:["gray"]}};Oe=s;for(const n of Object.keys(s)){if(!("channels"in s[n]))throw new Error("missing channels property: "+n);if(!("labels"in s[n]))throw new Error("missing channel labels property: "+n);if(s[n].labels.length!==s[n].channels)throw new Error("channel and label counts mismatch: "+n);const{channels:o,labels:i}=s[n];delete s[n].channels,delete s[n].labels,Object.defineProperty(s[n],"channels",{value:o}),Object.defineProperty(s[n],"labels",{value:i})}s.rgb.hsl=function(n){const o=n[0]/255,i=n[1]/255,c=n[2]/255,a=Math.min(o,i,c),p=Math.max(o,i,c),u=p-a;let l,f;p===a?l=0:o===p?l=(i-c)/u:i===p?l=2+(c-o)/u:c===p&&(l=4+(o-i)/u),l=Math.min(l*60,360),l<0&&(l+=360);const d=(a+p)/2;return p===a?f=0:d<=.5?f=u/(p+a):f=u/(2-p-a),[l,f*100,d*100]},s.rgb.hsv=function(n){let o,i,c,a,p;const u=n[0]/255,l=n[1]/255,f=n[2]/255,d=Math.max(u,l,f),m=d-Math.min(u,l,f),h=function(g){return(d-g)/6/m+1/2};return m===0?(a=0,p=0):(p=m/d,o=h(u),i=h(l),c=h(f),u===d?a=c-i:l===d?a=1/3+o-c:f===d&&(a=2/3+i-o),a<0?a+=1:a>1&&(a-=1)),[a*360,p*100,d*100]},s.rgb.hwb=function(n){const o=n[0],i=n[1];let c=n[2];const a=s.rgb.hsl(n)[0],p=1/255*Math.min(o,Math.min(i,c));return c=1-1/255*Math.max(o,Math.max(i,c)),[a,p*100,c*100]},s.rgb.cmyk=function(n){const o=n[0]/255,i=n[1]/255,c=n[2]/255,a=Math.min(1-o,1-i,1-c),p=(1-o-a)/(1-a)||0,u=(1-i-a)/(1-a)||0,l=(1-c-a)/(1-a)||0;return[p*100,u*100,l*100,a*100]};function r(n,o){return(n[0]-o[0])**2+(n[1]-o[1])**2+(n[2]-o[2])**2}return s.rgb.keyword=function(n){const o=t[n];if(o)return o;let i=1/0,c;for(const a of Object.keys(e)){const p=e[a],u=r(n,p);u<i&&(i=u,c=a)}return c},s.keyword.rgb=function(n){return e[n]},s.rgb.xyz=function(n){let o=n[0]/255,i=n[1]/255,c=n[2]/255;o=o>.04045?((o+.055)/1.055)**2.4:o/12.92,i=i>.04045?((i+.055)/1.055)**2.4:i/12.92,c=c>.04045?((c+.055)/1.055)**2.4:c/12.92;const a=o*.4124+i*.3576+c*.1805,p=o*.2126+i*.7152+c*.0722,u=o*.0193+i*.1192+c*.9505;return[a*100,p*100,u*100]},s.rgb.lab=function(n){const o=s.rgb.xyz(n);let i=o[0],c=o[1],a=o[2];i/=95.047,c/=100,a/=108.883,i=i>.008856?i**(1/3):7.787*i+16/116,c=c>.008856?c**(1/3):7.787*c+16/116,a=a>.008856?a**(1/3):7.787*a+16/116;const p=116*c-16,u=500*(i-c),l=200*(c-a);return[p,u,l]},s.hsl.rgb=function(n){const o=n[0]/360,i=n[1]/100,c=n[2]/100;let a,p,u;if(i===0)return u=c*255,[u,u,u];c<.5?a=c*(1+i):a=c+i-c*i;const l=2*c-a,f=[0,0,0];for(let d=0;d<3;d++)p=o+1/3*-(d-1),p<0&&p++,p>1&&p--,6*p<1?u=l+(a-l)*6*p:2*p<1?u=a:3*p<2?u=l+(a-l)*(2/3-p)*6:u=l,f[d]=u*255;return f},s.hsl.hsv=function(n){const o=n[0];let i=n[1]/100,c=n[2]/100,a=i;const p=Math.max(c,.01);c*=2,i*=c<=1?c:2-c,a*=p<=1?p:2-p;const u=(c+i)/2,l=c===0?2*a/(p+a):2*i/(c+i);return[o,l*100,u*100]},s.hsv.rgb=function(n){const o=n[0]/60,i=n[1]/100;let c=n[2]/100;const a=Math.floor(o)%6,p=o-Math.floor(o),u=255*c*(1-i),l=255*c*(1-i*p),f=255*c*(1-i*(1-p));switch(c*=255,a){case 0:return[c,f,u];case 1:return[l,c,u];case 2:return[u,c,f];case 3:return[u,l,c];case 4:return[f,u,c];case 5:return[c,u,l]}},s.hsv.hsl=function(n){const o=n[0],i=n[1]/100,c=n[2]/100,a=Math.max(c,.01);let p,u;u=(2-i)*c;const l=(2-i)*a;return p=i*a,p/=l<=1?l:2-l,p=p||0,u/=2,[o,p*100,u*100]},s.hwb.rgb=function(n){const o=n[0]/360;let i=n[1]/100,c=n[2]/100;const a=i+c;let p;a>1&&(i/=a,c/=a);const u=Math.floor(6*o),l=1-c;p=6*o-u,u&1&&(p=1-p);const f=i+p*(l-i);let d,m,h;switch(u){default:case 6:case 0:d=l,m=f,h=i;break;case 1:d=f,m=l,h=i;break;case 2:d=i,m=l,h=f;break;case 3:d=i,m=f,h=l;break;case 4:d=f,m=i,h=l;break;case 5:d=l,m=i,h=f;break}return[d*255,m*255,h*255]},s.cmyk.rgb=function(n){const o=n[0]/100,i=n[1]/100,c=n[2]/100,a=n[3]/100,p=1-Math.min(1,o*(1-a)+a),u=1-Math.min(1,i*(1-a)+a),l=1-Math.min(1,c*(1-a)+a);return[p*255,u*255,l*255]},s.xyz.rgb=function(n){const o=n[0]/100,i=n[1]/100,c=n[2]/100;let a,p,u;return a=o*3.2406+i*-1.5372+c*-.4986,p=o*-.9689+i*1.8758+c*.0415,u=o*.0557+i*-.204+c*1.057,a=a>.0031308?1.055*a**(1/2.4)-.055:a*12.92,p=p>.0031308?1.055*p**(1/2.4)-.055:p*12.92,u=u>.0031308?1.055*u**(1/2.4)-.055:u*12.92,a=Math.min(Math.max(0,a),1),p=Math.min(Math.max(0,p),1),u=Math.min(Math.max(0,u),1),[a*255,p*255,u*255]},s.xyz.lab=function(n){let o=n[0],i=n[1],c=n[2];o/=95.047,i/=100,c/=108.883,o=o>.008856?o**(1/3):7.787*o+16/116,i=i>.008856?i**(1/3):7.787*i+16/116,c=c>.008856?c**(1/3):7.787*c+16/116;const a=116*i-16,p=500*(o-i),u=200*(i-c);return[a,p,u]},s.lab.xyz=function(n){const o=n[0],i=n[1],c=n[2];let a,p,u;p=(o+16)/116,a=i/500+p,u=p-c/200;const l=p**3,f=a**3,d=u**3;return p=l>.008856?l:(p-16/116)/7.787,a=f>.008856?f:(a-16/116)/7.787,u=d>.008856?d:(u-16/116)/7.787,a*=95.047,p*=100,u*=108.883,[a,p,u]},s.lab.lch=function(n){const o=n[0],i=n[1],c=n[2];let a;a=Math.atan2(c,i)*360/2/Math.PI,a<0&&(a+=360);const u=Math.sqrt(i*i+c*c);return[o,u,a]},s.lch.lab=function(n){const o=n[0],i=n[1],a=n[2]/360*2*Math.PI,p=i*Math.cos(a),u=i*Math.sin(a);return[o,p,u]},s.rgb.ansi16=function(n,o=null){const[i,c,a]=n;let p=o===null?s.rgb.hsv(n)[2]:o;if(p=Math.round(p/50),p===0)return 30;let u=30+(Math.round(a/255)<<2|Math.round(c/255)<<1|Math.round(i/255));return p===2&&(u+=60),u},s.hsv.ansi16=function(n){return s.rgb.ansi16(s.hsv.rgb(n),n[2])},s.rgb.ansi256=function(n){const o=n[0],i=n[1],c=n[2];return o===i&&i===c?o<8?16:o>248?231:Math.round((o-8)/247*24)+232:16+36*Math.round(o/255*5)+6*Math.round(i/255*5)+Math.round(c/255*5)},s.ansi16.rgb=function(n){let o=n%10;if(o===0||o===7)return n>50&&(o+=3.5),o=o/10.5*255,[o,o,o];const i=(~~(n>50)+1)*.5,c=(o&1)*i*255,a=(o>>1&1)*i*255,p=(o>>2&1)*i*255;return[c,a,p]},s.ansi256.rgb=function(n){if(n>=232){const p=(n-232)*10+8;return[p,p,p]}n-=16;let o;const i=Math.floor(n/36)/5*255,c=Math.floor((o=n%36)/6)/5*255,a=o%6/5*255;return[i,c,a]},s.rgb.hex=function(n){const i=(((Math.round(n[0])&255)<<16)+((Math.round(n[1])&255)<<8)+(Math.round(n[2])&255)).toString(16).toUpperCase();return"000000".substring(i.length)+i},s.hex.rgb=function(n){const o=n.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);if(!o)return[0,0,0];let i=o[0];o[0].length===3&&(i=i.split("").map(l=>l+l).join(""));const c=parseInt(i,16),a=c>>16&255,p=c>>8&255,u=c&255;return[a,p,u]},s.rgb.hcg=function(n){const o=n[0]/255,i=n[1]/255,c=n[2]/255,a=Math.max(Math.max(o,i),c),p=Math.min(Math.min(o,i),c),u=a-p;let l,f;return u<1?l=p/(1-u):l=0,u<=0?f=0:a===o?f=(i-c)/u%6:a===i?f=2+(c-o)/u:f=4+(o-i)/u,f/=6,f%=1,[f*360,u*100,l*100]},s.hsl.hcg=function(n){const o=n[1]/100,i=n[2]/100,c=i<.5?2*o*i:2*o*(1-i);let a=0;return c<1&&(a=(i-.5*c)/(1-c)),[n[0],c*100,a*100]},s.hsv.hcg=function(n){const o=n[1]/100,i=n[2]/100,c=o*i;let a=0;return c<1&&(a=(i-c)/(1-c)),[n[0],c*100,a*100]},s.hcg.rgb=function(n){const o=n[0]/360,i=n[1]/100,c=n[2]/100;if(i===0)return[c*255,c*255,c*255];const a=[0,0,0],p=o%1*6,u=p%1,l=1-u;let f=0;switch(Math.floor(p)){case 0:a[0]=1,a[1]=u,a[2]=0;break;case 1:a[0]=l,a[1]=1,a[2]=0;break;case 2:a[0]=0,a[1]=1,a[2]=u;break;case 3:a[0]=0,a[1]=l,a[2]=1;break;case 4:a[0]=u,a[1]=0,a[2]=1;break;default:a[0]=1,a[1]=0,a[2]=l}return f=(1-i)*c,[(i*a[0]+f)*255,(i*a[1]+f)*255,(i*a[2]+f)*255]},s.hcg.hsv=function(n){const o=n[1]/100,i=n[2]/100,c=o+i*(1-o);let a=0;return c>0&&(a=o/c),[n[0],a*100,c*100]},s.hcg.hsl=function(n){const o=n[1]/100,c=n[2]/100*(1-o)+.5*o;let a=0;return c>0&&c<.5?a=o/(2*c):c>=.5&&c<1&&(a=o/(2*(1-c))),[n[0],a*100,c*100]},s.hcg.hwb=function(n){const o=n[1]/100,i=n[2]/100,c=o+i*(1-o);return[n[0],(c-o)*100,(1-c)*100]},s.hwb.hcg=function(n){const o=n[1]/100,c=1-n[2]/100,a=c-o;let p=0;return a<1&&(p=(c-a)/(1-a)),[n[0],a*100,p*100]},s.apple.rgb=function(n){return[n[0]/65535*255,n[1]/65535*255,n[2]/65535*255]},s.rgb.apple=function(n){return[n[0]/255*65535,n[1]/255*65535,n[2]/255*65535]},s.gray.rgb=function(n){return[n[0]/100*255,n[0]/100*255,n[0]/100*255]},s.gray.hsl=function(n){return[0,0,n[0]]},s.gray.hsv=s.gray.hsl,s.gray.hwb=function(n){return[0,100,n[0]]},s.gray.cmyk=function(n){return[0,0,0,n[0]]},s.gray.lab=function(n){return[n[0],0,0]},s.gray.hex=function(n){const o=Math.round(n[0]/100*255)&255,c=((o<<16)+(o<<8)+o).toString(16).toUpperCase();return"000000".substring(c.length)+c},s.rgb.gray=function(n){return[(n[0]+n[1]+n[2])/3/255*100]},Oe}var we,lt;function Un(){if(lt)return we;lt=1;const e=ct();function t(){const o={},i=Object.keys(e);for(let c=i.length,a=0;a<c;a++)o[i[a]]={distance:-1,parent:null};return o}function s(o){const i=t(),c=[o];for(i[o].distance=0;c.length;){const a=c.pop(),p=Object.keys(e[a]);for(let u=p.length,l=0;l<u;l++){const f=p[l],d=i[f];d.distance===-1&&(d.distance=i[a].distance+1,d.parent=a,c.unshift(f))}}return i}function r(o,i){return function(c){return i(o(c))}}function n(o,i){const c=[i[o].parent,o];let a=e[i[o].parent][o],p=i[o].parent;for(;i[p].parent;)c.unshift(i[p].parent),a=r(e[i[p].parent][p],a),p=i[p].parent;return a.conversion=c,a}return we=function(o){const i=s(o),c={},a=Object.keys(i);for(let p=a.length,u=0;u<p;u++){const l=a[u];i[l].parent!==null&&(c[l]=n(l,i))}return c},we}var ve,pt;function Xn(){if(pt)return ve;pt=1;const e=ct(),t=Un(),s={},r=Object.keys(e);function n(i){const c=function(...a){const p=a[0];return p==null?p:(p.length>1&&(a=p),i(a))};return"conversion"in i&&(c.conversion=i.conversion),c}function o(i){const c=function(...a){const p=a[0];if(p==null)return p;p.length>1&&(a=p);const u=i(a);if(typeof u=="object")for(let l=u.length,f=0;f<l;f++)u[f]=Math.round(u[f]);return u};return"conversion"in i&&(c.conversion=i.conversion),c}return r.forEach(i=>{s[i]={},Object.defineProperty(s[i],"channels",{value:e[i].channels}),Object.defineProperty(s[i],"labels",{value:e[i].labels});const c=t(i);Object.keys(c).forEach(p=>{const u=c[p];s[i][p]=o(u),s[i][p].raw=n(u)})}),ve=s,ve}Ee.exports,function(e){const t=(u,l)=>(...f)=>`\x1B[${u(...f)+l}m`,s=(u,l)=>(...f)=>{const d=u(...f);return`\x1B[${38+l};5;${d}m`},r=(u,l)=>(...f)=>{const d=u(...f);return`\x1B[${38+l};2;${d[0]};${d[1]};${d[2]}m`},n=u=>u,o=(u,l,f)=>[u,l,f],i=(u,l,f)=>{Object.defineProperty(u,l,{get:()=>{const d=f();return Object.defineProperty(u,l,{value:d,enumerable:!0,configurable:!0}),d},enumerable:!0,configurable:!0})};let c;const a=(u,l,f,d)=>{c===void 0&&(c=Xn());const m=d?10:0,h={};for(const[g,y]of Object.entries(c)){const $=g==="ansi16"?"ansi":g;g===l?h[$]=u(f,m):typeof y=="object"&&(h[$]=u(y[l],m))}return h};function p(){const u=new Map,l={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}};l.color.gray=l.color.blackBright,l.bgColor.bgGray=l.bgColor.bgBlackBright,l.color.grey=l.color.blackBright,l.bgColor.bgGrey=l.bgColor.bgBlackBright;for(const[f,d]of Object.entries(l)){for(const[m,h]of Object.entries(d))l[m]={open:`\x1B[${h[0]}m`,close:`\x1B[${h[1]}m`},d[m]=l[m],u.set(h[0],h[1]);Object.defineProperty(l,f,{value:d,enumerable:!1})}return Object.defineProperty(l,"codes",{value:u,enumerable:!1}),l.color.close="\x1B[39m",l.bgColor.close="\x1B[49m",i(l.color,"ansi",()=>a(t,"ansi16",n,!1)),i(l.color,"ansi256",()=>a(s,"ansi256",n,!1)),i(l.color,"ansi16m",()=>a(r,"rgb",o,!1)),i(l.bgColor,"ansi",()=>a(t,"ansi16",n,!0)),i(l.bgColor,"ansi256",()=>a(s,"ansi256",n,!0)),i(l.bgColor,"ansi16m",()=>a(r,"rgb",o,!0)),l}Object.defineProperty(e,"exports",{enumerable:!0,get:p})}(Ee);var zn=Ee.exports,qn=(e,t=process.argv)=>{const s=e.startsWith("-")?"":e.length===1?"-":"--",r=t.indexOf(s+e),n=t.indexOf("--");return r!==-1&&(n===-1||r<n)};const Kn=In,ut=Je,x=qn,{env:w}=process;let B;x("no-color")||x("no-colors")||x("color=false")||x("color=never")?B=0:(x("color")||x("colors")||x("color=true")||x("color=always"))&&(B=1),"FORCE_COLOR"in w&&(w.FORCE_COLOR==="true"?B=1:w.FORCE_COLOR==="false"?B=0:B=w.FORCE_COLOR.length===0?1:Math.min(parseInt(w.FORCE_COLOR,10),3));function $e(e){return e===0?!1:{level:e,hasBasic:!0,has256:e>=2,has16m:e>=3}}function Te(e,t){if(B===0)return 0;if(x("color=16m")||x("color=full")||x("color=truecolor"))return 3;if(x("color=256"))return 2;if(e&&!t&&B===void 0)return 0;const s=B||0;if(w.TERM==="dumb")return s;if(process.platform==="win32"){const r=Kn.release().split(".");return Number(r[0])>=10&&Number(r[2])>=10586?Number(r[2])>=14931?3:2:1}if("CI"in w)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE"].some(r=>r in w)||w.CI_NAME==="codeship"?1:s;if("TEAMCITY_VERSION"in w)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(w.TEAMCITY_VERSION)?1:0;if(w.COLORTERM==="truecolor")return 3;if("TERM_PROGRAM"in w){const r=parseInt((w.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(w.TERM_PROGRAM){case"iTerm.app":return r>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(w.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(w.TERM)||"COLORTERM"in w?1:s}function Hn(e){const t=Te(e,e&&e.isTTY);return $e(t)}var ft={supportsColor:Hn,stdout:$e(Te(!0,ut.isatty(1))),stderr:$e(Te(!0,ut.isatty(2)))};const Vn=(e,t,s)=>{let r=e.indexOf(t);if(r===-1)return e;const n=t.length;let o=0,i="";do i+=e.substr(o,r-o)+t+s,o=r+n,r=e.indexOf(t,o);while(r!==-1);return i+=e.substr(o),i},Jn=(e,t,s,r)=>{let n=0,o="";do{const i=e[r-1]==="\r";o+=e.substr(n,(i?r-1:r)-n)+t+(i?`\r
3
+ `:`
4
+ `)+s,n=r+1,r=e.indexOf(`
5
+ `,n)}while(r!==-1);return o+=e.substr(n),o};var Wn={stringReplaceAll:Vn,stringEncaseCRLFWithFirstIndex:Jn},je,dt;function Yn(){if(dt)return je;dt=1;const e=/(?:\\(u(?:[a-f\d]{4}|\{[a-f\d]{1,6}\})|x[a-f\d]{2}|.))|(?:\{(~)?(\w+(?:\([^)]*\))?(?:\.\w+(?:\([^)]*\))?)*)(?:[ \t]|(?=\r?\n)))|(\})|((?:.|[\r\n\f])+?)/gi,t=/(?:^|\.)(\w+)(?:\(([^)]*)\))?/g,s=/^(['"])((?:\\.|(?!\1)[^\\])*)\1$/,r=/\\(u(?:[a-f\d]{4}|{[a-f\d]{1,6}})|x[a-f\d]{2}|.)|([^\\])/gi,n=new Map([["n",`
6
+ `],["r","\r"],["t"," "],["b","\b"],["f","\f"],["v","\v"],["0","\0"],["\\","\\"],["e","\x1B"],["a","\x07"]]);function o(p){const u=p[0]==="u",l=p[1]==="{";return u&&!l&&p.length===5||p[0]==="x"&&p.length===3?String.fromCharCode(parseInt(p.slice(1),16)):u&&l?String.fromCodePoint(parseInt(p.slice(2,-1),16)):n.get(p)||p}function i(p,u){const l=[],f=u.trim().split(/\s*,\s*/g);let d;for(const m of f){const h=Number(m);if(!Number.isNaN(h))l.push(h);else if(d=m.match(s))l.push(d[2].replace(r,(g,y,$)=>y?o(y):$));else throw new Error(`Invalid Chalk template style argument: ${m} (in style '${p}')`)}return l}function c(p){t.lastIndex=0;const u=[];let l;for(;(l=t.exec(p))!==null;){const f=l[1];if(l[2]){const d=i(f,l[2]);u.push([f].concat(d))}else u.push([f])}return u}function a(p,u){const l={};for(const d of u)for(const m of d.styles)l[m[0]]=d.inverse?null:m.slice(1);let f=p;for(const[d,m]of Object.entries(l))if(Array.isArray(m)){if(!(d in f))throw new Error(`Unknown Chalk style: ${d}`);f=m.length>0?f[d](...m):f[d]}return f}return je=(p,u)=>{const l=[],f=[];let d=[];if(u.replace(e,(m,h,g,y,$,R)=>{if(h)d.push(o(h));else if(y){const M=d.join("");d=[],f.push(l.length===0?M:a(p,l)(M)),l.push({inverse:g,styles:c(y)})}else if($){if(l.length===0)throw new Error("Found extraneous } in Chalk template literal");f.push(a(p,l)(d.join(""))),d=[],l.pop()}else d.push(R)}),f.push(d.join("")),l.length>0){const m=`Chalk template literal is missing ${l.length} closing bracket${l.length===1?"":"s"} (\`}\`)`;throw new Error(m)}return f.join("")},je}const J=zn,{stdout:Ae,stderr:Se}=ft,{stringReplaceAll:Zn,stringEncaseCRLFWithFirstIndex:Qn}=Wn,{isArray:re}=Array,mt=["ansi","ansi","ansi256","ansi16m"],q=Object.create(null),es=(e,t={})=>{if(t.level&&!(Number.isInteger(t.level)&&t.level>=0&&t.level<=3))throw new Error("The `level` option should be an integer from 0 to 3");const s=Ae?Ae.level:0;e.level=t.level===void 0?s:t.level};class ts{constructor(t){return ht(t)}}const ht=e=>{const t={};return es(t,e),t.template=(...s)=>bt(t.template,...s),Object.setPrototypeOf(t,ie.prototype),Object.setPrototypeOf(t.template,t),t.template.constructor=()=>{throw new Error("`chalk.constructor()` is deprecated. Use `new chalk.Instance()` instead.")},t.template.Instance=ts,t.template};function ie(e){return ht(e)}for(const[e,t]of Object.entries(J))q[e]={get(){const s=ae(this,Ne(t.open,t.close,this._styler),this._isEmpty);return Object.defineProperty(this,e,{value:s}),s}};q.visible={get(){const e=ae(this,this._styler,!0);return Object.defineProperty(this,"visible",{value:e}),e}};const yt=["rgb","hex","keyword","hsl","hsv","hwb","ansi","ansi256"];for(const e of yt)q[e]={get(){const{level:t}=this;return function(...s){const r=Ne(J.color[mt[t]][e](...s),J.color.close,this._styler);return ae(this,r,this._isEmpty)}}};for(const e of yt){const t="bg"+e[0].toUpperCase()+e.slice(1);q[t]={get(){const{level:s}=this;return function(...r){const n=Ne(J.bgColor[mt[s]][e](...r),J.bgColor.close,this._styler);return ae(this,n,this._isEmpty)}}}}const ns=Object.defineProperties(()=>{},{...q,level:{enumerable:!0,get(){return this._generator.level},set(e){this._generator.level=e}}}),Ne=(e,t,s)=>{let r,n;return s===void 0?(r=e,n=t):(r=s.openAll+e,n=t+s.closeAll),{open:e,close:t,openAll:r,closeAll:n,parent:s}},ae=(e,t,s)=>{const r=(...n)=>re(n[0])&&re(n[0].raw)?gt(r,bt(r,...n)):gt(r,n.length===1?""+n[0]:n.join(" "));return Object.setPrototypeOf(r,ns),r._generator=e,r._styler=t,r._isEmpty=s,r},gt=(e,t)=>{if(e.level<=0||!t)return e._isEmpty?"":t;let s=e._styler;if(s===void 0)return t;const{openAll:r,closeAll:n}=s;if(t.indexOf("\x1B")!==-1)for(;s!==void 0;)t=Zn(t,s.close,s.open),s=s.parent;const o=t.indexOf(`
7
+ `);return o!==-1&&(t=Qn(t,n,r,o)),r+t+n};let ke;const bt=(e,...t)=>{const[s]=t;if(!re(s)||!re(s.raw))return t.join(" ");const r=t.slice(1),n=[s.raw[0]];for(let o=1;o<s.length;o++)n.push(String(r[o-1]).replace(/[{}\\]/g,"\\$&"),String(s.raw[o]));return ke===void 0&&(ke=Yn()),ke(e,n.join(""))};Object.defineProperties(ie.prototype,q);const ce=ie();ce.supportsColor=Ae,ce.stderr=ie({level:Se?Se.level:0}),ce.stderr.supportsColor=Se;var ss=ce;const le=rt(ss);var xe={exports:{}},pe={exports:{}},Ie,Et;function os(){if(Et)return Ie;Et=1;var e=1e3,t=e*60,s=t*60,r=s*24,n=r*7,o=r*365.25;Ie=function(u,l){l=l||{};var f=typeof u;if(f==="string"&&u.length>0)return i(u);if(f==="number"&&isFinite(u))return l.long?a(u):c(u);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(u))};function i(u){if(u=String(u),!(u.length>100)){var l=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(u);if(l){var f=parseFloat(l[1]),d=(l[2]||"ms").toLowerCase();switch(d){case"years":case"year":case"yrs":case"yr":case"y":return f*o;case"weeks":case"week":case"w":return f*n;case"days":case"day":case"d":return f*r;case"hours":case"hour":case"hrs":case"hr":case"h":return f*s;case"minutes":case"minute":case"mins":case"min":case"m":return f*t;case"seconds":case"second":case"secs":case"sec":case"s":return f*e;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return f;default:return}}}}function c(u){var l=Math.abs(u);return l>=r?Math.round(u/r)+"d":l>=s?Math.round(u/s)+"h":l>=t?Math.round(u/t)+"m":l>=e?Math.round(u/e)+"s":u+"ms"}function a(u){var l=Math.abs(u);return l>=r?p(u,l,r,"day"):l>=s?p(u,l,s,"hour"):l>=t?p(u,l,t,"minute"):l>=e?p(u,l,e,"second"):u+" ms"}function p(u,l,f,d){var m=l>=f*1.5;return Math.round(u/f)+" "+d+(m?"s":"")}return Ie}var Fe,Ct;function Ot(){if(Ct)return Fe;Ct=1;function e(t){r.debug=r,r.default=r,r.coerce=p,r.disable=i,r.enable=o,r.enabled=c,r.humanize=os(),r.destroy=u,Object.keys(t).forEach(l=>{r[l]=t[l]}),r.names=[],r.skips=[],r.formatters={};function s(l){let f=0;for(let d=0;d<l.length;d++)f=(f<<5)-f+l.charCodeAt(d),f|=0;return r.colors[Math.abs(f)%r.colors.length]}r.selectColor=s;function r(l){let f,d=null,m,h;function g(...y){if(!g.enabled)return;const $=g,R=Number(new Date),M=R-(f||R);$.diff=M,$.prev=f,$.curr=R,f=R,y[0]=r.coerce(y[0]),typeof y[0]!="string"&&y.unshift("%O");let U=0;y[0]=y[0].replace(/%([a-zA-Z%])/g,(Y,gn)=>{if(Y==="%%")return"%";U++;const Pe=r.formatters[gn];if(typeof Pe=="function"){const bn=y[U];Y=Pe.call($,bn),y.splice(U,1),U--}return Y}),r.formatArgs.call($,y),($.log||r.log).apply($,y)}return g.namespace=l,g.useColors=r.useColors(),g.color=r.selectColor(l),g.extend=n,g.destroy=r.destroy,Object.defineProperty(g,"enabled",{enumerable:!0,configurable:!1,get:()=>d!==null?d:(m!==r.namespaces&&(m=r.namespaces,h=r.enabled(l)),h),set:y=>{d=y}}),typeof r.init=="function"&&r.init(g),g}function n(l,f){const d=r(this.namespace+(typeof f>"u"?":":f)+l);return d.log=this.log,d}function o(l){r.save(l),r.namespaces=l,r.names=[],r.skips=[];let f;const d=(typeof l=="string"?l:"").split(/[\s,]+/),m=d.length;for(f=0;f<m;f++)d[f]&&(l=d[f].replace(/\*/g,".*?"),l[0]==="-"?r.skips.push(new RegExp("^"+l.slice(1)+"$")):r.names.push(new RegExp("^"+l+"$")))}function i(){const l=[...r.names.map(a),...r.skips.map(a).map(f=>"-"+f)].join(",");return r.enable(""),l}function c(l){if(l[l.length-1]==="*")return!0;let f,d;for(f=0,d=r.skips.length;f<d;f++)if(r.skips[f].test(l))return!1;for(f=0,d=r.names.length;f<d;f++)if(r.names[f].test(l))return!0;return!1}function a(l){return l.toString().substring(2,l.toString().length-2).replace(/\.\*\?$/,"*")}function p(l){return l instanceof Error?l.stack||l.message:l}function u(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return r.enable(r.load()),r}return Fe=e,Fe}var wt;function rs(){return wt||(wt=1,function(e,t){t.formatArgs=r,t.save=n,t.load=o,t.useColors=s,t.storage=i(),t.destroy=(()=>{let a=!1;return()=>{a||(a=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),t.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function s(){if(typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs))return!0;if(typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;let a;return typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&(a=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(a[1],10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function r(a){if(a[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+a[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff),!this.useColors)return;const p="color: "+this.color;a.splice(1,0,p,"color: inherit");let u=0,l=0;a[0].replace(/%[a-zA-Z%]/g,f=>{f!=="%%"&&(u++,f==="%c"&&(l=u))}),a.splice(l,0,p)}t.log=console.debug||console.log||(()=>{});function n(a){try{a?t.storage.setItem("debug",a):t.storage.removeItem("debug")}catch{}}function o(){let a;try{a=t.storage.getItem("debug")}catch{}return!a&&typeof process<"u"&&"env"in process&&(a=process.env.DEBUG),a}function i(){try{return localStorage}catch{}}e.exports=Ot()(t);const{formatters:c}=e.exports;c.j=function(a){try{return JSON.stringify(a)}catch(p){return"[UnexpectedJSONParseError]: "+p.message}}}(pe,pe.exports)),pe.exports}var ue={exports:{}},vt;function is(){return vt||(vt=1,function(e,t){const s=Je,r=Fn;t.init=u,t.log=c,t.formatArgs=o,t.save=a,t.load=p,t.useColors=n,t.destroy=r.deprecate(()=>{},"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."),t.colors=[6,2,3,4,5,1];try{const f=ft;f&&(f.stderr||f).level>=2&&(t.colors=[20,21,26,27,32,33,38,39,40,41,42,43,44,45,56,57,62,63,68,69,74,75,76,77,78,79,80,81,92,93,98,99,112,113,128,129,134,135,148,149,160,161,162,163,164,165,166,167,168,169,170,171,172,173,178,179,184,185,196,197,198,199,200,201,202,203,204,205,206,207,208,209,214,215,220,221])}catch{}t.inspectOpts=Object.keys(process.env).filter(f=>/^debug_/i.test(f)).reduce((f,d)=>{const m=d.substring(6).toLowerCase().replace(/_([a-z])/g,(g,y)=>y.toUpperCase());let h=process.env[d];return/^(yes|on|true|enabled)$/i.test(h)?h=!0:/^(no|off|false|disabled)$/i.test(h)?h=!1:h==="null"?h=null:h=Number(h),f[m]=h,f},{});function n(){return"colors"in t.inspectOpts?!!t.inspectOpts.colors:s.isatty(process.stderr.fd)}function o(f){const{namespace:d,useColors:m}=this;if(m){const h=this.color,g="\x1B[3"+(h<8?h:"8;5;"+h),y=` ${g};1m${d} \x1B[0m`;f[0]=y+f[0].split(`
8
+ `).join(`
9
+ `+y),f.push(g+"m+"+e.exports.humanize(this.diff)+"\x1B[0m")}else f[0]=i()+d+" "+f[0]}function i(){return t.inspectOpts.hideDate?"":new Date().toISOString()+" "}function c(...f){return process.stderr.write(r.formatWithOptions(t.inspectOpts,...f)+`
10
+ `)}function a(f){f?process.env.DEBUG=f:delete process.env.DEBUG}function p(){return process.env.DEBUG}function u(f){f.inspectOpts={};const d=Object.keys(t.inspectOpts);for(let m=0;m<d.length;m++)f.inspectOpts[d[m]]=t.inspectOpts[d[m]]}e.exports=Ot()(t);const{formatters:l}=e.exports;l.o=function(f){return this.inspectOpts.colors=this.useColors,r.inspect(f,this.inspectOpts).split(`
11
+ `).map(d=>d.trim()).join(" ")},l.O=function(f){return this.inspectOpts.colors=this.useColors,r.inspect(f,this.inspectOpts)}}(ue,ue.exports)),ue.exports}typeof process>"u"||process.type==="renderer"||process.browser===!0||process.__nwjs?xe.exports=rs():xe.exports=is();var as=xe.exports;const cs=rt(as),ls=e=>typeof e=="function",ps=e=>Object.prototype.toString.call(e)==="[object RegExp]";function $t(e,t){let s=[];try{de.existsSync(e)&&(de.lstatSync(e).isDirectory()?de.readdirSync(e).forEach(function(o){const i=$t(te.join(e,"/",o),t);s=s.concat(i)}):t!==void 0||s.push(e))}catch(r){throw r}return s}const Le=cs.debug("vite-plugin-compression"),us=/\.(js|mjs|json|css|html)$/i,Tt=new Map;function fs(e={}){let t,s;const r={name:"vite:compression"},{disable:n=!1,filter:o=us,verbose:i=!0,threshold:c=1025,compressionOptions:a={},deleteOriginFile:p=!1,success:u=()=>{}}=e;let{ext:l=""}=e;const{algorithm:f="gzip"}=e;return f==="gzip"&&!l&&(l=".gz"),f==="brotliCompress"&&!l&&(l=".br"),n?r:(Le("plugin options:",e),{...r,apply:"build",enforce:"post",configResolved(d){s=d,t=te.isAbsolute(s.build.outDir)?s.build.outDir:te.join(s.root,s.build.outDir),Le("resolvedConfig:",d)},async closeBundle(){let d=$t(t)||[];if(Le("files:",d),!d.length)return;d=ds(d,o);const m=ms(f,a),h=new Map,g=d.map(async y=>{const{mtimeMs:$,size:R}=await se.stat(y);if($<=(Tt.get(y)||0)||R<c)return;let M=await se.readFile(y);p&&se.remove(y);try{M=await hs(M,f,m)}catch{s.logger.error("compress error:"+y)}const U=M.byteLength,fe=ys(y,l);h.set(y,{size:U/1024,oldSize:R/1024,cname:fe}),await se.writeFile(fe,M),Tt.set(y,Date.now())});return Promise.all(g).then(()=>{i&&(gs(s,h,f),u())})}})}function ds(e,t){if(t){const s=ps(t),r=ls(t);e=e.filter(n=>s?t.test(n):r?t(n):!0)}return e}function ms(e="",t={}){return{...{gzip:{level:G.constants.Z_BEST_COMPRESSION},deflate:{level:G.constants.Z_BEST_COMPRESSION},deflateRaw:{level:G.constants.Z_BEST_COMPRESSION},brotliCompress:{params:{[G.constants.BROTLI_PARAM_QUALITY]:G.constants.BROTLI_MAX_QUALITY,[G.constants.BROTLI_PARAM_MODE]:G.constants.BROTLI_MODE_TEXT}}}[e],...t}}function hs(e,t,s={}){return new Promise((r,n)=>{G[t](e,s,(o,i)=>o?n(o):r(i))})}function ys(e,t){const s=t.startsWith(".")?t:`.${t}`;return`${e}${s}`}function gs(e,t,s){e.logger.info(`
12
+ ${le.cyan("\u2728 [vite-plugin-compression]:algorithm="+s)} - compressed file successfully: `);const r=Array.from(t.keys(),o=>o.length),n=Math.max(...r);t.forEach((o,i)=>{const{size:c,oldSize:a,cname:p}=o,u=ze(p).replace(ze(`${e.build.outDir}/`),""),l=`${a.toFixed(2)}kb / ${s}: ${c.toFixed(2)}kb`;e.logger.info(le.dim(te.basename(e.build.outDir)+"/")+le.blueBright(u)+" ".repeat(2+n-i.length)+" "+le.dim(l))}),e.logger.info(`
13
+ `)}const bs=()=>fs({ext:".gz",algorithm:"gzip",deleteOriginFile:!0}),jt=()=>{const e=process.env.npm_lifecycle_event;return Ln({typescript:!0,vueTsc:!1,eslint:{lintCommand:`eslint --max-warnings=0 "./sections/**/*.{js,ts,vue}" --cache --cache-location "./build/eslintcache/${e}.json"`}})},Es={[I.Server]:[Ve(),me(),bs()],[I.Client]:[Ve(),me(),jt(),xn({vue:"EcVue"})],[I.Misc]:[me(),jt()]},v={SECTION:{source:"sections",dist:"dist/sections"},HEADER:{source:"headers",dist:"dist/headers"},FOOTER:{source:"footers",dist:"dist/footers"}};function Cs(e){return L(`${he}/${e}`)?"HEADER":L(`${ye}/${e}`)?"FOOTER":"SECTION"}const At={"process.env":{NODE_ENV:"production"}},Os=[...He,...He.map(e=>`node:${e}`)],ws=[/@vue\/compiler-dom/,/@vue\/runtime-dom/,/@vue\/server-renderer/,/@vue\/compiler-ssr/,/@vue\/shared/],_={[j.Server]:{pluginType:I.Server,define:At,ssr:!0,ssrOptions:{noExternal:!0},outDir:(e,t)=>`./${v[t].dist}/${e}/js/main/server`,externalOption:[...Os],entryFileNames:"server.js",inlineDynamicImports:!0},[j.Client]:{pluginType:I.Client,define:At,ssr:!1,outDir:(e,t)=>`./${v[t].dist}/${e}/js/main/client`,entryFileNames:"client.js",assetFileNames:"assets/[name].[ext]",inlineDynamicImports:!0},[j.SectionSetting]:{pluginType:I.Misc,ssr:!1,outDir:(e,t)=>`./${v[t].dist}/${e}/js/settings`,entryFileNames:"[name].mjs"},[j.SectionShowcase]:{pluginType:I.Misc,ssr:!1,outDir:(e,t)=>`./${v[t].dist}/${e}/js/showcases`,entryFileNames:"[name].mjs"},[j.SectionAsset]:{pluginType:I.Misc,ssr:!1,outDir:(e,t)=>`./${v[t].dist}/${e}/assets`,assetFileNames:"[name].[ext]"},[j.TemplateDescriptor]:{pluginType:I.Misc,ssr:!1,outDir:()=>`./${z}/js`,entryFileNames:`[name]${X}.mjs`},[j.TemplateAsset]:{pluginType:I.Misc,ssr:!1,outDir:()=>`./${z}/assets`,assetFileNames:"[name].[ext]"}};function vs(e){switch(typeof e){case"string":return[C(process.cwd(),e)];case"object":return e.map(t=>C(process.cwd(),t));default:return[]}}function $s(e,t){const{externalOption:s}=_[e];return t?.externalizeVue&&e===j.Server?[...s??[],...ws]:s}function St(e,t,s,r,n){const o=_[s].define,i=_[s].ssrOptions,c=_[s].entryFileNames,a=_[s].chunkFileNames,p=_[s].assetFileNames,u=_[s].inlineDynamicImports,l=$s(s,n);return{plugins:Es[_[s].pluginType],...o!=null&&{define:o},...i!=null&&{ssr:i},resolve:{alias:{"@":"/src"}},build:{ssr:_[s].ssr,outDir:_[s].outDir(e,r),emptyOutDir:!0,minify:"terser",terserOptions:{compress:{drop_console:!1}},rollupOptions:{...l!=null&&{external:l},preserveEntrySignatures:"strict",input:vs(t),output:{validate:!0,inlineDynamicImports:u,...c!=null&&{entryFileNames:c},...a!=null&&{chunkFileNames:a},...p!=null&&{assetFileNames:p}}}}}}const Nt="https://json-schema.org/draft/2020-12/schema",kt="https://lightspeedhq.com/template.schema.json",xt="Custom Template",It="A custom template enclosing the necessary custom and default blocks",Ft="object",Lt={metadata:{type:"object",properties:{name:{description:"Name of the template",type:"string",minLength:2,maxLength:60},description:{description:"Short description of the template",type:"string",minLength:2,maxLength:150},preview_url:{description:"Preview url of the demo website",type:"string",format:"uri",pattern:"^(https?)://([^.]+?\\.)company\\.site($|/[A-Za-z0-9\\-._~:/?#\\[\\]@!$&'()*+,;=]*)?$"},cover_image:{type:"object",properties:{set:{description:"Name of the image set",type:"object",patternProperties:{".*":{type:"object",properties:{url:{description:"Path to the preview image relative to the 'assets' folder for a specific resolution",type:"string"}},required:["url"],additionalProperties:!1}}}},required:["set"],additionalProperties:!1}},required:["name","description","cover_image"],additionalProperties:!1},sections:{description:"List of sections contained by this template",type:"array",items:{type:"object",properties:{type:{description:"Type of the section",type:"string",enum:["custom","default"]}},allOf:[{if:{properties:{type:{const:"default"}}},then:{$ref:"template-default.schema.json#/$defs/default-section"}},{if:{properties:{type:{const:"custom"}}},then:{$ref:"template-custom.schema.json#/$defs/custom-section"}}]},minItems:1,uniqueItems:!1}},_t=["metadata","sections"],Ts={$schema:Nt,$id:kt,title:xt,description:It,type:Ft,properties:Lt,required:_t},Rt={__proto__:null,$id:kt,$schema:Nt,default:Ts,description:It,properties:Lt,required:_t,title:xt,type:Ft},Mt="https://json-schema.org/draft/2020-12/schema",Dt="https://lightspeedhq.com/template-default.schema.json",Gt="Default Section",Bt="Default section for a Custom Template",Pt="object",Ut={"default-section":{type:"object",properties:{type:{description:"Type of the section",type:"string",enum:["custom","default"]},id:{description:"Identification of the section",type:"string",pattern:"^((header|cover|announcement_bar|slider|special_offer|customer_review|company_info|shipping_payment|location|store|footer)(_\\d{3})?)$"}},required:["type","id"],additionalProperties:!1}},js={$schema:Mt,$id:Dt,title:Gt,description:Bt,type:Pt,$defs:Ut},As={__proto__:null,$defs:Ut,$id:Dt,$schema:Mt,default:js,description:Bt,title:Gt,type:Pt},Xt="https://json-schema.org/draft/2020-12/schema",zt="https://lightspeedhq.com/template-custom.schema.json",qt="Custom Section",Kt="Custom section for a Custom Template",Ht="object",Vt={"custom-section":{type:"object",properties:{type:{description:"Type of the section",type:"string",enum:["custom","default"]},id:{description:"Identification of the section",type:"string"},showcase_id:{description:"Showcase id of the section",type:"string"},showcase_overrides:{type:"object",description:"Overrides for the showcase",properties:{content:{type:"object",patternProperties:{".*":{type:"object",properties:{type:{description:"Type of the content configuration element",type:"string",enum:["INPUTBOX","TEXTAREA","BUTTON","IMAGE","TOGGLE","SELECTBOX","LOGO","DECK"]}},allOf:[{if:{properties:{type:{const:"INPUTBOX"}}},then:{$ref:"template-custom-content.schema.json#/$defs/input_box"}},{if:{properties:{type:{const:"TEXTAREA"}}},then:{$ref:"template-custom-content.schema.json#/$defs/text_area"}},{if:{properties:{type:{const:"BUTTON"}}},then:{$ref:"template-custom-content.schema.json#/$defs/button"}},{if:{properties:{type:{const:"IMAGE"}}},then:{$ref:"template-custom-content.schema.json#/$defs/image"}},{if:{properties:{type:{const:"TOGGLE"}}},then:{$ref:"template-custom-content.schema.json#/$defs/toggle"}},{if:{properties:{type:{const:"SELECTBOX"}}},then:{$ref:"template-custom-content.schema.json#/$defs/select_box"}},{if:{properties:{type:{const:"LOGO"}}},then:{$ref:"template-custom-content.schema.json#/$defs/logo"}},{if:{properties:{type:{const:"DECK"}}},then:{$ref:"template-custom-content.schema.json#/$defs/deck"}}]}},minProperties:1},design:{type:"object",patternProperties:{".*":{type:"object",properties:{type:{description:"Type of the design configuration element",type:"string",enum:["TEXT","BUTTON","IMAGE","TOGGLE","SELECTBOX","BACKGROUND","LOGO"]}},allOf:[{if:{properties:{type:{const:"TEXT"}}},then:{$ref:"template-custom-design.schema.json#/$defs/text"}},{if:{properties:{type:{const:"BUTTON"}}},then:{$ref:"template-custom-design.schema.json#/$defs/button"}},{if:{properties:{type:{const:"IMAGE"}}},then:{$ref:"template-custom-design.schema.json#/$defs/image"}},{if:{properties:{type:{const:"TOGGLE"}}},then:{$ref:"template-custom-design.schema.json#/$defs/toggle"}},{if:{properties:{type:{const:"SELECTBOX"}}},then:{$ref:"template-custom-design.schema.json#/$defs/select_box"}},{if:{properties:{type:{const:"BACKGROUND"}}},then:{$ref:"template-custom-design.schema.json#/$defs/background"}},{if:{properties:{type:{const:"LOGO"}}},then:{$ref:"template-custom-design.schema.json#/$defs/logo"}}]}},minProperties:1},layoutId:{description:"Layout ID for the showcase",type:"string"},blockName:{description:"Section name for the showcase",type:"string"}},required:["content","design"]}},required:["type","id"],additionalProperties:!1}},Ss={$schema:Xt,$id:zt,title:qt,description:Kt,type:Ht,$defs:Vt},Ns={__proto__:null,$defs:Vt,$id:zt,$schema:Xt,default:Ss,description:Kt,title:qt,type:Ht},Jt="https://json-schema.org/draft/2020-12/schema",Wt="https://lightspeedhq.com/template-custom-content.schema.json",Yt="Custom Section :: Content Configuration",Zt="Content tab configuration of a Custom Section for a Custom Template",Qt="object",en={input_box:{type:"object",properties:{type:{description:"Type of the content configuration element",type:"string",enum:["INPUTBOX","TEXTAREA","BUTTON","IMAGE","TOGGLE","SELECTBOX","DECK","MENU","NAVIGATION_MENU","LOGO"]},text:{type:"string"}},required:["type","text"],additionalProperties:!1},text_area:{type:"object",properties:{type:{description:"Type of the content configuration element",type:"string",enum:["INPUTBOX","TEXTAREA","BUTTON","IMAGE","TOGGLE","SELECTBOX","DECK","MENU","NAVIGATION_MENU","LOGO"]},text:{type:"string"}},required:["type","text"],additionalProperties:!1},button:{type:"object",properties:{type:{description:"Type of the content configuration element",type:"string",enum:["INPUTBOX","TEXTAREA","BUTTON","IMAGE","TOGGLE","SELECTBOX","DECK","MENU","NAVIGATION_MENU","LOGO"]},title:{type:"string"},buttonType:{type:"string",enum:["SCROLL_TO_TILE","HYPER_LINK","MAIL_LINK","TEL_LINK","GO_TO_STORE_LINK","GO_TO_PAGE"]},link:{type:"string",format:"uri"},linkTarget:{type:"string"},email:{type:"string"},phone:{type:"string"},tileId:{type:"string"}},required:["type","title"],additionalProperties:!1},image:{type:"object",properties:{type:{description:"Type of the content configuration element",type:"string",enum:["INPUTBOX","TEXTAREA","BUTTON","IMAGE","TOGGLE","SELECTBOX","DECK","MENU","NAVIGATION_MENU","LOGO"]},imageData:{type:"object",properties:{set:{type:"object"},borderInfo:{type:"object"},bucket:{type:"string"}},required:["set"]}},required:["type"],additionalProperties:!1},toggle:{type:"object",properties:{type:{description:"Type of the content configuration element",type:"string",enum:["INPUTBOX","TEXTAREA","BUTTON","IMAGE","TOGGLE","SELECTBOX","DECK","MENU","NAVIGATION_MENU","LOGO"]},enabled:{type:"boolean"}},required:["type"],additionalProperties:!1},select_box:{type:"object",properties:{type:{description:"Type of the content configuration element",type:"string",enum:["INPUTBOX","TEXTAREA","BUTTON","IMAGE","TOGGLE","SELECTBOX","DECK","MENU","NAVIGATION_MENU","LOGO"]},value:{type:"string"}},required:["type"],additionalProperties:!1},logo:{type:"object",properties:{type:{description:"Type of the content configuration element",type:"string",enum:["INPUTBOX","TEXTAREA","BUTTON","IMAGE","TOGGLE","SELECTBOX","DECK","LOGO"]},logoType:{description:"Type of the logo content",type:"string",enum:["TEXT","IMAGE"]},text:{description:"Logo content text",type:"string"},imageData:{type:"object",properties:{set:{type:"object"},borderInfo:{type:"object"},bucket:{type:"string"}},required:["set"]}},required:["type"],additionalProperties:!1},menu:{type:"object",properties:{type:{description:"Type of the content configuration element",type:"string",enum:["INPUTBOX","TEXTAREA","BUTTON","IMAGE","TOGGLE","SELECTBOX","DECK","MENU","NAVIGATION_MENU","LOGO"]}},required:["type"],additionalProperties:!1},deck:{type:"object",properties:{type:{description:"Type of the content configuration element",type:"string",enum:["INPUTBOX","TEXTAREA","BUTTON","IMAGE","TOGGLE","SELECTBOX","DECK","LOGO"]},cards:{description:"Cards of the content configuration element",type:"array",items:{type:"object",required:["settings"]},properties:{settings:{type:"object",patternProperties:{".*":{type:"object",properties:{type:{description:"Type of the settings configuration element",type:"string",enum:["INPUTBOX","TEXTAREA","BUTTON","IMAGE","TOGGLE","SELECTBOX"]}},allOf:[{if:{properties:{type:{const:"INPUTBOX"}}},then:{$ref:"template-custom-content.schema.json#/$defs/input_box"}},{if:{properties:{type:{const:"TEXTAREA"}}},then:{$ref:"template-custom-content.schema.json#/$defs/text_area"}},{if:{properties:{type:{const:"BUTTON"}}},then:{$ref:"template-custom-content.schema.json#/$defs/button"}},{if:{properties:{type:{const:"IMAGE"}}},then:{$ref:"template-custom-content.schema.json#/$defs/image"}},{if:{properties:{type:{const:"TOGGLE"}}},then:{$ref:"template-custom-content.schema.json#/$defs/toggle"}},{if:{properties:{type:{const:"SELECTBOX"}}},then:{$ref:"template-custom-content.schema.json#/$defs/select_box"}}]}},minProperties:1}}}}}},ks={$schema:Jt,$id:Wt,title:Yt,description:Zt,type:Qt,$defs:en},xs={__proto__:null,$defs:en,$id:Wt,$schema:Jt,default:ks,description:Zt,title:Yt,type:Qt},tn="https://json-schema.org/draft/2020-12/schema",nn="https://lightspeedhq.com/template-custom-design.schema.json",sn="Custom Section :: Design Configuration",on="Design tab configuration of a Custom Section for a Custom Template",rn="object",an={text:{type:"object",properties:{type:{description:"Type of the text",type:"string",enum:["TEXT","BUTTON","IMAGE","TOGGLE","SELECTBOX","BACKGROUND","LOGO"]},font:{description:"Default font for the text",type:"string"},size:{description:"Default size for the text",type:"integer",minimum:1,exclusiveMaximum:50},bold:{description:"Default boldness for the text",type:"boolean"},italic:{description:"Default italic style for the text",type:"boolean"},color:{description:"Default color for the text",type:"string",pattern:"^#([a-fA-F0-9]{8}|[a-fA-F0-9]{6}|[a-fA-F0-9]{3})$"},visible:{description:"Default visibility for the text",type:"boolean"}},additionalProperties:!1},button:{type:"object",properties:{type:{description:"Type of the button",type:"string",enum:["TEXT","BUTTON","IMAGE","TOGGLE","SELECTBOX","BACKGROUND","LOGO"]},font:{description:"Default font for the button",type:"string"},size:{description:"Default size for the button",type:"string",enum:["SMALL","MEDIUM","LARGE"]},appearance:{description:"Default appearance for the button",type:"string",enum:["SOLID","OUTLINE","TEXT"]},shape:{description:"Default shape for the button",type:"string",enum:["ROUND_CORNER","RECTANGLE","PILL"]},color:{description:"Default color for the button",type:"string",pattern:"^#([a-fA-F0-9]{8}|[a-fA-F0-9]{6}|[a-fA-F0-9]{3})$"}},additionalProperties:!1},image:{type:"object",properties:{type:{description:"Type of the image",type:"string",enum:["TEXT","BUTTON","IMAGE","TOGGLE","SELECTBOX","BACKGROUND","LOGO"]},overlay:{description:"Default overlay for the image",type:"string",enum:["COLOR","GRADIENT","NONE"]}},if:{properties:{overlay:{const:"GRADIENT"}}},then:{properties:{color:{description:"Default color for the image",type:"array",items:{type:"string",pattern:"^#([a-fA-F0-9]{8}|[a-fA-F0-9]{6}|[a-fA-F0-9]{3})$"},minItems:2,maxItems:2}}},else:{properties:{color:{description:"Default color for the image",type:"string",pattern:"^#([a-fA-F0-9]{8}|[a-fA-F0-9]{6}|[a-fA-F0-9]{3})$"}}}},toggle:{type:"object",properties:{type:{description:"Type of the toggle",type:"string",enum:["TEXT","BUTTON","IMAGE","TOGGLE","SELECTBOX","BACKGROUND","LOGO"]},enabled:{description:"Default enabled status for the toggle",type:"boolean"}},additionalProperties:!1},select_box:{type:"object",properties:{type:{description:"Type of the checkbox",type:"string",enum:["TEXT","BUTTON","IMAGE","TOGGLE","SELECTBOX","BACKGROUND","LOGO"]},value:{description:"Default option for the checkbox",type:"string"}},additionalProperties:!1},background:{type:"object",properties:{type:{description:"Type of the background",type:"string",enum:["TEXT","BUTTON","IMAGE","TOGGLE","SELECTBOX","BACKGROUND","LOGO"]},style:{description:"Default style for the background",type:"string",enum:["COLOR","GRADIENT"]}},if:{properties:{style:{const:"GRADIENT"}}},then:{properties:{color:{description:"Default colors for the image",type:"array",items:{type:"string",pattern:"^#([a-fA-F0-9]{8}|[a-fA-F0-9]{6}|[a-fA-F0-9]{3})$"},minItems:2,maxItems:2}}},else:{properties:{color:{description:"Default color for the image",type:"string"}}}},logo:{type:"object",properties:{type:{description:"Type of the logo",type:"string",enum:["TEXT","BUTTON","IMAGE","TOGGLE","SELECTBOX","BACKGROUND","LOGO"]},font:{description:"Default font for the text logo",type:"string"},size:{description:"Default size for the text logo",type:"integer",minimum:1,exclusiveMaximum:50},bold:{description:"Default boldness for the text logo",type:"boolean"},italic:{description:"Default italic style for the text logo",type:"boolean"},color:{description:"Default color for the text logo",type:"string",pattern:"^#([a-fA-F0-9]{8}|[a-fA-F0-9]{6}|[a-fA-F0-9]{3})$"},visible:{description:"Default visibility for the logo",type:"boolean"},spacing:{description:"Default spacing size for the text logo",type:"integer",minimum:1,exclusiveMaximum:10},capitalization:{description:"Default capitalization style for the text logo",type:"string",enum:["none","all","small"]},frame:{description:"Default frame for the text logo",type:"object",properties:{visible:{description:"Default visibility for the frame on text logo",type:"boolean"},width:{description:"Default width size for the frame on text logo",type:"integer",minimum:1,exclusiveMaximum:50},color:{description:"Default color for the frame on text logo",type:"string",pattern:"^#([a-fA-F0-9]{8}|[a-fA-F0-9]{6}|[a-fA-F0-9]{3})$"}},required:["visible","width","color"],additionalProperties:!1}},additionalProperties:!1}},Is={$schema:tn,$id:nn,title:sn,description:on,type:rn,$defs:an},Fs={__proto__:null,$defs:an,$id:nn,$schema:tn,default:Is,description:on,title:sn,type:rn};function Ls(e){return Object.entries(v).find(t=>t[1].source===e)?.[0]}async function _s(){const e=await T("**/server.{js,ts}",{ignore:["node_modules/**","dist/**"]});return Promise.all(e.map(async t=>{const s=Nn(t).split(kn),r=s.pop()??"default",n=s.pop();if(n===void 0)throw new Error("Cannot determine type of section, outer directory is undefined");const o=await T(`**/${r}/client.{js,ts}`,{ignore:["node_modules/**","dist/**"]}),i=await T(`**/${r}/settings/content.{js,ts}`,{ignore:["node_modules/**","dist/**"]}),c=await T(`**/${r}/settings/design.{js,ts}`,{ignore:["node_modules/**","dist/**"]}),a=await T(`**/${r}/settings/layout.{js,ts}`,{ignore:["node_modules/**","dist/**"]}),p=await T(`**/${r}/settings/translations.{js,ts}`,{ignore:["node_modules/**","dist/**"]}),u=await T(`**/${r}/showcases/*.{js,ts}`,{ignore:["node_modules/**","dist/**",`**/${r}/showcases/translations.{js,ts}`]}),l=await T(`**/${r}/showcases/translations.{js,ts}`,{ignore:["node_modules/**","dist/**"]}),f=await T(`**/${r}/assets/*`,{ignore:["node_modules/**","dist/**"]});return{name:r,type:Ls(n),serverEntrypoint:t,clientEntrypoint:o.at(0),contentSettingsEntrypoint:i.at(0),designSettingsEntrypoint:c.at(0),layoutSettingsEntrypoint:a.at(0),settingsTranslationsEntrypoint:p.at(0),showcasesEntrypoints:u,showcasesTranslationsEntrypoint:l.at(0),assetsEntrypoints:f}}))}async function Rs(){const e=await T("./templates/**.{js,ts}",{ignore:["node_modules/**","dist/**"]}),t=await T("./templates/assets/*",{ignore:["node_modules/**","dist/**"]});return{templates:e,assets:t}}async function _e(e,t){try{const s=C(Ue.cwd(),t?`${e}${X}.mjs`:`${e}.mjs`);return(await import(P(s).href)).default}catch{throw new Error(`File [${e}${X}.mjs] is either invalid or undefined`)}}async function Ms(){let e=new _n({allErrors:!0,schemas:[Rt,As,Ns,xs,Fs]});return Rn(e),e.compile(Rt)}async function Ds(e,t,s,r){if(e(t)&&r===void 0)new Promise(n=>{vn(`${s}${X}.mjs`,`${s}.mjs`,function(o){o&&n(o)})});else throw new Promise(n=>{$n(`${s}${X}.mjs`,function(o){o&&n(o)})}),new Error(`Invalid file [${ne(s).name}].
3
14
  Note: Errors regarding failingKeyword: "then" can sometimes be false negatives. Please focus on fixing other errors first!
4
- Errors: ${JSON.stringify([...e.errors??[],...o??[]],null,2)}`)}async function _t(e){const t=[];for(const s of e.sections){const o=e.sections.indexOf(s);if(o===0&&s.id!=="header"&&t.push({instancePath:`/sections/${o}/id`,message:"The first section must be a default `header`"}),o===e.sections.length-1&&s.id!=="footer"&&t.push({instancePath:`/sections/${o}/id`,message:"The last section must be a default `footer`"}),s.type==="custom")if(!S(`${a}/${s.id}`))t.push({instancePath:`/sections/${o}/id`,message:"Custom section must have a corresponding block defined"});else{if(s.content!==void 0)if(!S(`${a}/${s.id}/js/settings/content.mjs`))t.push({instancePath:`/sections/${o}/content`,message:"Content descriptor is overridden, please provide a default descriptor in the block's settings folder"});else{const n=await M(`${a}/${s.id}/js/settings/content`,!1),i=new Set(Object.keys(n));Object.keys(s.content).every(c=>i.has(c))||t.push({instancePath:`/sections/${o}/content`,message:"Content descriptor must be a subset of the default content descriptor"})}if(s.design!==void 0)if(!S(`${a}/${s.id}/js/settings/design.mjs`))t.push({instancePath:`/sections/${o}/design`,message:"Design descriptor is overridden, please provide a default descriptor in the block's settings folder"});else{const n=await M(`${a}/${s.id}/js/settings/design`,!1),i=new Set(Object.keys(n));Object.keys(s.design).every(c=>i.has(c))||t.push({instancePath:`/sections/${o}/design`,message:"Design descriptor must be a subset of the default design descriptor"})}s.showcase_id!==void 0&&(S(`${a}/${s.id}/js/showcases/${s.showcase_id}.mjs`)||t.push({instancePath:`/sections/${o}/showcase-id`,message:"Custom section must have a corresponding showcase defined in case showcase_id is specified"}))}}return t.length===0?void 0:t}function Dt(e){const t=e.reduce((s,o)=>{const n=et(o);return n.size>te&&(s[o]=ee(n.size)),s},{});if(Object.keys(t).length!==0){const s=Math.max(...Object.keys(t).map(o=>o.length));p.error(`Size of individual assets must not exceed threshold [${ee(te)}]!`);for(let o in t)p.error(`File: ${o}`.padEnd(s+10)+`| ${t[o]}`);throw new Error("Invalid asset file size")}}async function It(){async function e(t,s,o){s.length!==0&&await J({configFile:!1,...H(ce(t,s,o))})}Ve("dist",{recursive:!0,force:!0});try{const t=await Ct().then(o=>o.map(n=>({name:n.name,serverEntrypoint:n.serverEntrypoint,clientEntrypoint:[n.clientEntrypoint].filter(B).flat(),settingsEntryPoints:[n.contentSettingsEntrypoint,n.designSettingsEntrypoint,n.layoutSettingsEntrypoint,n.settingsTranslationsEntrypoint].filter(B),showcaseEntryPoints:[...n.showcasesEntrypoints??[],n.showcasesTranslationsEntrypoint].filter(B),assetEntryPoints:n.assetsEntrypoints??[]})));for(const o of t)Dt(o.assetEntryPoints),await J({configFile:!1,...H(ce(o.name,o.serverEntrypoint,f.Server))}),await e(o.name,o.clientEntrypoint,f.Client),await e(o.name,o.settingsEntryPoints,f.SectionSetting),await e(o.name,o.showcaseEntryPoints,f.SectionShowcase),await e(o.name,o.assetEntryPoints,f.SectionAsset);const s=await At();if(s.templates.length!==0){const o=await Nt();await e(void 0,s.assets,f.TemplateAsset),await e(void 0,s.templates,f.TemplateDescriptor);for(const n of s.templates){const i=`${C}/js/${I(n).name}`,c=await M(i,!0);await Lt(o,c,i,await _t(c))}}p.info("Build successful. For deploy run: npx @lightspeed/crane@latest deploy")}catch(t){p.error(`Error while building: ${t.message}`),z.exit(1)}}function Me(e){if(e!==void 0)return e.startsWith("global.")?{type:"GLOBAL_FONT",font:e}:{type:"PRESET_FONT",font:e}}function O(e){if(e===void 0)return;if(e.startsWith("global."))return{type:"GLOBAL_COLOR",raw:e};const t=ut(e);return{type:"STRUCTURED_COLOR",raw:e,hex:t.toHex8String(),hsl:t.toHsl(),rgba:t.toRgb(),auto:!1}}function xt(e){if(e!==void 0)return typeof e=="string"&&e.startsWith("global.")?{type:"GLOBAL_TEXT_SIZE",size:e}:{type:"NUMERIC_TEXT_SIZE",size:e}}const Gt={COLOR:"COLOR",GRADIENT:"GRADIENT"};function Pt(e){switch(e){case"COLOR":return"solid";case"GRADIENT":return"gradient";default:throw new Error(`Unknown background type: ${e}. Right options: ${Object.keys(Gt)}`)}}function Rt(e){const t=e.style,s=e.color,o=Array.isArray(s)?s:[s,s];return e.background={type:Pt(t),solid:{color:O(o.at(0))},gradient:{fromColor:O(o.at(0)),toColor:O(o.at(1))}},e.style=void 0,e.color=void 0,e}const kt={SOLID:"SOLID",OUTLINE:"OUTLINE",TEXT:"TEXT"};function Bt(e){switch(e){case"SOLID":return"solid-button";case"OUTLINE":return"outline-button";case"TEXT":return"text-link";default:throw new Error(`Unknown button appearance: ${e}. Right options: ${Object.keys(kt)}`)}}const Ut={SMALL:"SMALL",MEDIUM:"MEDIUM",LARGE:"LARGE"};function Mt(e){switch(e){case"SMALL":return"small";case"MEDIUM":return"medium";case"LARGE":return"large";default:throw new Error(`Unknown button size: ${e}. Right options: ${Object.keys(Ut)}`)}}const Xt={ROUND_CORNER:"ROUND_CORNER",RECTANGLE:"RECTANGLE",PILL:"PILL"};function Ft(e){switch(e){case"ROUND_CORNER":return"round-corner";case"RECTANGLE":return"rectangle";case"PILL":return"pill";default:throw new Error(`Unknown button shape: ${e}. Right options: ${Object.keys(Xt)}`)}}function qt(e){const t=e.appearance;t!==void 0&&(e.appearance=Bt(t));const s=e.size;s!==void 0&&(e.size=Mt(s));const o=e.shape;o!==void 0&&(e.style=Ft(o),e.shape=void 0);const n=e.font;e.font=Me(n);const i=e.color;return e.color=O(i),e}const zt={COLOR:"COLOR",GRADIENT:"GRADIENT",NONE:"NONE"};function Kt(e){switch(e){case"COLOR":return"solid";case"GRADIENT":return"gradient";case"NONE":return"none";default:throw new Error(`Unknown image overlay type: ${e}. Right options: ${Object.keys(zt)}`)}}function Jt(e){const t=e.overlay,s=e.color,o=Array.isArray(s)?s:[s,s];return e.overlay={type:Kt(t),solid:{color:O(o.at(0))},gradient:{fromColor:O(o.at(0)),toColor:O(o.at(1))}},e.color=void 0,e}function Ht(e){const t=e.font;e.font=Me(t);const s=e.color;e.color=O(s);const o=e.size;return e.size=xt(o),e}function Zt(e){const t=e.color;return e.color=O(t),e}function Wt(e){Object.keys(e).forEach(t=>{const s=e[t],o=s.type;X(o,s.defaults)})}function Vt(e){e.forEach(t=>{t.type!==void 0&&t.defaults!==void 0&&(X(t.type,t.defaults),t.defaults.type=t.type)})}function Xe(e){Object.keys(e).forEach(t=>{const s=e[t],o=s.type;X(o,s)})}function X(e,t){switch(e){case"TEXT":{Ht(t);break}case"BUTTON":{qt(t);break}case"IMAGE":{Jt(t);break}case"BACKGROUND":{Rt(t);break}case"COLOR_PICKER":{Zt(t);break}case"TOGGLE":case"SELECTBOX":break;default:throw new Error(`Unknown design editor type: ${e}`)}return t}const Yt=200;var y=(e=>(e[e.Server=0]="Server",e[e.Client=1]="Client",e[e.ClientAsset=2]="ClientAsset",e[e.Asset=3]="Asset",e[e.TemplateAsset=4]="TemplateAsset",e[e.Dependency=5]="Dependency",e))(y||{});const A={[y.Server]:{type:"server_js",isSingleton:!0,toPath:e=>`${a}/${e}/js/main/server/`,fileName:"server.js"},[y.Client]:{type:"client_js",isSingleton:!1,toPath:e=>`${a}/${e}/js/main/client/`,fileName:"client.js"},[y.ClientAsset]:{type:"assets",isSingleton:!1,toPath:e=>`${a}/${e}/js/main/client/assets/`,fileName:"*"},[y.Asset]:{type:"assets",isSingleton:!1,toPath:e=>`${a}/${e}/assets/`,fileName:"*"},[y.TemplateAsset]:{type:"template_assets",isSingleton:!1,toPath:()=>`${C}/assets/`,fileName:"*"},[y.Dependency]:{type:"dependencies",isSingleton:!0,toPath:()=>{},fileName:"package.json"}},Qt="https://blockbuster.ecwid.com",es="/api/v1/custom-apps/resources/sections/upload",ts="/api/v1/custom-apps/resources/templates/upload",ss="/api/v1/custom-apps/manifests/sections",os="/api/v1/custom-apps/manifests/templates",ns=5,is=3;async function rs(){const e=await V(m(l.cwd(),"crane.config.json")),t=JSON.parse(e.toString());return{appClientId:t.app_client_id,appSecretKey:btoa(t.app_secret_key)}}async function as(){const e=m(l.cwd(),"package.json"),t=await V(e),s=JSON.parse(t.toString());if(cs(s))return s;throw new Error(`Package file located at path: ${e} does not contain a version field`)}function cs(e){return typeof e=="object"&&e!==null&&"version"in e&&typeof e.version=="string"}async function ps(e){const t=mt(e.version,"patch");if(t===null)throw Error("Error while incrementing app version");e.version=t,tt(m(l.cwd(),"package.json"),`${JSON.stringify(e,null,2)}
5
- `)}async function ls(e,t){try{const s=m(l.cwd(),`${a}/${e}/js/settings/content.mjs`),o=(await import(v(s).href)).default;return L(o,t),o}catch{throw new Error(`Content descriptor for section [${e}] is either invalid or undefined`)}}async function ds(e,t){try{const s=m(l.cwd(),`${a}/${e}/js/settings/design.mjs`),o=(await import(v(s).href)).default;return Wt(o),L(o,t),o}catch(s){const o=s;throw new Error(`Design settings is invalid or undefined. Error ${o.stack}`)}}async function ms(e,t){try{const s=await u("*.mjs",{cwd:m(l.cwd(),`${a}/${e}/js/showcases/`),ignore:"**/translations.mjs"});return Promise.all(s.map(async o=>{const n=m(l.cwd(),`${a}/${e}/js/showcases/${o}`),i=(await import(v(n).href)).default;return Xe(i.design),L(i,t),i}))}catch(s){throw new Error(`Showcases is invalid or undefined. Error ${s}`)}}async function fs(e){try{const t=m(l.cwd(),`${a}/${e}/js/settings/layout.mjs`);if(!S(t))return[];const s=(await import(v(t).href)).default;return s.forEach(o=>Vt(o.selectedDesignSettings)),s}catch{throw new Error(`Layout descriptor for section [${e}] is either invalid or undefined`)}}async function us(e){return await qe(`${a}/${e}/js/settings/translations.mjs`)}async function Fe(e){return await qe(`${a}/${e}/js/showcases/translations.mjs`)}async function qe(e){const t=m(l.cwd(),e),s=(await import(v(t).href)).default;return hs(s)}function L(e,t){if(e&&typeof e=="object"){const s=e;for(let o in s){const n=s[o];typeof n=="string"&&n.startsWith("$")&&(s[o]=ys(t,n)),typeof n=="object"&&L(n,t)}}}function ys(e,t){if(!t)return;const s=e[t];return s===void 0?{en:t}:s}function hs(e){const t={};for(let s in e){const o=e[s];for(let n in o){const i=t[n],c=o[n];if(i===void 0){const r={};r[s]=c,t[n]=r}else i[s]=c}}return t}async function gs(){const e=await u("*/",{cwd:m(l.cwd(),`${a}/`)});return Promise.all(e.map(async t=>{const s=await us(t),o=await Fe(t),n=await ls(t,s),i=await ds(t,s),c=await ms(t,o),r=await fs(t);return{id:t,name:{en:t},contentEditors:n,designEditors:i,layouts:r,showcases:c}}))}async function $s(e){try{return(await import(v(m(l.cwd(),e)).href)).default}catch{throw new Error(`Template descriptor [${e}] is either invalid or undefined`)}}async function Es(){const e=await u(`${C}/js/**.mjs`,{ignore:[`${C}/js/**${b}.mjs`]});return Promise.all(e.map(async t=>{const s=await $s(t),o=s.sections.filter(n=>n.type==="custom");for(const n of o){const i=await Fe(n.id);n.showcase_overrides!==void 0&&(L(n.showcase_overrides,i),Xe(n.showcase_overrides.design))}return{id:`${I(l.cwd()).name.replace(/[^a-zA-Z0-9]/g,"_")}_${I(t).name}`,descriptor:s}}))}function Ts(e){const t=e.pathContext,s=t.toPath(e.currentSection),o=s===void 0?K(t.fileName):K(t.fileName,{cwd:m(l.cwd(),s),ignore:t.ignore});return t.isSingleton?o.splice(0):o}function ws(e){return e instanceof Y&&(e.code==="ECONNRESET"||e.response?.status!==void 0&&e.response?.status>=500&&e.response?.status<600)}function ze(e,t){return e<is&&ws(t)}async function Ke(e){await new Promise(t=>{setTimeout(t,2**e*500)})}function Je(e,t,s,o){const n=e.config.app.templates.length>0?ts:es;return e.config.axios.post(n,{file:st(m(l.cwd(),s!==void 0?s+t:t))},{params:{appClientId:e.config.app.crane.appClientId,type:e.pathContext.type,version:e.config.app.packageJson.version,...e.currentSection!==void 0&&{block:e.currentSection},...e.pathContext.type!=="dependencies"&&{fileName:t}},headers:{"Content-Type":"multipart/form-data",Authorization:`Bearer ${e.config.app.crane.appSecretKey}`}}).then(i=>({status:i.status})).catch(async i=>ze(o,i)?(await Ke(o),Je(e,t,s,o+1)):{status:i.response?.status,message:i.message})}function N(e){const t=Ts(e),s=e.pathContext.toPath(e.currentSection);return t.map(o=>Je(e,o,s,0))}function js(e){return[...e.app.sections.flatMap(t=>[...N({config:e,currentSection:t.id,pathContext:A[y.Server]}),...N({config:e,currentSection:t.id,pathContext:A[y.Client]}),...N({config:e,currentSection:t.id,pathContext:A[y.ClientAsset]}),...N({config:e,currentSection:t.id,pathContext:A[y.Asset]})]),...N({config:e,pathContext:A[y.Dependency]}),...N({config:e,pathContext:A[y.TemplateAsset]})]}function Os(e){return e.includes(`
6
- `)}function vs(e,t,s){return e.split(`
7
- `).map((o,n)=>n>=s?t+o:o).join(`
8
- `)}function He(e,t){const s=[];if(e instanceof Y){e.response?.status!==void 0&&s.push(` HTTP Status Code: ${e.response.status}`);const i=e.response?.data;if(i?.errorCode&&s.push(` Error Code: ${i.errorCode}`),i?.errorMessage){const c=Os(i.errorMessage)?vs(i.errorMessage," ",1):i.errorMessage;s.push(` Error Message: ${c}`)}}const o=s.length>0?s.join(`
9
- `):e?.message??"Unknown error";if(!t||t.length===0)return o;const n=s.length>0?`
10
- `:" ";return`${t}${n}${o}`}async function Ze(e,t=0){const s=e.app.templates.length>0?os:ss;return e.axios.post(s,{version:e.app.packageJson.version,name:"Custom Block App",blocks:e.app.sections,templates:e.app.templates},{params:{appClientId:e.app.crane.appClientId},headers:{Authorization:`Bearer ${e.app.crane.appSecretKey}`}}).catch(async o=>{if(ze(t,o))return await Ke(t),Ze(e,t+1);throw o})}async function Ss(e){try{S(m(l.cwd(),a))||(p.error(`Distribution folder [${a}] not found, please execute the build command first.`),l.exit(1));const t=e??Qt;p.info("Custom application deployment :: Started");const s=dt.create({baseURL:t});ft(s,ns),p.info("Loading configuration files ...");const o=await Promise.all([rs(),as(),gs(),Es()]).then(([r,E,g,G])=>({axios:s,app:{crane:r,packageJson:E,sections:g,templates:G}}));p.info("Uploading asset files ...");let n=se();const i=await Promise.all(js(o)).finally(()=>{U(n)});i.every(r=>r.status===Yt)||(i.map(r=>r.message).filter((r,E,g)=>g.indexOf(r)===E).forEach(r=>p.error(`Error while uploading asset files: ${r}`)),l.exit(1)),p.info("Uploading manifest files ..."),n=se(),await Ze(o).catch(r=>{U(n),p.error(He(r,"Error while deploying manifest file:")),l.exit(1)}).finally(()=>{U(n)});const c=o.app.sections.map(r=>r.id);p.info(`Custom application deployment :: Successful
11
- Current app version: ${o.app.packageJson.version}
12
- Deployed sections: ${c.join(", ")}`),await ps(o.app.packageJson),o.app.templates.length>0&&p.info(`Deployed templates: ${o.app.templates.map(r=>r.id).join(", ")}`)}catch(t){p.error(He(t,"Error while deploying:")),l.exit(1)}}const bs="1.1.0",d=We("crane");function Cs(){d.command("init","Initialize a new resource in the form of a directory.").option("--app <name>","Creates an app folder inside your current directory.").option("--section <name>","Creates the files necessary for one custom section with the given name, this can be repeated for each section.").option("--template <name>","Creates the directory and files necessary to build a custom template inside your app folder.").action(e=>{if(e.app)return oe(e.app);if(e.section)return ne(e.section);if(e.template)return ie(e.template);d.outputHelp()}),d.command("build","Builds your resource code").action(It),d.command("deploy","Deploys your resource code into Ecwid"),d.on("command:*",()=>{console.error("Invalid command: %s",d.args.join(" ")),d.outputHelp(),process.exit(1)}),d.on("command:init",()=>{const e=d.options.section,t=d.options.app,s=d.options.template;q(t)?F("app",x("init --app <name>"),oe):q(e)?F("section",x("init --section <name>"),ne):q(s)&&F("template",x("init --template <name>"),ie)}),d.on("command:deploy",()=>Ss(d.options.url)),d.help(),d.usage("<action> <resource>"),d.version(bs),d.parse()}try{Cs()}catch{}async function F(e,t,s){const o=`You can use ${t} to directly specify the name of the ${e}.`;console.log(o);const n=await yt({type:"text",name:"name",message:`Please specify a name for your ${e}:`});if(n.name)return s(n.name);console.log("Please provide a name for the template."),d.outputHelp()}function q(e){return e&&(typeof e!="string"||e.trim().length==0)}
15
+ Errors: ${JSON.stringify([...e.errors??[],...r??[]],null,2)}`)}async function Gs(e){const t=[];for(const s of e.sections){const r=e.sections.indexOf(s);if(r===0){const n=s.id==="header"&&s.type==="default",o=L(`${he}/${s.id}`);!n&&!o&&t.push({instancePath:`/sections/${r}/id`,message:"The first section must be a `header`"})}else if(r===e.sections.length-1){const n=s.id==="footer"&&s.type==="default",o=L(`${ye}/${s.id}`);!n&&!o&&t.push({instancePath:`/sections/${r}/id`,message:"The last section must be a `footer`"})}else if(s.type==="custom")if(!L(`${S}/${s.id}`))t.push({instancePath:`/sections/${r}/id`,message:"Custom section must have a corresponding block defined"});else{if(s.content!==void 0)if(!L(`${S}/${s.id}/js/settings/content.mjs`))t.push({instancePath:`/sections/${r}/content`,message:"Content descriptor is overridden, please provide a default descriptor in the block's settings folder"});else{const n=await _e(`${S}/${s.id}/js/settings/content`,!1),o=new Set(Object.keys(n));Object.keys(s.content).every(i=>o.has(i))||t.push({instancePath:`/sections/${r}/content`,message:"Content descriptor must be a subset of the default content descriptor"})}if(s.design!==void 0)if(!L(`${S}/${s.id}/js/settings/design.mjs`))t.push({instancePath:`/sections/${r}/design`,message:"Design descriptor is overridden, please provide a default descriptor in the block's settings folder"});else{const n=await _e(`${S}/${s.id}/js/settings/design`,!1),o=new Set(Object.keys(n));Object.keys(s.design).every(i=>o.has(i))||t.push({instancePath:`/sections/${r}/design`,message:"Design descriptor must be a subset of the default design descriptor"})}s.showcase_id!==void 0&&(L(`${S}/${s.id}/js/showcases/${s.showcase_id}.mjs`)||t.push({instancePath:`/sections/${r}/showcase-id`,message:"Custom section must have a corresponding showcase defined in case showcase_id is specified"}))}}return t.length===0?void 0:t}function Bs(e){const t=e.reduce((s,r)=>{const n=Tn(r);return n.size>et&&(s[r]=Qe(n.size)),s},{});if(Object.keys(t).length!==0){const s=Math.max(...Object.keys(t).map(r=>r.length));b.error(`Size of individual assets must not exceed threshold [${Qe(et)}]!`);for(let r in t)b.error(`File: ${r}`.padEnd(s+10)+`| ${t[r]}`);throw new Error("Invalid asset file size")}}function Ps(){return jn.rm("dist",{recursive:!0,force:!0})}async function Us(e){async function t(s,r,n,o="SECTION"){r.length!==0&&await qe({configFile:!1,...Ke(St(s,r,n,o,e))})}try{const[s,r]=await Promise.all([_s(),Rs(),Ps()]),n=s.map(o=>({name:o.name,type:o.type,serverEntrypoint:o.serverEntrypoint,clientEntrypoint:[o.clientEntrypoint].filter(ge).flat(),settingsEntryPoints:[o.contentSettingsEntrypoint,o.designSettingsEntrypoint,o.layoutSettingsEntrypoint,o.settingsTranslationsEntrypoint].filter(ge),showcaseEntryPoints:[...o.showcasesEntrypoints??[],o.showcasesTranslationsEntrypoint].filter(ge),assetsEntrypoints:o.assetsEntrypoints??[]}));for(const o of n)Bs(o.assetsEntrypoints),await Promise.all([qe({configFile:!1,...Ke(St(o.name,o.serverEntrypoint,j.Server,o.type,e))}),t(o.name,o.clientEntrypoint,j.Client,o.type),t(o.name,o.settingsEntryPoints,j.SectionSetting,o.type),t(o.name,o.showcaseEntryPoints,j.SectionShowcase,o.type),t(o.name,o.assetsEntrypoints,j.SectionAsset,o.type)]);if(r.templates.length!==0){const[o]=await Promise.all([Ms(),t(void 0,r.assets,j.TemplateAsset),t(void 0,r.templates,j.TemplateDescriptor)]);for(const i of r.templates){const c=`${z}/js/${ne(i).name}`,a=await _e(c,!0);await Ds(o,a,c,await Gs(a))}}b.info("Build successful. For deploy run: npx @lightspeed/crane@latest deploy")}catch(s){b.error(`Error while building: ${s.message}`),Ue.exit(1)}}function Re(e){if(e!==void 0)return e.startsWith("global.")?{type:"GLOBAL_FONT",font:e}:{type:"PRESET_FONT",font:e}}function F(e){if(e===void 0)return;if(e.startsWith("global."))return{type:"GLOBAL_COLOR",raw:e};const t=Bn(e);return{type:"STRUCTURED_COLOR",raw:e,hex:t.toHex8String(),hsl:t.toHsl(),rgba:t.toRgb(),auto:!1}}function cn(e){if(e!==void 0)return typeof e=="string"&&e.startsWith("global.")?{type:"GLOBAL_TEXT_SIZE",size:e}:{type:"NUMERIC_TEXT_SIZE",size:Number(e)}}const Xs={COLOR:"COLOR",GRADIENT:"GRADIENT"};function zs(e){switch(e){case"COLOR":return"solid";case"GRADIENT":return"gradient";default:throw new Error(`Unknown background type: ${e}. Right options: ${Object.keys(Xs)}`)}}function qs(e){const t=e.style,s=e.color,r=Array.isArray(s)?s:[s,s];return e.background={type:zs(t),solid:{color:F(r.at(0))},gradient:{fromColor:F(r.at(0)),toColor:F(r.at(1))}},e.style=void 0,e.color=void 0,e}const Ks={SOLID:"SOLID",OUTLINE:"OUTLINE",TEXT:"TEXT"};function Hs(e){switch(e){case"SOLID":return"solid-button";case"OUTLINE":return"outline-button";case"TEXT":return"text-link";default:throw new Error(`Unknown button appearance: ${e}. Right options: ${Object.keys(Ks)}`)}}const Vs={SMALL:"SMALL",MEDIUM:"MEDIUM",LARGE:"LARGE"};function Js(e){switch(e){case"SMALL":return"small";case"MEDIUM":return"medium";case"LARGE":return"large";default:throw new Error(`Unknown button size: ${e}. Right options: ${Object.keys(Vs)}`)}}const Ws={ROUND_CORNER:"ROUND_CORNER",RECTANGLE:"RECTANGLE",PILL:"PILL"};function Ys(e){switch(e){case"ROUND_CORNER":return"round-corner";case"RECTANGLE":return"rectangle";case"PILL":return"pill";default:throw new Error(`Unknown button shape: ${e}. Right options: ${Object.keys(Ws)}`)}}function Zs(e){const t=e.appearance;t!==void 0&&(e.appearance=Hs(t));const s=e.size;s!==void 0&&(e.size=Js(s));const r=e.shape;r!==void 0&&(e.style=Ys(r),e.shape=void 0);const n=e.font;e.font=Re(n);const o=e.color;return e.color=F(o),e}const Qs={COLOR:"COLOR",GRADIENT:"GRADIENT",NONE:"NONE"};function eo(e){switch(e){case"COLOR":return"solid";case"GRADIENT":return"gradient";case"NONE":return"none";default:throw new Error(`Unknown image overlay type: ${e}. Right options: ${Object.keys(Qs)}`)}}function to(e){const t=e.overlay,s=e.color,r=Array.isArray(s)?s:[s,s];return e.overlay={type:eo(t),solid:{color:F(r.at(0))},gradient:{fromColor:F(r.at(0)),toColor:F(r.at(1))}},e.color=void 0,e}function no(e){const t=e.font;e.font=Re(t);const s=e.color;e.color=F(s);const r=e.size;return e.size=cn(r),e}function so(e){const t=e.color;return e.color=F(t),e}function oo(e){const t=e.font;e.font=Re(t);const s=e.color;e.color=F(s);const r=e.size;if(e.size=cn(r),e.frame!==void 0){const n=e.frame.color;e.frame.color=F(n)}return e}function Me(e,t){switch(e){case"TEXT":{no(t);break}case"BUTTON":{Zs(t);break}case"IMAGE":{to(t);break}case"BACKGROUND":{qs(t);break}case"COLOR_PICKER":{so(t);break}case"LOGO":{oo(t);break}case"TOGGLE":case"SELECTBOX":break;default:throw new Error(`Unknown design editor type: ${e}`)}return t}function ro(e){Object.keys(e).forEach(t=>{const s=e[t],r=s.type;Me(r,s.defaults)})}function io(e){e.forEach(t=>{t.type!==void 0&&t.defaults!==void 0&&(Me(t.type,t.defaults),t.defaults.type=t.type)})}function ln(e){Object.keys(e).forEach(t=>{const s=e[t],r=s.type;Me(r,s)})}const ao=200;var N=(e=>(e[e.Server=0]="Server",e[e.Client=1]="Client",e[e.ClientAsset=2]="ClientAsset",e[e.Asset=3]="Asset",e[e.TemplateAsset=4]="TemplateAsset",e[e.Dependency=5]="Dependency",e))(N||{});const K={[N.Server]:{type:"server_js_compressed",isSingleton:!0,toPath:(e,t)=>`${v[t].dist}/${e}/js/main/server/`,fileName:"server.js.gz"},[N.Client]:{type:"client_js",isSingleton:!1,toPath:(e,t)=>`${v[t].dist}/${e}/js/main/client/`,fileName:"client.js"},[N.ClientAsset]:{type:"assets",isSingleton:!1,toPath:(e,t)=>`${v[t].dist}/${e}/js/main/client/assets/`,fileName:"*"},[N.Asset]:{type:"assets",isSingleton:!1,toPath:(e,t)=>`${v[t].dist}/${e}/assets/`,fileName:"*"},[N.TemplateAsset]:{type:"template_assets",isSingleton:!1,toPath:()=>`${z}/assets/`,fileName:"*"},[N.Dependency]:{type:"dependencies",isSingleton:!0,toPath:()=>{},fileName:"package.json"}},co="https://blockbuster.ecwid.com",lo="/api/v1/custom-apps/resources/sections/upload",po="/api/v1/custom-apps/resources/templates/upload",uo="/api/v1/custom-apps/manifests/sections",fo="/api/v1/custom-apps/manifests/templates",mo=5,ho=3;async function yo(){const e=await We(C(E.cwd(),"crane.config.json")),t=JSON.parse(e.toString());return{appClientId:t.app_client_id,appSecretKey:btoa(t.app_secret_key)}}async function go(){const e=C(E.cwd(),"package.json"),t=await We(e),s=JSON.parse(t.toString());if(bo(s))return s;throw new Error(`Package file located at path: ${e} does not contain a version field`)}function bo(e){return typeof e=="object"&&e!==null&&"version"in e&&typeof e.version=="string"}async function Eo(e){const t=Dn(e.version,"patch");if(t===null)throw Error("Error while incrementing app version");e.version=t,An(C(E.cwd(),"package.json"),`${JSON.stringify(e,null,2)}
16
+ `)}async function Co(e,t,s=S){try{const r=C(E.cwd(),`${s}/${e}/js/settings/content.mjs`),n=(await import(P(r).href)).default;return W(n,t),n}catch{throw new Error(`Content descriptor for section [${e}] is either invalid or undefined`)}}async function Oo(e,t,s=S){try{const r=C(E.cwd(),`${s}/${e}/js/settings/design.mjs`),n=(await import(P(r).href)).default;return ro(n),W(n,t),n}catch(r){const n=r;throw new Error(`Design settings is invalid or undefined. Error ${n.stack}`)}}async function wo(e,t,s=S){try{const r=await T("*.mjs",{cwd:C(E.cwd(),`${s}/${e}/js/showcases/`),ignore:"**/translations.mjs"});return Promise.all(r.map(async n=>{const o=C(E.cwd(),`${s}/${e}/js/showcases/${n}`),i=(await import(P(o).href)).default;return ln(i.design),W(i,t),i}))}catch(r){throw new Error(`Showcases is invalid or undefined. Error ${r}`)}}async function vo(e,t=S){try{const s=C(E.cwd(),`${t}/${e}/js/settings/layout.mjs`);if(!L(s))return[];const r=(await import(P(s).href)).default;return r.forEach(n=>io(n.selectedDesignSettings)),r}catch{throw new Error(`Layout descriptor for section [${e}] is either invalid or undefined`)}}async function $o(e,t=S){return await un(`${t}/${e}/js/settings/translations.mjs`)}async function pn(e,t=S){return await un(`${t}/${e}/js/showcases/translations.mjs`)}async function un(e){const t=C(E.cwd(),e),s=(await import(P(t).href)).default;return jo(s)}function W(e,t){if(e&&typeof e=="object"){const s=e;for(const r in s){const n=s[r];typeof n=="string"&&n.startsWith("$")&&(s[r]=To(t,n)),typeof n=="object"&&W(n,t)}}}function To(e,t){if(!t)return;const s=e[t];return s===void 0?{en:t}:s}function jo(e){const t={};for(const s in e){const r=e[s];for(const n in r){const o=t[n],i=r[n];if(o===void 0){const c={};c[s]=i,t[n]=c}else o[s]=i}}return t}async function De(e,t){const s=await $o(e,v[t].dist),r=await pn(e,v[t].dist),n=await Co(e,s,v[t].dist),o=await Oo(e,s,v[t].dist),i=await wo(e,r,v[t].dist),c=await vo(e,v[t].dist);return{id:e,type:t,name:{en:e},contentEditors:n,designEditors:o,layouts:c,showcases:i}}async function Ao(){const e=await T("*/",{cwd:C(E.cwd(),`${S}/`)}),t=await T("*/",{cwd:C(E.cwd(),`${he}/`)}),s=await T("*/",{cwd:C(E.cwd(),`${ye}/`)});return Promise.all([...e.map(async r=>De(r,"SECTION")),...t.map(async r=>De(r,"HEADER")),...s.map(async r=>De(r,"FOOTER"))])}async function So(e){try{return(await import(P(C(E.cwd(),e)).href)).default}catch{throw new Error(`Template descriptor [${e}] is either invalid or undefined`)}}async function No(){const e=await T(`${z}/js/**.mjs`,{ignore:[`${z}/js/**${X}.mjs`]});return Promise.all(e.map(async t=>{const s=await So(t),r=s.sections.filter(n=>n.type==="custom");for(const n of r){const o=Cs(n.id),i=await pn(n.id,v[o].dist);n.showcase_overrides!==void 0&&(W(n.showcase_overrides,i),ln(n.showcase_overrides.design))}return{id:`${ne(E.cwd()).name.replace(/[^a-zA-Z0-9]/g,"_")}_${ne(t).name}`,descriptor:s}}))}function ko(e,t){const s=e.pathContext,r=s.toPath(e.currentSection,t),n=r===void 0?Xe(s.fileName):Xe(s.fileName,{cwd:C(E.cwd(),r),ignore:s.ignore});return s.isSingleton?n.splice(0):n}function xo(e){return e instanceof Ye&&(e.code==="ECONNRESET"||e.response?.status!==void 0&&e.response?.status>=500&&e.response?.status<600)}function fn(e,t){return e<ho&&xo(t)}async function dn(e){await new Promise(t=>{setTimeout(t,2**e*500)})}function mn(e,t,s,r){const n=e.config.app.templates.length>0?po:lo;return e.config.axios.post(n,{file:Sn(C(E.cwd(),s!==void 0?s+t:t))},{params:{appClientId:e.config.app.crane.appClientId,type:e.pathContext.type,version:e.config.app.packageJson.version,...e.currentSection!==void 0&&{block:e.currentSection},...e.pathContext.type!=="dependencies"&&{fileName:t}},headers:{"Content-Type":"multipart/form-data",Authorization:`Bearer ${e.config.app.crane.appSecretKey}`}}).then(o=>({status:o.status})).catch(async o=>fn(r,o)?(await dn(r),mn(e,t,s,r+1)):{status:o.response?.status,message:o.message})}function H(e,t="SECTION"){const s=ko(e,t),r=e.pathContext.toPath(e.currentSection,t);return s.map(n=>mn(e,n,r,0))}function Io(e){return[...e.app.sections.flatMap(t=>[...H({config:e,currentSection:t.id,pathContext:K[N.Server]},t.type),...H({config:e,currentSection:t.id,pathContext:K[N.Client]},t.type),...H({config:e,currentSection:t.id,pathContext:K[N.ClientAsset]},t.type),...H({config:e,currentSection:t.id,pathContext:K[N.Asset]},t.type)]),...H({config:e,pathContext:K[N.Dependency]}),...H({config:e,pathContext:K[N.TemplateAsset]})]}function Fo(e){return e.includes(`
17
+ `)}function Lo(e,t,s){return e.split(`
18
+ `).map((r,n)=>n>=s?t+r:r).join(`
19
+ `)}function hn(e,t){const s=[];if(e instanceof Ye){e.response?.status!==void 0&&s.push(` HTTP Status Code: ${e.response.status}`);const o=e.response?.data;if(o?.errorCode&&s.push(` Error Code: ${o.errorCode}`),o?.errorMessage){const i=Fo(o.errorMessage)?Lo(o.errorMessage," ",1):o.errorMessage;s.push(` Error Message: ${i}`)}}const r=s.length>0?s.join(`
20
+ `):e?.message??"Unknown error";if(!t||t.length===0)return r;const n=s.length>0?`
21
+ `:" ";return`${t}${n}${r}`}async function yn(e,t=0){const s=e.app.templates.length>0?fo:uo;return e.axios.post(s,{version:e.app.packageJson.version,name:"Custom Block App",blocks:e.app.sections,templates:e.app.templates,compressionEnabled:!0},{params:{appClientId:e.app.crane.appClientId},headers:{Authorization:`Bearer ${e.app.crane.appSecretKey}`}}).catch(async r=>{if(fn(t,r))return await dn(t),yn(e,t+1);throw r})}async function _o(e){try{L(C(E.cwd(),S))||(b.error(`Distribution folder [${S}] not found, please execute the build command first.`),E.exit(1));const t=e??co;b.info("Custom application deployment :: Started");const s=Mn.create({baseURL:t});Gn(s,mo),b.info("Loading configuration files ...");const r=await Promise.all([yo(),go(),Ao(),No()]).then(([c,a,p,u])=>({axios:s,app:{crane:c,packageJson:a,sections:p,templates:u}}));b.info("Uploading asset files ...");let n=tt();const o=await Promise.all(Io(r)).finally(()=>{be(n)});o.every(c=>c.status===ao)||(o.map(c=>c.message).filter((c,a,p)=>p.indexOf(c)===a).forEach(c=>b.error(`Error while uploading asset files: ${c}`)),E.exit(1)),b.info("Uploading manifest files ..."),n=tt(),await yn(r).catch(c=>{be(n),b.error(hn(c,"Error while deploying manifest file:")),E.exit(1)}).finally(()=>{be(n)});const i=r.app.sections.map(c=>c.id);b.info(`Custom application deployment :: Successful
22
+ Current app version: ${r.app.packageJson.version}
23
+ Deployed sections: ${i.join(", ")}`),await Eo(r.app.packageJson),r.app.templates.length>0&&b.info(`Deployed templates: ${r.app.templates.map(c=>c.id).join(", ")}`)}catch(t){b.error(hn(t,"Error while deploying:")),E.exit(1)}}const Ro="1.1.2",O=En("crane");async function Ge(e,t,s,r){const n=`You can use ${t} to directly specify the name of the ${e}.`;console.log(n);const o=await Cn({type:"text",name:"name",message:`Please specify a name for your ${e}:`});return o.name?e==="template"?s(o.name,r):s(o.name):(console.log("Please provide a name for the template."),O.outputHelp())}function Be(e){return e&&(typeof e!="string"||e.trim().length===0)}function Mo(){O.command("init","Initialize a new resource in the form of a directory.").option("--app <name>","Creates an app folder inside your current directory.").option("--section <name>","Creates the files necessary for one custom section with the given name, this can be repeated for each section.").option("--template <name>","Creates the directory and files necessary to build a custom template inside your app folder.").option("--custom-headers-footers","Creates the directories and files necessary to build a custom header and footer inside your app folder.").action(e=>e.app?nt(e.app):e.section?st(e.section):e.template?ot(e.template,e.customHeadersFooters):O.outputHelp()),O.command("build","Builds your resource code").option("--externalize-vue","Externalize @vue core libraries to reduce the bundle size").action(Us),O.command("deploy","Deploys your resource code into Ecwid"),O.on("command:*",()=>{console.error("Invalid command: %s",O.args.join(" ")),O.outputHelp(),process.exit(1)}),O.on("command:init",()=>{const e=O.options.section,t=O.options.app,s=O.options.template,r=O.options.customHeadersFooters||!1;Be(t)?Ge("app",Z("init --app <name>"),nt):Be(e)?Ge("section",Z("init --section <name>"),st):Be(s)&&Ge("template",Z("init --template <name>"),ot,r)}),O.on("command:deploy",()=>_o(O.options.url)),O.help(),O.usage("<action> <resource>"),O.version(Ro),O.parse()}try{Mo()}catch(e){console.error(e)}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lightspeed/crane",
3
- "version": "1.1.0",
3
+ "version": "1.1.2",
4
4
  "type": "module",
5
5
  "bin": "bin/crane.js",
6
6
  "main": "./dist/app.mjs",
@@ -36,18 +36,20 @@
36
36
  "@types/fs-extra": "^11.0.1",
37
37
  "@types/jest": "^29.5.12",
38
38
  "@types/node": "^20.4.5",
39
- "dir-compare": "^5.0.0",
40
39
  "express": "^4.19.2",
41
40
  "express-fileupload": "^1.5.1",
42
41
  "jest": "^29.7.0",
42
+ "terser": "^5.35.0",
43
43
  "ts-jest": "^29.1.5",
44
44
  "ts-node": "^10.9.2",
45
45
  "typescript": "5.4.5",
46
46
  "unbuild": "^2.0.0",
47
+ "vite-plugin-compression": "^0.5.1",
47
48
  "vite-plugin-dts": "^3.4.0",
48
49
  "vite-plugin-static-copy": "^0.17.0"
49
50
  },
50
51
  "dependencies": {
52
+ "@jest/globals": "^29.7.0",
51
53
  "@jridgewell/sourcemap-codec": "^1.4.15",
52
54
  "@lightspeed/eslint-config-crane": "1.0.2",
53
55
  "@types/prompts": "^2.4.2",
@@ -57,6 +59,7 @@
57
59
  "axios": "^1.7.7",
58
60
  "axios-concurrency": "^1.0.4",
59
61
  "cac": "^6.7.14",
62
+ "dir-compare": "^5.0.0",
60
63
  "eslint": "npm:eslint-customized-for-crane@8.57.0",
61
64
  "fs-extra": "^11.1.1",
62
65
  "glob": "^9.3.5",
@@ -1,17 +1,56 @@
1
1
  <template>
2
2
  <div
3
3
  class="custom-footer"
4
+ :style="backgroundStyle"
4
5
  >
5
6
  <div>
6
- the components will sit here
7
+ <ReportAbuse />
8
+ <div class="custom-block__blank_space" />
9
+ <LegalLinks />
10
+ <div class="custom-footer__blank_space" />
11
+ <LanguageSelector />
7
12
  </div>
8
13
  </div>
9
14
  </template>
10
15
 
11
16
  <script setup lang="ts">
17
+ import { computed } from 'vue';
18
+ import { useBackgroundElementDesign } from '@lightspeed/crane';
19
+ import ReportAbuse from './component/ReportAbuse.vue';
20
+ import { Design } from './type.ts';
21
+ import LanguageSelector from '../../shared/LanguageSelector.vue';
22
+ import LegalLinks from './component/LegalLinks.vue';
12
23
 
24
+ const backgroundDesign = useBackgroundElementDesign<Design>('background');
25
+ const background = computed(() => ({
26
+ type: backgroundDesign.background?.type,
27
+ solidColor: backgroundDesign.background?.solid?.color as Color,
28
+ fromColor: backgroundDesign.background?.gradient?.fromColor as Color,
29
+ toColor: backgroundDesign.background?.gradient?.toColor as Color,
30
+ }));
31
+
32
+ const backgroundStyle = computed(() => {
33
+ if (background.value.type === 'gradient') {
34
+ return { 'background-image': `linear-gradient(to right, ${background.value.fromColor.hex}, ${background.value.toColor.hex})` };
35
+ }
36
+ return { 'background-color': background.value.solidColor.hex };
37
+ });
13
38
  </script>
14
39
 
15
40
  <style scoped lang="scss">
41
+ .custom-footer {
42
+ padding: 50px;
43
+
44
+ @media screen and (min-width: 700px) {
45
+ padding: 75px;
46
+ }
47
+
48
+ @media screen and (min-width: 1200px) {
49
+ padding: 100px;
50
+ }
16
51
 
52
+ &__blank_space {
53
+ height: 40px;
54
+ }
55
+ }
17
56
  </style>
@@ -0,0 +1,20 @@
1
+ <template>
2
+ <div>
3
+ <span v-for="(link, index) in legalLinks" :key="index">
4
+ <a :href="link.url">{{ link.title }}</a>
5
+ <span v-if="index < legalLinks.length - 1"> | </span>
6
+ </span>
7
+ </div>
8
+ </template>
9
+
10
+ <script setup lang="ts">
11
+ import { useVueBaseProps } from '@lightspeed/crane';
12
+ import { Design } from '../type.ts';
13
+
14
+ const baseProps = useVueBaseProps<unknown, Design>();
15
+ const externalContent: ExternalContentData = baseProps.externalContent?.value;
16
+ const legalLinks = externalContent.legalLinks ?? [];
17
+ </script>
18
+
19
+ <style lang="scss" scoped>
20
+ </style>
@@ -0,0 +1,18 @@
1
+ <template>
2
+ <div>
3
+ <a :href="externalContent?.reportAbuse?.url" target="{{ externalContent?.reportAbuse?.target }}}">
4
+ {{ externalContent?.reportAbuse?.title }}
5
+ </a>
6
+ </div>
7
+ </template>
8
+
9
+ <script setup lang="ts">
10
+ import { useVueBaseProps } from '@lightspeed/crane';
11
+ import { Design } from '../type.ts';
12
+
13
+ const baseProps = useVueBaseProps<unknown, Design>();
14
+ const externalContent: ExternalContentData = baseProps.externalContent.value;
15
+ </script>
16
+
17
+ <style lang="scss" scoped>
18
+ </style>
@@ -0,0 +1,4 @@
1
+ export enum ColorType {
2
+ SOLID = 'solid',
3
+ GRADIENT = 'gradient',
4
+ }
@@ -1,5 +1,3 @@
1
1
  export default {
2
- en: {},
3
2
 
4
- nl: {},
5
3
  } as const;
@@ -0,0 +1,11 @@
1
+ export default {
2
+ background: {
3
+ type: 'BACKGROUND',
4
+ label: '$label.background.label',
5
+ colors: ['#FFFFFF66', '#0000004D', '#00000099', '#64C7FF66', '#F9947266', '#C794CD66', '#FFD17466'],
6
+ defaults: {
7
+ style: 'COLOR',
8
+ color: 'global.color.background',
9
+ },
10
+ },
11
+ } as const;
@@ -0,0 +1,12 @@
1
+ export default {
2
+ en: {
3
+ '$label.reportAbuse.label': 'Custom Footer',
4
+ '$label.background.label': 'Background',
5
+ },
6
+
7
+ nl: {
8
+ '$label.reportAbuse.label': 'aangepaste voettekst',
9
+ '$label.background.label': 'Achtergrond',
10
+
11
+ },
12
+ } as const;
@@ -1,4 +1,5 @@
1
1
  export default {
2
+ showcaseId: '1',
2
3
  previewImage: {
3
4
  set: {
4
5
  ORIGINAL: {
@@ -6,6 +7,7 @@ export default {
6
7
  },
7
8
  },
8
9
  },
10
+ blockName: '$label.showcase_1.blockName',
9
11
  content: {},
10
12
  design: {},
11
13
  } as const;
@@ -0,0 +1,9 @@
1
+ export default {
2
+ en: {
3
+ '$label.showcase_1.blockName': 'Custom footer',
4
+ },
5
+
6
+ nl: {
7
+ '$label.showcase_1.blockName': 'aangepaste voettekst',
8
+ },
9
+ } as const;
@@ -1,5 +1,5 @@
1
- import ContentSettings from '../settings/content.ts';
2
- import DesignSettings from '../settings/design.ts';
1
+ import ContentSettings from './settings/content.ts';
2
+ import DesignSettings from './settings/design.ts';
3
3
 
4
4
  export type Content = InferContentType<typeof ContentSettings>;
5
5
  export type Design = InferDesignType<typeof DesignSettings>;