@wix/cli-app 1.1.32 → 1.1.34

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 (84) hide show
  1. package/build/CreateVersionCommand-3ECZI65A.js +4 -0
  2. package/build/{CreateVersionCommand-AKOX3F4R.js.map → CreateVersionCommand-3ECZI65A.js.map} +1 -1
  3. package/build/DevCommand-B7WYY2UQ.js +4 -0
  4. package/build/DevCommand-B7WYY2UQ.js.map +1 -0
  5. package/build/{GenerateCommand-57P6KOOM.js → GenerateCommand-CIO77YCS.js} +3 -3
  6. package/build/{GenerateCommand-57P6KOOM.js.map → GenerateCommand-CIO77YCS.js.map} +1 -1
  7. package/build/LogsCommand-VJ64MYDN.js +4 -0
  8. package/build/LogsCommand-VJ64MYDN.js.map +1 -0
  9. package/build/PreviewCommand-BZY2XOZN.js +4 -0
  10. package/build/ServeCommand-AEELDVFH.js +4 -0
  11. package/build/ServeCommand-AEELDVFH.js.map +1 -0
  12. package/build/{build-ISANKZIW.js → build-JVHXDZDD.js} +2 -2
  13. package/build/{chunk-DPW3BI3Y.js → chunk-2KPKOJPE.js} +2 -2
  14. package/build/chunk-35SQ77PW.js +4 -0
  15. package/build/chunk-35SQ77PW.js.map +1 -0
  16. package/build/{chunk-ZSNZ62EG.js → chunk-COIDN4V4.js} +2 -2
  17. package/build/{chunk-K5V5YWVI.js → chunk-E6MYDYCH.js} +2 -2
  18. package/build/{chunk-6PKE6DT4.js → chunk-F4LXYTO3.js} +2 -2
  19. package/build/chunk-F4YTZ6XA.js +116 -0
  20. package/build/{chunk-NXQAYU44.js.map → chunk-F4YTZ6XA.js.map} +1 -1
  21. package/build/{chunk-KWUMJ6JQ.js → chunk-F55KYUXJ.js} +2 -2
  22. package/build/{chunk-ZRKMSAZQ.js → chunk-FBYP5GID.js} +2 -2
  23. package/build/{chunk-BOQ3NCXF.js → chunk-HTO6ALNX.js} +2 -2
  24. package/build/{chunk-BOQ3NCXF.js.map → chunk-HTO6ALNX.js.map} +1 -1
  25. package/build/{chunk-EI7JLTNP.js → chunk-HTY6QIPX.js} +2 -2
  26. package/build/{chunk-ARPIRV47.js → chunk-JAY5356K.js} +2 -2
  27. package/build/{chunk-H2U4YHRN.js → chunk-JKG4PFVP.js} +2 -2
  28. package/build/{chunk-J5ANBYWF.js → chunk-KQOYEWON.js} +4 -4
  29. package/build/chunk-KQOYEWON.js.map +1 -0
  30. package/build/{chunk-DRRMAC33.js → chunk-MB65UVFQ.js} +28 -28
  31. package/build/chunk-MB65UVFQ.js.map +1 -0
  32. package/build/chunk-MKVAJTCF.js +4 -0
  33. package/build/chunk-MKVAJTCF.js.map +1 -0
  34. package/build/{chunk-MRVGH2GQ.js → chunk-MON4UIEH.js} +2 -2
  35. package/build/chunk-QTYWYBN3.js +4 -0
  36. package/build/chunk-QTYWYBN3.js.map +1 -0
  37. package/build/{chunk-W2OGV6HU.js → chunk-ROZV4SHP.js} +2 -2
  38. package/build/chunk-X62VPDUS.js +4 -0
  39. package/build/{chunk-VQJRKVSE.js → chunk-XUF2HJAT.js} +2 -2
  40. package/build/{chunk-VQJRKVSE.js.map → chunk-XUF2HJAT.js.map} +1 -1
  41. package/build/index.js +2 -2
  42. package/build/index.js.map +1 -1
  43. package/build/{preview-ABI3GMT6.js → preview-L5LDZK2L.js} +2 -2
  44. package/build/render-command-IA3LLA3F.js +4 -0
  45. package/build/render-command-IA3LLA3F.js.map +1 -0
  46. package/package.json +6 -6
  47. package/templates/dashboard-plugin/files/plugin.tsx.ejs +11 -0
  48. package/build/CreateVersionCommand-AKOX3F4R.js +0 -4
  49. package/build/DevCommand-CVMI3OND.js +0 -4
  50. package/build/DevCommand-CVMI3OND.js.map +0 -1
  51. package/build/LogsCommand-P5LW5VOI.js +0 -4
  52. package/build/LogsCommand-P5LW5VOI.js.map +0 -1
  53. package/build/PreviewCommand-AXFQVFBV.js +0 -4
  54. package/build/ServeCommand-CEFAI6Z4.js +0 -4
  55. package/build/ServeCommand-CEFAI6Z4.js.map +0 -1
  56. package/build/chunk-A5N3P734.js +0 -4
  57. package/build/chunk-A5N3P734.js.map +0 -1
  58. package/build/chunk-DRRMAC33.js.map +0 -1
  59. package/build/chunk-J5ANBYWF.js.map +0 -1
  60. package/build/chunk-LE2AC3SJ.js +0 -4
  61. package/build/chunk-MDC42U33.js +0 -4
  62. package/build/chunk-MDC42U33.js.map +0 -1
  63. package/build/chunk-NXQAYU44.js +0 -116
  64. package/build/chunk-QZS4ARDD.js +0 -4
  65. package/build/chunk-QZS4ARDD.js.map +0 -1
  66. package/build/chunk-RPI6ANLU.js +0 -4
  67. package/build/chunk-RPI6ANLU.js.map +0 -1
  68. package/build/render-command-F4KJL2DD.js +0 -4
  69. package/build/render-command-F4KJL2DD.js.map +0 -1
  70. /package/build/{PreviewCommand-AXFQVFBV.js.map → PreviewCommand-BZY2XOZN.js.map} +0 -0
  71. /package/build/{build-ISANKZIW.js.map → build-JVHXDZDD.js.map} +0 -0
  72. /package/build/{chunk-DPW3BI3Y.js.map → chunk-2KPKOJPE.js.map} +0 -0
  73. /package/build/{chunk-ZSNZ62EG.js.map → chunk-COIDN4V4.js.map} +0 -0
  74. /package/build/{chunk-K5V5YWVI.js.map → chunk-E6MYDYCH.js.map} +0 -0
  75. /package/build/{chunk-6PKE6DT4.js.map → chunk-F4LXYTO3.js.map} +0 -0
  76. /package/build/{chunk-KWUMJ6JQ.js.map → chunk-F55KYUXJ.js.map} +0 -0
  77. /package/build/{chunk-ZRKMSAZQ.js.map → chunk-FBYP5GID.js.map} +0 -0
  78. /package/build/{chunk-EI7JLTNP.js.map → chunk-HTY6QIPX.js.map} +0 -0
  79. /package/build/{chunk-ARPIRV47.js.map → chunk-JAY5356K.js.map} +0 -0
  80. /package/build/{chunk-H2U4YHRN.js.map → chunk-JKG4PFVP.js.map} +0 -0
  81. /package/build/{chunk-MRVGH2GQ.js.map → chunk-MON4UIEH.js.map} +0 -0
  82. /package/build/{chunk-W2OGV6HU.js.map → chunk-ROZV4SHP.js.map} +0 -0
  83. /package/build/{chunk-LE2AC3SJ.js.map → chunk-X62VPDUS.js.map} +0 -0
  84. /package/build/{preview-ABI3GMT6.js.map → preview-L5LDZK2L.js.map} +0 -0
@@ -1,4 +1,4 @@
1
1
  import { createRequire as _createRequire } from 'node:module';
2
2
  const require = _createRequire(import.meta.url);
3
- import{H as o,I as u,J as h,K as m,L as p,M as N,P as f,Q as E}from"./chunk-NXQAYU44.js";import{l as e}from"./chunk-DRRMAC33.js";import{h as S}from"./chunk-V4TR6DCM.js";S();import C from"node:fs/promises";var g=e.object({errorReporting:e.object({url:e.string().optional(),artifact:e.object({fullArtifactId:e.string().max(255).min(1),version:e.string().max(255).min(1)}).optional()}).optional()}),d=e.object({iframeUrl:e.string().optional(),scriptAsset:e.object({exportedName:e.string(),containerId:e.string(),url:e.string(),scriptType:e.string().optional()}).optional()}),_=e.object({hostingPlatform:e.string(),fullPage:e.boolean().nullish(),hideInSidebar:e.boolean().nullish(),priority:e.number().nullish(),routePath:e.string().nullish(),title:e.string(),pageCategoryId:e.string().uuid().nullish(),activeSidebarPageId:e.string().nullish(),requiredPermission:e.string().nullish(),previousRoutePaths:e.array(e.string()).nullish()}).merge(g).merge(d).passthrough(),j=e.object({width:e.number().nullish(),height:e.number().nullish()}).merge(d).passthrough(),b=e.object({appId:e.string(),componentId:e.string().uuid(),spec:e.string().min(1),variantValue:e.string()}).passthrough().optional(),y=e.object({compId:e.string(),compType:e.literal(o.BACK_OFFICE_PAGE),compData:e.object({backOfficePage:_}),compName:e.string().optional(),experiment:b}).passthrough(),A=e.object({compId:e.string(),compType:e.literal(o.BACK_OFFICE_EXTENSION),compData:e.object({backOfficeExtension:e.object({hostingPlatform:e.string(),extends:e.string(),title:e.string().nullish(),extensionType:e.literal(N.BACK_OFFICE_EXTENSION_WIDGET),requiredPermission:e.string().nullish(),widget:j}).merge(g).passthrough()}),compName:e.string().optional(),experiment:b}).passthrough(),D=e.object({compId:e.string(),compType:e.literal(o.BACK_OFFICE_EXTENSION_WIDGET),compData:e.object({backOfficeExtensionWidget:e.object({hostingPlatform:e.string(),extends:e.string(),title:e.string().nullish(),description:e.string().optional(),requiredPermission:e.string().nullish(),width:e.number().nullish(),height:e.number().nullish()}).merge(d).merge(g).passthrough()}),compName:e.string().optional(),experiment:b}).passthrough(),v=e.object({compId:e.string(),compType:e.literal(o.BACK_OFFICE_EXTENSION_MENU_ITEM),compData:e.object({backOfficeExtensionMenuItem:e.object({id:e.string().uuid(),title:e.string().min(1),subtitle:e.string().max(200).optional(),iconKey:e.string().min(3).max(50).optional(),extends:e.string().uuid(),action:e.object({navigateToPage:e.object({pageId:e.string().uuid(),relativeUrl:e.string().optional()}),openModal:e.object({componentId:e.string().uuid(),componentParams:e.record(e.string().min(1),e.string().min(1)).optional()})}).partial().superRefine((r,i)=>{!r.navigateToPage&&!r.openModal&&i.addIssue({code:e.ZodIssueCode.custom,message:"action must have either navigateToPage or openModal"})}),sentryDSN:e.string().optional(),requiredPermission:e.string().optional()}).merge(d).merge(g).passthrough()}),compName:e.string().optional(),experiment:b}).passthrough(),k=e.object({compId:e.string(),compType:e.literal(o.BACK_OFFICE_MODAL),compData:e.object({backOfficeModal:e.object({hostingPlatform:e.string(),title:e.string().nullish(),requiredPermission:e.string().nullish(),width:e.number().nullish(),height:e.number().nullish()}).merge(d).merge(g).passthrough()}),compName:e.string().optional(),experiment:b}).passthrough(),P=e.object({compId:e.string(),compType:e.literal(o.BACK_OFFICE_SIDEBAR_CATEGORY),compData:e.object({backOfficeSidebarCategory:e.object({hostingPlatform:e.string(),title:e.string(),priority:e.number().nullish()})}),compName:e.string().optional()}).passthrough(),F=e.object({compId:e.string(),compType:e.literal(o.BACK_OFFICE_WIDGET),compName:e.string().optional()}).passthrough(),x=e.object({compId:e.string(),compType:e.literal(o.BACK_OFFICE_EXTENSION_CONTAINER),compName:e.string().optional()}).passthrough(),T=e.object({packageName:e.string().min(2).max(100),version:e.number().int().min(0)}),M=e.object({template:e.string(),name:e.string(),pages:e.enum([h.NONE_PAGES,h.ONCE,h.SPECIFIC_PAGES]),placement:e.enum([m.HEAD,m.BODY_START,m.BODY_END,m.NONE_PLACEMENT]),connectArticleUrl:e.string(),embedCategory:e.enum([p.UNKNOWN,p.FUNCTIONAL,p.ESSENTIAL,p.ANALYTICS,p.ADVERTISING]),loadOnce:e.boolean(),allowedForFreeSite:e.boolean(),dependencies:e.array(T)}),W=e.object({compId:e.string(),compType:e.literal(o.EMBEDDED_SCRIPT),compName:e.string().optional(),compData:e.object({embeddedScriptComponentData:M})}).passthrough(),U=e.object({base:e.object({id:e.string().optional(),name:e.string()}),installation:e.object({base:e.object({autoAdd:e.boolean().optional(),essential:e.boolean().optional(),maxInstances:e.number().optional()}).optional(),widget:e.object({default_preset:e.object({desktop_preset_id:e.string().optional(),tablet_preset_id:e.string().optional(),mobile_preset_id:e.string().optional()}).optional(),region:e.enum([u.BODY,u.FOOTER,u.HEADER])}).optional()}).optional(),widgetData:e.object({tagName:e.string(),scriptUrl:e.string(),scriptType:e.enum([f.NONE,f.COMMON_JS,f.ES_MODULE])}),behaviors:e.object({settings:e.object({settingsUrl:e.string()}).optional(),dashboard:e.object({dashboardPageComponentId:e.string()}).optional()}),size:e.object({width:e.object({allowStretch:e.boolean().optional(),defaultWidth:e.number().optional(),stretchByDefault:e.boolean().optional()}),height:e.object({defaultHeight:e.number(),heightMode:e.enum([E.AUTO,E.FIXED,E.UNKNOWN]).optional()})}),dependencies:e.array(T)}),w=e.object({compId:e.string(),compType:e.literal(o.CUSTOM_ELEMENT_WIDGET),compName:e.string().optional(),compData:e.object({customElementWidget:U})}).passthrough(),B=e.object({compId:e.string().uuid(),compType:e.literal(o.WEBHOOK),compName:e.string().optional(),compData:e.object({webhook:e.object({webhookSlug:e.string(),callbackUrl:e.string()})})}).passthrough(),R=e.object({compType:e.literal(o.TOPOLOGY),compId:e.string(),compName:e.string().optional(),compData:e.object({topology:e.object({topology:e.object({backendApiUrl:e.string().url()})})})}).passthrough(),K=e.object({appId:e.string(),components:e.array(e.discriminatedUnion("compType",[y,A,D,v,k,P,F,x,W,w,B,R]))});async function $(r){try{let i=await C.readFile(r,"utf-8");return K.parse(JSON.parse(i))}catch(i){let n=i instanceof Error?i.toString():JSON.stringify(i);throw new Error(`Failed to read App Manifest at ${r}: ${n}`)}}var I=(r,i)=>new URL(r,i).href,O=(r,i)=>{let{scriptAsset:n,iframeUrl:s}=r;return n?{scriptAsset:{...n,url:I(n.url,i)}}:s?{iframeUrl:I(s,i)}:r},L=(r,i)=>({template:r.template.replaceAll("__STATICS_BASE_URL_PLACEHOLDER__",i)}),z=(r,i,n)=>{let s=JSON.parse(JSON.stringify(r)),a=i.endsWith("/")?i:`${i}/`;return s.components.forEach(l=>{let{compData:t,compType:c}=l;c===o.BACK_OFFICE_PAGE&&(t.backOfficePage={...t.backOfficePage,...O(t.backOfficePage,a)}),c===o.BACK_OFFICE_EXTENSION&&(t.backOfficeExtension.widget={...t.backOfficeExtension.widget,...O(t.backOfficeExtension.widget,a)}),c===o.BACK_OFFICE_EXTENSION_WIDGET&&(t.backOfficeExtensionWidget={...t.backOfficeExtensionWidget,...O(t.backOfficeExtensionWidget,a)}),c===o.BACK_OFFICE_MODAL&&(t.backOfficeModal={...t.backOfficeModal,...O(t.backOfficeModal,a)}),c===o.EMBEDDED_SCRIPT&&(t.embeddedScriptComponentData={...t.embeddedScriptComponentData,...L(t.embeddedScriptComponentData,a)}),c===o.CUSTOM_ELEMENT_WIDGET&&(t.customElementWidget={...t.customElementWidget,widgetData:{...t.customElementWidget.widgetData,scriptUrl:I(t.customElementWidget.widgetData.scriptUrl,a)},behaviors:{...t.customElementWidget.behaviors,...t.customElementWidget.behaviors.settings?{settings:{settingsUrl:I(t.customElementWidget.behaviors.settings.settingsUrl,a)}}:{}}}),c===o.WEBHOOK&&n&&(t.webhook={...t.webhook,callbackUrl:`${n}/webhooks`})}),s},Z=(r,i)=>{let{baseApiUrl:n,id:s}=i;if(!s&&!n)return r;let a=JSON.parse(JSON.stringify(r));return a.components.forEach(l=>{l.compType===o.TOPOLOGY&&(s&&(l.compId=s),n&&(l.compData.topology.topology.backendApiUrl=n))}),a};export{$ as a,z as b,Z as c};
4
- //# sourceMappingURL=chunk-KWUMJ6JQ.js.map
3
+ import{H as o,I as u,J as h,K as m,L as p,M as N,P as f,Q as E}from"./chunk-F4YTZ6XA.js";import{l as e}from"./chunk-MB65UVFQ.js";import{h as S}from"./chunk-V4TR6DCM.js";S();import C from"node:fs/promises";var g=e.object({errorReporting:e.object({url:e.string().optional(),artifact:e.object({fullArtifactId:e.string().max(255).min(1),version:e.string().max(255).min(1)}).optional()}).optional()}),d=e.object({iframeUrl:e.string().optional(),scriptAsset:e.object({exportedName:e.string(),containerId:e.string(),url:e.string(),scriptType:e.string().optional()}).optional()}),_=e.object({hostingPlatform:e.string(),fullPage:e.boolean().nullish(),hideInSidebar:e.boolean().nullish(),priority:e.number().nullish(),routePath:e.string().nullish(),title:e.string(),pageCategoryId:e.string().uuid().nullish(),activeSidebarPageId:e.string().nullish(),requiredPermission:e.string().nullish(),previousRoutePaths:e.array(e.string()).nullish()}).merge(g).merge(d).passthrough(),j=e.object({width:e.number().nullish(),height:e.number().nullish()}).merge(d).passthrough(),b=e.object({appId:e.string(),componentId:e.string().uuid(),spec:e.string().min(1),variantValue:e.string()}).passthrough().optional(),y=e.object({compId:e.string(),compType:e.literal(o.BACK_OFFICE_PAGE),compData:e.object({backOfficePage:_}),compName:e.string().optional(),experiment:b}).passthrough(),A=e.object({compId:e.string(),compType:e.literal(o.BACK_OFFICE_EXTENSION),compData:e.object({backOfficeExtension:e.object({hostingPlatform:e.string(),extends:e.string(),title:e.string().nullish(),extensionType:e.literal(N.BACK_OFFICE_EXTENSION_WIDGET),requiredPermission:e.string().nullish(),widget:j}).merge(g).passthrough()}),compName:e.string().optional(),experiment:b}).passthrough(),D=e.object({compId:e.string(),compType:e.literal(o.BACK_OFFICE_EXTENSION_WIDGET),compData:e.object({backOfficeExtensionWidget:e.object({hostingPlatform:e.string(),extends:e.string(),title:e.string().nullish(),description:e.string().optional(),requiredPermission:e.string().nullish(),width:e.number().nullish(),height:e.number().nullish()}).merge(d).merge(g).passthrough()}),compName:e.string().optional(),experiment:b}).passthrough(),v=e.object({compId:e.string(),compType:e.literal(o.BACK_OFFICE_EXTENSION_MENU_ITEM),compData:e.object({backOfficeExtensionMenuItem:e.object({id:e.string().uuid(),title:e.string().min(1),subtitle:e.string().max(200).optional(),iconKey:e.string().min(3).max(50).optional(),extends:e.string().uuid(),action:e.object({navigateToPage:e.object({pageId:e.string().uuid(),relativeUrl:e.string().optional()}),openModal:e.object({componentId:e.string().uuid(),componentParams:e.record(e.string().min(1),e.string().min(1)).optional()})}).partial().superRefine((r,i)=>{!r.navigateToPage&&!r.openModal&&i.addIssue({code:e.ZodIssueCode.custom,message:"action must have either navigateToPage or openModal"})}),sentryDSN:e.string().optional(),requiredPermission:e.string().optional()}).merge(d).merge(g).passthrough()}),compName:e.string().optional(),experiment:b}).passthrough(),k=e.object({compId:e.string(),compType:e.literal(o.BACK_OFFICE_MODAL),compData:e.object({backOfficeModal:e.object({hostingPlatform:e.string(),title:e.string().nullish(),requiredPermission:e.string().nullish(),width:e.number().nullish(),height:e.number().nullish()}).merge(d).merge(g).passthrough()}),compName:e.string().optional(),experiment:b}).passthrough(),P=e.object({compId:e.string(),compType:e.literal(o.BACK_OFFICE_SIDEBAR_CATEGORY),compData:e.object({backOfficeSidebarCategory:e.object({hostingPlatform:e.string(),title:e.string(),priority:e.number().nullish()})}),compName:e.string().optional()}).passthrough(),F=e.object({compId:e.string(),compType:e.literal(o.BACK_OFFICE_WIDGET),compName:e.string().optional()}).passthrough(),x=e.object({compId:e.string(),compType:e.literal(o.BACK_OFFICE_EXTENSION_CONTAINER),compName:e.string().optional()}).passthrough(),T=e.object({packageName:e.string().min(2).max(100),version:e.number().int().min(0)}),M=e.object({template:e.string(),name:e.string(),pages:e.enum([h.NONE_PAGES,h.ONCE,h.SPECIFIC_PAGES]),placement:e.enum([m.HEAD,m.BODY_START,m.BODY_END,m.NONE_PLACEMENT]),connectArticleUrl:e.string(),embedCategory:e.enum([p.UNKNOWN,p.FUNCTIONAL,p.ESSENTIAL,p.ANALYTICS,p.ADVERTISING]),loadOnce:e.boolean(),allowedForFreeSite:e.boolean(),dependencies:e.array(T)}),W=e.object({compId:e.string(),compType:e.literal(o.EMBEDDED_SCRIPT),compName:e.string().optional(),compData:e.object({embeddedScriptComponentData:M})}).passthrough(),U=e.object({base:e.object({id:e.string().optional(),name:e.string()}),installation:e.object({base:e.object({autoAdd:e.boolean().optional(),essential:e.boolean().optional(),maxInstances:e.number().optional()}).optional(),widget:e.object({default_preset:e.object({desktop_preset_id:e.string().optional(),tablet_preset_id:e.string().optional(),mobile_preset_id:e.string().optional()}).optional(),region:e.enum([u.BODY,u.FOOTER,u.HEADER])}).optional()}).optional(),widgetData:e.object({tagName:e.string(),scriptUrl:e.string(),scriptType:e.enum([f.NONE,f.COMMON_JS,f.ES_MODULE])}),behaviors:e.object({settings:e.object({settingsUrl:e.string()}).optional(),dashboard:e.object({dashboardPageComponentId:e.string()}).optional()}),size:e.object({width:e.object({allowStretch:e.boolean().optional(),defaultWidth:e.number().optional(),stretchByDefault:e.boolean().optional()}),height:e.object({defaultHeight:e.number(),heightMode:e.enum([E.AUTO,E.FIXED,E.UNKNOWN]).optional()})}),dependencies:e.array(T)}),w=e.object({compId:e.string(),compType:e.literal(o.CUSTOM_ELEMENT_WIDGET),compName:e.string().optional(),compData:e.object({customElementWidget:U})}).passthrough(),B=e.object({compId:e.string().uuid(),compType:e.literal(o.WEBHOOK),compName:e.string().optional(),compData:e.object({webhook:e.object({webhookSlug:e.string(),callbackUrl:e.string()})})}).passthrough(),R=e.object({compType:e.literal(o.TOPOLOGY),compId:e.string(),compName:e.string().optional(),compData:e.object({topology:e.object({topology:e.object({backendApiUrl:e.string().url()})})})}).passthrough(),K=e.object({appId:e.string(),components:e.array(e.discriminatedUnion("compType",[y,A,D,v,k,P,F,x,W,w,B,R]))});async function $(r){try{let i=await C.readFile(r,"utf-8");return K.parse(JSON.parse(i))}catch(i){let n=i instanceof Error?i.toString():JSON.stringify(i);throw new Error(`Failed to read App Manifest at ${r}: ${n}`)}}var I=(r,i)=>new URL(r,i).href,O=(r,i)=>{let{scriptAsset:n,iframeUrl:s}=r;return n?{scriptAsset:{...n,url:I(n.url,i)}}:s?{iframeUrl:I(s,i)}:r},L=(r,i)=>({template:r.template.replaceAll("__STATICS_BASE_URL_PLACEHOLDER__",i)}),z=(r,i,n)=>{let s=JSON.parse(JSON.stringify(r)),a=i.endsWith("/")?i:`${i}/`;return s.components.forEach(l=>{let{compData:t,compType:c}=l;c===o.BACK_OFFICE_PAGE&&(t.backOfficePage={...t.backOfficePage,...O(t.backOfficePage,a)}),c===o.BACK_OFFICE_EXTENSION&&(t.backOfficeExtension.widget={...t.backOfficeExtension.widget,...O(t.backOfficeExtension.widget,a)}),c===o.BACK_OFFICE_EXTENSION_WIDGET&&(t.backOfficeExtensionWidget={...t.backOfficeExtensionWidget,...O(t.backOfficeExtensionWidget,a)}),c===o.BACK_OFFICE_MODAL&&(t.backOfficeModal={...t.backOfficeModal,...O(t.backOfficeModal,a)}),c===o.EMBEDDED_SCRIPT&&(t.embeddedScriptComponentData={...t.embeddedScriptComponentData,...L(t.embeddedScriptComponentData,a)}),c===o.CUSTOM_ELEMENT_WIDGET&&(t.customElementWidget={...t.customElementWidget,widgetData:{...t.customElementWidget.widgetData,scriptUrl:I(t.customElementWidget.widgetData.scriptUrl,a)},behaviors:{...t.customElementWidget.behaviors,...t.customElementWidget.behaviors.settings?{settings:{settingsUrl:I(t.customElementWidget.behaviors.settings.settingsUrl,a)}}:{}}}),c===o.WEBHOOK&&n&&(t.webhook={...t.webhook,callbackUrl:`${n}/webhooks`})}),s},Z=(r,i)=>{let{baseApiUrl:n,id:s}=i;if(!s&&!n)return r;let a=JSON.parse(JSON.stringify(r));return a.components.forEach(l=>{l.compType===o.TOPOLOGY&&(s&&(l.compId=s),n&&(l.compData.topology.topology.backendApiUrl=n))}),a};export{$ as a,z as b,Z as c};
4
+ //# sourceMappingURL=chunk-F55KYUXJ.js.map
@@ -1,10 +1,10 @@
1
1
  import { createRequire as _createRequire } from 'node:module';
