@treasuredata/tdx 0.14.3 → 0.14.4

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 (141) hide show
  1. package/dist/bin.js +1 -1
  2. package/dist/build-info.json +3 -3
  3. package/dist/cli-categories.js +1 -1
  4. package/dist/cli.js +1 -1
  5. package/dist/commands/activations.js +1 -1
  6. package/dist/commands/agent-command.js +1 -1
  7. package/dist/commands/api-command.js +1 -1
  8. package/dist/commands/auth-command.js +1 -1
  9. package/dist/commands/chat-command.js +1 -1
  10. package/dist/commands/claude-command.d.ts.map +1 -1
  11. package/dist/commands/claude-command.js +1 -1
  12. package/dist/commands/claude-command.js.map +1 -1
  13. package/dist/commands/claude-statusline-command.js +1 -1
  14. package/dist/commands/claude-usage-command.js +1 -1
  15. package/dist/commands/command.js +1 -1
  16. package/dist/commands/connection-command.js +1 -1
  17. package/dist/commands/databases.js +1 -1
  18. package/dist/commands/describe.js +1 -1
  19. package/dist/commands/engage-command.js +1 -1
  20. package/dist/commands/job-command.js +1 -1
  21. package/dist/commands/journey-command.js +1 -1
  22. package/dist/commands/journey-validate-command.js +1 -1
  23. package/dist/commands/llm-command.js +1 -1
  24. package/dist/commands/llm-proxy.js +1 -1
  25. package/dist/commands/parent-segment-command.js +1 -1
  26. package/dist/commands/profile-command.js +1 -1
  27. package/dist/commands/profiles-command.js +1 -1
  28. package/dist/commands/query-command.js +1 -1
  29. package/dist/commands/segment-command.js +1 -1
  30. package/dist/commands/segment-create-command.js +1 -1
  31. package/dist/commands/segment-fields-command.js +1 -1
  32. package/dist/commands/segment-pull-command.js +1 -1
  33. package/dist/commands/segment-push-command.js +1 -1
  34. package/dist/commands/segment-update-command.js +1 -1
  35. package/dist/commands/segment-use-command.js +1 -1
  36. package/dist/commands/segment-validate-command.js +1 -1
  37. package/dist/commands/segments.js +1 -1
  38. package/dist/commands/show.js +1 -1
  39. package/dist/commands/tables.js +1 -1
  40. package/dist/commands/use-command.js +1 -1
  41. package/dist/commands/user-command.js +1 -1
  42. package/dist/commands/workflow-command.js +1 -1
  43. package/dist/core/auth.js +1 -1
  44. package/dist/core/command-output.js +1 -1
  45. package/dist/core/config.js +1 -1
  46. package/dist/core/connection-cache.js +1 -1
  47. package/dist/core/constants.js +1 -1
  48. package/dist/core/credential-cache.js +1 -1
  49. package/dist/core/global-context.js +1 -1
  50. package/dist/core/keychain.js +1 -1
  51. package/dist/core/profile.js +1 -1
  52. package/dist/core/project-config.js +1 -1
  53. package/dist/core/session.js +1 -1
  54. package/dist/core/user-cache.js +1 -1
  55. package/dist/core/version.js +1 -1
  56. package/dist/index.js +1 -1
  57. package/dist/proxy/anthropic-adapter.js +1 -1
  58. package/dist/proxy/claude-usage-tracker.d.ts.map +1 -1
  59. package/dist/proxy/claude-usage-tracker.js +1 -1
  60. package/dist/proxy/claude-usage-tracker.js.map +1 -1
  61. package/dist/proxy/context-signature.js +1 -1
  62. package/dist/proxy/conversation-utils.js +1 -1
  63. package/dist/proxy/passthrough-server.js +1 -1
  64. package/dist/proxy/server.js +1 -1
  65. package/dist/proxy/session-cache.js +1 -1
  66. package/dist/proxy/sse-usage-parser.js +1 -1
  67. package/dist/sdk/agent/agent-config.js +1 -1
  68. package/dist/sdk/agent/agent-ref-parser.js +1 -1
  69. package/dist/sdk/agent/agent-yaml.js +1 -1
  70. package/dist/sdk/api.js +1 -1
  71. package/dist/sdk/client/cdp-api-client.js +1 -1
  72. package/dist/sdk/client/endpoints.js +1 -1
  73. package/dist/sdk/client/engage-api-client.js +1 -1
  74. package/dist/sdk/client/http-client.js +1 -1
  75. package/dist/sdk/client/llm-api-client.js +1 -1
  76. package/dist/sdk/client/rate-limiter.js +1 -1
  77. package/dist/sdk/client/td-api-client.js +1 -1
  78. package/dist/sdk/client/trino-api-client.js +1 -1
  79. package/dist/sdk/client/workflow-client.js +1 -1
  80. package/dist/sdk/connection-validator.js +1 -1
  81. package/dist/sdk/connection.js +1 -1
  82. package/dist/sdk/engage.js +1 -1
  83. package/dist/sdk/errors.js +1 -1
  84. package/dist/sdk/index.js +1 -1
  85. package/dist/sdk/io/index.js +1 -1
  86. package/dist/sdk/io/node-filesystem.js +1 -1
  87. package/dist/sdk/job.js +1 -1
  88. package/dist/sdk/journey.js +1 -1
  89. package/dist/sdk/llm/chat-cache.js +1 -1
  90. package/dist/sdk/llm/index.js +1 -1
  91. package/dist/sdk/llm/llm-backup-utils.js +1 -1
  92. package/dist/sdk/llm/model-aliases.js +1 -1
  93. package/dist/sdk/llm/model-factors.js +1 -1
  94. package/dist/sdk/query/index.js +1 -1
  95. package/dist/sdk/query/sql-parser.js +1 -1
  96. package/dist/sdk/segment/child-segment-yaml.js +1 -1
  97. package/dist/sdk/segment/fields-display.js +1 -1
  98. package/dist/sdk/segment/file-discovery.js +1 -1
  99. package/dist/sdk/segment/journey-utils.js +1 -1
  100. package/dist/sdk/segment/journey-yaml.js +1 -1
  101. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  102. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  103. package/dist/sdk/segment/pull-workflow.js +1 -1
  104. package/dist/sdk/segment/push-workflow.js +1 -1
  105. package/dist/sdk/segment/resolution-context.js +1 -1
  106. package/dist/sdk/segment/segment-path-parser.js +1 -1
  107. package/dist/sdk/segment/segment-ref-parser.js +1 -1
  108. package/dist/sdk/segment/target-resolution.js +1 -1
  109. package/dist/sdk/segment/tdx-config.js +1 -1
  110. package/dist/sdk/segment/validate-files.js +1 -1
  111. package/dist/sdk/segment/yaml-validator.js +1 -1
  112. package/dist/sdk/segment.js +1 -1
  113. package/dist/sdk/types/index.js +1 -1
  114. package/dist/sdk/types/progress.js +1 -1
  115. package/dist/sdk/user.js +1 -1
  116. package/dist/sdk/util/format-detector.js +1 -1
  117. package/dist/sdk/util/formatters.js +1 -1
  118. package/dist/sdk/util/index.js +1 -1
  119. package/dist/sdk/util/tree-formatter.js +1 -1
  120. package/dist/sdk/workflow/clone-workflow.js +1 -1
  121. package/dist/sdk/workflow/index.js +1 -1
  122. package/dist/sdk/workflow/pull-workflow.js +1 -1
  123. package/dist/sdk/workflow/push-workflow.js +1 -1
  124. package/dist/sdk/workflow/tdx-config.js +1 -1
  125. package/dist/sdk/workflow/workflow-utils.js +1 -1
  126. package/dist/utils/async.js +1 -1
  127. package/dist/utils/colors.js +1 -1
  128. package/dist/utils/diff.js +1 -1
  129. package/dist/utils/file-permissions.js +1 -1
  130. package/dist/utils/json-loader.js +1 -1
  131. package/dist/utils/option-validation.js +1 -1
  132. package/dist/utils/port.js +1 -1
  133. package/dist/utils/process.js +1 -1
  134. package/dist/utils/prompt.js +1 -1
  135. package/dist/utils/spinner.js +1 -1
  136. package/dist/utils/sse-parser.js +1 -1
  137. package/dist/utils/string-utils.js +1 -1
  138. package/dist/utils/table-ref-parser.js +1 -1
  139. package/dist/utils/tdx-logger.js +1 -1
  140. package/dist/utils/version-check.js +1 -1
  141. package/package.json +1 -1
