@treasuredata/tdx 2026.3.8 → 2026.3.10
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 +3 -3
- package/dist/cli-categories.js +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/agent-test-command.js +1 -1
- package/dist/commands/api-command.js +1 -1
- package/dist/commands/auth-command.js +1 -1
- package/dist/commands/auth-login-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/databases.js +1 -1
- package/dist/commands/delivery-command.js +1 -1
- package/dist/commands/describe.js +1 -1
- package/dist/commands/engage-campaign-pull-command.js +1 -1
- package/dist/commands/engage-campaign-push-command.js +1 -1
- package/dist/commands/engage-campaign-validate-command.js +1 -1
- package/dist/commands/engage-command.js +1 -1
- package/dist/commands/engage-template-pull-command.js +1 -1
- package/dist/commands/engage-template-push-command.js +1 -1
- package/dist/commands/engage-template-validate-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/mcp-command.js +1 -1
- package/dist/commands/parent-segment-command.js +1 -1
- package/dist/commands/profile-command.js +1 -1
- package/dist/commands/profiles-command.js +1 -1
- package/dist/commands/query-command.js +1 -1
- package/dist/commands/schedule-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/status-command.js +1 -1
- package/dist/commands/tables.js +1 -1
- package/dist/commands/unset-command.js +1 -1
- package/dist/commands/upgrade-command.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.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.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.js +1 -1
- package/dist/core/keychain.js +1 -1
- package/dist/core/oauth-keychain.js +1 -1
- package/dist/core/oauth.d.ts +2 -2
- package/dist/core/oauth.js +1 -1
- package/dist/core/profile.js +1 -1
- package/dist/core/profile.js.map +1 -1
- package/dist/core/project-config.js +1 -1
- package/dist/core/session.js +1 -1
- package/dist/core/user-cache.js +1 -1
- package/dist/core/version.js +1 -1
- package/dist/index.js +1 -1
- package/dist/mcp/server.js +1 -1
- package/dist/mcp/tools/index.js +1 -1
- package/dist/mcp/tools/tdx-run.js +1 -1
- package/dist/mcp/tools/tdx-search.js +1 -1
- package/dist/mcp/utils.js +1 -1
- package/dist/proxy/claude-usage-tracker.js +1 -1
- package/dist/proxy/passthrough-server.js +1 -1
- package/dist/proxy/sse-usage-parser.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/agent/test/evaluator.js +1 -1
- package/dist/sdk/agent/test/executor.js +1 -1
- package/dist/sdk/agent/test/index.js +1 -1
- package/dist/sdk/agent/test/output.js +1 -1
- package/dist/sdk/agent/test/parser.js +1 -1
- package/dist/sdk/agent/tool-target-registry.js +1 -1
- package/dist/sdk/api.js +1 -1
- package/dist/sdk/client/cdp-api-client.js +1 -1
- package/dist/sdk/client/delivery-api-client.js +1 -1
- package/dist/sdk/client/endpoints.js +1 -1
- package/dist/sdk/client/endpoints.js.map +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/oauth-refresh.d.ts +1 -1
- package/dist/sdk/client/oauth-refresh.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.js +1 -1
- package/dist/sdk/connection-validator.js +1 -1
- package/dist/sdk/connection.js +1 -1
- package/dist/sdk/delivery.js +1 -1
- package/dist/sdk/engage/campaign-pull.js +1 -1
- package/dist/sdk/engage/campaign-push.js +1 -1
- package/dist/sdk/engage/campaign-validator.js +1 -1
- package/dist/sdk/engage/campaign-yaml.js +1 -1
- package/dist/sdk/engage/template-pull.js +1 -1
- package/dist/sdk/engage/template-push.js +1 -1
- package/dist/sdk/engage/template-validator.js +1 -1
- package/dist/sdk/engage/template-yaml.js +1 -1
- package/dist/sdk/engage/types/campaign-def.js +1 -1
- package/dist/sdk/engage/types/campaign-schema.js +1 -1
- package/dist/sdk/engage/types/template-schema.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-factors.js +1 -1
- package/dist/sdk/personalization.js +1 -1
- package/dist/sdk/query/index.js +1 -1
- package/dist/sdk/query/sql-parser.js +1 -1
- package/dist/sdk/realtime.js +1 -1
- package/dist/sdk/schedule.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.d.ts.map +1 -1
- package/dist/sdk/segment/journey-utils.js +1 -1
- package/dist/sdk/segment/journey-utils.js.map +1 -1
- package/dist/sdk/segment/journey-validator.js +1 -1
- package/dist/sdk/segment/journey-yaml.js +1 -1
- package/dist/sdk/segment/journey-yaml.js.map +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-recovery.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/segment-validator.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/types/activation-schema.js +1 -1
- package/dist/sdk/segment/types/journey-def.js +1 -1
- package/dist/sdk/segment/types/journey-schema.js +1 -1
- package/dist/sdk/segment/types/segment-def.js +1 -1
- package/dist/sdk/segment/types/segment-schema.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.js +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/paginate.js +1 -1
- package/dist/sdk/util/tree-formatter.js +1 -1
- package/dist/sdk/workflow/archive-validation.js +1 -1
- package/dist/sdk/workflow/clone-workflow.js +1 -1
- package/dist/sdk/workflow/index.d.ts +12 -0
- 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/pull-workflow.js +1 -1
- package/dist/sdk/workflow/push-workflow.js +1 -1
- package/dist/sdk/workflow/tdx-config.js +1 -1
- package/dist/sdk/workflow/workflow-utils.js +1 -1
- package/dist/test-utils/command-runner.js +1 -1
- package/dist/test-utils/factories.js +1 -1
- package/dist/test-utils/fixtures.js +1 -1
- package/dist/test-utils/http-mock.js +1 -1
- package/dist/test-utils/index.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/file-reader.js +1 -1
- package/dist/utils/github-releases.js +1 -1
- package/dist/utils/global-cache.js +1 -1
- package/dist/utils/json-loader.js +1 -1
- package/dist/utils/local-cache.js +1 -1
- package/dist/utils/logger/formatters/default-formatter.js +1 -1
- package/dist/utils/logger/formatters/index.js +1 -1
- package/dist/utils/logger/handlers/console-handler.js +1 -1
- package/dist/utils/logger/handlers/file-handler.js +1 -1
- package/dist/utils/logger/handlers/index.js +1 -1
- package/dist/utils/logger/handlers/null-handler.js +1 -1
- package/dist/utils/logger/index.js +1 -1
- package/dist/utils/logger/logger.js +1 -1
- package/dist/utils/logger/types.js +1 -1
- package/dist/utils/option-validation.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
|
-
const a140_0x2ff839=a140_0x18bd;(function(_0x360ae2,_0xcf3f60){const _0x54ce01=a140_0x18bd,_0x514e43=_0x360ae2();while(!![]){try{const _0x4007a7=-parseInt(_0x54ce01(0x296))/0x1*(-parseInt(_0x54ce01(0x275))/0x2)+parseInt(_0x54ce01(0x2ba))/0x3+-parseInt(_0x54ce01(0x26a))/0x4*(parseInt(_0x54ce01(0x208))/0x5)+-parseInt(_0x54ce01(0x2d3))/0x6+-parseInt(_0x54ce01(0x253))/0x7+parseInt(_0x54ce01(0x234))/0x8*(parseInt(_0x54ce01(0x2b6))/0x9)+parseInt(_0x54ce01(0x251))/0xa;if(_0x4007a7===_0xcf3f60)break;else _0x514e43['push'](_0x514e43['shift']());}catch(_0x534fcf){_0x514e43['push'](_0x514e43['shift']());}}}(a140_0x33e7,0x492c3));import{createHash}from'crypto';import{Logger}from'../../utils/logger/index.js';const logger=Logger['of'](a140_0x2ff839(0x2d2));export const PENDING_SEGMENT_PREFIX=a140_0x2ff839(0x1ef);export const PENDING_ACTIVATION_PREFIX=a140_0x2ff839(0x22e);export function createPendingSegmentId(_0x43e1e5){return''+PENDING_SEGMENT_PREFIX+_0x43e1e5+'__';}export function isPendingSegmentId(_0x1f09da){const _0x50e166=a140_0x2ff839;return _0x1f09da[_0x50e166(0x27e)](PENDING_SEGMENT_PREFIX)&&!_0x1f09da[_0x50e166(0x27e)](PENDING_ACTIVATION_PREFIX);}export function extractPendingSegmentName(_0x2a7476){return _0x2a7476['replace'](/^__pending_(.+)__$/,'$1');}export function createPendingActivationId(_0x4aa51b){return''+PENDING_ACTIVATION_PREFIX+_0x4aa51b+'__';}export function isPendingActivationId(_0x731b9c){return _0x731b9c['startsWith'](PENDING_ACTIVATION_PREFIX);}export function extractPendingActivationName(_0x8a4564){const _0x406810=a140_0x2ff839;return _0x8a4564[_0x406810(0x233)](/^__pending_act_(.+)__$/,'$1');}export function generateDeterministicJourneySegmentName(_0x508eb4,_0x36f01a){const _0xb87d82=a140_0x2ff839,_0x4da48f=_0x508eb4+'::'+(_0x36f01a[_0xb87d82(0x256)]()||_0xb87d82(0x1f7)),_0xa2472e=createHash(_0xb87d82(0x216))[_0xb87d82(0x210)](_0x4da48f)[_0xb87d82(0x27d)](_0xb87d82(0x26c))[_0xb87d82(0x2d4)](0x0,0xc);return'journey_entry_criteria_'+_0xa2472e;}export function ensureJourneyDefaults(_0x253695){const _0x599ee4=a140_0x2ff839;!_0x253695[_0x599ee4(0x26d)]&&(_0x253695[_0x599ee4(0x26d)]=''),!_0x253695[_0x599ee4(0x1f3)]&&(_0x253695[_0x599ee4(0x1f3)]=_0x599ee4(0x23a));}export function injectExistingStageIds(_0x27db96,_0x33294f){const _0x2f2448=a140_0x2ff839,_0xcbebe9=new Map(_0x33294f['map'](_0x4847ca=>[_0x4847ca[_0x2f2448(0x258)],_0x4847ca['id']]));for(const _0x603da9 of _0x27db96){if(!_0x603da9['id']){const _0xed0e27=_0xcbebe9['get'](_0x603da9[_0x2f2448(0x258)]);_0xed0e27&&(_0x603da9['id']=_0xed0e27);}}}export function resolveTDFolderPath(_0x48c90f,_0x2d7aad,_0x4e627b){if(!_0x2d7aad)return _0x48c90f;if(_0x48c90f===_0x4e627b||_0x48c90f['startsWith'](_0x4e627b+'/'))return _0x48c90f;return _0x48c90f?_0x4e627b+'/'+_0x48c90f:_0x4e627b;}export function addFoldersToCreate(_0x31f4d6,_0x250c70,_0x30d180){const _0x3accfa=a140_0x2ff839;if(!_0x31f4d6)return;if(_0x250c70[_0x3accfa(0x200)](_0x31f4d6))return;const _0x2ba48b=_0x31f4d6['split']('/');let _0x49e595='';for(const _0x1f522d of _0x2ba48b){_0x49e595=_0x49e595?_0x49e595+'/'+_0x1f522d:_0x1f522d,!_0x250c70['has'](_0x49e595)&&_0x30d180[_0x3accfa(0x237)](_0x49e595);}}export function sortFoldersByDepth(_0x30a59e){const _0x48c1e4=a140_0x2ff839;return[..._0x30a59e][_0x48c1e4(0x2c7)]((_0xe67066,_0x549740)=>{const _0x6a8787=_0x48c1e4,_0xa878b1=(_0xe67066['match'](/\//g)||[])[_0x6a8787(0x2cc)],_0x4c4fe8=(_0x549740['match'](/\//g)||[])['length'];return _0xa878b1-_0x4c4fe8;});}import*as a140_0x2af49b from'yaml';import{readFileSync}from'fs';import a140_0x20a41d from'path';import{isJourneyDef,parseYamlString as a140_0x38903d,toYamlString as a140_0x20196f,normalizeJourneyDef,hasMultipleVersions,journeyResponseToDef,collectSegmentIdsFromJourneyApi}from'./journey-yaml.js';import{SEGMENT_KIND_JOURNEY,generateJourneyLocalName,sanitizeYamlKey,createJumpTargetCache,resolveJumpTarget,buildMergedJourneyDef,buildLocalRuleToNameMappingFromJourney,collectSegmentUsageCounts}from'./journey-utils.js';import{activationResponseToDef,segmentToYamlString,segmentWithActivationsToYaml,parseSegmentYamlFile,normalizeChildSegmentYaml,apiRuleToYaml,yamlRuleToApi,serializeExpandedRule,collectSegmentRefsFromRule,resolveRuleSegmentRefs,resolveRuleSegmentIds,journeyActivationStepToYaml}from'./child-segment-yaml.js';import{generateDiff,formatDiffWithColors,hasChanges}from'../../utils/diff.js';import{batchAsync}from'../../utils/async.js';import{buildFolderMaps}from'./resolution-context.js';import{SDKError,ErrorCode,isHttp400Error,getErrorMessage}from'../errors.js';import{readPushRecovery,saveSegmentToPushRecovery,deletePushRecovery}from'./push-recovery.js';import{validateSegmentDef,formatValidationResult}from'./yaml-validator.js';import{validateJourneyDef}from'./journey-validator.js';function stableStringify(_0x2d70de){const _0x1baf6a=a140_0x2ff839;if(Array[_0x1baf6a(0x280)](_0x2d70de))return'['+_0x2d70de[_0x1baf6a(0x295)](_0x35fe01=>stableStringify(_0x35fe01))[_0x1baf6a(0x2f0)](',')+']';if(_0x2d70de&&typeof _0x2d70de===_0x1baf6a(0x23f)){const _0x1554c0=_0x2d70de,_0x569572=Object[_0x1baf6a(0x20a)](_0x1554c0)[_0x1baf6a(0x2c7)](),_0x3c3997=_0x569572[_0x1baf6a(0x295)](_0x2fb686=>'\x22'+_0x2fb686+'\x22:'+stableStringify(_0x1554c0[_0x2fb686]));return'{'+_0x3c3997[_0x1baf6a(0x2f0)](',')+'}';}const _0x26a653=JSON['stringify'](_0x2d70de);return _0x26a653===undefined?'null':_0x26a653;}function activationSignature(_0x2082ed){const _0x48b90a=a140_0x2ff839,_0x172fa4={'connection':_0x2082ed['connection'],..._0x2082ed[_0x48b90a(0x277)]!==undefined&&{'all_columns':_0x2082ed[_0x48b90a(0x277)]},..._0x2082ed[_0x48b90a(0x276)]!==undefined&&{'columns':_0x2082ed[_0x48b90a(0x276)]},..._0x2082ed[_0x48b90a(0x1fd)]!==undefined&&{'behavior':_0x2082ed[_0x48b90a(0x1fd)]},..._0x2082ed[_0x48b90a(0x289)]!==undefined&&{'schedule':_0x2082ed[_0x48b90a(0x289)]},..._0x2082ed['notification']!==undefined&&{'notification':_0x2082ed['notification']},..._0x2082ed['connector_config']!==undefined&&{'connector_config':_0x2082ed['connector_config']},..._0x2082ed[_0x48b90a(0x231)]!==undefined&&{'activation_template_id':_0x2082ed[_0x48b90a(0x231)]}};return stableStringify(_0x172fa4);}async function fetchSegment(_0x36ce55,_0x4d427f,_0x232f58,_0x48ca09){const _0x22ee37=a140_0x2ff839,_0x2a75f5=_0x48ca09?.['find'](_0x352f6b=>_0x352f6b['id']===_0x232f58);if(_0x2a75f5)return _0x2a75f5;try{return await _0x36ce55['segment'][_0x22ee37(0x20d)](_0x4d427f,_0x232f58);}catch(_0x37809d){logger[_0x22ee37(0x262)](_0x22ee37(0x224)+_0x232f58+',\x20falling\x20back\x20to\x20getSegmentEntity:\x20'+_0x37809d);try{return await _0x36ce55['segment']['getSegmentEntity'](_0x232f58);}catch(_0x17f293){return logger[_0x22ee37(0x262)](_0x22ee37(0x2ee)+_0x232f58+':\x20'+_0x17f293),null;}}}function recoverSegmentIdsFromPushRecovery(_0x2a89a6,_0x34c4bb,_0x5223cc){const _0x3df85d=a140_0x2ff839,_0x5cbe49=readPushRecovery(_0x2a89a6[_0x3df85d(0x2d1)]);if(_0x5cbe49?.[_0x3df85d(0x248)]===_0x2a89a6[_0x3df85d(0x2a6)][_0x3df85d(0x258)])for(const [_0x22d013,_0xf0eea0]of Object[_0x3df85d(0x2ea)](_0x5cbe49[_0x3df85d(0x2e1)])){const _0x3faaee=generateDeterministicJourneySegmentName(_0x2a89a6[_0x3df85d(0x2a6)][_0x3df85d(0x258)],_0x22d013);_0xf0eea0[_0x3df85d(0x21f)]===_0x3faaee&&(_0x34c4bb['set'](_0x22d013,_0xf0eea0[_0x3df85d(0x2a2)]),_0x5223cc[_0x3df85d(0x282)](_0x22d013,_0xf0eea0['segmentId']));}}async function createOrRecoverEmbeddedSegment(_0x573e24,_0x14f28c,_0x18fa53,_0x54f463){const _0x59ae55=a140_0x2ff839;let _0x25a159;try{_0x25a159=await _0x573e24['segment'][_0x59ae55(0x227)]({'name':_0x18fa53['uniqueSegmentName'],'description':_0x18fa53[_0x59ae55(0x26d)],'journeyId':_0x18fa53['journeyId'],'rule':_0x54f463(_0x18fa53[_0x59ae55(0x27a)],!![]),'countPopulation':!![],'parentFolderId':_0x18fa53['folderId'],'audienceId':_0x18fa53[_0x59ae55(0x22c)]});}catch(_0x44f635){const _0x420e02=_0x44f635 instanceof Error&&_0x44f635[_0x59ae55(0x2c1)]['includes'](_0x59ae55(0x263));if(_0x420e02){const _0x281b1f=readPushRecovery(_0x14f28c[_0x59ae55(0x2d1)]),_0x62d385=_0x281b1f?.[_0x59ae55(0x248)]===_0x14f28c[_0x59ae55(0x2a6)][_0x59ae55(0x258)]?_0x281b1f[_0x59ae55(0x2e1)][_0x18fa53[_0x59ae55(0x290)]]:undefined;if(_0x62d385?.[_0x59ae55(0x21f)]===_0x18fa53[_0x59ae55(0x2e3)])await _0x573e24[_0x59ae55(0x1f7)][_0x59ae55(0x255)](_0x18fa53[_0x59ae55(0x22c)],_0x62d385[_0x59ae55(0x2a2)],{'description':_0x18fa53[_0x59ae55(0x26d)],'rule':_0x54f463(_0x18fa53[_0x59ae55(0x27a)],!![]),'countPopulation':!![]}),_0x25a159=_0x62d385[_0x59ae55(0x2a2)];else throw new SDKError(ErrorCode[_0x59ae55(0x287)],'Embedded\x20segment\x20\x27'+_0x18fa53['localName']+_0x59ae55(0x254)+(_0x59ae55(0x28f)+_0x14f28c[_0x59ae55(0x2d1)]['replace'](/([^/]+)$/,_0x59ae55(0x2bd))+')\x20')+_0x59ae55(0x1fe),_0x44f635);}else throw _0x44f635;}return saveSegmentToPushRecovery(_0x14f28c[_0x59ae55(0x2d1)],_0x14f28c[_0x59ae55(0x2a6)][_0x59ae55(0x258)],_0x18fa53['localName'],{'segmentId':_0x25a159,'uniqueServerName':_0x18fa53[_0x59ae55(0x2e3)],'createdAt':new Date()['toISOString']()}),_0x25a159;}export async function prepareSegmentFiles(_0x2c6a5b,_0x1a9c4c,_0x391ada,_0x7ba9cf,_0x62329e){const _0x1c306e=a140_0x2ff839,{activationDefToCreateRequest:_0x187937}=await import(_0x1c306e(0x2b4)),_0x5a219d=[],_0x3b5a63=new Set();for(const {yamlConfig:_0x1a39a2,folderPath:_0x2c28df,sourcePath:_0x5bfb20}of _0x2c6a5b){const _0xbda484=resolveTDFolderPath(_0x2c28df,_0x7ba9cf,_0x62329e),_0x3e5851=_0xbda484+':'+_0x1a39a2[_0x1c306e(0x258)],_0x23153a=_0x1a9c4c[_0x1c306e(0x204)]['get'](_0x3e5851),_0x5c1bff=_0x23153a?_0x1a9c4c[_0x1c306e(0x20b)][_0x1c306e(0x2c3)](_0x23153a['id'])||[]:[];addFoldersToCreate(_0xbda484,_0x1a9c4c[_0x1c306e(0x2ed)],_0x3b5a63);const _0x4a7e44=calculateActivationActions(_0x1a39a2['activations']||[],_0x5c1bff,_0x1a9c4c[_0x1c306e(0x225)],_0x1a9c4c['connectionIdToNameMap']);for(const _0x3b0647 of _0x4a7e44){(_0x3b0647[_0x1c306e(0x2b5)]===_0x1c306e(0x27f)||_0x3b0647[_0x1c306e(0x2b5)]===_0x1c306e(0x210))&&_0x3b0647[_0x1c306e(0x205)]&&(_0x3b0647[_0x1c306e(0x232)]=await _0x187937(_0x3b0647[_0x1c306e(0x205)],_0x391ada));}const _0x46bc29=calculateSegmentDiff(_0x1a39a2,_0x23153a,_0x5c1bff,_0x1a9c4c[_0x1c306e(0x225)],_0x1a9c4c[_0x1c306e(0x244)]);_0x5a219d[_0x1c306e(0x1fc)]({'relativePath':_0x1a39a2[_0x1c306e(0x258)],'absolutePath':_0x5bfb20,'yamlConfig':_0x1a39a2,'folderPath':_0xbda484,'existingSegment':_0x23153a,'existingActivations':_0x5c1bff,'isNew':_0x46bc29[_0x1c306e(0x264)],'hasChanges':_0x46bc29[_0x1c306e(0x24c)],'diff':_0x46bc29[_0x1c306e(0x29b)],'activationActions':_0x4a7e44});}return{'segmentFiles':_0x5a219d,'foldersToCreate':_0x3b5a63};}export async function prepareJourneyFiles(_0x3d602d,_0x2a80ca,_0x435a61,_0xdaba0f){const _0x9d0132=a140_0x2ff839,_0x39fb50=[],_0x25f8ba=new Set();for(const {yamlConfig:_0x15468c,folderPath:_0xc91c8d,sourcePath:_0x39e05b}of _0x3d602d){const _0x3d6dda=resolveTDFolderPath(_0xc91c8d,_0x435a61,_0xdaba0f),_0x538afd=_0x3d6dda+':'+_0x15468c['name'],_0x54ba95=_0x2a80ca[_0x9d0132(0x1f1)][_0x9d0132(0x2c3)](_0x538afd);let _0x230381,_0x27d305;if(_0x54ba95&&_0x54ba95[_0x9d0132(0x2cc)]>0x0){const _0x6c3a31=buildLocalExpandedRuleMappings(_0x15468c),{createYamlContext:_0x4c8004,prefetchJourneySegments:_0x472dc9}=createPushYamlContextForBundle(_0x2a80ca['deps'],_0x2a80ca['parentId'],_0x2a80ca['existingSegments'],_0x6c3a31,_0x2a80ca[_0x9d0132(0x225)],_0x2a80ca['connectionIdToNameMap'],_0x2a80ca['activationStepsById'],_0x2a80ca[_0x9d0132(0x2ef)]);await _0x472dc9(_0x54ba95[_0x9d0132(0x295)](_0x44aa67=>_0x44aa67['id']));const _0x16dca1=await _0x2a80ca['deps'][_0x9d0132(0x209)][_0x9d0132(0x23e)](_0x54ba95[0x0][_0x9d0132(0x236)]),_0x41b038=hasMultipleVersions(_0x15468c),_0x31da99=async _0x5a906a=>{const _0x4ec8cd=_0x9d0132,_0x198ddb=_0x2a80ca['journeyById']?.[_0x4ec8cd(0x2c3)](_0x5a906a);if(_0x198ddb)return _0x198ddb;return _0x2a80ca[_0x4ec8cd(0x246)]({'journeyId':_0x5a906a,'journeyName':_0x15468c[_0x4ec8cd(0x258)],'isMultiVersion':_0x54ba95['length']>0x1});};if(_0x41b038&&_0x54ba95[_0x9d0132(0x2cc)]>0x1){const _0x4c27fd=[];for(const _0x421857 of _0x54ba95){const _0x546c1e=_0x421857[_0x9d0132(0x235)]||0x1;_0x2a80ca[_0x9d0132(0x229)]?.[_0x9d0132(0x210)](_0x9d0132(0x2c9)+_0x15468c[_0x9d0132(0x258)]+'\x20v'+_0x546c1e);const _0xf06331=await _0x31da99(_0x421857['id']),_0x46719a=_0x4c8004(_0x421857['id']),_0x1ed747=await journeyResponseToDef(_0xf06331,_0x46719a);_0x4c27fd[_0x9d0132(0x1fc)]({'item':_0x421857,'yaml':_0x1ed747});}const _0x97f095=buildLocalRuleToNameMappingFromJourney(_0x15468c);_0x27d305=buildMergedJourneyDef(_0x4c27fd,_0x97f095,_0x16dca1);const _0x1b8ba=Math['max'](..._0x4c27fd[_0x9d0132(0x295)](_0x2db536=>_0x2db536[_0x9d0132(0x260)][_0x9d0132(0x235)]||0x0)),_0x4d8a12=_0x54ba95['find'](_0x256117=>(_0x256117[_0x9d0132(0x235)]||0x0)===_0x1b8ba);_0x4d8a12&&(_0x2a80ca[_0x9d0132(0x229)]?.['update'](_0x9d0132(0x2c9)+_0x15468c[_0x9d0132(0x258)]+'\x20v'+_0x1b8ba),_0x230381=await _0x31da99(_0x4d8a12['id']));}else{const _0x21dce2=_0x54ba95[_0x54ba95[_0x9d0132(0x2cc)]-0x1];_0x2a80ca['progress']?.[_0x9d0132(0x210)](_0x9d0132(0x2c9)+_0x15468c[_0x9d0132(0x258)]),_0x230381=await _0x31da99(_0x21dce2['id']);const _0x3d247f=_0x4c8004(_0x21dce2['id']),_0x423922=await journeyResponseToDef(_0x230381,_0x3d247f),_0xf6a8d6=buildLocalRuleToNameMappingFromJourney(_0x15468c);_0x27d305=buildMergedJourneyDef([{'item':_0x21dce2,'yaml':_0x423922}],_0xf6a8d6,_0x16dca1);}}addFoldersToCreate(_0x3d6dda,_0x2a80ca[_0x9d0132(0x2ed)],_0x25f8ba);const _0x55dcbc=calculateJourneyDiff(_0x15468c,_0x27d305);_0x39fb50[_0x9d0132(0x1fc)]({'relativePath':_0x15468c[_0x9d0132(0x258)],'absolutePath':_0x39e05b,'yamlConfig':_0x15468c,'folderPath':_0x3d6dda,'existingJourney':_0x230381,'isNew':_0x55dcbc[_0x9d0132(0x264)],'hasChanges':_0x55dcbc[_0x9d0132(0x24c)],'diff':_0x55dcbc[_0x9d0132(0x29b)]});}return{'journeyFiles':_0x39fb50,'foldersToCreate':_0x25f8ba};}export function calculateActivationActions(_0x1d63df,_0x31386c,_0x2c1322,_0x505960){const _0x475f0b=a140_0x2ff839,_0x158c8d=[],_0x4877d9=new Map();for(const _0x21f8f3 of _0x31386c){_0x4877d9[_0x475f0b(0x282)](_0x21f8f3[_0x475f0b(0x258)],_0x21f8f3);}const _0x230dfa=new Map();for(const _0x4fad1e of _0x1d63df){_0x230dfa['set'](_0x4fad1e[_0x475f0b(0x258)],_0x4fad1e);}for(const _0x5b6e57 of _0x1d63df){const _0x37a360=_0x4877d9['get'](_0x5b6e57['name']);if(!_0x37a360)_0x158c8d['push']({'type':_0x475f0b(0x27f),'name':_0x5b6e57['name'],'yamlActivation':_0x5b6e57});else{const _0x3b4dcc=activationResponseToDef(_0x37a360,_0x2c1322,_0x505960),_0x166183=a140_0x2af49b['stringify'](_0x3b4dcc),_0x3db876=a140_0x2af49b['stringify'](_0x5b6e57);_0x166183!==_0x3db876&&_0x158c8d['push']({'type':_0x475f0b(0x210),'name':_0x5b6e57[_0x475f0b(0x258)],'yamlActivation':_0x5b6e57,'existingActivation':_0x37a360});}}for(const _0x4c1269 of _0x31386c){!_0x230dfa[_0x475f0b(0x200)](_0x4c1269[_0x475f0b(0x258)])&&_0x158c8d[_0x475f0b(0x1fc)]({'type':_0x475f0b(0x2d9),'name':_0x4c1269[_0x475f0b(0x258)],'existingActivation':_0x4c1269});}return _0x158c8d;}function calculateYamlDiff(_0x3ea196,_0x56ab11){if(_0x56ab11){const _0x30a6d6=generateDiff(_0x56ab11,_0x3ea196),_0x4fe082=hasChanges(_0x30a6d6);return{'isNew':![],'hasChanges':_0x4fe082,'diff':_0x4fe082?formatDiffWithColors(_0x30a6d6):undefined};}const _0x1a6e22=generateDiff('',_0x3ea196);return{'isNew':!![],'hasChanges':![],'diff':formatDiffWithColors(_0x1a6e22)};}export function calculateSegmentDiff(_0x58b7ae,_0x360daa,_0x4bd6c9,_0x58a027,_0x5dce50){const _0x4e6c0a=segmentToYamlString(_0x58b7ae),_0x4f3141=_0x360daa?segmentToYamlString(segmentWithActivationsToYaml(_0x360daa,_0x4bd6c9,undefined,_0x58a027,_0x5dce50)):undefined;return calculateYamlDiff(_0x4e6c0a,_0x4f3141);}export function calculateJourneyDiff(_0x441ce4,_0x2f9587){const _0x373304=normalizeJourneyDef(_0x441ce4,_0x441ce4),_0x30f326=a140_0x20196f(_0x373304),_0x37c352=_0x2f9587?a140_0x20196f(normalizeJourneyDef(_0x2f9587,_0x441ce4)):undefined;return calculateYamlDiff(_0x30f326,_0x37c352);}export function findSegmentsToDelete(_0x551308,_0xa23430,_0x40c4f7,_0x35b107,_0x381896){const _0x5700c4=a140_0x2ff839,_0x2da6fe=new Set();for(const {yamlConfig:_0x252fc9,folderPath:_0x4126bb}of _0xa23430){_0x2da6fe[_0x5700c4(0x237)](_0x4126bb+':'+_0x252fc9['name']);}return _0x551308[_0x5700c4(0x2ec)](_0x493622=>{const _0x4c2e72=_0x5700c4,_0x398e1d=_0x493622[_0x4c2e72(0x299)]?_0x40c4f7[_0x4c2e72(0x2c3)](_0x493622[_0x4c2e72(0x299)][_0x4c2e72(0x24a)]())||'':'',_0x44b29e=_0x398e1d+':'+_0x493622[_0x4c2e72(0x258)];if(_0x2da6fe[_0x4c2e72(0x200)](_0x44b29e))return![];if(_0x381896)return _0x398e1d===_0x35b107||_0x398e1d[_0x4c2e72(0x27e)](_0x35b107+'/');return!![];});}export function findJourneysToDelete(_0x126f88,_0x3622e5,_0x357db9,_0x2d9461,_0x4ce486){const _0x39c615=a140_0x2ff839,_0x248924=new Set();for(const {yamlConfig:_0x14992b,folderPath:_0x338467}of _0x3622e5){_0x248924[_0x39c615(0x237)](_0x338467+':'+_0x14992b['name']);}return _0x126f88[_0x39c615(0x2ec)](_0x418b5d=>{const _0xfc5d2b=_0x39c615,_0x2439ec=_0x418b5d['folderId']?_0x357db9[_0xfc5d2b(0x2c3)](_0x418b5d['folderId'])||'':'',_0x2290f8=_0x2439ec+':'+_0x418b5d['journeyBundleName'];if(_0x248924['has'](_0x2290f8))return![];if(_0x4ce486)return _0x2439ec===_0x2d9461||_0x2439ec['startsWith'](_0x2d9461+'/');return!![];});}export function buildSegmentLookupMap(_0x3cf60f,_0x4fee0a){const _0x2fd090=a140_0x2ff839,_0x3fd2ed=new Map();for(const _0x1edd16 of _0x3cf60f){const _0x107410=_0x1edd16[_0x2fd090(0x299)]?_0x4fee0a[_0x2fd090(0x2c3)](_0x1edd16[_0x2fd090(0x299)]['toString']())||'':'',_0x52b4d7=_0x107410+':'+_0x1edd16[_0x2fd090(0x258)];_0x3fd2ed['set'](_0x52b4d7,_0x1edd16);}return _0x3fd2ed;}export function buildSegmentNameToIdMap(_0x3f6a10){const _0x1b8c97=a140_0x2ff839,_0x16a05c=new Map();for(const _0x5171c5 of _0x3f6a10){_0x16a05c[_0x1b8c97(0x282)](_0x5171c5['name'],_0x5171c5['id']);}return _0x16a05c;}export function buildJourneyBundleLookupMap(_0x39a1f8,_0x373fd5){const _0x258ee7=a140_0x2ff839,_0x13e3e3=new Map();for(const _0x328a19 of _0x39a1f8){const _0x215111=_0x328a19[_0x258ee7(0x29d)]?_0x373fd5['get'](_0x328a19[_0x258ee7(0x29d)])||'':'',_0x2c9707=_0x215111+':'+_0x328a19[_0x258ee7(0x220)];!_0x13e3e3[_0x258ee7(0x200)](_0x2c9707)&&_0x13e3e3['set'](_0x2c9707,[]),_0x13e3e3[_0x258ee7(0x2c3)](_0x2c9707)[_0x258ee7(0x1fc)](_0x328a19);}for(const _0x56d1f3 of _0x13e3e3[_0x258ee7(0x213)]()){_0x56d1f3[_0x258ee7(0x2c7)]((_0x407b08,_0x14bea7)=>(_0x407b08[_0x258ee7(0x235)]||0x0)-(_0x14bea7['versionNumber']||0x0));}return _0x13e3e3;}export function collectFoldersToCreate(_0x5d6adc,_0x155b75){const _0x29f2e8=a140_0x2ff839,_0x1e3913=new Set();for(const _0x3f29c3 of _0x5d6adc){if(!_0x3f29c3)continue;if(_0x155b75[_0x29f2e8(0x200)](_0x3f29c3))continue;const _0x206118=_0x3f29c3[_0x29f2e8(0x202)]('/');let _0x2f6472='';for(const _0x1f6568 of _0x206118){_0x2f6472=_0x2f6472?_0x2f6472+'/'+_0x1f6568:_0x1f6568,!_0x155b75[_0x29f2e8(0x200)](_0x2f6472)&&_0x1e3913[_0x29f2e8(0x237)](_0x2f6472);}}return _0x1e3913;}export function parseAndClassifyYamlFiles(_0x242ffd,_0x2dc30d,_0x45e31b){const _0x3c9271=a140_0x2ff839,_0x112d0e=[],_0x333546=[];for(const _0x5cd61a of _0x242ffd){const _0x1a3085=a140_0x20a41d['relative'](_0x2dc30d,a140_0x20a41d['dirname'](_0x5cd61a)),_0x25ae3e=_0x1a3085==='.'?'':_0x1a3085,_0x508033=readFileSync(_0x5cd61a,_0x3c9271(0x2b1)),_0x2cdbd6=a140_0x2af49b[_0x3c9271(0x2e2)](_0x508033);if(isJourneyDef(_0x2cdbd6)){const _0x2a9936=a140_0x38903d(_0x508033);_0x333546['push']({'yamlConfig':_0x2a9936,'folderPath':_0x25ae3e,'sourcePath':_0x5cd61a});}else{if(!_0x45e31b?.[_0x3c9271(0x2bb)]){const _0x574df9=parseSegmentYamlFile(_0x508033),_0xa978aa=normalizeChildSegmentYaml(_0x574df9);_0x112d0e[_0x3c9271(0x1fc)]({'yamlConfig':_0xa978aa,'folderPath':_0x25ae3e,'sourcePath':_0x5cd61a});}}}return{'segments':_0x112d0e,'journeys':_0x333546};}export function validateParsedFiles(_0x2d8f5b,_0x912a50){const _0x3eb86f=a140_0x2ff839,_0x134644=[];for(const {yamlConfig:_0x38e924,sourcePath:_0x423892}of _0x2d8f5b[_0x3eb86f(0x2e1)]){const _0x34da69=readFileSync(_0x423892,_0x3eb86f(0x2b1)),_0x19a555=a140_0x2af49b['parseDocument'](_0x34da69),_0x5c3922=validateSegmentDef(_0x38e924,{'source':_0x34da69,'document':_0x19a555},{'skipSchema':!![]});if(!_0x5c3922['valid']){const _0x369b1=a140_0x20a41d[_0x3eb86f(0x23c)](_0x912a50,_0x423892);_0x134644['push']({'filePath':_0x369b1,'source':_0x34da69,'result':_0x5c3922,'isJourney':![]});}}for(const {yamlConfig:_0xc1600a,sourcePath:_0x299cad}of _0x2d8f5b[_0x3eb86f(0x2c5)]){const _0x931037=readFileSync(_0x299cad,_0x3eb86f(0x2b1)),_0x508a04=a140_0x2af49b[_0x3eb86f(0x2de)](_0x931037),_0x3374fb=validateJourneyDef(_0xc1600a,{'source':_0x931037,'document':_0x508a04},{'skipSchema':!![]});if(!_0x3374fb['valid']){const _0x3952dc=a140_0x20a41d['relative'](_0x912a50,_0x299cad);_0x134644[_0x3eb86f(0x1fc)]({'filePath':_0x3952dc,'source':_0x931037,'result':_0x3374fb,'isJourney':!![]});}}return _0x134644;}export function formatValidationErrors(_0x4ea074){const _0x2dcd5f=a140_0x2ff839,_0x2046e6=[];for(const {filePath:_0x3ec459,source:_0x345f3b,result:_0xf47d3d,isJourney:_0x407310}of _0x4ea074){const _0x62a768=_0x407310?'journey':'segment';_0x2046e6[_0x2dcd5f(0x1fc)]('\x0a'+_0x3ec459+'\x20('+_0x62a768+_0x2dcd5f(0x22d)+_0xf47d3d[_0x2dcd5f(0x29a)][_0x2dcd5f(0x2cc)]+_0x2dcd5f(0x26e)),_0x2046e6[_0x2dcd5f(0x1fc)](formatValidationResult(_0xf47d3d,_0x345f3b,_0x3ec459));}return _0x2046e6['join']('\x0a');}export function buildLocalExpandedRuleMappings(_0x45efc4){const _0x18087b=a140_0x2ff839,_0x29c55e=new Set(),_0xc3b692=new Map(),_0x28a3cc=collectSegmentUsageCounts(_0x45efc4);if(_0x45efc4[_0x18087b(0x2e1)])for(const [_0x53bca9,_0x1bc45f]of Object[_0x18087b(0x2ea)](_0x45efc4[_0x18087b(0x2e1)])){_0x29c55e[_0x18087b(0x237)](_0x53bca9);if(_0x1bc45f[_0x18087b(0x268)]){const _0x49fae1=yamlRuleToApi(_0x1bc45f[_0x18087b(0x268)]),_0x4bc424=apiRuleToYaml(_0x49fae1);_0xc3b692[_0x18087b(0x282)](_0x53bca9,_0x4bc424);}}const _0x5a0b5f=new Map();let _0x4e5f19=0x0;for(const [_0x23f4a3,_0x5c1374]of _0xc3b692){const _0x2cf136=serializeExpandedRule(_0x5c1374,_0xc3b692),_0x2e78a=_0x5a0b5f['get'](_0x2cf136)||[];_0x2e78a['push']({'name':_0x23f4a3,'index':_0x4e5f19}),_0x5a0b5f[_0x18087b(0x282)](_0x2cf136,_0x2e78a),_0x4e5f19++;}const _0x421389=new Map();for(const [_0x5731f6,_0x5d474e]of _0x5a0b5f){const _0x1d3b76=_0x5d474e[_0x18087b(0x2d4)]()['sort']((_0x4eb3bc,_0x1524cf)=>{const _0x117b9d=_0x18087b,_0xe63f46=_0x28a3cc[_0x117b9d(0x2c3)](_0x4eb3bc['name'])||0x0,_0x51a218=_0x28a3cc['get'](_0x1524cf['name'])||0x0;if(_0xe63f46!==_0x51a218)return _0x51a218-_0xe63f46;return _0x4eb3bc['index']-_0x1524cf[_0x117b9d(0x2b3)];})[_0x18087b(0x295)](_0x2d3ffa=>_0x2d3ffa[_0x18087b(0x258)]),_0x3c5a0f=[];for(const _0x1d4b18 of _0x1d3b76){const _0x5b5f27=_0x28a3cc['get'](_0x1d4b18)||0x0,_0x4ac53d=Math[_0x18087b(0x2e8)](_0x5b5f27,0x1);for(let _0x18cb8d=0x0;_0x18cb8d<_0x4ac53d;_0x18cb8d++){_0x3c5a0f[_0x18087b(0x1fc)](_0x1d4b18);}}_0x421389[_0x18087b(0x282)](_0x5731f6,_0x3c5a0f);}return{'existingLocalSegmentNames':_0x29c55e,'localSegmentRules':_0xc3b692,'localExpandedRuleToNames':_0x421389};}export function createSegmentIdResolver(_0x504b38,_0xf1d3b5){return async _0x16616d=>{const _0x41930d=a140_0x18bd,_0x48c930=_0x504b38[_0x41930d(0x2c3)](_0x16616d);if(!_0x48c930)throw new SDKError(ErrorCode[_0x41930d(0x2a8)],_0x41930d(0x271)+_0x16616d+_0x41930d(0x252)+_0xf1d3b5+'\x27)');return _0x48c930;};}export function extractRootFolderId(_0x1774b6){const _0x167555=a140_0x2ff839;return _0x1774b6[_0x167555(0x25e)]?.[_0x167555(0x259)]?.[_0x167555(0x2b0)]?.['id']||_0x1774b6[_0x167555(0x25e)]?.[_0x167555(0x201)]?.[_0x167555(0x2b0)]?.['id'];}export function buildConnectionMaps(_0x43bec2){const _0x28aafc=a140_0x2ff839,_0x2c5816=new Map(),_0x9756c7=new Map(),_0x3191db=new Map();for(const _0x47c71e of _0x43bec2){_0x2c5816['set'](_0x47c71e[_0x28aafc(0x258)],parseInt(_0x47c71e['id'],0xa)),_0x9756c7[_0x28aafc(0x282)](_0x47c71e['id'],_0x47c71e[_0x28aafc(0x258)]),_0x3191db[_0x28aafc(0x282)](_0x47c71e[_0x28aafc(0x258)],_0x47c71e[_0x28aafc(0x2b5)]);}return{'nameToId':_0x2c5816,'idToName':_0x9756c7,'nameToType':_0x3191db};}export function calculatePushStats(_0xc8dae5,_0x1557aa,_0x23c373,_0x6ac3e9,_0x6ceb76,_0x4c1ada,_0x208f60){const _0x22e0d8=a140_0x2ff839,_0x9e0866=_0xc8dae5[_0x22e0d8(0x2ec)](_0x51051a=>_0x51051a['isNew']),_0x1d3322=_0xc8dae5[_0x22e0d8(0x2ec)](_0x12ad20=>!_0x12ad20['isNew']&&_0x12ad20[_0x22e0d8(0x24c)]),_0x2cec88=_0xc8dae5[_0x22e0d8(0x2ec)](_0xb0b4e1=>!_0xb0b4e1[_0x22e0d8(0x264)]&&!_0xb0b4e1[_0x22e0d8(0x24c)]),_0x586269=_0x4c1ada?_0x6ac3e9:[],_0xd6c3f9=_0x1557aa['filter'](_0x15884a=>_0x15884a[_0x22e0d8(0x264)]),_0x109f3c=_0x1557aa[_0x22e0d8(0x2ec)](_0x1cee2b=>!_0x1cee2b[_0x22e0d8(0x264)]&&_0x1cee2b[_0x22e0d8(0x24c)]),_0x1e2b24=_0x1557aa[_0x22e0d8(0x2ec)](_0x2813f3=>!_0x2813f3[_0x22e0d8(0x264)]&&!_0x2813f3[_0x22e0d8(0x24c)]),_0x5b54fc=_0x4c1ada?_0x6ceb76:[],_0x22c880=_0xc8dae5[_0x22e0d8(0x2d0)](_0x256628=>_0x256628[_0x22e0d8(0x26f)]),_0x3d3fae=_0x22c880[_0x22e0d8(0x2ec)](_0x525faa=>_0x525faa[_0x22e0d8(0x2b5)]===_0x22e0d8(0x27f)),_0x9903f3=_0x22c880[_0x22e0d8(0x2ec)](_0x5a55b4=>_0x5a55b4['type']==='update'),_0x3a256f=_0x22c880[_0x22e0d8(0x2ec)](_0x486d3b=>_0x486d3b[_0x22e0d8(0x2b5)]==='delete'),_0x1af9c9=Array[_0x22e0d8(0x2a7)](_0x23c373)[_0x22e0d8(0x2c7)](),_0x1e0924=_0x208f60?![]:_0x9e0866[_0x22e0d8(0x2cc)]>0x0||_0x1d3322['length']>0x0||_0x586269[_0x22e0d8(0x2cc)]>0x0,_0x2ac00f=_0xd6c3f9['length']>0x0||_0x109f3c['length']>0x0||_0x5b54fc[_0x22e0d8(0x2cc)]>0x0,_0x4b7d3c=_0x208f60?![]:_0x22c880[_0x22e0d8(0x2cc)]>0x0,_0x55a96d=_0x1af9c9['length']>0x0;return{'segments':{'new':_0x9e0866,'changed':_0x1d3322,'unchanged':_0x2cec88,'toDelete':_0x586269},'journeys':{'new':_0xd6c3f9,'changed':_0x109f3c,'unchanged':_0x1e2b24,'toDelete':_0x5b54fc},'activations':{'all':_0x22c880,'toCreate':_0x3d3fae,'toUpdate':_0x9903f3,'toDelete':_0x3a256f},'folders':{'toCreate':_0x1af9c9},'counts':{'segments':{'new':_0x9e0866[_0x22e0d8(0x2cc)],'changed':_0x1d3322[_0x22e0d8(0x2cc)],'unchanged':_0x2cec88[_0x22e0d8(0x2cc)],'toDelete':_0x586269['length']},'journeys':{'new':_0xd6c3f9[_0x22e0d8(0x2cc)],'changed':_0x109f3c['length'],'unchanged':_0x1e2b24[_0x22e0d8(0x2cc)],'toDelete':_0x5b54fc[_0x22e0d8(0x2cc)]},'activations':{'create':_0x3d3fae[_0x22e0d8(0x2cc)],'update':_0x9903f3[_0x22e0d8(0x2cc)],'delete':_0x3a256f['length']},'folders':_0x1af9c9[_0x22e0d8(0x2cc)]},'hasChanges':_0x1e0924||_0x2ac00f||_0x4b7d3c||_0x55a96d};}export async function buildPushExecutionContext(_0x521bfd,_0x1ad28d,_0x3cb99f,_0x163328,_0x74db05,_0x52e98a){const _0x23c6e7=a140_0x2ff839,_0x1bc259=extractRootFolderId(_0x3cb99f),{pathToId:_0x3674b6,idToPath:_0x666c58}=buildFolderMaps(_0x74db05),_0x155e6a=buildSegmentNameToIdMap(_0x163328),_0x387b06=new Map(),{batchAsync:_0x58903a}=await import(_0x23c6e7(0x25b)),[_0xf80bb6,_0x4ae0c5]=await Promise[_0x23c6e7(0x217)]([_0x521bfd[_0x23c6e7(0x2cd)]['buildUserMaps'](),_0x521bfd[_0x23c6e7(0x27b)][_0x23c6e7(0x269)](),((async()=>{const _0x5f5206=_0x23c6e7;!_0x52e98a&&_0x163328[_0x5f5206(0x2cc)]>0x0&&await _0x58903a(_0x163328,async _0x43bf8b=>{const _0x46e518=_0x5f5206,_0xd25559=await _0x521bfd[_0x46e518(0x1f7)][_0x46e518(0x21d)](_0x1ad28d,_0x43bf8b['id']);_0x387b06[_0x46e518(0x282)](_0x43bf8b['id'],_0xd25559);});})())]),{emailToId:_0x36e966,idToEmail:_0x15cbac}=_0xf80bb6,_0x5193a5=buildConnectionMaps(_0x4ae0c5);return{'rootFolderId':_0x1bc259,'folderPathToId':_0x3674b6,'folderIdToPath':_0x666c58,'segmentNameToId':_0x155e6a,'activationsBySegmentId':_0x387b06,'emailToIdMap':_0x36e966,'idToEmailMap':_0x15cbac,'connectionNameToIdMap':_0x5193a5[_0x23c6e7(0x270)],'connectionIdToNameMap':_0x5193a5[_0x23c6e7(0x2c6)],'connectionNameToTypeMap':_0x5193a5[_0x23c6e7(0x291)]};}export function createPushYamlContextForBundle(_0x2a5ff2,_0x2c7eaa,_0x46f7d0,_0x36f28a,_0x104d74,_0x23b6b0,_0x24b47a,_0x5a4bbe){const {existingLocalSegmentNames:_0x40dc,localExpandedRuleToNames:_0x39afe6}=_0x36f28a,_0x4c47bf=new Set(),_0x3e07b0=new Map(),_0x4c61ec=new Map(),_0x40f9fe=new Map(),_0x22d9ed=createJumpTargetCache(),_0x4afc48=new Map(),_0x44222e=new Map(),_0x1ccaf8=new Set();let _0x31bf86;const _0x30c635=_0x3ba5ef=>{const _0x2fa6af={'resolveSegment':async _0x142437=>{const _0x2f38c7=a140_0x18bd,_0x3b5e48=_0x40f9fe[_0x2f38c7(0x2c3)](_0x142437);if(_0x3b5e48!==undefined)return{'name':_0x3b5e48,'isJourneyLocal':!![]};try{const _0x39583c=await fetchSegment(_0x2a5ff2,_0x2c7eaa,_0x142437,_0x46f7d0);if(!_0x39583c)throw new Error(_0x2f38c7(0x298));const _0x597075=generateJourneyLocalName(_0x39583c[_0x2f38c7(0x258)]),_0x4f645f=_0x39583c[_0x2f38c7(0x28a)]===SEGMENT_KIND_JOURNEY&&_0x597075!==undefined;let _0x217283=_0x39583c[_0x2f38c7(0x258)],_0x5b3609;if(_0x4f645f&&_0x39583c[_0x2f38c7(0x268)]){const _0x1262e2=apiRuleToYaml(_0x39583c['rule']);_0x44222e[_0x2f38c7(0x282)](_0x142437,_0x1262e2);const _0x13c9da=async _0x206ce5=>{const _0x38038d=_0x2f38c7,_0x1717c7=collectSegmentRefsFromRule(_0x206ce5);for(const _0x438571 of _0x1717c7){if(!_0x44222e[_0x38038d(0x200)](_0x438571))try{const _0x5cf46b=await fetchSegment(_0x2a5ff2,_0x2c7eaa,_0x438571,_0x46f7d0);if(_0x5cf46b?.[_0x38038d(0x268)]){const _0xdeab5e=apiRuleToYaml(_0x5cf46b[_0x38038d(0x268)]);_0x44222e[_0x38038d(0x282)](_0x438571,_0xdeab5e),await _0x13c9da(_0xdeab5e);}}catch(_0x48c083){logger[_0x38038d(0x262)]('Failed\x20to\x20fetch\x20referenced\x20segment\x20'+_0x438571+':\x20'+_0x48c083);}}};await _0x13c9da(_0x1262e2);const _0x339b3f=serializeExpandedRule(_0x1262e2,_0x44222e),_0x56b928=_0x39afe6[_0x2f38c7(0x2c3)](_0x339b3f);if(_0x56b928&&_0x56b928[_0x2f38c7(0x2cc)]>0x0){const _0x3c5f6f=_0x3e07b0[_0x2f38c7(0x2c3)](_0x339b3f)||0x0,_0x4459cf=_0x56b928[_0x3c5f6f]||_0x56b928[_0x56b928[_0x2f38c7(0x2cc)]-0x1];_0x3e07b0[_0x2f38c7(0x282)](_0x339b3f,_0x3c5f6f+0x1),_0x217283=_0x4459cf,_0x4c47bf[_0x2f38c7(0x237)](_0x217283),_0x40f9fe[_0x2f38c7(0x282)](_0x142437,_0x217283);const _0x5499a8=await resolveRuleSegmentRefs(_0x1262e2,async _0xb223af=>{const _0x2650bf=_0x2f38c7,_0x5c26e4=_0x40f9fe['get'](_0xb223af);if(_0x5c26e4)return _0x5c26e4;const _0x3f80fc=await _0x31bf86[_0x2650bf(0x241)](_0xb223af);return _0x3f80fc[_0x2650bf(0x258)];});_0x5b3609={'description':_0x39583c['description'],'rule':_0x5499a8};}else{const _0x294204=_0x4afc48[_0x2f38c7(0x2c3)](_0x339b3f);if(_0x294204)_0x217283=_0x294204,_0x40f9fe[_0x2f38c7(0x282)](_0x142437,_0x217283);else{if(_0x597075){let _0x3e0191=_0x597075,_0x187bbd=0x2;while(_0x4c47bf[_0x2f38c7(0x200)](_0x3e0191)||_0x40dc['has'](_0x3e0191)){_0x3e0191=_0x597075+'_'+_0x187bbd,_0x187bbd++;}_0x4c47bf[_0x2f38c7(0x237)](_0x3e0191),_0x217283=_0x3e0191;}_0x40f9fe[_0x2f38c7(0x282)](_0x142437,_0x217283),_0x4afc48[_0x2f38c7(0x282)](_0x339b3f,_0x217283);const _0x3f032d=await resolveRuleSegmentRefs(_0x1262e2,async _0x19429f=>{const _0x3be116=_0x2f38c7,_0x535f40=_0x40f9fe[_0x3be116(0x2c3)](_0x19429f);if(_0x535f40)return _0x535f40;const _0x2d1fe5=await _0x31bf86[_0x3be116(0x241)](_0x19429f);return _0x2d1fe5[_0x3be116(0x258)];});_0x5b3609={'description':_0x39583c[_0x2f38c7(0x26d)],'rule':_0x3f032d};}}}return{'name':_0x217283,'isJourneyLocal':_0x4f645f,'definition':_0x5b3609};}catch(_0x29c800){return logger[_0x2f38c7(0x262)](_0x2f38c7(0x250)+_0x142437+':\x20'+_0x29c800),{'name':_0x142437,'isJourneyLocal':![]};}},'resolveActivation':async _0x582fdc=>{const _0x26d3df=a140_0x18bd,_0x4c7c77=_0x4c61ec[_0x26d3df(0x2c3)](_0x582fdc);if(_0x4c7c77!==undefined)return{'name':_0x4c7c77,'isJourneyLocal':!![]};try{let _0xb6a34a=_0x24b47a?.[_0x26d3df(0x2c3)](_0x582fdc);!_0xb6a34a&&(_0xb6a34a=await _0x2a5ff2[_0x26d3df(0x209)]['getActivation'](_0x3ba5ef,_0x582fdc));const _0x427434=_0xb6a34a[_0x26d3df(0x27c)]['activationParams']['name']||_0x582fdc,_0x5c32a6=sanitizeYamlKey(_0x427434)||'activation_'+_0x582fdc,_0x3ec0ea=_0x5c32a6;_0x4c61ec[_0x26d3df(0x282)](_0x582fdc,_0x3ec0ea);const _0x5c15c5=journeyActivationStepToYaml(_0xb6a34a,_0x104d74,_0x23b6b0);return{'name':_0x3ec0ea,'isJourneyLocal':!![],'definition':_0x5c15c5};}catch(_0x4e6e9c){return logger[_0x26d3df(0x262)](_0x26d3df(0x284)+_0x582fdc+':\x20'+_0x4e6e9c),{'name':_0x582fdc,'isJourneyLocal':![]};}},'resolveJumpTarget':(_0x59b875,_0x47fd6b)=>resolveJumpTarget(_0x59b875,_0x47fd6b,_0x22d9ed,async _0x515917=>{const _0x49890e=a140_0x18bd,_0x2d50e1=_0x5a4bbe?.[_0x49890e(0x2c3)](_0x515917);if(_0x2d50e1)return _0x2d50e1;return _0x2a5ff2[_0x49890e(0x209)]['getJourney'](_0x515917);})};return _0x31bf86=_0x2fa6af,_0x2fa6af;},_0x13b5db=async _0x4390bb=>{const _0x41322d=a140_0x18bd,{collectSegmentIdsFromJourneyApi:_0x478650}=await import(_0x41322d(0x2be)),{batchAsync:_0x14345a}=await import(_0x41322d(0x25b)),_0x2dba67=new Set();for(const _0x393e12 of _0x4390bb){let _0x2964d1=_0x5a4bbe?.['get'](_0x393e12);!_0x2964d1&&(_0x2964d1=await _0x2a5ff2[_0x41322d(0x209)]['getJourney'](_0x393e12));const _0x15be49=_0x478650(_0x2964d1);for(const _0x16af6d of _0x15be49){_0x2dba67['add'](_0x16af6d);}}let _0x22b808=Array[_0x41322d(0x2a7)](_0x2dba67);while(_0x22b808['length']>0x0){const _0x32662a=_0x22b808[_0x41322d(0x2ec)](_0xa12aea=>!_0x1ccaf8[_0x41322d(0x200)](_0xa12aea));if(_0x32662a[_0x41322d(0x2cc)]===0x0)break;const _0x280fd3=await _0x14345a(_0x32662a,async _0x3b1c88=>{const _0x118e4d=_0x41322d;_0x1ccaf8[_0x118e4d(0x237)](_0x3b1c88);const _0x4a722f=await fetchSegment(_0x2a5ff2,_0x2c7eaa,_0x3b1c88,_0x46f7d0);if(!_0x4a722f)return null;return{'segmentId':_0x3b1c88,'segment':_0x4a722f};},0xa),_0x414236=new Set();for(const _0x439eb9 of _0x280fd3){if(!_0x439eb9?.['segment']?.[_0x41322d(0x268)])continue;const _0x5bc709=apiRuleToYaml(_0x439eb9['segment'][_0x41322d(0x268)]);_0x44222e['set'](_0x439eb9[_0x41322d(0x2a2)],_0x5bc709);const _0x3e6989=collectSegmentRefsFromRule(_0x5bc709);for(const _0x277dc9 of _0x3e6989){!_0x1ccaf8[_0x41322d(0x200)](_0x277dc9)&&_0x414236[_0x41322d(0x237)](_0x277dc9);}}_0x22b808=Array[_0x41322d(0x2a7)](_0x414236);}};return{'createYamlContext':_0x30c635,'prefetchJourneySegments':_0x13b5db};}export async function executePushSegments(_0x1302c5,_0x3f4c76,_0x482a1b,_0x11ba15,_0x248117){const _0x443431=a140_0x2ff839,{segmentDefToCreateRequest:_0x5d23ac,segmentDefToUpdateRequest:_0x26cbdb}=await import(_0x443431(0x2b4)),_0x4aa145=_0x482a1b['folderPathToId'],_0x29ccba=0x5,_0x5e76b7=async _0x2c31fd=>{const _0x1c57a4=_0x443431,_0x1b0a72=_0x2c31fd['folderPath']?_0x4aa145['get'](_0x2c31fd[_0x1c57a4(0x22a)]):undefined;let _0x4613a5;const _0x4d49f3={'created':0x0,'updated':0x0,'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};let _0x3472b3=_0x2c31fd[_0x1c57a4(0x2a6)];if(_0x2c31fd['yamlConfig'][_0x1c57a4(0x268)]){const _0x5f1c65=createSegmentIdResolver(_0x482a1b[_0x1c57a4(0x2c0)],_0x2c31fd[_0x1c57a4(0x2a6)][_0x1c57a4(0x258)]),_0x34c809=await resolveRuleSegmentIds(_0x2c31fd[_0x1c57a4(0x2a6)]['rule'],_0x5f1c65);_0x3472b3={..._0x2c31fd['yamlConfig'],'rule':_0x34c809};}try{if(_0x2c31fd[_0x1c57a4(0x264)]){_0x248117['onProgress']?.({'type':_0x1c57a4(0x211),'name':_0x2c31fd[_0x1c57a4(0x2a6)]['name']});const _0x4cb535=_0x5d23ac(_0x3472b3,_0x1b0a72),_0x31cd21=await _0x248117[_0x1c57a4(0x240)](_0x1c57a4(0x2a3)+_0x2c31fd[_0x1c57a4(0x2a6)][_0x1c57a4(0x258)]+'\x27...',()=>_0x1302c5[_0x1c57a4(0x1f7)]['createSegment'](_0x11ba15['parentId'],_0x4cb535));_0x4613a5=_0x31cd21['data']['id'],_0x482a1b[_0x1c57a4(0x2c0)][_0x1c57a4(0x282)](_0x2c31fd['yamlConfig'][_0x1c57a4(0x258)],_0x4613a5),_0x4d49f3[_0x1c57a4(0x274)]={'name':_0x2c31fd['yamlConfig'][_0x1c57a4(0x258)],'id':_0x4613a5},_0x248117['onProgress']?.({'type':_0x1c57a4(0x2b7),'name':_0x2c31fd[_0x1c57a4(0x2a6)][_0x1c57a4(0x258)],'segmentId':_0x4613a5}),_0x248117['logSuccess']?.('Created\x20segment\x20\x27'+_0x2c31fd[_0x1c57a4(0x2a6)]['name']+'\x27'),_0x4d49f3['created']=0x1;}else{if(_0x2c31fd['hasChanges']){_0x248117[_0x1c57a4(0x2e4)]?.({'type':_0x1c57a4(0x203),'name':_0x2c31fd[_0x1c57a4(0x2a6)][_0x1c57a4(0x258)]});const _0x467b4f=_0x26cbdb(_0x3472b3);_0x1b0a72!==_0x2c31fd['existingSegment']?.[_0x1c57a4(0x299)]&&(_0x467b4f[_0x1c57a4(0x299)]=_0x1b0a72?parseInt(_0x1b0a72,0xa):undefined),await _0x248117[_0x1c57a4(0x240)](_0x1c57a4(0x222)+_0x2c31fd[_0x1c57a4(0x2a6)][_0x1c57a4(0x258)]+_0x1c57a4(0x2b8),()=>_0x1302c5[_0x1c57a4(0x1f7)][_0x1c57a4(0x255)](_0x11ba15['parentId'],_0x2c31fd['existingSegment']['id'],_0x467b4f)),_0x4613a5=_0x2c31fd[_0x1c57a4(0x226)]['id'],_0x248117['onProgress']?.({'type':_0x1c57a4(0x239),'name':_0x2c31fd[_0x1c57a4(0x2a6)][_0x1c57a4(0x258)]}),_0x248117[_0x1c57a4(0x242)]?.(_0x1c57a4(0x281)+_0x2c31fd[_0x1c57a4(0x2a6)][_0x1c57a4(0x258)]+'\x27'),_0x4d49f3['updated']=0x1;}else _0x4613a5=_0x2c31fd[_0x1c57a4(0x226)]['id'];}}catch(_0x2f2fad){const _0x38e53c=isHttp400Error(_0x2f2fad),_0x49f018=_0x38e53c?ErrorCode[_0x1c57a4(0x273)]:ErrorCode[_0x1c57a4(0x287)],_0x28b3fc=getErrorMessage(_0x2f2fad);throw new SDKError(_0x49f018,'Failed\x20to\x20'+(_0x2c31fd[_0x1c57a4(0x264)]?_0x1c57a4(0x27f):_0x1c57a4(0x210))+_0x1c57a4(0x2e9)+_0x2c31fd['absolutePath']+_0x1c57a4(0x22f)+_0x28b3fc,_0x2f2fad);}try{const _0x3e3e82=await syncActivationsForSegment(_0x1302c5,_0x11ba15[_0x1c57a4(0x22c)],_0x4613a5,_0x2c31fd[_0x1c57a4(0x2a6)][_0x1c57a4(0x258)],_0x2c31fd[_0x1c57a4(0x26f)],_0x248117,_0x2c31fd[_0x1c57a4(0x2d1)]);_0x4d49f3['activations']=_0x3e3e82;}catch(_0x18ac1b){if(_0x18ac1b instanceof SDKError)throw _0x18ac1b;throw new SDKError(ErrorCode['ACTIVATION_UPDATE_ERROR'],'Failed\x20to\x20sync\x20activations\x20for\x20segment\x20\x27'+_0x2c31fd[_0x1c57a4(0x2a6)]['name']+_0x1c57a4(0x29f)+_0x2c31fd['absolutePath']+_0x1c57a4(0x22f)+getErrorMessage(_0x18ac1b),_0x18ac1b);}return _0x4d49f3;},_0x1ec328=await batchAsync(_0x3f4c76,_0x5e76b7,_0x29ccba),_0x388165={'created':0x0,'updated':0x0,'deleted':0x0,'createdSegmentIds':new Map(),'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};for(const _0x259ad7 of _0x1ec328){_0x388165[_0x443431(0x2cb)]+=_0x259ad7[_0x443431(0x2cb)],_0x388165[_0x443431(0x25c)]+=_0x259ad7[_0x443431(0x25c)],_0x259ad7[_0x443431(0x274)]&&_0x388165[_0x443431(0x23d)][_0x443431(0x282)](_0x259ad7[_0x443431(0x274)][_0x443431(0x258)],_0x259ad7[_0x443431(0x274)]['id']),_0x388165[_0x443431(0x265)]['created']+=_0x259ad7[_0x443431(0x265)]['created'],_0x388165[_0x443431(0x265)]['updated']+=_0x259ad7[_0x443431(0x265)][_0x443431(0x25c)],_0x388165[_0x443431(0x265)]['deleted']+=_0x259ad7[_0x443431(0x265)][_0x443431(0x2d5)];}return _0x388165;}async function syncActivationsForSegment(_0x1e88b0,_0x16532b,_0x225b6a,_0x3a2f38,_0x7819ac,_0x2de87d,_0x590352){const _0x239aca=a140_0x2ff839,_0x4baf77={'created':0x0,'updated':0x0,'deleted':0x0};for(const _0x37530c of _0x7819ac){try{if(_0x37530c['type']===_0x239aca(0x27f)&&_0x37530c[_0x239aca(0x232)])_0x2de87d[_0x239aca(0x2e4)]?.({'type':_0x239aca(0x2d6),'segmentName':_0x3a2f38,'activationName':_0x37530c['name']}),await _0x2de87d[_0x239aca(0x240)]('Creating\x20activation\x20\x27'+_0x37530c['name']+_0x239aca(0x2b8),()=>_0x1e88b0['segment']['createActivation'](_0x16532b,_0x225b6a,_0x37530c['validatedRequest'])),_0x2de87d[_0x239aca(0x2e4)]?.({'type':'activation_created','segmentName':_0x3a2f38,'activationName':_0x37530c[_0x239aca(0x258)]}),_0x2de87d['logSuccess']?.('Created\x20activation\x20\x27'+_0x37530c[_0x239aca(0x258)]+'\x27'),_0x4baf77[_0x239aca(0x2cb)]++;else{if(_0x37530c[_0x239aca(0x2b5)]===_0x239aca(0x210)&&_0x37530c['validatedRequest']&&_0x37530c['existingActivation'])_0x2de87d[_0x239aca(0x2e4)]?.({'type':_0x239aca(0x293),'segmentName':_0x3a2f38,'activationName':_0x37530c[_0x239aca(0x258)]}),await _0x2de87d[_0x239aca(0x240)](_0x239aca(0x2a1)+_0x37530c[_0x239aca(0x258)]+_0x239aca(0x2b8),()=>_0x1e88b0['segment'][_0x239aca(0x1f2)](_0x16532b,_0x225b6a,_0x37530c[_0x239aca(0x21e)]['id'],_0x37530c['validatedRequest'])),_0x2de87d[_0x239aca(0x2e4)]?.({'type':_0x239aca(0x2e7),'segmentName':_0x3a2f38,'activationName':_0x37530c['name']}),_0x2de87d[_0x239aca(0x242)]?.('Updated\x20activation\x20\x27'+_0x37530c[_0x239aca(0x258)]+'\x27'),_0x4baf77['updated']++;else _0x37530c[_0x239aca(0x2b5)]===_0x239aca(0x2d9)&&_0x37530c['existingActivation']&&(_0x2de87d[_0x239aca(0x2e4)]?.({'type':_0x239aca(0x2e6),'segmentName':_0x3a2f38,'activationName':_0x37530c[_0x239aca(0x258)]}),await _0x2de87d[_0x239aca(0x240)](_0x239aca(0x297)+_0x37530c[_0x239aca(0x258)]+_0x239aca(0x2b8),()=>_0x1e88b0[_0x239aca(0x1f7)][_0x239aca(0x2a9)](_0x16532b,_0x225b6a,_0x37530c[_0x239aca(0x21e)]['id'])),_0x2de87d[_0x239aca(0x2e4)]?.({'type':'activation_deleted','segmentName':_0x3a2f38,'activationName':_0x37530c[_0x239aca(0x258)]}),_0x2de87d[_0x239aca(0x206)]?.('Deleted\x20activation\x20\x27'+_0x37530c['name']+'\x27'),_0x4baf77[_0x239aca(0x2d5)]++);}}catch(_0x51d6f3){const _0x3fac8a=isHttp400Error(_0x51d6f3),_0x406b09=_0x3fac8a?ErrorCode[_0x239aca(0x285)]:ErrorCode['ACTIVATION_UPDATE_ERROR'],_0x3c6c4e=getErrorMessage(_0x51d6f3);throw new SDKError(_0x406b09,_0x239aca(0x24b)+_0x37530c['type']+_0x239aca(0x272)+_0x37530c[_0x239aca(0x258)]+'\x27\x20from\x20file:\x20'+_0x590352+_0x239aca(0x22f)+_0x3c6c4e,_0x51d6f3);}}return _0x4baf77;}export async function executePushFolders(_0x1b1e2d,_0x581fbb,_0x36ffb5,_0x3eceda,_0x21a36d){const _0x1ca801=a140_0x2ff839,_0x6c94f3=new Map(_0x36ffb5),_0x2c70ab=sortFoldersByDepth(_0x581fbb);for(const _0x3edf9f of _0x2c70ab){const _0x28aad1=_0x3edf9f[_0x1ca801(0x202)]('/'),_0x560b48=_0x28aad1[_0x28aad1[_0x1ca801(0x2cc)]-0x1],_0xaca571=_0x28aad1['slice'](0x0,-0x1)[_0x1ca801(0x2f0)]('/'),_0x453b26=_0x6c94f3[_0x1ca801(0x2c3)](_0xaca571);_0x21a36d[_0x1ca801(0x2e4)]?.({'type':_0x1ca801(0x25d),'folder':_0x3edf9f});const _0x1bf754={'name':_0x560b48,'parentFolderId':_0x453b26},_0x33a1e4=await _0x21a36d[_0x1ca801(0x240)](_0x1ca801(0x29e)+_0x3edf9f+_0x1ca801(0x2b8),()=>_0x1b1e2d[_0x1ca801(0x1f7)][_0x1ca801(0x2bc)](_0x3eceda[_0x1ca801(0x22c)],_0x1bf754));_0x6c94f3[_0x1ca801(0x282)](_0x3edf9f,_0x33a1e4[_0x1ca801(0x2b0)]['id']),_0x21a36d[_0x1ca801(0x2e4)]?.({'type':_0x1ca801(0x212),'folder':_0x3edf9f,'folderId':_0x33a1e4[_0x1ca801(0x2b0)]['id']}),_0x21a36d['logInfo']?.('Created\x20folder\x20\x27'+_0x3edf9f+'\x27');}return _0x6c94f3;}export async function executePushSegmentDeletions(_0xb1539b,_0x4805c5,_0x5b4d41){const _0x117d84=a140_0x2ff839;if(_0x4805c5[_0x117d84(0x2cc)]===0x0)return 0x0;const {batchAsync:_0x35f445}=await import('../../utils/async.js'),_0xe44d5f=0x5,_0x31db1d=await _0x35f445(_0x4805c5,async _0x543587=>{const _0x5c501b=_0x117d84;return _0x5b4d41[_0x5c501b(0x2e4)]?.({'type':_0x5c501b(0x2c8),'name':_0x543587['name']}),await _0xb1539b[_0x5c501b(0x1f7)][_0x5c501b(0x2e0)](_0x543587['id']),_0x5b4d41[_0x5c501b(0x2e4)]?.({'type':_0x5c501b(0x1ff),'name':_0x543587['name']}),_0x5b4d41['logDeleted']?.('Deleted\x20segment\x20\x27'+_0x543587[_0x5c501b(0x258)]+'\x27'),0x1;},_0xe44d5f);return _0x31db1d[_0x117d84(0x2d8)]((_0x4dff44,_0x422255)=>_0x4dff44+_0x422255,0x0);}export async function executePushJourneys(_0x3f7d28,_0x524855,_0x442b11,_0x10632d,_0x29e3f0){const _0x2a9ca7=a140_0x2ff839,{journeyDefToRequest:_0x345c25}=await import(_0x2a9ca7(0x2be)),{activationDefToCreateRequest:_0x4ef1ab,yamlRuleToApi:_0x2b5831,validateSegmentRule:_0x3b53c2}=await import('./child-segment-yaml.js'),_0x522054={'results':[],'created':0x0,'updated':0x0,'embeddedSegmentNameToId':new Map()},_0x1b7381=new Map(_0x442b11[_0x2a9ca7(0x2c0)]),_0x142b04=0x5;for(let _0x19718d=0x0;_0x19718d<_0x524855[_0x2a9ca7(0x2cc)];_0x19718d+=_0x142b04){const _0x22085c=_0x524855[_0x2a9ca7(0x2d4)](_0x19718d,_0x19718d+_0x142b04),_0x3fb66f=await Promise['all'](_0x22085c[_0x2a9ca7(0x295)](async _0x3530dd=>{const _0x57f808=_0x2a9ca7;if(!_0x3530dd['isNew']&&!_0x3530dd['hasChanges'])return{'action':'unchanged','name':_0x3530dd[_0x57f808(0x2a6)][_0x57f808(0x258)],'journeyId':_0x3530dd[_0x57f808(0x2ad)]?.['id']};const _0x5348fa=_0x3530dd['folderPath']?_0x442b11[_0x57f808(0x2ed)][_0x57f808(0x2c3)](_0x3530dd['folderPath']):undefined;_0x29e3f0[_0x57f808(0x2e4)]?.({'type':_0x3530dd[_0x57f808(0x264)]?'journey_creating':'journey_updating','name':_0x3530dd[_0x57f808(0x2a6)][_0x57f808(0x258)]});try{const _0x5dfb46=await executeSingleJourneyPush(_0x3f7d28,_0x3530dd,{..._0x442b11,'segmentNameToId':_0x1b7381},{'parentId':_0x10632d[_0x57f808(0x22c)],'rootFolderId':_0x10632d[_0x57f808(0x2a0)],'folderId':_0x5348fa,'verbose':_0x10632d['verbose']},_0x29e3f0,{'journeyDefToRequest':_0x345c25,'activationDefToCreateRequest':_0x4ef1ab,'yamlRuleToApi':_0x2b5831,'validateSegmentRule':_0x3b53c2});for(const [_0x7294e8,_0x404867]of _0x5dfb46[_0x57f808(0x1f9)]){_0x1b7381[_0x57f808(0x282)](_0x7294e8,_0x404867),_0x522054[_0x57f808(0x1f9)][_0x57f808(0x282)](_0x7294e8,_0x404867);}if(_0x5dfb46[_0x57f808(0x21c)]==='created')_0x29e3f0['onProgress']?.({'type':_0x57f808(0x21a),'name':_0x3530dd['yamlConfig']['name'],'journeyId':_0x5dfb46[_0x57f808(0x294)]}),_0x29e3f0[_0x57f808(0x242)]?.(_0x57f808(0x292)+_0x3530dd['yamlConfig']['name']+'\x27'),_0x522054[_0x57f808(0x2cb)]++;else _0x5dfb46[_0x57f808(0x21c)]==='updated'&&(_0x29e3f0[_0x57f808(0x2e4)]?.({'type':'journey_updated','name':_0x3530dd[_0x57f808(0x2a6)]['name']}),_0x29e3f0[_0x57f808(0x242)]?.(_0x57f808(0x2c4)+_0x3530dd['yamlConfig'][_0x57f808(0x258)]+'\x27'),_0x522054[_0x57f808(0x25c)]++);return{'action':_0x5dfb46['action'],'name':_0x3530dd['yamlConfig'][_0x57f808(0x258)],'journeyId':_0x5dfb46[_0x57f808(0x294)]};}catch(_0x3d9044){const _0x502e32=isHttp400Error(_0x3d9044),_0x4102d7=_0x502e32?ErrorCode['JOURNEY_SYNTAX_ERROR']:ErrorCode['JOURNEY_UPDATE_ERROR'],_0x5246ec=getErrorMessage(_0x3d9044);throw new SDKError(_0x4102d7,_0x57f808(0x24b)+(_0x3530dd[_0x57f808(0x264)]?'create':_0x57f808(0x210))+_0x57f808(0x238)+_0x3530dd[_0x57f808(0x2d1)]+_0x57f808(0x22f)+_0x5246ec,_0x3d9044);}}));_0x522054[_0x2a9ca7(0x214)]['push'](..._0x3fb66f);}return _0x522054;}async function matchExistingJourneySegments(_0x1a606f,_0x2fa3b9,_0xf79aeb,_0x93cce7,_0xea03d6){const _0x4c2fd1=a140_0x2ff839;if(!_0x2fa3b9[_0x4c2fd1(0x2ad)]||!_0x2fa3b9[_0x4c2fd1(0x2a6)]['segments'])return;const _0x56d941=new Map(),_0x7550ff=new Set();for(const _0x4ea7c7 of Object[_0x4c2fd1(0x20a)](_0x2fa3b9[_0x4c2fd1(0x2a6)][_0x4c2fd1(0x2e1)])){const _0x3c7ab4=generateDeterministicJourneySegmentName(_0x2fa3b9[_0x4c2fd1(0x2a6)][_0x4c2fd1(0x258)],_0x4ea7c7);_0x56d941[_0x4c2fd1(0x282)](_0x3c7ab4,_0x4ea7c7),_0x7550ff[_0x4c2fd1(0x237)](_0x4ea7c7);}const _0x8c3d0f=[],_0x5818b6=collectSegmentIdsFromJourneyApi(_0x2fa3b9['existingJourney']);for(const _0x5ba9d5 of _0x5818b6){const _0x32861f=await fetchSegment(_0x1a606f,_0xf79aeb,_0x5ba9d5,_0x93cce7);if(!_0x32861f?.[_0x4c2fd1(0x258)])continue;const _0x2f9a60=_0x56d941['get'](_0x32861f[_0x4c2fd1(0x258)]);_0x2f9a60?(_0xea03d6[_0x4c2fd1(0x282)](_0x2f9a60,_0x5ba9d5),_0x7550ff[_0x4c2fd1(0x2d9)](_0x2f9a60)):_0x8c3d0f['push']({'id':_0x5ba9d5,'seg':_0x32861f});}if(_0x7550ff['size']>0x0&&_0x8c3d0f[_0x4c2fd1(0x2cc)]>0x0){const {localExpandedRuleToNames:_0xdf3eac}=buildLocalExpandedRuleMappings(_0x2fa3b9['yamlConfig']),_0x74cb57=new Map();for(const {id:_0x499495,seg:_0x49eb9c}of _0x8c3d0f){if(_0x49eb9c['rule']){const _0x1a119d=apiRuleToYaml(_0x49eb9c[_0x4c2fd1(0x268)]);_0x74cb57[_0x4c2fd1(0x282)](_0x499495,_0x1a119d);}}for(const {id:_0x25f5de,seg:_0x35d142}of _0x8c3d0f){if(!_0x35d142['rule'])continue;const _0x144eff=_0x74cb57['get'](_0x25f5de);if(!_0x144eff)continue;const _0x7dad37=serializeExpandedRule(_0x144eff,_0x74cb57),_0x20d2c8=_0xdf3eac[_0x4c2fd1(0x2c3)](_0x7dad37);if(_0x20d2c8){const _0x704afe=_0x20d2c8[_0x4c2fd1(0x219)](_0x36fea6=>_0x7550ff[_0x4c2fd1(0x200)](_0x36fea6));_0x704afe&&(_0xea03d6[_0x4c2fd1(0x282)](_0x704afe,_0x25f5de),_0x7550ff['delete'](_0x704afe),logger['debug']('Matched\x20server\x20segment\x20\x27'+_0x35d142[_0x4c2fd1(0x258)]+_0x4c2fd1(0x24e)+_0x704afe+_0x4c2fd1(0x223)));}}}}async function executeSingleJourneyPush(_0x29fb29,_0x187de8,_0x4eb0f6,_0x1170c1,_0x4017f9,_0x16842c){const _0x4b3285=a140_0x2ff839,{journeyDefToRequest:_0x4d1438,activationDefToCreateRequest:_0x4e69d1,yamlRuleToApi:_0x41aed4,validateSegmentRule:_0x5e7ddb}=_0x16842c,_0x2c0385=new Map(),_0x4067c5=new Map();recoverSegmentIdsFromPushRecovery(_0x187de8,_0x2c0385,_0x4eb0f6[_0x4b3285(0x2c0)]);const _0x1002bd=new Map(),_0x3ab5ec=new Map(),_0x153ea9=new Map();let _0x1ec9f5;const _0x55477a=async()=>{const _0x51ace8=_0x4b3285;if(_0x1ec9f5)return;_0x1ec9f5=new Map();if(!_0x187de8[_0x51ace8(0x2ad)])return;const _0x585cc0=await _0x29fb29[_0x51ace8(0x209)]['listActivations'](_0x187de8['existingJourney']['id']);for(const _0x45dd59 of _0x585cc0){const _0x4f86e4=journeyActivationStepToYaml(_0x45dd59,_0x4eb0f6[_0x51ace8(0x225)],_0x4eb0f6['connectionIdToNameMap']),_0x2cd70a=activationSignature(_0x4f86e4);!_0x1ec9f5['has'](_0x2cd70a)&&_0x1ec9f5[_0x51ace8(0x282)](_0x2cd70a,_0x45dd59['id']),_0x4f86e4['name']&&_0x4067c5[_0x51ace8(0x282)](_0x4f86e4[_0x51ace8(0x258)],_0x45dd59['id']);}};await matchExistingJourneySegments(_0x29fb29,_0x187de8,_0x1170c1[_0x4b3285(0x22c)],_0x4eb0f6[_0x4b3285(0x25a)],_0x4eb0f6[_0x4b3285(0x2c0)]);const _0x28b985={'resolveSegmentId':async _0x25ee48=>{const _0x4d61a5=_0x4b3285,_0x3b632b=_0x4eb0f6[_0x4d61a5(0x2c0)]['get'](_0x25ee48);if(!_0x3b632b)throw new SDKError(ErrorCode[_0x4d61a5(0x2a8)],'Segment\x20not\x20found:\x20'+_0x25ee48+_0x4d61a5(0x2cf)+_0x187de8[_0x4d61a5(0x2a6)][_0x4d61a5(0x258)]+')');return _0x3b632b;},'resolveEmbeddedSegmentId':async(_0x4ab4bb,_0x67e185)=>{const _0x2ce020=_0x4b3285,_0x54362e=_0x4eb0f6['segmentNameToId'][_0x2ce020(0x2c3)](_0x4ab4bb);if(_0x54362e)return _0x54362e;const _0x5e2242=_0x4eb0f6['existingSegments'][_0x2ce020(0x219)](_0x45f1c1=>_0x45f1c1[_0x2ce020(0x258)]===_0x4ab4bb);if(_0x5e2242)return _0x4eb0f6[_0x2ce020(0x2c0)][_0x2ce020(0x282)](_0x4ab4bb,_0x5e2242['id']),_0x5e2242['id'];if(_0x187de8[_0x2ce020(0x264)]){const {stageName:_0xc1295d,criteriaName:_0x1603b1}=findSegmentCriteriaLocation(_0x187de8[_0x2ce020(0x2a6)],_0x4ab4bb);return _0x5e7ddb(_0x4ab4bb,_0x67e185[_0x2ce020(0x268)]),_0x3ab5ec[_0x2ce020(0x282)](_0x4ab4bb,{'definition':_0x67e185,'stageName':_0xc1295d,'criteriaName':_0x1603b1}),createPendingSegmentId(_0x4ab4bb);}const _0x26a46c=_0x187de8[_0x2ce020(0x2ad)]?.['id'];if(!_0x26a46c)throw new SDKError(ErrorCode[_0x2ce020(0x1f6)],_0x2ce020(0x267));const _0x7eecc6=_0x1002bd[_0x2ce020(0x2c3)](_0x4ab4bb);if(_0x7eecc6)return _0x7eecc6;const _0x2fa200=((async()=>{const _0x49e1e4=_0x2ce020;_0x5e7ddb(_0x4ab4bb,_0x67e185[_0x49e1e4(0x268)]);const _0x8ddff8=generateDeterministicJourneySegmentName(_0x187de8['yamlConfig'][_0x49e1e4(0x258)],_0x4ab4bb),_0x8538d0=_0x4eb0f6[_0x49e1e4(0x25a)][_0x49e1e4(0x219)](_0x5850b0=>_0x5850b0[_0x49e1e4(0x258)]===_0x8ddff8),_0x2f4c19=createSegmentIdResolver(_0x4eb0f6['segmentNameToId'],_0x4ab4bb),_0x58a31d=await resolveRuleSegmentIds(_0x67e185[_0x49e1e4(0x268)],_0x2f4c19);let _0x35df54;return _0x8538d0?(await _0x29fb29[_0x49e1e4(0x1f7)][_0x49e1e4(0x255)](_0x1170c1[_0x49e1e4(0x22c)],_0x8538d0['id'],{'description':_0x67e185[_0x49e1e4(0x26d)]||_0x49e1e4(0x21b)+_0x4ab4bb,'rule':_0x41aed4(_0x58a31d,!![]),'countPopulation':!![]}),_0x35df54=_0x8538d0['id'],saveSegmentToPushRecovery(_0x187de8[_0x49e1e4(0x2d1)],_0x187de8[_0x49e1e4(0x2a6)][_0x49e1e4(0x258)],_0x4ab4bb,{'segmentId':_0x35df54,'uniqueServerName':_0x8ddff8,'createdAt':new Date()[_0x49e1e4(0x249)]()})):_0x35df54=await createOrRecoverEmbeddedSegment(_0x29fb29,_0x187de8,{'localName':_0x4ab4bb,'uniqueSegmentName':_0x8ddff8,'description':_0x67e185[_0x49e1e4(0x26d)]||'Entry\x20criteria:\x20'+_0x4ab4bb,'journeyId':_0x26a46c,'resolvedRule':_0x58a31d,'parentId':_0x1170c1[_0x49e1e4(0x22c)],'folderId':_0x1170c1[_0x49e1e4(0x2a0)]||''},_0x41aed4),_0x4eb0f6[_0x49e1e4(0x2c0)][_0x49e1e4(0x282)](_0x4ab4bb,_0x35df54),_0x2c0385['set'](_0x4ab4bb,_0x35df54),_0x35df54;})());_0x1002bd['set'](_0x4ab4bb,_0x2fa200);try{return await _0x2fa200;}finally{_0x1002bd['delete'](_0x4ab4bb);}},'resolveActivationId':async _0x4e0afd=>{const _0x1a6ca3=_0x4b3285,_0x57cd14=_0x4067c5[_0x1a6ca3(0x2c3)](_0x4e0afd);if(_0x57cd14)return _0x57cd14;if(_0x187de8[_0x1a6ca3(0x2ad)]){await _0x55477a();const _0x4f52f1=_0x4067c5[_0x1a6ca3(0x2c3)](_0x4e0afd);if(_0x4f52f1)return _0x4f52f1;}throw new SDKError(ErrorCode['NOT_FOUND'],_0x1a6ca3(0x28c)+_0x4e0afd+_0x1a6ca3(0x2cf)+_0x187de8[_0x1a6ca3(0x2a6)][_0x1a6ca3(0x258)]+_0x1a6ca3(0x228)+_0x1a6ca3(0x278));},'resolveEmbeddedActivationId':async(_0x49a1af,_0x46ad87)=>{const _0xf7aba6=_0x4b3285,_0x21ea07=_0x4067c5[_0xf7aba6(0x2c3)](_0x49a1af);if(_0x21ea07)return _0x21ea07;if(_0x187de8['isNew'])return _0x153ea9[_0xf7aba6(0x282)](_0x49a1af,_0x46ad87),createPendingActivationId(_0x49a1af);if(_0x187de8[_0xf7aba6(0x2ad)]){await _0x55477a();const _0x5955c4=_0x4067c5[_0xf7aba6(0x2c3)](_0x46ad87[_0xf7aba6(0x258)]);if(_0x5955c4)return _0x4067c5['set'](_0x49a1af,_0x5955c4),_0x5955c4;const _0x3246a8=activationSignature(_0x46ad87),_0x51b343=_0x1ec9f5?.[_0xf7aba6(0x2c3)](_0x3246a8);if(_0x51b343)return _0x4067c5[_0xf7aba6(0x282)](_0x49a1af,_0x51b343),_0x51b343;const _0x1fc6c0=await _0x4e69d1(_0x46ad87,_0x4eb0f6[_0xf7aba6(0x243)]),_0x18a572={..._0x1fc6c0,..._0x46ad87[_0xf7aba6(0x28d)]!==undefined&&{'runAfterJourneyRefresh':_0x46ad87[_0xf7aba6(0x28d)]}},_0x525357=await _0x29fb29[_0xf7aba6(0x209)][_0xf7aba6(0x2ae)](_0x187de8['existingJourney']['id'],_0x18a572);return _0x4067c5[_0xf7aba6(0x282)](_0x49a1af,_0x525357['id']),_0x525357['id'];}throw new SDKError(ErrorCode[_0xf7aba6(0x1f6)],_0xf7aba6(0x22b));},'resolveJourneyId':async _0x13598e=>{const _0x219525=_0x4b3285;try{return await _0x29fb29['journey'][_0x219525(0x24f)](_0x1170c1[_0x219525(0x22c)],_0x13598e);}catch(_0x207672){throw new SDKError(ErrorCode[_0x219525(0x286)],_0x219525(0x2dd)+_0x13598e+_0x219525(0x2c2)+_0x187de8[_0x219525(0x2a6)][_0x219525(0x258)]+'\x27)',_0x207672);}},'resolveStageId':async(_0x453c71,_0x35f00b)=>{const _0x3b6958=_0x4b3285,_0x5b2b95=await _0x29fb29[_0x3b6958(0x209)][_0x3b6958(0x2f1)](_0x453c71),_0x2a96e1=_0x5b2b95['attributes']['journeyStages'][_0x3b6958(0x219)](_0x56ac41=>_0x56ac41[_0x3b6958(0x258)][_0x3b6958(0x2a4)]()===_0x35f00b[_0x3b6958(0x2a4)]());if(!_0x2a96e1?.['id'])throw new SDKError(ErrorCode[_0x3b6958(0x286)],_0x3b6958(0x221)+_0x35f00b+'\x27\x20not\x20found\x20in\x20journey\x20\x27'+(_0x5b2b95['attributes']['journeyBundleName']||_0x5b2b95[_0x3b6958(0x27c)][_0x3b6958(0x258)])+'\x27');return _0x2a96e1['id'];}},_0x45a406=await _0x4d1438(_0x187de8['yamlConfig'],_0x1170c1[_0x4b3285(0x22c)],_0x28b985),_0x3abece=_0x1170c1['folderId']||_0x1170c1['rootFolderId'];_0x3abece&&(_0x45a406[_0x4b3285(0x25e)]={'parentFolder':{'data':{'id':_0x3abece,'type':_0x4b3285(0x215)}}});if(_0x187de8['isNew']){if(_0x3ab5ec['size']>0x0||_0x153ea9[_0x4b3285(0x24d)]>0x0)return await executeThreeStepJourneyCreate(_0x29fb29,_0x187de8,_0x45a406,{'pendingEmbeddedSegments':_0x3ab5ec,'pendingEmbeddedActivations':_0x153ea9,'embeddedSegmentNameToId':_0x2c0385,'journeyActivationNameToId':_0x4067c5},{..._0x1170c1,'effectiveFolderId':_0x3abece},_0x4eb0f6,_0x4017f9,_0x16842c);else{ensureJourneyDefaults(_0x45a406[_0x4b3285(0x27c)]);const _0x460c22=await _0x29fb29[_0x4b3285(0x209)]['create'](_0x45a406);return deletePushRecovery(_0x187de8[_0x4b3285(0x2d1)]),{'action':_0x4b3285(0x2cb),'journeyId':_0x460c22['id'],'embeddedSegmentNameToId':_0x2c0385};}}else{if(_0x187de8['hasChanges']&&_0x187de8['existingJourney']){_0x45a406['id']=_0x187de8[_0x4b3285(0x2ad)]['id'];const _0x18c1d0=_0x45a406['attributes'];_0x187de8[_0x4b3285(0x2ad)][_0x4b3285(0x27c)]?.[_0x4b3285(0x220)]&&(_0x18c1d0['journeyBundleName']=_0x187de8[_0x4b3285(0x2ad)][_0x4b3285(0x27c)]['journeyBundleName']);const _0x192ad1=_0x187de8[_0x4b3285(0x2ad)][_0x4b3285(0x27c)]?.[_0x4b3285(0x2b9)];return _0x192ad1&&_0x45a406['attributes'][_0x4b3285(0x2b9)]&&injectExistingStageIds(_0x45a406['attributes']['journeyStages'],_0x192ad1),ensureJourneyDefaults(_0x18c1d0),await _0x29fb29[_0x4b3285(0x209)][_0x4b3285(0x210)](_0x187de8[_0x4b3285(0x2ad)]['id'],_0x45a406),deletePushRecovery(_0x187de8[_0x4b3285(0x2d1)]),{'action':_0x4b3285(0x25c),'journeyId':_0x187de8[_0x4b3285(0x2ad)]['id'],'embeddedSegmentNameToId':_0x2c0385};}}return deletePushRecovery(_0x187de8[_0x4b3285(0x2d1)]),{'action':_0x4b3285(0x20c),'journeyId':_0x187de8[_0x4b3285(0x2ad)]?.['id'],'embeddedSegmentNameToId':_0x2c0385};}function findSegmentCriteriaLocation(_0x5a021b,_0x248668){const _0x5ca10b=a140_0x2ff839,_0x282097=_0x5a021b[_0x5ca10b(0x2df)]||_0x5a021b[_0x5ca10b(0x2c5)]?.[0x0]?.[_0x5ca10b(0x2df)]||[];let _0xf58cdd=_0x5ca10b(0x2da),_0x4ab14c=_0x248668;const _0x5eec03=_0x5a021b['goal']||_0x5a021b[_0x5ca10b(0x2c5)]?.[0x0]?.[_0x5ca10b(0x25f)];if(_0x5eec03?.[_0x5ca10b(0x1f7)]===_0x248668)return{'stageName':_0x5ca10b(0x25f),'criteriaName':_0x5eec03[_0x5ca10b(0x258)]||_0x248668};_0x5cb7eb:for(const _0x38af51 of _0x282097){if(_0x38af51[_0x5ca10b(0x218)]?.[_0x5ca10b(0x1f7)]===_0x248668){_0xf58cdd=_0x38af51[_0x5ca10b(0x258)],_0x4ab14c=_0x38af51[_0x5ca10b(0x218)][_0x5ca10b(0x258)]||_0x248668;break;}if(_0x38af51[_0x5ca10b(0x288)])for(const _0x3146f6 of _0x38af51[_0x5ca10b(0x288)]){if(_0x3146f6[_0x5ca10b(0x2b5)]===_0x5ca10b(0x28b)&&_0x3146f6[_0x5ca10b(0x1f0)]?.[_0x5ca10b(0x28e)])for(const _0x107f25 of _0x3146f6[_0x5ca10b(0x1f0)]['branches']){if(_0x107f25[_0x5ca10b(0x1f7)]===_0x248668){_0xf58cdd=_0x38af51[_0x5ca10b(0x258)],_0x4ab14c=_0x107f25[_0x5ca10b(0x258)]||_0x248668;break _0x5cb7eb;}}}}return{'stageName':_0xf58cdd,'criteriaName':_0x4ab14c};}function a140_0x33e7(){const _0x36b319=['Updating\x20segment\x20\x27','\x27\x20by\x20rule\x20content','getSegment\x20failed\x20for\x20','idToEmailMap','existingSegment','createJourneySegment',').\x20','progress','folderPath','Cannot\x20create\x20embedded\x20activation\x20without\x20journey\x20context','parentId','):\x20','__pending_act_','\x0a\x20\x20','\x27\x20wait\x20condition','activation_template_id','validatedRequest','replace','4072Buglcg','versionNumber','journeyBundleId','add','\x20journey\x20from\x20file:\x20','segment_updated','draft','goal\x20criteria','relative','createdSegmentIds','getLatestJourneyId','object','withProgress','resolveSegment','logSuccess','activationContext','connectionIdToNameMap','waitStep','fetchJourney','logWarning','journeyName','toISOString','toString','Failed\x20to\x20','hasChanges','size','\x27\x20to\x20local\x20\x27','resolveJourneyId','Failed\x20to\x20resolve\x20segment\x20','6412360RTYnPG','\x20(referenced\x20in\x20embedded\x20segment\x20\x27','1985641haiHaI','\x27\x20already\x20exists\x20on\x20server\x20but\x20cannot\x20be\x20found.\x20','updateSegmentById','trim','milestone','name','parentSegmentFolder','existingSegments','../../utils/async.js','updated','folder_creating','relationships','goal','item','journeyActivationNameToId','debug','Name\x20has\x20already\x20been\x20taken','isNew','activations','\x27\x20entry\x20criteria','Cannot\x20create\x20embedded\x20segment\x20for\x20existing\x20journey\x20without\x20journey\x20ID','rule','list','7772qhlLbl','embedded_segment_creating','hex','description','\x20error(s)','activationActions','nameToId','Segment\x20not\x20found:\x20','\x20activation\x20\x27','SEGMENT_SYNTAX_ERROR','createdSegmentId','38378hRSsEM','columns','all_columns','Define\x20it\x20in\x20the\x20journey\x27s\x20\x27activations\x27\x20section\x20or\x20use\x20an\x20existing\x20activation\x20ID.','effectiveFolderId','resolvedRule','connection','attributes','digest','startsWith','create','isArray','Updated\x20segment\x20\x27','set','waitStepUnit','Failed\x20to\x20resolve\x20activation\x20','ACTIVATION_SYNTAX_ERROR','NOT_FOUND','SEGMENT_UPDATE_ERROR','steps','schedule','kind','decision_point','Activation\x20not\x20found:\x20','run_after_journey_refresh','branches','Delete\x20the\x20push\x20recovery\x20file\x20(','localName','nameToType','Created\x20journey\x20\x27','activation_updating','journeyId','map','11FcwbWB','Deleting\x20activation\x20\x27','Segment\x20not\x20found','segmentFolderId','errors','diff','Duration','folderId','Creating\x20folder\x20\x27','\x27\x20from\x20file:\x20','rootFolderId','Updating\x20activation\x20\x27','segmentId','Creating\x20segment\x20\x27','toLowerCase','embedded_segment_created','yamlConfig','from','SEGMENT_NOT_FOUND','deleteActivation','\x27\x20exit\x20criteria','conditionSegmentId','journeyActivationStepId','existingJourney','createActivation','stringify','data','utf-8','conditions','index','./child-segment-yaml.js','type','1494cQTokl','segment_created','\x27...','journeyStages','1094673WXtPNl','skipSegments','createFolder','.$1.push-recovery.json','./journey-yaml.js','entryCriteria','segmentNameToId','message','\x27\x20not\x20found\x20in\x20parent\x20segment\x20(referenced\x20in\x20jump\x20step\x20of\x20\x27','get','Updated\x20journey\x20\x27','journeys','idToName','sort','segment_deleting','Fetching\x20','Activation','created','length','user','\x27\x20for\x20','\x20(referenced\x20in\x20journey\x20','flatMap','absolutePath','tdx.sdk.push-workflow','1313826kYCodX','slice','deleted','activation_creating','\x27\x20milestone','reduce','delete','entry','day','Condition','Journey\x20\x27','parseDocument','stages','deleteSegment','segments','parse','uniqueSegmentName','onProgress','waitStepType','activation_deleting','activation_updated','max','\x20segment\x20from\x20file:\x20','entries','exitCriterias','filter','folderPathToId','getSegmentEntity\x20also\x20failed\x20for\x20','journeyById','join','getJourney','__pending_','with','journeyBundlesByFolderAndName','updateActivation','state','some','conditionTimeoutUnit','INTERNAL','segment','WaitStep','embeddedSegmentNameToId','conditionTimeoutDuration','DecisionPoint','push','behavior','and\x20the\x20server\x20segment,\x20then\x20retry.','segment_deleted','has','parentFolder','split','segment_updating','segmentByFolderAndName','yamlActivation','logDeleted','\x27\x20decision\x20point\x20branch\x20\x27','1285JeHtjL','journey','keys','activationsBySegmentId','unchanged','getSegment','embedded_activation_created','stage\x20\x27','update','segment_creating','folder_created','values','results','folder','sha1','all','entry_criteria','find','journey_created','Entry\x20criteria:\x20','action','listActivations','existingActivation','uniqueServerName','journeyBundleName','Stage\x20\x27'];a140_0x33e7=function(){return _0x36b319;};return a140_0x33e7();}function a140_0x18bd(_0x35ca75,_0x3132a8){_0x35ca75=_0x35ca75-0x1ef;const _0x33e760=a140_0x33e7();let _0x18bddb=_0x33e760[_0x35ca75];return _0x18bddb;}async function executeThreeStepJourneyCreate(_0x476d4e,_0x1e54d8,_0x13e14b,_0x2d4daf,_0x58a490,_0x1fd86a,_0x5dc65f,_0x343295){const _0x55745e=a140_0x2ff839,{activationDefToCreateRequest:_0x348f51,yamlRuleToApi:_0x120705}=_0x343295,{pendingEmbeddedSegments:_0x120c59,pendingEmbeddedActivations:_0x2e4e2c,embeddedSegmentNameToId:_0x1a4403}=_0x2d4daf,_0x5b3d58=JSON[_0x55745e(0x2e2)](JSON[_0x55745e(0x2af)](_0x13e14b));ensureJourneyDefaults(_0x5b3d58[_0x55745e(0x27c)]),stripPendingIds(_0x5b3d58);const _0x11bf67=await _0x476d4e['journey']['create'](_0x5b3d58),_0x3a60b4=_0x11bf67['id'],_0x657a73=new Map();for(const _0x388300 of _0x11bf67[_0x55745e(0x27c)]['journeyStages']){_0x657a73[_0x55745e(0x282)](_0x388300[_0x55745e(0x258)]['toLowerCase'](),_0x388300['id']);}recoverSegmentIdsFromPushRecovery(_0x1e54d8,_0x1a4403,_0x1fd86a[_0x55745e(0x2c0)]);for(const [_0x44542d,{definition:_0x2255eb}]of _0x120c59){if(_0x1a4403[_0x55745e(0x200)](_0x44542d)){_0x5dc65f[_0x55745e(0x2e4)]?.({'type':_0x55745e(0x2a5),'journeyName':_0x1e54d8['yamlConfig'][_0x55745e(0x258)],'segmentName':_0x44542d});continue;}const _0x379b31=generateDeterministicJourneySegmentName(_0x1e54d8[_0x55745e(0x2a6)][_0x55745e(0x258)],_0x44542d);_0x5dc65f['onProgress']?.({'type':_0x55745e(0x26b),'journeyName':_0x1e54d8['yamlConfig'][_0x55745e(0x258)],'segmentName':_0x44542d});const _0x2da118=createSegmentIdResolver(_0x1fd86a['segmentNameToId'],_0x44542d),_0x4124cb=await resolveRuleSegmentIds(_0x2255eb['rule'],_0x2da118),_0x48453c=await createOrRecoverEmbeddedSegment(_0x476d4e,_0x1e54d8,{'localName':_0x44542d,'uniqueSegmentName':_0x379b31,'description':_0x2255eb[_0x55745e(0x26d)]||'Entry\x20criteria:\x20'+_0x44542d,'journeyId':_0x3a60b4,'resolvedRule':_0x4124cb,'parentId':_0x58a490[_0x55745e(0x22c)],'folderId':_0x58a490[_0x55745e(0x279)]||''},_0x120705);_0x1a4403[_0x55745e(0x282)](_0x44542d,_0x48453c),_0x1fd86a[_0x55745e(0x2c0)]['set'](_0x44542d,_0x48453c),_0x5dc65f['onProgress']?.({'type':_0x55745e(0x2a5),'journeyName':_0x1e54d8[_0x55745e(0x2a6)][_0x55745e(0x258)],'segmentName':_0x44542d});}const _0x246905=new Map();for(const [_0x4ddaad,_0x2f7629]of _0x2e4e2c){_0x5dc65f['onProgress']?.({'type':'embedded_activation_creating','journeyName':_0x1e54d8[_0x55745e(0x2a6)]['name'],'activationName':_0x4ddaad});const _0x35410a=await _0x348f51(_0x2f7629,_0x1fd86a['activationContext']),_0xf9ca08={..._0x35410a,..._0x2f7629[_0x55745e(0x28d)]!==undefined&&{'runAfterJourneyRefresh':_0x2f7629['run_after_journey_refresh']}},_0x305c77=await _0x476d4e[_0x55745e(0x209)][_0x55745e(0x2ae)](_0x3a60b4,_0xf9ca08);_0x246905[_0x55745e(0x282)](_0x4ddaad,_0x305c77['id']),_0x2d4daf[_0x55745e(0x261)]['set'](_0x4ddaad,_0x305c77['id']),_0x5dc65f['onProgress']?.({'type':_0x55745e(0x20e),'journeyName':_0x1e54d8[_0x55745e(0x2a6)][_0x55745e(0x258)],'activationName':_0x4ddaad});}const _0x5133ee=JSON['parse'](JSON[_0x55745e(0x2af)](_0x13e14b));return _0x5133ee['id']=_0x3a60b4,ensureJourneyDefaults(_0x5133ee['attributes']),resolvePendingIdsInRequest(_0x5133ee,_0x13e14b,_0x657a73,_0x1a4403,_0x246905,_0x5dc65f),await _0x476d4e['journey'][_0x55745e(0x210)](_0x3a60b4,_0x5133ee),deletePushRecovery(_0x1e54d8[_0x55745e(0x2d1)]),{'action':_0x55745e(0x2cb),'journeyId':_0x3a60b4,'embeddedSegmentNameToId':_0x1a4403};}export function stripWaitStepPendingIds(_0x11bdea){const _0x3ad9f7=a140_0x2ff839,_0x5aff03=_0x11bdea[_0x3ad9f7(0x2ab)]&&isPendingSegmentId(_0x11bdea[_0x3ad9f7(0x2ab)]),_0x306211=_0x11bdea[_0x3ad9f7(0x2b2)]?.['some'](_0x4db57b=>_0x4db57b[_0x3ad9f7(0x2a2)]&&isPendingSegmentId(_0x4db57b[_0x3ad9f7(0x2a2)]));(_0x5aff03||_0x306211)&&(_0x11bdea[_0x3ad9f7(0x2e5)]=_0x3ad9f7(0x29c),_0x11bdea[_0x3ad9f7(0x245)]=0x1,_0x11bdea['waitStepUnit']=_0x3ad9f7(0x2db),delete _0x11bdea['conditionSegmentId'],delete _0x11bdea[_0x3ad9f7(0x1fa)],delete _0x11bdea[_0x3ad9f7(0x1f5)],delete _0x11bdea[_0x3ad9f7(0x2b2)]);}export function resolveWaitStepPendingIds(_0x2775c0,_0xef77bb,_0x5c81bd,_0x6f3d84){const _0x2f2dd3=a140_0x2ff839;if(_0xef77bb[_0x2f2dd3(0x2ab)]&&isPendingSegmentId(_0xef77bb[_0x2f2dd3(0x2ab)])){const _0xb84e75=_0x5c81bd(_0xef77bb[_0x2f2dd3(0x2ab)],_0x2f2dd3(0x20f)+_0x6f3d84+'\x27\x20wait\x20condition');_0xb84e75&&(_0x2775c0['waitStepType']=_0x2f2dd3(0x2dc),_0x2775c0[_0x2f2dd3(0x2ab)]=_0xb84e75,delete _0x2775c0[_0x2f2dd3(0x245)],delete _0x2775c0[_0x2f2dd3(0x283)],_0xef77bb[_0x2f2dd3(0x1fa)]!==undefined&&(_0x2775c0[_0x2f2dd3(0x1fa)]=_0xef77bb['conditionTimeoutDuration']),_0xef77bb[_0x2f2dd3(0x1f5)]&&(_0x2775c0[_0x2f2dd3(0x1f5)]=_0xef77bb['conditionTimeoutUnit']));}if(_0xef77bb[_0x2f2dd3(0x2b2)]){const _0x2dcb75=_0xef77bb[_0x2f2dd3(0x2b2)][_0x2f2dd3(0x1f4)](_0x5742a3=>_0x5742a3['segmentId']&&isPendingSegmentId(_0x5742a3[_0x2f2dd3(0x2a2)]));if(_0x2dcb75){const _0x37ec6=_0xef77bb[_0x2f2dd3(0x2b2)][_0x2f2dd3(0x295)](_0xa2ed07=>{const _0x32e1ed=_0x2f2dd3;if(_0xa2ed07['segmentId']&&isPendingSegmentId(_0xa2ed07[_0x32e1ed(0x2a2)])){const _0x41576d=_0x5c81bd(_0xa2ed07[_0x32e1ed(0x2a2)],_0x32e1ed(0x20f)+_0x6f3d84+_0x32e1ed(0x230));return{..._0xa2ed07,'segmentId':_0x41576d||_0xa2ed07[_0x32e1ed(0x2a2)]};}return{..._0xa2ed07};});_0x2775c0[_0x2f2dd3(0x2e5)]=_0x2f2dd3(0x2dc),_0x2775c0[_0x2f2dd3(0x2b2)]=_0x37ec6,delete _0x2775c0[_0x2f2dd3(0x245)],delete _0x2775c0[_0x2f2dd3(0x283)],delete _0x2775c0[_0x2f2dd3(0x2ab)],delete _0x2775c0[_0x2f2dd3(0x1fa)],delete _0x2775c0[_0x2f2dd3(0x1f5)];}}}function stripPendingIds(_0x4f5d8a){const _0x39106c=a140_0x2ff839;_0x4f5d8a[_0x39106c(0x27c)][_0x39106c(0x25f)]?.[_0x39106c(0x2a2)]&&isPendingSegmentId(_0x4f5d8a[_0x39106c(0x27c)][_0x39106c(0x25f)][_0x39106c(0x2a2)])&&delete _0x4f5d8a[_0x39106c(0x27c)][_0x39106c(0x25f)];for(const _0x1fe6f0 of _0x4f5d8a['attributes'][_0x39106c(0x2b9)]||[]){_0x1fe6f0[_0x39106c(0x2bf)]?.[_0x39106c(0x2a2)]&&isPendingSegmentId(_0x1fe6f0[_0x39106c(0x2bf)][_0x39106c(0x2a2)])&&delete _0x1fe6f0[_0x39106c(0x2bf)];_0x1fe6f0[_0x39106c(0x257)]?.[_0x39106c(0x2a2)]&&isPendingSegmentId(_0x1fe6f0[_0x39106c(0x257)]['segmentId'])&&delete _0x1fe6f0[_0x39106c(0x257)];_0x1fe6f0[_0x39106c(0x2eb)]&&(_0x1fe6f0['exitCriterias']=_0x1fe6f0[_0x39106c(0x2eb)][_0x39106c(0x2ec)](_0x8be94c=>!_0x8be94c[_0x39106c(0x2a2)]||!isPendingSegmentId(_0x8be94c[_0x39106c(0x2a2)])));if(_0x1fe6f0[_0x39106c(0x288)])for(const _0x5d51cb of Object[_0x39106c(0x20a)](_0x1fe6f0[_0x39106c(0x288)])){const _0x155fb7=_0x1fe6f0['steps'][_0x5d51cb];_0x155fb7[_0x39106c(0x2b5)]===_0x39106c(0x2ca)&&_0x155fb7[_0x39106c(0x2ac)]&&isPendingActivationId(_0x155fb7[_0x39106c(0x2ac)])&&(_0x155fb7[_0x39106c(0x2ac)]='');if(_0x155fb7[_0x39106c(0x2b5)]===_0x39106c(0x1fb)&&_0x155fb7[_0x39106c(0x28e)])for(const _0x563b10 of _0x155fb7[_0x39106c(0x28e)]){_0x563b10[_0x39106c(0x2a2)]&&isPendingSegmentId(_0x563b10['segmentId'])&&(_0x563b10['segmentId']='');}_0x155fb7[_0x39106c(0x2b5)]===_0x39106c(0x1f8)&&stripWaitStepPendingIds(_0x155fb7);}}}function resolvePendingIdsInRequest(_0x536d67,_0x443e91,_0xda3dc2,_0x2409d2,_0x3c86d1,_0xfe8f6){const _0x1e1354=a140_0x2ff839,_0x1ef65d=(_0x2b540f,_0x5adcdb)=>{const _0x2578c7=a140_0x18bd;if(!isPendingSegmentId(_0x2b540f))return _0x2b540f;const _0x75998f=extractPendingSegmentName(_0x2b540f),_0x393c23=_0x2409d2['get'](_0x75998f);return!_0x393c23&&_0xfe8f6[_0x2578c7(0x247)]?.('Warning:\x20Could\x20not\x20resolve\x20embedded\x20segment\x20\x27'+_0x75998f+_0x2578c7(0x2ce)+_0x5adcdb),_0x393c23;};if(_0x536d67[_0x1e1354(0x27c)]['goal']?.[_0x1e1354(0x2a2)]&&isPendingSegmentId(_0x536d67['attributes'][_0x1e1354(0x25f)]['segmentId'])){const _0x2d0d2f=_0x1ef65d(_0x536d67['attributes']['goal']['segmentId'],_0x1e1354(0x23b));_0x2d0d2f&&(_0x536d67[_0x1e1354(0x27c)][_0x1e1354(0x25f)][_0x1e1354(0x2a2)]=_0x2d0d2f);}for(const _0x29290f of _0x536d67[_0x1e1354(0x27c)]['journeyStages']||[]){const _0x504bcc=_0xda3dc2[_0x1e1354(0x2c3)](_0x29290f[_0x1e1354(0x258)]['toLowerCase']());_0x504bcc&&(_0x29290f['id']=_0x504bcc);if(_0x29290f[_0x1e1354(0x2bf)]?.['segmentId']&&isPendingSegmentId(_0x29290f[_0x1e1354(0x2bf)][_0x1e1354(0x2a2)])){const _0x1b883f=_0x1ef65d(_0x29290f['entryCriteria'][_0x1e1354(0x2a2)],_0x1e1354(0x20f)+_0x29290f[_0x1e1354(0x258)]+_0x1e1354(0x266));_0x1b883f&&(_0x29290f[_0x1e1354(0x2bf)][_0x1e1354(0x2a2)]=_0x1b883f);}if(_0x29290f[_0x1e1354(0x2eb)])for(const _0x45f7b6 of _0x29290f[_0x1e1354(0x2eb)]){if(_0x45f7b6['segmentId']&&isPendingSegmentId(_0x45f7b6[_0x1e1354(0x2a2)])){const _0x449cc7=_0x1ef65d(_0x45f7b6[_0x1e1354(0x2a2)],_0x1e1354(0x20f)+_0x29290f[_0x1e1354(0x258)]+_0x1e1354(0x2aa));_0x449cc7&&(_0x45f7b6[_0x1e1354(0x2a2)]=_0x449cc7);}}if(_0x29290f['milestone']?.[_0x1e1354(0x2a2)]&&isPendingSegmentId(_0x29290f[_0x1e1354(0x257)][_0x1e1354(0x2a2)])){const _0xa26b96=_0x1ef65d(_0x29290f[_0x1e1354(0x257)][_0x1e1354(0x2a2)],'stage\x20\x27'+_0x29290f[_0x1e1354(0x258)]+_0x1e1354(0x2d7));_0xa26b96&&(_0x29290f[_0x1e1354(0x257)][_0x1e1354(0x2a2)]=_0xa26b96);}if(_0x29290f[_0x1e1354(0x288)]){const _0x24dd10=_0x184946=>_0x443e91[_0x1e1354(0x27c)][_0x1e1354(0x2b9)]?.[_0x1e1354(0x219)](_0x3e30ff=>_0x3e30ff[_0x1e1354(0x258)][_0x1e1354(0x2a4)]()===_0x29290f[_0x1e1354(0x258)][_0x1e1354(0x2a4)]())?.[_0x1e1354(0x288)]?.[_0x184946];for(const _0x10db98 of Object[_0x1e1354(0x20a)](_0x29290f[_0x1e1354(0x288)])){const _0x44095a=_0x29290f[_0x1e1354(0x288)][_0x10db98],_0x44b933=_0x24dd10(_0x10db98);if(_0x44095a['type']===_0x1e1354(0x2ca)&&_0x44095a['journeyActivationStepId']&&(isPendingActivationId(_0x44095a[_0x1e1354(0x2ac)])||_0x44095a[_0x1e1354(0x2ac)]==='')){if(_0x44b933?.[_0x1e1354(0x2ac)]&&isPendingActivationId(_0x44b933['journeyActivationStepId'])){const _0x9539df=extractPendingActivationName(_0x44b933['journeyActivationStepId']),_0x4d8ec3=_0x3c86d1[_0x1e1354(0x2c3)](_0x9539df);_0x4d8ec3&&(_0x44095a[_0x1e1354(0x2ac)]=_0x4d8ec3);}}if(_0x44095a['type']===_0x1e1354(0x1fb)&&_0x44095a[_0x1e1354(0x28e)]&&_0x44b933?.[_0x1e1354(0x28e)])for(let _0x172fbe=0x0;_0x172fbe<_0x44095a[_0x1e1354(0x28e)][_0x1e1354(0x2cc)];_0x172fbe++){const _0x2ba5cc=_0x44095a[_0x1e1354(0x28e)][_0x172fbe],_0x16b3ca=_0x44b933['branches'][_0x172fbe];if(_0x16b3ca?.[_0x1e1354(0x2a2)]&&isPendingSegmentId(_0x16b3ca[_0x1e1354(0x2a2)])){const _0x18de84=_0x1ef65d(_0x16b3ca['segmentId'],_0x1e1354(0x20f)+_0x29290f[_0x1e1354(0x258)]+_0x1e1354(0x207)+(_0x2ba5cc[_0x1e1354(0x258)]||_0x172fbe)+'\x27');_0x18de84&&(_0x2ba5cc['segmentId']=_0x18de84);}}_0x44095a[_0x1e1354(0x2b5)]===_0x1e1354(0x1f8)&&_0x44b933?.[_0x1e1354(0x2b5)]===_0x1e1354(0x1f8)&&resolveWaitStepPendingIds(_0x44095a,_0x44b933,_0x1ef65d,_0x29290f[_0x1e1354(0x258)]);}}}}
|
|
1
|
+
const a140_0x2d1abb=a140_0x4f0a;(function(_0x17d107,_0x5ac681){const _0x4314b4=a140_0x4f0a,_0x25fd71=_0x17d107();while(!![]){try{const _0x2aba09=parseInt(_0x4314b4(0x15c))/0x1*(-parseInt(_0x4314b4(0x19b))/0x2)+parseInt(_0x4314b4(0x154))/0x3+-parseInt(_0x4314b4(0x1b7))/0x4*(-parseInt(_0x4314b4(0x1e5))/0x5)+-parseInt(_0x4314b4(0x1c0))/0x6+parseInt(_0x4314b4(0x235))/0x7+-parseInt(_0x4314b4(0x1b4))/0x8+parseInt(_0x4314b4(0x1ee))/0x9*(-parseInt(_0x4314b4(0x166))/0xa);if(_0x2aba09===_0x5ac681)break;else _0x25fd71['push'](_0x25fd71['shift']());}catch(_0x1cba8f){_0x25fd71['push'](_0x25fd71['shift']());}}}(a140_0x51ab,0x2310b));import{createHash}from'crypto';import{Logger}from'../../utils/logger/index.js';const logger=Logger['of']('tdx.sdk.push-workflow');function a140_0x4f0a(_0x19048e,_0x1c740a){_0x19048e=_0x19048e-0x14b;const _0x51ab77=a140_0x51ab();let _0x4f0aac=_0x51ab77[_0x19048e];return _0x4f0aac;}export const PENDING_SEGMENT_PREFIX=a140_0x2d1abb(0x217);export const PENDING_ACTIVATION_PREFIX=a140_0x2d1abb(0x1e9);export function createPendingSegmentId(_0x4cb505){return''+PENDING_SEGMENT_PREFIX+_0x4cb505+'__';}export function isPendingSegmentId(_0x39ef9f){return _0x39ef9f['startsWith'](PENDING_SEGMENT_PREFIX)&&!_0x39ef9f['startsWith'](PENDING_ACTIVATION_PREFIX);}export function extractPendingSegmentName(_0x34aeed){const _0x42d5af=a140_0x2d1abb;return _0x34aeed[_0x42d5af(0x180)](/^__pending_(.+)__$/,'$1');}export function createPendingActivationId(_0x4c8225){return''+PENDING_ACTIVATION_PREFIX+_0x4c8225+'__';}export function isPendingActivationId(_0x21c8fc){return _0x21c8fc['startsWith'](PENDING_ACTIVATION_PREFIX);}export function extractPendingActivationName(_0x3100f6){const _0x24e634=a140_0x2d1abb;return _0x3100f6[_0x24e634(0x180)](/^__pending_act_(.+)__$/,'$1');}export function generateDeterministicJourneySegmentName(_0x5cc3b6,_0x316c71){const _0x4f4fa0=a140_0x2d1abb,_0x291c9f=_0x5cc3b6+'::'+(_0x316c71['trim']()||_0x4f4fa0(0x150)),_0x4dfc3f=createHash(_0x4f4fa0(0x14b))[_0x4f4fa0(0x1db)](_0x291c9f)['digest'](_0x4f4fa0(0x1af))[_0x4f4fa0(0x17d)](0x0,0xc);return _0x4f4fa0(0x1c2)+_0x4dfc3f;}export function ensureJourneyDefaults(_0x2a7855){const _0x2a838f=a140_0x2d1abb;!_0x2a7855[_0x2a838f(0x170)]&&(_0x2a7855[_0x2a838f(0x170)]=''),!_0x2a7855[_0x2a838f(0x1e3)]&&(_0x2a7855[_0x2a838f(0x1e3)]='draft');}export function injectExistingStageIds(_0x51ce3b,_0x48eede){const _0x2f1873=a140_0x2d1abb,_0x1d9f5c=new Map(_0x48eede[_0x2f1873(0x1d7)](_0x37f3d1=>[_0x37f3d1[_0x2f1873(0x1d5)],_0x37f3d1['id']]));for(const _0xf76242 of _0x51ce3b){if(!_0xf76242['id']){const _0x1110a6=_0x1d9f5c[_0x2f1873(0x160)](_0xf76242[_0x2f1873(0x1d5)]);_0x1110a6&&(_0xf76242['id']=_0x1110a6);}}}export function resolveTDFolderPath(_0x337673,_0x2a7ba1,_0x26a0c8){const _0x3a1f70=a140_0x2d1abb;if(!_0x2a7ba1)return _0x337673;if(_0x337673===_0x26a0c8||_0x337673[_0x3a1f70(0x19a)](_0x26a0c8+'/'))return _0x337673;return _0x337673?_0x26a0c8+'/'+_0x337673:_0x26a0c8;}export function addFoldersToCreate(_0x1f3986,_0xba9299,_0x29e754){const _0x3649ab=a140_0x2d1abb;if(!_0x1f3986)return;if(_0xba9299['has'](_0x1f3986))return;const _0x1b8226=_0x1f3986[_0x3649ab(0x1b0)]('/');let _0xbcb191='';for(const _0xac21a5 of _0x1b8226){_0xbcb191=_0xbcb191?_0xbcb191+'/'+_0xac21a5:_0xac21a5,!_0xba9299[_0x3649ab(0x1aa)](_0xbcb191)&&_0x29e754[_0x3649ab(0x1c7)](_0xbcb191);}}export function sortFoldersByDepth(_0x3a1ff4){const _0x3b4b33=a140_0x2d1abb;return[..._0x3a1ff4][_0x3b4b33(0x176)]((_0x441ade,_0x2783fe)=>{const _0x16744e=_0x3b4b33,_0x1b81b3=(_0x441ade[_0x16744e(0x22a)](/\//g)||[])[_0x16744e(0x1b5)],_0x41dbf3=(_0x2783fe[_0x16744e(0x22a)](/\//g)||[])[_0x16744e(0x1b5)];return _0x1b81b3-_0x41dbf3;});}import*as a140_0x399a39 from'yaml';import{readFileSync}from'fs';import a140_0x41e71e from'path';import{isJourneyDef,parseYamlString as a140_0x10dfcc,toYamlString as a140_0x5cd287,normalizeJourneyDef,hasMultipleVersions,journeyResponseToDef,collectSegmentIdsFromJourneyApi}from'./journey-yaml.js';import{SEGMENT_KIND_JOURNEY,generateJourneyLocalName,sanitizeYamlKey,createJumpTargetCache,resolveJumpTarget,buildMergedJourneyDef,buildLocalRuleToNameMappingFromJourney,collectSegmentUsageCounts}from'./journey-utils.js';import{activationResponseToDef,segmentToYamlString,segmentWithActivationsToYaml,parseSegmentYamlFile,normalizeChildSegmentYaml,apiRuleToYaml,yamlRuleToApi,serializeExpandedRule,collectSegmentRefsFromRule,resolveRuleSegmentRefs,resolveRuleSegmentIds,journeyActivationStepToYaml}from'./child-segment-yaml.js';import{generateDiff,formatDiffWithColors,hasChanges}from'../../utils/diff.js';import{batchAsync}from'../../utils/async.js';import{buildFolderMaps}from'./resolution-context.js';import{SDKError,ErrorCode,isHttp400Error,getErrorMessage}from'../errors.js';import{readPushRecovery,saveSegmentToPushRecovery,deletePushRecovery}from'./push-recovery.js';import{validateSegmentDef,formatValidationResult}from'./yaml-validator.js';import{validateJourneyDef}from'./journey-validator.js';function stableStringify(_0x29f385){const _0x44d552=a140_0x2d1abb;if(Array[_0x44d552(0x189)](_0x29f385))return'['+_0x29f385[_0x44d552(0x1d7)](_0x60d66c=>stableStringify(_0x60d66c))[_0x44d552(0x181)](',')+']';if(_0x29f385&&typeof _0x29f385===_0x44d552(0x234)){const _0x275046=_0x29f385,_0x1256dc=Object[_0x44d552(0x244)](_0x275046)[_0x44d552(0x176)](),_0x9ddc4=_0x1256dc[_0x44d552(0x1d7)](_0x243f21=>'\x22'+_0x243f21+'\x22:'+stableStringify(_0x275046[_0x243f21]));return'{'+_0x9ddc4['join'](',')+'}';}const _0x3ecf2e=JSON[_0x44d552(0x21f)](_0x29f385);return _0x3ecf2e===undefined?_0x44d552(0x212):_0x3ecf2e;}function activationSignature(_0x56272d){const _0x161b3a=a140_0x2d1abb,_0x29d988={'connection':_0x56272d[_0x161b3a(0x161)],..._0x56272d['all_columns']!==undefined&&{'all_columns':_0x56272d[_0x161b3a(0x186)]},..._0x56272d[_0x161b3a(0x15e)]!==undefined&&{'columns':_0x56272d[_0x161b3a(0x15e)]},..._0x56272d[_0x161b3a(0x184)]!==undefined&&{'behavior':_0x56272d[_0x161b3a(0x184)]},..._0x56272d[_0x161b3a(0x1ec)]!==undefined&&{'schedule':_0x56272d[_0x161b3a(0x1ec)]},..._0x56272d[_0x161b3a(0x1e4)]!==undefined&&{'notification':_0x56272d[_0x161b3a(0x1e4)]},..._0x56272d[_0x161b3a(0x1a8)]!==undefined&&{'connector_config':_0x56272d[_0x161b3a(0x1a8)]},..._0x56272d[_0x161b3a(0x1b8)]!==undefined&&{'activation_template_id':_0x56272d[_0x161b3a(0x1b8)]}};return stableStringify(_0x29d988);}async function fetchSegment(_0x42c57d,_0x265668,_0x561329,_0x12c67b){const _0x1f3517=a140_0x2d1abb,_0x125e07=_0x12c67b?.[_0x1f3517(0x1ba)](_0x347d45=>_0x347d45['id']===_0x561329);if(_0x125e07)return _0x125e07;try{return await _0x42c57d[_0x1f3517(0x150)][_0x1f3517(0x1cd)](_0x265668,_0x561329);}catch(_0x10f2de){logger[_0x1f3517(0x1ab)](_0x1f3517(0x1da)+_0x561329+_0x1f3517(0x216)+_0x10f2de);try{return await _0x42c57d[_0x1f3517(0x150)][_0x1f3517(0x1ae)](_0x561329);}catch(_0x34435a){return logger[_0x1f3517(0x1ab)](_0x1f3517(0x207)+_0x561329+':\x20'+_0x34435a),null;}}}function recoverSegmentIdsFromPushRecovery(_0x51272c,_0x5314ef,_0x46fb7f){const _0x400571=a140_0x2d1abb,_0x3293e0=readPushRecovery(_0x51272c[_0x400571(0x238)]);if(_0x3293e0?.[_0x400571(0x17a)]===_0x51272c['yamlConfig']['name'])for(const [_0x540d29,_0x5b6164]of Object['entries'](_0x3293e0['segments'])){const _0x1892df=generateDeterministicJourneySegmentName(_0x51272c['yamlConfig'][_0x400571(0x1d5)],_0x540d29);_0x5b6164[_0x400571(0x1bb)]===_0x1892df&&(_0x5314ef['set'](_0x540d29,_0x5b6164[_0x400571(0x231)]),_0x46fb7f[_0x400571(0x1cf)](_0x540d29,_0x5b6164[_0x400571(0x231)]));}}async function createOrRecoverEmbeddedSegment(_0x3711a1,_0x3e2524,_0x3882f1,_0x321a42){const _0xe4877d=a140_0x2d1abb;let _0x55f49c;try{_0x55f49c=await _0x3711a1[_0xe4877d(0x150)]['createJourneySegment']({'name':_0x3882f1[_0xe4877d(0x215)],'description':_0x3882f1[_0xe4877d(0x170)],'journeyId':_0x3882f1[_0xe4877d(0x1fe)],'rule':_0x321a42(_0x3882f1[_0xe4877d(0x204)],!![]),'countPopulation':!![],'parentFolderId':_0x3882f1[_0xe4877d(0x174)],'audienceId':_0x3882f1[_0xe4877d(0x1c5)]});}catch(_0x2d98da){const _0x22162d=_0x2d98da instanceof Error&&_0x2d98da[_0xe4877d(0x1b1)][_0xe4877d(0x1a4)]('Name\x20has\x20already\x20been\x20taken');if(_0x22162d){const _0x23f125=readPushRecovery(_0x3e2524[_0xe4877d(0x238)]),_0x56ec50=_0x23f125?.[_0xe4877d(0x17a)]===_0x3e2524[_0xe4877d(0x165)]['name']?_0x23f125[_0xe4877d(0x1c8)][_0x3882f1['localName']]:undefined;if(_0x56ec50?.[_0xe4877d(0x1bb)]===_0x3882f1['uniqueSegmentName'])await _0x3711a1['segment']['updateSegmentById'](_0x3882f1[_0xe4877d(0x1c5)],_0x56ec50[_0xe4877d(0x231)],{'description':_0x3882f1[_0xe4877d(0x170)],'rule':_0x321a42(_0x3882f1[_0xe4877d(0x204)],!![]),'countPopulation':!![]}),_0x55f49c=_0x56ec50[_0xe4877d(0x231)];else throw new SDKError(ErrorCode[_0xe4877d(0x1eb)],'Embedded\x20segment\x20\x27'+_0x3882f1[_0xe4877d(0x20c)]+'\x27\x20already\x20exists\x20on\x20server\x20but\x20cannot\x20be\x20found.\x20'+(_0xe4877d(0x1c1)+_0x3e2524['absolutePath'][_0xe4877d(0x180)](/([^/]+)$/,_0xe4877d(0x21b))+')\x20')+_0xe4877d(0x17f),_0x2d98da);}else throw _0x2d98da;}return saveSegmentToPushRecovery(_0x3e2524[_0xe4877d(0x238)],_0x3e2524[_0xe4877d(0x165)][_0xe4877d(0x1d5)],_0x3882f1[_0xe4877d(0x20c)],{'segmentId':_0x55f49c,'uniqueServerName':_0x3882f1[_0xe4877d(0x215)],'createdAt':new Date()[_0xe4877d(0x211)]()}),_0x55f49c;}export async function prepareSegmentFiles(_0x38489c,_0x35e42b,_0xf32b9c,_0x43f837,_0x3ed55d){const _0x3550d0=a140_0x2d1abb,{activationDefToCreateRequest:_0x190369}=await import(_0x3550d0(0x205)),_0x3a37f5=[],_0x285166=new Set();for(const {yamlConfig:_0x35436d,folderPath:_0x58bd76,sourcePath:_0x4c4110}of _0x38489c){const _0x8bcf5c=resolveTDFolderPath(_0x58bd76,_0x43f837,_0x3ed55d),_0x2e1fa2=_0x8bcf5c+':'+_0x35436d['name'],_0x492777=_0x35e42b[_0x3550d0(0x1dc)][_0x3550d0(0x160)](_0x2e1fa2),_0x1b63de=_0x492777?_0x35e42b[_0x3550d0(0x20f)][_0x3550d0(0x160)](_0x492777['id'])||[]:[];addFoldersToCreate(_0x8bcf5c,_0x35e42b['folderPathToId'],_0x285166);const _0x760598=calculateActivationActions(_0x35436d['activations']||[],_0x1b63de,_0x35e42b['idToEmailMap'],_0x35e42b[_0x3550d0(0x1a2)]);for(const _0x54063d of _0x760598){(_0x54063d[_0x3550d0(0x19d)]==='create'||_0x54063d[_0x3550d0(0x19d)]===_0x3550d0(0x1db))&&_0x54063d[_0x3550d0(0x224)]&&(_0x54063d['validatedRequest']=await _0x190369(_0x54063d[_0x3550d0(0x224)],_0xf32b9c));}const _0x31159f=calculateSegmentDiff(_0x35436d,_0x492777,_0x1b63de,_0x35e42b[_0x3550d0(0x18e)],_0x35e42b[_0x3550d0(0x1a2)]);_0x3a37f5[_0x3550d0(0x243)]({'relativePath':_0x35436d[_0x3550d0(0x1d5)],'absolutePath':_0x4c4110,'yamlConfig':_0x35436d,'folderPath':_0x8bcf5c,'existingSegment':_0x492777,'existingActivations':_0x1b63de,'isNew':_0x31159f[_0x3550d0(0x17b)],'hasChanges':_0x31159f['hasChanges'],'diff':_0x31159f[_0x3550d0(0x169)],'activationActions':_0x760598});}return{'segmentFiles':_0x3a37f5,'foldersToCreate':_0x285166};}export async function prepareJourneyFiles(_0x315f83,_0xdb0a83,_0xb392dd,_0x2409e9){const _0x4aeb7c=a140_0x2d1abb,_0xd09aa5=[],_0x1278c6=new Set();for(const {yamlConfig:_0x39a6b2,folderPath:_0x4ede34,sourcePath:_0x1ce51a}of _0x315f83){const _0x567d0e=resolveTDFolderPath(_0x4ede34,_0xb392dd,_0x2409e9),_0x561230=_0x567d0e+':'+_0x39a6b2[_0x4aeb7c(0x1d5)],_0x21fbd0=_0xdb0a83[_0x4aeb7c(0x1fa)][_0x4aeb7c(0x160)](_0x561230);let _0x3d0fa8,_0x21099b;if(_0x21fbd0&&_0x21fbd0['length']>0x0){const _0x1908ef=buildLocalExpandedRuleMappings(_0x39a6b2),{createYamlContext:_0x36a3e9,prefetchJourneySegments:_0x13c03d}=createPushYamlContextForBundle(_0xdb0a83[_0x4aeb7c(0x1c6)],_0xdb0a83['parentId'],_0xdb0a83['existingSegments'],_0x1908ef,_0xdb0a83[_0x4aeb7c(0x18e)],_0xdb0a83[_0x4aeb7c(0x1a2)],_0xdb0a83[_0x4aeb7c(0x23a)],_0xdb0a83[_0x4aeb7c(0x226)]);await _0x13c03d(_0x21fbd0['map'](_0x1fb5bf=>_0x1fb5bf['id']));const _0x2c4cc0=await _0xdb0a83[_0x4aeb7c(0x1c6)][_0x4aeb7c(0x151)][_0x4aeb7c(0x15b)](_0x21fbd0[0x0][_0x4aeb7c(0x157)]),_0x34cd59=hasMultipleVersions(_0x39a6b2),_0x1b0936=async _0x428844=>{const _0x40d250=_0x4aeb7c,_0x55a1b1=_0xdb0a83[_0x40d250(0x226)]?.['get'](_0x428844);if(_0x55a1b1)return _0x55a1b1;return _0xdb0a83['fetchJourney']({'journeyId':_0x428844,'journeyName':_0x39a6b2[_0x40d250(0x1d5)],'isMultiVersion':_0x21fbd0[_0x40d250(0x1b5)]>0x1});};if(_0x34cd59&&_0x21fbd0['length']>0x1){const _0x5a1081=[];for(const _0x187181 of _0x21fbd0){const _0x37c510=_0x187181[_0x4aeb7c(0x1bd)]||0x1;_0xdb0a83[_0x4aeb7c(0x14d)]?.['update'](_0x4aeb7c(0x214)+_0x39a6b2[_0x4aeb7c(0x1d5)]+'\x20v'+_0x37c510);const _0xa7d03b=await _0x1b0936(_0x187181['id']),_0xe9b6b1=_0x36a3e9(_0x187181['id']),_0x264bdb=await journeyResponseToDef(_0xa7d03b,_0xe9b6b1);_0x5a1081[_0x4aeb7c(0x243)]({'item':_0x187181,'yaml':_0x264bdb});}const _0x2268d6=buildLocalRuleToNameMappingFromJourney(_0x39a6b2);_0x21099b=buildMergedJourneyDef(_0x5a1081,_0x2268d6,_0x2c4cc0);const _0x5a68d0=Math[_0x4aeb7c(0x1a7)](..._0x5a1081[_0x4aeb7c(0x1d7)](_0x39decf=>_0x39decf[_0x4aeb7c(0x187)]['versionNumber']||0x0)),_0x260e47=_0x21fbd0['find'](_0x14e7d1=>(_0x14e7d1[_0x4aeb7c(0x1bd)]||0x0)===_0x5a68d0);_0x260e47&&(_0xdb0a83[_0x4aeb7c(0x14d)]?.[_0x4aeb7c(0x1db)](_0x4aeb7c(0x214)+_0x39a6b2[_0x4aeb7c(0x1d5)]+'\x20v'+_0x5a68d0),_0x3d0fa8=await _0x1b0936(_0x260e47['id']));}else{const _0x23ac0a=_0x21fbd0[_0x21fbd0[_0x4aeb7c(0x1b5)]-0x1];_0xdb0a83['progress']?.[_0x4aeb7c(0x1db)]('Fetching\x20'+_0x39a6b2[_0x4aeb7c(0x1d5)]),_0x3d0fa8=await _0x1b0936(_0x23ac0a['id']);const _0x34cb58=_0x36a3e9(_0x23ac0a['id']),_0x4e75ac=await journeyResponseToDef(_0x3d0fa8,_0x34cb58),_0xb25070=buildLocalRuleToNameMappingFromJourney(_0x39a6b2);_0x21099b=buildMergedJourneyDef([{'item':_0x23ac0a,'yaml':_0x4e75ac}],_0xb25070,_0x2c4cc0);}}addFoldersToCreate(_0x567d0e,_0xdb0a83[_0x4aeb7c(0x18d)],_0x1278c6);const _0xae0213=calculateJourneyDiff(_0x39a6b2,_0x21099b);_0xd09aa5['push']({'relativePath':_0x39a6b2[_0x4aeb7c(0x1d5)],'absolutePath':_0x1ce51a,'yamlConfig':_0x39a6b2,'folderPath':_0x567d0e,'existingJourney':_0x3d0fa8,'isNew':_0xae0213['isNew'],'hasChanges':_0xae0213[_0x4aeb7c(0x21d)],'diff':_0xae0213[_0x4aeb7c(0x169)]});}return{'journeyFiles':_0xd09aa5,'foldersToCreate':_0x1278c6};}export function calculateActivationActions(_0x25b621,_0x8f7e5f,_0xb05d68,_0x2b4f25){const _0x20e202=a140_0x2d1abb,_0x2ecd5e=[],_0x25db60=new Map();for(const _0x313c01 of _0x8f7e5f){_0x25db60[_0x20e202(0x1cf)](_0x313c01[_0x20e202(0x1d5)],_0x313c01);}const _0x4b234a=new Map();for(const _0x83f8db of _0x25b621){_0x4b234a[_0x20e202(0x1cf)](_0x83f8db[_0x20e202(0x1d5)],_0x83f8db);}for(const _0x4ee322 of _0x25b621){const _0x1c08ba=_0x25db60[_0x20e202(0x160)](_0x4ee322[_0x20e202(0x1d5)]);if(!_0x1c08ba)_0x2ecd5e['push']({'type':'create','name':_0x4ee322[_0x20e202(0x1d5)],'yamlActivation':_0x4ee322});else{const _0x45be25=activationResponseToDef(_0x1c08ba,_0xb05d68,_0x2b4f25),_0x8cd9c4=a140_0x399a39[_0x20e202(0x21f)](_0x45be25),_0x1688ba=a140_0x399a39[_0x20e202(0x21f)](_0x4ee322);_0x8cd9c4!==_0x1688ba&&_0x2ecd5e['push']({'type':_0x20e202(0x1db),'name':_0x4ee322[_0x20e202(0x1d5)],'yamlActivation':_0x4ee322,'existingActivation':_0x1c08ba});}}for(const _0x484818 of _0x8f7e5f){!_0x4b234a[_0x20e202(0x1aa)](_0x484818['name'])&&_0x2ecd5e[_0x20e202(0x243)]({'type':_0x20e202(0x22b),'name':_0x484818[_0x20e202(0x1d5)],'existingActivation':_0x484818});}return _0x2ecd5e;}function calculateYamlDiff(_0x5eb8ce,_0xdea241){if(_0xdea241){const _0x277967=generateDiff(_0xdea241,_0x5eb8ce),_0x1d6eb2=hasChanges(_0x277967);return{'isNew':![],'hasChanges':_0x1d6eb2,'diff':_0x1d6eb2?formatDiffWithColors(_0x277967):undefined};}const _0x1215f3=generateDiff('',_0x5eb8ce);return{'isNew':!![],'hasChanges':![],'diff':formatDiffWithColors(_0x1215f3)};}export function calculateSegmentDiff(_0x4c0845,_0x19a54d,_0x34c59c,_0x39caf5,_0x10e428){const _0x4dff77=segmentToYamlString(_0x4c0845),_0x8c9dd7=_0x19a54d?segmentToYamlString(segmentWithActivationsToYaml(_0x19a54d,_0x34c59c,undefined,_0x39caf5,_0x10e428)):undefined;return calculateYamlDiff(_0x4dff77,_0x8c9dd7);}export function calculateJourneyDiff(_0x5ec0b3,_0x45796f){const _0x331b5e=normalizeJourneyDef(_0x5ec0b3,_0x5ec0b3),_0x433646=a140_0x5cd287(_0x331b5e),_0xd29c20=_0x45796f?a140_0x5cd287(normalizeJourneyDef(_0x45796f,_0x5ec0b3)):undefined;return calculateYamlDiff(_0x433646,_0xd29c20);}export function findSegmentsToDelete(_0x4d9319,_0x366758,_0xc323a1,_0x1dceae,_0x50ff27){const _0x235f8c=a140_0x2d1abb,_0x437c70=new Set();for(const {yamlConfig:_0x4bc0f1,folderPath:_0x3c1710}of _0x366758){_0x437c70[_0x235f8c(0x1c7)](_0x3c1710+':'+_0x4bc0f1[_0x235f8c(0x1d5)]);}return _0x4d9319[_0x235f8c(0x177)](_0x95a200=>{const _0x29c419=_0x235f8c,_0x5a6021=_0x95a200[_0x29c419(0x1e8)]?_0xc323a1[_0x29c419(0x160)](_0x95a200['segmentFolderId'][_0x29c419(0x1f9)]())||'':'',_0x5ee9f7=_0x5a6021+':'+_0x95a200[_0x29c419(0x1d5)];if(_0x437c70[_0x29c419(0x1aa)](_0x5ee9f7))return![];if(_0x50ff27)return _0x5a6021===_0x1dceae||_0x5a6021[_0x29c419(0x19a)](_0x1dceae+'/');return!![];});}export function findJourneysToDelete(_0x236e1a,_0x381632,_0x481be7,_0x1a6933,_0x59bdff){const _0x5b570f=a140_0x2d1abb,_0x53d94d=new Set();for(const {yamlConfig:_0x3202d8,folderPath:_0x1f1b22}of _0x381632){_0x53d94d[_0x5b570f(0x1c7)](_0x1f1b22+':'+_0x3202d8['name']);}return _0x236e1a[_0x5b570f(0x177)](_0x2503f6=>{const _0x159e5d=_0x5b570f,_0x115488=_0x2503f6['folderId']?_0x481be7[_0x159e5d(0x160)](_0x2503f6[_0x159e5d(0x174)])||'':'',_0x54d671=_0x115488+':'+_0x2503f6['journeyBundleName'];if(_0x53d94d['has'](_0x54d671))return![];if(_0x59bdff)return _0x115488===_0x1a6933||_0x115488[_0x159e5d(0x19a)](_0x1a6933+'/');return!![];});}export function buildSegmentLookupMap(_0x180493,_0x28fdb9){const _0x1e4473=a140_0x2d1abb,_0x21dae8=new Map();for(const _0x4f49f9 of _0x180493){const _0x3aaf4b=_0x4f49f9[_0x1e4473(0x1e8)]?_0x28fdb9['get'](_0x4f49f9['segmentFolderId']['toString']())||'':'',_0x55fd88=_0x3aaf4b+':'+_0x4f49f9[_0x1e4473(0x1d5)];_0x21dae8[_0x1e4473(0x1cf)](_0x55fd88,_0x4f49f9);}return _0x21dae8;}export function buildSegmentNameToIdMap(_0x3ed6eb){const _0x5ca1b6=a140_0x2d1abb,_0x1583e1=new Map();for(const _0xa49957 of _0x3ed6eb){_0x1583e1[_0x5ca1b6(0x1cf)](_0xa49957[_0x5ca1b6(0x1d5)],_0xa49957['id']);}return _0x1583e1;}export function buildJourneyBundleLookupMap(_0x46f0f3,_0x501989){const _0x36e604=a140_0x2d1abb,_0x5bc211=new Map();for(const _0x3717b4 of _0x46f0f3){const _0x167abd=_0x3717b4[_0x36e604(0x174)]?_0x501989['get'](_0x3717b4[_0x36e604(0x174)])||'':'',_0x79ce1e=_0x167abd+':'+_0x3717b4[_0x36e604(0x1f4)];!_0x5bc211[_0x36e604(0x1aa)](_0x79ce1e)&&_0x5bc211['set'](_0x79ce1e,[]),_0x5bc211[_0x36e604(0x160)](_0x79ce1e)[_0x36e604(0x243)](_0x3717b4);}for(const _0x2702f4 of _0x5bc211['values']()){_0x2702f4[_0x36e604(0x176)]((_0xe7e349,_0x3bf2ff)=>(_0xe7e349[_0x36e604(0x1bd)]||0x0)-(_0x3bf2ff[_0x36e604(0x1bd)]||0x0));}return _0x5bc211;}export function collectFoldersToCreate(_0x547019,_0x22b17f){const _0x2c47ed=a140_0x2d1abb,_0x62977=new Set();for(const _0x171212 of _0x547019){if(!_0x171212)continue;if(_0x22b17f[_0x2c47ed(0x1aa)](_0x171212))continue;const _0x31455a=_0x171212[_0x2c47ed(0x1b0)]('/');let _0x26280e='';for(const _0x440bed of _0x31455a){_0x26280e=_0x26280e?_0x26280e+'/'+_0x440bed:_0x440bed,!_0x22b17f[_0x2c47ed(0x1aa)](_0x26280e)&&_0x62977[_0x2c47ed(0x1c7)](_0x26280e);}}return _0x62977;}export function parseAndClassifyYamlFiles(_0x369b56,_0x48973a,_0x5ca331){const _0x1e7de3=a140_0x2d1abb,_0x357109=[],_0x3e0953=[];for(const _0x1debe3 of _0x369b56){const _0x541394=a140_0x41e71e[_0x1e7de3(0x23e)](_0x48973a,a140_0x41e71e[_0x1e7de3(0x1e7)](_0x1debe3)),_0x22a67e=_0x541394==='.'?'':_0x541394,_0xe7eab7=readFileSync(_0x1debe3,_0x1e7de3(0x1d4)),_0x54a640=a140_0x399a39[_0x1e7de3(0x1e0)](_0xe7eab7);if(isJourneyDef(_0x54a640)){const _0x34b851=a140_0x10dfcc(_0xe7eab7);_0x3e0953[_0x1e7de3(0x243)]({'yamlConfig':_0x34b851,'folderPath':_0x22a67e,'sourcePath':_0x1debe3});}else{if(!_0x5ca331?.['skipSegments']){const _0x4446cf=parseSegmentYamlFile(_0xe7eab7),_0x125163=normalizeChildSegmentYaml(_0x4446cf);_0x357109[_0x1e7de3(0x243)]({'yamlConfig':_0x125163,'folderPath':_0x22a67e,'sourcePath':_0x1debe3});}}}return{'segments':_0x357109,'journeys':_0x3e0953};}export function validateParsedFiles(_0x10c897,_0x4dee41){const _0x1334f3=a140_0x2d1abb,_0x260ed8=[];for(const {yamlConfig:_0xd48d8,sourcePath:_0x33e531}of _0x10c897['segments']){const _0x50d5f5=readFileSync(_0x33e531,_0x1334f3(0x1d4)),_0x502076=a140_0x399a39['parseDocument'](_0x50d5f5),_0x18ebd6=validateSegmentDef(_0xd48d8,{'source':_0x50d5f5,'document':_0x502076},{'skipSchema':!![]});if(!_0x18ebd6[_0x1334f3(0x213)]){const _0x4edc6f=a140_0x41e71e[_0x1334f3(0x23e)](_0x4dee41,_0x33e531);_0x260ed8[_0x1334f3(0x243)]({'filePath':_0x4edc6f,'source':_0x50d5f5,'result':_0x18ebd6,'isJourney':![]});}}for(const {yamlConfig:_0x31d4c0,sourcePath:_0x1ee092}of _0x10c897[_0x1334f3(0x203)]){const _0x2213ab=readFileSync(_0x1ee092,_0x1334f3(0x1d4)),_0x4a822c=a140_0x399a39[_0x1334f3(0x218)](_0x2213ab),_0x4c3c29=validateJourneyDef(_0x31d4c0,{'source':_0x2213ab,'document':_0x4a822c},{'skipSchema':!![]});if(!_0x4c3c29[_0x1334f3(0x213)]){const _0x3017a5=a140_0x41e71e[_0x1334f3(0x23e)](_0x4dee41,_0x1ee092);_0x260ed8['push']({'filePath':_0x3017a5,'source':_0x2213ab,'result':_0x4c3c29,'isJourney':!![]});}}return _0x260ed8;}export function formatValidationErrors(_0x541271){const _0xc87c85=a140_0x2d1abb,_0x10840a=[];for(const {filePath:_0x2a41a0,source:_0x2a2669,result:_0x164213,isJourney:_0xf4bc6d}of _0x541271){const _0x1c7c51=_0xf4bc6d?'journey':_0xc87c85(0x150);_0x10840a[_0xc87c85(0x243)]('\x0a'+_0x2a41a0+'\x20('+_0x1c7c51+_0xc87c85(0x192)+_0x164213[_0xc87c85(0x1bc)][_0xc87c85(0x1b5)]+_0xc87c85(0x199)),_0x10840a[_0xc87c85(0x243)](formatValidationResult(_0x164213,_0x2a2669,_0x2a41a0));}return _0x10840a[_0xc87c85(0x181)]('\x0a');}export function buildLocalExpandedRuleMappings(_0x15670a){const _0x505341=a140_0x2d1abb,_0xe3ad45=new Set(),_0x4ba868=new Map(),_0x58a477=collectSegmentUsageCounts(_0x15670a);if(_0x15670a[_0x505341(0x1c8)])for(const [_0x813c9f,_0x3d20c9]of Object[_0x505341(0x1ea)](_0x15670a['segments'])){_0xe3ad45[_0x505341(0x1c7)](_0x813c9f);if(_0x3d20c9['rule']){const _0x2a95a1=yamlRuleToApi(_0x3d20c9['rule']),_0x434765=apiRuleToYaml(_0x2a95a1);_0x4ba868[_0x505341(0x1cf)](_0x813c9f,_0x434765);}}const _0x3d2c09=new Map();let _0x3e4e6f=0x0;for(const [_0x2c1cdc,_0x15b0ef]of _0x4ba868){const _0x151480=serializeExpandedRule(_0x15b0ef,_0x4ba868),_0x23d1d9=_0x3d2c09[_0x505341(0x160)](_0x151480)||[];_0x23d1d9['push']({'name':_0x2c1cdc,'index':_0x3e4e6f}),_0x3d2c09['set'](_0x151480,_0x23d1d9),_0x3e4e6f++;}const _0x4693d7=new Map();for(const [_0xaedf49,_0x4db51c]of _0x3d2c09){const _0x386023=_0x4db51c[_0x505341(0x17d)]()[_0x505341(0x176)]((_0x218107,_0x435a25)=>{const _0x1943bc=_0x505341,_0x340cd0=_0x58a477[_0x1943bc(0x160)](_0x218107[_0x1943bc(0x1d5)])||0x0,_0x2edcbb=_0x58a477[_0x1943bc(0x160)](_0x435a25[_0x1943bc(0x1d5)])||0x0;if(_0x340cd0!==_0x2edcbb)return _0x2edcbb-_0x340cd0;return _0x218107[_0x1943bc(0x156)]-_0x435a25[_0x1943bc(0x156)];})[_0x505341(0x1d7)](_0x1705f6=>_0x1705f6[_0x505341(0x1d5)]),_0x38732d=[];for(const _0xebfe35 of _0x386023){const _0x55ac61=_0x58a477['get'](_0xebfe35)||0x0,_0x1226da=Math['max'](_0x55ac61,0x1);for(let _0x25c7c1=0x0;_0x25c7c1<_0x1226da;_0x25c7c1++){_0x38732d[_0x505341(0x243)](_0xebfe35);}}_0x4693d7[_0x505341(0x1cf)](_0xaedf49,_0x38732d);}return{'existingLocalSegmentNames':_0xe3ad45,'localSegmentRules':_0x4ba868,'localExpandedRuleToNames':_0x4693d7};}export function createSegmentIdResolver(_0x10573e,_0x43b6f){return async _0xcae1e9=>{const _0x1018ee=a140_0x4f0a,_0x2ab24a=_0x10573e['get'](_0xcae1e9);if(!_0x2ab24a)throw new SDKError(ErrorCode[_0x1018ee(0x162)],_0x1018ee(0x219)+_0xcae1e9+_0x1018ee(0x152)+_0x43b6f+'\x27)');return _0x2ab24a;};}export function extractRootFolderId(_0x5ccca9){const _0x59ea58=a140_0x2d1abb;return _0x5ccca9[_0x59ea58(0x194)]?.['parentSegmentFolder']?.[_0x59ea58(0x21c)]?.['id']||_0x5ccca9[_0x59ea58(0x194)]?.[_0x59ea58(0x19c)]?.['data']?.['id'];}export function buildConnectionMaps(_0x1209e1){const _0x5d458b=a140_0x2d1abb,_0x37ef4e=new Map(),_0x5ecd81=new Map(),_0x5a761f=new Map();for(const _0x3a7aed of _0x1209e1){_0x37ef4e['set'](_0x3a7aed['name'],parseInt(_0x3a7aed['id'],0xa)),_0x5ecd81['set'](_0x3a7aed['id'],_0x3a7aed[_0x5d458b(0x1d5)]),_0x5a761f['set'](_0x3a7aed[_0x5d458b(0x1d5)],_0x3a7aed[_0x5d458b(0x19d)]);}return{'nameToId':_0x37ef4e,'idToName':_0x5ecd81,'nameToType':_0x5a761f};}export function calculatePushStats(_0x582cae,_0x98ef01,_0x3f2663,_0xcffa3b,_0x2322da,_0x5b6990,_0x1eb0a8){const _0x39c573=a140_0x2d1abb,_0x5b0b8d=_0x582cae[_0x39c573(0x177)](_0x5dec2b=>_0x5dec2b[_0x39c573(0x17b)]),_0x445eb1=_0x582cae[_0x39c573(0x177)](_0x49a734=>!_0x49a734[_0x39c573(0x17b)]&&_0x49a734[_0x39c573(0x21d)]),_0x50725b=_0x582cae['filter'](_0x14fb93=>!_0x14fb93[_0x39c573(0x17b)]&&!_0x14fb93[_0x39c573(0x21d)]),_0x488234=_0x5b6990?_0xcffa3b:[],_0x58ead7=_0x98ef01['filter'](_0x241245=>_0x241245[_0x39c573(0x17b)]),_0x3912e8=_0x98ef01[_0x39c573(0x177)](_0x5e68d8=>!_0x5e68d8[_0x39c573(0x17b)]&&_0x5e68d8[_0x39c573(0x21d)]),_0x1466bf=_0x98ef01[_0x39c573(0x177)](_0x1229bb=>!_0x1229bb[_0x39c573(0x17b)]&&!_0x1229bb[_0x39c573(0x21d)]),_0x462419=_0x5b6990?_0x2322da:[],_0x34e454=_0x582cae[_0x39c573(0x164)](_0x3ad662=>_0x3ad662['activationActions']),_0x191540=_0x34e454[_0x39c573(0x177)](_0x45a7fb=>_0x45a7fb[_0x39c573(0x19d)]===_0x39c573(0x185)),_0x4ecb82=_0x34e454[_0x39c573(0x177)](_0x31ffbc=>_0x31ffbc[_0x39c573(0x19d)]===_0x39c573(0x1db)),_0xfb8f30=_0x34e454[_0x39c573(0x177)](_0x510001=>_0x510001[_0x39c573(0x19d)]==='delete'),_0x1e6870=Array[_0x39c573(0x237)](_0x3f2663)[_0x39c573(0x176)](),_0x44c1a1=_0x1eb0a8?![]:_0x5b0b8d['length']>0x0||_0x445eb1['length']>0x0||_0x488234['length']>0x0,_0x5b1603=_0x58ead7[_0x39c573(0x1b5)]>0x0||_0x3912e8['length']>0x0||_0x462419[_0x39c573(0x1b5)]>0x0,_0xc1dde2=_0x1eb0a8?![]:_0x34e454[_0x39c573(0x1b5)]>0x0,_0x257d9f=_0x1e6870[_0x39c573(0x1b5)]>0x0;return{'segments':{'new':_0x5b0b8d,'changed':_0x445eb1,'unchanged':_0x50725b,'toDelete':_0x488234},'journeys':{'new':_0x58ead7,'changed':_0x3912e8,'unchanged':_0x1466bf,'toDelete':_0x462419},'activations':{'all':_0x34e454,'toCreate':_0x191540,'toUpdate':_0x4ecb82,'toDelete':_0xfb8f30},'folders':{'toCreate':_0x1e6870},'counts':{'segments':{'new':_0x5b0b8d[_0x39c573(0x1b5)],'changed':_0x445eb1[_0x39c573(0x1b5)],'unchanged':_0x50725b['length'],'toDelete':_0x488234[_0x39c573(0x1b5)]},'journeys':{'new':_0x58ead7[_0x39c573(0x1b5)],'changed':_0x3912e8[_0x39c573(0x1b5)],'unchanged':_0x1466bf[_0x39c573(0x1b5)],'toDelete':_0x462419[_0x39c573(0x1b5)]},'activations':{'create':_0x191540['length'],'update':_0x4ecb82[_0x39c573(0x1b5)],'delete':_0xfb8f30[_0x39c573(0x1b5)]},'folders':_0x1e6870[_0x39c573(0x1b5)]},'hasChanges':_0x44c1a1||_0x5b1603||_0xc1dde2||_0x257d9f};}export async function buildPushExecutionContext(_0x212b0f,_0x5f7b40,_0x39fc47,_0x1a1cb5,_0x46a3e4,_0x4fd9b8){const _0x1eac00=a140_0x2d1abb,_0x3018c4=extractRootFolderId(_0x39fc47),{pathToId:_0x1ad758,idToPath:_0x237835}=buildFolderMaps(_0x46a3e4),_0x5d5f31=buildSegmentNameToIdMap(_0x1a1cb5),_0x5cd537=new Map(),{batchAsync:_0x31451d}=await import(_0x1eac00(0x1d6)),[_0x372e1f,_0x2ac4de]=await Promise['all']([_0x212b0f[_0x1eac00(0x18a)][_0x1eac00(0x1ef)](),_0x212b0f[_0x1eac00(0x161)][_0x1eac00(0x1cb)](),((async()=>{const _0x1f5a94=_0x1eac00;!_0x4fd9b8&&_0x1a1cb5[_0x1f5a94(0x1b5)]>0x0&&await _0x31451d(_0x1a1cb5,async _0x57ffec=>{const _0x426b22=_0x1f5a94,_0x850041=await _0x212b0f[_0x426b22(0x150)][_0x426b22(0x1a6)](_0x5f7b40,_0x57ffec['id']);_0x5cd537[_0x426b22(0x1cf)](_0x57ffec['id'],_0x850041);});})())]),{emailToId:_0x4632d9,idToEmail:_0x118181}=_0x372e1f,_0x3fdffc=buildConnectionMaps(_0x2ac4de);return{'rootFolderId':_0x3018c4,'folderPathToId':_0x1ad758,'folderIdToPath':_0x237835,'segmentNameToId':_0x5d5f31,'activationsBySegmentId':_0x5cd537,'emailToIdMap':_0x4632d9,'idToEmailMap':_0x118181,'connectionNameToIdMap':_0x3fdffc[_0x1eac00(0x1dd)],'connectionIdToNameMap':_0x3fdffc[_0x1eac00(0x209)],'connectionNameToTypeMap':_0x3fdffc[_0x1eac00(0x179)]};}export function createPushYamlContextForBundle(_0x4aadab,_0x8a72c0,_0x51c00f,_0x3339b4,_0x5df8f6,_0x2a369e,_0x62af03,_0x3ee8ba){const {existingLocalSegmentNames:_0x32e037,localExpandedRuleToNames:_0x2cca12}=_0x3339b4,_0x56f2d7=new Set(),_0x12fde0=new Map(),_0x3db4b4=new Map(),_0xf51f52=new Map(),_0x142767=createJumpTargetCache(),_0x1bbb79=new Map(),_0x2e6e0a=new Map(),_0x124d5b=new Set();let _0xd8ba13;const _0x59473f=_0x1ff7ee=>{const _0x298a0d={'resolveSegment':async _0x222740=>{const _0x2a1bf7=a140_0x4f0a,_0x35eff5=_0xf51f52[_0x2a1bf7(0x160)](_0x222740);if(_0x35eff5!==undefined)return{'name':_0x35eff5,'isJourneyLocal':!![]};try{const _0x50d98=await fetchSegment(_0x4aadab,_0x8a72c0,_0x222740,_0x51c00f);if(!_0x50d98)throw new Error(_0x2a1bf7(0x18f));const _0x338056=generateJourneyLocalName(_0x50d98[_0x2a1bf7(0x1d5)]),_0x21b267=_0x50d98['kind']===SEGMENT_KIND_JOURNEY&&_0x338056!==undefined;let _0x252ea9=_0x50d98[_0x2a1bf7(0x1d5)],_0x3504a8;if(_0x21b267&&_0x50d98[_0x2a1bf7(0x20b)]){const _0x26b469=apiRuleToYaml(_0x50d98[_0x2a1bf7(0x20b)]);_0x2e6e0a['set'](_0x222740,_0x26b469);const _0x49c6cd=async _0x2d3948=>{const _0x4d442d=_0x2a1bf7,_0x3445ce=collectSegmentRefsFromRule(_0x2d3948);for(const _0x4c8ee2 of _0x3445ce){if(!_0x2e6e0a['has'](_0x4c8ee2))try{const _0x4069e4=await fetchSegment(_0x4aadab,_0x8a72c0,_0x4c8ee2,_0x51c00f);if(_0x4069e4?.[_0x4d442d(0x20b)]){const _0x172032=apiRuleToYaml(_0x4069e4[_0x4d442d(0x20b)]);_0x2e6e0a[_0x4d442d(0x1cf)](_0x4c8ee2,_0x172032),await _0x49c6cd(_0x172032);}}catch(_0x17cf9c){logger['debug'](_0x4d442d(0x1d3)+_0x4c8ee2+':\x20'+_0x17cf9c);}}};await _0x49c6cd(_0x26b469);const _0x442d45=serializeExpandedRule(_0x26b469,_0x2e6e0a),_0x563ff6=_0x2cca12[_0x2a1bf7(0x160)](_0x442d45);if(_0x563ff6&&_0x563ff6[_0x2a1bf7(0x1b5)]>0x0){const _0x3906b7=_0x12fde0['get'](_0x442d45)||0x0,_0x3328e6=_0x563ff6[_0x3906b7]||_0x563ff6[_0x563ff6[_0x2a1bf7(0x1b5)]-0x1];_0x12fde0[_0x2a1bf7(0x1cf)](_0x442d45,_0x3906b7+0x1),_0x252ea9=_0x3328e6,_0x56f2d7[_0x2a1bf7(0x1c7)](_0x252ea9),_0xf51f52[_0x2a1bf7(0x1cf)](_0x222740,_0x252ea9);const _0x37f1eb=await resolveRuleSegmentRefs(_0x26b469,async _0x2204d5=>{const _0x2597e2=_0x2a1bf7,_0x3af689=_0xf51f52[_0x2597e2(0x160)](_0x2204d5);if(_0x3af689)return _0x3af689;const _0x13582a=await _0xd8ba13[_0x2597e2(0x22e)](_0x2204d5);return _0x13582a[_0x2597e2(0x1d5)];});_0x3504a8={'description':_0x50d98['description'],'rule':_0x37f1eb};}else{const _0x3d419b=_0x1bbb79[_0x2a1bf7(0x160)](_0x442d45);if(_0x3d419b)_0x252ea9=_0x3d419b,_0xf51f52[_0x2a1bf7(0x1cf)](_0x222740,_0x252ea9);else{if(_0x338056){let _0x1ca52c=_0x338056,_0xb8069b=0x2;while(_0x56f2d7[_0x2a1bf7(0x1aa)](_0x1ca52c)||_0x32e037[_0x2a1bf7(0x1aa)](_0x1ca52c)){_0x1ca52c=_0x338056+'_'+_0xb8069b,_0xb8069b++;}_0x56f2d7['add'](_0x1ca52c),_0x252ea9=_0x1ca52c;}_0xf51f52[_0x2a1bf7(0x1cf)](_0x222740,_0x252ea9),_0x1bbb79['set'](_0x442d45,_0x252ea9);const _0x5e377e=await resolveRuleSegmentRefs(_0x26b469,async _0x9b0c9c=>{const _0x30e6c6=_0x2a1bf7,_0x5e4c55=_0xf51f52['get'](_0x9b0c9c);if(_0x5e4c55)return _0x5e4c55;const _0xcc5fc8=await _0xd8ba13[_0x30e6c6(0x22e)](_0x9b0c9c);return _0xcc5fc8[_0x30e6c6(0x1d5)];});_0x3504a8={'description':_0x50d98[_0x2a1bf7(0x170)],'rule':_0x5e377e};}}}return{'name':_0x252ea9,'isJourneyLocal':_0x21b267,'definition':_0x3504a8};}catch(_0x253074){return logger[_0x2a1bf7(0x1ab)](_0x2a1bf7(0x1f8)+_0x222740+':\x20'+_0x253074),{'name':_0x222740,'isJourneyLocal':![]};}},'resolveActivation':async _0x18ffec=>{const _0x4386f2=a140_0x4f0a,_0x423ae3=_0x3db4b4['get'](_0x18ffec);if(_0x423ae3!==undefined)return{'name':_0x423ae3,'isJourneyLocal':!![]};try{let _0x3560c9=_0x62af03?.[_0x4386f2(0x160)](_0x18ffec);!_0x3560c9&&(_0x3560c9=await _0x4aadab[_0x4386f2(0x151)][_0x4386f2(0x200)](_0x1ff7ee,_0x18ffec));const _0x5ec4ba=_0x3560c9['attributes'][_0x4386f2(0x222)][_0x4386f2(0x1d5)]||_0x18ffec,_0x28defd=sanitizeYamlKey(_0x5ec4ba)||_0x4386f2(0x1b3)+_0x18ffec,_0xb4da72=_0x28defd;_0x3db4b4[_0x4386f2(0x1cf)](_0x18ffec,_0xb4da72);const _0x2c7db3=journeyActivationStepToYaml(_0x3560c9,_0x5df8f6,_0x2a369e);return{'name':_0xb4da72,'isJourneyLocal':!![],'definition':_0x2c7db3};}catch(_0x29d0d5){return logger[_0x4386f2(0x1ab)](_0x4386f2(0x1f1)+_0x18ffec+':\x20'+_0x29d0d5),{'name':_0x18ffec,'isJourneyLocal':![]};}},'resolveJumpTarget':(_0x32a5ff,_0x178e07)=>resolveJumpTarget(_0x32a5ff,_0x178e07,_0x142767,async _0x18f45e=>{const _0x5badbe=a140_0x4f0a,_0x215ed0=_0x3ee8ba?.[_0x5badbe(0x160)](_0x18f45e);if(_0x215ed0)return _0x215ed0;return _0x4aadab[_0x5badbe(0x151)]['getJourney'](_0x18f45e);})};return _0xd8ba13=_0x298a0d,_0x298a0d;},_0x1de0ab=async _0x515b5e=>{const _0x1ce280=a140_0x4f0a,{collectSegmentIdsFromJourneyApi:_0x30631c}=await import(_0x1ce280(0x242)),{batchAsync:_0x43a660}=await import('../../utils/async.js'),_0x246778=new Set();for(const _0x5d115c of _0x515b5e){let _0x1385b4=_0x3ee8ba?.['get'](_0x5d115c);!_0x1385b4&&(_0x1385b4=await _0x4aadab[_0x1ce280(0x151)][_0x1ce280(0x175)](_0x5d115c));const _0x47becf=_0x30631c(_0x1385b4);for(const _0xba54e5 of _0x47becf){_0x246778[_0x1ce280(0x1c7)](_0xba54e5);}}let _0x5da523=Array[_0x1ce280(0x237)](_0x246778);while(_0x5da523[_0x1ce280(0x1b5)]>0x0){const _0x1a0779=_0x5da523[_0x1ce280(0x177)](_0x205635=>!_0x124d5b[_0x1ce280(0x1aa)](_0x205635));if(_0x1a0779['length']===0x0)break;const _0x645f7f=await _0x43a660(_0x1a0779,async _0x24c012=>{const _0x55bfd4=_0x1ce280;_0x124d5b[_0x55bfd4(0x1c7)](_0x24c012);const _0x5cd8da=await fetchSegment(_0x4aadab,_0x8a72c0,_0x24c012,_0x51c00f);if(!_0x5cd8da)return null;return{'segmentId':_0x24c012,'segment':_0x5cd8da};},0xa),_0x31e474=new Set();for(const _0x11e3c1 of _0x645f7f){if(!_0x11e3c1?.[_0x1ce280(0x150)]?.[_0x1ce280(0x20b)])continue;const _0x97e340=apiRuleToYaml(_0x11e3c1[_0x1ce280(0x150)][_0x1ce280(0x20b)]);_0x2e6e0a[_0x1ce280(0x1cf)](_0x11e3c1['segmentId'],_0x97e340);const _0x363197=collectSegmentRefsFromRule(_0x97e340);for(const _0x3ebafa of _0x363197){!_0x124d5b[_0x1ce280(0x1aa)](_0x3ebafa)&&_0x31e474[_0x1ce280(0x1c7)](_0x3ebafa);}}_0x5da523=Array[_0x1ce280(0x237)](_0x31e474);}};return{'createYamlContext':_0x59473f,'prefetchJourneySegments':_0x1de0ab};}export async function executePushSegments(_0x2db870,_0x17b4f0,_0x2cea84,_0x59b582,_0x5cb974){const _0x585387=a140_0x2d1abb,{segmentDefToCreateRequest:_0x5bfaec,segmentDefToUpdateRequest:_0x5066cb}=await import('./child-segment-yaml.js'),_0x11c5a4=_0x2cea84['folderPathToId'],_0x586c3d=0x5,_0x958009=async _0x33a806=>{const _0x17401c=a140_0x4f0a,_0x3064e2=_0x33a806[_0x17401c(0x191)]?_0x11c5a4['get'](_0x33a806[_0x17401c(0x191)]):undefined;let _0x15b927;const _0x5579ba={'created':0x0,'updated':0x0,'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};let _0x1c370e=_0x33a806['yamlConfig'];if(_0x33a806['yamlConfig']['rule']){const _0x3133be=createSegmentIdResolver(_0x2cea84['segmentNameToId'],_0x33a806[_0x17401c(0x165)]['name']),_0x29c13a=await resolveRuleSegmentIds(_0x33a806[_0x17401c(0x165)][_0x17401c(0x20b)],_0x3133be);_0x1c370e={..._0x33a806['yamlConfig'],'rule':_0x29c13a};}try{if(_0x33a806['isNew']){_0x5cb974['onProgress']?.({'type':_0x17401c(0x178),'name':_0x33a806[_0x17401c(0x165)][_0x17401c(0x1d5)]});const _0x113d0a=_0x5bfaec(_0x1c370e,_0x3064e2),_0x30356c=await _0x5cb974[_0x17401c(0x19e)](_0x17401c(0x159)+_0x33a806['yamlConfig']['name']+'\x27...',()=>_0x2db870[_0x17401c(0x150)][_0x17401c(0x1cc)](_0x59b582[_0x17401c(0x1c5)],_0x113d0a));_0x15b927=_0x30356c[_0x17401c(0x21c)]['id'],_0x2cea84[_0x17401c(0x1f6)][_0x17401c(0x1cf)](_0x33a806[_0x17401c(0x165)]['name'],_0x15b927),_0x5579ba[_0x17401c(0x15d)]={'name':_0x33a806[_0x17401c(0x165)]['name'],'id':_0x15b927},_0x5cb974[_0x17401c(0x236)]?.({'type':'segment_created','name':_0x33a806[_0x17401c(0x165)][_0x17401c(0x1d5)],'segmentId':_0x15b927}),_0x5cb974[_0x17401c(0x1de)]?.(_0x17401c(0x1d8)+_0x33a806[_0x17401c(0x165)]['name']+'\x27'),_0x5579ba['created']=0x1;}else{if(_0x33a806[_0x17401c(0x21d)]){_0x5cb974[_0x17401c(0x236)]?.({'type':_0x17401c(0x210),'name':_0x33a806['yamlConfig'][_0x17401c(0x1d5)]});const _0x3e498c=_0x5066cb(_0x1c370e);_0x3064e2!==_0x33a806[_0x17401c(0x22c)]?.['segmentFolderId']&&(_0x3e498c[_0x17401c(0x1e8)]=_0x3064e2?parseInt(_0x3064e2,0xa):undefined),await _0x5cb974[_0x17401c(0x19e)]('Updating\x20segment\x20\x27'+_0x33a806[_0x17401c(0x165)][_0x17401c(0x1d5)]+_0x17401c(0x1d0),()=>_0x2db870[_0x17401c(0x150)][_0x17401c(0x1e2)](_0x59b582['parentId'],_0x33a806[_0x17401c(0x22c)]['id'],_0x3e498c)),_0x15b927=_0x33a806[_0x17401c(0x22c)]['id'],_0x5cb974[_0x17401c(0x236)]?.({'type':_0x17401c(0x195),'name':_0x33a806[_0x17401c(0x165)]['name']}),_0x5cb974[_0x17401c(0x1de)]?.('Updated\x20segment\x20\x27'+_0x33a806[_0x17401c(0x165)][_0x17401c(0x1d5)]+'\x27'),_0x5579ba['updated']=0x1;}else _0x15b927=_0x33a806['existingSegment']['id'];}}catch(_0x3a332f){const _0x49916d=isHttp400Error(_0x3a332f),_0x4d876e=_0x49916d?ErrorCode[_0x17401c(0x229)]:ErrorCode[_0x17401c(0x1eb)],_0x51ddc6=getErrorMessage(_0x3a332f);throw new SDKError(_0x4d876e,_0x17401c(0x14f)+(_0x33a806[_0x17401c(0x17b)]?'create':_0x17401c(0x1db))+'\x20segment\x20from\x20file:\x20'+_0x33a806[_0x17401c(0x238)]+_0x17401c(0x1ff)+_0x51ddc6,_0x3a332f);}try{const _0x3cf4ea=await syncActivationsForSegment(_0x2db870,_0x59b582[_0x17401c(0x1c5)],_0x15b927,_0x33a806[_0x17401c(0x165)][_0x17401c(0x1d5)],_0x33a806['activationActions'],_0x5cb974,_0x33a806[_0x17401c(0x238)]);_0x5579ba[_0x17401c(0x167)]=_0x3cf4ea;}catch(_0x2a4272){if(_0x2a4272 instanceof SDKError)throw _0x2a4272;throw new SDKError(ErrorCode['ACTIVATION_UPDATE_ERROR'],_0x17401c(0x196)+_0x33a806['yamlConfig'][_0x17401c(0x1d5)]+_0x17401c(0x155)+_0x33a806[_0x17401c(0x238)]+'\x0a\x20\x20'+getErrorMessage(_0x2a4272),_0x2a4272);}return _0x5579ba;},_0x46d311=await batchAsync(_0x17b4f0,_0x958009,_0x586c3d),_0x23aefe={'created':0x0,'updated':0x0,'deleted':0x0,'createdSegmentIds':new Map(),'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};for(const _0x50617a of _0x46d311){_0x23aefe[_0x585387(0x1b9)]+=_0x50617a[_0x585387(0x1b9)],_0x23aefe[_0x585387(0x239)]+=_0x50617a['updated'],_0x50617a['createdSegmentId']&&_0x23aefe['createdSegmentIds'][_0x585387(0x1cf)](_0x50617a[_0x585387(0x15d)]['name'],_0x50617a[_0x585387(0x15d)]['id']),_0x23aefe[_0x585387(0x167)][_0x585387(0x1b9)]+=_0x50617a[_0x585387(0x167)][_0x585387(0x1b9)],_0x23aefe[_0x585387(0x167)][_0x585387(0x239)]+=_0x50617a[_0x585387(0x167)][_0x585387(0x239)],_0x23aefe[_0x585387(0x167)]['deleted']+=_0x50617a[_0x585387(0x167)]['deleted'];}return _0x23aefe;}function a140_0x51ab(){const _0x1afac0=['activation_template_id','created','find','uniqueServerName','errors','versionNumber','embedded_activation_created','existingSegments','712782jVKtkV','Delete\x20the\x20push\x20recovery\x20file\x20(','journey_entry_criteria_','action','\x27\x20not\x20found\x20in\x20parent\x20segment\x20(referenced\x20in\x20jump\x20step\x20of\x20\x27','parentId','deps','add','segments','all','journey_creating','list','createSegment','getSegment','activation_deleted','set','\x27...','stages','effectiveFolderId','Failed\x20to\x20fetch\x20referenced\x20segment\x20','utf-8','name','../../utils/async.js','map','Created\x20segment\x20\x27','Matched\x20server\x20segment\x20\x27','getSegment\x20failed\x20for\x20','update','segmentByFolderAndName','nameToId','logSuccess','WaitStep','parse','Deleted\x20segment\x20\x27','updateSegmentById','state','notification','415410ryPIum','conditions','dirname','segmentFolderId','__pending_act_','entries','SEGMENT_UPDATE_ERROR','schedule','conditionTimeoutUnit','9INAozO','buildUserMaps','\x27\x20not\x20found\x20in\x20journey\x20\x27','Failed\x20to\x20resolve\x20activation\x20','\x27\x20decision\x20point\x20branch\x20\x27','embedded_segment_creating','journeyBundleName','Entry\x20criteria:\x20','segmentNameToId','conditionSegmentId','Failed\x20to\x20resolve\x20segment\x20','toString','journeyBundlesByFolderAndName','milestone','Deleting\x20activation\x20\x27','updateActivation','journeyId','\x0a\x20\x20','getActivation','reduce','journeyStages','journeys','resolvedRule','./child-segment-yaml.js','decision_point','getSegmentEntity\x20also\x20failed\x20for\x20','Cannot\x20create\x20embedded\x20segment\x20for\x20existing\x20journey\x20without\x20journey\x20ID','idToName','waitStep','rule','localName','\x27\x20exit\x20criteria','\x20journey\x20from\x20file:\x20','activationsBySegmentId','segment_updating','toISOString','null','valid','Fetching\x20','uniqueSegmentName',',\x20falling\x20back\x20to\x20getSegmentEntity:\x20','__pending_','parseDocument','Segment\x20not\x20found:\x20','journeyActivationStepId','.$1.push-recovery.json','data','hasChanges','with','stringify','rootFolderId','waitStepUnit','activationParams','some','yamlActivation','attributes','journeyById','Creating\x20activation\x20\x27','NOT_FOUND','SEGMENT_SYNTAX_ERROR','match','delete','existingSegment','Activation','resolveSegment','Duration','Created\x20journey\x20\x27','segmentId','entry_criteria','INTERNAL','object','849352IOMVhQ','onProgress','from','absolutePath','updated','activationStepsById','ACTIVATION_SYNTAX_ERROR','\x27\x20for\x20','existingJourney','relative','existingActivation','logDeleted','unchanged','./journey-yaml.js','push','keys','branches','sha1','activationContext','progress','stage\x20\x27','Failed\x20to\x20','segment','journey','\x20(referenced\x20in\x20embedded\x20segment\x20\x27','\x20(referenced\x20in\x20journey\x20','416982WnlcAv','\x27\x20from\x20file:\x20','index','journeyBundleId',').\x20','Creating\x20segment\x20\x27','Updated\x20activation\x20\x27','getLatestJourneyId','8871TzfNeT','createdSegmentId','columns','entry','get','connection','SEGMENT_NOT_FOUND','toLowerCase','flatMap','yamlConfig','844690IoytUh','activations','folder','diff','\x20activation\x20\x27','entryCriteria','segment_deleting','resolveJourneyId','\x27\x20entry\x20criteria','run_after_journey_refresh','description','Journey\x20\x27','embedded_activation_creating','Cannot\x20create\x20embedded\x20activation\x20without\x20journey\x20context','folderId','getJourney','sort','filter','segment_creating','nameToType','journeyName','isNew','waitStepType','slice','validatedRequest','and\x20the\x20server\x20segment,\x20then\x20retry.','replace','join','goal','Define\x20it\x20in\x20the\x20journey\x27s\x20\x27activations\x27\x20section\x20or\x20use\x20an\x20existing\x20activation\x20ID.','behavior','create','all_columns','item','steps','isArray','user','size','journey_updated','folderPathToId','idToEmailMap','Segment\x20not\x20found','exitCriterias','folderPath','):\x20','\x27\x20to\x20local\x20\x27','relationships','segment_updated','Failed\x20to\x20sync\x20activations\x20for\x20segment\x20\x27','conditionTimeoutDuration','DecisionPoint','\x20error(s)','startsWith','14ZYSaFR','parentFolder','type','withProgress','Created\x20folder\x20\x27','Creating\x20folder\x20\x27','journey_created','connectionIdToNameMap','deleted','includes','folder_creating','listActivations','max','connector_config','activation_created','has','debug','goal\x20criteria','Condition','getSegmentEntity','hex','split','message','embedded_segment_created','activation_','804688eqDjus','length','\x27\x20wait\x20condition','12PGyFhm'];a140_0x51ab=function(){return _0x1afac0;};return a140_0x51ab();}async function syncActivationsForSegment(_0x1a1fbb,_0x2b34ea,_0x49189b,_0x59c08f,_0x473116,_0x31d39c,_0x44dd7f){const _0x5a2040=a140_0x2d1abb,_0x6fc63a={'created':0x0,'updated':0x0,'deleted':0x0};for(const _0x1d8e05 of _0x473116){try{if(_0x1d8e05[_0x5a2040(0x19d)]===_0x5a2040(0x185)&&_0x1d8e05['validatedRequest'])_0x31d39c[_0x5a2040(0x236)]?.({'type':'activation_creating','segmentName':_0x59c08f,'activationName':_0x1d8e05['name']}),await _0x31d39c[_0x5a2040(0x19e)](_0x5a2040(0x227)+_0x1d8e05[_0x5a2040(0x1d5)]+_0x5a2040(0x1d0),()=>_0x1a1fbb[_0x5a2040(0x150)]['createActivation'](_0x2b34ea,_0x49189b,_0x1d8e05[_0x5a2040(0x17e)])),_0x31d39c['onProgress']?.({'type':_0x5a2040(0x1a9),'segmentName':_0x59c08f,'activationName':_0x1d8e05[_0x5a2040(0x1d5)]}),_0x31d39c[_0x5a2040(0x1de)]?.('Created\x20activation\x20\x27'+_0x1d8e05[_0x5a2040(0x1d5)]+'\x27'),_0x6fc63a['created']++;else{if(_0x1d8e05[_0x5a2040(0x19d)]===_0x5a2040(0x1db)&&_0x1d8e05['validatedRequest']&&_0x1d8e05[_0x5a2040(0x23f)])_0x31d39c[_0x5a2040(0x236)]?.({'type':'activation_updating','segmentName':_0x59c08f,'activationName':_0x1d8e05[_0x5a2040(0x1d5)]}),await _0x31d39c[_0x5a2040(0x19e)]('Updating\x20activation\x20\x27'+_0x1d8e05[_0x5a2040(0x1d5)]+_0x5a2040(0x1d0),()=>_0x1a1fbb['segment'][_0x5a2040(0x1fd)](_0x2b34ea,_0x49189b,_0x1d8e05['existingActivation']['id'],_0x1d8e05[_0x5a2040(0x17e)])),_0x31d39c[_0x5a2040(0x236)]?.({'type':'activation_updated','segmentName':_0x59c08f,'activationName':_0x1d8e05[_0x5a2040(0x1d5)]}),_0x31d39c[_0x5a2040(0x1de)]?.(_0x5a2040(0x15a)+_0x1d8e05[_0x5a2040(0x1d5)]+'\x27'),_0x6fc63a[_0x5a2040(0x239)]++;else _0x1d8e05[_0x5a2040(0x19d)]==='delete'&&_0x1d8e05['existingActivation']&&(_0x31d39c['onProgress']?.({'type':'activation_deleting','segmentName':_0x59c08f,'activationName':_0x1d8e05[_0x5a2040(0x1d5)]}),await _0x31d39c[_0x5a2040(0x19e)](_0x5a2040(0x1fc)+_0x1d8e05[_0x5a2040(0x1d5)]+_0x5a2040(0x1d0),()=>_0x1a1fbb[_0x5a2040(0x150)]['deleteActivation'](_0x2b34ea,_0x49189b,_0x1d8e05[_0x5a2040(0x23f)]['id'])),_0x31d39c[_0x5a2040(0x236)]?.({'type':_0x5a2040(0x1ce),'segmentName':_0x59c08f,'activationName':_0x1d8e05[_0x5a2040(0x1d5)]}),_0x31d39c['logDeleted']?.('Deleted\x20activation\x20\x27'+_0x1d8e05[_0x5a2040(0x1d5)]+'\x27'),_0x6fc63a[_0x5a2040(0x1a3)]++);}}catch(_0x57d6ae){const _0x21039c=isHttp400Error(_0x57d6ae),_0x4cfeff=_0x21039c?ErrorCode[_0x5a2040(0x23b)]:ErrorCode['ACTIVATION_UPDATE_ERROR'],_0x2066db=getErrorMessage(_0x57d6ae);throw new SDKError(_0x4cfeff,_0x5a2040(0x14f)+_0x1d8e05[_0x5a2040(0x19d)]+_0x5a2040(0x16a)+_0x1d8e05[_0x5a2040(0x1d5)]+_0x5a2040(0x155)+_0x44dd7f+'\x0a\x20\x20'+_0x2066db,_0x57d6ae);}}return _0x6fc63a;}export async function executePushFolders(_0x56d0ae,_0x104bce,_0x422fd6,_0xeb6456,_0x4f884c){const _0x197eb6=a140_0x2d1abb,_0x7ddd99=new Map(_0x422fd6),_0x458dba=sortFoldersByDepth(_0x104bce);for(const _0x11b9d7 of _0x458dba){const _0x24a056=_0x11b9d7[_0x197eb6(0x1b0)]('/'),_0x454033=_0x24a056[_0x24a056[_0x197eb6(0x1b5)]-0x1],_0x76f9bf=_0x24a056[_0x197eb6(0x17d)](0x0,-0x1)[_0x197eb6(0x181)]('/'),_0x5a8a2b=_0x7ddd99[_0x197eb6(0x160)](_0x76f9bf);_0x4f884c[_0x197eb6(0x236)]?.({'type':_0x197eb6(0x1a5),'folder':_0x11b9d7});const _0x15cb42={'name':_0x454033,'parentFolderId':_0x5a8a2b},_0x1f523d=await _0x4f884c[_0x197eb6(0x19e)](_0x197eb6(0x1a0)+_0x11b9d7+_0x197eb6(0x1d0),()=>_0x56d0ae[_0x197eb6(0x150)]['createFolder'](_0xeb6456[_0x197eb6(0x1c5)],_0x15cb42));_0x7ddd99[_0x197eb6(0x1cf)](_0x11b9d7,_0x1f523d['data']['id']),_0x4f884c[_0x197eb6(0x236)]?.({'type':'folder_created','folder':_0x11b9d7,'folderId':_0x1f523d[_0x197eb6(0x21c)]['id']}),_0x4f884c['logInfo']?.(_0x197eb6(0x19f)+_0x11b9d7+'\x27');}return _0x7ddd99;}export async function executePushSegmentDeletions(_0x45fe71,_0x265f65,_0x53ff29){const _0x56a621=a140_0x2d1abb;if(_0x265f65[_0x56a621(0x1b5)]===0x0)return 0x0;const {batchAsync:_0x2903f9}=await import('../../utils/async.js'),_0x26a33e=0x5,_0x2caf2d=await _0x2903f9(_0x265f65,async _0x1a458f=>{const _0x135020=_0x56a621;return _0x53ff29[_0x135020(0x236)]?.({'type':_0x135020(0x16c),'name':_0x1a458f[_0x135020(0x1d5)]}),await _0x45fe71['segment']['deleteSegment'](_0x1a458f['id']),_0x53ff29[_0x135020(0x236)]?.({'type':'segment_deleted','name':_0x1a458f[_0x135020(0x1d5)]}),_0x53ff29[_0x135020(0x240)]?.(_0x135020(0x1e1)+_0x1a458f[_0x135020(0x1d5)]+'\x27'),0x1;},_0x26a33e);return _0x2caf2d[_0x56a621(0x201)]((_0x21dfd3,_0x46b920)=>_0x21dfd3+_0x46b920,0x0);}export async function executePushJourneys(_0x422c5a,_0xf0cbf4,_0x24bad8,_0x371d6f,_0x352bf1){const _0xc0d044=a140_0x2d1abb,{journeyDefToRequest:_0x542d8b}=await import(_0xc0d044(0x242)),{activationDefToCreateRequest:_0x25d752,yamlRuleToApi:_0x50a650,validateSegmentRule:_0x8f4a56}=await import(_0xc0d044(0x205)),_0x2f1459={'results':[],'created':0x0,'updated':0x0,'embeddedSegmentNameToId':new Map()},_0x16e4f5=new Map(_0x24bad8[_0xc0d044(0x1f6)]),_0xd8b572=0x5;for(let _0x477b13=0x0;_0x477b13<_0xf0cbf4[_0xc0d044(0x1b5)];_0x477b13+=_0xd8b572){const _0x12e8c7=_0xf0cbf4[_0xc0d044(0x17d)](_0x477b13,_0x477b13+_0xd8b572),_0x17efab=await Promise[_0xc0d044(0x1c9)](_0x12e8c7['map'](async _0x392b7f=>{const _0x1fa314=_0xc0d044;if(!_0x392b7f[_0x1fa314(0x17b)]&&!_0x392b7f[_0x1fa314(0x21d)])return{'action':_0x1fa314(0x241),'name':_0x392b7f[_0x1fa314(0x165)][_0x1fa314(0x1d5)],'journeyId':_0x392b7f[_0x1fa314(0x23d)]?.['id']};const _0x2e74ca=_0x392b7f[_0x1fa314(0x191)]?_0x24bad8[_0x1fa314(0x18d)][_0x1fa314(0x160)](_0x392b7f[_0x1fa314(0x191)]):undefined;_0x352bf1[_0x1fa314(0x236)]?.({'type':_0x392b7f[_0x1fa314(0x17b)]?_0x1fa314(0x1ca):'journey_updating','name':_0x392b7f[_0x1fa314(0x165)][_0x1fa314(0x1d5)]});try{const _0x34dd79=await executeSingleJourneyPush(_0x422c5a,_0x392b7f,{..._0x24bad8,'segmentNameToId':_0x16e4f5},{'parentId':_0x371d6f[_0x1fa314(0x1c5)],'rootFolderId':_0x371d6f['rootFolderId'],'folderId':_0x2e74ca,'verbose':_0x371d6f['verbose']},_0x352bf1,{'journeyDefToRequest':_0x542d8b,'activationDefToCreateRequest':_0x25d752,'yamlRuleToApi':_0x50a650,'validateSegmentRule':_0x8f4a56});for(const [_0x495e7f,_0x22a25d]of _0x34dd79['embeddedSegmentNameToId']){_0x16e4f5['set'](_0x495e7f,_0x22a25d),_0x2f1459['embeddedSegmentNameToId'][_0x1fa314(0x1cf)](_0x495e7f,_0x22a25d);}if(_0x34dd79[_0x1fa314(0x1c3)]===_0x1fa314(0x1b9))_0x352bf1[_0x1fa314(0x236)]?.({'type':_0x1fa314(0x1a1),'name':_0x392b7f[_0x1fa314(0x165)]['name'],'journeyId':_0x34dd79[_0x1fa314(0x1fe)]}),_0x352bf1[_0x1fa314(0x1de)]?.(_0x1fa314(0x230)+_0x392b7f['yamlConfig']['name']+'\x27'),_0x2f1459[_0x1fa314(0x1b9)]++;else _0x34dd79[_0x1fa314(0x1c3)]==='updated'&&(_0x352bf1['onProgress']?.({'type':_0x1fa314(0x18c),'name':_0x392b7f[_0x1fa314(0x165)][_0x1fa314(0x1d5)]}),_0x352bf1['logSuccess']?.('Updated\x20journey\x20\x27'+_0x392b7f[_0x1fa314(0x165)][_0x1fa314(0x1d5)]+'\x27'),_0x2f1459[_0x1fa314(0x239)]++);return{'action':_0x34dd79[_0x1fa314(0x1c3)],'name':_0x392b7f['yamlConfig']['name'],'journeyId':_0x34dd79['journeyId']};}catch(_0x2d691c){const _0x3cb103=isHttp400Error(_0x2d691c),_0x6b2dd1=_0x3cb103?ErrorCode['JOURNEY_SYNTAX_ERROR']:ErrorCode['JOURNEY_UPDATE_ERROR'],_0x38401a=getErrorMessage(_0x2d691c);throw new SDKError(_0x6b2dd1,_0x1fa314(0x14f)+(_0x392b7f[_0x1fa314(0x17b)]?_0x1fa314(0x185):'update')+_0x1fa314(0x20e)+_0x392b7f['absolutePath']+_0x1fa314(0x1ff)+_0x38401a,_0x2d691c);}}));_0x2f1459['results'][_0xc0d044(0x243)](..._0x17efab);}return _0x2f1459;}async function matchExistingJourneySegments(_0x2f801a,_0xcec73c,_0x424d44,_0x739473,_0x5a1d4f){const _0x21c268=a140_0x2d1abb;if(!_0xcec73c['existingJourney']||!_0xcec73c[_0x21c268(0x165)]['segments'])return;const _0x18845b=new Map(),_0x299fb1=new Set();for(const _0x33c3a4 of Object[_0x21c268(0x244)](_0xcec73c[_0x21c268(0x165)]['segments'])){const _0x33a138=generateDeterministicJourneySegmentName(_0xcec73c['yamlConfig'][_0x21c268(0x1d5)],_0x33c3a4);_0x18845b['set'](_0x33a138,_0x33c3a4),_0x299fb1[_0x21c268(0x1c7)](_0x33c3a4);}const _0x9e0f06=[],_0x30ba1d=collectSegmentIdsFromJourneyApi(_0xcec73c['existingJourney']);for(const _0x47a7f7 of _0x30ba1d){const _0x598d31=await fetchSegment(_0x2f801a,_0x424d44,_0x47a7f7,_0x739473);if(!_0x598d31?.[_0x21c268(0x1d5)])continue;const _0x27b2f4=_0x18845b[_0x21c268(0x160)](_0x598d31[_0x21c268(0x1d5)]);_0x27b2f4?(_0x5a1d4f[_0x21c268(0x1cf)](_0x27b2f4,_0x47a7f7),_0x299fb1[_0x21c268(0x22b)](_0x27b2f4)):_0x9e0f06[_0x21c268(0x243)]({'id':_0x47a7f7,'seg':_0x598d31});}if(_0x299fb1['size']>0x0&&_0x9e0f06[_0x21c268(0x1b5)]>0x0){const {localExpandedRuleToNames:_0x762289}=buildLocalExpandedRuleMappings(_0xcec73c[_0x21c268(0x165)]),_0x53c317=new Map();for(const {id:_0x8853de,seg:_0x16d7e6}of _0x9e0f06){if(_0x16d7e6[_0x21c268(0x20b)]){const _0x42fa3a=apiRuleToYaml(_0x16d7e6['rule']);_0x53c317[_0x21c268(0x1cf)](_0x8853de,_0x42fa3a);}}for(const {id:_0x11564a,seg:_0x286c72}of _0x9e0f06){if(!_0x286c72[_0x21c268(0x20b)])continue;const _0x59f468=_0x53c317[_0x21c268(0x160)](_0x11564a);if(!_0x59f468)continue;const _0x27c421=serializeExpandedRule(_0x59f468,_0x53c317),_0x2d6227=_0x762289[_0x21c268(0x160)](_0x27c421);if(_0x2d6227){const _0x137b96=_0x2d6227[_0x21c268(0x1ba)](_0x1ff765=>_0x299fb1[_0x21c268(0x1aa)](_0x1ff765));_0x137b96&&(_0x5a1d4f[_0x21c268(0x1cf)](_0x137b96,_0x11564a),_0x299fb1[_0x21c268(0x22b)](_0x137b96),logger[_0x21c268(0x1ab)](_0x21c268(0x1d9)+_0x286c72['name']+_0x21c268(0x193)+_0x137b96+'\x27\x20by\x20rule\x20content'));}}}}async function executeSingleJourneyPush(_0x2ff1ad,_0x4f93a4,_0x402972,_0xbc529b,_0x2ed66f,_0x384307){const _0x41f5a8=a140_0x2d1abb,{journeyDefToRequest:_0x4c4505,activationDefToCreateRequest:_0x1cbb8d,yamlRuleToApi:_0x3afb3c,validateSegmentRule:_0x311b03}=_0x384307,_0x1e756c=new Map(),_0x3b590a=new Map();recoverSegmentIdsFromPushRecovery(_0x4f93a4,_0x1e756c,_0x402972[_0x41f5a8(0x1f6)]);const _0x1854fb=new Map(),_0x14c923=new Map(),_0x2de651=new Map();let _0x487e4b;const _0x5ad461=async()=>{const _0x56ab5b=_0x41f5a8;if(_0x487e4b)return;_0x487e4b=new Map();if(!_0x4f93a4['existingJourney'])return;const _0x593658=await _0x2ff1ad[_0x56ab5b(0x151)]['listActivations'](_0x4f93a4['existingJourney']['id']);for(const _0x893df8 of _0x593658){const _0x3c8bf6=journeyActivationStepToYaml(_0x893df8,_0x402972[_0x56ab5b(0x18e)],_0x402972[_0x56ab5b(0x1a2)]),_0x1dc45f=activationSignature(_0x3c8bf6);!_0x487e4b[_0x56ab5b(0x1aa)](_0x1dc45f)&&_0x487e4b[_0x56ab5b(0x1cf)](_0x1dc45f,_0x893df8['id']),_0x3c8bf6['name']&&_0x3b590a[_0x56ab5b(0x1cf)](_0x3c8bf6['name'],_0x893df8['id']);}};await matchExistingJourneySegments(_0x2ff1ad,_0x4f93a4,_0xbc529b[_0x41f5a8(0x1c5)],_0x402972[_0x41f5a8(0x1bf)],_0x402972[_0x41f5a8(0x1f6)]);const _0x5baa20={'resolveSegmentId':async _0x386661=>{const _0x5cac0d=_0x41f5a8,_0x22443b=_0x402972[_0x5cac0d(0x1f6)][_0x5cac0d(0x160)](_0x386661);if(!_0x22443b)throw new SDKError(ErrorCode[_0x5cac0d(0x162)],_0x5cac0d(0x219)+_0x386661+_0x5cac0d(0x153)+_0x4f93a4[_0x5cac0d(0x165)][_0x5cac0d(0x1d5)]+')');return _0x22443b;},'resolveEmbeddedSegmentId':async(_0x9ac6f5,_0xd39e8f)=>{const _0x23650e=_0x41f5a8,_0x346da2=_0x402972['segmentNameToId'][_0x23650e(0x160)](_0x9ac6f5);if(_0x346da2)return _0x346da2;const _0x480a40=_0x402972[_0x23650e(0x1bf)][_0x23650e(0x1ba)](_0x168899=>_0x168899['name']===_0x9ac6f5);if(_0x480a40)return _0x402972[_0x23650e(0x1f6)][_0x23650e(0x1cf)](_0x9ac6f5,_0x480a40['id']),_0x480a40['id'];if(_0x4f93a4[_0x23650e(0x17b)]){const {stageName:_0x4fc723,criteriaName:_0x4370b3}=findSegmentCriteriaLocation(_0x4f93a4['yamlConfig'],_0x9ac6f5);return _0x311b03(_0x9ac6f5,_0xd39e8f[_0x23650e(0x20b)]),_0x14c923[_0x23650e(0x1cf)](_0x9ac6f5,{'definition':_0xd39e8f,'stageName':_0x4fc723,'criteriaName':_0x4370b3}),createPendingSegmentId(_0x9ac6f5);}const _0x21178c=_0x4f93a4[_0x23650e(0x23d)]?.['id'];if(!_0x21178c)throw new SDKError(ErrorCode[_0x23650e(0x233)],_0x23650e(0x208));const _0xee8fcc=_0x1854fb[_0x23650e(0x160)](_0x9ac6f5);if(_0xee8fcc)return _0xee8fcc;const _0x3aff13=((async()=>{const _0x5c536e=_0x23650e;_0x311b03(_0x9ac6f5,_0xd39e8f[_0x5c536e(0x20b)]);const _0x31ac52=generateDeterministicJourneySegmentName(_0x4f93a4[_0x5c536e(0x165)][_0x5c536e(0x1d5)],_0x9ac6f5),_0xb6f59a=_0x402972['existingSegments']['find'](_0x3ac0fa=>_0x3ac0fa[_0x5c536e(0x1d5)]===_0x31ac52),_0x46da20=createSegmentIdResolver(_0x402972[_0x5c536e(0x1f6)],_0x9ac6f5),_0xaf3574=await resolveRuleSegmentIds(_0xd39e8f[_0x5c536e(0x20b)],_0x46da20);let _0x91eeae;return _0xb6f59a?(await _0x2ff1ad[_0x5c536e(0x150)]['updateSegmentById'](_0xbc529b[_0x5c536e(0x1c5)],_0xb6f59a['id'],{'description':_0xd39e8f[_0x5c536e(0x170)]||_0x5c536e(0x1f5)+_0x9ac6f5,'rule':_0x3afb3c(_0xaf3574,!![]),'countPopulation':!![]}),_0x91eeae=_0xb6f59a['id'],saveSegmentToPushRecovery(_0x4f93a4[_0x5c536e(0x238)],_0x4f93a4[_0x5c536e(0x165)]['name'],_0x9ac6f5,{'segmentId':_0x91eeae,'uniqueServerName':_0x31ac52,'createdAt':new Date()[_0x5c536e(0x211)]()})):_0x91eeae=await createOrRecoverEmbeddedSegment(_0x2ff1ad,_0x4f93a4,{'localName':_0x9ac6f5,'uniqueSegmentName':_0x31ac52,'description':_0xd39e8f[_0x5c536e(0x170)]||_0x5c536e(0x1f5)+_0x9ac6f5,'journeyId':_0x21178c,'resolvedRule':_0xaf3574,'parentId':_0xbc529b['parentId'],'folderId':_0xbc529b[_0x5c536e(0x220)]||''},_0x3afb3c),_0x402972[_0x5c536e(0x1f6)][_0x5c536e(0x1cf)](_0x9ac6f5,_0x91eeae),_0x1e756c['set'](_0x9ac6f5,_0x91eeae),_0x91eeae;})());_0x1854fb[_0x23650e(0x1cf)](_0x9ac6f5,_0x3aff13);try{return await _0x3aff13;}finally{_0x1854fb[_0x23650e(0x22b)](_0x9ac6f5);}},'resolveActivationId':async _0x1967b0=>{const _0x2ea8b9=_0x41f5a8,_0x326ec6=_0x3b590a['get'](_0x1967b0);if(_0x326ec6)return _0x326ec6;if(_0x4f93a4[_0x2ea8b9(0x23d)]){await _0x5ad461();const _0x4b8147=_0x3b590a[_0x2ea8b9(0x160)](_0x1967b0);if(_0x4b8147)return _0x4b8147;}throw new SDKError(ErrorCode['NOT_FOUND'],'Activation\x20not\x20found:\x20'+_0x1967b0+_0x2ea8b9(0x153)+_0x4f93a4[_0x2ea8b9(0x165)][_0x2ea8b9(0x1d5)]+_0x2ea8b9(0x158)+_0x2ea8b9(0x183));},'resolveEmbeddedActivationId':async(_0x3d4489,_0x1a16f2)=>{const _0x361317=_0x41f5a8,_0x201fa1=_0x3b590a[_0x361317(0x160)](_0x3d4489);if(_0x201fa1)return _0x201fa1;if(_0x4f93a4[_0x361317(0x17b)])return _0x2de651[_0x361317(0x1cf)](_0x3d4489,_0x1a16f2),createPendingActivationId(_0x3d4489);if(_0x4f93a4[_0x361317(0x23d)]){await _0x5ad461();const _0x5f3291=_0x3b590a[_0x361317(0x160)](_0x1a16f2['name']);if(_0x5f3291)return _0x3b590a[_0x361317(0x1cf)](_0x3d4489,_0x5f3291),_0x5f3291;const _0x293018=activationSignature(_0x1a16f2),_0x2f532c=_0x487e4b?.[_0x361317(0x160)](_0x293018);if(_0x2f532c)return _0x3b590a[_0x361317(0x1cf)](_0x3d4489,_0x2f532c),_0x2f532c;const _0x1dc1ca=await _0x1cbb8d(_0x1a16f2,_0x402972['activationContext']),_0x3b36bd={..._0x1dc1ca,..._0x1a16f2['run_after_journey_refresh']!==undefined&&{'runAfterJourneyRefresh':_0x1a16f2[_0x361317(0x16f)]}},_0x2092b0=await _0x2ff1ad[_0x361317(0x151)]['createActivation'](_0x4f93a4[_0x361317(0x23d)]['id'],_0x3b36bd);return _0x3b590a[_0x361317(0x1cf)](_0x3d4489,_0x2092b0['id']),_0x2092b0['id'];}throw new SDKError(ErrorCode[_0x361317(0x233)],_0x361317(0x173));},'resolveJourneyId':async _0x14f080=>{const _0x3cd4ee=_0x41f5a8;try{return await _0x2ff1ad[_0x3cd4ee(0x151)][_0x3cd4ee(0x16d)](_0xbc529b[_0x3cd4ee(0x1c5)],_0x14f080);}catch(_0x1476e9){throw new SDKError(ErrorCode[_0x3cd4ee(0x228)],_0x3cd4ee(0x171)+_0x14f080+_0x3cd4ee(0x1c4)+_0x4f93a4[_0x3cd4ee(0x165)][_0x3cd4ee(0x1d5)]+'\x27)',_0x1476e9);}},'resolveStageId':async(_0x4ef880,_0x4c8961)=>{const _0x52485d=_0x41f5a8,_0x28e1dc=await _0x2ff1ad['journey'][_0x52485d(0x175)](_0x4ef880),_0x2d080e=_0x28e1dc[_0x52485d(0x225)][_0x52485d(0x202)]['find'](_0xe92646=>_0xe92646['name'][_0x52485d(0x163)]()===_0x4c8961[_0x52485d(0x163)]());if(!_0x2d080e?.['id'])throw new SDKError(ErrorCode[_0x52485d(0x228)],'Stage\x20\x27'+_0x4c8961+_0x52485d(0x1f0)+(_0x28e1dc[_0x52485d(0x225)][_0x52485d(0x1f4)]||_0x28e1dc[_0x52485d(0x225)]['name'])+'\x27');return _0x2d080e['id'];}},_0x6dd2a0=await _0x4c4505(_0x4f93a4['yamlConfig'],_0xbc529b[_0x41f5a8(0x1c5)],_0x5baa20),_0x1683d7=_0xbc529b['folderId']||_0xbc529b['rootFolderId'];_0x1683d7&&(_0x6dd2a0[_0x41f5a8(0x194)]={'parentFolder':{'data':{'id':_0x1683d7,'type':_0x41f5a8(0x168)}}});if(_0x4f93a4[_0x41f5a8(0x17b)]){if(_0x14c923['size']>0x0||_0x2de651[_0x41f5a8(0x18b)]>0x0)return await executeThreeStepJourneyCreate(_0x2ff1ad,_0x4f93a4,_0x6dd2a0,{'pendingEmbeddedSegments':_0x14c923,'pendingEmbeddedActivations':_0x2de651,'embeddedSegmentNameToId':_0x1e756c,'journeyActivationNameToId':_0x3b590a},{..._0xbc529b,'effectiveFolderId':_0x1683d7},_0x402972,_0x2ed66f,_0x384307);else{ensureJourneyDefaults(_0x6dd2a0[_0x41f5a8(0x225)]);const _0x4fe429=await _0x2ff1ad[_0x41f5a8(0x151)][_0x41f5a8(0x185)](_0x6dd2a0);return deletePushRecovery(_0x4f93a4['absolutePath']),{'action':_0x41f5a8(0x1b9),'journeyId':_0x4fe429['id'],'embeddedSegmentNameToId':_0x1e756c};}}else{if(_0x4f93a4[_0x41f5a8(0x21d)]&&_0x4f93a4[_0x41f5a8(0x23d)]){_0x6dd2a0['id']=_0x4f93a4[_0x41f5a8(0x23d)]['id'];const _0x3b9fe6=_0x6dd2a0[_0x41f5a8(0x225)];_0x4f93a4[_0x41f5a8(0x23d)][_0x41f5a8(0x225)]?.[_0x41f5a8(0x1f4)]&&(_0x3b9fe6[_0x41f5a8(0x1f4)]=_0x4f93a4['existingJourney']['attributes'][_0x41f5a8(0x1f4)]);const _0x4e2830=_0x4f93a4[_0x41f5a8(0x23d)][_0x41f5a8(0x225)]?.[_0x41f5a8(0x202)];return _0x4e2830&&_0x6dd2a0['attributes']['journeyStages']&&injectExistingStageIds(_0x6dd2a0[_0x41f5a8(0x225)][_0x41f5a8(0x202)],_0x4e2830),ensureJourneyDefaults(_0x3b9fe6),await _0x2ff1ad[_0x41f5a8(0x151)]['update'](_0x4f93a4[_0x41f5a8(0x23d)]['id'],_0x6dd2a0),deletePushRecovery(_0x4f93a4['absolutePath']),{'action':_0x41f5a8(0x239),'journeyId':_0x4f93a4['existingJourney']['id'],'embeddedSegmentNameToId':_0x1e756c};}}return deletePushRecovery(_0x4f93a4[_0x41f5a8(0x238)]),{'action':_0x41f5a8(0x241),'journeyId':_0x4f93a4[_0x41f5a8(0x23d)]?.['id'],'embeddedSegmentNameToId':_0x1e756c};}function findSegmentCriteriaLocation(_0xba82be,_0x5ee658){const _0x4228f6=a140_0x2d1abb,_0x3d318d=_0xba82be[_0x4228f6(0x1d1)]||_0xba82be['journeys']?.[0x0]?.[_0x4228f6(0x1d1)]||[];let _0x3616b2=_0x4228f6(0x15f),_0x2be877=_0x5ee658;const _0x7e2067=_0xba82be[_0x4228f6(0x182)]||_0xba82be[_0x4228f6(0x203)]?.[0x0]?.[_0x4228f6(0x182)];if(_0x7e2067?.[_0x4228f6(0x150)]===_0x5ee658)return{'stageName':_0x4228f6(0x182),'criteriaName':_0x7e2067[_0x4228f6(0x1d5)]||_0x5ee658};_0x1e965d:for(const _0xa31a07 of _0x3d318d){if(_0xa31a07[_0x4228f6(0x232)]?.[_0x4228f6(0x150)]===_0x5ee658){_0x3616b2=_0xa31a07[_0x4228f6(0x1d5)],_0x2be877=_0xa31a07[_0x4228f6(0x232)][_0x4228f6(0x1d5)]||_0x5ee658;break;}if(_0xa31a07[_0x4228f6(0x188)])for(const _0x1e2d56 of _0xa31a07[_0x4228f6(0x188)]){if(_0x1e2d56[_0x4228f6(0x19d)]===_0x4228f6(0x206)&&_0x1e2d56['with']?.[_0x4228f6(0x245)])for(const _0x431bf6 of _0x1e2d56[_0x4228f6(0x21e)][_0x4228f6(0x245)]){if(_0x431bf6[_0x4228f6(0x150)]===_0x5ee658){_0x3616b2=_0xa31a07['name'],_0x2be877=_0x431bf6[_0x4228f6(0x1d5)]||_0x5ee658;break _0x1e965d;}}}}return{'stageName':_0x3616b2,'criteriaName':_0x2be877};}async function executeThreeStepJourneyCreate(_0x5d6a16,_0x22519d,_0x58d146,_0x2562be,_0x54b9fb,_0x16bbbe,_0xe11df2,_0x1b40ff){const _0x5db076=a140_0x2d1abb,{activationDefToCreateRequest:_0x143f06,yamlRuleToApi:_0x541aa2}=_0x1b40ff,{pendingEmbeddedSegments:_0x2e7997,pendingEmbeddedActivations:_0x6ecc9c,embeddedSegmentNameToId:_0x59c92f}=_0x2562be,_0x1722e7=JSON[_0x5db076(0x1e0)](JSON[_0x5db076(0x21f)](_0x58d146));ensureJourneyDefaults(_0x1722e7[_0x5db076(0x225)]),stripPendingIds(_0x1722e7);const _0x4c0466=await _0x5d6a16[_0x5db076(0x151)][_0x5db076(0x185)](_0x1722e7),_0xa74da6=_0x4c0466['id'],_0x58dcba=new Map();for(const _0x3d8454 of _0x4c0466[_0x5db076(0x225)][_0x5db076(0x202)]){_0x58dcba[_0x5db076(0x1cf)](_0x3d8454[_0x5db076(0x1d5)][_0x5db076(0x163)](),_0x3d8454['id']);}recoverSegmentIdsFromPushRecovery(_0x22519d,_0x59c92f,_0x16bbbe[_0x5db076(0x1f6)]);for(const [_0x116796,{definition:_0x3a5045}]of _0x2e7997){if(_0x59c92f['has'](_0x116796)){_0xe11df2[_0x5db076(0x236)]?.({'type':_0x5db076(0x1b2),'journeyName':_0x22519d[_0x5db076(0x165)][_0x5db076(0x1d5)],'segmentName':_0x116796});continue;}const _0x59c9a6=generateDeterministicJourneySegmentName(_0x22519d[_0x5db076(0x165)][_0x5db076(0x1d5)],_0x116796);_0xe11df2[_0x5db076(0x236)]?.({'type':_0x5db076(0x1f3),'journeyName':_0x22519d[_0x5db076(0x165)][_0x5db076(0x1d5)],'segmentName':_0x116796});const _0x319b10=createSegmentIdResolver(_0x16bbbe[_0x5db076(0x1f6)],_0x116796),_0xa3fc80=await resolveRuleSegmentIds(_0x3a5045[_0x5db076(0x20b)],_0x319b10),_0x5522df=await createOrRecoverEmbeddedSegment(_0x5d6a16,_0x22519d,{'localName':_0x116796,'uniqueSegmentName':_0x59c9a6,'description':_0x3a5045['description']||_0x5db076(0x1f5)+_0x116796,'journeyId':_0xa74da6,'resolvedRule':_0xa3fc80,'parentId':_0x54b9fb[_0x5db076(0x1c5)],'folderId':_0x54b9fb[_0x5db076(0x1d2)]||''},_0x541aa2);_0x59c92f['set'](_0x116796,_0x5522df),_0x16bbbe[_0x5db076(0x1f6)]['set'](_0x116796,_0x5522df),_0xe11df2['onProgress']?.({'type':_0x5db076(0x1b2),'journeyName':_0x22519d[_0x5db076(0x165)][_0x5db076(0x1d5)],'segmentName':_0x116796});}const _0x2c74f5=new Map();for(const [_0x3b76ab,_0x4ecb8c]of _0x6ecc9c){_0xe11df2[_0x5db076(0x236)]?.({'type':_0x5db076(0x172),'journeyName':_0x22519d[_0x5db076(0x165)]['name'],'activationName':_0x3b76ab});const _0x29b32a=await _0x143f06(_0x4ecb8c,_0x16bbbe[_0x5db076(0x14c)]),_0x4eeaec={..._0x29b32a,..._0x4ecb8c[_0x5db076(0x16f)]!==undefined&&{'runAfterJourneyRefresh':_0x4ecb8c[_0x5db076(0x16f)]}},_0x30b3e8=await _0x5d6a16[_0x5db076(0x151)]['createActivation'](_0xa74da6,_0x4eeaec);_0x2c74f5['set'](_0x3b76ab,_0x30b3e8['id']),_0x2562be['journeyActivationNameToId'][_0x5db076(0x1cf)](_0x3b76ab,_0x30b3e8['id']),_0xe11df2[_0x5db076(0x236)]?.({'type':_0x5db076(0x1be),'journeyName':_0x22519d['yamlConfig'][_0x5db076(0x1d5)],'activationName':_0x3b76ab});}const _0x3d39b5=JSON['parse'](JSON[_0x5db076(0x21f)](_0x58d146));return _0x3d39b5['id']=_0xa74da6,ensureJourneyDefaults(_0x3d39b5['attributes']),resolvePendingIdsInRequest(_0x3d39b5,_0x58d146,_0x58dcba,_0x59c92f,_0x2c74f5,_0xe11df2),await _0x5d6a16[_0x5db076(0x151)][_0x5db076(0x1db)](_0xa74da6,_0x3d39b5),deletePushRecovery(_0x22519d[_0x5db076(0x238)]),{'action':'created','journeyId':_0xa74da6,'embeddedSegmentNameToId':_0x59c92f};}export function stripWaitStepPendingIds(_0x523c9e){const _0x312561=a140_0x2d1abb,_0x52b1d7=_0x523c9e[_0x312561(0x1f7)]&&isPendingSegmentId(_0x523c9e[_0x312561(0x1f7)]),_0x1fcddb=_0x523c9e[_0x312561(0x1e6)]?.[_0x312561(0x223)](_0x545a04=>_0x545a04[_0x312561(0x231)]&&isPendingSegmentId(_0x545a04[_0x312561(0x231)]));(_0x52b1d7||_0x1fcddb)&&(_0x523c9e[_0x312561(0x17c)]=_0x312561(0x22f),_0x523c9e[_0x312561(0x20a)]=0x1,_0x523c9e['waitStepUnit']='day',delete _0x523c9e[_0x312561(0x1f7)],delete _0x523c9e[_0x312561(0x197)],delete _0x523c9e[_0x312561(0x1ed)],delete _0x523c9e[_0x312561(0x1e6)]);}export function resolveWaitStepPendingIds(_0x24a381,_0x151831,_0x1fba93,_0xb71028){const _0x5200c1=a140_0x2d1abb;if(_0x151831[_0x5200c1(0x1f7)]&&isPendingSegmentId(_0x151831['conditionSegmentId'])){const _0xb9e29=_0x1fba93(_0x151831[_0x5200c1(0x1f7)],_0x5200c1(0x14e)+_0xb71028+_0x5200c1(0x1b6));_0xb9e29&&(_0x24a381[_0x5200c1(0x17c)]=_0x5200c1(0x1ad),_0x24a381['conditionSegmentId']=_0xb9e29,delete _0x24a381[_0x5200c1(0x20a)],delete _0x24a381['waitStepUnit'],_0x151831[_0x5200c1(0x197)]!==undefined&&(_0x24a381['conditionTimeoutDuration']=_0x151831[_0x5200c1(0x197)]),_0x151831[_0x5200c1(0x1ed)]&&(_0x24a381[_0x5200c1(0x1ed)]=_0x151831['conditionTimeoutUnit']));}if(_0x151831[_0x5200c1(0x1e6)]){const _0x9c5991=_0x151831[_0x5200c1(0x1e6)][_0x5200c1(0x223)](_0x2ef0f5=>_0x2ef0f5[_0x5200c1(0x231)]&&isPendingSegmentId(_0x2ef0f5['segmentId']));if(_0x9c5991){const _0xccf930=_0x151831[_0x5200c1(0x1e6)]['map'](_0x4cb27b=>{const _0x780141=_0x5200c1;if(_0x4cb27b[_0x780141(0x231)]&&isPendingSegmentId(_0x4cb27b['segmentId'])){const _0xd514c0=_0x1fba93(_0x4cb27b[_0x780141(0x231)],_0x780141(0x14e)+_0xb71028+_0x780141(0x1b6));return{..._0x4cb27b,'segmentId':_0xd514c0||_0x4cb27b[_0x780141(0x231)]};}return{..._0x4cb27b};});_0x24a381['waitStepType']='Condition',_0x24a381[_0x5200c1(0x1e6)]=_0xccf930,delete _0x24a381['waitStep'],delete _0x24a381[_0x5200c1(0x221)],delete _0x24a381['conditionSegmentId'],delete _0x24a381[_0x5200c1(0x197)],delete _0x24a381[_0x5200c1(0x1ed)];}}}function stripPendingIds(_0x4066f6){const _0x216f15=a140_0x2d1abb;_0x4066f6[_0x216f15(0x225)][_0x216f15(0x182)]?.['segmentId']&&isPendingSegmentId(_0x4066f6[_0x216f15(0x225)][_0x216f15(0x182)][_0x216f15(0x231)])&&delete _0x4066f6[_0x216f15(0x225)]['goal'];for(const _0x1dadde of _0x4066f6['attributes'][_0x216f15(0x202)]||[]){_0x1dadde[_0x216f15(0x16b)]?.[_0x216f15(0x231)]&&isPendingSegmentId(_0x1dadde['entryCriteria'][_0x216f15(0x231)])&&delete _0x1dadde[_0x216f15(0x16b)];_0x1dadde[_0x216f15(0x1fb)]?.[_0x216f15(0x231)]&&isPendingSegmentId(_0x1dadde[_0x216f15(0x1fb)]['segmentId'])&&delete _0x1dadde[_0x216f15(0x1fb)];_0x1dadde[_0x216f15(0x190)]&&(_0x1dadde[_0x216f15(0x190)]=_0x1dadde[_0x216f15(0x190)][_0x216f15(0x177)](_0x3b351e=>!_0x3b351e[_0x216f15(0x231)]||!isPendingSegmentId(_0x3b351e[_0x216f15(0x231)])));if(_0x1dadde[_0x216f15(0x188)])for(const _0x5e7182 of Object[_0x216f15(0x244)](_0x1dadde[_0x216f15(0x188)])){const _0x1518b7=_0x1dadde['steps'][_0x5e7182];_0x1518b7['type']===_0x216f15(0x22d)&&_0x1518b7['journeyActivationStepId']&&isPendingActivationId(_0x1518b7[_0x216f15(0x21a)])&&(_0x1518b7[_0x216f15(0x21a)]='');if(_0x1518b7['type']===_0x216f15(0x198)&&_0x1518b7['branches'])for(const _0xe39a86 of _0x1518b7[_0x216f15(0x245)]){_0xe39a86[_0x216f15(0x231)]&&isPendingSegmentId(_0xe39a86[_0x216f15(0x231)])&&(_0xe39a86[_0x216f15(0x231)]='');}_0x1518b7[_0x216f15(0x19d)]===_0x216f15(0x1df)&&stripWaitStepPendingIds(_0x1518b7);}}}function resolvePendingIdsInRequest(_0x4b01ce,_0x3059a9,_0x13ad51,_0x118226,_0x1c0fd2,_0x3ac669){const _0x34a6a7=a140_0x2d1abb,_0x2e50a4=(_0x5354db,_0x2fb4e9)=>{const _0xe9c746=a140_0x4f0a;if(!isPendingSegmentId(_0x5354db))return _0x5354db;const _0x43a760=extractPendingSegmentName(_0x5354db),_0x417939=_0x118226['get'](_0x43a760);return!_0x417939&&_0x3ac669['logWarning']?.('Warning:\x20Could\x20not\x20resolve\x20embedded\x20segment\x20\x27'+_0x43a760+_0xe9c746(0x23c)+_0x2fb4e9),_0x417939;};if(_0x4b01ce[_0x34a6a7(0x225)][_0x34a6a7(0x182)]?.['segmentId']&&isPendingSegmentId(_0x4b01ce['attributes'][_0x34a6a7(0x182)][_0x34a6a7(0x231)])){const _0x5dd734=_0x2e50a4(_0x4b01ce[_0x34a6a7(0x225)][_0x34a6a7(0x182)][_0x34a6a7(0x231)],_0x34a6a7(0x1ac));_0x5dd734&&(_0x4b01ce[_0x34a6a7(0x225)][_0x34a6a7(0x182)][_0x34a6a7(0x231)]=_0x5dd734);}for(const _0x2127d1 of _0x4b01ce['attributes']['journeyStages']||[]){const _0x550e3f=_0x13ad51[_0x34a6a7(0x160)](_0x2127d1[_0x34a6a7(0x1d5)][_0x34a6a7(0x163)]());_0x550e3f&&(_0x2127d1['id']=_0x550e3f);if(_0x2127d1[_0x34a6a7(0x16b)]?.[_0x34a6a7(0x231)]&&isPendingSegmentId(_0x2127d1[_0x34a6a7(0x16b)][_0x34a6a7(0x231)])){const _0x5e9303=_0x2e50a4(_0x2127d1[_0x34a6a7(0x16b)][_0x34a6a7(0x231)],_0x34a6a7(0x14e)+_0x2127d1[_0x34a6a7(0x1d5)]+_0x34a6a7(0x16e));_0x5e9303&&(_0x2127d1[_0x34a6a7(0x16b)][_0x34a6a7(0x231)]=_0x5e9303);}if(_0x2127d1[_0x34a6a7(0x190)])for(const _0x9b344f of _0x2127d1[_0x34a6a7(0x190)]){if(_0x9b344f[_0x34a6a7(0x231)]&&isPendingSegmentId(_0x9b344f[_0x34a6a7(0x231)])){const _0x251030=_0x2e50a4(_0x9b344f['segmentId'],_0x34a6a7(0x14e)+_0x2127d1[_0x34a6a7(0x1d5)]+_0x34a6a7(0x20d));_0x251030&&(_0x9b344f[_0x34a6a7(0x231)]=_0x251030);}}if(_0x2127d1[_0x34a6a7(0x1fb)]?.[_0x34a6a7(0x231)]&&isPendingSegmentId(_0x2127d1[_0x34a6a7(0x1fb)][_0x34a6a7(0x231)])){const _0x2c1f3a=_0x2e50a4(_0x2127d1[_0x34a6a7(0x1fb)][_0x34a6a7(0x231)],'stage\x20\x27'+_0x2127d1[_0x34a6a7(0x1d5)]+'\x27\x20milestone');_0x2c1f3a&&(_0x2127d1[_0x34a6a7(0x1fb)][_0x34a6a7(0x231)]=_0x2c1f3a);}if(_0x2127d1[_0x34a6a7(0x188)]){const _0x31eb41=_0x16aa8b=>_0x3059a9[_0x34a6a7(0x225)][_0x34a6a7(0x202)]?.[_0x34a6a7(0x1ba)](_0x5c5cc6=>_0x5c5cc6[_0x34a6a7(0x1d5)]['toLowerCase']()===_0x2127d1[_0x34a6a7(0x1d5)][_0x34a6a7(0x163)]())?.[_0x34a6a7(0x188)]?.[_0x16aa8b];for(const _0x1fa6dd of Object[_0x34a6a7(0x244)](_0x2127d1[_0x34a6a7(0x188)])){const _0x507cbd=_0x2127d1[_0x34a6a7(0x188)][_0x1fa6dd],_0x56310e=_0x31eb41(_0x1fa6dd);if(_0x507cbd[_0x34a6a7(0x19d)]==='Activation'&&_0x507cbd[_0x34a6a7(0x21a)]&&(isPendingActivationId(_0x507cbd[_0x34a6a7(0x21a)])||_0x507cbd[_0x34a6a7(0x21a)]==='')){if(_0x56310e?.[_0x34a6a7(0x21a)]&&isPendingActivationId(_0x56310e[_0x34a6a7(0x21a)])){const _0x38b0ea=extractPendingActivationName(_0x56310e[_0x34a6a7(0x21a)]),_0x385fe3=_0x1c0fd2[_0x34a6a7(0x160)](_0x38b0ea);_0x385fe3&&(_0x507cbd['journeyActivationStepId']=_0x385fe3);}}if(_0x507cbd[_0x34a6a7(0x19d)]===_0x34a6a7(0x198)&&_0x507cbd[_0x34a6a7(0x245)]&&_0x56310e?.['branches'])for(let _0x5cdbb1=0x0;_0x5cdbb1<_0x507cbd[_0x34a6a7(0x245)]['length'];_0x5cdbb1++){const _0x127e26=_0x507cbd[_0x34a6a7(0x245)][_0x5cdbb1],_0x3c6821=_0x56310e[_0x34a6a7(0x245)][_0x5cdbb1];if(_0x3c6821?.['segmentId']&&isPendingSegmentId(_0x3c6821[_0x34a6a7(0x231)])){const _0x18f769=_0x2e50a4(_0x3c6821[_0x34a6a7(0x231)],_0x34a6a7(0x14e)+_0x2127d1[_0x34a6a7(0x1d5)]+_0x34a6a7(0x1f2)+(_0x127e26[_0x34a6a7(0x1d5)]||_0x5cdbb1)+'\x27');_0x18f769&&(_0x127e26[_0x34a6a7(0x231)]=_0x18f769);}}_0x507cbd[_0x34a6a7(0x19d)]===_0x34a6a7(0x1df)&&_0x56310e?.['type']===_0x34a6a7(0x1df)&&resolveWaitStepPendingIds(_0x507cbd,_0x56310e,_0x2e50a4,_0x2127d1['name']);}}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x141010,_0x5848fa){const _0x13b71b=a141_0x5336,_0x283b6a=_0x141010();while(!![]){try{const _0x153011=parseInt(_0x13b71b(0x113))/0x1*(parseInt(_0x13b71b(0x110))/0x2)+-parseInt(_0x13b71b(0x10a))/0x3+-parseInt(_0x13b71b(0x10c))/0x4*(-parseInt(_0x13b71b(0x112))/0x5)+-parseInt(_0x13b71b(0x107))/0x6+parseInt(_0x13b71b(0x10f))/0x7*(parseInt(_0x13b71b(0x111))/0x8)+parseInt(_0x13b71b(0x115))/0x9*(-parseInt(_0x13b71b(0x116))/0xa)+parseInt(_0x13b71b(0x10d))/0xb;if(_0x153011===_0x5848fa)break;else _0x283b6a['push'](_0x283b6a['shift']());}catch(_0x3b333f){_0x283b6a['push'](_0x283b6a['shift']());}}}(a141_0x6bac,0x80424));function a141_0x6bac(){const _0x18bc6f=['8862557lKHeuA','set','3358733otrnVV','4274BKucLe','8rbEPif','175135MqvOjc','43bqVIZE','parentFolderId','605034edwcMX','70WWOgRp','name','1829160cfYjUR','add','get','439983IQkQkX','has','8lzBUUn'];a141_0x6bac=function(){return _0x18bc6f;};return a141_0x6bac();}function a141_0x5336(_0x5932f5,_0x34c16a){_0x5932f5=_0x5932f5-0x106;const _0x6bac07=a141_0x6bac();let _0x533630=_0x6bac07[_0x5932f5];return _0x533630;}export function buildFolderIdToPathMap(_0x4100e3){const _0x526890=a141_0x5336,_0x3a06b1=new Map(),_0x2d9ab2=new Map();for(const _0x395aa1 of _0x4100e3){_0x2d9ab2[_0x526890(0x10e)](_0x395aa1['id'],_0x395aa1);}const _0x595229=new Set();for(const _0x10f2d7 of _0x4100e3){!_0x10f2d7[_0x526890(0x114)]&&_0x595229['add'](_0x10f2d7['id']);}function _0xea4164(_0x44d7ab){const _0x5125b4=_0x526890;if(_0x3a06b1[_0x5125b4(0x10b)](_0x44d7ab['id']))return _0x3a06b1[_0x5125b4(0x109)](_0x44d7ab['id']);if(_0x595229['has'](_0x44d7ab['id']))return _0x3a06b1[_0x5125b4(0x10e)](_0x44d7ab['id'],''),'';if(_0x44d7ab[_0x5125b4(0x114)]){const _0x1b88f1=_0x2d9ab2[_0x5125b4(0x109)](_0x44d7ab[_0x5125b4(0x114)]);if(_0x1b88f1){const _0x1b061c=_0xea4164(_0x1b88f1),_0x445e0d=_0x1b061c?_0x1b061c+'/'+_0x44d7ab['name']:_0x44d7ab[_0x5125b4(0x106)];return _0x3a06b1['set'](_0x44d7ab['id'],_0x445e0d),_0x445e0d;}}const _0x2911b8=_0x44d7ab['name'];return _0x3a06b1[_0x5125b4(0x10e)](_0x44d7ab['id'],_0x2911b8),_0x2911b8;}for(const _0x3789b0 of _0x4100e3){_0xea4164(_0x3789b0);}return _0x3a06b1;}export function buildFolderPathToIdMap(_0x1a6b55){const _0x5610de=a141_0x5336,_0x43533f=new Map(),_0x120556=new Map();for(const _0x102ff5 of _0x1a6b55){_0x120556['set'](_0x102ff5['id'],_0x102ff5);}const _0x5a9bf2=new Set();for(const _0x450ab2 of _0x1a6b55){!_0x450ab2[_0x5610de(0x114)]&&_0x5a9bf2[_0x5610de(0x108)](_0x450ab2['id']);}function _0x52f102(_0xac11e1){const _0x1a9c26=_0x5610de;if(_0x5a9bf2[_0x1a9c26(0x10b)](_0xac11e1['id']))return'';if(_0xac11e1['parentFolderId']){const _0x3d2164=_0x120556['get'](_0xac11e1[_0x1a9c26(0x114)]);if(_0x3d2164){const _0x2c8b6b=_0x52f102(_0x3d2164);return _0x2c8b6b?_0x2c8b6b+'/'+_0xac11e1[_0x1a9c26(0x106)]:_0xac11e1['name'];}}return _0xac11e1[_0x1a9c26(0x106)];}for(const _0x21ad26 of _0x1a6b55){const _0x11da75=_0x52f102(_0x21ad26);_0x43533f[_0x5610de(0x10e)](_0x11da75,_0x21ad26['id']);}return _0x43533f;}export function buildFolderMaps(_0x5e6dcb){const _0x1dff11=a141_0x5336,_0x11509a=buildFolderIdToPathMap(_0x5e6dcb),_0x5692cc=new Map();for(const [_0x1efde0,_0x310772]of _0x11509a){_0x5692cc[_0x1dff11(0x10e)](_0x310772,_0x1efde0);}return{'idToPath':_0x11509a,'pathToId':_0x5692cc};}export function getFolderPath(_0x34dccd,_0x2dc68c){const _0x182df3=a141_0x5336;if(!_0x34dccd)return'';return _0x2dc68c[_0x182df3(0x109)](_0x34dccd)??'';}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x5d253a,_0x29fb9a){const _0x2cf7ce=a142_0x5e78,_0x12dfe1=_0x5d253a();while(!![]){try{const _0x366409=parseInt(_0x2cf7ce(0xf9))/0x1+-parseInt(_0x2cf7ce(0xe5))/0x2*(parseInt(_0x2cf7ce(0xe7))/0x3)+parseInt(_0x2cf7ce(0xd4))/0x4*(-parseInt(_0x2cf7ce(0xf7))/0x5)+parseInt(_0x2cf7ce(0x100))/0x6+parseInt(_0x2cf7ce(0xd9))/0x7*(-parseInt(_0x2cf7ce(0xee))/0x8)+-parseInt(_0x2cf7ce(0x101))/0x9*(parseInt(_0x2cf7ce(0x103))/0xa)+-parseInt(_0x2cf7ce(0xec))/0xb*(parseInt(_0x2cf7ce(0xf1))/0xc);if(_0x366409===_0x29fb9a)break;else _0x12dfe1['push'](_0x12dfe1['shift']());}catch(_0x15e133){_0x12dfe1['push'](_0x12dfe1['shift']());}}}(a142_0x5bdb,0x3397e));import a142_0x287075 from'path';function a142_0x5e78(_0xbfbb17,_0x547e32){_0xbfbb17=_0xbfbb17-0xd1;const _0x5bdb9c=a142_0x5bdb();let _0x5e781f=_0x5bdb9c[_0xbfbb17];return _0x5e781f;}import{parse as a142_0x4950ae}from'yaml';import{nodeFileSystem}from'../io/node-filesystem.js';export function parsePath(_0x170dfa){const _0x336abe=a142_0x5e78;if(!_0x170dfa||_0x170dfa['trim']()==='')throw new Error(_0x336abe(0xdb));const _0x1dba37=_0x170dfa['trim']();if(_0x1dba37==='/')return{'segments':[],'isAbsolute':!![],'raw':_0x170dfa};const _0x383173=_0x1dba37[_0x336abe(0xf6)]('/')?_0x1dba37['substring'](0x1):_0x1dba37,_0x4e755a=_0x383173[_0x336abe(0xde)]('/')[_0x336abe(0xef)](_0x3eab89=>_0x3eab89!=='');if(_0x4e755a[_0x336abe(0xf3)]===0x0)throw new Error(_0x336abe(0xdd));const _0xb12e9e=_0x1dba37[_0x336abe(0xf6)]('/')||!isRelativePathSegment(_0x4e755a[0x0]);for(const _0x4f3714 of _0x4e755a){validatePathSegment(_0x4f3714);}return{'segments':_0x4e755a,'isAbsolute':_0xb12e9e,'raw':_0x170dfa};}function isRelativePathSegment(_0x5023fc){return _0x5023fc==='.'||_0x5023fc==='..';}function validatePathSegment(_0x1d1d53){const _0x58168f=a142_0x5e78;if(_0x1d1d53==='')throw new Error(_0x58168f(0xfc));if(_0x1d1d53==='.'||_0x1d1d53==='..')return;if(/[\x00-\x1F\x7F]/[_0x58168f(0xe1)](_0x1d1d53))throw new Error(_0x58168f(0xd5)+_0x1d1d53);if(_0x1d1d53!==_0x1d1d53[_0x58168f(0xe8)]()){}}export function validatePath(_0x12e920){const _0x1d738e=a142_0x5e78;if(_0x12e920[_0x1d738e(0xe0)]['length']===0x0&&!_0x12e920[_0x1d738e(0xd6)])throw new Error(_0x1d738e(0xfb));if(_0x12e920[_0x1d738e(0xd6)]){if(_0x12e920['segments'][0x0]==='..')throw new Error(_0x1d738e(0xdf));let _0x435bda=0x0;for(const _0x58b290 of _0x12e920[_0x1d738e(0xe0)]){if(_0x58b290==='..'){if(_0x435bda===0x0)throw new Error(_0x1d738e(0xda));_0x435bda--;}else _0x58b290!=='.'&&_0x435bda++;}}}export function joinPaths(_0x871585,_0x447b59){const _0x208855=a142_0x5e78;if(!_0x871585||_0x871585==='/')return _0x447b59;if(!_0x447b59||_0x447b59==='.')return _0x871585;if(_0x447b59[_0x208855(0xf6)]('/'))return _0x447b59;const _0x50986e=parsePath(_0x871585),_0x1f0bb6=parsePath(_0x447b59),_0x4214e3=[..._0x50986e[_0x208855(0xe0)]];for(const _0x374272 of _0x1f0bb6[_0x208855(0xe0)]){if(_0x374272==='.')continue;else{if(_0x374272==='..'){if(_0x4214e3[_0x208855(0xf3)]===0x0)throw new Error(_0x208855(0xd1));_0x4214e3[_0x208855(0xea)]();}else _0x4214e3['push'](_0x374272);}}const _0x1c8ef3=_0x4214e3[_0x208855(0xd3)]('/');return _0x50986e['raw']['startsWith']('/')?'/'+_0x1c8ef3:_0x1c8ef3;}export function normalizePath(_0x348212){const _0x3dab01=a142_0x5e78,_0x3aec90=parsePath(_0x348212),_0xb30194=[];for(const _0x56ac86 of _0x3aec90[_0x3dab01(0xe0)]){if(_0x56ac86==='.')continue;else{if(_0x56ac86==='..'){if(_0xb30194['length']===0x0){if(_0x3aec90['isAbsolute'])throw new Error(_0x3dab01(0xd1));_0xb30194['push']('..');}else _0xb30194[_0xb30194[_0x3dab01(0xf3)]-0x1]==='..'?_0xb30194[_0x3dab01(0xff)]('..'):_0xb30194['pop']();}else _0xb30194[_0x3dab01(0xff)](_0x56ac86);}}if(_0xb30194[_0x3dab01(0xf3)]===0x0)return _0x3aec90[_0x3dab01(0xd6)]?'/':'.';const _0x86e16c=_0xb30194['join']('/');return _0x3aec90['raw'][_0x3dab01(0xf6)]('/')?'/'+_0x86e16c:_0x86e16c;}export function getParentPath(_0x3ed480){const _0x3f7e66=a142_0x5e78,_0x38d8b3=parsePath(_0x3ed480);if(_0x38d8b3[_0x3f7e66(0xe0)][_0x3f7e66(0xf3)]<=0x1)return'/';const _0x776eb2=_0x38d8b3[_0x3f7e66(0xe0)][_0x3f7e66(0xfd)](0x0,-0x1)[_0x3f7e66(0xd3)]('/');return _0x38d8b3[_0x3f7e66(0xf2)][_0x3f7e66(0xf6)]('/')?'/'+_0x776eb2:_0x776eb2;}export function getBaseName(_0x5c1e68){const _0x4b27f3=a142_0x5e78,_0x1cc5a1=parsePath(_0x5c1e68);return _0x1cc5a1['segments'][_0x1cc5a1[_0x4b27f3(0xe0)]['length']-0x1]||'';}function a142_0x5bdb(){const _0x425fcc=['filter','name','754404ygaoaC','raw','length','No\x20tdx.json\x20found\x20for\x20file:\x20','endsWith','startsWith','708610iENgKd','readFile','268383XSEQMa','relative','Relative\x20path\x20cannot\x20be\x20empty','Path\x20segment\x20cannot\x20be\x20empty','slice','.yml','push','1718868jtQrYH','3141qCtQqr','exists','30zbkUQd','Invalid\x20tdx.json:\x20missing\x20parent_segment\x20field','resolve','Cannot\x20navigate\x20above\x20root','replace','join','4dnydaE','Path\x20segment\x20contains\x20invalid\x20control\x20characters:\x20','isAbsolute','Invalid\x20YAML:\x20missing\x20name\x20field\x20in\x20','root','805OoifKs','Path\x20attempts\x20to\x20navigate\x20above\x20root','Path\x20cannot\x20be\x20empty','segment','Path\x20must\x20contain\x20at\x20least\x20one\x20segment','split','Absolute\x20path\x20cannot\x20start\x20with\x20\x22..\x22','segments','test','tdx.json','parse','Hint:\x20Run\x20`tdx\x20sg\x20pull\x20\x22Parent\x20Segment\x20Name\x22`\x20first\x20to\x20create\x20a\x20project\x20directory,\x20then\x20work\x20within\x20that\x20directory.','2644yaOeAR','journey','33cGLubk','trim','dirname','pop','Cannot\x20split\x20empty\x20path','22wJpmVG','parent_segment','4208MmeNJW'];a142_0x5bdb=function(){return _0x425fcc;};return a142_0x5bdb();}export function isChildPath(_0x583f73,_0x4d9cb0){const _0x4e59c0=a142_0x5e78,_0x807969=parsePath(_0x583f73),_0x4b8a0b=parsePath(_0x4d9cb0);if(_0x807969[_0x4e59c0(0xe0)]['length']<=_0x4b8a0b[_0x4e59c0(0xe0)][_0x4e59c0(0xf3)])return![];for(let _0x4f686a=0x0;_0x4f686a<_0x4b8a0b[_0x4e59c0(0xe0)][_0x4e59c0(0xf3)];_0x4f686a++){if(_0x807969['segments'][_0x4f686a]!==_0x4b8a0b[_0x4e59c0(0xe0)][_0x4f686a])return![];}return!![];}export function splitPath(_0x12b07c){const _0x3875df=a142_0x5e78,_0x55a8b9=parsePath(_0x12b07c);if(_0x55a8b9[_0x3875df(0xe0)]['length']===0x0)throw new Error(_0x3875df(0xeb));if(_0x55a8b9[_0x3875df(0xe0)][_0x3875df(0xf3)]===0x1)return{'parent':_0x55a8b9['segments'][0x0]};return{'parent':_0x55a8b9[_0x3875df(0xe0)][0x0],'child':_0x55a8b9[_0x3875df(0xe0)][_0x3875df(0xfd)](0x1)[_0x3875df(0xd3)]('/')};}export function isYamlFilePath(_0x43a77d){const _0xe17ef0=a142_0x5e78;return _0x43a77d[_0xe17ef0(0xf5)](_0xe17ef0(0xfe))||_0x43a77d[_0xe17ef0(0xf5)]('.yaml');}export async function resolveYamlFilePath(_0x3ff88b,_0x55d79d=nodeFileSystem){const _0x98862d=a142_0x5e78,_0x393318=a142_0x287075[_0x98862d(0x105)](_0x3ff88b);if(!await _0x55d79d[_0x98862d(0x102)](_0x393318))throw new Error('File\x20not\x20found:\x20'+_0x3ff88b);let _0x5c1976=a142_0x287075[_0x98862d(0xe9)](_0x393318),_0x424db0=null,_0x5aabf2=null;const _0x584007=a142_0x287075['parse'](_0x5c1976)[_0x98862d(0xd8)];while(_0x5c1976!==_0x584007){const _0x24251c=a142_0x287075[_0x98862d(0xd3)](_0x5c1976,_0x98862d(0xe2));if(await _0x55d79d[_0x98862d(0x102)](_0x24251c)){_0x424db0=_0x24251c,_0x5aabf2=_0x5c1976;break;}_0x5c1976=a142_0x287075['dirname'](_0x5c1976);}if(!_0x424db0||!_0x5aabf2)throw new Error(_0x98862d(0xf4)+_0x3ff88b+'\x0a'+_0x98862d(0xe4));const _0x1d272f=await _0x55d79d[_0x98862d(0xf8)](_0x424db0),_0x287558=JSON[_0x98862d(0xe3)](_0x1d272f),_0x2052a2=_0x287558[_0x98862d(0xed)];if(!_0x2052a2)throw new Error(_0x98862d(0x104));const _0x594a35=await _0x55d79d[_0x98862d(0xf8)](_0x393318),_0x577bcd=a142_0x4950ae(_0x594a35),_0x4d7bf6=_0x577bcd[_0x98862d(0xf0)];if(!_0x4d7bf6)throw new Error(_0x98862d(0xd7)+_0x3ff88b);const _0x1f1af6=_0x577bcd['type']===_0x98862d(0xe6)?_0x98862d(0xe6):_0x98862d(0xdc),_0x2d665c=a142_0x287075[_0x98862d(0xfa)](_0x5aabf2,_0x393318),_0x3e4b4c=a142_0x287075[_0x98862d(0xe9)](_0x2d665c),_0x1d397d=_0x3e4b4c==='.'?'':_0x3e4b4c[_0x98862d(0xd2)](/\\/g,'/'),_0x1447c1=_0x1d397d?_0x2052a2+'/'+_0x1d397d+'/'+_0x4d7bf6:_0x2052a2+'/'+_0x4d7bf6;return{'parentSegment':_0x2052a2,'segmentName':_0x4d7bf6,'folderPath':_0x1d397d,'fullPath':_0x1447c1,'resourceType':_0x1f1af6,'content':_0x594a35};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a143_0xfbc1(){const _0x156c60=['252uSUnxS','1864800bjfAQL','24bIfRuw','indexOf','11910gZDosY','substring','.\x20Child\x20name\x20cannot\x20be\x20empty','45740BBDfaP','Invalid\x20segment\x20reference\x20format:\x20','402155VqQABq','510mxgPTJ','357865gaiGOz','581Dquuvf','6354128OvQaRQ','.\x20Parent\x20name\x20cannot\x20be\x20empty','5064IQSupM'];a143_0xfbc1=function(){return _0x156c60;};return a143_0xfbc1();}(function(_0x4f24d1,_0x5e978d){const _0x5e7bae=a143_0xb23d,_0x38410f=_0x4f24d1();while(!![]){try{const _0x308092=parseInt(_0x5e7bae(0x6b))/0x1+-parseInt(_0x5e7bae(0x6a))/0x2*(parseInt(_0x5e7bae(0x6f))/0x3)+parseInt(_0x5e7bae(0x72))/0x4*(-parseInt(_0x5e7bae(0x69))/0x5)+-parseInt(_0x5e7bae(0x74))/0x6*(-parseInt(_0x5e7bae(0x6c))/0x7)+parseInt(_0x5e7bae(0x71))/0x8+parseInt(_0x5e7bae(0x70))/0x9*(-parseInt(_0x5e7bae(0x77))/0xa)+parseInt(_0x5e7bae(0x6d))/0xb;if(_0x308092===_0x5e978d)break;else _0x38410f['push'](_0x38410f['shift']());}catch(_0x5531bf){_0x38410f['push'](_0x38410f['shift']());}}}(a143_0xfbc1,0x475ae));function a143_0xb23d(_0x58bef5,_0x11658e){_0x58bef5=_0x58bef5-0x69;const _0xfbc12a=a143_0xfbc1();let _0xb23dba=_0xfbc12a[_0x58bef5];return _0xb23dba;}export function parseSegmentRef(_0xb82447){const _0x159a8d=a143_0xb23d,_0x47476d=_0xb82447[_0x159a8d(0x73)]('/');if(_0x47476d===-0x1)return{'parentId':_0xb82447};if(_0x47476d===0x0)throw new Error(_0x159a8d(0x78)+_0xb82447+_0x159a8d(0x6e));const _0x2e38b4=_0xb82447[_0x159a8d(0x75)](0x0,_0x47476d),_0x2dc542=_0xb82447[_0x159a8d(0x75)](_0x47476d+0x1);if(_0x2dc542==='')throw new Error(_0x159a8d(0x78)+_0xb82447+_0x159a8d(0x76));return{'parentId':_0x2e38b4,'childId':_0x2dc542};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x1a4c52,_0x58c5fb){const _0xc1c59f=a144_0x2588,_0x28e6bc=_0x1a4c52();while(!![]){try{const _0x1e2dc8=parseInt(_0xc1c59f(0x161))/0x1+-parseInt(_0xc1c59f(0x168))/0x2*(-parseInt(_0xc1c59f(0x14f))/0x3)+-parseInt(_0xc1c59f(0x149))/0x4+parseInt(_0xc1c59f(0x15f))/0x5+-parseInt(_0xc1c59f(0x165))/0x6+-parseInt(_0xc1c59f(0x15b))/0x7+parseInt(_0xc1c59f(0x146))/0x8*(parseInt(_0xc1c59f(0x16c))/0x9);if(_0x1e2dc8===_0x58c5fb)break;else _0x28e6bc['push'](_0x28e6bc['shift']());}catch(_0xf2e5a3){_0x28e6bc['push'](_0x28e6bc['shift']());}}}(a144_0x1857,0x2b87d));import{SegmentDefSchema,RuleDefSchema}from'./types/segment-schema.js';function a144_0x2588(_0x349868,_0x54a35a){_0x349868=_0x349868-0x13f;const _0x185752=a144_0x1857();let _0x25888e=_0x185752[_0x349868];return _0x25888e;}import{formatZodPath,flattenZodIssues,getLocationFromPath,pathToArray}from'./yaml-validator.js';export function validateSegmentDef(_0x4713a2,_0x287f2f={},_0x3a8661={}){const _0x3614f0=a144_0x2588;if(_0x3a8661['skipSchema'])return runSemanticChecks(_0x4713a2,_0x287f2f);const _0xc967e4=SegmentDefSchema[_0x3614f0(0x166)](_0x4713a2);if(_0xc967e4[_0x3614f0(0x15a)])return runSemanticChecks(_0xc967e4[_0x3614f0(0x175)],_0x287f2f);return zodErrorsToValidationResult(_0xc967e4[_0x3614f0(0x160)],_0x287f2f);}export function validateRuleDef(_0x4cead3,_0x47acd5,_0xaaf84b){const _0x15f035=a144_0x2588;if(!_0x4cead3)return[];const _0x2b296a=RuleDefSchema['safeParse'](_0x4cead3);if(_0x2b296a[_0x15f035(0x15a)])return checkRule(_0x2b296a[_0x15f035(0x175)],_0x47acd5,_0xaaf84b);const _0x36ad03=flattenZodIssues(_0x2b296a['error']['issues']);return _0x36ad03[_0x15f035(0x16a)](_0x1cd3f3=>{const _0x30a611=_0x15f035,_0x53e179=formatZodPath(_0x1cd3f3['path']),_0x52b5da=_0x53e179?_0x47acd5+'.'+_0x53e179:_0x47acd5,_0x39414c=mapZodIssueToCode(_0x1cd3f3,_0x53e179),_0x1d1228=getLocationFromPath(_0xaaf84b['document'],_0xaaf84b['source'],pathToArray(_0x52b5da));return{'level':_0x30a611(0x160),'path':_0x52b5da,'code':_0x39414c,'message':_0x1cd3f3[_0x30a611(0x179)],..._0x1d1228&&{'location':_0x1d1228}};});}function zodErrorsToValidationResult(_0x198f70,_0x2ab6e6){const _0x327145=a144_0x2588,_0x342aa0=flattenZodIssues(_0x198f70['issues']),_0x17542d=_0x342aa0[_0x327145(0x16a)](_0x323871=>{const _0x4b13f3=_0x327145,_0x58d2a5=formatZodPath(_0x323871[_0x4b13f3(0x176)]),_0x51f6c4=mapZodIssueToCode(_0x323871,_0x58d2a5),_0xc14a89=getLocationFromPath(_0x2ab6e6[_0x4b13f3(0x181)],_0x2ab6e6[_0x4b13f3(0x182)],_0x323871[_0x4b13f3(0x176)]['map'](_0x57b418=>typeof _0x57b418===_0x4b13f3(0x17b)?String(_0x57b418):_0x57b418));return{'level':_0x4b13f3(0x160),'path':_0x58d2a5,'code':_0x51f6c4,'message':_0x323871['message'],..._0xc14a89&&{'location':_0xc14a89}};});return{'valid':![],'errors':_0x17542d,'warnings':[]};}function mapZodIssueToCode(_0x420081,_0x13eac9){const _0x5414ca=a144_0x2588,_0x1de041=_0x420081['code']==='custom'?_0x420081['params']:undefined;if(_0x13eac9===_0x5414ca(0x164))return _0x5414ca(0x177);if(_0x13eac9===_0x5414ca(0x14b)||_0x13eac9[_0x5414ca(0x170)](_0x5414ca(0x16f))){if(_0x420081[_0x5414ca(0x151)]==='invalid_value'){if(_0x13eac9===_0x5414ca(0x14b)||_0x13eac9[_0x5414ca(0x156)](/\.conditions\[\d+\]\.type$/))return'INVALID_RULE_TYPE';}}if(_0x13eac9[_0x5414ca(0x170)](_0x5414ca(0x145)))return _0x5414ca(0x158);if(_0x13eac9[_0x5414ca(0x170)](_0x5414ca(0x13f)))return _0x5414ca(0x14a);if(_0x1de041?.[_0x5414ca(0x162)]===_0x5414ca(0x163))return'MISSING_BETWEEN_BOUNDS';if(_0x1de041?.[_0x5414ca(0x162)]===_0x5414ca(0x167))return _0x5414ca(0x167);if(_0x13eac9[_0x5414ca(0x170)](_0x5414ca(0x159))||_0x13eac9==='conditions')return _0x5414ca(0x148);if(_0x13eac9[_0x5414ca(0x153)](_0x5414ca(0x17e)))return _0x5414ca(0x180);if(_0x13eac9[_0x5414ca(0x170)](_0x5414ca(0x178)))return'MISSING_SEGMENT_REFERENCE';return _0x5414ca(0x141);}function runSemanticChecks(_0x5a5c1e,_0x30a2cd){const _0x4b6611=a144_0x2588,_0x35a92f=[];_0x5a5c1e['rule']&&_0x35a92f['push'](...checkRule(_0x5a5c1e['rule'],_0x4b6611(0x152),_0x30a2cd));const _0x2979ea=_0x35a92f[_0x4b6611(0x143)](_0xea95e1=>_0xea95e1[_0x4b6611(0x155)]===_0x4b6611(0x160)),_0x4d0150=_0x35a92f['filter'](_0x3eeee9=>_0x3eeee9[_0x4b6611(0x155)]===_0x4b6611(0x16d));return{'valid':_0x2979ea['length']===0x0,'errors':_0x2979ea,'warnings':_0x4d0150};}function a144_0x1857(){const _0x1458c2=['map','aggregation','182421QQIvOW','warning','requires\x20a\x20nested\x20\x27filter\x27.\x20Without\x20filter,\x20the\x20source\x20is\x20silently\x20ignored\x20and\x20','.type','endsWith','And','\x20condition\x20cannot\x20have\x20an\x20empty\x20conditions\x20array','Behavior','length','data','path','MISSING_NAME','.segment','message','Rule\x20conditions\x20array\x20cannot\x20be\x20empty.\x20Add\x20at\x20least\x20one\x20condition.','symbol','use\x20\x27In\x27\x20operator\x20instead:\x20operator:\x20{\x20type:\x20In,\x20value:\x20[\x22val1\x22,\x20\x22val2\x22]\x20}','Attribute\x20name\x20cannot\x20be\x20empty','arrayMatching','.source','INVALID_ARRAY_MATCHING','document','source','the\x20condition\x20queries\x20the\x20master\x20table\x20instead.\x20','.operator.value','BEHAVIOR_SOURCE_MISSING_FILTER','SEGMENT_SCHEMA_ERROR','conditions','filter','BEHAVIOR_SOURCE_WITH_ATTRIBUTE','.operator.type','8IifjGQ','\x27\x20with\x20attribute\x20\x27','MISSING_CONDITIONS','178620UpkWsc','MISSING_OPERATOR_VALUE','rule.type','Use\x20\x27attribute:\x20\x22\x22\x27\x20with\x20\x27filter.type:\x20And\x27\x20containing\x20\x27type:\x20Column\x27\x20conditions.','EMPTY_CONDITIONS','.filter','3Kxmcdq','type','code','rule','includes','attribute','level','match','.attribute','INVALID_OPERATOR_TYPE','.conditions','success','1115709OuzvqG','\x27\x20with\x20behavior\x20source\x20may\x20cause\x20unexpected\x20behavior.\x20','push','Behavior\x20source\x20\x27','991780gzGckM','error','36978QViaNT','validationCode','MISSING_BETWEEN_BOUNDS','name','999264lDkaRm','safeParse','MISSING_TIME_UNIT','586568TocQtc','groups,\x20causing\x20local/server\x20discrepancy.\x20For\x20same-attribute\x20Or\x20conditions,\x20'];a144_0x1857=function(){return _0x1458c2;};return a144_0x1857();}function checkRule(_0xfef562,_0x29eb28,_0x20f311){const _0x558bc7=a144_0x2588,_0x47cc7f=[];if(_0xfef562[_0x558bc7(0x142)]['length']===0x0)return _0x47cc7f[_0x558bc7(0x15d)]({'level':_0x558bc7(0x160),'path':_0x29eb28+_0x558bc7(0x159),'code':_0x558bc7(0x14d),'message':_0x558bc7(0x17a),'location':getLocationFromPath(_0x20f311[_0x558bc7(0x181)],_0x20f311['source'],pathToArray(_0x29eb28+_0x558bc7(0x159)))}),_0x47cc7f;return _0x47cc7f[_0x558bc7(0x15d)](...checkConditions(_0xfef562[_0x558bc7(0x142)],_0x29eb28,_0x20f311)),_0x47cc7f;}function checkConditions(_0xfed8f5,_0x10ed0c,_0x51184e){const _0x3204bd=a144_0x2588,_0x54a498=[];for(let _0x137187=0x0;_0x137187<_0xfed8f5[_0x3204bd(0x174)];_0x137187++){const _0x287c36=_0xfed8f5[_0x137187],_0x4376f8=_0x10ed0c+'.conditions['+_0x137187+']';_0x54a498[_0x3204bd(0x15d)](...checkCondition(_0x287c36,_0x4376f8,_0x51184e));}return _0x54a498;}function checkCondition(_0x25e7a2,_0x1ca1b1,_0x56840f){const _0x2ca552=a144_0x2588,_0x49e171=[];if(_0x25e7a2['type']===_0x2ca552(0x171)||_0x25e7a2['type']==='Or')return _0x25e7a2[_0x2ca552(0x142)][_0x2ca552(0x174)]===0x0?_0x49e171[_0x2ca552(0x15d)]({'level':_0x2ca552(0x160),'path':_0x1ca1b1+'.conditions','code':'EMPTY_CONDITIONS','message':_0x25e7a2[_0x2ca552(0x150)]+_0x2ca552(0x172),'location':getLocationFromPath(_0x56840f[_0x2ca552(0x181)],_0x56840f['source'],pathToArray(_0x1ca1b1+'.conditions'))}):_0x49e171[_0x2ca552(0x15d)]({'level':_0x2ca552(0x160),'path':_0x1ca1b1,'code':'NESTED_CONDITION_GROUP','message':_0x25e7a2[_0x2ca552(0x150)]+'\x20condition\x20group\x20not\x20supported.\x20Console\x20UI\x20ignores\x20nested\x20condition\x20'+_0x2ca552(0x169)+_0x2ca552(0x17c),'location':getLocationFromPath(_0x56840f[_0x2ca552(0x181)],_0x56840f[_0x2ca552(0x182)],pathToArray(_0x1ca1b1))}),_0x49e171;if(_0x25e7a2[_0x2ca552(0x150)]==='Value'||_0x25e7a2[_0x2ca552(0x150)]===_0x2ca552(0x173)){const _0x25de8a=_0x25e7a2,_0x1388ec=_0x25de8a[_0x2ca552(0x182)],_0x33f7f9=_0x25de8a[_0x2ca552(0x16b)],_0x27a55d=_0x1388ec||_0x33f7f9;(!_0x25de8a[_0x2ca552(0x154)]||_0x25de8a[_0x2ca552(0x154)]==='')&&(!_0x27a55d&&_0x49e171[_0x2ca552(0x15d)]({'level':_0x2ca552(0x160),'path':_0x1ca1b1+_0x2ca552(0x157),'code':'EMPTY_ATTRIBUTE','message':_0x2ca552(0x17d),'location':getLocationFromPath(_0x56840f[_0x2ca552(0x181)],_0x56840f[_0x2ca552(0x182)],pathToArray(_0x1ca1b1+_0x2ca552(0x157)))}));_0x25de8a[_0x2ca552(0x143)]&&_0x49e171[_0x2ca552(0x15d)](...checkRule(_0x25de8a[_0x2ca552(0x143)],_0x1ca1b1+_0x2ca552(0x14e),_0x56840f));if(_0x25de8a[_0x2ca552(0x182)]){const _0x420c61=_0x25de8a[_0x2ca552(0x154)]&&_0x25de8a[_0x2ca552(0x154)]!=='';_0x420c61&&!_0x25de8a[_0x2ca552(0x143)]&&_0x49e171[_0x2ca552(0x15d)]({'level':_0x2ca552(0x160),'path':_0x1ca1b1+_0x2ca552(0x17f),'code':_0x2ca552(0x140),'message':_0x2ca552(0x15e)+_0x25de8a['source']+_0x2ca552(0x147)+_0x25de8a[_0x2ca552(0x154)]+'\x27\x20'+_0x2ca552(0x16e)+_0x2ca552(0x183)+_0x2ca552(0x14c),'location':getLocationFromPath(_0x56840f['document'],_0x56840f['source'],pathToArray(_0x1ca1b1+_0x2ca552(0x17f)))}),_0x420c61&&_0x25de8a[_0x2ca552(0x143)]&&_0x49e171[_0x2ca552(0x15d)]({'level':_0x2ca552(0x16d),'path':_0x1ca1b1+_0x2ca552(0x157),'code':_0x2ca552(0x144),'message':'Attribute\x20\x27'+_0x25de8a[_0x2ca552(0x154)]+_0x2ca552(0x15c)+'For\x20behavior\x20aggregations,\x20use\x20\x27attribute:\x20\x22\x22\x27\x20with\x20Column\x20conditions\x20in\x20filter.','location':getLocationFromPath(_0x56840f['document'],_0x56840f[_0x2ca552(0x182)],pathToArray(_0x1ca1b1+_0x2ca552(0x157)))});}}return _0x49e171;}
|