@treasuredata/tdx 2026.8.0 → 2026.8.2
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.d.ts.map +1 -1
- package/dist/cli.js +1 -1
- package/dist/cli.js.map +1 -1
- package/dist/commands/activations.js +1 -1
- package/dist/commands/agent-command.js +1 -1
- package/dist/commands/agent-test-command.js +1 -1
- package/dist/commands/api-command.js +1 -1
- package/dist/commands/auth-command.d.ts +9 -0
- package/dist/commands/auth-command.d.ts.map +1 -1
- package/dist/commands/auth-command.js +1 -1
- package/dist/commands/auth-command.js.map +1 -1
- package/dist/commands/cas-command.js +1 -1
- package/dist/commands/cas-segment-command.js +1 -1
- package/dist/commands/chat-command.js +1 -1
- package/dist/commands/claude-command.d.ts +10 -1
- package/dist/commands/claude-command.d.ts.map +1 -1
- package/dist/commands/claude-command.js +1 -1
- package/dist/commands/claude-command.js.map +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-always-on-campaign-pull-command.js +1 -1
- package/dist/commands/engage-always-on-campaign-push-command.js +1 -1
- package/dist/commands/engage-always-on-campaign-validate-command.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/policy-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-move-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/table-deleted.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/work-command.js +1 -1
- package/dist/commands/workflow-command.js +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.js +1 -1
- package/dist/core/profile.js +1 -1
- package/dist/core/project-config.js +1 -1
- package/dist/core/session.js +1 -1
- package/dist/core/site-mismatch.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/tools/work-create-item.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/auth-token.d.ts +23 -0
- package/dist/sdk/auth-token.d.ts.map +1 -0
- package/dist/sdk/auth-token.js +1 -0
- package/dist/sdk/auth-token.js.map +1 -0
- package/dist/sdk/cas/cas-api-client.js +1 -1
- package/dist/sdk/cas/cas-audience-schema.d.ts +2 -0
- package/dist/sdk/cas/cas-audience-schema.d.ts.map +1 -1
- package/dist/sdk/cas/cas-audience-schema.js +1 -1
- package/dist/sdk/cas/cas-audience-schema.js.map +1 -1
- package/dist/sdk/cas/cas-audience-validator.js +1 -1
- package/dist/sdk/cas/cas-audience-yaml.d.ts.map +1 -1
- package/dist/sdk/cas/cas-audience-yaml.js +1 -1
- package/dist/sdk/cas/cas-audience-yaml.js.map +1 -1
- package/dist/sdk/cas/cas-segment-yaml.js +1 -1
- package/dist/sdk/cas/index.js +1 -1
- package/dist/sdk/cas/pull-workflow.js +1 -1
- package/dist/sdk/cas/push-workflow.d.ts.map +1 -1
- package/dist/sdk/cas/push-workflow.js +1 -1
- package/dist/sdk/cas/push-workflow.js.map +1 -1
- package/dist/sdk/cas/types.d.ts +2 -0
- package/dist/sdk/cas/types.d.ts.map +1 -1
- package/dist/sdk/cas/validate-files.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/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.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/always-on-campaign-pull.js +1 -1
- package/dist/sdk/engage/always-on-campaign-push.js +1 -1
- package/dist/sdk/engage/always-on-campaign-validator.js +1 -1
- package/dist/sdk/engage/always-on-campaign-yaml.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/always-on-campaign-schema.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.js +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/llm/user-settings.js +1 -1
- package/dist/sdk/personalization.js +1 -1
- package/dist/sdk/policy.js +1 -1
- package/dist/sdk/query/deleted-table-validation.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.js +1 -1
- package/dist/sdk/segment/journey-validator.js +1 -1
- package/dist/sdk/segment/journey-yaml.js +1 -1
- package/dist/sdk/segment/parent-segment-preview.js +1 -1
- package/dist/sdk/segment/parent-segment-yaml.js +1 -1
- package/dist/sdk/segment/pull-workflow.js +1 -1
- package/dist/sdk/segment/push-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/cas.d.ts +4 -0
- package/dist/sdk/types/cas.d.ts.map +1 -1
- package/dist/sdk/types/index.js +1 -1
- package/dist/sdk/types/progress.js +1 -1
- package/dist/sdk/types/workspace.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/util/tree-search.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.js +1 -1
- package/dist/sdk/workflow/pull-workflow.js +1 -1
- package/dist/sdk/workflow/push-workflow.js +1 -1
- package/dist/sdk/workflow/task-graph.js +1 -1
- package/dist/sdk/workflow/tdx-config.js +1 -1
- package/dist/sdk/workflow/workflow-utils.js +1 -1
- package/dist/sdk/workspace/access-tracker.js +1 -1
- package/dist/sdk/workspace/frontmatter.js +1 -1
- package/dist/sdk/workspace/git.js +1 -1
- package/dist/sdk/workspace/index.js +1 -1
- package/dist/sdk/workspace/templates.js +1 -1
- package/dist/sdk/workspace/weekly.js +1 -1
- package/dist/sdk/workspace/wikilinks.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/claude-code-state.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/proxy-fetch.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 a168_0x5cf043=a168_0x51ba;(function(_0x4a76cd,_0x3af289){const _0x57b75f=a168_0x51ba,_0x289498=_0x4a76cd();while(!![]){try{const _0x313817=parseInt(_0x57b75f(0x13d))/0x1*(-parseInt(_0x57b75f(0xf7))/0x2)+parseInt(_0x57b75f(0x182))/0x3*(parseInt(_0x57b75f(0x1d0))/0x4)+-parseInt(_0x57b75f(0x1b9))/0x5+parseInt(_0x57b75f(0x14a))/0x6*(-parseInt(_0x57b75f(0x1c1))/0x7)+-parseInt(_0x57b75f(0x148))/0x8*(-parseInt(_0x57b75f(0x18f))/0x9)+-parseInt(_0x57b75f(0x12e))/0xa+-parseInt(_0x57b75f(0x195))/0xb*(parseInt(_0x57b75f(0x163))/0xc);if(_0x313817===_0x3af289)break;else _0x289498['push'](_0x289498['shift']());}catch(_0x34b727){_0x289498['push'](_0x289498['shift']());}}}(a168_0x5e19,0xa466b));import{createHash}from'crypto';import{Logger}from'../../utils/logger/index.js';const logger=Logger['of'](a168_0x5cf043(0x1a0));function a168_0x51ba(_0x145301,_0x4e6b14){_0x145301=_0x145301-0xdb;const _0x5e19dd=a168_0x5e19();let _0x51bad9=_0x5e19dd[_0x145301];return _0x51bad9;}export const PENDING_SEGMENT_PREFIX='__pending_';export const PENDING_ACTIVATION_PREFIX=a168_0x5cf043(0x188);export function createPendingSegmentId(_0x4439cd){return''+PENDING_SEGMENT_PREFIX+_0x4439cd+'__';}export function isPendingSegmentId(_0x2699d6){const _0x2cf4ac=a168_0x5cf043;return _0x2699d6['startsWith'](PENDING_SEGMENT_PREFIX)&&!_0x2699d6[_0x2cf4ac(0xfc)](PENDING_ACTIVATION_PREFIX);}export function extractPendingSegmentName(_0x541901){const _0x5168b9=a168_0x5cf043;return _0x541901[_0x5168b9(0x1d5)](/^__pending_(.+)__$/,'$1');}export function createPendingActivationId(_0x746c12){return''+PENDING_ACTIVATION_PREFIX+_0x746c12+'__';}export function isPendingActivationId(_0x42ed19){const _0x2d6179=a168_0x5cf043;return _0x42ed19[_0x2d6179(0xfc)](PENDING_ACTIVATION_PREFIX);}export function extractPendingActivationName(_0x467d7c){const _0x369dbf=a168_0x5cf043;return _0x467d7c[_0x369dbf(0x1d5)](/^__pending_act_(.+)__$/,'$1');}export function generateDeterministicJourneySegmentName(_0x508b7f,_0x5ddef6){const _0xa6b842=a168_0x5cf043,_0x528478=_0x508b7f+'::'+(_0x5ddef6[_0xa6b842(0x146)]()||_0xa6b842(0x160)),_0x15509d=createHash('sha1')['update'](_0x528478)['digest']('hex')[_0xa6b842(0x1c8)](0x0,0xc);return _0xa6b842(0x102)+_0x15509d;}export function ensureJourneyDefaults(_0x3b4407){const _0x45cd9b=a168_0x5cf043;!_0x3b4407[_0x45cd9b(0x1cb)]&&(_0x3b4407[_0x45cd9b(0x1cb)]=''),!_0x3b4407[_0x45cd9b(0xf6)]&&(_0x3b4407[_0x45cd9b(0xf6)]=_0x45cd9b(0x149));}export function injectExistingStageIds(_0x573da5,_0x309bba){const _0x468bc5=a168_0x5cf043,_0x11d8ad=new Map(_0x309bba[_0x468bc5(0xe6)](_0x2a4f64=>[_0x2a4f64[_0x468bc5(0x170)],_0x2a4f64['id']]));for(const _0x432bef of _0x573da5){if(!_0x432bef['id']){const _0x296075=_0x11d8ad['get'](_0x432bef[_0x468bc5(0x170)]);_0x296075&&(_0x432bef['id']=_0x296075);}}}export function resolveTDFolderPath(_0x3f5157,_0x32eaa8,_0x2fda92){const _0x256e7d=a168_0x5cf043;if(!_0x32eaa8)return _0x3f5157;if(_0x3f5157===_0x2fda92||_0x3f5157[_0x256e7d(0xfc)](_0x2fda92+'/'))return _0x3f5157;return _0x3f5157?_0x2fda92+'/'+_0x3f5157:_0x2fda92;}export function addFoldersToCreate(_0x5f0610,_0x470172,_0x249259){const _0x5a1ebd=a168_0x5cf043;if(!_0x5f0610)return;if(_0x470172[_0x5a1ebd(0x15a)](_0x5f0610))return;const _0x15e8d9=_0x5f0610[_0x5a1ebd(0xdb)]('/');let _0x51b55f='';for(const _0x821fbb of _0x15e8d9){_0x51b55f=_0x51b55f?_0x51b55f+'/'+_0x821fbb:_0x821fbb,!_0x470172[_0x5a1ebd(0x15a)](_0x51b55f)&&_0x249259['add'](_0x51b55f);}}export function sortFoldersByDepth(_0x11e951){const _0x4f3378=a168_0x5cf043;return[..._0x11e951][_0x4f3378(0x13e)]((_0x4eddd9,_0x2e2249)=>{const _0x2904e4=_0x4f3378,_0x409d58=(_0x4eddd9[_0x2904e4(0x1ba)](/\//g)||[])['length'],_0x1622e2=(_0x2e2249['match'](/\//g)||[])[_0x2904e4(0xdc)];return _0x409d58-_0x1622e2;});}import*as a168_0x54cead from'yaml';import{readFileSync}from'fs';import a168_0x1426cc from'path';import{isJourneyDef,parseYamlString as a168_0x2e04ad,toYamlString as a168_0x25b02b,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(_0x4d40d2){const _0x434de2=a168_0x5cf043;if(Array[_0x434de2(0x175)](_0x4d40d2))return'['+_0x4d40d2[_0x434de2(0xe6)](_0x59310b=>stableStringify(_0x59310b))['join'](',')+']';if(_0x4d40d2&&typeof _0x4d40d2==='object'){const _0x3bcf25=_0x4d40d2,_0x309eda=Object['keys'](_0x3bcf25)['sort'](),_0x655a47=_0x309eda[_0x434de2(0xe6)](_0xb24fef=>'\x22'+_0xb24fef+'\x22:'+stableStringify(_0x3bcf25[_0xb24fef]));return'{'+_0x655a47[_0x434de2(0x1b4)](',')+'}';}const _0x35229d=JSON[_0x434de2(0x10b)](_0x4d40d2);return _0x35229d===undefined?_0x434de2(0x194):_0x35229d;}function activationSignature(_0x50a3a7){const _0x3921a5=a168_0x5cf043,_0x337d1b={'connection':_0x50a3a7[_0x3921a5(0x1c5)],..._0x50a3a7[_0x3921a5(0x18d)]!==undefined&&{'all_columns':_0x50a3a7['all_columns']},..._0x50a3a7[_0x3921a5(0x19f)]!==undefined&&{'columns':_0x50a3a7[_0x3921a5(0x19f)]},..._0x50a3a7[_0x3921a5(0x1c9)]!==undefined&&{'behavior':_0x50a3a7[_0x3921a5(0x1c9)]},..._0x50a3a7[_0x3921a5(0x197)]!==undefined&&{'behaviors':_0x50a3a7[_0x3921a5(0x197)]},..._0x50a3a7[_0x3921a5(0xfb)]!==undefined&&{'schedule':_0x50a3a7[_0x3921a5(0xfb)]},..._0x50a3a7[_0x3921a5(0x111)]!==undefined&&{'notification':_0x50a3a7[_0x3921a5(0x111)]},..._0x50a3a7[_0x3921a5(0x107)]!==undefined&&{'connector_config':_0x50a3a7[_0x3921a5(0x107)]},..._0x50a3a7[_0x3921a5(0x1d6)]!==undefined&&{'activation_template_id':_0x50a3a7[_0x3921a5(0x1d6)]}};return stableStringify(_0x337d1b);}async function fetchSegment(_0x12610a,_0x2ad920,_0x2ac65b,_0x13a0ed){const _0xb4156d=a168_0x5cf043,_0x1c5730=_0x13a0ed?.[_0xb4156d(0x11b)](_0x2575d1=>_0x2575d1['id']===_0x2ac65b);if(_0x1c5730)return _0x1c5730;try{return await _0x12610a[_0xb4156d(0x160)][_0xb4156d(0x13c)](_0x2ad920,_0x2ac65b);}catch(_0x202092){logger[_0xb4156d(0x142)](_0xb4156d(0x199)+_0x2ac65b+_0xb4156d(0x192)+_0x202092);try{return await _0x12610a[_0xb4156d(0x160)]['getSegmentEntity'](_0x2ac65b);}catch(_0x4aaac4){return logger[_0xb4156d(0x142)](_0xb4156d(0x1b5)+_0x2ac65b+':\x20'+_0x4aaac4),null;}}}function recoverSegmentIdsFromPushRecovery(_0x485fb7,_0x26fb8f,_0x53f306){const _0x3e0c35=a168_0x5cf043,_0x849992=readPushRecovery(_0x485fb7[_0x3e0c35(0x139)]);if(_0x849992?.[_0x3e0c35(0x120)]===_0x485fb7[_0x3e0c35(0x152)][_0x3e0c35(0x170)])for(const [_0x134652,_0xf1f8c0]of Object[_0x3e0c35(0x1ad)](_0x849992[_0x3e0c35(0x17e)])){const _0x9a32cf=generateDeterministicJourneySegmentName(_0x485fb7['yamlConfig'][_0x3e0c35(0x170)],_0x134652);_0xf1f8c0[_0x3e0c35(0xfa)]===_0x9a32cf&&(_0x26fb8f[_0x3e0c35(0x1ce)](_0x134652,_0xf1f8c0[_0x3e0c35(0x14b)]),_0x53f306[_0x3e0c35(0x1ce)](_0x134652,_0xf1f8c0[_0x3e0c35(0x14b)]));}}async function createOrRecoverEmbeddedSegment(_0x1c6fc4,_0x3da9c8,_0x2c6968,_0x4a4317){const _0x355c4f=a168_0x5cf043;let _0x32ba6a;try{_0x32ba6a=await _0x1c6fc4[_0x355c4f(0x160)][_0x355c4f(0x168)]({'name':_0x2c6968['uniqueSegmentName'],'description':_0x2c6968[_0x355c4f(0x1cb)],'journeyId':_0x2c6968['journeyId'],'rule':_0x4a4317(_0x2c6968['resolvedRule'],!![]),'countPopulation':!![],'parentFolderId':_0x2c6968['folderId'],'audienceId':_0x2c6968[_0x355c4f(0x180)]});}catch(_0x605f1d){const _0x4fb381=_0x605f1d instanceof Error&&_0x605f1d['message'][_0x355c4f(0xe1)](_0x355c4f(0x1a4));if(_0x4fb381){const _0x55acc1=readPushRecovery(_0x3da9c8[_0x355c4f(0x139)]),_0x170400=_0x55acc1?.['journeyName']===_0x3da9c8['yamlConfig'][_0x355c4f(0x170)]?_0x55acc1[_0x355c4f(0x17e)][_0x2c6968[_0x355c4f(0x113)]]:undefined;if(_0x170400?.['uniqueServerName']===_0x2c6968[_0x355c4f(0xed)])await _0x1c6fc4[_0x355c4f(0x160)][_0x355c4f(0xff)](_0x2c6968[_0x355c4f(0x180)],_0x170400[_0x355c4f(0x14b)],{'description':_0x2c6968['description'],'rule':_0x4a4317(_0x2c6968[_0x355c4f(0xe2)],!![]),'countPopulation':!![]}),_0x32ba6a=_0x170400[_0x355c4f(0x14b)];else throw new SDKError(ErrorCode[_0x355c4f(0x109)],'Embedded\x20segment\x20\x27'+_0x2c6968[_0x355c4f(0x113)]+'\x27\x20already\x20exists\x20on\x20server\x20but\x20cannot\x20be\x20found.\x20'+(_0x355c4f(0x145)+_0x3da9c8['absolutePath'][_0x355c4f(0x1d5)](/([^/]+)$/,_0x355c4f(0x17b))+')\x20')+'and\x20the\x20server\x20segment,\x20then\x20retry.',_0x605f1d);}else throw _0x605f1d;}return saveSegmentToPushRecovery(_0x3da9c8['absolutePath'],_0x3da9c8[_0x355c4f(0x152)][_0x355c4f(0x170)],_0x2c6968[_0x355c4f(0x113)],{'segmentId':_0x32ba6a,'uniqueServerName':_0x2c6968['uniqueSegmentName'],'createdAt':new Date()[_0x355c4f(0x143)]()}),_0x32ba6a;}export async function prepareSegmentFiles(_0x1bc919,_0x95fad8,_0x4e93bb,_0x83f607,_0x151519){const _0x29d9bd=a168_0x5cf043,{activationDefToCreateRequest:_0x44842d}=await import(_0x29d9bd(0x173)),_0x329084=[],_0xa6743d=new Set();for(const {yamlConfig:_0x4b082e,folderPath:_0x3c484a,sourcePath:_0x32ca30}of _0x1bc919){const _0x345874=resolveTDFolderPath(_0x3c484a,_0x83f607,_0x151519),_0xdc6e05=_0x345874+':'+_0x4b082e[_0x29d9bd(0x170)],_0x4c8978=_0x95fad8[_0x29d9bd(0x18c)]['get'](_0xdc6e05),_0x5529e9=_0x4c8978?_0x95fad8[_0x29d9bd(0x172)][_0x29d9bd(0x11e)](_0x4c8978['id'])||[]:[];addFoldersToCreate(_0x345874,_0x95fad8[_0x29d9bd(0x136)],_0xa6743d);const _0x2d9d98=calculateActivationActions(_0x4b082e[_0x29d9bd(0x1d9)]||[],_0x5529e9,_0x95fad8['idToEmailMap'],_0x95fad8[_0x29d9bd(0x156)]);for(const _0x654c46 of _0x2d9d98){(_0x654c46['type']===_0x29d9bd(0x10f)||_0x654c46[_0x29d9bd(0xe9)]===_0x29d9bd(0xfd))&&_0x654c46[_0x29d9bd(0x17f)]&&(_0x654c46['validatedRequest']=await _0x44842d(_0x654c46['yamlActivation'],_0x4e93bb));}const _0x4b1cc2=calculateSegmentDiff(_0x4b082e,_0x4c8978,_0x5529e9,_0x95fad8['idToEmailMap'],_0x95fad8[_0x29d9bd(0x156)]);_0x329084['push']({'relativePath':_0x4b082e[_0x29d9bd(0x170)],'absolutePath':_0x32ca30,'yamlConfig':_0x4b082e,'folderPath':_0x345874,'existingSegment':_0x4c8978,'existingActivations':_0x5529e9,'isNew':_0x4b1cc2[_0x29d9bd(0x1c4)],'hasChanges':_0x4b1cc2['hasChanges'],'diff':_0x4b1cc2['diff'],'activationActions':_0x2d9d98});}return{'segmentFiles':_0x329084,'foldersToCreate':_0xa6743d};}export async function prepareJourneyFiles(_0x3b3d3e,_0x51659d,_0x7963b3,_0x45355c){const _0x4cc796=a168_0x5cf043,_0x3afacd=[],_0x34ff78=new Set();for(const {yamlConfig:_0x2ae3aa,folderPath:_0x3b68c8,sourcePath:_0x3c1cc8}of _0x3b3d3e){const _0x432ae5=resolveTDFolderPath(_0x3b68c8,_0x7963b3,_0x45355c),_0x599dd0=_0x432ae5+':'+_0x2ae3aa[_0x4cc796(0x170)],_0x5241ef=_0x51659d[_0x4cc796(0xf2)][_0x4cc796(0x11e)](_0x599dd0);let _0x593350,_0x413c5c;if(_0x5241ef&&_0x5241ef[_0x4cc796(0xdc)]>0x0){const _0x1cdd21=buildLocalExpandedRuleMappings(_0x2ae3aa),{createYamlContext:_0x5c7965,prefetchJourneySegments:_0x4db13a}=createPushYamlContextForBundle(_0x51659d[_0x4cc796(0x114)],_0x51659d['parentId'],_0x51659d[_0x4cc796(0x169)],_0x1cdd21,_0x51659d[_0x4cc796(0x196)],_0x51659d[_0x4cc796(0x156)],_0x51659d[_0x4cc796(0x13b)],_0x51659d[_0x4cc796(0x11a)]);await _0x4db13a(_0x5241ef['map'](_0x2ed6f4=>_0x2ed6f4['id']));const _0x49ec97=await _0x51659d[_0x4cc796(0x114)][_0x4cc796(0x12b)][_0x4cc796(0x14e)](_0x5241ef[0x0][_0x4cc796(0x191)]),_0x35a202=hasMultipleVersions(_0x2ae3aa),_0x327e9c=async _0x5abcd5=>{const _0xa087ab=_0x4cc796,_0xe16f0b=_0x51659d[_0xa087ab(0x11a)]?.[_0xa087ab(0x11e)](_0x5abcd5);if(_0xe16f0b)return _0xe16f0b;return _0x51659d['fetchJourney']({'journeyId':_0x5abcd5,'journeyName':_0x2ae3aa[_0xa087ab(0x170)],'isMultiVersion':_0x5241ef['length']>0x1});};if(_0x35a202&&_0x5241ef[_0x4cc796(0xdc)]>0x1){const _0x457bbc=[];for(const _0x59ecc3 of _0x5241ef){const _0xb79c0c=_0x59ecc3[_0x4cc796(0x11f)]||0x1;_0x51659d[_0x4cc796(0x155)]?.[_0x4cc796(0xfd)]('Fetching\x20'+_0x2ae3aa[_0x4cc796(0x170)]+'\x20v'+_0xb79c0c);const _0x3e90bf=await _0x327e9c(_0x59ecc3['id']),_0xdded05=_0x5c7965(_0x59ecc3['id']),_0x318fc1=await journeyResponseToDef(_0x3e90bf,_0xdded05);_0x457bbc[_0x4cc796(0x164)]({'item':_0x59ecc3,'yaml':_0x318fc1});}const _0x187500=buildLocalRuleToNameMappingFromJourney(_0x2ae3aa);_0x413c5c=buildMergedJourneyDef(_0x457bbc,_0x187500,_0x49ec97);const _0x19d0d3=Math[_0x4cc796(0x190)](..._0x457bbc[_0x4cc796(0xe6)](_0x2613af=>_0x2613af['item'][_0x4cc796(0x11f)]||0x0)),_0x4f2faf=_0x5241ef[_0x4cc796(0x11b)](_0x561a1a=>(_0x561a1a[_0x4cc796(0x11f)]||0x0)===_0x19d0d3);_0x4f2faf&&(_0x51659d['progress']?.[_0x4cc796(0xfd)](_0x4cc796(0x126)+_0x2ae3aa[_0x4cc796(0x170)]+'\x20v'+_0x19d0d3),_0x593350=await _0x327e9c(_0x4f2faf['id']));}else{const _0x27e0b6=_0x5241ef[_0x5241ef[_0x4cc796(0xdc)]-0x1];_0x51659d['progress']?.[_0x4cc796(0xfd)](_0x4cc796(0x126)+_0x2ae3aa[_0x4cc796(0x170)]),_0x593350=await _0x327e9c(_0x27e0b6['id']);const _0x28df19=_0x5c7965(_0x27e0b6['id']),_0x4962d1=await journeyResponseToDef(_0x593350,_0x28df19),_0x215467=buildLocalRuleToNameMappingFromJourney(_0x2ae3aa);_0x413c5c=buildMergedJourneyDef([{'item':_0x27e0b6,'yaml':_0x4962d1}],_0x215467,_0x49ec97);}}addFoldersToCreate(_0x432ae5,_0x51659d['folderPathToId'],_0x34ff78);const _0x5375db=calculateJourneyDiff(_0x2ae3aa,_0x413c5c);_0x3afacd['push']({'relativePath':_0x2ae3aa['name'],'absolutePath':_0x3c1cc8,'yamlConfig':_0x2ae3aa,'folderPath':_0x432ae5,'existingJourney':_0x593350,'isNew':_0x5375db['isNew'],'hasChanges':_0x5375db[_0x4cc796(0x1a7)],'diff':_0x5375db['diff']});}return{'journeyFiles':_0x3afacd,'foldersToCreate':_0x34ff78};}export function calculateActivationActions(_0x1023a0,_0x532b81,_0x14fa0e,_0x3ad99a){const _0x113710=a168_0x5cf043,_0x28cfe0=[],_0x2a1cdf=new Map();for(const _0x4e29fe of _0x532b81){_0x2a1cdf[_0x113710(0x1ce)](_0x4e29fe['name'],_0x4e29fe);}const _0x24aea2=new Map();for(const _0x33dc87 of _0x1023a0){_0x24aea2[_0x113710(0x1ce)](_0x33dc87[_0x113710(0x170)],_0x33dc87);}for(const _0x517981 of _0x1023a0){const _0x40b5cf=_0x2a1cdf[_0x113710(0x11e)](_0x517981[_0x113710(0x170)]);if(!_0x40b5cf)_0x28cfe0[_0x113710(0x164)]({'type':_0x113710(0x10f),'name':_0x517981[_0x113710(0x170)],'yamlActivation':_0x517981});else{const _0x3d8f1a=activationResponseToDef(_0x40b5cf,_0x14fa0e,_0x3ad99a),_0x334862=a168_0x54cead[_0x113710(0x10b)](_0x3d8f1a),_0x11ca26=a168_0x54cead[_0x113710(0x10b)](_0x517981);_0x334862!==_0x11ca26&&_0x28cfe0['push']({'type':_0x113710(0xfd),'name':_0x517981[_0x113710(0x170)],'yamlActivation':_0x517981,'existingActivation':_0x40b5cf});}}for(const _0x206b78 of _0x532b81){!_0x24aea2['has'](_0x206b78['name'])&&_0x28cfe0[_0x113710(0x164)]({'type':_0x113710(0xdf),'name':_0x206b78[_0x113710(0x170)],'existingActivation':_0x206b78});}return _0x28cfe0;}function calculateYamlDiff(_0x57c84e,_0x3a4589){if(_0x3a4589){const _0x865e32=generateDiff(_0x3a4589,_0x57c84e),_0x59dd65=hasChanges(_0x865e32);return{'isNew':![],'hasChanges':_0x59dd65,'diff':_0x59dd65?formatDiffWithColors(_0x865e32):undefined};}const _0x4b3e5a=generateDiff('',_0x57c84e);return{'isNew':!![],'hasChanges':![],'diff':formatDiffWithColors(_0x4b3e5a)};}export function calculateSegmentDiff(_0x5dee8e,_0x417ee8,_0x1469f6,_0x40004b,_0x2088bd){const _0x3fa0ad=segmentToYamlString(_0x5dee8e),_0x89310e=_0x417ee8?segmentToYamlString(segmentWithActivationsToYaml(_0x417ee8,_0x1469f6,undefined,_0x40004b,_0x2088bd)):undefined;return calculateYamlDiff(_0x3fa0ad,_0x89310e);}export function calculateJourneyDiff(_0x2802be,_0x557eee){const _0x3e9999=normalizeJourneyDef(_0x2802be,_0x2802be),_0x53abde=a168_0x25b02b(_0x3e9999),_0x454cad=_0x557eee?a168_0x25b02b(normalizeJourneyDef(_0x557eee,_0x2802be)):undefined;return calculateYamlDiff(_0x53abde,_0x454cad);}export function findSegmentsToDelete(_0x531f3a,_0x705f88,_0x3e5007,_0x237e22,_0xa0d5ed){const _0x47f14e=a168_0x5cf043,_0x12a152=new Set();for(const {yamlConfig:_0x50940b,folderPath:_0x40941a}of _0x705f88){_0x12a152[_0x47f14e(0x16c)](_0x40941a+':'+_0x50940b[_0x47f14e(0x170)]);}return _0x531f3a['filter'](_0x136537=>{const _0x5e85e7=_0x47f14e,_0x8144b8=_0x136537[_0x5e85e7(0x150)]?_0x3e5007[_0x5e85e7(0x11e)](_0x136537[_0x5e85e7(0x150)][_0x5e85e7(0x178)]())||'':'',_0x4313e0=_0x8144b8+':'+_0x136537[_0x5e85e7(0x170)];if(_0x12a152[_0x5e85e7(0x15a)](_0x4313e0))return![];if(_0xa0d5ed)return _0x8144b8===_0x237e22||_0x8144b8[_0x5e85e7(0xfc)](_0x237e22+'/');return!![];});}export function findJourneysToDelete(_0x49bca5,_0x3dd1ba,_0x41ef9f,_0x4bc9c7,_0xc18b20){const _0x5c3b9a=a168_0x5cf043,_0xee11fd=new Set();for(const {yamlConfig:_0x5370ff,folderPath:_0x55b734}of _0x3dd1ba){_0xee11fd[_0x5c3b9a(0x16c)](_0x55b734+':'+_0x5370ff['name']);}return _0x49bca5['filter'](_0xa6d3df=>{const _0x58756a=_0x5c3b9a,_0x282ea3=_0xa6d3df[_0x58756a(0x15f)]?_0x41ef9f[_0x58756a(0x11e)](_0xa6d3df[_0x58756a(0x15f)])||'':'',_0x42f523=_0x282ea3+':'+_0xa6d3df[_0x58756a(0x138)];if(_0xee11fd[_0x58756a(0x15a)](_0x42f523))return![];if(_0xc18b20)return _0x282ea3===_0x4bc9c7||_0x282ea3[_0x58756a(0xfc)](_0x4bc9c7+'/');return!![];});}export function buildSegmentLookupMap(_0x4b74b7,_0x50da9a){const _0x2c110f=a168_0x5cf043,_0x4f2a6f=new Map();for(const _0x4a5e79 of _0x4b74b7){const _0x279a9a=_0x4a5e79[_0x2c110f(0x150)]?_0x50da9a['get'](_0x4a5e79[_0x2c110f(0x150)][_0x2c110f(0x178)]())||'':'',_0x29851a=_0x279a9a+':'+_0x4a5e79[_0x2c110f(0x170)];_0x4f2a6f[_0x2c110f(0x1ce)](_0x29851a,_0x4a5e79);}return _0x4f2a6f;}export function buildSegmentNameToIdMap(_0x4aec0e){const _0x1f1420=a168_0x5cf043,_0x1d61c6=new Map();for(const _0x1ac2f6 of _0x4aec0e){_0x1d61c6[_0x1f1420(0x1ce)](_0x1ac2f6[_0x1f1420(0x170)],_0x1ac2f6['id']);}return _0x1d61c6;}export function buildJourneyBundleLookupMap(_0x4d4116,_0x41eaeb){const _0x42c932=a168_0x5cf043,_0x3c4ab2=new Map();for(const _0x97743f of _0x4d4116){const _0x265eb3=_0x97743f[_0x42c932(0x15f)]?_0x41eaeb[_0x42c932(0x11e)](_0x97743f[_0x42c932(0x15f)])||'':'',_0x5de2e1=_0x265eb3+':'+_0x97743f[_0x42c932(0x138)];!_0x3c4ab2[_0x42c932(0x15a)](_0x5de2e1)&&_0x3c4ab2['set'](_0x5de2e1,[]),_0x3c4ab2[_0x42c932(0x11e)](_0x5de2e1)[_0x42c932(0x164)](_0x97743f);}for(const _0x385f02 of _0x3c4ab2[_0x42c932(0x12a)]()){_0x385f02['sort']((_0x4a8f8a,_0x3c613f)=>(_0x4a8f8a[_0x42c932(0x11f)]||0x0)-(_0x3c613f[_0x42c932(0x11f)]||0x0));}return _0x3c4ab2;}export function collectFoldersToCreate(_0x1203aa,_0xb4ec){const _0x3207c6=a168_0x5cf043,_0x49bd2b=new Set();for(const _0x506851 of _0x1203aa){if(!_0x506851)continue;if(_0xb4ec[_0x3207c6(0x15a)](_0x506851))continue;const _0x446932=_0x506851['split']('/');let _0x5eeffc='';for(const _0x52ce00 of _0x446932){_0x5eeffc=_0x5eeffc?_0x5eeffc+'/'+_0x52ce00:_0x52ce00,!_0xb4ec[_0x3207c6(0x15a)](_0x5eeffc)&&_0x49bd2b['add'](_0x5eeffc);}}return _0x49bd2b;}export function parseAndClassifyYamlFiles(_0x3da1b1,_0x3b7f03,_0x44b084){const _0x3605a9=a168_0x5cf043,_0x56f843=[],_0x154a54=[];for(const _0x15c297 of _0x3da1b1){const _0xd68242=a168_0x1426cc[_0x3605a9(0x158)](_0x3b7f03,a168_0x1426cc[_0x3605a9(0x1d2)](_0x15c297)),_0x438b87=_0xd68242==='.'?'':_0xd68242[_0x3605a9(0x1d5)](/\\/g,'/'),_0x263d98=readFileSync(_0x15c297,_0x3605a9(0x19d)),_0x4d950b=a168_0x54cead['parse'](_0x263d98);if(isJourneyDef(_0x4d950b,_0x15c297)){const _0x8c4cd6=a168_0x2e04ad(_0x263d98);_0x154a54[_0x3605a9(0x164)]({'yamlConfig':_0x8c4cd6,'folderPath':_0x438b87,'sourcePath':_0x15c297});}else{if(!_0x44b084?.[_0x3605a9(0x141)]){const _0x148437=parseSegmentYamlFile(_0x263d98),_0x23bdd5=normalizeChildSegmentYaml(_0x148437);_0x56f843[_0x3605a9(0x164)]({'yamlConfig':_0x23bdd5,'folderPath':_0x438b87,'sourcePath':_0x15c297});}}}return{'segments':_0x56f843,'journeys':_0x154a54};}export function validateParsedFiles(_0x1bb764,_0x5aaa55){const _0x58f636=a168_0x5cf043,_0x51c76c=[];for(const {yamlConfig:_0x4b2df5,sourcePath:_0x46265b}of _0x1bb764[_0x58f636(0x17e)]){const _0x1db5a6=readFileSync(_0x46265b,_0x58f636(0x19d)),_0x2f37c0=a168_0x54cead[_0x58f636(0x1b6)](_0x1db5a6),_0x34875c=validateSegmentDef(_0x4b2df5,{'source':_0x1db5a6,'document':_0x2f37c0},{'skipSchema':!![]});if(!_0x34875c[_0x58f636(0x179)]){const _0x5a52ed=a168_0x1426cc[_0x58f636(0x158)](_0x5aaa55,_0x46265b);_0x51c76c[_0x58f636(0x164)]({'filePath':_0x5a52ed,'source':_0x1db5a6,'result':_0x34875c,'isJourney':![]});}}for(const {yamlConfig:_0x16be9d,sourcePath:_0x571a0f}of _0x1bb764[_0x58f636(0x108)]){const _0x40cd17=readFileSync(_0x571a0f,_0x58f636(0x19d)),_0x4305fd=a168_0x54cead[_0x58f636(0x1b6)](_0x40cd17),_0x551bd7=validateJourneyDef(_0x16be9d,{'source':_0x40cd17,'document':_0x4305fd},{'skipSchema':!![]});if(!_0x551bd7['valid']){const _0x5ab347=a168_0x1426cc[_0x58f636(0x158)](_0x5aaa55,_0x571a0f);_0x51c76c[_0x58f636(0x164)]({'filePath':_0x5ab347,'source':_0x40cd17,'result':_0x551bd7,'isJourney':!![]});}}return _0x51c76c;}export function formatValidationErrors(_0x5d8682){const _0x4e89de=a168_0x5cf043,_0x507cff=[];for(const {filePath:_0x3ee463,source:_0x18a57b,result:_0x10e7bb,isJourney:_0x209d6c}of _0x5d8682){const _0x201c19=_0x209d6c?_0x4e89de(0x12b):'segment';_0x507cff[_0x4e89de(0x164)]('\x0a'+_0x3ee463+'\x20('+_0x201c19+_0x4e89de(0xee)+_0x10e7bb[_0x4e89de(0x1b1)][_0x4e89de(0xdc)]+'\x20error(s)'),_0x507cff[_0x4e89de(0x164)](formatValidationResult(_0x10e7bb,_0x18a57b,_0x3ee463));}return _0x507cff[_0x4e89de(0x1b4)]('\x0a');}export function buildLocalExpandedRuleMappings(_0x27b487){const _0x49393c=a168_0x5cf043,_0x5bd342=new Set(),_0x455b15=new Map(),_0xbfdc9=collectSegmentUsageCounts(_0x27b487);if(_0x27b487[_0x49393c(0x17e)])for(const [_0x102909,_0x385b4f]of Object[_0x49393c(0x1ad)](_0x27b487['segments'])){_0x5bd342['add'](_0x102909);if(_0x385b4f[_0x49393c(0x116)]){const _0x3593ec=yamlRuleToApi(_0x385b4f['rule']),_0x3df486=apiRuleToYaml(_0x3593ec);_0x455b15[_0x49393c(0x1ce)](_0x102909,_0x3df486);}}const _0x56f637=new Map();let _0x24b841=0x0;for(const [_0x1e1325,_0x7e02a]of _0x455b15){const _0xd6ff29=serializeExpandedRule(_0x7e02a,_0x455b15),_0x3c49b1=_0x56f637['get'](_0xd6ff29)||[];_0x3c49b1['push']({'name':_0x1e1325,'index':_0x24b841}),_0x56f637[_0x49393c(0x1ce)](_0xd6ff29,_0x3c49b1),_0x24b841++;}const _0x1f5b2d=new Map();for(const [_0x53545e,_0x20678d]of _0x56f637){const _0x3ff8fa=_0x20678d[_0x49393c(0x1c8)]()[_0x49393c(0x13e)]((_0x5eb75e,_0x6c8fc0)=>{const _0x54c21b=_0x49393c,_0x12cdf0=_0xbfdc9[_0x54c21b(0x11e)](_0x5eb75e['name'])||0x0,_0x3774a1=_0xbfdc9[_0x54c21b(0x11e)](_0x6c8fc0[_0x54c21b(0x170)])||0x0;if(_0x12cdf0!==_0x3774a1)return _0x3774a1-_0x12cdf0;return _0x5eb75e[_0x54c21b(0x183)]-_0x6c8fc0[_0x54c21b(0x183)];})['map'](_0x2330bb=>_0x2330bb[_0x49393c(0x170)]),_0x3c0e66=[];for(const _0x27cad3 of _0x3ff8fa){const _0x411b3a=_0xbfdc9[_0x49393c(0x11e)](_0x27cad3)||0x0,_0x3f2b9e=Math[_0x49393c(0x190)](_0x411b3a,0x1);for(let _0x18ea67=0x0;_0x18ea67<_0x3f2b9e;_0x18ea67++){_0x3c0e66[_0x49393c(0x164)](_0x27cad3);}}_0x1f5b2d[_0x49393c(0x1ce)](_0x53545e,_0x3c0e66);}return{'existingLocalSegmentNames':_0x5bd342,'localSegmentRules':_0x455b15,'localExpandedRuleToNames':_0x1f5b2d};}export function createSegmentIdResolver(_0xd4f03d,_0x49d232){return async _0x29f939=>{const _0x486ec3=a168_0x51ba,_0x45b23a=_0xd4f03d['get'](_0x29f939);if(!_0x45b23a)throw new SDKError(ErrorCode[_0x486ec3(0xeb)],'Segment\x20not\x20found:\x20'+_0x29f939+'\x20(referenced\x20in\x20embedded\x20segment\x20\x27'+_0x49d232+'\x27)');return _0x45b23a;};}export function extractRootFolderId(_0x4480c9){const _0x3b05f8=a168_0x5cf043;return _0x4480c9['relationships']?.[_0x3b05f8(0x1ac)]?.[_0x3b05f8(0x1d3)]?.['id']||_0x4480c9[_0x3b05f8(0x1d4)]?.['parentFolder']?.[_0x3b05f8(0x1d3)]?.['id'];}export function buildConnectionMaps(_0x4ca390){const _0x392eff=a168_0x5cf043,_0xc2b9c0=new Map(),_0x393df5=new Map(),_0x2a6a29=new Map();for(const _0x4b0126 of _0x4ca390){_0xc2b9c0[_0x392eff(0x1ce)](_0x4b0126['name'],parseInt(_0x4b0126['id'],0xa)),_0x393df5['set'](_0x4b0126['id'],_0x4b0126['name']),_0x2a6a29[_0x392eff(0x1ce)](_0x4b0126['name'],_0x4b0126[_0x392eff(0xe9)]);}return{'nameToId':_0xc2b9c0,'idToName':_0x393df5,'nameToType':_0x2a6a29};}function a168_0x5e19(){const _0x59a3b2=['Deleted\x20activation\x20\x27','uniqueSegmentName','):\x20','idToName','\x27\x20not\x20found\x20in\x20journey\x20\x27','conditionTimeoutUnit','journeyBundlesByFolderAndName','resolveSegment','getActivation','folderPath','state','1398nYfKaF','Failed\x20to\x20fetch\x20referenced\x20segment\x20','existingJourney','uniqueServerName','schedule','startsWith','update','existingActivation','updateSegmentById','branches','Deleting\x20activation\x20\x27','journey_entry_criteria_','goal\x20criteria','attributes','\x27\x20wait\x20condition','folder','connector_config','journeys','SEGMENT_UPDATE_ERROR','Segment\x20not\x20found','stringify','deleteActivation','goal','Updating\x20segment\x20\x27','create','segment_deleting','notification','filter','localName','deps','Failed\x20to\x20','rule','logInfo','Updating\x20activation\x20\x27','WaitStep','journeyById','find','embeddedSegmentNameToId','\x27\x20milestone','get','versionNumber','journeyName','steps','logSuccess','toLowerCase','created','conditionTimeoutDuration','Fetching\x20','createdSegmentIds','conditionSegmentId','entry_criteria','values','journey','\x0a\x20\x20','createdSegmentId','285720BEaHjB','NOT_FOUND','ACTIVATION_SYNTAX_ERROR','Updated\x20activation\x20\x27','Stage\x20\x27','Failed\x20to\x20resolve\x20segment\x20','kind','Updated\x20journey\x20\x27','folderPathToId','createSegment','journeyBundleName','absolutePath','with','activationStepsById','getSegment','419IueGGH','sort','Created\x20activation\x20\x27','buildUserMaps','skipSegments','debug','toISOString','unchanged','Delete\x20the\x20push\x20recovery\x20file\x20(','trim','keys','16OlRrlb','draft','1757040KyUkvs','segmentId','\x27...','verbose','getLatestJourneyId','Segment\x20not\x20found:\x20','segmentFolderId','\x27\x20to\x20local\x20\x27','yamlConfig','\x27\x20exit\x20criteria','ACTIVATION_UPDATE_ERROR','progress','connectionIdToNameMap','validatedRequest','relative','from','has','journey_updating','journey_created','Creating\x20activation\x20\x27','deleted','folderId','segment','Entry\x20criteria:\x20','stages','2388USHvmU','push','rootFolderId','activation_updating','getJourney','createJourneySegment','existingSegments','Updated\x20segment\x20\x27','entry','add','user','journeyActivationStepId','JOURNEY_UPDATE_ERROR','name','action','activationsBySegmentId','./child-segment-yaml.js','all','isArray','some','Deleted\x20segment\x20\x27','toString','valid','Cannot\x20create\x20embedded\x20segment\x20for\x20existing\x20journey\x20without\x20journey\x20ID','.$1.push-recovery.json','list','Journey\x20\x27','segments','yamlActivation','parentId','journeyActivationNameToId','172461IPMQAa','index','Matched\x20server\x20segment\x20\x27','entryCriteria','Condition','conditions','__pending_act_','updated','segmentNameToId','../../utils/async.js','segmentByFolderAndName','all_columns','journeyId','4119273zgQeVo','max','journeyBundleId',',\x20falling\x20back\x20to\x20getSegmentEntity:\x20','embedded_activation_creating','null','23859WoGVEB','idToEmailMap','behaviors','withProgress','getSegment\x20failed\x20for\x20','folder_created','results','logDeleted','utf-8','journeyStages','columns','tdx.sdk.push-workflow','Created\x20journey\x20\x27','activation_creating','folder_creating','Name\x20has\x20already\x20been\x20taken','DecisionPoint','\x20journey\x20from\x20file:\x20','hasChanges','./journey-yaml.js','activationActions','\x27\x20entry\x20criteria','Activation','parentSegmentFolder','entries','INTERNAL','Creating\x20segment\x20\x27','\x27\x20from\x20file:\x20','errors','run_after_journey_refresh','existingSegment','join','getSegmentEntity\x20also\x20failed\x20for\x20','parseDocument','reduce','listActivations','2016550NTktRl','match','Failed\x20to\x20sync\x20activations\x20for\x20segment\x20\x27','embedded_segment_creating','segment_deleted','waitStepUnit','activationParams','SEGMENT_SYNTAX_ERROR','7pFxcga','Created\x20segment\x20\x27','logWarning','isNew','connection','\x20(referenced\x20in\x20journey\x20','milestone','slice','behavior','size','description','flatMap','segment_created','set','effectiveFolderId','84jRnDPq','Duration','dirname','data','relationships','replace','activation_template_id','createActivation','nameToId','activations','split','length','exitCriterias','waitStep','delete','activation_deleting','includes','resolvedRule','activationContext','resolveJourneyId','onProgress','map','stage\x20\x27','waitStepType','type','embedded_segment_created','SEGMENT_NOT_FOUND'];a168_0x5e19=function(){return _0x59a3b2;};return a168_0x5e19();}export function calculatePushStats(_0x408f0f,_0x4d9cb7,_0x216b83,_0x2b42cf,_0x294ce4,_0x2c5e85,_0x1cbd14){const _0x39fa17=a168_0x5cf043,_0x5a5e93=_0x408f0f['filter'](_0x4ffa35=>_0x4ffa35['isNew']),_0x1d20c1=_0x408f0f[_0x39fa17(0x112)](_0x5f2b67=>!_0x5f2b67[_0x39fa17(0x1c4)]&&_0x5f2b67[_0x39fa17(0x1a7)]),_0x57a08d=_0x408f0f[_0x39fa17(0x112)](_0x4be8c8=>!_0x4be8c8[_0x39fa17(0x1c4)]&&!_0x4be8c8[_0x39fa17(0x1a7)]),_0x44657a=_0x2c5e85?_0x2b42cf:[],_0x25b27e=_0x4d9cb7[_0x39fa17(0x112)](_0x3c869c=>_0x3c869c[_0x39fa17(0x1c4)]),_0x246cbf=_0x4d9cb7[_0x39fa17(0x112)](_0x1aafba=>!_0x1aafba[_0x39fa17(0x1c4)]&&_0x1aafba[_0x39fa17(0x1a7)]),_0x49480d=_0x4d9cb7[_0x39fa17(0x112)](_0x1b90bd=>!_0x1b90bd[_0x39fa17(0x1c4)]&&!_0x1b90bd[_0x39fa17(0x1a7)]),_0x2d7390=_0x2c5e85?_0x294ce4:[],_0x134e05=_0x408f0f[_0x39fa17(0x1cc)](_0x3c3c12=>_0x3c3c12['activationActions']),_0x41efed=_0x134e05[_0x39fa17(0x112)](_0x4ff0b6=>_0x4ff0b6[_0x39fa17(0xe9)]===_0x39fa17(0x10f)),_0x2dc9b6=_0x134e05[_0x39fa17(0x112)](_0x3624c0=>_0x3624c0['type']===_0x39fa17(0xfd)),_0x14db0e=_0x134e05[_0x39fa17(0x112)](_0x3b435a=>_0x3b435a[_0x39fa17(0xe9)]===_0x39fa17(0xdf)),_0x310282=Array[_0x39fa17(0x159)](_0x216b83)[_0x39fa17(0x13e)](),_0xf294ab=_0x1cbd14?![]:_0x5a5e93[_0x39fa17(0xdc)]>0x0||_0x1d20c1[_0x39fa17(0xdc)]>0x0||_0x44657a[_0x39fa17(0xdc)]>0x0,_0x11fe2e=_0x25b27e[_0x39fa17(0xdc)]>0x0||_0x246cbf[_0x39fa17(0xdc)]>0x0||_0x2d7390[_0x39fa17(0xdc)]>0x0,_0x246afe=_0x1cbd14?![]:_0x134e05[_0x39fa17(0xdc)]>0x0,_0x4eeb35=_0x310282['length']>0x0;return{'segments':{'new':_0x5a5e93,'changed':_0x1d20c1,'unchanged':_0x57a08d,'toDelete':_0x44657a},'journeys':{'new':_0x25b27e,'changed':_0x246cbf,'unchanged':_0x49480d,'toDelete':_0x2d7390},'activations':{'all':_0x134e05,'toCreate':_0x41efed,'toUpdate':_0x2dc9b6,'toDelete':_0x14db0e},'folders':{'toCreate':_0x310282},'counts':{'segments':{'new':_0x5a5e93[_0x39fa17(0xdc)],'changed':_0x1d20c1['length'],'unchanged':_0x57a08d[_0x39fa17(0xdc)],'toDelete':_0x44657a[_0x39fa17(0xdc)]},'journeys':{'new':_0x25b27e['length'],'changed':_0x246cbf[_0x39fa17(0xdc)],'unchanged':_0x49480d[_0x39fa17(0xdc)],'toDelete':_0x2d7390['length']},'activations':{'create':_0x41efed[_0x39fa17(0xdc)],'update':_0x2dc9b6[_0x39fa17(0xdc)],'delete':_0x14db0e[_0x39fa17(0xdc)]},'folders':_0x310282['length']},'hasChanges':_0xf294ab||_0x11fe2e||_0x246afe||_0x4eeb35};}export async function buildPushExecutionContext(_0x80ab30,_0x54aee0,_0xf3ab79,_0x475693,_0x36c4b0,_0x269810){const _0xd737c8=a168_0x5cf043,_0x4ed12a=extractRootFolderId(_0xf3ab79),{pathToId:_0x1f0979,idToPath:_0x11588e}=buildFolderMaps(_0x36c4b0),_0x4ca5db=buildSegmentNameToIdMap(_0x475693),_0x29d44c=new Map(),{batchAsync:_0x3b4f88}=await import(_0xd737c8(0x18b)),[_0x50a5ef,_0x5d3f14]=await Promise[_0xd737c8(0x174)]([_0x80ab30[_0xd737c8(0x16d)][_0xd737c8(0x140)](),_0x80ab30[_0xd737c8(0x1c5)][_0xd737c8(0x17c)](),((async()=>{const _0x18620f=_0xd737c8;!_0x269810&&_0x475693[_0x18620f(0xdc)]>0x0&&await _0x3b4f88(_0x475693,async _0x538458=>{const _0x269824=_0x18620f,_0x3f3fb8=await _0x80ab30[_0x269824(0x160)][_0x269824(0x1b8)](_0x54aee0,_0x538458['id']);_0x29d44c[_0x269824(0x1ce)](_0x538458['id'],_0x3f3fb8);});})())]),{emailToId:_0x4ef16b,idToEmail:_0x2d95a7}=_0x50a5ef,_0xfc9d89=buildConnectionMaps(_0x5d3f14);return{'rootFolderId':_0x4ed12a,'folderPathToId':_0x1f0979,'folderIdToPath':_0x11588e,'segmentNameToId':_0x4ca5db,'activationsBySegmentId':_0x29d44c,'emailToIdMap':_0x4ef16b,'idToEmailMap':_0x2d95a7,'connectionNameToIdMap':_0xfc9d89[_0xd737c8(0x1d8)],'connectionIdToNameMap':_0xfc9d89[_0xd737c8(0xef)],'connectionNameToTypeMap':_0xfc9d89['nameToType']};}export function createPushYamlContextForBundle(_0x22ae8e,_0x35baf6,_0x24eebc,_0x92085e,_0x1f2d2f,_0x922461,_0xac0fd9,_0x40f930){const {existingLocalSegmentNames:_0x541f83,localExpandedRuleToNames:_0xf37207}=_0x92085e,_0x1c2124=new Set(),_0x36956a=new Map(),_0x3998c6=new Map(),_0xacc52f=new Map(),_0x40acff=createJumpTargetCache(),_0x2dcd15=new Map(),_0x4a01e6=new Map(),_0x34bc55=new Set();let _0x444267;const _0x3d2eb7=_0x49a97c=>{const _0x49a935={'resolveSegment':async _0xcf53a9=>{const _0x45792b=a168_0x51ba,_0x345f1f=_0xacc52f[_0x45792b(0x11e)](_0xcf53a9);if(_0x345f1f!==undefined)return{'name':_0x345f1f,'isJourneyLocal':!![]};try{const _0x33ec05=await fetchSegment(_0x22ae8e,_0x35baf6,_0xcf53a9,_0x24eebc);if(!_0x33ec05)throw new Error(_0x45792b(0x10a));const _0x24064e=generateJourneyLocalName(_0x33ec05[_0x45792b(0x170)]),_0x5c4b55=_0x33ec05[_0x45792b(0x134)]===SEGMENT_KIND_JOURNEY&&_0x24064e!==undefined;let _0x2bac69=_0x33ec05[_0x45792b(0x170)],_0x34c437;if(_0x5c4b55&&_0x33ec05[_0x45792b(0x116)]){const _0x4189c0=apiRuleToYaml(_0x33ec05['rule']);_0x4a01e6[_0x45792b(0x1ce)](_0xcf53a9,_0x4189c0);const _0x2cf199=async _0x5a95bf=>{const _0x4dec5e=_0x45792b,_0xf1a0c5=collectSegmentRefsFromRule(_0x5a95bf);for(const _0x5c91b1 of _0xf1a0c5){if(!_0x4a01e6[_0x4dec5e(0x15a)](_0x5c91b1))try{const _0x461b25=await fetchSegment(_0x22ae8e,_0x35baf6,_0x5c91b1,_0x24eebc);if(_0x461b25?.[_0x4dec5e(0x116)]){const _0x1e60c3=apiRuleToYaml(_0x461b25[_0x4dec5e(0x116)]);_0x4a01e6[_0x4dec5e(0x1ce)](_0x5c91b1,_0x1e60c3),await _0x2cf199(_0x1e60c3);}}catch(_0xc6ff3){logger['debug'](_0x4dec5e(0xf8)+_0x5c91b1+':\x20'+_0xc6ff3);}}};await _0x2cf199(_0x4189c0);const _0xf07af9=serializeExpandedRule(_0x4189c0,_0x4a01e6),_0x50770d=_0xf37207[_0x45792b(0x11e)](_0xf07af9);if(_0x50770d&&_0x50770d[_0x45792b(0xdc)]>0x0){const _0x33a4e6=_0x36956a['get'](_0xf07af9)||0x0,_0x1ca255=_0x50770d[_0x33a4e6]||_0x50770d[_0x50770d[_0x45792b(0xdc)]-0x1];_0x36956a[_0x45792b(0x1ce)](_0xf07af9,_0x33a4e6+0x1),_0x2bac69=_0x1ca255,_0x1c2124['add'](_0x2bac69),_0xacc52f['set'](_0xcf53a9,_0x2bac69);const _0x7bd921=await resolveRuleSegmentRefs(_0x4189c0,async _0x4b764e=>{const _0x11956d=_0x45792b,_0x454703=_0xacc52f[_0x11956d(0x11e)](_0x4b764e);if(_0x454703)return _0x454703;const _0x4af0d5=await _0x444267[_0x11956d(0xf3)](_0x4b764e);return _0x4af0d5[_0x11956d(0x170)];});_0x34c437={'description':_0x33ec05['description'],'rule':_0x7bd921};}else{const _0x38319c=_0x2dcd15[_0x45792b(0x11e)](_0xf07af9);if(_0x38319c)_0x2bac69=_0x38319c,_0xacc52f[_0x45792b(0x1ce)](_0xcf53a9,_0x2bac69);else{if(_0x24064e){let _0x72d2c9=_0x24064e,_0x2794d9=0x2;while(_0x1c2124[_0x45792b(0x15a)](_0x72d2c9)||_0x541f83[_0x45792b(0x15a)](_0x72d2c9)){_0x72d2c9=_0x24064e+'_'+_0x2794d9,_0x2794d9++;}_0x1c2124[_0x45792b(0x16c)](_0x72d2c9),_0x2bac69=_0x72d2c9;}_0xacc52f[_0x45792b(0x1ce)](_0xcf53a9,_0x2bac69),_0x2dcd15[_0x45792b(0x1ce)](_0xf07af9,_0x2bac69);const _0x517ebe=await resolveRuleSegmentRefs(_0x4189c0,async _0x3d3548=>{const _0x7381db=_0x45792b,_0x4aa335=_0xacc52f[_0x7381db(0x11e)](_0x3d3548);if(_0x4aa335)return _0x4aa335;const _0x4deb47=await _0x444267['resolveSegment'](_0x3d3548);return _0x4deb47[_0x7381db(0x170)];});_0x34c437={'description':_0x33ec05['description'],'rule':_0x517ebe};}}}return{'name':_0x2bac69,'isJourneyLocal':_0x5c4b55,'definition':_0x34c437};}catch(_0x211be9){return logger[_0x45792b(0x142)](_0x45792b(0x133)+_0xcf53a9+':\x20'+_0x211be9),{'name':_0xcf53a9,'isJourneyLocal':![]};}},'resolveActivation':async _0x2b1a91=>{const _0x3ec0bf=a168_0x51ba,_0x894e43=_0x3998c6[_0x3ec0bf(0x11e)](_0x2b1a91);if(_0x894e43!==undefined)return{'name':_0x894e43,'isJourneyLocal':!![]};try{let _0x4590d6=_0xac0fd9?.[_0x3ec0bf(0x11e)](_0x2b1a91);!_0x4590d6&&(_0x4590d6=await _0x22ae8e[_0x3ec0bf(0x12b)][_0x3ec0bf(0xf4)](_0x49a97c,_0x2b1a91));const _0x512c5b=_0x4590d6[_0x3ec0bf(0x104)][_0x3ec0bf(0x1bf)][_0x3ec0bf(0x170)]||_0x2b1a91,_0x41c766=sanitizeYamlKey(_0x512c5b)||'activation_'+_0x2b1a91,_0x1c8400=_0x41c766;_0x3998c6['set'](_0x2b1a91,_0x1c8400);const _0x1a3c4f=journeyActivationStepToYaml(_0x4590d6,_0x1f2d2f,_0x922461);return{'name':_0x1c8400,'isJourneyLocal':!![],'definition':_0x1a3c4f};}catch(_0x597c45){return logger[_0x3ec0bf(0x142)]('Failed\x20to\x20resolve\x20activation\x20'+_0x2b1a91+':\x20'+_0x597c45),{'name':_0x2b1a91,'isJourneyLocal':![]};}},'resolveJumpTarget':(_0xea22dc,_0x57e591)=>resolveJumpTarget(_0xea22dc,_0x57e591,_0x40acff,async _0x2ee192=>{const _0x2c14e8=a168_0x51ba,_0x441798=_0x40f930?.[_0x2c14e8(0x11e)](_0x2ee192);if(_0x441798)return _0x441798;return _0x22ae8e['journey'][_0x2c14e8(0x167)](_0x2ee192);})};return _0x444267=_0x49a935,_0x49a935;},_0x240eb5=async _0xc298=>{const _0x205457=a168_0x51ba,{collectSegmentIdsFromJourneyApi:_0x38dd9c}=await import(_0x205457(0x1a8)),{batchAsync:_0x33ee08}=await import(_0x205457(0x18b)),_0x4c2288=new Set();for(const _0x16f470 of _0xc298){let _0x52748d=_0x40f930?.[_0x205457(0x11e)](_0x16f470);!_0x52748d&&(_0x52748d=await _0x22ae8e[_0x205457(0x12b)]['getJourney'](_0x16f470));const _0x4ac2eb=_0x38dd9c(_0x52748d);for(const _0x4ae821 of _0x4ac2eb){_0x4c2288[_0x205457(0x16c)](_0x4ae821);}}let _0x3c32b1=Array[_0x205457(0x159)](_0x4c2288);while(_0x3c32b1[_0x205457(0xdc)]>0x0){const _0x2214d7=_0x3c32b1[_0x205457(0x112)](_0x14f182=>!_0x34bc55['has'](_0x14f182));if(_0x2214d7['length']===0x0)break;const _0x36b94b=await _0x33ee08(_0x2214d7,async _0x1a04e4=>{const _0xa7de7d=_0x205457;_0x34bc55[_0xa7de7d(0x16c)](_0x1a04e4);const _0x3eb3bb=await fetchSegment(_0x22ae8e,_0x35baf6,_0x1a04e4,_0x24eebc);if(!_0x3eb3bb)return null;return{'segmentId':_0x1a04e4,'segment':_0x3eb3bb};},0xa),_0x56ab59=new Set();for(const _0x590165 of _0x36b94b){if(!_0x590165?.[_0x205457(0x160)]?.[_0x205457(0x116)])continue;const _0x4157a9=apiRuleToYaml(_0x590165[_0x205457(0x160)][_0x205457(0x116)]);_0x4a01e6[_0x205457(0x1ce)](_0x590165[_0x205457(0x14b)],_0x4157a9);const _0x3c58dd=collectSegmentRefsFromRule(_0x4157a9);for(const _0x2c4249 of _0x3c58dd){!_0x34bc55[_0x205457(0x15a)](_0x2c4249)&&_0x56ab59[_0x205457(0x16c)](_0x2c4249);}}_0x3c32b1=Array['from'](_0x56ab59);}};return{'createYamlContext':_0x3d2eb7,'prefetchJourneySegments':_0x240eb5};}export async function executePushSegments(_0x56be91,_0x3607ec,_0x14ae1a,_0x345bd5,_0x1f214f){const _0x523323=a168_0x5cf043,{segmentDefToCreateRequest:_0x4a93c4,segmentDefToUpdateRequest:_0x39c549}=await import('./child-segment-yaml.js'),_0x314186=_0x14ae1a['folderPathToId'],_0x30acf3=0x5,_0x339106=async _0x380eee=>{const _0x18ccbf=a168_0x51ba,_0x2e42ba=_0x380eee[_0x18ccbf(0xf5)]?_0x314186['get'](_0x380eee[_0x18ccbf(0xf5)]):undefined;let _0x265a6a;const _0x401ba0={'created':0x0,'updated':0x0,'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};let _0xb49b49=_0x380eee[_0x18ccbf(0x152)];if(_0x380eee[_0x18ccbf(0x152)][_0x18ccbf(0x116)]){const _0x2b01db=createSegmentIdResolver(_0x14ae1a[_0x18ccbf(0x18a)],_0x380eee[_0x18ccbf(0x152)][_0x18ccbf(0x170)]),_0x3bc7fb=await resolveRuleSegmentIds(_0x380eee[_0x18ccbf(0x152)][_0x18ccbf(0x116)],_0x2b01db);_0xb49b49={..._0x380eee[_0x18ccbf(0x152)],'rule':_0x3bc7fb};}try{if(_0x380eee['isNew']){_0x1f214f[_0x18ccbf(0xe5)]?.({'type':'segment_creating','name':_0x380eee[_0x18ccbf(0x152)][_0x18ccbf(0x170)]});const _0x3aa895=_0x4a93c4(_0xb49b49,_0x2e42ba),_0x5c3035=await _0x1f214f['withProgress'](_0x18ccbf(0x1af)+_0x380eee[_0x18ccbf(0x152)][_0x18ccbf(0x170)]+_0x18ccbf(0x14c),()=>_0x56be91[_0x18ccbf(0x160)][_0x18ccbf(0x137)](_0x345bd5[_0x18ccbf(0x180)],_0x3aa895));_0x265a6a=_0x5c3035[_0x18ccbf(0x1d3)]['id'],_0x14ae1a[_0x18ccbf(0x18a)][_0x18ccbf(0x1ce)](_0x380eee[_0x18ccbf(0x152)][_0x18ccbf(0x170)],_0x265a6a),_0x401ba0[_0x18ccbf(0x12d)]={'name':_0x380eee['yamlConfig']['name'],'id':_0x265a6a},_0x1f214f['onProgress']?.({'type':_0x18ccbf(0x1cd),'name':_0x380eee[_0x18ccbf(0x152)][_0x18ccbf(0x170)],'segmentId':_0x265a6a}),_0x1f214f[_0x18ccbf(0x122)]?.(_0x18ccbf(0x1c2)+_0x380eee[_0x18ccbf(0x152)][_0x18ccbf(0x170)]+'\x27'),_0x401ba0['created']=0x1;}else{if(_0x380eee['hasChanges']){_0x1f214f[_0x18ccbf(0xe5)]?.({'type':'segment_updating','name':_0x380eee['yamlConfig']['name']});const _0x2ab9f1=_0x39c549(_0xb49b49);_0x2e42ba!==_0x380eee[_0x18ccbf(0x1b3)]?.[_0x18ccbf(0x150)]&&(_0x2ab9f1[_0x18ccbf(0x150)]=_0x2e42ba?parseInt(_0x2e42ba,0xa):undefined),await _0x1f214f['withProgress'](_0x18ccbf(0x10e)+_0x380eee[_0x18ccbf(0x152)][_0x18ccbf(0x170)]+_0x18ccbf(0x14c),()=>_0x56be91[_0x18ccbf(0x160)][_0x18ccbf(0xff)](_0x345bd5['parentId'],_0x380eee[_0x18ccbf(0x1b3)]['id'],_0x2ab9f1)),_0x265a6a=_0x380eee[_0x18ccbf(0x1b3)]['id'],_0x1f214f[_0x18ccbf(0xe5)]?.({'type':'segment_updated','name':_0x380eee[_0x18ccbf(0x152)][_0x18ccbf(0x170)]}),_0x1f214f[_0x18ccbf(0x122)]?.(_0x18ccbf(0x16a)+_0x380eee[_0x18ccbf(0x152)][_0x18ccbf(0x170)]+'\x27'),_0x401ba0['updated']=0x1;}else _0x265a6a=_0x380eee[_0x18ccbf(0x1b3)]['id'];}}catch(_0x165809){const _0x16eb46=isHttp400Error(_0x165809),_0x36e5fb=_0x16eb46?ErrorCode[_0x18ccbf(0x1c0)]:ErrorCode[_0x18ccbf(0x109)],_0x538872=getErrorMessage(_0x165809);throw new SDKError(_0x36e5fb,_0x18ccbf(0x115)+(_0x380eee[_0x18ccbf(0x1c4)]?_0x18ccbf(0x10f):'update')+'\x20segment\x20from\x20file:\x20'+_0x380eee[_0x18ccbf(0x139)]+_0x18ccbf(0x12c)+_0x538872,_0x165809);}try{const _0x2cbcb3=await syncActivationsForSegment(_0x56be91,_0x345bd5['parentId'],_0x265a6a,_0x380eee[_0x18ccbf(0x152)][_0x18ccbf(0x170)],_0x380eee[_0x18ccbf(0x1a9)],_0x1f214f,_0x380eee[_0x18ccbf(0x139)]);_0x401ba0[_0x18ccbf(0x1d9)]=_0x2cbcb3;}catch(_0xb4867d){if(_0xb4867d instanceof SDKError)throw _0xb4867d;throw new SDKError(ErrorCode[_0x18ccbf(0x154)],_0x18ccbf(0x1bb)+_0x380eee[_0x18ccbf(0x152)]['name']+_0x18ccbf(0x1b0)+_0x380eee['absolutePath']+'\x0a\x20\x20'+getErrorMessage(_0xb4867d),_0xb4867d);}return _0x401ba0;},_0x1a95ed=await batchAsync(_0x3607ec,_0x339106,_0x30acf3),_0x29e993={'created':0x0,'updated':0x0,'deleted':0x0,'createdSegmentIds':new Map(),'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};for(const _0x59dd34 of _0x1a95ed){_0x29e993[_0x523323(0x124)]+=_0x59dd34['created'],_0x29e993[_0x523323(0x189)]+=_0x59dd34[_0x523323(0x189)],_0x59dd34['createdSegmentId']&&_0x29e993[_0x523323(0x127)][_0x523323(0x1ce)](_0x59dd34['createdSegmentId'][_0x523323(0x170)],_0x59dd34[_0x523323(0x12d)]['id']),_0x29e993['activations'][_0x523323(0x124)]+=_0x59dd34[_0x523323(0x1d9)]['created'],_0x29e993[_0x523323(0x1d9)][_0x523323(0x189)]+=_0x59dd34[_0x523323(0x1d9)][_0x523323(0x189)],_0x29e993[_0x523323(0x1d9)][_0x523323(0x15e)]+=_0x59dd34[_0x523323(0x1d9)][_0x523323(0x15e)];}return _0x29e993;}async function syncActivationsForSegment(_0x2c14b6,_0x1fd0c7,_0x182e7f,_0x13e9cf,_0x3f7d4a,_0x1569bd,_0x5a3bd3){const _0x436b56=a168_0x5cf043,_0x33d6b7={'created':0x0,'updated':0x0,'deleted':0x0};for(const _0x23e011 of _0x3f7d4a){try{if(_0x23e011['type']===_0x436b56(0x10f)&&_0x23e011[_0x436b56(0x157)])_0x1569bd[_0x436b56(0xe5)]?.({'type':_0x436b56(0x1a2),'segmentName':_0x13e9cf,'activationName':_0x23e011[_0x436b56(0x170)]}),await _0x1569bd['withProgress'](_0x436b56(0x15d)+_0x23e011['name']+_0x436b56(0x14c),()=>_0x2c14b6[_0x436b56(0x160)][_0x436b56(0x1d7)](_0x1fd0c7,_0x182e7f,_0x23e011[_0x436b56(0x157)])),_0x1569bd[_0x436b56(0xe5)]?.({'type':'activation_created','segmentName':_0x13e9cf,'activationName':_0x23e011[_0x436b56(0x170)]}),_0x1569bd[_0x436b56(0x122)]?.(_0x436b56(0x13f)+_0x23e011['name']+'\x27'),_0x33d6b7[_0x436b56(0x124)]++;else{if(_0x23e011[_0x436b56(0xe9)]==='update'&&_0x23e011[_0x436b56(0x157)]&&_0x23e011[_0x436b56(0xfe)])_0x1569bd['onProgress']?.({'type':_0x436b56(0x166),'segmentName':_0x13e9cf,'activationName':_0x23e011['name']}),await _0x1569bd[_0x436b56(0x198)](_0x436b56(0x118)+_0x23e011[_0x436b56(0x170)]+_0x436b56(0x14c),()=>_0x2c14b6['segment']['updateActivation'](_0x1fd0c7,_0x182e7f,_0x23e011[_0x436b56(0xfe)]['id'],_0x23e011[_0x436b56(0x157)])),_0x1569bd[_0x436b56(0xe5)]?.({'type':'activation_updated','segmentName':_0x13e9cf,'activationName':_0x23e011[_0x436b56(0x170)]}),_0x1569bd[_0x436b56(0x122)]?.(_0x436b56(0x131)+_0x23e011[_0x436b56(0x170)]+'\x27'),_0x33d6b7[_0x436b56(0x189)]++;else _0x23e011['type']===_0x436b56(0xdf)&&_0x23e011[_0x436b56(0xfe)]&&(_0x1569bd[_0x436b56(0xe5)]?.({'type':_0x436b56(0xe0),'segmentName':_0x13e9cf,'activationName':_0x23e011[_0x436b56(0x170)]}),await _0x1569bd[_0x436b56(0x198)](_0x436b56(0x101)+_0x23e011[_0x436b56(0x170)]+_0x436b56(0x14c),()=>_0x2c14b6['segment'][_0x436b56(0x10c)](_0x1fd0c7,_0x182e7f,_0x23e011['existingActivation']['id'])),_0x1569bd[_0x436b56(0xe5)]?.({'type':'activation_deleted','segmentName':_0x13e9cf,'activationName':_0x23e011[_0x436b56(0x170)]}),_0x1569bd[_0x436b56(0x19c)]?.(_0x436b56(0xec)+_0x23e011[_0x436b56(0x170)]+'\x27'),_0x33d6b7[_0x436b56(0x15e)]++);}}catch(_0x8aada7){const _0x4cbee0=isHttp400Error(_0x8aada7),_0x2333cb=_0x4cbee0?ErrorCode[_0x436b56(0x130)]:ErrorCode[_0x436b56(0x154)],_0x5e5c84=getErrorMessage(_0x8aada7);throw new SDKError(_0x2333cb,_0x436b56(0x115)+_0x23e011[_0x436b56(0xe9)]+'\x20activation\x20\x27'+_0x23e011[_0x436b56(0x170)]+_0x436b56(0x1b0)+_0x5a3bd3+'\x0a\x20\x20'+_0x5e5c84,_0x8aada7);}}return _0x33d6b7;}export async function executePushFolders(_0x219cc6,_0x37fa11,_0x3bc246,_0x2df356,_0x4d02d5){const _0x3b93c6=a168_0x5cf043,_0x17793d=new Map(_0x3bc246),_0x5f374c=sortFoldersByDepth(_0x37fa11);for(const _0x9813b3 of _0x5f374c){const _0x3954f3=_0x9813b3[_0x3b93c6(0xdb)]('/'),_0x2a5f33=_0x3954f3[_0x3954f3['length']-0x1],_0x312a67=_0x3954f3[_0x3b93c6(0x1c8)](0x0,-0x1)[_0x3b93c6(0x1b4)]('/'),_0x47da2c=_0x17793d[_0x3b93c6(0x11e)](_0x312a67);_0x4d02d5['onProgress']?.({'type':_0x3b93c6(0x1a3),'folder':_0x9813b3});const _0x5ea425={'name':_0x2a5f33,'parentFolderId':_0x47da2c},_0x410129=await _0x4d02d5[_0x3b93c6(0x198)]('Creating\x20folder\x20\x27'+_0x9813b3+_0x3b93c6(0x14c),()=>_0x219cc6[_0x3b93c6(0x160)]['createFolder'](_0x2df356[_0x3b93c6(0x180)],_0x5ea425));_0x17793d[_0x3b93c6(0x1ce)](_0x9813b3,_0x410129[_0x3b93c6(0x1d3)]['id']),_0x4d02d5['onProgress']?.({'type':_0x3b93c6(0x19a),'folder':_0x9813b3,'folderId':_0x410129['data']['id']}),_0x4d02d5[_0x3b93c6(0x117)]?.('Created\x20folder\x20\x27'+_0x9813b3+'\x27');}return _0x17793d;}export async function executePushSegmentDeletions(_0x2ae188,_0x472ef5,_0x4c7904){const _0x5067d3=a168_0x5cf043;if(_0x472ef5['length']===0x0)return 0x0;const {batchAsync:_0x1fef19}=await import(_0x5067d3(0x18b)),_0x9f7082=0x5,_0x2e8106=await _0x1fef19(_0x472ef5,async _0x212e84=>{const _0x5ed354=_0x5067d3;return _0x4c7904['onProgress']?.({'type':_0x5ed354(0x110),'name':_0x212e84['name']}),await _0x2ae188['segment']['deleteSegment'](_0x212e84['id']),_0x4c7904[_0x5ed354(0xe5)]?.({'type':_0x5ed354(0x1bd),'name':_0x212e84[_0x5ed354(0x170)]}),_0x4c7904[_0x5ed354(0x19c)]?.(_0x5ed354(0x177)+_0x212e84['name']+'\x27'),0x1;},_0x9f7082);return _0x2e8106[_0x5067d3(0x1b7)]((_0x5af1b9,_0x2a09ac)=>_0x5af1b9+_0x2a09ac,0x0);}export async function executePushJourneys(_0x4fb1af,_0x129214,_0x1a94a5,_0x3e285d,_0x181290){const _0x48985e=a168_0x5cf043,{journeyDefToRequest:_0x175dc3}=await import('./journey-yaml.js'),{activationDefToCreateRequest:_0x1b908c,yamlRuleToApi:_0x4a3c2e,validateSegmentRule:_0x2987f6}=await import(_0x48985e(0x173)),_0xae3c89={'results':[],'created':0x0,'updated':0x0,'embeddedSegmentNameToId':new Map()},_0x30f0dd=new Map(_0x1a94a5[_0x48985e(0x18a)]),_0x1c764e=0x5;for(let _0x4f4741=0x0;_0x4f4741<_0x129214['length'];_0x4f4741+=_0x1c764e){const _0x57a9b6=_0x129214[_0x48985e(0x1c8)](_0x4f4741,_0x4f4741+_0x1c764e),_0x3218a9=await Promise['all'](_0x57a9b6['map'](async _0x4c4dc9=>{const _0xe2036a=_0x48985e;if(!_0x4c4dc9[_0xe2036a(0x1c4)]&&!_0x4c4dc9[_0xe2036a(0x1a7)])return{'action':_0xe2036a(0x144),'name':_0x4c4dc9[_0xe2036a(0x152)][_0xe2036a(0x170)],'journeyId':_0x4c4dc9[_0xe2036a(0xf9)]?.['id']};const _0x370d2e=_0x4c4dc9[_0xe2036a(0xf5)]?_0x1a94a5[_0xe2036a(0x136)][_0xe2036a(0x11e)](_0x4c4dc9[_0xe2036a(0xf5)]):undefined;_0x181290[_0xe2036a(0xe5)]?.({'type':_0x4c4dc9[_0xe2036a(0x1c4)]?'journey_creating':_0xe2036a(0x15b),'name':_0x4c4dc9[_0xe2036a(0x152)][_0xe2036a(0x170)]});try{const _0x12e930=await executeSingleJourneyPush(_0x4fb1af,_0x4c4dc9,{..._0x1a94a5,'segmentNameToId':_0x30f0dd},{'parentId':_0x3e285d[_0xe2036a(0x180)],'rootFolderId':_0x3e285d[_0xe2036a(0x165)],'folderId':_0x370d2e,'verbose':_0x3e285d[_0xe2036a(0x14d)]},_0x181290,{'journeyDefToRequest':_0x175dc3,'activationDefToCreateRequest':_0x1b908c,'yamlRuleToApi':_0x4a3c2e,'validateSegmentRule':_0x2987f6});for(const [_0x5e958d,_0x32df47]of _0x12e930[_0xe2036a(0x11c)]){_0x30f0dd[_0xe2036a(0x1ce)](_0x5e958d,_0x32df47),_0xae3c89[_0xe2036a(0x11c)][_0xe2036a(0x1ce)](_0x5e958d,_0x32df47);}if(_0x12e930['action']==='created')_0x181290['onProgress']?.({'type':_0xe2036a(0x15c),'name':_0x4c4dc9['yamlConfig']['name'],'journeyId':_0x12e930[_0xe2036a(0x18e)]}),_0x181290[_0xe2036a(0x122)]?.(_0xe2036a(0x1a1)+_0x4c4dc9[_0xe2036a(0x152)][_0xe2036a(0x170)]+'\x27'),_0xae3c89[_0xe2036a(0x124)]++;else _0x12e930[_0xe2036a(0x171)]===_0xe2036a(0x189)&&(_0x181290[_0xe2036a(0xe5)]?.({'type':'journey_updated','name':_0x4c4dc9[_0xe2036a(0x152)][_0xe2036a(0x170)]}),_0x181290['logSuccess']?.(_0xe2036a(0x135)+_0x4c4dc9[_0xe2036a(0x152)]['name']+'\x27'),_0xae3c89[_0xe2036a(0x189)]++);return{'action':_0x12e930['action'],'name':_0x4c4dc9[_0xe2036a(0x152)][_0xe2036a(0x170)],'journeyId':_0x12e930['journeyId']};}catch(_0x4f9e63){const _0x55dd39=isHttp400Error(_0x4f9e63),_0x274cf0=_0x55dd39?ErrorCode['JOURNEY_SYNTAX_ERROR']:ErrorCode[_0xe2036a(0x16f)],_0x269fc0=getErrorMessage(_0x4f9e63);throw new SDKError(_0x274cf0,_0xe2036a(0x115)+(_0x4c4dc9[_0xe2036a(0x1c4)]?'create':_0xe2036a(0xfd))+_0xe2036a(0x1a6)+_0x4c4dc9[_0xe2036a(0x139)]+_0xe2036a(0x12c)+_0x269fc0,_0x4f9e63);}}));_0xae3c89[_0x48985e(0x19b)][_0x48985e(0x164)](..._0x3218a9);}return _0xae3c89;}async function matchExistingJourneySegments(_0x5ad924,_0x89bf2a,_0x58d4cf,_0x145c7c,_0xa23727){const _0x273bfe=a168_0x5cf043;if(!_0x89bf2a['existingJourney']||!_0x89bf2a[_0x273bfe(0x152)][_0x273bfe(0x17e)])return;const _0x37b815=new Map(),_0x5af66d=new Set();for(const _0x47b835 of Object[_0x273bfe(0x147)](_0x89bf2a[_0x273bfe(0x152)][_0x273bfe(0x17e)])){const _0x5d90e6=generateDeterministicJourneySegmentName(_0x89bf2a['yamlConfig'][_0x273bfe(0x170)],_0x47b835);_0x37b815['set'](_0x5d90e6,_0x47b835),_0x5af66d['add'](_0x47b835);}const _0x112a5a=[],_0x4900f3=collectSegmentIdsFromJourneyApi(_0x89bf2a[_0x273bfe(0xf9)]);for(const _0x4491d8 of _0x4900f3){const _0x1d692d=await fetchSegment(_0x5ad924,_0x58d4cf,_0x4491d8,_0x145c7c);if(!_0x1d692d?.[_0x273bfe(0x170)])continue;const _0x417253=_0x37b815[_0x273bfe(0x11e)](_0x1d692d['name']);_0x417253?(_0xa23727[_0x273bfe(0x1ce)](_0x417253,_0x4491d8),_0x5af66d[_0x273bfe(0xdf)](_0x417253)):_0x112a5a[_0x273bfe(0x164)]({'id':_0x4491d8,'seg':_0x1d692d});}if(_0x5af66d[_0x273bfe(0x1ca)]>0x0&&_0x112a5a[_0x273bfe(0xdc)]>0x0){const {localExpandedRuleToNames:_0x14d7c6}=buildLocalExpandedRuleMappings(_0x89bf2a['yamlConfig']),_0x4782aa=new Map();for(const {id:_0x4c5ce5,seg:_0x5a25e9}of _0x112a5a){if(_0x5a25e9[_0x273bfe(0x116)]){const _0x357695=apiRuleToYaml(_0x5a25e9['rule']);_0x4782aa[_0x273bfe(0x1ce)](_0x4c5ce5,_0x357695);}}for(const {id:_0x1497e7,seg:_0xa97560}of _0x112a5a){if(!_0xa97560[_0x273bfe(0x116)])continue;const _0x123799=_0x4782aa[_0x273bfe(0x11e)](_0x1497e7);if(!_0x123799)continue;const _0x4b8d5f=serializeExpandedRule(_0x123799,_0x4782aa),_0x33c563=_0x14d7c6[_0x273bfe(0x11e)](_0x4b8d5f);if(_0x33c563){const _0x304216=_0x33c563[_0x273bfe(0x11b)](_0x397965=>_0x5af66d['has'](_0x397965));_0x304216&&(_0xa23727[_0x273bfe(0x1ce)](_0x304216,_0x1497e7),_0x5af66d['delete'](_0x304216),logger[_0x273bfe(0x142)](_0x273bfe(0x184)+_0xa97560[_0x273bfe(0x170)]+_0x273bfe(0x151)+_0x304216+'\x27\x20by\x20rule\x20content'));}}}}async function executeSingleJourneyPush(_0xc19731,_0x3bc658,_0x413b01,_0x24202e,_0x1cf7fd,_0x5da938){const _0x333a62=a168_0x5cf043,{journeyDefToRequest:_0x52dcc6,activationDefToCreateRequest:_0x48ee5f,yamlRuleToApi:_0xbcc4d8,validateSegmentRule:_0x430093}=_0x5da938,_0xc32e38=new Map(),_0x45ca67=new Map();recoverSegmentIdsFromPushRecovery(_0x3bc658,_0xc32e38,_0x413b01[_0x333a62(0x18a)]);const _0x3a75cd=new Map(),_0x566e5b=new Map(),_0x3c7771=new Map();let _0x46643c;const _0x112ba8=async()=>{const _0x4b4110=_0x333a62;if(_0x46643c)return;_0x46643c=new Map();if(!_0x3bc658[_0x4b4110(0xf9)])return;const _0x4e12d8=await _0xc19731['journey']['listActivations'](_0x3bc658[_0x4b4110(0xf9)]['id']);for(const _0x4225f1 of _0x4e12d8){const _0x41d246=journeyActivationStepToYaml(_0x4225f1,_0x413b01['idToEmailMap'],_0x413b01[_0x4b4110(0x156)]),_0x3d3ea1=activationSignature(_0x41d246);!_0x46643c[_0x4b4110(0x15a)](_0x3d3ea1)&&_0x46643c[_0x4b4110(0x1ce)](_0x3d3ea1,_0x4225f1['id']),_0x41d246[_0x4b4110(0x170)]&&_0x45ca67['set'](_0x41d246[_0x4b4110(0x170)],_0x4225f1['id']);}};await matchExistingJourneySegments(_0xc19731,_0x3bc658,_0x24202e[_0x333a62(0x180)],_0x413b01[_0x333a62(0x169)],_0x413b01[_0x333a62(0x18a)]);const _0x185d60={'resolveSegmentId':async _0x2644f9=>{const _0x13c1c3=_0x333a62,_0x145eca=_0x413b01[_0x13c1c3(0x18a)][_0x13c1c3(0x11e)](_0x2644f9);if(!_0x145eca)throw new SDKError(ErrorCode[_0x13c1c3(0xeb)],_0x13c1c3(0x14f)+_0x2644f9+'\x20(referenced\x20in\x20journey\x20'+_0x3bc658[_0x13c1c3(0x152)]['name']+')');return _0x145eca;},'resolveEmbeddedSegmentId':async(_0x267ae5,_0x200a4a)=>{const _0x26e0e4=_0x333a62,_0xf7be2e=_0x413b01[_0x26e0e4(0x18a)][_0x26e0e4(0x11e)](_0x267ae5);if(_0xf7be2e)return _0xf7be2e;const _0x5a18e7=_0x413b01[_0x26e0e4(0x169)][_0x26e0e4(0x11b)](_0x2054dc=>_0x2054dc['name']===_0x267ae5);if(_0x5a18e7)return _0x413b01[_0x26e0e4(0x18a)]['set'](_0x267ae5,_0x5a18e7['id']),_0x5a18e7['id'];if(_0x3bc658[_0x26e0e4(0x1c4)]){const {stageName:_0x185227,criteriaName:_0x4e123c}=findSegmentCriteriaLocation(_0x3bc658[_0x26e0e4(0x152)],_0x267ae5);return _0x430093(_0x267ae5,_0x200a4a[_0x26e0e4(0x116)]),_0x566e5b[_0x26e0e4(0x1ce)](_0x267ae5,{'definition':_0x200a4a,'stageName':_0x185227,'criteriaName':_0x4e123c}),createPendingSegmentId(_0x267ae5);}const _0x27f043=_0x3bc658[_0x26e0e4(0xf9)]?.['id'];if(!_0x27f043)throw new SDKError(ErrorCode[_0x26e0e4(0x1ae)],_0x26e0e4(0x17a));const _0x21699d=_0x3a75cd['get'](_0x267ae5);if(_0x21699d)return _0x21699d;const _0xce3757=((async()=>{const _0x6fb576=_0x26e0e4;_0x430093(_0x267ae5,_0x200a4a[_0x6fb576(0x116)]);const _0x101176=generateDeterministicJourneySegmentName(_0x3bc658[_0x6fb576(0x152)][_0x6fb576(0x170)],_0x267ae5),_0x44ef34=_0x413b01[_0x6fb576(0x169)][_0x6fb576(0x11b)](_0xfb5560=>_0xfb5560[_0x6fb576(0x170)]===_0x101176),_0xeb5dd9=createSegmentIdResolver(_0x413b01[_0x6fb576(0x18a)],_0x267ae5),_0x1e9051=await resolveRuleSegmentIds(_0x200a4a['rule'],_0xeb5dd9);let _0x40a05c;return _0x44ef34?(await _0xc19731[_0x6fb576(0x160)][_0x6fb576(0xff)](_0x24202e[_0x6fb576(0x180)],_0x44ef34['id'],{'description':_0x200a4a[_0x6fb576(0x1cb)]||_0x6fb576(0x161)+_0x267ae5,'rule':_0xbcc4d8(_0x1e9051),'countPopulation':!![]}),_0x40a05c=_0x44ef34['id'],saveSegmentToPushRecovery(_0x3bc658['absolutePath'],_0x3bc658[_0x6fb576(0x152)][_0x6fb576(0x170)],_0x267ae5,{'segmentId':_0x40a05c,'uniqueServerName':_0x101176,'createdAt':new Date()[_0x6fb576(0x143)]()})):_0x40a05c=await createOrRecoverEmbeddedSegment(_0xc19731,_0x3bc658,{'localName':_0x267ae5,'uniqueSegmentName':_0x101176,'description':_0x200a4a[_0x6fb576(0x1cb)]||_0x6fb576(0x161)+_0x267ae5,'journeyId':_0x27f043,'resolvedRule':_0x1e9051,'parentId':_0x24202e[_0x6fb576(0x180)],'folderId':_0x24202e[_0x6fb576(0x165)]||''},_0xbcc4d8),_0x413b01[_0x6fb576(0x18a)]['set'](_0x267ae5,_0x40a05c),_0xc32e38[_0x6fb576(0x1ce)](_0x267ae5,_0x40a05c),_0x40a05c;})());_0x3a75cd[_0x26e0e4(0x1ce)](_0x267ae5,_0xce3757);try{return await _0xce3757;}finally{_0x3a75cd[_0x26e0e4(0xdf)](_0x267ae5);}},'resolveActivationId':async _0x91ca1=>{const _0x4dcc8b=_0x333a62,_0x274bac=_0x45ca67[_0x4dcc8b(0x11e)](_0x91ca1);if(_0x274bac)return _0x274bac;if(_0x3bc658[_0x4dcc8b(0xf9)]){await _0x112ba8();const _0x5596ac=_0x45ca67[_0x4dcc8b(0x11e)](_0x91ca1);if(_0x5596ac)return _0x5596ac;}throw new SDKError(ErrorCode['NOT_FOUND'],'Activation\x20not\x20found:\x20'+_0x91ca1+_0x4dcc8b(0x1c6)+_0x3bc658[_0x4dcc8b(0x152)][_0x4dcc8b(0x170)]+').\x20'+'Define\x20it\x20in\x20the\x20journey\x27s\x20\x27activations\x27\x20section\x20or\x20use\x20an\x20existing\x20activation\x20ID.');},'resolveEmbeddedActivationId':async(_0x3c11e9,_0x18a38e)=>{const _0xa8b82=_0x333a62,_0x57fa16=_0x45ca67[_0xa8b82(0x11e)](_0x3c11e9);if(_0x57fa16)return _0x57fa16;if(_0x3bc658[_0xa8b82(0x1c4)])return _0x3c7771[_0xa8b82(0x1ce)](_0x3c11e9,_0x18a38e),createPendingActivationId(_0x3c11e9);if(_0x3bc658['existingJourney']){await _0x112ba8();const _0x1d6b93=_0x45ca67[_0xa8b82(0x11e)](_0x18a38e[_0xa8b82(0x170)]);if(_0x1d6b93)return _0x45ca67[_0xa8b82(0x1ce)](_0x3c11e9,_0x1d6b93),_0x1d6b93;const _0x31fdb6=activationSignature(_0x18a38e),_0x7cdf64=_0x46643c?.[_0xa8b82(0x11e)](_0x31fdb6);if(_0x7cdf64)return _0x45ca67[_0xa8b82(0x1ce)](_0x3c11e9,_0x7cdf64),_0x7cdf64;const _0x4436c9=await _0x48ee5f(_0x18a38e,_0x413b01[_0xa8b82(0xe3)]),_0x155427={..._0x4436c9,..._0x18a38e[_0xa8b82(0x1b2)]!==undefined&&{'runAfterJourneyRefresh':_0x18a38e['run_after_journey_refresh']}},_0x6d3e2b=await _0xc19731[_0xa8b82(0x12b)][_0xa8b82(0x1d7)](_0x3bc658[_0xa8b82(0xf9)]['id'],_0x155427);return _0x45ca67[_0xa8b82(0x1ce)](_0x3c11e9,_0x6d3e2b['id']),_0x6d3e2b['id'];}throw new SDKError(ErrorCode[_0xa8b82(0x1ae)],'Cannot\x20create\x20embedded\x20activation\x20without\x20journey\x20context');},'resolveJourneyId':async _0x39ef11=>{const _0x44157d=_0x333a62;try{return await _0xc19731[_0x44157d(0x12b)][_0x44157d(0xe4)](_0x24202e['parentId'],_0x39ef11);}catch(_0x3e747f){throw new SDKError(ErrorCode[_0x44157d(0x12f)],_0x44157d(0x17d)+_0x39ef11+'\x27\x20not\x20found\x20in\x20parent\x20segment\x20(referenced\x20in\x20jump\x20step\x20of\x20\x27'+_0x3bc658['yamlConfig'][_0x44157d(0x170)]+'\x27)',_0x3e747f);}},'resolveStageId':async(_0x112433,_0x5c5c45)=>{const _0x6083b=_0x333a62,_0x1be62f=await _0xc19731[_0x6083b(0x12b)][_0x6083b(0x167)](_0x112433),_0x474911=_0x1be62f['attributes'][_0x6083b(0x19e)][_0x6083b(0x11b)](_0x500c39=>_0x500c39['name']['toLowerCase']()===_0x5c5c45[_0x6083b(0x123)]());if(!_0x474911?.['id'])throw new SDKError(ErrorCode[_0x6083b(0x12f)],_0x6083b(0x132)+_0x5c5c45+_0x6083b(0xf0)+(_0x1be62f[_0x6083b(0x104)][_0x6083b(0x138)]||_0x1be62f[_0x6083b(0x104)][_0x6083b(0x170)])+'\x27');return _0x474911['id'];}},_0x3a9371=await _0x52dcc6(_0x3bc658[_0x333a62(0x152)],_0x24202e['parentId'],_0x185d60),_0x340f1c=_0x24202e[_0x333a62(0x15f)]||_0x24202e[_0x333a62(0x165)];_0x340f1c&&(_0x3a9371[_0x333a62(0x1d4)]={'parentFolder':{'data':{'id':_0x340f1c,'type':_0x333a62(0x106)}}});if(_0x3bc658[_0x333a62(0x1c4)]){if(_0x566e5b['size']>0x0||_0x3c7771['size']>0x0)return await executeThreeStepJourneyCreate(_0xc19731,_0x3bc658,_0x3a9371,{'pendingEmbeddedSegments':_0x566e5b,'pendingEmbeddedActivations':_0x3c7771,'embeddedSegmentNameToId':_0xc32e38,'journeyActivationNameToId':_0x45ca67},{..._0x24202e,'effectiveFolderId':_0x340f1c},_0x413b01,_0x1cf7fd,_0x5da938);else{ensureJourneyDefaults(_0x3a9371['attributes']);const _0x2d558d=await _0xc19731['journey'][_0x333a62(0x10f)](_0x3a9371);return deletePushRecovery(_0x3bc658[_0x333a62(0x139)]),{'action':'created','journeyId':_0x2d558d['id'],'embeddedSegmentNameToId':_0xc32e38};}}else{if(_0x3bc658[_0x333a62(0x1a7)]&&_0x3bc658[_0x333a62(0xf9)]){_0x3a9371['id']=_0x3bc658[_0x333a62(0xf9)]['id'];const _0xd7564b=_0x3a9371['attributes'];_0x3bc658[_0x333a62(0xf9)][_0x333a62(0x104)]?.[_0x333a62(0x138)]&&(_0xd7564b['journeyBundleName']=_0x3bc658[_0x333a62(0xf9)][_0x333a62(0x104)][_0x333a62(0x138)]);const _0xd8a934=_0x3bc658[_0x333a62(0xf9)][_0x333a62(0x104)]?.[_0x333a62(0x19e)];return _0xd8a934&&_0x3a9371[_0x333a62(0x104)][_0x333a62(0x19e)]&&injectExistingStageIds(_0x3a9371[_0x333a62(0x104)][_0x333a62(0x19e)],_0xd8a934),ensureJourneyDefaults(_0xd7564b),await _0xc19731[_0x333a62(0x12b)]['update'](_0x3bc658[_0x333a62(0xf9)]['id'],_0x3a9371),deletePushRecovery(_0x3bc658[_0x333a62(0x139)]),{'action':_0x333a62(0x189),'journeyId':_0x3bc658[_0x333a62(0xf9)]['id'],'embeddedSegmentNameToId':_0xc32e38};}}return deletePushRecovery(_0x3bc658['absolutePath']),{'action':'unchanged','journeyId':_0x3bc658[_0x333a62(0xf9)]?.['id'],'embeddedSegmentNameToId':_0xc32e38};}function findSegmentCriteriaLocation(_0x17c28a,_0x1e4171){const _0x296bb4=a168_0x5cf043,_0xaee381=_0x17c28a[_0x296bb4(0x162)]||_0x17c28a['journeys']?.[0x0]?.[_0x296bb4(0x162)]||[];let _0x2891b9=_0x296bb4(0x16b),_0x509e73=_0x1e4171;const _0x1ed0f7=_0x17c28a[_0x296bb4(0x10d)]||_0x17c28a['journeys']?.[0x0]?.[_0x296bb4(0x10d)];if(_0x1ed0f7?.['segment']===_0x1e4171)return{'stageName':_0x296bb4(0x10d),'criteriaName':_0x1ed0f7[_0x296bb4(0x170)]||_0x1e4171};_0x194a80:for(const _0x102329 of _0xaee381){if(_0x102329[_0x296bb4(0x129)]?.[_0x296bb4(0x160)]===_0x1e4171){_0x2891b9=_0x102329[_0x296bb4(0x170)],_0x509e73=_0x102329['entry_criteria'][_0x296bb4(0x170)]||_0x1e4171;break;}if(_0x102329['steps'])for(const _0x16d8a8 of _0x102329['steps']){if(_0x16d8a8[_0x296bb4(0xe9)]==='decision_point'&&_0x16d8a8[_0x296bb4(0x13a)]?.[_0x296bb4(0x100)])for(const _0x4671c8 of _0x16d8a8[_0x296bb4(0x13a)]['branches']){if(_0x4671c8[_0x296bb4(0x160)]===_0x1e4171){_0x2891b9=_0x102329[_0x296bb4(0x170)],_0x509e73=_0x4671c8['name']||_0x1e4171;break _0x194a80;}}}}return{'stageName':_0x2891b9,'criteriaName':_0x509e73};}async function executeThreeStepJourneyCreate(_0x34248c,_0x24800,_0x1a102c,_0x6150c0,_0x4f4b19,_0x35f6b5,_0x13a189,_0x804d80){const _0x1c3faa=a168_0x5cf043,{activationDefToCreateRequest:_0x106865,yamlRuleToApi:_0x1f0964}=_0x804d80,{pendingEmbeddedSegments:_0x4d2b49,pendingEmbeddedActivations:_0x2888a1,embeddedSegmentNameToId:_0xad4558}=_0x6150c0,_0x437b20=JSON['parse'](JSON['stringify'](_0x1a102c));ensureJourneyDefaults(_0x437b20[_0x1c3faa(0x104)]),stripPendingIds(_0x437b20);const _0x385c7e=await _0x34248c['journey'][_0x1c3faa(0x10f)](_0x437b20),_0x37052a=_0x385c7e['id'],_0x49e9bc=new Map();for(const _0x55b3e2 of _0x385c7e[_0x1c3faa(0x104)][_0x1c3faa(0x19e)]){_0x49e9bc[_0x1c3faa(0x1ce)](_0x55b3e2[_0x1c3faa(0x170)][_0x1c3faa(0x123)](),_0x55b3e2['id']);}recoverSegmentIdsFromPushRecovery(_0x24800,_0xad4558,_0x35f6b5['segmentNameToId']);for(const [_0x4f0e27,{definition:_0xbfccdc}]of _0x4d2b49){if(_0xad4558[_0x1c3faa(0x15a)](_0x4f0e27)){_0x13a189[_0x1c3faa(0xe5)]?.({'type':_0x1c3faa(0xea),'journeyName':_0x24800['yamlConfig'][_0x1c3faa(0x170)],'segmentName':_0x4f0e27});continue;}const _0x552838=generateDeterministicJourneySegmentName(_0x24800[_0x1c3faa(0x152)][_0x1c3faa(0x170)],_0x4f0e27);_0x13a189['onProgress']?.({'type':_0x1c3faa(0x1bc),'journeyName':_0x24800[_0x1c3faa(0x152)][_0x1c3faa(0x170)],'segmentName':_0x4f0e27});const _0x10f1c5=createSegmentIdResolver(_0x35f6b5[_0x1c3faa(0x18a)],_0x4f0e27),_0x1b44fe=await resolveRuleSegmentIds(_0xbfccdc[_0x1c3faa(0x116)],_0x10f1c5),_0xee5158=await createOrRecoverEmbeddedSegment(_0x34248c,_0x24800,{'localName':_0x4f0e27,'uniqueSegmentName':_0x552838,'description':_0xbfccdc['description']||_0x1c3faa(0x161)+_0x4f0e27,'journeyId':_0x37052a,'resolvedRule':_0x1b44fe,'parentId':_0x4f4b19[_0x1c3faa(0x180)],'folderId':_0x4f4b19[_0x1c3faa(0x1cf)]||''},_0x1f0964);_0xad4558['set'](_0x4f0e27,_0xee5158),_0x35f6b5['segmentNameToId'][_0x1c3faa(0x1ce)](_0x4f0e27,_0xee5158),_0x13a189['onProgress']?.({'type':_0x1c3faa(0xea),'journeyName':_0x24800['yamlConfig'][_0x1c3faa(0x170)],'segmentName':_0x4f0e27});}const _0x4e2123=new Map();for(const [_0x395a7f,_0x43bf29]of _0x2888a1){_0x13a189[_0x1c3faa(0xe5)]?.({'type':_0x1c3faa(0x193),'journeyName':_0x24800['yamlConfig'][_0x1c3faa(0x170)],'activationName':_0x395a7f});const _0x3598c3=await _0x106865(_0x43bf29,_0x35f6b5[_0x1c3faa(0xe3)]),_0x3ecb49={..._0x3598c3,..._0x43bf29[_0x1c3faa(0x1b2)]!==undefined&&{'runAfterJourneyRefresh':_0x43bf29[_0x1c3faa(0x1b2)]}},_0x39456b=await _0x34248c[_0x1c3faa(0x12b)][_0x1c3faa(0x1d7)](_0x37052a,_0x3ecb49);_0x4e2123[_0x1c3faa(0x1ce)](_0x395a7f,_0x39456b['id']),_0x6150c0[_0x1c3faa(0x181)]['set'](_0x395a7f,_0x39456b['id']),_0x13a189[_0x1c3faa(0xe5)]?.({'type':'embedded_activation_created','journeyName':_0x24800[_0x1c3faa(0x152)][_0x1c3faa(0x170)],'activationName':_0x395a7f});}const _0x4d1fe4=JSON['parse'](JSON[_0x1c3faa(0x10b)](_0x1a102c));return _0x4d1fe4['id']=_0x37052a,ensureJourneyDefaults(_0x4d1fe4[_0x1c3faa(0x104)]),resolvePendingIdsInRequest(_0x4d1fe4,_0x1a102c,_0x49e9bc,_0xad4558,_0x4e2123,_0x13a189),await _0x34248c[_0x1c3faa(0x12b)][_0x1c3faa(0xfd)](_0x37052a,_0x4d1fe4),deletePushRecovery(_0x24800['absolutePath']),{'action':_0x1c3faa(0x124),'journeyId':_0x37052a,'embeddedSegmentNameToId':_0xad4558};}export function stripWaitStepPendingIds(_0x80f659){const _0x53b4c6=a168_0x5cf043,_0x443e57=_0x80f659['conditionSegmentId']&&isPendingSegmentId(_0x80f659[_0x53b4c6(0x128)]),_0x96ea5f=_0x80f659[_0x53b4c6(0x187)]?.[_0x53b4c6(0x176)](_0x257d69=>_0x257d69['segmentId']&&isPendingSegmentId(_0x257d69[_0x53b4c6(0x14b)]));(_0x443e57||_0x96ea5f)&&(_0x80f659[_0x53b4c6(0xe8)]=_0x53b4c6(0x1d1),_0x80f659[_0x53b4c6(0xde)]=0x1,_0x80f659[_0x53b4c6(0x1be)]='day',delete _0x80f659['conditionSegmentId'],delete _0x80f659['conditionTimeoutDuration'],delete _0x80f659[_0x53b4c6(0xf1)],delete _0x80f659['conditions']);}export function resolveWaitStepPendingIds(_0x3d7d87,_0x124e77,_0x317238,_0x205af2){const _0x245a9f=a168_0x5cf043;if(_0x124e77['conditionSegmentId']&&isPendingSegmentId(_0x124e77[_0x245a9f(0x128)])){const _0x733a08=_0x317238(_0x124e77[_0x245a9f(0x128)],_0x245a9f(0xe7)+_0x205af2+'\x27\x20wait\x20condition');_0x733a08&&(_0x3d7d87['waitStepType']='Condition',_0x3d7d87[_0x245a9f(0x128)]=_0x733a08,delete _0x3d7d87[_0x245a9f(0xde)],delete _0x3d7d87['waitStepUnit'],_0x124e77[_0x245a9f(0x125)]!==undefined&&(_0x3d7d87[_0x245a9f(0x125)]=_0x124e77[_0x245a9f(0x125)]),_0x124e77[_0x245a9f(0xf1)]&&(_0x3d7d87[_0x245a9f(0xf1)]=_0x124e77[_0x245a9f(0xf1)]));}if(_0x124e77[_0x245a9f(0x187)]){const _0x504f91=_0x124e77[_0x245a9f(0x187)][_0x245a9f(0x176)](_0x272d3f=>_0x272d3f['segmentId']&&isPendingSegmentId(_0x272d3f[_0x245a9f(0x14b)]));if(_0x504f91){const _0x4ebd95=_0x124e77[_0x245a9f(0x187)]['map'](_0x4b3445=>{const _0x9d9c40=_0x245a9f;if(_0x4b3445[_0x9d9c40(0x14b)]&&isPendingSegmentId(_0x4b3445['segmentId'])){const _0x1908a0=_0x317238(_0x4b3445[_0x9d9c40(0x14b)],'stage\x20\x27'+_0x205af2+_0x9d9c40(0x105));return{..._0x4b3445,'segmentId':_0x1908a0||_0x4b3445[_0x9d9c40(0x14b)]};}return{..._0x4b3445};});_0x3d7d87['waitStepType']=_0x245a9f(0x186),_0x3d7d87[_0x245a9f(0x187)]=_0x4ebd95,delete _0x3d7d87['waitStep'],delete _0x3d7d87['waitStepUnit'],delete _0x3d7d87['conditionSegmentId'],delete _0x3d7d87[_0x245a9f(0x125)],delete _0x3d7d87[_0x245a9f(0xf1)];}}}function stripPendingIds(_0x132bc8){const _0x1254ef=a168_0x5cf043;_0x132bc8[_0x1254ef(0x104)][_0x1254ef(0x10d)]?.[_0x1254ef(0x14b)]&&isPendingSegmentId(_0x132bc8[_0x1254ef(0x104)]['goal']['segmentId'])&&delete _0x132bc8[_0x1254ef(0x104)][_0x1254ef(0x10d)];for(const _0x5afe6e of _0x132bc8['attributes']['journeyStages']||[]){_0x5afe6e[_0x1254ef(0x185)]?.[_0x1254ef(0x14b)]&&isPendingSegmentId(_0x5afe6e[_0x1254ef(0x185)]['segmentId'])&&delete _0x5afe6e[_0x1254ef(0x185)];_0x5afe6e[_0x1254ef(0x1c7)]?.['segmentId']&&isPendingSegmentId(_0x5afe6e[_0x1254ef(0x1c7)][_0x1254ef(0x14b)])&&delete _0x5afe6e[_0x1254ef(0x1c7)];_0x5afe6e[_0x1254ef(0xdd)]&&(_0x5afe6e['exitCriterias']=_0x5afe6e['exitCriterias'][_0x1254ef(0x112)](_0x283c04=>!_0x283c04[_0x1254ef(0x14b)]||!isPendingSegmentId(_0x283c04[_0x1254ef(0x14b)])));if(_0x5afe6e[_0x1254ef(0x121)])for(const _0x2d7abe of Object[_0x1254ef(0x147)](_0x5afe6e[_0x1254ef(0x121)])){const _0x4d1db7=_0x5afe6e['steps'][_0x2d7abe];_0x4d1db7[_0x1254ef(0xe9)]===_0x1254ef(0x1ab)&&_0x4d1db7['journeyActivationStepId']&&isPendingActivationId(_0x4d1db7['journeyActivationStepId'])&&(_0x4d1db7[_0x1254ef(0x16e)]='');if(_0x4d1db7[_0x1254ef(0xe9)]==='DecisionPoint'&&_0x4d1db7[_0x1254ef(0x100)])for(const _0x115b68 of _0x4d1db7[_0x1254ef(0x100)]){_0x115b68[_0x1254ef(0x14b)]&&isPendingSegmentId(_0x115b68[_0x1254ef(0x14b)])&&(_0x115b68[_0x1254ef(0x14b)]='');}_0x4d1db7[_0x1254ef(0xe9)]==='WaitStep'&&stripWaitStepPendingIds(_0x4d1db7);}}}function resolvePendingIdsInRequest(_0x732e8e,_0x18ba14,_0x59cd0b,_0x4957fd,_0x23459a,_0x4db761){const _0x4b43d3=a168_0x5cf043,_0x42539f=(_0x5e7b37,_0x223c71)=>{const _0x4201aa=a168_0x51ba;if(!isPendingSegmentId(_0x5e7b37))return _0x5e7b37;const _0x486737=extractPendingSegmentName(_0x5e7b37),_0x30f2ba=_0x4957fd[_0x4201aa(0x11e)](_0x486737);return!_0x30f2ba&&_0x4db761[_0x4201aa(0x1c3)]?.('Warning:\x20Could\x20not\x20resolve\x20embedded\x20segment\x20\x27'+_0x486737+'\x27\x20for\x20'+_0x223c71),_0x30f2ba;};if(_0x732e8e[_0x4b43d3(0x104)][_0x4b43d3(0x10d)]?.[_0x4b43d3(0x14b)]&&isPendingSegmentId(_0x732e8e[_0x4b43d3(0x104)][_0x4b43d3(0x10d)]['segmentId'])){const _0x2bae5e=_0x42539f(_0x732e8e[_0x4b43d3(0x104)][_0x4b43d3(0x10d)][_0x4b43d3(0x14b)],_0x4b43d3(0x103));_0x2bae5e&&(_0x732e8e[_0x4b43d3(0x104)][_0x4b43d3(0x10d)][_0x4b43d3(0x14b)]=_0x2bae5e);}for(const _0x334e99 of _0x732e8e[_0x4b43d3(0x104)][_0x4b43d3(0x19e)]||[]){const _0x37f7bb=_0x59cd0b[_0x4b43d3(0x11e)](_0x334e99[_0x4b43d3(0x170)][_0x4b43d3(0x123)]());_0x37f7bb&&(_0x334e99['id']=_0x37f7bb);if(_0x334e99['entryCriteria']?.[_0x4b43d3(0x14b)]&&isPendingSegmentId(_0x334e99[_0x4b43d3(0x185)][_0x4b43d3(0x14b)])){const _0x478a58=_0x42539f(_0x334e99[_0x4b43d3(0x185)][_0x4b43d3(0x14b)],_0x4b43d3(0xe7)+_0x334e99[_0x4b43d3(0x170)]+_0x4b43d3(0x1aa));_0x478a58&&(_0x334e99[_0x4b43d3(0x185)]['segmentId']=_0x478a58);}if(_0x334e99[_0x4b43d3(0xdd)])for(const _0x3e00ba of _0x334e99['exitCriterias']){if(_0x3e00ba[_0x4b43d3(0x14b)]&&isPendingSegmentId(_0x3e00ba[_0x4b43d3(0x14b)])){const _0x45b5c9=_0x42539f(_0x3e00ba[_0x4b43d3(0x14b)],_0x4b43d3(0xe7)+_0x334e99[_0x4b43d3(0x170)]+_0x4b43d3(0x153));_0x45b5c9&&(_0x3e00ba['segmentId']=_0x45b5c9);}}if(_0x334e99[_0x4b43d3(0x1c7)]?.[_0x4b43d3(0x14b)]&&isPendingSegmentId(_0x334e99[_0x4b43d3(0x1c7)][_0x4b43d3(0x14b)])){const _0x37a6a8=_0x42539f(_0x334e99[_0x4b43d3(0x1c7)][_0x4b43d3(0x14b)],_0x4b43d3(0xe7)+_0x334e99[_0x4b43d3(0x170)]+_0x4b43d3(0x11d));_0x37a6a8&&(_0x334e99[_0x4b43d3(0x1c7)][_0x4b43d3(0x14b)]=_0x37a6a8);}if(_0x334e99['steps']){const _0x4725f8=_0x9105de=>_0x18ba14[_0x4b43d3(0x104)][_0x4b43d3(0x19e)]?.[_0x4b43d3(0x11b)](_0x19902b=>_0x19902b[_0x4b43d3(0x170)][_0x4b43d3(0x123)]()===_0x334e99[_0x4b43d3(0x170)][_0x4b43d3(0x123)]())?.[_0x4b43d3(0x121)]?.[_0x9105de];for(const _0x465a38 of Object[_0x4b43d3(0x147)](_0x334e99[_0x4b43d3(0x121)])){const _0x5bc473=_0x334e99['steps'][_0x465a38],_0x3f9de3=_0x4725f8(_0x465a38);if(_0x5bc473['type']===_0x4b43d3(0x1ab)&&_0x5bc473[_0x4b43d3(0x16e)]&&(isPendingActivationId(_0x5bc473['journeyActivationStepId'])||_0x5bc473['journeyActivationStepId']==='')){if(_0x3f9de3?.[_0x4b43d3(0x16e)]&&isPendingActivationId(_0x3f9de3[_0x4b43d3(0x16e)])){const _0x3e12c4=extractPendingActivationName(_0x3f9de3[_0x4b43d3(0x16e)]),_0x3229d7=_0x23459a[_0x4b43d3(0x11e)](_0x3e12c4);_0x3229d7&&(_0x5bc473[_0x4b43d3(0x16e)]=_0x3229d7);}}if(_0x5bc473['type']===_0x4b43d3(0x1a5)&&_0x5bc473[_0x4b43d3(0x100)]&&_0x3f9de3?.[_0x4b43d3(0x100)])for(let _0x5471b8=0x0;_0x5471b8<_0x5bc473[_0x4b43d3(0x100)][_0x4b43d3(0xdc)];_0x5471b8++){const _0x485585=_0x5bc473[_0x4b43d3(0x100)][_0x5471b8],_0x5c92d0=_0x3f9de3[_0x4b43d3(0x100)][_0x5471b8];if(_0x5c92d0?.['segmentId']&&isPendingSegmentId(_0x5c92d0['segmentId'])){const _0x205371=_0x42539f(_0x5c92d0['segmentId'],_0x4b43d3(0xe7)+_0x334e99[_0x4b43d3(0x170)]+'\x27\x20decision\x20point\x20branch\x20\x27'+(_0x485585[_0x4b43d3(0x170)]||_0x5471b8)+'\x27');_0x205371&&(_0x485585[_0x4b43d3(0x14b)]=_0x205371);}}_0x5bc473['type']===_0x4b43d3(0x119)&&_0x3f9de3?.['type']==='WaitStep'&&resolveWaitStepPendingIds(_0x5bc473,_0x3f9de3,_0x42539f,_0x334e99[_0x4b43d3(0x170)]);}}}}
|
|
1
|
+
const a169_0x12f8f2=a169_0x880c;(function(_0x425f53,_0x25a6c5){const _0x5c2ea6=a169_0x880c,_0x2a3d34=_0x425f53();while(!![]){try{const _0x524e85=-parseInt(_0x5c2ea6(0x229))/0x1*(parseInt(_0x5c2ea6(0x24b))/0x2)+parseInt(_0x5c2ea6(0x244))/0x3*(parseInt(_0x5c2ea6(0x1ce))/0x4)+-parseInt(_0x5c2ea6(0x1e8))/0x5+-parseInt(_0x5c2ea6(0x251))/0x6*(parseInt(_0x5c2ea6(0x273))/0x7)+-parseInt(_0x5c2ea6(0x279))/0x8*(-parseInt(_0x5c2ea6(0x23e))/0x9)+parseInt(_0x5c2ea6(0x2bd))/0xa+parseInt(_0x5c2ea6(0x1e0))/0xb;if(_0x524e85===_0x25a6c5)break;else _0x2a3d34['push'](_0x2a3d34['shift']());}catch(_0x13d03e){_0x2a3d34['push'](_0x2a3d34['shift']());}}}(a169_0xf99f,0xd87b0));import{createHash}from'crypto';import{Logger}from'../../utils/logger/index.js';const logger=Logger['of'](a169_0x12f8f2(0x2be));export const PENDING_SEGMENT_PREFIX=a169_0x12f8f2(0x2b2);export const PENDING_ACTIVATION_PREFIX=a169_0x12f8f2(0x20e);export function createPendingSegmentId(_0x541c24){return''+PENDING_SEGMENT_PREFIX+_0x541c24+'__';}export function isPendingSegmentId(_0x4563e2){const _0x42f4f2=a169_0x12f8f2;return _0x4563e2[_0x42f4f2(0x28d)](PENDING_SEGMENT_PREFIX)&&!_0x4563e2[_0x42f4f2(0x28d)](PENDING_ACTIVATION_PREFIX);}export function extractPendingSegmentName(_0x4a71ad){const _0x12dfaa=a169_0x12f8f2;return _0x4a71ad[_0x12dfaa(0x228)](/^__pending_(.+)__$/,'$1');}export function createPendingActivationId(_0x3da04b){return''+PENDING_ACTIVATION_PREFIX+_0x3da04b+'__';}export function isPendingActivationId(_0x50a055){const _0x2c9c1d=a169_0x12f8f2;return _0x50a055[_0x2c9c1d(0x28d)](PENDING_ACTIVATION_PREFIX);}export function extractPendingActivationName(_0x1db518){const _0x4c185d=a169_0x12f8f2;return _0x1db518[_0x4c185d(0x228)](/^__pending_act_(.+)__$/,'$1');}export function generateDeterministicJourneySegmentName(_0x2ad93e,_0x406d58){const _0x39bf74=a169_0x12f8f2,_0x108181=_0x2ad93e+'::'+(_0x406d58[_0x39bf74(0x271)]()||_0x39bf74(0x28e)),_0x1133a5=createHash(_0x39bf74(0x23c))['update'](_0x108181)[_0x39bf74(0x280)]('hex')[_0x39bf74(0x209)](0x0,0xc);return _0x39bf74(0x231)+_0x1133a5;}export function ensureJourneyDefaults(_0xd1d229){const _0xc22543=a169_0x12f8f2;!_0xd1d229[_0xc22543(0x261)]&&(_0xd1d229[_0xc22543(0x261)]=''),!_0xd1d229['state']&&(_0xd1d229[_0xc22543(0x1f1)]='draft');}export function injectExistingStageIds(_0x24a44b,_0x3f5d85){const _0x4ed02b=a169_0x12f8f2,_0x4c256d=new Map(_0x3f5d85['map'](_0x14bc99=>[_0x14bc99['name'],_0x14bc99['id']]));for(const _0x3c7a56 of _0x24a44b){if(!_0x3c7a56['id']){const _0x380f07=_0x4c256d[_0x4ed02b(0x1d3)](_0x3c7a56['name']);_0x380f07&&(_0x3c7a56['id']=_0x380f07);}}}export function resolveTDFolderPath(_0x2edc8c,_0x487631,_0x2449bc){const _0x3bc9b9=a169_0x12f8f2;if(!_0x487631)return _0x2edc8c;if(_0x2edc8c===_0x2449bc||_0x2edc8c[_0x3bc9b9(0x28d)](_0x2449bc+'/'))return _0x2edc8c;return _0x2edc8c?_0x2449bc+'/'+_0x2edc8c:_0x2449bc;}export function addFoldersToCreate(_0x497632,_0x46b1d2,_0x2648f2){const _0x289aba=a169_0x12f8f2;if(!_0x497632)return;if(_0x46b1d2[_0x289aba(0x249)](_0x497632))return;const _0x350fce=_0x497632[_0x289aba(0x2bb)]('/');let _0xb842c9='';for(const _0xeaf482 of _0x350fce){_0xb842c9=_0xb842c9?_0xb842c9+'/'+_0xeaf482:_0xeaf482,!_0x46b1d2[_0x289aba(0x249)](_0xb842c9)&&_0x2648f2[_0x289aba(0x1f7)](_0xb842c9);}}export function sortFoldersByDepth(_0x3a6cdd){const _0x33b09b=a169_0x12f8f2;return[..._0x3a6cdd][_0x33b09b(0x2a7)]((_0xfe7ded,_0x3e4b72)=>{const _0x1af6ec=_0x33b09b,_0x51e82d=(_0xfe7ded['match'](/\//g)||[])[_0x1af6ec(0x295)],_0x58e2e3=(_0x3e4b72[_0x1af6ec(0x29f)](/\//g)||[])[_0x1af6ec(0x295)];return _0x51e82d-_0x58e2e3;});}import*as a169_0x56a015 from'yaml';import{readFileSync}from'fs';import a169_0x240131 from'path';import{isJourneyDef,parseYamlString as a169_0x235896,toYamlString as a169_0x271d0b,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(_0xb24438){const _0x51038a=a169_0x12f8f2;if(Array[_0x51038a(0x200)](_0xb24438))return'['+_0xb24438['map'](_0x1236ba=>stableStringify(_0x1236ba))[_0x51038a(0x2b9)](',')+']';if(_0xb24438&&typeof _0xb24438===_0x51038a(0x1fc)){const _0x183879=_0xb24438,_0x4dddae=Object[_0x51038a(0x1d2)](_0x183879)[_0x51038a(0x2a7)](),_0x5961c1=_0x4dddae[_0x51038a(0x201)](_0x3085dd=>'\x22'+_0x3085dd+'\x22:'+stableStringify(_0x183879[_0x3085dd]));return'{'+_0x5961c1['join'](',')+'}';}const _0x37373c=JSON[_0x51038a(0x298)](_0xb24438);return _0x37373c===undefined?_0x51038a(0x299):_0x37373c;}function activationSignature(_0x23ac55){const _0x311f30=a169_0x12f8f2,_0x20494a={'connection':_0x23ac55[_0x311f30(0x1f5)],..._0x23ac55[_0x311f30(0x27c)]!==undefined&&{'all_columns':_0x23ac55[_0x311f30(0x27c)]},..._0x23ac55[_0x311f30(0x2cb)]!==undefined&&{'columns':_0x23ac55[_0x311f30(0x2cb)]},..._0x23ac55['behavior']!==undefined&&{'behavior':_0x23ac55[_0x311f30(0x1e5)]},..._0x23ac55[_0x311f30(0x2b1)]!==undefined&&{'behaviors':_0x23ac55[_0x311f30(0x2b1)]},..._0x23ac55['schedule']!==undefined&&{'schedule':_0x23ac55[_0x311f30(0x2a0)]},..._0x23ac55[_0x311f30(0x26b)]!==undefined&&{'notification':_0x23ac55[_0x311f30(0x26b)]},..._0x23ac55[_0x311f30(0x27a)]!==undefined&&{'connector_config':_0x23ac55[_0x311f30(0x27a)]},..._0x23ac55[_0x311f30(0x234)]!==undefined&&{'activation_template_id':_0x23ac55['activation_template_id']}};return stableStringify(_0x20494a);}async function fetchSegment(_0x51d257,_0x3b372f,_0x41bfd7,_0x1ed2b6){const _0x4b8376=a169_0x12f8f2,_0x31b39c=_0x1ed2b6?.[_0x4b8376(0x1f8)](_0x5fb2f6=>_0x5fb2f6['id']===_0x41bfd7);if(_0x31b39c)return _0x31b39c;try{return await _0x51d257[_0x4b8376(0x28e)]['getSegment'](_0x3b372f,_0x41bfd7);}catch(_0x159ab9){logger['debug']('getSegment\x20failed\x20for\x20'+_0x41bfd7+_0x4b8376(0x22c)+_0x159ab9);try{return await _0x51d257[_0x4b8376(0x28e)][_0x4b8376(0x211)](_0x41bfd7);}catch(_0x4ea2a7){return logger[_0x4b8376(0x1eb)]('getSegmentEntity\x20also\x20failed\x20for\x20'+_0x41bfd7+':\x20'+_0x4ea2a7),null;}}}function recoverSegmentIdsFromPushRecovery(_0x9dd050,_0x2de427,_0x397630){const _0x3bf5ac=a169_0x12f8f2,_0xe8675b=readPushRecovery(_0x9dd050[_0x3bf5ac(0x253)]);if(_0xe8675b?.['journeyName']===_0x9dd050[_0x3bf5ac(0x256)][_0x3bf5ac(0x2a4)])for(const [_0x160a6a,_0x1fdcb1]of Object['entries'](_0xe8675b[_0x3bf5ac(0x1ed)])){const _0x2f22c8=generateDeterministicJourneySegmentName(_0x9dd050['yamlConfig'][_0x3bf5ac(0x2a4)],_0x160a6a);_0x1fdcb1[_0x3bf5ac(0x274)]===_0x2f22c8&&(_0x2de427[_0x3bf5ac(0x1ea)](_0x160a6a,_0x1fdcb1[_0x3bf5ac(0x26d)]),_0x397630['set'](_0x160a6a,_0x1fdcb1[_0x3bf5ac(0x26d)]));}}async function createOrRecoverEmbeddedSegment(_0x1b3147,_0x29c86a,_0x191fba,_0x82650f){const _0x2b19ed=a169_0x12f8f2;let _0x12d100;try{_0x12d100=await _0x1b3147[_0x2b19ed(0x28e)][_0x2b19ed(0x210)]({'name':_0x191fba[_0x2b19ed(0x205)],'description':_0x191fba[_0x2b19ed(0x261)],'journeyId':_0x191fba['journeyId'],'rule':_0x82650f(_0x191fba[_0x2b19ed(0x214)],!![]),'countPopulation':!![],'parentFolderId':_0x191fba[_0x2b19ed(0x27d)],'audienceId':_0x191fba[_0x2b19ed(0x1e4)]});}catch(_0x2d9b2a){const _0x5280fd=_0x2d9b2a instanceof Error&&_0x2d9b2a['message'][_0x2b19ed(0x26f)](_0x2b19ed(0x268));if(_0x5280fd){const _0x28cb20=readPushRecovery(_0x29c86a[_0x2b19ed(0x253)]),_0x5d0c77=_0x28cb20?.[_0x2b19ed(0x1e3)]===_0x29c86a[_0x2b19ed(0x256)][_0x2b19ed(0x2a4)]?_0x28cb20[_0x2b19ed(0x1ed)][_0x191fba[_0x2b19ed(0x297)]]:undefined;if(_0x5d0c77?.[_0x2b19ed(0x274)]===_0x191fba[_0x2b19ed(0x205)])await _0x1b3147[_0x2b19ed(0x28e)][_0x2b19ed(0x22d)](_0x191fba[_0x2b19ed(0x1e4)],_0x5d0c77[_0x2b19ed(0x26d)],{'description':_0x191fba[_0x2b19ed(0x261)],'rule':_0x82650f(_0x191fba['resolvedRule'],!![]),'countPopulation':!![]}),_0x12d100=_0x5d0c77['segmentId'];else throw new SDKError(ErrorCode[_0x2b19ed(0x239)],_0x2b19ed(0x232)+_0x191fba[_0x2b19ed(0x297)]+_0x2b19ed(0x1f0)+(_0x2b19ed(0x20a)+_0x29c86a['absolutePath'][_0x2b19ed(0x228)](/([^/]+)$/,_0x2b19ed(0x245))+')\x20')+'and\x20the\x20server\x20segment,\x20then\x20retry.',_0x2d9b2a);}else throw _0x2d9b2a;}return saveSegmentToPushRecovery(_0x29c86a[_0x2b19ed(0x253)],_0x29c86a[_0x2b19ed(0x256)]['name'],_0x191fba[_0x2b19ed(0x297)],{'segmentId':_0x12d100,'uniqueServerName':_0x191fba[_0x2b19ed(0x205)],'createdAt':new Date()[_0x2b19ed(0x2ad)]()}),_0x12d100;}export async function prepareSegmentFiles(_0x22ac10,_0x3968a5,_0x18a2cc,_0x4d8a42,_0x372abd){const _0x38bdf5=a169_0x12f8f2,{activationDefToCreateRequest:_0x177430}=await import(_0x38bdf5(0x202)),_0x2c47fd=[],_0x354f36=new Set();for(const {yamlConfig:_0x5ab5c2,folderPath:_0x234108,sourcePath:_0x2afe37}of _0x22ac10){const _0x1da61d=resolveTDFolderPath(_0x234108,_0x4d8a42,_0x372abd),_0x2d41d7=_0x1da61d+':'+_0x5ab5c2[_0x38bdf5(0x2a4)],_0x4e1b59=_0x3968a5[_0x38bdf5(0x29b)][_0x38bdf5(0x1d3)](_0x2d41d7),_0x4072d2=_0x4e1b59?_0x3968a5[_0x38bdf5(0x23a)]['get'](_0x4e1b59['id'])||[]:[];addFoldersToCreate(_0x1da61d,_0x3968a5[_0x38bdf5(0x241)],_0x354f36);const _0x1acc79=calculateActivationActions(_0x5ab5c2[_0x38bdf5(0x20c)]||[],_0x4072d2,_0x3968a5[_0x38bdf5(0x1ef)],_0x3968a5[_0x38bdf5(0x212)]);for(const _0x324511 of _0x1acc79){(_0x324511[_0x38bdf5(0x1d7)]===_0x38bdf5(0x29d)||_0x324511['type']==='update')&&_0x324511['yamlActivation']&&(_0x324511[_0x38bdf5(0x2c3)]=await _0x177430(_0x324511[_0x38bdf5(0x288)],_0x18a2cc));}const _0xd5c6ef=calculateSegmentDiff(_0x5ab5c2,_0x4e1b59,_0x4072d2,_0x3968a5[_0x38bdf5(0x1ef)],_0x3968a5[_0x38bdf5(0x212)]);_0x2c47fd[_0x38bdf5(0x2a9)]({'relativePath':_0x5ab5c2[_0x38bdf5(0x2a4)],'absolutePath':_0x2afe37,'yamlConfig':_0x5ab5c2,'folderPath':_0x1da61d,'existingSegment':_0x4e1b59,'existingActivations':_0x4072d2,'isNew':_0xd5c6ef[_0x38bdf5(0x267)],'hasChanges':_0xd5c6ef[_0x38bdf5(0x247)],'diff':_0xd5c6ef[_0x38bdf5(0x206)],'activationActions':_0x1acc79});}return{'segmentFiles':_0x2c47fd,'foldersToCreate':_0x354f36};}function a169_0x880c(_0x4e4c34,_0x1536f7){_0x4e4c34=_0x4e4c34-0x1ce;const _0xf99fa4=a169_0xf99f();let _0x880c74=_0xf99fa4[_0x4e4c34];return _0x880c74;}export async function prepareJourneyFiles(_0x21f1ba,_0x3edbf0,_0xd77b41,_0x52732b){const _0x4b2fd8=a169_0x12f8f2,_0x57b2ed=[],_0x2471aa=new Set();for(const {yamlConfig:_0x322df0,folderPath:_0x41c093,sourcePath:_0x3fa7cb}of _0x21f1ba){const _0x2722e9=resolveTDFolderPath(_0x41c093,_0xd77b41,_0x52732b),_0x763ac3=_0x2722e9+':'+_0x322df0[_0x4b2fd8(0x2a4)],_0x26db51=_0x3edbf0[_0x4b2fd8(0x1ec)][_0x4b2fd8(0x1d3)](_0x763ac3);let _0x28fc7c,_0x4892cf;if(_0x26db51&&_0x26db51[_0x4b2fd8(0x295)]>0x0){const _0x330a57=buildLocalExpandedRuleMappings(_0x322df0),{createYamlContext:_0x173f3b,prefetchJourneySegments:_0x486911}=createPushYamlContextForBundle(_0x3edbf0[_0x4b2fd8(0x2ba)],_0x3edbf0[_0x4b2fd8(0x1e4)],_0x3edbf0[_0x4b2fd8(0x21a)],_0x330a57,_0x3edbf0[_0x4b2fd8(0x1ef)],_0x3edbf0[_0x4b2fd8(0x212)],_0x3edbf0['activationStepsById'],_0x3edbf0[_0x4b2fd8(0x2b3)]);await _0x486911(_0x26db51['map'](_0x341950=>_0x341950['id']));const _0x5f4ccc=await _0x3edbf0[_0x4b2fd8(0x2ba)][_0x4b2fd8(0x2bc)][_0x4b2fd8(0x2c7)](_0x26db51[0x0]['journeyBundleId']),_0x17dd19=hasMultipleVersions(_0x322df0),_0x31d75b=async _0x5be338=>{const _0x33ea49=_0x4b2fd8,_0x38722d=_0x3edbf0['journeyById']?.['get'](_0x5be338);if(_0x38722d)return _0x38722d;return _0x3edbf0['fetchJourney']({'journeyId':_0x5be338,'journeyName':_0x322df0['name'],'isMultiVersion':_0x26db51[_0x33ea49(0x295)]>0x1});};if(_0x17dd19&&_0x26db51[_0x4b2fd8(0x295)]>0x1){const _0x17c15a=[];for(const _0x5c1594 of _0x26db51){const _0x1c8f3d=_0x5c1594[_0x4b2fd8(0x2a1)]||0x1;_0x3edbf0['progress']?.[_0x4b2fd8(0x23f)](_0x4b2fd8(0x260)+_0x322df0['name']+'\x20v'+_0x1c8f3d);const _0x53aeb2=await _0x31d75b(_0x5c1594['id']),_0x397500=_0x173f3b(_0x5c1594['id']),_0x5c4c1f=await journeyResponseToDef(_0x53aeb2,_0x397500);_0x17c15a[_0x4b2fd8(0x2a9)]({'item':_0x5c1594,'yaml':_0x5c4c1f});}const _0xe03e14=buildLocalRuleToNameMappingFromJourney(_0x322df0);_0x4892cf=buildMergedJourneyDef(_0x17c15a,_0xe03e14,_0x5f4ccc);const _0x5b7989=Math[_0x4b2fd8(0x26e)](..._0x17c15a['map'](_0x43b917=>_0x43b917[_0x4b2fd8(0x270)][_0x4b2fd8(0x2a1)]||0x0)),_0xced487=_0x26db51[_0x4b2fd8(0x1f8)](_0x208720=>(_0x208720['versionNumber']||0x0)===_0x5b7989);_0xced487&&(_0x3edbf0['progress']?.[_0x4b2fd8(0x23f)]('Fetching\x20'+_0x322df0['name']+'\x20v'+_0x5b7989),_0x28fc7c=await _0x31d75b(_0xced487['id']));}else{const _0x2998a3=_0x26db51[_0x26db51[_0x4b2fd8(0x295)]-0x1];_0x3edbf0[_0x4b2fd8(0x1de)]?.[_0x4b2fd8(0x23f)](_0x4b2fd8(0x260)+_0x322df0[_0x4b2fd8(0x2a4)]),_0x28fc7c=await _0x31d75b(_0x2998a3['id']);const _0x4c3679=_0x173f3b(_0x2998a3['id']),_0x2d2516=await journeyResponseToDef(_0x28fc7c,_0x4c3679),_0x371104=buildLocalRuleToNameMappingFromJourney(_0x322df0);_0x4892cf=buildMergedJourneyDef([{'item':_0x2998a3,'yaml':_0x2d2516}],_0x371104,_0x5f4ccc);}}addFoldersToCreate(_0x2722e9,_0x3edbf0[_0x4b2fd8(0x241)],_0x2471aa);const _0x5268db=calculateJourneyDiff(_0x322df0,_0x4892cf);_0x57b2ed[_0x4b2fd8(0x2a9)]({'relativePath':_0x322df0[_0x4b2fd8(0x2a4)],'absolutePath':_0x3fa7cb,'yamlConfig':_0x322df0,'folderPath':_0x2722e9,'existingJourney':_0x28fc7c,'isNew':_0x5268db['isNew'],'hasChanges':_0x5268db[_0x4b2fd8(0x247)],'diff':_0x5268db[_0x4b2fd8(0x206)]});}return{'journeyFiles':_0x57b2ed,'foldersToCreate':_0x2471aa};}export function calculateActivationActions(_0x568a6b,_0x4e7cb6,_0x299131,_0x45be10){const _0xe552be=a169_0x12f8f2,_0x1324d3=[],_0x5b70ea=new Map();for(const _0x44221b of _0x4e7cb6){_0x5b70ea[_0xe552be(0x1ea)](_0x44221b[_0xe552be(0x2a4)],_0x44221b);}const _0x472b50=new Map();for(const _0x590503 of _0x568a6b){_0x472b50[_0xe552be(0x1ea)](_0x590503[_0xe552be(0x2a4)],_0x590503);}for(const _0x5bfded of _0x568a6b){const _0x2935fe=_0x5b70ea[_0xe552be(0x1d3)](_0x5bfded[_0xe552be(0x2a4)]);if(!_0x2935fe)_0x1324d3['push']({'type':_0xe552be(0x29d),'name':_0x5bfded[_0xe552be(0x2a4)],'yamlActivation':_0x5bfded});else{const _0x28f01b=activationResponseToDef(_0x2935fe,_0x299131,_0x45be10),_0x5dd227=a169_0x56a015[_0xe552be(0x298)](_0x28f01b),_0x11bce4=a169_0x56a015[_0xe552be(0x298)](_0x5bfded);_0x5dd227!==_0x11bce4&&_0x1324d3[_0xe552be(0x2a9)]({'type':_0xe552be(0x23f),'name':_0x5bfded[_0xe552be(0x2a4)],'yamlActivation':_0x5bfded,'existingActivation':_0x2935fe});}}for(const _0x35d1a2 of _0x4e7cb6){!_0x472b50[_0xe552be(0x249)](_0x35d1a2[_0xe552be(0x2a4)])&&_0x1324d3['push']({'type':_0xe552be(0x275),'name':_0x35d1a2[_0xe552be(0x2a4)],'existingActivation':_0x35d1a2});}return _0x1324d3;}function calculateYamlDiff(_0x5258fd,_0x585ad4){if(_0x585ad4){const _0x2a8db3=generateDiff(_0x585ad4,_0x5258fd),_0x47d459=hasChanges(_0x2a8db3);return{'isNew':![],'hasChanges':_0x47d459,'diff':_0x47d459?formatDiffWithColors(_0x2a8db3):undefined};}const _0x5aef0e=generateDiff('',_0x5258fd);return{'isNew':!![],'hasChanges':![],'diff':formatDiffWithColors(_0x5aef0e)};}export function calculateSegmentDiff(_0x5d29e3,_0x22c05a,_0x56675c,_0x194ab1,_0x598186){const _0x1984d4=segmentToYamlString(_0x5d29e3),_0x5ed46b=_0x22c05a?segmentToYamlString(segmentWithActivationsToYaml(_0x22c05a,_0x56675c,undefined,_0x194ab1,_0x598186)):undefined;return calculateYamlDiff(_0x1984d4,_0x5ed46b);}export function calculateJourneyDiff(_0x250ab4,_0x1ada0e){const _0x2ef306=normalizeJourneyDef(_0x250ab4,_0x250ab4),_0x192b38=a169_0x271d0b(_0x2ef306),_0x1b217e=_0x1ada0e?a169_0x271d0b(normalizeJourneyDef(_0x1ada0e,_0x250ab4)):undefined;return calculateYamlDiff(_0x192b38,_0x1b217e);}export function findSegmentsToDelete(_0x31c610,_0x5eed92,_0x397a82,_0x17e9f4,_0x1caeea){const _0x373c48=a169_0x12f8f2,_0xc6ce97=new Set();for(const {yamlConfig:_0x182c58,folderPath:_0x4180f1}of _0x5eed92){_0xc6ce97[_0x373c48(0x1f7)](_0x4180f1+':'+_0x182c58[_0x373c48(0x2a4)]);}return _0x31c610['filter'](_0x21f372=>{const _0x4c3b6f=_0x373c48,_0x5d4b81=_0x21f372[_0x4c3b6f(0x22e)]?_0x397a82['get'](_0x21f372[_0x4c3b6f(0x22e)][_0x4c3b6f(0x21c)]())||'':'',_0x5412ca=_0x5d4b81+':'+_0x21f372[_0x4c3b6f(0x2a4)];if(_0xc6ce97[_0x4c3b6f(0x249)](_0x5412ca))return![];if(_0x1caeea)return _0x5d4b81===_0x17e9f4||_0x5d4b81[_0x4c3b6f(0x28d)](_0x17e9f4+'/');return!![];});}export function findJourneysToDelete(_0x12482a,_0x52ba1c,_0x3daa95,_0x54fbea,_0x11ff23){const _0x271c89=a169_0x12f8f2,_0x4b295e=new Set();for(const {yamlConfig:_0x393f18,folderPath:_0x20949d}of _0x52ba1c){_0x4b295e[_0x271c89(0x1f7)](_0x20949d+':'+_0x393f18[_0x271c89(0x2a4)]);}return _0x12482a['filter'](_0x2c9bb9=>{const _0x1abdf8=_0x271c89,_0x8e829b=_0x2c9bb9['folderId']?_0x3daa95['get'](_0x2c9bb9[_0x1abdf8(0x27d)])||'':'',_0x129dcf=_0x8e829b+':'+_0x2c9bb9[_0x1abdf8(0x203)];if(_0x4b295e[_0x1abdf8(0x249)](_0x129dcf))return![];if(_0x11ff23)return _0x8e829b===_0x54fbea||_0x8e829b[_0x1abdf8(0x28d)](_0x54fbea+'/');return!![];});}export function buildSegmentLookupMap(_0x7f9fa4,_0x3bc784){const _0x2dd59d=a169_0x12f8f2,_0x2ad1d1=new Map();for(const _0x3a4651 of _0x7f9fa4){const _0xad5234=_0x3a4651[_0x2dd59d(0x22e)]?_0x3bc784[_0x2dd59d(0x1d3)](_0x3a4651[_0x2dd59d(0x22e)]['toString']())||'':'',_0x33c008=_0xad5234+':'+_0x3a4651[_0x2dd59d(0x2a4)];_0x2ad1d1[_0x2dd59d(0x1ea)](_0x33c008,_0x3a4651);}return _0x2ad1d1;}export function buildSegmentNameToIdMap(_0x3db959){const _0x453372=a169_0x12f8f2,_0x39c105=new Map();for(const _0x2682da of _0x3db959){_0x39c105[_0x453372(0x1ea)](_0x2682da['name'],_0x2682da['id']);}return _0x39c105;}export function buildJourneyBundleLookupMap(_0x4be2a4,_0x44d9d5){const _0x5e000d=a169_0x12f8f2,_0x409aff=new Map();for(const _0xe3752e of _0x4be2a4){const _0x52abf7=_0xe3752e[_0x5e000d(0x27d)]?_0x44d9d5[_0x5e000d(0x1d3)](_0xe3752e[_0x5e000d(0x27d)])||'':'',_0x2bd378=_0x52abf7+':'+_0xe3752e[_0x5e000d(0x203)];!_0x409aff[_0x5e000d(0x249)](_0x2bd378)&&_0x409aff['set'](_0x2bd378,[]),_0x409aff[_0x5e000d(0x1d3)](_0x2bd378)[_0x5e000d(0x2a9)](_0xe3752e);}for(const _0x1ae348 of _0x409aff[_0x5e000d(0x254)]()){_0x1ae348['sort']((_0xc8458c,_0x4fb55e)=>(_0xc8458c[_0x5e000d(0x2a1)]||0x0)-(_0x4fb55e[_0x5e000d(0x2a1)]||0x0));}return _0x409aff;}export function collectFoldersToCreate(_0x4caf4b,_0x453fa0){const _0x40eeb4=a169_0x12f8f2,_0xafbe02=new Set();for(const _0x591064 of _0x4caf4b){if(!_0x591064)continue;if(_0x453fa0['has'](_0x591064))continue;const _0x5a1eeb=_0x591064[_0x40eeb4(0x2bb)]('/');let _0x48f321='';for(const _0x49e48a of _0x5a1eeb){_0x48f321=_0x48f321?_0x48f321+'/'+_0x49e48a:_0x49e48a,!_0x453fa0['has'](_0x48f321)&&_0xafbe02[_0x40eeb4(0x1f7)](_0x48f321);}}return _0xafbe02;}export function parseAndClassifyYamlFiles(_0x54aa0a,_0xd70e7f,_0x5f22ee){const _0x9a835f=a169_0x12f8f2,_0x1d88ca=[],_0x3705fc=[];for(const _0x4a4592 of _0x54aa0a){const _0x5768e7=a169_0x240131[_0x9a835f(0x223)](_0xd70e7f,a169_0x240131['dirname'](_0x4a4592)),_0x400b2d=_0x5768e7==='.'?'':_0x5768e7[_0x9a835f(0x228)](/\\/g,'/'),_0x3df099=readFileSync(_0x4a4592,_0x9a835f(0x2cf)),_0x18409a=a169_0x56a015[_0x9a835f(0x2a2)](_0x3df099);if(isJourneyDef(_0x18409a,_0x4a4592)){const _0x2c1632=a169_0x235896(_0x3df099);_0x3705fc[_0x9a835f(0x2a9)]({'yamlConfig':_0x2c1632,'folderPath':_0x400b2d,'sourcePath':_0x4a4592});}else{if(!_0x5f22ee?.['skipSegments']){const _0x1b453b=parseSegmentYamlFile(_0x3df099),_0x5b4e80=normalizeChildSegmentYaml(_0x1b453b);_0x1d88ca[_0x9a835f(0x2a9)]({'yamlConfig':_0x5b4e80,'folderPath':_0x400b2d,'sourcePath':_0x4a4592});}}}return{'segments':_0x1d88ca,'journeys':_0x3705fc};}export function validateParsedFiles(_0xce089f,_0x3ad269){const _0x3feb03=a169_0x12f8f2,_0x3bd037=[];for(const {yamlConfig:_0x226fe2,sourcePath:_0x289b4e}of _0xce089f['segments']){const _0x2aa6c4=readFileSync(_0x289b4e,_0x3feb03(0x2cf)),_0xc2f020=a169_0x56a015[_0x3feb03(0x221)](_0x2aa6c4),_0x3991af=validateSegmentDef(_0x226fe2,{'source':_0x2aa6c4,'document':_0xc2f020},{'skipSchema':!![]});if(!_0x3991af[_0x3feb03(0x286)]){const _0xb1a2af=a169_0x240131[_0x3feb03(0x223)](_0x3ad269,_0x289b4e);_0x3bd037[_0x3feb03(0x2a9)]({'filePath':_0xb1a2af,'source':_0x2aa6c4,'result':_0x3991af,'isJourney':![]});}}for(const {yamlConfig:_0x5ddb29,sourcePath:_0x3f9f89}of _0xce089f['journeys']){const _0x2024cd=readFileSync(_0x3f9f89,_0x3feb03(0x2cf)),_0x3c9a49=a169_0x56a015[_0x3feb03(0x221)](_0x2024cd),_0x41c14a=validateJourneyDef(_0x5ddb29,{'source':_0x2024cd,'document':_0x3c9a49},{'skipSchema':!![]});if(!_0x41c14a[_0x3feb03(0x286)]){const _0x2087de=a169_0x240131[_0x3feb03(0x223)](_0x3ad269,_0x3f9f89);_0x3bd037['push']({'filePath':_0x2087de,'source':_0x2024cd,'result':_0x41c14a,'isJourney':!![]});}}return _0x3bd037;}export function formatValidationErrors(_0x427179){const _0x453e57=a169_0x12f8f2,_0x36e473=[];for(const {filePath:_0x45d47f,source:_0xbfacc2,result:_0x4b125b,isJourney:_0x27bdff}of _0x427179){const _0x1cb1c4=_0x27bdff?_0x453e57(0x2bc):_0x453e57(0x28e);_0x36e473['push']('\x0a'+_0x45d47f+'\x20('+_0x1cb1c4+_0x453e57(0x22a)+_0x4b125b[_0x453e57(0x27b)][_0x453e57(0x295)]+_0x453e57(0x2cd)),_0x36e473[_0x453e57(0x2a9)](formatValidationResult(_0x4b125b,_0xbfacc2,_0x45d47f));}return _0x36e473[_0x453e57(0x2b9)]('\x0a');}export function buildLocalExpandedRuleMappings(_0x2ba5e8){const _0x150509=a169_0x12f8f2,_0x1751cf=new Set(),_0x1037c2=new Map(),_0x1cdcad=collectSegmentUsageCounts(_0x2ba5e8);if(_0x2ba5e8[_0x150509(0x1ed)])for(const [_0x59853e,_0x58c02a]of Object[_0x150509(0x1f6)](_0x2ba5e8['segments'])){_0x1751cf[_0x150509(0x1f7)](_0x59853e);if(_0x58c02a[_0x150509(0x284)]){const _0x45ec55=yamlRuleToApi(_0x58c02a[_0x150509(0x284)]),_0x2230bb=apiRuleToYaml(_0x45ec55);_0x1037c2[_0x150509(0x1ea)](_0x59853e,_0x2230bb);}}const _0x53cc17=new Map();let _0x3d81b9=0x0;for(const [_0x331857,_0x21a6bd]of _0x1037c2){const _0x875114=serializeExpandedRule(_0x21a6bd,_0x1037c2),_0x160467=_0x53cc17[_0x150509(0x1d3)](_0x875114)||[];_0x160467[_0x150509(0x2a9)]({'name':_0x331857,'index':_0x3d81b9}),_0x53cc17['set'](_0x875114,_0x160467),_0x3d81b9++;}const _0x44b631=new Map();for(const [_0x17ac0f,_0x2860f1]of _0x53cc17){const _0x37314e=_0x2860f1[_0x150509(0x209)]()[_0x150509(0x2a7)]((_0x3d0bf4,_0x55a9e5)=>{const _0x75ce32=_0x150509,_0x21d02b=_0x1cdcad['get'](_0x3d0bf4[_0x75ce32(0x2a4)])||0x0,_0x3553a8=_0x1cdcad['get'](_0x55a9e5['name'])||0x0;if(_0x21d02b!==_0x3553a8)return _0x3553a8-_0x21d02b;return _0x3d0bf4[_0x75ce32(0x243)]-_0x55a9e5[_0x75ce32(0x243)];})[_0x150509(0x201)](_0x22a1b9=>_0x22a1b9[_0x150509(0x2a4)]),_0x2b72b5=[];for(const _0xc668ce of _0x37314e){const _0x545cfb=_0x1cdcad[_0x150509(0x1d3)](_0xc668ce)||0x0,_0x62b473=Math['max'](_0x545cfb,0x1);for(let _0x2061db=0x0;_0x2061db<_0x62b473;_0x2061db++){_0x2b72b5[_0x150509(0x2a9)](_0xc668ce);}}_0x44b631[_0x150509(0x1ea)](_0x17ac0f,_0x2b72b5);}return{'existingLocalSegmentNames':_0x1751cf,'localSegmentRules':_0x1037c2,'localExpandedRuleToNames':_0x44b631};}export function createSegmentIdResolver(_0x4e6fc5,_0x6b5b1c){return async _0x15265e=>{const _0x216d05=a169_0x880c,_0x44ea06=_0x4e6fc5[_0x216d05(0x1d3)](_0x15265e);if(!_0x44ea06)throw new SDKError(ErrorCode[_0x216d05(0x218)],_0x216d05(0x1d6)+_0x15265e+_0x216d05(0x246)+_0x6b5b1c+'\x27)');return _0x44ea06;};}export function extractRootFolderId(_0x46c674){const _0x1e6545=a169_0x12f8f2;return _0x46c674['relationships']?.['parentSegmentFolder']?.['data']?.['id']||_0x46c674[_0x1e6545(0x28f)]?.[_0x1e6545(0x1e7)]?.[_0x1e6545(0x204)]?.['id'];}export function buildConnectionMaps(_0x5db828){const _0x3ab45c=a169_0x12f8f2,_0x1f9d91=new Map(),_0x340745=new Map(),_0x30ba02=new Map();for(const _0x2ba8f3 of _0x5db828){_0x1f9d91[_0x3ab45c(0x1ea)](_0x2ba8f3[_0x3ab45c(0x2a4)],parseInt(_0x2ba8f3['id'],0xa)),_0x340745[_0x3ab45c(0x1ea)](_0x2ba8f3['id'],_0x2ba8f3[_0x3ab45c(0x2a4)]),_0x30ba02[_0x3ab45c(0x1ea)](_0x2ba8f3[_0x3ab45c(0x2a4)],_0x2ba8f3['type']);}return{'nameToId':_0x1f9d91,'idToName':_0x340745,'nameToType':_0x30ba02};}export function calculatePushStats(_0x5835a7,_0x484916,_0x33a3dc,_0x4a612b,_0x5ae9b0,_0x34e49d,_0x213682){const _0x34cc30=a169_0x12f8f2,_0x46c51a=_0x5835a7['filter'](_0x23145b=>_0x23145b[_0x34cc30(0x267)]),_0x3cc4d0=_0x5835a7['filter'](_0x5d7497=>!_0x5d7497[_0x34cc30(0x267)]&&_0x5d7497[_0x34cc30(0x247)]),_0x40208b=_0x5835a7[_0x34cc30(0x2af)](_0x3e247d=>!_0x3e247d[_0x34cc30(0x267)]&&!_0x3e247d[_0x34cc30(0x247)]),_0x37cd4e=_0x34e49d?_0x4a612b:[],_0x481922=_0x484916[_0x34cc30(0x2af)](_0x5b734b=>_0x5b734b[_0x34cc30(0x267)]),_0x309d41=_0x484916['filter'](_0x36475b=>!_0x36475b[_0x34cc30(0x267)]&&_0x36475b['hasChanges']),_0x55b487=_0x484916[_0x34cc30(0x2af)](_0x307651=>!_0x307651['isNew']&&!_0x307651[_0x34cc30(0x247)]),_0x6b9f0b=_0x34e49d?_0x5ae9b0:[],_0x34614a=_0x5835a7[_0x34cc30(0x2c2)](_0x3d5544=>_0x3d5544[_0x34cc30(0x2ab)]),_0x30d70e=_0x34614a['filter'](_0x57d98a=>_0x57d98a['type']===_0x34cc30(0x29d)),_0x52a684=_0x34614a[_0x34cc30(0x2af)](_0x292085=>_0x292085[_0x34cc30(0x1d7)]===_0x34cc30(0x23f)),_0x3dc352=_0x34614a[_0x34cc30(0x2af)](_0x360e49=>_0x360e49['type']===_0x34cc30(0x275)),_0x3bbfd1=Array[_0x34cc30(0x276)](_0x33a3dc)['sort'](),_0x64e82a=_0x213682?![]:_0x46c51a[_0x34cc30(0x295)]>0x0||_0x3cc4d0[_0x34cc30(0x295)]>0x0||_0x37cd4e[_0x34cc30(0x295)]>0x0,_0x21d515=_0x481922['length']>0x0||_0x309d41[_0x34cc30(0x295)]>0x0||_0x6b9f0b[_0x34cc30(0x295)]>0x0,_0xb1c06a=_0x213682?![]:_0x34614a[_0x34cc30(0x295)]>0x0,_0x59c28e=_0x3bbfd1['length']>0x0;return{'segments':{'new':_0x46c51a,'changed':_0x3cc4d0,'unchanged':_0x40208b,'toDelete':_0x37cd4e},'journeys':{'new':_0x481922,'changed':_0x309d41,'unchanged':_0x55b487,'toDelete':_0x6b9f0b},'activations':{'all':_0x34614a,'toCreate':_0x30d70e,'toUpdate':_0x52a684,'toDelete':_0x3dc352},'folders':{'toCreate':_0x3bbfd1},'counts':{'segments':{'new':_0x46c51a['length'],'changed':_0x3cc4d0[_0x34cc30(0x295)],'unchanged':_0x40208b[_0x34cc30(0x295)],'toDelete':_0x37cd4e[_0x34cc30(0x295)]},'journeys':{'new':_0x481922[_0x34cc30(0x295)],'changed':_0x309d41['length'],'unchanged':_0x55b487['length'],'toDelete':_0x6b9f0b[_0x34cc30(0x295)]},'activations':{'create':_0x30d70e[_0x34cc30(0x295)],'update':_0x52a684[_0x34cc30(0x295)],'delete':_0x3dc352[_0x34cc30(0x295)]},'folders':_0x3bbfd1[_0x34cc30(0x295)]},'hasChanges':_0x64e82a||_0x21d515||_0xb1c06a||_0x59c28e};}function a169_0xf99f(){const _0x58b184=['12549582TGGQCL','update','Cannot\x20create\x20embedded\x20segment\x20for\x20existing\x20journey\x20without\x20journey\x20ID','folderPathToId','createActivation','index','1685589tSFlQN','.$1.push-recovery.json','\x20(referenced\x20in\x20embedded\x20segment\x20\x27','hasChanges','segment_created','has','Journey\x20\x27','3197086wVSyws','Updating\x20segment\x20\x27','ACTIVATION_UPDATE_ERROR','INTERNAL','activation_created','journeyActivationNameToId','5370uLDckm','nameToType','absolutePath','values','\x20segment\x20from\x20file:\x20','yamlConfig','effectiveFolderId','getActivation','deleteActivation','\x27\x20not\x20found\x20in\x20parent\x20segment\x20(referenced\x20in\x20jump\x20step\x20of\x20\x27','DecisionPoint','Failed\x20to\x20sync\x20activations\x20for\x20segment\x20\x27','Segment\x20not\x20found','unchanged','day','Fetching\x20','description','Cannot\x20create\x20embedded\x20activation\x20without\x20journey\x20context','folder_creating','folder_created','updateActivation','\x20(referenced\x20in\x20journey\x20','isNew','Name\x20has\x20already\x20been\x20taken','../../utils/async.js','JOURNEY_SYNTAX_ERROR','notification','\x20journey\x20from\x20file:\x20','segmentId','max','includes','item','trim','logInfo','1428QAboMX','uniqueServerName','delete','from','exitCriterias','NOT_FOUND','8IbYbMJ','connector_config','errors','all_columns','folderId','activation_updated','Creating\x20activation\x20\x27','digest','embeddedSegmentNameToId','JOURNEY_UPDATE_ERROR','Failed\x20to\x20fetch\x20referenced\x20segment\x20','rule','segment_updating','valid','\x27\x20by\x20rule\x20content','yamlActivation','waitStep','logSuccess','list','Creating\x20segment\x20\x27','startsWith','segment','relationships','journeyActivationStepId','folder','conditionSegmentId','segment_updated','segmentNameToId','length','SEGMENT_SYNTAX_ERROR','localName','stringify','null','journeyId','segmentByFolderAndName','entryCriteria','create','created','match','schedule','versionNumber','parse','journey_updated','name','Created\x20folder\x20\x27','Created\x20journey\x20\x27','sort','folderPath','push','Failed\x20to\x20','activationActions','Condition','toISOString','createdSegmentId','filter','steps','behaviors','__pending_','journeyById','logDeleted','stages','results','\x27\x20from\x20file:\x20','\x27\x20decision\x20point\x20branch\x20\x27','join','deps','split','journey','7342470GqFmEk','tdx.sdk.push-workflow','Define\x20it\x20in\x20the\x20journey\x27s\x20\x27activations\x27\x20section\x20or\x20use\x20an\x20existing\x20activation\x20ID.','kind','goal','flatMap','validatedRequest','Created\x20segment\x20\x27','attributes','journey_updating','getLatestJourneyId','existingSegment','conditions','goal\x20criteria','columns','./journey-yaml.js','\x20error(s)','\x27\x20wait\x20condition','utf-8','with','activationParams','4CEuhYG','Stage\x20\x27','WaitStep','rootFolderId','keys','get','Updated\x20segment\x20\x27','createSegment','Segment\x20not\x20found:\x20','type','journey_created','Matched\x20server\x20segment\x20\x27','embedded_segment_created','Failed\x20to\x20resolve\x20activation\x20','deleted','Entry\x20criteria:\x20','progress','\x27...','836363gCrGbU','waitStepType','milestone','journeyName','parentId','behavior','\x0a\x20\x20','parentFolder','493570eYXQxC','activation_deleted','set','debug','journeyBundlesByFolderAndName','segments','branches','idToEmailMap','\x27\x20already\x20exists\x20on\x20server\x20but\x20cannot\x20be\x20found.\x20','state','Updated\x20activation\x20\x27','stage\x20\x27','all','connection','entries','add','find','embedded_activation_created','activation_creating','updated','object','idToName','\x27\x20entry\x20criteria','conditionTimeoutDuration','isArray','map','./child-segment-yaml.js','journeyBundleName','data','uniqueSegmentName','diff','reduce','segment_deleted','slice','Delete\x20the\x20push\x20recovery\x20file\x20(','Activation','activations','resolveSegment','__pending_act_','Created\x20activation\x20\x27','createJourneySegment','getSegmentEntity','connectionIdToNameMap','deleteSegment','resolvedRule',').\x20','onProgress','listActivations','SEGMENT_NOT_FOUND','\x27\x20not\x20found\x20in\x20journey\x20\x27','existingSegments','existingActivation','toString','toLowerCase','conditionTimeoutUnit','journeys','withProgress','parseDocument','embedded_activation_creating','relative','ACTIVATION_SYNTAX_ERROR','action','resolveJourneyId','getJourney','replace','1GxXwAP','):\x20','activationContext',',\x20falling\x20back\x20to\x20getSegmentEntity:\x20','updateSegmentById','segmentFolderId','entry_criteria','\x20activation\x20\x27','journey_entry_criteria_','Embedded\x20segment\x20\x27','run_after_journey_refresh','activation_template_id','buildUserMaps','waitStepUnit','some','journeyStages','SEGMENT_UPDATE_ERROR','activationsBySegmentId','existingJourney','sha1','verbose'];a169_0xf99f=function(){return _0x58b184;};return a169_0xf99f();}export async function buildPushExecutionContext(_0x3cff81,_0x144f12,_0x490a4f,_0x3bbfda,_0x5bad27,_0x2ac091){const _0x4621f5=a169_0x12f8f2,_0x558572=extractRootFolderId(_0x490a4f),{pathToId:_0x2d3e5a,idToPath:_0x446649}=buildFolderMaps(_0x5bad27),_0x3bdbfa=buildSegmentNameToIdMap(_0x3bbfda),_0x5899d3=new Map(),{batchAsync:_0x53eb12}=await import('../../utils/async.js'),[_0x45836e,_0x15ed3b]=await Promise[_0x4621f5(0x1f4)]([_0x3cff81['user'][_0x4621f5(0x235)](),_0x3cff81['connection'][_0x4621f5(0x28b)](),((async()=>{const _0x46b50a=_0x4621f5;!_0x2ac091&&_0x3bbfda[_0x46b50a(0x295)]>0x0&&await _0x53eb12(_0x3bbfda,async _0x2f23df=>{const _0x262d39=_0x46b50a,_0x3ec4d2=await _0x3cff81[_0x262d39(0x28e)][_0x262d39(0x217)](_0x144f12,_0x2f23df['id']);_0x5899d3['set'](_0x2f23df['id'],_0x3ec4d2);});})())]),{emailToId:_0x9ad3a6,idToEmail:_0x598283}=_0x45836e,_0x524b8b=buildConnectionMaps(_0x15ed3b);return{'rootFolderId':_0x558572,'folderPathToId':_0x2d3e5a,'folderIdToPath':_0x446649,'segmentNameToId':_0x3bdbfa,'activationsBySegmentId':_0x5899d3,'emailToIdMap':_0x9ad3a6,'idToEmailMap':_0x598283,'connectionNameToIdMap':_0x524b8b['nameToId'],'connectionIdToNameMap':_0x524b8b[_0x4621f5(0x1fd)],'connectionNameToTypeMap':_0x524b8b[_0x4621f5(0x252)]};}export function createPushYamlContextForBundle(_0x2f770d,_0x1f506c,_0x76a654,_0x2d6450,_0x2fccf7,_0x1574bf,_0x4a6e9a,_0x52bd43){const {existingLocalSegmentNames:_0x18af2c,localExpandedRuleToNames:_0x349dc7}=_0x2d6450,_0x36edd4=new Set(),_0x58d9cc=new Map(),_0x17f0b6=new Map(),_0x5e4f37=new Map(),_0x3e479e=createJumpTargetCache(),_0x48389b=new Map(),_0x50a809=new Map(),_0x36d1e0=new Set();let _0x45ed88;const _0x332410=_0x20b54e=>{const _0x423667={'resolveSegment':async _0x5e24cc=>{const _0x9fe798=a169_0x880c,_0xab0243=_0x5e4f37['get'](_0x5e24cc);if(_0xab0243!==undefined)return{'name':_0xab0243,'isJourneyLocal':!![]};try{const _0x52ff02=await fetchSegment(_0x2f770d,_0x1f506c,_0x5e24cc,_0x76a654);if(!_0x52ff02)throw new Error(_0x9fe798(0x25d));const _0x5e0a38=generateJourneyLocalName(_0x52ff02[_0x9fe798(0x2a4)]),_0x16baf9=_0x52ff02[_0x9fe798(0x2c0)]===SEGMENT_KIND_JOURNEY&&_0x5e0a38!==undefined;let _0x3b4b24=_0x52ff02[_0x9fe798(0x2a4)],_0x5f9015;if(_0x16baf9&&_0x52ff02[_0x9fe798(0x284)]){const _0x21e2ee=apiRuleToYaml(_0x52ff02[_0x9fe798(0x284)]);_0x50a809['set'](_0x5e24cc,_0x21e2ee);const _0x29e69a=async _0x47fd63=>{const _0x447950=_0x9fe798,_0x417af2=collectSegmentRefsFromRule(_0x47fd63);for(const _0x3cd671 of _0x417af2){if(!_0x50a809[_0x447950(0x249)](_0x3cd671))try{const _0x3e2fe1=await fetchSegment(_0x2f770d,_0x1f506c,_0x3cd671,_0x76a654);if(_0x3e2fe1?.[_0x447950(0x284)]){const _0x57f266=apiRuleToYaml(_0x3e2fe1['rule']);_0x50a809['set'](_0x3cd671,_0x57f266),await _0x29e69a(_0x57f266);}}catch(_0x2b3ea5){logger[_0x447950(0x1eb)](_0x447950(0x283)+_0x3cd671+':\x20'+_0x2b3ea5);}}};await _0x29e69a(_0x21e2ee);const _0x49833e=serializeExpandedRule(_0x21e2ee,_0x50a809),_0x224a85=_0x349dc7[_0x9fe798(0x1d3)](_0x49833e);if(_0x224a85&&_0x224a85[_0x9fe798(0x295)]>0x0){const _0x2b3c28=_0x58d9cc[_0x9fe798(0x1d3)](_0x49833e)||0x0,_0x524780=_0x224a85[_0x2b3c28]||_0x224a85[_0x224a85['length']-0x1];_0x58d9cc[_0x9fe798(0x1ea)](_0x49833e,_0x2b3c28+0x1),_0x3b4b24=_0x524780,_0x36edd4[_0x9fe798(0x1f7)](_0x3b4b24),_0x5e4f37[_0x9fe798(0x1ea)](_0x5e24cc,_0x3b4b24);const _0x1be744=await resolveRuleSegmentRefs(_0x21e2ee,async _0x10cf9a=>{const _0x255cd3=_0x9fe798,_0x23930c=_0x5e4f37[_0x255cd3(0x1d3)](_0x10cf9a);if(_0x23930c)return _0x23930c;const _0x85737e=await _0x45ed88[_0x255cd3(0x20d)](_0x10cf9a);return _0x85737e[_0x255cd3(0x2a4)];});_0x5f9015={'description':_0x52ff02[_0x9fe798(0x261)],'rule':_0x1be744};}else{const _0x492e77=_0x48389b[_0x9fe798(0x1d3)](_0x49833e);if(_0x492e77)_0x3b4b24=_0x492e77,_0x5e4f37[_0x9fe798(0x1ea)](_0x5e24cc,_0x3b4b24);else{if(_0x5e0a38){let _0x1c4bc5=_0x5e0a38,_0x3e1f63=0x2;while(_0x36edd4[_0x9fe798(0x249)](_0x1c4bc5)||_0x18af2c[_0x9fe798(0x249)](_0x1c4bc5)){_0x1c4bc5=_0x5e0a38+'_'+_0x3e1f63,_0x3e1f63++;}_0x36edd4[_0x9fe798(0x1f7)](_0x1c4bc5),_0x3b4b24=_0x1c4bc5;}_0x5e4f37['set'](_0x5e24cc,_0x3b4b24),_0x48389b[_0x9fe798(0x1ea)](_0x49833e,_0x3b4b24);const _0xbe027d=await resolveRuleSegmentRefs(_0x21e2ee,async _0x28c1e9=>{const _0xf3e1b7=_0x9fe798,_0x3d9a2e=_0x5e4f37['get'](_0x28c1e9);if(_0x3d9a2e)return _0x3d9a2e;const _0x10c28d=await _0x45ed88[_0xf3e1b7(0x20d)](_0x28c1e9);return _0x10c28d[_0xf3e1b7(0x2a4)];});_0x5f9015={'description':_0x52ff02['description'],'rule':_0xbe027d};}}}return{'name':_0x3b4b24,'isJourneyLocal':_0x16baf9,'definition':_0x5f9015};}catch(_0x565df6){return logger['debug']('Failed\x20to\x20resolve\x20segment\x20'+_0x5e24cc+':\x20'+_0x565df6),{'name':_0x5e24cc,'isJourneyLocal':![]};}},'resolveActivation':async _0x28412c=>{const _0x9b5d42=a169_0x880c,_0xd218c1=_0x17f0b6[_0x9b5d42(0x1d3)](_0x28412c);if(_0xd218c1!==undefined)return{'name':_0xd218c1,'isJourneyLocal':!![]};try{let _0x649542=_0x4a6e9a?.[_0x9b5d42(0x1d3)](_0x28412c);!_0x649542&&(_0x649542=await _0x2f770d[_0x9b5d42(0x2bc)][_0x9b5d42(0x258)](_0x20b54e,_0x28412c));const _0x54308d=_0x649542[_0x9b5d42(0x2c5)][_0x9b5d42(0x2d1)][_0x9b5d42(0x2a4)]||_0x28412c,_0x5394cd=sanitizeYamlKey(_0x54308d)||'activation_'+_0x28412c,_0x5af7b1=_0x5394cd;_0x17f0b6[_0x9b5d42(0x1ea)](_0x28412c,_0x5af7b1);const _0x4c5efa=journeyActivationStepToYaml(_0x649542,_0x2fccf7,_0x1574bf);return{'name':_0x5af7b1,'isJourneyLocal':!![],'definition':_0x4c5efa};}catch(_0x17d526){return logger[_0x9b5d42(0x1eb)](_0x9b5d42(0x1db)+_0x28412c+':\x20'+_0x17d526),{'name':_0x28412c,'isJourneyLocal':![]};}},'resolveJumpTarget':(_0x1028f7,_0x2eb62f)=>resolveJumpTarget(_0x1028f7,_0x2eb62f,_0x3e479e,async _0x325187=>{const _0x15070b=a169_0x880c,_0x5dbe49=_0x52bd43?.[_0x15070b(0x1d3)](_0x325187);if(_0x5dbe49)return _0x5dbe49;return _0x2f770d['journey'][_0x15070b(0x227)](_0x325187);})};return _0x45ed88=_0x423667,_0x423667;},_0x1c2e85=async _0x2bafea=>{const _0x59c9f6=a169_0x880c,{collectSegmentIdsFromJourneyApi:_0x4edbc0}=await import(_0x59c9f6(0x2cc)),{batchAsync:_0x2776cc}=await import(_0x59c9f6(0x269)),_0x442406=new Set();for(const _0x552c39 of _0x2bafea){let _0x946a8b=_0x52bd43?.[_0x59c9f6(0x1d3)](_0x552c39);!_0x946a8b&&(_0x946a8b=await _0x2f770d[_0x59c9f6(0x2bc)][_0x59c9f6(0x227)](_0x552c39));const _0x420af4=_0x4edbc0(_0x946a8b);for(const _0x4b6e71 of _0x420af4){_0x442406[_0x59c9f6(0x1f7)](_0x4b6e71);}}let _0x1c20a0=Array[_0x59c9f6(0x276)](_0x442406);while(_0x1c20a0[_0x59c9f6(0x295)]>0x0){const _0x1616a8=_0x1c20a0[_0x59c9f6(0x2af)](_0x8348be=>!_0x36d1e0[_0x59c9f6(0x249)](_0x8348be));if(_0x1616a8[_0x59c9f6(0x295)]===0x0)break;const _0x3120a3=await _0x2776cc(_0x1616a8,async _0x28d5d8=>{const _0x19e7a7=_0x59c9f6;_0x36d1e0[_0x19e7a7(0x1f7)](_0x28d5d8);const _0x5b109c=await fetchSegment(_0x2f770d,_0x1f506c,_0x28d5d8,_0x76a654);if(!_0x5b109c)return null;return{'segmentId':_0x28d5d8,'segment':_0x5b109c};},0xa),_0x213373=new Set();for(const _0x41ad48 of _0x3120a3){if(!_0x41ad48?.[_0x59c9f6(0x28e)]?.['rule'])continue;const _0x2490d2=apiRuleToYaml(_0x41ad48['segment'][_0x59c9f6(0x284)]);_0x50a809[_0x59c9f6(0x1ea)](_0x41ad48[_0x59c9f6(0x26d)],_0x2490d2);const _0x32f240=collectSegmentRefsFromRule(_0x2490d2);for(const _0x1327df of _0x32f240){!_0x36d1e0[_0x59c9f6(0x249)](_0x1327df)&&_0x213373[_0x59c9f6(0x1f7)](_0x1327df);}}_0x1c20a0=Array['from'](_0x213373);}};return{'createYamlContext':_0x332410,'prefetchJourneySegments':_0x1c2e85};}export async function executePushSegments(_0x30f1d8,_0x16c483,_0x4491c1,_0x26c86f,_0x5c1c56){const _0xfe1d18=a169_0x12f8f2,{segmentDefToCreateRequest:_0xbd0431,segmentDefToUpdateRequest:_0xf572fa}=await import(_0xfe1d18(0x202)),_0x36d221=_0x4491c1['folderPathToId'],_0x3921f7=0x5,_0x4592a7=async _0x5a7f8d=>{const _0x19370b=_0xfe1d18,_0xfa71a1=_0x5a7f8d['folderPath']?_0x36d221['get'](_0x5a7f8d['folderPath']):undefined;let _0x22dea4;const _0x25662a={'created':0x0,'updated':0x0,'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};let _0xc1ac47=_0x5a7f8d[_0x19370b(0x256)];if(_0x5a7f8d['yamlConfig'][_0x19370b(0x284)]){const _0x3203d8=createSegmentIdResolver(_0x4491c1[_0x19370b(0x294)],_0x5a7f8d['yamlConfig']['name']),_0x9b0e11=await resolveRuleSegmentIds(_0x5a7f8d[_0x19370b(0x256)]['rule'],_0x3203d8);_0xc1ac47={..._0x5a7f8d[_0x19370b(0x256)],'rule':_0x9b0e11};}try{if(_0x5a7f8d[_0x19370b(0x267)]){_0x5c1c56[_0x19370b(0x216)]?.({'type':'segment_creating','name':_0x5a7f8d[_0x19370b(0x256)]['name']});const _0x1ce40b=_0xbd0431(_0xc1ac47,_0xfa71a1),_0x16f304=await _0x5c1c56[_0x19370b(0x220)](_0x19370b(0x28c)+_0x5a7f8d[_0x19370b(0x256)][_0x19370b(0x2a4)]+_0x19370b(0x1df),()=>_0x30f1d8[_0x19370b(0x28e)][_0x19370b(0x1d5)](_0x26c86f['parentId'],_0x1ce40b));_0x22dea4=_0x16f304[_0x19370b(0x204)]['id'],_0x4491c1[_0x19370b(0x294)][_0x19370b(0x1ea)](_0x5a7f8d[_0x19370b(0x256)][_0x19370b(0x2a4)],_0x22dea4),_0x25662a['createdSegmentId']={'name':_0x5a7f8d[_0x19370b(0x256)][_0x19370b(0x2a4)],'id':_0x22dea4},_0x5c1c56[_0x19370b(0x216)]?.({'type':_0x19370b(0x248),'name':_0x5a7f8d[_0x19370b(0x256)]['name'],'segmentId':_0x22dea4}),_0x5c1c56[_0x19370b(0x28a)]?.(_0x19370b(0x2c4)+_0x5a7f8d[_0x19370b(0x256)]['name']+'\x27'),_0x25662a[_0x19370b(0x29e)]=0x1;}else{if(_0x5a7f8d[_0x19370b(0x247)]){_0x5c1c56['onProgress']?.({'type':_0x19370b(0x285),'name':_0x5a7f8d[_0x19370b(0x256)][_0x19370b(0x2a4)]});const _0x46e629=_0xf572fa(_0xc1ac47);_0xfa71a1!==_0x5a7f8d['existingSegment']?.[_0x19370b(0x22e)]&&(_0x46e629['segmentFolderId']=_0xfa71a1?parseInt(_0xfa71a1,0xa):undefined),await _0x5c1c56['withProgress'](_0x19370b(0x24c)+_0x5a7f8d[_0x19370b(0x256)]['name']+_0x19370b(0x1df),()=>_0x30f1d8['segment'][_0x19370b(0x22d)](_0x26c86f[_0x19370b(0x1e4)],_0x5a7f8d[_0x19370b(0x2c8)]['id'],_0x46e629)),_0x22dea4=_0x5a7f8d[_0x19370b(0x2c8)]['id'],_0x5c1c56[_0x19370b(0x216)]?.({'type':_0x19370b(0x293),'name':_0x5a7f8d[_0x19370b(0x256)][_0x19370b(0x2a4)]}),_0x5c1c56[_0x19370b(0x28a)]?.(_0x19370b(0x1d4)+_0x5a7f8d[_0x19370b(0x256)][_0x19370b(0x2a4)]+'\x27'),_0x25662a[_0x19370b(0x1fb)]=0x1;}else _0x22dea4=_0x5a7f8d['existingSegment']['id'];}}catch(_0x4ff1e7){const _0x5efd68=isHttp400Error(_0x4ff1e7),_0x21bb0b=_0x5efd68?ErrorCode[_0x19370b(0x296)]:ErrorCode[_0x19370b(0x239)],_0x2aefc3=getErrorMessage(_0x4ff1e7);throw new SDKError(_0x21bb0b,'Failed\x20to\x20'+(_0x5a7f8d[_0x19370b(0x267)]?_0x19370b(0x29d):_0x19370b(0x23f))+_0x19370b(0x255)+_0x5a7f8d[_0x19370b(0x253)]+_0x19370b(0x1e6)+_0x2aefc3,_0x4ff1e7);}try{const _0x18673a=await syncActivationsForSegment(_0x30f1d8,_0x26c86f[_0x19370b(0x1e4)],_0x22dea4,_0x5a7f8d['yamlConfig'][_0x19370b(0x2a4)],_0x5a7f8d[_0x19370b(0x2ab)],_0x5c1c56,_0x5a7f8d[_0x19370b(0x253)]);_0x25662a['activations']=_0x18673a;}catch(_0x1f606f){if(_0x1f606f instanceof SDKError)throw _0x1f606f;throw new SDKError(ErrorCode['ACTIVATION_UPDATE_ERROR'],_0x19370b(0x25c)+_0x5a7f8d['yamlConfig'][_0x19370b(0x2a4)]+_0x19370b(0x2b7)+_0x5a7f8d[_0x19370b(0x253)]+_0x19370b(0x1e6)+getErrorMessage(_0x1f606f),_0x1f606f);}return _0x25662a;},_0x3edecd=await batchAsync(_0x16c483,_0x4592a7,_0x3921f7),_0x1456a8={'created':0x0,'updated':0x0,'deleted':0x0,'createdSegmentIds':new Map(),'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};for(const _0x12d4b9 of _0x3edecd){_0x1456a8['created']+=_0x12d4b9['created'],_0x1456a8[_0xfe1d18(0x1fb)]+=_0x12d4b9[_0xfe1d18(0x1fb)],_0x12d4b9['createdSegmentId']&&_0x1456a8['createdSegmentIds'][_0xfe1d18(0x1ea)](_0x12d4b9[_0xfe1d18(0x2ae)][_0xfe1d18(0x2a4)],_0x12d4b9['createdSegmentId']['id']),_0x1456a8[_0xfe1d18(0x20c)][_0xfe1d18(0x29e)]+=_0x12d4b9[_0xfe1d18(0x20c)][_0xfe1d18(0x29e)],_0x1456a8[_0xfe1d18(0x20c)]['updated']+=_0x12d4b9[_0xfe1d18(0x20c)][_0xfe1d18(0x1fb)],_0x1456a8[_0xfe1d18(0x20c)][_0xfe1d18(0x1dc)]+=_0x12d4b9['activations']['deleted'];}return _0x1456a8;}async function syncActivationsForSegment(_0x5a42b2,_0x5126dd,_0x13d04b,_0xc28f72,_0x83bf3,_0xa654b5,_0x160e81){const _0x5826ed=a169_0x12f8f2,_0x363826={'created':0x0,'updated':0x0,'deleted':0x0};for(const _0x19d6f3 of _0x83bf3){try{if(_0x19d6f3[_0x5826ed(0x1d7)]===_0x5826ed(0x29d)&&_0x19d6f3[_0x5826ed(0x2c3)])_0xa654b5[_0x5826ed(0x216)]?.({'type':_0x5826ed(0x1fa),'segmentName':_0xc28f72,'activationName':_0x19d6f3[_0x5826ed(0x2a4)]}),await _0xa654b5['withProgress'](_0x5826ed(0x27f)+_0x19d6f3[_0x5826ed(0x2a4)]+'\x27...',()=>_0x5a42b2[_0x5826ed(0x28e)][_0x5826ed(0x242)](_0x5126dd,_0x13d04b,_0x19d6f3[_0x5826ed(0x2c3)])),_0xa654b5[_0x5826ed(0x216)]?.({'type':_0x5826ed(0x24f),'segmentName':_0xc28f72,'activationName':_0x19d6f3[_0x5826ed(0x2a4)]}),_0xa654b5[_0x5826ed(0x28a)]?.(_0x5826ed(0x20f)+_0x19d6f3[_0x5826ed(0x2a4)]+'\x27'),_0x363826[_0x5826ed(0x29e)]++;else{if(_0x19d6f3['type']===_0x5826ed(0x23f)&&_0x19d6f3[_0x5826ed(0x2c3)]&&_0x19d6f3['existingActivation'])_0xa654b5['onProgress']?.({'type':'activation_updating','segmentName':_0xc28f72,'activationName':_0x19d6f3[_0x5826ed(0x2a4)]}),await _0xa654b5[_0x5826ed(0x220)]('Updating\x20activation\x20\x27'+_0x19d6f3['name']+_0x5826ed(0x1df),()=>_0x5a42b2[_0x5826ed(0x28e)][_0x5826ed(0x265)](_0x5126dd,_0x13d04b,_0x19d6f3[_0x5826ed(0x21b)]['id'],_0x19d6f3[_0x5826ed(0x2c3)])),_0xa654b5['onProgress']?.({'type':_0x5826ed(0x27e),'segmentName':_0xc28f72,'activationName':_0x19d6f3[_0x5826ed(0x2a4)]}),_0xa654b5[_0x5826ed(0x28a)]?.(_0x5826ed(0x1f2)+_0x19d6f3[_0x5826ed(0x2a4)]+'\x27'),_0x363826[_0x5826ed(0x1fb)]++;else _0x19d6f3[_0x5826ed(0x1d7)]===_0x5826ed(0x275)&&_0x19d6f3[_0x5826ed(0x21b)]&&(_0xa654b5['onProgress']?.({'type':'activation_deleting','segmentName':_0xc28f72,'activationName':_0x19d6f3[_0x5826ed(0x2a4)]}),await _0xa654b5['withProgress']('Deleting\x20activation\x20\x27'+_0x19d6f3[_0x5826ed(0x2a4)]+_0x5826ed(0x1df),()=>_0x5a42b2[_0x5826ed(0x28e)][_0x5826ed(0x259)](_0x5126dd,_0x13d04b,_0x19d6f3[_0x5826ed(0x21b)]['id'])),_0xa654b5['onProgress']?.({'type':_0x5826ed(0x1e9),'segmentName':_0xc28f72,'activationName':_0x19d6f3[_0x5826ed(0x2a4)]}),_0xa654b5[_0x5826ed(0x2b4)]?.('Deleted\x20activation\x20\x27'+_0x19d6f3[_0x5826ed(0x2a4)]+'\x27'),_0x363826[_0x5826ed(0x1dc)]++);}}catch(_0x261fd9){const _0x11e3fd=isHttp400Error(_0x261fd9),_0x5c5df3=_0x11e3fd?ErrorCode[_0x5826ed(0x224)]:ErrorCode[_0x5826ed(0x24d)],_0x432cb7=getErrorMessage(_0x261fd9);throw new SDKError(_0x5c5df3,_0x5826ed(0x2aa)+_0x19d6f3[_0x5826ed(0x1d7)]+_0x5826ed(0x230)+_0x19d6f3[_0x5826ed(0x2a4)]+'\x27\x20from\x20file:\x20'+_0x160e81+_0x5826ed(0x1e6)+_0x432cb7,_0x261fd9);}}return _0x363826;}export async function executePushFolders(_0x2bec26,_0x2ebb77,_0xe9b408,_0x2095be,_0x4831b4){const _0xcc790a=a169_0x12f8f2,_0x2993fb=new Map(_0xe9b408),_0x4d351b=sortFoldersByDepth(_0x2ebb77);for(const _0xa43de2 of _0x4d351b){const _0x1ac8c3=_0xa43de2[_0xcc790a(0x2bb)]('/'),_0x5535ac=_0x1ac8c3[_0x1ac8c3[_0xcc790a(0x295)]-0x1],_0x4474fe=_0x1ac8c3[_0xcc790a(0x209)](0x0,-0x1)[_0xcc790a(0x2b9)]('/'),_0x1e9f56=_0x2993fb[_0xcc790a(0x1d3)](_0x4474fe);_0x4831b4[_0xcc790a(0x216)]?.({'type':_0xcc790a(0x263),'folder':_0xa43de2});const _0x3698a1={'name':_0x5535ac,'parentFolderId':_0x1e9f56},_0xd63371=await _0x4831b4[_0xcc790a(0x220)]('Creating\x20folder\x20\x27'+_0xa43de2+'\x27...',()=>_0x2bec26[_0xcc790a(0x28e)]['createFolder'](_0x2095be[_0xcc790a(0x1e4)],_0x3698a1));_0x2993fb[_0xcc790a(0x1ea)](_0xa43de2,_0xd63371[_0xcc790a(0x204)]['id']),_0x4831b4['onProgress']?.({'type':_0xcc790a(0x264),'folder':_0xa43de2,'folderId':_0xd63371[_0xcc790a(0x204)]['id']}),_0x4831b4[_0xcc790a(0x272)]?.(_0xcc790a(0x2a5)+_0xa43de2+'\x27');}return _0x2993fb;}export async function executePushSegmentDeletions(_0x3b46f2,_0x143c16,_0xa2c447){const _0x4c479d=a169_0x12f8f2;if(_0x143c16[_0x4c479d(0x295)]===0x0)return 0x0;const {batchAsync:_0x366b79}=await import(_0x4c479d(0x269)),_0x4e62e3=0x5,_0x51d468=await _0x366b79(_0x143c16,async _0x20be75=>{const _0x5e6529=_0x4c479d;return _0xa2c447[_0x5e6529(0x216)]?.({'type':'segment_deleting','name':_0x20be75[_0x5e6529(0x2a4)]}),await _0x3b46f2[_0x5e6529(0x28e)][_0x5e6529(0x213)](_0x20be75['id']),_0xa2c447[_0x5e6529(0x216)]?.({'type':_0x5e6529(0x208),'name':_0x20be75[_0x5e6529(0x2a4)]}),_0xa2c447[_0x5e6529(0x2b4)]?.('Deleted\x20segment\x20\x27'+_0x20be75['name']+'\x27'),0x1;},_0x4e62e3);return _0x51d468[_0x4c479d(0x207)]((_0x2230bc,_0x53a0be)=>_0x2230bc+_0x53a0be,0x0);}export async function executePushJourneys(_0x59d74c,_0x2f26af,_0x42b3f4,_0x3d7a97,_0x3d271b){const _0x253138=a169_0x12f8f2,{journeyDefToRequest:_0x3430c3}=await import(_0x253138(0x2cc)),{activationDefToCreateRequest:_0x3c3301,yamlRuleToApi:_0x444e69,validateSegmentRule:_0x4d7d98}=await import(_0x253138(0x202)),_0x3b0450={'results':[],'created':0x0,'updated':0x0,'embeddedSegmentNameToId':new Map()},_0x3262cb=new Map(_0x42b3f4[_0x253138(0x294)]),_0x453f6d=0x5;for(let _0x583299=0x0;_0x583299<_0x2f26af[_0x253138(0x295)];_0x583299+=_0x453f6d){const _0x3095ba=_0x2f26af['slice'](_0x583299,_0x583299+_0x453f6d),_0x5bb7b2=await Promise['all'](_0x3095ba[_0x253138(0x201)](async _0x3d124f=>{const _0x55dedb=_0x253138;if(!_0x3d124f['isNew']&&!_0x3d124f[_0x55dedb(0x247)])return{'action':'unchanged','name':_0x3d124f[_0x55dedb(0x256)][_0x55dedb(0x2a4)],'journeyId':_0x3d124f[_0x55dedb(0x23b)]?.['id']};const _0x191a3a=_0x3d124f[_0x55dedb(0x2a8)]?_0x42b3f4[_0x55dedb(0x241)][_0x55dedb(0x1d3)](_0x3d124f[_0x55dedb(0x2a8)]):undefined;_0x3d271b[_0x55dedb(0x216)]?.({'type':_0x3d124f[_0x55dedb(0x267)]?'journey_creating':_0x55dedb(0x2c6),'name':_0x3d124f['yamlConfig'][_0x55dedb(0x2a4)]});try{const _0x540257=await executeSingleJourneyPush(_0x59d74c,_0x3d124f,{..._0x42b3f4,'segmentNameToId':_0x3262cb},{'parentId':_0x3d7a97[_0x55dedb(0x1e4)],'rootFolderId':_0x3d7a97[_0x55dedb(0x1d1)],'folderId':_0x191a3a,'verbose':_0x3d7a97[_0x55dedb(0x23d)]},_0x3d271b,{'journeyDefToRequest':_0x3430c3,'activationDefToCreateRequest':_0x3c3301,'yamlRuleToApi':_0x444e69,'validateSegmentRule':_0x4d7d98});for(const [_0x4ce91f,_0x361d0e]of _0x540257[_0x55dedb(0x281)]){_0x3262cb['set'](_0x4ce91f,_0x361d0e),_0x3b0450['embeddedSegmentNameToId'][_0x55dedb(0x1ea)](_0x4ce91f,_0x361d0e);}if(_0x540257[_0x55dedb(0x225)]===_0x55dedb(0x29e))_0x3d271b[_0x55dedb(0x216)]?.({'type':_0x55dedb(0x1d8),'name':_0x3d124f[_0x55dedb(0x256)]['name'],'journeyId':_0x540257[_0x55dedb(0x29a)]}),_0x3d271b[_0x55dedb(0x28a)]?.(_0x55dedb(0x2a6)+_0x3d124f[_0x55dedb(0x256)]['name']+'\x27'),_0x3b0450[_0x55dedb(0x29e)]++;else _0x540257[_0x55dedb(0x225)]===_0x55dedb(0x1fb)&&(_0x3d271b['onProgress']?.({'type':_0x55dedb(0x2a3),'name':_0x3d124f[_0x55dedb(0x256)][_0x55dedb(0x2a4)]}),_0x3d271b[_0x55dedb(0x28a)]?.('Updated\x20journey\x20\x27'+_0x3d124f[_0x55dedb(0x256)][_0x55dedb(0x2a4)]+'\x27'),_0x3b0450[_0x55dedb(0x1fb)]++);return{'action':_0x540257['action'],'name':_0x3d124f[_0x55dedb(0x256)][_0x55dedb(0x2a4)],'journeyId':_0x540257[_0x55dedb(0x29a)]};}catch(_0x2c7a30){const _0x4833fa=isHttp400Error(_0x2c7a30),_0x599610=_0x4833fa?ErrorCode[_0x55dedb(0x26a)]:ErrorCode[_0x55dedb(0x282)],_0x5696fa=getErrorMessage(_0x2c7a30);throw new SDKError(_0x599610,_0x55dedb(0x2aa)+(_0x3d124f[_0x55dedb(0x267)]?_0x55dedb(0x29d):'update')+_0x55dedb(0x26c)+_0x3d124f[_0x55dedb(0x253)]+_0x55dedb(0x1e6)+_0x5696fa,_0x2c7a30);}}));_0x3b0450[_0x253138(0x2b6)][_0x253138(0x2a9)](..._0x5bb7b2);}return _0x3b0450;}async function matchExistingJourneySegments(_0x5dc956,_0x2f6989,_0xb55bbe,_0x350d42,_0x5d3409){const _0x4364c7=a169_0x12f8f2;if(!_0x2f6989[_0x4364c7(0x23b)]||!_0x2f6989[_0x4364c7(0x256)]['segments'])return;const _0x2d4735=new Map(),_0x452d41=new Set();for(const _0x480340 of Object[_0x4364c7(0x1d2)](_0x2f6989[_0x4364c7(0x256)][_0x4364c7(0x1ed)])){const _0x29e73a=generateDeterministicJourneySegmentName(_0x2f6989[_0x4364c7(0x256)][_0x4364c7(0x2a4)],_0x480340);_0x2d4735[_0x4364c7(0x1ea)](_0x29e73a,_0x480340),_0x452d41[_0x4364c7(0x1f7)](_0x480340);}const _0x2de35d=[],_0x14ca10=collectSegmentIdsFromJourneyApi(_0x2f6989[_0x4364c7(0x23b)]);for(const _0x132d88 of _0x14ca10){const _0x25c5b4=await fetchSegment(_0x5dc956,_0xb55bbe,_0x132d88,_0x350d42);if(!_0x25c5b4?.[_0x4364c7(0x2a4)])continue;const _0x3a94cb=_0x2d4735['get'](_0x25c5b4[_0x4364c7(0x2a4)]);_0x3a94cb?(_0x5d3409[_0x4364c7(0x1ea)](_0x3a94cb,_0x132d88),_0x452d41[_0x4364c7(0x275)](_0x3a94cb)):_0x2de35d[_0x4364c7(0x2a9)]({'id':_0x132d88,'seg':_0x25c5b4});}if(_0x452d41['size']>0x0&&_0x2de35d[_0x4364c7(0x295)]>0x0){const {localExpandedRuleToNames:_0x12f957}=buildLocalExpandedRuleMappings(_0x2f6989[_0x4364c7(0x256)]),_0x5266f8=new Map();for(const {id:_0x367a9a,seg:_0x454d98}of _0x2de35d){if(_0x454d98[_0x4364c7(0x284)]){const _0x31bd03=apiRuleToYaml(_0x454d98['rule']);_0x5266f8[_0x4364c7(0x1ea)](_0x367a9a,_0x31bd03);}}for(const {id:_0x3487c5,seg:_0x21a62a}of _0x2de35d){if(!_0x21a62a[_0x4364c7(0x284)])continue;const _0x300315=_0x5266f8[_0x4364c7(0x1d3)](_0x3487c5);if(!_0x300315)continue;const _0x328601=serializeExpandedRule(_0x300315,_0x5266f8),_0x500d60=_0x12f957[_0x4364c7(0x1d3)](_0x328601);if(_0x500d60){const _0x2e01ea=_0x500d60[_0x4364c7(0x1f8)](_0x17e9fd=>_0x452d41[_0x4364c7(0x249)](_0x17e9fd));_0x2e01ea&&(_0x5d3409[_0x4364c7(0x1ea)](_0x2e01ea,_0x3487c5),_0x452d41[_0x4364c7(0x275)](_0x2e01ea),logger[_0x4364c7(0x1eb)](_0x4364c7(0x1d9)+_0x21a62a[_0x4364c7(0x2a4)]+'\x27\x20to\x20local\x20\x27'+_0x2e01ea+_0x4364c7(0x287)));}}}}async function executeSingleJourneyPush(_0x3b481c,_0x354b51,_0x58674f,_0x3e2030,_0x5e3db5,_0xca719a){const _0x5dfb9a=a169_0x12f8f2,{journeyDefToRequest:_0x5093fa,activationDefToCreateRequest:_0x592e47,yamlRuleToApi:_0x41a634,validateSegmentRule:_0x4bea41}=_0xca719a,_0x8f0ba4=new Map(),_0xc348de=new Map();recoverSegmentIdsFromPushRecovery(_0x354b51,_0x8f0ba4,_0x58674f['segmentNameToId']);const _0x3bbdf7=new Map(),_0x35f53f=new Map(),_0x261d77=new Map();let _0x335523;const _0x1153a2=async()=>{const _0x79e86b=a169_0x880c;if(_0x335523)return;_0x335523=new Map();if(!_0x354b51[_0x79e86b(0x23b)])return;const _0x47bb18=await _0x3b481c['journey'][_0x79e86b(0x217)](_0x354b51[_0x79e86b(0x23b)]['id']);for(const _0xceac57 of _0x47bb18){const _0x11aad9=journeyActivationStepToYaml(_0xceac57,_0x58674f[_0x79e86b(0x1ef)],_0x58674f[_0x79e86b(0x212)]),_0x571652=activationSignature(_0x11aad9);!_0x335523[_0x79e86b(0x249)](_0x571652)&&_0x335523[_0x79e86b(0x1ea)](_0x571652,_0xceac57['id']),_0x11aad9['name']&&_0xc348de[_0x79e86b(0x1ea)](_0x11aad9[_0x79e86b(0x2a4)],_0xceac57['id']);}};await matchExistingJourneySegments(_0x3b481c,_0x354b51,_0x3e2030[_0x5dfb9a(0x1e4)],_0x58674f[_0x5dfb9a(0x21a)],_0x58674f[_0x5dfb9a(0x294)]);const _0x1f8486={'resolveSegmentId':async _0x2007cb=>{const _0x11661e=_0x5dfb9a,_0x5b602a=_0x58674f[_0x11661e(0x294)][_0x11661e(0x1d3)](_0x2007cb);if(!_0x5b602a)throw new SDKError(ErrorCode[_0x11661e(0x218)],_0x11661e(0x1d6)+_0x2007cb+_0x11661e(0x266)+_0x354b51[_0x11661e(0x256)][_0x11661e(0x2a4)]+')');return _0x5b602a;},'resolveEmbeddedSegmentId':async(_0x143fd5,_0x465ea2)=>{const _0x53324b=_0x5dfb9a,_0x4ace68=_0x58674f[_0x53324b(0x294)][_0x53324b(0x1d3)](_0x143fd5);if(_0x4ace68)return _0x4ace68;const _0x44a18f=_0x58674f[_0x53324b(0x21a)][_0x53324b(0x1f8)](_0x54df9b=>_0x54df9b[_0x53324b(0x2a4)]===_0x143fd5);if(_0x44a18f)return _0x58674f['segmentNameToId'][_0x53324b(0x1ea)](_0x143fd5,_0x44a18f['id']),_0x44a18f['id'];if(_0x354b51[_0x53324b(0x267)]){const {stageName:_0x5c7b78,criteriaName:_0x5513a4}=findSegmentCriteriaLocation(_0x354b51['yamlConfig'],_0x143fd5);return _0x4bea41(_0x143fd5,_0x465ea2[_0x53324b(0x284)]),_0x35f53f[_0x53324b(0x1ea)](_0x143fd5,{'definition':_0x465ea2,'stageName':_0x5c7b78,'criteriaName':_0x5513a4}),createPendingSegmentId(_0x143fd5);}const _0x4a4d6e=_0x354b51[_0x53324b(0x23b)]?.['id'];if(!_0x4a4d6e)throw new SDKError(ErrorCode[_0x53324b(0x24e)],_0x53324b(0x240));const _0x14c959=_0x3bbdf7[_0x53324b(0x1d3)](_0x143fd5);if(_0x14c959)return _0x14c959;const _0x4159cb=((async()=>{const _0x2d5e37=_0x53324b;_0x4bea41(_0x143fd5,_0x465ea2[_0x2d5e37(0x284)]);const _0x937a42=generateDeterministicJourneySegmentName(_0x354b51[_0x2d5e37(0x256)][_0x2d5e37(0x2a4)],_0x143fd5),_0x2833f8=_0x58674f[_0x2d5e37(0x21a)][_0x2d5e37(0x1f8)](_0x3377e4=>_0x3377e4[_0x2d5e37(0x2a4)]===_0x937a42),_0x42878f=createSegmentIdResolver(_0x58674f[_0x2d5e37(0x294)],_0x143fd5),_0x347ff8=await resolveRuleSegmentIds(_0x465ea2[_0x2d5e37(0x284)],_0x42878f);let _0x2be5b3;return _0x2833f8?(await _0x3b481c[_0x2d5e37(0x28e)][_0x2d5e37(0x22d)](_0x3e2030[_0x2d5e37(0x1e4)],_0x2833f8['id'],{'description':_0x465ea2[_0x2d5e37(0x261)]||_0x2d5e37(0x1dd)+_0x143fd5,'rule':_0x41a634(_0x347ff8),'countPopulation':!![]}),_0x2be5b3=_0x2833f8['id'],saveSegmentToPushRecovery(_0x354b51[_0x2d5e37(0x253)],_0x354b51[_0x2d5e37(0x256)][_0x2d5e37(0x2a4)],_0x143fd5,{'segmentId':_0x2be5b3,'uniqueServerName':_0x937a42,'createdAt':new Date()[_0x2d5e37(0x2ad)]()})):_0x2be5b3=await createOrRecoverEmbeddedSegment(_0x3b481c,_0x354b51,{'localName':_0x143fd5,'uniqueSegmentName':_0x937a42,'description':_0x465ea2[_0x2d5e37(0x261)]||_0x2d5e37(0x1dd)+_0x143fd5,'journeyId':_0x4a4d6e,'resolvedRule':_0x347ff8,'parentId':_0x3e2030[_0x2d5e37(0x1e4)],'folderId':_0x3e2030[_0x2d5e37(0x1d1)]||''},_0x41a634),_0x58674f[_0x2d5e37(0x294)][_0x2d5e37(0x1ea)](_0x143fd5,_0x2be5b3),_0x8f0ba4[_0x2d5e37(0x1ea)](_0x143fd5,_0x2be5b3),_0x2be5b3;})());_0x3bbdf7['set'](_0x143fd5,_0x4159cb);try{return await _0x4159cb;}finally{_0x3bbdf7[_0x53324b(0x275)](_0x143fd5);}},'resolveActivationId':async _0x1c10b7=>{const _0x349422=_0x5dfb9a,_0x1fc3d1=_0xc348de['get'](_0x1c10b7);if(_0x1fc3d1)return _0x1fc3d1;if(_0x354b51[_0x349422(0x23b)]){await _0x1153a2();const _0x5b1d02=_0xc348de[_0x349422(0x1d3)](_0x1c10b7);if(_0x5b1d02)return _0x5b1d02;}throw new SDKError(ErrorCode[_0x349422(0x278)],'Activation\x20not\x20found:\x20'+_0x1c10b7+_0x349422(0x266)+_0x354b51[_0x349422(0x256)][_0x349422(0x2a4)]+_0x349422(0x215)+_0x349422(0x2bf));},'resolveEmbeddedActivationId':async(_0x45832e,_0x2732e9)=>{const _0x4cee17=_0x5dfb9a,_0x47a9ba=_0xc348de[_0x4cee17(0x1d3)](_0x45832e);if(_0x47a9ba)return _0x47a9ba;if(_0x354b51['isNew'])return _0x261d77[_0x4cee17(0x1ea)](_0x45832e,_0x2732e9),createPendingActivationId(_0x45832e);if(_0x354b51[_0x4cee17(0x23b)]){await _0x1153a2();const _0xfbbbe2=_0xc348de[_0x4cee17(0x1d3)](_0x2732e9[_0x4cee17(0x2a4)]);if(_0xfbbbe2)return _0xc348de[_0x4cee17(0x1ea)](_0x45832e,_0xfbbbe2),_0xfbbbe2;const _0x3613d1=activationSignature(_0x2732e9),_0x4df490=_0x335523?.['get'](_0x3613d1);if(_0x4df490)return _0xc348de[_0x4cee17(0x1ea)](_0x45832e,_0x4df490),_0x4df490;const _0x22cbf6=await _0x592e47(_0x2732e9,_0x58674f[_0x4cee17(0x22b)]),_0x3f8715={..._0x22cbf6,..._0x2732e9[_0x4cee17(0x233)]!==undefined&&{'runAfterJourneyRefresh':_0x2732e9[_0x4cee17(0x233)]}},_0x394b80=await _0x3b481c[_0x4cee17(0x2bc)][_0x4cee17(0x242)](_0x354b51['existingJourney']['id'],_0x3f8715);return _0xc348de[_0x4cee17(0x1ea)](_0x45832e,_0x394b80['id']),_0x394b80['id'];}throw new SDKError(ErrorCode[_0x4cee17(0x24e)],_0x4cee17(0x262));},'resolveJourneyId':async _0x2e3b1f=>{const _0x5edef4=_0x5dfb9a;try{return await _0x3b481c['journey'][_0x5edef4(0x226)](_0x3e2030[_0x5edef4(0x1e4)],_0x2e3b1f);}catch(_0x27e6a7){throw new SDKError(ErrorCode[_0x5edef4(0x278)],_0x5edef4(0x24a)+_0x2e3b1f+_0x5edef4(0x25a)+_0x354b51[_0x5edef4(0x256)][_0x5edef4(0x2a4)]+'\x27)',_0x27e6a7);}},'resolveStageId':async(_0x2622f4,_0x3c5fdc)=>{const _0x41d7c8=_0x5dfb9a,_0x39e6b4=await _0x3b481c[_0x41d7c8(0x2bc)][_0x41d7c8(0x227)](_0x2622f4),_0x366869=_0x39e6b4[_0x41d7c8(0x2c5)][_0x41d7c8(0x238)][_0x41d7c8(0x1f8)](_0x5b4697=>_0x5b4697['name']['toLowerCase']()===_0x3c5fdc[_0x41d7c8(0x21d)]());if(!_0x366869?.['id'])throw new SDKError(ErrorCode[_0x41d7c8(0x278)],_0x41d7c8(0x1cf)+_0x3c5fdc+_0x41d7c8(0x219)+(_0x39e6b4[_0x41d7c8(0x2c5)][_0x41d7c8(0x203)]||_0x39e6b4[_0x41d7c8(0x2c5)]['name'])+'\x27');return _0x366869['id'];}},_0x3d4f4f=await _0x5093fa(_0x354b51[_0x5dfb9a(0x256)],_0x3e2030[_0x5dfb9a(0x1e4)],_0x1f8486),_0x269c8d=_0x3e2030[_0x5dfb9a(0x27d)]||_0x3e2030['rootFolderId'];_0x269c8d&&(_0x3d4f4f['relationships']={'parentFolder':{'data':{'id':_0x269c8d,'type':_0x5dfb9a(0x291)}}});if(_0x354b51[_0x5dfb9a(0x267)]){if(_0x35f53f['size']>0x0||_0x261d77['size']>0x0)return await executeThreeStepJourneyCreate(_0x3b481c,_0x354b51,_0x3d4f4f,{'pendingEmbeddedSegments':_0x35f53f,'pendingEmbeddedActivations':_0x261d77,'embeddedSegmentNameToId':_0x8f0ba4,'journeyActivationNameToId':_0xc348de},{..._0x3e2030,'effectiveFolderId':_0x269c8d},_0x58674f,_0x5e3db5,_0xca719a);else{ensureJourneyDefaults(_0x3d4f4f[_0x5dfb9a(0x2c5)]);const _0x1b72f6=await _0x3b481c[_0x5dfb9a(0x2bc)][_0x5dfb9a(0x29d)](_0x3d4f4f);return deletePushRecovery(_0x354b51[_0x5dfb9a(0x253)]),{'action':'created','journeyId':_0x1b72f6['id'],'embeddedSegmentNameToId':_0x8f0ba4};}}else{if(_0x354b51[_0x5dfb9a(0x247)]&&_0x354b51[_0x5dfb9a(0x23b)]){_0x3d4f4f['id']=_0x354b51[_0x5dfb9a(0x23b)]['id'];const _0x4f5717=_0x3d4f4f[_0x5dfb9a(0x2c5)];_0x354b51[_0x5dfb9a(0x23b)][_0x5dfb9a(0x2c5)]?.[_0x5dfb9a(0x203)]&&(_0x4f5717[_0x5dfb9a(0x203)]=_0x354b51[_0x5dfb9a(0x23b)]['attributes'][_0x5dfb9a(0x203)]);const _0x509ae8=_0x354b51[_0x5dfb9a(0x23b)][_0x5dfb9a(0x2c5)]?.[_0x5dfb9a(0x238)];return _0x509ae8&&_0x3d4f4f['attributes'][_0x5dfb9a(0x238)]&&injectExistingStageIds(_0x3d4f4f['attributes']['journeyStages'],_0x509ae8),ensureJourneyDefaults(_0x4f5717),await _0x3b481c[_0x5dfb9a(0x2bc)]['update'](_0x354b51[_0x5dfb9a(0x23b)]['id'],_0x3d4f4f),deletePushRecovery(_0x354b51[_0x5dfb9a(0x253)]),{'action':'updated','journeyId':_0x354b51[_0x5dfb9a(0x23b)]['id'],'embeddedSegmentNameToId':_0x8f0ba4};}}return deletePushRecovery(_0x354b51[_0x5dfb9a(0x253)]),{'action':_0x5dfb9a(0x25e),'journeyId':_0x354b51['existingJourney']?.['id'],'embeddedSegmentNameToId':_0x8f0ba4};}function findSegmentCriteriaLocation(_0x3b1e72,_0xe91eae){const _0x2afe5a=a169_0x12f8f2,_0x47ac27=_0x3b1e72[_0x2afe5a(0x2b5)]||_0x3b1e72[_0x2afe5a(0x21f)]?.[0x0]?.[_0x2afe5a(0x2b5)]||[];let _0x66529e='entry',_0x60e359=_0xe91eae;const _0x13987e=_0x3b1e72['goal']||_0x3b1e72[_0x2afe5a(0x21f)]?.[0x0]?.['goal'];if(_0x13987e?.['segment']===_0xe91eae)return{'stageName':_0x2afe5a(0x2c1),'criteriaName':_0x13987e['name']||_0xe91eae};_0x3a7ece:for(const _0x32eaf2 of _0x47ac27){if(_0x32eaf2[_0x2afe5a(0x22f)]?.['segment']===_0xe91eae){_0x66529e=_0x32eaf2[_0x2afe5a(0x2a4)],_0x60e359=_0x32eaf2[_0x2afe5a(0x22f)][_0x2afe5a(0x2a4)]||_0xe91eae;break;}if(_0x32eaf2[_0x2afe5a(0x2b0)])for(const _0x3bc5c5 of _0x32eaf2['steps']){if(_0x3bc5c5[_0x2afe5a(0x1d7)]==='decision_point'&&_0x3bc5c5[_0x2afe5a(0x2d0)]?.[_0x2afe5a(0x1ee)])for(const _0x2a6666 of _0x3bc5c5[_0x2afe5a(0x2d0)][_0x2afe5a(0x1ee)]){if(_0x2a6666['segment']===_0xe91eae){_0x66529e=_0x32eaf2[_0x2afe5a(0x2a4)],_0x60e359=_0x2a6666[_0x2afe5a(0x2a4)]||_0xe91eae;break _0x3a7ece;}}}}return{'stageName':_0x66529e,'criteriaName':_0x60e359};}async function executeThreeStepJourneyCreate(_0x81ef42,_0xb6bdbf,_0x388cb1,_0x332740,_0x4e9402,_0x336fb3,_0x4d85da,_0x53b2c9){const _0x6847e7=a169_0x12f8f2,{activationDefToCreateRequest:_0x37ff0f,yamlRuleToApi:_0x1209fa}=_0x53b2c9,{pendingEmbeddedSegments:_0x25879f,pendingEmbeddedActivations:_0x266e46,embeddedSegmentNameToId:_0x60306d}=_0x332740,_0x23230c=JSON[_0x6847e7(0x2a2)](JSON[_0x6847e7(0x298)](_0x388cb1));ensureJourneyDefaults(_0x23230c[_0x6847e7(0x2c5)]),stripPendingIds(_0x23230c);const _0x5b6d68=await _0x81ef42['journey'][_0x6847e7(0x29d)](_0x23230c),_0x1dedfa=_0x5b6d68['id'],_0x4c725e=new Map();for(const _0xfd0f21 of _0x5b6d68['attributes']['journeyStages']){_0x4c725e['set'](_0xfd0f21[_0x6847e7(0x2a4)][_0x6847e7(0x21d)](),_0xfd0f21['id']);}recoverSegmentIdsFromPushRecovery(_0xb6bdbf,_0x60306d,_0x336fb3['segmentNameToId']);for(const [_0x416111,{definition:_0x2f4511}]of _0x25879f){if(_0x60306d[_0x6847e7(0x249)](_0x416111)){_0x4d85da[_0x6847e7(0x216)]?.({'type':_0x6847e7(0x1da),'journeyName':_0xb6bdbf[_0x6847e7(0x256)][_0x6847e7(0x2a4)],'segmentName':_0x416111});continue;}const _0x481ed2=generateDeterministicJourneySegmentName(_0xb6bdbf[_0x6847e7(0x256)]['name'],_0x416111);_0x4d85da[_0x6847e7(0x216)]?.({'type':'embedded_segment_creating','journeyName':_0xb6bdbf['yamlConfig'][_0x6847e7(0x2a4)],'segmentName':_0x416111});const _0x4e760b=createSegmentIdResolver(_0x336fb3[_0x6847e7(0x294)],_0x416111),_0x5a75d4=await resolveRuleSegmentIds(_0x2f4511[_0x6847e7(0x284)],_0x4e760b),_0x3df1dc=await createOrRecoverEmbeddedSegment(_0x81ef42,_0xb6bdbf,{'localName':_0x416111,'uniqueSegmentName':_0x481ed2,'description':_0x2f4511[_0x6847e7(0x261)]||_0x6847e7(0x1dd)+_0x416111,'journeyId':_0x1dedfa,'resolvedRule':_0x5a75d4,'parentId':_0x4e9402[_0x6847e7(0x1e4)],'folderId':_0x4e9402[_0x6847e7(0x257)]||''},_0x1209fa);_0x60306d[_0x6847e7(0x1ea)](_0x416111,_0x3df1dc),_0x336fb3[_0x6847e7(0x294)][_0x6847e7(0x1ea)](_0x416111,_0x3df1dc),_0x4d85da[_0x6847e7(0x216)]?.({'type':'embedded_segment_created','journeyName':_0xb6bdbf[_0x6847e7(0x256)]['name'],'segmentName':_0x416111});}const _0x12b815=new Map();for(const [_0x5ab345,_0x34b5d9]of _0x266e46){_0x4d85da[_0x6847e7(0x216)]?.({'type':_0x6847e7(0x222),'journeyName':_0xb6bdbf['yamlConfig'][_0x6847e7(0x2a4)],'activationName':_0x5ab345});const _0x5b2538=await _0x37ff0f(_0x34b5d9,_0x336fb3[_0x6847e7(0x22b)]),_0x13e705={..._0x5b2538,..._0x34b5d9[_0x6847e7(0x233)]!==undefined&&{'runAfterJourneyRefresh':_0x34b5d9[_0x6847e7(0x233)]}},_0x16712b=await _0x81ef42[_0x6847e7(0x2bc)][_0x6847e7(0x242)](_0x1dedfa,_0x13e705);_0x12b815[_0x6847e7(0x1ea)](_0x5ab345,_0x16712b['id']),_0x332740[_0x6847e7(0x250)][_0x6847e7(0x1ea)](_0x5ab345,_0x16712b['id']),_0x4d85da[_0x6847e7(0x216)]?.({'type':_0x6847e7(0x1f9),'journeyName':_0xb6bdbf['yamlConfig'][_0x6847e7(0x2a4)],'activationName':_0x5ab345});}const _0x19e3c4=JSON[_0x6847e7(0x2a2)](JSON[_0x6847e7(0x298)](_0x388cb1));return _0x19e3c4['id']=_0x1dedfa,ensureJourneyDefaults(_0x19e3c4[_0x6847e7(0x2c5)]),resolvePendingIdsInRequest(_0x19e3c4,_0x388cb1,_0x4c725e,_0x60306d,_0x12b815,_0x4d85da),await _0x81ef42[_0x6847e7(0x2bc)][_0x6847e7(0x23f)](_0x1dedfa,_0x19e3c4),deletePushRecovery(_0xb6bdbf[_0x6847e7(0x253)]),{'action':_0x6847e7(0x29e),'journeyId':_0x1dedfa,'embeddedSegmentNameToId':_0x60306d};}export function stripWaitStepPendingIds(_0x1a9de8){const _0x58b866=a169_0x12f8f2,_0x22a2d7=_0x1a9de8[_0x58b866(0x292)]&&isPendingSegmentId(_0x1a9de8['conditionSegmentId']),_0x1a35c4=_0x1a9de8[_0x58b866(0x2c9)]?.[_0x58b866(0x237)](_0x59e6a8=>_0x59e6a8[_0x58b866(0x26d)]&&isPendingSegmentId(_0x59e6a8[_0x58b866(0x26d)]));(_0x22a2d7||_0x1a35c4)&&(_0x1a9de8[_0x58b866(0x1e1)]='Duration',_0x1a9de8[_0x58b866(0x289)]=0x1,_0x1a9de8[_0x58b866(0x236)]=_0x58b866(0x25f),delete _0x1a9de8[_0x58b866(0x292)],delete _0x1a9de8['conditionTimeoutDuration'],delete _0x1a9de8['conditionTimeoutUnit'],delete _0x1a9de8[_0x58b866(0x2c9)]);}export function resolveWaitStepPendingIds(_0x37853c,_0x231f24,_0x5192dd,_0x3dcd01){const _0x3629e1=a169_0x12f8f2;if(_0x231f24[_0x3629e1(0x292)]&&isPendingSegmentId(_0x231f24[_0x3629e1(0x292)])){const _0x28987d=_0x5192dd(_0x231f24[_0x3629e1(0x292)],_0x3629e1(0x1f3)+_0x3dcd01+_0x3629e1(0x2ce));_0x28987d&&(_0x37853c[_0x3629e1(0x1e1)]=_0x3629e1(0x2ac),_0x37853c[_0x3629e1(0x292)]=_0x28987d,delete _0x37853c[_0x3629e1(0x289)],delete _0x37853c[_0x3629e1(0x236)],_0x231f24[_0x3629e1(0x1ff)]!==undefined&&(_0x37853c['conditionTimeoutDuration']=_0x231f24['conditionTimeoutDuration']),_0x231f24['conditionTimeoutUnit']&&(_0x37853c[_0x3629e1(0x21e)]=_0x231f24[_0x3629e1(0x21e)]));}if(_0x231f24[_0x3629e1(0x2c9)]){const _0x3fac33=_0x231f24[_0x3629e1(0x2c9)]['some'](_0x2818cc=>_0x2818cc['segmentId']&&isPendingSegmentId(_0x2818cc['segmentId']));if(_0x3fac33){const _0xd1b3f=_0x231f24[_0x3629e1(0x2c9)][_0x3629e1(0x201)](_0x1a23b2=>{const _0x5631b1=_0x3629e1;if(_0x1a23b2[_0x5631b1(0x26d)]&&isPendingSegmentId(_0x1a23b2[_0x5631b1(0x26d)])){const _0x845f72=_0x5192dd(_0x1a23b2[_0x5631b1(0x26d)],_0x5631b1(0x1f3)+_0x3dcd01+_0x5631b1(0x2ce));return{..._0x1a23b2,'segmentId':_0x845f72||_0x1a23b2[_0x5631b1(0x26d)]};}return{..._0x1a23b2};});_0x37853c[_0x3629e1(0x1e1)]=_0x3629e1(0x2ac),_0x37853c[_0x3629e1(0x2c9)]=_0xd1b3f,delete _0x37853c[_0x3629e1(0x289)],delete _0x37853c[_0x3629e1(0x236)],delete _0x37853c[_0x3629e1(0x292)],delete _0x37853c[_0x3629e1(0x1ff)],delete _0x37853c[_0x3629e1(0x21e)];}}}function stripPendingIds(_0x17d507){const _0x4242d8=a169_0x12f8f2;_0x17d507[_0x4242d8(0x2c5)][_0x4242d8(0x2c1)]?.[_0x4242d8(0x26d)]&&isPendingSegmentId(_0x17d507[_0x4242d8(0x2c5)][_0x4242d8(0x2c1)]['segmentId'])&&delete _0x17d507[_0x4242d8(0x2c5)]['goal'];for(const _0x52c4b4 of _0x17d507[_0x4242d8(0x2c5)][_0x4242d8(0x238)]||[]){_0x52c4b4['entryCriteria']?.[_0x4242d8(0x26d)]&&isPendingSegmentId(_0x52c4b4[_0x4242d8(0x29c)]['segmentId'])&&delete _0x52c4b4[_0x4242d8(0x29c)];_0x52c4b4['milestone']?.['segmentId']&&isPendingSegmentId(_0x52c4b4[_0x4242d8(0x1e2)]['segmentId'])&&delete _0x52c4b4['milestone'];_0x52c4b4[_0x4242d8(0x277)]&&(_0x52c4b4[_0x4242d8(0x277)]=_0x52c4b4['exitCriterias'][_0x4242d8(0x2af)](_0x1b85a3=>!_0x1b85a3[_0x4242d8(0x26d)]||!isPendingSegmentId(_0x1b85a3['segmentId'])));if(_0x52c4b4[_0x4242d8(0x2b0)])for(const _0x13efaa of Object[_0x4242d8(0x1d2)](_0x52c4b4[_0x4242d8(0x2b0)])){const _0x43f8dd=_0x52c4b4[_0x4242d8(0x2b0)][_0x13efaa];_0x43f8dd[_0x4242d8(0x1d7)]===_0x4242d8(0x20b)&&_0x43f8dd['journeyActivationStepId']&&isPendingActivationId(_0x43f8dd[_0x4242d8(0x290)])&&(_0x43f8dd[_0x4242d8(0x290)]='');if(_0x43f8dd['type']===_0x4242d8(0x25b)&&_0x43f8dd[_0x4242d8(0x1ee)])for(const _0x18a271 of _0x43f8dd['branches']){_0x18a271[_0x4242d8(0x26d)]&&isPendingSegmentId(_0x18a271[_0x4242d8(0x26d)])&&(_0x18a271[_0x4242d8(0x26d)]='');}_0x43f8dd['type']===_0x4242d8(0x1d0)&&stripWaitStepPendingIds(_0x43f8dd);}}}function resolvePendingIdsInRequest(_0x37f5cb,_0x47302a,_0xc618da,_0x4951c4,_0x2e6ccd,_0x1b2672){const _0x48e770=a169_0x12f8f2,_0x4c9611=(_0x4124b0,_0x3831ef)=>{if(!isPendingSegmentId(_0x4124b0))return _0x4124b0;const _0x52939f=extractPendingSegmentName(_0x4124b0),_0x4d66fb=_0x4951c4['get'](_0x52939f);return!_0x4d66fb&&_0x1b2672['logWarning']?.('Warning:\x20Could\x20not\x20resolve\x20embedded\x20segment\x20\x27'+_0x52939f+'\x27\x20for\x20'+_0x3831ef),_0x4d66fb;};if(_0x37f5cb[_0x48e770(0x2c5)][_0x48e770(0x2c1)]?.[_0x48e770(0x26d)]&&isPendingSegmentId(_0x37f5cb['attributes']['goal'][_0x48e770(0x26d)])){const _0xfa468d=_0x4c9611(_0x37f5cb[_0x48e770(0x2c5)][_0x48e770(0x2c1)][_0x48e770(0x26d)],_0x48e770(0x2ca));_0xfa468d&&(_0x37f5cb[_0x48e770(0x2c5)][_0x48e770(0x2c1)]['segmentId']=_0xfa468d);}for(const _0x397199 of _0x37f5cb['attributes'][_0x48e770(0x238)]||[]){const _0x22c2b0=_0xc618da[_0x48e770(0x1d3)](_0x397199['name'][_0x48e770(0x21d)]());_0x22c2b0&&(_0x397199['id']=_0x22c2b0);if(_0x397199[_0x48e770(0x29c)]?.['segmentId']&&isPendingSegmentId(_0x397199[_0x48e770(0x29c)][_0x48e770(0x26d)])){const _0x45787b=_0x4c9611(_0x397199[_0x48e770(0x29c)][_0x48e770(0x26d)],_0x48e770(0x1f3)+_0x397199[_0x48e770(0x2a4)]+_0x48e770(0x1fe));_0x45787b&&(_0x397199['entryCriteria']['segmentId']=_0x45787b);}if(_0x397199[_0x48e770(0x277)])for(const _0x2fd0f0 of _0x397199['exitCriterias']){if(_0x2fd0f0[_0x48e770(0x26d)]&&isPendingSegmentId(_0x2fd0f0[_0x48e770(0x26d)])){const _0x135320=_0x4c9611(_0x2fd0f0['segmentId'],'stage\x20\x27'+_0x397199[_0x48e770(0x2a4)]+'\x27\x20exit\x20criteria');_0x135320&&(_0x2fd0f0[_0x48e770(0x26d)]=_0x135320);}}if(_0x397199[_0x48e770(0x1e2)]?.['segmentId']&&isPendingSegmentId(_0x397199[_0x48e770(0x1e2)]['segmentId'])){const _0x827564=_0x4c9611(_0x397199['milestone'][_0x48e770(0x26d)],_0x48e770(0x1f3)+_0x397199[_0x48e770(0x2a4)]+'\x27\x20milestone');_0x827564&&(_0x397199[_0x48e770(0x1e2)][_0x48e770(0x26d)]=_0x827564);}if(_0x397199[_0x48e770(0x2b0)]){const _0x66765b=_0x4f6175=>_0x47302a[_0x48e770(0x2c5)][_0x48e770(0x238)]?.[_0x48e770(0x1f8)](_0x1b5811=>_0x1b5811['name'][_0x48e770(0x21d)]()===_0x397199[_0x48e770(0x2a4)][_0x48e770(0x21d)]())?.[_0x48e770(0x2b0)]?.[_0x4f6175];for(const _0x5d9109 of Object[_0x48e770(0x1d2)](_0x397199[_0x48e770(0x2b0)])){const _0x19decf=_0x397199[_0x48e770(0x2b0)][_0x5d9109],_0x13176b=_0x66765b(_0x5d9109);if(_0x19decf[_0x48e770(0x1d7)]===_0x48e770(0x20b)&&_0x19decf[_0x48e770(0x290)]&&(isPendingActivationId(_0x19decf['journeyActivationStepId'])||_0x19decf[_0x48e770(0x290)]==='')){if(_0x13176b?.['journeyActivationStepId']&&isPendingActivationId(_0x13176b[_0x48e770(0x290)])){const _0x229c72=extractPendingActivationName(_0x13176b[_0x48e770(0x290)]),_0x46f786=_0x2e6ccd[_0x48e770(0x1d3)](_0x229c72);_0x46f786&&(_0x19decf[_0x48e770(0x290)]=_0x46f786);}}if(_0x19decf[_0x48e770(0x1d7)]===_0x48e770(0x25b)&&_0x19decf[_0x48e770(0x1ee)]&&_0x13176b?.[_0x48e770(0x1ee)])for(let _0x174822=0x0;_0x174822<_0x19decf[_0x48e770(0x1ee)][_0x48e770(0x295)];_0x174822++){const _0x5cee04=_0x19decf[_0x48e770(0x1ee)][_0x174822],_0x4d8671=_0x13176b[_0x48e770(0x1ee)][_0x174822];if(_0x4d8671?.[_0x48e770(0x26d)]&&isPendingSegmentId(_0x4d8671['segmentId'])){const _0x4d4d10=_0x4c9611(_0x4d8671[_0x48e770(0x26d)],'stage\x20\x27'+_0x397199[_0x48e770(0x2a4)]+_0x48e770(0x2b8)+(_0x5cee04['name']||_0x174822)+'\x27');_0x4d4d10&&(_0x5cee04[_0x48e770(0x26d)]=_0x4d4d10);}}_0x19decf[_0x48e770(0x1d7)]===_0x48e770(0x1d0)&&_0x13176b?.['type']===_0x48e770(0x1d0)&&resolveWaitStepPendingIds(_0x19decf,_0x13176b,_0x4c9611,_0x397199['name']);}}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a170_0x5db3(){const _0x27e618=['2362086vBnpno','name','4876Qarbkv','554596lQtaFZ','get','set','624DYPlcU','128733opreiI','573XbfSrU','has','6RsnIEM','15252TahKxn','88590mlkFkV','70620LiMFks','4xoWTjI','24GhhHrV','150SoySkJ','add','parentFolderId'];a170_0x5db3=function(){return _0x27e618;};return a170_0x5db3();}(function(_0x43129d,_0x1914e6){const _0x28fdc6=a170_0x1a3a,_0x341e56=_0x43129d();while(!![]){try{const _0x425c00=-parseInt(_0x28fdc6(0x1a3))/0x1*(parseInt(_0x28fdc6(0x1a1))/0x2)+-parseInt(_0x28fdc6(0x19d))/0x3*(-parseInt(_0x28fdc6(0x1aa))/0x4)+parseInt(_0x28fdc6(0x1a2))/0x5*(parseInt(_0x28fdc6(0x19f))/0x6)+parseInt(_0x28fdc6(0x1ab))/0x7*(parseInt(_0x28fdc6(0x1a4))/0x8)+-parseInt(_0x28fdc6(0x1a8))/0x9+parseInt(_0x28fdc6(0x1a5))/0xa*(parseInt(_0x28fdc6(0x19c))/0xb)+-parseInt(_0x28fdc6(0x1a0))/0xc*(parseInt(_0x28fdc6(0x1ae))/0xd);if(_0x425c00===_0x1914e6)break;else _0x341e56['push'](_0x341e56['shift']());}catch(_0x45bc9c){_0x341e56['push'](_0x341e56['shift']());}}}(a170_0x5db3,0x26f34));export function buildFolderIdToPathMap(_0x26a7a2){const _0x387eab=a170_0x1a3a,_0x436f99=new Map(),_0x5dd81e=new Map();for(const _0x16f8a6 of _0x26a7a2){_0x5dd81e[_0x387eab(0x1ad)](_0x16f8a6['id'],_0x16f8a6);}const _0x36c588=new Set();for(const _0x17fbb4 of _0x26a7a2){!_0x17fbb4[_0x387eab(0x1a7)]&&_0x36c588['add'](_0x17fbb4['id']);}function _0xe1c30a(_0x47c05f){const _0x45df67=_0x387eab;if(_0x436f99[_0x45df67(0x19e)](_0x47c05f['id']))return _0x436f99[_0x45df67(0x1ac)](_0x47c05f['id']);if(_0x36c588['has'](_0x47c05f['id']))return _0x436f99[_0x45df67(0x1ad)](_0x47c05f['id'],''),'';if(_0x47c05f['parentFolderId']){const _0x3e4d06=_0x5dd81e[_0x45df67(0x1ac)](_0x47c05f[_0x45df67(0x1a7)]);if(_0x3e4d06){const _0xd8e5cf=_0xe1c30a(_0x3e4d06),_0x14f83c=_0xd8e5cf?_0xd8e5cf+'/'+_0x47c05f[_0x45df67(0x1a9)]:_0x47c05f[_0x45df67(0x1a9)];return _0x436f99['set'](_0x47c05f['id'],_0x14f83c),_0x14f83c;}}const _0x1879d0=_0x47c05f[_0x45df67(0x1a9)];return _0x436f99['set'](_0x47c05f['id'],_0x1879d0),_0x1879d0;}for(const _0x11fdfd of _0x26a7a2){_0xe1c30a(_0x11fdfd);}return _0x436f99;}export function buildFolderPathToIdMap(_0x57dece){const _0x576ba7=a170_0x1a3a,_0x41a6a9=new Map(),_0x44a425=new Map();for(const _0x5d3208 of _0x57dece){_0x44a425[_0x576ba7(0x1ad)](_0x5d3208['id'],_0x5d3208);}const _0x325f69=new Set();for(const _0x2d2b9c of _0x57dece){!_0x2d2b9c[_0x576ba7(0x1a7)]&&_0x325f69[_0x576ba7(0x1a6)](_0x2d2b9c['id']);}function _0x5c271a(_0x3a2dc3){const _0x18c8eb=_0x576ba7;if(_0x325f69[_0x18c8eb(0x19e)](_0x3a2dc3['id']))return'';if(_0x3a2dc3[_0x18c8eb(0x1a7)]){const _0x9d83ae=_0x44a425[_0x18c8eb(0x1ac)](_0x3a2dc3['parentFolderId']);if(_0x9d83ae){const _0x4a7c80=_0x5c271a(_0x9d83ae);return _0x4a7c80?_0x4a7c80+'/'+_0x3a2dc3[_0x18c8eb(0x1a9)]:_0x3a2dc3[_0x18c8eb(0x1a9)];}}return _0x3a2dc3[_0x18c8eb(0x1a9)];}for(const _0x2384d8 of _0x57dece){const _0x3bc68b=_0x5c271a(_0x2384d8);_0x41a6a9[_0x576ba7(0x1ad)](_0x3bc68b,_0x2384d8['id']);}return _0x41a6a9;}function a170_0x1a3a(_0x115536,_0x5161dd){_0x115536=_0x115536-0x19c;const _0x5db382=a170_0x5db3();let _0x1a3a30=_0x5db382[_0x115536];return _0x1a3a30;}export function buildFolderMaps(_0x1df256){const _0x35e803=a170_0x1a3a,_0x823460=buildFolderIdToPathMap(_0x1df256),_0x497cc=new Map();for(const [_0x162d8e,_0x32de30]of _0x823460){_0x497cc[_0x35e803(0x1ad)](_0x32de30,_0x162d8e);}return{'idToPath':_0x823460,'pathToId':_0x497cc};}export function getFolderPath(_0x4c6eb5,_0x3535cb){const _0x2dc14a=a170_0x1a3a;if(!_0x4c6eb5)return'';return _0x3535cb[_0x2dc14a(0x1ac)](_0x4c6eb5)??'';}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x573b51,_0x1880f5){const _0x239748=a171_0x2be2,_0x56fb56=_0x573b51();while(!![]){try{const _0x4c535e=parseInt(_0x239748(0x1db))/0x1*(parseInt(_0x239748(0x1f4))/0x2)+-parseInt(_0x239748(0x1e5))/0x3+-parseInt(_0x239748(0x1ea))/0x4+-parseInt(_0x239748(0x1d3))/0x5+parseInt(_0x239748(0x1dc))/0x6+-parseInt(_0x239748(0x1e1))/0x7+parseInt(_0x239748(0x1f7))/0x8*(parseInt(_0x239748(0x1fb))/0x9);if(_0x4c535e===_0x1880f5)break;else _0x56fb56['push'](_0x56fb56['shift']());}catch(_0x265039){_0x56fb56['push'](_0x56fb56['shift']());}}}(a171_0x30ab,0x7a48e));import a171_0x2ec83f from'path';import{parse as a171_0x3663e5}from'yaml';function a171_0x2be2(_0x1c66c9,_0x2b8f54){_0x1c66c9=_0x1c66c9-0x1cd;const _0x30ab01=a171_0x30ab();let _0x2be2ac=_0x30ab01[_0x1c66c9];return _0x2be2ac;}import{nodeFileSystem}from'../io/node-filesystem.js';import{isJourneyDef}from'./journey-yaml.js';export function parsePath(_0x103a12){const _0x332b2a=a171_0x2be2;if(!_0x103a12||_0x103a12[_0x332b2a(0x1f8)]()==='')throw new Error(_0x332b2a(0x1fa));const _0xfab9a1=_0x103a12[_0x332b2a(0x1f8)]();if(_0xfab9a1==='/')return{'segments':[],'isAbsolute':!![],'raw':_0x103a12};const _0x3cc320=_0xfab9a1['startsWith']('/')?_0xfab9a1[_0x332b2a(0x1e2)](0x1):_0xfab9a1,_0x278c49=_0x3cc320[_0x332b2a(0x1e9)]('/')[_0x332b2a(0x1da)](_0x3c9dee=>_0x3c9dee!=='');if(_0x278c49['length']===0x0)throw new Error(_0x332b2a(0x1ee));const _0x154e56=_0xfab9a1['startsWith']('/')||!isRelativePathSegment(_0x278c49[0x0]);for(const _0x5cc95a of _0x278c49){validatePathSegment(_0x5cc95a);}return{'segments':_0x278c49,'isAbsolute':_0x154e56,'raw':_0x103a12};}function isRelativePathSegment(_0x58dcaa){return _0x58dcaa==='.'||_0x58dcaa==='..';}function a171_0x30ab(){const _0x4f1a2c=['length','segments','relative','readFile','2614975lUBcqX','test','parse','parent_segment','Relative\x20path\x20cannot\x20be\x20empty','slice','Path\x20attempts\x20to\x20navigate\x20above\x20root','filter','436969QAlCnb','3522972lgYDUI','dirname','replace','Path\x20segment\x20contains\x20invalid\x20control\x20characters:\x20','startsWith','4607197FNYUrN','substring','Absolute\x20path\x20cannot\x20start\x20with\x20\x22..\x22','segment','1630023DWzQwj','Cannot\x20navigate\x20above\x20root','File\x20not\x20found:\x20','Hint:\x20Run\x20`tdx\x20sg\x20pull\x20\x22Parent\x20Segment\x20Name\x22`\x20first\x20to\x20create\x20a\x20project\x20directory,\x20then\x20work\x20within\x20that\x20directory.','split','2476704ejajMp','Invalid\x20YAML:\x20missing\x20name\x20field\x20in\x20','Cannot\x20split\x20empty\x20path','exists','Path\x20must\x20contain\x20at\x20least\x20one\x20segment','Path\x20segment\x20cannot\x20be\x20empty','isAbsolute','push','No\x20tdx.json\x20found\x20for\x20file:\x20','raw','2FYJewB','join','resolve','40680UhhjWu','trim','pop','Path\x20cannot\x20be\x20empty','3222jiwUnX','Invalid\x20tdx.json:\x20missing\x20parent_segment\x20field','name'];a171_0x30ab=function(){return _0x4f1a2c;};return a171_0x30ab();}function validatePathSegment(_0x58f417){const _0x5acb80=a171_0x2be2;if(_0x58f417==='')throw new Error(_0x5acb80(0x1ef));if(_0x58f417==='.'||_0x58f417==='..')return;if(/[\x00-\x1F\x7F]/[_0x5acb80(0x1d4)](_0x58f417))throw new Error(_0x5acb80(0x1df)+_0x58f417);if(_0x58f417!==_0x58f417['trim']()){}}export function validatePath(_0x31f468){const _0x26ce69=a171_0x2be2;if(_0x31f468[_0x26ce69(0x1d0)][_0x26ce69(0x1cf)]===0x0&&!_0x31f468[_0x26ce69(0x1f0)])throw new Error(_0x26ce69(0x1d7));if(_0x31f468[_0x26ce69(0x1f0)]){if(_0x31f468[_0x26ce69(0x1d0)][0x0]==='..')throw new Error(_0x26ce69(0x1e3));let _0x515ca4=0x0;for(const _0x409db4 of _0x31f468['segments']){if(_0x409db4==='..'){if(_0x515ca4===0x0)throw new Error(_0x26ce69(0x1d9));_0x515ca4--;}else _0x409db4!=='.'&&_0x515ca4++;}}}export function joinPaths(_0x4706a2,_0x57d891){const _0x52987a=a171_0x2be2;if(!_0x4706a2||_0x4706a2==='/')return _0x57d891;if(!_0x57d891||_0x57d891==='.')return _0x4706a2;if(_0x57d891[_0x52987a(0x1e0)]('/'))return _0x57d891;const _0x3ca2ce=parsePath(_0x4706a2),_0x11641b=parsePath(_0x57d891),_0x3e79af=[..._0x3ca2ce[_0x52987a(0x1d0)]];for(const _0x401420 of _0x11641b[_0x52987a(0x1d0)]){if(_0x401420==='.')continue;else{if(_0x401420==='..'){if(_0x3e79af['length']===0x0)throw new Error(_0x52987a(0x1e6));_0x3e79af[_0x52987a(0x1f9)]();}else _0x3e79af[_0x52987a(0x1f1)](_0x401420);}}const _0x36e554=_0x3e79af['join']('/');return _0x3ca2ce[_0x52987a(0x1f3)][_0x52987a(0x1e0)]('/')?'/'+_0x36e554:_0x36e554;}export function normalizePath(_0xe05ffa){const _0x28e0b8=a171_0x2be2,_0x3e69ba=parsePath(_0xe05ffa),_0x5c2bfb=[];for(const _0x5c6cc9 of _0x3e69ba[_0x28e0b8(0x1d0)]){if(_0x5c6cc9==='.')continue;else{if(_0x5c6cc9==='..'){if(_0x5c2bfb[_0x28e0b8(0x1cf)]===0x0){if(_0x3e69ba[_0x28e0b8(0x1f0)])throw new Error(_0x28e0b8(0x1e6));_0x5c2bfb[_0x28e0b8(0x1f1)]('..');}else _0x5c2bfb[_0x5c2bfb[_0x28e0b8(0x1cf)]-0x1]==='..'?_0x5c2bfb['push']('..'):_0x5c2bfb[_0x28e0b8(0x1f9)]();}else _0x5c2bfb[_0x28e0b8(0x1f1)](_0x5c6cc9);}}if(_0x5c2bfb['length']===0x0)return _0x3e69ba[_0x28e0b8(0x1f0)]?'/':'.';const _0x29dd0d=_0x5c2bfb['join']('/');return _0x3e69ba[_0x28e0b8(0x1f3)][_0x28e0b8(0x1e0)]('/')?'/'+_0x29dd0d:_0x29dd0d;}export function getParentPath(_0x249f7d){const _0x7925f2=a171_0x2be2,_0x1493dc=parsePath(_0x249f7d);if(_0x1493dc[_0x7925f2(0x1d0)][_0x7925f2(0x1cf)]<=0x1)return'/';const _0x5e7f12=_0x1493dc[_0x7925f2(0x1d0)]['slice'](0x0,-0x1)[_0x7925f2(0x1f5)]('/');return _0x1493dc[_0x7925f2(0x1f3)][_0x7925f2(0x1e0)]('/')?'/'+_0x5e7f12:_0x5e7f12;}export function getBaseName(_0x238f58){const _0x2f7f1e=a171_0x2be2,_0x1d4e59=parsePath(_0x238f58);return _0x1d4e59[_0x2f7f1e(0x1d0)][_0x1d4e59[_0x2f7f1e(0x1d0)]['length']-0x1]||'';}export function isChildPath(_0x8e6ef4,_0x1dd0d6){const _0x4d9956=a171_0x2be2,_0x4e8e8b=parsePath(_0x8e6ef4),_0x2aa69e=parsePath(_0x1dd0d6);if(_0x4e8e8b[_0x4d9956(0x1d0)]['length']<=_0x2aa69e[_0x4d9956(0x1d0)][_0x4d9956(0x1cf)])return![];for(let _0x4ace51=0x0;_0x4ace51<_0x2aa69e[_0x4d9956(0x1d0)]['length'];_0x4ace51++){if(_0x4e8e8b[_0x4d9956(0x1d0)][_0x4ace51]!==_0x2aa69e[_0x4d9956(0x1d0)][_0x4ace51])return![];}return!![];}export function splitPath(_0x5548c0){const _0x3899aa=a171_0x2be2,_0x237852=parsePath(_0x5548c0);if(_0x237852[_0x3899aa(0x1d0)][_0x3899aa(0x1cf)]===0x0)throw new Error(_0x3899aa(0x1ec));if(_0x237852[_0x3899aa(0x1d0)]['length']===0x1)return{'parent':_0x237852['segments'][0x0]};return{'parent':_0x237852['segments'][0x0],'child':_0x237852['segments'][_0x3899aa(0x1d8)](0x1)[_0x3899aa(0x1f5)]('/')};}export function isYamlFilePath(_0x1e7585){return _0x1e7585['endsWith']('.yml')||_0x1e7585['endsWith']('.yaml');}export async function resolveYamlFilePath(_0x473979,_0x53fef1=nodeFileSystem){const _0x33b4b3=a171_0x2be2,_0x29c04f=a171_0x2ec83f[_0x33b4b3(0x1f6)](_0x473979);if(!await _0x53fef1['exists'](_0x29c04f))throw new Error(_0x33b4b3(0x1e7)+_0x473979);let _0x199637=a171_0x2ec83f['dirname'](_0x29c04f),_0x31f65d=null,_0xedcf66=null;const _0x29dd4e=a171_0x2ec83f[_0x33b4b3(0x1d5)](_0x199637)['root'];while(_0x199637!==_0x29dd4e){const _0x2f0f0d=a171_0x2ec83f[_0x33b4b3(0x1f5)](_0x199637,'tdx.json');if(await _0x53fef1[_0x33b4b3(0x1ed)](_0x2f0f0d)){_0x31f65d=_0x2f0f0d,_0xedcf66=_0x199637;break;}_0x199637=a171_0x2ec83f[_0x33b4b3(0x1dd)](_0x199637);}if(!_0x31f65d||!_0xedcf66)throw new Error(_0x33b4b3(0x1f2)+_0x473979+'\x0a'+_0x33b4b3(0x1e8));const _0x36a7ac=await _0x53fef1['readFile'](_0x31f65d),_0x6d0572=JSON[_0x33b4b3(0x1d5)](_0x36a7ac),_0x308ed3=_0x6d0572[_0x33b4b3(0x1d6)];if(!_0x308ed3)throw new Error(_0x33b4b3(0x1cd));const _0x2dec8=await _0x53fef1[_0x33b4b3(0x1d2)](_0x29c04f),_0x143f05=a171_0x3663e5(_0x2dec8),_0x5f0e91=_0x143f05[_0x33b4b3(0x1ce)];if(!_0x5f0e91)throw new Error(_0x33b4b3(0x1eb)+_0x473979);const _0x543ce8=isJourneyDef(_0x143f05,_0x29c04f)?'journey':_0x33b4b3(0x1e4),_0x4c2253=a171_0x2ec83f[_0x33b4b3(0x1d1)](_0xedcf66,_0x29c04f),_0x516138=a171_0x2ec83f[_0x33b4b3(0x1dd)](_0x4c2253),_0x430789=_0x516138==='.'?'':_0x516138[_0x33b4b3(0x1de)](/\\/g,'/'),_0x1e8cb3=_0x430789?_0x308ed3+'/'+_0x430789+'/'+_0x5f0e91:_0x308ed3+'/'+_0x5f0e91;return{'parentSegment':_0x308ed3,'segmentName':_0x5f0e91,'folderPath':_0x430789,'fullPath':_0x1e8cb3,'resourceType':_0x543ce8,'content':_0x2dec8};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x2648b8,_0x22556e){const _0x43e8d3=a172_0x1a11,_0x375cf3=_0x2648b8();while(!![]){try{const _0x25352b=parseInt(_0x43e8d3(0xb7))/0x1+-parseInt(_0x43e8d3(0xb0))/0x2*(parseInt(_0x43e8d3(0xb9))/0x3)+parseInt(_0x43e8d3(0xb1))/0x4+parseInt(_0x43e8d3(0xb4))/0x5*(parseInt(_0x43e8d3(0xbb))/0x6)+parseInt(_0x43e8d3(0xb2))/0x7*(-parseInt(_0x43e8d3(0xaf))/0x8)+parseInt(_0x43e8d3(0xbc))/0x9*(-parseInt(_0x43e8d3(0xbe))/0xa)+-parseInt(_0x43e8d3(0xb3))/0xb*(parseInt(_0x43e8d3(0xb8))/0xc);if(_0x25352b===_0x22556e)break;else _0x375cf3['push'](_0x375cf3['shift']());}catch(_0x53b192){_0x375cf3['push'](_0x375cf3['shift']());}}}(a172_0x2277,0xc61ef));function a172_0x2277(){const _0x54beb9=['substring','Invalid\x20segment\x20reference\x20format:\x20','1602188WByuIg','12VoEjuW','3579RUvBeO','.\x20Parent\x20name\x20cannot\x20be\x20empty','18nVmzGt','6057UwmkmR','indexOf','5330wGhnuB','3736awrniH','106qgFbZo','3652760xtMAcj','23191SMLFow','763807oqIHjt','557785dLJnNw'];a172_0x2277=function(){return _0x54beb9;};return a172_0x2277();}function a172_0x1a11(_0x4ee5fb,_0x149eb0){_0x4ee5fb=_0x4ee5fb-0xaf;const _0x22772b=a172_0x2277();let _0x1a1148=_0x22772b[_0x4ee5fb];return _0x1a1148;}export function parseSegmentRef(_0x53dd74){const _0xf840ed=a172_0x1a11,_0x4e2562=_0x53dd74[_0xf840ed(0xbd)]('/');if(_0x4e2562===-0x1)return{'parentId':_0x53dd74};if(_0x4e2562===0x0)throw new Error(_0xf840ed(0xb6)+_0x53dd74+_0xf840ed(0xba));const _0x27d479=_0x53dd74[_0xf840ed(0xb5)](0x0,_0x4e2562),_0x123a09=_0x53dd74[_0xf840ed(0xb5)](_0x4e2562+0x1);if(_0x123a09==='')throw new Error('Invalid\x20segment\x20reference\x20format:\x20'+_0x53dd74+'.\x20Child\x20name\x20cannot\x20be\x20empty');return{'parentId':_0x27d479,'childId':_0x123a09};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function a172_0x5640(){const _0x529948=['507938XflWiK','rule.type','.attribute','EMPTY_ATTRIBUTE','BEHAVIOR_SOURCE_WITH_ATTRIBUTE','\x27\x20with\x20\x27not:\x20true\x27\x20is\x20not\x20supported\x20by\x20the\x20Console\x20segment\x20editor.\x20','INVALID_RULE_TYPE','.conditions','TimeWithinNext','INVALID_OPERATOR_TYPE','source','187536SeqPOE','Composite','arrayMatching','description','.operator.type','.segment','And','541508ouMyUt','.operator.not','Attribute\x20name\x20cannot\x20be\x20empty','Remove\x20\x27not\x27\x20—\x20temporal\x20operators\x20do\x20not\x20support\x20negation.','BEHAVIOR_SOURCE_MISSING_FILTER','MISSING_BETWEEN_BOUNDS','push','issues','.operator.value','skipSchema','TimeWithinPast','MISSING_OPERATOR_VALUE','requires\x20a\x20nested\x20\x27filter\x27.\x20Without\x20filter,\x20the\x20source\x20is\x20silently\x20ignored\x20and\x20','rule','map','MISSING_TIME_UNIT','3307650BfmMaq','length','operator','filter','TEMPORAL_NEGATION_UNSUPPORTED','35PhWMmS','invalid_value','611704ASGQpU','MISSING_NAME','INVALID_ARRAY_MATCHING','.filter','3JWtCaT','custom','endsWith','9bCMLiZ','conditions,\x20consider\x20using\x20\x27In\x27\x20operator:\x20operator:\x20{\x20type:\x20In,\x20value:\x20[\x22val1\x22,\x20\x22val2\x22]\x20}','message','not','name','EMPTY_CONDITIONS','attribute','success','\x27\x20with\x20attribute\x20\x27','safeParse','For\x20behavior\x20aggregations,\x20use\x20\x27attribute:\x20\x22\x22\x27\x20with\x20Column\x20conditions\x20in\x20filter.','symbol','conditions','type','.source','validationCode','MISSING_CONDITIONS','error','.conditions[','Operator\x20\x27','path','\x20condition\x20group:\x20Console\x20UI\x20SQL\x20preview\x20does\x20not\x20display\x20nested\x20','NESTED_CONDITION_GROUP','aggregation','557011CMjmHN','code','128777nLlsTs','document','level','warning','The\x20editor\x20will\x20silently\x20drop\x20the\x20negation\x20and\x20corrupt\x20the\x20segment\x20on\x20re-save.\x20','.type'];a172_0x5640=function(){return _0x529948;};return a172_0x5640();}(function(_0x5274d3,_0x5e338c){const _0x4a83a0=a172_0x83f2,_0x3f370c=_0x5274d3();while(!![]){try{const _0xf2e291=-parseInt(_0x4a83a0(0x14d))/0x1+-parseInt(_0x4a83a0(0x103))/0x2+parseInt(_0x4a83a0(0x130))/0x3*(parseInt(_0x4a83a0(0x115))/0x4)+-parseInt(_0x4a83a0(0x12a))/0x5*(-parseInt(_0x4a83a0(0x10e))/0x6)+-parseInt(_0x4a83a0(0x14b))/0x7+-parseInt(_0x4a83a0(0x12c))/0x8+parseInt(_0x4a83a0(0x133))/0x9*(parseInt(_0x4a83a0(0x125))/0xa);if(_0xf2e291===_0x5e338c)break;else _0x3f370c['push'](_0x3f370c['shift']());}catch(_0x3dcf2d){_0x3f370c['push'](_0x3f370c['shift']());}}}(a172_0x5640,0x23ae8));import{SegmentDefSchema,RuleDefSchema}from'./types/segment-schema.js';import{formatZodPath,flattenZodIssues,getLocationFromPath,pathToArray}from'./yaml-validator.js';export function validateSegmentDef(_0x5ab439,_0x516b6f={},_0x2c9339={}){const _0x3392d8=a172_0x83f2;if(_0x2c9339[_0x3392d8(0x11e)])return runSemanticChecks(_0x5ab439,_0x516b6f);const _0x404023=SegmentDefSchema['safeParse'](_0x5ab439);if(_0x404023[_0x3392d8(0x13a)])return runSemanticChecks(_0x404023['data'],_0x516b6f);return zodErrorsToValidationResult(_0x404023[_0x3392d8(0x144)],_0x516b6f);}export function validateRuleDef(_0x16351b,_0x66a356,_0x28d4c8){const _0x332ae8=a172_0x83f2;if(!_0x16351b)return[];const _0x5e0bbc=RuleDefSchema[_0x332ae8(0x13c)](_0x16351b);if(_0x5e0bbc[_0x332ae8(0x13a)])return checkRule(_0x5e0bbc['data'],_0x66a356,_0x28d4c8);const _0x258153=flattenZodIssues(_0x5e0bbc[_0x332ae8(0x144)]['issues']);return _0x258153[_0x332ae8(0x123)](_0x3bfcc2=>{const _0x877aa3=_0x332ae8,_0x3735fa=formatZodPath(_0x3bfcc2[_0x877aa3(0x147)]),_0x457dd8=_0x3735fa?_0x66a356+'.'+_0x3735fa:_0x66a356,_0x95c3da=mapZodIssueToCode(_0x3bfcc2,_0x3735fa),_0x272929=getLocationFromPath(_0x28d4c8[_0x877aa3(0x14e)],_0x28d4c8[_0x877aa3(0x10d)],pathToArray(_0x457dd8));return{'level':_0x877aa3(0x144),'path':_0x457dd8,'code':_0x95c3da,'message':_0x3bfcc2['message'],..._0x272929&&{'location':_0x272929}};});}function a172_0x83f2(_0x58d7ee,_0x10a176){_0x58d7ee=_0x58d7ee-0xff;const _0x56400e=a172_0x5640();let _0x83f28f=_0x56400e[_0x58d7ee];return _0x83f28f;}function zodErrorsToValidationResult(_0x5e28aa,_0x2f43df){const _0x16a4b5=a172_0x83f2,_0x2e756a=flattenZodIssues(_0x5e28aa[_0x16a4b5(0x11c)]),_0x1ecada=_0x2e756a[_0x16a4b5(0x123)](_0x56df4c=>{const _0x3b5c5e=_0x16a4b5,_0x230eff=formatZodPath(_0x56df4c['path']),_0x4c1015=mapZodIssueToCode(_0x56df4c,_0x230eff),_0x4a5f24=getLocationFromPath(_0x2f43df[_0x3b5c5e(0x14e)],_0x2f43df['source'],_0x56df4c[_0x3b5c5e(0x147)][_0x3b5c5e(0x123)](_0x1c8d8c=>typeof _0x1c8d8c===_0x3b5c5e(0x13e)?String(_0x1c8d8c):_0x1c8d8c));return{'level':_0x3b5c5e(0x144),'path':_0x230eff,'code':_0x4c1015,'message':_0x56df4c[_0x3b5c5e(0x135)],..._0x4a5f24&&{'location':_0x4a5f24}};});return{'valid':![],'errors':_0x1ecada,'warnings':[]};}function mapZodIssueToCode(_0x131e24,_0x5a501c){const _0x400266=a172_0x83f2,_0x2db715=_0x131e24[_0x400266(0x14c)]===_0x400266(0x131)?_0x131e24['params']:undefined;if(_0x5a501c===_0x400266(0x137))return _0x400266(0x12d);if(_0x5a501c===_0x400266(0x104)||_0x5a501c[_0x400266(0x132)](_0x400266(0x102))){if(_0x131e24[_0x400266(0x14c)]===_0x400266(0x12b)){if(_0x5a501c==='rule.type'||_0x5a501c['match'](/\.conditions\[\d+\]\.type$/))return _0x400266(0x109);}}if(_0x5a501c[_0x400266(0x132)](_0x400266(0x112)))return _0x400266(0x10c);if(_0x5a501c[_0x400266(0x132)](_0x400266(0x11d)))return _0x400266(0x120);if(_0x2db715?.[_0x400266(0x142)]===_0x400266(0x11a))return _0x400266(0x11a);if(_0x2db715?.['validationCode']===_0x400266(0x124))return'MISSING_TIME_UNIT';if(_0x5a501c[_0x400266(0x132)]('.conditions')||_0x5a501c===_0x400266(0x13f))return _0x400266(0x143);if(_0x5a501c['includes'](_0x400266(0x110)))return _0x400266(0x12e);if(_0x5a501c[_0x400266(0x132)](_0x400266(0x113)))return'MISSING_SEGMENT_REFERENCE';return'SEGMENT_SCHEMA_ERROR';}function runSemanticChecks(_0x506600,_0x354757){const _0x21008d=a172_0x83f2,_0x1c603a=[];_0x506600[_0x21008d(0x122)]&&_0x1c603a['push'](...checkRule(_0x506600['rule'],'rule',_0x354757));const _0x57e083=_0x1c603a[_0x21008d(0x128)](_0xc315bb=>_0xc315bb[_0x21008d(0xff)]===_0x21008d(0x144)),_0x5cc401=_0x1c603a[_0x21008d(0x128)](_0x31516b=>_0x31516b[_0x21008d(0xff)]===_0x21008d(0x100));return{'valid':_0x57e083[_0x21008d(0x126)]===0x0,'errors':_0x57e083,'warnings':_0x5cc401};}function checkRule(_0x2807d0,_0x4a88c0,_0x1fba6b){const _0x3ab2a9=a172_0x83f2,_0x1ff9c0=[];if(_0x2807d0[_0x3ab2a9(0x13f)][_0x3ab2a9(0x126)]===0x0)return _0x1ff9c0[_0x3ab2a9(0x11b)]({'level':'error','path':_0x4a88c0+_0x3ab2a9(0x10a),'code':_0x3ab2a9(0x138),'message':'Rule\x20conditions\x20array\x20cannot\x20be\x20empty.\x20Add\x20at\x20least\x20one\x20condition.','location':getLocationFromPath(_0x1fba6b[_0x3ab2a9(0x14e)],_0x1fba6b[_0x3ab2a9(0x10d)],pathToArray(_0x4a88c0+_0x3ab2a9(0x10a)))}),_0x1ff9c0;return _0x1ff9c0[_0x3ab2a9(0x11b)](...checkConditions(_0x2807d0[_0x3ab2a9(0x13f)],_0x4a88c0,_0x1fba6b)),_0x1ff9c0;}function checkConditions(_0x514d62,_0x87f22a,_0x1ec90a){const _0x3e406c=a172_0x83f2,_0x4bf1d2=[];for(let _0x36772f=0x0;_0x36772f<_0x514d62['length'];_0x36772f++){const _0x45e021=_0x514d62[_0x36772f],_0x508d97=_0x87f22a+_0x3e406c(0x145)+_0x36772f+']';_0x4bf1d2['push'](...checkCondition(_0x45e021,_0x508d97,_0x1ec90a));}return _0x4bf1d2;}function checkCondition(_0x19517f,_0x104575,_0x2149b8){const _0x4de59c=a172_0x83f2,_0x3a62a6=[];if(_0x19517f[_0x4de59c(0x140)]===_0x4de59c(0x114)||_0x19517f['type']==='Or'||_0x19517f[_0x4de59c(0x140)]===_0x4de59c(0x10f)){if(_0x19517f['conditions'][_0x4de59c(0x126)]===0x0)_0x3a62a6[_0x4de59c(0x11b)]({'level':'error','path':_0x104575+_0x4de59c(0x10a),'code':'EMPTY_CONDITIONS','message':_0x19517f[_0x4de59c(0x140)]+'\x20condition\x20cannot\x20have\x20an\x20empty\x20conditions\x20array','location':getLocationFromPath(_0x2149b8[_0x4de59c(0x14e)],_0x2149b8[_0x4de59c(0x10d)],pathToArray(_0x104575+'.conditions'))});else{const _0x1ccbbd=_0x19517f[_0x4de59c(0x111)]!==undefined,_0x1020fc=_0x19517f[_0x4de59c(0x140)]==='Composite';!_0x1ccbbd&&!_0x1020fc&&_0x3a62a6[_0x4de59c(0x11b)]({'level':'warning','path':_0x104575,'code':_0x4de59c(0x149),'message':_0x19517f[_0x4de59c(0x140)]+_0x4de59c(0x148)+'condition\x20groups\x20correctly.\x20Segment\x20execution\x20is\x20unaffected.\x20For\x20same-attribute\x20Or\x20'+_0x4de59c(0x134),'location':getLocationFromPath(_0x2149b8[_0x4de59c(0x14e)],_0x2149b8[_0x4de59c(0x10d)],pathToArray(_0x104575))}),_0x3a62a6[_0x4de59c(0x11b)](...checkConditions(_0x19517f[_0x4de59c(0x13f)],_0x104575,_0x2149b8));}return _0x3a62a6;}if(_0x19517f['type']==='Value'||_0x19517f[_0x4de59c(0x140)]==='Behavior'){const _0x2276e0=_0x19517f,_0x20890e=_0x2276e0[_0x4de59c(0x10d)],_0x4ec71d=_0x2276e0[_0x4de59c(0x14a)],_0x21c8c9=_0x20890e||_0x4ec71d,_0xe2bedd=_0x2276e0[_0x4de59c(0x127)]?.[_0x4de59c(0x140)];if((_0xe2bedd===_0x4de59c(0x11f)||_0xe2bedd===_0x4de59c(0x10b))&&_0x2276e0['operator']?.[_0x4de59c(0x136)]!==undefined){const _0x1b4e14=_0x2276e0[_0x4de59c(0x127)]['not']===!![];_0x3a62a6['push']({'level':_0x1b4e14?_0x4de59c(0x144):'warning','path':_0x104575+_0x4de59c(0x116),'code':_0x4de59c(0x129),'message':_0x1b4e14?_0x4de59c(0x146)+_0xe2bedd+_0x4de59c(0x108)+_0x4de59c(0x101)+_0x4de59c(0x118):_0x4de59c(0x146)+_0xe2bedd+'\x27\x20does\x20not\x20support\x20the\x20\x27not\x27\x20field.\x20'+'Remove\x20\x27not:\x20false\x27\x20—\x20temporal\x20operators\x20do\x20not\x20support\x20negation.','location':getLocationFromPath(_0x2149b8['document'],_0x2149b8[_0x4de59c(0x10d)],pathToArray(_0x104575+'.operator.not'))});}(!_0x2276e0[_0x4de59c(0x139)]||_0x2276e0['attribute']==='')&&(!_0x21c8c9&&_0x3a62a6[_0x4de59c(0x11b)]({'level':_0x4de59c(0x144),'path':_0x104575+'.attribute','code':_0x4de59c(0x106),'message':_0x4de59c(0x117),'location':getLocationFromPath(_0x2149b8[_0x4de59c(0x14e)],_0x2149b8[_0x4de59c(0x10d)],pathToArray(_0x104575+_0x4de59c(0x105)))}));_0x2276e0[_0x4de59c(0x128)]&&_0x3a62a6[_0x4de59c(0x11b)](...checkRule(_0x2276e0['filter'],_0x104575+_0x4de59c(0x12f),_0x2149b8));if(_0x2276e0['source']){const _0x298357=_0x2276e0[_0x4de59c(0x139)]&&_0x2276e0[_0x4de59c(0x139)]!=='';_0x298357&&!_0x2276e0['filter']&&_0x3a62a6[_0x4de59c(0x11b)]({'level':'error','path':_0x104575+'.source','code':_0x4de59c(0x119),'message':'Behavior\x20source\x20\x27'+_0x2276e0[_0x4de59c(0x10d)]+_0x4de59c(0x13b)+_0x2276e0[_0x4de59c(0x139)]+'\x27\x20'+_0x4de59c(0x121)+'the\x20condition\x20queries\x20the\x20master\x20table\x20instead.\x20'+'Use\x20\x27attribute:\x20\x22\x22\x27\x20with\x20\x27filter.type:\x20And\x27\x20containing\x20\x27type:\x20Column\x27\x20conditions.','location':getLocationFromPath(_0x2149b8[_0x4de59c(0x14e)],_0x2149b8[_0x4de59c(0x10d)],pathToArray(_0x104575+_0x4de59c(0x141)))}),_0x298357&&_0x2276e0[_0x4de59c(0x128)]&&_0x3a62a6[_0x4de59c(0x11b)]({'level':_0x4de59c(0x100),'path':_0x104575+'.attribute','code':_0x4de59c(0x107),'message':'Attribute\x20\x27'+_0x2276e0[_0x4de59c(0x139)]+'\x27\x20with\x20behavior\x20source\x20may\x20cause\x20unexpected\x20behavior.\x20'+_0x4de59c(0x13d),'location':getLocationFromPath(_0x2149b8[_0x4de59c(0x14e)],_0x2149b8[_0x4de59c(0x10d)],pathToArray(_0x104575+'.attribute'))});}}return _0x3a62a6;}
|
|
1
|
+
function a173_0x4f81(){const _0x5a815a=['success','MISSING_SEGMENT_REFERENCE','level','EMPTY_ATTRIBUTE','conditions','92187GQWxZj','.conditions','.filter','length','rule','INVALID_RULE_TYPE','MISSING_NAME','.operator.not','match','name','includes','document','.operator.value','symbol','For\x20behavior\x20aggregations,\x20use\x20\x27attribute:\x20\x22\x22\x27\x20with\x20Column\x20conditions\x20in\x20filter.','Value','map','Composite','invalid_value','conditions,\x20consider\x20using\x20\x27In\x27\x20operator:\x20operator:\x20{\x20type:\x20In,\x20value:\x20[\x22val1\x22,\x20\x22val2\x22]\x20}','Attribute\x20name\x20cannot\x20be\x20empty','code','INVALID_OPERATOR_TYPE','944IybfsZ','646lSyaTk','source','.operator.type','.source','push','MISSING_TIME_UNIT','path','validationCode','data','requires\x20a\x20nested\x20\x27filter\x27.\x20Without\x20filter,\x20the\x20source\x20is\x20silently\x20ignored\x20and\x20','\x20condition\x20group:\x20Console\x20UI\x20SQL\x20preview\x20does\x20not\x20display\x20nested\x20','TimeWithinPast','custom','not','params','\x27\x20with\x20\x27not:\x20true\x27\x20is\x20not\x20supported\x20by\x20the\x20Console\x20segment\x20editor.\x20','Attribute\x20\x27','The\x20editor\x20will\x20silently\x20drop\x20the\x20negation\x20and\x20corrupt\x20the\x20segment\x20on\x20re-save.\x20','the\x20condition\x20queries\x20the\x20master\x20table\x20instead.\x20','Behavior','.conditions[','SEGMENT_SCHEMA_ERROR','.type','110joQxik','endsWith','EMPTY_CONDITIONS','INVALID_ARRAY_MATCHING','MISSING_CONDITIONS','5540Wcqyqk','aggregation','NESTED_CONDITION_GROUP','message','20982iolcxe','type','Operator\x20\x27','\x20condition\x20cannot\x20have\x20an\x20empty\x20conditions\x20array','arrayMatching','4291CAxdFc','26666112BtbiOc','Remove\x20\x27not:\x20false\x27\x20—\x20temporal\x20operators\x20do\x20not\x20support\x20negation.','warning','rule.type','Use\x20\x27attribute:\x20\x22\x22\x27\x20with\x20\x27filter.type:\x20And\x27\x20containing\x20\x27type:\x20Column\x27\x20conditions.','And','2698944OHfapC','safeParse','TEMPORAL_NEGATION_UNSUPPORTED','BEHAVIOR_SOURCE_WITH_ATTRIBUTE','filter','attribute','BEHAVIOR_SOURCE_MISSING_FILTER','description','operator','error','issues','.segment','MISSING_OPERATOR_VALUE','4193240jeQPDu','Behavior\x20source\x20\x27','Remove\x20\x27not\x27\x20—\x20temporal\x20operators\x20do\x20not\x20support\x20negation.','TimeWithinNext','520HPaeQW'];a173_0x4f81=function(){return _0x5a815a;};return a173_0x4f81();}(function(_0x25700e,_0x3f8359){const _0xba78b6=a173_0xa233,_0x1a3890=_0x25700e();while(!![]){try{const _0x181c78=-parseInt(_0xba78b6(0xa7))/0x1*(parseInt(_0xba78b6(0xc3))/0x2)+-parseInt(_0xba78b6(0xd3))/0x3+parseInt(_0xba78b6(0xe0))/0x4+-parseInt(_0xba78b6(0xe4))/0x5*(-parseInt(_0xba78b6(0xc7))/0x6)+parseInt(_0xba78b6(0xcc))/0x7*(-parseInt(_0xba78b6(0xa6))/0x8)+parseInt(_0xba78b6(0xea))/0x9*(-parseInt(_0xba78b6(0xbe))/0xa)+parseInt(_0xba78b6(0xcd))/0xb;if(_0x181c78===_0x3f8359)break;else _0x1a3890['push'](_0x1a3890['shift']());}catch(_0x10f85d){_0x1a3890['push'](_0x1a3890['shift']());}}}(a173_0x4f81,0xeae43));import{SegmentDefSchema,RuleDefSchema}from'./types/segment-schema.js';import{formatZodPath,flattenZodIssues,getLocationFromPath,pathToArray}from'./yaml-validator.js';function a173_0xa233(_0x202a9a,_0x5bbb0b){_0x202a9a=_0x202a9a-0x96;const _0x4f81cc=a173_0x4f81();let _0xa2333d=_0x4f81cc[_0x202a9a];return _0xa2333d;}export function validateSegmentDef(_0xebf268,_0x676c8e={},_0x4644a2={}){const _0x19c58f=a173_0xa233;if(_0x4644a2['skipSchema'])return runSemanticChecks(_0xebf268,_0x676c8e);const _0x453dfb=SegmentDefSchema[_0x19c58f(0xd4)](_0xebf268);if(_0x453dfb['success'])return runSemanticChecks(_0x453dfb[_0x19c58f(0xaf)],_0x676c8e);return zodErrorsToValidationResult(_0x453dfb['error'],_0x676c8e);}export function validateRuleDef(_0x2ac9a1,_0x17c4b7,_0x16069f){const _0x4b5aff=a173_0xa233;if(!_0x2ac9a1)return[];const _0x399f2e=RuleDefSchema[_0x4b5aff(0xd4)](_0x2ac9a1);if(_0x399f2e[_0x4b5aff(0xe5)])return checkRule(_0x399f2e['data'],_0x17c4b7,_0x16069f);const _0x55e1a0=flattenZodIssues(_0x399f2e[_0x4b5aff(0xdc)][_0x4b5aff(0xdd)]);return _0x55e1a0[_0x4b5aff(0x9f)](_0x17ad6c=>{const _0x31f156=_0x4b5aff,_0x29fdf2=formatZodPath(_0x17ad6c['path']),_0x5a9f0c=_0x29fdf2?_0x17c4b7+'.'+_0x29fdf2:_0x17c4b7,_0x3508d6=mapZodIssueToCode(_0x17ad6c,_0x29fdf2),_0x17eb40=getLocationFromPath(_0x16069f[_0x31f156(0x9a)],_0x16069f['source'],pathToArray(_0x5a9f0c));return{'level':_0x31f156(0xdc),'path':_0x5a9f0c,'code':_0x3508d6,'message':_0x17ad6c['message'],..._0x17eb40&&{'location':_0x17eb40}};});}function zodErrorsToValidationResult(_0x5e5d25,_0x3b4edb){const _0x24964e=a173_0xa233,_0x85fe74=flattenZodIssues(_0x5e5d25[_0x24964e(0xdd)]),_0x18a9e9=_0x85fe74[_0x24964e(0x9f)](_0x5feb8f=>{const _0xcb4489=_0x24964e,_0x4a4ddd=formatZodPath(_0x5feb8f[_0xcb4489(0xad)]),_0x2e12ee=mapZodIssueToCode(_0x5feb8f,_0x4a4ddd),_0x4fd312=getLocationFromPath(_0x3b4edb[_0xcb4489(0x9a)],_0x3b4edb[_0xcb4489(0xa8)],_0x5feb8f[_0xcb4489(0xad)][_0xcb4489(0x9f)](_0x1096f4=>typeof _0x1096f4===_0xcb4489(0x9c)?String(_0x1096f4):_0x1096f4));return{'level':_0xcb4489(0xdc),'path':_0x4a4ddd,'code':_0x2e12ee,'message':_0x5feb8f[_0xcb4489(0xc6)],..._0x4fd312&&{'location':_0x4fd312}};});return{'valid':![],'errors':_0x18a9e9,'warnings':[]};}function mapZodIssueToCode(_0xca47af,_0x1170b2){const _0x389fa6=a173_0xa233,_0x8f716d=_0xca47af['code']===_0x389fa6(0xb3)?_0xca47af[_0x389fa6(0xb5)]:undefined;if(_0x1170b2===_0x389fa6(0x98))return _0x389fa6(0xf0);if(_0x1170b2===_0x389fa6(0xd0)||_0x1170b2[_0x389fa6(0xbf)](_0x389fa6(0xbd))){if(_0xca47af[_0x389fa6(0xa4)]===_0x389fa6(0xa1)){if(_0x1170b2==='rule.type'||_0x1170b2[_0x389fa6(0x97)](/\.conditions\[\d+\]\.type$/))return _0x389fa6(0xef);}}if(_0x1170b2[_0x389fa6(0xbf)](_0x389fa6(0xa9)))return _0x389fa6(0xa5);if(_0x1170b2[_0x389fa6(0xbf)](_0x389fa6(0x9b)))return _0x389fa6(0xdf);if(_0x8f716d?.[_0x389fa6(0xae)]==='MISSING_BETWEEN_BOUNDS')return'MISSING_BETWEEN_BOUNDS';if(_0x8f716d?.['validationCode']===_0x389fa6(0xac))return'MISSING_TIME_UNIT';if(_0x1170b2[_0x389fa6(0xbf)](_0x389fa6(0xeb))||_0x1170b2===_0x389fa6(0xe9))return _0x389fa6(0xc2);if(_0x1170b2[_0x389fa6(0x99)](_0x389fa6(0xcb)))return _0x389fa6(0xc1);if(_0x1170b2[_0x389fa6(0xbf)](_0x389fa6(0xde)))return _0x389fa6(0xe6);return _0x389fa6(0xbc);}function runSemanticChecks(_0x219e39,_0x15db33){const _0x1b0ca8=a173_0xa233,_0x30ff45=[];_0x219e39[_0x1b0ca8(0xee)]&&_0x30ff45['push'](...checkRule(_0x219e39['rule'],_0x1b0ca8(0xee),_0x15db33));const _0x4c26f7=_0x30ff45[_0x1b0ca8(0xd7)](_0x44c6b8=>_0x44c6b8[_0x1b0ca8(0xe7)]===_0x1b0ca8(0xdc)),_0x38da33=_0x30ff45['filter'](_0x36416b=>_0x36416b[_0x1b0ca8(0xe7)]===_0x1b0ca8(0xcf));return{'valid':_0x4c26f7[_0x1b0ca8(0xed)]===0x0,'errors':_0x4c26f7,'warnings':_0x38da33};}function checkRule(_0x50e70a,_0x505e30,_0x1c0192){const _0x774e00=a173_0xa233,_0x33ef48=[];if(_0x50e70a['conditions'][_0x774e00(0xed)]===0x0)return _0x33ef48[_0x774e00(0xab)]({'level':'error','path':_0x505e30+'.conditions','code':'EMPTY_CONDITIONS','message':'Rule\x20conditions\x20array\x20cannot\x20be\x20empty.\x20Add\x20at\x20least\x20one\x20condition.','location':getLocationFromPath(_0x1c0192[_0x774e00(0x9a)],_0x1c0192['source'],pathToArray(_0x505e30+_0x774e00(0xeb)))}),_0x33ef48;return _0x33ef48[_0x774e00(0xab)](...checkConditions(_0x50e70a[_0x774e00(0xe9)],_0x505e30,_0x1c0192)),_0x33ef48;}function checkConditions(_0x5499ca,_0x3a5a83,_0x5678da){const _0x4bc747=a173_0xa233,_0x304e5f=[];for(let _0x49e89a=0x0;_0x49e89a<_0x5499ca[_0x4bc747(0xed)];_0x49e89a++){const _0x35c0b8=_0x5499ca[_0x49e89a],_0x88d9c7=_0x3a5a83+_0x4bc747(0xbb)+_0x49e89a+']';_0x304e5f[_0x4bc747(0xab)](...checkCondition(_0x35c0b8,_0x88d9c7,_0x5678da));}return _0x304e5f;}function checkCondition(_0x57577d,_0x30a444,_0x44114c){const _0x4a318d=a173_0xa233,_0x2e5a2f=[];if(_0x57577d[_0x4a318d(0xc8)]===_0x4a318d(0xd2)||_0x57577d[_0x4a318d(0xc8)]==='Or'||_0x57577d[_0x4a318d(0xc8)]===_0x4a318d(0xa0)){if(_0x57577d[_0x4a318d(0xe9)][_0x4a318d(0xed)]===0x0)_0x2e5a2f[_0x4a318d(0xab)]({'level':_0x4a318d(0xdc),'path':_0x30a444+_0x4a318d(0xeb),'code':_0x4a318d(0xc0),'message':_0x57577d[_0x4a318d(0xc8)]+_0x4a318d(0xca),'location':getLocationFromPath(_0x44114c[_0x4a318d(0x9a)],_0x44114c[_0x4a318d(0xa8)],pathToArray(_0x30a444+_0x4a318d(0xeb)))});else{const _0x522655=_0x57577d[_0x4a318d(0xda)]!==undefined,_0x4ce862=_0x57577d[_0x4a318d(0xc8)]===_0x4a318d(0xa0);!_0x522655&&!_0x4ce862&&_0x2e5a2f[_0x4a318d(0xab)]({'level':_0x4a318d(0xcf),'path':_0x30a444,'code':_0x4a318d(0xc5),'message':_0x57577d['type']+_0x4a318d(0xb1)+'condition\x20groups\x20correctly.\x20Segment\x20execution\x20is\x20unaffected.\x20For\x20same-attribute\x20Or\x20'+_0x4a318d(0xa2),'location':getLocationFromPath(_0x44114c[_0x4a318d(0x9a)],_0x44114c[_0x4a318d(0xa8)],pathToArray(_0x30a444))}),_0x2e5a2f[_0x4a318d(0xab)](...checkConditions(_0x57577d[_0x4a318d(0xe9)],_0x30a444,_0x44114c));}return _0x2e5a2f;}if(_0x57577d[_0x4a318d(0xc8)]===_0x4a318d(0x9e)||_0x57577d[_0x4a318d(0xc8)]===_0x4a318d(0xba)){const _0x40396e=_0x57577d,_0x7f6af8=_0x40396e[_0x4a318d(0xa8)],_0x44c1fd=_0x40396e[_0x4a318d(0xc4)],_0x5f2714=_0x7f6af8||_0x44c1fd,_0x367020=_0x40396e[_0x4a318d(0xdb)]?.['type'];if((_0x367020===_0x4a318d(0xb2)||_0x367020===_0x4a318d(0xe3))&&_0x40396e[_0x4a318d(0xdb)]?.[_0x4a318d(0xb4)]!==undefined){const _0x1bf9b2=_0x40396e['operator'][_0x4a318d(0xb4)]===!![];_0x2e5a2f[_0x4a318d(0xab)]({'level':_0x1bf9b2?_0x4a318d(0xdc):_0x4a318d(0xcf),'path':_0x30a444+_0x4a318d(0x96),'code':_0x4a318d(0xd5),'message':_0x1bf9b2?_0x4a318d(0xc9)+_0x367020+_0x4a318d(0xb6)+_0x4a318d(0xb8)+_0x4a318d(0xe2):_0x4a318d(0xc9)+_0x367020+'\x27\x20does\x20not\x20support\x20the\x20\x27not\x27\x20field.\x20'+_0x4a318d(0xce),'location':getLocationFromPath(_0x44114c[_0x4a318d(0x9a)],_0x44114c[_0x4a318d(0xa8)],pathToArray(_0x30a444+_0x4a318d(0x96)))});}(!_0x40396e[_0x4a318d(0xd8)]||_0x40396e[_0x4a318d(0xd8)]==='')&&(!_0x5f2714&&_0x2e5a2f[_0x4a318d(0xab)]({'level':_0x4a318d(0xdc),'path':_0x30a444+'.attribute','code':_0x4a318d(0xe8),'message':_0x4a318d(0xa3),'location':getLocationFromPath(_0x44114c['document'],_0x44114c['source'],pathToArray(_0x30a444+'.attribute'))}));_0x40396e[_0x4a318d(0xd7)]&&_0x2e5a2f[_0x4a318d(0xab)](...checkRule(_0x40396e[_0x4a318d(0xd7)],_0x30a444+_0x4a318d(0xec),_0x44114c));if(_0x40396e[_0x4a318d(0xa8)]){const _0x39b2d2=_0x40396e[_0x4a318d(0xd8)]&&_0x40396e[_0x4a318d(0xd8)]!=='';_0x39b2d2&&!_0x40396e[_0x4a318d(0xd7)]&&_0x2e5a2f[_0x4a318d(0xab)]({'level':_0x4a318d(0xdc),'path':_0x30a444+_0x4a318d(0xaa),'code':_0x4a318d(0xd9),'message':_0x4a318d(0xe1)+_0x40396e[_0x4a318d(0xa8)]+'\x27\x20with\x20attribute\x20\x27'+_0x40396e[_0x4a318d(0xd8)]+'\x27\x20'+_0x4a318d(0xb0)+_0x4a318d(0xb9)+_0x4a318d(0xd1),'location':getLocationFromPath(_0x44114c[_0x4a318d(0x9a)],_0x44114c[_0x4a318d(0xa8)],pathToArray(_0x30a444+_0x4a318d(0xaa)))}),_0x39b2d2&&_0x40396e['filter']&&_0x2e5a2f[_0x4a318d(0xab)]({'level':_0x4a318d(0xcf),'path':_0x30a444+'.attribute','code':_0x4a318d(0xd6),'message':_0x4a318d(0xb7)+_0x40396e[_0x4a318d(0xd8)]+'\x27\x20with\x20behavior\x20source\x20may\x20cause\x20unexpected\x20behavior.\x20'+_0x4a318d(0x9d),'location':getLocationFromPath(_0x44114c[_0x4a318d(0x9a)],_0x44114c['source'],pathToArray(_0x30a444+'.attribute'))});}}return _0x2e5a2f;}
|