@@ -1 +1 @@
1
- const a92_0x4a9a23=a92_0x4feb;(function(_0x213e85,_0x17f033){const _0x23e6c5=a92_0x4feb,_0x21ef87=_0x213e85();while(!![]){try{const _0x319e2e=parseInt(_0x23e6c5(0x217))/0x1*(parseInt(_0x23e6c5(0x24c))/0x2)+parseInt(_0x23e6c5(0x21f))/0x3*(-parseInt(_0x23e6c5(0x23f))/0x4)+parseInt(_0x23e6c5(0x221))/0x5*(-parseInt(_0x23e6c5(0x27a))/0x6)+-parseInt(_0x23e6c5(0x23b))/0x7*(-parseInt(_0x23e6c5(0x269))/0x8)+parseInt(_0x23e6c5(0x22e))/0x9+-parseInt(_0x23e6c5(0x211))/0xa*(-parseInt(_0x23e6c5(0x274))/0xb)+-parseInt(_0x23e6c5(0x26c))/0xc*(parseInt(_0x23e6c5(0x22c))/0xd);if(_0x319e2e===_0x17f033)break;else _0x21ef87['push'](_0x21ef87['shift']());}catch(_0x4d3ed5){_0x21ef87['push'](_0x21ef87['shift']());}}}(a92_0x29a6,0x85557));import*as a92_0x11a49f from'yaml';import{SDKError,ErrorCode}from'../errors.js';import{validateConnectorConfig,transformConfigToLegacy,normalizeConnectorConfigForYaml,formatValidationErrors,formatValidationWarnings,formatSchemaAsHelp}from'../connection-validator.js';export function segmentResponseToDefSync(_0x3da45b,_0x18c240){const _0x5d4d7b=a92_0x4feb,_0x58c8e3=_0x3da45b[_0x5d4d7b(0x270)]&&'type'in _0x3da45b[_0x5d4d7b(0x270)]&&_0x3da45b['rule'][_0x5d4d7b(0x20a)];return{'type':_0x5d4d7b(0x252),'name':_0x3da45b['name'],..._0x3da45b[_0x5d4d7b(0x267)]&&{'description':_0x3da45b[_0x5d4d7b(0x267)]},..._0x18c240&&{'folder':_0x18c240},..._0x58c8e3&&{'rule':apiRuleToYaml(_0x3da45b[_0x5d4d7b(0x270)])},..._0x3da45b[_0x5d4d7b(0x273)]!==undefined&&{'kind':_0x3da45b[_0x5d4d7b(0x273)]===0x0?_0x5d4d7b(0x25c):_0x3da45b[_0x5d4d7b(0x273)]===0x1?_0x5d4d7b(0x1f3):_0x5d4d7b(0x20d)},..._0x3da45b[_0x5d4d7b(0x1f7)]!==undefined&&{'visible':_0x3da45b[_0x5d4d7b(0x1f7)]}};}export async function segmentResponseToDef(_0x540ac1,_0x405886,_0x2e87fe){const _0x40d0ca=a92_0x4feb,_0xd1c00=segmentResponseToDefSync(_0x540ac1,_0x2e87fe);if(!_0x405886||!_0x405886[_0x40d0ca(0x1fa)])return _0xd1c00;return _0xd1c00[_0x40d0ca(0x270)]&&(_0xd1c00[_0x40d0ca(0x270)]=await resolveRuleSegmentRefs(_0xd1c00[_0x40d0ca(0x270)],_0x405886[_0x40d0ca(0x1fa)])),_0xd1c00;}export function apiRuleToYaml(_0x4c3d3d){const _0x5880dd=a92_0x4feb,_0x28d6d6=(_0x4c3d3d[_0x5880dd(0x21b)]||[])[_0x5880dd(0x268)](apiConditionToYaml);if(_0x28d6d6['length']===0x1&&!_0x4c3d3d['description']&&_0x5880dd(0x20a)in _0x28d6d6[0x0]&&(_0x28d6d6[0x0][_0x5880dd(0x20a)]===_0x5880dd(0x279)||_0x28d6d6[0x0][_0x5880dd(0x20a)]==='Or')){const _0x2d12c3=_0x28d6d6[0x0];if(_0x2d12c3[_0x5880dd(0x20a)]===_0x4c3d3d[_0x5880dd(0x20a)]&&_0x2d12c3[_0x5880dd(0x21b)])return{'type':_0x4c3d3d[_0x5880dd(0x20a)],'conditions':_0x2d12c3[_0x5880dd(0x21b)],..._0x2d12c3['description']&&{'description':_0x2d12c3[_0x5880dd(0x267)]}};}return{'type':_0x4c3d3d['type'],'conditions':_0x28d6d6,..._0x4c3d3d['description']&&{'description':_0x4c3d3d[_0x5880dd(0x267)]}};}export async function resolveRuleSegmentRefs(_0x1720f3,_0x351693){const _0x4b850b=a92_0x4feb,_0x575c15=await Promise['all'](_0x1720f3[_0x4b850b(0x21b)][_0x4b850b(0x268)](_0x2e6964=>resolveConditionSegmentRefs(_0x2e6964,_0x351693)));return{..._0x1720f3,'conditions':_0x575c15};}async function resolveConditionSegmentRefs(_0x5cd9df,_0x42bb1a){const _0x458d84=a92_0x4feb;if(_0x458d84(0x252)in _0x5cd9df&&(_0x5cd9df[_0x458d84(0x20a)]===_0x458d84(0x244)||_0x5cd9df[_0x458d84(0x20a)]===_0x458d84(0x27f))){const _0x2c5b88=_0x5cd9df;if(/^\d+$/['test'](_0x2c5b88[_0x458d84(0x252)])){const _0x3ed2b6=await _0x42bb1a(_0x2c5b88['segment']);return{..._0x2c5b88,'segment':_0x3ed2b6};}return _0x5cd9df;}if(_0x458d84(0x21b)in _0x5cd9df&&_0x5cd9df['conditions']){const _0x36dce2=_0x5cd9df,_0x2716ea=await Promise[_0x458d84(0x275)](_0x36dce2[_0x458d84(0x21b)][_0x458d84(0x268)](_0x5e865b=>resolveConditionSegmentRefs(_0x5e865b,_0x42bb1a)));return{..._0x36dce2,'conditions':_0x2716ea};}if(_0x458d84(0x24d)in _0x5cd9df&&_0x5cd9df[_0x458d84(0x24d)]){const _0x54c58b=_0x5cd9df,_0x304f51=await resolveRuleSegmentRefs(_0x54c58b[_0x458d84(0x24d)],_0x42bb1a);return{..._0x54c58b,'filter':_0x304f51};}return _0x5cd9df;}export async function resolveRuleSegmentIds(_0x3a7d93,_0x3da5a7){const _0x1c0444=a92_0x4feb,_0x342316=await Promise[_0x1c0444(0x275)](_0x3a7d93[_0x1c0444(0x21b)][_0x1c0444(0x268)](_0x3c71fe=>resolveConditionSegmentIds(_0x3c71fe,_0x3da5a7)));return{..._0x3a7d93,'conditions':_0x342316};}async function resolveConditionSegmentIds(_0x2013d3,_0x150219){const _0x54f38c=a92_0x4feb;if(_0x54f38c(0x252)in _0x2013d3&&(_0x2013d3[_0x54f38c(0x20a)]===_0x54f38c(0x244)||_0x2013d3[_0x54f38c(0x20a)]==='exclude')){const _0xab7a06=_0x2013d3;if(!/^\d+$/[_0x54f38c(0x24f)](_0xab7a06[_0x54f38c(0x252)])){const _0x3859de=await _0x150219(_0xab7a06[_0x54f38c(0x252)]);return{..._0xab7a06,'segment':_0x3859de};}return _0x2013d3;}if(_0x54f38c(0x21b)in _0x2013d3&&_0x2013d3[_0x54f38c(0x21b)]){const _0x2b763f=_0x2013d3,_0x4bcde5=await Promise[_0x54f38c(0x275)](_0x2b763f[_0x54f38c(0x21b)][_0x54f38c(0x268)](_0x5a64e4=>resolveConditionSegmentIds(_0x5a64e4,_0x150219)));return{..._0x2b763f,'conditions':_0x4bcde5};}if(_0x54f38c(0x24d)in _0x2013d3&&_0x2013d3[_0x54f38c(0x24d)]){const _0x4f7332=_0x2013d3,_0x29e40e=await resolveRuleSegmentIds(_0x4f7332[_0x54f38c(0x24d)],_0x150219);return{..._0x4f7332,'filter':_0x29e40e};}return _0x2013d3;}function apiConditionToYaml(_0x50a59d){const _0x247074=a92_0x4feb;if(_0x50a59d[_0x247074(0x20a)]===_0x247074(0x279)||_0x50a59d[_0x247074(0x20a)]==='Or'){if(_0x50a59d[_0x247074(0x21b)]){const _0x518ac2=_0x50a59d[_0x247074(0x21b)]['map'](apiConditionToYaml);if(_0x518ac2[_0x247074(0x232)]===0x1&&!_0x50a59d['description'])return _0x518ac2[0x0];return{'type':_0x50a59d['type'],'conditions':_0x518ac2,..._0x50a59d[_0x247074(0x267)]&&{'description':_0x50a59d['description']}};}}if(_0x50a59d[_0x247074(0x20a)]==='Value'&&_0x50a59d[_0x247074(0x260)]&&_0x50a59d[_0x247074(0x25d)]){const _0x28b766=_0x50a59d[_0x247074(0x260)][_0x247074(0x272)]?{'type':_0x50a59d['leftValue'][_0x247074(0x272)][_0x247074(0x20a)],..._0x50a59d[_0x247074(0x260)]['aggregation']['groupingColumns']&&{'groupingColumns':_0x50a59d[_0x247074(0x260)]['aggregation'][_0x247074(0x280)]}}:undefined;return{'type':'Value','attribute':_0x50a59d['leftValue'][_0x247074(0x236)]||'','operator':apiOperatorToYaml(_0x50a59d[_0x247074(0x25d)]),..._0x50a59d['arrayMatching']&&_0x50a59d[_0x247074(0x266)]!==_0x247074(0x223)?{'arrayMatching':_0x50a59d[_0x247074(0x266)]}:{},..._0x50a59d['exclude']?{'exclude':_0x50a59d[_0x247074(0x27f)]}:{},..._0x28b766?{'aggregation':_0x28b766}:{},..._0x50a59d['leftValue'][_0x247074(0x25f)]?{'source':_0x50a59d[_0x247074(0x260)][_0x247074(0x25f)][_0x247074(0x236)]}:{},..._0x50a59d['leftValue'][_0x247074(0x24d)]?{'filter':apiRuleToYaml(_0x50a59d[_0x247074(0x260)][_0x247074(0x24d)])}:{},..._0x50a59d['limit']!==undefined&&_0x50a59d[_0x247074(0x1fd)]!==null?{'limit':_0x50a59d[_0x247074(0x1fd)]}:{}};}if(_0x50a59d[_0x247074(0x20a)]===_0x247074(0x26d)&&_0x50a59d['id'])return{'type':_0x50a59d[_0x247074(0x27f)]?_0x247074(0x27f):'include','segment':_0x50a59d['id']};return{'type':_0x247074(0x279),'conditions':[]};}function isTemporalOperator(_0x50f1ed){const _0xd4b011=a92_0x4feb;return _0x50f1ed===_0xd4b011(0x20e)||_0x50f1ed===_0xd4b011(0x229);}function getEffectiveValue(_0xa4632a){const _0x1e8eb6=a92_0x4feb,_0x57d193=_0xa4632a[_0x1e8eb6(0x225)];return _0xa4632a['value']??_0x57d193;}function a92_0x29a6(){const _0xa7e098=['TimeWithinNext','connectorConfig','emailRecipients','91598AytkgS','max','6539265AGYchP','rule:','join_row','behaviorTableName','length','Equal','conditions[','add','name','start_at','localRuleToName','replace','endOn','92043uyMNUP','null','duration','connectionId','4QdWHzg','forEach','activations:','schedule','emailToIdMap','include','warn','Please\x20specify\x20a\x20valid\x20attribute\x20name.','push','repeatFrequency','join_strategy','notify_on','scheduleType','263506UZRVUY','filter','YAML\x20config\x20missing\x20required\x20field:\x20name','test','INVALID_ARGUMENT','rightValue','segment','repeat_frequency','rightValues','order_by','joinRow','activation_template_id','syndicationBehavior','repeatSubFrequency','localeCompare','stringify','batch','operator','startAt','source','leftValue','email_recipients','getSchema','notifyOn','min','__SEGMENT_REF__','arrayMatching','description','map','88dCrOOL','entries','formatting','228ZmWmNo','Reference','connectionNameToIdMap','Value','rule','CONNECTOR_INVALID_CONFIG','aggregation','kind','18568WEkHUn','all','behavior','keys','get','And','240nlGnTJ','timezone','from','repeat_unit','valid','exclude','groupingColumns','sort','\x22:\x0a','attribute','visible','realtime','repeat_sub_frequency','columns','behavior_table','isVisible','unit','connector_config\x20for\x20activation\x20\x22','resolveSegmentName','activations','New\x20Segment','limit','attributes','usedNames','value','orderBy','warnings','\x27:\x20','__UNRESOLVED__','connectionNameToTypeMap','not','parse','connection','code','type','repeatUnit','\x0a\x0aAvailable\x20fields:\x0a','funnel_stage','TimeWithinPast','folder','joinStrategy','3830BIRmMk','string','all_columns','visibility','connector_config','ruleHashToName','2tySiEs','CONNECTION_NOT_FOUND','JOURNEY_SYNTAX_ERROR','allColumns','conditions','notification','object','isArray','2777475aVNqBm','activationTemplateId','21925yxPvPR','YAML\x20type\x20must\x20be\x20\x27segment\x27\x20or\x20omitted,\x20got:\x20','any','every','values','has','end_on','Segment\x20description'];a92_0x29a6=function(){return _0xa7e098;};return a92_0x29a6();}function apiOperatorToYaml(_0x1f72dd){const _0x368908=a92_0x4feb;let _0x1f6e13;if(_0x1f72dd[_0x368908(0x254)]&&_0x1f72dd[_0x368908(0x254)][_0x368908(0x232)]>0x0)_0x1f6e13=_0x1f72dd[_0x368908(0x254)];else{if(_0x1f72dd[_0x368908(0x251)]!==undefined)_0x1f6e13=_0x1f72dd[_0x368908(0x251)];else isTemporalOperator(_0x1f72dd['type'])&&_0x1f72dd[_0x368908(0x200)]!==undefined&&(_0x1f6e13=_0x1f72dd['value']);}return{'type':mapApiOperatorType(_0x1f72dd[_0x368908(0x20a)]),..._0x1f72dd[_0x368908(0x206)]&&{'not':_0x1f72dd[_0x368908(0x206)]},..._0x1f6e13!==undefined&&{'value':_0x1f6e13},..._0x1f72dd['unit']&&{'unit':_0x1f72dd[_0x368908(0x1f8)]}};}function mapApiOperatorType(_0x26dc72){return _0x26dc72;}export function segmentDefToCreateRequest(_0x1ebdd4,_0x13cccc){const _0x520247=a92_0x4feb,_0x2b4411={'name':_0x1ebdd4[_0x520247(0x236)]};return _0x1ebdd4[_0x520247(0x267)]&&(_0x2b4411[_0x520247(0x267)]=_0x1ebdd4[_0x520247(0x267)]),_0x1ebdd4[_0x520247(0x270)]&&(_0x2b4411[_0x520247(0x270)]=yamlRuleToApi(_0x1ebdd4[_0x520247(0x270)])),_0x1ebdd4[_0x520247(0x273)]&&(_0x2b4411[_0x520247(0x273)]=_0x1ebdd4[_0x520247(0x273)]===_0x520247(0x25c)?0x0:_0x1ebdd4[_0x520247(0x273)]===_0x520247(0x1f3)?0x1:0x2),_0x1ebdd4[_0x520247(0x1f2)]!==undefined&&(_0x2b4411[_0x520247(0x1f7)]=_0x1ebdd4[_0x520247(0x1f2)]),_0x13cccc&&(_0x2b4411['segmentFolderId']=_0x13cccc),_0x2b4411;}export function segmentDefToUpdateRequest(_0x2ac9d9){const _0x2d1a77=a92_0x4feb,_0x5d2faa={'name':_0x2ac9d9[_0x2d1a77(0x236)]};return _0x2ac9d9[_0x2d1a77(0x267)]!==undefined&&(_0x5d2faa[_0x2d1a77(0x267)]=_0x2ac9d9[_0x2d1a77(0x267)]),_0x2ac9d9['rule']&&(_0x5d2faa[_0x2d1a77(0x270)]=yamlRuleToApi(_0x2ac9d9[_0x2d1a77(0x270)])),_0x2ac9d9[_0x2d1a77(0x273)]&&(_0x5d2faa[_0x2d1a77(0x273)]=_0x2ac9d9[_0x2d1a77(0x273)]===_0x2d1a77(0x25c)?0x0:_0x2ac9d9[_0x2d1a77(0x273)]===_0x2d1a77(0x1f3)?0x1:0x2),_0x5d2faa;}export function yamlRuleToApi(_0x58e1f9,_0x3db8b4=![]){const _0x452a2d=a92_0x4feb,_0x42e09b=_0x58e1f9[_0x452a2d(0x21b)][_0x452a2d(0x268)](yamlConditionToApi);if(_0x3db8b4){const _0x3af871=_0x42e09b[_0x452a2d(0x224)](_0x1fe62a=>_0x1fe62a[_0x452a2d(0x20a)]===_0x452a2d(0x279)||_0x1fe62a[_0x452a2d(0x20a)]==='Or');if(!_0x3af871&&_0x42e09b[_0x452a2d(0x232)]>0x0)return{'type':_0x58e1f9['type'],'conditions':[{'type':_0x452a2d(0x279),'description':_0x58e1f9['description']||'','conditions':_0x42e09b}]};}return{'type':_0x58e1f9[_0x452a2d(0x20a)],'conditions':_0x42e09b,..._0x58e1f9['description']&&{'description':_0x58e1f9[_0x452a2d(0x267)]}};}function yamlConditionToApi(_0x170d29){const _0x106a37=a92_0x4feb;if('segment'in _0x170d29&&(_0x170d29[_0x106a37(0x20a)]===_0x106a37(0x244)||_0x170d29['type']===_0x106a37(0x27f))){const _0x550f00=_0x170d29;return{'type':'Reference','id':_0x550f00['segment'],'exclude':_0x550f00[_0x106a37(0x20a)]==='exclude'};}if(_0x106a37(0x20a)in _0x170d29&&(_0x170d29[_0x106a37(0x20a)]===_0x106a37(0x279)||_0x170d29[_0x106a37(0x20a)]==='Or')){const _0x5b1166=_0x170d29;return{'type':_0x5b1166['type'],'conditions':_0x5b1166[_0x106a37(0x21b)][_0x106a37(0x268)](yamlConditionToApi),..._0x5b1166['description']&&{'description':_0x5b1166[_0x106a37(0x267)]}};}const _0x149a1d=_0x170d29,_0x497547={'type':'Value','leftValue':buildLeftValue(_0x149a1d),'operator':yamlOperatorToApi(_0x149a1d[_0x106a37(0x25d)]),'exclude':_0x149a1d[_0x106a37(0x27f)]??![],'arrayMatching':_0x149a1d[_0x106a37(0x266)]??_0x106a37(0x223)};return _0x149a1d['limit']!==undefined&&(_0x497547[_0x106a37(0x1fd)]=_0x149a1d['limit']),_0x497547;}function buildLeftValue(_0x3b2194){const _0x42f8cb=a92_0x4feb,_0x5d7214={'name':_0x3b2194['attribute']};return _0x3b2194[_0x42f8cb(0x272)]&&(_0x5d7214[_0x42f8cb(0x272)]={'type':_0x3b2194[_0x42f8cb(0x272)][_0x42f8cb(0x20a)],..._0x3b2194[_0x42f8cb(0x272)][_0x42f8cb(0x280)]&&{'groupingColumns':_0x3b2194['aggregation'][_0x42f8cb(0x280)]}}),_0x3b2194[_0x42f8cb(0x25f)]&&(_0x5d7214['source']={'name':_0x3b2194[_0x42f8cb(0x25f)]}),_0x3b2194[_0x42f8cb(0x24d)]&&(_0x5d7214['filter']=yamlRuleToApi(_0x3b2194[_0x42f8cb(0x24d)])),_0x5d7214;}function yamlOperatorToApi(_0x205f52){const _0x5d2625=a92_0x4feb,_0x120b1f={'type':mapYamlOperatorType(_0x205f52[_0x5d2625(0x20a)]),'not':_0x205f52[_0x5d2625(0x206)]??![]},_0x1badc2=getEffectiveValue(_0x205f52);if(_0x1badc2!==undefined){if(Array[_0x5d2625(0x21e)](_0x1badc2))_0x120b1f[_0x5d2625(0x254)]=_0x1badc2;else isTemporalOperator(_0x205f52[_0x5d2625(0x20a)])?_0x120b1f['value']=_0x1badc2:_0x120b1f['rightValue']=_0x1badc2;}return _0x205f52[_0x5d2625(0x1f8)]&&(_0x120b1f['unit']=_0x205f52['unit']),_0x120b1f;}function mapYamlOperatorType(_0x3a74ba){return _0x3a74ba;}export function toYamlString(_0xc6f38f){const _0x17e770=a92_0x4feb,_0x261849=JSON[_0x17e770(0x207)](JSON['stringify'](_0xc6f38f)),_0x2dcafb=a92_0x11a49f[_0x17e770(0x25b)](_0x261849,{'indent':0x2,'lineWidth':0x0,'nullStr':_0x17e770(0x23c)}),_0x20e912=[_0x17e770(0x22f)];let _0x480670=_0x2dcafb;for(const _0x3e39ff of _0x20e912){_0x480670=_0x480670[_0x17e770(0x239)](new RegExp('^('+_0x3e39ff+')','m'),(_0x52f76e,_0x3adb0d,_0x2026f5)=>{if(_0x2026f5===0x0||_0x480670[_0x2026f5-0x1]==='\x0a'&&_0x480670[_0x2026f5-0x2]==='\x0a')return _0x3adb0d;return'\x0a'+_0x3adb0d;});}return _0x480670;}export function parseYamlString(_0x1c0f2b){const _0x554255=a92_0x4feb,_0xd9b4bf=a92_0x11a49f[_0x554255(0x207)](_0x1c0f2b);if(!_0xd9b4bf[_0x554255(0x236)])throw new Error(_0x554255(0x24e));if(_0xd9b4bf[_0x554255(0x20a)]&&_0xd9b4bf[_0x554255(0x20a)]!==_0x554255(0x252))throw new Error(_0x554255(0x222)+_0xd9b4bf[_0x554255(0x20a)]);return _0xd9b4bf;}export function isSegmentYaml(_0x4a149e){const _0x2c1220=a92_0x4feb;if(typeof _0x4a149e!=='object'||_0x4a149e===null)return![];const _0x44a652=_0x4a149e;return _0x44a652[_0x2c1220(0x20a)]===_0x2c1220(0x252)||_0x44a652['type']===undefined;}export function generateTemplate(_0x3e5aa7=a92_0x4a9a23(0x1fc)){const _0x5daefd=a92_0x4a9a23,_0x4404ec={'type':_0x5daefd(0x252),'name':_0x3e5aa7,'description':_0x5daefd(0x228),'rule':{'type':_0x5daefd(0x279),'conditions':[{'type':_0x5daefd(0x26f),'attribute':'attribute_name','operator':{'type':_0x5daefd(0x233),'value':'value'}}]}};return toYamlString(_0x4404ec);}export function segmentToYamlString(_0x3826d0){const _0x485ff7=a92_0x4a9a23,_0x221d14=JSON[_0x485ff7(0x207)](JSON[_0x485ff7(0x25b)](_0x3826d0)),_0x1188a0=a92_0x11a49f[_0x485ff7(0x25b)](_0x221d14,{'indent':0x2,'lineWidth':0x0,'nullStr':_0x485ff7(0x23c)}),_0x57705f=['rule:',_0x485ff7(0x241)];let _0x5798ca=_0x1188a0;for(const _0xdeebb6 of _0x57705f){_0x5798ca=_0x5798ca['replace'](new RegExp('^('+_0xdeebb6+')','m'),(_0x364db3,_0x25023c,_0x3c676b)=>{if(_0x3c676b===0x0||_0x5798ca[_0x3c676b-0x1]==='\x0a'&&_0x5798ca[_0x3c676b-0x2]==='\x0a')return _0x25023c;return'\x0a'+_0x25023c;});}return _0x5798ca;}export function parseSegmentYamlFile(_0x3d3950){const _0x7a50aa=a92_0x4a9a23,_0x25300d=a92_0x11a49f[_0x7a50aa(0x207)](_0x3d3950);if(!_0x25300d[_0x7a50aa(0x236)])throw new Error('YAML\x20config\x20missing\x20required\x20field:\x20name');return _0x25300d;}export function normalizeChildSegmentYaml(_0x5168bd){const _0x3afc40=a92_0x4a9a23;return{'type':'segment','name':_0x5168bd[_0x3afc40(0x236)],..._0x5168bd[_0x3afc40(0x267)]!==undefined&&{'description':_0x5168bd[_0x3afc40(0x267)]},..._0x5168bd[_0x3afc40(0x20f)]!==undefined&&{'folder':_0x5168bd[_0x3afc40(0x20f)]},..._0x5168bd['rule']&&{'rule':normalizeRule(_0x5168bd[_0x3afc40(0x270)])},..._0x5168bd['kind']!==undefined&&{'kind':_0x5168bd[_0x3afc40(0x273)]},..._0x5168bd[_0x3afc40(0x1f2)]!==undefined&&{'visible':_0x5168bd['visible']},..._0x5168bd['activations']&&{'activations':_0x5168bd[_0x3afc40(0x1fb)][_0x3afc40(0x268)](normalizeActivation)}};}function a92_0x4feb(_0x24bba9,_0xc73305){_0x24bba9=_0x24bba9-0x1f1;const _0x29a666=a92_0x29a6();let _0x4feb84=_0x29a666[_0x24bba9];return _0x4feb84;}export function normalizeRule(_0x43e0f5){const _0x367a9a=a92_0x4a9a23;return{'type':_0x43e0f5[_0x367a9a(0x20a)],'conditions':_0x43e0f5[_0x367a9a(0x21b)]['map'](normalizeCondition),..._0x43e0f5[_0x367a9a(0x267)]!==undefined&&{'description':_0x43e0f5[_0x367a9a(0x267)]}};}function normalizeCondition(_0x121738){const _0x202823=a92_0x4a9a23;if(_0x202823(0x252)in _0x121738&&(_0x121738['type']==='include'||_0x121738[_0x202823(0x20a)]==='exclude')){const _0x2b32b1=_0x121738;return{'type':_0x2b32b1[_0x202823(0x20a)],'segment':_0x2b32b1['segment']};}if(_0x202823(0x20a)in _0x121738&&(_0x121738['type']===_0x202823(0x279)||_0x121738[_0x202823(0x20a)]==='Or')){const _0x3ca4da=_0x121738;return{'type':_0x3ca4da[_0x202823(0x20a)],'conditions':_0x3ca4da['conditions'][_0x202823(0x268)](normalizeCondition),..._0x3ca4da[_0x202823(0x267)]!==undefined&&{'description':_0x3ca4da['description']}};}const _0x3febcd=_0x121738;return{'type':_0x202823(0x26f),'attribute':_0x3febcd[_0x202823(0x1f1)],'operator':normalizeOperator(_0x3febcd['operator']),..._0x3febcd[_0x202823(0x266)]!==undefined&&{'arrayMatching':_0x3febcd[_0x202823(0x266)]},..._0x3febcd[_0x202823(0x27f)]!==undefined&&{'exclude':_0x3febcd[_0x202823(0x27f)]},..._0x3febcd['aggregation']!==undefined&&{'aggregation':_0x3febcd[_0x202823(0x272)]},..._0x3febcd[_0x202823(0x25f)]!==undefined&&{'source':_0x3febcd[_0x202823(0x25f)]},..._0x3febcd[_0x202823(0x24d)]!==undefined&&{'filter':normalizeRule(_0x3febcd[_0x202823(0x24d)])},..._0x3febcd[_0x202823(0x1fd)]!==undefined&&{'limit':_0x3febcd[_0x202823(0x1fd)]}};}function normalizeOperator(_0x22040e){const _0x5df0d1=a92_0x4a9a23,_0x40e781=getEffectiveValue(_0x22040e);return{'type':_0x22040e[_0x5df0d1(0x20a)],..._0x22040e[_0x5df0d1(0x206)]!==undefined&&{'not':_0x22040e[_0x5df0d1(0x206)]},..._0x40e781!==undefined&&{'value':_0x40e781},..._0x22040e[_0x5df0d1(0x264)]!==undefined&&{'min':_0x22040e['min']},..._0x22040e[_0x5df0d1(0x22d)]!==undefined&&{'max':_0x22040e[_0x5df0d1(0x22d)]},..._0x22040e[_0x5df0d1(0x1f8)]!==undefined&&{'unit':_0x22040e[_0x5df0d1(0x1f8)]},..._0x22040e[_0x5df0d1(0x23d)]!==undefined&&{'duration':_0x22040e[_0x5df0d1(0x23d)]},..._0x22040e[_0x5df0d1(0x27c)]!==undefined&&{'from':_0x22040e[_0x5df0d1(0x27c)]}};}function normalizeActivation(_0x53a19a){const _0x4f539e=a92_0x4a9a23;return{'name':_0x53a19a[_0x4f539e(0x236)],'connection':_0x53a19a[_0x4f539e(0x208)],..._0x53a19a['description']!==undefined&&{'description':_0x53a19a[_0x4f539e(0x267)]},..._0x53a19a[_0x4f539e(0x213)]!==undefined&&{'all_columns':_0x53a19a['all_columns']},..._0x53a19a[_0x4f539e(0x1f5)]!==undefined&&{'columns':_0x53a19a[_0x4f539e(0x1f5)]},..._0x53a19a['behavior']!==undefined&&{'behavior':_0x53a19a[_0x4f539e(0x276)]},..._0x53a19a[_0x4f539e(0x242)]!==undefined&&{'schedule':_0x53a19a[_0x4f539e(0x242)]},..._0x53a19a[_0x4f539e(0x21c)]!==undefined&&{'notification':_0x53a19a['notification']},..._0x53a19a[_0x4f539e(0x215)]!==undefined&&{'connector_config':_0x53a19a[_0x4f539e(0x215)]},..._0x53a19a[_0x4f539e(0x257)]!==undefined&&{'activation_template_id':_0x53a19a[_0x4f539e(0x257)]}};}export function activationResponseToDef(_0xbc567c,_0x38c542,_0x2faeb5){const _0xbba5c4=a92_0x4a9a23,_0x513e9c=_0xbc567c[_0xbba5c4(0x23e)]||'',_0x81f53f=_0x2faeb5?.[_0xbba5c4(0x278)](_0x513e9c)??_0x513e9c,_0x3e551d={'name':_0xbc567c[_0xbba5c4(0x236)],'connection':_0x81f53f};_0xbc567c[_0xbba5c4(0x267)]&&(_0x3e551d[_0xbba5c4(0x267)]=_0xbc567c[_0xbba5c4(0x267)]);let _0x350e71=[];_0xbc567c['columns']&&_0xbc567c[_0xbba5c4(0x1f5)][_0xbba5c4(0x232)]>0x0&&(_0x350e71=_0xbc567c[_0xbba5c4(0x1f5)][_0xbba5c4(0x24d)](_0x5256ab=>_0x5256ab&&_0x5256ab[_0xbba5c4(0x236)])[_0xbba5c4(0x268)](_0xa9dbcf=>{const _0xc5417b=_0xbba5c4;if(_0xa9dbcf['type']||_0xa9dbcf['visibility'])return{'name':_0xa9dbcf[_0xc5417b(0x236)],..._0xa9dbcf[_0xc5417b(0x20a)]&&{'type':_0xa9dbcf[_0xc5417b(0x20a)]},..._0xa9dbcf[_0xc5417b(0x214)]&&{'visibility':_0xa9dbcf[_0xc5417b(0x214)]}};return _0xa9dbcf[_0xc5417b(0x236)];}));_0x350e71[_0xbba5c4(0x232)]>0x0&&(_0x3e551d[_0xbba5c4(0x1f5)]=_0x350e71);_0xbc567c['allColumns']!==undefined&&(_0xbc567c['allColumns']===![]&&_0x350e71[_0xbba5c4(0x232)]===0x0?_0x3e551d[_0xbba5c4(0x213)]=!![]:_0x3e551d[_0xbba5c4(0x213)]=_0xbc567c['allColumns']);const _0x49215f={};let _0x1df3b3=![];_0xbc567c[_0xbba5c4(0x24b)]&&(_0x49215f[_0xbba5c4(0x20a)]=_0xbc567c[_0xbba5c4(0x24b)],_0x1df3b3=!![]);_0xbc567c[_0xbba5c4(0x20b)]&&(_0x49215f[_0xbba5c4(0x27d)]=_0xbc567c['repeatUnit'],_0x1df3b3=!![]);_0xbc567c[_0xbba5c4(0x248)]!==undefined&&_0xbc567c[_0xbba5c4(0x248)]!==null&&(_0x49215f[_0xbba5c4(0x253)]=_0xbc567c[_0xbba5c4(0x248)],_0x1df3b3=!![]);_0xbc567c[_0xbba5c4(0x259)]&&_0xbc567c['repeatSubFrequency']['length']>0x0&&(_0x49215f[_0xbba5c4(0x1f4)]=_0xbc567c[_0xbba5c4(0x259)],_0x1df3b3=!![]);_0xbc567c[_0xbba5c4(0x25e)]!==undefined&&(_0x49215f[_0xbba5c4(0x237)]=_0xbc567c[_0xbba5c4(0x25e)],_0x1df3b3=!![]);_0xbc567c[_0xbba5c4(0x23a)]!==undefined&&(_0x49215f['end_on']=_0xbc567c[_0xbba5c4(0x23a)],_0x1df3b3=!![]);_0xbc567c[_0xbba5c4(0x27b)]&&(_0x49215f['timezone']=_0xbc567c[_0xbba5c4(0x27b)],_0x1df3b3=!![]);_0x1df3b3&&(_0x3e551d['schedule']=_0x49215f);(_0xbc567c[_0xbba5c4(0x263)]&&_0xbc567c[_0xbba5c4(0x263)][_0xbba5c4(0x232)]>0x0||_0xbc567c[_0xbba5c4(0x22b)]&&_0xbc567c[_0xbba5c4(0x22b)]['length']>0x0)&&(_0x3e551d['notification']={},_0xbc567c[_0xbba5c4(0x263)]&&_0xbc567c[_0xbba5c4(0x263)]['length']>0x0&&(_0x3e551d['notification'][_0xbba5c4(0x24a)]=_0xbc567c[_0xbba5c4(0x263)]),_0xbc567c[_0xbba5c4(0x22b)]&&_0xbc567c[_0xbba5c4(0x22b)][_0xbba5c4(0x232)]>0x0&&(_0x3e551d['notification'][_0xbba5c4(0x261)]=_0xbc567c[_0xbba5c4(0x22b)][_0xbba5c4(0x268)](_0x27c870=>{const _0xd9b849=_0xbba5c4,_0x3b9f3b=_0x38c542?.[_0xd9b849(0x278)](_0x27c870);return _0x3b9f3b??String(_0x27c870);})));_0xbc567c[_0xbba5c4(0x22a)]&&Object[_0xbba5c4(0x277)](_0xbc567c[_0xbba5c4(0x22a)])[_0xbba5c4(0x232)]>0x0&&(_0x3e551d['connector_config']=normalizeConnectorConfigForYaml(_0xbc567c[_0xbba5c4(0x22a)]));_0xbc567c[_0xbba5c4(0x220)]&&(_0x3e551d['activation_template_id']=_0xbc567c['activationTemplateId']);if(_0xbc567c[_0xbba5c4(0x258)]){const _0x31af85={},_0x458caa=_0xbc567c[_0xbba5c4(0x258)];_0x458caa[_0xbba5c4(0x1f5)]&&_0x458caa[_0xbba5c4(0x1f5)][_0xbba5c4(0x232)]>0x0&&(_0x31af85[_0xbba5c4(0x1f5)]=_0x458caa[_0xbba5c4(0x1f5)]['filter'](_0x2fc2de=>_0x2fc2de&&_0x2fc2de[_0xbba5c4(0x236)])[_0xbba5c4(0x268)](_0x164b94=>({'name':_0x164b94[_0xbba5c4(0x236)],..._0x164b94[_0xbba5c4(0x20a)]&&{'type':_0x164b94[_0xbba5c4(0x20a)]},..._0x164b94[_0xbba5c4(0x214)]&&{'visibility':_0x164b94[_0xbba5c4(0x214)]}}))),_0x458caa[_0xbba5c4(0x231)]&&(_0x31af85['behavior_table']=_0x458caa[_0xbba5c4(0x231)]),_0x458caa[_0xbba5c4(0x256)]!==undefined&&(_0x31af85[_0xbba5c4(0x230)]=_0x458caa[_0xbba5c4(0x256)]),_0x458caa[_0xbba5c4(0x210)]&&(_0x31af85['join_strategy']=_0x458caa[_0xbba5c4(0x210)]),_0x458caa[_0xbba5c4(0x26b)]&&(_0x31af85['formatting']=_0x458caa[_0xbba5c4(0x26b)]),_0x458caa[_0xbba5c4(0x201)]&&_0x458caa[_0xbba5c4(0x201)][_0xbba5c4(0x232)]>0x0&&(_0x31af85['order_by']=_0x458caa['orderBy']),Object['keys'](_0x31af85)[_0xbba5c4(0x232)]>0x0&&(_0x3e551d[_0xbba5c4(0x276)]=_0x31af85);}return _0x3e551d;}export function journeyActivationStepToYaml(_0x4ca5d5,_0x46123a,_0x457398){const _0x40cfac=a92_0x4a9a23,_0x4dcae8=_0x4ca5d5[_0x40cfac(0x1fe)]['activationParams'],_0x3ba4db=_0x4dcae8[_0x40cfac(0x23e)]||'',_0x2a5fb1=_0x457398?.[_0x40cfac(0x278)](_0x3ba4db)??_0x3ba4db,_0x15c1b8={'name':_0x4dcae8['name']||'','connection':_0x2a5fb1};_0x4dcae8['description']&&(_0x15c1b8[_0x40cfac(0x267)]=_0x4dcae8[_0x40cfac(0x267)]);let _0x41f0c7=[];_0x4dcae8[_0x40cfac(0x1f5)]&&_0x4dcae8[_0x40cfac(0x1f5)][_0x40cfac(0x232)]>0x0&&(_0x41f0c7=_0x4dcae8[_0x40cfac(0x1f5)]['filter'](_0x3e52da=>_0x3e52da&&_0x3e52da[_0x40cfac(0x236)])[_0x40cfac(0x268)](_0x504f1e=>{const _0x577c51=_0x40cfac;if(_0x504f1e[_0x577c51(0x20a)]||_0x504f1e['visibility'])return{'name':_0x504f1e[_0x577c51(0x236)],..._0x504f1e[_0x577c51(0x20a)]&&{'type':_0x504f1e[_0x577c51(0x20a)]},..._0x504f1e[_0x577c51(0x214)]&&{'visibility':_0x504f1e['visibility']}};return _0x504f1e[_0x577c51(0x236)];}));_0x41f0c7[_0x40cfac(0x232)]>0x0&&(_0x15c1b8[_0x40cfac(0x1f5)]=_0x41f0c7);_0x4dcae8[_0x40cfac(0x21a)]!==undefined&&(_0x4dcae8['allColumns']===![]&&_0x41f0c7[_0x40cfac(0x232)]===0x0?_0x15c1b8['all_columns']=!![]:_0x15c1b8[_0x40cfac(0x213)]=_0x4dcae8[_0x40cfac(0x21a)]);const _0x5e1389={};let _0x133a09=![];_0x4dcae8['scheduleType']&&(_0x5e1389[_0x40cfac(0x20a)]=_0x4dcae8['scheduleType'],_0x133a09=!![]);_0x4dcae8[_0x40cfac(0x20b)]&&(_0x5e1389[_0x40cfac(0x27d)]=_0x4dcae8['repeatUnit'],_0x133a09=!![]);_0x4dcae8['repeatFrequency']!==undefined&&_0x4dcae8[_0x40cfac(0x248)]!==null&&(_0x5e1389['repeat_frequency']=_0x4dcae8[_0x40cfac(0x248)],_0x133a09=!![]);_0x4dcae8[_0x40cfac(0x25e)]!==undefined&&(_0x5e1389[_0x40cfac(0x237)]=_0x4dcae8[_0x40cfac(0x25e)],_0x133a09=!![]);_0x4dcae8[_0x40cfac(0x23a)]!==undefined&&(_0x5e1389[_0x40cfac(0x227)]=_0x4dcae8[_0x40cfac(0x23a)],_0x133a09=!![]);_0x4dcae8['timezone']&&(_0x5e1389['timezone']=_0x4dcae8[_0x40cfac(0x27b)],_0x133a09=!![]);_0x133a09&&(_0x15c1b8[_0x40cfac(0x242)]=_0x5e1389);(_0x4dcae8['notifyOn']&&_0x4dcae8['notifyOn'][_0x40cfac(0x232)]>0x0||_0x4dcae8[_0x40cfac(0x22b)]&&_0x4dcae8[_0x40cfac(0x22b)][_0x40cfac(0x232)]>0x0)&&(_0x15c1b8[_0x40cfac(0x21c)]={},_0x4dcae8[_0x40cfac(0x263)]&&_0x4dcae8['notifyOn']['length']>0x0&&(_0x15c1b8['notification']['notify_on']=_0x4dcae8[_0x40cfac(0x263)]),_0x4dcae8['emailRecipients']&&_0x4dcae8[_0x40cfac(0x22b)][_0x40cfac(0x232)]>0x0&&(_0x15c1b8[_0x40cfac(0x21c)]['email_recipients']=_0x4dcae8[_0x40cfac(0x22b)][_0x40cfac(0x268)](_0x1147c3=>{const _0x325431=_0x46123a?.['get'](_0x1147c3);return _0x325431??String(_0x1147c3);})));_0x4dcae8[_0x40cfac(0x22a)]&&Object[_0x40cfac(0x277)](_0x4dcae8['connectorConfig'])[_0x40cfac(0x232)]>0x0&&(_0x15c1b8[_0x40cfac(0x215)]=normalizeConnectorConfigForYaml(_0x4dcae8[_0x40cfac(0x22a)]));_0x4dcae8[_0x40cfac(0x220)]&&(_0x15c1b8['activation_template_id']=_0x4dcae8[_0x40cfac(0x220)]);if(_0x4dcae8[_0x40cfac(0x258)]){const _0x41c33a={},_0xfa455c=_0x4dcae8[_0x40cfac(0x258)];_0xfa455c['columns']&&_0xfa455c[_0x40cfac(0x1f5)][_0x40cfac(0x232)]>0x0&&(_0x41c33a['columns']=_0xfa455c[_0x40cfac(0x1f5)][_0x40cfac(0x24d)](_0x15ad66=>_0x15ad66&&_0x15ad66[_0x40cfac(0x236)])[_0x40cfac(0x268)](_0x2fdeda=>({'name':_0x2fdeda['name'],..._0x2fdeda[_0x40cfac(0x20a)]&&{'type':_0x2fdeda[_0x40cfac(0x20a)]},..._0x2fdeda[_0x40cfac(0x214)]&&{'visibility':_0x2fdeda[_0x40cfac(0x214)]}}))),_0xfa455c[_0x40cfac(0x231)]&&(_0x41c33a[_0x40cfac(0x1f6)]=_0xfa455c[_0x40cfac(0x231)]),_0xfa455c[_0x40cfac(0x256)]!==undefined&&(_0x41c33a['join_row']=_0xfa455c[_0x40cfac(0x256)]),_0xfa455c['joinStrategy']&&(_0x41c33a[_0x40cfac(0x249)]=_0xfa455c[_0x40cfac(0x210)]),_0xfa455c['formatting']&&(_0x41c33a['formatting']=_0xfa455c[_0x40cfac(0x26b)]),_0xfa455c[_0x40cfac(0x201)]&&_0xfa455c[_0x40cfac(0x201)][_0x40cfac(0x232)]>0x0&&(_0x41c33a[_0x40cfac(0x255)]=_0xfa455c[_0x40cfac(0x201)]),Object[_0x40cfac(0x277)](_0x41c33a)['length']>0x0&&(_0x15c1b8['behavior']=_0x41c33a);}return _0x15c1b8;}export function segmentWithActivationsToYaml(_0x467316,_0x2f5026,_0x4ab511,_0x12a811,_0x106de8){const _0x4a77cd=a92_0x4a9a23,_0x275f7b=segmentResponseToDefSync(_0x467316,_0x4ab511);return _0x2f5026[_0x4a77cd(0x232)]>0x0&&(_0x275f7b[_0x4a77cd(0x1fb)]=_0x2f5026['map'](_0xd4ad95=>activationResponseToDef(_0xd4ad95,_0x12a811,_0x106de8))),_0x275f7b;}function normalizeColumn(_0x1076ee){const _0x5ad61e=a92_0x4a9a23;if(typeof _0x1076ee===_0x5ad61e(0x212))return{'name':_0x1076ee};return{'name':_0x1076ee['name'],..._0x1076ee[_0x5ad61e(0x20a)]&&{'type':_0x1076ee[_0x5ad61e(0x20a)]},..._0x1076ee[_0x5ad61e(0x214)]&&{'visibility':_0x1076ee[_0x5ad61e(0x214)]}};}export async function activationDefToCreateRequest(_0xe71a60,_0x52aa6a){const _0xe09e97=a92_0x4a9a23,_0x1a41f7=_0x52aa6a?.[_0xe09e97(0x243)],_0x3480f6=_0x52aa6a?.[_0xe09e97(0x26e)],_0x24b03e=_0xe71a60[_0xe09e97(0x208)];let _0x264b49;const _0x5cc2a9=parseInt(_0x24b03e,0xa);if(!isNaN(_0x5cc2a9)&&String(_0x5cc2a9)===_0x24b03e)_0x264b49=_0x5cc2a9;else{const _0x1fdaf4=_0x3480f6?.[_0xe09e97(0x278)](_0x24b03e);if(_0x1fdaf4===undefined)throw new SDKError(ErrorCode[_0xe09e97(0x218)],'Unknown\x20connection:\x20'+_0x24b03e,undefined,{'helpText':'Use\x20\x27tdx\x20connections\x27\x20to\x20list\x20available\x20connections'});_0x264b49=_0x1fdaf4;}const _0x4c9fff={'name':_0xe71a60[_0xe09e97(0x236)],'connectionId':_0x264b49};_0xe71a60[_0xe09e97(0x267)]&&(_0x4c9fff['description']=_0xe71a60['description']);let _0x1e592e=[];_0xe71a60[_0xe09e97(0x1f5)]&&_0xe71a60[_0xe09e97(0x1f5)][_0xe09e97(0x232)]>0x0&&(_0x1e592e=_0xe71a60[_0xe09e97(0x1f5)][_0xe09e97(0x24d)](_0x6f1017=>_0x6f1017!=null)['map'](normalizeColumn));_0x1e592e[_0xe09e97(0x232)]>0x0&&(_0x4c9fff[_0xe09e97(0x1f5)]=_0x1e592e);_0xe71a60['all_columns']!==undefined&&(_0xe71a60[_0xe09e97(0x213)]===![]&&_0x1e592e['length']===0x0?_0x4c9fff[_0xe09e97(0x21a)]=!![]:_0x4c9fff['allColumns']=_0xe71a60[_0xe09e97(0x213)]);if(_0xe71a60[_0xe09e97(0x242)]){const _0x4618eb=_0xe71a60[_0xe09e97(0x242)];_0x4618eb[_0xe09e97(0x20a)]&&(_0x4c9fff[_0xe09e97(0x24b)]=_0x4618eb[_0xe09e97(0x20a)]),_0x4618eb[_0xe09e97(0x27d)]&&(_0x4c9fff[_0xe09e97(0x20b)]=_0x4618eb[_0xe09e97(0x27d)]),_0x4618eb[_0xe09e97(0x253)]!==undefined&&(_0x4c9fff[_0xe09e97(0x248)]=_0x4618eb['repeat_frequency']),_0x4618eb['repeat_sub_frequency']&&(_0x4c9fff[_0xe09e97(0x259)]=_0x4618eb[_0xe09e97(0x1f4)]),_0x4618eb[_0xe09e97(0x237)]!==undefined&&(_0x4c9fff['startAt']=_0x4618eb[_0xe09e97(0x237)]),_0x4618eb[_0xe09e97(0x227)]!==undefined&&(_0x4c9fff[_0xe09e97(0x23a)]=_0x4618eb[_0xe09e97(0x227)]),_0x4618eb[_0xe09e97(0x27b)]&&(_0x4c9fff[_0xe09e97(0x27b)]=_0x4618eb[_0xe09e97(0x27b)]);}_0xe71a60[_0xe09e97(0x21c)]&&(_0xe71a60['notification'][_0xe09e97(0x24a)]&&(_0x4c9fff['notifyOn']=_0xe71a60[_0xe09e97(0x21c)]['notify_on']),_0xe71a60[_0xe09e97(0x21c)]['email_recipients']&&(_0x4c9fff[_0xe09e97(0x22b)]=_0xe71a60[_0xe09e97(0x21c)][_0xe09e97(0x261)][_0xe09e97(0x268)](_0x5d709a=>{const _0x59dc11=_0xe09e97,_0x1e669e=Number(_0x5d709a);if(!isNaN(_0x1e669e)&&String(_0x1e669e)===_0x5d709a)return _0x1e669e;const _0x24ff50=_0x1a41f7?.[_0x59dc11(0x278)](_0x5d709a['toLowerCase']());if(_0x24ff50===undefined)throw new SDKError(ErrorCode[_0x59dc11(0x250)],'Unknown\x20email\x20recipient:\x20'+_0x5d709a+'.\x20Use\x20\x27tdx\x20user\x20list\x27\x20to\x20see\x20valid\x20emails.');return _0x24ff50;})));if(_0xe71a60['connector_config']){const _0xcf2440=_0x52aa6a?.[_0xe09e97(0x205)]?.[_0xe09e97(0x278)](_0x24b03e);if(_0xcf2440&&_0x52aa6a?.[_0xe09e97(0x262)])try{const _0x56116e=await _0x52aa6a[_0xe09e97(0x262)](_0xcf2440),_0x344911=validateConnectorConfig(_0xe71a60['connector_config'],_0x56116e);if(!_0x344911[_0xe09e97(0x27e)])throw new SDKError(ErrorCode[_0xe09e97(0x271)],'Invalid\x20connector_config\x20for\x20activation\x20\x22'+_0xe71a60[_0xe09e97(0x236)]+_0xe09e97(0x282)+formatValidationErrors(_0x344911['errors']),undefined,{'helpText':'Connector:\x20'+_0xcf2440+_0xe09e97(0x20c)+formatSchemaAsHelp(_0x56116e)});if(_0x344911['warnings'][_0xe09e97(0x232)]>0x0){const _0x4ec07=formatValidationWarnings(_0x344911[_0xe09e97(0x202)]);console[_0xe09e97(0x245)](_0xe09e97(0x1f9)+_0xe71a60[_0xe09e97(0x236)]+'\x22:\x0a'+_0x4ec07);}_0x4c9fff[_0xe09e97(0x22a)]=transformConfigToLegacy(_0xe71a60['connector_config'],_0x56116e);}catch(_0x46f04c){if(_0x46f04c instanceof SDKError&&_0x46f04c[_0xe09e97(0x209)]===ErrorCode['CONNECTOR_SCHEMA_NOT_FOUND'])_0x4c9fff['connectorConfig']=_0xe71a60[_0xe09e97(0x215)];else throw _0x46f04c;}else _0x4c9fff[_0xe09e97(0x22a)]=_0xe71a60[_0xe09e97(0x215)];}_0xe71a60[_0xe09e97(0x257)]!==undefined&&(_0x4c9fff[_0xe09e97(0x220)]=_0xe71a60[_0xe09e97(0x257)]);if(_0xe71a60['behavior']){const _0x42c630=_0xe71a60[_0xe09e97(0x276)],_0x2cd964={};if(_0x42c630[_0xe09e97(0x1f5)]&&_0x42c630[_0xe09e97(0x1f5)][_0xe09e97(0x232)]>0x0){const _0x205f20=_0x42c630[_0xe09e97(0x1f5)][_0xe09e97(0x24d)](_0x567ac7=>_0x567ac7&&_0x567ac7[_0xe09e97(0x236)]);_0x205f20[_0xe09e97(0x232)]>0x0&&(_0x2cd964[_0xe09e97(0x1f5)]=_0x205f20);}_0x42c630['behavior_table']&&(_0x2cd964[_0xe09e97(0x231)]=_0x42c630['behavior_table']),_0x42c630['join_row']!==undefined&&(_0x2cd964[_0xe09e97(0x256)]=_0x42c630[_0xe09e97(0x230)]),_0x42c630['join_strategy']&&(_0x2cd964[_0xe09e97(0x210)]=_0x42c630[_0xe09e97(0x249)]),_0x42c630[_0xe09e97(0x26b)]&&(_0x2cd964['formatting']=_0x42c630[_0xe09e97(0x26b)]),_0x42c630[_0xe09e97(0x255)]&&(_0x2cd964['orderBy']=_0x42c630[_0xe09e97(0x255)]),_0x4c9fff[_0xe09e97(0x258)]=_0x2cd964;}return _0x4c9fff;}export async function activationDefToUpdateRequest(_0x8d543a,_0x124dbb){return activationDefToCreateRequest(_0x8d543a,_0x124dbb);}export function deepSortObject(_0x4e3e3e){const _0x267f82=a92_0x4a9a23;if(_0x4e3e3e===null||typeof _0x4e3e3e!==_0x267f82(0x21d))return _0x4e3e3e;if(Array[_0x267f82(0x21e)](_0x4e3e3e))return _0x4e3e3e[_0x267f82(0x268)](deepSortObject)[_0x267f82(0x281)]((_0x1e944c,_0x21d159)=>JSON[_0x267f82(0x25b)](_0x1e944c)[_0x267f82(0x25a)](JSON['stringify'](_0x21d159)));const _0x821188={};for(const _0x2d7b29 of Object[_0x267f82(0x277)](_0x4e3e3e)['sort']()){_0x821188[_0x2d7b29]=deepSortObject(_0x4e3e3e[_0x2d7b29]);}return _0x821188;}export function serializeRule(_0x303ac6){const _0x2db274=a92_0x4a9a23;return JSON[_0x2db274(0x25b)](deepSortObject(_0x303ac6));}export function normalizeRuleForMatching(_0x554867){return normalizeConditionsForMatching(_0x554867);}function normalizeConditionsForMatching(_0x21f4f4){const _0x9c085f=a92_0x4a9a23;if(_0x21f4f4===null||typeof _0x21f4f4!=='object')return _0x21f4f4;if(Array[_0x9c085f(0x21e)](_0x21f4f4))return _0x21f4f4[_0x9c085f(0x268)](normalizeConditionsForMatching);const _0x18e940=_0x21f4f4;if((_0x18e940[_0x9c085f(0x20a)]===_0x9c085f(0x244)||_0x18e940[_0x9c085f(0x20a)]===_0x9c085f(0x27f))&&typeof _0x18e940[_0x9c085f(0x252)]===_0x9c085f(0x212))return{..._0x18e940,'segment':_0x9c085f(0x265)};const _0x16555b={};for(const _0x3d49f7 of Object['keys'](_0x18e940)){_0x16555b[_0x3d49f7]=normalizeConditionsForMatching(_0x18e940[_0x3d49f7]);}return _0x16555b;}export function serializeRuleForMatching(_0x127060){const _0x34ecbf=a92_0x4a9a23;return JSON[_0x34ecbf(0x25b)](deepSortObject(normalizeRuleForMatching(_0x127060)));}export function expandSegmentReferences(_0x59dd2a,_0x436efa,_0x1c7151=new Set()){return expandConditions(_0x59dd2a,_0x436efa,_0x1c7151);}function expandConditions(_0x28cc27,_0x3a790c,_0x2cd796){const _0x34cf43=a92_0x4a9a23;if(_0x28cc27===null||typeof _0x28cc27!==_0x34cf43(0x21d))return _0x28cc27;if(Array[_0x34cf43(0x21e)](_0x28cc27))return _0x28cc27[_0x34cf43(0x268)](_0x13cd5c=>expandConditions(_0x13cd5c,_0x3a790c,_0x2cd796));const _0x51eae3=_0x28cc27;if((_0x51eae3[_0x34cf43(0x20a)]==='include'||_0x51eae3['type']==='exclude')&&typeof _0x51eae3[_0x34cf43(0x252)]===_0x34cf43(0x212)){const _0x44b818=_0x51eae3['segment'],_0x5c5fe6=_0x3a790c[_0x34cf43(0x278)](_0x44b818);if(_0x5c5fe6&&!_0x2cd796[_0x34cf43(0x226)](_0x44b818)){const _0x29ba84=new Set(_0x2cd796);_0x29ba84[_0x34cf43(0x235)](_0x44b818);const _0x4f5212=expandConditions(_0x5c5fe6,_0x3a790c,_0x29ba84);return{'type':_0x51eae3[_0x34cf43(0x20a)],'expanded_rule':_0x4f5212};}return{'type':_0x51eae3['type'],'expanded_rule':_0x34cf43(0x204)};}const _0xde1a55={};for(const _0x331f49 of Object[_0x34cf43(0x277)](_0x51eae3)){_0xde1a55[_0x331f49]=expandConditions(_0x51eae3[_0x331f49],_0x3a790c,_0x2cd796);}return _0xde1a55;}export function serializeExpandedRule(_0x423e41,_0x231561){const _0x3bc464=a92_0x4a9a23,_0x13135b=expandSegmentReferences(_0x423e41,_0x231561);return JSON[_0x3bc464(0x25b)](deepSortObject(_0x13135b));}export function createSegmentNameContext(_0x19412a){const _0x204e75=a92_0x4a9a23,_0x55215e=new Set(),_0x397709=new Map(),_0x4caf61=new Map();if(_0x19412a)for(const [_0x5c177c,_0x5ace26]of Object[_0x204e75(0x26a)](_0x19412a)){if(_0x5ace26[_0x204e75(0x270)]){const _0x51581e=serializeRule(_0x5ace26[_0x204e75(0x270)]);_0x4caf61['set'](_0x51581e,_0x5c177c),_0x55215e[_0x204e75(0x235)](_0x5c177c);}}return{'usedNames':_0x55215e,'ruleHashToName':_0x397709,'localRuleToName':_0x19412a?_0x4caf61:undefined};}export function resolveSegmentName(_0x22010,_0x425f29,_0x219d2a,_0x14a316){const _0x2d12e5=a92_0x4a9a23,_0x4d170c=serializeRule(_0x425f29);if(_0x219d2a['localRuleToName']){const _0x253773=_0x219d2a[_0x2d12e5(0x238)][_0x2d12e5(0x278)](_0x4d170c);if(_0x253773)return{'name':_0x253773,'isDuplicate':![],'isLocalMatch':!![]};}const _0xbcdcfd=_0x219d2a[_0x2d12e5(0x216)][_0x2d12e5(0x278)](_0x4d170c);if(_0xbcdcfd)return{'name':_0xbcdcfd,'isDuplicate':!![],'isLocalMatch':![]};const _0x4fe75e=_0x14a316(_0x22010);let _0x487ae6=_0x4fe75e||_0x22010,_0x47bd28=_0x487ae6,_0x17f5ed=0x2;while(_0x219d2a[_0x2d12e5(0x1ff)]['has'](_0x47bd28)){_0x47bd28=_0x487ae6+'_'+_0x17f5ed,_0x17f5ed++;}return _0x219d2a[_0x2d12e5(0x1ff)][_0x2d12e5(0x235)](_0x47bd28),_0x219d2a[_0x2d12e5(0x216)]['set'](_0x4d170c,_0x47bd28),{'name':_0x47bd28,'isDuplicate':![],'isLocalMatch':![]};}export function collectSegmentRefsFromRule(_0x6c05d5){const _0x3f0984=[],_0x393770=_0x4b3676=>{const _0x4d1cab=a92_0x4feb;if(!_0x4b3676||typeof _0x4b3676!=='object')return;if(Array[_0x4d1cab(0x21e)](_0x4b3676)){_0x4b3676[_0x4d1cab(0x240)](_0x393770);return;}const _0x2e7eac=_0x4b3676;(_0x2e7eac['type']===_0x4d1cab(0x244)||_0x2e7eac['type']===_0x4d1cab(0x27f))&&typeof _0x2e7eac['segment']===_0x4d1cab(0x212)&&_0x3f0984[_0x4d1cab(0x247)](_0x2e7eac[_0x4d1cab(0x252)]);for(const _0x2d40a2 of Object[_0x4d1cab(0x225)](_0x2e7eac)){_0x393770(_0x2d40a2);}};return _0x393770(_0x6c05d5),_0x3f0984;}export function validateSegmentRule(_0x18847b,_0x5e4f5f){const _0x31fc49=a92_0x4a9a23;if(!_0x5e4f5f||!_0x5e4f5f[_0x31fc49(0x21b)])return;for(let _0x17cd2b=0x0;_0x17cd2b<_0x5e4f5f[_0x31fc49(0x21b)][_0x31fc49(0x232)];_0x17cd2b++){const _0x102fd0=_0x5e4f5f[_0x31fc49(0x21b)][_0x17cd2b];if(_0x31fc49(0x20a)in _0x102fd0&&_0x102fd0['type']===_0x31fc49(0x26f)){const _0x5f36d7=_0x102fd0;if(!_0x5f36d7[_0x31fc49(0x1f1)]||_0x5f36d7['attribute']==='')throw new SDKError(ErrorCode[_0x31fc49(0x219)],'Invalid\x20condition\x20in\x20embedded\x20segment\x20\x27'+_0x18847b+_0x31fc49(0x203)+(_0x31fc49(0x234)+_0x17cd2b+'].attribute\x20cannot\x20be\x20empty.\x0a')+_0x31fc49(0x246));}}}
1
+ (function(_0x254cd4,_0x3b118f){const _0x2af413=a92_0x1e89,_0x3e57e0=_0x254cd4();while(!![]){try{const _0x140a0d=parseInt(_0x2af413(0x116))/0x1+-parseInt(_0x2af413(0x154))/0x2+-parseInt(_0x2af413(0x102))/0x3*(-parseInt(_0x2af413(0x185))/0x4)+-parseInt(_0x2af413(0x17e))/0x5*(-parseInt(_0x2af413(0x141))/0x6)+parseInt(_0x2af413(0x16a))/0x7*(parseInt(_0x2af413(0x183))/0x8)+parseInt(_0x2af413(0x138))/0x9*(parseInt(_0x2af413(0x123))/0xa)+-parseInt(_0x2af413(0x155))/0xb;if(_0x140a0d===_0x3b118f)break;else _0x3e57e0['push'](_0x3e57e0['shift']());}catch(_0x3759ed){_0x3e57e0['push'](_0x3e57e0['shift']());}}}(a92_0x1513,0xc5a80));import*as a92_0x1faf5d from'yaml';import{SDKError,ErrorCode}from'../errors.js';import{validateConnectorConfig,transformConfigToLegacy,normalizeConnectorConfigForYaml,formatValidationErrors,formatValidationWarnings,formatSchemaAsHelp}from'../connection-validator.js';export function segmentResponseToDefSync(_0x1958c9,_0x500768){const _0x199541=a92_0x1e89,_0x2f0dab=_0x1958c9[_0x199541(0x17c)]&&_0x199541(0x152)in _0x1958c9[_0x199541(0x17c)]&&_0x1958c9[_0x199541(0x17c)][_0x199541(0x152)];return{'type':_0x199541(0x167),'name':_0x1958c9['name'],..._0x1958c9[_0x199541(0x110)]&&{'description':_0x1958c9['description']},..._0x500768&&{'folder':_0x500768},..._0x2f0dab&&{'rule':apiRuleToYaml(_0x1958c9[_0x199541(0x17c)])},..._0x1958c9[_0x199541(0x11b)]!==undefined&&{'kind':_0x1958c9['kind']===0x0?_0x199541(0x148):_0x1958c9[_0x199541(0x11b)]===0x1?_0x199541(0x113):'funnel_stage'},..._0x1958c9[_0x199541(0x151)]!==undefined&&{'visible':_0x1958c9[_0x199541(0x151)]}};}export async function segmentResponseToDef(_0x4db747,_0x16a2df,_0x1a5a63){const _0x4ca79d=a92_0x1e89,_0x1212cf=segmentResponseToDefSync(_0x4db747,_0x1a5a63);if(!_0x16a2df||!_0x16a2df[_0x4ca79d(0x16d)])return _0x1212cf;return _0x1212cf['rule']&&(_0x1212cf[_0x4ca79d(0x17c)]=await resolveRuleSegmentRefs(_0x1212cf[_0x4ca79d(0x17c)],_0x16a2df[_0x4ca79d(0x16d)])),_0x1212cf;}export function apiRuleToYaml(_0x46a384){const _0x2734b0=a92_0x1e89,_0x5023e2=(_0x46a384[_0x2734b0(0x120)]||[])[_0x2734b0(0x10d)](apiConditionToYaml);if(_0x5023e2[_0x2734b0(0x101)]===0x1&&!_0x46a384[_0x2734b0(0x110)]&&_0x2734b0(0x152)in _0x5023e2[0x0]&&(_0x5023e2[0x0][_0x2734b0(0x152)]===_0x2734b0(0x172)||_0x5023e2[0x0][_0x2734b0(0x152)]==='Or')){const _0x168c51=_0x5023e2[0x0];if(_0x168c51[_0x2734b0(0x152)]===_0x46a384[_0x2734b0(0x152)]&&_0x168c51[_0x2734b0(0x120)])return{'type':_0x46a384['type'],'conditions':_0x168c51[_0x2734b0(0x120)],..._0x168c51[_0x2734b0(0x110)]&&{'description':_0x168c51['description']}};}return{'type':_0x46a384[_0x2734b0(0x152)],'conditions':_0x5023e2,..._0x46a384[_0x2734b0(0x110)]&&{'description':_0x46a384[_0x2734b0(0x110)]}};}export async function resolveRuleSegmentRefs(_0x49d9cf,_0xcb7684){const _0x210ec0=a92_0x1e89,_0x5a5b8b=await Promise['all'](_0x49d9cf[_0x210ec0(0x120)][_0x210ec0(0x10d)](_0x4a1f4e=>resolveConditionSegmentRefs(_0x4a1f4e,_0xcb7684)));return{..._0x49d9cf,'conditions':_0x5a5b8b};}async function resolveConditionSegmentRefs(_0x4c6674,_0x3cc804){const _0x21df95=a92_0x1e89;if('segment'in _0x4c6674&&(_0x4c6674[_0x21df95(0x152)]===_0x21df95(0x186)||_0x4c6674[_0x21df95(0x152)]===_0x21df95(0x17d))){const _0x24a451=_0x4c6674;if(/^\d+$/[_0x21df95(0x15f)](_0x24a451[_0x21df95(0x167)])){const _0x41db28=await _0x3cc804(_0x24a451[_0x21df95(0x167)]);return{..._0x24a451,'segment':_0x41db28};}return _0x4c6674;}if(_0x21df95(0x120)in _0x4c6674&&_0x4c6674[_0x21df95(0x120)]){const _0x57547e=_0x4c6674,_0x175fc9=await Promise['all'](_0x57547e['conditions'][_0x21df95(0x10d)](_0x2c526b=>resolveConditionSegmentRefs(_0x2c526b,_0x3cc804)));return{..._0x57547e,'conditions':_0x175fc9};}if(_0x21df95(0x181)in _0x4c6674&&_0x4c6674['filter']){const _0x3ace1c=_0x4c6674,_0x2b3534=await resolveRuleSegmentRefs(_0x3ace1c['filter'],_0x3cc804);return{..._0x3ace1c,'filter':_0x2b3534};}return _0x4c6674;}export async function resolveRuleSegmentIds(_0x4ae7ff,_0x1c0f16){const _0x382523=a92_0x1e89,_0x258914=await Promise[_0x382523(0x143)](_0x4ae7ff[_0x382523(0x120)][_0x382523(0x10d)](_0x5c3c3d=>resolveConditionSegmentIds(_0x5c3c3d,_0x1c0f16)));return{..._0x4ae7ff,'conditions':_0x258914};}async function resolveConditionSegmentIds(_0x251f8e,_0x4985b3){const _0x14d079=a92_0x1e89;if(_0x14d079(0x167)in _0x251f8e&&(_0x251f8e[_0x14d079(0x152)]===_0x14d079(0x186)||_0x251f8e[_0x14d079(0x152)]==='exclude')){const _0x2863bb=_0x251f8e;if(!/^\d+$/['test'](_0x2863bb['segment'])){const _0x3b2f22=await _0x4985b3(_0x2863bb[_0x14d079(0x167)]);return{..._0x2863bb,'segment':_0x3b2f22};}return _0x251f8e;}if(_0x14d079(0x120)in _0x251f8e&&_0x251f8e[_0x14d079(0x120)]){const _0x4efebb=_0x251f8e,_0x488b2b=await Promise[_0x14d079(0x143)](_0x4efebb[_0x14d079(0x120)][_0x14d079(0x10d)](_0x52c073=>resolveConditionSegmentIds(_0x52c073,_0x4985b3)));return{..._0x4efebb,'conditions':_0x488b2b};}if(_0x14d079(0x181)in _0x251f8e&&_0x251f8e[_0x14d079(0x181)]){const _0x580ec0=_0x251f8e,_0x500f58=await resolveRuleSegmentIds(_0x580ec0[_0x14d079(0x181)],_0x4985b3);return{..._0x580ec0,'filter':_0x500f58};}return _0x251f8e;}function apiConditionToYaml(_0x390a94){const _0x5be13c=a92_0x1e89;if(_0x390a94[_0x5be13c(0x152)]===_0x5be13c(0x172)||_0x390a94[_0x5be13c(0x152)]==='Or'){if(_0x390a94[_0x5be13c(0x120)]){const _0x10bfab=_0x390a94['conditions'][_0x5be13c(0x10d)](apiConditionToYaml);if(_0x10bfab[_0x5be13c(0x101)]===0x1&&!_0x390a94[_0x5be13c(0x110)])return _0x10bfab[0x0];return{'type':_0x390a94[_0x5be13c(0x152)],'conditions':_0x10bfab,..._0x390a94[_0x5be13c(0x110)]&&{'description':_0x390a94[_0x5be13c(0x110)]}};}}if(_0x390a94[_0x5be13c(0x152)]===_0x5be13c(0x12f)&&_0x390a94['leftValue']&&_0x390a94[_0x5be13c(0x11e)]){const _0x38bd3b=_0x390a94['leftValue'][_0x5be13c(0x140)]?{'type':_0x390a94['leftValue'][_0x5be13c(0x140)][_0x5be13c(0x152)],..._0x390a94['leftValue'][_0x5be13c(0x140)][_0x5be13c(0x13b)]&&{'groupingColumns':_0x390a94[_0x5be13c(0x176)][_0x5be13c(0x140)][_0x5be13c(0x13b)]}}:undefined;return{'type':_0x5be13c(0x12f),'attribute':_0x390a94[_0x5be13c(0x176)][_0x5be13c(0x170)]||'','operator':apiOperatorToYaml(_0x390a94[_0x5be13c(0x11e)]),..._0x390a94[_0x5be13c(0x104)]&&_0x390a94[_0x5be13c(0x104)]!==_0x5be13c(0x106)?{'arrayMatching':_0x390a94[_0x5be13c(0x104)]}:{},..._0x390a94['exclude']?{'exclude':_0x390a94[_0x5be13c(0x17d)]}:{},..._0x38bd3b?{'aggregation':_0x38bd3b}:{},..._0x390a94[_0x5be13c(0x176)]['source']?{'source':_0x390a94[_0x5be13c(0x176)][_0x5be13c(0x108)][_0x5be13c(0x170)]}:{},..._0x390a94['leftValue']['filter']?{'filter':apiRuleToYaml(_0x390a94[_0x5be13c(0x176)][_0x5be13c(0x181)])}:{},..._0x390a94[_0x5be13c(0x14b)]!==undefined&&_0x390a94[_0x5be13c(0x14b)]!==null?{'limit':_0x390a94[_0x5be13c(0x14b)]}:{}};}if(_0x390a94[_0x5be13c(0x152)]===_0x5be13c(0x134)&&_0x390a94['id'])return{'type':_0x390a94[_0x5be13c(0x17d)]?_0x5be13c(0x17d):_0x5be13c(0x186),'segment':_0x390a94['id']};return{'type':_0x5be13c(0x172),'conditions':[]};}function isTemporalOperator(_0x1b335d){const _0x4d6297=a92_0x1e89;return _0x1b335d===_0x4d6297(0x157)||_0x1b335d===_0x4d6297(0x145);}function getEffectiveValue(_0x4c9991){const _0xa84253=a92_0x1e89,_0x121116=_0x4c9991[_0xa84253(0x142)];return _0x4c9991['value']??_0x121116;}function apiOperatorToYaml(_0xce6e74){const _0x438584=a92_0x1e89;let _0x4d0413;if(_0xce6e74[_0x438584(0x18a)]&&_0xce6e74[_0x438584(0x18a)][_0x438584(0x101)]>0x0)_0x4d0413=_0xce6e74['rightValues'];else{if(_0xce6e74[_0x438584(0x122)]!==undefined)_0x4d0413=_0xce6e74[_0x438584(0x122)];else isTemporalOperator(_0xce6e74[_0x438584(0x152)])&&_0xce6e74[_0x438584(0x17f)]!==undefined&&(_0x4d0413=_0xce6e74[_0x438584(0x17f)]);}return{'type':mapApiOperatorType(_0xce6e74[_0x438584(0x152)]),..._0xce6e74['not']&&{'not':_0xce6e74[_0x438584(0x136)]},..._0x4d0413!==undefined&&{'value':_0x4d0413},..._0xce6e74['unit']&&{'unit':_0xce6e74[_0x438584(0x18e)]}};}function mapApiOperatorType(_0x5af135){return _0x5af135;}export function segmentDefToCreateRequest(_0x3a7350,_0x4bbc6c){const _0x1999d2=a92_0x1e89,_0x134fb6={'name':_0x3a7350[_0x1999d2(0x170)]};return _0x3a7350[_0x1999d2(0x110)]&&(_0x134fb6[_0x1999d2(0x110)]=_0x3a7350[_0x1999d2(0x110)]),_0x3a7350[_0x1999d2(0x17c)]&&(_0x134fb6[_0x1999d2(0x17c)]=yamlRuleToApi(_0x3a7350[_0x1999d2(0x17c)])),_0x3a7350[_0x1999d2(0x11b)]&&(_0x134fb6['kind']=_0x3a7350[_0x1999d2(0x11b)]===_0x1999d2(0x148)?0x0:_0x3a7350['kind']===_0x1999d2(0x113)?0x1:0x2),_0x3a7350[_0x1999d2(0x112)]!==undefined&&(_0x134fb6[_0x1999d2(0x151)]=_0x3a7350[_0x1999d2(0x112)]),_0x4bbc6c&&(_0x134fb6['segmentFolderId']=_0x4bbc6c),_0x134fb6;}export function segmentDefToUpdateRequest(_0x2aa1d4){const _0x2d4e08=a92_0x1e89,_0x287550={'name':_0x2aa1d4[_0x2d4e08(0x170)]};return _0x2aa1d4['description']!==undefined&&(_0x287550['description']=_0x2aa1d4['description']),_0x2aa1d4[_0x2d4e08(0x17c)]&&(_0x287550[_0x2d4e08(0x17c)]=yamlRuleToApi(_0x2aa1d4[_0x2d4e08(0x17c)])),_0x2aa1d4['kind']&&(_0x287550['kind']=_0x2aa1d4[_0x2d4e08(0x11b)]==='batch'?0x0:_0x2aa1d4['kind']===_0x2d4e08(0x113)?0x1:0x2),_0x287550;}export function yamlRuleToApi(_0x483ac9,_0xb1bf10=![]){const _0x5f28a2=a92_0x1e89,_0x4fbead=_0x483ac9[_0x5f28a2(0x120)][_0x5f28a2(0x10d)](yamlConditionToApi);if(_0xb1bf10){const _0x1d8c76=_0x4fbead[_0x5f28a2(0x18b)](_0x2aaf8c=>_0x2aaf8c[_0x5f28a2(0x152)]===_0x5f28a2(0x172)||_0x2aaf8c[_0x5f28a2(0x152)]==='Or');if(!_0x1d8c76&&_0x4fbead[_0x5f28a2(0x101)]>0x0)return{'type':_0x483ac9[_0x5f28a2(0x152)],'conditions':[{'type':_0x5f28a2(0x172),'description':_0x483ac9['description']||'','conditions':_0x4fbead}]};}return{'type':_0x483ac9[_0x5f28a2(0x152)],'conditions':_0x4fbead,..._0x483ac9[_0x5f28a2(0x110)]&&{'description':_0x483ac9[_0x5f28a2(0x110)]}};}function yamlConditionToApi(_0x343882){const _0x2373cb=a92_0x1e89;if(_0x2373cb(0x167)in _0x343882&&(_0x343882['type']===_0x2373cb(0x186)||_0x343882['type']===_0x2373cb(0x17d))){const _0x23b317=_0x343882;return{'type':_0x2373cb(0x134),'id':_0x23b317[_0x2373cb(0x167)],'exclude':_0x23b317[_0x2373cb(0x152)]===_0x2373cb(0x17d)};}if(_0x2373cb(0x152)in _0x343882&&(_0x343882[_0x2373cb(0x152)]===_0x2373cb(0x172)||_0x343882['type']==='Or')){const _0x4d4137=_0x343882;return{'type':_0x4d4137[_0x2373cb(0x152)],'conditions':_0x4d4137[_0x2373cb(0x120)][_0x2373cb(0x10d)](yamlConditionToApi),..._0x4d4137[_0x2373cb(0x110)]&&{'description':_0x4d4137[_0x2373cb(0x110)]}};}const _0x2a6d89=_0x343882,_0x534449={'type':'Value','leftValue':buildLeftValue(_0x2a6d89),'operator':yamlOperatorToApi(_0x2a6d89[_0x2373cb(0x11e)]),'exclude':_0x2a6d89[_0x2373cb(0x17d)]??![],'arrayMatching':_0x2a6d89[_0x2373cb(0x104)]??'any'};return _0x2a6d89[_0x2373cb(0x14b)]!==undefined&&(_0x534449[_0x2373cb(0x14b)]=_0x2a6d89['limit']),_0x534449;}function buildLeftValue(_0x111319){const _0x568f74=a92_0x1e89,_0x49c3bb={'name':_0x111319['attribute']};return _0x111319[_0x568f74(0x140)]&&(_0x49c3bb[_0x568f74(0x140)]={'type':_0x111319['aggregation'][_0x568f74(0x152)],..._0x111319[_0x568f74(0x140)][_0x568f74(0x13b)]&&{'groupingColumns':_0x111319[_0x568f74(0x140)]['groupingColumns']}}),_0x111319[_0x568f74(0x108)]&&(_0x49c3bb[_0x568f74(0x108)]={'name':_0x111319[_0x568f74(0x108)]}),_0x111319[_0x568f74(0x181)]&&(_0x49c3bb['filter']=yamlRuleToApi(_0x111319[_0x568f74(0x181)])),_0x49c3bb;}function yamlOperatorToApi(_0x1d1dc6){const _0x3dbea4=a92_0x1e89,_0x5a9d26={'type':mapYamlOperatorType(_0x1d1dc6[_0x3dbea4(0x152)]),'not':_0x1d1dc6[_0x3dbea4(0x136)]??![]},_0x509ceb=getEffectiveValue(_0x1d1dc6);if(_0x509ceb!==undefined){if(Array[_0x3dbea4(0x189)](_0x509ceb))_0x5a9d26['rightValues']=_0x509ceb;else isTemporalOperator(_0x1d1dc6['type'])?_0x5a9d26[_0x3dbea4(0x17f)]=_0x509ceb:_0x5a9d26[_0x3dbea4(0x122)]=_0x509ceb;}return _0x1d1dc6[_0x3dbea4(0x18e)]&&(_0x5a9d26[_0x3dbea4(0x18e)]=_0x1d1dc6[_0x3dbea4(0x18e)]),_0x5a9d26;}function mapYamlOperatorType(_0x12b207){return _0x12b207;}export function toYamlString(_0x5670d4){const _0x32d3bd=a92_0x1e89,_0x5a851c=JSON[_0x32d3bd(0x17b)](JSON[_0x32d3bd(0x131)](_0x5670d4)),_0x1e7211=a92_0x1faf5d[_0x32d3bd(0x131)](_0x5a851c,{'indent':0x2,'lineWidth':0x0,'nullStr':_0x32d3bd(0x10b)}),_0x456157=[_0x32d3bd(0x107)];let _0x274ab9=_0x1e7211;for(const _0x144dba of _0x456157){_0x274ab9=_0x274ab9[_0x32d3bd(0x132)](new RegExp('^('+_0x144dba+')','m'),(_0x4b3336,_0x265aaf,_0x5b8a42)=>{if(_0x5b8a42===0x0||_0x274ab9[_0x5b8a42-0x1]==='\x0a'&&_0x274ab9[_0x5b8a42-0x2]==='\x0a')return _0x265aaf;return'\x0a'+_0x265aaf;});}return _0x274ab9;}export function parseYamlString(_0x2c8179){const _0x3f65bf=a92_0x1e89,_0x594d53=a92_0x1faf5d['parse'](_0x2c8179);if(!_0x594d53['name'])throw new Error(_0x3f65bf(0x179));if(_0x594d53[_0x3f65bf(0x152)]&&_0x594d53[_0x3f65bf(0x152)]!=='segment')throw new Error(_0x3f65bf(0x10f)+_0x594d53[_0x3f65bf(0x152)]);return _0x594d53;}export function isSegmentYaml(_0x162411){const _0x1c78b4=a92_0x1e89;if(typeof _0x162411!==_0x1c78b4(0x144)||_0x162411===null)return![];const _0x46e12c=_0x162411;return _0x46e12c[_0x1c78b4(0x152)]===_0x1c78b4(0x167)||_0x46e12c[_0x1c78b4(0x152)]===undefined;}export function generateTemplate(_0x280c20='New\x20Segment'){const _0x547191=a92_0x1e89,_0x2b2ce7={'type':'segment','name':_0x280c20,'description':_0x547191(0x11a),'rule':{'type':_0x547191(0x172),'conditions':[{'type':_0x547191(0x12f),'attribute':_0x547191(0x153),'operator':{'type':_0x547191(0x162),'value':_0x547191(0x17f)}}]}};return toYamlString(_0x2b2ce7);}export function segmentToYamlString(_0x4471e2){const _0x289f06=a92_0x1e89,_0x148faf=JSON['parse'](JSON[_0x289f06(0x131)](_0x4471e2)),_0x3e616c=a92_0x1faf5d[_0x289f06(0x131)](_0x148faf,{'indent':0x2,'lineWidth':0x0,'nullStr':'null'}),_0x8dcaef=['rule:',_0x289f06(0x114)];let _0x4c74b9=_0x3e616c;for(const _0x447535 of _0x8dcaef){_0x4c74b9=_0x4c74b9[_0x289f06(0x132)](new RegExp('^('+_0x447535+')','m'),(_0x1ebabf,_0x3c2940,_0x323004)=>{if(_0x323004===0x0||_0x4c74b9[_0x323004-0x1]==='\x0a'&&_0x4c74b9[_0x323004-0x2]==='\x0a')return _0x3c2940;return'\x0a'+_0x3c2940;});}return _0x4c74b9;}export function parseSegmentYamlFile(_0x140df3){const _0x2b392d=a92_0x1e89,_0x30f6eb=a92_0x1faf5d[_0x2b392d(0x17b)](_0x140df3);if(!_0x30f6eb[_0x2b392d(0x170)])throw new Error(_0x2b392d(0x179));return _0x30f6eb;}export function normalizeChildSegmentYaml(_0x54a35e){const _0x2c7f3a=a92_0x1e89;return{'type':_0x2c7f3a(0x167),'name':_0x54a35e[_0x2c7f3a(0x170)],..._0x54a35e[_0x2c7f3a(0x110)]!==undefined&&{'description':_0x54a35e[_0x2c7f3a(0x110)]},..._0x54a35e[_0x2c7f3a(0x12a)]!==undefined&&{'folder':_0x54a35e[_0x2c7f3a(0x12a)]},..._0x54a35e['rule']&&{'rule':normalizeRule(_0x54a35e[_0x2c7f3a(0x17c)])},..._0x54a35e['kind']!==undefined&&{'kind':_0x54a35e['kind']},..._0x54a35e[_0x2c7f3a(0x112)]!==undefined&&{'visible':_0x54a35e[_0x2c7f3a(0x112)]},..._0x54a35e['activations']&&{'activations':_0x54a35e[_0x2c7f3a(0x126)]['map'](normalizeActivation)}};}function a92_0x1e89(_0x4dad1f,_0x1d7dac){_0x4dad1f=_0x4dad1f-0x101;const _0x15137d=a92_0x1513();let _0x1e8906=_0x15137d[_0x4dad1f];return _0x1e8906;}export function normalizeRule(_0x5cb551){const _0x3a8626=a92_0x1e89;return{'type':_0x5cb551[_0x3a8626(0x152)],'conditions':_0x5cb551[_0x3a8626(0x120)][_0x3a8626(0x10d)](normalizeCondition),..._0x5cb551['description']!==undefined&&{'description':_0x5cb551[_0x3a8626(0x110)]}};}function normalizeCondition(_0xd69981){const _0x1987a2=a92_0x1e89;if('segment'in _0xd69981&&(_0xd69981[_0x1987a2(0x152)]===_0x1987a2(0x186)||_0xd69981[_0x1987a2(0x152)]===_0x1987a2(0x17d))){const _0x1b3f0e=_0xd69981;return{'type':_0x1b3f0e[_0x1987a2(0x152)],'segment':_0x1b3f0e['segment']};}if('type'in _0xd69981&&(_0xd69981[_0x1987a2(0x152)]===_0x1987a2(0x172)||_0xd69981['type']==='Or')){const _0x482760=_0xd69981;return{'type':_0x482760['type'],'conditions':_0x482760['conditions'][_0x1987a2(0x10d)](normalizeCondition),..._0x482760[_0x1987a2(0x110)]!==undefined&&{'description':_0x482760[_0x1987a2(0x110)]}};}const _0x6f28ae=_0xd69981;return{'type':'Value','attribute':_0x6f28ae[_0x1987a2(0x137)],'operator':normalizeOperator(_0x6f28ae['operator']),..._0x6f28ae[_0x1987a2(0x104)]!==undefined&&{'arrayMatching':_0x6f28ae[_0x1987a2(0x104)]},..._0x6f28ae[_0x1987a2(0x17d)]!==undefined&&{'exclude':_0x6f28ae[_0x1987a2(0x17d)]},..._0x6f28ae[_0x1987a2(0x140)]!==undefined&&{'aggregation':_0x6f28ae[_0x1987a2(0x140)]},..._0x6f28ae[_0x1987a2(0x108)]!==undefined&&{'source':_0x6f28ae[_0x1987a2(0x108)]},..._0x6f28ae[_0x1987a2(0x181)]!==undefined&&{'filter':normalizeRule(_0x6f28ae['filter'])},..._0x6f28ae[_0x1987a2(0x14b)]!==undefined&&{'limit':_0x6f28ae[_0x1987a2(0x14b)]}};}function normalizeOperator(_0x5d54c8){const _0x49dcc8=a92_0x1e89,_0x3b0bd0=getEffectiveValue(_0x5d54c8);return{'type':_0x5d54c8[_0x49dcc8(0x152)],..._0x5d54c8[_0x49dcc8(0x136)]!==undefined&&{'not':_0x5d54c8['not']},..._0x3b0bd0!==undefined&&{'value':_0x3b0bd0},..._0x5d54c8[_0x49dcc8(0x187)]!==undefined&&{'min':_0x5d54c8[_0x49dcc8(0x187)]},..._0x5d54c8[_0x49dcc8(0x128)]!==undefined&&{'max':_0x5d54c8[_0x49dcc8(0x128)]},..._0x5d54c8['unit']!==undefined&&{'unit':_0x5d54c8[_0x49dcc8(0x18e)]},..._0x5d54c8['duration']!==undefined&&{'duration':_0x5d54c8[_0x49dcc8(0x156)]},..._0x5d54c8[_0x49dcc8(0x18c)]!==undefined&&{'from':_0x5d54c8[_0x49dcc8(0x18c)]}};}function normalizeActivation(_0x480d68){const _0x52ea56=a92_0x1e89;return{'name':_0x480d68[_0x52ea56(0x170)],'connection':_0x480d68[_0x52ea56(0x158)],..._0x480d68['description']!==undefined&&{'description':_0x480d68['description']},..._0x480d68[_0x52ea56(0x171)]!==undefined&&{'all_columns':_0x480d68[_0x52ea56(0x171)]},..._0x480d68[_0x52ea56(0x119)]!==undefined&&{'columns':_0x480d68[_0x52ea56(0x119)]},..._0x480d68[_0x52ea56(0x16b)]!==undefined&&{'behavior':_0x480d68[_0x52ea56(0x16b)]},..._0x480d68[_0x52ea56(0x105)]!==undefined&&{'schedule':_0x480d68[_0x52ea56(0x105)]},..._0x480d68[_0x52ea56(0x168)]!==undefined&&{'notification':_0x480d68['notification']},..._0x480d68[_0x52ea56(0x10a)]!==undefined&&{'connector_config':_0x480d68['connector_config']},..._0x480d68[_0x52ea56(0x14d)]!==undefined&&{'activation_template_id':_0x480d68[_0x52ea56(0x14d)]}};}export function activationResponseToDef(_0x241c63,_0x35f232,_0x4be20d){const _0x1ffabe=a92_0x1e89,_0x4a9757=_0x241c63[_0x1ffabe(0x15c)]||'',_0x144840=_0x4be20d?.[_0x1ffabe(0x166)](_0x4a9757)??_0x4a9757,_0x56b267={'name':_0x241c63['name'],'connection':_0x144840};_0x241c63[_0x1ffabe(0x110)]&&(_0x56b267[_0x1ffabe(0x110)]=_0x241c63[_0x1ffabe(0x110)]);let _0x5d6de1=[];_0x241c63[_0x1ffabe(0x119)]&&_0x241c63[_0x1ffabe(0x119)][_0x1ffabe(0x101)]>0x0&&(_0x5d6de1=_0x241c63[_0x1ffabe(0x119)][_0x1ffabe(0x181)](_0x5b9caa=>_0x5b9caa&&_0x5b9caa['name'])['map'](_0x509369=>{const _0xfb0480=_0x1ffabe;if(_0x509369[_0xfb0480(0x152)]||_0x509369[_0xfb0480(0x177)])return{'name':_0x509369['name'],..._0x509369[_0xfb0480(0x152)]&&{'type':_0x509369[_0xfb0480(0x152)]},..._0x509369[_0xfb0480(0x177)]&&{'visibility':_0x509369[_0xfb0480(0x177)]}};return _0x509369[_0xfb0480(0x170)];}));_0x5d6de1[_0x1ffabe(0x101)]>0x0&&(_0x56b267[_0x1ffabe(0x119)]=_0x5d6de1);_0x241c63[_0x1ffabe(0x109)]!==undefined&&(_0x241c63[_0x1ffabe(0x109)]===![]&&_0x5d6de1[_0x1ffabe(0x101)]===0x0?_0x56b267[_0x1ffabe(0x171)]=!![]:_0x56b267[_0x1ffabe(0x171)]=_0x241c63['allColumns']);const _0x5a179e={};let _0x461a23=![];_0x241c63[_0x1ffabe(0x15a)]&&(_0x5a179e['type']=_0x241c63['scheduleType'],_0x461a23=!![]);_0x241c63[_0x1ffabe(0x161)]&&(_0x5a179e[_0x1ffabe(0x103)]=_0x241c63[_0x1ffabe(0x161)],_0x461a23=!![]);_0x241c63['repeatFrequency']!==undefined&&_0x241c63[_0x1ffabe(0x175)]!==null&&(_0x5a179e[_0x1ffabe(0x12d)]=_0x241c63['repeatFrequency'],_0x461a23=!![]);_0x241c63[_0x1ffabe(0x14c)]&&_0x241c63[_0x1ffabe(0x14c)]['length']>0x0&&(_0x5a179e[_0x1ffabe(0x13a)]=_0x241c63[_0x1ffabe(0x14c)],_0x461a23=!![]);_0x241c63[_0x1ffabe(0x16e)]!==undefined&&(_0x5a179e[_0x1ffabe(0x178)]=_0x241c63[_0x1ffabe(0x16e)],_0x461a23=!![]);_0x241c63[_0x1ffabe(0x165)]!==undefined&&(_0x5a179e['end_on']=_0x241c63[_0x1ffabe(0x165)],_0x461a23=!![]);_0x241c63[_0x1ffabe(0x150)]&&(_0x5a179e[_0x1ffabe(0x150)]=_0x241c63[_0x1ffabe(0x150)],_0x461a23=!![]);_0x461a23&&(_0x56b267[_0x1ffabe(0x105)]=_0x5a179e);(_0x241c63[_0x1ffabe(0x11c)]&&_0x241c63['notifyOn'][_0x1ffabe(0x101)]>0x0||_0x241c63[_0x1ffabe(0x160)]&&_0x241c63[_0x1ffabe(0x160)][_0x1ffabe(0x101)]>0x0)&&(_0x56b267[_0x1ffabe(0x168)]={},_0x241c63[_0x1ffabe(0x11c)]&&_0x241c63['notifyOn'][_0x1ffabe(0x101)]>0x0&&(_0x56b267[_0x1ffabe(0x168)]['notify_on']=_0x241c63['notifyOn']),_0x241c63[_0x1ffabe(0x160)]&&_0x241c63[_0x1ffabe(0x160)][_0x1ffabe(0x101)]>0x0&&(_0x56b267[_0x1ffabe(0x168)]['email_recipients']=_0x241c63[_0x1ffabe(0x160)]['map'](_0x3990b2=>{const _0x371514=_0x1ffabe,_0x7e8bef=_0x35f232?.[_0x371514(0x166)](_0x3990b2);return _0x7e8bef??String(_0x3990b2);})));_0x241c63[_0x1ffabe(0x12b)]&&Object[_0x1ffabe(0x111)](_0x241c63[_0x1ffabe(0x12b)])['length']>0x0&&(_0x56b267[_0x1ffabe(0x10a)]=normalizeConnectorConfigForYaml(_0x241c63[_0x1ffabe(0x12b)]));_0x241c63['activationTemplateId']&&(_0x56b267[_0x1ffabe(0x14d)]=_0x241c63[_0x1ffabe(0x173)]);if(_0x241c63[_0x1ffabe(0x139)]){const _0x3975f4={},_0x237f7f=_0x241c63['syndicationBehavior'];_0x237f7f['columns']&&_0x237f7f['columns'][_0x1ffabe(0x101)]>0x0&&(_0x3975f4[_0x1ffabe(0x119)]=_0x237f7f[_0x1ffabe(0x119)][_0x1ffabe(0x181)](_0x493dd0=>_0x493dd0&&_0x493dd0[_0x1ffabe(0x170)])[_0x1ffabe(0x10d)](_0x4c6903=>({'name':_0x4c6903[_0x1ffabe(0x170)],..._0x4c6903['type']&&{'type':_0x4c6903['type']},..._0x4c6903['visibility']&&{'visibility':_0x4c6903[_0x1ffabe(0x177)]}}))),_0x237f7f[_0x1ffabe(0x133)]&&(_0x3975f4['behavior_table']=_0x237f7f[_0x1ffabe(0x133)]),_0x237f7f[_0x1ffabe(0x13e)]!==undefined&&(_0x3975f4[_0x1ffabe(0x13d)]=_0x237f7f['joinRow']),_0x237f7f[_0x1ffabe(0x169)]&&(_0x3975f4[_0x1ffabe(0x135)]=_0x237f7f[_0x1ffabe(0x169)]),_0x237f7f[_0x1ffabe(0x12c)]&&(_0x3975f4[_0x1ffabe(0x12c)]=_0x237f7f[_0x1ffabe(0x12c)]),_0x237f7f[_0x1ffabe(0x146)]&&_0x237f7f[_0x1ffabe(0x146)][_0x1ffabe(0x101)]>0x0&&(_0x3975f4[_0x1ffabe(0x147)]=_0x237f7f[_0x1ffabe(0x146)]),Object[_0x1ffabe(0x111)](_0x3975f4)[_0x1ffabe(0x101)]>0x0&&(_0x56b267[_0x1ffabe(0x16b)]=_0x3975f4);}return _0x56b267;}export function journeyActivationStepToYaml(_0x14c1f2,_0x2e1142,_0x3c65f8){const _0x16eb7a=a92_0x1e89,_0x14a598=_0x14c1f2[_0x16eb7a(0x149)][_0x16eb7a(0x15e)],_0x2e6850=_0x14a598['connectionId']||'',_0x2303f7=_0x3c65f8?.[_0x16eb7a(0x166)](_0x2e6850)??_0x2e6850,_0x5acbc4={'name':_0x14a598[_0x16eb7a(0x170)]||'','connection':_0x2303f7};_0x14a598['description']&&(_0x5acbc4['description']=_0x14a598[_0x16eb7a(0x110)]);let _0x78b7ab=[];_0x14a598[_0x16eb7a(0x119)]&&_0x14a598[_0x16eb7a(0x119)][_0x16eb7a(0x101)]>0x0&&(_0x78b7ab=_0x14a598['columns'][_0x16eb7a(0x181)](_0x5e3b99=>_0x5e3b99&&_0x5e3b99[_0x16eb7a(0x170)])[_0x16eb7a(0x10d)](_0x19bf4c=>{const _0x31c95b=_0x16eb7a;if(_0x19bf4c[_0x31c95b(0x152)]||_0x19bf4c[_0x31c95b(0x177)])return{'name':_0x19bf4c[_0x31c95b(0x170)],..._0x19bf4c[_0x31c95b(0x152)]&&{'type':_0x19bf4c[_0x31c95b(0x152)]},..._0x19bf4c[_0x31c95b(0x177)]&&{'visibility':_0x19bf4c[_0x31c95b(0x177)]}};return _0x19bf4c['name'];}));_0x78b7ab[_0x16eb7a(0x101)]>0x0&&(_0x5acbc4[_0x16eb7a(0x119)]=_0x78b7ab);_0x14a598[_0x16eb7a(0x109)]!==undefined&&(_0x14a598[_0x16eb7a(0x109)]===![]&&_0x78b7ab[_0x16eb7a(0x101)]===0x0?_0x5acbc4[_0x16eb7a(0x171)]=!![]:_0x5acbc4['all_columns']=_0x14a598[_0x16eb7a(0x109)]);const _0x52d886={};let _0x28ecd1=![];_0x14a598[_0x16eb7a(0x15a)]&&(_0x52d886[_0x16eb7a(0x152)]=_0x14a598['scheduleType'],_0x28ecd1=!![]);_0x14a598['repeatUnit']&&(_0x52d886['repeat_unit']=_0x14a598[_0x16eb7a(0x161)],_0x28ecd1=!![]);_0x14a598[_0x16eb7a(0x175)]!==undefined&&_0x14a598[_0x16eb7a(0x175)]!==null&&(_0x52d886[_0x16eb7a(0x12d)]=_0x14a598[_0x16eb7a(0x175)],_0x28ecd1=!![]);_0x14a598[_0x16eb7a(0x16e)]!==undefined&&(_0x52d886['start_at']=_0x14a598[_0x16eb7a(0x16e)],_0x28ecd1=!![]);_0x14a598[_0x16eb7a(0x165)]!==undefined&&(_0x52d886[_0x16eb7a(0x127)]=_0x14a598[_0x16eb7a(0x165)],_0x28ecd1=!![]);_0x14a598[_0x16eb7a(0x150)]&&(_0x52d886[_0x16eb7a(0x150)]=_0x14a598[_0x16eb7a(0x150)],_0x28ecd1=!![]);_0x28ecd1&&(_0x5acbc4[_0x16eb7a(0x105)]=_0x52d886);(_0x14a598['notifyOn']&&_0x14a598[_0x16eb7a(0x11c)][_0x16eb7a(0x101)]>0x0||_0x14a598['emailRecipients']&&_0x14a598[_0x16eb7a(0x160)][_0x16eb7a(0x101)]>0x0)&&(_0x5acbc4[_0x16eb7a(0x168)]={},_0x14a598[_0x16eb7a(0x11c)]&&_0x14a598[_0x16eb7a(0x11c)][_0x16eb7a(0x101)]>0x0&&(_0x5acbc4[_0x16eb7a(0x168)][_0x16eb7a(0x11f)]=_0x14a598['notifyOn']),_0x14a598[_0x16eb7a(0x160)]&&_0x14a598[_0x16eb7a(0x160)][_0x16eb7a(0x101)]>0x0&&(_0x5acbc4[_0x16eb7a(0x168)][_0x16eb7a(0x17a)]=_0x14a598[_0x16eb7a(0x160)][_0x16eb7a(0x10d)](_0x44fdc2=>{const _0xcb0c60=_0x16eb7a,_0xfea8a6=_0x2e1142?.[_0xcb0c60(0x166)](_0x44fdc2);return _0xfea8a6??String(_0x44fdc2);})));_0x14a598[_0x16eb7a(0x12b)]&&Object['keys'](_0x14a598[_0x16eb7a(0x12b)])['length']>0x0&&(_0x5acbc4[_0x16eb7a(0x10a)]=normalizeConnectorConfigForYaml(_0x14a598[_0x16eb7a(0x12b)]));_0x14a598[_0x16eb7a(0x173)]&&(_0x5acbc4['activation_template_id']=_0x14a598['activationTemplateId']);if(_0x14a598[_0x16eb7a(0x139)]){const _0x28bddf={},_0x1433ac=_0x14a598[_0x16eb7a(0x139)];_0x1433ac[_0x16eb7a(0x119)]&&_0x1433ac[_0x16eb7a(0x119)][_0x16eb7a(0x101)]>0x0&&(_0x28bddf[_0x16eb7a(0x119)]=_0x1433ac[_0x16eb7a(0x119)][_0x16eb7a(0x181)](_0xd36bfb=>_0xd36bfb&&_0xd36bfb['name'])[_0x16eb7a(0x10d)](_0x33a914=>({'name':_0x33a914[_0x16eb7a(0x170)],..._0x33a914[_0x16eb7a(0x152)]&&{'type':_0x33a914[_0x16eb7a(0x152)]},..._0x33a914['visibility']&&{'visibility':_0x33a914[_0x16eb7a(0x177)]}}))),_0x1433ac['behaviorTableName']&&(_0x28bddf['behavior_table']=_0x1433ac[_0x16eb7a(0x133)]),_0x1433ac[_0x16eb7a(0x13e)]!==undefined&&(_0x28bddf['join_row']=_0x1433ac[_0x16eb7a(0x13e)]),_0x1433ac[_0x16eb7a(0x169)]&&(_0x28bddf[_0x16eb7a(0x135)]=_0x1433ac['joinStrategy']),_0x1433ac[_0x16eb7a(0x12c)]&&(_0x28bddf[_0x16eb7a(0x12c)]=_0x1433ac['formatting']),_0x1433ac[_0x16eb7a(0x146)]&&_0x1433ac[_0x16eb7a(0x146)]['length']>0x0&&(_0x28bddf[_0x16eb7a(0x147)]=_0x1433ac[_0x16eb7a(0x146)]),Object[_0x16eb7a(0x111)](_0x28bddf)[_0x16eb7a(0x101)]>0x0&&(_0x5acbc4[_0x16eb7a(0x16b)]=_0x28bddf);}return _0x5acbc4;}export function segmentWithActivationsToYaml(_0x134a78,_0xf1ef1,_0x4025fa,_0x475ee5,_0x5e54be){const _0x4034fb=a92_0x1e89,_0x4a2709=segmentResponseToDefSync(_0x134a78,_0x4025fa);return _0xf1ef1[_0x4034fb(0x101)]>0x0&&(_0x4a2709[_0x4034fb(0x126)]=_0xf1ef1['map'](_0x41901b=>activationResponseToDef(_0x41901b,_0x475ee5,_0x5e54be))),_0x4a2709;}function normalizeColumn(_0x1c545b){const _0x59dc04=a92_0x1e89;if(typeof _0x1c545b===_0x59dc04(0x121))return{'name':_0x1c545b};return{'name':_0x1c545b[_0x59dc04(0x170)],..._0x1c545b[_0x59dc04(0x152)]&&{'type':_0x1c545b['type']},..._0x1c545b['visibility']&&{'visibility':_0x1c545b['visibility']}};}export async function activationDefToCreateRequest(_0x19f336,_0x580a5f){const _0xf48460=a92_0x1e89,_0x41d43c=_0x580a5f?.[_0xf48460(0x159)],_0x5acb20=_0x580a5f?.[_0xf48460(0x11d)],_0x12e2c3=_0x19f336[_0xf48460(0x158)];let _0x17d932;const _0x47b1a6=parseInt(_0x12e2c3,0xa);if(!isNaN(_0x47b1a6)&&String(_0x47b1a6)===_0x12e2c3)_0x17d932=_0x47b1a6;else{const _0x2a54ed=_0x5acb20?.[_0xf48460(0x166)](_0x12e2c3);if(_0x2a54ed===undefined)throw new SDKError(ErrorCode[_0xf48460(0x118)],_0xf48460(0x117)+_0x12e2c3,undefined,{'helpText':_0xf48460(0x14a)});_0x17d932=_0x2a54ed;}const _0x548df7={'name':_0x19f336[_0xf48460(0x170)],'connectionId':_0x17d932};_0x19f336[_0xf48460(0x110)]&&(_0x548df7[_0xf48460(0x110)]=_0x19f336[_0xf48460(0x110)]);let _0x1e3808=[];_0x19f336[_0xf48460(0x119)]&&_0x19f336[_0xf48460(0x119)][_0xf48460(0x101)]>0x0&&(_0x1e3808=_0x19f336[_0xf48460(0x119)][_0xf48460(0x181)](_0x5b83a8=>_0x5b83a8!=null)[_0xf48460(0x10d)](normalizeColumn));_0x1e3808[_0xf48460(0x101)]>0x0&&(_0x548df7[_0xf48460(0x119)]=_0x1e3808);_0x19f336[_0xf48460(0x171)]!==undefined&&(_0x19f336[_0xf48460(0x171)]===![]&&_0x1e3808[_0xf48460(0x101)]===0x0?_0x548df7[_0xf48460(0x109)]=!![]:_0x548df7[_0xf48460(0x109)]=_0x19f336[_0xf48460(0x171)]);if(_0x19f336[_0xf48460(0x105)]){const _0x45fd87=_0x19f336[_0xf48460(0x105)];_0x45fd87['type']&&(_0x548df7[_0xf48460(0x15a)]=_0x45fd87[_0xf48460(0x152)]),_0x45fd87[_0xf48460(0x103)]&&(_0x548df7['repeatUnit']=_0x45fd87['repeat_unit']),_0x45fd87[_0xf48460(0x12d)]!==undefined&&(_0x548df7['repeatFrequency']=_0x45fd87[_0xf48460(0x12d)]),_0x45fd87[_0xf48460(0x13a)]&&(_0x548df7[_0xf48460(0x14c)]=_0x45fd87[_0xf48460(0x13a)]),_0x45fd87['start_at']!==undefined&&(_0x548df7['startAt']=_0x45fd87['start_at']),_0x45fd87[_0xf48460(0x127)]!==undefined&&(_0x548df7[_0xf48460(0x165)]=_0x45fd87[_0xf48460(0x127)]),_0x45fd87[_0xf48460(0x150)]&&(_0x548df7[_0xf48460(0x150)]=_0x45fd87[_0xf48460(0x150)]);}_0x19f336['notification']&&(_0x19f336[_0xf48460(0x168)][_0xf48460(0x11f)]&&(_0x548df7[_0xf48460(0x11c)]=_0x19f336[_0xf48460(0x168)]['notify_on']),_0x19f336[_0xf48460(0x168)]['email_recipients']&&(_0x548df7[_0xf48460(0x160)]=_0x19f336[_0xf48460(0x168)][_0xf48460(0x17a)][_0xf48460(0x10d)](_0x391432=>{const _0x52b45d=_0xf48460,_0x4eb513=Number(_0x391432);if(!isNaN(_0x4eb513)&&String(_0x4eb513)===_0x391432)return _0x4eb513;const _0x4d20e3=_0x41d43c?.[_0x52b45d(0x166)](_0x391432['toLowerCase']());if(_0x4d20e3===undefined)throw new SDKError(ErrorCode[_0x52b45d(0x174)],'Unknown\x20email\x20recipient:\x20'+_0x391432+'.\x20Use\x20\x27tdx\x20user\x20list\x27\x20to\x20see\x20valid\x20emails.');return _0x4d20e3;})));if(_0x19f336[_0xf48460(0x10a)]){const _0x3cb063=_0x580a5f?.[_0xf48460(0x129)]?.[_0xf48460(0x166)](_0x12e2c3);if(_0x3cb063&&_0x580a5f?.[_0xf48460(0x13f)])try{const _0x17028d=await _0x580a5f[_0xf48460(0x13f)](_0x3cb063),_0x3a4fc5=validateConnectorConfig(_0x19f336[_0xf48460(0x10a)],_0x17028d);if(!_0x3a4fc5[_0xf48460(0x115)])throw new SDKError(ErrorCode['CONNECTOR_INVALID_CONFIG'],'Invalid\x20connector_config\x20for\x20activation\x20\x22'+_0x19f336[_0xf48460(0x170)]+'\x22:\x0a'+formatValidationErrors(_0x3a4fc5['errors']),undefined,{'helpText':_0xf48460(0x184)+_0x3cb063+'\x0a\x0aAvailable\x20fields:\x0a'+formatSchemaAsHelp(_0x17028d)});if(_0x3a4fc5['warnings'][_0xf48460(0x101)]>0x0){const _0x2769a6=formatValidationWarnings(_0x3a4fc5[_0xf48460(0x130)]);console[_0xf48460(0x10c)]('connector_config\x20for\x20activation\x20\x22'+_0x19f336[_0xf48460(0x170)]+_0xf48460(0x14f)+_0x2769a6);}_0x548df7[_0xf48460(0x12b)]=transformConfigToLegacy(_0x19f336[_0xf48460(0x10a)],_0x17028d);}catch(_0x4abf68){if(_0x4abf68 instanceof SDKError&&_0x4abf68[_0xf48460(0x182)]===ErrorCode[_0xf48460(0x18d)])_0x548df7[_0xf48460(0x12b)]=_0x19f336['connector_config'];else throw _0x4abf68;}else _0x548df7[_0xf48460(0x12b)]=_0x19f336[_0xf48460(0x10a)];}_0x19f336[_0xf48460(0x14d)]!==undefined&&(_0x548df7[_0xf48460(0x173)]=_0x19f336[_0xf48460(0x14d)]);if(_0x19f336[_0xf48460(0x16b)]){const _0x9fdbd0=_0x19f336[_0xf48460(0x16b)],_0x35f06b={};if(_0x9fdbd0['columns']&&_0x9fdbd0[_0xf48460(0x119)]['length']>0x0){const _0x11817b=_0x9fdbd0[_0xf48460(0x119)][_0xf48460(0x181)](_0x219a8c=>_0x219a8c&&_0x219a8c['name']);_0x11817b['length']>0x0&&(_0x35f06b['columns']=_0x11817b);}_0x9fdbd0['behavior_table']&&(_0x35f06b[_0xf48460(0x133)]=_0x9fdbd0['behavior_table']),_0x9fdbd0[_0xf48460(0x13d)]!==undefined&&(_0x35f06b['joinRow']=_0x9fdbd0[_0xf48460(0x13d)]),_0x9fdbd0[_0xf48460(0x135)]&&(_0x35f06b[_0xf48460(0x169)]=_0x9fdbd0['join_strategy']),_0x9fdbd0['formatting']&&(_0x35f06b[_0xf48460(0x12c)]=_0x9fdbd0[_0xf48460(0x12c)]),_0x9fdbd0[_0xf48460(0x147)]&&(_0x35f06b[_0xf48460(0x146)]=_0x9fdbd0[_0xf48460(0x147)]),_0x548df7[_0xf48460(0x139)]=_0x35f06b;}return _0x548df7;}export async function activationDefToUpdateRequest(_0x34e1cf,_0xf75a6){return activationDefToCreateRequest(_0x34e1cf,_0xf75a6);}export function deepSortObject(_0x323d3b){const _0x2e913c=a92_0x1e89;if(_0x323d3b===null||typeof _0x323d3b!==_0x2e913c(0x144))return _0x323d3b;if(Array[_0x2e913c(0x189)](_0x323d3b))return _0x323d3b[_0x2e913c(0x10d)](deepSortObject)['sort']((_0x5d0e6c,_0x4bd20c)=>JSON[_0x2e913c(0x131)](_0x5d0e6c)[_0x2e913c(0x12e)](JSON['stringify'](_0x4bd20c)));const _0x120075={};for(const _0x2ff60e of Object[_0x2e913c(0x111)](_0x323d3b)[_0x2e913c(0x15b)]()){_0x120075[_0x2ff60e]=deepSortObject(_0x323d3b[_0x2ff60e]);}return _0x120075;}export function serializeRule(_0x1cf6f6){const _0x53fee7=a92_0x1e89;return JSON[_0x53fee7(0x131)](deepSortObject(_0x1cf6f6));}export function normalizeRuleForMatching(_0x5481bb){return normalizeConditionsForMatching(_0x5481bb);}function normalizeConditionsForMatching(_0x37cc6e){const _0x442b84=a92_0x1e89;if(_0x37cc6e===null||typeof _0x37cc6e!==_0x442b84(0x144))return _0x37cc6e;if(Array['isArray'](_0x37cc6e))return _0x37cc6e[_0x442b84(0x10d)](normalizeConditionsForMatching);const _0x157c94=_0x37cc6e;if((_0x157c94[_0x442b84(0x152)]==='include'||_0x157c94[_0x442b84(0x152)]==='exclude')&&typeof _0x157c94['segment']==='string')return{..._0x157c94,'segment':_0x442b84(0x125)};const _0x4d04df={};for(const _0x2a77e0 of Object[_0x442b84(0x111)](_0x157c94)){_0x4d04df[_0x2a77e0]=normalizeConditionsForMatching(_0x157c94[_0x2a77e0]);}return _0x4d04df;}export function serializeRuleForMatching(_0x589b9b){const _0x338fc2=a92_0x1e89;return JSON[_0x338fc2(0x131)](deepSortObject(normalizeRuleForMatching(_0x589b9b)));}function a92_0x1513(){const _0x167761=['repeat_sub_frequency','groupingColumns','ruleHashToName','join_row','joinRow','getSchema','aggregation','132228WOiEgX','values','all','object','TimeWithinNext','orderBy','order_by','batch','attributes','Use\x20\x27tdx\x20connections\x27\x20to\x20list\x20available\x20connections','limit','repeatSubFrequency','activation_template_id','add','\x22:\x0a','timezone','isVisible','type','attribute_name','1653348egPBlN','19509578QBCwKa','duration','TimeWithinPast','connection','emailToIdMap','scheduleType','sort','connectionId','JOURNEY_SYNTAX_ERROR','activationParams','test','emailRecipients','repeatUnit','Equal','conditions[','has','endOn','get','segment','notification','joinStrategy','19782BDEdHU','behavior','__UNRESOLVED__','resolveSegmentName','startAt','Please\x20specify\x20a\x20valid\x20attribute\x20name.','name','all_columns','And','activationTemplateId','INVALID_ARGUMENT','repeatFrequency','leftValue','visibility','start_at','YAML\x20config\x20missing\x20required\x20field:\x20name','email_recipients','parse','rule','exclude','155wdDNGf','value','localRuleToName','filter','code','576etFpeh','Connector:\x20','3890116PsHOwZ','include','min','forEach','isArray','rightValues','every','from','CONNECTOR_SCHEMA_NOT_FOUND','unit','length','3BKKHhd','repeat_unit','arrayMatching','schedule','any','rule:','source','allColumns','connector_config','null','warn','map','entries','YAML\x20type\x20must\x20be\x20\x27segment\x27\x20or\x20omitted,\x20got:\x20','description','keys','visible','realtime','activations:','valid','1447043nTUZun','Unknown\x20connection:\x20','CONNECTION_NOT_FOUND','columns','Segment\x20description','kind','notifyOn','connectionNameToIdMap','operator','notify_on','conditions','string','rightValue','20FlOuIu','set','__SEGMENT_REF__','activations','end_on','max','connectionNameToTypeMap','folder','connectorConfig','formatting','repeat_frequency','localeCompare','Value','warnings','stringify','replace','behaviorTableName','Reference','join_strategy','not','attribute','466425ExEDEi','syndicationBehavior'];a92_0x1513=function(){return _0x167761;};return a92_0x1513();}export function expandSegmentReferences(_0xa43833,_0x21bba6,_0x5108df=new Set()){return expandConditions(_0xa43833,_0x21bba6,_0x5108df);}function expandConditions(_0x58ec49,_0x3bcbaf,_0x126a39){const _0x1178c4=a92_0x1e89;if(_0x58ec49===null||typeof _0x58ec49!==_0x1178c4(0x144))return _0x58ec49;if(Array[_0x1178c4(0x189)](_0x58ec49))return _0x58ec49[_0x1178c4(0x10d)](_0x348ee3=>expandConditions(_0x348ee3,_0x3bcbaf,_0x126a39));const _0x22351c=_0x58ec49;if((_0x22351c[_0x1178c4(0x152)]===_0x1178c4(0x186)||_0x22351c[_0x1178c4(0x152)]===_0x1178c4(0x17d))&&typeof _0x22351c[_0x1178c4(0x167)]===_0x1178c4(0x121)){const _0x514aaa=_0x22351c[_0x1178c4(0x167)],_0x1d5d8c=_0x3bcbaf[_0x1178c4(0x166)](_0x514aaa);if(_0x1d5d8c&&!_0x126a39[_0x1178c4(0x164)](_0x514aaa)){const _0x50a825=new Set(_0x126a39);_0x50a825['add'](_0x514aaa);const _0x5df788=expandConditions(_0x1d5d8c,_0x3bcbaf,_0x50a825);return{'type':_0x22351c[_0x1178c4(0x152)],'expanded_rule':_0x5df788};}return{'type':_0x22351c[_0x1178c4(0x152)],'expanded_rule':_0x1178c4(0x16c)};}const _0xc3600d={};for(const _0x4dbfcd of Object['keys'](_0x22351c)){_0xc3600d[_0x4dbfcd]=expandConditions(_0x22351c[_0x4dbfcd],_0x3bcbaf,_0x126a39);}return _0xc3600d;}export function serializeExpandedRule(_0x56a46f,_0x275fbf){const _0x3a13b9=a92_0x1e89,_0x334773=expandSegmentReferences(_0x56a46f,_0x275fbf);return JSON[_0x3a13b9(0x131)](deepSortObject(_0x334773));}export function createSegmentNameContext(_0x326186){const _0xee9824=a92_0x1e89,_0x447d82=new Set(),_0x98be33=new Map(),_0x1c67f0=new Map();if(_0x326186)for(const [_0x4b21de,_0x4305fa]of Object[_0xee9824(0x10e)](_0x326186)){if(_0x4305fa[_0xee9824(0x17c)]){const _0x3e3de5=serializeRule(_0x4305fa[_0xee9824(0x17c)]);_0x1c67f0[_0xee9824(0x124)](_0x3e3de5,_0x4b21de),_0x447d82[_0xee9824(0x14e)](_0x4b21de);}}return{'usedNames':_0x447d82,'ruleHashToName':_0x98be33,'localRuleToName':_0x326186?_0x1c67f0:undefined};}export function resolveSegmentName(_0x100d37,_0x37dc9d,_0x4edc12,_0x1e478d){const _0x379432=a92_0x1e89,_0x1c96a8=serializeRule(_0x37dc9d);if(_0x4edc12[_0x379432(0x180)]){const _0x53c07d=_0x4edc12[_0x379432(0x180)][_0x379432(0x166)](_0x1c96a8);if(_0x53c07d)return{'name':_0x53c07d,'isDuplicate':![],'isLocalMatch':!![]};}const _0x203ed6=_0x4edc12[_0x379432(0x13c)]['get'](_0x1c96a8);if(_0x203ed6)return{'name':_0x203ed6,'isDuplicate':!![],'isLocalMatch':![]};const _0x4247d7=_0x1e478d(_0x100d37);let _0x187950=_0x4247d7||_0x100d37,_0x58f5ea=_0x187950,_0x18d09b=0x2;while(_0x4edc12['usedNames'][_0x379432(0x164)](_0x58f5ea)){_0x58f5ea=_0x187950+'_'+_0x18d09b,_0x18d09b++;}return _0x4edc12['usedNames'][_0x379432(0x14e)](_0x58f5ea),_0x4edc12[_0x379432(0x13c)]['set'](_0x1c96a8,_0x58f5ea),{'name':_0x58f5ea,'isDuplicate':![],'isLocalMatch':![]};}export function collectSegmentRefsFromRule(_0x2e3c0f){const _0x1f4f87=[],_0x2a7658=_0x3573bd=>{const _0x3acc77=a92_0x1e89;if(!_0x3573bd||typeof _0x3573bd!==_0x3acc77(0x144))return;if(Array[_0x3acc77(0x189)](_0x3573bd)){_0x3573bd[_0x3acc77(0x188)](_0x2a7658);return;}const _0x282608=_0x3573bd;(_0x282608[_0x3acc77(0x152)]==='include'||_0x282608[_0x3acc77(0x152)]==='exclude')&&typeof _0x282608[_0x3acc77(0x167)]===_0x3acc77(0x121)&&_0x1f4f87['push'](_0x282608[_0x3acc77(0x167)]);for(const _0x51246d of Object[_0x3acc77(0x142)](_0x282608)){_0x2a7658(_0x51246d);}};return _0x2a7658(_0x2e3c0f),_0x1f4f87;}export function validateSegmentRule(_0x5b3e80,_0x233055){const _0x1694a7=a92_0x1e89;if(!_0x233055||!_0x233055['conditions'])return;for(let _0x271f66=0x0;_0x271f66<_0x233055[_0x1694a7(0x120)][_0x1694a7(0x101)];_0x271f66++){const _0x6e0898=_0x233055['conditions'][_0x271f66];if(_0x1694a7(0x152)in _0x6e0898&&_0x6e0898[_0x1694a7(0x152)]===_0x1694a7(0x12f)){const _0x1c65c2=_0x6e0898;if(!_0x1c65c2[_0x1694a7(0x137)]||_0x1c65c2['attribute']==='')throw new SDKError(ErrorCode[_0x1694a7(0x15d)],'Invalid\x20condition\x20in\x20embedded\x20segment\x20\x27'+_0x5b3e80+'\x27:\x20'+(_0x1694a7(0x163)+_0x271f66+'].attribute\x20cannot\x20be\x20empty.\x0a')+_0x1694a7(0x16f));}}}
@@ -1 +1 @@
1
- function a93_0x2427(_0x5ad88c,_0x48b44a){_0x5ad88c=_0x5ad88c-0x18f;const _0x1cdf3d=a93_0x1cdf();let _0x24278e=_0x1cdf3d[_0x5ad88c];return _0x24278e;}(function(_0x4151b8,_0x2d002d){const _0x1fe19b=a93_0x2427,_0x20f612=_0x4151b8();while(!![]){try{const _0x42eafa=parseInt(_0x1fe19b(0x1a7))/0x1+parseInt(_0x1fe19b(0x1b2))/0x2*(-parseInt(_0x1fe19b(0x18f))/0x3)+parseInt(_0x1fe19b(0x195))/0x4+parseInt(_0x1fe19b(0x1c2))/0x5*(-parseInt(_0x1fe19b(0x1b3))/0x6)+parseInt(_0x1fe19b(0x1ba))/0x7+parseInt(_0x1fe19b(0x1bc))/0x8*(parseInt(_0x1fe19b(0x199))/0x9)+parseInt(_0x1fe19b(0x197))/0xa*(-parseInt(_0x1fe19b(0x1aa))/0xb);if(_0x42eafa===_0x2d002d)break;else _0x20f612['push'](_0x20f612['shift']());}catch(_0x52662f){_0x20f612['push'](_0x20f612['shift']());}}}(a93_0x1cdf,0xb4afd));import a93_0x1d211c from'chalk';import{withProgressSpinner}from'../../utils/spinner.js';export function buildSchemaResult(_0x243a10){const _0x525598=a93_0x2427,_0x2a8565=_0x243a10['columns'][_0x525598(0x1b1)](_0x107875=>({'column_name':_0x107875['name'],'column_type':_0x107875['type'],'null':'YES','key':null,'default':null,'extra':null}));return{..._0x243a10,'columns':[{'name':_0x525598(0x1c1),'type':'varchar'},{'name':_0x525598(0x1ae),'type':_0x525598(0x1a4)},{'name':_0x525598(0x1c5),'type':_0x525598(0x1a4)},{'name':_0x525598(0x193),'type':'varchar'},{'name':_0x525598(0x1b9),'type':_0x525598(0x1a4)},{'name':'extra','type':_0x525598(0x1a4)}],'data':_0x2a8565};}function a93_0x1cdf(){const _0x3b3d4b=['setJobId','2744uSpCPy','tableName','groupingName','length','verbose','column_name','5tVKcqP','execute','bold','null','fields','591MOFaZa','data','startsWith','source','key','entries','3517636HYiXav','localeCompare','1397430aprNJE','parentColumn','20322QcRhXG','Attributes','trim','error','type','Unknown','SELECT\x20*\x20FROM\x20(\x0a','Fetching\x20schema...','set','size','name','varchar','behaviorName','get','562604OuZwGR','slice','parentTableName','143NWYpSL','\x20\x20\x20\x20','attribute','dim','column_type','Behaviors','cyan','map','7322FLorgK','2126286bbbQeq','filter','displayName','information_schema','\x0a)\x20AS\x20segment_query\x20LIMIT\x200','sort','default','9910901TCFUqN'];a93_0x1cdf=function(){return _0x3b3d4b;};return a93_0x1cdf();}export async function executeSchemaQuery(_0x2b682b,_0x4b1512,_0x286ab4){const _0x4cbb8d=a93_0x2427,_0x39ae57=_0x2b682b[_0x4cbb8d(0x19b)]()['replace'](/;+$/,''),_0x32410e=_0x4cbb8d(0x19f)+_0x39ae57+_0x4cbb8d(0x1b7);_0x286ab4[_0x4cbb8d(0x1c0)]&&console[_0x4cbb8d(0x19c)]('Schema\x20query:\x0a'+_0x32410e);const _0x2d7bd6=await withProgressSpinner(_0x4cbb8d(0x1a0),async _0x5f8ef7=>{const _0x1dcfdf=_0x4cbb8d,_0x145b73=await _0x4b1512['query'][_0x1dcfdf(0x1c3)](_0x32410e,{'catalog':'td','schema':_0x1dcfdf(0x1b6),'onJobId':_0x13ba52=>{const _0x3d6499=_0x1dcfdf;_0x5f8ef7[_0x3d6499(0x1bb)](_0x13ba52);}});return _0x145b73;},{'verbose':_0x286ab4['verbose']});return buildSchemaResult(_0x2d7bd6[_0x4cbb8d(0x190)]);}export function displayFieldsHumanReadable(_0x374f84,_0x30033b){const _0x35e7f6=a93_0x2427,_0x5a03dd=_0x374f84['filter'](_0x883b93=>_0x883b93[_0x35e7f6(0x192)]===_0x35e7f6(0x1ac)),_0x5a7fae=_0x374f84[_0x35e7f6(0x1b4)](_0x3a7d71=>_0x3a7d71[_0x35e7f6(0x192)]==='behavior'),_0xdd6c67=new Map();for(const _0x145d66 of _0x5a03dd){const _0x10e4a2=_0x145d66[_0x35e7f6(0x1be)]||_0x145d66['parentTableName']||_0x35e7f6(0x19e),_0x257274=_0xdd6c67['get'](_0x10e4a2);_0x257274?_0x257274[_0x35e7f6(0x1c6)]['push'](_0x145d66):_0xdd6c67[_0x35e7f6(0x1a1)](_0x10e4a2,{'displayName':_0x10e4a2,'tableName':_0x145d66['parentTableName'],'fields':[_0x145d66]});}const _0x4a0032=new Map();for(const _0x5387b8 of _0x5a7fae){const _0x4e56f0=_0x5387b8[_0x35e7f6(0x1a5)]||'Unknown',_0x225dae=_0x4a0032[_0x35e7f6(0x1a6)](_0x4e56f0)||[];_0x225dae['push'](_0x5387b8),_0x4a0032['set'](_0x4e56f0,_0x225dae);}console[_0x35e7f6(0x19c)]('\x0a'+a93_0x1d211c[_0x35e7f6(0x1c4)](_0x30033b));if(_0xdd6c67[_0x35e7f6(0x1a2)]>0x0){console['error']('\x0a'+a93_0x1d211c[_0x35e7f6(0x1ad)](_0x35e7f6(0x19a)));const _0xfb840a=[..._0xdd6c67[_0x35e7f6(0x194)]()][_0x35e7f6(0x1b8)]((_0x2c8793,_0x134717)=>_0x2c8793[0x0][_0x35e7f6(0x196)](_0x134717[0x0]));for(const [,_0x22158b]of _0xfb840a){const _0x56b077=_0x22158b[_0x35e7f6(0x1bd)]&&_0x22158b[_0x35e7f6(0x1bd)]!==_0x22158b[_0x35e7f6(0x1b5)]?'\x20'+a93_0x1d211c[_0x35e7f6(0x1ad)]('('+_0x22158b[_0x35e7f6(0x1bd)]+')'):'';console[_0x35e7f6(0x19c)]('\x20\x20'+a93_0x1d211c['bold'](_0x22158b['displayName'])+_0x56b077);const _0x424a27=[..._0x22158b[_0x35e7f6(0x1c6)]]['sort']((_0x419a30,_0x7971e6)=>_0x419a30[_0x35e7f6(0x1a3)][_0x35e7f6(0x196)](_0x7971e6['name']));for(const _0x2b293a of _0x424a27){const _0x4bac9b=_0x2b293a[_0x35e7f6(0x198)]&&_0x2b293a[_0x35e7f6(0x198)]!==_0x2b293a[_0x35e7f6(0x1a3)]?'\x20'+a93_0x1d211c[_0x35e7f6(0x1ad)]('('+_0x2b293a[_0x35e7f6(0x198)]+')'):'';console['error']('\x20\x20\x20\x20'+_0x2b293a[_0x35e7f6(0x1a3)]+_0x4bac9b+':\x20'+a93_0x1d211c[_0x35e7f6(0x1b0)](_0x2b293a[_0x35e7f6(0x19d)]));}}}if(_0x4a0032['size']>0x0){console[_0x35e7f6(0x19c)]('\x0a'+a93_0x1d211c[_0x35e7f6(0x1ad)](_0x35e7f6(0x1af)));const _0x419cc3=[..._0x4a0032[_0x35e7f6(0x194)]()]['sort']((_0x2a1eba,_0x488c99)=>_0x2a1eba[0x0][_0x35e7f6(0x196)](_0x488c99[0x0]));for(const [_0x17bc6d,_0x41324f]of _0x419cc3){const _0x12a935=_0x41324f[0x0],_0x513861=_0x12a935?.[_0x35e7f6(0x1a9)]||'';console[_0x35e7f6(0x19c)]('\x20\x20'+a93_0x1d211c[_0x35e7f6(0x1c4)](_0x17bc6d)+(_0x513861?'\x20'+a93_0x1d211c[_0x35e7f6(0x1ad)]('('+_0x513861+')'):''));const _0x317f64=[..._0x41324f]['sort']((_0x3017ee,_0x24457f)=>_0x3017ee[_0x35e7f6(0x1a3)]['localeCompare'](_0x24457f[_0x35e7f6(0x1a3)]));for(const _0x2d5b6a of _0x317f64){const _0x2dcfaa=_0x2d5b6a[_0x35e7f6(0x1a3)][_0x35e7f6(0x191)](_0x17bc6d+'.')?_0x2d5b6a[_0x35e7f6(0x1a3)][_0x35e7f6(0x1a8)](_0x17bc6d[_0x35e7f6(0x1bf)]+0x1):_0x2d5b6a[_0x35e7f6(0x1a3)],_0x1c859d=_0x2d5b6a['parentColumn']&&_0x2d5b6a['parentColumn']!==_0x2dcfaa?'\x20'+a93_0x1d211c[_0x35e7f6(0x1ad)]('('+_0x2d5b6a[_0x35e7f6(0x198)]+')'):'';console['error'](_0x35e7f6(0x1ab)+_0x2dcfaa+_0x1c859d+':\x20'+a93_0x1d211c[_0x35e7f6(0x1b0)](_0x2d5b6a['type']));}}}console[_0x35e7f6(0x19c)]('');}
1
+ (function(_0x5082e0,_0x3575d9){const _0xbe2f17=a93_0x278b,_0x2ddd7b=_0x5082e0();while(!![]){try{const _0x3b07cf=parseInt(_0xbe2f17(0x19d))/0x1+-parseInt(_0xbe2f17(0x1bf))/0x2*(parseInt(_0xbe2f17(0x1a2))/0x3)+-parseInt(_0xbe2f17(0x1ae))/0x4+parseInt(_0xbe2f17(0x18d))/0x5*(-parseInt(_0xbe2f17(0x19b))/0x6)+parseInt(_0xbe2f17(0x191))/0x7+parseInt(_0xbe2f17(0x1a5))/0x8+-parseInt(_0xbe2f17(0x189))/0x9*(-parseInt(_0xbe2f17(0x1b7))/0xa);if(_0x3b07cf===_0x3575d9)break;else _0x2ddd7b['push'](_0x2ddd7b['shift']());}catch(_0x1cf63d){_0x2ddd7b['push'](_0x2ddd7b['shift']());}}}(a93_0x10a7,0x25e5e));import a93_0x422614 from'chalk';import{withProgressSpinner}from'../../utils/spinner.js';export function buildSchemaResult(_0x5c6a84){const _0x2ed178=a93_0x278b,_0x377828=_0x5c6a84[_0x2ed178(0x1b4)][_0x2ed178(0x18f)](_0x3daca1=>({'column_name':_0x3daca1[_0x2ed178(0x194)],'column_type':_0x3daca1[_0x2ed178(0x1b8)],'null':_0x2ed178(0x1b2),'key':null,'default':null,'extra':null}));return{..._0x5c6a84,'columns':[{'name':_0x2ed178(0x1b0),'type':_0x2ed178(0x1af)},{'name':_0x2ed178(0x1bc),'type':_0x2ed178(0x1af)},{'name':_0x2ed178(0x18e),'type':_0x2ed178(0x1af)},{'name':_0x2ed178(0x1be),'type':_0x2ed178(0x1af)},{'name':'default','type':_0x2ed178(0x1af)},{'name':'extra','type':_0x2ed178(0x1af)}],'data':_0x377828};}function a93_0x278b(_0x22f0f0,_0x1154b5){_0x22f0f0=_0x22f0f0-0x189;const _0x10a73a=a93_0x10a7();let _0x278b3b=_0x10a73a[_0x22f0f0];return _0x278b3b;}export async function executeSchemaQuery(_0x241ea4,_0x38b7e1,_0x39eb2e){const _0x5eb779=a93_0x278b,_0x583fb0=_0x241ea4[_0x5eb779(0x1ad)]()[_0x5eb779(0x1ab)](/;+$/,''),_0x294aac=_0x5eb779(0x18a)+_0x583fb0+_0x5eb779(0x1aa);_0x39eb2e['verbose']&&console[_0x5eb779(0x190)](_0x5eb779(0x1bb)+_0x294aac);const _0x4bac2c=await withProgressSpinner(_0x5eb779(0x1b6),async _0x3dde29=>{const _0x48e73f=_0x5eb779,_0x249670=await _0x38b7e1['query'][_0x48e73f(0x18c)](_0x294aac,{'catalog':'td','schema':_0x48e73f(0x1b3),'onJobId':_0x2d3c07=>{const _0x2835d5=_0x48e73f;_0x3dde29[_0x2835d5(0x1a7)](_0x2d3c07);}});return _0x249670;},{'verbose':_0x39eb2e[_0x5eb779(0x197)]});return buildSchemaResult(_0x4bac2c['data']);}export function displayFieldsHumanReadable(_0x56d9b1,_0xf441b6){const _0x19fc44=a93_0x278b,_0x156f6e=_0x56d9b1[_0x19fc44(0x19f)](_0xa30ddf=>_0xa30ddf[_0x19fc44(0x19e)]===_0x19fc44(0x1b5)),_0x3bd3bc=_0x56d9b1['filter'](_0x4c05c4=>_0x4c05c4[_0x19fc44(0x19e)]===_0x19fc44(0x1a0)),_0x3f2f88=new Map();for(const _0x3d529f of _0x156f6e){const _0x4195cb=_0x3d529f[_0x19fc44(0x1ba)]||_0x3d529f[_0x19fc44(0x1a3)]||_0x19fc44(0x18b),_0x2fc38c=_0x3f2f88['get'](_0x4195cb);_0x2fc38c?_0x2fc38c['fields'][_0x19fc44(0x1a4)](_0x3d529f):_0x3f2f88['set'](_0x4195cb,{'displayName':_0x4195cb,'tableName':_0x3d529f[_0x19fc44(0x1a3)],'fields':[_0x3d529f]});}const _0x1b32d0=new Map();for(const _0x27011d of _0x3bd3bc){const _0x1e9e66=_0x27011d[_0x19fc44(0x193)]||_0x19fc44(0x18b),_0x3fa60e=_0x1b32d0['get'](_0x1e9e66)||[];_0x3fa60e[_0x19fc44(0x1a4)](_0x27011d),_0x1b32d0[_0x19fc44(0x19c)](_0x1e9e66,_0x3fa60e);}console[_0x19fc44(0x190)]('\x0a'+a93_0x422614[_0x19fc44(0x195)](_0xf441b6));if(_0x3f2f88[_0x19fc44(0x1a1)]>0x0){console[_0x19fc44(0x190)]('\x0a'+a93_0x422614['dim']('Attributes'));const _0x2ab393=[..._0x3f2f88[_0x19fc44(0x198)]()][_0x19fc44(0x19a)]((_0x1a805b,_0x26f870)=>_0x1a805b[0x0][_0x19fc44(0x192)](_0x26f870[0x0]));for(const [,_0x235792]of _0x2ab393){const _0x1d005e=_0x235792[_0x19fc44(0x1a6)]&&_0x235792['tableName']!==_0x235792[_0x19fc44(0x1a8)]?'\x20'+a93_0x422614[_0x19fc44(0x1ac)]('('+_0x235792[_0x19fc44(0x1a6)]+')'):'';console['error']('\x20\x20'+a93_0x422614[_0x19fc44(0x195)](_0x235792[_0x19fc44(0x1a8)])+_0x1d005e);const _0x49ebe1=[..._0x235792[_0x19fc44(0x196)]]['sort']((_0x17c330,_0x34c82c)=>_0x17c330[_0x19fc44(0x194)]['localeCompare'](_0x34c82c[_0x19fc44(0x194)]));for(const _0x5e44bb of _0x49ebe1){const _0x1bed5b=_0x5e44bb[_0x19fc44(0x1b9)]&&_0x5e44bb['parentColumn']!==_0x5e44bb[_0x19fc44(0x194)]?'\x20'+a93_0x422614[_0x19fc44(0x1ac)]('('+_0x5e44bb[_0x19fc44(0x1b9)]+')'):'';console['error']('\x20\x20\x20\x20'+_0x5e44bb['name']+_0x1bed5b+':\x20'+a93_0x422614[_0x19fc44(0x1a9)](_0x5e44bb[_0x19fc44(0x1b8)]));}}}if(_0x1b32d0[_0x19fc44(0x1a1)]>0x0){console['error']('\x0a'+a93_0x422614[_0x19fc44(0x1ac)](_0x19fc44(0x1b1)));const _0x536b52=[..._0x1b32d0['entries']()][_0x19fc44(0x19a)]((_0x3c3282,_0x373638)=>_0x3c3282[0x0]['localeCompare'](_0x373638[0x0]));for(const [_0x1885a7,_0x5967fc]of _0x536b52){const _0x39eace=_0x5967fc[0x0],_0x35452f=_0x39eace?.['parentTableName']||'';console[_0x19fc44(0x190)]('\x20\x20'+a93_0x422614[_0x19fc44(0x195)](_0x1885a7)+(_0x35452f?'\x20'+a93_0x422614[_0x19fc44(0x1ac)]('('+_0x35452f+')'):''));const _0x2e4325=[..._0x5967fc][_0x19fc44(0x19a)]((_0x45c1e4,_0x50953c)=>_0x45c1e4[_0x19fc44(0x194)][_0x19fc44(0x192)](_0x50953c[_0x19fc44(0x194)]));for(const _0x197012 of _0x2e4325){const _0x5a80f1=_0x197012[_0x19fc44(0x194)][_0x19fc44(0x1bd)](_0x1885a7+'.')?_0x197012[_0x19fc44(0x194)]['slice'](_0x1885a7['length']+0x1):_0x197012[_0x19fc44(0x194)],_0x27abbd=_0x197012[_0x19fc44(0x1b9)]&&_0x197012['parentColumn']!==_0x5a80f1?'\x20'+a93_0x422614[_0x19fc44(0x1ac)]('('+_0x197012[_0x19fc44(0x1b9)]+')'):'';console[_0x19fc44(0x190)](_0x19fc44(0x199)+_0x5a80f1+_0x27abbd+':\x20'+a93_0x422614[_0x19fc44(0x1a9)](_0x197012[_0x19fc44(0x1b8)]));}}}console[_0x19fc44(0x190)]('');}function a93_0x10a7(){const _0x2d2677=['SELECT\x20*\x20FROM\x20(\x0a','Unknown','execute','1205smQjDQ','null','map','error','1046143teCpya','localeCompare','behaviorName','name','bold','fields','verbose','entries','\x20\x20\x20\x20','sort','930ErFoWf','set','106801GoJXwO','source','filter','behavior','size','4335DSeaqO','parentTableName','push','676264lCBvuP','tableName','setJobId','displayName','cyan','\x0a)\x20AS\x20segment_query\x20LIMIT\x200','replace','dim','trim','619056SpVHje','varchar','column_name','Behaviors','YES','information_schema','columns','attribute','Fetching\x20schema...','20770paPnGQ','type','parentColumn','groupingName','Schema\x20query:\x0a','column_type','startsWith','key','402idrxtm','1287Mnbldt'];a93_0x10a7=function(){return _0x2d2677;};return a93_0x10a7();}
@@ -1 +1 @@
1
- function a94_0x2831(_0x315a84,_0x1389d9){_0x315a84=_0x315a84-0xb4;const _0x4e72d3=a94_0x4e72();let _0x2831df=_0x4e72d3[_0x315a84];return _0x2831df;}(function(_0x502023,_0x5be2bb){const _0xe85514=a94_0x2831,_0x212806=_0x502023();while(!![]){try{const _0x24a50e=parseInt(_0xe85514(0xb9))/0x1*(parseInt(_0xe85514(0xb7))/0x2)+-parseInt(_0xe85514(0xbc))/0x3+-parseInt(_0xe85514(0xb4))/0x4+-parseInt(_0xe85514(0xb6))/0x5+-parseInt(_0xe85514(0xc0))/0x6+-parseInt(_0xe85514(0xbd))/0x7+parseInt(_0xe85514(0xc1))/0x8;if(_0x24a50e===_0x5be2bb)break;else _0x212806['push'](_0x212806['shift']());}catch(_0x46eb73){_0x212806['push'](_0x212806['shift']());}}}(a94_0x4e72,0xecfdc));import{readdirSync,statSync}from'fs';import a94_0x413fc8 from'path';function a94_0x4e72(){const _0x543b6c=['2666523SWJsUv','735434wLHeXV','.yaml','endsWith','3407232dTuGSv','40418640woOTsH','dirname','push','.yml','join','extname','5130328yPCdLR','isDirectory','7468845tuSnSc','16032AQfBhT','toLowerCase','32tsCxJB','name','relative'];a94_0x4e72=function(){return _0x543b6c;};return a94_0x4e72();}export function findYamlFiles(_0xb3528d){const _0xb2a05f=[];function _0x25ba85(_0x5081dc){const _0x3506f5=a94_0x2831,_0x11e24b=readdirSync(_0x5081dc,{'withFileTypes':!![]});for(const _0x32fbcf of _0x11e24b){const _0x918aaa=a94_0x413fc8[_0x3506f5(0xc5)](_0x5081dc,_0x32fbcf[_0x3506f5(0xba)]);if(_0x32fbcf[_0x3506f5(0xb5)]())_0x25ba85(_0x918aaa);else(_0x32fbcf[_0x3506f5(0xba)][_0x3506f5(0xbf)]('.yml')||_0x32fbcf[_0x3506f5(0xba)][_0x3506f5(0xbf)](_0x3506f5(0xbe)))&&_0xb2a05f[_0x3506f5(0xc3)](_0x918aaa);}}return _0x25ba85(_0xb3528d),_0xb2a05f;}export function discoverYamlFiles(_0x251618){const _0x436878=findYamlFiles(_0x251618);return _0x436878['map'](_0x32d461=>{const _0x2b0d0b=a94_0x2831,_0x348a49=a94_0x413fc8[_0x2b0d0b(0xbb)](_0x251618,_0x32d461),_0x4806bd=a94_0x413fc8[_0x2b0d0b(0xc2)](_0x348a49);return{'absolutePath':_0x32d461,'relativePath':_0x348a49,'folderPath':_0x4806bd==='.'?'':_0x4806bd};});}export function isYamlFile(_0x4684c7){const _0x231e89=a94_0x2831;try{const _0x3571fb=statSync(_0x4684c7);if(!_0x3571fb['isFile']())return![];const _0x2b0b15=a94_0x413fc8[_0x231e89(0xc6)](_0x4684c7)[_0x231e89(0xb8)]();return _0x2b0b15===_0x231e89(0xc4)||_0x2b0b15===_0x231e89(0xbe);}catch{return![];}}
1
+ (function(_0x3ffd23,_0x290630){const _0xf2d3b0=a94_0x5767,_0x5ccde4=_0x3ffd23();while(!![]){try{const _0x4ba668=parseInt(_0xf2d3b0(0x1f7))/0x1*(-parseInt(_0xf2d3b0(0x1f8))/0x2)+parseInt(_0xf2d3b0(0x1fa))/0x3*(parseInt(_0xf2d3b0(0x1f9))/0x4)+parseInt(_0xf2d3b0(0x204))/0x5*(parseInt(_0xf2d3b0(0x1ff))/0x6)+-parseInt(_0xf2d3b0(0x206))/0x7+-parseInt(_0xf2d3b0(0x202))/0x8*(-parseInt(_0xf2d3b0(0x1fc))/0x9)+parseInt(_0xf2d3b0(0x1f5))/0xa*(parseInt(_0xf2d3b0(0x203))/0xb)+parseInt(_0xf2d3b0(0x1f6))/0xc*(-parseInt(_0xf2d3b0(0x1fb))/0xd);if(_0x4ba668===_0x290630)break;else _0x5ccde4['push'](_0x5ccde4['shift']());}catch(_0x203bd4){_0x5ccde4['push'](_0x5ccde4['shift']());}}}(a94_0x1b78,0xac6dc));import{readdirSync,statSync}from'fs';import a94_0x1053d7 from'path';export function findYamlFiles(_0x402d8d){const _0x3b2bf6=[];function _0x36b7dc(_0x257095){const _0x3366dc=a94_0x5767,_0x10d399=readdirSync(_0x257095,{'withFileTypes':!![]});for(const _0x66d751 of _0x10d399){const _0x48d062=a94_0x1053d7[_0x3366dc(0x207)](_0x257095,_0x66d751[_0x3366dc(0x1f4)]);if(_0x66d751[_0x3366dc(0x201)]())_0x36b7dc(_0x48d062);else(_0x66d751['name'][_0x3366dc(0x1ef)](_0x3366dc(0x1f1))||_0x66d751[_0x3366dc(0x1f4)]['endsWith'](_0x3366dc(0x205)))&&_0x3b2bf6[_0x3366dc(0x1fe)](_0x48d062);}}return _0x36b7dc(_0x402d8d),_0x3b2bf6;}function a94_0x5767(_0x26d097,_0x4851c0){_0x26d097=_0x26d097-0x1ee;const _0x1b7859=a94_0x1b78();let _0x576729=_0x1b7859[_0x26d097];return _0x576729;}export function discoverYamlFiles(_0x1fae26){const _0x4ff0da=a94_0x5767,_0xd3bc6=findYamlFiles(_0x1fae26);return _0xd3bc6[_0x4ff0da(0x1fd)](_0x81105e=>{const _0x490860=_0x4ff0da,_0x58bbf7=a94_0x1053d7[_0x490860(0x1ee)](_0x1fae26,_0x81105e),_0x404333=a94_0x1053d7[_0x490860(0x1f3)](_0x58bbf7);return{'absolutePath':_0x81105e,'relativePath':_0x58bbf7,'folderPath':_0x404333==='.'?'':_0x404333};});}export function isYamlFile(_0x8056d9){const _0x12f8c4=a94_0x5767;try{const _0x2af013=statSync(_0x8056d9);if(!_0x2af013[_0x12f8c4(0x200)]())return![];const _0x263c1d=a94_0x1053d7[_0x12f8c4(0x1f0)](_0x8056d9)[_0x12f8c4(0x1f2)]();return _0x263c1d==='.yml'||_0x263c1d===_0x12f8c4(0x205);}catch{return![];}}function a94_0x1b78(){const _0x5a0446=['toLowerCase','dirname','name','5733800GRdgVw','4189944SBMskF','15455yQWJMD','94bZjBPi','12764YeQKGA','21oupAXs','52pzROeK','6003tDFsAW','map','push','6iAsFSO','isFile','isDirectory','11528hvbtbw','22NDdcQR','5559285zJCAcP','.yaml','2889600sGEjkm','join','relative','endsWith','extname','.yml'];a94_0x1b78=function(){return _0x5a0446;};return a94_0x1b78();}
@@ -1 +1 @@
1
- function a95_0x5d05(_0x220284,_0x31c788){_0x220284=_0x220284-0x66;const _0x46b7ca=a95_0x46b7();let _0x5d0510=_0x46b7ca[_0x220284];return _0x5d0510;}(function(_0x52098f,_0x2373a5){const _0x2ce769=a95_0x5d05,_0x53b447=_0x52098f();while(!![]){try{const _0x508b18=parseInt(_0x2ce769(0x77))/0x1*(-parseInt(_0x2ce769(0x90))/0x2)+parseInt(_0x2ce769(0x95))/0x3*(parseInt(_0x2ce769(0xac))/0x4)+parseInt(_0x2ce769(0xad))/0x5*(parseInt(_0x2ce769(0x80))/0x6)+-parseInt(_0x2ce769(0x68))/0x7+parseInt(_0x2ce769(0x88))/0x8*(parseInt(_0x2ce769(0x7e))/0x9)+-parseInt(_0x2ce769(0x7a))/0xa+-parseInt(_0x2ce769(0x83))/0xb*(-parseInt(_0x2ce769(0x79))/0xc);if(_0x508b18===_0x2373a5)break;else _0x53b447['push'](_0x53b447['shift']());}catch(_0x153c13){_0x53b447['push'](_0x53b447['shift']());}}}(a95_0x46b7,0x703c7));import{serializeRule,deepSortObject}from'./child-segment-yaml.js';export const SEGMENT_KIND_JOURNEY=0x3;const MAX_MAPPING_CHAIN_DEPTH=0xa;export function sanitizeYamlKey(_0x4eae0f){const _0x5e238d=a95_0x5d05;return _0x4eae0f[_0x5e238d(0x7c)]()[_0x5e238d(0x89)](/\s+/g,'_')[_0x5e238d(0x89)](/[^a-z0-9_]/g,'')['replace'](/_+/g,'_')[_0x5e238d(0x89)](/^_|_$/g,'');}function a95_0x46b7(){const _0x1a7eff=['6316639szTHKY','entry_criteria','stages','activations','length','all_columns','find','with','versions','state','has','item','object','keys','string','144293fCyPLV','segments','12aRPSmx','4031690BRUoIi','milestone','toLowerCase','index','81KKRUfk','version','11028baaOjy','exit_criteria','description','5630152vKUrEt','journey','bundle_id','decision_point','version_number','588048mVSspA','replace','slice','match','merged','map','join','conditions','8mfJdTZ','latest','isArray','get','connector_config','1064451KyRRGP','goal','values','.yaml','from','columns','branches','draft','set','activation_template_id','launched','notification','condition','segment','type','yaml','name','versionNumber','schedule','activation','journeys','reentry','attributes','4sFhmfD','2215luylTj','null','steps','some','include','behavior','rule','stringify','bundle_name','entries','sort','max'];a95_0x46b7=function(){return _0x1a7eff;};return a95_0x46b7();}export function generateJourneyLocalName(_0x4b307f){const _0xaa8137=a95_0x5d05,_0x1666f7=_0x4b307f[_0xaa8137(0x8b)](/^journey_([a-z_]+)_([0-9a-f-]+)$/i);if(_0x1666f7){const _0x10054d=_0x1666f7[0x1][_0xaa8137(0x7c)](),_0x40b9a5=_0x1666f7[0x2],_0x3b1c5d=_0x40b9a5[_0xaa8137(0x89)](/-/g,'')[_0xaa8137(0x8a)](0x0,0x4)[_0xaa8137(0x7c)]();return _0x10054d+'_'+_0x3b1c5d;}const _0x56a66c=_0x4b307f[_0xaa8137(0x8b)](/^journey_\d+_stage_\d+_step_([0-9a-f-]+)_([a-z_]+)$/i);if(_0x56a66c){const _0x1ff302=_0x56a66c[0x1],_0x5604ab=_0x56a66c[0x2][_0xaa8137(0x7c)](),_0x101c05=_0x1ff302[_0xaa8137(0x89)](/-/g,'')[_0xaa8137(0x8a)](0x0,0x4)['toLowerCase']();return _0x5604ab+'_'+_0x101c05;}return undefined;}function stableStringify(_0x5ed6c7){const _0x48b9bd=a95_0x5d05;if(Array[_0x48b9bd(0x92)](_0x5ed6c7))return'['+_0x5ed6c7['map'](_0x681258=>stableStringify(_0x681258))['join'](',')+']';if(_0x5ed6c7&&typeof _0x5ed6c7===_0x48b9bd(0x74)){const _0xa195c8=_0x5ed6c7,_0x1a9dfb=Object[_0x48b9bd(0x75)](_0xa195c8)[_0x48b9bd(0x66)](),_0x51e1fb=_0x1a9dfb[_0x48b9bd(0x8d)](_0x192124=>'\x22'+_0x192124+'\x22:'+stableStringify(_0xa195c8[_0x192124]));return'{'+_0x51e1fb[_0x48b9bd(0x8e)](',')+'}';}const _0x4fe179=JSON['stringify'](_0x5ed6c7);return _0x4fe179===undefined?_0x48b9bd(0xae):_0x4fe179;}export function consolidateActivationsByContent(_0x28577a){const _0x2c76f3=a95_0x5d05,_0x4b20df={},_0x48f71d=new Map(),_0x5ddf82=new Map();for(const _0x166b8a of _0x28577a){if(!_0x166b8a)continue;for(const [_0x1b338b,_0x304721]of Object[_0x2c76f3(0xb6)](_0x166b8a)){const _0x440a3f={'connection':_0x304721['connection'],..._0x304721[_0x2c76f3(0x6d)]!==undefined&&{'all_columns':_0x304721['all_columns']},..._0x304721[_0x2c76f3(0x9a)]!==undefined&&{'columns':_0x304721[_0x2c76f3(0x9a)]},..._0x304721[_0x2c76f3(0xb2)]!==undefined&&{'behavior':_0x304721[_0x2c76f3(0xb2)]},..._0x304721[_0x2c76f3(0xa7)]!==undefined&&{'schedule':_0x304721[_0x2c76f3(0xa7)]},..._0x304721[_0x2c76f3(0xa0)]!==undefined&&{'notification':_0x304721['notification']},..._0x304721[_0x2c76f3(0x94)]!==undefined&&{'connector_config':_0x304721['connector_config']},..._0x304721[_0x2c76f3(0x9e)]!==undefined&&{'activation_template_id':_0x304721['activation_template_id']}},_0xbe8da7=stableStringify(_0x440a3f),_0x3bbee5=_0x5ddf82['get'](_0xbe8da7);_0x3bbee5?_0x48f71d[_0x2c76f3(0x9d)](_0x1b338b,_0x3bbee5):(_0x4b20df[_0x1b338b]=_0x304721,_0x48f71d['set'](_0x1b338b,_0x1b338b),_0x5ddf82[_0x2c76f3(0x9d)](_0xbe8da7,_0x1b338b));}}return{'merged':_0x4b20df,'nameMapping':_0x48f71d};}export function updateActivationReferences(_0x281cc2,_0x151c19){const _0x5362ad=a95_0x5d05;if(!_0x281cc2)return;for(const _0x478738 of _0x281cc2){if(!_0x478738['steps'])continue;for(const _0x11fc5d of _0x478738['steps']){if(_0x11fc5d['type']==='activation'&&_0x11fc5d['with']?.[_0x5362ad(0xa8)]){const _0x5ed83d=_0x151c19[_0x5362ad(0x93)](_0x11fc5d['with'][_0x5362ad(0xa8)]);_0x5ed83d&&_0x5ed83d!==_0x11fc5d[_0x5362ad(0x6f)][_0x5362ad(0xa8)]&&(_0x11fc5d[_0x5362ad(0x6f)][_0x5362ad(0xa8)]=_0x5ed83d);}}}}export function consolidateSegmentsByContent(_0xbd939e,_0x179002){const _0x2a20f6=a95_0x5d05,_0x4a4978={},_0x40ac45=new Map(),_0x3cd152=new Map();for(const _0x3eaa7c of _0xbd939e){if(!_0x3eaa7c)continue;for(const [_0x3678c1,_0x5a4d8a]of Object[_0x2a20f6(0xb6)](_0x3eaa7c)){if(!_0x5a4d8a['rule']){_0x4a4978[_0x3678c1]=_0x5a4d8a,_0x40ac45[_0x2a20f6(0x9d)](_0x3678c1,_0x3678c1);continue;}const _0x38ae82=_0x5a4d8a[_0x2a20f6(0x82)]&&_0x5a4d8a[_0x2a20f6(0x82)]['trim']()?_0x5a4d8a['description']:undefined,_0x597c57=JSON[_0x2a20f6(0xb4)]({'description':_0x38ae82,'rule':deepSortObject(_0x5a4d8a[_0x2a20f6(0xb3)])}),_0x11a674=_0x3cd152[_0x2a20f6(0x93)](_0x597c57);if(_0x11a674){const _0x38622c={..._0x5a4d8a['description']!==undefined&&{'description':_0x5a4d8a[_0x2a20f6(0x82)]},'rule':_0x5a4d8a[_0x2a20f6(0xb3)]?deepSortObject(_0x5a4d8a['rule']):_0x5a4d8a[_0x2a20f6(0xb3)]};if(_0x3678c1<_0x11a674){_0x4a4978[_0x3678c1]=_0x38622c,delete _0x4a4978[_0x11a674];for(const [_0x3c6be5,_0x47b78e]of _0x40ac45[_0x2a20f6(0xb6)]()){_0x47b78e===_0x11a674&&_0x40ac45[_0x2a20f6(0x9d)](_0x3c6be5,_0x3678c1);}_0x40ac45[_0x2a20f6(0x9d)](_0x3678c1,_0x3678c1),_0x3cd152[_0x2a20f6(0x9d)](_0x597c57,_0x3678c1);}else _0x4a4978[_0x11a674]=_0x38622c,_0x40ac45[_0x2a20f6(0x9d)](_0x3678c1,_0x11a674);}else{let _0x1edabd=_0x3678c1;if(_0x179002){const _0x3e53f3=_0x179002[_0x2a20f6(0x93)](_0x597c57);_0x3e53f3&&_0x3e53f3['length']>0x0&&(_0x1edabd=_0x3e53f3[_0x2a20f6(0x8a)]()[_0x2a20f6(0x66)]()[0x0]);}const _0x1a49fe={..._0x5a4d8a[_0x2a20f6(0x82)]!==undefined&&{'description':_0x5a4d8a['description']},'rule':_0x5a4d8a[_0x2a20f6(0xb3)]?deepSortObject(_0x5a4d8a['rule']):_0x5a4d8a['rule']};_0x4a4978[_0x1edabd]=_0x1a49fe,_0x40ac45[_0x2a20f6(0x9d)](_0x3678c1,_0x1edabd),_0x3cd152['set'](_0x597c57,_0x1edabd);}}}return{'merged':_0x4a4978,'nameMapping':_0x40ac45};}export function updateSegmentReferences(_0x2edc2d,_0x3bdccf){const _0x20c7ee=a95_0x5d05;if(!_0x2edc2d)return;for(const _0x1606cb of _0x2edc2d){if(_0x1606cb[_0x20c7ee(0x69)]?.[_0x20c7ee(0xa2)]){const _0x2e47bc=_0x3bdccf[_0x20c7ee(0x93)](_0x1606cb[_0x20c7ee(0x69)][_0x20c7ee(0xa2)]);_0x2e47bc&&(_0x1606cb[_0x20c7ee(0x69)][_0x20c7ee(0xa2)]=_0x2e47bc);}if(_0x1606cb[_0x20c7ee(0xaf)])for(const _0x1a1d91 of _0x1606cb[_0x20c7ee(0xaf)]){if(_0x1a1d91[_0x20c7ee(0xa3)]===_0x20c7ee(0x86)&&_0x1a1d91[_0x20c7ee(0x6f)]?.[_0x20c7ee(0x9b)])for(const _0x4539d9 of _0x1a1d91[_0x20c7ee(0x6f)]['branches']){if(_0x4539d9[_0x20c7ee(0xa2)]){const _0x43fc72=_0x3bdccf[_0x20c7ee(0x93)](_0x4539d9[_0x20c7ee(0xa2)]);_0x43fc72&&(_0x4539d9[_0x20c7ee(0xa2)]=_0x43fc72);}}}}}export function updateSegmentRefsInSegments(_0x403b38,_0x49d172){const _0x38c0db=a95_0x5d05;for(const _0x3f60db of Object[_0x38c0db(0x97)](_0x403b38)){_0x3f60db['rule']&&updateSegmentRefsInRule(_0x3f60db[_0x38c0db(0xb3)],_0x49d172);}}function updateSegmentRefsInRule(_0x5039b9,_0x38ce8e){const _0x4be76c=a95_0x5d05;if(_0x5039b9===null||typeof _0x5039b9!==_0x4be76c(0x74))return;if(Array['isArray'](_0x5039b9)){for(const _0x3e33a4 of _0x5039b9){updateSegmentRefsInRule(_0x3e33a4,_0x38ce8e);}return;}const _0x3200c8=_0x5039b9;if((_0x3200c8['type']===_0x4be76c(0xb1)||_0x3200c8[_0x4be76c(0xa3)]==='exclude')&&typeof _0x3200c8[_0x4be76c(0xa2)]===_0x4be76c(0x76)){const _0x1245fa=_0x38ce8e[_0x4be76c(0x93)](_0x3200c8[_0x4be76c(0xa2)]);_0x1245fa&&(_0x3200c8[_0x4be76c(0xa2)]=_0x1245fa);}if(_0x3200c8[_0x4be76c(0x8f)]&&Array[_0x4be76c(0x92)](_0x3200c8[_0x4be76c(0x8f)]))for(const _0xda33c5 of _0x3200c8[_0x4be76c(0x8f)]){updateSegmentRefsInRule(_0xda33c5,_0x38ce8e);}}export function buildJourneysArray(_0x2aa91a){const _0x1c5d0c=a95_0x5d05,_0x7f6daa=Math[_0x1c5d0c(0x67)](..._0x2aa91a[_0x1c5d0c(0x8d)](_0xe0c7c=>_0xe0c7c[_0x1c5d0c(0x73)][_0x1c5d0c(0xa6)]||0x0));return _0x2aa91a[_0x1c5d0c(0x8d)](_0x31aae6=>{const _0x30214d=_0x1c5d0c,_0x5daae5=(_0x31aae6[_0x30214d(0x73)][_0x30214d(0xa6)]||0x0)===_0x7f6daa,_0x4831f3=_0x31aae6[_0x30214d(0xa4)][_0x30214d(0xa9)]?.[0x0],_0x246fb5={'version':_0x4831f3?.[_0x30214d(0x7f)]||_0x31aae6[_0x30214d(0xa4)][_0x30214d(0x7f)]||_0x31aae6[_0x30214d(0x73)]['name'],'state':_0x31aae6[_0x30214d(0x73)][_0x30214d(0x71)]===_0x30214d(0x9f)?_0x30214d(0x9f):_0x30214d(0x9c),'stages':_0x4831f3?.[_0x30214d(0x6a)]||_0x31aae6[_0x30214d(0xa4)]['stages']||[],'id':_0x4831f3?.['id']||_0x31aae6[_0x30214d(0xa4)]['id'],'version_number':_0x4831f3?.[_0x30214d(0x87)]||_0x31aae6[_0x30214d(0xa4)]['version_number']};return _0x5daae5&&(_0x246fb5[_0x30214d(0x91)]=!![]),_0x246fb5;});}export function buildMergedJourneyDef(_0x2ebee7,_0x1dbeb1){const _0x53fa83=a95_0x5d05,_0x1f55d4=_0x2ebee7[0x0][_0x53fa83(0xa4)],_0x593a3f=buildJourneysArray(_0x2ebee7),{merged:_0x251d74,nameMapping:_0x2b528a}=consolidateSegmentsByContent(_0x2ebee7['map'](_0x4cf51d=>_0x4cf51d[_0x53fa83(0xa4)]['segments']),_0x1dbeb1);updateSegmentRefsInSegments(_0x251d74,_0x2b528a);const _0x52ce6d=Array[_0x53fa83(0x99)](_0x2b528a[_0x53fa83(0xb6)]())[_0x53fa83(0xb0)](([_0x16bf2c,_0x1ba014])=>_0x16bf2c!==_0x1ba014&&_0x16bf2c['startsWith'](_0x53fa83(0x69)));let _0x1fbc65=_0x251d74,_0x4c843c=new Map();if(_0x52ce6d){const _0x5e7d1b=consolidateSegmentsByContent([_0x251d74],_0x1dbeb1);_0x1fbc65=_0x5e7d1b[_0x53fa83(0x8c)],_0x4c843c=_0x5e7d1b['nameMapping'];}const _0x59fa2f=new Map(_0x2b528a);for(const [_0x20ca6e,_0x573bd4]of _0x4c843c[_0x53fa83(0xb6)]()){_0x59fa2f[_0x53fa83(0x9d)](_0x20ca6e,_0x573bd4);}for(const [_0x3ede20,_0xac9e48]of _0x59fa2f[_0x53fa83(0xb6)]()){let _0x21c09b=_0xac9e48,_0x586c5c=0x0;while(_0x59fa2f[_0x53fa83(0x72)](_0x21c09b)&&_0x59fa2f[_0x53fa83(0x93)](_0x21c09b)!==_0x21c09b&&_0x586c5c<MAX_MAPPING_CHAIN_DEPTH){_0x21c09b=_0x59fa2f[_0x53fa83(0x93)](_0x21c09b),_0x586c5c++;}_0x21c09b!==_0xac9e48&&_0x59fa2f[_0x53fa83(0x9d)](_0x3ede20,_0x21c09b);}for(const _0x2ffd2e of _0x593a3f){updateSegmentReferences(_0x2ffd2e[_0x53fa83(0x6a)],_0x59fa2f);}const {merged:_0x2c9de5,nameMapping:_0xf7ebc}=consolidateActivationsByContent(_0x2ebee7['map'](_0x101bd7=>_0x101bd7['yaml'][_0x53fa83(0x6b)]));for(const _0x4b7f89 of _0x593a3f){updateActivationReferences(_0x4b7f89[_0x53fa83(0x6a)],_0xf7ebc);}let _0x5036ec=_0x1f55d4[_0x53fa83(0x96)];if(_0x5036ec?.['segment']){const _0x56e232=_0x59fa2f['get'](_0x5036ec[_0x53fa83(0xa2)]);_0x56e232&&(_0x5036ec={..._0x5036ec,'segment':_0x56e232});}for(const _0x43e3f9 of _0x593a3f){if(_0x43e3f9[_0x53fa83(0x96)]?.[_0x53fa83(0xa2)]){const _0x1b29a2=_0x59fa2f['get'](_0x43e3f9[_0x53fa83(0x96)]['segment']);_0x1b29a2&&(_0x43e3f9[_0x53fa83(0x96)]={..._0x43e3f9[_0x53fa83(0x96)],'segment':_0x1b29a2});}}return{'type':_0x53fa83(0x84),'name':_0x1f55d4[_0x53fa83(0xa5)],'description':_0x1f55d4[_0x53fa83(0x82)],'goal':_0x5036ec,'reentry':_0x1f55d4[_0x53fa83(0xaa)],'segments':Object['keys'](_0x1fbc65)['length']>0x0?_0x1fbc65:undefined,'activations':Object[_0x53fa83(0x75)](_0x2c9de5)[_0x53fa83(0x6c)]>0x0?_0x2c9de5:undefined,'journeys':_0x593a3f,'bundle_id':_0x1f55d4[_0x53fa83(0x85)],'bundle_name':_0x1f55d4[_0x53fa83(0xb5)]};}export function createJumpTargetCache(){return new Map();}export async function resolveJumpTarget(_0x1bff2a,_0x440a5e,_0x1b570c,_0x2ce398){const _0x26e540=a95_0x5d05,_0x31c784=_0x1bff2a+':'+_0x440a5e,_0x598a30=_0x1b570c[_0x26e540(0x93)](_0x31c784);if(_0x598a30)return _0x598a30;const _0x21ec9f=await _0x2ce398(_0x1bff2a),_0x510432=_0x21ec9f['attributes']['journeyBundleName']||_0x21ec9f['attributes'][_0x26e540(0xa5)],_0x5bf388=_0x21ec9f[_0x26e540(0xab)]['journeyStages'][_0x26e540(0x6e)](_0x2f68ee=>String(_0x2f68ee['id'])===String(_0x440a5e)),_0xa6d168=_0x5bf388?.['name']||_0x440a5e,_0x430a48={'journeyName':_0x510432,'stageName':_0xa6d168};return _0x1b570c[_0x26e540(0x9d)](_0x31c784,_0x430a48),_0x430a48;}export function formatApiJourneyName(_0x44f4ef,_0x46d4b0){return _0x46d4b0+'\x20('+_0x44f4ef+')';}export function isLocalJourneyRef(_0x9495d9){const _0x4720de=a95_0x5d05;return _0x9495d9['endsWith']('.yml')||_0x9495d9['endsWith'](_0x4720de(0x98));}export function buildLocalRuleToNameMapping(_0x56ffcb){const _0x2f9929=a95_0x5d05,_0x48152d=new Map();if(!_0x56ffcb)return _0x48152d;for(const [_0x4ef9b2,_0x3a285c]of Object['entries'](_0x56ffcb)){if(_0x3a285c['rule']){const _0xe21c9e=serializeRule(_0x3a285c['rule']),_0x32397e=_0x48152d[_0x2f9929(0x93)](_0xe21c9e)||[];_0x32397e['push'](_0x4ef9b2),_0x48152d[_0x2f9929(0x9d)](_0xe21c9e,_0x32397e);}}return _0x48152d;}export function buildLocalRuleToNameMappingFromJourney(_0x25639f){const _0x4db547=a95_0x5d05,_0x221599=_0x25639f[_0x4db547(0x78)];if(!_0x221599)return new Map();const _0x489e9c=collectSegmentUsageCounts(_0x25639f),_0x1a3fb4=new Map();let _0x1d5e55=0x0;for(const [_0x44b665,_0x3fdf6f]of Object[_0x4db547(0xb6)](_0x221599)){if(!_0x3fdf6f[_0x4db547(0xb3)]){_0x1d5e55++;continue;}const _0x637d21=serializeRule(_0x3fdf6f['rule']),_0x5a3fb4=_0x1a3fb4[_0x4db547(0x93)](_0x637d21)||[];_0x5a3fb4['push']({'name':_0x44b665,'index':_0x1d5e55}),_0x1a3fb4[_0x4db547(0x9d)](_0x637d21,_0x5a3fb4),_0x1d5e55++;}const _0x3d0b3b=new Map();for(const [_0x127f9f,_0x22af8a]of _0x1a3fb4){const _0x599fe7=_0x22af8a[_0x4db547(0x8a)]()[_0x4db547(0x66)]((_0x2a3955,_0x40a772)=>{const _0x3b53c9=_0x4db547,_0x58355f=_0x489e9c[_0x3b53c9(0x93)](_0x2a3955[_0x3b53c9(0xa5)])||0x0,_0x1365c0=_0x489e9c[_0x3b53c9(0x93)](_0x40a772[_0x3b53c9(0xa5)])||0x0;if(_0x58355f!==_0x1365c0)return _0x1365c0-_0x58355f;return _0x2a3955['index']-_0x40a772[_0x3b53c9(0x7d)];})[_0x4db547(0x8d)](_0xe50a0c=>_0xe50a0c['name']);_0x3d0b3b[_0x4db547(0x9d)](_0x127f9f,_0x599fe7);}return _0x3d0b3b;}export function collectSegmentUsageCounts(_0x3e63e6){const _0x1a7987=a95_0x5d05,_0x221fe6=new Map(),_0x3fe828=_0x263654=>{const _0x220540=a95_0x5d05;if(!_0x263654)return;_0x221fe6['set'](_0x263654,(_0x221fe6[_0x220540(0x93)](_0x263654)||0x0)+0x1);},_0x23c64b=_0x5586ed=>{const _0x549f17=a95_0x5d05;for(const _0x420cf0 of _0x5586ed){_0x3fe828(_0x420cf0['entry_criteria']?.['segment']);if(_0x420cf0[_0x549f17(0x81)])for(const _0x236e2f of _0x420cf0[_0x549f17(0x81)]){_0x3fe828(_0x236e2f[_0x549f17(0xa2)]);}_0x3fe828(_0x420cf0[_0x549f17(0x7b)]?.[_0x549f17(0xa2)]);if(_0x420cf0['steps'])for(const _0x1225e4 of _0x420cf0[_0x549f17(0xaf)]){if(_0x1225e4[_0x549f17(0xa3)]===_0x549f17(0x86))for(const _0x2fdfbd of _0x1225e4['with'][_0x549f17(0x9b)]){_0x3fe828(_0x2fdfbd[_0x549f17(0xa2)]);}else _0x1225e4[_0x549f17(0xa3)]==='wait'&&_0x3fe828(_0x1225e4[_0x549f17(0x6f)][_0x549f17(0xa1)]?.['segment']);}}};_0x3fe828(_0x3e63e6[_0x1a7987(0x96)]?.[_0x1a7987(0xa2)]);if(_0x3e63e6[_0x1a7987(0xa9)])for(const _0xa7273f of _0x3e63e6[_0x1a7987(0xa9)]){_0x3fe828(_0xa7273f[_0x1a7987(0x96)]?.[_0x1a7987(0xa2)]),_0x23c64b(_0xa7273f['stages']);}_0x3e63e6['stages']&&_0x23c64b(_0x3e63e6['stages']);if(_0x3e63e6[_0x1a7987(0x70)])for(const _0x2e6a6d of _0x3e63e6['versions']){_0x23c64b(_0x2e6a6d[_0x1a7987(0x6a)]);}return _0x221fe6;}
1
+ function a95_0x4e7a(){const _0xacb63a=['reentry','8SvcnXg','versions','map','version','launched','notification','conditions','set','connection','steps','isArray','branches','replace','endsWith','startsWith','342372sSNxsZ','versionNumber','nameMapping','bundle_id','connector_config','name','schedule','push','condition','from','30PRXDZh','activation','journeys','columns','with','state','goal','slice','yaml','344824EIJHQv','.yaml','120445ZppPbr','all_columns','journey','entry_criteria','.yml','attributes','get','83919vzyyGD','42xLLVoG','merged','decision_point','match','keys','rule','description','behavior','entries','has','journeyBundleName','find','version_number','join','toLowerCase','1694STRpbI','bundle_name','activation_template_id','length','index','sort','23ndtJIG','segment','681264ClPHpp','type','segments','latest','include','item','object','stages','stringify','exit_criteria','643555UaRIug','string'];a95_0x4e7a=function(){return _0xacb63a;};return a95_0x4e7a();}(function(_0x187e40,_0x1cf7a3){const _0x5eb0f7=a95_0x3fa3,_0x30464f=_0x187e40();while(!![]){try{const _0x4fddd4=parseInt(_0x5eb0f7(0x10f))/0x1*(parseInt(_0x5eb0f7(0x109))/0x2)+-parseInt(_0x5eb0f7(0xf9))/0x3*(-parseInt(_0x5eb0f7(0x11e))/0x4)+parseInt(_0x5eb0f7(0xf2))/0x5+parseInt(_0x5eb0f7(0xdd))/0x6+parseInt(_0x5eb0f7(0xfa))/0x7*(-parseInt(_0x5eb0f7(0xf0))/0x8)+parseInt(_0x5eb0f7(0x111))/0x9+parseInt(_0x5eb0f7(0xe7))/0xa*(parseInt(_0x5eb0f7(0x11b))/0xb);if(_0x4fddd4===_0x1cf7a3)break;else _0x30464f['push'](_0x30464f['shift']());}catch(_0x58046b){_0x30464f['push'](_0x30464f['shift']());}}}(a95_0x4e7a,0x246b3));import{serializeRule,deepSortObject}from'./child-segment-yaml.js';export const SEGMENT_KIND_JOURNEY=0x3;function a95_0x3fa3(_0x36fb80,_0x1cf871){_0x36fb80=_0x36fb80-0xd0;const _0x4e7af9=a95_0x4e7a();let _0x3fa3fd=_0x4e7af9[_0x36fb80];return _0x3fa3fd;}const MAX_MAPPING_CHAIN_DEPTH=0xa;export function sanitizeYamlKey(_0x12cf1e){const _0x457ccd=a95_0x3fa3;return _0x12cf1e[_0x457ccd(0x108)]()[_0x457ccd(0xda)](/\s+/g,'_')[_0x457ccd(0xda)](/[^a-z0-9_]/g,'')[_0x457ccd(0xda)](/_+/g,'_')[_0x457ccd(0xda)](/^_|_$/g,'');}export function generateJourneyLocalName(_0x41447a){const _0x35ea55=a95_0x3fa3,_0x5adcb6=_0x41447a[_0x35ea55(0xfd)](/^journey_([a-z_]+)_([0-9a-f-]+)$/i);if(_0x5adcb6){const _0x2d3fc7=_0x5adcb6[0x1][_0x35ea55(0x108)](),_0xbfa73a=_0x5adcb6[0x2],_0xb37cbd=_0xbfa73a[_0x35ea55(0xda)](/-/g,'')[_0x35ea55(0xee)](0x0,0x4)[_0x35ea55(0x108)]();return _0x2d3fc7+'_'+_0xb37cbd;}const _0xb05242=_0x41447a[_0x35ea55(0xfd)](/^journey_\d+_stage_\d+_step_([0-9a-f-]+)_([a-z_]+)$/i);if(_0xb05242){const _0x4a787e=_0xb05242[0x1],_0x46a83d=_0xb05242[0x2][_0x35ea55(0x108)](),_0x31e40c=_0x4a787e[_0x35ea55(0xda)](/-/g,'')[_0x35ea55(0xee)](0x0,0x4)[_0x35ea55(0x108)]();return _0x46a83d+'_'+_0x31e40c;}return undefined;}function stableStringify(_0x26f3a3){const _0x17c6cc=a95_0x3fa3;if(Array[_0x17c6cc(0xd8)](_0x26f3a3))return'['+_0x26f3a3['map'](_0x5adad6=>stableStringify(_0x5adad6))[_0x17c6cc(0x107)](',')+']';if(_0x26f3a3&&typeof _0x26f3a3===_0x17c6cc(0x117)){const _0x5c46ce=_0x26f3a3,_0x53feca=Object['keys'](_0x5c46ce)[_0x17c6cc(0x10e)](),_0x1f9fb3=_0x53feca[_0x17c6cc(0xd0)](_0x48fec6=>'\x22'+_0x48fec6+'\x22:'+stableStringify(_0x5c46ce[_0x48fec6]));return'{'+_0x1f9fb3[_0x17c6cc(0x107)](',')+'}';}const _0x19a8e5=JSON[_0x17c6cc(0x119)](_0x26f3a3);return _0x19a8e5===undefined?'null':_0x19a8e5;}export function consolidateActivationsByContent(_0x211a55){const _0x3ff3ba=a95_0x3fa3,_0x529589={},_0x32b89a=new Map(),_0xcfa83d=new Map();for(const _0x46ac32 of _0x211a55){if(!_0x46ac32)continue;for(const [_0x4c872b,_0x2640cc]of Object['entries'](_0x46ac32)){const _0x26fefa={'connection':_0x2640cc[_0x3ff3ba(0xd6)],..._0x2640cc['all_columns']!==undefined&&{'all_columns':_0x2640cc[_0x3ff3ba(0xf3)]},..._0x2640cc[_0x3ff3ba(0xea)]!==undefined&&{'columns':_0x2640cc[_0x3ff3ba(0xea)]},..._0x2640cc[_0x3ff3ba(0x101)]!==undefined&&{'behavior':_0x2640cc['behavior']},..._0x2640cc[_0x3ff3ba(0xe3)]!==undefined&&{'schedule':_0x2640cc[_0x3ff3ba(0xe3)]},..._0x2640cc[_0x3ff3ba(0xd3)]!==undefined&&{'notification':_0x2640cc['notification']},..._0x2640cc['connector_config']!==undefined&&{'connector_config':_0x2640cc[_0x3ff3ba(0xe1)]},..._0x2640cc[_0x3ff3ba(0x10b)]!==undefined&&{'activation_template_id':_0x2640cc[_0x3ff3ba(0x10b)]}},_0x29db6=stableStringify(_0x26fefa),_0x5f4217=_0xcfa83d[_0x3ff3ba(0xf8)](_0x29db6);_0x5f4217?_0x32b89a[_0x3ff3ba(0xd5)](_0x4c872b,_0x5f4217):(_0x529589[_0x4c872b]=_0x2640cc,_0x32b89a[_0x3ff3ba(0xd5)](_0x4c872b,_0x4c872b),_0xcfa83d['set'](_0x29db6,_0x4c872b));}}return{'merged':_0x529589,'nameMapping':_0x32b89a};}export function updateActivationReferences(_0x413342,_0x2fe506){const _0x5ecac2=a95_0x3fa3;if(!_0x413342)return;for(const _0xb1501a of _0x413342){if(!_0xb1501a[_0x5ecac2(0xd7)])continue;for(const _0x2dd450 of _0xb1501a['steps']){if(_0x2dd450[_0x5ecac2(0x112)]===_0x5ecac2(0xe8)&&_0x2dd450[_0x5ecac2(0xeb)]?.['activation']){const _0xdda336=_0x2fe506[_0x5ecac2(0xf8)](_0x2dd450[_0x5ecac2(0xeb)][_0x5ecac2(0xe8)]);_0xdda336&&_0xdda336!==_0x2dd450['with']['activation']&&(_0x2dd450['with'][_0x5ecac2(0xe8)]=_0xdda336);}}}}export function consolidateSegmentsByContent(_0x403ad8,_0x23df3c){const _0x433c13=a95_0x3fa3,_0x403514={},_0x5a23e0=new Map(),_0x8175ec=new Map();for(const _0x18347d of _0x403ad8){if(!_0x18347d)continue;for(const [_0x77e430,_0x507542]of Object['entries'](_0x18347d)){if(!_0x507542[_0x433c13(0xff)]){_0x403514[_0x77e430]=_0x507542,_0x5a23e0[_0x433c13(0xd5)](_0x77e430,_0x77e430);continue;}const _0x2737b5=_0x507542[_0x433c13(0x100)]&&_0x507542[_0x433c13(0x100)]['trim']()?_0x507542[_0x433c13(0x100)]:undefined,_0x502c8a=JSON['stringify']({'description':_0x2737b5,'rule':deepSortObject(_0x507542['rule'])}),_0x236d22=_0x8175ec[_0x433c13(0xf8)](_0x502c8a);if(_0x236d22){const _0x164f4d={..._0x507542[_0x433c13(0x100)]!==undefined&&{'description':_0x507542[_0x433c13(0x100)]},'rule':_0x507542[_0x433c13(0xff)]?deepSortObject(_0x507542[_0x433c13(0xff)]):_0x507542[_0x433c13(0xff)]};if(_0x77e430<_0x236d22){_0x403514[_0x77e430]=_0x164f4d,delete _0x403514[_0x236d22];for(const [_0x4d7d94,_0x34bed7]of _0x5a23e0[_0x433c13(0x102)]()){_0x34bed7===_0x236d22&&_0x5a23e0['set'](_0x4d7d94,_0x77e430);}_0x5a23e0[_0x433c13(0xd5)](_0x77e430,_0x77e430),_0x8175ec[_0x433c13(0xd5)](_0x502c8a,_0x77e430);}else _0x403514[_0x236d22]=_0x164f4d,_0x5a23e0[_0x433c13(0xd5)](_0x77e430,_0x236d22);}else{let _0x50801d=_0x77e430;if(_0x23df3c){const _0x3cf0a2=_0x23df3c[_0x433c13(0xf8)](_0x502c8a);_0x3cf0a2&&_0x3cf0a2[_0x433c13(0x10c)]>0x0&&(_0x50801d=_0x3cf0a2['slice']()[_0x433c13(0x10e)]()[0x0]);}const _0x35d0b0={..._0x507542[_0x433c13(0x100)]!==undefined&&{'description':_0x507542[_0x433c13(0x100)]},'rule':_0x507542['rule']?deepSortObject(_0x507542[_0x433c13(0xff)]):_0x507542[_0x433c13(0xff)]};_0x403514[_0x50801d]=_0x35d0b0,_0x5a23e0[_0x433c13(0xd5)](_0x77e430,_0x50801d),_0x8175ec[_0x433c13(0xd5)](_0x502c8a,_0x50801d);}}}return{'merged':_0x403514,'nameMapping':_0x5a23e0};}export function updateSegmentReferences(_0x3fefb6,_0x5e9b65){const _0x180c88=a95_0x3fa3;if(!_0x3fefb6)return;for(const _0x415200 of _0x3fefb6){if(_0x415200[_0x180c88(0xf5)]?.[_0x180c88(0x110)]){const _0x236f6e=_0x5e9b65[_0x180c88(0xf8)](_0x415200['entry_criteria'][_0x180c88(0x110)]);_0x236f6e&&(_0x415200[_0x180c88(0xf5)][_0x180c88(0x110)]=_0x236f6e);}if(_0x415200[_0x180c88(0xd7)])for(const _0x409618 of _0x415200[_0x180c88(0xd7)]){if(_0x409618[_0x180c88(0x112)]===_0x180c88(0xfc)&&_0x409618[_0x180c88(0xeb)]?.[_0x180c88(0xd9)])for(const _0xcd6a0c of _0x409618[_0x180c88(0xeb)]['branches']){if(_0xcd6a0c[_0x180c88(0x110)]){const _0x258e89=_0x5e9b65['get'](_0xcd6a0c[_0x180c88(0x110)]);_0x258e89&&(_0xcd6a0c[_0x180c88(0x110)]=_0x258e89);}}}}}export function updateSegmentRefsInSegments(_0x2300e0,_0x4c1ba5){const _0x1e71bc=a95_0x3fa3;for(const _0x4b3d04 of Object['values'](_0x2300e0)){_0x4b3d04[_0x1e71bc(0xff)]&&updateSegmentRefsInRule(_0x4b3d04[_0x1e71bc(0xff)],_0x4c1ba5);}}function updateSegmentRefsInRule(_0x250b60,_0x529d0a){const _0x62979a=a95_0x3fa3;if(_0x250b60===null||typeof _0x250b60!==_0x62979a(0x117))return;if(Array[_0x62979a(0xd8)](_0x250b60)){for(const _0x5433dc of _0x250b60){updateSegmentRefsInRule(_0x5433dc,_0x529d0a);}return;}const _0x5c661e=_0x250b60;if((_0x5c661e[_0x62979a(0x112)]===_0x62979a(0x115)||_0x5c661e[_0x62979a(0x112)]==='exclude')&&typeof _0x5c661e[_0x62979a(0x110)]===_0x62979a(0x11c)){const _0x3051cf=_0x529d0a['get'](_0x5c661e['segment']);_0x3051cf&&(_0x5c661e[_0x62979a(0x110)]=_0x3051cf);}if(_0x5c661e[_0x62979a(0xd4)]&&Array['isArray'](_0x5c661e['conditions']))for(const _0x5f4861 of _0x5c661e['conditions']){updateSegmentRefsInRule(_0x5f4861,_0x529d0a);}}export function buildJourneysArray(_0x4a9018){const _0x296c76=a95_0x3fa3,_0x7ea0f9=Math['max'](..._0x4a9018[_0x296c76(0xd0)](_0x2a1cdb=>_0x2a1cdb['item'][_0x296c76(0xde)]||0x0));return _0x4a9018[_0x296c76(0xd0)](_0x533cd6=>{const _0x516149=_0x296c76,_0x22ef2f=(_0x533cd6['item']['versionNumber']||0x0)===_0x7ea0f9,_0x1efce5=_0x533cd6[_0x516149(0xef)][_0x516149(0xe9)]?.[0x0],_0x5de9f6={'version':_0x1efce5?.[_0x516149(0xd1)]||_0x533cd6[_0x516149(0xef)][_0x516149(0xd1)]||_0x533cd6[_0x516149(0x116)]['name'],'state':_0x533cd6[_0x516149(0x116)][_0x516149(0xec)]==='launched'?_0x516149(0xd2):'draft','stages':_0x1efce5?.[_0x516149(0x118)]||_0x533cd6[_0x516149(0xef)][_0x516149(0x118)]||[],'id':_0x1efce5?.['id']||_0x533cd6[_0x516149(0xef)]['id'],'version_number':_0x1efce5?.[_0x516149(0x106)]||_0x533cd6[_0x516149(0xef)][_0x516149(0x106)]};return _0x22ef2f&&(_0x5de9f6[_0x516149(0x114)]=!![]),_0x5de9f6;});}export function buildMergedJourneyDef(_0x259ba8,_0xd8dcbf){const _0x125f8a=a95_0x3fa3,_0x540e50=_0x259ba8[0x0][_0x125f8a(0xef)],_0x567928=buildJourneysArray(_0x259ba8),{merged:_0x457543,nameMapping:_0x3987d1}=consolidateSegmentsByContent(_0x259ba8['map'](_0x6202aa=>_0x6202aa[_0x125f8a(0xef)][_0x125f8a(0x113)]),_0xd8dcbf);updateSegmentRefsInSegments(_0x457543,_0x3987d1);const _0x58313e=Array[_0x125f8a(0xe6)](_0x3987d1[_0x125f8a(0x102)]())['some'](([_0x362b15,_0x405d97])=>_0x362b15!==_0x405d97&&_0x362b15[_0x125f8a(0xdc)]('entry_criteria'));let _0x15ae5a=_0x457543,_0x574634=new Map();if(_0x58313e){const _0x45323b=consolidateSegmentsByContent([_0x457543],_0xd8dcbf);_0x15ae5a=_0x45323b[_0x125f8a(0xfb)],_0x574634=_0x45323b[_0x125f8a(0xdf)];}const _0x28c41e=new Map(_0x3987d1);for(const [_0x228aa1,_0x3f5e66]of _0x574634[_0x125f8a(0x102)]()){_0x28c41e[_0x125f8a(0xd5)](_0x228aa1,_0x3f5e66);}for(const [_0x18888b,_0x58a296]of _0x28c41e[_0x125f8a(0x102)]()){let _0x1d477c=_0x58a296,_0x211b22=0x0;while(_0x28c41e[_0x125f8a(0x103)](_0x1d477c)&&_0x28c41e[_0x125f8a(0xf8)](_0x1d477c)!==_0x1d477c&&_0x211b22<MAX_MAPPING_CHAIN_DEPTH){_0x1d477c=_0x28c41e[_0x125f8a(0xf8)](_0x1d477c),_0x211b22++;}_0x1d477c!==_0x58a296&&_0x28c41e[_0x125f8a(0xd5)](_0x18888b,_0x1d477c);}for(const _0x3d4ed9 of _0x567928){updateSegmentReferences(_0x3d4ed9[_0x125f8a(0x118)],_0x28c41e);}const {merged:_0x45763b,nameMapping:_0x6fc408}=consolidateActivationsByContent(_0x259ba8[_0x125f8a(0xd0)](_0xe909b1=>_0xe909b1[_0x125f8a(0xef)]['activations']));for(const _0x58c96f of _0x567928){updateActivationReferences(_0x58c96f[_0x125f8a(0x118)],_0x6fc408);}let _0xcaeb20=_0x540e50['goal'];if(_0xcaeb20?.[_0x125f8a(0x110)]){const _0x41ccff=_0x28c41e[_0x125f8a(0xf8)](_0xcaeb20['segment']);_0x41ccff&&(_0xcaeb20={..._0xcaeb20,'segment':_0x41ccff});}for(const _0x439be4 of _0x567928){if(_0x439be4[_0x125f8a(0xed)]?.[_0x125f8a(0x110)]){const _0x1cc838=_0x28c41e[_0x125f8a(0xf8)](_0x439be4[_0x125f8a(0xed)][_0x125f8a(0x110)]);_0x1cc838&&(_0x439be4[_0x125f8a(0xed)]={..._0x439be4['goal'],'segment':_0x1cc838});}}return{'type':_0x125f8a(0xf4),'name':_0x540e50[_0x125f8a(0xe2)],'description':_0x540e50['description'],'goal':_0xcaeb20,'reentry':_0x540e50[_0x125f8a(0x11d)],'segments':Object[_0x125f8a(0xfe)](_0x15ae5a)[_0x125f8a(0x10c)]>0x0?_0x15ae5a:undefined,'activations':Object[_0x125f8a(0xfe)](_0x45763b)[_0x125f8a(0x10c)]>0x0?_0x45763b:undefined,'journeys':_0x567928,'bundle_id':_0x540e50[_0x125f8a(0xe0)],'bundle_name':_0x540e50[_0x125f8a(0x10a)]};}export function createJumpTargetCache(){return new Map();}export async function resolveJumpTarget(_0x42345f,_0xc741a0,_0x4df587,_0x19cddd){const _0x184548=a95_0x3fa3,_0x4e00fb=_0x42345f+':'+_0xc741a0,_0xd0459b=_0x4df587[_0x184548(0xf8)](_0x4e00fb);if(_0xd0459b)return _0xd0459b;const _0x1edcf8=await _0x19cddd(_0x42345f),_0x143cee=_0x1edcf8[_0x184548(0xf7)][_0x184548(0x104)]||_0x1edcf8[_0x184548(0xf7)][_0x184548(0xe2)],_0x1be797=_0x1edcf8[_0x184548(0xf7)]['journeyStages'][_0x184548(0x105)](_0x2c8c4f=>String(_0x2c8c4f['id'])===String(_0xc741a0)),_0x2517c0=_0x1be797?.[_0x184548(0xe2)]||_0xc741a0,_0x4360ad={'journeyName':_0x143cee,'stageName':_0x2517c0};return _0x4df587[_0x184548(0xd5)](_0x4e00fb,_0x4360ad),_0x4360ad;}export function formatApiJourneyName(_0x3dd1d1,_0x29db81){return _0x29db81+'\x20('+_0x3dd1d1+')';}export function isLocalJourneyRef(_0x6483bd){const _0x431043=a95_0x3fa3;return _0x6483bd[_0x431043(0xdb)](_0x431043(0xf6))||_0x6483bd[_0x431043(0xdb)](_0x431043(0xf1));}export function buildLocalRuleToNameMapping(_0x3a1842){const _0x9aec88=a95_0x3fa3,_0x72682e=new Map();if(!_0x3a1842)return _0x72682e;for(const [_0x497568,_0x274a95]of Object[_0x9aec88(0x102)](_0x3a1842)){if(_0x274a95['rule']){const _0x544074=serializeRule(_0x274a95['rule']),_0x4a9c20=_0x72682e[_0x9aec88(0xf8)](_0x544074)||[];_0x4a9c20[_0x9aec88(0xe4)](_0x497568),_0x72682e['set'](_0x544074,_0x4a9c20);}}return _0x72682e;}export function buildLocalRuleToNameMappingFromJourney(_0x866aec){const _0x2d5e96=a95_0x3fa3,_0xe8c2d4=_0x866aec['segments'];if(!_0xe8c2d4)return new Map();const _0x554b5e=collectSegmentUsageCounts(_0x866aec),_0x23ad9c=new Map();let _0x28b30f=0x0;for(const [_0x29929c,_0xf74fe0]of Object[_0x2d5e96(0x102)](_0xe8c2d4)){if(!_0xf74fe0[_0x2d5e96(0xff)]){_0x28b30f++;continue;}const _0x53797c=serializeRule(_0xf74fe0[_0x2d5e96(0xff)]),_0x5bf16f=_0x23ad9c[_0x2d5e96(0xf8)](_0x53797c)||[];_0x5bf16f[_0x2d5e96(0xe4)]({'name':_0x29929c,'index':_0x28b30f}),_0x23ad9c['set'](_0x53797c,_0x5bf16f),_0x28b30f++;}const _0x3e0da9=new Map();for(const [_0x945757,_0x1e96a1]of _0x23ad9c){const _0x1631da=_0x1e96a1['slice']()['sort']((_0x749f29,_0x4bf904)=>{const _0x375ae7=_0x2d5e96,_0x2a410a=_0x554b5e[_0x375ae7(0xf8)](_0x749f29['name'])||0x0,_0x907c87=_0x554b5e[_0x375ae7(0xf8)](_0x4bf904[_0x375ae7(0xe2)])||0x0;if(_0x2a410a!==_0x907c87)return _0x907c87-_0x2a410a;return _0x749f29['index']-_0x4bf904[_0x375ae7(0x10d)];})[_0x2d5e96(0xd0)](_0x4fabc4=>_0x4fabc4['name']);_0x3e0da9[_0x2d5e96(0xd5)](_0x945757,_0x1631da);}return _0x3e0da9;}export function collectSegmentUsageCounts(_0x3ed012){const _0x50a39c=a95_0x3fa3,_0x4cc0e9=new Map(),_0x357352=_0x162602=>{const _0x3751a8=a95_0x3fa3;if(!_0x162602)return;_0x4cc0e9[_0x3751a8(0xd5)](_0x162602,(_0x4cc0e9[_0x3751a8(0xf8)](_0x162602)||0x0)+0x1);},_0xa0ecc6=_0x2e3bd6=>{const _0x363423=a95_0x3fa3;for(const _0x1a28bc of _0x2e3bd6){_0x357352(_0x1a28bc[_0x363423(0xf5)]?.['segment']);if(_0x1a28bc[_0x363423(0x11a)])for(const _0x1765ba of _0x1a28bc[_0x363423(0x11a)]){_0x357352(_0x1765ba[_0x363423(0x110)]);}_0x357352(_0x1a28bc['milestone']?.[_0x363423(0x110)]);if(_0x1a28bc[_0x363423(0xd7)])for(const _0xa9bf1a of _0x1a28bc[_0x363423(0xd7)]){if(_0xa9bf1a[_0x363423(0x112)]===_0x363423(0xfc))for(const _0x47a26e of _0xa9bf1a[_0x363423(0xeb)][_0x363423(0xd9)]){_0x357352(_0x47a26e[_0x363423(0x110)]);}else _0xa9bf1a[_0x363423(0x112)]==='wait'&&_0x357352(_0xa9bf1a[_0x363423(0xeb)][_0x363423(0xe5)]?.['segment']);}}};_0x357352(_0x3ed012[_0x50a39c(0xed)]?.[_0x50a39c(0x110)]);if(_0x3ed012[_0x50a39c(0xe9)])for(const _0x4bc075 of _0x3ed012[_0x50a39c(0xe9)]){_0x357352(_0x4bc075[_0x50a39c(0xed)]?.[_0x50a39c(0x110)]),_0xa0ecc6(_0x4bc075[_0x50a39c(0x118)]);}_0x3ed012[_0x50a39c(0x118)]&&_0xa0ecc6(_0x3ed012[_0x50a39c(0x118)]);if(_0x3ed012['versions'])for(const _0x37e8da of _0x3ed012[_0x50a39c(0x11f)]){_0xa0ecc6(_0x37e8da[_0x50a39c(0x118)]);}return _0x4cc0e9;}