@next-bricks/ai-portal 0.50.2 → 0.51.0

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 (114) hide show
  1. package/dist/bricks.json +33 -28
  2. package/dist/chunks/1334.aae33a33.js +2 -0
  3. package/dist/chunks/1334.aae33a33.js.map +1 -0
  4. package/dist/chunks/2084.37e19e93.js +3 -0
  5. package/dist/chunks/2084.37e19e93.js.map +1 -0
  6. package/dist/chunks/3199.0220cf6e.js +3 -0
  7. package/dist/chunks/3199.0220cf6e.js.map +1 -0
  8. package/dist/chunks/3735.8c1d82e7.js +15 -0
  9. package/dist/chunks/3735.8c1d82e7.js.LICENSE.txt +5 -0
  10. package/dist/chunks/3735.8c1d82e7.js.map +1 -0
  11. package/dist/chunks/3744.ed6d0719.js +2 -0
  12. package/dist/chunks/3744.ed6d0719.js.map +1 -0
  13. package/dist/chunks/4317.d0f5904b.js +3 -0
  14. package/dist/chunks/{3151.d1fdecfb.js.LICENSE.txt → 4317.d0f5904b.js.LICENSE.txt} +8 -0
  15. package/dist/chunks/4317.d0f5904b.js.map +1 -0
  16. package/dist/chunks/6201.993201cb.js +2 -0
  17. package/dist/chunks/6201.993201cb.js.map +1 -0
  18. package/dist/chunks/6206.874a68ab.js +2 -0
  19. package/dist/chunks/6206.874a68ab.js.map +1 -0
  20. package/dist/chunks/6593.f25cfd6b.js +2 -0
  21. package/dist/chunks/6593.f25cfd6b.js.map +1 -0
  22. package/dist/chunks/8135.3255c5ba.js +2 -0
  23. package/dist/chunks/8135.3255c5ba.js.map +1 -0
  24. package/dist/chunks/8717.fc81dec5.js +2 -0
  25. package/dist/chunks/8717.fc81dec5.js.map +1 -0
  26. package/dist/chunks/{ai-agents.59e23ea3.js → ai-agents.d47947e5.js} +3 -3
  27. package/dist/chunks/{ai-agents.59e23ea3.js.map → ai-agents.d47947e5.js.map} +1 -1
  28. package/dist/chunks/{ai-employees.941aaa1b.js → ai-employees.6d586b8d.js} +3 -3
  29. package/dist/chunks/{ai-employees.941aaa1b.js.map → ai-employees.6d586b8d.js.map} +1 -1
  30. package/dist/chunks/blank-state.2b55f2c6.js +2 -0
  31. package/dist/chunks/blank-state.2b55f2c6.js.map +1 -0
  32. package/dist/chunks/chat-box.6156ad59.js +2 -0
  33. package/dist/chunks/chat-box.6156ad59.js.map +1 -0
  34. package/dist/chunks/elevo-card.731505e0.js +3 -0
  35. package/dist/chunks/elevo-card.731505e0.js.LICENSE.txt +5 -0
  36. package/dist/chunks/elevo-card.731505e0.js.map +1 -0
  37. package/dist/chunks/elevo-sidebar.402d464e.js +3 -0
  38. package/dist/chunks/elevo-sidebar.402d464e.js.LICENSE.txt +5 -0
  39. package/dist/chunks/elevo-sidebar.402d464e.js.map +1 -0
  40. package/dist/chunks/icon-button.0881c876.js +2 -0
  41. package/dist/chunks/icon-button.0881c876.js.map +1 -0
  42. package/dist/chunks/main.5dcdeb69.js +2 -0
  43. package/dist/chunks/main.5dcdeb69.js.map +1 -0
  44. package/dist/chunks/page-container.e59d6a94.js +2 -0
  45. package/dist/chunks/page-container.e59d6a94.js.map +1 -0
  46. package/dist/chunks/preview-container.6b29ee97.js +2 -0
  47. package/dist/chunks/preview-container.6b29ee97.js.map +1 -0
  48. package/dist/chunks/sticky-container.d3f7054e.js +2 -0
  49. package/dist/chunks/sticky-container.d3f7054e.js.map +1 -0
  50. package/dist/examples.json +19 -16
  51. package/dist/images/27bd64e1.png +0 -0
  52. package/dist/index.28d7dd85.js +2 -0
  53. package/dist/index.28d7dd85.js.map +1 -0
  54. package/dist/manifest.json +216 -173
  55. package/dist/types.json +327 -149
  56. package/dist-types/blank-state/index.d.ts +1 -1
  57. package/dist-types/bootstrap.d.ts +1 -0
  58. package/dist-types/chat-box/index.d.ts +8 -0
  59. package/dist-types/elevo-card/index.d.ts +25 -0
  60. package/dist-types/elevo-card/index.spec.d.ts +1 -0
  61. package/dist-types/elevo-sidebar/ChatHistory.d.ts +3 -3
  62. package/dist-types/elevo-sidebar/NavLink.d.ts +9 -0
  63. package/dist-types/elevo-sidebar/i18n.d.ts +1 -0
  64. package/dist-types/elevo-sidebar/index.d.ts +4 -5
  65. package/dist-types/icon-button/index.d.ts +2 -0
  66. package/dist-types/page-container/index.d.ts +2 -0
  67. package/dist-types/shared/interfaces.d.ts +2 -2
  68. package/dist-types/shared/workers/tsxParser.d.ts +2 -2
  69. package/docs/elevo-card.md +40 -0
  70. package/package.json +2 -2
  71. package/dist/chunks/3151.d1fdecfb.js +0 -3
  72. package/dist/chunks/3151.d1fdecfb.js.map +0 -1
  73. package/dist/chunks/3735.0389cba2.js +0 -15
  74. package/dist/chunks/3735.0389cba2.js.map +0 -1
  75. package/dist/chunks/3744.8d040aaa.js +0 -2
  76. package/dist/chunks/3744.8d040aaa.js.map +0 -1
  77. package/dist/chunks/3832.9b48b5f5.js +0 -2
  78. package/dist/chunks/3832.9b48b5f5.js.map +0 -1
  79. package/dist/chunks/6201.01557568.js +0 -2
  80. package/dist/chunks/6201.01557568.js.map +0 -1
  81. package/dist/chunks/7580.5dca4f97.js +0 -3
  82. package/dist/chunks/7580.5dca4f97.js.LICENSE.txt +0 -9
  83. package/dist/chunks/7580.5dca4f97.js.map +0 -1
  84. package/dist/chunks/8414.8b8390cb.js +0 -2
  85. package/dist/chunks/8414.8b8390cb.js.map +0 -1
  86. package/dist/chunks/8717.4f49d4f6.js +0 -2
  87. package/dist/chunks/8717.4f49d4f6.js.map +0 -1
  88. package/dist/chunks/8889.746f8129.js +0 -3
  89. package/dist/chunks/8889.746f8129.js.map +0 -1
  90. package/dist/chunks/blank-state.3a537adc.js +0 -2
  91. package/dist/chunks/blank-state.3a537adc.js.map +0 -1
  92. package/dist/chunks/chat-box.da1fbfc3.js +0 -2
  93. package/dist/chunks/chat-box.da1fbfc3.js.map +0 -1
  94. package/dist/chunks/elevo-sidebar.cbec3024.js +0 -3
  95. package/dist/chunks/elevo-sidebar.cbec3024.js.LICENSE.txt +0 -9
  96. package/dist/chunks/elevo-sidebar.cbec3024.js.map +0 -1
  97. package/dist/chunks/icon-button.1014fc6a.js +0 -2
  98. package/dist/chunks/icon-button.1014fc6a.js.map +0 -1
  99. package/dist/chunks/main.bd40fdc0.js +0 -2
  100. package/dist/chunks/main.bd40fdc0.js.map +0 -1
  101. package/dist/chunks/page-container.e187d00a.js +0 -2
  102. package/dist/chunks/page-container.e187d00a.js.map +0 -1
  103. package/dist/chunks/preview-container.631389f7.js +0 -2
  104. package/dist/chunks/preview-container.631389f7.js.map +0 -1
  105. package/dist/chunks/sticky-container.b8ab2a25.js +0 -2
  106. package/dist/chunks/sticky-container.b8ab2a25.js.map +0 -1
  107. package/dist/images/4b299d0b.png +0 -0
  108. package/dist/images/ddd8ccd2.png +0 -0
  109. package/dist/index.546d6b1e.js +0 -2
  110. package/dist/index.546d6b1e.js.map +0 -1
  111. /package/dist/chunks/{8889.746f8129.js.LICENSE.txt → 2084.37e19e93.js.LICENSE.txt} +0 -0
  112. /package/dist/chunks/{3735.0389cba2.js.LICENSE.txt → 3199.0220cf6e.js.LICENSE.txt} +0 -0
  113. /package/dist/chunks/{ai-agents.59e23ea3.js.LICENSE.txt → ai-agents.d47947e5.js.LICENSE.txt} +0 -0
  114. /package/dist/chunks/{ai-employees.941aaa1b.js.LICENSE.txt → ai-employees.6d586b8d.js.LICENSE.txt} +0 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"chunks/1334.aae33a33.js","mappings":"uBAAIA,ECAAC,EAIAC,EAIAC,EAIAC,EAIAC,EAGAC,EAIAC,EAuBAC,EAMAC,EAUAC,EAMAC,EAWAC,EA0BAC,EAgBAC,EACAC,EAIAC,EAKAC,ECnIAC,E,wDCAG,MAAMC,EAAgB,WAEhBC,EAAgB,CAAC,UAAW,WAAY,YCG9C,SAASC,EACdC,EACAC,GAEA,OAAID,EAAGE,QAASF,EAAGG,YACjBF,EAAMG,OAAOC,KAAK,CAChBC,QAAS,wCACTC,KAAMP,EACNQ,SAAU,WAEL,EAIX,C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BoD,EAAgBxD,IAChB,KAAOA,GACTuB,cAAchD,EAAoB3R,EAAI2R,EAAoB8B,EAAEL,GAE9D,EAGD,IAAIyD,EAAqBlD,WAA+C,mCAAIA,WAA+C,oCAAK,GAC5HmD,EAA6BD,EAAmB/c,KAAK4b,KAAKmB,GAC9DA,EAAmB/c,KAvBCid,IACnB,IAAK1E,EAAU2E,EAAaC,GAAWF,EACvC,IAAI,IAAInF,KAAYoF,EAChBrF,EAAoBsB,EAAE+D,EAAapF,KACrCD,EAAoBM,EAAEL,GAAYoF,EAAYpF,IAIhD,IADGqF,GAASA,EAAQtF,GACdU,EAASpX,QACd2b,EAAgBvE,EAAShE,OAAS,EACnCyI,EAA2BC,EAAK,C,K/BnB7B1d,EAAOsY,EAAoBO,EAC/BP,EAAoBO,EAAI,IAChBmB,QAAQC,IAAI,CAAC,KAAK,KAAK,KAAKpP,IAAIyN,EAAoB/Q,EAAG+Q,IAAsB8C,KAAKpb,GgCAhEsY,EAAoBO,G","sources":["webpack:///webpack/runtime/chunk loaded","webpack:///webpack/runtime/consumes","webpack:///webpack/runtime/startup chunk dependencies","webpack:///../../../src/modules/constants.ts","webpack:///../../../src/modules/validations.ts","webpack:///../../../src/modules/parseEmbedded.ts","webpack:///../../../src/modules/parseJsValue.ts","webpack:///../../../src/modules/parseCallApi.ts","webpack:///../../../src/modules/parseEvent.ts","webpack:///../../../src/modules/getComponentReference.ts","webpack:///../../../src/modules/parseJSXElement.ts","webpack:///../../../src/modules/parseElement.ts","webpack:///../../../src/modules/parseLowLevelChildren.ts","webpack:///../../../src/modules/parseChildren.ts","webpack:///../../../src/modules/getViewTitle.ts","webpack:///../../../src/modules/parseLegacyModule.ts","webpack:///../../../src/modules/parseResourceCall.ts","webpack:///../../../src/modules/parseUseResource.ts","webpack:///../../../src/modules/parseComponent.ts","webpack:///../../../src/modules/parseFunction.ts","webpack:///../../../src/modules/getFilePath.ts","webpack:///../../../src/modules/parseModule.ts","webpack:///../../../src/modules/parseFile.ts","webpack:///./src/shared/workers/tsxParser.worker.ts","webpack:///../../src/parseView.ts","webpack:///webpack/bootstrap","webpack:///webpack/runtime/define property getters","webpack:///webpack/runtime/ensure chunk","webpack:///webpack/runtime/get javascript chunk filename","webpack:///webpack/runtime/global","webpack:///webpack/runtime/hasOwnProperty shorthand","webpack:///webpack/runtime/sharing","webpack:///webpack/runtime/publicPath","webpack:///webpack/runtime/importScripts chunk loading","webpack:///webpack/startup"],"sourcesContent":["var deferred = [];\n__webpack_require__.O = (result, chunkIds, fn, priority) => {\n\tif(chunkIds) {\n\t\tpriority = priority || 0;\n\t\tfor(var i = deferred.length; i > 0 && deferred[i - 1][2] > priority; i--) deferred[i] = deferred[i - 1];\n\t\tdeferred[i] = [chunkIds, fn, priority];\n\t\treturn;\n\t}\n\tvar notFulfilled = Infinity;\n\tfor (var i = 0; i < deferred.length; i++) {\n\t\tvar [chunkIds, fn, priority] = deferred[i];\n\t\tvar fulfilled = true;\n\t\tfor (var j = 0; j < chunkIds.length; j++) {\n\t\t\tif ((priority & 1 === 0 || notFulfilled >= priority) && Object.keys(__webpack_require__.O).every((key) => (__webpack_require__.O[key](chunkIds[j])))) {\n\t\t\t\tchunkIds.splice(j--, 1);\n\t\t\t} else {\n\t\t\t\tfulfilled = false;\n\t\t\t\tif(priority < notFulfilled) notFulfilled = priority;\n\t\t\t}\n\t\t}\n\t\tif(fulfilled) {\n\t\t\tdeferred.splice(i--, 1)\n\t\t\tvar r = fn();\n\t\t\tif (r !== undefined) result = r;\n\t\t}\n\t}\n\treturn result;\n};","var parseVersion = (str) => {\n\t// see webpack/lib/util/semver.js for original code\n\tvar p=p=>{return p.split(\".\").map((p=>{return+p==p?+p:p}))},n=/^([^-+]+)?(?:-([^+]+))?(?:\\+(.+))?$/.exec(str),r=n[1]?p(n[1]):[];return n[2]&&(r.length++,r.push.apply(r,p(n[2]))),n[3]&&(r.push([]),r.push.apply(r,p(n[3]))),r;\n}\nvar versionLt = (a, b) => {\n\t// see webpack/lib/util/semver.js for original code\n\ta=parseVersion(a),b=parseVersion(b);for(var r=0;;){if(r>=a.length)return r<b.length&&\"u\"!=(typeof b[r])[0];var e=a[r],n=(typeof e)[0];if(r>=b.length)return\"u\"==n;var t=b[r],f=(typeof t)[0];if(n!=f)return\"o\"==n&&\"n\"==f||(\"s\"==f||\"u\"==n);if(\"o\"!=n&&\"u\"!=n&&e!=t)return e<t;r++}\n}\nvar rangeToString = (range) => {\n\t// see webpack/lib/util/semver.js for original code\n\tvar r=range[0],n=\"\";if(1===range.length)return\"*\";if(r+.5){n+=0==r?\">=\":-1==r?\"<\":1==r?\"^\":2==r?\"~\":r>0?\"=\":\"!=\";for(var e=1,a=1;a<range.length;a++){e--,n+=\"u\"==(typeof(t=range[a]))[0]?\"-\":(e>0?\".\":\"\")+(e=2,t)}return n}var g=[];for(a=1;a<range.length;a++){var t=range[a];g.push(0===t?\"not(\"+o()+\")\":1===t?\"(\"+o()+\" || \"+o()+\")\":2===t?g.pop()+\" \"+g.pop():rangeToString(t))}return o();function o(){return g.pop().replace(/^\\((.+)\\)$/,\"$1\")}\n}\nvar satisfy = (range, version) => {\n\t// see webpack/lib/util/semver.js for original code\n\tif(0 in range){version=parseVersion(version);var e=range[0],r=e<0;r&&(e=-e-1);for(var n=0,i=1,a=!0;;i++,n++){var f,s,g=i<range.length?(typeof range[i])[0]:\"\";if(n>=version.length||\"o\"==(s=(typeof(f=version[n]))[0]))return!a||(\"u\"==g?i>e&&!r:\"\"==g!=r);if(\"u\"==s){if(!a||\"u\"!=g)return!1}else if(a)if(g==s)if(i<=e){if(f!=range[i])return!1}else{if(r?f>range[i]:f<range[i])return!1;f!=range[i]&&(a=!1)}else if(\"s\"!=g&&\"n\"!=g){if(r||i<=e)return!1;a=!1,i--}else{if(i<=e||s<g!=r)return!1;a=!1}else\"s\"!=g&&\"n\"!=g&&(a=!1,i--)}}var t=[],o=t.pop.bind(t);for(n=1;n<range.length;n++){var u=range[n];t.push(1==u?o()|o():2==u?o()&o():u?satisfy(u,version):!o())}return!!o();\n}\nvar exists = (scope, key) => {\n\treturn scope && __webpack_require__.o(scope, key);\n}\nvar get = (entry) => {\n\tentry.loaded = 1;\n\treturn entry.get()\n};\nvar eagerOnly = (versions) => {\n\treturn Object.keys(versions).reduce((filtered, version) => {\n\t\t\tif (versions[version].eager) {\n\t\t\t\tfiltered[version] = versions[version];\n\t\t\t}\n\t\t\treturn filtered;\n\t}, {});\n};\nvar findLatestVersion = (scope, key, eager) => {\n\tvar versions = eager ? eagerOnly(scope[key]) : scope[key];\n\tvar key = Object.keys(versions).reduce((a, b) => {\n\t\treturn !a || versionLt(a, b) ? b : a;\n\t}, 0);\n\treturn key && versions[key];\n};\nvar findSatisfyingVersion = (scope, key, requiredVersion, eager) => {\n\tvar versions = eager ? eagerOnly(scope[key]) : scope[key];\n\tvar key = Object.keys(versions).reduce((a, b) => {\n\t\tif (!satisfy(requiredVersion, b)) return a;\n\t\treturn !a || versionLt(a, b) ? b : a;\n\t}, 0);\n\treturn key && versions[key]\n};\nvar findSingletonVersionKey = (scope, key, eager) => {\n\tvar versions = eager ? eagerOnly(scope[key]) : scope[key];\n\treturn Object.keys(versions).reduce((a, b) => {\n\t\treturn !a || (!versions[a].loaded && versionLt(a, b)) ? b : a;\n\t}, 0);\n};\nvar getInvalidSingletonVersionMessage = (scope, key, version, requiredVersion) => {\n\treturn \"Unsatisfied version \" + version + \" from \" + (version && scope[key][version].from) + \" of shared singleton module \" + key + \" (required \" + rangeToString(requiredVersion) + \")\"\n};\nvar getInvalidVersionMessage = (scope, scopeName, key, requiredVersion, eager) => {\n\tvar versions = scope[key];\n\treturn \"No satisfying version (\" + rangeToString(requiredVersion) + \")\" + (eager ? \" for eager consumption\" : \"\") + \" of shared module \" + key + \" found in shared scope \" + scopeName + \".\\n\" +\n\t\t\"Available versions: \" + Object.keys(versions).map((key) => {\n\t\treturn key + \" from \" + versions[key].from;\n\t}).join(\", \");\n};\nvar fail = (msg) => {\n\tthrow new Error(msg);\n}\nvar failAsNotExist = (scopeName, key) => {\n\treturn fail(\"Shared module \" + key + \" doesn't exist in shared scope \" + scopeName);\n}\nvar warn = /*#__PURE__*/ (msg) => {\n\tif (typeof console !== \"undefined\" && console.warn) console.warn(msg);\n};\nvar init = (fn) => (function(scopeName, key, eager, c, d) {\n\tvar promise = __webpack_require__.I(scopeName);\n\tif (promise && promise.then && !eager) {\n\t\treturn promise.then(fn.bind(fn, scopeName, __webpack_require__.S[scopeName], key, false, c, d));\n\t}\n\treturn fn(scopeName, __webpack_require__.S[scopeName], key, eager, c, d);\n});\n\nvar useFallback = (scopeName, key, fallback) => {\n\treturn fallback ? fallback() : failAsNotExist(scopeName, key);\n}\nvar load = /*#__PURE__*/ init((scopeName, scope, key, eager, fallback) => {\n\tif (!exists(scope, key)) return useFallback(scopeName, key, fallback);\n\treturn get(findLatestVersion(scope, key, eager));\n});\nvar loadVersion = /*#__PURE__*/ init((scopeName, scope, key, eager, requiredVersion, fallback) => {\n\tif (!exists(scope, key)) return useFallback(scopeName, key, fallback);\n\tvar satisfyingVersion = findSatisfyingVersion(scope, key, requiredVersion, eager);\n\tif (satisfyingVersion) return get(satisfyingVersion);\n\twarn(getInvalidVersionMessage(scope, scopeName, key, requiredVersion, eager))\n\treturn get(findLatestVersion(scope, key, eager));\n});\nvar loadStrictVersion = /*#__PURE__*/ init((scopeName, scope, key, eager, requiredVersion, fallback) => {\n\tif (!exists(scope, key)) return useFallback(scopeName, key, fallback);\n\tvar satisfyingVersion = findSatisfyingVersion(scope, key, requiredVersion, eager);\n\tif (satisfyingVersion) return get(satisfyingVersion);\n\tif (fallback) return fallback();\n\tfail(getInvalidVersionMessage(scope, scopeName, key, requiredVersion, eager));\n});\nvar loadSingleton = /*#__PURE__*/ init((scopeName, scope, key, eager, fallback) => {\n\tif (!exists(scope, key)) return useFallback(scopeName, key, fallback);\n\tvar version = findSingletonVersionKey(scope, key, eager);\n\treturn get(scope[key][version]);\n});\nvar loadSingletonVersion = /*#__PURE__*/ init((scopeName, scope, key, eager, requiredVersion, fallback) => {\n\tif (!exists(scope, key)) return useFallback(scopeName, key, fallback);\n\tvar version = findSingletonVersionKey(scope, key, eager);\n\tif (!satisfy(requiredVersion, version)) {\n\t\twarn(getInvalidSingletonVersionMessage(scope, key, version, requiredVersion));\n\t}\n\treturn get(scope[key][version]);\n});\nvar loadStrictSingletonVersion = /*#__PURE__*/ init((scopeName, scope, key, eager, requiredVersion, fallback) => {\n\tif (!exists(scope, key)) return useFallback(scopeName, key, fallback);\n\tvar version = findSingletonVersionKey(scope, key, eager);\n\tif (!satisfy(requiredVersion, version)) {\n\t\tfail(getInvalidSingletonVersionMessage(scope, key, version, requiredVersion));\n\t}\n\treturn get(scope[key][version]);\n});\nvar installedModules = {};\nvar moduleToHandlerMapping = {\n\t40580: () => (loadSingletonVersion(\"default\", \"@babel/parser\", false, [0], () => (__webpack_require__.e(6773).then(() => (() => (__webpack_require__(46773)))))))\n};\n// no consumes in initial chunks\nvar chunkMapping = {\n\t\"580\": [\n\t\t40580\n\t]\n};\nvar startedInstallModules = {};\n__webpack_require__.f.consumes = (chunkId, promises) => {\n\tif(__webpack_require__.o(chunkMapping, chunkId)) {\n\t\tchunkMapping[chunkId].forEach((id) => {\n\t\t\tif(__webpack_require__.o(installedModules, id)) return promises.push(installedModules[id]);\n\t\t\tif(!startedInstallModules[id]) {\n\t\t\tvar onFactory = (factory) => {\n\t\t\t\tinstalledModules[id] = 0;\n\t\t\t\t__webpack_require__.m[id] = (module) => {\n\t\t\t\t\tdelete __webpack_require__.c[id];\n\t\t\t\t\tmodule.exports = factory();\n\t\t\t\t}\n\t\t\t};\n\t\t\tstartedInstallModules[id] = true;\n\t\t\tvar onError = (error) => {\n\t\t\t\tdelete installedModules[id];\n\t\t\t\t__webpack_require__.m[id] = (module) => {\n\t\t\t\t\tdelete __webpack_require__.c[id];\n\t\t\t\t\tthrow error;\n\t\t\t\t}\n\t\t\t};\n\t\t\ttry {\n\t\t\t\tvar promise = moduleToHandlerMapping[id]();\n\t\t\t\tif(promise.then) {\n\t\t\t\t\tpromises.push(installedModules[id] = promise.then(onFactory)['catch'](onError));\n\t\t\t\t} else onFactory(promise);\n\t\t\t} catch(e) { onError(e); }\n\t\t\t}\n\t\t});\n\t}\n}","var next = __webpack_require__.x;\n__webpack_require__.x = () => {\n\treturn Promise.all([8135,3735,580].map(__webpack_require__.e, __webpack_require__)).then(next);\n};","export const MODULE_SOURCE = \"next-tsx\";\n\nexport const CALL_API_LIST = [\"callApi\", \"callHttp\", \"callTool\"] as const;\n","import type { NodePath } from \"@babel/traverse\";\nimport * as t from \"@babel/types\";\nimport type { ComponentChild, ParsedModule } from \"./interfaces.js\";\nimport { MODULE_SOURCE } from \"./constants.js\";\n\nexport function validateFunction(\n fn: t.FunctionDeclaration | t.FunctionExpression | t.ArrowFunctionExpression,\n state: ParsedModule\n): boolean {\n if (fn.async || fn.generator) {\n state.errors.push({\n message: `Function cannot be async or generator`,\n node: fn,\n severity: \"error\",\n });\n return false;\n }\n\n return true;\n}\n\nexport function validateGlobalApi(\n id: NodePath<t.Identifier | t.JSXIdentifier>,\n api: string\n): boolean {\n const ref = id.referencesImport(MODULE_SOURCE, api);\n if (ref) {\n return true;\n }\n return id.node.name === api && !id.scope.getBinding(id.node.name);\n}\n\nexport function validateEmbeddedExpression(\n expr: t.Expression,\n state: ParsedModule | null\n): boolean {\n let invalidNode: t.Node | null = null;\n\n t.traverse(expr, {\n enter(node, parent) {\n if (\n !invalidNode &&\n (t.isFunctionExpression(node) ||\n t.isStatement(node) ||\n t.isAwaitExpression(node) ||\n t.isYieldExpression(node) ||\n t.isJSX(node) ||\n (t.isArrowFunctionExpression(node) &&\n (node.async ||\n node.generator ||\n t.isBlockStatement(node.body) ||\n t.isObjectProperty(parent[parent.length - 1]?.node))))\n ) {\n invalidNode = node;\n }\n },\n });\n\n if (invalidNode) {\n state?.errors.push({\n message: `Unsupported expression type: ${(invalidNode as t.Node).type}`,\n node: invalidNode,\n severity: \"error\",\n });\n return false;\n }\n\n return true;\n}\n\nexport function isNilPath(path: NodePath<t.Node>) {\n return (\n path.isNullLiteral() ||\n (path.isIdentifier() &&\n path.node.name === \"undefined\" &&\n path.scope.getBinding(\"undefined\") === undefined)\n );\n}\n\nconst EXPRESSION_PREFIX_REG = /^<%=?\\s/;\nconst EXPRESSION_SUFFIX_REG = /\\s%>$/;\n\nexport function isExpressionString(value: unknown): value is string {\n if (typeof value !== \"string\") {\n return false;\n }\n const trimmed = value.trim();\n return (\n EXPRESSION_PREFIX_REG.test(trimmed) && EXPRESSION_SUFFIX_REG.test(trimmed)\n );\n}\n\nexport function isAnyOfficialComponent(child: ComponentChild) {\n return (\n !child.reference ||\n (child.reference.type === \"imported\" &&\n child.reference.importSource === MODULE_SOURCE)\n );\n}\n\nexport function isOfficialComponent(child: ComponentChild, name: string) {\n return (\n isAnyOfficialComponent(child) &&\n (child.reference ? child.reference.name === name : child.name === name)\n );\n}\n","import type { NodePath, Visitor } from \"@babel/traverse\";\nimport type * as t from \"@babel/types\";\nimport type { ParseJsValueOptions, ParsedModule } from \"./interfaces.js\";\n\ntype Replacement = IdReplacement | Annotation;\n\ninterface IdReplacement {\n type: \"id\";\n start: number;\n end: number;\n replacement: string;\n shorthand?: string;\n}\n\ninterface Annotation {\n type: \"annotation\";\n start: number;\n end: number;\n}\n\nexport function parseEmbedded(\n path: NodePath<t.Expression | t.FunctionDeclaration>,\n state: ParsedModule,\n options: ParseJsValueOptions,\n noWrapping?: boolean\n): string {\n const replacements: Replacement[] = [];\n\n const visitor: Visitor = {\n TSTypeAnnotation(tsPath) {\n replacements.push({\n type: \"annotation\",\n start: tsPath.node.start!,\n end: tsPath.node.end!,\n });\n tsPath.skip();\n },\n TSTypeParameterInstantiation(tsPath) {\n replacements.push({\n type: \"annotation\",\n start: tsPath.node.start!,\n end: tsPath.node.end!,\n });\n tsPath.skip();\n },\n TSAsExpression(tsPath) {\n replacements.push({\n type: \"annotation\",\n start: tsPath.node.expression.end!,\n end: tsPath.node.end!,\n });\n tsPath.skip();\n },\n Identifier(idPath) {\n if (!idPath.isReferencedIdentifier()) {\n return;\n }\n const shorthand =\n idPath.parentPath.isObjectProperty() &&\n idPath.parentPath.node.shorthand;\n const varName = idPath.node.name;\n const bindingId = idPath.scope.getBindingIdentifier(varName);\n if (bindingId) {\n let specificReplacement: string | undefined;\n switch (bindingId) {\n case options.eventBinding?.id:\n specificReplacement = options.eventBinding?.isCallback\n ? \"EVENT.detail\"\n : \"EVENT\";\n break;\n case options.forEachBinding?.item:\n specificReplacement = \"ITEM\";\n break;\n case options.forEachBinding?.index:\n specificReplacement = \"INDEX\";\n break;\n case options.dataBinding?.id:\n specificReplacement = \"DATA\";\n break;\n }\n if (specificReplacement) {\n replacements.push({\n type: \"id\",\n start: idPath.node.start!,\n end: idPath.node.end!,\n replacement: specificReplacement,\n shorthand: shorthand ? varName : undefined,\n });\n return;\n }\n\n const binding = options.component?.bindingMap.get(bindingId);\n if (binding) {\n if (\n binding.kind === \"state\" ||\n binding.kind === \"resource\" ||\n binding.kind === \"constant\" ||\n binding.kind === \"param\" ||\n binding.kind === \"query\"\n ) {\n replacements.push({\n type: \"id\",\n start: idPath.node.start!,\n end: idPath.node.end!,\n replacement:\n binding.kind === \"query\"\n ? \"QUERY\"\n : `${options.component!.type === \"template\" ? \"STATE\" : \"CTX\"}.${bindingId.name}`,\n shorthand: shorthand ? varName : undefined,\n });\n } else {\n state.errors.push({\n message: `Invalid usage of ${binding.kind} variable \"${bindingId.name}\"`,\n node: idPath.node,\n severity: \"error\",\n });\n }\n } else if (options.functionBindings?.has(bindingId)) {\n replacements.push({\n type: \"id\",\n start: idPath.node.start!,\n end: idPath.node.end!,\n replacement: `FN.${varName}`,\n shorthand: shorthand ? varName : undefined,\n });\n }\n } else if (options.contextBindings?.includes(varName)) {\n replacements.push({\n type: \"id\",\n start: idPath.node.start!,\n end: idPath.node.end!,\n replacement: `CTX.${varName}`,\n shorthand: shorthand ? varName : undefined,\n });\n }\n },\n };\n\n if (path.isIdentifier()) {\n (visitor.Identifier as any)(path);\n }\n path.traverse(visitor);\n\n replacements.sort((a, b) => a.start - b.start);\n\n const chunks: string[] = [];\n let prevStart = path.node.start!;\n for (const rep of replacements) {\n chunks.push(\n state.source.substring(prevStart, rep.start),\n rep.type === \"annotation\"\n ? \"\"\n : `${rep.shorthand ? `${rep.shorthand}:` : \"\"}${rep.replacement}`\n );\n prevStart = rep.end;\n }\n chunks.push(state.source.substring(prevStart, path.node.end!));\n\n const value = chunks.join(\"\");\n\n if (noWrapping) {\n return value;\n }\n\n return `<%${options.modifier ?? \"\"} ${value} %>`;\n}\n","import type { NodePath } from \"@babel/traverse\";\nimport * as t from \"@babel/types\";\nimport type {\n ParseJsValueOptions,\n ParsedModule,\n RenderUseBrick,\n} from \"./interfaces.js\";\nimport { validateEmbeddedExpression } from \"./validations.js\";\nimport { parseEmbedded } from \"./parseEmbedded.js\";\nimport { parseChildren } from \"./parseChildren.js\";\n\nconst ambiguousSymbol = Symbol(\"ambiguous\");\n\nexport function parseJsValue(\n path: NodePath<t.Node>,\n state: ParsedModule,\n options: ParseJsValueOptions\n): unknown {\n if (path.isTSAsExpression()) {\n return parseJsValue(path.get(\"expression\"), state, options);\n }\n\n if (path.isObjectExpression()) {\n return parseJsObject(path, state, options);\n }\n\n if (path.isArrayExpression()) {\n return parseJsArray(path, state, options);\n }\n\n if (\n path.isStringLiteral() ||\n path.isNumericLiteral() ||\n path.isBooleanLiteral()\n ) {\n return path.node.value;\n }\n\n if (path.isNullLiteral()) {\n return null;\n }\n\n if (\n path.isIdentifier() &&\n path.node.name === \"undefined\" &&\n path.scope.getBinding(\"undefined\") === undefined\n ) {\n return undefined;\n }\n\n if (options.allowUseBrick && path.isArrowFunctionExpression()) {\n const expr = path.get(\"body\");\n if (expr.isBlockStatement()) {\n state.errors.push({\n message: \"Block statements are not supported in render callback\",\n node: expr.node,\n severity: \"error\",\n });\n return null;\n }\n const paramNames: string[] = [];\n for (const param of path.get(\"params\")) {\n if (param.isIdentifier()) {\n paramNames.push(param.node.name);\n } else {\n state.errors.push({\n message: `Unsupported parameter type: ${param.type}`,\n node: param.node,\n severity: \"error\",\n });\n return null;\n }\n }\n return {\n params: paramNames,\n children: parseChildren(expr, state, options),\n } as RenderUseBrick;\n }\n\n if (path.isExpression()) {\n if (!validateEmbeddedExpression(path.node, state)) {\n return null;\n }\n\n if (options.ambiguous) {\n return ambiguousSymbol;\n }\n\n return parseEmbedded(path, state, options);\n }\n\n state.errors.push({\n message: `Unsupported value type: ${path.node.type}`,\n node: path.node,\n severity: \"error\",\n });\n return null;\n}\n\nexport function parsePropValue(\n path: NodePath<t.Expression>,\n state: ParsedModule,\n options: ParseJsValueOptions\n) {\n let shouldCompute = false;\n t.traverse(path.node, {\n enter(node, parent) {\n let p: t.Node | undefined;\n if (\n !shouldCompute &&\n !(\n t.isStringLiteral(node) ||\n t.isNumericLiteral(node) ||\n t.isBooleanLiteral(node) ||\n t.isNullLiteral(node) ||\n t.isObjectExpression(node) ||\n t.isArrayExpression(node) ||\n t.isObjectProperty(node) ||\n (t.isIdentifier(node) &&\n ((p = parent[parent.length - 1]?.node), true) &&\n (p && t.isObjectProperty(p)\n ? !p.computed && !p.shorthand\n : node.name === \"undefined\"))\n )\n ) {\n shouldCompute = true;\n }\n },\n });\n\n if (shouldCompute && validateEmbeddedExpression(path.node, null)) {\n return parseEmbedded(path, state, options);\n }\n\n return parseJsValue(path, state, options);\n}\n\nfunction parseJsObject(\n path: NodePath<t.ObjectExpression>,\n state: ParsedModule,\n options: ParseJsValueOptions\n) {\n const props = path.get(\"properties\");\n if (\n props.some(\n (p) =>\n p.isSpreadElement() ||\n (p.isObjectProperty() && (p.node.computed || p.node.shorthand))\n ) &&\n validateEmbeddedExpression(path.node, state)\n ) {\n if (options.ambiguous) {\n return ambiguousSymbol;\n }\n return parseEmbedded(path, state, options);\n }\n\n const result: Record<string, unknown> = {};\n\n for (const prop of props) {\n if (!prop.isObjectProperty()) {\n state.errors.push({\n message: `Unsupported property type: ${prop.type}`,\n node: prop.node,\n severity: \"error\",\n });\n continue;\n }\n\n if (prop.node.computed || prop.node.shorthand) {\n state.errors.push({\n message: \"Unsupported computed or shorthand object property\",\n node: prop.node.key,\n severity: \"error\",\n });\n continue;\n }\n\n const keyPath = prop.get(\"key\");\n let key: string;\n if (keyPath.isIdentifier()) {\n key = keyPath.node.name;\n } else if (keyPath.isStringLiteral()) {\n key = keyPath.node.value;\n } else {\n state.errors.push({\n message: `Unsupported object key type: ${keyPath.node.type}`,\n node: keyPath.node,\n severity: \"error\",\n });\n continue;\n }\n\n result[key] = parseJsValue(prop.get(\"value\"), state, options);\n }\n\n return result;\n}\n\nfunction parseJsArray(\n path: NodePath<t.ArrayExpression>,\n state: ParsedModule,\n options: ParseJsValueOptions\n) {\n const elements = path.get(\"elements\");\n if (\n elements.some((e) => !e || e.isSpreadElement()) &&\n validateEmbeddedExpression(path.node, state)\n ) {\n if (options.ambiguous) {\n return ambiguousSymbol;\n }\n return parseEmbedded(path, state, options);\n }\n\n const result: unknown[] = [];\n\n for (const elem of elements) {\n if (!elem.node) {\n state.errors.push({\n message: \"Array elements cannot be empty\",\n node: path.node,\n severity: \"error\",\n });\n continue;\n }\n if (elem.isSpreadElement()) {\n state.errors.push({\n message: \"Spread elements are not supported in array\",\n node: elem.node,\n severity: \"error\",\n });\n continue;\n }\n result.push(parseJsValue(elem as NodePath<t.Expression>, state, options));\n }\n\n return result;\n}\n","import type { NodePath } from \"@babel/traverse\";\nimport type * as t from \"@babel/types\";\nimport type {\n ParseJsValueOptions,\n ParsedModule,\n ToolInfo,\n} from \"./interfaces.js\";\nimport { parseJsValue } from \"./parseJsValue.js\";\nimport {\n isExpressionString,\n isNilPath,\n validateGlobalApi,\n} from \"./validations.js\";\nimport { CALL_API_LIST } from \"./constants.js\";\n\nexport interface CallApiPayload {\n api: string;\n http?: boolean;\n tool?: ToolInfo;\n params?: string | Record<string, unknown>;\n ambiguousParams?: unknown;\n objectId?: string;\n}\n\nconst EXPECTED_ARGS = {\n callApi: [2, 3],\n callHttp: [1, 2],\n callTool: [2, 3],\n};\n\nexport function parseCallApi(\n path: NodePath<t.Expression>,\n state: ParsedModule,\n options: ParseJsValueOptions\n): CallApiPayload | null {\n if (!(path.isCallExpression() || path.isOptionalCallExpression())) {\n state.errors.push({\n message: `Await expression must be a call expression, received ${path.node.type}`,\n node: path.node,\n severity: \"error\",\n });\n return null;\n }\n const callee = path.get(\"callee\") as NodePath<t.Expression>;\n let calleeName: \"callApi\" | \"callHttp\" | \"callTool\" | undefined;\n if (callee.isIdentifier()) {\n for (const name of CALL_API_LIST) {\n if (validateGlobalApi(callee, name)) {\n calleeName = name;\n break;\n }\n }\n if (!calleeName) {\n state.errors.push({\n message: `Await expression must call \"callApi\", \"callHttp\" or \"callTool\", received \"${callee.node.name}\"`,\n node: callee.node,\n severity: \"error\",\n });\n return null;\n }\n } else {\n state.errors.push({\n message: `Await expression must call an identifier, received ${callee.type}`,\n node: callee.node,\n severity: \"error\",\n });\n return null;\n }\n\n const expectedArgs = EXPECTED_ARGS[calleeName];\n\n const args = path.get(\"arguments\") as NodePath<\n t.Expression | t.SpreadElement | t.ArgumentPlaceholder\n >[];\n const missingArgs = args.length < expectedArgs[0];\n if (missingArgs || !expectedArgs.includes(args.length)) {\n state.errors.push({\n message: `\"${calleeName}()\" expects ${expectedArgs.join(\" or \")} arguments, but got ${args.length}`,\n node: path.node,\n severity: missingArgs ? \"error\" : \"warning\",\n });\n if (missingArgs) {\n return null;\n }\n }\n\n let payload: CallApiPayload;\n const firstArg = args[0];\n\n if (calleeName === \"callHttp\") {\n const value = parseJsValue(firstArg, state, options);\n if (typeof value !== \"string\") {\n state.errors.push({\n message: `\"${calleeName}()\" expects a string value as the first argument, but got ${typeof value}`,\n node: firstArg.node,\n severity: \"error\",\n });\n return null;\n }\n payload = {\n api: value,\n http: true,\n };\n } else if (calleeName === \"callApi\") {\n if (!firstArg.isStringLiteral()) {\n state.errors.push({\n message: `\"${calleeName}()\" expects a string literal as the first argument, but got ${firstArg.type}`,\n node: firstArg.node,\n severity: \"error\",\n });\n return null;\n }\n payload = {\n api: firstArg.node.value,\n };\n } else {\n const conversationId = parseJsValue(firstArg, state, options);\n if (typeof conversationId !== \"string\") {\n state.errors.push({\n message: `\"${calleeName}()\" expects a string value as the first argument, but got ${typeof conversationId}`,\n node: firstArg.node,\n severity: \"error\",\n });\n return null;\n }\n\n const secondArg = args[1];\n const stepId = parseJsValue(secondArg, state, options);\n if (typeof stepId !== \"string\") {\n state.errors.push({\n message: `\"${calleeName}()\" expects a string value as the second argument, but got ${typeof stepId}`,\n node: secondArg.node,\n severity: \"error\",\n });\n return null;\n }\n\n const paramsNode = args[2];\n let params: string | Record<string, unknown> | undefined;\n if (paramsNode) {\n params = parseJsValue(paramsNode, state, options) as\n | string\n | Record<string, unknown>;\n }\n payload = {\n api: calleeName,\n tool: { conversationId, stepId },\n params,\n };\n }\n\n if (calleeName === \"callApi\" || calleeName === \"callHttp\") {\n const valuePath = args[1];\n\n if (valuePath && !isNilPath(valuePath)) {\n if (!valuePath.isObjectExpression()) {\n state.errors.push({\n message: `Data source \"params\" prefers an object literal, but got ${valuePath.type}`,\n node: valuePath.node,\n severity: \"notice\",\n });\n }\n const params = parseJsValue(valuePath, state, options);\n if (\n isExpressionString(params) ||\n (typeof params === \"object\" && params !== null)\n ) {\n payload.params = params as string | Record<string, unknown>;\n } else {\n state.errors.push({\n message: `API params expects an object or expression, but got ${typeof params}`,\n node: valuePath.node,\n severity: \"error\",\n });\n }\n // TODO: set ambiguousProps when reward is enabled\n }\n }\n\n if (calleeName === \"callApi\") {\n const metaPath = args[2];\n if (metaPath && !isNilPath(metaPath)) {\n if (!metaPath.isObjectExpression()) {\n state.errors.push({\n message: `\"callApi()\" third param \"meta\" expects an object literal, but got ${metaPath.type}`,\n node: metaPath.node,\n severity: \"error\",\n });\n } else {\n const props = metaPath.get(\"properties\");\n for (const prop of props) {\n if (!prop.isObjectProperty()) {\n state.errors.push({\n message: `\"callApi()\" third param \"meta\" expects object properties, but got ${prop.type}`,\n node: prop.node,\n severity: \"error\",\n });\n continue;\n }\n const key = prop.get(\"key\");\n if (!key.isIdentifier()) {\n state.errors.push({\n message: `\"callApi()\" third param \"meta\" property key must be an identifier, but got ${key.type}`,\n node: key.node,\n severity: \"error\",\n });\n continue;\n }\n if (key.node.name !== \"objectId\") {\n state.errors.push({\n message: `\"callApi()\" third param \"meta\" property key must be \"objectId\", but got \"${key.node.name}\"`,\n node: key.node,\n severity: \"error\",\n });\n continue;\n }\n const value = prop.get(\"value\");\n if (!isNilPath(value)) {\n if (!value.isStringLiteral()) {\n state.errors.push({\n message: `\"callApi()\" third param \"meta\" property \"${key.node.name}\" expects a string literal, but got ${value.type}`,\n node: value.node,\n severity: \"error\",\n });\n continue;\n }\n payload.objectId = value.node.value;\n }\n }\n }\n }\n }\n\n return payload;\n}\n","import type { NodePath } from \"@babel/traverse\";\nimport type * as t from \"@babel/types\";\nimport type {\n BindingInfo,\n EventHandler,\n ParseJsValueOptions,\n ParsedModule,\n TypeEventHandlerOfShowMessage,\n} from \"./interfaces.js\";\nimport { parseJsValue } from \"./parseJsValue.js\";\nimport { CALL_API_LIST } from \"./constants.js\";\nimport { parseCallApi } from \"./parseCallApi.js\";\nimport { validateGlobalApi } from \"./validations.js\";\n\nexport function parseEvent(\n path: NodePath<t.Node>,\n state: ParsedModule,\n options: ParseJsValueOptions,\n isCallback?: boolean\n): EventHandler[] | null {\n if (!path.isArrowFunctionExpression()) {\n state.errors.push({\n message: `Event handler must be an arrow function expression, but got ${path.type}`,\n node: path.node,\n severity: \"error\",\n });\n return null;\n }\n\n const params = path.get(\"params\");\n if (params.length > 1) {\n state.errors.push({\n message: `Event handler arrow function must have at most one parameter, but got ${params.length}`,\n node: path.node,\n severity: \"error\",\n });\n return null;\n }\n\n const param = params[0];\n const eventOptions: ParseJsValueOptions = {\n ...options,\n modifier: undefined,\n eventBinding: undefined,\n };\n if (param) {\n if (!param.isIdentifier()) {\n state.errors.push({\n message: `Event handler arrow function parameter must be an identifier, but got ${param.type}`,\n node: param.node,\n severity: \"error\",\n });\n return null;\n }\n eventOptions.eventBinding = { id: param.node, isCallback };\n }\n\n const body = path.get(\"body\");\n const handler = parseEventHandler(body, state, eventOptions);\n if (!handler) {\n return null;\n }\n\n return ([] as EventHandler[]).concat(handler);\n}\n\nfunction parseEventHandler(\n path: NodePath<t.Statement | t.Expression | null | undefined>,\n state: ParsedModule,\n options: ParseJsValueOptions\n): EventHandler | EventHandler[] | null {\n if (path.isBlockStatement()) {\n return path\n .get(\"body\")\n .flatMap((stmtPath) => parseEventHandler(stmtPath, state, options))\n .filter((h): h is EventHandler => h !== null);\n }\n\n if (path.isIfStatement()) {\n const test = parseJsValue(path.get(\"test\"), state, options) as\n | string\n | boolean\n | undefined;\n return {\n action: \"conditional\",\n payload: {\n test,\n consequent: parseEventHandler(path.get(\"consequent\"), state, options),\n alternate: path.node.alternate\n ? parseEventHandler(path.get(\"alternate\"), state, options)\n : null,\n },\n };\n }\n\n if (path.isExpressionStatement()) {\n return parseEventHandler(path.get(\"expression\"), state, options);\n }\n\n if (path.isCallExpression() || path.isOptionalCallExpression()) {\n const callee = (path as NodePath<t.CallExpression>).get(\"callee\");\n const args = (path as NodePath<t.CallExpression>).get(\n \"arguments\"\n ) as NodePath<t.Expression | t.SpreadElement>[];\n if (callee.isIdentifier()) {\n if (validateGlobalApi(callee, \"showMessage\")) {\n if (args.length !== 1) {\n state.errors.push({\n message: `\"showMessage()\" expects exactly 1 argument, but got ${args.length}`,\n node: path.node,\n severity: \"error\",\n });\n return null;\n }\n const payload = parseJsValue(args[0], state, options);\n return {\n action: \"show_message\",\n payload,\n } as TypeEventHandlerOfShowMessage;\n }\n\n if (validateGlobalApi(callee, \"pushQuery\")) {\n if (args.length !== 1 && args.length !== 2) {\n state.errors.push({\n message: `\"pushQuery()\" expects 1 or 2 arguments, but got ${args.length}`,\n node: path.node,\n severity: \"error\",\n });\n return null;\n }\n const queryArgs = args.map((arg) => parseJsValue(arg, state, options));\n return {\n action: \"update_query\",\n payload: {\n method: \"push\",\n args: queryArgs,\n },\n };\n }\n\n for (const name of CALL_API_LIST) {\n if (validateGlobalApi(callee, name)) {\n const payload = parseCallApi(path, state, options);\n if (!payload) {\n return null;\n }\n state.contracts.add(payload.api);\n return {\n action: \"call_api\",\n payload,\n };\n }\n }\n\n // Assert: callee.isReferencedIdentifier()\n const bindingId = callee.scope.getBindingIdentifier(callee.node.name);\n let binding: BindingInfo | undefined;\n if (bindingId) {\n binding = options.component?.bindingMap.get(bindingId);\n }\n if (!binding) {\n state.errors.push({\n message: `Function \"${callee.node.name}\" is not defined`,\n node: callee.node,\n severity: \"error\",\n });\n return null;\n }\n switch (binding.kind) {\n case \"setState\":\n return {\n action: \"update_variable\",\n payload: {\n name: binding.id.name,\n value:\n args[0] === undefined\n ? undefined\n : parseJsValue(args[0], state, {\n ...options,\n modifier: undefined,\n }),\n },\n };\n default:\n state.errors.push({\n message: `\"${callee.node.name}\" is not callable`,\n node: callee.node,\n severity: \"error\",\n });\n return null;\n }\n } else if (\n callee.isMemberExpression() ||\n callee.isOptionalMemberExpression()\n ) {\n if (callee.node.computed) {\n state.errors.push({\n message: `Event handler call expression with computed member expression is not supported`,\n node: callee.node,\n severity: \"error\",\n });\n return null;\n }\n const object = (callee as NodePath<t.MemberExpression>).get(\"object\");\n if (object.isMemberExpression() || object.isOptionalMemberExpression()) {\n const property = (object as NodePath<t.MemberExpression>).get(\n \"property\"\n );\n if (\n !object.node.computed &&\n property.isIdentifier() &&\n property.node.name === \"current\"\n ) {\n const refObject = (object as NodePath<t.MemberExpression>).get(\n \"object\"\n );\n if (refObject.isIdentifier()) {\n const refBindingId = refObject.scope.getBindingIdentifier(\n refObject.node.name\n );\n let refBinding: BindingInfo | undefined;\n if (refBindingId) {\n refBinding = options.component?.bindingMap.get(refBindingId);\n }\n if (!refBinding) {\n state.errors.push({\n message: `Variable \"${refObject.node.name}\" is not defined`,\n node: refObject.node,\n severity: \"error\",\n });\n return null;\n }\n if (refBinding.kind !== \"ref\") {\n state.errors.push({\n message: `Variable \"${refObject.node.name}\" is not a ref, but a ${refBinding.kind}`,\n node: refObject.node,\n severity: \"error\",\n });\n return null;\n }\n const property = (callee as NodePath<t.MemberExpression>).get(\n \"property\"\n );\n if (!property.isIdentifier()) {\n state.errors.push({\n message: `Event handler call expression with non-identifier property is not supported`,\n node: property.node,\n severity: \"error\",\n });\n return null;\n }\n return {\n action: \"call_ref\",\n payload: {\n ref: refBinding.id.name,\n method: property.node.name,\n args: args.map((arg) => parseJsValue(arg, state, options)),\n scope:\n options.component?.type === \"template\"\n ? \"template\"\n : \"global\",\n },\n };\n }\n }\n }\n\n if (!object.isCallExpression()) {\n state.errors.push({\n message: `Member expression in event handler expects a call expression as object, but got ${object.type}`,\n node: object.node,\n severity: \"error\",\n });\n return null;\n }\n const objectCallee = object.get(\"callee\");\n if (!objectCallee.isIdentifier()) {\n state.errors.push({\n message: `Member expression in event handler expects an identifier as callee, but got ${objectCallee.type}`,\n node: objectCallee.node,\n severity: \"error\",\n });\n return null;\n }\n const property = (callee as NodePath<t.MemberExpression>).get(\"property\");\n if (!property.isIdentifier()) {\n state.errors.push({\n message: `Member expression in event handler expects an identifier as property, but got ${property.type}`,\n node: property.node,\n severity: \"error\",\n });\n return null;\n }\n // const action = objectCallee.node.name;\n let calleeName: \"callApi\" | \"callHttp\" | \"callTool\" | undefined;\n for (const name of CALL_API_LIST) {\n if (validateGlobalApi(objectCallee, name)) {\n calleeName = name;\n break;\n }\n }\n if (calleeName) {\n if (property.node.name !== \"then\") {\n state.errors.push({\n message: `\"${calleeName}()\" expects \"then\" as its method, but got ${property.node.name}`,\n node: property.node,\n severity: \"error\",\n });\n return null;\n }\n if (args.length !== 1) {\n state.errors.push({\n message: `\"${calleeName}().then()\" expects exactly 1 argument, but got ${args.length}`,\n node: property.node,\n severity: \"error\",\n });\n return null;\n }\n const payload = parseCallApi(object, state, options);\n if (!payload) {\n return null;\n }\n state.contracts.add(payload.api);\n const successCallback = parseEvent(args[0], state, options, true);\n return {\n action: \"call_api\",\n payload,\n callback: successCallback ? { success: successCallback } : undefined,\n };\n }\n\n state.errors.push({\n message: `Unsupported action in event handler: ${objectCallee.node.name}`,\n node: objectCallee.node,\n severity: \"error\",\n });\n return null;\n }\n }\n\n state.errors.push({\n message: `Unsupported event handler`,\n node: path.node,\n severity: \"error\",\n });\n\n return null;\n}\n","import type { NodePath } from \"@babel/traverse\";\nimport type * as t from \"@babel/types\";\nimport type {\n ComponentReference,\n ParseJsValueOptions,\n ParsedModule,\n} from \"./interfaces.js\";\n\nexport function getComponentReference(\n path: NodePath<t.Identifier | t.JSXIdentifier>,\n state: ParsedModule,\n options: ParseJsValueOptions\n): ComponentReference | null {\n if (!path.isReferencedIdentifier()) {\n return null;\n }\n\n const componentName = path.node.name;\n const binding = path.scope.getBinding(componentName);\n if (!binding) {\n return null;\n }\n\n if (options.componentBindings?.has(binding.identifier)) {\n return {\n type: \"local\",\n name: componentName,\n };\n }\n\n if (binding.kind === \"module\") {\n if (\n binding.path.isImportSpecifier() &&\n binding.path.parentPath.isImportDeclaration()\n ) {\n const imported = binding.path.get(\"imported\");\n if (!imported.isIdentifier()) {\n state.errors.push({\n message: `Unsupported import specifier type: ${imported.type}`,\n node: imported.node,\n severity: \"error\",\n });\n return null;\n }\n const source = binding.path.parentPath.get(\"source\");\n return {\n type: \"imported\",\n name: imported.node.name,\n importSource: source.node.value,\n };\n }\n\n if (\n binding.path.isImportDefaultSpecifier() &&\n binding.path.parentPath.isImportDeclaration()\n ) {\n const source = binding.path.parentPath.get(\"source\");\n return {\n type: \"imported\",\n importSource: source.node.value,\n };\n }\n }\n\n state.errors.push({\n message: `Unsupported component binding for \"${componentName}\"`,\n node: binding.identifier,\n severity: \"error\",\n });\n\n return null;\n}\n","import type { NodePath } from \"@babel/traverse\";\nimport * as t from \"@babel/types\";\nimport type {\n BindingInfo,\n ComponentChild,\n EventHandler,\n Events,\n ParseJsValueOptions,\n ParsedModule,\n} from \"./interfaces.js\";\nimport { parsePropValue } from \"./parseJsValue.js\";\nimport { parseLowLevelChildren } from \"./parseLowLevelChildren.js\";\nimport type { ChildElement } from \"./internal-interfaces.js\";\nimport { parseElement } from \"./parseElement.js\";\nimport { parseEvent } from \"./parseEvent.js\";\nimport { validateGlobalApi } from \"./validations.js\";\nimport { getComponentReference } from \"./getComponentReference.js\";\n\nexport function parseJSXElement(\n path: NodePath<t.JSXElement>,\n state: ParsedModule,\n options: ParseJsValueOptions\n): ChildElement | null | (ChildElement | null)[] {\n const openingElement = path.get(\"openingElement\");\n const tagName = openingElement.get(\"name\");\n if (!tagName.isJSXIdentifier()) {\n state.errors.push({\n message: `Unsupported JSX element name type: ${tagName.type}`,\n node: tagName.node,\n severity: \"error\",\n });\n return null;\n }\n\n if (validateGlobalApi(tagName, \"Fragment\")) {\n for (const attr of openingElement.node.attributes) {\n if (\n !(\n t.isJSXAttribute(attr) &&\n t.isJSXIdentifier(attr.name) &&\n attr.name.name === \"key\"\n )\n ) {\n state.errors.push({\n message: `Invalid attribute for Fragment`,\n node: attr,\n severity: \"error\",\n });\n }\n }\n return path\n .get(\"children\")\n .flatMap((child) => parseElement(child, state, options));\n }\n\n const reference = getComponentReference(tagName, state, options);\n const properties: Record<string, unknown> = {};\n // const ambiguousProps: Record<string, unknown> = {};\n let events: Events | undefined;\n let ref: string | undefined;\n\n const isRoute = validateGlobalApi(tagName, \"Route\");\n\n for (const attr of openingElement.get(\"attributes\")) {\n if (attr.isJSXSpreadAttribute()) {\n state.errors.push({\n message: `Spread attributes are not supported in component`,\n node: attr.node,\n severity: \"error\",\n });\n continue;\n }\n const attrNamePath = (attr as NodePath<t.JSXAttribute>).get(\"name\");\n if (!attrNamePath.isJSXIdentifier()) {\n state.errors.push({\n message: `Expected JSXIdentifier, but got ${attrNamePath.node.type}`,\n node: attrNamePath.node,\n severity: \"error\",\n });\n continue;\n }\n const attrName = attrNamePath.node.name;\n if (attrName === \"key\") {\n // Ignore key attribute\n continue;\n }\n const attrValuePath = (attr as NodePath<t.JSXAttribute>).get(\"value\");\n\n if (isRoute) {\n if (attrName === \"component\") {\n if (!attrValuePath.isJSXExpressionContainer()) {\n state.errors.push({\n message: `The \"component\" attribute in Route expects a JSXExpressionContainer, but got ${attrValuePath.node?.type}`,\n node: attrValuePath.node ?? attrValuePath.parent,\n severity: \"error\",\n });\n continue;\n }\n const exprPath = attrValuePath.get(\"expression\");\n if (!exprPath.isIdentifier()) {\n state.errors.push({\n message: `The \"component\" attribute in Route expects an identifier, but got ${exprPath.node.type}`,\n node: exprPath.node,\n severity: \"error\",\n });\n continue;\n }\n const reference = getComponentReference(exprPath, state, options);\n if (!reference) {\n state.errors.push({\n message: `The component \"${exprPath.node.name}\" is not defined`,\n node: exprPath.node,\n severity: \"error\",\n });\n continue;\n }\n properties.component = {\n name: exprPath.node.name,\n reference,\n };\n } else if (attrName === \"path\") {\n if (!attrValuePath.isStringLiteral()) {\n state.errors.push({\n message: `The \"path\" attribute in Route expects a string literal, but got ${attrValuePath.node?.type}`,\n node: attrValuePath.node ?? attrValuePath.parent,\n severity: \"error\",\n });\n continue;\n }\n properties.path = attrValuePath.node.value;\n } else {\n state.errors.push({\n message: `Unsupported attribute \"${attrName}\" in Route`,\n node: attrNamePath.node,\n severity: \"error\",\n });\n }\n continue;\n }\n\n if (attrName === \"ref\") {\n ref = parseRefAttribute(attrValuePath, state, options);\n continue;\n }\n\n const isEventHandler = /^on[A-Z]/.test(attrName);\n if (isEventHandler) {\n if (!attrValuePath.isJSXExpressionContainer()) {\n state.errors.push({\n message: `Event handler \"${attrName}\" expects a JSXExpressionContainer, but got ${attrValuePath.node?.type}`,\n node: attrValuePath.node ?? attrValuePath.parent,\n severity: \"error\",\n });\n continue;\n }\n const exprPath = attrValuePath.get(\"expression\");\n if (exprPath.isJSXEmptyExpression()) {\n state.errors.push({\n message: `Empty expression in events is not allowed`,\n node: exprPath.node,\n severity: \"warning\",\n });\n continue;\n }\n let handler: EventHandler[] | null = null;\n // Assert: exprPath.isReferencedIdentifier()\n if (exprPath.isIdentifier()) {\n const bindingId = exprPath.scope.getBindingIdentifier(\n exprPath.node.name\n );\n if (bindingId) {\n const binding = options.component?.bindingMap.get(bindingId);\n if (binding && binding.kind === \"eventHandler\") {\n handler = [\n {\n action: \"dispatch_event\",\n payload: {\n type: convertJsxEventAttr(binding.id.name),\n detail: \"<% EVENT.detail %>\",\n },\n },\n ];\n }\n }\n }\n if (!handler) {\n handler = parseEvent(exprPath, state, options);\n }\n if (handler) {\n events ??= {};\n events[convertJsxEventAttr(attrName)] = handler;\n }\n } else {\n if (attrValuePath.node == null) {\n properties[attrName] = true;\n } else if (attrValuePath.isStringLiteral()) {\n properties[attrName] = attrValuePath.node.value;\n // ambiguousProps[attrName] = attrValuePath.node.value;\n } else if (attrValuePath.isJSXExpressionContainer()) {\n const exprPath = attrValuePath.get(\"expression\");\n if (exprPath.isJSXEmptyExpression()) {\n state.errors.push({\n message: `Empty expression in JSX attribute \"${attrName}\" is not allowed`,\n node: exprPath.node,\n severity: \"warning\",\n });\n } else {\n properties[attrName] = parsePropValue(\n exprPath as NodePath<t.Expression>,\n state,\n {\n ...options,\n allowUseBrick: true,\n modifier: \"=\",\n }\n );\n // TODO: set ambiguousProps when reward is enabled\n }\n } else {\n state.errors.push({\n message: `Unsupported attribute value type in component: ${attrValuePath.node.type}`,\n node: attrValuePath.node,\n severity: \"error\",\n });\n }\n }\n }\n\n const { textContent, children } = parseLowLevelChildren(\n path.get(\"children\"),\n state,\n options\n );\n\n if (textContent) {\n properties.textContent = textContent;\n }\n\n const child: ComponentChild = {\n name: tagName.node.name,\n reference,\n properties,\n ref,\n events,\n children,\n };\n\n return {\n type: \"component\",\n component: child,\n };\n}\n\nfunction parseRefAttribute(\n attrValuePath: NodePath<t.Node | null | undefined>,\n state: ParsedModule,\n options: ParseJsValueOptions\n): string | undefined {\n if (!attrValuePath.isJSXExpressionContainer()) {\n state.errors.push({\n message: `The \"ref\" attribute in component expects a JSXExpressionContainer, but got ${attrValuePath.node?.type}`,\n node: attrValuePath.node ?? attrValuePath.parent,\n severity: \"error\",\n });\n return;\n }\n const exprPath = attrValuePath.get(\"expression\");\n if (!exprPath.isIdentifier()) {\n state.errors.push({\n message: `The \"ref\" attribute in component expects an identifier, but got ${exprPath.node.type}`,\n node: exprPath.node,\n severity: \"error\",\n });\n return;\n }\n const refName = exprPath.node.name;\n // Assert: exprPath.isReferencedIdentifier()\n const bindingId = exprPath.scope.getBindingIdentifier(refName);\n let binding: BindingInfo | undefined;\n if (bindingId) {\n binding = options.component?.bindingMap.get(bindingId);\n }\n if (!binding) {\n state.errors.push({\n message: `The ref \"${refName}\" is not defined`,\n node: attrValuePath.node,\n severity: \"error\",\n });\n return;\n }\n if (binding.kind !== \"ref\") {\n state.errors.push({\n message: `The variable \"${refName}\" is not a ref, but a ${binding.kind}`,\n node: attrValuePath.node,\n severity: \"error\",\n });\n return;\n }\n return binding.id.name;\n}\n\nfunction convertJsxEventAttr(attr: string): string {\n return attr\n .slice(2)\n .replace(/([a-z])([A-Z])/g, \"$1.$2\")\n .toLowerCase();\n}\n","import type { NodePath } from \"@babel/traverse\";\nimport * as t from \"@babel/types\";\nimport type { ParseJsValueOptions, ParsedModule } from \"./interfaces.js\";\nimport { validateEmbeddedExpression } from \"./validations.js\";\nimport type { ChildElement } from \"./internal-interfaces.js\";\nimport { parseJSXElement } from \"./parseJSXElement.js\";\nimport { parsePropValue } from \"./parseJsValue.js\";\nimport { parseChildren } from \"./parseChildren.js\";\n\nexport function parseElement(\n path: NodePath<t.Node>,\n state: ParsedModule,\n options: ParseJsValueOptions\n): ChildElement | null | (ChildElement | null)[] {\n if (path.isJSXFragment()) {\n const children = path.get(\"children\");\n return children.flatMap((child) => parseElement(child, state, options));\n }\n\n if (path.isJSXText()) {\n if (path.node.value.trim()) {\n return {\n type: \"text\",\n text: path.node.value,\n };\n }\n return null;\n }\n\n if (path.isJSXExpressionContainer()) {\n return parseElement(path.get(\"expression\"), state, options);\n }\n\n if (path.isJSXEmptyExpression()) {\n return null;\n }\n\n if (path.isJSXElement()) {\n return parseJSXElement(path, state, options);\n }\n\n if (path.isCallExpression()) {\n const callee = path.get(\"callee\");\n if (callee.isMemberExpression() || callee.isOptionalMemberExpression()) {\n const property = callee.get(\"property\") as NodePath<t.Identifier>;\n if (property.isIdentifier() && property.node.name === \"map\") {\n const args = path.get(\"arguments\");\n if (args.length > 0) {\n const func = args[0];\n if (func.isArrowFunctionExpression()) {\n const body = func.get(\"body\");\n if (body.isExpression() && containsJsxNode(body.node)) {\n const object = callee.get(\"object\") as NodePath<t.Expression>;\n if (!validateEmbeddedExpression(object.node, state)) {\n return null;\n }\n const params = func.get(\"params\");\n if (params.length > 2) {\n state.errors.push({\n message: `Array map function with JSX elements must have at most two parameters, but got ${params.length}`,\n node: params[2].node,\n severity: \"error\",\n });\n return null;\n }\n const invalidParam = params.find((p) => !p.isIdentifier());\n if (invalidParam) {\n state.errors.push({\n message: `Array map function with JSX elements must have identifier parameters, but got ${invalidParam.type}`,\n node: invalidParam.node,\n severity: \"error\",\n });\n return null;\n }\n\n const forEachOptions: ParseJsValueOptions = {\n ...options,\n forEachBinding: undefined,\n };\n if (params.length > 0) {\n const [itemArg, indexArg] = params as NodePath<t.Identifier>[];\n forEachOptions.forEachBinding = {\n item: itemArg.node,\n index: indexArg?.node,\n };\n }\n\n return {\n type: \"component\",\n component: {\n name: \"ForEach\",\n properties: {\n dataSource: parsePropValue(object, state, {\n ...options,\n modifier: \"=\",\n }),\n },\n children: parseChildren(\n func.get(\"body\"),\n state,\n forEachOptions\n ),\n },\n };\n }\n }\n }\n }\n }\n } else if (path.isConditionalExpression()) {\n const test = path.get(\"test\");\n const consequent = path.get(\"consequent\");\n const alternate = path.get(\"alternate\");\n if (containsJsxNode(consequent.node) || containsJsxNode(alternate.node)) {\n if (!validateEmbeddedExpression(test.node, state)) {\n return null;\n }\n return {\n type: \"component\",\n component: {\n name: \"If\",\n properties: {\n dataSource: parsePropValue(test, state, {\n ...options,\n modifier: \"=\",\n }),\n },\n children: [\n ...parseChildren(consequent, state, options),\n ...parseChildren(alternate, state, options).map((component) => ({\n ...component,\n slot: \"else\",\n })),\n ],\n },\n };\n }\n } else if (path.isLogicalExpression()) {\n const left = path.get(\"left\");\n const right = path.get(\"right\");\n const operator = path.node.operator;\n if (\n (operator === \"&&\" || operator === \"||\") &&\n containsJsxNode(right.node)\n ) {\n if (!validateEmbeddedExpression(left.node, state)) {\n return null;\n }\n const children = parseChildren(right, state, options);\n return {\n type: \"component\",\n component: {\n name: \"If\",\n properties: {\n dataSource: parsePropValue(left, state, {\n ...options,\n modifier: \"=\",\n }),\n },\n children:\n operator === \"&&\"\n ? children\n : children.map((component) => ({\n ...component,\n slot: \"else\",\n })),\n },\n };\n }\n }\n\n if (path.isExpression()) {\n if (validateEmbeddedExpression(path.node, state)) {\n return {\n type: \"expression\",\n expression: path,\n };\n }\n return null;\n }\n\n state.errors.push({\n message: `Unsupported node type in JSX children: ${path.type}`,\n node: path.node,\n severity: \"error\",\n });\n return null;\n}\n\nfunction containsJsxNode(expr: t.Expression): boolean {\n let found = false;\n t.traverse(expr, {\n enter(node) {\n if (!found && (t.isJSXElement(node) || t.isJSXFragment(node))) {\n found = true;\n }\n },\n });\n return found;\n}\n","import type { NodePath } from \"@babel/traverse\";\nimport type * as t from \"@babel/types\";\nimport type {\n ChildElement,\n ChildExpression,\n ChildMerged,\n ChildText,\n} from \"./internal-interfaces.js\";\nimport type {\n ComponentChild,\n ParseJsValueOptions,\n ParsedModule,\n} from \"./interfaces.js\";\nimport { parseElement } from \"./parseElement.js\";\nimport { parseEmbedded } from \"./parseEmbedded.js\";\n\nexport function parseLowLevelChildren(\n paths: NodePath<t.Node>[],\n state: ParsedModule,\n options: ParseJsValueOptions\n): {\n textContent?: string;\n children?: ComponentChild[];\n} {\n let rawChildren: (ChildElement | ChildMerged)[] = paths.flatMap((p) =>\n parseElement(p, state, options)\n );\n\n let onlyTextChildren = rawChildren.every((child) => child?.type === \"text\");\n if (!onlyTextChildren) {\n let previousChild: ChildElement | ChildMerged = null;\n const tempChildren: (ChildElement | ChildMerged)[] = [];\n\n for (const child of rawChildren) {\n if (child === null) {\n // Do nothing\n } else if (child.type === \"text\" || child.type === \"expression\") {\n if (\n previousChild?.type === \"text\" ||\n previousChild?.type === \"expression\"\n ) {\n previousChild = {\n type: \"merged\",\n children: [previousChild, child],\n };\n tempChildren.splice(tempChildren.length - 1, 1, previousChild);\n continue;\n } else if (previousChild?.type === \"merged\") {\n previousChild.children.push(child);\n continue;\n }\n }\n previousChild = child;\n tempChildren.push(child);\n }\n\n rawChildren = tempChildren;\n onlyTextChildren = rawChildren.every(\n (child) =>\n child?.type === \"text\" ||\n (child?.type === \"merged\" &&\n child.children.every((c) => c.type === \"text\"))\n );\n }\n\n if (onlyTextChildren) {\n const textContent = rawChildren\n .flatMap((child) =>\n child!.type === \"text\"\n ? child!.text\n : (child as ChildMerged).children.map((c) => (c as ChildText).text)\n )\n .join(\"\")\n .trim();\n return { textContent };\n }\n const onlyLooseTextChildren = rawChildren.every(\n (child) => !!child && child.type !== \"component\"\n );\n if (onlyLooseTextChildren) {\n const textContent = constructMergeTexts(\n rawChildren.flatMap((child) =>\n child!.type === \"merged\"\n ? (child as ChildMerged).children\n : (child as ChildText)\n ),\n state,\n options\n );\n return { textContent };\n }\n\n const children = rawChildren\n .filter((child) => !!child)\n .map((child) =>\n child.type === \"component\"\n ? child.component\n : {\n name: \"Plaintext\",\n properties: {\n textContent:\n child.type === \"text\"\n ? child.text\n : child.type === \"expression\"\n ? parseEmbedded(child.expression, state, {\n ...options,\n modifier: \"=\",\n })\n : constructMergeTexts(child.children, state, options),\n },\n }\n );\n\n return { children };\n}\n\nfunction constructMergeTexts(\n elements: (ChildText | ChildExpression)[],\n state: ParsedModule,\n options: ParseJsValueOptions\n) {\n state.usedHelpers.add(\"_helper_mergeTexts\");\n return `<%= FN._helper_mergeTexts(${elements\n .map((elem) =>\n elem.type === \"text\"\n ? JSON.stringify(elem)\n : `{type:\"expression\",value:(${parseEmbedded(elem.expression, state, options, true)})}`\n )\n .join(\", \")}) %>`;\n}\n","import type { NodePath } from \"@babel/traverse\";\nimport type * as t from \"@babel/types\";\nimport type {\n ComponentChild,\n ParseJsValueOptions,\n ParsedModule,\n} from \"./interfaces.js\";\nimport { parseLowLevelChildren } from \"./parseLowLevelChildren.js\";\n\nexport function parseChildren(\n path: NodePath<t.Node>,\n state: ParsedModule,\n options: ParseJsValueOptions\n): ComponentChild[] {\n const { textContent, children } = parseLowLevelChildren(\n [path],\n state,\n options\n );\n\n return (\n children ?? [\n {\n name: \"Plaintext\",\n properties: { textContent },\n },\n ]\n );\n}\n","import type { ParsedComponent } from \"./interfaces.js\";\nimport { isExpressionString, isOfficialComponent } from \"./validations.js\";\n\nexport function getViewTitle(component: ParsedComponent): string | undefined {\n const view = component.children?.find((comp) =>\n isOfficialComponent(comp, \"View\")\n );\n const viewTitle = view?.properties?.title;\n if (typeof viewTitle === \"string\" && !isExpressionString(viewTitle)) {\n return viewTitle;\n }\n}\n","import type { ParseResult as BabelParseResult } from \"@babel/parser\";\nimport BabelTraverse from \"@babel/traverse\";\nimport type { NodePath } from \"@babel/traverse\";\nimport type * as t from \"@babel/types\";\nimport type {\n BindingInfo,\n BindingMap,\n ParsedApp,\n ParsedComponent,\n ParseJsValueOptions,\n ParseModuleOptions,\n ParsedModule,\n ModulePartOfComponent,\n} from \"./interfaces.js\";\nimport { parseChildren } from \"./parseChildren.js\";\nimport { parseJsValue } from \"./parseJsValue.js\";\nimport { getViewTitle } from \"./getViewTitle.js\";\nimport type { ParseError } from \"../interfaces.js\";\n\nconst traverse =\n process.env.NODE_ENV === \"test\"\n ? BabelTraverse\n : (BabelTraverse as unknown as { default: typeof BabelTraverse }).default;\n\nexport function parseLegacyModule(\n filePath: string,\n app: ParsedApp,\n ast: BabelParseResult<t.File>,\n options?: ParseModuleOptions\n): void {\n const errors: ParseError[] = [];\n if (ast.errors?.length) {\n for (const error of ast.errors) {\n errors.push({\n message: `${error.code}: ${error.reasonCode}`,\n node: null,\n severity: \"error\",\n });\n }\n }\n\n const bindingMap: BindingMap = new Map();\n const component: ParsedComponent = {\n type: \"view\",\n bindingMap,\n };\n const globalOptions: ParseJsValueOptions = {\n component,\n contextBindings: options?.withContexts,\n };\n const file = app.files.find((f) => f.filePath === filePath)!;\n const mod: ParsedModule = {\n source: file.content,\n filePath,\n moduleType: \"entry\",\n defaultExport: {\n type: \"view\",\n component,\n },\n internals: [],\n namedExports: new Map(),\n errors: errors,\n contracts: new Set(),\n usedHelpers: new Set(),\n };\n\n traverse(ast, {\n Program(path) {\n const body = path.get(\"body\");\n let exported = false;\n for (const stmt of body) {\n if (stmt.isVariableDeclaration()) {\n if (exported) {\n errors.push({\n message: `Unexpected variable declaration after export`,\n node: stmt.node,\n severity: \"error\",\n });\n continue;\n }\n if (stmt.node.kind !== \"const\") {\n errors.push({\n message: `Only \"const\" variable declaration is allowed, received: ${stmt.node.kind}`,\n node: stmt.node,\n severity: \"error\",\n });\n continue;\n }\n for (const decl of stmt.get(\"declarations\")) {\n const declId = decl.get(\"id\");\n if (!declId.isIdentifier()) {\n errors.push({\n message: `Unsupported variable declaration pattern, expected: Identifier, received: ${declId.type}`,\n node: declId.node,\n severity: \"error\",\n });\n continue;\n }\n\n const binding: BindingInfo = { id: declId.node, kind: \"constant\" };\n const init = decl.get(\"init\");\n if (init.node) {\n binding.initialValue = parseJsValue(\n init as NodePath<t.Node>,\n mod,\n globalOptions\n );\n }\n bindingMap.set(declId.node, binding);\n }\n } else if (stmt.isExportDefaultDeclaration()) {\n exported = true;\n const decl = stmt.get(\"declaration\");\n if (!decl.isJSXElement()) {\n errors.push({\n message: `Default export must be a JSX element, received: ${decl.type}`,\n node: stmt.node,\n severity: \"error\",\n });\n } else {\n component.children = parseChildren(decl, mod, globalOptions);\n }\n break;\n }\n }\n\n path.stop();\n },\n });\n\n (mod.defaultExport as ModulePartOfComponent).title = getViewTitle(component);\n\n app.entry = mod;\n}\n","import type { NodePath } from \"@babel/traverse\";\nimport type * as t from \"@babel/types\";\nimport type {\n DataSource,\n DataSourceConfig,\n ParseJsValueOptions,\n ParsedModule,\n} from \"./interfaces.js\";\nimport { parseCallApi } from \"./parseCallApi.js\";\nimport { parseEmbedded } from \"./parseEmbedded.js\";\n\nexport function parseResourceCall(\n path: NodePath<t.Expression>,\n state: ParsedModule,\n options: ParseJsValueOptions,\n name: string,\n config?: DataSourceConfig,\n transformArgs?: NodePath<\n t.Expression | t.SpreadElement | t.ArgumentPlaceholder\n >[],\n method?: \"then\" | \"catch\"\n): DataSource | null {\n const payload = parseCallApi(path, state, options);\n if (!payload) {\n return null;\n }\n state.contracts.add(payload.api);\n const dataSource: DataSource = {\n name,\n config,\n ...payload,\n };\n\n if (transformArgs) {\n if (transformArgs.length > (method === \"catch\" ? 1 : 2)) {\n state.errors.push({\n message: `\".${method}()\" expects no more than 2 arguments, but got ${transformArgs.length}`,\n node: transformArgs[1]?.node,\n severity: \"error\",\n });\n return null;\n }\n if (transformArgs.length > 0) {\n const transform = parsePromiseCallback(transformArgs[0], state, options);\n if (transform) {\n dataSource[method === \"catch\" ? \"rejectTransform\" : \"transform\"] =\n transform;\n }\n }\n if (method !== \"catch\" && transformArgs.length > 1) {\n const transform = parsePromiseCallback(transformArgs[1], state, options);\n if (transform) {\n dataSource.rejectTransform = transform;\n }\n }\n }\n\n return dataSource;\n}\n\nfunction parsePromiseCallback(\n callback: NodePath<t.ArgumentPlaceholder | t.SpreadElement | t.Expression>,\n state: ParsedModule,\n options: ParseJsValueOptions\n): string | null {\n if (!callback.isArrowFunctionExpression()) {\n state.errors.push({\n message: `\".then()\" callback expects an arrow function, but got ${callback.type}`,\n node: callback.node,\n severity: \"error\",\n });\n return null;\n }\n const body = callback.get(\"body\");\n if (!body.isExpression()) {\n state.errors.push({\n message: `\".then()\" callback function body expects an expression, but got ${body.type}`,\n node: body.node,\n severity: \"error\",\n });\n return null;\n }\n const params = callback.get(\"params\");\n if (params.length > 1) {\n state.errors.push({\n message: `\".then()\" callback function expects exactly 0 or 1 parameter, but got ${params.length}`,\n node: params[1]?.node ?? callback,\n severity: \"error\",\n });\n return null;\n }\n const optionsWithData: ParseJsValueOptions = {\n ...options,\n dataBinding: undefined,\n };\n const arg = params[0];\n if (params.length > 0) {\n if (!arg.isIdentifier()) {\n state.errors.push({\n message: `\".then()\" callback function parameter expects an identifier, but got ${arg.type}`,\n node: arg.node,\n severity: \"error\",\n });\n return null;\n }\n optionsWithData.dataBinding = { id: arg.node };\n }\n return parseEmbedded(body, state, optionsWithData);\n}\n","import type { NodePath } from \"@babel/traverse\";\nimport type * as t from \"@babel/types\";\nimport type {\n ParsedModule,\n DataSourceConfig,\n ParseJsValueOptions,\n DataSource,\n BindingInfo,\n} from \"./interfaces.js\";\nimport { validateFunction } from \"./validations.js\";\nimport { parseJsValue } from \"./parseJsValue.js\";\nimport { parseResourceCall } from \"./parseResourceCall.js\";\n\nexport function parseUseResource(\n decl: NodePath<t.VariableDeclarator>,\n args: NodePath<t.Expression | t.SpreadElement | t.ArgumentPlaceholder>[],\n state: ParsedModule,\n options: ParseJsValueOptions\n): BindingInfo | null {\n const declId = decl.get(\"id\");\n if (!declId.isArrayPattern()) {\n return null;\n }\n const elements = declId.get(\"elements\");\n if (elements.length !== 1 && elements.length !== 2) {\n return null;\n }\n const resourceVar = elements[0];\n if (!resourceVar.isIdentifier()) {\n return null;\n }\n if (args.length !== 1 && args.length !== 2) {\n return null;\n }\n const resourcePath = args[0];\n if (!resourcePath.isArrowFunctionExpression()) {\n return null;\n }\n if (!validateFunction(resourcePath.node, state)) {\n return null;\n }\n const call = resourcePath.get(\"body\");\n if (call.isBlockStatement()) {\n return null;\n }\n if (!call.isCallExpression()) {\n return null;\n }\n const callee = call.get(\"callee\");\n if (!(callee.isIdentifier() || callee.isMemberExpression())) {\n return null;\n }\n const resourceConfig = args[1];\n let config: DataSourceConfig | undefined;\n if (resourceConfig) {\n if (!resourceConfig.isObjectExpression()) {\n state.errors.push({\n message: `\"useResource()\" second argument must be an object expression, but got ${resourceConfig.type}`,\n node: resourceConfig.node,\n severity: \"error\",\n });\n return null;\n }\n for (const prop of resourceConfig.get(\"properties\")) {\n if (!prop.isObjectProperty()) {\n state.errors.push({\n message: `Unsupported property type in \"useResource()\" second argument: ${prop.type}`,\n node: prop.node,\n severity: \"error\",\n });\n return null;\n }\n const key = prop.get(\"key\");\n if (!key.isIdentifier()) {\n state.errors.push({\n message: `\"useResource()\" second argument property key must be an identifier, but got ${key.type}`,\n node: key.node,\n severity: \"error\",\n });\n return null;\n }\n if (prop.node.computed) {\n state.errors.push({\n message: `\"useResource()\" second argument property key cannot be computed`,\n node: key.node,\n severity: \"error\",\n });\n return null;\n }\n if (key.node.name !== \"enabled\" && key.node.name !== \"fallback\") {\n state.errors.push({\n message: `\"useResource()\" second argument property key must be \"enabled\" or \"fallback\", but got \"${key.node.name}\"`,\n node: key.node,\n severity: \"error\",\n });\n return null;\n }\n config ??= {};\n config[key.node.name] = parseJsValue(prop.get(\"value\"), state, options);\n }\n }\n\n let resource: DataSource | null = null;\n if (callee.isMemberExpression()) {\n const property = callee.get(\"property\");\n if (\n !property.isIdentifier() ||\n callee.node.computed ||\n (property.node.name !== \"then\" && property.node.name !== \"catch\")\n ) {\n state.errors.push({\n message: `Unexpected awaited expression`,\n node: property.node,\n severity: \"error\",\n });\n return null;\n }\n resource = parseResourceCall(\n callee.get(\"object\"),\n state,\n options,\n resourceVar.node.name,\n config,\n call.get(\"arguments\"),\n property.node.name\n );\n } else {\n resource = parseResourceCall(\n call,\n state,\n options,\n resourceVar.node.name,\n config\n );\n }\n\n if (resource) {\n return { id: resourceVar.node, kind: \"resource\", resource };\n }\n\n return null;\n}\n","import type { NodePath } from \"@babel/traverse\";\nimport type * as t from \"@babel/types\";\nimport type {\n BindingInfo,\n BindingMap,\n ParsedComponent,\n ParseJsValueOptions,\n ParsedModule,\n} from \"./interfaces.js\";\nimport { validateFunction, validateGlobalApi } from \"./validations.js\";\nimport { parseJsValue } from \"./parseJsValue.js\";\nimport { parseChildren } from \"./parseChildren.js\";\nimport { parseUseResource } from \"./parseUseResource.js\";\n\nexport function parseComponent(\n fn: NodePath<t.FunctionDeclaration>,\n state: ParsedModule,\n type: \"template\" | \"view\" | \"page\",\n globalOptions?: ParseJsValueOptions\n): ParsedComponent | null {\n if (!validateFunction(fn.node, state)) {\n return null;\n }\n\n const bindingMap: BindingMap = new Map();\n const component: ParsedComponent = {\n bindingMap,\n type,\n id: fn.node.id,\n };\n const options: ParseJsValueOptions = { ...globalOptions, component };\n\n const params = fn.get(\"params\");\n if (type === \"template\") {\n if (params.length > 1) {\n state.errors.push({\n message: `Component function can only have zero or one parameter, received ${params.length}`,\n node: fn.node,\n severity: \"error\",\n });\n return null;\n }\n if (params.length > 0) {\n const param = params[0];\n if (!param.isObjectPattern()) {\n state.errors.push({\n message: `Component function parameter must be an object pattern, received ${param.type}`,\n node: param.node,\n severity: \"error\",\n });\n return null;\n }\n for (const prop of param.get(\"properties\")) {\n if (prop.isRestElement()) {\n state.errors.push({\n message: `Component function parameter rest element is not allowed`,\n node: prop.node,\n severity: \"error\",\n });\n return null;\n }\n const propNode = prop.node as t.ObjectProperty;\n if (propNode.computed || !propNode.shorthand) {\n state.errors.push({\n message: `Component function parameter properties must be shorthand and not computed`,\n node: prop.node,\n severity: \"error\",\n });\n return null;\n }\n const key = prop.get(\"key\") as NodePath<t.ObjectProperty[\"key\"]>;\n const value = prop.get(\"value\") as NodePath<t.ObjectProperty[\"value\"]>;\n if (!key.isIdentifier()) {\n state.errors.push({\n message: `Component function parameter property key must be an identifier, received ${key.type}`,\n node: key.node,\n severity: \"error\",\n });\n return null;\n }\n const varName = key.node.name;\n const isEventHandler = /^on[A-Z]/.test(varName);\n if (isEventHandler) {\n if (!value.isIdentifier()) {\n state.errors.push({\n message: `Event handler parameter \"${varName}\" must be an identifier, received ${value.type}`,\n node: value.node,\n severity: \"error\",\n });\n return null;\n }\n bindingMap.set(value.node, { id: value.node, kind: \"eventHandler\" });\n } else {\n let bindingId: t.Identifier | undefined;\n let initialValue: unknown;\n if (value.isAssignmentPattern()) {\n const left = value.get(\"left\");\n if (left.isIdentifier()) {\n bindingId = left.node;\n initialValue = parseJsValue(value.get(\"right\"), state, options);\n }\n } else if (value.isIdentifier()) {\n bindingId = value.node;\n }\n if (!bindingId) {\n state.errors.push({\n message: `Component function parameter property value must be an identifier or assignment pattern, received ${value.type}`,\n node: value.node,\n severity: \"error\",\n });\n continue;\n }\n const paramBinding: BindingInfo = {\n id: bindingId,\n kind: \"param\",\n initialValue,\n };\n bindingMap.set(bindingId, paramBinding);\n }\n }\n }\n } else if (params.length > 0) {\n state.errors.push({\n message: `Page function cannot have parameters, received ${params.length}`,\n node: params[0].node,\n severity: \"error\",\n });\n return null;\n }\n\n const stmts = fn.get(\"body\").get(\"body\");\n for (const stmt of stmts) {\n if (stmt.isVariableDeclaration()) {\n if (stmt.node.kind !== \"const\") {\n state.errors.push({\n message: `Only \"const\" variable declaration is allowed, received \"${stmt.node.kind}\"`,\n node: stmt.node,\n severity: \"error\",\n });\n continue;\n }\n for (const decl of stmt.get(\"declarations\")) {\n const init = decl.get(\"init\");\n // Hooks\n if (init.isCallExpression()) {\n const callee = init.get(\"callee\");\n if (callee.isIdentifier()) {\n const args = init.get(\"arguments\");\n if (validateGlobalApi(callee, \"useState\")) {\n const declId = decl.get(\"id\");\n if (!declId.isArrayPattern()) {\n continue;\n }\n const elements = declId.get(\"elements\");\n if (elements.length !== 2) {\n state.errors.push({\n message: `useState() destructuring must have exactly two elements, received ${elements.length}`,\n node: declId.node,\n severity: \"error\",\n });\n continue;\n }\n const stateVar = elements[0];\n const setStateVar = elements[1];\n if (!stateVar.isIdentifier() || !setStateVar.isIdentifier()) {\n state.errors.push({\n message: `useState() destructuring must have identifiers as elements, received ${elements.map((el) => el.type).join(\", \")}`,\n node: declId.node,\n severity: \"error\",\n });\n continue;\n }\n const stateInfo: BindingInfo = {\n id: stateVar.node,\n kind: \"state\",\n };\n bindingMap.set(stateVar.node, stateInfo);\n bindingMap.set(setStateVar.node, {\n id: stateVar.node,\n kind: \"setState\",\n });\n if (args.length > 0) {\n stateInfo.initialValue = parseJsValue(args[0], state, options);\n }\n if (args.length > 1) {\n state.errors.push({\n message: `useState() only accepts at most one argument, received ${args.length}`,\n node: args[1].node,\n severity: \"warning\",\n });\n }\n continue;\n } else if (validateGlobalApi(callee, \"useResource\")) {\n const bindingInfo = parseUseResource(decl, args, state, options);\n if (bindingInfo) {\n bindingMap.set(bindingInfo.id, bindingInfo);\n }\n continue;\n } else if (validateGlobalApi(callee, \"useRef\")) {\n const declId = decl.get(\"id\");\n if (!declId.isIdentifier()) {\n state.errors.push({\n message: `useRef() must be assigned to an identifier, received ${declId.type}`,\n node: declId.node,\n severity: \"error\",\n });\n continue;\n }\n if (args.length > 1) {\n state.errors.push({\n message: `useRef() only accepts at most one argument, received ${args.length}`,\n node: args[1].node,\n severity: \"warning\",\n });\n }\n const firstArg = args[0];\n if (firstArg && !firstArg.isNullLiteral()) {\n state.errors.push({\n message: `useRef() first argument must be null, received ${firstArg.type}`,\n node: firstArg.node,\n severity: \"warning\",\n });\n }\n bindingMap.set(declId.node, { id: declId.node, kind: \"ref\" });\n continue;\n } else if (validateGlobalApi(callee, \"useQuery\")) {\n const declId = decl.get(\"id\");\n if (!declId.isIdentifier()) {\n state.errors.push({\n message: `useQuery() must be assigned to an identifier, received ${declId.type}`,\n node: declId.node,\n severity: \"error\",\n });\n continue;\n }\n if (args.length > 0) {\n state.errors.push({\n message: `useQuery() does not accept any arguments, received ${args.length}`,\n node: args[0].node,\n severity: \"warning\",\n });\n }\n bindingMap.set(declId.node, { id: declId.node, kind: \"query\" });\n continue;\n }\n }\n }\n\n // Normal variable\n const declId = decl.get(\"id\");\n if (!declId.isIdentifier()) {\n state.errors.push({\n message: `Expect an identifier as the variable name, received ${declId.type}`,\n node: declId.node,\n severity: \"error\",\n });\n continue;\n }\n\n const binding: BindingInfo = { id: declId.node, kind: \"constant\" };\n bindingMap.set(declId.node, binding);\n if (init.node) {\n binding.initialValue = parseJsValue(\n init as NodePath<t.Expression>,\n state,\n options\n );\n }\n }\n } else if (stmt.isReturnStatement()) {\n const arg = stmt.get(\"argument\");\n if (!arg.isJSXElement() && !arg.isJSXFragment()) {\n state.errors.push({\n message: `Expect JSX element or fragment as the return value, received ${arg.type}`,\n node: arg.node,\n severity: \"error\",\n });\n continue;\n }\n component.children = parseChildren(arg, state, options);\n } else if (\n !stmt.isTSInterfaceDeclaration() &&\n !stmt.isTSTypeAliasDeclaration()\n ) {\n state.errors.push({\n message: `Unsupported top level statement type: ${stmt.type}`,\n node: stmt.node,\n severity: \"error\",\n });\n }\n }\n\n return component;\n}\n","import type { NodePath } from \"@babel/traverse\";\nimport type * as t from \"@babel/types\";\nimport type { StoryboardFunction } from \"@next-core/types\";\nimport type { ParseJsValueOptions, ParsedModule } from \"./interfaces.js\";\nimport { validateFunction } from \"./validations.js\";\n\ninterface Replacement {\n type: \"id\";\n start: number;\n end: number;\n replacement: string;\n shorthand?: string;\n}\n\nexport function parseFunction(\n fn: NodePath<t.FunctionDeclaration>,\n state: ParsedModule,\n options: ParseJsValueOptions\n): StoryboardFunction | null {\n if (!validateFunction(fn.node, state)) {\n return null;\n }\n\n const replacements: Replacement[] = [];\n\n fn.traverse({\n Identifier(idPath) {\n if (!idPath.isReferencedIdentifier()) {\n return;\n }\n const shorthand =\n idPath.parentPath.isObjectProperty() &&\n idPath.parentPath.node.shorthand;\n const bindingId = idPath.scope.getBindingIdentifier(idPath.node.name);\n if (bindingId && bindingId !== fn.node.id) {\n if (options.functionBindings?.has(bindingId)) {\n replacements.push({\n type: \"id\",\n start: idPath.node.start!,\n end: idPath.node.end!,\n replacement: `FN.${bindingId.name}`,\n shorthand: shorthand ? idPath.node.name : undefined,\n });\n }\n }\n },\n });\n\n replacements.sort((a, b) => a.start - b.start);\n\n const chunks: string[] = [];\n let prevStart = fn.node.start!;\n for (const rep of replacements) {\n chunks.push(\n state.source.substring(prevStart, rep.start),\n `${rep.shorthand ? `${rep.shorthand}:` : \"\"}${rep.replacement}`\n );\n prevStart = rep.end;\n }\n chunks.push(state.source.substring(prevStart, fn.node.end!));\n\n return {\n name: fn.node.id!.name,\n source: chunks.join(\"\"),\n typescript: true,\n };\n}\n","import type { SourceFile } from \"./interfaces.js\";\n\nconst resolveExtensions = [\".js\", \".jsx\", \".ts\", \".tsx\"];\n\nexport function getFilePath(\n importSource: string,\n currentFilePath: string,\n files: SourceFile[]\n): string {\n if (importSource.startsWith(\"/\")) {\n // Absolute path\n return resolvePath(importSource.slice(1), files);\n }\n // Relative path\n // Assert: importSource starts with \".\"\n const currentDir = currentFilePath.substring(\n 0,\n currentFilePath.lastIndexOf(\"/\")\n );\n const segments = currentDir ? currentDir.split(\"/\") : [];\n const parts = importSource.split(\"/\");\n for (const part of parts) {\n if (part === \".\") {\n continue;\n } else if (part === \"..\") {\n if (segments.length > 0) {\n segments.pop();\n }\n } else {\n segments.push(part);\n }\n }\n return resolvePath(segments.join(\"/\"), files);\n}\n\nfunction resolvePath(path: string, files: SourceFile[]): string {\n if (files.some((f) => f.filePath === path)) {\n return path;\n }\n for (const ext of resolveExtensions) {\n if (files.some((f) => f.filePath === `${path}${ext}`)) {\n return `${path}${ext}`;\n }\n }\n return path;\n}\n","import type { ParseResult as BabelParseResult } from \"@babel/parser\";\nimport BabelTraverse from \"@babel/traverse\";\nimport type { NodePath } from \"@babel/traverse\";\nimport type * as t from \"@babel/types\";\nimport { parseComponent } from \"./parseComponent.js\";\nimport type {\n ModulePart,\n ParsedApp,\n ParseJsValueOptions,\n ParseModuleOptions,\n ParsedModule,\n} from \"./interfaces.js\";\nimport { parseFunction } from \"./parseFunction.js\";\nimport { validateGlobalApi } from \"./validations.js\";\nimport { parseChildren } from \"./parseChildren.js\";\nimport { parseFile } from \"./parseFile.js\";\nimport { getFilePath } from \"./getFilePath.js\";\nimport { getViewTitle } from \"./getViewTitle.js\";\n\nconst traverse =\n process.env.NODE_ENV === \"test\"\n ? BabelTraverse\n : (BabelTraverse as unknown as { default: typeof BabelTraverse }).default;\n\nenum FunctionScope {\n TopLevelStatement = \"top level statement\",\n NamedExportDeclaration = \"named export declaration\",\n DefaultExportDeclaration = \"default export declaration\",\n}\n\nexport function parseModule(\n mod: ParsedModule,\n app: ParsedApp,\n ast: BabelParseResult<t.File>,\n options?: ParseModuleOptions\n): void {\n const functionBindings = new Set<t.Identifier>();\n const componentBindings = new Set<t.Identifier>();\n const globalOptions: ParseJsValueOptions = {\n functionBindings,\n componentBindings,\n contextBindings: options?.withContexts,\n };\n\n traverse(ast, {\n Program(path) {\n const body = path.get(\"body\");\n const functionNodes: Array<{\n func: NodePath<t.FunctionDeclaration>;\n exported?: boolean;\n }> = [];\n let defaultExportNode: NodePath<t.FunctionDeclaration> | null = null;\n let renderNode: NodePath<t.Node> | null = null;\n const imports: string[] = [];\n\n const collectFunctions = (\n stmt: NodePath<t.Node | null | undefined>,\n scope: FunctionScope\n ) => {\n if (stmt.isFunctionDeclaration()) {\n const id = stmt.node.id;\n if (id) {\n if (isComponent(id)) {\n componentBindings.add(id);\n } else {\n functionBindings.add(id);\n }\n }\n if (scope === FunctionScope.DefaultExportDeclaration) {\n if (app.appType === \"app\" && mod.moduleType === \"entry\") {\n mod.errors.push({\n message: `The entry module in an app cannot have a default export declaration.`,\n node: stmt.node,\n severity: \"error\",\n });\n } else {\n defaultExportNode = stmt;\n }\n return;\n }\n if (!id) {\n mod.errors.push({\n message: `Function declaration must have a name`,\n node: stmt.node,\n severity: \"error\",\n });\n return;\n }\n if (scope === FunctionScope.NamedExportDeclaration) {\n functionNodes.push({ func: stmt, exported: true });\n } else {\n functionNodes.push({ func: stmt });\n }\n } else if (stmt.isExportDefaultDeclaration()) {\n const decl = stmt.get(\"declaration\");\n collectFunctions(decl, FunctionScope.DefaultExportDeclaration);\n } else if (stmt.isExportNamedDeclaration()) {\n const decl = stmt.get(\"declaration\");\n collectFunctions(decl, FunctionScope.NamedExportDeclaration);\n } else if (stmt.isImportDeclaration()) {\n const importSource = stmt.node.source.value;\n if (importSource.startsWith(\".\") || importSource.startsWith(\"/\")) {\n imports.push(importSource);\n }\n } else if (\n !stmt.isTSInterfaceDeclaration &&\n !stmt.isTSTypeAliasDeclaration()\n ) {\n mod.errors.push({\n message: `Unsupported ${scope} type: ${stmt.type}`,\n node: stmt.node,\n severity: \"error\",\n });\n }\n };\n\n for (const stmt of body) {\n if (\n app.appType === \"app\" &&\n mod === app.entry &&\n stmt.isExpressionStatement()\n ) {\n const expr = stmt.get(\"expression\");\n if (expr.isCallExpression()) {\n const callee = expr.get(\"callee\");\n if (callee.isIdentifier() && validateGlobalApi(callee, \"render\")) {\n const args = expr.get(\"arguments\");\n if (args.length !== 1) {\n mod.errors.push({\n message: `render() expects exactly one argument, received: ${args.length}`,\n node: expr.node,\n severity: \"error\",\n });\n continue;\n }\n renderNode = args[0];\n continue;\n }\n }\n }\n\n collectFunctions(stmt, FunctionScope.TopLevelStatement);\n }\n\n for (const importSource of imports) {\n parseFile(\n getFilePath(importSource, mod.filePath, app.files),\n app,\n undefined,\n options\n );\n }\n\n for (const { func: item, exported } of functionNodes) {\n const id = item.node.id!;\n if (isComponent(id)) {\n const type =\n app.appType === \"app\" && mod.moduleType === \"entry\"\n ? \"page\"\n : \"template\";\n const component = parseComponent(item, mod, type, globalOptions);\n if (component) {\n const part: ModulePart = {\n type,\n component,\n };\n if (exported) {\n mod.namedExports.set(id.name, part);\n } else {\n mod.internals.push(part);\n }\n }\n } else {\n const func = parseFunction(item, mod, globalOptions);\n if (func) {\n const part: ModulePart = {\n type: \"function\",\n function: func,\n };\n if (exported) {\n mod.namedExports.set(id.name, part);\n } else {\n mod.internals.push(part);\n }\n }\n }\n }\n\n if (defaultExportNode) {\n const type =\n mod.moduleType === \"entry\"\n ? \"view\"\n : mod.moduleType === \"page\"\n ? \"page\"\n : \"template\";\n const component = parseComponent(\n defaultExportNode,\n mod,\n type,\n globalOptions\n );\n if (component) {\n mod.defaultExport = {\n type,\n component,\n ...(type === \"view\" ? { title: getViewTitle(component) } : {}),\n };\n }\n }\n\n if (renderNode) {\n const children = parseChildren(renderNode, mod, globalOptions);\n mod.render = { type: \"render\", children };\n }\n\n path.stop();\n },\n });\n}\n\n/**\n * Checks if a given identifier is a component.\n *\n * Convention: components have names starting with uppercase letter\n * e.g. MyComponent, HelloWorld\n * functions have names starting with lowercase letter\n * e.g. myFunction, helloWorld\n */\nfunction isComponent(id: t.Identifier) {\n return id.name[0] >= \"A\" && id.name[0] <= \"Z\";\n}\n","import { parse, type ParseResult as BabelParseResult } from \"@babel/parser\";\nimport type * as t from \"@babel/types\";\nimport { parseModule } from \"./parseModule.js\";\nimport type {\n ModuleType,\n ParsedApp,\n ParseModuleOptions,\n ParsedModule,\n} from \"./interfaces.js\";\n\nexport interface SourceFile {\n filePath: string;\n content: string;\n}\n\nexport function parseFile(\n filePath: string,\n app: ParsedApp,\n ast?: BabelParseResult<t.File> | undefined,\n options?: ParseModuleOptions\n): void {\n const file = app.files.find((f) => f.filePath === filePath);\n if (!file) {\n throw new Error(`File not found: ${filePath}`);\n }\n\n if (app.modules.has(filePath)) {\n return;\n }\n\n app.modules.set(filePath, null);\n\n if (!ast) {\n ast = parse(file.content, {\n plugins: [\"jsx\", \"typescript\"],\n sourceType: \"module\",\n errorRecovery: true,\n });\n }\n\n const isEntry = !app.entry;\n\n const moduleType: ModuleType = isEntry\n ? \"entry\"\n : file.filePath.startsWith(\"Pages/\")\n ? \"page\"\n : file.filePath.startsWith(\"Components/\")\n ? \"template\"\n : \"unknown\";\n\n const mod: ParsedModule = {\n source: file.content,\n filePath,\n moduleType,\n defaultExport: null,\n namedExports: new Map(),\n internals: [],\n errors: [],\n contracts: new Set(),\n usedHelpers: new Set(),\n };\n\n if (ast.errors?.length) {\n for (const error of ast.errors) {\n mod.errors.push({\n message: `${error.code}: ${error.reasonCode}`,\n node: null,\n severity: \"error\",\n });\n }\n }\n\n if (isEntry) {\n app.entry = mod;\n }\n\n app.modules.set(filePath, mod);\n\n parseModule(mod, app, ast, options);\n}\n","// istanbul ignore file\nimport { parseView, type ParseOptions } from \"@next-shared/tsx-parser\";\nimport { expose } from \"comlink\";\n\nclass TsxParserWorker {\n parseView(source: string, options?: ParseOptions) {\n return parseView(source, options);\n }\n}\n\nexpose(TsxParserWorker);\n","import { parse, type ParseResult as BabelParseResult } from \"@babel/parser\";\nimport * as t from \"@babel/types\";\nimport type { ParseOptions } from \"./interfaces.js\";\nimport { parseLegacyModule } from \"./modules/parseLegacyModule.js\";\nimport type { ParsedApp } from \"./modules/interfaces.js\";\nimport { parseFile } from \"./modules/parseFile.js\";\n\nexport function parseView(source: string, options?: ParseOptions): ParsedApp {\n const app: ParsedApp = {\n appType: \"view\",\n modules: new Map(),\n files: [\n {\n filePath: \"View.tsx\",\n content: source,\n },\n ],\n errors: [],\n };\n\n let ast: BabelParseResult<t.File> | undefined;\n try {\n ast = parse(source, {\n plugins: [\"jsx\", \"typescript\"],\n sourceType: \"module\",\n errorRecovery: true,\n });\n } catch (error) {\n app.errors.push({\n message: `Failed to parse TSX: ${error}`,\n node: null,\n severity: \"fatal\",\n });\n return app;\n }\n\n for (const stmt of ast.program.body) {\n if (t.isExportDefaultDeclaration(stmt)) {\n if (t.isFunctionDeclaration(stmt.declaration)) {\n parseFile(\"View.tsx\", app, ast, options);\n return app;\n }\n break;\n }\n }\n\n parseLegacyModule(\"View.tsx\", app, ast, options);\n return app;\n}\n","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n// expose the modules object (__webpack_modules__)\n__webpack_require__.m = __webpack_modules__;\n\n// expose the module cache\n__webpack_require__.c = __webpack_module_cache__;\n\n// the startup function\n__webpack_require__.x = () => {\n\t// Load entry module and return exports\n\tvar __webpack_exports__ = __webpack_require__.O(undefined, [8135,3735,580], () => (__webpack_require__(41334)))\n\t__webpack_exports__ = __webpack_require__.O(__webpack_exports__);\n\treturn __webpack_exports__;\n};\n\n","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.f = {};\n// This file contains only the entry chunk.\n// The chunk loading function for additional chunks\n__webpack_require__.e = (chunkId) => {\n\treturn Promise.all(Object.keys(__webpack_require__.f).reduce((promises, key) => {\n\t\t__webpack_require__.f[key](chunkId, promises);\n\t\treturn promises;\n\t}, []));\n};","// This function allow to reference async chunks and sibling chunks for the entrypoint\n__webpack_require__.u = (chunkId) => {\n\t// return url for filenames based on template\n\treturn \"chunks/\" + chunkId + \".\" + {\"3735\":\"8c1d82e7\",\"6773\":\"afd27a30\",\"8135\":\"3255c5ba\"}[chunkId] + \".js\";\n};","__webpack_require__.g = (function() {\n\tif (typeof globalThis === 'object') return globalThis;\n\ttry {\n\t\treturn this || new Function('return this')();\n\t} catch (e) {\n\t\tif (typeof window === 'object') return window;\n\t}\n})();","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","__webpack_require__.S = {};\nvar initPromises = {};\nvar initTokens = {};\n__webpack_require__.I = (name, initScope) => {\n\tif(!initScope) initScope = [];\n\t// handling circular init calls\n\tvar initToken = initTokens[name];\n\tif(!initToken) initToken = initTokens[name] = {};\n\tif(initScope.indexOf(initToken) >= 0) return;\n\tinitScope.push(initToken);\n\t// only runs once\n\tif(initPromises[name]) return initPromises[name];\n\t// creates a new share scope if needed\n\tif(!__webpack_require__.o(__webpack_require__.S, name)) __webpack_require__.S[name] = {};\n\t// runs all init snippets from all modules reachable\n\tvar scope = __webpack_require__.S[name];\n\tvar warn = (msg) => {\n\t\tif (typeof console !== \"undefined\" && console.warn) console.warn(msg);\n\t};\n\tvar uniqueName = \"@next-bricks/ai-portal\";\n\tvar register = (name, version, factory, eager) => {\n\t\tvar versions = scope[name] = scope[name] || {};\n\t\tvar activeVersion = versions[version];\n\t\tif(!activeVersion || (!activeVersion.loaded && (!eager != !activeVersion.eager ? eager : uniqueName > activeVersion.from))) versions[version] = { get: factory, from: uniqueName, eager: !!eager };\n\t};\n\tvar initExternal = (id) => {\n\t\tvar handleError = (err) => (warn(\"Initialization of sharing external failed: \" + err));\n\t\ttry {\n\t\t\tvar module = __webpack_require__(id);\n\t\t\tif(!module) return;\n\t\t\tvar initFn = (module) => (module && module.init && module.init(__webpack_require__.S[name], initScope))\n\t\t\tif(module.then) return promises.push(module.then(initFn, handleError));\n\t\t\tvar initResult = initFn(module);\n\t\t\tif(initResult && initResult.then) return promises.push(initResult['catch'](handleError));\n\t\t} catch(err) { handleError(err); }\n\t}\n\tvar promises = [];\n\tswitch(name) {\n\t}\n\tif(!promises.length) return initPromises[name] = 1;\n\treturn initPromises[name] = Promise.all(promises).then(() => (initPromises[name] = 1));\n};","var scriptUrl;\nif (__webpack_require__.g.importScripts) scriptUrl = __webpack_require__.g.location + \"\";\nvar document = __webpack_require__.g.document;\nif (!scriptUrl && document) {\n\tif (document.currentScript && document.currentScript.tagName.toUpperCase() === 'SCRIPT')\n\t\tscriptUrl = document.currentScript.src;\n\tif (!scriptUrl) {\n\t\tvar scripts = document.getElementsByTagName(\"script\");\n\t\tif(scripts.length) {\n\t\t\tvar i = scripts.length - 1;\n\t\t\twhile (i > -1 && (!scriptUrl || !/^http(s?):/.test(scriptUrl))) scriptUrl = scripts[i--].src;\n\t\t}\n\t}\n}\n// When supporting browsers where an automatic publicPath is not supported you must specify an output.publicPath manually via configuration\n// or pass an empty string (\"\") and set the __webpack_public_path__ variable from your code to use your own logic.\nif (!scriptUrl) throw new Error(\"Automatic publicPath is not supported in this browser\");\nscriptUrl = scriptUrl.replace(/^blob:/, \"\").replace(/#.*$/, \"\").replace(/\\?.*$/, \"\").replace(/\\/[^\\/]+$/, \"/\");\n__webpack_require__.p = scriptUrl + \"../\";","// no baseURI\n\n// object to store loaded chunks\n// \"1\" means \"already loaded\"\nvar installedChunks = {\n\t1334: 1\n};\n\n// importScripts chunk loading\nvar installChunk = (data) => {\n\tvar [chunkIds, moreModules, runtime] = data;\n\tfor(var moduleId in moreModules) {\n\t\tif(__webpack_require__.o(moreModules, moduleId)) {\n\t\t\t__webpack_require__.m[moduleId] = moreModules[moduleId];\n\t\t}\n\t}\n\tif(runtime) runtime(__webpack_require__);\n\twhile(chunkIds.length)\n\t\tinstalledChunks[chunkIds.pop()] = 1;\n\tparentChunkLoadingFunction(data);\n};\n__webpack_require__.f.i = (chunkId, promises) => {\n\t// \"1\" is the signal for \"already loaded\"\n\tif(!installedChunks[chunkId]) {\n\t\tif(580 != chunkId) {\n\t\t\timportScripts(__webpack_require__.p + __webpack_require__.u(chunkId));\n\t\t}\n\t}\n};\n\nvar chunkLoadingGlobal = globalThis[\"webpackChunk_next_bricks_ai_portal\"] = globalThis[\"webpackChunk_next_bricks_ai_portal\"] || [];\nvar parentChunkLoadingFunction = chunkLoadingGlobal.push.bind(chunkLoadingGlobal);\nchunkLoadingGlobal.push = installChunk;\n\n// no HMR\n\n// no HMR manifest","// module cache are used so entry inlining is disabled\n// run startup\nvar __webpack_exports__ = __webpack_require__.x();\n"],"names":["deferred","parseVersion","versionLt","rangeToString","satisfy","exists","get","eagerOnly","findSingletonVersionKey","getInvalidSingletonVersionMessage","fail","warn","useFallback","loadSingletonVersion","installedModules","moduleToHandlerMapping","chunkMapping","startedInstallModules","next","MODULE_SOURCE","CALL_API_LIST","validateFunction","fn","state","async","generator","errors","push","message","node","severity","validateGlobalApi","id","api","referencesImport","name","scope","getBinding","validateEmbeddedExpression","expr","invalidNode","t","enter","parent","_parent","body","length","type","isNilPath","path","isNullLiteral","isIdentifier","undefined","EXPRESSION_PREFIX_REG","EXPRESSION_SUFFIX_REG","isExpressionString","value","trimmed","trim","test","parseEmbedded","options","noWrapping","_options$modifier","replacements","visitor","TSTypeAnnotation","tsPath","start","end","skip","TSTypeParameterInstantiation","TSAsExpression","expression","Identifier","idPath","_options$eventBinding","_options$eventBinding2","_options$forEachBindi","_options$forEachBindi2","_options$dataBinding","_options$contextBindi","isReferencedIdentifier","shorthand","parentPath","isObjectProperty","varName","bindingId","getBindingIdentifier","_options$component","_options$functionBind","specificReplacement","eventBinding","isCallback","forEachBinding","item","index","dataBinding","replacement","binding","component","bindingMap","kind","functionBindings","has","contextBindings","includes","traverse","sort","a","b","chunks","prevStart","rep","source","substring","join","modifier","ambiguousSymbol","Symbol","parseJsValue","isTSAsExpression","isObjectExpression","props","some","p","isSpreadElement","computed","ambiguous","result","prop","key","keyPath","isStringLiteral","parseJsObject","isArrayExpression","elements","e","elem","parseJsArray","isNumericLiteral","isBooleanLiteral","allowUseBrick","isArrowFunctionExpression","isBlockStatement","paramNames","param","params","children","parseChildren","isExpression","parsePropValue","shouldCompute","EXPECTED_ARGS","callApi","callHttp","callTool","parseCallApi","isCallExpression","isOptionalCallExpression","callee","calleeName","expectedArgs","args","missingArgs","payload","firstArg","http","conversationId","secondArg","stepId","paramsNode","tool","valuePath","metaPath","objectId","parseEvent","eventOptions","handler","parseEventHandler","concat","flatMap","stmtPath","filter","h","isIfStatement","action","consequent","alternate","isExpressionStatement","method","map","arg","contracts","add","isMemberExpression","isOptionalMemberExpression","object","property","refObject","_options$component3","refBindingId","refBinding","_options$component2","ref","objectCallee","successCallback","callback","success","getComponentReference","_options$componentBin","componentName","componentBindings","identifier","isImportSpecifier","isImportDeclaration","imported","importSource","isImportDefaultSpecifier","parseRefAttribute","attrValuePath","_attrValuePath$node7","_attrValuePath$node8","isJSXExpressionContainer","exprPath","refName","convertJsxEventAttr","attr","slice","replace","toLowerCase","parseElement","isJSXFragment","child","isJSXText","text","isJSXEmptyExpression","isJSXElement","openingElement","tagName","isJSXIdentifier","attributes","reference","properties","events","isRoute","isJSXSpreadAttribute","attrNamePath","attrName","_attrValuePath$node","_attrValuePath$node2","_attrValuePath$node3","_attrValuePath$node4","_attrValuePath$node5","_attrValuePath$node6","detail","textContent","parseLowLevelChildren","parseJSXElement","func","containsJsxNode","invalidParam","find","forEachOptions","itemArg","indexArg","dataSource","isConditionalExpression","slot","isLogicalExpression","left","right","operator","found","paths","rawChildren","onlyTextChildren","every","previousChild","tempChildren","_previousChild","_previousChild2","_previousChild3","splice","c","constructMergeTexts","usedHelpers","JSON","stringify","getViewTitle","_component$children","_view$properties","view","comp","isOfficialComponent","isAnyOfficialComponent","viewTitle","title","BabelTraverse","parseResourceCall","config","transformArgs","_transformArgs$","transform","parsePromiseCallback","rejectTransform","_params$1$node","_params$","optionsWithData","parseUseResource","decl","declId","isArrayPattern","resourceVar","resourcePath","call","resourceConfig","resource","parseComponent","globalOptions","Map","isObjectPattern","isRestElement","propNode","set","initialValue","isAssignmentPattern","paramBinding","stmts","stmt","isVariableDeclaration","init","stateVar","setStateVar","el","stateInfo","bindingInfo","isReturnStatement","isTSInterfaceDeclaration","isTSTypeAliasDeclaration","parseFunction","typescript","resolveExtensions","getFilePath","currentFilePath","files","startsWith","resolvePath","currentDir","lastIndexOf","segments","split","parts","part","pop","f","filePath","ext","FunctionScope","isComponent","parseFile","app","ast","_ast$errors","file","Error","modules","parse","content","plugins","sourceType","errorRecovery","isEntry","entry","moduleType","mod","defaultExport","namedExports","internals","Set","error","code","reasonCode","withContexts","Program","functionNodes","defaultExportNode","renderNode","imports","collectFunctions","isFunctionDeclaration","DefaultExportDeclaration","appType","NamedExportDeclaration","exported","isExportDefaultDeclaration","isExportNamedDeclaration","TopLevelStatement","function","render","stop","parseModule","expose","parseView","program","declaration","parseLegacyModule","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","exports","module","__webpack_modules__","m","x","__webpack_exports__","O","chunkIds","priority","notFulfilled","Infinity","i","fulfilled","j","Object","keys","r","d","definition","o","defineProperty","enumerable","chunkId","Promise","all","reduce","promises","u","g","globalThis","this","Function","window","obj","prototype","hasOwnProperty","S","initPromises","initTokens","I","initScope","initToken","indexOf","then","scriptUrl","importScripts","location","document","currentScript","toUpperCase","src","scripts","getElementsByTagName","str","n","exec","apply","range","version","s","bind","loaded","versions","filtered","eager","requiredVersion","from","msg","console","scopeName","fallback","failAsNotExist","promise","consumes","forEach","onFactory","factory","onError","installedChunks","chunkLoadingGlobal","parentChunkLoadingFunction","data","moreModules","runtime"],"sourceRoot":""}
