@lovrabet/rabetbase-cli 2.1.2-beta.3 → 2.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (161) hide show
  1. package/lib/api/api-doc.js +1 -1
  2. package/lib/api/fetch-model-list.js +1 -1
  3. package/lib/api/generate-api-file.js +1 -1
  4. package/lib/auth/auth-server-ui.js +1 -1
  5. package/lib/auth/auth-server.js +1 -1
  6. package/lib/auth/constant.js +1 -1
  7. package/lib/auth/get-cookie.js +1 -1
  8. package/lib/auth/get-session-user.js +1 -1
  9. package/lib/auth/is-session-valid.js +1 -1
  10. package/lib/auth/login-success-html.js +1 -1
  11. package/lib/auth/logout.js +1 -1
  12. package/lib/cli-flags.js +1 -1
  13. package/lib/cli.js +1 -1
  14. package/lib/commands/api/generate.js +1 -1
  15. package/lib/commands/api/index.js +1 -1
  16. package/lib/commands/api/list.js +1 -1
  17. package/lib/commands/api/pull.js +1 -1
  18. package/lib/commands/api/shared.js +1 -1
  19. package/lib/commands/app/add.js +1 -1
  20. package/lib/commands/app/discover.js +1 -1
  21. package/lib/commands/app/index.js +1 -1
  22. package/lib/commands/app/list.js +1 -1
  23. package/lib/commands/app/remove.js +1 -1
  24. package/lib/commands/app/shared.js +1 -1
  25. package/lib/commands/app/use.js +1 -1
  26. package/lib/commands/auth/index.js +1 -1
  27. package/lib/commands/bff/delete.js +1 -1
  28. package/lib/commands/bff/detail.js +1 -1
  29. package/lib/commands/bff/index.js +1 -1
  30. package/lib/commands/bff/list.js +1 -1
  31. package/lib/commands/bff/new.js +1 -1
  32. package/lib/commands/bff/pull.js +1 -1
  33. package/lib/commands/bff/push.js +1 -1
  34. package/lib/commands/bff/status.js +1 -1
  35. package/lib/commands/cli-update.js +1 -1
  36. package/lib/commands/codegen/index.js +1 -1
  37. package/lib/commands/codegen/sdk.js +1 -1
  38. package/lib/commands/codegen/sql.js +1 -1
  39. package/lib/commands/common/app-selector.js +1 -1
  40. package/lib/commands/common/flags.js +1 -1
  41. package/lib/commands/common/validate.js +1 -1
  42. package/lib/commands/config/get.js +1 -1
  43. package/lib/commands/config/index.js +1 -1
  44. package/lib/commands/config/list.js +1 -1
  45. package/lib/commands/config/set.js +1 -1
  46. package/lib/commands/config/shared.js +1 -1
  47. package/lib/commands/dataset/detail.js +1 -1
  48. package/lib/commands/dataset/index.js +1 -1
  49. package/lib/commands/dataset/links.js +1 -1
  50. package/lib/commands/dataset/list.js +1 -1
  51. package/lib/commands/dataset/operations.js +1 -1
  52. package/lib/commands/db/analyze-cancel.js +1 -1
  53. package/lib/commands/db/analyze-start.js +1 -1
  54. package/lib/commands/db/analyze-status.js +1 -1
  55. package/lib/commands/db/create.js +1 -1
  56. package/lib/commands/db/delete.js +1 -1
  57. package/lib/commands/db/detail.js +1 -1
  58. package/lib/commands/db/diff.js +1 -1
  59. package/lib/commands/db/index.js +1 -1
  60. package/lib/commands/db/list.js +1 -1
  61. package/lib/commands/db/shared.js +1 -1
  62. package/lib/commands/db/tables.js +1 -1
  63. package/lib/commands/db/test.js +1 -1
  64. package/lib/commands/db/update.js +1 -1
  65. package/lib/commands/doctor.js +1 -1
  66. package/lib/commands/init/index.js +1 -1
  67. package/lib/commands/logs/index.js +1 -1
  68. package/lib/commands/menu/index.js +1 -1
  69. package/lib/commands/menu/shared/compare-table.js +1 -1
  70. package/lib/commands/menu/shared/index.js +1 -1
  71. package/lib/commands/menu/shared/inquirer.js +1 -1
  72. package/lib/commands/menu/shared/local-pages.js +1 -1
  73. package/lib/commands/menu/shared/logic.js +1 -1
  74. package/lib/commands/menu/shared/service.js +1 -1
  75. package/lib/commands/menu/shared/sync-core.js +1 -1
  76. package/lib/commands/menu/shared/update-core.js +1 -1
  77. package/lib/commands/menu/shared/valid-url.js +1 -1
  78. package/lib/commands/menu/sync.js +1 -1
  79. package/lib/commands/menu/update.js +1 -1
  80. package/lib/commands/project/create/enhanced-guided-create.js +1 -1
  81. package/lib/commands/project/create/format-elapsed.js +1 -1
  82. package/lib/commands/project/create/main.js +1 -1
  83. package/lib/commands/project/create/non-interactive.js +1 -1
  84. package/lib/commands/project/create/project-template-path.js +1 -1
  85. package/lib/commands/project/create/use-copy-project-template.js +1 -1
  86. package/lib/commands/project/create/use-format-code.js +1 -1
  87. package/lib/commands/project/create/use-install-dependencies.js +1 -1
  88. package/lib/commands/project/index.js +1 -1
  89. package/lib/commands/project/init.js +1 -1
  90. package/lib/commands/project/upgrade.js +1 -1
  91. package/lib/commands/registry.js +1 -1
  92. package/lib/commands/run/index.js +1 -1
  93. package/lib/commands/schema.js +1 -1
  94. package/lib/commands/skill/index.js +1 -1
  95. package/lib/commands/sql/detail.js +1 -1
  96. package/lib/commands/sql/exec.js +1 -1
  97. package/lib/commands/sql/index.js +1 -1
  98. package/lib/commands/sql/list.js +1 -1
  99. package/lib/commands/sql/pull.js +1 -1
  100. package/lib/commands/sql/save.js +1 -1
  101. package/lib/commands/sql/shared.js +1 -1
  102. package/lib/commands/sql/validate.js +1 -1
  103. package/lib/config/schema.js +1 -1
  104. package/lib/constant/cli.js +1 -1
  105. package/lib/constant/defaults.js +1 -1
  106. package/lib/constant/domain.js +1 -1
  107. package/lib/constant/env.js +1 -1
  108. package/lib/constant/output.js +1 -1
  109. package/lib/constant/paths.js +1 -1
  110. package/lib/constant/risk.js +1 -1
  111. package/lib/context.js +1 -1
  112. package/lib/core/alias-resolver.js +1 -1
  113. package/lib/core/api-client.js +1 -1
  114. package/lib/core/bff/config.js +1 -1
  115. package/lib/core/bff/file-system.js +1 -1
  116. package/lib/core/bff/hash.js +1 -1
  117. package/lib/core/bff/lock.js +1 -1
  118. package/lib/core/bff/utils.js +1 -1
  119. package/lib/core/db-resolver.js +1 -1
  120. package/lib/core/sql-validator.js +1 -1
  121. package/lib/errors.js +1 -1
  122. package/lib/framework/build-all-flags.js +1 -1
  123. package/lib/framework/flags.js +1 -1
  124. package/lib/framework/help.js +1 -1
  125. package/lib/framework/index.js +1 -1
  126. package/lib/framework/output.js +1 -1
  127. package/lib/framework/response.js +1 -1
  128. package/lib/framework/runner-alias.js +1 -1
  129. package/lib/framework/runner.js +1 -1
  130. package/lib/framework/schema-export.js +1 -1
  131. package/lib/framework/types.js +1 -1
  132. package/lib/generated/build-info.js +1 -1
  133. package/lib/help.js +1 -1
  134. package/lib/skills/main.js +1 -1
  135. package/lib/skills/npx-skills-add.js +1 -1
  136. package/lib/telemetry/cli-command-trace.js +1 -1
  137. package/lib/telemetry/cli-help-trace.js +1 -1
  138. package/lib/telemetry/ensure-cli-otel-config.js +1 -1
  139. package/lib/telemetry/register-otel-exit-shutdown.js +1 -1
  140. package/lib/telemetry/send-cli-trace-log.js +1 -1
  141. package/lib/utils/ai_config.js +1 -1
  142. package/lib/utils/apply-jq-filter.js +1 -1
  143. package/lib/utils/cdn-config.js +1 -1
  144. package/lib/utils/check-sdk-version.js +1 -1
  145. package/lib/utils/cli-version-check.js +1 -1
  146. package/lib/utils/config.js +1 -1
  147. package/lib/utils/copy-directory.js +1 -1
  148. package/lib/utils/entity-with-id.js +1 -1
  149. package/lib/utils/file-utils.js +1 -1
  150. package/lib/utils/guides-cdn.js +1 -1
  151. package/lib/utils/http-client.js +1 -1
  152. package/lib/utils/is-non-interactive.js +1 -1
  153. package/lib/utils/logger.js +1 -1
  154. package/lib/utils/platform.js +1 -1
  155. package/lib/utils/rules-cdn.js +1 -1
  156. package/lib/utils/sleep.js +1 -1
  157. package/lib/utils/template-replacer.js +1 -1
  158. package/lib/utils/version.js +1 -1
  159. package/lib/utils/with-active-cookie.js +1 -1
  160. package/lib/utils/write-cli-side-channel.js +1 -1
  161. package/package.json +1 -1
