@lovrabet/rabetbase-cli 2.5.10-beta.2 → 2.5.10-beta.3

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 (384) hide show
  1. package/README.md +10 -0
  2. package/lib/api/api-doc.js +1 -1
  3. package/lib/api/api-group.js +1 -1
  4. package/lib/api/fetch-model-list.js +1 -1
  5. package/lib/api/generate-api-file.js +1 -1
  6. package/lib/api/generate-sdk-config-file.js +1 -1
  7. package/lib/api/legacy-api-file.js +1 -1
  8. package/lib/api/model-registry-file.js +1 -1
  9. package/lib/api/model-registry-scaffold.js +1 -1
  10. package/lib/api/model-source.js +1 -1
  11. package/lib/auth/auth-server-ui.js +1 -1
  12. package/lib/auth/auth-server.js +1 -1
  13. package/lib/auth/constant.js +1 -1
  14. package/lib/auth/get-cookie.js +1 -1
  15. package/lib/auth/get-session-user.d.ts +2 -2
  16. package/lib/auth/get-session-user.js +1 -1
  17. package/lib/auth/is-session-valid.js +1 -1
  18. package/lib/auth/login-success-html.js +1 -1
  19. package/lib/auth/logout.js +1 -1
  20. package/lib/cli-flags.js +1 -1
  21. package/lib/cli.js +1 -1
  22. package/lib/commands/api/generate.js +1 -1
  23. package/lib/commands/api/index.js +1 -1
  24. package/lib/commands/api/list.js +1 -1
  25. package/lib/commands/api/pull.js +1 -1
  26. package/lib/commands/api/shared.js +1 -1
  27. package/lib/commands/app/detail.js +1 -1
  28. package/lib/commands/app/index.js +1 -1
  29. package/lib/commands/app/list.js +1 -1
  30. package/lib/commands/app/members-list.js +1 -1
  31. package/lib/commands/app/remote-directory.js +1 -1
  32. package/lib/commands/app/shared.js +1 -1
  33. package/lib/commands/app-config/delete.js +1 -1
  34. package/lib/commands/app-config/get.js +1 -1
  35. package/lib/commands/app-config/index.js +1 -1
  36. package/lib/commands/app-config/list.js +1 -1
  37. package/lib/commands/app-config/set.js +1 -1
  38. package/lib/commands/app-config/shared.js +1 -1
  39. package/lib/commands/auth/index.js +1 -1
  40. package/lib/commands/bff/create.js +1 -1
  41. package/lib/commands/bff/delete.js +1 -1
  42. package/lib/commands/bff/detail.js +1 -1
  43. package/lib/commands/bff/index.js +1 -1
  44. package/lib/commands/bff/list.js +1 -1
  45. package/lib/commands/bff/logs.js +1 -1
  46. package/lib/commands/bff/pull.js +1 -1
  47. package/lib/commands/bff/push.js +1 -1
  48. package/lib/commands/bff/status.js +1 -1
  49. package/lib/commands/cli-skill/index.js +1 -1
  50. package/lib/commands/cli-update.js +1 -1
  51. package/lib/commands/codegen/index.js +1 -1
  52. package/lib/commands/codegen/sdk.js +1 -1
  53. package/lib/commands/codegen/sql.js +1 -1
  54. package/lib/commands/common/app-registry.js +1 -1
  55. package/lib/commands/common/app-selector.js +1 -1
  56. package/lib/commands/common/async-task.js +1 -1
  57. package/lib/commands/common/dry-run.js +1 -1
  58. package/lib/commands/common/flags.js +1 -1
  59. package/lib/commands/common/local-file.js +1 -1
  60. package/lib/commands/common/validate.js +1 -1
  61. package/lib/commands/config/delete.js +1 -1
  62. package/lib/commands/config/get.js +1 -1
  63. package/lib/commands/config/index.js +1 -1
  64. package/lib/commands/config/init.js +1 -1
  65. package/lib/commands/config/list.js +1 -1
  66. package/lib/commands/config/set.js +1 -1
  67. package/lib/commands/config/shared.js +1 -1
  68. package/lib/commands/dataset/batch-design.js +1 -1
  69. package/lib/commands/dataset/business-group-update.js +1 -1
  70. package/lib/commands/dataset/business-groups.js +1 -1
  71. package/lib/commands/dataset/capability.js +1 -1
  72. package/lib/commands/dataset/cross-relation-create.js +1 -1
  73. package/lib/commands/dataset/cross-relation-delete.js +1 -1
  74. package/lib/commands/dataset/cross-relation-list.js +1 -1
  75. package/lib/commands/dataset/cross-relation-shared.js +1 -1
  76. package/lib/commands/dataset/cross-relation-update.js +1 -1
  77. package/lib/commands/dataset/delete.js +1 -1
  78. package/lib/commands/dataset/design-context.js +1 -1
  79. package/lib/commands/dataset/design-start.js +1 -1
  80. package/lib/commands/dataset/design-status.js +1 -1
  81. package/lib/commands/dataset/design-sync-retry.js +1 -1
  82. package/lib/commands/dataset/design-sync-status.js +1 -1
  83. package/lib/commands/dataset/design-validate.js +1 -1
  84. package/lib/commands/dataset/detail.js +1 -1
  85. package/lib/commands/dataset/extend-update.js +1 -1
  86. package/lib/commands/dataset/field-restore.js +1 -1
  87. package/lib/commands/dataset/field-update.js +1 -1
  88. package/lib/commands/dataset/generate.js +1 -1
  89. package/lib/commands/dataset/index.js +1 -1
  90. package/lib/commands/dataset/list.js +1 -1
  91. package/lib/commands/dataset/operations.js +1 -1
  92. package/lib/commands/dataset/relation-audit.js +1 -1
  93. package/lib/commands/dataset/relation-create.js +1 -1
  94. package/lib/commands/dataset/relation-delete.js +1 -1
  95. package/lib/commands/dataset/relation-shared.js +1 -1
  96. package/lib/commands/dataset/relation-update.js +1 -1
  97. package/lib/commands/dataset/relations.js +1 -1
  98. package/lib/commands/dataset/rename.js +1 -1
  99. package/lib/commands/dataset/restore.js +1 -1
  100. package/lib/commands/dataset/user-deleted-field-list.js +1 -1
  101. package/lib/commands/db/analysis-batching.js +1 -1
  102. package/lib/commands/db/analyze-batch-plan.js +1 -1
  103. package/lib/commands/db/analyze-cancel.js +1 -1
  104. package/lib/commands/db/analyze-start.js +1 -1
  105. package/lib/commands/db/analyze-status.js +1 -1
  106. package/lib/commands/db/create.js +1 -1
  107. package/lib/commands/db/cross-db-analysis-shared.js +1 -1
  108. package/lib/commands/db/cross-db-analyze-latest.js +1 -1
  109. package/lib/commands/db/cross-db-analyze-start.js +1 -1
  110. package/lib/commands/db/cross-db-analyze-status.js +1 -1
  111. package/lib/commands/db/delete.js +1 -1
  112. package/lib/commands/db/detail.js +1 -1
  113. package/lib/commands/db/diff-refresh-start.js +1 -1
  114. package/lib/commands/db/diff-refresh-status.js +1 -1
  115. package/lib/commands/db/diff.js +1 -1
  116. package/lib/commands/db/index.js +1 -1
  117. package/lib/commands/db/list.js +1 -1
  118. package/lib/commands/db/shared.js +1 -1
  119. package/lib/commands/db/table-diff-shared.js +1 -1
  120. package/lib/commands/db/tables.js +1 -1
  121. package/lib/commands/db/test.js +1 -1
  122. package/lib/commands/db/update.js +1 -1
  123. package/lib/commands/deployment/index.js +1 -1
  124. package/lib/commands/deployment/sync-all.js +1 -1
  125. package/lib/commands/deployment/sync-jobs.js +1 -1
  126. package/lib/commands/deployment/sync-status.js +1 -1
  127. package/lib/commands/doctor.js +1 -1
  128. package/lib/commands/file/index.js +1 -1
  129. package/lib/commands/flow/create.js +1 -1
  130. package/lib/commands/flow/detail.js +1 -1
  131. package/lib/commands/flow/index.js +1 -1
  132. package/lib/commands/flow/list.js +1 -1
  133. package/lib/commands/flow/page-list.js +1 -1
  134. package/lib/commands/flow/publish.js +1 -1
  135. package/lib/commands/flow/runtime-resources-shared.js +1 -1
  136. package/lib/commands/flow/runtime-role-list.js +1 -1
  137. package/lib/commands/flow/runtime-role-user-list.js +1 -1
  138. package/lib/commands/flow/runtime-user-search.js +1 -1
  139. package/lib/commands/flow/shared.js +1 -1
  140. package/lib/commands/flow/update.js +1 -1
  141. package/lib/commands/flow/validate.js +1 -1
  142. package/lib/commands/instant-api-policy/current.js +1 -1
  143. package/lib/commands/instant-api-policy/index.js +1 -1
  144. package/lib/commands/instant-api-policy/init.js +1 -1
  145. package/lib/commands/instant-api-policy/publish.js +1 -1
  146. package/lib/commands/instant-api-policy/pull.js +1 -1
  147. package/lib/commands/instant-api-policy/revision.js +1 -1
  148. package/lib/commands/instant-api-policy/revisions.js +1 -1
  149. package/lib/commands/instant-api-policy/rollback.js +1 -1
  150. package/lib/commands/instant-api-policy/shared.js +1 -1
  151. package/lib/commands/instant-api-policy/validate.js +1 -1
  152. package/lib/commands/issue/context.d.ts +3 -0
  153. package/lib/commands/issue/context.js +1 -0
  154. package/lib/commands/issue/index.js +1 -1
  155. package/lib/commands/issue/nudge.js +1 -1
  156. package/lib/commands/issue/report.js +1 -1
  157. package/lib/commands/kb/create.js +1 -1
  158. package/lib/commands/kb/delete.js +1 -1
  159. package/lib/commands/kb/detail.js +1 -1
  160. package/lib/commands/kb/index.js +1 -1
  161. package/lib/commands/kb/list.js +1 -1
  162. package/lib/commands/kb/search.js +1 -1
  163. package/lib/commands/kb/shared.js +1 -1
  164. package/lib/commands/kb/update.js +1 -1
  165. package/lib/commands/logs/index.js +1 -1
  166. package/lib/commands/menu/asset-update.js +1 -1
  167. package/lib/commands/menu/delete.js +1 -1
  168. package/lib/commands/menu/external-link-create.js +1 -1
  169. package/lib/commands/menu/external-link-update.js +1 -1
  170. package/lib/commands/menu/group-create.js +1 -1
  171. package/lib/commands/menu/group-update.js +1 -1
  172. package/lib/commands/menu/index.js +1 -1
  173. package/lib/commands/menu/list.js +1 -1
  174. package/lib/commands/menu/move.js +1 -1
  175. package/lib/commands/menu/regroup-start.js +1 -1
  176. package/lib/commands/menu/rename.js +1 -1
  177. package/lib/commands/menu/shared/compare-table.js +1 -1
  178. package/lib/commands/menu/shared/delete-plan.js +1 -1
  179. package/lib/commands/menu/shared/facts.js +1 -1
  180. package/lib/commands/menu/shared/index.js +1 -1
  181. package/lib/commands/menu/shared/inquirer.js +1 -1
  182. package/lib/commands/menu/shared/local-pages.js +1 -1
  183. package/lib/commands/menu/shared/logic.js +1 -1
  184. package/lib/commands/menu/shared/mutations.js +1 -1
  185. package/lib/commands/menu/shared/path.js +1 -1
  186. package/lib/commands/menu/shared/service.js +1 -1
  187. package/lib/commands/menu/shared/subapp-assets.js +1 -1
  188. package/lib/commands/menu/shared/sync-core.js +1 -1
  189. package/lib/commands/menu/shared/update-core.js +1 -1
  190. package/lib/commands/menu/shared/valid-url.js +1 -1
  191. package/lib/commands/menu/subapp-assets-status.js +1 -1
  192. package/lib/commands/menu/subapp-assets-update.js +1 -1
  193. package/lib/commands/menu/sync.js +1 -1
  194. package/lib/commands/menu/visibility-update.js +1 -1
  195. package/lib/commands/notification/config-create.js +1 -1
  196. package/lib/commands/notification/config-delete.js +1 -1
  197. package/lib/commands/notification/config-list.js +1 -1
  198. package/lib/commands/notification/config-update.js +1 -1
  199. package/lib/commands/notification/index.js +1 -1
  200. package/lib/commands/notification/shared.js +1 -1
  201. package/lib/commands/ocr/index.js +1 -1
  202. package/lib/commands/page/create.js +1 -1
  203. package/lib/commands/page/custom/detail.js +1 -1
  204. package/lib/commands/page/custom/list.js +1 -1
  205. package/lib/commands/page/custom/publish.js +1 -1
  206. package/lib/commands/page/custom/shared.js +1 -1
  207. package/lib/commands/page/custom/syntax.js +1 -1
  208. package/lib/commands/page/custom/update.js +1 -1
  209. package/lib/commands/page/data-list-status.js +1 -1
  210. package/lib/commands/page/generate-start.js +1 -1
  211. package/lib/commands/page/generate-status.js +1 -1
  212. package/lib/commands/page/index.js +1 -1
  213. package/lib/commands/page/pull.js +1 -1
  214. package/lib/commands/page/push.js +1 -1
  215. package/lib/commands/page/relation-audit.js +1 -1
  216. package/lib/commands/page/restore.js +1 -1
  217. package/lib/commands/page/shared.js +1 -1
  218. package/lib/commands/page/sync.js +1 -1
  219. package/lib/commands/project/api-architecture-upgrade.js +1 -1
  220. package/lib/commands/project/create/enhanced-guided-create.js +1 -1
  221. package/lib/commands/project/create/format-elapsed.js +1 -1
  222. package/lib/commands/project/create/main.js +1 -1
  223. package/lib/commands/project/create/materialize-project-template.js +1 -1
  224. package/lib/commands/project/create/project-name.js +1 -1
  225. package/lib/commands/project/create/project-template-archive.js +1 -1
  226. package/lib/commands/project/create/project-template-path.js +1 -1
  227. package/lib/commands/project/create/use-copy-project-template.js +1 -1
  228. package/lib/commands/project/create/use-format-code.js +1 -1
  229. package/lib/commands/project/create/use-install-dependencies.js +1 -1
  230. package/lib/commands/project/domain-routing-sync.js +1 -1
  231. package/lib/commands/project/index.js +1 -1
  232. package/lib/commands/project/upgrade.js +1 -1
  233. package/lib/commands/registry.js +1 -1
  234. package/lib/commands/role/delete.js +1 -1
  235. package/lib/commands/role/detail.js +1 -1
  236. package/lib/commands/role/index.js +1 -1
  237. package/lib/commands/role/list.js +1 -1
  238. package/lib/commands/role/shared.js +1 -1
  239. package/lib/commands/role/update.js +1 -1
  240. package/lib/commands/role/user-add.js +1 -1
  241. package/lib/commands/role/user-remove.js +1 -1
  242. package/lib/commands/role/user-resolve.js +1 -1
  243. package/lib/commands/rule/get.js +1 -1
  244. package/lib/commands/rule/index.js +1 -1
  245. package/lib/commands/rule/list.js +1 -1
  246. package/lib/commands/rule/set.js +1 -1
  247. package/lib/commands/rule/shared.js +1 -1
  248. package/lib/commands/run/index.js +1 -1
  249. package/lib/commands/schema.js +1 -1
  250. package/lib/commands/sql/create.js +1 -1
  251. package/lib/commands/sql/delete.js +1 -1
  252. package/lib/commands/sql/detail.js +1 -1
  253. package/lib/commands/sql/exec.js +1 -1
  254. package/lib/commands/sql/index.js +1 -1
  255. package/lib/commands/sql/list.js +1 -1
  256. package/lib/commands/sql/pull.js +1 -1
  257. package/lib/commands/sql/push.js +1 -1
  258. package/lib/commands/sql/shared.js +1 -1
  259. package/lib/commands/sql/status.js +1 -1
  260. package/lib/commands/sql/validate.js +1 -1
  261. package/lib/commands/task/index.js +1 -1
  262. package/lib/commands/task/status.js +1 -1
  263. package/lib/commands/tenant/index.js +1 -1
  264. package/lib/commands/tenant/members-list.js +1 -1
  265. package/lib/commands/tenant/shared.js +1 -1
  266. package/lib/commands/user-account/dingding-sandbox-bind.js +1 -1
  267. package/lib/commands/user-account/feishu-bind.js +1 -1
  268. package/lib/commands/user-account/index.js +1 -1
  269. package/lib/commands/workspace/add.js +1 -1
  270. package/lib/commands/workspace/index.js +1 -1
  271. package/lib/commands/workspace/remove.js +1 -1
  272. package/lib/config/domain-config.js +1 -1
  273. package/lib/config/project-domain-routing.js +1 -1
  274. package/lib/config/region-config.js +1 -1
  275. package/lib/config/schema.js +1 -1
  276. package/lib/constant/cdn.js +1 -1
  277. package/lib/constant/cli.js +1 -1
  278. package/lib/constant/defaults.js +1 -1
  279. package/lib/constant/domain.js +1 -1
  280. package/lib/constant/env.js +1 -1
  281. package/lib/constant/output.js +1 -1
  282. package/lib/constant/paths.js +1 -1
  283. package/lib/constant/region.js +1 -1
  284. package/lib/constant/risk.js +1 -1
  285. package/lib/constant/routing-profile.js +1 -1
  286. package/lib/context/app-resolver.js +1 -1
  287. package/lib/context/auth-resolver.js +1 -1
  288. package/lib/context/config-loader.js +1 -1
  289. package/lib/context.js +1 -1
  290. package/lib/core/alias-resolver.js +1 -1
  291. package/lib/core/api-client.js +1 -1
  292. package/lib/core/bff/config.js +1 -1
  293. package/lib/core/bff/file-system.js +1 -1
  294. package/lib/core/bff/hash.js +1 -1
  295. package/lib/core/bff/hook-directory.js +1 -1
  296. package/lib/core/bff/lock.js +1 -1
  297. package/lib/core/bff/utils.js +1 -1
  298. package/lib/core/cross-db-analysis.js +1 -1
  299. package/lib/core/cross-db-relation.js +1 -1
  300. package/lib/core/db-resolver.js +1 -1
  301. package/lib/core/flow-config.js +1 -1
  302. package/lib/core/instant-api-policy/config.js +1 -1
  303. package/lib/core/instant-api-policy/endpoints.js +1 -1
  304. package/lib/core/kb-management-client.js +1 -1
  305. package/lib/core/kb-search-client.js +1 -1
  306. package/lib/core/page/file-system.js +1 -1
  307. package/lib/core/page/hash.js +1 -1
  308. package/lib/core/page/lock.js +1 -1
  309. package/lib/core/page/lr-smart-jsx.js +1 -1
  310. package/lib/core/sql-index-auditor.js +1 -1
  311. package/lib/core/sql-sync/config.js +1 -1
  312. package/lib/core/sql-sync/file-system.js +1 -1
  313. package/lib/core/sql-sync/hash.js +1 -1
  314. package/lib/core/sql-sync/lock.js +1 -1
  315. package/lib/core/sql-sync/utils.js +1 -1
  316. package/lib/core/sql-validator.js +1 -1
  317. package/lib/errors.js +1 -1
  318. package/lib/framework/build-all-flags.js +1 -1
  319. package/lib/framework/error-output.js +1 -1
  320. package/lib/framework/explicit-yes.js +1 -1
  321. package/lib/framework/flags.js +1 -1
  322. package/lib/framework/help.js +1 -1
  323. package/lib/framework/index.js +1 -1
  324. package/lib/framework/output.js +1 -1
  325. package/lib/framework/response.js +1 -1
  326. package/lib/framework/runner-alias.js +1 -1
  327. package/lib/framework/runner.js +1 -1
  328. package/lib/framework/schema-export.js +1 -1
  329. package/lib/framework/supported-flags.js +1 -1
  330. package/lib/framework/types.js +1 -1
  331. package/lib/generated/build-info.d.ts +4 -4
  332. package/lib/generated/build-info.js +1 -1
  333. package/lib/generated/official-routing.js +1 -1
  334. package/lib/generated/routing-contract.js +1 -1
  335. package/lib/help.js +1 -1
  336. package/lib/postinstall.js +1 -1
  337. package/lib/runtime/confirmation.js +1 -1
  338. package/lib/runtime/event.js +1 -1
  339. package/lib/runtime/index.js +1 -1
  340. package/lib/runtime/queue.js +1 -1
  341. package/lib/runtime/resolve.js +1 -1
  342. package/lib/services/dataset-design/checkpoint.js +1 -1
  343. package/lib/services/dataset-design/commands.js +1 -1
  344. package/lib/services/dataset-design/contract.js +1 -1
  345. package/lib/skills/builtin-skill.js +1 -1
  346. package/lib/skills/main.js +1 -1
  347. package/lib/skills/npx-skills-add.js +1 -1
  348. package/lib/skills/skill-presence.js +1 -1
  349. package/lib/telemetry/cli-command-trace.js +1 -1
  350. package/lib/telemetry/cli-help-trace.js +1 -1
  351. package/lib/telemetry/ensure-cli-otel-config.js +1 -1
  352. package/lib/telemetry/register-otel-exit-shutdown.js +1 -1
  353. package/lib/telemetry/send-cli-trace-log.js +1 -1
  354. package/lib/utils/ai_config.js +1 -1
  355. package/lib/utils/apply-jq-filter.js +1 -1
  356. package/lib/utils/cdn-config.js +1 -1
  357. package/lib/utils/check-sdk-version.js +1 -1
  358. package/lib/utils/cli-version-check.js +1 -1
  359. package/lib/utils/cli-version-policy.js +1 -1
  360. package/lib/utils/config.js +1 -1
  361. package/lib/utils/entity-with-id.js +1 -1
  362. package/lib/utils/file-utils.js +1 -1
  363. package/lib/utils/guides-cdn.js +1 -1
  364. package/lib/utils/http-client.js +1 -1
  365. package/lib/utils/is-non-interactive.js +1 -1
  366. package/lib/utils/logger.js +1 -1
  367. package/lib/utils/params.js +1 -1
  368. package/lib/utils/platform.js +1 -1
  369. package/lib/utils/sleep.js +1 -1
  370. package/lib/utils/template-replacer.js +1 -1
  371. package/lib/utils/update-notice.js +1 -1
  372. package/lib/utils/version.js +1 -1
  373. package/lib/utils/with-active-cookie.js +1 -1
  374. package/lib/utils/write-cli-side-channel.js +1 -1
  375. package/package.json +2 -2
  376. package/skills/rabetbase/SKILL.md +2 -2
  377. package/skills/rabetbase/references/rabetbase-issue-report.md +4 -1
  378. package/skills/rabetbase-dataset-generation/SKILL.md +1 -1
  379. package/skills/rabetbase-page-generation/SKILL.md +1 -1
  380. package/skills/rabetbase.manifest.json +3 -3
  381. package/lib/commands/issue/shared.d.ts +0 -32
  382. package/lib/commands/issue/shared.js +0 -1
  383. package/lib/telemetry/send-platform-issue-collect-log.d.ts +0 -26
  384. package/lib/telemetry/send-platform-issue-collect-log.js +0 -1