@@ -0,0 +1,3 @@
1
+ /*! For license information please see 2084.37e19e93.js.LICENSE.txt */
2
+ "use strict";(globalThis.webpackChunk_next_bricks_ai_portal=globalThis.webpackChunk_next_bricks_ai_portal||[]).push([[2084],{5813:(e,t,i)=>{i.d(t,{I:()=>s,K:()=>o,NS:()=>l,t:()=>c});var n=i(68443);let o=function(e){return e.NEW_CHAT="NEW_CHAT",e.LOGOUT="LOGOUT",e.TODAY="TODAY",e.YESTERDAY="YESTERDAY",e.PREVIOUS_7_DAYS="PREVIOUS_7_DAYS",e.PREVIOUS_30_DAYS="PREVIOUS_30_DAYS",e.SWITCH_LANGUAGE="SWITCH_LANGUAGE",e.MY="MY",e.PROJECTS="PROJECTS",e.HISTORY="HISTORY",e.CREATE_PROJECT="CREATE_PROJECT",e.MOVE_TO_PROJECT="MOVE_TO_PROJECT",e.UNTITLED="UNTITLED",e.UNNAMED="UNNAMED",e}({});const r={[o.NEW_CHAT]:"New chat",[o.LOGOUT]:"Logout",[o.TODAY]:"Today",[o.YESTERDAY]:"Yesterday",[o.PREVIOUS_7_DAYS]:"Previous 7 days",[o.PREVIOUS_30_DAYS]:"Previous 30 days",[o.SWITCH_LANGUAGE]:"中文",[o.MY]:"My",[o.PROJECTS]:"Projects",[o.HISTORY]:"Chats",[o.CREATE_PROJECT]:"Create project",[o.MOVE_TO_PROJECT]:"Move to project",[o.UNTITLED]:"Untitled",[o.UNNAMED]:"Unnamed"},a={[o.NEW_CHAT]:"新对话",[o.LOGOUT]:"登出",[o.TODAY]:"今天",[o.YESTERDAY]:"昨天",[o.PREVIOUS_7_DAYS]:"过去7天",[o.PREVIOUS_30_DAYS]:"过去30天",[o.SWITCH_LANGUAGE]:"English",[o.MY]:"我的",[o.PROJECTS]:"项目",[o.HISTORY]:"对话",[o.CREATE_PROJECT]:"创建项目",[o.MOVE_TO_PROJECT]:"移动到项目",[o.UNTITLED]:"无标题",[o.UNNAMED]:"未命名"},l="bricks/ai-portal/elevo-sidebar",s={en:r,zh:a},c=n.i18n.getFixedT(null,l)},61408:(e,t,i)=>{i.d(t,{A:()=>l});var n=i(36758),o=i.n(n),r=i(40935),a=i.n(r)()(o());a.push([e.id,':host{display:block}:host([hidden]){display:none}*{box-sizing:border-box}.sidebar{position:relative;z-index:2;width:260px;height:100%;background:rgba(246,247,249,0.5);border:1px solid rgba(255,255,255,0.3);border-radius:12px;-webkit-backdrop-filter:blur(10px);backdrop-filter:blur(10px);padding:23px 11px 0;display:flex;flex-direction:column;transition:transform 0.3s ease-in-out}.logo-bar{display:flex;align-items:center;justify-content:space-between;margin-bottom:30px;margin-left:4px}.logo-link::part(link){display:block}.logo{vertical-align:middle}.new-chat::part(link){display:flex;gap:0;align-items:center;color:var(--elevo-color-brand);font-size:14px;text-align:left;cursor:pointer}.sidebar .new-chat::part(link){background:#f0f4ff;border-radius:8px;border:1px solid #c9d7ff;padding:9px 13px;font-weight:500;margin-bottom:16px}.sidebar .new-chat::part(link):hover{background:rgba(201,215,255,0.5)}.new-chat-icon{font-size:16px;margin-right:5px}.footer{border-top:1px solid rgba(0,0,0,0.04);padding:9px 12px;margin:0 -12px}.dropdown{display:block}.account{background:none;border:none;border-radius:8px;padding:6px 10px;display:block;width:100%;text-align:left;cursor:pointer}.account:hover{background:rgba(0,0,0,0.04)}.alternative{position:fixed;top:8px;left:8px;padding:6px 10px 6px 8px;display:flex;align-items:center;opacity:0;z-index:2;transition:opacity 0.2s ease-in-out;background:rgba(255,255,255,0);border-radius:8px;-webkit-backdrop-filter:blur(10px);backdrop-filter:blur(10px)}.alternative .new-chat::part(link){padding:4px;margin-left:16px;font-size:12px}.alternative .new-chat::part(link):hover{color:#7891ff}.alternative .new-chat::part(link):active{color:#0911b3}.container{width:270px;padding:10px 0 10px 10px;height:100%;transition:width 0.3s ease-in-out,padding 0.3s ease-in-out}.container.collapsed{width:0;padding:10px 0;overflow:visible}.container.collapsed .sidebar{transform:translateX(-100%)}.container.collapsed .alternative{opacity:1}:host([behavior="drawer"]){z-index:2;width:0}:host(:not([behavior="drawer"])) .alternative .new-chat{display:none}.mask{position:fixed;top:0;right:0;bottom:0;left:0}.links{border-bottom:1px solid rgba(0,0,0,0.06);padding-bottom:16px;margin-bottom:16px}.link{display:block}.link + .link{margin-top:4px}.link::part(link){display:flex;gap:0;align-items:center;padding:7px 10px;border-radius:8px;color:#000}.link.active::part(link),.link::part(link):hover{background:rgba(0,0,0,0.04)}.link .icon{font-size:16px;margin-right:10px}.link .title{flex:1;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.history{flex:1;min-height:0;overflow-y:auto;margin:0 -12px;padding:0 12px}.history ul{list-style:none;margin:0;padding:0}.history .section + .section{margin-top:14px}.history .section-title{display:flex;align-items:center;justify-content:space-between;height:30px;margin-bottom:6px;padding:0 8px;position:sticky;top:0}.history .section-title.sticky::before{content:"";position:absolute;top:0;right:0;bottom:0;left:0;background-color:rgb(229,228,234);border-radius:8px;z-index:-1}.history .section-label{display:flex;align-items:center;height:24px;padding:0 8px;margin-left:-8px;cursor:pointer;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-weight:500;font-size:12px;color:#8c8c8c;border-radius:8px}.history .section-label eo-icon{vertical-align:middle;margin-left:6px;transition:transform 0.2s ease-in-out}.history .section-label:hover{background:rgba(0,0,0,0.04)}.history .collapsed > ul{display:none}.history .collapsed .section-label eo-icon{transform:rotate(-90deg)}.history .error,.history .loading{display:flex;align-items:center;height:36px;padding:0 8px}.history .loading{justify-content:center}.history .error{color:var(--color-error)}.history .group + .group{margin-top:15px}.history .group-title{font-weight:500;font-size:12px;color:#000;padding:8px;height:36px;line-height:20px}.history .item{display:block}.history .item::part(link){display:flex;align-items:center;padding:0 8px;height:36px;border-radius:8px;color:#000}.history .item.active::part(link){background:rgba(0,0,0,0.06)}.history .item.actions-active::part(link),.history .item::part(link):hover{background:rgba(0,0,0,0.04)}.history .item-title{flex:1;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.history .actions{cursor:auto}.history .item:not(:hover):not(.actions-active) .actions{display:none}.history .working{width:8px;height:8px;border-radius:8px;background:var(--elevo-color-brand);margin:0 7px}.history .item.actions-active .working,.history .item:hover .working,.history .item.active .working{display:none}.history .load-more{display:flex;justify-content:center;align-items:center;height:36px}.button{display:flex}',""]);const l=a.toString()},70579:(e,t,i)=>{i.d(t,{Bj:()=>o,EM:()=>r,JQ:()=>l,Py:()=>c,qb:()=>a,qu:()=>s});var n=i(30981);const o=(0,n.wrapBrick)("eo-icon"),r=(0,n.wrapBrick)("eo-link"),a=(0,n.wrapBrick)("eo-dropdown-actions",{onActionClick:"action.click",onVisibleChange:"visible.change"}),l=(0,n.wrapBrick)("eo-easyops-avatar"),s=(0,n.wrapBrick)("eo-mini-actions",{onActionClick:"action.click",onVisibleChange:"visible.change"}),c=(0,n.wrapBrick)("ai-portal.icon-button")},75197:(e,t,i)=>{i.d(t,{D:()=>b});var n=i(89575),o=i(18769),r=i.n(o),a=i(53373),l=i.n(a),s=i(22919);const c=async(e,t)=>(await s.http.get("api/gateway/logic.llm.aiops_service/api/v1/elevo/conversations",{...t,params:e})).data;var d=i(41030),p=i(5813),u=i(70579),m=i(40177),g=i(65549),h=i(94504);const E={lib:"fa",icon:"plus"},b=(0,o.forwardRef)(x);function x(e,t){let{historyActions:i,historyUrlTemplate:a,projectUrlTemplate:b,projectActions:x,canAddProject:v,myLinks:k,onActionClick:y,onHistoryClick:T,onProjectActionClick:w,onAddProject:O}=e;const A=(0,o.useRef)(null),[C,S]=(0,o.useState)(!1),[_,N]=(0,o.useState)(null),[R,I]=(0,o.useState)(!1),[P,U]=(0,o.useState)(!1),[Y,D]=(0,o.useState)(null),[j,M]=(0,o.useState)(!1),[L,V]=(0,o.useState)(),[H,B]=(0,o.useState)(),[J,z]=(0,o.useState)(!1),G=(0,o.useRef)(!0),[q,K]=(0,o.useState)([]),W=(0,o.useMemo)((()=>[...null!=i?i:[],{isDropdown:!0,text:(0,p.t)(p.K.MOVE_TO_PROJECT),disabled:!(null!=_&&_.length),items:null==_?void 0:_.map((e=>({event:"move",key:e.instanceId,text:e.name,project:e})))}]),[i,_]);(0,o.useEffect)((()=>{(async()=>{try{const e=await(async()=>(await s.http.get("api/gateway/logic.llm.aiops_service/api/v1/elevo/projects",{params:{page:1,page_size:3e3}})).data)();N(e.list)}catch(e){console.error("Error loading projects:",e),U(!0),N([])}})()}),[]),(0,o.useEffect)((()=>{Promise.all([c({token:H,limit:30,onlyOwner:!0,onlyUnrelatedProject:!0},{interceptorParams:{ignoreLoadingBar:!0}}),...G.current?[]:[new Promise((e=>setTimeout(e,500)))]]).then((e=>{let[t]=e;G.current=!1,D((e=>[...null!=e?e:[],...t.conversations])),V(t.nextToken)})).catch((e=>{console.error("Error loading chat history:",e),D([]),z(!0)}))}),[H]);const[Q,F]=(0,o.useState)(null),X=(0,o.useRef)(null);(0,o.useEffect)((()=>{const e=X.current,t=A.current;if(!e||!L||!t||j)return;const i=new IntersectionObserver((e=>{for(const t of e)t.isIntersecting&&B(L)}),{root:t});return i.observe(e),()=>{i.disconnect()}}),[L,j]);const Z=(0,o.useRef)(0),$=(0,o.useCallback)((async()=>{try{const e=++Z.current,t=await c({limit:30,onlyOwner:!0,onlyUnrelatedProject:!0},{interceptorParams:{ignoreLoadingBar:!0}});if(e!==Z.current)return;D((e=>{const i=null!=e?e:[],n=t.conversations,o=new Set(n.map((e=>e.conversationId))),r=new Map(n.map((e=>[e.conversationId,e])));let a=!1,l=!1,s=!0;for(const e of i){const t=r.get(e.conversationId);if(!t)break;if(a=!0,l=s&&t!==n[0]||!(0,d.isEqual)(t,e),l)break;s=!1}return a?l?[...n,...i.filter((e=>!o.has(e.conversationId)))]:e:(V(t.nextToken),n)}))}catch(e){console.error("Error pulling chat history:",e)}}),[]);(0,o.useImperativeHandle)(t,(()=>({pull:$,removeProject:e=>{N((t=>t?t.filter((t=>t.instanceId!==e)):t))},addProject:e=>{N((t=>t?[...t,e]:[e]))},moveConversation:e=>{K((t=>[...t,e]))}})),[$]);const ee=(0,o.useMemo)((()=>Y&&Y.length?Y.filter((e=>!q.includes(e.conversationId))):Y),[Y,q]);return r().createElement("div",{className:"history",ref:A},null!=k&&k.length?r().createElement("div",{className:l()("section",{collapsed:C})},r().createElement(f,{rootRef:A,title:(0,p.t)(p.K.MY),onToggle:()=>S((e=>!e))}),r().createElement("ul",{className:"items"},k.map(((e,t)=>r().createElement("li",{key:t},r().createElement(h.k,{url:e.url,activeIncludes:e.activeIncludes,render:t=>{let{active:i}=t;return r().createElement(u.EM,{className:l()("item",{active:i}),url:e.url},r().createElement("div",{className:"item-title"},e.title))}})))))):null,r().createElement("div",{className:l()("section",{collapsed:R})},r().createElement(f,{rootRef:A,title:(0,p.t)(p.K.PROJECTS),onToggle:()=>I((e=>!e))},v&&r().createElement(u.Py,{icon:E,variant:"mini-light",tooltip:(0,p.t)(p.K.CREATE_PROJECT),tooltipHoist:!0,className:"button",onClick:O})),r().createElement("ul",{className:"items"},P?r().createElement("li",{className:"error"},"Failed to load project"):_?_.map((e=>{const t=b?(0,g.Q)(b,e):void 0;return r().createElement("li",{key:e.instanceId},r().createElement(h.k,{url:t,render:i=>{let{active:o}=i;return r().createElement(u.EM,(0,n.A)({className:l()("item",{"actions-active":e.instanceId===Q,active:o}),onClick:T},t?{url:t}:null),r().createElement("div",{className:"item-title",title:e.name},e.name||(0,p.t)(p.K.UNNAMED)),r().createElement(u.qu,{className:"actions",actions:x,themeVariant:"elevo",onActionClick:t=>{w({action:t.detail,project:e})},onVisibleChange:t=>{F(t.detail?e.instanceId:null)}}))}}))})):r().createElement("li",{className:"loading"},r().createElement(u.Bj,{lib:"antd",theme:"outlined",icon:"loading-3-quarters",spinning:!0})))),r().createElement("div",{className:l()("section",{collapsed:j})},r().createElement(f,{rootRef:A,title:(0,p.t)(p.K.HISTORY),onToggle:()=>M((e=>!e))}),r().createElement("ul",{className:"items"},ee?ee.map((e=>{const t=a?(0,g.Q)(a,e):void 0;return r().createElement("li",{key:e.conversationId},r().createElement(h.k,{url:t,render:t=>{let{active:i}=t;return r().createElement(u.EM,(0,n.A)({className:l()("item",{"actions-active":e.conversationId===Q,active:i}),onClick:T},a?{url:(0,g.Q)(a,e)}:null),r().createElement("div",{className:"item-title",title:e.title},e.title||(0,p.t)(p.K.UNTITLED)),r().createElement(u.qu,{className:"actions",actions:W,onActionClick:t=>{y({action:t.detail,item:e})},onVisibleChange:t=>{F(t.detail?e.conversationId:null)}}),!m.QB.includes(e.state)&&r().createElement("div",{className:"working"}))}}))})):r().createElement("li",{className:"loading"},r().createElement(u.Bj,{lib:"antd",theme:"outlined",icon:"loading-3-quarters",spinning:!0})),J?r().createElement("li",{className:"error"},"Failed to load chat history"):null),!j&&L&&r().createElement("div",{className:"load-more",ref:X},r().createElement(u.Bj,{lib:"antd",icon:"loading-3-quarters",spinning:!0}))))}function f(e){let{rootRef:t,title:i,children:n,onToggle:a}=e;const s=(0,o.useRef)(null),[c,p]=(0,o.useState)(!1);return(0,o.useEffect)((()=>{const e=t.current,i=s.current,n=null==i?void 0:i.nextElementSibling;if(!e||!i||!n)return;const o=(0,d.throttle)((()=>{const e=i.getBoundingClientRect(),t=n.getBoundingClientRect().top-e.top-e.height;p(t<1)}),100);return e.addEventListener("scroll",o),()=>{e.removeEventListener("scroll",o)}}),[t]),r().createElement("div",{className:l()("section-title",{sticky:c}),ref:s},r().createElement("div",{className:"section-label",onClick:a},i,r().createElement(u.Bj,{lib:"fa",icon:"angle-down"})),n)}},94504:(e,t,i)=>{i.d(t,{k:()=>r});var n=i(18769),o=i(51921);function r(e){let{url:t,activeIncludes:i,render:r}=e;const[a,l]=(0,n.useState)(!1);return(0,n.useEffect)((()=>{function e(e){if(t){for(const n of[t,...null!=i?i:[]])if((0,o.matchPath)(e.pathname,{path:n,exact:!1}))return void l(!0);l(!1)}else l(!1)}const n=(0,o.getHistory)();return e(n.location),n.listen(e)}),[t,i]),r({active:a})}}}]);
3
+ //# sourceMappingURL=2084.37e19e93.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"chunks/2084.37e19e93.js","mappings":";qMAEO,IAAKA,EAAC,SAADA,GAAC,OAADA,EAAC,oBAADA,EAAC,gBAADA,EAAC,cAADA,EAAC,sBAADA,EAAC,kCAADA,EAAC,oCAADA,EAAC,kCAADA,EAAC,QAADA,EAAC,oBAADA,EAAC,kBAADA,EAAC,gCAADA,EAAC,kCAADA,EAAC,oBAADA,EAAC,kBAADA,CAAC,MAiBb,MAAMC,EAAa,CACjB,CAACD,EAAEE,UAAW,WACd,CAACF,EAAEG,QAAS,SACZ,CAACH,EAAEI,OAAQ,QACX,CAACJ,EAAEK,WAAY,YACf,CAACL,EAAEM,iBAAkB,kBACrB,CAACN,EAAEO,kBAAmB,mBACtB,CAACP,EAAEQ,iBAAkB,KACrB,CAACR,EAAES,IAAK,KACR,CAACT,EAAEU,UAAW,WACd,CAACV,EAAEW,SAAU,QACb,CAACX,EAAEY,gBAAiB,iBACpB,CAACZ,EAAEa,iBAAkB,kBACrB,CAACb,EAAEc,UAAW,WACd,CAACd,EAAEe,SAAU,WAGTC,EAAa,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R,EAAS,CAC/C,GACA,CAAC7I,IAGFoG,IAAAA,cAAA,OACEC,UAAWC,IAAW,gBAAiB,CAAEgD,OAAQf,IACjDjJ,IAAKA,GAEL8G,IAAAA,cAAA,OAAKC,UAAU,gBAAgBiB,QAASZ,GACrCD,EACDL,IAAAA,cAACrI,EAAAA,GAAW,CAACiB,IAAI,KAAKC,KAAK,gBAE5BqJ,EAGP,8DC/hBO,SAASzB,EAAOxH,GAAgD,IAA/C,IAAEyH,EAAG,eAAEC,EAAc,OAAEC,GAAsB3H,EACnE,MAAO6H,EAAQqC,IAAanJ,EAAAA,EAAAA,WAAS,GAsBrC,OApBAiC,EAAAA,EAAAA,YAAU,KACR,SAASmH,EAAgBC,GACvB,GAAK3C,EAAL,CAIA,IAAK,MAAM4C,IAAQ,CAAC5C,KAASC,QAAAA,EAAkB,IAE7C,IADgB4C,EAAAA,EAAAA,WAAUF,EAAIG,SAAU,CAAEF,OAAMG,OAAO,IAGrD,YADAN,GAAU,GAIdA,GAAU,EARV,MAFEA,GAAU,EAWd,CACA,MAAMO,GAAUC,EAAAA,EAAAA,cAEhB,OADAP,EAAgBM,EAAQE,UACjBF,EAAQG,OAAOT,EAAgB,GACrC,CAAC1C,EAAKC,IAEFC,EAAO,CAAEE,UAClB","sources":["webpack:///./src/elevo-sidebar/i18n.ts","webpack:///./src/elevo-sidebar/styles.shadow.css","webpack:///./src/elevo-sidebar/bricks.ts","webpack:///../../node_modules/@next-api-sdk/llm-sdk/dist/esm/api/llm/elevo/getElevoProjects.js","webpack:///../../node_modules/@next-api-sdk/llm-sdk/dist/esm/api/llm/elevo/listElevoConversations.js","webpack:///./src/elevo-sidebar/ChatHistory.tsx","webpack:///./src/elevo-sidebar/NavLink.tsx"],"sourcesContent":["import { i18n } from \"@next-core/i18n\";\n\nexport enum K {\n NEW_CHAT = \"NEW_CHAT\",\n LOGOUT = \"LOGOUT\",\n TODAY = \"TODAY\",\n YESTERDAY = \"YESTERDAY\",\n PREVIOUS_7_DAYS = \"PREVIOUS_7_DAYS\",\n PREVIOUS_30_DAYS = \"PREVIOUS_30_DAYS\",\n SWITCH_LANGUAGE = \"SWITCH_LANGUAGE\",\n MY = \"MY\",\n PROJECTS = \"PROJECTS\",\n HISTORY = \"HISTORY\",\n CREATE_PROJECT = \"CREATE_PROJECT\",\n MOVE_TO_PROJECT = \"MOVE_TO_PROJECT\",\n UNTITLED = \"UNTITLED\",\n UNNAMED = \"UNNAMED\",\n}\n\nconst en: Locale = {\n [K.NEW_CHAT]: \"New chat\",\n [K.LOGOUT]: \"Logout\",\n [K.TODAY]: \"Today\",\n [K.YESTERDAY]: \"Yesterday\",\n [K.PREVIOUS_7_DAYS]: \"Previous 7 days\",\n [K.PREVIOUS_30_DAYS]: \"Previous 30 days\",\n [K.SWITCH_LANGUAGE]: \"中文\",\n [K.MY]: \"My\",\n [K.PROJECTS]: \"Projects\",\n [K.HISTORY]: \"Chats\",\n [K.CREATE_PROJECT]: \"Create project\",\n [K.MOVE_TO_PROJECT]: \"Move to project\",\n [K.UNTITLED]: \"Untitled\",\n [K.UNNAMED]: \"Unnamed\",\n};\n\nconst zh: Locale = {\n [K.NEW_CHAT]: \"新对话\",\n [K.LOGOUT]: \"登出\",\n [K.TODAY]: \"今天\",\n [K.YESTERDAY]: \"昨天\",\n [K.PREVIOUS_7_DAYS]: \"过去7天\",\n [K.PREVIOUS_30_DAYS]: \"过去30天\",\n [K.SWITCH_LANGUAGE]: \"English\",\n [K.MY]: \"我的\",\n [K.PROJECTS]: \"项目\",\n [K.HISTORY]: \"对话\",\n [K.CREATE_PROJECT]: \"创建项目\",\n [K.MOVE_TO_PROJECT]: \"移动到项目\",\n [K.UNTITLED]: \"无标题\",\n [K.UNNAMED]: \"未命名\",\n};\n\nexport const NS = \"bricks/ai-portal/elevo-sidebar\";\n\nexport const locales = { en, zh };\n\nexport const t = i18n.getFixedT(null, NS);\n\ntype Locale = { [k in K]: string } & {\n [k in K as `${k}_plural`]?: string;\n};\n","// Imports\nimport ___CSS_LOADER_API_NO_SOURCEMAP_IMPORT___ from \"../../../../node_modules/css-loader/dist/runtime/noSourceMaps.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../../node_modules/css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_NO_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, `:host{display:block}:host([hidden]){display:none}*{box-sizing:border-box}.sidebar{position:relative;z-index:2;width:260px;height:100%;background:rgba(246,247,249,0.5);border:1px solid rgba(255,255,255,0.3);border-radius:12px;-webkit-backdrop-filter:blur(10px);backdrop-filter:blur(10px);padding:23px 11px 0;display:flex;flex-direction:column;transition:transform 0.3s ease-in-out}.logo-bar{display:flex;align-items:center;justify-content:space-between;margin-bottom:30px;margin-left:4px}.logo-link::part(link){display:block}.logo{vertical-align:middle}.new-chat::part(link){display:flex;gap:0;align-items:center;color:var(--elevo-color-brand);font-size:14px;text-align:left;cursor:pointer}.sidebar .new-chat::part(link){background:#f0f4ff;border-radius:8px;border:1px solid #c9d7ff;padding:9px 13px;font-weight:500;margin-bottom:16px}.sidebar .new-chat::part(link):hover{background:rgba(201,215,255,0.5)}.new-chat-icon{font-size:16px;margin-right:5px}.footer{border-top:1px solid rgba(0,0,0,0.04);padding:9px 12px;margin:0 -12px}.dropdown{display:block}.account{background:none;border:none;border-radius:8px;padding:6px 10px;display:block;width:100%;text-align:left;cursor:pointer}.account:hover{background:rgba(0,0,0,0.04)}.alternative{position:fixed;top:8px;left:8px;padding:6px 10px 6px 8px;display:flex;align-items:center;opacity:0;z-index:2;transition:opacity 0.2s ease-in-out;background:rgba(255,255,255,0);border-radius:8px;-webkit-backdrop-filter:blur(10px);backdrop-filter:blur(10px)}.alternative .new-chat::part(link){padding:4px;margin-left:16px;font-size:12px}.alternative .new-chat::part(link):hover{color:#7891ff}.alternative .new-chat::part(link):active{color:#0911b3}.container{width:270px;padding:10px 0 10px 10px;height:100%;transition:width 0.3s ease-in-out,padding 0.3s ease-in-out}.container.collapsed{width:0;padding:10px 0;overflow:visible}.container.collapsed .sidebar{transform:translateX(-100%)}.container.collapsed .alternative{opacity:1}:host([behavior=\"drawer\"]){z-index:2;width:0}:host(:not([behavior=\"drawer\"])) .alternative .new-chat{display:none}.mask{position:fixed;top:0;right:0;bottom:0;left:0}.links{border-bottom:1px solid rgba(0,0,0,0.06);padding-bottom:16px;margin-bottom:16px}.link{display:block}.link + .link{margin-top:4px}.link::part(link){display:flex;gap:0;align-items:center;padding:7px 10px;border-radius:8px;color:#000}.link.active::part(link),.link::part(link):hover{background:rgba(0,0,0,0.04)}.link .icon{font-size:16px;margin-right:10px}.link .title{flex:1;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.history{flex:1;min-height:0;overflow-y:auto;margin:0 -12px;padding:0 12px}.history ul{list-style:none;margin:0;padding:0}.history .section + .section{margin-top:14px}.history .section-title{display:flex;align-items:center;justify-content:space-between;height:30px;margin-bottom:6px;padding:0 8px;position:sticky;top:0}.history .section-title.sticky::before{content:\"\";position:absolute;top:0;right:0;bottom:0;left:0;background-color:rgb(229,228,234);border-radius:8px;z-index:-1}.history .section-label{display:flex;align-items:center;height:24px;padding:0 8px;margin-left:-8px;cursor:pointer;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-weight:500;font-size:12px;color:#8c8c8c;border-radius:8px}.history .section-label eo-icon{vertical-align:middle;margin-left:6px;transition:transform 0.2s ease-in-out}.history .section-label:hover{background:rgba(0,0,0,0.04)}.history .collapsed > ul{display:none}.history .collapsed .section-label eo-icon{transform:rotate(-90deg)}.history .error,.history .loading{display:flex;align-items:center;height:36px;padding:0 8px}.history .loading{justify-content:center}.history .error{color:var(--color-error)}.history .group + .group{margin-top:15px}.history .group-title{font-weight:500;font-size:12px;color:#000;padding:8px;height:36px;line-height:20px}.history .item{display:block}.history .item::part(link){display:flex;align-items:center;padding:0 8px;height:36px;border-radius:8px;color:#000}.history .item.active::part(link){background:rgba(0,0,0,0.06)}.history .item.actions-active::part(link),.history .item::part(link):hover{background:rgba(0,0,0,0.04)}.history .item-title{flex:1;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.history .actions{cursor:auto}.history .item:not(:hover):not(.actions-active) .actions{display:none}.history .working{width:8px;height:8px;border-radius:8px;background:var(--elevo-color-brand);margin:0 7px}.history .item.actions-active .working,.history .item:hover .working,.history .item.active .working{display:none}.history .load-more{display:flex;justify-content:center;align-items:center;height:36px}.button{display:flex}`, \"\"]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___.toString();\n","import { wrapBrick } from \"@next-core/react-element\";\nimport type {\n GeneralIcon,\n GeneralIconProps,\n} from \"@next-bricks/icons/general-icon\";\nimport type { Link, LinkProps } from \"@next-bricks/basic/link\";\nimport type {\n EoDropdownActions,\n DropdownActionsProps,\n DropdownActionsEvents,\n DropdownActionsEventsMapping,\n} from \"@next-bricks/basic/dropdown-actions\";\nimport type {\n EoEasyopsAvatar,\n EoEasyopsAvatarProps,\n} from \"@next-bricks/basic/easyops-avatar\";\nimport type {\n EoMiniActions,\n EoMiniActionsEvents,\n EoMiniActionsEventsMapping,\n EoMiniActionsProps,\n} from \"@next-bricks/basic/mini-actions\";\nimport type { IconButton, IconButtonProps } from \"../icon-button\";\n\nexport const WrappedIcon = wrapBrick<GeneralIcon, GeneralIconProps>(\"eo-icon\");\nexport const WrappedLink = wrapBrick<Link, LinkProps>(\"eo-link\");\nexport const WrappedDropdownActions = wrapBrick<\n EoDropdownActions,\n DropdownActionsProps,\n DropdownActionsEvents,\n DropdownActionsEventsMapping\n>(\"eo-dropdown-actions\", {\n onActionClick: \"action.click\",\n onVisibleChange: \"visible.change\",\n});\nexport const WrappedEasyopsAvatar = wrapBrick<\n EoEasyopsAvatar,\n EoEasyopsAvatarProps\n>(\"eo-easyops-avatar\");\nexport const WrappedMiniActions = wrapBrick<\n EoMiniActions,\n EoMiniActionsProps & { themeVariant?: \"default\" | \"elevo\" },\n EoMiniActionsEvents,\n EoMiniActionsEventsMapping\n>(\"eo-mini-actions\", {\n onActionClick: \"action.click\",\n onVisibleChange: \"visible.change\",\n});\nexport const WrappedIconButton = wrapBrick<IconButton, IconButtonProps>(\n \"ai-portal.icon-button\"\n);\n","import { http } from \"@next-core/http\";\n/**\n * @description 获取elevo项目列表\n * @endpoint list /api/v1/elevo/projects\n */\nexport const ElevoApi_getElevoProjects = async (params, options) => /**! @contract easyops.api.llm.elevo.GetElevoProjects@1.0.0 */(await http.get(\"api/gateway/logic.llm.aiops_service/api/v1/elevo/projects\", {\n ...options,\n params\n})).data;\n//# sourceMappingURL=getElevoProjects.js.map","import { http } from \"@next-core/http\";\n/**\n * @description 获取elevo会话列表\n * @endpoint GET /api/v1/elevo/conversations\n */\nexport const ElevoApi_listElevoConversations = async (params, options) => /**! @contract easyops.api.llm.elevo.ListElevoConversations@1.0.0 */(await http.get(\"api/gateway/logic.llm.aiops_service/api/v1/elevo/conversations\", {\n ...options,\n params\n})).data;\n//# sourceMappingURL=listElevoConversations.js.map","import React, {\n forwardRef,\n useCallback,\n useEffect,\n useImperativeHandle,\n useMemo,\n useRef,\n useState,\n type MutableRefObject,\n type PropsWithChildren,\n} from \"react\";\nimport classNames from \"classnames\";\nimport {\n ElevoApi_listElevoConversations,\n ElevoApi_getElevoProjects,\n type ElevoApi_ListElevoConversationsRequestParams,\n} from \"@next-api-sdk/llm-sdk\";\nimport type {\n ActionType,\n SimpleActionType,\n} from \"@next-bricks/basic/mini-actions\";\nimport type { GeneralIconProps } from \"@next-bricks/icons/general-icon\";\nimport { isEqual, throttle } from \"lodash\";\nimport { K, t } from \"./i18n.js\";\nimport {\n WrappedIcon,\n WrappedLink,\n WrappedMiniActions,\n WrappedIconButton,\n} from \"./bricks.js\";\nimport { DONE_STATES } from \"../shared/constants.js\";\nimport { parseTemplate } from \"../shared/parseTemplate.js\";\nimport type { ConversationState } from \"../shared/interfaces.js\";\nimport type { SidebarLink } from \"./index.js\";\nimport { NavLink } from \"./NavLink.js\";\n\nconst ADD_ICON: GeneralIconProps = {\n lib: \"fa\",\n icon: \"plus\",\n};\n\nexport interface HistoryItem {\n conversationId: string;\n title: string;\n startTime: number;\n state?: ConversationState;\n}\n\nexport interface GroupedHistory {\n title: string;\n items: HistoryItem[];\n}\n\nexport interface ActionClickDetail {\n action: SimpleActionType;\n item: HistoryItem;\n project?: Project;\n}\n\nexport interface ProjectActionClickDetail {\n action: SimpleActionType;\n project: Project;\n}\n\nexport interface Project {\n /** 实例ID */\n instanceId: string;\n /** 项目名称 */\n name: string;\n /** 项目描述 */\n description: string;\n /** 状态 */\n state: \"active\" | \"inactive\";\n /** 默认数字人ID */\n defaultAiEmployeeId: string;\n /** 创建者 */\n creator: string;\n /** 创建时间 */\n ctime: string;\n /** 修改时间 */\n mtime: string;\n /** 修改者 */\n modifier: string;\n}\n\nexport interface ChatHistoryProps {\n historyUrlTemplate?: string;\n historyActions?: ActionType[];\n projectUrlTemplate?: string;\n projectActions?: ActionType[];\n canAddProject?: boolean;\n myLinks?: SidebarLink[];\n onActionClick: (detail: ActionClickDetail) => void;\n onHistoryClick: () => void;\n onProjectActionClick: (detail: ProjectActionClickDetail) => void;\n onAddProject: () => void;\n}\n\nexport interface ChatHistoryRef {\n pull: () => void;\n removeProject?: (projectId: string) => void;\n addProject?: (project: Project) => void;\n moveConversation?: (conversationId: string) => void;\n}\n\nexport const ChatHistory = forwardRef(LowLevelChatHistory);\n\nexport function LowLevelChatHistory(\n {\n historyActions,\n historyUrlTemplate,\n projectUrlTemplate,\n projectActions,\n canAddProject,\n myLinks,\n onActionClick,\n onHistoryClick,\n onProjectActionClick,\n onAddProject,\n }: ChatHistoryProps,\n ref: React.Ref<ChatHistoryRef>\n) {\n const rootRef = useRef<HTMLDivElement | null>(null);\n const [myCollapsed, setMyCollapsed] = useState(false);\n const [projects, setProjects] = useState<Project[] | null>(null);\n const [projectsCollapsed, setProjectsCollapsed] = useState(false);\n const [projectsError, setProjectsError] = useState(false);\n const [historyList, setHistoryList] = useState<HistoryItem[] | null>(null);\n const [historyCollapsed, setHistoryCollapsed] = useState(false);\n const [nextToken, setNextToken] = useState<string | undefined>();\n const [loadNextToken, setLoadNextToken] = useState<string | undefined>();\n const [historyError, setHistoryError] = useState(false);\n const initialRef = useRef(true);\n const [movedConversations, setMovedConversations] = useState<string[]>([]);\n\n const mergedHistoryActions = useMemo(\n () =>\n [\n ...(historyActions ?? []),\n {\n isDropdown: true,\n text: t(K.MOVE_TO_PROJECT),\n disabled: !projects?.length,\n items: projects?.map((project) => ({\n event: \"move\",\n key: project.instanceId,\n text: project.name,\n project,\n })),\n },\n ] as ActionType[],\n [historyActions, projects]\n );\n\n useEffect(() => {\n (async () => {\n try {\n const projects = await ElevoApi_getElevoProjects({\n page: 1,\n page_size: 3000,\n });\n setProjects(projects.list as Project[]);\n } catch (error) {\n // eslint-disable-next-line no-console\n console.error(\"Error loading projects:\", error);\n setProjectsError(true);\n setProjects([]);\n }\n })();\n }, []);\n\n useEffect(() => {\n Promise.all([\n ElevoApi_listElevoConversations(\n {\n token: loadNextToken,\n limit: 30,\n onlyOwner: true,\n onlyUnrelatedProject: true,\n } as ElevoApi_ListElevoConversationsRequestParams,\n {\n interceptorParams: {\n ignoreLoadingBar: true,\n },\n }\n ),\n ...(initialRef.current\n ? []\n : [\n new Promise((resolve) => setTimeout(resolve, 500)), // Force a minimum delay\n ]),\n ])\n .then(([data]) => {\n initialRef.current = false;\n setHistoryList((prev) => [\n ...(prev ?? []),\n ...(data.conversations as HistoryItem[]),\n ]);\n setNextToken(data.nextToken);\n })\n .catch((error) => {\n // eslint-disable-next-line no-console\n console.error(\"Error loading chat history:\", error);\n setHistoryList([]);\n setHistoryError(true);\n });\n }, [loadNextToken]);\n\n const [actionsVisible, setActionsVisible] = useState<string | null>(null);\n\n const nextRef = useRef<HTMLDivElement | null>(null);\n\n useEffect(() => {\n const next = nextRef.current;\n const root = rootRef.current;\n if (!next || !nextToken || !root || historyCollapsed) {\n return;\n }\n const observer = new IntersectionObserver(\n (entries) => {\n for (const entry of entries) {\n if (entry.isIntersecting) {\n setLoadNextToken(nextToken);\n }\n }\n },\n { root }\n );\n observer.observe(next);\n return () => {\n observer.disconnect();\n };\n }, [nextToken, historyCollapsed]);\n\n const pullIdRef = useRef(0);\n\n const pull = useCallback(async () => {\n try {\n const pullId = ++pullIdRef.current;\n const tempList = await ElevoApi_listElevoConversations(\n {\n limit: 30,\n onlyOwner: true,\n onlyUnrelatedProject: true,\n } as ElevoApi_ListElevoConversationsRequestParams,\n {\n interceptorParams: {\n ignoreLoadingBar: true,\n },\n }\n );\n if (pullId !== pullIdRef.current) {\n // Ignore this pull if a newer one has been triggered\n return;\n }\n setHistoryList((prev) => {\n const prevList = prev ?? [];\n const newList = tempList.conversations as HistoryItem[];\n const newIds = new Set(newList.map((item) => item.conversationId));\n const newItemsMap = new Map(\n newList.map((item) => [item.conversationId, item])\n );\n\n let foundIntersection = false;\n let foundChanged = false;\n let isFirst = true;\n for (const item of prevList) {\n const newItem = newItemsMap.get(item.conversationId);\n if (newItem) {\n foundIntersection = true;\n foundChanged =\n (isFirst && newItem !== newList[0]) || !isEqual(newItem, item);\n if (foundChanged) {\n break;\n }\n } else {\n break;\n }\n isFirst = false;\n }\n\n if (!foundIntersection) {\n setNextToken(tempList.nextToken);\n return newList;\n }\n\n if (foundChanged) {\n return [\n ...newList,\n ...prevList.filter((item) => !newIds.has(item.conversationId)),\n ];\n }\n\n return prev;\n });\n } catch (error) {\n // eslint-disable-next-line no-console\n console.error(\"Error pulling chat history:\", error);\n }\n }, []);\n\n useImperativeHandle(\n ref,\n () => ({\n pull,\n removeProject: (projectId: string) => {\n setProjects((prev) =>\n prev ? prev.filter((p) => p.instanceId !== projectId) : prev\n );\n },\n addProject: (project: Project) => {\n setProjects((prev) => (prev ? [...prev, project] : [project]));\n },\n moveConversation: (conversationId: string) => {\n setMovedConversations((prev) => [...prev, conversationId]);\n },\n }),\n [pull]\n );\n\n const filteredHistoryList = useMemo(() => {\n if (!historyList || !historyList.length) {\n return historyList;\n }\n return historyList.filter(\n (item) => !movedConversations.includes(item.conversationId)\n );\n }, [historyList, movedConversations]);\n\n return (\n <div className=\"history\" ref={rootRef}>\n {myLinks?.length ? (\n <div className={classNames(\"section\", { collapsed: myCollapsed })}>\n <SectionTitle\n rootRef={rootRef}\n title={t(K.MY)}\n onToggle={() => setMyCollapsed((prev) => !prev)}\n />\n <ul className=\"items\">\n {myLinks.map((link, index) => (\n <li key={index}>\n <NavLink\n url={link.url}\n activeIncludes={link.activeIncludes}\n render={({ active }) => (\n <WrappedLink\n className={classNames(\"item\", { active })}\n url={link.url}\n >\n <div className=\"item-title\">{link.title}</div>\n </WrappedLink>\n )}\n />\n </li>\n ))}\n </ul>\n </div>\n ) : null}\n <div className={classNames(\"section\", { collapsed: projectsCollapsed })}>\n <SectionTitle\n rootRef={rootRef}\n title={t(K.PROJECTS)}\n onToggle={() => setProjectsCollapsed((prev) => !prev)}\n >\n {canAddProject && (\n <WrappedIconButton\n icon={ADD_ICON}\n variant=\"mini-light\"\n tooltip={t(K.CREATE_PROJECT)}\n tooltipHoist={true}\n className=\"button\"\n onClick={onAddProject}\n />\n )}\n </SectionTitle>\n <ul className=\"items\">\n {projectsError ? (\n <li className=\"error\">Failed to load project</li>\n ) : projects ? (\n projects.map((project) => {\n const url = projectUrlTemplate\n ? parseTemplate(projectUrlTemplate, project)\n : undefined;\n return (\n <li key={project.instanceId}>\n <NavLink\n url={url}\n render={({ active }) => (\n <WrappedLink\n className={classNames(\"item\", {\n \"actions-active\":\n project.instanceId === actionsVisible,\n active,\n })}\n onClick={onHistoryClick}\n {...(url ? { url } : null)}\n >\n <div className=\"item-title\" title={project.name}>\n {project.name || t(K.UNNAMED)}\n </div>\n <WrappedMiniActions\n className=\"actions\"\n actions={projectActions}\n themeVariant=\"elevo\"\n onActionClick={(e) => {\n onProjectActionClick({ action: e.detail, project });\n }}\n onVisibleChange={(e) => {\n setActionsVisible(\n e.detail ? project.instanceId : null\n );\n }}\n />\n </WrappedLink>\n )}\n />\n </li>\n );\n })\n ) : (\n <li className=\"loading\">\n <WrappedIcon\n lib=\"antd\"\n theme=\"outlined\"\n icon=\"loading-3-quarters\"\n spinning\n />\n </li>\n )}\n </ul>\n </div>\n <div className={classNames(\"section\", { collapsed: historyCollapsed })}>\n <SectionTitle\n rootRef={rootRef}\n title={t(K.HISTORY)}\n onToggle={() => setHistoryCollapsed((prev) => !prev)}\n />\n <ul className=\"items\">\n {filteredHistoryList ? (\n filteredHistoryList.map((item) => {\n const url = historyUrlTemplate\n ? parseTemplate(historyUrlTemplate, item)\n : undefined;\n return (\n <li key={item.conversationId}>\n <NavLink\n url={url}\n render={({ active }) => (\n <WrappedLink\n className={classNames(\"item\", {\n \"actions-active\":\n item.conversationId === actionsVisible,\n active,\n })}\n onClick={onHistoryClick}\n {...(historyUrlTemplate\n ? { url: parseTemplate(historyUrlTemplate, item) }\n : null)}\n >\n <div className=\"item-title\" title={item.title}>\n {item.title || t(K.UNTITLED)}\n </div>\n <WrappedMiniActions\n className=\"actions\"\n actions={mergedHistoryActions}\n onActionClick={(e) => {\n onActionClick({ action: e.detail, item });\n }}\n onVisibleChange={(e) => {\n setActionsVisible(\n e.detail ? item.conversationId : null\n );\n }}\n />\n {!DONE_STATES.includes(item.state!) && (\n <div className=\"working\"></div>\n )}\n </WrappedLink>\n )}\n />\n </li>\n );\n })\n ) : (\n <li className=\"loading\">\n <WrappedIcon\n lib=\"antd\"\n theme=\"outlined\"\n icon=\"loading-3-quarters\"\n spinning\n />\n </li>\n )}\n {historyError ? (\n <li className=\"error\">Failed to load chat history</li>\n ) : null}\n </ul>\n {!historyCollapsed && nextToken && (\n <div className=\"load-more\" ref={nextRef}>\n <WrappedIcon lib=\"antd\" icon=\"loading-3-quarters\" spinning />\n </div>\n )}\n </div>\n </div>\n );\n}\n\ninterface SectionTitleProps {\n rootRef: MutableRefObject<HTMLDivElement | null>;\n title: string;\n onToggle: () => void;\n}\n\nfunction SectionTitle({\n rootRef,\n title,\n children,\n onToggle,\n}: PropsWithChildren<SectionTitleProps>) {\n const ref = useRef<HTMLDivElement | null>(null);\n const [stickyActive, setStickyActive] = useState(false);\n\n useEffect(() => {\n const parent = rootRef.current;\n const element = ref.current;\n const sibling = element?.nextElementSibling as HTMLElement | null;\n if (!parent || !element || !sibling) {\n return;\n }\n const onScroll = throttle(() => {\n const rect = element.getBoundingClientRect();\n const siblingRect = sibling.getBoundingClientRect();\n const diff = siblingRect.top - rect.top - rect.height;\n setStickyActive(diff < 1);\n }, 100);\n parent.addEventListener(\"scroll\", onScroll);\n return () => {\n parent.removeEventListener(\"scroll\", onScroll);\n };\n }, [rootRef]);\n\n return (\n <div\n className={classNames(\"section-title\", { sticky: stickyActive })}\n ref={ref}\n >\n <div className=\"section-label\" onClick={onToggle}>\n {title}\n <WrappedIcon lib=\"fa\" icon=\"angle-down\" />\n </div>\n {children}\n </div>\n );\n}\n","import React, { useEffect, useState } from \"react\";\nimport { getHistory, matchPath } from \"@next-core/runtime\";\nimport type { Location } from \"history\";\n\nexport interface NavLinkProps {\n url?: string;\n activeIncludes?: string[];\n render: (props: { active: boolean }) => React.ReactElement;\n}\n\nexport function NavLink({ url, activeIncludes, render }: NavLinkProps) {\n const [active, setActive] = useState(false);\n\n useEffect(() => {\n function checkLinkActive(loc: Location) {\n if (!url) {\n setActive(false);\n return;\n }\n for (const path of [url, ...(activeIncludes ?? [])]) {\n const matched = matchPath(loc.pathname, { path, exact: false });\n if (matched) {\n setActive(true);\n return;\n }\n }\n setActive(false);\n }\n const history = getHistory();\n checkLinkActive(history.location);\n return history.listen(checkLinkActive);\n }, [url, activeIncludes]);\n\n return render({ active });\n}\n"],"names":["K","en","NEW_CHAT","LOGOUT","TODAY","YESTERDAY","PREVIOUS_7_DAYS","PREVIOUS_30_DAYS","SWITCH_LANGUAGE","MY","PROJECTS","HISTORY","CREATE_PROJECT","MOVE_TO_PROJECT","UNTITLED","UNNAMED","zh","NS","locales","t","i18n","getFixedT","___CSS_LOADER_EXPORT___","push","module","id","toString","WrappedIcon","wrapBrick","WrappedLink","WrappedDropdownActions","onActionClick","onVisibleChange","WrappedEasyopsAvatar","WrappedMiniActions","WrappedIconButton","ElevoApi_listElevoConversations","async","params","options","http","get","data","ADD_ICON","lib","icon","ChatHistory","forwardRef","LowLevelChatHistory","_ref","ref","historyActions","historyUrlTemplate","projectUrlTemplate","projectActions","canAddProject","myLinks","onHistoryClick","onProjectActionClick","onAddProject","rootRef","useRef","myCollapsed","setMyCollapsed","useState","projects","setProjects","projectsCollapsed","setProjectsCollapsed","projectsError","setProjectsError","historyList","setHistoryList","historyCollapsed","setHistoryCollapsed","nextToken","setNextToken","loadNextToken","setLoadNextToken","historyError","setHistoryError","initialRef","movedConversations","setMovedConversations","mergedHistoryActions","useMemo","isDropdown","text","disabled","length","items","map","project","event","key","instanceId","name","useEffect","page","page_size","ElevoApi_getElevoProjects","list","error","console","Promise","all","token","limit","onlyOwner","onlyUnrelatedProject","interceptorParams","ignoreLoadingBar","current","resolve","setTimeout","then","_ref2","prev","conversations","catch","actionsVisible","setActionsVisible","nextRef","next","root","observer","IntersectionObserver","entries","entry","isIntersecting","observe","disconnect","pullIdRef","pull","useCallback","pullId","tempList","prevList","newList","newIds","Set","item","conversationId","newItemsMap","Map","foundIntersection","foundChanged","isFirst","newItem","isEqual","filter","has","useImperativeHandle","removeProject","projectId","p","addProject","moveConversation","filteredHistoryList","includes","React","className","classNames","collapsed","SectionTitle","title","onToggle","link","index","NavLink","url","activeIncludes","render","_ref3","active","variant","tooltip","tooltipHoist","onClick","parseTemplate","undefined","_ref4","_extends","actions","themeVariant","e","action","detail","theme","spinning","_ref5","DONE_STATES","state","_ref6","children","stickyActive","setStickyActive","parent","element","sibling","nextElementSibling","onScroll","throttle","rect","getBoundingClientRect","diff","top","height","addEventListener","removeEventListener","sticky","setActive","checkLinkActive","loc","path","matchPath","pathname","exact","history","getHistory","location","listen"],"sourceRoot":""}