@treasuredata/tdx 2026.3.34 → 2026.3.36
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bin.js +1 -1
- package/dist/build-info.json +3 -3
- package/dist/cli-categories.js +1 -1
- package/dist/cli.js +1 -1
- package/dist/commands/activations.js +1 -1
- package/dist/commands/agent-command.js +1 -1
- package/dist/commands/agent-test-command.js +1 -1
- package/dist/commands/api-command.js +1 -1
- package/dist/commands/auth-command.js +1 -1
- package/dist/commands/auth-login-command.js +1 -1
- package/dist/commands/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.js +1 -1
- package/dist/commands/claude-statusline-command.js +1 -1
- package/dist/commands/claude-usage-command.js +1 -1
- package/dist/commands/command.js +1 -1
- package/dist/commands/connection-command.js +1 -1
- package/dist/commands/databases.js +1 -1
- package/dist/commands/delivery-command.js +1 -1
- package/dist/commands/describe.js +1 -1
- package/dist/commands/engage-campaign-pull-command.js +1 -1
- package/dist/commands/engage-campaign-push-command.js +1 -1
- package/dist/commands/engage-campaign-validate-command.js +1 -1
- package/dist/commands/engage-command.js +1 -1
- package/dist/commands/engage-template-pull-command.js +1 -1
- package/dist/commands/engage-template-push-command.js +1 -1
- package/dist/commands/engage-template-validate-command.js +1 -1
- package/dist/commands/job-command.js +1 -1
- package/dist/commands/journey-command.js +1 -1
- package/dist/commands/journey-validate-command.js +1 -1
- package/dist/commands/llm-command.js +1 -1
- package/dist/commands/mcp-command.js +1 -1
- package/dist/commands/parent-segment-command.js +1 -1
- package/dist/commands/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-pull-command.js +1 -1
- package/dist/commands/segment-push-command.js +1 -1
- package/dist/commands/segment-update-command.js +1 -1
- package/dist/commands/segment-use-command.js +1 -1
- package/dist/commands/segment-validate-command.js +1 -1
- package/dist/commands/segments.js +1 -1
- package/dist/commands/show.js +1 -1
- package/dist/commands/status-command.js +1 -1
- package/dist/commands/tables.js +1 -1
- package/dist/commands/unset-command.js +1 -1
- package/dist/commands/upgrade-command.js +1 -1
- package/dist/commands/use-command.js +1 -1
- package/dist/commands/user-command.js +1 -1
- package/dist/commands/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/user-cache.js +1 -1
- package/dist/core/version.js +1 -1
- package/dist/index.js +1 -1
- package/dist/mcp/server.js +1 -1
- package/dist/mcp/tools/index.js +1 -1
- package/dist/mcp/tools/tdx-run.js +1 -1
- package/dist/mcp/tools/tdx-search.js +1 -1
- package/dist/mcp/utils.js +1 -1
- package/dist/proxy/claude-usage-tracker.js +1 -1
- package/dist/proxy/passthrough-server.js +1 -1
- package/dist/proxy/sse-usage-parser.js +1 -1
- package/dist/sdk/agent/agent-config.js +1 -1
- package/dist/sdk/agent/agent-ref-parser.js +1 -1
- package/dist/sdk/agent/agent-yaml.js +1 -1
- package/dist/sdk/agent/test/evaluator.js +1 -1
- package/dist/sdk/agent/test/executor.js +1 -1
- package/dist/sdk/agent/test/index.js +1 -1
- package/dist/sdk/agent/test/output.js +1 -1
- package/dist/sdk/agent/test/parser.js +1 -1
- package/dist/sdk/agent/tool-target-registry.js +1 -1
- package/dist/sdk/api.js +1 -1
- package/dist/sdk/cas/cas-api-client.js +1 -1
- package/dist/sdk/cas/cas-audience-yaml.js +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.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/campaign-pull.js +1 -1
- package/dist/sdk/engage/campaign-push.js +1 -1
- package/dist/sdk/engage/campaign-validator.js +1 -1
- package/dist/sdk/engage/campaign-yaml.js +1 -1
- package/dist/sdk/engage/template-pull.js +1 -1
- package/dist/sdk/engage/template-push.js +1 -1
- package/dist/sdk/engage/template-validator.js +1 -1
- package/dist/sdk/engage/template-yaml.js +1 -1
- package/dist/sdk/engage/types/campaign-def.js +1 -1
- package/dist/sdk/engage/types/campaign-schema.js +1 -1
- package/dist/sdk/engage/types/template-schema.js +1 -1
- package/dist/sdk/engage.js +1 -1
- package/dist/sdk/errors.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/personalization.js +1 -1
- package/dist/sdk/policy.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/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/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/tdx-config.js +1 -1
- package/dist/sdk/workflow/workflow-utils.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/colors.js +1 -1
- package/dist/utils/diff.js +1 -1
- package/dist/utils/file-permissions.js +1 -1
- package/dist/utils/file-reader.js +1 -1
- package/dist/utils/github-releases.js +1 -1
- package/dist/utils/global-cache.js +1 -1
- package/dist/utils/json-loader.js +1 -1
- package/dist/utils/local-cache.js +1 -1
- package/dist/utils/logger/formatters/default-formatter.js +1 -1
- package/dist/utils/logger/formatters/index.js +1 -1
- package/dist/utils/logger/handlers/console-handler.js +1 -1
- package/dist/utils/logger/handlers/file-handler.js +1 -1
- package/dist/utils/logger/handlers/index.js +1 -1
- package/dist/utils/logger/handlers/null-handler.js +1 -1
- package/dist/utils/logger/index.js +1 -1
- package/dist/utils/logger/logger.js +1 -1
- package/dist/utils/logger/types.js +1 -1
- package/dist/utils/option-validation.js +1 -1
- package/dist/utils/process.js +1 -1
- package/dist/utils/prompt.js +1 -1
- package/dist/utils/spinner.js +1 -1
- package/dist/utils/sse-parser.js +1 -1
- package/dist/utils/string-utils.js +1 -1
- package/dist/utils/table-ref-parser.js +1 -1
- package/dist/utils/tdx-logger.js +1 -1
- package/dist/utils/version-check.js +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a151_0x76c5e9=a151_0x2b21;(function(_0x3b5ad2,_0x10f4bd){const _0x509f6c=a151_0x2b21,_0x597d3f=_0x3b5ad2();while(!![]){try{const _0x4c4e0e=parseInt(_0x509f6c(0x180))/0x1+parseInt(_0x509f6c(0x173))/0x2*(-parseInt(_0x509f6c(0x181))/0x3)+-parseInt(_0x509f6c(0x175))/0x4*(parseInt(_0x509f6c(0x177))/0x5)+parseInt(_0x509f6c(0x17a))/0x6*(parseInt(_0x509f6c(0x17e))/0x7)+parseInt(_0x509f6c(0x170))/0x8*(parseInt(_0x509f6c(0x17f))/0x9)+parseInt(_0x509f6c(0x17d))/0xa*(-parseInt(_0x509f6c(0x184))/0xb)+-parseInt(_0x509f6c(0x189))/0xc*(-parseInt(_0x509f6c(0x172))/0xd);if(_0x4c4e0e===_0x10f4bd)break;else _0x597d3f['push'](_0x597d3f['shift']());}catch(_0x257884){_0x597d3f['push'](_0x597d3f['shift']());}}}(a151_0x3e8f,0xe83cc));import{readFileSync,writeFileSync,unlinkSync,existsSync,renameSync}from'fs';function a151_0x3e8f(){const _0x363475=['282570bHmsIb','ENOENT','segments','451TrVKCb','dirname','code','tdx.sdk.push-recovery','utf-8','28200420lxWVya','debug','8HLiTYl','toISOString','13SDyjXT','14vnoxdJ','Failed\x20to\x20read\x20push\x20recovery\x20file:\x20','4ZuhPum','.tmp','4263530SQnWcT','parse','Failed\x20to\x20parse\x20push\x20recovery\x20file:\x20','193266MaAFEy','journeyName','basename','439070jebADI','175TOWTGa','3832254NuEoKP','682351yJcomW'];a151_0x3e8f=function(){return _0x363475;};return a151_0x3e8f();}import a151_0x31de53 from'path';import{Logger}from'../../utils/logger/index.js';function a151_0x2b21(_0x2f6f94,_0x4d8838){_0x2f6f94=_0x2f6f94-0x170;const _0x3e8fa4=a151_0x3e8f();let _0x2b2162=_0x3e8fa4[_0x2f6f94];return _0x2b2162;}const logger=Logger['of'](a151_0x76c5e9(0x187));export function getPushRecoveryPath(_0x1a618f){const _0x1e99f7=a151_0x76c5e9,_0x38a251=a151_0x31de53[_0x1e99f7(0x185)](_0x1a618f),_0x2836e1=a151_0x31de53[_0x1e99f7(0x17c)](_0x1a618f);return a151_0x31de53['join'](_0x38a251,'.'+_0x2836e1+'.push-recovery.json');}export function readPushRecovery(_0x120695){const _0x12736f=a151_0x76c5e9,_0x31de99=getPushRecoveryPath(_0x120695);if(!existsSync(_0x31de99))return undefined;try{const _0x553fde=readFileSync(_0x31de99,'utf-8'),_0xe0d8ce=JSON[_0x12736f(0x178)](_0x553fde);if(_0xe0d8ce?.['version']!==0x1||typeof _0xe0d8ce[_0x12736f(0x17b)]!=='string')return undefined;return _0xe0d8ce;}catch(_0x139089){return _0x139089 instanceof SyntaxError?logger[_0x12736f(0x18a)](_0x12736f(0x179)+_0x139089):logger['warn'](_0x12736f(0x174)+_0x139089),undefined;}}export function writePushRecovery(_0x454a00,_0x94e7a){const _0x23775d=a151_0x76c5e9,_0x4665bc=getPushRecoveryPath(_0x454a00),_0x26cbab=_0x4665bc+_0x23775d(0x176);writeFileSync(_0x26cbab,JSON['stringify'](_0x94e7a,null,0x2)+'\x0a',_0x23775d(0x188)),renameSync(_0x26cbab,_0x4665bc);}export function deletePushRecovery(_0xe0f043){const _0x1da4b9=a151_0x76c5e9,_0x1a0d7f=getPushRecoveryPath(_0xe0f043);try{unlinkSync(_0x1a0d7f);}catch(_0x1cc2b8){_0x1cc2b8[_0x1da4b9(0x186)]!==_0x1da4b9(0x182)&&logger[_0x1da4b9(0x18a)]('Failed\x20to\x20delete\x20push\x20recovery\x20file:\x20'+_0x1cc2b8);}}export function saveSegmentToPushRecovery(_0xf5c3d,_0x17bcbf,_0x25636,_0x4e79e6){const _0xb23449=a151_0x76c5e9,_0x17deab=readPushRecovery(_0xf5c3d),_0x5b66f0=_0x17deab?.['journeyName']===_0x17bcbf?{..._0x17deab,'updatedAt':new Date()[_0xb23449(0x171)]()}:{'version':0x1,'journeyName':_0x17bcbf,'updatedAt':new Date()['toISOString'](),'segments':{}};_0x5b66f0[_0xb23449(0x183)][_0x25636]=_0x4e79e6,writePushRecovery(_0xf5c3d,_0x5b66f0);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a152_0x261771=a152_0x57f8;(function(_0x27c77b,_0x6671ae){const _0x2fa742=a152_0x57f8,_0x467e6b=_0x27c77b();while(!![]){try{const _0x281212=-parseInt(_0x2fa742(0x20a))/0x1+-parseInt(_0x2fa742(0x12a))/0x2*(parseInt(_0x2fa742(0x190))/0x3)+parseInt(_0x2fa742(0x171))/0x4*(parseInt(_0x2fa742(0x1a4))/0x5)+parseInt(_0x2fa742(0x1ba))/0x6+parseInt(_0x2fa742(0x1de))/0x7+parseInt(_0x2fa742(0x132))/0x8*(parseInt(_0x2fa742(0x15f))/0x9)+parseInt(_0x2fa742(0x166))/0xa*(-parseInt(_0x2fa742(0x17a))/0xb);if(_0x281212===_0x6671ae)break;else _0x467e6b['push'](_0x467e6b['shift']());}catch(_0x32e68b){_0x467e6b['push'](_0x467e6b['shift']());}}}(a152_0xf4f8,0x8c63d));import{createHash}from'crypto';import{Logger}from'../../utils/logger/index.js';const logger=Logger['of'](a152_0x261771(0x16e));export const PENDING_SEGMENT_PREFIX=a152_0x261771(0x1fc);export const PENDING_ACTIVATION_PREFIX=a152_0x261771(0x154);export function createPendingSegmentId(_0x16f008){return''+PENDING_SEGMENT_PREFIX+_0x16f008+'__';}export function isPendingSegmentId(_0x2259f6){const _0x5ae179=a152_0x261771;return _0x2259f6[_0x5ae179(0x110)](PENDING_SEGMENT_PREFIX)&&!_0x2259f6[_0x5ae179(0x110)](PENDING_ACTIVATION_PREFIX);}export function extractPendingSegmentName(_0x21081a){return _0x21081a['replace'](/^__pending_(.+)__$/,'$1');}export function createPendingActivationId(_0x3e8c33){return''+PENDING_ACTIVATION_PREFIX+_0x3e8c33+'__';}export function isPendingActivationId(_0x5a812b){const _0xdf3dc2=a152_0x261771;return _0x5a812b[_0xdf3dc2(0x110)](PENDING_ACTIVATION_PREFIX);}export function extractPendingActivationName(_0x13bc9f){return _0x13bc9f['replace'](/^__pending_act_(.+)__$/,'$1');}export function generateDeterministicJourneySegmentName(_0x1d91e9,_0x47673b){const _0x2c63ab=a152_0x261771,_0x51351c=_0x1d91e9+'::'+(_0x47673b[_0x2c63ab(0x147)]()||'segment'),_0x50d317=createHash('sha1')[_0x2c63ab(0x1b4)](_0x51351c)[_0x2c63ab(0x1db)]('hex')[_0x2c63ab(0x18c)](0x0,0xc);return _0x2c63ab(0x15d)+_0x50d317;}export function ensureJourneyDefaults(_0x2e6f16){const _0x33101f=a152_0x261771;!_0x2e6f16[_0x33101f(0x11a)]&&(_0x2e6f16['description']=''),!_0x2e6f16['state']&&(_0x2e6f16[_0x33101f(0x16c)]='draft');}function a152_0x57f8(_0x313a27,_0x2ad2a7){_0x313a27=_0x313a27-0x10f;const _0xf4f8f3=a152_0xf4f8();let _0x57f8b4=_0xf4f8f3[_0x313a27];return _0x57f8b4;}export function injectExistingStageIds(_0xac1ee2,_0x527c54){const _0x9685cb=a152_0x261771,_0x20969c=new Map(_0x527c54[_0x9685cb(0x15a)](_0x489184=>[_0x489184[_0x9685cb(0x1ff)],_0x489184['id']]));for(const _0x4cdff6 of _0xac1ee2){if(!_0x4cdff6['id']){const _0x3ca77b=_0x20969c[_0x9685cb(0x114)](_0x4cdff6[_0x9685cb(0x1ff)]);_0x3ca77b&&(_0x4cdff6['id']=_0x3ca77b);}}}export function resolveTDFolderPath(_0x5407d6,_0x51f426,_0x338c07){const _0x1582fe=a152_0x261771;if(!_0x51f426)return _0x5407d6;if(_0x5407d6===_0x338c07||_0x5407d6[_0x1582fe(0x110)](_0x338c07+'/'))return _0x5407d6;return _0x5407d6?_0x338c07+'/'+_0x5407d6:_0x338c07;}function a152_0xf4f8(){const _0x7ac0e1=['behavior','folderId','rule','Matched\x20server\x20segment\x20\x27','state',').\x20','tdx.sdk.push-workflow','journeyStages','relationships','1433764lSIlde','existingActivation','\x27\x20to\x20local\x20\x27','segments','Entry\x20criteria:\x20','entries','verbose','length','steps','473WPdJSY','message',',\x20falling\x20back\x20to\x20getSegmentEntity:\x20','segment_updating','all_columns','Failed\x20to\x20resolve\x20segment\x20','activationContext','journeys','dirname','Creating\x20folder\x20\x27','parentId','\x27\x20milestone','all','Failed\x20to\x20fetch\x20referenced\x20segment\x20','stages','index','.$1.push-recovery.json','item','slice','Segment\x20not\x20found:\x20','run_after_journey_refresh','createFolder','3BSinPv','Updating\x20activation\x20\x27','branches','ACTIVATION_UPDATE_ERROR','notification','getSegmentEntity\x20also\x20failed\x20for\x20','\x0a\x20\x20','withProgress','\x20journey\x20from\x20file:\x20','entry_criteria','\x27\x20exit\x20criteria','existingSegment','keys','goal\x20criteria','Name\x20has\x20already\x20been\x20taken','waitStepType','journeyActivationNameToId','Fetching\x20','activation_deleted','folderPathToId','5hkyCKc','logDeleted','journeyBundlesByFolderAndName','push','nameToId','getJourney','resolveSegment','Embedded\x20segment\x20\x27','has','filter','yamlConfig','with','createdSegmentId','kind','JOURNEY_UPDATE_ERROR','max','update','Activation','diff','journeyActivationStepId','segment_updated','updated','4742958SEqqbs','Delete\x20the\x20push\x20recovery\x20file\x20(','segment_creating','logWarning','idToEmailMap','\x20(referenced\x20in\x20journey\x20','Failed\x20to\x20sync\x20activations\x20for\x20segment\x20\x27','segmentFolderId','Failed\x20to\x20','localName','deleted','\x27\x20wait\x20condition','folderPath','segment_created','folder_creating','stage\x20\x27','toString','delete','segmentNameToId','logSuccess','SEGMENT_SYNTAX_ERROR','\x27\x20not\x20found\x20in\x20journey\x20\x27','createSegment','parse','journey_updated','journeyById','existingJourney','join','SEGMENT_NOT_FOUND','and\x20the\x20server\x20segment,\x20then\x20retry.','resolvedRule','DecisionPoint','created','digest','activation_creating','conditionTimeoutDuration','6584130QAGMVX','reduce','size','Activation\x20not\x20found:\x20','rootFolderId','../../utils/async.js','toISOString','type','activation_created','buildUserMaps','Warning:\x20Could\x20not\x20resolve\x20embedded\x20segment\x20\x27','columns','goal','fetchJourney','parentFolder','journeyBundleName','includes','connection','activationActions','Created\x20segment\x20\x27','connector_config','create','from','skipSegments','effectiveFolderId','uniqueServerName','WaitStep','\x20segment\x20from\x20file:\x20','Updated\x20segment\x20\x27','SEGMENT_UPDATE_ERROR','__pending_','segment_deleting','embedded_segment_created','name','conditionSegmentId','Updated\x20journey\x20\x27','segmentByFolderAndName','toLowerCase','createJourneySegment','connectionIdToNameMap','journeyId','getSegmentEntity','segment','JOURNEY_SYNTAX_ERROR','418799qqZTyj','\x27\x20from\x20file:\x20','segment_deleted','Failed\x20to\x20resolve\x20activation\x20','Cannot\x20create\x20embedded\x20activation\x20without\x20journey\x20context','activation_template_id','Cannot\x20create\x20embedded\x20segment\x20for\x20existing\x20journey\x20without\x20journey\x20ID','Created\x20journey\x20\x27','\x27\x20by\x20rule\x20content','flatMap','activation_updating','\x27\x20decision\x20point\x20branch\x20\x27','Condition','Stage\x20\x27','stringify','user','NOT_FOUND','startsWith','utf-8','progress','INTERNAL','get','Updated\x20activation\x20\x27','journey_created','add','embedded_activation_creating','createdSegmentIds','description','decision_point','idToName','versionNumber','activations','Creating\x20activation\x20\x27','find','debug','createActivation','embeddedSegmentNameToId','deleteActivation','results','embedded_segment_creating','deps','journeyBundleId','validatedRequest','648454gRycVz','split','getLatestJourneyId','isNew','Duration','\x27...','uniqueSegmentName','conditionTimeoutUnit','34096TkARKg','getActivation','entryCriteria','valid','Creating\x20segment\x20\x27','object','yamlActivation','):\x20','embedded_activation_created','action','Updating\x20segment\x20\x27','exitCriterias','getSegment\x20failed\x20for\x20','activation_updated','absolutePath','activationParams','schedule','existingSegments','sort','attributes','./child-segment-yaml.js','trim','activationStepsById','updateActivation','set','conditions','folder','waitStep','list','null','waitStepUnit','unchanged','listActivations','match','__pending_act_','milestone','segmentId','relative','./journey-yaml.js','journey_creating','map','updateSegmentById','parseDocument','journey_entry_criteria_','\x20error(s)','1242TLDnhr','\x27\x20for\x20','onProgress','hasChanges','\x27\x20not\x20found\x20in\x20parent\x20segment\x20(referenced\x20in\x20jump\x20step\x20of\x20\x27','data','journey','316190VfqqFc','parentSegmentFolder'];a152_0xf4f8=function(){return _0x7ac0e1;};return a152_0xf4f8();}export function addFoldersToCreate(_0x2379eb,_0x5d0884,_0x3a287a){const _0x586468=a152_0x261771;if(!_0x2379eb)return;if(_0x5d0884['has'](_0x2379eb))return;const _0x57a8d9=_0x2379eb[_0x586468(0x12b)]('/');let _0x58fa84='';for(const _0x47d49c of _0x57a8d9){_0x58fa84=_0x58fa84?_0x58fa84+'/'+_0x47d49c:_0x47d49c,!_0x5d0884[_0x586468(0x1ac)](_0x58fa84)&&_0x3a287a[_0x586468(0x117)](_0x58fa84);}}export function sortFoldersByDepth(_0x398bdc){const _0x5f34cf=a152_0x261771;return[..._0x398bdc][_0x5f34cf(0x144)]((_0x548c35,_0x50395f)=>{const _0x46517d=_0x5f34cf,_0x4f19c3=(_0x548c35[_0x46517d(0x153)](/\//g)||[])[_0x46517d(0x178)],_0x1ed3d9=(_0x50395f[_0x46517d(0x153)](/\//g)||[])['length'];return _0x4f19c3-_0x1ed3d9;});}import*as a152_0x532ddb from'yaml';import{readFileSync}from'fs';import a152_0x4a0113 from'path';import{isJourneyDef,parseYamlString as a152_0x92db47,toYamlString as a152_0x274023,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(_0x2918da){const _0x21593d=a152_0x261771;if(Array['isArray'](_0x2918da))return'['+_0x2918da[_0x21593d(0x15a)](_0x411a1c=>stableStringify(_0x411a1c))[_0x21593d(0x1d5)](',')+']';if(_0x2918da&&typeof _0x2918da===_0x21593d(0x137)){const _0x5c32c4=_0x2918da,_0xcfa1d4=Object[_0x21593d(0x19c)](_0x5c32c4)[_0x21593d(0x144)](),_0x3fa160=_0xcfa1d4[_0x21593d(0x15a)](_0x3d45c4=>'\x22'+_0x3d45c4+'\x22:'+stableStringify(_0x5c32c4[_0x3d45c4]));return'{'+_0x3fa160[_0x21593d(0x1d5)](',')+'}';}const _0x1fd34e=JSON[_0x21593d(0x218)](_0x2918da);return _0x1fd34e===undefined?_0x21593d(0x14f):_0x1fd34e;}function activationSignature(_0x4703c1){const _0x787a8c=a152_0x261771,_0x5ec16e={'connection':_0x4703c1[_0x787a8c(0x1ef)],..._0x4703c1[_0x787a8c(0x17e)]!==undefined&&{'all_columns':_0x4703c1[_0x787a8c(0x17e)]},..._0x4703c1[_0x787a8c(0x1e9)]!==undefined&&{'columns':_0x4703c1['columns']},..._0x4703c1[_0x787a8c(0x168)]!==undefined&&{'behavior':_0x4703c1['behavior']},..._0x4703c1['schedule']!==undefined&&{'schedule':_0x4703c1[_0x787a8c(0x142)]},..._0x4703c1[_0x787a8c(0x194)]!==undefined&&{'notification':_0x4703c1['notification']},..._0x4703c1[_0x787a8c(0x1f2)]!==undefined&&{'connector_config':_0x4703c1[_0x787a8c(0x1f2)]},..._0x4703c1[_0x787a8c(0x20f)]!==undefined&&{'activation_template_id':_0x4703c1[_0x787a8c(0x20f)]}};return stableStringify(_0x5ec16e);}async function fetchSegment(_0x215444,_0x370ab8,_0x58b82a,_0x521f2b){const _0x2f8c91=a152_0x261771,_0x355df3=_0x521f2b?.[_0x2f8c91(0x120)](_0xfbeae2=>_0xfbeae2['id']===_0x58b82a);if(_0x355df3)return _0x355df3;try{return await _0x215444['segment']['getSegment'](_0x370ab8,_0x58b82a);}catch(_0x453490){logger['debug'](_0x2f8c91(0x13e)+_0x58b82a+_0x2f8c91(0x17c)+_0x453490);try{return await _0x215444[_0x2f8c91(0x208)][_0x2f8c91(0x207)](_0x58b82a);}catch(_0xd1c054){return logger[_0x2f8c91(0x121)](_0x2f8c91(0x195)+_0x58b82a+':\x20'+_0xd1c054),null;}}}function recoverSegmentIdsFromPushRecovery(_0x13717a,_0x2dedfb,_0x1946a7){const _0x50b03a=a152_0x261771,_0x4727fd=readPushRecovery(_0x13717a[_0x50b03a(0x140)]);if(_0x4727fd?.['journeyName']===_0x13717a[_0x50b03a(0x1ae)][_0x50b03a(0x1ff)])for(const [_0x24eacc,_0x269f02]of Object[_0x50b03a(0x176)](_0x4727fd[_0x50b03a(0x174)])){const _0xa8f7cf=generateDeterministicJourneySegmentName(_0x13717a[_0x50b03a(0x1ae)]['name'],_0x24eacc);_0x269f02[_0x50b03a(0x1f7)]===_0xa8f7cf&&(_0x2dedfb[_0x50b03a(0x14a)](_0x24eacc,_0x269f02['segmentId']),_0x1946a7['set'](_0x24eacc,_0x269f02['segmentId']));}}async function createOrRecoverEmbeddedSegment(_0x2a51e5,_0x408a8c,_0x4b15ef,_0x33f101){const _0x356d8a=a152_0x261771;let _0x2f9c33;try{_0x2f9c33=await _0x2a51e5['segment'][_0x356d8a(0x204)]({'name':_0x4b15ef[_0x356d8a(0x130)],'description':_0x4b15ef[_0x356d8a(0x11a)],'journeyId':_0x4b15ef[_0x356d8a(0x206)],'rule':_0x33f101(_0x4b15ef[_0x356d8a(0x1d8)],!![]),'countPopulation':!![],'parentFolderId':_0x4b15ef['folderId'],'audienceId':_0x4b15ef[_0x356d8a(0x184)]});}catch(_0x460314){const _0x38743b=_0x460314 instanceof Error&&_0x460314[_0x356d8a(0x17b)][_0x356d8a(0x1ee)](_0x356d8a(0x19e));if(_0x38743b){const _0x26f46d=readPushRecovery(_0x408a8c[_0x356d8a(0x140)]),_0x11253c=_0x26f46d?.['journeyName']===_0x408a8c[_0x356d8a(0x1ae)][_0x356d8a(0x1ff)]?_0x26f46d[_0x356d8a(0x174)][_0x4b15ef[_0x356d8a(0x1c3)]]:undefined;if(_0x11253c?.[_0x356d8a(0x1f7)]===_0x4b15ef[_0x356d8a(0x130)])await _0x2a51e5['segment']['updateSegmentById'](_0x4b15ef[_0x356d8a(0x184)],_0x11253c[_0x356d8a(0x156)],{'description':_0x4b15ef[_0x356d8a(0x11a)],'rule':_0x33f101(_0x4b15ef[_0x356d8a(0x1d8)],!![]),'countPopulation':!![]}),_0x2f9c33=_0x11253c['segmentId'];else throw new SDKError(ErrorCode['SEGMENT_UPDATE_ERROR'],_0x356d8a(0x1ab)+_0x4b15ef['localName']+'\x27\x20already\x20exists\x20on\x20server\x20but\x20cannot\x20be\x20found.\x20'+(_0x356d8a(0x1bb)+_0x408a8c[_0x356d8a(0x140)]['replace'](/([^/]+)$/,_0x356d8a(0x18a))+')\x20')+_0x356d8a(0x1d7),_0x460314);}else throw _0x460314;}return saveSegmentToPushRecovery(_0x408a8c[_0x356d8a(0x140)],_0x408a8c[_0x356d8a(0x1ae)][_0x356d8a(0x1ff)],_0x4b15ef[_0x356d8a(0x1c3)],{'segmentId':_0x2f9c33,'uniqueServerName':_0x4b15ef[_0x356d8a(0x130)],'createdAt':new Date()[_0x356d8a(0x1e4)]()}),_0x2f9c33;}export async function prepareSegmentFiles(_0x25abad,_0x459409,_0x55b501,_0x4fb6a5,_0x1582a3){const _0xb8b9e9=a152_0x261771,{activationDefToCreateRequest:_0x30a64a}=await import(_0xb8b9e9(0x146)),_0x2d34ad=[],_0x1531cc=new Set();for(const {yamlConfig:_0x41ee4a,folderPath:_0x2840a6,sourcePath:_0x52995e}of _0x25abad){const _0x47c0eb=resolveTDFolderPath(_0x2840a6,_0x4fb6a5,_0x1582a3),_0x554fc1=_0x47c0eb+':'+_0x41ee4a[_0xb8b9e9(0x1ff)],_0x530c2f=_0x459409[_0xb8b9e9(0x202)][_0xb8b9e9(0x114)](_0x554fc1),_0x209d53=_0x530c2f?_0x459409['activationsBySegmentId']['get'](_0x530c2f['id'])||[]:[];addFoldersToCreate(_0x47c0eb,_0x459409[_0xb8b9e9(0x1a3)],_0x1531cc);const _0x500ce6=calculateActivationActions(_0x41ee4a[_0xb8b9e9(0x11e)]||[],_0x209d53,_0x459409[_0xb8b9e9(0x1be)],_0x459409[_0xb8b9e9(0x205)]);for(const _0x24bf77 of _0x500ce6){(_0x24bf77[_0xb8b9e9(0x1e5)]===_0xb8b9e9(0x1f3)||_0x24bf77[_0xb8b9e9(0x1e5)]===_0xb8b9e9(0x1b4))&&_0x24bf77[_0xb8b9e9(0x138)]&&(_0x24bf77[_0xb8b9e9(0x129)]=await _0x30a64a(_0x24bf77['yamlActivation'],_0x55b501));}const _0x1bcb9a=calculateSegmentDiff(_0x41ee4a,_0x530c2f,_0x209d53,_0x459409['idToEmailMap'],_0x459409[_0xb8b9e9(0x205)]);_0x2d34ad[_0xb8b9e9(0x1a7)]({'relativePath':_0x41ee4a[_0xb8b9e9(0x1ff)],'absolutePath':_0x52995e,'yamlConfig':_0x41ee4a,'folderPath':_0x47c0eb,'existingSegment':_0x530c2f,'existingActivations':_0x209d53,'isNew':_0x1bcb9a[_0xb8b9e9(0x12d)],'hasChanges':_0x1bcb9a[_0xb8b9e9(0x162)],'diff':_0x1bcb9a['diff'],'activationActions':_0x500ce6});}return{'segmentFiles':_0x2d34ad,'foldersToCreate':_0x1531cc};}export async function prepareJourneyFiles(_0x5bd579,_0x121d57,_0x446f88,_0xd0260a){const _0x3ec0d6=a152_0x261771,_0xd30008=[],_0x59cf53=new Set();for(const {yamlConfig:_0x4cfef0,folderPath:_0x3a162a,sourcePath:_0x2a5f31}of _0x5bd579){const _0x2fd171=resolveTDFolderPath(_0x3a162a,_0x446f88,_0xd0260a),_0x16f5ed=_0x2fd171+':'+_0x4cfef0[_0x3ec0d6(0x1ff)],_0x30780b=_0x121d57[_0x3ec0d6(0x1a6)]['get'](_0x16f5ed);let _0xcf11bb,_0x1c14ee;if(_0x30780b&&_0x30780b['length']>0x0){const _0x299808=buildLocalExpandedRuleMappings(_0x4cfef0),{createYamlContext:_0x172fd8,prefetchJourneySegments:_0x5daad4}=createPushYamlContextForBundle(_0x121d57['deps'],_0x121d57['parentId'],_0x121d57[_0x3ec0d6(0x143)],_0x299808,_0x121d57[_0x3ec0d6(0x1be)],_0x121d57[_0x3ec0d6(0x205)],_0x121d57[_0x3ec0d6(0x148)],_0x121d57[_0x3ec0d6(0x1d3)]);await _0x5daad4(_0x30780b[_0x3ec0d6(0x15a)](_0x25378b=>_0x25378b['id']));const _0x2c00a7=await _0x121d57[_0x3ec0d6(0x127)][_0x3ec0d6(0x165)][_0x3ec0d6(0x12c)](_0x30780b[0x0][_0x3ec0d6(0x128)]),_0x4141c0=hasMultipleVersions(_0x4cfef0),_0x122fbb=async _0x299cc6=>{const _0x5d95cf=_0x3ec0d6,_0x5dfe7a=_0x121d57[_0x5d95cf(0x1d3)]?.[_0x5d95cf(0x114)](_0x299cc6);if(_0x5dfe7a)return _0x5dfe7a;return _0x121d57[_0x5d95cf(0x1eb)]({'journeyId':_0x299cc6,'journeyName':_0x4cfef0[_0x5d95cf(0x1ff)],'isMultiVersion':_0x30780b[_0x5d95cf(0x178)]>0x1});};if(_0x4141c0&&_0x30780b[_0x3ec0d6(0x178)]>0x1){const _0x5c2ccf=[];for(const _0x215e53 of _0x30780b){const _0x562ed9=_0x215e53[_0x3ec0d6(0x11d)]||0x1;_0x121d57[_0x3ec0d6(0x112)]?.[_0x3ec0d6(0x1b4)](_0x3ec0d6(0x1a1)+_0x4cfef0[_0x3ec0d6(0x1ff)]+'\x20v'+_0x562ed9);const _0x5a94e1=await _0x122fbb(_0x215e53['id']),_0x56d718=_0x172fd8(_0x215e53['id']),_0x13889b=await journeyResponseToDef(_0x5a94e1,_0x56d718);_0x5c2ccf[_0x3ec0d6(0x1a7)]({'item':_0x215e53,'yaml':_0x13889b});}const _0x391ef1=buildLocalRuleToNameMappingFromJourney(_0x4cfef0);_0x1c14ee=buildMergedJourneyDef(_0x5c2ccf,_0x391ef1,_0x2c00a7);const _0x378f23=Math[_0x3ec0d6(0x1b3)](..._0x5c2ccf[_0x3ec0d6(0x15a)](_0x231b16=>_0x231b16[_0x3ec0d6(0x18b)][_0x3ec0d6(0x11d)]||0x0)),_0x33cf2b=_0x30780b[_0x3ec0d6(0x120)](_0x1e0cc8=>(_0x1e0cc8[_0x3ec0d6(0x11d)]||0x0)===_0x378f23);_0x33cf2b&&(_0x121d57['progress']?.[_0x3ec0d6(0x1b4)]('Fetching\x20'+_0x4cfef0[_0x3ec0d6(0x1ff)]+'\x20v'+_0x378f23),_0xcf11bb=await _0x122fbb(_0x33cf2b['id']));}else{const _0x14a74c=_0x30780b[_0x30780b[_0x3ec0d6(0x178)]-0x1];_0x121d57[_0x3ec0d6(0x112)]?.[_0x3ec0d6(0x1b4)]('Fetching\x20'+_0x4cfef0[_0x3ec0d6(0x1ff)]),_0xcf11bb=await _0x122fbb(_0x14a74c['id']);const _0x367753=_0x172fd8(_0x14a74c['id']),_0x816ef4=await journeyResponseToDef(_0xcf11bb,_0x367753),_0x18a052=buildLocalRuleToNameMappingFromJourney(_0x4cfef0);_0x1c14ee=buildMergedJourneyDef([{'item':_0x14a74c,'yaml':_0x816ef4}],_0x18a052,_0x2c00a7);}}addFoldersToCreate(_0x2fd171,_0x121d57[_0x3ec0d6(0x1a3)],_0x59cf53);const _0x77eb2a=calculateJourneyDiff(_0x4cfef0,_0x1c14ee);_0xd30008[_0x3ec0d6(0x1a7)]({'relativePath':_0x4cfef0[_0x3ec0d6(0x1ff)],'absolutePath':_0x2a5f31,'yamlConfig':_0x4cfef0,'folderPath':_0x2fd171,'existingJourney':_0xcf11bb,'isNew':_0x77eb2a[_0x3ec0d6(0x12d)],'hasChanges':_0x77eb2a['hasChanges'],'diff':_0x77eb2a[_0x3ec0d6(0x1b6)]});}return{'journeyFiles':_0xd30008,'foldersToCreate':_0x59cf53};}export function calculateActivationActions(_0x4cb376,_0x2a6f2a,_0x329e35,_0xb8f26c){const _0xd54885=a152_0x261771,_0x281309=[],_0x3a2d72=new Map();for(const _0x5bd128 of _0x2a6f2a){_0x3a2d72[_0xd54885(0x14a)](_0x5bd128[_0xd54885(0x1ff)],_0x5bd128);}const _0x19714c=new Map();for(const _0x1a03ce of _0x4cb376){_0x19714c[_0xd54885(0x14a)](_0x1a03ce[_0xd54885(0x1ff)],_0x1a03ce);}for(const _0x438825 of _0x4cb376){const _0x2a700c=_0x3a2d72[_0xd54885(0x114)](_0x438825['name']);if(!_0x2a700c)_0x281309[_0xd54885(0x1a7)]({'type':_0xd54885(0x1f3),'name':_0x438825[_0xd54885(0x1ff)],'yamlActivation':_0x438825});else{const _0x18ed43=activationResponseToDef(_0x2a700c,_0x329e35,_0xb8f26c),_0x28366b=a152_0x532ddb[_0xd54885(0x218)](_0x18ed43),_0xc8335a=a152_0x532ddb[_0xd54885(0x218)](_0x438825);_0x28366b!==_0xc8335a&&_0x281309[_0xd54885(0x1a7)]({'type':_0xd54885(0x1b4),'name':_0x438825[_0xd54885(0x1ff)],'yamlActivation':_0x438825,'existingActivation':_0x2a700c});}}for(const _0x362cfb of _0x2a6f2a){!_0x19714c['has'](_0x362cfb['name'])&&_0x281309['push']({'type':_0xd54885(0x1cb),'name':_0x362cfb[_0xd54885(0x1ff)],'existingActivation':_0x362cfb});}return _0x281309;}function calculateYamlDiff(_0x4c6ce7,_0x539bfc){if(_0x539bfc){const _0x7ce2a4=generateDiff(_0x539bfc,_0x4c6ce7),_0x3ada94=hasChanges(_0x7ce2a4);return{'isNew':![],'hasChanges':_0x3ada94,'diff':_0x3ada94?formatDiffWithColors(_0x7ce2a4):undefined};}const _0x140b00=generateDiff('',_0x4c6ce7);return{'isNew':!![],'hasChanges':![],'diff':formatDiffWithColors(_0x140b00)};}export function calculateSegmentDiff(_0x1f3330,_0x2b09a7,_0x45834d,_0x3ba0e8,_0x203c0f){const _0x3e6d7b=segmentToYamlString(_0x1f3330),_0x524291=_0x2b09a7?segmentToYamlString(segmentWithActivationsToYaml(_0x2b09a7,_0x45834d,undefined,_0x3ba0e8,_0x203c0f)):undefined;return calculateYamlDiff(_0x3e6d7b,_0x524291);}export function calculateJourneyDiff(_0x3c4808,_0x37a7fb){const _0xf67213=normalizeJourneyDef(_0x3c4808,_0x3c4808),_0x259786=a152_0x274023(_0xf67213),_0x2e9a10=_0x37a7fb?a152_0x274023(normalizeJourneyDef(_0x37a7fb,_0x3c4808)):undefined;return calculateYamlDiff(_0x259786,_0x2e9a10);}export function findSegmentsToDelete(_0x12ed0a,_0x3c78fe,_0x3a446,_0xc512f5,_0x4b6f92){const _0x2e59f5=a152_0x261771,_0x49c66d=new Set();for(const {yamlConfig:_0x464b01,folderPath:_0x56da43}of _0x3c78fe){_0x49c66d[_0x2e59f5(0x117)](_0x56da43+':'+_0x464b01[_0x2e59f5(0x1ff)]);}return _0x12ed0a[_0x2e59f5(0x1ad)](_0x403319=>{const _0x3757fb=_0x2e59f5,_0x3d4d11=_0x403319[_0x3757fb(0x1c1)]?_0x3a446[_0x3757fb(0x114)](_0x403319[_0x3757fb(0x1c1)]['toString']())||'':'',_0x5217e6=_0x3d4d11+':'+_0x403319[_0x3757fb(0x1ff)];if(_0x49c66d[_0x3757fb(0x1ac)](_0x5217e6))return![];if(_0x4b6f92)return _0x3d4d11===_0xc512f5||_0x3d4d11[_0x3757fb(0x110)](_0xc512f5+'/');return!![];});}export function findJourneysToDelete(_0x592734,_0x13bb99,_0x36ff24,_0x58dac7,_0x5b164f){const _0xbc8d04=a152_0x261771,_0x3b3d9b=new Set();for(const {yamlConfig:_0x3131c0,folderPath:_0x57154b}of _0x13bb99){_0x3b3d9b[_0xbc8d04(0x117)](_0x57154b+':'+_0x3131c0['name']);}return _0x592734[_0xbc8d04(0x1ad)](_0x5131a5=>{const _0x412a9d=_0xbc8d04,_0x49ea54=_0x5131a5[_0x412a9d(0x169)]?_0x36ff24[_0x412a9d(0x114)](_0x5131a5[_0x412a9d(0x169)])||'':'',_0x2cf4b8=_0x49ea54+':'+_0x5131a5[_0x412a9d(0x1ed)];if(_0x3b3d9b[_0x412a9d(0x1ac)](_0x2cf4b8))return![];if(_0x5b164f)return _0x49ea54===_0x58dac7||_0x49ea54[_0x412a9d(0x110)](_0x58dac7+'/');return!![];});}export function buildSegmentLookupMap(_0x4b7896,_0x22bd80){const _0x1a86e2=a152_0x261771,_0x297d1d=new Map();for(const _0x52641e of _0x4b7896){const _0x16259e=_0x52641e[_0x1a86e2(0x1c1)]?_0x22bd80[_0x1a86e2(0x114)](_0x52641e['segmentFolderId'][_0x1a86e2(0x1ca)]())||'':'',_0x39a992=_0x16259e+':'+_0x52641e['name'];_0x297d1d['set'](_0x39a992,_0x52641e);}return _0x297d1d;}export function buildSegmentNameToIdMap(_0x328d18){const _0x5dbfd7=a152_0x261771,_0x24cbe9=new Map();for(const _0x5671a1 of _0x328d18){_0x24cbe9['set'](_0x5671a1[_0x5dbfd7(0x1ff)],_0x5671a1['id']);}return _0x24cbe9;}export function buildJourneyBundleLookupMap(_0x56aad9,_0x2bd5c8){const _0x1c6dce=a152_0x261771,_0xdc4095=new Map();for(const _0x50ab97 of _0x56aad9){const _0x4296f8=_0x50ab97['folderId']?_0x2bd5c8[_0x1c6dce(0x114)](_0x50ab97[_0x1c6dce(0x169)])||'':'',_0x1d6c0a=_0x4296f8+':'+_0x50ab97[_0x1c6dce(0x1ed)];!_0xdc4095[_0x1c6dce(0x1ac)](_0x1d6c0a)&&_0xdc4095['set'](_0x1d6c0a,[]),_0xdc4095['get'](_0x1d6c0a)[_0x1c6dce(0x1a7)](_0x50ab97);}for(const _0x440ce4 of _0xdc4095['values']()){_0x440ce4[_0x1c6dce(0x144)]((_0x4f2974,_0x152880)=>(_0x4f2974['versionNumber']||0x0)-(_0x152880[_0x1c6dce(0x11d)]||0x0));}return _0xdc4095;}export function collectFoldersToCreate(_0x49090a,_0x210314){const _0x4b1606=a152_0x261771,_0x1fff53=new Set();for(const _0x3469e9 of _0x49090a){if(!_0x3469e9)continue;if(_0x210314[_0x4b1606(0x1ac)](_0x3469e9))continue;const _0x1d47f8=_0x3469e9[_0x4b1606(0x12b)]('/');let _0x3b11b9='';for(const _0x5881b8 of _0x1d47f8){_0x3b11b9=_0x3b11b9?_0x3b11b9+'/'+_0x5881b8:_0x5881b8,!_0x210314[_0x4b1606(0x1ac)](_0x3b11b9)&&_0x1fff53['add'](_0x3b11b9);}}return _0x1fff53;}export function parseAndClassifyYamlFiles(_0x4179ec,_0x340f35,_0x39ef10){const _0x477a96=a152_0x261771,_0xdd1a16=[],_0x317592=[];for(const _0x557d8f of _0x4179ec){const _0x151ace=a152_0x4a0113[_0x477a96(0x157)](_0x340f35,a152_0x4a0113[_0x477a96(0x182)](_0x557d8f)),_0x2cbe09=_0x151ace==='.'?'':_0x151ace,_0x5b37dd=readFileSync(_0x557d8f,'utf-8'),_0x34ddb3=a152_0x532ddb[_0x477a96(0x1d1)](_0x5b37dd);if(isJourneyDef(_0x34ddb3)){const _0x303905=a152_0x92db47(_0x5b37dd);_0x317592['push']({'yamlConfig':_0x303905,'folderPath':_0x2cbe09,'sourcePath':_0x557d8f});}else{if(!_0x39ef10?.[_0x477a96(0x1f5)]){const _0x1df8e7=parseSegmentYamlFile(_0x5b37dd),_0x2629f4=normalizeChildSegmentYaml(_0x1df8e7);_0xdd1a16[_0x477a96(0x1a7)]({'yamlConfig':_0x2629f4,'folderPath':_0x2cbe09,'sourcePath':_0x557d8f});}}}return{'segments':_0xdd1a16,'journeys':_0x317592};}export function validateParsedFiles(_0x362b59,_0x411c15){const _0x378c45=a152_0x261771,_0x292989=[];for(const {yamlConfig:_0x119ce3,sourcePath:_0xccfa1b}of _0x362b59[_0x378c45(0x174)]){const _0x1c9e07=readFileSync(_0xccfa1b,_0x378c45(0x111)),_0x65c5a0=a152_0x532ddb[_0x378c45(0x15c)](_0x1c9e07),_0x553529=validateSegmentDef(_0x119ce3,{'source':_0x1c9e07,'document':_0x65c5a0},{'skipSchema':!![]});if(!_0x553529[_0x378c45(0x135)]){const _0x2345f9=a152_0x4a0113['relative'](_0x411c15,_0xccfa1b);_0x292989[_0x378c45(0x1a7)]({'filePath':_0x2345f9,'source':_0x1c9e07,'result':_0x553529,'isJourney':![]});}}for(const {yamlConfig:_0x472475,sourcePath:_0x360352}of _0x362b59['journeys']){const _0x194b68=readFileSync(_0x360352,_0x378c45(0x111)),_0x19aaf7=a152_0x532ddb[_0x378c45(0x15c)](_0x194b68),_0x7ca5e7=validateJourneyDef(_0x472475,{'source':_0x194b68,'document':_0x19aaf7},{'skipSchema':!![]});if(!_0x7ca5e7['valid']){const _0x8705af=a152_0x4a0113['relative'](_0x411c15,_0x360352);_0x292989[_0x378c45(0x1a7)]({'filePath':_0x8705af,'source':_0x194b68,'result':_0x7ca5e7,'isJourney':!![]});}}return _0x292989;}export function formatValidationErrors(_0x291310){const _0x5ce671=a152_0x261771,_0x3c8383=[];for(const {filePath:_0x3c21f8,source:_0x54feb0,result:_0x36038a,isJourney:_0x2952e6}of _0x291310){const _0x2152e5=_0x2952e6?_0x5ce671(0x165):_0x5ce671(0x208);_0x3c8383['push']('\x0a'+_0x3c21f8+'\x20('+_0x2152e5+_0x5ce671(0x139)+_0x36038a['errors']['length']+_0x5ce671(0x15e)),_0x3c8383[_0x5ce671(0x1a7)](formatValidationResult(_0x36038a,_0x54feb0,_0x3c21f8));}return _0x3c8383['join']('\x0a');}export function buildLocalExpandedRuleMappings(_0xacdcc6){const _0x2e7a30=a152_0x261771,_0x1aabfa=new Set(),_0x1ef687=new Map(),_0xeac6ca=collectSegmentUsageCounts(_0xacdcc6);if(_0xacdcc6['segments'])for(const [_0x3ac8fa,_0x4fbd24]of Object['entries'](_0xacdcc6[_0x2e7a30(0x174)])){_0x1aabfa['add'](_0x3ac8fa);if(_0x4fbd24[_0x2e7a30(0x16a)]){const _0x5f0ec0=yamlRuleToApi(_0x4fbd24['rule']),_0x341b0e=apiRuleToYaml(_0x5f0ec0);_0x1ef687['set'](_0x3ac8fa,_0x341b0e);}}const _0x30983f=new Map();let _0x5b8190=0x0;for(const [_0x378905,_0x7f226]of _0x1ef687){const _0xed2449=serializeExpandedRule(_0x7f226,_0x1ef687),_0x1e7917=_0x30983f[_0x2e7a30(0x114)](_0xed2449)||[];_0x1e7917['push']({'name':_0x378905,'index':_0x5b8190}),_0x30983f['set'](_0xed2449,_0x1e7917),_0x5b8190++;}const _0x205b77=new Map();for(const [_0x5a1026,_0xee4014]of _0x30983f){const _0x52c1dc=_0xee4014[_0x2e7a30(0x18c)]()[_0x2e7a30(0x144)]((_0x20c43e,_0x817cb6)=>{const _0x3a672d=_0x2e7a30,_0x3d45c8=_0xeac6ca[_0x3a672d(0x114)](_0x20c43e[_0x3a672d(0x1ff)])||0x0,_0xf7f4b3=_0xeac6ca['get'](_0x817cb6[_0x3a672d(0x1ff)])||0x0;if(_0x3d45c8!==_0xf7f4b3)return _0xf7f4b3-_0x3d45c8;return _0x20c43e[_0x3a672d(0x189)]-_0x817cb6[_0x3a672d(0x189)];})['map'](_0x31e40c=>_0x31e40c['name']),_0x1d9174=[];for(const _0x94a58 of _0x52c1dc){const _0x5609b9=_0xeac6ca['get'](_0x94a58)||0x0,_0x3d07fc=Math[_0x2e7a30(0x1b3)](_0x5609b9,0x1);for(let _0x1c59f1=0x0;_0x1c59f1<_0x3d07fc;_0x1c59f1++){_0x1d9174[_0x2e7a30(0x1a7)](_0x94a58);}}_0x205b77[_0x2e7a30(0x14a)](_0x5a1026,_0x1d9174);}return{'existingLocalSegmentNames':_0x1aabfa,'localSegmentRules':_0x1ef687,'localExpandedRuleToNames':_0x205b77};}export function createSegmentIdResolver(_0xeaefc,_0x2bcfd6){return async _0x209b37=>{const _0x1209ec=a152_0x57f8,_0x32bcd0=_0xeaefc[_0x1209ec(0x114)](_0x209b37);if(!_0x32bcd0)throw new SDKError(ErrorCode['SEGMENT_NOT_FOUND'],_0x1209ec(0x18d)+_0x209b37+'\x20(referenced\x20in\x20embedded\x20segment\x20\x27'+_0x2bcfd6+'\x27)');return _0x32bcd0;};}export function extractRootFolderId(_0x496759){const _0x1ebafe=a152_0x261771;return _0x496759[_0x1ebafe(0x170)]?.[_0x1ebafe(0x167)]?.[_0x1ebafe(0x164)]?.['id']||_0x496759[_0x1ebafe(0x170)]?.[_0x1ebafe(0x1ec)]?.[_0x1ebafe(0x164)]?.['id'];}export function buildConnectionMaps(_0x51159c){const _0x5a5071=a152_0x261771,_0x234ab4=new Map(),_0x501991=new Map(),_0xf9a2eb=new Map();for(const _0x13c62e of _0x51159c){_0x234ab4['set'](_0x13c62e[_0x5a5071(0x1ff)],parseInt(_0x13c62e['id'],0xa)),_0x501991[_0x5a5071(0x14a)](_0x13c62e['id'],_0x13c62e['name']),_0xf9a2eb[_0x5a5071(0x14a)](_0x13c62e['name'],_0x13c62e[_0x5a5071(0x1e5)]);}return{'nameToId':_0x234ab4,'idToName':_0x501991,'nameToType':_0xf9a2eb};}export function calculatePushStats(_0x537d79,_0x252a3b,_0x1d5082,_0x314a79,_0x3ff12f,_0x40e0a7,_0x4a87bb){const _0x33dee2=a152_0x261771,_0x16d4c0=_0x537d79[_0x33dee2(0x1ad)](_0xda916f=>_0xda916f[_0x33dee2(0x12d)]),_0x77925d=_0x537d79[_0x33dee2(0x1ad)](_0x349b2b=>!_0x349b2b[_0x33dee2(0x12d)]&&_0x349b2b[_0x33dee2(0x162)]),_0x2931c8=_0x537d79[_0x33dee2(0x1ad)](_0x1fb3ab=>!_0x1fb3ab[_0x33dee2(0x12d)]&&!_0x1fb3ab['hasChanges']),_0x124f5e=_0x40e0a7?_0x314a79:[],_0x525cb5=_0x252a3b[_0x33dee2(0x1ad)](_0x2548b1=>_0x2548b1[_0x33dee2(0x12d)]),_0x54e485=_0x252a3b[_0x33dee2(0x1ad)](_0x540106=>!_0x540106[_0x33dee2(0x12d)]&&_0x540106[_0x33dee2(0x162)]),_0x1974cf=_0x252a3b['filter'](_0x4dc76b=>!_0x4dc76b[_0x33dee2(0x12d)]&&!_0x4dc76b['hasChanges']),_0x13b394=_0x40e0a7?_0x3ff12f:[],_0x2c96cb=_0x537d79[_0x33dee2(0x213)](_0x2ba467=>_0x2ba467[_0x33dee2(0x1f0)]),_0x34ffc2=_0x2c96cb['filter'](_0x3bd1e2=>_0x3bd1e2[_0x33dee2(0x1e5)]===_0x33dee2(0x1f3)),_0x177532=_0x2c96cb[_0x33dee2(0x1ad)](_0x369eb5=>_0x369eb5[_0x33dee2(0x1e5)]===_0x33dee2(0x1b4)),_0x1bfb56=_0x2c96cb[_0x33dee2(0x1ad)](_0x3297d6=>_0x3297d6[_0x33dee2(0x1e5)]===_0x33dee2(0x1cb)),_0xedfccc=Array['from'](_0x1d5082)[_0x33dee2(0x144)](),_0x1b657d=_0x4a87bb?![]:_0x16d4c0[_0x33dee2(0x178)]>0x0||_0x77925d['length']>0x0||_0x124f5e['length']>0x0,_0x24e023=_0x525cb5['length']>0x0||_0x54e485[_0x33dee2(0x178)]>0x0||_0x13b394[_0x33dee2(0x178)]>0x0,_0x455134=_0x4a87bb?![]:_0x2c96cb[_0x33dee2(0x178)]>0x0,_0x3b2be7=_0xedfccc['length']>0x0;return{'segments':{'new':_0x16d4c0,'changed':_0x77925d,'unchanged':_0x2931c8,'toDelete':_0x124f5e},'journeys':{'new':_0x525cb5,'changed':_0x54e485,'unchanged':_0x1974cf,'toDelete':_0x13b394},'activations':{'all':_0x2c96cb,'toCreate':_0x34ffc2,'toUpdate':_0x177532,'toDelete':_0x1bfb56},'folders':{'toCreate':_0xedfccc},'counts':{'segments':{'new':_0x16d4c0[_0x33dee2(0x178)],'changed':_0x77925d[_0x33dee2(0x178)],'unchanged':_0x2931c8[_0x33dee2(0x178)],'toDelete':_0x124f5e[_0x33dee2(0x178)]},'journeys':{'new':_0x525cb5[_0x33dee2(0x178)],'changed':_0x54e485[_0x33dee2(0x178)],'unchanged':_0x1974cf[_0x33dee2(0x178)],'toDelete':_0x13b394['length']},'activations':{'create':_0x34ffc2[_0x33dee2(0x178)],'update':_0x177532['length'],'delete':_0x1bfb56[_0x33dee2(0x178)]},'folders':_0xedfccc['length']},'hasChanges':_0x1b657d||_0x24e023||_0x455134||_0x3b2be7};}export async function buildPushExecutionContext(_0x28186f,_0x2fa525,_0x3b5b3b,_0x591a61,_0x3a7a34,_0x274fbb){const _0x41912b=a152_0x261771,_0x2fb4be=extractRootFolderId(_0x3b5b3b),{pathToId:_0x220227,idToPath:_0x5eb7fd}=buildFolderMaps(_0x3a7a34),_0x83f459=buildSegmentNameToIdMap(_0x591a61),_0x5a67c1=new Map(),{batchAsync:_0x47cb47}=await import('../../utils/async.js'),[_0x2895a1,_0x17f58a]=await Promise[_0x41912b(0x186)]([_0x28186f[_0x41912b(0x219)][_0x41912b(0x1e7)](),_0x28186f[_0x41912b(0x1ef)][_0x41912b(0x14e)](),((async()=>{const _0x448bff=_0x41912b;!_0x274fbb&&_0x591a61[_0x448bff(0x178)]>0x0&&await _0x47cb47(_0x591a61,async _0x59982c=>{const _0x513c2f=_0x448bff,_0x41114b=await _0x28186f['segment'][_0x513c2f(0x152)](_0x2fa525,_0x59982c['id']);_0x5a67c1[_0x513c2f(0x14a)](_0x59982c['id'],_0x41114b);});})())]),{emailToId:_0x460c7e,idToEmail:_0x20d3b3}=_0x2895a1,_0x1793e0=buildConnectionMaps(_0x17f58a);return{'rootFolderId':_0x2fb4be,'folderPathToId':_0x220227,'folderIdToPath':_0x5eb7fd,'segmentNameToId':_0x83f459,'activationsBySegmentId':_0x5a67c1,'emailToIdMap':_0x460c7e,'idToEmailMap':_0x20d3b3,'connectionNameToIdMap':_0x1793e0[_0x41912b(0x1a8)],'connectionIdToNameMap':_0x1793e0[_0x41912b(0x11c)],'connectionNameToTypeMap':_0x1793e0['nameToType']};}export function createPushYamlContextForBundle(_0x30abfc,_0x2bcffb,_0x2c28e8,_0x2020bc,_0x25e9f0,_0x3546fd,_0x456d62,_0xb9902f){const {existingLocalSegmentNames:_0x179eee,localExpandedRuleToNames:_0x783617}=_0x2020bc,_0x8aba82=new Set(),_0x196e03=new Map(),_0x3ae792=new Map(),_0x3bc40b=new Map(),_0xf7f3cb=createJumpTargetCache(),_0x5562e8=new Map(),_0x222b26=new Map(),_0x272081=new Set();let _0x4c1dac;const _0x1edd44=_0x3896bc=>{const _0x488855={'resolveSegment':async _0x9fa126=>{const _0x51439e=a152_0x57f8,_0x1ecb38=_0x3bc40b[_0x51439e(0x114)](_0x9fa126);if(_0x1ecb38!==undefined)return{'name':_0x1ecb38,'isJourneyLocal':!![]};try{const _0x1865a7=await fetchSegment(_0x30abfc,_0x2bcffb,_0x9fa126,_0x2c28e8);if(!_0x1865a7)throw new Error('Segment\x20not\x20found');const _0x166d26=generateJourneyLocalName(_0x1865a7['name']),_0x31f44c=_0x1865a7[_0x51439e(0x1b1)]===SEGMENT_KIND_JOURNEY&&_0x166d26!==undefined;let _0x5b597f=_0x1865a7['name'],_0x309b76;if(_0x31f44c&&_0x1865a7[_0x51439e(0x16a)]){const _0xb72e98=apiRuleToYaml(_0x1865a7[_0x51439e(0x16a)]);_0x222b26[_0x51439e(0x14a)](_0x9fa126,_0xb72e98);const _0x518591=async _0xf1f11=>{const _0x443a64=_0x51439e,_0x48efe3=collectSegmentRefsFromRule(_0xf1f11);for(const _0x462acb of _0x48efe3){if(!_0x222b26[_0x443a64(0x1ac)](_0x462acb))try{const _0x232f1c=await fetchSegment(_0x30abfc,_0x2bcffb,_0x462acb,_0x2c28e8);if(_0x232f1c?.['rule']){const _0x404554=apiRuleToYaml(_0x232f1c[_0x443a64(0x16a)]);_0x222b26[_0x443a64(0x14a)](_0x462acb,_0x404554),await _0x518591(_0x404554);}}catch(_0x291364){logger[_0x443a64(0x121)](_0x443a64(0x187)+_0x462acb+':\x20'+_0x291364);}}};await _0x518591(_0xb72e98);const _0x4af5b6=serializeExpandedRule(_0xb72e98,_0x222b26),_0x2e5cb4=_0x783617['get'](_0x4af5b6);if(_0x2e5cb4&&_0x2e5cb4[_0x51439e(0x178)]>0x0){const _0x411753=_0x196e03[_0x51439e(0x114)](_0x4af5b6)||0x0,_0x32b179=_0x2e5cb4[_0x411753]||_0x2e5cb4[_0x2e5cb4[_0x51439e(0x178)]-0x1];_0x196e03[_0x51439e(0x14a)](_0x4af5b6,_0x411753+0x1),_0x5b597f=_0x32b179,_0x8aba82[_0x51439e(0x117)](_0x5b597f),_0x3bc40b[_0x51439e(0x14a)](_0x9fa126,_0x5b597f);const _0x2bcc48=await resolveRuleSegmentRefs(_0xb72e98,async _0x17d3aa=>{const _0x595257=_0x51439e,_0x1fd8b0=_0x3bc40b['get'](_0x17d3aa);if(_0x1fd8b0)return _0x1fd8b0;const _0x33bc5b=await _0x4c1dac[_0x595257(0x1aa)](_0x17d3aa);return _0x33bc5b[_0x595257(0x1ff)];});_0x309b76={'description':_0x1865a7[_0x51439e(0x11a)],'rule':_0x2bcc48};}else{const _0x60f62c=_0x5562e8[_0x51439e(0x114)](_0x4af5b6);if(_0x60f62c)_0x5b597f=_0x60f62c,_0x3bc40b[_0x51439e(0x14a)](_0x9fa126,_0x5b597f);else{if(_0x166d26){let _0x1df5e0=_0x166d26,_0x3ccba5=0x2;while(_0x8aba82[_0x51439e(0x1ac)](_0x1df5e0)||_0x179eee[_0x51439e(0x1ac)](_0x1df5e0)){_0x1df5e0=_0x166d26+'_'+_0x3ccba5,_0x3ccba5++;}_0x8aba82[_0x51439e(0x117)](_0x1df5e0),_0x5b597f=_0x1df5e0;}_0x3bc40b['set'](_0x9fa126,_0x5b597f),_0x5562e8[_0x51439e(0x14a)](_0x4af5b6,_0x5b597f);const _0xed130c=await resolveRuleSegmentRefs(_0xb72e98,async _0x157744=>{const _0x3c1593=_0x51439e,_0x3a6c00=_0x3bc40b[_0x3c1593(0x114)](_0x157744);if(_0x3a6c00)return _0x3a6c00;const _0x41c47f=await _0x4c1dac['resolveSegment'](_0x157744);return _0x41c47f['name'];});_0x309b76={'description':_0x1865a7['description'],'rule':_0xed130c};}}}return{'name':_0x5b597f,'isJourneyLocal':_0x31f44c,'definition':_0x309b76};}catch(_0x27e306){return logger[_0x51439e(0x121)](_0x51439e(0x17f)+_0x9fa126+':\x20'+_0x27e306),{'name':_0x9fa126,'isJourneyLocal':![]};}},'resolveActivation':async _0x547999=>{const _0x1dfae2=a152_0x57f8,_0x55ce07=_0x3ae792[_0x1dfae2(0x114)](_0x547999);if(_0x55ce07!==undefined)return{'name':_0x55ce07,'isJourneyLocal':!![]};try{let _0x38beb8=_0x456d62?.[_0x1dfae2(0x114)](_0x547999);!_0x38beb8&&(_0x38beb8=await _0x30abfc[_0x1dfae2(0x165)][_0x1dfae2(0x133)](_0x3896bc,_0x547999));const _0x38e281=_0x38beb8['attributes'][_0x1dfae2(0x141)][_0x1dfae2(0x1ff)]||_0x547999,_0xaef879=sanitizeYamlKey(_0x38e281)||'activation_'+_0x547999,_0x357a73=_0xaef879;_0x3ae792['set'](_0x547999,_0x357a73);const _0x2632de=journeyActivationStepToYaml(_0x38beb8,_0x25e9f0,_0x3546fd);return{'name':_0x357a73,'isJourneyLocal':!![],'definition':_0x2632de};}catch(_0x532072){return logger[_0x1dfae2(0x121)](_0x1dfae2(0x20d)+_0x547999+':\x20'+_0x532072),{'name':_0x547999,'isJourneyLocal':![]};}},'resolveJumpTarget':(_0x4ca894,_0x40e96f)=>resolveJumpTarget(_0x4ca894,_0x40e96f,_0xf7f3cb,async _0x5a5c00=>{const _0x3be0c4=a152_0x57f8,_0x5b6cb5=_0xb9902f?.[_0x3be0c4(0x114)](_0x5a5c00);if(_0x5b6cb5)return _0x5b6cb5;return _0x30abfc[_0x3be0c4(0x165)][_0x3be0c4(0x1a9)](_0x5a5c00);})};return _0x4c1dac=_0x488855,_0x488855;},_0x255e1c=async _0x47843b=>{const _0x5d4eac=a152_0x57f8,{collectSegmentIdsFromJourneyApi:_0x5f70e6}=await import('./journey-yaml.js'),{batchAsync:_0x55856d}=await import(_0x5d4eac(0x1e3)),_0x179a30=new Set();for(const _0x431eb7 of _0x47843b){let _0x120c09=_0xb9902f?.[_0x5d4eac(0x114)](_0x431eb7);!_0x120c09&&(_0x120c09=await _0x30abfc[_0x5d4eac(0x165)]['getJourney'](_0x431eb7));const _0x4dd059=_0x5f70e6(_0x120c09);for(const _0x44f182 of _0x4dd059){_0x179a30[_0x5d4eac(0x117)](_0x44f182);}}let _0x1ddc39=Array[_0x5d4eac(0x1f4)](_0x179a30);while(_0x1ddc39[_0x5d4eac(0x178)]>0x0){const _0xb86abb=_0x1ddc39['filter'](_0x944466=>!_0x272081[_0x5d4eac(0x1ac)](_0x944466));if(_0xb86abb[_0x5d4eac(0x178)]===0x0)break;const _0x2647bd=await _0x55856d(_0xb86abb,async _0x1fa755=>{const _0x51a862=_0x5d4eac;_0x272081[_0x51a862(0x117)](_0x1fa755);const _0x4d9678=await fetchSegment(_0x30abfc,_0x2bcffb,_0x1fa755,_0x2c28e8);if(!_0x4d9678)return null;return{'segmentId':_0x1fa755,'segment':_0x4d9678};},0xa),_0x4e83a8=new Set();for(const _0x2f57be of _0x2647bd){if(!_0x2f57be?.[_0x5d4eac(0x208)]?.[_0x5d4eac(0x16a)])continue;const _0x276231=apiRuleToYaml(_0x2f57be[_0x5d4eac(0x208)][_0x5d4eac(0x16a)]);_0x222b26[_0x5d4eac(0x14a)](_0x2f57be[_0x5d4eac(0x156)],_0x276231);const _0x127f5e=collectSegmentRefsFromRule(_0x276231);for(const _0x17686b of _0x127f5e){!_0x272081[_0x5d4eac(0x1ac)](_0x17686b)&&_0x4e83a8[_0x5d4eac(0x117)](_0x17686b);}}_0x1ddc39=Array[_0x5d4eac(0x1f4)](_0x4e83a8);}};return{'createYamlContext':_0x1edd44,'prefetchJourneySegments':_0x255e1c};}export async function executePushSegments(_0xa38847,_0x5853b0,_0x25442c,_0x2a6c48,_0x178bed){const _0x35401d=a152_0x261771,{segmentDefToCreateRequest:_0x545faf,segmentDefToUpdateRequest:_0x35710b}=await import(_0x35401d(0x146)),_0x2c726e=_0x25442c[_0x35401d(0x1a3)],_0x550740=0x5,_0x4af20f=async _0x43122c=>{const _0x2e57c9=_0x35401d,_0x12048b=_0x43122c[_0x2e57c9(0x1c6)]?_0x2c726e['get'](_0x43122c['folderPath']):undefined;let _0x46544a;const _0x4ec16b={'created':0x0,'updated':0x0,'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};let _0xb3cd26=_0x43122c[_0x2e57c9(0x1ae)];if(_0x43122c[_0x2e57c9(0x1ae)][_0x2e57c9(0x16a)]){const _0x42f36d=createSegmentIdResolver(_0x25442c[_0x2e57c9(0x1cc)],_0x43122c['yamlConfig'][_0x2e57c9(0x1ff)]),_0x48cf30=await resolveRuleSegmentIds(_0x43122c['yamlConfig']['rule'],_0x42f36d);_0xb3cd26={..._0x43122c[_0x2e57c9(0x1ae)],'rule':_0x48cf30};}try{if(_0x43122c[_0x2e57c9(0x12d)]){_0x178bed[_0x2e57c9(0x161)]?.({'type':_0x2e57c9(0x1bc),'name':_0x43122c[_0x2e57c9(0x1ae)][_0x2e57c9(0x1ff)]});const _0x1eb906=_0x545faf(_0xb3cd26,_0x12048b),_0x46a708=await _0x178bed[_0x2e57c9(0x197)](_0x2e57c9(0x136)+_0x43122c[_0x2e57c9(0x1ae)][_0x2e57c9(0x1ff)]+_0x2e57c9(0x12f),()=>_0xa38847[_0x2e57c9(0x208)][_0x2e57c9(0x1d0)](_0x2a6c48[_0x2e57c9(0x184)],_0x1eb906));_0x46544a=_0x46a708[_0x2e57c9(0x164)]['id'],_0x25442c['segmentNameToId']['set'](_0x43122c['yamlConfig'][_0x2e57c9(0x1ff)],_0x46544a),_0x4ec16b[_0x2e57c9(0x1b0)]={'name':_0x43122c['yamlConfig']['name'],'id':_0x46544a},_0x178bed[_0x2e57c9(0x161)]?.({'type':_0x2e57c9(0x1c7),'name':_0x43122c[_0x2e57c9(0x1ae)][_0x2e57c9(0x1ff)],'segmentId':_0x46544a}),_0x178bed[_0x2e57c9(0x1cd)]?.(_0x2e57c9(0x1f1)+_0x43122c[_0x2e57c9(0x1ae)]['name']+'\x27'),_0x4ec16b[_0x2e57c9(0x1da)]=0x1;}else{if(_0x43122c['hasChanges']){_0x178bed[_0x2e57c9(0x161)]?.({'type':_0x2e57c9(0x17d),'name':_0x43122c[_0x2e57c9(0x1ae)][_0x2e57c9(0x1ff)]});const _0x58ecc0=_0x35710b(_0xb3cd26);_0x12048b!==_0x43122c['existingSegment']?.[_0x2e57c9(0x1c1)]&&(_0x58ecc0[_0x2e57c9(0x1c1)]=_0x12048b?parseInt(_0x12048b,0xa):undefined),await _0x178bed[_0x2e57c9(0x197)](_0x2e57c9(0x13c)+_0x43122c['yamlConfig'][_0x2e57c9(0x1ff)]+_0x2e57c9(0x12f),()=>_0xa38847[_0x2e57c9(0x208)][_0x2e57c9(0x15b)](_0x2a6c48['parentId'],_0x43122c[_0x2e57c9(0x19b)]['id'],_0x58ecc0)),_0x46544a=_0x43122c['existingSegment']['id'],_0x178bed[_0x2e57c9(0x161)]?.({'type':_0x2e57c9(0x1b8),'name':_0x43122c['yamlConfig'][_0x2e57c9(0x1ff)]}),_0x178bed[_0x2e57c9(0x1cd)]?.(_0x2e57c9(0x1fa)+_0x43122c[_0x2e57c9(0x1ae)]['name']+'\x27'),_0x4ec16b['updated']=0x1;}else _0x46544a=_0x43122c[_0x2e57c9(0x19b)]['id'];}}catch(_0xba9256){const _0xcf148d=isHttp400Error(_0xba9256),_0x557bab=_0xcf148d?ErrorCode[_0x2e57c9(0x1ce)]:ErrorCode[_0x2e57c9(0x1fb)],_0x3397b9=getErrorMessage(_0xba9256);throw new SDKError(_0x557bab,_0x2e57c9(0x1c2)+(_0x43122c['isNew']?_0x2e57c9(0x1f3):_0x2e57c9(0x1b4))+_0x2e57c9(0x1f9)+_0x43122c[_0x2e57c9(0x140)]+_0x2e57c9(0x196)+_0x3397b9,_0xba9256);}try{const _0x487714=await syncActivationsForSegment(_0xa38847,_0x2a6c48[_0x2e57c9(0x184)],_0x46544a,_0x43122c['yamlConfig'][_0x2e57c9(0x1ff)],_0x43122c[_0x2e57c9(0x1f0)],_0x178bed,_0x43122c[_0x2e57c9(0x140)]);_0x4ec16b['activations']=_0x487714;}catch(_0x40532d){if(_0x40532d instanceof SDKError)throw _0x40532d;throw new SDKError(ErrorCode[_0x2e57c9(0x193)],_0x2e57c9(0x1c0)+_0x43122c['yamlConfig'][_0x2e57c9(0x1ff)]+_0x2e57c9(0x20b)+_0x43122c[_0x2e57c9(0x140)]+_0x2e57c9(0x196)+getErrorMessage(_0x40532d),_0x40532d);}return _0x4ec16b;},_0x1ab390=await batchAsync(_0x5853b0,_0x4af20f,_0x550740),_0x538135={'created':0x0,'updated':0x0,'deleted':0x0,'createdSegmentIds':new Map(),'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};for(const _0x25eb32 of _0x1ab390){_0x538135[_0x35401d(0x1da)]+=_0x25eb32[_0x35401d(0x1da)],_0x538135[_0x35401d(0x1b9)]+=_0x25eb32[_0x35401d(0x1b9)],_0x25eb32[_0x35401d(0x1b0)]&&_0x538135[_0x35401d(0x119)][_0x35401d(0x14a)](_0x25eb32['createdSegmentId']['name'],_0x25eb32[_0x35401d(0x1b0)]['id']),_0x538135[_0x35401d(0x11e)][_0x35401d(0x1da)]+=_0x25eb32[_0x35401d(0x11e)][_0x35401d(0x1da)],_0x538135[_0x35401d(0x11e)]['updated']+=_0x25eb32[_0x35401d(0x11e)][_0x35401d(0x1b9)],_0x538135[_0x35401d(0x11e)][_0x35401d(0x1c4)]+=_0x25eb32[_0x35401d(0x11e)]['deleted'];}return _0x538135;}async function syncActivationsForSegment(_0x42d97e,_0x3a6af3,_0x5d98af,_0x5c08ba,_0x30a749,_0x4a18d7,_0x510d96){const _0x10bf59=a152_0x261771,_0x2ed0ae={'created':0x0,'updated':0x0,'deleted':0x0};for(const _0x361e60 of _0x30a749){try{if(_0x361e60[_0x10bf59(0x1e5)]===_0x10bf59(0x1f3)&&_0x361e60['validatedRequest'])_0x4a18d7[_0x10bf59(0x161)]?.({'type':_0x10bf59(0x1dc),'segmentName':_0x5c08ba,'activationName':_0x361e60['name']}),await _0x4a18d7['withProgress'](_0x10bf59(0x11f)+_0x361e60[_0x10bf59(0x1ff)]+_0x10bf59(0x12f),()=>_0x42d97e[_0x10bf59(0x208)][_0x10bf59(0x122)](_0x3a6af3,_0x5d98af,_0x361e60[_0x10bf59(0x129)])),_0x4a18d7[_0x10bf59(0x161)]?.({'type':_0x10bf59(0x1e6),'segmentName':_0x5c08ba,'activationName':_0x361e60[_0x10bf59(0x1ff)]}),_0x4a18d7[_0x10bf59(0x1cd)]?.('Created\x20activation\x20\x27'+_0x361e60['name']+'\x27'),_0x2ed0ae[_0x10bf59(0x1da)]++;else{if(_0x361e60[_0x10bf59(0x1e5)]==='update'&&_0x361e60[_0x10bf59(0x129)]&&_0x361e60[_0x10bf59(0x172)])_0x4a18d7[_0x10bf59(0x161)]?.({'type':_0x10bf59(0x214),'segmentName':_0x5c08ba,'activationName':_0x361e60[_0x10bf59(0x1ff)]}),await _0x4a18d7['withProgress'](_0x10bf59(0x191)+_0x361e60[_0x10bf59(0x1ff)]+_0x10bf59(0x12f),()=>_0x42d97e[_0x10bf59(0x208)][_0x10bf59(0x149)](_0x3a6af3,_0x5d98af,_0x361e60[_0x10bf59(0x172)]['id'],_0x361e60[_0x10bf59(0x129)])),_0x4a18d7[_0x10bf59(0x161)]?.({'type':_0x10bf59(0x13f),'segmentName':_0x5c08ba,'activationName':_0x361e60[_0x10bf59(0x1ff)]}),_0x4a18d7[_0x10bf59(0x1cd)]?.(_0x10bf59(0x115)+_0x361e60[_0x10bf59(0x1ff)]+'\x27'),_0x2ed0ae[_0x10bf59(0x1b9)]++;else _0x361e60[_0x10bf59(0x1e5)]==='delete'&&_0x361e60[_0x10bf59(0x172)]&&(_0x4a18d7[_0x10bf59(0x161)]?.({'type':'activation_deleting','segmentName':_0x5c08ba,'activationName':_0x361e60['name']}),await _0x4a18d7[_0x10bf59(0x197)]('Deleting\x20activation\x20\x27'+_0x361e60[_0x10bf59(0x1ff)]+_0x10bf59(0x12f),()=>_0x42d97e[_0x10bf59(0x208)][_0x10bf59(0x124)](_0x3a6af3,_0x5d98af,_0x361e60[_0x10bf59(0x172)]['id'])),_0x4a18d7[_0x10bf59(0x161)]?.({'type':_0x10bf59(0x1a2),'segmentName':_0x5c08ba,'activationName':_0x361e60[_0x10bf59(0x1ff)]}),_0x4a18d7[_0x10bf59(0x1a5)]?.('Deleted\x20activation\x20\x27'+_0x361e60[_0x10bf59(0x1ff)]+'\x27'),_0x2ed0ae['deleted']++);}}catch(_0x4e2c8d){const _0x9966e3=isHttp400Error(_0x4e2c8d),_0x358f96=_0x9966e3?ErrorCode['ACTIVATION_SYNTAX_ERROR']:ErrorCode[_0x10bf59(0x193)],_0x2f8d81=getErrorMessage(_0x4e2c8d);throw new SDKError(_0x358f96,'Failed\x20to\x20'+_0x361e60[_0x10bf59(0x1e5)]+'\x20activation\x20\x27'+_0x361e60[_0x10bf59(0x1ff)]+_0x10bf59(0x20b)+_0x510d96+_0x10bf59(0x196)+_0x2f8d81,_0x4e2c8d);}}return _0x2ed0ae;}export async function executePushFolders(_0x37249f,_0x35594c,_0x1ce71b,_0x566506,_0x2e8f37){const _0x300ca5=a152_0x261771,_0x3f03e5=new Map(_0x1ce71b),_0x4645b6=sortFoldersByDepth(_0x35594c);for(const _0x4f0b81 of _0x4645b6){const _0x3caf75=_0x4f0b81['split']('/'),_0xeec225=_0x3caf75[_0x3caf75[_0x300ca5(0x178)]-0x1],_0x5f364c=_0x3caf75[_0x300ca5(0x18c)](0x0,-0x1)[_0x300ca5(0x1d5)]('/'),_0x856e25=_0x3f03e5[_0x300ca5(0x114)](_0x5f364c);_0x2e8f37[_0x300ca5(0x161)]?.({'type':_0x300ca5(0x1c8),'folder':_0x4f0b81});const _0x284292={'name':_0xeec225,'parentFolderId':_0x856e25},_0xe91b7c=await _0x2e8f37[_0x300ca5(0x197)](_0x300ca5(0x183)+_0x4f0b81+_0x300ca5(0x12f),()=>_0x37249f[_0x300ca5(0x208)][_0x300ca5(0x18f)](_0x566506[_0x300ca5(0x184)],_0x284292));_0x3f03e5[_0x300ca5(0x14a)](_0x4f0b81,_0xe91b7c[_0x300ca5(0x164)]['id']),_0x2e8f37[_0x300ca5(0x161)]?.({'type':'folder_created','folder':_0x4f0b81,'folderId':_0xe91b7c[_0x300ca5(0x164)]['id']}),_0x2e8f37['logInfo']?.('Created\x20folder\x20\x27'+_0x4f0b81+'\x27');}return _0x3f03e5;}export async function executePushSegmentDeletions(_0x9d2297,_0x49ee56,_0x4db592){const _0x50265d=a152_0x261771;if(_0x49ee56['length']===0x0)return 0x0;const {batchAsync:_0x148d8d}=await import(_0x50265d(0x1e3)),_0x36fe3d=0x5,_0x11cbd5=await _0x148d8d(_0x49ee56,async _0x1bc894=>{const _0x4aad1d=_0x50265d;return _0x4db592[_0x4aad1d(0x161)]?.({'type':_0x4aad1d(0x1fd),'name':_0x1bc894[_0x4aad1d(0x1ff)]}),await _0x9d2297[_0x4aad1d(0x208)]['deleteSegment'](_0x1bc894['id']),_0x4db592[_0x4aad1d(0x161)]?.({'type':_0x4aad1d(0x20c),'name':_0x1bc894[_0x4aad1d(0x1ff)]}),_0x4db592[_0x4aad1d(0x1a5)]?.('Deleted\x20segment\x20\x27'+_0x1bc894[_0x4aad1d(0x1ff)]+'\x27'),0x1;},_0x36fe3d);return _0x11cbd5[_0x50265d(0x1df)]((_0x2aca61,_0x3c0348)=>_0x2aca61+_0x3c0348,0x0);}export async function executePushJourneys(_0x3209ba,_0x2ec5f2,_0x7166aa,_0x16af00,_0x2da457){const _0x150876=a152_0x261771,{journeyDefToRequest:_0x4de684}=await import(_0x150876(0x158)),{activationDefToCreateRequest:_0x73ab1a,yamlRuleToApi:_0x4383fb,validateSegmentRule:_0x3dcbe4}=await import(_0x150876(0x146)),_0x1fee86={'results':[],'created':0x0,'updated':0x0,'embeddedSegmentNameToId':new Map()},_0x5b998d=new Map(_0x7166aa[_0x150876(0x1cc)]),_0xdaf0d9=0x5;for(let _0x4fde2d=0x0;_0x4fde2d<_0x2ec5f2[_0x150876(0x178)];_0x4fde2d+=_0xdaf0d9){const _0x17d58e=_0x2ec5f2[_0x150876(0x18c)](_0x4fde2d,_0x4fde2d+_0xdaf0d9),_0x5cc0c2=await Promise['all'](_0x17d58e[_0x150876(0x15a)](async _0x57e845=>{const _0xa7df67=_0x150876;if(!_0x57e845[_0xa7df67(0x12d)]&&!_0x57e845['hasChanges'])return{'action':_0xa7df67(0x151),'name':_0x57e845[_0xa7df67(0x1ae)][_0xa7df67(0x1ff)],'journeyId':_0x57e845[_0xa7df67(0x1d4)]?.['id']};const _0x15e834=_0x57e845[_0xa7df67(0x1c6)]?_0x7166aa[_0xa7df67(0x1a3)]['get'](_0x57e845[_0xa7df67(0x1c6)]):undefined;_0x2da457[_0xa7df67(0x161)]?.({'type':_0x57e845[_0xa7df67(0x12d)]?_0xa7df67(0x159):'journey_updating','name':_0x57e845[_0xa7df67(0x1ae)]['name']});try{const _0x3a2264=await executeSingleJourneyPush(_0x3209ba,_0x57e845,{..._0x7166aa,'segmentNameToId':_0x5b998d},{'parentId':_0x16af00[_0xa7df67(0x184)],'rootFolderId':_0x16af00['rootFolderId'],'folderId':_0x15e834,'verbose':_0x16af00[_0xa7df67(0x177)]},_0x2da457,{'journeyDefToRequest':_0x4de684,'activationDefToCreateRequest':_0x73ab1a,'yamlRuleToApi':_0x4383fb,'validateSegmentRule':_0x3dcbe4});for(const [_0x47d204,_0x23f89b]of _0x3a2264[_0xa7df67(0x123)]){_0x5b998d[_0xa7df67(0x14a)](_0x47d204,_0x23f89b),_0x1fee86['embeddedSegmentNameToId'][_0xa7df67(0x14a)](_0x47d204,_0x23f89b);}if(_0x3a2264['action']==='created')_0x2da457[_0xa7df67(0x161)]?.({'type':_0xa7df67(0x116),'name':_0x57e845[_0xa7df67(0x1ae)]['name'],'journeyId':_0x3a2264[_0xa7df67(0x206)]}),_0x2da457[_0xa7df67(0x1cd)]?.(_0xa7df67(0x211)+_0x57e845[_0xa7df67(0x1ae)]['name']+'\x27'),_0x1fee86[_0xa7df67(0x1da)]++;else _0x3a2264[_0xa7df67(0x13b)]===_0xa7df67(0x1b9)&&(_0x2da457[_0xa7df67(0x161)]?.({'type':_0xa7df67(0x1d2),'name':_0x57e845[_0xa7df67(0x1ae)][_0xa7df67(0x1ff)]}),_0x2da457[_0xa7df67(0x1cd)]?.(_0xa7df67(0x201)+_0x57e845['yamlConfig']['name']+'\x27'),_0x1fee86[_0xa7df67(0x1b9)]++);return{'action':_0x3a2264[_0xa7df67(0x13b)],'name':_0x57e845['yamlConfig'][_0xa7df67(0x1ff)],'journeyId':_0x3a2264[_0xa7df67(0x206)]};}catch(_0x42316d){const _0x4641e2=isHttp400Error(_0x42316d),_0x201843=_0x4641e2?ErrorCode[_0xa7df67(0x209)]:ErrorCode[_0xa7df67(0x1b2)],_0x4ed67f=getErrorMessage(_0x42316d);throw new SDKError(_0x201843,'Failed\x20to\x20'+(_0x57e845[_0xa7df67(0x12d)]?_0xa7df67(0x1f3):'update')+_0xa7df67(0x198)+_0x57e845[_0xa7df67(0x140)]+_0xa7df67(0x196)+_0x4ed67f,_0x42316d);}}));_0x1fee86[_0x150876(0x125)][_0x150876(0x1a7)](..._0x5cc0c2);}return _0x1fee86;}async function matchExistingJourneySegments(_0xa18ea2,_0x1c0b47,_0x40228f,_0x5d5a82,_0x114f80){const _0x3df456=a152_0x261771;if(!_0x1c0b47[_0x3df456(0x1d4)]||!_0x1c0b47[_0x3df456(0x1ae)]['segments'])return;const _0xa5d431=new Map(),_0x318acb=new Set();for(const _0x59f55f of Object[_0x3df456(0x19c)](_0x1c0b47[_0x3df456(0x1ae)][_0x3df456(0x174)])){const _0x1ce76d=generateDeterministicJourneySegmentName(_0x1c0b47['yamlConfig'][_0x3df456(0x1ff)],_0x59f55f);_0xa5d431[_0x3df456(0x14a)](_0x1ce76d,_0x59f55f),_0x318acb[_0x3df456(0x117)](_0x59f55f);}const _0x1c5aea=[],_0x386870=collectSegmentIdsFromJourneyApi(_0x1c0b47['existingJourney']);for(const _0x51f49b of _0x386870){const _0x2acf48=await fetchSegment(_0xa18ea2,_0x40228f,_0x51f49b,_0x5d5a82);if(!_0x2acf48?.[_0x3df456(0x1ff)])continue;const _0x4b9dbe=_0xa5d431[_0x3df456(0x114)](_0x2acf48[_0x3df456(0x1ff)]);_0x4b9dbe?(_0x114f80[_0x3df456(0x14a)](_0x4b9dbe,_0x51f49b),_0x318acb['delete'](_0x4b9dbe)):_0x1c5aea['push']({'id':_0x51f49b,'seg':_0x2acf48});}if(_0x318acb[_0x3df456(0x1e0)]>0x0&&_0x1c5aea[_0x3df456(0x178)]>0x0){const {localExpandedRuleToNames:_0x431736}=buildLocalExpandedRuleMappings(_0x1c0b47[_0x3df456(0x1ae)]),_0x387d9e=new Map();for(const {id:_0x139179,seg:_0xb90ec3}of _0x1c5aea){if(_0xb90ec3[_0x3df456(0x16a)]){const _0x57fdb1=apiRuleToYaml(_0xb90ec3[_0x3df456(0x16a)]);_0x387d9e[_0x3df456(0x14a)](_0x139179,_0x57fdb1);}}for(const {id:_0xd6577b,seg:_0x450bdb}of _0x1c5aea){if(!_0x450bdb['rule'])continue;const _0x27755e=_0x387d9e[_0x3df456(0x114)](_0xd6577b);if(!_0x27755e)continue;const _0x4f1b1a=serializeExpandedRule(_0x27755e,_0x387d9e),_0x3fda64=_0x431736['get'](_0x4f1b1a);if(_0x3fda64){const _0x4f21fb=_0x3fda64['find'](_0x9493ea=>_0x318acb[_0x3df456(0x1ac)](_0x9493ea));_0x4f21fb&&(_0x114f80['set'](_0x4f21fb,_0xd6577b),_0x318acb['delete'](_0x4f21fb),logger[_0x3df456(0x121)](_0x3df456(0x16b)+_0x450bdb['name']+_0x3df456(0x173)+_0x4f21fb+_0x3df456(0x212)));}}}}async function executeSingleJourneyPush(_0x19a21d,_0x1a439c,_0xf2e567,_0x3bd906,_0x120832,_0xc71411){const _0x426b95=a152_0x261771,{journeyDefToRequest:_0x519874,activationDefToCreateRequest:_0x181624,yamlRuleToApi:_0x49f28a,validateSegmentRule:_0x46ac96}=_0xc71411,_0xb4cc5f=new Map(),_0xcf0fb8=new Map();recoverSegmentIdsFromPushRecovery(_0x1a439c,_0xb4cc5f,_0xf2e567['segmentNameToId']);const _0x143db3=new Map(),_0x2f2378=new Map(),_0x374188=new Map();let _0x922a6c;const _0x2c0416=async()=>{const _0x9de7eb=a152_0x57f8;if(_0x922a6c)return;_0x922a6c=new Map();if(!_0x1a439c['existingJourney'])return;const _0x44aa6e=await _0x19a21d[_0x9de7eb(0x165)][_0x9de7eb(0x152)](_0x1a439c[_0x9de7eb(0x1d4)]['id']);for(const _0x3d2606 of _0x44aa6e){const _0x32a386=journeyActivationStepToYaml(_0x3d2606,_0xf2e567[_0x9de7eb(0x1be)],_0xf2e567[_0x9de7eb(0x205)]),_0xd301e0=activationSignature(_0x32a386);!_0x922a6c[_0x9de7eb(0x1ac)](_0xd301e0)&&_0x922a6c[_0x9de7eb(0x14a)](_0xd301e0,_0x3d2606['id']),_0x32a386[_0x9de7eb(0x1ff)]&&_0xcf0fb8[_0x9de7eb(0x14a)](_0x32a386['name'],_0x3d2606['id']);}};await matchExistingJourneySegments(_0x19a21d,_0x1a439c,_0x3bd906[_0x426b95(0x184)],_0xf2e567[_0x426b95(0x143)],_0xf2e567[_0x426b95(0x1cc)]);const _0x5e1578={'resolveSegmentId':async _0x123dac=>{const _0x5205dd=_0x426b95,_0x14cf85=_0xf2e567['segmentNameToId']['get'](_0x123dac);if(!_0x14cf85)throw new SDKError(ErrorCode[_0x5205dd(0x1d6)],_0x5205dd(0x18d)+_0x123dac+_0x5205dd(0x1bf)+_0x1a439c[_0x5205dd(0x1ae)][_0x5205dd(0x1ff)]+')');return _0x14cf85;},'resolveEmbeddedSegmentId':async(_0x1e2287,_0x389b4d)=>{const _0x27e2de=_0x426b95,_0x188784=_0xf2e567['segmentNameToId']['get'](_0x1e2287);if(_0x188784)return _0x188784;const _0x17f1c4=_0xf2e567[_0x27e2de(0x143)][_0x27e2de(0x120)](_0x5d8247=>_0x5d8247[_0x27e2de(0x1ff)]===_0x1e2287);if(_0x17f1c4)return _0xf2e567[_0x27e2de(0x1cc)][_0x27e2de(0x14a)](_0x1e2287,_0x17f1c4['id']),_0x17f1c4['id'];if(_0x1a439c[_0x27e2de(0x12d)]){const {stageName:_0x20a618,criteriaName:_0x1ccfe7}=findSegmentCriteriaLocation(_0x1a439c[_0x27e2de(0x1ae)],_0x1e2287);return _0x46ac96(_0x1e2287,_0x389b4d['rule']),_0x2f2378[_0x27e2de(0x14a)](_0x1e2287,{'definition':_0x389b4d,'stageName':_0x20a618,'criteriaName':_0x1ccfe7}),createPendingSegmentId(_0x1e2287);}const _0x5554d4=_0x1a439c[_0x27e2de(0x1d4)]?.['id'];if(!_0x5554d4)throw new SDKError(ErrorCode[_0x27e2de(0x113)],_0x27e2de(0x210));const _0x5f3ba4=_0x143db3[_0x27e2de(0x114)](_0x1e2287);if(_0x5f3ba4)return _0x5f3ba4;const _0x5acd42=((async()=>{const _0x240355=_0x27e2de;_0x46ac96(_0x1e2287,_0x389b4d[_0x240355(0x16a)]);const _0x2c2fc6=generateDeterministicJourneySegmentName(_0x1a439c['yamlConfig']['name'],_0x1e2287),_0x122211=_0xf2e567['existingSegments'][_0x240355(0x120)](_0x3015d7=>_0x3015d7[_0x240355(0x1ff)]===_0x2c2fc6),_0x590647=createSegmentIdResolver(_0xf2e567[_0x240355(0x1cc)],_0x1e2287),_0x2eabf5=await resolveRuleSegmentIds(_0x389b4d['rule'],_0x590647);let _0x35dc57;return _0x122211?(await _0x19a21d['segment']['updateSegmentById'](_0x3bd906['parentId'],_0x122211['id'],{'description':_0x389b4d[_0x240355(0x11a)]||_0x240355(0x175)+_0x1e2287,'rule':_0x49f28a(_0x2eabf5,!![]),'countPopulation':!![]}),_0x35dc57=_0x122211['id'],saveSegmentToPushRecovery(_0x1a439c[_0x240355(0x140)],_0x1a439c[_0x240355(0x1ae)]['name'],_0x1e2287,{'segmentId':_0x35dc57,'uniqueServerName':_0x2c2fc6,'createdAt':new Date()[_0x240355(0x1e4)]()})):_0x35dc57=await createOrRecoverEmbeddedSegment(_0x19a21d,_0x1a439c,{'localName':_0x1e2287,'uniqueSegmentName':_0x2c2fc6,'description':_0x389b4d['description']||'Entry\x20criteria:\x20'+_0x1e2287,'journeyId':_0x5554d4,'resolvedRule':_0x2eabf5,'parentId':_0x3bd906[_0x240355(0x184)],'folderId':_0x3bd906['rootFolderId']||''},_0x49f28a),_0xf2e567['segmentNameToId'][_0x240355(0x14a)](_0x1e2287,_0x35dc57),_0xb4cc5f['set'](_0x1e2287,_0x35dc57),_0x35dc57;})());_0x143db3[_0x27e2de(0x14a)](_0x1e2287,_0x5acd42);try{return await _0x5acd42;}finally{_0x143db3['delete'](_0x1e2287);}},'resolveActivationId':async _0xe6a41f=>{const _0x1cb411=_0x426b95,_0x2fdbde=_0xcf0fb8[_0x1cb411(0x114)](_0xe6a41f);if(_0x2fdbde)return _0x2fdbde;if(_0x1a439c[_0x1cb411(0x1d4)]){await _0x2c0416();const _0x4fcd79=_0xcf0fb8[_0x1cb411(0x114)](_0xe6a41f);if(_0x4fcd79)return _0x4fcd79;}throw new SDKError(ErrorCode[_0x1cb411(0x10f)],_0x1cb411(0x1e1)+_0xe6a41f+_0x1cb411(0x1bf)+_0x1a439c['yamlConfig'][_0x1cb411(0x1ff)]+_0x1cb411(0x16d)+'Define\x20it\x20in\x20the\x20journey\x27s\x20\x27activations\x27\x20section\x20or\x20use\x20an\x20existing\x20activation\x20ID.');},'resolveEmbeddedActivationId':async(_0xbef352,_0x2ccbf3)=>{const _0x1ff152=_0x426b95,_0x1d1382=_0xcf0fb8[_0x1ff152(0x114)](_0xbef352);if(_0x1d1382)return _0x1d1382;if(_0x1a439c['isNew'])return _0x374188['set'](_0xbef352,_0x2ccbf3),createPendingActivationId(_0xbef352);if(_0x1a439c['existingJourney']){await _0x2c0416();const _0x46840c=_0xcf0fb8[_0x1ff152(0x114)](_0x2ccbf3[_0x1ff152(0x1ff)]);if(_0x46840c)return _0xcf0fb8[_0x1ff152(0x14a)](_0xbef352,_0x46840c),_0x46840c;const _0x109e90=activationSignature(_0x2ccbf3),_0x265272=_0x922a6c?.[_0x1ff152(0x114)](_0x109e90);if(_0x265272)return _0xcf0fb8[_0x1ff152(0x14a)](_0xbef352,_0x265272),_0x265272;const _0x409307=await _0x181624(_0x2ccbf3,_0xf2e567['activationContext']),_0x4ab7fc={..._0x409307,..._0x2ccbf3[_0x1ff152(0x18e)]!==undefined&&{'runAfterJourneyRefresh':_0x2ccbf3[_0x1ff152(0x18e)]}},_0x4b27b8=await _0x19a21d[_0x1ff152(0x165)]['createActivation'](_0x1a439c['existingJourney']['id'],_0x4ab7fc);return _0xcf0fb8['set'](_0xbef352,_0x4b27b8['id']),_0x4b27b8['id'];}throw new SDKError(ErrorCode[_0x1ff152(0x113)],_0x1ff152(0x20e));},'resolveJourneyId':async _0xbf3c88=>{const _0x24ff12=_0x426b95;try{return await _0x19a21d[_0x24ff12(0x165)]['resolveJourneyId'](_0x3bd906[_0x24ff12(0x184)],_0xbf3c88);}catch(_0x6b768e){throw new SDKError(ErrorCode[_0x24ff12(0x10f)],'Journey\x20\x27'+_0xbf3c88+_0x24ff12(0x163)+_0x1a439c[_0x24ff12(0x1ae)]['name']+'\x27)',_0x6b768e);}},'resolveStageId':async(_0x275e92,_0x2185a2)=>{const _0x135e82=_0x426b95,_0x5040b4=await _0x19a21d[_0x135e82(0x165)][_0x135e82(0x1a9)](_0x275e92),_0x40f15a=_0x5040b4['attributes'][_0x135e82(0x16f)][_0x135e82(0x120)](_0x27516c=>_0x27516c[_0x135e82(0x1ff)]['toLowerCase']()===_0x2185a2[_0x135e82(0x203)]());if(!_0x40f15a?.['id'])throw new SDKError(ErrorCode[_0x135e82(0x10f)],_0x135e82(0x217)+_0x2185a2+_0x135e82(0x1cf)+(_0x5040b4[_0x135e82(0x145)][_0x135e82(0x1ed)]||_0x5040b4[_0x135e82(0x145)][_0x135e82(0x1ff)])+'\x27');return _0x40f15a['id'];}},_0x21e0e7=await _0x519874(_0x1a439c['yamlConfig'],_0x3bd906[_0x426b95(0x184)],_0x5e1578),_0x26f57b=_0x3bd906[_0x426b95(0x169)]||_0x3bd906[_0x426b95(0x1e2)];_0x26f57b&&(_0x21e0e7[_0x426b95(0x170)]={'parentFolder':{'data':{'id':_0x26f57b,'type':_0x426b95(0x14c)}}});if(_0x1a439c[_0x426b95(0x12d)]){if(_0x2f2378['size']>0x0||_0x374188[_0x426b95(0x1e0)]>0x0)return await executeThreeStepJourneyCreate(_0x19a21d,_0x1a439c,_0x21e0e7,{'pendingEmbeddedSegments':_0x2f2378,'pendingEmbeddedActivations':_0x374188,'embeddedSegmentNameToId':_0xb4cc5f,'journeyActivationNameToId':_0xcf0fb8},{..._0x3bd906,'effectiveFolderId':_0x26f57b},_0xf2e567,_0x120832,_0xc71411);else{ensureJourneyDefaults(_0x21e0e7[_0x426b95(0x145)]);const _0x7e135a=await _0x19a21d[_0x426b95(0x165)][_0x426b95(0x1f3)](_0x21e0e7);return deletePushRecovery(_0x1a439c[_0x426b95(0x140)]),{'action':_0x426b95(0x1da),'journeyId':_0x7e135a['id'],'embeddedSegmentNameToId':_0xb4cc5f};}}else{if(_0x1a439c[_0x426b95(0x162)]&&_0x1a439c[_0x426b95(0x1d4)]){_0x21e0e7['id']=_0x1a439c[_0x426b95(0x1d4)]['id'];const _0x54f245=_0x21e0e7[_0x426b95(0x145)];_0x1a439c[_0x426b95(0x1d4)][_0x426b95(0x145)]?.[_0x426b95(0x1ed)]&&(_0x54f245[_0x426b95(0x1ed)]=_0x1a439c[_0x426b95(0x1d4)]['attributes'][_0x426b95(0x1ed)]);const _0x316851=_0x1a439c[_0x426b95(0x1d4)]['attributes']?.[_0x426b95(0x16f)];return _0x316851&&_0x21e0e7[_0x426b95(0x145)]['journeyStages']&&injectExistingStageIds(_0x21e0e7[_0x426b95(0x145)]['journeyStages'],_0x316851),ensureJourneyDefaults(_0x54f245),await _0x19a21d[_0x426b95(0x165)][_0x426b95(0x1b4)](_0x1a439c['existingJourney']['id'],_0x21e0e7),deletePushRecovery(_0x1a439c[_0x426b95(0x140)]),{'action':'updated','journeyId':_0x1a439c[_0x426b95(0x1d4)]['id'],'embeddedSegmentNameToId':_0xb4cc5f};}}return deletePushRecovery(_0x1a439c[_0x426b95(0x140)]),{'action':_0x426b95(0x151),'journeyId':_0x1a439c[_0x426b95(0x1d4)]?.['id'],'embeddedSegmentNameToId':_0xb4cc5f};}function findSegmentCriteriaLocation(_0x173eb8,_0x2bc54d){const _0x2ccc3f=a152_0x261771,_0x547771=_0x173eb8[_0x2ccc3f(0x188)]||_0x173eb8[_0x2ccc3f(0x181)]?.[0x0]?.[_0x2ccc3f(0x188)]||[];let _0x25ba6d='entry',_0x11d97f=_0x2bc54d;const _0x3ca139=_0x173eb8[_0x2ccc3f(0x1ea)]||_0x173eb8[_0x2ccc3f(0x181)]?.[0x0]?.[_0x2ccc3f(0x1ea)];if(_0x3ca139?.['segment']===_0x2bc54d)return{'stageName':_0x2ccc3f(0x1ea),'criteriaName':_0x3ca139[_0x2ccc3f(0x1ff)]||_0x2bc54d};_0xac3620:for(const _0x3a0623 of _0x547771){if(_0x3a0623[_0x2ccc3f(0x199)]?.[_0x2ccc3f(0x208)]===_0x2bc54d){_0x25ba6d=_0x3a0623['name'],_0x11d97f=_0x3a0623[_0x2ccc3f(0x199)][_0x2ccc3f(0x1ff)]||_0x2bc54d;break;}if(_0x3a0623['steps'])for(const _0x25fc96 of _0x3a0623['steps']){if(_0x25fc96[_0x2ccc3f(0x1e5)]===_0x2ccc3f(0x11b)&&_0x25fc96[_0x2ccc3f(0x1af)]?.[_0x2ccc3f(0x192)])for(const _0x22bb81 of _0x25fc96['with'][_0x2ccc3f(0x192)]){if(_0x22bb81[_0x2ccc3f(0x208)]===_0x2bc54d){_0x25ba6d=_0x3a0623['name'],_0x11d97f=_0x22bb81[_0x2ccc3f(0x1ff)]||_0x2bc54d;break _0xac3620;}}}}return{'stageName':_0x25ba6d,'criteriaName':_0x11d97f};}async function executeThreeStepJourneyCreate(_0x32912d,_0x1eef56,_0x337424,_0x43268e,_0x689fb8,_0x84cec5,_0x320e3c,_0x1af876){const _0x574551=a152_0x261771,{activationDefToCreateRequest:_0x11da17,yamlRuleToApi:_0x50cc76}=_0x1af876,{pendingEmbeddedSegments:_0xf3e3cd,pendingEmbeddedActivations:_0x45fb01,embeddedSegmentNameToId:_0x504154}=_0x43268e,_0x1a38a6=JSON[_0x574551(0x1d1)](JSON['stringify'](_0x337424));ensureJourneyDefaults(_0x1a38a6['attributes']),stripPendingIds(_0x1a38a6);const _0x2f80b0=await _0x32912d[_0x574551(0x165)][_0x574551(0x1f3)](_0x1a38a6),_0x6aaffb=_0x2f80b0['id'],_0xabfe15=new Map();for(const _0x3209fa of _0x2f80b0[_0x574551(0x145)][_0x574551(0x16f)]){_0xabfe15[_0x574551(0x14a)](_0x3209fa[_0x574551(0x1ff)][_0x574551(0x203)](),_0x3209fa['id']);}recoverSegmentIdsFromPushRecovery(_0x1eef56,_0x504154,_0x84cec5[_0x574551(0x1cc)]);for(const [_0x34c715,{definition:_0x2c23db}]of _0xf3e3cd){if(_0x504154[_0x574551(0x1ac)](_0x34c715)){_0x320e3c[_0x574551(0x161)]?.({'type':_0x574551(0x1fe),'journeyName':_0x1eef56['yamlConfig'][_0x574551(0x1ff)],'segmentName':_0x34c715});continue;}const _0x51c174=generateDeterministicJourneySegmentName(_0x1eef56[_0x574551(0x1ae)]['name'],_0x34c715);_0x320e3c[_0x574551(0x161)]?.({'type':_0x574551(0x126),'journeyName':_0x1eef56[_0x574551(0x1ae)][_0x574551(0x1ff)],'segmentName':_0x34c715});const _0x3d8e0e=createSegmentIdResolver(_0x84cec5[_0x574551(0x1cc)],_0x34c715),_0x4f6134=await resolveRuleSegmentIds(_0x2c23db[_0x574551(0x16a)],_0x3d8e0e),_0x14350d=await createOrRecoverEmbeddedSegment(_0x32912d,_0x1eef56,{'localName':_0x34c715,'uniqueSegmentName':_0x51c174,'description':_0x2c23db[_0x574551(0x11a)]||_0x574551(0x175)+_0x34c715,'journeyId':_0x6aaffb,'resolvedRule':_0x4f6134,'parentId':_0x689fb8[_0x574551(0x184)],'folderId':_0x689fb8[_0x574551(0x1f6)]||''},_0x50cc76);_0x504154[_0x574551(0x14a)](_0x34c715,_0x14350d),_0x84cec5[_0x574551(0x1cc)][_0x574551(0x14a)](_0x34c715,_0x14350d),_0x320e3c[_0x574551(0x161)]?.({'type':_0x574551(0x1fe),'journeyName':_0x1eef56[_0x574551(0x1ae)]['name'],'segmentName':_0x34c715});}const _0x694cd8=new Map();for(const [_0x2e27e9,_0x14e0da]of _0x45fb01){_0x320e3c[_0x574551(0x161)]?.({'type':_0x574551(0x118),'journeyName':_0x1eef56[_0x574551(0x1ae)]['name'],'activationName':_0x2e27e9});const _0x24e1fe=await _0x11da17(_0x14e0da,_0x84cec5[_0x574551(0x180)]),_0x4e85cb={..._0x24e1fe,..._0x14e0da[_0x574551(0x18e)]!==undefined&&{'runAfterJourneyRefresh':_0x14e0da[_0x574551(0x18e)]}},_0x335e94=await _0x32912d[_0x574551(0x165)][_0x574551(0x122)](_0x6aaffb,_0x4e85cb);_0x694cd8[_0x574551(0x14a)](_0x2e27e9,_0x335e94['id']),_0x43268e[_0x574551(0x1a0)][_0x574551(0x14a)](_0x2e27e9,_0x335e94['id']),_0x320e3c[_0x574551(0x161)]?.({'type':_0x574551(0x13a),'journeyName':_0x1eef56[_0x574551(0x1ae)][_0x574551(0x1ff)],'activationName':_0x2e27e9});}const _0x2f9eae=JSON['parse'](JSON['stringify'](_0x337424));return _0x2f9eae['id']=_0x6aaffb,ensureJourneyDefaults(_0x2f9eae['attributes']),resolvePendingIdsInRequest(_0x2f9eae,_0x337424,_0xabfe15,_0x504154,_0x694cd8,_0x320e3c),await _0x32912d[_0x574551(0x165)][_0x574551(0x1b4)](_0x6aaffb,_0x2f9eae),deletePushRecovery(_0x1eef56[_0x574551(0x140)]),{'action':_0x574551(0x1da),'journeyId':_0x6aaffb,'embeddedSegmentNameToId':_0x504154};}export function stripWaitStepPendingIds(_0x40ed6a){const _0xecc645=a152_0x261771,_0x12344c=_0x40ed6a[_0xecc645(0x200)]&&isPendingSegmentId(_0x40ed6a[_0xecc645(0x200)]),_0x47404f=_0x40ed6a[_0xecc645(0x14b)]?.['some'](_0x374912=>_0x374912[_0xecc645(0x156)]&&isPendingSegmentId(_0x374912[_0xecc645(0x156)]));(_0x12344c||_0x47404f)&&(_0x40ed6a[_0xecc645(0x19f)]=_0xecc645(0x12e),_0x40ed6a['waitStep']=0x1,_0x40ed6a['waitStepUnit']='day',delete _0x40ed6a['conditionSegmentId'],delete _0x40ed6a[_0xecc645(0x1dd)],delete _0x40ed6a['conditionTimeoutUnit'],delete _0x40ed6a[_0xecc645(0x14b)]);}export function resolveWaitStepPendingIds(_0x33f095,_0x92795d,_0x10ec3e,_0x2e2ad1){const _0x576e83=a152_0x261771;if(_0x92795d[_0x576e83(0x200)]&&isPendingSegmentId(_0x92795d['conditionSegmentId'])){const _0x1a1ba6=_0x10ec3e(_0x92795d[_0x576e83(0x200)],_0x576e83(0x1c9)+_0x2e2ad1+'\x27\x20wait\x20condition');_0x1a1ba6&&(_0x33f095[_0x576e83(0x19f)]=_0x576e83(0x216),_0x33f095[_0x576e83(0x200)]=_0x1a1ba6,delete _0x33f095[_0x576e83(0x14d)],delete _0x33f095[_0x576e83(0x150)],_0x92795d[_0x576e83(0x1dd)]!==undefined&&(_0x33f095['conditionTimeoutDuration']=_0x92795d[_0x576e83(0x1dd)]),_0x92795d[_0x576e83(0x131)]&&(_0x33f095[_0x576e83(0x131)]=_0x92795d[_0x576e83(0x131)]));}if(_0x92795d[_0x576e83(0x14b)]){const _0x48c296=_0x92795d[_0x576e83(0x14b)]['some'](_0x16b267=>_0x16b267[_0x576e83(0x156)]&&isPendingSegmentId(_0x16b267[_0x576e83(0x156)]));if(_0x48c296){const _0x40f723=_0x92795d['conditions']['map'](_0x189672=>{const _0x51adec=_0x576e83;if(_0x189672[_0x51adec(0x156)]&&isPendingSegmentId(_0x189672[_0x51adec(0x156)])){const _0x2d7915=_0x10ec3e(_0x189672[_0x51adec(0x156)],_0x51adec(0x1c9)+_0x2e2ad1+_0x51adec(0x1c5));return{..._0x189672,'segmentId':_0x2d7915||_0x189672[_0x51adec(0x156)]};}return{..._0x189672};});_0x33f095[_0x576e83(0x19f)]=_0x576e83(0x216),_0x33f095[_0x576e83(0x14b)]=_0x40f723,delete _0x33f095[_0x576e83(0x14d)],delete _0x33f095[_0x576e83(0x150)],delete _0x33f095[_0x576e83(0x200)],delete _0x33f095[_0x576e83(0x1dd)],delete _0x33f095[_0x576e83(0x131)];}}}function stripPendingIds(_0x5790d0){const _0x5b3e17=a152_0x261771;_0x5790d0[_0x5b3e17(0x145)]['goal']?.[_0x5b3e17(0x156)]&&isPendingSegmentId(_0x5790d0[_0x5b3e17(0x145)][_0x5b3e17(0x1ea)][_0x5b3e17(0x156)])&&delete _0x5790d0[_0x5b3e17(0x145)][_0x5b3e17(0x1ea)];for(const _0x378b74 of _0x5790d0[_0x5b3e17(0x145)][_0x5b3e17(0x16f)]||[]){_0x378b74[_0x5b3e17(0x134)]?.[_0x5b3e17(0x156)]&&isPendingSegmentId(_0x378b74[_0x5b3e17(0x134)][_0x5b3e17(0x156)])&&delete _0x378b74[_0x5b3e17(0x134)];_0x378b74[_0x5b3e17(0x155)]?.[_0x5b3e17(0x156)]&&isPendingSegmentId(_0x378b74[_0x5b3e17(0x155)][_0x5b3e17(0x156)])&&delete _0x378b74[_0x5b3e17(0x155)];_0x378b74['exitCriterias']&&(_0x378b74[_0x5b3e17(0x13d)]=_0x378b74[_0x5b3e17(0x13d)][_0x5b3e17(0x1ad)](_0x1f2b3b=>!_0x1f2b3b[_0x5b3e17(0x156)]||!isPendingSegmentId(_0x1f2b3b[_0x5b3e17(0x156)])));if(_0x378b74[_0x5b3e17(0x179)])for(const _0x5dbc69 of Object['keys'](_0x378b74[_0x5b3e17(0x179)])){const _0x317c0e=_0x378b74['steps'][_0x5dbc69];_0x317c0e[_0x5b3e17(0x1e5)]==='Activation'&&_0x317c0e[_0x5b3e17(0x1b7)]&&isPendingActivationId(_0x317c0e[_0x5b3e17(0x1b7)])&&(_0x317c0e['journeyActivationStepId']='');if(_0x317c0e[_0x5b3e17(0x1e5)]==='DecisionPoint'&&_0x317c0e['branches'])for(const _0x36d746 of _0x317c0e[_0x5b3e17(0x192)]){_0x36d746[_0x5b3e17(0x156)]&&isPendingSegmentId(_0x36d746[_0x5b3e17(0x156)])&&(_0x36d746['segmentId']='');}_0x317c0e[_0x5b3e17(0x1e5)]===_0x5b3e17(0x1f8)&&stripWaitStepPendingIds(_0x317c0e);}}}function resolvePendingIdsInRequest(_0x4c13c1,_0x181321,_0x142723,_0x5306d4,_0x325128,_0x416e36){const _0x472a9c=a152_0x261771,_0x11dd10=(_0x2e1d87,_0x868850)=>{const _0x159b8e=a152_0x57f8;if(!isPendingSegmentId(_0x2e1d87))return _0x2e1d87;const _0x1895ec=extractPendingSegmentName(_0x2e1d87),_0x3c071c=_0x5306d4[_0x159b8e(0x114)](_0x1895ec);return!_0x3c071c&&_0x416e36[_0x159b8e(0x1bd)]?.(_0x159b8e(0x1e8)+_0x1895ec+_0x159b8e(0x160)+_0x868850),_0x3c071c;};if(_0x4c13c1[_0x472a9c(0x145)][_0x472a9c(0x1ea)]?.[_0x472a9c(0x156)]&&isPendingSegmentId(_0x4c13c1['attributes']['goal'][_0x472a9c(0x156)])){const _0x25c24e=_0x11dd10(_0x4c13c1['attributes']['goal'][_0x472a9c(0x156)],_0x472a9c(0x19d));_0x25c24e&&(_0x4c13c1['attributes']['goal'][_0x472a9c(0x156)]=_0x25c24e);}for(const _0x36faf1 of _0x4c13c1['attributes'][_0x472a9c(0x16f)]||[]){const _0x4e7281=_0x142723[_0x472a9c(0x114)](_0x36faf1[_0x472a9c(0x1ff)]['toLowerCase']());_0x4e7281&&(_0x36faf1['id']=_0x4e7281);if(_0x36faf1[_0x472a9c(0x134)]?.[_0x472a9c(0x156)]&&isPendingSegmentId(_0x36faf1[_0x472a9c(0x134)]['segmentId'])){const _0x3bd31c=_0x11dd10(_0x36faf1[_0x472a9c(0x134)]['segmentId'],_0x472a9c(0x1c9)+_0x36faf1[_0x472a9c(0x1ff)]+'\x27\x20entry\x20criteria');_0x3bd31c&&(_0x36faf1[_0x472a9c(0x134)][_0x472a9c(0x156)]=_0x3bd31c);}if(_0x36faf1[_0x472a9c(0x13d)])for(const _0x1f7888 of _0x36faf1[_0x472a9c(0x13d)]){if(_0x1f7888[_0x472a9c(0x156)]&&isPendingSegmentId(_0x1f7888[_0x472a9c(0x156)])){const _0x303202=_0x11dd10(_0x1f7888['segmentId'],_0x472a9c(0x1c9)+_0x36faf1[_0x472a9c(0x1ff)]+_0x472a9c(0x19a));_0x303202&&(_0x1f7888[_0x472a9c(0x156)]=_0x303202);}}if(_0x36faf1[_0x472a9c(0x155)]?.['segmentId']&&isPendingSegmentId(_0x36faf1['milestone'][_0x472a9c(0x156)])){const _0x22e267=_0x11dd10(_0x36faf1['milestone'][_0x472a9c(0x156)],_0x472a9c(0x1c9)+_0x36faf1['name']+_0x472a9c(0x185));_0x22e267&&(_0x36faf1[_0x472a9c(0x155)][_0x472a9c(0x156)]=_0x22e267);}if(_0x36faf1[_0x472a9c(0x179)]){const _0x1c9099=_0x394c81=>_0x181321[_0x472a9c(0x145)][_0x472a9c(0x16f)]?.[_0x472a9c(0x120)](_0x586cb9=>_0x586cb9[_0x472a9c(0x1ff)][_0x472a9c(0x203)]()===_0x36faf1[_0x472a9c(0x1ff)][_0x472a9c(0x203)]())?.[_0x472a9c(0x179)]?.[_0x394c81];for(const _0x37f07b of Object[_0x472a9c(0x19c)](_0x36faf1[_0x472a9c(0x179)])){const _0x5465ef=_0x36faf1['steps'][_0x37f07b],_0x361a45=_0x1c9099(_0x37f07b);if(_0x5465ef['type']===_0x472a9c(0x1b5)&&_0x5465ef[_0x472a9c(0x1b7)]&&(isPendingActivationId(_0x5465ef[_0x472a9c(0x1b7)])||_0x5465ef['journeyActivationStepId']==='')){if(_0x361a45?.[_0x472a9c(0x1b7)]&&isPendingActivationId(_0x361a45[_0x472a9c(0x1b7)])){const _0x40b8b4=extractPendingActivationName(_0x361a45[_0x472a9c(0x1b7)]),_0x4a1bc6=_0x325128['get'](_0x40b8b4);_0x4a1bc6&&(_0x5465ef[_0x472a9c(0x1b7)]=_0x4a1bc6);}}if(_0x5465ef[_0x472a9c(0x1e5)]===_0x472a9c(0x1d9)&&_0x5465ef[_0x472a9c(0x192)]&&_0x361a45?.[_0x472a9c(0x192)])for(let _0x5ba989=0x0;_0x5ba989<_0x5465ef[_0x472a9c(0x192)][_0x472a9c(0x178)];_0x5ba989++){const _0x4dbaef=_0x5465ef[_0x472a9c(0x192)][_0x5ba989],_0x1cde75=_0x361a45[_0x472a9c(0x192)][_0x5ba989];if(_0x1cde75?.[_0x472a9c(0x156)]&&isPendingSegmentId(_0x1cde75[_0x472a9c(0x156)])){const _0x3ea4d9=_0x11dd10(_0x1cde75[_0x472a9c(0x156)],_0x472a9c(0x1c9)+_0x36faf1[_0x472a9c(0x1ff)]+_0x472a9c(0x215)+(_0x4dbaef[_0x472a9c(0x1ff)]||_0x5ba989)+'\x27');_0x3ea4d9&&(_0x4dbaef[_0x472a9c(0x156)]=_0x3ea4d9);}}_0x5465ef['type']===_0x472a9c(0x1f8)&&_0x361a45?.[_0x472a9c(0x1e5)]===_0x472a9c(0x1f8)&&resolveWaitStepPendingIds(_0x5465ef,_0x361a45,_0x11dd10,_0x36faf1[_0x472a9c(0x1ff)]);}}}}
|
|
1
|
+
const a152_0x59916b=a152_0x54b0;(function(_0x10bf40,_0x5bfdda){const _0x17cb40=a152_0x54b0,_0x2d5e3f=_0x10bf40();while(!![]){try{const _0x1044b0=-parseInt(_0x17cb40(0x212))/0x1*(parseInt(_0x17cb40(0x194))/0x2)+parseInt(_0x17cb40(0x1e3))/0x3+-parseInt(_0x17cb40(0x140))/0x4+-parseInt(_0x17cb40(0x148))/0x5*(-parseInt(_0x17cb40(0x147))/0x6)+-parseInt(_0x17cb40(0x225))/0x7*(-parseInt(_0x17cb40(0x1cb))/0x8)+-parseInt(_0x17cb40(0x15e))/0x9+-parseInt(_0x17cb40(0x1fe))/0xa*(-parseInt(_0x17cb40(0x235))/0xb);if(_0x1044b0===_0x5bfdda)break;else _0x2d5e3f['push'](_0x2d5e3f['shift']());}catch(_0x470ff5){_0x2d5e3f['push'](_0x2d5e3f['shift']());}}}(a152_0x481a,0xc984c));import{createHash}from'crypto';import{Logger}from'../../utils/logger/index.js';function a152_0x54b0(_0x296254,_0x5a0f4d){_0x296254=_0x296254-0x13d;const _0x481afa=a152_0x481a();let _0x54b076=_0x481afa[_0x296254];return _0x54b076;}const logger=Logger['of'](a152_0x59916b(0x1f3));export const PENDING_SEGMENT_PREFIX=a152_0x59916b(0x187);export const PENDING_ACTIVATION_PREFIX=a152_0x59916b(0x207);export function createPendingSegmentId(_0x963781){return''+PENDING_SEGMENT_PREFIX+_0x963781+'__';}export function isPendingSegmentId(_0x3f82cd){const _0x4806ba=a152_0x59916b;return _0x3f82cd[_0x4806ba(0x1d7)](PENDING_SEGMENT_PREFIX)&&!_0x3f82cd[_0x4806ba(0x1d7)](PENDING_ACTIVATION_PREFIX);}export function extractPendingSegmentName(_0x4a6636){const _0x1a4a84=a152_0x59916b;return _0x4a6636[_0x1a4a84(0x221)](/^__pending_(.+)__$/,'$1');}export function createPendingActivationId(_0x455824){return''+PENDING_ACTIVATION_PREFIX+_0x455824+'__';}export function isPendingActivationId(_0x317624){const _0x467439=a152_0x59916b;return _0x317624[_0x467439(0x1d7)](PENDING_ACTIVATION_PREFIX);}export function extractPendingActivationName(_0x4de3e1){return _0x4de3e1['replace'](/^__pending_act_(.+)__$/,'$1');}export function generateDeterministicJourneySegmentName(_0x357e78,_0x3d16be){const _0x3aafb7=a152_0x59916b,_0x5449ab=_0x357e78+'::'+(_0x3d16be['trim']()||_0x3aafb7(0x240)),_0xd4ab46=createHash(_0x3aafb7(0x189))[_0x3aafb7(0x1b1)](_0x5449ab)['digest'](_0x3aafb7(0x14a))['slice'](0x0,0xc);return _0x3aafb7(0x238)+_0xd4ab46;}export function ensureJourneyDefaults(_0x459315){const _0x34772d=a152_0x59916b;!_0x459315[_0x34772d(0x1a3)]&&(_0x459315[_0x34772d(0x1a3)]=''),!_0x459315['state']&&(_0x459315[_0x34772d(0x20f)]=_0x34772d(0x14b));}export function injectExistingStageIds(_0x5d830a,_0x37d077){const _0x4d6f57=a152_0x59916b,_0x5ee23b=new Map(_0x37d077['map'](_0x3b3bb7=>[_0x3b3bb7[_0x4d6f57(0x1ce)],_0x3b3bb7['id']]));for(const _0x413767 of _0x5d830a){if(!_0x413767['id']){const _0x458c4c=_0x5ee23b[_0x4d6f57(0x21c)](_0x413767[_0x4d6f57(0x1ce)]);_0x458c4c&&(_0x413767['id']=_0x458c4c);}}}export function resolveTDFolderPath(_0x4fcad8,_0x4c90b8,_0x5e65ab){const _0xa9eccd=a152_0x59916b;if(!_0x4c90b8)return _0x4fcad8;if(_0x4fcad8===_0x5e65ab||_0x4fcad8[_0xa9eccd(0x1d7)](_0x5e65ab+'/'))return _0x4fcad8;return _0x4fcad8?_0x5e65ab+'/'+_0x4fcad8:_0x5e65ab;}export function addFoldersToCreate(_0xa3c18a,_0x3d8fe1,_0x12d163){const _0x149d5c=a152_0x59916b;if(!_0xa3c18a)return;if(_0x3d8fe1[_0x149d5c(0x145)](_0xa3c18a))return;const _0xf14c94=_0xa3c18a[_0x149d5c(0x1e8)]('/');let _0x4b0215='';for(const _0x4023ba of _0xf14c94){_0x4b0215=_0x4b0215?_0x4b0215+'/'+_0x4023ba:_0x4023ba,!_0x3d8fe1[_0x149d5c(0x145)](_0x4b0215)&&_0x12d163[_0x149d5c(0x180)](_0x4b0215);}}export function sortFoldersByDepth(_0x2dcad3){const _0x5dfd5a=a152_0x59916b;return[..._0x2dcad3][_0x5dfd5a(0x1a1)]((_0x29b06f,_0x277b72)=>{const _0xf1eba0=_0x5dfd5a,_0x54c009=(_0x29b06f['match'](/\//g)||[])[_0xf1eba0(0x1fd)],_0xf9fb25=(_0x277b72[_0xf1eba0(0x1fc)](/\//g)||[])[_0xf1eba0(0x1fd)];return _0x54c009-_0xf9fb25;});}import*as a152_0x329c1f from'yaml';import{readFileSync}from'fs';import a152_0x822047 from'path';import{isJourneyDef,parseYamlString as a152_0x73dd06,toYamlString as a152_0x4934de,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(_0x236e6f){const _0x51f1e4=a152_0x59916b;if(Array[_0x51f1e4(0x188)](_0x236e6f))return'['+_0x236e6f[_0x51f1e4(0x1da)](_0x2c108e=>stableStringify(_0x2c108e))['join'](',')+']';if(_0x236e6f&&typeof _0x236e6f===_0x51f1e4(0x20a)){const _0x5ec5d1=_0x236e6f,_0x220b42=Object[_0x51f1e4(0x141)](_0x5ec5d1)[_0x51f1e4(0x1a1)](),_0x1ae193=_0x220b42[_0x51f1e4(0x1da)](_0x554dce=>'\x22'+_0x554dce+'\x22:'+stableStringify(_0x5ec5d1[_0x554dce]));return'{'+_0x1ae193[_0x51f1e4(0x1d3)](',')+'}';}const _0x23d083=JSON[_0x51f1e4(0x18a)](_0x236e6f);return _0x23d083===undefined?_0x51f1e4(0x23c):_0x23d083;}function activationSignature(_0x33266d){const _0x45b8ff=a152_0x59916b,_0x3ecd1c={'connection':_0x33266d['connection'],..._0x33266d[_0x45b8ff(0x144)]!==undefined&&{'all_columns':_0x33266d[_0x45b8ff(0x144)]},..._0x33266d[_0x45b8ff(0x1c4)]!==undefined&&{'columns':_0x33266d[_0x45b8ff(0x1c4)]},..._0x33266d['behavior']!==undefined&&{'behavior':_0x33266d[_0x45b8ff(0x206)]},..._0x33266d[_0x45b8ff(0x14f)]!==undefined&&{'schedule':_0x33266d['schedule']},..._0x33266d['notification']!==undefined&&{'notification':_0x33266d[_0x45b8ff(0x17b)]},..._0x33266d[_0x45b8ff(0x1e1)]!==undefined&&{'connector_config':_0x33266d[_0x45b8ff(0x1e1)]},..._0x33266d[_0x45b8ff(0x1f2)]!==undefined&&{'activation_template_id':_0x33266d['activation_template_id']}};return stableStringify(_0x3ecd1c);}async function fetchSegment(_0xeb70e7,_0x4cbcc0,_0x281e31,_0x5e1659){const _0x107fab=a152_0x59916b,_0x105f19=_0x5e1659?.[_0x107fab(0x16c)](_0xc19c48=>_0xc19c48['id']===_0x281e31);if(_0x105f19)return _0x105f19;try{return await _0xeb70e7[_0x107fab(0x240)][_0x107fab(0x162)](_0x4cbcc0,_0x281e31);}catch(_0x17a173){logger['debug'](_0x107fab(0x218)+_0x281e31+_0x107fab(0x22b)+_0x17a173);try{return await _0xeb70e7[_0x107fab(0x240)][_0x107fab(0x1a8)](_0x281e31);}catch(_0x1f8d88){return logger['debug'](_0x107fab(0x1c9)+_0x281e31+':\x20'+_0x1f8d88),null;}}}function recoverSegmentIdsFromPushRecovery(_0x3d0926,_0x589c5b,_0x182064){const _0x95ec20=a152_0x59916b,_0x4c8d7c=readPushRecovery(_0x3d0926['absolutePath']);if(_0x4c8d7c?.['journeyName']===_0x3d0926[_0x95ec20(0x245)][_0x95ec20(0x1ce)])for(const [_0x56721d,_0x44d65b]of Object[_0x95ec20(0x199)](_0x4c8d7c[_0x95ec20(0x23d)])){const _0x353e56=generateDeterministicJourneySegmentName(_0x3d0926[_0x95ec20(0x245)][_0x95ec20(0x1ce)],_0x56721d);_0x44d65b['uniqueServerName']===_0x353e56&&(_0x589c5b[_0x95ec20(0x172)](_0x56721d,_0x44d65b[_0x95ec20(0x16d)]),_0x182064[_0x95ec20(0x172)](_0x56721d,_0x44d65b[_0x95ec20(0x16d)]));}}async function createOrRecoverEmbeddedSegment(_0x54f43d,_0x313a32,_0x237c26,_0x34e906){const _0x95549=a152_0x59916b;let _0x5dd774;try{_0x5dd774=await _0x54f43d[_0x95549(0x240)][_0x95549(0x1e7)]({'name':_0x237c26[_0x95549(0x1f5)],'description':_0x237c26[_0x95549(0x1a3)],'journeyId':_0x237c26[_0x95549(0x223)],'rule':_0x34e906(_0x237c26[_0x95549(0x1d4)],!![]),'countPopulation':!![],'parentFolderId':_0x237c26[_0x95549(0x169)],'audienceId':_0x237c26[_0x95549(0x1c5)]});}catch(_0x5eedc3){const _0x12b469=_0x5eedc3 instanceof Error&&_0x5eedc3[_0x95549(0x230)][_0x95549(0x1ec)]('Name\x20has\x20already\x20been\x20taken');if(_0x12b469){const _0x39c126=readPushRecovery(_0x313a32[_0x95549(0x202)]),_0x36a52a=_0x39c126?.[_0x95549(0x1fa)]===_0x313a32[_0x95549(0x245)][_0x95549(0x1ce)]?_0x39c126[_0x95549(0x23d)][_0x237c26[_0x95549(0x1c6)]]:undefined;if(_0x36a52a?.[_0x95549(0x15d)]===_0x237c26['uniqueSegmentName'])await _0x54f43d[_0x95549(0x240)]['updateSegmentById'](_0x237c26[_0x95549(0x1c5)],_0x36a52a[_0x95549(0x16d)],{'description':_0x237c26[_0x95549(0x1a3)],'rule':_0x34e906(_0x237c26[_0x95549(0x1d4)],!![]),'countPopulation':!![]}),_0x5dd774=_0x36a52a[_0x95549(0x16d)];else throw new SDKError(ErrorCode[_0x95549(0x1c3)],_0x95549(0x1a9)+_0x237c26[_0x95549(0x1c6)]+_0x95549(0x1a6)+(_0x95549(0x1be)+_0x313a32[_0x95549(0x202)][_0x95549(0x221)](/([^/]+)$/,_0x95549(0x1cd))+')\x20')+'and\x20the\x20server\x20segment,\x20then\x20retry.',_0x5eedc3);}else throw _0x5eedc3;}return saveSegmentToPushRecovery(_0x313a32[_0x95549(0x202)],_0x313a32[_0x95549(0x245)][_0x95549(0x1ce)],_0x237c26[_0x95549(0x1c6)],{'segmentId':_0x5dd774,'uniqueServerName':_0x237c26['uniqueSegmentName'],'createdAt':new Date()[_0x95549(0x22d)]()}),_0x5dd774;}export async function prepareSegmentFiles(_0x1e6f2e,_0x479c51,_0x1b1c0e,_0x1120d7,_0x3f78d5){const _0x51cd1c=a152_0x59916b,{activationDefToCreateRequest:_0x5957fa}=await import(_0x51cd1c(0x20c)),_0xfbf0a9=[],_0x1184a6=new Set();for(const {yamlConfig:_0x493108,folderPath:_0x1ce061,sourcePath:_0x4d14c3}of _0x1e6f2e){const _0xe33ee6=resolveTDFolderPath(_0x1ce061,_0x1120d7,_0x3f78d5),_0x1abf0f=_0xe33ee6+':'+_0x493108[_0x51cd1c(0x1ce)],_0x433b5a=_0x479c51[_0x51cd1c(0x1a0)][_0x51cd1c(0x21c)](_0x1abf0f),_0x4a47ea=_0x433b5a?_0x479c51[_0x51cd1c(0x1db)][_0x51cd1c(0x21c)](_0x433b5a['id'])||[]:[];addFoldersToCreate(_0xe33ee6,_0x479c51[_0x51cd1c(0x1b0)],_0x1184a6);const _0x9b81a=calculateActivationActions(_0x493108[_0x51cd1c(0x1df)]||[],_0x4a47ea,_0x479c51['idToEmailMap'],_0x479c51[_0x51cd1c(0x247)]);for(const _0x538d18 of _0x9b81a){(_0x538d18['type']==='create'||_0x538d18['type']===_0x51cd1c(0x1b1))&&_0x538d18[_0x51cd1c(0x1b4)]&&(_0x538d18[_0x51cd1c(0x152)]=await _0x5957fa(_0x538d18[_0x51cd1c(0x1b4)],_0x1b1c0e));}const _0x48e44e=calculateSegmentDiff(_0x493108,_0x433b5a,_0x4a47ea,_0x479c51['idToEmailMap'],_0x479c51[_0x51cd1c(0x247)]);_0xfbf0a9[_0x51cd1c(0x1ae)]({'relativePath':_0x493108[_0x51cd1c(0x1ce)],'absolutePath':_0x4d14c3,'yamlConfig':_0x493108,'folderPath':_0xe33ee6,'existingSegment':_0x433b5a,'existingActivations':_0x4a47ea,'isNew':_0x48e44e[_0x51cd1c(0x190)],'hasChanges':_0x48e44e[_0x51cd1c(0x1f7)],'diff':_0x48e44e[_0x51cd1c(0x231)],'activationActions':_0x9b81a});}return{'segmentFiles':_0xfbf0a9,'foldersToCreate':_0x1184a6};}export async function prepareJourneyFiles(_0x25738e,_0x2e471d,_0x4245b8,_0xd0790f){const _0xc080cc=a152_0x59916b,_0x5a0999=[],_0x529873=new Set();for(const {yamlConfig:_0x5c9937,folderPath:_0x461e16,sourcePath:_0x443e42}of _0x25738e){const _0x3b8166=resolveTDFolderPath(_0x461e16,_0x4245b8,_0xd0790f),_0x3affbd=_0x3b8166+':'+_0x5c9937['name'],_0x4fa639=_0x2e471d[_0xc080cc(0x219)]['get'](_0x3affbd);let _0x2e82b4,_0x4e3219;if(_0x4fa639&&_0x4fa639[_0xc080cc(0x1fd)]>0x0){const _0x26a312=buildLocalExpandedRuleMappings(_0x5c9937),{createYamlContext:_0x42f116,prefetchJourneySegments:_0x3adc39}=createPushYamlContextForBundle(_0x2e471d[_0xc080cc(0x13d)],_0x2e471d['parentId'],_0x2e471d[_0xc080cc(0x1bf)],_0x26a312,_0x2e471d[_0xc080cc(0x1f1)],_0x2e471d['connectionIdToNameMap'],_0x2e471d[_0xc080cc(0x173)],_0x2e471d[_0xc080cc(0x236)]);await _0x3adc39(_0x4fa639['map'](_0x3611f7=>_0x3611f7['id']));const _0x24d278=await _0x2e471d[_0xc080cc(0x13d)]['journey'][_0xc080cc(0x1b5)](_0x4fa639[0x0]['journeyBundleId']),_0x549b1a=hasMultipleVersions(_0x5c9937),_0x52ac59=async _0x4e907d=>{const _0x6dc397=_0xc080cc,_0x34c1f2=_0x2e471d[_0x6dc397(0x236)]?.[_0x6dc397(0x21c)](_0x4e907d);if(_0x34c1f2)return _0x34c1f2;return _0x2e471d[_0x6dc397(0x217)]({'journeyId':_0x4e907d,'journeyName':_0x5c9937['name'],'isMultiVersion':_0x4fa639['length']>0x1});};if(_0x549b1a&&_0x4fa639[_0xc080cc(0x1fd)]>0x1){const _0x23e502=[];for(const _0x4d4233 of _0x4fa639){const _0x323cad=_0x4d4233[_0xc080cc(0x164)]||0x1;_0x2e471d[_0xc080cc(0x167)]?.[_0xc080cc(0x1b1)](_0xc080cc(0x1b3)+_0x5c9937[_0xc080cc(0x1ce)]+'\x20v'+_0x323cad);const _0x57c3fe=await _0x52ac59(_0x4d4233['id']),_0x138c7b=_0x42f116(_0x4d4233['id']),_0x406397=await journeyResponseToDef(_0x57c3fe,_0x138c7b);_0x23e502[_0xc080cc(0x1ae)]({'item':_0x4d4233,'yaml':_0x406397});}const _0x34be0b=buildLocalRuleToNameMappingFromJourney(_0x5c9937);_0x4e3219=buildMergedJourneyDef(_0x23e502,_0x34be0b,_0x24d278);const _0x33fb31=Math['max'](..._0x23e502[_0xc080cc(0x1da)](_0x299b5a=>_0x299b5a[_0xc080cc(0x1d5)][_0xc080cc(0x164)]||0x0)),_0x1e49b7=_0x4fa639['find'](_0x5dba9f=>(_0x5dba9f['versionNumber']||0x0)===_0x33fb31);_0x1e49b7&&(_0x2e471d['progress']?.[_0xc080cc(0x1b1)](_0xc080cc(0x1b3)+_0x5c9937[_0xc080cc(0x1ce)]+'\x20v'+_0x33fb31),_0x2e82b4=await _0x52ac59(_0x1e49b7['id']));}else{const _0x2532dd=_0x4fa639[_0x4fa639[_0xc080cc(0x1fd)]-0x1];_0x2e471d['progress']?.[_0xc080cc(0x1b1)](_0xc080cc(0x1b3)+_0x5c9937[_0xc080cc(0x1ce)]),_0x2e82b4=await _0x52ac59(_0x2532dd['id']);const _0x89808c=_0x42f116(_0x2532dd['id']),_0x4bc96b=await journeyResponseToDef(_0x2e82b4,_0x89808c),_0x6cff5c=buildLocalRuleToNameMappingFromJourney(_0x5c9937);_0x4e3219=buildMergedJourneyDef([{'item':_0x2532dd,'yaml':_0x4bc96b}],_0x6cff5c,_0x24d278);}}addFoldersToCreate(_0x3b8166,_0x2e471d[_0xc080cc(0x1b0)],_0x529873);const _0x3f1155=calculateJourneyDiff(_0x5c9937,_0x4e3219);_0x5a0999[_0xc080cc(0x1ae)]({'relativePath':_0x5c9937['name'],'absolutePath':_0x443e42,'yamlConfig':_0x5c9937,'folderPath':_0x3b8166,'existingJourney':_0x2e82b4,'isNew':_0x3f1155[_0xc080cc(0x190)],'hasChanges':_0x3f1155['hasChanges'],'diff':_0x3f1155[_0xc080cc(0x231)]});}return{'journeyFiles':_0x5a0999,'foldersToCreate':_0x529873};}export function calculateActivationActions(_0x1ecfd0,_0x2dde2a,_0x435a58,_0x31d94c){const _0x5ddca7=a152_0x59916b,_0x3592f9=[],_0x2437a8=new Map();for(const _0x19fe37 of _0x2dde2a){_0x2437a8[_0x5ddca7(0x172)](_0x19fe37[_0x5ddca7(0x1ce)],_0x19fe37);}const _0x2142bb=new Map();for(const _0x48ce1b of _0x1ecfd0){_0x2142bb['set'](_0x48ce1b[_0x5ddca7(0x1ce)],_0x48ce1b);}for(const _0x4e7e4a of _0x1ecfd0){const _0x696f50=_0x2437a8[_0x5ddca7(0x21c)](_0x4e7e4a['name']);if(!_0x696f50)_0x3592f9['push']({'type':'create','name':_0x4e7e4a[_0x5ddca7(0x1ce)],'yamlActivation':_0x4e7e4a});else{const _0x2c7c98=activationResponseToDef(_0x696f50,_0x435a58,_0x31d94c),_0x201451=a152_0x329c1f[_0x5ddca7(0x18a)](_0x2c7c98),_0x41a8f7=a152_0x329c1f['stringify'](_0x4e7e4a);_0x201451!==_0x41a8f7&&_0x3592f9[_0x5ddca7(0x1ae)]({'type':_0x5ddca7(0x1b1),'name':_0x4e7e4a['name'],'yamlActivation':_0x4e7e4a,'existingActivation':_0x696f50});}}for(const _0x399795 of _0x2dde2a){!_0x2142bb['has'](_0x399795[_0x5ddca7(0x1ce)])&&_0x3592f9[_0x5ddca7(0x1ae)]({'type':_0x5ddca7(0x193),'name':_0x399795[_0x5ddca7(0x1ce)],'existingActivation':_0x399795});}return _0x3592f9;}function calculateYamlDiff(_0x594cd9,_0x168954){if(_0x168954){const _0x5ea57a=generateDiff(_0x168954,_0x594cd9),_0x567ad2=hasChanges(_0x5ea57a);return{'isNew':![],'hasChanges':_0x567ad2,'diff':_0x567ad2?formatDiffWithColors(_0x5ea57a):undefined};}const _0x597aab=generateDiff('',_0x594cd9);return{'isNew':!![],'hasChanges':![],'diff':formatDiffWithColors(_0x597aab)};}export function calculateSegmentDiff(_0x276817,_0x3b1331,_0x336db0,_0x3b5eba,_0x40ab1b){const _0x4fa3f7=segmentToYamlString(_0x276817),_0x44e4cb=_0x3b1331?segmentToYamlString(segmentWithActivationsToYaml(_0x3b1331,_0x336db0,undefined,_0x3b5eba,_0x40ab1b)):undefined;return calculateYamlDiff(_0x4fa3f7,_0x44e4cb);}export function calculateJourneyDiff(_0x1933d3,_0x8694b9){const _0x4c86b8=normalizeJourneyDef(_0x1933d3,_0x1933d3),_0x4c8f26=a152_0x4934de(_0x4c86b8),_0x57e608=_0x8694b9?a152_0x4934de(normalizeJourneyDef(_0x8694b9,_0x1933d3)):undefined;return calculateYamlDiff(_0x4c8f26,_0x57e608);}export function findSegmentsToDelete(_0x557888,_0x3bfdcb,_0x156c30,_0xe710fd,_0x55cac8){const _0x1e609e=a152_0x59916b,_0x561717=new Set();for(const {yamlConfig:_0x5a5978,folderPath:_0x5c4061}of _0x3bfdcb){_0x561717[_0x1e609e(0x180)](_0x5c4061+':'+_0x5a5978[_0x1e609e(0x1ce)]);}return _0x557888['filter'](_0x1fd4c3=>{const _0x5b2c54=_0x1e609e,_0xfbf8cd=_0x1fd4c3['segmentFolderId']?_0x156c30['get'](_0x1fd4c3[_0x5b2c54(0x228)]['toString']())||'':'',_0x179d21=_0xfbf8cd+':'+_0x1fd4c3[_0x5b2c54(0x1ce)];if(_0x561717[_0x5b2c54(0x145)](_0x179d21))return![];if(_0x55cac8)return _0xfbf8cd===_0xe710fd||_0xfbf8cd[_0x5b2c54(0x1d7)](_0xe710fd+'/');return!![];});}function a152_0x481a(){const _0x1d54de=['valid','Updated\x20journey\x20\x27','Delete\x20the\x20push\x20recovery\x20file\x20(','existingSegments','Warning:\x20Could\x20not\x20resolve\x20embedded\x20segment\x20\x27','parseDocument','embedded_segment_creating','SEGMENT_UPDATE_ERROR','columns','parentId','localName','deleted','values','getSegmentEntity\x20also\x20failed\x20for\x20','journeyStages','568jfGZHd','ACTIVATION_UPDATE_ERROR','.$1.push-recovery.json','name','Duration','\x27\x20not\x20found\x20in\x20parent\x20segment\x20(referenced\x20in\x20jump\x20step\x20of\x20\x27','toLowerCase','Failed\x20to\x20fetch\x20referenced\x20segment\x20','join','resolvedRule','item','\x27\x20wait\x20condition','startsWith','updateActivation','slice','map','activationsBySegmentId','created','segment_creating','WaitStep','activations','\x27\x20to\x20local\x20\x27','connector_config','INTERNAL','2300838YiZiHY','rootFolderId','journeyActivationStepId','logSuccess','createJourneySegment','split','waitStepType','createFolder','embeddedSegmentNameToId','includes','conditions','listActivations','relationships','existingJourney','idToEmailMap','activation_template_id','tdx.sdk.push-workflow','deleteActivation','uniqueSegmentName','existingSegment','hasChanges','Entry\x20criteria:\x20','stage\x20\x27','journeyName','segment_created','match','length','326310FIuOwH','size','createdSegmentIds','journey_creating','absolutePath','conditionTimeoutUnit','max','waitStepUnit','behavior','__pending_act_','connection','Segment\x20not\x20found','object','entry_criteria','./child-segment-yaml.js','segmentNameToId','\x20segment\x20from\x20file:\x20','state','branches','attributes','1510009TnKhov','Segment\x20not\x20found:\x20','activation_deleting','journeyActivationNameToId','type','fetchJourney','getSegment\x20failed\x20for\x20','journeyBundlesByFolderAndName','effectiveFolderId','activation_updated','get','conditionSegmentId','reduce',').\x20','idToName','replace','Created\x20activation\x20\x27','journeyId','onProgress','59395dAudvf','):\x20','goal','segmentFolderId','getJourney','journey_created',',\x20falling\x20back\x20to\x20getSegmentEntity:\x20','\x27\x20milestone','toISOString','deleteSegment','parentSegmentFolder','message','diff','journeys','entryCriteria','journey_updating','902hgrLpx','journeyById','embedded_activation_created','journey_entry_criteria_','\x27\x20not\x20found\x20in\x20journey\x20\x27','Activation','toString','null','segments','withProgress','resolveJourneyId','segment','create','activationActions','Condition','activation_updating','yamlConfig','list','connectionIdToNameMap','deps','journey','./journey-yaml.js','3055188PYayqo','keys','\x27\x20from\x20file:\x20','createActivation','all_columns','has','from','18HhrqJY','1035805NRELxS','\x20(referenced\x20in\x20embedded\x20segment\x20\x27','hex','draft','parse','activation_','folderPath','schedule','Updated\x20activation\x20\x27','folder_created','validatedRequest','all','Failed\x20to\x20resolve\x20segment\x20','with','getActivation','\x27\x20decision\x20point\x20branch\x20\x27','../../utils/async.js','buildUserMaps','relative','DecisionPoint','journeyBundleName','uniqueServerName','14106420JnbmCO','NOT_FOUND','journey_updated','createdSegmentId','getSegment','Updating\x20segment\x20\x27','versionNumber','ACTIVATION_SYNTAX_ERROR','resolveSegment','progress','dirname','folderId','logWarning','logDeleted','find','segmentId','entry','day','Define\x20it\x20in\x20the\x20journey\x27s\x20\x27activations\x27\x20section\x20or\x20use\x20an\x20existing\x20activation\x20ID.','exitCriterias','set','activationStepsById','folder_creating','\x27\x20exit\x20criteria','rule','\x20(referenced\x20in\x20journey\x20','segment_deleting','run_after_journey_refresh','\x27\x20by\x20rule\x20content','notification','updated','waitStep','segment_updating','\x20activation\x20\x27','add','unchanged','Deleting\x20activation\x20\x27','Matched\x20server\x20segment\x20\x27','Failed\x20to\x20','logInfo','debug','__pending_','isArray','sha1','stringify','Journey\x20\x27','Created\x20segment\x20\x27','steps','Cannot\x20create\x20embedded\x20activation\x20without\x20journey\x20context','decision_point','isNew','kind','some','delete','2QTRNoq','verbose','Failed\x20to\x20sync\x20activations\x20for\x20segment\x20\x27','filter','Activation\x20not\x20found:\x20','entries','folder','JOURNEY_SYNTAX_ERROR','milestone','conditionTimeoutDuration','Stage\x20\x27','utf-8','segmentByFolderAndName','sort','\x27\x20entry\x20criteria','description','index','segment_updated','\x27\x20already\x20exists\x20on\x20server\x20but\x20cannot\x20be\x20found.\x20','embedded_segment_created','getSegmentEntity','Embedded\x20segment\x20\x27','\x27...','\x0a\x20\x20','\x27\x20for\x20','updateSegmentById','push','existingActivation','folderPathToId','update','skipSegments','Fetching\x20','yamlActivation','getLatestJourneyId','data','action','activationContext','segment_deleted','stages','Deleted\x20activation\x20\x27'];a152_0x481a=function(){return _0x1d54de;};return a152_0x481a();}export function findJourneysToDelete(_0x2e5aa4,_0x18b731,_0x5e2379,_0x10dc21,_0x5c433c){const _0xf9fcaa=a152_0x59916b,_0x415253=new Set();for(const {yamlConfig:_0x1d612a,folderPath:_0x3dc2b6}of _0x18b731){_0x415253[_0xf9fcaa(0x180)](_0x3dc2b6+':'+_0x1d612a[_0xf9fcaa(0x1ce)]);}return _0x2e5aa4[_0xf9fcaa(0x197)](_0xeaceff=>{const _0x3e877a=_0xf9fcaa,_0x5a6098=_0xeaceff[_0x3e877a(0x169)]?_0x5e2379['get'](_0xeaceff[_0x3e877a(0x169)])||'':'',_0x115910=_0x5a6098+':'+_0xeaceff['journeyBundleName'];if(_0x415253[_0x3e877a(0x145)](_0x115910))return![];if(_0x5c433c)return _0x5a6098===_0x10dc21||_0x5a6098[_0x3e877a(0x1d7)](_0x10dc21+'/');return!![];});}export function buildSegmentLookupMap(_0x355c1e,_0x4bade7){const _0x5a3789=a152_0x59916b,_0x3d9099=new Map();for(const _0x1ebad8 of _0x355c1e){const _0x583d72=_0x1ebad8['segmentFolderId']?_0x4bade7['get'](_0x1ebad8[_0x5a3789(0x228)][_0x5a3789(0x23b)]())||'':'',_0x49e53d=_0x583d72+':'+_0x1ebad8[_0x5a3789(0x1ce)];_0x3d9099['set'](_0x49e53d,_0x1ebad8);}return _0x3d9099;}export function buildSegmentNameToIdMap(_0x36328a){const _0xe175e4=a152_0x59916b,_0x1fc74b=new Map();for(const _0x251cbe of _0x36328a){_0x1fc74b['set'](_0x251cbe[_0xe175e4(0x1ce)],_0x251cbe['id']);}return _0x1fc74b;}export function buildJourneyBundleLookupMap(_0x46ed9e,_0x483f55){const _0x5043bb=a152_0x59916b,_0x31523a=new Map();for(const _0x1bbe73 of _0x46ed9e){const _0x558b9a=_0x1bbe73[_0x5043bb(0x169)]?_0x483f55['get'](_0x1bbe73[_0x5043bb(0x169)])||'':'',_0x28965d=_0x558b9a+':'+_0x1bbe73[_0x5043bb(0x15c)];!_0x31523a[_0x5043bb(0x145)](_0x28965d)&&_0x31523a[_0x5043bb(0x172)](_0x28965d,[]),_0x31523a[_0x5043bb(0x21c)](_0x28965d)[_0x5043bb(0x1ae)](_0x1bbe73);}for(const _0x2d7c98 of _0x31523a[_0x5043bb(0x1c8)]()){_0x2d7c98[_0x5043bb(0x1a1)]((_0xcf814,_0x48c53c)=>(_0xcf814[_0x5043bb(0x164)]||0x0)-(_0x48c53c[_0x5043bb(0x164)]||0x0));}return _0x31523a;}export function collectFoldersToCreate(_0x21e01b,_0x273089){const _0x403d6e=a152_0x59916b,_0x347999=new Set();for(const _0x5e704b of _0x21e01b){if(!_0x5e704b)continue;if(_0x273089['has'](_0x5e704b))continue;const _0x29b81d=_0x5e704b[_0x403d6e(0x1e8)]('/');let _0x556726='';for(const _0x13883f of _0x29b81d){_0x556726=_0x556726?_0x556726+'/'+_0x13883f:_0x13883f,!_0x273089[_0x403d6e(0x145)](_0x556726)&&_0x347999[_0x403d6e(0x180)](_0x556726);}}return _0x347999;}export function parseAndClassifyYamlFiles(_0x5621ab,_0xa6b5d5,_0x789ab0){const _0x1ccd8f=a152_0x59916b,_0x2280b8=[],_0x38e218=[];for(const _0x4443e8 of _0x5621ab){const _0x5ca330=a152_0x822047['relative'](_0xa6b5d5,a152_0x822047[_0x1ccd8f(0x168)](_0x4443e8)),_0x18ea99=_0x5ca330==='.'?'':_0x5ca330,_0x4b9e96=readFileSync(_0x4443e8,_0x1ccd8f(0x19f)),_0x314467=a152_0x329c1f[_0x1ccd8f(0x14c)](_0x4b9e96);if(isJourneyDef(_0x314467)){const _0x22b732=a152_0x73dd06(_0x4b9e96);_0x38e218[_0x1ccd8f(0x1ae)]({'yamlConfig':_0x22b732,'folderPath':_0x18ea99,'sourcePath':_0x4443e8});}else{if(!_0x789ab0?.[_0x1ccd8f(0x1b2)]){const _0x18003f=parseSegmentYamlFile(_0x4b9e96),_0x24b919=normalizeChildSegmentYaml(_0x18003f);_0x2280b8[_0x1ccd8f(0x1ae)]({'yamlConfig':_0x24b919,'folderPath':_0x18ea99,'sourcePath':_0x4443e8});}}}return{'segments':_0x2280b8,'journeys':_0x38e218};}export function validateParsedFiles(_0x35c275,_0x2953af){const _0x376375=a152_0x59916b,_0x4e388b=[];for(const {yamlConfig:_0x50cb93,sourcePath:_0x275881}of _0x35c275[_0x376375(0x23d)]){const _0x296cb3=readFileSync(_0x275881,_0x376375(0x19f)),_0x258995=a152_0x329c1f['parseDocument'](_0x296cb3),_0x526ca5=validateSegmentDef(_0x50cb93,{'source':_0x296cb3,'document':_0x258995},{'skipSchema':!![]});if(!_0x526ca5[_0x376375(0x1bc)]){const _0x5b183e=a152_0x822047[_0x376375(0x15a)](_0x2953af,_0x275881);_0x4e388b[_0x376375(0x1ae)]({'filePath':_0x5b183e,'source':_0x296cb3,'result':_0x526ca5,'isJourney':![]});}}for(const {yamlConfig:_0x2404f5,sourcePath:_0x2b9893}of _0x35c275[_0x376375(0x232)]){const _0x355dce=readFileSync(_0x2b9893,_0x376375(0x19f)),_0x28b886=a152_0x329c1f[_0x376375(0x1c1)](_0x355dce),_0x2a3bc3=validateJourneyDef(_0x2404f5,{'source':_0x355dce,'document':_0x28b886},{'skipSchema':!![]});if(!_0x2a3bc3[_0x376375(0x1bc)]){const _0x2dc417=a152_0x822047[_0x376375(0x15a)](_0x2953af,_0x2b9893);_0x4e388b[_0x376375(0x1ae)]({'filePath':_0x2dc417,'source':_0x355dce,'result':_0x2a3bc3,'isJourney':!![]});}}return _0x4e388b;}export function formatValidationErrors(_0x57ea24){const _0x1607f4=a152_0x59916b,_0x1f35e9=[];for(const {filePath:_0x1efe27,source:_0x40d57c,result:_0x136d68,isJourney:_0x54bd2c}of _0x57ea24){const _0x2fb4f2=_0x54bd2c?'journey':_0x1607f4(0x240);_0x1f35e9[_0x1607f4(0x1ae)]('\x0a'+_0x1efe27+'\x20('+_0x2fb4f2+_0x1607f4(0x226)+_0x136d68['errors'][_0x1607f4(0x1fd)]+'\x20error(s)'),_0x1f35e9[_0x1607f4(0x1ae)](formatValidationResult(_0x136d68,_0x40d57c,_0x1efe27));}return _0x1f35e9[_0x1607f4(0x1d3)]('\x0a');}export function buildLocalExpandedRuleMappings(_0x4fa36d){const _0x2212b8=a152_0x59916b,_0x222537=new Set(),_0x305b93=new Map(),_0x5dbd86=collectSegmentUsageCounts(_0x4fa36d);if(_0x4fa36d[_0x2212b8(0x23d)])for(const [_0x29e06d,_0x27430e]of Object[_0x2212b8(0x199)](_0x4fa36d[_0x2212b8(0x23d)])){_0x222537['add'](_0x29e06d);if(_0x27430e[_0x2212b8(0x176)]){const _0x1a4229=yamlRuleToApi(_0x27430e[_0x2212b8(0x176)]),_0x2a5b38=apiRuleToYaml(_0x1a4229);_0x305b93[_0x2212b8(0x172)](_0x29e06d,_0x2a5b38);}}const _0x70eef4=new Map();let _0x53af23=0x0;for(const [_0x27305a,_0x39c0ed]of _0x305b93){const _0x4372a2=serializeExpandedRule(_0x39c0ed,_0x305b93),_0x2671d7=_0x70eef4[_0x2212b8(0x21c)](_0x4372a2)||[];_0x2671d7[_0x2212b8(0x1ae)]({'name':_0x27305a,'index':_0x53af23}),_0x70eef4[_0x2212b8(0x172)](_0x4372a2,_0x2671d7),_0x53af23++;}const _0x5ba125=new Map();for(const [_0xea3cd4,_0x7b70ac]of _0x70eef4){const _0x115c08=_0x7b70ac[_0x2212b8(0x1d9)]()[_0x2212b8(0x1a1)]((_0x278699,_0x3e893b)=>{const _0x15912f=_0x2212b8,_0x1d32c4=_0x5dbd86['get'](_0x278699[_0x15912f(0x1ce)])||0x0,_0x3b6f31=_0x5dbd86[_0x15912f(0x21c)](_0x3e893b[_0x15912f(0x1ce)])||0x0;if(_0x1d32c4!==_0x3b6f31)return _0x3b6f31-_0x1d32c4;return _0x278699[_0x15912f(0x1a4)]-_0x3e893b[_0x15912f(0x1a4)];})[_0x2212b8(0x1da)](_0x442572=>_0x442572[_0x2212b8(0x1ce)]),_0x2b04db=[];for(const _0xda22d5 of _0x115c08){const _0x95ea08=_0x5dbd86['get'](_0xda22d5)||0x0,_0x4d2e86=Math[_0x2212b8(0x204)](_0x95ea08,0x1);for(let _0x55ed5e=0x0;_0x55ed5e<_0x4d2e86;_0x55ed5e++){_0x2b04db[_0x2212b8(0x1ae)](_0xda22d5);}}_0x5ba125[_0x2212b8(0x172)](_0xea3cd4,_0x2b04db);}return{'existingLocalSegmentNames':_0x222537,'localSegmentRules':_0x305b93,'localExpandedRuleToNames':_0x5ba125};}export function createSegmentIdResolver(_0x3e6707,_0x407dbd){return async _0xfa3dc8=>{const _0x16bf08=a152_0x54b0,_0x125bb4=_0x3e6707[_0x16bf08(0x21c)](_0xfa3dc8);if(!_0x125bb4)throw new SDKError(ErrorCode['SEGMENT_NOT_FOUND'],_0x16bf08(0x213)+_0xfa3dc8+_0x16bf08(0x149)+_0x407dbd+'\x27)');return _0x125bb4;};}export function extractRootFolderId(_0xeec8f3){const _0x2a71ba=a152_0x59916b;return _0xeec8f3[_0x2a71ba(0x1ef)]?.[_0x2a71ba(0x22f)]?.[_0x2a71ba(0x1b6)]?.['id']||_0xeec8f3[_0x2a71ba(0x1ef)]?.['parentFolder']?.[_0x2a71ba(0x1b6)]?.['id'];}export function buildConnectionMaps(_0x492530){const _0x49377d=a152_0x59916b,_0x2a3b25=new Map(),_0x1880e7=new Map(),_0x5da601=new Map();for(const _0x27426f of _0x492530){_0x2a3b25[_0x49377d(0x172)](_0x27426f[_0x49377d(0x1ce)],parseInt(_0x27426f['id'],0xa)),_0x1880e7[_0x49377d(0x172)](_0x27426f['id'],_0x27426f['name']),_0x5da601['set'](_0x27426f['name'],_0x27426f[_0x49377d(0x216)]);}return{'nameToId':_0x2a3b25,'idToName':_0x1880e7,'nameToType':_0x5da601};}export function calculatePushStats(_0x40feca,_0x1b94a3,_0x2b8fbd,_0x57a439,_0x33374c,_0x44cfd7,_0x20b05e){const _0x3f7a34=a152_0x59916b,_0x164c3c=_0x40feca[_0x3f7a34(0x197)](_0xcd86e5=>_0xcd86e5['isNew']),_0x5cd377=_0x40feca[_0x3f7a34(0x197)](_0x340123=>!_0x340123[_0x3f7a34(0x190)]&&_0x340123[_0x3f7a34(0x1f7)]),_0x18b76d=_0x40feca[_0x3f7a34(0x197)](_0x46dc6d=>!_0x46dc6d[_0x3f7a34(0x190)]&&!_0x46dc6d['hasChanges']),_0x454394=_0x44cfd7?_0x57a439:[],_0x1f0ef2=_0x1b94a3['filter'](_0x2238b4=>_0x2238b4[_0x3f7a34(0x190)]),_0x592e26=_0x1b94a3[_0x3f7a34(0x197)](_0x13b137=>!_0x13b137[_0x3f7a34(0x190)]&&_0x13b137[_0x3f7a34(0x1f7)]),_0x1b1539=_0x1b94a3[_0x3f7a34(0x197)](_0x5f4333=>!_0x5f4333['isNew']&&!_0x5f4333[_0x3f7a34(0x1f7)]),_0x2bb857=_0x44cfd7?_0x33374c:[],_0x48771f=_0x40feca['flatMap'](_0xf4c441=>_0xf4c441[_0x3f7a34(0x242)]),_0x4210af=_0x48771f[_0x3f7a34(0x197)](_0x459745=>_0x459745[_0x3f7a34(0x216)]===_0x3f7a34(0x241)),_0xc6fc33=_0x48771f[_0x3f7a34(0x197)](_0x605ee5=>_0x605ee5[_0x3f7a34(0x216)]===_0x3f7a34(0x1b1)),_0x335604=_0x48771f['filter'](_0x52f8cc=>_0x52f8cc[_0x3f7a34(0x216)]===_0x3f7a34(0x193)),_0x543561=Array[_0x3f7a34(0x146)](_0x2b8fbd)[_0x3f7a34(0x1a1)](),_0x1b40db=_0x20b05e?![]:_0x164c3c[_0x3f7a34(0x1fd)]>0x0||_0x5cd377[_0x3f7a34(0x1fd)]>0x0||_0x454394[_0x3f7a34(0x1fd)]>0x0,_0x356425=_0x1f0ef2['length']>0x0||_0x592e26['length']>0x0||_0x2bb857[_0x3f7a34(0x1fd)]>0x0,_0x4f7b99=_0x20b05e?![]:_0x48771f['length']>0x0,_0x2350f1=_0x543561[_0x3f7a34(0x1fd)]>0x0;return{'segments':{'new':_0x164c3c,'changed':_0x5cd377,'unchanged':_0x18b76d,'toDelete':_0x454394},'journeys':{'new':_0x1f0ef2,'changed':_0x592e26,'unchanged':_0x1b1539,'toDelete':_0x2bb857},'activations':{'all':_0x48771f,'toCreate':_0x4210af,'toUpdate':_0xc6fc33,'toDelete':_0x335604},'folders':{'toCreate':_0x543561},'counts':{'segments':{'new':_0x164c3c[_0x3f7a34(0x1fd)],'changed':_0x5cd377[_0x3f7a34(0x1fd)],'unchanged':_0x18b76d[_0x3f7a34(0x1fd)],'toDelete':_0x454394['length']},'journeys':{'new':_0x1f0ef2[_0x3f7a34(0x1fd)],'changed':_0x592e26[_0x3f7a34(0x1fd)],'unchanged':_0x1b1539[_0x3f7a34(0x1fd)],'toDelete':_0x2bb857[_0x3f7a34(0x1fd)]},'activations':{'create':_0x4210af[_0x3f7a34(0x1fd)],'update':_0xc6fc33['length'],'delete':_0x335604[_0x3f7a34(0x1fd)]},'folders':_0x543561['length']},'hasChanges':_0x1b40db||_0x356425||_0x4f7b99||_0x2350f1};}export async function buildPushExecutionContext(_0x157c19,_0x407489,_0x1dfdcd,_0x58d0ac,_0x52a8cc,_0x50e85d){const _0x4b9d6a=a152_0x59916b,_0x72b821=extractRootFolderId(_0x1dfdcd),{pathToId:_0x274587,idToPath:_0x2f4168}=buildFolderMaps(_0x52a8cc),_0x121a62=buildSegmentNameToIdMap(_0x58d0ac),_0x52255f=new Map(),{batchAsync:_0x3f2276}=await import('../../utils/async.js'),[_0x5d8cad,_0x200f81]=await Promise[_0x4b9d6a(0x153)]([_0x157c19['user'][_0x4b9d6a(0x159)](),_0x157c19[_0x4b9d6a(0x208)][_0x4b9d6a(0x246)](),((async()=>{const _0x404c26=_0x4b9d6a;!_0x50e85d&&_0x58d0ac[_0x404c26(0x1fd)]>0x0&&await _0x3f2276(_0x58d0ac,async _0x2ee4a5=>{const _0x5c5f0c=_0x404c26,_0x4af888=await _0x157c19['segment'][_0x5c5f0c(0x1ee)](_0x407489,_0x2ee4a5['id']);_0x52255f[_0x5c5f0c(0x172)](_0x2ee4a5['id'],_0x4af888);});})())]),{emailToId:_0x53bb70,idToEmail:_0x3aac9d}=_0x5d8cad,_0x2ad7ab=buildConnectionMaps(_0x200f81);return{'rootFolderId':_0x72b821,'folderPathToId':_0x274587,'folderIdToPath':_0x2f4168,'segmentNameToId':_0x121a62,'activationsBySegmentId':_0x52255f,'emailToIdMap':_0x53bb70,'idToEmailMap':_0x3aac9d,'connectionNameToIdMap':_0x2ad7ab['nameToId'],'connectionIdToNameMap':_0x2ad7ab[_0x4b9d6a(0x220)],'connectionNameToTypeMap':_0x2ad7ab['nameToType']};}export function createPushYamlContextForBundle(_0x583450,_0x3206f3,_0xaf91ad,_0x2f188c,_0x444363,_0x797514,_0x419ca5,_0x36c585){const {existingLocalSegmentNames:_0x1cb67f,localExpandedRuleToNames:_0x34b9e8}=_0x2f188c,_0x383f34=new Set(),_0x5c6d44=new Map(),_0x5044fc=new Map(),_0x308c94=new Map(),_0x292d6e=createJumpTargetCache(),_0x2986a4=new Map(),_0x2eea8a=new Map(),_0x386c9b=new Set();let _0x302c75;const _0xd63835=_0x150acf=>{const _0x2fddc7={'resolveSegment':async _0xbf337c=>{const _0x5e90fc=a152_0x54b0,_0x5b7d62=_0x308c94[_0x5e90fc(0x21c)](_0xbf337c);if(_0x5b7d62!==undefined)return{'name':_0x5b7d62,'isJourneyLocal':!![]};try{const _0x5bb411=await fetchSegment(_0x583450,_0x3206f3,_0xbf337c,_0xaf91ad);if(!_0x5bb411)throw new Error(_0x5e90fc(0x209));const _0x4ae411=generateJourneyLocalName(_0x5bb411[_0x5e90fc(0x1ce)]),_0x5e432e=_0x5bb411[_0x5e90fc(0x191)]===SEGMENT_KIND_JOURNEY&&_0x4ae411!==undefined;let _0x2ae1c7=_0x5bb411[_0x5e90fc(0x1ce)],_0x3af4dc;if(_0x5e432e&&_0x5bb411['rule']){const _0x1202b1=apiRuleToYaml(_0x5bb411[_0x5e90fc(0x176)]);_0x2eea8a[_0x5e90fc(0x172)](_0xbf337c,_0x1202b1);const _0x12abf8=async _0x57501c=>{const _0x3f467d=_0x5e90fc,_0x2d7ad9=collectSegmentRefsFromRule(_0x57501c);for(const _0x4ccd92 of _0x2d7ad9){if(!_0x2eea8a[_0x3f467d(0x145)](_0x4ccd92))try{const _0x23cacf=await fetchSegment(_0x583450,_0x3206f3,_0x4ccd92,_0xaf91ad);if(_0x23cacf?.[_0x3f467d(0x176)]){const _0x40d47e=apiRuleToYaml(_0x23cacf[_0x3f467d(0x176)]);_0x2eea8a[_0x3f467d(0x172)](_0x4ccd92,_0x40d47e),await _0x12abf8(_0x40d47e);}}catch(_0x132beb){logger['debug'](_0x3f467d(0x1d2)+_0x4ccd92+':\x20'+_0x132beb);}}};await _0x12abf8(_0x1202b1);const _0x4e2f70=serializeExpandedRule(_0x1202b1,_0x2eea8a),_0x5e32e5=_0x34b9e8[_0x5e90fc(0x21c)](_0x4e2f70);if(_0x5e32e5&&_0x5e32e5[_0x5e90fc(0x1fd)]>0x0){const _0x49178b=_0x5c6d44[_0x5e90fc(0x21c)](_0x4e2f70)||0x0,_0x975881=_0x5e32e5[_0x49178b]||_0x5e32e5[_0x5e32e5['length']-0x1];_0x5c6d44[_0x5e90fc(0x172)](_0x4e2f70,_0x49178b+0x1),_0x2ae1c7=_0x975881,_0x383f34[_0x5e90fc(0x180)](_0x2ae1c7),_0x308c94['set'](_0xbf337c,_0x2ae1c7);const _0x11fa67=await resolveRuleSegmentRefs(_0x1202b1,async _0xfa465d=>{const _0x47b46b=_0x5e90fc,_0x239748=_0x308c94[_0x47b46b(0x21c)](_0xfa465d);if(_0x239748)return _0x239748;const _0x337ae5=await _0x302c75[_0x47b46b(0x166)](_0xfa465d);return _0x337ae5[_0x47b46b(0x1ce)];});_0x3af4dc={'description':_0x5bb411[_0x5e90fc(0x1a3)],'rule':_0x11fa67};}else{const _0x167a7f=_0x2986a4[_0x5e90fc(0x21c)](_0x4e2f70);if(_0x167a7f)_0x2ae1c7=_0x167a7f,_0x308c94[_0x5e90fc(0x172)](_0xbf337c,_0x2ae1c7);else{if(_0x4ae411){let _0x44305b=_0x4ae411,_0x231134=0x2;while(_0x383f34['has'](_0x44305b)||_0x1cb67f['has'](_0x44305b)){_0x44305b=_0x4ae411+'_'+_0x231134,_0x231134++;}_0x383f34[_0x5e90fc(0x180)](_0x44305b),_0x2ae1c7=_0x44305b;}_0x308c94['set'](_0xbf337c,_0x2ae1c7),_0x2986a4[_0x5e90fc(0x172)](_0x4e2f70,_0x2ae1c7);const _0x2b642c=await resolveRuleSegmentRefs(_0x1202b1,async _0x3cd97f=>{const _0x19c6e5=_0x308c94['get'](_0x3cd97f);if(_0x19c6e5)return _0x19c6e5;const _0x472fbf=await _0x302c75['resolveSegment'](_0x3cd97f);return _0x472fbf['name'];});_0x3af4dc={'description':_0x5bb411[_0x5e90fc(0x1a3)],'rule':_0x2b642c};}}}return{'name':_0x2ae1c7,'isJourneyLocal':_0x5e432e,'definition':_0x3af4dc};}catch(_0x1e1d2b){return logger[_0x5e90fc(0x186)](_0x5e90fc(0x154)+_0xbf337c+':\x20'+_0x1e1d2b),{'name':_0xbf337c,'isJourneyLocal':![]};}},'resolveActivation':async _0x407c11=>{const _0x366db3=a152_0x54b0,_0x559c19=_0x5044fc[_0x366db3(0x21c)](_0x407c11);if(_0x559c19!==undefined)return{'name':_0x559c19,'isJourneyLocal':!![]};try{let _0x65358=_0x419ca5?.['get'](_0x407c11);!_0x65358&&(_0x65358=await _0x583450[_0x366db3(0x13e)][_0x366db3(0x156)](_0x150acf,_0x407c11));const _0x32b44a=_0x65358[_0x366db3(0x211)]['activationParams']['name']||_0x407c11,_0x3172be=sanitizeYamlKey(_0x32b44a)||_0x366db3(0x14d)+_0x407c11,_0x5dd6d1=_0x3172be;_0x5044fc[_0x366db3(0x172)](_0x407c11,_0x5dd6d1);const _0x53028c=journeyActivationStepToYaml(_0x65358,_0x444363,_0x797514);return{'name':_0x5dd6d1,'isJourneyLocal':!![],'definition':_0x53028c};}catch(_0x16be4b){return logger[_0x366db3(0x186)]('Failed\x20to\x20resolve\x20activation\x20'+_0x407c11+':\x20'+_0x16be4b),{'name':_0x407c11,'isJourneyLocal':![]};}},'resolveJumpTarget':(_0x43015b,_0x48211d)=>resolveJumpTarget(_0x43015b,_0x48211d,_0x292d6e,async _0x1957b5=>{const _0x22720a=a152_0x54b0,_0x4eec75=_0x36c585?.[_0x22720a(0x21c)](_0x1957b5);if(_0x4eec75)return _0x4eec75;return _0x583450[_0x22720a(0x13e)][_0x22720a(0x229)](_0x1957b5);})};return _0x302c75=_0x2fddc7,_0x2fddc7;},_0x1c7190=async _0x4ec62d=>{const _0x4c3ee8=a152_0x54b0,{collectSegmentIdsFromJourneyApi:_0x18b53f}=await import(_0x4c3ee8(0x13f)),{batchAsync:_0x466468}=await import('../../utils/async.js'),_0x217a66=new Set();for(const _0x3bfe7d of _0x4ec62d){let _0x260845=_0x36c585?.[_0x4c3ee8(0x21c)](_0x3bfe7d);!_0x260845&&(_0x260845=await _0x583450[_0x4c3ee8(0x13e)][_0x4c3ee8(0x229)](_0x3bfe7d));const _0x19dd94=_0x18b53f(_0x260845);for(const _0x4a6afb of _0x19dd94){_0x217a66[_0x4c3ee8(0x180)](_0x4a6afb);}}let _0x2cffa1=Array[_0x4c3ee8(0x146)](_0x217a66);while(_0x2cffa1[_0x4c3ee8(0x1fd)]>0x0){const _0xecc5dc=_0x2cffa1['filter'](_0x3b2b15=>!_0x386c9b['has'](_0x3b2b15));if(_0xecc5dc[_0x4c3ee8(0x1fd)]===0x0)break;const _0x2a1471=await _0x466468(_0xecc5dc,async _0x419902=>{const _0x5330c1=_0x4c3ee8;_0x386c9b[_0x5330c1(0x180)](_0x419902);const _0x2c112b=await fetchSegment(_0x583450,_0x3206f3,_0x419902,_0xaf91ad);if(!_0x2c112b)return null;return{'segmentId':_0x419902,'segment':_0x2c112b};},0xa),_0x46cb6c=new Set();for(const _0x4ccdf2 of _0x2a1471){if(!_0x4ccdf2?.[_0x4c3ee8(0x240)]?.[_0x4c3ee8(0x176)])continue;const _0x2dbf11=apiRuleToYaml(_0x4ccdf2['segment'][_0x4c3ee8(0x176)]);_0x2eea8a[_0x4c3ee8(0x172)](_0x4ccdf2[_0x4c3ee8(0x16d)],_0x2dbf11);const _0x5e4ea0=collectSegmentRefsFromRule(_0x2dbf11);for(const _0x67f442 of _0x5e4ea0){!_0x386c9b[_0x4c3ee8(0x145)](_0x67f442)&&_0x46cb6c[_0x4c3ee8(0x180)](_0x67f442);}}_0x2cffa1=Array[_0x4c3ee8(0x146)](_0x46cb6c);}};return{'createYamlContext':_0xd63835,'prefetchJourneySegments':_0x1c7190};}export async function executePushSegments(_0x63d245,_0x4e74dc,_0x17ef44,_0x439987,_0x445ab7){const _0x2f9ad0=a152_0x59916b,{segmentDefToCreateRequest:_0x52ff48,segmentDefToUpdateRequest:_0x4b69d5}=await import('./child-segment-yaml.js'),_0x2bf66b=_0x17ef44['folderPathToId'],_0x416ec5=0x5,_0x43996b=async _0x88eccf=>{const _0x2f6c5d=a152_0x54b0,_0x2156aa=_0x88eccf[_0x2f6c5d(0x14e)]?_0x2bf66b[_0x2f6c5d(0x21c)](_0x88eccf[_0x2f6c5d(0x14e)]):undefined;let _0x4ca952;const _0xc9607d={'created':0x0,'updated':0x0,'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};let _0x11d7c4=_0x88eccf[_0x2f6c5d(0x245)];if(_0x88eccf['yamlConfig']['rule']){const _0x447dd6=createSegmentIdResolver(_0x17ef44[_0x2f6c5d(0x20d)],_0x88eccf['yamlConfig'][_0x2f6c5d(0x1ce)]),_0x2687ac=await resolveRuleSegmentIds(_0x88eccf['yamlConfig'][_0x2f6c5d(0x176)],_0x447dd6);_0x11d7c4={..._0x88eccf[_0x2f6c5d(0x245)],'rule':_0x2687ac};}try{if(_0x88eccf['isNew']){_0x445ab7[_0x2f6c5d(0x224)]?.({'type':_0x2f6c5d(0x1dd),'name':_0x88eccf['yamlConfig'][_0x2f6c5d(0x1ce)]});const _0x485fa1=_0x52ff48(_0x11d7c4,_0x2156aa),_0x4c3abf=await _0x445ab7[_0x2f6c5d(0x23e)]('Creating\x20segment\x20\x27'+_0x88eccf['yamlConfig']['name']+_0x2f6c5d(0x1aa),()=>_0x63d245[_0x2f6c5d(0x240)]['createSegment'](_0x439987[_0x2f6c5d(0x1c5)],_0x485fa1));_0x4ca952=_0x4c3abf['data']['id'],_0x17ef44[_0x2f6c5d(0x20d)]['set'](_0x88eccf[_0x2f6c5d(0x245)][_0x2f6c5d(0x1ce)],_0x4ca952),_0xc9607d[_0x2f6c5d(0x161)]={'name':_0x88eccf[_0x2f6c5d(0x245)][_0x2f6c5d(0x1ce)],'id':_0x4ca952},_0x445ab7[_0x2f6c5d(0x224)]?.({'type':_0x2f6c5d(0x1fb),'name':_0x88eccf[_0x2f6c5d(0x245)][_0x2f6c5d(0x1ce)],'segmentId':_0x4ca952}),_0x445ab7[_0x2f6c5d(0x1e6)]?.(_0x2f6c5d(0x18c)+_0x88eccf[_0x2f6c5d(0x245)][_0x2f6c5d(0x1ce)]+'\x27'),_0xc9607d['created']=0x1;}else{if(_0x88eccf[_0x2f6c5d(0x1f7)]){_0x445ab7[_0x2f6c5d(0x224)]?.({'type':_0x2f6c5d(0x17e),'name':_0x88eccf[_0x2f6c5d(0x245)]['name']});const _0x1ab5b4=_0x4b69d5(_0x11d7c4);_0x2156aa!==_0x88eccf[_0x2f6c5d(0x1f6)]?.[_0x2f6c5d(0x228)]&&(_0x1ab5b4['segmentFolderId']=_0x2156aa?parseInt(_0x2156aa,0xa):undefined),await _0x445ab7[_0x2f6c5d(0x23e)](_0x2f6c5d(0x163)+_0x88eccf[_0x2f6c5d(0x245)][_0x2f6c5d(0x1ce)]+_0x2f6c5d(0x1aa),()=>_0x63d245[_0x2f6c5d(0x240)]['updateSegmentById'](_0x439987[_0x2f6c5d(0x1c5)],_0x88eccf[_0x2f6c5d(0x1f6)]['id'],_0x1ab5b4)),_0x4ca952=_0x88eccf[_0x2f6c5d(0x1f6)]['id'],_0x445ab7[_0x2f6c5d(0x224)]?.({'type':_0x2f6c5d(0x1a5),'name':_0x88eccf[_0x2f6c5d(0x245)][_0x2f6c5d(0x1ce)]}),_0x445ab7[_0x2f6c5d(0x1e6)]?.('Updated\x20segment\x20\x27'+_0x88eccf['yamlConfig'][_0x2f6c5d(0x1ce)]+'\x27'),_0xc9607d[_0x2f6c5d(0x17c)]=0x1;}else _0x4ca952=_0x88eccf['existingSegment']['id'];}}catch(_0x2f8165){const _0x406cec=isHttp400Error(_0x2f8165),_0x128ae9=_0x406cec?ErrorCode['SEGMENT_SYNTAX_ERROR']:ErrorCode[_0x2f6c5d(0x1c3)],_0x15cfc1=getErrorMessage(_0x2f8165);throw new SDKError(_0x128ae9,'Failed\x20to\x20'+(_0x88eccf[_0x2f6c5d(0x190)]?_0x2f6c5d(0x241):_0x2f6c5d(0x1b1))+_0x2f6c5d(0x20e)+_0x88eccf[_0x2f6c5d(0x202)]+_0x2f6c5d(0x1ab)+_0x15cfc1,_0x2f8165);}try{const _0x557955=await syncActivationsForSegment(_0x63d245,_0x439987[_0x2f6c5d(0x1c5)],_0x4ca952,_0x88eccf['yamlConfig'][_0x2f6c5d(0x1ce)],_0x88eccf[_0x2f6c5d(0x242)],_0x445ab7,_0x88eccf[_0x2f6c5d(0x202)]);_0xc9607d[_0x2f6c5d(0x1df)]=_0x557955;}catch(_0xc5f7d4){if(_0xc5f7d4 instanceof SDKError)throw _0xc5f7d4;throw new SDKError(ErrorCode[_0x2f6c5d(0x1cc)],_0x2f6c5d(0x196)+_0x88eccf[_0x2f6c5d(0x245)][_0x2f6c5d(0x1ce)]+_0x2f6c5d(0x142)+_0x88eccf[_0x2f6c5d(0x202)]+'\x0a\x20\x20'+getErrorMessage(_0xc5f7d4),_0xc5f7d4);}return _0xc9607d;},_0x5d9334=await batchAsync(_0x4e74dc,_0x43996b,_0x416ec5),_0x5f4bc3={'created':0x0,'updated':0x0,'deleted':0x0,'createdSegmentIds':new Map(),'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};for(const _0x1a0582 of _0x5d9334){_0x5f4bc3['created']+=_0x1a0582[_0x2f9ad0(0x1dc)],_0x5f4bc3[_0x2f9ad0(0x17c)]+=_0x1a0582[_0x2f9ad0(0x17c)],_0x1a0582[_0x2f9ad0(0x161)]&&_0x5f4bc3[_0x2f9ad0(0x200)][_0x2f9ad0(0x172)](_0x1a0582[_0x2f9ad0(0x161)]['name'],_0x1a0582[_0x2f9ad0(0x161)]['id']),_0x5f4bc3[_0x2f9ad0(0x1df)][_0x2f9ad0(0x1dc)]+=_0x1a0582[_0x2f9ad0(0x1df)][_0x2f9ad0(0x1dc)],_0x5f4bc3[_0x2f9ad0(0x1df)][_0x2f9ad0(0x17c)]+=_0x1a0582[_0x2f9ad0(0x1df)][_0x2f9ad0(0x17c)],_0x5f4bc3[_0x2f9ad0(0x1df)][_0x2f9ad0(0x1c7)]+=_0x1a0582['activations'][_0x2f9ad0(0x1c7)];}return _0x5f4bc3;}async function syncActivationsForSegment(_0x2cefd8,_0xe1c161,_0x4cd661,_0x39ca84,_0x369e83,_0x25a881,_0x359c99){const _0x3562e2=a152_0x59916b,_0xcb1fd8={'created':0x0,'updated':0x0,'deleted':0x0};for(const _0xbc1bc4 of _0x369e83){try{if(_0xbc1bc4[_0x3562e2(0x216)]==='create'&&_0xbc1bc4['validatedRequest'])_0x25a881[_0x3562e2(0x224)]?.({'type':'activation_creating','segmentName':_0x39ca84,'activationName':_0xbc1bc4[_0x3562e2(0x1ce)]}),await _0x25a881[_0x3562e2(0x23e)]('Creating\x20activation\x20\x27'+_0xbc1bc4[_0x3562e2(0x1ce)]+_0x3562e2(0x1aa),()=>_0x2cefd8[_0x3562e2(0x240)][_0x3562e2(0x143)](_0xe1c161,_0x4cd661,_0xbc1bc4[_0x3562e2(0x152)])),_0x25a881['onProgress']?.({'type':'activation_created','segmentName':_0x39ca84,'activationName':_0xbc1bc4['name']}),_0x25a881['logSuccess']?.(_0x3562e2(0x222)+_0xbc1bc4['name']+'\x27'),_0xcb1fd8[_0x3562e2(0x1dc)]++;else{if(_0xbc1bc4[_0x3562e2(0x216)]===_0x3562e2(0x1b1)&&_0xbc1bc4[_0x3562e2(0x152)]&&_0xbc1bc4['existingActivation'])_0x25a881[_0x3562e2(0x224)]?.({'type':_0x3562e2(0x244),'segmentName':_0x39ca84,'activationName':_0xbc1bc4[_0x3562e2(0x1ce)]}),await _0x25a881['withProgress']('Updating\x20activation\x20\x27'+_0xbc1bc4[_0x3562e2(0x1ce)]+_0x3562e2(0x1aa),()=>_0x2cefd8['segment'][_0x3562e2(0x1d8)](_0xe1c161,_0x4cd661,_0xbc1bc4[_0x3562e2(0x1af)]['id'],_0xbc1bc4[_0x3562e2(0x152)])),_0x25a881[_0x3562e2(0x224)]?.({'type':_0x3562e2(0x21b),'segmentName':_0x39ca84,'activationName':_0xbc1bc4[_0x3562e2(0x1ce)]}),_0x25a881['logSuccess']?.(_0x3562e2(0x150)+_0xbc1bc4['name']+'\x27'),_0xcb1fd8['updated']++;else _0xbc1bc4['type']===_0x3562e2(0x193)&&_0xbc1bc4[_0x3562e2(0x1af)]&&(_0x25a881[_0x3562e2(0x224)]?.({'type':_0x3562e2(0x214),'segmentName':_0x39ca84,'activationName':_0xbc1bc4[_0x3562e2(0x1ce)]}),await _0x25a881[_0x3562e2(0x23e)](_0x3562e2(0x182)+_0xbc1bc4[_0x3562e2(0x1ce)]+_0x3562e2(0x1aa),()=>_0x2cefd8[_0x3562e2(0x240)][_0x3562e2(0x1f4)](_0xe1c161,_0x4cd661,_0xbc1bc4[_0x3562e2(0x1af)]['id'])),_0x25a881[_0x3562e2(0x224)]?.({'type':'activation_deleted','segmentName':_0x39ca84,'activationName':_0xbc1bc4[_0x3562e2(0x1ce)]}),_0x25a881[_0x3562e2(0x16b)]?.(_0x3562e2(0x1bb)+_0xbc1bc4[_0x3562e2(0x1ce)]+'\x27'),_0xcb1fd8[_0x3562e2(0x1c7)]++);}}catch(_0x4010af){const _0x15bf09=isHttp400Error(_0x4010af),_0xafbbe5=_0x15bf09?ErrorCode[_0x3562e2(0x165)]:ErrorCode[_0x3562e2(0x1cc)],_0x121a92=getErrorMessage(_0x4010af);throw new SDKError(_0xafbbe5,_0x3562e2(0x184)+_0xbc1bc4[_0x3562e2(0x216)]+_0x3562e2(0x17f)+_0xbc1bc4[_0x3562e2(0x1ce)]+_0x3562e2(0x142)+_0x359c99+_0x3562e2(0x1ab)+_0x121a92,_0x4010af);}}return _0xcb1fd8;}export async function executePushFolders(_0x3d07a5,_0x327f0d,_0x189ecd,_0xeb48c1,_0x440b1a){const _0x50514a=a152_0x59916b,_0x205fe7=new Map(_0x189ecd),_0x3933b0=sortFoldersByDepth(_0x327f0d);for(const _0x33c87a of _0x3933b0){const _0x508381=_0x33c87a[_0x50514a(0x1e8)]('/'),_0x533c20=_0x508381[_0x508381[_0x50514a(0x1fd)]-0x1],_0x22548f=_0x508381['slice'](0x0,-0x1)['join']('/'),_0x194fd3=_0x205fe7['get'](_0x22548f);_0x440b1a[_0x50514a(0x224)]?.({'type':_0x50514a(0x174),'folder':_0x33c87a});const _0x24283f={'name':_0x533c20,'parentFolderId':_0x194fd3},_0x2aa1c1=await _0x440b1a[_0x50514a(0x23e)]('Creating\x20folder\x20\x27'+_0x33c87a+_0x50514a(0x1aa),()=>_0x3d07a5[_0x50514a(0x240)][_0x50514a(0x1ea)](_0xeb48c1[_0x50514a(0x1c5)],_0x24283f));_0x205fe7[_0x50514a(0x172)](_0x33c87a,_0x2aa1c1['data']['id']),_0x440b1a[_0x50514a(0x224)]?.({'type':_0x50514a(0x151),'folder':_0x33c87a,'folderId':_0x2aa1c1[_0x50514a(0x1b6)]['id']}),_0x440b1a[_0x50514a(0x185)]?.('Created\x20folder\x20\x27'+_0x33c87a+'\x27');}return _0x205fe7;}export async function executePushSegmentDeletions(_0x1068cc,_0x859a7,_0x13ad19){const _0x22f52d=a152_0x59916b;if(_0x859a7[_0x22f52d(0x1fd)]===0x0)return 0x0;const {batchAsync:_0x3f3164}=await import(_0x22f52d(0x158)),_0x2436a4=0x5,_0x39f5d8=await _0x3f3164(_0x859a7,async _0x472953=>{const _0x442197=_0x22f52d;return _0x13ad19[_0x442197(0x224)]?.({'type':_0x442197(0x178),'name':_0x472953[_0x442197(0x1ce)]}),await _0x1068cc['segment'][_0x442197(0x22e)](_0x472953['id']),_0x13ad19['onProgress']?.({'type':_0x442197(0x1b9),'name':_0x472953[_0x442197(0x1ce)]}),_0x13ad19[_0x442197(0x16b)]?.('Deleted\x20segment\x20\x27'+_0x472953[_0x442197(0x1ce)]+'\x27'),0x1;},_0x2436a4);return _0x39f5d8[_0x22f52d(0x21e)]((_0x332287,_0x2b2ea8)=>_0x332287+_0x2b2ea8,0x0);}export async function executePushJourneys(_0x5f1422,_0x2b7610,_0x21aa85,_0x3d4280,_0x49444e){const _0x4c3656=a152_0x59916b,{journeyDefToRequest:_0x462a49}=await import(_0x4c3656(0x13f)),{activationDefToCreateRequest:_0x17d97b,yamlRuleToApi:_0x1856f0,validateSegmentRule:_0x1af0f4}=await import(_0x4c3656(0x20c)),_0x58b820={'results':[],'created':0x0,'updated':0x0,'embeddedSegmentNameToId':new Map()},_0x4c42bf=new Map(_0x21aa85['segmentNameToId']),_0x3f0173=0x5;for(let _0x3a2eea=0x0;_0x3a2eea<_0x2b7610[_0x4c3656(0x1fd)];_0x3a2eea+=_0x3f0173){const _0x51817a=_0x2b7610['slice'](_0x3a2eea,_0x3a2eea+_0x3f0173),_0x6f670=await Promise['all'](_0x51817a[_0x4c3656(0x1da)](async _0x4b0f62=>{const _0x33c20e=_0x4c3656;if(!_0x4b0f62[_0x33c20e(0x190)]&&!_0x4b0f62[_0x33c20e(0x1f7)])return{'action':_0x33c20e(0x181),'name':_0x4b0f62[_0x33c20e(0x245)][_0x33c20e(0x1ce)],'journeyId':_0x4b0f62[_0x33c20e(0x1f0)]?.['id']};const _0x45acad=_0x4b0f62[_0x33c20e(0x14e)]?_0x21aa85[_0x33c20e(0x1b0)][_0x33c20e(0x21c)](_0x4b0f62[_0x33c20e(0x14e)]):undefined;_0x49444e[_0x33c20e(0x224)]?.({'type':_0x4b0f62[_0x33c20e(0x190)]?_0x33c20e(0x201):_0x33c20e(0x234),'name':_0x4b0f62['yamlConfig'][_0x33c20e(0x1ce)]});try{const _0xbfae44=await executeSingleJourneyPush(_0x5f1422,_0x4b0f62,{..._0x21aa85,'segmentNameToId':_0x4c42bf},{'parentId':_0x3d4280[_0x33c20e(0x1c5)],'rootFolderId':_0x3d4280[_0x33c20e(0x1e4)],'folderId':_0x45acad,'verbose':_0x3d4280[_0x33c20e(0x195)]},_0x49444e,{'journeyDefToRequest':_0x462a49,'activationDefToCreateRequest':_0x17d97b,'yamlRuleToApi':_0x1856f0,'validateSegmentRule':_0x1af0f4});for(const [_0x55b2c3,_0x50713a]of _0xbfae44[_0x33c20e(0x1eb)]){_0x4c42bf[_0x33c20e(0x172)](_0x55b2c3,_0x50713a),_0x58b820[_0x33c20e(0x1eb)][_0x33c20e(0x172)](_0x55b2c3,_0x50713a);}if(_0xbfae44['action']===_0x33c20e(0x1dc))_0x49444e[_0x33c20e(0x224)]?.({'type':_0x33c20e(0x22a),'name':_0x4b0f62[_0x33c20e(0x245)][_0x33c20e(0x1ce)],'journeyId':_0xbfae44[_0x33c20e(0x223)]}),_0x49444e['logSuccess']?.('Created\x20journey\x20\x27'+_0x4b0f62[_0x33c20e(0x245)]['name']+'\x27'),_0x58b820[_0x33c20e(0x1dc)]++;else _0xbfae44[_0x33c20e(0x1b7)]==='updated'&&(_0x49444e[_0x33c20e(0x224)]?.({'type':_0x33c20e(0x160),'name':_0x4b0f62[_0x33c20e(0x245)][_0x33c20e(0x1ce)]}),_0x49444e[_0x33c20e(0x1e6)]?.(_0x33c20e(0x1bd)+_0x4b0f62[_0x33c20e(0x245)]['name']+'\x27'),_0x58b820[_0x33c20e(0x17c)]++);return{'action':_0xbfae44[_0x33c20e(0x1b7)],'name':_0x4b0f62[_0x33c20e(0x245)][_0x33c20e(0x1ce)],'journeyId':_0xbfae44[_0x33c20e(0x223)]};}catch(_0x152caa){const _0x13fdb9=isHttp400Error(_0x152caa),_0xc51b96=_0x13fdb9?ErrorCode[_0x33c20e(0x19b)]:ErrorCode['JOURNEY_UPDATE_ERROR'],_0x22fa48=getErrorMessage(_0x152caa);throw new SDKError(_0xc51b96,_0x33c20e(0x184)+(_0x4b0f62['isNew']?_0x33c20e(0x241):_0x33c20e(0x1b1))+'\x20journey\x20from\x20file:\x20'+_0x4b0f62[_0x33c20e(0x202)]+'\x0a\x20\x20'+_0x22fa48,_0x152caa);}}));_0x58b820['results'][_0x4c3656(0x1ae)](..._0x6f670);}return _0x58b820;}async function matchExistingJourneySegments(_0x4115e2,_0x47cb7e,_0x36dbb8,_0x552acf,_0x3d6f91){const _0x59e8a1=a152_0x59916b;if(!_0x47cb7e[_0x59e8a1(0x1f0)]||!_0x47cb7e[_0x59e8a1(0x245)][_0x59e8a1(0x23d)])return;const _0x24b240=new Map(),_0x41d105=new Set();for(const _0x1496d2 of Object[_0x59e8a1(0x141)](_0x47cb7e['yamlConfig']['segments'])){const _0x1f6e85=generateDeterministicJourneySegmentName(_0x47cb7e[_0x59e8a1(0x245)][_0x59e8a1(0x1ce)],_0x1496d2);_0x24b240[_0x59e8a1(0x172)](_0x1f6e85,_0x1496d2),_0x41d105[_0x59e8a1(0x180)](_0x1496d2);}const _0x4d0f07=[],_0x4969ed=collectSegmentIdsFromJourneyApi(_0x47cb7e[_0x59e8a1(0x1f0)]);for(const _0x3fba49 of _0x4969ed){const _0x49b58e=await fetchSegment(_0x4115e2,_0x36dbb8,_0x3fba49,_0x552acf);if(!_0x49b58e?.[_0x59e8a1(0x1ce)])continue;const _0x50139c=_0x24b240[_0x59e8a1(0x21c)](_0x49b58e[_0x59e8a1(0x1ce)]);_0x50139c?(_0x3d6f91['set'](_0x50139c,_0x3fba49),_0x41d105[_0x59e8a1(0x193)](_0x50139c)):_0x4d0f07[_0x59e8a1(0x1ae)]({'id':_0x3fba49,'seg':_0x49b58e});}if(_0x41d105[_0x59e8a1(0x1ff)]>0x0&&_0x4d0f07[_0x59e8a1(0x1fd)]>0x0){const {localExpandedRuleToNames:_0x4589ca}=buildLocalExpandedRuleMappings(_0x47cb7e['yamlConfig']),_0x3ec683=new Map();for(const {id:_0x2d0d39,seg:_0x373dc2}of _0x4d0f07){if(_0x373dc2[_0x59e8a1(0x176)]){const _0x119a43=apiRuleToYaml(_0x373dc2[_0x59e8a1(0x176)]);_0x3ec683[_0x59e8a1(0x172)](_0x2d0d39,_0x119a43);}}for(const {id:_0xde403,seg:_0xc6b2f2}of _0x4d0f07){if(!_0xc6b2f2[_0x59e8a1(0x176)])continue;const _0x14e6d3=_0x3ec683[_0x59e8a1(0x21c)](_0xde403);if(!_0x14e6d3)continue;const _0x5e9316=serializeExpandedRule(_0x14e6d3,_0x3ec683),_0x52e184=_0x4589ca[_0x59e8a1(0x21c)](_0x5e9316);if(_0x52e184){const _0x50a840=_0x52e184[_0x59e8a1(0x16c)](_0x3fb4ec=>_0x41d105[_0x59e8a1(0x145)](_0x3fb4ec));_0x50a840&&(_0x3d6f91['set'](_0x50a840,_0xde403),_0x41d105[_0x59e8a1(0x193)](_0x50a840),logger[_0x59e8a1(0x186)](_0x59e8a1(0x183)+_0xc6b2f2[_0x59e8a1(0x1ce)]+_0x59e8a1(0x1e0)+_0x50a840+_0x59e8a1(0x17a)));}}}}async function executeSingleJourneyPush(_0x43f726,_0x2e525e,_0x26386d,_0x4e74da,_0x2c2f8f,_0x56b4d1){const _0xe4749c=a152_0x59916b,{journeyDefToRequest:_0x1452d3,activationDefToCreateRequest:_0x4c826a,yamlRuleToApi:_0x5a9b64,validateSegmentRule:_0x2965f7}=_0x56b4d1,_0x4286e6=new Map(),_0x1143c9=new Map();recoverSegmentIdsFromPushRecovery(_0x2e525e,_0x4286e6,_0x26386d['segmentNameToId']);const _0x2e4dd0=new Map(),_0x1da4b0=new Map(),_0x7af2ad=new Map();let _0x1d58b1;const _0x81162=async()=>{const _0x220232=a152_0x54b0;if(_0x1d58b1)return;_0x1d58b1=new Map();if(!_0x2e525e['existingJourney'])return;const _0x35f6fd=await _0x43f726[_0x220232(0x13e)][_0x220232(0x1ee)](_0x2e525e[_0x220232(0x1f0)]['id']);for(const _0x36163b of _0x35f6fd){const _0x1b7ae1=journeyActivationStepToYaml(_0x36163b,_0x26386d['idToEmailMap'],_0x26386d[_0x220232(0x247)]),_0x3a7046=activationSignature(_0x1b7ae1);!_0x1d58b1[_0x220232(0x145)](_0x3a7046)&&_0x1d58b1[_0x220232(0x172)](_0x3a7046,_0x36163b['id']),_0x1b7ae1[_0x220232(0x1ce)]&&_0x1143c9[_0x220232(0x172)](_0x1b7ae1[_0x220232(0x1ce)],_0x36163b['id']);}};await matchExistingJourneySegments(_0x43f726,_0x2e525e,_0x4e74da['parentId'],_0x26386d[_0xe4749c(0x1bf)],_0x26386d['segmentNameToId']);const _0x53bd51={'resolveSegmentId':async _0x5c1858=>{const _0x4e1fd7=_0xe4749c,_0x2d0fe0=_0x26386d[_0x4e1fd7(0x20d)][_0x4e1fd7(0x21c)](_0x5c1858);if(!_0x2d0fe0)throw new SDKError(ErrorCode['SEGMENT_NOT_FOUND'],_0x4e1fd7(0x213)+_0x5c1858+_0x4e1fd7(0x177)+_0x2e525e[_0x4e1fd7(0x245)]['name']+')');return _0x2d0fe0;},'resolveEmbeddedSegmentId':async(_0x130ec0,_0x173808)=>{const _0x3073ce=_0xe4749c,_0x13669f=_0x26386d[_0x3073ce(0x20d)]['get'](_0x130ec0);if(_0x13669f)return _0x13669f;const _0x154669=_0x26386d[_0x3073ce(0x1bf)][_0x3073ce(0x16c)](_0xd8f6e=>_0xd8f6e[_0x3073ce(0x1ce)]===_0x130ec0);if(_0x154669)return _0x26386d['segmentNameToId'][_0x3073ce(0x172)](_0x130ec0,_0x154669['id']),_0x154669['id'];if(_0x2e525e[_0x3073ce(0x190)]){const {stageName:_0x1c037a,criteriaName:_0x47f62e}=findSegmentCriteriaLocation(_0x2e525e[_0x3073ce(0x245)],_0x130ec0);return _0x2965f7(_0x130ec0,_0x173808[_0x3073ce(0x176)]),_0x1da4b0[_0x3073ce(0x172)](_0x130ec0,{'definition':_0x173808,'stageName':_0x1c037a,'criteriaName':_0x47f62e}),createPendingSegmentId(_0x130ec0);}const _0x320b60=_0x2e525e[_0x3073ce(0x1f0)]?.['id'];if(!_0x320b60)throw new SDKError(ErrorCode[_0x3073ce(0x1e2)],'Cannot\x20create\x20embedded\x20segment\x20for\x20existing\x20journey\x20without\x20journey\x20ID');const _0x4dbf6e=_0x2e4dd0['get'](_0x130ec0);if(_0x4dbf6e)return _0x4dbf6e;const _0x323695=((async()=>{const _0xa929bb=_0x3073ce;_0x2965f7(_0x130ec0,_0x173808[_0xa929bb(0x176)]);const _0x100520=generateDeterministicJourneySegmentName(_0x2e525e[_0xa929bb(0x245)][_0xa929bb(0x1ce)],_0x130ec0),_0x2f15e7=_0x26386d[_0xa929bb(0x1bf)][_0xa929bb(0x16c)](_0x2f6398=>_0x2f6398[_0xa929bb(0x1ce)]===_0x100520),_0x33c6e0=createSegmentIdResolver(_0x26386d[_0xa929bb(0x20d)],_0x130ec0),_0x3c3cf8=await resolveRuleSegmentIds(_0x173808[_0xa929bb(0x176)],_0x33c6e0);let _0x30ccc8;return _0x2f15e7?(await _0x43f726[_0xa929bb(0x240)][_0xa929bb(0x1ad)](_0x4e74da[_0xa929bb(0x1c5)],_0x2f15e7['id'],{'description':_0x173808[_0xa929bb(0x1a3)]||_0xa929bb(0x1f8)+_0x130ec0,'rule':_0x5a9b64(_0x3c3cf8,!![]),'countPopulation':!![]}),_0x30ccc8=_0x2f15e7['id'],saveSegmentToPushRecovery(_0x2e525e[_0xa929bb(0x202)],_0x2e525e[_0xa929bb(0x245)][_0xa929bb(0x1ce)],_0x130ec0,{'segmentId':_0x30ccc8,'uniqueServerName':_0x100520,'createdAt':new Date()[_0xa929bb(0x22d)]()})):_0x30ccc8=await createOrRecoverEmbeddedSegment(_0x43f726,_0x2e525e,{'localName':_0x130ec0,'uniqueSegmentName':_0x100520,'description':_0x173808[_0xa929bb(0x1a3)]||'Entry\x20criteria:\x20'+_0x130ec0,'journeyId':_0x320b60,'resolvedRule':_0x3c3cf8,'parentId':_0x4e74da['parentId'],'folderId':_0x4e74da[_0xa929bb(0x1e4)]||''},_0x5a9b64),_0x26386d[_0xa929bb(0x20d)]['set'](_0x130ec0,_0x30ccc8),_0x4286e6[_0xa929bb(0x172)](_0x130ec0,_0x30ccc8),_0x30ccc8;})());_0x2e4dd0[_0x3073ce(0x172)](_0x130ec0,_0x323695);try{return await _0x323695;}finally{_0x2e4dd0[_0x3073ce(0x193)](_0x130ec0);}},'resolveActivationId':async _0x412dfd=>{const _0x3d5e01=_0xe4749c,_0x14306a=_0x1143c9[_0x3d5e01(0x21c)](_0x412dfd);if(_0x14306a)return _0x14306a;if(_0x2e525e[_0x3d5e01(0x1f0)]){await _0x81162();const _0x3f9e8f=_0x1143c9[_0x3d5e01(0x21c)](_0x412dfd);if(_0x3f9e8f)return _0x3f9e8f;}throw new SDKError(ErrorCode[_0x3d5e01(0x15f)],_0x3d5e01(0x198)+_0x412dfd+_0x3d5e01(0x177)+_0x2e525e[_0x3d5e01(0x245)][_0x3d5e01(0x1ce)]+_0x3d5e01(0x21f)+_0x3d5e01(0x170));},'resolveEmbeddedActivationId':async(_0x5de786,_0x3f0c2d)=>{const _0x15b1c9=_0xe4749c,_0x18be07=_0x1143c9[_0x15b1c9(0x21c)](_0x5de786);if(_0x18be07)return _0x18be07;if(_0x2e525e['isNew'])return _0x7af2ad['set'](_0x5de786,_0x3f0c2d),createPendingActivationId(_0x5de786);if(_0x2e525e[_0x15b1c9(0x1f0)]){await _0x81162();const _0x5354df=_0x1143c9[_0x15b1c9(0x21c)](_0x3f0c2d[_0x15b1c9(0x1ce)]);if(_0x5354df)return _0x1143c9['set'](_0x5de786,_0x5354df),_0x5354df;const _0x41df67=activationSignature(_0x3f0c2d),_0x3c9f7d=_0x1d58b1?.['get'](_0x41df67);if(_0x3c9f7d)return _0x1143c9['set'](_0x5de786,_0x3c9f7d),_0x3c9f7d;const _0x20c667=await _0x4c826a(_0x3f0c2d,_0x26386d[_0x15b1c9(0x1b8)]),_0x1aadce={..._0x20c667,..._0x3f0c2d[_0x15b1c9(0x179)]!==undefined&&{'runAfterJourneyRefresh':_0x3f0c2d[_0x15b1c9(0x179)]}},_0x565582=await _0x43f726['journey'][_0x15b1c9(0x143)](_0x2e525e[_0x15b1c9(0x1f0)]['id'],_0x1aadce);return _0x1143c9[_0x15b1c9(0x172)](_0x5de786,_0x565582['id']),_0x565582['id'];}throw new SDKError(ErrorCode[_0x15b1c9(0x1e2)],_0x15b1c9(0x18e));},'resolveJourneyId':async _0x3f3a18=>{const _0x10651e=_0xe4749c;try{return await _0x43f726[_0x10651e(0x13e)][_0x10651e(0x23f)](_0x4e74da[_0x10651e(0x1c5)],_0x3f3a18);}catch(_0x4d3ad1){throw new SDKError(ErrorCode['NOT_FOUND'],_0x10651e(0x18b)+_0x3f3a18+_0x10651e(0x1d0)+_0x2e525e[_0x10651e(0x245)][_0x10651e(0x1ce)]+'\x27)',_0x4d3ad1);}},'resolveStageId':async(_0x355a56,_0xdd0803)=>{const _0x29c347=_0xe4749c,_0x5bf2f6=await _0x43f726[_0x29c347(0x13e)][_0x29c347(0x229)](_0x355a56),_0x24f640=_0x5bf2f6[_0x29c347(0x211)][_0x29c347(0x1ca)]['find'](_0x5af390=>_0x5af390['name'][_0x29c347(0x1d1)]()===_0xdd0803[_0x29c347(0x1d1)]());if(!_0x24f640?.['id'])throw new SDKError(ErrorCode[_0x29c347(0x15f)],_0x29c347(0x19e)+_0xdd0803+_0x29c347(0x239)+(_0x5bf2f6['attributes'][_0x29c347(0x15c)]||_0x5bf2f6[_0x29c347(0x211)][_0x29c347(0x1ce)])+'\x27');return _0x24f640['id'];}},_0x2b1519=await _0x1452d3(_0x2e525e[_0xe4749c(0x245)],_0x4e74da[_0xe4749c(0x1c5)],_0x53bd51),_0x46d0bf=_0x4e74da[_0xe4749c(0x169)]||_0x4e74da[_0xe4749c(0x1e4)];_0x46d0bf&&(_0x2b1519[_0xe4749c(0x1ef)]={'parentFolder':{'data':{'id':_0x46d0bf,'type':_0xe4749c(0x19a)}}});if(_0x2e525e[_0xe4749c(0x190)]){if(_0x1da4b0[_0xe4749c(0x1ff)]>0x0||_0x7af2ad[_0xe4749c(0x1ff)]>0x0)return await executeThreeStepJourneyCreate(_0x43f726,_0x2e525e,_0x2b1519,{'pendingEmbeddedSegments':_0x1da4b0,'pendingEmbeddedActivations':_0x7af2ad,'embeddedSegmentNameToId':_0x4286e6,'journeyActivationNameToId':_0x1143c9},{..._0x4e74da,'effectiveFolderId':_0x46d0bf},_0x26386d,_0x2c2f8f,_0x56b4d1);else{ensureJourneyDefaults(_0x2b1519[_0xe4749c(0x211)]);const _0x3590f8=await _0x43f726[_0xe4749c(0x13e)][_0xe4749c(0x241)](_0x2b1519);return deletePushRecovery(_0x2e525e[_0xe4749c(0x202)]),{'action':'created','journeyId':_0x3590f8['id'],'embeddedSegmentNameToId':_0x4286e6};}}else{if(_0x2e525e[_0xe4749c(0x1f7)]&&_0x2e525e[_0xe4749c(0x1f0)]){_0x2b1519['id']=_0x2e525e[_0xe4749c(0x1f0)]['id'];const _0x3da5bf=_0x2b1519[_0xe4749c(0x211)];_0x2e525e['existingJourney'][_0xe4749c(0x211)]?.[_0xe4749c(0x15c)]&&(_0x3da5bf['journeyBundleName']=_0x2e525e['existingJourney'][_0xe4749c(0x211)][_0xe4749c(0x15c)]);const _0x3769fe=_0x2e525e['existingJourney'][_0xe4749c(0x211)]?.[_0xe4749c(0x1ca)];return _0x3769fe&&_0x2b1519[_0xe4749c(0x211)][_0xe4749c(0x1ca)]&&injectExistingStageIds(_0x2b1519[_0xe4749c(0x211)][_0xe4749c(0x1ca)],_0x3769fe),ensureJourneyDefaults(_0x3da5bf),await _0x43f726['journey'][_0xe4749c(0x1b1)](_0x2e525e[_0xe4749c(0x1f0)]['id'],_0x2b1519),deletePushRecovery(_0x2e525e[_0xe4749c(0x202)]),{'action':_0xe4749c(0x17c),'journeyId':_0x2e525e[_0xe4749c(0x1f0)]['id'],'embeddedSegmentNameToId':_0x4286e6};}}return deletePushRecovery(_0x2e525e['absolutePath']),{'action':_0xe4749c(0x181),'journeyId':_0x2e525e[_0xe4749c(0x1f0)]?.['id'],'embeddedSegmentNameToId':_0x4286e6};}function findSegmentCriteriaLocation(_0x16fe36,_0x5ea9d3){const _0x18b84d=a152_0x59916b,_0x11c30f=_0x16fe36[_0x18b84d(0x1ba)]||_0x16fe36[_0x18b84d(0x232)]?.[0x0]?.[_0x18b84d(0x1ba)]||[];let _0x5528e8=_0x18b84d(0x16e),_0x5a646f=_0x5ea9d3;const _0x269714=_0x16fe36[_0x18b84d(0x227)]||_0x16fe36[_0x18b84d(0x232)]?.[0x0]?.[_0x18b84d(0x227)];if(_0x269714?.[_0x18b84d(0x240)]===_0x5ea9d3)return{'stageName':'goal','criteriaName':_0x269714[_0x18b84d(0x1ce)]||_0x5ea9d3};_0x215a08:for(const _0x97b1b4 of _0x11c30f){if(_0x97b1b4[_0x18b84d(0x20b)]?.['segment']===_0x5ea9d3){_0x5528e8=_0x97b1b4[_0x18b84d(0x1ce)],_0x5a646f=_0x97b1b4[_0x18b84d(0x20b)]['name']||_0x5ea9d3;break;}if(_0x97b1b4[_0x18b84d(0x18d)])for(const _0x594ad1 of _0x97b1b4[_0x18b84d(0x18d)]){if(_0x594ad1[_0x18b84d(0x216)]===_0x18b84d(0x18f)&&_0x594ad1[_0x18b84d(0x155)]?.['branches'])for(const _0x45913a of _0x594ad1[_0x18b84d(0x155)][_0x18b84d(0x210)]){if(_0x45913a['segment']===_0x5ea9d3){_0x5528e8=_0x97b1b4[_0x18b84d(0x1ce)],_0x5a646f=_0x45913a[_0x18b84d(0x1ce)]||_0x5ea9d3;break _0x215a08;}}}}return{'stageName':_0x5528e8,'criteriaName':_0x5a646f};}async function executeThreeStepJourneyCreate(_0x111b10,_0x4e323a,_0x16e2f4,_0x181b0b,_0x36211d,_0x35b752,_0x42d6f7,_0x1e6dd8){const _0x40f436=a152_0x59916b,{activationDefToCreateRequest:_0x5b23ef,yamlRuleToApi:_0x1ac70c}=_0x1e6dd8,{pendingEmbeddedSegments:_0x32f862,pendingEmbeddedActivations:_0x42847f,embeddedSegmentNameToId:_0x6739cd}=_0x181b0b,_0x1f00f8=JSON[_0x40f436(0x14c)](JSON[_0x40f436(0x18a)](_0x16e2f4));ensureJourneyDefaults(_0x1f00f8[_0x40f436(0x211)]),stripPendingIds(_0x1f00f8);const _0x15779c=await _0x111b10[_0x40f436(0x13e)]['create'](_0x1f00f8),_0x1bc42d=_0x15779c['id'],_0x5be842=new Map();for(const _0xbd7fad of _0x15779c[_0x40f436(0x211)][_0x40f436(0x1ca)]){_0x5be842[_0x40f436(0x172)](_0xbd7fad[_0x40f436(0x1ce)][_0x40f436(0x1d1)](),_0xbd7fad['id']);}recoverSegmentIdsFromPushRecovery(_0x4e323a,_0x6739cd,_0x35b752[_0x40f436(0x20d)]);for(const [_0x56eef1,{definition:_0x31e2f2}]of _0x32f862){if(_0x6739cd[_0x40f436(0x145)](_0x56eef1)){_0x42d6f7[_0x40f436(0x224)]?.({'type':_0x40f436(0x1a7),'journeyName':_0x4e323a[_0x40f436(0x245)][_0x40f436(0x1ce)],'segmentName':_0x56eef1});continue;}const _0x3fe8ef=generateDeterministicJourneySegmentName(_0x4e323a[_0x40f436(0x245)][_0x40f436(0x1ce)],_0x56eef1);_0x42d6f7[_0x40f436(0x224)]?.({'type':_0x40f436(0x1c2),'journeyName':_0x4e323a['yamlConfig'][_0x40f436(0x1ce)],'segmentName':_0x56eef1});const _0x4fe8aa=createSegmentIdResolver(_0x35b752['segmentNameToId'],_0x56eef1),_0x111c9c=await resolveRuleSegmentIds(_0x31e2f2[_0x40f436(0x176)],_0x4fe8aa),_0x209a2b=await createOrRecoverEmbeddedSegment(_0x111b10,_0x4e323a,{'localName':_0x56eef1,'uniqueSegmentName':_0x3fe8ef,'description':_0x31e2f2['description']||_0x40f436(0x1f8)+_0x56eef1,'journeyId':_0x1bc42d,'resolvedRule':_0x111c9c,'parentId':_0x36211d[_0x40f436(0x1c5)],'folderId':_0x36211d[_0x40f436(0x21a)]||''},_0x1ac70c);_0x6739cd[_0x40f436(0x172)](_0x56eef1,_0x209a2b),_0x35b752[_0x40f436(0x20d)][_0x40f436(0x172)](_0x56eef1,_0x209a2b),_0x42d6f7[_0x40f436(0x224)]?.({'type':_0x40f436(0x1a7),'journeyName':_0x4e323a[_0x40f436(0x245)][_0x40f436(0x1ce)],'segmentName':_0x56eef1});}const _0x32ccec=new Map();for(const [_0x2f8476,_0x2fd152]of _0x42847f){_0x42d6f7['onProgress']?.({'type':'embedded_activation_creating','journeyName':_0x4e323a[_0x40f436(0x245)]['name'],'activationName':_0x2f8476});const _0x523776=await _0x5b23ef(_0x2fd152,_0x35b752[_0x40f436(0x1b8)]),_0x52a627={..._0x523776,..._0x2fd152[_0x40f436(0x179)]!==undefined&&{'runAfterJourneyRefresh':_0x2fd152[_0x40f436(0x179)]}},_0x4bbae5=await _0x111b10['journey'][_0x40f436(0x143)](_0x1bc42d,_0x52a627);_0x32ccec[_0x40f436(0x172)](_0x2f8476,_0x4bbae5['id']),_0x181b0b[_0x40f436(0x215)][_0x40f436(0x172)](_0x2f8476,_0x4bbae5['id']),_0x42d6f7[_0x40f436(0x224)]?.({'type':_0x40f436(0x237),'journeyName':_0x4e323a['yamlConfig'][_0x40f436(0x1ce)],'activationName':_0x2f8476});}const _0x2cbc37=JSON['parse'](JSON['stringify'](_0x16e2f4));return _0x2cbc37['id']=_0x1bc42d,ensureJourneyDefaults(_0x2cbc37[_0x40f436(0x211)]),resolvePendingIdsInRequest(_0x2cbc37,_0x16e2f4,_0x5be842,_0x6739cd,_0x32ccec,_0x42d6f7),await _0x111b10[_0x40f436(0x13e)]['update'](_0x1bc42d,_0x2cbc37),deletePushRecovery(_0x4e323a[_0x40f436(0x202)]),{'action':'created','journeyId':_0x1bc42d,'embeddedSegmentNameToId':_0x6739cd};}export function stripWaitStepPendingIds(_0x20a5ac){const _0x3de059=a152_0x59916b,_0x22955b=_0x20a5ac[_0x3de059(0x21d)]&&isPendingSegmentId(_0x20a5ac[_0x3de059(0x21d)]),_0x2ceb84=_0x20a5ac['conditions']?.[_0x3de059(0x192)](_0x37411d=>_0x37411d[_0x3de059(0x16d)]&&isPendingSegmentId(_0x37411d[_0x3de059(0x16d)]));(_0x22955b||_0x2ceb84)&&(_0x20a5ac[_0x3de059(0x1e9)]=_0x3de059(0x1cf),_0x20a5ac[_0x3de059(0x17d)]=0x1,_0x20a5ac['waitStepUnit']=_0x3de059(0x16f),delete _0x20a5ac[_0x3de059(0x21d)],delete _0x20a5ac[_0x3de059(0x19d)],delete _0x20a5ac[_0x3de059(0x203)],delete _0x20a5ac[_0x3de059(0x1ed)]);}export function resolveWaitStepPendingIds(_0x56cfac,_0x1105eb,_0x4bad2b,_0x232a44){const _0x5cd8da=a152_0x59916b;if(_0x1105eb[_0x5cd8da(0x21d)]&&isPendingSegmentId(_0x1105eb[_0x5cd8da(0x21d)])){const _0x18267e=_0x4bad2b(_0x1105eb[_0x5cd8da(0x21d)],_0x5cd8da(0x1f9)+_0x232a44+'\x27\x20wait\x20condition');_0x18267e&&(_0x56cfac[_0x5cd8da(0x1e9)]=_0x5cd8da(0x243),_0x56cfac[_0x5cd8da(0x21d)]=_0x18267e,delete _0x56cfac['waitStep'],delete _0x56cfac[_0x5cd8da(0x205)],_0x1105eb[_0x5cd8da(0x19d)]!==undefined&&(_0x56cfac[_0x5cd8da(0x19d)]=_0x1105eb[_0x5cd8da(0x19d)]),_0x1105eb[_0x5cd8da(0x203)]&&(_0x56cfac['conditionTimeoutUnit']=_0x1105eb[_0x5cd8da(0x203)]));}if(_0x1105eb['conditions']){const _0x57d41e=_0x1105eb['conditions'][_0x5cd8da(0x192)](_0x447c52=>_0x447c52[_0x5cd8da(0x16d)]&&isPendingSegmentId(_0x447c52[_0x5cd8da(0x16d)]));if(_0x57d41e){const _0x1f484e=_0x1105eb[_0x5cd8da(0x1ed)][_0x5cd8da(0x1da)](_0x534963=>{const _0x66588f=_0x5cd8da;if(_0x534963['segmentId']&&isPendingSegmentId(_0x534963[_0x66588f(0x16d)])){const _0x2002fd=_0x4bad2b(_0x534963['segmentId'],_0x66588f(0x1f9)+_0x232a44+_0x66588f(0x1d6));return{..._0x534963,'segmentId':_0x2002fd||_0x534963[_0x66588f(0x16d)]};}return{..._0x534963};});_0x56cfac[_0x5cd8da(0x1e9)]=_0x5cd8da(0x243),_0x56cfac[_0x5cd8da(0x1ed)]=_0x1f484e,delete _0x56cfac[_0x5cd8da(0x17d)],delete _0x56cfac[_0x5cd8da(0x205)],delete _0x56cfac[_0x5cd8da(0x21d)],delete _0x56cfac[_0x5cd8da(0x19d)],delete _0x56cfac['conditionTimeoutUnit'];}}}function stripPendingIds(_0x506259){const _0x340f7a=a152_0x59916b;_0x506259['attributes'][_0x340f7a(0x227)]?.[_0x340f7a(0x16d)]&&isPendingSegmentId(_0x506259['attributes'][_0x340f7a(0x227)][_0x340f7a(0x16d)])&&delete _0x506259[_0x340f7a(0x211)][_0x340f7a(0x227)];for(const _0x2bc24f of _0x506259[_0x340f7a(0x211)][_0x340f7a(0x1ca)]||[]){_0x2bc24f[_0x340f7a(0x233)]?.[_0x340f7a(0x16d)]&&isPendingSegmentId(_0x2bc24f[_0x340f7a(0x233)][_0x340f7a(0x16d)])&&delete _0x2bc24f[_0x340f7a(0x233)];_0x2bc24f[_0x340f7a(0x19c)]?.[_0x340f7a(0x16d)]&&isPendingSegmentId(_0x2bc24f['milestone'][_0x340f7a(0x16d)])&&delete _0x2bc24f[_0x340f7a(0x19c)];_0x2bc24f[_0x340f7a(0x171)]&&(_0x2bc24f[_0x340f7a(0x171)]=_0x2bc24f[_0x340f7a(0x171)][_0x340f7a(0x197)](_0x289704=>!_0x289704[_0x340f7a(0x16d)]||!isPendingSegmentId(_0x289704[_0x340f7a(0x16d)])));if(_0x2bc24f[_0x340f7a(0x18d)])for(const _0xec5ad6 of Object['keys'](_0x2bc24f[_0x340f7a(0x18d)])){const _0x3cd292=_0x2bc24f['steps'][_0xec5ad6];_0x3cd292[_0x340f7a(0x216)]===_0x340f7a(0x23a)&&_0x3cd292['journeyActivationStepId']&&isPendingActivationId(_0x3cd292[_0x340f7a(0x1e5)])&&(_0x3cd292[_0x340f7a(0x1e5)]='');if(_0x3cd292['type']===_0x340f7a(0x15b)&&_0x3cd292[_0x340f7a(0x210)])for(const _0x488d93 of _0x3cd292[_0x340f7a(0x210)]){_0x488d93[_0x340f7a(0x16d)]&&isPendingSegmentId(_0x488d93[_0x340f7a(0x16d)])&&(_0x488d93[_0x340f7a(0x16d)]='');}_0x3cd292[_0x340f7a(0x216)]===_0x340f7a(0x1de)&&stripWaitStepPendingIds(_0x3cd292);}}}function resolvePendingIdsInRequest(_0x286472,_0x294d7d,_0x4287d6,_0x5180d8,_0x564360,_0x3b0d48){const _0xf752eb=a152_0x59916b,_0x3c47ca=(_0x2af67c,_0x4f6875)=>{const _0x5e8cb6=a152_0x54b0;if(!isPendingSegmentId(_0x2af67c))return _0x2af67c;const _0x2c91c3=extractPendingSegmentName(_0x2af67c),_0x547db1=_0x5180d8[_0x5e8cb6(0x21c)](_0x2c91c3);return!_0x547db1&&_0x3b0d48[_0x5e8cb6(0x16a)]?.(_0x5e8cb6(0x1c0)+_0x2c91c3+_0x5e8cb6(0x1ac)+_0x4f6875),_0x547db1;};if(_0x286472[_0xf752eb(0x211)]['goal']?.['segmentId']&&isPendingSegmentId(_0x286472['attributes'][_0xf752eb(0x227)]['segmentId'])){const _0x419e48=_0x3c47ca(_0x286472['attributes'][_0xf752eb(0x227)]['segmentId'],'goal\x20criteria');_0x419e48&&(_0x286472[_0xf752eb(0x211)][_0xf752eb(0x227)][_0xf752eb(0x16d)]=_0x419e48);}for(const _0x529792 of _0x286472[_0xf752eb(0x211)][_0xf752eb(0x1ca)]||[]){const _0x1dcc53=_0x4287d6[_0xf752eb(0x21c)](_0x529792[_0xf752eb(0x1ce)][_0xf752eb(0x1d1)]());_0x1dcc53&&(_0x529792['id']=_0x1dcc53);if(_0x529792['entryCriteria']?.['segmentId']&&isPendingSegmentId(_0x529792['entryCriteria'][_0xf752eb(0x16d)])){const _0x210df3=_0x3c47ca(_0x529792['entryCriteria'][_0xf752eb(0x16d)],_0xf752eb(0x1f9)+_0x529792[_0xf752eb(0x1ce)]+_0xf752eb(0x1a2));_0x210df3&&(_0x529792['entryCriteria'][_0xf752eb(0x16d)]=_0x210df3);}if(_0x529792['exitCriterias'])for(const _0x44a75b of _0x529792[_0xf752eb(0x171)]){if(_0x44a75b[_0xf752eb(0x16d)]&&isPendingSegmentId(_0x44a75b[_0xf752eb(0x16d)])){const _0x3ed467=_0x3c47ca(_0x44a75b[_0xf752eb(0x16d)],_0xf752eb(0x1f9)+_0x529792['name']+_0xf752eb(0x175));_0x3ed467&&(_0x44a75b[_0xf752eb(0x16d)]=_0x3ed467);}}if(_0x529792[_0xf752eb(0x19c)]?.[_0xf752eb(0x16d)]&&isPendingSegmentId(_0x529792[_0xf752eb(0x19c)][_0xf752eb(0x16d)])){const _0xb7d907=_0x3c47ca(_0x529792[_0xf752eb(0x19c)][_0xf752eb(0x16d)],_0xf752eb(0x1f9)+_0x529792[_0xf752eb(0x1ce)]+_0xf752eb(0x22c));_0xb7d907&&(_0x529792['milestone'][_0xf752eb(0x16d)]=_0xb7d907);}if(_0x529792['steps']){const _0x38b293=_0x8a3230=>_0x294d7d[_0xf752eb(0x211)][_0xf752eb(0x1ca)]?.[_0xf752eb(0x16c)](_0x5be044=>_0x5be044[_0xf752eb(0x1ce)][_0xf752eb(0x1d1)]()===_0x529792[_0xf752eb(0x1ce)][_0xf752eb(0x1d1)]())?.[_0xf752eb(0x18d)]?.[_0x8a3230];for(const _0x354582 of Object[_0xf752eb(0x141)](_0x529792[_0xf752eb(0x18d)])){const _0x1d5bd9=_0x529792[_0xf752eb(0x18d)][_0x354582],_0x5167bb=_0x38b293(_0x354582);if(_0x1d5bd9[_0xf752eb(0x216)]==='Activation'&&_0x1d5bd9[_0xf752eb(0x1e5)]&&(isPendingActivationId(_0x1d5bd9[_0xf752eb(0x1e5)])||_0x1d5bd9[_0xf752eb(0x1e5)]==='')){if(_0x5167bb?.[_0xf752eb(0x1e5)]&&isPendingActivationId(_0x5167bb['journeyActivationStepId'])){const _0x1082eb=extractPendingActivationName(_0x5167bb[_0xf752eb(0x1e5)]),_0x18f862=_0x564360['get'](_0x1082eb);_0x18f862&&(_0x1d5bd9[_0xf752eb(0x1e5)]=_0x18f862);}}if(_0x1d5bd9[_0xf752eb(0x216)]===_0xf752eb(0x15b)&&_0x1d5bd9['branches']&&_0x5167bb?.[_0xf752eb(0x210)])for(let _0x57a4ab=0x0;_0x57a4ab<_0x1d5bd9[_0xf752eb(0x210)]['length'];_0x57a4ab++){const _0x357b16=_0x1d5bd9[_0xf752eb(0x210)][_0x57a4ab],_0x4a39a3=_0x5167bb[_0xf752eb(0x210)][_0x57a4ab];if(_0x4a39a3?.[_0xf752eb(0x16d)]&&isPendingSegmentId(_0x4a39a3[_0xf752eb(0x16d)])){const _0x16fd61=_0x3c47ca(_0x4a39a3[_0xf752eb(0x16d)],_0xf752eb(0x1f9)+_0x529792[_0xf752eb(0x1ce)]+_0xf752eb(0x157)+(_0x357b16[_0xf752eb(0x1ce)]||_0x57a4ab)+'\x27');_0x16fd61&&(_0x357b16['segmentId']=_0x16fd61);}}_0x1d5bd9[_0xf752eb(0x216)]==='WaitStep'&&_0x5167bb?.[_0xf752eb(0x216)]===_0xf752eb(0x1de)&&resolveWaitStepPendingIds(_0x1d5bd9,_0x5167bb,_0x3c47ca,_0x529792['name']);}}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x455e32,_0x43b296){const _0x14f28d=a153_0x4de1,_0x18e041=_0x455e32();while(!![]){try{const _0x157dd7=parseInt(_0x14f28d(0xbb))/0x1*(-parseInt(_0x14f28d(0xb8))/0x2)+-parseInt(_0x14f28d(0xbf))/0x3*(parseInt(_0x14f28d(0xba))/0x4)+-parseInt(_0x14f28d(0xbe))/0x5+-parseInt(_0x14f28d(0xb9))/0x6+parseInt(_0x14f28d(0xb2))/0x7*(-parseInt(_0x14f28d(0xb5))/0x8)+parseInt(_0x14f28d(0xb6))/0x9+-parseInt(_0x14f28d(0xb4))/0xa*(-parseInt(_0x14f28d(0xbc))/0xb);if(_0x157dd7===_0x43b296)break;else _0x18e041['push'](_0x18e041['shift']());}catch(_0xf21e88){_0x18e041['push'](_0x18e041['shift']());}}}(a153_0x5ed7,0x76ec7));export function buildFolderIdToPathMap(_0x3c822c){const _0x1a56f0=a153_0x4de1,_0x1942bf=new Map(),_0x8b773d=new Map();for(const _0x352c52 of _0x3c822c){_0x8b773d[_0x1a56f0(0xb3)](_0x352c52['id'],_0x352c52);}const _0x3c0747=new Set();for(const _0x301f44 of _0x3c822c){!_0x301f44[_0x1a56f0(0xc0)]&&_0x3c0747[_0x1a56f0(0xb7)](_0x301f44['id']);}function _0x578cbf(_0xba1268){const _0x41d75d=_0x1a56f0;if(_0x1942bf[_0x41d75d(0xb1)](_0xba1268['id']))return _0x1942bf['get'](_0xba1268['id']);if(_0x3c0747[_0x41d75d(0xb1)](_0xba1268['id']))return _0x1942bf[_0x41d75d(0xb3)](_0xba1268['id'],''),'';if(_0xba1268['parentFolderId']){const _0x15b84b=_0x8b773d[_0x41d75d(0xbd)](_0xba1268['parentFolderId']);if(_0x15b84b){const _0x45f8cc=_0x578cbf(_0x15b84b),_0x4167a6=_0x45f8cc?_0x45f8cc+'/'+_0xba1268[_0x41d75d(0xb0)]:_0xba1268['name'];return _0x1942bf[_0x41d75d(0xb3)](_0xba1268['id'],_0x4167a6),_0x4167a6;}}const _0x938cd4=_0xba1268['name'];return _0x1942bf[_0x41d75d(0xb3)](_0xba1268['id'],_0x938cd4),_0x938cd4;}for(const _0x4d1371 of _0x3c822c){_0x578cbf(_0x4d1371);}return _0x1942bf;}function a153_0x5ed7(){const _0x467191=['4GfwGcg','3YiliCs','91223XkEmkV','get','3211340tERhWk','155298ELlMyz','parentFolderId','name','has','2401819IYbkCX','set','3460jYeXwa','16tFCTYl','2400795RCPGOf','add','356360nccviZ','4405284LJfcEq'];a153_0x5ed7=function(){return _0x467191;};return a153_0x5ed7();}function a153_0x4de1(_0x367f9a,_0x200e10){_0x367f9a=_0x367f9a-0xb0;const _0x5ed7b9=a153_0x5ed7();let _0x4de125=_0x5ed7b9[_0x367f9a];return _0x4de125;}export function buildFolderPathToIdMap(_0x41c279){const _0x1f94dc=a153_0x4de1,_0x522682=new Map(),_0x43e052=new Map();for(const _0x5b4547 of _0x41c279){_0x43e052['set'](_0x5b4547['id'],_0x5b4547);}const _0x2301ab=new Set();for(const _0x2f02e2 of _0x41c279){!_0x2f02e2[_0x1f94dc(0xc0)]&&_0x2301ab[_0x1f94dc(0xb7)](_0x2f02e2['id']);}function _0x2d621f(_0x1bba51){const _0x9ac49e=_0x1f94dc;if(_0x2301ab[_0x9ac49e(0xb1)](_0x1bba51['id']))return'';if(_0x1bba51[_0x9ac49e(0xc0)]){const _0x2206ed=_0x43e052[_0x9ac49e(0xbd)](_0x1bba51[_0x9ac49e(0xc0)]);if(_0x2206ed){const _0x5a70f0=_0x2d621f(_0x2206ed);return _0x5a70f0?_0x5a70f0+'/'+_0x1bba51['name']:_0x1bba51[_0x9ac49e(0xb0)];}}return _0x1bba51[_0x9ac49e(0xb0)];}for(const _0x8fb70c of _0x41c279){const _0x2510fe=_0x2d621f(_0x8fb70c);_0x522682[_0x1f94dc(0xb3)](_0x2510fe,_0x8fb70c['id']);}return _0x522682;}export function buildFolderMaps(_0x3ef273){const _0x54eabb=a153_0x4de1,_0x3d6cf6=buildFolderIdToPathMap(_0x3ef273),_0x3d5ee3=new Map();for(const [_0x23c751,_0x4ad876]of _0x3d6cf6){_0x3d5ee3[_0x54eabb(0xb3)](_0x4ad876,_0x23c751);}return{'idToPath':_0x3d6cf6,'pathToId':_0x3d5ee3};}export function getFolderPath(_0x5d0948,_0x4c5a78){if(!_0x5d0948)return'';return _0x4c5a78['get'](_0x5d0948)??'';}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a154_0x193a(_0x3737ef,_0x2ae0af){_0x3737ef=_0x3737ef-0x70;const _0x5ab76b=a154_0x5ab7();let _0x193a8e=_0x5ab76b[_0x3737ef];return _0x193a8e;}(function(_0x257a5e,_0x4e5929){const _0xa55544=a154_0x193a,_0x91afa8=_0x257a5e();while(!![]){try{const _0x56c200=-parseInt(_0xa55544(0x7f))/0x1*(parseInt(_0xa55544(0x84))/0x2)+-parseInt(_0xa55544(0x8e))/0x3+parseInt(_0xa55544(0x77))/0x4+parseInt(_0xa55544(0x82))/0x5*(-parseInt(_0xa55544(0x8c))/0x6)+parseInt(_0xa55544(0x70))/0x7*(parseInt(_0xa55544(0x8b))/0x8)+parseInt(_0xa55544(0x9a))/0x9*(-parseInt(_0xa55544(0x83))/0xa)+parseInt(_0xa55544(0x72))/0xb;if(_0x56c200===_0x4e5929)break;else _0x91afa8['push'](_0x91afa8['shift']());}catch(_0x56250c){_0x91afa8['push'](_0x91afa8['shift']());}}}(a154_0x5ab7,0x5c1fc));import a154_0x4dfb95 from'path';import{parse as a154_0x5a57dd}from'yaml';import{nodeFileSystem}from'../io/node-filesystem.js';export function parsePath(_0x5897f9){const _0x5231b8=a154_0x193a;if(!_0x5897f9||_0x5897f9['trim']()==='')throw new Error(_0x5231b8(0x8f));const _0x19251d=_0x5897f9['trim']();if(_0x19251d==='/')return{'segments':[],'isAbsolute':!![],'raw':_0x5897f9};const _0x1ae24e=_0x19251d[_0x5231b8(0x71)]('/')?_0x19251d[_0x5231b8(0x97)](0x1):_0x19251d,_0x4ddd01=_0x1ae24e[_0x5231b8(0x9d)]('/')[_0x5231b8(0x9c)](_0x37da2f=>_0x37da2f!=='');if(_0x4ddd01[_0x5231b8(0x90)]===0x0)throw new Error(_0x5231b8(0x7c));const _0x4a6d2a=_0x19251d['startsWith']('/')||!isRelativePathSegment(_0x4ddd01[0x0]);for(const _0x137ba2 of _0x4ddd01){validatePathSegment(_0x137ba2);}return{'segments':_0x4ddd01,'isAbsolute':_0x4a6d2a,'raw':_0x5897f9};}function isRelativePathSegment(_0x4e00af){return _0x4e00af==='.'||_0x4e00af==='..';}function validatePathSegment(_0x422d22){const _0x21fa75=a154_0x193a;if(_0x422d22==='')throw new Error(_0x21fa75(0x80));if(_0x422d22==='.'||_0x422d22==='..')return;if(/[\x00-\x1F\x7F]/[_0x21fa75(0x73)](_0x422d22))throw new Error(_0x21fa75(0x93)+_0x422d22);if(_0x422d22!==_0x422d22[_0x21fa75(0x78)]()){}}export function validatePath(_0xa2d723){const _0x2a7415=a154_0x193a;if(_0xa2d723[_0x2a7415(0x7e)][_0x2a7415(0x90)]===0x0&&!_0xa2d723[_0x2a7415(0x7d)])throw new Error('Relative\x20path\x20cannot\x20be\x20empty');if(_0xa2d723[_0x2a7415(0x7d)]){if(_0xa2d723[_0x2a7415(0x7e)][0x0]==='..')throw new Error(_0x2a7415(0x8a));let _0x33c74f=0x0;for(const _0x311405 of _0xa2d723[_0x2a7415(0x7e)]){if(_0x311405==='..'){if(_0x33c74f===0x0)throw new Error(_0x2a7415(0x7a));_0x33c74f--;}else _0x311405!=='.'&&_0x33c74f++;}}}export function joinPaths(_0x5a9375,_0x431acd){const _0x56a409=a154_0x193a;if(!_0x5a9375||_0x5a9375==='/')return _0x431acd;if(!_0x431acd||_0x431acd==='.')return _0x5a9375;if(_0x431acd['startsWith']('/'))return _0x431acd;const _0x167688=parsePath(_0x5a9375),_0x2b3a67=parsePath(_0x431acd),_0x149cd3=[..._0x167688[_0x56a409(0x7e)]];for(const _0x425dc6 of _0x2b3a67[_0x56a409(0x7e)]){if(_0x425dc6==='.')continue;else{if(_0x425dc6==='..'){if(_0x149cd3[_0x56a409(0x90)]===0x0)throw new Error(_0x56a409(0x81));_0x149cd3['pop']();}else _0x149cd3[_0x56a409(0x79)](_0x425dc6);}}const _0x51336e=_0x149cd3[_0x56a409(0x88)]('/');return _0x167688[_0x56a409(0x94)][_0x56a409(0x71)]('/')?'/'+_0x51336e:_0x51336e;}export function normalizePath(_0x7df32f){const _0x15c0bb=a154_0x193a,_0x47c043=parsePath(_0x7df32f),_0x28d96b=[];for(const _0x2e90f2 of _0x47c043[_0x15c0bb(0x7e)]){if(_0x2e90f2==='.')continue;else{if(_0x2e90f2==='..'){if(_0x28d96b[_0x15c0bb(0x90)]===0x0){if(_0x47c043['isAbsolute'])throw new Error('Cannot\x20navigate\x20above\x20root');_0x28d96b['push']('..');}else _0x28d96b[_0x28d96b['length']-0x1]==='..'?_0x28d96b[_0x15c0bb(0x79)]('..'):_0x28d96b[_0x15c0bb(0x9b)]();}else _0x28d96b[_0x15c0bb(0x79)](_0x2e90f2);}}if(_0x28d96b[_0x15c0bb(0x90)]===0x0)return _0x47c043[_0x15c0bb(0x7d)]?'/':'.';const _0x322220=_0x28d96b[_0x15c0bb(0x88)]('/');return _0x47c043[_0x15c0bb(0x94)][_0x15c0bb(0x71)]('/')?'/'+_0x322220:_0x322220;}export function getParentPath(_0x5e07c9){const _0x4b762b=a154_0x193a,_0x1bc197=parsePath(_0x5e07c9);if(_0x1bc197[_0x4b762b(0x7e)]['length']<=0x1)return'/';const _0x262b1c=_0x1bc197[_0x4b762b(0x7e)][_0x4b762b(0x85)](0x0,-0x1)[_0x4b762b(0x88)]('/');return _0x1bc197['raw'][_0x4b762b(0x71)]('/')?'/'+_0x262b1c:_0x262b1c;}function a154_0x5ab7(){const _0x22042b=['1056966kNXxgV','replace','1305156ZScTHz','Path\x20cannot\x20be\x20empty','length','name','File\x20not\x20found:\x20','Path\x20segment\x20contains\x20invalid\x20control\x20characters:\x20','raw','Hint:\x20Run\x20`tdx\x20sg\x20pull\x20\x22Parent\x20Segment\x20Name\x22`\x20first\x20to\x20create\x20a\x20project\x20directory,\x20then\x20work\x20within\x20that\x20directory.','journey','substring','root','Cannot\x20split\x20empty\x20path','326493QqJjtx','pop','filter','split','Invalid\x20tdx.json:\x20missing\x20parent_segment\x20field','exists','196DNfSQd','startsWith','4183553eTLnDC','test','tdx.json','relative','readFile','1948756cEUSMX','trim','push','Path\x20attempts\x20to\x20navigate\x20above\x20root','parent_segment','Path\x20must\x20contain\x20at\x20least\x20one\x20segment','isAbsolute','segments','12406IXCmWn','Path\x20segment\x20cannot\x20be\x20empty','Cannot\x20navigate\x20above\x20root','5Omngct','10GicvMG','14mvegaZ','slice','.yaml','dirname','join','Invalid\x20YAML:\x20missing\x20name\x20field\x20in\x20','Absolute\x20path\x20cannot\x20start\x20with\x20\x22..\x22','69760JVggLw'];a154_0x5ab7=function(){return _0x22042b;};return a154_0x5ab7();}export function getBaseName(_0x496ad8){const _0x126788=a154_0x193a,_0x17b4e4=parsePath(_0x496ad8);return _0x17b4e4[_0x126788(0x7e)][_0x17b4e4[_0x126788(0x7e)]['length']-0x1]||'';}export function isChildPath(_0x6d1c69,_0x518491){const _0x3d62a6=a154_0x193a,_0x48bcc1=parsePath(_0x6d1c69),_0x505cee=parsePath(_0x518491);if(_0x48bcc1[_0x3d62a6(0x7e)][_0x3d62a6(0x90)]<=_0x505cee[_0x3d62a6(0x7e)]['length'])return![];for(let _0x5afdd6=0x0;_0x5afdd6<_0x505cee[_0x3d62a6(0x7e)][_0x3d62a6(0x90)];_0x5afdd6++){if(_0x48bcc1[_0x3d62a6(0x7e)][_0x5afdd6]!==_0x505cee[_0x3d62a6(0x7e)][_0x5afdd6])return![];}return!![];}export function splitPath(_0x19673c){const _0x280cb8=a154_0x193a,_0xc25723=parsePath(_0x19673c);if(_0xc25723[_0x280cb8(0x7e)][_0x280cb8(0x90)]===0x0)throw new Error(_0x280cb8(0x99));if(_0xc25723[_0x280cb8(0x7e)][_0x280cb8(0x90)]===0x1)return{'parent':_0xc25723[_0x280cb8(0x7e)][0x0]};return{'parent':_0xc25723[_0x280cb8(0x7e)][0x0],'child':_0xc25723[_0x280cb8(0x7e)][_0x280cb8(0x85)](0x1)[_0x280cb8(0x88)]('/')};}export function isYamlFilePath(_0x88b868){const _0x192546=a154_0x193a;return _0x88b868['endsWith']('.yml')||_0x88b868['endsWith'](_0x192546(0x86));}export async function resolveYamlFilePath(_0x128292,_0x206bab=nodeFileSystem){const _0x2eb15a=a154_0x193a,_0x25c30e=a154_0x4dfb95['resolve'](_0x128292);if(!await _0x206bab[_0x2eb15a(0x9f)](_0x25c30e))throw new Error(_0x2eb15a(0x92)+_0x128292);let _0x2eda18=a154_0x4dfb95[_0x2eb15a(0x87)](_0x25c30e),_0x266848=null,_0x5736ae=null;const _0x568a05=a154_0x4dfb95['parse'](_0x2eda18)[_0x2eb15a(0x98)];while(_0x2eda18!==_0x568a05){const _0x302ee2=a154_0x4dfb95[_0x2eb15a(0x88)](_0x2eda18,_0x2eb15a(0x74));if(await _0x206bab['exists'](_0x302ee2)){_0x266848=_0x302ee2,_0x5736ae=_0x2eda18;break;}_0x2eda18=a154_0x4dfb95['dirname'](_0x2eda18);}if(!_0x266848||!_0x5736ae)throw new Error('No\x20tdx.json\x20found\x20for\x20file:\x20'+_0x128292+'\x0a'+_0x2eb15a(0x95));const _0x5eadcc=await _0x206bab[_0x2eb15a(0x76)](_0x266848),_0x3e10be=JSON['parse'](_0x5eadcc),_0x9d0b3=_0x3e10be[_0x2eb15a(0x7b)];if(!_0x9d0b3)throw new Error(_0x2eb15a(0x9e));const _0x199c17=await _0x206bab[_0x2eb15a(0x76)](_0x25c30e),_0x1f314c=a154_0x5a57dd(_0x199c17),_0x4ffceb=_0x1f314c[_0x2eb15a(0x91)];if(!_0x4ffceb)throw new Error(_0x2eb15a(0x89)+_0x128292);const _0x29632f=_0x1f314c['type']===_0x2eb15a(0x96)?_0x2eb15a(0x96):'segment',_0x3a9891=a154_0x4dfb95[_0x2eb15a(0x75)](_0x5736ae,_0x25c30e),_0x599cb0=a154_0x4dfb95[_0x2eb15a(0x87)](_0x3a9891),_0x52ac93=_0x599cb0==='.'?'':_0x599cb0[_0x2eb15a(0x8d)](/\\/g,'/'),_0x4a8b6c=_0x52ac93?_0x9d0b3+'/'+_0x52ac93+'/'+_0x4ffceb:_0x9d0b3+'/'+_0x4ffceb;return{'parentSegment':_0x9d0b3,'segmentName':_0x4ffceb,'folderPath':_0x52ac93,'fullPath':_0x4a8b6c,'resourceType':_0x29632f,'content':_0x199c17};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x33c70c,_0x53afe1){const _0xc00b92=a155_0x22c9,_0x1cd86f=_0x33c70c();while(!![]){try{const _0x49c083=-parseInt(_0xc00b92(0x179))/0x1*(-parseInt(_0xc00b92(0x180))/0x2)+-parseInt(_0xc00b92(0x177))/0x3+-parseInt(_0xc00b92(0x17f))/0x4*(parseInt(_0xc00b92(0x17d))/0x5)+parseInt(_0xc00b92(0x176))/0x6*(parseInt(_0xc00b92(0x178))/0x7)+-parseInt(_0xc00b92(0x17b))/0x8+-parseInt(_0xc00b92(0x174))/0x9+-parseInt(_0xc00b92(0x173))/0xa*(-parseInt(_0xc00b92(0x17a))/0xb);if(_0x49c083===_0x53afe1)break;else _0x1cd86f['push'](_0x1cd86f['shift']());}catch(_0x4a2e46){_0x1cd86f['push'](_0x1cd86f['shift']());}}}(a155_0x46a8,0x40342));function a155_0x46a8(){const _0x336796=['substring','70beqzzj','.\x20Parent\x20name\x20cannot\x20be\x20empty','111436BqHxPE','30loSHlH','13775290gMyyHV','4429836AkWpTn','Invalid\x20segment\x20reference\x20format:\x20','198MvNsjO','1565385dHhgfN','52255diGzql','30699eQkKql','11ZlybEK','3338848ySIpjD'];a155_0x46a8=function(){return _0x336796;};return a155_0x46a8();}function a155_0x22c9(_0x36828d,_0x3d77a0){_0x36828d=_0x36828d-0x173;const _0x46a8b9=a155_0x46a8();let _0x22c9f9=_0x46a8b9[_0x36828d];return _0x22c9f9;}export function parseSegmentRef(_0x5e59a0){const _0x39218f=a155_0x22c9,_0x325cdf=_0x5e59a0['indexOf']('/');if(_0x325cdf===-0x1)return{'parentId':_0x5e59a0};if(_0x325cdf===0x0)throw new Error(_0x39218f(0x175)+_0x5e59a0+_0x39218f(0x17e));const _0xf4a4fe=_0x5e59a0[_0x39218f(0x17c)](0x0,_0x325cdf),_0x3b5386=_0x5e59a0['substring'](_0x325cdf+0x1);if(_0x3b5386==='')throw new Error('Invalid\x20segment\x20reference\x20format:\x20'+_0x5e59a0+'.\x20Child\x20name\x20cannot\x20be\x20empty');return{'parentId':_0xf4a4fe,'childId':_0x3b5386};}
|