2
2
  const require = _createRequire(import.meta.url);
3
- import{Ca as Te,Da as Ce,Fa as Ot,Ja as Pt,a as ve,b as wt,c as bt,d as G,m as Et,u as vt}from"./chunk-NXQAYU44.js";import{a as Vn,d as Oe,e as Pe,l as F,m as te}from"./chunk-DRRMAC33.js";import{a as x,c as _,e as ee,g as f,h as s}from"./chunk-V4TR6DCM.js";var $t=_((ba,jt)=>{"use strict";s();jt.exports=Nt;Nt.sync=Kn;var Rt=x("fs");function Xn(e,t){var r=t.pathExt!==void 0?t.pathExt:process.env.PATHEXT;if(!r||(r=r.split(";"),r.indexOf("")!==-1))return!0;for(var n=0;n<r.length;n++){var o=r[n].toLowerCase();if(o&&e.substr(-o.length).toLowerCase()===o)return!0}return!1}function Lt(e,t,r){return!e.isSymbolicLink()&&!e.isFile()?!1:Xn(t,r)}function Nt(e,t,r){Rt.stat(e,function(n,o){r(n,n?!1:Lt(o,e,t))})}function Kn(e,t){return Lt(Rt.statSync(e),e,t)}});var Gt=_((va,Bt)=>{"use strict";s();Bt.exports=kt;kt.sync=Yn;var Dt=x("fs");function kt(e,t,r){Dt.stat(e,function(n,o){r(n,n?!1:Ut(o,t))})}function Yn(e,t){return Ut(Dt.statSync(e),t)}function Ut(e,t){return e.isFile()&&Zn(e,t)}function Zn(e,t){var r=e.mode,n=e.uid,o=e.gid,i=t.uid!==void 0?t.uid:process.getuid&&process.getuid(),a=t.gid!==void 0?t.gid:process.getgid&&process.getgid(),c=parseInt("100",8),l=parseInt("010",8),p=parseInt("001",8),u=c|l,h=r&p||r&l&&o===a||r&c&&n===i||r&u&&i===0;return h}});var Mt=_((Ta,Ft)=>{"use strict";s();var Pa=x("fs"),ne;process.platform==="win32"||global.TESTING_WINDOWS?ne=$t():ne=Gt();Ft.exports=Ie;Ie.sync=Qn;function Ie(e,t,r){if(typeof t=="function"&&(r=t,t={}),!r){if(typeof Promise!="function")throw new TypeError("callback not provided");return new Promise(function(n,o){Ie(e,t||{},function(i,a){i?o(i):n(a)})})}ne(e,t||{},function(n,o){n&&(n.code==="EACCES"||t&&t.ignoreErrors)&&(n=null,o=!1),r(n,o)})}function Qn(e,t){try{return ne.sync(e,t||{})}catch(r){if(t&&t.ignoreErrors||r.code==="EACCES")return!1;throw r}}});var Xt=_((Ia,Jt)=>{"use strict";s();var j=process.platform==="win32"||process.env.OSTYPE==="cygwin"||process.env.OSTYPE==="msys",qt=x("path"),eo=j?";":":",Vt=Mt(),zt=e=>Object.assign(new Error(`not found: ${e}`),{code:"ENOENT"}),Ht=(e,t)=>{let r=t.colon||eo,n=e.match(/\//)||j&&e.match(/\\/)?[""]:[...j?[process.cwd()]:[],...(t.path||process.env.PATH||"").split(r)],o=j?t.pathExt||process.env.PATHEXT||".EXE;.CMD;.BAT;.COM":"",i=j?o.split(r):[""];return j&&e.indexOf(".")!==-1&&i[0]!==""&&i.unshift(""),{pathEnv:n,pathExt:i,pathExtExe:o}},Wt=(e,t,r)=>{typeof t=="function"&&(r=t,t={}),t||(t={});let{pathEnv:n,pathExt:o,pathExtExe:i}=Ht(e,t),a=[],c=p=>new Promise((u,h)=>{if(p===n.length)return t.all&&a.length?u(a):h(zt(e));let m=n[p],g=/^".*"$/.test(m)?m.slice(1,-1):m,y=qt.join(g,e),b=!g&&/^\.[\\\/]/.test(e)?e.slice(0,2)+y:y;u(l(b,p,0))}),l=(p,u,h)=>new Promise((m,g)=>{if(h===o.length)return m(c(u+1));let y=o[h];Vt(p+y,{pathExt:i},(b,E)=>{if(!b&&E)if(t.all)a.push(p+y);else return m(p+y);return m(l(p,u,h+1))})});return r?c(0).then(p=>r(null,p),r):c(0)},to=(e,t)=>{t=t||{};let{pathEnv:r,pathExt:n,pathExtExe:o}=Ht(e,t),i=[];for(let a=0;a<r.length;a++){let c=r[a],l=/^".*"$/.test(c)?c.slice(1,-1):c,p=qt.join(l,e),u=!l&&/^\.[\\\/]/.test(e)?e.slice(0,2)+p:p;for(let h=0;h<n.length;h++){let m=u+n[h];try{if(Vt.sync(m,{pathExt:o}))if(t.all)i.push(m);else return m}catch{}}}if(t.all&&i.length)return i;if(t.nothrow)return null;throw zt(e)};Jt.exports=Wt;Wt.sync=to});var Yt=_((Ra,Ae)=>{"use strict";s();var Kt=(e={})=>{let t=e.env||process.env;return(e.platform||process.platform)!=="win32"?"PATH":Object.keys(t).reverse().find(n=>n.toUpperCase()==="PATH")||"Path"};Ae.exports=Kt;Ae.exports.default=Kt});var tr=_((Na,er)=>{"use strict";s();var Zt=x("path"),ro=Xt(),no=Yt();function Qt(e,t){let r=e.options.env||process.env,n=process.cwd(),o=e.options.cwd!=null,i=o&&process.chdir!==void 0&&!process.chdir.disabled;if(i)try{process.chdir(e.options.cwd)}catch{}let a;try{a=ro.sync(e.command,{path:r[no({env:r})],pathExt:t?Zt.delimiter:void 0})}catch{}finally{i&&process.chdir(n)}return a&&(a=Zt.resolve(o?e.options.cwd:"",a)),a}function oo(e){return Qt(e)||Qt(e,!0)}er.exports=oo});var rr=_(($a,Le)=>{"use strict";s();var Re=/([()\][%!^"`<>&|;, *?])/g;function io(e){return e=e.replace(Re,"^$1"),e}function so(e,t){return e=`${e}`,e=e.replace(/(\\*)"/g,'$1$1\\"'),e=e.replace(/(\\*)$/,"$1$1"),e=`"${e}"`,e=e.replace(Re,"^$1"),t&&(e=e.replace(Re,"^$1")),e}Le.exports.command=io;Le.exports.argument=so});var or=_((ka,nr)=>{"use strict";s();nr.exports=/^#!(.*)/});var sr=_((Ba,ir)=>{"use strict";s();var ao=or();ir.exports=(e="")=>{let t=e.match(ao);if(!t)return null;let[r,n]=t[0].replace(/#! ?/,"").split(" "),o=r.split("/").pop();return o==="env"?n:n?`${o} ${n}`:o}});var cr=_((Fa,ar)=>{"use strict";s();var Ne=x("fs"),co=sr();function lo(e){let r=Buffer.alloc(150),n;try{n=Ne.openSync(e,"r"),Ne.readSync(n,r,0,150,0),Ne.closeSync(n)}catch{}return co(r.toString())}ar.exports=lo});var dr=_((qa,fr)=>{"use strict";s();var uo=x("path"),lr=tr(),ur=rr(),fo=cr(),po=process.platform==="win32",mo=/\.(?:com|exe)$/i,ho=/node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;function go(e){e.file=lr(e);let t=e.file&&fo(e.file);return t?(e.args.unshift(e.file),e.command=t,lr(e)):e.file}function yo(e){if(!po)return e;let t=go(e),r=!mo.test(t);if(e.options.forceShell||r){let n=ho.test(t);e.command=uo.normalize(e.command),e.command=ur.command(e.command),e.args=e.args.map(i=>ur.argument(i,n));let o=[e.command].concat(e.args).join(" ");e.args=["/d","/s","/c",`"${o}"`],e.command=process.env.comspec||"cmd.exe",e.options.windowsVerbatimArguments=!0}return e}function _o(e,t,r){t&&!Array.isArray(t)&&(r=t,t=null),t=t?t.slice(0):[],r=Object.assign({},r);let n={command:e,args:t,options:r,file:void 0,original:{command:e,args:t}};return r.shell?n:yo(n)}fr.exports=_o});var hr=_((za,mr)=>{"use strict";s();var je=process.platform==="win32";function $e(e,t){return Object.assign(new Error(`${t} ${e.command} ENOENT`),{code:"ENOENT",errno:"ENOENT",syscall:`${t} ${e.command}`,path:e.command,spawnargs:e.args})}function xo(e,t){if(!je)return;let r=e.emit;e.emit=function(n,o){if(n==="exit"){let i=pr(o,t,"spawn");if(i)return r.call(e,"error",i)}return r.apply(e,arguments)}}function pr(e,t){return je&&e===1&&!t.file?$e(t.original,"spawn"):null}function So(e,t){return je&&e===1&&!t.file?$e(t.original,"spawnSync"):null}mr.exports={hookChildProcess:xo,verifyENOENT:pr,verifyENOENTSync:So,notFoundError:$e}});var _r=_((Wa,$)=>{"use strict";s();var gr=x("child_process"),De=dr(),ke=hr();function yr(e,t,r){let n=De(e,t,r),o=gr.spawn(n.command,n.args,n.options);return ke.hookChildProcess(o,n),o}function wo(e,t,r){let n=De(e,t,r),o=gr.spawnSync(n.command,n.args,n.options);return o.error=o.error||ke.verifyENOENTSync(o.status,n),o}$.exports=yr;$.exports.spawn=yr;$.exports.sync=wo;$.exports._parse=De;$.exports._enoent=ke});var zr=_((xl,Vr)=>{"use strict";s();var{PassThrough:_i}=x("stream");Vr.exports=function(){var e=[],t=new _i({objectMode:!0});return t.setMaxListeners(0),t.add=r,t.isEmpty=n,t.on("unpipe",o),Array.prototype.slice.call(arguments).forEach(r),t;function r(i){return Array.isArray(i)?(i.forEach(r),this):(e.push(i),i.once("end",o.bind(null,i)),i.once("error",t.emit.bind(t,"error")),i.pipe(t,{end:!1}),this)}function n(){return e.length==0}function o(i){e=e.filter(function(a){return a!==i}),!e.length&&t.readable&&t.end()}}});var H=_((nu,dn)=>{"use strict";s();var Mi=Object.create,_e=Object.defineProperty,qi=Object.getOwnPropertyDescriptor,Vi=Object.getOwnPropertyNames,zi=Object.getPrototypeOf,Hi=Object.prototype.hasOwnProperty,Wi=(e,t)=>{for(var r in t)_e(e,r,{get:t[r],enumerable:!0})},cn=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of Vi(t))!Hi.call(e,o)&&o!==r&&_e(e,o,{get:()=>t[o],enumerable:!(n=qi(t,o))||n.enumerable});return e},Ji=(e,t,r)=>(r=e!=null?Mi(zi(e)):{},cn(t||!e||!e.__esModule?_e(r,"default",{value:e,enumerable:!0}):r,e)),Xi=e=>cn(_e({},"__esModule",{value:!0}),e),ln={};Wi(ln,{CLOUDFLARED_VERSION:()=>Zi,DEFAULT_CLOUDFLARED_BIN:()=>un,RELEASE_BASE:()=>Qi,bin:()=>fn,use:()=>Yi});dn.exports=Xi(ln);var Ki=Ji(x("node:path")),un=Ki.default.join(f,"..","bin",process.platform==="win32"?"cloudflared.exe":"cloudflared"),fn=process.env.CLOUDFLARED_BIN||un;function Yi(e){fn=e}var Zi=process.env.CLOUDFLARED_VERSION||"latest",Qi="https://github.com/cloudflare/cloudflared/releases/"});var hn=_((iu,mn)=>{"use strict";s();var ct=Object.defineProperty,es=Object.getOwnPropertyDescriptor,ts=Object.getOwnPropertyNames,rs=Object.prototype.hasOwnProperty,ns=(e,t)=>{for(var r in t)ct(e,r,{get:t[r],enumerable:!0})},os=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of ts(t))!rs.call(e,o)&&o!==r&&ct(e,o,{get:()=>t[o],enumerable:!(n=es(t,o))||n.enumerable});return e},is=e=>os(ct({},"__esModule",{value:!0}),e),pn={};ns(pn,{UnsupportedError:()=>at});mn.exports=is(pn);var at=class extends Error{constructor(t){super(t)}}});var bn=_((au,wn)=>{"use strict";s();var ss=Object.create,xe=Object.defineProperty,as=Object.getOwnPropertyDescriptor,cs=Object.getOwnPropertyNames,ls=Object.getPrototypeOf,us=Object.prototype.hasOwnProperty,fs=(e,t)=>{for(var r in t)xe(e,r,{get:t[r],enumerable:!0})},gn=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of cs(t))!us.call(e,o)&&o!==r&&xe(e,o,{get:()=>t[o],enumerable:!(n=as(t,o))||n.enumerable});return e},lt=(e,t,r)=>(r=e!=null?ss(ls(e)):{},gn(t||!e||!e.__esModule?xe(r,"default",{value:e,enumerable:!0}):r,e)),ds=e=>gn(xe({},"__esModule",{value:!0}),e),yn={};fs(yn,{install:()=>_s,install_linux:()=>_n,install_macos:()=>xn,install_windows:()=>Sn});wn.exports=ds(yn);var A=lt(x("node:fs")),W=lt(x("node:path")),ps=lt(x("node:https")),ms=x("node:child_process"),D=H(),Se=hn(),hs={arm64:"cloudflared-linux-arm64",arm:"cloudflared-linux-arm",x64:"cloudflared-linux-amd64",ia32:"cloudflared-linux-386"},gs={arm64:"cloudflared-darwin-amd64.tgz",x64:"cloudflared-darwin-amd64.tgz"},ys={x64:"cloudflared-windows-amd64.exe",ia32:"cloudflared-windows-386.exe"};function ut(e){return e==="latest"?`${D.RELEASE_BASE}latest/download/`:`${D.RELEASE_BASE}download/${e}/`}async function _s(e,t=D.CLOUDFLARED_VERSION){if(process.platform==="linux")return _n(e,t);if(process.platform==="darwin")return xn(e,t);if(process.platform==="win32")return Sn(e,t);throw new Se.UnsupportedError("Unsupported platform: "+process.platform)}async function _n(e,t=D.CLOUDFLARED_VERSION){let r=hs[process.arch];if(r===void 0)throw new Se.UnsupportedError("Unsupported architecture: "+process.arch);return await we(ut(t)+r,e),A.default.chmodSync(e,"755"),e}async function xn(e,t=D.CLOUDFLARED_VERSION){let r=gs[process.arch];if(r===void 0)throw new Se.UnsupportedError("Unsupported architecture: "+process.arch);return await we(ut(t)+r,`${e}.tgz`),process.env.VERBOSE&&console.log(`Extracting to ${e}`),(0,ms.execSync)(`tar -xzf ${W.default.basename(`${e}.tgz`)}`,{cwd:W.default.dirname(e)}),A.default.unlinkSync(`${e}.tgz`),A.default.renameSync(`${W.default.dirname(e)}/cloudflared`,e),e}async function Sn(e,t=D.CLOUDFLARED_VERSION){let r=ys[process.arch];if(r===void 0)throw new Se.UnsupportedError("Unsupported architecture: "+process.arch);return await we(ut(t)+r,e),e}function we(e,t,r=0){return r===0?process.env.VERBOSE&&console.log(`Downloading ${e} to ${t}`):process.env.VERBOSE&&console.log(`Redirecting to ${e}`),A.default.existsSync(W.default.dirname(t))||A.default.mkdirSync(W.default.dirname(t),{recursive:!0}),new Promise((n,o)=>{let i=ps.default.get(e,a=>{if([301,302,303,307,308].includes(a.statusCode)&&a.headers.location!==void 0){i.destroy();let l=a.headers.location;n(we(l,t,r+1));return}if(a.statusCode&&a.statusCode>=200&&a.statusCode<300){let l=A.default.createWriteStream(t);l.on("finish",()=>{l.close(()=>n(t))}),l.on("error",p=>{A.default.unlink(t,()=>o(p))}),a.pipe(l)}else i.destroy(),o(new Error(`HTTP response with status code: ${a.statusCode}`))});i.on("error",a=>{o(a)}),i.end()})}});var dt=_((lu,vn)=>{"use strict";s();var ft=Object.defineProperty,xs=Object.getOwnPropertyDescriptor,Ss=Object.getOwnPropertyNames,ws=Object.prototype.hasOwnProperty,bs=(e,t)=>{for(var r in t)ft(e,r,{get:t[r],enumerable:!0})},Es=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of Ss(t))!ws.call(e,o)&&o!==r&&ft(e,o,{get:()=>t[o],enumerable:!(n=xs(t,o))||n.enumerable});return e},vs=e=>Es(ft({},"__esModule",{value:!0}),e),En={};bs(En,{config_regex:()=>Ns,conn_regex:()=>Os,connectorID_regex:()=>Rs,disconnect_regex:()=>Is,index_regex:()=>Cs,ip_regex:()=>Ps,location_regex:()=>Ts,metrics_regex:()=>Ls,tunnelID_regex:()=>As});vn.exports=vs(En);var Os=/connection[= ]([0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[0-9a-f]{4}-[0-9a-f]{12})/i,Ps=/ip=([0-9.]+)/,Ts=/location=([A-Za-z0-9]+)/,Cs=/connIndex=(\d)/,Is=/Unregistered tunnel connection connIndex=(\d)/i,As=/tunnelID=([0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[0-9a-f]{4}-[0-9a-f]{12})/i,Rs=/Connector ID: ([0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[0-9a-f]{4}-[0-9a-f]{12})/i,Ls=/metrics server on ([0-9.:]+\/metrics)/,Ns=/config="(.+[^\\])"/});var Tn=_((fu,Pn)=>{"use strict";s();var pt=Object.defineProperty,js=Object.getOwnPropertyDescriptor,$s=Object.getOwnPropertyNames,Ds=Object.prototype.hasOwnProperty,ks=(e,t)=>{for(var r in t)pt(e,r,{get:t[r],enumerable:!0})},Us=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of $s(t))!Ds.call(e,o)&&o!==r&&pt(e,o,{get:()=>t[o],enumerable:!(n=js(t,o))||n.enumerable});return e},Bs=e=>Us(pt({},"__esModule",{value:!0}),e),On={};ks(On,{tunnel:()=>Ms});Pn.exports=Bs(On);var Gs=x("node:child_process"),Fs=H(),be=dt();function Ms(e={}){let t=["tunnel"];for(let[m,g]of Object.entries(e))typeof g=="string"?t.push(`${m}`,g):typeof g=="number"?t.push(`${m}`,g.toString()):g===null&&t.push(`${m}`);t.length===1&&t.push("--url","localhost:8080");let r=(0,Gs.spawn)(Fs.bin,t,{stdio:["ignore","pipe","pipe"]});process.env.VERBOSE&&(r.stdout.pipe(process.stdout),r.stderr.pipe(process.stderr));let n=/\|\s+(https?:\/\/[^\s]+)/,o=()=>{},i=()=>{},a=new Promise((...m)=>[o,i]=m),c=[],l=[],p=[];for(let m=0;m<1;m++)p.push(new Promise((...g)=>[c[m],l[m]]=g));let u=m=>{var g;let y=m.toString(),b=y.match(n);b&&o(b[1]);let E=y.match(be.conn_regex),P=y.match(be.ip_regex),T=y.match(be.location_regex),C=y.match(be.index_regex);if(E&&P&&T&&C){let[,K]=E,[,Y]=P,[,Z]=T,[,Q]=C;(g=c[+Q])==null||g.call(c,{id:K,ip:Y,location:Z})}};return r.stdout.on("data",u).on("error",i),r.stderr.on("data",u).on("error",i),{url:a,connections:p,child:r,stop:()=>r.kill("SIGINT")}}});var Un=_((pu,kn)=>{"use strict";s();var qs=Object.create,Ee=Object.defineProperty,Vs=Object.getOwnPropertyDescriptor,zs=Object.getOwnPropertyNames,Hs=Object.getPrototypeOf,Ws=Object.prototype.hasOwnProperty,Js=(e,t)=>{for(var r in t)Ee(e,r,{get:t[r],enumerable:!0})},Cn=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of zs(t))!Ws.call(e,o)&&o!==r&&Ee(e,o,{get:()=>t[o],enumerable:!(n=Vs(t,o))||n.enumerable});return e},In=(e,t,r)=>(r=e!=null?qs(Hs(e)):{},Cn(t||!e||!e.__esModule?Ee(r,"default",{value:e,enumerable:!0}):r,e)),Xs=e=>Cn(Ee({},"__esModule",{value:!0}),e),An={};Js(An,{AlreadyInstalledError:()=>J,LINUX_SERVICE_PATH:()=>L,MACOS_SERVICE_PATH:()=>v,NotInstalledError:()=>N,clean:()=>Dn,current:()=>$n,err:()=>_t,exists:()=>O,identifier:()=>R,install:()=>Ln,journal:()=>xt,log:()=>jn,service:()=>Ks,service_name:()=>yt,uninstall:()=>Nn});kn.exports=Xs(An);var mt=In(x("node:os")),w=In(x("node:fs")),gt=x("node:child_process"),Rn=H(),S=dt(),R="com.cloudflare.cloudflared",yt="cloudflared.service",v={PLIST:ht()?`/Library/LaunchDaemons/${R}.plist`:`${mt.default.homedir()}/Library/LaunchAgents/${R}.plist`,OUT:ht()?`/Library/Logs/${R}.out.log`:`${mt.default.homedir()}/Library/Logs/${R}.out.log`,ERR:ht()?`/Library/Logs/${R}.err.log`:`${mt.default.homedir()}/Library/Logs/${R}.err.log`},L={SYSTEMD:`/etc/systemd/system/${yt}`,SERVICE:"/etc/init.d/cloudflared",SERVICE_OUT:"/var/log/cloudflared.log",SERVICE_ERR:"/var/log/cloudflared.err"},Ks={install:Ln,uninstall:Nn,exists:O,log:jn,err:_t,current:$n,clean:Dn,journal:xt},J=class extends Error{constructor(){super("service is already installed")}},N=class extends Error{constructor(){super("service is not installed")}};function Ln(e){if(!["darwin","linux"].includes(process.platform))throw new Error(`Not Implemented on platform ${process.platform}`);if(O())throw new J;let t=["service","install"];e&&t.push(e);let r=(0,gt.spawnSync)(Rn.bin,t);if(r.status!==0)throw new Error(`service install failed: ${r.stderr.toString()}`)}function Nn(){if(!["darwin","linux"].includes(process.platform))throw new Error(`Not Implemented on platform ${process.platform}`);if(!O())throw new N;let e=(0,gt.spawnSync)(Rn.bin,["service","uninstall"]);if(e.status!==0)throw new Error(`service uninstall failed: ${e.stderr.toString()}`);process.platform==="darwin"?(w.default.rmSync(v.OUT),w.default.rmSync(v.ERR)):process.platform==="linux"&&!k()&&(w.default.rmSync(L.SERVICE_OUT),w.default.rmSync(L.SERVICE_ERR))}function jn(){if(!O())throw new N;if(process.platform==="darwin")return w.default.readFileSync(v.OUT,"utf8");if(process.platform==="linux"&&!k())return w.default.readFileSync(L.SERVICE_OUT,"utf8");throw new Error(`Not Implemented on platform ${process.platform}`)}function _t(){if(!O())throw new N;if(process.platform==="darwin")return w.default.readFileSync(v.ERR,"utf8");if(process.platform==="linux"&&!k())return w.default.readFileSync(L.SERVICE_ERR,"utf8");throw new Error(`Not Implemented on platform ${process.platform}`)}function xt(e=300){if(process.platform==="linux"&&k()){let t=["-u",yt,"-o","cat","-n",e.toString()];return(0,gt.spawnSync)("journalctl",t).stdout.toString()}throw new Error(`Not Implemented on platform ${process.platform}`)}function $n(){var e,t,r,n;if(!["darwin","linux"].includes(process.platform))throw new Error(`Not Implemented on platform ${process.platform}`);if(!O())throw new N;let o=k()?xt():_t(),i="",a="",c=[],l="",p={};for(let u of o.split(`
3
+ import{Ca as Te,Da as Ce,Fa as Ot,Ja as Pt,a as ve,b as wt,c as bt,d as G,m as Et,u as vt}from"./chunk-F4YTZ6XA.js";import{a as Vn,d as Oe,e as Pe,l as F,m as te}from"./chunk-MB65UVFQ.js";import{a as x,c as _,e as ee,g as f,h as s}from"./chunk-V4TR6DCM.js";var $t=_((ba,jt)=>{"use strict";s();jt.exports=Nt;Nt.sync=Kn;var Rt=x("fs");function Xn(e,t){var r=t.pathExt!==void 0?t.pathExt:process.env.PATHEXT;if(!r||(r=r.split(";"),r.indexOf("")!==-1))return!0;for(var n=0;n<r.length;n++){var o=r[n].toLowerCase();if(o&&e.substr(-o.length).toLowerCase()===o)return!0}return!1}function Lt(e,t,r){return!e.isSymbolicLink()&&!e.isFile()?!1:Xn(t,r)}function Nt(e,t,r){Rt.stat(e,function(n,o){r(n,n?!1:Lt(o,e,t))})}function Kn(e,t){return Lt(Rt.statSync(e),e,t)}});var Gt=_((va,Bt)=>{"use strict";s();Bt.exports=kt;kt.sync=Yn;var Dt=x("fs");function kt(e,t,r){Dt.stat(e,function(n,o){r(n,n?!1:Ut(o,t))})}function Yn(e,t){return Ut(Dt.statSync(e),t)}function Ut(e,t){return e.isFile()&&Zn(e,t)}function Zn(e,t){var r=e.mode,n=e.uid,o=e.gid,i=t.uid!==void 0?t.uid:process.getuid&&process.getuid(),a=t.gid!==void 0?t.gid:process.getgid&&process.getgid(),c=parseInt("100",8),l=parseInt("010",8),p=parseInt("001",8),u=c|l,h=r&p||r&l&&o===a||r&c&&n===i||r&u&&i===0;return h}});var Mt=_((Ta,Ft)=>{"use strict";s();var Pa=x("fs"),ne;process.platform==="win32"||global.TESTING_WINDOWS?ne=$t():ne=Gt();Ft.exports=Ie;Ie.sync=Qn;function Ie(e,t,r){if(typeof t=="function"&&(r=t,t={}),!r){if(typeof Promise!="function")throw new TypeError("callback not provided");return new Promise(function(n,o){Ie(e,t||{},function(i,a){i?o(i):n(a)})})}ne(e,t||{},function(n,o){n&&(n.code==="EACCES"||t&&t.ignoreErrors)&&(n=null,o=!1),r(n,o)})}function Qn(e,t){try{return ne.sync(e,t||{})}catch(r){if(t&&t.ignoreErrors||r.code==="EACCES")return!1;throw r}}});var Xt=_((Ia,Jt)=>{"use strict";s();var j=process.platform==="win32"||process.env.OSTYPE==="cygwin"||process.env.OSTYPE==="msys",qt=x("path"),eo=j?";":":",Vt=Mt(),zt=e=>Object.assign(new Error(`not found: ${e}`),{code:"ENOENT"}),Ht=(e,t)=>{let r=t.colon||eo,n=e.match(/\//)||j&&e.match(/\\/)?[""]:[...j?[process.cwd()]:[],...(t.path||process.env.PATH||"").split(r)],o=j?t.pathExt||process.env.PATHEXT||".EXE;.CMD;.BAT;.COM":"",i=j?o.split(r):[""];return j&&e.indexOf(".")!==-1&&i[0]!==""&&i.unshift(""),{pathEnv:n,pathExt:i,pathExtExe:o}},Wt=(e,t,r)=>{typeof t=="function"&&(r=t,t={}),t||(t={});let{pathEnv:n,pathExt:o,pathExtExe:i}=Ht(e,t),a=[],c=p=>new Promise((u,h)=>{if(p===n.length)return t.all&&a.length?u(a):h(zt(e));let m=n[p],g=/^".*"$/.test(m)?m.slice(1,-1):m,y=qt.join(g,e),b=!g&&/^\.[\\\/]/.test(e)?e.slice(0,2)+y:y;u(l(b,p,0))}),l=(p,u,h)=>new Promise((m,g)=>{if(h===o.length)return m(c(u+1));let y=o[h];Vt(p+y,{pathExt:i},(b,E)=>{if(!b&&E)if(t.all)a.push(p+y);else return m(p+y);return m(l(p,u,h+1))})});return r?c(0).then(p=>r(null,p),r):c(0)},to=(e,t)=>{t=t||{};let{pathEnv:r,pathExt:n,pathExtExe:o}=Ht(e,t),i=[];for(let a=0;a<r.length;a++){let c=r[a],l=/^".*"$/.test(c)?c.slice(1,-1):c,p=qt.join(l,e),u=!l&&/^\.[\\\/]/.test(e)?e.slice(0,2)+p:p;for(let h=0;h<n.length;h++){let m=u+n[h];try{if(Vt.sync(m,{pathExt:o}))if(t.all)i.push(m);else return m}catch{}}}if(t.all&&i.length)return i;if(t.nothrow)return null;throw zt(e)};Jt.exports=Wt;Wt.sync=to});var Yt=_((Ra,Ae)=>{"use strict";s();var Kt=(e={})=>{let t=e.env||process.env;return(e.platform||process.platform)!=="win32"?"PATH":Object.keys(t).reverse().find(n=>n.toUpperCase()==="PATH")||"Path"};Ae.exports=Kt;Ae.exports.default=Kt});var tr=_((Na,er)=>{"use strict";s();var Zt=x("path"),ro=Xt(),no=Yt();function Qt(e,t){let r=e.options.env||process.env,n=process.cwd(),o=e.options.cwd!=null,i=o&&process.chdir!==void 0&&!process.chdir.disabled;if(i)try{process.chdir(e.options.cwd)}catch{}let a;try{a=ro.sync(e.command,{path:r[no({env:r})],pathExt:t?Zt.delimiter:void 0})}catch{}finally{i&&process.chdir(n)}return a&&(a=Zt.resolve(o?e.options.cwd:"",a)),a}function oo(e){return Qt(e)||Qt(e,!0)}er.exports=oo});var rr=_(($a,Le)=>{"use strict";s();var Re=/([()\][%!^"`<>&|;, *?])/g;function io(e){return e=e.replace(Re,"^$1"),e}function so(e,t){return e=`${e}`,e=e.replace(/(\\*)"/g,'$1$1\\"'),e=e.replace(/(\\*)$/,"$1$1"),e=`"${e}"`,e=e.replace(Re,"^$1"),t&&(e=e.replace(Re,"^$1")),e}Le.exports.command=io;Le.exports.argument=so});var or=_((ka,nr)=>{"use strict";s();nr.exports=/^#!(.*)/});var sr=_((Ba,ir)=>{"use strict";s();var ao=or();ir.exports=(e="")=>{let t=e.match(ao);if(!t)return null;let[r,n]=t[0].replace(/#! ?/,"").split(" "),o=r.split("/").pop();return o==="env"?n:n?`${o} ${n}`:o}});var cr=_((Fa,ar)=>{"use strict";s();var Ne=x("fs"),co=sr();function lo(e){let r=Buffer.alloc(150),n;try{n=Ne.openSync(e,"r"),Ne.readSync(n,r,0,150,0),Ne.closeSync(n)}catch{}return co(r.toString())}ar.exports=lo});var dr=_((qa,fr)=>{"use strict";s();var uo=x("path"),lr=tr(),ur=rr(),fo=cr(),po=process.platform==="win32",mo=/\.(?:com|exe)$/i,ho=/node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;function go(e){e.file=lr(e);let t=e.file&&fo(e.file);return t?(e.args.unshift(e.file),e.command=t,lr(e)):e.file}function yo(e){if(!po)return e;let t=go(e),r=!mo.test(t);if(e.options.forceShell||r){let n=ho.test(t);e.command=uo.normalize(e.command),e.command=ur.command(e.command),e.args=e.args.map(i=>ur.argument(i,n));let o=[e.command].concat(e.args).join(" ");e.args=["/d","/s","/c",`"${o}"`],e.command=process.env.comspec||"cmd.exe",e.options.windowsVerbatimArguments=!0}return e}function _o(e,t,r){t&&!Array.isArray(t)&&(r=t,t=null),t=t?t.slice(0):[],r=Object.assign({},r);let n={command:e,args:t,options:r,file:void 0,original:{command:e,args:t}};return r.shell?n:yo(n)}fr.exports=_o});var hr=_((za,mr)=>{"use strict";s();var je=process.platform==="win32";function $e(e,t){return Object.assign(new Error(`${t} ${e.command} ENOENT`),{code:"ENOENT",errno:"ENOENT",syscall:`${t} ${e.command}`,path:e.command,spawnargs:e.args})}function xo(e,t){if(!je)return;let r=e.emit;e.emit=function(n,o){if(n==="exit"){let i=pr(o,t,"spawn");if(i)return r.call(e,"error",i)}return r.apply(e,arguments)}}function pr(e,t){return je&&e===1&&!t.file?$e(t.original,"spawn"):null}function So(e,t){return je&&e===1&&!t.file?$e(t.original,"spawnSync"):null}mr.exports={hookChildProcess:xo,verifyENOENT:pr,verifyENOENTSync:So,notFoundError:$e}});var _r=_((Wa,$)=>{"use strict";s();var gr=x("child_process"),De=dr(),ke=hr();function yr(e,t,r){let n=De(e,t,r),o=gr.spawn(n.command,n.args,n.options);return ke.hookChildProcess(o,n),o}function wo(e,t,r){let n=De(e,t,r),o=gr.spawnSync(n.command,n.args,n.options);return o.error=o.error||ke.verifyENOENTSync(o.status,n),o}$.exports=yr;$.exports.spawn=yr;$.exports.sync=wo;$.exports._parse=De;$.exports._enoent=ke});var zr=_((xl,Vr)=>{"use strict";s();var{PassThrough:_i}=x("stream");Vr.exports=function(){var e=[],t=new _i({objectMode:!0});return t.setMaxListeners(0),t.add=r,t.isEmpty=n,t.on("unpipe",o),Array.prototype.slice.call(arguments).forEach(r),t;function r(i){return Array.isArray(i)?(i.forEach(r),this):(e.push(i),i.once("end",o.bind(null,i)),i.once("error",t.emit.bind(t,"error")),i.pipe(t,{end:!1}),this)}function n(){return e.length==0}function o(i){e=e.filter(function(a){return a!==i}),!e.length&&t.readable&&t.end()}}});var H=_((nu,dn)=>{"use strict";s();var Mi=Object.create,_e=Object.defineProperty,qi=Object.getOwnPropertyDescriptor,Vi=Object.getOwnPropertyNames,zi=Object.getPrototypeOf,Hi=Object.prototype.hasOwnProperty,Wi=(e,t)=>{for(var r in t)_e(e,r,{get:t[r],enumerable:!0})},cn=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of Vi(t))!Hi.call(e,o)&&o!==r&&_e(e,o,{get:()=>t[o],enumerable:!(n=qi(t,o))||n.enumerable});return e},Ji=(e,t,r)=>(r=e!=null?Mi(zi(e)):{},cn(t||!e||!e.__esModule?_e(r,"default",{value:e,enumerable:!0}):r,e)),Xi=e=>cn(_e({},"__esModule",{value:!0}),e),ln={};Wi(ln,{CLOUDFLARED_VERSION:()=>Zi,DEFAULT_CLOUDFLARED_BIN:()=>un,RELEASE_BASE:()=>Qi,bin:()=>fn,use:()=>Yi});dn.exports=Xi(ln);var Ki=Ji(x("node:path")),un=Ki.default.join(f,"..","bin",process.platform==="win32"?"cloudflared.exe":"cloudflared"),fn=process.env.CLOUDFLARED_BIN||un;function Yi(e){fn=e}var Zi=process.env.CLOUDFLARED_VERSION||"latest",Qi="https://github.com/cloudflare/cloudflared/releases/"});var hn=_((iu,mn)=>{"use strict";s();var ct=Object.defineProperty,es=Object.getOwnPropertyDescriptor,ts=Object.getOwnPropertyNames,rs=Object.prototype.hasOwnProperty,ns=(e,t)=>{for(var r in t)ct(e,r,{get:t[r],enumerable:!0})},os=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of ts(t))!rs.call(e,o)&&o!==r&&ct(e,o,{get:()=>t[o],enumerable:!(n=es(t,o))||n.enumerable});return e},is=e=>os(ct({},"__esModule",{value:!0}),e),pn={};ns(pn,{UnsupportedError:()=>at});mn.exports=is(pn);var at=class extends Error{constructor(t){super(t)}}});var bn=_((au,wn)=>{"use strict";s();var ss=Object.create,xe=Object.defineProperty,as=Object.getOwnPropertyDescriptor,cs=Object.getOwnPropertyNames,ls=Object.getPrototypeOf,us=Object.prototype.hasOwnProperty,fs=(e,t)=>{for(var r in t)xe(e,r,{get:t[r],enumerable:!0})},gn=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of cs(t))!us.call(e,o)&&o!==r&&xe(e,o,{get:()=>t[o],enumerable:!(n=as(t,o))||n.enumerable});return e},lt=(e,t,r)=>(r=e!=null?ss(ls(e)):{},gn(t||!e||!e.__esModule?xe(r,"default",{value:e,enumerable:!0}):r,e)),ds=e=>gn(xe({},"__esModule",{value:!0}),e),yn={};fs(yn,{install:()=>_s,install_linux:()=>_n,install_macos:()=>xn,install_windows:()=>Sn});wn.exports=ds(yn);var A=lt(x("node:fs")),W=lt(x("node:path")),ps=lt(x("node:https")),ms=x("node:child_process"),D=H(),Se=hn(),hs={arm64:"cloudflared-linux-arm64",arm:"cloudflared-linux-arm",x64:"cloudflared-linux-amd64",ia32:"cloudflared-linux-386"},gs={arm64:"cloudflared-darwin-amd64.tgz",x64:"cloudflared-darwin-amd64.tgz"},ys={x64:"cloudflared-windows-amd64.exe",ia32:"cloudflared-windows-386.exe"};function ut(e){return e==="latest"?`${D.RELEASE_BASE}latest/download/`:`${D.RELEASE_BASE}download/${e}/`}async function _s(e,t=D.CLOUDFLARED_VERSION){if(process.platform==="linux")return _n(e,t);if(process.platform==="darwin")return xn(e,t);if(process.platform==="win32")return Sn(e,t);throw new Se.UnsupportedError("Unsupported platform: "+process.platform)}async function _n(e,t=D.CLOUDFLARED_VERSION){let r=hs[process.arch];if(r===void 0)throw new Se.UnsupportedError("Unsupported architecture: "+process.arch);return await we(ut(t)+r,e),A.default.chmodSync(e,"755"),e}async function xn(e,t=D.CLOUDFLARED_VERSION){let r=gs[process.arch];if(r===void 0)throw new Se.UnsupportedError("Unsupported architecture: "+process.arch);return await we(ut(t)+r,`${e}.tgz`),process.env.VERBOSE&&console.log(`Extracting to ${e}`),(0,ms.execSync)(`tar -xzf ${W.default.basename(`${e}.tgz`)}`,{cwd:W.default.dirname(e)}),A.default.unlinkSync(`${e}.tgz`),A.default.renameSync(`${W.default.dirname(e)}/cloudflared`,e),e}async function Sn(e,t=D.CLOUDFLARED_VERSION){let r=ys[process.arch];if(r===void 0)throw new Se.UnsupportedError("Unsupported architecture: "+process.arch);return await we(ut(t)+r,e),e}function we(e,t,r=0){return r===0?process.env.VERBOSE&&console.log(`Downloading ${e} to ${t}`):process.env.VERBOSE&&console.log(`Redirecting to ${e}`),A.default.existsSync(W.default.dirname(t))||A.default.mkdirSync(W.default.dirname(t),{recursive:!0}),new Promise((n,o)=>{let i=ps.default.get(e,a=>{if([301,302,303,307,308].includes(a.statusCode)&&a.headers.location!==void 0){i.destroy();let l=a.headers.location;n(we(l,t,r+1));return}if(a.statusCode&&a.statusCode>=200&&a.statusCode<300){let l=A.default.createWriteStream(t);l.on("finish",()=>{l.close(()=>n(t))}),l.on("error",p=>{A.default.unlink(t,()=>o(p))}),a.pipe(l)}else i.destroy(),o(new Error(`HTTP response with status code: ${a.statusCode}`))});i.on("error",a=>{o(a)}),i.end()})}});var dt=_((lu,vn)=>{"use strict";s();var ft=Object.defineProperty,xs=Object.getOwnPropertyDescriptor,Ss=Object.getOwnPropertyNames,ws=Object.prototype.hasOwnProperty,bs=(e,t)=>{for(var r in t)ft(e,r,{get:t[r],enumerable:!0})},Es=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of Ss(t))!ws.call(e,o)&&o!==r&&ft(e,o,{get:()=>t[o],enumerable:!(n=xs(t,o))||n.enumerable});return e},vs=e=>Es(ft({},"__esModule",{value:!0}),e),En={};bs(En,{config_regex:()=>Ns,conn_regex:()=>Os,connectorID_regex:()=>Rs,disconnect_regex:()=>Is,index_regex:()=>Cs,ip_regex:()=>Ps,location_regex:()=>Ts,metrics_regex:()=>Ls,tunnelID_regex:()=>As});vn.exports=vs(En);var Os=/connection[= ]([0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[0-9a-f]{4}-[0-9a-f]{12})/i,Ps=/ip=([0-9.]+)/,Ts=/location=([A-Za-z0-9]+)/,Cs=/connIndex=(\d)/,Is=/Unregistered tunnel connection connIndex=(\d)/i,As=/tunnelID=([0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[0-9a-f]{4}-[0-9a-f]{12})/i,Rs=/Connector ID: ([0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[0-9a-f]{4}-[0-9a-f]{12})/i,Ls=/metrics server on ([0-9.:]+\/metrics)/,Ns=/config="(.+[^\\])"/});var Tn=_((fu,Pn)=>{"use strict";s();var pt=Object.defineProperty,js=Object.getOwnPropertyDescriptor,$s=Object.getOwnPropertyNames,Ds=Object.prototype.hasOwnProperty,ks=(e,t)=>{for(var r in t)pt(e,r,{get:t[r],enumerable:!0})},Us=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of $s(t))!Ds.call(e,o)&&o!==r&&pt(e,o,{get:()=>t[o],enumerable:!(n=js(t,o))||n.enumerable});return e},Bs=e=>Us(pt({},"__esModule",{value:!0}),e),On={};ks(On,{tunnel:()=>Ms});Pn.exports=Bs(On);var Gs=x("node:child_process"),Fs=H(),be=dt();function Ms(e={}){let t=["tunnel"];for(let[m,g]of Object.entries(e))typeof g=="string"?t.push(`${m}`,g):typeof g=="number"?t.push(`${m}`,g.toString()):g===null&&t.push(`${m}`);t.length===1&&t.push("--url","localhost:8080");let r=(0,Gs.spawn)(Fs.bin,t,{stdio:["ignore","pipe","pipe"]});process.env.VERBOSE&&(r.stdout.pipe(process.stdout),r.stderr.pipe(process.stderr));let n=/\|\s+(https?:\/\/[^\s]+)/,o=()=>{},i=()=>{},a=new Promise((...m)=>[o,i]=m),c=[],l=[],p=[];for(let m=0;m<1;m++)p.push(new Promise((...g)=>[c[m],l[m]]=g));let u=m=>{var g;let y=m.toString(),b=y.match(n);b&&o(b[1]);let E=y.match(be.conn_regex),P=y.match(be.ip_regex),T=y.match(be.location_regex),C=y.match(be.index_regex);if(E&&P&&T&&C){let[,K]=E,[,Y]=P,[,Z]=T,[,Q]=C;(g=c[+Q])==null||g.call(c,{id:K,ip:Y,location:Z})}};return r.stdout.on("data",u).on("error",i),r.stderr.on("data",u).on("error",i),{url:a,connections:p,child:r,stop:()=>r.kill("SIGINT")}}});var Un=_((pu,kn)=>{"use strict";s();var qs=Object.create,Ee=Object.defineProperty,Vs=Object.getOwnPropertyDescriptor,zs=Object.getOwnPropertyNames,Hs=Object.getPrototypeOf,Ws=Object.prototype.hasOwnProperty,Js=(e,t)=>{for(var r in t)Ee(e,r,{get:t[r],enumerable:!0})},Cn=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of zs(t))!Ws.call(e,o)&&o!==r&&Ee(e,o,{get:()=>t[o],enumerable:!(n=Vs(t,o))||n.enumerable});return e},In=(e,t,r)=>(r=e!=null?qs(Hs(e)):{},Cn(t||!e||!e.__esModule?Ee(r,"default",{value:e,enumerable:!0}):r,e)),Xs=e=>Cn(Ee({},"__esModule",{value:!0}),e),An={};Js(An,{AlreadyInstalledError:()=>J,LINUX_SERVICE_PATH:()=>L,MACOS_SERVICE_PATH:()=>v,NotInstalledError:()=>N,clean:()=>Dn,current:()=>$n,err:()=>_t,exists:()=>O,identifier:()=>R,install:()=>Ln,journal:()=>xt,log:()=>jn,service:()=>Ks,service_name:()=>yt,uninstall:()=>Nn});kn.exports=Xs(An);var mt=In(x("node:os")),w=In(x("node:fs")),gt=x("node:child_process"),Rn=H(),S=dt(),R="com.cloudflare.cloudflared",yt="cloudflared.service",v={PLIST:ht()?`/Library/LaunchDaemons/${R}.plist`:`${mt.default.homedir()}/Library/LaunchAgents/${R}.plist`,OUT:ht()?`/Library/Logs/${R}.out.log`:`${mt.default.homedir()}/Library/Logs/${R}.out.log`,ERR:ht()?`/Library/Logs/${R}.err.log`:`${mt.default.homedir()}/Library/Logs/${R}.err.log`},L={SYSTEMD:`/etc/systemd/system/${yt}`,SERVICE:"/etc/init.d/cloudflared",SERVICE_OUT:"/var/log/cloudflared.log",SERVICE_ERR:"/var/log/cloudflared.err"},Ks={install:Ln,uninstall:Nn,exists:O,log:jn,err:_t,current:$n,clean:Dn,journal:xt},J=class extends Error{constructor(){super("service is already installed")}},N=class extends Error{constructor(){super("service is not installed")}};function Ln(e){if(!["darwin","linux"].includes(process.platform))throw new Error(`Not Implemented on platform ${process.platform}`);if(O())throw new J;let t=["service","install"];e&&t.push(e);let r=(0,gt.spawnSync)(Rn.bin,t);if(r.status!==0)throw new Error(`service install failed: ${r.stderr.toString()}`)}function Nn(){if(!["darwin","linux"].includes(process.platform))throw new Error(`Not Implemented on platform ${process.platform}`);if(!O())throw new N;let e=(0,gt.spawnSync)(Rn.bin,["service","uninstall"]);if(e.status!==0)throw new Error(`service uninstall failed: ${e.stderr.toString()}`);process.platform==="darwin"?(w.default.rmSync(v.OUT),w.default.rmSync(v.ERR)):process.platform==="linux"&&!k()&&(w.default.rmSync(L.SERVICE_OUT),w.default.rmSync(L.SERVICE_ERR))}function jn(){if(!O())throw new N;if(process.platform==="darwin")return w.default.readFileSync(v.OUT,"utf8");if(process.platform==="linux"&&!k())return w.default.readFileSync(L.SERVICE_OUT,"utf8");throw new Error(`Not Implemented on platform ${process.platform}`)}function _t(){if(!O())throw new N;if(process.platform==="darwin")return w.default.readFileSync(v.ERR,"utf8");if(process.platform==="linux"&&!k())return w.default.readFileSync(L.SERVICE_ERR,"utf8");throw new Error(`Not Implemented on platform ${process.platform}`)}function xt(e=300){if(process.platform==="linux"&&k()){let t=["-u",yt,"-o","cat","-n",e.toString()];return(0,gt.spawnSync)("journalctl",t).stdout.toString()}throw new Error(`Not Implemented on platform ${process.platform}`)}function $n(){var e,t,r,n;if(!["darwin","linux"].includes(process.platform))throw new Error(`Not Implemented on platform ${process.platform}`);if(!O())throw new N;let o=k()?xt():_t(),i="",a="",c=[],l="",p={};for(let u of o.split(`
4
4
  `))try{if(u.match(S.tunnelID_regex))i=((e=u.match(S.tunnelID_regex))==null?void 0:e[1])??"";else if(u.match(S.connectorID_regex))a=((t=u.match(S.connectorID_regex))==null?void 0:t[1])??"";else if(u.match(S.conn_regex)&&u.match(S.location_regex)&&u.match(S.ip_regex)&&u.match(S.index_regex)){let[,h]=u.match(S.conn_regex)??[],[,m]=u.match(S.location_regex)??[],[,g]=u.match(S.ip_regex)??[],[,y]=u.match(S.index_regex)??[];c[parseInt(y)]={id:h,ip:g,location:m}}else if(u.match(S.disconnect_regex)){let[,h]=u.match(S.disconnect_regex)??[];parseInt(h)in c&&(c[parseInt(h)]={id:"",ip:"",location:""})}else u.match(S.metrics_regex)?l=((r=u.match(S.metrics_regex))==null?void 0:r[1])??"":u.match(S.config_regex)&&(p=JSON.parse(((n=u.match(S.config_regex))==null?void 0:n[1].replace(/\\/g,""))??"{}"))}catch(h){process.env.VERBOSE&&console.error("log parsing failed",h)}return{tunnelID:i,connectorID:a,connections:c,metrics:l,config:p}}function Dn(){if(process.platform!=="darwin")throw new Error(`Not Implemented on platform ${process.platform}`);if(O())throw new J;w.default.rmSync(v.OUT,{force:!0}),w.default.rmSync(v.ERR,{force:!0})}function O(){if(process.platform==="darwin")return w.default.existsSync(v.PLIST);if(process.platform==="linux")return k()?w.default.existsSync(L.SYSTEMD):w.default.existsSync(L.SERVICE);throw new Error(`Not Implemented on platform ${process.platform}`)}function ht(){var e;return((e=process.getuid)==null?void 0:e.call(process))===0}function k(){return process.platform==="linux"&&w.default.existsSync("/run/systemd/system")}});var Fn=_((hu,Gn)=>{"use strict";s();var St=Object.defineProperty,Ys=Object.getOwnPropertyDescriptor,Zs=Object.getOwnPropertyNames,Qs=Object.prototype.hasOwnProperty,ea=(e,t)=>{for(var r in t)St(e,r,{get:t[r],enumerable:!0})},ta=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of Zs(t))!Qs.call(e,o)&&o!==r&&St(e,o,{get:()=>t[o],enumerable:!(n=Ys(t,o))||n.enumerable});return e},ra=e=>ta(St({},"__esModule",{value:!0}),e),Bn={};ea(Bn,{AlreadyInstalledError:()=>X.AlreadyInstalledError,MACOS_SERVICE_PATH:()=>X.MACOS_SERVICE_PATH,NotInstalledError:()=>X.NotInstalledError,bin:()=>na.bin,identifier:()=>X.identifier,install:()=>oa.install,service:()=>X.service,tunnel:()=>ia.tunnel});Gn.exports=ra(Bn);var na=H(),oa=bn(),ia=Tn(),X=Un()});s();var B=ee(Vn(),1);s();s();var zn={},Hn={},Wn={},Jn={};function Tt(e){var t={"bo._base_domain_":[{srcPath:"/_serverless/wix-app-backend-manager",destPath:""}],"wixbo.ai":[{srcPath:"/_serverless/wix-app-backend-manager",destPath:""}],"manage._base_domain_":[{srcPath:"/_serverless/wix-app-backend-manager",destPath:""}]};return wt(Object.assign(e,{domainToMappings:t}))}function Ct(e){var t=G(zn,{}),r=t.toJSON,n=t.fromJSON,o=G(Hn,{}).fromJSON;function i(a){var c=a.host,l=r(e),p={entityFqdn:"wix.apps.hosting.v1.deployment",method:"POST",methodFqn:"wix.apps.hosting.v1.BackendService.CreateTunnel",url:Tt({protoPath:"/v1/tunnel",data:l,host:c}),data:l,transformResponse:o};return p}return i.fromReq=n,i.__isAmbassador=!0,i}function It(e){var t=G(Wn,{}),r=t.toJSON,n=t.fromJSON,o=G(Jn,{}).fromJSON;function i(a){var c=a.host,l=r(e),p={entityFqdn:"wix.apps.hosting.v1.deployment",method:"DELETE",methodFqn:"wix.apps.hosting.v1.BackendService.DeleteTunnel",url:Tt({protoPath:"/v1/tunnel",data:l,host:c}),params:bt(l),transformResponse:o};return p}return i.fromReq=n,i.__isAmbassador=!0,i}s();var At=F.object({id:F.string(),token:F.string(),domain:F.string()});var re=class{constructor(t){this.httpClient=t;let{minRetryTimeout:r}=te();this.retryOptions={retries:3,minTimeout:r,maxTimeout:3*1e3}}retryOptions;createTunnel=async({port:t})=>{try{let{data:r}=await ve(()=>this.httpClient.request(Ct({port:t})),this.retryOptions);return At.parse(r)}catch(r){throw new Oe({code:Pe.FailedToCreateTunnel(),cause:r})}};deleteTunnel=async t=>{try{await ve(()=>this.httpClient.request(It({id:t})),this.retryOptions)}catch(r){throw new Oe({code:Pe.FailedToDeleteTunnel(),cause:r})}}};s();s();var on=ee(_r(),1);import{Buffer as Di}from"node:buffer";import ki from"node:path";import st from"node:child_process";import ge from"node:process";s();function Ue(e){let t=typeof e=="string"?`
5
5
  `:10,r=typeof e=="string"?"\r":13;return e[e.length-1]===t&&(e=e.slice(0,-1)),e[e.length-1]===r&&(e=e.slice(0,-1)),e}s();import ie from"node:process";import M from"node:path";import bo from"node:url";s();function oe(e={}){let{env:t=process.env,platform:r=process.platform}=e;return r!=="win32"?"PATH":Object.keys(t).reverse().find(n=>n.toUpperCase()==="PATH")||"Path"}function Eo(e={}){let{cwd:t=ie.cwd(),path:r=ie.env[oe()],execPath:n=ie.execPath}=e,o,i=t instanceof URL?bo.fileURLToPath(t):t,a=M.resolve(i),c=[];for(;o!==a;)c.push(M.join(a,"node_modules/.bin")),o=a,a=M.resolve(a,"..");return c.push(M.resolve(i,n,"..")),[...c,r].join(M.delimiter)}function xr({env:e=ie.env,...t}={}){e={...e};let r=oe({env:e});return t.path=e[r],e[r]=Eo(t),e}s();s();var vo=(e,t,r,n)=>{if(r==="length"||r==="prototype"||r==="arguments"||r==="caller")return;let o=Object.getOwnPropertyDescriptor(e,r),i=Object.getOwnPropertyDescriptor(t,r);!Oo(o,i)&&n||Object.defineProperty(e,r,i)},Oo=function(e,t){return e===void 0||e.configurable||e.writable===t.writable&&e.enumerable===t.enumerable&&e.configurable===t.configurable&&(e.writable||e.value===t.value)},Po=(e,t)=>{let r=Object.getPrototypeOf(t);r!==Object.getPrototypeOf(e)&&Object.setPrototypeOf(e,r)},To=(e,t)=>`/* Wrapped ${e}*/
6
6
  ${t}`,Co=Object.getOwnPropertyDescriptor(Function.prototype,"toString"),Io=Object.getOwnPropertyDescriptor(Function.prototype.toString,"name"),Ao=(e,t,r)=>{let n=r===""?"":`with ${r.trim()}() `,o=To.bind(null,n,t.toString());Object.defineProperty(o,"name",Io),Object.defineProperty(e,"toString",{...Co,value:o})};function Be(e,t,{ignoreNonConfigurable:r=!1}={}){let{name:n}=e;for(let o of Reflect.ownKeys(t))vo(e,t,o,r);return Po(e,t),Ao(e,t,n),e}var se=new WeakMap,Sr=(e,t={})=>{if(typeof e!="function")throw new TypeError("Expected a function");let r,n=0,o=e.displayName||e.name||"<anonymous>",i=function(...a){if(se.set(i,++n),n===1)r=e.apply(this,a),e=null;else if(t.throw===!0)throw new Error(`Function \`${o}\` can only be called once`);return r};return Be(i,e),se.set(i,n),i};Sr.callCount=e=>{if(!se.has(e))throw new Error(`The given function \`${e.name}\` is not wrapped by the \`onetime\` package`);return se.get(e)};var wr=Sr;s();import Go from"node:process";s();import{constants as jo}from"node:os";s();var br=()=>{let e=vr-Er+1;return Array.from({length:e},Ro)},Ro=(e,t)=>({name:`SIGRT${t+1}`,number:Er+t,action:"terminate",description:"Application-specific signal (realtime)",standard:"posix"}),Er=34,vr=64;s();import{constants as Lo}from"node:os";s();var Or=[{name:"SIGHUP",number:1,action:"terminate",description:"Terminal closed",standard:"posix"},{name:"SIGINT",number:2,action:"terminate",description:"User interruption with CTRL-C",standard:"ansi"},{name:"SIGQUIT",number:3,action:"core",description:"User interruption with CTRL-\\",standard:"posix"},{name:"SIGILL",number:4,action:"core",description:"Invalid machine instruction",standard:"ansi"},{name:"SIGTRAP",number:5,action:"core",description:"Debugger breakpoint",standard:"posix"},{name:"SIGABRT",number:6,action:"core",description:"Aborted",standard:"ansi"},{name:"SIGIOT",number:6,action:"core",description:"Aborted",standard:"bsd"},{name:"SIGBUS",number:7,action:"core",description:"Bus error due to misaligned, non-existing address or paging error",standard:"bsd"},{name:"SIGEMT",number:7,action:"terminate",description:"Command should be emulated but is not implemented",standard:"other"},{name:"SIGFPE",number:8,action:"core",description:"Floating point arithmetic error",standard:"ansi"},{name:"SIGKILL",number:9,action:"terminate",description:"Forced termination",standard:"posix",forced:!0},{name:"SIGUSR1",number:10,action:"terminate",description:"Application-specific signal",standard:"posix"},{name:"SIGSEGV",number:11,action:"core",description:"Segmentation fault",standard:"ansi"},{name:"SIGUSR2",number:12,action:"terminate",description:"Application-specific signal",standard:"posix"},{name:"SIGPIPE",number:13,action:"terminate",description:"Broken pipe or socket",standard:"posix"},{name:"SIGALRM",number:14,action:"terminate",description:"Timeout or timer",standard:"posix"},{name:"SIGTERM",number:15,action:"terminate",description:"Termination",standard:"ansi"},{name:"SIGSTKFLT",number:16,action:"terminate",description:"Stack is empty or overflowed",standard:"other"},{name:"SIGCHLD",number:17,action:"ignore",description:"Child process terminated, paused or unpaused",standard:"posix"},{name:"SIGCLD",number:17,action:"ignore",description:"Child process terminated, paused or unpaused",standard:"other"},{name:"SIGCONT",number:18,action:"unpause",description:"Unpaused",standard:"posix",forced:!0},{name:"SIGSTOP",number:19,action:"pause",description:"Paused",standard:"posix",forced:!0},{name:"SIGTSTP",number:20,action:"pause",description:'Paused using CTRL-Z or "suspend"',standard:"posix"},{name:"SIGTTIN",number:21,action:"pause",description:"Background process cannot read terminal input",standard:"posix"},{name:"SIGBREAK",number:21,action:"terminate",description:"User interruption with CTRL-BREAK",standard:"other"},{name:"SIGTTOU",number:22,action:"pause",description:"Background process cannot write to terminal output",standard:"posix"},{name:"SIGURG",number:23,action:"ignore",description:"Socket received out-of-band data",standard:"bsd"},{name:"SIGXCPU",number:24,action:"core",description:"Process timed out",standard:"bsd"},{name:"SIGXFSZ",number:25,action:"core",description:"File too big",standard:"bsd"},{name:"SIGVTALRM",number:26,action:"terminate",description:"Timeout or timer",standard:"bsd"},{name:"SIGPROF",number:27,action:"terminate",description:"Timeout or timer",standard:"bsd"},{name:"SIGWINCH",number:28,action:"ignore",description:"Terminal window size changed",standard:"bsd"},{name:"SIGIO",number:29,action:"terminate",description:"I/O is available",standard:"other"},{name:"SIGPOLL",number:29,action:"terminate",description:"Watched event",standard:"other"},{name:"SIGINFO",number:29,action:"ignore",description:"Request for process information",standard:"other"},{name:"SIGPWR",number:30,action:"terminate",description:"Device running out of power",standard:"systemv"},{name:"SIGSYS",number:31,action:"core",description:"Invalid system call",standard:"other"},{name:"SIGUNUSED",number:31,action:"terminate",description:"Invalid system call",standard:"other"}];var Ge=()=>{let e=br();return[...Or,...e].map(No)},No=({name:e,number:t,description:r,action:n,forced:o=!1,standard:i})=>{let{signals:{[e]:a}}=Lo,c=a!==void 0;return{name:e,number:c?a:t,description:r,supported:c,action:n,forced:o,standard:i}};var $o=()=>{let e=Ge();return Object.fromEntries(e.map(Do))},Do=({name:e,number:t,description:r,supported:n,action:o,forced:i,standard:a})=>[e,{name:e,number:t,description:r,supported:n,action:o,forced:i,standard:a}],Pr=$o(),ko=()=>{let e=Ge(),t=65,r=Array.from({length:t},(n,o)=>Uo(o,e));return Object.assign({},...r)},Uo=(e,t)=>{let r=Bo(e,t);if(r===void 0)return{};let{name:n,description:o,supported:i,action:a,forced:c,standard:l}=r;return{[e]:{name:n,number:e,description:o,supported:i,action:a,forced:c,standard:l}}},Bo=(e,t)=>{let r=t.find(({name:n})=>jo.signals[n]===e);return r!==void 0?r:t.find(n=>n.number===e)},wc=ko();var Fo=({timedOut:e,timeout:t,errorCode:r,signal:n,signalDescription:o,exitCode:i,isCanceled:a})=>e?`timed out after ${t} milliseconds`:a?"was canceled":r!==void 0?`failed with ${r}`:n!==void 0?`was killed with ${n} (${o})`:i!==void 0?`failed with exit code ${i}`:"failed",q=({stdout:e,stderr:t,all:r,error:n,signal:o,exitCode:i,command:a,escapedCommand:c,timedOut:l,isCanceled:p,killed:u,parsed:{options:{timeout:h,cwd:m=Go.cwd()}}})=>{i=i===null?void 0:i,o=o===null?void 0:o;let g=o===void 0?void 0:Pr[o].description,y=n&&n.code,E=`Command ${Fo({timedOut:l,timeout:h,errorCode:y,signal:o,signalDescription:g,exitCode:i,isCanceled:p})}: ${a}`,P=Object.prototype.toString.call(n)==="[object Error]",T=P?`${E}
7
7
  ${n.message}`:E,C=[T,t,e].filter(Boolean).join(`
8
8
  `);return P?(n.originalMessage=n.message,n.message=C):n=new Error(C),n.shortMessage=T,n.command=a,n.escapedCommand=c,n.exitCode=i,n.signal=o,n.signalDescription=g,n.stdout=e,n.stderr=t,n.cwd=m,r!==void 0&&(n.all=r),"bufferedData"in n&&delete n.bufferedData,n.failed=!0,n.timedOut=!!l,n.isCanceled=p,n.killed=u&&!l,n};s();var ae=["stdin","stdout","stderr"],Mo=e=>ae.some(t=>e[t]!==void 0),Tr=e=>{if(!e)return;let{stdio:t}=e;if(t===void 0)return ae.map(n=>e[n]);if(Mo(e))throw new Error(`It's not possible to provide \`stdio\` in combination with one of ${ae.map(n=>`\`${n}\``).join(", ")}`);if(typeof t=="string")return t;if(!Array.isArray(t))throw new TypeError(`Expected \`stdio\` to be of type \`string\` or \`Array\`, got \`${typeof t}\``);let r=Math.max(t.length,ae.length);return Array.from({length:r},(n,o)=>t[o])};s();import zo from"node:os";s();s();var I=[];I.push("SIGHUP","SIGINT","SIGTERM");process.platform!=="win32"&&I.push("SIGALRM","SIGABRT","SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");process.platform==="linux"&&I.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT");var ce=e=>!!e&&typeof e=="object"&&typeof e.removeListener=="function"&&typeof e.emit=="function"&&typeof e.reallyExit=="function"&&typeof e.listeners=="function"&&typeof e.kill=="function"&&typeof e.pid=="number"&&typeof e.on=="function",Fe=Symbol.for("signal-exit emitter"),Me=globalThis,qo=Object.defineProperty.bind(Object),qe=class{emitted={afterExit:!1,exit:!1};listeners={afterExit:[],exit:[]};count=0;id=Math.random();constructor(){if(Me[Fe])return Me[Fe];qo(Me,Fe,{value:this,writable:!1,enumerable:!1,configurable:!1})}on(t,r){this.listeners[t].push(r)}removeListener(t,r){let n=this.listeners[t],o=n.indexOf(r);o!==-1&&(o===0&&n.length===1?n.length=0:n.splice(o,1))}emit(t,r,n){if(this.emitted[t])return!1;this.emitted[t]=!0;let o=!1;for(let i of this.listeners[t])o=i(r,n)===!0||o;return t==="exit"&&(o=this.emit("afterExit",r,n)||o),o}},le=class{},Vo=e=>({onExit(t,r){return e.onExit(t,r)},load(){return e.load()},unload(){return e.unload()}}),Ve=class extends le{onExit(){return()=>{}}load(){}unload(){}},ze=class extends le{#s=He.platform==="win32"?"SIGINT":"SIGHUP";#t=new qe;#e;#o;#i;#n={};#r=!1;constructor(t){super(),this.#e=t,this.#n={};for(let r of I)this.#n[r]=()=>{let n=this.#e.listeners(r),{count:o}=this.#t,i=t;if(typeof i.__signal_exit_emitter__=="object"&&typeof i.__signal_exit_emitter__.count=="number"&&(o+=i.__signal_exit_emitter__.count),n.length===o){this.unload();let a=this.#t.emit("exit",null,r),c=r==="SIGHUP"?this.#s:r;a||t.kill(t.pid,c)}};this.#i=t.reallyExit,this.#o=t.emit}onExit(t,r){if(!ce(this.#e))return()=>{};this.#r===!1&&this.load();let n=r?.alwaysLast?"afterExit":"exit";return this.#t.on(n,t),()=>{this.#t.removeListener(n,t),this.#t.listeners.exit.length===0&&this.#t.listeners.afterExit.length===0&&this.unload()}}load(){if(!this.#r){this.#r=!0,this.#t.count+=1;for(let t of I)try{let r=this.#n[t];r&&this.#e.on(t,r)}catch{}this.#e.emit=(t,...r)=>this.#c(t,...r),this.#e.reallyExit=t=>this.#a(t)}}unload(){this.#r&&(this.#r=!1,I.forEach(t=>{let r=this.#n[t];if(!r)throw new Error("Listener not defined for signal: "+t);try{this.#e.removeListener(t,r)}catch{}}),this.#e.emit=this.#o,this.#e.reallyExit=this.#i,this.#t.count-=1)}#a(t){return ce(this.#e)?(this.#e.exitCode=t||0,this.#t.emit("exit",this.#e.exitCode,null),this.#i.call(this.#e,this.#e.exitCode)):0}#c(t,...r){let n=this.#o;if(t==="exit"&&ce(this.#e)){typeof r[0]=="number"&&(this.#e.exitCode=r[0]);let o=n.call(this.#e,t,...r);return this.#t.emit("exit",this.#e.exitCode,null),o}else return n.call(this.#e,t,...r)}},He=globalThis.process,{onExit:Cr,load:Nc,unload:jc}=Vo(ce(He)?new ze(He):new Ve);var Ho=1e3*5,Ir=(e,t="SIGTERM",r={})=>{let n=e(t);return Wo(e,t,r,n),n},Wo=(e,t,r,n)=>{if(!Jo(t,r,n))return;let o=Ko(r),i=setTimeout(()=>{e("SIGKILL")},o);i.unref&&i.unref()},Jo=(e,{forceKillAfterTimeout:t},r)=>Xo(e)&&t!==!1&&r,Xo=e=>e===zo.constants.signals.SIGTERM||typeof e=="string"&&e.toUpperCase()==="SIGTERM",Ko=({forceKillAfterTimeout:e=!0})=>{if(e===!0)return Ho;if(!Number.isFinite(e)||e<0)throw new TypeError(`Expected the \`forceKillAfterTimeout\` option to be a non-negative integer, got \`${e}\` (${typeof e})`);return e},Ar=(e,t)=>{e.kill()&&(t.isCanceled=!0)},Yo=(e,t,r)=>{e.kill(t),r(Object.assign(new Error("Timed out"),{timedOut:!0,signal:t}))},Rr=(e,{timeout:t,killSignal:r="SIGTERM"},n)=>{if(t===0||t===void 0)return n;let o,i=new Promise((c,l)=>{o=setTimeout(()=>{Yo(e,r,l)},t)}),a=n.finally(()=>{clearTimeout(o)});return Promise.race([i,a])},Lr=({timeout:e})=>{if(e!==void 0&&(!Number.isFinite(e)||e<0))throw new TypeError(`Expected the \`timeout\` option to be a non-negative integer, got \`${e}\` (${typeof e})`)},Nr=async(e,{cleanup:t,detached:r},n)=>{if(!t||r)return n;let o=Cr(()=>{e.kill()});return n.finally(()=>{o()})};s();import{createWriteStream as Zo}from"node:fs";import{ChildProcess as Qo}from"node:child_process";var ei=e=>e instanceof Qo&&typeof e.then=="function",We=(e,t,r)=>{if(typeof r=="string")return e[t].pipe(Zo(r)),e;if(Ce(r))return e[t].pipe(r),e;if(!ei(r))throw new TypeError("The second argument must be a string, a stream or an Execa child process.");if(!Ce(r.stdin))throw new TypeError("The target child process's stdin must be available.");return e[t].pipe(r.stdin),r},jr=e=>{e.stdout!==null&&(e.pipeStdout=We.bind(void 0,e,"stdout")),e.stderr!==null&&(e.pipeStderr=We.bind(void 0,e,"stderr")),e.all!==void 0&&(e.pipeAll=We.bind(void 0,e,"all"))};s();import{createReadStream as xi,readFileSync as Si}from"node:fs";import{setTimeout as wi}from"node:timers/promises";s();s();s();var V=async(e,{init:t,convertChunk:r,getSize:n,truncateChunk:o,addChunk:i,getFinalChunk:a,finalize:c},{maxBuffer:l=Number.POSITIVE_INFINITY}={})=>{if(!ri(e))throw new Error("The first argument must be a Readable, a ReadableStream, or an async iterable.");let p=t();p.length=0;try{for await(let u of e){let h=ni(u),m=r[h](u,p);kr({convertedChunk:m,state:p,getSize:n,truncateChunk:o,addChunk:i,maxBuffer:l})}return ti({state:p,convertChunk:r,getSize:n,truncateChunk:o,addChunk:i,getFinalChunk:a,maxBuffer:l}),c(p)}catch(u){throw u.bufferedData=c(p),u}},ti=({state:e,getSize:t,truncateChunk:r,addChunk:n,getFinalChunk:o,maxBuffer:i})=>{let a=o(e);a!==void 0&&kr({convertedChunk:a,state:e,getSize:t,truncateChunk:r,addChunk:n,maxBuffer:i})},kr=({convertedChunk:e,state:t,getSize:r,truncateChunk:n,addChunk:o,maxBuffer:i})=>{let a=r(e),c=t.length+a;if(c<=i){$r(e,t,o,c);return}let l=n(e,i-t.length);throw l!==void 0&&$r(l,t,o,i),new ue},$r=(e,t,r,n)=>{t.contents=r(e,t,n),t.length=n},ri=e=>typeof e=="object"&&e!==null&&typeof e[Symbol.asyncIterator]=="function",ni=e=>{let t=typeof e;if(t==="string")return"string";if(t!=="object"||e===null)return"others";if(globalThis.Buffer?.isBuffer(e))return"buffer";let r=Dr.call(e);return r==="[object ArrayBuffer]"?"arrayBuffer":r==="[object DataView]"?"dataView":Number.isInteger(e.byteLength)&&Number.isInteger(e.byteOffset)&&Dr.call(e.buffer)==="[object ArrayBuffer]"?"typedArray":"others"},{toString:Dr}=Object.prototype,ue=class extends Error{name="MaxBufferError";constructor(){super("maxBuffer exceeded")}};s();var Je=e=>e,Xe=()=>{},Ke=({contents:e})=>e,fe=e=>{throw new Error(`Streams in object mode are not supported: ${String(e)}`)},de=e=>e.length;s();async function Ye(e,t){return V(e,di,t)}var oi=()=>({contents:new ArrayBuffer(0)}),ii=e=>si.encode(e),si=new TextEncoder,Ur=e=>new Uint8Array(e),Br=e=>new Uint8Array(e.buffer,e.byteOffset,e.byteLength),ai=(e,t)=>e.slice(0,t),ci=(e,{contents:t,length:r},n)=>{let o=Mr()?ui(t,n):li(t,n);return new Uint8Array(o).set(e,r),o},li=(e,t)=>{if(t<=e.byteLength)return e;let r=new ArrayBuffer(Fr(t));return new Uint8Array(r).set(new Uint8Array(e),0),r},ui=(e,t)=>{if(t<=e.maxByteLength)return e.resize(t),e;let r=new ArrayBuffer(t,{maxByteLength:Fr(t)});return new Uint8Array(r).set(new Uint8Array(e),0),r},Fr=e=>Gr**Math.ceil(Math.log(e)/Math.log(Gr)),Gr=2,fi=({contents:e,length:t})=>Mr()?e:e.slice(0,t),Mr=()=>"resize"in ArrayBuffer.prototype,di={init:oi,convertChunk:{string:ii,buffer:Ur,arrayBuffer:Ur,dataView:Br,typedArray:Br,others:fe},getSize:de,truncateChunk:ai,addChunk:ci,getFinalChunk:Xe,finalize:fi};s();async function pe(e,t){if(!("Buffer"in globalThis))throw new Error("getStreamAsBuffer() is only supported in Node.js");try{return qr(await Ye(e,t))}catch(r){throw r.bufferedData!==void 0&&(r.bufferedData=qr(r.bufferedData)),r}}var qr=e=>globalThis.Buffer.from(e);s();async function Ze(e,t){return V(e,yi,t)}var pi=()=>({contents:"",textDecoder:new TextDecoder}),me=(e,{textDecoder:t})=>t.decode(e,{stream:!0}),mi=(e,{contents:t})=>t+e,hi=(e,t)=>e.slice(0,t),gi=({textDecoder:e})=>{let t=e.decode();return t===""?void 0:t},yi={init:pi,convertChunk:{string:Je,buffer:me,arrayBuffer:me,dataView:me,typedArray:me,others:fe},getSize:de,truncateChunk:hi,addChunk:mi,getFinalChunk:gi,finalize:Ke};var Hr=ee(zr(),1),Wr=e=>{if(e!==void 0)throw new TypeError("The `input` and `inputFile` options cannot be both set.")},bi=({input:e,inputFile:t})=>typeof t!="string"?e:(Wr(e),Si(t)),Jr=e=>{let t=bi(e);if(Te(t))throw new TypeError("The `input` option cannot be a stream in sync mode");return t},Ei=({input:e,inputFile:t})=>typeof t!="string"?e:(Wr(e),xi(t)),Xr=(e,t)=>{let r=Ei(t);r!==void 0&&(Te(r)?r.pipe(e.stdin):e.stdin.end(r))},Kr=(e,{all:t})=>{if(!t||!e.stdout&&!e.stderr)return;let r=(0,Hr.default)();return e.stdout&&r.add(e.stdout),e.stderr&&r.add(e.stderr),r},Qe=async(e,t)=>{if(!(!e||t===void 0)){await wi(0),e.destroy();try{return await t}catch(r){return r.bufferedData}}},et=(e,{encoding:t,buffer:r,maxBuffer:n})=>{if(!(!e||!r))return t==="utf8"||t==="utf-8"?Ze(e,{maxBuffer:n}):t===null||t==="buffer"?pe(e,{maxBuffer:n}):vi(e,n,t)},vi=async(e,t,r)=>(await pe(e,{maxBuffer:t})).toString(r),Yr=async({stdout:e,stderr:t,all:r},{encoding:n,buffer:o,maxBuffer:i},a)=>{let c=et(e,{encoding:n,buffer:o,maxBuffer:i}),l=et(t,{encoding:n,buffer:o,maxBuffer:i}),p=et(r,{encoding:n,buffer:o,maxBuffer:i*2});try{return await Promise.all([a,c,l,p])}catch(u){return Promise.all([{error:u,signal:u.signal,timedOut:u.timedOut},Qe(e,c),Qe(t,l),Qe(r,p)])}};s();var Oi=(async()=>{})().constructor.prototype,Pi=["then","catch","finally"].map(e=>[e,Reflect.getOwnPropertyDescriptor(Oi,e)]),tt=(e,t)=>{for(let[r,n]of Pi){let o=typeof t=="function"?(...i)=>Reflect.apply(n.value,t(),i):n.value.bind(t);Reflect.defineProperty(e,r,{...n,value:o})}},Zr=e=>new Promise((t,r)=>{e.on("exit",(n,o)=>{t({exitCode:n,signal:o})}),e.on("error",n=>{r(n)}),e.stdin&&e.stdin.on("error",n=>{r(n)})});s();import{Buffer as Ti}from"node:buffer";import{ChildProcess as Ci}from"node:child_process";var tn=(e,t=[])=>Array.isArray(t)?[e,...t]:[e],Ii=/^[\w.-]+$/,Ai=e=>typeof e!="string"||Ii.test(e)?e:`"${e.replaceAll('"','\\"')}"`,rt=(e,t)=>tn(e,t).join(" "),nt=(e,t)=>tn(e,t).map(r=>Ai(r)).join(" "),Ri=/ +/g;var Qr=e=>{let t=typeof e;if(t==="string")return e;if(t==="number")return String(e);if(t==="object"&&e!==null&&!(e instanceof Ci)&&"stdout"in e){let r=typeof e.stdout;if(r==="string")return e.stdout;if(Ti.isBuffer(e.stdout))return e.stdout.toString();throw new TypeError(`Unexpected "${r}" stdout in template expression`)}throw new TypeError(`Unexpected "${t}" in template expression`)},en=(e,t,r)=>r||e.length===0||t.length===0?[...e,...t]:[...e.slice(0,-1),`${e.at(-1)}${t[0]}`,...t.slice(1)],Li=({templates:e,expressions:t,tokens:r,index:n,template:o})=>{let i=o??e.raw[n],a=i.split(Ri).filter(Boolean),c=en(r,a,i.startsWith(" "));if(n===t.length)return c;let l=t[n],p=Array.isArray(l)?l.map(u=>Qr(u)):[Qr(l)];return en(c,p,i.endsWith(" "))},ot=(e,t)=>{let r=[];for(let[n,o]of e.entries())r=Li({templates:e,expressions:t,tokens:r,index:n,template:o});return r};s();import{debuglog as Ni}from"node:util";import ji from"node:process";var rn=Ni("execa").enabled,he=(e,t)=>String(e).padStart(t,"0"),$i=()=>{let e=new Date;return`${he(e.getHours(),2)}:${he(e.getMinutes(),2)}:${he(e.getSeconds(),2)}.${he(e.getMilliseconds(),3)}`},it=(e,{verbose:t})=>{t&&ji.stderr.write(`[${$i()}] ${e}
9
9
  `)};var Ui=1e3*1e3*100,Bi=({env:e,extendEnv:t,preferLocal:r,localDir:n,execPath:o})=>{let i=t?{...ge.env,...e}:e;return r?xr({env:i,cwd:n,execPath:o}):i},sn=(e,t,r={})=>{let n=on.default._parse(e,t,r);return e=n.command,t=n.args,r=n.options,r={maxBuffer:Ui,buffer:!0,stripFinalNewline:!0,extendEnv:!0,preferLocal:!1,localDir:r.cwd||ge.cwd(),execPath:ge.execPath,encoding:"utf8",reject:!0,cleanup:!0,all:!1,windowsHide:!0,verbose:rn,...r},r.env=Bi(r),r.stdio=Tr(r),ge.platform==="win32"&&ki.basename(e,".exe")==="cmd"&&t.unshift("/q"),{file:e,args:t,options:r,parsed:n}},z=(e,t,r)=>typeof t!="string"&&!Di.isBuffer(t)?r===void 0?void 0:"":e.stripFinalNewline?Ue(t):t;function ye(e,t,r){let n=sn(e,t,r),o=rt(e,t),i=nt(e,t);it(i,n.options),Lr(n.options);let a;try{a=st.spawn(n.file,n.args,n.options)}catch(g){let y=new st.ChildProcess,b=Promise.reject(q({error:g,stdout:"",stderr:"",all:"",command:o,escapedCommand:i,parsed:n,timedOut:!1,isCanceled:!1,killed:!1}));return tt(y,b),y}let c=Zr(a),l=Rr(a,n.options,c),p=Nr(a,n.options,l),u={isCanceled:!1};a.kill=Ir.bind(null,a.kill.bind(a)),a.cancel=Ar.bind(null,a,u);let m=wr(async()=>{let[{error:g,exitCode:y,signal:b,timedOut:E},P,T,C]=await Yr(a,n.options,p),K=z(n.options,P),Y=z(n.options,T),Z=z(n.options,C);if(g||y!==0||b!==null){let Q=q({error:g,exitCode:y,signal:b,stdout:K,stderr:Y,all:Z,command:o,escapedCommand:i,parsed:n,timedOut:E,isCanceled:u.isCanceled||(n.options.signal?n.options.signal.aborted:!1),killed:a.killed});if(!n.options.reject)return Q;throw Q}return{command:o,escapedCommand:i,exitCode:0,stdout:K,stderr:Y,all:Z,failed:!1,timedOut:!1,isCanceled:!1,killed:!1}});return Xr(a,n.options),a.all=Kr(a,n.options),jr(a),tt(a,m),a}function Gi(e,t,r){let n=sn(e,t,r),o=rt(e,t),i=nt(e,t);it(i,n.options);let a=Jr(n.options),c;try{c=st.spawnSync(n.file,n.args,{...n.options,input:a})}catch(u){throw q({error:u,stdout:"",stderr:"",all:"",command:o,escapedCommand:i,parsed:n,timedOut:!1,isCanceled:!1,killed:!1})}let l=z(n.options,c.stdout,c.error),p=z(n.options,c.stderr,c.error);if(c.error||c.status!==0||c.signal!==null){let u=q({stdout:l,stderr:p,error:c.error,signal:c.signal,exitCode:c.status,command:o,escapedCommand:i,parsed:n,timedOut:c.error&&c.error.code==="ETIMEDOUT",isCanceled:!1,killed:c.signal!==null});if(!n.options.reject)return u;throw u}return{command:o,escapedCommand:i,exitCode:0,stdout:l,stderr:p,failed:!1,timedOut:!1,isCanceled:!1,killed:!1}}var Fi=({input:e,inputFile:t,stdio:r})=>e===void 0&&t===void 0&&r===void 0?{stdin:"inherit"}:{},nn=(e={})=>({preferLocal:!0,...Fi(e),...e});function an(e){function t(r,...n){if(!Array.isArray(r))return an({...e,...r});let[o,...i]=ot(r,n);return ye(o,i,nn(e))}return t.sync=(r,...n)=>{if(!Array.isArray(r))throw new TypeError("Please use $(options).sync`command` instead of $.sync(options)`command`.");let[o,...i]=ot(r,n);return Gi(o,i,nn(e))},t}var eu=an();var U=ee(Fn(),1);async function Mn(e,t){let{localTunnel:r}=te();!r&&!await Et(U.bin)&&await(0,U.install)(U.bin);let n=await t.createTunnel({port:e}),o=`http${r?"":"s"}://${n.domain}`,i=new Promise((a,c)=>{let l=r?ye("echo",[n.domain,n.token],{detached:!0}):ye(U.bin,["tunnel","run","--token",n.token]),p=()=>{l.kill()},u=async h=>{h.toString().match(n.domain)?.[0]&&a({domain:o,close:p})};l.stderr?.on("data",u),l.stdout?.on("data",u),l.on("error",h=>{c(h)})});return{domain:o,close:async()=>(await i).close()}}s();var qn=e=>({tunnel:()=>{let t=Date.now();return{finish:({isSuccess:r,failureReason:n})=>e.report(Pt({isSuccess:r,failureReason:n,tunnelCreationTime:Date.now()-t}))}}});function sa(){let e=(0,B.useRef)(),t=Ot({type:"backoffice"}),r=vt();return(0,B.useEffect)(()=>()=>{e.current?.close()},[]),(0,B.useCallback)(async n=>{let o=new re(t),a=qn(r).tunnel();try{let c=await Mn(n,o);return e.current=c,a.finish({isSuccess:!0}),{url:c.domain}}catch(c){throw a.finish({isSuccess:!1,failureReason:c instanceof Error?c.message:"Unknown error"}),c}},[t,r])}s();export{sa as a};
10
- //# sourceMappingURL=chunk-ZRKMSAZQ.js.map
10
+ //# sourceMappingURL=chunk-FBYP5GID.js.map
@@ -1,4 +1,4 @@
1
1
  import { createRequire as _createRequire } from 'node:module';
2
2
  const require = _createRequire(import.meta.url);
3
- import{D as P,H as p,I as B,J as M,N as g,O as A,P as I,Q as w,Ta as O,Va as U,da as T,la as N,ma as h,na as f,oa as x,qa as k}from"./chunk-NXQAYU44.js";import{b as y,d as u,e as c}from"./chunk-DRRMAC33.js";import{e as E,h as l}from"./chunk-V4TR6DCM.js";l();var C=E(y(),1);import{randomUUID as V}from"node:crypto";var _=t=>{let r=new Map;[...t.filter(i=>!(0,C.isType)(i,h.Api)&&!(0,C.isType)(i,h.Event)&&!(0,C.isType)(i,h.ServicePlugin))].sort((i,d)=>i.id.localeCompare(d.id)).forEach(i=>{let d=r.get(i.id)??[];d.push(i),r.set(i.id,d)});let e=new Map;if(r.forEach((i,d)=>{i.length>1&&e.set(d,i)}),e.size)throw new u({code:c.DuplicateComponentIdsError({issues:Array.from(e.entries()).map(([i,d])=>({id:i,components:d.map(n=>(0,C.match)(n,{DashboardPage:({title:s,relativePath:m})=>({name:s,type:"page",path:f(m,"json")}),DashboardPlugin:({title:s,relativePath:m})=>({name:s,type:"plugin",path:f(m,"json")}),DashboardMenuPlugin:({title:s,relativePath:m})=>({name:s,type:"menu-plugin",path:m}),DashboardModal:({title:s,relativePath:m})=>({name:s,type:"modal",path:f(m,"json")}),DashboardSidebarCategory:({label:s})=>({name:s,type:"sidebar-category",path:P}),EmbeddedScript:({relativePath:s})=>({name:s,type:"embedded-script",path:f(s,"json")}),CustomElement:({name:s,relativePath:m})=>({name:s,type:"custom-element",path:f(m,"json")}),Topology:({name:s})=>({name:s,type:"topology",path:""})})).sort((n,s)=>n.name.localeCompare(s.name)),suggestedId:V()}))})})};l();var R=E(y(),1);import{randomUUID as G}from"node:crypto";function L(t){return t!=null&&t!==!1}var H=(t,r)=>{if(t.experiments)return{appId:r,componentId:t.id,spec:t.experiments.enabledBy,variantValue:"true"}},K=t=>({compId:t.id,compType:p.CUSTOM_ELEMENT_WIDGET,compName:t.name,compData:{customElementWidget:{base:{name:t.name},widgetData:{tagName:t.tagName,scriptType:I.ES_MODULE,scriptUrl:"https://dummy.web.com"},size:{width:{defaultWidth:t.width.defaultWidth,allowStretch:t.width.allowStretch,stretchByDefault:t.width.stretchByDefault},height:{defaultHeight:t.height.defaultHeight,heightMode:w.FIXED}},installation:{base:{autoAdd:t.installation?.autoAddToSite,essential:t.installation?.essential,maxInstances:t.installation?.essential?1:0},widget:{region:B.BODY}},behaviors:{},dependencies:t.dependencies}}});async function pe({appId:t,components:r,sentryDSN:a,componentSourceBuilder:o}){return _(r),{appId:t,components:(await Promise.all(r.map((0,R.match)({DashboardPage:async e=>{let i=e.sentryDSN??a;return{compId:e.id,compType:p.BACK_OFFICE_PAGE,compData:{backOfficePage:{hostingPlatform:g.BUSINESS_MANAGER,fullPage:e.sidebar?.whenActive?.hideSidebar,hideInSidebar:e.sidebar?.disabled,priority:e.sidebar?.priority,routePath:e.route.slice(1),title:e.title,pageCategoryId:e.sidebar?.categoryId,activeSidebarPageId:e.sidebar?.whenActive?.selectedPageId,requiredPermission:e.requiredPermission,previousRoutePaths:e.additionalRoutes,...i?{errorReporting:{url:i}}:void 0,...await o(e)}},compName:e.title,experiment:H(e,t)}},DashboardPlugin:async e=>({compId:e.id,compType:p.BACK_OFFICE_EXTENSION_WIDGET,compData:{backOfficeExtensionWidget:{hostingPlatform:g.BUSINESS_MANAGER,extends:e.extends,title:e.title,requiredPermission:e.requiredPermission,width:e.width,height:e.height,...await o(e),...e.sentryDSN?{errorReporting:{url:e.sentryDSN}}:void 0}},compName:e.title}),DashboardMenuPlugin:async e=>({compId:e.id,compType:p.BACK_OFFICE_EXTENSION_MENU_ITEM,compData:{backOfficeExtensionMenuItem:{hostingPlatform:g.BUSINESS_MANAGER,id:e.id,title:e.title,subtitle:e.subtitle,iconKey:e.iconKey,extends:e.extends,action:e.action,requiredPermission:e.requiredPermission,...e.sentryDSN?{errorReporting:{url:e.sentryDSN}}:void 0}},compName:e.title}),DashboardModal:async e=>({compId:e.id,compType:p.BACK_OFFICE_MODAL,compData:{backOfficeModal:{hostingPlatform:g.BUSINESS_MANAGER,title:e.title,requiredPermission:e.requiredPermission,width:e.width,height:e.height,...await o(e),...e.sentryDSN?{errorReporting:{url:e.sentryDSN}}:void 0}},compName:e.title}),DashboardSidebarCategory:async e=>({compId:e.id,compType:p.BACK_OFFICE_SIDEBAR_CATEGORY,compData:{backOfficeSidebarCategory:{hostingPlatform:g.BUSINESS_MANAGER,title:e.label,priority:e.priority}},compName:e.label}),EmbeddedScript:async e=>({compId:e.id,compType:p.EMBEDDED_SCRIPT,compName:e.name,compData:{embeddedScriptComponentData:{name:e.name,pages:M.NONE_PAGES,placement:e.placement,connectArticleUrl:"",embedCategory:e.scriptType,dependencies:e.dependencies,loadOnce:!0,allowedForFreeSite:!0,...await o(e)}}}),CustomElement:async e=>{let{scriptUrl:i,settingsUrl:d}=await o(e),n=K(e);return{...n,compData:{customElementWidget:{...n.compData.customElementWidget,widgetData:{...n.compData.customElementWidget.widgetData,scriptUrl:i},behaviors:{...n.compData.customElementWidget.behaviors,...e.relativePanelPath?{settings:{settingsUrl:d}}:{}}}}}},Topology:async e=>({compId:e.id,compType:p.TOPOLOGY,compName:e.name,compData:{topology:{topology:{backendApiUrl:e.backendApiUrl}}}}),Api:()=>null,Event:async e=>(await o(e)).map(({webhookSlug:d})=>({compName:d,compId:G(),compType:p.WEBHOOK,compData:{webhook:{callbackUrl:"__WEBHOOKS_URL_PLACEHOLDER__",webhookSlug:d}}})),ServicePlugin:()=>null})))).filter(L).flat()}}l();var W=E(y(),1);import{join as q}from"node:path";l();function F(t){if(!("output"in t||Array.isArray(t)))throw new u({code:c.InvalidViteBuildOutput()});return Array.isArray(t)?t.flatMap(o=>o.output):t.output}function v(t,r){let o=F(t).find(e=>e.type==="chunk"&&e.facadeModuleId===r);if(!o)throw new u({code:c.ViteModuleBundleNotFound()});return o.fileName}function j(t,r){let o=F(t).find(e=>e.fileName===r);if(!o||!("source"in o))throw new u({code:c.ViteFileNotFoundInOutput({fileName:r})});return o.source.toString()}async function $(t,r){let a=new URL(t.relativePath,r).href;return await fetch(a).then(e=>e.text())}async function X(t,r){let a=new URL("__get-registered-events",r).href,o=await fetch(a);return o.ok?(await o.json())[`/${t.relativePath}`]??[]:[]}async function Y(t,r){let a=T(r.projectFolder),o=q(a,"getRegisteredEvents.mjs"),{getRegisteredEvents:e}=await import(o);return(await e())[`/${t.relativePath}`]}var b=(t,r,a)=>{if(!r.config.trusted)return{iframeUrl:x(t.id)};let o=k(t.id),e=a?v(a,o):`/@id/${o}?import`;return{scriptAsset:{exportedName:t.id,containerId:r.config.appId,url:e,scriptType:A.MODULE}}},z=async(t,r,a)=>({template:r?j(r,t.relativePath):await $(t,a)}),J=async(t,r,a,o)=>{let e=a?await Y(t,r):await X(t,o);return(await Promise.all(e?.map(N))).map(d=>({webhookSlug:d}))},Q=(t,r)=>{let a=U(t.id);return{scriptUrl:r?v(r,a):`/@id/${a}?import`,settingsUrl:O(t.id)}};function ve({model:t,clientBuildOutput:r,backendBuildOutput:a,clientDevServerUrl:o,backendDevServerUrl:e}){return async i=>(0,W.match)(i,{EmbeddedScript:n=>z(n,r,o),DashboardSidebarCategory:()=>{},CustomElement:n=>Q(n,r),DashboardPage:n=>b(n,t,r),DashboardPlugin:n=>b(n,t,r),DashboardModal:n=>b(n,t,r),DashboardMenuPlugin:()=>{},Topology:()=>{},Api:()=>{},Event:n=>J(n,t,a,e),ServicePlugin:()=>{}})}export{_ as a,K as b,pe as c,ve as d};
4
- //# sourceMappingURL=chunk-BOQ3NCXF.js.map
3
+ import{D as P,H as p,I as B,J as M,N as g,O as A,P as I,Q as w,Ta as O,Va as U,da as T,la as N,ma as h,na as f,oa as x,qa as k}from"./chunk-F4YTZ6XA.js";import{b as y,d as u,e as c}from"./chunk-MB65UVFQ.js";import{e as E,h as l}from"./chunk-V4TR6DCM.js";l();var C=E(y(),1);import{randomUUID as V}from"node:crypto";var _=t=>{let r=new Map;[...t.filter(i=>!(0,C.isType)(i,h.Api)&&!(0,C.isType)(i,h.Event)&&!(0,C.isType)(i,h.ServicePlugin))].sort((i,d)=>i.id.localeCompare(d.id)).forEach(i=>{let d=r.get(i.id)??[];d.push(i),r.set(i.id,d)});let e=new Map;if(r.forEach((i,d)=>{i.length>1&&e.set(d,i)}),e.size)throw new u({code:c.DuplicateComponentIdsError({issues:Array.from(e.entries()).map(([i,d])=>({id:i,components:d.map(n=>(0,C.match)(n,{DashboardPage:({title:s,relativePath:m})=>({name:s,type:"page",path:f(m,"json")}),DashboardPlugin:({title:s,relativePath:m})=>({name:s,type:"plugin",path:f(m,"json")}),DashboardMenuPlugin:({title:s,relativePath:m})=>({name:s,type:"menu-plugin",path:m}),DashboardModal:({title:s,relativePath:m})=>({name:s,type:"modal",path:f(m,"json")}),DashboardSidebarCategory:({label:s})=>({name:s,type:"sidebar-category",path:P}),EmbeddedScript:({relativePath:s})=>({name:s,type:"embedded-script",path:f(s,"json")}),CustomElement:({name:s,relativePath:m})=>({name:s,type:"custom-element",path:f(m,"json")}),Topology:({name:s})=>({name:s,type:"topology",path:""})})).sort((n,s)=>n.name.localeCompare(s.name)),suggestedId:V()}))})})};l();var R=E(y(),1);import{randomUUID as G}from"node:crypto";function L(t){return t!=null&&t!==!1}var H=(t,r)=>{if(t.experiments)return{appId:r,componentId:t.id,spec:t.experiments.enabledBy,variantValue:"true"}},K=t=>({compId:t.id,compType:p.CUSTOM_ELEMENT_WIDGET,compName:t.name,compData:{customElementWidget:{base:{name:t.name},widgetData:{tagName:t.tagName,scriptType:I.ES_MODULE,scriptUrl:"https://dummy.web.com"},size:{width:{defaultWidth:t.width.defaultWidth,allowStretch:t.width.allowStretch,stretchByDefault:t.width.stretchByDefault},height:{defaultHeight:t.height.defaultHeight,heightMode:w.FIXED}},installation:{base:{autoAdd:t.installation?.autoAddToSite,essential:t.installation?.essential,maxInstances:t.installation?.essential?1:0},widget:{region:B.BODY}},behaviors:{},dependencies:t.dependencies}}});async function pe({appId:t,components:r,sentryDSN:a,componentSourceBuilder:o}){return _(r),{appId:t,components:(await Promise.all(r.map((0,R.match)({DashboardPage:async e=>{let i=e.sentryDSN??a;return{compId:e.id,compType:p.BACK_OFFICE_PAGE,compData:{backOfficePage:{hostingPlatform:g.BUSINESS_MANAGER,fullPage:e.sidebar?.whenActive?.hideSidebar,hideInSidebar:e.sidebar?.disabled,priority:e.sidebar?.priority,routePath:e.route.slice(1),title:e.title,pageCategoryId:e.sidebar?.categoryId,activeSidebarPageId:e.sidebar?.whenActive?.selectedPageId,requiredPermission:e.requiredPermission,previousRoutePaths:e.additionalRoutes,...i?{errorReporting:{url:i}}:void 0,...await o(e)}},compName:e.title,experiment:H(e,t)}},DashboardPlugin:async e=>({compId:e.id,compType:p.BACK_OFFICE_EXTENSION_WIDGET,compData:{backOfficeExtensionWidget:{hostingPlatform:g.BUSINESS_MANAGER,extends:e.extends,title:e.title,requiredPermission:e.requiredPermission,width:e.width,height:e.height,...await o(e),...e.sentryDSN?{errorReporting:{url:e.sentryDSN}}:void 0}},compName:e.title}),DashboardMenuPlugin:async e=>({compId:e.id,compType:p.BACK_OFFICE_EXTENSION_MENU_ITEM,compData:{backOfficeExtensionMenuItem:{hostingPlatform:g.BUSINESS_MANAGER,id:e.id,title:e.title,subtitle:e.subtitle,iconKey:e.iconKey,extends:e.extends,action:e.action,requiredPermission:e.requiredPermission,...e.sentryDSN?{errorReporting:{url:e.sentryDSN}}:void 0}},compName:e.title}),DashboardModal:async e=>({compId:e.id,compType:p.BACK_OFFICE_MODAL,compData:{backOfficeModal:{hostingPlatform:g.BUSINESS_MANAGER,title:e.title,requiredPermission:e.requiredPermission,width:e.width,height:e.height,...await o(e),...e.sentryDSN?{errorReporting:{url:e.sentryDSN}}:void 0}},compName:e.title}),DashboardSidebarCategory:async e=>({compId:e.id,compType:p.BACK_OFFICE_SIDEBAR_CATEGORY,compData:{backOfficeSidebarCategory:{hostingPlatform:g.BUSINESS_MANAGER,title:e.label,priority:e.priority}},compName:e.label}),EmbeddedScript:async e=>({compId:e.id,compType:p.EMBEDDED_SCRIPT,compName:e.name,compData:{embeddedScriptComponentData:{name:e.name,pages:M.NONE_PAGES,placement:e.placement,connectArticleUrl:"",embedCategory:e.scriptType,dependencies:e.dependencies,loadOnce:!0,allowedForFreeSite:!0,...await o(e)}}}),CustomElement:async e=>{let{scriptUrl:i,settingsUrl:d}=await o(e),n=K(e);return{...n,compData:{customElementWidget:{...n.compData.customElementWidget,widgetData:{...n.compData.customElementWidget.widgetData,scriptUrl:i},behaviors:{...n.compData.customElementWidget.behaviors,...e.relativePanelPath?{settings:{settingsUrl:d}}:{}}}}}},Topology:async e=>({compId:e.id,compType:p.TOPOLOGY,compName:e.name,compData:{topology:{topology:{backendApiUrl:e.backendApiUrl}}}}),Api:()=>null,Event:async e=>(await o(e)).map(({webhookSlug:d})=>({compName:d,compId:G(),compType:p.WEBHOOK,compData:{webhook:{callbackUrl:"__WEBHOOKS_URL_PLACEHOLDER__",webhookSlug:d}}})),ServicePlugin:()=>null})))).filter(L).flat()}}l();var W=E(y(),1);import{join as q}from"node:path";l();function F(t){if(!("output"in t||Array.isArray(t)))throw new u({code:c.InvalidViteBuildOutput()});return Array.isArray(t)?t.flatMap(o=>o.output):t.output}function v(t,r){let o=F(t).find(e=>e.type==="chunk"&&e.facadeModuleId===r);if(!o)throw new u({code:c.ViteModuleBundleNotFound()});return o.fileName}function j(t,r){let o=F(t).find(e=>e.fileName===r);if(!o||!("source"in o))throw new u({code:c.ViteFileNotFoundInOutput({fileName:r})});return o.source.toString()}async function $(t,r){let a=new URL(t.relativePath,r).href;return await fetch(a).then(e=>e.text())}async function X(t,r){let a=new URL("__get-registered-events",r).href,o=await fetch(a);return o.ok?(await o.json())[`/${t.relativePath}`]??[]:[]}async function Y(t,r){let a=T(r.projectFolder),o=q(a,"getRegisteredEvents.mjs"),{getRegisteredEvents:e}=await import(o);return(await e())[`/${t.relativePath}`]}var b=(t,r,a)=>{if(!r.config.trusted)return{iframeUrl:x(t.id)};let o=k(t.id),e=a?v(a,o):`/@id/${o}?import`;return{scriptAsset:{exportedName:t.id,containerId:r.config.appId,url:e,scriptType:A.MODULE}}},z=async(t,r,a)=>({template:r?j(r,t.relativePath):await $(t,a)}),J=async(t,r,a,o)=>{let e=a?await Y(t,r):await X(t,o);return(e?await Promise.all(e.map(N)):[]).map(d=>({webhookSlug:d}))},Q=(t,r)=>{let a=U(t.id);return{scriptUrl:r?v(r,a):`/@id/${a}?import`,settingsUrl:O(t.id)}};function ve({model:t,clientBuildOutput:r,backendBuildOutput:a,clientDevServerUrl:o,backendDevServerUrl:e}){return async i=>(0,W.match)(i,{EmbeddedScript:n=>z(n,r,o),DashboardSidebarCategory:()=>{},CustomElement:n=>Q(n,r),DashboardPage:n=>b(n,t,r),DashboardPlugin:n=>b(n,t,r),DashboardModal:n=>b(n,t,r),DashboardMenuPlugin:()=>{},Topology:()=>{},Api:()=>{},Event:n=>J(n,t,a,e),ServicePlugin:()=>{}})}export{_ as a,K as b,pe as c,ve as d};
4
+ //# sourceMappingURL=chunk-HTO6ALNX.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/app-manifest/validate.ts","../src/app-manifest/create.ts","../src/app-manifest/component-source.ts","../src/app-manifest/build-output-data-extractor.ts"],"sourcesContent":["import { randomUUID } from 'node:crypto';\nimport { isType, match } from 'variant';\nimport { CliError, CliErrorCode } from '@wix/cli-error';\nimport { CONFIG_FILENAME } from '@wix/cli-core-definitions';\nimport { replaceExtension } from '../dev-center/components/path.js';\nimport type { BackendComponent } from '../dev-center/components/dev-center-component.js';\nimport { DevCenterComponent } from '../dev-center/components/dev-center-component.js';\n\ntype NonBackendComponent = Exclude<DevCenterComponent, BackendComponent>;\n\nexport const validateComponents = (components: DevCenterComponent[]) => {\n const devCenterComponentsToIdMap: Map<string, NonBackendComponent[]> =\n new Map();\n\n const componentsWithConfig = components.filter(\n (component): component is NonBackendComponent =>\n !isType(component, DevCenterComponent.Api) &&\n !isType(component, DevCenterComponent.Event) &&\n !isType(component, DevCenterComponent.ServicePlugin)\n );\n\n const sortedComponentsById = [...componentsWithConfig].sort((a, b) =>\n a.id.localeCompare(b.id)\n );\n sortedComponentsById.forEach((component) => {\n const componentList = devCenterComponentsToIdMap.get(component.id) ?? [];\n componentList.push(component);\n devCenterComponentsToIdMap.set(component.id, componentList);\n });\n\n const devCenterComponentsWithSameIDMap: Map<string, NonBackendComponent[]> =\n new Map();\n\n devCenterComponentsToIdMap.forEach((devCenterComponents, key) => {\n if (devCenterComponents.length > 1) {\n devCenterComponentsWithSameIDMap.set(key, devCenterComponents);\n }\n });\n\n if (devCenterComponentsWithSameIDMap.size) {\n throw new CliError({\n code: CliErrorCode.DuplicateComponentIdsError({\n issues: Array.from(devCenterComponentsWithSameIDMap.entries()).map(\n ([id, devCenterComponents]) => {\n return {\n id,\n components: devCenterComponents\n .map((component) =>\n match(component, {\n DashboardPage: ({ title, relativePath }) => ({\n name: title,\n type: 'page' as const,\n path: replaceExtension(relativePath, 'json'),\n }),\n DashboardPlugin: ({ title, relativePath }) => ({\n name: title,\n type: 'plugin' as const,\n path: replaceExtension(relativePath, 'json'),\n }),\n DashboardMenuPlugin: ({ title, relativePath }) => ({\n name: title,\n type: 'menu-plugin' as const,\n // We can use the relative path since the path already points to the menu config json\n path: relativePath,\n }),\n DashboardModal: ({ title, relativePath }) => ({\n name: title,\n type: 'modal' as const,\n path: replaceExtension(relativePath, 'json'),\n }),\n DashboardSidebarCategory: ({ label }) => ({\n name: label,\n type: 'sidebar-category' as const,\n path: CONFIG_FILENAME,\n }),\n EmbeddedScript: ({ relativePath }) => ({\n name: relativePath,\n type: 'embedded-script' as const,\n path: replaceExtension(relativePath, 'json'),\n }),\n CustomElement: ({ name, relativePath }) => ({\n name,\n type: 'custom-element' as const,\n path: replaceExtension(relativePath, 'json'),\n }),\n Topology: ({ name }) => ({\n name,\n type: 'topology' as const,\n // Topology component doesn't have a config file\n path: '',\n }),\n })\n )\n .sort((a, b) => a.name.localeCompare(b.name)),\n suggestedId: randomUUID(),\n };\n }\n ),\n }),\n });\n }\n};\n","import {\n ComponentType,\n BackOfficeHostingPlatforms,\n EmbeddedScriptPages,\n HeightMode,\n RegionType,\n CustomElementScriptType,\n} from '@wix/ambassador-devcenter-components-v1-component/types';\nimport { match } from 'variant';\nimport { randomUUID } from 'node:crypto';\nimport type {\n AppManifest,\n ComponentExperiment,\n BackofficePage,\n BackofficeExtensionWidget,\n BackofficeExtensionMenuItem,\n BackofficeSideCategory,\n BackofficeModal,\n EmbeddedScript,\n CustomElement,\n Webhook,\n Topology,\n} from '@wix/cli-app-manifest';\nimport { validateComponents } from './validate.js';\nimport type { DevCenterComponent } from '../dev-center/components/dev-center-component.js';\nimport type { ComponentSourceBuilder } from './component-source.js';\n\ntype CreateAppManifestParams = {\n appId: string;\n backendServerUrl?: string;\n components: DevCenterComponent[];\n sentryDSN?: string;\n componentSourceBuilder: ComponentSourceBuilder;\n};\n\nfunction isTruthy<T>(x: T | undefined | null | false): x is T {\n return x !== undefined && x !== null && x !== false;\n}\n\nconst getExperiment = (\n component: DevCenterComponent<'DashboardPage'>,\n appId: string\n): ComponentExperiment => {\n if (component.experiments) {\n return {\n appId,\n componentId: component.id,\n spec: component.experiments.enabledBy,\n variantValue: 'true',\n };\n }\n return undefined;\n};\n\nexport const createCustomElementConfig = (\n component: DevCenterComponent<'CustomElement'>\n): CustomElement => {\n return {\n compId: component.id,\n compType: ComponentType.CUSTOM_ELEMENT_WIDGET as const,\n compName: component.name,\n compData: {\n customElementWidget: {\n base: {\n name: component.name,\n },\n widgetData: {\n tagName: component.tagName,\n scriptType: CustomElementScriptType.ES_MODULE,\n scriptUrl: 'https://dummy.web.com',\n },\n size: {\n width: {\n defaultWidth: component.width.defaultWidth,\n allowStretch: component.width.allowStretch,\n stretchByDefault: component.width.stretchByDefault,\n },\n height: {\n defaultHeight: component.height.defaultHeight,\n heightMode: HeightMode.FIXED,\n },\n },\n installation: {\n base: {\n autoAdd: component.installation?.autoAddToSite,\n essential: component.installation?.essential,\n maxInstances: component.installation?.essential ? 1 : 0,\n },\n widget: { region: RegionType.BODY },\n },\n behaviors: {},\n dependencies: component.dependencies,\n },\n },\n };\n};\n\nexport async function createAppManifest({\n appId,\n components,\n sentryDSN,\n componentSourceBuilder,\n}: CreateAppManifestParams): Promise<AppManifest> {\n validateComponents(components);\n\n return {\n appId,\n components: (\n await Promise.all(\n components.map(\n match({\n DashboardPage: async (component): Promise<BackofficePage> => {\n const componentSentryDSN = component.sentryDSN ?? sentryDSN;\n return {\n compId: component.id,\n compType: ComponentType.BACK_OFFICE_PAGE as const,\n compData: {\n backOfficePage: {\n hostingPlatform:\n BackOfficeHostingPlatforms.BUSINESS_MANAGER,\n fullPage: component.sidebar?.whenActive?.hideSidebar,\n hideInSidebar: component.sidebar?.disabled,\n priority: component.sidebar?.priority,\n routePath: component.route.slice(1),\n title: component.title,\n pageCategoryId: component.sidebar?.categoryId,\n activeSidebarPageId:\n component.sidebar?.whenActive?.selectedPageId,\n requiredPermission: component.requiredPermission,\n previousRoutePaths: component.additionalRoutes,\n ...(componentSentryDSN\n ? { errorReporting: { url: componentSentryDSN } }\n : undefined),\n ...(await componentSourceBuilder(component)),\n },\n },\n compName: component.title,\n experiment: getExperiment(component, appId),\n };\n },\n DashboardPlugin: async (\n component\n ): Promise<BackofficeExtensionWidget> => ({\n compId: component.id,\n compType: ComponentType.BACK_OFFICE_EXTENSION_WIDGET as const,\n compData: {\n backOfficeExtensionWidget: {\n hostingPlatform: BackOfficeHostingPlatforms.BUSINESS_MANAGER,\n extends: component.extends,\n title: component.title,\n requiredPermission: component.requiredPermission,\n width: component.width,\n height: component.height,\n ...(await componentSourceBuilder(component)),\n ...(component.sentryDSN\n ? { errorReporting: { url: component.sentryDSN } }\n : undefined),\n },\n },\n compName: component.title,\n }),\n DashboardMenuPlugin: async (\n component\n ): Promise<BackofficeExtensionMenuItem> => ({\n compId: component.id,\n compType: ComponentType.BACK_OFFICE_EXTENSION_MENU_ITEM as const,\n compData: {\n backOfficeExtensionMenuItem: {\n hostingPlatform: BackOfficeHostingPlatforms.BUSINESS_MANAGER,\n id: component.id,\n title: component.title,\n subtitle: component.subtitle,\n iconKey: component.iconKey,\n extends: component.extends,\n action: component.action,\n requiredPermission: component.requiredPermission,\n ...(component.sentryDSN\n ? { errorReporting: { url: component.sentryDSN } }\n : undefined),\n },\n },\n compName: component.title,\n }),\n DashboardModal: async (component): Promise<BackofficeModal> => ({\n compId: component.id,\n compType: ComponentType.BACK_OFFICE_MODAL as const,\n compData: {\n backOfficeModal: {\n hostingPlatform: BackOfficeHostingPlatforms.BUSINESS_MANAGER,\n title: component.title,\n requiredPermission: component.requiredPermission,\n width: component.width,\n height: component.height,\n ...(await componentSourceBuilder(component)),\n ...(component.sentryDSN\n ? { errorReporting: { url: component.sentryDSN } }\n : undefined),\n },\n },\n compName: component.title,\n }),\n DashboardSidebarCategory: async (\n component\n ): Promise<BackofficeSideCategory> => ({\n compId: component.id,\n compType: ComponentType.BACK_OFFICE_SIDEBAR_CATEGORY as const,\n compData: {\n backOfficeSidebarCategory: {\n hostingPlatform: BackOfficeHostingPlatforms.BUSINESS_MANAGER,\n title: component.label,\n priority: component.priority,\n },\n },\n compName: component.label,\n }),\n EmbeddedScript: async (component): Promise<EmbeddedScript> => ({\n compId: component.id,\n compType: ComponentType.EMBEDDED_SCRIPT as const,\n compName: component.name,\n compData: {\n embeddedScriptComponentData: {\n name: component.name,\n pages: EmbeddedScriptPages.NONE_PAGES,\n placement: component.placement,\n connectArticleUrl: '',\n embedCategory: component.scriptType,\n dependencies: component.dependencies,\n loadOnce: true,\n allowedForFreeSite: true,\n ...(await componentSourceBuilder(component)),\n },\n },\n }),\n CustomElement: async (component): Promise<CustomElement> => {\n const { scriptUrl, settingsUrl } = await componentSourceBuilder(\n component\n );\n\n const basicConfig = createCustomElementConfig(component);\n\n return {\n ...basicConfig,\n compData: {\n customElementWidget: {\n ...basicConfig.compData.customElementWidget,\n widgetData: {\n ...basicConfig.compData.customElementWidget.widgetData,\n scriptUrl,\n },\n behaviors: {\n ...basicConfig.compData.customElementWidget.behaviors,\n ...(component.relativePanelPath\n ? { settings: { settingsUrl } }\n : {}),\n },\n },\n },\n };\n },\n Topology: async (component): Promise<Topology> => {\n return {\n compId: component.id,\n compType: ComponentType.TOPOLOGY as const,\n compName: component.name,\n compData: {\n topology: {\n topology: {\n backendApiUrl: component.backendApiUrl,\n },\n },\n },\n };\n },\n Api: () => null,\n Event: async (component): Promise<Array<Webhook>> => {\n const webhookSlugs = await componentSourceBuilder(component);\n\n return webhookSlugs.map(({ webhookSlug }) => ({\n compName: webhookSlug,\n compId: randomUUID(),\n compType: ComponentType.WEBHOOK,\n compData: {\n webhook: {\n callbackUrl: '__WEBHOOKS_URL_PLACEHOLDER__',\n webhookSlug,\n },\n },\n }));\n },\n ServicePlugin: () => null,\n })\n )\n )\n )\n .filter(isTruthy)\n .flat(),\n };\n}\n","import { BackOfficeScriptAssetType } from '@wix/ambassador-devcenter-components-v1-component/types';\nimport type { ComponentSource } from '@wix/cli-app-manifest';\nimport { match } from 'variant';\nimport { join } from 'node:path';\nimport { getAppBackendBuildFolder } from '@wix/cli-app-definitions';\nimport type * as GetRegisteredEvents from '@wix/cli-cloudflare-runtime/getRegisteredEvents';\nimport { getBackendEventSlug } from '@wix/extensions-data-client';\nimport {\n virtualModuleIdForScriptAsset,\n virtualPathForHTMLAsset,\n} from '../dev-center/components/dashboard/config.js';\nimport {\n virtualModuleIdForCustomElementScriptAsset,\n virtualPathForCustomElementPanelHTMLAsset,\n} from '../dev-center/components/site/config.js';\nimport type { ProjectModel } from '../model.js';\nimport type { ViteBuildOutput } from './build-output-data-extractor.js';\nimport {\n extractModuleBundleContent,\n extractModuleBundleName,\n} from './build-output-data-extractor.js';\nimport type { DevCenterComponent } from '../dev-center/components/dev-center-component.js';\n\ntype DashboardSource =\n | {\n iframeUrl: string;\n scriptAsset?: never;\n }\n | {\n scriptAsset: ComponentSource['scriptAsset'];\n iframeUrl?: never;\n };\n\ntype EmbeddedScriptSource = {\n template: string;\n};\n\ntype CustomElementSource = { scriptUrl: string; settingsUrl: string };\n\ntype EventSource = {\n webhookSlug: string;\n};\n\nexport type ComponentSourceBuilder = <T extends DevCenterComponent>(\n component: T\n) => Promise<\n T extends DevCenterComponent<'EmbeddedScript'>\n ? EmbeddedScriptSource\n : T extends DevCenterComponent<'CustomElement'>\n ? CustomElementSource\n : T extends DevCenterComponent<'DashboardPage'>\n ? DashboardSource\n : T extends DevCenterComponent<'DashboardPlugin'>\n ? DashboardSource\n : T extends DevCenterComponent<'DashboardModal'>\n ? DashboardSource\n : T extends DevCenterComponent<'Event'>\n ? Array<EventSource>\n : undefined\n>;\n\nasync function getEmbeddedScriptDevTemplate(\n component: DevCenterComponent<'EmbeddedScript'>,\n backendDevServerUrl?: string\n) {\n const url = new URL(component.relativePath, backendDevServerUrl).href;\n const devTemplate = await fetch(url).then((res) => res.text());\n\n return devTemplate;\n}\n\nasync function getEventDevSlugs(\n component: DevCenterComponent<'Event'>,\n backendDevServerUrl?: string\n) {\n const url = new URL(`__get-registered-events`, backendDevServerUrl).href;\n const response = await fetch(url);\n\n if (!response.ok) {\n return [];\n }\n\n const eventTypes = await response.json();\n const devSlugs = eventTypes[`/${component.relativePath}`] ?? [];\n\n return devSlugs as Array<string>;\n}\n\nasync function getEventProdSlugs(\n component: DevCenterComponent<'Event'>,\n model: ProjectModel\n) {\n const backendBuildFolder = getAppBackendBuildFolder(model.projectFolder);\n const outputFilepath = join(backendBuildFolder, 'getRegisteredEvents.mjs');\n\n const { getRegisteredEvents } = await (import(outputFilepath) as Promise<\n typeof GetRegisteredEvents\n >);\n\n const eventsMap = await getRegisteredEvents();\n\n return eventsMap[`/${component.relativePath}`];\n}\n\nconst dashboardSourceBuilder = (\n component:\n | DevCenterComponent<'DashboardPage'>\n | DevCenterComponent<'DashboardPlugin'>\n | DevCenterComponent<'DashboardModal'>,\n model: ProjectModel,\n clientBuildOutput?: ViteBuildOutput\n): DashboardSource => {\n if (!model.config.trusted) {\n return {\n iframeUrl: virtualPathForHTMLAsset(component.id),\n };\n }\n const moduleId = virtualModuleIdForScriptAsset(component.id);\n const componentUrl = clientBuildOutput\n ? extractModuleBundleName(clientBuildOutput, moduleId)\n : `/@id/${moduleId}?import`;\n\n return {\n scriptAsset: {\n exportedName: component.id,\n containerId: model.config.appId,\n url: componentUrl,\n scriptType: BackOfficeScriptAssetType.MODULE,\n },\n };\n};\n\nconst embeddedScriptBuilder = async (\n component: DevCenterComponent<'EmbeddedScript'>,\n clientBuildOutput?: ViteBuildOutput,\n devServerUrl?: string\n): Promise<EmbeddedScriptSource> => {\n return {\n template: clientBuildOutput\n ? extractModuleBundleContent(clientBuildOutput, component.relativePath)\n : await getEmbeddedScriptDevTemplate(component, devServerUrl),\n };\n};\n\nconst eventSourceBuilder = async (\n component: DevCenterComponent<'Event'>,\n model: ProjectModel,\n backendBuildOutput?: ViteBuildOutput,\n backendDevServerUrl?: string\n): Promise<Array<EventSource>> => {\n const fullSlugNames = backendBuildOutput\n ? await getEventProdSlugs(component, model)\n : await getEventDevSlugs(component, backendDevServerUrl);\n\n const webhookSlugs = await Promise.all(\n fullSlugNames?.map(getBackendEventSlug)\n );\n\n return webhookSlugs.map((webhookSlug) => ({\n webhookSlug,\n }));\n};\n\nconst customElementBuilder = (\n component: DevCenterComponent<'CustomElement'>,\n clientBuildOutput?: ViteBuildOutput\n): CustomElementSource => {\n const moduleId = virtualModuleIdForCustomElementScriptAsset(component.id);\n const componentUrl = clientBuildOutput\n ? extractModuleBundleName(clientBuildOutput, moduleId)\n : `/@id/${moduleId}?import`;\n\n return {\n scriptUrl: componentUrl,\n settingsUrl: virtualPathForCustomElementPanelHTMLAsset(component.id),\n };\n};\n\nexport function getComponentSourceBuilder({\n model,\n clientBuildOutput,\n backendBuildOutput,\n clientDevServerUrl,\n backendDevServerUrl,\n}: {\n model: ProjectModel;\n clientBuildOutput?: ViteBuildOutput;\n backendBuildOutput?: ViteBuildOutput;\n clientDevServerUrl?: string;\n backendDevServerUrl?: string;\n}) {\n return (async (component: DevCenterComponent) => {\n const source = match(component, {\n EmbeddedScript: (embeddedScriptComponent) =>\n embeddedScriptBuilder(\n embeddedScriptComponent,\n clientBuildOutput,\n clientDevServerUrl\n ),\n DashboardSidebarCategory: () => {},\n CustomElement: (customElementComponent) =>\n customElementBuilder(customElementComponent, clientBuildOutput),\n DashboardPage: (dashboardPageComponent) =>\n dashboardSourceBuilder(\n dashboardPageComponent,\n model,\n clientBuildOutput\n ),\n DashboardPlugin: (dashboardPluginComponent) =>\n dashboardSourceBuilder(\n dashboardPluginComponent,\n model,\n clientBuildOutput\n ),\n DashboardModal: (dashboardModalComponent) =>\n dashboardSourceBuilder(\n dashboardModalComponent,\n model,\n clientBuildOutput\n ),\n DashboardMenuPlugin: () => {},\n Topology: () => {},\n Api: () => {},\n Event: (component) =>\n eventSourceBuilder(\n component,\n model,\n backendBuildOutput,\n backendDevServerUrl\n ),\n ServicePlugin: () => {},\n });\n\n return source;\n }) as ComponentSourceBuilder;\n}\n","import { CliError, CliErrorCode } from '@wix/cli-error';\nimport type { build } from 'vite';\n\nexport type ViteBuildOutput = Awaited<ReturnType<typeof build>>;\n\nfunction extractBuildOutputs(buildOutput: ViteBuildOutput) {\n const isValidRollupOutput =\n 'output' in buildOutput || Array.isArray(buildOutput);\n\n if (!isValidRollupOutput) {\n throw new CliError({ code: CliErrorCode.InvalidViteBuildOutput() });\n }\n\n const outputs = Array.isArray(buildOutput)\n ? buildOutput.flatMap((output) => output.output)\n : buildOutput.output;\n\n return outputs;\n}\n\nexport function extractModuleBundleName(\n buildOutput: ViteBuildOutput,\n moduleId: string\n) {\n const outputs = extractBuildOutputs(buildOutput);\n\n const output = outputs.find(\n (output) => output.type === 'chunk' && output.facadeModuleId === moduleId\n );\n\n if (!output) {\n throw new CliError({ code: CliErrorCode.ViteModuleBundleNotFound() });\n }\n\n return output.fileName;\n}\n\nexport function extractModuleBundleContent(\n buildOutput: ViteBuildOutput,\n fileName: string\n) {\n const outputs = extractBuildOutputs(buildOutput);\n\n const output = outputs.find((output) => output.fileName === fileName);\n\n if (!output || !('source' in output)) {\n throw new CliError({\n code: CliErrorCode.ViteFileNotFoundInOutput({ fileName }),\n });\n }\n\n return output.source.toString();\n}\n"],"mappings":";;8PAAAA,IACA,IAAAC,EAA8B,SAD9B,OAAS,cAAAC,MAAkB,cAUpB,IAAMC,EAAsBC,GAAqC,CACtE,IAAMC,EACJ,I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,CACF,EACF,oBAAqB,IAAM,CAAC,EAC5B,SAAU,IAAM,CAAC,EACjB,IAAK,IAAM,CAAC,EACZ,MAAQd,GACNwB,EACExB,EACAO,EACAkB,EACAxB,CACF,EACF,cAAe,IAAM,CAAC,CACxB,CAAC,CAIL","names":["init_esm_shims","import_variant","randomUUID","validateComponents","components","devCenterComponentsToIdMap","component","DevCenterComponent","a","b","componentList","devCenterComponentsWithSameIDMap","devCenterComponents","key","CliError","CliErrorCode","id","title","relativePath","replaceExtension","label","CONFIG_FILENAME","name","randomUUID","init_esm_shims","import_variant","randomUUID","isTruthy","x","getExperiment","component","appId","createCustomElementConfig","ComponentType","CustomElementScriptType","HeightMode","RegionType","createAppManifest","components","sentryDSN","componentSourceBuilder","validateComponents","componentSentryDSN","BackOfficeHostingPlatforms","EmbeddedScriptPages","scriptUrl","settingsUrl","basicConfig","webhookSlug","randomUUID","init_esm_shims","import_variant","join","init_esm_shims","extractBuildOutputs","buildOutput","CliError","CliErrorCode","output","extractModuleBundleName","moduleId","extractModuleBundleContent","fileName","getEmbeddedScriptDevTemplate","component","backendDevServerUrl","url","res","getEventDevSlugs","response","getEventProdSlugs","model","backendBuildFolder","getAppBackendBuildFolder","outputFilepath","join","getRegisteredEvents","dashboardSourceBuilder","clientBuildOutput","virtualPathForHTMLAsset","moduleId","virtualModuleIdForScriptAsset","componentUrl","extractModuleBundleName","BackOfficeScriptAssetType","embeddedScriptBuilder","devServerUrl","extractModuleBundleContent","eventSourceBuilder","backendBuildOutput","fullSlugNames","getBackendEventSlug","webhookSlug","customElementBuilder","virtualModuleIdForCustomElementScriptAsset","virtualPathForCustomElementPanelHTMLAsset","getComponentSourceBuilder","clientDevServerUrl","embeddedScriptComponent","customElementComponent","dashboardPageComponent","dashboardPluginComponent","dashboardModalComponent"]}
1
+ {"version":3,"sources":["../src/app-manifest/validate.ts","../src/app-manifest/create.ts","../src/app-manifest/component-source.ts","../src/app-manifest/build-output-data-extractor.ts"],"sourcesContent":["import { randomUUID } from 'node:crypto';\nimport { isType, match } from 'variant';\nimport { CliError, CliErrorCode } from '@wix/cli-error';\nimport { CONFIG_FILENAME } from '@wix/cli-core-definitions';\nimport { replaceExtension } from '../dev-center/components/path.js';\nimport type { BackendComponent } from '../dev-center/components/dev-center-component.js';\nimport { DevCenterComponent } from '../dev-center/components/dev-center-component.js';\n\ntype NonBackendComponent = Exclude<DevCenterComponent, BackendComponent>;\n\nexport const validateComponents = (components: DevCenterComponent[]) => {\n const devCenterComponentsToIdMap: Map<string, NonBackendComponent[]> =\n new Map();\n\n const componentsWithConfig = components.filter(\n (component): component is NonBackendComponent =>\n !isType(component, DevCenterComponent.Api) &&\n !isType(component, DevCenterComponent.Event) &&\n !isType(component, DevCenterComponent.ServicePlugin)\n );\n\n const sortedComponentsById = [...componentsWithConfig].sort((a, b) =>\n a.id.localeCompare(b.id)\n );\n sortedComponentsById.forEach((component) => {\n const componentList = devCenterComponentsToIdMap.get(component.id) ?? [];\n componentList.push(component);\n devCenterComponentsToIdMap.set(component.id, componentList);\n });\n\n const devCenterComponentsWithSameIDMap: Map<string, NonBackendComponent[]> =\n new Map();\n\n devCenterComponentsToIdMap.forEach((devCenterComponents, key) => {\n if (devCenterComponents.length > 1) {\n devCenterComponentsWithSameIDMap.set(key, devCenterComponents);\n }\n });\n\n if (devCenterComponentsWithSameIDMap.size) {\n throw new CliError({\n code: CliErrorCode.DuplicateComponentIdsError({\n issues: Array.from(devCenterComponentsWithSameIDMap.entries()).map(\n ([id, devCenterComponents]) => {\n return {\n id,\n components: devCenterComponents\n .map((component) =>\n match(component, {\n DashboardPage: ({ title, relativePath }) => ({\n name: title,\n type: 'page' as const,\n path: replaceExtension(relativePath, 'json'),\n }),\n DashboardPlugin: ({ title, relativePath }) => ({\n name: title,\n type: 'plugin' as const,\n path: replaceExtension(relativePath, 'json'),\n }),\n DashboardMenuPlugin: ({ title, relativePath }) => ({\n name: title,\n type: 'menu-plugin' as const,\n // We can use the relative path since the path already points to the menu config json\n path: relativePath,\n }),\n DashboardModal: ({ title, relativePath }) => ({\n name: title,\n type: 'modal' as const,\n path: replaceExtension(relativePath, 'json'),\n }),\n DashboardSidebarCategory: ({ label }) => ({\n name: label,\n type: 'sidebar-category' as const,\n path: CONFIG_FILENAME,\n }),\n EmbeddedScript: ({ relativePath }) => ({\n name: relativePath,\n type: 'embedded-script' as const,\n path: replaceExtension(relativePath, 'json'),\n }),\n CustomElement: ({ name, relativePath }) => ({\n name,\n type: 'custom-element' as const,\n path: replaceExtension(relativePath, 'json'),\n }),\n Topology: ({ name }) => ({\n name,\n type: 'topology' as const,\n // Topology component doesn't have a config file\n path: '',\n }),\n })\n )\n .sort((a, b) => a.name.localeCompare(b.name)),\n suggestedId: randomUUID(),\n };\n }\n ),\n }),\n });\n }\n};\n","import {\n ComponentType,\n BackOfficeHostingPlatforms,\n EmbeddedScriptPages,\n HeightMode,\n RegionType,\n CustomElementScriptType,\n} from '@wix/ambassador-devcenter-components-v1-component/types';\nimport { match } from 'variant';\nimport { randomUUID } from 'node:crypto';\nimport type {\n AppManifest,\n ComponentExperiment,\n BackofficePage,\n BackofficeExtensionWidget,\n BackofficeExtensionMenuItem,\n BackofficeSideCategory,\n BackofficeModal,\n EmbeddedScript,\n CustomElement,\n Webhook,\n Topology,\n} from '@wix/cli-app-manifest';\nimport { validateComponents } from './validate.js';\nimport type { DevCenterComponent } from '../dev-center/components/dev-center-component.js';\nimport type { ComponentSourceBuilder } from './component-source.js';\n\ntype CreateAppManifestParams = {\n appId: string;\n backendServerUrl?: string;\n components: DevCenterComponent[];\n sentryDSN?: string;\n componentSourceBuilder: ComponentSourceBuilder;\n};\n\nfunction isTruthy<T>(x: T | undefined | null | false): x is T {\n return x !== undefined && x !== null && x !== false;\n}\n\nconst getExperiment = (\n component: DevCenterComponent<'DashboardPage'>,\n appId: string\n): ComponentExperiment => {\n if (component.experiments) {\n return {\n appId,\n componentId: component.id,\n spec: component.experiments.enabledBy,\n variantValue: 'true',\n };\n }\n return undefined;\n};\n\nexport const createCustomElementConfig = (\n component: DevCenterComponent<'CustomElement'>\n): CustomElement => {\n return {\n compId: component.id,\n compType: ComponentType.CUSTOM_ELEMENT_WIDGET as const,\n compName: component.name,\n compData: {\n customElementWidget: {\n base: {\n name: component.name,\n },\n widgetData: {\n tagName: component.tagName,\n scriptType: CustomElementScriptType.ES_MODULE,\n scriptUrl: 'https://dummy.web.com',\n },\n size: {\n width: {\n defaultWidth: component.width.defaultWidth,\n allowStretch: component.width.allowStretch,\n stretchByDefault: component.width.stretchByDefault,\n },\n height: {\n defaultHeight: component.height.defaultHeight,\n heightMode: HeightMode.FIXED,\n },\n },\n installation: {\n base: {\n autoAdd: component.installation?.autoAddToSite,\n essential: component.installation?.essential,\n maxInstances: component.installation?.essential ? 1 : 0,\n },\n widget: { region: RegionType.BODY },\n },\n behaviors: {},\n dependencies: component.dependencies,\n },\n },\n };\n};\n\nexport async function createAppManifest({\n appId,\n components,\n sentryDSN,\n componentSourceBuilder,\n}: CreateAppManifestParams): Promise<AppManifest> {\n validateComponents(components);\n\n return {\n appId,\n components: (\n await Promise.all(\n components.map(\n match({\n DashboardPage: async (component): Promise<BackofficePage> => {\n const componentSentryDSN = component.sentryDSN ?? sentryDSN;\n return {\n compId: component.id,\n compType: ComponentType.BACK_OFFICE_PAGE as const,\n compData: {\n backOfficePage: {\n hostingPlatform:\n BackOfficeHostingPlatforms.BUSINESS_MANAGER,\n fullPage: component.sidebar?.whenActive?.hideSidebar,\n hideInSidebar: component.sidebar?.disabled,\n priority: component.sidebar?.priority,\n routePath: component.route.slice(1),\n title: component.title,\n pageCategoryId: component.sidebar?.categoryId,\n activeSidebarPageId:\n component.sidebar?.whenActive?.selectedPageId,\n requiredPermission: component.requiredPermission,\n previousRoutePaths: component.additionalRoutes,\n ...(componentSentryDSN\n ? { errorReporting: { url: componentSentryDSN } }\n : undefined),\n ...(await componentSourceBuilder(component)),\n },\n },\n compName: component.title,\n experiment: getExperiment(component, appId),\n };\n },\n DashboardPlugin: async (\n component\n ): Promise<BackofficeExtensionWidget> => ({\n compId: component.id,\n compType: ComponentType.BACK_OFFICE_EXTENSION_WIDGET as const,\n compData: {\n backOfficeExtensionWidget: {\n hostingPlatform: BackOfficeHostingPlatforms.BUSINESS_MANAGER,\n extends: component.extends,\n title: component.title,\n requiredPermission: component.requiredPermission,\n width: component.width,\n height: component.height,\n ...(await componentSourceBuilder(component)),\n ...(component.sentryDSN\n ? { errorReporting: { url: component.sentryDSN } }\n : undefined),\n },\n },\n compName: component.title,\n }),\n DashboardMenuPlugin: async (\n component\n ): Promise<BackofficeExtensionMenuItem> => ({\n compId: component.id,\n compType: ComponentType.BACK_OFFICE_EXTENSION_MENU_ITEM as const,\n compData: {\n backOfficeExtensionMenuItem: {\n hostingPlatform: BackOfficeHostingPlatforms.BUSINESS_MANAGER,\n id: component.id,\n title: component.title,\n subtitle: component.subtitle,\n iconKey: component.iconKey,\n extends: component.extends,\n action: component.action,\n requiredPermission: component.requiredPermission,\n ...(component.sentryDSN\n ? { errorReporting: { url: component.sentryDSN } }\n : undefined),\n },\n },\n compName: component.title,\n }),\n DashboardModal: async (component): Promise<BackofficeModal> => ({\n compId: component.id,\n compType: ComponentType.BACK_OFFICE_MODAL as const,\n compData: {\n backOfficeModal: {\n hostingPlatform: BackOfficeHostingPlatforms.BUSINESS_MANAGER,\n title: component.title,\n requiredPermission: component.requiredPermission,\n width: component.width,\n height: component.height,\n ...(await componentSourceBuilder(component)),\n ...(component.sentryDSN\n ? { errorReporting: { url: component.sentryDSN } }\n : undefined),\n },\n },\n compName: component.title,\n }),\n DashboardSidebarCategory: async (\n component\n ): Promise<BackofficeSideCategory> => ({\n compId: component.id,\n compType: ComponentType.BACK_OFFICE_SIDEBAR_CATEGORY as const,\n compData: {\n backOfficeSidebarCategory: {\n hostingPlatform: BackOfficeHostingPlatforms.BUSINESS_MANAGER,\n title: component.label,\n priority: component.priority,\n },\n },\n compName: component.label,\n }),\n EmbeddedScript: async (component): Promise<EmbeddedScript> => ({\n compId: component.id,\n compType: ComponentType.EMBEDDED_SCRIPT as const,\n compName: component.name,\n compData: {\n embeddedScriptComponentData: {\n name: component.name,\n pages: EmbeddedScriptPages.NONE_PAGES,\n placement: component.placement,\n connectArticleUrl: '',\n embedCategory: component.scriptType,\n dependencies: component.dependencies,\n loadOnce: true,\n allowedForFreeSite: true,\n ...(await componentSourceBuilder(component)),\n },\n },\n }),\n CustomElement: async (component): Promise<CustomElement> => {\n const { scriptUrl, settingsUrl } = await componentSourceBuilder(\n component\n );\n\n const basicConfig = createCustomElementConfig(component);\n\n return {\n ...basicConfig,\n compData: {\n customElementWidget: {\n ...basicConfig.compData.customElementWidget,\n widgetData: {\n ...basicConfig.compData.customElementWidget.widgetData,\n scriptUrl,\n },\n behaviors: {\n ...basicConfig.compData.customElementWidget.behaviors,\n ...(component.relativePanelPath\n ? { settings: { settingsUrl } }\n : {}),\n },\n },\n },\n };\n },\n Topology: async (component): Promise<Topology> => {\n return {\n compId: component.id,\n compType: ComponentType.TOPOLOGY as const,\n compName: component.name,\n compData: {\n topology: {\n topology: {\n backendApiUrl: component.backendApiUrl,\n },\n },\n },\n };\n },\n Api: () => null,\n Event: async (component): Promise<Array<Webhook>> => {\n const webhookSlugs = await componentSourceBuilder(component);\n\n return webhookSlugs.map(({ webhookSlug }) => ({\n compName: webhookSlug,\n compId: randomUUID(),\n compType: ComponentType.WEBHOOK,\n compData: {\n webhook: {\n callbackUrl: '__WEBHOOKS_URL_PLACEHOLDER__',\n webhookSlug,\n },\n },\n }));\n },\n ServicePlugin: () => null,\n })\n )\n )\n )\n .filter(isTruthy)\n .flat(),\n };\n}\n","import { BackOfficeScriptAssetType } from '@wix/ambassador-devcenter-components-v1-component/types';\nimport type { ComponentSource } from '@wix/cli-app-manifest';\nimport { match } from 'variant';\nimport { join } from 'node:path';\nimport { getAppBackendBuildFolder } from '@wix/cli-app-definitions';\nimport type * as GetRegisteredEvents from '@wix/cli-cloudflare-runtime/getRegisteredEvents';\nimport { getBackendEventSlug } from '@wix/extensions-data-client';\nimport {\n virtualModuleIdForScriptAsset,\n virtualPathForHTMLAsset,\n} from '../dev-center/components/dashboard/config.js';\nimport {\n virtualModuleIdForCustomElementScriptAsset,\n virtualPathForCustomElementPanelHTMLAsset,\n} from '../dev-center/components/site/config.js';\nimport type { ProjectModel } from '../model.js';\nimport type { ViteBuildOutput } from './build-output-data-extractor.js';\nimport {\n extractModuleBundleContent,\n extractModuleBundleName,\n} from './build-output-data-extractor.js';\nimport type { DevCenterComponent } from '../dev-center/components/dev-center-component.js';\n\ntype DashboardSource =\n | {\n iframeUrl: string;\n scriptAsset?: never;\n }\n | {\n scriptAsset: ComponentSource['scriptAsset'];\n iframeUrl?: never;\n };\n\ntype EmbeddedScriptSource = {\n template: string;\n};\n\ntype CustomElementSource = { scriptUrl: string; settingsUrl: string };\n\ntype EventSource = {\n webhookSlug: string;\n};\n\nexport type ComponentSourceBuilder = <T extends DevCenterComponent>(\n component: T\n) => Promise<\n T extends DevCenterComponent<'EmbeddedScript'>\n ? EmbeddedScriptSource\n : T extends DevCenterComponent<'CustomElement'>\n ? CustomElementSource\n : T extends DevCenterComponent<'DashboardPage'>\n ? DashboardSource\n : T extends DevCenterComponent<'DashboardPlugin'>\n ? DashboardSource\n : T extends DevCenterComponent<'DashboardModal'>\n ? DashboardSource\n : T extends DevCenterComponent<'Event'>\n ? Array<EventSource>\n : undefined\n>;\n\nasync function getEmbeddedScriptDevTemplate(\n component: DevCenterComponent<'EmbeddedScript'>,\n backendDevServerUrl?: string\n) {\n const url = new URL(component.relativePath, backendDevServerUrl).href;\n const devTemplate = await fetch(url).then((res) => res.text());\n\n return devTemplate;\n}\n\nasync function getEventDevSlugs(\n component: DevCenterComponent<'Event'>,\n backendDevServerUrl?: string\n) {\n const url = new URL(`__get-registered-events`, backendDevServerUrl).href;\n const response = await fetch(url);\n\n if (!response.ok) {\n return [];\n }\n\n const eventTypes = await response.json();\n const devSlugs = eventTypes[`/${component.relativePath}`] ?? [];\n\n return devSlugs as Array<string>;\n}\n\nasync function getEventProdSlugs(\n component: DevCenterComponent<'Event'>,\n model: ProjectModel\n) {\n const backendBuildFolder = getAppBackendBuildFolder(model.projectFolder);\n const outputFilepath = join(backendBuildFolder, 'getRegisteredEvents.mjs');\n\n const { getRegisteredEvents } = await (import(outputFilepath) as Promise<\n typeof GetRegisteredEvents\n >);\n\n const eventsMap = await getRegisteredEvents();\n\n return eventsMap[`/${component.relativePath}`];\n}\n\nconst dashboardSourceBuilder = (\n component:\n | DevCenterComponent<'DashboardPage'>\n | DevCenterComponent<'DashboardPlugin'>\n | DevCenterComponent<'DashboardModal'>,\n model: ProjectModel,\n clientBuildOutput?: ViteBuildOutput\n): DashboardSource => {\n if (!model.config.trusted) {\n return {\n iframeUrl: virtualPathForHTMLAsset(component.id),\n };\n }\n const moduleId = virtualModuleIdForScriptAsset(component.id);\n const componentUrl = clientBuildOutput\n ? extractModuleBundleName(clientBuildOutput, moduleId)\n : `/@id/${moduleId}?import`;\n\n return {\n scriptAsset: {\n exportedName: component.id,\n containerId: model.config.appId,\n url: componentUrl,\n scriptType: BackOfficeScriptAssetType.MODULE,\n },\n };\n};\n\nconst embeddedScriptBuilder = async (\n component: DevCenterComponent<'EmbeddedScript'>,\n clientBuildOutput?: ViteBuildOutput,\n devServerUrl?: string\n): Promise<EmbeddedScriptSource> => {\n return {\n template: clientBuildOutput\n ? extractModuleBundleContent(clientBuildOutput, component.relativePath)\n : await getEmbeddedScriptDevTemplate(component, devServerUrl),\n };\n};\n\nconst eventSourceBuilder = async (\n component: DevCenterComponent<'Event'>,\n model: ProjectModel,\n backendBuildOutput?: ViteBuildOutput,\n backendDevServerUrl?: string\n): Promise<Array<EventSource>> => {\n const fullSlugNames = backendBuildOutput\n ? await getEventProdSlugs(component, model)\n : await getEventDevSlugs(component, backendDevServerUrl);\n\n const webhookSlugs = fullSlugNames\n ? await Promise.all(\n fullSlugNames.map(getBackendEventSlug)\n )\n : [];\n\n return webhookSlugs.map((webhookSlug) => ({\n webhookSlug,\n }));\n};\n\nconst customElementBuilder = (\n component: DevCenterComponent<'CustomElement'>,\n clientBuildOutput?: ViteBuildOutput\n): CustomElementSource => {\n const moduleId = virtualModuleIdForCustomElementScriptAsset(component.id);\n const componentUrl = clientBuildOutput\n ? extractModuleBundleName(clientBuildOutput, moduleId)\n : `/@id/${moduleId}?import`;\n\n return {\n scriptUrl: componentUrl,\n settingsUrl: virtualPathForCustomElementPanelHTMLAsset(component.id),\n };\n};\n\nexport function getComponentSourceBuilder({\n model,\n clientBuildOutput,\n backendBuildOutput,\n clientDevServerUrl,\n backendDevServerUrl,\n}: {\n model: ProjectModel;\n clientBuildOutput?: ViteBuildOutput;\n backendBuildOutput?: ViteBuildOutput;\n clientDevServerUrl?: string;\n backendDevServerUrl?: string;\n}) {\n return (async (component: DevCenterComponent) => {\n const source = match(component, {\n EmbeddedScript: (embeddedScriptComponent) =>\n embeddedScriptBuilder(\n embeddedScriptComponent,\n clientBuildOutput,\n clientDevServerUrl\n ),\n DashboardSidebarCategory: () => {},\n CustomElement: (customElementComponent) =>\n customElementBuilder(customElementComponent, clientBuildOutput),\n DashboardPage: (dashboardPageComponent) =>\n dashboardSourceBuilder(\n dashboardPageComponent,\n model,\n clientBuildOutput\n ),\n DashboardPlugin: (dashboardPluginComponent) =>\n dashboardSourceBuilder(\n dashboardPluginComponent,\n model,\n clientBuildOutput\n ),\n DashboardModal: (dashboardModalComponent) =>\n dashboardSourceBuilder(\n dashboardModalComponent,\n model,\n clientBuildOutput\n ),\n DashboardMenuPlugin: () => {},\n Topology: () => {},\n Api: () => {},\n Event: (component) =>\n eventSourceBuilder(\n component,\n model,\n backendBuildOutput,\n backendDevServerUrl\n ),\n ServicePlugin: () => {},\n });\n\n return source;\n }) as ComponentSourceBuilder;\n}\n","import { CliError, CliErrorCode } from '@wix/cli-error';\nimport type { build } from 'vite';\n\nexport type ViteBuildOutput = Awaited<ReturnType<typeof build>>;\n\nfunction extractBuildOutputs(buildOutput: ViteBuildOutput) {\n const isValidRollupOutput =\n 'output' in buildOutput || Array.isArray(buildOutput);\n\n if (!isValidRollupOutput) {\n throw new CliError({ code: CliErrorCode.InvalidViteBuildOutput() });\n }\n\n const outputs = Array.isArray(buildOutput)\n ? buildOutput.flatMap((output) => output.output)\n : buildOutput.output;\n\n return outputs;\n}\n\nexport function extractModuleBundleName(\n buildOutput: ViteBuildOutput,\n moduleId: string\n) {\n const outputs = extractBuildOutputs(buildOutput);\n\n const output = outputs.find(\n (output) => output.type === 'chunk' && output.facadeModuleId === moduleId\n );\n\n if (!output) {\n throw new CliError({ code: CliErrorCode.ViteModuleBundleNotFound() });\n }\n\n return output.fileName;\n}\n\nexport function extractModuleBundleContent(\n buildOutput: ViteBuildOutput,\n fileName: string\n) {\n const outputs = extractBuildOutputs(buildOutput);\n\n const output = outputs.find((output) => output.fileName === fileName);\n\n if (!output || !('source' in output)) {\n throw new CliError({\n code: CliErrorCode.ViteFileNotFoundInOutput({ fileName }),\n });\n }\n\n return output.source.toString();\n}\n"],"mappings":";;8PAAAA,IACA,IAAAC,EAA8B,SAD9B,OAAS,cAAAC,MAAkB,cAUpB,IAAMC,EAAsBC,GAAqC,CACtE,IAAMC,EACJ,IAAI,IASuB,CAAC,GAPDD,EAAW,OACrCE,GACC,IAAC,UAAOA,EAAWC,EAAmB,GAAG,GACzC,IAAC,UAAOD,EAAWC,EAAmB,KAAK,GAC3C,IAAC,UAAOD,EAAWC,EAAmB,aAAa,CACvD,CAEqD,EAAE,KAAK,CAACC,EAAGC,IAC9DD,EAAE,GAAG,cAAcC,EAAE,EAAE,CACzB,EACqB,QAASH,GAAc,CAC1C,IAAMI,EAAgBL,EAA2B,IAAIC,EAAU,EAAE,GAAK,CAAC,EACvEI,EAAc,KAAKJ,CAAS,EAC5BD,EAA2B,IAAIC,EAAU,GAAII,CAAa,CAC5D,CAAC,EAED,IAAMC,EACJ,IAAI,IAQN,GANAN,EAA2B,QAAQ,CAACO,EAAqBC,IAAQ,C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AWO,CAAK,EACxC,MAAMH,EAAiBJ,EAAWC,CAAmB,EAQzD,OANqByB,EACjB,MAAM,QAAQ,IACdA,EAAc,IAAIC,CAAmB,CACvC,EACE,CAAC,GAEe,IAAKC,IAAiB,CACxC,YAAAA,CACF,EAAE,CACJ,EAEMC,EAAuB,CAC3B7B,EACAc,IACwB,CACxB,IAAME,EAAWc,EAA2C9B,EAAU,EAAE,EAKxE,MAAO,CACL,UALmBc,EACjBK,EAAwBL,EAAmBE,CAAQ,EACnD,QAAQA,CAAQ,UAIlB,YAAae,EAA0C/B,EAAU,EAAE,CACrE,CACF,EAEO,SAASgC,GAA0B,CACxC,MAAAzB,EACA,kBAAAO,EACA,mBAAAW,EACA,mBAAAQ,EACA,oBAAAhC,CACF,EAMG,CACD,MAAQ,OAAOD,MACE,SAAMA,EAAW,CAC9B,eAAiBkC,GACfb,EACEa,EACApB,EACAmB,CACF,EACF,yBAA0B,IAAM,CAAC,EACjC,cAAgBE,GACdN,EAAqBM,EAAwBrB,CAAiB,EAChE,cAAgBsB,GACdvB,EACEuB,EACA7B,EACAO,CACF,EACF,gBAAkBuB,GAChBxB,EACEwB,EACA9B,EACAO,CACF,EACF,eAAiBwB,GACfzB,EACEyB,EACA/B,EACAO,CACF,EACF,oBAAqB,IAAM,CAAC,EAC5B,SAAU,IAAM,CAAC,EACjB,IAAK,IAAM,CAAC,EACZ,MAAQd,GACNwB,EACExB,EACAO,EACAkB,EACAxB,CACF,EACF,cAAe,IAAM,CAAC,CACxB,CAAC,CAIL","names":["init_esm_shims","import_variant","randomUUID","validateComponents","components","devCenterComponentsToIdMap","component","DevCenterComponent","a","b","componentList","devCenterComponentsWithSameIDMap","devCenterComponents","key","CliError","CliErrorCode","id","title","relativePath","replaceExtension","label","CONFIG_FILENAME","name","randomUUID","init_esm_shims","import_variant","randomUUID","isTruthy","x","getExperiment","component","appId","createCustomElementConfig","ComponentType","CustomElementScriptType","HeightMode","RegionType","createAppManifest","components","sentryDSN","componentSourceBuilder","validateComponents","componentSentryDSN","BackOfficeHostingPlatforms","EmbeddedScriptPages","scriptUrl","settingsUrl","basicConfig","webhookSlug","randomUUID","init_esm_shims","import_variant","join","init_esm_shims","extractBuildOutputs","buildOutput","CliError","CliErrorCode","output","extractModuleBundleName","moduleId","extractModuleBundleContent","fileName","getEmbeddedScriptDevTemplate","component","backendDevServerUrl","url","res","getEventDevSlugs","response","getEventProdSlugs","model","backendBuildFolder","getAppBackendBuildFolder","outputFilepath","join","getRegisteredEvents","dashboardSourceBuilder","clientBuildOutput","virtualPathForHTMLAsset","moduleId","virtualModuleIdForScriptAsset","componentUrl","extractModuleBundleName","BackOfficeScriptAssetType","embeddedScriptBuilder","devServerUrl","extractModuleBundleContent","eventSourceBuilder","backendBuildOutput","fullSlugNames","getBackendEventSlug","webhookSlug","customElementBuilder","virtualModuleIdForCustomElementScriptAsset","virtualPathForCustomElementPanelHTMLAsset","getComponentSourceBuilder","clientDevServerUrl","embeddedScriptComponent","customElementComponent","dashboardPageComponent","dashboardPluginComponent","dashboardModalComponent"]}
@@ -1,4 +1,4 @@
1
1
  import { createRequire as _createRequire } from 'node:module';
2
2
  const require = _createRequire(import.meta.url);
3
- import{v as f,w as m}from"./chunk-NXQAYU44.js";import{f as l,g as d,v as U}from"./chunk-DRRMAC33.js";import{e as O,h as o}from"./chunk-V4TR6DCM.js";o();import{randomUUID as k}from"node:crypto";function L(r,t){r.updateDefaults(N(t))}function N(r){return r?{_client_id:r,_uuid:r,logged_user_id:r,logged_account_id:r,target_account_id:r}:{_client_id:k()}}o();import{uptime as h}from"node:process";o();var u=O(U(),1);import V from"node:os";import{platform as b,version as B}from"node:process";function w({cliVersion:r,flow:t}){return{...t?{flow:t}:{},cliVersion:r,isCI:u.default,nodeVersion:B,osName:F(),osVersion:V.release()}}function F(){switch(b){case"darwin":return"mac";case"win32":return"windows";default:return"linux"}}var x=()=>Math.round(h()*1e3);function j({biLogger:r,command:t,flow:y,cliVersion:E,projectId:p,extensions:n}){let S=t.opts(),C=t.args,_=new Set(["apiKey"]),c=Object.fromEntries(Object.entries(S).map(([e,s])=>{let v=_.has(e)?"<censored>":s;return[e,v]})),i={command:t.name(),arguments:C.join(","),flags:Object.keys(c).length?JSON.stringify(c):""};return r.report(f({...w({cliVersion:E,flow:y}),...i,...p?{projectId:p}:{},isValid:!0})),{succeed(){r.report(m({...i,...n?{extensions:JSON.stringify(n)}:{},duration:x(),isSuccess:!0,isValid:!0}))},failed(e){let s=l(e)?{errorType:d(e)?"SystemError":"UserError",errorName:e.name,errorMessage:e.message}:e instanceof Error?{errorType:"UnknownError",errorName:e.name,errorMessage:e.message}:{errorType:"UnknownError",errorMessage:JSON.stringify(e)};r.report(m({...i,...s,...n?{extensions:JSON.stringify(n)}:{},duration:x(),isSuccess:!1,isValid:!0}))}}}o();export{L as a,j as b};
4
- //# sourceMappingURL=chunk-EI7JLTNP.js.map
3
+ import{v as f,w as m}from"./chunk-F4YTZ6XA.js";import{f as l,g as d,v as U}from"./chunk-MB65UVFQ.js";import{e as O,h as o}from"./chunk-V4TR6DCM.js";o();import{randomUUID as k}from"node:crypto";function L(r,t){r.updateDefaults(N(t))}function N(r){return r?{_client_id:r,_uuid:r,logged_user_id:r,logged_account_id:r,target_account_id:r}:{_client_id:k()}}o();import{uptime as h}from"node:process";o();var u=O(U(),1);import V from"node:os";import{platform as b,version as B}from"node:process";function w({cliVersion:r,flow:t}){return{...t?{flow:t}:{},cliVersion:r,isCI:u.default,nodeVersion:B,osName:F(),osVersion:V.release()}}function F(){switch(b){case"darwin":return"mac";case"win32":return"windows";default:return"linux"}}var x=()=>Math.round(h()*1e3);function j({biLogger:r,command:t,flow:y,cliVersion:E,projectId:p,extensions:n}){let S=t.opts(),C=t.args,_=new Set(["apiKey"]),c=Object.fromEntries(Object.entries(S).map(([e,s])=>{let v=_.has(e)?"<censored>":s;return[e,v]})),i={command:t.name(),arguments:C.join(","),flags:Object.keys(c).length?JSON.stringify(c):""};return r.report(f({...w({cliVersion:E,flow:y}),...i,...p?{projectId:p}:{},isValid:!0})),{succeed(){r.report(m({...i,...n?{extensions:JSON.stringify(n)}:{},duration:x(),isSuccess:!0,isValid:!0}))},failed(e){let s=l(e)?{errorType:d(e)?"SystemError":"UserError",errorName:e.name,errorMessage:e.message}:e instanceof Error?{errorType:"UnknownError",errorName:e.name,errorMessage:e.message}:{errorType:"UnknownError",errorMessage:JSON.stringify(e)};r.report(m({...i,...s,...n?{extensions:JSON.stringify(n)}:{},duration:x(),isSuccess:!1,isValid:!0}))}}}o();export{L as a,j as b};
4
+ //# sourceMappingURL=chunk-HTY6QIPX.js.map
@@ -1,6 +1,6 @@
1
1
  import { createRequire as _createRequire } from 'node:module';
2
2
  const require = _createRequire(import.meta.url);
3
- import{e as x}from"./chunk-NXQAYU44.js";import{a as b,c as a}from"./chunk-DRRMAC33.js";import{e as s,h as n}from"./chunk-V4TR6DCM.js";n();var r=s(b(),1),c=s(a(),1);import{dirname as L}from"node:path";import{appendFileSync as D,mkdirSync as w}from"node:fs";n();var f=s(x(),1),l=s(a(),1);function u(e){if(f.HttpClient.isHttpError(e))return e;let o=e instanceof Error?l.default.cause(e):null;return o?u(o):null}n();function d(e){return{request:{baseURL:e.config?.baseURL,url:e.config?.url,method:e.config?.method,headers:e.config?.headers,data:e.config?.data},response:{code:e.code,message:e.message,status:e.response?.status,headers:e.response?.headers,data:e.response?.data}}}function y(e,o){try{let t=`----- CLI crash report at ${new Date().toISOString()}
3
+ import{e as x}from"./chunk-F4YTZ6XA.js";import{a as b,c as a}from"./chunk-MB65UVFQ.js";import{e as s,h as n}from"./chunk-V4TR6DCM.js";n();var r=s(b(),1),c=s(a(),1);import{dirname as L}from"node:path";import{appendFileSync as D,mkdirSync as w}from"node:fs";n();var f=s(x(),1),l=s(a(),1);function u(e){if(f.HttpClient.isHttpError(e))return e;let o=e instanceof Error?l.default.cause(e):null;return o?u(o):null}n();function d(e){return{request:{baseURL:e.config?.baseURL,url:e.config?.url,method:e.config?.method,headers:e.config?.headers,data:e.config?.data},response:{code:e.code,message:e.message,status:e.response?.status,headers:e.response?.headers,data:e.response?.data}}}function y(e,o){try{let t=`----- CLI crash report at ${new Date().toISOString()}
4
4
  `;if(o instanceof Error){t+=`Error Trace
5
5
  `,t+=`${c.default.fullStack(o)}
6
6
  `,t+=`Error Info
@@ -8,4 +8,4 @@ import{e as x}from"./chunk-NXQAYU44.js";import{a as b,c as a}from"./chunk-DRRMAC
8
8
  `;let i=u(o);i&&(t+=`Request Info
9
9
  `,t+=`${JSON.stringify(d(i),null,2)}
10
10
  `)}w(L(e),{recursive:!0}),D(e,t)}catch{}}var m=(0,r.createContext)(null),k=({filePath:e,children:o})=>{let t=(0,r.useCallback)(i=>y(e,i),[e]);return r.default.createElement(m.Provider,{value:t},o)},R=()=>{let e=(0,r.useContext)(m);if(e===null)throw new Error("useDebugLog() cannot be used without an <DebugLogProvider>");return e};export{k as a,R as b};
11
- //# sourceMappingURL=chunk-ARPIRV47.js.map
11
+ //# sourceMappingURL=chunk-JAY5356K.js.map
@@ -1,4 +1,4 @@
1
1
  import { createRequire as _createRequire } from 'node:module';
2
2
  const require = _createRequire(import.meta.url);
3
- import{Ka as e,u as r}from"./chunk-NXQAYU44.js";import{a as m}from"./chunk-DRRMAC33.js";import{e as t,h as i}from"./chunk-V4TR6DCM.js";i();var p=t(m(),1);function f(){let o=r();return(0,p.useMemo)(()=>e(o),[o])}i();export{f as a};
4
- //# sourceMappingURL=chunk-H2U4YHRN.js.map
3
+ import{Ka as e,u as r}from"./chunk-F4YTZ6XA.js";import{a as m}from"./chunk-MB65UVFQ.js";import{e as t,h as i}from"./chunk-V4TR6DCM.js";i();var p=t(m(),1);function f(){let o=r();return(0,p.useMemo)(()=>e(o),[o])}i();export{f as a};
4
+ //# sourceMappingURL=chunk-JKG4PFVP.js.map
@@ -1,11 +1,11 @@
1
1
  import { createRequire as _createRequire } from 'node:module';
2
2
  const require = _createRequire(import.meta.url);
3
- var a={"create_version_command_def.option.version_type":"The type of version you would like to create","create_version_command_def.option.approve_preview":"Approve preview automatically","create_version_command_def.option.base_url":"The base url for when static files have been uploaded to an external cdn","create_version_command_def.option.site":"The site id to use for Application Preview urls, defaults to the current selected development site","dev_command_def.option.https":"Start local dev server on https","app_preview_command_def.option.site":"The site id to use for Application Preview urls, defaults to the current selected development site","app_preview_command_def.option.base_url":"The base url for when static files have been uploaded to an external cdn","app_preview_command_def.option.no_input":"Disable command interactivity","general.loading":"Loading...","general.no_site_id_configured":"You don't have a Development Site currently configured","general.site_id_not_found":`Your currently configured Development Site was not found ({id})
3
+ var o={"create_version_command_def.option.version_type":"The type of version you would like to create","create_version_command_def.option.approve_preview":"Approve preview automatically","create_version_command_def.option.base_url":"The base url for when static files have been uploaded to an external cdn","create_version_command_def.option.site":"The site id to use for Application Preview urls, defaults to the current selected development site","dev_command_def.option.https":"Start local dev server on https","app_preview_command_def.option.site":"The site id to use for Application Preview urls, defaults to the current selected development site","app_preview_command_def.option.base_url":"The base url for when static files have been uploaded to an external cdn","app_preview_command_def.option.no_input":"Disable command interactivity","general.loading":"Loading...","general.no_site_id_configured":"You don't have a Development Site currently configured","general.site_id_not_found":`Your currently configured Development Site was not found ({id})
4
4
  This may happen because the site was deleted or your access has been revoked.
5
5
 
6
6
  Please select another Development Site to continue`,"general.dashboard_page_text":"<0>Click here</0> to open your application in the Wix Dashboard","general.dashboard_page_click_here":"Click here","general.close_screen":"Press <0/> to close","logs.backend.clear":"Press <0/> to clear","general.write_dev_log_failure.message":"Can not write logs to <0>{path}</0>","general.write_dev_log_failure.hint":"Make sure the file has proper permissions and is accessible","general.open_page_error":"Failed to open the browser for <0>{title}</0>, use the following URL to open it in your browser:","general.dashboard_pages_viewer.title":"Press a number key to open a dashboard page:","general.dashboard_plugins_viewer.title":"Press a number key to open a dashboard plugin:","general.dashboard_menu_plugins_viewer.title":"Press a number key to open a dashboard menu plugin:","general.backend_api_viewer.title":"Press a number key to trigger an api:","general.backend_plugin_viewer.title":"Press a number key to trigger an plugin:","general.backend_events_viewer.title":"Press a number key to trigger an event:","general.numeric_viewer.show_more":"View more...","general.platform.site":"Site","general.platform.unpublished_site":"Site (publish the site to enable site preview)","general.platform.editor":"Editor","general.platform.dashboard":"Dashboard","general.platform.backend":"Backend","general.platform.none":`Your project doesn't seem to have any extensions.
7
7
 
8
8
  Extensions are the building blocks of your app.
9
- Make sure it is configured properly, or read our <0>documentation</0> to start developing your first extension.`,"general.dev_site.current":"Current Development Site: {name}","general.view_changes":"View your local changes: <0>(Press a key to open)</0>","general.open_preview.title_single":"Open the preview on the","general.open_preview.title_multiple":"Open the preview on:","preview_command.creating_preview":"Creating a preview...","preview_command.creating_preview_success":"Preview created successfully!","preview_command.uploading_files":"Uploading your application files...","preview_command.uploading_files_success":"Uploaded successfully!","dev_command.site_provider.loading":"Resolving development site...","dev_command.custom_elements_migration.loading":"Checking site widgets installation...","dev_command.dev_environment.loading":"Starting dev environment...","dev_command.dev_environment.started":"Local development environment ready.","dev_command.dev_environment.url":"Application served on <0/>","dev_command.dev_environment.backend_url":"Backend served on <0/>","dev_command.dev_environment.https_url.open_info":"Press <0/> to open & approve dev server","dev_command.dev_environment.https_url.failed_to_open":"Unable to open <0/> for approving selfsigned certificate. Please manually access the link.","dev_command.dev_site.change":"Press <0/> to change your current Development Site","dev_command.site_selector.error":"Failed to change Development Site!","dev_command.dashboard_pages_screen.select_label":"Select a dashboard page to open","dev_command.dashboard_menu_plugin_screen.select_label":"Select a dashboard menu plugin to open","dev_command.dashboard_page_plugin_screen.select_label":"Select a dashboard plugin to open","dev_command.dashboard_modal_screen.select_label":"Select a dashboard modal to open","dev_command.backend_apis_screen.select_label":"Select api to trigger","dev_command.backend_events_screen.select_label":"Select event to trigger","dev_command.backend_plugins_screen.select_label":"Select plugin to trigger","dev_command.dev_env_logs.title":"Dev Environment Logs:","dev_command.dev_env_backend_logs.title":"Press <0/> to view full logs from {path}","dev_command.dev_env_backend_logs_screen.title":"Server Environment Full Logs","dev_command.dev_env_logs.empty":"No logs to show","dev_command.dev_env_logs.listening_to_logs":"Listening to logs...","dev_command.dev_env_logs.scroll_explain":"Use the arrow keys to scroll","dev_command.config_change":"Loading App Manifest changes...","dev_command.config_update":"App Manifest updated. Refresh existing browser tabs to view the latest changes.","dev_command.config_didnt_update":"No App Manifest update occurred","dev_command.tunneling.confirm":"To proceed, we'll set up a secure tunnel from your machine for development purposes","dev_command.tunneling.abort_dev":"Operation aborted. Tunneling is necessary to run your application.","dev_command.new_custom_element.warning":"New site widget detected. Press <0/> to open the Site Editor and complete the installation.","dev_command.new_custom_element.confirm_reinstall":"Press <0/> when you reinstalled app on your dev site","dev_command.new_custom_element.reinstall_error":"We had troubles with adding your new site widget. You can try to do it by yourself. Press <0/> to continue","serve_command.starting_serve_environment":"Starting serve environment...","serve_command.starting_serve_environment_success":"Serve environment started! <0/>","serve_command.production_build":"Application is using a production build","create_version_command.creating_version":"Creating a version...","create_version_command.creating_version_success":"Successfully created v{version}","create_version_command.current_version":"Your current version is: v{version}","create_version_command.confirm_version_events_warning":"Any configured events will be deployed to production and take effect once a new version of your app is created.","create_version_command.confirm_version_creation":"Continue with creating the new version?","create_version_command.confirm_version_creation_aborted":"Version creation aborted","create_version_command.version_type_question":"What type of version would you like to create?","create_version_command.version_type_question_minor":"Minor (v{version})","create_version_command.version_type_question_major":"Major (v{version})","create_version_command.check_preview_before_version_release":"Before creating a new version, let's create a preview of your app","create_version_command.checking_validation_status":"Checking if this version can be submitted\u2026","create_version_command.version_validation_ok":"This version can be submitted for review in the <0>Dev Center</0>","create_version_command.version_validation_has_failures":`This version has blockers preventing it from being submitted for review.
10
- Please fix them and submit your app in the <0>Dev Center</0>.`,"embedded_script.type.essential":"Essential","embedded_script.type.essential.description":"Must load regardless of policy","embedded_script.type.functional":"Functional","embedded_script.type.functional.description":"Adds optional functionality to the site","embedded_script.type.analytics":"Analytics","embedded_script.type.analytics.description":"Adds analytics abilities to the site","embedded_script.type.advertising":"Advertising","embedded_script.type.advertising.description":"Adds advertising content or advertising tracking to the site","embedded_script.placement.head":"Head","embedded_script.placement.head.description":"In the document head","embedded_script.placement.body_start":"Body Start","embedded_script.placement.body_start.description":"Prepended in the body","embedded_script.placement.body_end":"Body End","embedded_script.placement.body_end.description":"Appended in the body","generate_command.description":"Add new extensions to your application","generate_command.flow.dashboard_category":"Dashboard","generate_command.flow.site_category":"Site","generate_command.flow.backend_category":"Backend","generate_command.flow.dashboard_page":"Dashboard Page","generate_command.flow.sidebar_category":"Sidebar Category","generate_command.flow.dashboard_plugin":"Dashboard Plugin","generate_command.flow.dashboard_menu_plugin":"Dashboard Menu Plugin","generate_command.flow.embedded_script":"Embedded Script","generate_command.flow.event":"Event","generate_command.flow.api.title":"API","generate_command.flow.dashboard_modal":"Dashboard Modal","generate_command.flow.custom_element":"Site Widget","generate_command.flow.choose_flow":"What kind of extension would you like to generate?","generate_command.generation.loading":"Generating {subject}...","generate_command.generation.done":"\u{1F680} The new {extensionType} has been generated successfully.","generate_command.generation.learn_more":"\u{1F4DA} Learn more about {extensionType}: <0/>","generate_command.generation.new_dependencies":"\u26A0\uFE0F New app dependencies have been added. Please run <0>npm install</0> before continuing to work.","generate_command.dashboard_page.choose_route":"Enter the route for the new page:","generate_command.dashboard_page.route_placeholder":"my-page","generate_command.dashboard_page.choose_title":"Page title:","generate_command.dashboard_page.title_placeholder":"My Page","generate_command.dashboard_page.add_to_category":"Add to a sidebar category?","generate_command.dashboard_page.choose_category":"Sidebar category:","generate_command.sidebar_category.choose_label":"Enter the label for the new category:","generate_command.sidebar_category.label_placeholder":"My App","generate_command.custom_element.validation.element_exists":"The site widget folder must be unique, please choose a name that has not been used yet in your application.","generate_command.custom_element.validation.element_invalid":"The site widget folder must be a valid path ([a-z-/]+) and must not start with a dot.","generate_command.custom_element.choose_folder":"Widget folder (relative to src/site/widgets/custom-elements):","generate_command.custom_element.folder_placeholder":"my-widget","generate_command.custom_element.choose_name":"Widget name:","generate_command.custom_element.name_placeholder":"My Widget","generate_command.embedded_script.validation.script_exists":"The script folder must be unique, please choose a name that has not been used yet in your application.","generate_command.embedded_script.validation.script_invalid":"The script folder must be a valid path ([a-z0-9-/]+) and must not start with a dot.","generate_command.embedded_script.choose_folder":"Script folder (relative to src/site/embedded-scripts):","generate_command.embedded_script.folder_placeholder":"my-script","generate_command.embedded_script.choose_name":"Script name:","generate_command.embedded_script.name_placeholder":"My Script","generate_command.embedded_script.choose_type":"Script type:","generate_command.embedded_script.type_info":"Will be used for GDPR and cookie consent purposes","generate_command.embedded_script.choose_placement":"Placement:","generate_command.embedded_script.placement_info":"Will determine where the script is embedded","generate_command.dashboard_modal.validation.folder_exists":"The modal folder must be unique, please choose a folder name that has not been used yet in your application.","generate_command.dashboard_modal.validation.folder_invalid":"The modal folder must be a valid path ([a-z0-9-/]+) and must not start with a dot.","generate_command.dashboard_modal.choose_folder":"Enter the folder name for the new modal:","generate_command.dashboard_modal.folder_placeholder":"my-modal","generate_command.dashboard_modal.choose_title":"Modal title:","generate_command.dashboard_modal.title_placeholder":"My Modal","generate_command.dashboard_plugin.what_to_extend":"What would you like to extend?","generate_command.dashboard_plugin.what_to_extend.description":"Plugins let you extend Wix apps by embedding your UI inside dedicated slots within a dashboard page (<0>read more</0>)","generate_command.dashboard_plugin.what_to_extend.item_description":"<0>read more</0>","generate_command.dashboard_plugin.choose_folder":"Plugin folder (relative to src/dashboard/plugins)","generate_command.dashboard_plugin.folder_placeholder":"my-plugin","generate_command.dashboard_plugin.choose_title":"Plugin title","generate_command.dashboard_plugin.title_placeholder":"My Plugin","generate_command.required_app":"Would you like to set {appName} as a requirement for your app?","generate_command.required_app.description":"This means sites must have {appName} installed before installing your app (<0>read more</0>)","generate_command.dashboard_menu_plugin.what_to_extend":"What would you like to extend?","generate_command.dashboard_menu_plugin.what_to_extend.description":"Menu Plugins let you extend Wix apps by adding a menu item in a pre-defined slot in a menu on a dashboard page (<0>read more</0>)","generate_command.dashboard_menu_plugin.what_to_extend.item_description":"<0>read more</0>","generate_command.dashboard_menu_plugin.what_to_do":"What action will happen after clicking on the menu item?","generate_command.dashboard_menu_plugin.what_to_do.navigate_to_page":"Navigate to a page","generate_command.dashboard_menu_plugin.what_to_do.open_modal":"Open a modal","generate_command.dashboard_menu_plugin.what_to_do.navigate_to_page.choose_page":"Choose a page the menu item will navigate to:","generate_command.dashboard_menu_plugin.what_to_do.navigate_to_page.choose_page.info":"Choose from a list of available pages in your project or manually add a page from a different app","generate_command.dashboard_menu_plugin.what_to_do.navigate_to_page.choose_page.other":"Use a page from a different app","generate_command.dashboard_menu_plugin.what_to_do.navigate_to_page.choose_page.other.choose_page_id":"What is the unique id of the page?","generate_command.dashboard_menu_plugin.what_to_do.navigate_to_page.choose_page.other.page_id_invalid":"Page id has to be in the format of a uuid","generate_command.dashboard_menu_plugin.what_to_do.open_modal.choose_component":"Choose the modal to open:","generate_command.dashboard_menu_plugin.what_to_do.open_modal.choose_component.info":"Choose from a list of available modals in your project or manually add a modal from a different app","generate_command.dashboard_menu_plugin.what_to_do.open_modal.choose_component.other":"Use a modal from a different app","generate_command.dashboard_menu_plugin.what_to_do.open_modal.choose_component.other.choose_component_id":"What is the unique id of the modal?","generate_command.dashboard_menu_plugin.what_to_do.open_modal.choose_component.other.component_id_invalid":"Modal id has to be in the format of a uuid","generate_command.dashboard_menu_plugin.choose_folder":"Menu Plugin folder (relative to src/dashboard/menu-plugins)","generate_command.dashboard_menu_plugin.folder_placeholder":"my-plugin","generate_command.dashboard_menu_plugin.choose_title":"Menu Plugin title","generate_command.dashboard_menu_plugin.title_placeholder":"My Plugin","generate_command.api.api_placeholder":"my-api","generate_command.api.choose_api_name":"How would you like to name your API?","generate_command.api.choose_folder":"API folder (relative to src/backend/api):","generate_command.api.choose_api_name.error":"API name must be unique, can not include special characters or spaces, and must be shorter than 20 characters","generate_command.api.choose_method":"Choose an API method","generate_command.event.choose_folder":"Event folder (relative to src/backend/events):","generate_command.event.folder_placeholder":"my-event","generate_command.event.choose_folder.error":"Event name must be unique, can not include special characters or spaces, and must be shorter than 20 characters","logs_command.logs_without_version":"Logs command without the version is not supported, add `--version {version}`","logs_command.connecting":"Connecting to the log server...","logs_command.listening_to_logs":"Listening to logs from the server.","logs_command.prod_env_logs":"Prod Environment logs for the version: {version}"};export{a};
11
- //# sourceMappingURL=chunk-J5ANBYWF.js.map
9
+ Make sure it is configured properly, or read our <0>documentation</0> to start developing your first extension.`,"general.dev_site.current":"Current Development Site: {name}","general.view_changes":"View your local changes: <0>(Press a key to open)</0>","general.open_preview.title_single":"Open the preview on the","general.open_preview.title_multiple":"Open the preview on:","preview_command.creating_preview":"Creating a preview...","preview_command.creating_preview_success":"Preview created successfully!","preview_command.uploading_files":"Uploading your application files...","preview_command.uploading_files_success":"Uploaded successfully!","dev_command.site_provider.loading":"Resolving development site...","dev_command.custom_elements_migration.loading":"Checking site widgets installation...","preview_command.note_about_temporary_backend":"This preview URL will be available for three days. Afterward, you can create a new preview if you need to.","dev_command.dev_environment.loading":"Starting dev environment...","dev_command.dev_environment.started":"Local development environment ready.","dev_command.dev_environment.url":"Application served on <0/>","dev_command.dev_environment.backend_url":"Backend served on <0/>","dev_command.dev_environment.https_url.open_info":"Press <0/> to open & approve dev server","dev_command.dev_environment.https_url.failed_to_open":"Unable to open <0/> for approving selfsigned certificate. Please manually access the link.","dev_command.dev_site.change":"Press <0/> to change your current Development Site","dev_command.site_selector.error":"Failed to change Development Site!","dev_command.dashboard_pages_screen.select_label":"Select a dashboard page to open","dev_command.dashboard_menu_plugin_screen.select_label":"Select a dashboard menu plugin to open","dev_command.dashboard_page_plugin_screen.select_label":"Select a dashboard plugin to open","dev_command.dashboard_modal_screen.select_label":"Select a dashboard modal to open","dev_command.backend_apis_screen.select_label":"Select api to trigger","dev_command.backend_events_screen.select_label":"Select event to trigger","dev_command.backend_plugins_screen.select_label":"Select plugin to trigger","dev_command.dev_env_logs.title":"Dev Environment Logs:","dev_command.dev_env_backend_logs.title":"Press <0/> to view full logs from {path}","dev_command.dev_env_backend_logs_screen.title":"Server Environment Full Logs","dev_command.dev_env_logs.empty":"No logs to show","dev_command.dev_env_logs.listening_to_logs":"Listening to logs...","dev_command.dev_env_logs.scroll_explain":"Use the arrow keys to scroll","dev_command.config_change":"Loading App Manifest changes...","dev_command.config_update":"App Manifest updated. Refresh existing browser tabs to view the latest changes.","dev_command.config_didnt_update":"No App Manifest update occurred","dev_command.tunneling.confirm":"To proceed, we'll set up a secure tunnel from your machine for development purposes","dev_command.tunneling.abort_dev":"Operation aborted. Tunneling is necessary to run your application.","dev_command.new_custom_element.warning":"New site widget detected. Press <0/> to open the Site Editor and complete the installation.","dev_command.new_custom_element.confirm_reinstall":"Press <0/> when you reinstalled app on your dev site","dev_command.new_custom_element.reinstall_error":"We had troubles with adding your new site widget. You can try to do it by yourself. Press <0/> to continue","serve_command.starting_serve_environment":"Starting serve environment...","serve_command.starting_serve_environment_success":"Serve environment started! <0/>","serve_command.production_build":"Application is using a production build","create_version_command.creating_version":"Creating a version...","create_version_command.creating_version_success":"Successfully created v{version}","create_version_command.current_version":"Your current version is: v{version}","create_version_command.confirm_version_events_warning":"Any configured events will be deployed to production and take effect once a new version of your app is created.","create_version_command.confirm_version_creation":"Continue with creating the new version?","create_version_command.confirm_version_creation_aborted":"Version creation aborted","create_version_command.version_type_question":"What type of version would you like to create?","create_version_command.version_type_question_minor":"Minor (v{version})","create_version_command.version_type_question_major":"Major (v{version})","create_version_command.check_preview_before_version_release":"Before creating a new version, let's create a preview of your app","create_version_command.checking_validation_status":"Checking if this version can be submitted\u2026","create_version_command.version_validation_ok":"This version can be submitted for review in the <0>Dev Center</0>","create_version_command.version_validation_has_failures":`This version has blockers preventing it from being submitted for review.
10
+ Please fix them and submit your app in the <0>Dev Center</0>.`,"embedded_script.type.essential":"Essential","embedded_script.type.essential.description":"Must load regardless of policy","embedded_script.type.functional":"Functional","embedded_script.type.functional.description":"Adds optional functionality to the site","embedded_script.type.analytics":"Analytics","embedded_script.type.analytics.description":"Adds analytics abilities to the site","embedded_script.type.advertising":"Advertising","embedded_script.type.advertising.description":"Adds advertising content or advertising tracking to the site","embedded_script.placement.head":"Head","embedded_script.placement.head.description":"In the document head","embedded_script.placement.body_start":"Body Start","embedded_script.placement.body_start.description":"Prepended in the body","embedded_script.placement.body_end":"Body End","embedded_script.placement.body_end.description":"Appended in the body","generate_command.description":"Add new extensions to your application","generate_command.flow.dashboard_category":"Dashboard","generate_command.flow.site_category":"Site","generate_command.flow.backend_category":"Backend","generate_command.flow.dashboard_page":"Dashboard Page","generate_command.flow.sidebar_category":"Sidebar Category","generate_command.flow.dashboard_plugin":"Dashboard Plugin","generate_command.flow.dashboard_menu_plugin":"Dashboard Menu Plugin","generate_command.flow.embedded_script":"Embedded Script","generate_command.flow.event":"Event","generate_command.flow.api.title":"API","generate_command.flow.dashboard_modal":"Dashboard Modal","generate_command.flow.custom_element":"Site Widget","generate_command.flow.choose_flow":"What kind of extension would you like to generate?","generate_command.generation.loading":"Generating {subject}...","generate_command.generation.done":"\u{1F680} The new {extensionType} has been generated successfully.","generate_command.generation.learn_more":"\u{1F4DA} Learn more about {extensionType}: <0/>","generate_command.generation.new_dependencies":"\u26A0\uFE0F New app dependencies have been added. Please run <0>npm install</0> before continuing to work.","generate_command.dashboard_page.choose_route":"Enter the route for the new page:","generate_command.dashboard_page.route_placeholder":"my-page","generate_command.dashboard_page.choose_title":"Page title:","generate_command.dashboard_page.title_placeholder":"My Page","generate_command.dashboard_page.add_to_category":"Add to a sidebar category?","generate_command.dashboard_page.choose_category":"Sidebar category:","generate_command.sidebar_category.choose_label":"Enter the label for the new category:","generate_command.sidebar_category.label_placeholder":"My App","generate_command.custom_element.validation.element_exists":"The site widget folder must be unique, please choose a name that has not been used yet in your application.","generate_command.custom_element.validation.element_invalid":"The site widget folder must be a valid path ([a-z-/]+) and must not start with a dot.","generate_command.custom_element.choose_folder":"Widget folder (relative to src/site/widgets/custom-elements):","generate_command.custom_element.folder_placeholder":"my-widget","generate_command.custom_element.choose_name":"Widget name:","generate_command.custom_element.name_placeholder":"My Widget","generate_command.embedded_script.validation.script_exists":"The script folder must be unique, please choose a name that has not been used yet in your application.","generate_command.embedded_script.validation.script_invalid":"The script folder must be a valid path ([a-z0-9-/]+) and must not start with a dot.","generate_command.embedded_script.choose_folder":"Script folder (relative to src/site/embedded-scripts):","generate_command.embedded_script.folder_placeholder":"my-script","generate_command.embedded_script.choose_name":"Script name:","generate_command.embedded_script.name_placeholder":"My Script","generate_command.embedded_script.choose_type":"Script type:","generate_command.embedded_script.type_info":"Will be used for GDPR and cookie consent purposes","generate_command.embedded_script.choose_placement":"Placement:","generate_command.embedded_script.placement_info":"Will determine where the script is embedded","generate_command.dashboard_modal.validation.folder_exists":"The modal folder must be unique, please choose a folder name that has not been used yet in your application.","generate_command.dashboard_modal.validation.folder_invalid":"The modal folder must be a valid path ([a-z0-9-/]+) and must not start with a dot.","generate_command.dashboard_modal.choose_folder":"Enter the folder name for the new modal:","generate_command.dashboard_modal.folder_placeholder":"my-modal","generate_command.dashboard_modal.choose_title":"Modal title:","generate_command.dashboard_modal.title_placeholder":"My Modal","generate_command.dashboard_plugin.what_to_extend":"What would you like to extend?","generate_command.dashboard_plugin.what_to_extend.description":"Plugins let you extend Wix apps by embedding your UI inside dedicated slots within a dashboard page (<0>read more</0>)","generate_command.dashboard_plugin.what_to_extend.item_description":"<0>read more</0>","generate_command.dashboard_plugin.choose_folder":"Plugin folder (relative to src/dashboard/plugins)","generate_command.dashboard_plugin.folder_placeholder":"my-plugin","generate_command.dashboard_plugin.choose_title":"Plugin title","generate_command.dashboard_plugin.title_placeholder":"My Plugin","generate_command.required_app":"Would you like to set {appName} as a requirement for your app?","generate_command.required_app.description":"This means sites must have {appName} installed before installing your app (<0>read more</0>)","generate_command.dashboard_menu_plugin.what_to_extend":"What would you like to extend?","generate_command.dashboard_menu_plugin.what_to_extend.description":"Menu Plugins let you extend Wix apps by adding a menu item in a pre-defined slot in a menu on a dashboard page (<0>read more</0>)","generate_command.dashboard_menu_plugin.what_to_extend.item_description":"<0>read more</0>","generate_command.dashboard_menu_plugin.what_to_do":"What action will happen after clicking on the menu item?","generate_command.dashboard_menu_plugin.what_to_do.navigate_to_page":"Navigate to a page","generate_command.dashboard_menu_plugin.what_to_do.open_modal":"Open a modal","generate_command.dashboard_menu_plugin.what_to_do.navigate_to_page.choose_page":"Choose a page the menu item will navigate to:","generate_command.dashboard_menu_plugin.what_to_do.navigate_to_page.choose_page.info":"Choose from a list of available pages in your project or manually add a page from a different app","generate_command.dashboard_menu_plugin.what_to_do.navigate_to_page.choose_page.other":"Use a page from a different app","generate_command.dashboard_menu_plugin.what_to_do.navigate_to_page.choose_page.other.choose_page_id":"What is the unique id of the page?","generate_command.dashboard_menu_plugin.what_to_do.navigate_to_page.choose_page.other.page_id_invalid":"Page id has to be in the format of a uuid","generate_command.dashboard_menu_plugin.what_to_do.open_modal.choose_component":"Choose the modal to open:","generate_command.dashboard_menu_plugin.what_to_do.open_modal.choose_component.info":"Choose from a list of available modals in your project or manually add a modal from a different app","generate_command.dashboard_menu_plugin.what_to_do.open_modal.choose_component.other":"Use a modal from a different app","generate_command.dashboard_menu_plugin.what_to_do.open_modal.choose_component.other.choose_component_id":"What is the unique id of the modal?","generate_command.dashboard_menu_plugin.what_to_do.open_modal.choose_component.other.component_id_invalid":"Modal id has to be in the format of a uuid","generate_command.dashboard_menu_plugin.choose_folder":"Menu Plugin folder (relative to src/dashboard/menu-plugins)","generate_command.dashboard_menu_plugin.folder_placeholder":"my-plugin","generate_command.dashboard_menu_plugin.choose_title":"Menu Plugin title","generate_command.dashboard_menu_plugin.title_placeholder":"My Plugin","generate_command.api.api_placeholder":"my-api","generate_command.api.choose_api_name":"How would you like to name your API?","generate_command.api.choose_folder":"API folder (relative to src/backend/api):","generate_command.api.choose_api_name.error":"API name must be unique, can not include special characters or spaces, and must be shorter than 20 characters","generate_command.api.choose_method":"Choose an API method","generate_command.event.choose_folder":"Event folder (relative to src/backend/events):","generate_command.event.folder_placeholder":"my-event","generate_command.event.choose_folder.error":"Event name must be unique, can not include special characters or spaces, and must be shorter than 20 characters","logs_command.logs_without_version":"Logs command without the version is not supported, add `--version {version}`","logs_command.connecting":"Connecting to the log server...","logs_command.listening_to_logs":"Listening to logs from the server.","logs_command.prod_env_logs":"Prod Environment logs for the version: {version}"};export{o as a};
11
+ //# sourceMappingURL=chunk-KQOYEWON.js.map