@@ -1 +1 @@
1
- (function(_0x50c24b,_0x446a50){const _0x59afd3=a177_0x4cbf,_0x4cc32b=_0x50c24b();while(!![]){try{const _0x291190=parseInt(_0x59afd3(0x1b4))/0x1+parseInt(_0x59afd3(0x1bc))/0x2*(-parseInt(_0x59afd3(0x1d8))/0x3)+-parseInt(_0x59afd3(0x1d5))/0x4+parseInt(_0x59afd3(0x1bd))/0x5*(parseInt(_0x59afd3(0x1bf))/0x6)+-parseInt(_0x59afd3(0x1d4))/0x7*(-parseInt(_0x59afd3(0x1cc))/0x8)+parseInt(_0x59afd3(0x1c3))/0x9*(-parseInt(_0x59afd3(0x1c6))/0xa)+parseInt(_0x59afd3(0x1ba))/0xb*(parseInt(_0x59afd3(0x1b7))/0xc);if(_0x291190===_0x446a50)break;else _0x4cc32b['push'](_0x4cc32b['shift']());}catch(_0xa3f51e){_0x4cc32b['push'](_0x4cc32b['shift']());}}}(a177_0x4019,0xdfdd3));import a177_0x2b8619 from'chalk';import{checkbox,input,confirm}from'@inquirer/prompts';import a177_0x47bce2 from'ora';import{isUrlReachable}from'../../../commands/menu/shared/valid-url.js';import{menuPathKey}from'../../../commands/menu/shared/path.js';import{CliErrors}from'../../../errors.js';function onCancel(_0x5ef294){const _0x2d560b=a177_0x4cbf;return _0x5ef294[_0x2d560b(0x1c9)](_0x17bea7=>{const _0x10c4cf=_0x2d560b;if(_0x17bea7?.[_0x10c4cf(0x1d0)]===_0x10c4cf(0x1c4))throw CliErrors[_0x10c4cf(0x1c1)](_0x10c4cf(0x1d7));throw _0x17bea7;});}export function startSpinner(_0x47cb9e){const _0x4c02cf=a177_0x4cbf;return a177_0x47bce2({'text':_0x47cb9e,'color':'cyan'})[_0x4c02cf(0x1ca)]();}function a177_0x4cbf(_0x17a0b1,_0x57352d){_0x17a0b1=_0x17a0b1-0x1b4;const _0x401938=a177_0x4019();let _0x4cbff8=_0x401938[_0x17a0b1];return _0x4cbff8;}export function stopSpinner(_0xc739d2,_0xc907ca,_0x2819e8){const _0xb7823d=a177_0x4cbf;_0x2819e8?_0xc739d2['succeed'](_0xc907ca):_0xc739d2[_0xb7823d(0x1c0)](_0xc907ca);}export async function askConfirm(_0x21492a){return onCancel(confirm({'message':_0x21492a,'theme':{'prefix':''}}));}function a177_0x4019(){const _0x17becb=['name','map','CSS\x20URL\x20checked','\x20\x20✗\x20JS\x20URL\x20is\x20unreachable','29253wejQeI','1935624Biflue','path','Cancelled.','15vgwbsX','\x20\x20✗\x20JS\x20URL\x20must\x20be\x20a\x20valid\x20https://...js\x20URL','[new]','Use\x20--yes\x20to\x20run\x20in\x20non-interactive\x20mode,\x20or\x20pipe\x20data\x20via\x20--params.','length','JS\x20URL\x20check\x20failed','label','\x20\x20JS\x20URL:','\x20\x20Select\x20menus\x20to\x20sync\x20(space\x20to\x20toggle,\x20a=all,\x20i=invert):','117007ctciRp','\x20\x20Checking\x20CSS\x20URL\x20reachability...','\x20\x20✗\x20CSS\x20URL\x20must\x20be\x20a\x20valid\x20https://...css\x20URL','13749180IWCvPm','filter','error','33lxxJIc','JS\x20URL\x20checked','505534uKNoME','111380bJlYuy','includes','174iUPjVW','fail','cancelled','isTTY','197946lSUwTY','ExitPromptError','CSS\x20URL\x20check\x20failed','740XZbaSe','test','green','catch','start','\x20\x20✗\x20CSS\x20URL\x20is\x20unreachable','176iwrdNo','red','trim','gray'];a177_0x4019=function(){return _0x17becb;};return a177_0x4019();}export async function askJsUrl(_0x5406db){const _0x3f4528=a177_0x4cbf;while(!![]){const _0x3356b7=await onCancel(input({'message':_0x3f4528(0x1df),'default':_0x5406db,'theme':{'prefix':''}}));if(_0x3356b7[_0x3f4528(0x1ce)]()==='')throw CliErrors[_0x3f4528(0x1c1)]('Cancelled.');if(!/^https:\/\/.+\.js(\?.*)?$/[_0x3f4528(0x1c7)](_0x3356b7[_0x3f4528(0x1ce)]())){console[_0x3f4528(0x1b9)](a177_0x2b8619[_0x3f4528(0x1cd)](_0x3f4528(0x1d9)));continue;}const _0x45116f=startSpinner('\x20\x20Checking\x20JS\x20URL\x20reachability...');try{const _0x2dfada=await isUrlReachable(_0x3356b7[_0x3f4528(0x1ce)]());stopSpinner(_0x45116f,_0x3f4528(0x1bb),_0x2dfada);if(!_0x2dfada){console[_0x3f4528(0x1b9)](a177_0x2b8619[_0x3f4528(0x1cd)](_0x3f4528(0x1d3)));continue;}return _0x3356b7[_0x3f4528(0x1ce)]();}catch(_0x1349f0){stopSpinner(_0x45116f,_0x3f4528(0x1dd),![]);throw _0x1349f0;}}}export async function askCssUrl(_0x52b920){const _0x4e499a=a177_0x4cbf;while(!![]){const _0x135ccd=await onCancel(input({'message':'\x20\x20CSS\x20URL:','default':_0x52b920,'theme':{'prefix':''}}));if(_0x135ccd[_0x4e499a(0x1ce)]()==='')throw CliErrors[_0x4e499a(0x1c1)](_0x4e499a(0x1d7));if(!/^https:\/\/.+\.css(\?.*)?$/[_0x4e499a(0x1c7)](_0x135ccd[_0x4e499a(0x1ce)]())){console[_0x4e499a(0x1b9)](a177_0x2b8619['red'](_0x4e499a(0x1b6)));continue;}const _0x376b0f=startSpinner(_0x4e499a(0x1b5));try{const _0x4d74ff=await isUrlReachable(_0x135ccd[_0x4e499a(0x1ce)]());stopSpinner(_0x376b0f,_0x4e499a(0x1d2),_0x4d74ff);if(!_0x4d74ff){console[_0x4e499a(0x1b9)](a177_0x2b8619[_0x4e499a(0x1cd)](_0x4e499a(0x1cb)));continue;}return _0x135ccd[_0x4e499a(0x1ce)]();}catch(_0x57a7a8){stopSpinner(_0x376b0f,_0x4e499a(0x1c5),![]);throw _0x57a7a8;}}}export async function selectPages(_0x5d5636,_0x40df9b){const _0xb9f342=a177_0x4cbf,_0x51d8ef=_0x5d5636[_0xb9f342(0x1d1)](_0x36819f=>{const _0xd23913=_0xb9f342,_0x4c7f6a=_0x40df9b['has'](menuPathKey(_0x36819f[_0xd23913(0x1d6)]));return{'name':_0x36819f[_0xd23913(0x1de)]+'\x20\x20'+a177_0x2b8619[_0xd23913(0x1cf)](_0x36819f[_0xd23913(0x1d6)])+'\x20\x20'+(_0x4c7f6a?a177_0x2b8619[_0xd23913(0x1cf)]('[already\x20on\x20platform]'):a177_0x2b8619[_0xd23913(0x1c8)](_0xd23913(0x1da))),'value':_0x36819f['path'],'checked':!_0x4c7f6a,'disabled':_0x4c7f6a};});if(_0x51d8ef[_0xb9f342(0x1dc)]===0x0)throw new Error('No\x20local\x20pages\x20found.');const _0xea4fab=await onCancel(checkbox({'message':_0xb9f342(0x1e0),'choices':_0x51d8ef,'loop':![],'theme':{'prefix':''}}));if(_0xea4fab[_0xb9f342(0x1dc)]===0x0)throw new Error('No\x20menus\x20selected.');return _0x5d5636[_0xb9f342(0x1b8)](_0x3a220e=>_0xea4fab[_0xb9f342(0x1be)](_0x3a220e[_0xb9f342(0x1d6)]));}export function isInteractive(){const _0x4f5f92=a177_0x4cbf;return process['stdin'][_0x4f5f92(0x1c2)]===!![];}export function requireInteractive(){const _0xcf73d=a177_0x4cbf;if(!isInteractive())throw new Error('This\x20command\x20requires\x20an\x20interactive\x20terminal.\x20'+_0xcf73d(0x1db));}
1
+ (function(_0x4c5add,_0x2ee6d6){const _0x1e1ad8=a177_0x12d8,_0x37b68b=_0x4c5add();while(!![]){try{const _0x8f4279=parseInt(_0x1e1ad8(0xd0))/0x1*(parseInt(_0x1e1ad8(0xd8))/0x2)+-parseInt(_0x1e1ad8(0xc5))/0x3*(-parseInt(_0x1e1ad8(0xb8))/0x4)+parseInt(_0x1e1ad8(0xc7))/0x5*(parseInt(_0x1e1ad8(0xd5))/0x6)+-parseInt(_0x1e1ad8(0xd1))/0x7*(parseInt(_0x1e1ad8(0xe7))/0x8)+parseInt(_0x1e1ad8(0xe8))/0x9+-parseInt(_0x1e1ad8(0xbc))/0xa*(-parseInt(_0x1e1ad8(0xc0))/0xb)+parseInt(_0x1e1ad8(0xb6))/0xc*(-parseInt(_0x1e1ad8(0xcc))/0xd);if(_0x8f4279===_0x2ee6d6)break;else _0x37b68b['push'](_0x37b68b['shift']());}catch(_0x51abb8){_0x37b68b['push'](_0x37b68b['shift']());}}}(a177_0x22d6,0x8c6f7));import a177_0x3f80cd from'chalk';import{checkbox,input,confirm}from'@inquirer/prompts';import a177_0x18437b from'ora';import{isUrlReachable}from'../../../commands/menu/shared/valid-url.js';import{menuPathKey}from'../../../commands/menu/shared/path.js';import{CliErrors}from'../../../errors.js';function a177_0x22d6(){const _0x5b30e1=['JS\x20URL\x20checked','\x20\x20✗\x20JS\x20URL\x20must\x20be\x20a\x20valid\x20https://...js\x20URL','10gZersp','\x20\x20Checking\x20CSS\x20URL\x20reachability...','ExitPromptError','fail','2393809NUHcCr','filter','No\x20menus\x20selected.','[new]','This\x20command\x20requires\x20an\x20interactive\x20terminal.\x20','3774ArDQnT','error','496560XHfpES','red','label','\x20\x20JS\x20URL:','cancelled','26EfNpEc','name','catch','stdin','809prCclq','12005GZjKeS','succeed','\x20\x20Select\x20menus\x20to\x20sync\x20(space\x20to\x20toggle,\x20a=all,\x20i=invert):','gray','30LcUxBf','trim','start','1322sROVEM','\x20\x20Checking\x20JS\x20URL\x20reachability...','green','test','includes','\x20\x20✗\x20CSS\x20URL\x20is\x20unreachable','[already\x20on\x20platform]','map','Use\x20--yes\x20to\x20run\x20in\x20non-interactive\x20mode,\x20or\x20pipe\x20data\x20via\x20--params.','isTTY','No\x20local\x20pages\x20found.','Cancelled.','length','\x20\x20CSS\x20URL:','cyan','1784CYaQQN','3079998BsBMNf','path','CSS\x20URL\x20check\x20failed','has','6118128DWmSfU','\x20\x20✗\x20CSS\x20URL\x20must\x20be\x20a\x20valid\x20https://...css\x20URL','1228DOKRqD','\x20\x20✗\x20JS\x20URL\x20is\x20unreachable'];a177_0x22d6=function(){return _0x5b30e1;};return a177_0x22d6();}function onCancel(_0x3523e2){const _0x1ded1e=a177_0x12d8;return _0x3523e2[_0x1ded1e(0xce)](_0x106e95=>{const _0x202514=_0x1ded1e;if(_0x106e95?.[_0x202514(0xcd)]===_0x202514(0xbe))throw CliErrors['cancelled'](_0x202514(0xe3));throw _0x106e95;});}export function startSpinner(_0x38b661){const _0xdce70b=a177_0x12d8;return a177_0x18437b({'text':_0x38b661,'color':_0xdce70b(0xe6)})[_0xdce70b(0xd7)]();}export function stopSpinner(_0x2beeae,_0x4a38be,_0x404245){const _0x4da570=a177_0x12d8;_0x404245?_0x2beeae[_0x4da570(0xd2)](_0x4a38be):_0x2beeae[_0x4da570(0xbf)](_0x4a38be);}export async function askConfirm(_0x55ce47){return onCancel(confirm({'message':_0x55ce47,'theme':{'prefix':''}}));}export async function askJsUrl(_0x14dbe8){const _0x38936e=a177_0x12d8;while(!![]){const _0xd932a4=await onCancel(input({'message':_0x38936e(0xca),'default':_0x14dbe8,'theme':{'prefix':''}}));if(_0xd932a4[_0x38936e(0xd6)]()==='')throw CliErrors[_0x38936e(0xcb)](_0x38936e(0xe3));if(!/^https:\/\/.+\.js(\?.*)?$/[_0x38936e(0xdb)](_0xd932a4['trim']())){console[_0x38936e(0xc6)](a177_0x3f80cd[_0x38936e(0xc8)](_0x38936e(0xbb)));continue;}const _0x545af1=startSpinner(_0x38936e(0xd9));try{const _0x29cd02=await isUrlReachable(_0xd932a4['trim']());stopSpinner(_0x545af1,_0x38936e(0xba),_0x29cd02);if(!_0x29cd02){console[_0x38936e(0xc6)](a177_0x3f80cd[_0x38936e(0xc8)](_0x38936e(0xb9)));continue;}return _0xd932a4[_0x38936e(0xd6)]();}catch(_0x1f4abc){stopSpinner(_0x545af1,'JS\x20URL\x20check\x20failed',![]);throw _0x1f4abc;}}}export async function askCssUrl(_0x5a8a61){const _0x3c8cfc=a177_0x12d8;while(!![]){const _0x3c37c2=await onCancel(input({'message':_0x3c8cfc(0xe5),'default':_0x5a8a61,'theme':{'prefix':''}}));if(_0x3c37c2[_0x3c8cfc(0xd6)]()==='')throw CliErrors['cancelled'](_0x3c8cfc(0xe3));if(!/^https:\/\/.+\.css(\?.*)?$/[_0x3c8cfc(0xdb)](_0x3c37c2['trim']())){console[_0x3c8cfc(0xc6)](a177_0x3f80cd[_0x3c8cfc(0xc8)](_0x3c8cfc(0xb7)));continue;}const _0x1149fa=startSpinner(_0x3c8cfc(0xbd));try{const _0x3095fd=await isUrlReachable(_0x3c37c2[_0x3c8cfc(0xd6)]());stopSpinner(_0x1149fa,'CSS\x20URL\x20checked',_0x3095fd);if(!_0x3095fd){console[_0x3c8cfc(0xc6)](a177_0x3f80cd[_0x3c8cfc(0xc8)](_0x3c8cfc(0xdd)));continue;}return _0x3c37c2[_0x3c8cfc(0xd6)]();}catch(_0x353adb){stopSpinner(_0x1149fa,_0x3c8cfc(0xb4),![]);throw _0x353adb;}}}export async function selectPages(_0x21616b,_0x5ee821){const _0x4bd4a9=a177_0x12d8,_0x430a39=_0x21616b[_0x4bd4a9(0xdf)](_0x3158c7=>{const _0x1134b6=_0x4bd4a9,_0x2f7ad1=_0x5ee821[_0x1134b6(0xb5)](menuPathKey(_0x3158c7[_0x1134b6(0xb3)]));return{'name':_0x3158c7[_0x1134b6(0xc9)]+'\x20\x20'+a177_0x3f80cd[_0x1134b6(0xd4)](_0x3158c7[_0x1134b6(0xb3)])+'\x20\x20'+(_0x2f7ad1?a177_0x3f80cd[_0x1134b6(0xd4)](_0x1134b6(0xde)):a177_0x3f80cd[_0x1134b6(0xda)](_0x1134b6(0xc3))),'value':_0x3158c7[_0x1134b6(0xb3)],'checked':!_0x2f7ad1,'disabled':_0x2f7ad1};});if(_0x430a39[_0x4bd4a9(0xe4)]===0x0)throw new Error(_0x4bd4a9(0xe2));const _0x47acf9=await onCancel(checkbox({'message':_0x4bd4a9(0xd3),'choices':_0x430a39,'loop':![],'theme':{'prefix':''}}));if(_0x47acf9[_0x4bd4a9(0xe4)]===0x0)throw new Error(_0x4bd4a9(0xc2));return _0x21616b[_0x4bd4a9(0xc1)](_0x50f0d0=>_0x47acf9[_0x4bd4a9(0xdc)](_0x50f0d0[_0x4bd4a9(0xb3)]));}function a177_0x12d8(_0x238832,_0x4c6ba4){_0x238832=_0x238832-0xb3;const _0x22d67d=a177_0x22d6();let _0x12d886=_0x22d67d[_0x238832];return _0x12d886;}export function isInteractive(){const _0x36caf4=a177_0x12d8;return process[_0x36caf4(0xcf)][_0x36caf4(0xe1)]===!![];}export function requireInteractive(){const _0x49b600=a177_0x12d8;if(!isInteractive())throw new Error(_0x49b600(0xc4)+_0x49b600(0xe0));}
@@ -1 +1 @@
1
- const a178_0x9f0a57=a178_0x2251;(function(_0x65f2a1,_0x3b240e){const _0x4a23b7=a178_0x2251,_0x158bf7=_0x65f2a1();while(!![]){try{const _0x3d71b8=parseInt(_0x4a23b7(0x1e2))/0x1*(parseInt(_0x4a23b7(0x1e8))/0x2)+parseInt(_0x4a23b7(0x1d6))/0x3*(-parseInt(_0x4a23b7(0x1d2))/0x4)+parseInt(_0x4a23b7(0x1da))/0x5+parseInt(_0x4a23b7(0x1c9))/0x6+-parseInt(_0x4a23b7(0x1c4))/0x7+-parseInt(_0x4a23b7(0x1dc))/0x8+parseInt(_0x4a23b7(0x1de))/0x9;if(_0x3d71b8===_0x3b240e)break;else _0x158bf7['push'](_0x158bf7['shift']());}catch(_0x201d8c){_0x158bf7['push'](_0x158bf7['shift']());}}}(a178_0x4c57,0x72755));import{existsSync,readdirSync,statSync,readFileSync}from'fs';import{join,relative,resolve,sep}from'path';function a178_0x4c57(){const _0x3eab1c=[':$1','endsWith','filter','test','forEach','label','has','src/pages','slice','order','isArray','Invalid\x20route\x20manifest\x20','pageFile','\x20disagrees\x20with\x20pageFile\x20','1531131cdOEmn','cwd','visible','length','parse','314514LLuOty','Route\x20','utf-8','utf8','trim','Invalid\x20route\x20group\x20for\x20',':\x20path,\x20label,\x20pageFile\x20and\x20visible\x20are\x20required','isDirectory','join','44uFqnPx','Invalid\x20route\x20order\x20for\x20','index.tsx','replace','206508YgxKsR','isInteger','Invalid\x20route\x20manifest\x20row\x20','path','1426805iRQlsH','group','3344064ePbZvx','match','13283757PksFnY','Duplicate\x20route\x20path\x20in\x20manifest:\x20','Route\x20page\x20file\x20does\x20not\x20exist:\x20','string','135vPUpJw','\x5c.displayName\x5cs*=\x5cs*[\x22\x27]([^\x22\x27]+)[\x22\x27]','Route\x20manifest\x20must\x20contain\x20an\x20array:\x20','map','index','src/pages/','726YTPXwV','replaceAll','boolean'];a178_0x4c57=function(){return _0x3eab1c;};return a178_0x4c57();}const pagesDir=resolve(process[a178_0x9f0a57(0x1c5)](),a178_0x9f0a57(0x1f2));function a178_0x2251(_0x3afc55,_0x137ef4){_0x3afc55=_0x3afc55-0x1be;const _0x4c570c=a178_0x4c57();let _0x22518b=_0x4c570c[_0x3afc55];return _0x22518b;}export function extractTitleFromComment(_0x230129){const _0x530161=a178_0x9f0a57;try{const _0x4bb727=readFileSync(_0x230129,_0x530161(0x1cb)),_0x5bcf79=_0x4bb727[_0x530161(0x1dd)](/^\s*\/\*\*?([\s\S]*?)\*\//);if(_0x5bcf79&&_0x5bcf79[0x1]){const _0x5512cd=_0x5bcf79[0x1],_0x58ac98=_0x5512cd[_0x530161(0x1dd)](/^\s*\*?\s*title\s*:\s*(.+)/im);if(_0x58ac98&&_0x58ac98[0x1])return _0x58ac98[0x1][_0x530161(0x1cd)]();}let _0x6277f=null;const _0x379c8d=_0x4bb727['match'](/export\s+default\s+([A-Z][a-zA-Z0-9]*)/);_0x379c8d&&_0x379c8d[0x1]&&(_0x6277f=_0x379c8d[0x1]);if(!_0x6277f){const _0x52cc7c=_0x4bb727[_0x530161(0x1dd)](/export\s+default\s+function\s+([A-Z][a-zA-Z0-9]*)/);_0x52cc7c&&_0x52cc7c[0x1]&&(_0x6277f=_0x52cc7c[0x1]);}if(_0x6277f){const _0x1aa0bb=new RegExp('\x5cb'+_0x6277f+_0x530161(0x1e3)),_0x2b487c=_0x4bb727[_0x530161(0x1dd)](_0x1aa0bb);if(_0x2b487c&&_0x2b487c[0x1])return _0x2b487c[0x1];return _0x6277f;}return null;}catch(_0x476572){return null;}}export function getLocalPages(_0x50eb52=pagesDir,_0x4fff51=pagesDir,_0x329944=process['cwd']()){const _0x4f2d6e=a178_0x9f0a57;if(resolve(_0x50eb52)===resolve(_0x4fff51)){const _0xcb7fcc=join(_0x329944,'src/features/routing/routes.json');if(existsSync(_0xcb7fcc))return getDeclaredPages(_0xcb7fcc,_0x329944);}let _0x426f6a=[];const _0x558683=readdirSync(_0x50eb52);return _0x558683[_0x4f2d6e(0x1ef)](_0x15376a=>{const _0x121ad0=_0x4f2d6e,_0x4421dd=join(_0x50eb52,_0x15376a),_0x5496d9=statSync(_0x4421dd);if(_0x5496d9&&_0x5496d9[_0x121ad0(0x1d0)]())_0x426f6a=_0x426f6a['concat'](getLocalPages(_0x4421dd,_0x4fff51,_0x329944));else{if(_0x15376a[_0x121ad0(0x1ec)]('.tsx')){let _0x27489d=relative(_0x4fff51,_0x4421dd);_0x27489d['endsWith'](_0x121ad0(0x1d4))?_0x27489d=_0x27489d[_0x121ad0(0x1d5)](/index\.tsx$/,''):_0x27489d=_0x27489d['replace'](/\.tsx$/,'');_0x27489d['endsWith'](sep)&&(_0x27489d=_0x27489d[_0x121ad0(0x1be)](0x0,-0x1));const _0x23d58b=_0x27489d['split'](sep)[_0x121ad0(0x1d1)]('/'),_0x465a78=extractTitleFromComment(_0x4421dd),_0x235fca=_0x465a78||_0x23d58b;_0x426f6a['push']({'path':_0x23d58b[_0x121ad0(0x1e9)]('$',':'),'label':_0x235fca});}}}),_0x426f6a[_0x4f2d6e(0x1ed)](_0x3589db=>_0x3589db[_0x4f2d6e(0x1d9)]!=='');}function getDeclaredPages(_0x46d944,_0xe737a8){const _0x57ae30=a178_0x9f0a57;let _0x39efb3;try{_0x39efb3=JSON[_0x57ae30(0x1c8)](readFileSync(_0x46d944,_0x57ae30(0x1cc)));}catch(_0x39f6d6){throw new Error(_0x57ae30(0x1c1)+_0x46d944+':\x20'+String(_0x39f6d6));}if(!Array[_0x57ae30(0x1c0)](_0x39efb3))throw new Error(_0x57ae30(0x1e4)+_0x46d944);const _0x2dd77e=new Set();return _0x39efb3[_0x57ae30(0x1e5)]((_0x35d53f,_0x4b0f5c)=>{const _0x5ed2f3=_0x57ae30;if(!_0x35d53f||typeof _0x35d53f!=='object'||Array['isArray'](_0x35d53f))throw new Error(_0x5ed2f3(0x1d8)+(_0x4b0f5c+0x1));const _0x57296e=_0x35d53f,_0x55d7f3=_0x57296e[_0x5ed2f3(0x1d9)],_0x1f1b2b=_0x57296e[_0x5ed2f3(0x1f0)],_0xf80061=_0x57296e[_0x5ed2f3(0x1c2)];if(typeof _0x55d7f3!==_0x5ed2f3(0x1e1)||!/^\/(?!\/)[^?#]*$/['test'](_0x55d7f3)||typeof _0x1f1b2b!==_0x5ed2f3(0x1e1)||!_0x1f1b2b[_0x5ed2f3(0x1cd)]()||typeof _0xf80061!==_0x5ed2f3(0x1e1)||!/^src\/pages\/(?!.*\.\.)[^/].*\.tsx$/[_0x5ed2f3(0x1ee)](_0xf80061)||typeof _0x57296e[_0x5ed2f3(0x1c6)]!==_0x5ed2f3(0x1ea))throw new Error(_0x5ed2f3(0x1d8)+(_0x4b0f5c+0x1)+_0x5ed2f3(0x1cf));if(_0x2dd77e[_0x5ed2f3(0x1f1)](_0x55d7f3))throw new Error(_0x5ed2f3(0x1df)+_0x55d7f3);_0x2dd77e['add'](_0x55d7f3);if(!existsSync(resolve(_0xe737a8,_0xf80061)))throw new Error(_0x5ed2f3(0x1e0)+_0xf80061);const _0x219036=_0xf80061[_0x5ed2f3(0x1be)](_0x5ed2f3(0x1e7)[_0x5ed2f3(0x1c7)])['replace'](/\/index\.tsx$/,'')[_0x5ed2f3(0x1d5)](/\.tsx$/,'')[_0x5ed2f3(0x1e9)]('$',':')['replace'](/\[([^/\]]+)\]/g,_0x5ed2f3(0x1eb)),_0x173a6d=_0x219036===_0x5ed2f3(0x1e6)?'/':'/'+_0x219036;if(_0x55d7f3!==_0x173a6d)throw new Error(_0x5ed2f3(0x1ca)+_0x55d7f3+_0x5ed2f3(0x1c3)+_0xf80061+';\x20expected\x20'+_0x173a6d);if(_0x57296e[_0x5ed2f3(0x1db)]!==undefined&&(typeof _0x57296e['group']!==_0x5ed2f3(0x1e1)||!_0x57296e[_0x5ed2f3(0x1db)]['trim']()))throw new Error(_0x5ed2f3(0x1ce)+_0x55d7f3);if(_0x57296e[_0x5ed2f3(0x1bf)]!==undefined&&(!Number[_0x5ed2f3(0x1d7)](_0x57296e['order'])||_0x57296e[_0x5ed2f3(0x1bf)]<0x0))throw new Error(_0x5ed2f3(0x1d3)+_0x55d7f3);return{'path':_0x55d7f3,'label':_0x1f1b2b[_0x5ed2f3(0x1cd)](),'visible':_0x57296e['visible'],..._0x57296e['group']===undefined?{}:{'group':_0x57296e['group'][_0x5ed2f3(0x1cd)]()},..._0x57296e[_0x5ed2f3(0x1bf)]===undefined?{}:{'order':_0x57296e[_0x5ed2f3(0x1bf)]}};});}
1
+ const a178_0x1b543f=a178_0x25ee;(function(_0x7067ec,_0x5a48eb){const _0x5b26bc=a178_0x25ee,_0xa29e61=_0x7067ec();while(!![]){try{const _0x41f443=parseInt(_0x5b26bc(0x13d))/0x1+-parseInt(_0x5b26bc(0x14a))/0x2*(parseInt(_0x5b26bc(0x15e))/0x3)+-parseInt(_0x5b26bc(0x157))/0x4*(-parseInt(_0x5b26bc(0x163))/0x5)+parseInt(_0x5b26bc(0x13c))/0x6*(-parseInt(_0x5b26bc(0x156))/0x7)+parseInt(_0x5b26bc(0x15a))/0x8*(parseInt(_0x5b26bc(0x15d))/0x9)+-parseInt(_0x5b26bc(0x143))/0xa+parseInt(_0x5b26bc(0x166))/0xb;if(_0x41f443===_0x5a48eb)break;else _0xa29e61['push'](_0xa29e61['shift']());}catch(_0x16e827){_0xa29e61['push'](_0xa29e61['shift']());}}}(a178_0x41a7,0xe6d2f));import{existsSync,readdirSync,statSync,readFileSync}from'fs';import{join,relative,resolve,sep}from'path';const pagesDir=resolve(process[a178_0x1b543f(0x164)](),a178_0x1b543f(0x167));function a178_0x41a7(){const _0x126d28=['group','has','Route\x20manifest\x20must\x20contain\x20an\x20array:\x20','object','replace','match','24LTarXg','362100pCtnEk','utf8','isInteger','Route\x20page\x20file\x20does\x20not\x20exist:\x20','path','isDirectory','3368450CCeGaA','isArray','filter','push','label','join','\x20disagrees\x20with\x20pageFile\x20','2FTrLsn',';\x20expected\x20','Invalid\x20route\x20manifest\x20row\x20','string','order','index.tsx','Invalid\x20route\x20group\x20for\x20','replaceAll','.tsx','forEach','add','visible','69496NeYeOV','132380aIHRnp','endsWith','trim','296peeyZI','test','slice','259542QkmBrL','4227981EJXfbP','Duplicate\x20route\x20path\x20in\x20manifest:\x20','length','Invalid\x20route\x20order\x20for\x20','boolean','195acVtsw','cwd','src/features/routing/routes.json','126808jTwVTh','src/pages',':\x20path,\x20label,\x20pageFile\x20and\x20visible\x20are\x20required'];a178_0x41a7=function(){return _0x126d28;};return a178_0x41a7();}export function extractTitleFromComment(_0x14b745){const _0x3894ce=a178_0x1b543f;try{const _0x4afc30=readFileSync(_0x14b745,'utf-8'),_0x5cc52b=_0x4afc30[_0x3894ce(0x13b)](/^\s*\/\*\*?([\s\S]*?)\*\//);if(_0x5cc52b&&_0x5cc52b[0x1]){const _0x307508=_0x5cc52b[0x1],_0x5073be=_0x307508[_0x3894ce(0x13b)](/^\s*\*?\s*title\s*:\s*(.+)/im);if(_0x5073be&&_0x5073be[0x1])return _0x5073be[0x1]['trim']();}let _0x282e5f=null;const _0x5dad13=_0x4afc30[_0x3894ce(0x13b)](/export\s+default\s+([A-Z][a-zA-Z0-9]*)/);_0x5dad13&&_0x5dad13[0x1]&&(_0x282e5f=_0x5dad13[0x1]);if(!_0x282e5f){const _0xd6b6ab=_0x4afc30[_0x3894ce(0x13b)](/export\s+default\s+function\s+([A-Z][a-zA-Z0-9]*)/);_0xd6b6ab&&_0xd6b6ab[0x1]&&(_0x282e5f=_0xd6b6ab[0x1]);}if(_0x282e5f){const _0x2362bc=new RegExp('\x5cb'+_0x282e5f+'\x5c.displayName\x5cs*=\x5cs*[\x22\x27]([^\x22\x27]+)[\x22\x27]'),_0x186155=_0x4afc30[_0x3894ce(0x13b)](_0x2362bc);if(_0x186155&&_0x186155[0x1])return _0x186155[0x1];return _0x282e5f;}return null;}catch(_0x4ab95a){return null;}}export function getLocalPages(_0x1d623e=pagesDir,_0x62b8e7=pagesDir,_0x20db95=process['cwd']()){const _0x3e04eb=a178_0x1b543f;if(resolve(_0x1d623e)===resolve(_0x62b8e7)){const _0x26759b=join(_0x20db95,_0x3e04eb(0x165));if(existsSync(_0x26759b))return getDeclaredPages(_0x26759b,_0x20db95);}let _0x3779e6=[];const _0x2c66d7=readdirSync(_0x1d623e);return _0x2c66d7[_0x3e04eb(0x153)](_0x4c34a9=>{const _0x15ceae=_0x3e04eb,_0x5e1302=join(_0x1d623e,_0x4c34a9),_0xbc801c=statSync(_0x5e1302);if(_0xbc801c&&_0xbc801c[_0x15ceae(0x142)]())_0x3779e6=_0x3779e6['concat'](getLocalPages(_0x5e1302,_0x62b8e7,_0x20db95));else{if(_0x4c34a9[_0x15ceae(0x158)](_0x15ceae(0x152))){let _0x59ac02=relative(_0x62b8e7,_0x5e1302);_0x59ac02[_0x15ceae(0x158)](_0x15ceae(0x14f))?_0x59ac02=_0x59ac02[_0x15ceae(0x13a)](/index\.tsx$/,''):_0x59ac02=_0x59ac02['replace'](/\.tsx$/,'');_0x59ac02[_0x15ceae(0x158)](sep)&&(_0x59ac02=_0x59ac02[_0x15ceae(0x15c)](0x0,-0x1));const _0x383f22=_0x59ac02['split'](sep)[_0x15ceae(0x148)]('/'),_0x1d255a=extractTitleFromComment(_0x5e1302),_0x2fae77=_0x1d255a||_0x383f22;_0x3779e6[_0x15ceae(0x146)]({'path':_0x383f22[_0x15ceae(0x151)]('$',':'),'label':_0x2fae77});}}}),_0x3779e6[_0x3e04eb(0x145)](_0x1bfe0d=>_0x1bfe0d[_0x3e04eb(0x141)]!=='');}function a178_0x25ee(_0x4e8595,_0x22cfde){_0x4e8595=_0x4e8595-0x139;const _0x41a77a=a178_0x41a7();let _0x25ee85=_0x41a77a[_0x4e8595];return _0x25ee85;}function getDeclaredPages(_0x7fc37b,_0x3235c7){const _0x2597b5=a178_0x1b543f;let _0x420d06;try{_0x420d06=JSON['parse'](readFileSync(_0x7fc37b,_0x2597b5(0x13e)));}catch(_0x1a24c7){throw new Error('Invalid\x20route\x20manifest\x20'+_0x7fc37b+':\x20'+String(_0x1a24c7));}if(!Array[_0x2597b5(0x144)](_0x420d06))throw new Error(_0x2597b5(0x16b)+_0x7fc37b);const _0x2a7b2e=new Set();return _0x420d06['map']((_0x47f3a4,_0x37e029)=>{const _0x695c0c=_0x2597b5;if(!_0x47f3a4||typeof _0x47f3a4!==_0x695c0c(0x139)||Array[_0x695c0c(0x144)](_0x47f3a4))throw new Error(_0x695c0c(0x14c)+(_0x37e029+0x1));const _0x5d2120=_0x47f3a4,_0x1aea80=_0x5d2120['path'],_0x3b5931=_0x5d2120[_0x695c0c(0x147)],_0x44e7e5=_0x5d2120['pageFile'];if(typeof _0x1aea80!=='string'||!/^\/(?!\/)[^?#]*$/[_0x695c0c(0x15b)](_0x1aea80)||typeof _0x3b5931!=='string'||!_0x3b5931[_0x695c0c(0x159)]()||typeof _0x44e7e5!=='string'||!/^src\/pages\/(?!.*\.\.)[^/].*\.tsx$/['test'](_0x44e7e5)||typeof _0x5d2120['visible']!==_0x695c0c(0x162))throw new Error(_0x695c0c(0x14c)+(_0x37e029+0x1)+_0x695c0c(0x168));if(_0x2a7b2e[_0x695c0c(0x16a)](_0x1aea80))throw new Error(_0x695c0c(0x15f)+_0x1aea80);_0x2a7b2e[_0x695c0c(0x154)](_0x1aea80);if(!existsSync(resolve(_0x3235c7,_0x44e7e5)))throw new Error(_0x695c0c(0x140)+_0x44e7e5);const _0x2856e5=_0x44e7e5[_0x695c0c(0x15c)]('src/pages/'[_0x695c0c(0x160)])[_0x695c0c(0x13a)](/\/index\.tsx$/,'')['replace'](/\.tsx$/,'')[_0x695c0c(0x151)]('$',':')[_0x695c0c(0x13a)](/\[([^/\]]+)\]/g,':$1'),_0x564f57=_0x2856e5==='index'?'/':'/'+_0x2856e5;if(_0x1aea80!==_0x564f57)throw new Error('Route\x20'+_0x1aea80+_0x695c0c(0x149)+_0x44e7e5+_0x695c0c(0x14b)+_0x564f57);if(_0x5d2120[_0x695c0c(0x169)]!==undefined&&(typeof _0x5d2120[_0x695c0c(0x169)]!==_0x695c0c(0x14d)||!_0x5d2120[_0x695c0c(0x169)]['trim']()))throw new Error(_0x695c0c(0x150)+_0x1aea80);if(_0x5d2120['order']!==undefined&&(!Number[_0x695c0c(0x13f)](_0x5d2120[_0x695c0c(0x14e)])||_0x5d2120['order']<0x0))throw new Error(_0x695c0c(0x161)+_0x1aea80);return{'path':_0x1aea80,'label':_0x3b5931[_0x695c0c(0x159)](),'visible':_0x5d2120[_0x695c0c(0x155)],..._0x5d2120[_0x695c0c(0x169)]===undefined?{}:{'group':_0x5d2120[_0x695c0c(0x169)][_0x695c0c(0x159)]()},..._0x5d2120[_0x695c0c(0x14e)]===undefined?{}:{'order':_0x5d2120[_0x695c0c(0x14e)]}};});}
@@ -1 +1 @@
1
- (function(_0x5566bb,_0x1e1fd0){const _0x3ca6bd=a179_0x178d,_0x23eb82=_0x5566bb();while(!![]){try{const _0x456ae0=-parseInt(_0x3ca6bd(0xa3))/0x1+parseInt(_0x3ca6bd(0xac))/0x2*(parseInt(_0x3ca6bd(0xaa))/0x3)+parseInt(_0x3ca6bd(0xb0))/0x4*(-parseInt(_0x3ca6bd(0xa5))/0x5)+-parseInt(_0x3ca6bd(0xae))/0x6*(-parseInt(_0x3ca6bd(0xa1))/0x7)+-parseInt(_0x3ca6bd(0xad))/0x8*(parseInt(_0x3ca6bd(0xb6))/0x9)+parseInt(_0x3ca6bd(0xa2))/0xa*(-parseInt(_0x3ca6bd(0xa0))/0xb)+parseInt(_0x3ca6bd(0xb4))/0xc;if(_0x456ae0===_0x1e1fd0)break;else _0x23eb82['push'](_0x23eb82['shift']());}catch(_0x5daaaf){_0x23eb82['push'](_0x23eb82['shift']());}}}(a179_0x4385,0x6f8cb));import{menuPathKey}from'../../../commands/menu/shared/path.js';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';export function validateJsUrl(_0x571a4b){const _0x4b696e=a179_0x178d,_0x154931=[];return!isValidJsHttpsUrl(_0x571a4b)&&_0x154931[_0x4b696e(0xa8)]('JS\x20URL\x20must\x20be\x20a\x20valid\x20https://...js\x20URL'),{'ok':_0x154931[_0x4b696e(0xa7)]===0x0,'errors':_0x154931};}function a179_0x4385(){const _0x59c1d4=['1252750qrbDbb','872656pikgNU','JS\x20URL\x20is\x20unreachable','1294045UrYsgh','errors','length','push','has','1674rureah','resources','2072mihkKF','872HELhnk','37740kijoVV','CSS\x20URL\x20must\x20be\x20a\x20valid\x20https://...css\x20URL','12dEjmho','CSS\x20URL\x20is\x20unreachable','path','label','21259848qBwUut','map','69552IMBuXb','22ZDmMUR','945wFYNxO'];a179_0x4385=function(){return _0x59c1d4;};return a179_0x4385();}export function validateCssUrl(_0x1e3e4f){const _0x41dc94=a179_0x178d,_0x160e45=[];return!isValidCssHttpsUrl(_0x1e3e4f)&&_0x160e45['push'](_0x41dc94(0xaf)),{'ok':_0x160e45[_0x41dc94(0xa7)]===0x0,'errors':_0x160e45};}export async function validateJsUrlReachable(_0x249378){const _0x59e121=a179_0x178d,_0x510879=validateJsUrl(_0x249378);if(!_0x510879['ok'])return _0x510879;const _0x195abc=await isUrlReachable(_0x249378);if(!_0x195abc)_0x510879['errors'][_0x59e121(0xa8)](_0x59e121(0xa4));return{'ok':_0x510879[_0x59e121(0xa6)]['length']===0x0,'errors':_0x510879['errors']};}export async function validateCssUrlReachable(_0x2ce3da){const _0x4a9d59=a179_0x178d,_0x371c08=validateCssUrl(_0x2ce3da);if(!_0x371c08['ok'])return _0x371c08;const _0x12015c=await isUrlReachable(_0x2ce3da);if(!_0x12015c)_0x371c08[_0x4a9d59(0xa6)][_0x4a9d59(0xa8)](_0x4a9d59(0xb1));return{'ok':_0x371c08[_0x4a9d59(0xa6)]['length']===0x0,'errors':_0x371c08[_0x4a9d59(0xa6)]};}export function buildCompareRows(_0x29df4f,_0x16748a){const _0x1ccf2e=a179_0x178d;return _0x29df4f[_0x1ccf2e(0xb5)](_0x565c2d=>({'label':_0x565c2d['label'],'path':_0x565c2d[_0x1ccf2e(0xb2)],'local':!![],'online':_0x16748a[_0x1ccf2e(0xa9)](menuPathKey(_0x565c2d[_0x1ccf2e(0xb2)]))}));}export async function doCreateMenus(_0x235126,_0x364216,_0x3127d1,_0x2affc8,_0x279ce7){const _0x44a4ef=a179_0x178d,_0x29d574=_0x279ce7?await createMenus(_0x235126,_0x364216,_0x3127d1,_0x2affc8,_0x279ce7):await createMenus(_0x235126,_0x364216,_0x3127d1,_0x2affc8);return{'created':_0x29d574[_0x44a4ef(0xa7)],'failed':0x0,'labels':_0x3127d1[_0x44a4ef(0xb5)](_0x3e8c24=>_0x3e8c24[_0x44a4ef(0xb3)]),'menus':_0x29d574};}function a179_0x178d(_0x380906,_0x2ee414){_0x380906=_0x380906-0xa0;const _0x43856b=a179_0x4385();let _0x178dd4=_0x43856b[_0x380906];return _0x178dd4;}export function filterMenusWithResources(_0x26e7c5){const _0x56018b=a179_0x178d;return _0x26e7c5['filter'](_0x3fb387=>_0x3fb387[_0x56018b(0xab)][_0x56018b(0xa7)]>0x0);}export async function fetchMenuData(_0x1333a7,_0x3fcf54){const _0x3464c8=a179_0x178d,_0x3bb4ec=getLocalPages(),_0x207652=await getOnlineMenuList(_0x1333a7,_0x3fcf54),_0x3b503e=new Set(_0x207652[_0x3464c8(0xb5)](_0x2f79f0=>menuPathKey(_0x2f79f0[_0x3464c8(0xb2)])));return{'localPages':_0x3bb4ec,'onlineMenuList':_0x207652,'onlinePaths':_0x3b503e};}export async function fetchOnlineMenuList(_0x5835c8,_0x5bf656){return getOnlineMenuList(_0x5835c8,_0x5bf656);}
1
+ (function(_0x4bcc16,_0x1584b4){const _0x305c0e=a179_0x5b6d,_0x54f6f4=_0x4bcc16();while(!![]){try{const _0x2c2754=parseInt(_0x305c0e(0x18f))/0x1+-parseInt(_0x305c0e(0x198))/0x2*(parseInt(_0x305c0e(0x185))/0x3)+parseInt(_0x305c0e(0x193))/0x4*(-parseInt(_0x305c0e(0x191))/0x5)+parseInt(_0x305c0e(0x199))/0x6*(-parseInt(_0x305c0e(0x186))/0x7)+-parseInt(_0x305c0e(0x195))/0x8*(parseInt(_0x305c0e(0x196))/0x9)+parseInt(_0x305c0e(0x18c))/0xa*(-parseInt(_0x305c0e(0x194))/0xb)+parseInt(_0x305c0e(0x188))/0xc;if(_0x2c2754===_0x1584b4)break;else _0x54f6f4['push'](_0x54f6f4['shift']());}catch(_0x36c260){_0x54f6f4['push'](_0x54f6f4['shift']());}}}(a179_0x446d,0x9f9ee));import{menuPathKey}from'../../../commands/menu/shared/path.js';function a179_0x446d(){const _0x422036=['errors','has','resources','30EeKFwp','JS\x20URL\x20is\x20unreachable','CSS\x20URL\x20must\x20be\x20a\x20valid\x20https://...css\x20URL','313113tWNVZm','map','1200945zpURQs','path','12jAyeSN','1274042dASSLu','10352584bQKpCz','9qtgGeK','length','74yEYKni','30iayIoB','push','filter','10551RPNSEA','904351kYHWts','CSS\x20URL\x20is\x20unreachable','41746716NHzais'];a179_0x446d=function(){return _0x422036;};return a179_0x446d();}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';export function validateJsUrl(_0x340364){const _0x3df9e1=a179_0x5b6d,_0x3f1fbd=[];return!isValidJsHttpsUrl(_0x340364)&&_0x3f1fbd[_0x3df9e1(0x183)]('JS\x20URL\x20must\x20be\x20a\x20valid\x20https://...js\x20URL'),{'ok':_0x3f1fbd[_0x3df9e1(0x197)]===0x0,'errors':_0x3f1fbd};}export function validateCssUrl(_0x3d942b){const _0x3d44a3=a179_0x5b6d,_0x315d82=[];return!isValidCssHttpsUrl(_0x3d942b)&&_0x315d82[_0x3d44a3(0x183)](_0x3d44a3(0x18e)),{'ok':_0x315d82[_0x3d44a3(0x197)]===0x0,'errors':_0x315d82};}export async function validateJsUrlReachable(_0x4004d5){const _0x3e1836=a179_0x5b6d,_0x2f20c2=validateJsUrl(_0x4004d5);if(!_0x2f20c2['ok'])return _0x2f20c2;const _0x5ee9b6=await isUrlReachable(_0x4004d5);if(!_0x5ee9b6)_0x2f20c2[_0x3e1836(0x189)][_0x3e1836(0x183)](_0x3e1836(0x18d));return{'ok':_0x2f20c2[_0x3e1836(0x189)][_0x3e1836(0x197)]===0x0,'errors':_0x2f20c2[_0x3e1836(0x189)]};}export async function validateCssUrlReachable(_0x42b2d0){const _0x540b92=a179_0x5b6d,_0x3bcff8=validateCssUrl(_0x42b2d0);if(!_0x3bcff8['ok'])return _0x3bcff8;const _0x26a3c2=await isUrlReachable(_0x42b2d0);if(!_0x26a3c2)_0x3bcff8['errors']['push'](_0x540b92(0x187));return{'ok':_0x3bcff8[_0x540b92(0x189)][_0x540b92(0x197)]===0x0,'errors':_0x3bcff8[_0x540b92(0x189)]};}export function buildCompareRows(_0x7538a2,_0x3d3b3e){const _0x5ca738=a179_0x5b6d;return _0x7538a2[_0x5ca738(0x190)](_0x21f7ad=>({'label':_0x21f7ad['label'],'path':_0x21f7ad[_0x5ca738(0x192)],'local':!![],'online':_0x3d3b3e[_0x5ca738(0x18a)](menuPathKey(_0x21f7ad[_0x5ca738(0x192)]))}));}export async function doCreateMenus(_0x1cbfa8,_0xe774d1,_0x53c119,_0x2aed98,_0x3c3a49){const _0x563b65=a179_0x5b6d,_0x2562f0=_0x3c3a49?await createMenus(_0x1cbfa8,_0xe774d1,_0x53c119,_0x2aed98,_0x3c3a49):await createMenus(_0x1cbfa8,_0xe774d1,_0x53c119,_0x2aed98);return{'created':_0x2562f0[_0x563b65(0x197)],'failed':0x0,'labels':_0x53c119[_0x563b65(0x190)](_0x48dbbe=>_0x48dbbe['label']),'menus':_0x2562f0};}export function filterMenusWithResources(_0x3b0ba4){const _0x49891b=a179_0x5b6d;return _0x3b0ba4[_0x49891b(0x184)](_0x5f172b=>_0x5f172b[_0x49891b(0x18b)][_0x49891b(0x197)]>0x0);}export async function fetchMenuData(_0x30e113,_0xe0a1cb){const _0x3beec6=a179_0x5b6d,_0x1d7392=getLocalPages(),_0x1b16f9=await getOnlineMenuList(_0x30e113,_0xe0a1cb),_0x570f28=new Set(_0x1b16f9['map'](_0xaa76e2=>menuPathKey(_0xaa76e2[_0x3beec6(0x192)])));return{'localPages':_0x1d7392,'onlineMenuList':_0x1b16f9,'onlinePaths':_0x570f28};}function a179_0x5b6d(_0x1c6890,_0x44718a){_0x1c6890=_0x1c6890-0x183;const _0x446d44=a179_0x446d();let _0x5b6d35=_0x446d44[_0x1c6890];return _0x5b6d35;}export async function fetchOnlineMenuList(_0x4f7127,_0xd40e41){return getOnlineMenuList(_0x4f7127,_0xd40e41);}
@@ -1 +1 @@
1
- const a180_0x941e73=a180_0xc719;(function(_0x3ac30f,_0x50839f){const _0x20de0f=a180_0xc719,_0x27fa85=_0x3ac30f();while(!![]){try{const _0x877d8d=-parseInt(_0x20de0f(0xd7))/0x1*(parseInt(_0x20de0f(0xd1))/0x2)+-parseInt(_0x20de0f(0xf2))/0x3*(parseInt(_0x20de0f(0xb9))/0x4)+-parseInt(_0x20de0f(0xed))/0x5*(parseInt(_0x20de0f(0xbf))/0x6)+-parseInt(_0x20de0f(0xba))/0x7+parseInt(_0x20de0f(0xb1))/0x8*(-parseInt(_0x20de0f(0xd0))/0x9)+-parseInt(_0x20de0f(0xc3))/0xa*(parseInt(_0x20de0f(0xcb))/0xb)+parseInt(_0x20de0f(0xc8))/0xc;if(_0x877d8d===_0x50839f)break;else _0x27fa85['push'](_0x27fa85['shift']());}catch(_0x5235b9){_0x27fa85['push'](_0x27fa85['shift']());}}}(a180_0x3e60,0x93f5b));import{CliError,CliErrors}from'../../../errors.js';import{fetchMenuSnapshot,getChildren}from'../../../commands/menu/shared/facts.js';export const MAX_MENU_SORT=0x7fffffff;export const MENU_ID_FLAG={'name':'id','type':'number','required':!![],'description':'Exact\x20online\x20menu\x20id'};export const MENU_SORT_FLAG={'name':a180_0x941e73(0x106),'type':'number','description':'Sibling\x20sort\x20value\x20(non-negative\x20integer)'};export const MENU_PARENT_ID_FLAG={'name':a180_0x941e73(0xec),'type':a180_0x941e73(0xdd),'description':'Parent\x20folder\x20id;\x20use\x20root\x20for\x20a\x20root-level\x20node'};function a180_0x3e60(){const _0x16c6f8=['deleteOrder','Run\x20the\x20same\x20command\x20with\x20--dry-run\x20again\x20and\x20review\x20the\x20latest\x20snapshot\x20before\x20retrying.','\x20child\x20count\x20changed:\x20expected\x20','menu_sort_invalid','--expected-children-count\x20must\x20be\x20a\x20non-negative\x20integer.','string','Abort\x20unless\x20the\x20current\x20parent\x20id\x20matches;\x20use\x20root\x20for\x20root\x20level','--id\x20must\x20be\x20a\x20positive\x20integer\x20menu\x20id.','verification','toLowerCase','succeeded','length','folder','backend','map','Re-run\x20the\x20command\x20with\x20--dry-run\x20and\x20update\x20the\x20expect\x20flags\x20before\x20retrying.','unknown','cascade','dryRun','Menu\x20','parent-id','1632785aYZXZp','\x20because\x20the\x20current\x20maximum\x20sibling\x20sort\x20is\x20','\x20path\x20changed:\x20expected\x20','menu_permission_denied','Re-run\x20menu\x20list\x20to\x20inspect\x20the\x20latest\x20online\x20state\x20before\x20retrying.','33CyPnKo','warnings','Abort\x20unless\x20the\x20current\x20direct\x20child\x20count\x20matches','read\x20online\x20menu\x20facts\x20before\x20','snapshotHash','childrenCount',',\x20or\x20pass\x20an\x20explicit\x20--sort\x20value.','num','code','hasOwnProperty','appCode','dry-run','\x22,\x20not\x20folder.','parentId','flagMissing','stringify','filter','plannedActions','expect-path','cookie','sort','Choose\x20a\x20sort\x20value\x20within\x20the\x20Java\x20Integer\x20range\x20used\x20by\x20the\x20menu\x20service.','failed','message','The\x20write\x20may\x20already\x20have\x20taken\x20effect.\x20Run\x20`rabetbase\x20menu\x20list\x20--format\x20json`\x20and\x20inspect\x20the\x20returned\x20id\x20before\x20retrying.','byId','Reorder\x20sibling\x20menus\x20below\x20','data','prototype','expected-children-count','Failed\x20to\x20','\x20parent\x20changed:\x20expected\x20','type','menu_mutation_failed','Online\x20menu\x20state\x20changed\x20before\x20','menu_sort_overflow','menu_confirmation_required','yes','root','menu_parent_not_folder','targets','27872obLWRW','\x20is\x20type\x20\x22','test','hash','max','validation','menu_state_drift','number','352784aHergE','80647HKHpBa','trim',',\x20current\x20','after','expect-parent-id','6IRXdtF','Choose\x20a\x20menu\x20whose\x20type\x20is\x20folder,\x20or\x20use\x20root.','Abort\x20unless\x20the\x20current\x20menu\x20path\x20exactly\x20matches','menu_verification_failed','470TpvAUg','rawFlags','pre-write-recheck','bool','hint','59485140edRJsa','Permission\x20denied\x20while\x20attempting\x20to\x20','api_error','176429couDOb','menu_not_found','path','str','planFile','3123dvDUcf','14FBvbcE','Online\x20menu\x20not\x20found:\x20','\x20must\x20be\x20a\x20positive\x20menu\x20id\x20or\x20root.','isSafeInteger','Cannot\x20append\x20a\x20','selector','154291eeGWeO'];a180_0x3e60=function(){return _0x16c6f8;};return a180_0x3e60();}export const MENU_EXPECT_PARENT_ID_FLAG={'name':a180_0x941e73(0xbe),'type':a180_0x941e73(0xdd),'description':a180_0x941e73(0xde)};export const MENU_EXPECT_FLAGS=[MENU_EXPECT_PARENT_ID_FLAG,{'name':a180_0x941e73(0x104),'type':'string','description':a180_0x941e73(0xc1)},{'name':a180_0x941e73(0x10f),'type':a180_0x941e73(0xb8),'description':a180_0x941e73(0xf4)}];export function validateExactId(_0x2ccbfd){const _0x486075=a180_0x941e73,_0x214691=_0x2ccbfd[_0x486075(0xf9)]('id');if(!Number[_0x486075(0xd4)](_0x214691)||_0x214691<=0x0)throw CliErrors[_0x486075(0xb6)](_0x486075(0xdf));return _0x214691;}export function validateSort(_0x1fa591,_0xfe5301=a180_0x941e73(0x106)){const _0x9fa676=a180_0x941e73;if(!hasFlag(_0x1fa591,_0xfe5301))return undefined;const _0x478d35=_0x1fa591[_0x9fa676(0xf9)](_0xfe5301);if(!Number['isSafeInteger'](_0x478d35)||_0x478d35<0x0||_0x478d35>MAX_MENU_SORT)throw menuError(_0x9fa676(0xdb),'--'+_0xfe5301+'\x20must\x20be\x20an\x20integer\x20between\x200\x20and\x20'+MAX_MENU_SORT+'.',_0x9fa676(0x107));return _0x478d35;}export function nextSiblingSort(_0x10ed09,_0x371369,_0x2cf5fc){const _0x268c36=a180_0x941e73,_0x33e2a7=getChildren(_0x10ed09,_0x371369)[_0x268c36(0xe6)](_0x8186c=>_0x8186c[_0x268c36(0x106)])[_0x268c36(0x102)](_0x1ab787=>typeof _0x1ab787===_0x268c36(0xb8));if(_0x33e2a7[_0x268c36(0xe3)]===0x0)return 0x0;const _0x47d91d=Math[_0x268c36(0xb5)](..._0x33e2a7);if(_0x47d91d>=MAX_MENU_SORT)throw menuError(_0x268c36(0xab),_0x268c36(0xd5)+_0x2cf5fc+_0x268c36(0xee)+_0x47d91d+'.',_0x268c36(0x10c)+MAX_MENU_SORT+_0x268c36(0xf8));return _0x47d91d+0x1;}export function requireExplicitYes(_0x4e9c5b){const _0x353e4e=a180_0x941e73;if(_0x4e9c5b[_0x353e4e(0xc6)](_0x353e4e(0xfd)))return;if(!_0x4e9c5b[_0x353e4e(0xc6)](_0x353e4e(0xad)))throw menuError(_0x353e4e(0xac),'This\x20menu\x20mutation\x20requires\x20explicit\x20--yes.','Run\x20the\x20same\x20command\x20with\x20--dry-run\x20first,\x20then\x20add\x20--yes\x20after\x20reviewing\x20the\x20plan.');}export async function fetchMutationSnapshot(_0x1f368e,_0x1eec88,_0x393559){const _0x52132c=a180_0x941e73;try{return await fetchMenuSnapshot(_0x1f368e['appCode'],_0x1f368e[_0x52132c(0x105)]);}catch(_0x8377e7){throw mapMenuApiError(_0x8377e7,_0x52132c(0xf5)+_0x1eec88,_0x393559);}}export async function recheckMutationSnapshot(_0x21b375,_0x3e264c,_0x45540c,_0x1e1e15){const _0xce78b7=a180_0x941e73;let _0x4beaa5;try{_0x4beaa5=await fetchMenuSnapshot(_0x21b375[_0xce78b7(0xfc)],_0x21b375[_0xce78b7(0x105)]);}catch(_0x530279){const _0x93236=mapMenuApiError(_0x530279,'recheck\x20online\x20menu\x20facts\x20before\x20'+_0x45540c,_0x1e1e15);throw menuFailure(_0x93236,_0x3e264c,{'stage':'pre-write-recheck','failed':_0x1e1e15==null?{}:{'id':_0x1e1e15}});}if(_0x4beaa5[_0xce78b7(0xb4)]!==_0x3e264c['snapshotHash']){const _0x188bd2=menuError(_0xce78b7(0xb7),_0xce78b7(0x114)+_0x45540c+';\x20the\x20planned\x20snapshot\x20is\x20no\x20longer\x20current.',_0xce78b7(0xd9));throw menuFailure(_0x188bd2,_0x3e264c,{'stage':_0xce78b7(0xc5),'failed':{..._0x1e1e15==null?{}:{'id':_0x1e1e15},'expectedSnapshotHash':_0x3e264c[_0xce78b7(0xf6)],'currentSnapshotHash':_0x4beaa5[_0xce78b7(0xb4)]}});}return _0x4beaa5;}export function parseParentId(_0x36caa8,_0x264024,_0x4d17f0={}){const _0xf86f=a180_0x941e73;if(!hasFlag(_0x36caa8,_0x264024)){if(_0x4d17f0['required'])throw CliErrors[_0xf86f(0x100)](_0x264024);return undefined;}const _0x2de1f3=_0x36caa8[_0xf86f(0xce)](_0x264024)[_0xf86f(0xbb)]();if(_0x2de1f3[_0xf86f(0xe1)]()==='root')return null;if(!/^\d+$/['test'](_0x2de1f3))throw CliErrors[_0xf86f(0xb6)]('--'+_0x264024+_0xf86f(0xd3));const _0x211f10=Number(_0x2de1f3);if(!Number[_0xf86f(0xd4)](_0x211f10)||_0x211f10<=0x0)throw CliErrors[_0xf86f(0xb6)]('--'+_0x264024+_0xf86f(0xd3));return _0x211f10;}export function requireMenu(_0xde4f5d,_0x1fa108){const _0x5a330a=a180_0x941e73,_0x2306a5=_0xde4f5d[_0x5a330a(0x10b)]['get'](_0x1fa108);if(!_0x2306a5)throw menuError(_0x5a330a(0xcc),_0x5a330a(0xd2)+_0x1fa108,'Run\x20`rabetbase\x20menu\x20list\x20--format\x20json`\x20and\x20use\x20an\x20exact\x20id\x20from\x20the\x20current\x20app.');return _0x2306a5;}export function requireFolder(_0x1b3083,_0x67e7a){const _0x9ec5fc=a180_0x941e73,_0x5d6229=requireMenu(_0x1b3083,_0x67e7a);if(_0x5d6229[_0x9ec5fc(0x112)]!==_0x9ec5fc(0xe4))throw menuError(_0x9ec5fc(0xaf),_0x9ec5fc(0xeb)+_0x67e7a+_0x9ec5fc(0xb2)+(_0x5d6229['type']||_0x9ec5fc(0xe8))+_0x9ec5fc(0xfe),_0x9ec5fc(0xc0));return _0x5d6229;}export function assertExpectedState(_0x354338,_0x28553a){const _0x21c441=a180_0x941e73;if(hasFlag(_0x354338,_0x21c441(0xbe))){const _0x781da5=parseParentId(_0x354338,_0x21c441(0xbe),{'required':!![]});if(_0x28553a[_0x21c441(0xff)]!==_0x781da5)throw stateDrift('Menu\x20'+_0x28553a['id']+_0x21c441(0x111)+formatParent(_0x781da5)+_0x21c441(0xbc)+formatParent(_0x28553a[_0x21c441(0xff)])+'.');}if(hasFlag(_0x354338,_0x21c441(0x104))){const _0x22ce1e=_0x354338[_0x21c441(0xce)](_0x21c441(0x104));if(_0x28553a[_0x21c441(0xcd)]!==_0x22ce1e)throw stateDrift(_0x21c441(0xeb)+_0x28553a['id']+_0x21c441(0xef)+JSON[_0x21c441(0x101)](_0x22ce1e)+',\x20current\x20'+JSON['stringify'](_0x28553a[_0x21c441(0xcd)])+'.');}if(hasFlag(_0x354338,'expected-children-count')){const _0x3a34e7=_0x354338['num'](_0x21c441(0x10f));if(!Number[_0x21c441(0xd4)](_0x3a34e7)||_0x3a34e7<0x0)throw CliErrors['validation'](_0x21c441(0xdc));if(_0x28553a[_0x21c441(0xf7)]!==_0x3a34e7)throw stateDrift(_0x21c441(0xeb)+_0x28553a['id']+_0x21c441(0xda)+_0x3a34e7+_0x21c441(0xbc)+_0x28553a['childrenCount']+'.');}}export function assertVerified(_0x297963,_0x28d575,_0x4a5c38='Run\x20`rabetbase\x20menu\x20list\x20--format\x20json`\x20to\x20inspect\x20the\x20latest\x20online\x20menu\x20state.'){const _0x3d4268=a180_0x941e73;if(!_0x297963)throw menuError(_0x3d4268(0xc2),_0x28d575,_0x4a5c38);}export function mutationResult(_0x268f5a){const _0x1bb364=a180_0x941e73;return{'operation':_0x268f5a['operation'],'selector':_0x268f5a[_0x1bb364(0xd6)],'before':_0x268f5a['before'],'after':_0x268f5a[_0x1bb364(0xbd)],'dryRun':_0x268f5a[_0x1bb364(0xea)],'backend':_0x268f5a[_0x1bb364(0xe5)],..._0x268f5a[_0x1bb364(0x103)]?{'plannedActions':_0x268f5a[_0x1bb364(0x103)]}:{},..._0x268f5a[_0x1bb364(0xb0)]?{'targets':_0x268f5a[_0x1bb364(0xb0)]}:{},..._0x268f5a[_0x1bb364(0xd8)]?{'deleteOrder':_0x268f5a[_0x1bb364(0xd8)]}:{},'snapshotHash':_0x268f5a[_0x1bb364(0xf6)],..._0x268f5a[_0x1bb364(0xe9)]?{'cascade':_0x268f5a[_0x1bb364(0xe9)]}:{},..._0x268f5a[_0x1bb364(0xcf)]?{'planFile':_0x268f5a[_0x1bb364(0xcf)]}:{},'succeeded':_0x268f5a[_0x1bb364(0xe2)]??[],'failed':_0x268f5a[_0x1bb364(0x108)]??[],'warnings':_0x268f5a[_0x1bb364(0xf3)]??[],'verification':_0x268f5a[_0x1bb364(0xe0)],'error':_0x268f5a['error']};}export function menuDryRunResult(_0x5d95aa,_0xb39198){return{..._0x5d95aa,..._0xb39198};}export function menuFailure(_0x1975a0,_0x3afbec,_0x82a97d){const _0x331f85=a180_0x941e73,_0x2b3c31=mutationResult({..._0x3afbec,'after':_0x82a97d[_0x331f85(0xbd)]===undefined?_0x3afbec[_0x331f85(0xbd)]:_0x82a97d[_0x331f85(0xbd)],'backend':_0x82a97d['backend']??_0x3afbec[_0x331f85(0xe5)],'dryRun':![],'succeeded':_0x82a97d[_0x331f85(0xe2)]??[],'failed':_0x82a97d['failedRecords']??[{..._0x82a97d[_0x331f85(0x108)]??{},'stage':_0x82a97d['stage'],'code':_0x1975a0[_0x331f85(0xfa)],'message':_0x1975a0[_0x331f85(0x109)]}],'warnings':[..._0x3afbec[_0x331f85(0xf3)],..._0x82a97d[_0x331f85(0xf3)]??[]],'verification':_0x82a97d[_0x331f85(0xe0)],'error':{'code':_0x1975a0[_0x331f85(0xfa)],'message':_0x1975a0['message'],..._0x1975a0[_0x331f85(0xc7)]?{'hint':_0x1975a0[_0x331f85(0xc7)]}:{}}});return Object['defineProperty'](_0x1975a0,_0x331f85(0x10d),{'value':_0x2b3c31,'enumerable':!![],'configurable':!![]}),_0x1975a0;}export function asVerificationError(_0x53b4ac,_0x20d8a9){const _0x62654e=a180_0x941e73;if(_0x53b4ac instanceof CliError&&_0x53b4ac[_0x62654e(0xfa)]===_0x62654e(0xc2))return _0x53b4ac;const _0x1142e1=_0x53b4ac instanceof Error?_0x53b4ac[_0x62654e(0x109)]:String(_0x53b4ac);return menuError(_0x62654e(0xc2),''+_0x20d8a9+(_0x1142e1?':\x20'+_0x1142e1:''),_0x62654e(0x10a));}export function describeMenuErrorCause(_0x15d62d,_0x452a08,_0x3c5a8b){const _0x2c0969=a180_0x941e73,_0xb104aa=mapMenuApiError(_0x15d62d,_0x452a08,_0x3c5a8b);return{'causeCode':_0xb104aa[_0x2c0969(0xfa)],'causeMessage':_0xb104aa[_0x2c0969(0x109)]};}export function hasFlag(_0x4e0330,_0x47bd82){const _0x55e8ae=a180_0x941e73;return Object[_0x55e8ae(0x10e)][_0x55e8ae(0xfb)]['call'](_0x4e0330['rawFlags'],_0x47bd82)&&_0x4e0330[_0x55e8ae(0xc4)][_0x47bd82]!==undefined;}export function toApiParentId(_0x306f7c){return _0x306f7c??0x0;}export function formatParent(_0x252102){const _0x35a700=a180_0x941e73;return _0x252102==null?_0x35a700(0xae):String(_0x252102);}export function menuError(_0x207113,_0x364353,_0x1091c2){return new CliError(_0x207113,0x1,_0x364353,_0x1091c2);}function a180_0xc719(_0x4e6c66,_0x21a812){_0x4e6c66=_0x4e6c66-0xab;const _0x3e60a5=a180_0x3e60();let _0xc71925=_0x3e60a5[_0x4e6c66];return _0xc71925;}export function mapMenuApiError(_0x273768,_0x38a3e8,_0x3e8c28){const _0x4005e2=a180_0x941e73;if(_0x273768 instanceof CliError&&_0x273768['code']!==_0x4005e2(0xca))return _0x273768;const _0x2ed1b4=_0x273768 instanceof Error?_0x273768[_0x4005e2(0x109)]:String(_0x273768);if(/HTTP 403|forbidden|permission|无权限|权限不足|没有权限/i[_0x4005e2(0xb3)](_0x2ed1b4))return menuError(_0x4005e2(0xf0),_0x4005e2(0xc9)+_0x38a3e8+(_0x3e8c28?'\x20menu\x20'+_0x3e8c28:'')+'.','Confirm\x20that\x20the\x20current\x20account\x20can\x20manage\x20menus\x20for\x20this\x20app.');return menuError(_0x4005e2(0x113),_0x4005e2(0x110)+_0x38a3e8+(_0x3e8c28?'\x20menu\x20'+_0x3e8c28:'')+':\x20'+_0x2ed1b4,_0x4005e2(0xf1));}export function isMenuResponseLoss(_0x1ae4ec){const _0x903880=a180_0x941e73,_0x70e489=_0x1ae4ec instanceof Error?_0x1ae4ec[_0x903880(0x109)]:String(_0x1ae4ec);if(_0x1ae4ec instanceof CliError)return _0x1ae4ec[_0x903880(0xfa)]==='api_error'&&/^Request (?:failed|timeout):/i[_0x903880(0xb3)](_0x70e489);return/timeout|timed out|ECONNRESET|socket hang up|network|fetch failed|connection closed|aborted|terminated|unexpected end of JSON|premature close|body stream/i['test'](_0x70e489);}function stateDrift(_0x5a36f1){const _0x241a4a=a180_0x941e73;return menuError(_0x241a4a(0xb7),_0x5a36f1,_0x241a4a(0xe7));}
1
+ const a180_0x662cc1=a180_0x6eb1;(function(_0x5ba2c2,_0x3e71f7){const _0xa28651=a180_0x6eb1,_0x4bbb3f=_0x5ba2c2();while(!![]){try{const _0x485129=-parseInt(_0xa28651(0x14d))/0x1*(parseInt(_0xa28651(0x116))/0x2)+parseInt(_0xa28651(0x143))/0x3+parseInt(_0xa28651(0x10f))/0x4+parseInt(_0xa28651(0x16e))/0x5+parseInt(_0xa28651(0x15c))/0x6+-parseInt(_0xa28651(0x14a))/0x7*(parseInt(_0xa28651(0x13e))/0x8)+-parseInt(_0xa28651(0x15a))/0x9*(parseInt(_0xa28651(0x11a))/0xa);if(_0x485129===_0x3e71f7)break;else _0x4bbb3f['push'](_0x4bbb3f['shift']());}catch(_0xa8a955){_0x4bbb3f['push'](_0x4bbb3f['shift']());}}}(a180_0x3f39,0xc9786));import{CliError,CliErrors}from'../../../errors.js';import{fetchMenuSnapshot,getChildren}from'../../../commands/menu/shared/facts.js';export const MAX_MENU_SORT=0x7fffffff;export const MENU_ID_FLAG={'name':'id','type':a180_0x662cc1(0x135),'required':!![],'description':'Exact\x20online\x20menu\x20id'};export const MENU_SORT_FLAG={'name':a180_0x662cc1(0x10a),'type':a180_0x662cc1(0x135),'description':a180_0x662cc1(0x141)};export const MENU_PARENT_ID_FLAG={'name':'parent-id','type':a180_0x662cc1(0x10c),'description':a180_0x662cc1(0x101)};export const MENU_EXPECT_PARENT_ID_FLAG={'name':'expect-parent-id','type':a180_0x662cc1(0x10c),'description':a180_0x662cc1(0x109)};export const MENU_EXPECT_FLAGS=[MENU_EXPECT_PARENT_ID_FLAG,{'name':a180_0x662cc1(0x16d),'type':'string','description':a180_0x662cc1(0x125)},{'name':'expected-children-count','type':'number','description':a180_0x662cc1(0x107)}];export function validateExactId(_0x44fca1){const _0x164169=a180_0x662cc1,_0x44bda2=_0x44fca1[_0x164169(0x13c)]('id');if(!Number[_0x164169(0x137)](_0x44bda2)||_0x44bda2<=0x0)throw CliErrors[_0x164169(0x156)](_0x164169(0x12e));return _0x44bda2;}export function validateSort(_0x5cb5f7,_0x24cdb5='sort'){const _0x16fdba=a180_0x662cc1;if(!hasFlag(_0x5cb5f7,_0x24cdb5))return undefined;const _0xfe7399=_0x5cb5f7[_0x16fdba(0x13c)](_0x24cdb5);if(!Number[_0x16fdba(0x137)](_0xfe7399)||_0xfe7399<0x0||_0xfe7399>MAX_MENU_SORT)throw menuError(_0x16fdba(0x10b),'--'+_0x24cdb5+'\x20must\x20be\x20an\x20integer\x20between\x200\x20and\x20'+MAX_MENU_SORT+'.',_0x16fdba(0x12a));return _0xfe7399;}export function nextSiblingSort(_0xdacef7,_0x35a011,_0x22020a){const _0x447816=a180_0x662cc1,_0x48291d=getChildren(_0xdacef7,_0x35a011)[_0x447816(0x14e)](_0x4ad04a=>_0x4ad04a[_0x447816(0x10a)])['filter'](_0x3e24b5=>typeof _0x3e24b5===_0x447816(0x135));if(_0x48291d[_0x447816(0x11f)]===0x0)return 0x0;const _0x24ee0e=Math[_0x447816(0x113)](..._0x48291d);if(_0x24ee0e>=MAX_MENU_SORT)throw menuError(_0x447816(0x151),'Cannot\x20append\x20a\x20'+_0x22020a+'\x20because\x20the\x20current\x20maximum\x20sibling\x20sort\x20is\x20'+_0x24ee0e+'.',_0x447816(0x139)+MAX_MENU_SORT+_0x447816(0x118));return _0x24ee0e+0x1;}export function requireExplicitYes(_0x5d45f2){const _0x1748aa=a180_0x662cc1;if(_0x5d45f2[_0x1748aa(0x14f)]('dry-run'))return;if(!_0x5d45f2['bool'](_0x1748aa(0x12c)))throw menuError(_0x1748aa(0x13b),_0x1748aa(0x11b),_0x1748aa(0x161));}export async function fetchMutationSnapshot(_0x4ccd5b,_0x3e8522,_0x11bf26){const _0x5945ac=a180_0x662cc1;try{return await fetchMenuSnapshot(_0x4ccd5b[_0x5945ac(0x110)],_0x4ccd5b[_0x5945ac(0x16c)]);}catch(_0x5ee511){throw mapMenuApiError(_0x5ee511,_0x5945ac(0x138)+_0x3e8522,_0x11bf26);}}export async function recheckMutationSnapshot(_0x1495b7,_0x58bfa8,_0x27fa8a,_0x5be680){const _0x4d6719=a180_0x662cc1;let _0xbf5daf;try{_0xbf5daf=await fetchMenuSnapshot(_0x1495b7['appCode'],_0x1495b7[_0x4d6719(0x16c)]);}catch(_0xb10cf8){const _0x5e9344=mapMenuApiError(_0xb10cf8,_0x4d6719(0x106)+_0x27fa8a,_0x5be680);throw menuFailure(_0x5e9344,_0x58bfa8,{'stage':'pre-write-recheck','failed':_0x5be680==null?{}:{'id':_0x5be680}});}if(_0xbf5daf[_0x4d6719(0x146)]!==_0x58bfa8['snapshotHash']){const _0x34c0a0=menuError(_0x4d6719(0x11c),_0x4d6719(0x157)+_0x27fa8a+_0x4d6719(0x12d),_0x4d6719(0x142));throw menuFailure(_0x34c0a0,_0x58bfa8,{'stage':_0x4d6719(0x165),'failed':{..._0x5be680==null?{}:{'id':_0x5be680},'expectedSnapshotHash':_0x58bfa8[_0x4d6719(0x122)],'currentSnapshotHash':_0xbf5daf[_0x4d6719(0x146)]}});}return _0xbf5daf;}export function parseParentId(_0x4934b4,_0x343da1,_0x2f8725={}){const _0x4fe862=a180_0x662cc1;if(!hasFlag(_0x4934b4,_0x343da1)){if(_0x2f8725[_0x4fe862(0x111)])throw CliErrors[_0x4fe862(0x105)](_0x343da1);return undefined;}const _0x73b60b=_0x4934b4['str'](_0x343da1)[_0x4fe862(0x162)]();if(_0x73b60b[_0x4fe862(0x16b)]()===_0x4fe862(0x115))return null;if(!/^\d+$/[_0x4fe862(0x152)](_0x73b60b))throw CliErrors[_0x4fe862(0x156)]('--'+_0x343da1+_0x4fe862(0x136));const _0x257502=Number(_0x73b60b);if(!Number[_0x4fe862(0x137)](_0x257502)||_0x257502<=0x0)throw CliErrors[_0x4fe862(0x156)]('--'+_0x343da1+_0x4fe862(0x136));return _0x257502;}export function requireMenu(_0x16ba47,_0x8a5eb6){const _0x435701=a180_0x662cc1,_0x1d8c72=_0x16ba47[_0x435701(0x140)][_0x435701(0x153)](_0x8a5eb6);if(!_0x1d8c72)throw menuError(_0x435701(0x160),'Online\x20menu\x20not\x20found:\x20'+_0x8a5eb6,_0x435701(0x102));return _0x1d8c72;}export function requireFolder(_0x4f4e16,_0x2ea03a){const _0x3e311d=a180_0x662cc1,_0x151ac8=requireMenu(_0x4f4e16,_0x2ea03a);if(_0x151ac8[_0x3e311d(0x11e)]!==_0x3e311d(0x114))throw menuError(_0x3e311d(0x15b),_0x3e311d(0x169)+_0x2ea03a+'\x20is\x20type\x20\x22'+(_0x151ac8[_0x3e311d(0x11e)]||_0x3e311d(0x124))+_0x3e311d(0x120),'Choose\x20a\x20menu\x20whose\x20type\x20is\x20folder,\x20or\x20use\x20root.');return _0x151ac8;}export function assertExpectedState(_0x31e7c7,_0x1041a5){const _0x3edb95=a180_0x662cc1;if(hasFlag(_0x31e7c7,_0x3edb95(0x163))){const _0x213aee=parseParentId(_0x31e7c7,_0x3edb95(0x163),{'required':!![]});if(_0x1041a5[_0x3edb95(0x119)]!==_0x213aee)throw stateDrift(_0x3edb95(0x169)+_0x1041a5['id']+_0x3edb95(0x164)+formatParent(_0x213aee)+_0x3edb95(0x132)+formatParent(_0x1041a5['parentId'])+'.');}if(hasFlag(_0x31e7c7,_0x3edb95(0x16d))){const _0x545c3a=_0x31e7c7[_0x3edb95(0x13d)](_0x3edb95(0x16d));if(_0x1041a5[_0x3edb95(0x158)]!==_0x545c3a)throw stateDrift('Menu\x20'+_0x1041a5['id']+'\x20path\x20changed:\x20expected\x20'+JSON[_0x3edb95(0x133)](_0x545c3a)+',\x20current\x20'+JSON[_0x3edb95(0x133)](_0x1041a5[_0x3edb95(0x158)])+'.');}if(hasFlag(_0x31e7c7,_0x3edb95(0x14b))){const _0x5e1649=_0x31e7c7[_0x3edb95(0x13c)](_0x3edb95(0x14b));if(!Number[_0x3edb95(0x137)](_0x5e1649)||_0x5e1649<0x0)throw CliErrors[_0x3edb95(0x156)](_0x3edb95(0x13f));if(_0x1041a5['childrenCount']!==_0x5e1649)throw stateDrift(_0x3edb95(0x169)+_0x1041a5['id']+_0x3edb95(0x12f)+_0x5e1649+_0x3edb95(0x132)+_0x1041a5[_0x3edb95(0x121)]+'.');}}export function assertVerified(_0x1ea122,_0x2d8671,_0x5c7468=a180_0x662cc1(0x150)){const _0x449914=a180_0x662cc1;if(!_0x1ea122)throw menuError(_0x449914(0x112),_0x2d8671,_0x5c7468);}export function mutationResult(_0x56bff6){const _0x4bc6=a180_0x662cc1;return{'operation':_0x56bff6[_0x4bc6(0x11d)],'selector':_0x56bff6[_0x4bc6(0x15d)],'before':_0x56bff6[_0x4bc6(0x129)],'after':_0x56bff6[_0x4bc6(0x16a)],'dryRun':_0x56bff6[_0x4bc6(0x15e)],'backend':_0x56bff6[_0x4bc6(0x104)],..._0x56bff6['plannedActions']?{'plannedActions':_0x56bff6[_0x4bc6(0x14c)]}:{},..._0x56bff6[_0x4bc6(0x131)]?{'targets':_0x56bff6[_0x4bc6(0x131)]}:{},..._0x56bff6['deleteOrder']?{'deleteOrder':_0x56bff6['deleteOrder']}:{},'snapshotHash':_0x56bff6['snapshotHash'],..._0x56bff6[_0x4bc6(0x130)]?{'cascade':_0x56bff6[_0x4bc6(0x130)]}:{},..._0x56bff6[_0x4bc6(0x149)]?{'planFile':_0x56bff6[_0x4bc6(0x149)]}:{},'succeeded':_0x56bff6[_0x4bc6(0x148)]??[],'failed':_0x56bff6[_0x4bc6(0x12b)]??[],'warnings':_0x56bff6[_0x4bc6(0x123)]??[],'verification':_0x56bff6['verification'],'error':_0x56bff6[_0x4bc6(0x144)]};}export function menuDryRunResult(_0x2f5594,_0x19f9cb){return{..._0x2f5594,..._0x19f9cb};}export function menuFailure(_0x419992,_0x3dd912,_0x30d8bb){const _0x1cdfa8=a180_0x662cc1,_0x4537e3=mutationResult({..._0x3dd912,'after':_0x30d8bb[_0x1cdfa8(0x16a)]===undefined?_0x3dd912['after']:_0x30d8bb['after'],'backend':_0x30d8bb[_0x1cdfa8(0x104)]??_0x3dd912[_0x1cdfa8(0x104)],'dryRun':![],'succeeded':_0x30d8bb[_0x1cdfa8(0x148)]??[],'failed':_0x30d8bb['failedRecords']??[{..._0x30d8bb[_0x1cdfa8(0x12b)]??{},'stage':_0x30d8bb[_0x1cdfa8(0x108)],'code':_0x419992['code'],'message':_0x419992[_0x1cdfa8(0x10e)]}],'warnings':[..._0x3dd912['warnings'],..._0x30d8bb[_0x1cdfa8(0x123)]??[]],'verification':_0x30d8bb[_0x1cdfa8(0x126)],'error':{'code':_0x419992[_0x1cdfa8(0x154)],'message':_0x419992[_0x1cdfa8(0x10e)],..._0x419992[_0x1cdfa8(0x117)]?{'hint':_0x419992[_0x1cdfa8(0x117)]}:{}}});return Object[_0x1cdfa8(0x103)](_0x419992,'data',{'value':_0x4537e3,'enumerable':!![],'configurable':!![]}),_0x419992;}function a180_0x6eb1(_0xda8baa,_0x5cb584){_0xda8baa=_0xda8baa-0x101;const _0x3f3991=a180_0x3f39();let _0x6eb1d0=_0x3f3991[_0xda8baa];return _0x6eb1d0;}export function asVerificationError(_0x246eeb,_0x12711f){const _0x1a568b=a180_0x662cc1;if(_0x246eeb instanceof CliError&&_0x246eeb[_0x1a568b(0x154)]==='menu_verification_failed')return _0x246eeb;const _0x11a3b4=_0x246eeb instanceof Error?_0x246eeb[_0x1a568b(0x10e)]:String(_0x246eeb);return menuError(_0x1a568b(0x112),''+_0x12711f+(_0x11a3b4?':\x20'+_0x11a3b4:''),_0x1a568b(0x127));}export function describeMenuErrorCause(_0x169e4c,_0x54edb0,_0x315536){const _0x1f6d39=a180_0x662cc1,_0x40dc7a=mapMenuApiError(_0x169e4c,_0x54edb0,_0x315536);return{'causeCode':_0x40dc7a[_0x1f6d39(0x154)],'causeMessage':_0x40dc7a['message']};}function a180_0x3f39(){const _0x4d4fe4=['This\x20menu\x20mutation\x20requires\x20explicit\x20--yes.','menu_state_drift','operation','type','length','\x22,\x20not\x20folder.','childrenCount','snapshotHash','warnings','unknown','Abort\x20unless\x20the\x20current\x20menu\x20path\x20exactly\x20matches','verification','The\x20write\x20may\x20already\x20have\x20taken\x20effect.\x20Run\x20`rabetbase\x20menu\x20list\x20--format\x20json`\x20and\x20inspect\x20the\x20returned\x20id\x20before\x20retrying.','Failed\x20to\x20','before','Choose\x20a\x20sort\x20value\x20within\x20the\x20Java\x20Integer\x20range\x20used\x20by\x20the\x20menu\x20service.','failed','yes',';\x20the\x20planned\x20snapshot\x20is\x20no\x20longer\x20current.','--id\x20must\x20be\x20a\x20positive\x20integer\x20menu\x20id.','\x20child\x20count\x20changed:\x20expected\x20','cascade','targets',',\x20current\x20','stringify','Re-run\x20the\x20command\x20with\x20--dry-run\x20and\x20update\x20the\x20expect\x20flags\x20before\x20retrying.','number','\x20must\x20be\x20a\x20positive\x20menu\x20id\x20or\x20root.','isSafeInteger','read\x20online\x20menu\x20facts\x20before\x20','Reorder\x20sibling\x20menus\x20below\x20','Permission\x20denied\x20while\x20attempting\x20to\x20','menu_confirmation_required','num','str','88XsvGYE','--expected-children-count\x20must\x20be\x20a\x20non-negative\x20integer.','byId','Sibling\x20sort\x20value\x20(non-negative\x20integer)','Run\x20the\x20same\x20command\x20with\x20--dry-run\x20again\x20and\x20review\x20the\x20latest\x20snapshot\x20before\x20retrying.','3403812fnGocG','error','rawFlags','hash','menu_permission_denied','succeeded','planFile','118643MrKffQ','expected-children-count','plannedActions','174085ZYzZDg','map','bool','Run\x20`rabetbase\x20menu\x20list\x20--format\x20json`\x20to\x20inspect\x20the\x20latest\x20online\x20menu\x20state.','menu_sort_overflow','test','get','code','menu_mutation_failed','validation','Online\x20menu\x20state\x20changed\x20before\x20','path','api_error','27ouPHbp','menu_parent_not_folder','8604696umEdXg','selector','dryRun','Re-run\x20menu\x20list\x20to\x20inspect\x20the\x20latest\x20online\x20state\x20before\x20retrying.','menu_not_found','Run\x20the\x20same\x20command\x20with\x20--dry-run\x20first,\x20then\x20add\x20--yes\x20after\x20reviewing\x20the\x20plan.','trim','expect-parent-id','\x20parent\x20changed:\x20expected\x20','pre-write-recheck','call','prototype','hasOwnProperty','Menu\x20','after','toLowerCase','cookie','expect-path','2283315aEGcfd','Parent\x20folder\x20id;\x20use\x20root\x20for\x20a\x20root-level\x20node','Run\x20`rabetbase\x20menu\x20list\x20--format\x20json`\x20and\x20use\x20an\x20exact\x20id\x20from\x20the\x20current\x20app.','defineProperty','backend','flagMissing','recheck\x20online\x20menu\x20facts\x20before\x20','Abort\x20unless\x20the\x20current\x20direct\x20child\x20count\x20matches','stage','Abort\x20unless\x20the\x20current\x20parent\x20id\x20matches;\x20use\x20root\x20for\x20root\x20level','sort','menu_sort_invalid','string','\x20menu\x20','message','3608796WXIQVf','appCode','required','menu_verification_failed','max','folder','root','4RYjOUg','hint',',\x20or\x20pass\x20an\x20explicit\x20--sort\x20value.','parentId','8559170VYJUNZ'];a180_0x3f39=function(){return _0x4d4fe4;};return a180_0x3f39();}export function hasFlag(_0x1f1ce2,_0x3a24df){const _0x16ab51=a180_0x662cc1;return Object[_0x16ab51(0x167)][_0x16ab51(0x168)][_0x16ab51(0x166)](_0x1f1ce2[_0x16ab51(0x145)],_0x3a24df)&&_0x1f1ce2[_0x16ab51(0x145)][_0x3a24df]!==undefined;}export function toApiParentId(_0x12bd84){return _0x12bd84??0x0;}export function formatParent(_0x1e0823){const _0x41fde5=a180_0x662cc1;return _0x1e0823==null?_0x41fde5(0x115):String(_0x1e0823);}export function menuError(_0x24c61f,_0x302d4b,_0x48b983){return new CliError(_0x24c61f,0x1,_0x302d4b,_0x48b983);}export function mapMenuApiError(_0x823767,_0x296187,_0x15eea4){const _0x8474f4=a180_0x662cc1;if(_0x823767 instanceof CliError&&_0x823767[_0x8474f4(0x154)]!==_0x8474f4(0x159))return _0x823767;const _0x572e51=_0x823767 instanceof Error?_0x823767[_0x8474f4(0x10e)]:String(_0x823767);if(/HTTP 403|forbidden|permission|无权限|权限不足|没有权限/i[_0x8474f4(0x152)](_0x572e51))return menuError(_0x8474f4(0x147),_0x8474f4(0x13a)+_0x296187+(_0x15eea4?_0x8474f4(0x10d)+_0x15eea4:'')+'.','Confirm\x20that\x20the\x20current\x20account\x20can\x20manage\x20menus\x20for\x20this\x20app.');return menuError(_0x8474f4(0x155),_0x8474f4(0x128)+_0x296187+(_0x15eea4?_0x8474f4(0x10d)+_0x15eea4:'')+':\x20'+_0x572e51,_0x8474f4(0x15f));}export function isMenuResponseLoss(_0x2bb509){const _0x5db754=a180_0x662cc1,_0xcad210=_0x2bb509 instanceof Error?_0x2bb509[_0x5db754(0x10e)]:String(_0x2bb509);if(_0x2bb509 instanceof CliError)return _0x2bb509[_0x5db754(0x154)]==='api_error'&&/^Request (?:failed|timeout):/i[_0x5db754(0x152)](_0xcad210);return/timeout|timed out|ECONNRESET|socket hang up|network|fetch failed|connection closed|aborted|terminated|unexpected end of JSON|premature close|body stream/i[_0x5db754(0x152)](_0xcad210);}function stateDrift(_0x19d426){const _0x20910d=a180_0x662cc1;return menuError(_0x20910d(0x11c),_0x19d426,_0x20910d(0x134));}
@@ -1 +1 @@
1
- function a181_0xd3a1(_0x1866c5,_0x53751d){_0x1866c5=_0x1866c5-0x108;const _0x1dce1d=a181_0x1dce();let _0xd3a182=_0x1dce1d[_0x1866c5];return _0xd3a182;}function a181_0x1dce(){const _0x3d405c=['2141170MXOknA','5250707ZWDBOG','replace','1084GiscZv','156042fXtHRQ','1602054SiYrNh','6tOZWiB','26618iwwLAR','8mxQFBB','2892euaXGJ','65GwLcWM','13233jaSouA','12215ZsOSTb','trim'];a181_0x1dce=function(){return _0x3d405c;};return a181_0x1dce();}(function(_0x3c69e9,_0x4b2ef2){const _0x39dbaf=a181_0xd3a1,_0x6d2b9=_0x3c69e9();while(!![]){try{const _0x5b428c=-parseInt(_0x39dbaf(0x10b))/0x1*(-parseInt(_0x39dbaf(0x108))/0x2)+parseInt(_0x39dbaf(0x114))/0x3+-parseInt(_0x39dbaf(0x112))/0x4*(-parseInt(_0x39dbaf(0x10d))/0x5)+-parseInt(_0x39dbaf(0x115))/0x6*(parseInt(_0x39dbaf(0x110))/0x7)+-parseInt(_0x39dbaf(0x109))/0x8*(parseInt(_0x39dbaf(0x113))/0x9)+-parseInt(_0x39dbaf(0x10f))/0xa+-parseInt(_0x39dbaf(0x10c))/0xb*(parseInt(_0x39dbaf(0x10a))/0xc);if(_0x5b428c===_0x4b2ef2)break;else _0x6d2b9['push'](_0x6d2b9['shift']());}catch(_0x3cc46e){_0x6d2b9['push'](_0x6d2b9['shift']());}}}(a181_0x1dce,0xc0cad));export function menuPathKey(_0x18b8de){const _0x1608ff=a181_0xd3a1,_0x411e36=_0x18b8de[_0x1608ff(0x10e)]();if(!_0x411e36)return'';return _0x411e36['replace'](/^\/+/,'')[_0x1608ff(0x111)](/\/+$/,'')||'/';}
1
+ function a181_0x1344(){const _0x1986f1=['3087984yHdLLn','677430dHyPSm','38JiNjNq','78IZARET','32oEXnuo','192808IXTNcS','84282iaqoGd','replace','49624alvxgH','909NXGvHN','6CJmcQT','290vmblNX','176740FAWtsC','1940078jUfbPv'];a181_0x1344=function(){return _0x1986f1;};return a181_0x1344();}function a181_0x599d(_0x48253e,_0x3bc1b2){_0x48253e=_0x48253e-0x116;const _0x13449a=a181_0x1344();let _0x599d1a=_0x13449a[_0x48253e];return _0x599d1a;}(function(_0x304a97,_0x4ce132){const _0x520fcb=a181_0x599d,_0x52b842=_0x304a97();while(!![]){try{const _0x490701=-parseInt(_0x520fcb(0x11d))/0x1+parseInt(_0x520fcb(0x11e))/0x2*(-parseInt(_0x520fcb(0x122))/0x3)+-parseInt(_0x520fcb(0x120))/0x4*(-parseInt(_0x520fcb(0x11a))/0x5)+-parseInt(_0x520fcb(0x118))/0x6*(parseInt(_0x520fcb(0x11b))/0x7)+parseInt(_0x520fcb(0x116))/0x8*(parseInt(_0x520fcb(0x117))/0x9)+-parseInt(_0x520fcb(0x119))/0xa*(parseInt(_0x520fcb(0x121))/0xb)+-parseInt(_0x520fcb(0x11c))/0xc*(-parseInt(_0x520fcb(0x11f))/0xd);if(_0x490701===_0x4ce132)break;else _0x52b842['push'](_0x52b842['shift']());}catch(_0x13515c){_0x52b842['push'](_0x52b842['shift']());}}}(a181_0x1344,0x6f795));export function menuPathKey(_0x337d5f){const _0x3de6ad=a181_0x599d,_0x57df9d=_0x337d5f['trim']();if(!_0x57df9d)return'';return _0x57df9d['replace'](/^\/+/,'')[_0x3de6ad(0x123)](/\/+$/,'')||'/';}
@@ -1 +1 @@
1
- (function(_0x1c3f03,_0x1e75fa){const _0x413540=a182_0x4b6c,_0x5953b9=_0x1c3f03();while(!![]){try{const _0x4b7012=parseInt(_0x413540(0x1a8))/0x1+-parseInt(_0x413540(0x1a9))/0x2*(parseInt(_0x413540(0x183))/0x3)+parseInt(_0x413540(0x19d))/0x4+parseInt(_0x413540(0x18f))/0x5*(parseInt(_0x413540(0x194))/0x6)+-parseInt(_0x413540(0x198))/0x7*(parseInt(_0x413540(0x18d))/0x8)+parseInt(_0x413540(0x189))/0x9*(parseInt(_0x413540(0x1ad))/0xa)+parseInt(_0x413540(0x1ab))/0xb*(-parseInt(_0x413540(0x1ac))/0xc);if(_0x4b7012===_0x1e75fa)break;else _0x5953b9['push'](_0x5953b9['shift']());}catch(_0x1942e4){_0x5953b9['push'](_0x5953b9['shift']());}}}(a182_0x4466,0x2696f));import{getEnv,isProduction}from'../../../constant/env.js';import{logger}from'../../../utils/logger.js';import{fetchMenuSnapshot,toProcessedMenuItem}from'../../../commands/menu/shared/facts.js';import{batchDeleteMenuRecords,createMenuRecord,startMenuRegroup as a182_0x214450,updateMenuRecord}from'../../../core/api-client.js';export async function getOnlineMenuList(_0x3d0617,_0x4e66d8){const _0x1e7fe5=a182_0x4b6c,_0x204339=getEnv();logger['info']('get-online-menu-list',isProduction(_0x204339)?_0x1e7fe5(0x192)+_0x3d0617+')':_0x1e7fe5(0x18b)+_0x3d0617+')');const _0x3ec37a=await fetchMenuSnapshot(_0x3d0617,_0x4e66d8,{'verbose':!![]});return logger[_0x1e7fe5(0x19b)]('get-online-menu-list',_0x1e7fe5(0x19f)+_0x3ec37a[_0x1e7fe5(0x1a4)]+'\x20online\x20menus\x20successfully'),_0x3ec37a['menus'][_0x1e7fe5(0x182)](toProcessedMenuItem);}export async function createMenu(_0x1b31a8,_0x5e5581,_0x3096c0){const _0x164456=a182_0x4b6c;logger[_0x164456(0x19b)](_0x164456(0x1a0),_0x164456(0x19c)+_0x3096c0[_0x164456(0x18c)]+'\x20('+_0x3096c0[_0x164456(0x19a)]+')');const _0x3c20e6={'appCode':_0x1b31a8,'type':_0x164456(0x1ae),'sort':0x0,'extend':{'loadScriptMode':'import','resources':_0x3096c0[_0x164456(0x185)]?JSON['stringify'](_0x3096c0[_0x164456(0x185)]):undefined},..._0x3096c0},_0x194e1f=await createMenuRecord(_0x3c20e6,_0x5e5581,_0x164456(0x186)+_0x3096c0[_0x164456(0x18c)]+'\x22');return logger[_0x164456(0x19b)](_0x164456(0x1a0),_0x164456(0x191)+_0x3096c0[_0x164456(0x18c)]),_0x194e1f;}async function createSingleMenu(_0x1a46e0,_0x39a682,_0x4cbb89,_0x554bb3,_0x14f91e){const _0x4abced=a182_0x4b6c,_0x24240f={'appCode':_0x1a46e0,'type':_0x4abced(0x1ae),'sort':_0x4abced(0x18a)in _0x4cbb89&&typeof _0x4cbb89[_0x4abced(0x18a)]===_0x4abced(0x1aa)?_0x4cbb89['order']:0x0,..._0x4abced(0x190)in _0x4cbb89&&typeof _0x4cbb89['visible']===_0x4abced(0x184)?{'visible':_0x4cbb89[_0x4abced(0x190)]}:{},..._0x4abced(0x196)in _0x4cbb89&&typeof _0x4cbb89[_0x4abced(0x196)]===_0x4abced(0x1aa)?{'parentId':_0x4cbb89[_0x4abced(0x196)]}:{},'extend':{..._0x14f91e?.[_0x4abced(0x1a7)]?{'appName':_0x14f91e[_0x4abced(0x1a7)]}:{},'loadScriptMode':'import','resources':_0x554bb3?JSON[_0x4abced(0x1a1)](_0x554bb3):undefined},'label':_0x4cbb89[_0x4abced(0x18c)],'path':_0x4cbb89[_0x4abced(0x19a)]},_0x2c5618=await createMenuRecord(_0x24240f,_0x39a682,_0x4abced(0x186)+_0x4cbb89[_0x4abced(0x18c)]+'\x22');return logger[_0x4abced(0x19b)]('create-menu',_0x4abced(0x191)+_0x4cbb89[_0x4abced(0x18c)]),_0x2c5618;}function a182_0x4b6c(_0x384d42,_0x2ed070){_0x384d42=_0x384d42-0x181;const _0x4466ce=a182_0x4466();let _0x4b6cb0=_0x4466ce[_0x384d42];return _0x4b6cb0;}function a182_0x4466(){const _0x458cf7=['Creating\x20menu:\x20','412244rHEjbh','Regroup\x20','Fetched\x20','create-menu','stringify','menuGroups','Start\x20batch\x20menu\x20creation,\x20total\x20','total','Update\x20menu\x20','loadScriptMode','appName','200585olQjtM','171398mUXZdJ','number','11TjmFNz','3094536OfcQLs','10KUHcZr','procode','Menu\x20assets\x20synced:\x20','map','3BpySoU','boolean','resources','Create\x20menu\x20\x22','create-menus','Delete\x20','680337USPzTB','order','Fetching\x20daily\x20menu\x20list...\x20(appCode:\x20','label','8XmDUCc','\x20menu\x20group(s)','201010CdYHNm','visible','Menu\x20created\x20successfully:\x20','Fetching\x20online\x20menu\x20list...\x20(appCode:\x20','Update\x20menu\x20assets\x20\x22','42nbjXdH','update-menu-cdn-url','parentId','\x20menu','1113091nSVCQT','length','path','info'];a182_0x4466=function(){return _0x458cf7;};return a182_0x4466();}export async function createMenus(_0x3f2b80,_0x4c272f,_0x2eaabf,_0x835f25,_0x2c7318){const _0x2a305a=a182_0x4b6c;logger[_0x2a305a(0x19b)](_0x2a305a(0x187),_0x2a305a(0x1a3)+_0x2eaabf[_0x2a305a(0x199)]);const _0x3e8753=await Promise['all'](_0x2eaabf[_0x2a305a(0x182)](_0x3ce9e5=>createSingleMenu(_0x3f2b80,_0x4c272f,_0x3ce9e5,_0x835f25,_0x2c7318)));return logger[_0x2a305a(0x19b)]('create-menus','Batch\x20menu\x20creation\x20completed,\x20total\x20'+_0x2eaabf[_0x2a305a(0x199)]),_0x3e8753;}export async function updateMenuCdnUrl(_0x3ecf87,_0x55d432,_0x5595d1){const _0x235050=a182_0x4b6c;logger[_0x235050(0x19b)](_0x235050(0x195),'Updating\x20menu\x20asset\x20links:\x20'+_0x5595d1['label']+'\x20('+_0x5595d1[_0x235050(0x19a)]+')');const _0x8d4127={'id':_0x5595d1['id'],'appCode':_0x3ecf87,'extend':{..._0x5595d1['extend']??{},..._0x5595d1[_0x235050(0x1a6)]?{'loadScriptMode':_0x5595d1[_0x235050(0x1a6)]}:{},'resources':_0x5595d1[_0x235050(0x185)]?JSON[_0x235050(0x1a1)](_0x5595d1[_0x235050(0x185)]):undefined}},_0x8fac54=await updateMenuRecord(_0x8d4127,_0x55d432,_0x235050(0x193)+_0x5595d1[_0x235050(0x18c)]+'\x22');return logger[_0x235050(0x19b)](_0x235050(0x195),_0x235050(0x181)+_0x5595d1[_0x235050(0x18c)],undefined),_0x8fac54;}export async function createMenuEntity(_0x1ada54,_0x141a29,_0x215073){const _0x32726b=a182_0x4b6c;return createMenuRecord({'appCode':_0x1ada54,..._0x215073},_0x141a29,_0x32726b(0x186)+_0x215073[_0x32726b(0x18c)]+'\x22');}export async function updateMenuEntity(_0x30f6a0,_0x1dc678,_0x32486f){const _0x52bf89=a182_0x4b6c;return updateMenuRecord({'appCode':_0x30f6a0,..._0x32486f},_0x1dc678,_0x52bf89(0x1a5)+_0x32486f['id']);}export async function batchDeleteMenuEntities(_0x273dc7,_0x613a9f){const _0x846aaf=a182_0x4b6c;return batchDeleteMenuRecords(_0x613a9f,_0x273dc7,_0x846aaf(0x188)+_0x613a9f[_0x846aaf(0x199)]+_0x846aaf(0x197)+(_0x613a9f[_0x846aaf(0x199)]===0x1?'':'s'));}export async function startMenuRegroup(_0x5b663c,_0xdff7e2){const _0x4a22ca=a182_0x4b6c;return a182_0x214450(_0xdff7e2,_0x5b663c,_0x4a22ca(0x19e)+_0xdff7e2[_0x4a22ca(0x1a2)][_0x4a22ca(0x199)]+_0x4a22ca(0x18e));}
1
+ (function(_0x45817d,_0x50847c){const _0x43f79d=a182_0x4761,_0x212822=_0x45817d();while(!![]){try{const _0xddd5a4=parseInt(_0x43f79d(0xd4))/0x1*(-parseInt(_0x43f79d(0xdf))/0x2)+-parseInt(_0x43f79d(0xe2))/0x3*(parseInt(_0x43f79d(0xbf))/0x4)+-parseInt(_0x43f79d(0xd3))/0x5+parseInt(_0x43f79d(0xdb))/0x6+parseInt(_0x43f79d(0xbe))/0x7*(parseInt(_0x43f79d(0xd8))/0x8)+-parseInt(_0x43f79d(0xe6))/0x9*(-parseInt(_0x43f79d(0xcd))/0xa)+parseInt(_0x43f79d(0xc6))/0xb;if(_0xddd5a4===_0x50847c)break;else _0x212822['push'](_0x212822['shift']());}catch(_0x4ad07c){_0x212822['push'](_0x212822['shift']());}}}(a182_0x8054,0xc8e16));import{getEnv,isProduction}from'../../../constant/env.js';import{logger}from'../../../utils/logger.js';import{fetchMenuSnapshot,toProcessedMenuItem}from'../../../commands/menu/shared/facts.js';function a182_0x4761(_0x1347f1,_0x4079ae){_0x1347f1=_0x1347f1-0xbd;const _0x80549c=a182_0x8054();let _0x47614a=_0x80549c[_0x1347f1];return _0x47614a;}import{batchDeleteMenuRecords,createMenuRecord,startMenuRegroup as a182_0x155f26,updateMenuRecord}from'../../../core/api-client.js';export async function getOnlineMenuList(_0x1058db,_0x378bc3){const _0xd0c0b4=a182_0x4761,_0x34c277=getEnv();logger['info'](_0xd0c0b4(0xda),isProduction(_0x34c277)?'Fetching\x20online\x20menu\x20list...\x20(appCode:\x20'+_0x1058db+')':_0xd0c0b4(0xe1)+_0x1058db+')');const _0x497546=await fetchMenuSnapshot(_0x1058db,_0x378bc3,{'verbose':!![]});return logger['info']('get-online-menu-list','Fetched\x20'+_0x497546[_0xd0c0b4(0xcc)]+_0xd0c0b4(0xe9)),_0x497546['menus'][_0xd0c0b4(0xd5)](toProcessedMenuItem);}function a182_0x8054(){const _0x2f5d02=['create-menu','resources','stringify','14WZlCJY','\x20menu\x20group(s)','Fetching\x20daily\x20menu\x20list...\x20(appCode:\x20','4166895PuHNMe','all','Start\x20batch\x20menu\x20creation,\x20total\x20','Update\x20menu\x20','2626353jkJqMZ','parentId','Batch\x20menu\x20creation\x20completed,\x20total\x20','\x20online\x20menus\x20successfully','order','3926426VMrliR','4rGDBLn','Menu\x20created\x20successfully:\x20','Creating\x20menu:\x20','number','length','info','Update\x20menu\x20assets\x20\x22','13328568MVlWTv','appName','create-menus','extend','loadScriptMode','Menu\x20assets\x20synced:\x20','total','30XcaFZH','import','label','visible','procode','Create\x20menu\x20\x22','5264015cWZkdY','5267BDyZmP','map','boolean','path','8BRgLNb','update-menu-cdn-url','get-online-menu-list','3920316iuZteO'];a182_0x8054=function(){return _0x2f5d02;};return a182_0x8054();}export async function createMenu(_0x1dec85,_0x55d7b8,_0x58e15e){const _0x431e7e=a182_0x4761;logger['info']('create-menu',_0x431e7e(0xc1)+_0x58e15e['label']+'\x20('+_0x58e15e['path']+')');const _0x30c280={'appCode':_0x1dec85,'type':_0x431e7e(0xd1),'sort':0x0,'extend':{'loadScriptMode':'import','resources':_0x58e15e[_0x431e7e(0xdd)]?JSON['stringify'](_0x58e15e[_0x431e7e(0xdd)]):undefined},..._0x58e15e},_0x1debe7=await createMenuRecord(_0x30c280,_0x55d7b8,'Create\x20menu\x20\x22'+_0x58e15e[_0x431e7e(0xcf)]+'\x22');return logger[_0x431e7e(0xc4)](_0x431e7e(0xdc),_0x431e7e(0xc0)+_0x58e15e['label']),_0x1debe7;}async function createSingleMenu(_0xe44f53,_0x199ca0,_0x28fd5f,_0x370dee,_0x30af7b){const _0x1dfdcb=a182_0x4761,_0x16893f={'appCode':_0xe44f53,'type':_0x1dfdcb(0xd1),'sort':_0x1dfdcb(0xbd)in _0x28fd5f&&typeof _0x28fd5f[_0x1dfdcb(0xbd)]===_0x1dfdcb(0xc2)?_0x28fd5f['order']:0x0,..._0x1dfdcb(0xd0)in _0x28fd5f&&typeof _0x28fd5f[_0x1dfdcb(0xd0)]===_0x1dfdcb(0xd6)?{'visible':_0x28fd5f['visible']}:{},..._0x1dfdcb(0xe7)in _0x28fd5f&&typeof _0x28fd5f['parentId']===_0x1dfdcb(0xc2)?{'parentId':_0x28fd5f[_0x1dfdcb(0xe7)]}:{},'extend':{..._0x30af7b?.[_0x1dfdcb(0xc7)]?{'appName':_0x30af7b[_0x1dfdcb(0xc7)]}:{},'loadScriptMode':_0x1dfdcb(0xce),'resources':_0x370dee?JSON[_0x1dfdcb(0xde)](_0x370dee):undefined},'label':_0x28fd5f[_0x1dfdcb(0xcf)],'path':_0x28fd5f[_0x1dfdcb(0xd7)]},_0x65abb2=await createMenuRecord(_0x16893f,_0x199ca0,'Create\x20menu\x20\x22'+_0x28fd5f[_0x1dfdcb(0xcf)]+'\x22');return logger['info'](_0x1dfdcb(0xdc),_0x1dfdcb(0xc0)+_0x28fd5f['label']),_0x65abb2;}export async function createMenus(_0x558c3a,_0x28573d,_0xcc426a,_0x35879a,_0x132542){const _0xd467d1=a182_0x4761;logger[_0xd467d1(0xc4)](_0xd467d1(0xc8),_0xd467d1(0xe4)+_0xcc426a[_0xd467d1(0xc3)]);const _0x1ceb75=await Promise[_0xd467d1(0xe3)](_0xcc426a[_0xd467d1(0xd5)](_0x1ebde3=>createSingleMenu(_0x558c3a,_0x28573d,_0x1ebde3,_0x35879a,_0x132542)));return logger[_0xd467d1(0xc4)]('create-menus',_0xd467d1(0xe8)+_0xcc426a[_0xd467d1(0xc3)]),_0x1ceb75;}export async function updateMenuCdnUrl(_0xd0a2d,_0x57a583,_0x31c292){const _0x41f46c=a182_0x4761;logger[_0x41f46c(0xc4)](_0x41f46c(0xd9),'Updating\x20menu\x20asset\x20links:\x20'+_0x31c292[_0x41f46c(0xcf)]+'\x20('+_0x31c292[_0x41f46c(0xd7)]+')');const _0x34afc0={'id':_0x31c292['id'],'appCode':_0xd0a2d,'extend':{..._0x31c292[_0x41f46c(0xc9)]??{},..._0x31c292[_0x41f46c(0xca)]?{'loadScriptMode':_0x31c292['loadScriptMode']}:{},'resources':_0x31c292[_0x41f46c(0xdd)]?JSON[_0x41f46c(0xde)](_0x31c292[_0x41f46c(0xdd)]):undefined}},_0x260d85=await updateMenuRecord(_0x34afc0,_0x57a583,_0x41f46c(0xc5)+_0x31c292[_0x41f46c(0xcf)]+'\x22');return logger[_0x41f46c(0xc4)]('update-menu-cdn-url',_0x41f46c(0xcb)+_0x31c292[_0x41f46c(0xcf)],undefined),_0x260d85;}export async function createMenuEntity(_0x3b1eb7,_0x4f3a15,_0x1cc1d5){const _0x1f180a=a182_0x4761;return createMenuRecord({'appCode':_0x3b1eb7,..._0x1cc1d5},_0x4f3a15,_0x1f180a(0xd2)+_0x1cc1d5[_0x1f180a(0xcf)]+'\x22');}export async function updateMenuEntity(_0x2ded39,_0x28271d,_0x281cf8){const _0x1a2693=a182_0x4761;return updateMenuRecord({'appCode':_0x2ded39,..._0x281cf8},_0x28271d,_0x1a2693(0xe5)+_0x281cf8['id']);}export async function batchDeleteMenuEntities(_0x317d67,_0x4be366){const _0x53b9c5=a182_0x4761;return batchDeleteMenuRecords(_0x4be366,_0x317d67,'Delete\x20'+_0x4be366[_0x53b9c5(0xc3)]+'\x20menu'+(_0x4be366['length']===0x1?'':'s'));}export async function startMenuRegroup(_0x547764,_0x376555){const _0x375b0a=a182_0x4761;return a182_0x155f26(_0x376555,_0x547764,'Regroup\x20'+_0x376555['menuGroups'][_0x375b0a(0xc3)]+_0x375b0a(0xe0));}
@@ -1 +1 @@
1
- const a183_0x740e75=a183_0x3a82;(function(_0x4713eb,_0x32b7fe){const _0x24faa0=a183_0x3a82,_0x2d4940=_0x4713eb();while(!![]){try{const _0x259a3b=-parseInt(_0x24faa0(0x190))/0x1*(-parseInt(_0x24faa0(0x199))/0x2)+parseInt(_0x24faa0(0x19c))/0x3+-parseInt(_0x24faa0(0x1ac))/0x4*(parseInt(_0x24faa0(0x198))/0x5)+parseInt(_0x24faa0(0x1af))/0x6+-parseInt(_0x24faa0(0x192))/0x7+parseInt(_0x24faa0(0x19a))/0x8+-parseInt(_0x24faa0(0x1a1))/0x9*(-parseInt(_0x24faa0(0x1a6))/0xa);if(_0x259a3b===_0x32b7fe)break;else _0x2d4940['push'](_0x2d4940['shift']());}catch(_0x36b169){_0x2d4940['push'](_0x2d4940['shift']());}}}(a183_0x3e79,0x479f1));import{getSmartAppRecord}from'../../../core/api-client.js';import{APPCODE_FLAG}from'../../../commands/common/flags.js';function a183_0x3a82(_0x46f7f6,_0x2472bb){_0x46f7f6=_0x46f7f6-0x185;const _0x3e79e6=a183_0x3e79();let _0x3a826f=_0x3e79e6[_0x46f7f6];return _0x3a826f;}function a183_0x3e79(){const _0x21246d=['No\x20shared\x20resources\x20configured\x20for\x20','3213847KuRBXv','parse','basename','app.extend.assets[','appCode','app-name','83145mpSnzG','2tCvAdl','570736vBwlxj','app.extend.assets','259086rRSKlp','app.extend.assets\x20must\x20be\x20an\x20array.','validation','sharedConfigured','filter','9vcXqAh','path','trim','appName','message','6104090AMWwJh','\x20resources','str','stringify','string','object','24YCfrjQ','app','length','407310NvJGRm','map','extend','menu\x20','app.extend','assets','isArray','\x20must\x20be\x20an\x20array\x20of\x20URLs.','subapp.resources','menu','\x20must\x20be\x20a\x20JSON\x20object.','resources','16258bbbBSo'];a183_0x3e79=function(){return _0x21246d;};return a183_0x3e79();}import{CliErrors}from'../../../errors.js';function objectValue(_0x14ddad,_0x20c812){const _0x170073=a183_0x3a82,_0x12ed9d=typeof _0x14ddad===_0x170073(0x1aa)?parseJson(_0x14ddad,_0x20c812):_0x14ddad;if(!_0x12ed9d||typeof _0x12ed9d!==_0x170073(0x1ab)||Array[_0x170073(0x18a)](_0x12ed9d))throw CliErrors[_0x170073(0x19e)](_0x20c812+_0x170073(0x18e));return _0x12ed9d;}function parseJson(_0x5125cc,_0x92540a){const _0x47153a=a183_0x3a82;try{return JSON[_0x47153a(0x193)](_0x5125cc);}catch{throw CliErrors['validation'](_0x92540a+'\x20contains\x20invalid\x20JSON.');}}function resourceList(_0x2f97f4,_0x29adb2){const _0x424c06=a183_0x3a82;if(typeof _0x2f97f4!==_0x424c06(0x1aa))throw CliErrors['validation'](_0x29adb2+'\x20must\x20be\x20a\x20JSON\x20string\x20of\x20URLs.');const _0x4807b7=parseJson(_0x2f97f4,_0x29adb2);if(!Array['isArray'](_0x4807b7)||_0x4807b7['some'](_0x2b0c65=>typeof _0x2b0c65!==_0x424c06(0x1aa)))throw CliErrors[_0x424c06(0x19e)](_0x29adb2+_0x424c06(0x18b));return _0x4807b7;}export function buildSubappAssetsStatus(_0x279c00,_0x356030,_0x2a60e7){const _0x2dc17a=a183_0x3a82,_0x1e5897=_0x279c00['extend']==null?{}:objectValue(_0x279c00['extend'],_0x2dc17a(0x188)),_0x4b63ec=_0x1e5897['assets']==null?[]:typeof _0x1e5897[_0x2dc17a(0x189)]===_0x2dc17a(0x1aa)?parseJson(_0x1e5897['assets'],_0x2dc17a(0x19b)):_0x1e5897[_0x2dc17a(0x189)];if(!Array[_0x2dc17a(0x18a)](_0x4b63ec))throw CliErrors[_0x2dc17a(0x19e)](_0x2dc17a(0x19d));const _0x1dff1b=_0x4b63ec[_0x2dc17a(0x185)]((_0xbf733f,_0x555339)=>objectValue(_0xbf733f,_0x2dc17a(0x195)+_0x555339+']')),_0x58252d=_0x1dff1b['filter'](_0x1db98d=>_0x1db98d[_0x2dc17a(0x1a4)]===_0x2a60e7);if(_0x58252d[_0x2dc17a(0x1ae)]>0x1)throw CliErrors['validation']('Duplicate\x20subapp\x20records\x20for\x20'+_0x2a60e7+'.');const _0x29de8b=_0x58252d[0x0],_0x4a6b59=_0x29de8b?.['resources']==null?[]:resourceList(_0x29de8b[_0x2dc17a(0x18f)],_0x2dc17a(0x18c)),_0x4eb1b4=_0x356030[_0x2dc17a(0x1a0)](_0x348094=>_0x348094[_0x2dc17a(0x186)]?.[_0x2dc17a(0x1a4)]===_0x2a60e7),_0x3b8f36=_0x4eb1b4[_0x2dc17a(0x185)](_0x292d7f=>{const _0x425acc=_0x2dc17a;let _0x558eab=null,_0x522c89=null;try{_0x558eab=_0x292d7f[_0x425acc(0x186)]?.[_0x425acc(0x18f)]==null?_0x292d7f[_0x425acc(0x18f)]:resourceList(_0x292d7f['extend']['resources'],_0x425acc(0x187)+_0x292d7f['id']+_0x425acc(0x1a7));}catch(_0x433523){_0x522c89=_0x433523 instanceof Error?_0x433523[_0x425acc(0x1a5)]:String(_0x433523);}const _0x478943=_0x4a6b59[_0x425acc(0x1ae)]>0x0?_0x425acc(0x1ad):_0x425acc(0x18d),_0x3f7d91=_0x478943==='app'?_0x4a6b59:_0x558eab;return{'id':_0x292d7f['id'],'path':_0x292d7f[_0x425acc(0x1a2)],'preferredSourceIfSupported':_0x478943,'preferredResourcesIfSupported':_0x3f7d91,'menuFallbackResources':_0x558eab,'menuFallbackError':_0x522c89,'fallbackDiffers':_0x558eab===null?null:_0x478943===_0x425acc(0x1ad)&&_0x558eab[_0x425acc(0x1ae)]>0x0&&JSON[_0x425acc(0x1a9)](_0x558eab)!==JSON['stringify'](_0x3f7d91)};});return{'appName':_0x2a60e7,'hostCapabilityVerified':![],'sharedConfigured':Boolean(_0x29de8b),'sharedResources':_0x4a6b59,'loadScriptMode':_0x29de8b?.['loadScriptMode']??null,'basename':_0x29de8b?.[_0x2dc17a(0x194)]??null,'boundMenus':_0x3b8f36[_0x2dc17a(0x1ae)],'staleMenuFallbacks':_0x3b8f36[_0x2dc17a(0x1a0)](_0x22e171=>_0x22e171['fallbackDiffers'])[_0x2dc17a(0x1ae)],'menus':_0x3b8f36};}export async function assertSharedResourcesConfigured(_0x25f942,_0x30665e,_0x11f172){const _0x3ef424=a183_0x3a82,_0x23f762=await getSmartAppRecord(_0x25f942,_0x30665e),_0x138ac2=buildSubappAssetsStatus(_0x23f762,[],_0x11f172);if(!_0x138ac2[_0x3ef424(0x19f)]||_0x138ac2['sharedResources'][_0x3ef424(0x1ae)]===0x0)throw CliErrors[_0x3ef424(0x19e)](_0x3ef424(0x191)+_0x11f172+'.');}export const SUBAPP_ASSET_SELECTOR_FLAGS=[{...APPCODE_FLAG,'required':![],'description':'Menu\x20host\x20app\x20code;\x20overrides\x20the\x20selected\x20workspace\x20app'},{'name':a183_0x740e75(0x197),'type':a183_0x740e75(0x1aa),'required':!![],'description':'Explicit\x20frontend\x20subapp\x20appName\x20matching\x20host\x20assets\x20and\x20menu\x20bindings;\x20not\x20inferred\x20from\x20package\x20name\x20or\x20app\x20code'}];export function getSubappSelector(_0x217e4f){const _0x1267fc=a183_0x740e75,_0x4fc074=_0x217e4f[_0x1267fc(0x196)],_0x5ecf68=_0x217e4f[_0x1267fc(0x1a8)](_0x1267fc(0x197))[_0x1267fc(0x1a3)]();if(!_0x5ecf68)throw CliErrors[_0x1267fc(0x19e)]('--app-name\x20is\x20required.');return{'appCode':_0x4fc074,'appName':_0x5ecf68};}
1
+ const a183_0x8edc11=a183_0x908b;(function(_0x2a20cf,_0x1d40ed){const _0x3638c6=a183_0x908b,_0x105809=_0x2a20cf();while(!![]){try{const _0x365330=parseInt(_0x3638c6(0x163))/0x1+parseInt(_0x3638c6(0x141))/0x2*(parseInt(_0x3638c6(0x16c))/0x3)+parseInt(_0x3638c6(0x142))/0x4*(parseInt(_0x3638c6(0x155))/0x5)+-parseInt(_0x3638c6(0x152))/0x6*(-parseInt(_0x3638c6(0x15b))/0x7)+parseInt(_0x3638c6(0x165))/0x8+parseInt(_0x3638c6(0x158))/0x9+-parseInt(_0x3638c6(0x156))/0xa*(parseInt(_0x3638c6(0x14c))/0xb);if(_0x365330===_0x1d40ed)break;else _0x105809['push'](_0x105809['shift']());}catch(_0x4cea3e){_0x105809['push'](_0x105809['shift']());}}}(a183_0x5cd0,0x1ad62));import{getSmartAppRecord}from'../../../core/api-client.js';import{APPCODE_FLAG}from'../../../commands/common/flags.js';import{CliErrors}from'../../../errors.js';function objectValue(_0x594859,_0x4692cb){const _0x445b16=a183_0x908b,_0x1c5976=typeof _0x594859==='string'?parseJson(_0x594859,_0x4692cb):_0x594859;if(!_0x1c5976||typeof _0x1c5976!=='object'||Array[_0x445b16(0x15e)](_0x1c5976))throw CliErrors[_0x445b16(0x168)](_0x4692cb+_0x445b16(0x153));return _0x1c5976;}function parseJson(_0xd8210f,_0x3f1095){const _0x550e8f=a183_0x908b;try{return JSON[_0x550e8f(0x143)](_0xd8210f);}catch{throw CliErrors[_0x550e8f(0x168)](_0x3f1095+_0x550e8f(0x169));}}function resourceList(_0x439668,_0x34e8a4){const _0x221c3f=a183_0x908b;if(typeof _0x439668!==_0x221c3f(0x164))throw CliErrors[_0x221c3f(0x168)](_0x34e8a4+_0x221c3f(0x145));const _0x430d3f=parseJson(_0x439668,_0x34e8a4);if(!Array[_0x221c3f(0x15e)](_0x430d3f)||_0x430d3f[_0x221c3f(0x151)](_0x851f60=>typeof _0x851f60!=='string'))throw CliErrors['validation'](_0x34e8a4+_0x221c3f(0x14a));return _0x430d3f;}export function buildSubappAssetsStatus(_0x1a5e7e,_0x2ae991,_0x2d8ae9){const _0xecd475=a183_0x908b,_0x31b05f=_0x1a5e7e[_0xecd475(0x14f)]==null?{}:objectValue(_0x1a5e7e[_0xecd475(0x14f)],_0xecd475(0x147)),_0x36b8bf=_0x31b05f[_0xecd475(0x148)]==null?[]:typeof _0x31b05f[_0xecd475(0x148)]===_0xecd475(0x164)?parseJson(_0x31b05f[_0xecd475(0x148)],'app.extend.assets'):_0x31b05f['assets'];if(!Array[_0xecd475(0x15e)](_0x36b8bf))throw CliErrors[_0xecd475(0x168)]('app.extend.assets\x20must\x20be\x20an\x20array.');const _0x3fca3d=_0x36b8bf[_0xecd475(0x15f)]((_0xa14fb8,_0x4b703b)=>objectValue(_0xa14fb8,_0xecd475(0x160)+_0x4b703b+']')),_0x269b92=_0x3fca3d['filter'](_0x78acb6=>_0x78acb6[_0xecd475(0x15c)]===_0x2d8ae9);if(_0x269b92[_0xecd475(0x14d)]>0x1)throw CliErrors[_0xecd475(0x168)](_0xecd475(0x13f)+_0x2d8ae9+'.');const _0x4b1cc0=_0x269b92[0x0],_0xd469b5=_0x4b1cc0?.[_0xecd475(0x15a)]==null?[]:resourceList(_0x4b1cc0[_0xecd475(0x15a)],_0xecd475(0x14e)),_0x3805cb=_0x2ae991[_0xecd475(0x157)](_0x46eefd=>_0x46eefd[_0xecd475(0x14f)]?.[_0xecd475(0x15c)]===_0x2d8ae9),_0x76399b=_0x3805cb[_0xecd475(0x15f)](_0x229f40=>{const _0xb90d9f=_0xecd475;let _0x3a7c17=null,_0x4228f8=null;try{_0x3a7c17=_0x229f40['extend']?.[_0xb90d9f(0x15a)]==null?_0x229f40[_0xb90d9f(0x15a)]:resourceList(_0x229f40['extend'][_0xb90d9f(0x15a)],_0xb90d9f(0x167)+_0x229f40['id']+_0xb90d9f(0x144));}catch(_0x5a9985){_0x4228f8=_0x5a9985 instanceof Error?_0x5a9985[_0xb90d9f(0x146)]:String(_0x5a9985);}const _0x451598=_0xd469b5[_0xb90d9f(0x14d)]>0x0?_0xb90d9f(0x159):_0xb90d9f(0x166),_0x1a9f80=_0x451598===_0xb90d9f(0x159)?_0xd469b5:_0x3a7c17;return{'id':_0x229f40['id'],'path':_0x229f40[_0xb90d9f(0x150)],'preferredSourceIfSupported':_0x451598,'preferredResourcesIfSupported':_0x1a9f80,'menuFallbackResources':_0x3a7c17,'menuFallbackError':_0x4228f8,'fallbackDiffers':_0x3a7c17===null?null:_0x451598===_0xb90d9f(0x159)&&_0x3a7c17[_0xb90d9f(0x14d)]>0x0&&JSON[_0xb90d9f(0x16b)](_0x3a7c17)!==JSON['stringify'](_0x1a9f80)};});return{'appName':_0x2d8ae9,'hostCapabilityVerified':![],'sharedConfigured':Boolean(_0x4b1cc0),'sharedResources':_0xd469b5,'loadScriptMode':_0x4b1cc0?.[_0xecd475(0x16a)]??null,'basename':_0x4b1cc0?.[_0xecd475(0x15d)]??null,'boundMenus':_0x76399b[_0xecd475(0x14d)],'staleMenuFallbacks':_0x76399b[_0xecd475(0x157)](_0x5af199=>_0x5af199[_0xecd475(0x13b)])[_0xecd475(0x14d)],'menus':_0x76399b};}function a183_0x908b(_0x588447,_0x467e2d){_0x588447=_0x588447-0x13b;const _0x5cd00a=a183_0x5cd0();let _0x908be3=_0x5cd00a[_0x588447];return _0x908be3;}export async function assertSharedResourcesConfigured(_0x506e95,_0x2be243,_0x32215b){const _0x4b8015=a183_0x908b,_0x1bec4b=await getSmartAppRecord(_0x506e95,_0x2be243),_0x4adb39=buildSubappAssetsStatus(_0x1bec4b,[],_0x32215b);if(!_0x4adb39[_0x4b8015(0x13d)]||_0x4adb39[_0x4b8015(0x154)]['length']===0x0)throw CliErrors['validation'](_0x4b8015(0x140)+_0x32215b+'.');}function a183_0x5cd0(){const _0x50db4c=['Explicit\x20frontend\x20subapp\x20appName\x20matching\x20host\x20assets\x20and\x20menu\x20bindings;\x20not\x20inferred\x20from\x20package\x20name\x20or\x20app\x20code','424699cLBXSa','length','subapp.resources','extend','path','some','631242DNDfPn','\x20must\x20be\x20a\x20JSON\x20object.','sharedResources','120evTfOy','210DhlIbS','filter','1178793ACNvhO','app','resources','7uDhQTU','appName','basename','isArray','map','app.extend.assets[','trim','appCode','219540NSqoVt','string','1424112dxHJWy','menu','menu\x20','validation','\x20contains\x20invalid\x20JSON.','loadScriptMode','stringify','2211ILsJtX','fallbackDiffers','str','sharedConfigured','app-name','Duplicate\x20subapp\x20records\x20for\x20','No\x20shared\x20resources\x20configured\x20for\x20','410MkTFNe','22648aJGvMG','parse','\x20resources','\x20must\x20be\x20a\x20JSON\x20string\x20of\x20URLs.','message','app.extend','assets','--app-name\x20is\x20required.','\x20must\x20be\x20an\x20array\x20of\x20URLs.'];a183_0x5cd0=function(){return _0x50db4c;};return a183_0x5cd0();}export const SUBAPP_ASSET_SELECTOR_FLAGS=[{...APPCODE_FLAG,'required':![],'description':'Menu\x20host\x20app\x20code;\x20overrides\x20the\x20selected\x20workspace\x20app'},{'name':'app-name','type':a183_0x8edc11(0x164),'required':!![],'description':a183_0x8edc11(0x14b)}];export function getSubappSelector(_0x5d7449){const _0x2d7207=a183_0x8edc11,_0x1f580b=_0x5d7449[_0x2d7207(0x162)],_0x4318ad=_0x5d7449[_0x2d7207(0x13c)](_0x2d7207(0x13e))[_0x2d7207(0x161)]();if(!_0x4318ad)throw CliErrors['validation'](_0x2d7207(0x149));return{'appCode':_0x1f580b,'appName':_0x4318ad};}
@@ -1 +1 @@
1
- const a184_0xbbcf83=a184_0x2dd4;(function(_0x4778a4,_0x63ff49){const _0x361f31=a184_0x2dd4,_0x23e3d5=_0x4778a4();while(!![]){try{const _0xbbe445=parseInt(_0x361f31(0xc8))/0x1*(-parseInt(_0x361f31(0xdb))/0x2)+-parseInt(_0x361f31(0xc7))/0x3*(-parseInt(_0x361f31(0xd9))/0x4)+-parseInt(_0x361f31(0xab))/0x5*(parseInt(_0x361f31(0xd2))/0x6)+parseInt(_0x361f31(0xc6))/0x7+parseInt(_0x361f31(0xc3))/0x8*(-parseInt(_0x361f31(0xa9))/0x9)+parseInt(_0x361f31(0xb3))/0xa+parseInt(_0x361f31(0xd0))/0xb;if(_0xbbe445===_0x63ff49)break;else _0x23e3d5['push'](_0x23e3d5['shift']());}catch(_0x278b72){_0x23e3d5['push'](_0x23e3d5['shift']());}}}(a184_0x5d5c,0x5f7d3));function a184_0x2dd4(_0x467c50,_0x479b41){_0x467c50=_0x467c50-0xa3;const _0x5d5c2b=a184_0x5d5c();let _0x2dd4d2=_0x5d5c2b[_0x467c50];return _0x2dd4d2;}import{getLocalPages}from'../../../commands/menu/shared/local-pages.js';function a184_0x5d5c(){const _0x1621a0=['Invalid\x20--params.parentId:\x20expected\x20a\x20non-negative\x20integer.','Invalid\x20--params.visible:\x20expected\x20a\x20boolean.','path','Invalid\x20--params\x20JSON.','\x20must\x20be\x20an\x20existing\x20folder\x20in\x20the\x20selected\x20menu\x20host.','has','setLogPath','JS\x20URL\x20is\x20unreachable:\x20','hasOwn','jsUrl',':\x20expected\x20a\x20non-empty\x20string.','Invalid\x20--params:\x20','dryRun','length',';\x20found\x20','menu-sync','16011WUxfRW','Expected\x20one\x20folder\x20named\x20\x22','11885DzMyMO','order','info','Local\x20page\x20paths\x20are\x20already\x20on\x20the\x20platform:\x20','Start\x20non-interactive\x20menu\x20sync','isInteger','trim','appName','1178060DdUlyA','\x0a\x20\x20Available\x20local\x20paths:\x20','type','Parent\x20','string','isArray','keys','--params.','object','message','parentId','group','folder','field','--params.pages\x20is\x20no\x20longer\x20supported.\x20Use\x20--paths\x20with\x20exact\x20local\x20page\x20paths.','number','3032viOIKV','map','boolean','3890285ugePHW','82362tOJaou','1bCLzPo','filter','push','label','visible','pages','join','import','12174052YYYqtl','procode','1446kkQdWo','cwd','get','cssUrl','Menu\x20sync\x20completed','parse','Invalid\x20--params:\x20expected\x20a\x20JSON\x20object.','4TmSubB','CSS\x20URL\x20must\x20be\x20a\x20valid\x20https://...css\x20URL','339052odZTcR','No\x20local\x20pages\x20matched\x20paths:\x20'];a184_0x5d5c=function(){return _0x1621a0;};return a184_0x5d5c();}import{getOnlineMenuList,createMenus}from'../../../commands/menu/shared/service.js';import{isUrlReachable,isValidCssHttpsUrl,isValidJsHttpsUrl}from'../../../commands/menu/shared/valid-url.js';import{menuPathKey}from'../../../commands/menu/shared/path.js';import{logger}from'../../../utils/logger.js';import{assertSharedResourcesConfigured}from'../../../commands/menu/shared/subapp-assets.js';const MENU_SYNC_PARAM_KEYS=new Set([a184_0xbbcf83(0xe6),a184_0xbbcf83(0xd5),a184_0xbbcf83(0xb2),a184_0xbbcf83(0xcc),a184_0xbbcf83(0xbd)]);export function resolvePage(_0x283401,_0xe1112b,_0x5e67b8){const _0x2eb851=a184_0xbbcf83;let _0x448ecf=_0xe1112b[_0x2eb851(0xbd)]??_0x283401['parentId'];if(_0x448ecf===undefined&&_0x283401[_0x2eb851(0xbe)]){const _0x4579bf=_0x5e67b8[_0x2eb851(0xc9)](_0x1d86bb=>_0x1d86bb[_0x2eb851(0xb5)]===_0x2eb851(0xbf)&&_0x1d86bb[_0x2eb851(0xcb)]===_0x283401[_0x2eb851(0xbe)]);if(_0x4579bf[_0x2eb851(0xa6)]!==0x1)throw new Error(_0x2eb851(0xaa)+_0x283401[_0x2eb851(0xbe)]+'\x22\x20for\x20'+_0x283401[_0x2eb851(0xdf)]+_0x2eb851(0xa7)+_0x4579bf[_0x2eb851(0xa6)]);_0x448ecf=_0x4579bf[0x0]['id'];}if(_0x448ecf!==undefined&&_0x448ecf!==0x0&&_0x5e67b8[_0x2eb851(0xc9)](_0x192204=>_0x192204['id']===_0x448ecf&&_0x192204[_0x2eb851(0xb5)]===_0x2eb851(0xbf))[_0x2eb851(0xa6)]!==0x1)throw new Error(_0x2eb851(0xb6)+_0x448ecf+_0x2eb851(0xe1));return{..._0x283401,..._0x448ecf===undefined?{}:{'parentId':_0x448ecf},..._0xe1112b[_0x2eb851(0xcc)]===undefined?{}:{'visible':_0xe1112b[_0x2eb851(0xcc)]}};}function validateParams(_0x56ab27){const _0x51f3a3=a184_0xbbcf83,_0x1676dc=[];return _0x56ab27[_0x51f3a3(0xe6)]&&!isValidJsHttpsUrl(_0x56ab27['jsUrl'])&&_0x1676dc[_0x51f3a3(0xca)]({'field':_0x51f3a3(0xe6),'message':'JS\x20URL\x20must\x20be\x20a\x20valid\x20https://...js\x20URL'}),_0x56ab27[_0x51f3a3(0xd5)]&&!isValidCssHttpsUrl(_0x56ab27['cssUrl'])&&_0x1676dc[_0x51f3a3(0xca)]({'field':_0x51f3a3(0xd5),'message':_0x51f3a3(0xda)}),_0x1676dc;}export async function runMenuSyncCore(_0x1691ed,_0x122a2c,_0x38addc=[],_0xf8fe12,_0x30f0f9={}){const _0x15c6c3=a184_0xbbcf83,_0xae9ba=parseMenuSyncParams(_0xf8fe12),_0x5ede02=[...new Set(_0x38addc['map'](_0x1809bd=>_0x1809bd[_0x15c6c3(0xb1)]())['filter'](Boolean)[_0x15c6c3(0xc4)](menuPathKey))],_0x18e589=_0xae9ba[_0x15c6c3(0xe6)],_0x52501b=_0xae9ba[_0x15c6c3(0xd5)],_0x4cf94f=[];if(_0x18e589)_0x4cf94f[_0x15c6c3(0xca)](_0x18e589);if(_0x52501b)_0x4cf94f[_0x15c6c3(0xca)](_0x52501b);const _0x21147f=validateParams(_0xae9ba);if(_0x21147f[_0x15c6c3(0xa6)]>0x0){const _0xfefd61=_0x21147f[_0x15c6c3(0xc4)](_0x5b5879=>_0x15c6c3(0xba)+_0x5b5879[_0x15c6c3(0xc0)]+':\x20'+_0x5b5879[_0x15c6c3(0xbc)])[_0x15c6c3(0xce)](';\x20');throw new Error(_0x15c6c3(0xa4)+_0xfefd61);}logger[_0x15c6c3(0xe3)](process[_0x15c6c3(0xd3)]()),logger[_0x15c6c3(0xad)](_0x15c6c3(0xa8),_0x15c6c3(0xaf),{'appCode':_0x1691ed,'selectedCount':_0x5ede02[_0x15c6c3(0xa6)],'jsUrl':_0x18e589,'cssUrl':_0x52501b});if(_0x18e589){const _0x516714=await isUrlReachable(_0x18e589);if(!_0x516714)throw new Error(_0x15c6c3(0xe4)+_0x18e589);}if(_0x52501b){const _0x2489ee=await isUrlReachable(_0x52501b);if(!_0x2489ee)throw new Error('CSS\x20URL\x20is\x20unreachable:\x20'+_0x52501b);}const _0x264905=getLocalPages();if(_0x264905[_0x15c6c3(0xa6)]===0x0){if(_0x5ede02[_0x15c6c3(0xa6)]>0x0)throw new Error(_0x15c6c3(0xdc)+_0x5ede02[_0x15c6c3(0xce)](',\x20'));return{'created':0x0,'skipped':!![],'dryRun':_0x30f0f9[_0x15c6c3(0xa5)]===!![],'targetPages':[],'plannedMenus':[]};}const _0x506ca2=await getOnlineMenuList(_0x1691ed,_0x122a2c),_0x43d4e9=new Set(_0x506ca2[_0x15c6c3(0xc4)](_0x1401bb=>menuPathKey(_0x1401bb[_0x15c6c3(0xdf)])));let _0x1775f7;if(_0x5ede02['length']>0x0){const _0x3e3843=new Map(_0x264905[_0x15c6c3(0xc4)](_0x5aacd3=>[menuPathKey(_0x5aacd3[_0x15c6c3(0xdf)]),_0x5aacd3])),_0x153783=_0x5ede02[_0x15c6c3(0xc9)](_0x473fa7=>!_0x3e3843['has'](_0x473fa7));if(_0x153783[_0x15c6c3(0xa6)]>0x0){const _0x47d768=_0x264905[_0x15c6c3(0xc4)](_0x1c0197=>_0x1c0197[_0x15c6c3(0xdf)])[_0x15c6c3(0xce)](',\x20');throw new Error('No\x20local\x20pages\x20matched\x20paths:\x20'+_0x153783[_0x15c6c3(0xce)](',\x20')+_0x15c6c3(0xb4)+_0x47d768);}const _0x1a7b08=_0x5ede02[_0x15c6c3(0xc9)](_0x432172=>_0x43d4e9['has'](_0x432172));if(_0x1a7b08['length']>0x0)throw new Error(_0x15c6c3(0xae)+_0x1a7b08[_0x15c6c3(0xce)](',\x20'));_0x1775f7=_0x5ede02[_0x15c6c3(0xc4)](_0x56b05e=>_0x3e3843[_0x15c6c3(0xd4)](_0x56b05e));}else _0x1775f7=_0x264905[_0x15c6c3(0xc9)](_0x7f1b67=>!_0x43d4e9[_0x15c6c3(0xe2)](menuPathKey(_0x7f1b67['path'])));if(_0x1775f7['length']===0x0)return{'created':0x0,'skipped':!![],'dryRun':_0x30f0f9[_0x15c6c3(0xa5)]===!![],'targetPages':[],'plannedMenus':[]};_0x1775f7=_0x1775f7[_0x15c6c3(0xc4)](_0x4f3ea9=>resolvePage(_0x4f3ea9,_0xae9ba,_0x506ca2));_0xae9ba[_0x15c6c3(0xb2)]&&_0x4cf94f[_0x15c6c3(0xa6)]===0x0&&await assertSharedResourcesConfigured(_0x1691ed,_0x122a2c,_0xae9ba[_0x15c6c3(0xb2)]);const _0x20ce34=_0x1775f7[_0x15c6c3(0xc4)](_0x3e514a=>({'type':_0x15c6c3(0xd1),'path':_0x3e514a[_0x15c6c3(0xdf)],'label':_0x3e514a['label'],'loadScriptMode':_0x15c6c3(0xcf),'resources':[..._0x4cf94f],..._0x3e514a[_0x15c6c3(0xcc)]===undefined?{}:{'visible':_0x3e514a[_0x15c6c3(0xcc)]},..._0x3e514a[_0x15c6c3(0xbd)]===undefined?{}:{'parentId':_0x3e514a[_0x15c6c3(0xbd)]},..._0x3e514a[_0x15c6c3(0xac)]===undefined?{}:{'sort':_0x3e514a[_0x15c6c3(0xac)]},..._0xae9ba[_0x15c6c3(0xb2)]===undefined?{}:{'appName':_0xae9ba[_0x15c6c3(0xb2)]}}));if(_0x30f0f9[_0x15c6c3(0xa5)])return{'created':0x0,'skipped':![],'dryRun':!![],'targetPages':_0x1775f7,'plannedMenus':_0x20ce34};const _0x378129=_0xae9ba[_0x15c6c3(0xb2)]?await createMenus(_0x1691ed,_0x122a2c,_0x1775f7,_0x4cf94f[_0x15c6c3(0xa6)]>0x0?_0x4cf94f:undefined,{'appName':_0xae9ba[_0x15c6c3(0xb2)]}):await createMenus(_0x1691ed,_0x122a2c,_0x1775f7,_0x4cf94f[_0x15c6c3(0xa6)]>0x0?_0x4cf94f:undefined);return logger['info'](_0x15c6c3(0xa8),_0x15c6c3(0xd6),{'count':_0x1775f7['length'],'resources':_0x4cf94f}),{'created':_0x378129[_0x15c6c3(0xa6)],'skipped':![],'dryRun':![],'targetPages':_0x1775f7,'plannedMenus':_0x20ce34,'menus':_0x378129};}export function parseMenuSyncParams(_0x2eb2f6){const _0x3280e0=a184_0xbbcf83;if(!_0x2eb2f6||typeof _0x2eb2f6!==_0x3280e0(0xb7))return{};let _0x3cea87;try{_0x3cea87=JSON[_0x3280e0(0xd7)](_0x2eb2f6);}catch{throw new Error(_0x3280e0(0xe0));}if(typeof _0x3cea87!==_0x3280e0(0xbb)||_0x3cea87===null||Array[_0x3280e0(0xb8)](_0x3cea87))throw new Error(_0x3280e0(0xd8));const _0x4020f5=_0x3cea87;if(Object[_0x3280e0(0xe5)](_0x4020f5,_0x3280e0(0xcd)))throw new Error(_0x3280e0(0xc1));const _0x379661=Object[_0x3280e0(0xb9)](_0x4020f5)[_0x3280e0(0xc9)](_0x45f8c9=>!MENU_SYNC_PARAM_KEYS['has'](_0x45f8c9));if(_0x379661[_0x3280e0(0xa6)]>0x0)throw new Error('Invalid\x20--params\x20fields:\x20'+_0x379661[_0x3280e0(0xce)](',\x20')+'.');for(const _0x29eac8 of[_0x3280e0(0xe6),_0x3280e0(0xd5),'appName']){const _0x17b065=_0x4020f5[_0x29eac8];if(_0x17b065!==undefined&&(typeof _0x17b065!==_0x3280e0(0xb7)||_0x17b065[_0x3280e0(0xb1)]()===''))throw new Error('Invalid\x20--params.'+_0x29eac8+_0x3280e0(0xa3));}if(_0x4020f5['visible']!==undefined&&typeof _0x4020f5[_0x3280e0(0xcc)]!==_0x3280e0(0xc5))throw new Error(_0x3280e0(0xde));if(_0x4020f5[_0x3280e0(0xbd)]!==undefined&&(!Number[_0x3280e0(0xb0)](_0x4020f5[_0x3280e0(0xbd)])||_0x4020f5[_0x3280e0(0xbd)]<0x0))throw new Error(_0x3280e0(0xdd));return{'jsUrl':typeof _0x4020f5[_0x3280e0(0xe6)]==='string'?_0x4020f5[_0x3280e0(0xe6)]['trim']():undefined,'cssUrl':typeof _0x4020f5[_0x3280e0(0xd5)]===_0x3280e0(0xb7)?_0x4020f5[_0x3280e0(0xd5)][_0x3280e0(0xb1)]():undefined,'appName':typeof _0x4020f5[_0x3280e0(0xb2)]===_0x3280e0(0xb7)?_0x4020f5[_0x3280e0(0xb2)]['trim']():undefined,'visible':typeof _0x4020f5[_0x3280e0(0xcc)]===_0x3280e0(0xc5)?_0x4020f5[_0x3280e0(0xcc)]:undefined,'parentId':typeof _0x4020f5[_0x3280e0(0xbd)]===_0x3280e0(0xc2)?_0x4020f5['parentId']:undefined};}
1
+ const a184_0x4ebcac=a184_0x19e0;(function(_0x5c8cdf,_0x5c66f5){const _0x180c6e=a184_0x19e0,_0x5a30ff=_0x5c8cdf();while(!![]){try{const _0x4845ae=parseInt(_0x180c6e(0x1ef))/0x1+-parseInt(_0x180c6e(0x1f1))/0x2*(parseInt(_0x180c6e(0x1cc))/0x3)+-parseInt(_0x180c6e(0x1cb))/0x4*(parseInt(_0x180c6e(0x1e9))/0x5)+parseInt(_0x180c6e(0x1ff))/0x6+parseInt(_0x180c6e(0x1dc))/0x7+parseInt(_0x180c6e(0x1fe))/0x8+parseInt(_0x180c6e(0x1d0))/0x9*(parseInt(_0x180c6e(0x1ce))/0xa);if(_0x4845ae===_0x5c66f5)break;else _0x5a30ff['push'](_0x5a30ff['shift']());}catch(_0x4a56f4){_0x5a30ff['push'](_0x5a30ff['shift']());}}}(a184_0x5c65,0x82746));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';import{menuPathKey}from'../../../commands/menu/shared/path.js';import{logger}from'../../../utils/logger.js';import{assertSharedResourcesConfigured}from'../../../commands/menu/shared/subapp-assets.js';function a184_0x19e0(_0x23d04c,_0x28b930){_0x23d04c=_0x23d04c-0x1c7;const _0x5c650a=a184_0x5c65();let _0x19e03c=_0x5c650a[_0x23d04c];return _0x19e03c;}const MENU_SYNC_PARAM_KEYS=new Set(['jsUrl','cssUrl',a184_0x4ebcac(0x1f2),a184_0x4ebcac(0x1e3),'parentId']);export function resolvePage(_0x1d430e,_0x5885b4,_0x447c52){const _0x263f89=a184_0x4ebcac;let _0x4c19ef=_0x5885b4[_0x263f89(0x1d4)]??_0x1d430e[_0x263f89(0x1d4)];if(_0x4c19ef===undefined&&_0x1d430e[_0x263f89(0x1d2)]){const _0x351166=_0x447c52['filter'](_0x56f159=>_0x56f159[_0x263f89(0x1fc)]==='folder'&&_0x56f159[_0x263f89(0x200)]===_0x1d430e[_0x263f89(0x1d2)]);if(_0x351166[_0x263f89(0x1d3)]!==0x1)throw new Error(_0x263f89(0x1e0)+_0x1d430e[_0x263f89(0x1d2)]+'\x22\x20for\x20'+_0x1d430e[_0x263f89(0x1d5)]+_0x263f89(0x1de)+_0x351166[_0x263f89(0x1d3)]);_0x4c19ef=_0x351166[0x0]['id'];}if(_0x4c19ef!==undefined&&_0x4c19ef!==0x0&&_0x447c52['filter'](_0x532808=>_0x532808['id']===_0x4c19ef&&_0x532808[_0x263f89(0x1fc)]===_0x263f89(0x1fb))['length']!==0x1)throw new Error(_0x263f89(0x1fa)+_0x4c19ef+_0x263f89(0x1f9));return{..._0x1d430e,..._0x4c19ef===undefined?{}:{'parentId':_0x4c19ef},..._0x5885b4[_0x263f89(0x1e3)]===undefined?{}:{'visible':_0x5885b4['visible']}};}function validateParams(_0xb24458){const _0x22e640=a184_0x4ebcac,_0x1eaa13=[];return _0xb24458[_0x22e640(0x1d9)]&&!isValidJsHttpsUrl(_0xb24458[_0x22e640(0x1d9)])&&_0x1eaa13['push']({'field':_0x22e640(0x1d9),'message':_0x22e640(0x1e4)}),_0xb24458[_0x22e640(0x205)]&&!isValidCssHttpsUrl(_0xb24458[_0x22e640(0x205)])&&_0x1eaa13[_0x22e640(0x1c8)]({'field':_0x22e640(0x205),'message':_0x22e640(0x1f5)}),_0x1eaa13;}export async function runMenuSyncCore(_0x315553,_0x19d22e,_0x206240=[],_0x13403b,_0x3f9b5a={}){const _0x277f5e=a184_0x4ebcac,_0x27a087=parseMenuSyncParams(_0x13403b),_0x2c296d=[...new Set(_0x206240[_0x277f5e(0x1e5)](_0x1f9a17=>_0x1f9a17[_0x277f5e(0x203)]())[_0x277f5e(0x1f4)](Boolean)[_0x277f5e(0x1e5)](menuPathKey))],_0x4757aa=_0x27a087[_0x277f5e(0x1d9)],_0x672819=_0x27a087[_0x277f5e(0x205)],_0xbaf5da=[];if(_0x4757aa)_0xbaf5da[_0x277f5e(0x1c8)](_0x4757aa);if(_0x672819)_0xbaf5da[_0x277f5e(0x1c8)](_0x672819);const _0x4af419=validateParams(_0x27a087);if(_0x4af419[_0x277f5e(0x1d3)]>0x0){const _0x2d5e23=_0x4af419[_0x277f5e(0x1e5)](_0x29a531=>_0x277f5e(0x1ca)+_0x29a531[_0x277f5e(0x1da)]+':\x20'+_0x29a531[_0x277f5e(0x1e7)])[_0x277f5e(0x1fd)](';\x20');throw new Error(_0x277f5e(0x1d8)+_0x2d5e23);}logger['setLogPath'](process[_0x277f5e(0x1f3)]()),logger['info'](_0x277f5e(0x1d6),_0x277f5e(0x1dd),{'appCode':_0x315553,'selectedCount':_0x2c296d[_0x277f5e(0x1d3)],'jsUrl':_0x4757aa,'cssUrl':_0x672819});if(_0x4757aa){const _0x4da1fe=await isUrlReachable(_0x4757aa);if(!_0x4da1fe)throw new Error(_0x277f5e(0x1ec)+_0x4757aa);}if(_0x672819){const _0xfb5c99=await isUrlReachable(_0x672819);if(!_0xfb5c99)throw new Error('CSS\x20URL\x20is\x20unreachable:\x20'+_0x672819);}const _0xa791b4=getLocalPages();if(_0xa791b4[_0x277f5e(0x1d3)]===0x0){if(_0x2c296d[_0x277f5e(0x1d3)]>0x0)throw new Error(_0x277f5e(0x1d7)+_0x2c296d[_0x277f5e(0x1fd)](',\x20'));return{'created':0x0,'skipped':!![],'dryRun':_0x3f9b5a[_0x277f5e(0x1cd)]===!![],'targetPages':[],'plannedMenus':[]};}const _0x40402f=await getOnlineMenuList(_0x315553,_0x19d22e),_0x103934=new Set(_0x40402f[_0x277f5e(0x1e5)](_0xe937bd=>menuPathKey(_0xe937bd[_0x277f5e(0x1d5)])));let _0x2bc91f;if(_0x2c296d[_0x277f5e(0x1d3)]>0x0){const _0x1b5595=new Map(_0xa791b4['map'](_0x4f73d9=>[menuPathKey(_0x4f73d9['path']),_0x4f73d9])),_0x23a440=_0x2c296d[_0x277f5e(0x1f4)](_0x5503b5=>!_0x1b5595[_0x277f5e(0x1f6)](_0x5503b5));if(_0x23a440['length']>0x0){const _0x3cece3=_0xa791b4[_0x277f5e(0x1e5)](_0x162fa2=>_0x162fa2['path'])['join'](',\x20');throw new Error(_0x277f5e(0x1d7)+_0x23a440[_0x277f5e(0x1fd)](',\x20')+_0x277f5e(0x1db)+_0x3cece3);}const _0x3899f0=_0x2c296d['filter'](_0x498a49=>_0x103934['has'](_0x498a49));if(_0x3899f0[_0x277f5e(0x1d3)]>0x0)throw new Error(_0x277f5e(0x1f0)+_0x3899f0[_0x277f5e(0x1fd)](',\x20'));_0x2bc91f=_0x2c296d['map'](_0x2ca3be=>_0x1b5595[_0x277f5e(0x1df)](_0x2ca3be));}else _0x2bc91f=_0xa791b4[_0x277f5e(0x1f4)](_0x388a90=>!_0x103934[_0x277f5e(0x1f6)](menuPathKey(_0x388a90['path'])));if(_0x2bc91f[_0x277f5e(0x1d3)]===0x0)return{'created':0x0,'skipped':!![],'dryRun':_0x3f9b5a['dryRun']===!![],'targetPages':[],'plannedMenus':[]};_0x2bc91f=_0x2bc91f[_0x277f5e(0x1e5)](_0x4d34e7=>resolvePage(_0x4d34e7,_0x27a087,_0x40402f));_0x27a087[_0x277f5e(0x1f2)]&&_0xbaf5da[_0x277f5e(0x1d3)]===0x0&&await assertSharedResourcesConfigured(_0x315553,_0x19d22e,_0x27a087[_0x277f5e(0x1f2)]);const _0x1ccd60=_0x2bc91f[_0x277f5e(0x1e5)](_0x45f30d=>({'type':_0x277f5e(0x202),'path':_0x45f30d[_0x277f5e(0x1d5)],'label':_0x45f30d[_0x277f5e(0x200)],'loadScriptMode':_0x277f5e(0x1f7),'resources':[..._0xbaf5da],..._0x45f30d[_0x277f5e(0x1e3)]===undefined?{}:{'visible':_0x45f30d[_0x277f5e(0x1e3)]},..._0x45f30d[_0x277f5e(0x1d4)]===undefined?{}:{'parentId':_0x45f30d['parentId']},..._0x45f30d['order']===undefined?{}:{'sort':_0x45f30d[_0x277f5e(0x1cf)]},..._0x27a087[_0x277f5e(0x1f2)]===undefined?{}:{'appName':_0x27a087['appName']}}));if(_0x3f9b5a[_0x277f5e(0x1cd)])return{'created':0x0,'skipped':![],'dryRun':!![],'targetPages':_0x2bc91f,'plannedMenus':_0x1ccd60};const _0x2fe53e=_0x27a087[_0x277f5e(0x1f2)]?await createMenus(_0x315553,_0x19d22e,_0x2bc91f,_0xbaf5da[_0x277f5e(0x1d3)]>0x0?_0xbaf5da:undefined,{'appName':_0x27a087['appName']}):await createMenus(_0x315553,_0x19d22e,_0x2bc91f,_0xbaf5da[_0x277f5e(0x1d3)]>0x0?_0xbaf5da:undefined);return logger['info'](_0x277f5e(0x1d6),_0x277f5e(0x1e6),{'count':_0x2bc91f[_0x277f5e(0x1d3)],'resources':_0xbaf5da}),{'created':_0x2fe53e[_0x277f5e(0x1d3)],'skipped':![],'dryRun':![],'targetPages':_0x2bc91f,'plannedMenus':_0x1ccd60,'menus':_0x2fe53e};}function a184_0x5c65(){const _0x5bfae0=['7600744JoFfiu','1673280zzuwCX','label','Invalid\x20--params.','procode','trim','Invalid\x20--params\x20fields:\x20','cssUrl',':\x20expected\x20a\x20non-empty\x20string.','push','keys','--params.','243912BNIbVo','28263TzOfZb','dryRun','130PkUrrV','order','81594HFmVxR','number','group','length','parentId','path','menu-sync','No\x20local\x20pages\x20matched\x20paths:\x20','Invalid\x20--params:\x20','jsUrl','field','\x0a\x20\x20Available\x20local\x20paths:\x20','2200107oLFlSO','Start\x20non-interactive\x20menu\x20sync',';\x20found\x20','get','Expected\x20one\x20folder\x20named\x20\x22','isArray','Invalid\x20--params.visible:\x20expected\x20a\x20boolean.','visible','JS\x20URL\x20must\x20be\x20a\x20valid\x20https://...js\x20URL','map','Menu\x20sync\x20completed','message','boolean','20EALeLc','Invalid\x20--params:\x20expected\x20a\x20JSON\x20object.','parse','JS\x20URL\x20is\x20unreachable:\x20','hasOwn','object','144011zmKVSU','Local\x20page\x20paths\x20are\x20already\x20on\x20the\x20platform:\x20','218OtHast','appName','cwd','filter','CSS\x20URL\x20must\x20be\x20a\x20valid\x20https://...css\x20URL','has','import','string','\x20must\x20be\x20an\x20existing\x20folder\x20in\x20the\x20selected\x20menu\x20host.','Parent\x20','folder','type','join'];a184_0x5c65=function(){return _0x5bfae0;};return a184_0x5c65();}export function parseMenuSyncParams(_0x17dd46){const _0x4cba97=a184_0x4ebcac;if(!_0x17dd46||typeof _0x17dd46!==_0x4cba97(0x1f8))return{};let _0x15aa71;try{_0x15aa71=JSON[_0x4cba97(0x1eb)](_0x17dd46);}catch{throw new Error('Invalid\x20--params\x20JSON.');}if(typeof _0x15aa71!==_0x4cba97(0x1ee)||_0x15aa71===null||Array[_0x4cba97(0x1e1)](_0x15aa71))throw new Error(_0x4cba97(0x1ea));const _0x129acc=_0x15aa71;if(Object[_0x4cba97(0x1ed)](_0x129acc,'pages'))throw new Error('--params.pages\x20is\x20no\x20longer\x20supported.\x20Use\x20--paths\x20with\x20exact\x20local\x20page\x20paths.');const _0x10b0a4=Object[_0x4cba97(0x1c9)](_0x129acc)[_0x4cba97(0x1f4)](_0x3fa594=>!MENU_SYNC_PARAM_KEYS[_0x4cba97(0x1f6)](_0x3fa594));if(_0x10b0a4['length']>0x0)throw new Error(_0x4cba97(0x204)+_0x10b0a4[_0x4cba97(0x1fd)](',\x20')+'.');for(const _0xfb197 of[_0x4cba97(0x1d9),_0x4cba97(0x205),'appName']){const _0x3fc4c2=_0x129acc[_0xfb197];if(_0x3fc4c2!==undefined&&(typeof _0x3fc4c2!==_0x4cba97(0x1f8)||_0x3fc4c2['trim']()===''))throw new Error(_0x4cba97(0x201)+_0xfb197+_0x4cba97(0x1c7));}if(_0x129acc['visible']!==undefined&&typeof _0x129acc[_0x4cba97(0x1e3)]!=='boolean')throw new Error(_0x4cba97(0x1e2));if(_0x129acc[_0x4cba97(0x1d4)]!==undefined&&(!Number['isInteger'](_0x129acc['parentId'])||_0x129acc['parentId']<0x0))throw new Error('Invalid\x20--params.parentId:\x20expected\x20a\x20non-negative\x20integer.');return{'jsUrl':typeof _0x129acc[_0x4cba97(0x1d9)]==='string'?_0x129acc[_0x4cba97(0x1d9)][_0x4cba97(0x203)]():undefined,'cssUrl':typeof _0x129acc['cssUrl']===_0x4cba97(0x1f8)?_0x129acc[_0x4cba97(0x205)][_0x4cba97(0x203)]():undefined,'appName':typeof _0x129acc['appName']===_0x4cba97(0x1f8)?_0x129acc[_0x4cba97(0x1f2)]['trim']():undefined,'visible':typeof _0x129acc[_0x4cba97(0x1e3)]===_0x4cba97(0x1e8)?_0x129acc[_0x4cba97(0x1e3)]:undefined,'parentId':typeof _0x129acc[_0x4cba97(0x1d4)]===_0x4cba97(0x1d1)?_0x129acc['parentId']:undefined};}
@@ -1 +1 @@
1
- function a186_0x3ce7(_0x4d5297,_0x4140eb){_0x4d5297=_0x4d5297-0xfe;const _0x21706e=a186_0x2170();let _0x3ce7c6=_0x21706e[_0x4d5297];return _0x3ce7c6;}(function(_0x59998e,_0x3203dc){const _0x20f5b1=a186_0x3ce7,_0x3062f6=_0x59998e();while(!![]){try{const _0x16874a=-parseInt(_0x20f5b1(0x111))/0x1*(parseInt(_0x20f5b1(0x140))/0x2)+-parseInt(_0x20f5b1(0x141))/0x3+-parseInt(_0x20f5b1(0x126))/0x4+parseInt(_0x20f5b1(0x13c))/0x5+parseInt(_0x20f5b1(0x10a))/0x6*(-parseInt(_0x20f5b1(0x142))/0x7)+parseInt(_0x20f5b1(0x12a))/0x8+parseInt(_0x20f5b1(0x11c))/0x9;if(_0x16874a===_0x3203dc)break;else _0x3062f6['push'](_0x3062f6['shift']());}catch(_0x193f1a){_0x3062f6['push'](_0x3062f6['shift']());}}}(a186_0x2170,0x1eb82));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 a186_0x2170(){const _0x5f5c4d=['1TMflnW','label','message','object','resources','loadScriptMode','rejected','menu\x20asset-update\x20requires\x20an\x20explicit\x20target:\x20pass\x20--all,\x20--menu-ids,\x20or\x20--paths.','\x20existing\x20JS\x20resources\x20for\x20\x22','Invalid\x20--mode:\x20','allSettled','5017608dxWAFo','Invalid\x20--params:\x20','JS\x20URL\x20is\x20unreachable:\x20','with\x20a\x20single\x20jsUrl.\x20Review\x20a\x20dry-run\x20and\x20use\x20--mode\x20replace\x20only\x20when\x20intentionally\x20rewriting\x20the\x20complete\x20resource\x20set.','dryRun','all','paths','--all\x20cannot\x20be\x20combined\x20with\x20--menu-ids\x20or\x20--paths.','cwd','menu\x20asset-update\x20will\x20remove\x20existing\x20CSS\x20resource\x20for\x20\x22','776832TQaRlM','has','menu\x20asset-update\x20cannot\x20patch\x20','Menu\x20asset\x20update\x20completed','383512auNUKH','jsUrl',').\x20','replace','\x20existing\x20CSS\x20resources\x20for\x20\x22','menu-asset-update','.js','extend','value','unshift','length','.\x20Allowed\x20values:\x20replace,\x20patch','map','with\x20a\x20single\x20cssUrl.\x20Review\x20a\x20dry-run\x20and\x20use\x20--mode\x20replace\x20only\x20when\x20intentionally\x20rewriting\x20the\x20complete\x20resource\x20set.','filter','setLogPath','Pass\x20--params\x20\x27{\x22jsUrl\x22:\x22https://...js\x22,\x22cssUrl\x22:\x22https://...css\x22}\x27\x20to\x20update\x20assets.','menuIds','122660LfLRJe','cssUrl','patch','push','301394fvilmE','378165JGfWpc','2611SGkDPn','isArray','toLowerCase','after','force','some','.css','CSS\x20URL\x20must\x20be\x20a\x20valid\x20https://...css\x20URL','status','endsWith','info','split','\x22\x20(','534SGSEPA','path','menu\x20asset-update\x20selectors\x20did\x20not\x20match\x20resource-bearing\x20menus:\x20','join','string','mode','fulfilled'];a186_0x2170=function(){return _0x5f5c4d;};return a186_0x2170();}function validateParams(_0x2c3881){const _0x1bdac0=a186_0x3ce7,_0x200715=[];return _0x2c3881[_0x1bdac0(0x12b)]&&!isValidJsHttpsUrl(_0x2c3881[_0x1bdac0(0x12b)])&&_0x200715[_0x1bdac0(0x13f)]({'field':_0x1bdac0(0x12b),'message':'JS\x20URL\x20must\x20be\x20a\x20valid\x20https://...js\x20URL'}),_0x2c3881[_0x1bdac0(0x13d)]&&!isValidCssHttpsUrl(_0x2c3881['cssUrl'])&&_0x200715[_0x1bdac0(0x13f)]({'field':_0x1bdac0(0x13d),'message':_0x1bdac0(0x104)}),_0x200715;}export async function runMenuUpdateCore(_0x2373ed,_0x3b30bf,_0x29152d,_0x1adf05={}){const _0x58111d=a186_0x3ce7,_0x1fdc2c=parseUpdateParamsFlag(_0x29152d),_0x112295=normalizeMode(_0x1adf05[_0x58111d(0x10f)]);validateSelection(_0x1adf05['selection']);const _0x112322=[];if(_0x1fdc2c[_0x58111d(0x12b)])_0x112322[_0x58111d(0x13f)](_0x1fdc2c[_0x58111d(0x12b)]);if(_0x1fdc2c[_0x58111d(0x13d)])_0x112322[_0x58111d(0x13f)](_0x1fdc2c[_0x58111d(0x13d)]);const _0x3f1524=validateParams(_0x1fdc2c);if(_0x3f1524[_0x58111d(0x134)]>0x0){const _0x5d0574=_0x3f1524[_0x58111d(0x136)](_0x3897e0=>'--params.'+_0x3897e0['field']+':\x20'+_0x3897e0[_0x58111d(0x113)])[_0x58111d(0x10d)](';\x20');throw new Error(_0x58111d(0x11d)+_0x5d0574);}if(_0x112322[_0x58111d(0x134)]===0x0)throw new Error('Invalid\x20--params:\x20menu\x20asset-update\x20requires\x20at\x20least\x20one\x20explicit\x20JS/CSS\x20URL.\x20'+_0x58111d(0x13a));logger[_0x58111d(0x139)](process[_0x58111d(0x124)]()),logger[_0x58111d(0x107)](_0x58111d(0x12f),'Start\x20non-interactive\x20menu\x20asset\x20update',{'appCode':_0x2373ed,'jsUrl':_0x1fdc2c[_0x58111d(0x12b)],'cssUrl':_0x1fdc2c['cssUrl'],'mode':_0x112295,'dryRun':_0x1adf05[_0x58111d(0x120)]===!![]});if(_0x1fdc2c['jsUrl']){const _0x214891=await isUrlReachable(_0x1fdc2c[_0x58111d(0x12b)]);if(!_0x214891)throw new Error(_0x58111d(0x11e)+_0x1fdc2c[_0x58111d(0x12b)]);}if(_0x1fdc2c[_0x58111d(0x13d)]){const _0x4ce3b6=await isUrlReachable(_0x1fdc2c[_0x58111d(0x13d)]);if(!_0x4ce3b6)throw new Error('CSS\x20URL\x20is\x20unreachable:\x20'+_0x1fdc2c[_0x58111d(0x13d)]);}const _0x66ec99=await getOnlineMenuList(_0x2373ed,_0x3b30bf),_0x375563=_0x66ec99[_0x58111d(0x138)](_0x34f6ff=>_0x34f6ff['resources'][_0x58111d(0x134)]>0x0),_0x6c4d22=selectMenusForUpdate(_0x375563,_0x1adf05['selection']);if(_0x6c4d22[_0x58111d(0x134)]===0x0)return{'updated':0x0,'failed':0x0,'skipped':!![],'dryRun':_0x1adf05[_0x58111d(0x120)]===!![]};const _0x14fa6b=_0x6c4d22[_0x58111d(0x136)](_0x1ed109=>buildMenuUpdateDiff(_0x1ed109,_0x1fdc2c,_0x112295,_0x1adf05[_0x58111d(0x101)]===!![],_0x1adf05[_0x58111d(0x116)]));if(_0x1adf05[_0x58111d(0x120)])return{'updated':0x0,'failed':0x0,'skipped':![],'dryRun':!![],'diffs':_0x14fa6b};const _0x5f5b0b=await Promise[_0x58111d(0x11b)](_0x6c4d22[_0x58111d(0x136)]((_0x3aa355,_0x4648c9)=>updateMenuCdnUrl(_0x2373ed,_0x3b30bf,{'id':_0x3aa355['id'],'label':_0x3aa355[_0x58111d(0x112)],'path':_0x3aa355[_0x58111d(0x10b)],'resources':_0x14fa6b[_0x4648c9][_0x58111d(0x100)][_0x58111d(0x115)],'extend':_0x3aa355['extend']??null,'loadScriptMode':_0x1adf05[_0x58111d(0x116)]}))),_0x385094=_0x5f5b0b[_0x58111d(0x138)](_0x224cd7=>_0x224cd7[_0x58111d(0x105)]===_0x58111d(0x110))[_0x58111d(0x136)](_0x344730=>_0x344730[_0x58111d(0x132)]),_0x42f35d=_0x5f5b0b[_0x58111d(0x138)](_0x57b9a7=>_0x57b9a7['status']===_0x58111d(0x117))[_0x58111d(0x134)];return logger[_0x58111d(0x107)](_0x58111d(0x12f),_0x58111d(0x129),{'count':_0x6c4d22[_0x58111d(0x134)],'resources':_0x112322}),{'updated':_0x385094['length'],'failed':_0x42f35d,'skipped':![],'menus':_0x385094};}function validateSelection(_0x470352){const _0x2f346f=a186_0x3ce7;if(!_0x470352)throw new Error(_0x2f346f(0x118));if(_0x470352[_0x2f346f(0x121)]&&(_0x470352['menuIds']['length']>0x0||_0x470352[_0x2f346f(0x122)]['length']>0x0))throw new Error(_0x2f346f(0x123));if(!_0x470352[_0x2f346f(0x121)]&&_0x470352['menuIds'][_0x2f346f(0x134)]===0x0&&_0x470352[_0x2f346f(0x122)][_0x2f346f(0x134)]===0x0)throw new Error('menu\x20asset-update\x20requires\x20an\x20explicit\x20target:\x20pass\x20--all,\x20--menu-ids,\x20or\x20--paths.');}export function selectMenusForUpdate(_0xac7744,_0xd69a12){const _0x3cb9ca=a186_0x3ce7;validateSelection(_0xd69a12);if(_0xd69a12[_0x3cb9ca(0x121)])return _0xac7744;const _0x518310=new Set(_0xac7744[_0x3cb9ca(0x136)](_0x56ede5=>_0x56ede5['id'])),_0x424033=new Set(_0xac7744[_0x3cb9ca(0x136)](_0x31f101=>_0x31f101[_0x3cb9ca(0x10b)])),_0x28fc5a=_0xd69a12[_0x3cb9ca(0x13b)][_0x3cb9ca(0x138)](_0x1f50bd=>!_0x518310[_0x3cb9ca(0x127)](_0x1f50bd)),_0x3de860=_0xd69a12[_0x3cb9ca(0x122)][_0x3cb9ca(0x138)](_0x11b9bf=>!_0x424033['has'](_0x11b9bf));if(_0x28fc5a['length']>0x0||_0x3de860['length']>0x0){const _0x249811=[..._0x28fc5a['map'](_0x504a41=>String(_0x504a41)),..._0x3de860]['join'](',\x20');throw new Error(_0x3cb9ca(0x10c)+_0x249811);}const _0x4b6abd=new Set(_0xd69a12[_0x3cb9ca(0x13b)]),_0x1179e5=new Set(_0xd69a12[_0x3cb9ca(0x122)]);return _0xac7744[_0x3cb9ca(0x138)](_0x3120b2=>_0x4b6abd[_0x3cb9ca(0x127)](_0x3120b2['id'])||_0x1179e5[_0x3cb9ca(0x127)](_0x3120b2[_0x3cb9ca(0x10b)]));}function normalizeMode(_0x362439){const _0xa2c75a=a186_0x3ce7;if(!_0x362439)return'patch';if(_0x362439===_0xa2c75a(0x12d)||_0x362439==='patch')return _0x362439;throw new Error(_0xa2c75a(0x11a)+_0x362439+_0xa2c75a(0x135));}function buildMenuUpdateDiff(_0x5f466d,_0x359e26,_0x8a4708,_0x253ab1,_0x3c4c38){const _0x11c8c8=a186_0x3ce7,_0x322fa2=[..._0x5f466d['resources']];_0x8a4708===_0x11c8c8(0x13e)&&assertUnambiguousPatchResources(_0x5f466d,_0x322fa2,_0x359e26);const _0x3acd96=_0x8a4708===_0x11c8c8(0x13e)?patchResources(_0x322fa2,_0x359e26):replaceResources(_0x359e26),_0x1fa329=[],_0xe2df3f=_0x322fa2[_0x11c8c8(0x102)](isJsResource),_0x4eca53=_0x3acd96['some'](isJsResource);if(_0xe2df3f&&!_0x4eca53){const _0x27be43='menu\x20asset-update\x20would\x20remove\x20existing\x20JS\x20resource\x20for\x20\x22'+_0x5f466d['label']+_0x11c8c8(0x109)+_0x5f466d[_0x11c8c8(0x10b)]+_0x11c8c8(0x12c)+'Use\x20--mode\x20patch\x20to\x20preserve\x20it,\x20pass\x20jsUrl,\x20or\x20add\x20--force\x20for\x20an\x20intentional\x20removal.';if(!_0x253ab1)throw new Error(_0x27be43);_0x1fa329['push'](_0x27be43);}const _0x512e7a=_0x322fa2[_0x11c8c8(0x102)](isCssResource),_0x9b4492=_0x3acd96[_0x11c8c8(0x102)](isCssResource);_0x512e7a&&!_0x9b4492&&_0x1fa329[_0x11c8c8(0x13f)](_0x11c8c8(0x125)+_0x5f466d[_0x11c8c8(0x112)]+_0x11c8c8(0x109)+_0x5f466d[_0x11c8c8(0x10b)]+').');const _0xabcc6a=typeof _0x5f466d[_0x11c8c8(0x131)]?.[_0x11c8c8(0x116)]===_0x11c8c8(0x10e)?_0x5f466d['extend'][_0x11c8c8(0x116)]:null,_0x2807c5=_0x3c4c38?{'loadScriptMode':_0xabcc6a}:{},_0x1bb5e9=_0x3c4c38?{'loadScriptMode':_0x3c4c38}:{};return{'id':_0x5f466d['id'],'label':_0x5f466d[_0x11c8c8(0x112)],'path':_0x5f466d[_0x11c8c8(0x10b)],'mode':_0x8a4708,'before':{'resources':_0x322fa2,..._0x2807c5},'after':{'resources':_0x3acd96,..._0x1bb5e9},'warnings':_0x1fa329};}function replaceResources(_0x50dde9){const _0x2c66dc=a186_0x3ce7;return[_0x50dde9[_0x2c66dc(0x12b)],_0x50dde9[_0x2c66dc(0x13d)]][_0x2c66dc(0x138)](_0xa37405=>!!_0xa37405);}function assertUnambiguousPatchResources(_0x5add04,_0x588621,_0x292444){const _0x2db011=a186_0x3ce7,_0x538f57=_0x588621[_0x2db011(0x138)](isJsResource)[_0x2db011(0x134)];if(_0x292444['jsUrl']&&_0x538f57>0x1)throw new Error(_0x2db011(0x128)+_0x538f57+_0x2db011(0x119)+_0x5add04[_0x2db011(0x112)]+_0x2db011(0x109)+_0x5add04[_0x2db011(0x10b)]+')\x20'+_0x2db011(0x11f));const _0x4c2666=_0x588621[_0x2db011(0x138)](isCssResource)[_0x2db011(0x134)];if(_0x292444[_0x2db011(0x13d)]&&_0x4c2666>0x1)throw new Error('menu\x20asset-update\x20cannot\x20patch\x20'+_0x4c2666+_0x2db011(0x12e)+_0x5add04[_0x2db011(0x112)]+_0x2db011(0x109)+_0x5add04[_0x2db011(0x10b)]+')\x20'+_0x2db011(0x137));}function patchResources(_0x471a81,_0x2527c6){const _0xec27d0=a186_0x3ce7;let _0x5b0426=![],_0x17cc20=![];const _0x3adc05=[];for(const _0x1d2399 of _0x471a81){if(isJsResource(_0x1d2399)){if(_0x2527c6[_0xec27d0(0x12b)]&&!_0x5b0426)_0x3adc05[_0xec27d0(0x13f)](_0x2527c6[_0xec27d0(0x12b)]),_0x5b0426=!![];else!_0x2527c6[_0xec27d0(0x12b)]&&_0x3adc05['push'](_0x1d2399);continue;}if(isCssResource(_0x1d2399)){if(_0x2527c6['cssUrl']&&!_0x17cc20)_0x3adc05[_0xec27d0(0x13f)](_0x2527c6[_0xec27d0(0x13d)]),_0x17cc20=!![];else!_0x2527c6[_0xec27d0(0x13d)]&&_0x3adc05['push'](_0x1d2399);continue;}_0x3adc05['push'](_0x1d2399);}return _0x2527c6[_0xec27d0(0x12b)]&&!_0x5b0426&&_0x3adc05[_0xec27d0(0x133)](_0x2527c6[_0xec27d0(0x12b)]),_0x2527c6[_0xec27d0(0x13d)]&&!_0x17cc20&&_0x3adc05[_0xec27d0(0x13f)](_0x2527c6[_0xec27d0(0x13d)]),_0x3adc05;}function isJsResource(_0x2e0bf5){const _0x165651=a186_0x3ce7;return stripQuery(_0x2e0bf5)[_0x165651(0xff)]()[_0x165651(0x106)](_0x165651(0x130));}function isCssResource(_0x41dbd9){const _0x109f1b=a186_0x3ce7;return stripQuery(_0x41dbd9)[_0x109f1b(0xff)]()[_0x109f1b(0x106)](_0x109f1b(0x103));}function stripQuery(_0x275099){const _0x575202=a186_0x3ce7;return _0x275099[_0x575202(0x108)]('?')[0x0]??_0x275099;}function parseUpdateParamsFlag(_0xc76040){const _0x40caa8=a186_0x3ce7;if(!_0xc76040||typeof _0xc76040!=='string')return{};try{const _0x5ab361=JSON['parse'](_0xc76040);if(typeof _0x5ab361!==_0x40caa8(0x114)||_0x5ab361===null||Array[_0x40caa8(0xfe)](_0x5ab361))return{};return{'jsUrl':typeof _0x5ab361[_0x40caa8(0x12b)]==='string'?_0x5ab361['jsUrl']['trim']():undefined,'cssUrl':typeof _0x5ab361[_0x40caa8(0x13d)]===_0x40caa8(0x10e)?_0x5ab361[_0x40caa8(0x13d)]['trim']():undefined};}catch{return{};}}
1
+ (function(_0x85f7cc,_0x14820c){const _0x1bb8ee=a186_0x3c67,_0x1700e6=_0x85f7cc();while(!![]){try{const _0x316af0=parseInt(_0x1bb8ee(0x132))/0x1+-parseInt(_0x1bb8ee(0x128))/0x2*(-parseInt(_0x1bb8ee(0xf5))/0x3)+parseInt(_0x1bb8ee(0x113))/0x4*(-parseInt(_0x1bb8ee(0xfa))/0x5)+parseInt(_0x1bb8ee(0x11e))/0x6+-parseInt(_0x1bb8ee(0xfc))/0x7*(parseInt(_0x1bb8ee(0x133))/0x8)+-parseInt(_0x1bb8ee(0x134))/0x9+-parseInt(_0x1bb8ee(0x136))/0xa*(-parseInt(_0x1bb8ee(0x12e))/0xb);if(_0x316af0===_0x14820c)break;else _0x1700e6['push'](_0x1700e6['shift']());}catch(_0x359994){_0x1700e6['push'](_0x1700e6['shift']());}}}(a186_0x3687,0xee88b));import{updateMenuCdnUrl,getOnlineMenuList}from'../../../commands/menu/shared/service.js';import{isUrlReachable,isValidCssHttpsUrl,isValidJsHttpsUrl}from'../../../commands/menu/shared/valid-url.js';function a186_0x3687(){const _0x4f11f1=['--params.','label','allSettled','object','7692016KpmHuM','filter','rejected','extend',').\x20','Start\x20non-interactive\x20menu\x20asset\x20update','path','unshift','paths','replace','Invalid\x20--params:\x20','3858168yiRABS','cssUrl','force','resources','menu\x20asset-update\x20requires\x20an\x20explicit\x20target:\x20pass\x20--all,\x20--menu-ids,\x20or\x20--paths.','loadScriptMode','map','info','push','\x20existing\x20JS\x20resources\x20for\x20\x22','122tgzVsD','fulfilled','menu\x20asset-update\x20would\x20remove\x20existing\x20JS\x20resource\x20for\x20\x22','jsUrl','menuIds','has','18946103sbVrjg','string','setLogPath','.\x20Allowed\x20values:\x20replace,\x20patch','1642946wDcdaE','8ZpHmgD','2661912vUwMOg','dryRun','10YKCuvf','selection','menu-asset-update','patch','length','some','9543FujLhO','menu\x20asset-update\x20cannot\x20patch\x20','Pass\x20--params\x20\x27{\x22jsUrl\x22:\x22https://...js\x22,\x22cssUrl\x22:\x22https://...css\x22}\x27\x20to\x20update\x20assets.','menu\x20asset-update\x20will\x20remove\x20existing\x20CSS\x20resource\x20for\x20\x22','split','5eSrXZU','value','7046067saiJau','JS\x20URL\x20is\x20unreachable:\x20','\x22\x20(','isArray','.js','Invalid\x20--params:\x20menu\x20asset-update\x20requires\x20at\x20least\x20one\x20explicit\x20JS/CSS\x20URL.\x20','toLowerCase','endsWith','CSS\x20URL\x20is\x20unreachable:\x20','.css','join','cwd','JS\x20URL\x20must\x20be\x20a\x20valid\x20https://...js\x20URL','all','trim','status','Menu\x20asset\x20update\x20completed','CSS\x20URL\x20must\x20be\x20a\x20valid\x20https://...css\x20URL','menu\x20asset-update\x20selectors\x20did\x20not\x20match\x20resource-bearing\x20menus:\x20'];a186_0x3687=function(){return _0x4f11f1;};return a186_0x3687();}import{logger}from'../../../utils/logger.js';function validateParams(_0x14c39d){const _0xb556de=a186_0x3c67,_0x32b630=[];return _0x14c39d[_0xb556de(0x12b)]&&!isValidJsHttpsUrl(_0x14c39d[_0xb556de(0x12b)])&&_0x32b630[_0xb556de(0x126)]({'field':'jsUrl','message':_0xb556de(0x108)}),_0x14c39d[_0xb556de(0x11f)]&&!isValidCssHttpsUrl(_0x14c39d['cssUrl'])&&_0x32b630[_0xb556de(0x126)]({'field':_0xb556de(0x11f),'message':_0xb556de(0x10d)}),_0x32b630;}export async function runMenuUpdateCore(_0x4fc6aa,_0x3704d3,_0x3d671f,_0x467762={}){const _0x46dc47=a186_0x3c67,_0x3bd4f4=parseUpdateParamsFlag(_0x3d671f),_0x2b2213=normalizeMode(_0x467762['mode']);validateSelection(_0x467762[_0x46dc47(0x137)]);const _0x9f9d79=[];if(_0x3bd4f4[_0x46dc47(0x12b)])_0x9f9d79[_0x46dc47(0x126)](_0x3bd4f4['jsUrl']);if(_0x3bd4f4[_0x46dc47(0x11f)])_0x9f9d79['push'](_0x3bd4f4[_0x46dc47(0x11f)]);const _0x2aea7f=validateParams(_0x3bd4f4);if(_0x2aea7f['length']>0x0){const _0x5ac236=_0x2aea7f[_0x46dc47(0x124)](_0x27064f=>_0x46dc47(0x10f)+_0x27064f['field']+':\x20'+_0x27064f['message'])[_0x46dc47(0x106)](';\x20');throw new Error(_0x46dc47(0x11d)+_0x5ac236);}if(_0x9f9d79[_0x46dc47(0xf3)]===0x0)throw new Error(_0x46dc47(0x101)+_0x46dc47(0xf7));logger[_0x46dc47(0x130)](process[_0x46dc47(0x107)]()),logger[_0x46dc47(0x125)]('menu-asset-update',_0x46dc47(0x118),{'appCode':_0x4fc6aa,'jsUrl':_0x3bd4f4[_0x46dc47(0x12b)],'cssUrl':_0x3bd4f4[_0x46dc47(0x11f)],'mode':_0x2b2213,'dryRun':_0x467762[_0x46dc47(0x135)]===!![]});if(_0x3bd4f4[_0x46dc47(0x12b)]){const _0xaec58f=await isUrlReachable(_0x3bd4f4[_0x46dc47(0x12b)]);if(!_0xaec58f)throw new Error(_0x46dc47(0xfd)+_0x3bd4f4[_0x46dc47(0x12b)]);}if(_0x3bd4f4[_0x46dc47(0x11f)]){const _0x10793f=await isUrlReachable(_0x3bd4f4[_0x46dc47(0x11f)]);if(!_0x10793f)throw new Error(_0x46dc47(0x104)+_0x3bd4f4[_0x46dc47(0x11f)]);}const _0x15445b=await getOnlineMenuList(_0x4fc6aa,_0x3704d3),_0x2b3bf2=_0x15445b[_0x46dc47(0x114)](_0x56728a=>_0x56728a[_0x46dc47(0x121)][_0x46dc47(0xf3)]>0x0),_0x4cb4e9=selectMenusForUpdate(_0x2b3bf2,_0x467762['selection']);if(_0x4cb4e9[_0x46dc47(0xf3)]===0x0)return{'updated':0x0,'failed':0x0,'skipped':!![],'dryRun':_0x467762['dryRun']===!![]};const _0x4763cb=_0x4cb4e9[_0x46dc47(0x124)](_0x588055=>buildMenuUpdateDiff(_0x588055,_0x3bd4f4,_0x2b2213,_0x467762[_0x46dc47(0x120)]===!![],_0x467762[_0x46dc47(0x123)]));if(_0x467762[_0x46dc47(0x135)])return{'updated':0x0,'failed':0x0,'skipped':![],'dryRun':!![],'diffs':_0x4763cb};const _0x331b30=await Promise[_0x46dc47(0x111)](_0x4cb4e9[_0x46dc47(0x124)]((_0x54175d,_0x59f880)=>updateMenuCdnUrl(_0x4fc6aa,_0x3704d3,{'id':_0x54175d['id'],'label':_0x54175d['label'],'path':_0x54175d[_0x46dc47(0x119)],'resources':_0x4763cb[_0x59f880]['after'][_0x46dc47(0x121)],'extend':_0x54175d['extend']??null,'loadScriptMode':_0x467762[_0x46dc47(0x123)]}))),_0x141156=_0x331b30[_0x46dc47(0x114)](_0x38a228=>_0x38a228[_0x46dc47(0x10b)]===_0x46dc47(0x129))[_0x46dc47(0x124)](_0x35fca5=>_0x35fca5[_0x46dc47(0xfb)]),_0x188281=_0x331b30[_0x46dc47(0x114)](_0x994723=>_0x994723[_0x46dc47(0x10b)]===_0x46dc47(0x115))['length'];return logger[_0x46dc47(0x125)](_0x46dc47(0xf1),_0x46dc47(0x10c),{'count':_0x4cb4e9[_0x46dc47(0xf3)],'resources':_0x9f9d79}),{'updated':_0x141156['length'],'failed':_0x188281,'skipped':![],'menus':_0x141156};}function validateSelection(_0x4fa7c5){const _0x320614=a186_0x3c67;if(!_0x4fa7c5)throw new Error(_0x320614(0x122));if(_0x4fa7c5[_0x320614(0x109)]&&(_0x4fa7c5[_0x320614(0x12c)]['length']>0x0||_0x4fa7c5[_0x320614(0x11b)][_0x320614(0xf3)]>0x0))throw new Error('--all\x20cannot\x20be\x20combined\x20with\x20--menu-ids\x20or\x20--paths.');if(!_0x4fa7c5[_0x320614(0x109)]&&_0x4fa7c5[_0x320614(0x12c)][_0x320614(0xf3)]===0x0&&_0x4fa7c5[_0x320614(0x11b)][_0x320614(0xf3)]===0x0)throw new Error(_0x320614(0x122));}export function selectMenusForUpdate(_0x530694,_0x4bdbf5){const _0x4eeb8d=a186_0x3c67;validateSelection(_0x4bdbf5);if(_0x4bdbf5[_0x4eeb8d(0x109)])return _0x530694;const _0x593c16=new Set(_0x530694[_0x4eeb8d(0x124)](_0x2b2c66=>_0x2b2c66['id'])),_0x57c84a=new Set(_0x530694[_0x4eeb8d(0x124)](_0x1cd4b3=>_0x1cd4b3[_0x4eeb8d(0x119)])),_0xc900=_0x4bdbf5[_0x4eeb8d(0x12c)][_0x4eeb8d(0x114)](_0x16f7fc=>!_0x593c16[_0x4eeb8d(0x12d)](_0x16f7fc)),_0x228034=_0x4bdbf5['paths']['filter'](_0x2bcaab=>!_0x57c84a[_0x4eeb8d(0x12d)](_0x2bcaab));if(_0xc900[_0x4eeb8d(0xf3)]>0x0||_0x228034[_0x4eeb8d(0xf3)]>0x0){const _0x258dab=[..._0xc900[_0x4eeb8d(0x124)](_0x22ceed=>String(_0x22ceed)),..._0x228034][_0x4eeb8d(0x106)](',\x20');throw new Error(_0x4eeb8d(0x10e)+_0x258dab);}const _0xc4fe6f=new Set(_0x4bdbf5[_0x4eeb8d(0x12c)]),_0x500369=new Set(_0x4bdbf5[_0x4eeb8d(0x11b)]);return _0x530694[_0x4eeb8d(0x114)](_0x6906a7=>_0xc4fe6f[_0x4eeb8d(0x12d)](_0x6906a7['id'])||_0x500369[_0x4eeb8d(0x12d)](_0x6906a7[_0x4eeb8d(0x119)]));}function normalizeMode(_0x2a0b10){const _0x40b7=a186_0x3c67;if(!_0x2a0b10)return _0x40b7(0xf2);if(_0x2a0b10===_0x40b7(0x11c)||_0x2a0b10==='patch')return _0x2a0b10;throw new Error('Invalid\x20--mode:\x20'+_0x2a0b10+_0x40b7(0x131));}function buildMenuUpdateDiff(_0x5bd693,_0x564ae4,_0x2e7af1,_0x3e54c6,_0xef35d6){const _0x5d926d=a186_0x3c67,_0x2b81cb=[..._0x5bd693['resources']];_0x2e7af1===_0x5d926d(0xf2)&&assertUnambiguousPatchResources(_0x5bd693,_0x2b81cb,_0x564ae4);const _0x2b24d5=_0x2e7af1===_0x5d926d(0xf2)?patchResources(_0x2b81cb,_0x564ae4):replaceResources(_0x564ae4),_0x44acab=[],_0x50e0b0=_0x2b81cb[_0x5d926d(0xf4)](isJsResource),_0x2cb802=_0x2b24d5[_0x5d926d(0xf4)](isJsResource);if(_0x50e0b0&&!_0x2cb802){const _0xcc5283=_0x5d926d(0x12a)+_0x5bd693[_0x5d926d(0x110)]+_0x5d926d(0xfe)+_0x5bd693[_0x5d926d(0x119)]+_0x5d926d(0x117)+'Use\x20--mode\x20patch\x20to\x20preserve\x20it,\x20pass\x20jsUrl,\x20or\x20add\x20--force\x20for\x20an\x20intentional\x20removal.';if(!_0x3e54c6)throw new Error(_0xcc5283);_0x44acab[_0x5d926d(0x126)](_0xcc5283);}const _0x36ffb1=_0x2b81cb['some'](isCssResource),_0x22daf=_0x2b24d5['some'](isCssResource);_0x36ffb1&&!_0x22daf&&_0x44acab[_0x5d926d(0x126)](_0x5d926d(0xf8)+_0x5bd693[_0x5d926d(0x110)]+_0x5d926d(0xfe)+_0x5bd693[_0x5d926d(0x119)]+').');const _0x2a269d=typeof _0x5bd693[_0x5d926d(0x116)]?.['loadScriptMode']===_0x5d926d(0x12f)?_0x5bd693[_0x5d926d(0x116)][_0x5d926d(0x123)]:null,_0x3c5448=_0xef35d6?{'loadScriptMode':_0x2a269d}:{},_0x522e0a=_0xef35d6?{'loadScriptMode':_0xef35d6}:{};return{'id':_0x5bd693['id'],'label':_0x5bd693['label'],'path':_0x5bd693[_0x5d926d(0x119)],'mode':_0x2e7af1,'before':{'resources':_0x2b81cb,..._0x3c5448},'after':{'resources':_0x2b24d5,..._0x522e0a},'warnings':_0x44acab};}function replaceResources(_0x54a274){const _0x29eff0=a186_0x3c67;return[_0x54a274[_0x29eff0(0x12b)],_0x54a274[_0x29eff0(0x11f)]][_0x29eff0(0x114)](_0x5ca0a5=>!!_0x5ca0a5);}function assertUnambiguousPatchResources(_0xad779c,_0x3372fd,_0x21d8e7){const _0x15f7e4=a186_0x3c67,_0xbc3ce2=_0x3372fd[_0x15f7e4(0x114)](isJsResource)['length'];if(_0x21d8e7[_0x15f7e4(0x12b)]&&_0xbc3ce2>0x1)throw new Error(_0x15f7e4(0xf6)+_0xbc3ce2+_0x15f7e4(0x127)+_0xad779c[_0x15f7e4(0x110)]+_0x15f7e4(0xfe)+_0xad779c[_0x15f7e4(0x119)]+')\x20'+'with\x20a\x20single\x20jsUrl.\x20Review\x20a\x20dry-run\x20and\x20use\x20--mode\x20replace\x20only\x20when\x20intentionally\x20rewriting\x20the\x20complete\x20resource\x20set.');const _0x5088ea=_0x3372fd[_0x15f7e4(0x114)](isCssResource)[_0x15f7e4(0xf3)];if(_0x21d8e7['cssUrl']&&_0x5088ea>0x1)throw new Error(_0x15f7e4(0xf6)+_0x5088ea+'\x20existing\x20CSS\x20resources\x20for\x20\x22'+_0xad779c[_0x15f7e4(0x110)]+_0x15f7e4(0xfe)+_0xad779c['path']+')\x20'+'with\x20a\x20single\x20cssUrl.\x20Review\x20a\x20dry-run\x20and\x20use\x20--mode\x20replace\x20only\x20when\x20intentionally\x20rewriting\x20the\x20complete\x20resource\x20set.');}function a186_0x3c67(_0x4d37a6,_0x50a039){_0x4d37a6=_0x4d37a6-0xf1;const _0x36878e=a186_0x3687();let _0x3c6729=_0x36878e[_0x4d37a6];return _0x3c6729;}function patchResources(_0x58b03a,_0x5bc065){const _0x1d48dd=a186_0x3c67;let _0x35a459=![],_0x1983c4=![];const _0x4183ab=[];for(const _0x567806 of _0x58b03a){if(isJsResource(_0x567806)){if(_0x5bc065['jsUrl']&&!_0x35a459)_0x4183ab['push'](_0x5bc065['jsUrl']),_0x35a459=!![];else!_0x5bc065[_0x1d48dd(0x12b)]&&_0x4183ab[_0x1d48dd(0x126)](_0x567806);continue;}if(isCssResource(_0x567806)){if(_0x5bc065[_0x1d48dd(0x11f)]&&!_0x1983c4)_0x4183ab[_0x1d48dd(0x126)](_0x5bc065[_0x1d48dd(0x11f)]),_0x1983c4=!![];else!_0x5bc065['cssUrl']&&_0x4183ab[_0x1d48dd(0x126)](_0x567806);continue;}_0x4183ab[_0x1d48dd(0x126)](_0x567806);}return _0x5bc065[_0x1d48dd(0x12b)]&&!_0x35a459&&_0x4183ab[_0x1d48dd(0x11a)](_0x5bc065[_0x1d48dd(0x12b)]),_0x5bc065[_0x1d48dd(0x11f)]&&!_0x1983c4&&_0x4183ab[_0x1d48dd(0x126)](_0x5bc065[_0x1d48dd(0x11f)]),_0x4183ab;}function isJsResource(_0x43de53){const _0x4aad55=a186_0x3c67;return stripQuery(_0x43de53)[_0x4aad55(0x102)]()[_0x4aad55(0x103)](_0x4aad55(0x100));}function isCssResource(_0xea53e8){const _0x4f3c41=a186_0x3c67;return stripQuery(_0xea53e8)['toLowerCase']()[_0x4f3c41(0x103)](_0x4f3c41(0x105));}function stripQuery(_0x3c89e5){const _0x2f72be=a186_0x3c67;return _0x3c89e5[_0x2f72be(0xf9)]('?')[0x0]??_0x3c89e5;}function parseUpdateParamsFlag(_0x24a780){const _0x177119=a186_0x3c67;if(!_0x24a780||typeof _0x24a780!==_0x177119(0x12f))return{};try{const _0x3d34e5=JSON['parse'](_0x24a780);if(typeof _0x3d34e5!==_0x177119(0x112)||_0x3d34e5===null||Array[_0x177119(0xff)](_0x3d34e5))return{};return{'jsUrl':typeof _0x3d34e5[_0x177119(0x12b)]==='string'?_0x3d34e5[_0x177119(0x12b)][_0x177119(0x10a)]():undefined,'cssUrl':typeof _0x3d34e5[_0x177119(0x11f)]===_0x177119(0x12f)?_0x3d34e5['cssUrl']['trim']():undefined};}catch{return{};}}
@@ -1 +1 @@
1
- function a187_0x20bf(_0x2373c4,_0x134e6d){_0x2373c4=_0x2373c4-0x10b;const _0x1a116a=a187_0x1a11();let _0x20bfd0=_0x1a116a[_0x2373c4];return _0x20bfd0;}function a187_0x1a11(){const _0x4a9877=['2073510vhjsFt','GET','406940EPvzOM','6JcqWax','1YTyImH','3509231SdHeOe','cancel','1094578QsoNvD','133648uIcMLp','170HbmTNf','8BZTrLb','4618523jLJidS','test','7016391DwZRmm','body','HEAD'];a187_0x1a11=function(){return _0x4a9877;};return a187_0x1a11();}(function(_0x563ce4,_0x27f9a3){const _0x1dbb0b=a187_0x20bf,_0x3672d9=_0x563ce4();while(!![]){try{const _0x518581=-parseInt(_0x1dbb0b(0x113))/0x1*(-parseInt(_0x1dbb0b(0x116))/0x2)+parseInt(_0x1dbb0b(0x10f))/0x3+parseInt(_0x1dbb0b(0x117))/0x4*(-parseInt(_0x1dbb0b(0x118))/0x5)+parseInt(_0x1dbb0b(0x112))/0x6*(-parseInt(_0x1dbb0b(0x11a))/0x7)+-parseInt(_0x1dbb0b(0x119))/0x8*(-parseInt(_0x1dbb0b(0x10c))/0x9)+parseInt(_0x1dbb0b(0x111))/0xa+parseInt(_0x1dbb0b(0x114))/0xb;if(_0x518581===_0x27f9a3)break;else _0x3672d9['push'](_0x3672d9['shift']());}catch(_0x87a286){_0x3672d9['push'](_0x3672d9['shift']());}}}(a187_0x1a11,0x8e158));export function isValidJsHttpsUrl(_0xb9de1){const _0x4fed6d=a187_0x20bf;return/^https:\/\/.+\.js(\?.*)?$/[_0x4fed6d(0x10b)](_0xb9de1['trim']());}export function isValidCssHttpsUrl(_0x195903){const _0x216ece=a187_0x20bf;return/^https:\/\/.+\.css(\?.*)?$/[_0x216ece(0x10b)](_0x195903['trim']());}export async function isUrlReachable(_0x13f71b){const _0x91be79=a187_0x20bf;try{const _0x49c501=await fetch(_0x13f71b,{'method':_0x91be79(0x10e)});if(_0x49c501['ok'])return!![];}catch{}try{const _0x152705=await fetch(_0x13f71b,{'method':_0x91be79(0x110),'headers':{'Range':'bytes=0-0'}}),_0x1904a7=_0x152705['ok'];try{await _0x152705[_0x91be79(0x10d)]?.[_0x91be79(0x115)]();}catch{}return _0x1904a7;}catch{return![];}}
1
+ function a187_0x2a37(){const _0x3bd7b9=['8907708uKYPWI','105BqbCLQ','cancel','6936076bAzHVd','796416xpUDag','84GYdEsG','trim','47095umoHdP','bytes=0-0','123306EKWBpg','32480874fyHQgX','test','1037464TlaWLd','body'];a187_0x2a37=function(){return _0x3bd7b9;};return a187_0x2a37();}(function(_0x6db91,_0x43a0c2){const _0x19bdbc=a187_0x28ee,_0x16ad57=_0x6db91();while(!![]){try{const _0x32397d=parseInt(_0x19bdbc(0xf4))/0x1+-parseInt(_0x19bdbc(0xf1))/0x2*(-parseInt(_0x19bdbc(0xed))/0x3)+parseInt(_0x19bdbc(0xeb))/0x4+parseInt(_0x19bdbc(0xef))/0x5+-parseInt(_0x19bdbc(0xf6))/0x6+-parseInt(_0x19bdbc(0xf7))/0x7*(-parseInt(_0x19bdbc(0xec))/0x8)+-parseInt(_0x19bdbc(0xf2))/0x9;if(_0x32397d===_0x43a0c2)break;else _0x16ad57['push'](_0x16ad57['shift']());}catch(_0x511a32){_0x16ad57['push'](_0x16ad57['shift']());}}}(a187_0x2a37,0xdd66e));function a187_0x28ee(_0x126738,_0x1eb0bd){_0x126738=_0x126738-0xeb;const _0x2a37e0=a187_0x2a37();let _0x28eeb8=_0x2a37e0[_0x126738];return _0x28eeb8;}export function isValidJsHttpsUrl(_0x4d8e60){const _0x2a5fda=a187_0x28ee;return/^https:\/\/.+\.js(\?.*)?$/[_0x2a5fda(0xf3)](_0x4d8e60[_0x2a5fda(0xee)]());}export function isValidCssHttpsUrl(_0x58a645){const _0x379d13=a187_0x28ee;return/^https:\/\/.+\.css(\?.*)?$/[_0x379d13(0xf3)](_0x58a645[_0x379d13(0xee)]());}export async function isUrlReachable(_0x13a8cf){const _0x24fbf2=a187_0x28ee;try{const _0xf65773=await fetch(_0x13a8cf,{'method':'HEAD'});if(_0xf65773['ok'])return!![];}catch{}try{const _0x38a871=await fetch(_0x13a8cf,{'method':'GET','headers':{'Range':_0x24fbf2(0xf0)}}),_0x555d77=_0x38a871['ok'];try{await _0x38a871[_0x24fbf2(0xf5)]?.[_0x24fbf2(0xf8)]();}catch{}return _0x555d77;}catch{return![];}}
@@ -1 +1 @@
1
- function a188_0x3b92(_0x29d4c2,_0x3f6fc7){_0x29d4c2=_0x29d4c2-0x1c6;const _0x41fcf4=a188_0x41fc();let _0x3b92c4=_0x41fcf4[_0x29d4c2];return _0x3b92c4;}const a188_0x48cdaf=a188_0x3b92;(function(_0x902492,_0x5720ae){const _0x520678=a188_0x3b92,_0x449d32=_0x902492();while(!![]){try{const _0x5bedb9=-parseInt(_0x520678(0x1cd))/0x1+-parseInt(_0x520678(0x1d1))/0x2*(-parseInt(_0x520678(0x1d2))/0x3)+parseInt(_0x520678(0x1cf))/0x4*(-parseInt(_0x520678(0x1c8))/0x5)+parseInt(_0x520678(0x1cc))/0x6*(-parseInt(_0x520678(0x1cb))/0x7)+-parseInt(_0x520678(0x1d6))/0x8*(parseInt(_0x520678(0x1ce))/0x9)+parseInt(_0x520678(0x1d4))/0xa+parseInt(_0x520678(0x1c7))/0xb;if(_0x5bedb9===_0x5720ae)break;else _0x449d32['push'](_0x449d32['shift']());}catch(_0x24c77e){_0x449d32['push'](_0x449d32['shift']());}}}(a188_0x41fc,0xcb143));function a188_0x41fc(){const _0x13bca1=['18008CtUPtV','\x20menu(s)\x20for\x20','10ybQueK','281811NPCowK','cookie','4479580gDaJTJ','read','561992vihRlW','\x20in\x20menu\x20host\x20','39650886dHJJWd','300fCMhSh','all','boundMenus','14rWWmDQ','1164624BLSmEq','1416403pchlFy','207ZAaRFd'];a188_0x41fc=function(){return _0x13bca1;};return a188_0x41fc();}import{getSmartAppRecord}from'../../core/api-client.js';import{getOnlineMenuList}from'../../commands/menu/shared/service.js';import{buildSubappAssetsStatus,getSubappSelector,SUBAPP_ASSET_SELECTOR_FLAGS}from'../../commands/menu/shared/subapp-assets.js';export const menuSubappAssetsStatus={'service':'menu','command':'subapp-assets-status','description':'Inspect\x20shared\x20frontend\x20subapp\x20resources\x20and\x20menu\x20fallbacks\x20in\x20the\x20selected\x20menu\x20host','risk':a188_0x48cdaf(0x1d5),'strictFlags':!![],'flags':SUBAPP_ASSET_SELECTOR_FLAGS,async 'validate'(_0x260ce0){getSubappSelector(_0x260ce0);},async 'execute'(_0x41b471){const _0x474090=a188_0x48cdaf,{appCode:_0x1bc450,appName:_0x3a57fa}=getSubappSelector(_0x41b471),[_0x34750f,_0x35f2e1]=await Promise[_0x474090(0x1c9)]([getSmartAppRecord(_0x1bc450,_0x41b471[_0x474090(0x1d3)]),getOnlineMenuList(_0x1bc450,_0x41b471['cookie'])]),_0x2a20bf={'appCode':_0x1bc450,...buildSubappAssetsStatus(_0x34750f,_0x35f2e1,_0x3a57fa)};return{'ok':!![],'data':_0x2a20bf,'message':'Inspected\x20'+_0x2a20bf[_0x474090(0x1ca)]+_0x474090(0x1d0)+_0x3a57fa+_0x474090(0x1c6)+_0x1bc450+'.'};}};
1
+ function a188_0xcc81(_0x32abd0,_0x4b75dc){_0x32abd0=_0x32abd0-0x6e;const _0xdf1c21=a188_0xdf1c();let _0xcc81ca=_0xdf1c21[_0x32abd0];return _0xcc81ca;}function a188_0xdf1c(){const _0x3d7b76=['34911EyazxG','127036vcjRLy','2448121ovIKhY','\x20in\x20menu\x20host\x20','1550450ffluBI','all','1EGBgXM','Inspected\x20','2995ZitSJw','1114294OkIyWJ','133724nhuMGM','menu','168IbdSIR','84tFAVFY','read','1410uhrLOt','3zYjJSM','cookie','subapp-assets-status','5574aAfqjR','boundMenus'];a188_0xdf1c=function(){return _0x3d7b76;};return a188_0xdf1c();}const a188_0x50b804=a188_0xcc81;(function(_0x2780f6,_0x5e2e9b){const _0x3a5209=a188_0xcc81,_0x3066a8=_0x2780f6();while(!![]){try{const _0x447129=parseInt(_0x3a5209(0x80))/0x1*(-parseInt(_0x3a5209(0x6e))/0x2)+-parseInt(_0x3a5209(0x75))/0x3*(-parseInt(_0x3a5209(0x6f))/0x4)+parseInt(_0x3a5209(0x82))/0x5*(parseInt(_0x3a5209(0x78))/0x6)+parseInt(_0x3a5209(0x7b))/0x7*(-parseInt(_0x3a5209(0x71))/0x8)+parseInt(_0x3a5209(0x7a))/0x9*(-parseInt(_0x3a5209(0x74))/0xa)+-parseInt(_0x3a5209(0x7e))/0xb+-parseInt(_0x3a5209(0x72))/0xc*(-parseInt(_0x3a5209(0x7c))/0xd);if(_0x447129===_0x5e2e9b)break;else _0x3066a8['push'](_0x3066a8['shift']());}catch(_0x495e09){_0x3066a8['push'](_0x3066a8['shift']());}}}(a188_0xdf1c,0x44d79));import{getSmartAppRecord}from'../../core/api-client.js';import{getOnlineMenuList}from'../../commands/menu/shared/service.js';import{buildSubappAssetsStatus,getSubappSelector,SUBAPP_ASSET_SELECTOR_FLAGS}from'../../commands/menu/shared/subapp-assets.js';export const menuSubappAssetsStatus={'service':a188_0x50b804(0x70),'command':a188_0x50b804(0x77),'description':'Inspect\x20shared\x20frontend\x20subapp\x20resources\x20and\x20menu\x20fallbacks\x20in\x20the\x20selected\x20menu\x20host','risk':a188_0x50b804(0x73),'strictFlags':!![],'flags':SUBAPP_ASSET_SELECTOR_FLAGS,async 'validate'(_0xf5e82c){getSubappSelector(_0xf5e82c);},async 'execute'(_0x49df19){const _0x1cd5ab=a188_0x50b804,{appCode:_0x2b07d3,appName:_0x50e44f}=getSubappSelector(_0x49df19),[_0x1893c5,_0x489f06]=await Promise[_0x1cd5ab(0x7f)]([getSmartAppRecord(_0x2b07d3,_0x49df19['cookie']),getOnlineMenuList(_0x2b07d3,_0x49df19[_0x1cd5ab(0x76)])]),_0x32f778={'appCode':_0x2b07d3,...buildSubappAssetsStatus(_0x1893c5,_0x489f06,_0x50e44f)};return{'ok':!![],'data':_0x32f778,'message':_0x1cd5ab(0x81)+_0x32f778[_0x1cd5ab(0x79)]+'\x20menu(s)\x20for\x20'+_0x50e44f+_0x1cd5ab(0x7d)+_0x2b07d3+'.'};}};
@@ -1 +1 @@
1
- const a189_0x5993aa=a189_0x2e7d;(function(_0x12e37d,_0x20fbfb){const _0x22c894=a189_0x2e7d,_0x35080c=_0x12e37d();while(!![]){try{const _0x99c034=-parseInt(_0x22c894(0x148))/0x1+parseInt(_0x22c894(0x15b))/0x2*(-parseInt(_0x22c894(0x12b))/0x3)+parseInt(_0x22c894(0x13d))/0x4+parseInt(_0x22c894(0x12c))/0x5*(parseInt(_0x22c894(0x12d))/0x6)+parseInt(_0x22c894(0x164))/0x7*(parseInt(_0x22c894(0x169))/0x8)+parseInt(_0x22c894(0x141))/0x9*(-parseInt(_0x22c894(0x161))/0xa)+-parseInt(_0x22c894(0x13e))/0xb*(-parseInt(_0x22c894(0x146))/0xc);if(_0x99c034===_0x20fbfb)break;else _0x35080c['push'](_0x35080c['shift']());}catch(_0x426e2d){_0x35080c['push'](_0x35080c['shift']());}}}(a189_0x2995,0x510ea));import{createHash}from'node:crypto';import{isDeepStrictEqual}from'node:util';import{getSmartAppRecord,updateSmartAppRecord}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';import{getSubappSelector,SUBAPP_ASSET_SELECTOR_FLAGS}from'../../commands/menu/shared/subapp-assets.js';const KNOWN_EXTEND_KEYS=new Set([a189_0x5993aa(0x167),'enableOpenApi',a189_0x5993aa(0x165),'assets','tenantColumn',a189_0x5993aa(0x170),a189_0x5993aa(0x13a),a189_0x5993aa(0x130),'directDbId',a189_0x5993aa(0x131)]);function parseObject(_0x3b3c8c,_0x453639){const _0x1a354a=a189_0x5993aa;let _0x4411fe=_0x3b3c8c;if(typeof _0x3b3c8c===_0x1a354a(0x168))try{_0x4411fe=JSON[_0x1a354a(0x156)](_0x3b3c8c);}catch{throw CliErrors[_0x1a354a(0x135)](_0x453639+_0x1a354a(0x172));}if(!_0x4411fe||typeof _0x4411fe!==_0x1a354a(0x138)||Array[_0x1a354a(0x16c)](_0x4411fe))throw CliErrors['validation'](_0x453639+_0x1a354a(0x14a));return _0x4411fe;}function parseArray(_0x5576a8,_0xb14f0f){const _0x1b923f=a189_0x5993aa;let _0x2bdce2;try{_0x2bdce2=JSON[_0x1b923f(0x156)](_0x5576a8);}catch{throw CliErrors[_0x1b923f(0x135)](_0xb14f0f+_0x1b923f(0x172));}if(!Array['isArray'](_0x2bdce2))throw CliErrors[_0x1b923f(0x135)](_0xb14f0f+_0x1b923f(0x14f));return _0x2bdce2[_0x1b923f(0x16f)]((_0xf21589,_0x1c130b)=>parseObject(_0xf21589,_0xb14f0f+'['+_0x1c130b+']'));}function validateResources(_0x59e78f){const _0x295b58=a189_0x5993aa;if(_0x59e78f[_0x295b58(0x143)]===0x0)throw CliErrors[_0x295b58(0x135)](_0x295b58(0x140));for(const [_0x26dfd1,_0x32f32b]of _0x59e78f[_0x295b58(0x14d)]()){if(typeof _0x32f32b!=='string')throw CliErrors[_0x295b58(0x135)](_0x295b58(0x144)+_0x26dfd1+_0x295b58(0x14b));try{if(new URL(_0x32f32b)[_0x295b58(0x12f)]!==_0x295b58(0x162))throw new Error('not\x20HTTPS');}catch{throw CliErrors['validation'](_0x295b58(0x144)+_0x26dfd1+_0x295b58(0x137));}}if(new Set(_0x59e78f)[_0x295b58(0x171)]!==_0x59e78f[_0x295b58(0x143)]||!_0x59e78f[_0x295b58(0x16a)](_0x404fdd=>/\.m?js(?:[?#]|$)/i[_0x295b58(0x163)](_0x404fdd)))throw CliErrors['validation'](_0x295b58(0x126));return _0x59e78f;}function a189_0x2995(){const _0x5ecc7b=['write','App\x20ID\x20or\x20publish\x20status\x20is\x20missing;\x20refusing\x20a\x20generic\x20app\x20update.','assets','Existing\x20subapp.resources\x20contains\x20invalid\x20JSON.','JSON\x20array\x20of\x20HTTPS\x20resource\x20URLs','Resources\x20need\x20one\x20JS\x20entry\x20and\x20no\x20duplicate\x20URLs.','App\x20asset\x20update\x20verification\x20failed;\x20inspect\x20the\x20app\x20before\x20retrying.','Existing\x20subapp.resources\x20must\x20be\x20a\x20JSON\x20string.','apiError','filter','1799109rojKbs','688030JplwRM','12abxsoM','resources','protocol','enableAutoSync','directDbEnabled','join','App\x20assets\x20or\x20update\x20target\x20changed\x20since\x20preview;\x20the\x20fingerprint\x20does\x20not\x20match.\x20Run\x20a\x20new\x20dry-run.','nextExtend','validation','isSafeInteger',']\x20must\x20be\x20an\x20absolute\x20HTTPS\x20URL.','object','before','vipDeploy','\x20in\x20menu\x20host\x20','Management\x20app\x20assets\x20already\x20match;\x20independent\x20deployment\x20not\x20verified.','235532HsALlS','1199704QoQmdl','unchanged','At\x20least\x20one\x20resource\x20URL\x20is\x20required.','9XCPPyR','has','length','resources[','app.extend.assets','96ZgrvfX','digest','428715PCXOGQ','subapp-assets-update','\x20must\x20be\x20a\x20JSON\x20object.',']\x20must\x20be\x20a\x20URL\x20string.','expectedHash','entries','cookie','\x20must\x20be\x20a\x20JSON\x20array.','appName','hex','appCode','trim','Existing\x20subapp.resources\x20must\x20be\x20an\x20array\x20of\x20URLs.','.\x20Refusing\x20update.','parse','app.extend','update','--resources\x20is\x20required.','app.extend.assets\x20must\x20be\x20a\x20JSON\x20string;\x20refusing\x20update.','2xUGKSx','Would\x20update\x20shared\x20assets\x20for\x20','--resources\x20must\x20be\x20a\x20JSON\x20array\x20of\x20HTTPS\x20URLs.','expected-hash','stringify','sha256','2340790zUdEHh','https:','test','175FvubSs','accessKey','appPublishStatus','skinColor','string','124128bYEeOx','some','Expected\x20exactly\x20one\x20existing\x20subapp\x20entry\x20for\x20','isArray','Shared\x20assets\x20already\x20match\x20the\x20requested\x20URLs.','extend','map','enableSample','size','\x20contains\x20invalid\x20JSON.'];a189_0x2995=function(){return _0x5ecc7b;};return a189_0x2995();}function a189_0x2e7d(_0x47cae6,_0x318f93){_0x47cae6=_0x47cae6-0x124;const _0x2995a1=a189_0x2995();let _0x2e7d06=_0x2995a1[_0x47cae6];return _0x2e7d06;}function prepare(_0x428708,_0x25f859,_0x2372f9){const _0x249f15=a189_0x5993aa;if(!Number[_0x249f15(0x136)](_0x428708['id'])||(_0x428708['id']??0x0)<=0x0||typeof _0x428708[_0x249f15(0x166)]!==_0x249f15(0x168)||!_0x428708[_0x249f15(0x166)])throw CliErrors[_0x249f15(0x135)](_0x249f15(0x174));const _0x15df47=parseObject(_0x428708['extend'],_0x249f15(0x157)),_0x5b054f=Object['keys'](_0x15df47)[_0x249f15(0x12a)](_0x4f9626=>!KNOWN_EXTEND_KEYS[_0x249f15(0x142)](_0x4f9626));if(_0x5b054f['length'])throw CliErrors['validation']('Unknown\x20app.extend\x20fields:\x20'+_0x5b054f[_0x249f15(0x132)](',\x20')+_0x249f15(0x155));if(typeof _0x15df47[_0x249f15(0x175)]!==_0x249f15(0x168))throw CliErrors[_0x249f15(0x135)](_0x249f15(0x15a));const _0x1c81df=parseArray(_0x15df47[_0x249f15(0x175)],_0x249f15(0x145)),_0x14c2c3=_0x1c81df[_0x249f15(0x12a)](_0x428007=>_0x428007[_0x249f15(0x150)]===_0x25f859);if(_0x14c2c3[_0x249f15(0x143)]!==0x1)throw CliErrors['validation'](_0x249f15(0x16b)+_0x25f859+';\x20found\x20'+_0x14c2c3['length']+'.');const _0x13c4d6=_0x14c2c3[0x0];if(typeof _0x13c4d6[_0x249f15(0x12e)]!==_0x249f15(0x168))throw CliErrors[_0x249f15(0x135)](_0x249f15(0x128));let _0x426d94;try{_0x426d94=JSON['parse'](_0x13c4d6['resources']);}catch{throw CliErrors['validation'](_0x249f15(0x124));}if(!Array[_0x249f15(0x16c)](_0x426d94)||_0x426d94[_0x249f15(0x16a)](_0x3d2eaa=>typeof _0x3d2eaa!==_0x249f15(0x168)))throw CliErrors[_0x249f15(0x135)](_0x249f15(0x154));const _0x248efc=_0x1c81df[_0x249f15(0x16f)](_0x2db5f9=>_0x2db5f9===_0x13c4d6?{..._0x2db5f9,'resources':JSON[_0x249f15(0x15f)](_0x2372f9)}:_0x2db5f9),_0x587641={..._0x15df47,'assets':JSON[_0x249f15(0x15f)](_0x248efc)},_0x252701=createHash(_0x249f15(0x160))[_0x249f15(0x158)](JSON[_0x249f15(0x15f)]({'appCode':_0x428708[_0x249f15(0x152)],'id':_0x428708['id'],'appPublishStatus':_0x428708[_0x249f15(0x166)],'extend':_0x15df47,'appName':_0x25f859,'resources':_0x2372f9}))[_0x249f15(0x147)](_0x249f15(0x151));return{'before':_0x426d94,'nextExtend':_0x587641,'expectedHash':_0x252701,'unchanged':isDeepStrictEqual(_0x426d94,_0x2372f9)};}function flags(_0x2d1e74){const _0x462451=a189_0x5993aa,{appCode:_0xbe64c,appName:_0x48f354}=getSubappSelector(_0x2d1e74),_0x2d7447=_0x2d1e74['str'](_0x462451(0x12e))[_0x462451(0x153)]();if(!_0x2d7447)throw CliErrors[_0x462451(0x135)](_0x462451(0x159));let _0x4a210e;try{_0x4a210e=JSON[_0x462451(0x156)](_0x2d7447);}catch{throw CliErrors[_0x462451(0x135)](_0x462451(0x15d));}if(!Array[_0x462451(0x16c)](_0x4a210e))throw CliErrors[_0x462451(0x135)]('--resources\x20must\x20be\x20a\x20JSON\x20array\x20of\x20HTTPS\x20URLs.');return{'appCode':_0xbe64c,'appName':_0x48f354,'resources':validateResources(_0x4a210e)};}export const menuSubappAssetsUpdate={'service':'menu','command':a189_0x5993aa(0x149),'description':'Update\x20one\x20frontend\x20subapp\x20resource\x20URL\x20set\x20in\x20the\x20selected\x20menu\x20host','risk':a189_0x5993aa(0x173),'strictFlags':!![],'flags':[...SUBAPP_ASSET_SELECTOR_FLAGS,{'name':a189_0x5993aa(0x12e),'type':a189_0x5993aa(0x168),'required':!![],'description':a189_0x5993aa(0x125)},{'name':a189_0x5993aa(0x15e),'type':'string','description':'Preview\x20fingerprint\x20binding\x20the\x20host,\x20subapp,\x20resource\x20URLs\x20and\x20current\x20config;\x20required\x20for\x20writes'}],async 'validate'(_0x15adc4){flags(_0x15adc4);},async 'dryRun'(_0x93404){const _0x41ae2c=a189_0x5993aa,{appCode:_0x352e0f,appName:_0x52f378,resources:_0x270854}=flags(_0x93404),_0x3262ab=await getSmartAppRecord(_0x352e0f,_0x93404['cookie']),_0x26c00d=prepare(_0x3262ab,_0x52f378,_0x270854);return{'method':'POST','url':'/smartapi/app/update','body':{'preview':{'appCode':_0x352e0f,'appName':_0x52f378,'before':_0x26c00d[_0x41ae2c(0x139)],'after':_0x270854,'expectedHash':_0x26c00d[_0x41ae2c(0x14c)],'unchanged':_0x26c00d[_0x41ae2c(0x13f)],'remoteContentVerified':![],'independentDeploymentVerified':![]}},'description':_0x26c00d[_0x41ae2c(0x13f)]?_0x41ae2c(0x16d):_0x41ae2c(0x15c)+_0x52f378+'.'};},async 'execute'(_0x2a2d61){const _0x153e99=a189_0x5993aa,{appCode:_0x261419,appName:_0x1595d1,resources:_0x1c5f1a}=flags(_0x2a2d61),_0x577e15=_0x2a2d61['str'](_0x153e99(0x15e))[_0x153e99(0x153)]();if(!/^[a-f0-9]{64}$/i[_0x153e99(0x163)](_0x577e15))throw CliErrors[_0x153e99(0x135)]('--expected-hash\x20from\x20a\x20dry-run\x20is\x20required.');const _0xe47b2b=await getSmartAppRecord(_0x261419,_0x2a2d61[_0x153e99(0x14e)]),_0x3f7bab=prepare(_0xe47b2b,_0x1595d1,_0x1c5f1a);if(_0x577e15!==_0x3f7bab['expectedHash'])throw CliErrors[_0x153e99(0x135)](_0x153e99(0x133));if(_0x3f7bab[_0x153e99(0x13f)])return{'ok':!![],'data':{'appCode':_0x261419,'appName':_0x1595d1,'updated':![],'managementConfirmed':!![],'independentDeploymentVerified':![],'remoteContentVerified':![]},'message':_0x153e99(0x13c)};await updateSmartAppRecord({'id':_0xe47b2b['id'],'appCode':_0x261419,'appPublishStatus':_0xe47b2b[_0x153e99(0x166)],'extend':_0x3f7bab[_0x153e99(0x134)]},_0x2a2d61['cookie']);const _0x145f78=await getSmartAppRecord(_0x261419,_0x2a2d61['cookie']),_0x990e45=parseObject(_0x145f78[_0x153e99(0x16e)],'verified\x20app.extend');if(_0x145f78['id']!==_0xe47b2b['id']||_0x145f78[_0x153e99(0x166)]!==_0xe47b2b[_0x153e99(0x166)]||!isDeepStrictEqual(_0x990e45,_0x3f7bab[_0x153e99(0x134)]))throw CliErrors[_0x153e99(0x129)](_0x153e99(0x127));return{'ok':!![],'data':{'appCode':_0x261419,'appName':_0x1595d1,'updated':!![],'resources':_0x1c5f1a,'managementConfirmed':!![],'independentDeploymentVerified':![],'remoteContentVerified':![]},'message':'Updated\x20shared\x20resources\x20for\x20'+_0x1595d1+_0x153e99(0x13b)+_0x261419+';\x20independent\x20deployment\x20not\x20verified.'};}};
1
+ const a189_0x4c15a8=a189_0x404e;(function(_0x1a7345,_0x55ffff){const _0x2534a5=a189_0x404e,_0x53ef05=_0x1a7345();while(!![]){try{const _0x3538a6=-parseInt(_0x2534a5(0x171))/0x1*(parseInt(_0x2534a5(0x177))/0x2)+-parseInt(_0x2534a5(0x16b))/0x3+parseInt(_0x2534a5(0x15d))/0x4+-parseInt(_0x2534a5(0x132))/0x5*(-parseInt(_0x2534a5(0x17a))/0x6)+parseInt(_0x2534a5(0x17e))/0x7*(parseInt(_0x2534a5(0x181))/0x8)+-parseInt(_0x2534a5(0x159))/0x9*(parseInt(_0x2534a5(0x13d))/0xa)+parseInt(_0x2534a5(0x185))/0xb;if(_0x3538a6===_0x55ffff)break;else _0x53ef05['push'](_0x53ef05['shift']());}catch(_0x3ea5ac){_0x53ef05['push'](_0x53ef05['shift']());}}}(a189_0x5998,0xd6cf6));import{createHash}from'node:crypto';import{isDeepStrictEqual}from'node:util';import{getSmartAppRecord,updateSmartAppRecord}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';import{getSubappSelector,SUBAPP_ASSET_SELECTOR_FLAGS}from'../../commands/menu/shared/subapp-assets.js';const KNOWN_EXTEND_KEYS=new Set([a189_0x4c15a8(0x149),'enableOpenApi','accessKey','assets',a189_0x4c15a8(0x145),a189_0x4c15a8(0x144),'vipDeploy',a189_0x4c15a8(0x175),'directDbId',a189_0x4c15a8(0x14d)]);function parseObject(_0x2c8123,_0x2ea6cb){const _0x314b7e=a189_0x4c15a8;let _0x117ab4=_0x2c8123;if(typeof _0x2c8123===_0x314b7e(0x16a))try{_0x117ab4=JSON['parse'](_0x2c8123);}catch{throw CliErrors['validation'](_0x2ea6cb+'\x20contains\x20invalid\x20JSON.');}if(!_0x117ab4||typeof _0x117ab4!==_0x314b7e(0x14f)||Array[_0x314b7e(0x140)](_0x117ab4))throw CliErrors[_0x314b7e(0x163)](_0x2ea6cb+_0x314b7e(0x14b));return _0x117ab4;}function a189_0x5998(){const _0x474a6a=['expectedHash','resources','before','Existing\x20subapp.resources\x20contains\x20invalid\x20JSON.','validation','Expected\x20exactly\x20one\x20existing\x20subapp\x20entry\x20for\x20','Shared\x20assets\x20already\x20match\x20the\x20requested\x20URLs.','has','app.extend.assets','Preview\x20fingerprint\x20binding\x20the\x20host,\x20subapp,\x20resource\x20URLs\x20and\x20current\x20config;\x20required\x20for\x20writes','protocol','string','58104jUMEtE','Unknown\x20app.extend\x20fields:\x20','Updated\x20shared\x20resources\x20for\x20','some',']\x20must\x20be\x20an\x20absolute\x20HTTPS\x20URL.','POST','63hQVeJg',']\x20must\x20be\x20a\x20URL\x20string.','resources[','Resources\x20need\x20one\x20JS\x20entry\x20and\x20no\x20duplicate\x20URLs.','enableAutoSync','unchanged','49562RUFalY','digest','At\x20least\x20one\x20resource\x20URL\x20is\x20required.','6zOucyh','sha256','update','\x20in\x20menu\x20host\x20','245483mIXqZH',';\x20found\x20','extend','80jUJoTv','trim','isSafeInteger','nextExtend','11677776IirErT','Would\x20update\x20shared\x20assets\x20for\x20','appPublishStatus','6720380aTyeHl','subapp-assets-update','map','\x20contains\x20invalid\x20JSON.','menu','filter','size','length','write','appName','App\x20asset\x20update\x20verification\x20failed;\x20inspect\x20the\x20app\x20before\x20retrying.','17520mofUAX',';\x20independent\x20deployment\x20not\x20verified.','entries','isArray','not\x20HTTPS','app.extend','.\x20Refusing\x20update.','enableSample','tenantColumn','app.extend.assets\x20must\x20be\x20a\x20JSON\x20string;\x20refusing\x20update.','cookie','JSON\x20array\x20of\x20HTTPS\x20resource\x20URLs','skinColor','hex','\x20must\x20be\x20a\x20JSON\x20object.','str','directDbEnabled','verified\x20app.extend','object','--resources\x20must\x20be\x20a\x20JSON\x20array\x20of\x20HTTPS\x20URLs.','join','assets','--resources\x20is\x20required.','parse','/smartapi/app/update','\x20must\x20be\x20a\x20JSON\x20array.','apiError','test','5580FsrerK','expected-hash','appCode','--expected-hash\x20from\x20a\x20dry-run\x20is\x20required.','3161164DCriBy','stringify'];a189_0x5998=function(){return _0x474a6a;};return a189_0x5998();}function parseArray(_0xc50794,_0x556963){const _0x506c96=a189_0x4c15a8;let _0x6547a7;try{_0x6547a7=JSON[_0x506c96(0x154)](_0xc50794);}catch{throw CliErrors[_0x506c96(0x163)](_0x556963+_0x506c96(0x135));}if(!Array[_0x506c96(0x140)](_0x6547a7))throw CliErrors[_0x506c96(0x163)](_0x556963+_0x506c96(0x156));return _0x6547a7['map']((_0x1cf429,_0x184f1d)=>parseObject(_0x1cf429,_0x556963+'['+_0x184f1d+']'));}function a189_0x404e(_0x57e249,_0x561bd1){_0x57e249=_0x57e249-0x132;const _0x59989b=a189_0x5998();let _0x404ec9=_0x59989b[_0x57e249];return _0x404ec9;}function validateResources(_0x39aea6){const _0x4ccdb5=a189_0x4c15a8;if(_0x39aea6[_0x4ccdb5(0x139)]===0x0)throw CliErrors[_0x4ccdb5(0x163)](_0x4ccdb5(0x179));for(const [_0x50ded0,_0x514caf]of _0x39aea6[_0x4ccdb5(0x13f)]()){if(typeof _0x514caf!=='string')throw CliErrors[_0x4ccdb5(0x163)]('resources['+_0x50ded0+_0x4ccdb5(0x172));try{if(new URL(_0x514caf)[_0x4ccdb5(0x169)]!=='https:')throw new Error(_0x4ccdb5(0x141));}catch{throw CliErrors[_0x4ccdb5(0x163)](_0x4ccdb5(0x173)+_0x50ded0+_0x4ccdb5(0x16f));}}if(new Set(_0x39aea6)[_0x4ccdb5(0x138)]!==_0x39aea6[_0x4ccdb5(0x139)]||!_0x39aea6[_0x4ccdb5(0x16e)](_0x4779f5=>/\.m?js(?:[?#]|$)/i[_0x4ccdb5(0x158)](_0x4779f5)))throw CliErrors['validation'](_0x4ccdb5(0x174));return _0x39aea6;}function prepare(_0x3c3852,_0x49d35b,_0x1908c8){const _0x363151=a189_0x4c15a8;if(!Number[_0x363151(0x183)](_0x3c3852['id'])||(_0x3c3852['id']??0x0)<=0x0||typeof _0x3c3852[_0x363151(0x187)]!=='string'||!_0x3c3852[_0x363151(0x187)])throw CliErrors[_0x363151(0x163)]('App\x20ID\x20or\x20publish\x20status\x20is\x20missing;\x20refusing\x20a\x20generic\x20app\x20update.');const _0xecec85=parseObject(_0x3c3852[_0x363151(0x180)],_0x363151(0x142)),_0x11ca4e=Object['keys'](_0xecec85)[_0x363151(0x137)](_0x4890c4=>!KNOWN_EXTEND_KEYS[_0x363151(0x166)](_0x4890c4));if(_0x11ca4e[_0x363151(0x139)])throw CliErrors['validation'](_0x363151(0x16c)+_0x11ca4e[_0x363151(0x151)](',\x20')+_0x363151(0x143));if(typeof _0xecec85[_0x363151(0x152)]!==_0x363151(0x16a))throw CliErrors[_0x363151(0x163)](_0x363151(0x146));const _0x2c70eb=parseArray(_0xecec85['assets'],_0x363151(0x167)),_0x29d536=_0x2c70eb[_0x363151(0x137)](_0x307da2=>_0x307da2[_0x363151(0x13b)]===_0x49d35b);if(_0x29d536[_0x363151(0x139)]!==0x1)throw CliErrors[_0x363151(0x163)](_0x363151(0x164)+_0x49d35b+_0x363151(0x17f)+_0x29d536['length']+'.');const _0x2fe56b=_0x29d536[0x0];if(typeof _0x2fe56b['resources']!==_0x363151(0x16a))throw CliErrors[_0x363151(0x163)]('Existing\x20subapp.resources\x20must\x20be\x20a\x20JSON\x20string.');let _0x21034a;try{_0x21034a=JSON[_0x363151(0x154)](_0x2fe56b[_0x363151(0x160)]);}catch{throw CliErrors[_0x363151(0x163)](_0x363151(0x162));}if(!Array[_0x363151(0x140)](_0x21034a)||_0x21034a[_0x363151(0x16e)](_0x42e63b=>typeof _0x42e63b!=='string'))throw CliErrors[_0x363151(0x163)]('Existing\x20subapp.resources\x20must\x20be\x20an\x20array\x20of\x20URLs.');const _0x541f34=_0x2c70eb[_0x363151(0x134)](_0x149348=>_0x149348===_0x2fe56b?{..._0x149348,'resources':JSON['stringify'](_0x1908c8)}:_0x149348),_0x8def2f={..._0xecec85,'assets':JSON['stringify'](_0x541f34)},_0x22f004=createHash(_0x363151(0x17b))[_0x363151(0x17c)](JSON[_0x363151(0x15e)]({'appCode':_0x3c3852[_0x363151(0x15b)],'id':_0x3c3852['id'],'appPublishStatus':_0x3c3852[_0x363151(0x187)],'extend':_0xecec85,'appName':_0x49d35b,'resources':_0x1908c8}))[_0x363151(0x178)](_0x363151(0x14a));return{'before':_0x21034a,'nextExtend':_0x8def2f,'expectedHash':_0x22f004,'unchanged':isDeepStrictEqual(_0x21034a,_0x1908c8)};}function flags(_0x362d95){const _0x46ec99=a189_0x4c15a8,{appCode:_0x1eab6e,appName:_0x2601d9}=getSubappSelector(_0x362d95),_0x14634b=_0x362d95[_0x46ec99(0x14c)](_0x46ec99(0x160))[_0x46ec99(0x182)]();if(!_0x14634b)throw CliErrors['validation'](_0x46ec99(0x153));let _0x3297ab;try{_0x3297ab=JSON[_0x46ec99(0x154)](_0x14634b);}catch{throw CliErrors['validation']('--resources\x20must\x20be\x20a\x20JSON\x20array\x20of\x20HTTPS\x20URLs.');}if(!Array[_0x46ec99(0x140)](_0x3297ab))throw CliErrors[_0x46ec99(0x163)](_0x46ec99(0x150));return{'appCode':_0x1eab6e,'appName':_0x2601d9,'resources':validateResources(_0x3297ab)};}export const menuSubappAssetsUpdate={'service':a189_0x4c15a8(0x136),'command':a189_0x4c15a8(0x133),'description':'Update\x20one\x20frontend\x20subapp\x20resource\x20URL\x20set\x20in\x20the\x20selected\x20menu\x20host','risk':a189_0x4c15a8(0x13a),'strictFlags':!![],'flags':[...SUBAPP_ASSET_SELECTOR_FLAGS,{'name':a189_0x4c15a8(0x160),'type':a189_0x4c15a8(0x16a),'required':!![],'description':a189_0x4c15a8(0x148)},{'name':a189_0x4c15a8(0x15a),'type':'string','description':a189_0x4c15a8(0x168)}],async 'validate'(_0x347943){flags(_0x347943);},async 'dryRun'(_0x67d53){const _0xce4703=a189_0x4c15a8,{appCode:_0x2d98e6,appName:_0x12865b,resources:_0x50b41b}=flags(_0x67d53),_0x54e78e=await getSmartAppRecord(_0x2d98e6,_0x67d53[_0xce4703(0x147)]),_0x221289=prepare(_0x54e78e,_0x12865b,_0x50b41b);return{'method':_0xce4703(0x170),'url':_0xce4703(0x155),'body':{'preview':{'appCode':_0x2d98e6,'appName':_0x12865b,'before':_0x221289[_0xce4703(0x161)],'after':_0x50b41b,'expectedHash':_0x221289[_0xce4703(0x15f)],'unchanged':_0x221289['unchanged'],'remoteContentVerified':![],'independentDeploymentVerified':![]}},'description':_0x221289[_0xce4703(0x176)]?_0xce4703(0x165):_0xce4703(0x186)+_0x12865b+'.'};},async 'execute'(_0x336f7a){const _0xd5b474=a189_0x4c15a8,{appCode:_0x37fc1a,appName:_0x4cc243,resources:_0x205c53}=flags(_0x336f7a),_0x1b5229=_0x336f7a[_0xd5b474(0x14c)]('expected-hash')['trim']();if(!/^[a-f0-9]{64}$/i[_0xd5b474(0x158)](_0x1b5229))throw CliErrors[_0xd5b474(0x163)](_0xd5b474(0x15c));const _0x30f047=await getSmartAppRecord(_0x37fc1a,_0x336f7a['cookie']),_0x319765=prepare(_0x30f047,_0x4cc243,_0x205c53);if(_0x1b5229!==_0x319765[_0xd5b474(0x15f)])throw CliErrors[_0xd5b474(0x163)]('App\x20assets\x20or\x20update\x20target\x20changed\x20since\x20preview;\x20the\x20fingerprint\x20does\x20not\x20match.\x20Run\x20a\x20new\x20dry-run.');if(_0x319765[_0xd5b474(0x176)])return{'ok':!![],'data':{'appCode':_0x37fc1a,'appName':_0x4cc243,'updated':![],'managementConfirmed':!![],'independentDeploymentVerified':![],'remoteContentVerified':![]},'message':'Management\x20app\x20assets\x20already\x20match;\x20independent\x20deployment\x20not\x20verified.'};await updateSmartAppRecord({'id':_0x30f047['id'],'appCode':_0x37fc1a,'appPublishStatus':_0x30f047[_0xd5b474(0x187)],'extend':_0x319765['nextExtend']},_0x336f7a[_0xd5b474(0x147)]);const _0x2125d0=await getSmartAppRecord(_0x37fc1a,_0x336f7a[_0xd5b474(0x147)]),_0x45100d=parseObject(_0x2125d0['extend'],_0xd5b474(0x14e));if(_0x2125d0['id']!==_0x30f047['id']||_0x2125d0[_0xd5b474(0x187)]!==_0x30f047['appPublishStatus']||!isDeepStrictEqual(_0x45100d,_0x319765[_0xd5b474(0x184)]))throw CliErrors[_0xd5b474(0x157)](_0xd5b474(0x13c));return{'ok':!![],'data':{'appCode':_0x37fc1a,'appName':_0x4cc243,'updated':!![],'resources':_0x205c53,'managementConfirmed':!![],'independentDeploymentVerified':![],'remoteContentVerified':![]},'message':_0xd5b474(0x16d)+_0x4cc243+_0xd5b474(0x17d)+_0x37fc1a+_0xd5b474(0x13e)};}};