@treasuredata/tdx 0.10.1 → 0.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bin.js +1 -1
- package/dist/build-info.json +2 -2
- package/dist/cli-categories.js +1 -1
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +1 -1
- package/dist/cli.js.map +1 -1
- package/dist/commands/activations.js +1 -1
- package/dist/commands/agent-command.js +1 -1
- package/dist/commands/api-command.js +1 -1
- package/dist/commands/auth-command.js +1 -1
- package/dist/commands/chat-command.js +1 -1
- package/dist/commands/claude-command.js +1 -1
- package/dist/commands/claude-statusline-command.js +1 -1
- package/dist/commands/claude-usage-command.js +1 -1
- package/dist/commands/command.js +1 -1
- package/dist/commands/connection-command.js +1 -1
- package/dist/commands/context-command.js +1 -1
- package/dist/commands/databases.js +1 -1
- package/dist/commands/describe.js +1 -1
- package/dist/commands/engage-command.js +1 -1
- package/dist/commands/job-command.js +1 -1
- package/dist/commands/journey-command.js +1 -1
- package/dist/commands/journey-validate-command.js +1 -1
- package/dist/commands/llm-command.js +1 -1
- package/dist/commands/llm-proxy.js +1 -1
- package/dist/commands/parent-segment-command.js +1 -1
- package/dist/commands/profiles-command.js +1 -1
- package/dist/commands/query-command.js +1 -1
- package/dist/commands/segment-command.js +1 -1
- package/dist/commands/segment-create-command.js +1 -1
- package/dist/commands/segment-fields-command.js +1 -1
- package/dist/commands/segment-pull-command.js +1 -1
- package/dist/commands/segment-push-command.js +1 -1
- package/dist/commands/segment-update-command.js +1 -1
- package/dist/commands/segment-use-command.js +1 -1
- package/dist/commands/segment-validate-command.js +1 -1
- package/dist/commands/segments.js +1 -1
- package/dist/commands/show.js +1 -1
- package/dist/commands/tables.js +1 -1
- package/dist/commands/use-command.js +1 -1
- package/dist/commands/user-command.js +1 -1
- package/dist/commands/workflow-command.d.ts +73 -3
- package/dist/commands/workflow-command.d.ts.map +1 -1
- package/dist/commands/workflow-command.js +1 -1
- package/dist/commands/workflow-command.js.map +1 -1
- package/dist/core/auth.js +1 -1
- package/dist/core/command-output.d.ts +1 -1
- package/dist/core/command-output.d.ts.map +1 -1
- package/dist/core/command-output.js +1 -1
- package/dist/core/config.js +1 -1
- package/dist/core/connection-cache.js +1 -1
- package/dist/core/constants.js +1 -1
- package/dist/core/credential-cache.js +1 -1
- package/dist/core/global-context.d.ts +1 -0
- package/dist/core/global-context.d.ts.map +1 -1
- package/dist/core/global-context.js +1 -1
- package/dist/core/global-context.js.map +1 -1
- package/dist/core/keychain.js +1 -1
- package/dist/core/profile.js +1 -1
- package/dist/core/project-config.js +1 -1
- package/dist/core/session.d.ts +1 -0
- package/dist/core/session.d.ts.map +1 -1
- package/dist/core/session.js +1 -1
- package/dist/core/session.js.map +1 -1
- package/dist/core/user-cache.js +1 -1
- package/dist/index.js +1 -1
- package/dist/proxy/anthropic-adapter.js +1 -1
- package/dist/proxy/claude-usage-tracker.js +1 -1
- package/dist/proxy/context-signature.js +1 -1
- package/dist/proxy/conversation-utils.js +1 -1
- package/dist/proxy/server.js +1 -1
- package/dist/proxy/session-cache.js +1 -1
- package/dist/sdk/agent/agent-config.js +1 -1
- package/dist/sdk/agent/agent-ref-parser.js +1 -1
- package/dist/sdk/agent/agent-yaml.js +1 -1
- package/dist/sdk/api.js +1 -1
- package/dist/sdk/client/cdp-api-client.js +1 -1
- package/dist/sdk/client/endpoints.js +1 -1
- package/dist/sdk/client/engage-api-client.js +1 -1
- package/dist/sdk/client/http-client.js +1 -1
- package/dist/sdk/client/llm-api-client.js +1 -1
- package/dist/sdk/client/rate-limiter.js +1 -1
- package/dist/sdk/client/td-api-client.js +1 -1
- package/dist/sdk/client/trino-api-client.js +1 -1
- package/dist/sdk/client/workflow-client.d.ts +32 -4
- package/dist/sdk/client/workflow-client.d.ts.map +1 -1
- package/dist/sdk/client/workflow-client.js +1 -1
- package/dist/sdk/client/workflow-client.js.map +1 -1
- package/dist/sdk/connection-validator.d.ts +10 -6
- package/dist/sdk/connection-validator.d.ts.map +1 -1
- package/dist/sdk/connection-validator.js +1 -1
- package/dist/sdk/connection-validator.js.map +1 -1
- package/dist/sdk/connection.js +1 -1
- package/dist/sdk/engage.js +1 -1
- package/dist/sdk/errors.d.ts +2 -0
- package/dist/sdk/errors.d.ts.map +1 -1
- package/dist/sdk/errors.js +1 -1
- package/dist/sdk/errors.js.map +1 -1
- package/dist/sdk/index.js +1 -1
- package/dist/sdk/io/index.js +1 -1
- package/dist/sdk/io/node-filesystem.js +1 -1
- package/dist/sdk/job.js +1 -1
- package/dist/sdk/journey.js +1 -1
- package/dist/sdk/llm/chat-cache.js +1 -1
- package/dist/sdk/llm/index.js +1 -1
- package/dist/sdk/llm/llm-backup-utils.js +1 -1
- package/dist/sdk/llm/model-aliases.js +1 -1
- package/dist/sdk/llm/model-factors.js +1 -1
- package/dist/sdk/query/index.js +1 -1
- package/dist/sdk/query/sql-parser.js +1 -1
- package/dist/sdk/segment/child-segment-yaml.js +1 -1
- package/dist/sdk/segment/fields-display.js +1 -1
- package/dist/sdk/segment/file-discovery.js +1 -1
- package/dist/sdk/segment/journey-utils.js +1 -1
- package/dist/sdk/segment/journey-yaml.js +1 -1
- package/dist/sdk/segment/parent-segment-preview.js +1 -1
- package/dist/sdk/segment/parent-segment-yaml.js +1 -1
- package/dist/sdk/segment/pull-workflow.js +1 -1
- package/dist/sdk/segment/push-workflow.js +1 -1
- package/dist/sdk/segment/resolution-context.js +1 -1
- package/dist/sdk/segment/segment-path-parser.js +1 -1
- package/dist/sdk/segment/segment-ref-parser.js +1 -1
- package/dist/sdk/segment/target-resolution.js +1 -1
- package/dist/sdk/segment/tdx-config.js +1 -1
- package/dist/sdk/segment/validate-files.js +1 -1
- package/dist/sdk/segment/yaml-validator.js +1 -1
- package/dist/sdk/segment.js +1 -1
- package/dist/sdk/types/index.d.ts +1 -0
- package/dist/sdk/types/index.d.ts.map +1 -1
- package/dist/sdk/types/index.js +1 -1
- package/dist/sdk/types/index.js.map +1 -1
- package/dist/sdk/types/progress.js +1 -1
- package/dist/sdk/user.js +1 -1
- package/dist/sdk/util/format-detector.js +1 -1
- package/dist/sdk/util/formatters.js +1 -1
- package/dist/sdk/util/index.js +1 -1
- package/dist/sdk/util/tree-formatter.js +1 -1
- package/dist/sdk/workflow/index.d.ts +74 -4
- package/dist/sdk/workflow/index.d.ts.map +1 -1
- package/dist/sdk/workflow/index.js +1 -1
- package/dist/sdk/workflow/index.js.map +1 -1
- package/dist/sdk/workflow/workflow-utils.js +1 -1
- package/dist/utils/async.js +1 -1
- package/dist/utils/colors.js +1 -1
- package/dist/utils/diff.js +1 -1
- package/dist/utils/file-permissions.js +1 -1
- package/dist/utils/json-loader.js +1 -1
- package/dist/utils/option-validation.js +1 -1
- package/dist/utils/port.js +1 -1
- package/dist/utils/process.js +1 -1
- package/dist/utils/prompt.js +1 -1
- package/dist/utils/spinner.js +1 -1
- package/dist/utils/sse-parser.js +1 -1
- package/dist/utils/string-utils.js +1 -1
- package/dist/utils/table-ref-parser.js +1 -1
- package/dist/utils/tdx-logger.js +1 -1
- package/dist/utils/version-check.js +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(_0x2f9fb1,_0x2231ef){const _0x3b69fa=a89_0x4579,_0x43cbf6=_0x2f9fb1();while(!![]){try{const _0x4fb5fe=-parseInt(_0x3b69fa(0x110))/0x1*(parseInt(_0x3b69fa(0xa9))/0x2)+-parseInt(_0x3b69fa(0x8d))/0x3+-parseInt(_0x3b69fa(0x11d))/0x4*(parseInt(_0x3b69fa(0xdb))/0x5)+-parseInt(_0x3b69fa(0x106))/0x6*(-parseInt(_0x3b69fa(0x103))/0x7)+-parseInt(_0x3b69fa(0x11a))/0x8*(-parseInt(_0x3b69fa(0xe7))/0x9)+-parseInt(_0x3b69fa(0xd7))/0xa+parseInt(_0x3b69fa(0x108))/0xb;if(_0x4fb5fe===_0x2231ef)break;else _0x43cbf6['push'](_0x43cbf6['shift']());}catch(_0x1ce338){_0x43cbf6['push'](_0x43cbf6['shift']());}}}(a89_0xd835,0xd5f18));import*as a89_0x2d1181 from'yaml';import{SDKError,ErrorCode}from'../errors.js';import{validateConnectorConfig,transformConfigToLegacy,normalizeConnectorConfigForYaml,formatValidationErrors,formatValidationWarnings,formatSchemaAsHelp}from'../connection-validator.js';function a89_0xd835(){const _0x267c42=['And','email_recipients','arrayMatching','Reference','INVALID_ARGUMENT','\x0a\x0aAvailable\x20fields:\x0a','connectionId','isArray','description','all_columns','endOn','join_strategy','Unknown\x20connection:\x20','push','every','orderBy','Segment\x20description','repeat_frequency','length','joinStrategy','attribute','behaviorTableName','emailToIdMap','value','3422HjFDpL','conditions','syndicationBehavior','code','\x27:\x20','all','operator','connection','parse','join_row','YAML\x20config\x20missing\x20required\x20field:\x20name','limit','Invalid\x20condition\x20in\x20embedded\x20segment\x20\x27','activationParams','usedNames','repeat_sub_frequency','include','activations','connectorConfig','notifyOn','null','entries','CONNECTOR_INVALID_CONFIG','columns','allColumns','__SEGMENT_REF__','segment','toLowerCase','unit','has','max','behavior_table','Unknown\x20email\x20recipient:\x20','folder','rightValue','repeatFrequency','visible','order_by','localeCompare','add','resolveSegmentName','Equal','map','source','set','end_on','5895850WvqXWT','not','JOURNEY_SYNTAX_ERROR','min','2459695wwBliV','getSchema','warn','connectionNameToTypeMap','TimeWithinPast','funnel_stage','notification','Value','\x22:\x0a','behavior','Invalid\x20connector_config\x20for\x20activation\x20\x22','aggregation','135WZiGko','leftValue','from','scheduleType','connector_config','activation_template_id','errors','repeatUnit','conditions[','isVisible','joinRow','rightValues','object','YAML\x20type\x20must\x20be\x20\x27segment\x27\x20or\x20omitted,\x20got:\x20','kind','keys','CONNECTOR_SCHEMA_NOT_FOUND','Connector:\x20','string','groupingColumns','filter','timezone','notify_on','Please\x20specify\x20a\x20valid\x20attribute\x20name.','attributes','startAt','values','stringify','35dJkzQD','realtime','start_at','609162IDdvfj','forEach','19128087cGrIvO','type','CONNECTION_NOT_FOUND','test','valid','formatting','name','__UNRESOLVED__','318YZVJqa','duration','exclude','batch','visibility','rule','any','connector_config\x20for\x20activation\x20\x22','localRuleToName','].attribute\x20cannot\x20be\x20empty.\x0a','190088BZmHft','get','schedule','4WWLmCB','repeatSubFrequency','segmentFolderId','repeat_unit','activationTemplateId','sort','rule:','warnings','attribute_name','303099lkJdZr','emailRecipients','.\x20Use\x20\x27tdx\x20user\x20list\x27\x20to\x20see\x20valid\x20emails.','replace'];a89_0xd835=function(){return _0x267c42;};return a89_0xd835();}export function segmentResponseToDefSync(_0x24ea48,_0x5c2c0a){const _0x3bd248=a89_0x4579;return{'type':_0x3bd248(0xc3),'name':_0x24ea48[_0x3bd248(0x10e)],..._0x24ea48['description']&&{'description':_0x24ea48[_0x3bd248(0x99)]},..._0x5c2c0a&&{'folder':_0x5c2c0a},..._0x24ea48['rule']&&{'rule':apiRuleToYaml(_0x24ea48['rule'])},..._0x24ea48[_0x3bd248(0xf5)]!==undefined&&{'kind':_0x24ea48['kind']===0x0?_0x3bd248(0x113):_0x24ea48[_0x3bd248(0xf5)]===0x1?'realtime':_0x3bd248(0xe0)},..._0x24ea48[_0x3bd248(0xf0)]!==undefined&&{'visible':_0x24ea48[_0x3bd248(0xf0)]}};}export async function segmentResponseToDef(_0x21e66f,_0x39d3dd,_0xd22601){const _0x1f4760=a89_0x4579,_0x40ff74=segmentResponseToDefSync(_0x21e66f,_0xd22601);if(!_0x39d3dd||!_0x39d3dd[_0x1f4760(0xd1)])return _0x40ff74;return _0x40ff74['rule']&&(_0x40ff74[_0x1f4760(0x115)]=await resolveRuleSegmentRefs(_0x40ff74['rule'],_0x39d3dd[_0x1f4760(0xd1)])),_0x40ff74;}export function apiRuleToYaml(_0x5e5bfd){const _0x3baa75=a89_0x4579,_0x113553=(_0x5e5bfd[_0x3baa75(0xaa)]||[])[_0x3baa75(0xd3)](apiConditionToYaml);if(_0x113553['length']===0x1&&!_0x5e5bfd['description']&&_0x3baa75(0x109)in _0x113553[0x0]&&(_0x113553[0x0][_0x3baa75(0x109)]===_0x3baa75(0x91)||_0x113553[0x0][_0x3baa75(0x109)]==='Or')){const _0x27e102=_0x113553[0x0];if(_0x27e102['type']===_0x5e5bfd['type']&&_0x27e102[_0x3baa75(0xaa)])return{'type':_0x5e5bfd[_0x3baa75(0x109)],'conditions':_0x27e102[_0x3baa75(0xaa)],..._0x27e102[_0x3baa75(0x99)]&&{'description':_0x27e102['description']}};}return{'type':_0x5e5bfd[_0x3baa75(0x109)],'conditions':_0x113553,..._0x5e5bfd[_0x3baa75(0x99)]&&{'description':_0x5e5bfd['description']}};}export async function resolveRuleSegmentRefs(_0x20952a,_0x7ee4ae){const _0x4537e6=a89_0x4579,_0x2c628f=await Promise['all'](_0x20952a[_0x4537e6(0xaa)][_0x4537e6(0xd3)](_0xc9286e=>resolveConditionSegmentRefs(_0xc9286e,_0x7ee4ae)));return{..._0x20952a,'conditions':_0x2c628f};}async function resolveConditionSegmentRefs(_0x4e3bf9,_0x1b333e){const _0x486804=a89_0x4579;if(_0x486804(0xc3)in _0x4e3bf9&&(_0x4e3bf9[_0x486804(0x109)]===_0x486804(0xb9)||_0x4e3bf9[_0x486804(0x109)]===_0x486804(0x112))){const _0xb8bc2f=_0x4e3bf9;if(/^\d+$/[_0x486804(0x10b)](_0xb8bc2f[_0x486804(0xc3)])){const _0x299fa2=await _0x1b333e(_0xb8bc2f[_0x486804(0xc3)]);return{..._0xb8bc2f,'segment':_0x299fa2};}return _0x4e3bf9;}if(_0x486804(0xaa)in _0x4e3bf9&&_0x4e3bf9[_0x486804(0xaa)]){const _0x1be526=_0x4e3bf9,_0x54186b=await Promise[_0x486804(0xae)](_0x1be526['conditions'][_0x486804(0xd3)](_0x5bffd9=>resolveConditionSegmentRefs(_0x5bffd9,_0x1b333e)));return{..._0x1be526,'conditions':_0x54186b};}if(_0x486804(0xfb)in _0x4e3bf9&&_0x4e3bf9['filter']){const _0x15eb2e=_0x4e3bf9,_0x329afb=await resolveRuleSegmentRefs(_0x15eb2e[_0x486804(0xfb)],_0x1b333e);return{..._0x15eb2e,'filter':_0x329afb};}return _0x4e3bf9;}export async function resolveRuleSegmentIds(_0x517695,_0x347111){const _0x3f4c6e=a89_0x4579,_0x279b15=await Promise[_0x3f4c6e(0xae)](_0x517695[_0x3f4c6e(0xaa)][_0x3f4c6e(0xd3)](_0x201689=>resolveConditionSegmentIds(_0x201689,_0x347111)));return{..._0x517695,'conditions':_0x279b15};}async function resolveConditionSegmentIds(_0x5b4451,_0x38e178){const _0x2997be=a89_0x4579;if(_0x2997be(0xc3)in _0x5b4451&&(_0x5b4451[_0x2997be(0x109)]==='include'||_0x5b4451[_0x2997be(0x109)]===_0x2997be(0x112))){const _0x1651a7=_0x5b4451;if(!/^\d+$/['test'](_0x1651a7[_0x2997be(0xc3)])){const _0x4cd0f2=await _0x38e178(_0x1651a7[_0x2997be(0xc3)]);return{..._0x1651a7,'segment':_0x4cd0f2};}return _0x5b4451;}if('conditions'in _0x5b4451&&_0x5b4451[_0x2997be(0xaa)]){const _0x27d098=_0x5b4451,_0x543d30=await Promise[_0x2997be(0xae)](_0x27d098[_0x2997be(0xaa)][_0x2997be(0xd3)](_0x7d552d=>resolveConditionSegmentIds(_0x7d552d,_0x38e178)));return{..._0x27d098,'conditions':_0x543d30};}if(_0x2997be(0xfb)in _0x5b4451&&_0x5b4451[_0x2997be(0xfb)]){const _0x2e99c9=_0x5b4451,_0x57248d=await resolveRuleSegmentIds(_0x2e99c9[_0x2997be(0xfb)],_0x38e178);return{..._0x2e99c9,'filter':_0x57248d};}return _0x5b4451;}function apiConditionToYaml(_0x21df67){const _0x36abfb=a89_0x4579;if(_0x21df67[_0x36abfb(0x109)]===_0x36abfb(0x91)||_0x21df67[_0x36abfb(0x109)]==='Or'){if(_0x21df67[_0x36abfb(0xaa)]){const _0xfd6c7d=_0x21df67[_0x36abfb(0xaa)][_0x36abfb(0xd3)](apiConditionToYaml);if(_0xfd6c7d[_0x36abfb(0xa3)]===0x1&&!_0x21df67['description'])return _0xfd6c7d[0x0];return{'type':_0x21df67[_0x36abfb(0x109)],'conditions':_0xfd6c7d,..._0x21df67[_0x36abfb(0x99)]&&{'description':_0x21df67[_0x36abfb(0x99)]}};}}if(_0x21df67['type']===_0x36abfb(0xe2)&&_0x21df67[_0x36abfb(0xe8)]&&_0x21df67[_0x36abfb(0xaf)]){const _0x25ed4a=_0x21df67[_0x36abfb(0xe8)][_0x36abfb(0xe6)]?{'type':_0x21df67[_0x36abfb(0xe8)][_0x36abfb(0xe6)][_0x36abfb(0x109)],..._0x21df67[_0x36abfb(0xe8)][_0x36abfb(0xe6)][_0x36abfb(0xfa)]&&{'groupingColumns':_0x21df67[_0x36abfb(0xe8)][_0x36abfb(0xe6)]['groupingColumns']}}:undefined;return{'type':_0x36abfb(0xe2),'attribute':_0x21df67[_0x36abfb(0xe8)]['name']||'','operator':apiOperatorToYaml(_0x21df67[_0x36abfb(0xaf)]),..._0x21df67[_0x36abfb(0x93)]&&_0x21df67['arrayMatching']!==_0x36abfb(0x116)?{'arrayMatching':_0x21df67[_0x36abfb(0x93)]}:{},..._0x21df67[_0x36abfb(0x112)]?{'exclude':_0x21df67[_0x36abfb(0x112)]}:{},..._0x25ed4a?{'aggregation':_0x25ed4a}:{},..._0x21df67[_0x36abfb(0xe8)][_0x36abfb(0xd4)]?{'source':_0x21df67[_0x36abfb(0xe8)][_0x36abfb(0xd4)][_0x36abfb(0x10e)]}:{},..._0x21df67[_0x36abfb(0xe8)][_0x36abfb(0xfb)]?{'filter':apiRuleToYaml(_0x21df67[_0x36abfb(0xe8)][_0x36abfb(0xfb)])}:{},..._0x21df67[_0x36abfb(0xb4)]!==undefined&&_0x21df67[_0x36abfb(0xb4)]!==null?{'limit':_0x21df67['limit']}:{}};}if(_0x21df67[_0x36abfb(0x109)]===_0x36abfb(0x94)&&_0x21df67['id'])return{'type':_0x21df67[_0x36abfb(0x112)]?_0x36abfb(0x112):'include','segment':_0x21df67['id']};return{'type':_0x36abfb(0x91),'conditions':[]};}function isTemporalOperator(_0x27c7ab){const _0x5ef03a=a89_0x4579;return _0x27c7ab===_0x5ef03a(0xdf)||_0x27c7ab==='TimeWithinNext';}function getEffectiveValue(_0x52ccc6){const _0x282809=a89_0x4579,_0x16ae6b=_0x52ccc6['values'];return _0x52ccc6[_0x282809(0xa8)]??_0x16ae6b;}function apiOperatorToYaml(_0x505c89){const _0xf1bba0=a89_0x4579;let _0x27bd60;if(_0x505c89['rightValues']&&_0x505c89['rightValues']['length']>0x0)_0x27bd60=_0x505c89[_0xf1bba0(0xf2)];else{if(_0x505c89[_0xf1bba0(0xcb)]!==undefined)_0x27bd60=_0x505c89['rightValue'];else isTemporalOperator(_0x505c89[_0xf1bba0(0x109)])&&_0x505c89[_0xf1bba0(0xa8)]!==undefined&&(_0x27bd60=_0x505c89['value']);}return{'type':mapApiOperatorType(_0x505c89[_0xf1bba0(0x109)]),..._0x505c89[_0xf1bba0(0xd8)]&&{'not':_0x505c89[_0xf1bba0(0xd8)]},..._0x27bd60!==undefined&&{'value':_0x27bd60},..._0x505c89[_0xf1bba0(0xc5)]&&{'unit':_0x505c89[_0xf1bba0(0xc5)]}};}function mapApiOperatorType(_0x518002){return _0x518002;}export function segmentDefToCreateRequest(_0x1ca67a,_0x42a8ba){const _0x42f17b=a89_0x4579,_0x2165cf={'name':_0x1ca67a[_0x42f17b(0x10e)]};return _0x1ca67a[_0x42f17b(0x99)]&&(_0x2165cf['description']=_0x1ca67a[_0x42f17b(0x99)]),_0x1ca67a[_0x42f17b(0x115)]&&(_0x2165cf[_0x42f17b(0x115)]=yamlRuleToApi(_0x1ca67a['rule'])),_0x1ca67a['kind']&&(_0x2165cf[_0x42f17b(0xf5)]=_0x1ca67a['kind']==='batch'?0x0:_0x1ca67a[_0x42f17b(0xf5)]===_0x42f17b(0x104)?0x1:0x2),_0x1ca67a['visible']!==undefined&&(_0x2165cf[_0x42f17b(0xf0)]=_0x1ca67a['visible']),_0x42a8ba&&(_0x2165cf[_0x42f17b(0x11f)]=_0x42a8ba),_0x2165cf;}export function segmentDefToUpdateRequest(_0x36b6bc){const _0xdf63c3=a89_0x4579,_0x4b6879={'name':_0x36b6bc[_0xdf63c3(0x10e)]};return _0x36b6bc[_0xdf63c3(0x99)]!==undefined&&(_0x4b6879[_0xdf63c3(0x99)]=_0x36b6bc[_0xdf63c3(0x99)]),_0x36b6bc['rule']&&(_0x4b6879[_0xdf63c3(0x115)]=yamlRuleToApi(_0x36b6bc[_0xdf63c3(0x115)])),_0x36b6bc['kind']&&(_0x4b6879['kind']=_0x36b6bc[_0xdf63c3(0xf5)]===_0xdf63c3(0x113)?0x0:_0x36b6bc[_0xdf63c3(0xf5)]==='realtime'?0x1:0x2),_0x4b6879;}export function yamlRuleToApi(_0x1fbf02,_0x388d89=![]){const _0x1c8419=a89_0x4579,_0xcba611=_0x1fbf02[_0x1c8419(0xaa)][_0x1c8419(0xd3)](yamlConditionToApi);if(_0x388d89){const _0x5109ae=_0xcba611[_0x1c8419(0x9f)](_0x5cda47=>_0x5cda47[_0x1c8419(0x109)]===_0x1c8419(0x91)||_0x5cda47['type']==='Or');if(!_0x5109ae&&_0xcba611[_0x1c8419(0xa3)]>0x0)return{'type':_0x1fbf02[_0x1c8419(0x109)],'conditions':[{'type':_0x1c8419(0x91),'description':_0x1fbf02[_0x1c8419(0x99)]||'','conditions':_0xcba611}]};}return{'type':_0x1fbf02[_0x1c8419(0x109)],'conditions':_0xcba611,..._0x1fbf02[_0x1c8419(0x99)]&&{'description':_0x1fbf02['description']}};}function yamlConditionToApi(_0x368d48){const _0xb0ed08=a89_0x4579;if(_0xb0ed08(0xc3)in _0x368d48&&(_0x368d48[_0xb0ed08(0x109)]===_0xb0ed08(0xb9)||_0x368d48['type']===_0xb0ed08(0x112))){const _0x73c6a5=_0x368d48;return{'type':_0xb0ed08(0x94),'id':_0x73c6a5[_0xb0ed08(0xc3)],'exclude':_0x73c6a5[_0xb0ed08(0x109)]==='exclude'};}if('type'in _0x368d48&&(_0x368d48['type']==='And'||_0x368d48[_0xb0ed08(0x109)]==='Or')){const _0x1cc919=_0x368d48;return{'type':_0x1cc919[_0xb0ed08(0x109)],'conditions':_0x1cc919[_0xb0ed08(0xaa)][_0xb0ed08(0xd3)](yamlConditionToApi),..._0x1cc919[_0xb0ed08(0x99)]&&{'description':_0x1cc919[_0xb0ed08(0x99)]}};}const _0x198793=_0x368d48,_0x11cf85={'type':'Value','leftValue':buildLeftValue(_0x198793),'operator':yamlOperatorToApi(_0x198793[_0xb0ed08(0xaf)]),'exclude':_0x198793[_0xb0ed08(0x112)]??![],'arrayMatching':_0x198793['arrayMatching']??_0xb0ed08(0x116)};return _0x198793[_0xb0ed08(0xb4)]!==undefined&&(_0x11cf85['limit']=_0x198793['limit']),_0x11cf85;}function buildLeftValue(_0x4b9fb6){const _0x236e60=a89_0x4579,_0x3a8fc5={'name':_0x4b9fb6[_0x236e60(0xa5)]};return _0x4b9fb6[_0x236e60(0xe6)]&&(_0x3a8fc5['aggregation']={'type':_0x4b9fb6[_0x236e60(0xe6)]['type'],..._0x4b9fb6[_0x236e60(0xe6)][_0x236e60(0xfa)]&&{'groupingColumns':_0x4b9fb6[_0x236e60(0xe6)][_0x236e60(0xfa)]}}),_0x4b9fb6[_0x236e60(0xd4)]&&(_0x3a8fc5['source']={'name':_0x4b9fb6[_0x236e60(0xd4)]}),_0x4b9fb6[_0x236e60(0xfb)]&&(_0x3a8fc5[_0x236e60(0xfb)]=yamlRuleToApi(_0x4b9fb6[_0x236e60(0xfb)])),_0x3a8fc5;}function yamlOperatorToApi(_0x6becd3){const _0x23699c=a89_0x4579,_0x5ac72a={'type':mapYamlOperatorType(_0x6becd3[_0x23699c(0x109)]),'not':_0x6becd3[_0x23699c(0xd8)]??![]},_0x4e681b=getEffectiveValue(_0x6becd3);if(_0x4e681b!==undefined){if(Array[_0x23699c(0x98)](_0x4e681b))_0x5ac72a['rightValues']=_0x4e681b;else isTemporalOperator(_0x6becd3[_0x23699c(0x109)])?_0x5ac72a[_0x23699c(0xa8)]=_0x4e681b:_0x5ac72a[_0x23699c(0xcb)]=_0x4e681b;}return _0x6becd3['unit']&&(_0x5ac72a['unit']=_0x6becd3[_0x23699c(0xc5)]),_0x5ac72a;}function mapYamlOperatorType(_0x42aeab){return _0x42aeab;}export function toYamlString(_0x538143){const _0x4b4f33=a89_0x4579,_0xce430c=JSON[_0x4b4f33(0xb1)](JSON[_0x4b4f33(0x102)](_0x538143)),_0x1f0323=a89_0x2d1181[_0x4b4f33(0x102)](_0xce430c,{'indent':0x2,'lineWidth':0x0,'nullStr':_0x4b4f33(0xbd)}),_0x49badb=[_0x4b4f33(0x8a)];let _0x3a1b39=_0x1f0323;for(const _0x13b3ea of _0x49badb){_0x3a1b39=_0x3a1b39[_0x4b4f33(0x90)](new RegExp('^('+_0x13b3ea+')','m'),(_0x523719,_0x3e6976,_0x5c5ed)=>{if(_0x5c5ed===0x0||_0x3a1b39[_0x5c5ed-0x1]==='\x0a'&&_0x3a1b39[_0x5c5ed-0x2]==='\x0a')return _0x3e6976;return'\x0a'+_0x3e6976;});}return _0x3a1b39;}export function parseYamlString(_0x202edb){const _0x5aa77d=a89_0x4579,_0x20d863=a89_0x2d1181[_0x5aa77d(0xb1)](_0x202edb);if(!_0x20d863[_0x5aa77d(0x10e)])throw new Error(_0x5aa77d(0xb3));if(_0x20d863[_0x5aa77d(0x109)]&&_0x20d863['type']!==_0x5aa77d(0xc3))throw new Error(_0x5aa77d(0xf4)+_0x20d863[_0x5aa77d(0x109)]);return _0x20d863;}function a89_0x4579(_0x4e8709,_0x441501){_0x4e8709=_0x4e8709-0x87;const _0xd83506=a89_0xd835();let _0x45795c=_0xd83506[_0x4e8709];return _0x45795c;}export function isSegmentYaml(_0x2c0a31){const _0x51d8c9=a89_0x4579;if(typeof _0x2c0a31!=='object'||_0x2c0a31===null)return![];const _0x3301f8=_0x2c0a31;return _0x3301f8[_0x51d8c9(0x109)]===_0x51d8c9(0xc3)||_0x3301f8[_0x51d8c9(0x109)]===undefined;}export function generateTemplate(_0x76f725='New\x20Segment'){const _0x52d709=a89_0x4579,_0x4cd57f={'type':_0x52d709(0xc3),'name':_0x76f725,'description':_0x52d709(0xa1),'rule':{'type':'And','conditions':[{'type':'Value','attribute':_0x52d709(0x8c),'operator':{'type':_0x52d709(0xd2),'value':_0x52d709(0xa8)}}]}};return toYamlString(_0x4cd57f);}export function segmentToYamlString(_0x437a18){const _0xb1cf6f=a89_0x4579,_0x511af4=JSON['parse'](JSON[_0xb1cf6f(0x102)](_0x437a18)),_0x6d7d01=a89_0x2d1181['stringify'](_0x511af4,{'indent':0x2,'lineWidth':0x0,'nullStr':_0xb1cf6f(0xbd)}),_0x159643=['rule:','activations:'];let _0x26135b=_0x6d7d01;for(const _0x4f7c50 of _0x159643){_0x26135b=_0x26135b['replace'](new RegExp('^('+_0x4f7c50+')','m'),(_0x5066e3,_0x39cd7d,_0x2f084a)=>{if(_0x2f084a===0x0||_0x26135b[_0x2f084a-0x1]==='\x0a'&&_0x26135b[_0x2f084a-0x2]==='\x0a')return _0x39cd7d;return'\x0a'+_0x39cd7d;});}return _0x26135b;}export function parseSegmentYamlFile(_0x223ce8){const _0x192142=a89_0x4579,_0x5de5cc=a89_0x2d1181['parse'](_0x223ce8);if(!_0x5de5cc[_0x192142(0x10e)])throw new Error(_0x192142(0xb3));return _0x5de5cc;}export function normalizeChildSegmentYaml(_0xa59b45){const _0x30c3bf=a89_0x4579;return{'type':_0x30c3bf(0xc3),'name':_0xa59b45[_0x30c3bf(0x10e)],..._0xa59b45[_0x30c3bf(0x99)]!==undefined&&{'description':_0xa59b45[_0x30c3bf(0x99)]},..._0xa59b45['folder']!==undefined&&{'folder':_0xa59b45[_0x30c3bf(0xca)]},..._0xa59b45[_0x30c3bf(0x115)]&&{'rule':normalizeRule(_0xa59b45[_0x30c3bf(0x115)])},..._0xa59b45['kind']!==undefined&&{'kind':_0xa59b45[_0x30c3bf(0xf5)]},..._0xa59b45[_0x30c3bf(0xcd)]!==undefined&&{'visible':_0xa59b45['visible']},..._0xa59b45[_0x30c3bf(0xba)]&&{'activations':_0xa59b45[_0x30c3bf(0xba)][_0x30c3bf(0xd3)](normalizeActivation)}};}export function normalizeRule(_0x572e8f){const _0x24272e=a89_0x4579;return{'type':_0x572e8f[_0x24272e(0x109)],'conditions':_0x572e8f[_0x24272e(0xaa)][_0x24272e(0xd3)](normalizeCondition),..._0x572e8f[_0x24272e(0x99)]!==undefined&&{'description':_0x572e8f[_0x24272e(0x99)]}};}function normalizeCondition(_0x3d1fa5){const _0x32f784=a89_0x4579;if(_0x32f784(0xc3)in _0x3d1fa5&&(_0x3d1fa5[_0x32f784(0x109)]==='include'||_0x3d1fa5['type']==='exclude')){const _0xe333c1=_0x3d1fa5;return{'type':_0xe333c1['type'],'segment':_0xe333c1[_0x32f784(0xc3)]};}if(_0x32f784(0x109)in _0x3d1fa5&&(_0x3d1fa5[_0x32f784(0x109)]===_0x32f784(0x91)||_0x3d1fa5[_0x32f784(0x109)]==='Or')){const _0x278b44=_0x3d1fa5;return{'type':_0x278b44[_0x32f784(0x109)],'conditions':_0x278b44[_0x32f784(0xaa)]['map'](normalizeCondition),..._0x278b44['description']!==undefined&&{'description':_0x278b44['description']}};}const _0x40dbc5=_0x3d1fa5;return{'type':_0x32f784(0xe2),'attribute':_0x40dbc5['attribute'],'operator':normalizeOperator(_0x40dbc5['operator']),..._0x40dbc5[_0x32f784(0x93)]!==undefined&&{'arrayMatching':_0x40dbc5[_0x32f784(0x93)]},..._0x40dbc5[_0x32f784(0x112)]!==undefined&&{'exclude':_0x40dbc5[_0x32f784(0x112)]},..._0x40dbc5[_0x32f784(0xe6)]!==undefined&&{'aggregation':_0x40dbc5[_0x32f784(0xe6)]},..._0x40dbc5[_0x32f784(0xd4)]!==undefined&&{'source':_0x40dbc5[_0x32f784(0xd4)]},..._0x40dbc5[_0x32f784(0xfb)]!==undefined&&{'filter':normalizeRule(_0x40dbc5[_0x32f784(0xfb)])},..._0x40dbc5['limit']!==undefined&&{'limit':_0x40dbc5[_0x32f784(0xb4)]}};}function normalizeOperator(_0x3908fb){const _0x2ec79e=a89_0x4579,_0x11d44b=getEffectiveValue(_0x3908fb);return{'type':_0x3908fb[_0x2ec79e(0x109)],..._0x3908fb[_0x2ec79e(0xd8)]!==undefined&&{'not':_0x3908fb[_0x2ec79e(0xd8)]},..._0x11d44b!==undefined&&{'value':_0x11d44b},..._0x3908fb['min']!==undefined&&{'min':_0x3908fb[_0x2ec79e(0xda)]},..._0x3908fb[_0x2ec79e(0xc7)]!==undefined&&{'max':_0x3908fb['max']},..._0x3908fb[_0x2ec79e(0xc5)]!==undefined&&{'unit':_0x3908fb[_0x2ec79e(0xc5)]},..._0x3908fb[_0x2ec79e(0x111)]!==undefined&&{'duration':_0x3908fb[_0x2ec79e(0x111)]},..._0x3908fb[_0x2ec79e(0xe9)]!==undefined&&{'from':_0x3908fb[_0x2ec79e(0xe9)]}};}function normalizeActivation(_0x2ca10f){const _0x3b56f5=a89_0x4579;return{'name':_0x2ca10f[_0x3b56f5(0x10e)],'connection':_0x2ca10f['connection'],..._0x2ca10f[_0x3b56f5(0x99)]!==undefined&&{'description':_0x2ca10f[_0x3b56f5(0x99)]},..._0x2ca10f[_0x3b56f5(0x9a)]!==undefined&&{'all_columns':_0x2ca10f[_0x3b56f5(0x9a)]},..._0x2ca10f[_0x3b56f5(0xc0)]!==undefined&&{'columns':_0x2ca10f[_0x3b56f5(0xc0)]},..._0x2ca10f[_0x3b56f5(0xe4)]!==undefined&&{'behavior':_0x2ca10f[_0x3b56f5(0xe4)]},..._0x2ca10f[_0x3b56f5(0x11c)]!==undefined&&{'schedule':_0x2ca10f['schedule']},..._0x2ca10f[_0x3b56f5(0xe1)]!==undefined&&{'notification':_0x2ca10f['notification']},..._0x2ca10f[_0x3b56f5(0xeb)]!==undefined&&{'connector_config':_0x2ca10f[_0x3b56f5(0xeb)]},..._0x2ca10f[_0x3b56f5(0xec)]!==undefined&&{'activation_template_id':_0x2ca10f[_0x3b56f5(0xec)]}};}export function activationResponseToDef(_0x1ac892,_0x293492,_0x5d291c){const _0x48b185=a89_0x4579,_0x1f0189=_0x1ac892[_0x48b185(0x97)]||'',_0x4e494c=_0x5d291c?.[_0x48b185(0x11b)](_0x1f0189)??_0x1f0189,_0x3e7732={'name':_0x1ac892[_0x48b185(0x10e)],'connection':_0x4e494c};_0x1ac892[_0x48b185(0x99)]&&(_0x3e7732['description']=_0x1ac892[_0x48b185(0x99)]);let _0x338491=[];_0x1ac892[_0x48b185(0xc0)]&&_0x1ac892[_0x48b185(0xc0)]['length']>0x0&&(_0x338491=_0x1ac892['columns'][_0x48b185(0xfb)](_0x32f1bd=>_0x32f1bd&&_0x32f1bd[_0x48b185(0x10e)])['map'](_0x39ad30=>{const _0x57d1cb=_0x48b185;if(_0x39ad30['type']||_0x39ad30[_0x57d1cb(0x114)])return{'name':_0x39ad30['name'],..._0x39ad30['type']&&{'type':_0x39ad30['type']},..._0x39ad30['visibility']&&{'visibility':_0x39ad30[_0x57d1cb(0x114)]}};return _0x39ad30[_0x57d1cb(0x10e)];}));_0x338491[_0x48b185(0xa3)]>0x0&&(_0x3e7732[_0x48b185(0xc0)]=_0x338491);_0x1ac892['allColumns']!==undefined&&(_0x1ac892[_0x48b185(0xc1)]===![]&&_0x338491[_0x48b185(0xa3)]===0x0?_0x3e7732['all_columns']=!![]:_0x3e7732[_0x48b185(0x9a)]=_0x1ac892[_0x48b185(0xc1)]);const _0x542ae2={};let _0x2f309e=![];_0x1ac892[_0x48b185(0xea)]&&(_0x542ae2[_0x48b185(0x109)]=_0x1ac892[_0x48b185(0xea)],_0x2f309e=!![]);_0x1ac892[_0x48b185(0xee)]&&(_0x542ae2[_0x48b185(0x87)]=_0x1ac892[_0x48b185(0xee)],_0x2f309e=!![]);_0x1ac892[_0x48b185(0xcc)]!==undefined&&_0x1ac892[_0x48b185(0xcc)]!==null&&(_0x542ae2['repeat_frequency']=_0x1ac892[_0x48b185(0xcc)],_0x2f309e=!![]);_0x1ac892[_0x48b185(0x11e)]&&_0x1ac892[_0x48b185(0x11e)][_0x48b185(0xa3)]>0x0&&(_0x542ae2[_0x48b185(0xb8)]=_0x1ac892[_0x48b185(0x11e)],_0x2f309e=!![]);_0x1ac892[_0x48b185(0x100)]!==undefined&&(_0x542ae2[_0x48b185(0x105)]=_0x1ac892['startAt'],_0x2f309e=!![]);_0x1ac892['endOn']!==undefined&&(_0x542ae2[_0x48b185(0xd6)]=_0x1ac892[_0x48b185(0x9b)],_0x2f309e=!![]);_0x1ac892['timezone']&&(_0x542ae2[_0x48b185(0xfc)]=_0x1ac892['timezone'],_0x2f309e=!![]);_0x2f309e&&(_0x3e7732['schedule']=_0x542ae2);(_0x1ac892[_0x48b185(0xbc)]&&_0x1ac892[_0x48b185(0xbc)][_0x48b185(0xa3)]>0x0||_0x1ac892[_0x48b185(0x8e)]&&_0x1ac892['emailRecipients']['length']>0x0)&&(_0x3e7732[_0x48b185(0xe1)]={},_0x1ac892[_0x48b185(0xbc)]&&_0x1ac892[_0x48b185(0xbc)]['length']>0x0&&(_0x3e7732[_0x48b185(0xe1)][_0x48b185(0xfd)]=_0x1ac892['notifyOn']),_0x1ac892[_0x48b185(0x8e)]&&_0x1ac892[_0x48b185(0x8e)][_0x48b185(0xa3)]>0x0&&(_0x3e7732[_0x48b185(0xe1)][_0x48b185(0x92)]=_0x1ac892['emailRecipients'][_0x48b185(0xd3)](_0x2e487f=>{const _0x3b80c0=_0x48b185,_0x34bfd0=_0x293492?.[_0x3b80c0(0x11b)](_0x2e487f);return _0x34bfd0??String(_0x2e487f);})));_0x1ac892[_0x48b185(0xbb)]&&Object[_0x48b185(0xf6)](_0x1ac892[_0x48b185(0xbb)])[_0x48b185(0xa3)]>0x0&&(_0x3e7732[_0x48b185(0xeb)]=normalizeConnectorConfigForYaml(_0x1ac892['connectorConfig']));_0x1ac892[_0x48b185(0x88)]&&(_0x3e7732['activation_template_id']=_0x1ac892[_0x48b185(0x88)]);if(_0x1ac892['syndicationBehavior']){const _0x3df640={},_0x48e466=_0x1ac892['syndicationBehavior'];_0x48e466[_0x48b185(0xc0)]&&_0x48e466['columns'][_0x48b185(0xa3)]>0x0&&(_0x3df640['columns']=_0x48e466[_0x48b185(0xc0)]['filter'](_0x3e7255=>_0x3e7255&&_0x3e7255[_0x48b185(0x10e)])[_0x48b185(0xd3)](_0x2bd24a=>({'name':_0x2bd24a[_0x48b185(0x10e)],..._0x2bd24a[_0x48b185(0x109)]&&{'type':_0x2bd24a[_0x48b185(0x109)]},..._0x2bd24a[_0x48b185(0x114)]&&{'visibility':_0x2bd24a['visibility']}}))),_0x48e466[_0x48b185(0xa6)]&&(_0x3df640[_0x48b185(0xc8)]=_0x48e466[_0x48b185(0xa6)]),_0x48e466[_0x48b185(0xf1)]!==undefined&&(_0x3df640[_0x48b185(0xb2)]=_0x48e466[_0x48b185(0xf1)]),_0x48e466[_0x48b185(0xa4)]&&(_0x3df640[_0x48b185(0x9c)]=_0x48e466[_0x48b185(0xa4)]),_0x48e466[_0x48b185(0x10d)]&&(_0x3df640['formatting']=_0x48e466['formatting']),_0x48e466['orderBy']&&_0x48e466[_0x48b185(0xa0)]['length']>0x0&&(_0x3df640[_0x48b185(0xce)]=_0x48e466[_0x48b185(0xa0)]),Object[_0x48b185(0xf6)](_0x3df640)[_0x48b185(0xa3)]>0x0&&(_0x3e7732['behavior']=_0x3df640);}return _0x3e7732;}export function journeyActivationStepToYaml(_0xa1da53,_0x58d1d7,_0x213458){const _0x491c24=a89_0x4579,_0x4c73ac=_0xa1da53[_0x491c24(0xff)][_0x491c24(0xb6)],_0x2ac44b=_0x4c73ac[_0x491c24(0x97)]||'',_0x53653c=_0x213458?.['get'](_0x2ac44b)??_0x2ac44b,_0x5bb48d={'name':_0x4c73ac[_0x491c24(0x10e)]||'','connection':_0x53653c};_0x4c73ac['description']&&(_0x5bb48d[_0x491c24(0x99)]=_0x4c73ac['description']);let _0x3db7cf=[];_0x4c73ac['columns']&&_0x4c73ac['columns'][_0x491c24(0xa3)]>0x0&&(_0x3db7cf=_0x4c73ac[_0x491c24(0xc0)][_0x491c24(0xfb)](_0x58e653=>_0x58e653&&_0x58e653[_0x491c24(0x10e)])['map'](_0x105128=>{const _0x40fe33=_0x491c24;if(_0x105128['type']||_0x105128[_0x40fe33(0x114)])return{'name':_0x105128['name'],..._0x105128[_0x40fe33(0x109)]&&{'type':_0x105128[_0x40fe33(0x109)]},..._0x105128[_0x40fe33(0x114)]&&{'visibility':_0x105128[_0x40fe33(0x114)]}};return _0x105128[_0x40fe33(0x10e)];}));_0x3db7cf['length']>0x0&&(_0x5bb48d['columns']=_0x3db7cf);_0x4c73ac[_0x491c24(0xc1)]!==undefined&&(_0x4c73ac[_0x491c24(0xc1)]===![]&&_0x3db7cf[_0x491c24(0xa3)]===0x0?_0x5bb48d[_0x491c24(0x9a)]=!![]:_0x5bb48d[_0x491c24(0x9a)]=_0x4c73ac[_0x491c24(0xc1)]);const _0x42aa8c={};let _0x433183=![];_0x4c73ac[_0x491c24(0xea)]&&(_0x42aa8c[_0x491c24(0x109)]=_0x4c73ac[_0x491c24(0xea)],_0x433183=!![]);_0x4c73ac[_0x491c24(0xee)]&&(_0x42aa8c[_0x491c24(0x87)]=_0x4c73ac['repeatUnit'],_0x433183=!![]);_0x4c73ac[_0x491c24(0xcc)]!==undefined&&_0x4c73ac[_0x491c24(0xcc)]!==null&&(_0x42aa8c[_0x491c24(0xa2)]=_0x4c73ac[_0x491c24(0xcc)],_0x433183=!![]);_0x4c73ac[_0x491c24(0x100)]!==undefined&&(_0x42aa8c['start_at']=_0x4c73ac[_0x491c24(0x100)],_0x433183=!![]);_0x4c73ac[_0x491c24(0x9b)]!==undefined&&(_0x42aa8c['end_on']=_0x4c73ac['endOn'],_0x433183=!![]);_0x4c73ac['timezone']&&(_0x42aa8c[_0x491c24(0xfc)]=_0x4c73ac['timezone'],_0x433183=!![]);_0x433183&&(_0x5bb48d[_0x491c24(0x11c)]=_0x42aa8c);(_0x4c73ac[_0x491c24(0xbc)]&&_0x4c73ac[_0x491c24(0xbc)][_0x491c24(0xa3)]>0x0||_0x4c73ac[_0x491c24(0x8e)]&&_0x4c73ac['emailRecipients'][_0x491c24(0xa3)]>0x0)&&(_0x5bb48d['notification']={},_0x4c73ac[_0x491c24(0xbc)]&&_0x4c73ac[_0x491c24(0xbc)][_0x491c24(0xa3)]>0x0&&(_0x5bb48d[_0x491c24(0xe1)]['notify_on']=_0x4c73ac[_0x491c24(0xbc)]),_0x4c73ac[_0x491c24(0x8e)]&&_0x4c73ac[_0x491c24(0x8e)][_0x491c24(0xa3)]>0x0&&(_0x5bb48d[_0x491c24(0xe1)]['email_recipients']=_0x4c73ac[_0x491c24(0x8e)]['map'](_0x23e3ee=>{const _0x2f0386=_0x58d1d7?.['get'](_0x23e3ee);return _0x2f0386??String(_0x23e3ee);})));_0x4c73ac['connectorConfig']&&Object[_0x491c24(0xf6)](_0x4c73ac[_0x491c24(0xbb)])['length']>0x0&&(_0x5bb48d['connector_config']=normalizeConnectorConfigForYaml(_0x4c73ac[_0x491c24(0xbb)]));_0x4c73ac[_0x491c24(0x88)]&&(_0x5bb48d['activation_template_id']=_0x4c73ac['activationTemplateId']);if(_0x4c73ac[_0x491c24(0xab)]){const _0x171403={},_0x290839=_0x4c73ac['syndicationBehavior'];_0x290839[_0x491c24(0xc0)]&&_0x290839[_0x491c24(0xc0)][_0x491c24(0xa3)]>0x0&&(_0x171403[_0x491c24(0xc0)]=_0x290839['columns'][_0x491c24(0xfb)](_0x3467de=>_0x3467de&&_0x3467de[_0x491c24(0x10e)])['map'](_0x2d541d=>({'name':_0x2d541d[_0x491c24(0x10e)],..._0x2d541d['type']&&{'type':_0x2d541d[_0x491c24(0x109)]},..._0x2d541d[_0x491c24(0x114)]&&{'visibility':_0x2d541d[_0x491c24(0x114)]}}))),_0x290839[_0x491c24(0xa6)]&&(_0x171403['behavior_table']=_0x290839['behaviorTableName']),_0x290839[_0x491c24(0xf1)]!==undefined&&(_0x171403[_0x491c24(0xb2)]=_0x290839[_0x491c24(0xf1)]),_0x290839['joinStrategy']&&(_0x171403['join_strategy']=_0x290839[_0x491c24(0xa4)]),_0x290839['formatting']&&(_0x171403[_0x491c24(0x10d)]=_0x290839[_0x491c24(0x10d)]),_0x290839[_0x491c24(0xa0)]&&_0x290839['orderBy'][_0x491c24(0xa3)]>0x0&&(_0x171403[_0x491c24(0xce)]=_0x290839[_0x491c24(0xa0)]),Object[_0x491c24(0xf6)](_0x171403)['length']>0x0&&(_0x5bb48d['behavior']=_0x171403);}return _0x5bb48d;}export function segmentWithActivationsToYaml(_0x14ac09,_0x22114d,_0x18c502,_0x39b299,_0xf2e7af){const _0x40b721=a89_0x4579,_0x55fbad=segmentResponseToDefSync(_0x14ac09,_0x18c502);return _0x22114d[_0x40b721(0xa3)]>0x0&&(_0x55fbad[_0x40b721(0xba)]=_0x22114d[_0x40b721(0xd3)](_0x1b9edf=>activationResponseToDef(_0x1b9edf,_0x39b299,_0xf2e7af))),_0x55fbad;}function normalizeColumn(_0x28e99d){const _0x586d3b=a89_0x4579;if(typeof _0x28e99d===_0x586d3b(0xf9))return{'name':_0x28e99d};return{'name':_0x28e99d['name'],..._0x28e99d[_0x586d3b(0x109)]&&{'type':_0x28e99d['type']},..._0x28e99d['visibility']&&{'visibility':_0x28e99d[_0x586d3b(0x114)]}};}export async function activationDefToCreateRequest(_0x1a2224,_0x58857d){const _0x5f2dd3=a89_0x4579,_0x57b9ac=_0x58857d?.[_0x5f2dd3(0xa7)],_0x20425f=_0x58857d?.['connectionNameToIdMap'],_0x544a9d=_0x1a2224[_0x5f2dd3(0xb0)];let _0x539b38;const _0x49de39=parseInt(_0x544a9d,0xa);if(!isNaN(_0x49de39)&&String(_0x49de39)===_0x544a9d)_0x539b38=_0x49de39;else{const _0x321a32=_0x20425f?.[_0x5f2dd3(0x11b)](_0x544a9d);if(_0x321a32===undefined)throw new SDKError(ErrorCode[_0x5f2dd3(0x10a)],_0x5f2dd3(0x9d)+_0x544a9d,undefined,{'helpText':'Use\x20\x27tdx\x20connections\x27\x20to\x20list\x20available\x20connections'});_0x539b38=_0x321a32;}const _0x577433={'name':_0x1a2224['name'],'connectionId':_0x539b38};_0x1a2224[_0x5f2dd3(0x99)]&&(_0x577433['description']=_0x1a2224[_0x5f2dd3(0x99)]);let _0x46c960=[];_0x1a2224[_0x5f2dd3(0xc0)]&&_0x1a2224[_0x5f2dd3(0xc0)]['length']>0x0&&(_0x46c960=_0x1a2224[_0x5f2dd3(0xc0)][_0x5f2dd3(0xfb)](_0x3ce4aa=>_0x3ce4aa!=null)[_0x5f2dd3(0xd3)](normalizeColumn));_0x46c960[_0x5f2dd3(0xa3)]>0x0&&(_0x577433[_0x5f2dd3(0xc0)]=_0x46c960);_0x1a2224[_0x5f2dd3(0x9a)]!==undefined&&(_0x1a2224[_0x5f2dd3(0x9a)]===![]&&_0x46c960[_0x5f2dd3(0xa3)]===0x0?_0x577433[_0x5f2dd3(0xc1)]=!![]:_0x577433[_0x5f2dd3(0xc1)]=_0x1a2224['all_columns']);if(_0x1a2224[_0x5f2dd3(0x11c)]){const _0xee29cb=_0x1a2224[_0x5f2dd3(0x11c)];_0xee29cb[_0x5f2dd3(0x109)]&&(_0x577433[_0x5f2dd3(0xea)]=_0xee29cb[_0x5f2dd3(0x109)]),_0xee29cb[_0x5f2dd3(0x87)]&&(_0x577433['repeatUnit']=_0xee29cb['repeat_unit']),_0xee29cb['repeat_frequency']!==undefined&&(_0x577433[_0x5f2dd3(0xcc)]=_0xee29cb['repeat_frequency']),_0xee29cb[_0x5f2dd3(0xb8)]&&(_0x577433[_0x5f2dd3(0x11e)]=_0xee29cb[_0x5f2dd3(0xb8)]),_0xee29cb[_0x5f2dd3(0x105)]!==undefined&&(_0x577433['startAt']=_0xee29cb[_0x5f2dd3(0x105)]),_0xee29cb['end_on']!==undefined&&(_0x577433[_0x5f2dd3(0x9b)]=_0xee29cb['end_on']),_0xee29cb['timezone']&&(_0x577433[_0x5f2dd3(0xfc)]=_0xee29cb[_0x5f2dd3(0xfc)]);}_0x1a2224['notification']&&(_0x1a2224['notification'][_0x5f2dd3(0xfd)]&&(_0x577433[_0x5f2dd3(0xbc)]=_0x1a2224[_0x5f2dd3(0xe1)][_0x5f2dd3(0xfd)]),_0x1a2224[_0x5f2dd3(0xe1)][_0x5f2dd3(0x92)]&&(_0x577433[_0x5f2dd3(0x8e)]=_0x1a2224[_0x5f2dd3(0xe1)][_0x5f2dd3(0x92)][_0x5f2dd3(0xd3)](_0x52bdd7=>{const _0x4850ca=_0x5f2dd3,_0x26f2c5=Number(_0x52bdd7);if(!isNaN(_0x26f2c5)&&String(_0x26f2c5)===_0x52bdd7)return _0x26f2c5;const _0x4a4c1d=_0x57b9ac?.['get'](_0x52bdd7[_0x4850ca(0xc4)]());if(_0x4a4c1d===undefined)throw new SDKError(ErrorCode[_0x4850ca(0x95)],_0x4850ca(0xc9)+_0x52bdd7+_0x4850ca(0x8f));return _0x4a4c1d;})));if(_0x1a2224[_0x5f2dd3(0xeb)]){const _0x2d6c2f=_0x58857d?.[_0x5f2dd3(0xde)]?.[_0x5f2dd3(0x11b)](_0x544a9d);if(_0x2d6c2f&&_0x58857d?.['getSchema'])try{const _0x4e4d2f=await _0x58857d[_0x5f2dd3(0xdc)](_0x2d6c2f),_0x5b6352=validateConnectorConfig(_0x1a2224[_0x5f2dd3(0xeb)],_0x4e4d2f);if(!_0x5b6352[_0x5f2dd3(0x10c)])throw new SDKError(ErrorCode[_0x5f2dd3(0xbf)],_0x5f2dd3(0xe5)+_0x1a2224[_0x5f2dd3(0x10e)]+_0x5f2dd3(0xe3)+formatValidationErrors(_0x5b6352[_0x5f2dd3(0xed)]),undefined,{'helpText':_0x5f2dd3(0xf8)+_0x2d6c2f+_0x5f2dd3(0x96)+formatSchemaAsHelp(_0x4e4d2f)});if(_0x5b6352[_0x5f2dd3(0x8b)]['length']>0x0){const _0x2207d7=formatValidationWarnings(_0x5b6352[_0x5f2dd3(0x8b)]);console[_0x5f2dd3(0xdd)](_0x5f2dd3(0x117)+_0x1a2224[_0x5f2dd3(0x10e)]+_0x5f2dd3(0xe3)+_0x2207d7);}_0x577433[_0x5f2dd3(0xbb)]=transformConfigToLegacy(_0x1a2224[_0x5f2dd3(0xeb)],_0x4e4d2f);}catch(_0xf32bda){if(_0xf32bda instanceof SDKError&&_0xf32bda[_0x5f2dd3(0xac)]===ErrorCode[_0x5f2dd3(0xf7)])_0x577433['connectorConfig']=_0x1a2224[_0x5f2dd3(0xeb)];else throw _0xf32bda;}else _0x577433[_0x5f2dd3(0xbb)]=_0x1a2224[_0x5f2dd3(0xeb)];}_0x1a2224[_0x5f2dd3(0xec)]!==undefined&&(_0x577433[_0x5f2dd3(0x88)]=_0x1a2224[_0x5f2dd3(0xec)]);if(_0x1a2224[_0x5f2dd3(0xe4)]){const _0x423f74=_0x1a2224[_0x5f2dd3(0xe4)],_0x358505={};if(_0x423f74[_0x5f2dd3(0xc0)]&&_0x423f74[_0x5f2dd3(0xc0)][_0x5f2dd3(0xa3)]>0x0){const _0x2434dd=_0x423f74['columns'][_0x5f2dd3(0xfb)](_0x1f500f=>_0x1f500f&&_0x1f500f[_0x5f2dd3(0x10e)]);_0x2434dd[_0x5f2dd3(0xa3)]>0x0&&(_0x358505[_0x5f2dd3(0xc0)]=_0x2434dd);}_0x423f74[_0x5f2dd3(0xc8)]&&(_0x358505[_0x5f2dd3(0xa6)]=_0x423f74[_0x5f2dd3(0xc8)]),_0x423f74['join_row']!==undefined&&(_0x358505['joinRow']=_0x423f74[_0x5f2dd3(0xb2)]),_0x423f74['join_strategy']&&(_0x358505[_0x5f2dd3(0xa4)]=_0x423f74[_0x5f2dd3(0x9c)]),_0x423f74[_0x5f2dd3(0x10d)]&&(_0x358505[_0x5f2dd3(0x10d)]=_0x423f74['formatting']),_0x423f74[_0x5f2dd3(0xce)]&&(_0x358505['orderBy']=_0x423f74[_0x5f2dd3(0xce)]),_0x577433['syndicationBehavior']=_0x358505;}return _0x577433;}export async function activationDefToUpdateRequest(_0x563b07,_0x204ed5){return activationDefToCreateRequest(_0x563b07,_0x204ed5);}export function deepSortObject(_0x292222){const _0x5a3064=a89_0x4579;if(_0x292222===null||typeof _0x292222!==_0x5a3064(0xf3))return _0x292222;if(Array[_0x5a3064(0x98)](_0x292222))return _0x292222[_0x5a3064(0xd3)](deepSortObject)[_0x5a3064(0x89)]((_0xb77e36,_0x19768e)=>JSON[_0x5a3064(0x102)](_0xb77e36)[_0x5a3064(0xcf)](JSON[_0x5a3064(0x102)](_0x19768e)));const _0x476e62={};for(const _0x1bed8f of Object[_0x5a3064(0xf6)](_0x292222)['sort']()){_0x476e62[_0x1bed8f]=deepSortObject(_0x292222[_0x1bed8f]);}return _0x476e62;}export function serializeRule(_0x306e72){const _0x9c3318=a89_0x4579;return JSON[_0x9c3318(0x102)](deepSortObject(_0x306e72));}export function normalizeRuleForMatching(_0x21b76d){return normalizeConditionsForMatching(_0x21b76d);}function normalizeConditionsForMatching(_0xb4251e){const _0x37d5cf=a89_0x4579;if(_0xb4251e===null||typeof _0xb4251e!==_0x37d5cf(0xf3))return _0xb4251e;if(Array[_0x37d5cf(0x98)](_0xb4251e))return _0xb4251e[_0x37d5cf(0xd3)](normalizeConditionsForMatching);const _0x286089=_0xb4251e;if((_0x286089[_0x37d5cf(0x109)]==='include'||_0x286089['type']===_0x37d5cf(0x112))&&typeof _0x286089[_0x37d5cf(0xc3)]===_0x37d5cf(0xf9))return{..._0x286089,'segment':_0x37d5cf(0xc2)};const _0x26b34d={};for(const _0x228239 of Object[_0x37d5cf(0xf6)](_0x286089)){_0x26b34d[_0x228239]=normalizeConditionsForMatching(_0x286089[_0x228239]);}return _0x26b34d;}export function serializeRuleForMatching(_0x4c42ca){const _0x2dfe1d=a89_0x4579;return JSON[_0x2dfe1d(0x102)](deepSortObject(normalizeRuleForMatching(_0x4c42ca)));}export function expandSegmentReferences(_0xf14791,_0x3ac80c,_0x3f390d=new Set()){return expandConditions(_0xf14791,_0x3ac80c,_0x3f390d);}function expandConditions(_0x1b4ad7,_0x1cf12f,_0x3b3e46){const _0x231b74=a89_0x4579;if(_0x1b4ad7===null||typeof _0x1b4ad7!==_0x231b74(0xf3))return _0x1b4ad7;if(Array['isArray'](_0x1b4ad7))return _0x1b4ad7[_0x231b74(0xd3)](_0x3ad8e4=>expandConditions(_0x3ad8e4,_0x1cf12f,_0x3b3e46));const _0x35cc5f=_0x1b4ad7;if((_0x35cc5f[_0x231b74(0x109)]===_0x231b74(0xb9)||_0x35cc5f[_0x231b74(0x109)]==='exclude')&&typeof _0x35cc5f[_0x231b74(0xc3)]===_0x231b74(0xf9)){const _0x10014e=_0x35cc5f[_0x231b74(0xc3)],_0x405681=_0x1cf12f['get'](_0x10014e);if(_0x405681&&!_0x3b3e46[_0x231b74(0xc6)](_0x10014e)){const _0x3d460d=new Set(_0x3b3e46);_0x3d460d[_0x231b74(0xd0)](_0x10014e);const _0x2c00b4=expandConditions(_0x405681,_0x1cf12f,_0x3d460d);return{'type':_0x35cc5f[_0x231b74(0x109)],'expanded_rule':_0x2c00b4};}return{'type':_0x35cc5f['type'],'expanded_rule':_0x231b74(0x10f)};}const _0x5566c7={};for(const _0x2ed656 of Object['keys'](_0x35cc5f)){_0x5566c7[_0x2ed656]=expandConditions(_0x35cc5f[_0x2ed656],_0x1cf12f,_0x3b3e46);}return _0x5566c7;}export function serializeExpandedRule(_0x23f85b,_0x502823){const _0x384133=a89_0x4579,_0x31291b=expandSegmentReferences(_0x23f85b,_0x502823);return JSON[_0x384133(0x102)](deepSortObject(_0x31291b));}export function createSegmentNameContext(_0x48c5a5){const _0x30c5c4=a89_0x4579,_0x44b9d5=new Set(),_0xa4099e=new Map(),_0x546975=new Map();if(_0x48c5a5)for(const [_0x2611a7,_0x4182af]of Object[_0x30c5c4(0xbe)](_0x48c5a5)){if(_0x4182af[_0x30c5c4(0x115)]){const _0x324762=serializeRule(_0x4182af[_0x30c5c4(0x115)]);_0x546975[_0x30c5c4(0xd5)](_0x324762,_0x2611a7),_0x44b9d5['add'](_0x2611a7);}}return{'usedNames':_0x44b9d5,'ruleHashToName':_0xa4099e,'localRuleToName':_0x48c5a5?_0x546975:undefined};}export function resolveSegmentName(_0x1b0b54,_0x4120d9,_0x438e94,_0x475767){const _0x267576=a89_0x4579,_0xaddcc3=serializeRule(_0x4120d9);if(_0x438e94[_0x267576(0x118)]){const _0x42fa05=_0x438e94[_0x267576(0x118)][_0x267576(0x11b)](_0xaddcc3);if(_0x42fa05)return{'name':_0x42fa05,'isDuplicate':![],'isLocalMatch':!![]};}const _0x3d585a=_0x438e94['ruleHashToName'][_0x267576(0x11b)](_0xaddcc3);if(_0x3d585a)return{'name':_0x3d585a,'isDuplicate':!![],'isLocalMatch':![]};const _0x20f3ae=_0x475767(_0x1b0b54);let _0x53008d=_0x20f3ae||_0x1b0b54,_0x1e5360=_0x53008d,_0x38c1c6=0x2;while(_0x438e94[_0x267576(0xb7)][_0x267576(0xc6)](_0x1e5360)){_0x1e5360=_0x53008d+'_'+_0x38c1c6,_0x38c1c6++;}return _0x438e94['usedNames'][_0x267576(0xd0)](_0x1e5360),_0x438e94['ruleHashToName'][_0x267576(0xd5)](_0xaddcc3,_0x1e5360),{'name':_0x1e5360,'isDuplicate':![],'isLocalMatch':![]};}export function collectSegmentRefsFromRule(_0x2a045d){const _0x1c6215=[],_0x3d7fdc=_0x40073a=>{const _0x8fdeb4=a89_0x4579;if(!_0x40073a||typeof _0x40073a!=='object')return;if(Array[_0x8fdeb4(0x98)](_0x40073a)){_0x40073a[_0x8fdeb4(0x107)](_0x3d7fdc);return;}const _0x2e4856=_0x40073a;(_0x2e4856[_0x8fdeb4(0x109)]===_0x8fdeb4(0xb9)||_0x2e4856[_0x8fdeb4(0x109)]===_0x8fdeb4(0x112))&&typeof _0x2e4856[_0x8fdeb4(0xc3)]===_0x8fdeb4(0xf9)&&_0x1c6215[_0x8fdeb4(0x9e)](_0x2e4856['segment']);for(const _0x144b39 of Object[_0x8fdeb4(0x101)](_0x2e4856)){_0x3d7fdc(_0x144b39);}};return _0x3d7fdc(_0x2a045d),_0x1c6215;}export function validateSegmentRule(_0x7c33b1,_0x348a54){const _0x41d8b4=a89_0x4579;if(!_0x348a54||!_0x348a54[_0x41d8b4(0xaa)])return;for(let _0x775013=0x0;_0x775013<_0x348a54['conditions'][_0x41d8b4(0xa3)];_0x775013++){const _0x4ccbe5=_0x348a54[_0x41d8b4(0xaa)][_0x775013];if(_0x41d8b4(0x109)in _0x4ccbe5&&_0x4ccbe5[_0x41d8b4(0x109)]===_0x41d8b4(0xe2)){const _0x37e4fc=_0x4ccbe5;if(!_0x37e4fc[_0x41d8b4(0xa5)]||_0x37e4fc[_0x41d8b4(0xa5)]==='')throw new SDKError(ErrorCode[_0x41d8b4(0xd9)],_0x41d8b4(0xb5)+_0x7c33b1+_0x41d8b4(0xad)+(_0x41d8b4(0xef)+_0x775013+_0x41d8b4(0x119))+_0x41d8b4(0xfe));}}}
|
|
1
|
+
const a89_0x429167=a89_0x5267;(function(_0x5751aa,_0x35ee92){const _0x8085bc=a89_0x5267,_0x12445e=_0x5751aa();while(!![]){try{const _0x70d606=parseInt(_0x8085bc(0xbc))/0x1*(parseInt(_0x8085bc(0x103))/0x2)+-parseInt(_0x8085bc(0xb9))/0x3*(-parseInt(_0x8085bc(0x115))/0x4)+parseInt(_0x8085bc(0xf4))/0x5*(parseInt(_0x8085bc(0x12c))/0x6)+-parseInt(_0x8085bc(0x11f))/0x7*(parseInt(_0x8085bc(0x138))/0x8)+-parseInt(_0x8085bc(0xc9))/0x9*(parseInt(_0x8085bc(0xe8))/0xa)+parseInt(_0x8085bc(0x10f))/0xb*(-parseInt(_0x8085bc(0x13e))/0xc)+-parseInt(_0x8085bc(0x12b))/0xd*(-parseInt(_0x8085bc(0x116))/0xe);if(_0x70d606===_0x35ee92)break;else _0x12445e['push'](_0x12445e['shift']());}catch(_0x17b96c){_0x12445e['push'](_0x12445e['shift']());}}}(a89_0x325b,0xc878b));import*as a89_0x15cfbc from'yaml';import{SDKError,ErrorCode}from'../errors.js';import{validateConnectorConfig,transformConfigToLegacy,normalizeConnectorConfigForYaml,formatValidationErrors,formatValidationWarnings,formatSchemaAsHelp}from'../connection-validator.js';export function segmentResponseToDefSync(_0x3913f1,_0x13d604){const _0x28e197=a89_0x5267;return{'type':'segment','name':_0x3913f1[_0x28e197(0xe3)],..._0x3913f1[_0x28e197(0xda)]&&{'description':_0x3913f1[_0x28e197(0xda)]},..._0x13d604&&{'folder':_0x13d604},..._0x3913f1[_0x28e197(0xe6)]&&{'rule':apiRuleToYaml(_0x3913f1[_0x28e197(0xe6)])},..._0x3913f1[_0x28e197(0xbe)]!==undefined&&{'kind':_0x3913f1[_0x28e197(0xbe)]===0x0?_0x28e197(0xd3):_0x3913f1[_0x28e197(0xbe)]===0x1?_0x28e197(0xb6):_0x28e197(0xce)},..._0x3913f1[_0x28e197(0xcd)]!==undefined&&{'visible':_0x3913f1[_0x28e197(0xcd)]}};}export async function segmentResponseToDef(_0x4835e5,_0x2e61b5,_0x388a5e){const _0x49afab=a89_0x5267,_0x4fd521=segmentResponseToDefSync(_0x4835e5,_0x388a5e);if(!_0x2e61b5||!_0x2e61b5[_0x49afab(0xc0)])return _0x4fd521;return _0x4fd521['rule']&&(_0x4fd521[_0x49afab(0xe6)]=await resolveRuleSegmentRefs(_0x4fd521[_0x49afab(0xe6)],_0x2e61b5[_0x49afab(0xc0)])),_0x4fd521;}export function apiRuleToYaml(_0x12abd4){const _0x33f269=a89_0x5267,_0x5e8b5d=(_0x12abd4[_0x33f269(0x136)]||[])[_0x33f269(0x13a)](apiConditionToYaml);if(_0x5e8b5d['length']===0x1&&!_0x12abd4[_0x33f269(0xda)]&&_0x33f269(0x10c)in _0x5e8b5d[0x0]&&(_0x5e8b5d[0x0][_0x33f269(0x10c)]==='And'||_0x5e8b5d[0x0]['type']==='Or')){const _0x97e55d=_0x5e8b5d[0x0];if(_0x97e55d[_0x33f269(0x10c)]===_0x12abd4[_0x33f269(0x10c)]&&_0x97e55d[_0x33f269(0x136)])return{'type':_0x12abd4['type'],'conditions':_0x97e55d[_0x33f269(0x136)],..._0x97e55d[_0x33f269(0xda)]&&{'description':_0x97e55d[_0x33f269(0xda)]}};}return{'type':_0x12abd4[_0x33f269(0x10c)],'conditions':_0x5e8b5d,..._0x12abd4['description']&&{'description':_0x12abd4[_0x33f269(0xda)]}};}export async function resolveRuleSegmentRefs(_0x138033,_0x3366b1){const _0x4bac66=a89_0x5267,_0x5d801c=await Promise[_0x4bac66(0x12d)](_0x138033[_0x4bac66(0x136)][_0x4bac66(0x13a)](_0x261eb7=>resolveConditionSegmentRefs(_0x261eb7,_0x3366b1)));return{..._0x138033,'conditions':_0x5d801c};}async function resolveConditionSegmentRefs(_0x127da9,_0x460274){const _0xb65cfd=a89_0x5267;if(_0xb65cfd(0x124)in _0x127da9&&(_0x127da9[_0xb65cfd(0x10c)]===_0xb65cfd(0x11d)||_0x127da9[_0xb65cfd(0x10c)]===_0xb65cfd(0xec))){const _0x3a2a93=_0x127da9;if(/^\d+$/[_0xb65cfd(0xc8)](_0x3a2a93[_0xb65cfd(0x124)])){const _0x1fa16a=await _0x460274(_0x3a2a93[_0xb65cfd(0x124)]);return{..._0x3a2a93,'segment':_0x1fa16a};}return _0x127da9;}if('conditions'in _0x127da9&&_0x127da9['conditions']){const _0xeebc15=_0x127da9,_0x44dfd7=await Promise['all'](_0xeebc15[_0xb65cfd(0x136)]['map'](_0x4b8c0b=>resolveConditionSegmentRefs(_0x4b8c0b,_0x460274)));return{..._0xeebc15,'conditions':_0x44dfd7};}if(_0xb65cfd(0x112)in _0x127da9&&_0x127da9['filter']){const _0x3134e9=_0x127da9,_0x47f208=await resolveRuleSegmentRefs(_0x3134e9['filter'],_0x460274);return{..._0x3134e9,'filter':_0x47f208};}return _0x127da9;}export async function resolveRuleSegmentIds(_0x56a362,_0x1f4239){const _0x53bf71=a89_0x5267,_0xe66f2b=await Promise[_0x53bf71(0x12d)](_0x56a362[_0x53bf71(0x136)][_0x53bf71(0x13a)](_0x155113=>resolveConditionSegmentIds(_0x155113,_0x1f4239)));return{..._0x56a362,'conditions':_0xe66f2b};}async function resolveConditionSegmentIds(_0x14cc01,_0x28de38){const _0x520880=a89_0x5267;if(_0x520880(0x124)in _0x14cc01&&(_0x14cc01[_0x520880(0x10c)]===_0x520880(0x11d)||_0x14cc01[_0x520880(0x10c)]==='exclude')){const _0x2e6dc4=_0x14cc01;if(!/^\d+$/[_0x520880(0xc8)](_0x2e6dc4[_0x520880(0x124)])){const _0x14ef7b=await _0x28de38(_0x2e6dc4['segment']);return{..._0x2e6dc4,'segment':_0x14ef7b};}return _0x14cc01;}if(_0x520880(0x136)in _0x14cc01&&_0x14cc01[_0x520880(0x136)]){const _0x2684f2=_0x14cc01,_0x709d77=await Promise[_0x520880(0x12d)](_0x2684f2['conditions'][_0x520880(0x13a)](_0x432158=>resolveConditionSegmentIds(_0x432158,_0x28de38)));return{..._0x2684f2,'conditions':_0x709d77};}if('filter'in _0x14cc01&&_0x14cc01[_0x520880(0x112)]){const _0x1ef4d1=_0x14cc01,_0x23a39a=await resolveRuleSegmentIds(_0x1ef4d1[_0x520880(0x112)],_0x28de38);return{..._0x1ef4d1,'filter':_0x23a39a};}return _0x14cc01;}function apiConditionToYaml(_0x228a3c){const _0x451bdf=a89_0x5267;if(_0x228a3c[_0x451bdf(0x10c)]==='And'||_0x228a3c[_0x451bdf(0x10c)]==='Or'){if(_0x228a3c[_0x451bdf(0x136)]){const _0x318a6e=_0x228a3c[_0x451bdf(0x136)][_0x451bdf(0x13a)](apiConditionToYaml);if(_0x318a6e['length']===0x1&&!_0x228a3c[_0x451bdf(0xda)])return _0x318a6e[0x0];return{'type':_0x228a3c[_0x451bdf(0x10c)],'conditions':_0x318a6e,..._0x228a3c['description']&&{'description':_0x228a3c['description']}};}}if(_0x228a3c[_0x451bdf(0x10c)]===_0x451bdf(0x10d)&&_0x228a3c[_0x451bdf(0xe4)]&&_0x228a3c[_0x451bdf(0x122)]){const _0xc92a14=_0x228a3c[_0x451bdf(0xe4)][_0x451bdf(0x125)]?{'type':_0x228a3c[_0x451bdf(0xe4)][_0x451bdf(0x125)][_0x451bdf(0x10c)],..._0x228a3c[_0x451bdf(0xe4)][_0x451bdf(0x125)][_0x451bdf(0x113)]&&{'groupingColumns':_0x228a3c[_0x451bdf(0xe4)][_0x451bdf(0x125)][_0x451bdf(0x113)]}}:undefined;return{'type':'Value','attribute':_0x228a3c[_0x451bdf(0xe4)][_0x451bdf(0xe3)]||'','operator':apiOperatorToYaml(_0x228a3c[_0x451bdf(0x122)]),..._0x228a3c[_0x451bdf(0xb2)]&&_0x228a3c[_0x451bdf(0xb2)]!==_0x451bdf(0xb1)?{'arrayMatching':_0x228a3c[_0x451bdf(0xb2)]}:{},..._0x228a3c[_0x451bdf(0xec)]?{'exclude':_0x228a3c[_0x451bdf(0xec)]}:{},..._0xc92a14?{'aggregation':_0xc92a14}:{},..._0x228a3c[_0x451bdf(0xe4)][_0x451bdf(0x12e)]?{'source':_0x228a3c[_0x451bdf(0xe4)]['source'][_0x451bdf(0xe3)]}:{},..._0x228a3c['leftValue'][_0x451bdf(0x112)]?{'filter':apiRuleToYaml(_0x228a3c[_0x451bdf(0xe4)][_0x451bdf(0x112)])}:{},..._0x228a3c[_0x451bdf(0xfc)]!==undefined&&_0x228a3c[_0x451bdf(0xfc)]!==null?{'limit':_0x228a3c[_0x451bdf(0xfc)]}:{}};}if(_0x228a3c['type']===_0x451bdf(0x11e)&&_0x228a3c['id'])return{'type':_0x228a3c[_0x451bdf(0xec)]?_0x451bdf(0xec):_0x451bdf(0x11d),'segment':_0x228a3c['id']};return{'type':_0x451bdf(0x134),'conditions':[]};}function isTemporalOperator(_0x21cfbd){return _0x21cfbd==='TimeWithinPast'||_0x21cfbd==='TimeWithinNext';}function getEffectiveValue(_0x393e1b){const _0x13ca7b=a89_0x5267,_0xd67b07=_0x393e1b['values'];return _0x393e1b[_0x13ca7b(0x10b)]??_0xd67b07;}function apiOperatorToYaml(_0xc20531){const _0x2217fa=a89_0x5267;let _0x409d72;if(_0xc20531[_0x2217fa(0x110)]&&_0xc20531['rightValues'][_0x2217fa(0xbd)]>0x0)_0x409d72=_0xc20531['rightValues'];else{if(_0xc20531[_0x2217fa(0x105)]!==undefined)_0x409d72=_0xc20531[_0x2217fa(0x105)];else isTemporalOperator(_0xc20531['type'])&&_0xc20531[_0x2217fa(0x10b)]!==undefined&&(_0x409d72=_0xc20531[_0x2217fa(0x10b)]);}return{'type':mapApiOperatorType(_0xc20531['type']),..._0xc20531[_0x2217fa(0x120)]&&{'not':_0xc20531[_0x2217fa(0x120)]},..._0x409d72!==undefined&&{'value':_0x409d72},..._0xc20531['unit']&&{'unit':_0xc20531[_0x2217fa(0xb7)]}};}function mapApiOperatorType(_0x319a17){return _0x319a17;}export function segmentDefToCreateRequest(_0x939ab4,_0x4f620f){const _0x5e707e=a89_0x5267,_0x198ec9={'name':_0x939ab4['name']};return _0x939ab4['description']&&(_0x198ec9[_0x5e707e(0xda)]=_0x939ab4['description']),_0x939ab4[_0x5e707e(0xe6)]&&(_0x198ec9['rule']=yamlRuleToApi(_0x939ab4[_0x5e707e(0xe6)])),_0x939ab4[_0x5e707e(0xbe)]&&(_0x198ec9[_0x5e707e(0xbe)]=_0x939ab4['kind']==='batch'?0x0:_0x939ab4[_0x5e707e(0xbe)]===_0x5e707e(0xb6)?0x1:0x2),_0x939ab4[_0x5e707e(0xba)]!==undefined&&(_0x198ec9[_0x5e707e(0xcd)]=_0x939ab4['visible']),_0x4f620f&&(_0x198ec9[_0x5e707e(0xfd)]=_0x4f620f),_0x198ec9;}export function segmentDefToUpdateRequest(_0x132cec){const _0x16d85c=a89_0x5267,_0x2c4478={'name':_0x132cec[_0x16d85c(0xe3)]};return _0x132cec[_0x16d85c(0xda)]!==undefined&&(_0x2c4478['description']=_0x132cec[_0x16d85c(0xda)]),_0x132cec['rule']&&(_0x2c4478['rule']=yamlRuleToApi(_0x132cec[_0x16d85c(0xe6)])),_0x132cec[_0x16d85c(0xbe)]&&(_0x2c4478[_0x16d85c(0xbe)]=_0x132cec[_0x16d85c(0xbe)]===_0x16d85c(0xd3)?0x0:_0x132cec['kind']==='realtime'?0x1:0x2),_0x2c4478;}function a89_0x5267(_0x397e2e,_0x16d81c){_0x397e2e=_0x397e2e-0xae;const _0x325b65=a89_0x325b();let _0x52674c=_0x325b65[_0x397e2e];return _0x52674c;}export function yamlRuleToApi(_0x100a61,_0x22df75=![]){const _0x494be3=a89_0x5267,_0x33f3c5=_0x100a61['conditions'][_0x494be3(0x13a)](yamlConditionToApi);if(_0x22df75){const _0x7f2966=_0x33f3c5[_0x494be3(0xe2)](_0x5ad5db=>_0x5ad5db[_0x494be3(0x10c)]==='And'||_0x5ad5db[_0x494be3(0x10c)]==='Or');if(!_0x7f2966&&_0x33f3c5[_0x494be3(0xbd)]>0x0)return{'type':_0x100a61[_0x494be3(0x10c)],'conditions':[{'type':_0x494be3(0x134),'description':_0x100a61[_0x494be3(0xda)]||'','conditions':_0x33f3c5}]};}return{'type':_0x100a61[_0x494be3(0x10c)],'conditions':_0x33f3c5,..._0x100a61['description']&&{'description':_0x100a61[_0x494be3(0xda)]}};}function yamlConditionToApi(_0x1de123){const _0x5db439=a89_0x5267;if(_0x5db439(0x124)in _0x1de123&&(_0x1de123['type']===_0x5db439(0x11d)||_0x1de123[_0x5db439(0x10c)]==='exclude')){const _0x4cb512=_0x1de123;return{'type':_0x5db439(0x11e),'id':_0x4cb512[_0x5db439(0x124)],'exclude':_0x4cb512[_0x5db439(0x10c)]==='exclude'};}if(_0x5db439(0x10c)in _0x1de123&&(_0x1de123['type']==='And'||_0x1de123[_0x5db439(0x10c)]==='Or')){const _0x594cce=_0x1de123;return{'type':_0x594cce[_0x5db439(0x10c)],'conditions':_0x594cce[_0x5db439(0x136)][_0x5db439(0x13a)](yamlConditionToApi),..._0x594cce['description']&&{'description':_0x594cce[_0x5db439(0xda)]}};}const _0x487382=_0x1de123,_0x4a7c08={'type':_0x5db439(0x10d),'leftValue':buildLeftValue(_0x487382),'operator':yamlOperatorToApi(_0x487382[_0x5db439(0x122)]),'exclude':_0x487382[_0x5db439(0xec)]??![],'arrayMatching':_0x487382[_0x5db439(0xb2)]??_0x5db439(0xb1)};return _0x487382[_0x5db439(0xfc)]!==undefined&&(_0x4a7c08[_0x5db439(0xfc)]=_0x487382['limit']),_0x4a7c08;}function buildLeftValue(_0x33be09){const _0x56427e=a89_0x5267,_0x2d7b94={'name':_0x33be09[_0x56427e(0xae)]};return _0x33be09[_0x56427e(0x125)]&&(_0x2d7b94[_0x56427e(0x125)]={'type':_0x33be09[_0x56427e(0x125)][_0x56427e(0x10c)],..._0x33be09[_0x56427e(0x125)]['groupingColumns']&&{'groupingColumns':_0x33be09[_0x56427e(0x125)][_0x56427e(0x113)]}}),_0x33be09['source']&&(_0x2d7b94[_0x56427e(0x12e)]={'name':_0x33be09[_0x56427e(0x12e)]}),_0x33be09[_0x56427e(0x112)]&&(_0x2d7b94['filter']=yamlRuleToApi(_0x33be09[_0x56427e(0x112)])),_0x2d7b94;}function yamlOperatorToApi(_0x2ef887){const _0x2a30e0=a89_0x5267,_0x2a083e={'type':mapYamlOperatorType(_0x2ef887[_0x2a30e0(0x10c)]),'not':_0x2ef887[_0x2a30e0(0x120)]??![]},_0x2dc320=getEffectiveValue(_0x2ef887);if(_0x2dc320!==undefined){if(Array['isArray'](_0x2dc320))_0x2a083e['rightValues']=_0x2dc320;else isTemporalOperator(_0x2ef887[_0x2a30e0(0x10c)])?_0x2a083e[_0x2a30e0(0x10b)]=_0x2dc320:_0x2a083e[_0x2a30e0(0x105)]=_0x2dc320;}return _0x2ef887[_0x2a30e0(0xb7)]&&(_0x2a083e[_0x2a30e0(0xb7)]=_0x2ef887[_0x2a30e0(0xb7)]),_0x2a083e;}function mapYamlOperatorType(_0x4a6e03){return _0x4a6e03;}export function toYamlString(_0x315825){const _0x1084c8=a89_0x5267,_0x4872db=JSON[_0x1084c8(0x107)](JSON[_0x1084c8(0xc2)](_0x315825)),_0x47dd99=a89_0x15cfbc['stringify'](_0x4872db,{'indent':0x2,'lineWidth':0x0,'nullStr':_0x1084c8(0x11a)}),_0x29af5b=[_0x1084c8(0xd1)];let _0x4fb26d=_0x47dd99;for(const _0xcd40b8 of _0x29af5b){_0x4fb26d=_0x4fb26d[_0x1084c8(0xb4)](new RegExp('^('+_0xcd40b8+')','m'),(_0x2858df,_0x1e2663,_0x1f0cc3)=>{if(_0x1f0cc3===0x0||_0x4fb26d[_0x1f0cc3-0x1]==='\x0a'&&_0x4fb26d[_0x1f0cc3-0x2]==='\x0a')return _0x1e2663;return'\x0a'+_0x1e2663;});}return _0x4fb26d;}export function parseYamlString(_0x19bd00){const _0x565019=a89_0x5267,_0x142892=a89_0x15cfbc[_0x565019(0x107)](_0x19bd00);if(!_0x142892[_0x565019(0xe3)])throw new Error(_0x565019(0xd6));if(_0x142892[_0x565019(0x10c)]&&_0x142892['type']!==_0x565019(0x124))throw new Error('YAML\x20type\x20must\x20be\x20\x27segment\x27\x20or\x20omitted,\x20got:\x20'+_0x142892[_0x565019(0x10c)]);return _0x142892;}export function isSegmentYaml(_0x19d778){const _0x380552=a89_0x5267;if(typeof _0x19d778!==_0x380552(0x137)||_0x19d778===null)return![];const _0x3bbd66=_0x19d778;return _0x3bbd66[_0x380552(0x10c)]===_0x380552(0x124)||_0x3bbd66['type']===undefined;}export function generateTemplate(_0x4320b7=a89_0x429167(0x118)){const _0x6af6f0=a89_0x429167,_0x4c04b7={'type':_0x6af6f0(0x124),'name':_0x4320b7,'description':_0x6af6f0(0x117),'rule':{'type':_0x6af6f0(0x134),'conditions':[{'type':_0x6af6f0(0x10d),'attribute':_0x6af6f0(0x106),'operator':{'type':'Equal','value':_0x6af6f0(0x10b)}}]}};return toYamlString(_0x4c04b7);}export function segmentToYamlString(_0x366f05){const _0x3b241b=a89_0x429167,_0x4b8ba6=JSON['parse'](JSON[_0x3b241b(0xc2)](_0x366f05)),_0x428161=a89_0x15cfbc['stringify'](_0x4b8ba6,{'indent':0x2,'lineWidth':0x0,'nullStr':'null'}),_0x200de5=[_0x3b241b(0xd1),'activations:'];let _0x72feee=_0x428161;for(const _0x10ef2d of _0x200de5){_0x72feee=_0x72feee[_0x3b241b(0xb4)](new RegExp('^('+_0x10ef2d+')','m'),(_0x221787,_0x276087,_0x2f8c5d)=>{if(_0x2f8c5d===0x0||_0x72feee[_0x2f8c5d-0x1]==='\x0a'&&_0x72feee[_0x2f8c5d-0x2]==='\x0a')return _0x276087;return'\x0a'+_0x276087;});}return _0x72feee;}export function parseSegmentYamlFile(_0x1f3fc6){const _0x432418=a89_0x429167,_0x299a89=a89_0x15cfbc['parse'](_0x1f3fc6);if(!_0x299a89['name'])throw new Error(_0x432418(0xd6));return _0x299a89;}export function normalizeChildSegmentYaml(_0x3a89f8){const _0x5bfa4a=a89_0x429167;return{'type':_0x5bfa4a(0x124),'name':_0x3a89f8[_0x5bfa4a(0xe3)],..._0x3a89f8[_0x5bfa4a(0xda)]!==undefined&&{'description':_0x3a89f8[_0x5bfa4a(0xda)]},..._0x3a89f8['folder']!==undefined&&{'folder':_0x3a89f8[_0x5bfa4a(0xf7)]},..._0x3a89f8[_0x5bfa4a(0xe6)]&&{'rule':normalizeRule(_0x3a89f8[_0x5bfa4a(0xe6)])},..._0x3a89f8[_0x5bfa4a(0xbe)]!==undefined&&{'kind':_0x3a89f8[_0x5bfa4a(0xbe)]},..._0x3a89f8['visible']!==undefined&&{'visible':_0x3a89f8[_0x5bfa4a(0xba)]},..._0x3a89f8[_0x5bfa4a(0xea)]&&{'activations':_0x3a89f8[_0x5bfa4a(0xea)][_0x5bfa4a(0x13a)](normalizeActivation)}};}export function normalizeRule(_0x4b9882){const _0x22707f=a89_0x429167;return{'type':_0x4b9882[_0x22707f(0x10c)],'conditions':_0x4b9882[_0x22707f(0x136)][_0x22707f(0x13a)](normalizeCondition),..._0x4b9882['description']!==undefined&&{'description':_0x4b9882[_0x22707f(0xda)]}};}function normalizeCondition(_0x5d11cd){const _0x1cf3c9=a89_0x429167;if('segment'in _0x5d11cd&&(_0x5d11cd[_0x1cf3c9(0x10c)]===_0x1cf3c9(0x11d)||_0x5d11cd['type']==='exclude')){const _0x3c37ed=_0x5d11cd;return{'type':_0x3c37ed[_0x1cf3c9(0x10c)],'segment':_0x3c37ed['segment']};}if(_0x1cf3c9(0x10c)in _0x5d11cd&&(_0x5d11cd[_0x1cf3c9(0x10c)]==='And'||_0x5d11cd['type']==='Or')){const _0x464d30=_0x5d11cd;return{'type':_0x464d30[_0x1cf3c9(0x10c)],'conditions':_0x464d30[_0x1cf3c9(0x136)][_0x1cf3c9(0x13a)](normalizeCondition),..._0x464d30[_0x1cf3c9(0xda)]!==undefined&&{'description':_0x464d30[_0x1cf3c9(0xda)]}};}const _0x4cc9a3=_0x5d11cd;return{'type':_0x1cf3c9(0x10d),'attribute':_0x4cc9a3[_0x1cf3c9(0xae)],'operator':normalizeOperator(_0x4cc9a3[_0x1cf3c9(0x122)]),..._0x4cc9a3['arrayMatching']!==undefined&&{'arrayMatching':_0x4cc9a3[_0x1cf3c9(0xb2)]},..._0x4cc9a3[_0x1cf3c9(0xec)]!==undefined&&{'exclude':_0x4cc9a3[_0x1cf3c9(0xec)]},..._0x4cc9a3[_0x1cf3c9(0x125)]!==undefined&&{'aggregation':_0x4cc9a3[_0x1cf3c9(0x125)]},..._0x4cc9a3['source']!==undefined&&{'source':_0x4cc9a3['source']},..._0x4cc9a3[_0x1cf3c9(0x112)]!==undefined&&{'filter':normalizeRule(_0x4cc9a3[_0x1cf3c9(0x112)])},..._0x4cc9a3[_0x1cf3c9(0xfc)]!==undefined&&{'limit':_0x4cc9a3[_0x1cf3c9(0xfc)]}};}function normalizeOperator(_0x4d7341){const _0x185c53=a89_0x429167,_0x2dd1e6=getEffectiveValue(_0x4d7341);return{'type':_0x4d7341['type'],..._0x4d7341[_0x185c53(0x120)]!==undefined&&{'not':_0x4d7341[_0x185c53(0x120)]},..._0x2dd1e6!==undefined&&{'value':_0x2dd1e6},..._0x4d7341[_0x185c53(0xf3)]!==undefined&&{'min':_0x4d7341[_0x185c53(0xf3)]},..._0x4d7341[_0x185c53(0xf8)]!==undefined&&{'max':_0x4d7341[_0x185c53(0xf8)]},..._0x4d7341[_0x185c53(0xb7)]!==undefined&&{'unit':_0x4d7341[_0x185c53(0xb7)]},..._0x4d7341[_0x185c53(0x126)]!==undefined&&{'duration':_0x4d7341[_0x185c53(0x126)]},..._0x4d7341[_0x185c53(0xaf)]!==undefined&&{'from':_0x4d7341[_0x185c53(0xaf)]}};}function normalizeActivation(_0x4e4106){const _0x340d56=a89_0x429167;return{'name':_0x4e4106[_0x340d56(0xe3)],'connection':_0x4e4106[_0x340d56(0xc5)],..._0x4e4106[_0x340d56(0xda)]!==undefined&&{'description':_0x4e4106[_0x340d56(0xda)]},..._0x4e4106['all_columns']!==undefined&&{'all_columns':_0x4e4106[_0x340d56(0xf0)]},..._0x4e4106[_0x340d56(0x132)]!==undefined&&{'columns':_0x4e4106['columns']},..._0x4e4106['behavior']!==undefined&&{'behavior':_0x4e4106[_0x340d56(0xde)]},..._0x4e4106[_0x340d56(0xb0)]!==undefined&&{'schedule':_0x4e4106[_0x340d56(0xb0)]},..._0x4e4106[_0x340d56(0x139)]!==undefined&&{'notification':_0x4e4106[_0x340d56(0x139)]},..._0x4e4106[_0x340d56(0xed)]!==undefined&&{'connector_config':_0x4e4106[_0x340d56(0xed)]},..._0x4e4106[_0x340d56(0xe1)]!==undefined&&{'activation_template_id':_0x4e4106['activation_template_id']}};}export function activationResponseToDef(_0x3f3fda,_0x132cd8,_0x291efc){const _0x29ce55=a89_0x429167,_0x501c94=_0x3f3fda['connectionId']||'',_0x2b76e4=_0x291efc?.[_0x29ce55(0xb8)](_0x501c94)??_0x501c94,_0x5bbaa2={'name':_0x3f3fda[_0x29ce55(0xe3)],'connection':_0x2b76e4};_0x3f3fda[_0x29ce55(0xda)]&&(_0x5bbaa2[_0x29ce55(0xda)]=_0x3f3fda['description']);let _0x2ffe25=[];_0x3f3fda[_0x29ce55(0x132)]&&_0x3f3fda['columns']['length']>0x0&&(_0x2ffe25=_0x3f3fda[_0x29ce55(0x132)][_0x29ce55(0x112)](_0x4b0f9e=>_0x4b0f9e&&_0x4b0f9e[_0x29ce55(0xe3)])[_0x29ce55(0x13a)](_0x32e6e0=>{const _0x4b3ca6=_0x29ce55;if(_0x32e6e0[_0x4b3ca6(0x10c)]||_0x32e6e0[_0x4b3ca6(0xcf)])return{'name':_0x32e6e0[_0x4b3ca6(0xe3)],..._0x32e6e0[_0x4b3ca6(0x10c)]&&{'type':_0x32e6e0[_0x4b3ca6(0x10c)]},..._0x32e6e0[_0x4b3ca6(0xcf)]&&{'visibility':_0x32e6e0['visibility']}};return _0x32e6e0[_0x4b3ca6(0xe3)];}));_0x2ffe25['length']>0x0&&(_0x5bbaa2[_0x29ce55(0x132)]=_0x2ffe25);_0x3f3fda[_0x29ce55(0xd2)]!==undefined&&(_0x3f3fda[_0x29ce55(0xd2)]===![]&&_0x2ffe25[_0x29ce55(0xbd)]===0x0?_0x5bbaa2[_0x29ce55(0xf0)]=!![]:_0x5bbaa2[_0x29ce55(0xf0)]=_0x3f3fda[_0x29ce55(0xd2)]);const _0xa90bca={};let _0x24f6f8=![];_0x3f3fda[_0x29ce55(0xeb)]&&(_0xa90bca[_0x29ce55(0x10c)]=_0x3f3fda[_0x29ce55(0xeb)],_0x24f6f8=!![]);_0x3f3fda[_0x29ce55(0x123)]&&(_0xa90bca[_0x29ce55(0xef)]=_0x3f3fda[_0x29ce55(0x123)],_0x24f6f8=!![]);_0x3f3fda[_0x29ce55(0xe9)]!==undefined&&_0x3f3fda['repeatFrequency']!==null&&(_0xa90bca[_0x29ce55(0xb3)]=_0x3f3fda[_0x29ce55(0xe9)],_0x24f6f8=!![]);_0x3f3fda[_0x29ce55(0x13d)]&&_0x3f3fda[_0x29ce55(0x13d)][_0x29ce55(0xbd)]>0x0&&(_0xa90bca[_0x29ce55(0x114)]=_0x3f3fda[_0x29ce55(0x13d)],_0x24f6f8=!![]);_0x3f3fda[_0x29ce55(0xf1)]!==undefined&&(_0xa90bca[_0x29ce55(0xe5)]=_0x3f3fda[_0x29ce55(0xf1)],_0x24f6f8=!![]);_0x3f3fda[_0x29ce55(0xcc)]!==undefined&&(_0xa90bca[_0x29ce55(0xc7)]=_0x3f3fda[_0x29ce55(0xcc)],_0x24f6f8=!![]);_0x3f3fda[_0x29ce55(0x10a)]&&(_0xa90bca[_0x29ce55(0x10a)]=_0x3f3fda['timezone'],_0x24f6f8=!![]);_0x24f6f8&&(_0x5bbaa2[_0x29ce55(0xb0)]=_0xa90bca);(_0x3f3fda[_0x29ce55(0xcb)]&&_0x3f3fda['notifyOn'][_0x29ce55(0xbd)]>0x0||_0x3f3fda[_0x29ce55(0xd7)]&&_0x3f3fda[_0x29ce55(0xd7)]['length']>0x0)&&(_0x5bbaa2[_0x29ce55(0x139)]={},_0x3f3fda[_0x29ce55(0xcb)]&&_0x3f3fda[_0x29ce55(0xcb)][_0x29ce55(0xbd)]>0x0&&(_0x5bbaa2[_0x29ce55(0x139)][_0x29ce55(0xd8)]=_0x3f3fda[_0x29ce55(0xcb)]),_0x3f3fda[_0x29ce55(0xd7)]&&_0x3f3fda[_0x29ce55(0xd7)][_0x29ce55(0xbd)]>0x0&&(_0x5bbaa2[_0x29ce55(0x139)][_0x29ce55(0x128)]=_0x3f3fda['emailRecipients'][_0x29ce55(0x13a)](_0x1b71fd=>{const _0x5e91ea=_0x132cd8?.['get'](_0x1b71fd);return _0x5e91ea??String(_0x1b71fd);})));_0x3f3fda[_0x29ce55(0x131)]&&Object[_0x29ce55(0xff)](_0x3f3fda[_0x29ce55(0x131)])[_0x29ce55(0xbd)]>0x0&&(_0x5bbaa2[_0x29ce55(0xed)]=normalizeConnectorConfigForYaml(_0x3f3fda[_0x29ce55(0x131)]));_0x3f3fda[_0x29ce55(0xd9)]&&(_0x5bbaa2[_0x29ce55(0xe1)]=_0x3f3fda[_0x29ce55(0xd9)]);if(_0x3f3fda[_0x29ce55(0xe0)]){const _0x40ca4c={},_0x4b085f=_0x3f3fda[_0x29ce55(0xe0)];_0x4b085f['columns']&&_0x4b085f['columns'][_0x29ce55(0xbd)]>0x0&&(_0x40ca4c['columns']=_0x4b085f[_0x29ce55(0x132)][_0x29ce55(0x112)](_0x3edb36=>_0x3edb36&&_0x3edb36[_0x29ce55(0xe3)])[_0x29ce55(0x13a)](_0x4bf930=>({'name':_0x4bf930['name'],..._0x4bf930['type']&&{'type':_0x4bf930[_0x29ce55(0x10c)]},..._0x4bf930[_0x29ce55(0xcf)]&&{'visibility':_0x4bf930[_0x29ce55(0xcf)]}}))),_0x4b085f['behaviorTableName']&&(_0x40ca4c[_0x29ce55(0xfe)]=_0x4b085f[_0x29ce55(0x12a)]),_0x4b085f[_0x29ce55(0xf9)]!==undefined&&(_0x40ca4c[_0x29ce55(0xdd)]=_0x4b085f[_0x29ce55(0xf9)]),_0x4b085f[_0x29ce55(0xfa)]&&(_0x40ca4c['join_strategy']=_0x4b085f[_0x29ce55(0xfa)]),_0x4b085f['formatting']&&(_0x40ca4c[_0x29ce55(0x101)]=_0x4b085f['formatting']),_0x4b085f[_0x29ce55(0xee)]&&_0x4b085f[_0x29ce55(0xee)]['length']>0x0&&(_0x40ca4c[_0x29ce55(0x119)]=_0x4b085f[_0x29ce55(0xee)]),Object[_0x29ce55(0xff)](_0x40ca4c)[_0x29ce55(0xbd)]>0x0&&(_0x5bbaa2[_0x29ce55(0xde)]=_0x40ca4c);}return _0x5bbaa2;}export function journeyActivationStepToYaml(_0xcf32a0,_0x344e8e,_0x2b9c4d){const _0x11a112=a89_0x429167,_0x11af2a=_0xcf32a0[_0x11a112(0x121)][_0x11a112(0xc6)],_0x2dee2b=_0x11af2a[_0x11a112(0xe7)]||'',_0xd787d2=_0x2b9c4d?.[_0x11a112(0xb8)](_0x2dee2b)??_0x2dee2b,_0x3a422c={'name':_0x11af2a['name']||'','connection':_0xd787d2};_0x11af2a[_0x11a112(0xda)]&&(_0x3a422c[_0x11a112(0xda)]=_0x11af2a[_0x11a112(0xda)]);let _0x2667c6=[];_0x11af2a[_0x11a112(0x132)]&&_0x11af2a[_0x11a112(0x132)][_0x11a112(0xbd)]>0x0&&(_0x2667c6=_0x11af2a[_0x11a112(0x132)][_0x11a112(0x112)](_0x2c773a=>_0x2c773a&&_0x2c773a[_0x11a112(0xe3)])[_0x11a112(0x13a)](_0x1bf575=>{const _0x4028ac=_0x11a112;if(_0x1bf575[_0x4028ac(0x10c)]||_0x1bf575[_0x4028ac(0xcf)])return{'name':_0x1bf575['name'],..._0x1bf575[_0x4028ac(0x10c)]&&{'type':_0x1bf575[_0x4028ac(0x10c)]},..._0x1bf575[_0x4028ac(0xcf)]&&{'visibility':_0x1bf575['visibility']}};return _0x1bf575['name'];}));_0x2667c6[_0x11a112(0xbd)]>0x0&&(_0x3a422c[_0x11a112(0x132)]=_0x2667c6);_0x11af2a['allColumns']!==undefined&&(_0x11af2a[_0x11a112(0xd2)]===![]&&_0x2667c6[_0x11a112(0xbd)]===0x0?_0x3a422c[_0x11a112(0xf0)]=!![]:_0x3a422c[_0x11a112(0xf0)]=_0x11af2a[_0x11a112(0xd2)]);const _0x5d2970={};let _0x458aa5=![];_0x11af2a[_0x11a112(0xeb)]&&(_0x5d2970['type']=_0x11af2a['scheduleType'],_0x458aa5=!![]);_0x11af2a[_0x11a112(0x123)]&&(_0x5d2970[_0x11a112(0xef)]=_0x11af2a[_0x11a112(0x123)],_0x458aa5=!![]);_0x11af2a[_0x11a112(0xe9)]!==undefined&&_0x11af2a['repeatFrequency']!==null&&(_0x5d2970[_0x11a112(0xb3)]=_0x11af2a[_0x11a112(0xe9)],_0x458aa5=!![]);_0x11af2a[_0x11a112(0xf1)]!==undefined&&(_0x5d2970[_0x11a112(0xe5)]=_0x11af2a[_0x11a112(0xf1)],_0x458aa5=!![]);_0x11af2a[_0x11a112(0xcc)]!==undefined&&(_0x5d2970[_0x11a112(0xc7)]=_0x11af2a[_0x11a112(0xcc)],_0x458aa5=!![]);_0x11af2a[_0x11a112(0x10a)]&&(_0x5d2970[_0x11a112(0x10a)]=_0x11af2a['timezone'],_0x458aa5=!![]);_0x458aa5&&(_0x3a422c[_0x11a112(0xb0)]=_0x5d2970);(_0x11af2a['notifyOn']&&_0x11af2a['notifyOn'][_0x11a112(0xbd)]>0x0||_0x11af2a[_0x11a112(0xd7)]&&_0x11af2a[_0x11a112(0xd7)][_0x11a112(0xbd)]>0x0)&&(_0x3a422c[_0x11a112(0x139)]={},_0x11af2a['notifyOn']&&_0x11af2a['notifyOn']['length']>0x0&&(_0x3a422c['notification'][_0x11a112(0xd8)]=_0x11af2a[_0x11a112(0xcb)]),_0x11af2a[_0x11a112(0xd7)]&&_0x11af2a[_0x11a112(0xd7)][_0x11a112(0xbd)]>0x0&&(_0x3a422c[_0x11a112(0x139)][_0x11a112(0x128)]=_0x11af2a[_0x11a112(0xd7)][_0x11a112(0x13a)](_0x3fd104=>{const _0xbf1940=_0x344e8e?.['get'](_0x3fd104);return _0xbf1940??String(_0x3fd104);})));_0x11af2a[_0x11a112(0x131)]&&Object[_0x11a112(0xff)](_0x11af2a[_0x11a112(0x131)])[_0x11a112(0xbd)]>0x0&&(_0x3a422c[_0x11a112(0xed)]=normalizeConnectorConfigForYaml(_0x11af2a[_0x11a112(0x131)]));_0x11af2a['activationTemplateId']&&(_0x3a422c['activation_template_id']=_0x11af2a['activationTemplateId']);if(_0x11af2a[_0x11a112(0xe0)]){const _0x4baba0={},_0x58aa15=_0x11af2a[_0x11a112(0xe0)];_0x58aa15['columns']&&_0x58aa15[_0x11a112(0x132)][_0x11a112(0xbd)]>0x0&&(_0x4baba0['columns']=_0x58aa15[_0x11a112(0x132)][_0x11a112(0x112)](_0x32e2f7=>_0x32e2f7&&_0x32e2f7['name'])[_0x11a112(0x13a)](_0x705461=>({'name':_0x705461[_0x11a112(0xe3)],..._0x705461[_0x11a112(0x10c)]&&{'type':_0x705461[_0x11a112(0x10c)]},..._0x705461[_0x11a112(0xcf)]&&{'visibility':_0x705461[_0x11a112(0xcf)]}}))),_0x58aa15['behaviorTableName']&&(_0x4baba0[_0x11a112(0xfe)]=_0x58aa15[_0x11a112(0x12a)]),_0x58aa15[_0x11a112(0xf9)]!==undefined&&(_0x4baba0['join_row']=_0x58aa15[_0x11a112(0xf9)]),_0x58aa15[_0x11a112(0xfa)]&&(_0x4baba0[_0x11a112(0xf2)]=_0x58aa15['joinStrategy']),_0x58aa15[_0x11a112(0x101)]&&(_0x4baba0['formatting']=_0x58aa15[_0x11a112(0x101)]),_0x58aa15[_0x11a112(0xee)]&&_0x58aa15[_0x11a112(0xee)][_0x11a112(0xbd)]>0x0&&(_0x4baba0[_0x11a112(0x119)]=_0x58aa15['orderBy']),Object['keys'](_0x4baba0)[_0x11a112(0xbd)]>0x0&&(_0x3a422c[_0x11a112(0xde)]=_0x4baba0);}return _0x3a422c;}export function segmentWithActivationsToYaml(_0x5832db,_0x28d8a6,_0x34f676,_0x33ce61,_0x1c2c3f){const _0x498f95=a89_0x429167,_0x18a591=segmentResponseToDefSync(_0x5832db,_0x34f676);return _0x28d8a6[_0x498f95(0xbd)]>0x0&&(_0x18a591[_0x498f95(0xea)]=_0x28d8a6[_0x498f95(0x13a)](_0x4bc320=>activationResponseToDef(_0x4bc320,_0x33ce61,_0x1c2c3f))),_0x18a591;}function a89_0x325b(){const _0x58db78=['leftValue','start_at','rule','connectionId','6969430ZXVQWI','repeatFrequency','activations','scheduleType','exclude','connector_config','orderBy','repeat_unit','all_columns','startAt','join_strategy','min','1650680SRGGch','JOURNEY_SYNTAX_ERROR','emailToIdMap','folder','max','joinRow','joinStrategy','valid','limit','segmentFolderId','behavior_table','keys','INVALID_ARGUMENT','formatting','usedNames','12LAGELP','Use\x20\x27tdx\x20connections\x27\x20to\x20list\x20available\x20connections','rightValue','attribute_name','parse','isArray','localRuleToName','timezone','value','type','Value','getSchema','824318QMBQTQ','rightValues','toLowerCase','filter','groupingColumns','repeat_sub_frequency','18652KlfwTh','1800218wekbNN','Segment\x20description','New\x20Segment','order_by','null','string','connector_config\x20for\x20activation\x20\x22','include','Reference','25704VJNcdv','not','attributes','operator','repeatUnit','segment','aggregation','duration','Please\x20specify\x20a\x20valid\x20attribute\x20name.','email_recipients','sort','behaviorTableName','286DvamOV','6XDCinT','all','source','.\x20Use\x20\x27tdx\x20user\x20list\x27\x20to\x20see\x20valid\x20emails.','code','connectorConfig','columns','connectionNameToTypeMap','And','Connector:\x20','conditions','object','2776ZaFLbj','notification','map','CONNECTION_NOT_FOUND','ruleHashToName','repeatSubFrequency','192RAiRnT','attribute','from','schedule','any','arrayMatching','repeat_frequency','replace','add','realtime','unit','get','951Aqvysi','visible','localeCompare','8498PGQWPC','length','kind','entries','resolveSegmentName','values','stringify','warnings','\x0a\x0aAvailable\x20fields:\x0a','connection','activationParams','end_on','test','18WlTqKV','forEach','notifyOn','endOn','isVisible','funnel_stage','visibility','errors','rule:','allColumns','batch','\x22:\x0a','CONNECTOR_SCHEMA_NOT_FOUND','YAML\x20config\x20missing\x20required\x20field:\x20name','emailRecipients','notify_on','activationTemplateId','description','has','CONNECTOR_INVALID_CONFIG','join_row','behavior','Invalid\x20connector_config\x20for\x20activation\x20\x22','syndicationBehavior','activation_template_id','every','name'];a89_0x325b=function(){return _0x58db78;};return a89_0x325b();}function normalizeColumn(_0x5c2766){const _0x3958c4=a89_0x429167;if(typeof _0x5c2766===_0x3958c4(0x11b))return{'name':_0x5c2766};return{'name':_0x5c2766['name'],..._0x5c2766[_0x3958c4(0x10c)]&&{'type':_0x5c2766[_0x3958c4(0x10c)]},..._0x5c2766[_0x3958c4(0xcf)]&&{'visibility':_0x5c2766['visibility']}};}export async function activationDefToCreateRequest(_0xeba313,_0x147f24){const _0x3201db=a89_0x429167,_0x526aef=_0x147f24?.[_0x3201db(0xf6)],_0x1dc022=_0x147f24?.['connectionNameToIdMap'],_0x4cdf3c=_0xeba313['connection'];let _0x42c947;const _0x38481e=parseInt(_0x4cdf3c,0xa);if(!isNaN(_0x38481e)&&String(_0x38481e)===_0x4cdf3c)_0x42c947=_0x38481e;else{const _0x62fa77=_0x1dc022?.[_0x3201db(0xb8)](_0x4cdf3c);if(_0x62fa77===undefined)throw new SDKError(ErrorCode[_0x3201db(0x13b)],'Unknown\x20connection:\x20'+_0x4cdf3c,undefined,{'helpText':_0x3201db(0x104)});_0x42c947=_0x62fa77;}const _0x28c2d5={'name':_0xeba313[_0x3201db(0xe3)],'connectionId':_0x42c947};_0xeba313[_0x3201db(0xda)]&&(_0x28c2d5['description']=_0xeba313['description']);let _0x1c6946=[];_0xeba313['columns']&&_0xeba313['columns']['length']>0x0&&(_0x1c6946=_0xeba313[_0x3201db(0x132)][_0x3201db(0x112)](_0x29047a=>_0x29047a!=null)[_0x3201db(0x13a)](normalizeColumn));_0x1c6946[_0x3201db(0xbd)]>0x0&&(_0x28c2d5['columns']=_0x1c6946);_0xeba313[_0x3201db(0xf0)]!==undefined&&(_0xeba313[_0x3201db(0xf0)]===![]&&_0x1c6946[_0x3201db(0xbd)]===0x0?_0x28c2d5['allColumns']=!![]:_0x28c2d5['allColumns']=_0xeba313[_0x3201db(0xf0)]);if(_0xeba313[_0x3201db(0xb0)]){const _0x2affaf=_0xeba313['schedule'];_0x2affaf['type']&&(_0x28c2d5[_0x3201db(0xeb)]=_0x2affaf[_0x3201db(0x10c)]),_0x2affaf[_0x3201db(0xef)]&&(_0x28c2d5[_0x3201db(0x123)]=_0x2affaf['repeat_unit']),_0x2affaf['repeat_frequency']!==undefined&&(_0x28c2d5[_0x3201db(0xe9)]=_0x2affaf[_0x3201db(0xb3)]),_0x2affaf[_0x3201db(0x114)]&&(_0x28c2d5['repeatSubFrequency']=_0x2affaf[_0x3201db(0x114)]),_0x2affaf['start_at']!==undefined&&(_0x28c2d5[_0x3201db(0xf1)]=_0x2affaf['start_at']),_0x2affaf[_0x3201db(0xc7)]!==undefined&&(_0x28c2d5[_0x3201db(0xcc)]=_0x2affaf[_0x3201db(0xc7)]),_0x2affaf['timezone']&&(_0x28c2d5[_0x3201db(0x10a)]=_0x2affaf[_0x3201db(0x10a)]);}_0xeba313[_0x3201db(0x139)]&&(_0xeba313['notification'][_0x3201db(0xd8)]&&(_0x28c2d5[_0x3201db(0xcb)]=_0xeba313[_0x3201db(0x139)][_0x3201db(0xd8)]),_0xeba313[_0x3201db(0x139)][_0x3201db(0x128)]&&(_0x28c2d5[_0x3201db(0xd7)]=_0xeba313[_0x3201db(0x139)]['email_recipients'][_0x3201db(0x13a)](_0x467959=>{const _0x4be4a7=_0x3201db,_0x864907=Number(_0x467959);if(!isNaN(_0x864907)&&String(_0x864907)===_0x467959)return _0x864907;const _0x3291d3=_0x526aef?.[_0x4be4a7(0xb8)](_0x467959[_0x4be4a7(0x111)]());if(_0x3291d3===undefined)throw new SDKError(ErrorCode[_0x4be4a7(0x100)],'Unknown\x20email\x20recipient:\x20'+_0x467959+_0x4be4a7(0x12f));return _0x3291d3;})));if(_0xeba313[_0x3201db(0xed)]){const _0x57b8a0=_0x147f24?.[_0x3201db(0x133)]?.[_0x3201db(0xb8)](_0x4cdf3c);if(_0x57b8a0&&_0x147f24?.[_0x3201db(0x10e)])try{const _0x2a1ffe=await _0x147f24[_0x3201db(0x10e)](_0x57b8a0),_0x424c6d=validateConnectorConfig(_0xeba313[_0x3201db(0xed)],_0x2a1ffe);if(!_0x424c6d[_0x3201db(0xfb)])throw new SDKError(ErrorCode[_0x3201db(0xdc)],_0x3201db(0xdf)+_0xeba313[_0x3201db(0xe3)]+_0x3201db(0xd4)+formatValidationErrors(_0x424c6d[_0x3201db(0xd0)]),undefined,{'helpText':_0x3201db(0x135)+_0x57b8a0+_0x3201db(0xc4)+formatSchemaAsHelp(_0x2a1ffe)});if(_0x424c6d[_0x3201db(0xc3)][_0x3201db(0xbd)]>0x0){const _0x171ef2=formatValidationWarnings(_0x424c6d[_0x3201db(0xc3)]);console['warn'](_0x3201db(0x11c)+_0xeba313[_0x3201db(0xe3)]+_0x3201db(0xd4)+_0x171ef2);}_0x28c2d5[_0x3201db(0x131)]=transformConfigToLegacy(_0xeba313[_0x3201db(0xed)],_0x2a1ffe);}catch(_0x2d5770){if(_0x2d5770 instanceof SDKError&&_0x2d5770[_0x3201db(0x130)]===ErrorCode[_0x3201db(0xd5)])_0x28c2d5[_0x3201db(0x131)]=_0xeba313[_0x3201db(0xed)];else throw _0x2d5770;}else _0x28c2d5[_0x3201db(0x131)]=_0xeba313[_0x3201db(0xed)];}_0xeba313[_0x3201db(0xe1)]!==undefined&&(_0x28c2d5[_0x3201db(0xd9)]=_0xeba313[_0x3201db(0xe1)]);if(_0xeba313[_0x3201db(0xde)]){const _0x56336e=_0xeba313[_0x3201db(0xde)],_0x2d2d9a={};if(_0x56336e[_0x3201db(0x132)]&&_0x56336e[_0x3201db(0x132)][_0x3201db(0xbd)]>0x0){const _0x87ed2=_0x56336e[_0x3201db(0x132)][_0x3201db(0x112)](_0x4104aa=>_0x4104aa&&_0x4104aa['name']);_0x87ed2[_0x3201db(0xbd)]>0x0&&(_0x2d2d9a[_0x3201db(0x132)]=_0x87ed2);}_0x56336e[_0x3201db(0xfe)]&&(_0x2d2d9a['behaviorTableName']=_0x56336e[_0x3201db(0xfe)]),_0x56336e['join_row']!==undefined&&(_0x2d2d9a[_0x3201db(0xf9)]=_0x56336e['join_row']),_0x56336e[_0x3201db(0xf2)]&&(_0x2d2d9a['joinStrategy']=_0x56336e[_0x3201db(0xf2)]),_0x56336e[_0x3201db(0x101)]&&(_0x2d2d9a[_0x3201db(0x101)]=_0x56336e[_0x3201db(0x101)]),_0x56336e[_0x3201db(0x119)]&&(_0x2d2d9a[_0x3201db(0xee)]=_0x56336e[_0x3201db(0x119)]),_0x28c2d5[_0x3201db(0xe0)]=_0x2d2d9a;}return _0x28c2d5;}export async function activationDefToUpdateRequest(_0x1ae8d3,_0x3b3e86){return activationDefToCreateRequest(_0x1ae8d3,_0x3b3e86);}export function deepSortObject(_0x7dec0c){const _0x286f7b=a89_0x429167;if(_0x7dec0c===null||typeof _0x7dec0c!=='object')return _0x7dec0c;if(Array[_0x286f7b(0x108)](_0x7dec0c))return _0x7dec0c[_0x286f7b(0x13a)](deepSortObject)[_0x286f7b(0x129)]((_0x27807b,_0xcc5bc4)=>JSON['stringify'](_0x27807b)[_0x286f7b(0xbb)](JSON[_0x286f7b(0xc2)](_0xcc5bc4)));const _0xf15cf7={};for(const _0x4e910e of Object[_0x286f7b(0xff)](_0x7dec0c)['sort']()){_0xf15cf7[_0x4e910e]=deepSortObject(_0x7dec0c[_0x4e910e]);}return _0xf15cf7;}export function serializeRule(_0x4e32e0){const _0x49a149=a89_0x429167;return JSON[_0x49a149(0xc2)](deepSortObject(_0x4e32e0));}export function normalizeRuleForMatching(_0x5763b9){return normalizeConditionsForMatching(_0x5763b9);}function normalizeConditionsForMatching(_0x350be6){const _0x1f5932=a89_0x429167;if(_0x350be6===null||typeof _0x350be6!==_0x1f5932(0x137))return _0x350be6;if(Array[_0x1f5932(0x108)](_0x350be6))return _0x350be6[_0x1f5932(0x13a)](normalizeConditionsForMatching);const _0x2fdb3d=_0x350be6;if((_0x2fdb3d[_0x1f5932(0x10c)]===_0x1f5932(0x11d)||_0x2fdb3d['type']===_0x1f5932(0xec))&&typeof _0x2fdb3d[_0x1f5932(0x124)]===_0x1f5932(0x11b))return{..._0x2fdb3d,'segment':'__SEGMENT_REF__'};const _0x54d778={};for(const _0x3a6e89 of Object[_0x1f5932(0xff)](_0x2fdb3d)){_0x54d778[_0x3a6e89]=normalizeConditionsForMatching(_0x2fdb3d[_0x3a6e89]);}return _0x54d778;}export function serializeRuleForMatching(_0x6e40fc){const _0x463726=a89_0x429167;return JSON[_0x463726(0xc2)](deepSortObject(normalizeRuleForMatching(_0x6e40fc)));}export function expandSegmentReferences(_0x3286b1,_0xd9422d,_0x355d20=new Set()){return expandConditions(_0x3286b1,_0xd9422d,_0x355d20);}function expandConditions(_0x11e699,_0x36e23c,_0x26b7e7){const _0x16fbcc=a89_0x429167;if(_0x11e699===null||typeof _0x11e699!==_0x16fbcc(0x137))return _0x11e699;if(Array[_0x16fbcc(0x108)](_0x11e699))return _0x11e699[_0x16fbcc(0x13a)](_0x18775b=>expandConditions(_0x18775b,_0x36e23c,_0x26b7e7));const _0x47b428=_0x11e699;if((_0x47b428[_0x16fbcc(0x10c)]==='include'||_0x47b428['type']==='exclude')&&typeof _0x47b428[_0x16fbcc(0x124)]===_0x16fbcc(0x11b)){const _0x324a11=_0x47b428[_0x16fbcc(0x124)],_0x1e380e=_0x36e23c[_0x16fbcc(0xb8)](_0x324a11);if(_0x1e380e&&!_0x26b7e7['has'](_0x324a11)){const _0x2652c5=new Set(_0x26b7e7);_0x2652c5[_0x16fbcc(0xb5)](_0x324a11);const _0x432b65=expandConditions(_0x1e380e,_0x36e23c,_0x2652c5);return{'type':_0x47b428[_0x16fbcc(0x10c)],'expanded_rule':_0x432b65};}return{'type':_0x47b428['type'],'expanded_rule':'__UNRESOLVED__'};}const _0xa92b7={};for(const _0x32707c of Object[_0x16fbcc(0xff)](_0x47b428)){_0xa92b7[_0x32707c]=expandConditions(_0x47b428[_0x32707c],_0x36e23c,_0x26b7e7);}return _0xa92b7;}export function serializeExpandedRule(_0x40bbf7,_0x33f496){const _0xf7ba04=a89_0x429167,_0x1300e8=expandSegmentReferences(_0x40bbf7,_0x33f496);return JSON[_0xf7ba04(0xc2)](deepSortObject(_0x1300e8));}export function createSegmentNameContext(_0x2fec07){const _0x46bf20=a89_0x429167,_0x2ba275=new Set(),_0xe86243=new Map(),_0x28d59f=new Map();if(_0x2fec07)for(const [_0x9b62dd,_0x4f87b0]of Object[_0x46bf20(0xbf)](_0x2fec07)){if(_0x4f87b0[_0x46bf20(0xe6)]){const _0x5d04b0=serializeRule(_0x4f87b0[_0x46bf20(0xe6)]);_0x28d59f['set'](_0x5d04b0,_0x9b62dd),_0x2ba275[_0x46bf20(0xb5)](_0x9b62dd);}}return{'usedNames':_0x2ba275,'ruleHashToName':_0xe86243,'localRuleToName':_0x2fec07?_0x28d59f:undefined};}export function resolveSegmentName(_0x3490a2,_0xec3313,_0x425e46,_0x3b3c3c){const _0x217236=a89_0x429167,_0x142737=serializeRule(_0xec3313);if(_0x425e46['localRuleToName']){const _0x2c5fbd=_0x425e46[_0x217236(0x109)][_0x217236(0xb8)](_0x142737);if(_0x2c5fbd)return{'name':_0x2c5fbd,'isDuplicate':![],'isLocalMatch':!![]};}const _0x2727f0=_0x425e46[_0x217236(0x13c)][_0x217236(0xb8)](_0x142737);if(_0x2727f0)return{'name':_0x2727f0,'isDuplicate':!![],'isLocalMatch':![]};const _0x132a4e=_0x3b3c3c(_0x3490a2);let _0x110db7=_0x132a4e||_0x3490a2,_0x3b368f=_0x110db7,_0x3203f9=0x2;while(_0x425e46[_0x217236(0x102)][_0x217236(0xdb)](_0x3b368f)){_0x3b368f=_0x110db7+'_'+_0x3203f9,_0x3203f9++;}return _0x425e46['usedNames']['add'](_0x3b368f),_0x425e46[_0x217236(0x13c)]['set'](_0x142737,_0x3b368f),{'name':_0x3b368f,'isDuplicate':![],'isLocalMatch':![]};}export function collectSegmentRefsFromRule(_0x1bfbc4){const _0x1e74c5=[],_0x2ac897=_0x254486=>{const _0x30550b=a89_0x5267;if(!_0x254486||typeof _0x254486!=='object')return;if(Array[_0x30550b(0x108)](_0x254486)){_0x254486[_0x30550b(0xca)](_0x2ac897);return;}const _0x4cebec=_0x254486;(_0x4cebec[_0x30550b(0x10c)]===_0x30550b(0x11d)||_0x4cebec['type']===_0x30550b(0xec))&&typeof _0x4cebec[_0x30550b(0x124)]===_0x30550b(0x11b)&&_0x1e74c5['push'](_0x4cebec[_0x30550b(0x124)]);for(const _0x4e6bda of Object[_0x30550b(0xc1)](_0x4cebec)){_0x2ac897(_0x4e6bda);}};return _0x2ac897(_0x1bfbc4),_0x1e74c5;}export function validateSegmentRule(_0x5268f2,_0x3db7f7){const _0x1e0bf6=a89_0x429167;if(!_0x3db7f7||!_0x3db7f7[_0x1e0bf6(0x136)])return;for(let _0x1ac349=0x0;_0x1ac349<_0x3db7f7['conditions'][_0x1e0bf6(0xbd)];_0x1ac349++){const _0x1c5ed4=_0x3db7f7[_0x1e0bf6(0x136)][_0x1ac349];if(_0x1e0bf6(0x10c)in _0x1c5ed4&&_0x1c5ed4[_0x1e0bf6(0x10c)]===_0x1e0bf6(0x10d)){const _0x19dcca=_0x1c5ed4;if(!_0x19dcca[_0x1e0bf6(0xae)]||_0x19dcca[_0x1e0bf6(0xae)]==='')throw new SDKError(ErrorCode[_0x1e0bf6(0xf5)],'Invalid\x20condition\x20in\x20embedded\x20segment\x20\x27'+_0x5268f2+'\x27:\x20'+('conditions['+_0x1ac349+'].attribute\x20cannot\x20be\x20empty.\x0a')+_0x1e0bf6(0x127));}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a90_0x559a(_0xe1a912,_0x4f5276){_0xe1a912=_0xe1a912-0xce;const _0x54c150=a90_0x54c1();let _0x559a19=_0x54c150[_0xe1a912];return _0x559a19;}(function(_0x567637,_0x54a5ff){const _0x4efe8a=a90_0x559a,_0xf54a70=_0x567637();while(!![]){try{const _0x5a693a=-parseInt(_0x4efe8a(0xd0))/0x1+-parseInt(_0x4efe8a(0xe4))/0x2+parseInt(_0x4efe8a(0xf2))/0x3*(parseInt(_0x4efe8a(0xe5))/0x4)+-parseInt(_0x4efe8a(0x100))/0x5*(-parseInt(_0x4efe8a(0xfb))/0x6)+parseInt(_0x4efe8a(0xf4))/0x7+-parseInt(_0x4efe8a(0xce))/0x8+-parseInt(_0x4efe8a(0x104))/0x9*(parseInt(_0x4efe8a(0xf0))/0xa);if(_0x5a693a===_0x54a5ff)break;else _0xf54a70['push'](_0xf54a70['shift']());}catch(_0x2d66b5){_0xf54a70['push'](_0xf54a70['shift']());}}}(a90_0x54c1,0x83ac3));import a90_0x20d912 from'chalk';import{withProgressSpinner}from'../../utils/spinner.js';export function buildSchemaResult(_0x29cacb){const _0x225f61=a90_0x559a,_0xb708e0=_0x29cacb[_0x225f61(0xfa)]['map'](_0x493392=>({'column_name':_0x493392[_0x225f61(0xe3)],'column_type':_0x493392['type'],'null':_0x225f61(0xf5),'key':null,'default':null,'extra':null}));return{..._0x29cacb,'columns':[{'name':_0x225f61(0xdb),'type':_0x225f61(0xfe)},{'name':_0x225f61(0xf9),'type':_0x225f61(0xfe)},{'name':'null','type':_0x225f61(0xfe)},{'name':_0x225f61(0xd1),'type':'varchar'},{'name':_0x225f61(0xf8),'type':_0x225f61(0xfe)},{'name':'extra','type':'varchar'}],'data':_0xb708e0};}export async function executeSchemaQuery(_0x1ece06,_0x24f829,_0xc97f6c){const _0x73afe0=a90_0x559a,_0x4688b0=_0x1ece06[_0x73afe0(0xd2)]()['replace'](/;+$/,''),_0x3ba446=_0x73afe0(0xda)+_0x4688b0+_0x73afe0(0xef);_0xc97f6c['verbose']&&console[_0x73afe0(0xe1)](_0x73afe0(0xdd)+_0x3ba446);const _0x1a2822=await withProgressSpinner('Fetching\x20schema...',async _0x3a08bf=>{const _0x504f29=_0x73afe0,_0x4b049b=await _0x24f829[_0x504f29(0xfc)]['execute'](_0x3ba446,{'catalog':'td','schema':_0x504f29(0xd4),'onJobId':_0x40feff=>{const _0x528461=_0x504f29;_0x3a08bf[_0x528461(0xf1)](_0x40feff);}});return _0x4b049b;},{'verbose':_0xc97f6c[_0x73afe0(0xde)]});return buildSchemaResult(_0x1a2822[_0x73afe0(0xd7)]);}function a90_0x54c1(){const _0x42a053=['query','dim','varchar','Behaviors','65OFqkJA','push','\x20\x20\x20\x20','get','3933MsGyoQ','6449576zXEpGm','behavior','215486qiqKrk','key','trim','displayName','information_schema','slice','parentTableName','data','parentColumn','fields','SELECT\x20*\x20FROM\x20(\x0a','column_name','filter','Schema\x20query:\x0a','verbose','length','entries','error','cyan','name','442342PMUpEQ','3270968iFfvCs','behaviorName','Unknown','Attributes','tableName','sort','localeCompare','bold','startsWith','source','\x0a)\x20AS\x20segment_query\x20LIMIT\x200','10420IELqig','setJobId','3FRKrjy','type','4923660UnpacJ','YES','groupingName','size','default','column_type','columns','330654iLJbFA'];a90_0x54c1=function(){return _0x42a053;};return a90_0x54c1();}export function displayFieldsHumanReadable(_0x188fd3,_0x3f019d){const _0x4ff05=a90_0x559a,_0x5f567b=_0x188fd3[_0x4ff05(0xdc)](_0x3ab5b7=>_0x3ab5b7[_0x4ff05(0xee)]==='attribute'),_0x128f91=_0x188fd3[_0x4ff05(0xdc)](_0xc27b09=>_0xc27b09[_0x4ff05(0xee)]===_0x4ff05(0xcf)),_0x5a22ba=new Map();for(const _0x43fbde of _0x5f567b){const _0x1bcd5e=_0x43fbde[_0x4ff05(0xf6)]||_0x43fbde[_0x4ff05(0xd6)]||_0x4ff05(0xe7),_0x24d8a4=_0x5a22ba['get'](_0x1bcd5e);_0x24d8a4?_0x24d8a4[_0x4ff05(0xd9)]['push'](_0x43fbde):_0x5a22ba['set'](_0x1bcd5e,{'displayName':_0x1bcd5e,'tableName':_0x43fbde['parentTableName'],'fields':[_0x43fbde]});}const _0x38836d=new Map();for(const _0x1e8f39 of _0x128f91){const _0x3d82c2=_0x1e8f39[_0x4ff05(0xe6)]||_0x4ff05(0xe7),_0x4ea33b=_0x38836d[_0x4ff05(0x103)](_0x3d82c2)||[];_0x4ea33b[_0x4ff05(0x101)](_0x1e8f39),_0x38836d['set'](_0x3d82c2,_0x4ea33b);}console[_0x4ff05(0xe1)]('\x0a'+a90_0x20d912['bold'](_0x3f019d));if(_0x5a22ba[_0x4ff05(0xf7)]>0x0){console[_0x4ff05(0xe1)]('\x0a'+a90_0x20d912[_0x4ff05(0xfd)](_0x4ff05(0xe8)));const _0x4d7b39=[..._0x5a22ba[_0x4ff05(0xe0)]()][_0x4ff05(0xea)]((_0x46ffe9,_0x3c7224)=>_0x46ffe9[0x0][_0x4ff05(0xeb)](_0x3c7224[0x0]));for(const [,_0x21919f]of _0x4d7b39){const _0x5e1ace=_0x21919f['tableName']&&_0x21919f[_0x4ff05(0xe9)]!==_0x21919f[_0x4ff05(0xd3)]?'\x20'+a90_0x20d912[_0x4ff05(0xfd)]('('+_0x21919f[_0x4ff05(0xe9)]+')'):'';console[_0x4ff05(0xe1)]('\x20\x20'+a90_0x20d912[_0x4ff05(0xec)](_0x21919f[_0x4ff05(0xd3)])+_0x5e1ace);const _0x5aed11=[..._0x21919f[_0x4ff05(0xd9)]][_0x4ff05(0xea)]((_0x39e926,_0x4059dd)=>_0x39e926['name']['localeCompare'](_0x4059dd[_0x4ff05(0xe3)]));for(const _0xdb445d of _0x5aed11){const _0x6cf7f5=_0xdb445d['parentColumn']&&_0xdb445d[_0x4ff05(0xd8)]!==_0xdb445d[_0x4ff05(0xe3)]?'\x20'+a90_0x20d912[_0x4ff05(0xfd)]('('+_0xdb445d[_0x4ff05(0xd8)]+')'):'';console[_0x4ff05(0xe1)](_0x4ff05(0x102)+_0xdb445d[_0x4ff05(0xe3)]+_0x6cf7f5+':\x20'+a90_0x20d912[_0x4ff05(0xe2)](_0xdb445d['type']));}}}if(_0x38836d['size']>0x0){console[_0x4ff05(0xe1)]('\x0a'+a90_0x20d912[_0x4ff05(0xfd)](_0x4ff05(0xff)));const _0x478ece=[..._0x38836d[_0x4ff05(0xe0)]()][_0x4ff05(0xea)]((_0x1f612a,_0x2a7546)=>_0x1f612a[0x0]['localeCompare'](_0x2a7546[0x0]));for(const [_0x1d5798,_0x328157]of _0x478ece){const _0x4179c1=_0x328157[0x0],_0x44a50c=_0x4179c1?.[_0x4ff05(0xd6)]||'';console[_0x4ff05(0xe1)]('\x20\x20'+a90_0x20d912[_0x4ff05(0xec)](_0x1d5798)+(_0x44a50c?'\x20'+a90_0x20d912[_0x4ff05(0xfd)]('('+_0x44a50c+')'):''));const _0x17c48a=[..._0x328157][_0x4ff05(0xea)]((_0x181d19,_0x2119cf)=>_0x181d19[_0x4ff05(0xe3)][_0x4ff05(0xeb)](_0x2119cf[_0x4ff05(0xe3)]));for(const _0x3e678f of _0x17c48a){const _0x15fc1f=_0x3e678f[_0x4ff05(0xe3)][_0x4ff05(0xed)](_0x1d5798+'.')?_0x3e678f[_0x4ff05(0xe3)][_0x4ff05(0xd5)](_0x1d5798[_0x4ff05(0xdf)]+0x1):_0x3e678f[_0x4ff05(0xe3)],_0x231ab1=_0x3e678f[_0x4ff05(0xd8)]&&_0x3e678f[_0x4ff05(0xd8)]!==_0x15fc1f?'\x20'+a90_0x20d912[_0x4ff05(0xfd)]('('+_0x3e678f[_0x4ff05(0xd8)]+')'):'';console[_0x4ff05(0xe1)](_0x4ff05(0x102)+_0x15fc1f+_0x231ab1+':\x20'+a90_0x20d912[_0x4ff05(0xe2)](_0x3e678f[_0x4ff05(0xf3)]));}}}console['error']('');}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x4f218a,_0xa5282f){const _0x4a53e3=a91_0x477b,_0x1a0273=_0x4f218a();while(!![]){try{const _0x6cb9d=-parseInt(_0x4a53e3(0x109))/0x1*(parseInt(_0x4a53e3(0x10b))/0x2)+parseInt(_0x4a53e3(0x10f))/0x3+-parseInt(_0x4a53e3(0x10d))/0x4+-parseInt(_0x4a53e3(0xff))/0x5+-parseInt(_0x4a53e3(0xfe))/0x6*(-parseInt(_0x4a53e3(0x107))/0x7)+parseInt(_0x4a53e3(0x110))/0x8*(-parseInt(_0x4a53e3(0x10a))/0x9)+-parseInt(_0x4a53e3(0xfd))/0xa*(-parseInt(_0x4a53e3(0x108))/0xb);if(_0x6cb9d===_0xa5282f)break;else _0x1a0273['push'](_0x1a0273['shift']());}catch(_0x27a327){_0x1a0273['push'](_0x1a0273['shift']());}}}(a91_0x2a16,0x38e93));function a91_0x477b(_0x4ab1ba,_0x367df4){_0x4ab1ba=_0x4ab1ba-0xfd;const _0x2a16e8=a91_0x2a16();let _0x477b6c=_0x2a16e8[_0x4ab1ba];return _0x477b6c;}import{readdirSync,statSync}from'fs';import a91_0x4534da from'path';function a91_0x2a16(){const _0x124fe4=['4098zMDurk','958455ShPdVj','relative','.yaml','.yml','isDirectory','toLowerCase','name','endsWith','4487keYVgS','15983KbdGYY','68qTjvqN','278838XPPlRk','1424HoaQJt','push','307840XdChoQ','isFile','245298OYESqx','48rFYvVc','1490wEpXyq'];a91_0x2a16=function(){return _0x124fe4;};return a91_0x2a16();}export function findYamlFiles(_0x529329){const _0x3de120=[];function _0x41b504(_0x23a9ba){const _0x1fcc40=a91_0x477b,_0x234579=readdirSync(_0x23a9ba,{'withFileTypes':!![]});for(const _0x3048d4 of _0x234579){const _0x2d8316=a91_0x4534da['join'](_0x23a9ba,_0x3048d4[_0x1fcc40(0x105)]);if(_0x3048d4[_0x1fcc40(0x103)]())_0x41b504(_0x2d8316);else(_0x3048d4[_0x1fcc40(0x105)][_0x1fcc40(0x106)](_0x1fcc40(0x102))||_0x3048d4[_0x1fcc40(0x105)][_0x1fcc40(0x106)](_0x1fcc40(0x101)))&&_0x3de120[_0x1fcc40(0x10c)](_0x2d8316);}}return _0x41b504(_0x529329),_0x3de120;}export function discoverYamlFiles(_0x2de5d9){const _0x1c88c4=findYamlFiles(_0x2de5d9);return _0x1c88c4['map'](_0x293b9e=>{const _0x598a04=a91_0x477b,_0x5d4581=a91_0x4534da[_0x598a04(0x100)](_0x2de5d9,_0x293b9e),_0x25ce8b=a91_0x4534da['dirname'](_0x5d4581);return{'absolutePath':_0x293b9e,'relativePath':_0x5d4581,'folderPath':_0x25ce8b==='.'?'':_0x25ce8b};});}export function isYamlFile(_0x25532d){const _0x4d8eb9=a91_0x477b;try{const _0x2e8d85=statSync(_0x25532d);if(!_0x2e8d85[_0x4d8eb9(0x10e)]())return![];const _0xafc044=a91_0x4534da['extname'](_0x25532d)[_0x4d8eb9(0x104)]();return _0xafc044===_0x4d8eb9(0x102)||_0xafc044==='.yaml';}catch{return![];}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(_0x346651,_0x549e6c){const _0x14b289=a92_0x2514,_0x57d0fc=_0x346651();while(!![]){try{const _0x265e4b=parseInt(_0x14b289(0x109))/0x1*(parseInt(_0x14b289(0x12c))/0x2)+parseInt(_0x14b289(0x123))/0x3*(parseInt(_0x14b289(0x11e))/0x4)+parseInt(_0x14b289(0x138))/0x5*(parseInt(_0x14b289(0x12a))/0x6)+-parseInt(_0x14b289(0x11a))/0x7*(parseInt(_0x14b289(0x120))/0x8)+parseInt(_0x14b289(0x112))/0x9*(-parseInt(_0x14b289(0x116))/0xa)+parseInt(_0x14b289(0x133))/0xb*(parseInt(_0x14b289(0x10e))/0xc)+-parseInt(_0x14b289(0x10b))/0xd;if(_0x265e4b===_0x549e6c)break;else _0x57d0fc['push'](_0x57d0fc['shift']());}catch(_0x735d42){_0x57d0fc['push'](_0x57d0fc['shift']());}}}(a92_0x246b,0x8938f));import{serializeRule}from'./child-segment-yaml.js';export const SEGMENT_KIND_JOURNEY=0x3;export function sanitizeYamlKey(_0x34da46){const _0x400561=a92_0x2514;return _0x34da46[_0x400561(0x11c)]()['replace'](/\s+/g,'_')[_0x400561(0x132)](/[^a-z0-9_]/g,'')['replace'](/_+/g,'_')[_0x400561(0x132)](/^_|_$/g,'');}export function generateJourneyLocalName(_0x212ae0){const _0x2a030b=a92_0x2514,_0x5fc043=_0x212ae0['match'](/^journey_([a-z_]+)_([0-9a-f-]+)$/i);if(_0x5fc043){const _0x596e71=_0x5fc043[0x1][_0x2a030b(0x11c)](),_0x2ff600=_0x5fc043[0x2],_0x270157=_0x2ff600[_0x2a030b(0x132)](/-/g,'')[_0x2a030b(0x11d)](0x0,0x4)['toLowerCase']();return _0x596e71+'_'+_0x270157;}const _0x1c7317=_0x212ae0['match'](/^journey_\d+_stage_\d+_step_([0-9a-f-]+)_([a-z_]+)$/i);if(_0x1c7317){const _0x2363ce=_0x1c7317[0x1],_0x4ab24d=_0x1c7317[0x2]['toLowerCase'](),_0x58cf60=_0x2363ce[_0x2a030b(0x132)](/-/g,'')[_0x2a030b(0x11d)](0x0,0x4)[_0x2a030b(0x11c)]();return _0x4ab24d+'_'+_0x58cf60;}return undefined;}export function consolidateActivationsByContent(_0x4b3054){const _0x1a048c=a92_0x2514,_0xf8ffb4={},_0x8c22d6=new Map(),_0x84e937=new Map();for(const _0xae03d9 of _0x4b3054){if(!_0xae03d9)continue;for(const [_0x100d2e,_0x600494]of Object['entries'](_0xae03d9)){const _0x3619cf=JSON[_0x1a048c(0x137)]({'name':_0x600494[_0x1a048c(0x10a)],'connection':_0x600494[_0x1a048c(0x136)],'connector_config':_0x600494[_0x1a048c(0x117)]}),_0x4425a2=_0x84e937[_0x1a048c(0x11b)](_0x3619cf);_0x4425a2?_0x8c22d6['set'](_0x100d2e,_0x4425a2):(_0xf8ffb4[_0x100d2e]=_0x600494,_0x8c22d6[_0x1a048c(0x10f)](_0x100d2e,_0x100d2e),_0x84e937[_0x1a048c(0x10f)](_0x3619cf,_0x100d2e));}}return{'merged':_0xf8ffb4,'nameMapping':_0x8c22d6};}export function updateActivationReferences(_0x565c2b,_0x250ebb){const _0x1b8ad3=a92_0x2514;if(!_0x565c2b)return;for(const _0x263c45 of _0x565c2b){if(!_0x263c45[_0x1b8ad3(0x11f)])continue;for(const _0x5e3054 of _0x263c45[_0x1b8ad3(0x11f)]){if(_0x5e3054['type']===_0x1b8ad3(0xf7)&&_0x5e3054[_0x1b8ad3(0xfe)]?.['activation']){const _0x23371e=_0x250ebb[_0x1b8ad3(0x11b)](_0x5e3054[_0x1b8ad3(0xfe)][_0x1b8ad3(0xf7)]);_0x23371e&&_0x23371e!==_0x5e3054[_0x1b8ad3(0xfe)][_0x1b8ad3(0xf7)]&&(_0x5e3054[_0x1b8ad3(0xfe)][_0x1b8ad3(0xf7)]=_0x23371e);}}}}export function consolidateSegmentsByContent(_0x188af8,_0x576386){const _0xca7bdc=a92_0x2514,_0x9a7936={},_0x48b11f=new Map(),_0x4bc9ab=new Map();for(const _0x96ea5 of _0x188af8){if(!_0x96ea5)continue;for(const [_0x2f5d14,_0x187ec5]of Object['entries'](_0x96ea5)){if(!_0x187ec5[_0xca7bdc(0xfc)]){_0x9a7936[_0x2f5d14]=_0x187ec5,_0x48b11f['set'](_0x2f5d14,_0x2f5d14);continue;}const _0x2657b5=serializeRule(_0x187ec5[_0xca7bdc(0xfc)]),_0x11f18f=_0x4bc9ab[_0xca7bdc(0x11b)](_0x2657b5);if(_0x11f18f)_0x48b11f[_0xca7bdc(0x10f)](_0x2f5d14,_0x11f18f);else{let _0x15c631=_0x2f5d14;if(_0x576386){const _0x2e5706=_0x576386[_0xca7bdc(0x11b)](_0x2657b5);_0x2e5706&&_0x2e5706[_0xca7bdc(0x114)]>0x0&&(_0x15c631=_0x2e5706[0x0]);}_0x9a7936[_0x15c631]=_0x187ec5,_0x48b11f[_0xca7bdc(0x10f)](_0x2f5d14,_0x15c631),_0x4bc9ab[_0xca7bdc(0x10f)](_0x2657b5,_0x15c631);}}}return{'merged':_0x9a7936,'nameMapping':_0x48b11f};}function a92_0x2514(_0x2d44a7,_0x4f671d){_0x2d44a7=_0x2d44a7-0xf5;const _0x246b8d=a92_0x246b();let _0x251470=_0x246b8d[_0x2d44a7];return _0x251470;}export function updateSegmentReferences(_0x1498c,_0x2a7cbe){const _0x4f9f7d=a92_0x2514;if(!_0x1498c)return;for(const _0x2a81b0 of _0x1498c){if(_0x2a81b0['entry_criteria']?.['segment']){const _0x55e5a0=_0x2a7cbe[_0x4f9f7d(0x11b)](_0x2a81b0['entry_criteria'][_0x4f9f7d(0x125)]);_0x55e5a0&&(_0x2a81b0['entry_criteria']['segment']=_0x55e5a0);}if(_0x2a81b0[_0x4f9f7d(0x11f)])for(const _0x1f0d96 of _0x2a81b0[_0x4f9f7d(0x11f)]){if(_0x1f0d96[_0x4f9f7d(0x129)]===_0x4f9f7d(0x113)&&_0x1f0d96[_0x4f9f7d(0xfe)]?.[_0x4f9f7d(0x126)])for(const _0x449dc7 of _0x1f0d96[_0x4f9f7d(0xfe)][_0x4f9f7d(0x126)]){if(_0x449dc7[_0x4f9f7d(0x125)]){const _0xe1eac0=_0x2a7cbe[_0x4f9f7d(0x11b)](_0x449dc7[_0x4f9f7d(0x125)]);_0xe1eac0&&(_0x449dc7[_0x4f9f7d(0x125)]=_0xe1eac0);}}}}}export function updateSegmentRefsInSegments(_0x35683e,_0x342049){const _0x4e1c8=a92_0x2514;for(const _0x3c6923 of Object['values'](_0x35683e)){_0x3c6923[_0x4e1c8(0xfc)]&&updateSegmentRefsInRule(_0x3c6923[_0x4e1c8(0xfc)],_0x342049);}}function updateSegmentRefsInRule(_0x2449aa,_0x46fd4f){const _0x251065=a92_0x2514;if(_0x2449aa===null||typeof _0x2449aa!==_0x251065(0xfb))return;if(Array[_0x251065(0x131)](_0x2449aa)){for(const _0x31e6db of _0x2449aa){updateSegmentRefsInRule(_0x31e6db,_0x46fd4f);}return;}const _0x42fd99=_0x2449aa;if((_0x42fd99['type']===_0x251065(0x122)||_0x42fd99[_0x251065(0x129)]==='exclude')&&typeof _0x42fd99['segment']==='string'){const _0x3ac84a=_0x46fd4f['get'](_0x42fd99[_0x251065(0x125)]);_0x3ac84a&&(_0x42fd99[_0x251065(0x125)]=_0x3ac84a);}if(_0x42fd99['conditions']&&Array[_0x251065(0x131)](_0x42fd99['conditions']))for(const _0x210d6f of _0x42fd99[_0x251065(0x101)]){updateSegmentRefsInRule(_0x210d6f,_0x46fd4f);}}function a92_0x246b(){const _0x55e394=['launched','find','version','isArray','replace','319lENyqY','journeyBundleName','stages','connection','stringify','2165cNSHem','versionNumber','endsWith','activation','yaml','goal','bundle_name','object','rule','entries','with','versions','latest','conditions','wait','milestone','item','condition','activations','draft','segments','39437pgVBKQ','name','2388646dxYuRc','journeys','.yml','18576QtuDTT','set','max','keys','3864051PHuoXS','decision_point','length','index','20UWJpso','connector_config','state','exit_criteria','46242mEpQFF','get','toLowerCase','slice','960028xFiGGh','steps','120fuHIiP','reentry','include','9SQQnhs','bundle_id','segment','branches','map','push','type','438zxanhO','journey','46MERgoT','attributes'];a92_0x246b=function(){return _0x55e394;};return a92_0x246b();}export function buildJourneysArray(_0x5c677b){const _0x1f4311=a92_0x2514,_0x436e49=Math[_0x1f4311(0x110)](..._0x5c677b[_0x1f4311(0x127)](_0xdd1aea=>_0xdd1aea[_0x1f4311(0x104)][_0x1f4311(0xf5)]||0x0));return _0x5c677b[_0x1f4311(0x127)](_0xc70847=>{const _0x5ea982=_0x1f4311,_0x4291cd=(_0xc70847[_0x5ea982(0x104)][_0x5ea982(0xf5)]||0x0)===_0x436e49,_0x45edab=_0xc70847['yaml'][_0x5ea982(0x10c)]?.[0x0],_0x12c2c6={'version':_0x45edab?.[_0x5ea982(0x130)]||_0xc70847[_0x5ea982(0xf8)][_0x5ea982(0x130)]||_0xc70847['item'][_0x5ea982(0x10a)],'state':_0xc70847['item'][_0x5ea982(0x118)]===_0x5ea982(0x12e)?_0x5ea982(0x12e):_0x5ea982(0x107),'stages':_0x45edab?.[_0x5ea982(0x135)]||_0xc70847[_0x5ea982(0xf8)][_0x5ea982(0x135)]||[],'id':_0x45edab?.['id']||_0xc70847[_0x5ea982(0xf8)]['id'],'version_number':_0x45edab?.['version_number']||_0xc70847[_0x5ea982(0xf8)]['version_number']};return _0x4291cd&&(_0x12c2c6[_0x5ea982(0x100)]=!![]),_0x12c2c6;});}export function buildMergedJourneyDef(_0x577546,_0x4f1697){const _0x5356b4=a92_0x2514,_0x39ff33=_0x577546[0x0]['yaml'],_0xd02dd0=buildJourneysArray(_0x577546),{merged:_0x3a7b10,nameMapping:_0x4f29b1}=consolidateSegmentsByContent(_0x577546[_0x5356b4(0x127)](_0x3012d5=>_0x3012d5['yaml'][_0x5356b4(0x108)]),_0x4f1697);updateSegmentRefsInSegments(_0x3a7b10,_0x4f29b1);for(const _0x4e3fba of _0xd02dd0){updateSegmentReferences(_0x4e3fba[_0x5356b4(0x135)],_0x4f29b1);}const {merged:_0x564b99,nameMapping:_0x3c27f5}=consolidateActivationsByContent(_0x577546[_0x5356b4(0x127)](_0x550805=>_0x550805[_0x5356b4(0xf8)][_0x5356b4(0x106)]));for(const _0x509e53 of _0xd02dd0){updateActivationReferences(_0x509e53[_0x5356b4(0x135)],_0x3c27f5);}let _0x47fec5=_0x39ff33[_0x5356b4(0xf9)];if(_0x47fec5?.[_0x5356b4(0x125)]){const _0x34186a=_0x4f29b1['get'](_0x47fec5[_0x5356b4(0x125)]);_0x34186a&&(_0x47fec5={..._0x47fec5,'segment':_0x34186a});}return{'type':_0x5356b4(0x12b),'name':_0x39ff33[_0x5356b4(0x10a)],'description':_0x39ff33['description'],'goal':_0x47fec5,'reentry':_0x39ff33[_0x5356b4(0x121)],'segments':Object[_0x5356b4(0x111)](_0x3a7b10)[_0x5356b4(0x114)]>0x0?_0x3a7b10:undefined,'activations':Object[_0x5356b4(0x111)](_0x564b99)['length']>0x0?_0x564b99:undefined,'journeys':_0xd02dd0,'bundle_id':_0x39ff33[_0x5356b4(0x124)],'bundle_name':_0x39ff33[_0x5356b4(0xfa)]};}export function createJumpTargetCache(){return new Map();}export async function resolveJumpTarget(_0x52ec08,_0x25a8de,_0x3682d6,_0x1ab750){const _0x4f10b1=a92_0x2514,_0x5f0bbc=_0x52ec08+':'+_0x25a8de,_0x4f1262=_0x3682d6['get'](_0x5f0bbc);if(_0x4f1262)return _0x4f1262;const _0x2a8bfd=await _0x1ab750(_0x52ec08),_0x1c439e=_0x2a8bfd[_0x4f10b1(0x12d)][_0x4f10b1(0x134)]||_0x2a8bfd['attributes'][_0x4f10b1(0x10a)],_0x543669=_0x2a8bfd['attributes']['journeyStages'][_0x4f10b1(0x12f)](_0x5d3004=>String(_0x5d3004['id'])===String(_0x25a8de)),_0x1e5a29=_0x543669?.[_0x4f10b1(0x10a)]||_0x25a8de,_0x110827={'journeyName':_0x1c439e,'stageName':_0x1e5a29};return _0x3682d6[_0x4f10b1(0x10f)](_0x5f0bbc,_0x110827),_0x110827;}export function formatApiJourneyName(_0x49b447,_0x542765){return _0x542765+'\x20('+_0x49b447+')';}export function isLocalJourneyRef(_0xe566ec){const _0x1270b7=a92_0x2514;return _0xe566ec[_0x1270b7(0xf6)](_0x1270b7(0x10d))||_0xe566ec[_0x1270b7(0xf6)]('.yaml');}export function buildLocalRuleToNameMapping(_0x502be4){const _0xe4467a=a92_0x2514,_0x4483b7=new Map();if(!_0x502be4)return _0x4483b7;for(const [_0x1676ba,_0x523ade]of Object['entries'](_0x502be4)){if(_0x523ade[_0xe4467a(0xfc)]){const _0x34d0ff=serializeRule(_0x523ade[_0xe4467a(0xfc)]),_0x3db776=_0x4483b7[_0xe4467a(0x11b)](_0x34d0ff)||[];_0x3db776[_0xe4467a(0x128)](_0x1676ba),_0x4483b7[_0xe4467a(0x10f)](_0x34d0ff,_0x3db776);}}return _0x4483b7;}export function buildLocalRuleToNameMappingFromJourney(_0x20dfd2){const _0x4a100c=a92_0x2514,_0x37b44d=_0x20dfd2['segments'];if(!_0x37b44d)return new Map();const _0x35ab19=collectSegmentUsageCounts(_0x20dfd2),_0x5dadbf=new Map();let _0x2bbf4f=0x0;for(const [_0x341e67,_0x1eb96f]of Object[_0x4a100c(0xfd)](_0x37b44d)){if(!_0x1eb96f[_0x4a100c(0xfc)]){_0x2bbf4f++;continue;}const _0x42fa2f=serializeRule(_0x1eb96f[_0x4a100c(0xfc)]),_0x56a8a2=_0x5dadbf[_0x4a100c(0x11b)](_0x42fa2f)||[];_0x56a8a2['push']({'name':_0x341e67,'index':_0x2bbf4f}),_0x5dadbf['set'](_0x42fa2f,_0x56a8a2),_0x2bbf4f++;}const _0x4f7781=new Map();for(const [_0x290662,_0x2d7605]of _0x5dadbf){const _0x51df95=_0x2d7605[_0x4a100c(0x11d)]()['sort']((_0x3a4818,_0x32cf08)=>{const _0x654572=_0x4a100c,_0x5260ed=_0x35ab19[_0x654572(0x11b)](_0x3a4818['name'])||0x0,_0x5a0525=_0x35ab19['get'](_0x32cf08[_0x654572(0x10a)])||0x0;if(_0x5260ed!==_0x5a0525)return _0x5a0525-_0x5260ed;return _0x3a4818[_0x654572(0x115)]-_0x32cf08[_0x654572(0x115)];})[_0x4a100c(0x127)](_0x41fb18=>_0x41fb18['name']);_0x4f7781['set'](_0x290662,_0x51df95);}return _0x4f7781;}export function collectSegmentUsageCounts(_0x1d8397){const _0x53027c=a92_0x2514,_0x4e9e39=new Map(),_0x46ed7d=_0x5d46ef=>{const _0xc1e2f5=a92_0x2514;if(!_0x5d46ef)return;_0x4e9e39[_0xc1e2f5(0x10f)](_0x5d46ef,(_0x4e9e39[_0xc1e2f5(0x11b)](_0x5d46ef)||0x0)+0x1);},_0x5d0271=_0x56c34b=>{const _0x491cb1=a92_0x2514;for(const _0x2aa19c of _0x56c34b){_0x46ed7d(_0x2aa19c['entry_criteria']?.[_0x491cb1(0x125)]);if(_0x2aa19c[_0x491cb1(0x119)])for(const _0x5e614e of _0x2aa19c['exit_criteria']){_0x46ed7d(_0x5e614e[_0x491cb1(0x125)]);}_0x46ed7d(_0x2aa19c[_0x491cb1(0x103)]?.[_0x491cb1(0x125)]);if(_0x2aa19c[_0x491cb1(0x11f)])for(const _0x30cb22 of _0x2aa19c[_0x491cb1(0x11f)]){if(_0x30cb22[_0x491cb1(0x129)]===_0x491cb1(0x113))for(const _0x580fe2 of _0x30cb22['with'][_0x491cb1(0x126)]){_0x46ed7d(_0x580fe2['segment']);}else _0x30cb22[_0x491cb1(0x129)]===_0x491cb1(0x102)&&_0x46ed7d(_0x30cb22[_0x491cb1(0xfe)][_0x491cb1(0x105)]?.[_0x491cb1(0x125)]);}}};_0x46ed7d(_0x1d8397[_0x53027c(0xf9)]?.[_0x53027c(0x125)]);if(_0x1d8397[_0x53027c(0x10c)])for(const _0x4cf178 of _0x1d8397['journeys']){_0x46ed7d(_0x4cf178['goal']?.[_0x53027c(0x125)]),_0x5d0271(_0x4cf178[_0x53027c(0x135)]);}_0x1d8397[_0x53027c(0x135)]&&_0x5d0271(_0x1d8397[_0x53027c(0x135)]);if(_0x1d8397[_0x53027c(0xff)])for(const _0x45bfa4 of _0x1d8397[_0x53027c(0xff)]){_0x5d0271(_0x45bfa4['stages']);}return _0x4e9e39;}
|
|
1
|
+
(function(_0x24b8f3,_0x1f3b19){const _0x4388c3=a92_0x4dab,_0x309af0=_0x24b8f3();while(!![]){try{const _0x148206=parseInt(_0x4388c3(0x204))/0x1*(parseInt(_0x4388c3(0x229))/0x2)+parseInt(_0x4388c3(0x1f9))/0x3+-parseInt(_0x4388c3(0x201))/0x4*(-parseInt(_0x4388c3(0x1f7))/0x5)+parseInt(_0x4388c3(0x217))/0x6+parseInt(_0x4388c3(0x1f4))/0x7+parseInt(_0x4388c3(0x1f2))/0x8+-parseInt(_0x4388c3(0x214))/0x9*(parseInt(_0x4388c3(0x1f6))/0xa);if(_0x148206===_0x1f3b19)break;else _0x309af0['push'](_0x309af0['shift']());}catch(_0x4b7457){_0x309af0['push'](_0x309af0['shift']());}}}(a92_0xd9e5,0x38235));import{serializeRule}from'./child-segment-yaml.js';export const SEGMENT_KIND_JOURNEY=0x3;export function sanitizeYamlKey(_0x311220){const _0x5e3230=a92_0x4dab;return _0x311220[_0x5e3230(0x20d)]()[_0x5e3230(0x1ef)](/\s+/g,'_')['replace'](/[^a-z0-9_]/g,'')[_0x5e3230(0x1ef)](/_+/g,'_')[_0x5e3230(0x1ef)](/^_|_$/g,'');}export function generateJourneyLocalName(_0x3ff87e){const _0x40f52f=a92_0x4dab,_0x398702=_0x3ff87e[_0x40f52f(0x20c)](/^journey_([a-z_]+)_([0-9a-f-]+)$/i);if(_0x398702){const _0x5dbc05=_0x398702[0x1][_0x40f52f(0x20d)](),_0x425212=_0x398702[0x2],_0x27e4ac=_0x425212[_0x40f52f(0x1ef)](/-/g,'')[_0x40f52f(0x222)](0x0,0x4)['toLowerCase']();return _0x5dbc05+'_'+_0x27e4ac;}const _0x130b18=_0x3ff87e['match'](/^journey_\d+_stage_\d+_step_([0-9a-f-]+)_([a-z_]+)$/i);if(_0x130b18){const _0x39be01=_0x130b18[0x1],_0x2ca6ef=_0x130b18[0x2]['toLowerCase'](),_0x5590c6=_0x39be01[_0x40f52f(0x1ef)](/-/g,'')['slice'](0x0,0x4)[_0x40f52f(0x20d)]();return _0x2ca6ef+'_'+_0x5590c6;}return undefined;}export function consolidateActivationsByContent(_0x3b0a0e){const _0x202daf=a92_0x4dab,_0x47140d={},_0x38787d=new Map(),_0x4954e6=new Map();for(const _0x2137bf of _0x3b0a0e){if(!_0x2137bf)continue;for(const [_0x3f01d8,_0x352507]of Object[_0x202daf(0x1e9)](_0x2137bf)){const _0xe349cc=JSON['stringify']({'name':_0x352507[_0x202daf(0x202)],'connection':_0x352507['connection'],'connector_config':_0x352507['connector_config']}),_0x4214f3=_0x4954e6['get'](_0xe349cc);_0x4214f3?_0x38787d['set'](_0x3f01d8,_0x4214f3):(_0x47140d[_0x3f01d8]=_0x352507,_0x38787d['set'](_0x3f01d8,_0x3f01d8),_0x4954e6[_0x202daf(0x1f0)](_0xe349cc,_0x3f01d8));}}return{'merged':_0x47140d,'nameMapping':_0x38787d};}export function updateActivationReferences(_0x28fd2a,_0xaf2021){const _0x4de05d=a92_0x4dab;if(!_0x28fd2a)return;for(const _0x5280ce of _0x28fd2a){if(!_0x5280ce['steps'])continue;for(const _0x4218ef of _0x5280ce[_0x4de05d(0x210)]){if(_0x4218ef[_0x4de05d(0x206)]===_0x4de05d(0x1fe)&&_0x4218ef['with']?.[_0x4de05d(0x1fe)]){const _0x569675=_0xaf2021[_0x4de05d(0x225)](_0x4218ef[_0x4de05d(0x1fa)]['activation']);_0x569675&&_0x569675!==_0x4218ef[_0x4de05d(0x1fa)][_0x4de05d(0x1fe)]&&(_0x4218ef[_0x4de05d(0x1fa)][_0x4de05d(0x1fe)]=_0x569675);}}}}export function consolidateSegmentsByContent(_0x57a508,_0x33a84d){const _0x57117a=a92_0x4dab,_0x1d7d09={},_0x4b396e=new Map(),_0x534a4b=new Map();for(const _0x5dff8c of _0x57a508){if(!_0x5dff8c)continue;for(const [_0x1c9327,_0x1b1d3b]of Object['entries'](_0x5dff8c)){if(!_0x1b1d3b[_0x57117a(0x1ed)]){_0x1d7d09[_0x1c9327]=_0x1b1d3b,_0x4b396e[_0x57117a(0x1f0)](_0x1c9327,_0x1c9327);continue;}const _0x16e555=serializeRule(_0x1b1d3b[_0x57117a(0x1ed)]),_0x3f6cfd=_0x534a4b[_0x57117a(0x225)](_0x16e555);if(_0x3f6cfd)_0x4b396e['set'](_0x1c9327,_0x3f6cfd);else{let _0x54d34c=_0x1c9327;if(_0x33a84d){const _0x4d36c4=_0x33a84d[_0x57117a(0x225)](_0x16e555);_0x4d36c4&&_0x4d36c4[_0x57117a(0x1fc)]>0x0&&(_0x54d34c=_0x4d36c4[0x0]);}_0x1d7d09[_0x54d34c]=_0x1b1d3b,_0x4b396e[_0x57117a(0x1f0)](_0x1c9327,_0x54d34c),_0x534a4b['set'](_0x16e555,_0x54d34c);}}}return{'merged':_0x1d7d09,'nameMapping':_0x4b396e};}export function updateSegmentReferences(_0x1dae88,_0x4edd90){const _0x55c02f=a92_0x4dab;if(!_0x1dae88)return;for(const _0x5009c8 of _0x1dae88){if(_0x5009c8[_0x55c02f(0x207)]?.[_0x55c02f(0x1f8)]){const _0x271046=_0x4edd90[_0x55c02f(0x225)](_0x5009c8[_0x55c02f(0x207)][_0x55c02f(0x1f8)]);_0x271046&&(_0x5009c8[_0x55c02f(0x207)][_0x55c02f(0x1f8)]=_0x271046);}if(_0x5009c8[_0x55c02f(0x210)])for(const _0x3ccd91 of _0x5009c8[_0x55c02f(0x210)]){if(_0x3ccd91['type']==='decision_point'&&_0x3ccd91[_0x55c02f(0x1fa)]?.[_0x55c02f(0x1e8)])for(const _0x1d91aa of _0x3ccd91[_0x55c02f(0x1fa)]['branches']){if(_0x1d91aa[_0x55c02f(0x1f8)]){const _0x3f625c=_0x4edd90[_0x55c02f(0x225)](_0x1d91aa[_0x55c02f(0x1f8)]);_0x3f625c&&(_0x1d91aa[_0x55c02f(0x1f8)]=_0x3f625c);}}}}}export function updateSegmentRefsInSegments(_0x9e3908,_0xcd74ce){const _0x4a543b=a92_0x4dab;for(const _0x57bebe of Object[_0x4a543b(0x212)](_0x9e3908)){_0x57bebe[_0x4a543b(0x1ed)]&&updateSegmentRefsInRule(_0x57bebe['rule'],_0xcd74ce);}}function updateSegmentRefsInRule(_0x555a0c,_0xe761c0){const _0x406331=a92_0x4dab;if(_0x555a0c===null||typeof _0x555a0c!==_0x406331(0x215))return;if(Array[_0x406331(0x218)](_0x555a0c)){for(const _0x168e0c of _0x555a0c){updateSegmentRefsInRule(_0x168e0c,_0xe761c0);}return;}const _0x21f4ee=_0x555a0c;if((_0x21f4ee[_0x406331(0x206)]===_0x406331(0x21c)||_0x21f4ee[_0x406331(0x206)]===_0x406331(0x209))&&typeof _0x21f4ee[_0x406331(0x1f8)]===_0x406331(0x21b)){const _0x224461=_0xe761c0[_0x406331(0x225)](_0x21f4ee[_0x406331(0x1f8)]);_0x224461&&(_0x21f4ee[_0x406331(0x1f8)]=_0x224461);}if(_0x21f4ee['conditions']&&Array[_0x406331(0x218)](_0x21f4ee['conditions']))for(const _0x7172b8 of _0x21f4ee[_0x406331(0x205)]){updateSegmentRefsInRule(_0x7172b8,_0xe761c0);}}export function buildJourneysArray(_0x3be33b){const _0x91632c=a92_0x4dab,_0x17caed=Math[_0x91632c(0x21a)](..._0x3be33b[_0x91632c(0x21f)](_0x55ed29=>_0x55ed29[_0x91632c(0x20b)][_0x91632c(0x213)]||0x0));return _0x3be33b[_0x91632c(0x21f)](_0xb181e=>{const _0x203f5a=_0x91632c,_0x5eb6de=(_0xb181e[_0x203f5a(0x20b)]['versionNumber']||0x0)===_0x17caed,_0x403cec=_0xb181e['yaml'][_0x203f5a(0x208)]?.[0x0],_0x380da8={'version':_0x403cec?.[_0x203f5a(0x21d)]||_0xb181e[_0x203f5a(0x223)]['version']||_0xb181e[_0x203f5a(0x20b)][_0x203f5a(0x202)],'state':_0xb181e[_0x203f5a(0x20b)]['state']==='launched'?'launched':_0x203f5a(0x21e),'stages':_0x403cec?.['stages']||_0xb181e['yaml']['stages']||[],'id':_0x403cec?.['id']||_0xb181e['yaml']['id'],'version_number':_0x403cec?.[_0x203f5a(0x200)]||_0xb181e[_0x203f5a(0x223)][_0x203f5a(0x200)]};return _0x5eb6de&&(_0x380da8[_0x203f5a(0x227)]=!![]),_0x380da8;});}export function buildMergedJourneyDef(_0x19edba,_0x5747c1){const _0x2e2852=a92_0x4dab,_0xc8896c=_0x19edba[0x0]['yaml'],_0x5162c8=buildJourneysArray(_0x19edba),{merged:_0x9df64b,nameMapping:_0x198a13}=consolidateSegmentsByContent(_0x19edba[_0x2e2852(0x21f)](_0x1837d4=>_0x1837d4[_0x2e2852(0x223)]['segments']),_0x5747c1);updateSegmentRefsInSegments(_0x9df64b,_0x198a13);for(const _0x1ad63d of _0x5162c8){updateSegmentReferences(_0x1ad63d[_0x2e2852(0x1f5)],_0x198a13);}const {merged:_0x52f871,nameMapping:_0x125b34}=consolidateActivationsByContent(_0x19edba[_0x2e2852(0x21f)](_0x558c54=>_0x558c54[_0x2e2852(0x223)][_0x2e2852(0x20f)]));for(const _0x47f3b5 of _0x5162c8){updateActivationReferences(_0x47f3b5[_0x2e2852(0x1f5)],_0x125b34);}let _0x4eb354=_0xc8896c[_0x2e2852(0x216)];if(_0x4eb354?.['segment']){const _0x54eb51=_0x198a13['get'](_0x4eb354[_0x2e2852(0x1f8)]);_0x54eb51&&(_0x4eb354={..._0x4eb354,'segment':_0x54eb51});}return{'type':_0x2e2852(0x224),'name':_0xc8896c[_0x2e2852(0x202)],'description':_0xc8896c['description'],'goal':_0x4eb354,'reentry':_0xc8896c[_0x2e2852(0x226)],'segments':Object[_0x2e2852(0x20a)](_0x9df64b)[_0x2e2852(0x1fc)]>0x0?_0x9df64b:undefined,'activations':Object[_0x2e2852(0x20a)](_0x52f871)[_0x2e2852(0x1fc)]>0x0?_0x52f871:undefined,'journeys':_0x5162c8,'bundle_id':_0xc8896c['bundle_id'],'bundle_name':_0xc8896c[_0x2e2852(0x20e)]};}export function createJumpTargetCache(){return new Map();}export async function resolveJumpTarget(_0x4f90b,_0x27c354,_0x4ddfc8,_0x5f587b){const _0x56e0e9=a92_0x4dab,_0x219236=_0x4f90b+':'+_0x27c354,_0x53eb24=_0x4ddfc8[_0x56e0e9(0x225)](_0x219236);if(_0x53eb24)return _0x53eb24;const _0x45d4cf=await _0x5f587b(_0x4f90b),_0x456672=_0x45d4cf['attributes'][_0x56e0e9(0x1fd)]||_0x45d4cf[_0x56e0e9(0x221)][_0x56e0e9(0x202)],_0x2282d3=_0x45d4cf['attributes']['journeyStages'][_0x56e0e9(0x1ee)](_0x104180=>String(_0x104180['id'])===String(_0x27c354)),_0x1bd56b=_0x2282d3?.[_0x56e0e9(0x202)]||_0x27c354,_0x126902={'journeyName':_0x456672,'stageName':_0x1bd56b};return _0x4ddfc8['set'](_0x219236,_0x126902),_0x126902;}function a92_0xd9e5(){const _0x1728e0=['exclude','keys','item','match','toLowerCase','bundle_name','activations','steps','endsWith','values','versionNumber','153JArysU','object','goal','929286uSjwJo','isArray','segments','max','string','include','version','draft','map','condition','attributes','slice','yaml','journey','get','reentry','latest','exit_criteria','23716OUNYlz','branches','entries','push','.yml','index','rule','find','replace','set','versions','2587144hDOSFx','.yaml','1214752LmgYHf','stages','669250RkIFtt','106675yViaiS','segment','511587yrBnfz','with','wait','length','journeyBundleName','activation','decision_point','version_number','60DIsZBp','name','milestone','19qFmMBe','conditions','type','entry_criteria','journeys'];a92_0xd9e5=function(){return _0x1728e0;};return a92_0xd9e5();}export function formatApiJourneyName(_0x2d83e0,_0x328a2a){return _0x328a2a+'\x20('+_0x2d83e0+')';}export function isLocalJourneyRef(_0x8441cb){const _0x59fea9=a92_0x4dab;return _0x8441cb[_0x59fea9(0x211)](_0x59fea9(0x1eb))||_0x8441cb[_0x59fea9(0x211)](_0x59fea9(0x1f3));}function a92_0x4dab(_0x501865,_0x4489b6){_0x501865=_0x501865-0x1e8;const _0xd9e5a7=a92_0xd9e5();let _0x4dab25=_0xd9e5a7[_0x501865];return _0x4dab25;}export function buildLocalRuleToNameMapping(_0x332a7d){const _0x393525=a92_0x4dab,_0x42f71f=new Map();if(!_0x332a7d)return _0x42f71f;for(const [_0x5eb346,_0x37b644]of Object[_0x393525(0x1e9)](_0x332a7d)){if(_0x37b644['rule']){const _0x79696e=serializeRule(_0x37b644['rule']),_0x1a3b1c=_0x42f71f[_0x393525(0x225)](_0x79696e)||[];_0x1a3b1c[_0x393525(0x1ea)](_0x5eb346),_0x42f71f[_0x393525(0x1f0)](_0x79696e,_0x1a3b1c);}}return _0x42f71f;}export function buildLocalRuleToNameMappingFromJourney(_0x5f30aa){const _0x11b4a7=a92_0x4dab,_0x23f948=_0x5f30aa[_0x11b4a7(0x219)];if(!_0x23f948)return new Map();const _0x19c0e4=collectSegmentUsageCounts(_0x5f30aa),_0x3895dc=new Map();let _0x2fc157=0x0;for(const [_0xe938a2,_0x57cf4d]of Object[_0x11b4a7(0x1e9)](_0x23f948)){if(!_0x57cf4d[_0x11b4a7(0x1ed)]){_0x2fc157++;continue;}const _0x3a2ef3=serializeRule(_0x57cf4d['rule']),_0x5a7d60=_0x3895dc[_0x11b4a7(0x225)](_0x3a2ef3)||[];_0x5a7d60[_0x11b4a7(0x1ea)]({'name':_0xe938a2,'index':_0x2fc157}),_0x3895dc['set'](_0x3a2ef3,_0x5a7d60),_0x2fc157++;}const _0x40c980=new Map();for(const [_0x564a6d,_0x485b1b]of _0x3895dc){const _0x12ca3d=_0x485b1b[_0x11b4a7(0x222)]()['sort']((_0x300afb,_0x2b74a5)=>{const _0x247cb7=_0x11b4a7,_0x1032ae=_0x19c0e4[_0x247cb7(0x225)](_0x300afb[_0x247cb7(0x202)])||0x0,_0x33fa58=_0x19c0e4[_0x247cb7(0x225)](_0x2b74a5[_0x247cb7(0x202)])||0x0;if(_0x1032ae!==_0x33fa58)return _0x33fa58-_0x1032ae;return _0x300afb[_0x247cb7(0x1ec)]-_0x2b74a5[_0x247cb7(0x1ec)];})[_0x11b4a7(0x21f)](_0x2dc57b=>_0x2dc57b[_0x11b4a7(0x202)]);_0x40c980[_0x11b4a7(0x1f0)](_0x564a6d,_0x12ca3d);}return _0x40c980;}export function collectSegmentUsageCounts(_0x44529d){const _0x39a123=a92_0x4dab,_0x42a303=new Map(),_0x20fadc=_0x481424=>{const _0x414cf9=a92_0x4dab;if(!_0x481424)return;_0x42a303[_0x414cf9(0x1f0)](_0x481424,(_0x42a303['get'](_0x481424)||0x0)+0x1);},_0xadc9c6=_0x4da731=>{const _0x18c676=a92_0x4dab;for(const _0x18369e of _0x4da731){_0x20fadc(_0x18369e['entry_criteria']?.['segment']);if(_0x18369e[_0x18c676(0x228)])for(const _0x413a2b of _0x18369e[_0x18c676(0x228)]){_0x20fadc(_0x413a2b[_0x18c676(0x1f8)]);}_0x20fadc(_0x18369e[_0x18c676(0x203)]?.['segment']);if(_0x18369e[_0x18c676(0x210)])for(const _0x507292 of _0x18369e[_0x18c676(0x210)]){if(_0x507292[_0x18c676(0x206)]===_0x18c676(0x1ff))for(const _0x3d8e85 of _0x507292['with'][_0x18c676(0x1e8)]){_0x20fadc(_0x3d8e85[_0x18c676(0x1f8)]);}else _0x507292[_0x18c676(0x206)]===_0x18c676(0x1fb)&&_0x20fadc(_0x507292[_0x18c676(0x1fa)][_0x18c676(0x220)]?.['segment']);}}};_0x20fadc(_0x44529d[_0x39a123(0x216)]?.[_0x39a123(0x1f8)]);if(_0x44529d[_0x39a123(0x208)])for(const _0x144640 of _0x44529d[_0x39a123(0x208)]){_0x20fadc(_0x144640[_0x39a123(0x216)]?.[_0x39a123(0x1f8)]),_0xadc9c6(_0x144640[_0x39a123(0x1f5)]);}_0x44529d[_0x39a123(0x1f5)]&&_0xadc9c6(_0x44529d[_0x39a123(0x1f5)]);if(_0x44529d[_0x39a123(0x1f1)])for(const _0x3fc8fd of _0x44529d['versions']){_0xadc9c6(_0x3fc8fd[_0x39a123(0x1f5)]);}return _0x42a303;}
|