@@ -1 +1 @@
1
- const a128_0x1e84c8=a128_0x470f;function a128_0x470f(_0x116606,_0x2c891e){_0x116606=_0x116606-0xc0;const _0x117c9d=a128_0x117c();let _0x470fbb=_0x117c9d[_0x116606];return _0x470fbb;}(function(_0x5dfb1c,_0x53de9f){const _0xd0aa9b=a128_0x470f,_0x815645=_0x5dfb1c();while(!![]){try{const _0x4bcdaf=parseInt(_0xd0aa9b(0xd4))/0x1*(parseInt(_0xd0aa9b(0xc1))/0x2)+-parseInt(_0xd0aa9b(0xd7))/0x3+parseInt(_0xd0aa9b(0xd2))/0x4*(-parseInt(_0xd0aa9b(0xc7))/0x5)+parseInt(_0xd0aa9b(0xce))/0x6*(parseInt(_0xd0aa9b(0xda))/0x7)+-parseInt(_0xd0aa9b(0xca))/0x8*(-parseInt(_0xd0aa9b(0xd5))/0x9)+-parseInt(_0xd0aa9b(0xc5))/0xa*(parseInt(_0xd0aa9b(0xc9))/0xb)+parseInt(_0xd0aa9b(0xc4))/0xc;if(_0x4bcdaf===_0x53de9f)break;else _0x815645['push'](_0x815645['shift']());}catch(_0x593586){_0x815645['push'](_0x815645['shift']());}}}(a128_0x117c,0x514bd));import{readdirSync,statSync,readFileSync}from'fs';import{join,relative,resolve,sep}from'path';const pagesDir=resolve(process['cwd'](),a128_0x1e84c8(0xc6));export function extractTitleFromComment(_0x14be7f){const _0xc0e1=a128_0x1e84c8;try{const _0x1eaa1c=readFileSync(_0x14be7f,_0xc0e1(0xdc)),_0x56f1f4=_0x1eaa1c[_0xc0e1(0xc3)](/^\s*\/\*\*?([\s\S]*?)\*\//);if(_0x56f1f4&&_0x56f1f4[0x1]){const _0x15ddd8=_0x56f1f4[0x1],_0x421e9a=_0x15ddd8[_0xc0e1(0xc3)](/^\s*\*?\s*title\s*:\s*(.+)/im);if(_0x421e9a&&_0x421e9a[0x1])return _0x421e9a[0x1][_0xc0e1(0xd0)]();}let _0x3fe7fb=null;const _0x48dfc0=_0x1eaa1c[_0xc0e1(0xc3)](/export\s+default\s+([A-Z][a-zA-Z0-9]*)/);_0x48dfc0&&_0x48dfc0[0x1]&&(_0x3fe7fb=_0x48dfc0[0x1]);if(!_0x3fe7fb){const _0x20951c=_0x1eaa1c[_0xc0e1(0xc3)](/export\s+default\s+function\s+([A-Z][a-zA-Z0-9]*)/);_0x20951c&&_0x20951c[0x1]&&(_0x3fe7fb=_0x20951c[0x1]);}if(_0x3fe7fb){const _0x3be43f=new RegExp('\x5cb'+_0x3fe7fb+_0xc0e1(0xd1)),_0x15ca99=_0x1eaa1c[_0xc0e1(0xc3)](_0x3be43f);if(_0x15ca99&&_0x15ca99[0x1])return _0x15ca99[0x1];return _0x3fe7fb;}return null;}catch(_0x46bd6d){return null;}}function a128_0x117c(){const _0xa2de29=['replaceAll','7996RIdsex','replace','match','6006468picbGF','10130XZMnGu','src/pages','295MUCOMN','.tsx','1639ztlCaZ','8XBpykl','forEach','slice','index.tsx','504JCUxxH','isDirectory','trim','\x5c.displayName\x5cs*=\x5cs*[\x22\x27]([^\x22\x27]+)[\x22\x27]','29020BIMhHg','endsWith','77gHyFdV','4953159WoxIzG','push','1640679XIFJjY','path','join','8344MjrNYb','concat','utf-8'];a128_0x117c=function(){return _0xa2de29;};return a128_0x117c();}export function getLocalPages(_0x3509a7=pagesDir,_0x4a607c=pagesDir){const _0x3343f6=a128_0x1e84c8;let _0x23dea9=[];const _0x26fccb=readdirSync(_0x3509a7);return _0x26fccb[_0x3343f6(0xcb)](_0x44bd8b=>{const _0x4cfa92=_0x3343f6,_0x4c82e4=join(_0x3509a7,_0x44bd8b),_0x589cd7=statSync(_0x4c82e4);if(_0x589cd7&&_0x589cd7[_0x4cfa92(0xcf)]())_0x23dea9=_0x23dea9[_0x4cfa92(0xdb)](getLocalPages(_0x4c82e4,_0x4a607c));else{if(_0x44bd8b['endsWith'](_0x4cfa92(0xc8))){let _0x3716f8=relative(_0x4a607c,_0x4c82e4);_0x3716f8[_0x4cfa92(0xd3)](_0x4cfa92(0xcd))?_0x3716f8=_0x3716f8[_0x4cfa92(0xc2)](/index\.tsx$/,''):_0x3716f8=_0x3716f8['replace'](/\.tsx$/,'');_0x3716f8[_0x4cfa92(0xd3)](sep)&&(_0x3716f8=_0x3716f8[_0x4cfa92(0xcc)](0x0,-0x1));const _0x2f75d4=_0x3716f8['split'](sep)[_0x4cfa92(0xd9)]('/'),_0x5506c0=extractTitleFromComment(_0x4c82e4),_0x868fae=_0x5506c0||_0x2f75d4;_0x23dea9[_0x4cfa92(0xd6)]({'path':_0x2f75d4[_0x4cfa92(0xc0)]('$',':'),'label':_0x868fae});}}}),_0x23dea9['filter'](_0x65f3ad=>_0x65f3ad[_0x3343f6(0xd8)]!=='');}
1
+ const a128_0x2cd43d=a128_0x4013;(function(_0x544711,_0x183723){const _0x22a409=a128_0x4013,_0x1737e5=_0x544711();while(!![]){try{const _0x25ebc7=parseInt(_0x22a409(0xa7))/0x1+parseInt(_0x22a409(0xa3))/0x2*(-parseInt(_0x22a409(0x9f))/0x3)+parseInt(_0x22a409(0xa8))/0x4*(-parseInt(_0x22a409(0x9d))/0x5)+parseInt(_0x22a409(0xae))/0x6+-parseInt(_0x22a409(0x9c))/0x7*(-parseInt(_0x22a409(0xa2))/0x8)+-parseInt(_0x22a409(0xaa))/0x9+-parseInt(_0x22a409(0xac))/0xa;if(_0x25ebc7===_0x183723)break;else _0x1737e5['push'](_0x1737e5['shift']());}catch(_0x3bfda2){_0x1737e5['push'](_0x1737e5['shift']());}}}(a128_0x2249,0x8b03f));function a128_0x4013(_0x3510bb,_0x469ded){_0x3510bb=_0x3510bb-0x97;const _0x224907=a128_0x2249();let _0x401388=_0x224907[_0x3510bb];return _0x401388;}import{readdirSync,statSync,readFileSync}from'fs';import{join,relative,resolve,sep}from'path';function a128_0x2249(){const _0x411887=['split','endsWith','11656wCUXfa','82nfmzqa','replace','filter','path','923982xxShFQ','104SpEPmV','concat','4881204FFXoUU','utf-8','1282920DwtaHp','match','2617548yOzHnk','replaceAll','cwd','index.tsx','.tsx','isDirectory','448RwpbWm','2150HHyhwD','slice','14799wpVNjl'];a128_0x2249=function(){return _0x411887;};return a128_0x2249();}const pagesDir=resolve(process[a128_0x2cd43d(0x98)](),'src/pages');export function extractTitleFromComment(_0x32868c){const _0xcceb8f=a128_0x2cd43d;try{const _0x207ba1=readFileSync(_0x32868c,_0xcceb8f(0xab)),_0x48b47c=_0x207ba1[_0xcceb8f(0xad)](/^\s*\/\*\*?([\s\S]*?)\*\//);if(_0x48b47c&&_0x48b47c[0x1]){const _0x527410=_0x48b47c[0x1],_0x477e23=_0x527410[_0xcceb8f(0xad)](/^\s*\*?\s*title\s*:\s*(.+)/im);if(_0x477e23&&_0x477e23[0x1])return _0x477e23[0x1]['trim']();}let _0x3d40ef=null;const _0x204e14=_0x207ba1['match'](/export\s+default\s+([A-Z][a-zA-Z0-9]*)/);_0x204e14&&_0x204e14[0x1]&&(_0x3d40ef=_0x204e14[0x1]);if(!_0x3d40ef){const _0x586b88=_0x207ba1['match'](/export\s+default\s+function\s+([A-Z][a-zA-Z0-9]*)/);_0x586b88&&_0x586b88[0x1]&&(_0x3d40ef=_0x586b88[0x1]);}if(_0x3d40ef){const _0x5cd6e4=new RegExp('\x5cb'+_0x3d40ef+'\x5c.displayName\x5cs*=\x5cs*[\x22\x27]([^\x22\x27]+)[\x22\x27]'),_0x27e20f=_0x207ba1[_0xcceb8f(0xad)](_0x5cd6e4);if(_0x27e20f&&_0x27e20f[0x1])return _0x27e20f[0x1];return _0x3d40ef;}return null;}catch(_0x47b289){return null;}}export function getLocalPages(_0x47e2f8=pagesDir,_0x42f36e=pagesDir){const _0x55bdfe=a128_0x2cd43d;let _0x4383c8=[];const _0x48bea1=readdirSync(_0x47e2f8);return _0x48bea1['forEach'](_0x362cb5=>{const _0x4ce5c7=a128_0x4013,_0x3e3b18=join(_0x47e2f8,_0x362cb5),_0x381816=statSync(_0x3e3b18);if(_0x381816&&_0x381816[_0x4ce5c7(0x9b)]())_0x4383c8=_0x4383c8[_0x4ce5c7(0xa9)](getLocalPages(_0x3e3b18,_0x42f36e));else{if(_0x362cb5['endsWith'](_0x4ce5c7(0x9a))){let _0x5c7b0c=relative(_0x42f36e,_0x3e3b18);_0x5c7b0c[_0x4ce5c7(0xa1)](_0x4ce5c7(0x99))?_0x5c7b0c=_0x5c7b0c['replace'](/index\.tsx$/,''):_0x5c7b0c=_0x5c7b0c[_0x4ce5c7(0xa4)](/\.tsx$/,'');_0x5c7b0c[_0x4ce5c7(0xa1)](sep)&&(_0x5c7b0c=_0x5c7b0c[_0x4ce5c7(0x9e)](0x0,-0x1));const _0x136fc1=_0x5c7b0c[_0x4ce5c7(0xa0)](sep)['join']('/'),_0xc87a9c=extractTitleFromComment(_0x3e3b18),_0x542769=_0xc87a9c||_0x136fc1;_0x4383c8['push']({'path':_0x136fc1[_0x4ce5c7(0x97)]('$',':'),'label':_0x542769});}}}),_0x4383c8[_0x55bdfe(0xa5)](_0x3e5255=>_0x3e5255[_0x55bdfe(0xa6)]!=='');}
@@ -1 +1 @@
1
- function a130_0x2cb1(_0x19c0bb,_0x1b98fc){_0x19c0bb=_0x19c0bb-0xd5;const _0x43de8f=a130_0x43de();let _0x2cb12c=_0x43de8f[_0x19c0bb];return _0x2cb12c;}(function(_0x114668,_0x963855){const _0x319cd9=a130_0x2cb1,_0x2f28e7=_0x114668();while(!![]){try{const _0x17038=parseInt(_0x319cd9(0xe4))/0x1+parseInt(_0x319cd9(0xd9))/0x2+parseInt(_0x319cd9(0xd6))/0x3*(parseInt(_0x319cd9(0xec))/0x4)+parseInt(_0x319cd9(0xdd))/0x5+-parseInt(_0x319cd9(0xe2))/0x6*(-parseInt(_0x319cd9(0xdb))/0x7)+parseInt(_0x319cd9(0xd5))/0x8*(-parseInt(_0x319cd9(0xe8))/0x9)+-parseInt(_0x319cd9(0xe5))/0xa;if(_0x17038===_0x963855)break;else _0x2f28e7['push'](_0x2f28e7['shift']());}catch(_0x326725){_0x2f28e7['push'](_0x2f28e7['shift']());}}}(a130_0x43de,0x29566));import{getLocalPages}from'../../../commands/menu/shared/local-pages.js';import{getOnlineMenuList,createMenus,updateMenuCdnUrl}from'../../../commands/menu/shared/service.js';import{isUrlReachable,isValidCssHttpsUrl,isValidJsHttpsUrl}from'../../../commands/menu/shared/valid-url.js';export function validateJsUrl(_0x50932d){const _0x5db0be=a130_0x2cb1,_0x163170=[];return!isValidJsHttpsUrl(_0x50932d)&&_0x163170['push'](_0x5db0be(0xde)),{'ok':_0x163170[_0x5db0be(0xe6)]===0x0,'errors':_0x163170};}export function validateCssUrl(_0x4acca2){const _0x5d9f6b=a130_0x2cb1,_0x1701ed=[];return!isValidCssHttpsUrl(_0x4acca2)&&_0x1701ed[_0x5d9f6b(0xe0)](_0x5d9f6b(0xd7)),{'ok':_0x1701ed[_0x5d9f6b(0xe6)]===0x0,'errors':_0x1701ed};}export async function validateJsUrlReachable(_0x20ac77){const _0x18d48c=a130_0x2cb1,_0x2016b5=validateJsUrl(_0x20ac77);if(!_0x2016b5['ok'])return _0x2016b5;const _0x3e8293=await isUrlReachable(_0x20ac77);if(!_0x3e8293)_0x2016b5[_0x18d48c(0xe7)]['push'](_0x18d48c(0xeb));return{'ok':_0x2016b5['errors'][_0x18d48c(0xe6)]===0x0,'errors':_0x2016b5['errors']};}export async function validateCssUrlReachable(_0x304105){const _0x5a2f4a=a130_0x2cb1,_0x4bb8b5=validateCssUrl(_0x304105);if(!_0x4bb8b5['ok'])return _0x4bb8b5;const _0x7a1c1c=await isUrlReachable(_0x304105);if(!_0x7a1c1c)_0x4bb8b5[_0x5a2f4a(0xe7)][_0x5a2f4a(0xe0)]('CSS\x20URL\x20is\x20unreachable');return{'ok':_0x4bb8b5[_0x5a2f4a(0xe7)][_0x5a2f4a(0xe6)]===0x0,'errors':_0x4bb8b5['errors']};}export function buildCompareRows(_0x1eef2b,_0x13f906){const _0x119b3f=a130_0x2cb1;return _0x1eef2b['map'](_0x3fc21a=>({'label':_0x3fc21a[_0x119b3f(0xee)],'path':_0x3fc21a['path'],'local':!![],'online':_0x13f906['has'](_0x3fc21a[_0x119b3f(0xe3)])}));}function a130_0x43de(){const _0x2570db=['errors','27ScRFSA','status','has','JS\x20URL\x20is\x20unreachable','4WCwXuE','map','label','706888IqzqrT','630186HnHcal','CSS\x20URL\x20must\x20be\x20a\x20valid\x20https://...css\x20URL','filter','511206vJOQCs','trim','7zsSNty','resources','1433060giXdGu','JS\x20URL\x20must\x20be\x20a\x20valid\x20https://...js\x20URL','join','push','No\x20local\x20pages\x20matched\x20labels:\x20','77634XeVfsI','path','231051xbMLzw','5618660hCLTCT','length'];a130_0x43de=function(){return _0x2570db;};return a130_0x43de();}export function filterNewPages(_0x5642a2,_0x190e5f,_0x551f5f){const _0x101874=a130_0x2cb1;if(_0x551f5f&&_0x551f5f[_0x101874(0xe6)]>0x0){const _0x3fb5b2=new Set(_0x551f5f[_0x101874(0xed)](_0x5835c5=>_0x5835c5[_0x101874(0xda)]())),_0x36fe7d=_0x5642a2[_0x101874(0xd8)](_0x598bb1=>_0x3fb5b2[_0x101874(0xea)](_0x598bb1[_0x101874(0xee)]));if(_0x36fe7d[_0x101874(0xe6)]===0x0)throw new Error(_0x101874(0xe1)+[..._0x3fb5b2][_0x101874(0xdf)](',\x20'));return _0x36fe7d;}return _0x5642a2[_0x101874(0xd8)](_0x5a48cc=>!_0x190e5f[_0x101874(0xea)](_0x5a48cc[_0x101874(0xe3)]));}export function filterPagesByLabels(_0x334661,_0x4a3479){const _0x404ad4=a130_0x2cb1,_0x2269e8=[],_0x4a6791=[];for(const _0x19c373 of _0x4a3479){const _0x384ba0=_0x19c373[_0x404ad4(0xda)](),_0x2fc39a=_0x334661['find'](_0x129707=>_0x129707['label']===_0x384ba0);if(_0x2fc39a)_0x2269e8[_0x404ad4(0xe0)](_0x2fc39a);else _0x4a6791[_0x404ad4(0xe0)](_0x19c373);}return{'matched':_0x2269e8,'unmatched':_0x4a6791};}export async function doCreateMenus(_0x3a32d9,_0x31436a,_0x13789d,_0x56a36d){const _0x25e97b=a130_0x2cb1;return await createMenus(_0x3a32d9,_0x31436a,_0x13789d,_0x56a36d),{'created':_0x13789d[_0x25e97b(0xe6)],'failed':0x0,'labels':_0x13789d['map'](_0x1a6836=>_0x1a6836[_0x25e97b(0xee)])};}export function filterMenusWithResources(_0x18762b){const _0x421b7a=a130_0x2cb1;return _0x18762b[_0x421b7a(0xd8)](_0x51b2b7=>_0x51b2b7['resources'][_0x421b7a(0xe6)]>0x0);}export async function doUpdateCdnUrls(_0x2f36b4,_0x23b880,_0x3f7c3b,_0x4ceab7){const _0x2a4207=a130_0x2cb1,_0x4c6d8f=_0x3f7c3b[_0x2a4207(0xd8)](_0x2700fd=>_0x2700fd[_0x2a4207(0xdc)][_0x2a4207(0xe6)]>0x0),_0x24f0a9=await Promise['allSettled'](_0x4c6d8f[_0x2a4207(0xed)](_0x12d17f=>updateMenuCdnUrl(_0x2f36b4,_0x23b880,{'id':_0x12d17f['id'],'label':_0x12d17f[_0x2a4207(0xee)],'path':_0x12d17f[_0x2a4207(0xe3)],'resources':_0x4ceab7}))),_0x29815c=_0x24f0a9[_0x2a4207(0xd8)](_0x444d52=>_0x444d52[_0x2a4207(0xe9)]==='rejected')[_0x2a4207(0xe6)];return{'updated':_0x4c6d8f[_0x2a4207(0xe6)]-_0x29815c,'failed':_0x29815c};}export async function fetchMenuData(_0x5494d9,_0x541103){const _0x5b9d71=a130_0x2cb1,_0x43d992=getLocalPages(),_0x4326c2=await getOnlineMenuList(_0x5494d9,_0x541103),_0x427ffc=new Set(_0x4326c2[_0x5b9d71(0xed)](_0x115dc3=>_0x115dc3['path']));return{'localPages':_0x43d992,'onlineMenuList':_0x4326c2,'onlinePaths':_0x427ffc};}export async function fetchOnlineMenuList(_0x46af67,_0x20ebcf){return getOnlineMenuList(_0x46af67,_0x20ebcf);}
1
+ (function(_0x3ca76a,_0x2254c9){const _0x1100f8=a130_0x4208,_0xeb66a9=_0x3ca76a();while(!![]){try{const _0x467f8b=-parseInt(_0x1100f8(0x82))/0x1+parseInt(_0x1100f8(0x74))/0x2+parseInt(_0x1100f8(0x84))/0x3*(-parseInt(_0x1100f8(0x87))/0x4)+-parseInt(_0x1100f8(0x80))/0x5*(parseInt(_0x1100f8(0x88))/0x6)+-parseInt(_0x1100f8(0x89))/0x7*(parseInt(_0x1100f8(0x71))/0x8)+-parseInt(_0x1100f8(0x7a))/0x9+parseInt(_0x1100f8(0x8b))/0xa;if(_0x467f8b===_0x2254c9)break;else _0xeb66a9['push'](_0xeb66a9['shift']());}catch(_0x3abba4){_0xeb66a9['push'](_0xeb66a9['shift']());}}}(a130_0x5146,0x77e41));import{getLocalPages}from'../../../commands/menu/shared/local-pages.js';function a130_0x5146(){const _0x20f3b1=['status','16969260oASYyZ','rejected','path','211856QPahnO','resources','map','24366Tooesj','JS\x20URL\x20is\x20unreachable','has','CSS\x20URL\x20is\x20unreachable','find','CSS\x20URL\x20must\x20be\x20a\x20valid\x20https://...css\x20URL','1914453clbjLq','label','filter','length','join','JS\x20URL\x20must\x20be\x20a\x20valid\x20https://...js\x20URL','5vdAIaz','trim','685884TLAWJa','No\x20local\x20pages\x20matched\x20labels:\x20','61647DwsvEF','errors','push','8kVZuiu','1352238NrTqrb','14pbehZK'];a130_0x5146=function(){return _0x20f3b1;};return a130_0x5146();}import{getOnlineMenuList,createMenus,updateMenuCdnUrl}from'../../../commands/menu/shared/service.js';import{isUrlReachable,isValidCssHttpsUrl,isValidJsHttpsUrl}from'../../../commands/menu/shared/valid-url.js';export function validateJsUrl(_0xcfbf6d){const _0x1f7ee2=a130_0x4208,_0x43d31d=[];return!isValidJsHttpsUrl(_0xcfbf6d)&&_0x43d31d[_0x1f7ee2(0x86)](_0x1f7ee2(0x7f)),{'ok':_0x43d31d[_0x1f7ee2(0x7d)]===0x0,'errors':_0x43d31d};}export function validateCssUrl(_0x443d90){const _0x1cbc2c=a130_0x4208,_0x4d3a07=[];return!isValidCssHttpsUrl(_0x443d90)&&_0x4d3a07[_0x1cbc2c(0x86)](_0x1cbc2c(0x79)),{'ok':_0x4d3a07[_0x1cbc2c(0x7d)]===0x0,'errors':_0x4d3a07};}export async function validateJsUrlReachable(_0x16a989){const _0x160c3b=a130_0x4208,_0x57c1c0=validateJsUrl(_0x16a989);if(!_0x57c1c0['ok'])return _0x57c1c0;const _0x528fad=await isUrlReachable(_0x16a989);if(!_0x528fad)_0x57c1c0[_0x160c3b(0x85)][_0x160c3b(0x86)](_0x160c3b(0x75));return{'ok':_0x57c1c0[_0x160c3b(0x85)]['length']===0x0,'errors':_0x57c1c0[_0x160c3b(0x85)]};}export async function validateCssUrlReachable(_0x50ab6a){const _0x175aa3=a130_0x4208,_0x20eca8=validateCssUrl(_0x50ab6a);if(!_0x20eca8['ok'])return _0x20eca8;const _0x203290=await isUrlReachable(_0x50ab6a);if(!_0x203290)_0x20eca8[_0x175aa3(0x85)]['push'](_0x175aa3(0x77));return{'ok':_0x20eca8[_0x175aa3(0x85)]['length']===0x0,'errors':_0x20eca8['errors']};}function a130_0x4208(_0x20772e,_0x559d49){_0x20772e=_0x20772e-0x70;const _0x51460b=a130_0x5146();let _0x4208ae=_0x51460b[_0x20772e];return _0x4208ae;}export function buildCompareRows(_0x2da184,_0x153d66){const _0x400499=a130_0x4208;return _0x2da184['map'](_0x3f1f0d=>({'label':_0x3f1f0d['label'],'path':_0x3f1f0d[_0x400499(0x70)],'local':!![],'online':_0x153d66['has'](_0x3f1f0d['path'])}));}export function filterNewPages(_0x54d1f6,_0x49fdb,_0x773769){const _0x307a35=a130_0x4208;if(_0x773769&&_0x773769['length']>0x0){const _0x45fae5=new Set(_0x773769[_0x307a35(0x73)](_0x560fe7=>_0x560fe7[_0x307a35(0x81)]())),_0x117979=_0x54d1f6[_0x307a35(0x7c)](_0x84b48e=>_0x45fae5[_0x307a35(0x76)](_0x84b48e[_0x307a35(0x7b)]));if(_0x117979[_0x307a35(0x7d)]===0x0)throw new Error(_0x307a35(0x83)+[..._0x45fae5][_0x307a35(0x7e)](',\x20'));return _0x117979;}return _0x54d1f6[_0x307a35(0x7c)](_0x21dcae=>!_0x49fdb[_0x307a35(0x76)](_0x21dcae[_0x307a35(0x70)]));}export function filterPagesByLabels(_0xa1d5ff,_0x2bca60){const _0xa5559a=a130_0x4208,_0x447e16=[],_0x19662d=[];for(const _0x5ae1c6 of _0x2bca60){const _0x901df6=_0x5ae1c6['trim'](),_0x1458d8=_0xa1d5ff[_0xa5559a(0x78)](_0x6aa23a=>_0x6aa23a[_0xa5559a(0x7b)]===_0x901df6);if(_0x1458d8)_0x447e16[_0xa5559a(0x86)](_0x1458d8);else _0x19662d[_0xa5559a(0x86)](_0x5ae1c6);}return{'matched':_0x447e16,'unmatched':_0x19662d};}export async function doCreateMenus(_0x23132f,_0x36543a,_0x3a694d,_0x52eca1){const _0x5f295d=a130_0x4208;return await createMenus(_0x23132f,_0x36543a,_0x3a694d,_0x52eca1),{'created':_0x3a694d['length'],'failed':0x0,'labels':_0x3a694d[_0x5f295d(0x73)](_0x2bc2c9=>_0x2bc2c9[_0x5f295d(0x7b)])};}export function filterMenusWithResources(_0x4ec6e7){const _0x3cfa8b=a130_0x4208;return _0x4ec6e7[_0x3cfa8b(0x7c)](_0x421963=>_0x421963[_0x3cfa8b(0x72)]['length']>0x0);}export async function doUpdateCdnUrls(_0x5b1614,_0x11ed46,_0x460dd9,_0x1138c8){const _0xced9ae=a130_0x4208,_0x1821df=_0x460dd9['filter'](_0x38e7ee=>_0x38e7ee[_0xced9ae(0x72)][_0xced9ae(0x7d)]>0x0),_0x5c3a60=await Promise['allSettled'](_0x1821df[_0xced9ae(0x73)](_0x284e02=>updateMenuCdnUrl(_0x5b1614,_0x11ed46,{'id':_0x284e02['id'],'label':_0x284e02[_0xced9ae(0x7b)],'path':_0x284e02[_0xced9ae(0x70)],'resources':_0x1138c8}))),_0x3b9d2d=_0x5c3a60[_0xced9ae(0x7c)](_0x4b6029=>_0x4b6029[_0xced9ae(0x8a)]===_0xced9ae(0x8c))[_0xced9ae(0x7d)];return{'updated':_0x1821df[_0xced9ae(0x7d)]-_0x3b9d2d,'failed':_0x3b9d2d};}export async function fetchMenuData(_0x27d8d9,_0x5c75c7){const _0x10e831=a130_0x4208,_0x4eb90c=getLocalPages(),_0x6d69ab=await getOnlineMenuList(_0x27d8d9,_0x5c75c7),_0x378133=new Set(_0x6d69ab[_0x10e831(0x73)](_0x4ea64c=>_0x4ea64c[_0x10e831(0x70)]));return{'localPages':_0x4eb90c,'onlineMenuList':_0x6d69ab,'onlinePaths':_0x378133};}export async function fetchOnlineMenuList(_0x25f6da,_0x3ad34e){return getOnlineMenuList(_0x25f6da,_0x3ad34e);}
@@ -1 +1 @@
1
- (function(_0x48ade7,_0x49e400){const _0x41bd92=a124_0x369a,_0x547ce5=_0x48ade7();while(!![]){try{const _0x36b7ff=-parseInt(_0x41bd92(0x17d))/0x1*(-parseInt(_0x41bd92(0x189))/0x2)+parseInt(_0x41bd92(0x194))/0x3+-parseInt(_0x41bd92(0x16d))/0x4+parseInt(_0x41bd92(0x185))/0x5*(-parseInt(_0x41bd92(0x17b))/0x6)+parseInt(_0x41bd92(0x175))/0x7*(-parseInt(_0x41bd92(0x186))/0x8)+parseInt(_0x41bd92(0x17a))/0x9+-parseInt(_0x41bd92(0x187))/0xa*(-parseInt(_0x41bd92(0x173))/0xb);if(_0x36b7ff===_0x49e400)break;else _0x547ce5['push'](_0x547ce5['shift']());}catch(_0x5ad482){_0x547ce5['push'](_0x547ce5['shift']());}}}(a124_0xc7d7,0xbe8b4));import{getApiDomain}from'../../../constant/domain.js';import{getEnv,isProduction}from'../../../constant/env.js';import{logger}from'../../../utils/logger.js';import{platformFetch}from'../../../core/api-client.js';export async function getOnlineMenuList(_0x17fdd6,_0x45e5c6){const _0x3f836b=a124_0x369a,_0x287351=getEnv();logger[_0x3f836b(0x181)](_0x3f836b(0x192),isProduction(_0x287351)?_0x3f836b(0x18a)+_0x17fdd6+')':'Fetching\x20daily\x20menu\x20list...\x20(appCode:\x20'+_0x17fdd6+')');const _0x47f47f=await platformFetch(getApiDomain()+'/smartapi/menu/find?appCode='+_0x17fdd6,{'cookie':_0x45e5c6,'label':'Fetch\x20menu\x20list'});if(!_0x47f47f)return logger[_0x3f836b(0x181)](_0x3f836b(0x192),_0x3f836b(0x18b)),[];return logger[_0x3f836b(0x181)](_0x3f836b(0x192),_0x3f836b(0x16c)+_0x47f47f[_0x3f836b(0x172)]+_0x3f836b(0x180)),_0x47f47f[_0x3f836b(0x182)](flattenMenuItem)[_0x3f836b(0x174)]();}function flattenMenuItem(_0x1f00eb){const _0x573add=a124_0x369a;let _0x89e241=[];try{if(_0x1f00eb['extend']?.[_0x573add(0x16f)]){const _0x5aa235=JSON[_0x573add(0x176)](_0x1f00eb[_0x573add(0x183)][_0x573add(0x16f)]);if(Array[_0x573add(0x191)](_0x5aa235))_0x89e241=_0x5aa235;}}catch{}const _0x372c1d=[{'id':_0x1f00eb['id'],'path':_0x1f00eb['path'],'label':_0x1f00eb[_0x573add(0x18e)],'resources':_0x89e241}];if(_0x1f00eb[_0x573add(0x188)]&&_0x1f00eb[_0x573add(0x188)][_0x573add(0x172)]>0x0)for(const _0x2ed135 of _0x1f00eb[_0x573add(0x188)]){_0x372c1d[_0x573add(0x193)](...flattenMenuItem(_0x2ed135));}return _0x372c1d;}export async function createMenu(_0x18bf41,_0x477a1f,_0x2a9fae){const _0x3d15d8=a124_0x369a;logger[_0x3d15d8(0x181)](_0x3d15d8(0x195),_0x3d15d8(0x197)+_0x2a9fae[_0x3d15d8(0x18e)]+'\x20('+_0x2a9fae['path']+')');const _0x36eb80={'appCode':_0x18bf41,'type':'procode','sort':0x0,'extend':{'loadScriptMode':_0x3d15d8(0x190),'resources':_0x2a9fae['resources']?JSON[_0x3d15d8(0x171)](_0x2a9fae[_0x3d15d8(0x16f)]):undefined},..._0x2a9fae};await platformFetch(getApiDomain()+_0x3d15d8(0x178),{'method':'POST','body':_0x36eb80,'cookie':_0x477a1f,'label':'Create\x20menu\x20\x22'+_0x2a9fae['label']+'\x22'}),logger[_0x3d15d8(0x181)](_0x3d15d8(0x195),_0x3d15d8(0x179)+_0x2a9fae[_0x3d15d8(0x18e)]);}function a124_0xc7d7(){const _0xea12b1=['parse','Updating\x20menu\x20asset\x20links:\x20','/smartapi/menu/create','Menu\x20created\x20successfully:\x20','6313941JSElNy','534jxNsas','Create\x20menu\x20\x22','11SjcqKB','path','/smartapi/menu/update','\x20online\x20menus\x20successfully','info','map','extend','Update\x20menu\x20assets\x20\x22','85585nLqRbB','2322344sGxofl','12530soTSTc','children','264938bqUANL','Fetching\x20online\x20menu\x20list...\x20(appCode:\x20','Server\x20returned\x20empty\x20menu\x20list','create-menus','Start\x20batch\x20menu\x20creation,\x20total\x20','label','update-menu-cdn-url','import','isArray','get-online-menu-list','push','507279zdlCAr','create-menu','procode','Creating\x20menu:\x20','Fetched\x20','6121540xRboQx','Batch\x20menu\x20creation\x20completed,\x20total\x20','resources','POST','stringify','length','23419ZiLmGt','flat','28ndnnOU'];a124_0xc7d7=function(){return _0xea12b1;};return a124_0xc7d7();}function a124_0x369a(_0x2f7774,_0x2f9ceb){_0x2f7774=_0x2f7774-0x16c;const _0xc7d7e5=a124_0xc7d7();let _0x369aa0=_0xc7d7e5[_0x2f7774];return _0x369aa0;}async function createSingleMenu(_0x563cfa,_0x77787b,_0x4afd2b,_0x356c32){const _0x3167ce=a124_0x369a,_0x506641={'appCode':_0x563cfa,'type':_0x3167ce(0x196),'sort':0x0,'extend':{'loadScriptMode':_0x3167ce(0x190),'resources':_0x356c32?JSON[_0x3167ce(0x171)](_0x356c32):undefined},'label':_0x4afd2b['label'],'path':_0x4afd2b[_0x3167ce(0x17e)]};await platformFetch(getApiDomain()+_0x3167ce(0x178),{'method':'POST','body':_0x506641,'cookie':_0x77787b,'label':_0x3167ce(0x17c)+_0x4afd2b[_0x3167ce(0x18e)]+'\x22'}),logger[_0x3167ce(0x181)](_0x3167ce(0x195),'Menu\x20created\x20successfully:\x20'+_0x4afd2b[_0x3167ce(0x18e)]);}export async function createMenus(_0x5d5e42,_0x3b6e92,_0x3c7b4a,_0x5aa288){const _0x327f5f=a124_0x369a;logger[_0x327f5f(0x181)]('create-menus',_0x327f5f(0x18d)+_0x3c7b4a['length']),await Promise['all'](_0x3c7b4a[_0x327f5f(0x182)](_0x333adb=>createSingleMenu(_0x5d5e42,_0x3b6e92,_0x333adb,_0x5aa288))),logger[_0x327f5f(0x181)](_0x327f5f(0x18c),_0x327f5f(0x16e)+_0x3c7b4a[_0x327f5f(0x172)]);}export async function updateMenuCdnUrl(_0x47f0d3,_0xc53b9,_0x3cb65f){const _0x35f1d3=a124_0x369a;logger['info']('update-menu-cdn-url',_0x35f1d3(0x177)+_0x3cb65f[_0x35f1d3(0x18e)]+'\x20('+_0x3cb65f[_0x35f1d3(0x17e)]+')');const _0x398285={'id':_0x3cb65f['id'],'appCode':_0x47f0d3,'extend':{'loadScriptMode':_0x35f1d3(0x190),'resources':_0x3cb65f[_0x35f1d3(0x16f)]?JSON[_0x35f1d3(0x171)](_0x3cb65f[_0x35f1d3(0x16f)]):undefined}};await platformFetch(getApiDomain()+_0x35f1d3(0x17f),{'method':_0x35f1d3(0x170),'body':_0x398285,'cookie':_0xc53b9,'label':_0x35f1d3(0x184)+_0x3cb65f[_0x35f1d3(0x18e)]+'\x22'}),logger[_0x35f1d3(0x181)](_0x35f1d3(0x18f),'Menu\x20assets\x20synced:\x20'+_0x3cb65f['label'],undefined);}
1
+ (function(_0x5f29b6,_0x12ce43){const _0x39e466=a124_0x1461,_0x5ca13a=_0x5f29b6();while(!![]){try{const _0x484312=-parseInt(_0x39e466(0x81))/0x1*(parseInt(_0x39e466(0x79))/0x2)+parseInt(_0x39e466(0x96))/0x3+parseInt(_0x39e466(0x77))/0x4+-parseInt(_0x39e466(0x9a))/0x5*(-parseInt(_0x39e466(0x8f))/0x6)+-parseInt(_0x39e466(0x7b))/0x7+parseInt(_0x39e466(0x86))/0x8+-parseInt(_0x39e466(0x7e))/0x9*(parseInt(_0x39e466(0x94))/0xa);if(_0x484312===_0x12ce43)break;else _0x5ca13a['push'](_0x5ca13a['shift']());}catch(_0x1aab9c){_0x5ca13a['push'](_0x5ca13a['shift']());}}}(a124_0x2d44,0xa2298));import{getApiDomain}from'../../../constant/domain.js';import{getEnv,isProduction}from'../../../constant/env.js';import{logger}from'../../../utils/logger.js';import{platformFetch}from'../../../core/api-client.js';function a124_0x1461(_0x42b0ae,_0x43b05d){_0x42b0ae=_0x42b0ae-0x72;const _0x2d4489=a124_0x2d44();let _0x1461b6=_0x2d4489[_0x42b0ae];return _0x1461b6;}function a124_0x2d44(){const _0xbf4129=['124WkrQmp','/smartapi/menu/find?appCode=','8751680AaRgjp','all','Create\x20menu\x20\x22','9uhsOhE','Fetching\x20daily\x20menu\x20list...\x20(appCode:\x20','\x20online\x20menus\x20successfully','11956ouXaWb','/smartapi/menu/update','extend','get-online-menu-list','map','7323576wREsDV','Fetch\x20menu\x20list','label','info','create-menus','length','path','resources','update-menu-cdn-url','348yROASt','Menu\x20assets\x20synced:\x20','Fetched\x20','procode','POST','3336150BvWgVX','/smartapi/menu/create','2151051vBByHy','stringify','Batch\x20menu\x20creation\x20completed,\x20total\x20','flat','98525rQrDHx','Server\x20returned\x20empty\x20menu\x20list','Update\x20menu\x20assets\x20\x22','push','import','Menu\x20created\x20successfully:\x20','855956AZgyQC','children'];a124_0x2d44=function(){return _0xbf4129;};return a124_0x2d44();}export async function getOnlineMenuList(_0x2343a5,_0x174efd){const _0x22f943=a124_0x1461,_0x55e53a=getEnv();logger[_0x22f943(0x89)](_0x22f943(0x84),isProduction(_0x55e53a)?'Fetching\x20online\x20menu\x20list...\x20(appCode:\x20'+_0x2343a5+')':_0x22f943(0x7f)+_0x2343a5+')');const _0x59d5ec=await platformFetch(getApiDomain()+_0x22f943(0x7a)+_0x2343a5,{'cookie':_0x174efd,'label':_0x22f943(0x87)});if(!_0x59d5ec)return logger[_0x22f943(0x89)](_0x22f943(0x84),_0x22f943(0x72)),[];return logger['info'](_0x22f943(0x84),_0x22f943(0x91)+_0x59d5ec[_0x22f943(0x8b)]+_0x22f943(0x80)),_0x59d5ec[_0x22f943(0x85)](flattenMenuItem)[_0x22f943(0x99)]();}function flattenMenuItem(_0xb06133){const _0x10888e=a124_0x1461;let _0x26e1c3=[];try{if(_0xb06133[_0x10888e(0x83)]?.[_0x10888e(0x8d)]){const _0x236ef5=JSON['parse'](_0xb06133['extend'][_0x10888e(0x8d)]);if(Array['isArray'](_0x236ef5))_0x26e1c3=_0x236ef5;}}catch{}const _0x52f068=[{'id':_0xb06133['id'],'path':_0xb06133[_0x10888e(0x8c)],'label':_0xb06133[_0x10888e(0x88)],'resources':_0x26e1c3}];if(_0xb06133[_0x10888e(0x78)]&&_0xb06133[_0x10888e(0x78)][_0x10888e(0x8b)]>0x0)for(const _0x2eaa48 of _0xb06133['children']){_0x52f068[_0x10888e(0x74)](...flattenMenuItem(_0x2eaa48));}return _0x52f068;}export async function createMenu(_0xcc9c31,_0x4e6030,_0x5c2db3){const _0x33196d=a124_0x1461;logger['info']('create-menu','Creating\x20menu:\x20'+_0x5c2db3[_0x33196d(0x88)]+'\x20('+_0x5c2db3[_0x33196d(0x8c)]+')');const _0x548194={'appCode':_0xcc9c31,'type':_0x33196d(0x92),'sort':0x0,'extend':{'loadScriptMode':_0x33196d(0x75),'resources':_0x5c2db3[_0x33196d(0x8d)]?JSON[_0x33196d(0x97)](_0x5c2db3[_0x33196d(0x8d)]):undefined},..._0x5c2db3};await platformFetch(getApiDomain()+_0x33196d(0x95),{'method':'POST','body':_0x548194,'cookie':_0x4e6030,'label':_0x33196d(0x7d)+_0x5c2db3[_0x33196d(0x88)]+'\x22'}),logger['info']('create-menu',_0x33196d(0x76)+_0x5c2db3[_0x33196d(0x88)]);}async function createSingleMenu(_0x333b28,_0x7cce44,_0x2ada22,_0x55c8bd){const _0x5dd6c8=a124_0x1461,_0x595db3={'appCode':_0x333b28,'type':_0x5dd6c8(0x92),'sort':0x0,'extend':{'loadScriptMode':_0x5dd6c8(0x75),'resources':_0x55c8bd?JSON['stringify'](_0x55c8bd):undefined},'label':_0x2ada22['label'],'path':_0x2ada22['path']};await platformFetch(getApiDomain()+_0x5dd6c8(0x95),{'method':_0x5dd6c8(0x93),'body':_0x595db3,'cookie':_0x7cce44,'label':'Create\x20menu\x20\x22'+_0x2ada22['label']+'\x22'}),logger[_0x5dd6c8(0x89)]('create-menu',_0x5dd6c8(0x76)+_0x2ada22[_0x5dd6c8(0x88)]);}export async function createMenus(_0x4ecb69,_0x20595a,_0x127c6a,_0x3cf35b){const _0x446e57=a124_0x1461;logger[_0x446e57(0x89)](_0x446e57(0x8a),'Start\x20batch\x20menu\x20creation,\x20total\x20'+_0x127c6a['length']),await Promise[_0x446e57(0x7c)](_0x127c6a[_0x446e57(0x85)](_0x5770d1=>createSingleMenu(_0x4ecb69,_0x20595a,_0x5770d1,_0x3cf35b))),logger[_0x446e57(0x89)](_0x446e57(0x8a),_0x446e57(0x98)+_0x127c6a[_0x446e57(0x8b)]);}export async function updateMenuCdnUrl(_0x34b035,_0x4a5629,_0x4a3c5e){const _0xe7bd62=a124_0x1461;logger[_0xe7bd62(0x89)](_0xe7bd62(0x8e),'Updating\x20menu\x20asset\x20links:\x20'+_0x4a3c5e[_0xe7bd62(0x88)]+'\x20('+_0x4a3c5e[_0xe7bd62(0x8c)]+')');const _0x2a7af4={'id':_0x4a3c5e['id'],'appCode':_0x34b035,'extend':{'loadScriptMode':'import','resources':_0x4a3c5e[_0xe7bd62(0x8d)]?JSON[_0xe7bd62(0x97)](_0x4a3c5e[_0xe7bd62(0x8d)]):undefined}};await platformFetch(getApiDomain()+_0xe7bd62(0x82),{'method':'POST','body':_0x2a7af4,'cookie':_0x4a5629,'label':_0xe7bd62(0x73)+_0x4a3c5e[_0xe7bd62(0x88)]+'\x22'}),logger['info']('update-menu-cdn-url',_0xe7bd62(0x90)+_0x4a3c5e[_0xe7bd62(0x88)],undefined);}
@@ -1 +1 @@
1
- function a122_0x4f81(_0x34a3d4,_0x1f3b24){_0x34a3d4=_0x34a3d4-0x19d;const _0x5b9712=a122_0x5b97();let _0x4f81c=_0x5b9712[_0x34a3d4];return _0x4f81c;}(function(_0xd6eec8,_0x2f099d){const _0x13d809=a122_0x4f81,_0x21bf69=_0xd6eec8();while(!![]){try{const _0x189ec2=parseInt(_0x13d809(0x1c6))/0x1+-parseInt(_0x13d809(0x1a0))/0x2*(parseInt(_0x13d809(0x1ba))/0x3)+-parseInt(_0x13d809(0x1bf))/0x4+-parseInt(_0x13d809(0x1a8))/0x5*(parseInt(_0x13d809(0x1be))/0x6)+-parseInt(_0x13d809(0x1c3))/0x7*(parseInt(_0x13d809(0x1cc))/0x8)+-parseInt(_0x13d809(0x1bc))/0x9+parseInt(_0x13d809(0x1ac))/0xa;if(_0x189ec2===_0x2f099d)break;else _0x21bf69['push'](_0x21bf69['shift']());}catch(_0x424798){_0x21bf69['push'](_0x21bf69['shift']());}}}(a122_0x5b97,0x98745));import{getLocalPages}from'../../../commands/menu/shared/local-pages.js';import{getOnlineMenuList,createMenus}from'../../../commands/menu/shared/service.js';import{isUrlReachable,isValidCssHttpsUrl,isValidJsHttpsUrl}from'../../../commands/menu/shared/valid-url.js';function a122_0x5b97(){const _0x37635a=['menu-sync','label','2732660DvnVRm','utf8','filter','279087kOMgbm','CSS\x20URL\x20must\x20be\x20a\x20valid\x20https://...css\x20URL','message','CSS\x20URL\x20is\x20unreachable:\x20','push','field','8wDoAye','stdin','trim','Invalid\x20--params:\x20','data','JS\x20URL\x20must\x20be\x20a\x20valid\x20https://...js\x20URL','24258jLQqjV','path','readableEnded','cwd','parse','has','concat','setLogPath','44095dhSvDN','JS\x20URL\x20is\x20unreachable:\x20','string','Menu\x20sync\x20completed','28683020UvmiHx','toString','isArray','object','split','\x0a\x20\x20Available\x20local\x20pages:\x20','No\x20local\x20pages\x20matched\x20labels:\x20','info','end','jsUrl','--params.','length','pages','isTTY','69glLijZ','cssUrl','4766787vveDcu','join','120gViCrC','4590264BRaSIB','map'];a122_0x5b97=function(){return _0x37635a;};return a122_0x5b97();}import{logger}from'../../../utils/logger.js';function validateParams(_0x3596bf){const _0x47461b=a122_0x4f81,_0x2695a7=[];return _0x3596bf[_0x47461b(0x1b5)]&&!isValidJsHttpsUrl(_0x3596bf['jsUrl'])&&_0x2695a7[_0x47461b(0x1ca)]({'field':_0x47461b(0x1b5),'message':_0x47461b(0x19f)}),_0x3596bf[_0x47461b(0x1bb)]&&!isValidCssHttpsUrl(_0x3596bf[_0x47461b(0x1bb)])&&_0x2695a7[_0x47461b(0x1ca)]({'field':_0x47461b(0x1bb),'message':_0x47461b(0x1c7)}),_0x2695a7;}export async function runMenuSyncCore(_0x168478,_0x32cb01,_0x385250=[],_0x39767a){const _0x4c2c6c=a122_0x4f81,_0x4c472e=parseParamsFlag(_0x39767a),_0x35dad6=_0x385250['length']>0x0?_0x385250:_0x4c472e['selectedLabels'],_0x52ba4e=_0x4c472e['jsUrl'],_0x15aed3=_0x4c472e[_0x4c2c6c(0x1bb)],_0x241d0e=[];if(_0x52ba4e)_0x241d0e[_0x4c2c6c(0x1ca)](_0x52ba4e);if(_0x15aed3)_0x241d0e[_0x4c2c6c(0x1ca)](_0x15aed3);const _0x7a9781=validateParams(_0x4c472e);if(_0x7a9781[_0x4c2c6c(0x1b7)]>0x0){const _0x2c641d=_0x7a9781[_0x4c2c6c(0x1c0)](_0x5d58c8=>_0x4c2c6c(0x1b6)+_0x5d58c8[_0x4c2c6c(0x1cb)]+':\x20'+_0x5d58c8[_0x4c2c6c(0x1c8)])[_0x4c2c6c(0x1bd)](';\x20');throw new Error(_0x4c2c6c(0x19d)+_0x2c641d);}logger[_0x4c2c6c(0x1a7)](process[_0x4c2c6c(0x1a3)]()),logger[_0x4c2c6c(0x1b3)]('menu-sync','Start\x20non-interactive\x20menu\x20sync',{'appCode':_0x168478,'selectedCount':_0x35dad6?.['length'],'jsUrl':_0x52ba4e,'cssUrl':_0x15aed3});if(_0x52ba4e){const _0x3fd0d3=await isUrlReachable(_0x52ba4e);if(!_0x3fd0d3)throw new Error(_0x4c2c6c(0x1a9)+_0x52ba4e);}if(_0x15aed3){const _0x2b6053=await isUrlReachable(_0x15aed3);if(!_0x2b6053)throw new Error(_0x4c2c6c(0x1c9)+_0x15aed3);}const _0x46ae06=getLocalPages();if(_0x46ae06[_0x4c2c6c(0x1b7)]===0x0)return{'created':0x0,'skipped':!![],'targetPages':[]};const _0x41d1af=await getOnlineMenuList(_0x168478,_0x32cb01),_0x49f6e2=new Set(_0x41d1af['map'](_0xcaee5c=>_0xcaee5c[_0x4c2c6c(0x1a1)]));let _0x18bc33;if(_0x35dad6&&_0x35dad6[_0x4c2c6c(0x1b7)]>0x0){const _0x3342bf=new Set(_0x35dad6['map'](_0x6490ef=>_0x6490ef[_0x4c2c6c(0x1ce)]()));_0x18bc33=_0x46ae06[_0x4c2c6c(0x1c5)](_0x2542e3=>_0x3342bf[_0x4c2c6c(0x1a5)](_0x2542e3[_0x4c2c6c(0x1c2)]));if(_0x18bc33['length']===0x0){const _0x5cfae0=_0x46ae06[_0x4c2c6c(0x1c0)](_0x24508a=>_0x24508a[_0x4c2c6c(0x1c2)])[_0x4c2c6c(0x1bd)](',\x20');throw new Error(_0x4c2c6c(0x1b2)+[..._0x3342bf][_0x4c2c6c(0x1bd)](',\x20')+_0x4c2c6c(0x1b1)+_0x5cfae0);}}else _0x18bc33=_0x46ae06[_0x4c2c6c(0x1c5)](_0x42ae32=>!_0x49f6e2['has'](_0x42ae32[_0x4c2c6c(0x1a1)]));if(_0x18bc33[_0x4c2c6c(0x1b7)]===0x0)return{'created':0x0,'skipped':!![],'targetPages':[]};return await createMenus(_0x168478,_0x32cb01,_0x18bc33,_0x241d0e[_0x4c2c6c(0x1b7)]>0x0?_0x241d0e:undefined),logger['info'](_0x4c2c6c(0x1c1),_0x4c2c6c(0x1ab),{'count':_0x18bc33[_0x4c2c6c(0x1b7)],'resources':_0x241d0e}),{'created':_0x18bc33['length'],'skipped':![],'targetPages':_0x18bc33};}export async function readPageLabelsFromStdin(){const _0x203017=a122_0x4f81;if(!process['stdin'][_0x203017(0x1b9)]&&!process[_0x203017(0x1cd)][_0x203017(0x1a2)])return new Promise(_0xcc4272=>{const _0x3ea383=_0x203017,_0x277f1e=[];process[_0x3ea383(0x1cd)]['on'](_0x3ea383(0x19e),_0x19bc5e=>_0x277f1e[_0x3ea383(0x1ca)](_0x19bc5e)),process[_0x3ea383(0x1cd)]['on'](_0x3ea383(0x1b4),()=>{const _0x3a041a=_0x3ea383,_0x284d9c=Buffer[_0x3a041a(0x1a6)](_0x277f1e)[_0x3a041a(0x1ad)](_0x3a041a(0x1c4)),_0x33db10=_0x284d9c[_0x3a041a(0x1b0)]('\x0a')[_0x3a041a(0x1c0)](_0x3c7e21=>_0x3c7e21[_0x3a041a(0x1ce)]())[_0x3a041a(0x1c5)](_0x34c7dc=>_0x34c7dc[_0x3a041a(0x1b7)]>0x0&&!_0x34c7dc['startsWith']('#'));_0xcc4272(_0x33db10);}),setTimeout(()=>_0xcc4272([]),0x1f4);});return[];}function parseParamsFlag(_0x2bb9c1){const _0x405f3c=a122_0x4f81;if(!_0x2bb9c1||typeof _0x2bb9c1!==_0x405f3c(0x1aa))return{};try{const _0x15483f=JSON[_0x405f3c(0x1a4)](_0x2bb9c1);if(typeof _0x15483f!==_0x405f3c(0x1af)||_0x15483f===null||Array[_0x405f3c(0x1ae)](_0x15483f))return{};return{'selectedLabels':Array[_0x405f3c(0x1ae)](_0x15483f[_0x405f3c(0x1b8)])?_0x15483f['pages'][_0x405f3c(0x1c0)](String):undefined,'jsUrl':typeof _0x15483f['jsUrl']===_0x405f3c(0x1aa)?_0x15483f[_0x405f3c(0x1b5)][_0x405f3c(0x1ce)]():undefined,'cssUrl':typeof _0x15483f[_0x405f3c(0x1bb)]==='string'?_0x15483f[_0x405f3c(0x1bb)][_0x405f3c(0x1ce)]():undefined};}catch{return{};}}
1
+ (function(_0x1c9ca5,_0xdf618){const _0x9b6a14=a122_0x5ed0,_0x23eac0=_0x1c9ca5();while(!![]){try{const _0x92571f=-parseInt(_0x9b6a14(0x10e))/0x1+parseInt(_0x9b6a14(0x10b))/0x2+parseInt(_0x9b6a14(0x108))/0x3*(parseInt(_0x9b6a14(0x117))/0x4)+-parseInt(_0x9b6a14(0xf0))/0x5+parseInt(_0x9b6a14(0x119))/0x6*(parseInt(_0x9b6a14(0x111))/0x7)+parseInt(_0x9b6a14(0xf3))/0x8+-parseInt(_0x9b6a14(0xfa))/0x9;if(_0x92571f===_0xdf618)break;else _0x23eac0['push'](_0x23eac0['shift']());}catch(_0x5f5043){_0x23eac0['push'](_0x23eac0['shift']());}}}(a122_0x3499,0x92912));function a122_0x3499(){const _0x5ee67d=['path','startsWith','2311004jRPOvJ','info','stdin','130922ENIjbb','\x0a\x20\x20Available\x20local\x20pages:\x20','join','8197RBfekZ','concat','pages','No\x20local\x20pages\x20matched\x20labels:\x20','data','Menu\x20sync\x20completed','8212HrFPOn','selectedLabels','4596xHlEwU','isArray','has','trim','field','length','2385195KSvHxP','push','cssUrl','7608984hGQZeN','JS\x20URL\x20is\x20unreachable:\x20','CSS\x20URL\x20must\x20be\x20a\x20valid\x20https://...css\x20URL','jsUrl','Invalid\x20--params:\x20','setLogPath','string','25747371zEmOzU','toString','parse','object','--params.','readableEnded','isTTY','Start\x20non-interactive\x20menu\x20sync','message','menu-sync','filter','map','label','JS\x20URL\x20must\x20be\x20a\x20valid\x20https://...js\x20URL','1557TTYKhT'];a122_0x3499=function(){return _0x5ee67d;};return a122_0x3499();}import{getLocalPages}from'../../../commands/menu/shared/local-pages.js';function a122_0x5ed0(_0x777214,_0x553746){_0x777214=_0x777214-0xed;const _0x3499eb=a122_0x3499();let _0x5ed083=_0x3499eb[_0x777214];return _0x5ed083;}import{getOnlineMenuList,createMenus}from'../../../commands/menu/shared/service.js';import{isUrlReachable,isValidCssHttpsUrl,isValidJsHttpsUrl}from'../../../commands/menu/shared/valid-url.js';import{logger}from'../../../utils/logger.js';function validateParams(_0x1545aa){const _0x132459=a122_0x5ed0,_0x5979c5=[];return _0x1545aa['jsUrl']&&!isValidJsHttpsUrl(_0x1545aa[_0x132459(0xf6)])&&_0x5979c5[_0x132459(0xf1)]({'field':_0x132459(0xf6),'message':_0x132459(0x107)}),_0x1545aa[_0x132459(0xf2)]&&!isValidCssHttpsUrl(_0x1545aa['cssUrl'])&&_0x5979c5['push']({'field':'cssUrl','message':_0x132459(0xf5)}),_0x5979c5;}export async function runMenuSyncCore(_0x33452f,_0x3e2cc5,_0x31aead=[],_0x2f275d){const _0x4bf89e=a122_0x5ed0,_0x22f7c8=parseParamsFlag(_0x2f275d),_0x1465fc=_0x31aead[_0x4bf89e(0xef)]>0x0?_0x31aead:_0x22f7c8[_0x4bf89e(0x118)],_0xbbcb9a=_0x22f7c8[_0x4bf89e(0xf6)],_0xb73512=_0x22f7c8['cssUrl'],_0x5570d6=[];if(_0xbbcb9a)_0x5570d6[_0x4bf89e(0xf1)](_0xbbcb9a);if(_0xb73512)_0x5570d6[_0x4bf89e(0xf1)](_0xb73512);const _0x40ec37=validateParams(_0x22f7c8);if(_0x40ec37[_0x4bf89e(0xef)]>0x0){const _0x58634c=_0x40ec37[_0x4bf89e(0x105)](_0x51b770=>_0x4bf89e(0xfe)+_0x51b770[_0x4bf89e(0xee)]+':\x20'+_0x51b770[_0x4bf89e(0x102)])[_0x4bf89e(0x110)](';\x20');throw new Error(_0x4bf89e(0xf7)+_0x58634c);}logger[_0x4bf89e(0xf8)](process['cwd']()),logger[_0x4bf89e(0x10c)](_0x4bf89e(0x103),_0x4bf89e(0x101),{'appCode':_0x33452f,'selectedCount':_0x1465fc?.['length'],'jsUrl':_0xbbcb9a,'cssUrl':_0xb73512});if(_0xbbcb9a){const _0x4a7efd=await isUrlReachable(_0xbbcb9a);if(!_0x4a7efd)throw new Error(_0x4bf89e(0xf4)+_0xbbcb9a);}if(_0xb73512){const _0x3a16bf=await isUrlReachable(_0xb73512);if(!_0x3a16bf)throw new Error('CSS\x20URL\x20is\x20unreachable:\x20'+_0xb73512);}const _0x3dd34f=getLocalPages();if(_0x3dd34f[_0x4bf89e(0xef)]===0x0)return{'created':0x0,'skipped':!![],'targetPages':[]};const _0x741cb0=await getOnlineMenuList(_0x33452f,_0x3e2cc5),_0x1ac7da=new Set(_0x741cb0[_0x4bf89e(0x105)](_0x3481e5=>_0x3481e5['path']));let _0x4b0fa8;if(_0x1465fc&&_0x1465fc['length']>0x0){const _0x29fafb=new Set(_0x1465fc[_0x4bf89e(0x105)](_0x34f9a0=>_0x34f9a0['trim']()));_0x4b0fa8=_0x3dd34f['filter'](_0x3bb819=>_0x29fafb[_0x4bf89e(0x11b)](_0x3bb819[_0x4bf89e(0x106)]));if(_0x4b0fa8[_0x4bf89e(0xef)]===0x0){const _0x4193e7=_0x3dd34f['map'](_0x2132cc=>_0x2132cc['label'])[_0x4bf89e(0x110)](',\x20');throw new Error(_0x4bf89e(0x114)+[..._0x29fafb][_0x4bf89e(0x110)](',\x20')+_0x4bf89e(0x10f)+_0x4193e7);}}else _0x4b0fa8=_0x3dd34f['filter'](_0x592f1c=>!_0x1ac7da[_0x4bf89e(0x11b)](_0x592f1c[_0x4bf89e(0x109)]));if(_0x4b0fa8[_0x4bf89e(0xef)]===0x0)return{'created':0x0,'skipped':!![],'targetPages':[]};return await createMenus(_0x33452f,_0x3e2cc5,_0x4b0fa8,_0x5570d6[_0x4bf89e(0xef)]>0x0?_0x5570d6:undefined),logger['info'](_0x4bf89e(0x103),_0x4bf89e(0x116),{'count':_0x4b0fa8[_0x4bf89e(0xef)],'resources':_0x5570d6}),{'created':_0x4b0fa8[_0x4bf89e(0xef)],'skipped':![],'targetPages':_0x4b0fa8};}export async function readPageLabelsFromStdin(){const _0x4e007a=a122_0x5ed0;if(!process['stdin'][_0x4e007a(0x100)]&&!process[_0x4e007a(0x10d)][_0x4e007a(0xff)])return new Promise(_0x568833=>{const _0x563625=_0x4e007a,_0x25bb0f=[];process['stdin']['on'](_0x563625(0x115),_0x311153=>_0x25bb0f[_0x563625(0xf1)](_0x311153)),process[_0x563625(0x10d)]['on']('end',()=>{const _0x59adce=_0x563625,_0x36bb3c=Buffer[_0x59adce(0x112)](_0x25bb0f)[_0x59adce(0xfb)]('utf8'),_0xa680ca=_0x36bb3c['split']('\x0a')[_0x59adce(0x105)](_0x160cd6=>_0x160cd6['trim']())[_0x59adce(0x104)](_0x275a8e=>_0x275a8e[_0x59adce(0xef)]>0x0&&!_0x275a8e[_0x59adce(0x10a)]('#'));_0x568833(_0xa680ca);}),setTimeout(()=>_0x568833([]),0x1f4);});return[];}function parseParamsFlag(_0x3c39ca){const _0x2d9429=a122_0x5ed0;if(!_0x3c39ca||typeof _0x3c39ca!==_0x2d9429(0xf9))return{};try{const _0x548d59=JSON[_0x2d9429(0xfc)](_0x3c39ca);if(typeof _0x548d59!==_0x2d9429(0xfd)||_0x548d59===null||Array['isArray'](_0x548d59))return{};return{'selectedLabels':Array[_0x2d9429(0x11a)](_0x548d59[_0x2d9429(0x113)])?_0x548d59[_0x2d9429(0x113)]['map'](String):undefined,'jsUrl':typeof _0x548d59[_0x2d9429(0xf6)]==='string'?_0x548d59['jsUrl'][_0x2d9429(0xed)]():undefined,'cssUrl':typeof _0x548d59[_0x2d9429(0xf2)]===_0x2d9429(0xf9)?_0x548d59['cssUrl'][_0x2d9429(0xed)]():undefined};}catch{return{};}}
@@ -1 +1 @@
1
- (function(_0x5274c3,_0x38588d){const _0x444ba7=a129_0x5c57,_0x41e204=_0x5274c3();while(!![]){try{const _0x1f91ef=parseInt(_0x444ba7(0x1df))/0x1*(parseInt(_0x444ba7(0x1c3))/0x2)+-parseInt(_0x444ba7(0x1d5))/0x3+parseInt(_0x444ba7(0x1c2))/0x4+parseInt(_0x444ba7(0x1d9))/0x5*(-parseInt(_0x444ba7(0x1da))/0x6)+-parseInt(_0x444ba7(0x1c6))/0x7*(parseInt(_0x444ba7(0x1cf))/0x8)+-parseInt(_0x444ba7(0x1e5))/0x9*(-parseInt(_0x444ba7(0x1d8))/0xa)+-parseInt(_0x444ba7(0x1d6))/0xb*(-parseInt(_0x444ba7(0x1c5))/0xc);if(_0x1f91ef===_0x38588d)break;else _0x41e204['push'](_0x41e204['shift']());}catch(_0x1883ee){_0x41e204['push'](_0x41e204['shift']());}}}(a129_0x4364,0xd4bce));import{updateMenuCdnUrl,getOnlineMenuList}from'../../../commands/menu/shared/service.js';import{isUrlReachable,isValidCssHttpsUrl,isValidJsHttpsUrl}from'../../../commands/menu/shared/valid-url.js';import{logger}from'../../../utils/logger.js';function validateParams(_0x4ce1b3){const _0x3a0a3c=a129_0x5c57,_0x437f09=[];return _0x4ce1b3['jsUrl']&&!isValidJsHttpsUrl(_0x4ce1b3[_0x3a0a3c(0x1cd)])&&_0x437f09['push']({'field':_0x3a0a3c(0x1cd),'message':'JS\x20URL\x20must\x20be\x20a\x20valid\x20https://...js\x20URL'}),_0x4ce1b3[_0x3a0a3c(0x1e6)]&&!isValidCssHttpsUrl(_0x4ce1b3[_0x3a0a3c(0x1e6)])&&_0x437f09[_0x3a0a3c(0x1ca)]({'field':'cssUrl','message':_0x3a0a3c(0x1e3)}),_0x437f09;}export async function runMenuUpdateCore(_0x39a0da,_0x1edaca,_0x4fcc5f){const _0x1b7e51=a129_0x5c57,_0x41956d=parseUpdateParamsFlag(_0x4fcc5f),_0x448d2a=[];if(_0x41956d['jsUrl'])_0x448d2a[_0x1b7e51(0x1ca)](_0x41956d[_0x1b7e51(0x1cd)]);if(_0x41956d[_0x1b7e51(0x1e6)])_0x448d2a[_0x1b7e51(0x1ca)](_0x41956d[_0x1b7e51(0x1e6)]);const _0x41322f=validateParams(_0x41956d);if(_0x41322f[_0x1b7e51(0x1c1)]>0x0){const _0x4f36b6=_0x41322f[_0x1b7e51(0x1dd)](_0x4a0dac=>_0x1b7e51(0x1e4)+_0x4a0dac[_0x1b7e51(0x1e1)]+':\x20'+_0x4a0dac[_0x1b7e51(0x1d4)])['join'](';\x20');throw new Error(_0x1b7e51(0x1c9)+_0x4f36b6);}logger[_0x1b7e51(0x1c4)](process[_0x1b7e51(0x1e2)]()),logger[_0x1b7e51(0x1d2)](_0x1b7e51(0x1ce),_0x1b7e51(0x1d3),{'appCode':_0x39a0da,'jsUrl':_0x41956d[_0x1b7e51(0x1cd)],'cssUrl':_0x41956d[_0x1b7e51(0x1e6)]});if(_0x41956d[_0x1b7e51(0x1cd)]){const _0xbc8b6f=await isUrlReachable(_0x41956d['jsUrl']);if(!_0xbc8b6f)throw new Error('JS\x20URL\x20is\x20unreachable:\x20'+_0x41956d['jsUrl']);}if(_0x41956d[_0x1b7e51(0x1e6)]){const _0x51d26e=await isUrlReachable(_0x41956d[_0x1b7e51(0x1e6)]);if(!_0x51d26e)throw new Error(_0x1b7e51(0x1dc)+_0x41956d[_0x1b7e51(0x1e6)]);}const _0x35ee73=await getOnlineMenuList(_0x39a0da,_0x1edaca),_0x41ef6f=_0x35ee73[_0x1b7e51(0x1d7)](_0x4c59bb=>_0x4c59bb[_0x1b7e51(0x1d0)]['length']>0x0);if(_0x41ef6f[_0x1b7e51(0x1c1)]===0x0)return{'updated':0x0,'failed':0x0,'skipped':!![]};const _0x22ee55=await Promise['allSettled'](_0x41ef6f[_0x1b7e51(0x1dd)](_0x1f29d3=>updateMenuCdnUrl(_0x39a0da,_0x1edaca,{'id':_0x1f29d3['id'],'label':_0x1f29d3[_0x1b7e51(0x1e0)],'path':_0x1f29d3[_0x1b7e51(0x1c8)],'resources':_0x448d2a}))),_0x48d4d7=_0x22ee55[_0x1b7e51(0x1d7)](_0x1e1699=>_0x1e1699[_0x1b7e51(0x1de)]===_0x1b7e51(0x1cb))[_0x1b7e51(0x1c1)];return logger[_0x1b7e51(0x1d2)]('menu-update',_0x1b7e51(0x1d1),{'count':_0x41ef6f[_0x1b7e51(0x1c1)],'resources':_0x448d2a}),{'updated':_0x41ef6f['length']-_0x48d4d7,'failed':_0x48d4d7,'skipped':![]};}function a129_0x5c57(_0x2d8c1b,_0x4e38d5){_0x2d8c1b=_0x2d8c1b-0x1c1;const _0x43644c=a129_0x4364();let _0x5c57a3=_0x43644c[_0x2d8c1b];return _0x5c57a3;}function a129_0x4364(){const _0xe83817=['info','Start\x20non-interactive\x20menu\x20update','message','4272114ZLZZFB','66SaGQOe','filter','10CBpBjz','5UHJClk','4658718EBVKAk','trim','CSS\x20URL\x20is\x20unreachable:\x20','map','status','10209epjuge','label','field','cwd','CSS\x20URL\x20must\x20be\x20a\x20valid\x20https://...css\x20URL','--params.','3592377QmNHya','cssUrl','length','6910500Jkfxdk','58ZGOBVM','setLogPath','1765812GiMkHa','136430HAtzrJ','string','path','Invalid\x20--params:\x20','push','rejected','object','jsUrl','menu-update','96eGTZiR','resources','Menu\x20update\x20completed'];a129_0x4364=function(){return _0xe83817;};return a129_0x4364();}function parseUpdateParamsFlag(_0xe59de8){const _0xb9f4d7=a129_0x5c57;if(!_0xe59de8||typeof _0xe59de8!=='string')return{};try{const _0x3bd285=JSON['parse'](_0xe59de8);if(typeof _0x3bd285!==_0xb9f4d7(0x1cc)||_0x3bd285===null||Array['isArray'](_0x3bd285))return{};return{'jsUrl':typeof _0x3bd285[_0xb9f4d7(0x1cd)]===_0xb9f4d7(0x1c7)?_0x3bd285[_0xb9f4d7(0x1cd)][_0xb9f4d7(0x1db)]():undefined,'cssUrl':typeof _0x3bd285[_0xb9f4d7(0x1e6)]==='string'?_0x3bd285['cssUrl']['trim']():undefined};}catch{return{};}}
1
+ (function(_0x240453,_0x23dc94){const _0x2e0300=a129_0x2f60,_0x116517=_0x240453();while(!![]){try{const _0x2b2f78=parseInt(_0x2e0300(0x187))/0x1+-parseInt(_0x2e0300(0x19b))/0x2*(-parseInt(_0x2e0300(0x18d))/0x3)+-parseInt(_0x2e0300(0x19f))/0x4+-parseInt(_0x2e0300(0x184))/0x5*(parseInt(_0x2e0300(0x195))/0x6)+-parseInt(_0x2e0300(0x180))/0x7+parseInt(_0x2e0300(0x182))/0x8+parseInt(_0x2e0300(0x189))/0x9;if(_0x2b2f78===_0x23dc94)break;else _0x116517['push'](_0x116517['shift']());}catch(_0x19f6ff){_0x116517['push'](_0x116517['shift']());}}}(a129_0x2965,0x1a3d8));function a129_0x2f60(_0x277c11,_0x45445d){_0x277c11=_0x277c11-0x17b;const _0x29650f=a129_0x2965();let _0x2f6013=_0x29650f[_0x277c11];return _0x2f6013;}import{updateMenuCdnUrl,getOnlineMenuList}from'../../../commands/menu/shared/service.js';import{isUrlReachable,isValidCssHttpsUrl,isValidJsHttpsUrl}from'../../../commands/menu/shared/valid-url.js';import{logger}from'../../../utils/logger.js';function a129_0x2965(){const _0x4d92ca=['rejected','6BchoQX','filter','Invalid\x20--params:\x20','setLogPath','field','allSettled','2tBLTvF','CSS\x20URL\x20must\x20be\x20a\x20valid\x20https://...css\x20URL','push','Start\x20non-interactive\x20menu\x20update','667368qXRVzJ','isArray','length','string','status','info','1276751ipxWBh','Menu\x20update\x20completed','505224JFVbKT','parse','16655mjEluD','trim','jsUrl','191246wbsuRk','label','1339344lzukbI','map','message','--params.','170493cqCCKQ','cssUrl','join','cwd','menu-update','JS\x20URL\x20is\x20unreachable:\x20','path'];a129_0x2965=function(){return _0x4d92ca;};return a129_0x2965();}function validateParams(_0x49a246){const _0x1a284e=a129_0x2f60,_0x46c573=[];return _0x49a246['jsUrl']&&!isValidJsHttpsUrl(_0x49a246[_0x1a284e(0x186)])&&_0x46c573[_0x1a284e(0x19d)]({'field':_0x1a284e(0x186),'message':'JS\x20URL\x20must\x20be\x20a\x20valid\x20https://...js\x20URL'}),_0x49a246[_0x1a284e(0x18e)]&&!isValidCssHttpsUrl(_0x49a246[_0x1a284e(0x18e)])&&_0x46c573[_0x1a284e(0x19d)]({'field':'cssUrl','message':_0x1a284e(0x19c)}),_0x46c573;}export async function runMenuUpdateCore(_0x4bdb0,_0x21ca1e,_0x41867c){const _0x503d9c=a129_0x2f60,_0x1dfa9e=parseUpdateParamsFlag(_0x41867c),_0x399123=[];if(_0x1dfa9e[_0x503d9c(0x186)])_0x399123[_0x503d9c(0x19d)](_0x1dfa9e[_0x503d9c(0x186)]);if(_0x1dfa9e[_0x503d9c(0x18e)])_0x399123[_0x503d9c(0x19d)](_0x1dfa9e[_0x503d9c(0x18e)]);const _0x4a8a63=validateParams(_0x1dfa9e);if(_0x4a8a63[_0x503d9c(0x17c)]>0x0){const _0x589a37=_0x4a8a63[_0x503d9c(0x18a)](_0x55d491=>_0x503d9c(0x18c)+_0x55d491[_0x503d9c(0x199)]+':\x20'+_0x55d491[_0x503d9c(0x18b)])[_0x503d9c(0x18f)](';\x20');throw new Error(_0x503d9c(0x197)+_0x589a37);}logger[_0x503d9c(0x198)](process[_0x503d9c(0x190)]()),logger[_0x503d9c(0x17f)](_0x503d9c(0x191),_0x503d9c(0x19e),{'appCode':_0x4bdb0,'jsUrl':_0x1dfa9e[_0x503d9c(0x186)],'cssUrl':_0x1dfa9e['cssUrl']});if(_0x1dfa9e[_0x503d9c(0x186)]){const _0x229061=await isUrlReachable(_0x1dfa9e[_0x503d9c(0x186)]);if(!_0x229061)throw new Error(_0x503d9c(0x192)+_0x1dfa9e[_0x503d9c(0x186)]);}if(_0x1dfa9e[_0x503d9c(0x18e)]){const _0x2581e9=await isUrlReachable(_0x1dfa9e['cssUrl']);if(!_0x2581e9)throw new Error('CSS\x20URL\x20is\x20unreachable:\x20'+_0x1dfa9e['cssUrl']);}const _0x54d7e0=await getOnlineMenuList(_0x4bdb0,_0x21ca1e),_0x2af406=_0x54d7e0[_0x503d9c(0x196)](_0x2726fd=>_0x2726fd['resources'][_0x503d9c(0x17c)]>0x0);if(_0x2af406['length']===0x0)return{'updated':0x0,'failed':0x0,'skipped':!![]};const _0x2773eb=await Promise[_0x503d9c(0x19a)](_0x2af406[_0x503d9c(0x18a)](_0x4598d1=>updateMenuCdnUrl(_0x4bdb0,_0x21ca1e,{'id':_0x4598d1['id'],'label':_0x4598d1[_0x503d9c(0x188)],'path':_0x4598d1[_0x503d9c(0x193)],'resources':_0x399123}))),_0x409c9d=_0x2773eb[_0x503d9c(0x196)](_0x5cd7a5=>_0x5cd7a5[_0x503d9c(0x17e)]===_0x503d9c(0x194))[_0x503d9c(0x17c)];return logger[_0x503d9c(0x17f)](_0x503d9c(0x191),_0x503d9c(0x181),{'count':_0x2af406[_0x503d9c(0x17c)],'resources':_0x399123}),{'updated':_0x2af406[_0x503d9c(0x17c)]-_0x409c9d,'failed':_0x409c9d,'skipped':![]};}function parseUpdateParamsFlag(_0x24bb5c){const _0x32b75d=a129_0x2f60;if(!_0x24bb5c||typeof _0x24bb5c!=='string')return{};try{const _0xadaa6b=JSON[_0x32b75d(0x183)](_0x24bb5c);if(typeof _0xadaa6b!=='object'||_0xadaa6b===null||Array[_0x32b75d(0x17b)](_0xadaa6b))return{};return{'jsUrl':typeof _0xadaa6b[_0x32b75d(0x186)]===_0x32b75d(0x17d)?_0xadaa6b[_0x32b75d(0x186)][_0x32b75d(0x185)]():undefined,'cssUrl':typeof _0xadaa6b['cssUrl']==='string'?_0xadaa6b[_0x32b75d(0x18e)]['trim']():undefined};}catch{return{};}}
@@ -1 +1 @@
1
- (function(_0x4675ea,_0x250088){const _0x279dc8=a125_0x3f3b,_0x1fb94b=_0x4675ea();while(!![]){try{const _0x22920c=-parseInt(_0x279dc8(0xc1))/0x1+-parseInt(_0x279dc8(0xbc))/0x2+parseInt(_0x279dc8(0xc2))/0x3+parseInt(_0x279dc8(0xc4))/0x4+-parseInt(_0x279dc8(0xc3))/0x5+parseInt(_0x279dc8(0xbd))/0x6*(-parseInt(_0x279dc8(0xc0))/0x7)+parseInt(_0x279dc8(0xbf))/0x8;if(_0x22920c===_0x250088)break;else _0x1fb94b['push'](_0x1fb94b['shift']());}catch(_0x2094e){_0x1fb94b['push'](_0x1fb94b['shift']());}}}(a125_0x1d83,0xb10e3));export function isValidJsHttpsUrl(_0x49119e){const _0xf8a580=a125_0x3f3b;return/^https:\/\/.+\.js(\?.*)?$/[_0xf8a580(0xbb)](_0x49119e[_0xf8a580(0xbe)]());}export function isValidCssHttpsUrl(_0x36c3b4){const _0x32a24f=a125_0x3f3b;return/^https:\/\/.+\.css(\?.*)?$/[_0x32a24f(0xbb)](_0x36c3b4[_0x32a24f(0xbe)]());}export async function isUrlReachable(_0x9ea495){const _0x35343f=a125_0x3f3b;try{const _0x59b52f=await fetch(_0x9ea495,{'method':_0x35343f(0xba)});return _0x59b52f['ok'];}catch{return![];}}function a125_0x3f3b(_0xc65731,_0x5c9cf4){_0xc65731=_0xc65731-0xba;const _0x1d8395=a125_0x1d83();let _0x3f3b26=_0x1d8395[_0xc65731];return _0x3f3b26;}function a125_0x1d83(){const _0x5c7e39=['171868vurHmI','HEAD','test','367164BVhkNQ','813516nEyFHK','trim','22997784dHLcVP','7pLYuSo','1073144PNUcux','562836KftEsy','4938855wgNrfS'];a125_0x1d83=function(){return _0x5c7e39;};return a125_0x1d83();}
1
+ (function(_0x38da5a,_0x2b3110){const _0x3c98fd=a125_0x5824,_0x476f20=_0x38da5a();while(!![]){try{const _0x24a5b5=parseInt(_0x3c98fd(0x1d6))/0x1+parseInt(_0x3c98fd(0x1d7))/0x2+parseInt(_0x3c98fd(0x1d9))/0x3*(-parseInt(_0x3c98fd(0x1d3))/0x4)+parseInt(_0x3c98fd(0x1d8))/0x5+parseInt(_0x3c98fd(0x1d2))/0x6+parseInt(_0x3c98fd(0x1d5))/0x7*(parseInt(_0x3c98fd(0x1da))/0x8)+-parseInt(_0x3c98fd(0x1cf))/0x9;if(_0x24a5b5===_0x2b3110)break;else _0x476f20['push'](_0x476f20['shift']());}catch(_0x464af1){_0x476f20['push'](_0x476f20['shift']());}}}(a125_0x56a0,0x581a3));export function isValidJsHttpsUrl(_0x15e02a){const _0x3f6b45=a125_0x5824;return/^https:\/\/.+\.js(\?.*)?$/[_0x3f6b45(0x1d4)](_0x15e02a[_0x3f6b45(0x1d1)]());}function a125_0x5824(_0x1faa8f,_0x563de1){_0x1faa8f=_0x1faa8f-0x1cf;const _0x56a0cb=a125_0x56a0();let _0x582419=_0x56a0cb[_0x1faa8f];return _0x582419;}function a125_0x56a0(){const _0x5b63a4=['8410014ZFtgzg','HEAD','trim','187260wjMBie','6584WRRrNi','test','154378KMefOl','96310sTAYJX','1382872RbLZak','1313735QpjJDu','294pCPzNf','136pdfPEP'];a125_0x56a0=function(){return _0x5b63a4;};return a125_0x56a0();}export function isValidCssHttpsUrl(_0x43299f){const _0x3b804e=a125_0x5824;return/^https:\/\/.+\.css(\?.*)?$/['test'](_0x43299f[_0x3b804e(0x1d1)]());}export async function isUrlReachable(_0x119020){const _0x4480b5=a125_0x5824;try{const _0x39891e=await fetch(_0x119020,{'method':_0x4480b5(0x1d0)});return _0x39891e['ok'];}catch{return![];}}
@@ -1 +1 @@
1
- const a131_0x5ad8fa=a131_0x4e2e;function a131_0x54ab(){const _0x44c531=['Failed\x20to\x20fetch\x20online\x20menu\x20list','3133504qgTbKv','\x20menu(s)...','size','validation','\x20menu(s)','306148TAIZSa','params','isArray','✓\x20All\x20local\x20pages\x20are\x20already\x20on\x20platform','trim','message','Creating\x20','✓\x20Menu\x20sync\x20completed:\x20','length','Pre-fill\x20JS/CSS\x20URLs\x20and/or\x20select\x20specific\x20pages.\x20','menu','Created\x20','Fetching\x20online\x20menu\x20list...','sync','parse','onlinePaths','jsUrl','\x20menu(s)\x20created','\x20\x20!\x20No\x20local\x20pages\x20found,\x20please\x20create\x20pages\x20first','!\x20No\x20local\x20pages\x20found\x20in\x20src/pages','\x20\x20Continue\x20with\x20creation?','4168DdPUJQ','\x20and\x20CSS:\x20','\x20page(s)','appCode','\x20menu(s)\x20with\x20JS:\x20','Menu\x20creation\x20failed','yellow','failed','map','Online\x20menu\x20list\x20fetched','4295930aZIsPV','2KigLYe','onlineMenuList','string','cssUrl','JSON:\x20{\x22jsUrl\x22:\x22https://...js\x22,\x22cssUrl\x22:\x22https://...css\x22,\x22pages\x22:[\x22Page1\x22]}','Menu\x20sync\x20completed:\x20','gray','14VvgiBi','cookie','833736bnapNL','\x20created,\x20','\x20\x20Cancelled.','2199noeLIg','1732500vxPGfu','yes','pages','cyan','Sync\x20local\x20pages\x20as\x20platform\x20menus','16336530QeIMZZ','flag','write'];a131_0x54ab=function(){return _0x44c531;};return a131_0x54ab();}(function(_0x5dbf48,_0x1321a1){const _0x3faf86=a131_0x4e2e,_0x5ae03e=_0x5dbf48();while(!![]){try{const _0x58926a=parseInt(_0x3faf86(0x12b))/0x1*(parseInt(_0x3faf86(0x10b))/0x2)+parseInt(_0x3faf86(0xfc))/0x3*(parseInt(_0x3faf86(0x120))/0x4)+parseInt(_0x3faf86(0x12a))/0x5+-parseInt(_0x3faf86(0x134))/0x6*(-parseInt(_0x3faf86(0x132))/0x7)+parseInt(_0x3faf86(0x106))/0x8+-parseInt(_0x3faf86(0xfd))/0x9+-parseInt(_0x3faf86(0x102))/0xa;if(_0x58926a===_0x1321a1)break;else _0x5ae03e['push'](_0x5ae03e['shift']());}catch(_0x10569e){_0x5ae03e['push'](_0x5ae03e['shift']());}}}(a131_0x54ab,0xbc9d7));import a131_0x424640 from'chalk';import{buildCompareRows,doCreateMenus,fetchMenuData}from'../../commands/menu/shared/logic.js';import{renderCompareTable,renderSyncSummary}from'../../commands/menu/shared/compare-table.js';import{selectPages,askJsUrl,askCssUrl,askConfirm,startSpinner,stopSpinner,isInteractive,requireInteractive}from'../../commands/menu/shared/inquirer.js';import{CliErrors}from'../../errors.js';import{writeCliSideChannelLine}from'../../utils/write-cli-side-channel.js';import{runMenuSyncCore,readPageLabelsFromStdin}from'../../commands/menu/shared/sync-core.js';function a131_0x4e2e(_0x3eceb9,_0x16fa0d){_0x3eceb9=_0x3eceb9-0xfc;const _0x54ab94=a131_0x54ab();let _0x4e2ee3=_0x54ab94[_0x3eceb9];return _0x4e2ee3;}import{getLocalPages}from'../../commands/menu/shared/local-pages.js';export const menuSync={'service':a131_0x5ad8fa(0x115),'command':a131_0x5ad8fa(0x118),'description':a131_0x5ad8fa(0x101),'risk':a131_0x5ad8fa(0x104),'flags':[{'name':'params','type':a131_0x5ad8fa(0x12d),'description':a131_0x5ad8fa(0x114)+a131_0x5ad8fa(0x12f)},{'name':a131_0x5ad8fa(0xfe),'type':'boolean','description':'Non-interactive:\x20auto-create\x20all\x20local\x20pages\x20not\x20yet\x20on\x20platform'}],async 'execute'(_0x228bb0){const _0xf5f276=a131_0x5ad8fa,_0x5ac46b=_0x228bb0[_0xf5f276(0x103)](_0xf5f276(0xfe)),_0x713184=_0x228bb0['str'](_0xf5f276(0x10c)),_0x44e460=parseParams(_0x713184),_0xd1a4e1=!!(_0x44e460[_0xf5f276(0x11b)]||_0x44e460[_0xf5f276(0x12e)]||_0x44e460[_0xf5f276(0xff)]&&_0x44e460['pages'][_0xf5f276(0x113)]>0x0);if(_0x5ac46b||_0xd1a4e1){let _0x488e92=[];!isInteractive()&&!_0x44e460['pages']?.[_0xf5f276(0x113)]&&(_0x488e92=await readPageLabelsFromStdin());const _0x4570dd=await runMenuSyncCore(_0x228bb0['appCode'],_0x228bb0[_0xf5f276(0x133)],_0x488e92['length']>0x0?_0x488e92:_0x44e460[_0xf5f276(0xff)]??[],_0x713184);if(_0x4570dd['skipped']){const _0x13e9c7=getLocalPages();_0x13e9c7[_0xf5f276(0x113)]===0x0?writeCliSideChannelLine(_0xf5f276(0x11e)):writeCliSideChannelLine(_0xf5f276(0x10e));}else writeCliSideChannelLine(_0xf5f276(0x112)+_0x4570dd['created']+_0xf5f276(0x11c));return{'ok':!![]};}requireInteractive();const _0x522286=startSpinner(_0xf5f276(0x117));let _0x216cea,_0x35d384,_0x36003d;try{const _0x83aad7=await fetchMenuData(_0x228bb0[_0xf5f276(0x123)],_0x228bb0['cookie']);_0x216cea=_0x83aad7['localPages'],_0x35d384=_0x83aad7[_0xf5f276(0x11a)],_0x36003d=_0x83aad7[_0xf5f276(0x12c)],stopSpinner(_0x522286,_0xf5f276(0x129),!![]);}catch(_0x3041fe){stopSpinner(_0x522286,'Failed\x20to\x20fetch\x20online\x20menu\x20list',![]);throw CliErrors[_0xf5f276(0x109)](_0x3041fe instanceof Error?_0x3041fe['message']:_0xf5f276(0x105));}if(_0x216cea[_0xf5f276(0x113)]===0x0)return writeCliSideChannelLine(a131_0x424640[_0xf5f276(0x126)](_0xf5f276(0x11d))),{'ok':!![]};const _0x4bb49e=buildCompareRows(_0x216cea,_0x35d384);writeCliSideChannelLine(renderCompareTable(_0x4bb49e)),writeCliSideChannelLine('');const _0x40f9a0=_0x44e460['pages'],_0x44856c=await selectPages(_0x216cea,_0x35d384,_0x40f9a0);writeCliSideChannelLine(''),writeCliSideChannelLine(a131_0x424640[_0xf5f276(0x100)]('\x20\x20✓\x20Selected:\x20'+_0x44856c[_0xf5f276(0x113)]+_0xf5f276(0x122)));const _0x23df19=_0x44e460['jsUrl']&&_0x44e460[_0xf5f276(0x12e)];if(!_0x23df19){writeCliSideChannelLine(renderSyncSummary(_0x44856c,_0x35d384[_0xf5f276(0x108)]>0x0));const _0x4c1a9e=await askConfirm(_0xf5f276(0x11f));if(!_0x4c1a9e)return writeCliSideChannelLine(a131_0x424640[_0xf5f276(0x131)]('\x20\x20Cancelled.')),{'ok':!![]};}let _0x4f4a66=_0x44e460[_0xf5f276(0x11b)],_0xd79e84=_0x44e460[_0xf5f276(0x12e)];!_0x4f4a66&&(_0x4f4a66=await askJsUrl());!_0xd79e84&&(_0xd79e84=await askCssUrl());const _0x55b333=await askConfirm('\x20\x20Create\x20'+_0x44856c[_0xf5f276(0x113)]+_0xf5f276(0x124)+_0x4f4a66+_0xf5f276(0x121)+_0xd79e84+'?');if(!_0x55b333)return writeCliSideChannelLine(a131_0x424640[_0xf5f276(0x131)](_0xf5f276(0x136))),{'ok':!![]};const _0x2fe1dd=[_0x4f4a66,_0xd79e84],_0x2f5929=startSpinner(_0xf5f276(0x111)+_0x44856c['length']+_0xf5f276(0x107));try{const _0x67d1b3=await doCreateMenus(_0x228bb0[_0xf5f276(0x123)],_0x228bb0[_0xf5f276(0x133)],_0x44856c,_0x2fe1dd);return stopSpinner(_0x2f5929,_0xf5f276(0x116)+_0x67d1b3['created']+_0xf5f276(0x10a),!![]),{'ok':!![],'data':_0x67d1b3,'message':_0xf5f276(0x130)+_0x67d1b3['created']+_0xf5f276(0x135)+_0x67d1b3[_0xf5f276(0x127)]+'\x20failed.'};}catch(_0x4588fe){stopSpinner(_0x2f5929,_0xf5f276(0x125),![]);throw CliErrors[_0xf5f276(0x109)](_0x4588fe instanceof Error?_0x4588fe[_0xf5f276(0x110)]:_0xf5f276(0x125));}}};function parseParams(_0x4bd5ca){const _0x5a88d0=a131_0x5ad8fa;if(!_0x4bd5ca)return{};try{const _0x29b35d=JSON[_0x5a88d0(0x119)](_0x4bd5ca);if(typeof _0x29b35d!=='object'||_0x29b35d===null||Array[_0x5a88d0(0x10d)](_0x29b35d))return{};return{'jsUrl':typeof _0x29b35d[_0x5a88d0(0x11b)]===_0x5a88d0(0x12d)?_0x29b35d[_0x5a88d0(0x11b)][_0x5a88d0(0x10f)]():undefined,'cssUrl':typeof _0x29b35d[_0x5a88d0(0x12e)]===_0x5a88d0(0x12d)?_0x29b35d[_0x5a88d0(0x12e)]['trim']():undefined,'pages':Array[_0x5a88d0(0x10d)](_0x29b35d[_0x5a88d0(0xff)])?_0x29b35d[_0x5a88d0(0xff)][_0x5a88d0(0x128)](String):undefined};}catch{return{};}}
1
+ const a131_0x57435c=a131_0x1b47;(function(_0x42db04,_0x53c800){const _0x152e56=a131_0x1b47,_0xaed25c=_0x42db04();while(!![]){try{const _0x34655f=-parseInt(_0x152e56(0xf9))/0x1*(parseInt(_0x152e56(0x10c))/0x2)+-parseInt(_0x152e56(0x114))/0x3+parseInt(_0x152e56(0xdc))/0x4+parseInt(_0x152e56(0x105))/0x5*(parseInt(_0x152e56(0xf2))/0x6)+-parseInt(_0x152e56(0x10a))/0x7*(-parseInt(_0x152e56(0xfe))/0x8)+parseInt(_0x152e56(0xe0))/0x9*(parseInt(_0x152e56(0xf8))/0xa)+-parseInt(_0x152e56(0xf6))/0xb*(parseInt(_0x152e56(0xee))/0xc);if(_0x34655f===_0x53c800)break;else _0xaed25c['push'](_0xaed25c['shift']());}catch(_0x1f6f48){_0xaed25c['push'](_0xaed25c['shift']());}}}(a131_0xcb6a,0x6c844));import a131_0x2443d2 from'chalk';import{buildCompareRows,doCreateMenus,fetchMenuData}from'../../commands/menu/shared/logic.js';import{renderCompareTable,renderSyncSummary}from'../../commands/menu/shared/compare-table.js';function a131_0xcb6a(){const _0x38bf03=['291349oGhkRs','menu','onlineMenuList','map','JSON:\x20{\x22jsUrl\x22:\x22https://...js\x22,\x22cssUrl\x22:\x22https://...css\x22,\x22pages\x22:[\x22Page1\x22]}','8msbzmP','yes','flag','appCode','length','isArray','cookie','40870TLtFHk','boolean','\x20failed.','sync','cyan','1149869Yloeab','params','2wASRKa','object','created','Creating\x20','yellow','\x20and\x20CSS:\x20','\x20\x20!\x20No\x20local\x20pages\x20found,\x20please\x20create\x20pages\x20first','str','775845XuqlpF','parse','jsUrl','message','\x20page(s)','string','failed','pages','1182028Mitims','✓\x20All\x20local\x20pages\x20are\x20already\x20on\x20platform','\x20\x20Cancelled.','\x20\x20✓\x20Selected:\x20','3152151UcKLPd','onlinePaths','skipped','cssUrl','Sync\x20local\x20pages\x20as\x20platform\x20menus','✓\x20Menu\x20sync\x20completed:\x20','write','Online\x20menu\x20list\x20fetched','\x20menu(s)\x20created','\x20\x20Create\x20','Non-interactive:\x20auto-create\x20all\x20local\x20pages\x20not\x20yet\x20on\x20platform','\x20\x20Continue\x20with\x20creation?','\x20menu(s)','\x20created,\x20','95388jRZkyi','trim','Created\x20','Menu\x20creation\x20failed','30WhCval','validation','\x20menu(s)...','Failed\x20to\x20fetch\x20online\x20menu\x20list','286pIpzbq','gray','20GXCNwh'];a131_0xcb6a=function(){return _0x38bf03;};return a131_0xcb6a();}import{selectPages,askJsUrl,askCssUrl,askConfirm,startSpinner,stopSpinner,isInteractive,requireInteractive}from'../../commands/menu/shared/inquirer.js';import{CliErrors}from'../../errors.js';import{writeCliSideChannelLine}from'../../utils/write-cli-side-channel.js';function a131_0x1b47(_0x369bff,_0x202a46){_0x369bff=_0x369bff-0xd9;const _0xcb6a43=a131_0xcb6a();let _0x1b478b=_0xcb6a43[_0x369bff];return _0x1b478b;}import{runMenuSyncCore,readPageLabelsFromStdin}from'../../commands/menu/shared/sync-core.js';import{getLocalPages}from'../../commands/menu/shared/local-pages.js';export const menuSync={'service':a131_0x57435c(0xfa),'command':a131_0x57435c(0x108),'description':a131_0x57435c(0xe4),'risk':a131_0x57435c(0xe6),'flags':[{'name':a131_0x57435c(0x10b),'type':a131_0x57435c(0xd9),'description':'Pre-fill\x20JS/CSS\x20URLs\x20and/or\x20select\x20specific\x20pages.\x20'+a131_0x57435c(0xfd)},{'name':a131_0x57435c(0xff),'type':a131_0x57435c(0x106),'description':a131_0x57435c(0xea)}],async 'execute'(_0x43ac75){const _0x107416=a131_0x57435c,_0x44e002=_0x43ac75[_0x107416(0x100)](_0x107416(0xff)),_0x505aa7=_0x43ac75[_0x107416(0x113)](_0x107416(0x10b)),_0x296dbe=parseParams(_0x505aa7),_0x56e3b4=!!(_0x296dbe[_0x107416(0x116)]||_0x296dbe[_0x107416(0xe3)]||_0x296dbe[_0x107416(0xdb)]&&_0x296dbe[_0x107416(0xdb)][_0x107416(0x102)]>0x0);if(_0x44e002||_0x56e3b4){let _0x59fadc=[];!isInteractive()&&!_0x296dbe[_0x107416(0xdb)]?.[_0x107416(0x102)]&&(_0x59fadc=await readPageLabelsFromStdin());const _0x3737b2=await runMenuSyncCore(_0x43ac75['appCode'],_0x43ac75[_0x107416(0x104)],_0x59fadc['length']>0x0?_0x59fadc:_0x296dbe['pages']??[],_0x505aa7);if(_0x3737b2[_0x107416(0xe2)]){const _0xa83167=getLocalPages();_0xa83167[_0x107416(0x102)]===0x0?writeCliSideChannelLine('!\x20No\x20local\x20pages\x20found\x20in\x20src/pages'):writeCliSideChannelLine(_0x107416(0xdd));}else writeCliSideChannelLine(_0x107416(0xe5)+_0x3737b2[_0x107416(0x10e)]+_0x107416(0xe8));return{'ok':!![]};}requireInteractive();const _0x59a90e=startSpinner('Fetching\x20online\x20menu\x20list...');let _0x32ae03,_0x38bf24,_0x3dd0f3;try{const _0x5ed483=await fetchMenuData(_0x43ac75[_0x107416(0x101)],_0x43ac75[_0x107416(0x104)]);_0x32ae03=_0x5ed483['localPages'],_0x38bf24=_0x5ed483[_0x107416(0xe1)],_0x3dd0f3=_0x5ed483[_0x107416(0xfb)],stopSpinner(_0x59a90e,_0x107416(0xe7),!![]);}catch(_0x611460){stopSpinner(_0x59a90e,_0x107416(0xf5),![]);throw CliErrors[_0x107416(0xf3)](_0x611460 instanceof Error?_0x611460[_0x107416(0x117)]:'Failed\x20to\x20fetch\x20online\x20menu\x20list');}if(_0x32ae03[_0x107416(0x102)]===0x0)return writeCliSideChannelLine(a131_0x2443d2[_0x107416(0x110)](_0x107416(0x112))),{'ok':!![]};const _0xc0e1e5=buildCompareRows(_0x32ae03,_0x38bf24);writeCliSideChannelLine(renderCompareTable(_0xc0e1e5)),writeCliSideChannelLine('');const _0x26b211=_0x296dbe['pages'],_0x49a664=await selectPages(_0x32ae03,_0x38bf24,_0x26b211);writeCliSideChannelLine(''),writeCliSideChannelLine(a131_0x2443d2[_0x107416(0x109)](_0x107416(0xdf)+_0x49a664[_0x107416(0x102)]+_0x107416(0x118)));const _0x370caf=_0x296dbe[_0x107416(0x116)]&&_0x296dbe['cssUrl'];if(!_0x370caf){writeCliSideChannelLine(renderSyncSummary(_0x49a664,_0x38bf24['size']>0x0));const _0x5ec59e=await askConfirm(_0x107416(0xeb));if(!_0x5ec59e)return writeCliSideChannelLine(a131_0x2443d2[_0x107416(0xf7)]('\x20\x20Cancelled.')),{'ok':!![]};}let _0x5a0ed7=_0x296dbe['jsUrl'],_0x5f53d9=_0x296dbe[_0x107416(0xe3)];!_0x5a0ed7&&(_0x5a0ed7=await askJsUrl());!_0x5f53d9&&(_0x5f53d9=await askCssUrl());const _0x5f496d=await askConfirm(_0x107416(0xe9)+_0x49a664['length']+'\x20menu(s)\x20with\x20JS:\x20'+_0x5a0ed7+_0x107416(0x111)+_0x5f53d9+'?');if(!_0x5f496d)return writeCliSideChannelLine(a131_0x2443d2[_0x107416(0xf7)](_0x107416(0xde))),{'ok':!![]};const _0xb87279=[_0x5a0ed7,_0x5f53d9],_0x1704fa=startSpinner(_0x107416(0x10f)+_0x49a664[_0x107416(0x102)]+_0x107416(0xf4));try{const _0x16f33c=await doCreateMenus(_0x43ac75[_0x107416(0x101)],_0x43ac75[_0x107416(0x104)],_0x49a664,_0xb87279);return stopSpinner(_0x1704fa,_0x107416(0xf0)+_0x16f33c['created']+_0x107416(0xec),!![]),{'ok':!![],'data':_0x16f33c,'message':'Menu\x20sync\x20completed:\x20'+_0x16f33c[_0x107416(0x10e)]+_0x107416(0xed)+_0x16f33c[_0x107416(0xda)]+_0x107416(0x107)};}catch(_0x3fff5f){stopSpinner(_0x1704fa,_0x107416(0xf1),![]);throw CliErrors[_0x107416(0xf3)](_0x3fff5f instanceof Error?_0x3fff5f[_0x107416(0x117)]:_0x107416(0xf1));}}};function parseParams(_0x307c9f){const _0x3cde1d=a131_0x57435c;if(!_0x307c9f)return{};try{const _0x5cac81=JSON[_0x3cde1d(0x115)](_0x307c9f);if(typeof _0x5cac81!==_0x3cde1d(0x10d)||_0x5cac81===null||Array[_0x3cde1d(0x103)](_0x5cac81))return{};return{'jsUrl':typeof _0x5cac81[_0x3cde1d(0x116)]===_0x3cde1d(0xd9)?_0x5cac81['jsUrl'][_0x3cde1d(0xef)]():undefined,'cssUrl':typeof _0x5cac81[_0x3cde1d(0xe3)]==='string'?_0x5cac81[_0x3cde1d(0xe3)]['trim']():undefined,'pages':Array[_0x3cde1d(0x103)](_0x5cac81[_0x3cde1d(0xdb)])?_0x5cac81[_0x3cde1d(0xdb)][_0x3cde1d(0xfc)](String):undefined};}catch{return{};}}
@@ -1 +1 @@
1
- const a133_0x269d09=a133_0x2b0d;function a133_0x463d(){const _0x7078b4=['parse','338740TDRick','length','!\x20No\x20menus\x20with\x20existing\x20resources\x20found','429SkfbEt','2uiVBzW','\x20menu(s)\x20failed','boolean','Menu\x20update\x20failed','59741VayBPF','\x20updated.','validation','yellow','11571759YXkygM','\x20menu(s)','Fetching\x20online\x20menu\x20list...','4338jbSJyx','8NlPoJz','skipped','1430844gKTktO','Online\x20menu\x20list\x20fetched','object','update','map','flag','yes','✓\x20Menu\x20update\x20completed:\x20','message','string','\x20menu(s)\x20with\x20JS:\x20','cyan','36mTrbOE','\x20\x20!\x20No\x20menus\x20with\x20existing\x20resources\x20found','\x20menu(s)...','params','\x20\x20Found\x20','\x20\x20Update\x20','\x20updated,\x20','cssUrl','Failed\x20to\x20fetch\x20online\x20menu\x20list','18151367gRGUqf','label','cookie','Updated\x20','13220eARJRD','jsUrl','trim','596ohTahv','appCode','\x20failed.','\x20and\x20CSS:\x20','failed','updated','Update\x20CDN\x20asset\x20URLs\x20for\x20all\x20online\x20menus\x20with\x20existing\x20resources','\x20\x20Cancelled.','14679QJpWxu','\x20menu(s)\x20updated','Menu\x20update\x20completed:\x20','\x20menu(s)\x20with\x20existing\x20resources'];a133_0x463d=function(){return _0x7078b4;};return a133_0x463d();}(function(_0x3019c5,_0x4bccab){const _0x33c774=a133_0x2b0d,_0x2891fe=_0x3019c5();while(!![]){try{const _0x11eae7=parseInt(_0x33c774(0xc3))/0x1+-parseInt(_0x33c774(0xbf))/0x2*(-parseInt(_0x33c774(0xcd))/0x3)+-parseInt(_0x33c774(0xe9))/0x4*(-parseInt(_0x33c774(0xe6))/0x5)+parseInt(_0x33c774(0xca))/0x6*(-parseInt(_0x33c774(0xb6))/0x7)+parseInt(_0x33c774(0xcb))/0x8*(-parseInt(_0x33c774(0xc7))/0x9)+parseInt(_0x33c774(0xbb))/0xa*(-parseInt(_0x33c774(0xbe))/0xb)+-parseInt(_0x33c774(0xd9))/0xc*(-parseInt(_0x33c774(0xe2))/0xd);if(_0x11eae7===_0x4bccab)break;else _0x2891fe['push'](_0x2891fe['shift']());}catch(_0x86268d){_0x2891fe['push'](_0x2891fe['shift']());}}}(a133_0x463d,0xf3466));import a133_0x3870cc from'chalk';function a133_0x2b0d(_0xe94818,_0x400198){_0xe94818=_0xe94818-0xb2;const _0x463d7b=a133_0x463d();let _0x2b0dbe=_0x463d7b[_0xe94818];return _0x2b0dbe;}import{filterMenusWithResources,doUpdateCdnUrls,fetchOnlineMenuList}from'../../commands/menu/shared/logic.js';import{renderUpdateSummary}from'../../commands/menu/shared/compare-table.js';import{askJsUrl,askCssUrl,askConfirm,startSpinner,stopSpinner,isInteractive,requireInteractive}from'../../commands/menu/shared/inquirer.js';import{CliErrors}from'../../errors.js';import{writeCliSideChannelLine}from'../../utils/write-cli-side-channel.js';import{runMenuUpdateCore}from'../../commands/menu/shared/update-core.js';export const menuUpdate={'service':'menu','command':a133_0x269d09(0xd0),'description':a133_0x269d09(0xb4),'risk':'write','flags':[{'name':'params','type':'string','description':'Pre-fill\x20JS/CSS\x20URLs\x20to\x20update.\x20'+'JSON:\x20{\x22jsUrl\x22:\x22https://...js\x22,\x22cssUrl\x22:\x22https://...css\x22}'},{'name':a133_0x269d09(0xd3),'type':a133_0x269d09(0xc1),'description':'Non-interactive:\x20update\x20all\x20menus\x20without\x20confirmation'}],async 'execute'(_0x3dfa6c){const _0x492997=a133_0x269d09,_0x3046cb=_0x3dfa6c[_0x492997(0xd2)](_0x492997(0xd3)),_0x3a7222=_0x3dfa6c['str'](_0x492997(0xdc)),_0x23ac20=parseParams(_0x3a7222),_0x210c42=!!(_0x23ac20[_0x492997(0xe7)]||_0x23ac20[_0x492997(0xe0)]);if(_0x3046cb||_0x210c42&&!isInteractive()){const _0x50b8ee=await runMenuUpdateCore(_0x3dfa6c[_0x492997(0xea)],_0x3dfa6c[_0x492997(0xe4)],_0x3a7222);return _0x50b8ee[_0x492997(0xcc)]?writeCliSideChannelLine(_0x492997(0xbd)):(writeCliSideChannelLine(_0x492997(0xd4)+_0x50b8ee[_0x492997(0xb3)]+_0x492997(0xb7)),_0x50b8ee[_0x492997(0xb2)]>0x0&&writeCliSideChannelLine('!\x20'+_0x50b8ee['failed']+_0x492997(0xc0))),{'ok':_0x50b8ee[_0x492997(0xb2)]===0x0};}requireInteractive();const _0x1ccb4b=startSpinner(_0x492997(0xc9));let _0x5f4c5e;try{_0x5f4c5e=await fetchOnlineMenuList(_0x3dfa6c[_0x492997(0xea)],_0x3dfa6c[_0x492997(0xe4)]),stopSpinner(_0x1ccb4b,_0x492997(0xce),!![]);}catch(_0x5aaa90){stopSpinner(_0x1ccb4b,_0x492997(0xe1),![]);throw CliErrors[_0x492997(0xc5)](_0x5aaa90 instanceof Error?_0x5aaa90['message']:'Failed\x20to\x20fetch\x20online\x20menu\x20list');}const _0x2dd10c=filterMenusWithResources(_0x5f4c5e);if(_0x2dd10c[_0x492997(0xbc)]===0x0)return writeCliSideChannelLine(a133_0x3870cc[_0x492997(0xc6)](_0x492997(0xda))),{'ok':!![]};writeCliSideChannelLine(''),writeCliSideChannelLine(a133_0x3870cc[_0x492997(0xd8)](_0x492997(0xdd)+_0x2dd10c[_0x492997(0xbc)]+_0x492997(0xb9))),writeCliSideChannelLine(renderUpdateSummary(_0x2dd10c[_0x492997(0xd1)](_0x1250bd=>_0x1250bd[_0x492997(0xe3)]),[_0x23ac20['jsUrl'],_0x23ac20[_0x492997(0xe0)]])),writeCliSideChannelLine('');let _0x658ce4=_0x23ac20[_0x492997(0xe7)],_0x2de834=_0x23ac20[_0x492997(0xe0)];!_0x658ce4&&(_0x658ce4=await askJsUrl());!_0x2de834&&(_0x2de834=await askCssUrl());const _0x5d616b=await askConfirm(_0x492997(0xde)+_0x2dd10c[_0x492997(0xbc)]+_0x492997(0xd7)+_0x658ce4+_0x492997(0xec)+_0x2de834+'?');if(!_0x5d616b)return writeCliSideChannelLine(a133_0x3870cc['gray'](_0x492997(0xb5))),{'ok':!![]};const _0x38f827=[_0x658ce4,_0x2de834],_0x2d2b44=startSpinner('Updating\x20'+_0x2dd10c[_0x492997(0xbc)]+_0x492997(0xdb));try{const _0x54c990=await doUpdateCdnUrls(_0x3dfa6c['appCode'],_0x3dfa6c['cookie'],_0x2dd10c,_0x38f827);return stopSpinner(_0x2d2b44,_0x492997(0xe5)+_0x54c990[_0x492997(0xb3)]+_0x492997(0xc8),_0x54c990['failed']===0x0),{'ok':_0x54c990[_0x492997(0xb2)]===0x0,'data':_0x54c990,'message':_0x54c990['failed']>0x0?_0x492997(0xb8)+_0x54c990[_0x492997(0xb3)]+_0x492997(0xdf)+_0x54c990['failed']+_0x492997(0xeb):_0x492997(0xb8)+_0x54c990['updated']+_0x492997(0xc4)};}catch(_0xb92823){stopSpinner(_0x2d2b44,_0x492997(0xc2),![]);throw CliErrors[_0x492997(0xc5)](_0xb92823 instanceof Error?_0xb92823[_0x492997(0xd5)]:_0x492997(0xc2));}}};function parseParams(_0x41c9c4){const _0x22f0eb=a133_0x269d09;if(!_0x41c9c4)return{};try{const _0x4f578d=JSON[_0x22f0eb(0xba)](_0x41c9c4);if(typeof _0x4f578d!==_0x22f0eb(0xcf)||_0x4f578d===null||Array['isArray'](_0x4f578d))return{};return{'jsUrl':typeof _0x4f578d[_0x22f0eb(0xe7)]===_0x22f0eb(0xd6)?_0x4f578d[_0x22f0eb(0xe7)]['trim']():undefined,'cssUrl':typeof _0x4f578d[_0x22f0eb(0xe0)]===_0x22f0eb(0xd6)?_0x4f578d['cssUrl'][_0x22f0eb(0xe8)]():undefined};}catch{return{};}}
1
+ const a133_0x1547ec=a133_0x4a02;(function(_0x39a080,_0x36b9a1){const _0x26d781=a133_0x4a02,_0x3cb417=_0x39a080();while(!![]){try{const _0x2ee22d=parseInt(_0x26d781(0x78))/0x1*(parseInt(_0x26d781(0x8e))/0x2)+parseInt(_0x26d781(0xa2))/0x3+-parseInt(_0x26d781(0xad))/0x4+-parseInt(_0x26d781(0xa4))/0x5*(-parseInt(_0x26d781(0x7a))/0x6)+parseInt(_0x26d781(0x96))/0x7+parseInt(_0x26d781(0xa0))/0x8+parseInt(_0x26d781(0x7d))/0x9*(-parseInt(_0x26d781(0x9d))/0xa);if(_0x2ee22d===_0x36b9a1)break;else _0x3cb417['push'](_0x3cb417['shift']());}catch(_0x284a01){_0x3cb417['push'](_0x3cb417['shift']());}}}(a133_0x3fd4,0xb6989));import a133_0x46538d from'chalk';import{filterMenusWithResources,doUpdateCdnUrls,fetchOnlineMenuList}from'../../commands/menu/shared/logic.js';function a133_0x4a02(_0x5e33a4,_0x80c31d){_0x5e33a4=_0x5e33a4-0x75;const _0x3fd4ca=a133_0x3fd4();let _0x4a027f=_0x3fd4ca[_0x5e33a4];return _0x4a027f;}import{renderUpdateSummary}from'../../commands/menu/shared/compare-table.js';import{askJsUrl,askCssUrl,askConfirm,startSpinner,stopSpinner,isInteractive,requireInteractive}from'../../commands/menu/shared/inquirer.js';import{CliErrors}from'../../errors.js';function a133_0x3fd4(){const _0xcd2620=['cyan','map','7262318lbkumr','Online\x20menu\x20list\x20fetched','boolean','!\x20No\x20menus\x20with\x20existing\x20resources\x20found','flag','jsUrl','string','11209340NvkqWQ','\x20menu(s)\x20with\x20JS:\x20','\x20updated.','3210824ZhEbvh','Update\x20CDN\x20asset\x20URLs\x20for\x20all\x20online\x20menus\x20with\x20existing\x20resources','3100386TKvcIC','trim','614530XvaUJk','\x20failed.','\x20\x20!\x20No\x20menus\x20with\x20existing\x20resources\x20found','appCode','length','updated','cookie','Menu\x20update\x20failed','yes','3601052qxXvyG','Fetching\x20online\x20menu\x20list...','Menu\x20update\x20completed:\x20','str','skipped','1041wRPKTh','\x20menu(s)','12iuwZam','Pre-fill\x20JS/CSS\x20URLs\x20to\x20update.\x20','update','9peajRh','\x20menu(s)\x20with\x20existing\x20resources','\x20and\x20CSS:\x20','failed','message','gray','\x20\x20Found\x20','write','JSON:\x20{\x22jsUrl\x22:\x22https://...js\x22,\x22cssUrl\x22:\x22https://...css\x22}','\x20menu(s)\x20failed','Non-interactive:\x20update\x20all\x20menus\x20without\x20confirmation','parse','\x20\x20Update\x20','cssUrl','object','isArray','Failed\x20to\x20fetch\x20online\x20menu\x20list','98IkaNpi','validation','Updating\x20','label','params','\x20menu(s)\x20updated'];a133_0x3fd4=function(){return _0xcd2620;};return a133_0x3fd4();}import{writeCliSideChannelLine}from'../../utils/write-cli-side-channel.js';import{runMenuUpdateCore}from'../../commands/menu/shared/update-core.js';export const menuUpdate={'service':'menu','command':a133_0x1547ec(0x7c),'description':a133_0x1547ec(0xa1),'risk':a133_0x1547ec(0x84),'flags':[{'name':a133_0x1547ec(0x92),'type':'string','description':a133_0x1547ec(0x7b)+a133_0x1547ec(0x85)},{'name':a133_0x1547ec(0xac),'type':a133_0x1547ec(0x98),'description':a133_0x1547ec(0x87)}],async 'execute'(_0x21dd4d){const _0x1317fe=a133_0x1547ec,_0x2c1ab6=_0x21dd4d[_0x1317fe(0x9a)](_0x1317fe(0xac)),_0x457d30=_0x21dd4d[_0x1317fe(0x76)]('params'),_0x564dd1=parseParams(_0x457d30),_0x2814c7=!!(_0x564dd1[_0x1317fe(0x9b)]||_0x564dd1[_0x1317fe(0x8a)]);if(_0x2c1ab6||_0x2814c7&&!isInteractive()){const _0x342875=await runMenuUpdateCore(_0x21dd4d[_0x1317fe(0xa7)],_0x21dd4d[_0x1317fe(0xaa)],_0x457d30);return _0x342875[_0x1317fe(0x77)]?writeCliSideChannelLine(_0x1317fe(0x99)):(writeCliSideChannelLine('✓\x20Menu\x20update\x20completed:\x20'+_0x342875[_0x1317fe(0xa9)]+_0x1317fe(0x93)),_0x342875[_0x1317fe(0x80)]>0x0&&writeCliSideChannelLine('!\x20'+_0x342875[_0x1317fe(0x80)]+_0x1317fe(0x86))),{'ok':_0x342875[_0x1317fe(0x80)]===0x0};}requireInteractive();const _0x14fc3e=startSpinner(_0x1317fe(0xae));let _0x19fe04;try{_0x19fe04=await fetchOnlineMenuList(_0x21dd4d['appCode'],_0x21dd4d['cookie']),stopSpinner(_0x14fc3e,_0x1317fe(0x97),!![]);}catch(_0x47cc29){stopSpinner(_0x14fc3e,'Failed\x20to\x20fetch\x20online\x20menu\x20list',![]);throw CliErrors[_0x1317fe(0x8f)](_0x47cc29 instanceof Error?_0x47cc29[_0x1317fe(0x81)]:_0x1317fe(0x8d));}const _0x477fcb=filterMenusWithResources(_0x19fe04);if(_0x477fcb[_0x1317fe(0xa8)]===0x0)return writeCliSideChannelLine(a133_0x46538d['yellow'](_0x1317fe(0xa6))),{'ok':!![]};writeCliSideChannelLine(''),writeCliSideChannelLine(a133_0x46538d[_0x1317fe(0x94)](_0x1317fe(0x83)+_0x477fcb[_0x1317fe(0xa8)]+_0x1317fe(0x7e))),writeCliSideChannelLine(renderUpdateSummary(_0x477fcb[_0x1317fe(0x95)](_0x2ebb81=>_0x2ebb81[_0x1317fe(0x91)]),[_0x564dd1[_0x1317fe(0x9b)],_0x564dd1['cssUrl']])),writeCliSideChannelLine('');let _0x2dbbf0=_0x564dd1[_0x1317fe(0x9b)],_0x3601e2=_0x564dd1[_0x1317fe(0x8a)];!_0x2dbbf0&&(_0x2dbbf0=await askJsUrl());!_0x3601e2&&(_0x3601e2=await askCssUrl());const _0x5d0ebb=await askConfirm(_0x1317fe(0x89)+_0x477fcb[_0x1317fe(0xa8)]+_0x1317fe(0x9e)+_0x2dbbf0+_0x1317fe(0x7f)+_0x3601e2+'?');if(!_0x5d0ebb)return writeCliSideChannelLine(a133_0x46538d[_0x1317fe(0x82)]('\x20\x20Cancelled.')),{'ok':!![]};const _0xb68ecf=[_0x2dbbf0,_0x3601e2],_0x33e798=startSpinner(_0x1317fe(0x90)+_0x477fcb[_0x1317fe(0xa8)]+'\x20menu(s)...');try{const _0x36892f=await doUpdateCdnUrls(_0x21dd4d[_0x1317fe(0xa7)],_0x21dd4d[_0x1317fe(0xaa)],_0x477fcb,_0xb68ecf);return stopSpinner(_0x33e798,'Updated\x20'+_0x36892f['updated']+_0x1317fe(0x79),_0x36892f[_0x1317fe(0x80)]===0x0),{'ok':_0x36892f[_0x1317fe(0x80)]===0x0,'data':_0x36892f,'message':_0x36892f[_0x1317fe(0x80)]>0x0?_0x1317fe(0x75)+_0x36892f[_0x1317fe(0xa9)]+'\x20updated,\x20'+_0x36892f[_0x1317fe(0x80)]+_0x1317fe(0xa5):_0x1317fe(0x75)+_0x36892f[_0x1317fe(0xa9)]+_0x1317fe(0x9f)};}catch(_0x20a106){stopSpinner(_0x33e798,_0x1317fe(0xab),![]);throw CliErrors['validation'](_0x20a106 instanceof Error?_0x20a106[_0x1317fe(0x81)]:_0x1317fe(0xab));}}};function parseParams(_0x251550){const _0x31f30a=a133_0x1547ec;if(!_0x251550)return{};try{const _0x4d5ecc=JSON[_0x31f30a(0x88)](_0x251550);if(typeof _0x4d5ecc!==_0x31f30a(0x8b)||_0x4d5ecc===null||Array[_0x31f30a(0x8c)](_0x4d5ecc))return{};return{'jsUrl':typeof _0x4d5ecc[_0x31f30a(0x9b)]==='string'?_0x4d5ecc['jsUrl'][_0x31f30a(0xa3)]():undefined,'cssUrl':typeof _0x4d5ecc[_0x31f30a(0x8a)]===_0x31f30a(0x9c)?_0x4d5ecc[_0x31f30a(0x8a)][_0x31f30a(0xa3)]():undefined};}catch{return{};}}
@@ -1 +1 @@
1
- (function(_0x5a252f,_0xdb9932){const _0x1f3b4f=a64_0x16df,_0x23781f=_0x5a252f();while(!![]){try{const _0x239820=-parseInt(_0x1f3b4f(0x18d))/0x1+-parseInt(_0x1f3b4f(0x189))/0x2+-parseInt(_0x1f3b4f(0x17e))/0x3+-parseInt(_0x1f3b4f(0x184))/0x4*(-parseInt(_0x1f3b4f(0x18a))/0x5)+-parseInt(_0x1f3b4f(0x191))/0x6+parseInt(_0x1f3b4f(0x183))/0x7*(parseInt(_0x1f3b4f(0x180))/0x8)+-parseInt(_0x1f3b4f(0x188))/0x9*(-parseInt(_0x1f3b4f(0x17a))/0xa);if(_0x239820===_0xdb9932)break;else _0x23781f['push'](_0x23781f['shift']());}catch(_0x341e5e){_0x23781f['push'](_0x23781f['shift']());}}}(a64_0x2823,0x44827));import{existsSync}from'node:fs';import a64_0x33cc5e from'node:path';import a64_0x54a8c2 from'chalk';import{input,confirm}from'@inquirer/prompts';function a64_0x2823(){const _0x1d3559=['36755yfsEJZ','resolve','my-app','415164XMEjYu','\x22\x20already\x20exists','log','cwd','1553466HMwJEN','Project\x20name\x20cannot\x20exceed\x2050\x20characters','cyan','890aajhei','No\x20valid\x20login\x20detected.\x20Login\x20first\x20to\x20pull\x20API\x20config?','length','green','1643427fOVuCb','env','304tzZTJb','Not\x20set','Logged\x20in','88417wqqImI','24wfuOyE','production','Login\x20failed','√\x20Project\x20Name:\x20','143595PHkLGo','883160TAcjVa'];a64_0x2823=function(){return _0x1d3559;};return a64_0x2823();}import{getIsSessionValid}from'../../../auth/is-session-valid.js';import{authServer}from'../../../auth/auth-server.js';import{readConfig}from'../../../utils/config.js';import{selectSingleAppcode}from'../../../commands/common/app-selector.js';function a64_0x16df(_0x3267b3,_0x4f98c4){_0x3267b3=_0x3267b3-0x179;const _0x2823d6=a64_0x2823();let _0x16dffb=_0x2823d6[_0x3267b3];return _0x16dffb;}export async function guidedCreateProject(_0x1f2972,_0x278043,_0x219099){const _0x372127=a64_0x16df,_0x28d817=_0x372127(0x18c),_0x2502bb=readConfig(),_0x13e960=typeof _0x2502bb[_0x372127(0x17f)]==='string'?_0x2502bb[_0x372127(0x17f)]:undefined,_0x30cce1=await input({'message':'Project\x20name:','default':_0x28d817,'validate':_0xf82dfe=>{const _0x2bf471=_0x372127,_0x1fd207=_0xf82dfe['trim']()||_0x28d817;if(_0x1fd207[_0x2bf471(0x17c)]>0x32)return _0x2bf471(0x192);const _0x4ed51e=/^[A-Za-z0-9][A-Za-z0-9_-]*$/;if(_0x1fd207&&!_0x4ed51e['test'](_0x1fd207))return'Must\x20start\x20with\x20a\x20letter/number\x20and\x20only\x20contain\x20letters,\x20numbers,\x20-\x20and\x20_';const _0x4adb91=a64_0x33cc5e[_0x2bf471(0x18b)](process[_0x2bf471(0x190)](),_0x1fd207);if(existsSync(_0x4adb91))return'Directory\x20\x22'+_0x1fd207+_0x2bf471(0x18e);return!![];}});console[_0x372127(0x18f)](a64_0x54a8c2[_0x372127(0x17d)](_0x372127(0x187)+a64_0x54a8c2[_0x372127(0x179)](_0x30cce1)));const _0x14e5a9=await selectSingleAppcode(_0x219099);console[_0x372127(0x18f)](a64_0x54a8c2[_0x372127(0x17d)]('√\x20App\x20Code:\x20'+a64_0x54a8c2[_0x372127(0x179)](_0x14e5a9||_0x372127(0x181))));if(_0x14e5a9){const _0x546cbb=await getIsSessionValid();if(!_0x546cbb){const _0x199467=await confirm({'message':_0x372127(0x17b),'default':!![]});if(_0x199467){const _0x6631c9=await authServer({'silent':!![]});console[_0x372127(0x18f)](a64_0x54a8c2[_0x372127(0x17d)]('√\x20Login\x20status:\x20'+a64_0x54a8c2[_0x372127(0x179)](_0x6631c9?_0x372127(0x182):_0x372127(0x186))));}else console[_0x372127(0x18f)](a64_0x54a8c2[_0x372127(0x17d)]('√\x20Login\x20status:\x20'+a64_0x54a8c2[_0x372127(0x179)]('Skipped')));}await _0x1f2972({'projectName':_0x30cce1,'appCode':_0x14e5a9,'env':_0x278043||_0x13e960||_0x372127(0x185)});}else await _0x1f2972({'projectName':_0x30cce1,'env':_0x278043||_0x13e960||_0x372127(0x185)});}
1
+ (function(_0x1e9d9e,_0x38e351){const _0x322ae7=a64_0x11fd,_0x352b72=_0x1e9d9e();while(!![]){try{const _0xf534f2=-parseInt(_0x322ae7(0x13a))/0x1*(-parseInt(_0x322ae7(0x13f))/0x2)+-parseInt(_0x322ae7(0x14d))/0x3+-parseInt(_0x322ae7(0x14e))/0x4*(-parseInt(_0x322ae7(0x136))/0x5)+parseInt(_0x322ae7(0x13c))/0x6*(parseInt(_0x322ae7(0x152))/0x7)+-parseInt(_0x322ae7(0x142))/0x8*(parseInt(_0x322ae7(0x151))/0x9)+-parseInt(_0x322ae7(0x146))/0xa+parseInt(_0x322ae7(0x153))/0xb;if(_0xf534f2===_0x38e351)break;else _0x352b72['push'](_0x352b72['shift']());}catch(_0x13e213){_0x352b72['push'](_0x352b72['shift']());}}}(a64_0x75a3,0xd5120));import{existsSync}from'node:fs';import a64_0xfeb6e from'node:path';import a64_0x201b90 from'chalk';import{input,confirm}from'@inquirer/prompts';function a64_0x11fd(_0x589a93,_0x4b4afb){_0x589a93=_0x589a93-0x136;const _0x75a3cf=a64_0x75a3();let _0x11fd2c=_0x75a3cf[_0x589a93];return _0x11fd2c;}import{getIsSessionValid}from'../../../auth/is-session-valid.js';import{authServer}from'../../../auth/auth-server.js';import{readConfig}from'../../../utils/config.js';import{selectSingleAppcode}from'../../../commands/common/app-selector.js';export async function guidedCreateProject(_0x463c29,_0xc2df9e,_0x841b10){const _0x7903ea=a64_0x11fd,_0x15983c=_0x7903ea(0x140),_0x15fc56=readConfig(),_0xc0f952=typeof _0x15fc56[_0x7903ea(0x14b)]==='string'?_0x15fc56['env']:undefined,_0x45c7ef=await input({'message':_0x7903ea(0x14f),'default':_0x15983c,'validate':_0x329775=>{const _0x206f0a=_0x7903ea,_0x3165fc=_0x329775['trim']()||_0x15983c;if(_0x3165fc['length']>0x32)return _0x206f0a(0x14c);const _0x33a2e8=/^[A-Za-z0-9][A-Za-z0-9_-]*$/;if(_0x3165fc&&!_0x33a2e8[_0x206f0a(0x147)](_0x3165fc))return _0x206f0a(0x13b);const _0x51e59a=a64_0xfeb6e[_0x206f0a(0x13d)](process['cwd'](),_0x3165fc);if(existsSync(_0x51e59a))return'Directory\x20\x22'+_0x3165fc+_0x206f0a(0x150);return!![];}});console[_0x7903ea(0x145)](a64_0x201b90['green'](_0x7903ea(0x13e)+a64_0x201b90[_0x7903ea(0x144)](_0x45c7ef)));const _0x89645f=await selectSingleAppcode(_0x841b10);console['log'](a64_0x201b90[_0x7903ea(0x149)](_0x7903ea(0x143)+a64_0x201b90[_0x7903ea(0x144)](_0x89645f||_0x7903ea(0x138))));if(_0x89645f){const _0x3a1d79=await getIsSessionValid();if(!_0x3a1d79){const _0x22c484=await confirm({'message':_0x7903ea(0x148),'default':!![]});if(_0x22c484){const _0x57978d=await authServer({'silent':!![]});console[_0x7903ea(0x145)](a64_0x201b90[_0x7903ea(0x149)](_0x7903ea(0x141)+a64_0x201b90[_0x7903ea(0x144)](_0x57978d?_0x7903ea(0x137):'Login\x20failed')));}else console[_0x7903ea(0x145)](a64_0x201b90[_0x7903ea(0x149)](_0x7903ea(0x141)+a64_0x201b90[_0x7903ea(0x144)](_0x7903ea(0x139))));}await _0x463c29({'projectName':_0x45c7ef,'appCode':_0x89645f,'env':_0xc2df9e||_0xc0f952||_0x7903ea(0x14a)});}else await _0x463c29({'projectName':_0x45c7ef,'env':_0xc2df9e||_0xc0f952||_0x7903ea(0x14a)});}function a64_0x75a3(){const _0x3ccbff=['Logged\x20in','Not\x20set','Skipped','173564tnNWVk','Must\x20start\x20with\x20a\x20letter/number\x20and\x20only\x20contain\x20letters,\x20numbers,\x20-\x20and\x20_','4470CmbFjJ','resolve','√\x20Project\x20Name:\x20','4nTOVEo','my-app','√\x20Login\x20status:\x20','28024qdFcUh','√\x20App\x20Code:\x20','cyan','log','13033090wPLUcP','test','No\x20valid\x20login\x20detected.\x20Login\x20first\x20to\x20pull\x20API\x20config?','green','production','env','Project\x20name\x20cannot\x20exceed\x2050\x20characters','4561266SUEKCb','2384sYcvZD','Project\x20name:','\x22\x20already\x20exists','3411UdnFOR','5173NdDCkW','42132299ublChd','2485DUyGAb'];a64_0x75a3=function(){return _0x3ccbff;};return a64_0x75a3();}
@@ -1 +1 @@
1
- (function(_0x5cea0c,_0xf7a998){const _0x3575f3=a66_0x5f13,_0x439358=_0x5cea0c();while(!![]){try{const _0x23011e=parseInt(_0x3575f3(0xb5))/0x1+-parseInt(_0x3575f3(0xb4))/0x2*(parseInt(_0x3575f3(0xb8))/0x3)+parseInt(_0x3575f3(0xaf))/0x4*(parseInt(_0x3575f3(0xb3))/0x5)+parseInt(_0x3575f3(0xb1))/0x6+parseInt(_0x3575f3(0xb0))/0x7+-parseInt(_0x3575f3(0xb6))/0x8+-parseInt(_0x3575f3(0xb7))/0x9;if(_0x23011e===_0xf7a998)break;else _0x439358['push'](_0x439358['shift']());}catch(_0x7b5f7a){_0x439358['push'](_0x439358['shift']());}}}(a66_0x59b0,0xe7b2f));export function formatElapsed(_0x3e5690){const _0x3afa93=a66_0x5f13,_0x465831=Date['now']()-_0x3e5690;if(_0x465831<0x3e8)return _0x465831+'ms';const _0xc52d72=(_0x465831/0x3e8)['toFixed'](0x2),_0x3988fc=_0xc52d72[_0x3afa93(0xb2)](/\.?0+$/u,'');return _0x3988fc+'s';}function a66_0x5f13(_0x4674f1,_0x3a3889){_0x4674f1=_0x4674f1-0xaf;const _0x59b049=a66_0x59b0();let _0x5f13af=_0x59b049[_0x4674f1];return _0x5f13af;}function a66_0x59b0(){const _0x2af590=['11886376AnWdEn','8489682xmgBLj','3FtiXqk','259252GfwMgG','8469657Imiaja','10082316wEXolu','replace','95OfTWDK','2279582fWMLFJ','396141HuhBIx'];a66_0x59b0=function(){return _0x2af590;};return a66_0x59b0();}
1
+ function a66_0x3006(_0xd7289c,_0x2e6119){_0xd7289c=_0xd7289c-0x105;const _0x50c48b=a66_0x50c4();let _0x3006b3=_0x50c48b[_0xd7289c];return _0x3006b3;}function a66_0x50c4(){const _0x5dca78=['1644807XngVzD','508dWyfqp','3400ixizUi','18242818VUeRTW','8BVSuCs','6762940hthrnd','9clHuNe','now','7110212fKRzkP','24pNgtKi','5758732TkJKXI','30tFVVtP','752142RgxrBK'];a66_0x50c4=function(){return _0x5dca78;};return a66_0x50c4();}(function(_0x2b3cfe,_0x36372f){const _0x75b316=a66_0x3006,_0x42a550=_0x2b3cfe();while(!![]){try{const _0x2e4427=-parseInt(_0x75b316(0x109))/0x1*(-parseInt(_0x75b316(0x108))/0x2)+-parseInt(_0x75b316(0x107))/0x3+-parseInt(_0x75b316(0x10f))/0x4+-parseInt(_0x75b316(0x105))/0x5*(parseInt(_0x75b316(0x106))/0x6)+parseInt(_0x75b316(0x111))/0x7*(-parseInt(_0x75b316(0x10b))/0x8)+-parseInt(_0x75b316(0x10d))/0x9*(-parseInt(_0x75b316(0x10c))/0xa)+-parseInt(_0x75b316(0x10a))/0xb*(-parseInt(_0x75b316(0x110))/0xc);if(_0x2e4427===_0x36372f)break;else _0x42a550['push'](_0x42a550['shift']());}catch(_0x10365c){_0x42a550['push'](_0x42a550['shift']());}}}(a66_0x50c4,0xe96e2));export function formatElapsed(_0x5eb721){const _0x1c98ca=a66_0x3006,_0x368295=Date[_0x1c98ca(0x10e)]()-_0x5eb721;if(_0x368295<0x3e8)return _0x368295+'ms';const _0x5e9524=(_0x368295/0x3e8)['toFixed'](0x2),_0x2bfe46=_0x5e9524['replace'](/\.?0+$/u,'');return _0x2bfe46+'s';}
@@ -1 +1 @@
1
- (function(_0x46fcc3,_0x2c44b0){const _0x178e15=a67_0x125c,_0x1d9eac=_0x46fcc3();while(!![]){try{const _0x4e8775=parseInt(_0x178e15(0x159))/0x1+parseInt(_0x178e15(0x157))/0x2*(-parseInt(_0x178e15(0x1a2))/0x3)+parseInt(_0x178e15(0x18f))/0x4+parseInt(_0x178e15(0x160))/0x5*(parseInt(_0x178e15(0x19d))/0x6)+parseInt(_0x178e15(0x1aa))/0x7*(parseInt(_0x178e15(0x162))/0x8)+-parseInt(_0x178e15(0x16a))/0x9+-parseInt(_0x178e15(0x198))/0xa;if(_0x4e8775===_0x2c44b0)break;else _0x1d9eac['push'](_0x1d9eac['shift']());}catch(_0x3a6682){_0x1d9eac['push'](_0x1d9eac['shift']());}}}(a67_0x5aa9,0xca5b6));import a67_0x3b7ff9 from'path';import a67_0x32eb68 from'fs';import a67_0x4e1d30 from'chalk';import a67_0xb8bc07 from'ora';import{guidedCreateProject}from'../../../commands/project/create/enhanced-guided-create.js';import{fetchModelList}from'../../../api/fetch-model-list.js';import{generateApiFile}from'../../../api/generate-api-file.js';import{initEnv}from'../../../constant/env.js';import{readConfig}from'../../../utils/config.js';import{CLI_BIN_NAME}from'../../../constant/cli.js';import{DEFAULT_API_DIR}from'../../../constant/paths.js';import{writeConfigFile,NEW_CONFIG_NAME}from'../../../context.js';import{copyProjectTemplate}from'../../../commands/project/create/use-copy-project-template.js';function a67_0x125c(_0x5ae5f6,_0x356f17){_0x5ae5f6=_0x5ae5f6-0x156;const _0x5aa9f9=a67_0x5aa9();let _0x125ced=_0x5aa9f9[_0x5ae5f6];return _0x125ced;}import{installDependencies}from'../../../commands/project/create/use-install-dependencies.js';import{formatProjectCode}from'../../../commands/project/create/use-format-code.js';import{logger}from'../../../utils/logger.js';import{checkCliVersion,printCliUpgradeWarning}from'../../../utils/cli-version-check.js';import{PROJECT_CREATE_INHERITABLE_KEYS,buildCanonicalProjectConfig}from'../../../config/schema.js';import{selectSingleAppcode}from'../../../commands/common/app-selector.js';import{getRabetbaseCliPackageRoot}from'../../../commands/project/create/project-template-path.js';export async function createApp(_0x567dc9){const _0x5d3438=a67_0x125c,_0x5a0d72=await checkCliVersion();_0x5a0d72['needsUpgrade']&&(printCliUpgradeWarning(_0x5a0d72),logger[_0x5d3438(0x179)](_0x5d3438(0x171),_0x5d3438(0x1af),{'currentVersion':_0x5a0d72[_0x5d3438(0x1ad)],'stableVersion':_0x5a0d72[_0x5d3438(0x1a3)],'needsUpgrade':_0x5a0d72[_0x5d3438(0x17f)]}));if(_0x567dc9[_0x5d3438(0x19a)]&&_0x567dc9[_0x5d3438(0x188)])await runCreate({'projectName':_0x567dc9[_0x5d3438(0x19a)],'appCode':_0x567dc9[_0x5d3438(0x188)],'env':_0x567dc9['env']},_0x567dc9);else{if(_0x567dc9[_0x5d3438(0x19a)]){const _0x3b36c1=await selectSingleAppcode(_0x567dc9[_0x5d3438(0x18e)]);await runCreate({'projectName':_0x567dc9[_0x5d3438(0x19a)],'appCode':_0x3b36c1||undefined,'env':_0x567dc9[_0x5d3438(0x173)]},_0x567dc9);}else await guidedCreateProject(_0x3bf653=>runCreate(_0x3bf653,_0x567dc9),_0x567dc9['env'],_0x567dc9[_0x5d3438(0x18e)]);}}async function runCreate(_0x2f990a,_0x30990f){const _0x3e6dc3=a67_0x125c;if(!_0x2f990a[_0x3e6dc3(0x19c)]||_0x2f990a[_0x3e6dc3(0x19c)][_0x3e6dc3(0x15b)]()==='')throw new Error(_0x3e6dc3(0x168));const _0x441143=/[<>:"|?*\x00-\x1f\x7f]/;if(_0x441143[_0x3e6dc3(0x16c)](_0x2f990a[_0x3e6dc3(0x19c)]))throw new Error(_0x3e6dc3(0x18d));if(_0x2f990a['projectName'][_0x3e6dc3(0x1ab)]>0x64)throw new Error('Project\x20name\x20is\x20too\x20long,\x20maximum\x20100\x20characters');const _0x3d33c6=a67_0x3b7ff9[_0x3e6dc3(0x1a7)](process[_0x3e6dc3(0x1a6)](),_0x2f990a['projectName']);if(a67_0x32eb68[_0x3e6dc3(0x15f)](_0x3d33c6))throw new Error('Project\x20directory\x20'+_0x2f990a[_0x3e6dc3(0x19c)]+_0x3e6dc3(0x163));try{a67_0x32eb68[_0x3e6dc3(0x176)](a67_0x3b7ff9[_0x3e6dc3(0x180)](_0x3d33c6),a67_0x32eb68[_0x3e6dc3(0x18b)][_0x3e6dc3(0x16b)]);}catch{throw new Error(_0x3e6dc3(0x192));}logger[_0x3e6dc3(0x17a)](_0x3d33c6),logger[_0x3e6dc3(0x179)](_0x3e6dc3(0x171),'开始创建项目:\x20'+_0x2f990a[_0x3e6dc3(0x19c)],{'projectDir':_0x3d33c6,'appCode':_0x2f990a[_0x3e6dc3(0x188)]}),console[_0x3e6dc3(0x196)](),console['log'](a67_0x4e1d30[_0x3e6dc3(0x1a5)](_0x3e6dc3(0x165))+'Project\x20name:\x20'+a67_0x4e1d30[_0x3e6dc3(0x1a5)](_0x2f990a[_0x3e6dc3(0x19c)])+(_0x2f990a[_0x3e6dc3(0x188)]?_0x3e6dc3(0x19e)+a67_0x4e1d30[_0x3e6dc3(0x15c)](_0x2f990a[_0x3e6dc3(0x188)]):''));try{await runTask(_0x3e6dc3(0x185),()=>copyProjectTemplate(_0x2f990a['projectName'])),await updatePackageJsonName(_0x2f990a[_0x3e6dc3(0x19c)]),await runTask(_0x3e6dc3(0x193),()=>installDependencies(_0x2f990a[_0x3e6dc3(0x19c)])),await runTask('Format\x20code',()=>formatProjectCode(_0x2f990a[_0x3e6dc3(0x19c)])),await configureAppCode(_0x2f990a[_0x3e6dc3(0x19c)],_0x2f990a[_0x3e6dc3(0x188)]||'',_0x2f990a[_0x3e6dc3(0x173)]);let _0x2bcd5b=![];if(_0x2f990a[_0x3e6dc3(0x188)]){console['log'](_0x3e6dc3(0x19b));const _0x229a09=process[_0x3e6dc3(0x1a6)]();try{process[_0x3e6dc3(0x177)](_0x3d33c6);const _0x54c95b=_0x2f990a[_0x3e6dc3(0x173)]||_0x3e6dc3(0x1ae);initEnv(_0x54c95b);const {configArray:_0x547fb3}=await fetchModelList(_0x2f990a[_0x3e6dc3(0x188)],_0x30990f['cookie']||''),_0x5e4199=DEFAULT_API_DIR,_0x15a315=await generateApiFile(_0x547fb3,'',_0x2f990a[_0x3e6dc3(0x188)],!![],_0x54c95b,_0x5e4199);console[_0x3e6dc3(0x196)](_0x3e6dc3(0x191)+_0x547fb3[_0x3e6dc3(0x1ab)]+_0x3e6dc3(0x178)+_0x15a315[_0x3e6dc3(0x161)]+'\x20model(s)'),logger[_0x3e6dc3(0x179)]('create','API\x20configuration\x20pulled:\x20'+_0x2f990a[_0x3e6dc3(0x188)]);}catch(_0xe5ed00){_0x2bcd5b=!![],console[_0x3e6dc3(0x196)](_0x3e6dc3(0x16f)),logger['warn']('create','API\x20配置拉取异常',{'error':_0xe5ed00 instanceof Error?_0xe5ed00[_0x3e6dc3(0x190)]:String(_0xe5ed00)});}finally{process['chdir'](_0x229a09);}}logger[_0x3e6dc3(0x1ac)]('create',_0x3e6dc3(0x156)+_0x2f990a[_0x3e6dc3(0x19c)]),console[_0x3e6dc3(0x196)](),console[_0x3e6dc3(0x196)](a67_0x4e1d30[_0x3e6dc3(0x1a5)]('─'[_0x3e6dc3(0x1a1)](0x3c))),console[_0x3e6dc3(0x196)](a67_0x4e1d30[_0x3e6dc3(0x15c)][_0x3e6dc3(0x1a0)]('🚀\x20Next\x20Steps:')),console[_0x3e6dc3(0x196)](),console['log']('\x20\x201.\x20Start\x20project:\x20'+a67_0x4e1d30[_0x3e6dc3(0x15c)][_0x3e6dc3(0x1a0)](_0x3e6dc3(0x18a)+_0x2f990a[_0x3e6dc3(0x19c)]+_0x3e6dc3(0x175)+CLI_BIN_NAME+_0x3e6dc3(0x167))),_0x2bcd5b&&console['log']('\x20\x202.\x20Pull\x20API\x20configuration:\x20'+a67_0x4e1d30[_0x3e6dc3(0x15c)]['bold'](CLI_BIN_NAME+_0x3e6dc3(0x189))),console[_0x3e6dc3(0x196)](a67_0x4e1d30[_0x3e6dc3(0x1a5)]('─'[_0x3e6dc3(0x1a1)](0x3c)));}catch(_0x1476fd){logger['error']('create','项目创建失败:\x20'+_0x2f990a[_0x3e6dc3(0x19c)],{'error':_0x1476fd instanceof Error?_0x1476fd['message']:String(_0x1476fd)});try{a67_0x32eb68[_0x3e6dc3(0x15f)](_0x3d33c6)&&(console[_0x3e6dc3(0x196)](_0x3e6dc3(0x172)+_0x3d33c6),a67_0x32eb68[_0x3e6dc3(0x181)](_0x3d33c6,{'recursive':!![],'force':!![]}));}catch{logger[_0x3e6dc3(0x164)]('create',_0x3e6dc3(0x170)+_0x3d33c6);}throw _0x1476fd;}}async function runTask(_0x3dd3ba,_0x53ad86){const _0xe371ea=a67_0x125c,_0x19c278=a67_0xb8bc07(_0x3dd3ba+_0xe371ea(0x194))['start']();try{const _0x3450fa=await _0x53ad86();_0x19c278[_0xe371ea(0x15d)](),console[_0xe371ea(0x196)](''+a67_0x4e1d30['green'](_0xe371ea(0x165))+_0x3dd3ba+'\x20'+a67_0x4e1d30['gray']('['+_0x3450fa+']'));}catch(_0x38716b){_0x19c278[_0xe371ea(0x18c)](_0x3dd3ba);throw _0x38716b;}}function a67_0x5aa9(){const _0xde975b=['join','94829OBfMDT','length','success','currentVersion','production','CLI\x20版本检查','项目创建完成:\x20','68uoJOCc','package.json','123151tvITAM','*\x20Configuring\x20AppCode\x20for\x20project\x20','trim','cyan','stop','toLocaleString','existsSync','265yJhuSN','modelCount','752DEYULJ','\x20already\x20exists','warn','\x20√\x20','更新\x20package.json\x20name','\x20run\x20start','Project\x20name\x20cannot\x20be\x20empty','*\x20Updating\x20package.json\x20name\x20and\x20description\x20fields','13050108cRUdhq','W_OK','test','√\x20Configuration\x20file\x20created,\x20Apps:\x20','stringify','!\x20API\x20configuration\x20pull\x20error,\x20you\x20can\x20manually\x20run:\x20rabetbase\x20api\x20pull','清理项目目录失败:\x20','create','*\x20Cleaning\x20up\x20failed\x20project\x20directory:\x20','env','1.0.0','\x20&&\x20','accessSync','chdir','\x20dataset(s),\x20generated\x20','info','setLogPath','error','version','apps','*\x20Creating\x20configuration\x20file\x20for\x20project\x20','needsUpgrade','dirname','rmSync','defaultApp','更新\x20package.json\x20失败','keys','Copy\x20project\x20files','\x20|\x20Default:\x20','utf8','appCode','\x20api\x20pull','cd\x20','constants','fail','Invalid\x20characters\x20in\x20project\x20name.\x20Not\x20allowed:\x20<\x20>\x20:\x20\x22\x20|\x20?\x20*\x20and\x20control\x20characters','cookie','5604756npuzyz','message','√\x20Pulled\x20','Cannot\x20create\x20project\x20in\x20current\x20directory,\x20please\x20check\x20directory\x20permissions','Install\x20dependencies','...','readFileSync','log','配置应用AppCode:\x20','1826160GnIrnN','配置应用AppCode失败','projectCode','*\x20Pulling\x20API\x20configuration...','projectName','87468qcibRQ','\x20|\x20AppCode:\x20','√\x20Configuration\x20file\x20created,\x20you\x20can\x20configure\x20later\x20with\x20\x27','bold','repeat','97845Cisxbn','stableVersion','parse','green','cwd','resolve','\x20Generated\x20by\x20rabetbase\x20cli\x20'];a67_0x5aa9=function(){return _0xde975b;};return a67_0x5aa9();}async function updatePackageJsonName(_0x1b9dd0){const _0x553c89=a67_0x125c,_0x20dbc7=a67_0x3b7ff9[_0x553c89(0x1a7)](process[_0x553c89(0x1a6)](),_0x1b9dd0),_0x59097d=a67_0x3b7ff9['join'](_0x20dbc7,_0x553c89(0x158));try{console[_0x553c89(0x196)](_0x553c89(0x169));const _0x318ec8=getRabetbaseCliPackageRoot(),_0x57b343=a67_0x3b7ff9[_0x553c89(0x1a9)](_0x318ec8,_0x553c89(0x158));let _0x58677e=_0x553c89(0x174);try{const _0x105ce9=JSON[_0x553c89(0x1a4)](a67_0x32eb68['readFileSync'](_0x57b343,'utf8'));_0x58677e=_0x105ce9[_0x553c89(0x17c)]||_0x553c89(0x174);}catch{}const _0x1ab17e=a67_0x32eb68[_0x553c89(0x195)](_0x59097d,'utf8'),_0x355dfa=JSON[_0x553c89(0x1a4)](_0x1ab17e);_0x355dfa['name']=_0x1b9dd0,_0x355dfa['description']=_0x1b9dd0+_0x553c89(0x1a8)+_0x58677e,a67_0x32eb68['writeFileSync'](_0x59097d,JSON[_0x553c89(0x16e)](_0x355dfa,null,0x2)+'\x0a',_0x553c89(0x187)),console[_0x553c89(0x196)]('√\x20package.json\x20updated:\x20name='+_0x1b9dd0),logger[_0x553c89(0x179)](_0x553c89(0x171),_0x553c89(0x166));}catch(_0x39b9e7){logger['error'](_0x553c89(0x171),_0x553c89(0x183));throw _0x39b9e7;}}async function configureAppCode(_0x1ea0cf,_0x3a260d,_0x3b0975){const _0x4d1b83=a67_0x125c,_0x3aadac=a67_0x3b7ff9['resolve'](process[_0x4d1b83(0x1a6)](),_0x1ea0cf),_0x529756=a67_0x3b7ff9['join'](_0x3aadac,NEW_CONFIG_NAME);try{_0x3a260d?console[_0x4d1b83(0x196)](_0x4d1b83(0x15a)+_0x1ea0cf+':\x20'+_0x3a260d):console[_0x4d1b83(0x196)](_0x4d1b83(0x17e)+_0x1ea0cf);const _0x15b9c5=getRabetbaseCliPackageRoot(),_0x576b91=a67_0x3b7ff9['join'](_0x15b9c5,_0x4d1b83(0x158));let _0x45dfe9=_0x4d1b83(0x174);try{const _0x3b3e93=JSON[_0x4d1b83(0x1a4)](a67_0x32eb68[_0x4d1b83(0x195)](_0x576b91,_0x4d1b83(0x187)));_0x45dfe9=_0x3b3e93[_0x4d1b83(0x17c)]||_0x4d1b83(0x174);}catch{}const _0x25da3b=readConfig(),_0x36e4be=typeof _0x25da3b[_0x4d1b83(0x173)]==='string'?_0x25da3b[_0x4d1b83(0x173)]:undefined,_0x38465a={};for(const _0xc7be78 of PROJECT_CREATE_INHERITABLE_KEYS){if(_0x25da3b[_0xc7be78]!=null)_0x38465a[_0xc7be78]=_0x25da3b[_0xc7be78];}const _0x534a29=buildCanonicalProjectConfig(_0x38465a,{'appCodes':_0x3a260d?[_0x3a260d]:[],'env':_0x3b0975||_0x36e4be||_0x4d1b83(0x1ae),'metadata':{'createdAt':new Date()[_0x4d1b83(0x15e)](),'version':_0x45dfe9}});writeConfigFile(_0x529756,_0x534a29),_0x3a260d?console['log'](_0x4d1b83(0x16d)+Object[_0x4d1b83(0x184)](_0x534a29[_0x4d1b83(0x17d)]||{})[_0x4d1b83(0x1a9)](',\x20')+_0x4d1b83(0x186)+_0x534a29[_0x4d1b83(0x182)]):console[_0x4d1b83(0x196)](_0x4d1b83(0x19f)+CLI_BIN_NAME+'\x20config\x20set\x20appcode\x20<app-code>\x27'),logger['info'](_0x4d1b83(0x171),_0x4d1b83(0x197)+_0x3a260d);}catch(_0x2d707a){logger[_0x4d1b83(0x17b)](_0x4d1b83(0x171),_0x4d1b83(0x199));}}
1
+ (function(_0x506459,_0x25f164){const _0x274396=a67_0x121b,_0x3c04ef=_0x506459();while(!![]){try{const _0x4dbe7f=-parseInt(_0x274396(0xf3))/0x1+-parseInt(_0x274396(0xf4))/0x2+-parseInt(_0x274396(0xf9))/0x3+-parseInt(_0x274396(0x133))/0x4*(parseInt(_0x274396(0xe6))/0x5)+-parseInt(_0x274396(0xf7))/0x6+parseInt(_0x274396(0x132))/0x7+parseInt(_0x274396(0x127))/0x8;if(_0x4dbe7f===_0x25f164)break;else _0x3c04ef['push'](_0x3c04ef['shift']());}catch(_0x4579f3){_0x3c04ef['push'](_0x3c04ef['shift']());}}}(a67_0x4206,0x5687d));import a67_0x317c8f from'path';import a67_0x1a089c from'fs';import a67_0x56368a from'chalk';function a67_0x4206(){const _0x5e09ae=['error','配置应用AppCode:\x20','!\x20API\x20configuration\x20pull\x20error,\x20you\x20can\x20manually\x20run:\x20rabetbase\x20api\x20pull','Invalid\x20characters\x20in\x20project\x20name.\x20Not\x20allowed:\x20<\x20>\x20:\x20\x22\x20|\x20?\x20*\x20and\x20control\x20characters','\x20Generated\x20by\x20rabetbase\x20cli\x20','\x20dataset(s),\x20generated\x20','info','message','log','dirname','rmSync','parse','description','清理项目目录失败:\x20','name','cookie','√\x20package.json\x20updated:\x20name=','√\x20Configuration\x20file\x20created,\x20you\x20can\x20configure\x20later\x20with\x20\x27','√\x20Pulled\x20','length','trim','更新\x20package.json\x20name','\x20already\x20exists','\x20api\x20pull','Project\x20name:\x20','constants','projectCode','\x20|\x20Default:\x20','accessSync','\x20run\x20start','配置应用AppCode失败','Project\x20name\x20is\x20too\x20long,\x20maximum\x20100\x20characters','readFileSync','\x20model(s)','existsSync','package.json','🚀\x20Next\x20Steps:','keys','warn','开始创建项目:\x20','bold','Project\x20directory\x20','Project\x20name\x20cannot\x20be\x20empty','Format\x20code','\x20&&\x20','11548416aJqMpX','Copy\x20project\x20files','modelCount','CLI\x20版本检查','create','join','更新\x20package.json\x20失败','env','success','API\x20配置拉取异常','needsUpgrade','1680476cSkqeA','41196bTxejn','projectName','setLogPath','utf8','*\x20Updating\x20package.json\x20name\x20and\x20description\x20fields','\x20√\x20','green','chdir','gray','120ktardw','appCode','\x20|\x20AppCode:\x20','version','string','*\x20Cleaning\x20up\x20failed\x20project\x20directory:\x20','\x20config\x20set\x20appcode\x20<app-code>\x27','1.0.0','...','writeFileSync','fail','cwd','cyan','75291OKufVy','531688ogLMHE','production','*\x20Creating\x20configuration\x20file\x20for\x20project\x20','2220318UQKTkx','defaultApp','1112481duHrgD'];a67_0x4206=function(){return _0x5e09ae;};return a67_0x4206();}import a67_0x13aa8b from'ora';import{guidedCreateProject}from'../../../commands/project/create/enhanced-guided-create.js';import{fetchModelList}from'../../../api/fetch-model-list.js';import{generateApiFile}from'../../../api/generate-api-file.js';import{initEnv}from'../../../constant/env.js';import{readConfig}from'../../../utils/config.js';import{CLI_BIN_NAME}from'../../../constant/cli.js';import{DEFAULT_API_DIR}from'../../../constant/paths.js';import{writeConfigFile,NEW_CONFIG_NAME}from'../../../context.js';import{copyProjectTemplate}from'../../../commands/project/create/use-copy-project-template.js';import{installDependencies}from'../../../commands/project/create/use-install-dependencies.js';function a67_0x121b(_0x44f572,_0x5947f9){_0x44f572=_0x44f572-0xde;const _0x420636=a67_0x4206();let _0x121be0=_0x420636[_0x44f572];return _0x121be0;}import{formatProjectCode}from'../../../commands/project/create/use-format-code.js';import{logger}from'../../../utils/logger.js';import{checkCliVersion,printCliUpgradeWarning}from'../../../utils/cli-version-check.js';import{PROJECT_CREATE_INHERITABLE_KEYS,buildCanonicalProjectConfig}from'../../../config/schema.js';import{selectSingleAppcode}from'../../../commands/common/app-selector.js';import{getRabetbaseCliPackageRoot}from'../../../commands/project/create/project-template-path.js';export async function createApp(_0x478f19){const _0x48d436=a67_0x121b,_0x2f3fae=await checkCliVersion();_0x2f3fae[_0x48d436(0x131)]&&(printCliUpgradeWarning(_0x2f3fae),logger['info'](_0x48d436(0x12b),_0x48d436(0x12a),{'currentVersion':_0x2f3fae['currentVersion'],'stableVersion':_0x2f3fae['stableVersion'],'needsUpgrade':_0x2f3fae[_0x48d436(0x131)]}));if(_0x478f19[_0x48d436(0x114)]&&_0x478f19[_0x48d436(0xe7)])await runCreate({'projectName':_0x478f19[_0x48d436(0x114)],'appCode':_0x478f19['appCode'],'env':_0x478f19['env']},_0x478f19);else{if(_0x478f19['projectCode']){const _0x446b46=await selectSingleAppcode(_0x478f19[_0x48d436(0x109)]);await runCreate({'projectName':_0x478f19[_0x48d436(0x114)],'appCode':_0x446b46||undefined,'env':_0x478f19[_0x48d436(0x12e)]},_0x478f19);}else await guidedCreateProject(_0x17476b=>runCreate(_0x17476b,_0x478f19),_0x478f19[_0x48d436(0x12e)],_0x478f19[_0x48d436(0x109)]);}}async function runCreate(_0x3099c5,_0x435f10){const _0x1d1a2b=a67_0x121b;if(!_0x3099c5[_0x1d1a2b(0xde)]||_0x3099c5[_0x1d1a2b(0xde)][_0x1d1a2b(0x10e)]()==='')throw new Error(_0x1d1a2b(0x124));const _0x2df16a=/[<>:"|?*\x00-\x1f\x7f]/;if(_0x2df16a['test'](_0x3099c5['projectName']))throw new Error(_0x1d1a2b(0xfd));if(_0x3099c5[_0x1d1a2b(0xde)][_0x1d1a2b(0x10d)]>0x64)throw new Error(_0x1d1a2b(0x119));const _0x1ce210=a67_0x317c8f['resolve'](process[_0x1d1a2b(0xf1)](),_0x3099c5[_0x1d1a2b(0xde)]);if(a67_0x1a089c[_0x1d1a2b(0x11c)](_0x1ce210))throw new Error(_0x1d1a2b(0x123)+_0x3099c5['projectName']+_0x1d1a2b(0x110));try{a67_0x1a089c[_0x1d1a2b(0x116)](a67_0x317c8f[_0x1d1a2b(0x103)](_0x1ce210),a67_0x1a089c[_0x1d1a2b(0x113)]['W_OK']);}catch{throw new Error('Cannot\x20create\x20project\x20in\x20current\x20directory,\x20please\x20check\x20directory\x20permissions');}logger[_0x1d1a2b(0xdf)](_0x1ce210),logger[_0x1d1a2b(0x100)](_0x1d1a2b(0x12b),_0x1d1a2b(0x121)+_0x3099c5['projectName'],{'projectDir':_0x1ce210,'appCode':_0x3099c5[_0x1d1a2b(0xe7)]}),console['log'](),console[_0x1d1a2b(0x102)](a67_0x56368a[_0x1d1a2b(0xe3)](_0x1d1a2b(0xe2))+_0x1d1a2b(0x112)+a67_0x56368a['green'](_0x3099c5['projectName'])+(_0x3099c5[_0x1d1a2b(0xe7)]?_0x1d1a2b(0xe8)+a67_0x56368a[_0x1d1a2b(0xf2)](_0x3099c5[_0x1d1a2b(0xe7)]):''));try{await runTask(_0x1d1a2b(0x128),()=>copyProjectTemplate(_0x3099c5[_0x1d1a2b(0xde)])),await updatePackageJsonName(_0x3099c5[_0x1d1a2b(0xde)]),await runTask('Install\x20dependencies',()=>installDependencies(_0x3099c5[_0x1d1a2b(0xde)])),await runTask(_0x1d1a2b(0x125),()=>formatProjectCode(_0x3099c5[_0x1d1a2b(0xde)])),await configureAppCode(_0x3099c5['projectName'],_0x3099c5[_0x1d1a2b(0xe7)]||'',_0x3099c5[_0x1d1a2b(0x12e)]);let _0x16920e=![];if(_0x3099c5[_0x1d1a2b(0xe7)]){console[_0x1d1a2b(0x102)]('*\x20Pulling\x20API\x20configuration...');const _0x289115=process['cwd']();try{process['chdir'](_0x1ce210);const _0x7e552a=_0x3099c5[_0x1d1a2b(0x12e)]||'production';initEnv(_0x7e552a);const {configArray:_0x49c0ad}=await fetchModelList(_0x3099c5[_0x1d1a2b(0xe7)],_0x435f10['cookie']||''),_0x3d5e8a=DEFAULT_API_DIR,_0x45e046=await generateApiFile(_0x49c0ad,'',_0x3099c5[_0x1d1a2b(0xe7)],!![],_0x7e552a,_0x3d5e8a);console['log'](_0x1d1a2b(0x10c)+_0x49c0ad[_0x1d1a2b(0x10d)]+_0x1d1a2b(0xff)+_0x45e046[_0x1d1a2b(0x129)]+_0x1d1a2b(0x11b)),logger[_0x1d1a2b(0x100)](_0x1d1a2b(0x12b),'API\x20configuration\x20pulled:\x20'+_0x3099c5[_0x1d1a2b(0xe7)]);}catch(_0x34de3f){_0x16920e=!![],console[_0x1d1a2b(0x102)](_0x1d1a2b(0xfc)),logger[_0x1d1a2b(0x120)](_0x1d1a2b(0x12b),_0x1d1a2b(0x130),{'error':_0x34de3f instanceof Error?_0x34de3f[_0x1d1a2b(0x101)]:String(_0x34de3f)});}finally{process[_0x1d1a2b(0xe4)](_0x289115);}}logger[_0x1d1a2b(0x12f)](_0x1d1a2b(0x12b),'项目创建完成:\x20'+_0x3099c5['projectName']),console[_0x1d1a2b(0x102)](),console[_0x1d1a2b(0x102)](a67_0x56368a['green']('─'['repeat'](0x3c))),console['log'](a67_0x56368a[_0x1d1a2b(0xf2)][_0x1d1a2b(0x122)](_0x1d1a2b(0x11e))),console[_0x1d1a2b(0x102)](),console[_0x1d1a2b(0x102)]('\x20\x201.\x20Start\x20project:\x20'+a67_0x56368a[_0x1d1a2b(0xf2)]['bold']('cd\x20'+_0x3099c5[_0x1d1a2b(0xde)]+_0x1d1a2b(0x126)+CLI_BIN_NAME+_0x1d1a2b(0x117))),_0x16920e&&console['log']('\x20\x202.\x20Pull\x20API\x20configuration:\x20'+a67_0x56368a['cyan'][_0x1d1a2b(0x122)](CLI_BIN_NAME+_0x1d1a2b(0x111))),console[_0x1d1a2b(0x102)](a67_0x56368a[_0x1d1a2b(0xe3)]('─'['repeat'](0x3c)));}catch(_0x4b766f){logger[_0x1d1a2b(0xfa)](_0x1d1a2b(0x12b),'项目创建失败:\x20'+_0x3099c5[_0x1d1a2b(0xde)],{'error':_0x4b766f instanceof Error?_0x4b766f[_0x1d1a2b(0x101)]:String(_0x4b766f)});try{a67_0x1a089c['existsSync'](_0x1ce210)&&(console[_0x1d1a2b(0x102)](_0x1d1a2b(0xeb)+_0x1ce210),a67_0x1a089c[_0x1d1a2b(0x104)](_0x1ce210,{'recursive':!![],'force':!![]}));}catch{logger[_0x1d1a2b(0x120)](_0x1d1a2b(0x12b),_0x1d1a2b(0x107)+_0x1ce210);}throw _0x4b766f;}}async function runTask(_0x456ed2,_0x5ca313){const _0x4fc09f=a67_0x121b,_0x12d96a=a67_0x13aa8b(_0x456ed2+_0x4fc09f(0xee))['start']();try{const _0x4e4634=await _0x5ca313();_0x12d96a['stop'](),console[_0x4fc09f(0x102)](''+a67_0x56368a['green'](_0x4fc09f(0xe2))+_0x456ed2+'\x20'+a67_0x56368a[_0x4fc09f(0xe5)]('['+_0x4e4634+']'));}catch(_0x18c244){_0x12d96a[_0x4fc09f(0xf0)](_0x456ed2);throw _0x18c244;}}async function updatePackageJsonName(_0x17ea77){const _0x5d1bbf=a67_0x121b,_0x10bef6=a67_0x317c8f['resolve'](process[_0x5d1bbf(0xf1)](),_0x17ea77),_0x7a952e=a67_0x317c8f[_0x5d1bbf(0x12c)](_0x10bef6,'package.json');try{console[_0x5d1bbf(0x102)](_0x5d1bbf(0xe1));const _0xc9088a=getRabetbaseCliPackageRoot(),_0x4b153d=a67_0x317c8f[_0x5d1bbf(0x12c)](_0xc9088a,_0x5d1bbf(0x11d));let _0x566890=_0x5d1bbf(0xed);try{const _0x4c0938=JSON[_0x5d1bbf(0x105)](a67_0x1a089c['readFileSync'](_0x4b153d,_0x5d1bbf(0xe0)));_0x566890=_0x4c0938[_0x5d1bbf(0xe9)]||_0x5d1bbf(0xed);}catch{}const _0x45c31c=a67_0x1a089c[_0x5d1bbf(0x11a)](_0x7a952e,_0x5d1bbf(0xe0)),_0x3df0a1=JSON[_0x5d1bbf(0x105)](_0x45c31c);_0x3df0a1[_0x5d1bbf(0x108)]=_0x17ea77,_0x3df0a1[_0x5d1bbf(0x106)]=_0x17ea77+_0x5d1bbf(0xfe)+_0x566890,a67_0x1a089c[_0x5d1bbf(0xef)](_0x7a952e,JSON['stringify'](_0x3df0a1,null,0x2)+'\x0a',_0x5d1bbf(0xe0)),console[_0x5d1bbf(0x102)](_0x5d1bbf(0x10a)+_0x17ea77),logger[_0x5d1bbf(0x100)]('create',_0x5d1bbf(0x10f));}catch(_0x73a160){logger[_0x5d1bbf(0xfa)](_0x5d1bbf(0x12b),_0x5d1bbf(0x12d));throw _0x73a160;}}async function configureAppCode(_0x13c730,_0x15e171,_0x201398){const _0x4aedd6=a67_0x121b,_0x355805=a67_0x317c8f['resolve'](process[_0x4aedd6(0xf1)](),_0x13c730),_0x41c7cf=a67_0x317c8f[_0x4aedd6(0x12c)](_0x355805,NEW_CONFIG_NAME);try{_0x15e171?console[_0x4aedd6(0x102)]('*\x20Configuring\x20AppCode\x20for\x20project\x20'+_0x13c730+':\x20'+_0x15e171):console['log'](_0x4aedd6(0xf6)+_0x13c730);const _0x5a5ad6=getRabetbaseCliPackageRoot(),_0xc37e27=a67_0x317c8f['join'](_0x5a5ad6,_0x4aedd6(0x11d));let _0x39fb3f='1.0.0';try{const _0xeb3b78=JSON['parse'](a67_0x1a089c[_0x4aedd6(0x11a)](_0xc37e27,_0x4aedd6(0xe0)));_0x39fb3f=_0xeb3b78[_0x4aedd6(0xe9)]||_0x4aedd6(0xed);}catch{}const _0x1b3f15=readConfig(),_0x15931e=typeof _0x1b3f15[_0x4aedd6(0x12e)]===_0x4aedd6(0xea)?_0x1b3f15[_0x4aedd6(0x12e)]:undefined,_0x32106e={};for(const _0x4df6e1 of PROJECT_CREATE_INHERITABLE_KEYS){if(_0x1b3f15[_0x4df6e1]!=null)_0x32106e[_0x4df6e1]=_0x1b3f15[_0x4df6e1];}const _0x2f03e0=buildCanonicalProjectConfig(_0x32106e,{'appCodes':_0x15e171?[_0x15e171]:[],'env':_0x201398||_0x15931e||_0x4aedd6(0xf5),'metadata':{'createdAt':new Date()['toLocaleString'](),'version':_0x39fb3f}});writeConfigFile(_0x41c7cf,_0x2f03e0),_0x15e171?console[_0x4aedd6(0x102)]('√\x20Configuration\x20file\x20created,\x20Apps:\x20'+Object[_0x4aedd6(0x11f)](_0x2f03e0['apps']||{})['join'](',\x20')+_0x4aedd6(0x115)+_0x2f03e0[_0x4aedd6(0xf8)]):console[_0x4aedd6(0x102)](_0x4aedd6(0x10b)+CLI_BIN_NAME+_0x4aedd6(0xec)),logger['info'](_0x4aedd6(0x12b),_0x4aedd6(0xfb)+_0x15e171);}catch(_0x59ba34){logger[_0x4aedd6(0xfa)]('create',_0x4aedd6(0x118));}}
@@ -1 +1 @@
1
- (function(_0x37c4b5,_0x2c6a30){const _0x5281bf=a61_0x53d0,_0x42f53a=_0x37c4b5();while(!![]){try{const _0x435f17=-parseInt(_0x5281bf(0xc7))/0x1+-parseInt(_0x5281bf(0xd6))/0x2+parseInt(_0x5281bf(0xdf))/0x3*(-parseInt(_0x5281bf(0xc0))/0x4)+-parseInt(_0x5281bf(0xd7))/0x5+parseInt(_0x5281bf(0xd3))/0x6*(-parseInt(_0x5281bf(0xb1))/0x7)+parseInt(_0x5281bf(0xb4))/0x8+parseInt(_0x5281bf(0xc9))/0x9*(parseInt(_0x5281bf(0xc8))/0xa);if(_0x435f17===_0x2c6a30)break;else _0x42f53a['push'](_0x42f53a['shift']());}catch(_0x5941e0){_0x42f53a['push'](_0x42f53a['shift']());}}}(a61_0x2143,0x728e2));import a61_0x461511 from'path';import a61_0x15b9b5 from'fs/promises';import{existsSync}from'fs';import{CLI_BIN_NAME}from'../../../constant/cli.js';function a61_0x2143(){const _0x3e5e42=['npm','W_OK','1542774TviDWB','\x0a√\x20Project\x20','\x20model(s)','1584116dcUOEe','1719615WtnuUg','\x20api\x20pull`\x20manually\x20later.','trim','\x20\x20√\x20Project\x20template\x20created','chdir','utf-8','resolve','...','807132aisNcb','Check\x20directory\x20permissions.','\x20\x20!\x20API\x20pull\x20failed,\x20run\x20`','name','Cannot\x20create\x20project\x20in\x20current\x20directory.','ignore','bun\x20run\x20format','cwd','\x20\x20√\x20package.json\x20updated','\x20\x20Installing\x20dependencies...','needsUpgrade','bun','7jEjVvH','\x20dataset(s),\x20generated\x20','join','3788312BdraMs','stringify','log','bun\x20--version','\x22\x20already\x20exists.','\x20\x20√\x20Code\x20formatted','validation','access','\x20\x20√\x20Pulled\x20','*\x20Creating\x20project\x20','modelCount','Project\x20name\x20is\x20too\x20long,\x20maximum\x20100\x20characters.','12djGkHj','constants','package.json','length','readFile','A\x20project\x20created\x20with\x20Lovrabet\x20CLI','production','129167PcVInf','6430XStxJd','32544qWQsXT','Project\x20directory\x20\x22','description','\x20\x20√\x20Configuration\x20file\x20created','toLocaleString','Use\x20a\x20different\x20project\x20name.','dirname','string'];a61_0x2143=function(){return _0x3e5e42;};return a61_0x2143();}import{DEFAULT_API_DIR}from'../../../constant/paths.js';import{exec,execSync}from'child_process';import{copyDirectory}from'../../../utils/copy-directory.js';import{promisify}from'util';import{checkCliVersion,printCliUpgradeWarning}from'../../../utils/cli-version-check.js';import{writeConfigFile,NEW_CONFIG_NAME}from'../../../context.js';import{readConfig}from'../../../utils/config.js';import{getCliVersion}from'../../../utils/version.js';import{CliErrors}from'../../../errors.js';import{fetchModelList}from'../../../api/fetch-model-list.js';import{generateApiFile}from'../../../api/generate-api-file.js';import{initEnv}from'../../../constant/env.js';import{getSubAppReactDemoTemplateDir}from'../../../commands/project/create/project-template-path.js';import{PROJECT_CREATE_INHERITABLE_KEYS,buildCanonicalProjectConfig}from'../../../config/schema.js';const execAsync=promisify(exec);export async function createProjectNonInteractive(_0x4e3416,_0x1c88e8,_0x3aff4b,_0x3feec7){const _0x310418=a61_0x53d0,_0x48f3eb=await checkCliVersion();_0x48f3eb[_0x310418(0xaf)]&&printCliUpgradeWarning(_0x48f3eb);if(!_0x4e3416||_0x4e3416[_0x310418(0xd9)]()==='')throw CliErrors[_0x310418(0xba)]('Project\x20name\x20cannot\x20be\x20empty.');const _0x2a4eae=/[<>:"|?*\x00-\x1f\x7f]/;if(_0x2a4eae['test'](_0x4e3416))throw CliErrors[_0x310418(0xba)]('Project\x20name\x20contains\x20invalid\x20characters.','Not\x20allowed:\x20<\x20>\x20:\x20\x22\x20|\x20?\x20*\x20and\x20control\x20characters');if(_0x4e3416[_0x310418(0xc3)]>0x64)throw CliErrors[_0x310418(0xba)](_0x310418(0xbf));const _0x36b4e7=a61_0x461511[_0x310418(0xdd)](process['cwd'](),_0x4e3416);if(existsSync(_0x36b4e7))throw CliErrors[_0x310418(0xba)](_0x310418(0xca)+_0x4e3416+_0x310418(0xb8),_0x310418(0xce));try{const _0x3d01bd=a61_0x461511[_0x310418(0xcf)](_0x36b4e7);await a61_0x15b9b5[_0x310418(0xbb)](_0x3d01bd,a61_0x15b9b5[_0x310418(0xc1)][_0x310418(0xd2)]);}catch{throw CliErrors['validation'](_0x310418(0xe3),_0x310418(0xe0));}try{console[_0x310418(0xb6)](_0x310418(0xbd)+_0x4e3416+_0x310418(0xde));const _0x5086a0=getSubAppReactDemoTemplateDir();await copyDirectory(_0x5086a0,_0x36b4e7),console['log'](_0x310418(0xda)),await updatePackageJsonName(_0x4e3416),console['log'](_0x310418(0xad)),console['log'](_0x310418(0xae)),console[_0x310418(0xb6)]('\x20\x20√\x20Dependency\x20install\x20skipped\x20(non-interactive)'),await formatCode(_0x36b4e7),console[_0x310418(0xb6)](_0x310418(0xb9)),await configureProject(_0x4e3416,_0x3aff4b,_0x1c88e8),console[_0x310418(0xb6)](_0x310418(0xcc)),_0x3aff4b&&await pullApiConfig(_0x36b4e7,_0x3aff4b,_0x1c88e8,_0x3feec7),console[_0x310418(0xb6)](_0x310418(0xd4)+_0x4e3416+'\x20created\x20successfully!'),console['log']('\x0a\x20\x20cd\x20'+_0x4e3416),console[_0x310418(0xb6)]('\x20\x20rabetbase\x20run\x20start\x0a');}catch(_0x15c1f2){try{existsSync(_0x36b4e7)&&await a61_0x15b9b5['rm'](_0x36b4e7,{'recursive':!![],'force':!![]});}catch{}throw _0x15c1f2;}}async function updatePackageJsonName(_0x473abb){const _0x14154a=a61_0x53d0,_0x3f930e=a61_0x461511[_0x14154a(0xdd)](process[_0x14154a(0xac)](),_0x473abb),_0x6c2822=a61_0x461511[_0x14154a(0xb3)](_0x3f930e,_0x14154a(0xc2)),_0x37c6b3=await a61_0x15b9b5[_0x14154a(0xc4)](_0x6c2822,_0x14154a(0xdc)),_0x5c7972=JSON['parse'](_0x37c6b3);_0x5c7972[_0x14154a(0xe2)]=_0x473abb,_0x5c7972[_0x14154a(0xcb)]=_0x14154a(0xc5),await a61_0x15b9b5['writeFile'](_0x6c2822,JSON[_0x14154a(0xb5)](_0x5c7972,null,0x2)+'\x0a');}function detectPackageManager(){const _0x5748a1=a61_0x53d0;try{return execSync(_0x5748a1(0xb7),{'stdio':_0x5748a1(0xaa)}),_0x5748a1(0xb0);}catch{return _0x5748a1(0xd1);}}async function formatCode(_0x5c27f8){const _0x5409aa=a61_0x53d0;try{await execAsync(_0x5409aa(0xab),{'cwd':_0x5c27f8});}catch{}}function a61_0x53d0(_0x306d16,_0x3a2d19){_0x306d16=_0x306d16-0xaa;const _0x214373=a61_0x2143();let _0x53d04e=_0x214373[_0x306d16];return _0x53d04e;}async function configureProject(_0x43313a,_0x5d2548,_0x462b55){const _0xda2986=a61_0x53d0,_0x357635=a61_0x461511[_0xda2986(0xdd)](process['cwd'](),_0x43313a),_0xcea1cf=a61_0x461511[_0xda2986(0xb3)](_0x357635,NEW_CONFIG_NAME),_0x270eb0=readConfig(),_0x329100=typeof _0x270eb0['env']===_0xda2986(0xd0)?_0x270eb0['env']:undefined,_0x5ddf9b={};for(const _0x506f38 of PROJECT_CREATE_INHERITABLE_KEYS){if(_0x270eb0[_0x506f38]!=null)_0x5ddf9b[_0x506f38]=_0x270eb0[_0x506f38];}const _0x1ceea3=buildCanonicalProjectConfig(_0x5ddf9b,{'appCodes':_0x5d2548?[_0x5d2548]:[],'env':_0x462b55||_0x329100||_0xda2986(0xc6),'metadata':{'createdAt':new Date()[_0xda2986(0xcd)](),'version':getCliVersion()}});writeConfigFile(_0xcea1cf,_0x1ceea3);}async function pullApiConfig(_0x188199,_0x5af073,_0x891374,_0x3a40db){const _0x3d693c=a61_0x53d0,_0x2c5b6f=process['cwd']();try{process[_0x3d693c(0xdb)](_0x188199);const _0x1b71c7=_0x891374||_0x3d693c(0xc6);initEnv(_0x1b71c7),console['log']('\x20\x20Pulling\x20API\x20configuration...');const {configArray:_0x2f0895}=await fetchModelList(_0x5af073,_0x3a40db||''),_0x4f5fb0=await generateApiFile(_0x2f0895,'',_0x5af073,!![],_0x1b71c7,DEFAULT_API_DIR);console[_0x3d693c(0xb6)](_0x3d693c(0xbc)+_0x2f0895[_0x3d693c(0xc3)]+_0x3d693c(0xb2)+_0x4f5fb0[_0x3d693c(0xbe)]+_0x3d693c(0xd5));}catch(_0x5247a7){console[_0x3d693c(0xb6)](_0x3d693c(0xe1)+CLI_BIN_NAME+_0x3d693c(0xd8));}finally{process[_0x3d693c(0xdb)](_0x2c5b6f);}}
1
+ (function(_0xa4db88,_0x2e067d){const _0x4c10dc=a61_0x3074,_0x3da6c5=_0xa4db88();while(!![]){try{const _0x4c87e8=parseInt(_0x4c10dc(0x192))/0x1*(-parseInt(_0x4c10dc(0x1b0))/0x2)+parseInt(_0x4c10dc(0x18b))/0x3+-parseInt(_0x4c10dc(0x19f))/0x4+-parseInt(_0x4c10dc(0x1c2))/0x5+-parseInt(_0x4c10dc(0x1bf))/0x6*(-parseInt(_0x4c10dc(0x1a8))/0x7)+parseInt(_0x4c10dc(0x1c0))/0x8+parseInt(_0x4c10dc(0x1b2))/0x9;if(_0x4c87e8===_0x2e067d)break;else _0x3da6c5['push'](_0x3da6c5['shift']());}catch(_0x3cab2f){_0x3da6c5['push'](_0x3da6c5['shift']());}}}(a61_0x193f,0x44451));import a61_0x3355ab from'path';import a61_0x3896f9 from'fs/promises';import{existsSync}from'fs';import{CLI_BIN_NAME}from'../../../constant/cli.js';import{DEFAULT_API_DIR}from'../../../constant/paths.js';import{exec,execSync}from'child_process';import{copyDirectory}from'../../../utils/copy-directory.js';import{promisify}from'util';import{checkCliVersion,printCliUpgradeWarning}from'../../../utils/cli-version-check.js';import{writeConfigFile,NEW_CONFIG_NAME}from'../../../context.js';import{readConfig}from'../../../utils/config.js';import{getCliVersion}from'../../../utils/version.js';import{CliErrors}from'../../../errors.js';function a61_0x193f(){const _0x486298=['\x20\x20√\x20Project\x20template\x20created','parse','\x20\x20rabetbase\x20run\x20start\x0a','Cannot\x20create\x20project\x20in\x20current\x20directory.','\x0a\x20\x20cd\x20','name','1boDCzy','join','A\x20project\x20created\x20with\x20Lovrabet\x20CLI','\x20api\x20pull`\x20manually\x20later.','modelCount','resolve','\x20dataset(s),\x20generated\x20','\x0a√\x20Project\x20','cwd','production','\x22\x20already\x20exists.','npm','validation','1750176EMyYbi','\x20\x20√\x20Code\x20formatted','Project\x20name\x20is\x20too\x20long,\x20maximum\x20100\x20characters.','...','bun\x20--version','needsUpgrade','string','chdir','bun','2255827aihSKt','constants','bun\x20run\x20format','trim','ignore','Not\x20allowed:\x20<\x20>\x20:\x20\x22\x20|\x20?\x20*\x20and\x20control\x20characters','length','*\x20Creating\x20project\x20','842082oDWkGC','utf-8','929025umfMUS','env','log','\x20\x20Installing\x20dependencies...','\x20\x20√\x20Pulled\x20','writeFile','Project\x20directory\x20\x22','access','\x20\x20√\x20package.json\x20updated','\x20\x20!\x20API\x20pull\x20failed,\x20run\x20`','description','stringify','readFile','6SqDEeU','4014656McZXak','Project\x20name\x20contains\x20invalid\x20characters.','649110YTOjxm','toLocaleString','\x20model(s)','1022166WBATkh'];a61_0x193f=function(){return _0x486298;};return a61_0x193f();}import{fetchModelList}from'../../../api/fetch-model-list.js';import{generateApiFile}from'../../../api/generate-api-file.js';import{initEnv}from'../../../constant/env.js';import{getSubAppReactDemoTemplateDir}from'../../../commands/project/create/project-template-path.js';import{PROJECT_CREATE_INHERITABLE_KEYS,buildCanonicalProjectConfig}from'../../../config/schema.js';const execAsync=promisify(exec);function a61_0x3074(_0x1c91f3,_0x13d474){_0x1c91f3=_0x1c91f3-0x18b;const _0x193fb2=a61_0x193f();let _0x307416=_0x193fb2[_0x1c91f3];return _0x307416;}export async function createProjectNonInteractive(_0x131c4b,_0x388d31,_0x487970,_0x56ea6d){const _0x76845f=a61_0x3074,_0x36728e=await checkCliVersion();_0x36728e[_0x76845f(0x1a4)]&&printCliUpgradeWarning(_0x36728e);if(!_0x131c4b||_0x131c4b[_0x76845f(0x1ab)]()==='')throw CliErrors[_0x76845f(0x19e)]('Project\x20name\x20cannot\x20be\x20empty.');const _0x139dc3=/[<>:"|?*\x00-\x1f\x7f]/;if(_0x139dc3['test'](_0x131c4b))throw CliErrors[_0x76845f(0x19e)](_0x76845f(0x1c1),_0x76845f(0x1ad));if(_0x131c4b[_0x76845f(0x1ae)]>0x64)throw CliErrors[_0x76845f(0x19e)](_0x76845f(0x1a1));const _0x43d0af=a61_0x3355ab[_0x76845f(0x197)](process[_0x76845f(0x19a)](),_0x131c4b);if(existsSync(_0x43d0af))throw CliErrors[_0x76845f(0x19e)](_0x76845f(0x1b8)+_0x131c4b+_0x76845f(0x19c),'Use\x20a\x20different\x20project\x20name.');try{const _0x45af04=a61_0x3355ab['dirname'](_0x43d0af);await a61_0x3896f9[_0x76845f(0x1b9)](_0x45af04,a61_0x3896f9[_0x76845f(0x1a9)]['W_OK']);}catch{throw CliErrors[_0x76845f(0x19e)](_0x76845f(0x18f),'Check\x20directory\x20permissions.');}try{console[_0x76845f(0x1b4)](_0x76845f(0x1af)+_0x131c4b+_0x76845f(0x1a2));const _0x174ecf=getSubAppReactDemoTemplateDir();await copyDirectory(_0x174ecf,_0x43d0af),console['log'](_0x76845f(0x18c)),await updatePackageJsonName(_0x131c4b),console[_0x76845f(0x1b4)](_0x76845f(0x1ba)),console['log'](_0x76845f(0x1b5)),console[_0x76845f(0x1b4)]('\x20\x20√\x20Dependency\x20install\x20skipped\x20(non-interactive)'),await formatCode(_0x43d0af),console['log'](_0x76845f(0x1a0)),await configureProject(_0x131c4b,_0x487970,_0x388d31),console[_0x76845f(0x1b4)]('\x20\x20√\x20Configuration\x20file\x20created'),_0x487970&&await pullApiConfig(_0x43d0af,_0x487970,_0x388d31,_0x56ea6d),console[_0x76845f(0x1b4)](_0x76845f(0x199)+_0x131c4b+'\x20created\x20successfully!'),console[_0x76845f(0x1b4)](_0x76845f(0x190)+_0x131c4b),console[_0x76845f(0x1b4)](_0x76845f(0x18e));}catch(_0x376949){try{existsSync(_0x43d0af)&&await a61_0x3896f9['rm'](_0x43d0af,{'recursive':!![],'force':!![]});}catch{}throw _0x376949;}}async function updatePackageJsonName(_0x4e8d99){const _0x734ac4=a61_0x3074,_0xe77c08=a61_0x3355ab[_0x734ac4(0x197)](process['cwd'](),_0x4e8d99),_0x58107e=a61_0x3355ab[_0x734ac4(0x193)](_0xe77c08,'package.json'),_0x5c40f9=await a61_0x3896f9[_0x734ac4(0x1be)](_0x58107e,_0x734ac4(0x1b1)),_0x55aabb=JSON[_0x734ac4(0x18d)](_0x5c40f9);_0x55aabb[_0x734ac4(0x191)]=_0x4e8d99,_0x55aabb[_0x734ac4(0x1bc)]=_0x734ac4(0x194),await a61_0x3896f9[_0x734ac4(0x1b7)](_0x58107e,JSON[_0x734ac4(0x1bd)](_0x55aabb,null,0x2)+'\x0a');}function detectPackageManager(){const _0x2deccd=a61_0x3074;try{return execSync(_0x2deccd(0x1a3),{'stdio':_0x2deccd(0x1ac)}),_0x2deccd(0x1a7);}catch{return _0x2deccd(0x19d);}}async function formatCode(_0x23879e){const _0x59e3e9=a61_0x3074;try{await execAsync(_0x59e3e9(0x1aa),{'cwd':_0x23879e});}catch{}}async function configureProject(_0x4b61e2,_0x51c24a,_0x5c4d29){const _0x480b9b=a61_0x3074,_0x18760f=a61_0x3355ab[_0x480b9b(0x197)](process['cwd'](),_0x4b61e2),_0x257410=a61_0x3355ab[_0x480b9b(0x193)](_0x18760f,NEW_CONFIG_NAME),_0x1a43cc=readConfig(),_0x483b35=typeof _0x1a43cc[_0x480b9b(0x1b3)]===_0x480b9b(0x1a5)?_0x1a43cc['env']:undefined,_0x49d92f={};for(const _0x4fc57d of PROJECT_CREATE_INHERITABLE_KEYS){if(_0x1a43cc[_0x4fc57d]!=null)_0x49d92f[_0x4fc57d]=_0x1a43cc[_0x4fc57d];}const _0xaed72b=buildCanonicalProjectConfig(_0x49d92f,{'appCodes':_0x51c24a?[_0x51c24a]:[],'env':_0x5c4d29||_0x483b35||_0x480b9b(0x19b),'metadata':{'createdAt':new Date()[_0x480b9b(0x1c3)](),'version':getCliVersion()}});writeConfigFile(_0x257410,_0xaed72b);}async function pullApiConfig(_0x2aead4,_0x101388,_0x418de2,_0x3edfc2){const _0x3e2251=a61_0x3074,_0x2f45e5=process[_0x3e2251(0x19a)]();try{process[_0x3e2251(0x1a6)](_0x2aead4);const _0x4b6764=_0x418de2||_0x3e2251(0x19b);initEnv(_0x4b6764),console[_0x3e2251(0x1b4)]('\x20\x20Pulling\x20API\x20configuration...');const {configArray:_0x1739db}=await fetchModelList(_0x101388,_0x3edfc2||''),_0x378a81=await generateApiFile(_0x1739db,'',_0x101388,!![],_0x4b6764,DEFAULT_API_DIR);console['log'](_0x3e2251(0x1b6)+_0x1739db['length']+_0x3e2251(0x198)+_0x378a81[_0x3e2251(0x196)]+_0x3e2251(0x1c4));}catch(_0x4e5143){console[_0x3e2251(0x1b4)](_0x3e2251(0x1bb)+CLI_BIN_NAME+_0x3e2251(0x195));}finally{process[_0x3e2251(0x1a6)](_0x2f45e5);}}
@@ -1 +1 @@
1
- function a65_0x311a(_0xdeea69,_0x391882){_0xdeea69=_0xdeea69-0x15c;const _0x202751=a65_0x2027();let _0x311a52=_0x202751[_0xdeea69];return _0x311a52;}(function(_0x52ccd9,_0x480eba){const _0x56f04f=a65_0x311a,_0x2785f0=_0x52ccd9();while(!![]){try{const _0x554970=parseInt(_0x56f04f(0x15f))/0x1*(-parseInt(_0x56f04f(0x169))/0x2)+-parseInt(_0x56f04f(0x165))/0x3+-parseInt(_0x56f04f(0x162))/0x4+parseInt(_0x56f04f(0x163))/0x5*(-parseInt(_0x56f04f(0x168))/0x6)+parseInt(_0x56f04f(0x15d))/0x7+parseInt(_0x56f04f(0x161))/0x8+parseInt(_0x56f04f(0x15e))/0x9*(parseInt(_0x56f04f(0x15c))/0xa);if(_0x554970===_0x480eba)break;else _0x2785f0['push'](_0x2785f0['shift']());}catch(_0x33ba3c){_0x2785f0['push'](_0x2785f0['shift']());}}}(a65_0x2027,0x4d591));import a65_0x1465a4 from'node:path';import{fileURLToPath}from'node:url';const __dirname=a65_0x1465a4['dirname'](fileURLToPath(import.meta.url));function a65_0x2027(){const _0x5087df=['10AUWPBf','2861992vNhjaU','9314235AcKGHR','683hCkCON','../../../../','1783752JuYexb','2319084pNPyIf','57515LzPTBF','sub-app-react-demo','345921vPjZMI','templates','resolve','312lLRBfQ','166MTCbEd'];a65_0x2027=function(){return _0x5087df;};return a65_0x2027();}export function getRabetbaseCliPackageRoot(){const _0x1de94f=a65_0x311a;return a65_0x1465a4[_0x1de94f(0x167)](__dirname,_0x1de94f(0x160));}export function getSubAppReactDemoTemplateDir(){const _0x5aa0f8=a65_0x311a;return a65_0x1465a4['join'](getRabetbaseCliPackageRoot(),_0x5aa0f8(0x166),'projects',_0x5aa0f8(0x164));}
1
+ const a65_0x667533=a65_0x3b30;(function(_0x16fa42,_0x52e78e){const _0x41700e=a65_0x3b30,_0x53fd80=_0x16fa42();while(!![]){try{const _0x10a01d=parseInt(_0x41700e(0xb3))/0x1*(-parseInt(_0x41700e(0xbf))/0x2)+-parseInt(_0x41700e(0xb1))/0x3*(-parseInt(_0x41700e(0xb5))/0x4)+parseInt(_0x41700e(0xb4))/0x5*(parseInt(_0x41700e(0xc1))/0x6)+parseInt(_0x41700e(0xc0))/0x7+parseInt(_0x41700e(0xb8))/0x8*(-parseInt(_0x41700e(0xc2))/0x9)+-parseInt(_0x41700e(0xb7))/0xa+-parseInt(_0x41700e(0xbc))/0xb*(-parseInt(_0x41700e(0xbe))/0xc);if(_0x10a01d===_0x52e78e)break;else _0x53fd80['push'](_0x53fd80['shift']());}catch(_0x22e925){_0x53fd80['push'](_0x53fd80['shift']());}}}(a65_0x1a50,0xa10e8));import a65_0x5d0fae from'node:path';function a65_0x1a50(){const _0x39f5b1=['7291400fvsxyf','1501496sBtXDf','sub-app-react-demo','templates','join','345796VpBGqw','../../../../','240tMPGxn','4gwrNpB','4822811emrQvo','34590cJKqem','36yqaBNd','dirname','87uKHYpA','resolve','438307KwsLkU','1115tismPv','56952npZumC','projects'];a65_0x1a50=function(){return _0x39f5b1;};return a65_0x1a50();}import{fileURLToPath}from'node:url';const __dirname=a65_0x5d0fae[a65_0x667533(0xb0)](fileURLToPath(import.meta.url));function a65_0x3b30(_0x2ab58f,_0x3cc728){_0x2ab58f=_0x2ab58f-0xb0;const _0x1a502a=a65_0x1a50();let _0x3b3062=_0x1a502a[_0x2ab58f];return _0x3b3062;}export function getRabetbaseCliPackageRoot(){const _0x34892e=a65_0x667533;return a65_0x5d0fae[_0x34892e(0xb2)](__dirname,_0x34892e(0xbd));}export function getSubAppReactDemoTemplateDir(){const _0x2e19c0=a65_0x667533;return a65_0x5d0fae[_0x2e19c0(0xbb)](getRabetbaseCliPackageRoot(),_0x2e19c0(0xba),_0x2e19c0(0xb6),_0x2e19c0(0xb9));}
@@ -1 +1 @@
1
- (function(_0x3fb5d9,_0x3d01fe){const _0xc690dc=a60_0x3352,_0x19f223=_0x3fb5d9();while(!![]){try{const _0x36277f=-parseInt(_0xc690dc(0x129))/0x1+parseInt(_0xc690dc(0x12b))/0x2+-parseInt(_0xc690dc(0x12a))/0x3+parseInt(_0xc690dc(0x12d))/0x4+-parseInt(_0xc690dc(0x130))/0x5+-parseInt(_0xc690dc(0x122))/0x6+parseInt(_0xc690dc(0x125))/0x7;if(_0x36277f===_0x3d01fe)break;else _0x19f223['push'](_0x19f223['shift']());}catch(_0x216873){_0x19f223['push'](_0x19f223['shift']());}}}(a60_0x3a46,0xab062));function a60_0x3a46(){const _0x1449ec=['667566lkcMek','success','now','8864961wjUXWE','error','cwd','项目模板复制失败','1060255tWKZsS','428676aUIVUa','1381790ZYjgxJ','message','1760724tjBiOK','info','项目模板复制完成','1912885EkGAmV','开始复制项目模板','copy'];a60_0x3a46=function(){return _0x1449ec;};return a60_0x3a46();}import a60_0x10da16 from'node:path';import{copyDirectory}from'../../../utils/copy-directory.js';import{formatElapsed}from'../../../commands/project/create/format-elapsed.js';import{logger}from'../../../utils/logger.js';import{getSubAppReactDemoTemplateDir}from'../../../commands/project/create/project-template-path.js';function a60_0x3352(_0x446d90,_0x44f65b){_0x446d90=_0x446d90-0x121;const _0x3a464a=a60_0x3a46();let _0x33523c=_0x3a464a[_0x446d90];return _0x33523c;}const templateDir=getSubAppReactDemoTemplateDir();export async function copyProjectTemplate(_0x48dcbe){const _0x56ec83=a60_0x3352,_0x4ab968=Date[_0x56ec83(0x124)](),_0x4ddd54=a60_0x10da16['resolve'](process[_0x56ec83(0x127)](),_0x48dcbe);try{logger[_0x56ec83(0x12e)](_0x56ec83(0x121),_0x56ec83(0x131),{'projectCode':_0x48dcbe,'templateDir':templateDir}),await copyDirectory(templateDir,_0x4ddd54);const _0x58a4f4=Date['now']()-_0x4ab968;logger[_0x56ec83(0x123)](_0x56ec83(0x121),_0x56ec83(0x12f),_0x58a4f4,{'projectCode':_0x48dcbe});}catch(_0x133505){const _0x1cf2f4=Date[_0x56ec83(0x124)]()-_0x4ab968;logger[_0x56ec83(0x126)](_0x56ec83(0x121),_0x56ec83(0x128),{'projectCode':_0x48dcbe,'error':_0x133505 instanceof Error?_0x133505[_0x56ec83(0x12c)]:String(_0x133505),'duration':_0x1cf2f4});throw _0x133505;}return formatElapsed(_0x4ab968);}
1
+ (function(_0x11950c,_0x36a3c0){const _0x2a3542=a60_0x25e0,_0x4b14eb=_0x11950c();while(!![]){try{const _0x24a275=-parseInt(_0x2a3542(0xc7))/0x1+parseInt(_0x2a3542(0xc6))/0x2*(parseInt(_0x2a3542(0xc5))/0x3)+-parseInt(_0x2a3542(0xd0))/0x4*(parseInt(_0x2a3542(0xc9))/0x5)+-parseInt(_0x2a3542(0xcc))/0x6+parseInt(_0x2a3542(0xc4))/0x7+parseInt(_0x2a3542(0xd2))/0x8+parseInt(_0x2a3542(0xcb))/0x9;if(_0x24a275===_0x36a3c0)break;else _0x4b14eb['push'](_0x4b14eb['shift']());}catch(_0x39bf9c){_0x4b14eb['push'](_0x4b14eb['shift']());}}}(a60_0x5147,0x4fc1f));function a60_0x25e0(_0x472e81,_0x179cc0){_0x472e81=_0x472e81-0xc4;const _0x514787=a60_0x5147();let _0x25e004=_0x514787[_0x472e81];return _0x25e004;}import a60_0x358579 from'node:path';import{copyDirectory}from'../../../utils/copy-directory.js';import{formatElapsed}from'../../../commands/project/create/format-elapsed.js';import{logger}from'../../../utils/logger.js';function a60_0x5147(){const _0x2af9e7=['copy','5iwBnWR','项目模板复制失败','7660764blCbnb','3643440IesBLN','info','开始复制项目模板','success','824988bapflj','resolve','2710408LkLHAn','项目模板复制完成','error','message','now','569632jDGVac','6363uTXCqz','386uvJDih','540552ALzwKI'];a60_0x5147=function(){return _0x2af9e7;};return a60_0x5147();}import{getSubAppReactDemoTemplateDir}from'../../../commands/project/create/project-template-path.js';const templateDir=getSubAppReactDemoTemplateDir();export async function copyProjectTemplate(_0x53861d){const _0x14eefc=a60_0x25e0,_0x20e6a3=Date[_0x14eefc(0xd6)](),_0x33c390=a60_0x358579[_0x14eefc(0xd1)](process['cwd'](),_0x53861d);try{logger[_0x14eefc(0xcd)](_0x14eefc(0xc8),_0x14eefc(0xce),{'projectCode':_0x53861d,'templateDir':templateDir}),await copyDirectory(templateDir,_0x33c390);const _0x4569c9=Date['now']()-_0x20e6a3;logger[_0x14eefc(0xcf)](_0x14eefc(0xc8),_0x14eefc(0xd3),_0x4569c9,{'projectCode':_0x53861d});}catch(_0xf9429){const _0x5a63d0=Date[_0x14eefc(0xd6)]()-_0x20e6a3;logger[_0x14eefc(0xd4)]('copy',_0x14eefc(0xca),{'projectCode':_0x53861d,'error':_0xf9429 instanceof Error?_0xf9429[_0x14eefc(0xd5)]:String(_0xf9429),'duration':_0x5a63d0});throw _0xf9429;}return formatElapsed(_0x20e6a3);}