@treasuredata/tdx 0.14.2 → 0.14.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (145) 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/api-command.js +1 -1
  8. package/dist/commands/auth-command.d.ts.map +1 -1
  9. package/dist/commands/auth-command.js +1 -1
  10. package/dist/commands/auth-command.js.map +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/describe.js +1 -1
  19. package/dist/commands/engage-command.js +1 -1
  20. package/dist/commands/job-command.js +1 -1
  21. package/dist/commands/journey-command.js +1 -1
  22. package/dist/commands/journey-validate-command.js +1 -1
  23. package/dist/commands/llm-command.js +1 -1
  24. package/dist/commands/llm-proxy.js +1 -1
  25. package/dist/commands/parent-segment-command.js +1 -1
  26. package/dist/commands/profile-command.js +1 -1
  27. package/dist/commands/profiles-command.js +1 -1
  28. package/dist/commands/query-command.js +1 -1
  29. package/dist/commands/segment-command.js +1 -1
  30. package/dist/commands/segment-create-command.js +1 -1
  31. package/dist/commands/segment-fields-command.js +1 -1
  32. package/dist/commands/segment-pull-command.js +1 -1
  33. package/dist/commands/segment-push-command.js +1 -1
  34. package/dist/commands/segment-update-command.js +1 -1
  35. package/dist/commands/segment-use-command.js +1 -1
  36. package/dist/commands/segment-validate-command.js +1 -1
  37. package/dist/commands/segments.js +1 -1
  38. package/dist/commands/show.js +1 -1
  39. package/dist/commands/tables.js +1 -1
  40. package/dist/commands/use-command.js +1 -1
  41. package/dist/commands/user-command.js +1 -1
  42. package/dist/commands/workflow-command.js +1 -1
  43. package/dist/core/auth.js +1 -1
  44. package/dist/core/command-output.js +1 -1
  45. package/dist/core/config.js +1 -1
  46. package/dist/core/connection-cache.js +1 -1
  47. package/dist/core/constants.js +1 -1
  48. package/dist/core/credential-cache.js +1 -1
  49. package/dist/core/global-context.js +1 -1
  50. package/dist/core/keychain.js +1 -1
  51. package/dist/core/profile.d.ts +15 -0
  52. package/dist/core/profile.d.ts.map +1 -1
  53. package/dist/core/profile.js +1 -1
  54. package/dist/core/profile.js.map +1 -1
  55. package/dist/core/project-config.js +1 -1
  56. package/dist/core/session.js +1 -1
  57. package/dist/core/user-cache.js +1 -1
  58. package/dist/core/version.js +1 -1
  59. package/dist/index.js +1 -1
  60. package/dist/proxy/anthropic-adapter.js +1 -1
  61. package/dist/proxy/claude-usage-tracker.js +1 -1
  62. package/dist/proxy/context-signature.js +1 -1
  63. package/dist/proxy/conversation-utils.js +1 -1
  64. package/dist/proxy/passthrough-server.d.ts +13 -2
  65. package/dist/proxy/passthrough-server.d.ts.map +1 -1
  66. package/dist/proxy/passthrough-server.js +1 -1
  67. package/dist/proxy/passthrough-server.js.map +1 -1
  68. package/dist/proxy/server.js +1 -1
  69. package/dist/proxy/session-cache.js +1 -1
  70. package/dist/proxy/sse-usage-parser.js +1 -1
  71. package/dist/sdk/agent/agent-config.js +1 -1
  72. package/dist/sdk/agent/agent-ref-parser.js +1 -1
  73. package/dist/sdk/agent/agent-yaml.js +1 -1
  74. package/dist/sdk/api.js +1 -1
  75. package/dist/sdk/client/cdp-api-client.js +1 -1
  76. package/dist/sdk/client/endpoints.js +1 -1
  77. package/dist/sdk/client/engage-api-client.js +1 -1
  78. package/dist/sdk/client/http-client.js +1 -1
  79. package/dist/sdk/client/llm-api-client.js +1 -1
  80. package/dist/sdk/client/rate-limiter.js +1 -1
  81. package/dist/sdk/client/td-api-client.js +1 -1
  82. package/dist/sdk/client/trino-api-client.js +1 -1
  83. package/dist/sdk/client/workflow-client.js +1 -1
  84. package/dist/sdk/connection-validator.js +1 -1
  85. package/dist/sdk/connection.js +1 -1
  86. package/dist/sdk/engage.js +1 -1
  87. package/dist/sdk/errors.js +1 -1
  88. package/dist/sdk/index.js +1 -1
  89. package/dist/sdk/io/index.js +1 -1
  90. package/dist/sdk/io/node-filesystem.js +1 -1
  91. package/dist/sdk/job.js +1 -1
  92. package/dist/sdk/journey.js +1 -1
  93. package/dist/sdk/llm/chat-cache.js +1 -1
  94. package/dist/sdk/llm/index.js +1 -1
  95. package/dist/sdk/llm/llm-backup-utils.js +1 -1
  96. package/dist/sdk/llm/model-aliases.js +1 -1
  97. package/dist/sdk/llm/model-factors.js +1 -1
  98. package/dist/sdk/query/index.js +1 -1
  99. package/dist/sdk/query/sql-parser.js +1 -1
  100. package/dist/sdk/segment/child-segment-yaml.js +1 -1
  101. package/dist/sdk/segment/fields-display.js +1 -1
  102. package/dist/sdk/segment/file-discovery.js +1 -1
  103. package/dist/sdk/segment/journey-utils.js +1 -1
  104. package/dist/sdk/segment/journey-yaml.js +1 -1
  105. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  106. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  107. package/dist/sdk/segment/pull-workflow.js +1 -1
  108. package/dist/sdk/segment/push-workflow.js +1 -1
  109. package/dist/sdk/segment/resolution-context.js +1 -1
  110. package/dist/sdk/segment/segment-path-parser.js +1 -1
  111. package/dist/sdk/segment/segment-ref-parser.js +1 -1
  112. package/dist/sdk/segment/target-resolution.js +1 -1
  113. package/dist/sdk/segment/tdx-config.js +1 -1
  114. package/dist/sdk/segment/validate-files.js +1 -1
  115. package/dist/sdk/segment/yaml-validator.js +1 -1
  116. package/dist/sdk/segment.js +1 -1
  117. package/dist/sdk/types/index.js +1 -1
  118. package/dist/sdk/types/progress.js +1 -1
  119. package/dist/sdk/user.js +1 -1
  120. package/dist/sdk/util/format-detector.js +1 -1
  121. package/dist/sdk/util/formatters.js +1 -1
  122. package/dist/sdk/util/index.js +1 -1
  123. package/dist/sdk/util/tree-formatter.js +1 -1
  124. package/dist/sdk/workflow/clone-workflow.js +1 -1
  125. package/dist/sdk/workflow/index.js +1 -1
  126. package/dist/sdk/workflow/pull-workflow.js +1 -1
  127. package/dist/sdk/workflow/push-workflow.js +1 -1
  128. package/dist/sdk/workflow/tdx-config.js +1 -1
  129. package/dist/sdk/workflow/workflow-utils.js +1 -1
  130. package/dist/utils/async.js +1 -1
  131. package/dist/utils/colors.js +1 -1
  132. package/dist/utils/diff.js +1 -1
  133. package/dist/utils/file-permissions.js +1 -1
  134. package/dist/utils/json-loader.js +1 -1
  135. package/dist/utils/option-validation.js +1 -1
  136. package/dist/utils/port.js +1 -1
  137. package/dist/utils/process.js +1 -1
  138. package/dist/utils/prompt.js +1 -1
  139. package/dist/utils/spinner.js +1 -1
  140. package/dist/utils/sse-parser.js +1 -1
  141. package/dist/utils/string-utils.js +1 -1
  142. package/dist/utils/table-ref-parser.js +1 -1
  143. package/dist/utils/tdx-logger.js +1 -1
  144. package/dist/utils/version-check.js +1 -1
  145. package/package.json +1 -1
