@treasuredata/tdx 2026.3.53 → 2026.3.54

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 (219) hide show
  1. package/dist/bin.js +1 -1
  2. package/dist/build-info.json +3 -3
  3. package/dist/cli-categories.js +1 -1
  4. package/dist/cli.js +1 -1
  5. package/dist/commands/activations.js +1 -1
  6. package/dist/commands/agent-command.js +1 -1
  7. package/dist/commands/agent-test-command.js +1 -1
  8. package/dist/commands/api-command.js +1 -1
  9. package/dist/commands/auth-command.js +1 -1
  10. package/dist/commands/cas-command.js +1 -1
  11. package/dist/commands/cas-segment-command.js +1 -1
  12. package/dist/commands/chat-command.js +1 -1
  13. package/dist/commands/claude-command.js +1 -1
  14. package/dist/commands/claude-statusline-command.js +1 -1
  15. package/dist/commands/claude-usage-command.js +1 -1
  16. package/dist/commands/command.js +1 -1
  17. package/dist/commands/connection-command.js +1 -1
  18. package/dist/commands/databases.js +1 -1
  19. package/dist/commands/delivery-command.js +1 -1
  20. package/dist/commands/describe.js +1 -1
  21. package/dist/commands/engage-campaign-pull-command.js +1 -1
  22. package/dist/commands/engage-campaign-push-command.js +1 -1
  23. package/dist/commands/engage-campaign-validate-command.js +1 -1
  24. package/dist/commands/engage-command.js +1 -1
  25. package/dist/commands/engage-template-pull-command.js +1 -1
  26. package/dist/commands/engage-template-push-command.js +1 -1
  27. package/dist/commands/engage-template-validate-command.js +1 -1
  28. package/dist/commands/job-command.js +1 -1
  29. package/dist/commands/journey-command.js +1 -1
  30. package/dist/commands/journey-validate-command.js +1 -1
  31. package/dist/commands/llm-command.js +1 -1
  32. package/dist/commands/mcp-command.js +1 -1
  33. package/dist/commands/parent-segment-command.js +1 -1
  34. package/dist/commands/policy-command.js +1 -1
  35. package/dist/commands/profile-command.js +1 -1
  36. package/dist/commands/profiles-command.js +1 -1
  37. package/dist/commands/query-command.js +1 -1
  38. package/dist/commands/schedule-command.js +1 -1
  39. package/dist/commands/segment-command.js +1 -1
  40. package/dist/commands/segment-create-command.js +1 -1
  41. package/dist/commands/segment-fields-command.js +1 -1
  42. package/dist/commands/segment-pull-command.js +1 -1
  43. package/dist/commands/segment-push-command.js +1 -1
  44. package/dist/commands/segment-update-command.js +1 -1
  45. package/dist/commands/segment-use-command.js +1 -1
  46. package/dist/commands/segment-validate-command.js +1 -1
  47. package/dist/commands/segments.js +1 -1
  48. package/dist/commands/show.js +1 -1
  49. package/dist/commands/status-command.js +1 -1
  50. package/dist/commands/tables.js +1 -1
  51. package/dist/commands/unset-command.js +1 -1
  52. package/dist/commands/upgrade-command.js +1 -1
  53. package/dist/commands/use-command.js +1 -1
  54. package/dist/commands/user-command.js +1 -1
  55. package/dist/commands/work-command.js +1 -1
  56. package/dist/commands/workflow-command.js +1 -1
  57. package/dist/core/auth.js +1 -1
  58. package/dist/core/command-output.js +1 -1
  59. package/dist/core/config.js +1 -1
  60. package/dist/core/connection-cache.js +1 -1
  61. package/dist/core/constants.js +1 -1
  62. package/dist/core/credential-cache.js +1 -1
  63. package/dist/core/global-context.js +1 -1
  64. package/dist/core/keychain.js +1 -1
  65. package/dist/core/oauth-keychain.js +1 -1
  66. package/dist/core/oauth.js +1 -1
  67. package/dist/core/profile.js +1 -1
  68. package/dist/core/project-config.js +1 -1
  69. package/dist/core/session.js +1 -1
  70. package/dist/core/user-cache.js +1 -1
  71. package/dist/core/version.js +1 -1
  72. package/dist/index.js +1 -1
  73. package/dist/mcp/server.js +1 -1
  74. package/dist/mcp/tools/index.js +1 -1
  75. package/dist/mcp/tools/tdx-run.js +1 -1
  76. package/dist/mcp/tools/tdx-search.js +1 -1
  77. package/dist/mcp/tools/work-create-item.js +1 -1
  78. package/dist/mcp/utils.js +1 -1
  79. package/dist/proxy/claude-usage-tracker.js +1 -1
  80. package/dist/proxy/passthrough-server.js +1 -1
  81. package/dist/proxy/sse-usage-parser.js +1 -1
  82. package/dist/sdk/agent/agent-config.js +1 -1
  83. package/dist/sdk/agent/agent-ref-parser.js +1 -1
  84. package/dist/sdk/agent/agent-yaml.js +1 -1
  85. package/dist/sdk/agent/test/evaluator.js +1 -1
  86. package/dist/sdk/agent/test/executor.js +1 -1
  87. package/dist/sdk/agent/test/index.js +1 -1
  88. package/dist/sdk/agent/test/output.js +1 -1
  89. package/dist/sdk/agent/test/parser.js +1 -1
  90. package/dist/sdk/agent/tool-target-registry.js +1 -1
  91. package/dist/sdk/api.js +1 -1
  92. package/dist/sdk/cas/cas-api-client.js +1 -1
  93. package/dist/sdk/cas/cas-audience-yaml.js +1 -1
  94. package/dist/sdk/cas/cas-segment-yaml.js +1 -1
  95. package/dist/sdk/cas/index.js +1 -1
  96. package/dist/sdk/cas/pull-workflow.js +1 -1
  97. package/dist/sdk/cas/push-workflow.js +1 -1
  98. package/dist/sdk/client/cdp-api-client.js +1 -1
  99. package/dist/sdk/client/delivery-api-client.js +1 -1
  100. package/dist/sdk/client/endpoints.js +1 -1
  101. package/dist/sdk/client/engage-api-client.js +1 -1
  102. package/dist/sdk/client/http-client.js +1 -1
  103. package/dist/sdk/client/llm-api-client.js +1 -1
  104. package/dist/sdk/client/oauth-refresh.js +1 -1
  105. package/dist/sdk/client/rate-limiter.js +1 -1
  106. package/dist/sdk/client/td-api-client.js +1 -1
  107. package/dist/sdk/client/trino-api-client.js +1 -1
  108. package/dist/sdk/client/workflow-client.js +1 -1
  109. package/dist/sdk/connection-validator.js +1 -1
  110. package/dist/sdk/connection.js +1 -1
  111. package/dist/sdk/delivery.js +1 -1
  112. package/dist/sdk/engage/campaign-pull.js +1 -1
  113. package/dist/sdk/engage/campaign-push.js +1 -1
  114. package/dist/sdk/engage/campaign-validator.js +1 -1
  115. package/dist/sdk/engage/campaign-yaml.js +1 -1
  116. package/dist/sdk/engage/template-pull.js +1 -1
  117. package/dist/sdk/engage/template-push.js +1 -1
  118. package/dist/sdk/engage/template-validator.js +1 -1
  119. package/dist/sdk/engage/template-yaml.js +1 -1
  120. package/dist/sdk/engage/types/campaign-def.js +1 -1
  121. package/dist/sdk/engage/types/campaign-schema.js +1 -1
  122. package/dist/sdk/engage/types/template-schema.js +1 -1
  123. package/dist/sdk/engage.js +1 -1
  124. package/dist/sdk/errors.js +1 -1
  125. package/dist/sdk/index.js +1 -1
  126. package/dist/sdk/io/index.js +1 -1
  127. package/dist/sdk/io/node-filesystem.js +1 -1
  128. package/dist/sdk/job.js +1 -1
  129. package/dist/sdk/journey.js +1 -1
  130. package/dist/sdk/llm/chat-cache.js +1 -1
  131. package/dist/sdk/llm/index.js +1 -1
  132. package/dist/sdk/llm/llm-backup-utils.js +1 -1
  133. package/dist/sdk/llm/model-factors.js +1 -1
  134. package/dist/sdk/personalization.js +1 -1
  135. package/dist/sdk/policy.js +1 -1
  136. package/dist/sdk/query/index.js +1 -1
  137. package/dist/sdk/query/sql-parser.js +1 -1
  138. package/dist/sdk/realtime.js +1 -1
  139. package/dist/sdk/schedule.js +1 -1
  140. package/dist/sdk/segment/child-segment-yaml.js +1 -1
  141. package/dist/sdk/segment/fields-display.js +1 -1
  142. package/dist/sdk/segment/file-discovery.js +1 -1
  143. package/dist/sdk/segment/journey-utils.js +1 -1
  144. package/dist/sdk/segment/journey-validator.js +1 -1
  145. package/dist/sdk/segment/journey-yaml.js +1 -1
  146. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  147. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  148. package/dist/sdk/segment/pull-workflow.js +1 -1
  149. package/dist/sdk/segment/push-recovery.js +1 -1
  150. package/dist/sdk/segment/push-workflow.js +1 -1
  151. package/dist/sdk/segment/resolution-context.js +1 -1
  152. package/dist/sdk/segment/segment-path-parser.js +1 -1
  153. package/dist/sdk/segment/segment-ref-parser.js +1 -1
  154. package/dist/sdk/segment/segment-validator.js +1 -1
  155. package/dist/sdk/segment/target-resolution.js +1 -1
  156. package/dist/sdk/segment/tdx-config.js +1 -1
  157. package/dist/sdk/segment/types/activation-schema.js +1 -1
  158. package/dist/sdk/segment/types/journey-def.js +1 -1
  159. package/dist/sdk/segment/types/journey-schema.js +1 -1
  160. package/dist/sdk/segment/types/segment-def.js +1 -1
  161. package/dist/sdk/segment/types/segment-schema.js +1 -1
  162. package/dist/sdk/segment/validate-files.js +1 -1
  163. package/dist/sdk/segment/yaml-validator.js +1 -1
  164. package/dist/sdk/segment.js +1 -1
  165. package/dist/sdk/types/index.js +1 -1
  166. package/dist/sdk/types/progress.js +1 -1
  167. package/dist/sdk/types/workspace.js +1 -1
  168. package/dist/sdk/user.js +1 -1
  169. package/dist/sdk/util/format-detector.js +1 -1
  170. package/dist/sdk/util/formatters.js +1 -1
  171. package/dist/sdk/util/index.js +1 -1
  172. package/dist/sdk/util/paginate.js +1 -1
  173. package/dist/sdk/util/tree-formatter.js +1 -1
  174. package/dist/sdk/workflow/archive-validation.js +1 -1
  175. package/dist/sdk/workflow/clone-workflow.js +1 -1
  176. package/dist/sdk/workflow/index.js +1 -1
  177. package/dist/sdk/workflow/pull-workflow.js +1 -1
  178. package/dist/sdk/workflow/push-workflow.js +1 -1
  179. package/dist/sdk/workflow/tdx-config.js +1 -1
  180. package/dist/sdk/workflow/workflow-utils.js +1 -1
  181. package/dist/sdk/workspace/frontmatter.js +1 -1
  182. package/dist/sdk/workspace/git.js +1 -1
  183. package/dist/sdk/workspace/index.js +1 -1
  184. package/dist/sdk/workspace/templates.js +1 -1
  185. package/dist/sdk/workspace/weekly.js +1 -1
  186. package/dist/sdk/workspace/wikilinks.js +1 -1
  187. package/dist/test-utils/command-runner.js +1 -1
  188. package/dist/test-utils/factories.js +1 -1
  189. package/dist/test-utils/fixtures.js +1 -1
  190. package/dist/test-utils/http-mock.js +1 -1
  191. package/dist/test-utils/index.js +1 -1
  192. package/dist/utils/async.js +1 -1
  193. package/dist/utils/colors.js +1 -1
  194. package/dist/utils/diff.js +1 -1
  195. package/dist/utils/file-permissions.js +1 -1
  196. package/dist/utils/file-reader.js +1 -1
  197. package/dist/utils/github-releases.js +1 -1
  198. package/dist/utils/global-cache.js +1 -1
  199. package/dist/utils/json-loader.js +1 -1
  200. package/dist/utils/local-cache.js +1 -1
  201. package/dist/utils/logger/formatters/default-formatter.js +1 -1
  202. package/dist/utils/logger/formatters/index.js +1 -1
  203. package/dist/utils/logger/handlers/console-handler.js +1 -1
  204. package/dist/utils/logger/handlers/file-handler.js +1 -1
  205. package/dist/utils/logger/handlers/index.js +1 -1
  206. package/dist/utils/logger/handlers/null-handler.js +1 -1
  207. package/dist/utils/logger/index.js +1 -1
  208. package/dist/utils/logger/logger.js +1 -1
  209. package/dist/utils/logger/types.js +1 -1
  210. package/dist/utils/option-validation.js +1 -1
  211. package/dist/utils/process.js +1 -1
  212. package/dist/utils/prompt.js +1 -1
  213. package/dist/utils/spinner.js +1 -1
  214. package/dist/utils/sse-parser.js +1 -1
  215. package/dist/utils/string-utils.js +1 -1
  216. package/dist/utils/table-ref-parser.js +1 -1
  217. package/dist/utils/tdx-logger.js +1 -1
  218. package/dist/utils/version-check.js +1 -1
  219. package/package.json +1 -1
