@wix/cli-app 1.1.28 → 1.1.30

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 (120) hide show
  1. package/build/CreateVersionCommand-NFKBKYN5.js +4 -0
  2. package/build/CreateVersionCommand-NFKBKYN5.js.map +1 -0
  3. package/build/DevCommand-CSOEONPY.js +4 -0
  4. package/build/DevCommand-CSOEONPY.js.map +1 -0
  5. package/build/GenerateCommand-LHTPLGNF.js +99 -0
  6. package/build/GenerateCommand-LHTPLGNF.js.map +1 -0
  7. package/build/LogsCommand-GUWLKR7V.js +4 -0
  8. package/build/{LogsCommand-EQAEPQSZ.js.map → LogsCommand-GUWLKR7V.js.map} +1 -1
  9. package/build/PreviewCommand-QAYLTUIX.js +4 -0
  10. package/build/ServeCommand-PHOYGKPH.js +4 -0
  11. package/build/{ServeCommand-CERFKHB5.js.map → ServeCommand-PHOYGKPH.js.map} +1 -1
  12. package/build/build-N3GC2AJW.js +4 -0
  13. package/build/build-N3GC2AJW.js.map +1 -0
  14. package/build/chunk-25SA6SIS.js +4 -0
  15. package/build/chunk-25SA6SIS.js.map +1 -0
  16. package/build/chunk-2T5VKPKE.js +4 -0
  17. package/build/chunk-2T5VKPKE.js.map +1 -0
  18. package/build/chunk-5CHNGZ6H.js +87 -0
  19. package/build/chunk-5CHNGZ6H.js.map +1 -0
  20. package/build/{chunk-VZGLJSBQ.js → chunk-5QLZSP2U.js} +3 -3
  21. package/build/{chunk-VZGLJSBQ.js.map → chunk-5QLZSP2U.js.map} +1 -1
  22. package/build/chunk-AS45KVJN.js +4 -0
  23. package/build/chunk-AS45KVJN.js.map +1 -0
  24. package/build/chunk-BD6TU75M.js +11 -0
  25. package/build/{chunk-CU75PFHB.js.map → chunk-BD6TU75M.js.map} +1 -1
  26. package/build/chunk-C47JQ5AQ.js +4 -0
  27. package/build/{chunk-PDISMWAG.js.map → chunk-C47JQ5AQ.js.map} +1 -1
  28. package/build/{chunk-3ZWMQHFG.js → chunk-E74YEX6I.js} +2 -2
  29. package/build/chunk-E74YEX6I.js.map +1 -0
  30. package/build/chunk-EF6HOPCP.js +4 -0
  31. package/build/chunk-EF6HOPCP.js.map +1 -0
  32. package/build/chunk-GFH6QCDG.js +4 -0
  33. package/build/{chunk-EUCZHHS6.js.map → chunk-GFH6QCDG.js.map} +1 -1
  34. package/build/chunk-GRIMGGL3.js +4 -0
  35. package/build/chunk-H6SYLT4B.js +4 -0
  36. package/build/chunk-H6SYLT4B.js.map +1 -0
  37. package/build/chunk-JUS465G2.js +19 -0
  38. package/build/chunk-JUS465G2.js.map +1 -0
  39. package/build/chunk-L3HVHNTA.js +4 -0
  40. package/build/{chunk-VDBUFPPQ.js.map → chunk-L3HVHNTA.js.map} +1 -1
  41. package/build/chunk-OR2CAHGP.js +4 -0
  42. package/build/{chunk-ME4U7FVN.js.map → chunk-OR2CAHGP.js.map} +1 -1
  43. package/build/chunk-PEDWEHXR.js +99 -0
  44. package/build/chunk-PEDWEHXR.js.map +1 -0
  45. package/build/{chunk-4VHD7OBV.js → chunk-Q5WWBUFO.js} +2 -2
  46. package/build/{chunk-RXKVYQVC.js → chunk-SQZ5XNZ2.js} +2 -2
  47. package/build/chunk-SQZ5XNZ2.js.map +1 -0
  48. package/build/{chunk-FKNQBY7X.js → chunk-TTWJWXLR.js} +2 -2
  49. package/build/{chunk-YF675DKE.js → chunk-VH4K3U5M.js} +2 -2
  50. package/build/chunk-WZE4EKUX.js +4 -0
  51. package/build/{chunk-2V3FQGOH.js.map → chunk-WZE4EKUX.js.map} +1 -1
  52. package/build/chunk-XQLBMLA6.js +10 -0
  53. package/build/chunk-XQLBMLA6.js.map +1 -0
  54. package/build/chunk-YLBOH353.js +21 -0
  55. package/build/chunk-YLBOH353.js.map +1 -0
  56. package/build/chunk-ZFOHUOI6.js +4 -0
  57. package/build/{chunk-ZTBNOJP4.js.map → chunk-ZFOHUOI6.js.map} +1 -1
  58. package/build/index.js +12 -12
  59. package/build/index.js.map +1 -1
  60. package/build/preview-QZCCFP23.js +4 -0
  61. package/build/preview-QZCCFP23.js.map +1 -0
  62. package/build/render-command-AOEWP2JP.js +4 -0
  63. package/build/{render-command-QZNKMGV3.js.map → render-command-AOEWP2JP.js.map} +1 -1
  64. package/package.json +11 -10
  65. package/templates/custom-element/dependencies.json +1 -1
  66. package/templates/dashboard-modal/dependencies.json +2 -1
  67. package/templates/dashboard-modal/files/modal.tsx.ejs +4 -2
  68. package/templates/dashboard-page/dependencies.json +3 -1
  69. package/templates/dashboard-page/files/page.tsx.ejs +9 -3
  70. package/templates/dashboard-plugin/dependencies.json +2 -1
  71. package/templates/dashboard-plugin/files/plugin.tsx.ejs +5 -2
  72. package/build/CreateVersionCommand-HYIOMYPS.js +0 -4
  73. package/build/CreateVersionCommand-HYIOMYPS.js.map +0 -1
  74. package/build/DevCommand-NXVNR5O7.js +0 -4
  75. package/build/DevCommand-NXVNR5O7.js.map +0 -1
  76. package/build/GenerateCommand-QZE7QTNX.js +0 -99
  77. package/build/GenerateCommand-QZE7QTNX.js.map +0 -1
  78. package/build/LogsCommand-EQAEPQSZ.js +0 -4
  79. package/build/PreviewCommand-DCQC2ZG7.js +0 -4
  80. package/build/ServeCommand-CERFKHB5.js +0 -4
  81. package/build/build-NH7ZWZTO.js +0 -4
  82. package/build/build-NH7ZWZTO.js.map +0 -1
  83. package/build/chunk-2V3FQGOH.js +0 -4
  84. package/build/chunk-3ZWMQHFG.js.map +0 -1
  85. package/build/chunk-5IJKDSHA.js +0 -4
  86. package/build/chunk-AHUF5IOW.js +0 -4
  87. package/build/chunk-AHUF5IOW.js.map +0 -1
  88. package/build/chunk-BSR2JA4S.js +0 -4
  89. package/build/chunk-BSR2JA4S.js.map +0 -1
  90. package/build/chunk-CGSGJIBN.js +0 -10
  91. package/build/chunk-CGSGJIBN.js.map +0 -1
  92. package/build/chunk-CU75PFHB.js +0 -11
  93. package/build/chunk-EUCZHHS6.js +0 -4
  94. package/build/chunk-HAYBGBEA.js +0 -6
  95. package/build/chunk-HAYBGBEA.js.map +0 -1
  96. package/build/chunk-KSQU6TME.js +0 -4
  97. package/build/chunk-KSQU6TME.js.map +0 -1
  98. package/build/chunk-ME4U7FVN.js +0 -4
  99. package/build/chunk-PDISMWAG.js +0 -4
  100. package/build/chunk-QVFKOTXV.js +0 -87
  101. package/build/chunk-QVFKOTXV.js.map +0 -1
  102. package/build/chunk-RXKVYQVC.js.map +0 -1
  103. package/build/chunk-SEGEUJOD.js +0 -99
  104. package/build/chunk-SEGEUJOD.js.map +0 -1
  105. package/build/chunk-VDBUFPPQ.js +0 -4
  106. package/build/chunk-XKB57U76.js +0 -4
  107. package/build/chunk-XKB57U76.js.map +0 -1
  108. package/build/chunk-XT25CBJM.js +0 -21
  109. package/build/chunk-XT25CBJM.js.map +0 -1
  110. package/build/chunk-ZF4WFDE4.js +0 -4
  111. package/build/chunk-ZF4WFDE4.js.map +0 -1
  112. package/build/chunk-ZTBNOJP4.js +0 -4
  113. package/build/preview-EV2USTXM.js +0 -4
  114. package/build/preview-EV2USTXM.js.map +0 -1
  115. package/build/render-command-QZNKMGV3.js +0 -4
  116. /package/build/{PreviewCommand-DCQC2ZG7.js.map → PreviewCommand-QAYLTUIX.js.map} +0 -0
  117. /package/build/{chunk-5IJKDSHA.js.map → chunk-GRIMGGL3.js.map} +0 -0
  118. /package/build/{chunk-4VHD7OBV.js.map → chunk-Q5WWBUFO.js.map} +0 -0
  119. /package/build/{chunk-FKNQBY7X.js.map → chunk-TTWJWXLR.js.map} +0 -0
  120. /package/build/{chunk-YF675DKE.js.map → chunk-VH4K3U5M.js.map} +0 -0
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../node_modules/is-docker/index.js","../../../node_modules/is-wsl/index.js","../../../node_modules/define-lazy-prop/index.js","../../../node_modules/open/index.js","../../cli-telemetry-react/src/useBi.tsx","../../cli-telemetry-react/src/index.ts","../../cli-error-reporting/src/error-reporter-context.tsx","../../cli-error-reporting/src/index.ts","../../cli-http-client/src/create-http-client.ts","../../cli-error-reporting/src/components/ErrorViewer.ts","../../cli-error-reporting/src/get-error-component.tsx","../../../node_modules/outdent/src/index.ts","../../cli-error-reporting/src/components/ErrorMessage.tsx","../../cli-auth/src/providers/AccountAuthProvider.tsx","../../cli-auth/src/context.ts","../../cli-auth/src/auth-strategies/index.ts","../../cli-auth/src/auth-strategies/api-key-auth-strategy.ts","../../cli-auth/src/client.ts","../../../node_modules/@wix/ambassador-identity-account-v2-account/http.impl.ts","../../../node_modules/@wix/ambassador-identity-oauth-v1-refresh-token/http.impl.ts","../../cli-auth/src/schemas.ts","../../cli-auth/src/auth-data.ts","../../cli-auth/src/auth-strategies/account-auth-strategy.ts","../../../node_modules/p-limit/index.js","../../../node_modules/p-limit/node_modules/yocto-queue/index.js","../../cli-auth/src/components/EnsureLoggedIn.tsx","../../cli-auth/src/components/Login.tsx","../../../node_modules/@wix/bi-logger-wix-cli/src/v2/index.ts","../../cli-auth/src/messages.json","../../cli-auth/src/components/LoginInstructions.tsx","../../user-browser/src/index.ts","../../user-browser/src/open-testkit.ts","../../cli-auth/src/components/WarnLegacyAuthData.tsx","../../cli-auth/src/index.ts","../../cli-auth/src/useAuth.ts"],"sourcesContent":["'use strict';\nconst fs = require('fs');\n\nlet isDocker;\n\nfunction hasDockerEnv() {\n\ttry {\n\t\tfs.statSync('/.dockerenv');\n\t\treturn true;\n\t} catch (_) {\n\t\treturn false;\n\t}\n}\n\nfunction hasDockerCGroup() {\n\ttry {\n\t\treturn fs.readFileSync('/proc/self/cgroup', 'utf8').includes('docker');\n\t} catch (_) {\n\t\treturn false;\n\t}\n}\n\nmodule.exports = () => {\n\tif (isDocker === undefined) {\n\t\tisDocker = hasDockerEnv() || hasDockerCGroup();\n\t}\n\n\treturn isDocker;\n};\n","'use strict';\nconst os = require('os');\nconst fs = require('fs');\nconst isDocker = require('is-docker');\n\nconst isWsl = () => {\n\tif (process.platform !== 'linux') {\n\t\treturn false;\n\t}\n\n\tif (os.release().toLowerCase().includes('microsoft')) {\n\t\tif (isDocker()) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn true;\n\t}\n\n\ttry {\n\t\treturn fs.readFileSync('/proc/version', 'utf8').toLowerCase().includes('microsoft') ?\n\t\t\t!isDocker() : false;\n\t} catch (_) {\n\t\treturn false;\n\t}\n};\n\nif (process.env.__IS_WSL_TEST__) {\n\tmodule.exports = isWsl;\n} else {\n\tmodule.exports = isWsl();\n}\n","'use strict';\nmodule.exports = (object, propertyName, fn) => {\n\tconst define = value => Object.defineProperty(object, propertyName, {value, enumerable: true, writable: true});\n\n\tObject.defineProperty(object, propertyName, {\n\t\tconfigurable: true,\n\t\tenumerable: true,\n\t\tget() {\n\t\t\tconst result = fn();\n\t\t\tdefine(result);\n\t\t\treturn result;\n\t\t},\n\t\tset(value) {\n\t\t\tdefine(value);\n\t\t}\n\t});\n\n\treturn object;\n};\n","const path = require('path');\nconst childProcess = require('child_process');\nconst {promises: fs, constants: fsConstants} = require('fs');\nconst isWsl = require('is-wsl');\nconst isDocker = require('is-docker');\nconst defineLazyProperty = require('define-lazy-prop');\n\n// Path to included `xdg-open`.\nconst localXdgOpenPath = path.join(__dirname, 'xdg-open');\n\nconst {platform, arch} = process;\n\n// Podman detection\nconst hasContainerEnv = () => {\n\ttry {\n\t\tfs.statSync('/run/.containerenv');\n\t\treturn true;\n\t} catch {\n\t\treturn false;\n\t}\n};\n\nlet cachedResult;\nfunction isInsideContainer() {\n\tif (cachedResult === undefined) {\n\t\tcachedResult = hasContainerEnv() || isDocker();\n\t}\n\n\treturn cachedResult;\n}\n\n/**\nGet the mount point for fixed drives in WSL.\n\n@inner\n@returns {string} The mount point.\n*/\nconst getWslDrivesMountPoint = (() => {\n\t// Default value for \"root\" param\n\t// according to https://docs.microsoft.com/en-us/windows/wsl/wsl-config\n\tconst defaultMountPoint = '/mnt/';\n\n\tlet mountPoint;\n\n\treturn async function () {\n\t\tif (mountPoint) {\n\t\t\t// Return memoized mount point value\n\t\t\treturn mountPoint;\n\t\t}\n\n\t\tconst configFilePath = '/etc/wsl.conf';\n\n\t\tlet isConfigFileExists = false;\n\t\ttry {\n\t\t\tawait fs.access(configFilePath, fsConstants.F_OK);\n\t\t\tisConfigFileExists = true;\n\t\t} catch {}\n\n\t\tif (!isConfigFileExists) {\n\t\t\treturn defaultMountPoint;\n\t\t}\n\n\t\tconst configContent = await fs.readFile(configFilePath, {encoding: 'utf8'});\n\t\tconst configMountPoint = /(?<!#.*)root\\s*=\\s*(?<mountPoint>.*)/g.exec(configContent);\n\n\t\tif (!configMountPoint) {\n\t\t\treturn defaultMountPoint;\n\t\t}\n\n\t\tmountPoint = configMountPoint.groups.mountPoint.trim();\n\t\tmountPoint = mountPoint.endsWith('/') ? mountPoint : `${mountPoint}/`;\n\n\t\treturn mountPoint;\n\t};\n})();\n\nconst pTryEach = async (array, mapper) => {\n\tlet latestError;\n\n\tfor (const item of array) {\n\t\ttry {\n\t\t\treturn await mapper(item); // eslint-disable-line no-await-in-loop\n\t\t} catch (error) {\n\t\t\tlatestError = error;\n\t\t}\n\t}\n\n\tthrow latestError;\n};\n\nconst baseOpen = async options => {\n\toptions = {\n\t\twait: false,\n\t\tbackground: false,\n\t\tnewInstance: false,\n\t\tallowNonzeroExitCode: false,\n\t\t...options\n\t};\n\n\tif (Array.isArray(options.app)) {\n\t\treturn pTryEach(options.app, singleApp => baseOpen({\n\t\t\t...options,\n\t\t\tapp: singleApp\n\t\t}));\n\t}\n\n\tlet {name: app, arguments: appArguments = []} = options.app || {};\n\tappArguments = [...appArguments];\n\n\tif (Array.isArray(app)) {\n\t\treturn pTryEach(app, appName => baseOpen({\n\t\t\t...options,\n\t\t\tapp: {\n\t\t\t\tname: appName,\n\t\t\t\targuments: appArguments\n\t\t\t}\n\t\t}));\n\t}\n\n\tlet command;\n\tconst cliArguments = [];\n\tconst childProcessOptions = {};\n\n\tif (platform === 'darwin') {\n\t\tcommand = 'open';\n\n\t\tif (options.wait) {\n\t\t\tcliArguments.push('--wait-apps');\n\t\t}\n\n\t\tif (options.background) {\n\t\t\tcliArguments.push('--background');\n\t\t}\n\n\t\tif (options.newInstance) {\n\t\t\tcliArguments.push('--new');\n\t\t}\n\n\t\tif (app) {\n\t\t\tcliArguments.push('-a', app);\n\t\t}\n\t} else if (platform === 'win32' || (isWsl && !isInsideContainer() && !app)) {\n\t\tconst mountPoint = await getWslDrivesMountPoint();\n\n\t\tcommand = isWsl ?\n\t\t\t`${mountPoint}c/Windows/System32/WindowsPowerShell/v1.0/powershell.exe` :\n\t\t\t`${process.env.SYSTEMROOT}\\\\System32\\\\WindowsPowerShell\\\\v1.0\\\\powershell`;\n\n\t\tcliArguments.push(\n\t\t\t'-NoProfile',\n\t\t\t'-NonInteractive',\n\t\t\t'–ExecutionPolicy',\n\t\t\t'Bypass',\n\t\t\t'-EncodedCommand'\n\t\t);\n\n\t\tif (!isWsl) {\n\t\t\tchildProcessOptions.windowsVerbatimArguments = true;\n\t\t}\n\n\t\tconst encodedArguments = ['Start'];\n\n\t\tif (options.wait) {\n\t\t\tencodedArguments.push('-Wait');\n\t\t}\n\n\t\tif (app) {\n\t\t\t// Double quote with double quotes to ensure the inner quotes are passed through.\n\t\t\t// Inner quotes are delimited for PowerShell interpretation with backticks.\n\t\t\tencodedArguments.push(`\"\\`\"${app}\\`\"\"`, '-ArgumentList');\n\t\t\tif (options.target) {\n\t\t\t\tappArguments.unshift(options.target);\n\t\t\t}\n\t\t} else if (options.target) {\n\t\t\tencodedArguments.push(`\"${options.target}\"`);\n\t\t}\n\n\t\tif (appArguments.length > 0) {\n\t\t\tappArguments = appArguments.map(arg => `\"\\`\"${arg}\\`\"\"`);\n\t\t\tencodedArguments.push(appArguments.join(','));\n\t\t}\n\n\t\t// Using Base64-encoded command, accepted by PowerShell, to allow special characters.\n\t\toptions.target = Buffer.from(encodedArguments.join(' '), 'utf16le').toString('base64');\n\t} else {\n\t\tif (app) {\n\t\t\tcommand = app;\n\t\t} else {\n\t\t\t// When bundled by Webpack, there's no actual package file path and no local `xdg-open`.\n\t\t\tconst isBundled = !__dirname || __dirname === '/';\n\n\t\t\t// Check if local `xdg-open` exists and is executable.\n\t\t\tlet exeLocalXdgOpen = false;\n\t\t\ttry {\n\t\t\t\tawait fs.access(localXdgOpenPath, fsConstants.X_OK);\n\t\t\t\texeLocalXdgOpen = true;\n\t\t\t} catch {}\n\n\t\t\tconst useSystemXdgOpen = process.versions.electron ||\n\t\t\t\tplatform === 'android' || isBundled || !exeLocalXdgOpen;\n\t\t\tcommand = useSystemXdgOpen ? 'xdg-open' : localXdgOpenPath;\n\t\t}\n\n\t\tif (appArguments.length > 0) {\n\t\t\tcliArguments.push(...appArguments);\n\t\t}\n\n\t\tif (!options.wait) {\n\t\t\t// `xdg-open` will block the process unless stdio is ignored\n\t\t\t// and it's detached from the parent even if it's unref'd.\n\t\t\tchildProcessOptions.stdio = 'ignore';\n\t\t\tchildProcessOptions.detached = true;\n\t\t}\n\t}\n\n\tif (options.target) {\n\t\tcliArguments.push(options.target);\n\t}\n\n\tif (platform === 'darwin' && appArguments.length > 0) {\n\t\tcliArguments.push('--args', ...appArguments);\n\t}\n\n\tconst subprocess = childProcess.spawn(command, cliArguments, childProcessOptions);\n\n\tif (options.wait) {\n\t\treturn new Promise((resolve, reject) => {\n\t\t\tsubprocess.once('error', reject);\n\n\t\t\tsubprocess.once('close', exitCode => {\n\t\t\t\tif (!options.allowNonzeroExitCode && exitCode > 0) {\n\t\t\t\t\treject(new Error(`Exited with code ${exitCode}`));\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tresolve(subprocess);\n\t\t\t});\n\t\t});\n\t}\n\n\tsubprocess.unref();\n\n\treturn subprocess;\n};\n\nconst open = (target, options) => {\n\tif (typeof target !== 'string') {\n\t\tthrow new TypeError('Expected a `target`');\n\t}\n\n\treturn baseOpen({\n\t\t...options,\n\t\ttarget\n\t});\n};\n\nconst openApp = (name, options) => {\n\tif (typeof name !== 'string') {\n\t\tthrow new TypeError('Expected a `name`');\n\t}\n\n\tconst {arguments: appArguments = []} = options || {};\n\tif (appArguments !== undefined && appArguments !== null && !Array.isArray(appArguments)) {\n\t\tthrow new TypeError('Expected `appArguments` as Array type');\n\t}\n\n\treturn baseOpen({\n\t\t...options,\n\t\tapp: {\n\t\t\tname,\n\t\t\targuments: appArguments\n\t\t}\n\t});\n};\n\nfunction detectArchBinary(binary) {\n\tif (typeof binary === 'string' || Array.isArray(binary)) {\n\t\treturn binary;\n\t}\n\n\tconst {[arch]: archBinary} = binary;\n\n\tif (!archBinary) {\n\t\tthrow new Error(`${arch} is not supported`);\n\t}\n\n\treturn archBinary;\n}\n\nfunction detectPlatformBinary({[platform]: platformBinary}, {wsl}) {\n\tif (wsl && isWsl) {\n\t\treturn detectArchBinary(wsl);\n\t}\n\n\tif (!platformBinary) {\n\t\tthrow new Error(`${platform} is not supported`);\n\t}\n\n\treturn detectArchBinary(platformBinary);\n}\n\nconst apps = {};\n\ndefineLazyProperty(apps, 'chrome', () => detectPlatformBinary({\n\tdarwin: 'google chrome',\n\twin32: 'chrome',\n\tlinux: ['google-chrome', 'google-chrome-stable', 'chromium']\n}, {\n\twsl: {\n\t\tia32: '/mnt/c/Program Files (x86)/Google/Chrome/Application/chrome.exe',\n\t\tx64: ['/mnt/c/Program Files/Google/Chrome/Application/chrome.exe', '/mnt/c/Program Files (x86)/Google/Chrome/Application/chrome.exe']\n\t}\n}));\n\ndefineLazyProperty(apps, 'firefox', () => detectPlatformBinary({\n\tdarwin: 'firefox',\n\twin32: 'C:\\\\Program Files\\\\Mozilla Firefox\\\\firefox.exe',\n\tlinux: 'firefox'\n}, {\n\twsl: '/mnt/c/Program Files/Mozilla Firefox/firefox.exe'\n}));\n\ndefineLazyProperty(apps, 'edge', () => detectPlatformBinary({\n\tdarwin: 'microsoft edge',\n\twin32: 'msedge',\n\tlinux: ['microsoft-edge', 'microsoft-edge-dev']\n}, {\n\twsl: '/mnt/c/Program Files (x86)/Microsoft/Edge/Application/msedge.exe'\n}));\n\nopen.apps = apps;\nopen.openApp = openApp;\n\nmodule.exports = open;\n","import type { ReactNode } from 'react';\nimport React, { createContext, useContext } from 'react';\nimport type { BiLogger } from '@wix/cli-telemetry';\n\nconst BiContext = createContext<BiLogger | null>(null);\n\nexport const BiProvider = function ({\n children,\n value: biLogger,\n}: {\n children: ReactNode;\n value: BiLogger;\n}) {\n return <BiContext.Provider value={biLogger}>{children}</BiContext.Provider>;\n};\n\nexport const useBiLogger = (): BiLogger => {\n const context = useContext(BiContext);\n\n if (context === null) {\n throw new Error('useBiLogger() cannot be used without an <BiProvider>');\n }\n\n return context;\n};\n","export { useBiLogger, BiProvider } from './useBi.js';\n","import React, {\n type FC,\n type ReactNode,\n createContext,\n useContext,\n} from 'react';\nimport type { ErrorReporter } from './error-reporter.js';\n\nconst ErrorReporterContext = createContext<ErrorReporter | null>(null);\n\ninterface Props {\n value: ErrorReporter;\n children: ReactNode;\n}\n\nexport const ErrorReporterProvider: FC<Props> = (props) => (\n <ErrorReporterContext.Provider {...props} />\n);\n\nexport const useErrorReporter = (): ErrorReporter => {\n const context = useContext(ErrorReporterContext);\n if (context === null) {\n throw new Error(\n 'useErrorReporter() cannot be used without an <ErrorReporterProvider>'\n );\n }\n return context;\n};\n","export {\n createErrorHandler,\n type ErrorHandlerFn,\n} from './create-error-handler.js';\nexport { ErrorViewer } from './components/ErrorViewer.js';\nexport { createErrorReporter, type ErrorReporter } from './error-reporter.js';\nexport {\n ErrorReporterProvider,\n useErrorReporter,\n} from './error-reporter-context.js';\n","import { CliError, CliErrorCode } from '@wix/cli-error';\nimport type { IHttpClient, Headers } from '@wix/http-client';\nimport { createHttpClient as createHttpClientOriginal } from '@wix/http-client';\nimport { isHttpError } from './is-http-error.js';\n\nexport interface CreateHttpClientOptions {\n getAppToken?(): Promise<string>;\n createHeaders?(): Headers;\n\n type: keyof typeof baseUrls;\n}\n\nconst baseUrls = {\n backoffice: 'https://manage.wix.com',\n editor: 'https://editor.wix.com',\n code: 'https://code.wix.com',\n general: 'https://www.wix.com',\n standalone: undefined,\n};\n\nfunction interceptRequest<P extends Array<unknown>, R>(\n client: IHttpClient,\n fn: (...args: P) => Promise<R>\n) {\n return (...args: P) =>\n fn.apply(client, args).catch((error) => {\n if (isHttpError(error) && !client.isCancel(error)) {\n if (!error.response) {\n // Network error\n throw new CliError({\n code: CliErrorCode.NetworkError({ cause: error }),\n cause: error,\n info: { code: error.code },\n });\n }\n }\n\n throw error;\n });\n}\n\nexport function createHttpClient({\n getAppToken,\n createHeaders,\n type,\n}: CreateHttpClientOptions): IHttpClient {\n const client = createHttpClientOriginal({\n baseURL: baseUrls[type],\n ...(type !== 'standalone'\n ? {\n getAppToken,\n }\n : {}),\n createHeaders: () => ({\n ...createHeaders?.(),\n // See https://wix.slack.com/archives/C0JLGMT28/p1667219337530909\n 'X-XSRF-TOKEN': 'nocheck',\n Cookie: 'XSRF-TOKEN=nocheck',\n 'User-Agent': 'wix-cli',\n }),\n });\n\n return {\n ...client,\n request: interceptRequest(client, client.request),\n get: interceptRequest(client, client.get),\n delete: interceptRequest(client, client.delete),\n head: interceptRequest(client, client.head),\n options: interceptRequest(client, client.options),\n post: interceptRequest(client, client.post),\n put: interceptRequest(client, client.put),\n patch: interceptRequest(client, client.patch),\n };\n}\n","import { createElement, useMemo } from 'react';\nimport type { FC, ReactNode } from 'react';\nimport { isCliSystemError, normalizeError } from '@wix/cli-error';\nimport { getErrorComponent } from '../get-error-component.js';\n\ninterface Props {\n error: unknown;\n systemErrorOverride?: ReactNode;\n}\n\nexport const ErrorViewer: FC<Props> = ({\n error: originalError,\n systemErrorOverride,\n}) => {\n return useMemo(() => {\n const error = normalizeError(originalError);\n\n return isCliSystemError(error) && systemErrorOverride\n ? systemErrorOverride\n : createElement(getErrorComponent(error.cliCode));\n }, [originalError, systemErrorOverride]);\n};\n","import type { ComponentType } from 'react';\nimport React from 'react';\nimport { match } from 'variant';\nimport { Box, Newline, Text, Link } from '@wix/cli-ui-kit';\nimport { outdent } from 'outdent';\nimport type { ZodIssue } from 'zod';\nimport type { CliErrorCodeType } from '@wix/cli-error';\nimport { ErrorMessage, SystemErrorMessage } from './components/ErrorMessage.js';\n\nexport function getErrorComponent(code: CliErrorCodeType): ComponentType {\n return match(code, {\n UnknownFailure: ({ error }) => {\n return () => (\n <>\n <Text skin=\"error\">\n Oh no, seems like the CLI encountered an unexpected error:\n </Text>\n\n {error instanceof Error ? (\n <Text skin=\"error\">{error.message}</Text>\n ) : (\n <Text>{JSON.stringify(error)}</Text>\n )}\n </>\n );\n },\n FailedToGetDeviceCode: () => {\n return () => (\n <SystemErrorMessage message=\"An error occured while logging in: Failed to issue a login device code\" />\n );\n },\n FailedToGetAuthToken: () => {\n return () => (\n <SystemErrorMessage message=\"An error occured while logging in: Failed to issue refresh token\" />\n );\n },\n FailedToRefreshTokenForSite: () => {\n return () => (\n <SystemErrorMessage message=\"An error occured while logging in: Failed to issue refresh token for site\" />\n );\n },\n FailedToRenewAuthToken: () => {\n return () => (\n <SystemErrorMessage message=\"Failed to renew access token.\" />\n );\n },\n FailedToRenewAuthTokenSiteNotFound: ({ siteId }) => {\n return () => (\n <ErrorMessage\n message={`Authenticate failed, your configured development site (${siteId}) could not be accessed`}\n hint=\"Make sure the site exists and you still have access to it\"\n />\n );\n },\n FailedToRenewAuthTokenRefreshTokenRevoked: () => {\n return () => (\n <ErrorMessage\n message=\"Failed to renew access token: refresh token has been revoked\"\n hint=\"Please login again to get a new refresh token\"\n />\n );\n },\n FailedToRevokeRefreshToken: ({ email }) => {\n return () => (\n <SystemErrorMessage\n message=\"An error occured while trying to logout: Failed to revoke refresh token!\"\n explanation={`Wix CLI is still logged in to account ${email}`}\n />\n );\n },\n FailedToFetchPackageJson: () => {\n return () => (\n <SystemErrorMessage message=\"Failed to fetch package data.\" />\n );\n },\n LatestVersionOfCreateAppRequired: ({\n currentVersion,\n latestVersion,\n updateCommand,\n }) => {\n return () => (\n <ErrorMessage\n message={\n <>\n Generating a Wix App is only supported using the latest version (\n {latestVersion}) of <Text bold>@wix/create-app</Text> (current:{' '}\n {currentVersion})\n </>\n }\n hint={\n <Text>\n Make sure you are using the following command:\n <Newline />\n <Text bold>{updateCommand}</Text>\n <Newline />\n If the problem persists, try clearing your package manager's cache\n </Text>\n }\n />\n );\n },\n EmptyDirectoryRequiredAppGeneration: ({ folder }) => {\n return () => (\n <ErrorMessage\n message={\n <>\n Generating a Wix App requires an empty directory but{' '}\n <Text bold>{folder}</Text> already exists and isn't empty\n </>\n }\n hint={\n <Text>\n Choose a different project name or delete the existing{' '}\n <Text bold>{folder}</Text> folder\n </Text>\n }\n />\n );\n },\n InvalidNewPackageName: ({ packageName, validations }) => {\n return () => (\n <ErrorMessage\n message={\n <>\n Generating a Wix App requires a valid npm package name for the\n generated <Text bold>package.json</Text> <Newline />\n The name <Text bold>{packageName}</Text> failed the following\n validations:\n <Newline />\n {validations.map((validation, id) => (\n <Text key={id}>\n <Newline />- {validation}\n </Text>\n ))}\n </>\n }\n hint={`Choose a different project name that follows the validations above`}\n />\n );\n },\n SiteSelectorTimedout: () => {\n return () => (\n <ErrorMessage\n message={`Waiting for application installation timed out.`}\n />\n );\n },\n TypeErrorInvalidUrl: () => {\n return () => <ErrorMessage message={`Invalid assets URL.`} />;\n },\n UnsupportedPackageManager: ({ packageManagerName }) => {\n return () => (\n <ErrorMessage\n message={`Generating a Wix App requires the usage of a supported package manager`}\n hint={`Expected Yarn or NPM but ${\n packageManagerName\n ? `got ${packageManagerName}`\n : `failed to detect a package manager`\n }`}\n />\n );\n },\n UnsupportedPackageManagerWorkspaces: ({ packageManagerName }) => {\n return () => (\n <ErrorMessage\n message={`Generating a Wix App inside ${packageManagerName} workspaces is not supported`}\n />\n );\n },\n FailedToGetDeveloperApps: () => {\n return () => (\n <SystemErrorMessage message=\"Failed to get the list of your applications\" />\n );\n },\n FailedToCreateDevCenterApp: () => {\n return () => (\n <SystemErrorMessage message=\"Failed to register your application in Wix Dev Center\" />\n );\n },\n FailedToCreateTunnel: () => {\n return () => <ErrorMessage message=\"Failed to create tunnel\" />;\n },\n FailedToDeleteTunnel: () => {\n return () => <ErrorMessage message=\"Failed to delete tunnel\" />;\n },\n SitePermissionDenied: ({ siteId }) => {\n return () => {\n return (\n <ErrorMessage\n message={`You don't have permissions to site ${siteId}`}\n />\n );\n };\n },\n AppPermissionDenied: ({ appId }) => {\n return () => {\n return (\n <ErrorMessage\n message={`You don't have permissions to application ${appId}`}\n />\n );\n };\n },\n FailedToUpdateTelemetryConfig: () => {\n return () => (\n <ErrorMessage message=\"Failed to change telemetry preferences\" />\n );\n },\n FailedToInstallPackage: ({ packageName, cause }) => {\n const causeMessage = getErrorMessage(cause);\n return () => (\n <ErrorMessage\n message={`Failed to install npm package ${packageName}. Cause: ${causeMessage}`}\n />\n );\n },\n FailedToResolveNpmDependencies: () => {\n return () => (\n <SystemErrorMessage message=\"Failed to resolve npm dependencies\" />\n );\n },\n FailedToInstallPackages: ({ cause }) => {\n const causeMessage = getErrorMessage(cause);\n return () => (\n <ErrorMessage\n message={`Failed to install npm packages. Cause: ${causeMessage}`}\n />\n );\n },\n FailedMigrationToAnyNpm: () => {\n return () => (\n <ErrorMessage\n message={<>Could not start the migration process</>}\n hint={\n <Text>\n Make sure that your package.json does not have packages installed\n outside of dev dependencies\n </Text>\n }\n />\n );\n },\n DeprecatedVersion: ({ currentVersion }) => {\n return () => (\n <ErrorMessage\n message={\n <>\n {`Your version of the Wix CLI (${currentVersion}) is`}\n <Text bold> deprecated</Text>.\n </>\n }\n hint={`Please update to the latest version to continue`}\n />\n );\n },\n FailedToUninstallPackage: ({ packageName, cause }) => {\n const causeMessage = getErrorMessage(cause);\n return () => (\n <ErrorMessage\n message={`Failed to uninstall npm package ${packageName}. Cause: ${causeMessage}`}\n />\n );\n },\n FailedToSyncToRevision: ({ revision }) => {\n return () => (\n <ErrorMessage\n message={`Failed to sync the local project to revision ${revision}`}\n />\n );\n },\n FailedToCreateVersion: () => {\n return () => (\n <ErrorMessage message=\"Wix CLI failed to create version for your app\" />\n );\n },\n FailedToReadCache: ({ path }) => {\n return () => (\n <ErrorMessage message={`Failed to read cache file at ${path}.`} />\n );\n },\n FailedToWriteCache: ({ path }) => {\n return () => (\n <ErrorMessage message={`Failed to write cache file at ${path}.`} />\n );\n },\n UploadApplicationFailed: () => {\n return () => <ErrorMessage message=\"Failed to upload the application\" />;\n },\n BuiltProjectNeeded: () => {\n return () => (\n <ErrorMessage message=\"Can not find build output, please execute `wix app build` to build your app before proceeding\" />\n );\n },\n WixUninstallMissingPackageName: () => {\n return () => <ErrorMessage message=\"Please specify a package name\" />;\n },\n FailedToReadJson: ({ filePath, cause }) => {\n const causeMessage = getErrorMessage(cause);\n return () => (\n <ErrorMessage\n message={`Failed to read ${filePath}. Cause: ${causeMessage}`}\n />\n );\n },\n InvalidJsonFile: ({ filePath, cause }) => {\n const causeMessage = getErrorMessage(cause);\n return () => (\n <ErrorMessage\n message={`Invalid JSON file located at ${filePath}. Cause: ${causeMessage}`}\n />\n );\n },\n FailedToWriteWixLock: () => {\n return () => <ErrorMessage message={`Failed to write 'wix.lock'`} />;\n },\n InvalidVeloConfigJson: ({ configFilename, cause }) => {\n const causeMessage = getErrorMessage(cause);\n return () => (\n <ErrorMessage\n message={`Invalid ${configFilename}, make sure it's configured correctly. Cause: ${causeMessage}`}\n />\n );\n },\n DashboardPageConfigNotFound: ({ configPath }) => {\n return () => (\n <ErrorMessage\n message={`Dashboard page config not found at ${configPath}`}\n />\n );\n },\n EmbeddedScriptConfigNotFound: ({ configPath }) => {\n return () => (\n <ErrorMessage\n message={`Embedded script config not found at ${configPath}`}\n />\n );\n },\n CustomElementConfigNotFound: ({ configPath }) => {\n return () => (\n <ErrorMessage\n message={`Custom element config not found at ${configPath}`}\n />\n );\n },\n NoExtensionsFound: () => {\n return () => (\n <ErrorMessage\n message=\"Your project doesn't seem to have any extensions.\"\n explanation=\"Extensions are the building blocks of your app.\"\n hint=\"Make sure it is configured properly, or read our documentation (​https://wix.to/b7o4Ml0) to start developing your first extension.\"\n />\n );\n },\n NoPagesDirectoryFound: ({ srcDir }) => {\n return () => (\n <ErrorMessage\n message={\n <>\n No <Text bold>pages</Text> directory was found under{' '}\n <Text bold>{srcDir}</Text>.\n </>\n }\n hint={\n <Text>\n Consider re-cloning the project repository or creating a{' '}\n <Text bold>pages</Text> directory under <Text bold>{srcDir}</Text>\n .\n </Text>\n }\n />\n );\n },\n DashboardPluginConfigNotFound: ({ configPath }) => {\n return () => (\n <ErrorMessage\n message={`Dashboard plugin config not found at ${configPath}`}\n />\n );\n },\n DashboardMenuPluginConfigNotFound: ({ configPath }) => {\n return () => (\n <ErrorMessage\n message={`Dashboard menu plugin config not found at ${configPath}`}\n />\n );\n },\n ServicePluginConfigNotFound: ({ configPath }) => {\n return () => (\n <ErrorMessage\n message={`Service plugin config not found at ${configPath}`}\n />\n );\n },\n DashboardModalConfigNotFound: ({ configPath }) => {\n return () => (\n <ErrorMessage\n message={`Dashboard modal config not found at ${configPath}`}\n />\n );\n },\n InvalidConfigSchemaError: ({ configPath, zodError }) => {\n return () => (\n <ErrorMessage\n message={outdent`\n Invalid configuration found at \\`${configPath}\\`:\n The following errors were found:\n ${zodError.errors.map(formatZodIssue).join('\\n')}`}\n hint=\"Fix the errors above for your configurations to be applied successfully.\"\n />\n );\n },\n InvalidParamsOverrideSchemaError: ({ paramsOverridePath, zodError }) => {\n return () => (\n <ErrorMessage\n message={outdent`\n Invalid params override found at \\`${paramsOverridePath}\\`:\n The following errors were found:\n ${zodError.errors.map(formatZodIssue).join('\\n')}`}\n hint=\"Fix the errors above for your params override to be applied successfully.\"\n />\n );\n },\n InvalidDependenciesJsonSchemaError: ({ path, zodError }) => {\n return () => (\n <ErrorMessage\n message={outdent`\n Invalid configuration found at \\`${path}\\`:\n The following errors were found:\n ${zodError.errors.map(formatZodIssue).join('\\n')}`}\n hint={\n <Text>\n Try to re-install <Text bold>@wix/cli-app</Text> dependency\n </Text>\n }\n />\n );\n },\n PermissionDenied: () => {\n return () => (\n <ErrorMessage message=\"Forbidden operation. Missing permissions\" />\n );\n },\n FailedToReadProjectFiles: ({ cause }) => {\n const causeMessage = getErrorMessage(cause);\n return () => (\n <ErrorMessage\n message={`Failed to read source files: make sure you have an 'src' folder and that it's readable. Cause: ${causeMessage}`}\n />\n );\n },\n FailedToCreateVersionForSubmittedApp: () => {\n return () => (\n <ErrorMessage\n message=\"Cannot create a new application version because the app has an active marketplace submission\"\n hint=\"You will be able continue creating versions when your submission is approved or retracted\"\n />\n );\n },\n GridAppFilesMaxLengthExcceeded: ({ maxSizeViolationsData, filePaths }) => {\n let errorMessage =\n 'Found one or more project files that are bigger than the allowed limit';\n\n if (maxSizeViolationsData?.files?.length) {\n errorMessage += ` (${\n maxSizeViolationsData.expectedSize\n }KB): ${maxSizeViolationsData.files\n .map((f) => `${filePaths[f.fileIndex]} (${f.receivedSize}KB)`)\n .join(', ')}`;\n }\n\n return () => <ErrorMessage message={errorMessage} />;\n },\n GridAppFailedToUpdateFiles: () => {\n return () => (\n <ErrorMessage\n message={outdent`\n Failed to update files.\n Failed to sync changes from local files to the Dev Editor\n Still watching local files and will continue to sync changes...\n `}\n />\n );\n },\n FailedToWatchFiles: ({ cause }) => {\n const causeMessage = getErrorMessage(cause);\n\n return () => (\n <ErrorMessage\n message={`Failed to watch files. Cause: ${causeMessage}`}\n />\n );\n },\n FailedToCreateGridApp: ({ error }) => {\n return () => (\n <ErrorMessage\n message=\"Failed to create an isolated environment.\"\n explanation={error}\n />\n );\n },\n DeviceCodeTimedOut: () => {\n return () => (\n <ErrorMessage message=\"The device code has not been approved in the time allocated, please start the login process again.\" />\n );\n },\n DuplicateComponentIdsError: ({ issues }) => {\n const Issue = ({ issue }: { issue: (typeof issues)[0] }) => {\n const typeToName = (type: (typeof issue)['components'][0]['type']) =>\n match(type, {\n page: () => 'page',\n plugin: () => 'plugin',\n 'menu-plugin': () => 'menu plugin',\n 'sidebar-category': () => 'sidebar category',\n 'embedded-script': () => 'embedded script',\n 'custom-element': () => 'custom element',\n modal: () => 'modal',\n topology: () => 'topology',\n });\n return (\n <Box flexDirection=\"column\">\n <Text>\n <Text bold>Duplicate ID: </Text>\n {issue.id}\n </Text>\n <Text bold>Extensions:</Text>\n {issue.components.map(({ name, path, type }) => (\n <Text key={path}>\n [{typeToName(type)}] {name} ({path})\n </Text>\n ))}\n <Text>\n <Text bold>Possible GUID: </Text>\n {issue.suggestedId}\n </Text>\n </Box>\n );\n };\n const hint = (\n <Box flexDirection=\"column\" rowGap={1}>\n <Text>\n You can use the provided suggested GUIDs as the ID of the newly\n created extension.\n </Text>\n {issues.map((issue) => (\n <Issue issue={issue} key={issue.id} />\n ))}\n </Box>\n );\n\n return () => (\n <ErrorMessage\n message=\"Found multiple extensions with the same id, this might happen if you copy paste folders.\"\n hint={hint}\n />\n );\n },\n InvalidResponseData: () => {\n return () => (\n <SystemErrorMessage message=\"Got unexpected response from server.\" />\n );\n },\n InvalidCreateAppResponse: () => {\n return () => (\n <ErrorMessage message=\"`createApp` returned an invalid response.\" />\n );\n },\n InvalidDeployAppResponse: () => {\n return () => (\n <ErrorMessage message=\"Got unexpected response from server. Make sure you are running a supported version of the Velo CLI.\" />\n );\n },\n InvalidGetDeploymentResponse: () => {\n return () => (\n <ErrorMessage message=\"Got unexpected response from server. Please try again later..\" />\n );\n },\n FailedToGetPagesDiff: () => {\n return () => <ErrorMessage message=\"Failed to request pages diff.\" />;\n },\n InvalidViteBuildOutput: () => {\n return () => <ErrorMessage message=\"Invalid vite build output\" />;\n },\n ViteModuleBundleNotFound: () => {\n return () => (\n <ErrorMessage message=\"Could not find module bundle in vite build output\" />\n );\n },\n ViteFileNotFoundInOutput: ({ fileName }) => {\n return () => (\n <ErrorMessage\n message={`Could not find ${fileName} in vite build output`}\n />\n );\n },\n FailedToCreatePresignedUrl: () => {\n return () => (\n <ErrorMessage message=\"Failed to create a presigned upload url\" />\n );\n },\n FailedToCreateBackendDeployment: () => {\n return () => (\n <ErrorMessage message=\"Failed to create backend deployment\" />\n );\n },\n FailedToUpdateBackendDeployment: () => {\n return () => (\n <ErrorMessage message=\"Failed to update backend deployment\" />\n );\n },\n FailedToGetBackendDeployment: () => {\n return () => <ErrorMessage message=\"Failed to get backend deployment\" />;\n },\n FailedToDeployBackend: () => {\n return () => <ErrorMessage message=\"Failed to deploy backend\" />;\n },\n FailedToUploadApplicationFiles: () => {\n return () => (\n <ErrorMessage message=\"Failed to upload the application files\" />\n );\n },\n FailedToVerifyDeployment: () => {\n return () => (\n <ErrorMessage message=\"Deployment was not finished within the desired timeframe, please try again later.\" />\n );\n },\n FailedToGetUserInfo: () => {\n return () => <ErrorMessage message=\"Failed to get user information.\" />;\n },\n FailedToGetMyAccount: () => {\n return () => (\n <SystemErrorMessage message=\"Failed to get account information.\" />\n );\n },\n FailedToCreateDevelopmentSite: () => {\n return () => (\n <ErrorMessage message=\"Failed to create a Development Site\" />\n );\n },\n FailedToGetDevelopmentSites: () => {\n return () => (\n <ErrorMessage message=\"Failed to request development sites.\" />\n );\n },\n FailedToGetDevelopmentSitesLimit: () => {\n return () => (\n <ErrorMessage message=\"Failed to request development sites limit.\" />\n );\n },\n FailedToGetRequiredApps: () => {\n return () => <ErrorMessage message=\"Failed to get app required apps.\" />;\n },\n FailedToGetMarketListing: () => {\n return () => <ErrorMessage message=\"Failed to get market listing.\" />;\n },\n FailedToAddRequiredApp: () => {\n return () => <ErrorMessage message=\"Failed to add required app.\" />;\n },\n FailedToQuerySites: () => {\n return () => <ErrorMessage message=\"Failed to request sites list.\" />;\n },\n FailedToGetSite: () => {\n return () => (\n <ErrorMessage message=\"Failed to get information about your configured Development Site\" />\n );\n },\n FailedToDeploySite: () => {\n return () => <ErrorMessage message=\"Failed to deploy site.\" />;\n },\n FailedToPublishDeployment: () => {\n return () => <SystemErrorMessage message=\"Failed to publish site.\" />;\n },\n FailedToSaveDevelopmentSite: ({ path }) => {\n return () => (\n <ErrorMessage\n message=\"Failed to save the current development site.\"\n hint={`Make sure the \\`${path}\\` file has proper permissions and is accessible`}\n />\n );\n },\n FailedToBuildApp: ({ cause }) => {\n const causeMessage = getErrorMessage(cause);\n return () => (\n <ErrorMessage\n message={\n <>\n Failed to build the application.\n <Newline />\n {causeMessage}\n </>\n }\n hint={'Please check the build output for more information'}\n />\n );\n },\n FailedToCheckIfAppInstalled: () => {\n return () => (\n <ErrorMessage message=\"Failed to fetch site installation details\" />\n );\n },\n FailedToInitializeGitRepo: ({ cause }) => {\n const causeMessage = getErrorMessage(cause);\n return () => (\n <ErrorMessage\n message={`Failed to initialize git repo. Cause: ${causeMessage}`}\n />\n );\n },\n FailedToInstallDependencies: ({ cause }) => {\n const causeMessage = getErrorMessage(cause);\n return () => (\n <ErrorMessage\n message={`Failed to install dependencies. Cause: ${causeMessage}`}\n />\n );\n },\n FailedToCommitChanges: ({ cause }) => {\n const causeMessage = getErrorMessage(cause);\n return () => (\n <ErrorMessage\n message={`Failed to commit changes. Cause: ${causeMessage}`}\n />\n );\n },\n FailedToDeleteAuthData: ({ cause }) => {\n const causeMessage = getErrorMessage(cause);\n return () => (\n <ErrorMessage message={`Failed to delete auth data: ${causeMessage}`} />\n );\n },\n FailedToDeleteLegacyAuthData: ({ cause }) => {\n const causeMessage = getErrorMessage(cause);\n return () => (\n <ErrorMessage\n message={`Failed to delete legacy auth data: ${causeMessage}`}\n />\n );\n },\n FailedToSaveAuthData: ({ cause }) => {\n const causeMessage = getErrorMessage(cause);\n return () => (\n <ErrorMessage message={`Failed to save auth data: ${causeMessage}`} />\n );\n },\n FailedToSaveApiKeyAuthData: ({ cause }) => {\n const causeMessage = getErrorMessage(cause);\n return () => (\n <ErrorMessage\n message={`Failed to save api key auth data: ${causeMessage}`}\n />\n );\n },\n FailedToWriteJson: ({ filePath, cause }) => {\n const causeMessage = getErrorMessage(cause);\n return () => (\n <ErrorMessage\n message={`Failed to write JSON at path: ${filePath}. Cause: ${causeMessage}`}\n />\n );\n },\n TemplatePathNotFound: ({ templatePath }) => {\n return () => (\n <ErrorMessage\n message={`Template path not found: ${templatePath}`}\n hint=\"Make sure the template path exists in the remote repository\"\n />\n );\n },\n FailedToCloneRepo: ({ cause }) => {\n const causeMessage = getErrorMessage(cause);\n return () => (\n <ErrorMessage\n message={`Failed to clone repo: ${causeMessage}`}\n hint=\"Make sure the Git URL is correct and that your local Git is configured properly to access the remote repository\"\n />\n );\n },\n InvalidGitUrl: ({ url }) => {\n return () => (\n <ErrorMessage\n message={`Invalid Git URL: ${url}`}\n hint=\"Make sure the Git URL is in the correct format\"\n />\n );\n },\n AuthenticationRequired: () => {\n return () => (\n <ErrorMessage message=\"You have to already be logged in to run this command.\" />\n );\n },\n SiteConfiguredRequired: () => {\n return () => (\n <ErrorMessage message=\"You must configure the development site before running this command, or provide a site-id in the command options.\" />\n );\n },\n FailedAddingPackageToWorkspace: () => {\n return () => (\n <ErrorMessage\n message=\"Could not add package to the workspaces configuration. Please add it as instructed by your package manager.\"\n hint={\n <Text>\n Full error can be found in <Text bold>wix-error.log</Text>\n </Text>\n }\n />\n );\n },\n FailedToGenerateSelfsignedCertificate: () => {\n return () => (\n <ErrorMessage message=\"Failed to generate a Selfsigned certificate for development.\" />\n );\n },\n NonInteractiveTerminal: () => {\n return () => (\n <ErrorMessage message=\"This command is not supported in non-interactive terminals. Please run the command in an interactive terminal (TTY).\" />\n );\n },\n FailedToResolveViteOrigin: () => {\n return () => (\n <ErrorMessage message=\"Failed to resolve the base url for CSS asset urls\" />\n );\n },\n FailedToCreateAppRelease: () => {\n return () => (\n <SystemErrorMessage message=\"Failed to create an app configuration in dev center.\" />\n );\n },\n FailedToUpdateAppRelease: () => {\n return () => (\n <SystemErrorMessage message=\"Failed to update an app configuration in dev center.\" />\n );\n },\n FailedToCreateComponents: () => {\n return () => (\n <SystemErrorMessage message=\"Failed to create components in dev center.\" />\n );\n },\n FailedToCheckDeprecatedStatus: () => {\n return () => (\n <SystemErrorMessage message=\"Failed to check cli version deprecated status.\" />\n );\n },\n FailedToGetResolveNpmDependenciesResult: () => {\n return () => (\n <SystemErrorMessage message=\"Failed to resolve Wix's lockfile.\" />\n );\n },\n CliAppVersionMismatch: ({ cliVersion, cliAppVersion }) => {\n return () => (\n <ErrorMessage\n message={\n <Text>\n The versions of <Text bold>@wix/cli</Text> ({cliVersion}) and{' '}\n <Text bold>@wix/cli-app</Text> ({cliAppVersion}) dependencies do\n not match\n </Text>\n }\n hint={\n <Text>\n Align their versions in your <Text bold>package.json</Text> and\n re-install dependencies\n </Text>\n }\n />\n );\n },\n FailedToGetAppValidity: () => {\n return () => (\n <SystemErrorMessage message=\"Failed to get validation status for app version from dev center\" />\n );\n },\n InvalidDashboardPageRoute: ({ route, errorMessage }) => {\n return () => (\n <ErrorMessage\n message={`Invalid dashboard page route: ${route}`}\n hint={errorMessage}\n />\n );\n },\n InvalidEmbeddedScriptFolder: ({ path, errorMessage }) => {\n return () => (\n <ErrorMessage\n message={`Invalid embedded script folder: ${path}`}\n hint={errorMessage}\n />\n );\n },\n InvalidEmbeddedScriptTemplate: ({ templateFilename, errorMessage }) => {\n return () => (\n <ErrorMessage\n message={`Invalid embedded script template in ${templateFilename}`}\n hint={errorMessage}\n />\n );\n },\n InvalidCustomElementTagName: ({ tagName, errorMessage }) => {\n return () => (\n <ErrorMessage\n message={\n <Text>\n We use name of folder as tagName for your custom element.\n Unfortunately, <Text bold>{tagName}</Text> is invalid tagName.\n Reason: {errorMessage}\n </Text>\n }\n hint={\n <Text>\n You can find rules for tagName here:{' '}\n <Text bold>\n https://developer.mozilla.org/en-US/docs/Web/API/CustomElementRegistry/define#valid_custom_element_names\n </Text>\n </Text>\n }\n />\n );\n },\n InvalidSiteFrontendPackageVersion: ({ packageName, versionRange }) => {\n return () => (\n <ErrorMessage\n message={\n <Text>\n Package <Text bold>{packageName}</Text> has an invalid version\n range <Text bold>{versionRange}</Text> in your{' '}\n <Text bold>package.json</Text> file.\n </Text>\n }\n hint={\n <Text>\n The version range must follow{' '}\n <Text bold>semantic versioning</Text> rules, and it must contain a\n major version.\n <Newline />\n Read more about it here:{' '}\n <Link url=\"https://docs.npmjs.com/about-semantic-versioning\" />\n </Text>\n }\n />\n );\n },\n FailedToCreateSiteOverride: () => {\n return () => (\n <SystemErrorMessage message=\"Failed to create site override configuration\" />\n );\n },\n FailedToGetPipelineErrorInfo: () => {\n return () => <SystemErrorMessage message=\"Failed to get error details\" />;\n },\n FailedToGetDeploymentStatus: () => {\n return () => (\n <SystemErrorMessage message=\"Failed to get deployment status\" />\n );\n },\n NetworkError: ({ cause }) => {\n const causeMessage = getErrorMessage(cause);\n return () => (\n <ErrorMessage\n message={`Network error occurred. Cause: ${causeMessage}`}\n hint={`Make sure you have an active internet connection and try again shortly.`}\n />\n );\n },\n FailedToGenerateAppMarketQueryParam: () => {\n return () => (\n <SystemErrorMessage message=\"Failed to get generate appMarket query parameter\" />\n );\n },\n FailedToParseLog: () => {\n return () => (\n <SystemErrorMessage message=\"Failed to parse log from the server\" />\n );\n },\n FailedToFetchAppForVersion: ({ version }) => {\n return () => (\n <ErrorMessage\n message={`Failed to fetch app configuration for the provided version: \"${version}\"`}\n hint={`Make sure that there is an app for this version.`}\n />\n );\n },\n FailedToConnectToLogsService: () => {\n return () => (\n <ErrorMessage message={`Failed to connect to logs service.`} />\n );\n },\n FailedToGetLogsTopology: () => {\n return () => (\n <ErrorMessage\n message={`Failed to fetch logs configuration for the given version.`}\n hint={`Try to use a different version.`}\n />\n );\n },\n LogsConnectionTimeout: () => {\n return () => (\n <ErrorMessage message={`Log session has been closed due to timeout.`} />\n );\n },\n });\n}\n\nfunction getErrorMessage(cause: unknown) {\n return cause instanceof Error ? cause.message : JSON.stringify(cause);\n}\n\nfunction formatZodIssue(issue: ZodIssue) {\n const path = issue.path.join('.');\n\n if (!path) {\n return `- ${issue.message}`;\n }\n\n return `- \\`${path}\\`: ${issue.message}`;\n}\n","type TODO = any;\n\n// In the absence of a WeakSet or WeakMap implementation, don't break, but don't cache either.\nfunction noop(...args: Array<any>) {}\nfunction createWeakMap<K extends object, V>(): MyWeakMap<K, V> {\n if (typeof WeakMap !== \"undefined\") {\n return new WeakMap<K, V>();\n } else {\n return fakeSetOrMap<K, V>();\n }\n}\n\ntype MyWeakMap<K extends object, V> = Pick<\n WeakMap<K, V>,\n \"delete\" | \"get\" | \"set\" | \"has\"\n>;\ntype MyWeakSetMap<K extends object, V> =\n & Pick<WeakMap<K, V>, \"delete\" | \"get\" | \"set\" | \"has\">\n & Pick<WeakSet<K>, \"add\">;\n\n/**\n * Creates and returns a no-op implementation of a WeakMap / WeakSet that never stores anything.\n */\nfunction fakeSetOrMap<K extends object, V = any>(): MyWeakSetMap<K, V> {\n return {\n add: noop as WeakSet<K>[\"add\"],\n delete: noop as WeakMap<K, V>[\"delete\"],\n get: noop as WeakMap<K, V>[\"get\"],\n set: noop as WeakMap<K, V>[\"set\"],\n has(k: K) {\n return false;\n },\n };\n}\n\n// Safe hasOwnProperty\nconst hop = Object.prototype.hasOwnProperty;\nconst has = function (obj: object, prop: string): boolean {\n return hop.call(obj, prop);\n};\n\n// Copy all own enumerable properties from source to target\nfunction extend<T, S extends object>(target: T, source: S) {\n type Extended = T & S;\n for (const prop in source) {\n if (has(source, prop)) {\n (target as any)[prop] = source[prop];\n }\n }\n return target as Extended;\n}\n\nconst reLeadingNewline = /^[ \\t]*(?:\\r\\n|\\r|\\n)/;\nconst reTrailingNewline = /(?:\\r\\n|\\r|\\n)[ \\t]*$/;\nconst reStartsWithNewlineOrIsEmpty = /^(?:[\\r\\n]|$)/;\nconst reDetectIndentation = /(?:\\r\\n|\\r|\\n)([ \\t]*)(?:[^ \\t\\r\\n]|$)/;\nconst reOnlyWhitespaceWithAtLeastOneNewline = /^[ \\t]*[\\r\\n][ \\t\\r\\n]*$/;\n\nfunction _outdentArray(\n strings: ReadonlyArray<string>,\n firstInterpolatedValueSetsIndentationLevel: boolean,\n options: Options,\n) {\n // If first interpolated value is a reference to outdent,\n // determine indentation level from the indentation of the interpolated value.\n let indentationLevel = 0;\n\n const match = strings[0].match(reDetectIndentation);\n if (match) {\n indentationLevel = match[1].length;\n }\n\n const reSource = `(\\\\r\\\\n|\\\\r|\\\\n).{0,${indentationLevel}}`;\n const reMatchIndent = new RegExp(reSource, \"g\");\n\n if (firstInterpolatedValueSetsIndentationLevel) {\n strings = strings.slice(1);\n }\n\n const { newline, trimLeadingNewline, trimTrailingNewline } = options;\n const normalizeNewlines = typeof newline === \"string\";\n const l = strings.length;\n const outdentedStrings = strings.map((v, i) => {\n // Remove leading indentation from all lines\n v = v.replace(reMatchIndent, \"$1\");\n // Trim a leading newline from the first string\n if (i === 0 && trimLeadingNewline) {\n v = v.replace(reLeadingNewline, \"\");\n }\n // Trim a trailing newline from the last string\n if (i === l - 1 && trimTrailingNewline) {\n v = v.replace(reTrailingNewline, \"\");\n }\n // Normalize newlines\n if (normalizeNewlines) {\n v = v.replace(/\\r\\n|\\n|\\r/g, (_) => newline as string);\n }\n return v;\n });\n return outdentedStrings;\n}\n\nfunction concatStringsAndValues(\n strings: ReadonlyArray<string>,\n values: ReadonlyArray<any>,\n): string {\n let ret = \"\";\n for (let i = 0, l = strings.length; i < l; i++) {\n ret += strings[i];\n if (i < l - 1) {\n ret += values[i];\n }\n }\n return ret;\n}\n\nfunction isTemplateStringsArray(v: any): v is TemplateStringsArray {\n return has(v, \"raw\") && has(v, \"length\");\n}\n\n/**\n * It is assumed that opts will not change. If this is a problem, clone your options object and pass the clone to\n * makeInstance\n * @param options\n * @return {outdent}\n */\nfunction createInstance(options: Options): Outdent {\n /** Cache of pre-processed template literal arrays */\n const arrayAutoIndentCache = createWeakMap<\n TemplateStringsArray,\n Array<string>\n >();\n /**\n * Cache of pre-processed template literal arrays, where first interpolated value is a reference to outdent,\n * before interpolated values are injected.\n */\n const arrayFirstInterpSetsIndentCache = createWeakMap<\n TemplateStringsArray,\n Array<string>\n >();\n\n /* tslint:disable:no-shadowed-variable */\n function outdent(\n stringsOrOptions: TemplateStringsArray,\n ...values: Array<any>\n ): string;\n function outdent(stringsOrOptions: Options): Outdent;\n function outdent(\n stringsOrOptions: TemplateStringsArray | Options,\n ...values: Array<any>\n ): string | Outdent {\n /* tslint:enable:no-shadowed-variable */\n if (isTemplateStringsArray(stringsOrOptions)) {\n const strings = stringsOrOptions;\n\n // Is first interpolated value a reference to outdent, alone on its own line, without any preceding non-whitespace?\n const firstInterpolatedValueSetsIndentationLevel =\n (values[0] === outdent || values[0] === defaultOutdent) &&\n reOnlyWhitespaceWithAtLeastOneNewline.test(strings[0]) &&\n reStartsWithNewlineOrIsEmpty.test(strings[1]);\n\n // Perform outdentation\n const cache = firstInterpolatedValueSetsIndentationLevel\n ? arrayFirstInterpSetsIndentCache\n : arrayAutoIndentCache;\n let renderedArray = cache.get(strings);\n if (!renderedArray) {\n renderedArray = _outdentArray(\n strings,\n firstInterpolatedValueSetsIndentationLevel,\n options,\n );\n cache.set(strings, renderedArray);\n }\n /** If no interpolated values, skip concatenation step */\n if (values.length === 0) {\n return renderedArray[0];\n }\n /** Concatenate string literals with interpolated values */\n const rendered = concatStringsAndValues(\n renderedArray,\n firstInterpolatedValueSetsIndentationLevel ? values.slice(1) : values,\n );\n\n return rendered;\n } else {\n // Create and return a new instance of outdent with the given options\n return createInstance(\n extend(extend({}, options), stringsOrOptions || {}),\n );\n }\n }\n\n const fullOutdent = extend(outdent, {\n string(str: string): string {\n return _outdentArray([str], false, options)[0];\n },\n });\n\n return fullOutdent;\n}\n\nconst defaultOutdent = createInstance({\n trimLeadingNewline: true,\n trimTrailingNewline: true,\n});\n\nexport interface Outdent {\n /**\n * Remove indentation from a template literal.\n */\n (strings: TemplateStringsArray, ...values: Array<any>): string;\n /**\n * Create and return a new Outdent instance with the given options.\n */\n (options: Options): Outdent;\n\n /**\n * Remove indentation from a string\n */\n string(str: string): string;\n\n // /**\n // * Remove indentation from a template literal, but return a tuple of the\n // * outdented TemplateStringsArray and\n // */\n // pass(strings: TemplateStringsArray, ...values: Array<any>): [TemplateStringsArray, ...Array<any>];\n}\nexport interface Options {\n trimLeadingNewline?: boolean;\n trimTrailingNewline?: boolean;\n /**\n * Normalize all newlines in the template literal to this value.\n * \n * If `null`, newlines are left untouched.\n * \n * Newlines that get normalized are '\\r\\n', '\\r', and '\\n'.\n * \n * Newlines within interpolated values are *never* normalized.\n * \n * Although intended for normalizing to '\\n' or '\\r\\n',\n * you can also set to any string; for example ' '.\n */\n newline?: string | null;\n}\n\n// Named exports. Simple and preferred.\n// import outdent from 'outdent';\nexport default defaultOutdent;\n// import {outdent} from 'outdent';\nexport { defaultOutdent as outdent };\n\n// In CommonJS environments, enable `var outdent = require('outdent');` by\n// replacing the exports object.\n// Make sure that our replacement includes the named exports from above.\ndeclare var module: any;\nif (typeof module !== \"undefined\") {\n // In webpack harmony-modules environments, module.exports is read-only,\n // so we fail gracefully.\n try {\n module.exports = defaultOutdent;\n Object.defineProperty(defaultOutdent, \"__esModule\", { value: true });\n (defaultOutdent as any).default = defaultOutdent;\n (defaultOutdent as any).outdent = defaultOutdent;\n } catch (e) {}\n}\n","import React, { type ReactElement, type FC, type ReactNode } from 'react';\nimport { Alert, Box, InsightIcon, Text } from '@wix/cli-ui-kit';\n\nexport const ErrorMessage: FC<{\n message: string | ReactNode;\n explanation?: string | ReactNode;\n hint?: string | ReactElement;\n}> = ({ message, explanation, hint }) => (\n <Box flexDirection=\"column\">\n <Alert type=\"error\">{message}</Alert>\n\n {explanation && <Alert type=\"warning\">{explanation}</Alert>}\n\n {hint && (\n <Box paddingTop={1} columnGap={1}>\n <InsightIcon />\n {typeof hint === 'string' ? <Text>{hint}</Text> : hint}\n </Box>\n )}\n </Box>\n);\n\nexport const SystemErrorMessage: FC<{\n message: string | ReactNode;\n explanation?: string | ReactNode;\n hint?: string | ReactElement;\n}> = ({ message, explanation, hint }) => (\n <ErrorMessage\n message={message}\n explanation={explanation}\n hint={\n hint ??\n 'This is probably a temporary system error and has been logged. Try again shortly.'\n }\n />\n);\n","import React, { type FC, type ReactNode } from 'react';\nimport { useExit } from '@wix/cli-ui-kit';\nimport { AuthContext } from '../context.js';\nimport type { UserInfo } from '../schemas.js';\nimport { accountAuthStrategy } from '../auth-strategies/index.js';\nimport { EnsureLoggedIn } from '../components/EnsureLoggedIn.js';\n\ninterface Props {\n children: ReactNode;\n onError?: (error: unknown) => void;\n onLogin?: (userInfo: UserInfo) => void;\n}\n\nexport const AccountAuthProvider: FC<Props> = ({\n children,\n onError,\n onLogin,\n}) => {\n const exit = useExit();\n\n return (\n <EnsureLoggedIn\n authStrategy={accountAuthStrategy}\n onLogin={({ userInfo }) => onLogin?.(userInfo)}\n onError={onError ?? exit}\n >\n {({ getAccessToken, getRequestHeaders, userInfo }) => (\n <AuthContext.Provider\n value={{ getAccessToken, getRequestHeaders, userInfo }}\n >\n {children}\n </AuthContext.Provider>\n )}\n </EnsureLoggedIn>\n );\n};\n","import { createContext } from 'react';\nimport type { AuthStrategyState } from './auth-strategies/index.js';\n\nexport type AuthState = Pick<\n AuthStrategyState,\n 'getAccessToken' | 'getRequestHeaders' | 'userInfo'\n>;\n\nexport const AuthContext = createContext<AuthState | null>(null);\n","export type { AuthStrategyState, AuthStrategy } from './auth-strategy-types.js';\nexport { apiKeyAuthStrategy } from './api-key-auth-strategy.js';\nexport { accountAuthStrategy } from './account-auth-strategy.js';\nexport { createSiteAuthStrategy } from './site-auth-strategy.js';\n","import { match } from 'variant';\nimport { client } from '../client.js';\nimport type { ApiKeyAuth } from '../schemas.js';\nimport {\n readApiKeyAuthData,\n saveApiKeyAuthData,\n deleteAuthData,\n} from '../auth-data.js';\nimport type {\n ApiKeyAuthStrategy,\n AuthStrategyState,\n} from './auth-strategy-types.js';\n\nfunction createApiKeyAuthState({\n authData: { token, accountId, userInfo },\n siteId,\n}: {\n authData: ApiKeyAuth;\n siteId?: string;\n}): AuthStrategyState {\n return {\n getAccessToken: async () => token,\n getRefreshToken: () => {\n throw new Error('API key auth does not support refresh tokens');\n },\n getRequestHeaders: () => ({\n 'wix-account-id': accountId,\n ...(siteId && { 'wix-site-id': siteId }),\n }),\n userInfo,\n };\n}\n\nexport const apiKeyAuthStrategy: ApiKeyAuthStrategy = {\n async isLoggedIn({ siteId }: { siteId?: string } = {}) {\n const apiKeyAuth = await readApiKeyAuthData();\n\n return match(apiKeyAuth, {\n Authenticated: ({ payload }) => {\n return createApiKeyAuthState({ authData: payload, siteId });\n },\n Unauthenticated: () => null,\n });\n },\n async login({ token }) {\n const { accountId, accountOwner, slug } = await client.getMyAccount({\n token,\n });\n\n const authData: ApiKeyAuth = {\n token,\n accountId,\n userInfo: {\n userId: accountOwner,\n // TODO: this should be the email of the account owner, not the slug\n // https://jira.wixpress.com/browse/FEDINF-12201\n email: slug,\n },\n };\n\n await deleteAuthData();\n await saveApiKeyAuthData(authData);\n\n return createApiKeyAuthState({ authData });\n },\n};\n","import pRetry from 'p-retry';\nimport type { Options } from 'p-retry';\nimport type {\n DeviceCodeRequest,\n RevokeRefreshTokenRequest,\n} from '@wix/ambassador-identity-oauth-v1-refresh-token/types';\nimport { getMyAccount } from '@wix/ambassador-identity-account-v2-account/http';\nimport {\n deviceCode as deviceCodeRequest,\n token as tokenRequest,\n revokeRefreshToken,\n} from '@wix/ambassador-identity-oauth-v1-refresh-token/http';\nimport type { HttpClient, HttpError } from '@wix/cli-http-client';\nimport { isHttpError, createHttpClient } from '@wix/cli-http-client';\nimport { CliError, CliErrorCode } from '@wix/cli-error';\nimport { fields, payload, variant } from 'variant';\nimport { getTestOverrides } from '@wix/cli-test-overrides';\nimport type { SiteAuth, UserInfo } from './schemas.js';\nimport {\n deviceCodeSchema,\n tokenSchema,\n userInfoSchema,\n getMyAccountSchema,\n} from './schemas.js';\n\nconst {\n InvalidResponseData,\n FailedToGetAuthToken,\n FailedToGetDeviceCode,\n FailedToRenewAuthToken,\n FailedToRenewAuthTokenSiteNotFound,\n FailedToRevokeRefreshToken,\n} = CliErrorCode;\n\nconst clientId = '6f95cec8-3e98-48b9-b4e5-1fb92fcd9973';\n\nconst getCurrentTimestamp = () => Math.floor(Date.now() / 1000);\n\ntype TokenRequest = {\n clientId: string;\n grantType: string;\n scope?: string;\n deviceCode?: string;\n refreshToken?: string;\n siteId?: string;\n};\n\ntype TokenResponse = {\n access_token: string;\n refresh_token: string;\n expires_in: number;\n};\n\nexport class DeviceCodeNotYetVerifiedError extends Error {}\n\nexport const RenewTokenData = variant({\n TokenRenewed: payload<SiteAuth>(),\n RefreshTokenRevoked: fields<{ cause: HttpError }>(),\n});\n\nexport class AuthClient {\n private readonly retryOptions: Options;\n constructor(private readonly httpClient: HttpClient) {\n const { minRetryTimeout } = getTestOverrides();\n\n this.retryOptions = {\n retries: 3,\n minTimeout: minRetryTimeout,\n maxTimeout: 3 * 1000,\n };\n }\n\n async requestDeviceCode(req: DeviceCodeRequest = {}) {\n try {\n const { data } = await pRetry(\n () => this.httpClient.request(deviceCodeRequest({ ...req, clientId })),\n this.retryOptions\n );\n\n return deviceCodeSchema.parse(data);\n } catch (error) {\n throw new CliError({\n code: FailedToGetDeviceCode(),\n cause: error,\n });\n }\n }\n\n async createToken(req: { deviceCode: string }) {\n try {\n const payload: TokenRequest = {\n clientId,\n grantType: 'urn:ietf:params:oauth:grant-type:device_code',\n scope: 'offline_access',\n ...req,\n };\n\n const tokenData = await pRetry(async () => {\n // any is needed because `tokenRequest` uses `RawHttpRequest` and `RawHttpResponse` which are not typed correctly\n const { data, requestId } =\n await this.httpClient.request<TokenResponse>(\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n tokenRequest(payload as any) as any\n );\n\n const result = tokenSchema.safeParse(data);\n\n if (result.success) {\n return result.data;\n }\n\n throw new CliError({\n code: InvalidResponseData(),\n cause: result.error,\n info: { requestId, data },\n });\n }, this.retryOptions);\n\n return {\n ...tokenData,\n issuedAt: getCurrentTimestamp(),\n };\n } catch (error) {\n if (isHttpError(error)) {\n if (\n error.response?.data?.message === 'Device code is not yet verified' ||\n // https://github.com/wix-private/wix-cli/pull/655#discussion_r1145992702\n error.response?.data?.error === 'authorization_pending'\n ) {\n throw new DeviceCodeNotYetVerifiedError(\n 'Device code is not yet verified.'\n );\n }\n }\n\n throw new CliError({\n code: FailedToGetAuthToken(),\n cause: error,\n });\n }\n }\n\n async renewToken(req: { refreshToken: string; siteId?: string }) {\n try {\n const payload: TokenRequest = {\n clientId,\n grantType: 'refresh_token',\n ...req,\n };\n\n // any is needed because `tokenRequest` uses `RawHttpRequest` and `RawHttpResponse` which are not typed correctly\n const { data } = await pRetry(\n () =>\n this.httpClient.request<TokenResponse>(\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n tokenRequest(payload as any) as any\n ),\n this.retryOptions\n );\n\n const tokenData = tokenSchema.parse(data);\n\n return RenewTokenData.TokenRenewed({\n ...tokenData,\n issuedAt: getCurrentTimestamp(),\n });\n } catch (error) {\n if (isHttpError(error)) {\n if (\n error.response?.status === 400 &&\n error.response?.data?.error === 'invalid_grant'\n ) {\n return RenewTokenData.RefreshTokenRevoked({ cause: error });\n }\n if (\n req.siteId &&\n error.response?.status === 404 &&\n error.response?.data?.details?.applicationError?.code ===\n 'SITE_NOT_FOUND'\n ) {\n throw new CliError({\n code: FailedToRenewAuthTokenSiteNotFound({ siteId: req.siteId }),\n cause: error,\n });\n }\n }\n\n throw new CliError({\n code: FailedToRenewAuthToken(),\n cause: error,\n });\n }\n }\n\n async revokeRefreshToken(\n req: RevokeRefreshTokenRequest,\n { email }: UserInfo\n ) {\n try {\n const { data } = await this.httpClient.request(revokeRefreshToken(req));\n\n return data;\n } catch (error) {\n throw new CliError({\n code: FailedToRevokeRefreshToken({\n email,\n }),\n info: {\n email,\n },\n cause: error,\n });\n }\n }\n\n async userInfo({ accessToken }: { accessToken: string }) {\n try {\n const httpClient = createHttpClient({\n type: 'backoffice',\n getAppToken: async () => accessToken,\n });\n const { data: userInfoData } = await httpClient.get(\n '/_serverless/wix-cli-userinfo/userinfo'\n );\n\n return userInfoSchema.parse(userInfoData);\n } catch (error) {\n throw new CliError({\n code: CliErrorCode.FailedToGetUserInfo(),\n cause: error,\n });\n }\n }\n\n async getMyAccount({ token }: { token: string }) {\n try {\n const httpClient = createHttpClient({\n type: 'backoffice',\n getAppToken: async () => token,\n });\n const { data } = await httpClient.request(getMyAccount({}));\n\n return getMyAccountSchema.parse(data).account;\n } catch (error) {\n throw new CliError({\n code: CliErrorCode.FailedToGetMyAccount(),\n cause: error,\n });\n }\n }\n}\n\nexport const client = new AuthClient(createHttpClient({ type: 'backoffice' }));\n",null,null,"import { z } from 'zod';\n\nexport const deviceCodeSchema = z.object({\n deviceCode: z.string(),\n verificationUri: z.string().url(),\n userCode: z.string(),\n expiresIn: z.number(),\n});\n\nexport type DeviceCodeResponse = z.TypeOf<typeof deviceCodeSchema>;\n\nexport const tokenSchema = z\n .object({\n access_token: z.string(),\n refresh_token: z.string(),\n expires_in: z.number(),\n })\n .transform((token) => ({\n accessToken: token.access_token,\n refreshToken: token.refresh_token,\n expiresIn: token.expires_in,\n }));\n\nexport const userInfoSchema = z.object({\n userId: z.string().uuid(),\n email: z.string().email(),\n});\n\nexport type UserInfo = z.TypeOf<typeof userInfoSchema>;\n\nexport const getMyAccountSchema = z.object({\n account: z.object({\n slug: z.string(),\n accountId: z.string().uuid(),\n accountOwner: z.string().uuid(),\n }),\n});\n\nexport const siteAuthSchema = z.object({\n accessToken: z.string(),\n refreshToken: z.string(),\n expiresIn: z.number(),\n issuedAt: z.number(),\n});\n\nexport type SiteAuth = z.TypeOf<typeof siteAuthSchema>;\n\nexport const accountAuthSchema = siteAuthSchema.extend({\n userInfo: userInfoSchema,\n});\n\nexport type AccountAuth = z.TypeOf<typeof accountAuthSchema>;\n\nexport const apiKeyAuthSchema = z.object({\n token: z.string(),\n accountId: z.string().uuid(),\n userInfo: z.object({\n userId: z.string().uuid(),\n email: z.string(),\n }),\n});\n\nexport type ApiKeyAuth = z.TypeOf<typeof apiKeyAuthSchema>;\n","import { unlink, rm } from 'node:fs/promises';\nimport { resolve } from 'node:path';\nimport { getDataDirPath } from '@wix/cli-data-dir';\nimport type { VariantOf } from 'variant';\nimport { match, fields, variant, payload, isType } from 'variant';\nimport { pathExists, readJson, writeJson } from '@wix/cli-fs';\nimport { CliError, CliErrorCode } from '@wix/cli-error';\nimport type { ApiKeyAuth, AccountAuth, SiteAuth, UserInfo } from './schemas.js';\nimport {\n apiKeyAuthSchema,\n accountAuthSchema,\n siteAuthSchema,\n} from './schemas.js';\n\nfunction getLegacyAuthDataFilePath() {\n return resolve(getDataDirPath(), 'auth.json');\n}\n\nfunction getAuthDataFolder() {\n return resolve(getDataDirPath(), 'auth');\n}\n\nfunction getApiKeyAuthDataFilePath() {\n return resolve(getAuthDataFolder(), 'api-key.json');\n}\n\nfunction getAccountAuthDataFilePath() {\n return resolve(getAuthDataFolder(), 'account.json');\n}\n\nfunction getSiteAuthDataFilePath(siteId: string) {\n return resolve(getAuthDataFolder(), `${siteId}.json`);\n}\n\nexport const ApiKeyAuthData = variant({\n Authenticated: payload<ApiKeyAuth>(),\n Unauthenticated: {},\n});\nexport type ApiKeyAuthData = VariantOf<typeof ApiKeyAuthData>;\n\nexport async function readApiKeyAuthData(): Promise<ApiKeyAuthData> {\n const apiKeyAuthDataFilePath = getApiKeyAuthDataFilePath();\n\n if (!(await pathExists(apiKeyAuthDataFilePath))) {\n return ApiKeyAuthData.Unauthenticated();\n }\n\n const apiKeyFileContents = await readJson(apiKeyAuthDataFilePath);\n const savedApiKeyAuthData = apiKeyAuthSchema.parse(apiKeyFileContents);\n\n return ApiKeyAuthData.Authenticated(savedApiKeyAuthData);\n}\n\nexport async function saveApiKeyAuthData(authData: ApiKeyAuth) {\n try {\n const targetFilePath = getApiKeyAuthDataFilePath();\n\n await writeJson(targetFilePath, authData);\n } catch (error) {\n throw new CliError({\n code: CliErrorCode.FailedToSaveApiKeyAuthData({\n cause: error,\n }),\n cause: error,\n });\n }\n}\n\nexport const AccountAuthData = variant({\n Authenticated: fields<AccountAuth>(),\n Unauthenticated: {},\n Expired: fields<AccountAuth>(),\n});\nexport type AccountAuthData = VariantOf<typeof AccountAuthData>;\n\nexport async function readAccountAuthData(): Promise<AccountAuthData> {\n const accountAuthDataFilePath = getAccountAuthDataFilePath();\n\n if (!(await pathExists(accountAuthDataFilePath))) {\n return AccountAuthData.Unauthenticated();\n }\n\n const authFileContents = await readJson(accountAuthDataFilePath);\n const savedAccountAuthData = accountAuthSchema.parse(authFileContents);\n\n if (!isValidToken(savedAccountAuthData)) {\n return AccountAuthData.Expired(savedAccountAuthData);\n }\n\n return AccountAuthData.Authenticated(savedAccountAuthData);\n}\n\nexport const SiteAuthData = variant({\n Authenticated: fields<SiteAuth>(),\n Unauthenticated: {},\n Expired: fields<SiteAuth>(),\n});\nexport type SiteAuthData = VariantOf<typeof SiteAuthData>;\n\nexport async function readSiteAuthData(siteId: string): Promise<SiteAuthData> {\n const siteAuthDataFilePath = getSiteAuthDataFilePath(siteId);\n\n if (!(await pathExists(siteAuthDataFilePath))) {\n return SiteAuthData.Unauthenticated();\n }\n\n const authFileContents = await readJson(siteAuthDataFilePath);\n const savedSiteAuthData = siteAuthSchema.parse(authFileContents);\n\n if (!isValidToken(savedSiteAuthData)) {\n return SiteAuthData.Expired(savedSiteAuthData);\n }\n\n return SiteAuthData.Authenticated(savedSiteAuthData);\n}\n\nexport async function saveAuthData(\n authData: AccountAuth | SiteAuth,\n siteId?: string\n) {\n try {\n const targetFilePath = siteId\n ? getSiteAuthDataFilePath(siteId)\n : getAccountAuthDataFilePath();\n\n await writeJson(targetFilePath, authData);\n } catch (error) {\n throw new CliError({\n code: CliErrorCode.FailedToSaveAuthData({\n cause: error,\n }),\n cause: error,\n });\n }\n}\n\nexport async function deleteAuthData() {\n try {\n await rm(getAuthDataFolder(), { recursive: true, force: true });\n } catch (error) {\n throw new CliError({\n code: CliErrorCode.FailedToDeleteAuthData({\n cause: error,\n }),\n cause: error,\n });\n }\n\n if (await hasLegacyAuthData()) {\n await deleteLegacyAuthData();\n }\n}\n\nexport async function deleteLegacyAuthData() {\n try {\n await unlink(getLegacyAuthDataFilePath());\n } catch (error) {\n throw new CliError({\n code: CliErrorCode.FailedToDeleteLegacyAuthData({\n cause: error,\n }),\n cause: error,\n });\n }\n}\n\nexport async function hasLegacyAuthData() {\n return pathExists(getLegacyAuthDataFilePath());\n}\n\nexport function isValidToken(authData: {\n expiresIn: number;\n issuedAt: number;\n}): boolean {\n const currentTimestamp = Math.floor(Date.now() / 1000);\n const tokenOffset = 10 * 60; // 10 minutes\n const tokenLifetime = authData.expiresIn - tokenOffset;\n const tokenGenerationTimestamp = authData.issuedAt;\n\n return tokenGenerationTimestamp + tokenLifetime > currentTimestamp;\n}\n\nexport async function getUserInfo(): Promise<UserInfo | null> {\n const apiKeyAuthData = await readApiKeyAuthData();\n\n if (isType(apiKeyAuthData, ApiKeyAuthData.Authenticated)) {\n return apiKeyAuthData.payload.userInfo;\n }\n\n const accountAuthData = await readAccountAuthData();\n return match(accountAuthData, {\n Authenticated: ({ userInfo }) => userInfo,\n Expired: ({ userInfo }) => userInfo,\n Unauthenticated: () => null,\n });\n}\n","import pLimit from 'p-limit';\nimport { match, constant, isType } from 'variant';\nimport pWaitFor, { TimeoutError } from 'p-wait-for';\nimport { CliError, CliErrorCode } from '@wix/cli-error';\nimport { getTestOverrides } from '@wix/cli-test-overrides';\nimport type { AccountAuth, DeviceCodeResponse } from '../schemas.js';\nimport {\n client,\n RenewTokenData,\n DeviceCodeNotYetVerifiedError,\n} from '../client.js';\nimport {\n isValidToken,\n deleteAuthData,\n readAccountAuthData,\n saveAuthData,\n} from '../auth-data.js';\nimport type { AuthStrategyState, AuthStrategy } from './auth-strategy-types.js';\nimport { apiKeyAuthStrategy } from './api-key-auth-strategy.js';\n\nconst seconds = (n: number) => 1000 * n;\n\nasync function waitForLogin(\n { deviceCode, expiresIn }: DeviceCodeResponse,\n { signal }: { signal: AbortSignal }\n) {\n try {\n const authData = await pWaitFor(\n async () => {\n try {\n const tokenData = await client.createToken({\n deviceCode,\n });\n\n return pWaitFor.resolveWith(tokenData);\n } catch (error) {\n if (error instanceof DeviceCodeNotYetVerifiedError) {\n // continue polling\n return false;\n }\n\n throw error;\n }\n },\n {\n interval: getTestOverrides().waitForLoginInterval ?? seconds(3),\n timeout: { milliseconds: seconds(expiresIn), signal },\n }\n );\n\n const userInfo = await client.userInfo({\n accessToken: authData.accessToken,\n });\n\n const result = { ...authData, userInfo };\n\n await deleteAuthData();\n await saveAuthData(result);\n\n return result;\n } catch (error) {\n if (error instanceof TimeoutError) {\n throw new CliError({ code: CliErrorCode.DeviceCodeTimedOut() });\n }\n\n throw error;\n }\n}\n\nasync function renewAccountAuth({ refreshToken, userInfo }: AccountAuth) {\n const renewTokenResult = await client.renewToken({ refreshToken });\n\n if (isType(renewTokenResult, RenewTokenData.TokenRenewed)) {\n await saveAuthData({ ...renewTokenResult.payload, userInfo });\n }\n\n return renewTokenResult;\n}\n\nasync function getNonExpiredAccountAuth(): Promise<AccountAuth | null> {\n const accountAuthStatus = await readAccountAuthData();\n\n return match(accountAuthStatus, {\n Authenticated: (accountAuth) => accountAuth,\n Unauthenticated: () => null,\n Expired: async (accountAuth) => {\n const renewTokenResult = await renewAccountAuth(accountAuth);\n\n return match(renewTokenResult, {\n TokenRenewed: ({ payload: newTokenData }) => ({\n ...newTokenData,\n userInfo: accountAuth.userInfo,\n }),\n RefreshTokenRevoked: constant(null),\n });\n },\n });\n}\n\nfunction createAccountAuthState({\n userInfo,\n ...initialTokenData\n}: AccountAuth): AuthStrategyState {\n const limiter = pLimit(1);\n let tokenData = { ...initialTokenData };\n\n return {\n getAccessToken: () => {\n return limiter(async () => {\n if (isValidToken(tokenData)) {\n return tokenData.accessToken;\n }\n\n const renewTokenResult = await renewAccountAuth({\n ...tokenData,\n userInfo,\n });\n\n return match(renewTokenResult, {\n TokenRenewed: ({ payload: newTokenData }) => {\n tokenData = newTokenData;\n return tokenData.accessToken;\n },\n RefreshTokenRevoked: ({ cause }) => {\n throw new CliError({\n code: CliErrorCode.FailedToRenewAuthTokenRefreshTokenRevoked(),\n cause,\n });\n },\n });\n });\n },\n getRefreshToken: () => tokenData.refreshToken,\n userInfo,\n };\n}\n\nexport const accountAuthStrategy: AuthStrategy = {\n async isLoggedIn() {\n const apiKeyAuth = await apiKeyAuthStrategy.isLoggedIn();\n\n if (apiKeyAuth) {\n return apiKeyAuth;\n }\n\n const accountAuth = await getNonExpiredAccountAuth();\n\n if (accountAuth) {\n return createAccountAuthState(accountAuth);\n }\n\n return null;\n },\n async login({ deviceCode, signal }) {\n const accountAuth = await waitForLogin(deviceCode, { signal });\n\n return createAccountAuthState(accountAuth);\n },\n};\n","import Queue from 'yocto-queue';\n\nexport default function pLimit(concurrency) {\n\tif (!((Number.isInteger(concurrency) || concurrency === Number.POSITIVE_INFINITY) && concurrency > 0)) {\n\t\tthrow new TypeError('Expected `concurrency` to be a number from 1 and up');\n\t}\n\n\tconst queue = new Queue();\n\tlet activeCount = 0;\n\n\tconst next = () => {\n\t\tactiveCount--;\n\n\t\tif (queue.size > 0) {\n\t\t\tqueue.dequeue()();\n\t\t}\n\t};\n\n\tconst run = async (fn, resolve, args) => {\n\t\tactiveCount++;\n\n\t\tconst result = (async () => fn(...args))();\n\n\t\tresolve(result);\n\n\t\ttry {\n\t\t\tawait result;\n\t\t} catch {}\n\n\t\tnext();\n\t};\n\n\tconst enqueue = (fn, resolve, args) => {\n\t\tqueue.enqueue(run.bind(undefined, fn, resolve, args));\n\n\t\t(async () => {\n\t\t\t// This function needs to wait until the next microtask before comparing\n\t\t\t// `activeCount` to `concurrency`, because `activeCount` is updated asynchronously\n\t\t\t// when the run function is dequeued and called. The comparison in the if-statement\n\t\t\t// needs to happen asynchronously as well to get an up-to-date value for `activeCount`.\n\t\t\tawait Promise.resolve();\n\n\t\t\tif (activeCount < concurrency && queue.size > 0) {\n\t\t\t\tqueue.dequeue()();\n\t\t\t}\n\t\t})();\n\t};\n\n\tconst generator = (fn, ...args) => new Promise(resolve => {\n\t\tenqueue(fn, resolve, args);\n\t});\n\n\tObject.defineProperties(generator, {\n\t\tactiveCount: {\n\t\t\tget: () => activeCount,\n\t\t},\n\t\tpendingCount: {\n\t\t\tget: () => queue.size,\n\t\t},\n\t\tclearQueue: {\n\t\t\tvalue: () => {\n\t\t\t\tqueue.clear();\n\t\t\t},\n\t\t},\n\t});\n\n\treturn generator;\n}\n","/*\nHow it works:\n`this.#head` is an instance of `Node` which keeps track of its current value and nests another instance of `Node` that keeps the value that comes after it. When a value is provided to `.enqueue()`, the code needs to iterate through `this.#head`, going deeper and deeper to find the last value. However, iterating through every single item is slow. This problem is solved by saving a reference to the last value as `this.#tail` so that it can reference it to add a new value.\n*/\n\nclass Node {\n\tvalue;\n\tnext;\n\n\tconstructor(value) {\n\t\tthis.value = value;\n\t}\n}\n\nexport default class Queue {\n\t#head;\n\t#tail;\n\t#size;\n\n\tconstructor() {\n\t\tthis.clear();\n\t}\n\n\tenqueue(value) {\n\t\tconst node = new Node(value);\n\n\t\tif (this.#head) {\n\t\t\tthis.#tail.next = node;\n\t\t\tthis.#tail = node;\n\t\t} else {\n\t\t\tthis.#head = node;\n\t\t\tthis.#tail = node;\n\t\t}\n\n\t\tthis.#size++;\n\t}\n\n\tdequeue() {\n\t\tconst current = this.#head;\n\t\tif (!current) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.#head = this.#head.next;\n\t\tthis.#size--;\n\t\treturn current.value;\n\t}\n\n\tclear() {\n\t\tthis.#head = undefined;\n\t\tthis.#tail = undefined;\n\t\tthis.#size = 0;\n\t}\n\n\tget size() {\n\t\treturn this.#size;\n\t}\n\n\t* [Symbol.iterator]() {\n\t\tlet current = this.#head;\n\n\t\twhile (current) {\n\t\t\tyield current.value;\n\t\t\tcurrent = current.next;\n\t\t}\n\t}\n}\n","import React, { type ReactNode, type FC } from 'react';\nimport { match } from 'variant';\nimport { useAsync, Spinner } from '@wix/cli-ui-kit';\nimport { I18nProvider } from '@wix/cli-i18n';\nimport type {\n AuthStrategy,\n AuthStrategyState,\n} from '../auth-strategies/index.js';\nimport { Login } from './Login.js';\nimport { WarnLegacyAuthData } from './WarnLegacyAuthData.js';\nimport messages from '../messages.json';\n\ninterface Props {\n authStrategy: AuthStrategy;\n onLogin: (data: AuthStrategyState) => void;\n onError: (error: unknown) => void;\n children: (data: AuthStrategyState) => ReactNode;\n}\n\nexport const EnsureLoggedIn: FC<Props> = ({\n authStrategy: { login, isLoggedIn },\n onLogin,\n onError,\n children,\n}) => {\n const { status, merge: updateAccountAuth } = useAsync(isLoggedIn, [], {\n onSuccess: (result) => {\n if (result) {\n onLogin(result);\n }\n },\n onError,\n });\n\n return match(status, {\n Loading: () => <Spinner />,\n Error: () => null,\n Success: ({ result: accountAuth }) => {\n if (accountAuth === null) {\n return (\n <I18nProvider messages={messages}>\n <WarnLegacyAuthData>\n <Login\n loginFn={login}\n onLogin={(data) => {\n updateAccountAuth({ result: data });\n onLogin(data);\n }}\n onError={onError}\n />\n </WarnLegacyAuthData>\n </I18nProvider>\n );\n }\n\n return children(accountAuth);\n },\n });\n};\n","import React, { type FC } from 'react';\nimport { Spinner, useAsync, useAsyncCallback } from '@wix/cli-ui-kit';\nimport { I18nProvider } from '@wix/cli-i18n';\nimport { useBiLogger } from '@wix/cli-telemetry-react';\nimport { wixCliLoginStart, wixCliLoginEnd } from '@wix/bi-logger-wix-cli/v2';\nimport { match } from 'variant';\nimport type { DeviceCodeResponse } from '../schemas.js';\nimport messages from '../messages.json';\nimport {\n type AuthStrategy,\n type AuthStrategyState,\n accountAuthStrategy,\n} from '../auth-strategies/index.js';\nimport { LoginInstructions } from './LoginInstructions.js';\nimport { client } from '../client.js';\n\ninterface Props {\n loginFn: AuthStrategy['login'];\n onLogin: (data: AuthStrategyState) => void;\n onError: (error: unknown) => void;\n}\n\nexport const Login: FC<Props> = ({ loginFn, onLogin, onError }) => {\n const biLogger = useBiLogger();\n\n function handleError(error: unknown) {\n biLogger.report(\n wixCliLoginEnd({\n isSuccess: false,\n ...(error instanceof Error\n ? {\n errorType: error.name,\n }\n : {\n errorType: 'unknown',\n errorMessage: JSON.stringify(error),\n }),\n })\n );\n\n onError(error);\n }\n\n const loginAction = useAsyncCallback(\n async ({ signal }, deviceCodeResponse: DeviceCodeResponse) => {\n try {\n const authData = await loginFn({\n deviceCode: deviceCodeResponse,\n signal,\n });\n biLogger.report(\n wixCliLoginEnd({\n isSuccess: true,\n })\n );\n onLogin(authData);\n } catch (error) {\n handleError(error);\n }\n }\n );\n\n const { status } = useAsync(\n async () => {\n biLogger.report(wixCliLoginStart({}));\n\n return client.requestDeviceCode();\n },\n [],\n {\n onSuccess: (deviceCodeResponse) => {\n loginAction.execute(deviceCodeResponse);\n },\n onError: handleError,\n }\n );\n\n return match(status, {\n Error: () => null,\n Loading: () => <Spinner />,\n Success: ({ result: { userCode, verificationUri } }) => (\n <LoginInstructions\n userCode={userCode}\n verificationUri={verificationUri}\n />\n ),\n });\n};\n\nexport function LoginWithI18n(props: Omit<Props, 'loginFn'>) {\n return (\n <I18nProvider messages={messages}>\n <Login loginFn={accountAuthStrategy.login} {...props} />\n </I18nProvider>\n );\n}\n","import { LogObject, wixCliAppFlowAppGenerationAppGenerationEndParams, wixCliAppFlowAppGenerationExistingAppSelectedParams, wixCliAppFlowAppGenerationNewAppNameEnteredParams, wixCliAppFlowAppGenerationNewAppRegistrationEndParams, wixCliAppFlowAppGenerationTypeOfCreationSelectedParams, wixCliAppFlowComponentInstalledInTheAppParams, wixCliAppFlowDevelopmentSiteAppInstallationOnDevelopmentSiteEndParams, wixCliAppFlowDevelopmentSiteAppInstallationOnDevelopmentSiteStartParams, wixCliAppFlowDevelopmentSiteDevelopmentSiteSetParams, wixCliAppFlowDevelopmentSiteExistingSiteSelectedParams, wixCliAppFlowDevelopmentSiteNewDevelopmentSiteCreationEndParams, wixCliAppFlowDevelopmentSiteNewDevelopmentSiteCreationStartParams, wixCliAppFlowDevelopmentSiteSiteSelectorAbortedParams, wixCliAppFlowDevelopmentSiteSiteSelectorOpenedParams, wixCliAppFlowDevelopmentSiteTypeOfDevelopmentSiteSelectedParams, wixCliAppFlowExtensionGenerationExtensionWasAddedParams, wixCliAppFlowFileUploadStartedParams, wixCliAppFlowStepsAnswersParams, wixCliAppFlowZipUploadDoneParams, wixCliAppFlowZipUploadEndedParams, wixCliCliCommandParams, wixCliCliCommandStatusParams, wixCliCliErrorParams, wixCliCliMessageDisplayedParams, wixCliCodeHasBeenChangedParams, wixCliFileFolderCreatedRenamedDeletedParams, wixCliLoginEndParams, wixCliLoginStartParams, wixCliReadyForReloadAfterCodeChangeParams, wixCliUserResponseToCliMessageParams } from '../types';\n\n/**\n * A function to create a log object for the 'wixCliCliCommand' event (evid: 5200)\n *\n * Event description: Sent when a user enters a command (valid/invalid) in the Wix CLI\n *\n * @param {wixCliCliCommandParams} params - The parameters for this event\n * @property {DateTime} localTime - The local time during which the command was entered\n * @property {string} extraFileds - A Json of extra filed - for example - for dev & preview with embedded scripts - is_mocking_values\n * @property {boolean} isCI - Should be true if was fired from a CI environment\n * @property {boolean} isValid - Is the entered command a valid CLI command\n * @property {string} nodeVersion - The Node (full) version\n * @property {string} flags - (Optional) Flags that were added to the command (e.g. \"-h\")\n * @property {string} cliVersion - The CLI version\n * @property {string} projectId - The project that the users is currently working on\n * @property {string} command - The command that was entered by the user (e.g. \"wix dev\", \"preview-deployment\"). Note: This can be an invalid command.\n * @property {string} shellVersion - Which version of the shell is being used\n * @property {string} shellName - Which shell is being used\n * @property {string} flow - \"Sites\"/\"Apps\"\n * @property {string} terminalVersion - Which version of the terminal is being used\n * @property {number} siteRevision - (Optional) Site revision, if available\n * @property {string} osName - Which OS is being used\n * @property {string} terminalName - Which terminal is being used\n * @property {string} osVersion - Which version of the OS is being used\n * @property {GUID} cliSessionId - A unique ID for each Wix dev session\n * @property {string} arguments - The arguments/params that are added to the command (comma separated list)\n * @return {LogObject<wixCliCliCommandParams>} LogObject<wixCliCliCommandParams>\n */\nexport function wixCliCliCommand(params: wixCliCliCommandParams): LogObject<wixCliCliCommandParams> {\n return { evid: 5200, src: 11, endpoint: 'wix-cli', params };\n}\n\n/**\n * A function to create a log object for the 'wixCliCliCommandStatus' event (evid: 5201)\n *\n * Event description: Sent after a user enters a command in the Wix CLI\n *\n * @param {wixCliCliCommandStatusParams} params - The parameters for this event\n * @property {DateTime} localTime - The local time during which the command was entered\n * @property {string} extraFileds - A Json with extra data - for example - for build command - build statistics\n * @property {boolean} isCI - Should be true if was fired from a CI environment\n * @property {number} duration - The time it took for the command to run (in ms)\n * @property {boolean} isValid - Is the entered command a valid CLI command\n * @property {string} errorMessage - (Optional) The error message displayed, if the command was invalid\n * @property {string} nodeVersion - The Node (full) version\n * @property {string} flags - (Optional) Flags that were added to the command (e.g. \"-h\")\n * @property {string} cliVersion - The CLI version\n * @property {string} projectId - The project that the users is currently working on\n * @property {string} command - The command that was entered by the user (e.g. \"wix dev\", \"preview-deployment\"). Note: This can be an invalid command.\n * @property {boolean} isSuccess - Was the command successful\n * @property {string} extensions - Jsom of extensions type & number of each extensions: {side_bar_category:3,dashboard_page:4...}\n * @property {string} errorType - (Optional) The error type, if the command was invalid - User/ System error\n * @property {string} shellVersion - Which version of the shell is being used\n * @property {string} shellName - Which shell is being used\n * @property {string} flow - \"Sites\"/\"Apps\"\n * @property {string} terminalVersion - Which version of the terminal is being used\n * @property {number} siteRevision - (Optional) Site revision, if available\n * @property {string} failedStep - (Optional) If the generation was unsuccessful, which step failed\n * @property {string} osName - Which OS is being used\n * @property {string} errorName - The error name - a generic name for a group off errors. (Optional) if the command was invalid\n * @property {string} suggestion - (Optional) Which suggestion was shown to the user, if any\n * @property {string} terminalName - Which terminal is being used\n * @property {string} osVersion - Which version of the OS is being used\n * @property {string} previewUrl - The preview url that the user gets from us, can be null (will be sent only for preview command)\n * @property {GUID} cliSessionId - A unique ID for each Wix dev session\n * @property {string} arguments - The arguments/params that are added to the command (comma separated list)\n * @return {LogObject<wixCliCliCommandStatusParams>} LogObject<wixCliCliCommandStatusParams>\n */\nexport function wixCliCliCommandStatus(params: wixCliCliCommandStatusParams): LogObject<wixCliCliCommandStatusParams> {\n return { evid: 5201, src: 11, endpoint: 'wix-cli', params };\n}\n\n/**\n * A function to create a log object for the 'wixCliFileFolderCreatedRenamedDeleted' event (evid: 5202)\n *\n * Event description: Sent when a user creates, renames or deletes a file/folder in the local flow using Wix CLI\n *\n * @param {wixCliFileFolderCreatedRenamedDeletedParams} params - The parameters for this event\n * @property {DateTime} localTime - The local time during which the command was entered\n * @property {boolean} isCI - Should be true if was fired from a CI environment\n * @property {string} path - Full path of the file/folder after its creation/rename (e.g. \"backend/media-control.jsw\"), or name of the file that has been deleted\n * @property {string} nodeVersion - The Node (full) version\n * @property {string} cliVersion - The CLI version\n * @property {string} oldPath - (Optional) Previous full path of the file/folder, in case action = \"Rename\"\n * @property {string} sectionName - Section name (\"public\"/\"backend\"/\"other\")\n * @property {string} shellVersion - Which version of the shell is being used\n * @property {string} shellName - Which shell is being used\n * @property {string} flow - \"Sites\"/\"Apps\"\n * @property {string} terminalVersion - Which version of the terminal is being used\n * @property {number} siteRevision - (Optional) Site revision\n * @property {string} osName - Which OS is being used\n * @property {string} terminalName - Which terminal is being used\n * @property {string} type - Type of the created object: \"folder\"/file extension\n * @property {string} osVersion - Which version of the OS is being used\n * @property {GUID} cliSessionId - A unique ID for each Wix dev session\n * @property {string} action - \"Create\" / \"Rename\" / \"Delete\"\n * @return {LogObject<wixCliFileFolderCreatedRenamedDeletedParams>} LogObject<wixCliFileFolderCreatedRenamedDeletedParams>\n */\nexport function wixCliFileFolderCreatedRenamedDeleted(params: wixCliFileFolderCreatedRenamedDeletedParams): LogObject<wixCliFileFolderCreatedRenamedDeletedParams> {\n return { evid: 5202, src: 11, endpoint: 'wix-cli', params };\n}\n\n/**\n * A function to create a log object for the 'wixCliCodeHasBeenChanged' event (evid: 5203)\n *\n * Event description: Sent when the user changes their code while Wix CLI is running (per local save)\n *\n * @param {wixCliCodeHasBeenChangedParams} params - The parameters for this event\n * @property {DateTime} localTime - The local time during which the command was entered\n * @property {boolean} isCI - Should be true if was fired from a CI environment\n * @property {string} nodeVersion - Which Node (full) version is being used\n * @property {string} cliVersion - The CLI version\n * @property {string} fileName - Full path of file (e.g. \"public/pages/lkrir.js\")\n * @property {string} shellVersion - Which version of the shell is being used\n * @property {string} shellName - Which shell is being used\n * @property {string} flow - \"Sites\"/\"Apps\"\n * @property {string} terminalVersion - Which version of the terminal is being used\n * @property {number} siteRevision - Site revision\n * @property {string} osName - Which OS is being used\n * @property {string} terminalName - Which terminal is being used\n * @property {string} osVersion - Which version of the OS is being used\n * @property {GUID} cliSessionID - A unique ID for each Wix dev session\n * @return {LogObject<wixCliCodeHasBeenChangedParams>} LogObject<wixCliCodeHasBeenChangedParams>\n */\nexport function wixCliCodeHasBeenChanged(params: wixCliCodeHasBeenChangedParams): LogObject<wixCliCodeHasBeenChangedParams> {\n return { evid: 5203, src: 11, endpoint: 'wix-cli', params };\n}\n\n/**\n * A function to create a log object for the 'wixCliCliMessageDisplayed' event (evid: 5204)\n *\n * Event description: Sent when the Wix CLI presents a message to the user (e.g. after the editor disconnects)\n *\n * @param {wixCliCliMessageDisplayedParams} params - The parameters for this event\n * @property {DateTime} localTime - The local time during which the command was entered\n * @property {boolean} isCI - Should be true if was fired from a CI environment\n * @property {string} nodeVersion - Which Node (full) version is being used\n * @property {string} cliVersion - The CLI version\n * @property {string} shellVersion - Which version of the shell is being used\n * @property {string} shellName - Which shell is being used\n * @property {string} flow - \"Sites\"/\"Apps\"\n * @property {string} terminalVersion - Which version of the terminal is being used\n * @property {number} siteRevision - (Optional) Site revision, if available\n * @property {GUID} messageId - A unique ID for each message displayed\n * @property {string} osName - Which OS is being used\n * @property {string} message - The message that the CLI displays to the user\n * @property {string} terminalName - Which terminal is being used\n * @property {string} osVersion - Which version of the OS is being used\n * @property {GUID} cliSessionId - A unique ID for each Wix dev session\n * @return {LogObject<wixCliCliMessageDisplayedParams>} LogObject<wixCliCliMessageDisplayedParams>\n */\nexport function wixCliCliMessageDisplayed(params: wixCliCliMessageDisplayedParams): LogObject<wixCliCliMessageDisplayedParams> {\n return { evid: 5204, src: 11, endpoint: 'wix-cli', params };\n}\n\n/**\n * A function to create a log object for the 'wixCliUserResponseToCliMessage' event (evid: 5205)\n *\n * Event description: Sent when the user responds to a message presented by the CLI\n *\n * @param {wixCliUserResponseToCliMessageParams} params - The parameters for this event\n * @property {DateTime} localTime - The local time during which the command was entered\n * @property {boolean} isCI - Should be true if was fired from a CI environment\n * @property {string} nodeVersion - The Node (full) version\n * @property {string} cliVersion - The CLI version\n * @property {string} shellVersion - The shell version\n * @property {string} shellName - The shell that is being used\n * @property {string} flow - \"Sites\"/\"Apps\"\n * @property {string} terminalVersion - The terminal version\n * @property {number} siteRevision - (Optional) Site revision, if available\n * @property {GUID} messageId - A unique ID for each message displayed\n * @property {string} osName - The OS that is being used\n * @property {string} message - The message that the CLI displays to the user\n * @property {string} terminalName - The terminal that is being used\n * @property {string} osVersion - The version of the OS that is being used\n * @property {GUID} cliSessionId - A unique ID for each Wix dev session\n * @property {string} action - The action performed by the user\n * @return {LogObject<wixCliUserResponseToCliMessageParams>} LogObject<wixCliUserResponseToCliMessageParams>\n */\nexport function wixCliUserResponseToCliMessage(params: wixCliUserResponseToCliMessageParams): LogObject<wixCliUserResponseToCliMessageParams> {\n return { evid: 5205, src: 11, endpoint: 'wix-cli', params };\n}\n\n/**\n * A function to create a log object for the 'wixCliReadyForReloadAfterCodeChange' event (evid: 5206)\n *\n * Event description: Sent when Wix CLI is ready to reload the page after it has detected the user has changed code in the project\n *\n * @param {wixCliReadyForReloadAfterCodeChangeParams} params - The parameters for this event\n * @property {DateTime} localTime - The local time during which the command was entered\n * @property {boolean} isCI - Should be true if was fired from a CI environment\n * @property {number} duration - Time it took for Wix CLI to be ready to load the page after the code change (in ms)\n * @property {string} nodeVersion - The Node (full) version\n * @property {string} cliVersion - The CLI version\n * @property {string} fileName - Full path of file (e.g. \"public/pages/lkrir.js\")\n * @property {string} shellVersion - The shell version\n * @property {string} shellName - Which shell is being used\n * @property {string} flow - \"Sites\"/\"Apps\"\n * @property {string} terminalVersion - The terminal version\n * @property {number} siteRevision - Site revision\n * @property {string} osName - Which OS is being used\n * @property {string} terminalName - Which terminal is being used\n * @property {string} osVersion - The OS version\n * @property {GUID} cliSessionID - A unique ID for each Wix dev session\n * @return {LogObject<wixCliReadyForReloadAfterCodeChangeParams>} LogObject<wixCliReadyForReloadAfterCodeChangeParams>\n */\nexport function wixCliReadyForReloadAfterCodeChange(params: wixCliReadyForReloadAfterCodeChangeParams): LogObject<wixCliReadyForReloadAfterCodeChangeParams> {\n return { evid: 5206, src: 11, endpoint: 'wix-cli', params };\n}\n\n/**\n * A function to create a log object for the 'wixCliAppFlowFileUploadStarted' event (evid: 5208)\n *\n * Event description: Sent when the hosting service starts uploading files required by an app\n *\n * @param {wixCliAppFlowFileUploadStartedParams} params - The parameters for this event\n * @property {number} numFiles - How many files are uploaded\n * @property {string} projectId - The project that the users is currently working on\n * @property {number} fileSizeNotCompressed - The total size of the uploaded files\n * @property {string} hostingProvider - The hosting provider (\"Wix\"/...)\n * @property {number} timestampMs - The event's start time\n * @property {GUID} cliSessionId - A unique ID for each Wix dev session\n * @property {number} fileSizeCompressed - The total size of the uploaded files, compressed\n * @return {LogObject<wixCliAppFlowFileUploadStartedParams>} LogObject<wixCliAppFlowFileUploadStartedParams>\n */\nexport function wixCliAppFlowFileUploadStarted(params: wixCliAppFlowFileUploadStartedParams): LogObject<wixCliAppFlowFileUploadStartedParams> {\n return { evid: 5208, src: 11, endpoint: 'wix-cli', params };\n}\n\n/**\n * A function to create a log object for the 'wixCliAppFlowZipUploadDone' event (evid: 5209)\n *\n * Event description: Sent when the hosting service is done uploading the zip\n *\n * @param {wixCliAppFlowZipUploadDoneParams} params - The parameters for this event\n * @property {number} duration - How much time it took to to upload the zip (in ms)\n * @property {string} projectId - The project that the users is currently working on\n * @property {GUID} cliSessionId - A unique ID for each Wix dev session\n * @return {LogObject<wixCliAppFlowZipUploadDoneParams>} LogObject<wixCliAppFlowZipUploadDoneParams>\n */\nexport function wixCliAppFlowZipUploadDone(params: wixCliAppFlowZipUploadDoneParams): LogObject<wixCliAppFlowZipUploadDoneParams> {\n return { evid: 5209, src: 11, endpoint: 'wix-cli', params };\n}\n\n/**\n * A function to create a log object for the 'wixCliAppFlowZipUploadEnded' event (evid: 5210)\n *\n * Event description: Sent when the hosting service is done with the entire upload of the files\n *\n * @param {wixCliAppFlowZipUploadEndedParams} params - The parameters for this event\n * @property {number} duration - How much time it took for the entire upload (in ms)\n * @property {string} projectId - The project that the users is currently working on\n * @property {GUID} cliSessionId - A unique ID for each Wix dev session\n * @return {LogObject<wixCliAppFlowZipUploadEndedParams>} LogObject<wixCliAppFlowZipUploadEndedParams>\n */\nexport function wixCliAppFlowZipUploadEnded(params: wixCliAppFlowZipUploadEndedParams): LogObject<wixCliAppFlowZipUploadEndedParams> {\n return { evid: 5210, src: 11, endpoint: 'wix-cli', params };\n}\n\n/**\n * A function to create a log object for the 'wixCliLoginStart' event (evid: 5211)\n *\n * Event description: Sent when the Wix CLI authentication flow starts\n *\n * @param {wixCliLoginStartParams} params - The parameters for this event\n * @property {DateTime} localTime - The local time during which the command was entered\n * @property {boolean} wasLoggedIn - Was the user logged in before; i.e. did the user log out before starting the login process\n * @property {number} try - Which login is this - if 0, first try; if > 0, then this is a retry\n * @property {GUID} cliSessionId - A unique ID for each Wix dev session\n * @return {LogObject<wixCliLoginStartParams>} LogObject<wixCliLoginStartParams>\n */\nexport function wixCliLoginStart(params: wixCliLoginStartParams): LogObject<wixCliLoginStartParams> {\n return { evid: 5211, src: 11, endpoint: 'wix-cli', params };\n}\n\n/**\n * A function to create a log object for the 'wixCliLoginEnd' event (evid: 5212)\n *\n * Event description: Sent when the Wix CLI authentication flow ends\n *\n * @param {wixCliLoginEndParams} params - The parameters for this event\n * @property {DateTime} localTime - The local time during which the command was entered\n * @property {number} try - Which login is this - if 0, first try; if > 0, then this is a retry\n * @property {string} errorMessage - (Optional) The error message displayed, if the login was unsuccessul\n * @property {boolean} isSuccess - Was the login successful\n * @property {string} errorType - (Optional) The error type, if the login was unsuccessful\n * @property {GUID} cliSessionId - A unique ID for each Wix dev session\n * @return {LogObject<wixCliLoginEndParams>} LogObject<wixCliLoginEndParams>\n */\nexport function wixCliLoginEnd(params: wixCliLoginEndParams): LogObject<wixCliLoginEndParams> {\n return { evid: 5212, src: 11, endpoint: 'wix-cli', params };\n}\n\n/**\n * A function to create a log object for the 'wixCliAppFlowAppGenerationTypeOfCreationSelected' event (evid: 5213)\n *\n * Event description: Sent when the user selects whether they would like to create a new Wix app or extend an existing one\n *\n * @param {wixCliAppFlowAppGenerationTypeOfCreationSelectedParams} params - The parameters for this event\n * @property {DateTime} localTime - The local time during which the command was entered\n * @property {string} projectId - The project that the users is currently working on\n * @property {string} type - What would the user like to create: a new Wix app, or add new extensions to an existing app\n * @property {GUID} cliSessionId - A unique ID for each Wix dev session\n * @return {LogObject<wixCliAppFlowAppGenerationTypeOfCreationSelectedParams>} LogObject<wixCliAppFlowAppGenerationTypeOfCreationSelectedParams>\n */\nexport function wixCliAppFlowAppGenerationTypeOfCreationSelected(params: wixCliAppFlowAppGenerationTypeOfCreationSelectedParams): LogObject<wixCliAppFlowAppGenerationTypeOfCreationSelectedParams> {\n return { evid: 5213, src: 11, endpoint: 'wix-cli', params };\n}\n\n/**\n * A function to create a log object for the 'wixCliAppFlowAppGenerationNewAppNameEntered' event (evid: 5214)\n *\n * Event description: Sent when the user enters the name of the new app they want to create\n *\n * @param {wixCliAppFlowAppGenerationNewAppNameEnteredParams} params - The parameters for this event\n * @property {DateTime} localTime - The local time during which the command was entered\n * @property {string} name - Name of the new Wix App the user wants to create\n * @property {string} projectId - The project that the users is currently working on\n * @property {GUID} cliSessionId - A unique ID for each Wix dev session\n * @return {LogObject<wixCliAppFlowAppGenerationNewAppNameEnteredParams>} LogObject<wixCliAppFlowAppGenerationNewAppNameEnteredParams>\n */\nexport function wixCliAppFlowAppGenerationNewAppNameEntered(params: wixCliAppFlowAppGenerationNewAppNameEnteredParams): LogObject<wixCliAppFlowAppGenerationNewAppNameEnteredParams> {\n return { evid: 5214, src: 11, endpoint: 'wix-cli', params };\n}\n\n/**\n * A function to create a log object for the 'wixCliAppFlowAppGenerationNewAppRegistrationEnd' event (evid: 5215)\n *\n * Event description: Sent when the new app registration ends (successfully or not)\n *\n * @param {wixCliAppFlowAppGenerationNewAppRegistrationEndParams} params - The parameters for this event\n * @property {DateTime} localTime - The local time during which the command was entered\n * @property {string} errorMessage - (Optional) If the registration was unsuccessful, the error message displayed to the user\n * @property {string} result - Was the app registration in the Dev Center successful or not\n * @property {string} projectId - The project that the users is currently working on\n * @property {string} errorType - (Optional) If the registration was unsuccessful, the error type\n * @property {string} appId - ID of the newly created Wix App\n * @property {GUID} cliSessionId - A unique ID for each Wix dev session\n * @return {LogObject<wixCliAppFlowAppGenerationNewAppRegistrationEndParams>} LogObject<wixCliAppFlowAppGenerationNewAppRegistrationEndParams>\n */\nexport function wixCliAppFlowAppGenerationNewAppRegistrationEnd(params: wixCliAppFlowAppGenerationNewAppRegistrationEndParams): LogObject<wixCliAppFlowAppGenerationNewAppRegistrationEndParams> {\n return { evid: 5215, src: 11, endpoint: 'wix-cli', params };\n}\n\n/**\n * A function to create a log object for the 'wixCliAppFlowAppGenerationExistingAppSelected' event (evid: 5216)\n *\n * Event description: Sent when the user selects an existing app they want to extend\n *\n * @param {wixCliAppFlowAppGenerationExistingAppSelectedParams} params - The parameters for this event\n * @property {DateTime} localTime - The local time during which the command was entered\n * @property {string} appName - Name of the existing Wix App the user wants to extend\n * @property {string} projectId - The project that the users is currently working on\n * @property {number} numApps - How many apps does the user have\n * @property {string} appId - ID of the existing Wix App the user wants to extend\n * @property {GUID} cliSessionId - A unique ID for each Wix dev session\n * @return {LogObject<wixCliAppFlowAppGenerationExistingAppSelectedParams>} LogObject<wixCliAppFlowAppGenerationExistingAppSelectedParams>\n */\nexport function wixCliAppFlowAppGenerationExistingAppSelected(params: wixCliAppFlowAppGenerationExistingAppSelectedParams): LogObject<wixCliAppFlowAppGenerationExistingAppSelectedParams> {\n return { evid: 5216, src: 11, endpoint: 'wix-cli', params };\n}\n\n/**\n * A function to create a log object for the 'wixCliAppFlowAppGenerationAppGenerationEnd' event (evid: 5217)\n *\n * Event description: Sent when the new app generation end (successfully or not)\n *\n * @param {wixCliAppFlowAppGenerationAppGenerationEndParams} params - The parameters for this event\n * @property {DateTime} localTime - The local time during which the command was entered\n * @property {string} errorMessage - (Optional) If the generation was unsuccessful, the error message displayed to the user\n * @property {string} result - Was the app folder generation successful or not\n * @property {string} projectId - The project that the users is currently working on\n * @property {string} errorType - (Optional) If the generation was unsuccessful, the error type\n * @property {string} failedStep - (Optional) If the generation was unsuccessful, which step failed\n * @property {GUID} cliSessionId - A unique ID for each Wix dev session\n * @return {LogObject<wixCliAppFlowAppGenerationAppGenerationEndParams>} LogObject<wixCliAppFlowAppGenerationAppGenerationEndParams>\n */\nexport function wixCliAppFlowAppGenerationAppGenerationEnd(params: wixCliAppFlowAppGenerationAppGenerationEndParams): LogObject<wixCliAppFlowAppGenerationAppGenerationEndParams> {\n return { evid: 5217, src: 11, endpoint: 'wix-cli', params };\n}\n\n/**\n * A function to create a log object for the 'wixCliAppFlowComponentInstalledInTheApp' event (evid: 5218)\n *\n * Event description: Sent the components installed in the app when the app is published.\n *\n * @param {wixCliAppFlowComponentInstalledInTheAppParams} params - The parameters for this event\n * @property {DateTime} localTime - The local time during which the component was published\n * @property {string} cliVersion - The CLI version\n * @property {string} appCurrentVersion - The app version\n * @property {string} componentId - The Component Id\n * @property {string} projectId - The project that the users is currently working on\n * @property {string} widgetType - Relevant only for component type = widget. Pushed / Asked\n * @property {string} componentType - widget, page, sidebar category\n * @property {GUID} cliSessionId - A unique ID for each Wix dev session\n * @return {LogObject<wixCliAppFlowComponentInstalledInTheAppParams>} LogObject<wixCliAppFlowComponentInstalledInTheAppParams>\n */\nexport function wixCliAppFlowComponentInstalledInTheApp(params: wixCliAppFlowComponentInstalledInTheAppParams): LogObject<wixCliAppFlowComponentInstalledInTheAppParams> {\n return { evid: 5218, src: 11, endpoint: 'wix-cli', params };\n}\n\n/**\n * A function to create a log object for the 'wixCliAppFlowDevelopmentSiteSiteSelectorOpened' event (evid: 5219)\n *\n * Event description: Sent when the sites selector is open\n *\n * @param {wixCliAppFlowDevelopmentSiteSiteSelectorOpenedParams} params - The parameters for this event\n * @property {DateTime} localTime - The local time during which the component was published\n * @property {number} devSitesLimit - How many development sites CAN the user have\n * @property {string} projectId - The project that the users is currently working on\n * @property {GUID} siteSelectorSessionId - A unique ID for each Site Selector session\n * @property {string} origin - From where did the user get to the Development Site Selector\n * @property {number} devSitesCount - How many development sites does the user currently have\n * @property {GUID} cliSessionId - A unique ID for each Wix dev session\n * @return {LogObject<wixCliAppFlowDevelopmentSiteSiteSelectorOpenedParams>} LogObject<wixCliAppFlowDevelopmentSiteSiteSelectorOpenedParams>\n */\nexport function wixCliAppFlowDevelopmentSiteSiteSelectorOpened(params: wixCliAppFlowDevelopmentSiteSiteSelectorOpenedParams): LogObject<wixCliAppFlowDevelopmentSiteSiteSelectorOpenedParams> {\n return { evid: 5219, src: 11, endpoint: 'wix-cli', params };\n}\n\n/**\n * A function to create a log object for the 'wixCliAppFlowDevelopmentSiteTypeOfDevelopmentSiteSelected' event (evid: 5220)\n *\n * Event description: Sent when a site was selected at the sites selector\n *\n * @param {wixCliAppFlowDevelopmentSiteTypeOfDevelopmentSiteSelectedParams} params - The parameters for this event\n * @property {DateTime} localTime - The local time during which the component was published\n * @property {string} projectId - The project that the users is currently working on\n * @property {GUID} siteSelectorSessionId - A unique ID for each Site Selector session\n * @property {string} type - Would the user like to create a new development site or pick an existing one\n * @property {GUID} cliSessionId - A unique ID for each Wix dev session\n * @return {LogObject<wixCliAppFlowDevelopmentSiteTypeOfDevelopmentSiteSelectedParams>} LogObject<wixCliAppFlowDevelopmentSiteTypeOfDevelopmentSiteSelectedParams>\n */\nexport function wixCliAppFlowDevelopmentSiteTypeOfDevelopmentSiteSelected(params: wixCliAppFlowDevelopmentSiteTypeOfDevelopmentSiteSelectedParams): LogObject<wixCliAppFlowDevelopmentSiteTypeOfDevelopmentSiteSelectedParams> {\n return { evid: 5220, src: 11, endpoint: 'wix-cli', params };\n}\n\n/**\n * A function to create a log object for the 'wixCliAppFlowDevelopmentSiteNewDevelopmentSiteCreationStart' event (evid: 5221)\n *\n * Event description: Sent when a New Development Site Creation Starts\n *\n * @param {wixCliAppFlowDevelopmentSiteNewDevelopmentSiteCreationStartParams} params - The parameters for this event\n * @property {DateTime} localTime - The local time during which the component was published\n * @property {string} projectId - The project that the users is currently working on\n * @property {GUID} siteSelectorSessionId - A unique ID for each Site Selector session\n * @property {GUID} cliSessionId - A unique ID for each Wix dev session\n * @return {LogObject<wixCliAppFlowDevelopmentSiteNewDevelopmentSiteCreationStartParams>} LogObject<wixCliAppFlowDevelopmentSiteNewDevelopmentSiteCreationStartParams>\n */\nexport function wixCliAppFlowDevelopmentSiteNewDevelopmentSiteCreationStart(params: wixCliAppFlowDevelopmentSiteNewDevelopmentSiteCreationStartParams): LogObject<wixCliAppFlowDevelopmentSiteNewDevelopmentSiteCreationStartParams> {\n return { evid: 5221, src: 11, endpoint: 'wix-cli', params };\n}\n\n/**\n * A function to create a log object for the 'wixCliAppFlowDevelopmentSiteNewDevelopmentSiteCreationEnd' event (evid: 5222)\n *\n * Event description: Sent when a New Development Site Creation Ends\n *\n * @param {wixCliAppFlowDevelopmentSiteNewDevelopmentSiteCreationEndParams} params - The parameters for this event\n * @property {DateTime} localTime - The local time during which the component was published\n * @property {string} errorMessage - (Optional) If the site creation was unsuccessful, the error message displayed to the user\n * @property {string} result - Was the new site creation successful or not\n * @property {string} projectId - The project that the users is currently working on\n * @property {GUID} siteSelectorSessionId - A unique ID for each Site Selector session\n * @property {string} errorType - (Optional) If the site creation was unsuccessful, the error type\n * @property {string} siteName - (Optional) Name of the newly created development site\n * @property {GUID} cliSessionId - A unique ID for each Wix dev session\n * @property {GUID} msid - The site's ID\n * @property {string} siteUrl - (Optional) URL of the newly created development site\n * @return {LogObject<wixCliAppFlowDevelopmentSiteNewDevelopmentSiteCreationEndParams>} LogObject<wixCliAppFlowDevelopmentSiteNewDevelopmentSiteCreationEndParams>\n */\nexport function wixCliAppFlowDevelopmentSiteNewDevelopmentSiteCreationEnd(params: wixCliAppFlowDevelopmentSiteNewDevelopmentSiteCreationEndParams): LogObject<wixCliAppFlowDevelopmentSiteNewDevelopmentSiteCreationEndParams> {\n return { evid: 5222, src: 11, endpoint: 'wix-cli', params };\n}\n\n/**\n * A function to create a log object for the 'wixCliAppFlowDevelopmentSiteExistingSiteSelected' event (evid: 5223)\n *\n * Event description: Sent when an Existing site was selected\n *\n * @param {wixCliAppFlowDevelopmentSiteExistingSiteSelectedParams} params - The parameters for this event\n * @property {DateTime} localTime - The local time during which the component was published\n * @property {string} projectId - The project that the users is currently working on\n * @property {GUID} siteSelectorSessionId - A unique ID for each Site Selector session\n * @property {string} siteName - (Optional) Name of the newly created development site\n * @property {number} numSites - How many sites does the user have (>=1)\n * @property {GUID} cliSessionId - A unique ID for each Wix dev session\n * @property {GUID} msid - The site's ID\n * @property {string} siteUrl - (Optional) URL of the newly created development site\n * @return {LogObject<wixCliAppFlowDevelopmentSiteExistingSiteSelectedParams>} LogObject<wixCliAppFlowDevelopmentSiteExistingSiteSelectedParams>\n */\nexport function wixCliAppFlowDevelopmentSiteExistingSiteSelected(params: wixCliAppFlowDevelopmentSiteExistingSiteSelectedParams): LogObject<wixCliAppFlowDevelopmentSiteExistingSiteSelectedParams> {\n return { evid: 5223, src: 11, endpoint: 'wix-cli', params };\n}\n\n/**\n * A function to create a log object for the 'wixCliAppFlowDevelopmentSiteAppInstallationOnDevelopmentSiteStart' event (evid: 5224)\n *\n * Event description: Sent when an App Installation on Development Site Starts\n *\n * @param {wixCliAppFlowDevelopmentSiteAppInstallationOnDevelopmentSiteStartParams} params - The parameters for this event\n * @property {DateTime} localTime - The local time during which the component was published\n * @property {string} appName - Name of the Wix App the user wants to install\n * @property {string} projectId - The project that the users is currently working on\n * @property {GUID} siteSelectorSessionId - A unique ID for each Site Selector session\n * @property {GUID} appId - ID of the Wix App the user wants to install\n * @property {GUID} cliSessionId - A unique ID for each Wix dev session\n * @property {GUID} msid - The site's ID\n * @return {LogObject<wixCliAppFlowDevelopmentSiteAppInstallationOnDevelopmentSiteStartParams>} LogObject<wixCliAppFlowDevelopmentSiteAppInstallationOnDevelopmentSiteStartParams>\n */\nexport function wixCliAppFlowDevelopmentSiteAppInstallationOnDevelopmentSiteStart(params: wixCliAppFlowDevelopmentSiteAppInstallationOnDevelopmentSiteStartParams): LogObject<wixCliAppFlowDevelopmentSiteAppInstallationOnDevelopmentSiteStartParams> {\n return { evid: 5224, src: 11, endpoint: 'wix-cli', params };\n}\n\n/**\n * A function to create a log object for the 'wixCliAppFlowDevelopmentSiteAppInstallationOnDevelopmentSiteEnd' event (evid: 5225)\n *\n * Event description: Sent when an App Installation on Development Site Ends\n *\n * @param {wixCliAppFlowDevelopmentSiteAppInstallationOnDevelopmentSiteEndParams} params - The parameters for this event\n * @property {DateTime} localTime - The local time during which the component was published\n * @property {string} errorMessage - (Optional) If the app installation on the site was unsuccessful, the error message displayed to the user\n * @property {string} result - Was the app successfully installed on the development site or not\n * @property {string} projectId - The project that the users is currently working on\n * @property {GUID} siteSelectorSessionId - A unique ID for each Site Selector session\n * @property {string} errorType - (Optional) If the site installation on the site was unsuccessful, the error type\n * @property {GUID} cliSessionId - A unique ID for each Wix dev session\n * @property {GUID} msid - The site's ID\n * @return {LogObject<wixCliAppFlowDevelopmentSiteAppInstallationOnDevelopmentSiteEndParams>} LogObject<wixCliAppFlowDevelopmentSiteAppInstallationOnDevelopmentSiteEndParams>\n */\nexport function wixCliAppFlowDevelopmentSiteAppInstallationOnDevelopmentSiteEnd(params: wixCliAppFlowDevelopmentSiteAppInstallationOnDevelopmentSiteEndParams): LogObject<wixCliAppFlowDevelopmentSiteAppInstallationOnDevelopmentSiteEndParams> {\n return { evid: 5225, src: 11, endpoint: 'wix-cli', params };\n}\n\n/**\n * A function to create a log object for the 'wixCliAppFlowDevelopmentSiteDevelopmentSiteSet' event (evid: 5226)\n *\n * Event description: Sent when a development site was set\n *\n * @param {wixCliAppFlowDevelopmentSiteDevelopmentSiteSetParams} params - The parameters for this event\n * @property {DateTime} localTime - The local time during which the component was published\n * @property {string} projectId - The project that the users is currently working on\n * @property {GUID} siteSelectorSessionId - A unique ID for each Site Selector session\n * @property {GUID} cliSessionId - A unique ID for each Wix dev session\n * @property {GUID} msid - The site's ID\n * @return {LogObject<wixCliAppFlowDevelopmentSiteDevelopmentSiteSetParams>} LogObject<wixCliAppFlowDevelopmentSiteDevelopmentSiteSetParams>\n */\nexport function wixCliAppFlowDevelopmentSiteDevelopmentSiteSet(params: wixCliAppFlowDevelopmentSiteDevelopmentSiteSetParams): LogObject<wixCliAppFlowDevelopmentSiteDevelopmentSiteSetParams> {\n return { evid: 5226, src: 11, endpoint: 'wix-cli', params };\n}\n\n/**\n * A function to create a log object for the 'wixCliAppFlowDevelopmentSiteSiteSelectorAborted' event (evid: 5227)\n *\n * Event description: Sent when there was a Site Selector Abort\n *\n * @param {wixCliAppFlowDevelopmentSiteSiteSelectorAbortedParams} params - The parameters for this event\n * @property {DateTime} localTime - The local time during which the component was published\n * @property {string} projectId - The project that the users is currently working on\n * @property {GUID} siteSelectorSessionId - A unique ID for each Site Selector session\n * @property {GUID} cliSessionId - A unique ID for each Wix dev session\n * @return {LogObject<wixCliAppFlowDevelopmentSiteSiteSelectorAbortedParams>} LogObject<wixCliAppFlowDevelopmentSiteSiteSelectorAbortedParams>\n */\nexport function wixCliAppFlowDevelopmentSiteSiteSelectorAborted(params: wixCliAppFlowDevelopmentSiteSiteSelectorAbortedParams): LogObject<wixCliAppFlowDevelopmentSiteSiteSelectorAbortedParams> {\n return { evid: 5227, src: 11, endpoint: 'wix-cli', params };\n}\n\n/**\n * A function to create a log object for the 'wixCliAppFlowExtensionGenerationExtensionWasAdded' event (evid: 5228)\n *\n * Event description: Sent the Extension generated in the app when the generate session is finished.\n *\n * @param {wixCliAppFlowExtensionGenerationExtensionWasAddedParams} params - The parameters for this event\n * @property {DateTime} localTime - The local time during which the component was published\n * @property {string} failureReason - The failure reason, will be null if the extension was added successfully\n * @property {string} cliVersion - The CLI version\n * @property {string} appCurrentVersion - The app version\n * @property {string} componentId - The Component Id\n * @property {string} projectId - The project that the users is currently working on\n * @property {string} widgetType - Relevant only for component type = widget. Pushed / Asked\n * @property {string} componentType - widget, page, sidebar category\n * @property {boolean} wasSuccess - True if the extension was added successfully\n * @property {GUID} cliSessionId - A unique ID for each Wix dev session\n * @return {LogObject<wixCliAppFlowExtensionGenerationExtensionWasAddedParams>} LogObject<wixCliAppFlowExtensionGenerationExtensionWasAddedParams>\n */\nexport function wixCliAppFlowExtensionGenerationExtensionWasAdded(params: wixCliAppFlowExtensionGenerationExtensionWasAddedParams): LogObject<wixCliAppFlowExtensionGenerationExtensionWasAddedParams> {\n return { evid: 5228, src: 11, endpoint: 'wix-cli', params };\n}\n\n/**\n * A function to create a log object for the 'wixCliAppFlowStepsAnswers' event (evid: 5229)\n *\n * Event description: Sent on each answer the user writes, on each step of the flow. (answers for CLI questions)\n *\n * @param {wixCliAppFlowStepsAnswersParams} params - The parameters for this event\n * @property {DateTime} localTime - The local time during which the component was published\n * @property {string} question - The question that the user is answering on\n * @property {string} cliVersion - The CLI version\n * @property {string} appCurrentVersion - The app version\n * @property {string} projectId - The project that the users is currently working on\n * @property {string} command - The command that the user is working on now\n * @property {string} answer - The answer that the user wrote\n * @property {GUID} cliSessionId - A unique ID for each Wix dev session\n * @property {string} flow - Apps / Sites\n * @property {string} arguments - Additional data - for example the template name\n * @property {string} additionalInfo - Any additional info needed in Json - {extensionType:”...”, extensionGroup:”...”, etc…}.\n * extensionType - dashboard page / side bar category / specific-ecomm-checkout-plugin / etc.. (relevant only for Existing app extension flow)\n * extensionGroup - Dashboard / site / backend\n * @return {LogObject<wixCliAppFlowStepsAnswersParams>} LogObject<wixCliAppFlowStepsAnswersParams>\n */\nexport function wixCliAppFlowStepsAnswers(params: wixCliAppFlowStepsAnswersParams): LogObject<wixCliAppFlowStepsAnswersParams> {\n return { evid: 5229, src: 11, endpoint: 'wix-cli', params };\n}\n\n/**\n * A function to create a log object for the 'wixCliCliError' event (evid: 5230)\n *\n * Event description: Sent when there is a user/ system error at the CLI\n *\n * @param {wixCliCliErrorParams} params - The parameters for this event\n * @property {DateTime} localTime - The local time during which the error happened\n * @property {string} errorMessage - (Optional) The error message displayed, if the command was invalid\n * @property {string} projectId - The project id that the dev is currently working on\n * @property {string} errorType - (Optional) The error type, if the command was invalid - User/ System error\n * @property {string} errorName - The error name - a generic name for a group off errors. (Optional) if the command was invalid\n * @property {GUID} cliSessionId - A unique ID for each Wix dev session\n * @return {LogObject<wixCliCliErrorParams>} LogObject<wixCliCliErrorParams>\n */\nexport function wixCliCliError(params: wixCliCliErrorParams): LogObject<wixCliCliErrorParams> {\n return { evid: 5230, src: 11, endpoint: 'wix-cli', params };\n}\n","{\n \"login.instructions_title\": \"Authorize the CLI to access your Wix account:\",\n \"login.instructions_details\": \"1. Copy this code to the clipboard: <0>{code}</0>\\n2. Press <1/> to connect to <2/> then paste the code\",\n \"login.legacy_auth_notice\": \"We implemented a new and more secure login method. You'll need to re-login to continue using the CLI.\",\n \"login.error_opening_browser\": \"Failed to open browser, please try opening <0/> manually.\"\n}\n","import React, { useState, type FC } from 'react';\nimport { Box, Text, Link, useInput, Key } from '@wix/cli-ui-kit';\nimport { Trans } from '@wix/cli-i18n';\nimport { openBrowser } from '@wix/user-browser';\nimport { ErrorViewer, useErrorReporter } from '@wix/cli-error-reporting';\n\ninterface Props {\n userCode: string;\n verificationUri: string;\n}\n\nexport const LoginInstructions: FC<Props> = ({ userCode, verificationUri }) => {\n const { reportError } = useErrorReporter();\n const [openBrowserError, setOpenBrowserError] = useState<unknown | null>(\n null\n );\n\n useInput((input, key) => {\n if (key.return) {\n openBrowser(verificationUri).catch((error: unknown) => {\n reportError(error);\n setOpenBrowserError(error);\n });\n }\n });\n\n return (\n <>\n <Trans i18nKey=\"login.instructions_title\" />\n <Box flexDirection=\"column\" marginTop={1} marginBottom={1} marginLeft={2}>\n <Trans\n i18nKey=\"login.instructions_details\"\n components={[\n <Text skin=\"legacyBlue\" />,\n <Key value=\"enter\" />,\n <Link url={verificationUri} />,\n ]}\n values={{ code: userCode }}\n />\n </Box>\n\n {openBrowserError && (\n <>\n <Box flexDirection=\"column\" marginBottom={1}>\n <ErrorViewer error={openBrowserError} />\n </Box>\n\n <Trans\n i18nKey=\"login.error_opening_browser\"\n components={[<Link url={verificationUri} />]}\n />\n </>\n )}\n </>\n );\n};\n","import open from 'open';\nimport { getTestOverrides } from '@wix/cli-test-overrides';\nimport { open as openTestkit } from './open-testkit.js';\n\nexport async function openBrowser(url: string) {\n const { userBrowserTestEndpoint: testEndpoint } = getTestOverrides();\n\n if (testEndpoint) {\n await openTestkit(testEndpoint, url);\n } else {\n await open(url, {\n background: true,\n });\n }\n}\n","import { createHttpClient } from '@wix/http-client';\n\nexport async function open(testEndpoint: string, url: string) {\n await createHttpClient().post(testEndpoint, undefined, {\n params: {\n url,\n },\n });\n}\n","import React, { type FC, type ReactNode } from 'react';\nimport { match } from 'variant';\nimport { Box, useAsync } from '@wix/cli-ui-kit';\nimport { Trans } from '@wix/cli-i18n';\nimport { hasLegacyAuthData } from '../auth-data.js';\n\ninterface Props {\n children: ReactNode;\n}\n\nexport const WarnLegacyAuthData: FC<Props> = ({ children }) => {\n const { status } = useAsync(hasLegacyAuthData, [], { onError: () => {} });\n\n return match(status, {\n Error: () => null,\n Loading: () => null,\n Success: ({ result }) => (\n <>\n {result && (\n <Box marginBottom={1}>\n <Trans i18nKey=\"login.legacy_auth_notice\" />\n </Box>\n )}\n {children}\n </>\n ),\n });\n};\n","import { accountAuthStrategy } from './auth-strategies/index.js';\n\nexport const { isLoggedIn: isLoggedInToAccount } = accountAuthStrategy;\n\nexport { logout } from './logout.js';\nexport { getUserInfo } from './auth-data.js';\nexport type { UserInfo } from './schemas.js';\nexport { useAuth } from './useAuth.js';\nexport { ApiKeyLogin } from './components/ApiKeyLogin.js';\nexport { LoginWithI18n as Login } from './components/Login.js';\nexport { AccountAuthProvider } from './providers/AccountAuthProvider.js';\nexport { SiteAuthProvider } from './providers/SiteAuthProvider.js';\nexport { authenticateWithSiteId } from './authenticate.js';\nexport type { AuthState } from './context.js';\n","import { useContext } from 'react';\nimport { AuthContext, type AuthState } from './context.js';\n\nexport function useAuth(): AuthState {\n const context = useContext(AuthContext);\n\n if (!context) {\n throw new Error('useAuth() cannot be used without an <AuthProvider>');\n }\n\n return context;\n}\n"],"mappings":";;6ZAAA,IAAAA,GAAAC,EAAA,CAAAC,GAAAC,KAAA,cAAAC,IACA,IAAMC,GAAK,EAAQ,IAAI,EAEnBC,GAEJ,SAASC,IAAe,CACvB,GAAI,CACH,OAAAF,GAAG,SAAS,aAAa,EAClB,EACR,MAAY,CACX,MAAO,EACR,CACD,CAEA,SAASG,IAAkB,CAC1B,GAAI,CACH,OAAOH,GAAG,aAAa,oBAAqB,MAAM,EAAE,SAAS,QAAQ,CACtE,MAAY,CACX,MAAO,EACR,CACD,CAEAF,GAAO,QAAU,KACZG,KAAa,SAChBA,GAAWC,GAAa,GAAKC,GAAgB,GAGvCF,MC3BR,IAAAG,GAAAC,EAAA,CAAAC,GAAAC,KAAA,cAAAC,IACA,IAAMC,GAAK,EAAQ,IAAI,EACjBC,GAAK,EAAQ,IAAI,EACjBC,GAAW,KAEXC,GAAQ,IAAM,CACnB,GAAI,QAAQ,WAAa,QACxB,MAAO,GAGR,GAAIH,GAAG,QAAQ,EAAE,YAAY,EAAE,SAAS,WAAW,EAClD,MAAI,CAAAE,GAAS,EAOd,GAAI,CACH,OAAOD,GAAG,aAAa,gBAAiB,MAAM,EAAE,YAAY,EAAE,SAAS,WAAW,EACjF,CAACC,GAAS,EAAI,EAChB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ASN,EAAY,CAAC,EAAG,CACpE,UAAYO,GAAW,CACjBA,GACFN,EAAQM,CAAM,CAElB,EACA,QAAAL,CACF,CAAC,EAED,SAAO,UAAME,EAAQ,CACnB,QAAS,IAAMI,GAAA,cAACC,EAAA,IAAQ,EACxB,MAAO,IAAM,KACb,QAAS,CAAC,CAAE,OAAQC,CAAY,IAC1BA,IAAgB,KAEhBF,GAAA,cAACG,GAAA,CAAa,SAAUC,IACtBJ,GAAA,cAACK,GAAA,KACCL,GAAA,cAACM,GAAA,CACC,QAASf,EACT,QAAUgB,GAAS,CACjBV,EAAkB,CAAE,OAAQU,CAAK,CAAC,EAClCd,EAAQc,CAAI,CACd,EACA,QAASb,EACX,CACF,CACF,EAIGC,EAASO,CAAW,CAE/B,CAAC,CACH,EZ7CO,IAAMM,GAAiC,CAAC,CAC7C,SAAAC,EACA,QAAAC,EACA,QAAAC,CACF,IAAM,CACJ,IAAMC,EAAOC,GAAQ,EAErB,OACEC,GAAA,cAACC,GAAA,CACC,aAAcC,EACd,QAAS,CAAC,CAAE,SAAAC,CAAS,IAAMN,IAAUM,CAAQ,EAC7C,QAASP,GAAWE,GAEnB,CAAC,CAAE,eAAAM,EAAgB,kBAAAC,EAAmB,SAAAF,CAAS,IAC9CH,GAAA,cAACM,GAAY,SAAZ,CACC,MAAO,CAAE,eAAAF,EAAgB,kBAAAC,EAAmB,SAAAF,CAAS,GAEpDR,CACH,CAEJ,CAEJ,EoBnCAY,ICAAC,IAAA,OAAS,cAAAC,OAAkB,QAGpB,SAASC,IAAqB,CACnC,IAAMC,EAAUC,GAAWC,EAAW,EAEtC,GAAI,CAACF,EACH,MAAM,IAAI,MAAM,oDAAoD,EAGtE,OAAOA,CACT,CDTO,GAAM,CAAE,WAAYG,EAAoB,EAAIC","names":["require_is_docker","__commonJSMin","exports","module","init_esm_shims","fs","isDocker","hasDockerEnv","hasDockerCGroup","require_is_wsl","__commonJSMin","exports","module","init_esm_shims","os","fs","isDocker","isWsl","require_define_lazy_prop","__commonJSMin","exports","module","init_esm_shims","object","propertyName","fn","define","value","result","require_open","__commonJSMin","exports","module","init_esm_shims","path","childProcess","fs","fsConstants","isWsl","isDocker","defineLazyProperty","localXdgOpenPath","__dirname","platform","arch","hasContainerEnv","cachedResult","isInsideContainer","getWslDrivesMountPoint","defaultMountPoint","mountPoint","configFilePath","isConfigFileExists","configContent","configMountPoint","pTryEach","array","mapper","latestError","item","error","baseOpen","options","singleApp","app","appArguments","appName","command","cliArguments","childProcessOptions","encodedArguments","arg","isBundled","exeLocalXdgOpen","subprocess","resolve","reject","exitCode","open","target","openApp","name","detectArchBinary","binary","archBinary","detectPlatformBinary","platformBinary","wsl","apps","init_esm_shims","React","createContext","useContext","BiContext","BiProvider","children","biLogger","useBiLogger","context","init_esm_shims","init_esm_shims","React","createContext","useContext","ErrorReporterContext","ErrorReporterProvider","props","useErrorReporter","context","init_esm_shims","init_esm_shims","import_http_client","baseUrls","interceptRequest","client","fn","args","error","isHttpError","CliError","CliErrorCode","createHttpClient","getAppToken","createHeaders","type","createHttpClientOriginal","init_esm_shims","createElement","useMemo","init_esm_shims","import_variant","React","init_esm_shims","noop","args","_i","createWeakMap","fakeSetOrMap","k","hop","has","obj","prop","extend","target","source","reLeadingNewline","reTrailingNewline","reStartsWithNewlineOrIsEmpty","reDetectIndentation","reOnlyWhitespaceWithAtLeastOneNewline","_outdentArray","strings","firstInterpolatedValueSetsIndentationLevel","options","indentationLevel","match","reSource","reMatchIndent","newline","trimLeadingNewline","trimTrailingNewline","normalizeNewlines","l","outdentedStrings","v","i","_","concatStringsAndValues","values","ret","isTemplateStringsArray","createInstance","arrayAutoIndentCache","arrayFirstInterpSetsIndentCache","outdent","stringsOrOptions","defaultOutdent","cache","renderedArray","rendered","fullOutdent","str","defaultOutdent","init_esm_shims","React","ErrorMessage","message","explanation","hint","React","Box_default","Alert","InsightIcon","Text","SystemErrorMessage","getErrorComponent","code","error","React","Text","SystemErrorMessage","siteId","ErrorMessage","email","currentVersion","latestVersion","updateCommand","Newline","folder","packageName","validations","validation","id","packageManagerName","appId","cause","causeMessage","getErrorMessage","revision","path","filePath","configFilename","configPath","srcDir","zodError","defaultOutdent","formatZodIssue","paramsOverridePath","maxSizeViolationsData","filePaths","errorMessage","f","issues","Issue","issue","typeToName","type","Box_default","name","hint","fileName","templatePath","url","cliVersion","cliAppVersion","route","templateFilename","tagName","versionRange","Link","version","ErrorViewer","originalError","systemErrorOverride","useMemo","error","normalizeError","isCliSystemError","createElement","getErrorComponent","init_esm_shims","React","init_esm_shims","createContext","AuthContext","init_esm_shims","init_esm_shims","import_variant","init_esm_shims","init_esm_shims","_account","_accountResponse","_getMyAccountRequest","resolveComWixpressAccountApiAccountServiceUrl","opts","domainToMappings","resolveUrl","getMyAccount","payload","_a","serializer","_getMyAccountRequest","toReq","fromReq","fromRes","_accountResponse","_account","__getMyAccount","host","serializedData","metadata","resolveComWixpressAccountApiAccountServiceUrl","toURLSearchParams","init_esm_shims","_deviceCodeRequest","_deviceCodeResponse","_rawHttpRequest","_rawHttpResponse","_revokeRefreshTokenRequest","_revokeRefreshTokenResponse","resolveWixIdentityOauth2V1Oauth2NgUrl","opts","domainToMappings","resolveUrl","token","payload","_a","serializer","_rawHttpRequest","toReq","fromReq","fromRes","_rawHttpResponse","__token","host","serializedData","metadata","resolveWixIdentityOauth2V1Oauth2NgUrl","deviceCode","_deviceCodeRequest","_deviceCodeResponse","__deviceCode","toURLSearchParams","revokeRefreshToken","payload","_a","serializer","_revokeRefreshTokenRequest","toReq","fromReq","fromRes","_revokeRefreshTokenResponse","__revokeRefreshToken","host","serializedData","metadata","resolveWixIdentityOauth2V1Oauth2NgUrl","import_variant","init_esm_shims","deviceCodeSchema","z","tokenSchema","token","userInfoSchema","getMyAccountSchema","siteAuthSchema","accountAuthSchema","apiKeyAuthSchema","InvalidResponseData","FailedToGetAuthToken","FailedToGetDeviceCode","FailedToRenewAuthToken","FailedToRenewAuthTokenSiteNotFound","FailedToRevokeRefreshToken","CliErrorCode","clientId","getCurrentTimestamp","DeviceCodeNotYetVerifiedError","RenewTokenData","AuthClient","httpClient","minRetryTimeout","getTestOverrides","req","data","pRetry","deviceCode","deviceCodeSchema","error","CliError","payload","requestId","token","result","tokenSchema","isHttpError","tokenData","email","revokeRefreshToken","accessToken","createHttpClient","userInfoData","userInfoSchema","getMyAccount","getMyAccountSchema","client","init_esm_shims","unlink","rm","resolve","import_variant","getLegacyAuthDataFilePath","resolve","getDataDirPath","getAuthDataFolder","getApiKeyAuthDataFilePath","getAccountAuthDataFilePath","getSiteAuthDataFilePath","siteId","ApiKeyAuthData","readApiKeyAuthData","apiKeyAuthDataFilePath","pathExists","apiKeyFileContents","readJson","savedApiKeyAuthData","apiKeyAuthSchema","saveApiKeyAuthData","authData","targetFilePath","writeJson","error","CliError","CliErrorCode","AccountAuthData","readAccountAuthData","accountAuthDataFilePath","authFileContents","savedAccountAuthData","accountAuthSchema","isValidToken","SiteAuthData","saveAuthData","authData","siteId","targetFilePath","getSiteAuthDataFilePath","getAccountAuthDataFilePath","writeJson","error","CliError","CliErrorCode","deleteAuthData","rm","getAuthDataFolder","hasLegacyAuthData","deleteLegacyAuthData","unlink","getLegacyAuthDataFilePath","pathExists","isValidToken","currentTimestamp","tokenOffset","tokenLifetime","createApiKeyAuthState","token","accountId","userInfo","siteId","apiKeyAuthStrategy","apiKeyAuth","readApiKeyAuthData","payload","accountOwner","slug","client","authData","deleteAuthData","saveApiKeyAuthData","init_esm_shims","init_esm_shims","init_esm_shims","Node","value","Queue","#head","#tail","#size","node","current","pLimit","concurrency","queue","Queue","activeCount","next","run","fn","resolve","args","result","enqueue","generator","import_variant","seconds","n","waitForLogin","deviceCode","expiresIn","signal","authData","pWaitFor","tokenData","client","error","DeviceCodeNotYetVerifiedError","getTestOverrides","userInfo","result","deleteAuthData","saveAuthData","TimeoutError","CliError","CliErrorCode","renewAccountAuth","refreshToken","renewTokenResult","RenewTokenData","getNonExpiredAccountAuth","accountAuthStatus","readAccountAuthData","accountAuth","newTokenData","createAccountAuthState","initialTokenData","limiter","pLimit","isValidToken","cause","accountAuthStrategy","apiKeyAuth","apiKeyAuthStrategy","init_esm_shims","import_variant","React","init_esm_shims","React","init_esm_shims","wixCliCliCommand","params","wixCliCliCommandStatus","wixCliLoginStart","params","wixCliLoginEnd","import_variant","messages_default","init_esm_shims","React","useState","init_esm_shims","import_open","init_esm_shims","import_http_client","open","testEndpoint","url","openBrowser","url","testEndpoint","getTestOverrides","open","LoginInstructions","userCode","verificationUri","reportError","useErrorReporter","openBrowserError","setOpenBrowserError","useState","use_input_default","input","key","openBrowser","error","React","Trans","Box_default","Text","Key","Link","ErrorViewer","Login","loginFn","onLogin","onError","biLogger","useBiLogger","handleError","error","wixCliLoginEnd","loginAction","useAsyncCallback","signal","deviceCodeResponse","authData","status","useAsync","wixCliLoginStart","client","React","Spinner","userCode","verificationUri","LoginInstructions","init_esm_shims","import_variant","React","WarnLegacyAuthData","children","status","useAsync","hasLegacyAuthData","result","React","Box_default","Trans","EnsureLoggedIn","login","isLoggedIn","onLogin","onError","children","status","updateAccountAuth","useAsync","result","React","Spinner","accountAuth","I18nProvider","messages_default","WarnLegacyAuthData","Login","data","AccountAuthProvider","children","onError","onLogin","exit","useExit","React","EnsureLoggedIn","accountAuthStrategy","userInfo","getAccessToken","getRequestHeaders","AuthContext","init_esm_shims","init_esm_shims","useContext","useAuth","context","useContext","AuthContext","isLoggedInToAccount","accountAuthStrategy"]}
@@ -1,4 +0,0 @@
1
- import { createRequire as _createRequire } from 'node:module';
2
- const require = _createRequire(import.meta.url);
3
- import{B as u,C as I,D as M,E as v,Ea as N,Ga as T,aa as f,ca as B,ea as A,r as S,v as d,w as b,x as P}from"./chunk-SEGEUJOD.js";import{a as C,c,d as l}from"./chunk-HAYBGBEA.js";import{e as g,h as p}from"./chunk-V4TR6DCM.js";p();var w=g(C(),1);import{randomUUID as F}from"node:crypto";var x=t=>{let r=new Map;[...t].sort((i,e)=>i.id.localeCompare(e.id)).forEach(i=>{let e=r.get(i.id)??[];e.push(i),r.set(i.id,e)});let o=new Map;if(r.forEach((i,e)=>{i.length>1&&o.set(e,i)}),o.size)throw new c({code:l.DuplicateComponentIdsError({issues:Array.from(o.entries()).map(([i,e])=>({id:i,components:e.map(m=>(0,w.match)(m,{DashboardPage:({title:a,relativePath:n})=>({name:a,type:"page",path:f(n,"json")}),DashboardPlugin:({title:a,relativePath:n})=>({name:a,type:"plugin",path:f(n,"json")}),DashboardMenuPlugin:({title:a,relativePath:n})=>({name:a,type:"menu-plugin",path:n}),DashboardModal:({title:a,relativePath:n})=>({name:a,type:"modal",path:f(n,"json")}),DashboardSidebarCategory:({label:a})=>({name:a,type:"sidebar-category",path:S}),EmbeddedScript:({relativePath:a})=>({name:a,type:"embedded-script",path:f(a,"json")}),CustomElement:({name:a,relativePath:n})=>({name:a,type:"custom-element",path:f(n,"json")}),Topology:({name:a})=>({name:a,type:"topology",path:""})})).sort((m,a)=>m.name.localeCompare(a.name)),suggestedId:F()}))})})};p();var O=g(C(),1);import{randomUUID as R}from"node:crypto";var W=(t,r)=>{if(t.experiments)return{appId:r,componentId:t.id,spec:t.experiments.enabledBy,variantValue:"true"}};async function V(t){return t?.map(r=>({compId:R(),compData:{webhook:{webhookSlug:r,callbackUrl:"__WEBHOOKS_URL_PLACEHOLDER__"}},compType:d.WEBHOOK,compName:r}))||[]}var j=t=>({compId:t.id,compType:d.CUSTOM_ELEMENT_WIDGET,compName:t.name,compData:{customElementWidget:{base:{name:t.name},widgetData:{tagName:t.tagName,scriptType:M.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:v.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 ee({appId:t,components:r,sentryDSN:s,componentSourceBuilder:o,registeredEvents:i}){return x(r),{appId:t,components:[...await V(i),...await Promise.all(r.map((0,O.match)({DashboardPage:async e=>{let m=e.sentryDSN??s;return{compId:e.id,compType:d.BACK_OFFICE_PAGE,compData:{backOfficePage:{hostingPlatform:u.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,...m?{errorReporting:{url:m}}:void 0,...await o(e)}},compName:e.title,experiment:W(e,t)}},DashboardPlugin:async e=>({compId:e.id,compType:d.BACK_OFFICE_EXTENSION_WIDGET,compData:{backOfficeExtensionWidget:{hostingPlatform:u.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:d.BACK_OFFICE_EXTENSION_MENU_ITEM,compData:{backOfficeExtensionMenuItem:{hostingPlatform:u.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:d.BACK_OFFICE_MODAL,compData:{backOfficeModal:{hostingPlatform:u.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:d.BACK_OFFICE_SIDEBAR_CATEGORY,compData:{backOfficeSidebarCategory:{hostingPlatform:u.BUSINESS_MANAGER,title:e.label,priority:e.priority}},compName:e.label}),EmbeddedScript:async e=>({compId:e.id,compType:d.EMBEDDED_SCRIPT,compName:e.name,compData:{embeddedScriptComponentData:{name:e.name,pages:P.NONE_PAGES,placement:e.placement,connectArticleUrl:"",embedCategory:e.scriptType,dependencies:e.dependencies,loadOnce:!0,allowedForFreeSite:!0,...await o(e)}}}),CustomElement:async e=>{let{scriptUrl:m,settingsUrl:a}=await o(e),n=j(e);return{...n,compData:{customElementWidget:{...n.compData.customElementWidget,widgetData:{...n.compData.customElementWidget.widgetData,scriptUrl:m},behaviors:{...n.compData.customElementWidget.behaviors,...e.relativePanelPath?{settings:{settingsUrl:a}}:{}}}}}},Topology:async e=>({compId:e.id,compType:d.TOPOLOGY,compName:e.name,compData:{topology:{topology:{backendApiUrl:e.backendApiUrl}}}})})))]}}p();var k=g(C(),1);p();function U(t){if(!("output"in t||Array.isArray(t)))throw new c({code:l.InvalidViteBuildOutput()});return Array.isArray(t)?t.flatMap(o=>o.output):t.output}function E(t,r){let o=U(t).find(i=>i.type==="chunk"&&i.facadeModuleId===r);if(!o)throw new c({code:l.ViteModuleBundleNotFound()});return o.fileName}function _(t,r){let o=U(t).find(i=>i.fileName===r);if(!o||!("source"in o))throw new c({code:l.ViteFileNotFoundInOutput({fileName:r})});return o.source.toString()}async function L(t,r){let s=new URL(t.relativePath,r).href;return await fetch(s).then(i=>i.text())}var D=(t,r,s)=>{if(!r.config.trusted)return{iframeUrl:B(t.id)};let o=A(t.id),i=s?E(s,o):`/@id/${o}?import`;return{scriptAsset:{exportedName:t.id,containerId:r.config.appId,url:i,scriptType:I.MODULE}}},G=async(t,r,s)=>({template:r?_(r,t.relativePath):await L(t,s)}),H=(t,r)=>{let s=T(t.id);return{scriptUrl:r?E(r,s):`/@id/${s}?import`,settingsUrl:N(t.id)}};function pe({model:t,buildOutput:r,devServerUrl:s}){return async o=>(0,k.match)(o,{EmbeddedScript:e=>G(e,r,s),DashboardSidebarCategory:()=>{},CustomElement:e=>H(e,r),DashboardPage:e=>D(e,t,r),DashboardPlugin:e=>D(e,t,r),DashboardModal:e=>D(e,t,r),DashboardMenuPlugin:()=>{},Topology:()=>{}})}export{x as a,j as b,ee as c,pe as d};
4
- //# sourceMappingURL=chunk-ZF4WFDE4.js.map
@@ -1 +0,0 @@
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 { 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 { DevCenterComponent } from '../dev-center/components/dev-center-component.js';\n\nexport const validateComponents = (components: DevCenterComponent[]) => {\n const devCenterComponentsToIdMap: Map<string, DevCenterComponent[]> =\n new Map();\n const sortedComponentsById = [...components].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, DevCenterComponent[]> =\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 registeredEvents: string[];\n components: DevCenterComponent[];\n sentryDSN?: string;\n componentSourceBuilder: ComponentSourceBuilder;\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\nasync function getManifestWebhooks(registeredEvents: string[]) {\n return (\n registeredEvents?.map<Webhook>((eventSlug) => ({\n compId: randomUUID(),\n compData: {\n webhook: {\n webhookSlug: eventSlug,\n callbackUrl: '__WEBHOOKS_URL_PLACEHOLDER__',\n },\n },\n compType: ComponentType.WEBHOOK as const,\n compName: eventSlug,\n })) || []\n );\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 registeredEvents,\n}: CreateAppManifestParams): Promise<AppManifest> {\n validateComponents(components);\n\n return {\n appId,\n components: [\n ...(await getManifestWebhooks(registeredEvents)),\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 })\n )\n )),\n ],\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 {\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 };\ntype EmbeddedScriptSource = {\n template: string;\n};\ntype CustomElementSource = { scriptUrl: string; settingsUrl: string };\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 : undefined\n>;\n\nasync function getEmbeddedScriptDevTemplate(\n component: DevCenterComponent<'EmbeddedScript'>,\n devServerUrl?: string\n) {\n const url = new URL(component.relativePath, devServerUrl).href;\n const devTemplate = await fetch(url).then((res) => res.text());\n\n return devTemplate;\n}\n\nconst dashboardSourceBuilder = (\n component:\n | DevCenterComponent<'DashboardPage'>\n | DevCenterComponent<'DashboardPlugin'>\n | DevCenterComponent<'DashboardModal'>,\n model: ProjectModel,\n buildOutput?: 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 = buildOutput\n ? extractModuleBundleName(buildOutput, 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 buildOutput?: ViteBuildOutput,\n devServerUrl?: string\n): Promise<EmbeddedScriptSource> => {\n return {\n template: buildOutput\n ? extractModuleBundleContent(buildOutput, component.relativePath)\n : await getEmbeddedScriptDevTemplate(component, devServerUrl),\n };\n};\n\nconst customElementBuilder = (\n component: DevCenterComponent<'CustomElement'>,\n buildOutput?: ViteBuildOutput\n): CustomElementSource => {\n const moduleId = virtualModuleIdForCustomElementScriptAsset(component.id);\n const componentUrl = buildOutput\n ? extractModuleBundleName(buildOutput, 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 buildOutput,\n devServerUrl,\n}: {\n model: ProjectModel;\n buildOutput?: ViteBuildOutput;\n devServerUrl?: string;\n}) {\n return (async (component: DevCenterComponent) => {\n const source = match(component, {\n EmbeddedScript: (embeddedScriptComponent) =>\n embeddedScriptBuilder(\n embeddedScriptComponent,\n buildOutput,\n devServerUrl\n ),\n DashboardSidebarCategory: () => {},\n CustomElement: (customElementComponent) =>\n customElementBuilder(customElementComponent, buildOutput),\n DashboardPage: (dashboardPageComponent) =>\n dashboardSourceBuilder(dashboardPageComponent, model, buildOutput),\n DashboardPlugin: (dashboardPluginComponent) =>\n dashboardSourceBuilder(dashboardPluginComponent, model, buildOutput),\n DashboardModal: (dashboardModalComponent) =>\n dashboardSourceBuilder(dashboardModalComponent, model, buildOutput),\n DashboardMenuPlugin: () => {},\n Topology: () => {},\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":";;iOAAAA,IACA,IAAAC,EAAsB,SADtB,OAAS,cAAAC,MAAkB,cAOpB,IAAMC,EAAsBC,GAAqC,CACtE,IAAMC,EACJ,IAAI,IACuB,CAAC,GAAGD,CAAU,EAAE,KAAK,CAACE,EAAGC,IACpDD,EAAE,GAAG,cAAcC,EAAE,EAAE,CACzB,EACqB,QAASC,GAAc,CAC1C,IAAMC,EAAgBJ,EAA2B,IAAIG,EAAU,EAAE,GAAK,CAAC,EACvEC,EAAc,KAAKD,CAAS,EAC5BH,EAA2B,IAAIG,EAAU,GAAIC,CAAa,CAC5D,CAAC,EAED,IAAMC,EACJ,IAAI,IAQN,GANAL,EAA2B,QAAQ,CAACM,EAAqBC,IAAQ,CAC3DD,EAAoB,OAAS,GAC/BD,EAAiC,IAAIE,EAAKD,CAAmB,CAEjE,CAAC,EAEGD,EAAiC,KACnC,MAAM,IAAIG,EAAS,CACjB,KAAMC,EAAa,2BAA2B,CAC5C,OAAQ,MAAM,KAAKJ,EAAiC,QAAQ,CAAC,EAAE,IAC7D,CAAC,CAACK,EAA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P,EAAU,EAAE,CACjD,EAEF,IAAMQ,EAAWC,EAA8BT,EAAU,EAAE,EACrDU,EAAeJ,EACjBK,EAAwBL,EAAaE,CAAQ,EAC7C,QAAQA,CAAQ,UAEpB,MAAO,CACL,YAAa,CACX,aAAcR,EAAU,GACxB,YAAaK,EAAM,OAAO,MAC1B,IAAKK,EACL,WAAYE,EAA0B,MACxC,CACF,CACF,EAEMC,EAAwB,MAC5Bb,EACAM,EACAL,KAEO,CACL,SAAUK,EACNQ,EAA2BR,EAAaN,EAAU,YAAY,EAC9D,MAAMD,EAA6BC,EAAWC,CAAY,CAChE,GAGIc,EAAuB,CAC3Bf,EACAM,IACwB,CACxB,IAAME,EAAWQ,EAA2ChB,EAAU,EAAE,EAKxE,MAAO,CACL,UALmBM,EACjBK,EAAwBL,EAAaE,CAAQ,EAC7C,QAAQA,CAAQ,UAIlB,YAAaS,EAA0CjB,EAAU,EAAE,CACrE,CACF,EAEO,SAASkB,GAA0B,CACxC,MAAAb,EACA,YAAAC,EACA,aAAAL,CACF,EAIG,CACD,MAAQ,OAAOD,MACE,SAAMA,EAAW,CAC9B,eAAiBmB,GACfN,EACEM,EACAb,EACAL,CACF,EACF,yBAA0B,IAAM,CAAC,EACjC,cAAgBmB,GACdL,EAAqBK,EAAwBd,CAAW,EAC1D,cAAgBe,GACdjB,EAAuBiB,EAAwBhB,EAAOC,CAAW,EACnE,gBAAkBgB,GAChBlB,EAAuBkB,EAA0BjB,EAAOC,CAAW,EACrE,eAAiBiB,GACfnB,EAAuBmB,EAAyBlB,EAAOC,CAAW,EACpE,oBAAqB,IAAM,CAAC,EAC5B,SAAU,IAAM,CAAC,CACnB,CAAC,CAIL","names":["init_esm_shims","import_variant","randomUUID","validateComponents","components","devCenterComponentsToIdMap","a","b","component","componentList","devCenterComponentsWithSameIDMap","devCenterComponents","key","CliError","CliErrorCode","id","title","relativePath","replaceExtension","label","CONFIG_FILENAME","name","randomUUID","init_esm_shims","import_variant","randomUUID","getExperiment","component","appId","getManifestWebhooks","registeredEvents","eventSlug","randomUUID","ComponentType","createCustomElementConfig","CustomElementScriptType","HeightMode","RegionType","createAppManifest","components","sentryDSN","componentSourceBuilder","validateComponents","componentSentryDSN","BackOfficeHostingPlatforms","EmbeddedScriptPages","scriptUrl","settingsUrl","basicConfig","init_esm_shims","import_variant","init_esm_shims","extractBuildOutputs","buildOutput","CliError","CliErrorCode","output","extractModuleBundleName","moduleId","extractModuleBundleContent","fileName","getEmbeddedScriptDevTemplate","component","devServerUrl","url","res","dashboardSourceBuilder","model","buildOutput","virtualPathForHTMLAsset","moduleId","virtualModuleIdForScriptAsset","componentUrl","extractModuleBundleName","BackOfficeScriptAssetType","embeddedScriptBuilder","extractModuleBundleContent","customElementBuilder","virtualModuleIdForCustomElementScriptAsset","virtualPathForCustomElementPanelHTMLAsset","getComponentSourceBuilder","embeddedScriptComponent","customElementComponent","dashboardPageComponent","dashboardPluginComponent","dashboardModalComponent"]}