@treasuredata/tdx 2026.3.10 → 2026.3.11

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 (201) hide show
  1. package/dist/bin.js +1 -1
  2. package/dist/build-info.json +3 -3
  3. package/dist/cli-categories.js +1 -1
  4. package/dist/cli.js +1 -1
  5. package/dist/commands/activations.js +1 -1
  6. package/dist/commands/agent-command.js +1 -1
  7. package/dist/commands/agent-test-command.js +1 -1
  8. package/dist/commands/api-command.js +1 -1
  9. package/dist/commands/auth-command.js +1 -1
  10. package/dist/commands/auth-login-command.js +1 -1
  11. package/dist/commands/chat-command.js +1 -1
  12. package/dist/commands/claude-command.js +1 -1
  13. package/dist/commands/claude-statusline-command.js +1 -1
  14. package/dist/commands/claude-usage-command.js +1 -1
  15. package/dist/commands/command.js +1 -1
  16. package/dist/commands/connection-command.js +1 -1
  17. package/dist/commands/databases.js +1 -1
  18. package/dist/commands/delivery-command.js +1 -1
  19. package/dist/commands/describe.js +1 -1
  20. package/dist/commands/engage-campaign-pull-command.js +1 -1
  21. package/dist/commands/engage-campaign-push-command.js +1 -1
  22. package/dist/commands/engage-campaign-validate-command.js +1 -1
  23. package/dist/commands/engage-command.js +1 -1
  24. package/dist/commands/engage-template-pull-command.js +1 -1
  25. package/dist/commands/engage-template-push-command.js +1 -1
  26. package/dist/commands/engage-template-validate-command.js +1 -1
  27. package/dist/commands/job-command.js +1 -1
  28. package/dist/commands/journey-command.js +1 -1
  29. package/dist/commands/journey-validate-command.js +1 -1
  30. package/dist/commands/llm-command.js +1 -1
  31. package/dist/commands/mcp-command.js +1 -1
  32. package/dist/commands/parent-segment-command.js +1 -1
  33. package/dist/commands/profile-command.js +1 -1
  34. package/dist/commands/profiles-command.js +1 -1
  35. package/dist/commands/query-command.js +1 -1
  36. package/dist/commands/schedule-command.js +1 -1
  37. package/dist/commands/segment-command.js +1 -1
  38. package/dist/commands/segment-create-command.js +1 -1
  39. package/dist/commands/segment-fields-command.js +1 -1
  40. package/dist/commands/segment-pull-command.js +1 -1
  41. package/dist/commands/segment-push-command.js +1 -1
  42. package/dist/commands/segment-update-command.js +1 -1
  43. package/dist/commands/segment-use-command.js +1 -1
  44. package/dist/commands/segment-validate-command.js +1 -1
  45. package/dist/commands/segments.js +1 -1
  46. package/dist/commands/show.js +1 -1
  47. package/dist/commands/status-command.js +1 -1
  48. package/dist/commands/tables.js +1 -1
  49. package/dist/commands/unset-command.js +1 -1
  50. package/dist/commands/upgrade-command.js +1 -1
  51. package/dist/commands/use-command.js +1 -1
  52. package/dist/commands/user-command.js +1 -1
  53. package/dist/commands/workflow-command.js +1 -1
  54. package/dist/core/auth.js +1 -1
  55. package/dist/core/command-output.js +1 -1
  56. package/dist/core/config.js +1 -1
  57. package/dist/core/connection-cache.js +1 -1
  58. package/dist/core/constants.js +1 -1
  59. package/dist/core/credential-cache.js +1 -1
  60. package/dist/core/global-context.js +1 -1
  61. package/dist/core/keychain.js +1 -1
  62. package/dist/core/oauth-keychain.js +1 -1
  63. package/dist/core/oauth.js +1 -1
  64. package/dist/core/profile.js +1 -1
  65. package/dist/core/project-config.js +1 -1
  66. package/dist/core/session.js +1 -1
  67. package/dist/core/user-cache.js +1 -1
  68. package/dist/core/version.js +1 -1
  69. package/dist/index.js +1 -1
  70. package/dist/mcp/server.js +1 -1
  71. package/dist/mcp/tools/index.js +1 -1
  72. package/dist/mcp/tools/tdx-run.js +1 -1
  73. package/dist/mcp/tools/tdx-search.js +1 -1
  74. package/dist/mcp/utils.js +1 -1
  75. package/dist/proxy/claude-usage-tracker.js +1 -1
  76. package/dist/proxy/passthrough-server.js +1 -1
  77. package/dist/proxy/sse-usage-parser.js +1 -1
  78. package/dist/sdk/agent/agent-config.js +1 -1
  79. package/dist/sdk/agent/agent-ref-parser.js +1 -1
  80. package/dist/sdk/agent/agent-yaml.js +1 -1
  81. package/dist/sdk/agent/test/evaluator.js +1 -1
  82. package/dist/sdk/agent/test/executor.js +1 -1
  83. package/dist/sdk/agent/test/index.js +1 -1
  84. package/dist/sdk/agent/test/output.js +1 -1
  85. package/dist/sdk/agent/test/parser.js +1 -1
  86. package/dist/sdk/agent/tool-target-registry.js +1 -1
  87. package/dist/sdk/api.js +1 -1
  88. package/dist/sdk/client/cdp-api-client.js +1 -1
  89. package/dist/sdk/client/delivery-api-client.js +1 -1
  90. package/dist/sdk/client/endpoints.js +1 -1
  91. package/dist/sdk/client/engage-api-client.js +1 -1
  92. package/dist/sdk/client/http-client.js +1 -1
  93. package/dist/sdk/client/llm-api-client.js +1 -1
  94. package/dist/sdk/client/oauth-refresh.js +1 -1
  95. package/dist/sdk/client/rate-limiter.js +1 -1
  96. package/dist/sdk/client/td-api-client.js +1 -1
  97. package/dist/sdk/client/trino-api-client.js +1 -1
  98. package/dist/sdk/client/workflow-client.js +1 -1
  99. package/dist/sdk/connection-validator.js +1 -1
  100. package/dist/sdk/connection.js +1 -1
  101. package/dist/sdk/delivery.js +1 -1
  102. package/dist/sdk/engage/campaign-pull.js +1 -1
  103. package/dist/sdk/engage/campaign-push.js +1 -1
  104. package/dist/sdk/engage/campaign-validator.js +1 -1
  105. package/dist/sdk/engage/campaign-yaml.js +1 -1
  106. package/dist/sdk/engage/template-pull.js +1 -1
  107. package/dist/sdk/engage/template-push.js +1 -1
  108. package/dist/sdk/engage/template-validator.js +1 -1
  109. package/dist/sdk/engage/template-yaml.js +1 -1
  110. package/dist/sdk/engage/types/campaign-def.js +1 -1
  111. package/dist/sdk/engage/types/campaign-schema.js +1 -1
  112. package/dist/sdk/engage/types/template-schema.js +1 -1
  113. package/dist/sdk/engage.js +1 -1
  114. package/dist/sdk/errors.js +1 -1
  115. package/dist/sdk/index.js +1 -1
  116. package/dist/sdk/io/index.js +1 -1
  117. package/dist/sdk/io/node-filesystem.js +1 -1
  118. package/dist/sdk/job.js +1 -1
  119. package/dist/sdk/journey.js +1 -1
  120. package/dist/sdk/llm/chat-cache.js +1 -1
  121. package/dist/sdk/llm/index.js +1 -1
  122. package/dist/sdk/llm/llm-backup-utils.js +1 -1
  123. package/dist/sdk/llm/model-factors.js +1 -1
  124. package/dist/sdk/personalization.js +1 -1
  125. package/dist/sdk/query/index.js +1 -1
  126. package/dist/sdk/query/sql-parser.js +1 -1
  127. package/dist/sdk/realtime.js +1 -1
  128. package/dist/sdk/schedule.js +1 -1
  129. package/dist/sdk/segment/child-segment-yaml.js +1 -1
  130. package/dist/sdk/segment/fields-display.js +1 -1
  131. package/dist/sdk/segment/file-discovery.js +1 -1
  132. package/dist/sdk/segment/journey-utils.js +1 -1
  133. package/dist/sdk/segment/journey-validator.js +1 -1
  134. package/dist/sdk/segment/journey-yaml.js +1 -1
  135. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  136. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  137. package/dist/sdk/segment/pull-workflow.js +1 -1
  138. package/dist/sdk/segment/push-recovery.js +1 -1
  139. package/dist/sdk/segment/push-workflow.js +1 -1
  140. package/dist/sdk/segment/resolution-context.js +1 -1
  141. package/dist/sdk/segment/segment-path-parser.js +1 -1
  142. package/dist/sdk/segment/segment-ref-parser.js +1 -1
  143. package/dist/sdk/segment/segment-validator.js +1 -1
  144. package/dist/sdk/segment/target-resolution.js +1 -1
  145. package/dist/sdk/segment/tdx-config.js +1 -1
  146. package/dist/sdk/segment/types/activation-schema.js +1 -1
  147. package/dist/sdk/segment/types/journey-def.js +1 -1
  148. package/dist/sdk/segment/types/journey-schema.js +1 -1
  149. package/dist/sdk/segment/types/segment-def.js +1 -1
  150. package/dist/sdk/segment/types/segment-schema.js +1 -1
  151. package/dist/sdk/segment/validate-files.js +1 -1
  152. package/dist/sdk/segment/yaml-validator.js +1 -1
  153. package/dist/sdk/segment.js +1 -1
  154. package/dist/sdk/types/index.js +1 -1
  155. package/dist/sdk/types/progress.js +1 -1
  156. package/dist/sdk/user.js +1 -1
  157. package/dist/sdk/util/format-detector.js +1 -1
  158. package/dist/sdk/util/formatters.js +1 -1
  159. package/dist/sdk/util/index.js +1 -1
  160. package/dist/sdk/util/paginate.js +1 -1
  161. package/dist/sdk/util/tree-formatter.js +1 -1
  162. package/dist/sdk/workflow/archive-validation.js +1 -1
  163. package/dist/sdk/workflow/clone-workflow.js +1 -1
  164. package/dist/sdk/workflow/index.js +1 -1
  165. package/dist/sdk/workflow/pull-workflow.js +1 -1
  166. package/dist/sdk/workflow/push-workflow.js +1 -1
  167. package/dist/sdk/workflow/tdx-config.js +1 -1
  168. package/dist/sdk/workflow/workflow-utils.js +1 -1
  169. package/dist/test-utils/command-runner.js +1 -1
  170. package/dist/test-utils/factories.js +1 -1
  171. package/dist/test-utils/fixtures.js +1 -1
  172. package/dist/test-utils/http-mock.js +1 -1
  173. package/dist/test-utils/index.js +1 -1
  174. package/dist/utils/async.js +1 -1
  175. package/dist/utils/colors.js +1 -1
  176. package/dist/utils/diff.js +1 -1
  177. package/dist/utils/file-permissions.js +1 -1
  178. package/dist/utils/file-reader.js +1 -1
  179. package/dist/utils/github-releases.js +1 -1
  180. package/dist/utils/global-cache.js +1 -1
  181. package/dist/utils/json-loader.js +1 -1
  182. package/dist/utils/local-cache.js +1 -1
  183. package/dist/utils/logger/formatters/default-formatter.js +1 -1
  184. package/dist/utils/logger/formatters/index.js +1 -1
  185. package/dist/utils/logger/handlers/console-handler.js +1 -1
  186. package/dist/utils/logger/handlers/file-handler.js +1 -1
  187. package/dist/utils/logger/handlers/index.js +1 -1
  188. package/dist/utils/logger/handlers/null-handler.js +1 -1
  189. package/dist/utils/logger/index.js +1 -1
  190. package/dist/utils/logger/logger.js +1 -1
  191. package/dist/utils/logger/types.js +1 -1
  192. package/dist/utils/option-validation.js +1 -1
  193. package/dist/utils/process.js +1 -1
  194. package/dist/utils/prompt.js +1 -1
  195. package/dist/utils/spinner.js +1 -1
  196. package/dist/utils/sse-parser.js +1 -1
  197. package/dist/utils/string-utils.js +1 -1
  198. package/dist/utils/table-ref-parser.js +1 -1
  199. package/dist/utils/tdx-logger.js +1 -1
  200. package/dist/utils/version-check.js +1 -1
  201. package/package.json +1 -1