@@ -1 +1 @@
1
- const a142_0x543f86=a142_0x1ce0;(function(_0x3eec58,_0x5dc46a){const _0x519420=a142_0x1ce0,_0x4b7ba3=_0x3eec58();while(!![]){try{const _0x5e5a20=-parseInt(_0x519420(0x82))/0x1*(parseInt(_0x519420(0xff))/0x2)+parseInt(_0x519420(0x114))/0x3+parseInt(_0x519420(0x96))/0x4*(-parseInt(_0x519420(0x8e))/0x5)+-parseInt(_0x519420(0x11c))/0x6*(parseInt(_0x519420(0xf9))/0x7)+parseInt(_0x519420(0x117))/0x8+-parseInt(_0x519420(0xe6))/0x9+parseInt(_0x519420(0xca))/0xa;if(_0x5e5a20===_0x5dc46a)break;else _0x4b7ba3['push'](_0x4b7ba3['shift']());}catch(_0xa63b3f){_0x4b7ba3['push'](_0x4b7ba3['shift']());}}}(a142_0x428c,0xb1d56));function a142_0x428c(){const _0x30ed88=['behavior','type','nested_workflow_name','any','Unknown\x20email\x20recipient:\x20','usedNames','JOURNEY_SYNTAX_ERROR','connectorConfig','connection','has','Equal','ruleHashToName','rule','CountDistinct','from','All','INVALID_ARGUMENT','unit','\x0a\x0aAvailable\x20fields:\x0a','startAt','daily','not','Segment\x20description','activations:','61959GAxhrk','Invalid\x20condition\x20in\x20embedded\x20segment\x20\x27','monthly','join_row','minute','hourly','leftValue','runAfterJourneyRefresh','timeWindow','description','null','lock_enabled','5534545CpFePf','operator','segmentFolderId','repeatFrequency','set','isFinite','Value','minValue','4PsTxul','week','include','connectionNameToIdMap','conditions','all_columns','Please\x20specify\x20a\x20valid\x20attribute\x20name.','orderColumn','length','limit','resolveSegmentName','exclude','get','behavior_table','warn','string','notification','repeat_unit','weekly','repeatSubFrequency','Column','groupingColumns','TimeWithinNext','sort','Last','all','connectionId','syndicationBehavior','Invalid\x20connector_config\x20for\x20activation\x20\x22','\x22\x20has\x20unrecognized\x20fields\x20(will\x20be\x20ignored):\x0a','forEach','allColumns','Use\x20\x27tdx\x20connections\x27\x20to\x20list\x20available\x20connections','repeat_frequency','toLowerCase','nestedWorkflowProjectName','min','keys','arrayMatching','connector_config\x20for\x20activation\x20\x22','join','rule:','duration','replace','CONNECTION_NOT_FOUND','emailRecipients','New\x20Segment','activationTemplateId','Count','join_strategy','stringify','reverse','36945870SOzhWO','attribute','visible','add','column','max','getSchema','Unknown\x20connection:\x20','realtime','joinStrategy','Behavior','map','Warning:\x20activation\x20\x22','Reference','name','repeat_sub_frequency','source','start_at','lockEnabled','joinRow','entries','activations','valid','].attribute\x20cannot\x20be\x20empty.\x0a','scheduleOption','\x27:\x20','batch','nestedWorkflowName','1785366vvAvkX','isArray','filter','segment','TimeWithinPast','behaviorTableName','value','end_on','folder','schedule','object','isVisible','month','errors','connector_config','connectionNameToTypeMap','every','\x22:\x0a','\x20\x20-\x20\x22','3241wUmorD','rightValue','notifyOn','rightValues','orderBy','shape','40JPxLNa','values','.\x20Use\x20\x27tdx\x20user\x20list\x27\x20to\x20see\x20valid\x20emails.','attribute_name','timezone','kind','notify_on','cron','activationParams','nested_workflow_project_name','activation_template_id','visibility','repeatUnit','order_by','run_after_journey_refresh','localeCompare','email_recipients','minutes_interval','maxValue','And','push','659442xVaIym','localRuleToName','TimeRange','4290720JKTDBA','scheduleType','First','columns','aggregation','15264LTMAQf','hour','CONNECTOR_SCHEMA_NOT_FOUND','formatting','attributes','endOn','none'];a142_0x428c=function(){return _0x30ed88;};return a142_0x428c();}import*as a142_0x165285 from'yaml';import{safeParseYaml}from'./yaml-validator.js';import{SDKError,ErrorCode}from'../errors.js';import{validateConnectorConfig,transformConfigToLegacy,normalizeConnectorConfigForYaml,formatValidationErrors,formatValidationWarnings,formatSchemaAsHelp}from'../connection-validator.js';import{SegmentDefSchema}from'./types/segment-schema.js';import{ActivationDefSchema}from'./types/activation-schema.js';const SCHEDULE_TYPE_TO_REPEAT_UNIT={'daily':'day','hourly':a142_0x543f86(0x11d),'weekly':a142_0x543f86(0x97),'monthly':a142_0x543f86(0xf2),'minutes_interval':a142_0x543f86(0x86)},REPEAT_UNIT_TO_SCHEDULE_TYPE={'day':a142_0x543f86(0x7e),'hour':a142_0x543f86(0x87),'week':a142_0x543f86(0xa8),'month':a142_0x543f86(0x84),'minute':a142_0x543f86(0x110)};function filterRuleAsRuleDef(_0x41350c){return _0x41350c;}function ruleDefAsFilterRule(_0x276948){return _0x276948;}export function segmentResponseToDefSync(_0x4f060c,_0x2a40b2){const _0x30beb0=a142_0x543f86,_0x585bb6=_0x4f060c[_0x30beb0(0x76)]&&'type'in _0x4f060c['rule']&&_0x4f060c[_0x30beb0(0x76)][_0x30beb0(0x124)];return{'type':_0x30beb0(0xe9),'name':_0x4f060c[_0x30beb0(0xd8)],..._0x4f060c[_0x30beb0(0x8b)]&&{'description':_0x4f060c[_0x30beb0(0x8b)]},..._0x2a40b2&&{'folder':_0x2a40b2},..._0x585bb6&&{'rule':apiRuleToYaml(_0x4f060c['rule'])},..._0x4f060c[_0x30beb0(0x104)]!==undefined&&{'kind':_0x4f060c[_0x30beb0(0x104)]===0x0?_0x30beb0(0xe4):_0x4f060c['kind']===0x1?_0x30beb0(0xd2):'funnel_stage'},..._0x4f060c[_0x30beb0(0xf1)]!==undefined&&{'visible':_0x4f060c['isVisible']}};}export async function segmentResponseToDef(_0x107d70,_0x4f2c39,_0x4b33b8){const _0x28ccb7=a142_0x543f86,_0x266669=segmentResponseToDefSync(_0x107d70,_0x4b33b8);if(!_0x4f2c39||!_0x4f2c39[_0x28ccb7(0xa0)])return _0x266669;return _0x266669[_0x28ccb7(0x76)]&&(_0x266669[_0x28ccb7(0x76)]=await resolveRuleSegmentRefs(_0x266669[_0x28ccb7(0x76)],_0x4f2c39[_0x28ccb7(0xa0)])),_0x266669;}export function apiRuleToYaml(_0x29f81f){const _0xdc947f=a142_0x543f86,_0x3c4285=(_0x29f81f['conditions']||[])['flatMap'](_0x22f31c=>{const _0x49a52b=a142_0x1ce0,_0x649734=apiConditionToYaml(_0x22f31c);if(isCompositeType(_0x649734)&&_0x649734[_0x49a52b(0x8b)]!==undefined){const _0x45622f=_0x649734;if(_0x45622f['conditions'][_0x49a52b(0x9e)]===0x1)return _0x45622f[_0x49a52b(0x9a)];return[{'type':_0x45622f[_0x49a52b(0x124)],'conditions':_0x45622f[_0x49a52b(0x9a)]}];}return[_0x649734];});if(_0x3c4285[_0xdc947f(0x9e)]===0x1&&!_0x29f81f['description']&&isCompositeType(_0x3c4285[0x0])){const _0x2c76d8=_0x3c4285[0x0];if(_0x2c76d8[_0xdc947f(0x124)]===_0x29f81f[_0xdc947f(0x124)]&&_0x2c76d8[_0xdc947f(0x9a)]&&_0x2c76d8[_0xdc947f(0x8b)]===undefined)return{'type':_0x29f81f[_0xdc947f(0x124)],'conditions':_0x2c76d8[_0xdc947f(0x9a)]};}return{'type':_0x29f81f['type'],'conditions':_0x3c4285};}export async function resolveRuleSegmentRefs(_0x4d1ad0,_0x82facf){return transformRuleSegmentRefs(_0x4d1ad0,_0x82facf,_0x530cf3=>/^\d+$/['test'](_0x530cf3));}async function transformConditionSegmentRefs(_0x119d7a,_0x22f2d0,_0x48e215,_0xe695f6){const _0x3f2ac3=a142_0x543f86;if('segment'in _0x119d7a&&(_0x119d7a[_0x3f2ac3(0x124)]===_0x3f2ac3(0x98)||_0x119d7a[_0x3f2ac3(0x124)]===_0x3f2ac3(0xa1))){const _0xf909cd=_0x119d7a;if(_0x48e215(_0xf909cd[_0x3f2ac3(0xe9)]))return{..._0xf909cd,'segment':await _0x22f2d0(_0xf909cd[_0x3f2ac3(0xe9)])};return _0x119d7a;}if(_0x3f2ac3(0x9a)in _0x119d7a&&_0x119d7a[_0x3f2ac3(0x9a)]){const _0x577677=_0x119d7a,_0x2d1be4=await Promise[_0x3f2ac3(0xaf)](_0x577677[_0x3f2ac3(0x9a)][_0x3f2ac3(0xd5)](_0x126997=>transformConditionSegmentRefs(_0x126997,_0x22f2d0,_0x48e215,_0xe695f6)));return{..._0x577677,'conditions':_0x2d1be4};}if('filter'in _0x119d7a&&_0x119d7a[_0x3f2ac3(0xe8)]){const _0x1ad1f9=_0x119d7a,_0x56717d=await _0xe695f6(filterRuleAsRuleDef(_0x1ad1f9[_0x3f2ac3(0xe8)]),_0x22f2d0);return{..._0x1ad1f9,'filter':ruleDefAsFilterRule(_0x56717d)};}return _0x119d7a;}async function transformRuleSegmentRefs(_0x438146,_0x541346,_0x258848){const _0x2d2e05=a142_0x543f86,_0x3100c6=(_0x48cca4,_0x256d06)=>transformRuleSegmentRefs(_0x48cca4,_0x256d06,_0x258848),_0x23799=await Promise[_0x2d2e05(0xaf)](_0x438146[_0x2d2e05(0x9a)]['map'](_0x26d4b8=>transformConditionSegmentRefs(_0x26d4b8,_0x541346,_0x258848,_0x3100c6)));return{..._0x438146,'conditions':_0x23799};}export async function resolveRuleSegmentIds(_0x2053c9,_0x302541){return transformRuleSegmentRefs(_0x2053c9,_0x302541,_0x121fb9=>!/^\d+$/['test'](_0x121fb9));}function isCompositeType(_0x126cbc){const _0x1fd80a=a142_0x543f86;return _0x126cbc[_0x1fd80a(0x124)]===_0x1fd80a(0x112)||_0x126cbc['type']==='Or';}function isBehaviorApiCondition(_0x57d8e1){const _0x5856a6=a142_0x543f86;if(!_0x57d8e1[_0x5856a6(0x88)]?.[_0x5856a6(0xda)]?.[_0x5856a6(0xd8)])return![];return!![];}function apiConditionToYaml(_0x49b16f){const _0x4db5ca=a142_0x543f86;if(_0x49b16f[_0x4db5ca(0x124)]===_0x4db5ca(0x112)||_0x49b16f[_0x4db5ca(0x124)]==='Or'){if(_0x49b16f[_0x4db5ca(0x9a)]){const _0x73a110=_0x49b16f[_0x4db5ca(0x9a)][_0x4db5ca(0xd5)](apiConditionToYaml),_0x369e90=_0x49b16f[_0x4db5ca(0x8b)]!==undefined;if(_0x73a110[_0x4db5ca(0x9e)]===0x1&&!_0x369e90)return _0x73a110[0x0];return{'type':_0x49b16f[_0x4db5ca(0x124)],'conditions':_0x73a110,..._0x49b16f[_0x4db5ca(0x8b)]!==undefined&&{'description':_0x49b16f[_0x4db5ca(0x8b)]}};}}if(_0x49b16f['type']==='Value'&&_0x49b16f[_0x4db5ca(0x88)]&&_0x49b16f[_0x4db5ca(0x8f)]){const _0x46607f=_0x49b16f[_0x4db5ca(0x88)][_0x4db5ca(0x11b)]?buildAggregationDefFromApi(_0x49b16f['leftValue']['aggregation']):undefined;if(isBehaviorApiCondition(_0x49b16f)){const _0x33af2c=_0x49b16f['leftValue'][_0x4db5ca(0xda)][_0x4db5ca(0xd8)];return{'type':_0x4db5ca(0xd4),'attribute':'','operator':apiOperatorToYaml(_0x49b16f[_0x4db5ca(0x8f)]),..._0x49b16f['arrayMatching']&&_0x49b16f[_0x4db5ca(0xbc)]!==_0x4db5ca(0x126)?{'arrayMatching':_0x49b16f['arrayMatching']}:{},..._0x49b16f[_0x4db5ca(0xa1)]?{'exclude':_0x49b16f[_0x4db5ca(0xa1)]}:{},..._0x46607f?{'aggregation':_0x46607f}:{},'source':_0x33af2c,..._0x49b16f['leftValue'][_0x4db5ca(0xe8)]?{'filter':apiRuleToYaml(_0x49b16f[_0x4db5ca(0x88)][_0x4db5ca(0xe8)])}:{},..._0x49b16f[_0x4db5ca(0x9f)]!==undefined&&_0x49b16f[_0x4db5ca(0x9f)]!==null?{'limit':_0x49b16f[_0x4db5ca(0x9f)]}:{}};}return{'type':_0x4db5ca(0x94),'attribute':_0x49b16f[_0x4db5ca(0x88)][_0x4db5ca(0xd8)]||'','operator':apiOperatorToYaml(_0x49b16f[_0x4db5ca(0x8f)]),..._0x49b16f[_0x4db5ca(0xbc)]&&_0x49b16f[_0x4db5ca(0xbc)]!==_0x4db5ca(0x126)?{'arrayMatching':_0x49b16f[_0x4db5ca(0xbc)]}:{},..._0x49b16f['exclude']?{'exclude':_0x49b16f[_0x4db5ca(0xa1)]}:{},..._0x46607f?{'aggregation':_0x46607f}:{},..._0x49b16f['leftValue'][_0x4db5ca(0xe8)]?{'filter':apiRuleToYaml(_0x49b16f[_0x4db5ca(0x88)][_0x4db5ca(0xe8)])}:{},..._0x49b16f['limit']!==undefined&&_0x49b16f['limit']!==null?{'limit':_0x49b16f['limit']}:{}};}if(_0x49b16f['type']===_0x4db5ca(0xaa)&&_0x49b16f[_0x4db5ca(0xce)]&&_0x49b16f['operator'])return{'type':'Column','column':_0x49b16f[_0x4db5ca(0xce)],'operator':apiOperatorToYaml(_0x49b16f[_0x4db5ca(0x8f)])};if(_0x49b16f['type']===_0x4db5ca(0xd7)&&_0x49b16f['id'])return{'type':_0x49b16f[_0x4db5ca(0xa1)]?_0x4db5ca(0xa1):_0x4db5ca(0x98),'segment':_0x49b16f['id']};return{'type':_0x4db5ca(0x112),'conditions':[]};}function isTemporalOperator(_0x43b298){const _0x312749=a142_0x543f86;return _0x43b298===_0x312749(0xea)||_0x43b298===_0x312749(0xac);}function isBetweenOperator(_0x16f50c){return _0x16f50c==='Between';}function getEffectiveValue(_0x5a4cbe){const _0x47677e=a142_0x543f86,_0x35c06d=_0x5a4cbe['values'];return _0x5a4cbe[_0x47677e(0xec)]??_0x35c06d;}function parseNumericValue(_0x29b7fa){const _0x472219=a142_0x543f86;if(typeof _0x29b7fa===_0x472219(0xf0)&&_0x29b7fa!==null)return _0x29b7fa;if(_0x29b7fa==='')return _0x29b7fa;const _0x5a1e3a=Number(_0x29b7fa);return Number[_0x472219(0x93)](_0x5a1e3a)?_0x5a1e3a:_0x29b7fa;}function apiOperatorToYaml(_0x2025eb){const _0x57ee84=a142_0x543f86;if(isBetweenOperator(_0x2025eb[_0x57ee84(0x124)]))return{'type':mapApiOperatorType(_0x2025eb['type']),..._0x2025eb[_0x57ee84(0x7f)]!==undefined&&{'not':_0x2025eb['not']},..._0x2025eb['minValue']!==undefined&&{'min':parseNumericValue(_0x2025eb[_0x57ee84(0x95)])},..._0x2025eb['maxValue']!==undefined&&{'max':parseNumericValue(_0x2025eb['maxValue'])}};if(_0x2025eb[_0x57ee84(0x124)]===_0x57ee84(0x116))return{'type':_0x57ee84(0x116),..._0x2025eb['not']!==undefined&&{'not':_0x2025eb[_0x57ee84(0x7f)]},..._0x2025eb[_0x57ee84(0xc0)]!==undefined&&{'duration':_0x2025eb[_0x57ee84(0xc0)]},..._0x2025eb[_0x57ee84(0x78)]!==undefined&&{'from':_0x2025eb['from']},..._0x2025eb[_0x57ee84(0xc9)]!==undefined&&{'reverse':_0x2025eb[_0x57ee84(0xc9)]}};let _0x2d04df;if(_0x2025eb['rightValues']&&_0x2025eb[_0x57ee84(0xfc)]['length']>0x0)_0x2d04df=_0x2025eb[_0x57ee84(0xfc)];else{if(_0x2025eb[_0x57ee84(0xfa)]!==undefined)_0x2d04df=_0x2025eb[_0x57ee84(0xfa)];else isTemporalOperator(_0x2025eb[_0x57ee84(0x124)])&&_0x2025eb[_0x57ee84(0xec)]!==undefined&&(_0x2d04df=_0x2025eb[_0x57ee84(0xec)]);}return{'type':mapApiOperatorType(_0x2025eb[_0x57ee84(0x124)]),..._0x2025eb['not']!==undefined&&{'not':_0x2025eb[_0x57ee84(0x7f)]},..._0x2d04df!==undefined&&{'value':_0x2d04df},..._0x2025eb[_0x57ee84(0x7b)]!==undefined&&{'unit':_0x2025eb[_0x57ee84(0x7b)]}};}function mapApiOperatorType(_0xbdde62){return _0xbdde62;}export function segmentDefToCreateRequest(_0x149bc8,_0xe5feb2){const _0x5df4a2=a142_0x543f86,_0x9eb973={'name':_0x149bc8[_0x5df4a2(0xd8)]};return _0x149bc8[_0x5df4a2(0x8b)]&&(_0x9eb973[_0x5df4a2(0x8b)]=_0x149bc8[_0x5df4a2(0x8b)]),_0x149bc8[_0x5df4a2(0x76)]&&(_0x9eb973['rule']=yamlRuleToApi(_0x149bc8[_0x5df4a2(0x76)])),_0x149bc8[_0x5df4a2(0x104)]&&(_0x9eb973[_0x5df4a2(0x104)]=_0x149bc8[_0x5df4a2(0x104)]===_0x5df4a2(0xe4)?0x0:_0x149bc8[_0x5df4a2(0x104)]===_0x5df4a2(0xd2)?0x1:0x2),_0x149bc8[_0x5df4a2(0xcc)]!==undefined&&(_0x9eb973[_0x5df4a2(0xf1)]=_0x149bc8[_0x5df4a2(0xcc)]),_0xe5feb2&&(_0x9eb973[_0x5df4a2(0x90)]=_0xe5feb2),_0x9eb973;}export function segmentDefToUpdateRequest(_0xe126d3){const _0x19c3c0=a142_0x543f86,_0x5be225={'name':_0xe126d3[_0x19c3c0(0xd8)]};return _0xe126d3['description']!==undefined&&(_0x5be225[_0x19c3c0(0x8b)]=_0xe126d3['description']),_0xe126d3['rule']&&(_0x5be225[_0x19c3c0(0x76)]=yamlRuleToApi(_0xe126d3['rule'])),_0xe126d3[_0x19c3c0(0x104)]&&(_0x5be225[_0x19c3c0(0x104)]=_0xe126d3[_0x19c3c0(0x104)]===_0x19c3c0(0xe4)?0x0:_0xe126d3[_0x19c3c0(0x104)]===_0x19c3c0(0xd2)?0x1:0x2),_0x5be225;}export function yamlRuleToApi(_0x17bab0){const _0x1ca8bb=a142_0x543f86,_0x175492=_0x17bab0[_0x1ca8bb(0x9a)][_0x1ca8bb(0xd5)](yamlConditionToApi),_0xc605b6=_0x175492['every'](_0x11b9fe=>isCompositeType(_0x11b9fe)&&_0x11b9fe[_0x1ca8bb(0x8b)]!==undefined);if(!_0xc605b6&&_0x175492['length']>0x0){const _0x51aa74=[];for(const _0x53561c of _0x175492){isCompositeType(_0x53561c)&&_0x53561c[_0x1ca8bb(0x8b)]===undefined&&_0x53561c['conditions']&&_0x53561c[_0x1ca8bb(0x9a)][_0x1ca8bb(0xf6)](_0xf9daf1=>!isCompositeType(_0xf9daf1))?_0x51aa74['push']({'type':_0x53561c[_0x1ca8bb(0x124)],'description':'','conditions':_0x53561c['conditions']}):_0x51aa74['push']({'type':_0x1ca8bb(0x112),'description':_0x17bab0[_0x1ca8bb(0x8b)]||'','conditions':[_0x53561c]});}return{'type':_0x17bab0[_0x1ca8bb(0x124)],'conditions':_0x51aa74};}return{'type':_0x17bab0[_0x1ca8bb(0x124)],'conditions':_0x175492,..._0x17bab0[_0x1ca8bb(0x8b)]&&{'description':_0x17bab0[_0x1ca8bb(0x8b)]}};}function yamlFilterRuleToApi(_0x144f2c){const _0x276506=a142_0x543f86,_0x1c51b2=_0x144f2c[_0x276506(0x9a)][_0x276506(0xd5)](yamlConditionToApi);return{'type':_0x144f2c['type'],'conditions':_0x1c51b2};}function yamlConditionToApi(_0x28ae4a){const _0x56e0c2=a142_0x543f86;if(_0x56e0c2(0xe9)in _0x28ae4a&&(_0x28ae4a[_0x56e0c2(0x124)]===_0x56e0c2(0x98)||_0x28ae4a['type']===_0x56e0c2(0xa1))){const _0x2b065f=_0x28ae4a;return{'type':'Reference','id':_0x2b065f['segment'],'exclude':_0x2b065f[_0x56e0c2(0x124)]===_0x56e0c2(0xa1)};}if(_0x28ae4a[_0x56e0c2(0x124)]===_0x56e0c2(0x112)||_0x28ae4a['type']==='Or'){const _0x594ac6=_0x28ae4a;return{'type':_0x594ac6[_0x56e0c2(0x124)],'conditions':_0x594ac6[_0x56e0c2(0x9a)][_0x56e0c2(0xd5)](yamlConditionToApi),..._0x594ac6[_0x56e0c2(0x8b)]&&{'description':_0x594ac6[_0x56e0c2(0x8b)]}};}if(_0x56e0c2(0xce)in _0x28ae4a&&_0x28ae4a['type']===_0x56e0c2(0xaa)){const _0x25645c=_0x28ae4a;return{'type':'Column','column':_0x25645c[_0x56e0c2(0xce)],'operator':yamlOperatorToApi(_0x25645c['operator'])};}const _0x214e19=_0x28ae4a,_0x2c9fde={'type':_0x56e0c2(0x94),'leftValue':buildLeftValue(_0x214e19),'operator':yamlOperatorToApi(_0x214e19['operator']),'exclude':_0x214e19['exclude']??![],'arrayMatching':_0x214e19[_0x56e0c2(0xbc)]??_0x56e0c2(0x126)};return _0x214e19[_0x56e0c2(0x9f)]!==undefined&&(_0x2c9fde[_0x56e0c2(0x9f)]=_0x214e19['limit']),_0x2c9fde;}function buildAggregationDefFromApi(_0x58c2e6){const _0x4d9899=a142_0x543f86,_0x3031d1=_0x58c2e6[_0x4d9899(0x124)];if(_0x3031d1==='CountDistinct')return{'type':_0x3031d1,'columns':_0x58c2e6[_0x4d9899(0x11a)]??[]};if(_0x3031d1==='First'||_0x3031d1===_0x4d9899(0xae))return{'type':_0x3031d1,'column':_0x58c2e6[_0x4d9899(0xce)]??'','orderColumn':_0x58c2e6[_0x4d9899(0x9d)]??'',..._0x58c2e6[_0x4d9899(0xab)]&&{'groupingColumns':_0x58c2e6[_0x4d9899(0xab)]}};if(_0x3031d1==='Count')return{'type':_0x3031d1,..._0x58c2e6[_0x4d9899(0xab)]&&{'groupingColumns':_0x58c2e6[_0x4d9899(0xab)]}};return{'type':_0x3031d1,'column':_0x58c2e6[_0x4d9899(0xce)]??'',..._0x58c2e6[_0x4d9899(0xab)]&&{'groupingColumns':_0x58c2e6['groupingColumns']}};}function buildLeftValue(_0x4f0e24){const _0x5c2bd2=a142_0x543f86,_0x5cfbed={};_0x4f0e24[_0x5c2bd2(0xcb)]&&_0x4f0e24['type']!==_0x5c2bd2(0xd4)&&(_0x5cfbed[_0x5c2bd2(0xd8)]=_0x4f0e24[_0x5c2bd2(0xcb)]);if(_0x4f0e24['aggregation']){const _0xeb289=_0x4f0e24[_0x5c2bd2(0x11b)];if(_0xeb289[_0x5c2bd2(0x124)]===_0x5c2bd2(0x77))_0x5cfbed[_0x5c2bd2(0x11b)]={'type':'CountDistinct','columns':_0xeb289[_0x5c2bd2(0x11a)]};else{if(_0xeb289[_0x5c2bd2(0x124)]===_0x5c2bd2(0x119)||_0xeb289[_0x5c2bd2(0x124)]===_0x5c2bd2(0xae))_0x5cfbed[_0x5c2bd2(0x11b)]={'type':_0xeb289[_0x5c2bd2(0x124)],'column':_0xeb289[_0x5c2bd2(0xce)],'orderColumn':_0xeb289[_0x5c2bd2(0x9d)],..._0xeb289['groupingColumns']&&{'groupingColumns':_0xeb289['groupingColumns']}};else _0xeb289['type']===_0x5c2bd2(0xc6)?_0x5cfbed[_0x5c2bd2(0x11b)]={'type':_0x5c2bd2(0xc6),..._0xeb289[_0x5c2bd2(0xab)]&&{'groupingColumns':_0xeb289[_0x5c2bd2(0xab)]}}:_0x5cfbed[_0x5c2bd2(0x11b)]={'type':_0xeb289[_0x5c2bd2(0x124)],'column':_0xeb289[_0x5c2bd2(0xce)],..._0xeb289[_0x5c2bd2(0xab)]&&{'groupingColumns':_0xeb289[_0x5c2bd2(0xab)]}};}}return _0x4f0e24['source']&&(_0x5cfbed[_0x5c2bd2(0xda)]={'name':_0x4f0e24[_0x5c2bd2(0xda)]}),_0x4f0e24[_0x5c2bd2(0xe8)]&&(_0x5cfbed[_0x5c2bd2(0xe8)]=yamlFilterRuleToApi(filterRuleAsRuleDef(_0x4f0e24['filter']))),_0x5cfbed;}function yamlOperatorToApi(_0x45fe87){const _0x2d8976=a142_0x543f86,_0x3648e3={'type':mapYamlOperatorType(_0x45fe87[_0x2d8976(0x124)]),'not':_0x45fe87[_0x2d8976(0x7f)]??![]};if(isBetweenOperator(_0x45fe87[_0x2d8976(0x124)]))return _0x45fe87[_0x2d8976(0xba)]!==undefined&&(_0x3648e3[_0x2d8976(0x95)]=typeof _0x45fe87[_0x2d8976(0xba)]==='object'?_0x45fe87[_0x2d8976(0xba)]:String(_0x45fe87[_0x2d8976(0xba)])),_0x45fe87['max']!==undefined&&(_0x3648e3[_0x2d8976(0x111)]=typeof _0x45fe87[_0x2d8976(0xcf)]==='object'?_0x45fe87[_0x2d8976(0xcf)]:String(_0x45fe87[_0x2d8976(0xcf)])),_0x3648e3;if(_0x45fe87['type']==='TimeRange')return _0x45fe87[_0x2d8976(0xc0)]&&(_0x3648e3['duration']=_0x45fe87[_0x2d8976(0xc0)]),_0x45fe87[_0x2d8976(0x78)]&&(_0x3648e3['from']=_0x45fe87[_0x2d8976(0x78)]),_0x45fe87[_0x2d8976(0xc9)]!==undefined&&(_0x3648e3['reverse']=_0x45fe87['reverse']),_0x3648e3;const _0x101a79=getEffectiveValue(_0x45fe87);if(_0x101a79!==undefined){if(Array[_0x2d8976(0xe7)](_0x101a79))_0x3648e3[_0x2d8976(0xfc)]=_0x101a79;else isTemporalOperator(_0x45fe87['type'])?_0x3648e3[_0x2d8976(0xec)]=_0x101a79:_0x3648e3['rightValue']=_0x101a79;}return _0x45fe87[_0x2d8976(0x7b)]&&(_0x3648e3[_0x2d8976(0x7b)]=_0x45fe87[_0x2d8976(0x7b)]),_0x3648e3;}function mapYamlOperatorType(_0x1e67ce){return _0x1e67ce;}export function toYamlString(_0x225be3){const _0x30ec3f=a142_0x543f86,_0x169170=JSON['parse'](JSON[_0x30ec3f(0xc8)](_0x225be3)),_0x441d18=a142_0x165285[_0x30ec3f(0xc8)](_0x169170,{'indent':0x2,'lineWidth':0x0,'nullStr':_0x30ec3f(0x8c)}),_0x584fc8=[_0x30ec3f(0xbf)];let _0x5213ac=_0x441d18;for(const _0x49b387 of _0x584fc8){_0x5213ac=_0x5213ac[_0x30ec3f(0xc1)](new RegExp('^('+_0x49b387+')','m'),(_0xf7e48f,_0x34b4a8,_0x135d5c)=>{if(_0x135d5c===0x0||_0x5213ac[_0x135d5c-0x1]==='\x0a'&&_0x5213ac[_0x135d5c-0x2]==='\x0a')return _0x34b4a8;return'\x0a'+_0x34b4a8;});}return _0x5213ac;}export function parseYamlString(_0x4184d0){return parseSegmentYamlFile(_0x4184d0);}export function isSegmentYaml(_0x40f72d){const _0x2349b4=a142_0x543f86;if(typeof _0x40f72d!==_0x2349b4(0xf0)||_0x40f72d===null)return![];const _0x18885e=_0x40f72d;return _0x18885e[_0x2349b4(0x124)]==='segment'||_0x18885e['type']===undefined;}export function generateTemplate(_0x3c890c=a142_0x543f86(0xc4)){const _0x3fcb4a=a142_0x543f86,_0x4731a3={'type':_0x3fcb4a(0xe9),'name':_0x3c890c,'description':_0x3fcb4a(0x80),'rule':{'type':_0x3fcb4a(0x112),'conditions':[{'type':'Value','attribute':_0x3fcb4a(0x102),'operator':{'type':_0x3fcb4a(0x74),'value':_0x3fcb4a(0xec)}}]}};return toYamlString(_0x4731a3);}export function segmentToYamlString(_0x540bf5){const _0x1b3812=a142_0x543f86,_0x546972=JSON['parse'](JSON[_0x1b3812(0xc8)](_0x540bf5)),_0x5e9f98=a142_0x165285[_0x1b3812(0xc8)](_0x546972,{'indent':0x2,'lineWidth':0x0,'nullStr':_0x1b3812(0x8c)}),_0x3cfd78=['rule:',_0x1b3812(0x81)];let _0x555e87=_0x5e9f98;for(const _0x3a7296 of _0x3cfd78){_0x555e87=_0x555e87[_0x1b3812(0xc1)](new RegExp('^('+_0x3a7296+')','m'),(_0x1aaa15,_0x3be1bc,_0xb77be9)=>{if(_0xb77be9===0x0||_0x555e87[_0xb77be9-0x1]==='\x0a'&&_0x555e87[_0xb77be9-0x2]==='\x0a')return _0x3be1bc;return'\x0a'+_0x3be1bc;});}return _0x555e87;}export function parseSegmentYamlFile(_0x2a48c7){return safeParseYaml(_0x2a48c7,SegmentDefSchema);}export function normalizeChildSegmentYaml(_0x54521b){const _0x2db5c4=a142_0x543f86;return{'type':_0x2db5c4(0xe9),'name':_0x54521b[_0x2db5c4(0xd8)],..._0x54521b[_0x2db5c4(0x8b)]!==undefined&&{'description':_0x54521b['description']},..._0x54521b[_0x2db5c4(0xee)]!==undefined&&{'folder':_0x54521b[_0x2db5c4(0xee)]},..._0x54521b[_0x2db5c4(0x76)]&&{'rule':normalizeRule(_0x54521b['rule'])},..._0x54521b[_0x2db5c4(0x104)]!==undefined&&{'kind':_0x54521b[_0x2db5c4(0x104)]},..._0x54521b['visible']!==undefined&&{'visible':_0x54521b[_0x2db5c4(0xcc)]},..._0x54521b[_0x2db5c4(0xdf)]&&{'activations':_0x54521b[_0x2db5c4(0xdf)][_0x2db5c4(0xd5)](normalizeActivation)}};}export function normalizeRule(_0x5d2611){const _0x60e12=a142_0x543f86;return{'type':_0x5d2611[_0x60e12(0x124)],'conditions':_0x5d2611[_0x60e12(0x9a)][_0x60e12(0xd5)](normalizeCondition),..._0x5d2611[_0x60e12(0x8b)]!==undefined&&{'description':_0x5d2611[_0x60e12(0x8b)]}};}function a142_0x1ce0(_0x4d6166,_0x1cd522){_0x4d6166=_0x4d6166-0x71;const _0x428ce2=a142_0x428c();let _0x1ce047=_0x428ce2[_0x4d6166];return _0x1ce047;}function normalizeCondition(_0x5be5b5){const _0x3ea058=a142_0x543f86;if(_0x3ea058(0xe9)in _0x5be5b5&&(_0x5be5b5[_0x3ea058(0x124)]==='include'||_0x5be5b5[_0x3ea058(0x124)]===_0x3ea058(0xa1))){const _0x5bfb06=_0x5be5b5;return{'type':_0x5bfb06[_0x3ea058(0x124)],'segment':_0x5bfb06[_0x3ea058(0xe9)]};}if(_0x5be5b5['type']==='And'||_0x5be5b5['type']==='Or'){const _0x5de2c4=_0x5be5b5;return{'type':_0x5de2c4[_0x3ea058(0x124)],'conditions':_0x5de2c4[_0x3ea058(0x9a)][_0x3ea058(0xd5)](normalizeCondition),..._0x5de2c4[_0x3ea058(0x8b)]!==undefined&&{'description':_0x5de2c4[_0x3ea058(0x8b)]}};}if(_0x3ea058(0xce)in _0x5be5b5&&_0x5be5b5[_0x3ea058(0x124)]==='Column'){const _0x1931c7=_0x5be5b5;return{'type':_0x3ea058(0xaa),'column':_0x1931c7['column'],'operator':normalizeOperator(_0x1931c7[_0x3ea058(0x8f)])};}if(_0x5be5b5[_0x3ea058(0x124)]===_0x3ea058(0xd4)){const _0x37529e=_0x5be5b5;return{'type':_0x3ea058(0xd4),'attribute':_0x37529e[_0x3ea058(0xcb)],'operator':normalizeOperator(_0x37529e[_0x3ea058(0x8f)]),..._0x37529e[_0x3ea058(0xbc)]!==undefined&&{'arrayMatching':_0x37529e[_0x3ea058(0xbc)]},..._0x37529e[_0x3ea058(0xa1)]!==undefined&&{'exclude':_0x37529e[_0x3ea058(0xa1)]},..._0x37529e[_0x3ea058(0x11b)]!==undefined&&{'aggregation':_0x37529e['aggregation']},..._0x37529e[_0x3ea058(0xda)]!==undefined&&{'source':_0x37529e['source']},..._0x37529e['filter']!==undefined&&{'filter':ruleDefAsFilterRule(normalizeRule(filterRuleAsRuleDef(_0x37529e[_0x3ea058(0xe8)])))},..._0x37529e['timeWindow']!==undefined&&{'timeWindow':_0x37529e[_0x3ea058(0x8a)]},..._0x37529e[_0x3ea058(0x9f)]!==undefined&&{'limit':_0x37529e['limit']}};}const _0x38532a=_0x5be5b5;return{'type':'Value','attribute':_0x38532a['attribute'],'operator':normalizeOperator(_0x38532a[_0x3ea058(0x8f)]),..._0x38532a[_0x3ea058(0xbc)]!==undefined&&{'arrayMatching':_0x38532a[_0x3ea058(0xbc)]},..._0x38532a['exclude']!==undefined&&{'exclude':_0x38532a[_0x3ea058(0xa1)]},..._0x38532a['aggregation']!==undefined&&{'aggregation':_0x38532a[_0x3ea058(0x11b)]},..._0x38532a[_0x3ea058(0xda)]!==undefined&&{'source':_0x38532a[_0x3ea058(0xda)]},..._0x38532a[_0x3ea058(0xe8)]!==undefined&&{'filter':ruleDefAsFilterRule(normalizeRule(filterRuleAsRuleDef(_0x38532a[_0x3ea058(0xe8)])))},..._0x38532a[_0x3ea058(0x9f)]!==undefined&&{'limit':_0x38532a[_0x3ea058(0x9f)]}};}function normalizeOperator(_0x64fbe){const _0x7f702a=a142_0x543f86;if(isBetweenOperator(_0x64fbe[_0x7f702a(0x124)]))return{'type':_0x64fbe[_0x7f702a(0x124)],..._0x64fbe[_0x7f702a(0x7f)]!==undefined&&{'not':_0x64fbe['not']},..._0x64fbe[_0x7f702a(0xba)]!==undefined&&{'min':_0x64fbe[_0x7f702a(0xba)]},..._0x64fbe[_0x7f702a(0xcf)]!==undefined&&{'max':_0x64fbe[_0x7f702a(0xcf)]}};const _0xa03f74=getEffectiveValue(_0x64fbe);return{'type':_0x64fbe['type'],..._0x64fbe[_0x7f702a(0x7f)]!==undefined&&{'not':_0x64fbe['not']},..._0xa03f74!==undefined&&{'value':_0xa03f74},..._0x64fbe[_0x7f702a(0x7b)]!==undefined&&{'unit':_0x64fbe[_0x7f702a(0x7b)]},..._0x64fbe[_0x7f702a(0xc0)]!==undefined&&{'duration':_0x64fbe[_0x7f702a(0xc0)]},..._0x64fbe['from']!==undefined&&{'from':_0x64fbe[_0x7f702a(0x78)]},..._0x64fbe[_0x7f702a(0xc9)]!==undefined&&{'reverse':_0x64fbe[_0x7f702a(0xc9)]}};}function normalizeActivation(_0x599427){const _0x14f333=a142_0x543f86;return{'name':_0x599427[_0x14f333(0xd8)],'connection':_0x599427[_0x14f333(0x72)],..._0x599427['description']!==undefined&&{'description':_0x599427[_0x14f333(0x8b)]},..._0x599427[_0x14f333(0x9b)]!==undefined&&{'all_columns':_0x599427['all_columns']},..._0x599427[_0x14f333(0x11a)]!==undefined&&{'columns':_0x599427[_0x14f333(0x11a)]},..._0x599427['behavior']!==undefined&&{'behavior':_0x599427[_0x14f333(0x123)]},..._0x599427[_0x14f333(0xef)]!==undefined&&{'schedule':_0x599427[_0x14f333(0xef)]},..._0x599427['notification']!==undefined&&{'notification':_0x599427['notification']},..._0x599427['connector_config']!==undefined&&{'connector_config':_0x599427['connector_config']},..._0x599427[_0x14f333(0x109)]!==undefined&&{'activation_template_id':_0x599427[_0x14f333(0x109)]},..._0x599427[_0x14f333(0x108)]!==undefined&&{'nested_workflow_project_name':_0x599427['nested_workflow_project_name']},..._0x599427[_0x14f333(0x125)]!==undefined&&{'nested_workflow_name':_0x599427['nested_workflow_name']},..._0x599427[_0x14f333(0x8d)]!==undefined&&{'lock_enabled':_0x599427[_0x14f333(0x8d)]}};}function getColumnName(_0x514c25){const _0x532bc7=a142_0x543f86;return _0x514c25[_0x532bc7(0xce)]||_0x514c25[_0x532bc7(0xd8)];}export function activationResponseToDef(_0x87927a,_0x13b3ab,_0x5d8c3a){const _0x24466e=a142_0x543f86,_0x4c088f=_0x87927a[_0x24466e(0xb0)]||'',_0xa26784=_0x5d8c3a?.[_0x24466e(0xa2)](_0x4c088f)??_0x4c088f,_0x4e1cec={'name':_0x87927a[_0x24466e(0xd8)],'connection':_0xa26784};_0x87927a[_0x24466e(0x8b)]&&(_0x4e1cec[_0x24466e(0x8b)]=_0x87927a[_0x24466e(0x8b)]);let _0x4ec97a=[];_0x87927a[_0x24466e(0x11a)]&&_0x87927a['columns'][_0x24466e(0x9e)]>0x0&&(_0x4ec97a=_0x87927a[_0x24466e(0x11a)][_0x24466e(0xe8)](_0x3cd4b5=>_0x3cd4b5&&getColumnName(_0x3cd4b5))[_0x24466e(0xd5)](_0x3d45ec=>{const _0x52c82c=_0x24466e,_0x945112=getColumnName(_0x3d45ec);if(_0x3d45ec[_0x52c82c(0x124)]||_0x3d45ec[_0x52c82c(0x10a)])return{'name':_0x945112,..._0x3d45ec[_0x52c82c(0x124)]&&{'type':_0x3d45ec['type']},..._0x3d45ec[_0x52c82c(0x10a)]&&{'visibility':_0x3d45ec[_0x52c82c(0x10a)]}};return _0x945112;}));_0x4ec97a[_0x24466e(0x9e)]>0x0&&(_0x4e1cec[_0x24466e(0x11a)]=_0x4ec97a);_0x87927a[_0x24466e(0xb5)]!==undefined&&(_0x87927a[_0x24466e(0xb5)]===![]&&_0x4ec97a[_0x24466e(0x9e)]===0x0?_0x4e1cec[_0x24466e(0x9b)]=!![]:_0x4e1cec[_0x24466e(0x9b)]=_0x87927a[_0x24466e(0xb5)]);const _0x635cb2={};let _0x1739a8=![];_0x87927a[_0x24466e(0x118)]&&(_0x635cb2[_0x24466e(0x124)]=_0x87927a[_0x24466e(0x118)],_0x1739a8=!![]);_0x87927a['repeatUnit']&&(_0x635cb2[_0x24466e(0xa7)]=_0x87927a[_0x24466e(0x10b)],_0x1739a8=!![]);_0x87927a[_0x24466e(0x91)]!==undefined&&_0x87927a[_0x24466e(0x91)]!==null&&(_0x635cb2[_0x24466e(0xb7)]=_0x87927a['repeatFrequency'],_0x1739a8=!![]);_0x87927a[_0x24466e(0xa9)]&&_0x87927a[_0x24466e(0xa9)]['length']>0x0&&(_0x635cb2[_0x24466e(0xd9)]=_0x87927a[_0x24466e(0xa9)],_0x1739a8=!![]);_0x87927a[_0x24466e(0x7d)]!==undefined&&(_0x635cb2[_0x24466e(0xdb)]=_0x87927a[_0x24466e(0x7d)],_0x1739a8=!![]);_0x87927a['endOn']!==undefined&&(_0x635cb2[_0x24466e(0xed)]=_0x87927a[_0x24466e(0x121)],_0x1739a8=!![]);_0x87927a[_0x24466e(0x103)]&&(_0x635cb2['timezone']=_0x87927a[_0x24466e(0x103)],_0x1739a8=!![]);_0x1739a8&&(_0x4e1cec['schedule']=_0x635cb2);(_0x87927a['notifyOn']&&_0x87927a[_0x24466e(0xfb)]['length']>0x0||_0x87927a[_0x24466e(0xc3)]&&_0x87927a[_0x24466e(0xc3)]['length']>0x0)&&(_0x4e1cec[_0x24466e(0xa6)]={},_0x87927a[_0x24466e(0xfb)]&&_0x87927a[_0x24466e(0xfb)][_0x24466e(0x9e)]>0x0&&(_0x4e1cec[_0x24466e(0xa6)][_0x24466e(0x105)]=_0x87927a[_0x24466e(0xfb)]),_0x87927a['emailRecipients']&&_0x87927a['emailRecipients'][_0x24466e(0x9e)]>0x0&&(_0x4e1cec[_0x24466e(0xa6)][_0x24466e(0x10f)]=_0x87927a[_0x24466e(0xc3)][_0x24466e(0xd5)](_0x68eb46=>{const _0x441e7f=_0x24466e,_0x53efb1=_0x13b3ab?.[_0x441e7f(0xa2)](_0x68eb46);return _0x53efb1??String(_0x68eb46);})));_0x87927a[_0x24466e(0x71)]&&Object[_0x24466e(0xbb)](_0x87927a['connectorConfig'])['length']>0x0&&(_0x4e1cec['connector_config']=normalizeConnectorConfigForYaml(_0x87927a[_0x24466e(0x71)]));_0x87927a[_0x24466e(0xc5)]&&(_0x4e1cec[_0x24466e(0x109)]=_0x87927a[_0x24466e(0xc5)]);if(_0x87927a[_0x24466e(0xb1)]){const _0x19c56e={},_0x44ebf7=_0x87927a[_0x24466e(0xb1)];_0x44ebf7[_0x24466e(0x11a)]&&_0x44ebf7[_0x24466e(0x11a)][_0x24466e(0x9e)]>0x0&&(_0x19c56e[_0x24466e(0x11a)]=_0x44ebf7[_0x24466e(0x11a)][_0x24466e(0xe8)](_0x14846d=>_0x14846d&&getColumnName(_0x14846d))[_0x24466e(0xd5)](_0x5891f1=>({'name':getColumnName(_0x5891f1),..._0x5891f1[_0x24466e(0x124)]&&{'type':_0x5891f1[_0x24466e(0x124)]},..._0x5891f1[_0x24466e(0x10a)]&&{'visibility':_0x5891f1[_0x24466e(0x10a)]}}))),_0x44ebf7[_0x24466e(0xeb)]&&(_0x19c56e[_0x24466e(0xa3)]=_0x44ebf7[_0x24466e(0xeb)]),_0x44ebf7['joinRow']!==undefined&&(_0x19c56e['join_row']=_0x44ebf7['joinRow']),_0x44ebf7[_0x24466e(0xd3)]&&(_0x19c56e['join_strategy']=_0x44ebf7['joinStrategy']),_0x44ebf7[_0x24466e(0x11f)]&&(_0x19c56e[_0x24466e(0x11f)]=_0x44ebf7['formatting']),_0x44ebf7[_0x24466e(0xfd)]&&_0x44ebf7[_0x24466e(0xfd)]['length']>0x0&&(_0x19c56e[_0x24466e(0x10c)]=_0x44ebf7['orderBy']),Object[_0x24466e(0xbb)](_0x19c56e)[_0x24466e(0x9e)]>0x0&&(_0x4e1cec[_0x24466e(0x123)]=_0x19c56e);}return _0x87927a[_0x24466e(0xb9)]&&(_0x4e1cec[_0x24466e(0x108)]=_0x87927a[_0x24466e(0xb9)]),_0x87927a['nestedWorkflowName']&&(_0x4e1cec[_0x24466e(0x125)]=_0x87927a[_0x24466e(0xe5)]),_0x87927a[_0x24466e(0xdc)]!==undefined&&(_0x4e1cec['lock_enabled']=_0x87927a['lockEnabled']),_0x4e1cec;}export function journeyActivationStepToYaml(_0x197299,_0x38cfc9,_0x7dab2f){const _0x3ab290=a142_0x543f86,_0x3e032c=_0x197299[_0x3ab290(0x120)][_0x3ab290(0x107)],_0x24ae40=_0x3e032c['connectionId']||'',_0x3e5d50=_0x7dab2f?.[_0x3ab290(0xa2)](_0x24ae40)??_0x24ae40,_0x38379c={'name':_0x3e032c['name']||'','connection':_0x3e5d50};_0x197299[_0x3ab290(0x120)][_0x3ab290(0x89)]&&(_0x38379c[_0x3ab290(0x10d)]=!![]);_0x3e032c[_0x3ab290(0x8b)]&&(_0x38379c['description']=_0x3e032c['description']);let _0x33bb69=[];_0x3e032c[_0x3ab290(0x11a)]&&_0x3e032c[_0x3ab290(0x11a)][_0x3ab290(0x9e)]>0x0&&(_0x33bb69=_0x3e032c[_0x3ab290(0x11a)][_0x3ab290(0xe8)](_0x190270=>_0x190270&&getColumnName(_0x190270))[_0x3ab290(0xd5)](_0x5b49e7=>{const _0x2bf74e=_0x3ab290,_0x5bc08a=getColumnName(_0x5b49e7);if(_0x5b49e7[_0x2bf74e(0x124)]||_0x5b49e7[_0x2bf74e(0x10a)])return{'name':_0x5bc08a,..._0x5b49e7[_0x2bf74e(0x124)]&&{'type':_0x5b49e7[_0x2bf74e(0x124)]},..._0x5b49e7['visibility']&&{'visibility':_0x5b49e7['visibility']}};return _0x5bc08a;}));_0x33bb69['length']>0x0&&(_0x38379c[_0x3ab290(0x11a)]=_0x33bb69);_0x3e032c['allColumns']!==undefined&&(_0x3e032c[_0x3ab290(0xb5)]===![]&&_0x33bb69[_0x3ab290(0x9e)]===0x0?_0x38379c[_0x3ab290(0x9b)]=!![]:_0x38379c[_0x3ab290(0x9b)]=_0x3e032c[_0x3ab290(0xb5)]);const _0x347302={};let _0x1f55db=![];_0x3e032c['scheduleType']&&(_0x347302[_0x3ab290(0x124)]=_0x3e032c['scheduleType'],_0x1f55db=!![]);_0x3e032c[_0x3ab290(0x10b)]&&(_0x347302[_0x3ab290(0xa7)]=_0x3e032c[_0x3ab290(0x10b)],_0x1f55db=!![]);_0x3e032c[_0x3ab290(0x91)]!==undefined&&_0x3e032c[_0x3ab290(0x91)]!==null&&(_0x347302[_0x3ab290(0xb7)]=_0x3e032c['repeatFrequency'],_0x1f55db=!![]);_0x3e032c[_0x3ab290(0x7d)]!==undefined&&(_0x347302[_0x3ab290(0xdb)]=_0x3e032c[_0x3ab290(0x7d)],_0x1f55db=!![]);_0x3e032c[_0x3ab290(0x121)]!==undefined&&(_0x347302[_0x3ab290(0xed)]=_0x3e032c['endOn'],_0x1f55db=!![]);_0x3e032c['timezone']&&(_0x347302[_0x3ab290(0x103)]=_0x3e032c[_0x3ab290(0x103)],_0x1f55db=!![]);_0x1f55db&&(_0x38379c['schedule']=_0x347302);(_0x3e032c['notifyOn']&&_0x3e032c[_0x3ab290(0xfb)]['length']>0x0||_0x3e032c[_0x3ab290(0xc3)]&&_0x3e032c['emailRecipients']['length']>0x0)&&(_0x38379c[_0x3ab290(0xa6)]={},_0x3e032c[_0x3ab290(0xfb)]&&_0x3e032c[_0x3ab290(0xfb)]['length']>0x0&&(_0x38379c['notification'][_0x3ab290(0x105)]=_0x3e032c[_0x3ab290(0xfb)]),_0x3e032c[_0x3ab290(0xc3)]&&_0x3e032c[_0x3ab290(0xc3)][_0x3ab290(0x9e)]>0x0&&(_0x38379c[_0x3ab290(0xa6)][_0x3ab290(0x10f)]=_0x3e032c[_0x3ab290(0xc3)]['map'](_0x2dc1f9=>{const _0x1e0ebd=_0x3ab290,_0x454e60=_0x38cfc9?.[_0x1e0ebd(0xa2)](_0x2dc1f9);return _0x454e60??String(_0x2dc1f9);})));_0x3e032c[_0x3ab290(0x71)]&&Object['keys'](_0x3e032c[_0x3ab290(0x71)])[_0x3ab290(0x9e)]>0x0&&(_0x38379c[_0x3ab290(0xf4)]=normalizeConnectorConfigForYaml(_0x3e032c[_0x3ab290(0x71)]));_0x3e032c[_0x3ab290(0xc5)]&&(_0x38379c[_0x3ab290(0x109)]=_0x3e032c[_0x3ab290(0xc5)]);if(_0x3e032c['syndicationBehavior']){const _0x37b0f6={},_0x300bde=_0x3e032c[_0x3ab290(0xb1)];_0x300bde[_0x3ab290(0x11a)]&&_0x300bde[_0x3ab290(0x11a)]['length']>0x0&&(_0x37b0f6['columns']=_0x300bde[_0x3ab290(0x11a)]['filter'](_0x154e43=>_0x154e43&&getColumnName(_0x154e43))[_0x3ab290(0xd5)](_0xd037cd=>({'name':getColumnName(_0xd037cd),..._0xd037cd['type']&&{'type':_0xd037cd[_0x3ab290(0x124)]},..._0xd037cd[_0x3ab290(0x10a)]&&{'visibility':_0xd037cd['visibility']}}))),_0x300bde['behaviorTableName']&&(_0x37b0f6[_0x3ab290(0xa3)]=_0x300bde[_0x3ab290(0xeb)]),_0x300bde['joinRow']!==undefined&&(_0x37b0f6['join_row']=_0x300bde[_0x3ab290(0xdd)]),_0x300bde['joinStrategy']&&(_0x37b0f6[_0x3ab290(0xc7)]=_0x300bde['joinStrategy']),_0x300bde[_0x3ab290(0x11f)]&&(_0x37b0f6[_0x3ab290(0x11f)]=_0x300bde[_0x3ab290(0x11f)]),_0x300bde[_0x3ab290(0xfd)]&&_0x300bde[_0x3ab290(0xfd)][_0x3ab290(0x9e)]>0x0&&(_0x37b0f6['order_by']=_0x300bde[_0x3ab290(0xfd)]),Object[_0x3ab290(0xbb)](_0x37b0f6)[_0x3ab290(0x9e)]>0x0&&(_0x38379c[_0x3ab290(0x123)]=_0x37b0f6);}return _0x38379c;}export function segmentWithActivationsToYaml(_0x407f57,_0x29eea2,_0x6bd57e,_0x2f2d07,_0x1fc15d){const _0x547b58=a142_0x543f86,_0x5f10b3=segmentResponseToDefSync(_0x407f57,_0x6bd57e);return _0x29eea2[_0x547b58(0x9e)]>0x0&&(_0x5f10b3[_0x547b58(0xdf)]=_0x29eea2[_0x547b58(0xd5)](_0x5f5613=>activationResponseToDef(_0x5f5613,_0x2f2d07,_0x1fc15d))),_0x5f10b3;}function normalizeColumn(_0x55bc5e){const _0x343de0=a142_0x543f86;if(typeof _0x55bc5e==='string')return{'column':_0x55bc5e,'source':{'column':_0x55bc5e}};return{'column':_0x55bc5e['name'],'source':{'column':_0x55bc5e[_0x343de0(0xd8)]},..._0x55bc5e['type']&&{'type':_0x55bc5e[_0x343de0(0x124)]},..._0x55bc5e[_0x343de0(0x10a)]&&{'visibility':_0x55bc5e[_0x343de0(0x10a)]}};}const KNOWN_ACTIVATION_FIELDS=new Set(Object['keys'](ActivationDefSchema[a142_0x543f86(0xfe)]));export function warnUnrecognizedActivationFields(_0x565d46,_0x4f394a){const _0x3283d3=a142_0x543f86,_0x4f75a8=Object[_0x3283d3(0xbb)](_0x565d46)[_0x3283d3(0xe8)](_0x224026=>!KNOWN_ACTIVATION_FIELDS[_0x3283d3(0x73)](_0x224026));if(_0x4f75a8[_0x3283d3(0x9e)]>0x0){const _0x27cb37=_0x4f75a8[_0x3283d3(0xd5)](_0x579fa2=>_0x3283d3(0xf8)+_0x579fa2+'\x22')[_0x3283d3(0xbe)]('\x0a');console[_0x3283d3(0xa4)](_0x3283d3(0xd6)+_0x4f394a+_0x3283d3(0xb3)+_0x27cb37);}}export async function activationDefToCreateRequest(_0x14adc9,_0x23089d){const _0x5f41df=a142_0x543f86;warnUnrecognizedActivationFields(_0x14adc9,_0x14adc9[_0x5f41df(0xd8)]);const _0x2f6fd3=_0x23089d?.['emailToIdMap'],_0x2b26d9=_0x23089d?.[_0x5f41df(0x99)],_0x229191=_0x14adc9['connection'];let _0x923f5e;const _0x1c2ed2=parseInt(_0x229191,0xa);if(!isNaN(_0x1c2ed2)&&String(_0x1c2ed2)===_0x229191)_0x923f5e=_0x1c2ed2;else{const _0x3dfc6b=_0x2b26d9?.['get'](_0x229191);if(_0x3dfc6b===undefined)throw new SDKError(ErrorCode[_0x5f41df(0xc2)],_0x5f41df(0xd1)+_0x229191,undefined,{'helpText':_0x5f41df(0xb6)});_0x923f5e=_0x3dfc6b;}const _0x2395cb={'name':_0x14adc9['name'],'connectionId':_0x923f5e};_0x14adc9['description']&&(_0x2395cb[_0x5f41df(0x8b)]=_0x14adc9[_0x5f41df(0x8b)]);let _0x5b7469=[];_0x14adc9['columns']&&_0x14adc9[_0x5f41df(0x11a)][_0x5f41df(0x9e)]>0x0&&(_0x5b7469=_0x14adc9[_0x5f41df(0x11a)][_0x5f41df(0xe8)](_0x59c465=>_0x59c465!=null)[_0x5f41df(0xd5)](normalizeColumn));_0x5b7469[_0x5f41df(0x9e)]>0x0&&(_0x2395cb[_0x5f41df(0x11a)]=_0x5b7469);_0x14adc9[_0x5f41df(0x9b)]!==undefined&&(_0x14adc9['all_columns']===![]&&_0x5b7469[_0x5f41df(0x9e)]===0x0?_0x2395cb[_0x5f41df(0xb5)]=!![]:_0x2395cb[_0x5f41df(0xb5)]=_0x14adc9['all_columns']);if(_0x14adc9[_0x5f41df(0xef)]){const _0x103431=_0x14adc9[_0x5f41df(0xef)],_0xf1e3fb=_0x103431[_0x5f41df(0x124)]??REPEAT_UNIT_TO_SCHEDULE_TYPE[_0x103431[_0x5f41df(0xa7)]];_0xf1e3fb&&(_0x2395cb[_0x5f41df(0x118)]=_0xf1e3fb);const _0x4fca8a=_0x103431[_0x5f41df(0xa7)]??SCHEDULE_TYPE_TO_REPEAT_UNIT[_0x103431['type']];_0x4fca8a&&(_0x2395cb[_0x5f41df(0x10b)]=_0x4fca8a);_0x103431[_0x5f41df(0xb7)]!==undefined&&(_0x2395cb[_0x5f41df(0x91)]=_0x103431[_0x5f41df(0xb7)]);_0x103431[_0x5f41df(0xd9)]&&(_0x2395cb[_0x5f41df(0xa9)]=_0x103431[_0x5f41df(0xd9)]);_0x103431[_0x5f41df(0xdb)]!==undefined&&(_0x2395cb[_0x5f41df(0x7d)]=_0x103431[_0x5f41df(0xdb)]);_0x103431['end_on']!==undefined&&(_0x2395cb[_0x5f41df(0x121)]=_0x103431[_0x5f41df(0xed)]);_0x103431[_0x5f41df(0x103)]&&(_0x2395cb[_0x5f41df(0x103)]=_0x103431[_0x5f41df(0x103)]);if(_0xf1e3fb&&_0xf1e3fb!==_0x5f41df(0x122)&&_0xf1e3fb!==_0x5f41df(0x106)&&_0x103431[_0x5f41df(0xdb)]){const _0x20fd73=_0x103431['start_at']['match'](/T(\d{2}:\d{2})/);_0x20fd73&&(_0x2395cb[_0x5f41df(0xe2)]=_0x20fd73[0x1]);}}_0x14adc9[_0x5f41df(0xa6)]&&(_0x14adc9['notification'][_0x5f41df(0x105)]&&(_0x2395cb['notifyOn']=_0x14adc9[_0x5f41df(0xa6)]['notify_on']),_0x14adc9['notification'][_0x5f41df(0x10f)]&&(_0x2395cb['emailRecipients']=_0x14adc9[_0x5f41df(0xa6)][_0x5f41df(0x10f)][_0x5f41df(0xd5)](_0x280989=>{const _0x548441=_0x5f41df,_0x2d8dc1=Number(_0x280989);if(!isNaN(_0x2d8dc1)&&String(_0x2d8dc1)===_0x280989)return _0x2d8dc1;const _0x5c9b57=_0x2f6fd3?.[_0x548441(0xa2)](_0x280989[_0x548441(0xb8)]());if(_0x5c9b57===undefined)throw new SDKError(ErrorCode[_0x548441(0x7a)],_0x548441(0x127)+_0x280989+_0x548441(0x101));return _0x5c9b57;})));if(_0x14adc9[_0x5f41df(0xf4)]){const _0x62ae44=_0x23089d?.[_0x5f41df(0xf5)]?.['get'](_0x229191);if(_0x62ae44&&_0x23089d?.[_0x5f41df(0xd0)])try{const _0x3b510b=await _0x23089d[_0x5f41df(0xd0)](_0x62ae44),_0x59420a=validateConnectorConfig(_0x14adc9['connector_config'],_0x3b510b);if(!_0x59420a[_0x5f41df(0xe0)])throw new SDKError(ErrorCode['CONNECTOR_INVALID_CONFIG'],_0x5f41df(0xb2)+_0x14adc9[_0x5f41df(0xd8)]+_0x5f41df(0xf7)+formatValidationErrors(_0x59420a[_0x5f41df(0xf3)]),undefined,{'helpText':'Connector:\x20'+_0x62ae44+_0x5f41df(0x7c)+formatSchemaAsHelp(_0x3b510b)});if(_0x59420a['warnings'][_0x5f41df(0x9e)]>0x0){const _0x4cf915=formatValidationWarnings(_0x59420a['warnings']);console[_0x5f41df(0xa4)](_0x5f41df(0xbd)+_0x14adc9['name']+'\x22:\x0a'+_0x4cf915);}_0x2395cb['connectorConfig']=transformConfigToLegacy(_0x14adc9[_0x5f41df(0xf4)],_0x3b510b);}catch(_0x50f35a){if(_0x50f35a instanceof SDKError&&_0x50f35a['code']===ErrorCode[_0x5f41df(0x11e)])_0x2395cb[_0x5f41df(0x71)]=_0x14adc9[_0x5f41df(0xf4)];else throw _0x50f35a;}else _0x2395cb[_0x5f41df(0x71)]=_0x14adc9[_0x5f41df(0xf4)];}_0x14adc9[_0x5f41df(0x109)]!==undefined&&(_0x2395cb[_0x5f41df(0xc5)]=_0x14adc9[_0x5f41df(0x109)]);if(_0x14adc9[_0x5f41df(0x123)]){const _0x32495e=_0x14adc9[_0x5f41df(0x123)],_0x42f82e={};if(_0x32495e[_0x5f41df(0x11a)]&&_0x32495e[_0x5f41df(0x11a)][_0x5f41df(0x9e)]>0x0){const _0x28b88e=_0x32495e['columns']['filter'](_0x32082d=>_0x32082d&&_0x32082d[_0x5f41df(0xd8)])[_0x5f41df(0xd5)](normalizeColumn);_0x28b88e[_0x5f41df(0x9e)]>0x0&&(_0x42f82e[_0x5f41df(0x11a)]=_0x28b88e);}_0x32495e[_0x5f41df(0xa3)]&&(_0x42f82e['behaviorTableName']=_0x32495e['behavior_table']);_0x32495e[_0x5f41df(0xc7)]&&(_0x42f82e[_0x5f41df(0xd3)]=_0x32495e['join_strategy']);if(_0x32495e[_0x5f41df(0x85)]!==undefined)_0x42f82e['joinRow']=_0x32495e[_0x5f41df(0x85)];else{if(_0x32495e[_0x5f41df(0xc7)]===_0x5f41df(0xae)||_0x32495e[_0x5f41df(0xc7)]===_0x5f41df(0x119))_0x42f82e[_0x5f41df(0xdd)]=0x1;else _0x32495e[_0x5f41df(0xc7)]===_0x5f41df(0x79)&&(_0x42f82e[_0x5f41df(0xdd)]=null);}_0x32495e['formatting']&&(_0x42f82e[_0x5f41df(0x11f)]=_0x32495e[_0x5f41df(0x11f)]),_0x32495e[_0x5f41df(0x10c)]&&(_0x42f82e[_0x5f41df(0xfd)]=_0x32495e[_0x5f41df(0x10c)]),_0x2395cb[_0x5f41df(0xb1)]=_0x42f82e;}return _0x14adc9[_0x5f41df(0x108)]&&(_0x2395cb[_0x5f41df(0xb9)]=_0x14adc9[_0x5f41df(0x108)]),_0x14adc9['nested_workflow_name']&&(_0x2395cb[_0x5f41df(0xe5)]=_0x14adc9['nested_workflow_name']),_0x14adc9['lock_enabled']!==undefined&&(_0x2395cb['lockEnabled']=_0x14adc9['lock_enabled']),_0x2395cb;}export async function activationDefToUpdateRequest(_0x37edde,_0x478fc4){return activationDefToCreateRequest(_0x37edde,_0x478fc4);}export function deepSortObject(_0x1f51fd){const _0x3fd30c=a142_0x543f86;if(_0x1f51fd===null||typeof _0x1f51fd!==_0x3fd30c(0xf0))return _0x1f51fd;if(Array[_0x3fd30c(0xe7)](_0x1f51fd))return _0x1f51fd[_0x3fd30c(0xd5)](deepSortObject)[_0x3fd30c(0xad)]((_0x46728d,_0x3d3309)=>JSON[_0x3fd30c(0xc8)](_0x46728d)[_0x3fd30c(0x10e)](JSON['stringify'](_0x3d3309)));const _0x325582={};for(const _0x72fb01 of Object[_0x3fd30c(0xbb)](_0x1f51fd)['sort']()){_0x325582[_0x72fb01]=deepSortObject(_0x1f51fd[_0x72fb01]);}return _0x325582;}export function serializeRule(_0x553ecc){const _0x3f053d=a142_0x543f86;return JSON[_0x3f053d(0xc8)](deepSortObject(_0x553ecc));}export function normalizeRuleForMatching(_0x1843dd){return normalizeConditionsForMatching(_0x1843dd);}function normalizeConditionsForMatching(_0x497163){const _0x270d28=a142_0x543f86;if(_0x497163===null||typeof _0x497163!==_0x270d28(0xf0))return _0x497163;if(Array[_0x270d28(0xe7)](_0x497163))return _0x497163[_0x270d28(0xd5)](normalizeConditionsForMatching);const _0x2ed8a7=_0x497163;if((_0x2ed8a7['type']===_0x270d28(0x98)||_0x2ed8a7[_0x270d28(0x124)]==='exclude')&&typeof _0x2ed8a7[_0x270d28(0xe9)]===_0x270d28(0xa5))return{..._0x2ed8a7,'segment':'__SEGMENT_REF__'};const _0x31aeee={};for(const _0x5b8a3f of Object[_0x270d28(0xbb)](_0x2ed8a7)){_0x31aeee[_0x5b8a3f]=normalizeConditionsForMatching(_0x2ed8a7[_0x5b8a3f]);}return _0x31aeee;}export function serializeRuleForMatching(_0x475afc){const _0x413713=a142_0x543f86;return JSON[_0x413713(0xc8)](deepSortObject(normalizeRuleForMatching(_0x475afc)));}export function expandSegmentReferences(_0x521462,_0x369619,_0x4ba351=new Set()){return expandConditions(_0x521462,_0x369619,_0x4ba351);}function expandConditions(_0x4b5be2,_0x2b516f,_0x8357cd){const _0x33b36=a142_0x543f86;if(_0x4b5be2===null||typeof _0x4b5be2!=='object')return _0x4b5be2;if(Array[_0x33b36(0xe7)](_0x4b5be2))return _0x4b5be2[_0x33b36(0xd5)](_0x49ff37=>expandConditions(_0x49ff37,_0x2b516f,_0x8357cd));const _0x17373c=_0x4b5be2;if((_0x17373c[_0x33b36(0x124)]===_0x33b36(0x98)||_0x17373c[_0x33b36(0x124)]==='exclude')&&typeof _0x17373c['segment']==='string'){const _0x6c9b97=_0x17373c[_0x33b36(0xe9)],_0x14d23f=_0x2b516f[_0x33b36(0xa2)](_0x6c9b97);if(_0x14d23f&&!_0x8357cd['has'](_0x6c9b97)){const _0x279b80=new Set(_0x8357cd);_0x279b80['add'](_0x6c9b97);const _0x48482e=expandConditions(_0x14d23f,_0x2b516f,_0x279b80);return{'type':_0x17373c[_0x33b36(0x124)],'expanded_rule':_0x48482e};}return{'type':_0x17373c[_0x33b36(0x124)],'expanded_rule':'__UNRESOLVED__'};}const _0x3bc600={};for(const _0x380fa9 of Object[_0x33b36(0xbb)](_0x17373c)){_0x3bc600[_0x380fa9]=expandConditions(_0x17373c[_0x380fa9],_0x2b516f,_0x8357cd);}return _0x3bc600;}export function serializeExpandedRule(_0x24b944,_0x2cb112){const _0x24d6cb=expandSegmentReferences(_0x24b944,_0x2cb112);return JSON['stringify'](deepSortObject(_0x24d6cb));}export function createSegmentNameContext(_0x7791a5){const _0x224f47=a142_0x543f86,_0x4ca43f=new Set(),_0x3ea360=new Map(),_0x56be50=new Map();if(_0x7791a5)for(const [_0x1a1f5f,_0x23e22d]of Object[_0x224f47(0xde)](_0x7791a5)){if(_0x23e22d['rule']){const _0x483fd4=serializeRule(_0x23e22d['rule']);_0x56be50['set'](_0x483fd4,_0x1a1f5f),_0x4ca43f[_0x224f47(0xcd)](_0x1a1f5f);}}return{'usedNames':_0x4ca43f,'ruleHashToName':_0x3ea360,'localRuleToName':_0x7791a5?_0x56be50:undefined};}export function resolveSegmentName(_0x2b71aa,_0x57125d,_0x1cd886,_0x2dfb0c){const _0x426e6d=a142_0x543f86,_0x4536c0=serializeRule(_0x57125d);if(_0x1cd886[_0x426e6d(0x115)]){const _0xcbb1c5=_0x1cd886['localRuleToName']['get'](_0x4536c0);if(_0xcbb1c5)return{'name':_0xcbb1c5,'isDuplicate':![],'isLocalMatch':!![]};}const _0x19cab2=_0x1cd886[_0x426e6d(0x75)]['get'](_0x4536c0);if(_0x19cab2)return{'name':_0x19cab2,'isDuplicate':!![],'isLocalMatch':![]};const _0x3de5b1=_0x2dfb0c(_0x2b71aa);let _0x3b9eb5=_0x3de5b1||_0x2b71aa,_0x58100c=_0x3b9eb5,_0x1a96a9=0x2;while(_0x1cd886[_0x426e6d(0x128)][_0x426e6d(0x73)](_0x58100c)){_0x58100c=_0x3b9eb5+'_'+_0x1a96a9,_0x1a96a9++;}return _0x1cd886[_0x426e6d(0x128)]['add'](_0x58100c),_0x1cd886[_0x426e6d(0x75)][_0x426e6d(0x92)](_0x4536c0,_0x58100c),{'name':_0x58100c,'isDuplicate':![],'isLocalMatch':![]};}export function collectSegmentRefsFromRule(_0x26cb7f){const _0x595970=[],_0x4866ba=_0x528641=>{const _0x16434c=a142_0x1ce0;if(!_0x528641||typeof _0x528641!=='object')return;if(Array[_0x16434c(0xe7)](_0x528641)){_0x528641[_0x16434c(0xb4)](_0x4866ba);return;}const _0x29c60d=_0x528641;(_0x29c60d['type']==='include'||_0x29c60d[_0x16434c(0x124)]===_0x16434c(0xa1))&&typeof _0x29c60d['segment']==='string'&&_0x595970[_0x16434c(0x113)](_0x29c60d[_0x16434c(0xe9)]);for(const _0x1711f3 of Object[_0x16434c(0x100)](_0x29c60d)){_0x4866ba(_0x1711f3);}};return _0x4866ba(_0x26cb7f),_0x595970;}export function validateSegmentRule(_0x15c44f,_0x1c9e36){const _0x4367d8=a142_0x543f86;if(!_0x1c9e36||!_0x1c9e36[_0x4367d8(0x9a)])return;for(let _0x1d9926=0x0;_0x1d9926<_0x1c9e36[_0x4367d8(0x9a)]['length'];_0x1d9926++){const _0x301679=_0x1c9e36[_0x4367d8(0x9a)][_0x1d9926];if(_0x4367d8(0x124)in _0x301679&&_0x301679[_0x4367d8(0x124)]==='Value'){const _0x45ed00=_0x301679,_0x405fdb=_0x45ed00[_0x4367d8(0xda)]||_0x45ed00[_0x4367d8(0x11b)];if((!_0x45ed00[_0x4367d8(0xcb)]||_0x45ed00['attribute']==='')&&!_0x405fdb)throw new SDKError(ErrorCode[_0x4367d8(0x129)],_0x4367d8(0x83)+_0x15c44f+_0x4367d8(0xe3)+('conditions['+_0x1d9926+_0x4367d8(0xe1))+_0x4367d8(0x9c));}}}
1
+ const a142_0x39a3dd=a142_0x5a93;(function(_0x46ac36,_0xef26f){const _0xca87ea=a142_0x5a93,_0x2256e4=_0x46ac36();while(!![]){try{const _0x139885=-parseInt(_0xca87ea(0xe1))/0x1*(-parseInt(_0xca87ea(0x12a))/0x2)+parseInt(_0xca87ea(0xfa))/0x3*(-parseInt(_0xca87ea(0xc2))/0x4)+-parseInt(_0xca87ea(0x163))/0x5*(-parseInt(_0xca87ea(0xef))/0x6)+parseInt(_0xca87ea(0xcd))/0x7+parseInt(_0xca87ea(0x133))/0x8*(parseInt(_0xca87ea(0xbb))/0x9)+parseInt(_0xca87ea(0xc1))/0xa*(parseInt(_0xca87ea(0x131))/0xb)+-parseInt(_0xca87ea(0xda))/0xc*(parseInt(_0xca87ea(0x158))/0xd);if(_0x139885===_0xef26f)break;else _0x2256e4['push'](_0x2256e4['shift']());}catch(_0x2c92cd){_0x2256e4['push'](_0x2256e4['shift']());}}}(a142_0x350c,0x72e41));import*as a142_0x561a0a from'yaml';import{safeParseYaml}from'./yaml-validator.js';import{SDKError,ErrorCode}from'../errors.js';import{validateConnectorConfig,transformConfigToLegacy,normalizeConnectorConfigForYaml,formatValidationErrors,formatValidationWarnings,formatSchemaAsHelp}from'../connection-validator.js';import{SegmentDefSchema}from'./types/segment-schema.js';import{ActivationDefSchema}from'./types/activation-schema.js';const SCHEDULE_TYPE_TO_REPEAT_UNIT={'daily':a142_0x39a3dd(0x102),'hourly':'hour','weekly':'week','monthly':'month','minutes_interval':a142_0x39a3dd(0x142)},REPEAT_UNIT_TO_SCHEDULE_TYPE={'day':a142_0x39a3dd(0x143),'hour':a142_0x39a3dd(0x111),'week':a142_0x39a3dd(0xbc),'month':a142_0x39a3dd(0x148),'minute':a142_0x39a3dd(0x126)};function filterRuleAsRuleDef(_0x532a69){return _0x532a69;}function a142_0x350c(){const _0x33e324=['notifyOn','getSchema','day','repeatSubFrequency','end_on','Connector:\x20','Invalid\x20condition\x20in\x20embedded\x20segment\x20\x27','name','groupingColumns','lockEnabled','orderBy','TimeWithinNext','exclude','activationTemplateId','leftValue','activation_template_id','connectionNameToIdMap','hourly','behavior','include','email_recipients','attribute','every','column','nestedWorkflowProjectName','emailToIdMap','connectionNameToTypeMap','__SEGMENT_REF__','joinStrategy','isVisible','activationParams','keys','set','Unknown\x20connection:\x20','connectorConfig','rule:','Value','JOURNEY_SYNTAX_ERROR','minutes_interval','operator','aggregation','First','334NdZfja','\x20\x20-\x20\x22','filter','timeWindow','startAt','push','sort','3061146qJRPJQ','connection','32DypKVX','limit','not','description','join_strategy','emailRecipients','activations:','any','nested_workflow_project_name','conditions','realtime','\x22:\x0a','notification','Unknown\x20email\x20recipient:\x20','test','minute','daily','nested_workflow_name','segmentFolderId','min','Invalid\x20connector_config\x20for\x20activation\x20\x22','monthly','resolveSegmentName','endOn','errors','arrayMatching','shape','behaviorTableName','connectionId','joinRow','all_columns','notify_on','get','nestedWorkflowName','source','New\x20Segment','has','884TQUQSg','unit','minValue','syndicationBehavior','rightValue','folder','attributes','scheduleType','Equal','visibility','length','40taIuAf','add','formatting','__UNRESOLVED__','orderColumn','connector_config','run_after_journey_refresh','repeatUnit','CONNECTOR_INVALID_CONFIG','duration','Count','none','stringify','warnings','Last','max','value','Warning:\x20activation\x20\x22','TimeRange','1618992ziALzy','weekly','usedNames','ruleHashToName','values','rule','10xopQdg','8OzjCeg','schedule','code','INVALID_ARGUMENT','map','forEach','attribute_name','].attribute\x20cannot\x20be\x20empty.\x0a','repeat_sub_frequency','conditions[','parse','4237205sYUvmt','all','type','batch','from','CONNECTION_NOT_FOUND','object','maxValue','\x27:\x20','And','timezone','localRuleToName','repeatFrequency','260868QuJnSD','CONNECTOR_SCHEMA_NOT_FOUND','funnel_stage','Column','Use\x20\x27tdx\x20connections\x27\x20to\x20list\x20available\x20connections','Please\x20specify\x20a\x20valid\x20attribute\x20name.','Between','4670FIRMQh','null','warn','lock_enabled','valid','isFinite','isArray','segment','CountDistinct','kind','start_at','toLowerCase','Behavior','columns','194268tJlYqY','repeat_unit','activations','behavior_table','allColumns','join','connector_config\x20for\x20activation\x20\x22','rightValues','repeat_frequency','string','order_by','1039833iLrTFo','join_row','visible','Reference','runAfterJourneyRefresh','reverse'];a142_0x350c=function(){return _0x33e324;};return a142_0x350c();}function ruleDefAsFilterRule(_0x5ac026){return _0x5ac026;}export function segmentResponseToDefSync(_0x2c7b02,_0x36dc23){const _0x1126af=a142_0x39a3dd,_0x3b9966=_0x2c7b02[_0x1126af(0xc0)]&&'type'in _0x2c7b02[_0x1126af(0xc0)]&&_0x2c7b02['rule'][_0x1126af(0xcf)];return{'type':_0x1126af(0xe8),'name':_0x2c7b02[_0x1126af(0x107)],..._0x2c7b02['description']&&{'description':_0x2c7b02[_0x1126af(0x136)]},..._0x36dc23&&{'folder':_0x36dc23},..._0x3b9966&&{'rule':apiRuleToYaml(_0x2c7b02[_0x1126af(0xc0)])},..._0x2c7b02[_0x1126af(0xea)]!==undefined&&{'kind':_0x2c7b02['kind']===0x0?_0x1126af(0xd0):_0x2c7b02[_0x1126af(0xea)]===0x1?_0x1126af(0x13d):_0x1126af(0xdc)},..._0x2c7b02[_0x1126af(0x11d)]!==undefined&&{'visible':_0x2c7b02[_0x1126af(0x11d)]}};}export async function segmentResponseToDef(_0xff6e85,_0x3de678,_0x2dff88){const _0x131257=a142_0x39a3dd,_0x21628f=segmentResponseToDefSync(_0xff6e85,_0x2dff88);if(!_0x3de678||!_0x3de678[_0x131257(0x149)])return _0x21628f;return _0x21628f['rule']&&(_0x21628f[_0x131257(0xc0)]=await resolveRuleSegmentRefs(_0x21628f[_0x131257(0xc0)],_0x3de678[_0x131257(0x149)])),_0x21628f;}export function apiRuleToYaml(_0x332915){const _0x5d4034=a142_0x39a3dd,_0x31b76c=(_0x332915[_0x5d4034(0x13c)]||[])['flatMap'](_0x52c365=>{const _0x157194=_0x5d4034,_0x541d3f=apiConditionToYaml(_0x52c365);if(isCompositeType(_0x541d3f)&&_0x541d3f[_0x157194(0x136)]!==undefined){const _0x2191d2=_0x541d3f;if(_0x2191d2[_0x157194(0x13c)][_0x157194(0x162)]===0x1)return _0x2191d2[_0x157194(0x13c)];return[{'type':_0x2191d2['type'],'conditions':_0x2191d2['conditions']}];}return[_0x541d3f];});if(_0x31b76c[_0x5d4034(0x162)]===0x1&&!_0x332915['description']&&isCompositeType(_0x31b76c[0x0])){const _0x41734d=_0x31b76c[0x0];if(_0x41734d[_0x5d4034(0xcf)]===_0x332915[_0x5d4034(0xcf)]&&_0x41734d[_0x5d4034(0x13c)]&&_0x41734d[_0x5d4034(0x136)]===undefined)return{'type':_0x332915['type'],'conditions':_0x41734d['conditions']};}return{'type':_0x332915[_0x5d4034(0xcf)],'conditions':_0x31b76c};}export async function resolveRuleSegmentRefs(_0x8bd1f6,_0x15c326){return transformRuleSegmentRefs(_0x8bd1f6,_0x15c326,_0x39fe67=>/^\d+$/['test'](_0x39fe67));}async function transformConditionSegmentRefs(_0xbb415,_0x131279,_0x118b7c,_0x411ddb){const _0x160156=a142_0x39a3dd;if(_0x160156(0xe8)in _0xbb415&&(_0xbb415['type']===_0x160156(0x113)||_0xbb415['type']===_0x160156(0x10c))){const _0x128436=_0xbb415;if(_0x118b7c(_0x128436[_0x160156(0xe8)]))return{..._0x128436,'segment':await _0x131279(_0x128436[_0x160156(0xe8)])};return _0xbb415;}if(_0x160156(0x13c)in _0xbb415&&_0xbb415[_0x160156(0x13c)]){const _0x4355b2=_0xbb415,_0x188627=await Promise['all'](_0x4355b2[_0x160156(0x13c)][_0x160156(0xc6)](_0x2b7c78=>transformConditionSegmentRefs(_0x2b7c78,_0x131279,_0x118b7c,_0x411ddb)));return{..._0x4355b2,'conditions':_0x188627};}if('filter'in _0xbb415&&_0xbb415[_0x160156(0x12c)]){const _0x25a3c2=_0xbb415,_0x1299e0=await _0x411ddb(filterRuleAsRuleDef(_0x25a3c2['filter']),_0x131279);return{..._0x25a3c2,'filter':ruleDefAsFilterRule(_0x1299e0)};}return _0xbb415;}async function transformRuleSegmentRefs(_0x38ed9e,_0x544e31,_0x5832d9){const _0x57975c=a142_0x39a3dd,_0x566c53=(_0x3862fc,_0x3deef4)=>transformRuleSegmentRefs(_0x3862fc,_0x3deef4,_0x5832d9),_0x3e3bb0=await Promise[_0x57975c(0xce)](_0x38ed9e[_0x57975c(0x13c)][_0x57975c(0xc6)](_0x11322f=>transformConditionSegmentRefs(_0x11322f,_0x544e31,_0x5832d9,_0x566c53)));return{..._0x38ed9e,'conditions':_0x3e3bb0};}export async function resolveRuleSegmentIds(_0x104db4,_0x46fd5b){const _0x162d5d=a142_0x39a3dd;return transformRuleSegmentRefs(_0x104db4,_0x46fd5b,_0x4b3db6=>!/^\d+$/[_0x162d5d(0x141)](_0x4b3db6));}function isCompositeType(_0x325684){const _0x59bd26=a142_0x39a3dd;return _0x325684[_0x59bd26(0xcf)]===_0x59bd26(0xd6)||_0x325684['type']==='Or';}function isBehaviorApiCondition(_0x9ca2f9){const _0x3da3e9=a142_0x39a3dd;if(!_0x9ca2f9[_0x3da3e9(0x10e)]?.[_0x3da3e9(0x155)]?.[_0x3da3e9(0x107)])return![];return!![];}function apiConditionToYaml(_0xdeb061){const _0x27f1c9=a142_0x39a3dd;if(_0xdeb061[_0x27f1c9(0xcf)]===_0x27f1c9(0xd6)||_0xdeb061[_0x27f1c9(0xcf)]==='Or'){if(_0xdeb061[_0x27f1c9(0x13c)]){const _0x398508=_0xdeb061[_0x27f1c9(0x13c)][_0x27f1c9(0xc6)](apiConditionToYaml),_0x2609fc=_0xdeb061['description']!==undefined;if(_0x398508[_0x27f1c9(0x162)]===0x1&&!_0x2609fc)return _0x398508[0x0];return{'type':_0xdeb061[_0x27f1c9(0xcf)],'conditions':_0x398508,..._0xdeb061[_0x27f1c9(0x136)]!==undefined&&{'description':_0xdeb061[_0x27f1c9(0x136)]}};}}if(_0xdeb061[_0x27f1c9(0xcf)]==='Value'&&_0xdeb061[_0x27f1c9(0x10e)]&&_0xdeb061['operator']){const _0x17c7c1=_0xdeb061[_0x27f1c9(0x10e)][_0x27f1c9(0x128)]?buildAggregationDefFromApi(_0xdeb061['leftValue'][_0x27f1c9(0x128)]):undefined;if(isBehaviorApiCondition(_0xdeb061)){const _0x58bd69=_0xdeb061[_0x27f1c9(0x10e)][_0x27f1c9(0x155)]['name'];return{'type':_0x27f1c9(0xed),'attribute':'','operator':apiOperatorToYaml(_0xdeb061[_0x27f1c9(0x127)]),..._0xdeb061[_0x27f1c9(0x14c)]&&_0xdeb061[_0x27f1c9(0x14c)]!=='any'?{'arrayMatching':_0xdeb061['arrayMatching']}:{},..._0xdeb061['exclude']?{'exclude':_0xdeb061[_0x27f1c9(0x10c)]}:{},..._0x17c7c1?{'aggregation':_0x17c7c1}:{},'source':_0x58bd69,..._0xdeb061[_0x27f1c9(0x10e)][_0x27f1c9(0x12c)]?{'filter':apiRuleToYaml(_0xdeb061[_0x27f1c9(0x10e)][_0x27f1c9(0x12c)])}:{},..._0xdeb061[_0x27f1c9(0x134)]!==undefined&&_0xdeb061[_0x27f1c9(0x134)]!==null?{'limit':_0xdeb061[_0x27f1c9(0x134)]}:{}};}return{'type':_0x27f1c9(0x124),'attribute':_0xdeb061[_0x27f1c9(0x10e)]['name']||'','operator':apiOperatorToYaml(_0xdeb061['operator']),..._0xdeb061[_0x27f1c9(0x14c)]&&_0xdeb061[_0x27f1c9(0x14c)]!==_0x27f1c9(0x13a)?{'arrayMatching':_0xdeb061['arrayMatching']}:{},..._0xdeb061[_0x27f1c9(0x10c)]?{'exclude':_0xdeb061['exclude']}:{},..._0x17c7c1?{'aggregation':_0x17c7c1}:{},..._0xdeb061[_0x27f1c9(0x10e)][_0x27f1c9(0x12c)]?{'filter':apiRuleToYaml(_0xdeb061[_0x27f1c9(0x10e)]['filter'])}:{},..._0xdeb061[_0x27f1c9(0x134)]!==undefined&&_0xdeb061[_0x27f1c9(0x134)]!==null?{'limit':_0xdeb061['limit']}:{}};}if(_0xdeb061[_0x27f1c9(0xcf)]===_0x27f1c9(0xdd)&&_0xdeb061[_0x27f1c9(0x117)]&&_0xdeb061[_0x27f1c9(0x127)])return{'type':_0x27f1c9(0xdd),'column':_0xdeb061[_0x27f1c9(0x117)],'operator':apiOperatorToYaml(_0xdeb061['operator'])};if(_0xdeb061[_0x27f1c9(0xcf)]===_0x27f1c9(0xfd)&&_0xdeb061['id'])return{'type':_0xdeb061['exclude']?_0x27f1c9(0x10c):_0x27f1c9(0x113),'segment':_0xdeb061['id']};return{'type':_0x27f1c9(0xd6),'conditions':[]};}function isTemporalOperator(_0x42e620){const _0x300486=a142_0x39a3dd;return _0x42e620==='TimeWithinPast'||_0x42e620===_0x300486(0x10b);}function isBetweenOperator(_0x2b1835){const _0x5c48a3=a142_0x39a3dd;return _0x2b1835===_0x5c48a3(0xe0);}function getEffectiveValue(_0x11bb23){const _0x52dc16=a142_0x39a3dd,_0x162646=_0x11bb23[_0x52dc16(0xbf)];return _0x11bb23[_0x52dc16(0xb8)]??_0x162646;}function parseNumericValue(_0x1e0998){const _0x2e6564=a142_0x39a3dd;if(typeof _0x1e0998==='object'&&_0x1e0998!==null)return _0x1e0998;if(_0x1e0998==='')return _0x1e0998;const _0x3d6998=Number(_0x1e0998);return Number[_0x2e6564(0xe6)](_0x3d6998)?_0x3d6998:_0x1e0998;}function apiOperatorToYaml(_0x29f151){const _0x1e5f03=a142_0x39a3dd;if(isBetweenOperator(_0x29f151[_0x1e5f03(0xcf)]))return{'type':mapApiOperatorType(_0x29f151[_0x1e5f03(0xcf)]),..._0x29f151[_0x1e5f03(0x135)]!==undefined&&{'not':_0x29f151[_0x1e5f03(0x135)]},..._0x29f151[_0x1e5f03(0x15a)]!==undefined&&{'min':parseNumericValue(_0x29f151[_0x1e5f03(0x15a)])},..._0x29f151['maxValue']!==undefined&&{'max':parseNumericValue(_0x29f151[_0x1e5f03(0xd4)])}};if(_0x29f151[_0x1e5f03(0xcf)]==='TimeRange')return{'type':_0x1e5f03(0xba),..._0x29f151['not']!==undefined&&{'not':_0x29f151[_0x1e5f03(0x135)]},..._0x29f151[_0x1e5f03(0x16c)]!==undefined&&{'duration':_0x29f151[_0x1e5f03(0x16c)]},..._0x29f151[_0x1e5f03(0xd1)]!==undefined&&{'from':_0x29f151['from']},..._0x29f151[_0x1e5f03(0xff)]!==undefined&&{'reverse':_0x29f151['reverse']}};let _0x24abe2;if(_0x29f151[_0x1e5f03(0xf6)]&&_0x29f151['rightValues'][_0x1e5f03(0x162)]>0x0)_0x24abe2=_0x29f151['rightValues'];else{if(_0x29f151[_0x1e5f03(0x15c)]!==undefined)_0x24abe2=_0x29f151['rightValue'];else isTemporalOperator(_0x29f151[_0x1e5f03(0xcf)])&&_0x29f151[_0x1e5f03(0xb8)]!==undefined&&(_0x24abe2=_0x29f151[_0x1e5f03(0xb8)]);}return{'type':mapApiOperatorType(_0x29f151[_0x1e5f03(0xcf)]),..._0x29f151[_0x1e5f03(0x135)]!==undefined&&{'not':_0x29f151[_0x1e5f03(0x135)]},..._0x24abe2!==undefined&&{'value':_0x24abe2},..._0x29f151[_0x1e5f03(0x159)]!==undefined&&{'unit':_0x29f151[_0x1e5f03(0x159)]}};}function mapApiOperatorType(_0x474324){return _0x474324;}export function segmentDefToCreateRequest(_0x28b678,_0x3889d4){const _0x4618c4=a142_0x39a3dd,_0x25ca60={'name':_0x28b678[_0x4618c4(0x107)]};return _0x28b678['description']&&(_0x25ca60[_0x4618c4(0x136)]=_0x28b678[_0x4618c4(0x136)]),_0x28b678[_0x4618c4(0xc0)]&&(_0x25ca60[_0x4618c4(0xc0)]=yamlRuleToApi(_0x28b678[_0x4618c4(0xc0)])),_0x28b678['kind']&&(_0x25ca60['kind']=_0x28b678['kind']===_0x4618c4(0xd0)?0x0:_0x28b678[_0x4618c4(0xea)]===_0x4618c4(0x13d)?0x1:0x2),_0x28b678[_0x4618c4(0xfc)]!==undefined&&(_0x25ca60[_0x4618c4(0x11d)]=_0x28b678['visible']),_0x3889d4&&(_0x25ca60[_0x4618c4(0x145)]=_0x3889d4),_0x25ca60;}export function segmentDefToUpdateRequest(_0x4d8d06){const _0x5bf820=a142_0x39a3dd,_0xeaba26={'name':_0x4d8d06[_0x5bf820(0x107)]};return _0x4d8d06['description']!==undefined&&(_0xeaba26[_0x5bf820(0x136)]=_0x4d8d06['description']),_0x4d8d06['rule']&&(_0xeaba26[_0x5bf820(0xc0)]=yamlRuleToApi(_0x4d8d06[_0x5bf820(0xc0)])),_0x4d8d06[_0x5bf820(0xea)]&&(_0xeaba26[_0x5bf820(0xea)]=_0x4d8d06['kind']==='batch'?0x0:_0x4d8d06['kind']===_0x5bf820(0x13d)?0x1:0x2),_0xeaba26;}export function yamlRuleToApi(_0x14f9f5){const _0x5dcdec=a142_0x39a3dd,_0x200848=_0x14f9f5[_0x5dcdec(0x13c)][_0x5dcdec(0xc6)](yamlConditionToApi),_0x12c732=_0x200848['every'](_0x47546f=>isCompositeType(_0x47546f)&&_0x47546f[_0x5dcdec(0x136)]!==undefined);if(!_0x12c732&&_0x200848[_0x5dcdec(0x162)]>0x0){const _0x5a87b9=[];for(const _0x523ddb of _0x200848){isCompositeType(_0x523ddb)&&_0x523ddb[_0x5dcdec(0x136)]===undefined&&_0x523ddb['conditions']&&_0x523ddb[_0x5dcdec(0x13c)][_0x5dcdec(0x116)](_0x4d163f=>!isCompositeType(_0x4d163f))?_0x5a87b9['push']({'type':_0x523ddb['type'],'description':'','conditions':_0x523ddb['conditions']}):_0x5a87b9[_0x5dcdec(0x12f)]({'type':_0x5dcdec(0xd6),'description':_0x14f9f5[_0x5dcdec(0x136)]||'','conditions':[_0x523ddb]});}return{'type':_0x14f9f5['type'],'conditions':_0x5a87b9};}return{'type':_0x14f9f5[_0x5dcdec(0xcf)],'conditions':_0x200848,..._0x14f9f5[_0x5dcdec(0x136)]&&{'description':_0x14f9f5[_0x5dcdec(0x136)]}};}function yamlFilterRuleToApi(_0x10c422){const _0x413b99=a142_0x39a3dd,_0x1f5714=_0x10c422['conditions'][_0x413b99(0xc6)](yamlConditionToApi);return{'type':_0x10c422[_0x413b99(0xcf)],'conditions':_0x1f5714};}function yamlConditionToApi(_0x12c01c){const _0x51a305=a142_0x39a3dd;if('segment'in _0x12c01c&&(_0x12c01c[_0x51a305(0xcf)]===_0x51a305(0x113)||_0x12c01c[_0x51a305(0xcf)]===_0x51a305(0x10c))){const _0x165b0d=_0x12c01c;return{'type':_0x51a305(0xfd),'id':_0x165b0d[_0x51a305(0xe8)],'exclude':_0x165b0d['type']===_0x51a305(0x10c)};}if(_0x12c01c[_0x51a305(0xcf)]==='And'||_0x12c01c[_0x51a305(0xcf)]==='Or'){const _0x510988=_0x12c01c;return{'type':_0x510988[_0x51a305(0xcf)],'conditions':_0x510988['conditions'][_0x51a305(0xc6)](yamlConditionToApi),..._0x510988[_0x51a305(0x136)]&&{'description':_0x510988[_0x51a305(0x136)]}};}if('column'in _0x12c01c&&_0x12c01c[_0x51a305(0xcf)]==='Column'){const _0x58e29e=_0x12c01c;return{'type':_0x51a305(0xdd),'column':_0x58e29e[_0x51a305(0x117)],'operator':yamlOperatorToApi(_0x58e29e[_0x51a305(0x127)])};}const _0x6691fd=_0x12c01c,_0x3afd93={'type':_0x51a305(0x124),'leftValue':buildLeftValue(_0x6691fd),'operator':yamlOperatorToApi(_0x6691fd['operator']),'exclude':_0x6691fd[_0x51a305(0x10c)]??![],'arrayMatching':_0x6691fd['arrayMatching']??'any'};return _0x6691fd[_0x51a305(0x134)]!==undefined&&(_0x3afd93[_0x51a305(0x134)]=_0x6691fd[_0x51a305(0x134)]),_0x3afd93;}function buildAggregationDefFromApi(_0x4ca8ed){const _0x4d87ef=a142_0x39a3dd,_0x59c099=_0x4ca8ed['type'];if(_0x59c099===_0x4d87ef(0xe9))return{'type':_0x59c099,'columns':_0x4ca8ed[_0x4d87ef(0xee)]??[]};if(_0x59c099===_0x4d87ef(0x129)||_0x59c099===_0x4d87ef(0xb6))return{'type':_0x59c099,'column':_0x4ca8ed[_0x4d87ef(0x117)]??'','orderColumn':_0x4ca8ed[_0x4d87ef(0x167)]??'',..._0x4ca8ed[_0x4d87ef(0x108)]&&{'groupingColumns':_0x4ca8ed[_0x4d87ef(0x108)]}};if(_0x59c099===_0x4d87ef(0x16d))return{'type':_0x59c099,..._0x4ca8ed['groupingColumns']&&{'groupingColumns':_0x4ca8ed[_0x4d87ef(0x108)]}};return{'type':_0x59c099,'column':_0x4ca8ed[_0x4d87ef(0x117)]??'',..._0x4ca8ed[_0x4d87ef(0x108)]&&{'groupingColumns':_0x4ca8ed[_0x4d87ef(0x108)]}};}function buildLeftValue(_0x37153d){const _0x5cd60e=a142_0x39a3dd,_0x433f3b={};_0x37153d[_0x5cd60e(0x115)]&&_0x37153d[_0x5cd60e(0xcf)]!=='Behavior'&&(_0x433f3b[_0x5cd60e(0x107)]=_0x37153d['attribute']);if(_0x37153d[_0x5cd60e(0x128)]){const _0x6ae189=_0x37153d['aggregation'];if(_0x6ae189[_0x5cd60e(0xcf)]==='CountDistinct')_0x433f3b['aggregation']={'type':_0x5cd60e(0xe9),'columns':_0x6ae189[_0x5cd60e(0xee)]};else{if(_0x6ae189['type']===_0x5cd60e(0x129)||_0x6ae189[_0x5cd60e(0xcf)]===_0x5cd60e(0xb6))_0x433f3b[_0x5cd60e(0x128)]={'type':_0x6ae189[_0x5cd60e(0xcf)],'column':_0x6ae189['column'],'orderColumn':_0x6ae189[_0x5cd60e(0x167)],..._0x6ae189['groupingColumns']&&{'groupingColumns':_0x6ae189['groupingColumns']}};else _0x6ae189['type']===_0x5cd60e(0x16d)?_0x433f3b[_0x5cd60e(0x128)]={'type':_0x5cd60e(0x16d),..._0x6ae189[_0x5cd60e(0x108)]&&{'groupingColumns':_0x6ae189[_0x5cd60e(0x108)]}}:_0x433f3b['aggregation']={'type':_0x6ae189['type'],'column':_0x6ae189[_0x5cd60e(0x117)],..._0x6ae189[_0x5cd60e(0x108)]&&{'groupingColumns':_0x6ae189[_0x5cd60e(0x108)]}};}}return _0x37153d[_0x5cd60e(0x155)]&&(_0x433f3b[_0x5cd60e(0x155)]={'name':_0x37153d[_0x5cd60e(0x155)]}),_0x37153d['filter']&&(_0x433f3b[_0x5cd60e(0x12c)]=yamlFilterRuleToApi(filterRuleAsRuleDef(_0x37153d[_0x5cd60e(0x12c)]))),_0x433f3b;}function yamlOperatorToApi(_0xfe5969){const _0x37905c=a142_0x39a3dd,_0x4316b6={'type':mapYamlOperatorType(_0xfe5969[_0x37905c(0xcf)]),'not':_0xfe5969['not']??![]};if(isBetweenOperator(_0xfe5969[_0x37905c(0xcf)]))return _0xfe5969['min']!==undefined&&(_0x4316b6[_0x37905c(0x15a)]=typeof _0xfe5969[_0x37905c(0x146)]===_0x37905c(0xd3)?_0xfe5969['min']:String(_0xfe5969['min'])),_0xfe5969['max']!==undefined&&(_0x4316b6[_0x37905c(0xd4)]=typeof _0xfe5969['max']===_0x37905c(0xd3)?_0xfe5969[_0x37905c(0xb7)]:String(_0xfe5969[_0x37905c(0xb7)])),_0x4316b6;if(_0xfe5969[_0x37905c(0xcf)]===_0x37905c(0xba))return _0xfe5969[_0x37905c(0x16c)]&&(_0x4316b6[_0x37905c(0x16c)]=_0xfe5969[_0x37905c(0x16c)]),_0xfe5969[_0x37905c(0xd1)]&&(_0x4316b6[_0x37905c(0xd1)]=_0xfe5969[_0x37905c(0xd1)]),_0xfe5969[_0x37905c(0xff)]!==undefined&&(_0x4316b6['reverse']=_0xfe5969['reverse']),_0x4316b6;const _0x1473e2=getEffectiveValue(_0xfe5969);if(_0x1473e2!==undefined){if(Array[_0x37905c(0xe7)](_0x1473e2))_0x4316b6[_0x37905c(0xf6)]=_0x1473e2;else isTemporalOperator(_0xfe5969[_0x37905c(0xcf)])?_0x4316b6['value']=_0x1473e2:_0x4316b6['rightValue']=_0x1473e2;}return _0xfe5969[_0x37905c(0x159)]&&(_0x4316b6['unit']=_0xfe5969[_0x37905c(0x159)]),_0x4316b6;}function mapYamlOperatorType(_0x6984ac){return _0x6984ac;}function a142_0x5a93(_0x228ba7,_0x1b2d18){_0x228ba7=_0x228ba7-0xb4;const _0x350c36=a142_0x350c();let _0x5a936c=_0x350c36[_0x228ba7];return _0x5a936c;}export function toYamlString(_0x13f84c){const _0x33ac91=a142_0x39a3dd,_0x487dbd=JSON[_0x33ac91(0xcc)](JSON[_0x33ac91(0xb4)](_0x13f84c)),_0x434b96=a142_0x561a0a[_0x33ac91(0xb4)](_0x487dbd,{'indent':0x2,'lineWidth':0x0,'nullStr':_0x33ac91(0xe2)}),_0x37ee9c=[_0x33ac91(0x123)];let _0x57f438=_0x434b96;for(const _0x51eae1 of _0x37ee9c){_0x57f438=_0x57f438['replace'](new RegExp('^('+_0x51eae1+')','m'),(_0x2a564a,_0x3594ad,_0xedb92d)=>{if(_0xedb92d===0x0||_0x57f438[_0xedb92d-0x1]==='\x0a'&&_0x57f438[_0xedb92d-0x2]==='\x0a')return _0x3594ad;return'\x0a'+_0x3594ad;});}return _0x57f438;}export function parseYamlString(_0x32808a){return parseSegmentYamlFile(_0x32808a);}export function isSegmentYaml(_0x2ec106){const _0x57de5a=a142_0x39a3dd;if(typeof _0x2ec106!==_0x57de5a(0xd3)||_0x2ec106===null)return![];const _0x4e073d=_0x2ec106;return _0x4e073d[_0x57de5a(0xcf)]==='segment'||_0x4e073d[_0x57de5a(0xcf)]===undefined;}export function generateTemplate(_0x53dc25=a142_0x39a3dd(0x156)){const _0x48207b=a142_0x39a3dd,_0x3783e1={'type':_0x48207b(0xe8),'name':_0x53dc25,'description':'Segment\x20description','rule':{'type':'And','conditions':[{'type':_0x48207b(0x124),'attribute':_0x48207b(0xc8),'operator':{'type':_0x48207b(0x160),'value':_0x48207b(0xb8)}}]}};return toYamlString(_0x3783e1);}export function segmentToYamlString(_0x2996d2){const _0x24c57a=a142_0x39a3dd,_0x2e535c=JSON['parse'](JSON[_0x24c57a(0xb4)](_0x2996d2)),_0x36b36e=a142_0x561a0a[_0x24c57a(0xb4)](_0x2e535c,{'indent':0x2,'lineWidth':0x0,'nullStr':'null'}),_0xfb8d84=[_0x24c57a(0x123),_0x24c57a(0x139)];let _0x2e051b=_0x36b36e;for(const _0x31194b of _0xfb8d84){_0x2e051b=_0x2e051b['replace'](new RegExp('^('+_0x31194b+')','m'),(_0x205f73,_0x199f4d,_0x1aa0b9)=>{if(_0x1aa0b9===0x0||_0x2e051b[_0x1aa0b9-0x1]==='\x0a'&&_0x2e051b[_0x1aa0b9-0x2]==='\x0a')return _0x199f4d;return'\x0a'+_0x199f4d;});}return _0x2e051b;}export function parseSegmentYamlFile(_0x332475){return safeParseYaml(_0x332475,SegmentDefSchema);}export function normalizeChildSegmentYaml(_0x5dafe8){const _0x3af01f=a142_0x39a3dd;return{'type':_0x3af01f(0xe8),'name':_0x5dafe8[_0x3af01f(0x107)],..._0x5dafe8[_0x3af01f(0x136)]!==undefined&&{'description':_0x5dafe8[_0x3af01f(0x136)]},..._0x5dafe8[_0x3af01f(0x15d)]!==undefined&&{'folder':_0x5dafe8[_0x3af01f(0x15d)]},..._0x5dafe8[_0x3af01f(0xc0)]&&{'rule':normalizeRule(_0x5dafe8['rule'])},..._0x5dafe8[_0x3af01f(0xea)]!==undefined&&{'kind':_0x5dafe8['kind']},..._0x5dafe8[_0x3af01f(0xfc)]!==undefined&&{'visible':_0x5dafe8[_0x3af01f(0xfc)]},..._0x5dafe8[_0x3af01f(0xf1)]&&{'activations':_0x5dafe8['activations']['map'](normalizeActivation)}};}export function normalizeRule(_0x2ec465){const _0x59da4b=a142_0x39a3dd;return{'type':_0x2ec465['type'],'conditions':_0x2ec465['conditions'][_0x59da4b(0xc6)](normalizeCondition),..._0x2ec465[_0x59da4b(0x136)]!==undefined&&{'description':_0x2ec465['description']}};}function normalizeCondition(_0x7742ba){const _0x574626=a142_0x39a3dd;if(_0x574626(0xe8)in _0x7742ba&&(_0x7742ba['type']===_0x574626(0x113)||_0x7742ba[_0x574626(0xcf)]===_0x574626(0x10c))){const _0x2af6c5=_0x7742ba;return{'type':_0x2af6c5[_0x574626(0xcf)],'segment':_0x2af6c5[_0x574626(0xe8)]};}if(_0x7742ba['type']===_0x574626(0xd6)||_0x7742ba[_0x574626(0xcf)]==='Or'){const _0xa50006=_0x7742ba;return{'type':_0xa50006[_0x574626(0xcf)],'conditions':_0xa50006[_0x574626(0x13c)][_0x574626(0xc6)](normalizeCondition),..._0xa50006[_0x574626(0x136)]!==undefined&&{'description':_0xa50006['description']}};}if(_0x574626(0x117)in _0x7742ba&&_0x7742ba['type']==='Column'){const _0x1abb27=_0x7742ba;return{'type':_0x574626(0xdd),'column':_0x1abb27[_0x574626(0x117)],'operator':normalizeOperator(_0x1abb27[_0x574626(0x127)])};}if(_0x7742ba[_0x574626(0xcf)]===_0x574626(0xed)){const _0x248bd6=_0x7742ba;return{'type':_0x574626(0xed),'attribute':_0x248bd6['attribute'],'operator':normalizeOperator(_0x248bd6[_0x574626(0x127)]),..._0x248bd6['arrayMatching']!==undefined&&{'arrayMatching':_0x248bd6[_0x574626(0x14c)]},..._0x248bd6[_0x574626(0x10c)]!==undefined&&{'exclude':_0x248bd6['exclude']},..._0x248bd6[_0x574626(0x128)]!==undefined&&{'aggregation':_0x248bd6['aggregation']},..._0x248bd6['source']!==undefined&&{'source':_0x248bd6[_0x574626(0x155)]},..._0x248bd6[_0x574626(0x12c)]!==undefined&&{'filter':ruleDefAsFilterRule(normalizeRule(filterRuleAsRuleDef(_0x248bd6['filter'])))},..._0x248bd6[_0x574626(0x12d)]!==undefined&&{'timeWindow':_0x248bd6['timeWindow']},..._0x248bd6[_0x574626(0x134)]!==undefined&&{'limit':_0x248bd6['limit']}};}const _0x106c3e=_0x7742ba;return{'type':'Value','attribute':_0x106c3e[_0x574626(0x115)],'operator':normalizeOperator(_0x106c3e[_0x574626(0x127)]),..._0x106c3e['arrayMatching']!==undefined&&{'arrayMatching':_0x106c3e[_0x574626(0x14c)]},..._0x106c3e[_0x574626(0x10c)]!==undefined&&{'exclude':_0x106c3e[_0x574626(0x10c)]},..._0x106c3e[_0x574626(0x128)]!==undefined&&{'aggregation':_0x106c3e[_0x574626(0x128)]},..._0x106c3e[_0x574626(0x155)]!==undefined&&{'source':_0x106c3e[_0x574626(0x155)]},..._0x106c3e[_0x574626(0x12c)]!==undefined&&{'filter':ruleDefAsFilterRule(normalizeRule(filterRuleAsRuleDef(_0x106c3e[_0x574626(0x12c)])))},..._0x106c3e[_0x574626(0x134)]!==undefined&&{'limit':_0x106c3e[_0x574626(0x134)]}};}function normalizeOperator(_0x1271ab){const _0x42ad8e=a142_0x39a3dd;if(isBetweenOperator(_0x1271ab[_0x42ad8e(0xcf)]))return{'type':_0x1271ab[_0x42ad8e(0xcf)],..._0x1271ab[_0x42ad8e(0x135)]!==undefined&&{'not':_0x1271ab[_0x42ad8e(0x135)]},..._0x1271ab[_0x42ad8e(0x146)]!==undefined&&{'min':_0x1271ab[_0x42ad8e(0x146)]},..._0x1271ab[_0x42ad8e(0xb7)]!==undefined&&{'max':_0x1271ab[_0x42ad8e(0xb7)]}};const _0x56eb09=getEffectiveValue(_0x1271ab);return{'type':_0x1271ab[_0x42ad8e(0xcf)],..._0x1271ab[_0x42ad8e(0x135)]!==undefined&&{'not':_0x1271ab['not']},..._0x56eb09!==undefined&&{'value':_0x56eb09},..._0x1271ab[_0x42ad8e(0x159)]!==undefined&&{'unit':_0x1271ab[_0x42ad8e(0x159)]},..._0x1271ab[_0x42ad8e(0x16c)]!==undefined&&{'duration':_0x1271ab[_0x42ad8e(0x16c)]},..._0x1271ab[_0x42ad8e(0xd1)]!==undefined&&{'from':_0x1271ab[_0x42ad8e(0xd1)]},..._0x1271ab[_0x42ad8e(0xff)]!==undefined&&{'reverse':_0x1271ab[_0x42ad8e(0xff)]}};}function normalizeActivation(_0x511460){const _0x2c3810=a142_0x39a3dd;return{'name':_0x511460[_0x2c3810(0x107)],'connection':_0x511460[_0x2c3810(0x132)],..._0x511460['description']!==undefined&&{'description':_0x511460[_0x2c3810(0x136)]},..._0x511460[_0x2c3810(0x151)]!==undefined&&{'all_columns':_0x511460[_0x2c3810(0x151)]},..._0x511460[_0x2c3810(0xee)]!==undefined&&{'columns':_0x511460[_0x2c3810(0xee)]},..._0x511460[_0x2c3810(0x112)]!==undefined&&{'behavior':_0x511460[_0x2c3810(0x112)]},..._0x511460[_0x2c3810(0xc3)]!==undefined&&{'schedule':_0x511460[_0x2c3810(0xc3)]},..._0x511460[_0x2c3810(0x13f)]!==undefined&&{'notification':_0x511460['notification']},..._0x511460['connector_config']!==undefined&&{'connector_config':_0x511460[_0x2c3810(0x168)]},..._0x511460[_0x2c3810(0x10f)]!==undefined&&{'activation_template_id':_0x511460[_0x2c3810(0x10f)]},..._0x511460[_0x2c3810(0x13b)]!==undefined&&{'nested_workflow_project_name':_0x511460[_0x2c3810(0x13b)]},..._0x511460[_0x2c3810(0x144)]!==undefined&&{'nested_workflow_name':_0x511460[_0x2c3810(0x144)]},..._0x511460[_0x2c3810(0xe4)]!==undefined&&{'lock_enabled':_0x511460[_0x2c3810(0xe4)]}};}function getColumnName(_0x3db5a3){const _0x1c6c85=a142_0x39a3dd;return _0x3db5a3[_0x1c6c85(0x117)]||_0x3db5a3['name'];}export function activationResponseToDef(_0x461d83,_0x140e9d,_0x503ebf){const _0x365f02=a142_0x39a3dd,_0x56d465=_0x461d83[_0x365f02(0x14f)]||'',_0x4fde0f=_0x503ebf?.[_0x365f02(0x153)](_0x56d465)??_0x56d465,_0x2272d9={'name':_0x461d83[_0x365f02(0x107)],'connection':_0x4fde0f};_0x461d83['description']&&(_0x2272d9['description']=_0x461d83[_0x365f02(0x136)]);let _0x1e0521=[];_0x461d83[_0x365f02(0xee)]&&_0x461d83[_0x365f02(0xee)][_0x365f02(0x162)]>0x0&&(_0x1e0521=_0x461d83[_0x365f02(0xee)]['filter'](_0x50aaf6=>_0x50aaf6&&getColumnName(_0x50aaf6))[_0x365f02(0xc6)](_0x52607c=>{const _0x36af20=_0x365f02,_0x53cb3e=getColumnName(_0x52607c);if(_0x52607c[_0x36af20(0xcf)]||_0x52607c[_0x36af20(0x161)])return{'name':_0x53cb3e,..._0x52607c[_0x36af20(0xcf)]&&{'type':_0x52607c[_0x36af20(0xcf)]},..._0x52607c[_0x36af20(0x161)]&&{'visibility':_0x52607c[_0x36af20(0x161)]}};return _0x53cb3e;}));_0x1e0521[_0x365f02(0x162)]>0x0&&(_0x2272d9[_0x365f02(0xee)]=_0x1e0521);_0x461d83[_0x365f02(0xf3)]!==undefined&&(_0x461d83[_0x365f02(0xf3)]===![]&&_0x1e0521[_0x365f02(0x162)]===0x0?_0x2272d9[_0x365f02(0x151)]=!![]:_0x2272d9[_0x365f02(0x151)]=_0x461d83[_0x365f02(0xf3)]);const _0x3169cd={};let _0x59a593=![];_0x461d83[_0x365f02(0x15f)]&&(_0x3169cd['type']=_0x461d83[_0x365f02(0x15f)],_0x59a593=!![]);_0x461d83[_0x365f02(0x16a)]&&(_0x3169cd['repeat_unit']=_0x461d83[_0x365f02(0x16a)],_0x59a593=!![]);_0x461d83['repeatFrequency']!==undefined&&_0x461d83[_0x365f02(0xd9)]!==null&&(_0x3169cd[_0x365f02(0xf7)]=_0x461d83['repeatFrequency'],_0x59a593=!![]);_0x461d83[_0x365f02(0x103)]&&_0x461d83[_0x365f02(0x103)][_0x365f02(0x162)]>0x0&&(_0x3169cd[_0x365f02(0xca)]=_0x461d83[_0x365f02(0x103)],_0x59a593=!![]);_0x461d83[_0x365f02(0x12e)]!==undefined&&(_0x3169cd[_0x365f02(0xeb)]=_0x461d83[_0x365f02(0x12e)],_0x59a593=!![]);_0x461d83[_0x365f02(0x14a)]!==undefined&&(_0x3169cd[_0x365f02(0x104)]=_0x461d83[_0x365f02(0x14a)],_0x59a593=!![]);_0x461d83[_0x365f02(0xd7)]&&(_0x3169cd['timezone']=_0x461d83['timezone'],_0x59a593=!![]);_0x59a593&&(_0x2272d9[_0x365f02(0xc3)]=_0x3169cd);(_0x461d83['notifyOn']&&_0x461d83[_0x365f02(0x100)]['length']>0x0||_0x461d83['emailRecipients']&&_0x461d83[_0x365f02(0x138)][_0x365f02(0x162)]>0x0)&&(_0x2272d9[_0x365f02(0x13f)]={},_0x461d83['notifyOn']&&_0x461d83[_0x365f02(0x100)][_0x365f02(0x162)]>0x0&&(_0x2272d9[_0x365f02(0x13f)][_0x365f02(0x152)]=_0x461d83[_0x365f02(0x100)]),_0x461d83[_0x365f02(0x138)]&&_0x461d83[_0x365f02(0x138)][_0x365f02(0x162)]>0x0&&(_0x2272d9[_0x365f02(0x13f)][_0x365f02(0x114)]=_0x461d83[_0x365f02(0x138)][_0x365f02(0xc6)](_0x2c2c7a=>{const _0x350629=_0x365f02,_0x439037=_0x140e9d?.[_0x350629(0x153)](_0x2c2c7a);return _0x439037??String(_0x2c2c7a);})));_0x461d83[_0x365f02(0x122)]&&Object[_0x365f02(0x11f)](_0x461d83['connectorConfig'])[_0x365f02(0x162)]>0x0&&(_0x2272d9['connector_config']=normalizeConnectorConfigForYaml(_0x461d83[_0x365f02(0x122)]));_0x461d83[_0x365f02(0x10d)]&&(_0x2272d9[_0x365f02(0x10f)]=_0x461d83['activationTemplateId']);if(_0x461d83[_0x365f02(0x15b)]){const _0x34b1d2={},_0xdd766a=_0x461d83['syndicationBehavior'];_0xdd766a[_0x365f02(0xee)]&&_0xdd766a[_0x365f02(0xee)][_0x365f02(0x162)]>0x0&&(_0x34b1d2['columns']=_0xdd766a[_0x365f02(0xee)][_0x365f02(0x12c)](_0x63d277=>_0x63d277&&getColumnName(_0x63d277))[_0x365f02(0xc6)](_0x237090=>({'name':getColumnName(_0x237090),..._0x237090[_0x365f02(0xcf)]&&{'type':_0x237090[_0x365f02(0xcf)]},..._0x237090[_0x365f02(0x161)]&&{'visibility':_0x237090[_0x365f02(0x161)]}}))),_0xdd766a[_0x365f02(0x14e)]&&(_0x34b1d2[_0x365f02(0xf2)]=_0xdd766a[_0x365f02(0x14e)]),_0xdd766a[_0x365f02(0x150)]!==undefined&&(_0x34b1d2['join_row']=_0xdd766a[_0x365f02(0x150)]),_0xdd766a[_0x365f02(0x11c)]&&(_0x34b1d2[_0x365f02(0x137)]=_0xdd766a[_0x365f02(0x11c)]),_0xdd766a[_0x365f02(0x165)]&&(_0x34b1d2[_0x365f02(0x165)]=_0xdd766a['formatting']),_0xdd766a[_0x365f02(0x10a)]&&_0xdd766a['orderBy']['length']>0x0&&(_0x34b1d2[_0x365f02(0xf9)]=_0xdd766a[_0x365f02(0x10a)]),Object[_0x365f02(0x11f)](_0x34b1d2)['length']>0x0&&(_0x2272d9[_0x365f02(0x112)]=_0x34b1d2);}return _0x461d83[_0x365f02(0x118)]&&(_0x2272d9['nested_workflow_project_name']=_0x461d83[_0x365f02(0x118)]),_0x461d83[_0x365f02(0x154)]&&(_0x2272d9[_0x365f02(0x144)]=_0x461d83[_0x365f02(0x154)]),_0x461d83[_0x365f02(0x109)]!==undefined&&(_0x2272d9[_0x365f02(0xe4)]=_0x461d83[_0x365f02(0x109)]),_0x2272d9;}export function journeyActivationStepToYaml(_0x583686,_0x2b141f,_0x57201b){const _0x1dc449=a142_0x39a3dd,_0x224c04=_0x583686[_0x1dc449(0x15e)][_0x1dc449(0x11e)],_0xa4795c=_0x224c04[_0x1dc449(0x14f)]||'',_0x2f3ea2=_0x57201b?.[_0x1dc449(0x153)](_0xa4795c)??_0xa4795c,_0x44d457={'name':_0x224c04[_0x1dc449(0x107)]||'','connection':_0x2f3ea2};_0x583686[_0x1dc449(0x15e)][_0x1dc449(0xfe)]&&(_0x44d457[_0x1dc449(0x169)]=!![]);_0x224c04[_0x1dc449(0x136)]&&(_0x44d457[_0x1dc449(0x136)]=_0x224c04[_0x1dc449(0x136)]);let _0x2ed721=[];_0x224c04['columns']&&_0x224c04[_0x1dc449(0xee)][_0x1dc449(0x162)]>0x0&&(_0x2ed721=_0x224c04[_0x1dc449(0xee)][_0x1dc449(0x12c)](_0x3c7de6=>_0x3c7de6&&getColumnName(_0x3c7de6))[_0x1dc449(0xc6)](_0x246ea3=>{const _0x5e933e=_0x1dc449,_0x1cabc6=getColumnName(_0x246ea3);if(_0x246ea3[_0x5e933e(0xcf)]||_0x246ea3[_0x5e933e(0x161)])return{'name':_0x1cabc6,..._0x246ea3['type']&&{'type':_0x246ea3[_0x5e933e(0xcf)]},..._0x246ea3[_0x5e933e(0x161)]&&{'visibility':_0x246ea3[_0x5e933e(0x161)]}};return _0x1cabc6;}));_0x2ed721[_0x1dc449(0x162)]>0x0&&(_0x44d457[_0x1dc449(0xee)]=_0x2ed721);_0x224c04['allColumns']!==undefined&&(_0x224c04['allColumns']===![]&&_0x2ed721[_0x1dc449(0x162)]===0x0?_0x44d457[_0x1dc449(0x151)]=!![]:_0x44d457[_0x1dc449(0x151)]=_0x224c04[_0x1dc449(0xf3)]);const _0x5231e6={};let _0x4454fb=![];_0x224c04[_0x1dc449(0x15f)]&&(_0x5231e6[_0x1dc449(0xcf)]=_0x224c04[_0x1dc449(0x15f)],_0x4454fb=!![]);_0x224c04[_0x1dc449(0x16a)]&&(_0x5231e6[_0x1dc449(0xf0)]=_0x224c04['repeatUnit'],_0x4454fb=!![]);_0x224c04[_0x1dc449(0xd9)]!==undefined&&_0x224c04[_0x1dc449(0xd9)]!==null&&(_0x5231e6['repeat_frequency']=_0x224c04[_0x1dc449(0xd9)],_0x4454fb=!![]);_0x224c04[_0x1dc449(0x12e)]!==undefined&&(_0x5231e6[_0x1dc449(0xeb)]=_0x224c04[_0x1dc449(0x12e)],_0x4454fb=!![]);_0x224c04[_0x1dc449(0x14a)]!==undefined&&(_0x5231e6['end_on']=_0x224c04[_0x1dc449(0x14a)],_0x4454fb=!![]);_0x224c04['timezone']&&(_0x5231e6[_0x1dc449(0xd7)]=_0x224c04[_0x1dc449(0xd7)],_0x4454fb=!![]);_0x4454fb&&(_0x44d457[_0x1dc449(0xc3)]=_0x5231e6);(_0x224c04[_0x1dc449(0x100)]&&_0x224c04['notifyOn']['length']>0x0||_0x224c04['emailRecipients']&&_0x224c04[_0x1dc449(0x138)][_0x1dc449(0x162)]>0x0)&&(_0x44d457[_0x1dc449(0x13f)]={},_0x224c04[_0x1dc449(0x100)]&&_0x224c04[_0x1dc449(0x100)][_0x1dc449(0x162)]>0x0&&(_0x44d457[_0x1dc449(0x13f)][_0x1dc449(0x152)]=_0x224c04[_0x1dc449(0x100)]),_0x224c04['emailRecipients']&&_0x224c04[_0x1dc449(0x138)][_0x1dc449(0x162)]>0x0&&(_0x44d457['notification'][_0x1dc449(0x114)]=_0x224c04['emailRecipients']['map'](_0x561720=>{const _0x311756=_0x1dc449,_0x20aba0=_0x2b141f?.[_0x311756(0x153)](_0x561720);return _0x20aba0??String(_0x561720);})));_0x224c04[_0x1dc449(0x122)]&&Object[_0x1dc449(0x11f)](_0x224c04[_0x1dc449(0x122)])[_0x1dc449(0x162)]>0x0&&(_0x44d457[_0x1dc449(0x168)]=normalizeConnectorConfigForYaml(_0x224c04[_0x1dc449(0x122)]));_0x224c04['activationTemplateId']&&(_0x44d457[_0x1dc449(0x10f)]=_0x224c04[_0x1dc449(0x10d)]);if(_0x224c04[_0x1dc449(0x15b)]){const _0x911c52={},_0x95257f=_0x224c04[_0x1dc449(0x15b)];_0x95257f[_0x1dc449(0xee)]&&_0x95257f[_0x1dc449(0xee)]['length']>0x0&&(_0x911c52[_0x1dc449(0xee)]=_0x95257f[_0x1dc449(0xee)]['filter'](_0x2bb81d=>_0x2bb81d&&getColumnName(_0x2bb81d))[_0x1dc449(0xc6)](_0xd19bf3=>({'name':getColumnName(_0xd19bf3),..._0xd19bf3[_0x1dc449(0xcf)]&&{'type':_0xd19bf3[_0x1dc449(0xcf)]},..._0xd19bf3[_0x1dc449(0x161)]&&{'visibility':_0xd19bf3[_0x1dc449(0x161)]}}))),_0x95257f[_0x1dc449(0x14e)]&&(_0x911c52[_0x1dc449(0xf2)]=_0x95257f['behaviorTableName']),_0x95257f[_0x1dc449(0x150)]!==undefined&&(_0x911c52[_0x1dc449(0xfb)]=_0x95257f['joinRow']),_0x95257f['joinStrategy']&&(_0x911c52[_0x1dc449(0x137)]=_0x95257f[_0x1dc449(0x11c)]),_0x95257f['formatting']&&(_0x911c52[_0x1dc449(0x165)]=_0x95257f[_0x1dc449(0x165)]),_0x95257f[_0x1dc449(0x10a)]&&_0x95257f[_0x1dc449(0x10a)][_0x1dc449(0x162)]>0x0&&(_0x911c52[_0x1dc449(0xf9)]=_0x95257f[_0x1dc449(0x10a)]),Object[_0x1dc449(0x11f)](_0x911c52)[_0x1dc449(0x162)]>0x0&&(_0x44d457[_0x1dc449(0x112)]=_0x911c52);}return _0x44d457;}export function segmentWithActivationsToYaml(_0x549c17,_0x1d9731,_0x4abb4b,_0x207eed,_0x559ada){const _0x10d0ae=a142_0x39a3dd,_0x23524d=segmentResponseToDefSync(_0x549c17,_0x4abb4b);return _0x1d9731[_0x10d0ae(0x162)]>0x0&&(_0x23524d[_0x10d0ae(0xf1)]=_0x1d9731['map'](_0x5c8ef4=>activationResponseToDef(_0x5c8ef4,_0x207eed,_0x559ada))),_0x23524d;}function normalizeColumn(_0x5d25bb){const _0x5903df=a142_0x39a3dd;if(typeof _0x5d25bb===_0x5903df(0xf8))return{'column':_0x5d25bb,'source':{'column':_0x5d25bb}};return{'column':_0x5d25bb['name'],'source':{'column':_0x5d25bb[_0x5903df(0x107)]},..._0x5d25bb[_0x5903df(0xcf)]&&{'type':_0x5d25bb['type']},..._0x5d25bb['visibility']&&{'visibility':_0x5d25bb[_0x5903df(0x161)]}};}const KNOWN_ACTIVATION_FIELDS=new Set(Object[a142_0x39a3dd(0x11f)](ActivationDefSchema[a142_0x39a3dd(0x14d)]));export function warnUnrecognizedActivationFields(_0x5adbd5,_0x3547f8){const _0x11de8e=a142_0x39a3dd,_0x6f4ae5=Object[_0x11de8e(0x11f)](_0x5adbd5)[_0x11de8e(0x12c)](_0x4d404a=>!KNOWN_ACTIVATION_FIELDS['has'](_0x4d404a));if(_0x6f4ae5[_0x11de8e(0x162)]>0x0){const _0x2a1277=_0x6f4ae5['map'](_0x3e30be=>_0x11de8e(0x12b)+_0x3e30be+'\x22')[_0x11de8e(0xf4)]('\x0a');console[_0x11de8e(0xe3)](_0x11de8e(0xb9)+_0x3547f8+'\x22\x20has\x20unrecognized\x20fields\x20(will\x20be\x20ignored):\x0a'+_0x2a1277);}}export async function activationDefToCreateRequest(_0xf8601d,_0x14c547){const _0x131d33=a142_0x39a3dd;warnUnrecognizedActivationFields(_0xf8601d,_0xf8601d[_0x131d33(0x107)]);const _0x1a4a56=_0x14c547?.[_0x131d33(0x119)],_0x372293=_0x14c547?.[_0x131d33(0x110)],_0x57061a=_0xf8601d['connection'];let _0x3a92d0;const _0x2d21=parseInt(_0x57061a,0xa);if(!isNaN(_0x2d21)&&String(_0x2d21)===_0x57061a)_0x3a92d0=_0x2d21;else{const _0x4f7529=_0x372293?.[_0x131d33(0x153)](_0x57061a);if(_0x4f7529===undefined)throw new SDKError(ErrorCode[_0x131d33(0xd2)],_0x131d33(0x121)+_0x57061a,undefined,{'helpText':_0x131d33(0xde)});_0x3a92d0=_0x4f7529;}const _0x13a037={'name':_0xf8601d[_0x131d33(0x107)],'connectionId':_0x3a92d0};_0xf8601d['description']&&(_0x13a037[_0x131d33(0x136)]=_0xf8601d[_0x131d33(0x136)]);let _0x51fef3=[];_0xf8601d[_0x131d33(0xee)]&&_0xf8601d[_0x131d33(0xee)]['length']>0x0&&(_0x51fef3=_0xf8601d['columns'][_0x131d33(0x12c)](_0x3987c6=>_0x3987c6!=null)[_0x131d33(0xc6)](normalizeColumn));_0x51fef3[_0x131d33(0x162)]>0x0&&(_0x13a037[_0x131d33(0xee)]=_0x51fef3);_0xf8601d[_0x131d33(0x151)]!==undefined&&(_0xf8601d['all_columns']===![]&&_0x51fef3[_0x131d33(0x162)]===0x0?_0x13a037['allColumns']=!![]:_0x13a037[_0x131d33(0xf3)]=_0xf8601d['all_columns']);if(_0xf8601d[_0x131d33(0xc3)]){const _0x4a7bd0=_0xf8601d['schedule'],_0x18b7ac=_0x4a7bd0['type']??REPEAT_UNIT_TO_SCHEDULE_TYPE[_0x4a7bd0[_0x131d33(0xf0)]];_0x18b7ac&&(_0x13a037[_0x131d33(0x15f)]=_0x18b7ac);const _0x4cb6fd=_0x4a7bd0['repeat_unit']??SCHEDULE_TYPE_TO_REPEAT_UNIT[_0x4a7bd0['type']];_0x4cb6fd&&(_0x13a037[_0x131d33(0x16a)]=_0x4cb6fd);_0x4a7bd0['repeat_frequency']!==undefined&&(_0x13a037[_0x131d33(0xd9)]=_0x4a7bd0[_0x131d33(0xf7)]);_0x4a7bd0[_0x131d33(0xca)]&&(_0x13a037[_0x131d33(0x103)]=_0x4a7bd0[_0x131d33(0xca)]);_0x4a7bd0['start_at']!==undefined&&(_0x13a037[_0x131d33(0x12e)]=_0x4a7bd0[_0x131d33(0xeb)]);_0x4a7bd0[_0x131d33(0x104)]!==undefined&&(_0x13a037['endOn']=_0x4a7bd0[_0x131d33(0x104)]);_0x4a7bd0[_0x131d33(0xd7)]&&(_0x13a037['timezone']=_0x4a7bd0[_0x131d33(0xd7)]);if(_0x18b7ac&&_0x18b7ac!==_0x131d33(0x16e)&&_0x18b7ac!=='cron'&&_0x4a7bd0[_0x131d33(0xeb)]){const _0x56a2bf=_0x4a7bd0[_0x131d33(0xeb)]['match'](/T(\d{2}:\d{2})/);_0x56a2bf&&(_0x13a037['scheduleOption']=_0x56a2bf[0x1]);}}_0xf8601d[_0x131d33(0x13f)]&&(_0xf8601d[_0x131d33(0x13f)][_0x131d33(0x152)]&&(_0x13a037[_0x131d33(0x100)]=_0xf8601d[_0x131d33(0x13f)]['notify_on']),_0xf8601d[_0x131d33(0x13f)]['email_recipients']&&(_0x13a037[_0x131d33(0x138)]=_0xf8601d[_0x131d33(0x13f)]['email_recipients'][_0x131d33(0xc6)](_0x5e4071=>{const _0xd890b9=_0x131d33,_0x24652c=Number(_0x5e4071);if(!isNaN(_0x24652c)&&String(_0x24652c)===_0x5e4071)return _0x24652c;const _0x3babac=_0x1a4a56?.[_0xd890b9(0x153)](_0x5e4071[_0xd890b9(0xec)]());if(_0x3babac===undefined)throw new SDKError(ErrorCode[_0xd890b9(0xc5)],_0xd890b9(0x140)+_0x5e4071+'.\x20Use\x20\x27tdx\x20user\x20list\x27\x20to\x20see\x20valid\x20emails.');return _0x3babac;})));if(_0xf8601d['connector_config']){const _0x3ac9d3=_0x14c547?.[_0x131d33(0x11a)]?.['get'](_0x57061a);if(_0x3ac9d3&&_0x14c547?.['getSchema'])try{const _0x1d6a79=await _0x14c547[_0x131d33(0x101)](_0x3ac9d3),_0x15f15e=validateConnectorConfig(_0xf8601d[_0x131d33(0x168)],_0x1d6a79);if(!_0x15f15e[_0x131d33(0xe5)])throw new SDKError(ErrorCode[_0x131d33(0x16b)],_0x131d33(0x147)+_0xf8601d['name']+'\x22:\x0a'+formatValidationErrors(_0x15f15e[_0x131d33(0x14b)]),undefined,{'helpText':_0x131d33(0x105)+_0x3ac9d3+'\x0a\x0aAvailable\x20fields:\x0a'+formatSchemaAsHelp(_0x1d6a79)});if(_0x15f15e['warnings']['length']>0x0){const _0x590837=formatValidationWarnings(_0x15f15e[_0x131d33(0xb5)]);console[_0x131d33(0xe3)](_0x131d33(0xf5)+_0xf8601d[_0x131d33(0x107)]+_0x131d33(0x13e)+_0x590837);}_0x13a037['connectorConfig']=transformConfigToLegacy(_0xf8601d['connector_config'],_0x1d6a79);}catch(_0x24f525){if(_0x24f525 instanceof SDKError&&_0x24f525[_0x131d33(0xc4)]===ErrorCode[_0x131d33(0xdb)])_0x13a037[_0x131d33(0x122)]=_0xf8601d[_0x131d33(0x168)];else throw _0x24f525;}else _0x13a037[_0x131d33(0x122)]=_0xf8601d[_0x131d33(0x168)];}_0xf8601d[_0x131d33(0x10f)]!==undefined&&(_0x13a037[_0x131d33(0x10d)]=_0xf8601d[_0x131d33(0x10f)]);if(_0xf8601d[_0x131d33(0x112)]){const _0x349548=_0xf8601d[_0x131d33(0x112)],_0xaf4c8a={};if(_0x349548[_0x131d33(0xee)]&&_0x349548['columns'][_0x131d33(0x162)]>0x0){const _0x578946=_0x349548[_0x131d33(0xee)][_0x131d33(0x12c)](_0x47b118=>_0x47b118&&_0x47b118[_0x131d33(0x107)])[_0x131d33(0xc6)](normalizeColumn);_0x578946[_0x131d33(0x162)]>0x0&&(_0xaf4c8a[_0x131d33(0xee)]=_0x578946);}_0x349548['behavior_table']&&(_0xaf4c8a['behaviorTableName']=_0x349548[_0x131d33(0xf2)]);_0x349548[_0x131d33(0x137)]&&(_0xaf4c8a[_0x131d33(0x11c)]=_0x349548['join_strategy']);if(_0x349548[_0x131d33(0xfb)]!==undefined)_0xaf4c8a[_0x131d33(0x150)]=_0x349548[_0x131d33(0xfb)];else{if(_0x349548[_0x131d33(0x137)]===_0x131d33(0xb6)||_0x349548[_0x131d33(0x137)]===_0x131d33(0x129))_0xaf4c8a[_0x131d33(0x150)]=0x1;else _0x349548[_0x131d33(0x137)]==='All'&&(_0xaf4c8a[_0x131d33(0x150)]=null);}_0x349548[_0x131d33(0x165)]&&(_0xaf4c8a[_0x131d33(0x165)]=_0x349548[_0x131d33(0x165)]),_0x349548[_0x131d33(0xf9)]&&(_0xaf4c8a[_0x131d33(0x10a)]=_0x349548[_0x131d33(0xf9)]),_0x13a037['syndicationBehavior']=_0xaf4c8a;}return _0xf8601d[_0x131d33(0x13b)]&&(_0x13a037['nestedWorkflowProjectName']=_0xf8601d[_0x131d33(0x13b)]),_0xf8601d['nested_workflow_name']&&(_0x13a037[_0x131d33(0x154)]=_0xf8601d[_0x131d33(0x144)]),_0xf8601d[_0x131d33(0xe4)]!==undefined&&(_0x13a037['lockEnabled']=_0xf8601d['lock_enabled']),_0x13a037;}export async function activationDefToUpdateRequest(_0xed93a7,_0x5a9afe){return activationDefToCreateRequest(_0xed93a7,_0x5a9afe);}export function deepSortObject(_0x323199){const _0x144af8=a142_0x39a3dd;if(_0x323199===null||typeof _0x323199!=='object')return _0x323199;if(Array[_0x144af8(0xe7)](_0x323199))return _0x323199['map'](deepSortObject)['sort']((_0x7e4c2e,_0x5466ce)=>JSON[_0x144af8(0xb4)](_0x7e4c2e)['localeCompare'](JSON['stringify'](_0x5466ce)));const _0x4b50c9={};for(const _0x201360 of Object[_0x144af8(0x11f)](_0x323199)[_0x144af8(0x130)]()){_0x4b50c9[_0x201360]=deepSortObject(_0x323199[_0x201360]);}return _0x4b50c9;}export function serializeRule(_0x12d060){return JSON['stringify'](deepSortObject(_0x12d060));}export function normalizeRuleForMatching(_0x2d06f2){return normalizeConditionsForMatching(_0x2d06f2);}function normalizeConditionsForMatching(_0x111cb2){const _0x123c4c=a142_0x39a3dd;if(_0x111cb2===null||typeof _0x111cb2!=='object')return _0x111cb2;if(Array[_0x123c4c(0xe7)](_0x111cb2))return _0x111cb2[_0x123c4c(0xc6)](normalizeConditionsForMatching);const _0x5919a2=_0x111cb2;if((_0x5919a2['type']==='include'||_0x5919a2[_0x123c4c(0xcf)]===_0x123c4c(0x10c))&&typeof _0x5919a2[_0x123c4c(0xe8)]==='string')return{..._0x5919a2,'segment':_0x123c4c(0x11b)};const _0x15683b={};for(const _0x5dfdb6 of Object[_0x123c4c(0x11f)](_0x5919a2)){_0x15683b[_0x5dfdb6]=normalizeConditionsForMatching(_0x5919a2[_0x5dfdb6]);}return _0x15683b;}export function serializeRuleForMatching(_0x54d636){const _0x3b3674=a142_0x39a3dd;return JSON[_0x3b3674(0xb4)](deepSortObject(normalizeRuleForMatching(_0x54d636)));}export function expandSegmentReferences(_0xbf63b7,_0x312352,_0x2d401c=new Set()){return expandConditions(_0xbf63b7,_0x312352,_0x2d401c);}function expandConditions(_0x495153,_0xec5f4e,_0x150098){const _0x40c1f6=a142_0x39a3dd;if(_0x495153===null||typeof _0x495153!==_0x40c1f6(0xd3))return _0x495153;if(Array[_0x40c1f6(0xe7)](_0x495153))return _0x495153['map'](_0x14561f=>expandConditions(_0x14561f,_0xec5f4e,_0x150098));const _0x45fe76=_0x495153;if((_0x45fe76['type']===_0x40c1f6(0x113)||_0x45fe76['type']===_0x40c1f6(0x10c))&&typeof _0x45fe76['segment']===_0x40c1f6(0xf8)){const _0x32cbbb=_0x45fe76['segment'],_0x3dadaa=_0xec5f4e[_0x40c1f6(0x153)](_0x32cbbb);if(_0x3dadaa&&!_0x150098[_0x40c1f6(0x157)](_0x32cbbb)){const _0x8c3643=new Set(_0x150098);_0x8c3643[_0x40c1f6(0x164)](_0x32cbbb);const _0x19e5db=expandConditions(_0x3dadaa,_0xec5f4e,_0x8c3643);return{'type':_0x45fe76['type'],'expanded_rule':_0x19e5db};}return{'type':_0x45fe76[_0x40c1f6(0xcf)],'expanded_rule':_0x40c1f6(0x166)};}const _0x4c1254={};for(const _0x363466 of Object[_0x40c1f6(0x11f)](_0x45fe76)){_0x4c1254[_0x363466]=expandConditions(_0x45fe76[_0x363466],_0xec5f4e,_0x150098);}return _0x4c1254;}export function serializeExpandedRule(_0x1f78a8,_0x4f2194){const _0x4d202b=expandSegmentReferences(_0x1f78a8,_0x4f2194);return JSON['stringify'](deepSortObject(_0x4d202b));}export function createSegmentNameContext(_0x152cdb){const _0x4e5333=a142_0x39a3dd,_0x28c399=new Set(),_0x43a757=new Map(),_0x5d7d0d=new Map();if(_0x152cdb)for(const [_0x4092a4,_0xc7e59e]of Object['entries'](_0x152cdb)){if(_0xc7e59e[_0x4e5333(0xc0)]){const _0x997a40=serializeRule(_0xc7e59e[_0x4e5333(0xc0)]);_0x5d7d0d[_0x4e5333(0x120)](_0x997a40,_0x4092a4),_0x28c399['add'](_0x4092a4);}}return{'usedNames':_0x28c399,'ruleHashToName':_0x43a757,'localRuleToName':_0x152cdb?_0x5d7d0d:undefined};}export function resolveSegmentName(_0x297c8f,_0x362b02,_0x518d57,_0x5091d9){const _0x5dcfa9=a142_0x39a3dd,_0x4e13f9=serializeRule(_0x362b02);if(_0x518d57[_0x5dcfa9(0xd8)]){const _0x2c00ba=_0x518d57['localRuleToName'][_0x5dcfa9(0x153)](_0x4e13f9);if(_0x2c00ba)return{'name':_0x2c00ba,'isDuplicate':![],'isLocalMatch':!![]};}const _0x14ed87=_0x518d57[_0x5dcfa9(0xbe)]['get'](_0x4e13f9);if(_0x14ed87)return{'name':_0x14ed87,'isDuplicate':!![],'isLocalMatch':![]};const _0x49e087=_0x5091d9(_0x297c8f);let _0x1b41ca=_0x49e087||_0x297c8f,_0x56f107=_0x1b41ca,_0x1e0113=0x2;while(_0x518d57[_0x5dcfa9(0xbd)][_0x5dcfa9(0x157)](_0x56f107)){_0x56f107=_0x1b41ca+'_'+_0x1e0113,_0x1e0113++;}return _0x518d57[_0x5dcfa9(0xbd)][_0x5dcfa9(0x164)](_0x56f107),_0x518d57['ruleHashToName'][_0x5dcfa9(0x120)](_0x4e13f9,_0x56f107),{'name':_0x56f107,'isDuplicate':![],'isLocalMatch':![]};}export function collectSegmentRefsFromRule(_0x5bf4cd){const _0x3017d4=[],_0x1d3db1=_0x1c29a5=>{const _0xc5dcc5=a142_0x5a93;if(!_0x1c29a5||typeof _0x1c29a5!=='object')return;if(Array['isArray'](_0x1c29a5)){_0x1c29a5[_0xc5dcc5(0xc7)](_0x1d3db1);return;}const _0x31951f=_0x1c29a5;(_0x31951f[_0xc5dcc5(0xcf)]===_0xc5dcc5(0x113)||_0x31951f[_0xc5dcc5(0xcf)]===_0xc5dcc5(0x10c))&&typeof _0x31951f['segment']===_0xc5dcc5(0xf8)&&_0x3017d4[_0xc5dcc5(0x12f)](_0x31951f['segment']);for(const _0x577237 of Object[_0xc5dcc5(0xbf)](_0x31951f)){_0x1d3db1(_0x577237);}};return _0x1d3db1(_0x5bf4cd),_0x3017d4;}export function validateSegmentRule(_0x1494a3,_0x48fd78){const _0x3b7767=a142_0x39a3dd;if(!_0x48fd78||!_0x48fd78['conditions'])return;for(let _0x2396b8=0x0;_0x2396b8<_0x48fd78[_0x3b7767(0x13c)][_0x3b7767(0x162)];_0x2396b8++){const _0x364a49=_0x48fd78[_0x3b7767(0x13c)][_0x2396b8];if(_0x3b7767(0xcf)in _0x364a49&&_0x364a49[_0x3b7767(0xcf)]===_0x3b7767(0x124)){const _0x540867=_0x364a49,_0x47a4a2=_0x540867['source']||_0x540867[_0x3b7767(0x128)];if((!_0x540867['attribute']||_0x540867['attribute']==='')&&!_0x47a4a2)throw new SDKError(ErrorCode[_0x3b7767(0x125)],_0x3b7767(0x106)+_0x1494a3+_0x3b7767(0xd5)+(_0x3b7767(0xcb)+_0x2396b8+_0x3b7767(0xc9))+_0x3b7767(0xdf));}}}
@@ -1 +1 @@
1
- (function(_0xc5fdbc,_0x58f2f6){const _0x45a89e=a143_0x3f77,_0x29264=_0xc5fdbc();while(!![]){try{const _0x4967b4=-parseInt(_0x45a89e(0x11c))/0x1*(parseInt(_0x45a89e(0x122))/0x2)+-parseInt(_0x45a89e(0x156))/0x3*(parseInt(_0x45a89e(0x149))/0x4)+parseInt(_0x45a89e(0x128))/0x5+parseInt(_0x45a89e(0x14c))/0x6*(-parseInt(_0x45a89e(0x13f))/0x7)+-parseInt(_0x45a89e(0x142))/0x8+parseInt(_0x45a89e(0x143))/0x9*(parseInt(_0x45a89e(0x14b))/0xa)+parseInt(_0x45a89e(0x123))/0xb*(parseInt(_0x45a89e(0x13a))/0xc);if(_0x4967b4===_0x58f2f6)break;else _0x29264['push'](_0x29264['shift']());}catch(_0x57a8f8){_0x29264['push'](_0x29264['shift']());}}}(a143_0x2e65,0xb47f5));import a143_0x40ba7b from'chalk';import{withProgressSpinner}from'../../utils/spinner.js';function a143_0x2e65(){const _0x196c9e=['20wAXdPY','1807716dakkCD','SELECT\x20*\x20FROM\x20(\x0a','Tip:\x20Names\x20shown\x20are\x20column\x20names\x20for\x20segment\x20YAML\x20(attribute/source).','default','parentColumn','get','error','slice','extra','\x20\x20\x20\x20\x20Display\x20names\x20in\x20()\x20are\x20for\x20console\x20reference\x20only.','18SrGGhm','name','set','cyan','replace','size','push','9927KwmAIt','filter','matrixTableName','localeCompare','key','matrixColumnName','18HjYQaq','4081MYSwtZ','columns','entries','setJobId','some','484835sOKhvx','verbose','Behaviors','\x0a)\x20AS\x20segment_query\x20LIMIT\x200','Unknown','tableName','dim','map','\x20\x20\x20\x20','column_type','length','bold','startsWith','displayName','parentTableName','varchar','behaviorName','column_name','92892lhtLtu','Attributes','execute','behavior','source','14fKFXOf','YES','query','11007264umBZgH','2402667BBvTqC','trim','type','sort','information_schema','fields','463776VKYpBz','attribute'];a143_0x2e65=function(){return _0x196c9e;};return a143_0x2e65();}export function buildSchemaResult(_0x13adcf){const _0x26c041=a143_0x3f77,_0x292101=_0x13adcf[_0x26c041(0x124)][_0x26c041(0x12f)](_0x539488=>({'column_name':_0x539488[_0x26c041(0x157)],'column_type':_0x539488[_0x26c041(0x145)],'null':_0x26c041(0x140),'key':null,'default':null,'extra':null}));return{..._0x13adcf,'columns':[{'name':_0x26c041(0x139),'type':'varchar'},{'name':_0x26c041(0x131),'type':'varchar'},{'name':'null','type':_0x26c041(0x137)},{'name':_0x26c041(0x120),'type':_0x26c041(0x137)},{'name':_0x26c041(0x14f),'type':_0x26c041(0x137)},{'name':_0x26c041(0x154),'type':_0x26c041(0x137)}],'data':_0x292101};}export async function executeSchemaQuery(_0x30d643,_0x30e286,_0x1cac18){const _0x42320b=a143_0x3f77,_0xee3027=_0x30d643[_0x42320b(0x144)]()[_0x42320b(0x119)](/;+$/,''),_0x41be0a=_0x42320b(0x14d)+_0xee3027+_0x42320b(0x12b);_0x1cac18[_0x42320b(0x129)]&&console['error']('Schema\x20query:\x0a'+_0x41be0a);const _0x375065=await withProgressSpinner('Fetching\x20schema...',async _0x4eb0da=>{const _0x52445b=_0x42320b,_0x4e77e4=await _0x30e286[_0x52445b(0x141)][_0x52445b(0x13c)](_0x41be0a,{'catalog':'td','schema':_0x52445b(0x147),'onJobId':_0x5c4932=>{const _0x2aba8c=_0x52445b;_0x4eb0da[_0x2aba8c(0x126)](_0x5c4932);}});return _0x4e77e4;},{'verbose':_0x1cac18[_0x42320b(0x129)]});return buildSchemaResult(_0x375065['data']);}function columnName(_0x2d57e2){const _0x501784=a143_0x3f77;return _0x2d57e2[_0x501784(0x121)]||_0x2d57e2[_0x501784(0x150)]||_0x2d57e2['name'];}function a143_0x3f77(_0x447a12,_0x5a0f5d){_0x447a12=_0x447a12-0x118;const _0x2e65ef=a143_0x2e65();let _0x3f77a9=_0x2e65ef[_0x447a12];return _0x3f77a9;}function formatFieldLine(_0x5cf9d4,_0xaeb49f,_0x4f81bb){const _0x52d3fc=a143_0x3f77,_0x294be5=_0x5cf9d4!==_0xaeb49f?'\x20'+a143_0x40ba7b[_0x52d3fc(0x12e)]('('+_0xaeb49f+')'):'';return _0x52d3fc(0x130)+_0x5cf9d4+_0x294be5+':\x20'+a143_0x40ba7b[_0x52d3fc(0x118)](_0x4f81bb);}function sortByColumnName(_0x5c24b8){const _0x41dbd7=a143_0x3f77;return[..._0x5c24b8][_0x41dbd7(0x146)]((_0x10fb78,_0x5f335f)=>columnName(_0x10fb78)[_0x41dbd7(0x11f)](columnName(_0x5f335f)));}export function displayFieldsHumanReadable(_0x2e7c20,_0x152251){const _0x1804cb=a143_0x3f77,_0x5555a0=_0x2e7c20[_0x1804cb(0x11d)](_0x520aec=>_0x520aec[_0x1804cb(0x13e)]===_0x1804cb(0x14a)),_0x2b8c31=_0x2e7c20['filter'](_0x5e38ff=>_0x5e38ff['source']===_0x1804cb(0x13d)),_0x3959a6=new Map();for(const _0x25c653 of _0x5555a0){const _0x2cddbe=_0x25c653['groupingName']||_0x25c653[_0x1804cb(0x136)]||'Unknown',_0x56e982=_0x3959a6[_0x1804cb(0x151)](_0x2cddbe);_0x56e982?_0x56e982[_0x1804cb(0x148)][_0x1804cb(0x11b)](_0x25c653):_0x3959a6[_0x1804cb(0x158)](_0x2cddbe,{'displayName':_0x2cddbe,'tableName':_0x25c653[_0x1804cb(0x136)],'fields':[_0x25c653]});}const _0x716209=new Map();for(const _0x569660 of _0x2b8c31){const _0x12d58b=_0x569660[_0x1804cb(0x138)]||_0x1804cb(0x12c),_0x1d5d17=_0x716209[_0x1804cb(0x151)](_0x12d58b)||[];_0x1d5d17[_0x1804cb(0x11b)](_0x569660),_0x716209[_0x1804cb(0x158)](_0x12d58b,_0x1d5d17);}console['error']('\x0a'+a143_0x40ba7b['bold'](_0x152251));if(_0x3959a6[_0x1804cb(0x11a)]>0x0){console[_0x1804cb(0x152)]('\x0a'+a143_0x40ba7b[_0x1804cb(0x12e)](_0x1804cb(0x13b)));const _0x17cef9=[..._0x3959a6['entries']()]['sort']((_0x5710d1,_0x4cc91c)=>_0x5710d1[0x0]['localeCompare'](_0x4cc91c[0x0]));for(const [,_0x49ae76]of _0x17cef9){const _0xa63b1b=_0x49ae76[_0x1804cb(0x12d)]&&_0x49ae76[_0x1804cb(0x12d)]!==_0x49ae76[_0x1804cb(0x135)]?'\x20'+a143_0x40ba7b[_0x1804cb(0x12e)]('('+_0x49ae76[_0x1804cb(0x12d)]+')'):'';console[_0x1804cb(0x152)]('\x20\x20'+a143_0x40ba7b[_0x1804cb(0x133)](_0x49ae76['displayName'])+_0xa63b1b);for(const _0x1a1a05 of sortByColumnName(_0x49ae76['fields'])){console[_0x1804cb(0x152)](formatFieldLine(columnName(_0x1a1a05),_0x1a1a05[_0x1804cb(0x157)],_0x1a1a05[_0x1804cb(0x145)]));}}}if(_0x716209[_0x1804cb(0x11a)]>0x0){console[_0x1804cb(0x152)]('\x0a'+a143_0x40ba7b[_0x1804cb(0x12e)](_0x1804cb(0x12a)));const _0x354eec=[..._0x716209[_0x1804cb(0x125)]()][_0x1804cb(0x146)]((_0x421368,_0x68b63a)=>_0x421368[0x0][_0x1804cb(0x11f)](_0x68b63a[0x0]));for(const [_0x3a2097,_0x18023b]of _0x354eec){const _0x2745f5=_0x18023b[0x0],_0x26cf21=_0x2745f5?.[_0x1804cb(0x11e)];if(_0x26cf21){const _0x164b67=_0x26cf21!==_0x3a2097?'\x20'+a143_0x40ba7b[_0x1804cb(0x12e)]('('+_0x3a2097+')'):'';console[_0x1804cb(0x152)]('\x20\x20'+a143_0x40ba7b[_0x1804cb(0x133)](_0x26cf21)+_0x164b67);}else{const _0x420d3f=_0x2745f5?.[_0x1804cb(0x136)]||'';console[_0x1804cb(0x152)]('\x20\x20'+a143_0x40ba7b['bold'](_0x3a2097)+(_0x420d3f?'\x20'+a143_0x40ba7b[_0x1804cb(0x12e)]('('+_0x420d3f+')'):''));}for(const _0x5ce17f of sortByColumnName(_0x18023b)){const _0x247721=_0x5ce17f['name'][_0x1804cb(0x134)](_0x3a2097+'.')?_0x5ce17f[_0x1804cb(0x157)][_0x1804cb(0x153)](_0x3a2097[_0x1804cb(0x132)]+0x1):_0x5ce17f[_0x1804cb(0x157)];console['error'](formatFieldLine(columnName(_0x5ce17f),_0x247721,_0x5ce17f[_0x1804cb(0x145)]));}}}const _0x1154c2=_0x2e7c20[_0x1804cb(0x127)](_0x405712=>_0x405712[_0x1804cb(0x121)]||_0x405712[_0x1804cb(0x11e)]);_0x1154c2&&(console[_0x1804cb(0x152)]('\x0a'+a143_0x40ba7b[_0x1804cb(0x12e)](_0x1804cb(0x14e))),console[_0x1804cb(0x152)](a143_0x40ba7b[_0x1804cb(0x12e)](_0x1804cb(0x155)))),console[_0x1804cb(0x152)]('');}
1
+ (function(_0x1d0dd9,_0x41e522){const _0x36d9e2=a143_0x1e49,_0x5cf2ba=_0x1d0dd9();while(!![]){try{const _0x21b5da=parseInt(_0x36d9e2(0xb5))/0x1+-parseInt(_0x36d9e2(0xd9))/0x2+parseInt(_0x36d9e2(0xc2))/0x3*(-parseInt(_0x36d9e2(0xb6))/0x4)+parseInt(_0x36d9e2(0xd4))/0x5+parseInt(_0x36d9e2(0xbb))/0x6+-parseInt(_0x36d9e2(0xc8))/0x7*(parseInt(_0x36d9e2(0xd5))/0x8)+-parseInt(_0x36d9e2(0xe5))/0x9;if(_0x21b5da===_0x41e522)break;else _0x5cf2ba['push'](_0x5cf2ba['shift']());}catch(_0xb40ee0){_0x5cf2ba['push'](_0x5cf2ba['shift']());}}}(a143_0x24ad,0x47ebc));import a143_0x5ad943 from'chalk';import{withProgressSpinner}from'../../utils/spinner.js';function a143_0x24ad(){const _0xacdd8f=['type','Unknown','1325484xnPsvs','bold','replace','entries','SELECT\x20*\x20FROM\x20(\x0a','behavior','get','dim','attribute','\x20\x20\x20\x20','357007JpbrJp','987452gofAdm','Behaviors','localeCompare','parentColumn','trim','2844516ktmpTb','extra','source','Schema\x20query:\x0a','displayName','error','parentTableName','3BAgseA','groupingName','push','startsWith','filter','column_type','791QEJMMy','default','key','column_name','matrixTableName','verbose','set','columns','size','varchar','some','\x0a)\x20AS\x20segment_query\x20LIMIT\x200','2515510msdIQW','27760CKAYtX','information_schema','tableName','\x20\x20\x20\x20\x20Display\x20names\x20in\x20()\x20are\x20for\x20console\x20reference\x20only.','506716OPKoJS','Fetching\x20schema...','Tip:\x20Names\x20shown\x20are\x20column\x20names\x20for\x20segment\x20YAML\x20(attribute/source).','cyan','name','Attributes','data','null','YES','sort'];a143_0x24ad=function(){return _0xacdd8f;};return a143_0x24ad();}export function buildSchemaResult(_0x96c993){const _0x272e6c=a143_0x1e49,_0x236346=_0x96c993[_0x272e6c(0xcf)]['map'](_0x299b30=>({'column_name':_0x299b30['name'],'column_type':_0x299b30[_0x272e6c(0xe3)],'null':_0x272e6c(0xe1),'key':null,'default':null,'extra':null}));return{..._0x96c993,'columns':[{'name':_0x272e6c(0xcb),'type':_0x272e6c(0xd1)},{'name':_0x272e6c(0xc7),'type':_0x272e6c(0xd1)},{'name':_0x272e6c(0xe0),'type':_0x272e6c(0xd1)},{'name':_0x272e6c(0xca),'type':_0x272e6c(0xd1)},{'name':_0x272e6c(0xc9),'type':'varchar'},{'name':_0x272e6c(0xbc),'type':_0x272e6c(0xd1)}],'data':_0x236346};}export async function executeSchemaQuery(_0x4378e1,_0x1c4d18,_0x1e7693){const _0x255e37=a143_0x1e49,_0x2a2513=_0x4378e1[_0x255e37(0xba)]()[_0x255e37(0xad)](/;+$/,''),_0x3d72b3=_0x255e37(0xaf)+_0x2a2513+_0x255e37(0xd3);_0x1e7693[_0x255e37(0xcd)]&&console[_0x255e37(0xc0)](_0x255e37(0xbe)+_0x3d72b3);const _0x50315d=await withProgressSpinner(_0x255e37(0xda),async _0x112709=>{const _0xc039eb=_0x255e37,_0x52090d=await _0x1c4d18['query']['execute'](_0x3d72b3,{'catalog':'td','schema':_0xc039eb(0xd6),'onJobId':_0x2a809e=>{_0x112709['setJobId'](_0x2a809e);}});return _0x52090d;},{'verbose':_0x1e7693['verbose']});return buildSchemaResult(_0x50315d[_0x255e37(0xdf)]);}function columnName(_0x1a4a40){const _0x345090=a143_0x1e49;return _0x1a4a40['matrixColumnName']||_0x1a4a40[_0x345090(0xb9)]||_0x1a4a40[_0x345090(0xdd)];}function formatFieldLine(_0x23ef91,_0x53a047,_0x2781e9){const _0x9dc258=a143_0x1e49,_0x503f58=_0x23ef91!==_0x53a047?'\x20'+a143_0x5ad943[_0x9dc258(0xb2)]('('+_0x53a047+')'):'';return _0x9dc258(0xb4)+_0x23ef91+_0x503f58+':\x20'+a143_0x5ad943[_0x9dc258(0xdc)](_0x2781e9);}function sortByColumnName(_0x1e6996){const _0x5252e3=a143_0x1e49;return[..._0x1e6996]['sort']((_0xfea09c,_0x26186b)=>columnName(_0xfea09c)[_0x5252e3(0xb8)](columnName(_0x26186b)));}function a143_0x1e49(_0x5ccc9a,_0x84b5ff){_0x5ccc9a=_0x5ccc9a-0xad;const _0x24adf6=a143_0x24ad();let _0x1e4917=_0x24adf6[_0x5ccc9a];return _0x1e4917;}export function displayFieldsHumanReadable(_0x1758bc,_0x4dbf8e){const _0x4ffc4a=a143_0x1e49,_0x121a6b=_0x1758bc[_0x4ffc4a(0xc6)](_0x4d0a53=>_0x4d0a53['source']===_0x4ffc4a(0xb3)),_0x2b4d56=_0x1758bc['filter'](_0x401d45=>_0x401d45[_0x4ffc4a(0xbd)]===_0x4ffc4a(0xb0)),_0x2c1740=new Map();for(const _0x1d5138 of _0x121a6b){const _0x52662c=_0x1d5138[_0x4ffc4a(0xc3)]||_0x1d5138['parentTableName']||_0x4ffc4a(0xe4),_0x20a621=_0x2c1740[_0x4ffc4a(0xb1)](_0x52662c);_0x20a621?_0x20a621['fields'][_0x4ffc4a(0xc4)](_0x1d5138):_0x2c1740[_0x4ffc4a(0xce)](_0x52662c,{'displayName':_0x52662c,'tableName':_0x1d5138[_0x4ffc4a(0xc1)],'fields':[_0x1d5138]});}const _0x2ec671=new Map();for(const _0x1aadef of _0x2b4d56){const _0x4af5ac=_0x1aadef['behaviorName']||_0x4ffc4a(0xe4),_0x129442=_0x2ec671[_0x4ffc4a(0xb1)](_0x4af5ac)||[];_0x129442[_0x4ffc4a(0xc4)](_0x1aadef),_0x2ec671[_0x4ffc4a(0xce)](_0x4af5ac,_0x129442);}console[_0x4ffc4a(0xc0)]('\x0a'+a143_0x5ad943[_0x4ffc4a(0xe6)](_0x4dbf8e));if(_0x2c1740[_0x4ffc4a(0xd0)]>0x0){console['error']('\x0a'+a143_0x5ad943[_0x4ffc4a(0xb2)](_0x4ffc4a(0xde)));const _0x18456b=[..._0x2c1740[_0x4ffc4a(0xae)]()][_0x4ffc4a(0xe2)]((_0x15f5b0,_0x3d8b11)=>_0x15f5b0[0x0][_0x4ffc4a(0xb8)](_0x3d8b11[0x0]));for(const [,_0x474ffc]of _0x18456b){const _0x346430=_0x474ffc[_0x4ffc4a(0xd7)]&&_0x474ffc['tableName']!==_0x474ffc[_0x4ffc4a(0xbf)]?'\x20'+a143_0x5ad943[_0x4ffc4a(0xb2)]('('+_0x474ffc[_0x4ffc4a(0xd7)]+')'):'';console['error']('\x20\x20'+a143_0x5ad943[_0x4ffc4a(0xe6)](_0x474ffc[_0x4ffc4a(0xbf)])+_0x346430);for(const _0x28321d of sortByColumnName(_0x474ffc['fields'])){console[_0x4ffc4a(0xc0)](formatFieldLine(columnName(_0x28321d),_0x28321d[_0x4ffc4a(0xdd)],_0x28321d['type']));}}}if(_0x2ec671[_0x4ffc4a(0xd0)]>0x0){console['error']('\x0a'+a143_0x5ad943[_0x4ffc4a(0xb2)](_0x4ffc4a(0xb7)));const _0x4f4e42=[..._0x2ec671[_0x4ffc4a(0xae)]()][_0x4ffc4a(0xe2)]((_0x428f1b,_0x2d4563)=>_0x428f1b[0x0][_0x4ffc4a(0xb8)](_0x2d4563[0x0]));for(const [_0x1efd5d,_0x1e1c36]of _0x4f4e42){const _0x185dbf=_0x1e1c36[0x0],_0x4aae7b=_0x185dbf?.[_0x4ffc4a(0xcc)];if(_0x4aae7b){const _0x5aa306=_0x4aae7b!==_0x1efd5d?'\x20'+a143_0x5ad943[_0x4ffc4a(0xb2)]('('+_0x1efd5d+')'):'';console[_0x4ffc4a(0xc0)]('\x20\x20'+a143_0x5ad943[_0x4ffc4a(0xe6)](_0x4aae7b)+_0x5aa306);}else{const _0x20a612=_0x185dbf?.[_0x4ffc4a(0xc1)]||'';console['error']('\x20\x20'+a143_0x5ad943[_0x4ffc4a(0xe6)](_0x1efd5d)+(_0x20a612?'\x20'+a143_0x5ad943[_0x4ffc4a(0xb2)]('('+_0x20a612+')'):''));}for(const _0x5e2d09 of sortByColumnName(_0x1e1c36)){const _0x42a18b=_0x5e2d09[_0x4ffc4a(0xdd)][_0x4ffc4a(0xc5)](_0x1efd5d+'.')?_0x5e2d09['name']['slice'](_0x1efd5d['length']+0x1):_0x5e2d09['name'];console[_0x4ffc4a(0xc0)](formatFieldLine(columnName(_0x5e2d09),_0x42a18b,_0x5e2d09[_0x4ffc4a(0xe3)]));}}}const _0x279055=_0x1758bc[_0x4ffc4a(0xd2)](_0xc7b6fd=>_0xc7b6fd['matrixColumnName']||_0xc7b6fd[_0x4ffc4a(0xcc)]);_0x279055&&(console['error']('\x0a'+a143_0x5ad943[_0x4ffc4a(0xb2)](_0x4ffc4a(0xdb))),console[_0x4ffc4a(0xc0)](a143_0x5ad943[_0x4ffc4a(0xb2)](_0x4ffc4a(0xd8)))),console[_0x4ffc4a(0xc0)]('');}
@@ -1 +1 @@
1
- (function(_0x11db9d,_0x180baf){const _0x35551e=a144_0x4222,_0x2e2348=_0x11db9d();while(!![]){try{const _0x46e73d=parseInt(_0x35551e(0xc5))/0x1*(parseInt(_0x35551e(0xcd))/0x2)+parseInt(_0x35551e(0xc1))/0x3*(-parseInt(_0x35551e(0xcf))/0x4)+-parseInt(_0x35551e(0xc4))/0x5+parseInt(_0x35551e(0xc3))/0x6+-parseInt(_0x35551e(0xc0))/0x7+-parseInt(_0x35551e(0xcb))/0x8+parseInt(_0x35551e(0xc2))/0x9;if(_0x46e73d===_0x180baf)break;else _0x2e2348['push'](_0x2e2348['shift']());}catch(_0x1c94c2){_0x2e2348['push'](_0x2e2348['shift']());}}}(a144_0x55d1,0x2c00f));function a144_0x55d1(){const _0x2d39d4=['1547925YfTPbW','31171YjNAJQ','relative','join','isFile','map','endsWith','1692512Rzuasl','name','12Osznbj','extname','8sDyCBA','.yaml','dirname','.yml','push','1178765koJnte','410907cWkVXQ','5580486PuScec','2019846SUCoSx'];a144_0x55d1=function(){return _0x2d39d4;};return a144_0x55d1();}import{readdirSync,statSync}from'fs';function a144_0x4222(_0x219312,_0x2bc7e4){_0x219312=_0x219312-0xbe;const _0x55d1ff=a144_0x55d1();let _0x42227d=_0x55d1ff[_0x219312];return _0x42227d;}import a144_0x2b8fcd from'path';export function findYamlFiles(_0x454310){const _0x49496a=[];function _0x5c95f1(_0x38b031){const _0x499275=a144_0x4222,_0x4d20bf=readdirSync(_0x38b031,{'withFileTypes':!![]});for(const _0x274082 of _0x4d20bf){const _0x16ae84=a144_0x2b8fcd[_0x499275(0xc7)](_0x38b031,_0x274082['name']);if(_0x274082['isDirectory']())_0x5c95f1(_0x16ae84);else(_0x274082[_0x499275(0xcc)][_0x499275(0xca)](_0x499275(0xbe))||_0x274082[_0x499275(0xcc)][_0x499275(0xca)](_0x499275(0xd0)))&&_0x49496a[_0x499275(0xbf)](_0x16ae84);}}return _0x5c95f1(_0x454310),_0x49496a;}export function discoverYamlFiles(_0xe9931f){const _0x36fae9=a144_0x4222,_0x49b09e=findYamlFiles(_0xe9931f);return _0x49b09e[_0x36fae9(0xc9)](_0x5ea270=>{const _0x195d1d=_0x36fae9,_0x1e64c1=a144_0x2b8fcd[_0x195d1d(0xc6)](_0xe9931f,_0x5ea270),_0x37a8fb=a144_0x2b8fcd[_0x195d1d(0xd1)](_0x1e64c1);return{'absolutePath':_0x5ea270,'relativePath':_0x1e64c1,'folderPath':_0x37a8fb==='.'?'':_0x37a8fb};});}export function isYamlFile(_0x453ddd){const _0x288299=a144_0x4222;try{const _0x44a52d=statSync(_0x453ddd);if(!_0x44a52d[_0x288299(0xc8)]())return![];const _0x269616=a144_0x2b8fcd[_0x288299(0xce)](_0x453ddd)['toLowerCase']();return _0x269616===_0x288299(0xbe)||_0x269616===_0x288299(0xd0);}catch{return![];}}
1
+ (function(_0xbe121b,_0x1ded7f){const _0x2cd867=a144_0x2380,_0x2d6fe7=_0xbe121b();while(!![]){try{const _0x40e2d4=parseInt(_0x2cd867(0x12e))/0x1+-parseInt(_0x2cd867(0x12b))/0x2*(-parseInt(_0x2cd867(0x134))/0x3)+parseInt(_0x2cd867(0x131))/0x4+-parseInt(_0x2cd867(0x12c))/0x5*(-parseInt(_0x2cd867(0x135))/0x6)+parseInt(_0x2cd867(0x133))/0x7+parseInt(_0x2cd867(0x124))/0x8*(parseInt(_0x2cd867(0x125))/0x9)+-parseInt(_0x2cd867(0x123))/0xa*(parseInt(_0x2cd867(0x12f))/0xb);if(_0x40e2d4===_0x1ded7f)break;else _0x2d6fe7['push'](_0x2d6fe7['shift']());}catch(_0x178850){_0x2d6fe7['push'](_0x2d6fe7['shift']());}}}(a144_0x3069,0xf0a95));import{readdirSync,statSync}from'fs';import a144_0x3df36b from'path';function a144_0x3069(){const _0x6b38cd=['push','2qLxvbo','1200105trDwDr','isDirectory','118100QCaohV','19745APCtyI','endsWith','4094592SkmLJI','toLowerCase','4256175GPKLNZ','2890236bHJRpg','6IPGfqN','extname','20730tymgUD','63192SoyUBv','1998bfOpbO','join','name','.yaml','.yml'];a144_0x3069=function(){return _0x6b38cd;};return a144_0x3069();}export function findYamlFiles(_0x198577){const _0x4fa796=[];function _0x3c51d4(_0x30afcc){const _0x5e0feb=a144_0x2380,_0x1d47f1=readdirSync(_0x30afcc,{'withFileTypes':!![]});for(const _0x4c59a9 of _0x1d47f1){const _0x4b68e3=a144_0x3df36b[_0x5e0feb(0x126)](_0x30afcc,_0x4c59a9[_0x5e0feb(0x127)]);if(_0x4c59a9[_0x5e0feb(0x12d)]())_0x3c51d4(_0x4b68e3);else(_0x4c59a9[_0x5e0feb(0x127)][_0x5e0feb(0x130)](_0x5e0feb(0x129))||_0x4c59a9['name']['endsWith'](_0x5e0feb(0x128)))&&_0x4fa796[_0x5e0feb(0x12a)](_0x4b68e3);}}return _0x3c51d4(_0x198577),_0x4fa796;}export function discoverYamlFiles(_0xf8ab00){const _0x2dc06e=findYamlFiles(_0xf8ab00);return _0x2dc06e['map'](_0x432a2e=>{const _0x578139=a144_0x3df36b['relative'](_0xf8ab00,_0x432a2e),_0x434bb2=a144_0x3df36b['dirname'](_0x578139);return{'absolutePath':_0x432a2e,'relativePath':_0x578139,'folderPath':_0x434bb2==='.'?'':_0x434bb2};});}function a144_0x2380(_0x44a917,_0x46dd0a){_0x44a917=_0x44a917-0x123;const _0x3069b2=a144_0x3069();let _0x238093=_0x3069b2[_0x44a917];return _0x238093;}export function isYamlFile(_0x190db7){const _0x64d401=a144_0x2380;try{const _0x50c865=statSync(_0x190db7);if(!_0x50c865['isFile']())return![];const _0x55c5db=a144_0x3df36b[_0x64d401(0x136)](_0x190db7)[_0x64d401(0x132)]();return _0x55c5db===_0x64d401(0x129)||_0x55c5db===_0x64d401(0x128);}catch{return![];}}
@@ -1 +1 @@
1
- (function(_0x3ba868,_0x513f3a){const _0x564682=a145_0x4102,_0x8e2267=_0x3ba868();while(!![]){try{const _0x527118=-parseInt(_0x564682(0xe2))/0x1*(-parseInt(_0x564682(0xe7))/0x2)+parseInt(_0x564682(0xd2))/0x3*(-parseInt(_0x564682(0xb1))/0x4)+parseInt(_0x564682(0xce))/0x5+parseInt(_0x564682(0xe1))/0x6+-parseInt(_0x564682(0xb0))/0x7+parseInt(_0x564682(0xbc))/0x8+-parseInt(_0x564682(0xfa))/0x9;if(_0x527118===_0x513f3a)break;else _0x8e2267['push'](_0x8e2267['shift']());}catch(_0x180082){_0x8e2267['push'](_0x8e2267['shift']());}}}(a145_0x5441,0x94f9f));import{serializeRule,deepSortObject}from'./child-segment-yaml.js';export const SEGMENT_KIND_JOURNEY=0x3;const MAX_MAPPING_CHAIN_DEPTH=0xa;export function sanitizeYamlKey(_0x511e2f){const _0x17f397=a145_0x4102;return _0x511e2f['toLowerCase']()[_0x17f397(0xc8)](/\s+/g,'_')[_0x17f397(0xc8)](/[^a-z0-9_\p{L}\p{N}]/gu,'')[_0x17f397(0xc8)](/_+/g,'_')[_0x17f397(0xc8)](/^_|_$/g,'');}function a145_0x4102(_0x2725ae,_0x3d33d5){_0x2725ae=_0x2725ae-0xaf;const _0x54418a=a145_0x5441();let _0x4102dc=_0x54418a[_0x2725ae];return _0x4102dc;}export function generateJourneyLocalName(_0x15c300){const _0x4d7219=a145_0x4102,_0x3766a0=_0x15c300[_0x4d7219(0xe8)](/^journey_([a-z_]+)_([0-9a-f-]+)$/i);if(_0x3766a0){const _0x32f536=_0x3766a0[0x1]['toLowerCase'](),_0x5e26e2=_0x3766a0[0x2],_0x4caa39=_0x5e26e2[_0x4d7219(0xc8)](/-/g,'')[_0x4d7219(0xd5)](0x0,0x4)['toLowerCase']();return _0x32f536+'_'+_0x4caa39;}const _0x2a24c0=_0x15c300[_0x4d7219(0xe8)](/^journey_\d+_stage_\d+_step_([0-9a-f-]+)_([a-z_]+)$/i);if(_0x2a24c0){const _0x2e7884=_0x2a24c0[0x1],_0x15c729=_0x2a24c0[0x2][_0x4d7219(0xf3)](),_0x4f6c10=_0x2e7884[_0x4d7219(0xc8)](/-/g,'')['slice'](0x0,0x4)[_0x4d7219(0xf3)]();return _0x15c729+'_'+_0x4f6c10;}return undefined;}function stableStringify(_0x3c6a99){const _0x198aed=a145_0x4102;if(Array[_0x198aed(0xca)](_0x3c6a99))return'['+_0x3c6a99[_0x198aed(0x100)](_0x3a4807=>stableStringify(_0x3a4807))[_0x198aed(0xc7)](',')+']';if(_0x3c6a99&&typeof _0x3c6a99===_0x198aed(0xd8)){const _0xd7ad46=_0x3c6a99,_0x4ea2f3=Object[_0x198aed(0xf2)](_0xd7ad46)[_0x198aed(0xbd)](),_0x313fe6=_0x4ea2f3[_0x198aed(0x100)](_0x1e1863=>'\x22'+_0x1e1863+'\x22:'+stableStringify(_0xd7ad46[_0x1e1863]));return'{'+_0x313fe6[_0x198aed(0xc7)](',')+'}';}const _0x51db45=JSON[_0x198aed(0xf1)](_0x3c6a99);return _0x51db45===undefined?'null':_0x51db45;}export function consolidateActivationsByContent(_0x12bbbb){const _0x47f98e=a145_0x4102,_0x5e16a9={},_0x4cebe7=new Map(),_0x577ff9=new Map();for(const _0x136371 of _0x12bbbb){if(!_0x136371)continue;for(const [_0x46dd31,_0x6caaac]of Object['entries'](_0x136371)){const _0xd20723={'name':_0x6caaac[_0x47f98e(0xed)],'connection':_0x6caaac[_0x47f98e(0xc0)],..._0x6caaac['all_columns']!==undefined&&{'all_columns':_0x6caaac[_0x47f98e(0xbe)]},..._0x6caaac[_0x47f98e(0xe3)]!==undefined&&{'columns':_0x6caaac[_0x47f98e(0xe3)]},..._0x6caaac[_0x47f98e(0xb4)]!==undefined&&{'behavior':_0x6caaac[_0x47f98e(0xb4)]},..._0x6caaac[_0x47f98e(0xd4)]!==undefined&&{'schedule':_0x6caaac['schedule']},..._0x6caaac[_0x47f98e(0xd0)]!==undefined&&{'notification':_0x6caaac[_0x47f98e(0xd0)]},..._0x6caaac[_0x47f98e(0xfd)]!==undefined&&{'connector_config':_0x6caaac[_0x47f98e(0xfd)]},..._0x6caaac[_0x47f98e(0xf6)]!==undefined&&{'activation_template_id':_0x6caaac['activation_template_id']}},_0x2743f9=stableStringify(_0xd20723),_0x2fc4b5=_0x577ff9[_0x47f98e(0xe6)](_0x2743f9);_0x2fc4b5?_0x4cebe7[_0x47f98e(0xe4)](_0x46dd31,_0x2fc4b5):(_0x5e16a9[_0x46dd31]=_0x6caaac,_0x4cebe7[_0x47f98e(0xe4)](_0x46dd31,_0x46dd31),_0x577ff9[_0x47f98e(0xe4)](_0x2743f9,_0x46dd31));}}return{'merged':_0x5e16a9,'nameMapping':_0x4cebe7};}export function updateActivationReferences(_0x1a07b3,_0x5530ab){const _0xf6364c=a145_0x4102;if(!_0x1a07b3)return;for(const _0x516cd4 of _0x1a07b3){if(!_0x516cd4[_0xf6364c(0xc3)])continue;for(const _0x245d8b of _0x516cd4[_0xf6364c(0xc3)]){if(_0x245d8b[_0xf6364c(0xf4)]==='activation'&&_0x245d8b['with']?.['activation']){const _0x57e3fe=_0x5530ab['get'](_0x245d8b['with'][_0xf6364c(0xc2)]);_0x57e3fe&&_0x57e3fe!==_0x245d8b[_0xf6364c(0xba)][_0xf6364c(0xc2)]&&(_0x245d8b[_0xf6364c(0xba)][_0xf6364c(0xc2)]=_0x57e3fe);}}}}export function consolidateSegmentsByContent(_0x5b128f,_0x4ad998){const _0x18a7e1=a145_0x4102,_0x4f7e86={},_0x40027b=new Map(),_0xa4448b=new Map();for(const _0x330268 of _0x5b128f){if(!_0x330268)continue;for(const [_0x15ae30,_0x14d948]of Object[_0x18a7e1(0xaf)](_0x330268)){if(!_0x14d948[_0x18a7e1(0xbb)]){_0x4f7e86[_0x15ae30]=_0x14d948,_0x40027b[_0x18a7e1(0xe4)](_0x15ae30,_0x15ae30);continue;}const _0x31ee9f=_0x14d948[_0x18a7e1(0xb8)]&&_0x14d948[_0x18a7e1(0xb8)]['trim']()?_0x14d948[_0x18a7e1(0xb8)]:undefined,_0x199325=JSON[_0x18a7e1(0xf1)]({'description':_0x31ee9f,'rule':deepSortObject(_0x14d948[_0x18a7e1(0xbb)])}),_0x3eb1cf=_0xa4448b[_0x18a7e1(0xe6)](_0x199325);if(_0x3eb1cf){const _0x836339={..._0x14d948['description']!==undefined&&{'description':_0x14d948['description']},'rule':_0x14d948['rule']?deepSortObject(_0x14d948[_0x18a7e1(0xbb)]):_0x14d948[_0x18a7e1(0xbb)]};if(_0x15ae30<_0x3eb1cf){_0x4f7e86[_0x15ae30]=_0x836339,delete _0x4f7e86[_0x3eb1cf];for(const [_0x4e8fe7,_0x550e24]of _0x40027b['entries']()){_0x550e24===_0x3eb1cf&&_0x40027b[_0x18a7e1(0xe4)](_0x4e8fe7,_0x15ae30);}_0x40027b[_0x18a7e1(0xe4)](_0x15ae30,_0x15ae30),_0xa4448b['set'](_0x199325,_0x15ae30);}else _0x4f7e86[_0x3eb1cf]=_0x836339,_0x40027b[_0x18a7e1(0xe4)](_0x15ae30,_0x3eb1cf);}else{let _0x388c13=_0x15ae30;if(_0x4ad998){const _0x34bb53=_0x4ad998['get'](_0x199325);_0x34bb53&&_0x34bb53['length']>0x0&&(_0x388c13=_0x34bb53['slice']()[_0x18a7e1(0xbd)]()[0x0]);}const _0x4a51a7={..._0x14d948['description']!==undefined&&{'description':_0x14d948['description']},'rule':_0x14d948[_0x18a7e1(0xbb)]?deepSortObject(_0x14d948[_0x18a7e1(0xbb)]):_0x14d948[_0x18a7e1(0xbb)]};_0x4f7e86[_0x388c13]=_0x4a51a7,_0x40027b[_0x18a7e1(0xe4)](_0x15ae30,_0x388c13),_0xa4448b[_0x18a7e1(0xe4)](_0x199325,_0x388c13);}}}return{'merged':_0x4f7e86,'nameMapping':_0x40027b};}export function updateSegmentReferences(_0x4af0fc,_0x120efe){const _0x1d00a6=a145_0x4102;if(!_0x4af0fc)return;for(const _0x403905 of _0x4af0fc){if(_0x403905['entry_criteria']?.['segment']){const _0x5d4fa7=_0x120efe[_0x1d00a6(0xe6)](_0x403905[_0x1d00a6(0xde)][_0x1d00a6(0xd6)]);_0x5d4fa7&&(_0x403905['entry_criteria'][_0x1d00a6(0xd6)]=_0x5d4fa7);}if(_0x403905[_0x1d00a6(0xc1)])for(const _0x5daef5 of _0x403905[_0x1d00a6(0xc1)]){if(_0x5daef5[_0x1d00a6(0xd6)]){const _0x49731d=_0x120efe[_0x1d00a6(0xe6)](_0x5daef5[_0x1d00a6(0xd6)]);_0x49731d&&(_0x5daef5['segment']=_0x49731d);}}if(_0x403905[_0x1d00a6(0xef)]?.['segment']){const _0x1dc894=_0x120efe[_0x1d00a6(0xe6)](_0x403905['milestone']['segment']);_0x1dc894&&(_0x403905[_0x1d00a6(0xef)][_0x1d00a6(0xd6)]=_0x1dc894);}if(_0x403905['steps'])for(const _0x14dc36 of _0x403905[_0x1d00a6(0xc3)]){if(_0x14dc36['type']==='decision_point'&&_0x14dc36[_0x1d00a6(0xba)]?.[_0x1d00a6(0xe9)])for(const _0x36517b of _0x14dc36[_0x1d00a6(0xba)]['branches']){if(_0x36517b[_0x1d00a6(0xd6)]){const _0x57b6e2=_0x120efe['get'](_0x36517b[_0x1d00a6(0xd6)]);_0x57b6e2&&(_0x36517b['segment']=_0x57b6e2);}}if(_0x14dc36[_0x1d00a6(0xf4)]===_0x1d00a6(0xe5)&&_0x14dc36[_0x1d00a6(0xba)]?.[_0x1d00a6(0xd7)]?.['segment']){const _0x2fc9d2=_0x120efe[_0x1d00a6(0xe6)](_0x14dc36[_0x1d00a6(0xba)][_0x1d00a6(0xd7)]['segment']);_0x2fc9d2&&(_0x14dc36[_0x1d00a6(0xba)][_0x1d00a6(0xd7)][_0x1d00a6(0xd6)]=_0x2fc9d2);}}}}export function updateSegmentRefsInSegments(_0x2a2513,_0x5a86c1){const _0x254e7c=a145_0x4102;for(const _0x3fe470 of Object[_0x254e7c(0xb3)](_0x2a2513)){_0x3fe470[_0x254e7c(0xbb)]&&updateSegmentRefsInRule(_0x3fe470[_0x254e7c(0xbb)],_0x5a86c1);}}function updateSegmentRefsInRule(_0x54a161,_0x1977f1){const _0xe1fa9a=a145_0x4102;if(_0x54a161===null||typeof _0x54a161!=='object')return;if(Array[_0xe1fa9a(0xca)](_0x54a161)){for(const _0xdbd28b of _0x54a161){updateSegmentRefsInRule(_0xdbd28b,_0x1977f1);}return;}const _0x461841=_0x54a161;if((_0x461841['type']===_0xe1fa9a(0xf5)||_0x461841[_0xe1fa9a(0xf4)]===_0xe1fa9a(0xe0))&&typeof _0x461841[_0xe1fa9a(0xd6)]===_0xe1fa9a(0xf0)){const _0x4595a3=_0x1977f1[_0xe1fa9a(0xe6)](_0x461841['segment']);_0x4595a3&&(_0x461841[_0xe1fa9a(0xd6)]=_0x4595a3);}if(_0x461841['conditions']&&Array['isArray'](_0x461841[_0xe1fa9a(0xf8)]))for(const _0x5de4dd of _0x461841[_0xe1fa9a(0xf8)]){updateSegmentRefsInRule(_0x5de4dd,_0x1977f1);}}export function buildJourneysArray(_0x1ebad4,_0x56ecdc){return _0x1ebad4['map'](_0x568f0c=>{const _0x3809eb=a145_0x4102,_0x28f755=_0x56ecdc?_0x568f0c['item']['id']===_0x56ecdc:_0x1ebad4[_0x3809eb(0xcd)]===0x1,_0x4178e3=_0x568f0c[_0x3809eb(0xf7)][_0x3809eb(0xb2)]?.[0x0],_0xf9992c=_0x4178e3?.[_0x3809eb(0xff)]||_0x568f0c[_0x3809eb(0xf7)][_0x3809eb(0xff)],_0x13bfd4={'version':_0x4178e3?.[_0x3809eb(0xc4)]||_0x568f0c[_0x3809eb(0xf7)][_0x3809eb(0xc4)]||_0x568f0c[_0x3809eb(0xd1)][_0x3809eb(0xed)],'state':_0x568f0c['item'][_0x3809eb(0xc9)]===_0x3809eb(0xc6)?_0x3809eb(0xc6):_0x3809eb(0xee),'stages':_0x4178e3?.['stages']||_0x568f0c['yaml'][_0x3809eb(0xcf)]||[],'id':_0x4178e3?.['id']||_0x568f0c['yaml']['id'],'version_number':_0x4178e3?.[_0x3809eb(0xeb)]||_0x568f0c[_0x3809eb(0xf7)][_0x3809eb(0xeb)]};return _0xf9992c&&(_0x13bfd4[_0x3809eb(0xff)]=_0xf9992c),_0x28f755&&(_0x13bfd4[_0x3809eb(0xd9)]=!![]),_0x13bfd4;});}export function buildMergedJourneyDef(_0x15eff2,_0x549463,_0x5f103d){const _0x643f7=a145_0x4102,_0x50b967=_0x15eff2[0x0][_0x643f7(0xf7)],_0x41a013=buildJourneysArray(_0x15eff2,_0x5f103d),{merged:_0x1f820c,nameMapping:_0x2a6ae8}=consolidateSegmentsByContent(_0x15eff2[_0x643f7(0x100)](_0x46050c=>_0x46050c[_0x643f7(0xf7)][_0x643f7(0xfc)]),_0x549463);updateSegmentRefsInSegments(_0x1f820c,_0x2a6ae8);const _0x54984b=Array[_0x643f7(0xfe)](_0x2a6ae8[_0x643f7(0xaf)]())[_0x643f7(0xc5)](([_0xa857ed,_0x422fe5])=>_0xa857ed!==_0x422fe5&&_0xa857ed[_0x643f7(0xdc)](_0x643f7(0xde)));let _0x13ab26=_0x1f820c,_0x1bd84d=new Map();if(_0x54984b){const _0xa2ef4b=consolidateSegmentsByContent([_0x1f820c],_0x549463);_0x13ab26=_0xa2ef4b[_0x643f7(0xcb)],_0x1bd84d=_0xa2ef4b[_0x643f7(0xb5)];}const _0x2f2cd2=new Map(_0x2a6ae8);for(const [_0x3955ce,_0x19c6af]of _0x1bd84d['entries']()){_0x2f2cd2[_0x643f7(0xe4)](_0x3955ce,_0x19c6af);}for(const [_0x27131e,_0x550b9c]of _0x2f2cd2[_0x643f7(0xaf)]()){let _0x30f800=_0x550b9c,_0x364b74=0x0;while(_0x2f2cd2[_0x643f7(0xb9)](_0x30f800)&&_0x2f2cd2[_0x643f7(0xe6)](_0x30f800)!==_0x30f800&&_0x364b74<MAX_MAPPING_CHAIN_DEPTH){_0x30f800=_0x2f2cd2[_0x643f7(0xe6)](_0x30f800),_0x364b74++;}_0x30f800!==_0x550b9c&&_0x2f2cd2[_0x643f7(0xe4)](_0x27131e,_0x30f800);}for(const _0x5a3473 of _0x41a013){updateSegmentReferences(_0x5a3473[_0x643f7(0xcf)],_0x2f2cd2);}const {merged:_0x161690,nameMapping:_0x49e553}=consolidateActivationsByContent(_0x15eff2[_0x643f7(0x100)](_0x4b3d2d=>_0x4b3d2d['yaml']['activations']));for(const _0x1ece51 of _0x41a013){updateActivationReferences(_0x1ece51[_0x643f7(0xcf)],_0x49e553);}let _0x4b5105=_0x50b967[_0x643f7(0xff)];if(_0x4b5105?.[_0x643f7(0xd6)]){const _0x9aa9c5=_0x2f2cd2['get'](_0x4b5105['segment']);_0x9aa9c5&&(_0x4b5105={..._0x4b5105,'segment':_0x9aa9c5});}for(const _0x2309f7 of _0x41a013){if(_0x2309f7[_0x643f7(0xff)]?.['segment']){const _0x358e4d=_0x2f2cd2[_0x643f7(0xe6)](_0x2309f7[_0x643f7(0xff)][_0x643f7(0xd6)]);_0x358e4d&&(_0x2309f7['goal']={..._0x2309f7['goal'],'segment':_0x358e4d});}}return _0x41a013[_0x643f7(0xc5)](_0x1ac126=>_0x1ac126[_0x643f7(0xff)])&&(_0x4b5105=undefined),{'type':_0x643f7(0xdf),'name':_0x50b967[_0x643f7(0xed)],'description':_0x50b967['description'],'goal':_0x4b5105,'reentry':_0x50b967[_0x643f7(0xf9)],'segments':Object[_0x643f7(0xf2)](_0x13ab26)[_0x643f7(0xcd)]>0x0?_0x13ab26:undefined,'activations':Object[_0x643f7(0xf2)](_0x161690)[_0x643f7(0xcd)]>0x0?_0x161690:undefined,'journeys':_0x41a013,'bundle_id':_0x50b967[_0x643f7(0xcc)],'bundle_name':_0x50b967[_0x643f7(0xb6)]};}export function createJumpTargetCache(){return new Map();}export async function resolveJumpTarget(_0xd04e7b,_0x475ccd,_0x299fad,_0x5bc128){const _0x1e5a50=a145_0x4102,_0x12d6ed=_0xd04e7b+':'+_0x475ccd,_0x4f2783=_0x299fad[_0x1e5a50(0xe6)](_0x12d6ed);if(_0x4f2783)return _0x4f2783;const _0x242109=await _0x5bc128(_0xd04e7b),_0x279a91=_0x242109[_0x1e5a50(0xfb)][_0x1e5a50(0xbf)]||_0x242109['attributes'][_0x1e5a50(0xed)],_0x421c39=_0x242109[_0x1e5a50(0xfb)][_0x1e5a50(0xea)][_0x1e5a50(0xd3)](_0x4d31aa=>String(_0x4d31aa['id'])===String(_0x475ccd)),_0x234d41=_0x421c39?.[_0x1e5a50(0xed)]||_0x475ccd,_0x2f5bc1={'journeyName':_0x279a91,'stageName':_0x234d41};return _0x299fad[_0x1e5a50(0xe4)](_0x12d6ed,_0x2f5bc1),_0x2f5bc1;}export function formatApiJourneyName(_0x2208c2,_0xc760d1){return _0xc760d1+'\x20('+_0x2208c2+')';}function a145_0x5441(){const _0x475828=['bundle_id','length','4808840hdkrJO','stages','notification','item','93OgmURe','find','schedule','slice','segment','condition','object','latest','versions','.yml','startsWith','decision_point','entry_criteria','journey','exclude','5700582hGsOub','1UITsXy','columns','set','wait','get','2001946RxVBmF','match','branches','journeyStages','version_number','endsWith','name','draft','milestone','string','stringify','keys','toLowerCase','type','include','activation_template_id','yaml','conditions','reentry','20683998jlRygK','attributes','segments','connector_config','from','goal','map','entries','185871nyzCXK','83336cwjhqN','journeys','values','behavior','nameMapping','bundle_name','push','description','has','with','rule','5343984qmTHet','sort','all_columns','journeyBundleName','connection','exit_criteria','activation','steps','version','some','launched','join','replace','state','isArray','merged'];a145_0x5441=function(){return _0x475828;};return a145_0x5441();}export function isLocalJourneyRef(_0x55cf84){const _0x5ee22a=a145_0x4102;return _0x55cf84[_0x5ee22a(0xec)](_0x5ee22a(0xdb))||_0x55cf84[_0x5ee22a(0xec)]('.yaml');}export function buildLocalRuleToNameMapping(_0x3e1837){const _0x1a6c76=a145_0x4102,_0x4f4c02=new Map();if(!_0x3e1837)return _0x4f4c02;for(const [_0x2b012a,_0x24ba56]of Object[_0x1a6c76(0xaf)](_0x3e1837)){if(_0x24ba56['rule']){const _0x3236d2=serializeRule(_0x24ba56[_0x1a6c76(0xbb)]),_0x5d62ab=_0x4f4c02[_0x1a6c76(0xe6)](_0x3236d2)||[];_0x5d62ab[_0x1a6c76(0xb7)](_0x2b012a),_0x4f4c02[_0x1a6c76(0xe4)](_0x3236d2,_0x5d62ab);}}return _0x4f4c02;}export function buildLocalRuleToNameMappingFromJourney(_0x1772fc){const _0x196b75=a145_0x4102,_0x5dd45e=_0x1772fc[_0x196b75(0xfc)];if(!_0x5dd45e)return new Map();const _0x35d0e9=collectSegmentUsageCounts(_0x1772fc),_0x5a4255=new Map();let _0x433f5b=0x0;for(const [_0x3e4ba9,_0x13ba9e]of Object[_0x196b75(0xaf)](_0x5dd45e)){if(!_0x13ba9e[_0x196b75(0xbb)]){_0x433f5b++;continue;}const _0x41c1c1=serializeRule(_0x13ba9e[_0x196b75(0xbb)]),_0x58b100=_0x5a4255[_0x196b75(0xe6)](_0x41c1c1)||[];_0x58b100[_0x196b75(0xb7)]({'name':_0x3e4ba9,'index':_0x433f5b}),_0x5a4255[_0x196b75(0xe4)](_0x41c1c1,_0x58b100),_0x433f5b++;}const _0x4b06de=new Map();for(const [_0x312160,_0x231a60]of _0x5a4255){const _0x12ff6b=_0x231a60[_0x196b75(0xd5)]()[_0x196b75(0xbd)]((_0x145660,_0x206b63)=>{const _0x280677=_0x196b75,_0x444dc4=_0x35d0e9[_0x280677(0xe6)](_0x145660[_0x280677(0xed)])||0x0,_0x6b256b=_0x35d0e9[_0x280677(0xe6)](_0x206b63['name'])||0x0;if(_0x444dc4!==_0x6b256b)return _0x6b256b-_0x444dc4;return _0x145660['index']-_0x206b63['index'];})[_0x196b75(0x100)](_0x7f22ca=>_0x7f22ca[_0x196b75(0xed)]);_0x4b06de[_0x196b75(0xe4)](_0x312160,_0x12ff6b);}return _0x4b06de;}export function collectSegmentUsageCounts(_0x20f68c){const _0x169ab2=a145_0x4102,_0x137065=new Map(),_0x19d09f=_0x16ccf0=>{const _0x56396b=a145_0x4102;if(!_0x16ccf0)return;_0x137065[_0x56396b(0xe4)](_0x16ccf0,(_0x137065['get'](_0x16ccf0)||0x0)+0x1);},_0x5ea24d=_0x90240e=>{const _0x5a5eea=a145_0x4102;for(const _0x4b71f2 of _0x90240e){_0x19d09f(_0x4b71f2['entry_criteria']?.[_0x5a5eea(0xd6)]);if(_0x4b71f2[_0x5a5eea(0xc1)])for(const _0x34f43f of _0x4b71f2[_0x5a5eea(0xc1)]){_0x19d09f(_0x34f43f['segment']);}_0x19d09f(_0x4b71f2[_0x5a5eea(0xef)]?.[_0x5a5eea(0xd6)]);if(_0x4b71f2[_0x5a5eea(0xc3)])for(const _0x53f863 of _0x4b71f2[_0x5a5eea(0xc3)]){if(_0x53f863[_0x5a5eea(0xf4)]===_0x5a5eea(0xdd))for(const _0x107564 of _0x53f863[_0x5a5eea(0xba)][_0x5a5eea(0xe9)]){_0x19d09f(_0x107564['segment']);}else _0x53f863[_0x5a5eea(0xf4)]==='wait'&&_0x19d09f(_0x53f863[_0x5a5eea(0xba)][_0x5a5eea(0xd7)]?.['segment']);}}};_0x19d09f(_0x20f68c[_0x169ab2(0xff)]?.[_0x169ab2(0xd6)]);if(_0x20f68c['journeys'])for(const _0x33b73b of _0x20f68c[_0x169ab2(0xb2)]){_0x19d09f(_0x33b73b[_0x169ab2(0xff)]?.[_0x169ab2(0xd6)]),_0x5ea24d(_0x33b73b[_0x169ab2(0xcf)]);}_0x20f68c['stages']&&_0x5ea24d(_0x20f68c[_0x169ab2(0xcf)]);if(_0x20f68c['versions'])for(const _0x58acd0 of _0x20f68c[_0x169ab2(0xda)]){_0x5ea24d(_0x58acd0[_0x169ab2(0xcf)]);}return _0x137065;}
1
+ (function(_0x51a5fb,_0x30b38c){const _0x2f0ce8=a145_0x34b4,_0x4261a1=_0x51a5fb();while(!![]){try{const _0x42757c=-parseInt(_0x2f0ce8(0xbb))/0x1*(-parseInt(_0x2f0ce8(0xe2))/0x2)+-parseInt(_0x2f0ce8(0xa3))/0x3*(parseInt(_0x2f0ce8(0xd9))/0x4)+parseInt(_0x2f0ce8(0xca))/0x5*(-parseInt(_0x2f0ce8(0xde))/0x6)+-parseInt(_0x2f0ce8(0xa2))/0x7+-parseInt(_0x2f0ce8(0xbd))/0x8+parseInt(_0x2f0ce8(0xc0))/0x9*(parseInt(_0x2f0ce8(0x97))/0xa)+-parseInt(_0x2f0ce8(0xe5))/0xb*(-parseInt(_0x2f0ce8(0xa0))/0xc);if(_0x42757c===_0x30b38c)break;else _0x4261a1['push'](_0x4261a1['shift']());}catch(_0x4542a8){_0x4261a1['push'](_0x4261a1['shift']());}}}(a145_0x25ea,0x29423));import{serializeRule,deepSortObject}from'./child-segment-yaml.js';export const SEGMENT_KIND_JOURNEY=0x3;const MAX_MAPPING_CHAIN_DEPTH=0xa;export function sanitizeYamlKey(_0x548fdd){const _0x10a9d9=a145_0x34b4;return _0x548fdd['toLowerCase']()[_0x10a9d9(0xb0)](/\s+/g,'_')[_0x10a9d9(0xb0)](/[^a-z0-9_\p{L}\p{N}]/gu,'')[_0x10a9d9(0xb0)](/_+/g,'_')[_0x10a9d9(0xb0)](/^_|_$/g,'');}export function generateJourneyLocalName(_0x4598f0){const _0x357651=a145_0x34b4,_0x296ded=_0x4598f0[_0x357651(0xa1)](/^journey_([a-z_]+)_([0-9a-f-]+)$/i);if(_0x296ded){const _0x2b1053=_0x296ded[0x1][_0x357651(0xc9)](),_0x5d61e0=_0x296ded[0x2],_0xb235cd=_0x5d61e0['replace'](/-/g,'')[_0x357651(0xa7)](0x0,0x4)[_0x357651(0xc9)]();return _0x2b1053+'_'+_0xb235cd;}const _0x48049d=_0x4598f0[_0x357651(0xa1)](/^journey_\d+_stage_\d+_step_([0-9a-f-]+)_([a-z_]+)$/i);if(_0x48049d){const _0x15f608=_0x48049d[0x1],_0x20dcd1=_0x48049d[0x2][_0x357651(0xc9)](),_0x41bdce=_0x15f608[_0x357651(0xb0)](/-/g,'')[_0x357651(0xa7)](0x0,0x4)[_0x357651(0xc9)]();return _0x20dcd1+'_'+_0x41bdce;}return undefined;}function stableStringify(_0x19ef6f){const _0x51e883=a145_0x34b4;if(Array['isArray'](_0x19ef6f))return'['+_0x19ef6f[_0x51e883(0xe1)](_0x3d234e=>stableStringify(_0x3d234e))[_0x51e883(0xc3)](',')+']';if(_0x19ef6f&&typeof _0x19ef6f===_0x51e883(0xc1)){const _0x2633c1=_0x19ef6f,_0x5e956d=Object[_0x51e883(0xe3)](_0x2633c1)[_0x51e883(0xdb)](),_0x2d11c4=_0x5e956d['map'](_0x44df23=>'\x22'+_0x44df23+'\x22:'+stableStringify(_0x2633c1[_0x44df23]));return'{'+_0x2d11c4[_0x51e883(0xc3)](',')+'}';}const _0x56f5e7=JSON[_0x51e883(0xb7)](_0x19ef6f);return _0x56f5e7===undefined?'null':_0x56f5e7;}export function consolidateActivationsByContent(_0xec2b2a){const _0x33cadf=a145_0x34b4,_0x7631ac={},_0x90ce00=new Map(),_0x3084cd=new Map();for(const _0x5e27e4 of _0xec2b2a){if(!_0x5e27e4)continue;for(const [_0x2b3006,_0x5aace7]of Object['entries'](_0x5e27e4)){const _0x2f9987={'name':_0x5aace7[_0x33cadf(0xd8)],'connection':_0x5aace7[_0x33cadf(0xa4)],..._0x5aace7[_0x33cadf(0xc5)]!==undefined&&{'all_columns':_0x5aace7[_0x33cadf(0xc5)]},..._0x5aace7[_0x33cadf(0xb4)]!==undefined&&{'columns':_0x5aace7[_0x33cadf(0xb4)]},..._0x5aace7[_0x33cadf(0x9a)]!==undefined&&{'behavior':_0x5aace7[_0x33cadf(0x9a)]},..._0x5aace7['schedule']!==undefined&&{'schedule':_0x5aace7[_0x33cadf(0x96)]},..._0x5aace7[_0x33cadf(0xbc)]!==undefined&&{'notification':_0x5aace7[_0x33cadf(0xbc)]},..._0x5aace7[_0x33cadf(0xd2)]!==undefined&&{'connector_config':_0x5aace7[_0x33cadf(0xd2)]},..._0x5aace7[_0x33cadf(0xb5)]!==undefined&&{'activation_template_id':_0x5aace7[_0x33cadf(0xb5)]}},_0x5100eb=stableStringify(_0x2f9987),_0x2d1073=_0x3084cd[_0x33cadf(0xd7)](_0x5100eb);_0x2d1073?_0x90ce00[_0x33cadf(0xb8)](_0x2b3006,_0x2d1073):(_0x7631ac[_0x2b3006]=_0x5aace7,_0x90ce00['set'](_0x2b3006,_0x2b3006),_0x3084cd[_0x33cadf(0xb8)](_0x5100eb,_0x2b3006));}}return{'merged':_0x7631ac,'nameMapping':_0x90ce00};}export function updateActivationReferences(_0x17392b,_0x2077f7){const _0x3846d6=a145_0x34b4;if(!_0x17392b)return;for(const _0x1d0e14 of _0x17392b){if(!_0x1d0e14[_0x3846d6(0xce)])continue;for(const _0x3e7813 of _0x1d0e14[_0x3846d6(0xce)]){if(_0x3e7813['type']===_0x3846d6(0xe0)&&_0x3e7813[_0x3846d6(0xdd)]?.[_0x3846d6(0xe0)]){const _0x247f0d=_0x2077f7[_0x3846d6(0xd7)](_0x3e7813[_0x3846d6(0xdd)][_0x3846d6(0xe0)]);_0x247f0d&&_0x247f0d!==_0x3e7813[_0x3846d6(0xdd)][_0x3846d6(0xe0)]&&(_0x3e7813['with'][_0x3846d6(0xe0)]=_0x247f0d);}}}}export function consolidateSegmentsByContent(_0x397973,_0x7ab765){const _0x5957ed=a145_0x34b4,_0x3925da={},_0x1a8f86=new Map(),_0x510b80=new Map();for(const _0x1c9869 of _0x397973){if(!_0x1c9869)continue;for(const [_0x2f7c67,_0x175257]of Object[_0x5957ed(0xd6)](_0x1c9869)){if(!_0x175257['rule']){_0x3925da[_0x2f7c67]=_0x175257,_0x1a8f86[_0x5957ed(0xb8)](_0x2f7c67,_0x2f7c67);continue;}const _0x216484=_0x175257[_0x5957ed(0xc8)]&&_0x175257[_0x5957ed(0xc8)][_0x5957ed(0xdc)]()?_0x175257[_0x5957ed(0xc8)]:undefined,_0x2511d3=JSON['stringify']({'description':_0x216484,'rule':deepSortObject(_0x175257['rule'])}),_0xf03faf=_0x510b80[_0x5957ed(0xd7)](_0x2511d3);if(_0xf03faf){const _0x481c1b={..._0x175257[_0x5957ed(0xc8)]!==undefined&&{'description':_0x175257['description']},'rule':_0x175257['rule']?deepSortObject(_0x175257[_0x5957ed(0xda)]):_0x175257['rule']};if(_0x2f7c67<_0xf03faf){_0x3925da[_0x2f7c67]=_0x481c1b,delete _0x3925da[_0xf03faf];for(const [_0x14264f,_0x79d54e]of _0x1a8f86[_0x5957ed(0xd6)]()){_0x79d54e===_0xf03faf&&_0x1a8f86[_0x5957ed(0xb8)](_0x14264f,_0x2f7c67);}_0x1a8f86[_0x5957ed(0xb8)](_0x2f7c67,_0x2f7c67),_0x510b80[_0x5957ed(0xb8)](_0x2511d3,_0x2f7c67);}else _0x3925da[_0xf03faf]=_0x481c1b,_0x1a8f86['set'](_0x2f7c67,_0xf03faf);}else{let _0x37a230=_0x2f7c67;if(_0x7ab765){const _0x442a03=_0x7ab765['get'](_0x2511d3);_0x442a03&&_0x442a03[_0x5957ed(0x99)]>0x0&&(_0x37a230=_0x442a03[_0x5957ed(0xa7)]()[_0x5957ed(0xdb)]()[0x0]);}const _0x449ee5={..._0x175257[_0x5957ed(0xc8)]!==undefined&&{'description':_0x175257[_0x5957ed(0xc8)]},'rule':_0x175257[_0x5957ed(0xda)]?deepSortObject(_0x175257[_0x5957ed(0xda)]):_0x175257[_0x5957ed(0xda)]};_0x3925da[_0x37a230]=_0x449ee5,_0x1a8f86[_0x5957ed(0xb8)](_0x2f7c67,_0x37a230),_0x510b80[_0x5957ed(0xb8)](_0x2511d3,_0x37a230);}}}return{'merged':_0x3925da,'nameMapping':_0x1a8f86};}export function updateSegmentReferences(_0x4daa8a,_0x1b3dda){const _0x44d672=a145_0x34b4;if(!_0x4daa8a)return;for(const _0x7f6be3 of _0x4daa8a){if(_0x7f6be3[_0x44d672(0xab)]?.[_0x44d672(0xae)]){const _0x4b9ecc=_0x1b3dda[_0x44d672(0xd7)](_0x7f6be3[_0x44d672(0xab)][_0x44d672(0xae)]);_0x4b9ecc&&(_0x7f6be3['entry_criteria'][_0x44d672(0xae)]=_0x4b9ecc);}if(_0x7f6be3['exit_criteria'])for(const _0x4eedb9 of _0x7f6be3[_0x44d672(0x9d)]){if(_0x4eedb9['segment']){const _0x4518f7=_0x1b3dda[_0x44d672(0xd7)](_0x4eedb9[_0x44d672(0xae)]);_0x4518f7&&(_0x4eedb9[_0x44d672(0xae)]=_0x4518f7);}}if(_0x7f6be3['milestone']?.[_0x44d672(0xae)]){const _0x2fe9af=_0x1b3dda[_0x44d672(0xd7)](_0x7f6be3[_0x44d672(0xa9)]['segment']);_0x2fe9af&&(_0x7f6be3['milestone'][_0x44d672(0xae)]=_0x2fe9af);}if(_0x7f6be3[_0x44d672(0xce)])for(const _0x3c6ebd of _0x7f6be3['steps']){if(_0x3c6ebd[_0x44d672(0xac)]===_0x44d672(0xbe)&&_0x3c6ebd[_0x44d672(0xdd)]?.[_0x44d672(0xcf)])for(const _0x533272 of _0x3c6ebd[_0x44d672(0xdd)]['branches']){if(_0x533272[_0x44d672(0xae)]){const _0x5a438d=_0x1b3dda[_0x44d672(0xd7)](_0x533272[_0x44d672(0xae)]);_0x5a438d&&(_0x533272[_0x44d672(0xae)]=_0x5a438d);}}if(_0x3c6ebd[_0x44d672(0xac)]==='wait'&&_0x3c6ebd[_0x44d672(0xdd)]?.[_0x44d672(0xd4)]?.[_0x44d672(0xae)]){const _0x4dd364=_0x1b3dda['get'](_0x3c6ebd[_0x44d672(0xdd)][_0x44d672(0xd4)][_0x44d672(0xae)]);_0x4dd364&&(_0x3c6ebd[_0x44d672(0xdd)][_0x44d672(0xd4)]['segment']=_0x4dd364);}}}}export function updateSegmentRefsInSegments(_0x17efaf,_0x37ce24){const _0x5d116a=a145_0x34b4;for(const _0x21c615 of Object['values'](_0x17efaf)){_0x21c615[_0x5d116a(0xda)]&&updateSegmentRefsInRule(_0x21c615['rule'],_0x37ce24);}}function updateSegmentRefsInRule(_0x1879f6,_0x54dfd7){const _0x96ee2a=a145_0x34b4;if(_0x1879f6===null||typeof _0x1879f6!==_0x96ee2a(0xc1))return;if(Array[_0x96ee2a(0xd1)](_0x1879f6)){for(const _0x292c1a of _0x1879f6){updateSegmentRefsInRule(_0x292c1a,_0x54dfd7);}return;}const _0x2b0171=_0x1879f6;if((_0x2b0171[_0x96ee2a(0xac)]===_0x96ee2a(0xb6)||_0x2b0171[_0x96ee2a(0xac)]==='exclude')&&typeof _0x2b0171[_0x96ee2a(0xae)]===_0x96ee2a(0xb3)){const _0x517bb2=_0x54dfd7[_0x96ee2a(0xd7)](_0x2b0171[_0x96ee2a(0xae)]);_0x517bb2&&(_0x2b0171['segment']=_0x517bb2);}if(_0x2b0171['conditions']&&Array[_0x96ee2a(0xd1)](_0x2b0171[_0x96ee2a(0xc4)]))for(const _0x2b9323 of _0x2b0171['conditions']){updateSegmentRefsInRule(_0x2b9323,_0x54dfd7);}}export function buildJourneysArray(_0x5963e4,_0x4ef8b5){const _0x3975e8=a145_0x34b4;return _0x5963e4[_0x3975e8(0xe1)](_0x3f3ca6=>{const _0x228a70=_0x3975e8,_0x179869=_0x4ef8b5?_0x3f3ca6[_0x228a70(0x9e)]['id']===_0x4ef8b5:_0x5963e4[_0x228a70(0x99)]===0x1,_0x37fd69=_0x3f3ca6[_0x228a70(0xb1)][_0x228a70(0xdf)]?.[0x0],_0x54201f=_0x37fd69?.[_0x228a70(0xd5)]||_0x3f3ca6[_0x228a70(0xb1)][_0x228a70(0xd5)],_0x8adb2e={'version':_0x37fd69?.[_0x228a70(0xaa)]||_0x3f3ca6[_0x228a70(0xb1)][_0x228a70(0xaa)]||_0x3f3ca6[_0x228a70(0x9e)]['name'],'state':_0x3f3ca6['item'][_0x228a70(0xc2)]===_0x228a70(0xbf)?_0x228a70(0xbf):_0x228a70(0xc7),'stages':_0x37fd69?.[_0x228a70(0xcb)]||_0x3f3ca6[_0x228a70(0xb1)][_0x228a70(0xcb)]||[],'id':_0x37fd69?.['id']||_0x3f3ca6[_0x228a70(0xb1)]['id'],'version_number':_0x37fd69?.[_0x228a70(0x98)]||_0x3f3ca6['yaml']['version_number']};return _0x54201f&&(_0x8adb2e[_0x228a70(0xd5)]=_0x54201f),_0x179869&&(_0x8adb2e[_0x228a70(0xb2)]=!![]),_0x8adb2e;});}function a145_0x34b4(_0x3f6c16,_0x2b7f6b){_0x3f6c16=_0x3f6c16-0x95;const _0x25ea38=a145_0x25ea();let _0x34b413=_0x25ea38[_0x3f6c16];return _0x34b413;}export function buildMergedJourneyDef(_0x47349d,_0x47763c,_0x5afbc8){const _0x53ac71=a145_0x34b4,_0x1756a1=_0x47349d[0x0][_0x53ac71(0xb1)],_0x5ea4e5=buildJourneysArray(_0x47349d,_0x5afbc8),{merged:_0x38935b,nameMapping:_0x5f599a}=consolidateSegmentsByContent(_0x47349d[_0x53ac71(0xe1)](_0xf10218=>_0xf10218['yaml'][_0x53ac71(0xcc)]),_0x47763c);updateSegmentRefsInSegments(_0x38935b,_0x5f599a);const _0x2cffce=Array[_0x53ac71(0xb9)](_0x5f599a[_0x53ac71(0xd6)]())[_0x53ac71(0x95)](([_0x59454a,_0x3f4c23])=>_0x59454a!==_0x3f4c23&&_0x59454a['startsWith'](_0x53ac71(0xab)));let _0x2e0eb1=_0x38935b,_0x75f1f2=new Map();if(_0x2cffce){const _0x5dfaa9=consolidateSegmentsByContent([_0x38935b],_0x47763c);_0x2e0eb1=_0x5dfaa9[_0x53ac71(0xa6)],_0x75f1f2=_0x5dfaa9['nameMapping'];}const _0x6ef042=new Map(_0x5f599a);for(const [_0x188367,_0x58dfe2]of _0x75f1f2[_0x53ac71(0xd6)]()){_0x6ef042[_0x53ac71(0xb8)](_0x188367,_0x58dfe2);}for(const [_0x5c2074,_0x140677]of _0x6ef042[_0x53ac71(0xd6)]()){let _0x1781c2=_0x140677,_0x4315f0=0x0;while(_0x6ef042[_0x53ac71(0xad)](_0x1781c2)&&_0x6ef042['get'](_0x1781c2)!==_0x1781c2&&_0x4315f0<MAX_MAPPING_CHAIN_DEPTH){_0x1781c2=_0x6ef042[_0x53ac71(0xd7)](_0x1781c2),_0x4315f0++;}_0x1781c2!==_0x140677&&_0x6ef042[_0x53ac71(0xb8)](_0x5c2074,_0x1781c2);}for(const _0x538146 of _0x5ea4e5){updateSegmentReferences(_0x538146[_0x53ac71(0xcb)],_0x6ef042);}const {merged:_0x3674c9,nameMapping:_0x381e61}=consolidateActivationsByContent(_0x47349d[_0x53ac71(0xe1)](_0x347e63=>_0x347e63[_0x53ac71(0xb1)][_0x53ac71(0x9c)]));for(const _0x3e7851 of _0x5ea4e5){updateActivationReferences(_0x3e7851[_0x53ac71(0xcb)],_0x381e61);}let _0x245528=_0x1756a1[_0x53ac71(0xd5)];if(_0x245528?.[_0x53ac71(0xae)]){const _0xadd26f=_0x6ef042[_0x53ac71(0xd7)](_0x245528[_0x53ac71(0xae)]);_0xadd26f&&(_0x245528={..._0x245528,'segment':_0xadd26f});}for(const _0x508b6d of _0x5ea4e5){if(_0x508b6d[_0x53ac71(0xd5)]?.['segment']){const _0x2bdc57=_0x6ef042[_0x53ac71(0xd7)](_0x508b6d[_0x53ac71(0xd5)]['segment']);_0x2bdc57&&(_0x508b6d[_0x53ac71(0xd5)]={..._0x508b6d['goal'],'segment':_0x2bdc57});}}return _0x5ea4e5['some'](_0x4b9e57=>_0x4b9e57[_0x53ac71(0xd5)])&&(_0x245528=undefined),{'type':_0x53ac71(0xd3),'name':_0x1756a1[_0x53ac71(0xd8)],'description':_0x1756a1['description'],'goal':_0x245528,'reentry':_0x1756a1[_0x53ac71(0xe4)],'segments':Object[_0x53ac71(0xe3)](_0x2e0eb1)[_0x53ac71(0x99)]>0x0?_0x2e0eb1:undefined,'activations':Object[_0x53ac71(0xe3)](_0x3674c9)['length']>0x0?_0x3674c9:undefined,'journeys':_0x5ea4e5,'bundle_id':_0x1756a1[_0x53ac71(0xd0)],'bundle_name':_0x1756a1[_0x53ac71(0x9f)]};}export function createJumpTargetCache(){return new Map();}export async function resolveJumpTarget(_0x523b02,_0x1239f4,_0x4bef00,_0x35b83e){const _0xf6a498=a145_0x34b4,_0x131acb=_0x523b02+':'+_0x1239f4,_0x3cc0bb=_0x4bef00[_0xf6a498(0xd7)](_0x131acb);if(_0x3cc0bb)return _0x3cc0bb;const _0x545407=await _0x35b83e(_0x523b02),_0x5e533d=_0x545407[_0xf6a498(0xa8)]['journeyBundleName']||_0x545407[_0xf6a498(0xa8)][_0xf6a498(0xd8)],_0x4289eb=_0x545407[_0xf6a498(0xa8)][_0xf6a498(0xc6)]['find'](_0x11cc5a=>String(_0x11cc5a['id'])===String(_0x1239f4)),_0x4b50b6=_0x4289eb?.[_0xf6a498(0xd8)]||_0x1239f4,_0x2e2421={'journeyName':_0x5e533d,'stageName':_0x4b50b6};return _0x4bef00['set'](_0x131acb,_0x2e2421),_0x2e2421;}export function formatApiJourneyName(_0x53455a,_0x5d0f4a){return _0x5d0f4a+'\x20('+_0x53455a+')';}export function isLocalJourneyRef(_0x532802){const _0x52d859=a145_0x34b4;return _0x532802['endsWith'](_0x52d859(0xa5))||_0x532802[_0x52d859(0x9b)]('.yaml');}export function buildLocalRuleToNameMapping(_0x564a79){const _0x33dc72=a145_0x34b4,_0x184270=new Map();if(!_0x564a79)return _0x184270;for(const [_0x2a264f,_0x43e1c2]of Object[_0x33dc72(0xd6)](_0x564a79)){if(_0x43e1c2['rule']){const _0x1a7bfa=serializeRule(_0x43e1c2[_0x33dc72(0xda)]),_0x5ce665=_0x184270[_0x33dc72(0xd7)](_0x1a7bfa)||[];_0x5ce665[_0x33dc72(0xba)](_0x2a264f),_0x184270[_0x33dc72(0xb8)](_0x1a7bfa,_0x5ce665);}}return _0x184270;}export function buildLocalRuleToNameMappingFromJourney(_0x194721){const _0x38ed70=a145_0x34b4,_0x38a08b=_0x194721[_0x38ed70(0xcc)];if(!_0x38a08b)return new Map();const _0x412889=collectSegmentUsageCounts(_0x194721),_0x41cc3b=new Map();let _0x2c9f32=0x0;for(const [_0x16a05c,_0x43e517]of Object['entries'](_0x38a08b)){if(!_0x43e517[_0x38ed70(0xda)]){_0x2c9f32++;continue;}const _0x3ad0da=serializeRule(_0x43e517['rule']),_0x14a36d=_0x41cc3b[_0x38ed70(0xd7)](_0x3ad0da)||[];_0x14a36d[_0x38ed70(0xba)]({'name':_0x16a05c,'index':_0x2c9f32}),_0x41cc3b['set'](_0x3ad0da,_0x14a36d),_0x2c9f32++;}const _0x4bee12=new Map();for(const [_0x4d112a,_0x3eb2b4]of _0x41cc3b){const _0x43b66b=_0x3eb2b4[_0x38ed70(0xa7)]()[_0x38ed70(0xdb)]((_0x46c63b,_0x2df6cc)=>{const _0x150adc=_0x38ed70,_0x3638c7=_0x412889[_0x150adc(0xd7)](_0x46c63b[_0x150adc(0xd8)])||0x0,_0x279617=_0x412889[_0x150adc(0xd7)](_0x2df6cc[_0x150adc(0xd8)])||0x0;if(_0x3638c7!==_0x279617)return _0x279617-_0x3638c7;return _0x46c63b[_0x150adc(0xcd)]-_0x2df6cc[_0x150adc(0xcd)];})['map'](_0x4daeb0=>_0x4daeb0['name']);_0x4bee12[_0x38ed70(0xb8)](_0x4d112a,_0x43b66b);}return _0x4bee12;}function a145_0x25ea(){const _0x35cf77=['bundle_id','isArray','connector_config','journey','condition','goal','entries','get','name','69868zHZzTZ','rule','sort','trim','with','6VArRbs','journeys','activation','map','36546espstf','keys','reentry','426514UqauvT','some','schedule','421930EPeROI','version_number','length','behavior','endsWith','activations','exit_criteria','item','bundle_name','60xDtPcS','match','519932CPYXiy','12rVnFRh','connection','.yml','merged','slice','attributes','milestone','version','entry_criteria','type','has','segment','wait','replace','yaml','latest','string','columns','activation_template_id','include','stringify','set','from','push','9eoARgc','notification','19352fWQNMi','decision_point','launched','36GwUZZS','object','state','join','conditions','all_columns','journeyStages','draft','description','toLowerCase','1057705lcWCrJ','stages','segments','index','steps','branches'];a145_0x25ea=function(){return _0x35cf77;};return a145_0x25ea();}export function collectSegmentUsageCounts(_0x4d4116){const _0x2347e4=a145_0x34b4,_0x1f2f62=new Map(),_0x23bdcc=_0x278fea=>{const _0x4804c5=a145_0x34b4;if(!_0x278fea)return;_0x1f2f62[_0x4804c5(0xb8)](_0x278fea,(_0x1f2f62[_0x4804c5(0xd7)](_0x278fea)||0x0)+0x1);},_0x278e23=_0x10b645=>{const _0x46a198=a145_0x34b4;for(const _0x4b436f of _0x10b645){_0x23bdcc(_0x4b436f[_0x46a198(0xab)]?.[_0x46a198(0xae)]);if(_0x4b436f['exit_criteria'])for(const _0x2744af of _0x4b436f[_0x46a198(0x9d)]){_0x23bdcc(_0x2744af['segment']);}_0x23bdcc(_0x4b436f[_0x46a198(0xa9)]?.[_0x46a198(0xae)]);if(_0x4b436f[_0x46a198(0xce)])for(const _0x2aefb3 of _0x4b436f[_0x46a198(0xce)]){if(_0x2aefb3[_0x46a198(0xac)]===_0x46a198(0xbe))for(const _0x4ca1fc of _0x2aefb3['with'][_0x46a198(0xcf)]){_0x23bdcc(_0x4ca1fc['segment']);}else _0x2aefb3[_0x46a198(0xac)]===_0x46a198(0xaf)&&_0x23bdcc(_0x2aefb3[_0x46a198(0xdd)][_0x46a198(0xd4)]?.[_0x46a198(0xae)]);}}};_0x23bdcc(_0x4d4116['goal']?.[_0x2347e4(0xae)]);if(_0x4d4116[_0x2347e4(0xdf)])for(const _0x57d94e of _0x4d4116['journeys']){_0x23bdcc(_0x57d94e[_0x2347e4(0xd5)]?.[_0x2347e4(0xae)]),_0x278e23(_0x57d94e[_0x2347e4(0xcb)]);}_0x4d4116['stages']&&_0x278e23(_0x4d4116[_0x2347e4(0xcb)]);if(_0x4d4116['versions'])for(const _0x5804df of _0x4d4116['versions']){_0x278e23(_0x5804df['stages']);}return _0x1f2f62;}