@@ -1 +1 @@
1
- const a92_0x58af3c=a92_0x2625;(function(_0x2561a6,_0x1b8ca3){const _0xaf997e=a92_0x2625,_0x445392=_0x2561a6();while(!![]){try{const _0x312781=parseInt(_0xaf997e(0x1df))/0x1*(parseInt(_0xaf997e(0x1da))/0x2)+-parseInt(_0xaf997e(0x1e1))/0x3*(parseInt(_0xaf997e(0x1af))/0x4)+-parseInt(_0xaf997e(0x1aa))/0x5+-parseInt(_0xaf997e(0x1e2))/0x6*(parseInt(_0xaf997e(0x1f7))/0x7)+-parseInt(_0xaf997e(0x19f))/0x8*(-parseInt(_0xaf997e(0x1b7))/0x9)+parseInt(_0xaf997e(0x1b5))/0xa*(parseInt(_0xaf997e(0x1e3))/0xb)+-parseInt(_0xaf997e(0x1bf))/0xc*(-parseInt(_0xaf997e(0x1ff))/0xd);if(_0x312781===_0x1b8ca3)break;else _0x445392['push'](_0x445392['shift']());}catch(_0x391d15){_0x445392['push'](_0x445392['shift']());}}}(a92_0x3f3e,0xa20ec));import*as a92_0x5ef8d4 from'yaml';import{SDKError,ErrorCode}from'../errors.js';import{validateConnectorConfig,transformConfigToLegacy,normalizeConnectorConfigForYaml,formatValidationErrors,formatValidationWarnings,formatSchemaAsHelp}from'../connection-validator.js';export function segmentResponseToDefSync(_0x103c47,_0x38ef2f){const _0x5f36f0=a92_0x2625,_0x1e4161=_0x103c47[_0x5f36f0(0x1c9)]&&_0x5f36f0(0x1ec)in _0x103c47[_0x5f36f0(0x1c9)]&&_0x103c47['rule']['type'];return{'type':'segment','name':_0x103c47[_0x5f36f0(0x1b8)],..._0x103c47[_0x5f36f0(0x219)]&&{'description':_0x103c47['description']},..._0x38ef2f&&{'folder':_0x38ef2f},..._0x1e4161&&{'rule':apiRuleToYaml(_0x103c47[_0x5f36f0(0x1c9)])},..._0x103c47['kind']!==undefined&&{'kind':_0x103c47[_0x5f36f0(0x22f)]===0x0?_0x5f36f0(0x1a1):_0x103c47[_0x5f36f0(0x22f)]===0x1?'realtime':_0x5f36f0(0x1e4)},..._0x103c47[_0x5f36f0(0x225)]!==undefined&&{'visible':_0x103c47[_0x5f36f0(0x225)]}};}export async function segmentResponseToDef(_0x1cb4ad,_0x36734e,_0x3d39d5){const _0x107de9=a92_0x2625,_0x33056e=segmentResponseToDefSync(_0x1cb4ad,_0x3d39d5);if(!_0x36734e||!_0x36734e['resolveSegmentName'])return _0x33056e;return _0x33056e[_0x107de9(0x1c9)]&&(_0x33056e[_0x107de9(0x1c9)]=await resolveRuleSegmentRefs(_0x33056e['rule'],_0x36734e['resolveSegmentName'])),_0x33056e;}export function apiRuleToYaml(_0x19a662){const _0x236150=a92_0x2625,_0x28e62a=(_0x19a662[_0x236150(0x21f)]||[])[_0x236150(0x1ea)](apiConditionToYaml);if(_0x28e62a['length']===0x1&&!_0x19a662[_0x236150(0x219)]&&_0x236150(0x1ec)in _0x28e62a[0x0]&&(_0x28e62a[0x0]['type']===_0x236150(0x222)||_0x28e62a[0x0][_0x236150(0x1ec)]==='Or')){const _0x296525=_0x28e62a[0x0];if(_0x296525[_0x236150(0x1ec)]===_0x19a662[_0x236150(0x1ec)]&&_0x296525[_0x236150(0x21f)])return{'type':_0x19a662[_0x236150(0x1ec)],'conditions':_0x296525[_0x236150(0x21f)],..._0x296525[_0x236150(0x219)]&&{'description':_0x296525[_0x236150(0x219)]}};}return{'type':_0x19a662[_0x236150(0x1ec)],'conditions':_0x28e62a,..._0x19a662['description']&&{'description':_0x19a662[_0x236150(0x219)]}};}export async function resolveRuleSegmentRefs(_0x11c25c,_0x4f411c){const _0x28eac7=a92_0x2625,_0x459501=await Promise[_0x28eac7(0x1b0)](_0x11c25c[_0x28eac7(0x21f)][_0x28eac7(0x1ea)](_0x19909a=>resolveConditionSegmentRefs(_0x19909a,_0x4f411c)));return{..._0x11c25c,'conditions':_0x459501};}async function resolveConditionSegmentRefs(_0x3e4a55,_0x230c04){const _0x123174=a92_0x2625;if(_0x123174(0x1bd)in _0x3e4a55&&(_0x3e4a55[_0x123174(0x1ec)]===_0x123174(0x1e9)||_0x3e4a55[_0x123174(0x1ec)]===_0x123174(0x1d6))){const _0xa002aa=_0x3e4a55;if(/^\d+$/['test'](_0xa002aa['segment'])){const _0x5995aa=await _0x230c04(_0xa002aa['segment']);return{..._0xa002aa,'segment':_0x5995aa};}return _0x3e4a55;}if(_0x123174(0x21f)in _0x3e4a55&&_0x3e4a55[_0x123174(0x21f)]){const _0x127bba=_0x3e4a55,_0x2405b3=await Promise[_0x123174(0x1b0)](_0x127bba['conditions'][_0x123174(0x1ea)](_0x5bd9c0=>resolveConditionSegmentRefs(_0x5bd9c0,_0x230c04)));return{..._0x127bba,'conditions':_0x2405b3};}if(_0x123174(0x1ee)in _0x3e4a55&&_0x3e4a55['filter']){const _0x1c2b8f=_0x3e4a55,_0x2fc751=await resolveRuleSegmentRefs(_0x1c2b8f[_0x123174(0x1ee)],_0x230c04);return{..._0x1c2b8f,'filter':_0x2fc751};}return _0x3e4a55;}export async function resolveRuleSegmentIds(_0x4e8e6d,_0x119d81){const _0x55bbcb=a92_0x2625,_0x528e90=await Promise[_0x55bbcb(0x1b0)](_0x4e8e6d['conditions'][_0x55bbcb(0x1ea)](_0x5863d8=>resolveConditionSegmentIds(_0x5863d8,_0x119d81)));return{..._0x4e8e6d,'conditions':_0x528e90};}async function resolveConditionSegmentIds(_0x58493e,_0x2a23ff){const _0x7c9b9b=a92_0x2625;if('segment'in _0x58493e&&(_0x58493e['type']==='include'||_0x58493e['type']===_0x7c9b9b(0x1d6))){const _0x105f34=_0x58493e;if(!/^\d+$/[_0x7c9b9b(0x214)](_0x105f34[_0x7c9b9b(0x1bd)])){const _0x537ca1=await _0x2a23ff(_0x105f34['segment']);return{..._0x105f34,'segment':_0x537ca1};}return _0x58493e;}if(_0x7c9b9b(0x21f)in _0x58493e&&_0x58493e['conditions']){const _0x30559b=_0x58493e,_0x5bcb0a=await Promise['all'](_0x30559b[_0x7c9b9b(0x21f)][_0x7c9b9b(0x1ea)](_0x3bf37d=>resolveConditionSegmentIds(_0x3bf37d,_0x2a23ff)));return{..._0x30559b,'conditions':_0x5bcb0a};}if(_0x7c9b9b(0x1ee)in _0x58493e&&_0x58493e[_0x7c9b9b(0x1ee)]){const _0xe90987=_0x58493e,_0x3a67fe=await resolveRuleSegmentIds(_0xe90987[_0x7c9b9b(0x1ee)],_0x2a23ff);return{..._0xe90987,'filter':_0x3a67fe};}return _0x58493e;}function apiConditionToYaml(_0x138ffe){const _0x28d371=a92_0x2625;if(_0x138ffe[_0x28d371(0x1ec)]==='And'||_0x138ffe['type']==='Or'){if(_0x138ffe[_0x28d371(0x21f)]){const _0x1ac157=_0x138ffe[_0x28d371(0x21f)][_0x28d371(0x1ea)](apiConditionToYaml);if(_0x1ac157[_0x28d371(0x1b3)]===0x1&&!_0x138ffe['description'])return _0x1ac157[0x0];return{'type':_0x138ffe['type'],'conditions':_0x1ac157,..._0x138ffe[_0x28d371(0x219)]&&{'description':_0x138ffe['description']}};}}if(_0x138ffe[_0x28d371(0x1ec)]==='Value'&&_0x138ffe[_0x28d371(0x227)]&&_0x138ffe[_0x28d371(0x1e8)]){const _0x5baa4a=_0x138ffe[_0x28d371(0x227)][_0x28d371(0x1ca)]?{'type':_0x138ffe['leftValue'][_0x28d371(0x1ca)]['type'],..._0x138ffe['leftValue']['aggregation'][_0x28d371(0x205)]&&{'groupingColumns':_0x138ffe['leftValue'][_0x28d371(0x1ca)][_0x28d371(0x205)]}}:undefined;return{'type':_0x28d371(0x1dd),'attribute':_0x138ffe[_0x28d371(0x227)]['name']||'','operator':apiOperatorToYaml(_0x138ffe[_0x28d371(0x1e8)]),..._0x138ffe['arrayMatching']&&_0x138ffe[_0x28d371(0x216)]!==_0x28d371(0x230)?{'arrayMatching':_0x138ffe[_0x28d371(0x216)]}:{},..._0x138ffe[_0x28d371(0x1d6)]?{'exclude':_0x138ffe[_0x28d371(0x1d6)]}:{},..._0x5baa4a?{'aggregation':_0x5baa4a}:{},..._0x138ffe[_0x28d371(0x227)]['source']?{'source':_0x138ffe[_0x28d371(0x227)][_0x28d371(0x1f2)]['name']}:{},..._0x138ffe[_0x28d371(0x227)][_0x28d371(0x1ee)]?{'filter':apiRuleToYaml(_0x138ffe['leftValue'][_0x28d371(0x1ee)])}:{},..._0x138ffe['limit']!==undefined&&_0x138ffe[_0x28d371(0x21a)]!==null?{'limit':_0x138ffe[_0x28d371(0x21a)]}:{}};}if(_0x138ffe[_0x28d371(0x1ec)]===_0x28d371(0x1d8)&&_0x138ffe['id'])return{'type':_0x138ffe[_0x28d371(0x1d6)]?_0x28d371(0x1d6):'include','segment':_0x138ffe['id']};return{'type':_0x28d371(0x222),'conditions':[]};}function isTemporalOperator(_0x4beb9c){const _0x1d4582=a92_0x2625;return _0x4beb9c===_0x1d4582(0x1cf)||_0x4beb9c===_0x1d4582(0x223);}function getEffectiveValue(_0x473f2f){const _0x197150=a92_0x2625,_0x33fc49=_0x473f2f[_0x197150(0x201)];return _0x473f2f['value']??_0x33fc49;}function apiOperatorToYaml(_0x22069c){const _0x12ee9d=a92_0x2625;let _0x1781c2;if(_0x22069c['rightValues']&&_0x22069c[_0x12ee9d(0x215)][_0x12ee9d(0x1b3)]>0x0)_0x1781c2=_0x22069c[_0x12ee9d(0x215)];else{if(_0x22069c[_0x12ee9d(0x1f8)]!==undefined)_0x1781c2=_0x22069c[_0x12ee9d(0x1f8)];else isTemporalOperator(_0x22069c[_0x12ee9d(0x1ec)])&&_0x22069c['value']!==undefined&&(_0x1781c2=_0x22069c[_0x12ee9d(0x21c)]);}return{'type':mapApiOperatorType(_0x22069c[_0x12ee9d(0x1ec)]),..._0x22069c['not']&&{'not':_0x22069c[_0x12ee9d(0x22b)]},..._0x1781c2!==undefined&&{'value':_0x1781c2},..._0x22069c[_0x12ee9d(0x1fc)]&&{'unit':_0x22069c[_0x12ee9d(0x1fc)]}};}function mapApiOperatorType(_0x5c05bd){return _0x5c05bd;}export function segmentDefToCreateRequest(_0x4b63f2,_0x4dd6ca){const _0x4c90ef=a92_0x2625,_0x2b7180={'name':_0x4b63f2['name']};return _0x4b63f2[_0x4c90ef(0x219)]&&(_0x2b7180[_0x4c90ef(0x219)]=_0x4b63f2[_0x4c90ef(0x219)]),_0x4b63f2['rule']&&(_0x2b7180[_0x4c90ef(0x1c9)]=yamlRuleToApi(_0x4b63f2[_0x4c90ef(0x1c9)])),_0x4b63f2['kind']&&(_0x2b7180[_0x4c90ef(0x22f)]=_0x4b63f2[_0x4c90ef(0x22f)]===_0x4c90ef(0x1a1)?0x0:_0x4b63f2[_0x4c90ef(0x22f)]==='realtime'?0x1:0x2),_0x4b63f2['visible']!==undefined&&(_0x2b7180[_0x4c90ef(0x225)]=_0x4b63f2[_0x4c90ef(0x1d2)]),_0x4dd6ca&&(_0x2b7180[_0x4c90ef(0x1b9)]=_0x4dd6ca),_0x2b7180;}export function segmentDefToUpdateRequest(_0xd8903){const _0x320d6a=a92_0x2625,_0x55e4a9={'name':_0xd8903[_0x320d6a(0x1b8)]};return _0xd8903['description']!==undefined&&(_0x55e4a9[_0x320d6a(0x219)]=_0xd8903['description']),_0xd8903[_0x320d6a(0x1c9)]&&(_0x55e4a9[_0x320d6a(0x1c9)]=yamlRuleToApi(_0xd8903[_0x320d6a(0x1c9)])),_0xd8903[_0x320d6a(0x22f)]&&(_0x55e4a9[_0x320d6a(0x22f)]=_0xd8903['kind']===_0x320d6a(0x1a1)?0x0:_0xd8903[_0x320d6a(0x22f)]===_0x320d6a(0x1ba)?0x1:0x2),_0x55e4a9;}export function yamlRuleToApi(_0x2a1114,_0x3131d0=![]){const _0xe5c745=a92_0x2625,_0x510d34=_0x2a1114[_0xe5c745(0x21f)][_0xe5c745(0x1ea)](yamlConditionToApi);if(_0x3131d0){const _0x2728b8=_0x510d34[_0xe5c745(0x1c1)](_0x553f2f=>_0x553f2f['type']===_0xe5c745(0x222)||_0x553f2f[_0xe5c745(0x1ec)]==='Or');if(!_0x2728b8&&_0x510d34[_0xe5c745(0x1b3)]>0x0)return{'type':_0x2a1114[_0xe5c745(0x1ec)],'conditions':[{'type':_0xe5c745(0x222),'description':_0x2a1114['description']||'','conditions':_0x510d34}]};}return{'type':_0x2a1114[_0xe5c745(0x1ec)],'conditions':_0x510d34,..._0x2a1114[_0xe5c745(0x219)]&&{'description':_0x2a1114['description']}};}function yamlConditionToApi(_0x3c7dea){const _0x38898f=a92_0x2625;if(_0x38898f(0x1bd)in _0x3c7dea&&(_0x3c7dea[_0x38898f(0x1ec)]===_0x38898f(0x1e9)||_0x3c7dea['type']===_0x38898f(0x1d6))){const _0x3ae9f6=_0x3c7dea;return{'type':'Reference','id':_0x3ae9f6[_0x38898f(0x1bd)],'exclude':_0x3ae9f6[_0x38898f(0x1ec)]===_0x38898f(0x1d6)};}if('type'in _0x3c7dea&&(_0x3c7dea[_0x38898f(0x1ec)]===_0x38898f(0x222)||_0x3c7dea[_0x38898f(0x1ec)]==='Or')){const _0xcacf8f=_0x3c7dea;return{'type':_0xcacf8f[_0x38898f(0x1ec)],'conditions':_0xcacf8f['conditions'][_0x38898f(0x1ea)](yamlConditionToApi),..._0xcacf8f['description']&&{'description':_0xcacf8f[_0x38898f(0x219)]}};}const _0x5d89b1=_0x3c7dea,_0x38fc92={'type':_0x38898f(0x1dd),'leftValue':buildLeftValue(_0x5d89b1),'operator':yamlOperatorToApi(_0x5d89b1[_0x38898f(0x1e8)]),'exclude':_0x5d89b1[_0x38898f(0x1d6)]??![],'arrayMatching':_0x5d89b1[_0x38898f(0x216)]??_0x38898f(0x230)};return _0x5d89b1[_0x38898f(0x21a)]!==undefined&&(_0x38fc92[_0x38898f(0x21a)]=_0x5d89b1[_0x38898f(0x21a)]),_0x38fc92;}function buildLeftValue(_0x1f918b){const _0x2ab598=a92_0x2625,_0x1d73d3={'name':_0x1f918b[_0x2ab598(0x1a9)]};return _0x1f918b[_0x2ab598(0x1ca)]&&(_0x1d73d3['aggregation']={'type':_0x1f918b[_0x2ab598(0x1ca)][_0x2ab598(0x1ec)],..._0x1f918b[_0x2ab598(0x1ca)]['groupingColumns']&&{'groupingColumns':_0x1f918b[_0x2ab598(0x1ca)][_0x2ab598(0x205)]}}),_0x1f918b[_0x2ab598(0x1f2)]&&(_0x1d73d3[_0x2ab598(0x1f2)]={'name':_0x1f918b[_0x2ab598(0x1f2)]}),_0x1f918b[_0x2ab598(0x1ee)]&&(_0x1d73d3['filter']=yamlRuleToApi(_0x1f918b[_0x2ab598(0x1ee)])),_0x1d73d3;}function yamlOperatorToApi(_0x5e7ab1){const _0x120746=a92_0x2625,_0x5cdb32={'type':mapYamlOperatorType(_0x5e7ab1[_0x120746(0x1ec)]),'not':_0x5e7ab1[_0x120746(0x22b)]??![]},_0xadf5a2=getEffectiveValue(_0x5e7ab1);if(_0xadf5a2!==undefined){if(Array['isArray'](_0xadf5a2))_0x5cdb32['rightValues']=_0xadf5a2;else isTemporalOperator(_0x5e7ab1['type'])?_0x5cdb32[_0x120746(0x21c)]=_0xadf5a2:_0x5cdb32[_0x120746(0x1f8)]=_0xadf5a2;}return _0x5e7ab1[_0x120746(0x1fc)]&&(_0x5cdb32[_0x120746(0x1fc)]=_0x5e7ab1[_0x120746(0x1fc)]),_0x5cdb32;}function mapYamlOperatorType(_0x4d847e){return _0x4d847e;}export function toYamlString(_0x137365){const _0x5769d8=a92_0x2625,_0x4736af=JSON['parse'](JSON[_0x5769d8(0x1fd)](_0x137365)),_0x226cc9=a92_0x5ef8d4[_0x5769d8(0x1fd)](_0x4736af,{'indent':0x2,'lineWidth':0x0,'nullStr':_0x5769d8(0x1dc)}),_0x58b1f2=[_0x5769d8(0x1f0)];let _0xb35046=_0x226cc9;for(const _0x4a5c69 of _0x58b1f2){_0xb35046=_0xb35046[_0x5769d8(0x1f5)](new RegExp('^('+_0x4a5c69+')','m'),(_0x5de90f,_0x2a17db,_0x2c6f74)=>{if(_0x2c6f74===0x0||_0xb35046[_0x2c6f74-0x1]==='\x0a'&&_0xb35046[_0x2c6f74-0x2]==='\x0a')return _0x2a17db;return'\x0a'+_0x2a17db;});}return _0xb35046;}export function parseYamlString(_0xf51636){const _0x3f7f6b=a92_0x2625,_0x31e098=a92_0x5ef8d4[_0x3f7f6b(0x231)](_0xf51636);if(!_0x31e098[_0x3f7f6b(0x1b8)])throw new Error('YAML\x20config\x20missing\x20required\x20field:\x20name');if(_0x31e098[_0x3f7f6b(0x1ec)]&&_0x31e098[_0x3f7f6b(0x1ec)]!==_0x3f7f6b(0x1bd))throw new Error(_0x3f7f6b(0x1d5)+_0x31e098[_0x3f7f6b(0x1ec)]);return _0x31e098;}export function isSegmentYaml(_0x367d5a){const _0x1df234=a92_0x2625;if(typeof _0x367d5a!==_0x1df234(0x20a)||_0x367d5a===null)return![];const _0x23aabf=_0x367d5a;return _0x23aabf[_0x1df234(0x1ec)]===_0x1df234(0x1bd)||_0x23aabf[_0x1df234(0x1ec)]===undefined;}export function generateTemplate(_0x4afc72=a92_0x58af3c(0x1c6)){const _0x1102ed=a92_0x58af3c,_0x37813d={'type':_0x1102ed(0x1bd),'name':_0x4afc72,'description':_0x1102ed(0x1eb),'rule':{'type':_0x1102ed(0x222),'conditions':[{'type':_0x1102ed(0x1dd),'attribute':_0x1102ed(0x1bc),'operator':{'type':'Equal','value':'value'}}]}};return toYamlString(_0x37813d);}export function segmentToYamlString(_0x2bae2b){const _0x473607=a92_0x58af3c,_0x371dce=JSON['parse'](JSON['stringify'](_0x2bae2b)),_0xecd0ec=a92_0x5ef8d4[_0x473607(0x1fd)](_0x371dce,{'indent':0x2,'lineWidth':0x0,'nullStr':_0x473607(0x1dc)}),_0x4b544a=[_0x473607(0x1f0),_0x473607(0x1b1)];let _0x2104bf=_0xecd0ec;for(const _0x117b1f of _0x4b544a){_0x2104bf=_0x2104bf[_0x473607(0x1f5)](new RegExp('^('+_0x117b1f+')','m'),(_0x496663,_0x3e61fc,_0x2acd8c)=>{if(_0x2acd8c===0x0||_0x2104bf[_0x2acd8c-0x1]==='\x0a'&&_0x2104bf[_0x2acd8c-0x2]==='\x0a')return _0x3e61fc;return'\x0a'+_0x3e61fc;});}return _0x2104bf;}export function parseSegmentYamlFile(_0x558ee6){const _0x6fdf2f=a92_0x58af3c,_0xd762d2=a92_0x5ef8d4['parse'](_0x558ee6);if(!_0xd762d2[_0x6fdf2f(0x1b8)])throw new Error('YAML\x20config\x20missing\x20required\x20field:\x20name');return _0xd762d2;}export function normalizeChildSegmentYaml(_0x384851){const _0x28ec87=a92_0x58af3c;return{'type':_0x28ec87(0x1bd),'name':_0x384851['name'],..._0x384851['description']!==undefined&&{'description':_0x384851['description']},..._0x384851['folder']!==undefined&&{'folder':_0x384851['folder']},..._0x384851[_0x28ec87(0x1c9)]&&{'rule':normalizeRule(_0x384851[_0x28ec87(0x1c9)])},..._0x384851[_0x28ec87(0x22f)]!==undefined&&{'kind':_0x384851['kind']},..._0x384851['visible']!==undefined&&{'visible':_0x384851[_0x28ec87(0x1d2)]},..._0x384851[_0x28ec87(0x211)]&&{'activations':_0x384851[_0x28ec87(0x211)]['map'](normalizeActivation)}};}export function normalizeRule(_0x4b8cd2){const _0x20df7c=a92_0x58af3c;return{'type':_0x4b8cd2[_0x20df7c(0x1ec)],'conditions':_0x4b8cd2[_0x20df7c(0x21f)][_0x20df7c(0x1ea)](normalizeCondition),..._0x4b8cd2['description']!==undefined&&{'description':_0x4b8cd2[_0x20df7c(0x219)]}};}function normalizeCondition(_0x344184){const _0x577872=a92_0x58af3c;if(_0x577872(0x1bd)in _0x344184&&(_0x344184['type']===_0x577872(0x1e9)||_0x344184['type']===_0x577872(0x1d6))){const _0x1cc4ac=_0x344184;return{'type':_0x1cc4ac[_0x577872(0x1ec)],'segment':_0x1cc4ac[_0x577872(0x1bd)]};}if(_0x577872(0x1ec)in _0x344184&&(_0x344184[_0x577872(0x1ec)]===_0x577872(0x222)||_0x344184[_0x577872(0x1ec)]==='Or')){const _0x41c264=_0x344184;return{'type':_0x41c264[_0x577872(0x1ec)],'conditions':_0x41c264[_0x577872(0x21f)][_0x577872(0x1ea)](normalizeCondition),..._0x41c264[_0x577872(0x219)]!==undefined&&{'description':_0x41c264[_0x577872(0x219)]}};}const _0x473de3=_0x344184;return{'type':_0x577872(0x1dd),'attribute':_0x473de3['attribute'],'operator':normalizeOperator(_0x473de3[_0x577872(0x1e8)]),..._0x473de3[_0x577872(0x216)]!==undefined&&{'arrayMatching':_0x473de3['arrayMatching']},..._0x473de3[_0x577872(0x1d6)]!==undefined&&{'exclude':_0x473de3['exclude']},..._0x473de3[_0x577872(0x1ca)]!==undefined&&{'aggregation':_0x473de3[_0x577872(0x1ca)]},..._0x473de3[_0x577872(0x1f2)]!==undefined&&{'source':_0x473de3[_0x577872(0x1f2)]},..._0x473de3[_0x577872(0x1ee)]!==undefined&&{'filter':normalizeRule(_0x473de3['filter'])},..._0x473de3[_0x577872(0x21a)]!==undefined&&{'limit':_0x473de3['limit']}};}function normalizeOperator(_0x4f7e24){const _0x4df7fa=a92_0x58af3c,_0x5ad547=getEffectiveValue(_0x4f7e24);return{'type':_0x4f7e24[_0x4df7fa(0x1ec)],..._0x4f7e24[_0x4df7fa(0x22b)]!==undefined&&{'not':_0x4f7e24[_0x4df7fa(0x22b)]},..._0x5ad547!==undefined&&{'value':_0x5ad547},..._0x4f7e24['min']!==undefined&&{'min':_0x4f7e24[_0x4df7fa(0x217)]},..._0x4f7e24[_0x4df7fa(0x20f)]!==undefined&&{'max':_0x4f7e24['max']},..._0x4f7e24['unit']!==undefined&&{'unit':_0x4f7e24['unit']},..._0x4f7e24[_0x4df7fa(0x1cc)]!==undefined&&{'duration':_0x4f7e24['duration']},..._0x4f7e24['from']!==undefined&&{'from':_0x4f7e24[_0x4df7fa(0x209)]}};}function normalizeActivation(_0x205e1a){const _0x20f0b7=a92_0x58af3c;return{'name':_0x205e1a[_0x20f0b7(0x1b8)],'connection':_0x205e1a[_0x20f0b7(0x20e)],..._0x205e1a['description']!==undefined&&{'description':_0x205e1a[_0x20f0b7(0x219)]},..._0x205e1a[_0x20f0b7(0x22a)]!==undefined&&{'all_columns':_0x205e1a[_0x20f0b7(0x22a)]},..._0x205e1a[_0x20f0b7(0x203)]!==undefined&&{'columns':_0x205e1a[_0x20f0b7(0x203)]},..._0x205e1a['behavior']!==undefined&&{'behavior':_0x205e1a[_0x20f0b7(0x212)]},..._0x205e1a[_0x20f0b7(0x1b2)]!==undefined&&{'schedule':_0x205e1a[_0x20f0b7(0x1b2)]},..._0x205e1a[_0x20f0b7(0x1a3)]!==undefined&&{'notification':_0x205e1a[_0x20f0b7(0x1a3)]},..._0x205e1a[_0x20f0b7(0x1a7)]!==undefined&&{'connector_config':_0x205e1a['connector_config']},..._0x205e1a[_0x20f0b7(0x1d9)]!==undefined&&{'activation_template_id':_0x205e1a['activation_template_id']}};}export function activationResponseToDef(_0x1750f6,_0x3b289a,_0x2f46d7){const _0x283ff1=a92_0x58af3c,_0x422a59=_0x1750f6[_0x283ff1(0x220)]||'',_0xee5a54=_0x2f46d7?.['get'](_0x422a59)??_0x422a59,_0x1f3501={'name':_0x1750f6[_0x283ff1(0x1b8)],'connection':_0xee5a54};_0x1750f6[_0x283ff1(0x219)]&&(_0x1f3501[_0x283ff1(0x219)]=_0x1750f6['description']);let _0x4f97e0=[];_0x1750f6['columns']&&_0x1750f6[_0x283ff1(0x203)][_0x283ff1(0x1b3)]>0x0&&(_0x4f97e0=_0x1750f6[_0x283ff1(0x203)][_0x283ff1(0x1ee)](_0x4c8c5c=>_0x4c8c5c&&_0x4c8c5c['name'])[_0x283ff1(0x1ea)](_0x4318d9=>{const _0x59c583=_0x283ff1;if(_0x4318d9[_0x59c583(0x1ec)]||_0x4318d9['visibility'])return{'name':_0x4318d9['name'],..._0x4318d9[_0x59c583(0x1ec)]&&{'type':_0x4318d9[_0x59c583(0x1ec)]},..._0x4318d9[_0x59c583(0x1ab)]&&{'visibility':_0x4318d9[_0x59c583(0x1ab)]}};return _0x4318d9[_0x59c583(0x1b8)];}));_0x4f97e0['length']>0x0&&(_0x1f3501[_0x283ff1(0x203)]=_0x4f97e0);_0x1750f6[_0x283ff1(0x20c)]!==undefined&&(_0x1750f6[_0x283ff1(0x20c)]===![]&&_0x4f97e0['length']===0x0?_0x1f3501['all_columns']=!![]:_0x1f3501[_0x283ff1(0x22a)]=_0x1750f6[_0x283ff1(0x20c)]);const _0x15cceb={};let _0x5c9331=![];_0x1750f6[_0x283ff1(0x221)]&&(_0x15cceb['type']=_0x1750f6[_0x283ff1(0x221)],_0x5c9331=!![]);_0x1750f6[_0x283ff1(0x229)]&&(_0x15cceb[_0x283ff1(0x1fb)]=_0x1750f6[_0x283ff1(0x229)],_0x5c9331=!![]);_0x1750f6[_0x283ff1(0x22c)]!==undefined&&_0x1750f6[_0x283ff1(0x22c)]!==null&&(_0x15cceb['repeat_frequency']=_0x1750f6[_0x283ff1(0x22c)],_0x5c9331=!![]);_0x1750f6[_0x283ff1(0x1d1)]&&_0x1750f6[_0x283ff1(0x1d1)][_0x283ff1(0x1b3)]>0x0&&(_0x15cceb[_0x283ff1(0x1b6)]=_0x1750f6[_0x283ff1(0x1d1)],_0x5c9331=!![]);_0x1750f6[_0x283ff1(0x1c5)]!==undefined&&(_0x15cceb[_0x283ff1(0x210)]=_0x1750f6['startAt'],_0x5c9331=!![]);_0x1750f6[_0x283ff1(0x200)]!==undefined&&(_0x15cceb[_0x283ff1(0x1a2)]=_0x1750f6[_0x283ff1(0x200)],_0x5c9331=!![]);_0x1750f6[_0x283ff1(0x1e7)]&&(_0x15cceb[_0x283ff1(0x1e7)]=_0x1750f6['timezone'],_0x5c9331=!![]);_0x5c9331&&(_0x1f3501[_0x283ff1(0x1b2)]=_0x15cceb);(_0x1750f6[_0x283ff1(0x22d)]&&_0x1750f6[_0x283ff1(0x22d)][_0x283ff1(0x1b3)]>0x0||_0x1750f6['emailRecipients']&&_0x1750f6[_0x283ff1(0x206)][_0x283ff1(0x1b3)]>0x0)&&(_0x1f3501[_0x283ff1(0x1a3)]={},_0x1750f6[_0x283ff1(0x22d)]&&_0x1750f6[_0x283ff1(0x22d)][_0x283ff1(0x1b3)]>0x0&&(_0x1f3501[_0x283ff1(0x1a3)][_0x283ff1(0x1bb)]=_0x1750f6['notifyOn']),_0x1750f6[_0x283ff1(0x206)]&&_0x1750f6[_0x283ff1(0x206)][_0x283ff1(0x1b3)]>0x0&&(_0x1f3501[_0x283ff1(0x1a3)][_0x283ff1(0x1cb)]=_0x1750f6[_0x283ff1(0x206)][_0x283ff1(0x1ea)](_0x5211c8=>{const _0x50efa6=_0x283ff1,_0x54db8f=_0x3b289a?.[_0x50efa6(0x1e6)](_0x5211c8);return _0x54db8f??String(_0x5211c8);})));_0x1750f6[_0x283ff1(0x1d0)]&&Object[_0x283ff1(0x1ad)](_0x1750f6[_0x283ff1(0x1d0)])[_0x283ff1(0x1b3)]>0x0&&(_0x1f3501[_0x283ff1(0x1a7)]=normalizeConnectorConfigForYaml(_0x1750f6[_0x283ff1(0x1d0)]));_0x1750f6[_0x283ff1(0x1ac)]&&(_0x1f3501[_0x283ff1(0x1d9)]=_0x1750f6[_0x283ff1(0x1ac)]);if(_0x1750f6[_0x283ff1(0x20d)]){const _0xc7096e={},_0xd1a7e7=_0x1750f6['syndicationBehavior'];_0xd1a7e7[_0x283ff1(0x203)]&&_0xd1a7e7[_0x283ff1(0x203)][_0x283ff1(0x1b3)]>0x0&&(_0xc7096e[_0x283ff1(0x203)]=_0xd1a7e7[_0x283ff1(0x203)][_0x283ff1(0x1ee)](_0x20b0a5=>_0x20b0a5&&_0x20b0a5[_0x283ff1(0x1b8)])[_0x283ff1(0x1ea)](_0x49d0b4=>({'name':_0x49d0b4[_0x283ff1(0x1b8)],..._0x49d0b4[_0x283ff1(0x1ec)]&&{'type':_0x49d0b4[_0x283ff1(0x1ec)]},..._0x49d0b4['visibility']&&{'visibility':_0x49d0b4['visibility']}}))),_0xd1a7e7[_0x283ff1(0x1e5)]&&(_0xc7096e[_0x283ff1(0x1fe)]=_0xd1a7e7[_0x283ff1(0x1e5)]),_0xd1a7e7[_0x283ff1(0x213)]!==undefined&&(_0xc7096e['join_row']=_0xd1a7e7['joinRow']),_0xd1a7e7[_0x283ff1(0x1a6)]&&(_0xc7096e[_0x283ff1(0x1e0)]=_0xd1a7e7[_0x283ff1(0x1a6)]),_0xd1a7e7[_0x283ff1(0x21b)]&&(_0xc7096e[_0x283ff1(0x21b)]=_0xd1a7e7['formatting']),_0xd1a7e7[_0x283ff1(0x208)]&&_0xd1a7e7[_0x283ff1(0x208)][_0x283ff1(0x1b3)]>0x0&&(_0xc7096e['order_by']=_0xd1a7e7[_0x283ff1(0x208)]),Object['keys'](_0xc7096e)['length']>0x0&&(_0x1f3501['behavior']=_0xc7096e);}return _0x1f3501;}export function journeyActivationStepToYaml(_0x482144,_0x104bde,_0x26183a){const _0x50ae60=a92_0x58af3c,_0x4cc165=_0x482144['attributes']['activationParams'],_0x4de7a0=_0x4cc165[_0x50ae60(0x220)]||'',_0x2c4fde=_0x26183a?.[_0x50ae60(0x1e6)](_0x4de7a0)??_0x4de7a0,_0x1f3790={'name':_0x4cc165[_0x50ae60(0x1b8)]||'','connection':_0x2c4fde};_0x4cc165[_0x50ae60(0x219)]&&(_0x1f3790[_0x50ae60(0x219)]=_0x4cc165[_0x50ae60(0x219)]);let _0x360aae=[];_0x4cc165[_0x50ae60(0x203)]&&_0x4cc165[_0x50ae60(0x203)][_0x50ae60(0x1b3)]>0x0&&(_0x360aae=_0x4cc165['columns'][_0x50ae60(0x1ee)](_0x37a0e9=>_0x37a0e9&&_0x37a0e9['name'])['map'](_0x18c5bf=>{const _0xa84472=_0x50ae60;if(_0x18c5bf['type']||_0x18c5bf[_0xa84472(0x1ab)])return{'name':_0x18c5bf['name'],..._0x18c5bf[_0xa84472(0x1ec)]&&{'type':_0x18c5bf[_0xa84472(0x1ec)]},..._0x18c5bf[_0xa84472(0x1ab)]&&{'visibility':_0x18c5bf[_0xa84472(0x1ab)]}};return _0x18c5bf['name'];}));_0x360aae['length']>0x0&&(_0x1f3790[_0x50ae60(0x203)]=_0x360aae);_0x4cc165['allColumns']!==undefined&&(_0x4cc165[_0x50ae60(0x20c)]===![]&&_0x360aae[_0x50ae60(0x1b3)]===0x0?_0x1f3790['all_columns']=!![]:_0x1f3790[_0x50ae60(0x22a)]=_0x4cc165['allColumns']);const _0x1c0cfa={};let _0x22bb60=![];_0x4cc165[_0x50ae60(0x221)]&&(_0x1c0cfa[_0x50ae60(0x1ec)]=_0x4cc165[_0x50ae60(0x221)],_0x22bb60=!![]);_0x4cc165[_0x50ae60(0x229)]&&(_0x1c0cfa[_0x50ae60(0x1fb)]=_0x4cc165['repeatUnit'],_0x22bb60=!![]);_0x4cc165[_0x50ae60(0x22c)]!==undefined&&_0x4cc165[_0x50ae60(0x22c)]!==null&&(_0x1c0cfa['repeat_frequency']=_0x4cc165['repeatFrequency'],_0x22bb60=!![]);_0x4cc165[_0x50ae60(0x1c5)]!==undefined&&(_0x1c0cfa[_0x50ae60(0x210)]=_0x4cc165[_0x50ae60(0x1c5)],_0x22bb60=!![]);_0x4cc165['endOn']!==undefined&&(_0x1c0cfa[_0x50ae60(0x1a2)]=_0x4cc165[_0x50ae60(0x200)],_0x22bb60=!![]);_0x4cc165[_0x50ae60(0x1e7)]&&(_0x1c0cfa[_0x50ae60(0x1e7)]=_0x4cc165[_0x50ae60(0x1e7)],_0x22bb60=!![]);_0x22bb60&&(_0x1f3790[_0x50ae60(0x1b2)]=_0x1c0cfa);(_0x4cc165[_0x50ae60(0x22d)]&&_0x4cc165['notifyOn'][_0x50ae60(0x1b3)]>0x0||_0x4cc165[_0x50ae60(0x206)]&&_0x4cc165[_0x50ae60(0x206)]['length']>0x0)&&(_0x1f3790[_0x50ae60(0x1a3)]={},_0x4cc165[_0x50ae60(0x22d)]&&_0x4cc165[_0x50ae60(0x22d)][_0x50ae60(0x1b3)]>0x0&&(_0x1f3790[_0x50ae60(0x1a3)]['notify_on']=_0x4cc165['notifyOn']),_0x4cc165[_0x50ae60(0x206)]&&_0x4cc165[_0x50ae60(0x206)][_0x50ae60(0x1b3)]>0x0&&(_0x1f3790[_0x50ae60(0x1a3)][_0x50ae60(0x1cb)]=_0x4cc165['emailRecipients'][_0x50ae60(0x1ea)](_0x1e0081=>{const _0x2fe121=_0x50ae60,_0x50a516=_0x104bde?.[_0x2fe121(0x1e6)](_0x1e0081);return _0x50a516??String(_0x1e0081);})));_0x4cc165[_0x50ae60(0x1d0)]&&Object['keys'](_0x4cc165[_0x50ae60(0x1d0)])['length']>0x0&&(_0x1f3790['connector_config']=normalizeConnectorConfigForYaml(_0x4cc165[_0x50ae60(0x1d0)]));_0x4cc165[_0x50ae60(0x1ac)]&&(_0x1f3790[_0x50ae60(0x1d9)]=_0x4cc165['activationTemplateId']);if(_0x4cc165[_0x50ae60(0x20d)]){const _0x95e757={},_0x147b71=_0x4cc165['syndicationBehavior'];_0x147b71[_0x50ae60(0x203)]&&_0x147b71[_0x50ae60(0x203)][_0x50ae60(0x1b3)]>0x0&&(_0x95e757[_0x50ae60(0x203)]=_0x147b71[_0x50ae60(0x203)][_0x50ae60(0x1ee)](_0x2d3f37=>_0x2d3f37&&_0x2d3f37['name'])[_0x50ae60(0x1ea)](_0x58c7d5=>({'name':_0x58c7d5[_0x50ae60(0x1b8)],..._0x58c7d5[_0x50ae60(0x1ec)]&&{'type':_0x58c7d5['type']},..._0x58c7d5[_0x50ae60(0x1ab)]&&{'visibility':_0x58c7d5['visibility']}}))),_0x147b71[_0x50ae60(0x1e5)]&&(_0x95e757[_0x50ae60(0x1fe)]=_0x147b71[_0x50ae60(0x1e5)]),_0x147b71[_0x50ae60(0x213)]!==undefined&&(_0x95e757['join_row']=_0x147b71[_0x50ae60(0x213)]),_0x147b71[_0x50ae60(0x1a6)]&&(_0x95e757[_0x50ae60(0x1e0)]=_0x147b71[_0x50ae60(0x1a6)]),_0x147b71[_0x50ae60(0x21b)]&&(_0x95e757[_0x50ae60(0x21b)]=_0x147b71[_0x50ae60(0x21b)]),_0x147b71[_0x50ae60(0x208)]&&_0x147b71[_0x50ae60(0x208)][_0x50ae60(0x1b3)]>0x0&&(_0x95e757[_0x50ae60(0x1f3)]=_0x147b71['orderBy']),Object['keys'](_0x95e757)[_0x50ae60(0x1b3)]>0x0&&(_0x1f3790[_0x50ae60(0x212)]=_0x95e757);}return _0x1f3790;}export function segmentWithActivationsToYaml(_0x37010b,_0x1b0084,_0x1630e5,_0x11a87f,_0x4e4f8b){const _0xe36fb4=a92_0x58af3c,_0x281b07=segmentResponseToDefSync(_0x37010b,_0x1630e5);return _0x1b0084[_0xe36fb4(0x1b3)]>0x0&&(_0x281b07[_0xe36fb4(0x211)]=_0x1b0084[_0xe36fb4(0x1ea)](_0x2a2fd4=>activationResponseToDef(_0x2a2fd4,_0x11a87f,_0x4e4f8b))),_0x281b07;}function a92_0x2625(_0x3a7ab5,_0x243ccb){_0x3a7ab5=_0x3a7ab5-0x19f;const _0x3f3eb9=a92_0x3f3e();let _0x26254e=_0x3f3eb9[_0x3a7ab5];return _0x26254e;}function normalizeColumn(_0x400826){const _0x3fd6a3=a92_0x58af3c;if(typeof _0x400826===_0x3fd6a3(0x204))return{'name':_0x400826};return{'name':_0x400826[_0x3fd6a3(0x1b8)],..._0x400826[_0x3fd6a3(0x1ec)]&&{'type':_0x400826['type']},..._0x400826[_0x3fd6a3(0x1ab)]&&{'visibility':_0x400826['visibility']}};}export async function activationDefToCreateRequest(_0x321bc2,_0x54da5c){const _0xb31af5=a92_0x58af3c,_0x38a53a=_0x54da5c?.[_0xb31af5(0x20b)],_0x137499=_0x54da5c?.['connectionNameToIdMap'],_0x1be10f=_0x321bc2[_0xb31af5(0x20e)];let _0x3e47ee;const _0x4f982c=parseInt(_0x1be10f,0xa);if(!isNaN(_0x4f982c)&&String(_0x4f982c)===_0x1be10f)_0x3e47ee=_0x4f982c;else{const _0x1e0748=_0x137499?.[_0xb31af5(0x1e6)](_0x1be10f);if(_0x1e0748===undefined)throw new SDKError(ErrorCode['CONNECTION_NOT_FOUND'],_0xb31af5(0x1f1)+_0x1be10f,undefined,{'helpText':_0xb31af5(0x226)});_0x3e47ee=_0x1e0748;}const _0x158554={'name':_0x321bc2[_0xb31af5(0x1b8)],'connectionId':_0x3e47ee};_0x321bc2[_0xb31af5(0x219)]&&(_0x158554[_0xb31af5(0x219)]=_0x321bc2[_0xb31af5(0x219)]);let _0x455e6c=[];_0x321bc2[_0xb31af5(0x203)]&&_0x321bc2[_0xb31af5(0x203)][_0xb31af5(0x1b3)]>0x0&&(_0x455e6c=_0x321bc2[_0xb31af5(0x203)][_0xb31af5(0x1ee)](_0x36e655=>_0x36e655!=null)[_0xb31af5(0x1ea)](normalizeColumn));_0x455e6c[_0xb31af5(0x1b3)]>0x0&&(_0x158554[_0xb31af5(0x203)]=_0x455e6c);_0x321bc2['all_columns']!==undefined&&(_0x321bc2[_0xb31af5(0x22a)]===![]&&_0x455e6c[_0xb31af5(0x1b3)]===0x0?_0x158554['allColumns']=!![]:_0x158554['allColumns']=_0x321bc2[_0xb31af5(0x22a)]);if(_0x321bc2['schedule']){const _0x338a14=_0x321bc2['schedule'];_0x338a14['type']&&(_0x158554[_0xb31af5(0x221)]=_0x338a14['type']),_0x338a14[_0xb31af5(0x1fb)]&&(_0x158554['repeatUnit']=_0x338a14['repeat_unit']),_0x338a14[_0xb31af5(0x1ed)]!==undefined&&(_0x158554[_0xb31af5(0x22c)]=_0x338a14[_0xb31af5(0x1ed)]),_0x338a14[_0xb31af5(0x1b6)]&&(_0x158554[_0xb31af5(0x1d1)]=_0x338a14[_0xb31af5(0x1b6)]),_0x338a14['start_at']!==undefined&&(_0x158554[_0xb31af5(0x1c5)]=_0x338a14[_0xb31af5(0x210)]),_0x338a14[_0xb31af5(0x1a2)]!==undefined&&(_0x158554[_0xb31af5(0x200)]=_0x338a14['end_on']),_0x338a14[_0xb31af5(0x1e7)]&&(_0x158554[_0xb31af5(0x1e7)]=_0x338a14[_0xb31af5(0x1e7)]);}_0x321bc2[_0xb31af5(0x1a3)]&&(_0x321bc2[_0xb31af5(0x1a3)][_0xb31af5(0x1bb)]&&(_0x158554[_0xb31af5(0x22d)]=_0x321bc2['notification'][_0xb31af5(0x1bb)]),_0x321bc2['notification'][_0xb31af5(0x1cb)]&&(_0x158554[_0xb31af5(0x206)]=_0x321bc2[_0xb31af5(0x1a3)][_0xb31af5(0x1cb)][_0xb31af5(0x1ea)](_0x1a04c6=>{const _0x13994d=_0xb31af5,_0x1829ca=Number(_0x1a04c6);if(!isNaN(_0x1829ca)&&String(_0x1829ca)===_0x1a04c6)return _0x1829ca;const _0x113199=_0x38a53a?.['get'](_0x1a04c6[_0x13994d(0x1c3)]());if(_0x113199===undefined)throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x13994d(0x207)+_0x1a04c6+_0x13994d(0x1a4));return _0x113199;})));if(_0x321bc2[_0xb31af5(0x1a7)]){const _0x1e950d=_0x54da5c?.[_0xb31af5(0x1db)]?.[_0xb31af5(0x1e6)](_0x1be10f);if(_0x1e950d&&_0x54da5c?.[_0xb31af5(0x1c7)])try{const _0xe72ba5=await _0x54da5c['getSchema'](_0x1e950d),_0xdca639=validateConnectorConfig(_0x321bc2[_0xb31af5(0x1a7)],_0xe72ba5);if(!_0xdca639[_0xb31af5(0x1ef)])throw new SDKError(ErrorCode[_0xb31af5(0x21e)],'Invalid\x20connector_config\x20for\x20activation\x20\x22'+_0x321bc2[_0xb31af5(0x1b8)]+_0xb31af5(0x1c4)+formatValidationErrors(_0xdca639[_0xb31af5(0x1d3)]),undefined,{'helpText':_0xb31af5(0x1be)+_0x1e950d+'\x0a\x0aAvailable\x20fields:\x0a'+formatSchemaAsHelp(_0xe72ba5)});if(_0xdca639['warnings']['length']>0x0){const _0x34394a=formatValidationWarnings(_0xdca639[_0xb31af5(0x1cd)]);console[_0xb31af5(0x1c2)]('connector_config\x20for\x20activation\x20\x22'+_0x321bc2[_0xb31af5(0x1b8)]+_0xb31af5(0x1c4)+_0x34394a);}_0x158554[_0xb31af5(0x1d0)]=transformConfigToLegacy(_0x321bc2[_0xb31af5(0x1a7)],_0xe72ba5);}catch(_0x2f7804){if(_0x2f7804 instanceof SDKError&&_0x2f7804[_0xb31af5(0x1a8)]===ErrorCode[_0xb31af5(0x1f4)])_0x158554[_0xb31af5(0x1d0)]=_0x321bc2[_0xb31af5(0x1a7)];else throw _0x2f7804;}else _0x158554[_0xb31af5(0x1d0)]=_0x321bc2['connector_config'];}_0x321bc2[_0xb31af5(0x1d9)]!==undefined&&(_0x158554[_0xb31af5(0x1ac)]=_0x321bc2['activation_template_id']);if(_0x321bc2[_0xb31af5(0x212)]){const _0x39083e=_0x321bc2[_0xb31af5(0x212)],_0x2f226d={};if(_0x39083e[_0xb31af5(0x203)]&&_0x39083e['columns'][_0xb31af5(0x1b3)]>0x0){const _0x43bc38=_0x39083e[_0xb31af5(0x203)][_0xb31af5(0x1ee)](_0x4dc492=>_0x4dc492&&_0x4dc492[_0xb31af5(0x1b8)]);_0x43bc38['length']>0x0&&(_0x2f226d[_0xb31af5(0x203)]=_0x43bc38);}_0x39083e[_0xb31af5(0x1fe)]&&(_0x2f226d[_0xb31af5(0x1e5)]=_0x39083e[_0xb31af5(0x1fe)]),_0x39083e[_0xb31af5(0x228)]!==undefined&&(_0x2f226d[_0xb31af5(0x213)]=_0x39083e['join_row']),_0x39083e['join_strategy']&&(_0x2f226d[_0xb31af5(0x1a6)]=_0x39083e['join_strategy']),_0x39083e[_0xb31af5(0x21b)]&&(_0x2f226d[_0xb31af5(0x21b)]=_0x39083e[_0xb31af5(0x21b)]),_0x39083e[_0xb31af5(0x1f3)]&&(_0x2f226d[_0xb31af5(0x208)]=_0x39083e[_0xb31af5(0x1f3)]),_0x158554[_0xb31af5(0x20d)]=_0x2f226d;}return _0x158554;}export async function activationDefToUpdateRequest(_0x4b58f7,_0x3d32ee){return activationDefToCreateRequest(_0x4b58f7,_0x3d32ee);}function a92_0x3f3e(){const _0x142825=['7KkBLuD','rightValue','set','].attribute\x20cannot\x20be\x20empty.\x0a','repeat_unit','unit','stringify','behavior_table','3445XQvvFB','endOn','values','Invalid\x20condition\x20in\x20embedded\x20segment\x20\x27','columns','string','groupingColumns','emailRecipients','Unknown\x20email\x20recipient:\x20','orderBy','from','object','emailToIdMap','allColumns','syndicationBehavior','connection','max','start_at','activations','behavior','joinRow','test','rightValues','arrayMatching','min','usedNames','description','limit','formatting','value','conditions[','CONNECTOR_INVALID_CONFIG','conditions','connectionId','scheduleType','And','TimeWithinNext','__UNRESOLVED__','isVisible','Use\x20\x27tdx\x20connections\x27\x20to\x20list\x20available\x20connections','leftValue','join_row','repeatUnit','all_columns','not','repeatFrequency','notifyOn','__SEGMENT_REF__','kind','any','parse','8yFfdQl','Please\x20specify\x20a\x20valid\x20attribute\x20name.','batch','end_on','notification','.\x20Use\x20\x27tdx\x20user\x20list\x27\x20to\x20see\x20valid\x20emails.','localeCompare','joinStrategy','connector_config','code','attribute','6421400pAfZwr','visibility','activationTemplateId','keys','sort','621944WSUTjw','all','activations:','schedule','length','ruleHashToName','824350WIuxKE','repeat_sub_frequency','4476213JASPwD','name','segmentFolderId','realtime','notify_on','attribute_name','segment','Connector:\x20','32280hOvUoq','localRuleToName','every','warn','toLowerCase','\x22:\x0a','startAt','New\x20Segment','getSchema','add','rule','aggregation','email_recipients','duration','warnings','\x27:\x20','TimeWithinPast','connectorConfig','repeatSubFrequency','visible','errors','entries','YAML\x20type\x20must\x20be\x20\x27segment\x27\x20or\x20omitted,\x20got:\x20','exclude','has','Reference','activation_template_id','8OYKYRW','connectionNameToTypeMap','null','Value','push','270007QgMSqu','join_strategy','3DfcJbb','7550016JvlCTs','143LZufoh','funnel_stage','behaviorTableName','get','timezone','operator','include','map','Segment\x20description','type','repeat_frequency','filter','valid','rule:','Unknown\x20connection:\x20','source','order_by','CONNECTOR_SCHEMA_NOT_FOUND','replace','isArray'];a92_0x3f3e=function(){return _0x142825;};return a92_0x3f3e();}export function deepSortObject(_0x5571cc){const _0x2e17c9=a92_0x58af3c;if(_0x5571cc===null||typeof _0x5571cc!==_0x2e17c9(0x20a))return _0x5571cc;if(Array[_0x2e17c9(0x1f6)](_0x5571cc))return _0x5571cc[_0x2e17c9(0x1ea)](deepSortObject)[_0x2e17c9(0x1ae)]((_0x349230,_0x2472e5)=>JSON[_0x2e17c9(0x1fd)](_0x349230)[_0x2e17c9(0x1a5)](JSON[_0x2e17c9(0x1fd)](_0x2472e5)));const _0x304b70={};for(const _0x32498e of Object['keys'](_0x5571cc)['sort']()){_0x304b70[_0x32498e]=deepSortObject(_0x5571cc[_0x32498e]);}return _0x304b70;}export function serializeRule(_0x4c0065){return JSON['stringify'](deepSortObject(_0x4c0065));}export function normalizeRuleForMatching(_0x49014a){return normalizeConditionsForMatching(_0x49014a);}function normalizeConditionsForMatching(_0x1194c4){const _0x458a18=a92_0x58af3c;if(_0x1194c4===null||typeof _0x1194c4!==_0x458a18(0x20a))return _0x1194c4;if(Array['isArray'](_0x1194c4))return _0x1194c4[_0x458a18(0x1ea)](normalizeConditionsForMatching);const _0x1c9144=_0x1194c4;if((_0x1c9144[_0x458a18(0x1ec)]===_0x458a18(0x1e9)||_0x1c9144[_0x458a18(0x1ec)]===_0x458a18(0x1d6))&&typeof _0x1c9144[_0x458a18(0x1bd)]==='string')return{..._0x1c9144,'segment':_0x458a18(0x22e)};const _0x54cdcb={};for(const _0x514f1a of Object['keys'](_0x1c9144)){_0x54cdcb[_0x514f1a]=normalizeConditionsForMatching(_0x1c9144[_0x514f1a]);}return _0x54cdcb;}export function serializeRuleForMatching(_0x1581f4){return JSON['stringify'](deepSortObject(normalizeRuleForMatching(_0x1581f4)));}export function expandSegmentReferences(_0x7bed6f,_0x31b378,_0x41c61b=new Set()){return expandConditions(_0x7bed6f,_0x31b378,_0x41c61b);}function expandConditions(_0x52a4ed,_0x26b729,_0x34a7d1){const _0x557da8=a92_0x58af3c;if(_0x52a4ed===null||typeof _0x52a4ed!=='object')return _0x52a4ed;if(Array[_0x557da8(0x1f6)](_0x52a4ed))return _0x52a4ed['map'](_0x435a91=>expandConditions(_0x435a91,_0x26b729,_0x34a7d1));const _0x433e08=_0x52a4ed;if((_0x433e08[_0x557da8(0x1ec)]===_0x557da8(0x1e9)||_0x433e08[_0x557da8(0x1ec)]===_0x557da8(0x1d6))&&typeof _0x433e08['segment']===_0x557da8(0x204)){const _0x830d3f=_0x433e08['segment'],_0xe61461=_0x26b729[_0x557da8(0x1e6)](_0x830d3f);if(_0xe61461&&!_0x34a7d1[_0x557da8(0x1d7)](_0x830d3f)){const _0x31f215=new Set(_0x34a7d1);_0x31f215[_0x557da8(0x1c8)](_0x830d3f);const _0x5abbf7=expandConditions(_0xe61461,_0x26b729,_0x31f215);return{'type':_0x433e08[_0x557da8(0x1ec)],'expanded_rule':_0x5abbf7};}return{'type':_0x433e08[_0x557da8(0x1ec)],'expanded_rule':_0x557da8(0x224)};}const _0x2e2b96={};for(const _0x320e1e of Object[_0x557da8(0x1ad)](_0x433e08)){_0x2e2b96[_0x320e1e]=expandConditions(_0x433e08[_0x320e1e],_0x26b729,_0x34a7d1);}return _0x2e2b96;}export function serializeExpandedRule(_0x1ad444,_0x209f41){const _0x59ce69=a92_0x58af3c,_0x41f499=expandSegmentReferences(_0x1ad444,_0x209f41);return JSON[_0x59ce69(0x1fd)](deepSortObject(_0x41f499));}export function createSegmentNameContext(_0xf4cdbe){const _0x13a3c2=a92_0x58af3c,_0x43230b=new Set(),_0xa7a106=new Map(),_0x53d799=new Map();if(_0xf4cdbe)for(const [_0x211603,_0x2f962e]of Object[_0x13a3c2(0x1d4)](_0xf4cdbe)){if(_0x2f962e[_0x13a3c2(0x1c9)]){const _0x440106=serializeRule(_0x2f962e['rule']);_0x53d799[_0x13a3c2(0x1f9)](_0x440106,_0x211603),_0x43230b[_0x13a3c2(0x1c8)](_0x211603);}}return{'usedNames':_0x43230b,'ruleHashToName':_0xa7a106,'localRuleToName':_0xf4cdbe?_0x53d799:undefined};}export function resolveSegmentName(_0x22ccfd,_0x203931,_0x34f703,_0xb540cf){const _0x548be7=a92_0x58af3c,_0x35b8bd=serializeRule(_0x203931);if(_0x34f703['localRuleToName']){const _0x575db9=_0x34f703[_0x548be7(0x1c0)][_0x548be7(0x1e6)](_0x35b8bd);if(_0x575db9)return{'name':_0x575db9,'isDuplicate':![],'isLocalMatch':!![]};}const _0x1213dc=_0x34f703['ruleHashToName'][_0x548be7(0x1e6)](_0x35b8bd);if(_0x1213dc)return{'name':_0x1213dc,'isDuplicate':!![],'isLocalMatch':![]};const _0x1916d4=_0xb540cf(_0x22ccfd);let _0x446627=_0x1916d4||_0x22ccfd,_0x380768=_0x446627,_0x4b2548=0x2;while(_0x34f703[_0x548be7(0x218)]['has'](_0x380768)){_0x380768=_0x446627+'_'+_0x4b2548,_0x4b2548++;}return _0x34f703[_0x548be7(0x218)]['add'](_0x380768),_0x34f703[_0x548be7(0x1b4)]['set'](_0x35b8bd,_0x380768),{'name':_0x380768,'isDuplicate':![],'isLocalMatch':![]};}export function collectSegmentRefsFromRule(_0x31f333){const _0x263e69=[],_0x43c095=_0x494f01=>{const _0x3e91e1=a92_0x2625;if(!_0x494f01||typeof _0x494f01!==_0x3e91e1(0x20a))return;if(Array[_0x3e91e1(0x1f6)](_0x494f01)){_0x494f01['forEach'](_0x43c095);return;}const _0x1e6df9=_0x494f01;(_0x1e6df9[_0x3e91e1(0x1ec)]===_0x3e91e1(0x1e9)||_0x1e6df9[_0x3e91e1(0x1ec)]===_0x3e91e1(0x1d6))&&typeof _0x1e6df9[_0x3e91e1(0x1bd)]==='string'&&_0x263e69[_0x3e91e1(0x1de)](_0x1e6df9['segment']);for(const _0x75f9d2 of Object['values'](_0x1e6df9)){_0x43c095(_0x75f9d2);}};return _0x43c095(_0x31f333),_0x263e69;}export function validateSegmentRule(_0x4d1ce9,_0x5e4d02){const _0x48bab8=a92_0x58af3c;if(!_0x5e4d02||!_0x5e4d02['conditions'])return;for(let _0x518722=0x0;_0x518722<_0x5e4d02[_0x48bab8(0x21f)][_0x48bab8(0x1b3)];_0x518722++){const _0xdd9ee9=_0x5e4d02[_0x48bab8(0x21f)][_0x518722];if(_0x48bab8(0x1ec)in _0xdd9ee9&&_0xdd9ee9[_0x48bab8(0x1ec)]===_0x48bab8(0x1dd)){const _0x110a4f=_0xdd9ee9;if(!_0x110a4f[_0x48bab8(0x1a9)]||_0x110a4f['attribute']==='')throw new SDKError(ErrorCode['JOURNEY_SYNTAX_ERROR'],_0x48bab8(0x202)+_0x4d1ce9+_0x48bab8(0x1ce)+(_0x48bab8(0x21d)+_0x518722+_0x48bab8(0x1fa))+_0x48bab8(0x1a0));}}}
1
+ const a92_0x4a9a23=a92_0x4feb;(function(_0x213e85,_0x17f033){const _0x23e6c5=a92_0x4feb,_0x21ef87=_0x213e85();while(!![]){try{const _0x319e2e=parseInt(_0x23e6c5(0x217))/0x1*(parseInt(_0x23e6c5(0x24c))/0x2)+parseInt(_0x23e6c5(0x21f))/0x3*(-parseInt(_0x23e6c5(0x23f))/0x4)+parseInt(_0x23e6c5(0x221))/0x5*(-parseInt(_0x23e6c5(0x27a))/0x6)+-parseInt(_0x23e6c5(0x23b))/0x7*(-parseInt(_0x23e6c5(0x269))/0x8)+parseInt(_0x23e6c5(0x22e))/0x9+-parseInt(_0x23e6c5(0x211))/0xa*(-parseInt(_0x23e6c5(0x274))/0xb)+-parseInt(_0x23e6c5(0x26c))/0xc*(parseInt(_0x23e6c5(0x22c))/0xd);if(_0x319e2e===_0x17f033)break;else _0x21ef87['push'](_0x21ef87['shift']());}catch(_0x4d3ed5){_0x21ef87['push'](_0x21ef87['shift']());}}}(a92_0x29a6,0x85557));import*as a92_0x11a49f from'yaml';import{SDKError,ErrorCode}from'../errors.js';import{validateConnectorConfig,transformConfigToLegacy,normalizeConnectorConfigForYaml,formatValidationErrors,formatValidationWarnings,formatSchemaAsHelp}from'../connection-validator.js';export function segmentResponseToDefSync(_0x3da45b,_0x18c240){const _0x5d4d7b=a92_0x4feb,_0x58c8e3=_0x3da45b[_0x5d4d7b(0x270)]&&'type'in _0x3da45b[_0x5d4d7b(0x270)]&&_0x3da45b['rule'][_0x5d4d7b(0x20a)];return{'type':_0x5d4d7b(0x252),'name':_0x3da45b['name'],..._0x3da45b[_0x5d4d7b(0x267)]&&{'description':_0x3da45b[_0x5d4d7b(0x267)]},..._0x18c240&&{'folder':_0x18c240},..._0x58c8e3&&{'rule':apiRuleToYaml(_0x3da45b[_0x5d4d7b(0x270)])},..._0x3da45b[_0x5d4d7b(0x273)]!==undefined&&{'kind':_0x3da45b[_0x5d4d7b(0x273)]===0x0?_0x5d4d7b(0x25c):_0x3da45b[_0x5d4d7b(0x273)]===0x1?_0x5d4d7b(0x1f3):_0x5d4d7b(0x20d)},..._0x3da45b[_0x5d4d7b(0x1f7)]!==undefined&&{'visible':_0x3da45b[_0x5d4d7b(0x1f7)]}};}export async function segmentResponseToDef(_0x540ac1,_0x405886,_0x2e87fe){const _0x40d0ca=a92_0x4feb,_0xd1c00=segmentResponseToDefSync(_0x540ac1,_0x2e87fe);if(!_0x405886||!_0x405886[_0x40d0ca(0x1fa)])return _0xd1c00;return _0xd1c00[_0x40d0ca(0x270)]&&(_0xd1c00[_0x40d0ca(0x270)]=await resolveRuleSegmentRefs(_0xd1c00[_0x40d0ca(0x270)],_0x405886[_0x40d0ca(0x1fa)])),_0xd1c00;}export function apiRuleToYaml(_0x4c3d3d){const _0x5880dd=a92_0x4feb,_0x28d6d6=(_0x4c3d3d[_0x5880dd(0x21b)]||[])[_0x5880dd(0x268)](apiConditionToYaml);if(_0x28d6d6['length']===0x1&&!_0x4c3d3d['description']&&_0x5880dd(0x20a)in _0x28d6d6[0x0]&&(_0x28d6d6[0x0][_0x5880dd(0x20a)]===_0x5880dd(0x279)||_0x28d6d6[0x0][_0x5880dd(0x20a)]==='Or')){const _0x2d12c3=_0x28d6d6[0x0];if(_0x2d12c3[_0x5880dd(0x20a)]===_0x4c3d3d[_0x5880dd(0x20a)]&&_0x2d12c3[_0x5880dd(0x21b)])return{'type':_0x4c3d3d[_0x5880dd(0x20a)],'conditions':_0x2d12c3[_0x5880dd(0x21b)],..._0x2d12c3['description']&&{'description':_0x2d12c3[_0x5880dd(0x267)]}};}return{'type':_0x4c3d3d['type'],'conditions':_0x28d6d6,..._0x4c3d3d['description']&&{'description':_0x4c3d3d[_0x5880dd(0x267)]}};}export async function resolveRuleSegmentRefs(_0x1720f3,_0x351693){const _0x4b850b=a92_0x4feb,_0x575c15=await Promise['all'](_0x1720f3[_0x4b850b(0x21b)][_0x4b850b(0x268)](_0x2e6964=>resolveConditionSegmentRefs(_0x2e6964,_0x351693)));return{..._0x1720f3,'conditions':_0x575c15};}async function resolveConditionSegmentRefs(_0x5cd9df,_0x42bb1a){const _0x458d84=a92_0x4feb;if(_0x458d84(0x252)in _0x5cd9df&&(_0x5cd9df[_0x458d84(0x20a)]===_0x458d84(0x244)||_0x5cd9df[_0x458d84(0x20a)]===_0x458d84(0x27f))){const _0x2c5b88=_0x5cd9df;if(/^\d+$/['test'](_0x2c5b88[_0x458d84(0x252)])){const _0x3ed2b6=await _0x42bb1a(_0x2c5b88['segment']);return{..._0x2c5b88,'segment':_0x3ed2b6};}return _0x5cd9df;}if(_0x458d84(0x21b)in _0x5cd9df&&_0x5cd9df['conditions']){const _0x36dce2=_0x5cd9df,_0x2716ea=await Promise[_0x458d84(0x275)](_0x36dce2[_0x458d84(0x21b)][_0x458d84(0x268)](_0x5e865b=>resolveConditionSegmentRefs(_0x5e865b,_0x42bb1a)));return{..._0x36dce2,'conditions':_0x2716ea};}if(_0x458d84(0x24d)in _0x5cd9df&&_0x5cd9df[_0x458d84(0x24d)]){const _0x54c58b=_0x5cd9df,_0x304f51=await resolveRuleSegmentRefs(_0x54c58b[_0x458d84(0x24d)],_0x42bb1a);return{..._0x54c58b,'filter':_0x304f51};}return _0x5cd9df;}export async function resolveRuleSegmentIds(_0x3a7d93,_0x3da5a7){const _0x1c0444=a92_0x4feb,_0x342316=await Promise[_0x1c0444(0x275)](_0x3a7d93[_0x1c0444(0x21b)][_0x1c0444(0x268)](_0x3c71fe=>resolveConditionSegmentIds(_0x3c71fe,_0x3da5a7)));return{..._0x3a7d93,'conditions':_0x342316};}async function resolveConditionSegmentIds(_0x2013d3,_0x150219){const _0x54f38c=a92_0x4feb;if(_0x54f38c(0x252)in _0x2013d3&&(_0x2013d3[_0x54f38c(0x20a)]===_0x54f38c(0x244)||_0x2013d3[_0x54f38c(0x20a)]==='exclude')){const _0xab7a06=_0x2013d3;if(!/^\d+$/[_0x54f38c(0x24f)](_0xab7a06[_0x54f38c(0x252)])){const _0x3859de=await _0x150219(_0xab7a06[_0x54f38c(0x252)]);return{..._0xab7a06,'segment':_0x3859de};}return _0x2013d3;}if(_0x54f38c(0x21b)in _0x2013d3&&_0x2013d3[_0x54f38c(0x21b)]){const _0x2b763f=_0x2013d3,_0x4bcde5=await Promise[_0x54f38c(0x275)](_0x2b763f[_0x54f38c(0x21b)][_0x54f38c(0x268)](_0x5a64e4=>resolveConditionSegmentIds(_0x5a64e4,_0x150219)));return{..._0x2b763f,'conditions':_0x4bcde5};}if(_0x54f38c(0x24d)in _0x2013d3&&_0x2013d3[_0x54f38c(0x24d)]){const _0x4f7332=_0x2013d3,_0x29e40e=await resolveRuleSegmentIds(_0x4f7332[_0x54f38c(0x24d)],_0x150219);return{..._0x4f7332,'filter':_0x29e40e};}return _0x2013d3;}function apiConditionToYaml(_0x50a59d){const _0x247074=a92_0x4feb;if(_0x50a59d[_0x247074(0x20a)]===_0x247074(0x279)||_0x50a59d[_0x247074(0x20a)]==='Or'){if(_0x50a59d[_0x247074(0x21b)]){const _0x518ac2=_0x50a59d[_0x247074(0x21b)]['map'](apiConditionToYaml);if(_0x518ac2[_0x247074(0x232)]===0x1&&!_0x50a59d['description'])return _0x518ac2[0x0];return{'type':_0x50a59d['type'],'conditions':_0x518ac2,..._0x50a59d[_0x247074(0x267)]&&{'description':_0x50a59d['description']}};}}if(_0x50a59d[_0x247074(0x20a)]==='Value'&&_0x50a59d[_0x247074(0x260)]&&_0x50a59d[_0x247074(0x25d)]){const _0x28b766=_0x50a59d[_0x247074(0x260)][_0x247074(0x272)]?{'type':_0x50a59d['leftValue'][_0x247074(0x272)][_0x247074(0x20a)],..._0x50a59d[_0x247074(0x260)]['aggregation']['groupingColumns']&&{'groupingColumns':_0x50a59d[_0x247074(0x260)]['aggregation'][_0x247074(0x280)]}}:undefined;return{'type':'Value','attribute':_0x50a59d['leftValue'][_0x247074(0x236)]||'','operator':apiOperatorToYaml(_0x50a59d[_0x247074(0x25d)]),..._0x50a59d['arrayMatching']&&_0x50a59d[_0x247074(0x266)]!==_0x247074(0x223)?{'arrayMatching':_0x50a59d[_0x247074(0x266)]}:{},..._0x50a59d['exclude']?{'exclude':_0x50a59d[_0x247074(0x27f)]}:{},..._0x28b766?{'aggregation':_0x28b766}:{},..._0x50a59d['leftValue'][_0x247074(0x25f)]?{'source':_0x50a59d[_0x247074(0x260)][_0x247074(0x25f)][_0x247074(0x236)]}:{},..._0x50a59d['leftValue'][_0x247074(0x24d)]?{'filter':apiRuleToYaml(_0x50a59d[_0x247074(0x260)][_0x247074(0x24d)])}:{},..._0x50a59d['limit']!==undefined&&_0x50a59d[_0x247074(0x1fd)]!==null?{'limit':_0x50a59d[_0x247074(0x1fd)]}:{}};}if(_0x50a59d[_0x247074(0x20a)]===_0x247074(0x26d)&&_0x50a59d['id'])return{'type':_0x50a59d[_0x247074(0x27f)]?_0x247074(0x27f):'include','segment':_0x50a59d['id']};return{'type':_0x247074(0x279),'conditions':[]};}function isTemporalOperator(_0x50f1ed){const _0xd4b011=a92_0x4feb;return _0x50f1ed===_0xd4b011(0x20e)||_0x50f1ed===_0xd4b011(0x229);}function getEffectiveValue(_0xa4632a){const _0x1e8eb6=a92_0x4feb,_0x57d193=_0xa4632a[_0x1e8eb6(0x225)];return _0xa4632a['value']??_0x57d193;}function a92_0x29a6(){const _0xa7e098=['TimeWithinNext','connectorConfig','emailRecipients','91598AytkgS','max','6539265AGYchP','rule:','join_row','behaviorTableName','length','Equal','conditions[','add','name','start_at','localRuleToName','replace','endOn','92043uyMNUP','null','duration','connectionId','4QdWHzg','forEach','activations:','schedule','emailToIdMap','include','warn','Please\x20specify\x20a\x20valid\x20attribute\x20name.','push','repeatFrequency','join_strategy','notify_on','scheduleType','263506UZRVUY','filter','YAML\x20config\x20missing\x20required\x20field:\x20name','test','INVALID_ARGUMENT','rightValue','segment','repeat_frequency','rightValues','order_by','joinRow','activation_template_id','syndicationBehavior','repeatSubFrequency','localeCompare','stringify','batch','operator','startAt','source','leftValue','email_recipients','getSchema','notifyOn','min','__SEGMENT_REF__','arrayMatching','description','map','88dCrOOL','entries','formatting','228ZmWmNo','Reference','connectionNameToIdMap','Value','rule','CONNECTOR_INVALID_CONFIG','aggregation','kind','18568WEkHUn','all','behavior','keys','get','And','240nlGnTJ','timezone','from','repeat_unit','valid','exclude','groupingColumns','sort','\x22:\x0a','attribute','visible','realtime','repeat_sub_frequency','columns','behavior_table','isVisible','unit','connector_config\x20for\x20activation\x20\x22','resolveSegmentName','activations','New\x20Segment','limit','attributes','usedNames','value','orderBy','warnings','\x27:\x20','__UNRESOLVED__','connectionNameToTypeMap','not','parse','connection','code','type','repeatUnit','\x0a\x0aAvailable\x20fields:\x0a','funnel_stage','TimeWithinPast','folder','joinStrategy','3830BIRmMk','string','all_columns','visibility','connector_config','ruleHashToName','2tySiEs','CONNECTION_NOT_FOUND','JOURNEY_SYNTAX_ERROR','allColumns','conditions','notification','object','isArray','2777475aVNqBm','activationTemplateId','21925yxPvPR','YAML\x20type\x20must\x20be\x20\x27segment\x27\x20or\x20omitted,\x20got:\x20','any','every','values','has','end_on','Segment\x20description'];a92_0x29a6=function(){return _0xa7e098;};return a92_0x29a6();}function apiOperatorToYaml(_0x1f72dd){const _0x368908=a92_0x4feb;let _0x1f6e13;if(_0x1f72dd[_0x368908(0x254)]&&_0x1f72dd[_0x368908(0x254)][_0x368908(0x232)]>0x0)_0x1f6e13=_0x1f72dd[_0x368908(0x254)];else{if(_0x1f72dd[_0x368908(0x251)]!==undefined)_0x1f6e13=_0x1f72dd[_0x368908(0x251)];else isTemporalOperator(_0x1f72dd['type'])&&_0x1f72dd[_0x368908(0x200)]!==undefined&&(_0x1f6e13=_0x1f72dd['value']);}return{'type':mapApiOperatorType(_0x1f72dd[_0x368908(0x20a)]),..._0x1f72dd[_0x368908(0x206)]&&{'not':_0x1f72dd[_0x368908(0x206)]},..._0x1f6e13!==undefined&&{'value':_0x1f6e13},..._0x1f72dd['unit']&&{'unit':_0x1f72dd[_0x368908(0x1f8)]}};}function mapApiOperatorType(_0x26dc72){return _0x26dc72;}export function segmentDefToCreateRequest(_0x1ebdd4,_0x13cccc){const _0x520247=a92_0x4feb,_0x2b4411={'name':_0x1ebdd4[_0x520247(0x236)]};return _0x1ebdd4[_0x520247(0x267)]&&(_0x2b4411[_0x520247(0x267)]=_0x1ebdd4[_0x520247(0x267)]),_0x1ebdd4[_0x520247(0x270)]&&(_0x2b4411[_0x520247(0x270)]=yamlRuleToApi(_0x1ebdd4[_0x520247(0x270)])),_0x1ebdd4[_0x520247(0x273)]&&(_0x2b4411[_0x520247(0x273)]=_0x1ebdd4[_0x520247(0x273)]===_0x520247(0x25c)?0x0:_0x1ebdd4[_0x520247(0x273)]===_0x520247(0x1f3)?0x1:0x2),_0x1ebdd4[_0x520247(0x1f2)]!==undefined&&(_0x2b4411[_0x520247(0x1f7)]=_0x1ebdd4[_0x520247(0x1f2)]),_0x13cccc&&(_0x2b4411['segmentFolderId']=_0x13cccc),_0x2b4411;}export function segmentDefToUpdateRequest(_0x2ac9d9){const _0x2d1a77=a92_0x4feb,_0x5d2faa={'name':_0x2ac9d9[_0x2d1a77(0x236)]};return _0x2ac9d9[_0x2d1a77(0x267)]!==undefined&&(_0x5d2faa[_0x2d1a77(0x267)]=_0x2ac9d9[_0x2d1a77(0x267)]),_0x2ac9d9['rule']&&(_0x5d2faa[_0x2d1a77(0x270)]=yamlRuleToApi(_0x2ac9d9[_0x2d1a77(0x270)])),_0x2ac9d9[_0x2d1a77(0x273)]&&(_0x5d2faa[_0x2d1a77(0x273)]=_0x2ac9d9[_0x2d1a77(0x273)]===_0x2d1a77(0x25c)?0x0:_0x2ac9d9[_0x2d1a77(0x273)]===_0x2d1a77(0x1f3)?0x1:0x2),_0x5d2faa;}export function yamlRuleToApi(_0x58e1f9,_0x3db8b4=![]){const _0x452a2d=a92_0x4feb,_0x42e09b=_0x58e1f9[_0x452a2d(0x21b)][_0x452a2d(0x268)](yamlConditionToApi);if(_0x3db8b4){const _0x3af871=_0x42e09b[_0x452a2d(0x224)](_0x1fe62a=>_0x1fe62a[_0x452a2d(0x20a)]===_0x452a2d(0x279)||_0x1fe62a[_0x452a2d(0x20a)]==='Or');if(!_0x3af871&&_0x42e09b[_0x452a2d(0x232)]>0x0)return{'type':_0x58e1f9['type'],'conditions':[{'type':_0x452a2d(0x279),'description':_0x58e1f9['description']||'','conditions':_0x42e09b}]};}return{'type':_0x58e1f9[_0x452a2d(0x20a)],'conditions':_0x42e09b,..._0x58e1f9['description']&&{'description':_0x58e1f9[_0x452a2d(0x267)]}};}function yamlConditionToApi(_0x170d29){const _0x106a37=a92_0x4feb;if('segment'in _0x170d29&&(_0x170d29[_0x106a37(0x20a)]===_0x106a37(0x244)||_0x170d29['type']===_0x106a37(0x27f))){const _0x550f00=_0x170d29;return{'type':'Reference','id':_0x550f00['segment'],'exclude':_0x550f00[_0x106a37(0x20a)]==='exclude'};}if(_0x106a37(0x20a)in _0x170d29&&(_0x170d29[_0x106a37(0x20a)]===_0x106a37(0x279)||_0x170d29[_0x106a37(0x20a)]==='Or')){const _0x5b1166=_0x170d29;return{'type':_0x5b1166['type'],'conditions':_0x5b1166[_0x106a37(0x21b)][_0x106a37(0x268)](yamlConditionToApi),..._0x5b1166['description']&&{'description':_0x5b1166[_0x106a37(0x267)]}};}const _0x149a1d=_0x170d29,_0x497547={'type':'Value','leftValue':buildLeftValue(_0x149a1d),'operator':yamlOperatorToApi(_0x149a1d[_0x106a37(0x25d)]),'exclude':_0x149a1d[_0x106a37(0x27f)]??![],'arrayMatching':_0x149a1d[_0x106a37(0x266)]??_0x106a37(0x223)};return _0x149a1d['limit']!==undefined&&(_0x497547[_0x106a37(0x1fd)]=_0x149a1d['limit']),_0x497547;}function buildLeftValue(_0x3b2194){const _0x42f8cb=a92_0x4feb,_0x5d7214={'name':_0x3b2194['attribute']};return _0x3b2194[_0x42f8cb(0x272)]&&(_0x5d7214[_0x42f8cb(0x272)]={'type':_0x3b2194[_0x42f8cb(0x272)][_0x42f8cb(0x20a)],..._0x3b2194[_0x42f8cb(0x272)][_0x42f8cb(0x280)]&&{'groupingColumns':_0x3b2194['aggregation'][_0x42f8cb(0x280)]}}),_0x3b2194[_0x42f8cb(0x25f)]&&(_0x5d7214['source']={'name':_0x3b2194[_0x42f8cb(0x25f)]}),_0x3b2194[_0x42f8cb(0x24d)]&&(_0x5d7214['filter']=yamlRuleToApi(_0x3b2194[_0x42f8cb(0x24d)])),_0x5d7214;}function yamlOperatorToApi(_0x205f52){const _0x5d2625=a92_0x4feb,_0x120b1f={'type':mapYamlOperatorType(_0x205f52[_0x5d2625(0x20a)]),'not':_0x205f52[_0x5d2625(0x206)]??![]},_0x1badc2=getEffectiveValue(_0x205f52);if(_0x1badc2!==undefined){if(Array[_0x5d2625(0x21e)](_0x1badc2))_0x120b1f[_0x5d2625(0x254)]=_0x1badc2;else isTemporalOperator(_0x205f52[_0x5d2625(0x20a)])?_0x120b1f['value']=_0x1badc2:_0x120b1f['rightValue']=_0x1badc2;}return _0x205f52[_0x5d2625(0x1f8)]&&(_0x120b1f['unit']=_0x205f52['unit']),_0x120b1f;}function mapYamlOperatorType(_0x3a74ba){return _0x3a74ba;}export function toYamlString(_0xc6f38f){const _0x17e770=a92_0x4feb,_0x261849=JSON[_0x17e770(0x207)](JSON['stringify'](_0xc6f38f)),_0x2dcafb=a92_0x11a49f[_0x17e770(0x25b)](_0x261849,{'indent':0x2,'lineWidth':0x0,'nullStr':_0x17e770(0x23c)}),_0x20e912=[_0x17e770(0x22f)];let _0x480670=_0x2dcafb;for(const _0x3e39ff of _0x20e912){_0x480670=_0x480670[_0x17e770(0x239)](new RegExp('^('+_0x3e39ff+')','m'),(_0x52f76e,_0x3adb0d,_0x2026f5)=>{if(_0x2026f5===0x0||_0x480670[_0x2026f5-0x1]==='\x0a'&&_0x480670[_0x2026f5-0x2]==='\x0a')return _0x3adb0d;return'\x0a'+_0x3adb0d;});}return _0x480670;}export function parseYamlString(_0x1c0f2b){const _0x554255=a92_0x4feb,_0xd9b4bf=a92_0x11a49f[_0x554255(0x207)](_0x1c0f2b);if(!_0xd9b4bf[_0x554255(0x236)])throw new Error(_0x554255(0x24e));if(_0xd9b4bf[_0x554255(0x20a)]&&_0xd9b4bf[_0x554255(0x20a)]!==_0x554255(0x252))throw new Error(_0x554255(0x222)+_0xd9b4bf[_0x554255(0x20a)]);return _0xd9b4bf;}export function isSegmentYaml(_0x4a149e){const _0x2c1220=a92_0x4feb;if(typeof _0x4a149e!=='object'||_0x4a149e===null)return![];const _0x44a652=_0x4a149e;return _0x44a652[_0x2c1220(0x20a)]===_0x2c1220(0x252)||_0x44a652['type']===undefined;}export function generateTemplate(_0x3e5aa7=a92_0x4a9a23(0x1fc)){const _0x5daefd=a92_0x4a9a23,_0x4404ec={'type':_0x5daefd(0x252),'name':_0x3e5aa7,'description':_0x5daefd(0x228),'rule':{'type':_0x5daefd(0x279),'conditions':[{'type':_0x5daefd(0x26f),'attribute':'attribute_name','operator':{'type':_0x5daefd(0x233),'value':'value'}}]}};return toYamlString(_0x4404ec);}export function segmentToYamlString(_0x3826d0){const _0x485ff7=a92_0x4a9a23,_0x221d14=JSON[_0x485ff7(0x207)](JSON[_0x485ff7(0x25b)](_0x3826d0)),_0x1188a0=a92_0x11a49f[_0x485ff7(0x25b)](_0x221d14,{'indent':0x2,'lineWidth':0x0,'nullStr':_0x485ff7(0x23c)}),_0x57705f=['rule:',_0x485ff7(0x241)];let _0x5798ca=_0x1188a0;for(const _0xdeebb6 of _0x57705f){_0x5798ca=_0x5798ca['replace'](new RegExp('^('+_0xdeebb6+')','m'),(_0x364db3,_0x25023c,_0x3c676b)=>{if(_0x3c676b===0x0||_0x5798ca[_0x3c676b-0x1]==='\x0a'&&_0x5798ca[_0x3c676b-0x2]==='\x0a')return _0x25023c;return'\x0a'+_0x25023c;});}return _0x5798ca;}export function parseSegmentYamlFile(_0x3d3950){const _0x7a50aa=a92_0x4a9a23,_0x25300d=a92_0x11a49f[_0x7a50aa(0x207)](_0x3d3950);if(!_0x25300d[_0x7a50aa(0x236)])throw new Error('YAML\x20config\x20missing\x20required\x20field:\x20name');return _0x25300d;}export function normalizeChildSegmentYaml(_0x5168bd){const _0x3afc40=a92_0x4a9a23;return{'type':'segment','name':_0x5168bd[_0x3afc40(0x236)],..._0x5168bd[_0x3afc40(0x267)]!==undefined&&{'description':_0x5168bd[_0x3afc40(0x267)]},..._0x5168bd[_0x3afc40(0x20f)]!==undefined&&{'folder':_0x5168bd[_0x3afc40(0x20f)]},..._0x5168bd['rule']&&{'rule':normalizeRule(_0x5168bd[_0x3afc40(0x270)])},..._0x5168bd['kind']!==undefined&&{'kind':_0x5168bd[_0x3afc40(0x273)]},..._0x5168bd[_0x3afc40(0x1f2)]!==undefined&&{'visible':_0x5168bd['visible']},..._0x5168bd['activations']&&{'activations':_0x5168bd[_0x3afc40(0x1fb)][_0x3afc40(0x268)](normalizeActivation)}};}function a92_0x4feb(_0x24bba9,_0xc73305){_0x24bba9=_0x24bba9-0x1f1;const _0x29a666=a92_0x29a6();let _0x4feb84=_0x29a666[_0x24bba9];return _0x4feb84;}export function normalizeRule(_0x43e0f5){const _0x367a9a=a92_0x4a9a23;return{'type':_0x43e0f5[_0x367a9a(0x20a)],'conditions':_0x43e0f5[_0x367a9a(0x21b)]['map'](normalizeCondition),..._0x43e0f5[_0x367a9a(0x267)]!==undefined&&{'description':_0x43e0f5[_0x367a9a(0x267)]}};}function normalizeCondition(_0x121738){const _0x202823=a92_0x4a9a23;if(_0x202823(0x252)in _0x121738&&(_0x121738['type']==='include'||_0x121738[_0x202823(0x20a)]==='exclude')){const _0x2b32b1=_0x121738;return{'type':_0x2b32b1[_0x202823(0x20a)],'segment':_0x2b32b1['segment']};}if(_0x202823(0x20a)in _0x121738&&(_0x121738['type']===_0x202823(0x279)||_0x121738[_0x202823(0x20a)]==='Or')){const _0x3ca4da=_0x121738;return{'type':_0x3ca4da[_0x202823(0x20a)],'conditions':_0x3ca4da['conditions'][_0x202823(0x268)](normalizeCondition),..._0x3ca4da[_0x202823(0x267)]!==undefined&&{'description':_0x3ca4da['description']}};}const _0x3febcd=_0x121738;return{'type':_0x202823(0x26f),'attribute':_0x3febcd[_0x202823(0x1f1)],'operator':normalizeOperator(_0x3febcd['operator']),..._0x3febcd[_0x202823(0x266)]!==undefined&&{'arrayMatching':_0x3febcd[_0x202823(0x266)]},..._0x3febcd[_0x202823(0x27f)]!==undefined&&{'exclude':_0x3febcd[_0x202823(0x27f)]},..._0x3febcd['aggregation']!==undefined&&{'aggregation':_0x3febcd[_0x202823(0x272)]},..._0x3febcd[_0x202823(0x25f)]!==undefined&&{'source':_0x3febcd[_0x202823(0x25f)]},..._0x3febcd[_0x202823(0x24d)]!==undefined&&{'filter':normalizeRule(_0x3febcd[_0x202823(0x24d)])},..._0x3febcd[_0x202823(0x1fd)]!==undefined&&{'limit':_0x3febcd[_0x202823(0x1fd)]}};}function normalizeOperator(_0x22040e){const _0x5df0d1=a92_0x4a9a23,_0x40e781=getEffectiveValue(_0x22040e);return{'type':_0x22040e[_0x5df0d1(0x20a)],..._0x22040e[_0x5df0d1(0x206)]!==undefined&&{'not':_0x22040e[_0x5df0d1(0x206)]},..._0x40e781!==undefined&&{'value':_0x40e781},..._0x22040e[_0x5df0d1(0x264)]!==undefined&&{'min':_0x22040e['min']},..._0x22040e[_0x5df0d1(0x22d)]!==undefined&&{'max':_0x22040e[_0x5df0d1(0x22d)]},..._0x22040e[_0x5df0d1(0x1f8)]!==undefined&&{'unit':_0x22040e[_0x5df0d1(0x1f8)]},..._0x22040e[_0x5df0d1(0x23d)]!==undefined&&{'duration':_0x22040e[_0x5df0d1(0x23d)]},..._0x22040e[_0x5df0d1(0x27c)]!==undefined&&{'from':_0x22040e[_0x5df0d1(0x27c)]}};}function normalizeActivation(_0x53a19a){const _0x4f539e=a92_0x4a9a23;return{'name':_0x53a19a[_0x4f539e(0x236)],'connection':_0x53a19a[_0x4f539e(0x208)],..._0x53a19a['description']!==undefined&&{'description':_0x53a19a[_0x4f539e(0x267)]},..._0x53a19a[_0x4f539e(0x213)]!==undefined&&{'all_columns':_0x53a19a['all_columns']},..._0x53a19a[_0x4f539e(0x1f5)]!==undefined&&{'columns':_0x53a19a[_0x4f539e(0x1f5)]},..._0x53a19a['behavior']!==undefined&&{'behavior':_0x53a19a[_0x4f539e(0x276)]},..._0x53a19a[_0x4f539e(0x242)]!==undefined&&{'schedule':_0x53a19a[_0x4f539e(0x242)]},..._0x53a19a[_0x4f539e(0x21c)]!==undefined&&{'notification':_0x53a19a['notification']},..._0x53a19a[_0x4f539e(0x215)]!==undefined&&{'connector_config':_0x53a19a[_0x4f539e(0x215)]},..._0x53a19a[_0x4f539e(0x257)]!==undefined&&{'activation_template_id':_0x53a19a[_0x4f539e(0x257)]}};}export function activationResponseToDef(_0xbc567c,_0x38c542,_0x2faeb5){const _0xbba5c4=a92_0x4a9a23,_0x513e9c=_0xbc567c[_0xbba5c4(0x23e)]||'',_0x81f53f=_0x2faeb5?.[_0xbba5c4(0x278)](_0x513e9c)??_0x513e9c,_0x3e551d={'name':_0xbc567c[_0xbba5c4(0x236)],'connection':_0x81f53f};_0xbc567c[_0xbba5c4(0x267)]&&(_0x3e551d[_0xbba5c4(0x267)]=_0xbc567c[_0xbba5c4(0x267)]);let _0x350e71=[];_0xbc567c['columns']&&_0xbc567c[_0xbba5c4(0x1f5)][_0xbba5c4(0x232)]>0x0&&(_0x350e71=_0xbc567c[_0xbba5c4(0x1f5)][_0xbba5c4(0x24d)](_0x5256ab=>_0x5256ab&&_0x5256ab[_0xbba5c4(0x236)])[_0xbba5c4(0x268)](_0xa9dbcf=>{const _0xc5417b=_0xbba5c4;if(_0xa9dbcf['type']||_0xa9dbcf['visibility'])return{'name':_0xa9dbcf[_0xc5417b(0x236)],..._0xa9dbcf[_0xc5417b(0x20a)]&&{'type':_0xa9dbcf[_0xc5417b(0x20a)]},..._0xa9dbcf[_0xc5417b(0x214)]&&{'visibility':_0xa9dbcf[_0xc5417b(0x214)]}};return _0xa9dbcf[_0xc5417b(0x236)];}));_0x350e71[_0xbba5c4(0x232)]>0x0&&(_0x3e551d[_0xbba5c4(0x1f5)]=_0x350e71);_0xbc567c['allColumns']!==undefined&&(_0xbc567c['allColumns']===![]&&_0x350e71[_0xbba5c4(0x232)]===0x0?_0x3e551d[_0xbba5c4(0x213)]=!![]:_0x3e551d[_0xbba5c4(0x213)]=_0xbc567c['allColumns']);const _0x49215f={};let _0x1df3b3=![];_0xbc567c[_0xbba5c4(0x24b)]&&(_0x49215f[_0xbba5c4(0x20a)]=_0xbc567c[_0xbba5c4(0x24b)],_0x1df3b3=!![]);_0xbc567c[_0xbba5c4(0x20b)]&&(_0x49215f[_0xbba5c4(0x27d)]=_0xbc567c['repeatUnit'],_0x1df3b3=!![]);_0xbc567c[_0xbba5c4(0x248)]!==undefined&&_0xbc567c[_0xbba5c4(0x248)]!==null&&(_0x49215f[_0xbba5c4(0x253)]=_0xbc567c[_0xbba5c4(0x248)],_0x1df3b3=!![]);_0xbc567c[_0xbba5c4(0x259)]&&_0xbc567c['repeatSubFrequency']['length']>0x0&&(_0x49215f[_0xbba5c4(0x1f4)]=_0xbc567c[_0xbba5c4(0x259)],_0x1df3b3=!![]);_0xbc567c[_0xbba5c4(0x25e)]!==undefined&&(_0x49215f[_0xbba5c4(0x237)]=_0xbc567c[_0xbba5c4(0x25e)],_0x1df3b3=!![]);_0xbc567c[_0xbba5c4(0x23a)]!==undefined&&(_0x49215f['end_on']=_0xbc567c[_0xbba5c4(0x23a)],_0x1df3b3=!![]);_0xbc567c[_0xbba5c4(0x27b)]&&(_0x49215f['timezone']=_0xbc567c[_0xbba5c4(0x27b)],_0x1df3b3=!![]);_0x1df3b3&&(_0x3e551d['schedule']=_0x49215f);(_0xbc567c[_0xbba5c4(0x263)]&&_0xbc567c[_0xbba5c4(0x263)][_0xbba5c4(0x232)]>0x0||_0xbc567c[_0xbba5c4(0x22b)]&&_0xbc567c[_0xbba5c4(0x22b)]['length']>0x0)&&(_0x3e551d['notification']={},_0xbc567c[_0xbba5c4(0x263)]&&_0xbc567c[_0xbba5c4(0x263)]['length']>0x0&&(_0x3e551d['notification'][_0xbba5c4(0x24a)]=_0xbc567c[_0xbba5c4(0x263)]),_0xbc567c[_0xbba5c4(0x22b)]&&_0xbc567c[_0xbba5c4(0x22b)][_0xbba5c4(0x232)]>0x0&&(_0x3e551d['notification'][_0xbba5c4(0x261)]=_0xbc567c[_0xbba5c4(0x22b)][_0xbba5c4(0x268)](_0x27c870=>{const _0xd9b849=_0xbba5c4,_0x3b9f3b=_0x38c542?.[_0xd9b849(0x278)](_0x27c870);return _0x3b9f3b??String(_0x27c870);})));_0xbc567c[_0xbba5c4(0x22a)]&&Object[_0xbba5c4(0x277)](_0xbc567c[_0xbba5c4(0x22a)])[_0xbba5c4(0x232)]>0x0&&(_0x3e551d['connector_config']=normalizeConnectorConfigForYaml(_0xbc567c[_0xbba5c4(0x22a)]));_0xbc567c[_0xbba5c4(0x220)]&&(_0x3e551d['activation_template_id']=_0xbc567c['activationTemplateId']);if(_0xbc567c[_0xbba5c4(0x258)]){const _0x31af85={},_0x458caa=_0xbc567c[_0xbba5c4(0x258)];_0x458caa[_0xbba5c4(0x1f5)]&&_0x458caa[_0xbba5c4(0x1f5)][_0xbba5c4(0x232)]>0x0&&(_0x31af85[_0xbba5c4(0x1f5)]=_0x458caa[_0xbba5c4(0x1f5)]['filter'](_0x2fc2de=>_0x2fc2de&&_0x2fc2de[_0xbba5c4(0x236)])[_0xbba5c4(0x268)](_0x164b94=>({'name':_0x164b94[_0xbba5c4(0x236)],..._0x164b94[_0xbba5c4(0x20a)]&&{'type':_0x164b94[_0xbba5c4(0x20a)]},..._0x164b94[_0xbba5c4(0x214)]&&{'visibility':_0x164b94[_0xbba5c4(0x214)]}}))),_0x458caa[_0xbba5c4(0x231)]&&(_0x31af85['behavior_table']=_0x458caa[_0xbba5c4(0x231)]),_0x458caa[_0xbba5c4(0x256)]!==undefined&&(_0x31af85[_0xbba5c4(0x230)]=_0x458caa[_0xbba5c4(0x256)]),_0x458caa[_0xbba5c4(0x210)]&&(_0x31af85['join_strategy']=_0x458caa[_0xbba5c4(0x210)]),_0x458caa[_0xbba5c4(0x26b)]&&(_0x31af85['formatting']=_0x458caa[_0xbba5c4(0x26b)]),_0x458caa[_0xbba5c4(0x201)]&&_0x458caa[_0xbba5c4(0x201)][_0xbba5c4(0x232)]>0x0&&(_0x31af85['order_by']=_0x458caa['orderBy']),Object['keys'](_0x31af85)[_0xbba5c4(0x232)]>0x0&&(_0x3e551d[_0xbba5c4(0x276)]=_0x31af85);}return _0x3e551d;}export function journeyActivationStepToYaml(_0x4ca5d5,_0x46123a,_0x457398){const _0x40cfac=a92_0x4a9a23,_0x4dcae8=_0x4ca5d5[_0x40cfac(0x1fe)]['activationParams'],_0x3ba4db=_0x4dcae8[_0x40cfac(0x23e)]||'',_0x2a5fb1=_0x457398?.[_0x40cfac(0x278)](_0x3ba4db)??_0x3ba4db,_0x15c1b8={'name':_0x4dcae8['name']||'','connection':_0x2a5fb1};_0x4dcae8['description']&&(_0x15c1b8[_0x40cfac(0x267)]=_0x4dcae8[_0x40cfac(0x267)]);let _0x41f0c7=[];_0x4dcae8[_0x40cfac(0x1f5)]&&_0x4dcae8[_0x40cfac(0x1f5)][_0x40cfac(0x232)]>0x0&&(_0x41f0c7=_0x4dcae8[_0x40cfac(0x1f5)]['filter'](_0x3e52da=>_0x3e52da&&_0x3e52da[_0x40cfac(0x236)])[_0x40cfac(0x268)](_0x504f1e=>{const _0x577c51=_0x40cfac;if(_0x504f1e[_0x577c51(0x20a)]||_0x504f1e['visibility'])return{'name':_0x504f1e[_0x577c51(0x236)],..._0x504f1e[_0x577c51(0x20a)]&&{'type':_0x504f1e[_0x577c51(0x20a)]},..._0x504f1e[_0x577c51(0x214)]&&{'visibility':_0x504f1e['visibility']}};return _0x504f1e[_0x577c51(0x236)];}));_0x41f0c7[_0x40cfac(0x232)]>0x0&&(_0x15c1b8[_0x40cfac(0x1f5)]=_0x41f0c7);_0x4dcae8[_0x40cfac(0x21a)]!==undefined&&(_0x4dcae8['allColumns']===![]&&_0x41f0c7[_0x40cfac(0x232)]===0x0?_0x15c1b8['all_columns']=!![]:_0x15c1b8[_0x40cfac(0x213)]=_0x4dcae8[_0x40cfac(0x21a)]);const _0x5e1389={};let _0x133a09=![];_0x4dcae8['scheduleType']&&(_0x5e1389[_0x40cfac(0x20a)]=_0x4dcae8['scheduleType'],_0x133a09=!![]);_0x4dcae8[_0x40cfac(0x20b)]&&(_0x5e1389[_0x40cfac(0x27d)]=_0x4dcae8['repeatUnit'],_0x133a09=!![]);_0x4dcae8['repeatFrequency']!==undefined&&_0x4dcae8[_0x40cfac(0x248)]!==null&&(_0x5e1389['repeat_frequency']=_0x4dcae8[_0x40cfac(0x248)],_0x133a09=!![]);_0x4dcae8[_0x40cfac(0x25e)]!==undefined&&(_0x5e1389[_0x40cfac(0x237)]=_0x4dcae8[_0x40cfac(0x25e)],_0x133a09=!![]);_0x4dcae8[_0x40cfac(0x23a)]!==undefined&&(_0x5e1389[_0x40cfac(0x227)]=_0x4dcae8[_0x40cfac(0x23a)],_0x133a09=!![]);_0x4dcae8['timezone']&&(_0x5e1389['timezone']=_0x4dcae8[_0x40cfac(0x27b)],_0x133a09=!![]);_0x133a09&&(_0x15c1b8[_0x40cfac(0x242)]=_0x5e1389);(_0x4dcae8['notifyOn']&&_0x4dcae8['notifyOn'][_0x40cfac(0x232)]>0x0||_0x4dcae8[_0x40cfac(0x22b)]&&_0x4dcae8[_0x40cfac(0x22b)][_0x40cfac(0x232)]>0x0)&&(_0x15c1b8[_0x40cfac(0x21c)]={},_0x4dcae8[_0x40cfac(0x263)]&&_0x4dcae8['notifyOn']['length']>0x0&&(_0x15c1b8['notification']['notify_on']=_0x4dcae8[_0x40cfac(0x263)]),_0x4dcae8['emailRecipients']&&_0x4dcae8[_0x40cfac(0x22b)][_0x40cfac(0x232)]>0x0&&(_0x15c1b8[_0x40cfac(0x21c)]['email_recipients']=_0x4dcae8[_0x40cfac(0x22b)][_0x40cfac(0x268)](_0x1147c3=>{const _0x325431=_0x46123a?.['get'](_0x1147c3);return _0x325431??String(_0x1147c3);})));_0x4dcae8[_0x40cfac(0x22a)]&&Object[_0x40cfac(0x277)](_0x4dcae8['connectorConfig'])[_0x40cfac(0x232)]>0x0&&(_0x15c1b8[_0x40cfac(0x215)]=normalizeConnectorConfigForYaml(_0x4dcae8[_0x40cfac(0x22a)]));_0x4dcae8[_0x40cfac(0x220)]&&(_0x15c1b8['activation_template_id']=_0x4dcae8[_0x40cfac(0x220)]);if(_0x4dcae8[_0x40cfac(0x258)]){const _0x41c33a={},_0xfa455c=_0x4dcae8[_0x40cfac(0x258)];_0xfa455c['columns']&&_0xfa455c[_0x40cfac(0x1f5)][_0x40cfac(0x232)]>0x0&&(_0x41c33a['columns']=_0xfa455c[_0x40cfac(0x1f5)][_0x40cfac(0x24d)](_0x15ad66=>_0x15ad66&&_0x15ad66[_0x40cfac(0x236)])[_0x40cfac(0x268)](_0x2fdeda=>({'name':_0x2fdeda['name'],..._0x2fdeda[_0x40cfac(0x20a)]&&{'type':_0x2fdeda[_0x40cfac(0x20a)]},..._0x2fdeda[_0x40cfac(0x214)]&&{'visibility':_0x2fdeda[_0x40cfac(0x214)]}}))),_0xfa455c[_0x40cfac(0x231)]&&(_0x41c33a[_0x40cfac(0x1f6)]=_0xfa455c[_0x40cfac(0x231)]),_0xfa455c[_0x40cfac(0x256)]!==undefined&&(_0x41c33a['join_row']=_0xfa455c[_0x40cfac(0x256)]),_0xfa455c['joinStrategy']&&(_0x41c33a[_0x40cfac(0x249)]=_0xfa455c[_0x40cfac(0x210)]),_0xfa455c['formatting']&&(_0x41c33a['formatting']=_0xfa455c[_0x40cfac(0x26b)]),_0xfa455c[_0x40cfac(0x201)]&&_0xfa455c[_0x40cfac(0x201)][_0x40cfac(0x232)]>0x0&&(_0x41c33a[_0x40cfac(0x255)]=_0xfa455c[_0x40cfac(0x201)]),Object[_0x40cfac(0x277)](_0x41c33a)['length']>0x0&&(_0x15c1b8['behavior']=_0x41c33a);}return _0x15c1b8;}export function segmentWithActivationsToYaml(_0x467316,_0x2f5026,_0x4ab511,_0x12a811,_0x106de8){const _0x4a77cd=a92_0x4a9a23,_0x275f7b=segmentResponseToDefSync(_0x467316,_0x4ab511);return _0x2f5026[_0x4a77cd(0x232)]>0x0&&(_0x275f7b[_0x4a77cd(0x1fb)]=_0x2f5026['map'](_0xd4ad95=>activationResponseToDef(_0xd4ad95,_0x12a811,_0x106de8))),_0x275f7b;}function normalizeColumn(_0x1076ee){const _0x5ad61e=a92_0x4a9a23;if(typeof _0x1076ee===_0x5ad61e(0x212))return{'name':_0x1076ee};return{'name':_0x1076ee['name'],..._0x1076ee[_0x5ad61e(0x20a)]&&{'type':_0x1076ee[_0x5ad61e(0x20a)]},..._0x1076ee[_0x5ad61e(0x214)]&&{'visibility':_0x1076ee[_0x5ad61e(0x214)]}};}export async function activationDefToCreateRequest(_0xe71a60,_0x52aa6a){const _0xe09e97=a92_0x4a9a23,_0x1a41f7=_0x52aa6a?.[_0xe09e97(0x243)],_0x3480f6=_0x52aa6a?.[_0xe09e97(0x26e)],_0x24b03e=_0xe71a60[_0xe09e97(0x208)];let _0x264b49;const _0x5cc2a9=parseInt(_0x24b03e,0xa);if(!isNaN(_0x5cc2a9)&&String(_0x5cc2a9)===_0x24b03e)_0x264b49=_0x5cc2a9;else{const _0x1fdaf4=_0x3480f6?.[_0xe09e97(0x278)](_0x24b03e);if(_0x1fdaf4===undefined)throw new SDKError(ErrorCode[_0xe09e97(0x218)],'Unknown\x20connection:\x20'+_0x24b03e,undefined,{'helpText':'Use\x20\x27tdx\x20connections\x27\x20to\x20list\x20available\x20connections'});_0x264b49=_0x1fdaf4;}const _0x4c9fff={'name':_0xe71a60[_0xe09e97(0x236)],'connectionId':_0x264b49};_0xe71a60[_0xe09e97(0x267)]&&(_0x4c9fff['description']=_0xe71a60['description']);let _0x1e592e=[];_0xe71a60[_0xe09e97(0x1f5)]&&_0xe71a60[_0xe09e97(0x1f5)][_0xe09e97(0x232)]>0x0&&(_0x1e592e=_0xe71a60[_0xe09e97(0x1f5)][_0xe09e97(0x24d)](_0x6f1017=>_0x6f1017!=null)['map'](normalizeColumn));_0x1e592e[_0xe09e97(0x232)]>0x0&&(_0x4c9fff[_0xe09e97(0x1f5)]=_0x1e592e);_0xe71a60['all_columns']!==undefined&&(_0xe71a60[_0xe09e97(0x213)]===![]&&_0x1e592e['length']===0x0?_0x4c9fff[_0xe09e97(0x21a)]=!![]:_0x4c9fff['allColumns']=_0xe71a60[_0xe09e97(0x213)]);if(_0xe71a60[_0xe09e97(0x242)]){const _0x4618eb=_0xe71a60[_0xe09e97(0x242)];_0x4618eb[_0xe09e97(0x20a)]&&(_0x4c9fff[_0xe09e97(0x24b)]=_0x4618eb[_0xe09e97(0x20a)]),_0x4618eb[_0xe09e97(0x27d)]&&(_0x4c9fff[_0xe09e97(0x20b)]=_0x4618eb[_0xe09e97(0x27d)]),_0x4618eb[_0xe09e97(0x253)]!==undefined&&(_0x4c9fff[_0xe09e97(0x248)]=_0x4618eb['repeat_frequency']),_0x4618eb['repeat_sub_frequency']&&(_0x4c9fff[_0xe09e97(0x259)]=_0x4618eb[_0xe09e97(0x1f4)]),_0x4618eb[_0xe09e97(0x237)]!==undefined&&(_0x4c9fff['startAt']=_0x4618eb[_0xe09e97(0x237)]),_0x4618eb[_0xe09e97(0x227)]!==undefined&&(_0x4c9fff[_0xe09e97(0x23a)]=_0x4618eb[_0xe09e97(0x227)]),_0x4618eb[_0xe09e97(0x27b)]&&(_0x4c9fff[_0xe09e97(0x27b)]=_0x4618eb[_0xe09e97(0x27b)]);}_0xe71a60[_0xe09e97(0x21c)]&&(_0xe71a60['notification'][_0xe09e97(0x24a)]&&(_0x4c9fff['notifyOn']=_0xe71a60[_0xe09e97(0x21c)]['notify_on']),_0xe71a60[_0xe09e97(0x21c)]['email_recipients']&&(_0x4c9fff[_0xe09e97(0x22b)]=_0xe71a60[_0xe09e97(0x21c)][_0xe09e97(0x261)][_0xe09e97(0x268)](_0x5d709a=>{const _0x59dc11=_0xe09e97,_0x1e669e=Number(_0x5d709a);if(!isNaN(_0x1e669e)&&String(_0x1e669e)===_0x5d709a)return _0x1e669e;const _0x24ff50=_0x1a41f7?.[_0x59dc11(0x278)](_0x5d709a['toLowerCase']());if(_0x24ff50===undefined)throw new SDKError(ErrorCode[_0x59dc11(0x250)],'Unknown\x20email\x20recipient:\x20'+_0x5d709a+'.\x20Use\x20\x27tdx\x20user\x20list\x27\x20to\x20see\x20valid\x20emails.');return _0x24ff50;})));if(_0xe71a60['connector_config']){const _0xcf2440=_0x52aa6a?.[_0xe09e97(0x205)]?.[_0xe09e97(0x278)](_0x24b03e);if(_0xcf2440&&_0x52aa6a?.[_0xe09e97(0x262)])try{const _0x56116e=await _0x52aa6a[_0xe09e97(0x262)](_0xcf2440),_0x344911=validateConnectorConfig(_0xe71a60['connector_config'],_0x56116e);if(!_0x344911[_0xe09e97(0x27e)])throw new SDKError(ErrorCode[_0xe09e97(0x271)],'Invalid\x20connector_config\x20for\x20activation\x20\x22'+_0xe71a60[_0xe09e97(0x236)]+_0xe09e97(0x282)+formatValidationErrors(_0x344911['errors']),undefined,{'helpText':'Connector:\x20'+_0xcf2440+_0xe09e97(0x20c)+formatSchemaAsHelp(_0x56116e)});if(_0x344911['warnings'][_0xe09e97(0x232)]>0x0){const _0x4ec07=formatValidationWarnings(_0x344911[_0xe09e97(0x202)]);console[_0xe09e97(0x245)](_0xe09e97(0x1f9)+_0xe71a60[_0xe09e97(0x236)]+'\x22:\x0a'+_0x4ec07);}_0x4c9fff[_0xe09e97(0x22a)]=transformConfigToLegacy(_0xe71a60['connector_config'],_0x56116e);}catch(_0x46f04c){if(_0x46f04c instanceof SDKError&&_0x46f04c[_0xe09e97(0x209)]===ErrorCode['CONNECTOR_SCHEMA_NOT_FOUND'])_0x4c9fff['connectorConfig']=_0xe71a60[_0xe09e97(0x215)];else throw _0x46f04c;}else _0x4c9fff[_0xe09e97(0x22a)]=_0xe71a60[_0xe09e97(0x215)];}_0xe71a60[_0xe09e97(0x257)]!==undefined&&(_0x4c9fff[_0xe09e97(0x220)]=_0xe71a60[_0xe09e97(0x257)]);if(_0xe71a60['behavior']){const _0x42c630=_0xe71a60[_0xe09e97(0x276)],_0x2cd964={};if(_0x42c630[_0xe09e97(0x1f5)]&&_0x42c630[_0xe09e97(0x1f5)][_0xe09e97(0x232)]>0x0){const _0x205f20=_0x42c630[_0xe09e97(0x1f5)][_0xe09e97(0x24d)](_0x567ac7=>_0x567ac7&&_0x567ac7[_0xe09e97(0x236)]);_0x205f20[_0xe09e97(0x232)]>0x0&&(_0x2cd964[_0xe09e97(0x1f5)]=_0x205f20);}_0x42c630['behavior_table']&&(_0x2cd964[_0xe09e97(0x231)]=_0x42c630['behavior_table']),_0x42c630['join_row']!==undefined&&(_0x2cd964[_0xe09e97(0x256)]=_0x42c630[_0xe09e97(0x230)]),_0x42c630['join_strategy']&&(_0x2cd964[_0xe09e97(0x210)]=_0x42c630[_0xe09e97(0x249)]),_0x42c630[_0xe09e97(0x26b)]&&(_0x2cd964['formatting']=_0x42c630[_0xe09e97(0x26b)]),_0x42c630[_0xe09e97(0x255)]&&(_0x2cd964['orderBy']=_0x42c630[_0xe09e97(0x255)]),_0x4c9fff[_0xe09e97(0x258)]=_0x2cd964;}return _0x4c9fff;}export async function activationDefToUpdateRequest(_0x8d543a,_0x124dbb){return activationDefToCreateRequest(_0x8d543a,_0x124dbb);}export function deepSortObject(_0x4e3e3e){const _0x267f82=a92_0x4a9a23;if(_0x4e3e3e===null||typeof _0x4e3e3e!==_0x267f82(0x21d))return _0x4e3e3e;if(Array[_0x267f82(0x21e)](_0x4e3e3e))return _0x4e3e3e[_0x267f82(0x268)](deepSortObject)[_0x267f82(0x281)]((_0x1e944c,_0x21d159)=>JSON[_0x267f82(0x25b)](_0x1e944c)[_0x267f82(0x25a)](JSON['stringify'](_0x21d159)));const _0x821188={};for(const _0x2d7b29 of Object[_0x267f82(0x277)](_0x4e3e3e)['sort']()){_0x821188[_0x2d7b29]=deepSortObject(_0x4e3e3e[_0x2d7b29]);}return _0x821188;}export function serializeRule(_0x303ac6){const _0x2db274=a92_0x4a9a23;return JSON[_0x2db274(0x25b)](deepSortObject(_0x303ac6));}export function normalizeRuleForMatching(_0x554867){return normalizeConditionsForMatching(_0x554867);}function normalizeConditionsForMatching(_0x21f4f4){const _0x9c085f=a92_0x4a9a23;if(_0x21f4f4===null||typeof _0x21f4f4!=='object')return _0x21f4f4;if(Array[_0x9c085f(0x21e)](_0x21f4f4))return _0x21f4f4[_0x9c085f(0x268)](normalizeConditionsForMatching);const _0x18e940=_0x21f4f4;if((_0x18e940[_0x9c085f(0x20a)]===_0x9c085f(0x244)||_0x18e940[_0x9c085f(0x20a)]===_0x9c085f(0x27f))&&typeof _0x18e940[_0x9c085f(0x252)]===_0x9c085f(0x212))return{..._0x18e940,'segment':_0x9c085f(0x265)};const _0x16555b={};for(const _0x3d49f7 of Object['keys'](_0x18e940)){_0x16555b[_0x3d49f7]=normalizeConditionsForMatching(_0x18e940[_0x3d49f7]);}return _0x16555b;}export function serializeRuleForMatching(_0x127060){const _0x34ecbf=a92_0x4a9a23;return JSON[_0x34ecbf(0x25b)](deepSortObject(normalizeRuleForMatching(_0x127060)));}export function expandSegmentReferences(_0x59dd2a,_0x436efa,_0x1c7151=new Set()){return expandConditions(_0x59dd2a,_0x436efa,_0x1c7151);}function expandConditions(_0x28cc27,_0x3a790c,_0x2cd796){const _0x34cf43=a92_0x4a9a23;if(_0x28cc27===null||typeof _0x28cc27!==_0x34cf43(0x21d))return _0x28cc27;if(Array[_0x34cf43(0x21e)](_0x28cc27))return _0x28cc27[_0x34cf43(0x268)](_0x13cd5c=>expandConditions(_0x13cd5c,_0x3a790c,_0x2cd796));const _0x51eae3=_0x28cc27;if((_0x51eae3[_0x34cf43(0x20a)]==='include'||_0x51eae3['type']==='exclude')&&typeof _0x51eae3[_0x34cf43(0x252)]===_0x34cf43(0x212)){const _0x44b818=_0x51eae3['segment'],_0x5c5fe6=_0x3a790c[_0x34cf43(0x278)](_0x44b818);if(_0x5c5fe6&&!_0x2cd796[_0x34cf43(0x226)](_0x44b818)){const _0x29ba84=new Set(_0x2cd796);_0x29ba84[_0x34cf43(0x235)](_0x44b818);const _0x4f5212=expandConditions(_0x5c5fe6,_0x3a790c,_0x29ba84);return{'type':_0x51eae3[_0x34cf43(0x20a)],'expanded_rule':_0x4f5212};}return{'type':_0x51eae3['type'],'expanded_rule':_0x34cf43(0x204)};}const _0xde1a55={};for(const _0x331f49 of Object[_0x34cf43(0x277)](_0x51eae3)){_0xde1a55[_0x331f49]=expandConditions(_0x51eae3[_0x331f49],_0x3a790c,_0x2cd796);}return _0xde1a55;}export function serializeExpandedRule(_0x423e41,_0x231561){const _0x3bc464=a92_0x4a9a23,_0x13135b=expandSegmentReferences(_0x423e41,_0x231561);return JSON[_0x3bc464(0x25b)](deepSortObject(_0x13135b));}export function createSegmentNameContext(_0x19412a){const _0x204e75=a92_0x4a9a23,_0x55215e=new Set(),_0x397709=new Map(),_0x4caf61=new Map();if(_0x19412a)for(const [_0x5c177c,_0x5ace26]of Object[_0x204e75(0x26a)](_0x19412a)){if(_0x5ace26[_0x204e75(0x270)]){const _0x51581e=serializeRule(_0x5ace26[_0x204e75(0x270)]);_0x4caf61['set'](_0x51581e,_0x5c177c),_0x55215e[_0x204e75(0x235)](_0x5c177c);}}return{'usedNames':_0x55215e,'ruleHashToName':_0x397709,'localRuleToName':_0x19412a?_0x4caf61:undefined};}export function resolveSegmentName(_0x22010,_0x425f29,_0x219d2a,_0x14a316){const _0x2d12e5=a92_0x4a9a23,_0x4d170c=serializeRule(_0x425f29);if(_0x219d2a['localRuleToName']){const _0x253773=_0x219d2a[_0x2d12e5(0x238)][_0x2d12e5(0x278)](_0x4d170c);if(_0x253773)return{'name':_0x253773,'isDuplicate':![],'isLocalMatch':!![]};}const _0xbcdcfd=_0x219d2a[_0x2d12e5(0x216)][_0x2d12e5(0x278)](_0x4d170c);if(_0xbcdcfd)return{'name':_0xbcdcfd,'isDuplicate':!![],'isLocalMatch':![]};const _0x4fe75e=_0x14a316(_0x22010);let _0x487ae6=_0x4fe75e||_0x22010,_0x47bd28=_0x487ae6,_0x17f5ed=0x2;while(_0x219d2a[_0x2d12e5(0x1ff)]['has'](_0x47bd28)){_0x47bd28=_0x487ae6+'_'+_0x17f5ed,_0x17f5ed++;}return _0x219d2a[_0x2d12e5(0x1ff)][_0x2d12e5(0x235)](_0x47bd28),_0x219d2a[_0x2d12e5(0x216)]['set'](_0x4d170c,_0x47bd28),{'name':_0x47bd28,'isDuplicate':![],'isLocalMatch':![]};}export function collectSegmentRefsFromRule(_0x6c05d5){const _0x3f0984=[],_0x393770=_0x4b3676=>{const _0x4d1cab=a92_0x4feb;if(!_0x4b3676||typeof _0x4b3676!=='object')return;if(Array[_0x4d1cab(0x21e)](_0x4b3676)){_0x4b3676[_0x4d1cab(0x240)](_0x393770);return;}const _0x2e7eac=_0x4b3676;(_0x2e7eac['type']===_0x4d1cab(0x244)||_0x2e7eac['type']===_0x4d1cab(0x27f))&&typeof _0x2e7eac['segment']===_0x4d1cab(0x212)&&_0x3f0984[_0x4d1cab(0x247)](_0x2e7eac[_0x4d1cab(0x252)]);for(const _0x2d40a2 of Object[_0x4d1cab(0x225)](_0x2e7eac)){_0x393770(_0x2d40a2);}};return _0x393770(_0x6c05d5),_0x3f0984;}export function validateSegmentRule(_0x18847b,_0x5e4f5f){const _0x31fc49=a92_0x4a9a23;if(!_0x5e4f5f||!_0x5e4f5f[_0x31fc49(0x21b)])return;for(let _0x17cd2b=0x0;_0x17cd2b<_0x5e4f5f[_0x31fc49(0x21b)][_0x31fc49(0x232)];_0x17cd2b++){const _0x102fd0=_0x5e4f5f[_0x31fc49(0x21b)][_0x17cd2b];if(_0x31fc49(0x20a)in _0x102fd0&&_0x102fd0['type']===_0x31fc49(0x26f)){const _0x5f36d7=_0x102fd0;if(!_0x5f36d7[_0x31fc49(0x1f1)]||_0x5f36d7['attribute']==='')throw new SDKError(ErrorCode[_0x31fc49(0x219)],'Invalid\x20condition\x20in\x20embedded\x20segment\x20\x27'+_0x18847b+_0x31fc49(0x203)+(_0x31fc49(0x234)+_0x17cd2b+'].attribute\x20cannot\x20be\x20empty.\x0a')+_0x31fc49(0x246));}}}
@@ -1 +1 @@
1
- (function(_0x4f1225,_0x47ff6f){const _0x3ec515=a93_0x4235,_0x1f427c=_0x4f1225();while(!![]){try{const _0x514422=-parseInt(_0x3ec515(0x98))/0x1+parseInt(_0x3ec515(0x83))/0x2+parseInt(_0x3ec515(0x77))/0x3+-parseInt(_0x3ec515(0x88))/0x4+-parseInt(_0x3ec515(0x93))/0x5+-parseInt(_0x3ec515(0x7b))/0x6+parseInt(_0x3ec515(0x90))/0x7*(parseInt(_0x3ec515(0x70))/0x8);if(_0x514422===_0x47ff6f)break;else _0x1f427c['push'](_0x1f427c['shift']());}catch(_0x967113){_0x1f427c['push'](_0x1f427c['shift']());}}}(a93_0x2210,0xa9bbd));import a93_0x164b28 from'chalk';import{withProgressSpinner}from'../../utils/spinner.js';export function buildSchemaResult(_0x3882bf){const _0x2c835b=a93_0x4235,_0x3d3d7c=_0x3882bf[_0x2c835b(0x87)][_0x2c835b(0x84)](_0x1e440d=>({'column_name':_0x1e440d['name'],'column_type':_0x1e440d[_0x2c835b(0x73)],'null':'YES','key':null,'default':null,'extra':null}));return{..._0x3882bf,'columns':[{'name':_0x2c835b(0x92),'type':_0x2c835b(0x99)},{'name':'column_type','type':_0x2c835b(0x99)},{'name':_0x2c835b(0x8a),'type':_0x2c835b(0x99)},{'name':_0x2c835b(0x6e),'type':_0x2c835b(0x99)},{'name':'default','type':_0x2c835b(0x99)},{'name':_0x2c835b(0x80),'type':'varchar'}],'data':_0x3d3d7c};}export async function executeSchemaQuery(_0x4a1697,_0x59e339,_0x490569){const _0x5a1d05=a93_0x4235,_0xf6a1b2=_0x4a1697[_0x5a1d05(0x71)]()['replace'](/;+$/,''),_0x470bce='SELECT\x20*\x20FROM\x20(\x0a'+_0xf6a1b2+_0x5a1d05(0x86);_0x490569[_0x5a1d05(0x97)]&&console[_0x5a1d05(0x8e)]('Schema\x20query:\x0a'+_0x470bce);const _0x3d5e31=await withProgressSpinner('Fetching\x20schema...',async _0x5c5932=>{const _0x249d11=_0x5a1d05,_0x3684d=await _0x59e339[_0x249d11(0x6d)][_0x249d11(0x7a)](_0x470bce,{'catalog':'td','schema':_0x249d11(0x94),'onJobId':_0x4e3796=>{const _0x466671=_0x249d11;_0x5c5932[_0x466671(0x9b)](_0x4e3796);}});return _0x3684d;},{'verbose':_0x490569[_0x5a1d05(0x97)]});return buildSchemaResult(_0x3d5e31['data']);}export function displayFieldsHumanReadable(_0x25d3dc,_0x3cffa1){const _0x227b70=a93_0x4235,_0x28b4f9=_0x25d3dc[_0x227b70(0x9a)](_0xbe166c=>_0xbe166c[_0x227b70(0x7e)]===_0x227b70(0x8c)),_0x32b33d=_0x25d3dc[_0x227b70(0x9a)](_0x2c26d1=>_0x2c26d1['source']===_0x227b70(0x89)),_0x1ff6fe=new Map();for(const _0x538ccf of _0x28b4f9){const _0x7bd822=_0x538ccf[_0x227b70(0x91)]||_0x538ccf[_0x227b70(0x7d)]||_0x227b70(0x76),_0x1df03d=_0x1ff6fe[_0x227b70(0x9c)](_0x7bd822);_0x1df03d?_0x1df03d[_0x227b70(0x8b)]['push'](_0x538ccf):_0x1ff6fe[_0x227b70(0x75)](_0x7bd822,{'displayName':_0x7bd822,'tableName':_0x538ccf[_0x227b70(0x7d)],'fields':[_0x538ccf]});}const _0x2de9a4=new Map();for(const _0x104452 of _0x32b33d){const _0x379c13=_0x104452[_0x227b70(0x95)]||'Unknown',_0x4ea2ad=_0x2de9a4['get'](_0x379c13)||[];_0x4ea2ad['push'](_0x104452),_0x2de9a4[_0x227b70(0x75)](_0x379c13,_0x4ea2ad);}console['error']('\x0a'+a93_0x164b28[_0x227b70(0x72)](_0x3cffa1));if(_0x1ff6fe['size']>0x0){console[_0x227b70(0x8e)]('\x0a'+a93_0x164b28[_0x227b70(0x79)](_0x227b70(0x6c)));const _0x487c9f=[..._0x1ff6fe[_0x227b70(0x6f)]()]['sort']((_0x1578a9,_0x67b8fd)=>_0x1578a9[0x0][_0x227b70(0x8d)](_0x67b8fd[0x0]));for(const [,_0x94a9e]of _0x487c9f){const _0x5f4a94=_0x94a9e[_0x227b70(0x74)]&&_0x94a9e[_0x227b70(0x74)]!==_0x94a9e['displayName']?'\x20'+a93_0x164b28[_0x227b70(0x79)]('('+_0x94a9e[_0x227b70(0x74)]+')'):'';console['error']('\x20\x20'+a93_0x164b28['bold'](_0x94a9e[_0x227b70(0x7f)])+_0x5f4a94);const _0x39076e=[..._0x94a9e[_0x227b70(0x8b)]]['sort']((_0x222c45,_0x222a86)=>_0x222c45[_0x227b70(0x85)][_0x227b70(0x8d)](_0x222a86[_0x227b70(0x85)]));for(const _0x2d6798 of _0x39076e){const _0x4c1602=_0x2d6798['parentColumn']&&_0x2d6798['parentColumn']!==_0x2d6798['name']?'\x20'+a93_0x164b28['dim']('('+_0x2d6798[_0x227b70(0x78)]+')'):'';console[_0x227b70(0x8e)](_0x227b70(0x8f)+_0x2d6798[_0x227b70(0x85)]+_0x4c1602+':\x20'+a93_0x164b28[_0x227b70(0x81)](_0x2d6798[_0x227b70(0x73)]));}}}if(_0x2de9a4['size']>0x0){console[_0x227b70(0x8e)]('\x0a'+a93_0x164b28['dim'](_0x227b70(0x82)));const _0x4a162d=[..._0x2de9a4[_0x227b70(0x6f)]()]['sort']((_0x1f429b,_0x3e1ce8)=>_0x1f429b[0x0][_0x227b70(0x8d)](_0x3e1ce8[0x0]));for(const [_0x372ad4,_0x4346f0]of _0x4a162d){const _0x755121=_0x4346f0[0x0],_0x142bb1=_0x755121?.[_0x227b70(0x7d)]||'';console[_0x227b70(0x8e)]('\x20\x20'+a93_0x164b28[_0x227b70(0x72)](_0x372ad4)+(_0x142bb1?'\x20'+a93_0x164b28[_0x227b70(0x79)]('('+_0x142bb1+')'):''));const _0x3e4ffb=[..._0x4346f0][_0x227b70(0x96)]((_0x1c553d,_0x2b720d)=>_0x1c553d['name']['localeCompare'](_0x2b720d[_0x227b70(0x85)]));for(const _0x400993 of _0x3e4ffb){const _0x52c4ef=_0x400993[_0x227b70(0x85)]['startsWith'](_0x372ad4+'.')?_0x400993[_0x227b70(0x85)][_0x227b70(0x7c)](_0x372ad4['length']+0x1):_0x400993[_0x227b70(0x85)],_0x1fc852=_0x400993[_0x227b70(0x78)]&&_0x400993[_0x227b70(0x78)]!==_0x52c4ef?'\x20'+a93_0x164b28[_0x227b70(0x79)]('('+_0x400993[_0x227b70(0x78)]+')'):'';console[_0x227b70(0x8e)](_0x227b70(0x8f)+_0x52c4ef+_0x1fc852+':\x20'+a93_0x164b28['cyan'](_0x400993[_0x227b70(0x73)]));}}}console['error']('');}function a93_0x4235(_0x38636d,_0x2a1b7b){_0x38636d=_0x38636d-0x6c;const _0x22104e=a93_0x2210();let _0x4235f3=_0x22104e[_0x38636d];return _0x4235f3;}function a93_0x2210(){const _0xfca64d=['dim','execute','7514400oHgBAa','slice','parentTableName','source','displayName','extra','cyan','Behaviors','2223864DDrsiq','map','name','\x0a)\x20AS\x20segment_query\x20LIMIT\x200','columns','2847968HZgaUc','behavior','null','fields','attribute','localeCompare','error','\x20\x20\x20\x20','8596IZeBWL','groupingName','column_name','1889615IpeQjE','information_schema','behaviorName','sort','verbose','998844RDrspY','varchar','filter','setJobId','get','Attributes','query','key','entries','13672AnEwau','trim','bold','type','tableName','set','Unknown','2477412AbfOSz','parentColumn'];a93_0x2210=function(){return _0xfca64d;};return a93_0x2210();}
1
+ function a93_0x2427(_0x5ad88c,_0x48b44a){_0x5ad88c=_0x5ad88c-0x18f;const _0x1cdf3d=a93_0x1cdf();let _0x24278e=_0x1cdf3d[_0x5ad88c];return _0x24278e;}(function(_0x4151b8,_0x2d002d){const _0x1fe19b=a93_0x2427,_0x20f612=_0x4151b8();while(!![]){try{const _0x42eafa=parseInt(_0x1fe19b(0x1a7))/0x1+parseInt(_0x1fe19b(0x1b2))/0x2*(-parseInt(_0x1fe19b(0x18f))/0x3)+parseInt(_0x1fe19b(0x195))/0x4+parseInt(_0x1fe19b(0x1c2))/0x5*(-parseInt(_0x1fe19b(0x1b3))/0x6)+parseInt(_0x1fe19b(0x1ba))/0x7+parseInt(_0x1fe19b(0x1bc))/0x8*(parseInt(_0x1fe19b(0x199))/0x9)+parseInt(_0x1fe19b(0x197))/0xa*(-parseInt(_0x1fe19b(0x1aa))/0xb);if(_0x42eafa===_0x2d002d)break;else _0x20f612['push'](_0x20f612['shift']());}catch(_0x52662f){_0x20f612['push'](_0x20f612['shift']());}}}(a93_0x1cdf,0xb4afd));import a93_0x1d211c from'chalk';import{withProgressSpinner}from'../../utils/spinner.js';export function buildSchemaResult(_0x243a10){const _0x525598=a93_0x2427,_0x2a8565=_0x243a10['columns'][_0x525598(0x1b1)](_0x107875=>({'column_name':_0x107875['name'],'column_type':_0x107875['type'],'null':'YES','key':null,'default':null,'extra':null}));return{..._0x243a10,'columns':[{'name':_0x525598(0x1c1),'type':'varchar'},{'name':_0x525598(0x1ae),'type':_0x525598(0x1a4)},{'name':_0x525598(0x1c5),'type':_0x525598(0x1a4)},{'name':_0x525598(0x193),'type':'varchar'},{'name':_0x525598(0x1b9),'type':_0x525598(0x1a4)},{'name':'extra','type':_0x525598(0x1a4)}],'data':_0x2a8565};}function a93_0x1cdf(){const _0x3b3d4b=['setJobId','2744uSpCPy','tableName','groupingName','length','verbose','column_name','5tVKcqP','execute','bold','null','fields','591MOFaZa','data','startsWith','source','key','entries','3517636HYiXav','localeCompare','1397430aprNJE','parentColumn','20322QcRhXG','Attributes','trim','error','type','Unknown','SELECT\x20*\x20FROM\x20(\x0a','Fetching\x20schema...','set','size','name','varchar','behaviorName','get','562604OuZwGR','slice','parentTableName','143NWYpSL','\x20\x20\x20\x20','attribute','dim','column_type','Behaviors','cyan','map','7322FLorgK','2126286bbbQeq','filter','displayName','information_schema','\x0a)\x20AS\x20segment_query\x20LIMIT\x200','sort','default','9910901TCFUqN'];a93_0x1cdf=function(){return _0x3b3d4b;};return a93_0x1cdf();}export async function executeSchemaQuery(_0x2b682b,_0x4b1512,_0x286ab4){const _0x4cbb8d=a93_0x2427,_0x39ae57=_0x2b682b[_0x4cbb8d(0x19b)]()['replace'](/;+$/,''),_0x32410e=_0x4cbb8d(0x19f)+_0x39ae57+_0x4cbb8d(0x1b7);_0x286ab4[_0x4cbb8d(0x1c0)]&&console[_0x4cbb8d(0x19c)]('Schema\x20query:\x0a'+_0x32410e);const _0x2d7bd6=await withProgressSpinner(_0x4cbb8d(0x1a0),async _0x5f8ef7=>{const _0x1dcfdf=_0x4cbb8d,_0x145b73=await _0x4b1512['query'][_0x1dcfdf(0x1c3)](_0x32410e,{'catalog':'td','schema':_0x1dcfdf(0x1b6),'onJobId':_0x13ba52=>{const _0x3d6499=_0x1dcfdf;_0x5f8ef7[_0x3d6499(0x1bb)](_0x13ba52);}});return _0x145b73;},{'verbose':_0x286ab4['verbose']});return buildSchemaResult(_0x2d7bd6[_0x4cbb8d(0x190)]);}export function displayFieldsHumanReadable(_0x374f84,_0x30033b){const _0x35e7f6=a93_0x2427,_0x5a03dd=_0x374f84['filter'](_0x883b93=>_0x883b93[_0x35e7f6(0x192)]===_0x35e7f6(0x1ac)),_0x5a7fae=_0x374f84[_0x35e7f6(0x1b4)](_0x3a7d71=>_0x3a7d71[_0x35e7f6(0x192)]==='behavior'),_0xdd6c67=new Map();for(const _0x145d66 of _0x5a03dd){const _0x10e4a2=_0x145d66[_0x35e7f6(0x1be)]||_0x145d66['parentTableName']||_0x35e7f6(0x19e),_0x257274=_0xdd6c67['get'](_0x10e4a2);_0x257274?_0x257274[_0x35e7f6(0x1c6)]['push'](_0x145d66):_0xdd6c67[_0x35e7f6(0x1a1)](_0x10e4a2,{'displayName':_0x10e4a2,'tableName':_0x145d66['parentTableName'],'fields':[_0x145d66]});}const _0x4a0032=new Map();for(const _0x5387b8 of _0x5a7fae){const _0x4e56f0=_0x5387b8[_0x35e7f6(0x1a5)]||'Unknown',_0x225dae=_0x4a0032[_0x35e7f6(0x1a6)](_0x4e56f0)||[];_0x225dae['push'](_0x5387b8),_0x4a0032['set'](_0x4e56f0,_0x225dae);}console[_0x35e7f6(0x19c)]('\x0a'+a93_0x1d211c[_0x35e7f6(0x1c4)](_0x30033b));if(_0xdd6c67[_0x35e7f6(0x1a2)]>0x0){console['error']('\x0a'+a93_0x1d211c[_0x35e7f6(0x1ad)](_0x35e7f6(0x19a)));const _0xfb840a=[..._0xdd6c67[_0x35e7f6(0x194)]()][_0x35e7f6(0x1b8)]((_0x2c8793,_0x134717)=>_0x2c8793[0x0][_0x35e7f6(0x196)](_0x134717[0x0]));for(const [,_0x22158b]of _0xfb840a){const _0x56b077=_0x22158b[_0x35e7f6(0x1bd)]&&_0x22158b[_0x35e7f6(0x1bd)]!==_0x22158b[_0x35e7f6(0x1b5)]?'\x20'+a93_0x1d211c[_0x35e7f6(0x1ad)]('('+_0x22158b[_0x35e7f6(0x1bd)]+')'):'';console[_0x35e7f6(0x19c)]('\x20\x20'+a93_0x1d211c['bold'](_0x22158b['displayName'])+_0x56b077);const _0x424a27=[..._0x22158b[_0x35e7f6(0x1c6)]]['sort']((_0x419a30,_0x7971e6)=>_0x419a30[_0x35e7f6(0x1a3)][_0x35e7f6(0x196)](_0x7971e6['name']));for(const _0x2b293a of _0x424a27){const _0x4bac9b=_0x2b293a[_0x35e7f6(0x198)]&&_0x2b293a[_0x35e7f6(0x198)]!==_0x2b293a[_0x35e7f6(0x1a3)]?'\x20'+a93_0x1d211c[_0x35e7f6(0x1ad)]('('+_0x2b293a[_0x35e7f6(0x198)]+')'):'';console['error']('\x20\x20\x20\x20'+_0x2b293a[_0x35e7f6(0x1a3)]+_0x4bac9b+':\x20'+a93_0x1d211c[_0x35e7f6(0x1b0)](_0x2b293a[_0x35e7f6(0x19d)]));}}}if(_0x4a0032['size']>0x0){console[_0x35e7f6(0x19c)]('\x0a'+a93_0x1d211c[_0x35e7f6(0x1ad)](_0x35e7f6(0x1af)));const _0x419cc3=[..._0x4a0032[_0x35e7f6(0x194)]()]['sort']((_0x2a1eba,_0x488c99)=>_0x2a1eba[0x0][_0x35e7f6(0x196)](_0x488c99[0x0]));for(const [_0x17bc6d,_0x41324f]of _0x419cc3){const _0x12a935=_0x41324f[0x0],_0x513861=_0x12a935?.[_0x35e7f6(0x1a9)]||'';console[_0x35e7f6(0x19c)]('\x20\x20'+a93_0x1d211c[_0x35e7f6(0x1c4)](_0x17bc6d)+(_0x513861?'\x20'+a93_0x1d211c[_0x35e7f6(0x1ad)]('('+_0x513861+')'):''));const _0x317f64=[..._0x41324f]['sort']((_0x3017ee,_0x24457f)=>_0x3017ee[_0x35e7f6(0x1a3)]['localeCompare'](_0x24457f[_0x35e7f6(0x1a3)]));for(const _0x2d5b6a of _0x317f64){const _0x2dcfaa=_0x2d5b6a[_0x35e7f6(0x1a3)][_0x35e7f6(0x191)](_0x17bc6d+'.')?_0x2d5b6a[_0x35e7f6(0x1a3)][_0x35e7f6(0x1a8)](_0x17bc6d[_0x35e7f6(0x1bf)]+0x1):_0x2d5b6a[_0x35e7f6(0x1a3)],_0x1c859d=_0x2d5b6a['parentColumn']&&_0x2d5b6a['parentColumn']!==_0x2dcfaa?'\x20'+a93_0x1d211c[_0x35e7f6(0x1ad)]('('+_0x2d5b6a[_0x35e7f6(0x198)]+')'):'';console['error'](_0x35e7f6(0x1ab)+_0x2dcfaa+_0x1c859d+':\x20'+a93_0x1d211c[_0x35e7f6(0x1b0)](_0x2d5b6a['type']));}}}console[_0x35e7f6(0x19c)]('');}
@@ -1 +1 @@
1
- function a94_0x1e1a(_0x58dcf4,_0x30f088){_0x58dcf4=_0x58dcf4-0x1cd;const _0x2d9ada=a94_0x2d9a();let _0x1e1a4b=_0x2d9ada[_0x58dcf4];return _0x1e1a4b;}(function(_0x46f18b,_0x13d4de){const _0x3bba37=a94_0x1e1a,_0x245e29=_0x46f18b();while(!![]){try{const _0x35d85f=-parseInt(_0x3bba37(0x1d0))/0x1*(parseInt(_0x3bba37(0x1d6))/0x2)+-parseInt(_0x3bba37(0x1d3))/0x3+-parseInt(_0x3bba37(0x1de))/0x4*(parseInt(_0x3bba37(0x1d9))/0x5)+parseInt(_0x3bba37(0x1ce))/0x6+-parseInt(_0x3bba37(0x1d7))/0x7*(parseInt(_0x3bba37(0x1db))/0x8)+-parseInt(_0x3bba37(0x1da))/0x9+parseInt(_0x3bba37(0x1dd))/0xa;if(_0x35d85f===_0x13d4de)break;else _0x245e29['push'](_0x245e29['shift']());}catch(_0x466959){_0x245e29['push'](_0x245e29['shift']());}}}(a94_0x2d9a,0x9e9b3));import{readdirSync,statSync}from'fs';function a94_0x2d9a(){const _0x41b028=['2thaMkE','623721ZupOGq','endsWith','897325DuXCUn','5254011flRPol','56BnInlT','extname','31616540uGfhMt','20xYaqBA','.yaml','297864JsLMNd','isDirectory','132497swTJLN','.yml','map','972975pzqpnJ','name','isFile'];a94_0x2d9a=function(){return _0x41b028;};return a94_0x2d9a();}import a94_0x4fee4f from'path';export function findYamlFiles(_0x1e3ea6){const _0x2d1836=[];function _0x25f4ac(_0x51a6c2){const _0x21018e=a94_0x1e1a,_0x1fe1a8=readdirSync(_0x51a6c2,{'withFileTypes':!![]});for(const _0x1755f1 of _0x1fe1a8){const _0x3a8bfe=a94_0x4fee4f['join'](_0x51a6c2,_0x1755f1[_0x21018e(0x1d4)]);if(_0x1755f1[_0x21018e(0x1cf)]())_0x25f4ac(_0x3a8bfe);else(_0x1755f1['name'][_0x21018e(0x1d8)](_0x21018e(0x1d1))||_0x1755f1[_0x21018e(0x1d4)][_0x21018e(0x1d8)](_0x21018e(0x1cd)))&&_0x2d1836['push'](_0x3a8bfe);}}return _0x25f4ac(_0x1e3ea6),_0x2d1836;}export function discoverYamlFiles(_0xcb02b1){const _0x2ab3f5=a94_0x1e1a,_0x271726=findYamlFiles(_0xcb02b1);return _0x271726[_0x2ab3f5(0x1d2)](_0x13a687=>{const _0x3ef490=a94_0x4fee4f['relative'](_0xcb02b1,_0x13a687),_0x6c61c7=a94_0x4fee4f['dirname'](_0x3ef490);return{'absolutePath':_0x13a687,'relativePath':_0x3ef490,'folderPath':_0x6c61c7==='.'?'':_0x6c61c7};});}export function isYamlFile(_0xc5b742){const _0x4f0c31=a94_0x1e1a;try{const _0x591b71=statSync(_0xc5b742);if(!_0x591b71[_0x4f0c31(0x1d5)]())return![];const _0x3b8787=a94_0x4fee4f[_0x4f0c31(0x1dc)](_0xc5b742)['toLowerCase']();return _0x3b8787===_0x4f0c31(0x1d1)||_0x3b8787===_0x4f0c31(0x1cd);}catch{return![];}}
1
+ function a94_0x2831(_0x315a84,_0x1389d9){_0x315a84=_0x315a84-0xb4;const _0x4e72d3=a94_0x4e72();let _0x2831df=_0x4e72d3[_0x315a84];return _0x2831df;}(function(_0x502023,_0x5be2bb){const _0xe85514=a94_0x2831,_0x212806=_0x502023();while(!![]){try{const _0x24a50e=parseInt(_0xe85514(0xb9))/0x1*(parseInt(_0xe85514(0xb7))/0x2)+-parseInt(_0xe85514(0xbc))/0x3+-parseInt(_0xe85514(0xb4))/0x4+-parseInt(_0xe85514(0xb6))/0x5+-parseInt(_0xe85514(0xc0))/0x6+-parseInt(_0xe85514(0xbd))/0x7+parseInt(_0xe85514(0xc1))/0x8;if(_0x24a50e===_0x5be2bb)break;else _0x212806['push'](_0x212806['shift']());}catch(_0x46eb73){_0x212806['push'](_0x212806['shift']());}}}(a94_0x4e72,0xecfdc));import{readdirSync,statSync}from'fs';import a94_0x413fc8 from'path';function a94_0x4e72(){const _0x543b6c=['2666523SWJsUv','735434wLHeXV','.yaml','endsWith','3407232dTuGSv','40418640woOTsH','dirname','push','.yml','join','extname','5130328yPCdLR','isDirectory','7468845tuSnSc','16032AQfBhT','toLowerCase','32tsCxJB','name','relative'];a94_0x4e72=function(){return _0x543b6c;};return a94_0x4e72();}export function findYamlFiles(_0xb3528d){const _0xb2a05f=[];function _0x25ba85(_0x5081dc){const _0x3506f5=a94_0x2831,_0x11e24b=readdirSync(_0x5081dc,{'withFileTypes':!![]});for(const _0x32fbcf of _0x11e24b){const _0x918aaa=a94_0x413fc8[_0x3506f5(0xc5)](_0x5081dc,_0x32fbcf[_0x3506f5(0xba)]);if(_0x32fbcf[_0x3506f5(0xb5)]())_0x25ba85(_0x918aaa);else(_0x32fbcf[_0x3506f5(0xba)][_0x3506f5(0xbf)]('.yml')||_0x32fbcf[_0x3506f5(0xba)][_0x3506f5(0xbf)](_0x3506f5(0xbe)))&&_0xb2a05f[_0x3506f5(0xc3)](_0x918aaa);}}return _0x25ba85(_0xb3528d),_0xb2a05f;}export function discoverYamlFiles(_0x251618){const _0x436878=findYamlFiles(_0x251618);return _0x436878['map'](_0x32d461=>{const _0x2b0d0b=a94_0x2831,_0x348a49=a94_0x413fc8[_0x2b0d0b(0xbb)](_0x251618,_0x32d461),_0x4806bd=a94_0x413fc8[_0x2b0d0b(0xc2)](_0x348a49);return{'absolutePath':_0x32d461,'relativePath':_0x348a49,'folderPath':_0x4806bd==='.'?'':_0x4806bd};});}export function isYamlFile(_0x4684c7){const _0x231e89=a94_0x2831;try{const _0x3571fb=statSync(_0x4684c7);if(!_0x3571fb['isFile']())return![];const _0x2b0b15=a94_0x413fc8[_0x231e89(0xc6)](_0x4684c7)[_0x231e89(0xb8)]();return _0x2b0b15===_0x231e89(0xc4)||_0x2b0b15===_0x231e89(0xbe);}catch{return![];}}
@@ -1 +1 @@
1
- (function(_0x4902dc,_0x55a27b){const _0x4c9353=a95_0x5e89,_0x2a5ab2=_0x4902dc();while(!![]){try{const _0x33adc0=parseInt(_0x4c9353(0x1a1))/0x1*(-parseInt(_0x4c9353(0x188))/0x2)+parseInt(_0x4c9353(0x1d2))/0x3+-parseInt(_0x4c9353(0x186))/0x4*(parseInt(_0x4c9353(0x1c2))/0x5)+parseInt(_0x4c9353(0x1af))/0x6*(parseInt(_0x4c9353(0x19f))/0x7)+parseInt(_0x4c9353(0x18d))/0x8*(-parseInt(_0x4c9353(0x19b))/0x9)+parseInt(_0x4c9353(0x1c6))/0xa*(-parseInt(_0x4c9353(0x1aa))/0xb)+parseInt(_0x4c9353(0x1c1))/0xc*(parseInt(_0x4c9353(0x1a6))/0xd);if(_0x33adc0===_0x55a27b)break;else _0x2a5ab2['push'](_0x2a5ab2['shift']());}catch(_0x53e668){_0x2a5ab2['push'](_0x2a5ab2['shift']());}}}(a95_0x326e,0x4ef8b));import{serializeRule,deepSortObject}from'./child-segment-yaml.js';function a95_0x5e89(_0x5e1b28,_0x78e59a){_0x5e1b28=_0x5e1b28-0x185;const _0x326eb3=a95_0x326e();let _0x5e8991=_0x326eb3[_0x5e1b28];return _0x5e8991;}export const SEGMENT_KIND_JOURNEY=0x3;const MAX_MAPPING_CHAIN_DEPTH=0xa;export function sanitizeYamlKey(_0x5e7955){const _0xed9350=a95_0x5e89;return _0x5e7955[_0xed9350(0x1cf)]()[_0xed9350(0x1be)](/\s+/g,'_')[_0xed9350(0x1be)](/[^a-z0-9_]/g,'')['replace'](/_+/g,'_')['replace'](/^_|_$/g,'');}export function generateJourneyLocalName(_0x32595d){const _0x4bdde4=a95_0x5e89,_0x3a3ffd=_0x32595d[_0x4bdde4(0x1ac)](/^journey_([a-z_]+)_([0-9a-f-]+)$/i);if(_0x3a3ffd){const _0x4ba017=_0x3a3ffd[0x1][_0x4bdde4(0x1cf)](),_0x5c7941=_0x3a3ffd[0x2],_0xb07cfd=_0x5c7941[_0x4bdde4(0x1be)](/-/g,'')[_0x4bdde4(0x1cc)](0x0,0x4)['toLowerCase']();return _0x4ba017+'_'+_0xb07cfd;}const _0x4a2cc2=_0x32595d['match'](/^journey_\d+_stage_\d+_step_([0-9a-f-]+)_([a-z_]+)$/i);if(_0x4a2cc2){const _0xee4002=_0x4a2cc2[0x1],_0x20baba=_0x4a2cc2[0x2][_0x4bdde4(0x1cf)](),_0x3e6cf0=_0xee4002[_0x4bdde4(0x1be)](/-/g,'')[_0x4bdde4(0x1cc)](0x0,0x4)[_0x4bdde4(0x1cf)]();return _0x20baba+'_'+_0x3e6cf0;}return undefined;}function stableStringify(_0xd9a48e){const _0x519915=a95_0x5e89;if(Array[_0x519915(0x1b8)](_0xd9a48e))return'['+_0xd9a48e[_0x519915(0x18e)](_0x5a902a=>stableStringify(_0x5a902a))[_0x519915(0x1a9)](',')+']';if(_0xd9a48e&&typeof _0xd9a48e===_0x519915(0x1d4)){const _0x28ea78=_0xd9a48e,_0x31ff57=Object['keys'](_0x28ea78)['sort'](),_0x16b441=_0x31ff57['map'](_0x25267a=>'\x22'+_0x25267a+'\x22:'+stableStringify(_0x28ea78[_0x25267a]));return'{'+_0x16b441['join'](',')+'}';}const _0xf3457b=JSON[_0x519915(0x1bb)](_0xd9a48e);return _0xf3457b===undefined?_0x519915(0x1b6):_0xf3457b;}export function consolidateActivationsByContent(_0x5594c9){const _0x27c974=a95_0x5e89,_0xcda55e={},_0x3949e2=new Map(),_0x5233e0=new Map();for(const _0x4e6f93 of _0x5594c9){if(!_0x4e6f93)continue;for(const [_0x2a431c,_0xea8bd0]of Object[_0x27c974(0x1ae)](_0x4e6f93)){const _0x104f4c={'connection':_0xea8bd0[_0x27c974(0x1cb)],..._0xea8bd0[_0x27c974(0x1d0)]!==undefined&&{'all_columns':_0xea8bd0['all_columns']},..._0xea8bd0[_0x27c974(0x1a0)]!==undefined&&{'columns':_0xea8bd0[_0x27c974(0x1a0)]},..._0xea8bd0['behavior']!==undefined&&{'behavior':_0xea8bd0['behavior']},..._0xea8bd0[_0x27c974(0x1a3)]!==undefined&&{'schedule':_0xea8bd0[_0x27c974(0x1a3)]},..._0xea8bd0[_0x27c974(0x1b7)]!==undefined&&{'notification':_0xea8bd0[_0x27c974(0x1b7)]},..._0xea8bd0[_0x27c974(0x1ba)]!==undefined&&{'connector_config':_0xea8bd0[_0x27c974(0x1ba)]},..._0xea8bd0[_0x27c974(0x1d7)]!==undefined&&{'activation_template_id':_0xea8bd0[_0x27c974(0x1d7)]}},_0x579f7=stableStringify(_0x104f4c),_0x42999a=_0x5233e0[_0x27c974(0x190)](_0x579f7);_0x42999a?_0x3949e2[_0x27c974(0x1bd)](_0x2a431c,_0x42999a):(_0xcda55e[_0x2a431c]=_0xea8bd0,_0x3949e2[_0x27c974(0x1bd)](_0x2a431c,_0x2a431c),_0x5233e0[_0x27c974(0x1bd)](_0x579f7,_0x2a431c));}}return{'merged':_0xcda55e,'nameMapping':_0x3949e2};}export function updateActivationReferences(_0x2f4e5e,_0x75e6c3){const _0x20f21b=a95_0x5e89;if(!_0x2f4e5e)return;for(const _0x3eb5e8 of _0x2f4e5e){if(!_0x3eb5e8[_0x20f21b(0x1b1)])continue;for(const _0x479c3b of _0x3eb5e8[_0x20f21b(0x1b1)]){if(_0x479c3b['type']===_0x20f21b(0x1b2)&&_0x479c3b[_0x20f21b(0x1c3)]?.['activation']){const _0xec0264=_0x75e6c3[_0x20f21b(0x190)](_0x479c3b[_0x20f21b(0x1c3)][_0x20f21b(0x1b2)]);_0xec0264&&_0xec0264!==_0x479c3b[_0x20f21b(0x1c3)][_0x20f21b(0x1b2)]&&(_0x479c3b[_0x20f21b(0x1c3)][_0x20f21b(0x1b2)]=_0xec0264);}}}}export function consolidateSegmentsByContent(_0x321839,_0x3247d6){const _0x4e69a6=a95_0x5e89,_0x133544={},_0x1690f0=new Map(),_0x5eb88a=new Map();for(const _0x364764 of _0x321839){if(!_0x364764)continue;for(const [_0x7d33aa,_0x9b3cb2]of Object[_0x4e69a6(0x1ae)](_0x364764)){if(!_0x9b3cb2[_0x4e69a6(0x1d3)]){_0x133544[_0x7d33aa]=_0x9b3cb2,_0x1690f0['set'](_0x7d33aa,_0x7d33aa);continue;}const _0x145289=_0x9b3cb2[_0x4e69a6(0x1b0)]&&_0x9b3cb2['description']['trim']()?_0x9b3cb2[_0x4e69a6(0x1b0)]:undefined,_0xbf6a64=JSON['stringify']({'description':_0x145289,'rule':deepSortObject(_0x9b3cb2[_0x4e69a6(0x1d3)])}),_0xba17eb=_0x5eb88a[_0x4e69a6(0x190)](_0xbf6a64);if(_0xba17eb){const _0x35f7ec={..._0x9b3cb2['description']!==undefined&&{'description':_0x9b3cb2[_0x4e69a6(0x1b0)]},'rule':_0x9b3cb2[_0x4e69a6(0x1d3)]?deepSortObject(_0x9b3cb2[_0x4e69a6(0x1d3)]):_0x9b3cb2[_0x4e69a6(0x1d3)]};if(_0x7d33aa<_0xba17eb){_0x133544[_0x7d33aa]=_0x35f7ec,delete _0x133544[_0xba17eb];for(const [_0x2d2597,_0x1aa76d]of _0x1690f0[_0x4e69a6(0x1ae)]()){_0x1aa76d===_0xba17eb&&_0x1690f0[_0x4e69a6(0x1bd)](_0x2d2597,_0x7d33aa);}_0x1690f0['set'](_0x7d33aa,_0x7d33aa),_0x5eb88a[_0x4e69a6(0x1bd)](_0xbf6a64,_0x7d33aa);}else _0x133544[_0xba17eb]=_0x35f7ec,_0x1690f0['set'](_0x7d33aa,_0xba17eb);}else{let _0x3e7590=_0x7d33aa;if(_0x3247d6){const _0x59f28a=_0x3247d6[_0x4e69a6(0x190)](_0xbf6a64);_0x59f28a&&_0x59f28a[_0x4e69a6(0x18b)]>0x0&&(_0x3e7590=_0x59f28a['slice']()[_0x4e69a6(0x1a8)]()[0x0]);}const _0x498b59={..._0x9b3cb2[_0x4e69a6(0x1b0)]!==undefined&&{'description':_0x9b3cb2['description']},'rule':_0x9b3cb2[_0x4e69a6(0x1d3)]?deepSortObject(_0x9b3cb2[_0x4e69a6(0x1d3)]):_0x9b3cb2[_0x4e69a6(0x1d3)]};_0x133544[_0x3e7590]=_0x498b59,_0x1690f0[_0x4e69a6(0x1bd)](_0x7d33aa,_0x3e7590),_0x5eb88a['set'](_0xbf6a64,_0x3e7590);}}}return{'merged':_0x133544,'nameMapping':_0x1690f0};}export function updateSegmentReferences(_0x3fefb6,_0x36dcb5){const _0x3274ee=a95_0x5e89;if(!_0x3fefb6)return;for(const _0x4e9833 of _0x3fefb6){if(_0x4e9833['entry_criteria']?.[_0x3274ee(0x1ab)]){const _0x5dea16=_0x36dcb5[_0x3274ee(0x190)](_0x4e9833['entry_criteria'][_0x3274ee(0x1ab)]);_0x5dea16&&(_0x4e9833[_0x3274ee(0x18c)][_0x3274ee(0x1ab)]=_0x5dea16);}if(_0x4e9833['steps'])for(const _0x4d9a70 of _0x4e9833[_0x3274ee(0x1b1)]){if(_0x4d9a70[_0x3274ee(0x1b4)]===_0x3274ee(0x195)&&_0x4d9a70[_0x3274ee(0x1c3)]?.[_0x3274ee(0x1a4)])for(const _0x4a3d3d of _0x4d9a70[_0x3274ee(0x1c3)][_0x3274ee(0x1a4)]){if(_0x4a3d3d[_0x3274ee(0x1ab)]){const _0x1d2e91=_0x36dcb5[_0x3274ee(0x190)](_0x4a3d3d[_0x3274ee(0x1ab)]);_0x1d2e91&&(_0x4a3d3d[_0x3274ee(0x1ab)]=_0x1d2e91);}}}}}export function updateSegmentRefsInSegments(_0x300f64,_0x281f35){const _0x53b796=a95_0x5e89;for(const _0x2a3cb4 of Object[_0x53b796(0x1c5)](_0x300f64)){_0x2a3cb4[_0x53b796(0x1d3)]&&updateSegmentRefsInRule(_0x2a3cb4[_0x53b796(0x1d3)],_0x281f35);}}function updateSegmentRefsInRule(_0x52974a,_0x8f3b73){const _0x286e8a=a95_0x5e89;if(_0x52974a===null||typeof _0x52974a!==_0x286e8a(0x1d4))return;if(Array[_0x286e8a(0x1b8)](_0x52974a)){for(const _0x4ea914 of _0x52974a){updateSegmentRefsInRule(_0x4ea914,_0x8f3b73);}return;}const _0x48cd4b=_0x52974a;if((_0x48cd4b[_0x286e8a(0x1b4)]===_0x286e8a(0x1d6)||_0x48cd4b['type']===_0x286e8a(0x1d8))&&typeof _0x48cd4b[_0x286e8a(0x1ab)]===_0x286e8a(0x1b9)){const _0x2cceae=_0x8f3b73[_0x286e8a(0x190)](_0x48cd4b[_0x286e8a(0x1ab)]);_0x2cceae&&(_0x48cd4b[_0x286e8a(0x1ab)]=_0x2cceae);}if(_0x48cd4b[_0x286e8a(0x19d)]&&Array[_0x286e8a(0x1b8)](_0x48cd4b[_0x286e8a(0x19d)]))for(const _0x21afb6 of _0x48cd4b[_0x286e8a(0x19d)]){updateSegmentRefsInRule(_0x21afb6,_0x8f3b73);}}export function buildJourneysArray(_0x2c93e4){const _0x481765=a95_0x5e89,_0x50a818=Math['max'](..._0x2c93e4[_0x481765(0x18e)](_0x372c4e=>_0x372c4e[_0x481765(0x193)][_0x481765(0x1cd)]||0x0));return _0x2c93e4[_0x481765(0x18e)](_0x31356b=>{const _0x2ea1db=_0x481765,_0xc5683e=(_0x31356b[_0x2ea1db(0x193)][_0x2ea1db(0x1cd)]||0x0)===_0x50a818,_0x478a2c=_0x31356b[_0x2ea1db(0x1bf)][_0x2ea1db(0x198)]?.[0x0],_0x54978c={'version':_0x478a2c?.[_0x2ea1db(0x1ca)]||_0x31356b[_0x2ea1db(0x1bf)]['version']||_0x31356b[_0x2ea1db(0x193)][_0x2ea1db(0x189)],'state':_0x31356b[_0x2ea1db(0x193)]['state']===_0x2ea1db(0x1c7)?'launched':_0x2ea1db(0x199),'stages':_0x478a2c?.['stages']||_0x31356b['yaml'][_0x2ea1db(0x18f)]||[],'id':_0x478a2c?.['id']||_0x31356b[_0x2ea1db(0x1bf)]['id'],'version_number':_0x478a2c?.[_0x2ea1db(0x1c4)]||_0x31356b[_0x2ea1db(0x1bf)][_0x2ea1db(0x1c4)]};return _0xc5683e&&(_0x54978c[_0x2ea1db(0x1c8)]=!![]),_0x54978c;});}export function buildMergedJourneyDef(_0x4c43cd,_0x4c8705){const _0x2f814f=a95_0x5e89,_0xc2e236=_0x4c43cd[0x0][_0x2f814f(0x1bf)],_0x58987e=buildJourneysArray(_0x4c43cd),{merged:_0x539add,nameMapping:_0x493b1b}=consolidateSegmentsByContent(_0x4c43cd['map'](_0x830e14=>_0x830e14[_0x2f814f(0x1bf)][_0x2f814f(0x196)]),_0x4c8705);updateSegmentRefsInSegments(_0x539add,_0x493b1b);const _0x2c3144=Array[_0x2f814f(0x1a7)](_0x493b1b[_0x2f814f(0x1ae)]())[_0x2f814f(0x1b5)](([_0x9bff85,_0x454412])=>_0x9bff85!==_0x454412&&_0x9bff85[_0x2f814f(0x19c)]('entry_criteria'));let _0x4960bf=_0x539add,_0xb5401e=new Map();if(_0x2c3144){const _0x39390d=consolidateSegmentsByContent([_0x539add],_0x4c8705);_0x4960bf=_0x39390d['merged'],_0xb5401e=_0x39390d['nameMapping'];}const _0x1565c6=new Map(_0x493b1b);for(const [_0x71127a,_0x50ae67]of _0xb5401e[_0x2f814f(0x1ae)]()){_0x1565c6['set'](_0x71127a,_0x50ae67);}for(const [_0x3801c7,_0x17bf6d]of _0x1565c6['entries']()){let _0x549a86=_0x17bf6d,_0x4e1274=0x0;while(_0x1565c6['has'](_0x549a86)&&_0x1565c6[_0x2f814f(0x190)](_0x549a86)!==_0x549a86&&_0x4e1274<MAX_MAPPING_CHAIN_DEPTH){_0x549a86=_0x1565c6[_0x2f814f(0x190)](_0x549a86),_0x4e1274++;}_0x549a86!==_0x17bf6d&&_0x1565c6[_0x2f814f(0x1bd)](_0x3801c7,_0x549a86);}for(const _0xd2c4c8 of _0x58987e){updateSegmentReferences(_0xd2c4c8['stages'],_0x1565c6);}const {merged:_0x2c6a8e,nameMapping:_0x1edbde}=consolidateActivationsByContent(_0x4c43cd[_0x2f814f(0x18e)](_0x59d5a9=>_0x59d5a9[_0x2f814f(0x1bf)][_0x2f814f(0x1c0)]));for(const _0x4ba23a of _0x58987e){updateActivationReferences(_0x4ba23a[_0x2f814f(0x18f)],_0x1edbde);}let _0x45f17f=_0xc2e236['goal'];if(_0x45f17f?.[_0x2f814f(0x1ab)]){const _0x48fa46=_0x1565c6['get'](_0x45f17f[_0x2f814f(0x1ab)]);_0x48fa46&&(_0x45f17f={..._0x45f17f,'segment':_0x48fa46});}for(const _0x17ce20 of _0x58987e){if(_0x17ce20[_0x2f814f(0x1c9)]?.['segment']){const _0x2cd19d=_0x1565c6[_0x2f814f(0x190)](_0x17ce20['goal']['segment']);_0x2cd19d&&(_0x17ce20[_0x2f814f(0x1c9)]={..._0x17ce20[_0x2f814f(0x1c9)],'segment':_0x2cd19d});}}return{'type':_0x2f814f(0x18a),'name':_0xc2e236[_0x2f814f(0x189)],'description':_0xc2e236['description'],'goal':_0x45f17f,'reentry':_0xc2e236[_0x2f814f(0x1ad)],'segments':Object[_0x2f814f(0x194)](_0x4960bf)['length']>0x0?_0x4960bf:undefined,'activations':Object[_0x2f814f(0x194)](_0x2c6a8e)[_0x2f814f(0x18b)]>0x0?_0x2c6a8e:undefined,'journeys':_0x58987e,'bundle_id':_0xc2e236[_0x2f814f(0x197)],'bundle_name':_0xc2e236[_0x2f814f(0x1a5)]};}export function createJumpTargetCache(){return new Map();}export async function resolveJumpTarget(_0x151741,_0x267f1a,_0x47fc48,_0x57a766){const _0x57d910=a95_0x5e89,_0x32be25=_0x151741+':'+_0x267f1a,_0x31275b=_0x47fc48[_0x57d910(0x190)](_0x32be25);if(_0x31275b)return _0x31275b;const _0x2f1987=await _0x57a766(_0x151741),_0x265c89=_0x2f1987['attributes']['journeyBundleName']||_0x2f1987[_0x57d910(0x1ce)][_0x57d910(0x189)],_0x61bd69=_0x2f1987[_0x57d910(0x1ce)][_0x57d910(0x1d1)]['find'](_0x100b0e=>String(_0x100b0e['id'])===String(_0x267f1a)),_0x11d84b=_0x61bd69?.['name']||_0x267f1a,_0x129347={'journeyName':_0x265c89,'stageName':_0x11d84b};return _0x47fc48[_0x57d910(0x1bd)](_0x32be25,_0x129347),_0x129347;}export function formatApiJourneyName(_0x51a1c4,_0x463041){return _0x463041+'\x20('+_0x51a1c4+')';}export function isLocalJourneyRef(_0x5652e8){const _0x20e86b=a95_0x5e89;return _0x5652e8[_0x20e86b(0x1a2)](_0x20e86b(0x1b3))||_0x5652e8[_0x20e86b(0x1a2)](_0x20e86b(0x1bc));}export function buildLocalRuleToNameMapping(_0x41ebf4){const _0x27cafb=a95_0x5e89,_0x218b8a=new Map();if(!_0x41ebf4)return _0x218b8a;for(const [_0xfd94b9,_0x472446]of Object[_0x27cafb(0x1ae)](_0x41ebf4)){if(_0x472446[_0x27cafb(0x1d3)]){const _0x4d9d1=serializeRule(_0x472446['rule']),_0x382ade=_0x218b8a[_0x27cafb(0x190)](_0x4d9d1)||[];_0x382ade[_0x27cafb(0x1d5)](_0xfd94b9),_0x218b8a[_0x27cafb(0x1bd)](_0x4d9d1,_0x382ade);}}return _0x218b8a;}export function buildLocalRuleToNameMappingFromJourney(_0x2efdd3){const _0x144e8f=a95_0x5e89,_0x34acc3=_0x2efdd3[_0x144e8f(0x196)];if(!_0x34acc3)return new Map();const _0x29cc46=collectSegmentUsageCounts(_0x2efdd3),_0x36e786=new Map();let _0x12a891=0x0;for(const [_0x41d57,_0x4b1945]of Object['entries'](_0x34acc3)){if(!_0x4b1945[_0x144e8f(0x1d3)]){_0x12a891++;continue;}const _0x549c6e=serializeRule(_0x4b1945[_0x144e8f(0x1d3)]),_0x488d27=_0x36e786['get'](_0x549c6e)||[];_0x488d27[_0x144e8f(0x1d5)]({'name':_0x41d57,'index':_0x12a891}),_0x36e786[_0x144e8f(0x1bd)](_0x549c6e,_0x488d27),_0x12a891++;}const _0x5d187f=new Map();for(const [_0x4ddd42,_0x582af8]of _0x36e786){const _0x1628b7=_0x582af8[_0x144e8f(0x1cc)]()[_0x144e8f(0x1a8)]((_0x307d6d,_0x2706e2)=>{const _0x219391=_0x144e8f,_0x3b680b=_0x29cc46[_0x219391(0x190)](_0x307d6d[_0x219391(0x189)])||0x0,_0x51e1e3=_0x29cc46[_0x219391(0x190)](_0x2706e2[_0x219391(0x189)])||0x0;if(_0x3b680b!==_0x51e1e3)return _0x51e1e3-_0x3b680b;return _0x307d6d['index']-_0x2706e2[_0x219391(0x192)];})['map'](_0x112817=>_0x112817['name']);_0x5d187f[_0x144e8f(0x1bd)](_0x4ddd42,_0x1628b7);}return _0x5d187f;}export function collectSegmentUsageCounts(_0x53c288){const _0x25845d=a95_0x5e89,_0x90938b=new Map(),_0x3d9c08=_0x250511=>{const _0x11f55b=a95_0x5e89;if(!_0x250511)return;_0x90938b['set'](_0x250511,(_0x90938b[_0x11f55b(0x190)](_0x250511)||0x0)+0x1);},_0x2a06d0=_0x2b89a0=>{const _0x27f76c=a95_0x5e89;for(const _0x19fe0b of _0x2b89a0){_0x3d9c08(_0x19fe0b[_0x27f76c(0x18c)]?.[_0x27f76c(0x1ab)]);if(_0x19fe0b[_0x27f76c(0x185)])for(const _0x494015 of _0x19fe0b[_0x27f76c(0x185)]){_0x3d9c08(_0x494015[_0x27f76c(0x1ab)]);}_0x3d9c08(_0x19fe0b[_0x27f76c(0x191)]?.[_0x27f76c(0x1ab)]);if(_0x19fe0b['steps'])for(const _0x261ce4 of _0x19fe0b[_0x27f76c(0x1b1)]){if(_0x261ce4['type']===_0x27f76c(0x195))for(const _0x40ad90 of _0x261ce4[_0x27f76c(0x1c3)][_0x27f76c(0x1a4)]){_0x3d9c08(_0x40ad90['segment']);}else _0x261ce4['type']===_0x27f76c(0x19e)&&_0x3d9c08(_0x261ce4['with'][_0x27f76c(0x19a)]?.[_0x27f76c(0x1ab)]);}}};_0x3d9c08(_0x53c288[_0x25845d(0x1c9)]?.[_0x25845d(0x1ab)]);if(_0x53c288[_0x25845d(0x198)])for(const _0x17b43b of _0x53c288[_0x25845d(0x198)]){_0x3d9c08(_0x17b43b[_0x25845d(0x1c9)]?.[_0x25845d(0x1ab)]),_0x2a06d0(_0x17b43b[_0x25845d(0x18f)]);}_0x53c288[_0x25845d(0x18f)]&&_0x2a06d0(_0x53c288['stages']);if(_0x53c288['versions'])for(const _0x4d8c06 of _0x53c288[_0x25845d(0x187)]){_0x2a06d0(_0x4d8c06['stages']);}return _0x90938b;}function a95_0x326e(){const _0x73abbb=['47145XjEujf','with','version_number','values','30SWUZAh','launched','latest','goal','version','connection','slice','versionNumber','attributes','toLowerCase','all_columns','journeyStages','152112XDAoKH','rule','object','push','include','activation_template_id','exclude','exit_criteria','212AwefZu','versions','4ypiUpP','name','journey','length','entry_criteria','3576bLjpHk','map','stages','get','milestone','index','item','keys','decision_point','segments','bundle_id','journeys','draft','condition','10233KWNgdp','startsWith','conditions','wait','108962IVaTuG','columns','173987JXTmyP','endsWith','schedule','branches','bundle_name','22121333APaiKg','from','sort','join','666930jgPlzE','segment','match','reentry','entries','42DZVohk','description','steps','activation','.yml','type','some','null','notification','isArray','string','connector_config','stringify','.yaml','set','replace','yaml','activations','12USwGQV'];a95_0x326e=function(){return _0x73abbb;};return a95_0x326e();}
1
+ function a95_0x5d05(_0x220284,_0x31c788){_0x220284=_0x220284-0x66;const _0x46b7ca=a95_0x46b7();let _0x5d0510=_0x46b7ca[_0x220284];return _0x5d0510;}(function(_0x52098f,_0x2373a5){const _0x2ce769=a95_0x5d05,_0x53b447=_0x52098f();while(!![]){try{const _0x508b18=parseInt(_0x2ce769(0x77))/0x1*(-parseInt(_0x2ce769(0x90))/0x2)+parseInt(_0x2ce769(0x95))/0x3*(parseInt(_0x2ce769(0xac))/0x4)+parseInt(_0x2ce769(0xad))/0x5*(parseInt(_0x2ce769(0x80))/0x6)+-parseInt(_0x2ce769(0x68))/0x7+parseInt(_0x2ce769(0x88))/0x8*(parseInt(_0x2ce769(0x7e))/0x9)+-parseInt(_0x2ce769(0x7a))/0xa+-parseInt(_0x2ce769(0x83))/0xb*(-parseInt(_0x2ce769(0x79))/0xc);if(_0x508b18===_0x2373a5)break;else _0x53b447['push'](_0x53b447['shift']());}catch(_0x153c13){_0x53b447['push'](_0x53b447['shift']());}}}(a95_0x46b7,0x703c7));import{serializeRule,deepSortObject}from'./child-segment-yaml.js';export const SEGMENT_KIND_JOURNEY=0x3;const MAX_MAPPING_CHAIN_DEPTH=0xa;export function sanitizeYamlKey(_0x4eae0f){const _0x5e238d=a95_0x5d05;return _0x4eae0f[_0x5e238d(0x7c)]()[_0x5e238d(0x89)](/\s+/g,'_')[_0x5e238d(0x89)](/[^a-z0-9_]/g,'')['replace'](/_+/g,'_')[_0x5e238d(0x89)](/^_|_$/g,'');}function a95_0x46b7(){const _0x1a7eff=['6316639szTHKY','entry_criteria','stages','activations','length','all_columns','find','with','versions','state','has','item','object','keys','string','144293fCyPLV','segments','12aRPSmx','4031690BRUoIi','milestone','toLowerCase','index','81KKRUfk','version','11028baaOjy','exit_criteria','description','5630152vKUrEt','journey','bundle_id','decision_point','version_number','588048mVSspA','replace','slice','match','merged','map','join','conditions','8mfJdTZ','latest','isArray','get','connector_config','1064451KyRRGP','goal','values','.yaml','from','columns','branches','draft','set','activation_template_id','launched','notification','condition','segment','type','yaml','name','versionNumber','schedule','activation','journeys','reentry','attributes','4sFhmfD','2215luylTj','null','steps','some','include','behavior','rule','stringify','bundle_name','entries','sort','max'];a95_0x46b7=function(){return _0x1a7eff;};return a95_0x46b7();}export function generateJourneyLocalName(_0x4b307f){const _0xaa8137=a95_0x5d05,_0x1666f7=_0x4b307f[_0xaa8137(0x8b)](/^journey_([a-z_]+)_([0-9a-f-]+)$/i);if(_0x1666f7){const _0x10054d=_0x1666f7[0x1][_0xaa8137(0x7c)](),_0x40b9a5=_0x1666f7[0x2],_0x3b1c5d=_0x40b9a5[_0xaa8137(0x89)](/-/g,'')[_0xaa8137(0x8a)](0x0,0x4)[_0xaa8137(0x7c)]();return _0x10054d+'_'+_0x3b1c5d;}const _0x56a66c=_0x4b307f[_0xaa8137(0x8b)](/^journey_\d+_stage_\d+_step_([0-9a-f-]+)_([a-z_]+)$/i);if(_0x56a66c){const _0x1ff302=_0x56a66c[0x1],_0x5604ab=_0x56a66c[0x2][_0xaa8137(0x7c)](),_0x101c05=_0x1ff302[_0xaa8137(0x89)](/-/g,'')[_0xaa8137(0x8a)](0x0,0x4)['toLowerCase']();return _0x5604ab+'_'+_0x101c05;}return undefined;}function stableStringify(_0x5ed6c7){const _0x48b9bd=a95_0x5d05;if(Array[_0x48b9bd(0x92)](_0x5ed6c7))return'['+_0x5ed6c7['map'](_0x681258=>stableStringify(_0x681258))['join'](',')+']';if(_0x5ed6c7&&typeof _0x5ed6c7===_0x48b9bd(0x74)){const _0xa195c8=_0x5ed6c7,_0x1a9dfb=Object[_0x48b9bd(0x75)](_0xa195c8)[_0x48b9bd(0x66)](),_0x51e1fb=_0x1a9dfb[_0x48b9bd(0x8d)](_0x192124=>'\x22'+_0x192124+'\x22:'+stableStringify(_0xa195c8[_0x192124]));return'{'+_0x51e1fb[_0x48b9bd(0x8e)](',')+'}';}const _0x4fe179=JSON['stringify'](_0x5ed6c7);return _0x4fe179===undefined?_0x48b9bd(0xae):_0x4fe179;}export function consolidateActivationsByContent(_0x28577a){const _0x2c76f3=a95_0x5d05,_0x4b20df={},_0x48f71d=new Map(),_0x5ddf82=new Map();for(const _0x166b8a of _0x28577a){if(!_0x166b8a)continue;for(const [_0x1b338b,_0x304721]of Object[_0x2c76f3(0xb6)](_0x166b8a)){const _0x440a3f={'connection':_0x304721['connection'],..._0x304721[_0x2c76f3(0x6d)]!==undefined&&{'all_columns':_0x304721['all_columns']},..._0x304721[_0x2c76f3(0x9a)]!==undefined&&{'columns':_0x304721[_0x2c76f3(0x9a)]},..._0x304721[_0x2c76f3(0xb2)]!==undefined&&{'behavior':_0x304721[_0x2c76f3(0xb2)]},..._0x304721[_0x2c76f3(0xa7)]!==undefined&&{'schedule':_0x304721[_0x2c76f3(0xa7)]},..._0x304721[_0x2c76f3(0xa0)]!==undefined&&{'notification':_0x304721['notification']},..._0x304721[_0x2c76f3(0x94)]!==undefined&&{'connector_config':_0x304721['connector_config']},..._0x304721[_0x2c76f3(0x9e)]!==undefined&&{'activation_template_id':_0x304721['activation_template_id']}},_0xbe8da7=stableStringify(_0x440a3f),_0x3bbee5=_0x5ddf82['get'](_0xbe8da7);_0x3bbee5?_0x48f71d[_0x2c76f3(0x9d)](_0x1b338b,_0x3bbee5):(_0x4b20df[_0x1b338b]=_0x304721,_0x48f71d['set'](_0x1b338b,_0x1b338b),_0x5ddf82[_0x2c76f3(0x9d)](_0xbe8da7,_0x1b338b));}}return{'merged':_0x4b20df,'nameMapping':_0x48f71d};}export function updateActivationReferences(_0x281cc2,_0x151c19){const _0x5362ad=a95_0x5d05;if(!_0x281cc2)return;for(const _0x478738 of _0x281cc2){if(!_0x478738['steps'])continue;for(const _0x11fc5d of _0x478738['steps']){if(_0x11fc5d['type']==='activation'&&_0x11fc5d['with']?.[_0x5362ad(0xa8)]){const _0x5ed83d=_0x151c19[_0x5362ad(0x93)](_0x11fc5d['with'][_0x5362ad(0xa8)]);_0x5ed83d&&_0x5ed83d!==_0x11fc5d[_0x5362ad(0x6f)][_0x5362ad(0xa8)]&&(_0x11fc5d[_0x5362ad(0x6f)][_0x5362ad(0xa8)]=_0x5ed83d);}}}}export function consolidateSegmentsByContent(_0xbd939e,_0x179002){const _0x2a20f6=a95_0x5d05,_0x4a4978={},_0x40ac45=new Map(),_0x3cd152=new Map();for(const _0x3eaa7c of _0xbd939e){if(!_0x3eaa7c)continue;for(const [_0x3678c1,_0x5a4d8a]of Object[_0x2a20f6(0xb6)](_0x3eaa7c)){if(!_0x5a4d8a['rule']){_0x4a4978[_0x3678c1]=_0x5a4d8a,_0x40ac45[_0x2a20f6(0x9d)](_0x3678c1,_0x3678c1);continue;}const _0x38ae82=_0x5a4d8a[_0x2a20f6(0x82)]&&_0x5a4d8a[_0x2a20f6(0x82)]['trim']()?_0x5a4d8a['description']:undefined,_0x597c57=JSON[_0x2a20f6(0xb4)]({'description':_0x38ae82,'rule':deepSortObject(_0x5a4d8a[_0x2a20f6(0xb3)])}),_0x11a674=_0x3cd152[_0x2a20f6(0x93)](_0x597c57);if(_0x11a674){const _0x38622c={..._0x5a4d8a['description']!==undefined&&{'description':_0x5a4d8a[_0x2a20f6(0x82)]},'rule':_0x5a4d8a[_0x2a20f6(0xb3)]?deepSortObject(_0x5a4d8a['rule']):_0x5a4d8a[_0x2a20f6(0xb3)]};if(_0x3678c1<_0x11a674){_0x4a4978[_0x3678c1]=_0x38622c,delete _0x4a4978[_0x11a674];for(const [_0x3c6be5,_0x47b78e]of _0x40ac45[_0x2a20f6(0xb6)]()){_0x47b78e===_0x11a674&&_0x40ac45[_0x2a20f6(0x9d)](_0x3c6be5,_0x3678c1);}_0x40ac45[_0x2a20f6(0x9d)](_0x3678c1,_0x3678c1),_0x3cd152[_0x2a20f6(0x9d)](_0x597c57,_0x3678c1);}else _0x4a4978[_0x11a674]=_0x38622c,_0x40ac45[_0x2a20f6(0x9d)](_0x3678c1,_0x11a674);}else{let _0x1edabd=_0x3678c1;if(_0x179002){const _0x3e53f3=_0x179002[_0x2a20f6(0x93)](_0x597c57);_0x3e53f3&&_0x3e53f3['length']>0x0&&(_0x1edabd=_0x3e53f3[_0x2a20f6(0x8a)]()[_0x2a20f6(0x66)]()[0x0]);}const _0x1a49fe={..._0x5a4d8a[_0x2a20f6(0x82)]!==undefined&&{'description':_0x5a4d8a['description']},'rule':_0x5a4d8a[_0x2a20f6(0xb3)]?deepSortObject(_0x5a4d8a['rule']):_0x5a4d8a['rule']};_0x4a4978[_0x1edabd]=_0x1a49fe,_0x40ac45[_0x2a20f6(0x9d)](_0x3678c1,_0x1edabd),_0x3cd152['set'](_0x597c57,_0x1edabd);}}}return{'merged':_0x4a4978,'nameMapping':_0x40ac45};}export function updateSegmentReferences(_0x2edc2d,_0x3bdccf){const _0x20c7ee=a95_0x5d05;if(!_0x2edc2d)return;for(const _0x1606cb of _0x2edc2d){if(_0x1606cb[_0x20c7ee(0x69)]?.[_0x20c7ee(0xa2)]){const _0x2e47bc=_0x3bdccf[_0x20c7ee(0x93)](_0x1606cb[_0x20c7ee(0x69)][_0x20c7ee(0xa2)]);_0x2e47bc&&(_0x1606cb[_0x20c7ee(0x69)][_0x20c7ee(0xa2)]=_0x2e47bc);}if(_0x1606cb[_0x20c7ee(0xaf)])for(const _0x1a1d91 of _0x1606cb[_0x20c7ee(0xaf)]){if(_0x1a1d91[_0x20c7ee(0xa3)]===_0x20c7ee(0x86)&&_0x1a1d91[_0x20c7ee(0x6f)]?.[_0x20c7ee(0x9b)])for(const _0x4539d9 of _0x1a1d91[_0x20c7ee(0x6f)]['branches']){if(_0x4539d9[_0x20c7ee(0xa2)]){const _0x43fc72=_0x3bdccf[_0x20c7ee(0x93)](_0x4539d9[_0x20c7ee(0xa2)]);_0x43fc72&&(_0x4539d9[_0x20c7ee(0xa2)]=_0x43fc72);}}}}}export function updateSegmentRefsInSegments(_0x403b38,_0x49d172){const _0x38c0db=a95_0x5d05;for(const _0x3f60db of Object[_0x38c0db(0x97)](_0x403b38)){_0x3f60db['rule']&&updateSegmentRefsInRule(_0x3f60db[_0x38c0db(0xb3)],_0x49d172);}}function updateSegmentRefsInRule(_0x5039b9,_0x38ce8e){const _0x4be76c=a95_0x5d05;if(_0x5039b9===null||typeof _0x5039b9!==_0x4be76c(0x74))return;if(Array['isArray'](_0x5039b9)){for(const _0x3e33a4 of _0x5039b9){updateSegmentRefsInRule(_0x3e33a4,_0x38ce8e);}return;}const _0x3200c8=_0x5039b9;if((_0x3200c8['type']===_0x4be76c(0xb1)||_0x3200c8[_0x4be76c(0xa3)]==='exclude')&&typeof _0x3200c8[_0x4be76c(0xa2)]===_0x4be76c(0x76)){const _0x1245fa=_0x38ce8e[_0x4be76c(0x93)](_0x3200c8[_0x4be76c(0xa2)]);_0x1245fa&&(_0x3200c8[_0x4be76c(0xa2)]=_0x1245fa);}if(_0x3200c8[_0x4be76c(0x8f)]&&Array[_0x4be76c(0x92)](_0x3200c8[_0x4be76c(0x8f)]))for(const _0xda33c5 of _0x3200c8[_0x4be76c(0x8f)]){updateSegmentRefsInRule(_0xda33c5,_0x38ce8e);}}export function buildJourneysArray(_0x2aa91a){const _0x1c5d0c=a95_0x5d05,_0x7f6daa=Math[_0x1c5d0c(0x67)](..._0x2aa91a[_0x1c5d0c(0x8d)](_0xe0c7c=>_0xe0c7c[_0x1c5d0c(0x73)][_0x1c5d0c(0xa6)]||0x0));return _0x2aa91a[_0x1c5d0c(0x8d)](_0x31aae6=>{const _0x30214d=_0x1c5d0c,_0x5daae5=(_0x31aae6[_0x30214d(0x73)][_0x30214d(0xa6)]||0x0)===_0x7f6daa,_0x4831f3=_0x31aae6[_0x30214d(0xa4)][_0x30214d(0xa9)]?.[0x0],_0x246fb5={'version':_0x4831f3?.[_0x30214d(0x7f)]||_0x31aae6[_0x30214d(0xa4)][_0x30214d(0x7f)]||_0x31aae6[_0x30214d(0x73)]['name'],'state':_0x31aae6[_0x30214d(0x73)][_0x30214d(0x71)]===_0x30214d(0x9f)?_0x30214d(0x9f):_0x30214d(0x9c),'stages':_0x4831f3?.[_0x30214d(0x6a)]||_0x31aae6[_0x30214d(0xa4)]['stages']||[],'id':_0x4831f3?.['id']||_0x31aae6[_0x30214d(0xa4)]['id'],'version_number':_0x4831f3?.[_0x30214d(0x87)]||_0x31aae6[_0x30214d(0xa4)]['version_number']};return _0x5daae5&&(_0x246fb5[_0x30214d(0x91)]=!![]),_0x246fb5;});}export function buildMergedJourneyDef(_0x2ebee7,_0x1dbeb1){const _0x53fa83=a95_0x5d05,_0x1f55d4=_0x2ebee7[0x0][_0x53fa83(0xa4)],_0x593a3f=buildJourneysArray(_0x2ebee7),{merged:_0x251d74,nameMapping:_0x2b528a}=consolidateSegmentsByContent(_0x2ebee7['map'](_0x4cf51d=>_0x4cf51d[_0x53fa83(0xa4)]['segments']),_0x1dbeb1);updateSegmentRefsInSegments(_0x251d74,_0x2b528a);const _0x52ce6d=Array[_0x53fa83(0x99)](_0x2b528a[_0x53fa83(0xb6)]())[_0x53fa83(0xb0)](([_0x16bf2c,_0x1ba014])=>_0x16bf2c!==_0x1ba014&&_0x16bf2c['startsWith'](_0x53fa83(0x69)));let _0x1fbc65=_0x251d74,_0x4c843c=new Map();if(_0x52ce6d){const _0x5e7d1b=consolidateSegmentsByContent([_0x251d74],_0x1dbeb1);_0x1fbc65=_0x5e7d1b[_0x53fa83(0x8c)],_0x4c843c=_0x5e7d1b['nameMapping'];}const _0x59fa2f=new Map(_0x2b528a);for(const [_0x20ca6e,_0x573bd4]of _0x4c843c[_0x53fa83(0xb6)]()){_0x59fa2f[_0x53fa83(0x9d)](_0x20ca6e,_0x573bd4);}for(const [_0x3ede20,_0xac9e48]of _0x59fa2f[_0x53fa83(0xb6)]()){let _0x21c09b=_0xac9e48,_0x586c5c=0x0;while(_0x59fa2f[_0x53fa83(0x72)](_0x21c09b)&&_0x59fa2f[_0x53fa83(0x93)](_0x21c09b)!==_0x21c09b&&_0x586c5c<MAX_MAPPING_CHAIN_DEPTH){_0x21c09b=_0x59fa2f[_0x53fa83(0x93)](_0x21c09b),_0x586c5c++;}_0x21c09b!==_0xac9e48&&_0x59fa2f[_0x53fa83(0x9d)](_0x3ede20,_0x21c09b);}for(const _0x2ffd2e of _0x593a3f){updateSegmentReferences(_0x2ffd2e[_0x53fa83(0x6a)],_0x59fa2f);}const {merged:_0x2c9de5,nameMapping:_0xf7ebc}=consolidateActivationsByContent(_0x2ebee7['map'](_0x101bd7=>_0x101bd7['yaml'][_0x53fa83(0x6b)]));for(const _0x4b7f89 of _0x593a3f){updateActivationReferences(_0x4b7f89[_0x53fa83(0x6a)],_0xf7ebc);}let _0x5036ec=_0x1f55d4[_0x53fa83(0x96)];if(_0x5036ec?.['segment']){const _0x56e232=_0x59fa2f['get'](_0x5036ec[_0x53fa83(0xa2)]);_0x56e232&&(_0x5036ec={..._0x5036ec,'segment':_0x56e232});}for(const _0x43e3f9 of _0x593a3f){if(_0x43e3f9[_0x53fa83(0x96)]?.[_0x53fa83(0xa2)]){const _0x1b29a2=_0x59fa2f['get'](_0x43e3f9[_0x53fa83(0x96)]['segment']);_0x1b29a2&&(_0x43e3f9[_0x53fa83(0x96)]={..._0x43e3f9[_0x53fa83(0x96)],'segment':_0x1b29a2});}}return{'type':_0x53fa83(0x84),'name':_0x1f55d4[_0x53fa83(0xa5)],'description':_0x1f55d4[_0x53fa83(0x82)],'goal':_0x5036ec,'reentry':_0x1f55d4[_0x53fa83(0xaa)],'segments':Object['keys'](_0x1fbc65)['length']>0x0?_0x1fbc65:undefined,'activations':Object[_0x53fa83(0x75)](_0x2c9de5)[_0x53fa83(0x6c)]>0x0?_0x2c9de5:undefined,'journeys':_0x593a3f,'bundle_id':_0x1f55d4[_0x53fa83(0x85)],'bundle_name':_0x1f55d4[_0x53fa83(0xb5)]};}export function createJumpTargetCache(){return new Map();}export async function resolveJumpTarget(_0x1bff2a,_0x440a5e,_0x1b570c,_0x2ce398){const _0x26e540=a95_0x5d05,_0x31c784=_0x1bff2a+':'+_0x440a5e,_0x598a30=_0x1b570c[_0x26e540(0x93)](_0x31c784);if(_0x598a30)return _0x598a30;const _0x21ec9f=await _0x2ce398(_0x1bff2a),_0x510432=_0x21ec9f['attributes']['journeyBundleName']||_0x21ec9f['attributes'][_0x26e540(0xa5)],_0x5bf388=_0x21ec9f[_0x26e540(0xab)]['journeyStages'][_0x26e540(0x6e)](_0x2f68ee=>String(_0x2f68ee['id'])===String(_0x440a5e)),_0xa6d168=_0x5bf388?.['name']||_0x440a5e,_0x430a48={'journeyName':_0x510432,'stageName':_0xa6d168};return _0x1b570c[_0x26e540(0x9d)](_0x31c784,_0x430a48),_0x430a48;}export function formatApiJourneyName(_0x44f4ef,_0x46d4b0){return _0x46d4b0+'\x20('+_0x44f4ef+')';}export function isLocalJourneyRef(_0x9495d9){const _0x4720de=a95_0x5d05;return _0x9495d9['endsWith']('.yml')||_0x9495d9['endsWith'](_0x4720de(0x98));}export function buildLocalRuleToNameMapping(_0x56ffcb){const _0x2f9929=a95_0x5d05,_0x48152d=new Map();if(!_0x56ffcb)return _0x48152d;for(const [_0x4ef9b2,_0x3a285c]of Object['entries'](_0x56ffcb)){if(_0x3a285c['rule']){const _0xe21c9e=serializeRule(_0x3a285c['rule']),_0x32397e=_0x48152d[_0x2f9929(0x93)](_0xe21c9e)||[];_0x32397e['push'](_0x4ef9b2),_0x48152d[_0x2f9929(0x9d)](_0xe21c9e,_0x32397e);}}return _0x48152d;}export function buildLocalRuleToNameMappingFromJourney(_0x25639f){const _0x4db547=a95_0x5d05,_0x221599=_0x25639f[_0x4db547(0x78)];if(!_0x221599)return new Map();const _0x489e9c=collectSegmentUsageCounts(_0x25639f),_0x1a3fb4=new Map();let _0x1d5e55=0x0;for(const [_0x44b665,_0x3fdf6f]of Object[_0x4db547(0xb6)](_0x221599)){if(!_0x3fdf6f[_0x4db547(0xb3)]){_0x1d5e55++;continue;}const _0x637d21=serializeRule(_0x3fdf6f['rule']),_0x5a3fb4=_0x1a3fb4[_0x4db547(0x93)](_0x637d21)||[];_0x5a3fb4['push']({'name':_0x44b665,'index':_0x1d5e55}),_0x1a3fb4[_0x4db547(0x9d)](_0x637d21,_0x5a3fb4),_0x1d5e55++;}const _0x3d0b3b=new Map();for(const [_0x127f9f,_0x22af8a]of _0x1a3fb4){const _0x599fe7=_0x22af8a[_0x4db547(0x8a)]()[_0x4db547(0x66)]((_0x2a3955,_0x40a772)=>{const _0x3b53c9=_0x4db547,_0x58355f=_0x489e9c[_0x3b53c9(0x93)](_0x2a3955[_0x3b53c9(0xa5)])||0x0,_0x1365c0=_0x489e9c[_0x3b53c9(0x93)](_0x40a772[_0x3b53c9(0xa5)])||0x0;if(_0x58355f!==_0x1365c0)return _0x1365c0-_0x58355f;return _0x2a3955['index']-_0x40a772[_0x3b53c9(0x7d)];})[_0x4db547(0x8d)](_0xe50a0c=>_0xe50a0c['name']);_0x3d0b3b[_0x4db547(0x9d)](_0x127f9f,_0x599fe7);}return _0x3d0b3b;}export function collectSegmentUsageCounts(_0x3e63e6){const _0x1a7987=a95_0x5d05,_0x221fe6=new Map(),_0x3fe828=_0x263654=>{const _0x220540=a95_0x5d05;if(!_0x263654)return;_0x221fe6['set'](_0x263654,(_0x221fe6[_0x220540(0x93)](_0x263654)||0x0)+0x1);},_0x23c64b=_0x5586ed=>{const _0x549f17=a95_0x5d05;for(const _0x420cf0 of _0x5586ed){_0x3fe828(_0x420cf0['entry_criteria']?.['segment']);if(_0x420cf0[_0x549f17(0x81)])for(const _0x236e2f of _0x420cf0[_0x549f17(0x81)]){_0x3fe828(_0x236e2f[_0x549f17(0xa2)]);}_0x3fe828(_0x420cf0[_0x549f17(0x7b)]?.[_0x549f17(0xa2)]);if(_0x420cf0['steps'])for(const _0x1225e4 of _0x420cf0[_0x549f17(0xaf)]){if(_0x1225e4[_0x549f17(0xa3)]===_0x549f17(0x86))for(const _0x2fdfbd of _0x1225e4['with'][_0x549f17(0x9b)]){_0x3fe828(_0x2fdfbd[_0x549f17(0xa2)]);}else _0x1225e4[_0x549f17(0xa3)]==='wait'&&_0x3fe828(_0x1225e4[_0x549f17(0x6f)][_0x549f17(0xa1)]?.['segment']);}}};_0x3fe828(_0x3e63e6[_0x1a7987(0x96)]?.[_0x1a7987(0xa2)]);if(_0x3e63e6[_0x1a7987(0xa9)])for(const _0xa7273f of _0x3e63e6[_0x1a7987(0xa9)]){_0x3fe828(_0xa7273f[_0x1a7987(0x96)]?.[_0x1a7987(0xa2)]),_0x23c64b(_0xa7273f['stages']);}_0x3e63e6['stages']&&_0x23c64b(_0x3e63e6['stages']);if(_0x3e63e6[_0x1a7987(0x70)])for(const _0x2e6a6d of _0x3e63e6['versions']){_0x23c64b(_0x2e6a6d[_0x1a7987(0x6a)]);}return _0x221fe6;}