@@ -1 +1 @@
1
- const a88_0x725378=a88_0x30ed;(function(_0x5cf86d,_0x422537){const _0x17ebe5=a88_0x30ed,_0x28e45c=_0x5cf86d();while(!![]){try{const _0x2e38a2=-parseInt(_0x17ebe5(0x123))/0x1+-parseInt(_0x17ebe5(0x122))/0x2*(parseInt(_0x17ebe5(0x15c))/0x3)+parseInt(_0x17ebe5(0x194))/0x4+parseInt(_0x17ebe5(0x18e))/0x5*(parseInt(_0x17ebe5(0x17f))/0x6)+-parseInt(_0x17ebe5(0x16d))/0x7*(parseInt(_0x17ebe5(0x171))/0x8)+-parseInt(_0x17ebe5(0x111))/0x9*(-parseInt(_0x17ebe5(0x13a))/0xa)+-parseInt(_0x17ebe5(0x19d))/0xb;if(_0x2e38a2===_0x422537)break;else _0x28e45c['push'](_0x28e45c['shift']());}catch(_0xe8b16b){_0x28e45c['push'](_0x28e45c['shift']());}}}(a88_0x292a,0x85365));function a88_0x30ed(_0xbf2420,_0x2e3be5){_0xbf2420=_0xbf2420-0x10a;const _0x292ab4=a88_0x292a();let _0x30ed14=_0x292ab4[_0xbf2420];return _0x30ed14;}import{HTTPClient}from'./http-client.js';import{getEndpoint}from'../types/index.js';import{getAuthHeaders,toHeaderRecord}from'../../core/auth.js';export class CDPApiClient{[a88_0x725378(0x167)];[a88_0x725378(0x16f)];constructor(_0xdb7483){const _0x49ca72=a88_0x725378,_0x1409a9=getEndpoint(_0xdb7483[_0x49ca72(0x141)],_0x49ca72(0x158));this[_0x49ca72(0x16f)]=toHeaderRecord(getAuthHeaders(_0xdb7483[_0x49ca72(0x141)],_0xdb7483[_0x49ca72(0x114)],_0xdb7483[_0x49ca72(0x18b)])),this[_0x49ca72(0x167)]=new HTTPClient(_0x1409a9,{...this[_0x49ca72(0x16f)],'Accept':'application/vnd.treasuredata.v1+json','Content-Type':_0x49ca72(0x139)},{'proxy':_0xdb7483[_0x49ca72(0x151)]});}async[a88_0x725378(0x140)](){const _0x3ff88b=a88_0x725378,_0x423e4b='/entities/parent_segments',_0x5b6eaf=await this[_0x3ff88b(0x167)][_0x3ff88b(0x11d)](_0x3ff88b(0x157),_0x423e4b);return Array['isArray'](_0x5b6eaf)?_0x5b6eaf:_0x5b6eaf['data'];}async[a88_0x725378(0x199)](_0x184e17){const _0x369cb0=a88_0x725378,_0x21e1bf=_0x369cb0(0x191)+_0x184e17,_0x3d9bfb=await this[_0x369cb0(0x167)][_0x369cb0(0x11d)](_0x369cb0(0x157),_0x21e1bf);return _0x369cb0(0x162)in _0x3d9bfb?_0x3d9bfb[_0x369cb0(0x162)]:_0x3d9bfb;}async[a88_0x725378(0x16b)](_0x212c82){const _0x33cc40=a88_0x725378,_0x272432=_0x33cc40(0x13d)+_0x212c82+'/segments',_0x65d10b=await this[_0x33cc40(0x167)][_0x33cc40(0x11d)]('GET',_0x272432);return Array[_0x33cc40(0x11b)](_0x65d10b)?_0x65d10b:_0x65d10b[_0x33cc40(0x162)];}async[a88_0x725378(0x130)](_0x2b0fa6,_0x34801d){const _0x1e8be7=a88_0x725378,_0x15f8b3=_0x1e8be7(0x13d)+_0x2b0fa6+_0x1e8be7(0x17a)+_0x34801d,_0x22b661=await this[_0x1e8be7(0x167)][_0x1e8be7(0x11d)](_0x1e8be7(0x157),_0x15f8b3);return _0x1e8be7(0x162)in _0x22b661?_0x22b661[_0x1e8be7(0x162)]:_0x22b661;}async[a88_0x725378(0x18d)](_0x35f80f){const _0x3b7617=a88_0x725378,_0x3b0e91='/entities/segments/'+_0x35f80f,_0x4327d2=await this['httpClient'][_0x3b7617(0x11d)]('GET',_0x3b0e91);if('data'in _0x4327d2){const _0x524949=_0x4327d2[_0x3b7617(0x162)];if(_0x3b7617(0x14a)in _0x524949&&_0x524949[_0x3b7617(0x14a)]&&typeof _0x524949[_0x3b7617(0x14a)]===_0x3b7617(0x192)){const _0x7d95d6=_0x524949[_0x3b7617(0x14a)];return{'id':_0x524949['id'],'name':_0x7d95d6[_0x3b7617(0x120)],..._0x7d95d6};}return _0x524949;}return _0x4327d2;}async[a88_0x725378(0x12d)](_0x408028){const _0x9a8387=a88_0x725378,_0x11e7de='/audiences/'+_0x408028+_0x9a8387(0x143),_0x7dc8de=await this[_0x9a8387(0x167)]['request'](_0x9a8387(0x157),_0x11e7de);return Array[_0x9a8387(0x11b)](_0x7dc8de)?_0x7dc8de:_0x7dc8de['data'];}async[a88_0x725378(0x137)](_0x2d3b2e){const _0x1be768=a88_0x725378,_0x5b66d1=_0x1be768(0x164)+_0x2d3b2e,_0x6b5d3b=await this[_0x1be768(0x167)][_0x1be768(0x11d)]('GET',_0x5b66d1);return'data'in _0x6b5d3b?_0x6b5d3b[_0x1be768(0x162)]:_0x6b5d3b;}async[a88_0x725378(0x156)](_0x1b3291,_0x1a4003=0x20,_0x33e5e1=![]){const _0x3d9f0a=a88_0x725378,_0x58d67c='/entities/by-folder/'+_0x1b3291+_0x3d9f0a(0x14b)+_0x1a4003+_0x3d9f0a(0x15e)+_0x33e5e1;return await this[_0x3d9f0a(0x167)][_0x3d9f0a(0x11d)]('GET',_0x58d67c);}async[a88_0x725378(0x112)](_0x1c176b,_0x14aba6){const _0x530838=a88_0x725378,_0x488084=_0x530838(0x13d)+_0x1c176b+'/segments/'+_0x14aba6+_0x530838(0x11f),_0x29eaa1=await this['httpClient']['request'](_0x530838(0x157),_0x488084);return Array[_0x530838(0x11b)](_0x29eaa1)?_0x29eaa1:_0x29eaa1[_0x530838(0x162)];}async[a88_0x725378(0x160)](_0x2536b8,_0x204e97,_0x4e6763){const _0x130a12=a88_0x725378,_0x553c99=_0x130a12(0x13d)+_0x2536b8+_0x130a12(0x17a)+_0x204e97+_0x130a12(0x15b)+_0x4e6763,_0x177072=await this[_0x130a12(0x167)]['request'](_0x130a12(0x157),_0x553c99);return _0x130a12(0x162)in _0x177072?_0x177072[_0x130a12(0x162)]:_0x177072;}async['createActivation'](_0x2c7c4f,_0x26288c,_0x398a8b){const _0x2a7b9b=a88_0x725378,_0x461245='/audiences/'+_0x2c7c4f+'/segments/'+_0x26288c+'/syndications',_0x2745a0=await this[_0x2a7b9b(0x167)][_0x2a7b9b(0x11d)]('POST',_0x461245,{'body':_0x398a8b});return _0x2745a0;}async[a88_0x725378(0x13c)](_0x1c26b4,_0x29087d,_0x2aa279,_0x2de3e7){const _0x2c7461=a88_0x725378,_0x793b23=_0x2c7461(0x13d)+_0x1c26b4+_0x2c7461(0x17a)+_0x29087d+_0x2c7461(0x15b)+_0x2aa279,_0x589f85=await this[_0x2c7461(0x167)]['request'](_0x2c7461(0x12f),_0x793b23,{'body':_0x2de3e7});return _0x589f85;}async[a88_0x725378(0x135)](_0x2195ca,_0x344dae,_0x35007c){const _0x152e8d=a88_0x725378,_0x52b6ef='/audiences/'+_0x2195ca+_0x152e8d(0x17a)+_0x344dae+_0x152e8d(0x15b)+_0x35007c;await this[_0x152e8d(0x167)][_0x152e8d(0x11d)](_0x152e8d(0x181),_0x52b6ef);}async[a88_0x725378(0x17d)](_0x1f1d40){const _0x27a83c=a88_0x725378;return this[_0x27a83c(0x173)](_0x1f1d40);}async[a88_0x725378(0x17c)](_0x48e0e8,_0x31d743){const _0x3b2aa8=a88_0x725378;return this[_0x3b2aa8(0x173)](_0x48e0e8,_0x31d743);}async['getSegmentSQL'](_0x5ccd55,_0x328d82){const _0x229b3e=a88_0x725378,_0x5c7dc1=await this[_0x229b3e(0x130)](_0x5ccd55,_0x328d82),_0x588bec='rule'in _0x5c7dc1&&_0x5c7dc1[_0x229b3e(0x10a)]?_0x5c7dc1['rule']:undefined;return this[_0x229b3e(0x173)](_0x5ccd55,_0x588bec);}async[a88_0x725378(0x173)](_0x897d61,_0x29bbe9){const _0x596367=a88_0x725378,_0x430343=_0x596367(0x13d)+_0x897d61+_0x596367(0x12a),_0x541b2e={'format':_0x596367(0x163)};_0x29bbe9&&(_0x541b2e[_0x596367(0x10a)]=_0x29bbe9);const _0x5617a7=await this[_0x596367(0x167)][_0x596367(0x11d)](_0x596367(0x174),_0x430343,{'body':_0x541b2e});return _0x5617a7[_0x596367(0x163)]||_0x5617a7[_0x596367(0x154)]||'';}async[a88_0x725378(0x175)](_0x4b35ea){const _0x32a5a9=a88_0x725378,_0x45d0df=_0x32a5a9(0x148),_0x5d5ddd=await this[_0x32a5a9(0x167)][_0x32a5a9(0x11d)](_0x32a5a9(0x174),_0x45d0df,{'body':_0x4b35ea,'headers':{'Content-Type':_0x32a5a9(0x10e)}});return _0x5d5ddd;}async[a88_0x725378(0x11e)](_0x5bf2e7,_0x352508){const _0x32e668=a88_0x725378,_0x2bc97e=_0x32e668(0x13d)+_0x5bf2e7,_0x17841f=await this[_0x32e668(0x167)][_0x32e668(0x11d)]('PUT',_0x2bc97e,{'body':_0x352508,'headers':{'Content-Type':_0x32e668(0x10e)}});return _0x17841f;}async[a88_0x725378(0x117)](_0x2200fd){const _0x2c2dfd=a88_0x725378,_0x2e7704='/audiences/'+_0x2200fd,_0x2cd786=await this['httpClient']['request']('GET',_0x2e7704,{'headers':{'Accept':_0x2c2dfd(0x10e)}});return _0x2cd786;}async[a88_0x725378(0x182)](_0x548e3c){const _0x31a67c=a88_0x725378,_0x153555='/audiences/'+_0x548e3c+_0x31a67c(0x178),_0x10b2f9=await this[_0x31a67c(0x167)][_0x31a67c(0x11d)]('GET',_0x153555);return _0x10b2f9;}async['getAudienceBehaviors'](_0x1a7b04,_0x33ee9d){const _0x4e75e8=a88_0x725378;let _0x18a29c=_0x4e75e8(0x13d)+_0x1a7b04+'/behaviors';_0x33ee9d!==undefined&&(_0x18a29c+='?realtime='+_0x33ee9d);const _0x45301e=await this[_0x4e75e8(0x167)][_0x4e75e8(0x11d)](_0x4e75e8(0x157),_0x18a29c);return _0x45301e;}async[a88_0x725378(0x198)](_0x7d99e2,_0x120391){const _0x43e8aa=a88_0x725378,_0x323548='/audiences/'+_0x7d99e2+_0x43e8aa(0x128),_0x30d17a=await this['httpClient']['request'](_0x43e8aa(0x174),_0x323548,{'body':_0x120391});return _0x30d17a;}async[a88_0x725378(0x144)](_0x31c037){const _0x4a9a9b=a88_0x725378,_0x10a26d=_0x4a9a9b(0x19e),_0x29ffd3={'type':_0x4a9a9b(0x185),'attributes':{'name':_0x31c037[_0x4a9a9b(0x120)],'description':_0x31c037[_0x4a9a9b(0x170)]||'','journeyId':_0x31c037[_0x4a9a9b(0x18f)],'rule':_0x31c037[_0x4a9a9b(0x10a)],'countPopulation':_0x31c037[_0x4a9a9b(0x115)]??!![]},'relationships':{'parentFolder':{'data':{'id':_0x31c037['parentFolderId'],'type':_0x4a9a9b(0x124)}}}},_0x2b018f=await this[_0x4a9a9b(0x167)][_0x4a9a9b(0x11d)](_0x4a9a9b(0x174),_0x10a26d,{'body':_0x29ffd3,'headers':{'Content-Type':_0x4a9a9b(0x10e)}});return _0x2b018f[_0x4a9a9b(0x162)]['id'];}async[a88_0x725378(0x138)](_0x307038,_0x30b3a1,_0x1c76f6){const _0x32cf32=a88_0x725378,_0x287ae0=_0x32cf32(0x13d)+_0x307038+_0x32cf32(0x17a)+_0x30b3a1,_0x525e0c=await this[_0x32cf32(0x167)]['request'](_0x32cf32(0x12f),_0x287ae0,{'body':_0x1c76f6});return _0x525e0c;}async[a88_0x725378(0x186)](_0x19dc23){const _0x16ee0e=a88_0x725378,_0x204be5='/entities/segments/'+_0x19dc23;await this[_0x16ee0e(0x167)][_0x16ee0e(0x11d)]('DELETE',_0x204be5);}async['createSegmentFolder'](_0x290e09,_0x1bf637){const _0x5f5306=a88_0x725378,_0x2befc7='/audiences/'+_0x290e09+_0x5f5306(0x143),_0xef316=await this[_0x5f5306(0x167)][_0x5f5306(0x11d)](_0x5f5306(0x174),_0x2befc7,{'body':_0x1bf637});if(_0x5f5306(0x162)in _0xef316&&_0xef316['data']){const _0x323d03=_0xef316[_0x5f5306(0x162)];return{'id':_0x323d03['id'],'name':_0x323d03[_0x5f5306(0x120)],'description':_0x323d03[_0x5f5306(0x170)],'audienceId':_0x323d03[_0x5f5306(0x197)]||String(_0x290e09),'parentFolderId':_0x323d03[_0x5f5306(0x190)],'createdAt':_0x323d03['createdAt'],'updatedAt':_0x323d03[_0x5f5306(0x16a)]};}return _0xef316;}async['runParentSegment'](_0x4be567){const _0x38d555=a88_0x725378,_0x8f1e36='/audiences/'+_0x4be567+_0x38d555(0x134),_0x31a3bd=await this[_0x38d555(0x167)][_0x38d555(0x11d)](_0x38d555(0x174),_0x8f1e36);return _0x31a3bd;}async['listJourneys'](_0x55fa76){const _0x430f2d=a88_0x725378,_0x4f2d45='/entities/journeys?folder_id='+_0x55fa76,_0x2f398b=await this[_0x430f2d(0x167)][_0x430f2d(0x11d)]('GET',_0x4f2d45);return _0x2f398b[_0x430f2d(0x162)][_0x430f2d(0x10c)](_0x1b9b63=>({'id':_0x1b9b63['id'],'name':_0x1b9b63[_0x430f2d(0x14a)][_0x430f2d(0x120)],'journeyBundleName':_0x1b9b63[_0x430f2d(0x14a)][_0x430f2d(0x11a)],'journeyBundleId':_0x1b9b63[_0x430f2d(0x14a)][_0x430f2d(0x184)],'versionNumber':_0x1b9b63[_0x430f2d(0x14a)][_0x430f2d(0x155)],'description':_0x1b9b63[_0x430f2d(0x14a)][_0x430f2d(0x170)],'state':_0x1b9b63['attributes'][_0x430f2d(0x18a)],'paused':_0x1b9b63[_0x430f2d(0x14a)][_0x430f2d(0x169)],'audienceId':_0x1b9b63[_0x430f2d(0x14a)]['audienceId'],'folderId':_0x1b9b63[_0x430f2d(0x172)]?.[_0x430f2d(0x14c)]?.[_0x430f2d(0x162)]?.['id'],'createdAt':_0x1b9b63[_0x430f2d(0x14a)][_0x430f2d(0x131)],'updatedAt':_0x1b9b63['attributes'][_0x430f2d(0x16a)]}));}async[a88_0x725378(0x193)](_0x281f6b){const _0x484240=a88_0x725378,_0x3c6b4e=_0x484240(0x159)+_0x281f6b,_0x3095f1=await this[_0x484240(0x167)][_0x484240(0x11d)](_0x484240(0x157),_0x3c6b4e),_0x40cb30=new Map();if(_0x3095f1[_0x484240(0x149)])for(const _0xab5928 of _0x3095f1[_0x484240(0x149)]){_0xab5928[_0x484240(0x187)]===_0x484240(0x183)&&_0x40cb30[_0x484240(0x161)](_0xab5928['id'],_0xab5928);}return{'journeys':_0x3095f1[_0x484240(0x162)],'activationStepsById':_0x40cb30};}async[a88_0x725378(0x121)](_0x4853db){const _0x4f4551=a88_0x725378,_0x43e01e=_0x4f4551(0x13e)+_0x4853db,_0x368afa=await this[_0x4f4551(0x167)][_0x4f4551(0x11d)](_0x4f4551(0x157),_0x43e01e);return _0x4f4551(0x162)in _0x368afa?_0x368afa[_0x4f4551(0x162)]:_0x368afa;}async['getJourneyBundle'](_0x47cc69){const _0x5b9c19=a88_0x725378,_0x1ea29c=_0x5b9c19(0x152)+_0x47cc69,_0x2c9596=await this[_0x5b9c19(0x167)][_0x5b9c19(0x11d)](_0x5b9c19(0x157),_0x1ea29c);return parseJourneyBundleResponse(_0x2c9596);}async['checkJourneyAppendable'](_0x5beccf){const _0x3839e0=a88_0x725378,_0x1ed6fc='/entities/journey_bundles/'+_0x5beccf+_0x3839e0(0x15a);await this[_0x3839e0(0x167)]['request'](_0x3839e0(0x157),_0x1ed6fc);}async[a88_0x725378(0x14f)](_0x4f77c0,_0x2f2a57){const _0x3e6be4=a88_0x725378,_0x42a566=_0x3e6be4(0x152)+_0x4f77c0+_0x3e6be4(0x19a),_0x3d530a=await this[_0x3e6be4(0x167)]['request']('POST',_0x42a566,{'body':_0x2f2a57});return _0x3e6be4(0x162)in _0x3d530a?_0x3d530a[_0x3e6be4(0x162)]:_0x3d530a;}async['createJourney'](_0x3bae10){const _0x281c8c=a88_0x725378,_0x57b271='/entities/journeys',_0x14aa52=await this[_0x281c8c(0x167)][_0x281c8c(0x11d)](_0x281c8c(0x174),_0x57b271,{'body':_0x3bae10,'headers':{'Content-Type':_0x281c8c(0x10e)}});return _0x281c8c(0x162)in _0x14aa52?_0x14aa52[_0x281c8c(0x162)]:_0x14aa52;}async['updateJourney'](_0x307b7d,_0x12a590){const _0x4d9a93=a88_0x725378,_0x32983d=_0x4d9a93(0x13e)+_0x307b7d,_0x2a33e7=await this[_0x4d9a93(0x167)][_0x4d9a93(0x11d)](_0x4d9a93(0x11c),_0x32983d,{'body':_0x12a590,'headers':{'Content-Type':_0x4d9a93(0x10e)}});return'data'in _0x2a33e7?_0x2a33e7['data']:_0x2a33e7;}async[a88_0x725378(0x188)](_0x3b01ee,_0xd16932){const _0x3494d5=a88_0x725378,_0x5991a=_0x3494d5(0x13e)+_0x3b01ee+_0x3494d5(0x10d),_0x40ec77=await this[_0x3494d5(0x167)][_0x3494d5(0x11d)](_0x3494d5(0x174),_0x5991a,{'body':_0xd16932,'headers':{'Content-Type':_0x3494d5(0x10e)}});return'data'in _0x40ec77?_0x40ec77[_0x3494d5(0x162)]:_0x40ec77;}async[a88_0x725378(0x10b)](_0x44a371,_0x1d9a06){const _0x265f5d=a88_0x725378,_0x399229=buildJourneyEndpoint(_0x44a371,_0x265f5d(0x12c),_0x1d9a06),_0x2a3eb7=await this[_0x265f5d(0x167)][_0x265f5d(0x11d)](_0x265f5d(0x157),_0x399229);return parseJourneyStatisticsResponse(_0x2a3eb7);}async[a88_0x725378(0x165)](_0xc33c8f,_0x3f07b9){const _0x4c5ff4=a88_0x725378,_0x2177d7=buildJourneyEndpoint(_0xc33c8f,_0x4c5ff4(0x16e),_0x3f07b9),_0x4ca176=await this['httpClient'][_0x4c5ff4(0x11d)]('GET',_0x2177d7);return parseConversionSankeyResponse(_0x4ca176);}async[a88_0x725378(0x13b)](_0x2f4101,_0x51330c){const _0x57ade8=a88_0x725378,_0x45c42c=buildJourneyEndpoint(_0x2f4101,_0x57ade8(0x12b),_0x51330c),_0x263ce6=await this[_0x57ade8(0x167)]['request'](_0x57ade8(0x157),_0x45c42c);return parseActivationSankeyResponse(_0x263ce6);}async[a88_0x725378(0x125)](_0x23f02a){const _0x1fdc9b=a88_0x725378,_0xa4d072=_0x1fdc9b(0x13e)+_0x23f02a+_0x1fdc9b(0x12e),_0x5888d0=await this['httpClient']['request'](_0x1fdc9b(0x11c),_0xa4d072);return _0x1fdc9b(0x162)in _0x5888d0?_0x5888d0[_0x1fdc9b(0x162)]:_0x5888d0;}async[a88_0x725378(0x129)](_0x129f1f){const _0x58261d=a88_0x725378,_0xa8aa72='/entities/journeys/'+_0x129f1f+_0x58261d(0x153),_0x527942=await this[_0x58261d(0x167)][_0x58261d(0x11d)](_0x58261d(0x11c),_0xa8aa72);return _0x58261d(0x162)in _0x527942?_0x527942['data']:_0x527942;}async[a88_0x725378(0x15d)](_0x115c42,_0x532f3e){const _0x347de2=a88_0x725378,_0x1b7ccb=_0x347de2(0x13e)+_0x115c42+'/activations/'+_0x532f3e,_0x193647=await this['httpClient'][_0x347de2(0x11d)](_0x347de2(0x157),_0x1b7ccb);return'data'in _0x193647?_0x193647[_0x347de2(0x162)]:_0x193647;}async[a88_0x725378(0x142)](_0x1bf3ab){const _0x225730=a88_0x725378,_0x1440f2='/entities/journeys/'+_0x1bf3ab+'/activations',_0x3e479e=await this[_0x225730(0x167)][_0x225730(0x11d)](_0x225730(0x157),_0x1440f2);return'data'in _0x3e479e?_0x3e479e[_0x225730(0x162)]:_0x3e479e;}async[a88_0x725378(0x18c)](_0x14a2f3,_0x1b9305){const _0x1f1bf5=a88_0x725378,_0x4de329=_0x1f1bf5(0x13e)+_0x14a2f3+'/activations',_0x362974={'name':_0x1b9305[_0x1f1bf5(0x120)],'scheduleType':_0x1b9305[_0x1f1bf5(0x19b)]||'none','connectionId':String(_0x1b9305['connectionId']),'columns':_0x1b9305[_0x1f1bf5(0x118)]??[],'notifyOn':_0x1b9305[_0x1f1bf5(0x146)]??[],..._0x1b9305[_0x1f1bf5(0x170)]!==undefined&&{'description':_0x1b9305[_0x1f1bf5(0x170)]},..._0x1b9305[_0x1f1bf5(0x168)]!==undefined&&{'allColumns':_0x1b9305[_0x1f1bf5(0x168)]},..._0x1b9305[_0x1f1bf5(0x132)]!==undefined&&{'timezone':_0x1b9305[_0x1f1bf5(0x132)]},..._0x1b9305[_0x1f1bf5(0x17b)]!==undefined&&{'connectorConfig':_0x1b9305[_0x1f1bf5(0x17b)]},..._0x1b9305[_0x1f1bf5(0x14d)]!==undefined&&{'emailRecipients':_0x1b9305['emailRecipients']},..._0x1b9305['activationTemplateId']!==undefined&&{'activationTemplateId':_0x1b9305[_0x1f1bf5(0x13f)]},..._0x1b9305[_0x1f1bf5(0x116)]!==undefined&&{'syndicationBehavior':_0x1b9305[_0x1f1bf5(0x116)]}},_0x45de8a=await this['httpClient']['request'](_0x1f1bf5(0x174),_0x4de329,{'body':{'type':'journeyActivationStep','attributes':{'runAfterJourneyRefresh':_0x1b9305['runAfterJourneyRefresh']??![],'activationParams':_0x362974}},'headers':{'Content-Type':'application/vnd.treasuredata.v1+json'}});return _0x1f1bf5(0x162)in _0x45de8a?_0x45de8a[_0x1f1bf5(0x162)]:_0x45de8a;}}export function buildJourneyEndpoint(_0x12e435,_0x349021,_0x4ce1e9){const _0x1823ff=a88_0x725378,_0x10d90f='/entities/journeys/'+_0x12e435+'/'+_0x349021,_0x58054b=new URLSearchParams();if(_0x4ce1e9?.['from'])_0x58054b[_0x1823ff(0x161)](_0x1823ff(0x189),_0x4ce1e9[_0x1823ff(0x189)]);if(_0x4ce1e9?.['to'])_0x58054b[_0x1823ff(0x161)]('to',_0x4ce1e9['to']);if(_0x4ce1e9?.[_0x1823ff(0x19c)]!=null)_0x58054b['set'](_0x1823ff(0x19c),String(_0x4ce1e9[_0x1823ff(0x19c)]));const _0x168d96=_0x58054b[_0x1823ff(0x110)]();return _0x168d96?_0x10d90f+'?'+_0x168d96:_0x10d90f;}export function parseJourneyStatisticsResponse(_0x385409){const _0x2d64b6=a88_0x725378;if(!(_0x2d64b6(0x162)in _0x385409))return _0x385409;const _0x382b68=_0x385409['data'];if(!(_0x2d64b6(0x14a)in _0x382b68)||!_0x382b68['attributes']||typeof _0x382b68[_0x2d64b6(0x14a)]!==_0x2d64b6(0x192))return _0x382b68;const _0x392042=_0x382b68[_0x2d64b6(0x14a)],_0x217e79={'journeyId':_0x392042['journeyId'],'size':_0x392042[_0x2d64b6(0x179)],'goalSize':_0x392042[_0x2d64b6(0x150)],'enteredSize':_0x392042[_0x2d64b6(0x119)],'completionRate':_0x392042[_0x2d64b6(0x126)],'exitOrJumpSize':_0x392042[_0x2d64b6(0x17e)],'exitOrJumpRate':_0x392042['exitOrJumpRate'],'stages':(_0x392042[_0x2d64b6(0x15f)]??[])['map'](_0x4883b6=>{const _0x3eede4=_0x2d64b6,_0x425b44={'id':_0x4883b6['id'],'enteredSize':_0x4883b6[_0x3eede4(0x119)],'milestoneSize':_0x4883b6[_0x3eede4(0x113)],'completeMilestoneRate':_0x4883b6['completeMilestoneRate'],'exitOrJumpSize':_0x4883b6['exitOrJumpSize'],'exitOrJumpRate':_0x4883b6[_0x3eede4(0x10f)],'size':_0x4883b6[_0x3eede4(0x179)]};if(_0x4883b6[_0x3eede4(0x195)])_0x425b44['history']=_0x4883b6[_0x3eede4(0x195)];if(_0x4883b6['stepSizes'])_0x425b44['stepSizes']=_0x4883b6[_0x3eede4(0x166)];if(_0x4883b6[_0x3eede4(0x133)])_0x425b44[_0x3eede4(0x133)]=_0x4883b6['stepInfluxes'];if(_0x4883b6[_0x3eede4(0x147)])_0x425b44[_0x3eede4(0x147)]=_0x4883b6['exitSizes'];return _0x425b44;})};return Array[_0x2d64b6(0x11b)](_0x392042[_0x2d64b6(0x195)])&&(_0x217e79[_0x2d64b6(0x195)]=_0x392042[_0x2d64b6(0x195)]),_0x217e79;}function extractSankeyChart(_0x499435){const _0x404a06=a88_0x725378,_0x21ef8b=Array['isArray'](_0x499435[_0x404a06(0x162)])?_0x499435['data']:[],_0x3687e4=_0x499435[_0x404a06(0x176)]&&typeof _0x499435[_0x404a06(0x176)]==='object'?_0x499435[_0x404a06(0x176)]:{},_0x560316=Array[_0x404a06(0x11b)](_0x3687e4[_0x404a06(0x196)])?_0x3687e4[_0x404a06(0x196)]:[];return{'nodes':_0x21ef8b,'links':_0x560316};}function extractJsonApiAttributes(_0x5050fc){const _0x27f52a=a88_0x725378;if(!_0x5050fc||typeof _0x5050fc!==_0x27f52a(0x192))return[];const _0xb14ce5=_0x5050fc;if(!Array['isArray'](_0xb14ce5[_0x27f52a(0x162)]))return[];return _0xb14ce5[_0x27f52a(0x162)][_0x27f52a(0x127)](_0x36d675=>!!_0x36d675&&typeof _0x36d675===_0x27f52a(0x192))[_0x27f52a(0x10c)](_0x2f6586=>_0x2f6586[_0x27f52a(0x14a)])[_0x27f52a(0x127)](_0x5f4046=>!!_0x5f4046&&typeof _0x5f4046==='object');}export function parseConversionSankeyResponse(_0x5a48bc){const _0x283812=a88_0x725378,_0xb5ed16={'nodes':[],'links':[]},_0x526dbf=extractJsonApiAttributes(_0x5a48bc);if(_0x526dbf['length']===0x0)return _0xb5ed16;const _0x37b9ab=_0x526dbf[0x0],_0x176c5f=_0x37b9ab[_0x283812(0x145)];if(_0x176c5f&&typeof _0x176c5f==='object'){const {nodes:_0x3f9756,links:_0x7bdb7c}=extractSankeyChart(_0x176c5f);return{'nodes':_0x3f9756,'links':_0x7bdb7c,...typeof _0x37b9ab[_0x283812(0x16a)]===_0x283812(0x16c)?{'updatedAt':_0x37b9ab[_0x283812(0x16a)]}:{}};}return _0xb5ed16;}export function parseActivationSankeyResponse(_0x469b4f){const _0x3c82c8=a88_0x725378,_0x1bddfe=extractJsonApiAttributes(_0x469b4f);if(_0x1bddfe[_0x3c82c8(0x177)]>0x0)return _0x1bddfe[_0x3c82c8(0x10c)](_0x57d66d=>{const _0x19a09b=_0x3c82c8,_0x4ba9c0=_0x57d66d['chart'],{nodes:_0x58e924,links:_0x3ad5c9}=_0x4ba9c0&&typeof _0x4ba9c0===_0x19a09b(0x192)?extractSankeyChart(_0x4ba9c0):{'nodes':[],'links':[]};return{'journeyStageId':typeof _0x57d66d[_0x19a09b(0x136)]===_0x19a09b(0x16c)?_0x57d66d[_0x19a09b(0x136)]:'','nodes':_0x58e924,'links':_0x3ad5c9,...typeof _0x57d66d[_0x19a09b(0x16a)]===_0x19a09b(0x16c)?{'updatedAt':_0x57d66d[_0x19a09b(0x16a)]}:{}};});if(Array[_0x3c82c8(0x11b)](_0x469b4f))return _0x469b4f;return[];}export function parseJourneyBundleResponse(_0x2ac1b8){const _0x4842a4=a88_0x725378;if(!_0x2ac1b8||typeof _0x2ac1b8!==_0x4842a4(0x192))throw new Error(_0x4842a4(0x14e));const _0x17a4b2=_0x2ac1b8,_0x3229e4=_0x17a4b2[_0x4842a4(0x162)],_0x503e22=_0x3229e4?.['attributes']??_0x17a4b2,_0x73afbe=Array['isArray'](_0x503e22[_0x4842a4(0x180)])?_0x503e22[_0x4842a4(0x180)]:[],_0x2bf0fd=_0x73afbe[_0x4842a4(0x10c)](_0x79ec3a=>{const _0x39a6ec=_0x4842a4;if(!_0x79ec3a||typeof _0x79ec3a!==_0x39a6ec(0x192))return _0x79ec3a;const _0x1f1323=_0x79ec3a;if(_0x1f1323[_0x39a6ec(0x162)]&&typeof _0x1f1323['data']===_0x39a6ec(0x192))return _0x1f1323[_0x39a6ec(0x162)];return _0x1f1323;});return{'name':_0x503e22['name'],'description':_0x503e22[_0x4842a4(0x170)]??null,'latestJourneyId':_0x503e22['latestJourneyId'],'lastVersionNumber':_0x503e22['lastVersionNumber'],'journeys':_0x2bf0fd};}function a88_0x292a(){const _0x2f3cbd=['1251hKKPqr','listActivations','milestoneSize','apiKey','countPopulation','syndicationBehavior','getParentSegmentFull','columns','enteredSize','journeyBundleName','isArray','PATCH','request','updateParentSegment','/syndications','name','getJourney','4rXddaO','443270UdvWhU','folder-segment','pauseJourney','completionRate','filter','/segments','resumeJourney','/segments/query','activation_sankey_charts','statistics','listSegmentFolders','/pause','PUT','getSegment','createdAt','timezone','stepInfluxes','/run','deleteActivation','journeyStageId','getSegmentFolder','updateSegment','application/json','53990IeocFl','getActivationSankeyChart','updateActivation','/audiences/','/entities/journeys/','activationTemplateId','listParentSegments','site','listJourneyActivations','/folders','createJourneySegment','chart','notifyOn','exitSizes','/audiences','included','attributes','?depth=','parentFolder','emailRecipients','Invalid\x20journey\x20bundle\x20response','createJourneyVersion','goalSize','proxy','/entities/journey_bundles/','/resume','query','versionNumber','listEntitiesByFolder','GET','cdp','/entities/journeys?folder_id=','/journeys_appendable','/syndications/','1273752zCwohj','getJourneyActivation','&with_rule=','journeyStageStatistics','getActivation','set','data','sql','/entities/folders/','getConversionSankeyChart','stepSizes','httpClient','allColumns','paused','updatedAt','listSegments','string','945iWOrWe','conversion_sankey_charts','authHeaders','description','3320yKucGJ','relationships','requestSegmentSQL','POST','createParentSegment','metaData','length','/attributes','size','/segments/','connectorConfig','getSegmentSQLFromRule','getParentSegmentSQL','exitOrJumpSize','6ZBwmrO','journeys','DELETE','getAudienceAttributes','journeyActivationStep','journeyBundleId','segment-journey','deleteSegment','type','updateJourneyDetail','from','state','accessToken','createJourneyActivation','getSegmentEntity','3117655lYTVns','journeyId','parentFolderId','/entities/parent_segments/','object','listJourneysWithDetails','2592240dHQmfd','history','links','audienceId','createSegment','getParentSegment','/journeys','scheduleType','limit','1407472tBrYAr','/entities/segments','rule','getJourneyStatistics','map','/detail','application/vnd.treasuredata.v1+json','exitOrJumpRate','toString'];a88_0x292a=function(){return _0x2f3cbd;};return a88_0x292a();}
1
+ const a88_0x438f7c=a88_0x4e44;(function(_0x3dc201,_0x40dd61){const _0x31533d=a88_0x4e44,_0x817fc7=_0x3dc201();while(!![]){try{const _0x327bd7=parseInt(_0x31533d(0x1b4))/0x1+-parseInt(_0x31533d(0x183))/0x2*(-parseInt(_0x31533d(0x180))/0x3)+parseInt(_0x31533d(0x178))/0x4+parseInt(_0x31533d(0x1a8))/0x5+-parseInt(_0x31533d(0x1a3))/0x6+parseInt(_0x31533d(0x16e))/0x7+parseInt(_0x31533d(0x18e))/0x8*(-parseInt(_0x31533d(0x1b3))/0x9);if(_0x327bd7===_0x40dd61)break;else _0x817fc7['push'](_0x817fc7['shift']());}catch(_0x4b51f7){_0x817fc7['push'](_0x817fc7['shift']());}}}(a88_0x659e,0x832a3));function a88_0x659e(){const _0x1317b6=['/entities/journeys/','runAfterJourneyRefresh','journeyActivationStep','/pause','getActivation','/entities/journey_bundles/','cdp','type','deleteActivation','enteredSize','createJourneySegment','allColumns','listJourneyActivations','isArray','included','milestoneSize','updateJourneyDetail','/detail','/audiences','completionRate','/audiences/','/journeys','journeyId','/run','updateSegment','object','links','activationTemplateId','GET','none','emailRecipients','conversion_sankey_charts','&with_rule=','getJourney','POST','listSegmentFolders','listEntitiesByFolder','/entities/segments/','authHeaders','map','getConversionSankeyChart','limit','/entities/parent_segments/','stepSizes','requestSegmentSQL','resumeJourney','createParentSegment','journeyStageId','runParentSegment','from','PATCH','activation_sankey_charts','application/vnd.treasuredata.v1+json','relationships','/folders','/syndications/','connectionId','4294899uTTkza','columns','/behaviors','statistics','getJourneyBundle','?realtime=','/syndications','attributes','/segments','createdAt','3345220jfakVY','updatedAt','listActivations','updateJourney','/entities/segments','getAudienceAttributes','history','PUT','35454LJuFVz','/activations','getActivationSankeyChart','2IuCOEa','metaData','data','/segments/','goalSize','stepInfluxes','?depth=','getJourneyActivation','/entities/parent_segments','size','getParentSegmentFull','4499296JjVgMs','journeyBundleId','getAudienceBehaviors','paused','connectorConfig','exitOrJumpRate','/segments/query','createActivation','exitOrJumpSize','/activations/','parentFolderId','getParentSegmentSQL','audienceId','updateParentSegment','createSegmentFolder','toString','/attributes','description','folder-segment','countPopulation','createJourneyActivation','251490FHaiEi','syndicationBehavior','timezone','set','chart','821065cAFTvc','journeyStageStatistics','exitSizes','accessToken','getSegmentSQL','DELETE','query','/entities/journeys','/journeys_appendable','latestJourneyId','journeyBundleName','18QYzRFi','78097hXkFWV','getJourneyStatistics','httpClient','request','filter','/entities/journeys?folder_id=','name','string','pauseJourney','sql','rule'];a88_0x659e=function(){return _0x1317b6;};return a88_0x659e();}import{HTTPClient}from'./http-client.js';import{getEndpoint}from'../types/index.js';import{getAuthHeaders,toHeaderRecord}from'../../core/auth.js';export class CDPApiClient{['httpClient'];[a88_0x438f7c(0x15b)];constructor(_0x50832b){const _0x26f811=a88_0x438f7c,_0x369cb9=getEndpoint(_0x50832b['site'],_0x26f811(0x1c5));this[_0x26f811(0x15b)]=toHeaderRecord(getAuthHeaders(_0x50832b['site'],_0x50832b['apiKey'],_0x50832b[_0x26f811(0x1ab)])),this[_0x26f811(0x1b6)]=new HTTPClient(_0x369cb9,{...this['authHeaders'],'Accept':_0x26f811(0x169),'Content-Type':'application/json'},{'proxy':_0x50832b['proxy']});}async['listParentSegments'](){const _0x26780a=a88_0x438f7c,_0x425efb=_0x26780a(0x18b),_0x212823=await this[_0x26780a(0x1b6)][_0x26780a(0x1b7)](_0x26780a(0x151),_0x425efb);return Array[_0x26780a(0x1cc)](_0x212823)?_0x212823:_0x212823['data'];}async['getParentSegment'](_0x496c8c){const _0x325df4=a88_0x438f7c,_0x204d77=_0x325df4(0x15f)+_0x496c8c,_0x3e3477=await this[_0x325df4(0x1b6)][_0x325df4(0x1b7)](_0x325df4(0x151),_0x204d77);return'data'in _0x3e3477?_0x3e3477['data']:_0x3e3477;}async['listSegments'](_0x4f83ca){const _0xed6c18=a88_0x438f7c,_0x4042f7=_0xed6c18(0x149)+_0x4f83ca+'/segments',_0x1ecc76=await this[_0xed6c18(0x1b6)]['request'](_0xed6c18(0x151),_0x4042f7);return Array[_0xed6c18(0x1cc)](_0x1ecc76)?_0x1ecc76:_0x1ecc76[_0xed6c18(0x185)];}async['getSegment'](_0x3f7110,_0xcc745d){const _0x242b38=a88_0x438f7c,_0x50dc19=_0x242b38(0x149)+_0x3f7110+_0x242b38(0x186)+_0xcc745d,_0x288b06=await this[_0x242b38(0x1b6)][_0x242b38(0x1b7)](_0x242b38(0x151),_0x50dc19);return _0x242b38(0x185)in _0x288b06?_0x288b06[_0x242b38(0x185)]:_0x288b06;}async['getSegmentEntity'](_0x27949c){const _0x56f18a=a88_0x438f7c,_0x4c5b28='/entities/segments/'+_0x27949c,_0x21b7d7=await this[_0x56f18a(0x1b6)][_0x56f18a(0x1b7)]('GET',_0x4c5b28);if(_0x56f18a(0x185)in _0x21b7d7){const _0x126338=_0x21b7d7[_0x56f18a(0x185)];if(_0x56f18a(0x175)in _0x126338&&_0x126338[_0x56f18a(0x175)]&&typeof _0x126338[_0x56f18a(0x175)]===_0x56f18a(0x14e)){const _0x259c72=_0x126338[_0x56f18a(0x175)];return{'id':_0x126338['id'],'name':_0x259c72['name'],..._0x259c72};}return _0x126338;}return _0x21b7d7;}async[a88_0x438f7c(0x158)](_0x5f4fbe){const _0x330e0e=a88_0x438f7c,_0x58d284=_0x330e0e(0x149)+_0x5f4fbe+'/folders',_0x181f25=await this['httpClient']['request']('GET',_0x58d284);return Array[_0x330e0e(0x1cc)](_0x181f25)?_0x181f25:_0x181f25[_0x330e0e(0x185)];}async['getSegmentFolder'](_0x5ade6b){const _0x9395b8=a88_0x438f7c,_0x1571ea='/entities/folders/'+_0x5ade6b,_0x3ba72a=await this[_0x9395b8(0x1b6)][_0x9395b8(0x1b7)](_0x9395b8(0x151),_0x1571ea);return _0x9395b8(0x185)in _0x3ba72a?_0x3ba72a[_0x9395b8(0x185)]:_0x3ba72a;}async[a88_0x438f7c(0x159)](_0x253ea4,_0x45cc78=0x20,_0x4feb54=![]){const _0x2c9ab9=a88_0x438f7c,_0x499805='/entities/by-folder/'+_0x253ea4+_0x2c9ab9(0x189)+_0x45cc78+_0x2c9ab9(0x155)+_0x4feb54;return await this[_0x2c9ab9(0x1b6)]['request'](_0x2c9ab9(0x151),_0x499805);}async[a88_0x438f7c(0x17a)](_0x4adcf4,_0x33ec7e){const _0x3435be=a88_0x438f7c,_0x576473=_0x3435be(0x149)+_0x4adcf4+'/segments/'+_0x33ec7e+'/syndications',_0x39a45b=await this[_0x3435be(0x1b6)][_0x3435be(0x1b7)](_0x3435be(0x151),_0x576473);return Array[_0x3435be(0x1cc)](_0x39a45b)?_0x39a45b:_0x39a45b[_0x3435be(0x185)];}async[a88_0x438f7c(0x1c3)](_0x439a6f,_0x5397c3,_0xe98722){const _0x2be23e=a88_0x438f7c,_0x4a4be7=_0x2be23e(0x149)+_0x439a6f+_0x2be23e(0x186)+_0x5397c3+_0x2be23e(0x16c)+_0xe98722,_0xf8e4e1=await this['httpClient']['request'](_0x2be23e(0x151),_0x4a4be7);return _0x2be23e(0x185)in _0xf8e4e1?_0xf8e4e1[_0x2be23e(0x185)]:_0xf8e4e1;}async[a88_0x438f7c(0x195)](_0x216d98,_0x4b5597,_0x1f408f){const _0x4acb77=a88_0x438f7c,_0x412e8a='/audiences/'+_0x216d98+_0x4acb77(0x186)+_0x4b5597+_0x4acb77(0x174),_0xa03182=await this[_0x4acb77(0x1b6)][_0x4acb77(0x1b7)]('POST',_0x412e8a,{'body':_0x1f408f});return _0xa03182;}async['updateActivation'](_0x2a38fa,_0x590131,_0x1e95f9,_0x43d0e8){const _0x34da17=a88_0x438f7c,_0x2a8cfc='/audiences/'+_0x2a38fa+_0x34da17(0x186)+_0x590131+'/syndications/'+_0x1e95f9,_0x2a2c37=await this[_0x34da17(0x1b6)][_0x34da17(0x1b7)](_0x34da17(0x17f),_0x2a8cfc,{'body':_0x43d0e8});return _0x2a2c37;}async[a88_0x438f7c(0x1c7)](_0x401dba,_0x4ce57f,_0x164522){const _0x2289c6=a88_0x438f7c,_0x38a506='/audiences/'+_0x401dba+_0x2289c6(0x186)+_0x4ce57f+_0x2289c6(0x16c)+_0x164522;await this['httpClient'][_0x2289c6(0x1b7)](_0x2289c6(0x1ad),_0x38a506);}async[a88_0x438f7c(0x199)](_0x4cb2e4){const _0x296bf7=a88_0x438f7c;return this[_0x296bf7(0x161)](_0x4cb2e4);}async['getSegmentSQLFromRule'](_0x2bb3a4,_0x3d87bd){const _0x25870c=a88_0x438f7c;return this[_0x25870c(0x161)](_0x2bb3a4,_0x3d87bd);}async[a88_0x438f7c(0x1ac)](_0x24ee16,_0x598b79){const _0x1fe6ca=a88_0x438f7c,_0x1b3559=await this['getSegment'](_0x24ee16,_0x598b79),_0x5a28b4=_0x1fe6ca(0x1be)in _0x1b3559&&_0x1b3559['rule']?_0x1b3559[_0x1fe6ca(0x1be)]:undefined;return this[_0x1fe6ca(0x161)](_0x24ee16,_0x5a28b4);}async['requestSegmentSQL'](_0x6a7869,_0x120d32){const _0x4706=a88_0x438f7c,_0x57fc36='/audiences/'+_0x6a7869+_0x4706(0x194),_0x10b7b0={'format':_0x4706(0x1bd)};_0x120d32&&(_0x10b7b0[_0x4706(0x1be)]=_0x120d32);const _0x197082=await this[_0x4706(0x1b6)]['request']('POST',_0x57fc36,{'body':_0x10b7b0});return _0x197082[_0x4706(0x1bd)]||_0x197082[_0x4706(0x1ae)]||'';}async[a88_0x438f7c(0x163)](_0x317fdd){const _0x448bf2=a88_0x438f7c,_0x3edad3=_0x448bf2(0x147),_0x4f610a=await this['httpClient'][_0x448bf2(0x1b7)]('POST',_0x3edad3,{'body':_0x317fdd,'headers':{'Content-Type':_0x448bf2(0x169)}});return _0x4f610a;}async[a88_0x438f7c(0x19b)](_0x5e0f63,_0x3179ac){const _0x9066c2=a88_0x438f7c,_0x50d2f3=_0x9066c2(0x149)+_0x5e0f63,_0x15ac03=await this['httpClient'][_0x9066c2(0x1b7)]('PUT',_0x50d2f3,{'body':_0x3179ac,'headers':{'Content-Type':_0x9066c2(0x169)}});return _0x15ac03;}async[a88_0x438f7c(0x18d)](_0x5c0a07){const _0xf38445=a88_0x438f7c,_0x3376a0=_0xf38445(0x149)+_0x5c0a07,_0x450c26=await this['httpClient'][_0xf38445(0x1b7)]('GET',_0x3376a0,{'headers':{'Accept':_0xf38445(0x169)}});return _0x450c26;}async[a88_0x438f7c(0x17d)](_0x50d474){const _0x7629b3=a88_0x438f7c,_0xbb8f61='/audiences/'+_0x50d474+_0x7629b3(0x19e),_0x568e8b=await this['httpClient'][_0x7629b3(0x1b7)](_0x7629b3(0x151),_0xbb8f61);return _0x568e8b;}async[a88_0x438f7c(0x190)](_0xe080b5,_0x2ef53a){const _0x1c4ded=a88_0x438f7c;let _0x41588b=_0x1c4ded(0x149)+_0xe080b5+_0x1c4ded(0x170);_0x2ef53a!==undefined&&(_0x41588b+=_0x1c4ded(0x173)+_0x2ef53a);const _0x45447a=await this['httpClient']['request'](_0x1c4ded(0x151),_0x41588b);return _0x45447a;}async['createSegment'](_0x11fc20,_0x4e44f8){const _0x40a001=a88_0x438f7c,_0x3d61d9=_0x40a001(0x149)+_0x11fc20+_0x40a001(0x176),_0x5e3252=await this[_0x40a001(0x1b6)][_0x40a001(0x1b7)]('POST',_0x3d61d9,{'body':_0x4e44f8});return _0x5e3252;}async[a88_0x438f7c(0x1c9)](_0x17aac7){const _0xd43609=a88_0x438f7c,_0x56f3c5=_0xd43609(0x17c),_0x52fa3d={'type':'segment-journey','attributes':{'name':_0x17aac7[_0xd43609(0x1ba)],'description':_0x17aac7[_0xd43609(0x19f)]||'','journeyId':_0x17aac7[_0xd43609(0x14b)],'rule':_0x17aac7[_0xd43609(0x1be)],'countPopulation':_0x17aac7[_0xd43609(0x1a1)]??!![]},'relationships':{'parentFolder':{'data':{'id':_0x17aac7['parentFolderId'],'type':_0xd43609(0x1a0)}}}},_0x294a07=await this[_0xd43609(0x1b6)]['request'](_0xd43609(0x157),_0x56f3c5,{'body':_0x52fa3d,'headers':{'Content-Type':'application/vnd.treasuredata.v1+json'}});return _0x294a07['data']['id'];}async[a88_0x438f7c(0x14d)](_0x37cd2d,_0x202ad6,_0x4ffb00){const _0x5d01e0=a88_0x438f7c,_0x54b86d=_0x5d01e0(0x149)+_0x37cd2d+_0x5d01e0(0x186)+_0x202ad6,_0x4a3139=await this['httpClient']['request'](_0x5d01e0(0x17f),_0x54b86d,{'body':_0x4ffb00});return _0x4a3139;}async['deleteSegment'](_0x52813d){const _0x48b2b9=a88_0x438f7c,_0x58f1ea=_0x48b2b9(0x15a)+_0x52813d;await this[_0x48b2b9(0x1b6)][_0x48b2b9(0x1b7)]('DELETE',_0x58f1ea);}async[a88_0x438f7c(0x19c)](_0x5536af,_0x18da3d){const _0x16226b=a88_0x438f7c,_0x173b37=_0x16226b(0x149)+_0x5536af+_0x16226b(0x16b),_0xc3ed91=await this[_0x16226b(0x1b6)][_0x16226b(0x1b7)](_0x16226b(0x157),_0x173b37,{'body':_0x18da3d});if(_0x16226b(0x185)in _0xc3ed91&&_0xc3ed91['data']){const _0x3e2c3d=_0xc3ed91['data'];return{'id':_0x3e2c3d['id'],'name':_0x3e2c3d[_0x16226b(0x1ba)],'description':_0x3e2c3d['description'],'audienceId':_0x3e2c3d[_0x16226b(0x19a)]||String(_0x5536af),'parentFolderId':_0x3e2c3d[_0x16226b(0x198)],'createdAt':_0x3e2c3d['createdAt'],'updatedAt':_0x3e2c3d['updatedAt']};}return _0xc3ed91;}async[a88_0x438f7c(0x165)](_0x156ad0){const _0x550578=a88_0x438f7c,_0xf0c48f=_0x550578(0x149)+_0x156ad0+_0x550578(0x14c),_0x4bdb07=await this[_0x550578(0x1b6)][_0x550578(0x1b7)]('POST',_0xf0c48f);return _0x4bdb07;}async['listJourneys'](_0x5e5b1f){const _0x4e5676=a88_0x438f7c,_0x241186=_0x4e5676(0x1b9)+_0x5e5b1f,_0x424e1f=await this[_0x4e5676(0x1b6)][_0x4e5676(0x1b7)](_0x4e5676(0x151),_0x241186);return _0x424e1f['data'][_0x4e5676(0x15c)](_0x83c725=>({'id':_0x83c725['id'],'name':_0x83c725[_0x4e5676(0x175)]['name'],'journeyBundleName':_0x83c725['attributes'][_0x4e5676(0x1b2)],'journeyBundleId':_0x83c725[_0x4e5676(0x175)][_0x4e5676(0x18f)],'versionNumber':_0x83c725['attributes']['versionNumber'],'description':_0x83c725[_0x4e5676(0x175)][_0x4e5676(0x19f)],'state':_0x83c725[_0x4e5676(0x175)]['state'],'paused':_0x83c725['attributes'][_0x4e5676(0x191)],'audienceId':_0x83c725[_0x4e5676(0x175)][_0x4e5676(0x19a)],'folderId':_0x83c725[_0x4e5676(0x16a)]?.['parentFolder']?.[_0x4e5676(0x185)]?.['id'],'createdAt':_0x83c725[_0x4e5676(0x175)][_0x4e5676(0x177)],'updatedAt':_0x83c725[_0x4e5676(0x175)][_0x4e5676(0x179)]}));}async['listJourneysWithDetails'](_0x2fad27){const _0x3e2855=a88_0x438f7c,_0x36ee6e=_0x3e2855(0x1b9)+_0x2fad27,_0x171b85=await this[_0x3e2855(0x1b6)][_0x3e2855(0x1b7)](_0x3e2855(0x151),_0x36ee6e),_0x135b6d=new Map();if(_0x171b85[_0x3e2855(0x1cd)])for(const _0x44d01e of _0x171b85[_0x3e2855(0x1cd)]){_0x44d01e[_0x3e2855(0x1c6)]==='journeyActivationStep'&&_0x135b6d['set'](_0x44d01e['id'],_0x44d01e);}return{'journeys':_0x171b85['data'],'activationStepsById':_0x135b6d};}async[a88_0x438f7c(0x156)](_0x51e718){const _0x3ec57a=a88_0x438f7c,_0x3ce6a1='/entities/journeys/'+_0x51e718,_0x37868b=await this[_0x3ec57a(0x1b6)][_0x3ec57a(0x1b7)]('GET',_0x3ce6a1);return _0x3ec57a(0x185)in _0x37868b?_0x37868b['data']:_0x37868b;}async[a88_0x438f7c(0x172)](_0x539feb){const _0x249780=a88_0x438f7c,_0x34a127='/entities/journey_bundles/'+_0x539feb,_0x13c10e=await this[_0x249780(0x1b6)][_0x249780(0x1b7)](_0x249780(0x151),_0x34a127);return parseJourneyBundleResponse(_0x13c10e);}async['checkJourneyAppendable'](_0x51b4ae){const _0x13fcc6=a88_0x438f7c,_0x98a4e6='/entities/journey_bundles/'+_0x51b4ae+_0x13fcc6(0x1b0);await this[_0x13fcc6(0x1b6)]['request'](_0x13fcc6(0x151),_0x98a4e6);}async['createJourneyVersion'](_0x3450e9,_0x9d0d8d){const _0x58d358=a88_0x438f7c,_0x40dec5=_0x58d358(0x1c4)+_0x3450e9+_0x58d358(0x14a),_0x21b831=await this[_0x58d358(0x1b6)][_0x58d358(0x1b7)](_0x58d358(0x157),_0x40dec5,{'body':_0x9d0d8d});return _0x58d358(0x185)in _0x21b831?_0x21b831[_0x58d358(0x185)]:_0x21b831;}async['createJourney'](_0x1b4386){const _0x404bff=a88_0x438f7c,_0x46cf12=_0x404bff(0x1af),_0x50b2a0=await this['httpClient']['request']('POST',_0x46cf12,{'body':_0x1b4386,'headers':{'Content-Type':_0x404bff(0x169)}});return _0x404bff(0x185)in _0x50b2a0?_0x50b2a0[_0x404bff(0x185)]:_0x50b2a0;}async[a88_0x438f7c(0x17b)](_0x4bfa70,_0x1b0330){const _0x171b0b=a88_0x438f7c,_0x360bf9=_0x171b0b(0x1bf)+_0x4bfa70,_0x438e2b=await this[_0x171b0b(0x1b6)][_0x171b0b(0x1b7)](_0x171b0b(0x167),_0x360bf9,{'body':_0x1b0330,'headers':{'Content-Type':_0x171b0b(0x169)}});return _0x171b0b(0x185)in _0x438e2b?_0x438e2b[_0x171b0b(0x185)]:_0x438e2b;}async[a88_0x438f7c(0x145)](_0x53768c,_0x553c40){const _0x47ce76=a88_0x438f7c,_0x24dbd8=_0x47ce76(0x1bf)+_0x53768c+_0x47ce76(0x146),_0x3c7a3e=await this[_0x47ce76(0x1b6)][_0x47ce76(0x1b7)](_0x47ce76(0x157),_0x24dbd8,{'body':_0x553c40,'headers':{'Content-Type':_0x47ce76(0x169)}});return'data'in _0x3c7a3e?_0x3c7a3e[_0x47ce76(0x185)]:_0x3c7a3e;}async[a88_0x438f7c(0x1b5)](_0x1c96b3,_0x3cd418){const _0x3354ab=a88_0x438f7c,_0x238b6f=buildJourneyEndpoint(_0x1c96b3,_0x3354ab(0x171),_0x3cd418),_0x572c05=await this[_0x3354ab(0x1b6)][_0x3354ab(0x1b7)](_0x3354ab(0x151),_0x238b6f);return parseJourneyStatisticsResponse(_0x572c05);}async[a88_0x438f7c(0x15d)](_0x8ceff5,_0x50809d){const _0x3aa07d=a88_0x438f7c,_0xd0d6a9=buildJourneyEndpoint(_0x8ceff5,_0x3aa07d(0x154),_0x50809d),_0x1d9d9e=await this['httpClient'][_0x3aa07d(0x1b7)]('GET',_0xd0d6a9);return parseConversionSankeyResponse(_0x1d9d9e);}async[a88_0x438f7c(0x182)](_0x824c8c,_0x52e86c){const _0x3f6396=a88_0x438f7c,_0x421276=buildJourneyEndpoint(_0x824c8c,_0x3f6396(0x168),_0x52e86c),_0x54f2c=await this[_0x3f6396(0x1b6)][_0x3f6396(0x1b7)](_0x3f6396(0x151),_0x421276);return parseActivationSankeyResponse(_0x54f2c);}async[a88_0x438f7c(0x1bc)](_0x286e8e){const _0x45f707=a88_0x438f7c,_0x340d96=_0x45f707(0x1bf)+_0x286e8e+_0x45f707(0x1c2),_0x479921=await this[_0x45f707(0x1b6)][_0x45f707(0x1b7)](_0x45f707(0x167),_0x340d96);return _0x45f707(0x185)in _0x479921?_0x479921[_0x45f707(0x185)]:_0x479921;}async[a88_0x438f7c(0x162)](_0x16710f){const _0x355b1d=a88_0x438f7c,_0x125346=_0x355b1d(0x1bf)+_0x16710f+'/resume',_0x388475=await this[_0x355b1d(0x1b6)]['request'](_0x355b1d(0x167),_0x125346);return _0x355b1d(0x185)in _0x388475?_0x388475[_0x355b1d(0x185)]:_0x388475;}async[a88_0x438f7c(0x18a)](_0x2c5230,_0x236330){const _0x67485e=a88_0x438f7c,_0x18fd6b='/entities/journeys/'+_0x2c5230+_0x67485e(0x197)+_0x236330,_0x344da5=await this['httpClient'][_0x67485e(0x1b7)]('GET',_0x18fd6b);return'data'in _0x344da5?_0x344da5[_0x67485e(0x185)]:_0x344da5;}async[a88_0x438f7c(0x1cb)](_0x582a96){const _0x5319a1=a88_0x438f7c,_0x3b6e8d=_0x5319a1(0x1bf)+_0x582a96+_0x5319a1(0x181),_0x5040a9=await this[_0x5319a1(0x1b6)]['request'](_0x5319a1(0x151),_0x3b6e8d);return _0x5319a1(0x185)in _0x5040a9?_0x5040a9[_0x5319a1(0x185)]:_0x5040a9;}async[a88_0x438f7c(0x1a2)](_0x3e275e,_0xe1c56d){const _0x8c94dd=a88_0x438f7c,_0x399432='/entities/journeys/'+_0x3e275e+_0x8c94dd(0x181),_0x936320={'name':_0xe1c56d[_0x8c94dd(0x1ba)],'scheduleType':_0xe1c56d['scheduleType']||_0x8c94dd(0x152),'connectionId':String(_0xe1c56d[_0x8c94dd(0x16d)]),'columns':_0xe1c56d[_0x8c94dd(0x16f)]??[],'notifyOn':_0xe1c56d['notifyOn']??[],..._0xe1c56d[_0x8c94dd(0x19f)]!==undefined&&{'description':_0xe1c56d[_0x8c94dd(0x19f)]},..._0xe1c56d[_0x8c94dd(0x1ca)]!==undefined&&{'allColumns':_0xe1c56d[_0x8c94dd(0x1ca)]},..._0xe1c56d[_0x8c94dd(0x1a5)]!==undefined&&{'timezone':_0xe1c56d[_0x8c94dd(0x1a5)]},..._0xe1c56d[_0x8c94dd(0x192)]!==undefined&&{'connectorConfig':_0xe1c56d[_0x8c94dd(0x192)]},..._0xe1c56d[_0x8c94dd(0x153)]!==undefined&&{'emailRecipients':_0xe1c56d[_0x8c94dd(0x153)]},..._0xe1c56d[_0x8c94dd(0x150)]!==undefined&&{'activationTemplateId':_0xe1c56d[_0x8c94dd(0x150)]},..._0xe1c56d[_0x8c94dd(0x1a4)]!==undefined&&{'syndicationBehavior':_0xe1c56d[_0x8c94dd(0x1a4)]}},_0x4c293c=await this[_0x8c94dd(0x1b6)][_0x8c94dd(0x1b7)](_0x8c94dd(0x157),_0x399432,{'body':{'type':_0x8c94dd(0x1c1),'attributes':{'runAfterJourneyRefresh':_0xe1c56d[_0x8c94dd(0x1c0)]??![],'activationParams':_0x936320}},'headers':{'Content-Type':_0x8c94dd(0x169)}});return _0x8c94dd(0x185)in _0x4c293c?_0x4c293c[_0x8c94dd(0x185)]:_0x4c293c;}}export function buildJourneyEndpoint(_0xaa84b2,_0xe4b0ef,_0x30db69){const _0x1d779a=a88_0x438f7c,_0xbce8d4='/entities/journeys/'+_0xaa84b2+'/'+_0xe4b0ef,_0x487424=new URLSearchParams();if(_0x30db69?.['from'])_0x487424['set'](_0x1d779a(0x166),_0x30db69[_0x1d779a(0x166)]);if(_0x30db69?.['to'])_0x487424[_0x1d779a(0x1a6)]('to',_0x30db69['to']);if(_0x30db69?.[_0x1d779a(0x15e)]!=null)_0x487424[_0x1d779a(0x1a6)](_0x1d779a(0x15e),String(_0x30db69[_0x1d779a(0x15e)]));const _0x286c4d=_0x487424[_0x1d779a(0x19d)]();return _0x286c4d?_0xbce8d4+'?'+_0x286c4d:_0xbce8d4;}export function parseJourneyStatisticsResponse(_0x50fd91){const _0x274a19=a88_0x438f7c;if(!(_0x274a19(0x185)in _0x50fd91))return _0x50fd91;const _0x44f737=_0x50fd91[_0x274a19(0x185)];if(!(_0x274a19(0x175)in _0x44f737)||!_0x44f737[_0x274a19(0x175)]||typeof _0x44f737[_0x274a19(0x175)]!=='object')return _0x44f737;const _0x42cd33=_0x44f737[_0x274a19(0x175)],_0xd4328a={'journeyId':_0x42cd33[_0x274a19(0x14b)],'size':_0x42cd33[_0x274a19(0x18c)],'goalSize':_0x42cd33[_0x274a19(0x187)],'enteredSize':_0x42cd33[_0x274a19(0x1c8)],'completionRate':_0x42cd33[_0x274a19(0x148)],'exitOrJumpSize':_0x42cd33[_0x274a19(0x196)],'exitOrJumpRate':_0x42cd33[_0x274a19(0x193)],'stages':(_0x42cd33[_0x274a19(0x1a9)]??[])[_0x274a19(0x15c)](_0x2dc7fd=>{const _0x25719b=_0x274a19,_0x442bdd={'id':_0x2dc7fd['id'],'enteredSize':_0x2dc7fd[_0x25719b(0x1c8)],'milestoneSize':_0x2dc7fd[_0x25719b(0x144)],'completeMilestoneRate':_0x2dc7fd['completeMilestoneRate'],'exitOrJumpSize':_0x2dc7fd[_0x25719b(0x196)],'exitOrJumpRate':_0x2dc7fd['exitOrJumpRate'],'size':_0x2dc7fd['size']};if(_0x2dc7fd['history'])_0x442bdd[_0x25719b(0x17e)]=_0x2dc7fd[_0x25719b(0x17e)];if(_0x2dc7fd[_0x25719b(0x160)])_0x442bdd[_0x25719b(0x160)]=_0x2dc7fd[_0x25719b(0x160)];if(_0x2dc7fd[_0x25719b(0x188)])_0x442bdd[_0x25719b(0x188)]=_0x2dc7fd[_0x25719b(0x188)];if(_0x2dc7fd['exitSizes'])_0x442bdd[_0x25719b(0x1aa)]=_0x2dc7fd['exitSizes'];return _0x442bdd;})};return Array['isArray'](_0x42cd33['history'])&&(_0xd4328a[_0x274a19(0x17e)]=_0x42cd33[_0x274a19(0x17e)]),_0xd4328a;}function extractSankeyChart(_0x3dbd65){const _0x5a0c7c=a88_0x438f7c,_0x42cdb7=Array[_0x5a0c7c(0x1cc)](_0x3dbd65[_0x5a0c7c(0x185)])?_0x3dbd65[_0x5a0c7c(0x185)]:[],_0x47a679=_0x3dbd65[_0x5a0c7c(0x184)]&&typeof _0x3dbd65[_0x5a0c7c(0x184)]===_0x5a0c7c(0x14e)?_0x3dbd65[_0x5a0c7c(0x184)]:{},_0x662f1e=Array['isArray'](_0x47a679[_0x5a0c7c(0x14f)])?_0x47a679[_0x5a0c7c(0x14f)]:[];return{'nodes':_0x42cdb7,'links':_0x662f1e};}function extractJsonApiAttributes(_0x2387ef){const _0x50bdd2=a88_0x438f7c;if(!_0x2387ef||typeof _0x2387ef!==_0x50bdd2(0x14e))return[];const _0xb04fa2=_0x2387ef;if(!Array['isArray'](_0xb04fa2[_0x50bdd2(0x185)]))return[];return _0xb04fa2['data'][_0x50bdd2(0x1b8)](_0x5aeb14=>!!_0x5aeb14&&typeof _0x5aeb14===_0x50bdd2(0x14e))[_0x50bdd2(0x15c)](_0x2955de=>_0x2955de['attributes'])[_0x50bdd2(0x1b8)](_0xd2bb7b=>!!_0xd2bb7b&&typeof _0xd2bb7b===_0x50bdd2(0x14e));}export function parseConversionSankeyResponse(_0x55130b){const _0x46eb3d=a88_0x438f7c,_0x59de20={'nodes':[],'links':[]},_0x46a556=extractJsonApiAttributes(_0x55130b);if(_0x46a556['length']===0x0)return _0x59de20;const _0x2d48f6=_0x46a556[0x0],_0x158995=_0x2d48f6[_0x46eb3d(0x1a7)];if(_0x158995&&typeof _0x158995===_0x46eb3d(0x14e)){const {nodes:_0x56e3a3,links:_0x53e0fc}=extractSankeyChart(_0x158995);return{'nodes':_0x56e3a3,'links':_0x53e0fc,...typeof _0x2d48f6[_0x46eb3d(0x179)]==='string'?{'updatedAt':_0x2d48f6[_0x46eb3d(0x179)]}:{}};}return _0x59de20;}function a88_0x4e44(_0x45078e,_0x3dfebe){_0x45078e=_0x45078e-0x144;const _0x659eb6=a88_0x659e();let _0x4e44ee=_0x659eb6[_0x45078e];return _0x4e44ee;}export function parseActivationSankeyResponse(_0x41a454){const _0x33f25f=extractJsonApiAttributes(_0x41a454);if(_0x33f25f['length']>0x0)return _0x33f25f['map'](_0x2e864a=>{const _0xd30dac=a88_0x4e44,_0x59e88f=_0x2e864a[_0xd30dac(0x1a7)],{nodes:_0x220a80,links:_0x46456a}=_0x59e88f&&typeof _0x59e88f===_0xd30dac(0x14e)?extractSankeyChart(_0x59e88f):{'nodes':[],'links':[]};return{'journeyStageId':typeof _0x2e864a[_0xd30dac(0x164)]==='string'?_0x2e864a[_0xd30dac(0x164)]:'','nodes':_0x220a80,'links':_0x46456a,...typeof _0x2e864a[_0xd30dac(0x179)]===_0xd30dac(0x1bb)?{'updatedAt':_0x2e864a[_0xd30dac(0x179)]}:{}};});if(Array['isArray'](_0x41a454))return _0x41a454;return[];}export function parseJourneyBundleResponse(_0x13cb91){const _0x1b91fe=a88_0x438f7c;if(!_0x13cb91||typeof _0x13cb91!=='object')throw new Error('Invalid\x20journey\x20bundle\x20response');const _0x240549=_0x13cb91,_0x25affb=_0x240549[_0x1b91fe(0x185)],_0x4a763e=_0x25affb?.['attributes']??_0x240549,_0x2f9cb6=Array[_0x1b91fe(0x1cc)](_0x4a763e['journeys'])?_0x4a763e['journeys']:[],_0x3834db=_0x2f9cb6[_0x1b91fe(0x15c)](_0x3417fd=>{const _0x2e9a42=_0x1b91fe;if(!_0x3417fd||typeof _0x3417fd!==_0x2e9a42(0x14e))return _0x3417fd;const _0x23fa49=_0x3417fd;if(_0x23fa49[_0x2e9a42(0x185)]&&typeof _0x23fa49[_0x2e9a42(0x185)]===_0x2e9a42(0x14e))return _0x23fa49[_0x2e9a42(0x185)];return _0x23fa49;});return{'name':_0x4a763e[_0x1b91fe(0x1ba)],'description':_0x4a763e['description']??null,'latestJourneyId':_0x4a763e[_0x1b91fe(0x1b1)],'lastVersionNumber':_0x4a763e['lastVersionNumber'],'journeys':_0x3834db};}
@@ -1 +1 @@
1
- (function(_0x4084a2,_0xa70aff){const _0x2e9bd1=a89_0x559b,_0x5dbd80=_0x4084a2();while(!![]){try{const _0x576e43=parseInt(_0x2e9bd1(0xca))/0x1+parseInt(_0x2e9bd1(0xc9))/0x2*(-parseInt(_0x2e9bd1(0xcf))/0x3)+parseInt(_0x2e9bd1(0xcb))/0x4*(parseInt(_0x2e9bd1(0xb7))/0x5)+-parseInt(_0x2e9bd1(0xbf))/0x6*(parseInt(_0x2e9bd1(0xb8))/0x7)+-parseInt(_0x2e9bd1(0xc0))/0x8*(parseInt(_0x2e9bd1(0xc4))/0x9)+-parseInt(_0x2e9bd1(0xbc))/0xa*(parseInt(_0x2e9bd1(0xbd))/0xb)+parseInt(_0x2e9bd1(0xc5))/0xc*(parseInt(_0x2e9bd1(0xcc))/0xd);if(_0x576e43===_0xa70aff)break;else _0x5dbd80['push'](_0x5dbd80['shift']());}catch(_0x51bf58){_0x5dbd80['push'](_0x5dbd80['shift']());}}}(a89_0x4df0,0x36a44));import{HTTPClient}from'./http-client.js';function a89_0x559b(_0x5c3130,_0x8894ad){_0x5c3130=_0x5c3130-0xb2;const _0x4df0a0=a89_0x4df0();let _0x559bda=_0x4df0a0[_0x5c3130];return _0x559bda;}import{getDeliveryEndpoint}from'./endpoints.js';function a89_0x4df0(){const _0x3fc855=['1811148taPNAx','44680KoeUmi','toString','limit','GET','207XrbHeQ','22008BpRpTj','offset','/api/email_senders?','workspaceId','222QxPFJB','196872SeEGIu','1282248hQGeok','2782jvoQjH','request','proxy','4563mzbIHW','httpClient','apiKey','application/vnd.api+json','page[offset]','filter[workspaceId]','5LsjJyg','7CXNYRO','page[limit]','/api/email_senders','append','10oQwyCP','956494TlDrcg','accessToken'];a89_0x4df0=function(){return _0x3fc855;};return a89_0x4df0();}import{getAuthHeaders,toHeaderRecord}from'../../core/auth.js';export class DeliveryApiClient{['httpClient'];constructor(_0xa457d8){const _0x32c2d2=a89_0x559b,_0x59dd1c=getDeliveryEndpoint(_0xa457d8['site']),_0x3e1555=toHeaderRecord(getAuthHeaders(_0xa457d8['site'],_0xa457d8[_0x32c2d2(0xb3)],_0xa457d8[_0x32c2d2(0xbe)]));this[_0x32c2d2(0xb2)]=new HTTPClient(_0x59dd1c,_0x3e1555,{'proxy':_0xa457d8[_0x32c2d2(0xce)]});}async['listEmailSenders'](_0xa45650={}){const _0x5e75c3=a89_0x559b,_0xac75f1=new URLSearchParams();_0xa45650[_0x5e75c3(0xc8)]&&_0xac75f1[_0x5e75c3(0xbb)](_0x5e75c3(0xb6),_0xa45650[_0x5e75c3(0xc8)]);_0xa45650[_0x5e75c3(0xc2)]!==undefined&&_0xac75f1[_0x5e75c3(0xbb)](_0x5e75c3(0xb9),_0xa45650[_0x5e75c3(0xc2)][_0x5e75c3(0xc1)]());_0xa45650[_0x5e75c3(0xc6)]!==undefined&&_0xac75f1['append'](_0x5e75c3(0xb5),_0xa45650[_0x5e75c3(0xc6)][_0x5e75c3(0xc1)]());const _0x538ea9=_0xac75f1['toString'](),_0x471917=_0x538ea9?_0x5e75c3(0xc7)+_0x538ea9:_0x5e75c3(0xba);return await this[_0x5e75c3(0xb2)][_0x5e75c3(0xcd)](_0x5e75c3(0xc3),_0x471917,{'headers':{'Accept':_0x5e75c3(0xb4)}});}}
1
+ const a89_0x1956e8=a89_0x1740;(function(_0xda7936,_0x19c54a){const _0x4c76d5=a89_0x1740,_0x3ff12a=_0xda7936();while(!![]){try{const _0x58d81f=parseInt(_0x4c76d5(0x1a4))/0x1*(-parseInt(_0x4c76d5(0x197))/0x2)+-parseInt(_0x4c76d5(0x198))/0x3+parseInt(_0x4c76d5(0x19a))/0x4+parseInt(_0x4c76d5(0x1a3))/0x5*(-parseInt(_0x4c76d5(0x19d))/0x6)+parseInt(_0x4c76d5(0x1a6))/0x7+parseInt(_0x4c76d5(0x1ac))/0x8*(parseInt(_0x4c76d5(0x1ad))/0x9)+parseInt(_0x4c76d5(0x19c))/0xa;if(_0x58d81f===_0x19c54a)break;else _0x3ff12a['push'](_0x3ff12a['shift']());}catch(_0x401bcf){_0x3ff12a['push'](_0x3ff12a['shift']());}}}(a89_0x510b,0x9d5f2));function a89_0x1740(_0x45bcaa,_0x20cdc6){_0x45bcaa=_0x45bcaa-0x194;const _0x510b78=a89_0x510b();let _0x174061=_0x510b78[_0x45bcaa];return _0x174061;}import{HTTPClient}from'./http-client.js';import{getDeliveryEndpoint}from'./endpoints.js';function a89_0x510b(){const _0x16e8bd=['proxy','1306473bHyxlp','listEmailSenders','httpClient','application/vnd.api+json','request','page[offset]','3520ripiEP','22734InwjLr','/api/email_senders','offset','/api/email_senders?','accessToken','24iNMUMc','3755952pCOoat','site','3622244hZrVmS','append','10704060gbHUlB','6qwqRXj','limit','workspaceId','toString','apiKey','GET','4653960xlgFgm','37223DWFEeb'];a89_0x510b=function(){return _0x16e8bd;};return a89_0x510b();}import{getAuthHeaders,toHeaderRecord}from'../../core/auth.js';export class DeliveryApiClient{[a89_0x1956e8(0x1a8)];constructor(_0x4192d1){const _0x4d59ee=a89_0x1956e8,_0x1d4921=getDeliveryEndpoint(_0x4192d1[_0x4d59ee(0x199)]),_0x5010e3=toHeaderRecord(getAuthHeaders(_0x4192d1['site'],_0x4192d1[_0x4d59ee(0x1a1)],_0x4192d1[_0x4d59ee(0x196)]));this['httpClient']=new HTTPClient(_0x1d4921,_0x5010e3,{'proxy':_0x4192d1[_0x4d59ee(0x1a5)]});}async[a89_0x1956e8(0x1a7)](_0x30cb61={}){const _0x1b9aad=a89_0x1956e8,_0x19b51a=new URLSearchParams();_0x30cb61[_0x1b9aad(0x19f)]&&_0x19b51a[_0x1b9aad(0x19b)]('filter[workspaceId]',_0x30cb61['workspaceId']);_0x30cb61[_0x1b9aad(0x19e)]!==undefined&&_0x19b51a['append']('page[limit]',_0x30cb61[_0x1b9aad(0x19e)][_0x1b9aad(0x1a0)]());_0x30cb61[_0x1b9aad(0x194)]!==undefined&&_0x19b51a['append'](_0x1b9aad(0x1ab),_0x30cb61['offset'][_0x1b9aad(0x1a0)]());const _0x1f3274=_0x19b51a[_0x1b9aad(0x1a0)](),_0x21b816=_0x1f3274?_0x1b9aad(0x195)+_0x1f3274:_0x1b9aad(0x1ae);return await this[_0x1b9aad(0x1a8)][_0x1b9aad(0x1aa)](_0x1b9aad(0x1a2),_0x21b816,{'headers':{'Accept':_0x1b9aad(0x1a9)}});}}
@@ -1 +1 @@
1
- const a90_0xcd0f0a=a90_0x3eee;(function(_0x1b4371,_0x2111b8){const _0x778ce8=a90_0x3eee,_0x5a65e6=_0x1b4371();while(!![]){try{const _0x5a5897=-parseInt(_0x778ce8(0xb2))/0x1+-parseInt(_0x778ce8(0xdd))/0x2+-parseInt(_0x778ce8(0xa1))/0x3+-parseInt(_0x778ce8(0xb0))/0x4+parseInt(_0x778ce8(0xbb))/0x5+parseInt(_0x778ce8(0xb3))/0x6+parseInt(_0x778ce8(0x9d))/0x7;if(_0x5a5897===_0x2111b8)break;else _0x5a65e6['push'](_0x5a65e6['shift']());}catch(_0x5e5444){_0x5a65e6['push'](_0x5a65e6['shift']());}}}(a90_0x341c,0x921a9));export const TD_ENDPOINTS={'us01':a90_0xcd0f0a(0xc8),'ap01':a90_0xcd0f0a(0xab),'eu01':'https://api.eu01.treasuredata.com','ap02':a90_0xcd0f0a(0xac),'ap03':a90_0xcd0f0a(0xeb),'dev-us01':'https://api-development.treasuredata.com','dev-eu01':a90_0xcd0f0a(0xc3),'stg-us01':'https://api-staging.treasuredata.com','stg-ap01':a90_0xcd0f0a(0xa9),'stg-ap03':a90_0xcd0f0a(0xd6)};export const CDP_ENDPOINTS={'us01':a90_0xcd0f0a(0xae),'ap01':'https://api-cdp.treasuredata.co.jp','eu01':a90_0xcd0f0a(0xd2),'ap02':'https://api-cdp.ap02.treasuredata.com','ap03':a90_0xcd0f0a(0xca),'dev-us01':'https://api-development-cdp.us01.treasuredata.com','dev-eu01':'https://api-development-cdp.eu01.treasuredata.com','stg-us01':a90_0xcd0f0a(0xea),'stg-ap01':a90_0xcd0f0a(0xe3),'stg-ap03':a90_0xcd0f0a(0xd8)};export const WORKFLOW_ENDPOINTS={'us01':a90_0xcd0f0a(0x9e),'ap01':'https://api-workflow.treasuredata.co.jp','eu01':'https://api-workflow.eu01.treasuredata.com','ap02':a90_0xcd0f0a(0xc6),'ap03':a90_0xcd0f0a(0xaf),'dev-us01':'https://api-development-workflow.us01.treasuredata.com','dev-eu01':'https://api-development-workflow.eu01.treasuredata.com','stg-us01':a90_0xcd0f0a(0xe7),'stg-ap01':a90_0xcd0f0a(0xbe),'stg-ap03':a90_0xcd0f0a(0x99)};export const TRINO_ENDPOINTS={'us01':'https://api-presto.treasuredata.com','ap01':'https://api-presto.treasuredata.co.jp','eu01':'https://api-presto.eu01.treasuredata.com','ap02':a90_0xcd0f0a(0xde),'ap03':a90_0xcd0f0a(0xb5),'dev-us01':a90_0xcd0f0a(0x9c),'dev-eu01':a90_0xcd0f0a(0xa6),'stg-us01':'https://api-staging-presto.treasuredata.com','stg-ap01':'https://api-staging-presto.treasuredata.co.jp','stg-ap03':a90_0xcd0f0a(0xc2)};export const LLM_ENDPOINTS={'us01':a90_0xcd0f0a(0xd4),'ap01':a90_0xcd0f0a(0xec),'eu01':a90_0xcd0f0a(0xad),'ap02':a90_0xcd0f0a(0xe6),'ap03':a90_0xcd0f0a(0xf1),'dev-us01':a90_0xcd0f0a(0xbf),'dev-eu01':a90_0xcd0f0a(0xb1),'stg-us01':a90_0xcd0f0a(0x9b),'stg-ap01':a90_0xcd0f0a(0xa5),'stg-ap03':a90_0xcd0f0a(0x98)};export const LLM_PROXY_ENDPOINTS={'us01':a90_0xcd0f0a(0xbd),'ap01':a90_0xcd0f0a(0xb7),'eu01':a90_0xcd0f0a(0xd5),'ap02':a90_0xcd0f0a(0xe2),'ap03':a90_0xcd0f0a(0xa4),'dev-us01':'https://llm-proxy-development.us01.treasuredata.com','dev-eu01':'https://llm-proxy-development.eu01.treasuredata.com','stg-us01':a90_0xcd0f0a(0xbc),'stg-ap01':a90_0xcd0f0a(0xc1),'stg-ap03':a90_0xcd0f0a(0xcd)};export const ENGAGE_ENDPOINTS={'us01':a90_0xcd0f0a(0xcf),'ap01':a90_0xcd0f0a(0xef),'eu01':a90_0xcd0f0a(0xed),'ap02':'https://engage-api.ap02.treasuredata.com','ap03':a90_0xcd0f0a(0xf2),'dev-us01':'https://engage-api-development.us01.treasuredata.com','dev-eu01':a90_0xcd0f0a(0xa8),'stg-us01':a90_0xcd0f0a(0xe4),'stg-ap01':'https://engage-api-staging.treasuredata.co.jp','stg-ap03':a90_0xcd0f0a(0xf0)};export const DELIVERY_ENDPOINTS={'us01':a90_0xcd0f0a(0xf4),'ap01':a90_0xcd0f0a(0x9a),'eu01':'https://delivery-api.eu01.treasuredata.com','ap02':'https://delivery-api.ap02.treasuredata.com','ap03':'https://delivery-api.ap03.treasuredata.com','dev-us01':a90_0xcd0f0a(0xb9),'dev-eu01':a90_0xcd0f0a(0xa2),'stg-us01':a90_0xcd0f0a(0xe5),'stg-ap01':a90_0xcd0f0a(0xc9),'stg-ap03':a90_0xcd0f0a(0xaa)};export function getDeliveryEndpoint(_0x3b2df8){const _0x3064f3=a90_0xcd0f0a,_0x2d6bd7=DELIVERY_ENDPOINTS[_0x3b2df8];if(!_0x2d6bd7)throw new Error(_0x3064f3(0xdc)+_0x3b2df8);return _0x2d6bd7;}export const CONSOLE_ENDPOINTS={'us01':a90_0xcd0f0a(0xd3),'ap01':a90_0xcd0f0a(0xd9),'eu01':a90_0xcd0f0a(0xb4),'ap02':a90_0xcd0f0a(0xa3),'ap03':a90_0xcd0f0a(0xe0),'dev-us01':a90_0xcd0f0a(0xcb),'dev-eu01':a90_0xcd0f0a(0xb8),'stg-us01':a90_0xcd0f0a(0xda),'stg-ap01':'https://console-staging.treasuredata.co.jp','stg-ap03':a90_0xcd0f0a(0xe9)};export const CONSOLE_NEXT_ENDPOINTS={'us01':a90_0xcd0f0a(0xee),'ap01':a90_0xcd0f0a(0x9f),'eu01':a90_0xcd0f0a(0xb6),'ap02':a90_0xcd0f0a(0xc4),'ap03':'https://console-next.ap03.treasuredata.com','dev-us01':a90_0xcd0f0a(0xe8),'dev-eu01':'https://console-development-next.eu01.treasuredata.com','stg-us01':a90_0xcd0f0a(0xdf),'stg-ap01':'https://console-staging-next.treasuredata.co.jp','stg-ap03':'https://console-staging-next.ap03.treasuredata.com'};function a90_0x3eee(_0x1b15ea,_0x14d33f){_0x1b15ea=_0x1b15ea-0x98;const _0x341cc2=a90_0x341c();let _0x3eee01=_0x341cc2[_0x1b15ea];return _0x3eee01;}export function getConsoleUrl(_0x482b9a,_0x3a5250){const _0x35c9ff=a90_0xcd0f0a,_0x430945=CONSOLE_ENDPOINTS[_0x482b9a]||_0x35c9ff(0xba)+_0x482b9a+_0x35c9ff(0xdb);return _0x3a5250?''+_0x430945+_0x3a5250:_0x430945;}export function getConsoleNextUrl(_0x50374a,_0x15ef54){const _0x104077=a90_0xcd0f0a,_0x25447c=CONSOLE_NEXT_ENDPOINTS[_0x50374a]||_0x104077(0xc5)+_0x50374a+_0x104077(0xdb);return _0x15ef54?''+_0x25447c+_0x15ef54:_0x25447c;}function a90_0x341c(){const _0xe085ed=['https://delivery-api-development.us01.treasuredata.com','https://console.','3462070hYXjal','https://llm-proxy-staging.us01.treasuredata.com','https://llm-proxy.us01.treasuredata.com','https://api-staging-workflow.treasuredata.co.jp','https://llm-api-development.us01.treasuredata.com','\x27\x20and\x20site\x20\x27','https://llm-proxy-staging.treasuredata.co.jp','https://api-staging-presto.ap03.treasuredata.com','https://api-development.eu01.treasuredata.com','https://console-next.ap02.treasuredata.com','https://console-next.','https://api-workflow.ap02.treasuredata.com','/sessions/','https://api.treasuredata.com','https://delivery-api-staging.treasuredata.co.jp','https://api-cdp.ap03.treasuredata.com','https://console-development.us01.treasuredata.com','/attempt/','https://llm-proxy-staging.ap03.treasuredata.com','/em/','https://engage-api.treasuredata.com','/tc','/ag','https://api-cdp.eu01.treasuredata.com','https://console.us01.treasuredata.com','https://llm-api.treasuredata.com','https://llm-proxy.eu01.treasuredata.com','https://api-staging.ap03.treasuredata.com','/tc/','https://api-staging-cdp.ap03.treasuredata.com','https://console.treasuredata.co.jp','https://console-staging.us01.treasuredata.com','.treasuredata.com','No\x20Delivery\x20API\x20endpoint\x20for\x20site:\x20','1942018CGwPoe','https://api-presto.ap02.treasuredata.com','https://console-staging-next.us01.treasuredata.com','https://console.ap03.treasuredata.com','/info','https://llm-proxy.ap02.treasuredata.com','https://api-staging-cdp.treasuredata.co.jp','https://engage-api-staging.us01.treasuredata.com','https://delivery-api-staging.us01.treasuredata.com','https://llm-api.ap02.treasuredata.com','https://api-staging-workflow.us01.treasuredata.com','https://console-development-next.us01.treasuredata.com','https://console-staging.ap03.treasuredata.com','https://api-staging-cdp.us01.treasuredata.com','https://api.ap03.treasuredata.com','https://llm-api.treasuredata.co.jp','https://engage-api.eu01.treasuredata.com','https://console-next.us01.treasuredata.com','https://engage-api.treasuredata.co.jp','https://engage-api-staging.ap03.treasuredata.com','https://llm-api.ap03.treasuredata.com','https://engage-api.ap03.treasuredata.com','/app/workflows/','https://delivery-api.us01.treasuredata.com','https://llm-api-staging.ap03.treasuredata.com','https://api-staging-workflow.ap03.treasuredata.com','https://delivery-api.treasuredata.co.jp','https://llm-api-staging.us01.treasuredata.com','https://api-development-presto.treasuredata.com','17042445grlrpM','https://api-workflow.treasuredata.com','https://console-next.treasuredata.co.jp','/app/af/','2228313MOndPR','https://delivery-api-development.eu01.treasuredata.com','https://console.ap02.treasuredata.com','https://llm-proxy.ap03.treasuredata.com','https://llm-api-staging.treasuredata.co.jp','https://api-development-presto.eu01.treasuredata.com','/app/es/','https://engage-api-development.eu01.treasuredata.com','https://api-staging.treasuredata.co.jp','https://delivery-api-staging.ap03.treasuredata.com','https://api.treasuredata.co.jp','https://api.ap02.treasuredata.com','https://llm-api.eu01.treasuredata.com','https://api-cdp.treasuredata.com','https://api-workflow.ap03.treasuredata.com','4706516nHuAJH','https://llm-api-development.eu01.treasuredata.com','621508Wtupjr','5899854QwYIsW','https://console.eu01.treasuredata.com','https://api-presto.ap03.treasuredata.com','https://console-next.eu01.treasuredata.com','https://llm-proxy.treasuredata.co.jp','https://console-development.eu01.treasuredata.com'];a90_0x341c=function(){return _0xe085ed;};return a90_0x341c();}export function getLLMProjectUrl(_0x2ad699,_0x2ed902){const _0xb3ba20=a90_0xcd0f0a;return getConsoleNextUrl(_0x2ad699,_0xb3ba20(0xa0)+_0x2ed902+_0xb3ba20(0xd1));}export function getLLMAgentChatUrl(_0x33ace0,_0x135543,_0x14ab92){const _0x1862f7=a90_0xcd0f0a;return getConsoleNextUrl(_0x33ace0,_0x1862f7(0xa0)+_0x135543+'/ag/'+_0x14ab92+_0x1862f7(0xd0));}export function getLLMConversationUrl(_0x1d8194,_0x11ac66,_0x346f4a,_0x4a314e){const _0x2083d0=a90_0xcd0f0a;return getConsoleNextUrl(_0x1d8194,_0x2083d0(0xa0)+_0x11ac66+'/ag/'+_0x346f4a+_0x2083d0(0xd7)+_0x4a314e);}export function getWorkflowUrl(_0x6898c1,_0x303e88){const _0x404ebb=a90_0xcd0f0a;return getConsoleUrl(_0x6898c1,_0x404ebb(0xf3)+_0x303e88+_0x404ebb(0xe1));}export function getWorkflowSessionUrl(_0x414c,_0x57a384,_0x1cbeb6){const _0x5f4834=a90_0xcd0f0a;return getConsoleUrl(_0x414c,'/app/workflows/'+_0x57a384+_0x5f4834(0xc7)+_0x1cbeb6);}export function getWorkflowAttemptUrl(_0x322caa,_0x1dfeb3,_0xb451d4,_0x7541){const _0x9f1acb=a90_0xcd0f0a;return getConsoleUrl(_0x322caa,_0x9f1acb(0xf3)+_0x1dfeb3+_0x9f1acb(0xc7)+_0xb451d4+_0x9f1acb(0xcc)+_0x7541);}export function getCampaignUrl(_0x8f6574,_0x590696,_0x659bd5){return getConsoleNextUrl(_0x8f6574,'/app/es/'+_0x590696+'/ooc/'+_0x659bd5);}export function getTemplateUrl(_0x36dac2,_0x269953,_0x292cc9){const _0x566f91=a90_0xcd0f0a;return getConsoleNextUrl(_0x36dac2,_0x566f91(0xa7)+_0x269953+_0x566f91(0xce)+_0x292cc9+'/ce');}export function getJobUrl(_0x1d124b,_0x25ee8){return getConsoleNextUrl(_0x1d124b,'/app/jobs/'+_0x25ee8+'/result');}export function getWorkspaceUrl(_0xc9b0b7,_0x4372aa){const _0x35baca=a90_0xcd0f0a;return getConsoleNextUrl(_0xc9b0b7,_0x35baca(0xa7)+_0x4372aa);}export const API_ENDPOINTS={'td':TD_ENDPOINTS,'cdp':CDP_ENDPOINTS,'workflow':WORKFLOW_ENDPOINTS,'trino':TRINO_ENDPOINTS,'llm':LLM_ENDPOINTS,'engage':ENGAGE_ENDPOINTS,'llm-proxy':LLM_PROXY_ENDPOINTS};export function getLLMProxyEndpoint(_0x2113d9){const _0x4881bb=LLM_PROXY_ENDPOINTS[_0x2113d9];if(!_0x4881bb)throw new Error('No\x20LLM\x20Proxy\x20endpoint\x20for\x20site:\x20'+_0x2113d9);return _0x4881bb;}export function getEndpoint(_0x22c102,_0xbf37de='td'){const _0x150284=a90_0xcd0f0a,_0x4c8b70=API_ENDPOINTS[_0xbf37de]?.[_0x22c102];if(!_0x4c8b70)throw new Error('No\x20endpoint\x20defined\x20for\x20API\x20type\x20\x27'+_0xbf37de+_0x150284(0xc0)+_0x22c102+'\x27');return _0x4c8b70;}
1
+ const a90_0x5b0dd0=a90_0x3210;(function(_0x2640e,_0x59beb4){const _0x50b0a3=a90_0x3210,_0x14d24e=_0x2640e();while(!![]){try{const _0x5f3613=parseInt(_0x50b0a3(0x212))/0x1+-parseInt(_0x50b0a3(0x1f1))/0x2*(-parseInt(_0x50b0a3(0x1f6))/0x3)+-parseInt(_0x50b0a3(0x239))/0x4+parseInt(_0x50b0a3(0x22c))/0x5*(parseInt(_0x50b0a3(0x1ff))/0x6)+parseInt(_0x50b0a3(0x220))/0x7*(parseInt(_0x50b0a3(0x236))/0x8)+parseInt(_0x50b0a3(0x23a))/0x9+-parseInt(_0x50b0a3(0x205))/0xa;if(_0x5f3613===_0x59beb4)break;else _0x14d24e['push'](_0x14d24e['shift']());}catch(_0x5af7a7){_0x14d24e['push'](_0x14d24e['shift']());}}}(a90_0x58b1,0x37c37));export const TD_ENDPOINTS={'us01':a90_0x5b0dd0(0x203),'ap01':'https://api.treasuredata.co.jp','eu01':a90_0x5b0dd0(0x1f0),'ap02':a90_0x5b0dd0(0x246),'ap03':a90_0x5b0dd0(0x22e),'dev-us01':'https://api-development.treasuredata.com','dev-eu01':a90_0x5b0dd0(0x1f4),'stg-us01':a90_0x5b0dd0(0x22f),'stg-ap01':a90_0x5b0dd0(0x224),'stg-ap03':a90_0x5b0dd0(0x234)};export const CDP_ENDPOINTS={'us01':a90_0x5b0dd0(0x1ea),'ap01':'https://api-cdp.treasuredata.co.jp','eu01':'https://api-cdp.eu01.treasuredata.com','ap02':a90_0x5b0dd0(0x1ed),'ap03':a90_0x5b0dd0(0x1eb),'dev-us01':a90_0x5b0dd0(0x223),'dev-eu01':'https://api-development-cdp.eu01.treasuredata.com','stg-us01':a90_0x5b0dd0(0x222),'stg-ap01':a90_0x5b0dd0(0x1f9),'stg-ap03':a90_0x5b0dd0(0x1f7)};export const WORKFLOW_ENDPOINTS={'us01':a90_0x5b0dd0(0x1ef),'ap01':a90_0x5b0dd0(0x227),'eu01':a90_0x5b0dd0(0x20b),'ap02':a90_0x5b0dd0(0x230),'ap03':a90_0x5b0dd0(0x21b),'dev-us01':'https://api-development-workflow.us01.treasuredata.com','dev-eu01':'https://api-development-workflow.eu01.treasuredata.com','stg-us01':a90_0x5b0dd0(0x229),'stg-ap01':a90_0x5b0dd0(0x1fb),'stg-ap03':a90_0x5b0dd0(0x213)};export const TRINO_ENDPOINTS={'us01':'https://api-presto.treasuredata.com','ap01':a90_0x5b0dd0(0x221),'eu01':'https://api-presto.eu01.treasuredata.com','ap02':'https://api-presto.ap02.treasuredata.com','ap03':'https://api-presto.ap03.treasuredata.com','dev-us01':'https://api-development-presto.treasuredata.com','dev-eu01':a90_0x5b0dd0(0x1e9),'stg-us01':a90_0x5b0dd0(0x215),'stg-ap01':a90_0x5b0dd0(0x22d),'stg-ap03':'https://api-staging-presto.ap03.treasuredata.com'};export const LLM_ENDPOINTS={'us01':a90_0x5b0dd0(0x1e8),'ap01':a90_0x5b0dd0(0x1fd),'eu01':'https://llm-api.eu01.treasuredata.com','ap02':a90_0x5b0dd0(0x228),'ap03':a90_0x5b0dd0(0x208),'dev-us01':a90_0x5b0dd0(0x23c),'dev-eu01':a90_0x5b0dd0(0x226),'stg-us01':a90_0x5b0dd0(0x20d),'stg-ap01':a90_0x5b0dd0(0x22a),'stg-ap03':a90_0x5b0dd0(0x1fc)};export const LLM_PROXY_ENDPOINTS={'us01':a90_0x5b0dd0(0x210),'ap01':a90_0x5b0dd0(0x232),'eu01':a90_0x5b0dd0(0x237),'ap02':a90_0x5b0dd0(0x207),'ap03':a90_0x5b0dd0(0x22b),'dev-us01':a90_0x5b0dd0(0x1f5),'dev-eu01':a90_0x5b0dd0(0x21c),'stg-us01':a90_0x5b0dd0(0x214),'stg-ap01':a90_0x5b0dd0(0x21f),'stg-ap03':'https://llm-proxy-staging.ap03.treasuredata.com'};export const ENGAGE_ENDPOINTS={'us01':a90_0x5b0dd0(0x23b),'ap01':a90_0x5b0dd0(0x241),'eu01':a90_0x5b0dd0(0x1ee),'ap02':a90_0x5b0dd0(0x217),'ap03':a90_0x5b0dd0(0x1e7),'dev-us01':'https://engage-api-development.us01.treasuredata.com','dev-eu01':'https://engage-api-development.eu01.treasuredata.com','stg-us01':a90_0x5b0dd0(0x242),'stg-ap01':'https://engage-api-staging.treasuredata.co.jp','stg-ap03':a90_0x5b0dd0(0x1ec)};export const DELIVERY_ENDPOINTS={'us01':a90_0x5b0dd0(0x201),'ap01':a90_0x5b0dd0(0x1e6),'eu01':a90_0x5b0dd0(0x244),'ap02':a90_0x5b0dd0(0x238),'ap03':a90_0x5b0dd0(0x1f3),'dev-us01':a90_0x5b0dd0(0x200),'dev-eu01':a90_0x5b0dd0(0x21a),'stg-us01':a90_0x5b0dd0(0x1fa),'stg-ap01':'https://delivery-api-staging.treasuredata.co.jp','stg-ap03':a90_0x5b0dd0(0x21d)};export function getDeliveryEndpoint(_0x2b1145){const _0x1af26d=DELIVERY_ENDPOINTS[_0x2b1145];if(!_0x1af26d)throw new Error('No\x20Delivery\x20API\x20endpoint\x20for\x20site:\x20'+_0x2b1145);return _0x1af26d;}function a90_0x58b1(){const _0x24f906=['https://api.treasuredata.com','\x27\x20and\x20site\x20\x27','9250480HFDmJh','https://console.ap02.treasuredata.com','https://llm-proxy.ap02.treasuredata.com','https://llm-api.ap03.treasuredata.com','/em/','https://console-next.us01.treasuredata.com','https://api-workflow.eu01.treasuredata.com','https://console-development-next.us01.treasuredata.com','https://llm-api-staging.us01.treasuredata.com','/app/es/','/app/af/','https://llm-proxy.us01.treasuredata.com','/app/jobs/','276677xKwKVc','https://api-staging-workflow.ap03.treasuredata.com','https://llm-proxy-staging.us01.treasuredata.com','https://api-staging-presto.treasuredata.com','/ce','https://engage-api.ap02.treasuredata.com','.treasuredata.com','https://console-staging-next.us01.treasuredata.com','https://delivery-api-development.eu01.treasuredata.com','https://api-workflow.ap03.treasuredata.com','https://llm-proxy-development.eu01.treasuredata.com','https://delivery-api-staging.ap03.treasuredata.com','https://console-next.eu01.treasuredata.com','https://llm-proxy-staging.treasuredata.co.jp','1589XCTvje','https://api-presto.treasuredata.co.jp','https://api-staging-cdp.us01.treasuredata.com','https://api-development-cdp.us01.treasuredata.com','https://api-staging.treasuredata.co.jp','https://console-staging-next.ap03.treasuredata.com','https://llm-api-development.eu01.treasuredata.com','https://api-workflow.treasuredata.co.jp','https://llm-api.ap02.treasuredata.com','https://api-staging-workflow.us01.treasuredata.com','https://llm-api-staging.treasuredata.co.jp','https://llm-proxy.ap03.treasuredata.com','849160QrLEoj','https://api-staging-presto.treasuredata.co.jp','https://api.ap03.treasuredata.com','https://api-staging.treasuredata.com','https://api-workflow.ap02.treasuredata.com','/tc','https://llm-proxy.treasuredata.co.jp','https://console-staging-next.treasuredata.co.jp','https://api-staging.ap03.treasuredata.com','/ooc/','3400Eyrkzb','https://llm-proxy.eu01.treasuredata.com','https://delivery-api.ap02.treasuredata.com','148012isAiXn','2160261RtlRTG','https://engage-api.treasuredata.com','https://llm-api-development.us01.treasuredata.com','/app/workflows/','/ag','https://console.','https://console-development.eu01.treasuredata.com','https://engage-api.treasuredata.co.jp','https://engage-api-staging.us01.treasuredata.com','https://console.eu01.treasuredata.com','https://delivery-api.eu01.treasuredata.com','https://console-development.us01.treasuredata.com','https://api.ap02.treasuredata.com','https://console-next.treasuredata.co.jp','https://delivery-api.treasuredata.co.jp','https://engage-api.ap03.treasuredata.com','https://llm-api.treasuredata.com','https://api-development-presto.eu01.treasuredata.com','https://api-cdp.treasuredata.com','https://api-cdp.ap03.treasuredata.com','https://engage-api-staging.ap03.treasuredata.com','https://api-cdp.ap02.treasuredata.com','https://engage-api.eu01.treasuredata.com','https://api-workflow.treasuredata.com','https://api.eu01.treasuredata.com','20662RvMMbm','/sessions/','https://delivery-api.ap03.treasuredata.com','https://api-development.eu01.treasuredata.com','https://llm-proxy-development.us01.treasuredata.com','69ktsAdL','https://api-staging-cdp.ap03.treasuredata.com','/attempt/','https://api-staging-cdp.treasuredata.co.jp','https://delivery-api-staging.us01.treasuredata.com','https://api-staging-workflow.treasuredata.co.jp','https://llm-api-staging.ap03.treasuredata.com','https://llm-api.treasuredata.co.jp','/ag/','12tUentn','https://delivery-api-development.us01.treasuredata.com','https://delivery-api.us01.treasuredata.com','https://console-development-next.eu01.treasuredata.com'];a90_0x58b1=function(){return _0x24f906;};return a90_0x58b1();}export const CONSOLE_ENDPOINTS={'us01':'https://console.us01.treasuredata.com','ap01':'https://console.treasuredata.co.jp','eu01':a90_0x5b0dd0(0x243),'ap02':a90_0x5b0dd0(0x206),'ap03':'https://console.ap03.treasuredata.com','dev-us01':a90_0x5b0dd0(0x245),'dev-eu01':a90_0x5b0dd0(0x240),'stg-us01':'https://console-staging.us01.treasuredata.com','stg-ap01':'https://console-staging.treasuredata.co.jp','stg-ap03':'https://console-staging.ap03.treasuredata.com'};export const CONSOLE_NEXT_ENDPOINTS={'us01':a90_0x5b0dd0(0x20a),'ap01':a90_0x5b0dd0(0x247),'eu01':a90_0x5b0dd0(0x21e),'ap02':'https://console-next.ap02.treasuredata.com','ap03':'https://console-next.ap03.treasuredata.com','dev-us01':a90_0x5b0dd0(0x20c),'dev-eu01':a90_0x5b0dd0(0x202),'stg-us01':a90_0x5b0dd0(0x219),'stg-ap01':a90_0x5b0dd0(0x233),'stg-ap03':a90_0x5b0dd0(0x225)};export function getConsoleUrl(_0x3ea56b,_0x5d2a8b){const _0x4df43f=a90_0x5b0dd0,_0x54fe42=CONSOLE_ENDPOINTS[_0x3ea56b]||_0x4df43f(0x23f)+_0x3ea56b+_0x4df43f(0x218);return _0x5d2a8b?''+_0x54fe42+_0x5d2a8b:_0x54fe42;}export function getConsoleNextUrl(_0x2be45f,_0x52880a){const _0x55782f=a90_0x5b0dd0,_0x1d80de=CONSOLE_NEXT_ENDPOINTS[_0x2be45f]||'https://console-next.'+_0x2be45f+_0x55782f(0x218);return _0x52880a?''+_0x1d80de+_0x52880a:_0x1d80de;}export function getLLMProjectUrl(_0xa19b6e,_0x38a68c){const _0x289ce7=a90_0x5b0dd0;return getConsoleNextUrl(_0xa19b6e,_0x289ce7(0x20f)+_0x38a68c+_0x289ce7(0x23e));}function a90_0x3210(_0x4971f3,_0x39bdb2){_0x4971f3=_0x4971f3-0x1e6;const _0x58b17a=a90_0x58b1();let _0x321090=_0x58b17a[_0x4971f3];return _0x321090;}export function getLLMAgentChatUrl(_0x5185df,_0x3083af,_0x1b0cc0){const _0x409599=a90_0x5b0dd0;return getConsoleNextUrl(_0x5185df,_0x409599(0x20f)+_0x3083af+_0x409599(0x1fe)+_0x1b0cc0+_0x409599(0x231));}export function getLLMConversationUrl(_0x4bc453,_0x1b84da,_0x3cb1af,_0x2400ea){const _0x1255da=a90_0x5b0dd0;return getConsoleNextUrl(_0x4bc453,_0x1255da(0x20f)+_0x1b84da+_0x1255da(0x1fe)+_0x3cb1af+'/tc/'+_0x2400ea);}export function getWorkflowUrl(_0x3113d1,_0x188e70){const _0x3d8c1c=a90_0x5b0dd0;return getConsoleUrl(_0x3113d1,_0x3d8c1c(0x23d)+_0x188e70+'/info');}export function getWorkflowSessionUrl(_0xa3fa5f,_0x342b6b,_0x7b9d81){const _0x3becda=a90_0x5b0dd0;return getConsoleUrl(_0xa3fa5f,'/app/workflows/'+_0x342b6b+_0x3becda(0x1f2)+_0x7b9d81);}export function getWorkflowAttemptUrl(_0x26c26c,_0x373598,_0xfbb68f,_0x4d2e2b){const _0xc9fd68=a90_0x5b0dd0;return getConsoleUrl(_0x26c26c,_0xc9fd68(0x23d)+_0x373598+_0xc9fd68(0x1f2)+_0xfbb68f+_0xc9fd68(0x1f8)+_0x4d2e2b);}export function getCampaignUrl(_0x2af6d6,_0x1b6fb5,_0x36da57){const _0x444bf4=a90_0x5b0dd0;return getConsoleNextUrl(_0x2af6d6,_0x444bf4(0x20e)+_0x1b6fb5+_0x444bf4(0x235)+_0x36da57);}export function getTemplateUrl(_0x4698b7,_0x444ce0,_0x79239b){const _0x350c8c=a90_0x5b0dd0;return getConsoleNextUrl(_0x4698b7,'/app/es/'+_0x444ce0+_0x350c8c(0x209)+_0x79239b+_0x350c8c(0x216));}export function getJobUrl(_0x13cb84,_0x47d6c2){const _0x40d143=a90_0x5b0dd0;return getConsoleNextUrl(_0x13cb84,_0x40d143(0x211)+_0x47d6c2+'/result');}export function getWorkspaceUrl(_0x53d2c2,_0x3e9257){const _0x299d9f=a90_0x5b0dd0;return getConsoleNextUrl(_0x53d2c2,_0x299d9f(0x20e)+_0x3e9257);}export const API_ENDPOINTS={'td':TD_ENDPOINTS,'cdp':CDP_ENDPOINTS,'workflow':WORKFLOW_ENDPOINTS,'trino':TRINO_ENDPOINTS,'llm':LLM_ENDPOINTS,'engage':ENGAGE_ENDPOINTS,'llm-proxy':LLM_PROXY_ENDPOINTS};export function getLLMProxyEndpoint(_0x30db9d){const _0x21fcb0=LLM_PROXY_ENDPOINTS[_0x30db9d];if(!_0x21fcb0)throw new Error('No\x20LLM\x20Proxy\x20endpoint\x20for\x20site:\x20'+_0x30db9d);return _0x21fcb0;}export function getEndpoint(_0xc28c4e,_0x4a5368='td'){const _0x3a8d62=a90_0x5b0dd0,_0x5d2b67=API_ENDPOINTS[_0x4a5368]?.[_0xc28c4e];if(!_0x5d2b67)throw new Error('No\x20endpoint\x20defined\x20for\x20API\x20type\x20\x27'+_0x4a5368+_0x3a8d62(0x204)+_0xc28c4e+'\x27');return _0x5d2b67;}
@@ -1 +1 @@
1
- function a91_0x1fd5(_0x3eb4e2,_0x55c5d3){_0x3eb4e2=_0x3eb4e2-0xac;const _0x551ee8=a91_0x551e();let _0x1fd5e5=_0x551ee8[_0x3eb4e2];return _0x1fd5e5;}function a91_0x551e(){const _0x5eb2b2=['ownerName','312990QzVSUR','stringify','createWorkspace','launchCampaign','apiKey','workspaces','duplicateAlwaysOnCampaign','DELETE','updateTemplate','launch','POST','site','sort','301116bCPcoQ','pauseAlwaysOnCampaign','updateWorkspace','campaignType','listCampaigns','GET','1603VRrzHY','deleteCampaign','application/json','offset','PATCH','listTemplates','/api/campaigns','/always_on_campaigns','12216700xnGlcN','getTemplate','createCampaign','performAlwaysOnCampaignAction','toString','resumeAlwaysOnCampaign','request','include','resume','proxy','engage','/api/email_templates','4epxpDz','pause','/api/workspaces/','updateCampaign','deleteTemplate','pauseCampaign','resumeCampaign','/api/workspaces?','/api/campaigns?','page[limit]','13707ciuYzY','filter[status]','listAlwaysOnCampaigns','6216RWKIBw','filter[workspaceId]','2909535GUPsbK','finishAlwaysOnCampaign','216807wyfmhS','createTemplate','/api/email_templates/','7842IGiBMK','/pause','finish','/api/workspaces','status','filter[owner_user.name]','duplicateCampaign','/api/email_templates?','emailTemplates','deleteWorkspace','accessToken','updateAlwaysOnCampaign','campaigns','page[offset]','getAlwaysOnCampaign','/api/campaigns/','/always_on_campaigns/','workspaceId','name','always_on_campaigns','application/vnd.api+json','httpClient','/launch','limit','/duplicate','append'];a91_0x551e=function(){return _0x5eb2b2;};return a91_0x551e();}const a91_0x42c688=a91_0x1fd5;(function(_0x219ecd,_0x3a3555){const _0x4f2e87=a91_0x1fd5,_0x44682b=_0x219ecd();while(!![]){try{const _0x155aec=parseInt(_0x4f2e87(0xf9))/0x1+parseInt(_0x4f2e87(0xb0))/0x2+-parseInt(_0x4f2e87(0xdb))/0x3*(parseInt(_0x4f2e87(0xca))/0x4)+parseInt(_0x4f2e87(0xd9))/0x5+parseInt(_0x4f2e87(0xde))/0x6*(-parseInt(_0x4f2e87(0xb6))/0x7)+parseInt(_0x4f2e87(0xd7))/0x8*(parseInt(_0x4f2e87(0xd4))/0x9)+-parseInt(_0x4f2e87(0xbe))/0xa;if(_0x155aec===_0x3a3555)break;else _0x44682b['push'](_0x44682b['shift']());}catch(_0xd0b33c){_0x44682b['push'](_0x44682b['shift']());}}}(a91_0x551e,0x9b2c0));import{HTTPClient}from'./http-client.js';import{getEndpoint}from'../types/index.js';import{getAuthHeaders,toHeaderRecord}from'../../core/auth.js';export class EngageApiClient{[a91_0x42c688(0xf3)];constructor(_0x3eee0c){const _0x365429=a91_0x42c688,_0x34f38f=getEndpoint(_0x3eee0c[_0x365429(0xae)],_0x365429(0xc8)),_0x8b9c8=toHeaderRecord(getAuthHeaders(_0x3eee0c[_0x365429(0xae)],_0x3eee0c[_0x365429(0xfd)],_0x3eee0c[_0x365429(0xe8)]));this[_0x365429(0xf3)]=new HTTPClient(_0x34f38f,_0x8b9c8,{'proxy':_0x3eee0c[_0x365429(0xc7)]});}async[a91_0x42c688(0xb4)](_0x1f9bd3={}){const _0x485009=a91_0x42c688,_0x369450=new URLSearchParams();_0x1f9bd3[_0x485009(0xb3)]&&_0x369450[_0x485009(0xf7)]('filter[campaignType]',_0x1f9bd3[_0x485009(0xb3)]);_0x1f9bd3[_0x485009(0xe2)]&&_0x369450['append'](_0x485009(0xd5),_0x1f9bd3[_0x485009(0xe2)]);_0x1f9bd3[_0x485009(0xef)]&&_0x369450[_0x485009(0xf7)](_0x485009(0xd8),_0x1f9bd3[_0x485009(0xef)]);_0x1f9bd3[_0x485009(0xf5)]!==undefined&&_0x369450['append'](_0x485009(0xd3),_0x1f9bd3['limit'][_0x485009(0xc2)]());_0x1f9bd3[_0x485009(0xb9)]!==undefined&&_0x369450[_0x485009(0xf7)]('page[offset]',_0x1f9bd3[_0x485009(0xb9)]['toString']());_0x1f9bd3['sort']&&_0x369450[_0x485009(0xf7)](_0x485009(0xaf),_0x1f9bd3[_0x485009(0xaf)]);_0x1f9bd3[_0x485009(0xc5)]&&_0x369450[_0x485009(0xf7)](_0x485009(0xc5),_0x1f9bd3[_0x485009(0xc5)]);const _0x1d2aba=_0x369450[_0x485009(0xc2)](),_0x1a0720=_0x1d2aba?_0x485009(0xd2)+_0x1d2aba:_0x485009(0xbc);return await this[_0x485009(0xf3)][_0x485009(0xc4)](_0x485009(0xb5),_0x1a0720,{'headers':{'Accept':'application/vnd.api+json'}});}async['getCampaign'](_0x92890){const _0x49d169=a91_0x42c688;return await this[_0x49d169(0xf3)][_0x49d169(0xc4)](_0x49d169(0xb5),'/api/campaigns/'+encodeURIComponent(_0x92890),{'headers':{'Accept':_0x49d169(0xf2)}});}async[a91_0x42c688(0xc0)](_0x12f6b1){const _0x24edaf=a91_0x42c688,_0x32e46f={'data':{'type':_0x24edaf(0xea),'attributes':_0x12f6b1}};return await this[_0x24edaf(0xf3)]['request'](_0x24edaf(0xad),_0x24edaf(0xbc),{'headers':{'Content-Type':'application/vnd.api+json','Accept':_0x24edaf(0xf2)},'body':JSON['stringify'](_0x32e46f)});}async[a91_0x42c688(0xcd)](_0x5e56df,_0x448fec){const _0x2ad66c=a91_0x42c688,_0x36303e={'data':{'type':'campaigns','id':_0x5e56df,'attributes':_0x448fec}};return await this[_0x2ad66c(0xf3)]['request'](_0x2ad66c(0xba),'/api/campaigns/'+encodeURIComponent(_0x5e56df),{'headers':{'Content-Type':_0x2ad66c(0xf2),'Accept':_0x2ad66c(0xf2)},'body':JSON['stringify'](_0x36303e)});}async[a91_0x42c688(0xb7)](_0x1d965c){const _0x4952a8=a91_0x42c688;await this['httpClient'][_0x4952a8(0xc4)](_0x4952a8(0x100),_0x4952a8(0xed)+encodeURIComponent(_0x1d965c),{'headers':{'Accept':'application/vnd.api+json'}});}async[a91_0x42c688(0xfc)](_0x3fe339){const _0x27e07d=a91_0x42c688;await this[_0x27e07d(0xf3)][_0x27e07d(0xc4)](_0x27e07d(0xad),'/api/campaigns/'+encodeURIComponent(_0x3fe339)+_0x27e07d(0xf4),{'headers':{'Content-Type':'application/json','Accept':_0x27e07d(0xb8)},'body':JSON[_0x27e07d(0xfa)]({})});}async[a91_0x42c688(0xcf)](_0x33ad9a){const _0x30e19d=a91_0x42c688;await this[_0x30e19d(0xf3)]['request']('POST','/api/campaigns/'+encodeURIComponent(_0x33ad9a)+_0x30e19d(0xdf),{'headers':{'Content-Type':_0x30e19d(0xb8),'Accept':_0x30e19d(0xb8)},'body':JSON[_0x30e19d(0xfa)]({})});}async[a91_0x42c688(0xd0)](_0x2459ff){const _0x5f4dee=a91_0x42c688;await this[_0x5f4dee(0xf3)]['request'](_0x5f4dee(0xad),_0x5f4dee(0xed)+encodeURIComponent(_0x2459ff)+'/resume',{'headers':{'Content-Type':_0x5f4dee(0xb8),'Accept':_0x5f4dee(0xb8)},'body':JSON[_0x5f4dee(0xfa)]({})});}async[a91_0x42c688(0xe4)](_0x30bd58){const _0x4c9817=a91_0x42c688;return await this[_0x4c9817(0xf3)][_0x4c9817(0xc4)]('POST',_0x4c9817(0xed)+encodeURIComponent(_0x30bd58)+_0x4c9817(0xf6),{'headers':{'Content-Type':_0x4c9817(0xb8),'Accept':_0x4c9817(0xf2)},'body':JSON[_0x4c9817(0xfa)]({})});}async[a91_0x42c688(0xbb)](_0x5dbecf={}){const _0x4d0cd0=a91_0x42c688,_0x123886=new URLSearchParams();_0x5dbecf[_0x4d0cd0(0xef)]&&_0x123886[_0x4d0cd0(0xf7)](_0x4d0cd0(0xd8),_0x5dbecf['workspaceId']);_0x5dbecf['limit']!==undefined&&_0x123886['append'](_0x4d0cd0(0xd3),_0x5dbecf['limit']['toString']());_0x5dbecf[_0x4d0cd0(0xb9)]!==undefined&&_0x123886[_0x4d0cd0(0xf7)](_0x4d0cd0(0xeb),_0x5dbecf['offset'][_0x4d0cd0(0xc2)]());_0x5dbecf[_0x4d0cd0(0xaf)]&&_0x123886['append'](_0x4d0cd0(0xaf),_0x5dbecf[_0x4d0cd0(0xaf)]);const _0x410b4b=_0x123886[_0x4d0cd0(0xc2)](),_0x529cef=_0x410b4b?_0x4d0cd0(0xe5)+_0x410b4b:_0x4d0cd0(0xc9);return await this['httpClient'][_0x4d0cd0(0xc4)](_0x4d0cd0(0xb5),_0x529cef,{'headers':{'Accept':_0x4d0cd0(0xf2)}});}async[a91_0x42c688(0xbf)](_0x5cecff){const _0x53c6f8=a91_0x42c688;return await this[_0x53c6f8(0xf3)]['request'](_0x53c6f8(0xb5),_0x53c6f8(0xdd)+encodeURIComponent(_0x5cecff),{'headers':{'Accept':_0x53c6f8(0xf2)}});}async[a91_0x42c688(0xdc)](_0x19170e){const _0x56801d=a91_0x42c688,_0x15ee4b={'data':{'type':_0x56801d(0xe6),'attributes':_0x19170e}};return await this['httpClient']['request']('POST','/api/email_templates',{'headers':{'Content-Type':'application/vnd.api+json','Accept':_0x56801d(0xf2)},'body':JSON['stringify'](_0x15ee4b)});}async[a91_0x42c688(0x101)](_0xe43075,_0x592c16){const _0x25dcf0=a91_0x42c688,_0x5e0b9d={'data':{'type':_0x25dcf0(0xe6),'id':_0xe43075,'attributes':_0x592c16}};return await this[_0x25dcf0(0xf3)][_0x25dcf0(0xc4)](_0x25dcf0(0xba),_0x25dcf0(0xdd)+encodeURIComponent(_0xe43075),{'headers':{'Content-Type':_0x25dcf0(0xf2),'Accept':_0x25dcf0(0xf2)},'body':JSON[_0x25dcf0(0xfa)](_0x5e0b9d)});}async[a91_0x42c688(0xce)](_0x11400e){const _0x1a3f48=a91_0x42c688;await this[_0x1a3f48(0xf3)][_0x1a3f48(0xc4)](_0x1a3f48(0x100),_0x1a3f48(0xdd)+encodeURIComponent(_0x11400e),{'headers':{'Accept':_0x1a3f48(0xf2)}});}async['listWorkspaces'](_0x56f11f={}){const _0x1914b0=a91_0x42c688,_0x282e7f=new URLSearchParams();_0x56f11f[_0x1914b0(0xf0)]&&_0x282e7f['append']('filter[name]',_0x56f11f[_0x1914b0(0xf0)]);_0x56f11f['ownerName']&&_0x282e7f[_0x1914b0(0xf7)](_0x1914b0(0xe3),_0x56f11f[_0x1914b0(0xf8)]);_0x56f11f[_0x1914b0(0xf5)]!==undefined&&_0x282e7f[_0x1914b0(0xf7)](_0x1914b0(0xd3),_0x56f11f[_0x1914b0(0xf5)][_0x1914b0(0xc2)]());_0x56f11f[_0x1914b0(0xb9)]!==undefined&&_0x282e7f[_0x1914b0(0xf7)](_0x1914b0(0xeb),_0x56f11f[_0x1914b0(0xb9)][_0x1914b0(0xc2)]());_0x56f11f[_0x1914b0(0xaf)]&&_0x282e7f[_0x1914b0(0xf7)](_0x1914b0(0xaf),_0x56f11f[_0x1914b0(0xaf)]);const _0x824ef=_0x282e7f[_0x1914b0(0xc2)](),_0x4fc270=_0x824ef?_0x1914b0(0xd1)+_0x824ef:_0x1914b0(0xe1);return await this[_0x1914b0(0xf3)][_0x1914b0(0xc4)]('GET',_0x4fc270,{'headers':{'Accept':_0x1914b0(0xf2)}});}async['getWorkspace'](_0x7439fe){const _0x39e36b=a91_0x42c688;return await this[_0x39e36b(0xf3)][_0x39e36b(0xc4)]('GET',_0x39e36b(0xcc)+encodeURIComponent(_0x7439fe),{'headers':{'Accept':_0x39e36b(0xf2)}});}async[a91_0x42c688(0xfb)](_0x1d7ef2){const _0xaad60=a91_0x42c688,_0x370216={'data':{'type':_0xaad60(0xfe),'attributes':_0x1d7ef2}};return await this[_0xaad60(0xf3)][_0xaad60(0xc4)](_0xaad60(0xad),_0xaad60(0xe1),{'headers':{'Content-Type':_0xaad60(0xf2),'Accept':_0xaad60(0xf2)},'body':JSON[_0xaad60(0xfa)](_0x370216)});}async[a91_0x42c688(0xb2)](_0x305350,_0x5efdb5){const _0x1d44c9=a91_0x42c688,_0xa37864={'data':{'type':_0x1d44c9(0xfe),'id':_0x305350,'attributes':_0x5efdb5}};return await this[_0x1d44c9(0xf3)][_0x1d44c9(0xc4)](_0x1d44c9(0xba),_0x1d44c9(0xcc)+encodeURIComponent(_0x305350),{'headers':{'Content-Type':_0x1d44c9(0xf2),'Accept':'application/vnd.api+json'},'body':JSON[_0x1d44c9(0xfa)](_0xa37864)});}async[a91_0x42c688(0xe7)](_0x42d4d1){const _0x521227=a91_0x42c688;await this[_0x521227(0xf3)]['request']('DELETE',_0x521227(0xcc)+encodeURIComponent(_0x42d4d1),{'headers':{'Accept':'application/vnd.api+json'}});}async[a91_0x42c688(0xd6)](_0x2180c4,_0x1a6567={}){const _0x5db718=a91_0x42c688,_0x54bf1c=new URLSearchParams();_0x1a6567[_0x5db718(0xb3)]&&_0x54bf1c[_0x5db718(0xf7)]('filter[campaignType]',_0x1a6567[_0x5db718(0xb3)]);_0x1a6567[_0x5db718(0xe2)]&&_0x54bf1c['append']('filter[status]',_0x1a6567[_0x5db718(0xe2)]);_0x1a6567[_0x5db718(0xf5)]!==undefined&&_0x54bf1c[_0x5db718(0xf7)]('page[limit]',_0x1a6567[_0x5db718(0xf5)][_0x5db718(0xc2)]());_0x1a6567['offset']!==undefined&&_0x54bf1c[_0x5db718(0xf7)](_0x5db718(0xeb),_0x1a6567[_0x5db718(0xb9)][_0x5db718(0xc2)]());_0x1a6567[_0x5db718(0xaf)]&&_0x54bf1c[_0x5db718(0xf7)]('sort',_0x1a6567['sort']);const _0x37f08a=_0x54bf1c['toString'](),_0x3159dd=_0x5db718(0xcc)+encodeURIComponent(_0x2180c4)+_0x5db718(0xbd)+(_0x37f08a?'?'+_0x37f08a:'');return await this[_0x5db718(0xf3)][_0x5db718(0xc4)](_0x5db718(0xb5),_0x3159dd,{'headers':{'Accept':'application/vnd.api+json'}});}async[a91_0x42c688(0xec)](_0x15e886,_0x58d3e6){const _0x37e737=a91_0x42c688;return await this['httpClient'][_0x37e737(0xc4)]('GET',_0x37e737(0xcc)+encodeURIComponent(_0x15e886)+_0x37e737(0xee)+encodeURIComponent(_0x58d3e6),{'headers':{'Accept':_0x37e737(0xf2)}});}async['createAlwaysOnCampaign'](_0x4ab96a,_0x5ed92c){const _0x51876a=a91_0x42c688,_0x1549af={'data':{'type':'always_on_campaigns','attributes':_0x5ed92c}};return await this['httpClient'][_0x51876a(0xc4)](_0x51876a(0xad),'/api/workspaces/'+encodeURIComponent(_0x4ab96a)+_0x51876a(0xbd),{'headers':{'Content-Type':_0x51876a(0xf2),'Accept':_0x51876a(0xf2)},'body':JSON[_0x51876a(0xfa)](_0x1549af)});}async[a91_0x42c688(0xe9)](_0x415101,_0x270cf0,_0x3e18fa){const _0x76d4d=a91_0x42c688,_0x4ef3ba={'data':{'type':_0x76d4d(0xf1),'id':_0x270cf0,'attributes':_0x3e18fa}};return await this[_0x76d4d(0xf3)][_0x76d4d(0xc4)](_0x76d4d(0xba),_0x76d4d(0xcc)+encodeURIComponent(_0x415101)+_0x76d4d(0xee)+encodeURIComponent(_0x270cf0),{'headers':{'Content-Type':'application/vnd.api+json','Accept':_0x76d4d(0xf2)},'body':JSON[_0x76d4d(0xfa)](_0x4ef3ba)});}async['deleteAlwaysOnCampaign'](_0x41d7ab,_0x27a126){const _0x178d9b=a91_0x42c688;await this[_0x178d9b(0xf3)][_0x178d9b(0xc4)](_0x178d9b(0x100),_0x178d9b(0xcc)+encodeURIComponent(_0x41d7ab)+_0x178d9b(0xee)+encodeURIComponent(_0x27a126),{'headers':{'Accept':_0x178d9b(0xf2)}});}async[a91_0x42c688(0xc1)](_0x36e19e,_0x54c80f,_0x5e970e){const _0x2b6253=a91_0x42c688;await this[_0x2b6253(0xf3)][_0x2b6253(0xc4)](_0x2b6253(0xad),_0x2b6253(0xcc)+encodeURIComponent(_0x36e19e)+_0x2b6253(0xee)+encodeURIComponent(_0x54c80f)+'/'+_0x5e970e,{'headers':{'Content-Type':_0x2b6253(0xb8),'Accept':_0x2b6253(0xb8)},'body':JSON[_0x2b6253(0xfa)]({})});}async['launchAlwaysOnCampaign'](_0x406091,_0x3516cd){const _0x41c7ca=a91_0x42c688;await this['performAlwaysOnCampaignAction'](_0x406091,_0x3516cd,_0x41c7ca(0xac));}async[a91_0x42c688(0xb1)](_0x21e6ef,_0x387be4){const _0x502bbc=a91_0x42c688;await this[_0x502bbc(0xc1)](_0x21e6ef,_0x387be4,_0x502bbc(0xcb));}async[a91_0x42c688(0xc3)](_0x54b6f0,_0xca652){const _0x4bd172=a91_0x42c688;await this['performAlwaysOnCampaignAction'](_0x54b6f0,_0xca652,_0x4bd172(0xc6));}async[a91_0x42c688(0xda)](_0x29f5a6,_0x195305){const _0x16d444=a91_0x42c688;await this[_0x16d444(0xc1)](_0x29f5a6,_0x195305,_0x16d444(0xe0));}async[a91_0x42c688(0xff)](_0x3de517,_0x584971,_0x40e3dd){const _0x55e87b=a91_0x42c688,_0x40160c=_0x40e3dd?{'data':{'attributes':{'name':_0x40e3dd}}}:{};return await this[_0x55e87b(0xf3)][_0x55e87b(0xc4)](_0x55e87b(0xad),'/api/workspaces/'+encodeURIComponent(_0x3de517)+_0x55e87b(0xee)+encodeURIComponent(_0x584971)+'/duplicate',{'headers':{'Content-Type':_0x55e87b(0xb8),'Accept':_0x55e87b(0xf2)},'body':JSON[_0x55e87b(0xfa)](_0x40160c)});}}
1
+ const a91_0x4eac4b=a91_0x39ee;(function(_0x107668,_0x5c5413){const _0x2bb48b=a91_0x39ee,_0x2dcce9=_0x107668();while(!![]){try{const _0x1f3822=parseInt(_0x2bb48b(0x118))/0x1*(parseInt(_0x2bb48b(0xf7))/0x2)+-parseInt(_0x2bb48b(0xf1))/0x3*(parseInt(_0x2bb48b(0xe3))/0x4)+-parseInt(_0x2bb48b(0xe9))/0x5*(parseInt(_0x2bb48b(0x107))/0x6)+parseInt(_0x2bb48b(0x126))/0x7*(-parseInt(_0x2bb48b(0x12b))/0x8)+-parseInt(_0x2bb48b(0xf5))/0x9*(-parseInt(_0x2bb48b(0x10e))/0xa)+-parseInt(_0x2bb48b(0x117))/0xb*(parseInt(_0x2bb48b(0xf9))/0xc)+parseInt(_0x2bb48b(0xfb))/0xd;if(_0x1f3822===_0x5c5413)break;else _0x2dcce9['push'](_0x2dcce9['shift']());}catch(_0x192854){_0x2dcce9['push'](_0x2dcce9['shift']());}}}(a91_0x3eed,0xad968));import{HTTPClient}from'./http-client.js';function a91_0x39ee(_0x41ac44,_0x5cf1fd){_0x41ac44=_0x41ac44-0xdc;const _0x3eed00=a91_0x3eed();let _0x39ee2b=_0x3eed00[_0x41ac44];return _0x39ee2b;}import{getEndpoint}from'../types/index.js';import{getAuthHeaders,toHeaderRecord}from'../../core/auth.js';export class EngageApiClient{[a91_0x4eac4b(0x121)];constructor(_0xa12f03){const _0x1ca371=a91_0x4eac4b,_0x2fe9bd=getEndpoint(_0xa12f03['site'],_0x1ca371(0x115)),_0x1056ac=toHeaderRecord(getAuthHeaders(_0xa12f03[_0x1ca371(0x124)],_0xa12f03['apiKey'],_0xa12f03[_0x1ca371(0x10c)]));this[_0x1ca371(0x121)]=new HTTPClient(_0x2fe9bd,_0x1056ac,{'proxy':_0xa12f03[_0x1ca371(0xe4)]});}async[a91_0x4eac4b(0x100)](_0x1c90de={}){const _0x148239=a91_0x4eac4b,_0x4c8f58=new URLSearchParams();_0x1c90de[_0x148239(0xe8)]&&_0x4c8f58[_0x148239(0xe5)](_0x148239(0x109),_0x1c90de['campaignType']);_0x1c90de[_0x148239(0xf0)]&&_0x4c8f58[_0x148239(0xe5)](_0x148239(0x127),_0x1c90de[_0x148239(0xf0)]);_0x1c90de[_0x148239(0xef)]&&_0x4c8f58[_0x148239(0xe5)](_0x148239(0xeb),_0x1c90de['workspaceId']);_0x1c90de[_0x148239(0xea)]!==undefined&&_0x4c8f58[_0x148239(0xe5)](_0x148239(0x10b),_0x1c90de[_0x148239(0xea)]['toString']());_0x1c90de[_0x148239(0x129)]!==undefined&&_0x4c8f58[_0x148239(0xe5)]('page[offset]',_0x1c90de[_0x148239(0x129)][_0x148239(0xe0)]());_0x1c90de['sort']&&_0x4c8f58[_0x148239(0xe5)](_0x148239(0x131),_0x1c90de[_0x148239(0x131)]);_0x1c90de[_0x148239(0xe1)]&&_0x4c8f58[_0x148239(0xe5)](_0x148239(0xe1),_0x1c90de[_0x148239(0xe1)]);const _0x33b8fd=_0x4c8f58['toString'](),_0x244598=_0x33b8fd?_0x148239(0xf8)+_0x33b8fd:_0x148239(0xde);return await this[_0x148239(0x121)][_0x148239(0x125)]('GET',_0x244598,{'headers':{'Accept':_0x148239(0x113)}});}async[a91_0x4eac4b(0xfe)](_0x5d36b4){const _0x20e2f2=a91_0x4eac4b;return await this[_0x20e2f2(0x121)][_0x20e2f2(0x125)]('GET','/api/campaigns/'+encodeURIComponent(_0x5d36b4),{'headers':{'Accept':_0x20e2f2(0x113)}});}async[a91_0x4eac4b(0xfc)](_0x4a72c6){const _0x2120f6=a91_0x4eac4b,_0x22eea0={'data':{'type':'campaigns','attributes':_0x4a72c6}};return await this[_0x2120f6(0x121)][_0x2120f6(0x125)](_0x2120f6(0x105),_0x2120f6(0xde),{'headers':{'Content-Type':'application/vnd.api+json','Accept':'application/vnd.api+json'},'body':JSON[_0x2120f6(0x11a)](_0x22eea0)});}async[a91_0x4eac4b(0x12e)](_0x3d2c67,_0x7808bc){const _0x5a6a59=a91_0x4eac4b,_0x939b27={'data':{'type':'campaigns','id':_0x3d2c67,'attributes':_0x7808bc}};return await this[_0x5a6a59(0x121)][_0x5a6a59(0x125)]('PATCH',_0x5a6a59(0x101)+encodeURIComponent(_0x3d2c67),{'headers':{'Content-Type':'application/vnd.api+json','Accept':_0x5a6a59(0x113)},'body':JSON[_0x5a6a59(0x11a)](_0x939b27)});}async[a91_0x4eac4b(0xed)](_0x244633){const _0xc62a5=a91_0x4eac4b;await this[_0xc62a5(0x121)][_0xc62a5(0x125)](_0xc62a5(0x130),'/api/campaigns/'+encodeURIComponent(_0x244633),{'headers':{'Accept':_0xc62a5(0x113)}});}async[a91_0x4eac4b(0xf6)](_0x12d761){const _0x3353b2=a91_0x4eac4b;await this[_0x3353b2(0x121)]['request'](_0x3353b2(0x105),_0x3353b2(0x101)+encodeURIComponent(_0x12d761)+_0x3353b2(0x120),{'headers':{'Content-Type':_0x3353b2(0xfa),'Accept':_0x3353b2(0xfa)},'body':JSON[_0x3353b2(0x11a)]({})});}async['pauseCampaign'](_0x540da9){const _0x2f509f=a91_0x4eac4b;await this[_0x2f509f(0x121)][_0x2f509f(0x125)](_0x2f509f(0x105),_0x2f509f(0x101)+encodeURIComponent(_0x540da9)+_0x2f509f(0x111),{'headers':{'Content-Type':_0x2f509f(0xfa),'Accept':'application/json'},'body':JSON[_0x2f509f(0x11a)]({})});}async[a91_0x4eac4b(0xe6)](_0x139128){const _0x26c6a8=a91_0x4eac4b;await this[_0x26c6a8(0x121)][_0x26c6a8(0x125)](_0x26c6a8(0x105),'/api/campaigns/'+encodeURIComponent(_0x139128)+'/resume',{'headers':{'Content-Type':'application/json','Accept':_0x26c6a8(0xfa)},'body':JSON['stringify']({})});}async[a91_0x4eac4b(0xe7)](_0x51605a){const _0x407a8d=a91_0x4eac4b;return await this[_0x407a8d(0x121)][_0x407a8d(0x125)](_0x407a8d(0x105),'/api/campaigns/'+encodeURIComponent(_0x51605a)+'/duplicate',{'headers':{'Content-Type':_0x407a8d(0xfa),'Accept':_0x407a8d(0x113)},'body':JSON[_0x407a8d(0x11a)]({})});}async[a91_0x4eac4b(0x108)](_0x15e1f4={}){const _0x139560=a91_0x4eac4b,_0x5b9696=new URLSearchParams();_0x15e1f4[_0x139560(0xef)]&&_0x5b9696['append'](_0x139560(0xeb),_0x15e1f4['workspaceId']);_0x15e1f4[_0x139560(0xea)]!==undefined&&_0x5b9696['append'](_0x139560(0x10b),_0x15e1f4['limit'][_0x139560(0xe0)]());_0x15e1f4[_0x139560(0x129)]!==undefined&&_0x5b9696[_0x139560(0xe5)](_0x139560(0xdf),_0x15e1f4[_0x139560(0x129)][_0x139560(0xe0)]());_0x15e1f4[_0x139560(0x131)]&&_0x5b9696['append'](_0x139560(0x131),_0x15e1f4['sort']);const _0x1ff80f=_0x5b9696[_0x139560(0xe0)](),_0x37fb2b=_0x1ff80f?_0x139560(0x128)+_0x1ff80f:_0x139560(0xdd);return await this[_0x139560(0x121)][_0x139560(0x125)](_0x139560(0x116),_0x37fb2b,{'headers':{'Accept':'application/vnd.api+json'}});}async[a91_0x4eac4b(0x11d)](_0xc5f61d){const _0x8e1339=a91_0x4eac4b;return await this[_0x8e1339(0x121)][_0x8e1339(0x125)](_0x8e1339(0x116),_0x8e1339(0x11b)+encodeURIComponent(_0xc5f61d),{'headers':{'Accept':_0x8e1339(0x113)}});}async[a91_0x4eac4b(0x112)](_0x4271be){const _0x2c4a60=a91_0x4eac4b,_0xe1d7a0={'data':{'type':'emailTemplates','attributes':_0x4271be}};return await this[_0x2c4a60(0x121)][_0x2c4a60(0x125)](_0x2c4a60(0x105),'/api/email_templates',{'headers':{'Content-Type':_0x2c4a60(0x113),'Accept':_0x2c4a60(0x113)},'body':JSON[_0x2c4a60(0x11a)](_0xe1d7a0)});}async[a91_0x4eac4b(0x110)](_0x290fa0,_0x8ab8ff){const _0x17d2c6=a91_0x4eac4b,_0x3d0ab2={'data':{'type':_0x17d2c6(0x12f),'id':_0x290fa0,'attributes':_0x8ab8ff}};return await this[_0x17d2c6(0x121)][_0x17d2c6(0x125)](_0x17d2c6(0xfd),_0x17d2c6(0x11b)+encodeURIComponent(_0x290fa0),{'headers':{'Content-Type':_0x17d2c6(0x113),'Accept':_0x17d2c6(0x113)},'body':JSON[_0x17d2c6(0x11a)](_0x3d0ab2)});}async['deleteTemplate'](_0x2ddfe1){const _0x55f987=a91_0x4eac4b;await this[_0x55f987(0x121)][_0x55f987(0x125)](_0x55f987(0x130),'/api/email_templates/'+encodeURIComponent(_0x2ddfe1),{'headers':{'Accept':_0x55f987(0x113)}});}async[a91_0x4eac4b(0xff)](_0x1ca7a9={}){const _0x32c83a=a91_0x4eac4b,_0x18919b=new URLSearchParams();_0x1ca7a9[_0x32c83a(0xf2)]&&_0x18919b['append'](_0x32c83a(0x119),_0x1ca7a9[_0x32c83a(0xf2)]);_0x1ca7a9['ownerName']&&_0x18919b[_0x32c83a(0xe5)](_0x32c83a(0x11f),_0x1ca7a9[_0x32c83a(0x10f)]);_0x1ca7a9[_0x32c83a(0xea)]!==undefined&&_0x18919b[_0x32c83a(0xe5)](_0x32c83a(0x10b),_0x1ca7a9[_0x32c83a(0xea)][_0x32c83a(0xe0)]());_0x1ca7a9['offset']!==undefined&&_0x18919b[_0x32c83a(0xe5)](_0x32c83a(0xdf),_0x1ca7a9[_0x32c83a(0x129)][_0x32c83a(0xe0)]());_0x1ca7a9[_0x32c83a(0x131)]&&_0x18919b[_0x32c83a(0xe5)](_0x32c83a(0x131),_0x1ca7a9[_0x32c83a(0x131)]);const _0x1d8d50=_0x18919b[_0x32c83a(0xe0)](),_0x3a0fae=_0x1d8d50?_0x32c83a(0x10d)+_0x1d8d50:_0x32c83a(0xee);return await this[_0x32c83a(0x121)][_0x32c83a(0x125)]('GET',_0x3a0fae,{'headers':{'Accept':_0x32c83a(0x113)}});}async[a91_0x4eac4b(0xec)](_0x53c511){const _0x306db0=a91_0x4eac4b;return await this['httpClient']['request'](_0x306db0(0x116),_0x306db0(0xdc)+encodeURIComponent(_0x53c511),{'headers':{'Accept':_0x306db0(0x113)}});}async[a91_0x4eac4b(0x114)](_0x3213e9){const _0x11a48e=a91_0x4eac4b,_0x310433={'data':{'type':'workspaces','attributes':_0x3213e9}};return await this[_0x11a48e(0x121)][_0x11a48e(0x125)]('POST',_0x11a48e(0xee),{'headers':{'Content-Type':'application/vnd.api+json','Accept':'application/vnd.api+json'},'body':JSON['stringify'](_0x310433)});}async['updateWorkspace'](_0x56ee72,_0xd40285){const _0x26c9eb=a91_0x4eac4b,_0x53e6ee={'data':{'type':'workspaces','id':_0x56ee72,'attributes':_0xd40285}};return await this[_0x26c9eb(0x121)]['request'](_0x26c9eb(0xfd),_0x26c9eb(0xdc)+encodeURIComponent(_0x56ee72),{'headers':{'Content-Type':_0x26c9eb(0x113),'Accept':_0x26c9eb(0x113)},'body':JSON['stringify'](_0x53e6ee)});}async[a91_0x4eac4b(0x12c)](_0x812132){const _0x6f3d0e=a91_0x4eac4b;await this[_0x6f3d0e(0x121)][_0x6f3d0e(0x125)](_0x6f3d0e(0x130),'/api/workspaces/'+encodeURIComponent(_0x812132),{'headers':{'Accept':_0x6f3d0e(0x113)}});}async['listAlwaysOnCampaigns'](_0x149421,_0x3e4e88={}){const _0x4c65a0=a91_0x4eac4b,_0x101c3c=new URLSearchParams();_0x3e4e88[_0x4c65a0(0xe8)]&&_0x101c3c[_0x4c65a0(0xe5)](_0x4c65a0(0x109),_0x3e4e88[_0x4c65a0(0xe8)]);_0x3e4e88['status']&&_0x101c3c[_0x4c65a0(0xe5)](_0x4c65a0(0x127),_0x3e4e88[_0x4c65a0(0xf0)]);_0x3e4e88['limit']!==undefined&&_0x101c3c[_0x4c65a0(0xe5)](_0x4c65a0(0x10b),_0x3e4e88[_0x4c65a0(0xea)][_0x4c65a0(0xe0)]());_0x3e4e88['offset']!==undefined&&_0x101c3c[_0x4c65a0(0xe5)](_0x4c65a0(0xdf),_0x3e4e88[_0x4c65a0(0x129)][_0x4c65a0(0xe0)]());_0x3e4e88[_0x4c65a0(0x131)]&&_0x101c3c[_0x4c65a0(0xe5)]('sort',_0x3e4e88[_0x4c65a0(0x131)]);const _0x21ad1a=_0x101c3c[_0x4c65a0(0xe0)](),_0x1af31d='/api/workspaces/'+encodeURIComponent(_0x149421)+'/always_on_campaigns'+(_0x21ad1a?'?'+_0x21ad1a:'');return await this[_0x4c65a0(0x121)][_0x4c65a0(0x125)](_0x4c65a0(0x116),_0x1af31d,{'headers':{'Accept':_0x4c65a0(0x113)}});}async[a91_0x4eac4b(0x11e)](_0x56bd2d,_0x158697){const _0x59462d=a91_0x4eac4b;return await this[_0x59462d(0x121)][_0x59462d(0x125)]('GET',_0x59462d(0xdc)+encodeURIComponent(_0x56bd2d)+_0x59462d(0x104)+encodeURIComponent(_0x158697),{'headers':{'Accept':_0x59462d(0x113)}});}async[a91_0x4eac4b(0x12a)](_0x533bc2,_0x534589){const _0x1d4ed1=a91_0x4eac4b,_0x598fdf={'data':{'type':_0x1d4ed1(0x12d),'attributes':_0x534589}};return await this[_0x1d4ed1(0x121)][_0x1d4ed1(0x125)](_0x1d4ed1(0x105),'/api/workspaces/'+encodeURIComponent(_0x533bc2)+_0x1d4ed1(0x103),{'headers':{'Content-Type':_0x1d4ed1(0x113),'Accept':_0x1d4ed1(0x113)},'body':JSON['stringify'](_0x598fdf)});}async['updateAlwaysOnCampaign'](_0x48ac50,_0x4dbf93,_0x46bd23){const _0x22716c=a91_0x4eac4b,_0x2989d7={'data':{'type':_0x22716c(0x12d),'id':_0x4dbf93,'attributes':_0x46bd23}};return await this[_0x22716c(0x121)][_0x22716c(0x125)]('PATCH',_0x22716c(0xdc)+encodeURIComponent(_0x48ac50)+_0x22716c(0x104)+encodeURIComponent(_0x4dbf93),{'headers':{'Content-Type':_0x22716c(0x113),'Accept':'application/vnd.api+json'},'body':JSON[_0x22716c(0x11a)](_0x2989d7)});}async[a91_0x4eac4b(0x10a)](_0x35dddd,_0x4b1dcc){const _0x17f42f=a91_0x4eac4b;await this[_0x17f42f(0x121)][_0x17f42f(0x125)]('DELETE',_0x17f42f(0xdc)+encodeURIComponent(_0x35dddd)+_0x17f42f(0x104)+encodeURIComponent(_0x4b1dcc),{'headers':{'Accept':_0x17f42f(0x113)}});}async[a91_0x4eac4b(0x102)](_0x47303e,_0x3ca726,_0x2e0a6e){const _0x235885=a91_0x4eac4b;await this['httpClient'][_0x235885(0x125)](_0x235885(0x105),_0x235885(0xdc)+encodeURIComponent(_0x47303e)+_0x235885(0x104)+encodeURIComponent(_0x3ca726)+'/'+_0x2e0a6e,{'headers':{'Content-Type':_0x235885(0xfa),'Accept':_0x235885(0xfa)},'body':JSON[_0x235885(0x11a)]({})});}async['launchAlwaysOnCampaign'](_0x31dae9,_0x4f12e9){const _0x5308f4=a91_0x4eac4b;await this[_0x5308f4(0x102)](_0x31dae9,_0x4f12e9,_0x5308f4(0x11c));}async[a91_0x4eac4b(0xe2)](_0x4ffe15,_0x246f2c){const _0x1f09c5=a91_0x4eac4b;await this[_0x1f09c5(0x102)](_0x4ffe15,_0x246f2c,_0x1f09c5(0xf3));}async['resumeAlwaysOnCampaign'](_0x526fa3,_0x2bedfc){const _0x2c5a12=a91_0x4eac4b;await this['performAlwaysOnCampaignAction'](_0x526fa3,_0x2bedfc,_0x2c5a12(0x106));}async[a91_0x4eac4b(0x122)](_0x1f682c,_0x3e24ca){const _0x5e6c5a=a91_0x4eac4b;await this[_0x5e6c5a(0x102)](_0x1f682c,_0x3e24ca,_0x5e6c5a(0x123));}async[a91_0x4eac4b(0xf4)](_0x314d15,_0x26ee16,_0x307805){const _0x41c237=a91_0x4eac4b,_0x29c31b=_0x307805?{'data':{'attributes':{'name':_0x307805}}}:{};return await this['httpClient'][_0x41c237(0x125)](_0x41c237(0x105),'/api/workspaces/'+encodeURIComponent(_0x314d15)+_0x41c237(0x104)+encodeURIComponent(_0x26ee16)+'/duplicate',{'headers':{'Content-Type':_0x41c237(0xfa),'Accept':_0x41c237(0x113)},'body':JSON['stringify'](_0x29c31b)});}}function a91_0x3eed(){const _0x87d80b=['application/json','9149816ibsuRb','createCampaign','PATCH','getCampaign','listWorkspaces','listCampaigns','/api/campaigns/','performAlwaysOnCampaignAction','/always_on_campaigns','/always_on_campaigns/','POST','resume','7375734RcTjSG','listTemplates','filter[campaignType]','deleteAlwaysOnCampaign','page[limit]','accessToken','/api/workspaces?','20QTtmKH','ownerName','updateTemplate','/pause','createTemplate','application/vnd.api+json','createWorkspace','engage','GET','22OtaVBn','520733fGQuxd','filter[name]','stringify','/api/email_templates/','launch','getTemplate','getAlwaysOnCampaign','filter[owner_user.name]','/launch','httpClient','finishAlwaysOnCampaign','finish','site','request','554981msWRbT','filter[status]','/api/email_templates?','offset','createAlwaysOnCampaign','8kWYaun','deleteWorkspace','always_on_campaigns','updateCampaign','emailTemplates','DELETE','sort','/api/workspaces/','/api/email_templates','/api/campaigns','page[offset]','toString','include','pauseAlwaysOnCampaign','3230800izwUox','proxy','append','resumeCampaign','duplicateCampaign','campaignType','5dnKKzm','limit','filter[workspaceId]','getWorkspace','deleteCampaign','/api/workspaces','workspaceId','status','3EuWwuD','name','pause','duplicateAlwaysOnCampaign','6077772ayuIEn','launchCampaign','4PoLRmo','/api/campaigns?','1611756NDYdVD'];a91_0x3eed=function(){return _0x87d80b;};return a91_0x3eed();}
@@ -1 +1 @@
1
- const a92_0x9fb2b4=a92_0x1dc9;(function(_0x555870,_0x4b8c52){const _0x8548=a92_0x1dc9,_0x502559=_0x555870();while(!![]){try{const _0x57773e=parseInt(_0x8548(0x94))/0x1+-parseInt(_0x8548(0xa1))/0x2*(-parseInt(_0x8548(0x97))/0x3)+parseInt(_0x8548(0xab))/0x4*(parseInt(_0x8548(0xe7))/0x5)+-parseInt(_0x8548(0xeb))/0x6*(-parseInt(_0x8548(0xcb))/0x7)+parseInt(_0x8548(0xdb))/0x8*(parseInt(_0x8548(0xbf))/0x9)+parseInt(_0x8548(0xae))/0xa+parseInt(_0x8548(0xd3))/0xb*(-parseInt(_0x8548(0xb7))/0xc);if(_0x57773e===_0x4b8c52)break;else _0x502559['push'](_0x502559['shift']());}catch(_0x39cb46){_0x502559['push'](_0x502559['shift']());}}}(a92_0x2c9d,0xcf0c3));import{ErrorCode,SDKError}from'../errors.js';function a92_0x2c9d(){const _0x149dac=['detail','code','pow','Request\x20to\x20','status','parseProblemDetails','Request\x20cancelled\x20by\x20user','text','min','application/json','14YSSYtZ','Failed\x20to\x20connect\x20through\x20proxy\x20','already\x20running','about:blank','proxy','tunnel',']:\x20','json','3361567dCtNNe','signal','message','PERMISSION_DENIED','maxDelay','toLowerCase','length','Error','641392xLieAv','maxRetries','extractErrorMessage','UNAVAILABLE','safeParseJSON','PROXY_CONNECTION_FAILURE','trace','baseUrl','severity','logger','INVALID_ARGUMENT','get','2060UlbClu','proxyUrl','type','parse','3307038CFfVxf','ms...','****','abort','forEach','random','push','Retry-After','problemDetails','addEventListener','\x20failed:\x20','username','proxyReady','body','isProxyConnectionError','handleErrorResponse','cause','status_code','dispatcher','headers','[binary\x20data]','746529lcYBfQ','string','error','568803KFqKlG','instance','errors','NOT_FOUND','request\x20body:\x20','[Retry\x20','Request\x20failed\x20after\x20retries','Error\x20response\x20body:\x20','Content-Type','sleep','4TJGarT','arraybuffer','aborted','stringify','arrayBuffer','retrying\x20in\x20','title','then','defaultHeaders','password','4516totGgi','warn','maskProxyCredentials','3137990JuFIXG','407','PROXY','info','Unknown\x20error','\x0a\x20\x20Details:\x20','combineSignals','HTTP_REQUEST_FAILURE','tdx.client.http','132JWqwGq','Response\x20[','includes','An\x20error\x20occurred','round','requestSSE','name','retryConfig','135NCGgjL','debug'];a92_0x2c9d=function(){return _0x149dac;};return a92_0x2c9d();}import{Logger}from'../../utils/logger/index.js';import a92_0x5d0100 from'json-bigint';function a92_0x1dc9(_0x3cd6d8,_0x3418cc){_0x3cd6d8=_0x3cd6d8-0x8b;const _0x2c9d02=a92_0x2c9d();let _0x1dc9e3=_0x2c9d02[_0x3cd6d8];return _0x1dc9e3;}function getErrorChain(_0x3e09fb,_0x455c99=0x5){const _0x1ec7d4=a92_0x1dc9,_0x446d2f=[_0x3e09fb];let _0x1a089b=_0x3e09fb;for(let _0xc260cd=0x0;_0xc260cd<_0x455c99&&_0x1a089b;_0xc260cd++){const _0x5f4634=_0x1a089b['cause'];if(_0x5f4634 instanceof Error)_0x446d2f[_0x1ec7d4(0xf1)](_0x5f4634),_0x1a089b=_0x5f4634;else break;}return _0x446d2f;}function extractRootCause(_0x5a423e){const _0x2f0e5a=a92_0x1dc9,_0x209e4c=getErrorChain(_0x5a423e,0x4),_0x5476a8=_0x209e4c[_0x209e4c['length']-0x1],_0x381c7c=_0x5476a8[_0x2f0e5a(0x8f)];if(_0x381c7c&&!(_0x381c7c instanceof Error))return String(_0x381c7c);return _0x5476a8[_0x2f0e5a(0xd5)]||_0x2f0e5a(0xb2);}const DEFAULT_RETRY_CONFIG={'maxRetries':0x3,'baseDelay':0x3e8,'maxDelay':0x1f40};function isRetryableStatus(_0x19ff58){return _0x19ff58>=0x1f4||_0x19ff58===0x1ad;}function isNonRetryable429(_0x3ba000){const _0x332167=a92_0x1dc9;return _0x3ba000[_0x332167(0xb9)](_0x332167(0xcd));}function getRetryDelay(_0x138dee,_0x5e9f14){const _0x3f4098=a92_0x1dc9,_0x49e152=Math[_0x3f4098(0xc9)](_0x5e9f14['baseDelay']*Math[_0x3f4098(0xc3)](0x2,_0x138dee),_0x5e9f14[_0x3f4098(0xd7)]);return Math[_0x3f4098(0xf0)]()*_0x49e152;}function statusCodeToErrorCode(_0x494818){const _0x278499=a92_0x1dc9;if(_0x494818===0x191)return ErrorCode['UNAUTHENTICATED'];else{if(_0x494818===0x193)return ErrorCode[_0x278499(0xd6)];else{if(_0x494818===0x194)return ErrorCode[_0x278499(0x9a)];else{if(_0x494818===0x1ad)return ErrorCode['RATE_LIMITED'];else return _0x494818>=0x1f4?ErrorCode[_0x278499(0xde)]:ErrorCode[_0x278499(0xe5)];}}}}export class HTTPClientError extends Error{['status'];[a92_0x9fb2b4(0xf3)];[a92_0x9fb2b4(0xc2)];constructor(_0x136e56,_0x221509,_0x572e6f){const _0x4acabe=a92_0x9fb2b4,_0x202062=statusCodeToErrorCode(_0x221509);super('['+_0x202062+']\x20'+_0x136e56),this[_0x4acabe(0xc5)]=_0x221509,this['problemDetails']=_0x572e6f,this[_0x4acabe(0xbd)]='HTTPClientError',this['code']=_0x202062;}}export class HTTPClient{[a92_0x9fb2b4(0xbe)];[a92_0x9fb2b4(0xe2)];[a92_0x9fb2b4(0xa9)];[a92_0x9fb2b4(0xe4)]=Logger['of'](a92_0x9fb2b4(0xb6));['dispatcher'];[a92_0x9fb2b4(0x8b)];[a92_0x9fb2b4(0xe8)];constructor(_0x5ec8d9,_0x2b2429,_0x8df3e7){const _0x1858fd=a92_0x9fb2b4;this[_0x1858fd(0xe2)]=_0x5ec8d9,this[_0x1858fd(0xa9)]=_0x2b2429,this['retryConfig']={...DEFAULT_RETRY_CONFIG,..._0x8df3e7?.[_0x1858fd(0xbe)]},_0x8df3e7?.[_0x1858fd(0xcf)]&&(this[_0x1858fd(0xe8)]=_0x8df3e7[_0x1858fd(0xcf)],this['proxyReady']=import('undici')[_0x1858fd(0xa8)](({ProxyAgent:_0x2c1e0a})=>{const _0x2ed4b9=_0x1858fd;this[_0x2ed4b9(0x91)]=new _0x2c1e0a(_0x8df3e7[_0x2ed4b9(0xcf)]);}),this[_0x1858fd(0xe4)][_0x1858fd(0xb1)]('Using\x20proxy:\x20'+this[_0x1858fd(0xad)](_0x8df3e7[_0x1858fd(0xcf)])));}[a92_0x9fb2b4(0xad)](_0x371f25){const _0x287a86=a92_0x9fb2b4;try{const _0x234b6f=new URL(_0x371f25);return _0x234b6f[_0x287a86(0xf6)]&&(_0x234b6f[_0x287a86(0xf6)]=_0x287a86(0xed)),_0x234b6f[_0x287a86(0xaa)]&&(_0x234b6f[_0x287a86(0xaa)]=_0x287a86(0xed)),_0x234b6f['toString']();}catch{return _0x371f25;}}['isProxyConnectionError'](_0xd37168){const _0x1e2f95=a92_0x9fb2b4,_0x4eb334=getErrorChain(_0xd37168);for(const _0x15feae of _0x4eb334){const _0x3f0dd5=_0x15feae[_0x1e2f95(0xd5)]['toLowerCase'](),_0x2ae5ad=_0x15feae[_0x1e2f95(0xbd)][_0x1e2f95(0xd8)]();if(_0x3f0dd5['includes']('proxy')||_0x2ae5ad['includes']('proxy')||_0x3f0dd5['includes'](_0x1e2f95(0xd0))||_0x3f0dd5[_0x1e2f95(0xb9)](_0x1e2f95(0xaf)))return!![];if(_0x1e2f95(0xc2)in _0x15feae&&typeof _0x15feae[_0x1e2f95(0xc2)]===_0x1e2f95(0x95)){if(_0x15feae[_0x1e2f95(0xc2)][_0x1e2f95(0xb9)](_0x1e2f95(0xb0)))return!![];}}return![];}async['request'](_0xf08996,_0x2f2bdf,_0x441c93={}){const _0x253f90=a92_0x9fb2b4,{headers:headers={},body:_0x18336a,timeout:timeout=0x7530,retries:retries=this[_0x253f90(0xbe)][_0x253f90(0xdc)],signal:_0x26b5b4,includeHeaders:includeHeaders=![],responseType:responseType=_0x253f90(0xd2)}=_0x441c93,_0x29e200=''+this[_0x253f90(0xe2)]+_0x2f2bdf;this[_0x253f90(0xe4)][_0x253f90(0xb1)]('Request:\x20'+_0xf08996+'\x20'+_0x29e200);const _0x445ad2={...this[_0x253f90(0xa9)],...headers};if(_0x18336a&&!_0x445ad2[_0x253f90(0x9f)]){if(_0x18336a instanceof Buffer){}else _0x445ad2[_0x253f90(0x9f)]=_0x253f90(0xca);}let _0x496015;_0x18336a&&(_0x18336a instanceof Buffer?_0x496015=_0x18336a:_0x496015=typeof _0x18336a===_0x253f90(0x95)?_0x18336a:JSON['stringify'](_0x18336a));_0x496015&&this['logger']['debug'](_0x253f90(0x9b)+(typeof _0x496015===_0x253f90(0x95)?_0x496015:_0x253f90(0x93)));let _0x8b3769=null;for(let _0x42da6e=0x0;_0x42da6e<=retries;_0x42da6e++){try{const _0x51fa4e=new AbortController(),_0x2a6679=setTimeout(()=>_0x51fa4e['abort'](),timeout);if(_0x26b5b4){if(_0x26b5b4[_0x253f90(0xa3)])throw new Error(_0x253f90(0xc7));_0x26b5b4[_0x253f90(0xf4)]('abort',()=>_0x51fa4e[_0x253f90(0xee)](),{'once':!![]});}this[_0x253f90(0x8b)]&&await this['proxyReady'];const _0x19b8b2={'method':_0xf08996,'headers':_0x445ad2,'body':_0x496015,'signal':_0x51fa4e[_0x253f90(0xd4)]};this['dispatcher']&&(_0x19b8b2['dispatcher']=this[_0x253f90(0x91)]);const _0x35f89a=await fetch(_0x29e200,_0x19b8b2);clearTimeout(_0x2a6679);if(_0x42da6e<retries&&isRetryableStatus(_0x35f89a[_0x253f90(0xc5)])){if(_0x35f89a[_0x253f90(0xc5)]===0x1ad){const _0x9bbcb0=await _0x35f89a[_0x253f90(0xc8)]();if(isNonRetryable429(_0x9bbcb0)){const _0x4c733a=this[_0x253f90(0xdd)](_0x9bbcb0)||_0x35f89a['statusText'];throw new HTTPClientError(_0x4c733a,_0x35f89a[_0x253f90(0xc5)]);}}const _0x3709bb=_0x35f89a[_0x253f90(0x92)][_0x253f90(0xe6)](_0x253f90(0xf2)),_0x29f4cd=_0x3709bb?parseInt(_0x3709bb,0xa)*0x3e8:getRetryDelay(_0x42da6e,this[_0x253f90(0xbe)]);console[_0x253f90(0xac)]('[Retry\x20'+(_0x42da6e+0x1)+'/'+retries+']\x20Request\x20failed\x20with\x20'+_0x35f89a[_0x253f90(0xc5)]+',\x20'+(_0x253f90(0xa6)+Math[_0x253f90(0xbb)](_0x29f4cd)+_0x253f90(0xec))),await this[_0x253f90(0xa0)](_0x29f4cd);continue;}!_0x35f89a['ok']&&await this[_0x253f90(0x8e)](_0x35f89a);let _0xfb9f55;if(responseType===_0x253f90(0xa2)){const _0x5ad834=await _0x35f89a[_0x253f90(0xa5)]();_0xfb9f55=Buffer['from'](_0x5ad834);}else responseType===_0x253f90(0xc8)?_0xfb9f55=await _0x35f89a[_0x253f90(0xc8)]():_0xfb9f55=await this[_0x253f90(0xdf)](_0x35f89a);this[_0x253f90(0xe4)][_0x253f90(0xc0)](_0x253f90(0xb8)+_0x35f89a[_0x253f90(0xc5)]+_0x253f90(0xd1)+_0xf08996+'\x20'+_0x2f2bdf),this[_0x253f90(0xe4)][_0x253f90(0xe1)](JSON[_0x253f90(0xa4)](_0xfb9f55,null,0x2));if(includeHeaders){const _0x364e20={};return _0x35f89a['headers'][_0x253f90(0xef)]((_0x47b0ed,_0x46113a)=>{_0x364e20[_0x46113a]=_0x47b0ed;}),{'data':_0xfb9f55,'status':_0x35f89a['status'],'headers':_0x364e20};}return _0xfb9f55;}catch(_0x2a8081){_0x8b3769=_0x2a8081 instanceof Error?_0x2a8081:new Error(String(_0x2a8081));if(_0x2a8081 instanceof HTTPClientError){if(!isRetryableStatus(_0x2a8081[_0x253f90(0xc5)])||_0x2a8081[_0x253f90(0xc5)]===0x1ad&&isNonRetryable429(_0x2a8081[_0x253f90(0xd5)]))throw _0x2a8081;}if(_0x42da6e>=retries){if(!(_0x8b3769 instanceof HTTPClientError)){const _0x402e05=extractRootCause(_0x8b3769);if(this['proxyUrl']&&this[_0x253f90(0x8d)](_0x8b3769))throw new SDKError(ErrorCode[_0x253f90(0xe0)],'Failed\x20to\x20connect\x20through\x20proxy\x20'+this[_0x253f90(0xad)](this['proxyUrl'])+':\x20'+_0x402e05,_0x8b3769);throw new SDKError(ErrorCode[_0x253f90(0xb5)],_0x253f90(0xc4)+_0x29e200+_0x253f90(0xf5)+_0x402e05,_0x8b3769);}throw _0x8b3769;}const _0x5141e6=getRetryDelay(_0x42da6e,this[_0x253f90(0xbe)]);let _0x105794;_0x8b3769 instanceof HTTPClientError?_0x105794=_0x253f90(0x9c)+(_0x42da6e+0x1)+'/'+retries+']\x20Request\x20failed\x20with\x20HTTP\x20'+_0x8b3769[_0x253f90(0xc5)]+':\x20'+_0x8b3769[_0x253f90(0xd5)]+',\x20'+(_0x253f90(0xa6)+Math[_0x253f90(0xbb)](_0x5141e6)+'ms...'):_0x105794=_0x253f90(0x9c)+(_0x42da6e+0x1)+'/'+retries+']\x20Request\x20to\x20'+_0x29e200+_0x253f90(0xf5)+_0x8b3769[_0x253f90(0xd5)]+',\x20'+('retrying\x20in\x20'+Math[_0x253f90(0xbb)](_0x5141e6)+_0x253f90(0xec)),console['warn'](_0x105794),await this[_0x253f90(0xa0)](_0x5141e6);}}throw _0x8b3769||new SDKError(ErrorCode['INTERNAL'],_0x253f90(0x9d));}async['safeParseJSON'](_0x36cad6){const _0x557113=await _0x36cad6['text']();if(!_0x557113)return null;try{const _0x1d5810=a92_0x5d0100({'storeAsString':!![]});return _0x1d5810['parse'](_0x557113);}catch{return{'body':_0x557113};}}[a92_0x9fb2b4(0xc6)](_0x37bd5c,_0x162cf4){const _0x15a435=a92_0x9fb2b4;if(!_0x37bd5c||typeof _0x37bd5c!=='object')return undefined;let _0x2f7e2e=_0x37bd5c;_0x2f7e2e[_0x15a435(0x99)]&&typeof _0x2f7e2e[_0x15a435(0x99)]==='object'&&(_0x2f7e2e=_0x2f7e2e['errors']);if(_0x2f7e2e[_0x15a435(0xe9)]||_0x2f7e2e[_0x15a435(0xa7)]||_0x2f7e2e[_0x15a435(0xc1)])return{'type':_0x2f7e2e[_0x15a435(0xe9)]||_0x15a435(0xce),'title':_0x2f7e2e[_0x15a435(0xa7)]||_0x15a435(0xda),'status':_0x2f7e2e[_0x15a435(0xc5)]||_0x162cf4,'detail':_0x2f7e2e[_0x15a435(0xc1)]||_0x15a435(0xba),'instance':_0x2f7e2e[_0x15a435(0x98)]||'',..._0x2f7e2e};const _0xc631f9=_0x2f7e2e[_0x15a435(0xd5)]||_0x2f7e2e[_0x15a435(0x96)]||_0x2f7e2e['text'];if(typeof _0xc631f9===_0x15a435(0x95))return{'type':'about:blank','title':_0x2f7e2e[_0x15a435(0xe3)]||_0x15a435(0xda),'status':_0x2f7e2e[_0x15a435(0x90)]||_0x162cf4,'detail':_0xc631f9,'instance':'',..._0x2f7e2e};return undefined;}async[a92_0x9fb2b4(0x8e)](_0x44405c){const _0x48183f=a92_0x9fb2b4,_0x5a29ca=await this[_0x48183f(0xdf)](_0x44405c),_0x28d5f0=this[_0x48183f(0xc6)](_0x5a29ca,_0x44405c['status']);_0x5a29ca&&this['logger'][_0x48183f(0xc0)](_0x48183f(0x9e)+JSON[_0x48183f(0xa4)](_0x5a29ca));let _0x44c514;if(_0x28d5f0?.[_0x48183f(0xc1)])_0x44c514=_0x28d5f0[_0x48183f(0xc1)];else _0x5a29ca?_0x44c514='HTTP\x20'+_0x44405c[_0x48183f(0xc5)]+':\x20'+_0x44405c['statusText']+_0x48183f(0xb3)+JSON[_0x48183f(0xa4)](_0x5a29ca):_0x44c514='HTTP\x20'+_0x44405c[_0x48183f(0xc5)]+':\x20'+_0x44405c['statusText'];throw new HTTPClientError(_0x44c514,_0x44405c['status'],_0x28d5f0);}[a92_0x9fb2b4(0xa0)](_0x5f0b84){return new Promise(_0x5da4bd=>setTimeout(_0x5da4bd,_0x5f0b84));}[a92_0x9fb2b4(0xdd)](_0x14942d){const _0x445d64=a92_0x9fb2b4;try{const _0x19aeeb=JSON[_0x445d64(0xea)](_0x14942d);return _0x19aeeb['detail']||_0x19aeeb[_0x445d64(0xd5)]||_0x19aeeb[_0x445d64(0x96)]||null;}catch{return _0x14942d[_0x445d64(0xd9)]<0x1f4?_0x14942d:null;}}async[a92_0x9fb2b4(0xbc)](_0x5d0424,_0x49d717,_0x50fc56={}){const _0x4fc28e=a92_0x9fb2b4,{headers:headers={},body:_0x3a8589,timeout:timeout=0x7530,signal:_0x1029e8}=_0x50fc56,_0x121fce=''+this[_0x4fc28e(0xe2)]+_0x49d717,_0xd79267={...this[_0x4fc28e(0xa9)],...headers},_0x585123=new AbortController(),_0x39f864=setTimeout(()=>_0x585123[_0x4fc28e(0xee)](),timeout),_0x58dcf2=_0x1029e8?[_0x585123[_0x4fc28e(0xd4)],_0x1029e8]:[_0x585123[_0x4fc28e(0xd4)]],_0x4b4acc=this[_0x4fc28e(0xb4)](_0x58dcf2);try{this[_0x4fc28e(0x8b)]&&await this[_0x4fc28e(0x8b)];const _0x12baa0={'method':_0x5d0424,'headers':_0xd79267,'signal':_0x4b4acc};this[_0x4fc28e(0x91)]&&(_0x12baa0[_0x4fc28e(0x91)]=this['dispatcher']);if(_0x3a8589){if(typeof _0x3a8589===_0x4fc28e(0x95))_0x12baa0[_0x4fc28e(0x8c)]=_0x3a8589;else _0x3a8589 instanceof Buffer?_0x12baa0[_0x4fc28e(0x8c)]=_0x3a8589:_0x12baa0['body']=JSON[_0x4fc28e(0xa4)](_0x3a8589);}const _0x52cec6=await fetch(_0x121fce,_0x12baa0);return clearTimeout(_0x39f864),!_0x52cec6['ok']&&await this['handleErrorResponse'](_0x52cec6),_0x52cec6;}catch(_0x5dd51a){clearTimeout(_0x39f864);if(_0x5dd51a instanceof HTTPClientError)throw _0x5dd51a;if(_0x5dd51a[_0x4fc28e(0xbd)]==='AbortError')throw new Error(_0x4fc28e(0xc7));if(this[_0x4fc28e(0xe8)]&&_0x5dd51a instanceof Error&&this['isProxyConnectionError'](_0x5dd51a))throw new SDKError(ErrorCode['PROXY_CONNECTION_FAILURE'],_0x4fc28e(0xcc)+this[_0x4fc28e(0xad)](this[_0x4fc28e(0xe8)])+':\x20'+_0x5dd51a[_0x4fc28e(0xd5)],_0x5dd51a);throw _0x5dd51a;}}[a92_0x9fb2b4(0xb4)](_0x18bc28){const _0x509d3e=a92_0x9fb2b4,_0x1ed3f2=new AbortController();for(const _0x484075 of _0x18bc28){if(_0x484075[_0x509d3e(0xa3)])return _0x1ed3f2[_0x509d3e(0xee)](),_0x1ed3f2['signal'];_0x484075[_0x509d3e(0xf4)](_0x509d3e(0xee),()=>_0x1ed3f2[_0x509d3e(0xee)](),{'once':!![]});}return _0x1ed3f2[_0x509d3e(0xd4)];}}
1
+ const a92_0x4316be=a92_0x135d;(function(_0x177e90,_0x117b7c){const _0x1878e9=a92_0x135d,_0x1bcbbd=_0x177e90();while(!![]){try{const _0x5c59be=parseInt(_0x1878e9(0x1ac))/0x1*(-parseInt(_0x1878e9(0x1ee))/0x2)+-parseInt(_0x1878e9(0x1b5))/0x3+parseInt(_0x1878e9(0x1d7))/0x4*(parseInt(_0x1878e9(0x1f6))/0x5)+parseInt(_0x1878e9(0x1fa))/0x6*(parseInt(_0x1878e9(0x1ec))/0x7)+-parseInt(_0x1878e9(0x1ce))/0x8+parseInt(_0x1878e9(0x1bc))/0x9*(parseInt(_0x1878e9(0x207))/0xa)+parseInt(_0x1878e9(0x1c3))/0xb*(-parseInt(_0x1878e9(0x208))/0xc);if(_0x5c59be===_0x117b7c)break;else _0x1bcbbd['push'](_0x1bcbbd['shift']());}catch(_0x345fd2){_0x1bcbbd['push'](_0x1bcbbd['shift']());}}}(a92_0x389b,0x6dfda));import{ErrorCode,SDKError}from'../errors.js';function a92_0x135d(_0x2dece9,_0x559e66){_0x2dece9=_0x2dece9-0x1a0;const _0x389bec=a92_0x389b();let _0x135dfb=_0x389bec[_0x2dece9];return _0x135dfb;}import{Logger}from'../../utils/logger/index.js';import a92_0x401af5 from'json-bigint';function getErrorChain(_0x203782,_0x39fb1e=0x5){const _0x329c8f=a92_0x135d,_0x2d2974=[_0x203782];let _0x945ef3=_0x203782;for(let _0x4881c7=0x0;_0x4881c7<_0x39fb1e&&_0x945ef3;_0x4881c7++){const _0x4542d7=_0x945ef3[_0x329c8f(0x1fe)];if(_0x4542d7 instanceof Error)_0x2d2974['push'](_0x4542d7),_0x945ef3=_0x4542d7;else break;}return _0x2d2974;}function extractRootCause(_0x150ac3){const _0x11058f=a92_0x135d,_0x3bd17a=getErrorChain(_0x150ac3,0x4),_0x27367d=_0x3bd17a[_0x3bd17a[_0x11058f(0x1c4)]-0x1],_0x2416f9=_0x27367d[_0x11058f(0x1fe)];if(_0x2416f9&&!(_0x2416f9 instanceof Error))return String(_0x2416f9);return _0x27367d[_0x11058f(0x1ba)]||_0x11058f(0x1a6);}const DEFAULT_RETRY_CONFIG={'maxRetries':0x3,'baseDelay':0x3e8,'maxDelay':0x1f40};function isRetryableStatus(_0x2cd617){return _0x2cd617>=0x1f4||_0x2cd617===0x1ad;}function a92_0x389b(){const _0x169573=['baseDelay','NOT_FOUND','username','pow','already\x20running','parseProblemDetails','ms...','retryConfig','requestSSE','Failed\x20to\x20connect\x20through\x20proxy\x20','random','\x0a\x20\x20Details:\x20','5271oxvcQF','Error\x20response\x20body:\x20','20984qrPOHf','includes','addEventListener','toString','defaultHeaders','parse','handleErrorResponse','dispatcher','718455dcjyzk','then','abort','isProxyConnectionError','3798cwlwKy','Retry-After','statusText','Request:\x20','cause','proxyUrl','HTTPClientError','UNAUTHENTICATED','status',']\x20Request\x20failed\x20with\x20','aborted','warn','PROXY_CONNECTION_FAILURE','4011010rftvBJ','360dLtADR','maskProxyCredentials','code','signal','UNAVAILABLE','****',']:\x20','Unknown\x20error','get','string','logger','INTERNAL','\x20failed:\x20','64CFGEIz','maxDelay','PERMISSION_DENIED','proxyReady','title','headers','An\x20error\x20occurred','type','password','1032018XxYOow','baseUrl','AbortError','debug','[Retry\x20','message','object','9qCjWnU','Request\x20failed\x20after\x20retries','maxRetries','Request\x20cancelled\x20by\x20user','detail','arrayBuffer','retrying\x20in\x20','95359osxngp','length','body','round','text','undici','errors','application/json','Using\x20proxy:\x20','name','error','110480woertY','[binary\x20data]','toLowerCase','combineSignals','safeParseJSON','sleep','HTTP\x20','RATE_LIMITED','extractErrorMessage','24BZHpSf','json','stringify','problemDetails','proxy','severity','about:blank','Error','info'];a92_0x389b=function(){return _0x169573;};return a92_0x389b();}function isNonRetryable429(_0x241cba){const _0x40f834=a92_0x135d;return _0x241cba[_0x40f834(0x1ef)](_0x40f834(0x1e4));}function getRetryDelay(_0x4151e8,_0x4881a6){const _0x4a7633=a92_0x135d,_0x3bec8c=Math['min'](_0x4881a6[_0x4a7633(0x1e0)]*Math[_0x4a7633(0x1e3)](0x2,_0x4151e8),_0x4881a6[_0x4a7633(0x1ad)]);return Math[_0x4a7633(0x1ea)]()*_0x3bec8c;}function statusCodeToErrorCode(_0x1e9cfe){const _0x50d4cf=a92_0x135d;if(_0x1e9cfe===0x191)return ErrorCode[_0x50d4cf(0x201)];else{if(_0x1e9cfe===0x193)return ErrorCode[_0x50d4cf(0x1ae)];else{if(_0x1e9cfe===0x194)return ErrorCode[_0x50d4cf(0x1e1)];else{if(_0x1e9cfe===0x1ad)return ErrorCode[_0x50d4cf(0x1d5)];else return _0x1e9cfe>=0x1f4?ErrorCode[_0x50d4cf(0x1a3)]:ErrorCode['INVALID_ARGUMENT'];}}}}export class HTTPClientError extends Error{['status'];['problemDetails'];[a92_0x4316be(0x1a1)];constructor(_0x8ca434,_0x3f58a1,_0x4eb17a){const _0x2ca6e9=a92_0x4316be,_0x245c54=statusCodeToErrorCode(_0x3f58a1);super('['+_0x245c54+']\x20'+_0x8ca434),this['status']=_0x3f58a1,this[_0x2ca6e9(0x1da)]=_0x4eb17a,this[_0x2ca6e9(0x1cc)]=_0x2ca6e9(0x200),this['code']=_0x245c54;}}export class HTTPClient{['retryConfig'];[a92_0x4316be(0x1b6)];[a92_0x4316be(0x1f2)];['logger']=Logger['of']('tdx.client.http');[a92_0x4316be(0x1f5)];[a92_0x4316be(0x1af)];[a92_0x4316be(0x1ff)];constructor(_0x4e3ae4,_0x267037,_0x25849d){const _0x4e1858=a92_0x4316be;this[_0x4e1858(0x1b6)]=_0x4e3ae4,this[_0x4e1858(0x1f2)]=_0x267037,this['retryConfig']={...DEFAULT_RETRY_CONFIG,..._0x25849d?.[_0x4e1858(0x1e7)]},_0x25849d?.[_0x4e1858(0x1db)]&&(this['proxyUrl']=_0x25849d['proxy'],this[_0x4e1858(0x1af)]=import(_0x4e1858(0x1c8))[_0x4e1858(0x1f7)](({ProxyAgent:_0x2d8b8b})=>{const _0x4d6859=_0x4e1858;this[_0x4d6859(0x1f5)]=new _0x2d8b8b(_0x25849d[_0x4d6859(0x1db)]);}),this['logger'][_0x4e1858(0x1df)](_0x4e1858(0x1cb)+this['maskProxyCredentials'](_0x25849d[_0x4e1858(0x1db)])));}['maskProxyCredentials'](_0x2c1e3f){const _0x355bd6=a92_0x4316be;try{const _0x486383=new URL(_0x2c1e3f);return _0x486383[_0x355bd6(0x1e2)]&&(_0x486383[_0x355bd6(0x1e2)]='****'),_0x486383[_0x355bd6(0x1b4)]&&(_0x486383[_0x355bd6(0x1b4)]=_0x355bd6(0x1a4)),_0x486383[_0x355bd6(0x1f1)]();}catch{return _0x2c1e3f;}}['isProxyConnectionError'](_0x27b326){const _0x2ba519=a92_0x4316be,_0x501cbf=getErrorChain(_0x27b326);for(const _0x1f9e69 of _0x501cbf){const _0x15a51c=_0x1f9e69[_0x2ba519(0x1ba)][_0x2ba519(0x1d0)](),_0x413d0c=_0x1f9e69[_0x2ba519(0x1cc)][_0x2ba519(0x1d0)]();if(_0x15a51c[_0x2ba519(0x1ef)](_0x2ba519(0x1db))||_0x413d0c[_0x2ba519(0x1ef)]('proxy')||_0x15a51c['includes']('tunnel')||_0x15a51c['includes']('407'))return!![];if(_0x2ba519(0x1a1)in _0x1f9e69&&typeof _0x1f9e69[_0x2ba519(0x1a1)]===_0x2ba519(0x1a8)){if(_0x1f9e69[_0x2ba519(0x1a1)][_0x2ba519(0x1ef)]('PROXY'))return!![];}}return![];}async['request'](_0x613326,_0x32aee1,_0x3430bb={}){const _0xd3e763=a92_0x4316be,{headers:headers={},body:_0x39e4e8,timeout:timeout=0x7530,retries:retries=this[_0xd3e763(0x1e7)][_0xd3e763(0x1be)],signal:_0x55b945,includeHeaders:includeHeaders=![],responseType:responseType=_0xd3e763(0x1d8)}=_0x3430bb,_0x412355=''+this[_0xd3e763(0x1b6)]+_0x32aee1;this[_0xd3e763(0x1a9)]['info'](_0xd3e763(0x1fd)+_0x613326+'\x20'+_0x412355);const _0x4cabb4={...this[_0xd3e763(0x1f2)],...headers};if(_0x39e4e8&&!_0x4cabb4['Content-Type']){if(_0x39e4e8 instanceof Buffer){}else _0x4cabb4['Content-Type']=_0xd3e763(0x1ca);}let _0xbe40fe;_0x39e4e8&&(_0x39e4e8 instanceof Buffer?_0xbe40fe=_0x39e4e8:_0xbe40fe=typeof _0x39e4e8===_0xd3e763(0x1a8)?_0x39e4e8:JSON[_0xd3e763(0x1d9)](_0x39e4e8));_0xbe40fe&&this[_0xd3e763(0x1a9)]['debug']('request\x20body:\x20'+(typeof _0xbe40fe===_0xd3e763(0x1a8)?_0xbe40fe:_0xd3e763(0x1cf)));let _0x27e3dc=null;for(let _0x4f682d=0x0;_0x4f682d<=retries;_0x4f682d++){try{const _0x2f1114=new AbortController(),_0x519757=setTimeout(()=>_0x2f1114[_0xd3e763(0x1f8)](),timeout);if(_0x55b945){if(_0x55b945[_0xd3e763(0x204)])throw new Error(_0xd3e763(0x1bf));_0x55b945[_0xd3e763(0x1f0)]('abort',()=>_0x2f1114[_0xd3e763(0x1f8)](),{'once':!![]});}this['proxyReady']&&await this[_0xd3e763(0x1af)];const _0x1a06cc={'method':_0x613326,'headers':_0x4cabb4,'body':_0xbe40fe,'signal':_0x2f1114['signal']};this[_0xd3e763(0x1f5)]&&(_0x1a06cc[_0xd3e763(0x1f5)]=this[_0xd3e763(0x1f5)]);const _0x4c16ed=await fetch(_0x412355,_0x1a06cc);clearTimeout(_0x519757);if(_0x4f682d<retries&&isRetryableStatus(_0x4c16ed[_0xd3e763(0x202)])){if(_0x4c16ed[_0xd3e763(0x202)]===0x1ad){const _0xe990f8=await _0x4c16ed['text']();if(isNonRetryable429(_0xe990f8)){const _0x1d1270=this[_0xd3e763(0x1d6)](_0xe990f8)||_0x4c16ed[_0xd3e763(0x1fc)];throw new HTTPClientError(_0x1d1270,_0x4c16ed[_0xd3e763(0x202)]);}}const _0x5e42d9=_0x4c16ed['headers'][_0xd3e763(0x1a7)](_0xd3e763(0x1fb)),_0x25431d=_0x5e42d9?parseInt(_0x5e42d9,0xa)*0x3e8:getRetryDelay(_0x4f682d,this['retryConfig']);console[_0xd3e763(0x205)](_0xd3e763(0x1b9)+(_0x4f682d+0x1)+'/'+retries+_0xd3e763(0x203)+_0x4c16ed['status']+',\x20'+('retrying\x20in\x20'+Math[_0xd3e763(0x1c6)](_0x25431d)+_0xd3e763(0x1e6))),await this[_0xd3e763(0x1d3)](_0x25431d);continue;}!_0x4c16ed['ok']&&await this[_0xd3e763(0x1f4)](_0x4c16ed);let _0x5e5953;if(responseType==='arraybuffer'){const _0x31c844=await _0x4c16ed[_0xd3e763(0x1c1)]();_0x5e5953=Buffer['from'](_0x31c844);}else responseType===_0xd3e763(0x1c7)?_0x5e5953=await _0x4c16ed[_0xd3e763(0x1c7)]():_0x5e5953=await this[_0xd3e763(0x1d2)](_0x4c16ed);this[_0xd3e763(0x1a9)][_0xd3e763(0x1b8)]('Response\x20['+_0x4c16ed[_0xd3e763(0x202)]+_0xd3e763(0x1a5)+_0x613326+'\x20'+_0x32aee1),this[_0xd3e763(0x1a9)]['trace'](JSON[_0xd3e763(0x1d9)](_0x5e5953,null,0x2));if(includeHeaders){const _0x2f03b5={};return _0x4c16ed[_0xd3e763(0x1b1)]['forEach']((_0x16f553,_0x24d541)=>{_0x2f03b5[_0x24d541]=_0x16f553;}),{'data':_0x5e5953,'status':_0x4c16ed['status'],'headers':_0x2f03b5};}return _0x5e5953;}catch(_0x4cea1c){_0x27e3dc=_0x4cea1c instanceof Error?_0x4cea1c:new Error(String(_0x4cea1c));if(_0x4cea1c instanceof HTTPClientError){if(!isRetryableStatus(_0x4cea1c[_0xd3e763(0x202)])||_0x4cea1c[_0xd3e763(0x202)]===0x1ad&&isNonRetryable429(_0x4cea1c['message']))throw _0x4cea1c;}if(_0x4f682d>=retries){if(!(_0x27e3dc instanceof HTTPClientError)){const _0x2208e5=extractRootCause(_0x27e3dc);if(this['proxyUrl']&&this['isProxyConnectionError'](_0x27e3dc))throw new SDKError(ErrorCode[_0xd3e763(0x206)],_0xd3e763(0x1e9)+this[_0xd3e763(0x1a0)](this[_0xd3e763(0x1ff)])+':\x20'+_0x2208e5,_0x27e3dc);throw new SDKError(ErrorCode['HTTP_REQUEST_FAILURE'],'Request\x20to\x20'+_0x412355+_0xd3e763(0x1ab)+_0x2208e5,_0x27e3dc);}throw _0x27e3dc;}const _0x6c4224=getRetryDelay(_0x4f682d,this[_0xd3e763(0x1e7)]);let _0x29415a;_0x27e3dc instanceof HTTPClientError?_0x29415a=_0xd3e763(0x1b9)+(_0x4f682d+0x1)+'/'+retries+']\x20Request\x20failed\x20with\x20HTTP\x20'+_0x27e3dc['status']+':\x20'+_0x27e3dc[_0xd3e763(0x1ba)]+',\x20'+(_0xd3e763(0x1c2)+Math[_0xd3e763(0x1c6)](_0x6c4224)+_0xd3e763(0x1e6)):_0x29415a='[Retry\x20'+(_0x4f682d+0x1)+'/'+retries+']\x20Request\x20to\x20'+_0x412355+_0xd3e763(0x1ab)+_0x27e3dc[_0xd3e763(0x1ba)]+',\x20'+(_0xd3e763(0x1c2)+Math[_0xd3e763(0x1c6)](_0x6c4224)+_0xd3e763(0x1e6)),console[_0xd3e763(0x205)](_0x29415a),await this[_0xd3e763(0x1d3)](_0x6c4224);}}throw _0x27e3dc||new SDKError(ErrorCode[_0xd3e763(0x1aa)],_0xd3e763(0x1bd));}async[a92_0x4316be(0x1d2)](_0x2ff0c0){const _0x3d7d83=a92_0x4316be,_0x1b50c6=await _0x2ff0c0[_0x3d7d83(0x1c7)]();if(!_0x1b50c6)return null;try{const _0x25dc91=a92_0x401af5({'storeAsString':!![]});return _0x25dc91[_0x3d7d83(0x1f3)](_0x1b50c6);}catch{return{'body':_0x1b50c6};}}[a92_0x4316be(0x1e5)](_0x356a04,_0x25caeb){const _0x1ea233=a92_0x4316be;if(!_0x356a04||typeof _0x356a04!==_0x1ea233(0x1bb))return undefined;let _0x12dcd4=_0x356a04;_0x12dcd4[_0x1ea233(0x1c9)]&&typeof _0x12dcd4['errors']===_0x1ea233(0x1bb)&&(_0x12dcd4=_0x12dcd4['errors']);if(_0x12dcd4[_0x1ea233(0x1b3)]||_0x12dcd4[_0x1ea233(0x1b0)]||_0x12dcd4[_0x1ea233(0x1c0)])return{'type':_0x12dcd4['type']||_0x1ea233(0x1dd),'title':_0x12dcd4[_0x1ea233(0x1b0)]||_0x1ea233(0x1de),'status':_0x12dcd4[_0x1ea233(0x202)]||_0x25caeb,'detail':_0x12dcd4[_0x1ea233(0x1c0)]||_0x1ea233(0x1b2),'instance':_0x12dcd4['instance']||'',..._0x12dcd4};const _0x4979dc=_0x12dcd4[_0x1ea233(0x1ba)]||_0x12dcd4[_0x1ea233(0x1cd)]||_0x12dcd4[_0x1ea233(0x1c7)];if(typeof _0x4979dc===_0x1ea233(0x1a8))return{'type':_0x1ea233(0x1dd),'title':_0x12dcd4[_0x1ea233(0x1dc)]||_0x1ea233(0x1de),'status':_0x12dcd4['status_code']||_0x25caeb,'detail':_0x4979dc,'instance':'',..._0x12dcd4};return undefined;}async['handleErrorResponse'](_0x8340cd){const _0x4aef39=a92_0x4316be,_0x2a897e=await this[_0x4aef39(0x1d2)](_0x8340cd),_0x4b0703=this[_0x4aef39(0x1e5)](_0x2a897e,_0x8340cd[_0x4aef39(0x202)]);_0x2a897e&&this[_0x4aef39(0x1a9)][_0x4aef39(0x1b8)](_0x4aef39(0x1ed)+JSON[_0x4aef39(0x1d9)](_0x2a897e));let _0x311e28;if(_0x4b0703?.[_0x4aef39(0x1c0)])_0x311e28=_0x4b0703[_0x4aef39(0x1c0)];else _0x2a897e?_0x311e28=_0x4aef39(0x1d4)+_0x8340cd[_0x4aef39(0x202)]+':\x20'+_0x8340cd[_0x4aef39(0x1fc)]+_0x4aef39(0x1eb)+JSON[_0x4aef39(0x1d9)](_0x2a897e):_0x311e28=_0x4aef39(0x1d4)+_0x8340cd['status']+':\x20'+_0x8340cd['statusText'];throw new HTTPClientError(_0x311e28,_0x8340cd[_0x4aef39(0x202)],_0x4b0703);}['sleep'](_0x5de468){return new Promise(_0x53d4ab=>setTimeout(_0x53d4ab,_0x5de468));}[a92_0x4316be(0x1d6)](_0x480c70){const _0x3d6d1b=a92_0x4316be;try{const _0x58814f=JSON[_0x3d6d1b(0x1f3)](_0x480c70);return _0x58814f['detail']||_0x58814f['message']||_0x58814f[_0x3d6d1b(0x1cd)]||null;}catch{return _0x480c70['length']<0x1f4?_0x480c70:null;}}async[a92_0x4316be(0x1e8)](_0x5b2f9d,_0x2b9ce4,_0x2d068b={}){const _0x27bc67=a92_0x4316be,{headers:headers={},body:_0x2372e5,timeout:timeout=0x7530,signal:_0x8c6194}=_0x2d068b,_0x4865e4=''+this[_0x27bc67(0x1b6)]+_0x2b9ce4,_0x3b1675={...this[_0x27bc67(0x1f2)],...headers},_0x3a4ebd=new AbortController(),_0x3f995b=setTimeout(()=>_0x3a4ebd[_0x27bc67(0x1f8)](),timeout),_0x83d9be=_0x8c6194?[_0x3a4ebd['signal'],_0x8c6194]:[_0x3a4ebd['signal']],_0x1bf646=this[_0x27bc67(0x1d1)](_0x83d9be);try{this[_0x27bc67(0x1af)]&&await this['proxyReady'];const _0x4d749c={'method':_0x5b2f9d,'headers':_0x3b1675,'signal':_0x1bf646};this[_0x27bc67(0x1f5)]&&(_0x4d749c[_0x27bc67(0x1f5)]=this[_0x27bc67(0x1f5)]);if(_0x2372e5){if(typeof _0x2372e5===_0x27bc67(0x1a8))_0x4d749c[_0x27bc67(0x1c5)]=_0x2372e5;else _0x2372e5 instanceof Buffer?_0x4d749c[_0x27bc67(0x1c5)]=_0x2372e5:_0x4d749c[_0x27bc67(0x1c5)]=JSON[_0x27bc67(0x1d9)](_0x2372e5);}const _0xbd253e=await fetch(_0x4865e4,_0x4d749c);return clearTimeout(_0x3f995b),!_0xbd253e['ok']&&await this[_0x27bc67(0x1f4)](_0xbd253e),_0xbd253e;}catch(_0x2a2b19){clearTimeout(_0x3f995b);if(_0x2a2b19 instanceof HTTPClientError)throw _0x2a2b19;if(_0x2a2b19[_0x27bc67(0x1cc)]===_0x27bc67(0x1b7))throw new Error(_0x27bc67(0x1bf));if(this[_0x27bc67(0x1ff)]&&_0x2a2b19 instanceof Error&&this[_0x27bc67(0x1f9)](_0x2a2b19))throw new SDKError(ErrorCode[_0x27bc67(0x206)],_0x27bc67(0x1e9)+this[_0x27bc67(0x1a0)](this[_0x27bc67(0x1ff)])+':\x20'+_0x2a2b19['message'],_0x2a2b19);throw _0x2a2b19;}}[a92_0x4316be(0x1d1)](_0x3790f2){const _0x5be259=a92_0x4316be,_0x1532f6=new AbortController();for(const _0x34cd7b of _0x3790f2){if(_0x34cd7b[_0x5be259(0x204)])return _0x1532f6[_0x5be259(0x1f8)](),_0x1532f6[_0x5be259(0x1a2)];_0x34cd7b[_0x5be259(0x1f0)]('abort',()=>_0x1532f6[_0x5be259(0x1f8)](),{'once':!![]});}return _0x1532f6[_0x5be259(0x1a2)];}}
@@ -1 +1 @@
1
- const a93_0x465343=a93_0x1d2f;(function(_0x3b2141,_0x565933){const _0x411826=a93_0x1d2f,_0x7ea81a=_0x3b2141();while(!![]){try{const _0xc42a48=parseInt(_0x411826(0x163))/0x1*(parseInt(_0x411826(0x134))/0x2)+-parseInt(_0x411826(0x16d))/0x3*(-parseInt(_0x411826(0x130))/0x4)+-parseInt(_0x411826(0x167))/0x5*(parseInt(_0x411826(0x15f))/0x6)+-parseInt(_0x411826(0x1b2))/0x7*(-parseInt(_0x411826(0x12b))/0x8)+-parseInt(_0x411826(0x161))/0x9+-parseInt(_0x411826(0x1aa))/0xa*(-parseInt(_0x411826(0x14a))/0xb)+parseInt(_0x411826(0x144))/0xc*(parseInt(_0x411826(0x1ab))/0xd);if(_0xc42a48===_0x565933)break;else _0x7ea81a['push'](_0x7ea81a['shift']());}catch(_0x203cd9){_0x7ea81a['push'](_0x7ea81a['shift']());}}}(a93_0xe84b,0x8afbe));import{HTTPClient}from'./http-client.js';function a93_0xe84b(){const _0x25f615=['/api/image_generators','createProject','/history','debug','/api/tool_targets?filter[targetType]=TextKnowledgeBase&filter[project_id]=','systemPrompt','reasoningEffort','listExperimentalKnowledgeBases','LLM_EMPTY_MESSAGE','prompts','createWebSearchTool','llm','[Retry\x20','20tenovt','13MEOVTY','links','DELETE','/api/experimental_artifacts/','deleteProject','search','getAgent','7vHTHzP','updateKnowledgeBase','starterMessage','updatePrompt','/api/tool_targets?filter[targetType]=WebSearchTool&filter[project_id]=','/api/agents','\x20attempts:\x20API\x20returned\x20empty\x20chat\x20ID','paginateAll',']\x20Streaming\x20SSE\x20stream\x20for\x20chatId:\x20','listExperimentalArtifacts','updateIntegration','next','/api/integrations/','webSearchTools','getChatHistory','userLocation','&page[limit]=50','baseUrl','getChatInfo','httpClient','/api/projects/','agents','updateExperimentalKnowledgeBase','nova-canvas','1698608IpLhXB','modelType','projectId','chats','/api/web_search_tools','8sJdXyM','authHeaders','listToolTargets','listAgents','303362QIXyuA',']\x20Chat\x20creation\x20returned\x20empty\x20ID,\x20retrying\x20in\x20','\x20with\x20message\x20size:\x20','createExperimentalArtifact','site','imageGenerators','/api/experimental_artifacts','/api/tool_targets?filter[targetType]=','approximate','listWebSearchTools','maxToolIterations','/api/agents/','/api/tool_targets?filter[targetType]=ParentSegmentKnowledgeBase&filter[project_id]=','startsWith','listChats','textKnowledgeBases','864876rPAUvT','application/json','/api/integrations?filter[projectId]=','/api/experimental_artifacts?filter[projectId]=','/api/knowledge_bases?filter[projectId]=','/api/tool_targets?filter[targetType]=ExperimentalKnowledgeBase&filter[project_id]=','2880240nPgpHd','updateAgent','knowledge_bases','/api/experimental_knowledge_bases/','logger','&filter[project_id]=','length','/api/users/current_settings','/api/text_knowledge_bases/','getParentSegmentKnowledgeBase','experimentalArtifacts','continueChat','getChatLog','listKnowledgeBases','prompt','listProjects','/langfuse','/api/prompts?filter[projectId]=','getProject','California',',\x20message\x20length:\x20','402HcBApM','Please\x20provide\x20a\x20non-empty\x20message\x20to\x20continue\x20the\x20chat.','2166795pddcJl','createAgentResponse','1ObesiD','deleteIntegration','toString','POST','37985YQkiCe','append','LLM_CHAT_CREATION_FAILURE','agentId','push','searchContextSize','538908MQAqWF','createAgent','application/vnd.api+json','apiKey','imageModelType','page[limit]','You\x20are\x20a\x20helpful\x20search\x20assistant.','/api/projects?page[limit]=','name','/continue','PATCH','\x20characters','updateExperimentalArtifact','createImageGenerator','trim','/api/knowledge_bases/','/api/experimental_knowledge_bases','Failed\x20to\x20create\x20chat:\x20unexpected\x20error','temperature','filters','LLM_STREAM_ERROR','/api/tool_targets?filter[targetType]=ImageGenerator&filter[project_id]=','Continuing\x20chat\x20','getExperimentalArtifact','GET','ms...','listIntegrations','startChat','-last_conversation_at','/api/integrations','description','outputs','text/event-stream','listImageGenerators','/api/prompts','request','/api/projects','/api/chats/','map','San\x20Francisco','accessToken','Failed\x20to\x20continue\x20chat\x20(chatId:\x20','createExperimentalKnowledgeBase','integrations','data','pathname','/api/agents?page[limit]=50','experimentalKnowledgeBases'];a93_0xe84b=function(){return _0x25f615;};return a93_0xe84b();}import{getEndpoint}from'../types/index.js';import{getAuthHeaders,toHeaderRecord}from'../../core/auth.js';function a93_0x1d2f(_0x229d41,_0x4cd713){_0x229d41=_0x229d41-0x118;const _0xe84b01=a93_0xe84b();let _0x1d2f36=_0xe84b01[_0x229d41];return _0x1d2f36;}import{parseSSEStream}from'../../utils/sse-parser.js';import{ErrorCode,SDKError}from'../errors.js';import{Logger}from'../../utils/logger/index.js';export class LLMApiClient{['httpClient'];['baseUrl'];['authHeaders'];[a93_0x465343(0x14e)]=Logger['of']('tdx.client.llm');constructor(_0x190139){const _0x868e7d=a93_0x465343;this[_0x868e7d(0x124)]=getEndpoint(_0x190139[_0x868e7d(0x138)],_0x868e7d(0x1a8)),this[_0x868e7d(0x131)]=toHeaderRecord(getAuthHeaders(_0x190139[_0x868e7d(0x138)],_0x190139[_0x868e7d(0x170)],_0x190139[_0x868e7d(0x195)])),this[_0x868e7d(0x126)]=new HTTPClient(this[_0x868e7d(0x124)],this[_0x868e7d(0x131)],{'proxy':_0x190139['proxy']});}async[a93_0x465343(0x11a)](_0x148343){const _0x4d1fb6=a93_0x465343,_0x37db08=[];let _0x4dc083=_0x148343;while(_0x4dc083){const _0x4227bf=await this[_0x4d1fb6(0x126)]['request'](_0x4d1fb6(0x185),_0x4dc083);_0x4227bf[_0x4d1fb6(0x199)]&&_0x37db08['push'](..._0x4227bf[_0x4d1fb6(0x199)]);_0x4dc083=_0x4227bf[_0x4d1fb6(0x1ac)]?.[_0x4d1fb6(0x11e)];if(_0x4dc083&&_0x4dc083[_0x4d1fb6(0x141)]('http')){const _0x61bdd1=new URL(_0x4dc083);_0x4dc083=_0x61bdd1[_0x4d1fb6(0x19a)]+_0x61bdd1[_0x4d1fb6(0x1b0)];}}return _0x37db08;}async['getUserSettings'](){const _0x58f5ad=a93_0x465343;return await this[_0x58f5ad(0x126)][_0x58f5ad(0x190)](_0x58f5ad(0x185),_0x58f5ad(0x151));}async[a93_0x465343(0x19e)](_0x359d8b){const _0x364961=a93_0x465343,_0x53e245={'data':{'type':'projects','attributes':{'name':_0x359d8b['name'],..._0x359d8b[_0x364961(0x18b)]&&{'description':_0x359d8b[_0x364961(0x18b)]}}}},_0x185346=await this[_0x364961(0x126)][_0x364961(0x190)](_0x364961(0x166),_0x364961(0x191),{'headers':{'Content-Type':_0x364961(0x16f),'Accept':_0x364961(0x16f)},'body':_0x53e245});return _0x185346[_0x364961(0x199)];}async[a93_0x465343(0x1af)](_0xd966d1){const _0x5d773d=a93_0x465343,_0x270f0e=_0x5d773d(0x127)+encodeURIComponent(_0xd966d1);await this['httpClient'][_0x5d773d(0x190)](_0x5d773d(0x1ad),_0x270f0e);}async[a93_0x465343(0x159)](_0x4174f2=0x32){const _0x281680=a93_0x465343;return this[_0x281680(0x11a)](_0x281680(0x174)+_0x4174f2);}async[a93_0x465343(0x133)](_0x44f332){const _0x530b8e=a93_0x465343;let _0x301e30=_0x530b8e(0x19b);return _0x44f332&&(_0x301e30+=_0x530b8e(0x14f)+encodeURIComponent(_0x44f332)),this[_0x530b8e(0x11a)](_0x301e30);}async[a93_0x465343(0x1b1)](_0x2fdb68){const _0x35b017=a93_0x465343,_0x5905be=_0x35b017(0x13f)+encodeURIComponent(_0x2fdb68),_0xb597c=await this[_0x35b017(0x126)][_0x35b017(0x190)](_0x35b017(0x185),_0x5905be);return _0xb597c[_0x35b017(0x199)];}async[a93_0x465343(0x16e)](_0x5022d7){const _0x21d291=a93_0x465343,_0x3054c4={'name':_0x5022d7[_0x21d291(0x175)],'projectId':_0x5022d7[_0x21d291(0x12d)],'modelType':_0x5022d7['modelType'],'maxToolIterations':_0x5022d7[_0x21d291(0x13e)]??0x4,'temperature':_0x5022d7[_0x21d291(0x17f)]??0.7};_0x5022d7[_0x21d291(0x1a2)]!==undefined&&(_0x3054c4['systemPrompt']=_0x5022d7['systemPrompt']);_0x5022d7[_0x21d291(0x1b4)]&&(_0x3054c4[_0x21d291(0x1b4)]=_0x5022d7[_0x21d291(0x1b4)]);_0x5022d7[_0x21d291(0x1a3)]&&(_0x3054c4['reasoningEffort']=_0x5022d7[_0x21d291(0x1a3)]);_0x5022d7[_0x21d291(0x18c)]&&_0x5022d7[_0x21d291(0x18c)][_0x21d291(0x150)]>0x0&&(_0x3054c4[_0x21d291(0x18c)]=_0x5022d7['outputs']);const _0x14328e={'data':{'type':_0x21d291(0x128),'attributes':_0x3054c4}},_0x16c881=await this['httpClient'][_0x21d291(0x190)](_0x21d291(0x166),_0x21d291(0x118),{'headers':{'Content-Type':'application/vnd.api+json','Accept':_0x21d291(0x16f)},'body':_0x14328e});return _0x16c881[_0x21d291(0x199)];}async[a93_0x465343(0x14b)](_0x51699,_0x2868fd){const _0x33b1a7=a93_0x465343,_0x36594c={'data':{'type':'agents','id':_0x51699,'attributes':{..._0x2868fd[_0x33b1a7(0x175)]&&{'name':_0x2868fd['name']},..._0x2868fd[_0x33b1a7(0x18b)]&&{'description':_0x2868fd[_0x33b1a7(0x18b)]},..._0x2868fd[_0x33b1a7(0x158)]&&{'prompt':_0x2868fd[_0x33b1a7(0x158)]},..._0x2868fd[_0x33b1a7(0x1b4)]&&{'starter_message':_0x2868fd[_0x33b1a7(0x1b4)]},..._0x2868fd[_0x33b1a7(0x1a3)]&&{'reasoningEffort':_0x2868fd[_0x33b1a7(0x1a3)]}}}},_0x3324d7=_0x33b1a7(0x13f)+encodeURIComponent(_0x51699),_0x1e591f=await this[_0x33b1a7(0x126)][_0x33b1a7(0x190)](_0x33b1a7(0x177),_0x3324d7,{'headers':{'Content-Type':_0x33b1a7(0x16f)},'body':_0x36594c});return _0x1e591f[_0x33b1a7(0x199)];}async['deleteAgent'](_0x595f2){const _0x175b9a=a93_0x465343,_0x1ec4d0=_0x175b9a(0x13f)+encodeURIComponent(_0x595f2);await this[_0x175b9a(0x126)][_0x175b9a(0x190)]('DELETE',_0x1ec4d0);}async[a93_0x465343(0x142)](_0x4a00e8=0x32){const _0x119fe7=a93_0x465343,_0x5ae72c=new URLSearchParams();_0x5ae72c[_0x119fe7(0x168)](_0x119fe7(0x172),String(_0x4a00e8)),_0x5ae72c[_0x119fe7(0x168)]('sort',_0x119fe7(0x189));const _0xba73cb='/api/chats?'+_0x5ae72c[_0x119fe7(0x165)](),_0x3fed01=await this[_0x119fe7(0x126)]['request']('GET',_0xba73cb);return _0x3fed01[_0x119fe7(0x199)]||[];}async[a93_0x465343(0x125)](_0x590d1a){const _0x17719e=a93_0x465343,_0x3a5714=_0x17719e(0x192)+encodeURIComponent(_0x590d1a),_0x3d6045=await this['httpClient']['request'](_0x17719e(0x185),_0x3a5714);return _0x3d6045[_0x17719e(0x199)];}async[a93_0x465343(0x121)](_0x57581b){const _0xb15ba7=a93_0x465343,_0x15adfc=_0xb15ba7(0x192)+encodeURIComponent(_0x57581b)+_0xb15ba7(0x19f);return await this['httpClient'][_0xb15ba7(0x190)](_0xb15ba7(0x185),_0x15adfc);}async[a93_0x465343(0x156)](_0x4ae6f4){const _0x5bc171=a93_0x465343,_0x30c392=_0x5bc171(0x192)+encodeURIComponent(_0x4ae6f4)+_0x5bc171(0x15a);return await this[_0x5bc171(0x126)][_0x5bc171(0x190)](_0x5bc171(0x185),_0x30c392);}async[a93_0x465343(0x188)](_0x249353){const _0x53e055=a93_0x465343,_0x293607={'data':{'type':_0x53e055(0x12e),'attributes':{'agentId':_0x249353[_0x53e055(0x16a)]}}},_0x2035f5=0x3,_0x317e58=[0x3e8,0x7d0,0xfa0];for(let _0x502781=0x0;_0x502781<=_0x2035f5;_0x502781++){const _0x49521a=await this['httpClient'][_0x53e055(0x190)](_0x53e055(0x166),'/api/chats',{'headers':{'Content-Type':_0x53e055(0x16f),'Accept':'application/vnd.api+json'},'body':_0x293607});if(_0x49521a[_0x53e055(0x199)]&&_0x49521a[_0x53e055(0x199)]['id'])return _0x49521a[_0x53e055(0x199)];if(_0x502781>=_0x2035f5)throw new SDKError(ErrorCode[_0x53e055(0x169)],'Failed\x20to\x20create\x20chat\x20after\x20'+(_0x2035f5+0x1)+_0x53e055(0x119));const _0xa5e8ff=_0x317e58[_0x502781];console['warn'](_0x53e055(0x1a9)+(_0x502781+0x1)+'/'+_0x2035f5+_0x53e055(0x135)+_0xa5e8ff+_0x53e055(0x186)),await new Promise(_0x113acf=>setTimeout(_0x113acf,_0xa5e8ff));}throw new SDKError(ErrorCode['LLM_CHAT_CREATION_FAILURE'],_0x53e055(0x17e));}async*[a93_0x465343(0x155)](_0x34359c,_0x5c37db,_0x36c0c1){const _0x46449d=a93_0x465343,_0x49d6e2=_0x5c37db[_0x46449d(0x17b)]();if(!_0x49d6e2)throw new SDKError(ErrorCode[_0x46449d(0x1a5)],'Message\x20cannot\x20be\x20empty\x20or\x20whitespace\x20only',undefined,{'helpText':_0x46449d(0x160)});this[_0x46449d(0x14e)][_0x46449d(0x1a0)](_0x46449d(0x183)+_0x34359c+_0x46449d(0x136)+_0x5c37db[_0x46449d(0x150)]+_0x46449d(0x178));const _0x13c336=_0x46449d(0x192)+encodeURIComponent(_0x34359c)+_0x46449d(0x176),_0x4e2b9f={'input':_0x5c37db};try{const _0x31e9f6=await this[_0x46449d(0x126)]['requestSSE'](_0x46449d(0x166),_0x13c336,{'headers':{'Content-Type':_0x46449d(0x145),'Accept':_0x46449d(0x18d)},'body':_0x4e2b9f,'signal':_0x36c0c1});this[_0x46449d(0x14e)]['debug']('['+_0x31e9f6['status']+_0x46449d(0x11b)+_0x34359c),yield*parseSSEStream(_0x31e9f6,this[_0x46449d(0x14e)]);}catch(_0x5d9436){throw new SDKError(ErrorCode[_0x46449d(0x181)],_0x46449d(0x196)+_0x34359c+_0x46449d(0x15e)+_0x5c37db['length']+')',_0x5d9436);}}async[a93_0x465343(0x15c)](_0xe2d4d8){const _0x234fd2=a93_0x465343,_0x557c14=_0x234fd2(0x127)+encodeURIComponent(_0xe2d4d8),_0x3ccc4f=await this['httpClient'][_0x234fd2(0x190)](_0x234fd2(0x185),_0x557c14);return _0x3ccc4f[_0x234fd2(0x199)];}async[a93_0x465343(0x157)](_0x4b02ec){const _0x392949=a93_0x465343;return this[_0x392949(0x11a)](_0x392949(0x148)+encodeURIComponent(_0x4b02ec)+_0x392949(0x123));}async['createKnowledgeBase'](_0x49d836){const _0x2c942f=a93_0x465343,_0x5a0a55={'data':{'type':'knowledge_bases','attributes':_0x49d836}},_0x323875=await this[_0x2c942f(0x126)][_0x2c942f(0x190)](_0x2c942f(0x166),'/api/knowledge_bases',{'headers':{'Content-Type':'application/vnd.api+json','Accept':'application/vnd.api+json'},'body':_0x5a0a55});return _0x323875['data'];}async[a93_0x465343(0x132)](_0x208076,_0x3a83b8){const _0x31e497=a93_0x465343;return this[_0x31e497(0x11a)](_0x31e497(0x13b)+encodeURIComponent(_0x208076)+_0x31e497(0x14f)+encodeURIComponent(_0x3a83b8)+_0x31e497(0x123));}async['listTextKnowledgeBases'](_0x26299f){const _0xf30ca0=a93_0x465343,_0x273fa6=await this['paginateAll'](_0xf30ca0(0x1a1)+encodeURIComponent(_0x26299f)+_0xf30ca0(0x123));return _0x273fa6[_0xf30ca0(0x193)](_0x1b0778=>({..._0x1b0778,'type':_0xf30ca0(0x143)}));}async['getTextKnowledgeBase'](_0x55e085){const _0x201765=a93_0x465343,_0x329897=await this[_0x201765(0x126)][_0x201765(0x190)](_0x201765(0x185),_0x201765(0x152)+encodeURIComponent(_0x55e085),{'headers':{'Accept':_0x201765(0x16f)}});return _0x329897[_0x201765(0x199)];}async['createTextKnowledgeBase'](_0x75ead2){const _0x4cc969=a93_0x465343,_0x3bf143={'data':{'type':_0x4cc969(0x143),'attributes':_0x75ead2}},_0x38fc25=await this[_0x4cc969(0x126)][_0x4cc969(0x190)](_0x4cc969(0x166),'/api/text_knowledge_bases',{'headers':{'Content-Type':_0x4cc969(0x16f),'Accept':_0x4cc969(0x16f)},'body':_0x3bf143});return _0x38fc25['data'];}async['updateTextKnowledgeBase'](_0x5ce53c,_0x697f65){const _0x78ae3=a93_0x465343,_0x25ae22={'data':{'type':_0x78ae3(0x143),'id':_0x5ce53c,'attributes':_0x697f65}},_0x18224f=await this['httpClient']['request']('PATCH',_0x78ae3(0x152)+encodeURIComponent(_0x5ce53c),{'headers':{'Content-Type':'application/vnd.api+json','Accept':_0x78ae3(0x16f)},'body':_0x25ae22});return _0x18224f[_0x78ae3(0x199)];}async[a93_0x465343(0x17a)](_0x187b75){const _0x318be1=a93_0x465343,_0x73ed54={'data':{'type':'imageGenerators','attributes':{..._0x187b75,'imageModelType':_0x187b75[_0x318be1(0x171)]||_0x318be1(0x12a),'imageReturnMode':_0x187b75['imageReturnMode']||'ID'}}},_0x1bc4d9=await this[_0x318be1(0x126)]['request'](_0x318be1(0x166),_0x318be1(0x19d),{'headers':{'Content-Type':_0x318be1(0x16f),'Accept':_0x318be1(0x16f)},'body':_0x73ed54});return _0x1bc4d9['data'];}async[a93_0x465343(0x1a7)](_0x387dac){const _0xe8c7c4=a93_0x465343,_0x25af48={'data':{'type':_0xe8c7c4(0x120),'attributes':{'projectId':_0x387dac['projectId'],'name':_0x387dac[_0xe8c7c4(0x175)],'modelType':_0x387dac[_0xe8c7c4(0x12c)]||'gpt-4o','searchContextSize':_0x387dac[_0xe8c7c4(0x16c)]||'medium','userLocation':_0x387dac[_0xe8c7c4(0x122)]||{'type':_0xe8c7c4(0x13c),'country':'US','city':_0xe8c7c4(0x194),'region':_0xe8c7c4(0x15d),'timezone':'America/Los_Angeles'},'systemPrompt':_0x387dac['systemPrompt']||_0xe8c7c4(0x173),'filters':_0x387dac[_0xe8c7c4(0x180)]||{'allowed_domains':[]}}}},_0x4ab01a=await this[_0xe8c7c4(0x126)][_0xe8c7c4(0x190)](_0xe8c7c4(0x166),_0xe8c7c4(0x12f),{'headers':{'Content-Type':_0xe8c7c4(0x16f),'Accept':_0xe8c7c4(0x16f)},'body':_0x25af48});return _0x4ab01a[_0xe8c7c4(0x199)];}async[a93_0x465343(0x18e)](_0x47faef){const _0x5f1662=a93_0x465343,_0x1db82e=await this['paginateAll'](_0x5f1662(0x182)+encodeURIComponent(_0x47faef)+_0x5f1662(0x123));return _0x1db82e[_0x5f1662(0x193)](_0x1f7b5e=>({..._0x1f7b5e,'type':_0x5f1662(0x139)}));}async[a93_0x465343(0x13d)](_0x3c95d3){const _0x48cf72=a93_0x465343,_0x57cf82=await this[_0x48cf72(0x11a)](_0x48cf72(0x1b6)+encodeURIComponent(_0x3c95d3)+_0x48cf72(0x123));return _0x57cf82[_0x48cf72(0x193)](_0x462959=>({..._0x462959,'type':'webSearchTools'}));}async[a93_0x465343(0x153)](_0x105c5b){const _0x55b414=a93_0x465343,_0xcf0058=await this['paginateAll'](_0x55b414(0x140)+encodeURIComponent(_0x105c5b)+'&page[limit]=1');if(_0xcf0058[_0x55b414(0x150)]===0x0)return undefined;return{..._0xcf0058[0x0],'type':'parentSegmentKnowledgeBases'};}async['listPrompts'](_0x4907a4){const _0x3907bf=a93_0x465343;return this[_0x3907bf(0x11a)](_0x3907bf(0x15b)+encodeURIComponent(_0x4907a4)+'&page[limit]=50');}async['createPrompt'](_0x4eed65){const _0x4e0393=a93_0x465343,{jsonSchemaHint:_0x1d091f,..._0x2210d4}=_0x4eed65,_0x50d462={'data':{'type':'prompts','attributes':_0x2210d4}},_0x271242=await this[_0x4e0393(0x126)][_0x4e0393(0x190)]('POST',_0x4e0393(0x18f),{'headers':{'Content-Type':_0x4e0393(0x16f),'Accept':'application/vnd.api+json'},'body':_0x50d462});return _0x271242[_0x4e0393(0x199)];}async[a93_0x465343(0x187)](_0x349214){const _0xc4abeb=a93_0x465343;return this[_0xc4abeb(0x11a)](_0xc4abeb(0x146)+encodeURIComponent(_0x349214)+'&page[limit]=50');}async['createIntegration'](_0x5e99d0){const _0x23d78a=a93_0x465343,_0x89b9ea={'data':{'type':_0x23d78a(0x198),'attributes':_0x5e99d0}},_0x5dec53=await this[_0x23d78a(0x126)][_0x23d78a(0x190)](_0x23d78a(0x166),_0x23d78a(0x18a),{'headers':{'Content-Type':'application/vnd.api+json','Accept':'application/vnd.api+json'},'body':_0x89b9ea});return _0x5dec53[_0x23d78a(0x199)];}async[a93_0x465343(0x1a4)](_0x92691c){const _0x415e39=a93_0x465343,_0x9cfe5f=await this['paginateAll'](_0x415e39(0x149)+encodeURIComponent(_0x92691c)+_0x415e39(0x123));return _0x9cfe5f['map'](_0x32b0d5=>({..._0x32b0d5,'type':_0x415e39(0x19c)}));}async['getExperimentalKnowledgeBase'](_0x2ab98b){const _0x391c20=a93_0x465343,_0x24bd76=await this[_0x391c20(0x126)]['request'](_0x391c20(0x185),_0x391c20(0x14d)+encodeURIComponent(_0x2ab98b),{'headers':{'Accept':_0x391c20(0x16f)}});return _0x24bd76[_0x391c20(0x199)];}async[a93_0x465343(0x197)](_0x2548d9){const _0x3101d8=a93_0x465343,_0x7c1164={'data':{'type':'experimentalKnowledgeBases','attributes':_0x2548d9}},_0x58435c=await this['httpClient'][_0x3101d8(0x190)](_0x3101d8(0x166),_0x3101d8(0x17d),{'headers':{'Content-Type':_0x3101d8(0x16f),'Accept':'application/vnd.api+json'},'body':_0x7c1164});return _0x58435c['data'];}async[a93_0x465343(0x129)](_0x2a223d,_0xcec75a){const _0x25a0cb=a93_0x465343,_0x49d66e={'data':{'type':_0x25a0cb(0x19c),'id':_0x2a223d,'attributes':_0xcec75a}},_0x169526=await this[_0x25a0cb(0x126)][_0x25a0cb(0x190)]('PATCH',_0x25a0cb(0x14d)+encodeURIComponent(_0x2a223d),{'headers':{'Content-Type':_0x25a0cb(0x16f),'Accept':_0x25a0cb(0x16f)},'body':_0x49d66e});return _0x169526[_0x25a0cb(0x199)];}async[a93_0x465343(0x11c)](_0x11bebb){const _0x109e8d=a93_0x465343;return this['paginateAll'](_0x109e8d(0x147)+encodeURIComponent(_0x11bebb)+'&page[limit]=50');}async[a93_0x465343(0x184)](_0x3a05ab){const _0x5f0e32=a93_0x465343,_0x3bb647=await this[_0x5f0e32(0x126)][_0x5f0e32(0x190)](_0x5f0e32(0x185),_0x5f0e32(0x1ae)+encodeURIComponent(_0x3a05ab),{'headers':{'Accept':_0x5f0e32(0x16f)}});return _0x3bb647[_0x5f0e32(0x199)];}async[a93_0x465343(0x137)](_0x2d45b1){const _0x176519=a93_0x465343,_0x3ff391={'data':{'type':_0x176519(0x154),'attributes':_0x2d45b1}},_0xf4de33=await this[_0x176519(0x126)][_0x176519(0x190)](_0x176519(0x166),_0x176519(0x13a),{'headers':{'Content-Type':_0x176519(0x16f),'Accept':_0x176519(0x16f)},'body':_0x3ff391});return _0xf4de33[_0x176519(0x199)];}async[a93_0x465343(0x179)](_0xd80023,_0x20aced){const _0x650296=a93_0x465343,_0x290399={'data':{'type':_0x650296(0x154),'id':_0xd80023,'attributes':_0x20aced}},_0x214046=await this[_0x650296(0x126)]['request'](_0x650296(0x177),_0x650296(0x1ae)+encodeURIComponent(_0xd80023),{'headers':{'Content-Type':_0x650296(0x16f),'Accept':_0x650296(0x16f)},'body':_0x290399});return _0x214046['data'];}async['listAgentsFull'](_0x478233){const _0x450c18=a93_0x465343,_0xc7a89d=await this['listAgents'](_0x478233),_0x13b9c2=[];for(const _0x25cbd4 of _0xc7a89d){const _0xd4caf8=_0x450c18(0x13f)+encodeURIComponent(_0x25cbd4['id']),_0x414d21=await this[_0x450c18(0x126)]['request']('GET',_0xd4caf8);_0x13b9c2[_0x450c18(0x16b)](_0x414d21[_0x450c18(0x199)]);}return _0x13b9c2;}async[a93_0x465343(0x162)](_0x50b849){const _0x35966b=a93_0x465343,_0x58f4e2={'data':{'type':_0x35966b(0x128),'attributes':_0x50b849}},_0xc52aec=await this[_0x35966b(0x126)]['request'](_0x35966b(0x166),_0x35966b(0x118),{'headers':{'Content-Type':'application/vnd.api+json','Accept':_0x35966b(0x16f)},'body':_0x58f4e2});return _0xc52aec[_0x35966b(0x199)];}async['updateAgentResponse'](_0x271834,_0x3adfe8){const _0x3e156e=a93_0x465343,_0x39ec0c={'data':{'type':_0x3e156e(0x128),'id':_0x271834,'attributes':_0x3adfe8}},_0x515bd4=_0x3e156e(0x13f)+encodeURIComponent(_0x271834),_0x1d114a=await this['httpClient'][_0x3e156e(0x190)]('PATCH',_0x515bd4,{'headers':{'Content-Type':_0x3e156e(0x16f),'Accept':_0x3e156e(0x16f)},'body':_0x39ec0c});return _0x1d114a[_0x3e156e(0x199)];}async[a93_0x465343(0x1b3)](_0x438c15,_0xc54701){const _0x2bdfa3=a93_0x465343,_0x5cc224={'data':{'type':_0x2bdfa3(0x14c),'id':_0x438c15,'attributes':_0xc54701}},_0x54431a=_0x2bdfa3(0x17c)+encodeURIComponent(_0x438c15),_0x59f258=await this[_0x2bdfa3(0x126)]['request'](_0x2bdfa3(0x177),_0x54431a,{'headers':{'Content-Type':_0x2bdfa3(0x16f),'Accept':_0x2bdfa3(0x16f)},'body':_0x5cc224});return _0x59f258[_0x2bdfa3(0x199)];}async[a93_0x465343(0x1b5)](_0x349850,_0x83695b){const _0x49d67b=a93_0x465343,{jsonSchemaHint:_0x483336,..._0xb9c476}=_0x83695b,_0x65c86d={'data':{'type':_0x49d67b(0x1a6),'id':_0x349850,'attributes':_0xb9c476}},_0x58919f='/api/prompts/'+encodeURIComponent(_0x349850),_0xc0ef62=await this['httpClient'][_0x49d67b(0x190)](_0x49d67b(0x177),_0x58919f,{'headers':{'Content-Type':_0x49d67b(0x16f),'Accept':_0x49d67b(0x16f)},'body':_0x65c86d});return _0xc0ef62[_0x49d67b(0x199)];}async[a93_0x465343(0x11d)](_0x22f55b,_0x5c0d21){const _0x1e4c1d=a93_0x465343,_0x595782={'data':{'type':_0x1e4c1d(0x198),'id':_0x22f55b,'attributes':_0x5c0d21}},_0x4e7f2c=_0x1e4c1d(0x11f)+encodeURIComponent(_0x22f55b),_0x20f86d=await this['httpClient'][_0x1e4c1d(0x190)]('PATCH',_0x4e7f2c,{'headers':{'Content-Type':'application/vnd.api+json','Accept':'application/vnd.api+json'},'body':_0x595782});return _0x20f86d[_0x1e4c1d(0x199)];}async[a93_0x465343(0x164)](_0x809e9f){const _0x9cc3bd=a93_0x465343,_0x1a5fd6='/api/integrations/'+encodeURIComponent(_0x809e9f);await this[_0x9cc3bd(0x126)]['request']('DELETE',_0x1a5fd6);}}
1
+ const a93_0x40a016=a93_0x452c;(function(_0x544102,_0x4b75c6){const _0xe13d62=a93_0x452c,_0x336c00=_0x544102();while(!![]){try{const _0x52de33=-parseInt(_0xe13d62(0x270))/0x1+parseInt(_0xe13d62(0x245))/0x2*(parseInt(_0xe13d62(0x203))/0x3)+-parseInt(_0xe13d62(0x259))/0x4*(parseInt(_0xe13d62(0x261))/0x5)+-parseInt(_0xe13d62(0x244))/0x6+parseInt(_0xe13d62(0x1e4))/0x7*(-parseInt(_0xe13d62(0x24e))/0x8)+-parseInt(_0xe13d62(0x200))/0x9+parseInt(_0xe13d62(0x253))/0xa;if(_0x52de33===_0x4b75c6)break;else _0x336c00['push'](_0x336c00['shift']());}catch(_0x406985){_0x336c00['push'](_0x336c00['shift']());}}}(a93_0x8b17,0xaa97f));import{HTTPClient}from'./http-client.js';import{getEndpoint}from'../types/index.js';import{getAuthHeaders,toHeaderRecord}from'../../core/auth.js';import{parseSSEStream}from'../../utils/sse-parser.js';function a93_0x452c(_0x118510,_0xacd71e){_0x118510=_0x118510-0x1e3;const _0x8b17b0=a93_0x8b17();let _0x452c2a=_0x8b17b0[_0x118510];return _0x452c2a;}import{ErrorCode,SDKError}from'../errors.js';import{Logger}from'../../utils/logger/index.js';export class LLMApiClient{[a93_0x40a016(0x21d)];['baseUrl'];['authHeaders'];[a93_0x40a016(0x262)]=Logger['of'](a93_0x40a016(0x25e));constructor(_0xce8b95){const _0x296d43=a93_0x40a016;this[_0x296d43(0x234)]=getEndpoint(_0xce8b95[_0x296d43(0x1f9)],_0x296d43(0x202)),this[_0x296d43(0x225)]=toHeaderRecord(getAuthHeaders(_0xce8b95['site'],_0xce8b95['apiKey'],_0xce8b95[_0x296d43(0x231)])),this['httpClient']=new HTTPClient(this[_0x296d43(0x234)],this[_0x296d43(0x225)],{'proxy':_0xce8b95[_0x296d43(0x201)]});}async['paginateAll'](_0x163d6b){const _0x58b381=a93_0x40a016,_0x4e7c26=[];let _0x24eb92=_0x163d6b;while(_0x24eb92){const _0x3111cd=await this[_0x58b381(0x21d)]['request'](_0x58b381(0x21e),_0x24eb92);_0x3111cd[_0x58b381(0x250)]&&_0x4e7c26[_0x58b381(0x207)](..._0x3111cd[_0x58b381(0x250)]);_0x24eb92=_0x3111cd['links']?.['next'];if(_0x24eb92&&_0x24eb92[_0x58b381(0x278)]('http')){const _0x20b539=new URL(_0x24eb92);_0x24eb92=_0x20b539[_0x58b381(0x265)]+_0x20b539[_0x58b381(0x242)];}}return _0x4e7c26;}async[a93_0x40a016(0x1ee)](){const _0x34a6a3=a93_0x40a016;return await this[_0x34a6a3(0x21d)][_0x34a6a3(0x1fb)](_0x34a6a3(0x21e),_0x34a6a3(0x1e8));}async[a93_0x40a016(0x267)](_0x27dca1){const _0x1e7888=a93_0x40a016,_0x15558f={'data':{'type':_0x1e7888(0x26a),'attributes':{'name':_0x27dca1[_0x1e7888(0x23d)],..._0x27dca1[_0x1e7888(0x1f2)]&&{'description':_0x27dca1[_0x1e7888(0x1f2)]}}}},_0x2cf5b5=await this[_0x1e7888(0x21d)][_0x1e7888(0x1fb)](_0x1e7888(0x23a),_0x1e7888(0x27a),{'headers':{'Content-Type':_0x1e7888(0x1fd),'Accept':_0x1e7888(0x1fd)},'body':_0x15558f});return _0x2cf5b5[_0x1e7888(0x250)];}async['deleteProject'](_0x4df12b){const _0x127ee6=a93_0x40a016,_0x37305b='/api/projects/'+encodeURIComponent(_0x4df12b);await this[_0x127ee6(0x21d)][_0x127ee6(0x1fb)]('DELETE',_0x37305b);}async[a93_0x40a016(0x232)](_0x57e180=0x32){const _0x11d6d1=a93_0x40a016;return this['paginateAll'](_0x11d6d1(0x1f5)+_0x57e180);}async[a93_0x40a016(0x219)](_0x35b477){const _0x4417e4=a93_0x40a016;let _0x12068a=_0x4417e4(0x257);return _0x35b477&&(_0x12068a+=_0x4417e4(0x24b)+encodeURIComponent(_0x35b477)),this['paginateAll'](_0x12068a);}async[a93_0x40a016(0x229)](_0x2e80e5){const _0x3dc217=a93_0x40a016,_0x299523=_0x3dc217(0x210)+encodeURIComponent(_0x2e80e5),_0x574dc6=await this[_0x3dc217(0x21d)][_0x3dc217(0x1fb)]('GET',_0x299523);return _0x574dc6[_0x3dc217(0x250)];}async[a93_0x40a016(0x22e)](_0x216d4a){const _0x4f94c9=a93_0x40a016,_0x5acfeb={'name':_0x216d4a[_0x4f94c9(0x23d)],'projectId':_0x216d4a[_0x4f94c9(0x236)],'modelType':_0x216d4a[_0x4f94c9(0x23b)],'maxToolIterations':_0x216d4a[_0x4f94c9(0x21b)]??0x4,'temperature':_0x216d4a['temperature']??0.7};_0x216d4a[_0x4f94c9(0x20b)]!==undefined&&(_0x5acfeb[_0x4f94c9(0x20b)]=_0x216d4a[_0x4f94c9(0x20b)]);_0x216d4a['starterMessage']&&(_0x5acfeb[_0x4f94c9(0x20d)]=_0x216d4a[_0x4f94c9(0x20d)]);_0x216d4a['reasoningEffort']&&(_0x5acfeb[_0x4f94c9(0x272)]=_0x216d4a['reasoningEffort']);_0x216d4a[_0x4f94c9(0x204)]&&_0x216d4a[_0x4f94c9(0x204)][_0x4f94c9(0x241)]>0x0&&(_0x5acfeb[_0x4f94c9(0x204)]=_0x216d4a[_0x4f94c9(0x204)]);const _0x526b01={'data':{'type':_0x4f94c9(0x212),'attributes':_0x5acfeb}},_0xdc26e5=await this[_0x4f94c9(0x21d)]['request']('POST',_0x4f94c9(0x1ff),{'headers':{'Content-Type':'application/vnd.api+json','Accept':'application/vnd.api+json'},'body':_0x526b01});return _0xdc26e5['data'];}async[a93_0x40a016(0x215)](_0x2fadff,_0x3fbb50){const _0x54c441=a93_0x40a016,_0x1b7e11={'data':{'type':_0x54c441(0x212),'id':_0x2fadff,'attributes':{..._0x3fbb50[_0x54c441(0x23d)]&&{'name':_0x3fbb50['name']},..._0x3fbb50[_0x54c441(0x1f2)]&&{'description':_0x3fbb50[_0x54c441(0x1f2)]},..._0x3fbb50[_0x54c441(0x21a)]&&{'prompt':_0x3fbb50[_0x54c441(0x21a)]},..._0x3fbb50[_0x54c441(0x20d)]&&{'starter_message':_0x3fbb50['starterMessage']},..._0x3fbb50[_0x54c441(0x272)]&&{'reasoningEffort':_0x3fbb50['reasoningEffort']}}}},_0x167182=_0x54c441(0x210)+encodeURIComponent(_0x2fadff),_0x58abf7=await this[_0x54c441(0x21d)][_0x54c441(0x1fb)](_0x54c441(0x1ec),_0x167182,{'headers':{'Content-Type':_0x54c441(0x1fd)},'body':_0x1b7e11});return _0x58abf7[_0x54c441(0x250)];}async[a93_0x40a016(0x25c)](_0x4b178b){const _0x1c52e4=a93_0x40a016,_0x32b98f=_0x1c52e4(0x210)+encodeURIComponent(_0x4b178b);await this[_0x1c52e4(0x21d)][_0x1c52e4(0x1fb)](_0x1c52e4(0x22c),_0x32b98f);}async['listChats'](_0x3479d9=0x32){const _0x40e9ff=a93_0x40a016,_0x4b663c=new URLSearchParams();_0x4b663c[_0x40e9ff(0x276)]('page[limit]',String(_0x3479d9)),_0x4b663c[_0x40e9ff(0x276)](_0x40e9ff(0x27b),_0x40e9ff(0x237));const _0x48aadc=_0x40e9ff(0x25b)+_0x4b663c[_0x40e9ff(0x1e7)](),_0x5b37d5=await this[_0x40e9ff(0x21d)][_0x40e9ff(0x1fb)](_0x40e9ff(0x21e),_0x48aadc);return _0x5b37d5[_0x40e9ff(0x250)]||[];}async[a93_0x40a016(0x243)](_0x3c2465){const _0x4cc76e=a93_0x40a016,_0xde3d27=_0x4cc76e(0x26d)+encodeURIComponent(_0x3c2465),_0x503999=await this[_0x4cc76e(0x21d)][_0x4cc76e(0x1fb)](_0x4cc76e(0x21e),_0xde3d27);return _0x503999[_0x4cc76e(0x250)];}async['getChatHistory'](_0x55f0b0){const _0x3aa60b=a93_0x40a016,_0x5b772e=_0x3aa60b(0x26d)+encodeURIComponent(_0x55f0b0)+_0x3aa60b(0x1f4);return await this[_0x3aa60b(0x21d)][_0x3aa60b(0x1fb)](_0x3aa60b(0x21e),_0x5b772e);}async['getChatLog'](_0x406474){const _0x431cec=a93_0x40a016,_0x34a569=_0x431cec(0x26d)+encodeURIComponent(_0x406474)+_0x431cec(0x249);return await this['httpClient'][_0x431cec(0x1fb)]('GET',_0x34a569);}async['startChat'](_0x50b1ad){const _0x4a4b6e=a93_0x40a016,_0x1f9d17={'data':{'type':_0x4a4b6e(0x20c),'attributes':{'agentId':_0x50b1ad[_0x4a4b6e(0x233)]}}},_0x39ae96=0x3,_0x3ee293=[0x3e8,0x7d0,0xfa0];for(let _0x45cf1b=0x0;_0x45cf1b<=_0x39ae96;_0x45cf1b++){const _0x3365b9=await this[_0x4a4b6e(0x21d)][_0x4a4b6e(0x1fb)](_0x4a4b6e(0x23a),_0x4a4b6e(0x271),{'headers':{'Content-Type':_0x4a4b6e(0x1fd),'Accept':'application/vnd.api+json'},'body':_0x1f9d17});if(_0x3365b9[_0x4a4b6e(0x250)]&&_0x3365b9[_0x4a4b6e(0x250)]['id'])return _0x3365b9['data'];if(_0x45cf1b>=_0x39ae96)throw new SDKError(ErrorCode['LLM_CHAT_CREATION_FAILURE'],_0x4a4b6e(0x230)+(_0x39ae96+0x1)+_0x4a4b6e(0x216));const _0x4b5399=_0x3ee293[_0x45cf1b];console[_0x4a4b6e(0x20f)]('[Retry\x20'+(_0x45cf1b+0x1)+'/'+_0x39ae96+_0x4a4b6e(0x255)+_0x4b5399+_0x4a4b6e(0x24c)),await new Promise(_0xf359d1=>setTimeout(_0xf359d1,_0x4b5399));}throw new SDKError(ErrorCode[_0x4a4b6e(0x273)],'Failed\x20to\x20create\x20chat:\x20unexpected\x20error');}async*['continueChat'](_0x3b3f0b,_0x40024c,_0x38f6de){const _0x530cf4=a93_0x40a016,_0x4eb840=_0x40024c['trim']();if(!_0x4eb840)throw new SDKError(ErrorCode[_0x530cf4(0x22f)],'Message\x20cannot\x20be\x20empty\x20or\x20whitespace\x20only',undefined,{'helpText':_0x530cf4(0x263)});this['logger'][_0x530cf4(0x275)]('Continuing\x20chat\x20'+_0x3b3f0b+_0x530cf4(0x228)+_0x40024c[_0x530cf4(0x241)]+_0x530cf4(0x223));const _0x153156=_0x530cf4(0x26d)+encodeURIComponent(_0x3b3f0b)+_0x530cf4(0x269),_0x537bc3={'input':_0x40024c};try{const _0x87b1d=await this[_0x530cf4(0x21d)][_0x530cf4(0x227)]('POST',_0x153156,{'headers':{'Content-Type':_0x530cf4(0x239),'Accept':_0x530cf4(0x25d)},'body':_0x537bc3,'signal':_0x38f6de});this[_0x530cf4(0x262)][_0x530cf4(0x275)]('['+_0x87b1d[_0x530cf4(0x256)]+_0x530cf4(0x26b)+_0x3b3f0b),yield*parseSSEStream(_0x87b1d,this[_0x530cf4(0x262)]);}catch(_0x30a008){throw new SDKError(ErrorCode['LLM_STREAM_ERROR'],_0x530cf4(0x218)+_0x3b3f0b+',\x20message\x20length:\x20'+_0x40024c[_0x530cf4(0x241)]+')',_0x30a008);}}async[a93_0x40a016(0x1fc)](_0xec1b35){const _0x9a500b=a93_0x40a016,_0x51829c=_0x9a500b(0x25f)+encodeURIComponent(_0xec1b35),_0x559e66=await this[_0x9a500b(0x21d)][_0x9a500b(0x1fb)](_0x9a500b(0x21e),_0x51829c);return _0x559e66[_0x9a500b(0x250)];}async['listKnowledgeBases'](_0x26b16b){const _0x1a99ab=a93_0x40a016;return this[_0x1a99ab(0x23f)](_0x1a99ab(0x22d)+encodeURIComponent(_0x26b16b)+_0x1a99ab(0x268));}async[a93_0x40a016(0x1e9)](_0x276b5a){const _0x5637cb=a93_0x40a016,_0x2d9549={'data':{'type':_0x5637cb(0x217),'attributes':_0x276b5a}},_0x5aa2bf=await this['httpClient'][_0x5637cb(0x1fb)](_0x5637cb(0x23a),_0x5637cb(0x1e6),{'headers':{'Content-Type':_0x5637cb(0x1fd),'Accept':'application/vnd.api+json'},'body':_0x2d9549});return _0x5aa2bf[_0x5637cb(0x250)];}async[a93_0x40a016(0x221)](_0x730649,_0x42f022){const _0x4794d9=a93_0x40a016;return this['paginateAll'](_0x4794d9(0x224)+encodeURIComponent(_0x730649)+'&filter[project_id]='+encodeURIComponent(_0x42f022)+'&page[limit]=50');}async[a93_0x40a016(0x277)](_0x47a855){const _0x1f1625=a93_0x40a016,_0x4175a2=await this[_0x1f1625(0x23f)](_0x1f1625(0x1ed)+encodeURIComponent(_0x47a855)+_0x1f1625(0x268));return _0x4175a2['map'](_0x3e5a83=>({..._0x3e5a83,'type':_0x1f1625(0x247)}));}async[a93_0x40a016(0x22a)](_0x1a8f96){const _0x583dbc=a93_0x40a016,_0x3eac94=await this[_0x583dbc(0x21d)][_0x583dbc(0x1fb)](_0x583dbc(0x21e),_0x583dbc(0x22b)+encodeURIComponent(_0x1a8f96),{'headers':{'Accept':'application/vnd.api+json'}});return _0x3eac94[_0x583dbc(0x250)];}async[a93_0x40a016(0x20e)](_0x55fa81){const _0x46555e=a93_0x40a016,_0x1fb3b5={'data':{'type':'textKnowledgeBases','attributes':_0x55fa81}},_0xed0d32=await this[_0x46555e(0x21d)][_0x46555e(0x1fb)](_0x46555e(0x23a),'/api/text_knowledge_bases',{'headers':{'Content-Type':'application/vnd.api+json','Accept':_0x46555e(0x1fd)},'body':_0x1fb3b5});return _0xed0d32['data'];}async[a93_0x40a016(0x26f)](_0xfaf4a0,_0x1b1c56){const _0x515b77=a93_0x40a016,_0x2f8682={'data':{'type':'textKnowledgeBases','id':_0xfaf4a0,'attributes':_0x1b1c56}},_0x118cb3=await this[_0x515b77(0x21d)]['request'](_0x515b77(0x1ec),_0x515b77(0x22b)+encodeURIComponent(_0xfaf4a0),{'headers':{'Content-Type':_0x515b77(0x1fd),'Accept':_0x515b77(0x1fd)},'body':_0x2f8682});return _0x118cb3[_0x515b77(0x250)];}async[a93_0x40a016(0x1fe)](_0x4ecdba){const _0x377120=a93_0x40a016,_0x2ef64e={'data':{'type':_0x377120(0x25a),'attributes':{..._0x4ecdba,'imageModelType':_0x4ecdba[_0x377120(0x274)]||_0x377120(0x222),'imageReturnMode':_0x4ecdba['imageReturnMode']||'ID'}}},_0x54cf0c=await this[_0x377120(0x21d)]['request'](_0x377120(0x23a),_0x377120(0x208),{'headers':{'Content-Type':_0x377120(0x1fd),'Accept':_0x377120(0x1fd)},'body':_0x2ef64e});return _0x54cf0c[_0x377120(0x250)];}async['createWebSearchTool'](_0x2bbab1){const _0x19ea3b=a93_0x40a016,_0x31f4e5={'data':{'type':_0x19ea3b(0x1fa),'attributes':{'projectId':_0x2bbab1[_0x19ea3b(0x236)],'name':_0x2bbab1['name'],'modelType':_0x2bbab1[_0x19ea3b(0x23b)]||_0x19ea3b(0x279),'searchContextSize':_0x2bbab1['searchContextSize']||_0x19ea3b(0x1f7),'userLocation':_0x2bbab1[_0x19ea3b(0x248)]||{'type':_0x19ea3b(0x226),'country':'US','city':_0x19ea3b(0x1f6),'region':'California','timezone':_0x19ea3b(0x23e)},'systemPrompt':_0x2bbab1[_0x19ea3b(0x20b)]||_0x19ea3b(0x1f3),'filters':_0x2bbab1['filters']||{'allowed_domains':[]}}}},_0x5312de=await this[_0x19ea3b(0x21d)][_0x19ea3b(0x1fb)](_0x19ea3b(0x23a),'/api/web_search_tools',{'headers':{'Content-Type':_0x19ea3b(0x1fd),'Accept':_0x19ea3b(0x1fd)},'body':_0x31f4e5});return _0x5312de['data'];}async[a93_0x40a016(0x1ef)](_0x14d216){const _0x2f435e=a93_0x40a016,_0x14dc31=await this['paginateAll'](_0x2f435e(0x23c)+encodeURIComponent(_0x14d216)+'&page[limit]=50');return _0x14dc31[_0x2f435e(0x252)](_0x24eb0a=>({..._0x24eb0a,'type':_0x2f435e(0x25a)}));}async[a93_0x40a016(0x240)](_0x1d45a8){const _0x184e33=a93_0x40a016,_0x1b00ff=await this[_0x184e33(0x23f)](_0x184e33(0x206)+encodeURIComponent(_0x1d45a8)+_0x184e33(0x268));return _0x1b00ff[_0x184e33(0x252)](_0x3a5317=>({..._0x3a5317,'type':_0x184e33(0x1fa)}));}async[a93_0x40a016(0x24d)](_0x19a92a){const _0xb543b=a93_0x40a016,_0x3cfc55=await this[_0xb543b(0x23f)](_0xb543b(0x24f)+encodeURIComponent(_0x19a92a)+_0xb543b(0x260));if(_0x3cfc55[_0xb543b(0x241)]===0x0)return undefined;return{..._0x3cfc55[0x0],'type':_0xb543b(0x27c)};}async['listPrompts'](_0x581402){const _0x568ca6=a93_0x40a016;return this[_0x568ca6(0x23f)](_0x568ca6(0x220)+encodeURIComponent(_0x581402)+_0x568ca6(0x268));}async[a93_0x40a016(0x26c)](_0x106702){const _0x41c8b4=a93_0x40a016,{jsonSchemaHint:_0x55760d,..._0x4ccf83}=_0x106702,_0x449ee9={'data':{'type':'prompts','attributes':_0x4ccf83}},_0x348cb2=await this['httpClient'][_0x41c8b4(0x1fb)]('POST','/api/prompts',{'headers':{'Content-Type':_0x41c8b4(0x1fd),'Accept':_0x41c8b4(0x1fd)},'body':_0x449ee9});return _0x348cb2[_0x41c8b4(0x250)];}async[a93_0x40a016(0x26e)](_0x1f50f0){const _0x28abbc=a93_0x40a016;return this[_0x28abbc(0x23f)](_0x28abbc(0x21c)+encodeURIComponent(_0x1f50f0)+_0x28abbc(0x268));}async[a93_0x40a016(0x1f1)](_0x97bbf7){const _0x8fca83=a93_0x40a016,_0x581f55={'data':{'type':'integrations','attributes':_0x97bbf7}},_0x5376aa=await this['httpClient'][_0x8fca83(0x1fb)](_0x8fca83(0x23a),'/api/integrations',{'headers':{'Content-Type':'application/vnd.api+json','Accept':_0x8fca83(0x1fd)},'body':_0x581f55});return _0x5376aa[_0x8fca83(0x250)];}async['listExperimentalKnowledgeBases'](_0x4fd75a){const _0x1030c9=a93_0x40a016,_0x6f5140=await this[_0x1030c9(0x23f)]('/api/tool_targets?filter[targetType]=ExperimentalKnowledgeBase&filter[project_id]='+encodeURIComponent(_0x4fd75a)+'&page[limit]=50');return _0x6f5140[_0x1030c9(0x252)](_0x11efd3=>({..._0x11efd3,'type':_0x1030c9(0x266)}));}async['getExperimentalKnowledgeBase'](_0xa1f24){const _0x4f16ef=a93_0x40a016,_0x3643f1=await this[_0x4f16ef(0x21d)][_0x4f16ef(0x1fb)](_0x4f16ef(0x21e),_0x4f16ef(0x209)+encodeURIComponent(_0xa1f24),{'headers':{'Accept':'application/vnd.api+json'}});return _0x3643f1[_0x4f16ef(0x250)];}async[a93_0x40a016(0x1e5)](_0x3aaee9){const _0x3e0e81=a93_0x40a016,_0x522f91={'data':{'type':_0x3e0e81(0x266),'attributes':_0x3aaee9}},_0x5f53fa=await this[_0x3e0e81(0x21d)][_0x3e0e81(0x1fb)](_0x3e0e81(0x23a),_0x3e0e81(0x1ea),{'headers':{'Content-Type':_0x3e0e81(0x1fd),'Accept':_0x3e0e81(0x1fd)},'body':_0x522f91});return _0x5f53fa['data'];}async[a93_0x40a016(0x238)](_0xdfbca3,_0x1ae60c){const _0x360d5f=a93_0x40a016,_0x1b77c7={'data':{'type':'experimentalKnowledgeBases','id':_0xdfbca3,'attributes':_0x1ae60c}},_0x75a589=await this[_0x360d5f(0x21d)][_0x360d5f(0x1fb)](_0x360d5f(0x1ec),_0x360d5f(0x209)+encodeURIComponent(_0xdfbca3),{'headers':{'Content-Type':'application/vnd.api+json','Accept':_0x360d5f(0x1fd)},'body':_0x1b77c7});return _0x75a589[_0x360d5f(0x250)];}async[a93_0x40a016(0x1eb)](_0x645036){const _0x315003=a93_0x40a016;return this[_0x315003(0x23f)](_0x315003(0x214)+encodeURIComponent(_0x645036)+_0x315003(0x268));}async[a93_0x40a016(0x1f8)](_0x45fcf0){const _0x3591f1=a93_0x40a016,_0x2f191c=await this[_0x3591f1(0x21d)]['request'](_0x3591f1(0x21e),_0x3591f1(0x251)+encodeURIComponent(_0x45fcf0),{'headers':{'Accept':'application/vnd.api+json'}});return _0x2f191c[_0x3591f1(0x250)];}async['createExperimentalArtifact'](_0x1549e9){const _0x10f20e=a93_0x40a016,_0x1a6fd3={'data':{'type':_0x10f20e(0x264),'attributes':_0x1549e9}},_0x5e7213=await this[_0x10f20e(0x21d)][_0x10f20e(0x1fb)](_0x10f20e(0x23a),_0x10f20e(0x24a),{'headers':{'Content-Type':'application/vnd.api+json','Accept':_0x10f20e(0x1fd)},'body':_0x1a6fd3});return _0x5e7213['data'];}async['updateExperimentalArtifact'](_0x122660,_0x2b9763){const _0x1732c9=a93_0x40a016,_0x1f4564={'data':{'type':_0x1732c9(0x264),'id':_0x122660,'attributes':_0x2b9763}},_0x345503=await this[_0x1732c9(0x21d)]['request'](_0x1732c9(0x1ec),_0x1732c9(0x251)+encodeURIComponent(_0x122660),{'headers':{'Content-Type':_0x1732c9(0x1fd),'Accept':_0x1732c9(0x1fd)},'body':_0x1f4564});return _0x345503['data'];}async['listAgentsFull'](_0x46c293){const _0x1b480b=a93_0x40a016,_0x39bac8=await this[_0x1b480b(0x219)](_0x46c293),_0x367282=[];for(const _0x1e162c of _0x39bac8){const _0x3c6c29=_0x1b480b(0x210)+encodeURIComponent(_0x1e162c['id']),_0x353653=await this['httpClient'][_0x1b480b(0x1fb)](_0x1b480b(0x21e),_0x3c6c29);_0x367282[_0x1b480b(0x207)](_0x353653['data']);}return _0x367282;}async[a93_0x40a016(0x254)](_0x19783b){const _0x474e3a=a93_0x40a016,_0x404a94={'data':{'type':_0x474e3a(0x212),'attributes':_0x19783b}},_0x3b7804=await this[_0x474e3a(0x21d)]['request'](_0x474e3a(0x23a),_0x474e3a(0x1ff),{'headers':{'Content-Type':_0x474e3a(0x1fd),'Accept':_0x474e3a(0x1fd)},'body':_0x404a94});return _0x3b7804[_0x474e3a(0x250)];}async[a93_0x40a016(0x205)](_0x2f2309,_0x3667c1){const _0x5d6bd6=a93_0x40a016,_0x3de1d0={'data':{'type':_0x5d6bd6(0x212),'id':_0x2f2309,'attributes':_0x3667c1}},_0x36a716=_0x5d6bd6(0x210)+encodeURIComponent(_0x2f2309),_0x3cc94d=await this[_0x5d6bd6(0x21d)][_0x5d6bd6(0x1fb)](_0x5d6bd6(0x1ec),_0x36a716,{'headers':{'Content-Type':'application/vnd.api+json','Accept':'application/vnd.api+json'},'body':_0x3de1d0});return _0x3cc94d[_0x5d6bd6(0x250)];}async[a93_0x40a016(0x21f)](_0x343a5b,_0x15a2e7){const _0x46bdb2=a93_0x40a016,_0x5a8f30={'data':{'type':_0x46bdb2(0x217),'id':_0x343a5b,'attributes':_0x15a2e7}},_0x10b6b9=_0x46bdb2(0x1f0)+encodeURIComponent(_0x343a5b),_0x3841a1=await this['httpClient']['request'](_0x46bdb2(0x1ec),_0x10b6b9,{'headers':{'Content-Type':_0x46bdb2(0x1fd),'Accept':_0x46bdb2(0x1fd)},'body':_0x5a8f30});return _0x3841a1[_0x46bdb2(0x250)];}async[a93_0x40a016(0x258)](_0x2c26d0,_0x12de19){const _0x569447=a93_0x40a016,{jsonSchemaHint:_0x5ab880,..._0x17e3cf}=_0x12de19,_0x10feaa={'data':{'type':_0x569447(0x213),'id':_0x2c26d0,'attributes':_0x17e3cf}},_0x397968=_0x569447(0x20a)+encodeURIComponent(_0x2c26d0),_0x30c1f2=await this[_0x569447(0x21d)][_0x569447(0x1fb)](_0x569447(0x1ec),_0x397968,{'headers':{'Content-Type':'application/vnd.api+json','Accept':_0x569447(0x1fd)},'body':_0x10feaa});return _0x30c1f2[_0x569447(0x250)];}async[a93_0x40a016(0x1e3)](_0x16144c,_0x21c59d){const _0x4dc15c=a93_0x40a016,_0x5c296e={'data':{'type':_0x4dc15c(0x235),'id':_0x16144c,'attributes':_0x21c59d}},_0x1e144f=_0x4dc15c(0x246)+encodeURIComponent(_0x16144c),_0x4c3f24=await this[_0x4dc15c(0x21d)][_0x4dc15c(0x1fb)](_0x4dc15c(0x1ec),_0x1e144f,{'headers':{'Content-Type':_0x4dc15c(0x1fd),'Accept':'application/vnd.api+json'},'body':_0x5c296e});return _0x4c3f24['data'];}async[a93_0x40a016(0x211)](_0x146f66){const _0x4eba49=a93_0x40a016,_0x4d3396=_0x4eba49(0x246)+encodeURIComponent(_0x146f66);await this[_0x4eba49(0x21d)][_0x4eba49(0x1fb)]('DELETE',_0x4d3396);}}function a93_0x8b17(){const _0x869861=['updateAgent','\x20attempts:\x20API\x20returned\x20empty\x20chat\x20ID','knowledge_bases','Failed\x20to\x20continue\x20chat\x20(chatId:\x20','listAgents','prompt','maxToolIterations','/api/integrations?filter[projectId]=','httpClient','GET','updateKnowledgeBase','/api/prompts?filter[projectId]=','listToolTargets','nova-canvas','\x20characters','/api/tool_targets?filter[targetType]=','authHeaders','approximate','requestSSE','\x20with\x20message\x20size:\x20','getAgent','getTextKnowledgeBase','/api/text_knowledge_bases/','DELETE','/api/knowledge_bases?filter[projectId]=','createAgent','LLM_EMPTY_MESSAGE','Failed\x20to\x20create\x20chat\x20after\x20','accessToken','listProjects','agentId','baseUrl','integrations','projectId','-last_conversation_at','updateExperimentalKnowledgeBase','application/json','POST','modelType','/api/tool_targets?filter[targetType]=ImageGenerator&filter[project_id]=','name','America/Los_Angeles','paginateAll','listWebSearchTools','length','search','getChatInfo','6218238hJBUtx','2Wwamrt','/api/integrations/','textKnowledgeBases','userLocation','/langfuse','/api/experimental_artifacts','&filter[project_id]=','ms...','getParentSegmentKnowledgeBase','584bkNLRh','/api/tool_targets?filter[targetType]=ParentSegmentKnowledgeBase&filter[project_id]=','data','/api/experimental_artifacts/','map','33167260sVlKjG','createAgentResponse',']\x20Chat\x20creation\x20returned\x20empty\x20ID,\x20retrying\x20in\x20','status','/api/agents?page[limit]=50','updatePrompt','844xWhoux','imageGenerators','/api/chats?','deleteAgent','text/event-stream','tdx.client.llm','/api/projects/','&page[limit]=1','10580QzywFm','logger','Please\x20provide\x20a\x20non-empty\x20message\x20to\x20continue\x20the\x20chat.','experimentalArtifacts','pathname','experimentalKnowledgeBases','createProject','&page[limit]=50','/continue','projects',']\x20Streaming\x20SSE\x20stream\x20for\x20chatId:\x20','createPrompt','/api/chats/','listIntegrations','updateTextKnowledgeBase','294511ImeTfb','/api/chats','reasoningEffort','LLM_CHAT_CREATION_FAILURE','imageModelType','debug','append','listTextKnowledgeBases','startsWith','gpt-4o','/api/projects','sort','parentSegmentKnowledgeBases','updateIntegration','72023WdPQdT','createExperimentalKnowledgeBase','/api/knowledge_bases','toString','/api/users/current_settings','createKnowledgeBase','/api/experimental_knowledge_bases','listExperimentalArtifacts','PATCH','/api/tool_targets?filter[targetType]=TextKnowledgeBase&filter[project_id]=','getUserSettings','listImageGenerators','/api/knowledge_bases/','createIntegration','description','You\x20are\x20a\x20helpful\x20search\x20assistant.','/history','/api/projects?page[limit]=','San\x20Francisco','medium','getExperimentalArtifact','site','webSearchTools','request','getProject','application/vnd.api+json','createImageGenerator','/api/agents','12168495cAKZHD','proxy','llm','3787611wsPmMZ','outputs','updateAgentResponse','/api/tool_targets?filter[targetType]=WebSearchTool&filter[project_id]=','push','/api/image_generators','/api/experimental_knowledge_bases/','/api/prompts/','systemPrompt','chats','starterMessage','createTextKnowledgeBase','warn','/api/agents/','deleteIntegration','agents','prompts','/api/experimental_artifacts?filter[projectId]='];a93_0x8b17=function(){return _0x869861;};return a93_0x8b17();}
@@ -1 +1 @@
1
- function a94_0x300d(_0x4c062d,_0x75a259){_0x4c062d=_0x4c062d-0x12d;const _0x3fde8f=a94_0x3fde();let _0x300df1=_0x3fde8f[_0x4c062d];return _0x300df1;}function a94_0x3fde(){const _0x399870=['1545250rkWbKm','217522lGknHl','/oauth/token','4TnmukB','1380095HTbPyo','88iizJKM','557682AgMfaY','refresh_token','776349WFbHDG','3548649DKimLR','73041htaulM','18TlVvTY'];a94_0x3fde=function(){return _0x399870;};return a94_0x3fde();}(function(_0xb57aee,_0xbb1723){const _0x25ec4a=a94_0x300d,_0x2542af=_0xb57aee();while(!![]){try{const _0x401f1b=-parseInt(_0x25ec4a(0x12e))/0x1+parseInt(_0x25ec4a(0x131))/0x2+parseInt(_0x25ec4a(0x12d))/0x3+-parseInt(_0x25ec4a(0x133))/0x4*(-parseInt(_0x25ec4a(0x134))/0x5)+parseInt(_0x25ec4a(0x136))/0x6+-parseInt(_0x25ec4a(0x138))/0x7*(parseInt(_0x25ec4a(0x135))/0x8)+parseInt(_0x25ec4a(0x12f))/0x9*(parseInt(_0x25ec4a(0x130))/0xa);if(_0x401f1b===_0xbb1723)break;else _0x2542af['push'](_0x2542af['shift']());}catch(_0x2bd83a){_0x2542af['push'](_0x2542af['shift']());}}}(a94_0x3fde,0xa5322));import{getOAuthClientId,postTokenRequest}from'../../core/oauth.js';export async function refreshAccessToken(_0x4a0702,_0x5c5beb){const _0x3beef4=a94_0x300d,_0x4010ed=_0x4a0702+_0x3beef4(0x132);return postTokenRequest(_0x4010ed,{'grant_type':_0x3beef4(0x137),'client_id':getOAuthClientId(),'refresh_token':_0x5c5beb});}
1
+ (function(_0x4d6b54,_0x11bbdd){const _0x598c15=a94_0x325e,_0x2905d1=_0x4d6b54();while(!![]){try{const _0x52e65a=parseInt(_0x598c15(0x1a5))/0x1*(parseInt(_0x598c15(0x1a0))/0x2)+-parseInt(_0x598c15(0x198))/0x3*(parseInt(_0x598c15(0x199))/0x4)+parseInt(_0x598c15(0x19e))/0x5*(parseInt(_0x598c15(0x19c))/0x6)+parseInt(_0x598c15(0x1a1))/0x7+parseInt(_0x598c15(0x1a4))/0x8*(-parseInt(_0x598c15(0x1a2))/0x9)+-parseInt(_0x598c15(0x19b))/0xa+parseInt(_0x598c15(0x19a))/0xb*(parseInt(_0x598c15(0x1a3))/0xc);if(_0x52e65a===_0x11bbdd)break;else _0x2905d1['push'](_0x2905d1['shift']());}catch(_0x4afd8e){_0x2905d1['push'](_0x2905d1['shift']());}}}(a94_0x7aa9,0xaf3c1));import{getOAuthClientId,postTokenRequest}from'../../core/oauth.js';function a94_0x325e(_0x432498,_0x31bbdc){_0x432498=_0x432498-0x198;const _0x7aa9f1=a94_0x7aa9();let _0x325e96=_0x7aa9f1[_0x432498];return _0x325e96;}function a94_0x7aa9(){const _0x5d75c8=['641984XqvGUf','274761IbUFHT','120LGkCpa','272xjymic','16381rRmyJF','1063026dwuNiL','8QJyKpS','2259367bxHsKa','8338940joaaht','4851852vffApC','refresh_token','5xNWZYZ','/oauth/token','42ddBwOR'];a94_0x7aa9=function(){return _0x5d75c8;};return a94_0x7aa9();}export async function refreshAccessToken(_0x4cdbed,_0x3b0e12){const _0x2756c1=a94_0x325e,_0xaea694=_0x4cdbed+_0x2756c1(0x19f);return postTokenRequest(_0xaea694,{'grant_type':_0x2756c1(0x19d),'client_id':getOAuthClientId(),'refresh_token':_0x3b0e12});}
@@ -1 +1 @@
1
- const a95_0x16ff50=a95_0x3272;function a95_0x3272(_0x33dd6b,_0x258d33){_0x33dd6b=_0x33dd6b-0x16d;const _0x135a6d=a95_0x135a();let _0x327250=_0x135a6d[_0x33dd6b];return _0x327250;}(function(_0x6d51fc,_0x347266){const _0x2f58e9=a95_0x3272,_0x5b8e47=_0x6d51fc();while(!![]){try{const _0x152ee4=-parseInt(_0x2f58e9(0x183))/0x1+parseInt(_0x2f58e9(0x185))/0x2+parseInt(_0x2f58e9(0x172))/0x3*(parseInt(_0x2f58e9(0x177))/0x4)+-parseInt(_0x2f58e9(0x178))/0x5+parseInt(_0x2f58e9(0x182))/0x6+parseInt(_0x2f58e9(0x16d))/0x7*(-parseInt(_0x2f58e9(0x170))/0x8)+parseInt(_0x2f58e9(0x175))/0x9*(-parseInt(_0x2f58e9(0x180))/0xa);if(_0x152ee4===_0x347266)break;else _0x5b8e47['push'](_0x5b8e47['shift']());}catch(_0x322c1f){_0x5b8e47['push'](_0x5b8e47['shift']());}}}(a95_0x135a,0x4c8c8));export class RateLimiter{['tokens'];['lastRefill'];[a95_0x16ff50(0x184)];['refillRate'];constructor(_0x520e9b){const _0x8081f0=a95_0x16ff50;this[_0x8081f0(0x184)]=_0x520e9b['maxRequests'],this[_0x8081f0(0x17f)]=_0x520e9b[_0x8081f0(0x17c)],this[_0x8081f0(0x17d)]=Date[_0x8081f0(0x16e)](),this[_0x8081f0(0x173)]=_0x520e9b[_0x8081f0(0x17c)]/_0x520e9b[_0x8081f0(0x179)];}async['acquire'](){const _0x2fe8ee=a95_0x16ff50;while(!![]){this[_0x2fe8ee(0x17e)]();if(this[_0x2fe8ee(0x17f)]>=0x1){this[_0x2fe8ee(0x17f)]-=0x1;return;}const _0x1cb6ed=Math[_0x2fe8ee(0x181)](0x1,Math[_0x2fe8ee(0x17b)](0x1/this[_0x2fe8ee(0x173)]));await this['sleep'](_0x1cb6ed);}}[a95_0x16ff50(0x174)](){const _0x269731=a95_0x16ff50;this['refill']();if(this[_0x269731(0x17f)]>=0x1)return this['tokens']-=0x1,!![];return![];}[a95_0x16ff50(0x17e)](){const _0x215757=a95_0x16ff50,_0x23f06a=Date[_0x215757(0x16e)](),_0x4f720c=_0x23f06a-this['lastRefill'];if(_0x4f720c>0x0){const _0x1b0e01=_0x4f720c*this[_0x215757(0x173)];this[_0x215757(0x17f)]=Math[_0x215757(0x17a)](this[_0x215757(0x184)],this[_0x215757(0x17f)]+_0x1b0e01),this['lastRefill']=_0x23f06a;}}[a95_0x16ff50(0x176)](){const _0x24c654=a95_0x16ff50;return this['refill'](),Math['floor'](this[_0x24c654(0x17f)]);}[a95_0x16ff50(0x171)](){const _0xcdecbd=a95_0x16ff50;this[_0xcdecbd(0x17f)]=this[_0xcdecbd(0x184)],this[_0xcdecbd(0x17d)]=Date[_0xcdecbd(0x16e)]();}[a95_0x16ff50(0x16f)](_0x453d33){return new Promise(_0x30579f=>setTimeout(_0x30579f,_0x453d33));}}export const defaultRateLimiter=new RateLimiter({'maxRequests':0x64,'windowMs':0xea60});function a95_0x135a(){const _0x498e45=['now','sleep','40UTBYdu','reset','640944wiSaHU','refillRate','tryAcquire','2358lFNOuu','getAvailableTokens','8PwRlyh','689985ruUDMK','windowMs','min','ceil','maxRequests','lastRefill','refill','tokens','14610HHtTZe','max','2383890gSawHi','271553GDKwTw','maxTokens','994450GMMSDY','302344mznwLq'];a95_0x135a=function(){return _0x498e45;};return a95_0x135a();}
1
+ function a95_0x2fbe(){const _0x1eec57=['min','tokens','refill','max','38424fkmeEl','sleep','tryAcquire','ceil','windowMs','acquire','2786GBJhyw','floor','reset','now','lastRefill','4hYbTKj','76RyVTwQ','15060ErDlEu','maxTokens','732aztsfj','11464HNPKPP','maxRequests','2565qvuGXk','44bBGQZO','3450310QLoOGC','refillRate','15696kxypvk','6046195ZqnkWc','122239UwThjE'];a95_0x2fbe=function(){return _0x1eec57;};return a95_0x2fbe();}const a95_0x3661ec=a95_0x4c6b;(function(_0x5c58c9,_0x5c2743){const _0x187489=a95_0x4c6b,_0x24be6e=_0x5c58c9();while(!![]){try{const _0xc1f4b4=-parseInt(_0x187489(0xe7))/0x1*(-parseInt(_0x187489(0xf1))/0x2)+parseInt(_0x187489(0xdb))/0x3+-parseInt(_0x187489(0xe6))/0x4*(parseInt(_0x187489(0xf2))/0x5)+-parseInt(_0x187489(0xe8))/0x6*(parseInt(_0x187489(0xe1))/0x7)+-parseInt(_0x187489(0xeb))/0x8*(-parseInt(_0x187489(0xed))/0x9)+-parseInt(_0x187489(0xef))/0xa*(-parseInt(_0x187489(0xee))/0xb)+parseInt(_0x187489(0xea))/0xc*(parseInt(_0x187489(0xf3))/0xd);if(_0xc1f4b4===_0x5c2743)break;else _0x24be6e['push'](_0x24be6e['shift']());}catch(_0x54cdb5){_0x24be6e['push'](_0x24be6e['shift']());}}}(a95_0x2fbe,0xba50d));export class RateLimiter{[a95_0x3661ec(0xf5)];[a95_0x3661ec(0xe5)];[a95_0x3661ec(0xe9)];[a95_0x3661ec(0xf0)];constructor(_0x5724ff){const _0x3002d8=a95_0x3661ec;this[_0x3002d8(0xe9)]=_0x5724ff[_0x3002d8(0xec)],this[_0x3002d8(0xf5)]=_0x5724ff[_0x3002d8(0xec)],this[_0x3002d8(0xe5)]=Date[_0x3002d8(0xe4)](),this[_0x3002d8(0xf0)]=_0x5724ff[_0x3002d8(0xec)]/_0x5724ff[_0x3002d8(0xdf)];}async[a95_0x3661ec(0xe0)](){const _0x24e705=a95_0x3661ec;while(!![]){this[_0x24e705(0xd9)]();if(this[_0x24e705(0xf5)]>=0x1){this['tokens']-=0x1;return;}const _0x300f01=Math[_0x24e705(0xda)](0x1,Math[_0x24e705(0xde)](0x1/this[_0x24e705(0xf0)]));await this['sleep'](_0x300f01);}}[a95_0x3661ec(0xdd)](){const _0x5afba0=a95_0x3661ec;this[_0x5afba0(0xd9)]();if(this['tokens']>=0x1)return this['tokens']-=0x1,!![];return![];}[a95_0x3661ec(0xd9)](){const _0x281503=a95_0x3661ec,_0x55cf51=Date[_0x281503(0xe4)](),_0x258507=_0x55cf51-this['lastRefill'];if(_0x258507>0x0){const _0x5952d5=_0x258507*this[_0x281503(0xf0)];this[_0x281503(0xf5)]=Math[_0x281503(0xf4)](this[_0x281503(0xe9)],this['tokens']+_0x5952d5),this[_0x281503(0xe5)]=_0x55cf51;}}['getAvailableTokens'](){const _0xf37228=a95_0x3661ec;return this[_0xf37228(0xd9)](),Math[_0xf37228(0xe2)](this[_0xf37228(0xf5)]);}[a95_0x3661ec(0xe3)](){const _0x2be0aa=a95_0x3661ec;this[_0x2be0aa(0xf5)]=this[_0x2be0aa(0xe9)],this[_0x2be0aa(0xe5)]=Date[_0x2be0aa(0xe4)]();}[a95_0x3661ec(0xdc)](_0x4381e0){return new Promise(_0x58eacf=>setTimeout(_0x58eacf,_0x4381e0));}}function a95_0x4c6b(_0x240963,_0x244842){_0x240963=_0x240963-0xd9;const _0x2fbe05=a95_0x2fbe();let _0x4c6b8b=_0x2fbe05[_0x240963];return _0x4c6b8b;}export const defaultRateLimiter=new RateLimiter({'maxRequests':0x64,'windowMs':0xea60});