@treasuredata/tdx 0.20.0 → 0.20.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bin.js +1 -1
- package/dist/build-info.json +3 -3
- package/dist/cli-categories.js +1 -1
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +1 -1
- package/dist/cli.js.map +1 -1
- package/dist/commands/activations.js +1 -1
- package/dist/commands/agent-command.js +1 -1
- package/dist/commands/agent-test-command.js +1 -1
- package/dist/commands/api-command.js +1 -1
- package/dist/commands/auth-command.js +1 -1
- package/dist/commands/chat-command.js +1 -1
- package/dist/commands/claude-command.d.ts +9 -0
- package/dist/commands/claude-command.d.ts.map +1 -1
- package/dist/commands/claude-command.js +1 -1
- package/dist/commands/claude-command.js.map +1 -1
- package/dist/commands/claude-statusline-command.js +1 -1
- package/dist/commands/claude-usage-command.js +1 -1
- package/dist/commands/command.js +1 -1
- package/dist/commands/connection-command.js +1 -1
- package/dist/commands/databases.js +1 -1
- package/dist/commands/describe.js +1 -1
- package/dist/commands/engage-command.js +1 -1
- package/dist/commands/job-command.js +1 -1
- package/dist/commands/journey-command.js +1 -1
- package/dist/commands/journey-validate-command.js +1 -1
- package/dist/commands/llm-command.d.ts +12 -0
- package/dist/commands/llm-command.d.ts.map +1 -1
- package/dist/commands/llm-command.js +1 -1
- package/dist/commands/llm-command.js.map +1 -1
- package/dist/commands/llm-proxy.js +1 -1
- package/dist/commands/mcp-command.js +1 -1
- package/dist/commands/parent-segment-command.js +1 -1
- package/dist/commands/profile-command.js +1 -1
- package/dist/commands/profiles-command.js +1 -1
- package/dist/commands/query-command.js +1 -1
- package/dist/commands/schedule-command.js +1 -1
- package/dist/commands/segment-command.js +1 -1
- package/dist/commands/segment-create-command.js +1 -1
- package/dist/commands/segment-fields-command.js +1 -1
- package/dist/commands/segment-pull-command.js +1 -1
- package/dist/commands/segment-push-command.js +1 -1
- package/dist/commands/segment-update-command.js +1 -1
- package/dist/commands/segment-use-command.js +1 -1
- package/dist/commands/segment-validate-command.js +1 -1
- package/dist/commands/segments.js +1 -1
- package/dist/commands/show.js +1 -1
- package/dist/commands/status-command.js +1 -1
- package/dist/commands/tables.js +1 -1
- package/dist/commands/unset-command.js +1 -1
- package/dist/commands/use-command.js +1 -1
- package/dist/commands/user-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.d.ts +5 -0
- package/dist/core/config.d.ts.map +1 -1
- package/dist/core/config.js +1 -1
- package/dist/core/config.js.map +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/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/anthropic-adapter.js +1 -1
- package/dist/proxy/claude-usage-tracker.js +1 -1
- package/dist/proxy/context-signature.js +1 -1
- package/dist/proxy/conversation-utils.js +1 -1
- package/dist/proxy/passthrough-server.d.ts.map +1 -1
- package/dist/proxy/passthrough-server.js +1 -1
- package/dist/proxy/passthrough-server.js.map +1 -1
- package/dist/proxy/server.js +1 -1
- package/dist/proxy/session-cache.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/api.js +1 -1
- package/dist/sdk/client/cdp-api-client.js +1 -1
- package/dist/sdk/client/endpoints.js +1 -1
- package/dist/sdk/client/engage-api-client.js +1 -1
- package/dist/sdk/client/http-client.js +1 -1
- package/dist/sdk/client/llm-api-client.d.ts +7 -1
- package/dist/sdk/client/llm-api-client.d.ts.map +1 -1
- package/dist/sdk/client/llm-api-client.js +1 -1
- package/dist/sdk/client/llm-api-client.js.map +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/engage.js +1 -1
- package/dist/sdk/errors.js +1 -1
- package/dist/sdk/index.js +1 -1
- package/dist/sdk/index.js.map +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.d.ts +15 -1
- package/dist/sdk/llm/index.d.ts.map +1 -1
- package/dist/sdk/llm/index.js +1 -1
- package/dist/sdk/llm/index.js.map +1 -1
- package/dist/sdk/llm/llm-backup-utils.js +1 -1
- package/dist/sdk/llm/model-aliases.js +1 -1
- package/dist/sdk/llm/model-factors.js +1 -1
- package/dist/sdk/query/index.js +1 -1
- package/dist/sdk/query/sql-parser.js +1 -1
- package/dist/sdk/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-yaml.js +1 -1
- package/dist/sdk/segment/parent-segment-preview.js +1 -1
- package/dist/sdk/segment/parent-segment-yaml.js +1 -1
- package/dist/sdk/segment/pull-workflow.js +1 -1
- package/dist/sdk/segment/push-workflow.js +1 -1
- package/dist/sdk/segment/resolution-context.js +1 -1
- package/dist/sdk/segment/segment-path-parser.js +1 -1
- package/dist/sdk/segment/segment-ref-parser.js +1 -1
- package/dist/sdk/segment/target-resolution.js +1 -1
- package/dist/sdk/segment/tdx-config.js +1 -1
- package/dist/sdk/segment/validate-files.js +1 -1
- package/dist/sdk/segment/yaml-validator.js +1 -1
- package/dist/sdk/segment.js +1 -1
- package/dist/sdk/types/index.d.ts +1 -1
- package/dist/sdk/types/index.d.ts.map +1 -1
- package/dist/sdk/types/index.js +1 -1
- package/dist/sdk/types/index.js.map +1 -1
- package/dist/sdk/types/llm.d.ts +8 -0
- package/dist/sdk/types/llm.d.ts.map +1 -1
- package/dist/sdk/types/progress.js +1 -1
- package/dist/sdk/user.js +1 -1
- package/dist/sdk/util/format-detector.js +1 -1
- package/dist/sdk/util/formatters.js +1 -1
- package/dist/sdk/util/index.js +1 -1
- package/dist/sdk/util/tree-formatter.js +1 -1
- package/dist/sdk/workflow/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/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/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/port.js +1 -1
- package/dist/utils/process.d.ts.map +1 -1
- package/dist/utils/process.js +1 -1
- package/dist/utils/process.js.map +1 -1
- package/dist/utils/prompt.js +1 -1
- package/dist/utils/spinner.js +1 -1
- package/dist/utils/sse-parser.js +1 -1
- package/dist/utils/string-utils.js +1 -1
- package/dist/utils/table-ref-parser.js +1 -1
- package/dist/utils/tdx-logger.js +1 -1
- package/dist/utils/version-check.js +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
const a117_0x110a5=a117_0x5c13;(function(_0x43a774,_0x471391){const _0xf784e0=a117_0x5c13,_0x1ecb0d=_0x43a774();while(!![]){try{const _0x4c6f99=parseInt(_0xf784e0(0x1ad))/0x1+-parseInt(_0xf784e0(0x1a2))/0x2+-parseInt(_0xf784e0(0x21b))/0x3*(-parseInt(_0xf784e0(0x145))/0x4)+-parseInt(_0xf784e0(0x14b))/0x5*(-parseInt(_0xf784e0(0x1c4))/0x6)+-parseInt(_0xf784e0(0x1aa))/0x7*(-parseInt(_0xf784e0(0x13f))/0x8)+parseInt(_0xf784e0(0x1fa))/0x9*(-parseInt(_0xf784e0(0x14d))/0xa)+-parseInt(_0xf784e0(0x1f3))/0xb*(-parseInt(_0xf784e0(0x1bf))/0xc);if(_0x4c6f99===_0x471391)break;else _0x1ecb0d['push'](_0x1ecb0d['shift']());}catch(_0x83751c){_0x1ecb0d['push'](_0x1ecb0d['shift']());}}}(a117_0x3b8c,0x76bd3));import{createHash}from'crypto';export const PENDING_SEGMENT_PREFIX='__pending_';export const PENDING_ACTIVATION_PREFIX=a117_0x110a5(0x1d0);export function createPendingSegmentId(_0x5cdda6){return''+PENDING_SEGMENT_PREFIX+_0x5cdda6+'__';}export function isPendingSegmentId(_0x303d04){return _0x303d04['startsWith'](PENDING_SEGMENT_PREFIX);}export function extractPendingSegmentName(_0x597290){const _0x51610d=a117_0x110a5;return _0x597290[_0x51610d(0x1a3)](/^__pending_(.+)__$/,'$1');}export function createPendingActivationId(_0x4536fe){return''+PENDING_ACTIVATION_PREFIX+_0x4536fe+'__';}export function isPendingActivationId(_0x34994d){const _0x239742=a117_0x110a5;return _0x34994d[_0x239742(0x1ce)](PENDING_ACTIVATION_PREFIX);}export function extractPendingActivationName(_0x1d534a){const _0x2dbb15=a117_0x110a5;return _0x1d534a[_0x2dbb15(0x1a3)](/^__pending_act_(.+)__$/,'$1');}function generateDeterministicJourneySegmentName(_0x250787,_0x4df4d1){const _0x3a3b00=a117_0x110a5,_0x25d3c0=_0x250787+'::'+(_0x4df4d1[_0x3a3b00(0x1c0)]()||'segment'),_0x12454e=createHash('sha1')[_0x3a3b00(0x16f)](_0x25d3c0)[_0x3a3b00(0x16b)](_0x3a3b00(0x187))[_0x3a3b00(0x1de)](0x0,0xc);return'journey_entry_criteria_'+_0x12454e;}export function ensureJourneyDefaults(_0x1c93c0){const _0x30de3d=a117_0x110a5;!_0x1c93c0[_0x30de3d(0x149)]&&(_0x1c93c0['description']=''),!_0x1c93c0[_0x30de3d(0x156)]&&(_0x1c93c0[_0x30de3d(0x156)]='draft');}export function resolveTDFolderPath(_0x49008c,_0x2ac7d3,_0xfebf15){const _0x3cf721=a117_0x110a5;if(!_0x2ac7d3)return _0x49008c;if(_0x49008c===_0xfebf15||_0x49008c[_0x3cf721(0x1ce)](_0xfebf15+'/'))return _0x49008c;return _0x49008c?_0xfebf15+'/'+_0x49008c:_0xfebf15;}export function addFoldersToCreate(_0x222af2,_0x2a247b,_0x1c9d91){const _0x34f23e=a117_0x110a5;if(!_0x222af2)return;if(_0x2a247b[_0x34f23e(0x1b5)](_0x222af2))return;const _0x36e50e=_0x222af2[_0x34f23e(0x1e0)]('/');let _0x36ff26='';for(const _0x1eba7d of _0x36e50e){_0x36ff26=_0x36ff26?_0x36ff26+'/'+_0x1eba7d:_0x1eba7d,!_0x2a247b[_0x34f23e(0x1b5)](_0x36ff26)&&_0x1c9d91[_0x34f23e(0x198)](_0x36ff26);}}import*as a117_0x1ce7c7 from'yaml';import{readFileSync}from'fs';import a117_0x227d93 from'path';import{isJourneyDef,parseYamlString as a117_0x16f0f7,toYamlString as a117_0x528669,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{validateSegmentDef,validateJourneyDef,formatValidationResult}from'./yaml-validator.js';function stableStringify(_0x28baec){const _0x3a06d7=a117_0x110a5;if(Array['isArray'](_0x28baec))return'['+_0x28baec[_0x3a06d7(0x1af)](_0x77e91a=>stableStringify(_0x77e91a))['join'](',')+']';if(_0x28baec&&typeof _0x28baec==='object'){const _0x26fa49=_0x28baec,_0x3b7b40=Object[_0x3a06d7(0x178)](_0x26fa49)[_0x3a06d7(0x1f8)](),_0x2674b0=_0x3b7b40[_0x3a06d7(0x1af)](_0x525af6=>'\x22'+_0x525af6+'\x22:'+stableStringify(_0x26fa49[_0x525af6]));return'{'+_0x2674b0[_0x3a06d7(0x137)](',')+'}';}const _0x1fc2cc=JSON[_0x3a06d7(0x136)](_0x28baec);return _0x1fc2cc===undefined?_0x3a06d7(0x1b0):_0x1fc2cc;}function activationSignature(_0x204b4e){const _0x30702a=a117_0x110a5,_0x3e84c9={'connection':_0x204b4e['connection'],..._0x204b4e[_0x30702a(0x212)]!==undefined&&{'all_columns':_0x204b4e[_0x30702a(0x212)]},..._0x204b4e[_0x30702a(0x194)]!==undefined&&{'columns':_0x204b4e[_0x30702a(0x194)]},..._0x204b4e[_0x30702a(0x201)]!==undefined&&{'behavior':_0x204b4e['behavior']},..._0x204b4e[_0x30702a(0x205)]!==undefined&&{'schedule':_0x204b4e['schedule']},..._0x204b4e[_0x30702a(0x1da)]!==undefined&&{'notification':_0x204b4e[_0x30702a(0x1da)]},..._0x204b4e[_0x30702a(0x173)]!==undefined&&{'connector_config':_0x204b4e[_0x30702a(0x173)]},..._0x204b4e['activation_template_id']!==undefined&&{'activation_template_id':_0x204b4e[_0x30702a(0x1c8)]}};return stableStringify(_0x3e84c9);}export async function prepareSegmentFiles(_0x4ba1ca,_0x4ee1f2,_0x2a3ac5,_0x2c0ce3,_0x4354e7){const _0x8284f0=a117_0x110a5,{activationDefToCreateRequest:_0xa1017d}=await import('./child-segment-yaml.js'),_0x27ddf4=[],_0x2105a2=new Set();for(const {yamlConfig:_0x3c339d,folderPath:_0x35e02a,sourcePath:_0x5be457}of _0x4ba1ca){const _0x38a1ee=resolveTDFolderPath(_0x35e02a,_0x2c0ce3,_0x4354e7),_0x43eeeb=_0x38a1ee+':'+_0x3c339d[_0x8284f0(0x20d)],_0x146a27=_0x4ee1f2[_0x8284f0(0x138)][_0x8284f0(0x1ea)](_0x43eeeb),_0x1da409=_0x146a27?_0x4ee1f2[_0x8284f0(0x18d)][_0x8284f0(0x1ea)](_0x146a27['id'])||[]:[];addFoldersToCreate(_0x38a1ee,_0x4ee1f2[_0x8284f0(0x1f0)],_0x2105a2);const _0x27866d=calculateActivationActions(_0x3c339d[_0x8284f0(0x16e)]||[],_0x1da409,_0x4ee1f2[_0x8284f0(0x150)],_0x4ee1f2[_0x8284f0(0x191)]);for(const _0xfa2ed5 of _0x27866d){(_0xfa2ed5[_0x8284f0(0x18b)]===_0x8284f0(0x217)||_0xfa2ed5[_0x8284f0(0x18b)]===_0x8284f0(0x16f))&&_0xfa2ed5['yamlActivation']&&(_0xfa2ed5[_0x8284f0(0x1b3)]=await _0xa1017d(_0xfa2ed5['yamlActivation'],_0x2a3ac5));}const _0x2d2305=calculateSegmentDiff(_0x3c339d,_0x146a27,_0x1da409,_0x4ee1f2['idToEmailMap'],_0x4ee1f2[_0x8284f0(0x191)]);_0x27ddf4[_0x8284f0(0x184)]({'relativePath':_0x3c339d['name'],'absolutePath':_0x5be457,'yamlConfig':_0x3c339d,'folderPath':_0x38a1ee,'existingSegment':_0x146a27,'existingActivations':_0x1da409,'isNew':_0x2d2305['isNew'],'hasChanges':_0x2d2305[_0x8284f0(0x210)],'diff':_0x2d2305[_0x8284f0(0x1c2)],'activationActions':_0x27866d});}return{'segmentFiles':_0x27ddf4,'foldersToCreate':_0x2105a2};}export async function prepareJourneyFiles(_0x4980eb,_0x2165ef,_0x2ea674,_0x27dc18){const _0x1bcf9f=a117_0x110a5,_0x3f0912=[],_0x2aac23=new Set();for(const {yamlConfig:_0x5f2cf4,folderPath:_0x2293a0,sourcePath:_0x336173}of _0x4980eb){const _0x34fb54=resolveTDFolderPath(_0x2293a0,_0x2ea674,_0x27dc18),_0x5678a6=_0x34fb54+':'+_0x5f2cf4[_0x1bcf9f(0x20d)],_0x3c57e0=_0x2165ef[_0x1bcf9f(0x174)][_0x1bcf9f(0x1ea)](_0x5678a6);let _0x26d67f,_0x1d31df;if(_0x3c57e0&&_0x3c57e0[_0x1bcf9f(0x1d2)]>0x0){const _0x4b0c3e=buildLocalExpandedRuleMappings(_0x5f2cf4),{createYamlContext:_0x5babbf,prefetchJourneySegments:_0x294925}=createPushYamlContextForBundle(_0x2165ef[_0x1bcf9f(0x1ff)],_0x2165ef[_0x1bcf9f(0x20e)],_0x2165ef[_0x1bcf9f(0x1c3)],_0x4b0c3e,_0x2165ef[_0x1bcf9f(0x150)],_0x2165ef['connectionIdToNameMap'],_0x2165ef[_0x1bcf9f(0x1e4)],_0x2165ef[_0x1bcf9f(0x1c7)]);await _0x294925(_0x3c57e0[_0x1bcf9f(0x1af)](_0x2d40f4=>_0x2d40f4['id']));const _0x1dae16=hasMultipleVersions(_0x5f2cf4),_0x3d3d6b=async _0x48f012=>{const _0x376141=_0x1bcf9f,_0x5149f3=_0x2165ef[_0x376141(0x1c7)]?.['get'](_0x48f012);if(_0x5149f3)return _0x5149f3;return _0x2165ef[_0x376141(0x164)]({'journeyId':_0x48f012,'journeyName':_0x5f2cf4['name'],'isMultiVersion':_0x3c57e0[_0x376141(0x1d2)]>0x1});};if(_0x1dae16&&_0x3c57e0[_0x1bcf9f(0x1d2)]>0x1){const _0x48fadd=[];for(const _0x1b6bbc of _0x3c57e0){const _0x33be56=_0x1b6bbc[_0x1bcf9f(0x211)]||0x1;_0x2165ef[_0x1bcf9f(0x209)]?.[_0x1bcf9f(0x16f)](_0x1bcf9f(0x179)+_0x5f2cf4['name']+'\x20v'+_0x33be56);const _0x1773db=await _0x3d3d6b(_0x1b6bbc['id']),_0x34ee7d=_0x5babbf(_0x1b6bbc['id']),_0x3bfd38=await journeyResponseToDef(_0x1773db,_0x34ee7d);_0x48fadd[_0x1bcf9f(0x184)]({'item':_0x1b6bbc,'yaml':_0x3bfd38});}const _0x397b11=buildLocalRuleToNameMappingFromJourney(_0x5f2cf4);_0x1d31df=buildMergedJourneyDef(_0x48fadd,_0x397b11);const _0x4e6093=Math['max'](..._0x48fadd[_0x1bcf9f(0x1af)](_0x362e8c=>_0x362e8c[_0x1bcf9f(0x14a)][_0x1bcf9f(0x211)]||0x0)),_0x1dfbab=_0x3c57e0[_0x1bcf9f(0x21a)](_0x1b4c24=>(_0x1b4c24[_0x1bcf9f(0x211)]||0x0)===_0x4e6093);_0x1dfbab&&(_0x2165ef[_0x1bcf9f(0x209)]?.['update']('Fetching\x20'+_0x5f2cf4['name']+'\x20v'+_0x4e6093),_0x26d67f=await _0x3d3d6b(_0x1dfbab['id']));}else{const _0x260069=_0x3c57e0[_0x3c57e0[_0x1bcf9f(0x1d2)]-0x1];_0x2165ef[_0x1bcf9f(0x209)]?.[_0x1bcf9f(0x16f)](_0x1bcf9f(0x179)+_0x5f2cf4[_0x1bcf9f(0x20d)]),_0x26d67f=await _0x3d3d6b(_0x260069['id']);const _0x2939be=_0x5babbf(_0x260069['id']),_0x5efa82=await journeyResponseToDef(_0x26d67f,_0x2939be),_0x3944c4=buildLocalRuleToNameMappingFromJourney(_0x5f2cf4);_0x1d31df=buildMergedJourneyDef([{'item':_0x260069,'yaml':_0x5efa82}],_0x3944c4);}}addFoldersToCreate(_0x34fb54,_0x2165ef[_0x1bcf9f(0x1f0)],_0x2aac23);const _0x81bb31=calculateJourneyDiff(_0x5f2cf4,_0x1d31df);_0x3f0912[_0x1bcf9f(0x184)]({'relativePath':_0x5f2cf4[_0x1bcf9f(0x20d)],'absolutePath':_0x336173,'yamlConfig':_0x5f2cf4,'folderPath':_0x34fb54,'existingJourney':_0x26d67f,'isNew':_0x81bb31[_0x1bcf9f(0x1cf)],'hasChanges':_0x81bb31[_0x1bcf9f(0x210)],'diff':_0x81bb31['diff']});}return{'journeyFiles':_0x3f0912,'foldersToCreate':_0x2aac23};}export function calculateActivationActions(_0x4663c2,_0x1ffb2d,_0x83dfa,_0x4cc22f){const _0x88b906=a117_0x110a5,_0x25f5bd=[],_0x44c079=new Map();for(const _0x33be09 of _0x1ffb2d){_0x44c079[_0x88b906(0x172)](_0x33be09[_0x88b906(0x20d)],_0x33be09);}const _0x31d75c=new Map();for(const _0x3ad330 of _0x4663c2){_0x31d75c[_0x88b906(0x172)](_0x3ad330[_0x88b906(0x20d)],_0x3ad330);}for(const _0x2adb5a of _0x4663c2){const _0x5dfbaf=_0x44c079[_0x88b906(0x1ea)](_0x2adb5a[_0x88b906(0x20d)]);if(!_0x5dfbaf)_0x25f5bd['push']({'type':'create','name':_0x2adb5a['name'],'yamlActivation':_0x2adb5a});else{const _0x3d6e44=activationResponseToDef(_0x5dfbaf,_0x83dfa,_0x4cc22f),_0x2db5c8=a117_0x1ce7c7[_0x88b906(0x136)](_0x3d6e44),_0x46117e=a117_0x1ce7c7['stringify'](_0x2adb5a);_0x2db5c8!==_0x46117e&&_0x25f5bd[_0x88b906(0x184)]({'type':_0x88b906(0x16f),'name':_0x2adb5a[_0x88b906(0x20d)],'yamlActivation':_0x2adb5a,'existingActivation':_0x5dfbaf});}}for(const _0x405dff of _0x1ffb2d){!_0x31d75c[_0x88b906(0x1b5)](_0x405dff['name'])&&_0x25f5bd[_0x88b906(0x184)]({'type':_0x88b906(0x177),'name':_0x405dff['name'],'existingActivation':_0x405dff});}return _0x25f5bd;}export function calculateSegmentDiff(_0x35ef26,_0x3cbc05,_0x123b42,_0x232f29,_0x457515){const _0x41c145=segmentToYamlString(_0x35ef26);if(_0x3cbc05){const _0x1b5caf=segmentWithActivationsToYaml(_0x3cbc05,_0x123b42,undefined,_0x232f29,_0x457515),_0x5c7e8a=segmentToYamlString(_0x1b5caf),_0x24521b=generateDiff(_0x5c7e8a,_0x41c145),_0x546f49=hasChanges(_0x24521b);return{'isNew':![],'hasChanges':_0x546f49,'diff':_0x546f49?formatDiffWithColors(_0x24521b):undefined};}const _0x4d8541=generateDiff('',_0x41c145);return{'isNew':!![],'hasChanges':![],'diff':formatDiffWithColors(_0x4d8541)};}export function calculateJourneyDiff(_0x62a204,_0x31b0f3){const _0x3872cf=normalizeJourneyDef(_0x62a204,_0x62a204),_0x156c44=a117_0x528669(_0x3872cf);if(_0x31b0f3){const _0x1202b6=normalizeJourneyDef(_0x31b0f3,_0x62a204),_0x646c91=a117_0x528669(_0x1202b6),_0x2e4624=generateDiff(_0x646c91,_0x156c44),_0x42496b=hasChanges(_0x2e4624);return{'isNew':![],'hasChanges':_0x42496b,'diff':_0x42496b?formatDiffWithColors(_0x2e4624):undefined};}const _0x277330=generateDiff('',_0x156c44);return{'isNew':!![],'hasChanges':![],'diff':formatDiffWithColors(_0x277330)};}export function findSegmentsToDelete(_0x26ce41,_0x9cf0cb,_0x3fb1b2,_0xa0b360,_0x403853){const _0x24b58b=a117_0x110a5,_0x3790f6=new Set();for(const {yamlConfig:_0x42de32,folderPath:_0x43eb07}of _0x9cf0cb){_0x3790f6[_0x24b58b(0x198)](_0x43eb07+':'+_0x42de32[_0x24b58b(0x20d)]);}return _0x26ce41[_0x24b58b(0x1ca)](_0x2e5a83=>{const _0xb66886=_0x24b58b,_0x337a3d=_0x2e5a83[_0xb66886(0x1ac)]?_0x3fb1b2[_0xb66886(0x1ea)](_0x2e5a83['segmentFolderId'][_0xb66886(0x18e)]())||'':'',_0x2d397c=_0x337a3d+':'+_0x2e5a83[_0xb66886(0x20d)];if(_0x3790f6[_0xb66886(0x1b5)](_0x2d397c))return![];if(_0x403853)return _0x337a3d===_0xa0b360||_0x337a3d[_0xb66886(0x1ce)](_0xa0b360+'/');return!![];});}export function findJourneysToDelete(_0x457972,_0x59ee31,_0x488ed4,_0x5456d9,_0x5ac81b){const _0x34a35d=a117_0x110a5,_0x3241b2=new Set();for(const {yamlConfig:_0x5a650a,folderPath:_0xdf81f1}of _0x59ee31){_0x3241b2[_0x34a35d(0x198)](_0xdf81f1+':'+_0x5a650a[_0x34a35d(0x20d)]);}return _0x457972[_0x34a35d(0x1ca)](_0x55cf77=>{const _0x23ac52=_0x34a35d,_0x2670a7=_0x55cf77[_0x23ac52(0x19e)]?_0x488ed4['get'](_0x55cf77[_0x23ac52(0x19e)])||'':'',_0x8617c8=_0x2670a7+':'+_0x55cf77[_0x23ac52(0x17e)];if(_0x3241b2[_0x23ac52(0x1b5)](_0x8617c8))return![];if(_0x5ac81b)return _0x2670a7===_0x5456d9||_0x2670a7[_0x23ac52(0x1ce)](_0x5456d9+'/');return!![];});}export function buildSegmentLookupMap(_0x1c37e1,_0x4af630){const _0xac4109=a117_0x110a5,_0xedc533=new Map();for(const _0x5e3023 of _0x1c37e1){const _0x34cd7c=_0x5e3023[_0xac4109(0x1ac)]?_0x4af630['get'](_0x5e3023[_0xac4109(0x1ac)]['toString']())||'':'',_0x2bd195=_0x34cd7c+':'+_0x5e3023[_0xac4109(0x20d)];_0xedc533[_0xac4109(0x172)](_0x2bd195,_0x5e3023);}return _0xedc533;}export function buildSegmentNameToIdMap(_0x522500){const _0x89d278=a117_0x110a5,_0x3f3cfb=new Map();for(const _0x166e71 of _0x522500){_0x3f3cfb['set'](_0x166e71[_0x89d278(0x20d)],_0x166e71['id']);}return _0x3f3cfb;}export function buildJourneyBundleLookupMap(_0x2774d3,_0x4f4ef7){const _0x49989c=a117_0x110a5,_0x11c4e5=new Map();for(const _0x4d6714 of _0x2774d3){const _0x3666df=_0x4d6714['folderId']?_0x4f4ef7[_0x49989c(0x1ea)](_0x4d6714[_0x49989c(0x19e)])||'':'',_0x544aea=_0x3666df+':'+_0x4d6714[_0x49989c(0x17e)];!_0x11c4e5[_0x49989c(0x1b5)](_0x544aea)&&_0x11c4e5[_0x49989c(0x172)](_0x544aea,[]),_0x11c4e5[_0x49989c(0x1ea)](_0x544aea)[_0x49989c(0x184)](_0x4d6714);}for(const _0x1eee8d of _0x11c4e5['values']()){_0x1eee8d['sort']((_0x342782,_0x5c7f73)=>(_0x342782[_0x49989c(0x211)]||0x0)-(_0x5c7f73[_0x49989c(0x211)]||0x0));}return _0x11c4e5;}export function collectFoldersToCreate(_0x23cf53,_0x2c729d){const _0x2303a5=a117_0x110a5,_0x240a39=new Set();for(const _0x3f7c3c of _0x23cf53){if(!_0x3f7c3c)continue;if(_0x2c729d[_0x2303a5(0x1b5)](_0x3f7c3c))continue;const _0x3ca981=_0x3f7c3c[_0x2303a5(0x1e0)]('/');let _0x17c2df='';for(const _0xb24d35 of _0x3ca981){_0x17c2df=_0x17c2df?_0x17c2df+'/'+_0xb24d35:_0xb24d35,!_0x2c729d[_0x2303a5(0x1b5)](_0x17c2df)&&_0x240a39[_0x2303a5(0x198)](_0x17c2df);}}return _0x240a39;}function a117_0x5c13(_0x54e48a,_0xb55ad){_0x54e48a=_0x54e48a-0x135;const _0x3b8c29=a117_0x3b8c();let _0x5c138e=_0x3b8c29[_0x54e48a];return _0x5c138e;}export function parseAndClassifyYamlFiles(_0xbc06cf,_0x3ccd1b,_0x6dfd0c){const _0x4cb755=a117_0x110a5,_0x1fa147=[],_0x4a5d0a=[];for(const _0x32cb70 of _0xbc06cf){const _0x2dc625=a117_0x227d93[_0x4cb755(0x202)](_0x3ccd1b,a117_0x227d93[_0x4cb755(0x185)](_0x32cb70)),_0x32a5ab=_0x2dc625==='.'?'':_0x2dc625,_0x369a5f=readFileSync(_0x32cb70,_0x4cb755(0x20a)),_0x46b20a=a117_0x1ce7c7[_0x4cb755(0x20c)](_0x369a5f);if(isJourneyDef(_0x46b20a)){const _0x378df1=a117_0x16f0f7(_0x369a5f);_0x4a5d0a[_0x4cb755(0x184)]({'yamlConfig':_0x378df1,'folderPath':_0x32a5ab,'sourcePath':_0x32cb70});}else{if(!_0x6dfd0c?.['skipSegments']){const _0x59b662=parseSegmentYamlFile(_0x369a5f),_0x36a3bd=normalizeChildSegmentYaml(_0x59b662);_0x1fa147[_0x4cb755(0x184)]({'yamlConfig':_0x36a3bd,'folderPath':_0x32a5ab,'sourcePath':_0x32cb70});}}}return{'segments':_0x1fa147,'journeys':_0x4a5d0a};}export function validateParsedFiles(_0x28ff1a,_0x1bf676){const _0x409144=a117_0x110a5,_0xb6146f=[];for(const {yamlConfig:_0x157a6b,sourcePath:_0x4867d9}of _0x28ff1a[_0x409144(0x18a)]){const _0x4fef9d=readFileSync(_0x4867d9,_0x409144(0x20a)),_0x2cce5d=a117_0x1ce7c7[_0x409144(0x183)](_0x4fef9d),_0xd71651=validateSegmentDef(_0x157a6b,{'source':_0x4fef9d,'document':_0x2cce5d});if(!_0xd71651[_0x409144(0x1c5)]){const _0x50fa37=a117_0x227d93[_0x409144(0x202)](_0x1bf676,_0x4867d9);_0xb6146f[_0x409144(0x184)]({'filePath':_0x50fa37,'source':_0x4fef9d,'result':_0xd71651,'isJourney':![]});}}for(const {yamlConfig:_0x1ab99b,sourcePath:_0x25851d}of _0x28ff1a[_0x409144(0x219)]){const _0x15389c=readFileSync(_0x25851d,'utf-8'),_0x109e3b=a117_0x1ce7c7['parseDocument'](_0x15389c),_0x4e1f53=validateJourneyDef(_0x1ab99b,{'source':_0x15389c,'document':_0x109e3b});if(!_0x4e1f53[_0x409144(0x1c5)]){const _0x2aab83=a117_0x227d93[_0x409144(0x202)](_0x1bf676,_0x25851d);_0xb6146f[_0x409144(0x184)]({'filePath':_0x2aab83,'source':_0x15389c,'result':_0x4e1f53,'isJourney':!![]});}}return _0xb6146f;}export function formatValidationErrors(_0x3d567a){const _0x40cab5=a117_0x110a5,_0x98d04=[];for(const {filePath:_0x580844,source:_0x5b18f6,result:_0x596a7c,isJourney:_0x2a53b7}of _0x3d567a){const _0x6ee4c2=_0x2a53b7?'journey':_0x40cab5(0x135);_0x98d04[_0x40cab5(0x184)]('\x0a'+_0x580844+'\x20('+_0x6ee4c2+_0x40cab5(0x1fc)+_0x596a7c[_0x40cab5(0x215)][_0x40cab5(0x1d2)]+'\x20error(s)'),_0x98d04[_0x40cab5(0x184)](formatValidationResult(_0x596a7c,_0x5b18f6,_0x580844));}return _0x98d04[_0x40cab5(0x137)]('\x0a');}export function buildLocalExpandedRuleMappings(_0xe2ea0e){const _0xcfdb6d=a117_0x110a5,_0x7a7af0=new Set(),_0x472a75=new Map(),_0x12b63a=collectSegmentUsageCounts(_0xe2ea0e);if(_0xe2ea0e['segments'])for(const [_0x3b5ff5,_0x3d3fc8]of Object[_0xcfdb6d(0x181)](_0xe2ea0e[_0xcfdb6d(0x18a)])){_0x7a7af0[_0xcfdb6d(0x198)](_0x3b5ff5);if(_0x3d3fc8['rule']){const _0x3ed80b=yamlRuleToApi(_0x3d3fc8[_0xcfdb6d(0x1cc)]),_0x22be63=apiRuleToYaml(_0x3ed80b);_0x472a75['set'](_0x3b5ff5,_0x22be63);}}const _0x2ee98b=new Map();let _0x45a028=0x0;for(const [_0x240acd,_0x617c7e]of _0x472a75){const _0x582691=serializeExpandedRule(_0x617c7e,_0x472a75),_0x2e7f8a=_0x2ee98b['get'](_0x582691)||[];_0x2e7f8a[_0xcfdb6d(0x184)]({'name':_0x240acd,'index':_0x45a028}),_0x2ee98b['set'](_0x582691,_0x2e7f8a),_0x45a028++;}const _0x5d9915=new Map();for(const [_0xec372d,_0x3ec883]of _0x2ee98b){const _0x4a1518=_0x3ec883[_0xcfdb6d(0x1de)]()[_0xcfdb6d(0x1f8)]((_0x4e859b,_0x12d1b1)=>{const _0xdc21cc=_0xcfdb6d,_0x406f98=_0x12b63a[_0xdc21cc(0x1ea)](_0x4e859b['name'])||0x0,_0xab4ec3=_0x12b63a[_0xdc21cc(0x1ea)](_0x12d1b1[_0xdc21cc(0x20d)])||0x0;if(_0x406f98!==_0xab4ec3)return _0xab4ec3-_0x406f98;return _0x4e859b['index']-_0x12d1b1[_0xdc21cc(0x14c)];})[_0xcfdb6d(0x1af)](_0x2ee549=>_0x2ee549[_0xcfdb6d(0x20d)]),_0x13eee4=[];for(const _0x581cfa of _0x4a1518){const _0x3ac057=_0x12b63a[_0xcfdb6d(0x1ea)](_0x581cfa)||0x0,_0x4770cb=Math[_0xcfdb6d(0x1cd)](_0x3ac057,0x1);for(let _0x4d70f0=0x0;_0x4d70f0<_0x4770cb;_0x4d70f0++){_0x13eee4[_0xcfdb6d(0x184)](_0x581cfa);}}_0x5d9915['set'](_0xec372d,_0x13eee4);}return{'existingLocalSegmentNames':_0x7a7af0,'localSegmentRules':_0x472a75,'localExpandedRuleToNames':_0x5d9915};}async function buildServerSegmentRuleMap(_0x3ca953,_0x1183c6,_0x5225b9,_0x451e26){const _0x25d581=new Map(),_0xe135b8=new Set(),_0xe62a6=async _0x5c9b20=>{const _0x3d0403=a117_0x5c13;if(_0xe135b8[_0x3d0403(0x1b5)](_0x5c9b20))return;_0xe135b8[_0x3d0403(0x198)](_0x5c9b20);let _0x57d8b9=_0x5225b9[_0x3d0403(0x21a)](_0x48f2e3=>_0x48f2e3['id']===_0x5c9b20);if(!_0x57d8b9)try{_0x57d8b9=await _0x3ca953['segment']['getSegment'](_0x1183c6,_0x5c9b20);}catch{return;}if(!_0x57d8b9?.[_0x3d0403(0x1cc)])return;const _0x11fad4=apiRuleToYaml(_0x57d8b9[_0x3d0403(0x1cc)]);_0x25d581[_0x3d0403(0x172)](_0x5c9b20,_0x11fad4);const _0x5df51e=collectSegmentRefsFromRule(_0x11fad4);for(const _0x6728e3 of _0x5df51e){await _0xe62a6(_0x6728e3);}};for(const _0x2b372d of _0x451e26){await _0xe62a6(_0x2b372d);}return _0x25d581;}export function createSegmentIdResolver(_0x4e3886,_0x3bb154){return async _0x135bc9=>{const _0x3f0b94=a117_0x5c13,_0x282d5a=_0x4e3886[_0x3f0b94(0x1ea)](_0x135bc9);if(!_0x282d5a)throw new SDKError(ErrorCode[_0x3f0b94(0x1fe)],_0x3f0b94(0x1b7)+_0x135bc9+_0x3f0b94(0x1b2)+_0x3bb154+'\x27)');return _0x282d5a;};}export function extractRootFolderId(_0x198b2c){const _0x23439e=a117_0x110a5;return _0x198b2c[_0x23439e(0x14f)]?.[_0x23439e(0x158)]?.['data']?.['id']||_0x198b2c[_0x23439e(0x14f)]?.[_0x23439e(0x1d4)]?.[_0x23439e(0x192)]?.['id'];}export function buildConnectionMaps(_0x1856a8){const _0x557290=a117_0x110a5,_0x392986=new Map(),_0x1d7ddd=new Map(),_0x49af92=new Map();for(const _0x4046f1 of _0x1856a8){_0x392986[_0x557290(0x172)](_0x4046f1['name'],parseInt(_0x4046f1['id'],0xa)),_0x1d7ddd[_0x557290(0x172)](_0x4046f1['id'],_0x4046f1[_0x557290(0x20d)]),_0x49af92[_0x557290(0x172)](_0x4046f1[_0x557290(0x20d)],_0x4046f1[_0x557290(0x18b)]);}return{'nameToId':_0x392986,'idToName':_0x1d7ddd,'nameToType':_0x49af92};}export function calculatePushStats(_0x9688b9,_0x449625,_0x1011cc,_0x2d0614,_0x35deb9,_0x8d555b,_0x356f13){const _0x468c83=a117_0x110a5,_0x2b097f=_0x9688b9[_0x468c83(0x1ca)](_0x1f6c89=>_0x1f6c89['isNew']),_0x3a9949=_0x9688b9[_0x468c83(0x1ca)](_0x5445d3=>!_0x5445d3['isNew']&&_0x5445d3['hasChanges']),_0xde4568=_0x9688b9['filter'](_0x3446ff=>!_0x3446ff[_0x468c83(0x1cf)]&&!_0x3446ff[_0x468c83(0x210)]),_0x481411=_0x8d555b?_0x2d0614:[],_0xb6d34a=_0x449625[_0x468c83(0x1ca)](_0x373be9=>_0x373be9['isNew']),_0x5edc08=_0x449625[_0x468c83(0x1ca)](_0x1e407b=>!_0x1e407b['isNew']&&_0x1e407b[_0x468c83(0x210)]),_0x415ef0=_0x449625['filter'](_0x5e2f40=>!_0x5e2f40['isNew']&&!_0x5e2f40['hasChanges']),_0x4558c5=_0x8d555b?_0x35deb9:[],_0x10d308=_0x9688b9[_0x468c83(0x1a5)](_0x52cd97=>_0x52cd97[_0x468c83(0x1f9)]),_0x3604ea=_0x10d308[_0x468c83(0x1ca)](_0x409ff1=>_0x409ff1[_0x468c83(0x18b)]==='create'),_0x4e4f02=_0x10d308[_0x468c83(0x1ca)](_0x221637=>_0x221637[_0x468c83(0x18b)]===_0x468c83(0x16f)),_0x2b3eca=_0x10d308[_0x468c83(0x1ca)](_0x3c45e8=>_0x3c45e8[_0x468c83(0x18b)]==='delete'),_0x1ebd7b=Array[_0x468c83(0x15a)](_0x1011cc)['sort'](),_0x3f4242=_0x356f13?![]:_0x2b097f[_0x468c83(0x1d2)]>0x0||_0x3a9949[_0x468c83(0x1d2)]>0x0||_0x481411[_0x468c83(0x1d2)]>0x0,_0x3bc350=_0xb6d34a[_0x468c83(0x1d2)]>0x0||_0x5edc08[_0x468c83(0x1d2)]>0x0||_0x4558c5['length']>0x0,_0x2bb801=_0x356f13?![]:_0x10d308[_0x468c83(0x1d2)]>0x0,_0x58eac9=_0x1ebd7b[_0x468c83(0x1d2)]>0x0;return{'segments':{'new':_0x2b097f,'changed':_0x3a9949,'unchanged':_0xde4568,'toDelete':_0x481411},'journeys':{'new':_0xb6d34a,'changed':_0x5edc08,'unchanged':_0x415ef0,'toDelete':_0x4558c5},'activations':{'all':_0x10d308,'toCreate':_0x3604ea,'toUpdate':_0x4e4f02,'toDelete':_0x2b3eca},'folders':{'toCreate':_0x1ebd7b},'counts':{'segments':{'new':_0x2b097f[_0x468c83(0x1d2)],'changed':_0x3a9949['length'],'unchanged':_0xde4568[_0x468c83(0x1d2)],'toDelete':_0x481411[_0x468c83(0x1d2)]},'journeys':{'new':_0xb6d34a['length'],'changed':_0x5edc08['length'],'unchanged':_0x415ef0[_0x468c83(0x1d2)],'toDelete':_0x4558c5[_0x468c83(0x1d2)]},'activations':{'create':_0x3604ea[_0x468c83(0x1d2)],'update':_0x4e4f02['length'],'delete':_0x2b3eca['length']},'folders':_0x1ebd7b[_0x468c83(0x1d2)]},'hasChanges':_0x3f4242||_0x3bc350||_0x2bb801||_0x58eac9};}export async function buildPushExecutionContext(_0x11bb8d,_0x6bc8d8,_0x555637,_0x60e1e7,_0x52bad3,_0x53bab2){const _0x182b72=a117_0x110a5,_0x4110da=extractRootFolderId(_0x555637),{pathToId:_0x4991d1,idToPath:_0xf138ef}=buildFolderMaps(_0x52bad3),_0x18a13f=buildSegmentNameToIdMap(_0x60e1e7),_0x40b7fd=new Map(),{batchAsync:_0x4eeffb}=await import(_0x182b72(0x207)),[_0x2a9cf0,_0x371886]=await Promise[_0x182b72(0x1b9)]([_0x11bb8d[_0x182b72(0x14e)]['buildUserMaps'](),_0x11bb8d['connection'][_0x182b72(0x154)](),((async()=>{const _0x524087=_0x182b72;!_0x53bab2&&_0x60e1e7[_0x524087(0x1d2)]>0x0&&await _0x4eeffb(_0x60e1e7,async _0x3934ce=>{const _0x1b51c6=_0x524087,_0x4e83dc=await _0x11bb8d['segment'][_0x1b51c6(0x16d)](_0x6bc8d8,_0x3934ce['id']);_0x40b7fd[_0x1b51c6(0x172)](_0x3934ce['id'],_0x4e83dc);});})())]),{emailToId:_0x5cdf3d,idToEmail:_0x442601}=_0x2a9cf0,_0x14078d=buildConnectionMaps(_0x371886);return{'rootFolderId':_0x4110da,'folderPathToId':_0x4991d1,'folderIdToPath':_0xf138ef,'segmentNameToId':_0x18a13f,'activationsBySegmentId':_0x40b7fd,'emailToIdMap':_0x5cdf3d,'idToEmailMap':_0x442601,'connectionNameToIdMap':_0x14078d[_0x182b72(0x144)],'connectionIdToNameMap':_0x14078d[_0x182b72(0x1e2)],'connectionNameToTypeMap':_0x14078d[_0x182b72(0x19b)]};}export function createPushYamlContextForBundle(_0xe05179,_0x1b2b0c,_0x5f288e,_0x1b286f,_0x5a58ee,_0x183dd5,_0x484d91,_0x81bf33){const {existingLocalSegmentNames:_0xe7b50,localExpandedRuleToNames:_0x53e0ce}=_0x1b286f,_0xe8de06=new Set(),_0x3e6847=new Map(),_0x38441e=new Map(),_0x14b561=new Map(),_0x2505d8=createJumpTargetCache(),_0x630082=new Map(),_0x15bdb8=new Map(),_0x4fca80=new Set();let _0xe574dd;const _0x2be728=_0x5b5e8f=>{const _0x553889={'resolveSegment':async _0x315207=>{const _0x387bfd=a117_0x5c13,_0x29c45f=_0x14b561[_0x387bfd(0x1ea)](_0x315207);if(_0x29c45f!==undefined)return{'name':_0x29c45f,'isJourneyLocal':!![]};try{let _0x226798=_0x5f288e[_0x387bfd(0x21a)](_0x2bdeb0=>_0x2bdeb0['id']===_0x315207);!_0x226798&&(_0x226798=await _0xe05179[_0x387bfd(0x135)][_0x387bfd(0x157)](_0x1b2b0c,_0x315207));const _0x27335a=generateJourneyLocalName(_0x226798['name']),_0x5110da=_0x226798[_0x387bfd(0x1ef)]===SEGMENT_KIND_JOURNEY&&_0x27335a!==undefined;let _0x54108e=_0x226798[_0x387bfd(0x20d)],_0xf508b2;if(_0x5110da&&_0x226798[_0x387bfd(0x1cc)]){const _0x9ad8af=apiRuleToYaml(_0x226798[_0x387bfd(0x1cc)]);_0x15bdb8[_0x387bfd(0x172)](_0x315207,_0x9ad8af);const _0x29f757=async _0x4a52d6=>{const _0x2be66f=_0x387bfd,_0x2963a0=collectSegmentRefsFromRule(_0x4a52d6);for(const _0x20fe65 of _0x2963a0){if(!_0x15bdb8['has'](_0x20fe65))try{const _0x135d07=await _0xe05179['segment']['getSegment'](_0x1b2b0c,_0x20fe65);if(_0x135d07?.['rule']){const _0x491847=apiRuleToYaml(_0x135d07[_0x2be66f(0x1cc)]);_0x15bdb8[_0x2be66f(0x172)](_0x20fe65,_0x491847),await _0x29f757(_0x491847);}}catch{}}};await _0x29f757(_0x9ad8af);const _0x4b66e9=serializeExpandedRule(_0x9ad8af,_0x15bdb8),_0x6063a6=_0x53e0ce[_0x387bfd(0x1ea)](_0x4b66e9);if(_0x6063a6&&_0x6063a6[_0x387bfd(0x1d2)]>0x0){const _0x41214d=_0x3e6847[_0x387bfd(0x1ea)](_0x4b66e9)||0x0,_0x8a42ed=_0x6063a6[_0x41214d]||_0x6063a6[_0x6063a6[_0x387bfd(0x1d2)]-0x1];_0x3e6847['set'](_0x4b66e9,_0x41214d+0x1),_0x54108e=_0x8a42ed,_0xe8de06['add'](_0x54108e),_0x14b561[_0x387bfd(0x172)](_0x315207,_0x54108e);const _0xa8035c=await resolveRuleSegmentRefs(_0x9ad8af,async _0x1193a8=>{const _0x205964=_0x387bfd,_0x3c246d=_0x14b561[_0x205964(0x1ea)](_0x1193a8);if(_0x3c246d)return _0x3c246d;const _0x215545=await _0xe574dd[_0x205964(0x17d)](_0x1193a8);return _0x215545['name'];});_0xf508b2={'description':_0x226798['description'],'rule':_0xa8035c};}else{const _0x497a48=_0x630082[_0x387bfd(0x1ea)](_0x4b66e9);if(_0x497a48)_0x54108e=_0x497a48,_0x14b561[_0x387bfd(0x172)](_0x315207,_0x54108e);else{if(_0x27335a){let _0x27af49=_0x27335a,_0x1702a0=0x2;while(_0xe8de06[_0x387bfd(0x1b5)](_0x27af49)||_0xe7b50[_0x387bfd(0x1b5)](_0x27af49)){_0x27af49=_0x27335a+'_'+_0x1702a0,_0x1702a0++;}_0xe8de06['add'](_0x27af49),_0x54108e=_0x27af49;}_0x14b561[_0x387bfd(0x172)](_0x315207,_0x54108e),_0x630082['set'](_0x4b66e9,_0x54108e);const _0xd5bebb=await resolveRuleSegmentRefs(_0x9ad8af,async _0x5e7d80=>{const _0x3c2414=_0x387bfd,_0x492175=_0x14b561['get'](_0x5e7d80);if(_0x492175)return _0x492175;const _0x37797c=await _0xe574dd[_0x3c2414(0x17d)](_0x5e7d80);return _0x37797c[_0x3c2414(0x20d)];});_0xf508b2={'description':_0x226798[_0x387bfd(0x149)],'rule':_0xd5bebb};}}}return{'name':_0x54108e,'isJourneyLocal':_0x5110da,'definition':_0xf508b2};}catch{return{'name':_0x315207,'isJourneyLocal':![]};}},'resolveActivation':async _0x2892b9=>{const _0x42ed7a=a117_0x5c13,_0x64a3b3=_0x38441e[_0x42ed7a(0x1ea)](_0x2892b9);if(_0x64a3b3!==undefined)return{'name':_0x64a3b3,'isJourneyLocal':!![]};try{let _0x3d5925=_0x484d91?.[_0x42ed7a(0x1ea)](_0x2892b9);!_0x3d5925&&(_0x3d5925=await _0xe05179[_0x42ed7a(0x15f)][_0x42ed7a(0x1e1)](_0x5b5e8f,_0x2892b9));const _0x44a375=_0x3d5925[_0x42ed7a(0x13d)][_0x42ed7a(0x1db)][_0x42ed7a(0x20d)]||_0x2892b9,_0xb58151=sanitizeYamlKey(_0x44a375)||_0x42ed7a(0x166)+_0x2892b9,_0x59f35=_0xb58151;_0x38441e[_0x42ed7a(0x172)](_0x2892b9,_0x59f35);const _0x19f18b=journeyActivationStepToYaml(_0x3d5925,_0x5a58ee,_0x183dd5);return{'name':_0x59f35,'isJourneyLocal':!![],'definition':_0x19f18b};}catch{return{'name':_0x2892b9,'isJourneyLocal':![]};}},'resolveJumpTarget':(_0x326b44,_0x18bc89)=>resolveJumpTarget(_0x326b44,_0x18bc89,_0x2505d8,async _0x3d26a3=>{const _0x78b8bf=a117_0x5c13,_0x3d366d=_0x81bf33?.[_0x78b8bf(0x1ea)](_0x3d26a3);if(_0x3d366d)return _0x3d366d;return _0xe05179[_0x78b8bf(0x15f)][_0x78b8bf(0x1d8)](_0x3d26a3);})};return _0xe574dd=_0x553889,_0x553889;},_0x3645e3=async _0x2cf2b8=>{const _0x2e78f7=a117_0x5c13,{collectSegmentIdsFromJourneyApi:_0x46b210}=await import(_0x2e78f7(0x1ee)),{batchAsync:_0xcbf092}=await import(_0x2e78f7(0x207)),_0x47764d=new Set();for(const _0x4ef28c of _0x2cf2b8){let _0x235c9e=_0x81bf33?.[_0x2e78f7(0x1ea)](_0x4ef28c);!_0x235c9e&&(_0x235c9e=await _0xe05179[_0x2e78f7(0x15f)][_0x2e78f7(0x1d8)](_0x4ef28c));const _0x157eed=_0x46b210(_0x235c9e);for(const _0x4beb00 of _0x157eed){_0x47764d[_0x2e78f7(0x198)](_0x4beb00);}}let _0x52a755=Array[_0x2e78f7(0x15a)](_0x47764d);while(_0x52a755[_0x2e78f7(0x1d2)]>0x0){const _0x170eb3=_0x52a755[_0x2e78f7(0x1ca)](_0xe96f17=>!_0x4fca80[_0x2e78f7(0x1b5)](_0xe96f17));if(_0x170eb3[_0x2e78f7(0x1d2)]===0x0)break;const _0x4f24fb=await _0xcbf092(_0x170eb3,async _0x318fa4=>{const _0x5eff4e=_0x2e78f7;_0x4fca80[_0x5eff4e(0x198)](_0x318fa4);let _0x51161f=_0x5f288e[_0x5eff4e(0x21a)](_0x4e7325=>_0x4e7325['id']===_0x318fa4);if(!_0x51161f)try{_0x51161f=await _0xe05179[_0x5eff4e(0x135)][_0x5eff4e(0x157)](_0x1b2b0c,_0x318fa4);}catch{return null;}return{'segmentId':_0x318fa4,'segment':_0x51161f};},0xa),_0x1e6220=new Set();for(const _0x3c51d6 of _0x4f24fb){if(!_0x3c51d6?.[_0x2e78f7(0x135)]?.[_0x2e78f7(0x1cc)])continue;const _0x7a4168=apiRuleToYaml(_0x3c51d6[_0x2e78f7(0x135)][_0x2e78f7(0x1cc)]);_0x15bdb8[_0x2e78f7(0x172)](_0x3c51d6[_0x2e78f7(0x162)],_0x7a4168);const _0x197cf9=collectSegmentRefsFromRule(_0x7a4168);for(const _0x583ac0 of _0x197cf9){!_0x4fca80['has'](_0x583ac0)&&_0x1e6220[_0x2e78f7(0x198)](_0x583ac0);}}_0x52a755=Array[_0x2e78f7(0x15a)](_0x1e6220);}};return{'createYamlContext':_0x2be728,'prefetchJourneySegments':_0x3645e3};}export async function executePushSegments(_0x34a5bc,_0x13f3da,_0x1eebb8,_0x298b75,_0x282db2){const _0x5b147b=a117_0x110a5,{segmentDefToCreateRequest:_0x43ffee,segmentDefToUpdateRequest:_0xe15040}=await import(_0x5b147b(0x16c)),_0x546ac0=_0x1eebb8[_0x5b147b(0x1f0)],_0x197eb8=0x5,_0x3db54e=async _0x5c7b29=>{const _0x17426b=_0x5b147b,_0xf1d381=_0x5c7b29[_0x17426b(0x1e8)]?_0x546ac0[_0x17426b(0x1ea)](_0x5c7b29[_0x17426b(0x1e8)]):undefined;let _0x5123d5;const _0x5bed36={'created':0x0,'updated':0x0,'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};try{if(_0x5c7b29[_0x17426b(0x1cf)]){_0x282db2[_0x17426b(0x1df)]?.({'type':_0x17426b(0x161),'name':_0x5c7b29['yamlConfig'][_0x17426b(0x20d)]});const _0x55e196=_0x43ffee(_0x5c7b29[_0x17426b(0x199)],_0xf1d381),_0x2b0fc1=await _0x282db2[_0x17426b(0x148)]('Creating\x20segment\x20\x27'+_0x5c7b29[_0x17426b(0x199)]['name']+_0x17426b(0x1ab),()=>_0x34a5bc[_0x17426b(0x135)][_0x17426b(0x1a6)](_0x298b75[_0x17426b(0x20e)],_0x55e196));_0x5123d5=_0x2b0fc1[_0x17426b(0x192)]['id'],_0x5bed36[_0x17426b(0x1b4)]={'name':_0x5c7b29[_0x17426b(0x199)]['name'],'id':_0x5123d5},_0x282db2[_0x17426b(0x1df)]?.({'type':_0x17426b(0x17a),'name':_0x5c7b29['yamlConfig'][_0x17426b(0x20d)],'segmentId':_0x5123d5}),_0x282db2[_0x17426b(0x1b1)]?.('Created\x20segment\x20\x27'+_0x5c7b29['yamlConfig'][_0x17426b(0x20d)]+'\x27'),_0x5bed36[_0x17426b(0x188)]=0x1;}else{if(_0x5c7b29[_0x17426b(0x210)]){_0x282db2['onProgress']?.({'type':_0x17426b(0x18f),'name':_0x5c7b29['yamlConfig'][_0x17426b(0x20d)]});const _0x55d86b=_0xe15040(_0x5c7b29['yamlConfig']);_0xf1d381!==_0x5c7b29[_0x17426b(0x1a4)]?.[_0x17426b(0x1ac)]&&(_0x55d86b[_0x17426b(0x1ac)]=_0xf1d381?parseInt(_0xf1d381,0xa):undefined),await _0x282db2[_0x17426b(0x148)](_0x17426b(0x160)+_0x5c7b29[_0x17426b(0x199)]['name']+_0x17426b(0x1ab),()=>_0x34a5bc[_0x17426b(0x135)]['updateSegmentById'](_0x298b75['parentId'],_0x5c7b29['existingSegment']['id'],_0x55d86b)),_0x5123d5=_0x5c7b29['existingSegment']['id'],_0x282db2[_0x17426b(0x1df)]?.({'type':_0x17426b(0x17c),'name':_0x5c7b29[_0x17426b(0x199)][_0x17426b(0x20d)]}),_0x282db2[_0x17426b(0x1b1)]?.('Updated\x20segment\x20\x27'+_0x5c7b29[_0x17426b(0x199)][_0x17426b(0x20d)]+'\x27'),_0x5bed36[_0x17426b(0x171)]=0x1;}else _0x5123d5=_0x5c7b29[_0x17426b(0x1a4)]['id'];}}catch(_0x4425b3){const _0x4def98=isHttp400Error(_0x4425b3),_0x1f3ca0=_0x4def98?ErrorCode[_0x17426b(0x180)]:ErrorCode['SEGMENT_UPDATE_ERROR'],_0x4d1e5e=getErrorMessage(_0x4425b3);throw new SDKError(_0x1f3ca0,'Failed\x20to\x20'+(_0x5c7b29[_0x17426b(0x1cf)]?_0x17426b(0x217):_0x17426b(0x16f))+'\x20segment\x20from\x20file:\x20'+_0x5c7b29['absolutePath']+_0x17426b(0x140)+_0x4d1e5e,_0x4425b3);}try{const _0xae975c=await syncActivationsForSegment(_0x34a5bc,_0x298b75[_0x17426b(0x20e)],_0x5123d5,_0x5c7b29[_0x17426b(0x199)]['name'],_0x5c7b29[_0x17426b(0x1f9)],_0x282db2,_0x5c7b29[_0x17426b(0x1a1)]);_0x5bed36[_0x17426b(0x16e)]=_0xae975c;}catch(_0x51526b){if(_0x51526b instanceof SDKError)throw _0x51526b;throw new SDKError(ErrorCode[_0x17426b(0x17b)],_0x17426b(0x1d1)+_0x5c7b29['yamlConfig']['name']+_0x17426b(0x1a7)+_0x5c7b29[_0x17426b(0x1a1)]+'\x0a\x20\x20'+getErrorMessage(_0x51526b),_0x51526b);}return _0x5bed36;},_0x139a23=await batchAsync(_0x13f3da,_0x3db54e,_0x197eb8),_0x4cee16={'created':0x0,'updated':0x0,'deleted':0x0,'createdSegmentIds':new Map(),'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};for(const _0x5717fc of _0x139a23){_0x4cee16[_0x5b147b(0x188)]+=_0x5717fc[_0x5b147b(0x188)],_0x4cee16[_0x5b147b(0x171)]+=_0x5717fc[_0x5b147b(0x171)],_0x5717fc['createdSegmentId']&&_0x4cee16[_0x5b147b(0x1c1)][_0x5b147b(0x172)](_0x5717fc[_0x5b147b(0x1b4)]['name'],_0x5717fc[_0x5b147b(0x1b4)]['id']),_0x4cee16[_0x5b147b(0x16e)][_0x5b147b(0x188)]+=_0x5717fc[_0x5b147b(0x16e)][_0x5b147b(0x188)],_0x4cee16['activations']['updated']+=_0x5717fc[_0x5b147b(0x16e)]['updated'],_0x4cee16['activations'][_0x5b147b(0x167)]+=_0x5717fc['activations'][_0x5b147b(0x167)];}return _0x4cee16;}function a117_0x3b8c(){const _0x4f2c04=['segment_updating','entry_criteria','connectionIdToNameMap','data','Warning:\x20Could\x20not\x20resolve\x20embedded\x20segment\x20\x27','columns','journeyStages','stages','Stage\x20\x27','add','yamlConfig','milestone','nameToType','Updated\x20journey\x20\x27','NOT_FOUND','folderId','entry','embeddedSegmentNameToId','absolutePath','1178860sLKZdU','replace','existingSegment','flatMap','createSegment','\x27\x20from\x20file:\x20','\x20(referenced\x20in\x20journey\x20','Deleting\x20activation\x20\x27','35PFhVzg','\x27...','segmentFolderId','330550esAXwE','logDeleted','map','null','logSuccess','\x20(referenced\x20in\x20embedded\x20segment\x20\x27','validatedRequest','createdSegmentId','has','steps','Segment\x20not\x20found:\x20','action','all','Name\x20has\x20already\x20been\x20taken','JOURNEY_UPDATE_ERROR','\x27\x20for\x20','results','decision_point','30756CPSnuL','trim','createdSegmentIds','diff','existingSegments','3228XeEbet','valid','activation_deleting','journeyById','activation_template_id','\x27\x20not\x20found\x20in\x20journey\x20\x27','filter','\x27\x20entry\x20criteria','rule','max','startsWith','isNew','__pending_act_','Failed\x20to\x20sync\x20activations\x20for\x20segment\x20\x27','length','folder_created','parentFolder','activation_updating','with','deleteSegment','getJourney','waitCondition','notification','activationParams','Entry\x20criteria:\x20','Created\x20folder\x20\x27','slice','onProgress','split','getActivation','idToName','createFolder','activationStepsById','JOURNEY_SYNTAX_ERROR','Activation','journey_creating','folderPath','reduce','get','\x20activation\x20\x27','activation_creating','Updating\x20activation\x20\x27','./journey-yaml.js','kind','folderPathToId','createActivation','updateSegmentById','1474mzPrRy','ACTIVATION_SYNTAX_ERROR','activation_created','journeyActivationStepId','Failed\x20to\x20','sort','activationActions','108099FbodiV','entryCriteria','):\x20','rootFolderId','SEGMENT_NOT_FOUND','deps','goal','behavior','relative','embedded_segment_created','unchanged','schedule','activationContext','../../utils/async.js','effectiveFolderId','progress','utf-8','resolveJourneyId','parse','name','parentId','journeyId','hasChanges','versionNumber','all_columns','Cannot\x20create\x20embedded\x20segment\x20for\x20existing\x20journey\x20without\x20journey\x20ID','Define\x20it\x20in\x20the\x20journey\x27s\x20\x27activations\x27\x20section\x20or\x20use\x20an\x20existing\x20activation\x20ID.','errors','journey_updated','create','segment_deleted','journeys','find','3DiZkLd','segment','stringify','join','segmentByFolderAndName','toLowerCase','segmentNameToId','journey_updating','\x20journey\x20from\x20file:\x20','attributes','Updated\x20activation\x20\x27','811480TmBriy','\x0a\x20\x20','WaitStep','existingJourney','branches','nameToId','522628EtoXNs','folder_creating','Cannot\x20create\x20embedded\x20activation\x20without\x20journey\x20context','withProgress','description','item','1490LsVpxq','index','330sgEghQ','user','relationships','idToEmailMap','\x27\x20not\x20found\x20in\x20parent\x20segment\x20(referenced\x20in\x20jump\x20step\x20of\x20\x27',').\x20','Activation\x20not\x20found:\x20','list','activation_updated','state','getSegment','parentSegmentFolder','\x27\x20exit\x20criteria','from','updateActivation','logInfo','Created\x20activation\x20\x27','stage\x20\x27','journey','Updating\x20segment\x20\x27','segment_creating','segmentId','DecisionPoint','fetchJourney','deleteActivation','activation_','deleted','embedded_activation_creating','size','exitCriterias','digest','./child-segment-yaml.js','listActivations','activations','update','Created\x20journey\x20\x27','updated','set','connector_config','journeyBundlesByFolderAndName','createJourneySegment','goal\x20criteria','delete','keys','Fetching\x20','segment_created','ACTIVATION_UPDATE_ERROR','segment_updated','resolveSegment','journeyBundleName','Creating\x20activation\x20\x27','SEGMENT_SYNTAX_ERROR','entries','message','parseDocument','push','dirname','INTERNAL','hex','created','verbose','segments','type','existingActivation','activationsBySegmentId','toString'];a117_0x3b8c=function(){return _0x4f2c04;};return a117_0x3b8c();}async function syncActivationsForSegment(_0x1e4a57,_0x1b459f,_0x15d26e,_0x3ad843,_0x46e207,_0x152408,_0x30535a){const _0x57e673=a117_0x110a5,_0xeb0923={'created':0x0,'updated':0x0,'deleted':0x0};for(const _0x4a9351 of _0x46e207){try{if(_0x4a9351[_0x57e673(0x18b)]===_0x57e673(0x217)&&_0x4a9351[_0x57e673(0x1b3)])_0x152408[_0x57e673(0x1df)]?.({'type':_0x57e673(0x1ec),'segmentName':_0x3ad843,'activationName':_0x4a9351[_0x57e673(0x20d)]}),await _0x152408[_0x57e673(0x148)](_0x57e673(0x17f)+_0x4a9351['name']+_0x57e673(0x1ab),()=>_0x1e4a57[_0x57e673(0x135)][_0x57e673(0x1f1)](_0x1b459f,_0x15d26e,_0x4a9351[_0x57e673(0x1b3)])),_0x152408['onProgress']?.({'type':_0x57e673(0x1f5),'segmentName':_0x3ad843,'activationName':_0x4a9351[_0x57e673(0x20d)]}),_0x152408['logSuccess']?.(_0x57e673(0x15d)+_0x4a9351['name']+'\x27'),_0xeb0923[_0x57e673(0x188)]++;else{if(_0x4a9351[_0x57e673(0x18b)]==='update'&&_0x4a9351[_0x57e673(0x1b3)]&&_0x4a9351[_0x57e673(0x18c)])_0x152408[_0x57e673(0x1df)]?.({'type':_0x57e673(0x1d5),'segmentName':_0x3ad843,'activationName':_0x4a9351['name']}),await _0x152408['withProgress'](_0x57e673(0x1ed)+_0x4a9351[_0x57e673(0x20d)]+'\x27...',()=>_0x1e4a57['segment'][_0x57e673(0x15b)](_0x1b459f,_0x15d26e,_0x4a9351[_0x57e673(0x18c)]['id'],_0x4a9351[_0x57e673(0x1b3)])),_0x152408[_0x57e673(0x1df)]?.({'type':_0x57e673(0x155),'segmentName':_0x3ad843,'activationName':_0x4a9351[_0x57e673(0x20d)]}),_0x152408[_0x57e673(0x1b1)]?.(_0x57e673(0x13e)+_0x4a9351['name']+'\x27'),_0xeb0923[_0x57e673(0x171)]++;else _0x4a9351[_0x57e673(0x18b)]===_0x57e673(0x177)&&_0x4a9351[_0x57e673(0x18c)]&&(_0x152408[_0x57e673(0x1df)]?.({'type':_0x57e673(0x1c6),'segmentName':_0x3ad843,'activationName':_0x4a9351['name']}),await _0x152408[_0x57e673(0x148)](_0x57e673(0x1a9)+_0x4a9351[_0x57e673(0x20d)]+_0x57e673(0x1ab),()=>_0x1e4a57['segment'][_0x57e673(0x165)](_0x1b459f,_0x15d26e,_0x4a9351['existingActivation']['id'])),_0x152408[_0x57e673(0x1df)]?.({'type':'activation_deleted','segmentName':_0x3ad843,'activationName':_0x4a9351[_0x57e673(0x20d)]}),_0x152408[_0x57e673(0x1ae)]?.('Deleted\x20activation\x20\x27'+_0x4a9351[_0x57e673(0x20d)]+'\x27'),_0xeb0923['deleted']++);}}catch(_0x1f0b17){const _0x244aa0=isHttp400Error(_0x1f0b17),_0x1e091f=_0x244aa0?ErrorCode[_0x57e673(0x1f4)]:ErrorCode['ACTIVATION_UPDATE_ERROR'],_0xca07db=getErrorMessage(_0x1f0b17);throw new SDKError(_0x1e091f,_0x57e673(0x1f7)+_0x4a9351[_0x57e673(0x18b)]+_0x57e673(0x1eb)+_0x4a9351[_0x57e673(0x20d)]+_0x57e673(0x1a7)+_0x30535a+_0x57e673(0x140)+_0xca07db,_0x1f0b17);}}return _0xeb0923;}export async function executePushFolders(_0x253ddb,_0x51564b,_0x311edd,_0x298e15,_0x77fcf5){const _0x25b519=a117_0x110a5,_0x2cc395=new Map(_0x311edd);for(const _0x536877 of _0x51564b){const _0x16efd6=_0x536877[_0x25b519(0x1e0)]('/'),_0x5c63cc=_0x16efd6[_0x16efd6[_0x25b519(0x1d2)]-0x1],_0x29ed26=_0x16efd6[_0x25b519(0x1de)](0x0,-0x1)[_0x25b519(0x137)]('/'),_0x40523c=_0x2cc395[_0x25b519(0x1ea)](_0x29ed26);_0x77fcf5[_0x25b519(0x1df)]?.({'type':_0x25b519(0x146),'folder':_0x536877});const _0x4edb4b={'name':_0x5c63cc,'parentFolderId':_0x40523c},_0x5c2131=await _0x77fcf5[_0x25b519(0x148)]('Creating\x20folder\x20\x27'+_0x536877+_0x25b519(0x1ab),()=>_0x253ddb[_0x25b519(0x135)][_0x25b519(0x1e3)](_0x298e15[_0x25b519(0x20e)],_0x4edb4b));_0x2cc395[_0x25b519(0x172)](_0x536877,_0x5c2131[_0x25b519(0x192)]['id']),_0x77fcf5['onProgress']?.({'type':_0x25b519(0x1d3),'folder':_0x536877,'folderId':_0x5c2131[_0x25b519(0x192)]['id']}),_0x77fcf5[_0x25b519(0x15c)]?.(_0x25b519(0x1dd)+_0x536877+'\x27');}return _0x2cc395;}export async function executePushSegmentDeletions(_0x2de65e,_0x3db664,_0x45db24){const _0x42aa48=a117_0x110a5;if(_0x3db664['length']===0x0)return 0x0;const {batchAsync:_0x39ce69}=await import(_0x42aa48(0x207)),_0x262481=0x5,_0x3fcc46=await _0x39ce69(_0x3db664,async _0x50e422=>{const _0x5c608d=_0x42aa48;return _0x45db24[_0x5c608d(0x1df)]?.({'type':'segment_deleting','name':_0x50e422[_0x5c608d(0x20d)]}),await _0x2de65e[_0x5c608d(0x135)][_0x5c608d(0x1d7)](_0x50e422['id']),_0x45db24[_0x5c608d(0x1df)]?.({'type':_0x5c608d(0x218),'name':_0x50e422[_0x5c608d(0x20d)]}),_0x45db24[_0x5c608d(0x1ae)]?.('Deleted\x20segment\x20\x27'+_0x50e422[_0x5c608d(0x20d)]+'\x27'),0x1;},_0x262481);return _0x3fcc46[_0x42aa48(0x1e9)]((_0xa8f3b7,_0x47f856)=>_0xa8f3b7+_0x47f856,0x0);}export async function executePushJourneys(_0x3e3c0a,_0x521052,_0x3e43fc,_0x4e8ad2,_0xeb2360){const _0xfde5e4=a117_0x110a5,{journeyDefToRequest:_0x3c1f7c}=await import('./journey-yaml.js'),{activationDefToCreateRequest:_0x5cb569,yamlRuleToApi:_0x16507f,validateSegmentRule:_0x2aeca1}=await import(_0xfde5e4(0x16c)),_0x27cb58={'results':[],'created':0x0,'updated':0x0,'embeddedSegmentNameToId':new Map()},_0x25ab90=new Map(_0x3e43fc['segmentNameToId']),_0x493809=0x5;for(let _0x5939f0=0x0;_0x5939f0<_0x521052['length'];_0x5939f0+=_0x493809){const _0x5ee430=_0x521052['slice'](_0x5939f0,_0x5939f0+_0x493809),_0xfdd4b0=await Promise[_0xfde5e4(0x1b9)](_0x5ee430[_0xfde5e4(0x1af)](async _0x44eb9f=>{const _0x1e5dd6=_0xfde5e4;if(!_0x44eb9f[_0x1e5dd6(0x1cf)]&&!_0x44eb9f[_0x1e5dd6(0x210)])return{'action':_0x1e5dd6(0x204),'name':_0x44eb9f[_0x1e5dd6(0x199)][_0x1e5dd6(0x20d)],'journeyId':_0x44eb9f[_0x1e5dd6(0x142)]?.['id']};const _0x4bbbdb=_0x44eb9f[_0x1e5dd6(0x1e8)]?_0x3e43fc[_0x1e5dd6(0x1f0)][_0x1e5dd6(0x1ea)](_0x44eb9f['folderPath']):undefined;_0xeb2360['onProgress']?.({'type':_0x44eb9f['isNew']?_0x1e5dd6(0x1e7):_0x1e5dd6(0x13b),'name':_0x44eb9f[_0x1e5dd6(0x199)][_0x1e5dd6(0x20d)]});try{const _0x542eb6=await executeSingleJourneyPush(_0x3e3c0a,_0x44eb9f,{..._0x3e43fc,'segmentNameToId':_0x25ab90},{'parentId':_0x4e8ad2[_0x1e5dd6(0x20e)],'rootFolderId':_0x4e8ad2['rootFolderId'],'folderId':_0x4bbbdb,'verbose':_0x4e8ad2[_0x1e5dd6(0x189)]},_0xeb2360,{'journeyDefToRequest':_0x3c1f7c,'activationDefToCreateRequest':_0x5cb569,'yamlRuleToApi':_0x16507f,'validateSegmentRule':_0x2aeca1});for(const [_0x37a0a6,_0x32f805]of _0x542eb6[_0x1e5dd6(0x1a0)]){_0x25ab90['set'](_0x37a0a6,_0x32f805),_0x27cb58['embeddedSegmentNameToId']['set'](_0x37a0a6,_0x32f805);}if(_0x542eb6[_0x1e5dd6(0x1b8)]===_0x1e5dd6(0x188))_0xeb2360[_0x1e5dd6(0x1df)]?.({'type':'journey_created','name':_0x44eb9f['yamlConfig'][_0x1e5dd6(0x20d)],'journeyId':_0x542eb6[_0x1e5dd6(0x20f)]}),_0xeb2360[_0x1e5dd6(0x1b1)]?.(_0x1e5dd6(0x170)+_0x44eb9f[_0x1e5dd6(0x199)][_0x1e5dd6(0x20d)]+'\x27'),_0x27cb58[_0x1e5dd6(0x188)]++;else _0x542eb6['action']===_0x1e5dd6(0x171)&&(_0xeb2360['onProgress']?.({'type':_0x1e5dd6(0x216),'name':_0x44eb9f[_0x1e5dd6(0x199)][_0x1e5dd6(0x20d)]}),_0xeb2360['logSuccess']?.(_0x1e5dd6(0x19c)+_0x44eb9f[_0x1e5dd6(0x199)][_0x1e5dd6(0x20d)]+'\x27'),_0x27cb58['updated']++);return{'action':_0x542eb6[_0x1e5dd6(0x1b8)],'name':_0x44eb9f[_0x1e5dd6(0x199)][_0x1e5dd6(0x20d)],'journeyId':_0x542eb6[_0x1e5dd6(0x20f)]};}catch(_0x324f0b){const _0x124859=isHttp400Error(_0x324f0b),_0x29c830=_0x124859?ErrorCode[_0x1e5dd6(0x1e5)]:ErrorCode[_0x1e5dd6(0x1bb)],_0x1181d7=getErrorMessage(_0x324f0b);throw new SDKError(_0x29c830,_0x1e5dd6(0x1f7)+(_0x44eb9f[_0x1e5dd6(0x1cf)]?_0x1e5dd6(0x217):'update')+_0x1e5dd6(0x13c)+_0x44eb9f['absolutePath']+_0x1e5dd6(0x140)+_0x1181d7,_0x324f0b);}}));_0x27cb58[_0xfde5e4(0x1bd)][_0xfde5e4(0x184)](..._0xfdd4b0);}return _0x27cb58;}async function executeSingleJourneyPush(_0x60ed9f,_0x2933b5,_0x9fc1b7,_0x4dd78e,_0x1b059d,_0x3ee183){const _0x37ab8f=a117_0x110a5,{journeyDefToRequest:_0x55bc77,activationDefToCreateRequest:_0x29f2a3,yamlRuleToApi:_0x2ed28c,validateSegmentRule:_0x2ca8b4}=_0x3ee183,_0x304453=new Map(),_0x593169=new Map(),_0x3aeff7=new Map(),_0x20f1e0=new Map(),_0x189f94=new Map();let _0x3aa527;const _0x4159f9=async()=>{const _0x582f66=a117_0x5c13;if(_0x3aa527)return;_0x3aa527=new Map();if(!_0x2933b5['existingJourney'])return;const _0x3e656e=await _0x60ed9f[_0x582f66(0x15f)][_0x582f66(0x16d)](_0x2933b5[_0x582f66(0x142)]['id']);for(const _0x559ef1 of _0x3e656e){const _0xdc5e07=journeyActivationStepToYaml(_0x559ef1,_0x9fc1b7[_0x582f66(0x150)],_0x9fc1b7[_0x582f66(0x191)]),_0x304449=activationSignature(_0xdc5e07);!_0x3aa527['has'](_0x304449)&&_0x3aa527[_0x582f66(0x172)](_0x304449,_0x559ef1['id']),_0xdc5e07[_0x582f66(0x20d)]&&_0x593169[_0x582f66(0x172)](_0xdc5e07['name'],_0x559ef1['id']);}};if(_0x2933b5[_0x37ab8f(0x142)]&&_0x2933b5[_0x37ab8f(0x199)][_0x37ab8f(0x18a)]){const _0x2077c9=buildLocalExpandedRuleMappings(_0x2933b5[_0x37ab8f(0x199)]),_0x3c8a8a=_0x2077c9['localSegmentRules'];if(_0x3c8a8a[_0x37ab8f(0x169)]>0x0){const _0x2d1776=new Map();for(const [_0x19a68c,_0x35b18a]of _0x3c8a8a){const _0x25f53d=serializeExpandedRule(_0x35b18a,_0x3c8a8a);_0x2d1776['set'](_0x19a68c,_0x25f53d);}const _0x15cab4=collectSegmentIdsFromJourneyApi(_0x2933b5['existingJourney']);if(_0x15cab4[_0x37ab8f(0x169)]>0x0){const _0xd70997=await buildServerSegmentRuleMap(_0x60ed9f,_0x4dd78e[_0x37ab8f(0x20e)],_0x9fc1b7['existingSegments'],_0x15cab4);if(_0xd70997[_0x37ab8f(0x169)]>0x0){const _0x44c736=new Map();for(const [_0x32dcfc,_0x1efd8d]of _0xd70997){const _0x547d8b=serializeExpandedRule(_0x1efd8d,_0xd70997);!_0x44c736[_0x37ab8f(0x1b5)](_0x547d8b)&&_0x44c736[_0x37ab8f(0x172)](_0x547d8b,_0x32dcfc);}for(const [_0x3d839b,_0x40dcca]of _0x2d1776){const _0x554bdf=_0x44c736[_0x37ab8f(0x1ea)](_0x40dcca);_0x554bdf&&(_0x189f94[_0x37ab8f(0x172)](_0x3d839b,_0x554bdf),_0x9fc1b7['segmentNameToId'][_0x37ab8f(0x172)](_0x3d839b,_0x554bdf));}}}}}const _0x5dcd26={'resolveSegmentId':async _0x712b03=>{const _0x1d0b5e=_0x37ab8f,_0x5dc90e=_0x9fc1b7[_0x1d0b5e(0x13a)][_0x1d0b5e(0x1ea)](_0x712b03);if(!_0x5dc90e)throw new SDKError(ErrorCode[_0x1d0b5e(0x1fe)],_0x1d0b5e(0x1b7)+_0x712b03+_0x1d0b5e(0x1a8)+_0x2933b5['yamlConfig'][_0x1d0b5e(0x20d)]+')');return _0x5dc90e;},'resolveEmbeddedSegmentId':async(_0x3f4685,_0x35e5eb)=>{const _0x439c2b=_0x37ab8f,_0xfd87b8=_0x9fc1b7[_0x439c2b(0x13a)]['get'](_0x3f4685);if(_0xfd87b8)return _0xfd87b8;const _0x1d5927=_0x189f94[_0x439c2b(0x1ea)](_0x3f4685);if(_0x1d5927)return _0x9fc1b7[_0x439c2b(0x13a)][_0x439c2b(0x172)](_0x3f4685,_0x1d5927),_0x1d5927;const _0x276712=_0x9fc1b7[_0x439c2b(0x1c3)][_0x439c2b(0x21a)](_0x20c40d=>_0x20c40d[_0x439c2b(0x20d)]===_0x3f4685);if(_0x276712)return _0x9fc1b7[_0x439c2b(0x13a)][_0x439c2b(0x172)](_0x3f4685,_0x276712['id']),_0x276712['id'];if(_0x2933b5[_0x439c2b(0x1cf)]){const {stageName:_0x599a14,criteriaName:_0x20d518}=findSegmentCriteriaLocation(_0x2933b5[_0x439c2b(0x199)],_0x3f4685);return _0x2ca8b4(_0x3f4685,_0x35e5eb[_0x439c2b(0x1cc)]),_0x3aeff7[_0x439c2b(0x172)](_0x3f4685,{'definition':_0x35e5eb,'stageName':_0x599a14,'criteriaName':_0x20d518}),createPendingSegmentId(_0x3f4685);}const _0x1acf6d=_0x2933b5[_0x439c2b(0x142)]?.['id'];if(!_0x1acf6d)throw new SDKError(ErrorCode[_0x439c2b(0x186)],_0x439c2b(0x213));_0x2ca8b4(_0x3f4685,_0x35e5eb[_0x439c2b(0x1cc)]);const _0x4c299e=generateDeterministicJourneySegmentName(_0x2933b5['yamlConfig'][_0x439c2b(0x20d)],_0x3f4685),_0x1d73f3=_0x9fc1b7['existingSegments']['find'](_0x4f8add=>_0x4f8add[_0x439c2b(0x20d)]===_0x4c299e),_0x74ab8=createSegmentIdResolver(_0x9fc1b7[_0x439c2b(0x13a)],_0x3f4685),_0x4eeeb1=await resolveRuleSegmentIds(_0x35e5eb[_0x439c2b(0x1cc)],_0x74ab8);let _0x59c876;if(_0x1d73f3)await _0x60ed9f['segment']['updateSegmentById'](_0x4dd78e['parentId'],_0x1d73f3['id'],{'description':_0x35e5eb[_0x439c2b(0x149)]||_0x439c2b(0x1dc)+_0x3f4685,'rule':_0x2ed28c(_0x4eeeb1,!![]),'countPopulation':!![]}),_0x59c876=_0x1d73f3['id'];else try{_0x59c876=await _0x60ed9f[_0x439c2b(0x135)][_0x439c2b(0x175)]({'name':_0x4c299e,'description':_0x35e5eb['description']||'Entry\x20criteria:\x20'+_0x3f4685,'journeyId':_0x1acf6d,'rule':_0x2ed28c(_0x4eeeb1,!![]),'countPopulation':!![],'parentFolderId':_0x4dd78e['rootFolderId']||'','audienceId':_0x4dd78e[_0x439c2b(0x20e)]});}catch(_0x5b96d7){const _0x3c97c8=_0x5b96d7 instanceof Error&&_0x5b96d7[_0x439c2b(0x182)]['includes'](_0x439c2b(0x1ba));if(_0x3c97c8){const _0x8dd82c=await _0x60ed9f['segment']['listSegments'](_0x4dd78e[_0x439c2b(0x20e)]),_0xd6e31c=_0x8dd82c[_0x439c2b(0x21a)](_0x3bfdc9=>_0x3bfdc9[_0x439c2b(0x20d)]===_0x4c299e);if(_0xd6e31c)await _0x60ed9f[_0x439c2b(0x135)][_0x439c2b(0x1f2)](_0x4dd78e['parentId'],_0xd6e31c['id'],{'description':_0x35e5eb[_0x439c2b(0x149)]||'Entry\x20criteria:\x20'+_0x3f4685,'rule':_0x2ed28c(_0x4eeeb1,!![]),'countPopulation':!![]}),_0x59c876=_0xd6e31c['id'];else throw _0x5b96d7;}else throw _0x5b96d7;}return _0x9fc1b7[_0x439c2b(0x13a)][_0x439c2b(0x172)](_0x3f4685,_0x59c876),_0x304453[_0x439c2b(0x172)](_0x3f4685,_0x59c876),_0x59c876;},'resolveActivationId':async _0x132fc3=>{const _0x15ed23=_0x37ab8f,_0x16bd79=_0x593169['get'](_0x132fc3);if(_0x16bd79)return _0x16bd79;if(_0x2933b5[_0x15ed23(0x142)]){await _0x4159f9();const _0x346e85=_0x593169[_0x15ed23(0x1ea)](_0x132fc3);if(_0x346e85)return _0x346e85;}throw new SDKError(ErrorCode[_0x15ed23(0x19d)],_0x15ed23(0x153)+_0x132fc3+_0x15ed23(0x1a8)+_0x2933b5[_0x15ed23(0x199)][_0x15ed23(0x20d)]+_0x15ed23(0x152)+_0x15ed23(0x214));},'resolveEmbeddedActivationId':async(_0x2d2469,_0x385b17)=>{const _0x484c01=_0x37ab8f,_0x357e75=_0x593169[_0x484c01(0x1ea)](_0x2d2469);if(_0x357e75)return _0x357e75;if(_0x2933b5[_0x484c01(0x1cf)])return _0x20f1e0[_0x484c01(0x172)](_0x2d2469,_0x385b17),createPendingActivationId(_0x2d2469);if(_0x2933b5[_0x484c01(0x142)]){await _0x4159f9();const _0x290ba3=_0x593169[_0x484c01(0x1ea)](_0x385b17[_0x484c01(0x20d)]);if(_0x290ba3)return _0x593169[_0x484c01(0x172)](_0x2d2469,_0x290ba3),_0x290ba3;const _0x4b906c=activationSignature(_0x385b17),_0x583e44=_0x3aa527?.['get'](_0x4b906c);if(_0x583e44)return _0x593169[_0x484c01(0x172)](_0x2d2469,_0x583e44),_0x583e44;const _0x4c9a38=await _0x29f2a3(_0x385b17,_0x9fc1b7[_0x484c01(0x206)]),_0x233893=await _0x60ed9f[_0x484c01(0x15f)][_0x484c01(0x1f1)](_0x2933b5[_0x484c01(0x142)]['id'],_0x4c9a38);return _0x593169[_0x484c01(0x172)](_0x2d2469,_0x233893['id']),_0x233893['id'];}throw new SDKError(ErrorCode[_0x484c01(0x186)],_0x484c01(0x147));},'resolveJourneyId':async _0x5e23bb=>{const _0x369172=_0x37ab8f;try{return await _0x60ed9f['journey'][_0x369172(0x20b)](_0x4dd78e['parentId'],_0x5e23bb);}catch(_0x1558ed){throw new SDKError(ErrorCode[_0x369172(0x19d)],'Journey\x20\x27'+_0x5e23bb+_0x369172(0x151)+_0x2933b5[_0x369172(0x199)][_0x369172(0x20d)]+'\x27)',_0x1558ed);}},'resolveStageId':async(_0xd71b44,_0x160738)=>{const _0x2c8202=_0x37ab8f,_0x2f40d8=await _0x60ed9f[_0x2c8202(0x15f)][_0x2c8202(0x1d8)](_0xd71b44),_0x5e96e4=_0x2f40d8['attributes'][_0x2c8202(0x195)][_0x2c8202(0x21a)](_0x1343fc=>_0x1343fc[_0x2c8202(0x20d)][_0x2c8202(0x139)]()===_0x160738[_0x2c8202(0x139)]());if(!_0x5e96e4?.['id'])throw new SDKError(ErrorCode[_0x2c8202(0x19d)],_0x2c8202(0x197)+_0x160738+_0x2c8202(0x1c9)+(_0x2f40d8[_0x2c8202(0x13d)][_0x2c8202(0x17e)]||_0x2f40d8[_0x2c8202(0x13d)][_0x2c8202(0x20d)])+'\x27');return _0x5e96e4['id'];}},_0x5b4b0a=await _0x55bc77(_0x2933b5[_0x37ab8f(0x199)],_0x4dd78e['parentId'],_0x5dcd26),_0x5f4f34=_0x4dd78e[_0x37ab8f(0x19e)]||_0x4dd78e[_0x37ab8f(0x1fd)];_0x5f4f34&&(_0x5b4b0a['relationships']={'parentFolder':{'data':{'id':_0x5f4f34,'type':'folder'}}});if(_0x2933b5[_0x37ab8f(0x1cf)]){if(_0x3aeff7['size']>0x0||_0x20f1e0[_0x37ab8f(0x169)]>0x0)return await executeThreeStepJourneyCreate(_0x60ed9f,_0x2933b5,_0x5b4b0a,{'pendingEmbeddedSegments':_0x3aeff7,'pendingEmbeddedActivations':_0x20f1e0,'embeddedSegmentNameToId':_0x304453,'journeyActivationNameToId':_0x593169},{..._0x4dd78e,'effectiveFolderId':_0x5f4f34},_0x9fc1b7,_0x1b059d,_0x3ee183);else{ensureJourneyDefaults(_0x5b4b0a['attributes']);const _0x36beba=await _0x60ed9f[_0x37ab8f(0x15f)][_0x37ab8f(0x217)](_0x5b4b0a);return{'action':_0x37ab8f(0x188),'journeyId':_0x36beba['id'],'embeddedSegmentNameToId':_0x304453};}}else{if(_0x2933b5[_0x37ab8f(0x210)]&&_0x2933b5['existingJourney'])return ensureJourneyDefaults(_0x5b4b0a[_0x37ab8f(0x13d)]),await _0x60ed9f[_0x37ab8f(0x15f)]['update'](_0x2933b5[_0x37ab8f(0x142)]['id'],_0x5b4b0a),{'action':_0x37ab8f(0x171),'journeyId':_0x2933b5['existingJourney']['id'],'embeddedSegmentNameToId':_0x304453};}return{'action':'unchanged','journeyId':_0x2933b5[_0x37ab8f(0x142)]?.['id'],'embeddedSegmentNameToId':_0x304453};}function findSegmentCriteriaLocation(_0x49e8ef,_0x3ceb6f){const _0x3398f0=a117_0x110a5,_0xfa2efe=_0x49e8ef['stages']||_0x49e8ef[_0x3398f0(0x219)]?.[0x0]?.[_0x3398f0(0x196)]||[];let _0x5bfcf6=_0x3398f0(0x19f),_0x3f5032=_0x3ceb6f;const _0x12ad9e=_0x49e8ef[_0x3398f0(0x200)]||_0x49e8ef[_0x3398f0(0x219)]?.[0x0]?.['goal'];if(_0x12ad9e?.[_0x3398f0(0x135)]===_0x3ceb6f)return{'stageName':_0x3398f0(0x200),'criteriaName':_0x12ad9e[_0x3398f0(0x20d)]||_0x3ceb6f};_0x227b15:for(const _0x5684d3 of _0xfa2efe){if(_0x5684d3['entry_criteria']?.[_0x3398f0(0x135)]===_0x3ceb6f){_0x5bfcf6=_0x5684d3[_0x3398f0(0x20d)],_0x3f5032=_0x5684d3[_0x3398f0(0x190)][_0x3398f0(0x20d)]||_0x3ceb6f;break;}if(_0x5684d3[_0x3398f0(0x1b6)])for(const _0x56cc20 of _0x5684d3[_0x3398f0(0x1b6)]){if(_0x56cc20[_0x3398f0(0x18b)]===_0x3398f0(0x1be)&&_0x56cc20[_0x3398f0(0x1d6)]?.[_0x3398f0(0x143)])for(const _0xbbbb53 of _0x56cc20['with']['branches']){if(_0xbbbb53[_0x3398f0(0x135)]===_0x3ceb6f){_0x5bfcf6=_0x5684d3['name'],_0x3f5032=_0xbbbb53[_0x3398f0(0x20d)]||_0x3ceb6f;break _0x227b15;}}}}return{'stageName':_0x5bfcf6,'criteriaName':_0x3f5032};}async function executeThreeStepJourneyCreate(_0x260eb5,_0x28e711,_0x29679d,_0x214d9f,_0x25e7bb,_0xa9e28f,_0x453856,_0x4d80b6){const _0x4a824f=a117_0x110a5,{activationDefToCreateRequest:_0x2fd272,yamlRuleToApi:_0x2c62a5}=_0x4d80b6,{pendingEmbeddedSegments:_0x115602,pendingEmbeddedActivations:_0x6c4488,embeddedSegmentNameToId:_0x364245}=_0x214d9f,_0x21ac80=JSON[_0x4a824f(0x20c)](JSON['stringify'](_0x29679d));ensureJourneyDefaults(_0x21ac80['attributes']),stripPendingIds(_0x21ac80);const _0x595d50=await _0x260eb5[_0x4a824f(0x15f)][_0x4a824f(0x217)](_0x21ac80),_0x3d3a93=_0x595d50['id'],_0xd76ecc=new Map();for(const _0x54c29e of _0x595d50['attributes'][_0x4a824f(0x195)]){_0xd76ecc[_0x4a824f(0x172)](_0x54c29e['name'][_0x4a824f(0x139)](),_0x54c29e['id']);}for(const [_0x1d44fb,{definition:_0x580589}]of _0x115602){const _0x9f37a7=generateDeterministicJourneySegmentName(_0x28e711[_0x4a824f(0x199)][_0x4a824f(0x20d)],_0x1d44fb);_0x453856['onProgress']?.({'type':'embedded_segment_creating','journeyName':_0x28e711['yamlConfig'][_0x4a824f(0x20d)],'segmentName':_0x1d44fb});const _0x4c61e7=createSegmentIdResolver(_0xa9e28f[_0x4a824f(0x13a)],_0x1d44fb),_0x387e3d=await resolveRuleSegmentIds(_0x580589[_0x4a824f(0x1cc)],_0x4c61e7),_0x1ec15a=await _0x260eb5[_0x4a824f(0x135)][_0x4a824f(0x175)]({'name':_0x9f37a7,'description':_0x580589[_0x4a824f(0x149)]||'Entry\x20criteria:\x20'+_0x1d44fb,'journeyId':_0x3d3a93,'rule':_0x2c62a5(_0x387e3d,!![]),'countPopulation':!![],'parentFolderId':_0x25e7bb[_0x4a824f(0x208)]||'','audienceId':_0x25e7bb['parentId']});_0x364245[_0x4a824f(0x172)](_0x1d44fb,_0x1ec15a),_0xa9e28f['segmentNameToId'][_0x4a824f(0x172)](_0x1d44fb,_0x1ec15a),_0x453856[_0x4a824f(0x1df)]?.({'type':_0x4a824f(0x203),'journeyName':_0x28e711['yamlConfig'][_0x4a824f(0x20d)],'segmentName':_0x1d44fb});}const _0x35f83e=new Map();for(const [_0x48b000,_0x3bc0fb]of _0x6c4488){_0x453856['onProgress']?.({'type':_0x4a824f(0x168),'journeyName':_0x28e711[_0x4a824f(0x199)][_0x4a824f(0x20d)],'activationName':_0x48b000});const _0x19495a=await _0x2fd272(_0x3bc0fb,_0xa9e28f['activationContext']),_0x4344df=await _0x260eb5[_0x4a824f(0x15f)][_0x4a824f(0x1f1)](_0x3d3a93,_0x19495a);_0x35f83e[_0x4a824f(0x172)](_0x48b000,_0x4344df['id']),_0x214d9f['journeyActivationNameToId'][_0x4a824f(0x172)](_0x48b000,_0x4344df['id']),_0x453856[_0x4a824f(0x1df)]?.({'type':'embedded_activation_created','journeyName':_0x28e711[_0x4a824f(0x199)][_0x4a824f(0x20d)],'activationName':_0x48b000});}const _0x36b505=JSON[_0x4a824f(0x20c)](JSON[_0x4a824f(0x136)](_0x29679d));return _0x36b505['id']=_0x3d3a93,ensureJourneyDefaults(_0x36b505[_0x4a824f(0x13d)]),resolvePendingIdsInRequest(_0x36b505,_0x29679d,_0xd76ecc,_0x364245,_0x35f83e,_0x453856),await _0x260eb5[_0x4a824f(0x15f)][_0x4a824f(0x16f)](_0x3d3a93,_0x36b505),{'action':'created','journeyId':_0x3d3a93,'embeddedSegmentNameToId':_0x364245};}function stripPendingIds(_0xd6064d){const _0x17f03f=a117_0x110a5;for(const _0x40066f of _0xd6064d['attributes'][_0x17f03f(0x195)]||[]){_0x40066f[_0x17f03f(0x1fb)]?.[_0x17f03f(0x162)]&&isPendingSegmentId(_0x40066f[_0x17f03f(0x1fb)]['segmentId'])&&delete _0x40066f[_0x17f03f(0x1fb)];if(_0x40066f['steps'])for(const _0x1279a0 of Object[_0x17f03f(0x178)](_0x40066f[_0x17f03f(0x1b6)])){const _0xe9bb3f=_0x40066f[_0x17f03f(0x1b6)][_0x1279a0];_0xe9bb3f[_0x17f03f(0x18b)]===_0x17f03f(0x1e6)&&_0xe9bb3f[_0x17f03f(0x1f6)]&&isPendingActivationId(_0xe9bb3f[_0x17f03f(0x1f6)])&&(_0xe9bb3f[_0x17f03f(0x1f6)]='');if(_0xe9bb3f[_0x17f03f(0x18b)]===_0x17f03f(0x163)&&_0xe9bb3f['branches'])for(const _0x4ff5af of _0xe9bb3f[_0x17f03f(0x143)]){_0x4ff5af[_0x17f03f(0x162)]&&isPendingSegmentId(_0x4ff5af['segmentId'])&&(_0x4ff5af['segmentId']='');}_0xe9bb3f[_0x17f03f(0x18b)]===_0x17f03f(0x141)&&_0xe9bb3f['waitCondition']?.[_0x17f03f(0x162)]&&isPendingSegmentId(_0xe9bb3f[_0x17f03f(0x1d9)]['segmentId'])&&(_0xe9bb3f[_0x17f03f(0x1d9)][_0x17f03f(0x162)]='');}}}function resolvePendingIdsInRequest(_0x266732,_0x705ceb,_0x9c532,_0x929c87,_0x10d506,_0x3846ed){const _0x181b28=a117_0x110a5,_0x169e69=(_0x2696cd,_0x4827fb)=>{const _0x372d48=a117_0x5c13;if(!isPendingSegmentId(_0x2696cd))return _0x2696cd;const _0x49dc45=extractPendingSegmentName(_0x2696cd),_0x77a96=_0x929c87['get'](_0x49dc45);return!_0x77a96&&_0x3846ed['logWarning']?.(_0x372d48(0x193)+_0x49dc45+_0x372d48(0x1bc)+_0x4827fb),_0x77a96;};if(_0x266732[_0x181b28(0x13d)]['goal']?.[_0x181b28(0x162)]&&isPendingSegmentId(_0x266732['attributes'][_0x181b28(0x200)][_0x181b28(0x162)])){const _0x16161a=_0x169e69(_0x266732[_0x181b28(0x13d)]['goal'][_0x181b28(0x162)],_0x181b28(0x176));_0x16161a&&(_0x266732[_0x181b28(0x13d)][_0x181b28(0x200)][_0x181b28(0x162)]=_0x16161a);}for(const _0xa3f437 of _0x266732[_0x181b28(0x13d)][_0x181b28(0x195)]||[]){const _0x1ee7a0=_0x9c532[_0x181b28(0x1ea)](_0xa3f437['name'][_0x181b28(0x139)]());_0x1ee7a0&&(_0xa3f437['id']=_0x1ee7a0);if(_0xa3f437[_0x181b28(0x1fb)]?.[_0x181b28(0x162)]&&isPendingSegmentId(_0xa3f437[_0x181b28(0x1fb)][_0x181b28(0x162)])){const _0x2002a3=_0x169e69(_0xa3f437[_0x181b28(0x1fb)][_0x181b28(0x162)],_0x181b28(0x15e)+_0xa3f437[_0x181b28(0x20d)]+_0x181b28(0x1cb));_0x2002a3&&(_0xa3f437['entryCriteria'][_0x181b28(0x162)]=_0x2002a3);}if(_0xa3f437[_0x181b28(0x16a)])for(const _0x1de4bf of _0xa3f437[_0x181b28(0x16a)]){if(_0x1de4bf[_0x181b28(0x162)]&&isPendingSegmentId(_0x1de4bf[_0x181b28(0x162)])){const _0x1748c7=_0x169e69(_0x1de4bf[_0x181b28(0x162)],_0x181b28(0x15e)+_0xa3f437['name']+_0x181b28(0x159));_0x1748c7&&(_0x1de4bf[_0x181b28(0x162)]=_0x1748c7);}}if(_0xa3f437['milestone']?.['segmentId']&&isPendingSegmentId(_0xa3f437['milestone'][_0x181b28(0x162)])){const _0x1f2601=_0x169e69(_0xa3f437[_0x181b28(0x19a)][_0x181b28(0x162)],'stage\x20\x27'+_0xa3f437[_0x181b28(0x20d)]+'\x27\x20milestone');_0x1f2601&&(_0xa3f437[_0x181b28(0x19a)][_0x181b28(0x162)]=_0x1f2601);}if(_0xa3f437[_0x181b28(0x1b6)]){const _0x4dd49a=_0x3e9b84=>_0x705ceb['attributes'][_0x181b28(0x195)][_0x181b28(0x21a)](_0x2d04af=>_0x2d04af[_0x181b28(0x20d)][_0x181b28(0x139)]()===_0xa3f437[_0x181b28(0x20d)][_0x181b28(0x139)]())?.['steps']?.[_0x3e9b84];for(const _0xbedbbe of Object['keys'](_0xa3f437[_0x181b28(0x1b6)])){const _0x17dc70=_0xa3f437[_0x181b28(0x1b6)][_0xbedbbe],_0x2e90e6=_0x4dd49a(_0xbedbbe);if(_0x17dc70[_0x181b28(0x18b)]===_0x181b28(0x1e6)&&_0x17dc70[_0x181b28(0x1f6)]&&(isPendingActivationId(_0x17dc70[_0x181b28(0x1f6)])||_0x17dc70[_0x181b28(0x1f6)]==='')){if(_0x2e90e6?.[_0x181b28(0x1f6)]&&isPendingActivationId(_0x2e90e6[_0x181b28(0x1f6)])){const _0x52ee94=extractPendingActivationName(_0x2e90e6[_0x181b28(0x1f6)]),_0x12284a=_0x10d506[_0x181b28(0x1ea)](_0x52ee94);_0x12284a&&(_0x17dc70['journeyActivationStepId']=_0x12284a);}}if(_0x17dc70[_0x181b28(0x18b)]===_0x181b28(0x163)&&_0x17dc70['branches']&&_0x2e90e6?.[_0x181b28(0x143)])for(let _0x4236c0=0x0;_0x4236c0<_0x17dc70[_0x181b28(0x143)]['length'];_0x4236c0++){const _0x456e4c=_0x17dc70[_0x181b28(0x143)][_0x4236c0],_0x347d21=_0x2e90e6['branches'][_0x4236c0];if(_0x347d21?.[_0x181b28(0x162)]&&isPendingSegmentId(_0x347d21[_0x181b28(0x162)])){const _0x12fee9=_0x169e69(_0x347d21['segmentId'],_0x181b28(0x15e)+_0xa3f437[_0x181b28(0x20d)]+'\x27\x20decision\x20point\x20branch\x20\x27'+(_0x456e4c[_0x181b28(0x20d)]||_0x4236c0)+'\x27');_0x12fee9&&(_0x456e4c[_0x181b28(0x162)]=_0x12fee9);}}if(_0x17dc70['type']===_0x181b28(0x141)&&_0x17dc70[_0x181b28(0x1d9)]?.[_0x181b28(0x162)]&&_0x2e90e6?.[_0x181b28(0x1d9)]?.[_0x181b28(0x162)]&&isPendingSegmentId(_0x2e90e6[_0x181b28(0x1d9)][_0x181b28(0x162)])){const _0x42061d=_0x169e69(_0x2e90e6['waitCondition']['segmentId'],_0x181b28(0x15e)+_0xa3f437[_0x181b28(0x20d)]+'\x27\x20wait\x20condition');_0x42061d&&(_0x17dc70[_0x181b28(0x1d9)][_0x181b28(0x162)]=_0x42061d);}}}}}
|
|
1
|
+
const a117_0x1e2c10=a117_0x3610;(function(_0x133eb7,_0x4f9f7a){const _0xc58f66=a117_0x3610,_0x3570c2=_0x133eb7();while(!![]){try{const _0x2e9a6b=-parseInt(_0xc58f66(0x28d))/0x1*(-parseInt(_0xc58f66(0x286))/0x2)+-parseInt(_0xc58f66(0x2b5))/0x3*(parseInt(_0xc58f66(0x282))/0x4)+-parseInt(_0xc58f66(0x2bb))/0x5+-parseInt(_0xc58f66(0x1f1))/0x6*(-parseInt(_0xc58f66(0x232))/0x7)+parseInt(_0xc58f66(0x271))/0x8*(parseInt(_0xc58f66(0x24b))/0x9)+parseInt(_0xc58f66(0x29e))/0xa*(parseInt(_0xc58f66(0x236))/0xb)+-parseInt(_0xc58f66(0x279))/0xc*(-parseInt(_0xc58f66(0x2c5))/0xd);if(_0x2e9a6b===_0x4f9f7a)break;else _0x3570c2['push'](_0x3570c2['shift']());}catch(_0x3c7e9c){_0x3570c2['push'](_0x3570c2['shift']());}}}(a117_0x1fc6,0xdd07c));import{createHash}from'crypto';function a117_0x1fc6(){const _0x5e17e5=['list','behavior','NOT_FOUND','entry_criteria','data','add','SEGMENT_SYNTAX_ERROR','DecisionPoint','\x20(referenced\x20in\x20journey\x20','existingSegment','./journey-yaml.js','Warning:\x20Could\x20not\x20resolve\x20embedded\x20segment\x20\x27','trim','milestone','updateSegmentById','deleted','\x20(referenced\x20in\x20embedded\x20segment\x20\x27','\x27...','stage\x20\x27','Failed\x20to\x20','unchanged','created','state','JOURNEY_UPDATE_ERROR','\x27\x20from\x20file:\x20','Created\x20folder\x20\x27','connectionIdToNameMap','journeyStages','activation_creating','connection','index','journeyActivationNameToId','Journey\x20\x27','journey_updating','677328cOfuqv','get','\x20journey\x20from\x20file:\x20','replace','results','activation_deleting','has','rootFolderId','48TubYkb','idToName','logSuccess','getJourney','getSegment','logDeleted','Name\x20has\x20already\x20been\x20taken','withProgress','stages','3454852qJgpHL','logInfo','onProgress','updated','1722BLWyOH','):\x20','flatMap','folder_created','activationContext','yamlConfig','deleteActivation','615FAlWrz','slice','diff','sort','segment_deleted','find','buildUserMaps','SEGMENT_UPDATE_ERROR','object','goal','embedded_activation_created','Activation\x20not\x20found:\x20','all_columns','folderPathToId','all','segment_deleting','segments','31850DgsrYn','schedule','activation_template_id','resolveJourneyId','Created\x20segment\x20\x27','createFolder','entry','filter','skipSegments','../../utils/async.js','\x27\x20milestone','./child-segment-yaml.js','kind','Deleting\x20activation\x20\x27','segmentId','idToEmailMap','createdSegmentId','\x27\x20not\x20found\x20in\x20parent\x20segment\x20(referenced\x20in\x20jump\x20step\x20of\x20\x27','segmentFolderId','entryCriteria','existingSegments','description','errors','6COawNA','journeys','localSegmentRules','create','Deleted\x20segment\x20\x27','segment_updated','8263460MiuEVy','activation_deleted','activation_created','Stage\x20\x27','activation_','SEGMENT_NOT_FOUND','getActivation','\x20error(s)','item',').\x20','3827486YqNPnz','hasChanges','startsWith','isNew','journeyActivationStepId','__pending_act_','dirname','folderPath','folder_creating','length','hex','createJourneySegment','update','validatedRequest','nameToId','size','activation_updating','resolveSegment','Entry\x20criteria:\x20','segment_creating','utf-8','attributes','18OhZJtH','parse','parentFolder','toLowerCase','journeyBundlesByFolderAndName','split','join','embeddedSegmentNameToId','ACTIVATION_SYNTAX_ERROR','null','rule','relationships','valid','reduce','listActivations','updateActivation','journeyBundleName','\x20segment\x20from\x20file:\x20','nameToType','delete','journey_entry_criteria_','Updated\x20segment\x20\x27','with','\x27\x20wait\x20condition','segmentNameToId','embedded_segment_created','stringify','Created\x20journey\x20\x27','absolutePath','push','\x27\x20entry\x20criteria','action','\x27\x20decision\x20point\x20branch\x20\x27','\x27\x20exit\x20criteria','keys','values','\x20activation\x20\x27','Failed\x20to\x20sync\x20activations\x20for\x20segment\x20\x27','Updating\x20activation\x20\x27','Deleted\x20activation\x20\x27','INTERNAL','fetchJourney','Cannot\x20create\x20embedded\x20activation\x20without\x20journey\x20context','name','segment_updating','steps','activationParams','connector_config','draft','createActivation','type','map','progress','Updating\x20segment\x20\x27','digest','branches','parentSegmentFolder','notification','exitCriterias','Created\x20activation\x20\x27','segment','user','from','relative','activations','1175454GbOBWm','\x0a\x20\x20','activationActions','embedded_segment_creating','5995BmrUzk','JOURNEY_SYNTAX_ERROR','activation_updated','Fetching\x20','yamlActivation','parseDocument','activationsBySegmentId','parentId','Activation','decision_point','set','journey','columns','Creating\x20segment\x20\x27','existingActivation','folderId','waitCondition','existingJourney','versionNumber','ACTIVATION_UPDATE_ERROR','journeyId','36dOUhml','segment_created','activationStepsById','\x27\x20for\x20'];a117_0x1fc6=function(){return _0x5e17e5;};return a117_0x1fc6();}export const PENDING_SEGMENT_PREFIX='__pending_';export const PENDING_ACTIVATION_PREFIX=a117_0x1e2c10(0x2ca);export function createPendingSegmentId(_0x27c8cb){return''+PENDING_SEGMENT_PREFIX+_0x27c8cb+'__';}export function isPendingSegmentId(_0x53ddce){const _0x392fba=a117_0x1e2c10;return _0x53ddce[_0x392fba(0x2c7)](PENDING_SEGMENT_PREFIX);}export function extractPendingSegmentName(_0x2ed92a){const _0x1418b=a117_0x1e2c10;return _0x2ed92a[_0x1418b(0x274)](/^__pending_(.+)__$/,'$1');}export function createPendingActivationId(_0x3156a2){return''+PENDING_ACTIVATION_PREFIX+_0x3156a2+'__';}export function isPendingActivationId(_0x1360db){const _0x237779=a117_0x1e2c10;return _0x1360db[_0x237779(0x2c7)](PENDING_ACTIVATION_PREFIX);}export function extractPendingActivationName(_0x4e452d){const _0x4527e6=a117_0x1e2c10;return _0x4e452d[_0x4527e6(0x274)](/^__pending_act_(.+)__$/,'$1');}function generateDeterministicJourneySegmentName(_0x4c0fca,_0x5e1360){const _0x2e888b=a117_0x1e2c10,_0x3d50c2=_0x4c0fca+'::'+(_0x5e1360[_0x2e888b(0x25b)]()||_0x2e888b(0x22d)),_0x5204d3=createHash('sha1')[_0x2e888b(0x1e7)](_0x3d50c2)[_0x2e888b(0x227)](_0x2e888b(0x2cf))['slice'](0x0,0xc);return _0x2e888b(0x205)+_0x5204d3;}export function ensureJourneyDefaults(_0x2245a8){const _0x1f2bc6=a117_0x1e2c10;!_0x2245a8[_0x1f2bc6(0x2b3)]&&(_0x2245a8[_0x1f2bc6(0x2b3)]=''),!_0x2245a8['state']&&(_0x2245a8[_0x1f2bc6(0x265)]=_0x1f2bc6(0x221));}export function resolveTDFolderPath(_0x1ed525,_0x3c512c,_0x400e7d){const _0x3e3a53=a117_0x1e2c10;if(!_0x3c512c)return _0x1ed525;if(_0x1ed525===_0x400e7d||_0x1ed525[_0x3e3a53(0x2c7)](_0x400e7d+'/'))return _0x1ed525;return _0x1ed525?_0x400e7d+'/'+_0x1ed525:_0x400e7d;}export function addFoldersToCreate(_0xac03fe,_0x4c7249,_0x4173cb){const _0x45be6f=a117_0x1e2c10;if(!_0xac03fe)return;if(_0x4c7249['has'](_0xac03fe))return;const _0x5d433e=_0xac03fe[_0x45be6f(0x1f6)]('/');let _0x154c50='';for(const _0x430bd6 of _0x5d433e){_0x154c50=_0x154c50?_0x154c50+'/'+_0x430bd6:_0x430bd6,!_0x4c7249[_0x45be6f(0x277)](_0x154c50)&&_0x4173cb['add'](_0x154c50);}}import*as a117_0x25b9f1 from'yaml';import{readFileSync}from'fs';import a117_0x29758c from'path';import{isJourneyDef,parseYamlString as a117_0xe8fb12,toYamlString as a117_0x3d48b8,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{validateSegmentDef,validateJourneyDef,formatValidationResult}from'./yaml-validator.js';function stableStringify(_0xcd256){const _0x3daf20=a117_0x1e2c10;if(Array['isArray'](_0xcd256))return'['+_0xcd256[_0x3daf20(0x224)](_0x4d3aaa=>stableStringify(_0x4d3aaa))['join'](',')+']';if(_0xcd256&&typeof _0xcd256===_0x3daf20(0x295)){const _0x538796=_0xcd256,_0x1eb616=Object[_0x3daf20(0x213)](_0x538796)[_0x3daf20(0x290)](),_0x30599e=_0x1eb616[_0x3daf20(0x224)](_0x5e271c=>'\x22'+_0x5e271c+'\x22:'+stableStringify(_0x538796[_0x5e271c]));return'{'+_0x30599e[_0x3daf20(0x1f7)](',')+'}';}const _0x14d546=JSON['stringify'](_0xcd256);return _0x14d546===undefined?_0x3daf20(0x1fa):_0x14d546;}function activationSignature(_0x1f46e9){const _0x30b7c4=a117_0x1e2c10,_0x1edd20={'connection':_0x1f46e9[_0x30b7c4(0x26c)],..._0x1f46e9['all_columns']!==undefined&&{'all_columns':_0x1f46e9[_0x30b7c4(0x299)]},..._0x1f46e9['columns']!==undefined&&{'columns':_0x1f46e9[_0x30b7c4(0x242)]},..._0x1f46e9[_0x30b7c4(0x250)]!==undefined&&{'behavior':_0x1f46e9[_0x30b7c4(0x250)]},..._0x1f46e9[_0x30b7c4(0x29f)]!==undefined&&{'schedule':_0x1f46e9[_0x30b7c4(0x29f)]},..._0x1f46e9[_0x30b7c4(0x22a)]!==undefined&&{'notification':_0x1f46e9[_0x30b7c4(0x22a)]},..._0x1f46e9[_0x30b7c4(0x220)]!==undefined&&{'connector_config':_0x1f46e9[_0x30b7c4(0x220)]},..._0x1f46e9[_0x30b7c4(0x2a0)]!==undefined&&{'activation_template_id':_0x1f46e9[_0x30b7c4(0x2a0)]}};return stableStringify(_0x1edd20);}export async function prepareSegmentFiles(_0x5b773f,_0x531ab3,_0x1d2ccf,_0x159eb9,_0x59a733){const _0x1b2133=a117_0x1e2c10,{activationDefToCreateRequest:_0x2bb4ef}=await import(_0x1b2133(0x2a9)),_0x339e3a=[],_0x41976b=new Set();for(const {yamlConfig:_0x58c4d5,folderPath:_0x39250e,sourcePath:_0x2af16e}of _0x5b773f){const _0x80c13d=resolveTDFolderPath(_0x39250e,_0x159eb9,_0x59a733),_0x3e59a5=_0x80c13d+':'+_0x58c4d5['name'],_0x4d6e39=_0x531ab3['segmentByFolderAndName'][_0x1b2133(0x272)](_0x3e59a5),_0x4aaf69=_0x4d6e39?_0x531ab3[_0x1b2133(0x23c)][_0x1b2133(0x272)](_0x4d6e39['id'])||[]:[];addFoldersToCreate(_0x80c13d,_0x531ab3[_0x1b2133(0x29a)],_0x41976b);const _0x16b7b5=calculateActivationActions(_0x58c4d5['activations']||[],_0x4aaf69,_0x531ab3[_0x1b2133(0x2ad)],_0x531ab3['connectionIdToNameMap']);for(const _0x1e530a of _0x16b7b5){(_0x1e530a[_0x1b2133(0x223)]===_0x1b2133(0x2b8)||_0x1e530a[_0x1b2133(0x223)]===_0x1b2133(0x1e7))&&_0x1e530a[_0x1b2133(0x23a)]&&(_0x1e530a[_0x1b2133(0x1e8)]=await _0x2bb4ef(_0x1e530a[_0x1b2133(0x23a)],_0x1d2ccf));}const _0x142a53=calculateSegmentDiff(_0x58c4d5,_0x4d6e39,_0x4aaf69,_0x531ab3[_0x1b2133(0x2ad)],_0x531ab3[_0x1b2133(0x269)]);_0x339e3a[_0x1b2133(0x20e)]({'relativePath':_0x58c4d5[_0x1b2133(0x21c)],'absolutePath':_0x2af16e,'yamlConfig':_0x58c4d5,'folderPath':_0x80c13d,'existingSegment':_0x4d6e39,'existingActivations':_0x4aaf69,'isNew':_0x142a53[_0x1b2133(0x2c8)],'hasChanges':_0x142a53[_0x1b2133(0x2c6)],'diff':_0x142a53[_0x1b2133(0x28f)],'activationActions':_0x16b7b5});}return{'segmentFiles':_0x339e3a,'foldersToCreate':_0x41976b};}export async function prepareJourneyFiles(_0x46e21b,_0x16e64d,_0x2ad697,_0x3631d7){const _0x5b7aa4=a117_0x1e2c10,_0x7992de=[],_0x503a9d=new Set();for(const {yamlConfig:_0x48c19c,folderPath:_0x34e9f7,sourcePath:_0x2acf09}of _0x46e21b){const _0x1d7482=resolveTDFolderPath(_0x34e9f7,_0x2ad697,_0x3631d7),_0x4c7974=_0x1d7482+':'+_0x48c19c[_0x5b7aa4(0x21c)],_0x5e8b73=_0x16e64d[_0x5b7aa4(0x1f5)][_0x5b7aa4(0x272)](_0x4c7974);let _0x104ce8,_0x162ca2;if(_0x5e8b73&&_0x5e8b73[_0x5b7aa4(0x2ce)]>0x0){const _0x40ef44=buildLocalExpandedRuleMappings(_0x48c19c),{createYamlContext:_0x3654f1,prefetchJourneySegments:_0x4da424}=createPushYamlContextForBundle(_0x16e64d['deps'],_0x16e64d[_0x5b7aa4(0x23d)],_0x16e64d['existingSegments'],_0x40ef44,_0x16e64d[_0x5b7aa4(0x2ad)],_0x16e64d['connectionIdToNameMap'],_0x16e64d[_0x5b7aa4(0x24d)],_0x16e64d['journeyById']);await _0x4da424(_0x5e8b73[_0x5b7aa4(0x224)](_0x244bb5=>_0x244bb5['id']));const _0x2a9d2c=hasMultipleVersions(_0x48c19c),_0x97f5f1=async _0x27fd4c=>{const _0x3f4dcc=_0x5b7aa4,_0x46ebb7=_0x16e64d['journeyById']?.[_0x3f4dcc(0x272)](_0x27fd4c);if(_0x46ebb7)return _0x46ebb7;return _0x16e64d[_0x3f4dcc(0x21a)]({'journeyId':_0x27fd4c,'journeyName':_0x48c19c[_0x3f4dcc(0x21c)],'isMultiVersion':_0x5e8b73['length']>0x1});};if(_0x2a9d2c&&_0x5e8b73['length']>0x1){const _0x407f5b=[];for(const _0x2e87bb of _0x5e8b73){const _0x23cdd0=_0x2e87bb['versionNumber']||0x1;_0x16e64d['progress']?.[_0x5b7aa4(0x1e7)](_0x5b7aa4(0x239)+_0x48c19c['name']+'\x20v'+_0x23cdd0);const _0x3fb48b=await _0x97f5f1(_0x2e87bb['id']),_0x1c275a=_0x3654f1(_0x2e87bb['id']),_0x409395=await journeyResponseToDef(_0x3fb48b,_0x1c275a);_0x407f5b[_0x5b7aa4(0x20e)]({'item':_0x2e87bb,'yaml':_0x409395});}const _0x2c02fe=buildLocalRuleToNameMappingFromJourney(_0x48c19c);_0x162ca2=buildMergedJourneyDef(_0x407f5b,_0x2c02fe);const _0x1fb0fd=Math['max'](..._0x407f5b['map'](_0x5e5abe=>_0x5e5abe[_0x5b7aa4(0x2c3)]['versionNumber']||0x0)),_0x37c477=_0x5e8b73[_0x5b7aa4(0x292)](_0x29d495=>(_0x29d495['versionNumber']||0x0)===_0x1fb0fd);_0x37c477&&(_0x16e64d[_0x5b7aa4(0x225)]?.[_0x5b7aa4(0x1e7)]('Fetching\x20'+_0x48c19c[_0x5b7aa4(0x21c)]+'\x20v'+_0x1fb0fd),_0x104ce8=await _0x97f5f1(_0x37c477['id']));}else{const _0x328dfb=_0x5e8b73[_0x5e8b73['length']-0x1];_0x16e64d[_0x5b7aa4(0x225)]?.[_0x5b7aa4(0x1e7)]('Fetching\x20'+_0x48c19c['name']),_0x104ce8=await _0x97f5f1(_0x328dfb['id']);const _0x3a544b=_0x3654f1(_0x328dfb['id']),_0x52a965=await journeyResponseToDef(_0x104ce8,_0x3a544b),_0xa5e46c=buildLocalRuleToNameMappingFromJourney(_0x48c19c);_0x162ca2=buildMergedJourneyDef([{'item':_0x328dfb,'yaml':_0x52a965}],_0xa5e46c);}}addFoldersToCreate(_0x1d7482,_0x16e64d[_0x5b7aa4(0x29a)],_0x503a9d);const _0x58f708=calculateJourneyDiff(_0x48c19c,_0x162ca2);_0x7992de[_0x5b7aa4(0x20e)]({'relativePath':_0x48c19c[_0x5b7aa4(0x21c)],'absolutePath':_0x2acf09,'yamlConfig':_0x48c19c,'folderPath':_0x1d7482,'existingJourney':_0x104ce8,'isNew':_0x58f708[_0x5b7aa4(0x2c8)],'hasChanges':_0x58f708[_0x5b7aa4(0x2c6)],'diff':_0x58f708[_0x5b7aa4(0x28f)]});}return{'journeyFiles':_0x7992de,'foldersToCreate':_0x503a9d};}export function calculateActivationActions(_0x4fd56e,_0x29cd2f,_0x44b82c,_0x24428f){const _0x28024f=a117_0x1e2c10,_0x2ae1b2=[],_0x33b768=new Map();for(const _0x472bd0 of _0x29cd2f){_0x33b768[_0x28024f(0x240)](_0x472bd0[_0x28024f(0x21c)],_0x472bd0);}const _0x3f315a=new Map();for(const _0x537c88 of _0x4fd56e){_0x3f315a[_0x28024f(0x240)](_0x537c88[_0x28024f(0x21c)],_0x537c88);}for(const _0x37fdf7 of _0x4fd56e){const _0x940142=_0x33b768[_0x28024f(0x272)](_0x37fdf7[_0x28024f(0x21c)]);if(!_0x940142)_0x2ae1b2[_0x28024f(0x20e)]({'type':_0x28024f(0x2b8),'name':_0x37fdf7[_0x28024f(0x21c)],'yamlActivation':_0x37fdf7});else{const _0x3a8dcc=activationResponseToDef(_0x940142,_0x44b82c,_0x24428f),_0x2cce7f=a117_0x25b9f1[_0x28024f(0x20b)](_0x3a8dcc),_0x880312=a117_0x25b9f1[_0x28024f(0x20b)](_0x37fdf7);_0x2cce7f!==_0x880312&&_0x2ae1b2['push']({'type':_0x28024f(0x1e7),'name':_0x37fdf7['name'],'yamlActivation':_0x37fdf7,'existingActivation':_0x940142});}}for(const _0x34ff8e of _0x29cd2f){!_0x3f315a[_0x28024f(0x277)](_0x34ff8e[_0x28024f(0x21c)])&&_0x2ae1b2['push']({'type':'delete','name':_0x34ff8e[_0x28024f(0x21c)],'existingActivation':_0x34ff8e});}return _0x2ae1b2;}export function calculateSegmentDiff(_0x4b053b,_0x18b7a4,_0x3c3bd5,_0x550946,_0x6c9b7f){const _0x87fa8b=segmentToYamlString(_0x4b053b);if(_0x18b7a4){const _0x175b8a=segmentWithActivationsToYaml(_0x18b7a4,_0x3c3bd5,undefined,_0x550946,_0x6c9b7f),_0x273945=segmentToYamlString(_0x175b8a),_0x56dbc9=generateDiff(_0x273945,_0x87fa8b),_0x2ac487=hasChanges(_0x56dbc9);return{'isNew':![],'hasChanges':_0x2ac487,'diff':_0x2ac487?formatDiffWithColors(_0x56dbc9):undefined};}const _0xb9153c=generateDiff('',_0x87fa8b);return{'isNew':!![],'hasChanges':![],'diff':formatDiffWithColors(_0xb9153c)};}export function calculateJourneyDiff(_0x2b35f5,_0x16de78){const _0xdae278=normalizeJourneyDef(_0x2b35f5,_0x2b35f5),_0x259619=a117_0x3d48b8(_0xdae278);if(_0x16de78){const _0x46a59a=normalizeJourneyDef(_0x16de78,_0x2b35f5),_0x45dcac=a117_0x3d48b8(_0x46a59a),_0x31c5dc=generateDiff(_0x45dcac,_0x259619),_0x126a30=hasChanges(_0x31c5dc);return{'isNew':![],'hasChanges':_0x126a30,'diff':_0x126a30?formatDiffWithColors(_0x31c5dc):undefined};}const _0x231574=generateDiff('',_0x259619);return{'isNew':!![],'hasChanges':![],'diff':formatDiffWithColors(_0x231574)};}export function findSegmentsToDelete(_0x93def5,_0x42055a,_0x2e9312,_0x163563,_0x5af94f){const _0x13ec91=a117_0x1e2c10,_0x15d663=new Set();for(const {yamlConfig:_0x4eda8c,folderPath:_0xb1bde}of _0x42055a){_0x15d663[_0x13ec91(0x254)](_0xb1bde+':'+_0x4eda8c[_0x13ec91(0x21c)]);}return _0x93def5[_0x13ec91(0x2a5)](_0x52da8a=>{const _0x2e1a99=_0x13ec91,_0x42bc48=_0x52da8a[_0x2e1a99(0x2b0)]?_0x2e9312[_0x2e1a99(0x272)](_0x52da8a['segmentFolderId']['toString']())||'':'',_0x28d9e2=_0x42bc48+':'+_0x52da8a[_0x2e1a99(0x21c)];if(_0x15d663[_0x2e1a99(0x277)](_0x28d9e2))return![];if(_0x5af94f)return _0x42bc48===_0x163563||_0x42bc48[_0x2e1a99(0x2c7)](_0x163563+'/');return!![];});}export function findJourneysToDelete(_0x2f1829,_0x52c242,_0x5cbb69,_0x50257a,_0x5dd930){const _0x263fed=a117_0x1e2c10,_0x3250c8=new Set();for(const {yamlConfig:_0x368966,folderPath:_0x5572de}of _0x52c242){_0x3250c8['add'](_0x5572de+':'+_0x368966[_0x263fed(0x21c)]);}return _0x2f1829['filter'](_0x2a4ef7=>{const _0x475112=_0x263fed,_0x19bb59=_0x2a4ef7[_0x475112(0x245)]?_0x5cbb69[_0x475112(0x272)](_0x2a4ef7[_0x475112(0x245)])||'':'',_0x541363=_0x19bb59+':'+_0x2a4ef7[_0x475112(0x201)];if(_0x3250c8[_0x475112(0x277)](_0x541363))return![];if(_0x5dd930)return _0x19bb59===_0x50257a||_0x19bb59['startsWith'](_0x50257a+'/');return!![];});}export function buildSegmentLookupMap(_0x475969,_0x5b818a){const _0x24a10d=a117_0x1e2c10,_0xdb4b09=new Map();for(const _0x272577 of _0x475969){const _0x3424af=_0x272577[_0x24a10d(0x2b0)]?_0x5b818a[_0x24a10d(0x272)](_0x272577['segmentFolderId']['toString']())||'':'',_0x2f0b79=_0x3424af+':'+_0x272577[_0x24a10d(0x21c)];_0xdb4b09[_0x24a10d(0x240)](_0x2f0b79,_0x272577);}return _0xdb4b09;}export function buildSegmentNameToIdMap(_0x1f7ca5){const _0x2fd9ad=a117_0x1e2c10,_0x296777=new Map();for(const _0x3ce794 of _0x1f7ca5){_0x296777['set'](_0x3ce794[_0x2fd9ad(0x21c)],_0x3ce794['id']);}return _0x296777;}export function buildJourneyBundleLookupMap(_0x59974b,_0x3209c1){const _0x5ad838=a117_0x1e2c10,_0x995543=new Map();for(const _0x2bf8e9 of _0x59974b){const _0x24beea=_0x2bf8e9[_0x5ad838(0x245)]?_0x3209c1[_0x5ad838(0x272)](_0x2bf8e9[_0x5ad838(0x245)])||'':'',_0x524fd8=_0x24beea+':'+_0x2bf8e9[_0x5ad838(0x201)];!_0x995543[_0x5ad838(0x277)](_0x524fd8)&&_0x995543[_0x5ad838(0x240)](_0x524fd8,[]),_0x995543[_0x5ad838(0x272)](_0x524fd8)['push'](_0x2bf8e9);}for(const _0xc17523 of _0x995543[_0x5ad838(0x214)]()){_0xc17523[_0x5ad838(0x290)]((_0x4995ce,_0x1785df)=>(_0x4995ce[_0x5ad838(0x248)]||0x0)-(_0x1785df[_0x5ad838(0x248)]||0x0));}return _0x995543;}export function collectFoldersToCreate(_0xe9e91c,_0x33864e){const _0x2784f7=a117_0x1e2c10,_0x24847c=new Set();for(const _0x12a332 of _0xe9e91c){if(!_0x12a332)continue;if(_0x33864e[_0x2784f7(0x277)](_0x12a332))continue;const _0x5e3611=_0x12a332[_0x2784f7(0x1f6)]('/');let _0x26f95f='';for(const _0xe5d628 of _0x5e3611){_0x26f95f=_0x26f95f?_0x26f95f+'/'+_0xe5d628:_0xe5d628,!_0x33864e['has'](_0x26f95f)&&_0x24847c['add'](_0x26f95f);}}return _0x24847c;}export function parseAndClassifyYamlFiles(_0xf62cec,_0x3ec016,_0x1fe396){const _0x137954=a117_0x1e2c10,_0x2979c6=[],_0x61406f=[];for(const _0x2326dd of _0xf62cec){const _0x53c6f9=a117_0x29758c[_0x137954(0x230)](_0x3ec016,a117_0x29758c[_0x137954(0x2cb)](_0x2326dd)),_0x3b88de=_0x53c6f9==='.'?'':_0x53c6f9,_0x42bea4=readFileSync(_0x2326dd,_0x137954(0x1ef)),_0xecb388=a117_0x25b9f1[_0x137954(0x1f2)](_0x42bea4);if(isJourneyDef(_0xecb388)){const _0x30085d=a117_0xe8fb12(_0x42bea4);_0x61406f[_0x137954(0x20e)]({'yamlConfig':_0x30085d,'folderPath':_0x3b88de,'sourcePath':_0x2326dd});}else{if(!_0x1fe396?.[_0x137954(0x2a6)]){const _0x422a29=parseSegmentYamlFile(_0x42bea4),_0x548186=normalizeChildSegmentYaml(_0x422a29);_0x2979c6[_0x137954(0x20e)]({'yamlConfig':_0x548186,'folderPath':_0x3b88de,'sourcePath':_0x2326dd});}}}return{'segments':_0x2979c6,'journeys':_0x61406f};}export function validateParsedFiles(_0x4ef729,_0x5323dc){const _0x6ef7e6=a117_0x1e2c10,_0x77ad2e=[];for(const {yamlConfig:_0x1f78d3,sourcePath:_0x5d35fa}of _0x4ef729['segments']){const _0x4c4d91=readFileSync(_0x5d35fa,'utf-8'),_0x1cfb47=a117_0x25b9f1[_0x6ef7e6(0x23b)](_0x4c4d91),_0x59a3ce=validateSegmentDef(_0x1f78d3,{'source':_0x4c4d91,'document':_0x1cfb47});if(!_0x59a3ce[_0x6ef7e6(0x1fd)]){const _0x593c7b=a117_0x29758c[_0x6ef7e6(0x230)](_0x5323dc,_0x5d35fa);_0x77ad2e[_0x6ef7e6(0x20e)]({'filePath':_0x593c7b,'source':_0x4c4d91,'result':_0x59a3ce,'isJourney':![]});}}for(const {yamlConfig:_0x52facf,sourcePath:_0xb4d7d2}of _0x4ef729[_0x6ef7e6(0x2b6)]){const _0x42bbaf=readFileSync(_0xb4d7d2,_0x6ef7e6(0x1ef)),_0x995e4d=a117_0x25b9f1[_0x6ef7e6(0x23b)](_0x42bbaf),_0x3355e9=validateJourneyDef(_0x52facf,{'source':_0x42bbaf,'document':_0x995e4d});if(!_0x3355e9['valid']){const _0x10ad9e=a117_0x29758c['relative'](_0x5323dc,_0xb4d7d2);_0x77ad2e[_0x6ef7e6(0x20e)]({'filePath':_0x10ad9e,'source':_0x42bbaf,'result':_0x3355e9,'isJourney':!![]});}}return _0x77ad2e;}export function formatValidationErrors(_0xfde20c){const _0x2c23f3=a117_0x1e2c10,_0x21567d=[];for(const {filePath:_0x5d8e42,source:_0x3e7ed9,result:_0x587b05,isJourney:_0x16c326}of _0xfde20c){const _0x1e85c7=_0x16c326?_0x2c23f3(0x241):_0x2c23f3(0x22d);_0x21567d['push']('\x0a'+_0x5d8e42+'\x20('+_0x1e85c7+_0x2c23f3(0x287)+_0x587b05[_0x2c23f3(0x2b4)][_0x2c23f3(0x2ce)]+_0x2c23f3(0x2c2)),_0x21567d[_0x2c23f3(0x20e)](formatValidationResult(_0x587b05,_0x3e7ed9,_0x5d8e42));}return _0x21567d['join']('\x0a');}export function buildLocalExpandedRuleMappings(_0x5916b9){const _0xf8f4c4=a117_0x1e2c10,_0x6b742c=new Set(),_0x28ed60=new Map(),_0x23fad6=collectSegmentUsageCounts(_0x5916b9);if(_0x5916b9['segments'])for(const [_0x93e431,_0x54b466]of Object['entries'](_0x5916b9['segments'])){_0x6b742c[_0xf8f4c4(0x254)](_0x93e431);if(_0x54b466[_0xf8f4c4(0x1fb)]){const _0x34c653=yamlRuleToApi(_0x54b466[_0xf8f4c4(0x1fb)]),_0x5788cb=apiRuleToYaml(_0x34c653);_0x28ed60['set'](_0x93e431,_0x5788cb);}}const _0x1b3022=new Map();let _0x4c7525=0x0;for(const [_0x146088,_0x5b0a2c]of _0x28ed60){const _0x3b2c83=serializeExpandedRule(_0x5b0a2c,_0x28ed60),_0x2cede2=_0x1b3022['get'](_0x3b2c83)||[];_0x2cede2['push']({'name':_0x146088,'index':_0x4c7525}),_0x1b3022[_0xf8f4c4(0x240)](_0x3b2c83,_0x2cede2),_0x4c7525++;}const _0x4229aa=new Map();for(const [_0xaf64da,_0x39c734]of _0x1b3022){const _0xbfafc1=_0x39c734[_0xf8f4c4(0x28e)]()['sort']((_0x52b079,_0x11b23e)=>{const _0x56643f=_0xf8f4c4,_0x2d7a21=_0x23fad6[_0x56643f(0x272)](_0x52b079[_0x56643f(0x21c)])||0x0,_0x97139f=_0x23fad6[_0x56643f(0x272)](_0x11b23e['name'])||0x0;if(_0x2d7a21!==_0x97139f)return _0x97139f-_0x2d7a21;return _0x52b079['index']-_0x11b23e[_0x56643f(0x26d)];})[_0xf8f4c4(0x224)](_0x3a6305=>_0x3a6305['name']),_0x582352=[];for(const _0x3463c6 of _0xbfafc1){const _0x363c32=_0x23fad6[_0xf8f4c4(0x272)](_0x3463c6)||0x0,_0x1aad88=Math['max'](_0x363c32,0x1);for(let _0x3c80db=0x0;_0x3c80db<_0x1aad88;_0x3c80db++){_0x582352[_0xf8f4c4(0x20e)](_0x3463c6);}}_0x4229aa[_0xf8f4c4(0x240)](_0xaf64da,_0x582352);}return{'existingLocalSegmentNames':_0x6b742c,'localSegmentRules':_0x28ed60,'localExpandedRuleToNames':_0x4229aa};}async function buildServerSegmentRuleMap(_0x32a216,_0x4c782f,_0x300b5e,_0x4f6089){const _0x58dcfe=new Map(),_0x50558e=new Set(),_0x1689ca=async _0x2726e1=>{const _0x18e2d6=a117_0x3610;if(_0x50558e[_0x18e2d6(0x277)](_0x2726e1))return;_0x50558e[_0x18e2d6(0x254)](_0x2726e1);let _0x24385b=_0x300b5e['find'](_0x5f6f5d=>_0x5f6f5d['id']===_0x2726e1);if(!_0x24385b)try{_0x24385b=await _0x32a216['segment'][_0x18e2d6(0x27d)](_0x4c782f,_0x2726e1);}catch{return;}if(!_0x24385b?.['rule'])return;const _0x44e62d=apiRuleToYaml(_0x24385b[_0x18e2d6(0x1fb)]);_0x58dcfe[_0x18e2d6(0x240)](_0x2726e1,_0x44e62d);const _0x26e72e=collectSegmentRefsFromRule(_0x44e62d);for(const _0x9709db of _0x26e72e){await _0x1689ca(_0x9709db);}};for(const _0x52d8ab of _0x4f6089){await _0x1689ca(_0x52d8ab);}return _0x58dcfe;}export function createSegmentIdResolver(_0x59764c,_0x406e27){return async _0x5a8c35=>{const _0x169ae7=a117_0x3610,_0x49bb52=_0x59764c[_0x169ae7(0x272)](_0x5a8c35);if(!_0x49bb52)throw new SDKError(ErrorCode[_0x169ae7(0x2c0)],'Segment\x20not\x20found:\x20'+_0x5a8c35+_0x169ae7(0x25f)+_0x406e27+'\x27)');return _0x49bb52;};}export function extractRootFolderId(_0x3d1d51){const _0x1bcd50=a117_0x1e2c10;return _0x3d1d51[_0x1bcd50(0x1fc)]?.[_0x1bcd50(0x229)]?.[_0x1bcd50(0x253)]?.['id']||_0x3d1d51['relationships']?.[_0x1bcd50(0x1f3)]?.[_0x1bcd50(0x253)]?.['id'];}export function buildConnectionMaps(_0x54e508){const _0xd1317a=a117_0x1e2c10,_0x5d0f38=new Map(),_0x4e67c2=new Map(),_0x316a0d=new Map();for(const _0x5178ba of _0x54e508){_0x5d0f38[_0xd1317a(0x240)](_0x5178ba[_0xd1317a(0x21c)],parseInt(_0x5178ba['id'],0xa)),_0x4e67c2[_0xd1317a(0x240)](_0x5178ba['id'],_0x5178ba['name']),_0x316a0d['set'](_0x5178ba[_0xd1317a(0x21c)],_0x5178ba['type']);}return{'nameToId':_0x5d0f38,'idToName':_0x4e67c2,'nameToType':_0x316a0d};}export function calculatePushStats(_0x21ba71,_0xfc4b50,_0x41d5e8,_0x5eec65,_0x5a1f26,_0x579cdc,_0x48bfcb){const _0x34e824=a117_0x1e2c10,_0x4d4798=_0x21ba71[_0x34e824(0x2a5)](_0x2aaaf6=>_0x2aaaf6[_0x34e824(0x2c8)]),_0x2b36c8=_0x21ba71['filter'](_0xde0e6f=>!_0xde0e6f[_0x34e824(0x2c8)]&&_0xde0e6f[_0x34e824(0x2c6)]),_0xe67f3d=_0x21ba71[_0x34e824(0x2a5)](_0x32bdef=>!_0x32bdef['isNew']&&!_0x32bdef[_0x34e824(0x2c6)]),_0x48f058=_0x579cdc?_0x5eec65:[],_0x17c4ae=_0xfc4b50['filter'](_0x25761d=>_0x25761d[_0x34e824(0x2c8)]),_0x219475=_0xfc4b50[_0x34e824(0x2a5)](_0x873983=>!_0x873983[_0x34e824(0x2c8)]&&_0x873983[_0x34e824(0x2c6)]),_0x13e03d=_0xfc4b50[_0x34e824(0x2a5)](_0x50e9f5=>!_0x50e9f5['isNew']&&!_0x50e9f5[_0x34e824(0x2c6)]),_0x555efb=_0x579cdc?_0x5a1f26:[],_0x5cc673=_0x21ba71[_0x34e824(0x288)](_0x50a29e=>_0x50a29e[_0x34e824(0x234)]),_0x7aa56c=_0x5cc673[_0x34e824(0x2a5)](_0x5c8c25=>_0x5c8c25[_0x34e824(0x223)]==='create'),_0x58fcf6=_0x5cc673[_0x34e824(0x2a5)](_0x56ddf5=>_0x56ddf5[_0x34e824(0x223)]==='update'),_0x231791=_0x5cc673['filter'](_0x51b80e=>_0x51b80e['type']==='delete'),_0x3d487e=Array[_0x34e824(0x22f)](_0x41d5e8)['sort'](),_0xed5b17=_0x48bfcb?![]:_0x4d4798[_0x34e824(0x2ce)]>0x0||_0x2b36c8[_0x34e824(0x2ce)]>0x0||_0x48f058[_0x34e824(0x2ce)]>0x0,_0x2ae8a6=_0x17c4ae['length']>0x0||_0x219475[_0x34e824(0x2ce)]>0x0||_0x555efb[_0x34e824(0x2ce)]>0x0,_0x55ad1e=_0x48bfcb?![]:_0x5cc673[_0x34e824(0x2ce)]>0x0,_0x545cf3=_0x3d487e[_0x34e824(0x2ce)]>0x0;return{'segments':{'new':_0x4d4798,'changed':_0x2b36c8,'unchanged':_0xe67f3d,'toDelete':_0x48f058},'journeys':{'new':_0x17c4ae,'changed':_0x219475,'unchanged':_0x13e03d,'toDelete':_0x555efb},'activations':{'all':_0x5cc673,'toCreate':_0x7aa56c,'toUpdate':_0x58fcf6,'toDelete':_0x231791},'folders':{'toCreate':_0x3d487e},'counts':{'segments':{'new':_0x4d4798['length'],'changed':_0x2b36c8[_0x34e824(0x2ce)],'unchanged':_0xe67f3d[_0x34e824(0x2ce)],'toDelete':_0x48f058[_0x34e824(0x2ce)]},'journeys':{'new':_0x17c4ae[_0x34e824(0x2ce)],'changed':_0x219475[_0x34e824(0x2ce)],'unchanged':_0x13e03d['length'],'toDelete':_0x555efb[_0x34e824(0x2ce)]},'activations':{'create':_0x7aa56c[_0x34e824(0x2ce)],'update':_0x58fcf6[_0x34e824(0x2ce)],'delete':_0x231791['length']},'folders':_0x3d487e[_0x34e824(0x2ce)]},'hasChanges':_0xed5b17||_0x2ae8a6||_0x55ad1e||_0x545cf3};}export async function buildPushExecutionContext(_0x43917c,_0x57ab28,_0x13ad88,_0x313eba,_0x1d19ef,_0x503aa7){const _0x159b46=a117_0x1e2c10,_0x3d499a=extractRootFolderId(_0x13ad88),{pathToId:_0x39235c,idToPath:_0x4b8393}=buildFolderMaps(_0x1d19ef),_0x2a8a02=buildSegmentNameToIdMap(_0x313eba),_0x5270fe=new Map(),{batchAsync:_0x46e696}=await import(_0x159b46(0x2a7)),[_0x2296b1,_0x25041d]=await Promise['all']([_0x43917c[_0x159b46(0x22e)][_0x159b46(0x293)](),_0x43917c[_0x159b46(0x26c)][_0x159b46(0x24f)](),((async()=>{const _0x502a6f=_0x159b46;!_0x503aa7&&_0x313eba[_0x502a6f(0x2ce)]>0x0&&await _0x46e696(_0x313eba,async _0x27c816=>{const _0x5f20a5=_0x502a6f,_0x5ea9f0=await _0x43917c[_0x5f20a5(0x22d)][_0x5f20a5(0x1ff)](_0x57ab28,_0x27c816['id']);_0x5270fe[_0x5f20a5(0x240)](_0x27c816['id'],_0x5ea9f0);});})())]),{emailToId:_0x33b5c2,idToEmail:_0x3be25c}=_0x2296b1,_0x4218c=buildConnectionMaps(_0x25041d);return{'rootFolderId':_0x3d499a,'folderPathToId':_0x39235c,'folderIdToPath':_0x4b8393,'segmentNameToId':_0x2a8a02,'activationsBySegmentId':_0x5270fe,'emailToIdMap':_0x33b5c2,'idToEmailMap':_0x3be25c,'connectionNameToIdMap':_0x4218c[_0x159b46(0x1e9)],'connectionIdToNameMap':_0x4218c[_0x159b46(0x27a)],'connectionNameToTypeMap':_0x4218c[_0x159b46(0x203)]};}export function createPushYamlContextForBundle(_0x4be6c9,_0x4ec264,_0x3999a4,_0x52d24c,_0x59f2ca,_0x3996b3,_0x3f4354,_0x186a7c){const {existingLocalSegmentNames:_0x2908bb,localExpandedRuleToNames:_0x4c8a15}=_0x52d24c,_0x35a28b=new Set(),_0x170f8d=new Map(),_0x42b4e0=new Map(),_0x322ffe=new Map(),_0x547d0a=createJumpTargetCache(),_0x9aab30=new Map(),_0x27577e=new Map(),_0x17c746=new Set();let _0x4a613b;const _0x1a8eaf=_0x12a55b=>{const _0x454107={'resolveSegment':async _0x21476c=>{const _0x5bb49d=a117_0x3610,_0x528d84=_0x322ffe[_0x5bb49d(0x272)](_0x21476c);if(_0x528d84!==undefined)return{'name':_0x528d84,'isJourneyLocal':!![]};try{let _0x5f2e02=_0x3999a4['find'](_0x48da0b=>_0x48da0b['id']===_0x21476c);!_0x5f2e02&&(_0x5f2e02=await _0x4be6c9[_0x5bb49d(0x22d)]['getSegment'](_0x4ec264,_0x21476c));const _0x33934b=generateJourneyLocalName(_0x5f2e02[_0x5bb49d(0x21c)]),_0x3322a1=_0x5f2e02[_0x5bb49d(0x2aa)]===SEGMENT_KIND_JOURNEY&&_0x33934b!==undefined;let _0x104f61=_0x5f2e02[_0x5bb49d(0x21c)],_0x759713;if(_0x3322a1&&_0x5f2e02[_0x5bb49d(0x1fb)]){const _0x58d213=apiRuleToYaml(_0x5f2e02[_0x5bb49d(0x1fb)]);_0x27577e[_0x5bb49d(0x240)](_0x21476c,_0x58d213);const _0x268fcc=async _0x4d955a=>{const _0x3c0d36=_0x5bb49d,_0x47bdf9=collectSegmentRefsFromRule(_0x4d955a);for(const _0x1e2027 of _0x47bdf9){if(!_0x27577e[_0x3c0d36(0x277)](_0x1e2027))try{const _0x4b3df7=await _0x4be6c9[_0x3c0d36(0x22d)]['getSegment'](_0x4ec264,_0x1e2027);if(_0x4b3df7?.[_0x3c0d36(0x1fb)]){const _0xad990b=apiRuleToYaml(_0x4b3df7[_0x3c0d36(0x1fb)]);_0x27577e[_0x3c0d36(0x240)](_0x1e2027,_0xad990b),await _0x268fcc(_0xad990b);}}catch{}}};await _0x268fcc(_0x58d213);const _0x421b53=serializeExpandedRule(_0x58d213,_0x27577e),_0x580821=_0x4c8a15['get'](_0x421b53);if(_0x580821&&_0x580821[_0x5bb49d(0x2ce)]>0x0){const _0x1b6f6f=_0x170f8d[_0x5bb49d(0x272)](_0x421b53)||0x0,_0x5ead05=_0x580821[_0x1b6f6f]||_0x580821[_0x580821[_0x5bb49d(0x2ce)]-0x1];_0x170f8d[_0x5bb49d(0x240)](_0x421b53,_0x1b6f6f+0x1),_0x104f61=_0x5ead05,_0x35a28b[_0x5bb49d(0x254)](_0x104f61),_0x322ffe[_0x5bb49d(0x240)](_0x21476c,_0x104f61);const _0x5eb6ea=await resolveRuleSegmentRefs(_0x58d213,async _0x34a02d=>{const _0x12fe90=_0x5bb49d,_0x2ec97b=_0x322ffe[_0x12fe90(0x272)](_0x34a02d);if(_0x2ec97b)return _0x2ec97b;const _0x2c7cb4=await _0x4a613b[_0x12fe90(0x1ec)](_0x34a02d);return _0x2c7cb4[_0x12fe90(0x21c)];});_0x759713={'description':_0x5f2e02[_0x5bb49d(0x2b3)],'rule':_0x5eb6ea};}else{const _0x1e071f=_0x9aab30[_0x5bb49d(0x272)](_0x421b53);if(_0x1e071f)_0x104f61=_0x1e071f,_0x322ffe[_0x5bb49d(0x240)](_0x21476c,_0x104f61);else{if(_0x33934b){let _0xcd7976=_0x33934b,_0x3c0353=0x2;while(_0x35a28b[_0x5bb49d(0x277)](_0xcd7976)||_0x2908bb['has'](_0xcd7976)){_0xcd7976=_0x33934b+'_'+_0x3c0353,_0x3c0353++;}_0x35a28b[_0x5bb49d(0x254)](_0xcd7976),_0x104f61=_0xcd7976;}_0x322ffe[_0x5bb49d(0x240)](_0x21476c,_0x104f61),_0x9aab30[_0x5bb49d(0x240)](_0x421b53,_0x104f61);const _0x16ec4b=await resolveRuleSegmentRefs(_0x58d213,async _0x1c6a0e=>{const _0x587fa3=_0x5bb49d,_0x36b9c0=_0x322ffe[_0x587fa3(0x272)](_0x1c6a0e);if(_0x36b9c0)return _0x36b9c0;const _0x1e6d0e=await _0x4a613b[_0x587fa3(0x1ec)](_0x1c6a0e);return _0x1e6d0e['name'];});_0x759713={'description':_0x5f2e02[_0x5bb49d(0x2b3)],'rule':_0x16ec4b};}}}return{'name':_0x104f61,'isJourneyLocal':_0x3322a1,'definition':_0x759713};}catch{return{'name':_0x21476c,'isJourneyLocal':![]};}},'resolveActivation':async _0x10dd8d=>{const _0x541322=a117_0x3610,_0x37b5ad=_0x42b4e0[_0x541322(0x272)](_0x10dd8d);if(_0x37b5ad!==undefined)return{'name':_0x37b5ad,'isJourneyLocal':!![]};try{let _0x53b7e2=_0x3f4354?.[_0x541322(0x272)](_0x10dd8d);!_0x53b7e2&&(_0x53b7e2=await _0x4be6c9['journey'][_0x541322(0x2c1)](_0x12a55b,_0x10dd8d));const _0x19bcd6=_0x53b7e2[_0x541322(0x1f0)][_0x541322(0x21f)][_0x541322(0x21c)]||_0x10dd8d,_0x3bd21c=sanitizeYamlKey(_0x19bcd6)||_0x541322(0x2bf)+_0x10dd8d,_0x1fc5f6=_0x3bd21c;_0x42b4e0['set'](_0x10dd8d,_0x1fc5f6);const _0x3f0c79=journeyActivationStepToYaml(_0x53b7e2,_0x59f2ca,_0x3996b3);return{'name':_0x1fc5f6,'isJourneyLocal':!![],'definition':_0x3f0c79};}catch{return{'name':_0x10dd8d,'isJourneyLocal':![]};}},'resolveJumpTarget':(_0xc5b66b,_0x2b8e8c)=>resolveJumpTarget(_0xc5b66b,_0x2b8e8c,_0x547d0a,async _0x7c41f6=>{const _0x1db7aa=a117_0x3610,_0x2b3a06=_0x186a7c?.[_0x1db7aa(0x272)](_0x7c41f6);if(_0x2b3a06)return _0x2b3a06;return _0x4be6c9[_0x1db7aa(0x241)][_0x1db7aa(0x27c)](_0x7c41f6);})};return _0x4a613b=_0x454107,_0x454107;},_0x52a6fa=async _0x58d521=>{const _0x3ef3f4=a117_0x3610,{collectSegmentIdsFromJourneyApi:_0x8f8e0c}=await import(_0x3ef3f4(0x259)),{batchAsync:_0x51696c}=await import(_0x3ef3f4(0x2a7)),_0x35c0fe=new Set();for(const _0x25f2aa of _0x58d521){let _0x255efe=_0x186a7c?.['get'](_0x25f2aa);!_0x255efe&&(_0x255efe=await _0x4be6c9[_0x3ef3f4(0x241)][_0x3ef3f4(0x27c)](_0x25f2aa));const _0x80575b=_0x8f8e0c(_0x255efe);for(const _0x273295 of _0x80575b){_0x35c0fe['add'](_0x273295);}}let _0x120ccb=Array[_0x3ef3f4(0x22f)](_0x35c0fe);while(_0x120ccb[_0x3ef3f4(0x2ce)]>0x0){const _0xb33b0a=_0x120ccb[_0x3ef3f4(0x2a5)](_0x48de4a=>!_0x17c746[_0x3ef3f4(0x277)](_0x48de4a));if(_0xb33b0a['length']===0x0)break;const _0x5efb53=await _0x51696c(_0xb33b0a,async _0x2b42b8=>{const _0x16e3f0=_0x3ef3f4;_0x17c746[_0x16e3f0(0x254)](_0x2b42b8);let _0x23741c=_0x3999a4['find'](_0x375719=>_0x375719['id']===_0x2b42b8);if(!_0x23741c)try{_0x23741c=await _0x4be6c9['segment'][_0x16e3f0(0x27d)](_0x4ec264,_0x2b42b8);}catch{return null;}return{'segmentId':_0x2b42b8,'segment':_0x23741c};},0xa),_0x713f04=new Set();for(const _0x30689f of _0x5efb53){if(!_0x30689f?.[_0x3ef3f4(0x22d)]?.[_0x3ef3f4(0x1fb)])continue;const _0x556cd0=apiRuleToYaml(_0x30689f[_0x3ef3f4(0x22d)][_0x3ef3f4(0x1fb)]);_0x27577e['set'](_0x30689f[_0x3ef3f4(0x2ac)],_0x556cd0);const _0x34afb5=collectSegmentRefsFromRule(_0x556cd0);for(const _0xab270e of _0x34afb5){!_0x17c746[_0x3ef3f4(0x277)](_0xab270e)&&_0x713f04[_0x3ef3f4(0x254)](_0xab270e);}}_0x120ccb=Array[_0x3ef3f4(0x22f)](_0x713f04);}};return{'createYamlContext':_0x1a8eaf,'prefetchJourneySegments':_0x52a6fa};}export async function executePushSegments(_0x4a5e76,_0x20f96e,_0x1b54a3,_0xd54ba9,_0x470998){const _0x155bcd=a117_0x1e2c10,{segmentDefToCreateRequest:_0x2923d3,segmentDefToUpdateRequest:_0xd92c97}=await import('./child-segment-yaml.js'),_0x588aed=_0x1b54a3[_0x155bcd(0x29a)],_0x475fea=0x5,_0x98b92e=async _0x2f6f82=>{const _0x4f6a3e=_0x155bcd,_0x361c94=_0x2f6f82[_0x4f6a3e(0x2cc)]?_0x588aed[_0x4f6a3e(0x272)](_0x2f6f82[_0x4f6a3e(0x2cc)]):undefined;let _0x4ca716;const _0x34ea40={'created':0x0,'updated':0x0,'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};try{if(_0x2f6f82['isNew']){_0x470998['onProgress']?.({'type':_0x4f6a3e(0x1ee),'name':_0x2f6f82['yamlConfig'][_0x4f6a3e(0x21c)]});const _0x50c997=_0x2923d3(_0x2f6f82[_0x4f6a3e(0x28b)],_0x361c94),_0x2fd80d=await _0x470998[_0x4f6a3e(0x280)](_0x4f6a3e(0x243)+_0x2f6f82[_0x4f6a3e(0x28b)][_0x4f6a3e(0x21c)]+_0x4f6a3e(0x260),()=>_0x4a5e76[_0x4f6a3e(0x22d)]['createSegment'](_0xd54ba9[_0x4f6a3e(0x23d)],_0x50c997));_0x4ca716=_0x2fd80d[_0x4f6a3e(0x253)]['id'],_0x34ea40[_0x4f6a3e(0x2ae)]={'name':_0x2f6f82[_0x4f6a3e(0x28b)][_0x4f6a3e(0x21c)],'id':_0x4ca716},_0x470998[_0x4f6a3e(0x284)]?.({'type':_0x4f6a3e(0x24c),'name':_0x2f6f82[_0x4f6a3e(0x28b)][_0x4f6a3e(0x21c)],'segmentId':_0x4ca716}),_0x470998[_0x4f6a3e(0x27b)]?.(_0x4f6a3e(0x2a2)+_0x2f6f82[_0x4f6a3e(0x28b)][_0x4f6a3e(0x21c)]+'\x27'),_0x34ea40[_0x4f6a3e(0x264)]=0x1;}else{if(_0x2f6f82[_0x4f6a3e(0x2c6)]){_0x470998[_0x4f6a3e(0x284)]?.({'type':_0x4f6a3e(0x21d),'name':_0x2f6f82['yamlConfig'][_0x4f6a3e(0x21c)]});const _0x2b99f4=_0xd92c97(_0x2f6f82['yamlConfig']);_0x361c94!==_0x2f6f82[_0x4f6a3e(0x258)]?.[_0x4f6a3e(0x2b0)]&&(_0x2b99f4['segmentFolderId']=_0x361c94?parseInt(_0x361c94,0xa):undefined),await _0x470998[_0x4f6a3e(0x280)](_0x4f6a3e(0x226)+_0x2f6f82[_0x4f6a3e(0x28b)][_0x4f6a3e(0x21c)]+_0x4f6a3e(0x260),()=>_0x4a5e76['segment']['updateSegmentById'](_0xd54ba9[_0x4f6a3e(0x23d)],_0x2f6f82[_0x4f6a3e(0x258)]['id'],_0x2b99f4)),_0x4ca716=_0x2f6f82['existingSegment']['id'],_0x470998[_0x4f6a3e(0x284)]?.({'type':_0x4f6a3e(0x2ba),'name':_0x2f6f82[_0x4f6a3e(0x28b)][_0x4f6a3e(0x21c)]}),_0x470998[_0x4f6a3e(0x27b)]?.(_0x4f6a3e(0x206)+_0x2f6f82[_0x4f6a3e(0x28b)][_0x4f6a3e(0x21c)]+'\x27'),_0x34ea40[_0x4f6a3e(0x285)]=0x1;}else _0x4ca716=_0x2f6f82['existingSegment']['id'];}}catch(_0x1504b2){const _0x2e4f33=isHttp400Error(_0x1504b2),_0xd31054=_0x2e4f33?ErrorCode[_0x4f6a3e(0x255)]:ErrorCode[_0x4f6a3e(0x294)],_0x2058da=getErrorMessage(_0x1504b2);throw new SDKError(_0xd31054,_0x4f6a3e(0x262)+(_0x2f6f82[_0x4f6a3e(0x2c8)]?_0x4f6a3e(0x2b8):_0x4f6a3e(0x1e7))+_0x4f6a3e(0x202)+_0x2f6f82['absolutePath']+_0x4f6a3e(0x233)+_0x2058da,_0x1504b2);}try{const _0x265599=await syncActivationsForSegment(_0x4a5e76,_0xd54ba9[_0x4f6a3e(0x23d)],_0x4ca716,_0x2f6f82[_0x4f6a3e(0x28b)][_0x4f6a3e(0x21c)],_0x2f6f82[_0x4f6a3e(0x234)],_0x470998,_0x2f6f82[_0x4f6a3e(0x20d)]);_0x34ea40[_0x4f6a3e(0x231)]=_0x265599;}catch(_0xfd20e0){if(_0xfd20e0 instanceof SDKError)throw _0xfd20e0;throw new SDKError(ErrorCode[_0x4f6a3e(0x249)],_0x4f6a3e(0x216)+_0x2f6f82[_0x4f6a3e(0x28b)]['name']+_0x4f6a3e(0x267)+_0x2f6f82['absolutePath']+_0x4f6a3e(0x233)+getErrorMessage(_0xfd20e0),_0xfd20e0);}return _0x34ea40;},_0x52f18b=await batchAsync(_0x20f96e,_0x98b92e,_0x475fea),_0x102bce={'created':0x0,'updated':0x0,'deleted':0x0,'createdSegmentIds':new Map(),'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};for(const _0x15733c of _0x52f18b){_0x102bce[_0x155bcd(0x264)]+=_0x15733c[_0x155bcd(0x264)],_0x102bce[_0x155bcd(0x285)]+=_0x15733c[_0x155bcd(0x285)],_0x15733c[_0x155bcd(0x2ae)]&&_0x102bce['createdSegmentIds'][_0x155bcd(0x240)](_0x15733c[_0x155bcd(0x2ae)][_0x155bcd(0x21c)],_0x15733c[_0x155bcd(0x2ae)]['id']),_0x102bce[_0x155bcd(0x231)][_0x155bcd(0x264)]+=_0x15733c['activations'][_0x155bcd(0x264)],_0x102bce[_0x155bcd(0x231)][_0x155bcd(0x285)]+=_0x15733c['activations'][_0x155bcd(0x285)],_0x102bce[_0x155bcd(0x231)][_0x155bcd(0x25e)]+=_0x15733c[_0x155bcd(0x231)]['deleted'];}return _0x102bce;}async function syncActivationsForSegment(_0xe7b5c8,_0x1b3d71,_0x2ee07f,_0x4198a2,_0x15e737,_0x3beae7,_0x559041){const _0x28158d=a117_0x1e2c10,_0x17d949={'created':0x0,'updated':0x0,'deleted':0x0};for(const _0x17d1e7 of _0x15e737){try{if(_0x17d1e7[_0x28158d(0x223)]===_0x28158d(0x2b8)&&_0x17d1e7[_0x28158d(0x1e8)])_0x3beae7['onProgress']?.({'type':_0x28158d(0x26b),'segmentName':_0x4198a2,'activationName':_0x17d1e7['name']}),await _0x3beae7['withProgress']('Creating\x20activation\x20\x27'+_0x17d1e7[_0x28158d(0x21c)]+_0x28158d(0x260),()=>_0xe7b5c8[_0x28158d(0x22d)]['createActivation'](_0x1b3d71,_0x2ee07f,_0x17d1e7[_0x28158d(0x1e8)])),_0x3beae7[_0x28158d(0x284)]?.({'type':_0x28158d(0x2bd),'segmentName':_0x4198a2,'activationName':_0x17d1e7[_0x28158d(0x21c)]}),_0x3beae7[_0x28158d(0x27b)]?.(_0x28158d(0x22c)+_0x17d1e7['name']+'\x27'),_0x17d949['created']++;else{if(_0x17d1e7[_0x28158d(0x223)]===_0x28158d(0x1e7)&&_0x17d1e7[_0x28158d(0x1e8)]&&_0x17d1e7['existingActivation'])_0x3beae7[_0x28158d(0x284)]?.({'type':_0x28158d(0x1eb),'segmentName':_0x4198a2,'activationName':_0x17d1e7['name']}),await _0x3beae7[_0x28158d(0x280)](_0x28158d(0x217)+_0x17d1e7[_0x28158d(0x21c)]+'\x27...',()=>_0xe7b5c8[_0x28158d(0x22d)][_0x28158d(0x200)](_0x1b3d71,_0x2ee07f,_0x17d1e7[_0x28158d(0x244)]['id'],_0x17d1e7[_0x28158d(0x1e8)])),_0x3beae7[_0x28158d(0x284)]?.({'type':_0x28158d(0x238),'segmentName':_0x4198a2,'activationName':_0x17d1e7[_0x28158d(0x21c)]}),_0x3beae7[_0x28158d(0x27b)]?.('Updated\x20activation\x20\x27'+_0x17d1e7['name']+'\x27'),_0x17d949[_0x28158d(0x285)]++;else _0x17d1e7['type']===_0x28158d(0x204)&&_0x17d1e7[_0x28158d(0x244)]&&(_0x3beae7[_0x28158d(0x284)]?.({'type':_0x28158d(0x276),'segmentName':_0x4198a2,'activationName':_0x17d1e7['name']}),await _0x3beae7['withProgress'](_0x28158d(0x2ab)+_0x17d1e7[_0x28158d(0x21c)]+_0x28158d(0x260),()=>_0xe7b5c8[_0x28158d(0x22d)][_0x28158d(0x28c)](_0x1b3d71,_0x2ee07f,_0x17d1e7[_0x28158d(0x244)]['id'])),_0x3beae7[_0x28158d(0x284)]?.({'type':_0x28158d(0x2bc),'segmentName':_0x4198a2,'activationName':_0x17d1e7[_0x28158d(0x21c)]}),_0x3beae7['logDeleted']?.(_0x28158d(0x218)+_0x17d1e7[_0x28158d(0x21c)]+'\x27'),_0x17d949[_0x28158d(0x25e)]++);}}catch(_0x3f973d){const _0x3d09a0=isHttp400Error(_0x3f973d),_0x3924ec=_0x3d09a0?ErrorCode[_0x28158d(0x1f9)]:ErrorCode[_0x28158d(0x249)],_0x2bffb8=getErrorMessage(_0x3f973d);throw new SDKError(_0x3924ec,'Failed\x20to\x20'+_0x17d1e7['type']+_0x28158d(0x215)+_0x17d1e7[_0x28158d(0x21c)]+_0x28158d(0x267)+_0x559041+_0x28158d(0x233)+_0x2bffb8,_0x3f973d);}}return _0x17d949;}function a117_0x3610(_0x1a344a,_0x1fcbb2){_0x1a344a=_0x1a344a-0x1e7;const _0x1fc6a6=a117_0x1fc6();let _0x36109e=_0x1fc6a6[_0x1a344a];return _0x36109e;}export async function executePushFolders(_0x156ee4,_0x21b223,_0x57aa62,_0x37ca90,_0x4d8eea){const _0x2e6024=a117_0x1e2c10,_0x2e1015=new Map(_0x57aa62);for(const _0x39ca30 of _0x21b223){const _0x3a36d9=_0x39ca30[_0x2e6024(0x1f6)]('/'),_0x5ca144=_0x3a36d9[_0x3a36d9[_0x2e6024(0x2ce)]-0x1],_0x56d14c=_0x3a36d9['slice'](0x0,-0x1)[_0x2e6024(0x1f7)]('/'),_0xbebe8e=_0x2e1015['get'](_0x56d14c);_0x4d8eea['onProgress']?.({'type':_0x2e6024(0x2cd),'folder':_0x39ca30});const _0x4a423f={'name':_0x5ca144,'parentFolderId':_0xbebe8e},_0x52436d=await _0x4d8eea['withProgress']('Creating\x20folder\x20\x27'+_0x39ca30+'\x27...',()=>_0x156ee4['segment'][_0x2e6024(0x2a3)](_0x37ca90['parentId'],_0x4a423f));_0x2e1015[_0x2e6024(0x240)](_0x39ca30,_0x52436d[_0x2e6024(0x253)]['id']),_0x4d8eea['onProgress']?.({'type':_0x2e6024(0x289),'folder':_0x39ca30,'folderId':_0x52436d[_0x2e6024(0x253)]['id']}),_0x4d8eea[_0x2e6024(0x283)]?.(_0x2e6024(0x268)+_0x39ca30+'\x27');}return _0x2e1015;}export async function executePushSegmentDeletions(_0x29f1d9,_0x2d2e2c,_0x1f286e){const _0x2edeaa=a117_0x1e2c10;if(_0x2d2e2c[_0x2edeaa(0x2ce)]===0x0)return 0x0;const {batchAsync:_0xad27b7}=await import(_0x2edeaa(0x2a7)),_0x5dfc22=0x5,_0x901f7a=await _0xad27b7(_0x2d2e2c,async _0x374a89=>{const _0x5aa909=_0x2edeaa;return _0x1f286e[_0x5aa909(0x284)]?.({'type':_0x5aa909(0x29c),'name':_0x374a89[_0x5aa909(0x21c)]}),await _0x29f1d9[_0x5aa909(0x22d)]['deleteSegment'](_0x374a89['id']),_0x1f286e[_0x5aa909(0x284)]?.({'type':_0x5aa909(0x291),'name':_0x374a89[_0x5aa909(0x21c)]}),_0x1f286e[_0x5aa909(0x27e)]?.(_0x5aa909(0x2b9)+_0x374a89[_0x5aa909(0x21c)]+'\x27'),0x1;},_0x5dfc22);return _0x901f7a[_0x2edeaa(0x1fe)]((_0x265573,_0x13e9c8)=>_0x265573+_0x13e9c8,0x0);}export async function executePushJourneys(_0x33a684,_0x4320c2,_0x1830a7,_0x450862,_0x205a38){const _0x1ad6c7=a117_0x1e2c10,{journeyDefToRequest:_0x3b98ca}=await import(_0x1ad6c7(0x259)),{activationDefToCreateRequest:_0x5e2e85,yamlRuleToApi:_0x3317f4,validateSegmentRule:_0x3ca986}=await import('./child-segment-yaml.js'),_0x17b2b0={'results':[],'created':0x0,'updated':0x0,'embeddedSegmentNameToId':new Map()},_0x26a1e7=new Map(_0x1830a7[_0x1ad6c7(0x209)]),_0x51aee1=0x5;for(let _0x1ff7c0=0x0;_0x1ff7c0<_0x4320c2[_0x1ad6c7(0x2ce)];_0x1ff7c0+=_0x51aee1){const _0xddd0b1=_0x4320c2[_0x1ad6c7(0x28e)](_0x1ff7c0,_0x1ff7c0+_0x51aee1),_0x15d0a8=await Promise[_0x1ad6c7(0x29b)](_0xddd0b1[_0x1ad6c7(0x224)](async _0x59baae=>{const _0x1a3c92=_0x1ad6c7;if(!_0x59baae[_0x1a3c92(0x2c8)]&&!_0x59baae[_0x1a3c92(0x2c6)])return{'action':_0x1a3c92(0x263),'name':_0x59baae[_0x1a3c92(0x28b)][_0x1a3c92(0x21c)],'journeyId':_0x59baae[_0x1a3c92(0x247)]?.['id']};const _0x35c4ee=_0x59baae[_0x1a3c92(0x2cc)]?_0x1830a7[_0x1a3c92(0x29a)][_0x1a3c92(0x272)](_0x59baae[_0x1a3c92(0x2cc)]):undefined;_0x205a38['onProgress']?.({'type':_0x59baae[_0x1a3c92(0x2c8)]?'journey_creating':_0x1a3c92(0x270),'name':_0x59baae['yamlConfig'][_0x1a3c92(0x21c)]});try{const _0x18fd15=await executeSingleJourneyPush(_0x33a684,_0x59baae,{..._0x1830a7,'segmentNameToId':_0x26a1e7},{'parentId':_0x450862[_0x1a3c92(0x23d)],'rootFolderId':_0x450862[_0x1a3c92(0x278)],'folderId':_0x35c4ee,'verbose':_0x450862['verbose']},_0x205a38,{'journeyDefToRequest':_0x3b98ca,'activationDefToCreateRequest':_0x5e2e85,'yamlRuleToApi':_0x3317f4,'validateSegmentRule':_0x3ca986});for(const [_0x174cdd,_0x5d73c6]of _0x18fd15[_0x1a3c92(0x1f8)]){_0x26a1e7[_0x1a3c92(0x240)](_0x174cdd,_0x5d73c6),_0x17b2b0[_0x1a3c92(0x1f8)][_0x1a3c92(0x240)](_0x174cdd,_0x5d73c6);}if(_0x18fd15[_0x1a3c92(0x210)]==='created')_0x205a38['onProgress']?.({'type':'journey_created','name':_0x59baae[_0x1a3c92(0x28b)][_0x1a3c92(0x21c)],'journeyId':_0x18fd15['journeyId']}),_0x205a38[_0x1a3c92(0x27b)]?.(_0x1a3c92(0x20c)+_0x59baae[_0x1a3c92(0x28b)][_0x1a3c92(0x21c)]+'\x27'),_0x17b2b0['created']++;else _0x18fd15[_0x1a3c92(0x210)]==='updated'&&(_0x205a38[_0x1a3c92(0x284)]?.({'type':'journey_updated','name':_0x59baae['yamlConfig'][_0x1a3c92(0x21c)]}),_0x205a38[_0x1a3c92(0x27b)]?.('Updated\x20journey\x20\x27'+_0x59baae[_0x1a3c92(0x28b)]['name']+'\x27'),_0x17b2b0['updated']++);return{'action':_0x18fd15[_0x1a3c92(0x210)],'name':_0x59baae[_0x1a3c92(0x28b)]['name'],'journeyId':_0x18fd15[_0x1a3c92(0x24a)]};}catch(_0x137294){const _0x351857=isHttp400Error(_0x137294),_0x151045=_0x351857?ErrorCode[_0x1a3c92(0x237)]:ErrorCode[_0x1a3c92(0x266)],_0x3ace5f=getErrorMessage(_0x137294);throw new SDKError(_0x151045,_0x1a3c92(0x262)+(_0x59baae[_0x1a3c92(0x2c8)]?_0x1a3c92(0x2b8):_0x1a3c92(0x1e7))+_0x1a3c92(0x273)+_0x59baae[_0x1a3c92(0x20d)]+_0x1a3c92(0x233)+_0x3ace5f,_0x137294);}}));_0x17b2b0[_0x1ad6c7(0x275)]['push'](..._0x15d0a8);}return _0x17b2b0;}async function executeSingleJourneyPush(_0x41a84b,_0x193d6a,_0x41de18,_0x419102,_0x47afc7,_0x4d4dfa){const _0x36a5e4=a117_0x1e2c10,{journeyDefToRequest:_0xc4f6f0,activationDefToCreateRequest:_0x283f84,yamlRuleToApi:_0x4ee9bb,validateSegmentRule:_0x319fa4}=_0x4d4dfa,_0x9712b6=new Map(),_0x3ad5f1=new Map(),_0x25f778=new Map(),_0x5c1263=new Map(),_0x491601=new Map();let _0x3eca98;const _0x1c0c3e=async()=>{const _0x4243a5=a117_0x3610;if(_0x3eca98)return;_0x3eca98=new Map();if(!_0x193d6a[_0x4243a5(0x247)])return;const _0x2ce5e4=await _0x41a84b[_0x4243a5(0x241)][_0x4243a5(0x1ff)](_0x193d6a['existingJourney']['id']);for(const _0x4642b4 of _0x2ce5e4){const _0x21fda3=journeyActivationStepToYaml(_0x4642b4,_0x41de18['idToEmailMap'],_0x41de18[_0x4243a5(0x269)]),_0x11fe2f=activationSignature(_0x21fda3);!_0x3eca98[_0x4243a5(0x277)](_0x11fe2f)&&_0x3eca98[_0x4243a5(0x240)](_0x11fe2f,_0x4642b4['id']),_0x21fda3['name']&&_0x3ad5f1[_0x4243a5(0x240)](_0x21fda3[_0x4243a5(0x21c)],_0x4642b4['id']);}};if(_0x193d6a[_0x36a5e4(0x247)]&&_0x193d6a['yamlConfig'][_0x36a5e4(0x29d)]){const _0x3294fa=buildLocalExpandedRuleMappings(_0x193d6a[_0x36a5e4(0x28b)]),_0x22a191=_0x3294fa[_0x36a5e4(0x2b7)];if(_0x22a191[_0x36a5e4(0x1ea)]>0x0){const _0x3d5ab9=new Map();for(const [_0x362772,_0x134fb8]of _0x22a191){const _0x1cc1f5=serializeExpandedRule(_0x134fb8,_0x22a191);_0x3d5ab9[_0x36a5e4(0x240)](_0x362772,_0x1cc1f5);}const _0x1c15df=collectSegmentIdsFromJourneyApi(_0x193d6a[_0x36a5e4(0x247)]);if(_0x1c15df[_0x36a5e4(0x1ea)]>0x0){const _0x2dcdcd=await buildServerSegmentRuleMap(_0x41a84b,_0x419102['parentId'],_0x41de18[_0x36a5e4(0x2b2)],_0x1c15df);if(_0x2dcdcd[_0x36a5e4(0x1ea)]>0x0){const _0xb8d7f=new Map();for(const [_0x99a39c,_0xff9e1c]of _0x2dcdcd){const _0x225010=serializeExpandedRule(_0xff9e1c,_0x2dcdcd);!_0xb8d7f[_0x36a5e4(0x277)](_0x225010)&&_0xb8d7f[_0x36a5e4(0x240)](_0x225010,_0x99a39c);}for(const [_0x26a1ef,_0x360ff0]of _0x3d5ab9){const _0x9f7ce=_0xb8d7f[_0x36a5e4(0x272)](_0x360ff0);_0x9f7ce&&(_0x491601[_0x36a5e4(0x240)](_0x26a1ef,_0x9f7ce),_0x41de18[_0x36a5e4(0x209)][_0x36a5e4(0x240)](_0x26a1ef,_0x9f7ce));}}}}}const _0x34cb4a={'resolveSegmentId':async _0x46b23b=>{const _0x48a8f8=_0x36a5e4,_0x6f4abe=_0x41de18['segmentNameToId'][_0x48a8f8(0x272)](_0x46b23b);if(!_0x6f4abe)throw new SDKError(ErrorCode[_0x48a8f8(0x2c0)],'Segment\x20not\x20found:\x20'+_0x46b23b+_0x48a8f8(0x257)+_0x193d6a['yamlConfig']['name']+')');return _0x6f4abe;},'resolveEmbeddedSegmentId':async(_0x4df317,_0x5589af)=>{const _0x2b5c02=_0x36a5e4,_0xc731c1=_0x41de18[_0x2b5c02(0x209)][_0x2b5c02(0x272)](_0x4df317);if(_0xc731c1)return _0xc731c1;const _0x373d62=_0x491601['get'](_0x4df317);if(_0x373d62)return _0x41de18[_0x2b5c02(0x209)][_0x2b5c02(0x240)](_0x4df317,_0x373d62),_0x373d62;const _0x353fba=_0x41de18[_0x2b5c02(0x2b2)][_0x2b5c02(0x292)](_0x402891=>_0x402891[_0x2b5c02(0x21c)]===_0x4df317);if(_0x353fba)return _0x41de18[_0x2b5c02(0x209)]['set'](_0x4df317,_0x353fba['id']),_0x353fba['id'];if(_0x193d6a[_0x2b5c02(0x2c8)]){const {stageName:_0x5d8016,criteriaName:_0x316e32}=findSegmentCriteriaLocation(_0x193d6a['yamlConfig'],_0x4df317);return _0x319fa4(_0x4df317,_0x5589af['rule']),_0x25f778[_0x2b5c02(0x240)](_0x4df317,{'definition':_0x5589af,'stageName':_0x5d8016,'criteriaName':_0x316e32}),createPendingSegmentId(_0x4df317);}const _0x3fcc97=_0x193d6a[_0x2b5c02(0x247)]?.['id'];if(!_0x3fcc97)throw new SDKError(ErrorCode['INTERNAL'],'Cannot\x20create\x20embedded\x20segment\x20for\x20existing\x20journey\x20without\x20journey\x20ID');_0x319fa4(_0x4df317,_0x5589af[_0x2b5c02(0x1fb)]);const _0x215dad=generateDeterministicJourneySegmentName(_0x193d6a['yamlConfig']['name'],_0x4df317),_0x2b7e9f=_0x41de18[_0x2b5c02(0x2b2)][_0x2b5c02(0x292)](_0xd3e098=>_0xd3e098['name']===_0x215dad),_0x25f502=createSegmentIdResolver(_0x41de18[_0x2b5c02(0x209)],_0x4df317),_0x2c849f=await resolveRuleSegmentIds(_0x5589af[_0x2b5c02(0x1fb)],_0x25f502);let _0x4f3cb1;if(_0x2b7e9f)await _0x41a84b[_0x2b5c02(0x22d)][_0x2b5c02(0x25d)](_0x419102[_0x2b5c02(0x23d)],_0x2b7e9f['id'],{'description':_0x5589af[_0x2b5c02(0x2b3)]||_0x2b5c02(0x1ed)+_0x4df317,'rule':_0x4ee9bb(_0x2c849f,!![]),'countPopulation':!![]}),_0x4f3cb1=_0x2b7e9f['id'];else try{_0x4f3cb1=await _0x41a84b['segment'][_0x2b5c02(0x2d0)]({'name':_0x215dad,'description':_0x5589af[_0x2b5c02(0x2b3)]||'Entry\x20criteria:\x20'+_0x4df317,'journeyId':_0x3fcc97,'rule':_0x4ee9bb(_0x2c849f,!![]),'countPopulation':!![],'parentFolderId':_0x419102[_0x2b5c02(0x278)]||'','audienceId':_0x419102[_0x2b5c02(0x23d)]});}catch(_0x598f5c){const _0x446e22=_0x598f5c instanceof Error&&_0x598f5c['message']['includes'](_0x2b5c02(0x27f));if(_0x446e22){const _0x175ee3=await _0x41a84b[_0x2b5c02(0x22d)]['listSegments'](_0x419102[_0x2b5c02(0x23d)]),_0x30a44e=_0x175ee3['find'](_0x2fab7c=>_0x2fab7c[_0x2b5c02(0x21c)]===_0x215dad);if(_0x30a44e)await _0x41a84b[_0x2b5c02(0x22d)][_0x2b5c02(0x25d)](_0x419102[_0x2b5c02(0x23d)],_0x30a44e['id'],{'description':_0x5589af[_0x2b5c02(0x2b3)]||_0x2b5c02(0x1ed)+_0x4df317,'rule':_0x4ee9bb(_0x2c849f,!![]),'countPopulation':!![]}),_0x4f3cb1=_0x30a44e['id'];else throw _0x598f5c;}else throw _0x598f5c;}return _0x41de18['segmentNameToId'][_0x2b5c02(0x240)](_0x4df317,_0x4f3cb1),_0x9712b6[_0x2b5c02(0x240)](_0x4df317,_0x4f3cb1),_0x4f3cb1;},'resolveActivationId':async _0x435b82=>{const _0x2ddc77=_0x36a5e4,_0x116906=_0x3ad5f1['get'](_0x435b82);if(_0x116906)return _0x116906;if(_0x193d6a[_0x2ddc77(0x247)]){await _0x1c0c3e();const _0x578330=_0x3ad5f1[_0x2ddc77(0x272)](_0x435b82);if(_0x578330)return _0x578330;}throw new SDKError(ErrorCode[_0x2ddc77(0x251)],_0x2ddc77(0x298)+_0x435b82+'\x20(referenced\x20in\x20journey\x20'+_0x193d6a[_0x2ddc77(0x28b)][_0x2ddc77(0x21c)]+_0x2ddc77(0x2c4)+'Define\x20it\x20in\x20the\x20journey\x27s\x20\x27activations\x27\x20section\x20or\x20use\x20an\x20existing\x20activation\x20ID.');},'resolveEmbeddedActivationId':async(_0x163782,_0x2df2b5)=>{const _0xcadb8d=_0x36a5e4,_0x360850=_0x3ad5f1[_0xcadb8d(0x272)](_0x163782);if(_0x360850)return _0x360850;if(_0x193d6a[_0xcadb8d(0x2c8)])return _0x5c1263[_0xcadb8d(0x240)](_0x163782,_0x2df2b5),createPendingActivationId(_0x163782);if(_0x193d6a[_0xcadb8d(0x247)]){await _0x1c0c3e();const _0x2b0a4d=_0x3ad5f1[_0xcadb8d(0x272)](_0x2df2b5[_0xcadb8d(0x21c)]);if(_0x2b0a4d)return _0x3ad5f1[_0xcadb8d(0x240)](_0x163782,_0x2b0a4d),_0x2b0a4d;const _0x381992=activationSignature(_0x2df2b5),_0x13ea4b=_0x3eca98?.[_0xcadb8d(0x272)](_0x381992);if(_0x13ea4b)return _0x3ad5f1['set'](_0x163782,_0x13ea4b),_0x13ea4b;const _0x32e049=await _0x283f84(_0x2df2b5,_0x41de18[_0xcadb8d(0x28a)]),_0x166092=await _0x41a84b[_0xcadb8d(0x241)][_0xcadb8d(0x222)](_0x193d6a[_0xcadb8d(0x247)]['id'],_0x32e049);return _0x3ad5f1['set'](_0x163782,_0x166092['id']),_0x166092['id'];}throw new SDKError(ErrorCode[_0xcadb8d(0x219)],_0xcadb8d(0x21b));},'resolveJourneyId':async _0x4d3903=>{const _0x142e5a=_0x36a5e4;try{return await _0x41a84b[_0x142e5a(0x241)][_0x142e5a(0x2a1)](_0x419102['parentId'],_0x4d3903);}catch(_0x3541a1){throw new SDKError(ErrorCode[_0x142e5a(0x251)],_0x142e5a(0x26f)+_0x4d3903+_0x142e5a(0x2af)+_0x193d6a[_0x142e5a(0x28b)][_0x142e5a(0x21c)]+'\x27)',_0x3541a1);}},'resolveStageId':async(_0x57bee8,_0x79b9b8)=>{const _0x17223d=_0x36a5e4,_0x2ac876=await _0x41a84b[_0x17223d(0x241)][_0x17223d(0x27c)](_0x57bee8),_0xc58d9f=_0x2ac876[_0x17223d(0x1f0)][_0x17223d(0x26a)][_0x17223d(0x292)](_0x4cd148=>_0x4cd148[_0x17223d(0x21c)]['toLowerCase']()===_0x79b9b8[_0x17223d(0x1f4)]());if(!_0xc58d9f?.['id'])throw new SDKError(ErrorCode[_0x17223d(0x251)],_0x17223d(0x2be)+_0x79b9b8+'\x27\x20not\x20found\x20in\x20journey\x20\x27'+(_0x2ac876[_0x17223d(0x1f0)][_0x17223d(0x201)]||_0x2ac876[_0x17223d(0x1f0)]['name'])+'\x27');return _0xc58d9f['id'];}},_0x183331=await _0xc4f6f0(_0x193d6a[_0x36a5e4(0x28b)],_0x419102[_0x36a5e4(0x23d)],_0x34cb4a),_0xdd953c=_0x419102[_0x36a5e4(0x245)]||_0x419102[_0x36a5e4(0x278)];_0xdd953c&&(_0x183331['relationships']={'parentFolder':{'data':{'id':_0xdd953c,'type':'folder'}}});if(_0x193d6a['isNew']){if(_0x25f778[_0x36a5e4(0x1ea)]>0x0||_0x5c1263[_0x36a5e4(0x1ea)]>0x0)return await executeThreeStepJourneyCreate(_0x41a84b,_0x193d6a,_0x183331,{'pendingEmbeddedSegments':_0x25f778,'pendingEmbeddedActivations':_0x5c1263,'embeddedSegmentNameToId':_0x9712b6,'journeyActivationNameToId':_0x3ad5f1},{..._0x419102,'effectiveFolderId':_0xdd953c},_0x41de18,_0x47afc7,_0x4d4dfa);else{ensureJourneyDefaults(_0x183331[_0x36a5e4(0x1f0)]);const _0xde93b7=await _0x41a84b['journey']['create'](_0x183331);return{'action':_0x36a5e4(0x264),'journeyId':_0xde93b7['id'],'embeddedSegmentNameToId':_0x9712b6};}}else{if(_0x193d6a[_0x36a5e4(0x2c6)]&&_0x193d6a['existingJourney'])return ensureJourneyDefaults(_0x183331[_0x36a5e4(0x1f0)]),await _0x41a84b[_0x36a5e4(0x241)]['update'](_0x193d6a[_0x36a5e4(0x247)]['id'],_0x183331),{'action':'updated','journeyId':_0x193d6a[_0x36a5e4(0x247)]['id'],'embeddedSegmentNameToId':_0x9712b6};}return{'action':'unchanged','journeyId':_0x193d6a[_0x36a5e4(0x247)]?.['id'],'embeddedSegmentNameToId':_0x9712b6};}function findSegmentCriteriaLocation(_0x6b38f6,_0x3ad759){const _0x5055aa=a117_0x1e2c10,_0x36d369=_0x6b38f6['stages']||_0x6b38f6['journeys']?.[0x0]?.[_0x5055aa(0x281)]||[];let _0x2ca08b=_0x5055aa(0x2a4),_0x2253ee=_0x3ad759;const _0x400574=_0x6b38f6[_0x5055aa(0x296)]||_0x6b38f6[_0x5055aa(0x2b6)]?.[0x0]?.['goal'];if(_0x400574?.[_0x5055aa(0x22d)]===_0x3ad759)return{'stageName':_0x5055aa(0x296),'criteriaName':_0x400574[_0x5055aa(0x21c)]||_0x3ad759};_0x52eb7e:for(const _0xcc61fc of _0x36d369){if(_0xcc61fc[_0x5055aa(0x252)]?.[_0x5055aa(0x22d)]===_0x3ad759){_0x2ca08b=_0xcc61fc[_0x5055aa(0x21c)],_0x2253ee=_0xcc61fc[_0x5055aa(0x252)]['name']||_0x3ad759;break;}if(_0xcc61fc[_0x5055aa(0x21e)])for(const _0x2703c3 of _0xcc61fc[_0x5055aa(0x21e)]){if(_0x2703c3['type']===_0x5055aa(0x23f)&&_0x2703c3['with']?.['branches'])for(const _0x11edad of _0x2703c3[_0x5055aa(0x207)]['branches']){if(_0x11edad[_0x5055aa(0x22d)]===_0x3ad759){_0x2ca08b=_0xcc61fc[_0x5055aa(0x21c)],_0x2253ee=_0x11edad[_0x5055aa(0x21c)]||_0x3ad759;break _0x52eb7e;}}}}return{'stageName':_0x2ca08b,'criteriaName':_0x2253ee};}async function executeThreeStepJourneyCreate(_0x2a54df,_0x376aef,_0x3791eb,_0x1daac0,_0x5a9099,_0x522d06,_0x6b338a,_0x1f66e5){const _0x24f42c=a117_0x1e2c10,{activationDefToCreateRequest:_0x4e9a1c,yamlRuleToApi:_0x5be56a}=_0x1f66e5,{pendingEmbeddedSegments:_0x5c9fb2,pendingEmbeddedActivations:_0x4f7cc1,embeddedSegmentNameToId:_0x250cfd}=_0x1daac0,_0x3aac19=JSON['parse'](JSON['stringify'](_0x3791eb));ensureJourneyDefaults(_0x3aac19[_0x24f42c(0x1f0)]),stripPendingIds(_0x3aac19);const _0x124741=await _0x2a54df[_0x24f42c(0x241)][_0x24f42c(0x2b8)](_0x3aac19),_0x5442de=_0x124741['id'],_0x3a5c8b=new Map();for(const _0x5078b7 of _0x124741[_0x24f42c(0x1f0)][_0x24f42c(0x26a)]){_0x3a5c8b[_0x24f42c(0x240)](_0x5078b7[_0x24f42c(0x21c)][_0x24f42c(0x1f4)](),_0x5078b7['id']);}for(const [_0x334010,{definition:_0x238889}]of _0x5c9fb2){const _0x5a0a88=generateDeterministicJourneySegmentName(_0x376aef[_0x24f42c(0x28b)][_0x24f42c(0x21c)],_0x334010);_0x6b338a['onProgress']?.({'type':_0x24f42c(0x235),'journeyName':_0x376aef[_0x24f42c(0x28b)][_0x24f42c(0x21c)],'segmentName':_0x334010});const _0x3c3e88=createSegmentIdResolver(_0x522d06[_0x24f42c(0x209)],_0x334010),_0x2341de=await resolveRuleSegmentIds(_0x238889[_0x24f42c(0x1fb)],_0x3c3e88),_0x279bb5=await _0x2a54df[_0x24f42c(0x22d)][_0x24f42c(0x2d0)]({'name':_0x5a0a88,'description':_0x238889[_0x24f42c(0x2b3)]||'Entry\x20criteria:\x20'+_0x334010,'journeyId':_0x5442de,'rule':_0x5be56a(_0x2341de,!![]),'countPopulation':!![],'parentFolderId':_0x5a9099['effectiveFolderId']||'','audienceId':_0x5a9099[_0x24f42c(0x23d)]});_0x250cfd['set'](_0x334010,_0x279bb5),_0x522d06[_0x24f42c(0x209)][_0x24f42c(0x240)](_0x334010,_0x279bb5),_0x6b338a[_0x24f42c(0x284)]?.({'type':_0x24f42c(0x20a),'journeyName':_0x376aef[_0x24f42c(0x28b)][_0x24f42c(0x21c)],'segmentName':_0x334010});}const _0x345781=new Map();for(const [_0x1adb68,_0x5f9925]of _0x4f7cc1){_0x6b338a[_0x24f42c(0x284)]?.({'type':'embedded_activation_creating','journeyName':_0x376aef[_0x24f42c(0x28b)][_0x24f42c(0x21c)],'activationName':_0x1adb68});const _0x2cc670=await _0x4e9a1c(_0x5f9925,_0x522d06['activationContext']),_0x2c6651=await _0x2a54df[_0x24f42c(0x241)]['createActivation'](_0x5442de,_0x2cc670);_0x345781[_0x24f42c(0x240)](_0x1adb68,_0x2c6651['id']),_0x1daac0[_0x24f42c(0x26e)][_0x24f42c(0x240)](_0x1adb68,_0x2c6651['id']),_0x6b338a[_0x24f42c(0x284)]?.({'type':_0x24f42c(0x297),'journeyName':_0x376aef[_0x24f42c(0x28b)][_0x24f42c(0x21c)],'activationName':_0x1adb68});}const _0x7cb9e7=JSON[_0x24f42c(0x1f2)](JSON[_0x24f42c(0x20b)](_0x3791eb));return _0x7cb9e7['id']=_0x5442de,ensureJourneyDefaults(_0x7cb9e7['attributes']),resolvePendingIdsInRequest(_0x7cb9e7,_0x3791eb,_0x3a5c8b,_0x250cfd,_0x345781,_0x6b338a),await _0x2a54df['journey'][_0x24f42c(0x1e7)](_0x5442de,_0x7cb9e7),{'action':_0x24f42c(0x264),'journeyId':_0x5442de,'embeddedSegmentNameToId':_0x250cfd};}function stripPendingIds(_0xb5b40d){const _0x5f0ae6=a117_0x1e2c10;for(const _0x5c01e0 of _0xb5b40d[_0x5f0ae6(0x1f0)][_0x5f0ae6(0x26a)]||[]){_0x5c01e0[_0x5f0ae6(0x2b1)]?.[_0x5f0ae6(0x2ac)]&&isPendingSegmentId(_0x5c01e0[_0x5f0ae6(0x2b1)][_0x5f0ae6(0x2ac)])&&delete _0x5c01e0[_0x5f0ae6(0x2b1)];if(_0x5c01e0['steps'])for(const _0x385ec8 of Object['keys'](_0x5c01e0[_0x5f0ae6(0x21e)])){const _0xd0d873=_0x5c01e0['steps'][_0x385ec8];_0xd0d873[_0x5f0ae6(0x223)]===_0x5f0ae6(0x23e)&&_0xd0d873[_0x5f0ae6(0x2c9)]&&isPendingActivationId(_0xd0d873[_0x5f0ae6(0x2c9)])&&(_0xd0d873[_0x5f0ae6(0x2c9)]='');if(_0xd0d873[_0x5f0ae6(0x223)]===_0x5f0ae6(0x256)&&_0xd0d873[_0x5f0ae6(0x228)])for(const _0x37f095 of _0xd0d873[_0x5f0ae6(0x228)]){_0x37f095['segmentId']&&isPendingSegmentId(_0x37f095[_0x5f0ae6(0x2ac)])&&(_0x37f095[_0x5f0ae6(0x2ac)]='');}_0xd0d873[_0x5f0ae6(0x223)]==='WaitStep'&&_0xd0d873['waitCondition']?.[_0x5f0ae6(0x2ac)]&&isPendingSegmentId(_0xd0d873[_0x5f0ae6(0x246)]['segmentId'])&&(_0xd0d873[_0x5f0ae6(0x246)][_0x5f0ae6(0x2ac)]='');}}}function resolvePendingIdsInRequest(_0x3cf8bc,_0x3b0444,_0x1eb873,_0x3d833b,_0x463c02,_0x5e935c){const _0x55db25=a117_0x1e2c10,_0x451b4a=(_0x36a487,_0x3b8297)=>{const _0x4cb02a=a117_0x3610;if(!isPendingSegmentId(_0x36a487))return _0x36a487;const _0x19456c=extractPendingSegmentName(_0x36a487),_0x22fda9=_0x3d833b[_0x4cb02a(0x272)](_0x19456c);return!_0x22fda9&&_0x5e935c['logWarning']?.(_0x4cb02a(0x25a)+_0x19456c+_0x4cb02a(0x24e)+_0x3b8297),_0x22fda9;};if(_0x3cf8bc[_0x55db25(0x1f0)][_0x55db25(0x296)]?.['segmentId']&&isPendingSegmentId(_0x3cf8bc[_0x55db25(0x1f0)][_0x55db25(0x296)]['segmentId'])){const _0x102e6d=_0x451b4a(_0x3cf8bc[_0x55db25(0x1f0)][_0x55db25(0x296)][_0x55db25(0x2ac)],'goal\x20criteria');_0x102e6d&&(_0x3cf8bc['attributes'][_0x55db25(0x296)][_0x55db25(0x2ac)]=_0x102e6d);}for(const _0x33b38b of _0x3cf8bc['attributes'][_0x55db25(0x26a)]||[]){const _0x4f90d0=_0x1eb873[_0x55db25(0x272)](_0x33b38b['name'][_0x55db25(0x1f4)]());_0x4f90d0&&(_0x33b38b['id']=_0x4f90d0);if(_0x33b38b[_0x55db25(0x2b1)]?.['segmentId']&&isPendingSegmentId(_0x33b38b[_0x55db25(0x2b1)][_0x55db25(0x2ac)])){const _0x149372=_0x451b4a(_0x33b38b[_0x55db25(0x2b1)][_0x55db25(0x2ac)],_0x55db25(0x261)+_0x33b38b[_0x55db25(0x21c)]+_0x55db25(0x20f));_0x149372&&(_0x33b38b[_0x55db25(0x2b1)][_0x55db25(0x2ac)]=_0x149372);}if(_0x33b38b[_0x55db25(0x22b)])for(const _0x2e26ef of _0x33b38b['exitCriterias']){if(_0x2e26ef[_0x55db25(0x2ac)]&&isPendingSegmentId(_0x2e26ef['segmentId'])){const _0x3cc3c2=_0x451b4a(_0x2e26ef[_0x55db25(0x2ac)],_0x55db25(0x261)+_0x33b38b[_0x55db25(0x21c)]+_0x55db25(0x212));_0x3cc3c2&&(_0x2e26ef[_0x55db25(0x2ac)]=_0x3cc3c2);}}if(_0x33b38b[_0x55db25(0x25c)]?.[_0x55db25(0x2ac)]&&isPendingSegmentId(_0x33b38b[_0x55db25(0x25c)][_0x55db25(0x2ac)])){const _0x16be52=_0x451b4a(_0x33b38b['milestone']['segmentId'],_0x55db25(0x261)+_0x33b38b[_0x55db25(0x21c)]+_0x55db25(0x2a8));_0x16be52&&(_0x33b38b['milestone'][_0x55db25(0x2ac)]=_0x16be52);}if(_0x33b38b[_0x55db25(0x21e)]){const _0x560237=_0x1bbb14=>_0x3b0444[_0x55db25(0x1f0)][_0x55db25(0x26a)][_0x55db25(0x292)](_0x569df2=>_0x569df2[_0x55db25(0x21c)]['toLowerCase']()===_0x33b38b['name'][_0x55db25(0x1f4)]())?.[_0x55db25(0x21e)]?.[_0x1bbb14];for(const _0x2dc8f0 of Object[_0x55db25(0x213)](_0x33b38b[_0x55db25(0x21e)])){const _0x29e150=_0x33b38b[_0x55db25(0x21e)][_0x2dc8f0],_0x29a603=_0x560237(_0x2dc8f0);if(_0x29e150['type']===_0x55db25(0x23e)&&_0x29e150[_0x55db25(0x2c9)]&&(isPendingActivationId(_0x29e150['journeyActivationStepId'])||_0x29e150[_0x55db25(0x2c9)]==='')){if(_0x29a603?.[_0x55db25(0x2c9)]&&isPendingActivationId(_0x29a603[_0x55db25(0x2c9)])){const _0x1269e3=extractPendingActivationName(_0x29a603['journeyActivationStepId']),_0x27e363=_0x463c02[_0x55db25(0x272)](_0x1269e3);_0x27e363&&(_0x29e150['journeyActivationStepId']=_0x27e363);}}if(_0x29e150[_0x55db25(0x223)]==='DecisionPoint'&&_0x29e150[_0x55db25(0x228)]&&_0x29a603?.[_0x55db25(0x228)])for(let _0x45d224=0x0;_0x45d224<_0x29e150[_0x55db25(0x228)][_0x55db25(0x2ce)];_0x45d224++){const _0x54361c=_0x29e150[_0x55db25(0x228)][_0x45d224],_0x215de8=_0x29a603['branches'][_0x45d224];if(_0x215de8?.['segmentId']&&isPendingSegmentId(_0x215de8[_0x55db25(0x2ac)])){const _0x238d76=_0x451b4a(_0x215de8['segmentId'],_0x55db25(0x261)+_0x33b38b[_0x55db25(0x21c)]+_0x55db25(0x211)+(_0x54361c['name']||_0x45d224)+'\x27');_0x238d76&&(_0x54361c[_0x55db25(0x2ac)]=_0x238d76);}}if(_0x29e150[_0x55db25(0x223)]==='WaitStep'&&_0x29e150[_0x55db25(0x246)]?.[_0x55db25(0x2ac)]&&_0x29a603?.[_0x55db25(0x246)]?.[_0x55db25(0x2ac)]&&isPendingSegmentId(_0x29a603['waitCondition'][_0x55db25(0x2ac)])){const _0x356531=_0x451b4a(_0x29a603['waitCondition'][_0x55db25(0x2ac)],_0x55db25(0x261)+_0x33b38b[_0x55db25(0x21c)]+_0x55db25(0x208));_0x356531&&(_0x29e150[_0x55db25(0x246)][_0x55db25(0x2ac)]=_0x356531);}}}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x2103d3,_0x711009){const _0x2c5159=a118_0x403e,_0x3d9857=_0x2103d3();while(!![]){try{const _0x15ece4=-parseInt(_0x2c5159(0xab))/0x1*(parseInt(_0x2c5159(0xb5))/0x2)+parseInt(_0x2c5159(0xb6))/0x3*(-parseInt(_0x2c5159(0xb8))/0x4)+-parseInt(_0x2c5159(0xb2))/0x5*(-parseInt(_0x2c5159(0xb4))/0x6)+parseInt(_0x2c5159(0xad))/0x7+parseInt(_0x2c5159(0xb3))/0x8+-parseInt(_0x2c5159(0xb1))/0x9*(-parseInt(_0x2c5159(0xac))/0xa)+-parseInt(_0x2c5159(0xb9))/0xb;if(_0x15ece4===_0x711009)break;else _0x3d9857['push'](_0x3d9857['shift']());}catch(_0x5125cc){_0x3d9857['push'](_0x3d9857['shift']());}}}(a118_0x4ca4,0x5b1d4));function a118_0x403e(_0x1cf3fb,_0x237342){_0x1cf3fb=_0x1cf3fb-0xaa;const _0x4ca4a=a118_0x4ca4();let _0x403ed0=_0x4ca4a[_0x1cf3fb];return _0x403ed0;}export function buildFolderIdToPathMap(_0x1b5f53){const _0x363b29=a118_0x403e,_0xd7f376=new Map(),_0x3fcb13=new Map();for(const _0x3901b1 of _0x1b5f53){_0x3fcb13[_0x363b29(0xaf)](_0x3901b1['id'],_0x3901b1);}const _0x3b9fd8=new Set();for(const _0x5292b9 of _0x1b5f53){!_0x5292b9[_0x363b29(0xb0)]&&_0x3b9fd8[_0x363b29(0xb7)](_0x5292b9['id']);}function _0x3d2ee0(_0x234abd){const _0x106677=_0x363b29;if(_0xd7f376[_0x106677(0xae)](_0x234abd['id']))return _0xd7f376['get'](_0x234abd['id']);if(_0x3b9fd8[_0x106677(0xae)](_0x234abd['id']))return _0xd7f376[_0x106677(0xaf)](_0x234abd['id'],''),'';if(_0x234abd['parentFolderId']){const _0x42390a=_0x3fcb13[_0x106677(0xaa)](_0x234abd[_0x106677(0xb0)]);if(_0x42390a){const _0x3e90b3=_0x3d2ee0(_0x42390a),_0x58a9f6=_0x3e90b3?_0x3e90b3+'/'+_0x234abd['name']:_0x234abd[_0x106677(0xba)];return _0xd7f376['set'](_0x234abd['id'],_0x58a9f6),_0x58a9f6;}}const _0x10810d=_0x234abd['name'];return _0xd7f376['set'](_0x234abd['id'],_0x10810d),_0x10810d;}for(const _0x22846c of _0x1b5f53){_0x3d2ee0(_0x22846c);}return _0xd7f376;}function a118_0x4ca4(){const _0x401247=['add','4mjZvxI','4646884VUiWGn','name','get','649gJsTFE','390iwGqqx','1094240ONyXKD','has','set','parentFolderId','121239ukrZho','1085vlqgXn','4247136YxexJL','2148GInuuB','458HuiKSu','1037994RNAaum'];a118_0x4ca4=function(){return _0x401247;};return a118_0x4ca4();}export function buildFolderPathToIdMap(_0x36c4ac){const _0x10da36=a118_0x403e,_0x40c8a1=new Map(),_0x133daa=new Map();for(const _0x2e5a25 of _0x36c4ac){_0x133daa[_0x10da36(0xaf)](_0x2e5a25['id'],_0x2e5a25);}const _0x1b80af=new Set();for(const _0x5f42b5 of _0x36c4ac){!_0x5f42b5[_0x10da36(0xb0)]&&_0x1b80af[_0x10da36(0xb7)](_0x5f42b5['id']);}function _0x13ffab(_0x17d7cb){const _0x81fdb4=_0x10da36;if(_0x1b80af['has'](_0x17d7cb['id']))return'';if(_0x17d7cb[_0x81fdb4(0xb0)]){const _0x587e1c=_0x133daa['get'](_0x17d7cb[_0x81fdb4(0xb0)]);if(_0x587e1c){const _0x586420=_0x13ffab(_0x587e1c);return _0x586420?_0x586420+'/'+_0x17d7cb['name']:_0x17d7cb['name'];}}return _0x17d7cb[_0x81fdb4(0xba)];}for(const _0x746dc7 of _0x36c4ac){const _0x560018=_0x13ffab(_0x746dc7);_0x40c8a1[_0x10da36(0xaf)](_0x560018,_0x746dc7['id']);}return _0x40c8a1;}export function buildFolderMaps(_0x1ba82c){const _0xbf0feb=a118_0x403e,_0x38f3f2=buildFolderIdToPathMap(_0x1ba82c),_0x43fbed=new Map();for(const [_0x188d99,_0x1b87c5]of _0x38f3f2){_0x43fbed[_0xbf0feb(0xaf)](_0x1b87c5,_0x188d99);}return{'idToPath':_0x38f3f2,'pathToId':_0x43fbed};}export function getFolderPath(_0x1fb544,_0x3e113d){const _0xd59349=a118_0x403e;if(!_0x1fb544)return'';return _0x3e113d[_0xd59349(0xaa)](_0x1fb544)??'';}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x2260d7,_0x4472ae){const _0x468002=a119_0x5897,_0x32bd9f=_0x2260d7();while(!![]){try{const _0x3bfc96=-parseInt(_0x468002(0x1dc))/0x1+-parseInt(_0x468002(0x1c8))/0x2*(-parseInt(_0x468002(0x1e8))/0x3)+parseInt(_0x468002(0x1d9))/0x4*(-parseInt(_0x468002(0x1d6))/0x5)+-parseInt(_0x468002(0x1e4))/0x6+-parseInt(_0x468002(0x1ce))/0x7+parseInt(_0x468002(0x1da))/0x8+parseInt(_0x468002(0x1ea))/0x9;if(_0x3bfc96===_0x4472ae)break;else _0x32bd9f['push'](_0x32bd9f['shift']());}catch(_0x311d25){_0x32bd9f['push'](_0x32bd9f['shift']());}}}(a119_0x1528,0x29067));import a119_0x370f0c from'path';import{parse as a119_0x10d6ab}from'yaml';import{nodeFileSystem}from'../io/node-filesystem.js';export function parsePath(_0x5e84de){const _0x25bec7=a119_0x5897;if(!_0x5e84de||_0x5e84de[_0x25bec7(0x1e0)]()==='')throw new Error('Path\x20cannot\x20be\x20empty');const _0x2a93c6=_0x5e84de[_0x25bec7(0x1e0)]();if(_0x2a93c6==='/')return{'segments':[],'isAbsolute':!![],'raw':_0x5e84de};const _0x28a373=_0x2a93c6[_0x25bec7(0x1d1)]('/')?_0x2a93c6[_0x25bec7(0x1e1)](0x1):_0x2a93c6,_0x40a43c=_0x28a373[_0x25bec7(0x1db)]('/')['filter'](_0x149d32=>_0x149d32!=='');if(_0x40a43c[_0x25bec7(0x1cb)]===0x0)throw new Error(_0x25bec7(0x1eb));const _0x4c7c61=_0x2a93c6[_0x25bec7(0x1d1)]('/')||!isRelativePathSegment(_0x40a43c[0x0]);for(const _0x5048c4 of _0x40a43c){validatePathSegment(_0x5048c4);}return{'segments':_0x40a43c,'isAbsolute':_0x4c7c61,'raw':_0x5e84de};}function isRelativePathSegment(_0x46f914){return _0x46f914==='.'||_0x46f914==='..';}function a119_0x5897(_0x77abf8,_0x20ce58){_0x77abf8=_0x77abf8-0x1c6;const _0x1528e7=a119_0x1528();let _0x58970e=_0x1528e7[_0x77abf8];return _0x58970e;}function validatePathSegment(_0x3e8a91){const _0x5acef3=a119_0x5897;if(_0x3e8a91==='')throw new Error(_0x5acef3(0x1e7));if(_0x3e8a91==='.'||_0x3e8a91==='..')return;if(/[\x00-\x1F\x7F]/[_0x5acef3(0x1cc)](_0x3e8a91))throw new Error('Path\x20segment\x20contains\x20invalid\x20control\x20characters:\x20'+_0x3e8a91);if(_0x3e8a91!==_0x3e8a91[_0x5acef3(0x1e0)]()){}}export function validatePath(_0x4d1d2d){const _0x1261c7=a119_0x5897;if(_0x4d1d2d[_0x1261c7(0x1c6)]['length']===0x0&&!_0x4d1d2d['isAbsolute'])throw new Error(_0x1261c7(0x1f1));if(_0x4d1d2d[_0x1261c7(0x1d3)]){if(_0x4d1d2d['segments'][0x0]==='..')throw new Error(_0x1261c7(0x1d5));let _0x3e4a1a=0x0;for(const _0x94cb61 of _0x4d1d2d[_0x1261c7(0x1c6)]){if(_0x94cb61==='..'){if(_0x3e4a1a===0x0)throw new Error('Path\x20attempts\x20to\x20navigate\x20above\x20root');_0x3e4a1a--;}else _0x94cb61!=='.'&&_0x3e4a1a++;}}}function a119_0x1528(){const _0x819bbc=['test','endsWith','2187913IlNrxJ','root','Cannot\x20split\x20empty\x20path','startsWith','segment','isAbsolute','.yaml','Absolute\x20path\x20cannot\x20start\x20with\x20\x22..\x22','95iVRecQ','No\x20tdx.json\x20found\x20for\x20file:\x20','Invalid\x20YAML:\x20missing\x20name\x20field\x20in\x20','48764yeKQjt','199760Vswqld','split','253779xUltOi','resolve','exists','parse','trim','substring','readFile','slice','1009476hJjthU','dirname','name','Path\x20segment\x20cannot\x20be\x20empty','6DBJMGE','Cannot\x20navigate\x20above\x20root','8779536EYUdLA','Path\x20must\x20contain\x20at\x20least\x20one\x20segment','raw','join','pop','File\x20not\x20found:\x20','journey','Relative\x20path\x20cannot\x20be\x20empty','segments','replace','133778QABbMS','push','type','length'];a119_0x1528=function(){return _0x819bbc;};return a119_0x1528();}export function joinPaths(_0x5de6f4,_0x4b8112){const _0x2afbc6=a119_0x5897;if(!_0x5de6f4||_0x5de6f4==='/')return _0x4b8112;if(!_0x4b8112||_0x4b8112==='.')return _0x5de6f4;if(_0x4b8112[_0x2afbc6(0x1d1)]('/'))return _0x4b8112;const _0x54477f=parsePath(_0x5de6f4),_0x2e413b=parsePath(_0x4b8112),_0x5dc45a=[..._0x54477f['segments']];for(const _0x107750 of _0x2e413b[_0x2afbc6(0x1c6)]){if(_0x107750==='.')continue;else{if(_0x107750==='..'){if(_0x5dc45a['length']===0x0)throw new Error(_0x2afbc6(0x1e9));_0x5dc45a[_0x2afbc6(0x1ee)]();}else _0x5dc45a[_0x2afbc6(0x1c9)](_0x107750);}}const _0x2a9e0c=_0x5dc45a[_0x2afbc6(0x1ed)]('/');return _0x54477f['raw'][_0x2afbc6(0x1d1)]('/')?'/'+_0x2a9e0c:_0x2a9e0c;}export function normalizePath(_0x831f4){const _0x245147=a119_0x5897,_0x27e4b8=parsePath(_0x831f4),_0x5ddf6e=[];for(const _0x57466b of _0x27e4b8[_0x245147(0x1c6)]){if(_0x57466b==='.')continue;else{if(_0x57466b==='..'){if(_0x5ddf6e['length']===0x0){if(_0x27e4b8[_0x245147(0x1d3)])throw new Error(_0x245147(0x1e9));_0x5ddf6e['push']('..');}else _0x5ddf6e[_0x5ddf6e['length']-0x1]==='..'?_0x5ddf6e[_0x245147(0x1c9)]('..'):_0x5ddf6e['pop']();}else _0x5ddf6e[_0x245147(0x1c9)](_0x57466b);}}if(_0x5ddf6e[_0x245147(0x1cb)]===0x0)return _0x27e4b8[_0x245147(0x1d3)]?'/':'.';const _0x332e48=_0x5ddf6e[_0x245147(0x1ed)]('/');return _0x27e4b8[_0x245147(0x1ec)]['startsWith']('/')?'/'+_0x332e48:_0x332e48;}export function getParentPath(_0xf49683){const _0x959e02=a119_0x5897,_0x33edaf=parsePath(_0xf49683);if(_0x33edaf[_0x959e02(0x1c6)][_0x959e02(0x1cb)]<=0x1)return'/';const _0xbaeecb=_0x33edaf[_0x959e02(0x1c6)][_0x959e02(0x1e3)](0x0,-0x1)['join']('/');return _0x33edaf[_0x959e02(0x1ec)][_0x959e02(0x1d1)]('/')?'/'+_0xbaeecb:_0xbaeecb;}export function getBaseName(_0x42da2d){const _0x460be6=a119_0x5897,_0x34964d=parsePath(_0x42da2d);return _0x34964d[_0x460be6(0x1c6)][_0x34964d[_0x460be6(0x1c6)][_0x460be6(0x1cb)]-0x1]||'';}export function isChildPath(_0x5e2591,_0x2d23da){const _0x11facc=a119_0x5897,_0x1d8f42=parsePath(_0x5e2591),_0x434c1f=parsePath(_0x2d23da);if(_0x1d8f42['segments'][_0x11facc(0x1cb)]<=_0x434c1f[_0x11facc(0x1c6)]['length'])return![];for(let _0x9f5c9=0x0;_0x9f5c9<_0x434c1f[_0x11facc(0x1c6)]['length'];_0x9f5c9++){if(_0x1d8f42['segments'][_0x9f5c9]!==_0x434c1f['segments'][_0x9f5c9])return![];}return!![];}export function splitPath(_0xeec323){const _0x5c813e=a119_0x5897,_0x366757=parsePath(_0xeec323);if(_0x366757[_0x5c813e(0x1c6)][_0x5c813e(0x1cb)]===0x0)throw new Error(_0x5c813e(0x1d0));if(_0x366757['segments']['length']===0x1)return{'parent':_0x366757['segments'][0x0]};return{'parent':_0x366757['segments'][0x0],'child':_0x366757[_0x5c813e(0x1c6)][_0x5c813e(0x1e3)](0x1)[_0x5c813e(0x1ed)]('/')};}export function isYamlFilePath(_0x4b95ba){const _0x5e8515=a119_0x5897;return _0x4b95ba[_0x5e8515(0x1cd)]('.yml')||_0x4b95ba[_0x5e8515(0x1cd)](_0x5e8515(0x1d4));}export async function resolveYamlFilePath(_0x3e664d,_0x3c6e6d=nodeFileSystem){const _0xf7cee6=a119_0x5897,_0x14510f=a119_0x370f0c[_0xf7cee6(0x1dd)](_0x3e664d);if(!await _0x3c6e6d[_0xf7cee6(0x1de)](_0x14510f))throw new Error(_0xf7cee6(0x1ef)+_0x3e664d);let _0x456ab6=a119_0x370f0c[_0xf7cee6(0x1e5)](_0x14510f),_0x169757=null,_0x5cabb1=null;const _0x495492=a119_0x370f0c[_0xf7cee6(0x1df)](_0x456ab6)[_0xf7cee6(0x1cf)];while(_0x456ab6!==_0x495492){const _0x7d6bb5=a119_0x370f0c[_0xf7cee6(0x1ed)](_0x456ab6,'tdx.json');if(await _0x3c6e6d[_0xf7cee6(0x1de)](_0x7d6bb5)){_0x169757=_0x7d6bb5,_0x5cabb1=_0x456ab6;break;}_0x456ab6=a119_0x370f0c['dirname'](_0x456ab6);}if(!_0x169757||!_0x5cabb1)throw new Error(_0xf7cee6(0x1d7)+_0x3e664d);const _0x3a1e58=await _0x3c6e6d[_0xf7cee6(0x1e2)](_0x169757),_0x42d88e=JSON['parse'](_0x3a1e58),_0x19b748=_0x42d88e['parent_segment'];if(!_0x19b748)throw new Error('Invalid\x20tdx.json:\x20missing\x20parent_segment\x20field');const _0x5f5b48=await _0x3c6e6d[_0xf7cee6(0x1e2)](_0x14510f),_0x316d82=a119_0x10d6ab(_0x5f5b48),_0x39e7c1=_0x316d82[_0xf7cee6(0x1e6)];if(!_0x39e7c1)throw new Error(_0xf7cee6(0x1d8)+_0x3e664d);const _0x1dcf8a=_0x316d82[_0xf7cee6(0x1ca)]==='journey'?_0xf7cee6(0x1f0):_0xf7cee6(0x1d2),_0x2e225e=a119_0x370f0c['relative'](_0x5cabb1,_0x14510f),_0x44e10e=a119_0x370f0c['dirname'](_0x2e225e),_0x1f48f0=_0x44e10e==='.'?'':_0x44e10e[_0xf7cee6(0x1c7)](/\\/g,'/'),_0x5067b0=_0x1f48f0?_0x19b748+'/'+_0x1f48f0+'/'+_0x39e7c1:_0x19b748+'/'+_0x39e7c1;return{'parentSegment':_0x19b748,'segmentName':_0x39e7c1,'folderPath':_0x1f48f0,'fullPath':_0x5067b0,'resourceType':_0x1dcf8a};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a120_0x1cc4(_0x1b751d,_0x16005b){_0x1b751d=_0x1b751d-0x176;const _0x3e607f=a120_0x3e60();let _0x1cc46d=_0x3e607f[_0x1b751d];return _0x1cc46d;}function a120_0x3e60(){const _0x270fbf=['45lZRSMC','.\x20Child\x20name\x20cannot\x20be\x20empty','536846rkvFyw','15186afcNhW','54010yQyqKc','3VKgQlo','2453HrUXSF','2539104ohRSJN','Invalid\x20segment\x20reference\x20format:\x20','792616ihoFGV','2203117NAGMHI','495WlIXeR','substring','.\x20Parent\x20name\x20cannot\x20be\x20empty','83066IrYffs'];a120_0x3e60=function(){return _0x270fbf;};return a120_0x3e60();}(function(_0x4570f4,_0xe36f53){const _0x4f6b86=a120_0x1cc4,_0x21a342=_0x4570f4();while(!![]){try{const _0x3de7a5=-parseInt(_0x4f6b86(0x179))/0x1+-parseInt(_0x4f6b86(0x17c))/0x2*(-parseInt(_0x4f6b86(0x17f))/0x3)+-parseInt(_0x4f6b86(0x181))/0x4+-parseInt(_0x4f6b86(0x176))/0x5*(parseInt(_0x4f6b86(0x17d))/0x6)+parseInt(_0x4f6b86(0x184))/0x7+parseInt(_0x4f6b86(0x183))/0x8*(-parseInt(_0x4f6b86(0x17a))/0x9)+-parseInt(_0x4f6b86(0x17e))/0xa*(-parseInt(_0x4f6b86(0x180))/0xb);if(_0x3de7a5===_0xe36f53)break;else _0x21a342['push'](_0x21a342['shift']());}catch(_0x467b98){_0x21a342['push'](_0x21a342['shift']());}}}(a120_0x3e60,0x4f0c5));export function parseSegmentRef(_0x7b0697){const _0x5acb5c=a120_0x1cc4,_0x477f82=_0x7b0697['indexOf']('/');if(_0x477f82===-0x1)return{'parentId':_0x7b0697};if(_0x477f82===0x0)throw new Error('Invalid\x20segment\x20reference\x20format:\x20'+_0x7b0697+_0x5acb5c(0x178));const _0x36c5b1=_0x7b0697[_0x5acb5c(0x177)](0x0,_0x477f82),_0x9f8b6a=_0x7b0697['substring'](_0x477f82+0x1);if(_0x9f8b6a==='')throw new Error(_0x5acb5c(0x182)+_0x7b0697+_0x5acb5c(0x17b));return{'parentId':_0x36c5b1,'childId':_0x9f8b6a};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a121_0xf174(){const _0x2d34f6=['file_not_found','error','replace','basename','startsWith','stat','File\x20not\x20found','File\x20not\x20found:\x20','resolve','match','type','Not\x20a\x20YAML\x20file:\x20','2535134RySfIV','journey','message','parent_name','2500436pKHgLH','segmentName','string','3VoARCO','no_config','No\x20tdx.json\x20found\x20for\x20file:\x20','cwd','folderPath','join','segment','resourceType','no_parent','4056057oSovFg','file','20XQkvph','parent_segment','parentSegment','8bcLTca','isScoped','parse','Segment\x20and\x20journey\x20files\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension','tdx.json','isFile','6wyKjBo','context','1959020okpQqe','39918Jkgizx','relative','scopedFolderPath','invalid_yaml','Tip:\x20Run\x20\x27tdx\x20sg\x20pull\x20<parent_name>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure\x0a\x20\x20Or\x20set\x20context:\x20\x27tdx\x20sg\x20use\x20<parent_name>\x27','No\x20tdx.json\x20found\x20in\x20or\x20above:\x20','Use\x20\x27tdx\x20sg\x20use\x20<parent_name>\x27\x20to\x20set\x20context\x0aOr\x20run\x20\x27tdx\x20sg\x20pull\x20<parent_name>\x27\x20to\x20create\x20the\x20folder\x20structure','dirname','5151212OHdRel','readFile','No\x20tdx.json\x20found','2569060OBHsBx','Parent\x20segment\x20not\x20specified','configDir','isDirectory','trim'];a121_0xf174=function(){return _0x2d34f6;};return a121_0xf174();}(function(_0x6a3a0,_0x231aff){const _0x332103=a121_0x3c6c,_0x5520b5=_0x6a3a0();while(!![]){try{const _0x174562=parseInt(_0x332103(0x174))/0x1*(parseInt(_0x332103(0x180))/0x2)+-parseInt(_0x332103(0x169))/0x3*(-parseInt(_0x332103(0x166))/0x4)+-parseInt(_0x332103(0x17f))/0x5+-parseInt(_0x332103(0x17d))/0x6*(-parseInt(_0x332103(0x162))/0x7)+parseInt(_0x332103(0x177))/0x8*(-parseInt(_0x332103(0x172))/0x9)+parseInt(_0x332103(0x18b))/0xa+-parseInt(_0x332103(0x188))/0xb;if(_0x174562===_0x231aff)break;else _0x5520b5['push'](_0x5520b5['shift']());}catch(_0x8027a5){_0x5520b5['push'](_0x5520b5['shift']());}}}(a121_0xf174,0x5132c));import a121_0x210f18 from'path';import{sanitizeFileName}from'../../utils/string-utils.js';import{nodeFileSystem}from'../io/node-filesystem.js';import{isYamlFilePath,resolveYamlFilePath}from'./segment-path-parser.js';import{getSegmentRootDir}from'./tdx-config.js';export function isSuccessfulResolution(_0x52a5b0){const _0x2cd17b=a121_0x3c6c;return _0x52a5b0[_0x2cd17b(0x19a)]!==_0x2cd17b(0x191);}export function isScopedResolution(_0x594201){const _0x1118eb=a121_0x3c6c;return _0x594201[_0x1118eb(0x19a)]==='directory'||_0x594201[_0x1118eb(0x19a)]==='file'||_0x594201['type']==='context';}function a121_0x3c6c(_0x2ea326,_0xb4887b){_0x2ea326=_0x2ea326-0x161;const _0xf17469=a121_0xf174();let _0x3c6c8f=_0xf17469[_0x2ea326];return _0x3c6c8f;}export function getScopedDetails(_0xf96ec2){const _0x207ca4=a121_0x3c6c;if(isScopedResolution(_0xf96ec2))return{'isScoped':_0xf96ec2['isScoped'],'scopedFolderPath':_0xf96ec2[_0x207ca4(0x182)]};return undefined;}async function findTdxConfigAsync(_0x304bc1,_0x18a963){const _0x2b51c0=a121_0x3c6c;let _0x18d438=a121_0x210f18['resolve'](_0x304bc1);const _0x15fb4b=a121_0x210f18[_0x2b51c0(0x179)](_0x18d438)['root'];while(_0x18d438!==_0x15fb4b){const _0x473eb9=a121_0x210f18[_0x2b51c0(0x16e)](_0x18d438,_0x2b51c0(0x17b));if(await _0x18a963['exists'](_0x473eb9))try{const _0x4eae34=await _0x18a963[_0x2b51c0(0x189)](_0x473eb9),_0x2c3a05=JSON[_0x2b51c0(0x179)](_0x4eae34);if(_0x2c3a05[_0x2b51c0(0x175)]&&typeof _0x2c3a05[_0x2b51c0(0x175)]===_0x2b51c0(0x168))return{'configPath':_0x473eb9,'configDir':_0x18d438,'parentSegment':_0x2c3a05[_0x2b51c0(0x175)]};}catch{}_0x18d438=a121_0x210f18['dirname'](_0x18d438);}return null;}function calculateScopedPath(_0x15d92d,_0x38eb46){const _0x75e048=a121_0x3c6c,_0xa3d2bc=a121_0x210f18[_0x75e048(0x181)](_0x38eb46,_0x15d92d),_0x4dbc71=_0xa3d2bc!==''&&_0xa3d2bc!=='.'&&!_0xa3d2bc[_0x75e048(0x194)]('..');return{'isScoped':_0x4dbc71,'scopedFolderPath':_0x4dbc71?_0xa3d2bc[_0x75e048(0x192)](/\\/g,'/'):''};}export async function resolveTarget(_0x3e4f29){const _0x5791a1=a121_0x3c6c,{arg:_0x3f8c5f,contextParent:_0x5bc7fd,cwd:cwd=process[_0x5791a1(0x16c)](),fs:fs=nodeFileSystem}=_0x3e4f29;if(_0x3f8c5f&&isYamlFilePath(_0x3f8c5f))try{const _0xc50a4d=await resolveYamlFilePath(_0x3f8c5f,fs),_0x585fc5=a121_0x210f18['resolve'](_0x3f8c5f),_0x4567df=a121_0x210f18['dirname'](_0x585fc5),_0x20d360=await findTdxConfigAsync(_0x4567df,fs);if(!_0x20d360){if(_0x5bc7fd){const _0x15398f=a121_0x210f18[_0x5791a1(0x187)](_0x585fc5);return{'type':_0x5791a1(0x173),'parentName':_0x5bc7fd,'targetDir':_0x15398f,'configRoot':_0x15398f,'filePath':_0x585fc5,'resourceName':_0xc50a4d[_0x5791a1(0x167)],'folderPath':_0xc50a4d[_0x5791a1(0x16d)],'resourceType':_0xc50a4d[_0x5791a1(0x170)],'isScoped':![],'scopedFolderPath':''};}return{'type':_0x5791a1(0x191),'errorCode':_0x5791a1(0x16a),'message':_0x5791a1(0x16b)+_0x3f8c5f,'arg':_0x3f8c5f,'helpText':_0x5791a1(0x184)};}const _0x38f701=calculateScopedPath(_0x4567df,_0x20d360[_0x5791a1(0x18d)]);return{'type':_0x5791a1(0x173),'parentName':_0x20d360[_0x5791a1(0x176)],'targetDir':_0x20d360['configDir'],'configRoot':_0x20d360[_0x5791a1(0x18d)],'filePath':_0x585fc5,'resourceName':_0xc50a4d[_0x5791a1(0x167)],'folderPath':_0xc50a4d[_0x5791a1(0x16d)],'resourceType':_0xc50a4d['resourceType'],'isScoped':_0x38f701[_0x5791a1(0x178)],'scopedFolderPath':_0x38f701[_0x5791a1(0x182)]};}catch(_0x4fa6c6){const _0x31ee3a=_0x4fa6c6 instanceof Error?_0x4fa6c6[_0x5791a1(0x164)]:String(_0x4fa6c6);if(_0x31ee3a['includes'](_0x5791a1(0x196)))return{'type':_0x5791a1(0x191),'errorCode':_0x5791a1(0x190),'message':_0x5791a1(0x197)+_0x3f8c5f,'arg':_0x3f8c5f};if(_0x31ee3a['includes'](_0x5791a1(0x18a))){if(_0x5bc7fd){const _0x4e721e=a121_0x210f18[_0x5791a1(0x198)](_0x3f8c5f);if(await fs['exists'](_0x4e721e)){const _0x35f72f=a121_0x210f18[_0x5791a1(0x187)](_0x4e721e),_0x5ec236=await fs[_0x5791a1(0x189)](_0x4e721e),_0x1ccbcb=_0x5ec236[_0x5791a1(0x199)](/^name:\s*["']?([^"'\n]+)["']?/m),_0x4000f7=_0x5ec236['match'](/^type:\s*["']?([^"'\n]+)["']?/m),_0x4f16ea=_0x1ccbcb?_0x1ccbcb[0x1][_0x5791a1(0x18f)]():a121_0x210f18[_0x5791a1(0x193)](_0x3f8c5f,a121_0x210f18['extname'](_0x3f8c5f)),_0x5beb3=_0x4000f7&&_0x4000f7[0x1][_0x5791a1(0x18f)]()===_0x5791a1(0x163)?_0x5791a1(0x163):_0x5791a1(0x16f);return{'type':_0x5791a1(0x173),'parentName':_0x5bc7fd,'targetDir':_0x35f72f,'configRoot':_0x35f72f,'filePath':_0x4e721e,'resourceName':_0x4f16ea,'folderPath':'','resourceType':_0x5beb3,'isScoped':![],'scopedFolderPath':''};}}return{'type':_0x5791a1(0x191),'errorCode':_0x5791a1(0x16a),'message':_0x5791a1(0x16b)+_0x3f8c5f,'arg':_0x3f8c5f,'helpText':'Tip:\x20Run\x20\x27tdx\x20sg\x20pull\x20<parent_name>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure\x0a\x20\x20Or\x20set\x20context:\x20\x27tdx\x20sg\x20use\x20<parent_name>\x27'};}return{'type':_0x5791a1(0x191),'errorCode':_0x5791a1(0x183),'message':_0x31ee3a,'arg':_0x3f8c5f};}if(_0x3f8c5f){const _0x46b152=a121_0x210f18['resolve'](cwd,_0x3f8c5f);let _0x5656e5=null;try{_0x5656e5=await fs[_0x5791a1(0x195)](_0x46b152);}catch{}if(_0x5656e5?.[_0x5791a1(0x18e)]()){const _0x24d88d=await findTdxConfigAsync(_0x46b152,fs);if(_0x24d88d){const _0x578107=calculateScopedPath(_0x46b152,_0x24d88d[_0x5791a1(0x18d)]);return{'type':'directory','parentName':_0x24d88d[_0x5791a1(0x176)],'targetDir':_0x46b152,'configRoot':_0x24d88d[_0x5791a1(0x18d)],'isScoped':_0x578107['isScoped'],'scopedFolderPath':_0x578107[_0x5791a1(0x182)]};}if(_0x5bc7fd)return{'type':'directory','parentName':_0x5bc7fd,'targetDir':_0x46b152,'configRoot':_0x46b152,'isScoped':![],'scopedFolderPath':''};return{'type':_0x5791a1(0x191),'errorCode':_0x5791a1(0x16a),'message':_0x5791a1(0x185)+_0x3f8c5f,'arg':_0x3f8c5f,'helpText':_0x5791a1(0x184)};}if(_0x5656e5?.[_0x5791a1(0x17c)]())return{'type':_0x5791a1(0x191),'errorCode':_0x5791a1(0x183),'message':_0x5791a1(0x161)+_0x3f8c5f,'arg':_0x3f8c5f,'helpText':_0x5791a1(0x17a)};const _0x505ed7=sanitizeFileName(_0x3f8c5f),_0x21ca5c=getSegmentRootDir(_0x505ed7,cwd);return{'type':_0x5791a1(0x165),'parentName':_0x3f8c5f,'targetDir':_0x21ca5c,'configRoot':_0x21ca5c};}const _0x1b7e55=await findTdxConfigAsync(cwd,fs);if(_0x1b7e55){const _0x6b1ea8=calculateScopedPath(cwd,_0x1b7e55['configDir']);return{'type':_0x5791a1(0x17e),'parentName':_0x1b7e55['parentSegment'],'targetDir':cwd,'configRoot':_0x1b7e55['configDir'],'isScoped':_0x6b1ea8[_0x5791a1(0x178)],'scopedFolderPath':_0x6b1ea8[_0x5791a1(0x182)]};}if(_0x5bc7fd){const _0xcaf23a=sanitizeFileName(_0x5bc7fd),_0x9c8701=getSegmentRootDir(_0xcaf23a,cwd);return{'type':_0x5791a1(0x17e),'parentName':_0x5bc7fd,'targetDir':_0x9c8701,'configRoot':_0x9c8701,'isScoped':![],'scopedFolderPath':''};}return{'type':'error','errorCode':_0x5791a1(0x171),'message':_0x5791a1(0x18c),'helpText':_0x5791a1(0x186)};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a122_0x425a78=a122_0x42b3;(function(_0x24bead,_0x59548c){const _0x31b75e=a122_0x42b3,_0x23f1cb=_0x24bead();while(!![]){try{const _0x25efe0=-parseInt(_0x31b75e(0x179))/0x1+parseInt(_0x31b75e(0x172))/0x2+-parseInt(_0x31b75e(0x17b))/0x3+-parseInt(_0x31b75e(0x189))/0x4*(parseInt(_0x31b75e(0x184))/0x5)+-parseInt(_0x31b75e(0x17e))/0x6*(parseInt(_0x31b75e(0x17d))/0x7)+parseInt(_0x31b75e(0x176))/0x8+parseInt(_0x31b75e(0x182))/0x9;if(_0x25efe0===_0x59548c)break;else _0x23f1cb['push'](_0x23f1cb['shift']());}catch(_0x3f8f76){_0x23f1cb['push'](_0x23f1cb['shift']());}}}(a122_0x4778,0xac5ab));import{existsSync,readFileSync}from'fs';import a122_0x2acaa8 from'path';const TDX_CONFIG_FILE='tdx.json',SEGMENTS_DIR=a122_0x425a78(0x187);export function findTdxConfigPath(_0xbf2850=process[a122_0x425a78(0x183)]()){const _0x878e5d=a122_0x425a78;let _0x2e5a56=a122_0x2acaa8[_0x878e5d(0x188)](_0xbf2850);const _0x56b693=a122_0x2acaa8[_0x878e5d(0x170)](_0x2e5a56)[_0x878e5d(0x180)];while(_0x2e5a56!==_0x56b693){const _0x2b55b4=a122_0x2acaa8[_0x878e5d(0x17f)](_0x2e5a56,TDX_CONFIG_FILE);if(existsSync(_0x2b55b4))return _0x2b55b4;_0x2e5a56=a122_0x2acaa8[_0x878e5d(0x181)](_0x2e5a56);}return null;}export function loadTdxConfig(_0x3479b4){const _0x14a98e=a122_0x425a78,_0x2c668f=readFileSync(_0x3479b4,_0x14a98e(0x177));let _0x177a85;try{_0x177a85=JSON[_0x14a98e(0x170)](_0x2c668f);}catch{throw new Error(_0x14a98e(0x173)+_0x3479b4);}if(!_0x177a85||typeof _0x177a85!=='object')throw new Error(_0x14a98e(0x17a));const _0x323565=_0x177a85;if(!_0x323565['parent_segment']||typeof _0x323565[_0x14a98e(0x185)]!==_0x14a98e(0x174))throw new Error(_0x14a98e(0x175));return{'parent_segment':_0x323565['parent_segment']};}export function findTdxConfig(_0x190724=process[a122_0x425a78(0x183)]()){const _0x5b8b6c=a122_0x425a78,_0x9c2fe4=findTdxConfigPath(_0x190724);if(!_0x9c2fe4)throw new Error(_0x5b8b6c(0x186));const _0x38104b=loadTdxConfig(_0x9c2fe4),_0x56a673=a122_0x2acaa8[_0x5b8b6c(0x181)](_0x9c2fe4);return{'config':_0x38104b,'configPath':_0x9c2fe4,'configDir':_0x56a673};}export function tryFindTdxConfig(_0x2c35b3){try{return findTdxConfig(_0x2c35b3);}catch{return null;}}export function getSegmentRootDir(_0x219f52,_0x3b6908=process['cwd']()){const _0x4028f7=a122_0x425a78;return a122_0x2acaa8[_0x4028f7(0x17f)](_0x3b6908,SEGMENTS_DIR,_0x219f52);}function a122_0x42b3(_0x212bfc,_0x3e729d){_0x212bfc=_0x212bfc-0x170;const _0x4778c6=a122_0x4778();let _0x42b3c6=_0x4778c6[_0x212bfc];return _0x42b3c6;}export function getTdxConfigPath(_0x4d386,_0x4f1f6a=process['cwd']()){const _0x293efb=a122_0x425a78;return a122_0x2acaa8[_0x293efb(0x17f)](getSegmentRootDir(_0x4d386,_0x4f1f6a),TDX_CONFIG_FILE);}export function getRelativePathFromConfig(_0x5ea6f3,_0x285940){const _0x5965ac=a122_0x425a78,_0x2961b2=a122_0x2acaa8['resolve'](_0x5ea6f3),_0x265c84=a122_0x2acaa8[_0x5965ac(0x178)](_0x285940,_0x2961b2);if(_0x265c84[_0x5965ac(0x171)]('..'))return'';return _0x265c84;}export function localPathToTdFolderPath(_0x5e458a){const _0x24b69c=a122_0x425a78,_0x49d7f6=a122_0x2acaa8[_0x24b69c(0x181)](_0x5e458a);if(_0x49d7f6==='.'||_0x49d7f6==='')return'';return _0x49d7f6[_0x24b69c(0x17c)](/\\/g,'/');}export function tdFolderPathToLocalPath(_0x31485c,_0x401c44){const _0x53fccf=a122_0x425a78;if(!_0x31485c)return _0x401c44;return a122_0x2acaa8[_0x53fccf(0x17f)](_0x401c44,_0x31485c);}export function createTdxConfigContent(_0x5d9059){const _0x296278={'parent_segment':_0x5d9059};return JSON['stringify'](_0x296278,null,0x2)+'\x0a';}function a122_0x4778(){const _0x7a71f9=['1318982DeseLQ','Invalid\x20tdx.json:\x20expected\x20object','1888944CpwFNv','replace','14UTtChV','2926524sQBEZj','join','root','dirname','22562064vBLoBp','cwd','5514155QPtYqi','parent_segment','No\x20tdx.json\x20found.\x20Please\x20run\x20\x27tdx\x20sg\x20pull\x20<parent_segment>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure.','segments','resolve','4sISmAn','parse','startsWith','2161298WpuTRG','Invalid\x20JSON\x20in\x20','string','Invalid\x20tdx.json:\x20missing\x20or\x20invalid\x20\x27parent_segment\x27\x20field','9163096YgTwKF','utf-8','relative'];a122_0x4778=function(){return _0x7a71f9;};return a122_0x4778();}
|