@treasuredata/tdx 2026.7.3 → 2026.7.5
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/cas-command.d.ts.map +1 -1
- package/dist/commands/cas-command.js +1 -1
- package/dist/commands/cas-command.js.map +1 -1
- package/dist/commands/cas-segment-command.js +1 -1
- package/dist/commands/chat-command.js +1 -1
- package/dist/commands/claude-command.d.ts +67 -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/delivery-command.js +1 -1
- package/dist/commands/describe.d.ts +11 -0
- package/dist/commands/describe.d.ts.map +1 -1
- package/dist/commands/describe.js +1 -1
- package/dist/commands/describe.js.map +1 -1
- package/dist/commands/engage-campaign-pull-command.js +1 -1
- package/dist/commands/engage-campaign-push-command.js +1 -1
- package/dist/commands/engage-campaign-validate-command.js +1 -1
- package/dist/commands/engage-command.js +1 -1
- package/dist/commands/engage-template-pull-command.js +1 -1
- package/dist/commands/engage-template-push-command.js +1 -1
- package/dist/commands/engage-template-validate-command.js +1 -1
- package/dist/commands/job-command.d.ts.map +1 -1
- package/dist/commands/job-command.js +1 -1
- package/dist/commands/job-command.js.map +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.map +1 -1
- package/dist/commands/llm-command.js +1 -1
- package/dist/commands/llm-command.js.map +1 -1
- package/dist/commands/mcp-command.js +1 -1
- package/dist/commands/parent-segment-command.js +1 -1
- package/dist/commands/policy-command.js +1 -1
- package/dist/commands/profile-command.js +1 -1
- package/dist/commands/profiles-command.js +1 -1
- package/dist/commands/query-command.js +1 -1
- package/dist/commands/schedule-command.js +1 -1
- package/dist/commands/segment-command.js +1 -1
- package/dist/commands/segment-create-command.js +1 -1
- package/dist/commands/segment-fields-command.js +1 -1
- package/dist/commands/segment-move-command.js +1 -1
- package/dist/commands/segment-pull-command.js +1 -1
- package/dist/commands/segment-push-command.js +1 -1
- package/dist/commands/segment-update-command.js +1 -1
- package/dist/commands/segment-use-command.js +1 -1
- package/dist/commands/segment-validate-command.js +1 -1
- package/dist/commands/segments.js +1 -1
- package/dist/commands/show.js +1 -1
- package/dist/commands/status-command.js +1 -1
- package/dist/commands/table-deleted.js +1 -1
- package/dist/commands/tables.js +1 -1
- package/dist/commands/unset-command.js +1 -1
- package/dist/commands/upgrade-command.js +1 -1
- package/dist/commands/use-command.js +1 -1
- package/dist/commands/user-command.js +1 -1
- package/dist/commands/work-command.js +1 -1
- package/dist/commands/workflow-command.d.ts.map +1 -1
- package/dist/commands/workflow-command.js +1 -1
- package/dist/commands/workflow-command.js.map +1 -1
- package/dist/core/auth.js +1 -1
- package/dist/core/command-output.js +1 -1
- package/dist/core/config.js +1 -1
- package/dist/core/connection-cache.js +1 -1
- package/dist/core/constants.js +1 -1
- package/dist/core/credential-cache.js +1 -1
- package/dist/core/global-context.js +1 -1
- package/dist/core/keychain.js +1 -1
- package/dist/core/oauth-keychain.js +1 -1
- package/dist/core/oauth.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/tools/work-create-item.js +1 -1
- package/dist/mcp/utils.js +1 -1
- package/dist/proxy/claude-usage-tracker.js +1 -1
- package/dist/proxy/passthrough-server.js +1 -1
- package/dist/proxy/sse-usage-parser.js +1 -1
- package/dist/sdk/agent/agent-config.js +1 -1
- package/dist/sdk/agent/agent-ref-parser.js +1 -1
- package/dist/sdk/agent/agent-yaml.js +1 -1
- package/dist/sdk/agent/test/evaluator.js +1 -1
- package/dist/sdk/agent/test/executor.js +1 -1
- package/dist/sdk/agent/test/index.js +1 -1
- package/dist/sdk/agent/test/output.js +1 -1
- package/dist/sdk/agent/test/parser.js +1 -1
- package/dist/sdk/agent/tool-target-registry.js +1 -1
- package/dist/sdk/api.js +1 -1
- package/dist/sdk/cas/cas-api-client.d.ts.map +1 -1
- package/dist/sdk/cas/cas-api-client.js +1 -1
- package/dist/sdk/cas/cas-api-client.js.map +1 -1
- package/dist/sdk/cas/cas-audience-schema.d.ts +15 -3
- package/dist/sdk/cas/cas-audience-schema.d.ts.map +1 -1
- package/dist/sdk/cas/cas-audience-schema.js +1 -1
- package/dist/sdk/cas/cas-audience-schema.js.map +1 -1
- package/dist/sdk/cas/cas-audience-validator.js +1 -1
- package/dist/sdk/cas/cas-audience-validator.js.map +1 -1
- package/dist/sdk/cas/cas-audience-yaml.d.ts +8 -0
- package/dist/sdk/cas/cas-audience-yaml.d.ts.map +1 -1
- package/dist/sdk/cas/cas-audience-yaml.js +1 -1
- package/dist/sdk/cas/cas-audience-yaml.js.map +1 -1
- package/dist/sdk/cas/cas-segment-yaml.js +1 -1
- package/dist/sdk/cas/index.js +1 -1
- package/dist/sdk/cas/pull-workflow.js +1 -1
- package/dist/sdk/cas/push-workflow.d.ts +47 -1
- package/dist/sdk/cas/push-workflow.d.ts.map +1 -1
- package/dist/sdk/cas/push-workflow.js +1 -1
- package/dist/sdk/cas/push-workflow.js.map +1 -1
- package/dist/sdk/cas/validate-files.js +1 -1
- package/dist/sdk/client/cdp-api-client.d.ts.map +1 -1
- package/dist/sdk/client/cdp-api-client.js +1 -1
- package/dist/sdk/client/cdp-api-client.js.map +1 -1
- package/dist/sdk/client/delivery-api-client.js +1 -1
- package/dist/sdk/client/endpoints.js +1 -1
- package/dist/sdk/client/engage-api-client.d.ts +6 -6
- package/dist/sdk/client/engage-api-client.js +1 -1
- package/dist/sdk/client/engage-api-client.js.map +1 -1
- package/dist/sdk/client/http-client.js +1 -1
- package/dist/sdk/client/llm-api-client.js +1 -1
- package/dist/sdk/client/oauth-refresh.js +1 -1
- package/dist/sdk/client/rate-limiter.js +1 -1
- package/dist/sdk/client/td-api-client.js +1 -1
- package/dist/sdk/client/trino-api-client.js +1 -1
- package/dist/sdk/client/workflow-client.js +1 -1
- package/dist/sdk/connection-validator.js +1 -1
- package/dist/sdk/connection.js +1 -1
- package/dist/sdk/delivery.js +1 -1
- package/dist/sdk/engage/campaign-pull.js +1 -1
- package/dist/sdk/engage/campaign-push.js +1 -1
- package/dist/sdk/engage/campaign-validator.js +1 -1
- package/dist/sdk/engage/campaign-yaml.js +1 -1
- package/dist/sdk/engage/template-pull.js +1 -1
- package/dist/sdk/engage/template-push.js +1 -1
- package/dist/sdk/engage/template-validator.js +1 -1
- package/dist/sdk/engage/template-yaml.js +1 -1
- package/dist/sdk/engage/types/campaign-def.js +1 -1
- package/dist/sdk/engage/types/campaign-schema.js +1 -1
- package/dist/sdk/engage/types/template-schema.js +1 -1
- package/dist/sdk/engage.js +1 -1
- package/dist/sdk/errors.js +1 -1
- package/dist/sdk/index.js +1 -1
- package/dist/sdk/io/index.js +1 -1
- package/dist/sdk/io/node-filesystem.js +1 -1
- package/dist/sdk/job.js +1 -1
- package/dist/sdk/journey.js +1 -1
- package/dist/sdk/llm/chat-cache.js +1 -1
- package/dist/sdk/llm/index.js +1 -1
- package/dist/sdk/llm/llm-backup-utils.js +1 -1
- package/dist/sdk/llm/model-factors.d.ts.map +1 -1
- package/dist/sdk/llm/model-factors.js +1 -1
- package/dist/sdk/llm/model-factors.js.map +1 -1
- package/dist/sdk/llm/user-settings.js +1 -1
- package/dist/sdk/personalization.js +1 -1
- package/dist/sdk/policy.js +1 -1
- package/dist/sdk/query/deleted-table-validation.js +1 -1
- package/dist/sdk/query/index.d.ts +9 -1
- package/dist/sdk/query/index.d.ts.map +1 -1
- package/dist/sdk/query/index.js +1 -1
- package/dist/sdk/query/index.js.map +1 -1
- package/dist/sdk/query/sql-parser.js +1 -1
- package/dist/sdk/realtime.js +1 -1
- package/dist/sdk/schedule.js +1 -1
- package/dist/sdk/segment/child-segment-yaml.js +1 -1
- package/dist/sdk/segment/fields-display.js +1 -1
- package/dist/sdk/segment/file-discovery.js +1 -1
- package/dist/sdk/segment/journey-utils.js +1 -1
- package/dist/sdk/segment/journey-validator.js +1 -1
- package/dist/sdk/segment/journey-yaml.d.ts.map +1 -1
- package/dist/sdk/segment/journey-yaml.js +1 -1
- package/dist/sdk/segment/journey-yaml.js.map +1 -1
- package/dist/sdk/segment/parent-segment-preview.js +1 -1
- package/dist/sdk/segment/parent-segment-yaml.d.ts.map +1 -1
- package/dist/sdk/segment/parent-segment-yaml.js +1 -1
- package/dist/sdk/segment/parent-segment-yaml.js.map +1 -1
- package/dist/sdk/segment/pull-workflow.js +1 -1
- package/dist/sdk/segment/push-recovery.js +1 -1
- package/dist/sdk/segment/push-workflow.js +1 -1
- package/dist/sdk/segment/resolution-context.js +1 -1
- package/dist/sdk/segment/segment-path-parser.js +1 -1
- package/dist/sdk/segment/segment-ref-parser.js +1 -1
- package/dist/sdk/segment/segment-validator.js +1 -1
- package/dist/sdk/segment/target-resolution.d.ts.map +1 -1
- package/dist/sdk/segment/target-resolution.js +1 -1
- package/dist/sdk/segment/target-resolution.js.map +1 -1
- package/dist/sdk/segment/tdx-config.js +1 -1
- package/dist/sdk/segment/types/activation-schema.js +1 -1
- package/dist/sdk/segment/types/journey-def.d.ts.map +1 -1
- package/dist/sdk/segment/types/journey-def.js +1 -1
- package/dist/sdk/segment/types/journey-schema.js +1 -1
- package/dist/sdk/segment/types/parent-segment-def.d.ts.map +1 -1
- package/dist/sdk/segment/types/segment-def.js +1 -1
- package/dist/sdk/segment/types/segment-schema.js +1 -1
- package/dist/sdk/segment/validate-files.js +1 -1
- package/dist/sdk/segment/yaml-validator.js +1 -1
- package/dist/sdk/segment.js +1 -1
- package/dist/sdk/types/cas.d.ts +5 -0
- package/dist/sdk/types/cas.d.ts.map +1 -1
- package/dist/sdk/types/cdp.d.ts.map +1 -1
- package/dist/sdk/types/engage.d.ts.map +1 -1
- package/dist/sdk/types/index.js +1 -1
- package/dist/sdk/types/llm.d.ts.map +1 -1
- package/dist/sdk/types/progress.js +1 -1
- package/dist/sdk/types/workspace.d.ts.map +1 -1
- package/dist/sdk/types/workspace.js +1 -1
- package/dist/sdk/types/workspace.js.map +1 -1
- package/dist/sdk/user.js +1 -1
- package/dist/sdk/util/format-detector.js +1 -1
- package/dist/sdk/util/formatters.js +1 -1
- package/dist/sdk/util/index.js +1 -1
- package/dist/sdk/util/paginate.js +1 -1
- package/dist/sdk/util/tree-formatter.js +1 -1
- package/dist/sdk/util/tree-search.js +1 -1
- package/dist/sdk/workflow/archive-validation.js +1 -1
- package/dist/sdk/workflow/clone-workflow.js +1 -1
- package/dist/sdk/workflow/index.js +1 -1
- package/dist/sdk/workflow/pull-workflow.js +1 -1
- package/dist/sdk/workflow/push-workflow.js +1 -1
- package/dist/sdk/workflow/task-graph.js +1 -1
- package/dist/sdk/workflow/tdx-config.js +1 -1
- package/dist/sdk/workflow/workflow-utils.js +1 -1
- package/dist/sdk/workspace/access-tracker.js +1 -1
- package/dist/sdk/workspace/frontmatter.js +1 -1
- package/dist/sdk/workspace/git.js +1 -1
- package/dist/sdk/workspace/index.js +1 -1
- package/dist/sdk/workspace/templates.js +1 -1
- package/dist/sdk/workspace/weekly.js +1 -1
- package/dist/sdk/workspace/wikilinks.js +1 -1
- package/dist/test-utils/command-runner.js +1 -1
- package/dist/test-utils/factories.js +1 -1
- package/dist/test-utils/fixtures.js +1 -1
- package/dist/test-utils/http-mock.js +1 -1
- package/dist/test-utils/index.js +1 -1
- package/dist/utils/async.js +1 -1
- package/dist/utils/claude-code-state.d.ts +33 -0
- package/dist/utils/claude-code-state.d.ts.map +1 -0
- package/dist/utils/claude-code-state.js +1 -0
- package/dist/utils/claude-code-state.js.map +1 -0
- package/dist/utils/colors.js +1 -1
- package/dist/utils/diff.js +1 -1
- package/dist/utils/file-permissions.js +1 -1
- package/dist/utils/file-reader.js +1 -1
- package/dist/utils/github-releases.js +1 -1
- package/dist/utils/global-cache.js +1 -1
- package/dist/utils/json-loader.js +1 -1
- package/dist/utils/local-cache.js +1 -1
- package/dist/utils/logger/formatters/default-formatter.js +1 -1
- package/dist/utils/logger/formatters/index.js +1 -1
- package/dist/utils/logger/handlers/console-handler.js +1 -1
- package/dist/utils/logger/handlers/file-handler.js +1 -1
- package/dist/utils/logger/handlers/index.js +1 -1
- package/dist/utils/logger/handlers/null-handler.js +1 -1
- package/dist/utils/logger/index.js +1 -1
- package/dist/utils/logger/logger.js +1 -1
- package/dist/utils/logger/types.js +1 -1
- package/dist/utils/option-validation.js +1 -1
- package/dist/utils/process.js +1 -1
- package/dist/utils/prompt.js +1 -1
- package/dist/utils/proxy-fetch.js +1 -1
- package/dist/utils/proxy-fetch.js.map +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 +18 -10
|
@@ -1 +1 @@
|
|
|
1
|
-
function a157_0x18a4(_0x417943,_0x5b18ad){_0x417943=_0x417943-0xa1;const _0xc644=a157_0xc644();let _0x18a493=_0xc644[_0x417943];return _0x18a493;}(function(_0x158a04,_0x140c38){const _0x1d8f49=a157_0x18a4,_0xebb901=_0x158a04();while(!![]){try{const _0x5a1c0e=parseInt(_0x1d8f49(0xe2))/0x1+-parseInt(_0x1d8f49(0xd5))/0x2*(-parseInt(_0x1d8f49(0xb0))/0x3)+parseInt(_0x1d8f49(0xe9))/0x4*(parseInt(_0x1d8f49(0xbe))/0x5)+parseInt(_0x1d8f49(0xd0))/0x6*(parseInt(_0x1d8f49(0xce))/0x7)+-parseInt(_0x1d8f49(0xbf))/0x8+parseInt(_0x1d8f49(0xb9))/0x9+parseInt(_0x1d8f49(0xac))/0xa;if(_0x5a1c0e===_0x140c38)break;else _0xebb901['push'](_0xebb901['shift']());}catch(_0x48a38a){_0xebb901['push'](_0xebb901['shift']());}}}(a157_0xc644,0xd436e));import a157_0x1dc051 from'path';import{existsSync,readFileSync}from'fs';import{generateDiff,formatDiffWithColors,hasChanges}from'../../utils/diff.js';import{sanitizeFileName}from'../../utils/string-utils.js';import{batchAsync}from'../../utils/async.js';import{buildFolderIdToPathMap}from'./resolution-context.js';import{segmentWithActivationsToYaml,segmentToYamlString,segmentResponseToDef,journeyActivationStepToYaml}from'./child-segment-yaml.js';import{journeyResponseToDef,toYamlString as a157_0x1e4119,normalizeJourneyDef,parseYamlString as a157_0x2bc811}from'./journey-yaml.js';function a157_0xc644(){const _0x3d1852=['segmentFolderId','createdAt','Fetching\x20activations','308474RmfEpE','state','Resolving\x20parent\x20segment','Fetching\x20segments,\x20folders,\x20and\x20journeys','push','join','reduce','journey','journeyBundleName','toLowerCase','getSegment','updatedAt','getJourney','1124736WeekNY','Processing\x20segments','audienceId','map','set','isNew','\x20not\x20found\x20in\x20pre-fetched\x20data,\x20skipping','1060tdMYaJ','activation_','Processing\x20journey:\x20','slice','kind','name','Fetching\x20parent\x20segment\x20info','segments/','utf-8','listSegments','all','data','2700130abyYSj','length','versionNumber','getActivation','3XrjuHX','attributes','user','values','Warning:\x20Journey\x20','sort','description','add','listFolders','3646782IwMEZX','targetResourceName','from','folderId','paused','975JeSqIB','10866632GGncJo','rule','getParent','getLatestJourneyId','get','tdx.json','hasChanges','relative','filter','buildIdToEmailMap','.yml','listActivations','size','segment','listJourneysWithDetailsFromParentSegment','775950ICNedm','journeyBundleId','12WIVHac','update'];a157_0xc644=function(){return _0x3d1852;};return a157_0xc644();}import{SEGMENT_KIND_JOURNEY,generateJourneyLocalName,sanitizeYamlKey,buildMergedJourneyDef,buildLocalRuleToNameMappingFromJourney,createJumpTargetCache,resolveJumpTarget}from'./journey-utils.js';import{createTdxConfigContent}from'./tdx-config.js';function prepareFile(_0x2fa1f6,_0x14a0db,_0x132d62){const _0x579743=a157_0x18a4,_0x5ef3e7=a157_0x1dc051[_0x579743(0xc6)](_0x132d62,_0x2fa1f6);if(existsSync(_0x2fa1f6)){const _0x5c06e7=readFileSync(_0x2fa1f6,_0x579743(0xa8)),_0x140fb1=generateDiff(_0x5c06e7,_0x14a0db),_0x932c4d=hasChanges(_0x140fb1);return{'relativePath':_0x5ef3e7,'absolutePath':_0x2fa1f6,'content':_0x14a0db,'isNew':![],'hasChanges':_0x932c4d,'diff':_0x932c4d?formatDiffWithColors(_0x140fb1):undefined};}return{'relativePath':_0x5ef3e7,'absolutePath':_0x2fa1f6,'content':_0x14a0db,'isNew':!![],'hasChanges':![]};}function getUniqueFileName(_0x9dd03b,_0x2a3c35,_0x2e0a84){const _0x846556=a157_0x18a4,_0x592a55=_0x9dd03b+':'+_0x2a3c35,_0x13f4e1=_0x2e0a84[_0x846556(0xc3)](_0x592a55)||0x0;_0x2e0a84[_0x846556(0xe6)](_0x592a55,_0x13f4e1+0x1);if(_0x13f4e1===0x0)return _0x2a3c35;return _0x2a3c35+'_'+(_0x13f4e1+0x1);}export async function pullSegments(_0x26032d,_0x5c44ac,_0x796bdf={}){const _0x111516=a157_0x18a4,{targetDir:_0x22ce47,progress:_0x34ebd2}=_0x796bdf;_0x34ebd2?.[_0x111516(0xd1)](_0x111516(0xd7));const _0x2b4264=await _0x26032d[_0x111516(0xcc)]['resolveParentId'](_0x5c44ac);_0x34ebd2?.[_0x111516(0xd1)](_0x111516(0xa6));const _0x268d66=await _0x26032d[_0x111516(0xcc)][_0x111516(0xc1)](_0x2b4264),_0x409f6e=_0x268d66[_0x111516(0xb1)][_0x111516(0xa5)];_0x34ebd2?.[_0x111516(0xd1)](_0x111516(0xd8));const [_0xffa570,_0x3c0dc1,_0xc38816]=await Promise[_0x111516(0xaa)]([_0x26032d[_0x111516(0xcc)][_0x111516(0xa9)](_0x2b4264),_0x26032d['segment'][_0x111516(0xb8)](_0x2b4264),_0x26032d[_0x111516(0xdc)][_0x111516(0xcd)](_0x2b4264,{'includeAllVersions':!![]})]),{journeys:_0x4ffb17,activationStepsById:_0x4c7dff}=_0xc38816,_0x598260=new Map();for(const _0x481dae of _0x4ffb17){_0x598260[_0x111516(0xe6)](_0x481dae['id'],_0x481dae);}const _0x427279=_0x4ffb17['map'](_0x559443=>({'id':_0x559443['id'],'name':_0x559443['attributes'][_0x111516(0xa5)],'journeyBundleName':_0x559443[_0x111516(0xb1)][_0x111516(0xdd)]||'','journeyBundleId':_0x559443[_0x111516(0xb1)][_0x111516(0xcf)]||'','versionNumber':_0x559443['attributes'][_0x111516(0xae)],'description':_0x559443[_0x111516(0xb1)][_0x111516(0xb6)],'state':_0x559443[_0x111516(0xb1)][_0x111516(0xd6)],'paused':_0x559443[_0x111516(0xb1)][_0x111516(0xbd)],'audienceId':_0x559443['attributes'][_0x111516(0xe4)],'folderId':_0x559443['relationships']?.['parentFolder']?.[_0x111516(0xab)]?.['id'],'createdAt':_0x559443[_0x111516(0xb1)][_0x111516(0xd3)],'updatedAt':_0x559443[_0x111516(0xb1)][_0x111516(0xe0)]})),_0x4bd2f3=buildFolderIdToPathMap(_0x3c0dc1),_0x311480=_0x22ce47||_0x111516(0xa7)+sanitizeFileName(_0x409f6e);_0x34ebd2?.[_0x111516(0xd1)](_0x111516(0xd4));const _0x357134=new Map();await batchAsync(_0xffa570,async _0x432dd1=>{const _0x261979=_0x111516,_0x36cdca=await _0x26032d['segment'][_0x261979(0xca)](_0x2b4264,_0x432dd1['id']);_0x357134['set'](_0x432dd1['id'],_0x36cdca);}),_0x34ebd2?.[_0x111516(0xd1)]('Fetching\x20users\x20and\x20connections');const [_0x4fc524,_0x512c61]=await Promise[_0x111516(0xaa)]([_0x26032d[_0x111516(0xb2)][_0x111516(0xc8)](),_0x26032d['connection']['buildIdToNameMap']()]),_0x5451fc=[],_0x178470=new Map(),_0x5d2904=a157_0x1dc051[_0x111516(0xda)](_0x311480,_0x111516(0xc4)),_0x3a680a=createTdxConfigContent(_0x409f6e);_0x5451fc[_0x111516(0xd9)](prepareFile(_0x5d2904,_0x3a680a,_0x311480));const _0x3be592=new Map();for(const _0x2fe690 of _0xffa570){_0x3be592[_0x111516(0xe6)](_0x2fe690['id'],_0x2fe690);}let _0x5d9e98=_0xffa570;if(_0x796bdf[_0x111516(0xba)]){const _0xcc5bc1=_0xffa570['filter'](_0x4c3ef9=>_0x4c3ef9[_0x111516(0xa5)]['toLowerCase']()===_0x796bdf[_0x111516(0xba)][_0x111516(0xde)]());_0xcc5bc1[_0x111516(0xad)]>0x0&&(_0x5d9e98=_0xcc5bc1);}_0x34ebd2?.[_0x111516(0xd1)](_0x111516(0xe3));for(const _0x26a2bb of _0x5d9e98){if(_0x26a2bb[_0x111516(0xa4)]===SEGMENT_KIND_JOURNEY)continue;const _0x17c34a=_0x26a2bb[_0x111516(0xd2)]?_0x4bd2f3[_0x111516(0xc3)](_0x26a2bb['segmentFolderId'])||'':'',_0x1eb31b=_0x357134['get'](_0x26a2bb['id'])||[],_0x2d0cc5=segmentWithActivationsToYaml(_0x26a2bb,_0x1eb31b,undefined,_0x4fc524,_0x512c61),_0x2d8f3b=_0x17c34a?a157_0x1dc051[_0x111516(0xda)](_0x311480,_0x17c34a):_0x311480,_0x4ec16d=sanitizeFileName(_0x26a2bb[_0x111516(0xa5)]),_0x4ec252=getUniqueFileName(_0x2d8f3b,_0x4ec16d,_0x178470),_0x4cd609=a157_0x1dc051[_0x111516(0xda)](_0x2d8f3b,_0x4ec252+_0x111516(0xc9)),_0x3cbdf0=segmentToYamlString(_0x2d0cc5);_0x5451fc[_0x111516(0xd9)](prepareFile(_0x4cd609,_0x3cbdf0,_0x311480));}const _0x2f6fd6=new Map();for(const _0x35dcb2 of _0x427279){const _0x359c91=_0x35dcb2[_0x111516(0xcf)];!_0x2f6fd6['has'](_0x359c91)&&_0x2f6fd6[_0x111516(0xe6)](_0x359c91,[]),_0x2f6fd6[_0x111516(0xc3)](_0x359c91)[_0x111516(0xd9)](_0x35dcb2);}for(const _0x31cd14 of _0x2f6fd6[_0x111516(0xb3)]()){_0x31cd14[_0x111516(0xb5)]((_0x5a44de,_0x40c7)=>(_0x5a44de[_0x111516(0xae)]||0x0)-(_0x40c7[_0x111516(0xae)]||0x0));}if(_0x796bdf[_0x111516(0xba)]){const _0x2536fb=new Map();for(const [_0x5cc252,_0x259e5d]of _0x2f6fd6){const _0x85204f=_0x259e5d[0x0][_0x111516(0xdd)];if(_0x85204f['toLowerCase']()===_0x796bdf[_0x111516(0xba)][_0x111516(0xde)]()){_0x2536fb[_0x111516(0xe6)](_0x5cc252,_0x259e5d);break;}}_0x2f6fd6['clear']();for(const [_0x2c7ddf,_0x56357b]of _0x2536fb){_0x2f6fd6[_0x111516(0xe6)](_0x2c7ddf,_0x56357b);}}if(_0x2f6fd6[_0x111516(0xcb)]>0x0){_0x34ebd2?.[_0x111516(0xd1)]('Processing\x20journeys');const _0x302a5c=Array[_0x111516(0xbb)](_0x2f6fd6[_0x111516(0xb3)]()),_0x25aeba=0x5,{createYamlContext:_0xf7b1b4}=createYamlContextForBundle(_0x26032d,_0x3be592,_0x4fc524,_0x512c61,_0x4c7dff,_0x598260);for(let _0x1ed03a=0x0;_0x1ed03a<_0x302a5c[_0x111516(0xad)];_0x1ed03a+=_0x25aeba){const _0x859470=_0x302a5c[_0x111516(0xa3)](_0x1ed03a,_0x1ed03a+_0x25aeba),_0xd6e7cb=await Promise[_0x111516(0xaa)](_0x859470[_0x111516(0xe5)](async _0x2afc3c=>{const _0x54845d=_0x111516,_0x457a70=_0x2afc3c[0x0],_0x1893a7=_0x457a70[_0x54845d(0xdd)];_0x34ebd2?.[_0x54845d(0xd1)](_0x54845d(0xa2)+_0x1893a7);const _0xc426b=_0x457a70[_0x54845d(0xbc)]?_0x4bd2f3[_0x54845d(0xc3)](_0x457a70[_0x54845d(0xbc)])||'':'',_0x272bb4=_0xc426b?a157_0x1dc051[_0x54845d(0xda)](_0x311480,_0xc426b):_0x311480,_0x3e9a6b=sanitizeFileName(_0x1893a7),_0x3a24ee=a157_0x1dc051['join'](_0x272bb4,_0x3e9a6b+'.yml');let _0x3f50c0;if(existsSync(_0x3a24ee))try{const _0x3e57ad=readFileSync(_0x3a24ee,_0x54845d(0xa8)),_0xe92f4c=a157_0x2bc811(_0x3e57ad);_0x3f50c0=buildLocalRuleToNameMappingFromJourney(_0xe92f4c);}catch{}const _0x48f92c=[];for(const _0xbb1680 of _0x2afc3c){const _0x24701c=_0x598260[_0x54845d(0xc3)](_0xbb1680['id']);if(!_0x24701c){_0x34ebd2?.['update'](_0x54845d(0xb4)+_0xbb1680['id']+_0x54845d(0xe8));continue;}const _0x15878a=_0x24701c[_0x54845d(0xb1)]?.[_0x54845d(0xe4)],_0x1febac=_0xf7b1b4(_0xbb1680['id'],_0x15878a),_0x227bc4=await journeyResponseToDef(_0x24701c,_0x1febac);_0x48f92c[_0x54845d(0xd9)]({'item':_0xbb1680,'yaml':_0x227bc4});}const _0x6b2478=await _0x26032d[_0x54845d(0xdc)][_0x54845d(0xc2)](_0x457a70[_0x54845d(0xcf)]),_0x3478e3=buildMergedJourneyDef(_0x48f92c,_0x3f50c0,_0x6b2478);return{'bundleName':_0x1893a7,'folderPath':_0xc426b,'finalYaml':_0x3478e3};}));for(const {bundleName:_0x2ce1e9,folderPath:_0x5a3357,finalYaml:_0x33d055}of _0xd6e7cb){const _0x315aa6=normalizeJourneyDef(_0x33d055),_0xedb914=a157_0x1e4119(_0x315aa6),_0x8c9cb9=_0x5a3357?a157_0x1dc051['join'](_0x311480,_0x5a3357):_0x311480,_0x1ca4fd=sanitizeFileName(_0x2ce1e9),_0x3bb886=getUniqueFileName(_0x8c9cb9,_0x1ca4fd,_0x178470),_0x4ba43e=a157_0x1dc051[_0x111516(0xda)](_0x8c9cb9,_0x3bb886+'.yml');_0x5451fc[_0x111516(0xd9)](prepareFile(_0x4ba43e,_0xedb914,_0x311480));}}}const _0x331935=Array['from'](_0x357134[_0x111516(0xb3)]())[_0x111516(0xdb)]((_0x1d3199,_0x41d88a)=>_0x1d3199+_0x41d88a[_0x111516(0xad)],0x0),_0x1c17f9=_0x5d9e98[_0x111516(0xc7)](_0x4a8f05=>_0x4a8f05['kind']!==SEGMENT_KIND_JOURNEY),_0x304a2b=_0x5451fc[_0x111516(0xc7)](_0x4df8a8=>_0x4df8a8[_0x111516(0xe7)])['length'],_0x52687f=_0x5451fc['filter'](_0x5b5697=>!_0x5b5697[_0x111516(0xe7)]&&_0x5b5697[_0x111516(0xc5)])[_0x111516(0xad)],_0x5376cd=_0x5451fc['filter'](_0x357cca=>!_0x357cca[_0x111516(0xe7)]&&!_0x357cca[_0x111516(0xc5)])[_0x111516(0xad)],_0x2c6179=Array[_0x111516(0xbb)](_0x2f6fd6[_0x111516(0xb3)]())[_0x111516(0xdb)]((_0x18ab23,_0x3ba684)=>_0x18ab23+_0x3ba684[_0x111516(0xad)],0x0);return{'parentName':_0x409f6e,'parentId':_0x2b4264,'targetDir':_0x311480,'files':_0x5451fc,'counts':{'segments':_0x1c17f9[_0x111516(0xad)],'journeys':_0x2f6fd6[_0x111516(0xcb)],'journeyVersions':_0x2c6179,'activations':_0x331935},'newFiles':_0x304a2b,'changedFiles':_0x52687f,'unchangedFiles':_0x5376cd};}function createYamlContextForBundle(_0x2c0168,_0x1a828a,_0x133208,_0x29031a,_0x24d0c9,_0x561c3b){const _0x93a82e=new Set(),_0xd7b8d7=new Map(),_0x342526=new Map(),_0x3ead8e=createJumpTargetCache(),_0x4d5ec8=async(_0x1b70e9,_0x287900)=>{const _0x1c9e01=a157_0x18a4,_0x391521=_0xd7b8d7[_0x1c9e01(0xc3)](_0x1b70e9);if(_0x391521!==undefined)return _0x391521;if(!_0x287900)return _0x1b70e9;try{let _0x4af925=_0x1a828a['get'](_0x1b70e9);!_0x4af925&&(_0x4af925=await _0x2c0168['segment'][_0x1c9e01(0xdf)](_0x287900,_0x1b70e9),_0x1a828a['set'](_0x1b70e9,_0x4af925));const _0x136da7=generateJourneyLocalName(_0x4af925['name']),_0x2716a6=_0x4af925[_0x1c9e01(0xa4)]===SEGMENT_KIND_JOURNEY&&_0x136da7!==undefined;if(_0x2716a6&&_0x136da7){let _0x593d30=_0x136da7,_0x5befcf=0x2;while(_0x93a82e['has'](_0x593d30)){_0x593d30=_0x136da7+'_'+_0x5befcf,_0x5befcf++;}return _0x93a82e[_0x1c9e01(0xb7)](_0x593d30),_0xd7b8d7[_0x1c9e01(0xe6)](_0x1b70e9,_0x593d30),_0x593d30;}return _0x4af925[_0x1c9e01(0xa5)];}catch{return _0x1b70e9;}},_0x35b23e=(_0x52b196,_0x47a73f)=>({'resolveSegment':async _0x41614b=>{const _0x236e8b=a157_0x18a4,_0x219143=_0xd7b8d7['get'](_0x41614b);if(_0x219143!==undefined)return{'name':_0x219143,'isJourneyLocal':!![]};if(!_0x47a73f)return{'name':_0x41614b,'isJourneyLocal':![]};try{let _0x2faa93=_0x1a828a[_0x236e8b(0xc3)](_0x41614b);!_0x2faa93&&(_0x2faa93=await _0x2c0168[_0x236e8b(0xcc)][_0x236e8b(0xdf)](_0x47a73f,_0x41614b),_0x1a828a[_0x236e8b(0xe6)](_0x41614b,_0x2faa93));const _0x2d53fd=generateJourneyLocalName(_0x2faa93[_0x236e8b(0xa5)]),_0x17e4c3=_0x2faa93['kind']===SEGMENT_KIND_JOURNEY&&_0x2d53fd!==undefined;if(_0x17e4c3&&!_0x2faa93[_0x236e8b(0xc0)]&&_0x47a73f)try{const _0x42bf8d=await _0x2c0168[_0x236e8b(0xcc)][_0x236e8b(0xdf)](_0x47a73f,_0x41614b);_0x1a828a[_0x236e8b(0xe6)](_0x41614b,_0x42bf8d),_0x2faa93=_0x42bf8d;}catch{}const _0x44d564=await _0x4d5ec8(_0x41614b,_0x47a73f);let _0x54a866;if(_0x17e4c3&&_0x2faa93[_0x236e8b(0xc0)]){const _0x31625a=await segmentResponseToDef(_0x2faa93,{'resolveSegmentName':_0x2ab86b=>_0x4d5ec8(_0x2ab86b,_0x47a73f)});_0x54a866={'description':_0x2faa93[_0x236e8b(0xb6)],'rule':_0x31625a['rule']};}return{'name':_0x44d564,'isJourneyLocal':_0x17e4c3,'definition':_0x54a866};}catch{return{'name':_0x41614b,'isJourneyLocal':![]};}},'resolveActivation':async _0xe1181e=>{const _0x1d9d65=a157_0x18a4,_0x1154d=_0x342526[_0x1d9d65(0xc3)](_0xe1181e);if(_0x1154d!==undefined)return{'name':_0x1154d,'isJourneyLocal':!![]};try{let _0x560406=_0x24d0c9[_0x1d9d65(0xc3)](_0xe1181e);!_0x560406&&(_0x560406=await _0x2c0168[_0x1d9d65(0xdc)][_0x1d9d65(0xaf)](_0x52b196,_0xe1181e));const _0x311cc6=_0x560406[_0x1d9d65(0xb1)]['activationParams'][_0x1d9d65(0xa5)]||_0xe1181e,_0x363d4e=sanitizeYamlKey(_0x311cc6)||_0x1d9d65(0xa1)+_0xe1181e,_0x3a898d=_0x363d4e;_0x342526[_0x1d9d65(0xe6)](_0xe1181e,_0x3a898d);const _0x2744cf=journeyActivationStepToYaml(_0x560406,_0x133208,_0x29031a);return{'name':_0x3a898d,'isJourneyLocal':!![],'definition':_0x2744cf};}catch{return{'name':_0xe1181e,'isJourneyLocal':![]};}},'resolveJumpTarget':(_0x1a9495,_0x5b500b)=>resolveJumpTarget(_0x1a9495,_0x5b500b,_0x3ead8e,async _0x20c31b=>{const _0x5b41c9=a157_0x18a4,_0x1b39d5=_0x561c3b['get'](_0x20c31b);if(_0x1b39d5)return _0x1b39d5;return _0x2c0168[_0x5b41c9(0xdc)][_0x5b41c9(0xe1)](_0x20c31b);})});return{'createYamlContext':_0x35b23e};}
|
|
1
|
+
(function(_0x55f14b,_0x5ecc6b){const _0x273254=a157_0x4690,_0x120efa=_0x55f14b();while(!![]){try{const _0x3ebc7d=parseInt(_0x273254(0x1ea))/0x1*(parseInt(_0x273254(0x21d))/0x2)+-parseInt(_0x273254(0x209))/0x3+parseInt(_0x273254(0x225))/0x4+parseInt(_0x273254(0x1ef))/0x5+-parseInt(_0x273254(0x1e1))/0x6*(parseInt(_0x273254(0x1fa))/0x7)+-parseInt(_0x273254(0x20b))/0x8+parseInt(_0x273254(0x1e3))/0x9;if(_0x3ebc7d===_0x5ecc6b)break;else _0x120efa['push'](_0x120efa['shift']());}catch(_0x1ff9ae){_0x120efa['push'](_0x120efa['shift']());}}}(a157_0x4b83,0x9c2dd));import a157_0x28743c from'path';import{existsSync,readFileSync}from'fs';import{generateDiff,formatDiffWithColors,hasChanges}from'../../utils/diff.js';function a157_0x4b83(){const _0x3302b2=['getLatestJourneyId','journeyBundleId','filter','Processing\x20segments','Fetching\x20users\x20and\x20connections','parentFolder','size','relationships','paused','folderId','journey','33294ZUVHYc','name','6383264blSLSF','data','getJourney','getSegment','length','utf-8','getParent','audienceId','listFolders','getActivation','update','Warning:\x20Journey\x20','map','versionNumber','.yml','from','all','has','4eWhiaM','join','Fetching\x20parent\x20segment\x20info','attributes','toLowerCase','description','Processing\x20journey:\x20','add','4400848abUEaQ','relative','buildIdToNameMap','createdAt','Fetching\x20activations','rule','reduce','888RBjhEW','values','6257376YEqAKu','journeyBundleName','activation_','slice','tdx.json','Processing\x20journeys','set','172662ZnSCje','segmentFolderId','segment','segments/','clear','2868055DbNNrB','kind','state','listJourneysWithDetailsFromParentSegment','Resolving\x20parent\x20segment','targetResourceName','push','isNew','\x20not\x20found\x20in\x20pre-fetched\x20data,\x20skipping','listActivations','buildIdToEmailMap','59864hejOtE','activationParams','get','listSegments'];a157_0x4b83=function(){return _0x3302b2;};return a157_0x4b83();}import{sanitizeFileName}from'../../utils/string-utils.js';import{batchAsync}from'../../utils/async.js';import{buildFolderIdToPathMap}from'./resolution-context.js';import{segmentWithActivationsToYaml,segmentToYamlString,segmentResponseToDef,journeyActivationStepToYaml}from'./child-segment-yaml.js';function a157_0x4690(_0x4f051f,_0x5434a0){_0x4f051f=_0x4f051f-0x1e0;const _0x4b8303=a157_0x4b83();let _0x469099=_0x4b8303[_0x4f051f];return _0x469099;}import{journeyResponseToDef,toYamlString as a157_0xc21078,normalizeJourneyDef,parseYamlString as a157_0x939490}from'./journey-yaml.js';import{SEGMENT_KIND_JOURNEY,generateJourneyLocalName,sanitizeYamlKey,buildMergedJourneyDef,buildLocalRuleToNameMappingFromJourney,createJumpTargetCache,resolveJumpTarget}from'./journey-utils.js';import{createTdxConfigContent}from'./tdx-config.js';function prepareFile(_0x185701,_0x420632,_0x198024){const _0x55410c=a157_0x4690,_0x4e77bf=a157_0x28743c[_0x55410c(0x226)](_0x198024,_0x185701);if(existsSync(_0x185701)){const _0x143d1c=readFileSync(_0x185701,_0x55410c(0x210)),_0x57ebb4=generateDiff(_0x143d1c,_0x420632),_0xa5277c=hasChanges(_0x57ebb4);return{'relativePath':_0x4e77bf,'absolutePath':_0x185701,'content':_0x420632,'isNew':![],'hasChanges':_0xa5277c,'diff':_0xa5277c?formatDiffWithColors(_0x57ebb4):undefined};}return{'relativePath':_0x4e77bf,'absolutePath':_0x185701,'content':_0x420632,'isNew':!![],'hasChanges':![]};}function getUniqueFileName(_0x37deb7,_0x4e0951,_0x2dbefe){const _0x4e2154=a157_0x4690,_0x4f0cdc=_0x37deb7+':'+_0x4e0951,_0x45ae71=_0x2dbefe[_0x4e2154(0x1fc)](_0x4f0cdc)||0x0;_0x2dbefe[_0x4e2154(0x1e9)](_0x4f0cdc,_0x45ae71+0x1);if(_0x45ae71===0x0)return _0x4e0951;return _0x4e0951+'_'+(_0x45ae71+0x1);}export async function pullSegments(_0x37ecb3,_0x47e83f,_0x4e9e5a={}){const _0xb6515c=a157_0x4690,{targetDir:_0x161aa0,progress:_0x2de60f}=_0x4e9e5a;_0x2de60f?.[_0xb6515c(0x215)](_0xb6515c(0x1f3));const _0xd7369c=await _0x37ecb3['segment']['resolveParentId'](_0x47e83f);_0x2de60f?.[_0xb6515c(0x215)](_0xb6515c(0x21f));const _0xfc477e=await _0x37ecb3[_0xb6515c(0x1ec)][_0xb6515c(0x211)](_0xd7369c),_0x3394b4=_0xfc477e[_0xb6515c(0x220)][_0xb6515c(0x20a)];_0x2de60f?.['update']('Fetching\x20segments,\x20folders,\x20and\x20journeys');const [_0x49d53a,_0x5bf6d1,_0x4412b9]=await Promise[_0xb6515c(0x21b)]([_0x37ecb3[_0xb6515c(0x1ec)][_0xb6515c(0x1fd)](_0xd7369c),_0x37ecb3[_0xb6515c(0x1ec)][_0xb6515c(0x213)](_0xd7369c),_0x37ecb3[_0xb6515c(0x208)][_0xb6515c(0x1f2)](_0xd7369c,{'includeAllVersions':!![]})]),{journeys:_0x25908d,activationStepsById:_0x2fb869}=_0x4412b9,_0xb63a12=new Map();for(const _0x173ec8 of _0x25908d){_0xb63a12[_0xb6515c(0x1e9)](_0x173ec8['id'],_0x173ec8);}const _0x2a3210=_0x25908d[_0xb6515c(0x217)](_0x5a725e=>({'id':_0x5a725e['id'],'name':_0x5a725e[_0xb6515c(0x220)][_0xb6515c(0x20a)],'journeyBundleName':_0x5a725e[_0xb6515c(0x220)][_0xb6515c(0x1e4)]||'','journeyBundleId':_0x5a725e[_0xb6515c(0x220)][_0xb6515c(0x1ff)]||'','versionNumber':_0x5a725e['attributes']['versionNumber'],'description':_0x5a725e[_0xb6515c(0x220)][_0xb6515c(0x222)],'state':_0x5a725e[_0xb6515c(0x220)][_0xb6515c(0x1f1)],'paused':_0x5a725e[_0xb6515c(0x220)][_0xb6515c(0x206)],'audienceId':_0x5a725e['attributes'][_0xb6515c(0x212)],'folderId':_0x5a725e[_0xb6515c(0x205)]?.[_0xb6515c(0x203)]?.[_0xb6515c(0x20c)]?.['id'],'createdAt':_0x5a725e['attributes'][_0xb6515c(0x228)],'updatedAt':_0x5a725e['attributes']['updatedAt']})),_0x9c1bdc=buildFolderIdToPathMap(_0x5bf6d1),_0x19c83d=_0x161aa0||_0xb6515c(0x1ed)+sanitizeFileName(_0x3394b4);_0x2de60f?.['update'](_0xb6515c(0x229));const _0x16b58b=new Map();await batchAsync(_0x49d53a,async _0x30fcdc=>{const _0x563132=_0xb6515c,_0x4014c5=await _0x37ecb3[_0x563132(0x1ec)][_0x563132(0x1f8)](_0xd7369c,_0x30fcdc['id']);_0x16b58b[_0x563132(0x1e9)](_0x30fcdc['id'],_0x4014c5);}),_0x2de60f?.[_0xb6515c(0x215)](_0xb6515c(0x202));const [_0x5bbebf,_0x3d4945]=await Promise[_0xb6515c(0x21b)]([_0x37ecb3['user'][_0xb6515c(0x1f9)](),_0x37ecb3['connection'][_0xb6515c(0x227)]()]),_0x1c7bcd=[],_0xe11d0f=new Map(),_0x1e0d22=a157_0x28743c[_0xb6515c(0x21e)](_0x19c83d,_0xb6515c(0x1e7)),_0xe303dc=createTdxConfigContent(_0x3394b4);_0x1c7bcd[_0xb6515c(0x1f5)](prepareFile(_0x1e0d22,_0xe303dc,_0x19c83d));const _0x4f5803=new Map();for(const _0x1f1d89 of _0x49d53a){_0x4f5803[_0xb6515c(0x1e9)](_0x1f1d89['id'],_0x1f1d89);}let _0x50aa36=_0x49d53a;if(_0x4e9e5a['targetResourceName']){const _0x4d657d=_0x49d53a[_0xb6515c(0x200)](_0x38d19d=>_0x38d19d[_0xb6515c(0x20a)][_0xb6515c(0x221)]()===_0x4e9e5a[_0xb6515c(0x1f4)][_0xb6515c(0x221)]());_0x4d657d[_0xb6515c(0x20f)]>0x0&&(_0x50aa36=_0x4d657d);}_0x2de60f?.[_0xb6515c(0x215)](_0xb6515c(0x201));for(const _0x25099f of _0x50aa36){if(_0x25099f['kind']===SEGMENT_KIND_JOURNEY)continue;const _0x649e0a=_0x25099f[_0xb6515c(0x1eb)]?_0x9c1bdc[_0xb6515c(0x1fc)](_0x25099f['segmentFolderId'])||'':'',_0x382516=_0x16b58b['get'](_0x25099f['id'])||[],_0x41b262=segmentWithActivationsToYaml(_0x25099f,_0x382516,undefined,_0x5bbebf,_0x3d4945),_0x39be70=_0x649e0a?a157_0x28743c['join'](_0x19c83d,_0x649e0a):_0x19c83d,_0x480718=sanitizeFileName(_0x25099f[_0xb6515c(0x20a)]),_0x26918d=getUniqueFileName(_0x39be70,_0x480718,_0xe11d0f),_0x23a7b1=a157_0x28743c[_0xb6515c(0x21e)](_0x39be70,_0x26918d+_0xb6515c(0x219)),_0x3ec52a=segmentToYamlString(_0x41b262);_0x1c7bcd[_0xb6515c(0x1f5)](prepareFile(_0x23a7b1,_0x3ec52a,_0x19c83d));}const _0x4e9f4c=new Map();for(const _0x36839e of _0x2a3210){const _0x124a9a=_0x36839e[_0xb6515c(0x1ff)];!_0x4e9f4c[_0xb6515c(0x21c)](_0x124a9a)&&_0x4e9f4c[_0xb6515c(0x1e9)](_0x124a9a,[]),_0x4e9f4c[_0xb6515c(0x1fc)](_0x124a9a)[_0xb6515c(0x1f5)](_0x36839e);}for(const _0x4da12c of _0x4e9f4c[_0xb6515c(0x1e2)]()){_0x4da12c['sort']((_0x7cd6fb,_0x4134ba)=>(_0x7cd6fb[_0xb6515c(0x218)]||0x0)-(_0x4134ba[_0xb6515c(0x218)]||0x0));}if(_0x4e9e5a['targetResourceName']){const _0x252c5f=new Map();for(const [_0x4a8819,_0x3773b2]of _0x4e9f4c){const _0x207061=_0x3773b2[0x0][_0xb6515c(0x1e4)];if(_0x207061[_0xb6515c(0x221)]()===_0x4e9e5a['targetResourceName'][_0xb6515c(0x221)]()){_0x252c5f['set'](_0x4a8819,_0x3773b2);break;}}_0x4e9f4c[_0xb6515c(0x1ee)]();for(const [_0x1301c6,_0x4dd9f7]of _0x252c5f){_0x4e9f4c['set'](_0x1301c6,_0x4dd9f7);}}if(_0x4e9f4c[_0xb6515c(0x204)]>0x0){_0x2de60f?.[_0xb6515c(0x215)](_0xb6515c(0x1e8));const _0x14ea09=Array[_0xb6515c(0x21a)](_0x4e9f4c[_0xb6515c(0x1e2)]()),_0x1ef9f4=0x5,{createYamlContext:_0x41ae7b}=createYamlContextForBundle(_0x37ecb3,_0x4f5803,_0x5bbebf,_0x3d4945,_0x2fb869,_0xb63a12);for(let _0x15ecc4=0x0;_0x15ecc4<_0x14ea09['length'];_0x15ecc4+=_0x1ef9f4){const _0x73af19=_0x14ea09[_0xb6515c(0x1e6)](_0x15ecc4,_0x15ecc4+_0x1ef9f4),_0x286dc5=await Promise[_0xb6515c(0x21b)](_0x73af19[_0xb6515c(0x217)](async _0x4d48d5=>{const _0x33f3e9=_0xb6515c,_0x19f916=_0x4d48d5[0x0],_0x361a39=_0x19f916[_0x33f3e9(0x1e4)];_0x2de60f?.[_0x33f3e9(0x215)](_0x33f3e9(0x223)+_0x361a39);const _0x265216=_0x19f916[_0x33f3e9(0x207)]?_0x9c1bdc['get'](_0x19f916[_0x33f3e9(0x207)])||'':'',_0x340c81=_0x265216?a157_0x28743c[_0x33f3e9(0x21e)](_0x19c83d,_0x265216):_0x19c83d,_0x11ec5b=sanitizeFileName(_0x361a39),_0x99c2e8=a157_0x28743c[_0x33f3e9(0x21e)](_0x340c81,_0x11ec5b+_0x33f3e9(0x219));let _0xb95227;if(existsSync(_0x99c2e8))try{const _0x478024=readFileSync(_0x99c2e8,'utf-8'),_0xe699e9=a157_0x939490(_0x478024);_0xb95227=buildLocalRuleToNameMappingFromJourney(_0xe699e9);}catch{}const _0x32467=[];for(const _0x12aa3f of _0x4d48d5){const _0x42a74d=_0xb63a12[_0x33f3e9(0x1fc)](_0x12aa3f['id']);if(!_0x42a74d){_0x2de60f?.[_0x33f3e9(0x215)](_0x33f3e9(0x216)+_0x12aa3f['id']+_0x33f3e9(0x1f7));continue;}const _0x3fe0d0=_0x42a74d['attributes']?.[_0x33f3e9(0x212)],_0x5af789=_0x41ae7b(_0x12aa3f['id'],_0x3fe0d0),_0x240632=await journeyResponseToDef(_0x42a74d,_0x5af789);_0x32467[_0x33f3e9(0x1f5)]({'item':_0x12aa3f,'yaml':_0x240632});}const _0x5c7dba=await _0x37ecb3[_0x33f3e9(0x208)][_0x33f3e9(0x1fe)](_0x19f916[_0x33f3e9(0x1ff)]),_0x567560=buildMergedJourneyDef(_0x32467,_0xb95227,_0x5c7dba);return{'bundleName':_0x361a39,'folderPath':_0x265216,'finalYaml':_0x567560};}));for(const {bundleName:_0x258001,folderPath:_0x122153,finalYaml:_0x5eed8f}of _0x286dc5){const _0xb28395=normalizeJourneyDef(_0x5eed8f),_0x168178=a157_0xc21078(_0xb28395),_0x8e0378=_0x122153?a157_0x28743c[_0xb6515c(0x21e)](_0x19c83d,_0x122153):_0x19c83d,_0x3ee72f=sanitizeFileName(_0x258001),_0x44e1f2=getUniqueFileName(_0x8e0378,_0x3ee72f,_0xe11d0f),_0x61178=a157_0x28743c[_0xb6515c(0x21e)](_0x8e0378,_0x44e1f2+_0xb6515c(0x219));_0x1c7bcd[_0xb6515c(0x1f5)](prepareFile(_0x61178,_0x168178,_0x19c83d));}}}const _0x153f91=Array[_0xb6515c(0x21a)](_0x16b58b[_0xb6515c(0x1e2)]())[_0xb6515c(0x1e0)]((_0x2b633f,_0x19d0a4)=>_0x2b633f+_0x19d0a4[_0xb6515c(0x20f)],0x0),_0x3e0c0f=_0x50aa36[_0xb6515c(0x200)](_0x4cf0=>_0x4cf0[_0xb6515c(0x1f0)]!==SEGMENT_KIND_JOURNEY),_0x49d8c9=_0x1c7bcd[_0xb6515c(0x200)](_0x68aec6=>_0x68aec6[_0xb6515c(0x1f6)])[_0xb6515c(0x20f)],_0x208df6=_0x1c7bcd[_0xb6515c(0x200)](_0x5769ec=>!_0x5769ec[_0xb6515c(0x1f6)]&&_0x5769ec['hasChanges'])['length'],_0x81b01c=_0x1c7bcd['filter'](_0x12be8a=>!_0x12be8a['isNew']&&!_0x12be8a['hasChanges'])[_0xb6515c(0x20f)],_0x21113d=Array[_0xb6515c(0x21a)](_0x4e9f4c[_0xb6515c(0x1e2)]())[_0xb6515c(0x1e0)]((_0x59f235,_0x56f093)=>_0x59f235+_0x56f093[_0xb6515c(0x20f)],0x0);return{'parentName':_0x3394b4,'parentId':_0xd7369c,'targetDir':_0x19c83d,'files':_0x1c7bcd,'counts':{'segments':_0x3e0c0f[_0xb6515c(0x20f)],'journeys':_0x4e9f4c[_0xb6515c(0x204)],'journeyVersions':_0x21113d,'activations':_0x153f91},'newFiles':_0x49d8c9,'changedFiles':_0x208df6,'unchangedFiles':_0x81b01c};}function createYamlContextForBundle(_0xf33e26,_0x4a22a4,_0x3cac39,_0xd4384b,_0x44a3ef,_0x2c8bd7){const _0xb48cf2=new Set(),_0x35b1d7=new Map(),_0x965b4b=new Map(),_0x1be49b=createJumpTargetCache(),_0x39bcc7=async(_0x2e3bbc,_0x3879f1)=>{const _0x4f37e7=a157_0x4690,_0x3666d1=_0x35b1d7[_0x4f37e7(0x1fc)](_0x2e3bbc);if(_0x3666d1!==undefined)return _0x3666d1;if(!_0x3879f1)return _0x2e3bbc;try{let _0x4a3412=_0x4a22a4[_0x4f37e7(0x1fc)](_0x2e3bbc);!_0x4a3412&&(_0x4a3412=await _0xf33e26[_0x4f37e7(0x1ec)][_0x4f37e7(0x20e)](_0x3879f1,_0x2e3bbc),_0x4a22a4['set'](_0x2e3bbc,_0x4a3412));const _0x5cb690=generateJourneyLocalName(_0x4a3412[_0x4f37e7(0x20a)]),_0x5c8614=_0x4a3412[_0x4f37e7(0x1f0)]===SEGMENT_KIND_JOURNEY&&_0x5cb690!==undefined;if(_0x5c8614&&_0x5cb690){let _0x4cf0d9=_0x5cb690,_0x10eb74=0x2;while(_0xb48cf2[_0x4f37e7(0x21c)](_0x4cf0d9)){_0x4cf0d9=_0x5cb690+'_'+_0x10eb74,_0x10eb74++;}return _0xb48cf2[_0x4f37e7(0x224)](_0x4cf0d9),_0x35b1d7[_0x4f37e7(0x1e9)](_0x2e3bbc,_0x4cf0d9),_0x4cf0d9;}return _0x4a3412[_0x4f37e7(0x20a)];}catch{return _0x2e3bbc;}},_0x6d30b6=(_0x34526a,_0x449b9d)=>({'resolveSegment':async _0x1e94a9=>{const _0x3dabe2=a157_0x4690,_0x994eff=_0x35b1d7[_0x3dabe2(0x1fc)](_0x1e94a9);if(_0x994eff!==undefined)return{'name':_0x994eff,'isJourneyLocal':!![]};if(!_0x449b9d)return{'name':_0x1e94a9,'isJourneyLocal':![]};try{let _0x5a43af=_0x4a22a4[_0x3dabe2(0x1fc)](_0x1e94a9);!_0x5a43af&&(_0x5a43af=await _0xf33e26['segment'][_0x3dabe2(0x20e)](_0x449b9d,_0x1e94a9),_0x4a22a4['set'](_0x1e94a9,_0x5a43af));const _0x4fbe76=generateJourneyLocalName(_0x5a43af[_0x3dabe2(0x20a)]),_0x2825b4=_0x5a43af[_0x3dabe2(0x1f0)]===SEGMENT_KIND_JOURNEY&&_0x4fbe76!==undefined;if(_0x2825b4&&!_0x5a43af['rule']&&_0x449b9d)try{const _0x4f70d4=await _0xf33e26[_0x3dabe2(0x1ec)][_0x3dabe2(0x20e)](_0x449b9d,_0x1e94a9);_0x4a22a4['set'](_0x1e94a9,_0x4f70d4),_0x5a43af=_0x4f70d4;}catch{}const _0x3d1d99=await _0x39bcc7(_0x1e94a9,_0x449b9d);let _0x37af71;if(_0x2825b4&&_0x5a43af[_0x3dabe2(0x22a)]){const _0xc81c87=await segmentResponseToDef(_0x5a43af,{'resolveSegmentName':_0x39c158=>_0x39bcc7(_0x39c158,_0x449b9d)});_0x37af71={'description':_0x5a43af['description'],'rule':_0xc81c87['rule']};}return{'name':_0x3d1d99,'isJourneyLocal':_0x2825b4,'definition':_0x37af71};}catch{return{'name':_0x1e94a9,'isJourneyLocal':![]};}},'resolveActivation':async _0x5f1474=>{const _0x28e4fd=a157_0x4690,_0x11f36e=_0x965b4b['get'](_0x5f1474);if(_0x11f36e!==undefined)return{'name':_0x11f36e,'isJourneyLocal':!![]};try{let _0x2e15bc=_0x44a3ef[_0x28e4fd(0x1fc)](_0x5f1474);!_0x2e15bc&&(_0x2e15bc=await _0xf33e26[_0x28e4fd(0x208)][_0x28e4fd(0x214)](_0x34526a,_0x5f1474));const _0x53077b=_0x2e15bc[_0x28e4fd(0x220)][_0x28e4fd(0x1fb)][_0x28e4fd(0x20a)]||_0x5f1474,_0x102c5d=sanitizeYamlKey(_0x53077b)||_0x28e4fd(0x1e5)+_0x5f1474,_0x161380=_0x102c5d;_0x965b4b['set'](_0x5f1474,_0x161380);const _0x4ffa4d=journeyActivationStepToYaml(_0x2e15bc,_0x3cac39,_0xd4384b);return{'name':_0x161380,'isJourneyLocal':!![],'definition':_0x4ffa4d};}catch{return{'name':_0x5f1474,'isJourneyLocal':![]};}},'resolveJumpTarget':(_0x4eaf53,_0x33edd0)=>resolveJumpTarget(_0x4eaf53,_0x33edd0,_0x1be49b,async _0x2ca1e9=>{const _0x49d1f9=a157_0x4690,_0x5bf0a7=_0x2c8bd7[_0x49d1f9(0x1fc)](_0x2ca1e9);if(_0x5bf0a7)return _0x5bf0a7;return _0xf33e26[_0x49d1f9(0x208)][_0x49d1f9(0x20d)](_0x2ca1e9);})});return{'createYamlContext':_0x6d30b6};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a158_0x39f4(){const _0xb42c56=['4848864Hfcwyk','stringify','join','debug','dirname','403707DxOSYP','277gAeqXV','1426OlWkPI','Failed\x20to\x20delete\x20push\x20recovery\x20file:\x20','tdx.sdk.push-recovery','4bxeRjj','ENOENT','2088639GGCKyP','23710VLgcvQ','code','segments','77eWTzZa','1016057QKASLB','utf-8','journeyName','Failed\x20to\x20read\x20push\x20recovery\x20file:\x20','18185XMHDWJ','toISOString','parse','30aBAMsg','Failed\x20to\x20parse\x20push\x20recovery\x20file:\x20','8XFaWhB'];a158_0x39f4=function(){return _0xb42c56;};return a158_0x39f4();}const a158_0x51d3e7=a158_0x1092;(function(_0x203831,_0x477da4){const _0x4d8cc3=a158_0x1092,_0x1d0f9f=_0x203831();while(!![]){try{const _0x160ccb=-parseInt(_0x4d8cc3(0x1fb))/0x1*(-parseInt(_0x4d8cc3(0x1fc))/0x2)+-parseInt(_0x4d8cc3(0x1fa))/0x3*(parseInt(_0x4d8cc3(0x1ff))/0x4)+parseInt(_0x4d8cc3(0x20a))/0x5*(parseInt(_0x4d8cc3(0x20d))/0x6)+-parseInt(_0x4d8cc3(0x206))/0x7*(parseInt(_0x4d8cc3(0x1f4))/0x8)+-parseInt(_0x4d8cc3(0x201))/0x9+-parseInt(_0x4d8cc3(0x202))/0xa*(-parseInt(_0x4d8cc3(0x205))/0xb)+parseInt(_0x4d8cc3(0x1f5))/0xc;if(_0x160ccb===_0x477da4)break;else _0x1d0f9f['push'](_0x1d0f9f['shift']());}catch(_0x1773ab){_0x1d0f9f['push'](_0x1d0f9f['shift']());}}}(a158_0x39f4,0x1e694));import{readFileSync,writeFileSync,unlinkSync,existsSync,renameSync}from'fs';import a158_0x136f94 from'path';import{Logger}from'../../utils/logger/index.js';const logger=Logger['of'](a158_0x51d3e7(0x1fe));export function getPushRecoveryPath(_0x5aecd6){const _0x813915=a158_0x51d3e7,_0x509921=a158_0x136f94[_0x813915(0x1f9)](_0x5aecd6),_0x47b8e1=a158_0x136f94['basename'](_0x5aecd6);return a158_0x136f94[_0x813915(0x1f7)](_0x509921,'.'+_0x47b8e1+'.push-recovery.json');}export function readPushRecovery(_0x2696b7){const _0x20da7e=a158_0x51d3e7,_0x16c815=getPushRecoveryPath(_0x2696b7);if(!existsSync(_0x16c815))return undefined;try{const _0x15f251=readFileSync(_0x16c815,_0x20da7e(0x207)),_0x2f1285=JSON[_0x20da7e(0x20c)](_0x15f251);if(_0x2f1285?.['version']!==0x1||typeof _0x2f1285[_0x20da7e(0x208)]!=='string')return undefined;return _0x2f1285;}catch(_0x43acf1){return _0x43acf1 instanceof SyntaxError?logger['debug'](_0x20da7e(0x1f3)+_0x43acf1):logger['warn'](_0x20da7e(0x209)+_0x43acf1),undefined;}}export function writePushRecovery(_0x1a8b8f,_0x23dd94){const _0x4ed597=a158_0x51d3e7,_0x3c0921=getPushRecoveryPath(_0x1a8b8f),_0x32b394=_0x3c0921+'.tmp';writeFileSync(_0x32b394,JSON[_0x4ed597(0x1f6)](_0x23dd94,null,0x2)+'\x0a',_0x4ed597(0x207)),renameSync(_0x32b394,_0x3c0921);}function a158_0x1092(_0x2575d9,_0x5350db){_0x2575d9=_0x2575d9-0x1f3;const _0x39f481=a158_0x39f4();let _0x1092d3=_0x39f481[_0x2575d9];return _0x1092d3;}export function deletePushRecovery(_0x26802a){const _0x322348=a158_0x51d3e7,_0x165ba3=getPushRecoveryPath(_0x26802a);try{unlinkSync(_0x165ba3);}catch(_0x46be68){_0x46be68[_0x322348(0x203)]!==_0x322348(0x200)&&logger[_0x322348(0x1f8)](_0x322348(0x1fd)+_0x46be68);}}export function saveSegmentToPushRecovery(_0x2181a8,_0x2535b6,_0x21d0d6,_0x251fa3){const _0x1b0c3c=a158_0x51d3e7,_0x134501=readPushRecovery(_0x2181a8),_0x9a9781=_0x134501?.['journeyName']===_0x2535b6?{..._0x134501,'updatedAt':new Date()[_0x1b0c3c(0x20b)]()}:{'version':0x1,'journeyName':_0x2535b6,'updatedAt':new Date()[_0x1b0c3c(0x20b)](),'segments':{}};_0x9a9781[_0x1b0c3c(0x204)][_0x21d0d6]=_0x251fa3,writePushRecovery(_0x2181a8,_0x9a9781);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a159_0x1187c8=a159_0x35a2;(function(_0x101547,_0x3d4b16){const _0x42b22d=a159_0x35a2,_0x39c0d0=_0x101547();while(!![]){try{const _0x4c4bb3=-parseInt(_0x42b22d(0x17e))/0x1*(parseInt(_0x42b22d(0x140))/0x2)+-parseInt(_0x42b22d(0xed))/0x3+-parseInt(_0x42b22d(0x141))/0x4+-parseInt(_0x42b22d(0xf5))/0x5*(parseInt(_0x42b22d(0x189))/0x6)+parseInt(_0x42b22d(0xf6))/0x7+-parseInt(_0x42b22d(0x130))/0x8*(parseInt(_0x42b22d(0xca))/0x9)+parseInt(_0x42b22d(0xbb))/0xa;if(_0x4c4bb3===_0x3d4b16)break;else _0x39c0d0['push'](_0x39c0d0['shift']());}catch(_0x5ac1d7){_0x39c0d0['push'](_0x39c0d0['shift']());}}}(a159_0x1c6d,0xa2e4d));import{createHash}from'crypto';import{Logger}from'../../utils/logger/index.js';const logger=Logger['of'](a159_0x1187c8(0x11d));export const PENDING_SEGMENT_PREFIX=a159_0x1187c8(0x99);export const PENDING_ACTIVATION_PREFIX='__pending_act_';function a159_0x1c6d(){const _0x172b62=['\x20journey\x20from\x20file:\x20','steps','Journey\x20\x27','SEGMENT_NOT_FOUND','getLatestJourneyId','conditionTimeoutDuration','skipSegments','Updating\x20segment\x20\x27','isArray','parentId','folder_created','\x27\x20entry\x20criteria','Failed\x20to\x20fetch\x20referenced\x20segment\x20','\x27\x20to\x20local\x20\x27','\x27\x20wait\x20condition','versionNumber','journeyStages','segments','dirname','hasChanges','Creating\x20activation\x20\x27','from','segment_created','../../utils/async.js','folderPath','onProgress','63408AgZtGi','Stage\x20\x27','results','day','deleted','yamlConfig','deleteSegment','goal\x20criteria','5ALUvyJ','5536629JphmvS','Failed\x20to\x20resolve\x20segment\x20','\x27\x20by\x20rule\x20content','has','relationships','add','journey_entry_criteria_','activationStepsById','hex','DecisionPoint','list','segment_deleted',').\x20','entry','embedded_segment_creating','existingSegments','journeyBundleId','startsWith','Duration','ACTIVATION_SYNTAX_ERROR','all_columns','getSegment\x20failed\x20for\x20','size','\x27\x20already\x20exists\x20on\x20server\x20but\x20cannot\x20be\x20found.\x20','journeyId','Failed\x20to\x20resolve\x20activation\x20','./journey-yaml.js','existingJourney','connectionIdToNameMap','INTERNAL','Entry\x20criteria:\x20','segmentNameToId','uniqueSegmentName','activation_deleting','withProgress','JOURNEY_SYNTAX_ERROR','resolveSegment','listActivations','journeyActivationStepId','tdx.sdk.push-workflow','includes','SEGMENT_UPDATE_ERROR','segment','SEGMENT_SYNTAX_ERROR','activation_updating','existingSegment','notification','stage\x20\x27','Failed\x20to\x20sync\x20activations\x20for\x20segment\x20\x27','find','toLowerCase','segment_creating','logSuccess','./child-segment-yaml.js','waitStepUnit','activationParams','rule','rootFolderId','221944bALmIq','segment_updated','journeyById','Deleting\x20activation\x20\x27','Cannot\x20create\x20embedded\x20activation\x20without\x20journey\x20context','Condition','length','Updated\x20activation\x20\x27','conditionTimeoutUnit','relative','Segment\x20not\x20found:\x20','toString','journeyName','run_after_journey_refresh','activation_template_id','\x27\x20decision\x20point\x20branch\x20\x27','2ScQcyU','3072836Xdppnk','\x20(referenced\x20in\x20journey\x20','deleteActivation','Created\x20folder\x20\x27','journey_creating','branches','draft','activation_updated','resolveJourneyId','folder','schedule','index','journey_updated','parentSegmentFolder','debug','\x27...','create','exitCriterias','Created\x20journey\x20\x27','createdSegmentId','updateSegmentById','deps','match','filter','journey_updating','idToName','sha1','getJourney','logInfo','connector_config','sort','split','stages','Creating\x20folder\x20\x27','entries','Matched\x20server\x20segment\x20\x27','fetchJourney','absolutePath','Segment\x20not\x20found','embedded_segment_created','JOURNEY_UPDATE_ERROR','diff','conditions','activationActions','journeyBundleName','get','ACTIVATION_UPDATE_ERROR','Creating\x20segment\x20\x27','activationContext','createJourneySegment',',\x20falling\x20back\x20to\x20getSegmentEntity:\x20','waitStep','stringify','unchanged','item','errors','createdSegmentIds','user','utf-8','getSegmentEntity\x20also\x20failed\x20for\x20','slice','161561pgClbD','replace','null','values','\x27\x20from\x20file:\x20','journey_created','valid','segmentId','description','join','keys','168186qSuSgz','attributes','resolvedRule','yamlActivation','entryCriteria','Updating\x20activation\x20\x27','journeys','digest','Deleted\x20activation\x20\x27','Name\x20has\x20already\x20been\x20taken','logDeleted','folderId','\x20error(s)','isNew','progress','):\x20','update','max','\x0a\x20\x20','push','journey','__pending_','Activation','trim','activation_deleted','getActivation','parseDocument','entry_criteria','embeddedSegmentNameToId','embedded_activation_creating','conditionSegmentId','connection','goal','name','getSegment','all','NOT_FOUND','embedded_activation_created','waitStepType','behavior','WaitStep','validatedRequest','created','columns','activationsBySegmentId','segment_deleting','parentFolder','\x20(referenced\x20in\x20embedded\x20segment\x20\x27','journeyBundlesByFolderAndName','folderPathToId','uniqueServerName','Created\x20segment\x20\x27','Activation\x20not\x20found:\x20','\x27\x20not\x20found\x20in\x20journey\x20\x27','localName','13823200rXJLKO','segmentFolderId','map','Failed\x20to\x20','parse','createActivation','activation_','nameToType','existingActivation','\x20segment\x20from\x20file:\x20','activations','delete','Created\x20activation\x20\x27','createFolder','folder_creating','171RzSWgg','updated','set','idToEmailMap','milestone','action','type','Fetching\x20','data'];a159_0x1c6d=function(){return _0x172b62;};return a159_0x1c6d();}export function createPendingSegmentId(_0xb44e85){return''+PENDING_SEGMENT_PREFIX+_0xb44e85+'__';}export function isPendingSegmentId(_0x4e34d7){const _0x5aae06=a159_0x1187c8;return _0x4e34d7[_0x5aae06(0x107)](PENDING_SEGMENT_PREFIX)&&!_0x4e34d7[_0x5aae06(0x107)](PENDING_ACTIVATION_PREFIX);}function a159_0x35a2(_0x1fe239,_0x4d16e7){_0x1fe239=_0x1fe239-0x87;const _0x1c6d2a=a159_0x1c6d();let _0x35a21e=_0x1c6d2a[_0x1fe239];return _0x35a21e;}export function extractPendingSegmentName(_0x2f9ad3){const _0x65bbb8=a159_0x1187c8;return _0x2f9ad3[_0x65bbb8(0x17f)](/^__pending_(.+)__$/,'$1');}export function createPendingActivationId(_0x6188af){return''+PENDING_ACTIVATION_PREFIX+_0x6188af+'__';}export function isPendingActivationId(_0xc9f347){return _0xc9f347['startsWith'](PENDING_ACTIVATION_PREFIX);}export function extractPendingActivationName(_0x5e8dc8){const _0x18a467=a159_0x1187c8;return _0x5e8dc8[_0x18a467(0x17f)](/^__pending_act_(.+)__$/,'$1');}export function generateDeterministicJourneySegmentName(_0x492f06,_0x173277){const _0x1fc5a1=a159_0x1187c8,_0x1cf688=_0x492f06+'::'+(_0x173277[_0x1fc5a1(0x9b)]()||_0x1fc5a1(0x120)),_0x31ec24=createHash(_0x1fc5a1(0x15b))[_0x1fc5a1(0x94)](_0x1cf688)[_0x1fc5a1(0x8b)](_0x1fc5a1(0xfe))[_0x1fc5a1(0x17d)](0x0,0xc);return _0x1fc5a1(0xfc)+_0x31ec24;}export function ensureJourneyDefaults(_0x2b2d56){const _0x81dd15=a159_0x1187c8;!_0x2b2d56['description']&&(_0x2b2d56[_0x81dd15(0x186)]=''),!_0x2b2d56['state']&&(_0x2b2d56['state']=_0x81dd15(0x147));}export function injectExistingStageIds(_0x170c2b,_0xa994ec){const _0x296b44=a159_0x1187c8,_0x17a3a3=new Map(_0xa994ec[_0x296b44(0xbd)](_0x44ff64=>[_0x44ff64[_0x296b44(0xa5)],_0x44ff64['id']]));for(const _0x5190fa of _0x170c2b){if(!_0x5190fa['id']){const _0x7e262c=_0x17a3a3[_0x296b44(0x16e)](_0x5190fa['name']);_0x7e262c&&(_0x5190fa['id']=_0x7e262c);}}}export function resolveTDFolderPath(_0x55f6c9,_0x68f74e,_0x52436a){const _0x1acb9f=a159_0x1187c8;if(!_0x68f74e)return _0x55f6c9;if(_0x55f6c9===_0x52436a||_0x55f6c9[_0x1acb9f(0x107)](_0x52436a+'/'))return _0x55f6c9;return _0x55f6c9?_0x52436a+'/'+_0x55f6c9:_0x52436a;}export function addFoldersToCreate(_0x4ace33,_0x37c79f,_0x179abe){const _0x38acef=a159_0x1187c8;if(!_0x4ace33)return;if(_0x37c79f[_0x38acef(0xf9)](_0x4ace33))return;const _0x5be7a9=_0x4ace33[_0x38acef(0x160)]('/');let _0x54959a='';for(const _0x14f1b3 of _0x5be7a9){_0x54959a=_0x54959a?_0x54959a+'/'+_0x14f1b3:_0x14f1b3,!_0x37c79f[_0x38acef(0xf9)](_0x54959a)&&_0x179abe[_0x38acef(0xfb)](_0x54959a);}}export function sortFoldersByDepth(_0x4ff5ba){return[..._0x4ff5ba]['sort']((_0x40a38e,_0x284833)=>{const _0x247db3=a159_0x35a2,_0x23782e=(_0x40a38e[_0x247db3(0x157)](/\//g)||[])[_0x247db3(0x136)],_0x27364c=(_0x284833[_0x247db3(0x157)](/\//g)||[])['length'];return _0x23782e-_0x27364c;});}import*as a159_0x674282 from'yaml';import{readFileSync}from'fs';import a159_0x4ef545 from'path';import{isJourneyDef,parseYamlString as a159_0x29057a,toYamlString as a159_0x164755,normalizeJourneyDef,hasMultipleVersions,journeyResponseToDef,collectSegmentIdsFromJourneyApi}from'./journey-yaml.js';import{SEGMENT_KIND_JOURNEY,generateJourneyLocalName,sanitizeYamlKey,createJumpTargetCache,resolveJumpTarget,buildMergedJourneyDef,buildLocalRuleToNameMappingFromJourney,collectSegmentUsageCounts}from'./journey-utils.js';import{activationResponseToDef,segmentToYamlString,segmentWithActivationsToYaml,parseSegmentYamlFile,normalizeChildSegmentYaml,apiRuleToYaml,yamlRuleToApi,serializeExpandedRule,collectSegmentRefsFromRule,resolveRuleSegmentRefs,resolveRuleSegmentIds,journeyActivationStepToYaml}from'./child-segment-yaml.js';import{generateDiff,formatDiffWithColors,hasChanges}from'../../utils/diff.js';import{batchAsync}from'../../utils/async.js';import{buildFolderMaps}from'./resolution-context.js';import{SDKError,ErrorCode,isHttp400Error,getErrorMessage}from'../errors.js';import{readPushRecovery,saveSegmentToPushRecovery,deletePushRecovery}from'./push-recovery.js';import{validateSegmentDef,formatValidationResult}from'./yaml-validator.js';import{validateJourneyDef}from'./journey-validator.js';function stableStringify(_0x184fed){const _0xbc5a8a=a159_0x1187c8;if(Array[_0xbc5a8a(0xdb)](_0x184fed))return'['+_0x184fed[_0xbc5a8a(0xbd)](_0x43bff7=>stableStringify(_0x43bff7))[_0xbc5a8a(0x187)](',')+']';if(_0x184fed&&typeof _0x184fed==='object'){const _0x130943=_0x184fed,_0x3e48d7=Object[_0xbc5a8a(0x188)](_0x130943)['sort'](),_0x4121e1=_0x3e48d7[_0xbc5a8a(0xbd)](_0x39d05b=>'\x22'+_0x39d05b+'\x22:'+stableStringify(_0x130943[_0x39d05b]));return'{'+_0x4121e1[_0xbc5a8a(0x187)](',')+'}';}const _0x49e75d=JSON['stringify'](_0x184fed);return _0x49e75d===undefined?_0xbc5a8a(0x180):_0x49e75d;}function activationSignature(_0x133ec5){const _0x5e1ab0=a159_0x1187c8,_0x3c99cd={'connection':_0x133ec5[_0x5e1ab0(0xa3)],..._0x133ec5[_0x5e1ab0(0x10a)]!==undefined&&{'all_columns':_0x133ec5[_0x5e1ab0(0x10a)]},..._0x133ec5[_0x5e1ab0(0xaf)]!==undefined&&{'columns':_0x133ec5[_0x5e1ab0(0xaf)]},..._0x133ec5[_0x5e1ab0(0xab)]!==undefined&&{'behavior':_0x133ec5[_0x5e1ab0(0xab)]},..._0x133ec5[_0x5e1ab0(0x14b)]!==undefined&&{'schedule':_0x133ec5[_0x5e1ab0(0x14b)]},..._0x133ec5['notification']!==undefined&&{'notification':_0x133ec5[_0x5e1ab0(0x124)]},..._0x133ec5[_0x5e1ab0(0x15e)]!==undefined&&{'connector_config':_0x133ec5[_0x5e1ab0(0x15e)]},..._0x133ec5[_0x5e1ab0(0x13e)]!==undefined&&{'activation_template_id':_0x133ec5[_0x5e1ab0(0x13e)]}};return stableStringify(_0x3c99cd);}async function fetchSegment(_0x4c9253,_0x74c365,_0xd0b745,_0x22e32c){const _0x356744=a159_0x1187c8,_0xcd2e98=_0x22e32c?.['find'](_0x457b90=>_0x457b90['id']===_0xd0b745);if(_0xcd2e98)return _0xcd2e98;try{return await _0x4c9253[_0x356744(0x120)][_0x356744(0xa6)](_0x74c365,_0xd0b745);}catch(_0x4018d0){logger['debug'](_0x356744(0x10b)+_0xd0b745+_0x356744(0x173)+_0x4018d0);try{return await _0x4c9253[_0x356744(0x120)]['getSegmentEntity'](_0xd0b745);}catch(_0x530b8b){return logger[_0x356744(0x14f)](_0x356744(0x17c)+_0xd0b745+':\x20'+_0x530b8b),null;}}}function recoverSegmentIdsFromPushRecovery(_0x489554,_0x50d4b0,_0xd3fcbf){const _0x1f57da=a159_0x1187c8,_0x2be1bb=readPushRecovery(_0x489554[_0x1f57da(0x166)]);if(_0x2be1bb?.[_0x1f57da(0x13c)]===_0x489554[_0x1f57da(0xf2)][_0x1f57da(0xa5)])for(const [_0x5baf2e,_0x3631fb]of Object[_0x1f57da(0x163)](_0x2be1bb[_0x1f57da(0xe4)])){const _0x4b5abe=generateDeterministicJourneySegmentName(_0x489554[_0x1f57da(0xf2)]['name'],_0x5baf2e);_0x3631fb[_0x1f57da(0xb6)]===_0x4b5abe&&(_0x50d4b0[_0x1f57da(0xcc)](_0x5baf2e,_0x3631fb[_0x1f57da(0x185)]),_0xd3fcbf[_0x1f57da(0xcc)](_0x5baf2e,_0x3631fb['segmentId']));}}async function createOrRecoverEmbeddedSegment(_0x5ce824,_0x5a3f91,_0xf1613b,_0x5f0ac1){const _0x568c9b=a159_0x1187c8;let _0x12df31;try{_0x12df31=await _0x5ce824[_0x568c9b(0x120)][_0x568c9b(0x172)]({'name':_0xf1613b[_0x568c9b(0x116)],'description':_0xf1613b[_0x568c9b(0x186)],'journeyId':_0xf1613b['journeyId'],'rule':_0x5f0ac1(_0xf1613b[_0x568c9b(0x18b)],!![]),'countPopulation':!![],'parentFolderId':_0xf1613b['folderId'],'audienceId':_0xf1613b[_0x568c9b(0xdc)]});}catch(_0x49bd96){const _0x2e1059=_0x49bd96 instanceof Error&&_0x49bd96['message'][_0x568c9b(0x11e)](_0x568c9b(0x8d));if(_0x2e1059){const _0x5643f8=readPushRecovery(_0x5a3f91[_0x568c9b(0x166)]),_0x3cca04=_0x5643f8?.[_0x568c9b(0x13c)]===_0x5a3f91['yamlConfig'][_0x568c9b(0xa5)]?_0x5643f8['segments'][_0xf1613b[_0x568c9b(0xba)]]:undefined;if(_0x3cca04?.[_0x568c9b(0xb6)]===_0xf1613b[_0x568c9b(0x116)])await _0x5ce824[_0x568c9b(0x120)][_0x568c9b(0x155)](_0xf1613b[_0x568c9b(0xdc)],_0x3cca04[_0x568c9b(0x185)],{'description':_0xf1613b[_0x568c9b(0x186)],'rule':_0x5f0ac1(_0xf1613b[_0x568c9b(0x18b)],!![]),'countPopulation':!![]}),_0x12df31=_0x3cca04['segmentId'];else throw new SDKError(ErrorCode['SEGMENT_UPDATE_ERROR'],'Embedded\x20segment\x20\x27'+_0xf1613b[_0x568c9b(0xba)]+_0x568c9b(0x10d)+('Delete\x20the\x20push\x20recovery\x20file\x20('+_0x5a3f91['absolutePath'][_0x568c9b(0x17f)](/([^/]+)$/,'.$1.push-recovery.json')+')\x20')+'and\x20the\x20server\x20segment,\x20then\x20retry.',_0x49bd96);}else throw _0x49bd96;}return saveSegmentToPushRecovery(_0x5a3f91[_0x568c9b(0x166)],_0x5a3f91['yamlConfig'][_0x568c9b(0xa5)],_0xf1613b['localName'],{'segmentId':_0x12df31,'uniqueServerName':_0xf1613b['uniqueSegmentName'],'createdAt':new Date()['toISOString']()}),_0x12df31;}export async function prepareSegmentFiles(_0x15e25f,_0x1478b5,_0x125931,_0x2bfd03,_0x398f42){const _0x3894bd=a159_0x1187c8,{activationDefToCreateRequest:_0x2da313}=await import(_0x3894bd(0x12b)),_0x100025=[],_0x57b6c6=new Set();for(const {yamlConfig:_0x4f20cb,folderPath:_0x4e1e1c,sourcePath:_0x27f64d}of _0x15e25f){const _0x314c91=resolveTDFolderPath(_0x4e1e1c,_0x2bfd03,_0x398f42),_0x3f6cbe=_0x314c91+':'+_0x4f20cb[_0x3894bd(0xa5)],_0x475138=_0x1478b5['segmentByFolderAndName'][_0x3894bd(0x16e)](_0x3f6cbe),_0x4e4cf4=_0x475138?_0x1478b5[_0x3894bd(0xb0)]['get'](_0x475138['id'])||[]:[];addFoldersToCreate(_0x314c91,_0x1478b5[_0x3894bd(0xb5)],_0x57b6c6);const _0x36fc9d=calculateActivationActions(_0x4f20cb['activations']||[],_0x4e4cf4,_0x1478b5['idToEmailMap'],_0x1478b5[_0x3894bd(0x112)]);for(const _0xb40994 of _0x36fc9d){(_0xb40994[_0x3894bd(0xd0)]===_0x3894bd(0x151)||_0xb40994['type']===_0x3894bd(0x94))&&_0xb40994[_0x3894bd(0x87)]&&(_0xb40994[_0x3894bd(0xad)]=await _0x2da313(_0xb40994[_0x3894bd(0x87)],_0x125931));}const _0x553d7e=calculateSegmentDiff(_0x4f20cb,_0x475138,_0x4e4cf4,_0x1478b5[_0x3894bd(0xcd)],_0x1478b5[_0x3894bd(0x112)]);_0x100025['push']({'relativePath':_0x4f20cb[_0x3894bd(0xa5)],'absolutePath':_0x27f64d,'yamlConfig':_0x4f20cb,'folderPath':_0x314c91,'existingSegment':_0x475138,'existingActivations':_0x4e4cf4,'isNew':_0x553d7e[_0x3894bd(0x91)],'hasChanges':_0x553d7e[_0x3894bd(0xe6)],'diff':_0x553d7e[_0x3894bd(0x16a)],'activationActions':_0x36fc9d});}return{'segmentFiles':_0x100025,'foldersToCreate':_0x57b6c6};}export async function prepareJourneyFiles(_0x3fde0d,_0x12a96d,_0x232d87,_0xafdbd3){const _0x45a777=a159_0x1187c8,_0x3343ac=[],_0x2956e1=new Set();for(const {yamlConfig:_0x1768e9,folderPath:_0x105585,sourcePath:_0x2ea9c5}of _0x3fde0d){const _0x1d2c6d=resolveTDFolderPath(_0x105585,_0x232d87,_0xafdbd3),_0x4e8337=_0x1d2c6d+':'+_0x1768e9[_0x45a777(0xa5)],_0x508903=_0x12a96d[_0x45a777(0xb4)][_0x45a777(0x16e)](_0x4e8337);let _0x6df062,_0x270a7b;if(_0x508903&&_0x508903['length']>0x0){const _0x3885a9=buildLocalExpandedRuleMappings(_0x1768e9),{createYamlContext:_0x315e9b,prefetchJourneySegments:_0x439d2e}=createPushYamlContextForBundle(_0x12a96d[_0x45a777(0x156)],_0x12a96d[_0x45a777(0xdc)],_0x12a96d[_0x45a777(0x105)],_0x3885a9,_0x12a96d[_0x45a777(0xcd)],_0x12a96d[_0x45a777(0x112)],_0x12a96d[_0x45a777(0xfd)],_0x12a96d[_0x45a777(0x132)]);await _0x439d2e(_0x508903[_0x45a777(0xbd)](_0x159323=>_0x159323['id']));const _0x5d03bd=await _0x12a96d[_0x45a777(0x156)][_0x45a777(0x98)][_0x45a777(0xd7)](_0x508903[0x0][_0x45a777(0x106)]),_0x388c62=hasMultipleVersions(_0x1768e9),_0x1381c6=async _0x325b61=>{const _0x274259=_0x45a777,_0x2ee838=_0x12a96d[_0x274259(0x132)]?.['get'](_0x325b61);if(_0x2ee838)return _0x2ee838;return _0x12a96d[_0x274259(0x165)]({'journeyId':_0x325b61,'journeyName':_0x1768e9[_0x274259(0xa5)],'isMultiVersion':_0x508903[_0x274259(0x136)]>0x1});};if(_0x388c62&&_0x508903[_0x45a777(0x136)]>0x1){const _0x57d380=[];for(const _0x4aa674 of _0x508903){const _0x40233c=_0x4aa674[_0x45a777(0xe2)]||0x1;_0x12a96d[_0x45a777(0x92)]?.[_0x45a777(0x94)](_0x45a777(0xd1)+_0x1768e9['name']+'\x20v'+_0x40233c);const _0x24c496=await _0x1381c6(_0x4aa674['id']),_0x16cc3e=_0x315e9b(_0x4aa674['id']),_0x1b336d=await journeyResponseToDef(_0x24c496,_0x16cc3e);_0x57d380['push']({'item':_0x4aa674,'yaml':_0x1b336d});}const _0x2638ed=buildLocalRuleToNameMappingFromJourney(_0x1768e9);_0x270a7b=buildMergedJourneyDef(_0x57d380,_0x2638ed,_0x5d03bd);const _0x4fe503=Math[_0x45a777(0x95)](..._0x57d380['map'](_0x374bde=>_0x374bde[_0x45a777(0x177)][_0x45a777(0xe2)]||0x0)),_0xc7d83c=_0x508903[_0x45a777(0x127)](_0x3b8e6b=>(_0x3b8e6b[_0x45a777(0xe2)]||0x0)===_0x4fe503);_0xc7d83c&&(_0x12a96d['progress']?.[_0x45a777(0x94)](_0x45a777(0xd1)+_0x1768e9[_0x45a777(0xa5)]+'\x20v'+_0x4fe503),_0x6df062=await _0x1381c6(_0xc7d83c['id']));}else{const _0x42d850=_0x508903[_0x508903[_0x45a777(0x136)]-0x1];_0x12a96d['progress']?.[_0x45a777(0x94)](_0x45a777(0xd1)+_0x1768e9[_0x45a777(0xa5)]),_0x6df062=await _0x1381c6(_0x42d850['id']);const _0x5d351d=_0x315e9b(_0x42d850['id']),_0x342fb7=await journeyResponseToDef(_0x6df062,_0x5d351d),_0x546d=buildLocalRuleToNameMappingFromJourney(_0x1768e9);_0x270a7b=buildMergedJourneyDef([{'item':_0x42d850,'yaml':_0x342fb7}],_0x546d,_0x5d03bd);}}addFoldersToCreate(_0x1d2c6d,_0x12a96d[_0x45a777(0xb5)],_0x2956e1);const _0x3b2245=calculateJourneyDiff(_0x1768e9,_0x270a7b);_0x3343ac[_0x45a777(0x97)]({'relativePath':_0x1768e9['name'],'absolutePath':_0x2ea9c5,'yamlConfig':_0x1768e9,'folderPath':_0x1d2c6d,'existingJourney':_0x6df062,'isNew':_0x3b2245[_0x45a777(0x91)],'hasChanges':_0x3b2245[_0x45a777(0xe6)],'diff':_0x3b2245[_0x45a777(0x16a)]});}return{'journeyFiles':_0x3343ac,'foldersToCreate':_0x2956e1};}export function calculateActivationActions(_0x1e2e27,_0x5dd7bb,_0xc35b91,_0x57e4fe){const _0x183227=a159_0x1187c8,_0x41fd99=[],_0x5fc8fd=new Map();for(const _0x8d9493 of _0x5dd7bb){_0x5fc8fd['set'](_0x8d9493[_0x183227(0xa5)],_0x8d9493);}const _0xbb6318=new Map();for(const _0x44efda of _0x1e2e27){_0xbb6318[_0x183227(0xcc)](_0x44efda['name'],_0x44efda);}for(const _0x1f260e of _0x1e2e27){const _0x470771=_0x5fc8fd['get'](_0x1f260e[_0x183227(0xa5)]);if(!_0x470771)_0x41fd99[_0x183227(0x97)]({'type':_0x183227(0x151),'name':_0x1f260e[_0x183227(0xa5)],'yamlActivation':_0x1f260e});else{const _0x62216c=activationResponseToDef(_0x470771,_0xc35b91,_0x57e4fe),_0x583695=a159_0x674282['stringify'](_0x62216c),_0x484767=a159_0x674282['stringify'](_0x1f260e);_0x583695!==_0x484767&&_0x41fd99[_0x183227(0x97)]({'type':_0x183227(0x94),'name':_0x1f260e[_0x183227(0xa5)],'yamlActivation':_0x1f260e,'existingActivation':_0x470771});}}for(const _0x2ad389 of _0x5dd7bb){!_0xbb6318[_0x183227(0xf9)](_0x2ad389[_0x183227(0xa5)])&&_0x41fd99[_0x183227(0x97)]({'type':_0x183227(0xc6),'name':_0x2ad389[_0x183227(0xa5)],'existingActivation':_0x2ad389});}return _0x41fd99;}function calculateYamlDiff(_0x443c0e,_0x2d2287){if(_0x2d2287){const _0x60e1ff=generateDiff(_0x2d2287,_0x443c0e),_0x14ded0=hasChanges(_0x60e1ff);return{'isNew':![],'hasChanges':_0x14ded0,'diff':_0x14ded0?formatDiffWithColors(_0x60e1ff):undefined};}const _0x4253db=generateDiff('',_0x443c0e);return{'isNew':!![],'hasChanges':![],'diff':formatDiffWithColors(_0x4253db)};}export function calculateSegmentDiff(_0x5a4936,_0x386275,_0x56f61c,_0x36cb1d,_0x182226){const _0x356ed3=segmentToYamlString(_0x5a4936),_0x1d8208=_0x386275?segmentToYamlString(segmentWithActivationsToYaml(_0x386275,_0x56f61c,undefined,_0x36cb1d,_0x182226)):undefined;return calculateYamlDiff(_0x356ed3,_0x1d8208);}export function calculateJourneyDiff(_0x4603b4,_0x941e53){const _0x208c0b=normalizeJourneyDef(_0x4603b4,_0x4603b4),_0x2b25b9=a159_0x164755(_0x208c0b),_0x41c716=_0x941e53?a159_0x164755(normalizeJourneyDef(_0x941e53,_0x4603b4)):undefined;return calculateYamlDiff(_0x2b25b9,_0x41c716);}export function findSegmentsToDelete(_0x22a59f,_0x51ed0e,_0x35fb64,_0x657404,_0x15e511){const _0x5c6601=new Set();for(const {yamlConfig:_0x5eaf18,folderPath:_0x77dd9b}of _0x51ed0e){_0x5c6601['add'](_0x77dd9b+':'+_0x5eaf18['name']);}return _0x22a59f['filter'](_0x46b33a=>{const _0x164ebd=a159_0x35a2,_0x5b564b=_0x46b33a['segmentFolderId']?_0x35fb64[_0x164ebd(0x16e)](_0x46b33a[_0x164ebd(0xbc)][_0x164ebd(0x13b)]())||'':'',_0x243458=_0x5b564b+':'+_0x46b33a['name'];if(_0x5c6601[_0x164ebd(0xf9)](_0x243458))return![];if(_0x15e511)return _0x5b564b===_0x657404||_0x5b564b[_0x164ebd(0x107)](_0x657404+'/');return!![];});}export function findJourneysToDelete(_0x27fd1e,_0x3bf093,_0x133b0e,_0x5cb1ca,_0x1bb1e4){const _0xb8dbd1=a159_0x1187c8,_0x262f8a=new Set();for(const {yamlConfig:_0x5a5cd2,folderPath:_0x14e82c}of _0x3bf093){_0x262f8a['add'](_0x14e82c+':'+_0x5a5cd2[_0xb8dbd1(0xa5)]);}return _0x27fd1e[_0xb8dbd1(0x158)](_0x156e07=>{const _0x29d8eb=_0xb8dbd1,_0x3ac938=_0x156e07[_0x29d8eb(0x8f)]?_0x133b0e['get'](_0x156e07[_0x29d8eb(0x8f)])||'':'',_0x1acb71=_0x3ac938+':'+_0x156e07[_0x29d8eb(0x16d)];if(_0x262f8a[_0x29d8eb(0xf9)](_0x1acb71))return![];if(_0x1bb1e4)return _0x3ac938===_0x5cb1ca||_0x3ac938['startsWith'](_0x5cb1ca+'/');return!![];});}export function buildSegmentLookupMap(_0x2017a8,_0x27d0ae){const _0x138fab=a159_0x1187c8,_0xc6db72=new Map();for(const _0x1bdbcc of _0x2017a8){const _0xc250a1=_0x1bdbcc['segmentFolderId']?_0x27d0ae[_0x138fab(0x16e)](_0x1bdbcc[_0x138fab(0xbc)][_0x138fab(0x13b)]())||'':'',_0x562fd6=_0xc250a1+':'+_0x1bdbcc[_0x138fab(0xa5)];_0xc6db72[_0x138fab(0xcc)](_0x562fd6,_0x1bdbcc);}return _0xc6db72;}export function buildSegmentNameToIdMap(_0x5b6840){const _0x3f0e8c=a159_0x1187c8,_0x1191a5=new Map();for(const _0x29cbbe of _0x5b6840){_0x1191a5[_0x3f0e8c(0xcc)](_0x29cbbe[_0x3f0e8c(0xa5)],_0x29cbbe['id']);}return _0x1191a5;}export function buildJourneyBundleLookupMap(_0x1103c2,_0x456359){const _0x78a794=a159_0x1187c8,_0x2fe3dd=new Map();for(const _0x3095ac of _0x1103c2){const _0x11c35c=_0x3095ac[_0x78a794(0x8f)]?_0x456359[_0x78a794(0x16e)](_0x3095ac[_0x78a794(0x8f)])||'':'',_0x2358a5=_0x11c35c+':'+_0x3095ac[_0x78a794(0x16d)];!_0x2fe3dd[_0x78a794(0xf9)](_0x2358a5)&&_0x2fe3dd[_0x78a794(0xcc)](_0x2358a5,[]),_0x2fe3dd[_0x78a794(0x16e)](_0x2358a5)[_0x78a794(0x97)](_0x3095ac);}for(const _0x37fc98 of _0x2fe3dd[_0x78a794(0x181)]()){_0x37fc98['sort']((_0x866cfc,_0x50afae)=>(_0x866cfc[_0x78a794(0xe2)]||0x0)-(_0x50afae['versionNumber']||0x0));}return _0x2fe3dd;}export function collectFoldersToCreate(_0x239552,_0x1d7a00){const _0x2301ee=a159_0x1187c8,_0xdf1478=new Set();for(const _0x19621a of _0x239552){if(!_0x19621a)continue;if(_0x1d7a00[_0x2301ee(0xf9)](_0x19621a))continue;const _0x37f99c=_0x19621a[_0x2301ee(0x160)]('/');let _0xc3729e='';for(const _0x5effd8 of _0x37f99c){_0xc3729e=_0xc3729e?_0xc3729e+'/'+_0x5effd8:_0x5effd8,!_0x1d7a00['has'](_0xc3729e)&&_0xdf1478[_0x2301ee(0xfb)](_0xc3729e);}}return _0xdf1478;}export function parseAndClassifyYamlFiles(_0x223fa7,_0x1715e9,_0x4d243a){const _0x2883ed=a159_0x1187c8,_0x17cc21=[],_0x2313d9=[];for(const _0x154db0 of _0x223fa7){const _0x5142b7=a159_0x4ef545[_0x2883ed(0x139)](_0x1715e9,a159_0x4ef545[_0x2883ed(0xe5)](_0x154db0)),_0x31383b=_0x5142b7==='.'?'':_0x5142b7['replace'](/\\/g,'/'),_0x10ee54=readFileSync(_0x154db0,_0x2883ed(0x17b)),_0xd39954=a159_0x674282[_0x2883ed(0xbf)](_0x10ee54);if(isJourneyDef(_0xd39954,_0x154db0)){const _0x23eeae=a159_0x29057a(_0x10ee54);_0x2313d9[_0x2883ed(0x97)]({'yamlConfig':_0x23eeae,'folderPath':_0x31383b,'sourcePath':_0x154db0});}else{if(!_0x4d243a?.[_0x2883ed(0xd9)]){const _0x31536a=parseSegmentYamlFile(_0x10ee54),_0x376121=normalizeChildSegmentYaml(_0x31536a);_0x17cc21[_0x2883ed(0x97)]({'yamlConfig':_0x376121,'folderPath':_0x31383b,'sourcePath':_0x154db0});}}}return{'segments':_0x17cc21,'journeys':_0x2313d9};}export function validateParsedFiles(_0x2b9c26,_0x53a7be){const _0x3aef1f=a159_0x1187c8,_0x2e3c81=[];for(const {yamlConfig:_0xf7fa24,sourcePath:_0x9b2c2}of _0x2b9c26[_0x3aef1f(0xe4)]){const _0x14a4e2=readFileSync(_0x9b2c2,_0x3aef1f(0x17b)),_0x4cad8e=a159_0x674282[_0x3aef1f(0x9e)](_0x14a4e2),_0x18b850=validateSegmentDef(_0xf7fa24,{'source':_0x14a4e2,'document':_0x4cad8e},{'skipSchema':!![]});if(!_0x18b850[_0x3aef1f(0x184)]){const _0x4cf512=a159_0x4ef545['relative'](_0x53a7be,_0x9b2c2);_0x2e3c81['push']({'filePath':_0x4cf512,'source':_0x14a4e2,'result':_0x18b850,'isJourney':![]});}}for(const {yamlConfig:_0x2937c7,sourcePath:_0x4f0f0f}of _0x2b9c26[_0x3aef1f(0x8a)]){const _0x2039d2=readFileSync(_0x4f0f0f,_0x3aef1f(0x17b)),_0x4c086b=a159_0x674282[_0x3aef1f(0x9e)](_0x2039d2),_0x398179=validateJourneyDef(_0x2937c7,{'source':_0x2039d2,'document':_0x4c086b},{'skipSchema':!![]});if(!_0x398179[_0x3aef1f(0x184)]){const _0x3324d7=a159_0x4ef545[_0x3aef1f(0x139)](_0x53a7be,_0x4f0f0f);_0x2e3c81[_0x3aef1f(0x97)]({'filePath':_0x3324d7,'source':_0x2039d2,'result':_0x398179,'isJourney':!![]});}}return _0x2e3c81;}export function formatValidationErrors(_0x354abb){const _0x3aece7=a159_0x1187c8,_0x4cb135=[];for(const {filePath:_0x4635b0,source:_0x318076,result:_0x46cbcf,isJourney:_0x547a68}of _0x354abb){const _0x5b640b=_0x547a68?_0x3aece7(0x98):_0x3aece7(0x120);_0x4cb135[_0x3aece7(0x97)]('\x0a'+_0x4635b0+'\x20('+_0x5b640b+_0x3aece7(0x93)+_0x46cbcf[_0x3aece7(0x178)][_0x3aece7(0x136)]+_0x3aece7(0x90)),_0x4cb135[_0x3aece7(0x97)](formatValidationResult(_0x46cbcf,_0x318076,_0x4635b0));}return _0x4cb135['join']('\x0a');}export function buildLocalExpandedRuleMappings(_0x239e41){const _0x120bcb=a159_0x1187c8,_0x423bc4=new Set(),_0x5a1c0e=new Map(),_0x3d3188=collectSegmentUsageCounts(_0x239e41);if(_0x239e41[_0x120bcb(0xe4)])for(const [_0x4df432,_0x2eb52a]of Object[_0x120bcb(0x163)](_0x239e41[_0x120bcb(0xe4)])){_0x423bc4[_0x120bcb(0xfb)](_0x4df432);if(_0x2eb52a['rule']){const _0x1af29a=yamlRuleToApi(_0x2eb52a[_0x120bcb(0x12e)]),_0x304f6e=apiRuleToYaml(_0x1af29a);_0x5a1c0e['set'](_0x4df432,_0x304f6e);}}const _0x202afa=new Map();let _0x5c479b=0x0;for(const [_0x30e7bb,_0x3b097b]of _0x5a1c0e){const _0x5b0ee7=serializeExpandedRule(_0x3b097b,_0x5a1c0e),_0x145f9a=_0x202afa[_0x120bcb(0x16e)](_0x5b0ee7)||[];_0x145f9a[_0x120bcb(0x97)]({'name':_0x30e7bb,'index':_0x5c479b}),_0x202afa[_0x120bcb(0xcc)](_0x5b0ee7,_0x145f9a),_0x5c479b++;}const _0x511099=new Map();for(const [_0xbf041a,_0x4aa4c6]of _0x202afa){const _0x4ebfe8=_0x4aa4c6[_0x120bcb(0x17d)]()[_0x120bcb(0x15f)]((_0x5d47f5,_0x99d892)=>{const _0x5d4dee=_0x120bcb,_0x3253f5=_0x3d3188[_0x5d4dee(0x16e)](_0x5d47f5[_0x5d4dee(0xa5)])||0x0,_0x2d4e71=_0x3d3188[_0x5d4dee(0x16e)](_0x99d892[_0x5d4dee(0xa5)])||0x0;if(_0x3253f5!==_0x2d4e71)return _0x2d4e71-_0x3253f5;return _0x5d47f5[_0x5d4dee(0x14c)]-_0x99d892['index'];})[_0x120bcb(0xbd)](_0x422173=>_0x422173[_0x120bcb(0xa5)]),_0x5cc507=[];for(const _0x92147b of _0x4ebfe8){const _0x55de0a=_0x3d3188['get'](_0x92147b)||0x0,_0x265bc8=Math['max'](_0x55de0a,0x1);for(let _0x9bf64a=0x0;_0x9bf64a<_0x265bc8;_0x9bf64a++){_0x5cc507['push'](_0x92147b);}}_0x511099['set'](_0xbf041a,_0x5cc507);}return{'existingLocalSegmentNames':_0x423bc4,'localSegmentRules':_0x5a1c0e,'localExpandedRuleToNames':_0x511099};}export function createSegmentIdResolver(_0x4d8d0a,_0x3cfe38){return async _0x928968=>{const _0x378665=a159_0x35a2,_0x1198b8=_0x4d8d0a['get'](_0x928968);if(!_0x1198b8)throw new SDKError(ErrorCode[_0x378665(0xd6)],_0x378665(0x13a)+_0x928968+_0x378665(0xb3)+_0x3cfe38+'\x27)');return _0x1198b8;};}export function extractRootFolderId(_0x1fded9){const _0x1b8bca=a159_0x1187c8;return _0x1fded9[_0x1b8bca(0xfa)]?.[_0x1b8bca(0x14e)]?.['data']?.['id']||_0x1fded9[_0x1b8bca(0xfa)]?.[_0x1b8bca(0xb2)]?.['data']?.['id'];}export function buildConnectionMaps(_0x236501){const _0x8f3a5d=a159_0x1187c8,_0x12767b=new Map(),_0x454bd2=new Map(),_0x254303=new Map();for(const _0x14ecce of _0x236501){_0x12767b[_0x8f3a5d(0xcc)](_0x14ecce[_0x8f3a5d(0xa5)],parseInt(_0x14ecce['id'],0xa)),_0x454bd2[_0x8f3a5d(0xcc)](_0x14ecce['id'],_0x14ecce[_0x8f3a5d(0xa5)]),_0x254303[_0x8f3a5d(0xcc)](_0x14ecce[_0x8f3a5d(0xa5)],_0x14ecce[_0x8f3a5d(0xd0)]);}return{'nameToId':_0x12767b,'idToName':_0x454bd2,'nameToType':_0x254303};}export function calculatePushStats(_0x45ad1e,_0x5b971f,_0x2d015e,_0x3d14df,_0x3426e3,_0x561f62,_0x2ee43c){const _0x13526b=a159_0x1187c8,_0x14fdb8=_0x45ad1e['filter'](_0x2985d6=>_0x2985d6[_0x13526b(0x91)]),_0x3c6b38=_0x45ad1e[_0x13526b(0x158)](_0x3d14ea=>!_0x3d14ea[_0x13526b(0x91)]&&_0x3d14ea['hasChanges']),_0xf42d9=_0x45ad1e[_0x13526b(0x158)](_0x28e225=>!_0x28e225[_0x13526b(0x91)]&&!_0x28e225[_0x13526b(0xe6)]),_0x5b746c=_0x561f62?_0x3d14df:[],_0x67572e=_0x5b971f[_0x13526b(0x158)](_0x1b4317=>_0x1b4317[_0x13526b(0x91)]),_0x31cb11=_0x5b971f[_0x13526b(0x158)](_0x2bf11c=>!_0x2bf11c[_0x13526b(0x91)]&&_0x2bf11c[_0x13526b(0xe6)]),_0x541d7c=_0x5b971f[_0x13526b(0x158)](_0x4ae164=>!_0x4ae164['isNew']&&!_0x4ae164[_0x13526b(0xe6)]),_0x4309b1=_0x561f62?_0x3426e3:[],_0x11734c=_0x45ad1e['flatMap'](_0x2adf6b=>_0x2adf6b[_0x13526b(0x16c)]),_0x1ae157=_0x11734c[_0x13526b(0x158)](_0x35babd=>_0x35babd[_0x13526b(0xd0)]==='create'),_0x2454ee=_0x11734c['filter'](_0x3b9392=>_0x3b9392[_0x13526b(0xd0)]==='update'),_0x4bc860=_0x11734c[_0x13526b(0x158)](_0x4e786d=>_0x4e786d[_0x13526b(0xd0)]===_0x13526b(0xc6)),_0x18eb0d=Array[_0x13526b(0xe8)](_0x2d015e)[_0x13526b(0x15f)](),_0x2fe995=_0x2ee43c?![]:_0x14fdb8['length']>0x0||_0x3c6b38[_0x13526b(0x136)]>0x0||_0x5b746c[_0x13526b(0x136)]>0x0,_0x25514f=_0x67572e[_0x13526b(0x136)]>0x0||_0x31cb11[_0x13526b(0x136)]>0x0||_0x4309b1['length']>0x0,_0x5c8cda=_0x2ee43c?![]:_0x11734c[_0x13526b(0x136)]>0x0,_0x5c07dc=_0x18eb0d[_0x13526b(0x136)]>0x0;return{'segments':{'new':_0x14fdb8,'changed':_0x3c6b38,'unchanged':_0xf42d9,'toDelete':_0x5b746c},'journeys':{'new':_0x67572e,'changed':_0x31cb11,'unchanged':_0x541d7c,'toDelete':_0x4309b1},'activations':{'all':_0x11734c,'toCreate':_0x1ae157,'toUpdate':_0x2454ee,'toDelete':_0x4bc860},'folders':{'toCreate':_0x18eb0d},'counts':{'segments':{'new':_0x14fdb8[_0x13526b(0x136)],'changed':_0x3c6b38['length'],'unchanged':_0xf42d9[_0x13526b(0x136)],'toDelete':_0x5b746c[_0x13526b(0x136)]},'journeys':{'new':_0x67572e[_0x13526b(0x136)],'changed':_0x31cb11[_0x13526b(0x136)],'unchanged':_0x541d7c['length'],'toDelete':_0x4309b1[_0x13526b(0x136)]},'activations':{'create':_0x1ae157[_0x13526b(0x136)],'update':_0x2454ee[_0x13526b(0x136)],'delete':_0x4bc860['length']},'folders':_0x18eb0d[_0x13526b(0x136)]},'hasChanges':_0x2fe995||_0x25514f||_0x5c8cda||_0x5c07dc};}export async function buildPushExecutionContext(_0x32f74a,_0xea0719,_0x305552,_0x30ecc7,_0x2e5d45,_0x1cb9df){const _0x61a025=a159_0x1187c8,_0x4b5886=extractRootFolderId(_0x305552),{pathToId:_0xb40653,idToPath:_0x445f5e}=buildFolderMaps(_0x2e5d45),_0x22b67f=buildSegmentNameToIdMap(_0x30ecc7),_0x2d0104=new Map(),{batchAsync:_0xb9693d}=await import(_0x61a025(0xea)),[_0x12c5f1,_0x5c7504]=await Promise[_0x61a025(0xa7)]([_0x32f74a[_0x61a025(0x17a)]['buildUserMaps'](),_0x32f74a[_0x61a025(0xa3)][_0x61a025(0x100)](),((async()=>{const _0x648262=_0x61a025;!_0x1cb9df&&_0x30ecc7[_0x648262(0x136)]>0x0&&await _0xb9693d(_0x30ecc7,async _0x2a61d4=>{const _0x1d4483=_0x648262,_0x4cbc3b=await _0x32f74a[_0x1d4483(0x120)][_0x1d4483(0x11b)](_0xea0719,_0x2a61d4['id']);_0x2d0104['set'](_0x2a61d4['id'],_0x4cbc3b);});})())]),{emailToId:_0x6a6692,idToEmail:_0xade433}=_0x12c5f1,_0xbfca31=buildConnectionMaps(_0x5c7504);return{'rootFolderId':_0x4b5886,'folderPathToId':_0xb40653,'folderIdToPath':_0x445f5e,'segmentNameToId':_0x22b67f,'activationsBySegmentId':_0x2d0104,'emailToIdMap':_0x6a6692,'idToEmailMap':_0xade433,'connectionNameToIdMap':_0xbfca31['nameToId'],'connectionIdToNameMap':_0xbfca31[_0x61a025(0x15a)],'connectionNameToTypeMap':_0xbfca31[_0x61a025(0xc2)]};}export function createPushYamlContextForBundle(_0x512579,_0x4a5cc3,_0x4be111,_0x143f9d,_0x7de4d4,_0x5a69e1,_0x5f5618,_0x40bdae){const {existingLocalSegmentNames:_0x24e176,localExpandedRuleToNames:_0x51e872}=_0x143f9d,_0x12f82c=new Set(),_0x23236a=new Map(),_0x4775bd=new Map(),_0x209a5f=new Map(),_0x513339=createJumpTargetCache(),_0x200fdb=new Map(),_0x184094=new Map(),_0x4d0e21=new Set();let _0x339b67;const _0x371aa7=_0x189d00=>{const _0x3d9e89={'resolveSegment':async _0x15df92=>{const _0x3c15e7=a159_0x35a2,_0x2b6b1a=_0x209a5f[_0x3c15e7(0x16e)](_0x15df92);if(_0x2b6b1a!==undefined)return{'name':_0x2b6b1a,'isJourneyLocal':!![]};try{const _0x97c5cd=await fetchSegment(_0x512579,_0x4a5cc3,_0x15df92,_0x4be111);if(!_0x97c5cd)throw new Error(_0x3c15e7(0x167));const _0x591a9e=generateJourneyLocalName(_0x97c5cd[_0x3c15e7(0xa5)]),_0x2c6bb1=_0x97c5cd['kind']===SEGMENT_KIND_JOURNEY&&_0x591a9e!==undefined;let _0x4af9b0=_0x97c5cd[_0x3c15e7(0xa5)],_0x3822eb;if(_0x2c6bb1&&_0x97c5cd['rule']){const _0x4cd0b6=apiRuleToYaml(_0x97c5cd[_0x3c15e7(0x12e)]);_0x184094[_0x3c15e7(0xcc)](_0x15df92,_0x4cd0b6);const _0x288d15=async _0x46e98b=>{const _0x2fbbb0=_0x3c15e7,_0x36c583=collectSegmentRefsFromRule(_0x46e98b);for(const _0x42fec5 of _0x36c583){if(!_0x184094[_0x2fbbb0(0xf9)](_0x42fec5))try{const _0x4fae76=await fetchSegment(_0x512579,_0x4a5cc3,_0x42fec5,_0x4be111);if(_0x4fae76?.['rule']){const _0x54148b=apiRuleToYaml(_0x4fae76[_0x2fbbb0(0x12e)]);_0x184094['set'](_0x42fec5,_0x54148b),await _0x288d15(_0x54148b);}}catch(_0x2193a4){logger[_0x2fbbb0(0x14f)](_0x2fbbb0(0xdf)+_0x42fec5+':\x20'+_0x2193a4);}}};await _0x288d15(_0x4cd0b6);const _0x5ef622=serializeExpandedRule(_0x4cd0b6,_0x184094),_0x406f6d=_0x51e872[_0x3c15e7(0x16e)](_0x5ef622);if(_0x406f6d&&_0x406f6d[_0x3c15e7(0x136)]>0x0){const _0x5cb85e=_0x23236a['get'](_0x5ef622)||0x0,_0x2aa241=_0x406f6d[_0x5cb85e]||_0x406f6d[_0x406f6d[_0x3c15e7(0x136)]-0x1];_0x23236a['set'](_0x5ef622,_0x5cb85e+0x1),_0x4af9b0=_0x2aa241,_0x12f82c['add'](_0x4af9b0),_0x209a5f['set'](_0x15df92,_0x4af9b0);const _0x597626=await resolveRuleSegmentRefs(_0x4cd0b6,async _0x5e2d26=>{const _0x3eaac5=_0x3c15e7,_0x58d075=_0x209a5f[_0x3eaac5(0x16e)](_0x5e2d26);if(_0x58d075)return _0x58d075;const _0xffcc69=await _0x339b67[_0x3eaac5(0x11a)](_0x5e2d26);return _0xffcc69[_0x3eaac5(0xa5)];});_0x3822eb={'description':_0x97c5cd[_0x3c15e7(0x186)],'rule':_0x597626};}else{const _0x22ef7f=_0x200fdb[_0x3c15e7(0x16e)](_0x5ef622);if(_0x22ef7f)_0x4af9b0=_0x22ef7f,_0x209a5f[_0x3c15e7(0xcc)](_0x15df92,_0x4af9b0);else{if(_0x591a9e){let _0x55c8fd=_0x591a9e,_0xc9a13a=0x2;while(_0x12f82c['has'](_0x55c8fd)||_0x24e176[_0x3c15e7(0xf9)](_0x55c8fd)){_0x55c8fd=_0x591a9e+'_'+_0xc9a13a,_0xc9a13a++;}_0x12f82c[_0x3c15e7(0xfb)](_0x55c8fd),_0x4af9b0=_0x55c8fd;}_0x209a5f[_0x3c15e7(0xcc)](_0x15df92,_0x4af9b0),_0x200fdb['set'](_0x5ef622,_0x4af9b0);const _0xd3f93f=await resolveRuleSegmentRefs(_0x4cd0b6,async _0x4eda8c=>{const _0x4211f6=_0x3c15e7,_0x142f0d=_0x209a5f[_0x4211f6(0x16e)](_0x4eda8c);if(_0x142f0d)return _0x142f0d;const _0x1a135d=await _0x339b67[_0x4211f6(0x11a)](_0x4eda8c);return _0x1a135d['name'];});_0x3822eb={'description':_0x97c5cd[_0x3c15e7(0x186)],'rule':_0xd3f93f};}}}return{'name':_0x4af9b0,'isJourneyLocal':_0x2c6bb1,'definition':_0x3822eb};}catch(_0x59fd99){return logger['debug'](_0x3c15e7(0xf7)+_0x15df92+':\x20'+_0x59fd99),{'name':_0x15df92,'isJourneyLocal':![]};}},'resolveActivation':async _0x147da2=>{const _0x4b06cf=a159_0x35a2,_0x3abb90=_0x4775bd[_0x4b06cf(0x16e)](_0x147da2);if(_0x3abb90!==undefined)return{'name':_0x3abb90,'isJourneyLocal':!![]};try{let _0x827553=_0x5f5618?.['get'](_0x147da2);!_0x827553&&(_0x827553=await _0x512579['journey'][_0x4b06cf(0x9d)](_0x189d00,_0x147da2));const _0x4fc910=_0x827553[_0x4b06cf(0x18a)][_0x4b06cf(0x12d)][_0x4b06cf(0xa5)]||_0x147da2,_0x20d0b5=sanitizeYamlKey(_0x4fc910)||_0x4b06cf(0xc1)+_0x147da2,_0x1878a3=_0x20d0b5;_0x4775bd[_0x4b06cf(0xcc)](_0x147da2,_0x1878a3);const _0x5095a8=journeyActivationStepToYaml(_0x827553,_0x7de4d4,_0x5a69e1);return{'name':_0x1878a3,'isJourneyLocal':!![],'definition':_0x5095a8};}catch(_0x2d3104){return logger[_0x4b06cf(0x14f)](_0x4b06cf(0x10f)+_0x147da2+':\x20'+_0x2d3104),{'name':_0x147da2,'isJourneyLocal':![]};}},'resolveJumpTarget':(_0x39b45b,_0x265be2)=>resolveJumpTarget(_0x39b45b,_0x265be2,_0x513339,async _0x324810=>{const _0x48a432=a159_0x35a2,_0x5dffb0=_0x40bdae?.[_0x48a432(0x16e)](_0x324810);if(_0x5dffb0)return _0x5dffb0;return _0x512579[_0x48a432(0x98)]['getJourney'](_0x324810);})};return _0x339b67=_0x3d9e89,_0x3d9e89;},_0xea0e0f=async _0x33329e=>{const _0x41a76f=a159_0x35a2,{collectSegmentIdsFromJourneyApi:_0x47ec0b}=await import(_0x41a76f(0x110)),{batchAsync:_0x152ab2}=await import(_0x41a76f(0xea)),_0x1c2db4=new Set();for(const _0x253ace of _0x33329e){let _0xbb4bbd=_0x40bdae?.['get'](_0x253ace);!_0xbb4bbd&&(_0xbb4bbd=await _0x512579[_0x41a76f(0x98)][_0x41a76f(0x15c)](_0x253ace));const _0x16d175=_0x47ec0b(_0xbb4bbd);for(const _0x240604 of _0x16d175){_0x1c2db4[_0x41a76f(0xfb)](_0x240604);}}let _0xee3313=Array['from'](_0x1c2db4);while(_0xee3313['length']>0x0){const _0x1c8e4b=_0xee3313[_0x41a76f(0x158)](_0x8369fb=>!_0x4d0e21['has'](_0x8369fb));if(_0x1c8e4b['length']===0x0)break;const _0x2c9a8e=await _0x152ab2(_0x1c8e4b,async _0x5abe87=>{const _0x1f8f6d=_0x41a76f;_0x4d0e21[_0x1f8f6d(0xfb)](_0x5abe87);const _0x5e7e5b=await fetchSegment(_0x512579,_0x4a5cc3,_0x5abe87,_0x4be111);if(!_0x5e7e5b)return null;return{'segmentId':_0x5abe87,'segment':_0x5e7e5b};},0xa),_0xd5f95=new Set();for(const _0x40e758 of _0x2c9a8e){if(!_0x40e758?.[_0x41a76f(0x120)]?.[_0x41a76f(0x12e)])continue;const _0x592977=apiRuleToYaml(_0x40e758[_0x41a76f(0x120)][_0x41a76f(0x12e)]);_0x184094[_0x41a76f(0xcc)](_0x40e758['segmentId'],_0x592977);const _0x1cb76e=collectSegmentRefsFromRule(_0x592977);for(const _0x237fe4 of _0x1cb76e){!_0x4d0e21[_0x41a76f(0xf9)](_0x237fe4)&&_0xd5f95[_0x41a76f(0xfb)](_0x237fe4);}}_0xee3313=Array[_0x41a76f(0xe8)](_0xd5f95);}};return{'createYamlContext':_0x371aa7,'prefetchJourneySegments':_0xea0e0f};}export async function executePushSegments(_0x50cdfb,_0x37a596,_0x10d9f4,_0x3782a4,_0x124880){const _0x581b51=a159_0x1187c8,{segmentDefToCreateRequest:_0x226f00,segmentDefToUpdateRequest:_0x2d5e34}=await import('./child-segment-yaml.js'),_0x25650=_0x10d9f4[_0x581b51(0xb5)],_0x18bfb5=0x5,_0x548df4=async _0x41bc14=>{const _0x5d3923=_0x581b51,_0x398746=_0x41bc14[_0x5d3923(0xeb)]?_0x25650[_0x5d3923(0x16e)](_0x41bc14['folderPath']):undefined;let _0x46aa22;const _0x5d2eee={'created':0x0,'updated':0x0,'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};let _0x250060=_0x41bc14['yamlConfig'];if(_0x41bc14['yamlConfig'][_0x5d3923(0x12e)]){const _0x1d7bda=createSegmentIdResolver(_0x10d9f4['segmentNameToId'],_0x41bc14[_0x5d3923(0xf2)]['name']),_0x26a87c=await resolveRuleSegmentIds(_0x41bc14[_0x5d3923(0xf2)]['rule'],_0x1d7bda);_0x250060={..._0x41bc14[_0x5d3923(0xf2)],'rule':_0x26a87c};}try{if(_0x41bc14['isNew']){_0x124880[_0x5d3923(0xec)]?.({'type':_0x5d3923(0x129),'name':_0x41bc14[_0x5d3923(0xf2)]['name']});const _0x5e6f57=_0x226f00(_0x250060,_0x398746),_0x37efcb=await _0x124880[_0x5d3923(0x118)](_0x5d3923(0x170)+_0x41bc14[_0x5d3923(0xf2)]['name']+'\x27...',()=>_0x50cdfb['segment']['createSegment'](_0x3782a4[_0x5d3923(0xdc)],_0x5e6f57));_0x46aa22=_0x37efcb[_0x5d3923(0xd2)]['id'],_0x10d9f4[_0x5d3923(0x115)][_0x5d3923(0xcc)](_0x41bc14[_0x5d3923(0xf2)][_0x5d3923(0xa5)],_0x46aa22),_0x5d2eee[_0x5d3923(0x154)]={'name':_0x41bc14['yamlConfig'][_0x5d3923(0xa5)],'id':_0x46aa22},_0x124880[_0x5d3923(0xec)]?.({'type':_0x5d3923(0xe9),'name':_0x41bc14['yamlConfig'][_0x5d3923(0xa5)],'segmentId':_0x46aa22}),_0x124880[_0x5d3923(0x12a)]?.(_0x5d3923(0xb7)+_0x41bc14[_0x5d3923(0xf2)][_0x5d3923(0xa5)]+'\x27'),_0x5d2eee[_0x5d3923(0xae)]=0x1;}else{if(_0x41bc14['hasChanges']){_0x124880['onProgress']?.({'type':'segment_updating','name':_0x41bc14['yamlConfig'][_0x5d3923(0xa5)]});const _0x19fe79=_0x2d5e34(_0x250060);_0x398746!==_0x41bc14[_0x5d3923(0x123)]?.[_0x5d3923(0xbc)]&&(_0x19fe79[_0x5d3923(0xbc)]=_0x398746?parseInt(_0x398746,0xa):undefined),await _0x124880[_0x5d3923(0x118)](_0x5d3923(0xda)+_0x41bc14['yamlConfig'][_0x5d3923(0xa5)]+_0x5d3923(0x150),()=>_0x50cdfb['segment'][_0x5d3923(0x155)](_0x3782a4[_0x5d3923(0xdc)],_0x41bc14[_0x5d3923(0x123)]['id'],_0x19fe79)),_0x46aa22=_0x41bc14[_0x5d3923(0x123)]['id'],_0x124880[_0x5d3923(0xec)]?.({'type':_0x5d3923(0x131),'name':_0x41bc14[_0x5d3923(0xf2)][_0x5d3923(0xa5)]}),_0x124880[_0x5d3923(0x12a)]?.('Updated\x20segment\x20\x27'+_0x41bc14[_0x5d3923(0xf2)][_0x5d3923(0xa5)]+'\x27'),_0x5d2eee[_0x5d3923(0xcb)]=0x1;}else _0x46aa22=_0x41bc14[_0x5d3923(0x123)]['id'];}}catch(_0x15c9b9){const _0x5bd40a=isHttp400Error(_0x15c9b9),_0x5bcc93=_0x5bd40a?ErrorCode[_0x5d3923(0x121)]:ErrorCode[_0x5d3923(0x11f)],_0x337073=getErrorMessage(_0x15c9b9);throw new SDKError(_0x5bcc93,'Failed\x20to\x20'+(_0x41bc14[_0x5d3923(0x91)]?_0x5d3923(0x151):_0x5d3923(0x94))+_0x5d3923(0xc4)+_0x41bc14['absolutePath']+_0x5d3923(0x96)+_0x337073,_0x15c9b9);}try{const _0x4e7a1f=await syncActivationsForSegment(_0x50cdfb,_0x3782a4['parentId'],_0x46aa22,_0x41bc14[_0x5d3923(0xf2)]['name'],_0x41bc14[_0x5d3923(0x16c)],_0x124880,_0x41bc14[_0x5d3923(0x166)]);_0x5d2eee[_0x5d3923(0xc5)]=_0x4e7a1f;}catch(_0xfd0f76){if(_0xfd0f76 instanceof SDKError)throw _0xfd0f76;throw new SDKError(ErrorCode[_0x5d3923(0x16f)],_0x5d3923(0x126)+_0x41bc14[_0x5d3923(0xf2)][_0x5d3923(0xa5)]+_0x5d3923(0x182)+_0x41bc14['absolutePath']+_0x5d3923(0x96)+getErrorMessage(_0xfd0f76),_0xfd0f76);}return _0x5d2eee;},_0x426811=await batchAsync(_0x37a596,_0x548df4,_0x18bfb5),_0x4143a2={'created':0x0,'updated':0x0,'deleted':0x0,'createdSegmentIds':new Map(),'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};for(const _0x478f0c of _0x426811){_0x4143a2[_0x581b51(0xae)]+=_0x478f0c['created'],_0x4143a2[_0x581b51(0xcb)]+=_0x478f0c['updated'],_0x478f0c[_0x581b51(0x154)]&&_0x4143a2[_0x581b51(0x179)][_0x581b51(0xcc)](_0x478f0c[_0x581b51(0x154)][_0x581b51(0xa5)],_0x478f0c['createdSegmentId']['id']),_0x4143a2[_0x581b51(0xc5)][_0x581b51(0xae)]+=_0x478f0c[_0x581b51(0xc5)][_0x581b51(0xae)],_0x4143a2[_0x581b51(0xc5)][_0x581b51(0xcb)]+=_0x478f0c[_0x581b51(0xc5)][_0x581b51(0xcb)],_0x4143a2['activations'][_0x581b51(0xf1)]+=_0x478f0c[_0x581b51(0xc5)][_0x581b51(0xf1)];}return _0x4143a2;}async function syncActivationsForSegment(_0x529ba4,_0x23ed1c,_0xb7e409,_0x164d29,_0x3c371d,_0x33588d,_0x38d908){const _0x56d4de=a159_0x1187c8,_0x4ec326={'created':0x0,'updated':0x0,'deleted':0x0};for(const _0x419dc2 of _0x3c371d){try{if(_0x419dc2[_0x56d4de(0xd0)]==='create'&&_0x419dc2['validatedRequest'])_0x33588d['onProgress']?.({'type':'activation_creating','segmentName':_0x164d29,'activationName':_0x419dc2[_0x56d4de(0xa5)]}),await _0x33588d[_0x56d4de(0x118)](_0x56d4de(0xe7)+_0x419dc2[_0x56d4de(0xa5)]+'\x27...',()=>_0x529ba4[_0x56d4de(0x120)][_0x56d4de(0xc0)](_0x23ed1c,_0xb7e409,_0x419dc2[_0x56d4de(0xad)])),_0x33588d[_0x56d4de(0xec)]?.({'type':'activation_created','segmentName':_0x164d29,'activationName':_0x419dc2['name']}),_0x33588d[_0x56d4de(0x12a)]?.(_0x56d4de(0xc7)+_0x419dc2[_0x56d4de(0xa5)]+'\x27'),_0x4ec326[_0x56d4de(0xae)]++;else{if(_0x419dc2[_0x56d4de(0xd0)]==='update'&&_0x419dc2[_0x56d4de(0xad)]&&_0x419dc2[_0x56d4de(0xc3)])_0x33588d[_0x56d4de(0xec)]?.({'type':_0x56d4de(0x122),'segmentName':_0x164d29,'activationName':_0x419dc2[_0x56d4de(0xa5)]}),await _0x33588d[_0x56d4de(0x118)](_0x56d4de(0x89)+_0x419dc2['name']+_0x56d4de(0x150),()=>_0x529ba4[_0x56d4de(0x120)]['updateActivation'](_0x23ed1c,_0xb7e409,_0x419dc2[_0x56d4de(0xc3)]['id'],_0x419dc2[_0x56d4de(0xad)])),_0x33588d[_0x56d4de(0xec)]?.({'type':_0x56d4de(0x148),'segmentName':_0x164d29,'activationName':_0x419dc2[_0x56d4de(0xa5)]}),_0x33588d[_0x56d4de(0x12a)]?.(_0x56d4de(0x137)+_0x419dc2[_0x56d4de(0xa5)]+'\x27'),_0x4ec326[_0x56d4de(0xcb)]++;else _0x419dc2[_0x56d4de(0xd0)]===_0x56d4de(0xc6)&&_0x419dc2[_0x56d4de(0xc3)]&&(_0x33588d[_0x56d4de(0xec)]?.({'type':_0x56d4de(0x117),'segmentName':_0x164d29,'activationName':_0x419dc2[_0x56d4de(0xa5)]}),await _0x33588d[_0x56d4de(0x118)](_0x56d4de(0x133)+_0x419dc2[_0x56d4de(0xa5)]+_0x56d4de(0x150),()=>_0x529ba4['segment'][_0x56d4de(0x143)](_0x23ed1c,_0xb7e409,_0x419dc2['existingActivation']['id'])),_0x33588d[_0x56d4de(0xec)]?.({'type':_0x56d4de(0x9c),'segmentName':_0x164d29,'activationName':_0x419dc2[_0x56d4de(0xa5)]}),_0x33588d['logDeleted']?.(_0x56d4de(0x8c)+_0x419dc2['name']+'\x27'),_0x4ec326[_0x56d4de(0xf1)]++);}}catch(_0x266c5a){const _0x4852d6=isHttp400Error(_0x266c5a),_0x272084=_0x4852d6?ErrorCode[_0x56d4de(0x109)]:ErrorCode[_0x56d4de(0x16f)],_0x57852a=getErrorMessage(_0x266c5a);throw new SDKError(_0x272084,_0x56d4de(0xbe)+_0x419dc2[_0x56d4de(0xd0)]+'\x20activation\x20\x27'+_0x419dc2[_0x56d4de(0xa5)]+_0x56d4de(0x182)+_0x38d908+_0x56d4de(0x96)+_0x57852a,_0x266c5a);}}return _0x4ec326;}export async function executePushFolders(_0x107331,_0x5adc8f,_0x53cb3e,_0x313cfd,_0xb960e4){const _0x32bd63=a159_0x1187c8,_0x35162d=new Map(_0x53cb3e),_0x2e92ca=sortFoldersByDepth(_0x5adc8f);for(const _0x1b15c9 of _0x2e92ca){const _0x1c71ed=_0x1b15c9[_0x32bd63(0x160)]('/'),_0x2c043a=_0x1c71ed[_0x1c71ed[_0x32bd63(0x136)]-0x1],_0x215bed=_0x1c71ed[_0x32bd63(0x17d)](0x0,-0x1)[_0x32bd63(0x187)]('/'),_0x3b697e=_0x35162d[_0x32bd63(0x16e)](_0x215bed);_0xb960e4[_0x32bd63(0xec)]?.({'type':_0x32bd63(0xc9),'folder':_0x1b15c9});const _0x1f20c7={'name':_0x2c043a,'parentFolderId':_0x3b697e},_0x3e2d23=await _0xb960e4['withProgress'](_0x32bd63(0x162)+_0x1b15c9+_0x32bd63(0x150),()=>_0x107331[_0x32bd63(0x120)][_0x32bd63(0xc8)](_0x313cfd[_0x32bd63(0xdc)],_0x1f20c7));_0x35162d[_0x32bd63(0xcc)](_0x1b15c9,_0x3e2d23[_0x32bd63(0xd2)]['id']),_0xb960e4[_0x32bd63(0xec)]?.({'type':_0x32bd63(0xdd),'folder':_0x1b15c9,'folderId':_0x3e2d23[_0x32bd63(0xd2)]['id']}),_0xb960e4[_0x32bd63(0x15d)]?.(_0x32bd63(0x144)+_0x1b15c9+'\x27');}return _0x35162d;}export async function executePushSegmentDeletions(_0x5046a5,_0x74ff11,_0x9a1de){const _0x28401f=a159_0x1187c8;if(_0x74ff11['length']===0x0)return 0x0;const {batchAsync:_0x1b491d}=await import(_0x28401f(0xea)),_0x526903=0x5,_0x38483b=await _0x1b491d(_0x74ff11,async _0x3dde6e=>{const _0x203a96=_0x28401f;return _0x9a1de['onProgress']?.({'type':_0x203a96(0xb1),'name':_0x3dde6e[_0x203a96(0xa5)]}),await _0x5046a5[_0x203a96(0x120)][_0x203a96(0xf3)](_0x3dde6e['id']),_0x9a1de[_0x203a96(0xec)]?.({'type':_0x203a96(0x101),'name':_0x3dde6e['name']}),_0x9a1de[_0x203a96(0x8e)]?.('Deleted\x20segment\x20\x27'+_0x3dde6e[_0x203a96(0xa5)]+'\x27'),0x1;},_0x526903);return _0x38483b['reduce']((_0x1380a8,_0x544e80)=>_0x1380a8+_0x544e80,0x0);}export async function executePushJourneys(_0xb684e8,_0x1e49b5,_0x431465,_0x4120ef,_0x3ef027){const _0x4c1dc6=a159_0x1187c8,{journeyDefToRequest:_0x42daf2}=await import(_0x4c1dc6(0x110)),{activationDefToCreateRequest:_0xe45a22,yamlRuleToApi:_0x1e6ede,validateSegmentRule:_0x12ca30}=await import(_0x4c1dc6(0x12b)),_0x57d274={'results':[],'created':0x0,'updated':0x0,'embeddedSegmentNameToId':new Map()},_0x2400c1=new Map(_0x431465[_0x4c1dc6(0x115)]),_0x5d61e7=0x5;for(let _0x28e73b=0x0;_0x28e73b<_0x1e49b5[_0x4c1dc6(0x136)];_0x28e73b+=_0x5d61e7){const _0x300719=_0x1e49b5[_0x4c1dc6(0x17d)](_0x28e73b,_0x28e73b+_0x5d61e7),_0x2bde2b=await Promise[_0x4c1dc6(0xa7)](_0x300719[_0x4c1dc6(0xbd)](async _0x169678=>{const _0x408477=_0x4c1dc6;if(!_0x169678[_0x408477(0x91)]&&!_0x169678[_0x408477(0xe6)])return{'action':_0x408477(0x176),'name':_0x169678[_0x408477(0xf2)][_0x408477(0xa5)],'journeyId':_0x169678[_0x408477(0x111)]?.['id']};const _0x9a3a4d=_0x169678[_0x408477(0xeb)]?_0x431465[_0x408477(0xb5)][_0x408477(0x16e)](_0x169678[_0x408477(0xeb)]):undefined;_0x3ef027[_0x408477(0xec)]?.({'type':_0x169678[_0x408477(0x91)]?_0x408477(0x145):_0x408477(0x159),'name':_0x169678[_0x408477(0xf2)][_0x408477(0xa5)]});try{const _0x3f71b8=await executeSingleJourneyPush(_0xb684e8,_0x169678,{..._0x431465,'segmentNameToId':_0x2400c1},{'parentId':_0x4120ef[_0x408477(0xdc)],'rootFolderId':_0x4120ef['rootFolderId'],'folderId':_0x9a3a4d,'verbose':_0x4120ef['verbose']},_0x3ef027,{'journeyDefToRequest':_0x42daf2,'activationDefToCreateRequest':_0xe45a22,'yamlRuleToApi':_0x1e6ede,'validateSegmentRule':_0x12ca30});for(const [_0xbf57e0,_0x4884a1]of _0x3f71b8[_0x408477(0xa0)]){_0x2400c1[_0x408477(0xcc)](_0xbf57e0,_0x4884a1),_0x57d274['embeddedSegmentNameToId'][_0x408477(0xcc)](_0xbf57e0,_0x4884a1);}if(_0x3f71b8[_0x408477(0xcf)]===_0x408477(0xae))_0x3ef027['onProgress']?.({'type':_0x408477(0x183),'name':_0x169678['yamlConfig'][_0x408477(0xa5)],'journeyId':_0x3f71b8['journeyId']}),_0x3ef027[_0x408477(0x12a)]?.(_0x408477(0x153)+_0x169678[_0x408477(0xf2)][_0x408477(0xa5)]+'\x27'),_0x57d274[_0x408477(0xae)]++;else _0x3f71b8['action']==='updated'&&(_0x3ef027[_0x408477(0xec)]?.({'type':_0x408477(0x14d),'name':_0x169678[_0x408477(0xf2)]['name']}),_0x3ef027[_0x408477(0x12a)]?.('Updated\x20journey\x20\x27'+_0x169678[_0x408477(0xf2)]['name']+'\x27'),_0x57d274[_0x408477(0xcb)]++);return{'action':_0x3f71b8[_0x408477(0xcf)],'name':_0x169678[_0x408477(0xf2)][_0x408477(0xa5)],'journeyId':_0x3f71b8[_0x408477(0x10e)]};}catch(_0x1eeec6){const _0x174b44=isHttp400Error(_0x1eeec6),_0x30f811=_0x174b44?ErrorCode[_0x408477(0x119)]:ErrorCode[_0x408477(0x169)],_0x443667=getErrorMessage(_0x1eeec6);throw new SDKError(_0x30f811,_0x408477(0xbe)+(_0x169678['isNew']?_0x408477(0x151):_0x408477(0x94))+_0x408477(0xd3)+_0x169678[_0x408477(0x166)]+_0x408477(0x96)+_0x443667,_0x1eeec6);}}));_0x57d274[_0x4c1dc6(0xef)][_0x4c1dc6(0x97)](..._0x2bde2b);}return _0x57d274;}async function matchExistingJourneySegments(_0x700232,_0x756ce0,_0x3f1d07,_0xca83e8,_0x10f72e){const _0x465ec1=a159_0x1187c8;if(!_0x756ce0['existingJourney']||!_0x756ce0['yamlConfig'][_0x465ec1(0xe4)])return;const _0x4251c2=new Map(),_0x2c15b0=new Set();for(const _0x401dc9 of Object['keys'](_0x756ce0['yamlConfig'][_0x465ec1(0xe4)])){const _0x2253d7=generateDeterministicJourneySegmentName(_0x756ce0[_0x465ec1(0xf2)][_0x465ec1(0xa5)],_0x401dc9);_0x4251c2[_0x465ec1(0xcc)](_0x2253d7,_0x401dc9),_0x2c15b0[_0x465ec1(0xfb)](_0x401dc9);}const _0x18a894=[],_0x29a1f5=collectSegmentIdsFromJourneyApi(_0x756ce0[_0x465ec1(0x111)]);for(const _0x39747f of _0x29a1f5){const _0xd78770=await fetchSegment(_0x700232,_0x3f1d07,_0x39747f,_0xca83e8);if(!_0xd78770?.['name'])continue;const _0x481e33=_0x4251c2[_0x465ec1(0x16e)](_0xd78770['name']);_0x481e33?(_0x10f72e[_0x465ec1(0xcc)](_0x481e33,_0x39747f),_0x2c15b0['delete'](_0x481e33)):_0x18a894['push']({'id':_0x39747f,'seg':_0xd78770});}if(_0x2c15b0[_0x465ec1(0x10c)]>0x0&&_0x18a894['length']>0x0){const {localExpandedRuleToNames:_0x3059f7}=buildLocalExpandedRuleMappings(_0x756ce0[_0x465ec1(0xf2)]),_0x4ade81=new Map();for(const {id:_0x2bdf50,seg:_0x4ad4fe}of _0x18a894){if(_0x4ad4fe[_0x465ec1(0x12e)]){const _0x3e33ee=apiRuleToYaml(_0x4ad4fe['rule']);_0x4ade81[_0x465ec1(0xcc)](_0x2bdf50,_0x3e33ee);}}for(const {id:_0x15d37b,seg:_0x2e5a77}of _0x18a894){if(!_0x2e5a77[_0x465ec1(0x12e)])continue;const _0x75f6e0=_0x4ade81[_0x465ec1(0x16e)](_0x15d37b);if(!_0x75f6e0)continue;const _0x1e1a13=serializeExpandedRule(_0x75f6e0,_0x4ade81),_0x19e5e8=_0x3059f7['get'](_0x1e1a13);if(_0x19e5e8){const _0x1b85cd=_0x19e5e8[_0x465ec1(0x127)](_0x2a3f51=>_0x2c15b0[_0x465ec1(0xf9)](_0x2a3f51));_0x1b85cd&&(_0x10f72e['set'](_0x1b85cd,_0x15d37b),_0x2c15b0[_0x465ec1(0xc6)](_0x1b85cd),logger[_0x465ec1(0x14f)](_0x465ec1(0x164)+_0x2e5a77[_0x465ec1(0xa5)]+_0x465ec1(0xe0)+_0x1b85cd+_0x465ec1(0xf8)));}}}}async function executeSingleJourneyPush(_0x56578d,_0x6235eb,_0x435b90,_0x28a080,_0x8e1f1,_0x4f4b4c){const _0x122bb1=a159_0x1187c8,{journeyDefToRequest:_0x115d8b,activationDefToCreateRequest:_0x32815e,yamlRuleToApi:_0x4bef11,validateSegmentRule:_0x447b7a}=_0x4f4b4c,_0x5a2fb6=new Map(),_0x46acc4=new Map();recoverSegmentIdsFromPushRecovery(_0x6235eb,_0x5a2fb6,_0x435b90[_0x122bb1(0x115)]);const _0x4a1d70=new Map(),_0x13a7d1=new Map(),_0x55f169=new Map();let _0x88e575;const _0x5ce401=async()=>{const _0x30bf08=_0x122bb1;if(_0x88e575)return;_0x88e575=new Map();if(!_0x6235eb[_0x30bf08(0x111)])return;const _0x3d7381=await _0x56578d['journey'][_0x30bf08(0x11b)](_0x6235eb[_0x30bf08(0x111)]['id']);for(const _0x12b73b of _0x3d7381){const _0x425097=journeyActivationStepToYaml(_0x12b73b,_0x435b90[_0x30bf08(0xcd)],_0x435b90['connectionIdToNameMap']),_0x247b5f=activationSignature(_0x425097);!_0x88e575[_0x30bf08(0xf9)](_0x247b5f)&&_0x88e575[_0x30bf08(0xcc)](_0x247b5f,_0x12b73b['id']),_0x425097[_0x30bf08(0xa5)]&&_0x46acc4['set'](_0x425097['name'],_0x12b73b['id']);}};await matchExistingJourneySegments(_0x56578d,_0x6235eb,_0x28a080['parentId'],_0x435b90[_0x122bb1(0x105)],_0x435b90[_0x122bb1(0x115)]);const _0x3c97dc={'resolveSegmentId':async _0x1971b3=>{const _0x5f0c8b=_0x122bb1,_0x5a3588=_0x435b90[_0x5f0c8b(0x115)][_0x5f0c8b(0x16e)](_0x1971b3);if(!_0x5a3588)throw new SDKError(ErrorCode[_0x5f0c8b(0xd6)],_0x5f0c8b(0x13a)+_0x1971b3+_0x5f0c8b(0x142)+_0x6235eb[_0x5f0c8b(0xf2)][_0x5f0c8b(0xa5)]+')');return _0x5a3588;},'resolveEmbeddedSegmentId':async(_0x4cb3ab,_0x7b15df)=>{const _0x5b3902=_0x122bb1,_0x5d4d91=_0x435b90[_0x5b3902(0x115)][_0x5b3902(0x16e)](_0x4cb3ab);if(_0x5d4d91)return _0x5d4d91;const _0x3a2213=_0x435b90[_0x5b3902(0x105)][_0x5b3902(0x127)](_0x551492=>_0x551492[_0x5b3902(0xa5)]===_0x4cb3ab);if(_0x3a2213)return _0x435b90[_0x5b3902(0x115)][_0x5b3902(0xcc)](_0x4cb3ab,_0x3a2213['id']),_0x3a2213['id'];if(_0x6235eb['isNew']){const {stageName:_0x195ed7,criteriaName:_0x3f89d2}=findSegmentCriteriaLocation(_0x6235eb[_0x5b3902(0xf2)],_0x4cb3ab);return _0x447b7a(_0x4cb3ab,_0x7b15df[_0x5b3902(0x12e)]),_0x13a7d1[_0x5b3902(0xcc)](_0x4cb3ab,{'definition':_0x7b15df,'stageName':_0x195ed7,'criteriaName':_0x3f89d2}),createPendingSegmentId(_0x4cb3ab);}const _0x3bcb7f=_0x6235eb[_0x5b3902(0x111)]?.['id'];if(!_0x3bcb7f)throw new SDKError(ErrorCode[_0x5b3902(0x113)],'Cannot\x20create\x20embedded\x20segment\x20for\x20existing\x20journey\x20without\x20journey\x20ID');const _0x43baad=_0x4a1d70[_0x5b3902(0x16e)](_0x4cb3ab);if(_0x43baad)return _0x43baad;const _0x203bc8=((async()=>{const _0x4573f1=_0x5b3902;_0x447b7a(_0x4cb3ab,_0x7b15df['rule']);const _0x347a10=generateDeterministicJourneySegmentName(_0x6235eb[_0x4573f1(0xf2)][_0x4573f1(0xa5)],_0x4cb3ab),_0x41f948=_0x435b90[_0x4573f1(0x105)]['find'](_0x12576d=>_0x12576d[_0x4573f1(0xa5)]===_0x347a10),_0x4bfa4c=createSegmentIdResolver(_0x435b90[_0x4573f1(0x115)],_0x4cb3ab),_0x716371=await resolveRuleSegmentIds(_0x7b15df[_0x4573f1(0x12e)],_0x4bfa4c);let _0x3dbf5c;return _0x41f948?(await _0x56578d[_0x4573f1(0x120)][_0x4573f1(0x155)](_0x28a080[_0x4573f1(0xdc)],_0x41f948['id'],{'description':_0x7b15df['description']||'Entry\x20criteria:\x20'+_0x4cb3ab,'rule':_0x4bef11(_0x716371),'countPopulation':!![]}),_0x3dbf5c=_0x41f948['id'],saveSegmentToPushRecovery(_0x6235eb[_0x4573f1(0x166)],_0x6235eb[_0x4573f1(0xf2)]['name'],_0x4cb3ab,{'segmentId':_0x3dbf5c,'uniqueServerName':_0x347a10,'createdAt':new Date()['toISOString']()})):_0x3dbf5c=await createOrRecoverEmbeddedSegment(_0x56578d,_0x6235eb,{'localName':_0x4cb3ab,'uniqueSegmentName':_0x347a10,'description':_0x7b15df[_0x4573f1(0x186)]||_0x4573f1(0x114)+_0x4cb3ab,'journeyId':_0x3bcb7f,'resolvedRule':_0x716371,'parentId':_0x28a080[_0x4573f1(0xdc)],'folderId':_0x28a080[_0x4573f1(0x12f)]||''},_0x4bef11),_0x435b90['segmentNameToId'][_0x4573f1(0xcc)](_0x4cb3ab,_0x3dbf5c),_0x5a2fb6[_0x4573f1(0xcc)](_0x4cb3ab,_0x3dbf5c),_0x3dbf5c;})());_0x4a1d70['set'](_0x4cb3ab,_0x203bc8);try{return await _0x203bc8;}finally{_0x4a1d70[_0x5b3902(0xc6)](_0x4cb3ab);}},'resolveActivationId':async _0x19d8f=>{const _0x4d6cdd=_0x122bb1,_0x2c9d3c=_0x46acc4[_0x4d6cdd(0x16e)](_0x19d8f);if(_0x2c9d3c)return _0x2c9d3c;if(_0x6235eb[_0x4d6cdd(0x111)]){await _0x5ce401();const _0x6e2061=_0x46acc4[_0x4d6cdd(0x16e)](_0x19d8f);if(_0x6e2061)return _0x6e2061;}throw new SDKError(ErrorCode[_0x4d6cdd(0xa8)],_0x4d6cdd(0xb8)+_0x19d8f+_0x4d6cdd(0x142)+_0x6235eb[_0x4d6cdd(0xf2)][_0x4d6cdd(0xa5)]+_0x4d6cdd(0x102)+'Define\x20it\x20in\x20the\x20journey\x27s\x20\x27activations\x27\x20section\x20or\x20use\x20an\x20existing\x20activation\x20ID.');},'resolveEmbeddedActivationId':async(_0x560d60,_0x3cfd76)=>{const _0x3538c9=_0x122bb1,_0x8ce214=_0x46acc4['get'](_0x560d60);if(_0x8ce214)return _0x8ce214;if(_0x6235eb[_0x3538c9(0x91)])return _0x55f169[_0x3538c9(0xcc)](_0x560d60,_0x3cfd76),createPendingActivationId(_0x560d60);if(_0x6235eb[_0x3538c9(0x111)]){await _0x5ce401();const _0x5aa26a=_0x46acc4[_0x3538c9(0x16e)](_0x3cfd76[_0x3538c9(0xa5)]);if(_0x5aa26a)return _0x46acc4[_0x3538c9(0xcc)](_0x560d60,_0x5aa26a),_0x5aa26a;const _0x44d50d=activationSignature(_0x3cfd76),_0x19c758=_0x88e575?.[_0x3538c9(0x16e)](_0x44d50d);if(_0x19c758)return _0x46acc4[_0x3538c9(0xcc)](_0x560d60,_0x19c758),_0x19c758;const _0x232796=await _0x32815e(_0x3cfd76,_0x435b90['activationContext']),_0x44ca58={..._0x232796,..._0x3cfd76[_0x3538c9(0x13d)]!==undefined&&{'runAfterJourneyRefresh':_0x3cfd76['run_after_journey_refresh']}},_0x5cb340=await _0x56578d[_0x3538c9(0x98)][_0x3538c9(0xc0)](_0x6235eb['existingJourney']['id'],_0x44ca58);return _0x46acc4[_0x3538c9(0xcc)](_0x560d60,_0x5cb340['id']),_0x5cb340['id'];}throw new SDKError(ErrorCode[_0x3538c9(0x113)],_0x3538c9(0x134));},'resolveJourneyId':async _0x48b6b9=>{const _0x37a4b6=_0x122bb1;try{return await _0x56578d['journey'][_0x37a4b6(0x149)](_0x28a080[_0x37a4b6(0xdc)],_0x48b6b9);}catch(_0x118cff){throw new SDKError(ErrorCode[_0x37a4b6(0xa8)],_0x37a4b6(0xd5)+_0x48b6b9+'\x27\x20not\x20found\x20in\x20parent\x20segment\x20(referenced\x20in\x20jump\x20step\x20of\x20\x27'+_0x6235eb[_0x37a4b6(0xf2)][_0x37a4b6(0xa5)]+'\x27)',_0x118cff);}},'resolveStageId':async(_0x1d49d7,_0x1c6bf5)=>{const _0x55ca22=_0x122bb1,_0x2318d6=await _0x56578d['journey'][_0x55ca22(0x15c)](_0x1d49d7),_0x1591d9=_0x2318d6[_0x55ca22(0x18a)][_0x55ca22(0xe3)][_0x55ca22(0x127)](_0xbeebf1=>_0xbeebf1['name']['toLowerCase']()===_0x1c6bf5[_0x55ca22(0x128)]());if(!_0x1591d9?.['id'])throw new SDKError(ErrorCode['NOT_FOUND'],_0x55ca22(0xee)+_0x1c6bf5+_0x55ca22(0xb9)+(_0x2318d6[_0x55ca22(0x18a)]['journeyBundleName']||_0x2318d6[_0x55ca22(0x18a)][_0x55ca22(0xa5)])+'\x27');return _0x1591d9['id'];}},_0x2d8df4=await _0x115d8b(_0x6235eb[_0x122bb1(0xf2)],_0x28a080[_0x122bb1(0xdc)],_0x3c97dc),_0x2ee6f7=_0x28a080['folderId']||_0x28a080[_0x122bb1(0x12f)];_0x2ee6f7&&(_0x2d8df4['relationships']={'parentFolder':{'data':{'id':_0x2ee6f7,'type':_0x122bb1(0x14a)}}});if(_0x6235eb[_0x122bb1(0x91)]){if(_0x13a7d1[_0x122bb1(0x10c)]>0x0||_0x55f169['size']>0x0)return await executeThreeStepJourneyCreate(_0x56578d,_0x6235eb,_0x2d8df4,{'pendingEmbeddedSegments':_0x13a7d1,'pendingEmbeddedActivations':_0x55f169,'embeddedSegmentNameToId':_0x5a2fb6,'journeyActivationNameToId':_0x46acc4},{..._0x28a080,'effectiveFolderId':_0x2ee6f7},_0x435b90,_0x8e1f1,_0x4f4b4c);else{ensureJourneyDefaults(_0x2d8df4['attributes']);const _0x33238b=await _0x56578d[_0x122bb1(0x98)][_0x122bb1(0x151)](_0x2d8df4);return deletePushRecovery(_0x6235eb[_0x122bb1(0x166)]),{'action':_0x122bb1(0xae),'journeyId':_0x33238b['id'],'embeddedSegmentNameToId':_0x5a2fb6};}}else{if(_0x6235eb['hasChanges']&&_0x6235eb[_0x122bb1(0x111)]){_0x2d8df4['id']=_0x6235eb[_0x122bb1(0x111)]['id'];const _0x3b678e=_0x2d8df4[_0x122bb1(0x18a)];_0x6235eb[_0x122bb1(0x111)][_0x122bb1(0x18a)]?.[_0x122bb1(0x16d)]&&(_0x3b678e[_0x122bb1(0x16d)]=_0x6235eb[_0x122bb1(0x111)]['attributes'][_0x122bb1(0x16d)]);const _0x30015c=_0x6235eb['existingJourney'][_0x122bb1(0x18a)]?.['journeyStages'];return _0x30015c&&_0x2d8df4[_0x122bb1(0x18a)][_0x122bb1(0xe3)]&&injectExistingStageIds(_0x2d8df4['attributes'][_0x122bb1(0xe3)],_0x30015c),ensureJourneyDefaults(_0x3b678e),await _0x56578d[_0x122bb1(0x98)][_0x122bb1(0x94)](_0x6235eb[_0x122bb1(0x111)]['id'],_0x2d8df4),deletePushRecovery(_0x6235eb[_0x122bb1(0x166)]),{'action':_0x122bb1(0xcb),'journeyId':_0x6235eb[_0x122bb1(0x111)]['id'],'embeddedSegmentNameToId':_0x5a2fb6};}}return deletePushRecovery(_0x6235eb[_0x122bb1(0x166)]),{'action':_0x122bb1(0x176),'journeyId':_0x6235eb[_0x122bb1(0x111)]?.['id'],'embeddedSegmentNameToId':_0x5a2fb6};}function findSegmentCriteriaLocation(_0x39f41c,_0x203334){const _0x409f22=a159_0x1187c8,_0x38511a=_0x39f41c[_0x409f22(0x161)]||_0x39f41c['journeys']?.[0x0]?.['stages']||[];let _0x3205df=_0x409f22(0x103),_0x5cf218=_0x203334;const _0x5c6f5e=_0x39f41c[_0x409f22(0xa4)]||_0x39f41c[_0x409f22(0x8a)]?.[0x0]?.[_0x409f22(0xa4)];if(_0x5c6f5e?.[_0x409f22(0x120)]===_0x203334)return{'stageName':_0x409f22(0xa4),'criteriaName':_0x5c6f5e[_0x409f22(0xa5)]||_0x203334};_0xfe6050:for(const _0x3ddb07 of _0x38511a){if(_0x3ddb07[_0x409f22(0x9f)]?.[_0x409f22(0x120)]===_0x203334){_0x3205df=_0x3ddb07['name'],_0x5cf218=_0x3ddb07[_0x409f22(0x9f)]['name']||_0x203334;break;}if(_0x3ddb07[_0x409f22(0xd4)])for(const _0x27c1c0 of _0x3ddb07[_0x409f22(0xd4)]){if(_0x27c1c0[_0x409f22(0xd0)]==='decision_point'&&_0x27c1c0['with']?.[_0x409f22(0x146)])for(const _0x455ce5 of _0x27c1c0['with'][_0x409f22(0x146)]){if(_0x455ce5[_0x409f22(0x120)]===_0x203334){_0x3205df=_0x3ddb07['name'],_0x5cf218=_0x455ce5[_0x409f22(0xa5)]||_0x203334;break _0xfe6050;}}}}return{'stageName':_0x3205df,'criteriaName':_0x5cf218};}async function executeThreeStepJourneyCreate(_0x98e15a,_0x2b561b,_0x5989f4,_0x50740c,_0x11bc67,_0x318488,_0x3a0e1a,_0x356d97){const _0x1c6c42=a159_0x1187c8,{activationDefToCreateRequest:_0x49198a,yamlRuleToApi:_0x170bd0}=_0x356d97,{pendingEmbeddedSegments:_0x2d907b,pendingEmbeddedActivations:_0x273b4f,embeddedSegmentNameToId:_0x10b85b}=_0x50740c,_0x517a1b=JSON[_0x1c6c42(0xbf)](JSON[_0x1c6c42(0x175)](_0x5989f4));ensureJourneyDefaults(_0x517a1b[_0x1c6c42(0x18a)]),stripPendingIds(_0x517a1b);const _0x333856=await _0x98e15a[_0x1c6c42(0x98)]['create'](_0x517a1b),_0x1f32c3=_0x333856['id'],_0x34755f=new Map();for(const _0xb95bb5 of _0x333856[_0x1c6c42(0x18a)][_0x1c6c42(0xe3)]){_0x34755f['set'](_0xb95bb5['name'][_0x1c6c42(0x128)](),_0xb95bb5['id']);}recoverSegmentIdsFromPushRecovery(_0x2b561b,_0x10b85b,_0x318488['segmentNameToId']);for(const [_0x10abcb,{definition:_0x3d50cc}]of _0x2d907b){if(_0x10b85b[_0x1c6c42(0xf9)](_0x10abcb)){_0x3a0e1a[_0x1c6c42(0xec)]?.({'type':'embedded_segment_created','journeyName':_0x2b561b[_0x1c6c42(0xf2)]['name'],'segmentName':_0x10abcb});continue;}const _0x5cb7d1=generateDeterministicJourneySegmentName(_0x2b561b[_0x1c6c42(0xf2)][_0x1c6c42(0xa5)],_0x10abcb);_0x3a0e1a[_0x1c6c42(0xec)]?.({'type':_0x1c6c42(0x104),'journeyName':_0x2b561b['yamlConfig'][_0x1c6c42(0xa5)],'segmentName':_0x10abcb});const _0x4a61c5=createSegmentIdResolver(_0x318488[_0x1c6c42(0x115)],_0x10abcb),_0x48a531=await resolveRuleSegmentIds(_0x3d50cc['rule'],_0x4a61c5),_0x5e8144=await createOrRecoverEmbeddedSegment(_0x98e15a,_0x2b561b,{'localName':_0x10abcb,'uniqueSegmentName':_0x5cb7d1,'description':_0x3d50cc[_0x1c6c42(0x186)]||_0x1c6c42(0x114)+_0x10abcb,'journeyId':_0x1f32c3,'resolvedRule':_0x48a531,'parentId':_0x11bc67[_0x1c6c42(0xdc)],'folderId':_0x11bc67['effectiveFolderId']||''},_0x170bd0);_0x10b85b[_0x1c6c42(0xcc)](_0x10abcb,_0x5e8144),_0x318488[_0x1c6c42(0x115)][_0x1c6c42(0xcc)](_0x10abcb,_0x5e8144),_0x3a0e1a['onProgress']?.({'type':_0x1c6c42(0x168),'journeyName':_0x2b561b['yamlConfig'][_0x1c6c42(0xa5)],'segmentName':_0x10abcb});}const _0x375806=new Map();for(const [_0x48bf4a,_0x15f4b6]of _0x273b4f){_0x3a0e1a[_0x1c6c42(0xec)]?.({'type':_0x1c6c42(0xa1),'journeyName':_0x2b561b[_0x1c6c42(0xf2)][_0x1c6c42(0xa5)],'activationName':_0x48bf4a});const _0x439f94=await _0x49198a(_0x15f4b6,_0x318488[_0x1c6c42(0x171)]),_0x25a2ec={..._0x439f94,..._0x15f4b6['run_after_journey_refresh']!==undefined&&{'runAfterJourneyRefresh':_0x15f4b6[_0x1c6c42(0x13d)]}},_0x13a432=await _0x98e15a[_0x1c6c42(0x98)][_0x1c6c42(0xc0)](_0x1f32c3,_0x25a2ec);_0x375806['set'](_0x48bf4a,_0x13a432['id']),_0x50740c['journeyActivationNameToId'][_0x1c6c42(0xcc)](_0x48bf4a,_0x13a432['id']),_0x3a0e1a['onProgress']?.({'type':_0x1c6c42(0xa9),'journeyName':_0x2b561b[_0x1c6c42(0xf2)][_0x1c6c42(0xa5)],'activationName':_0x48bf4a});}const _0x2b9265=JSON['parse'](JSON['stringify'](_0x5989f4));return _0x2b9265['id']=_0x1f32c3,ensureJourneyDefaults(_0x2b9265[_0x1c6c42(0x18a)]),resolvePendingIdsInRequest(_0x2b9265,_0x5989f4,_0x34755f,_0x10b85b,_0x375806,_0x3a0e1a),await _0x98e15a[_0x1c6c42(0x98)][_0x1c6c42(0x94)](_0x1f32c3,_0x2b9265),deletePushRecovery(_0x2b561b['absolutePath']),{'action':_0x1c6c42(0xae),'journeyId':_0x1f32c3,'embeddedSegmentNameToId':_0x10b85b};}export function stripWaitStepPendingIds(_0x1dda7c){const _0x2e3118=a159_0x1187c8,_0x32ab2d=_0x1dda7c[_0x2e3118(0xa2)]&&isPendingSegmentId(_0x1dda7c[_0x2e3118(0xa2)]),_0x6f4776=_0x1dda7c['conditions']?.['some'](_0x1d9e74=>_0x1d9e74['segmentId']&&isPendingSegmentId(_0x1d9e74[_0x2e3118(0x185)]));(_0x32ab2d||_0x6f4776)&&(_0x1dda7c['waitStepType']=_0x2e3118(0x108),_0x1dda7c['waitStep']=0x1,_0x1dda7c[_0x2e3118(0x12c)]=_0x2e3118(0xf0),delete _0x1dda7c[_0x2e3118(0xa2)],delete _0x1dda7c[_0x2e3118(0xd8)],delete _0x1dda7c[_0x2e3118(0x138)],delete _0x1dda7c['conditions']);}export function resolveWaitStepPendingIds(_0x174a6b,_0x144261,_0x124e24,_0x44e434){const _0x55e270=a159_0x1187c8;if(_0x144261[_0x55e270(0xa2)]&&isPendingSegmentId(_0x144261['conditionSegmentId'])){const _0xc6395=_0x124e24(_0x144261[_0x55e270(0xa2)],_0x55e270(0x125)+_0x44e434+_0x55e270(0xe1));_0xc6395&&(_0x174a6b[_0x55e270(0xaa)]=_0x55e270(0x135),_0x174a6b['conditionSegmentId']=_0xc6395,delete _0x174a6b[_0x55e270(0x174)],delete _0x174a6b[_0x55e270(0x12c)],_0x144261[_0x55e270(0xd8)]!==undefined&&(_0x174a6b['conditionTimeoutDuration']=_0x144261[_0x55e270(0xd8)]),_0x144261[_0x55e270(0x138)]&&(_0x174a6b[_0x55e270(0x138)]=_0x144261['conditionTimeoutUnit']));}if(_0x144261['conditions']){const _0x4f3370=_0x144261[_0x55e270(0x16b)]['some'](_0x2bfcc3=>_0x2bfcc3[_0x55e270(0x185)]&&isPendingSegmentId(_0x2bfcc3['segmentId']));if(_0x4f3370){const _0x4b5541=_0x144261[_0x55e270(0x16b)][_0x55e270(0xbd)](_0x2e1b8f=>{const _0x449811=_0x55e270;if(_0x2e1b8f['segmentId']&&isPendingSegmentId(_0x2e1b8f[_0x449811(0x185)])){const _0x5755f7=_0x124e24(_0x2e1b8f[_0x449811(0x185)],_0x449811(0x125)+_0x44e434+_0x449811(0xe1));return{..._0x2e1b8f,'segmentId':_0x5755f7||_0x2e1b8f[_0x449811(0x185)]};}return{..._0x2e1b8f};});_0x174a6b[_0x55e270(0xaa)]=_0x55e270(0x135),_0x174a6b[_0x55e270(0x16b)]=_0x4b5541,delete _0x174a6b[_0x55e270(0x174)],delete _0x174a6b[_0x55e270(0x12c)],delete _0x174a6b['conditionSegmentId'],delete _0x174a6b[_0x55e270(0xd8)],delete _0x174a6b['conditionTimeoutUnit'];}}}function stripPendingIds(_0xc284bc){const _0x217e79=a159_0x1187c8;_0xc284bc[_0x217e79(0x18a)][_0x217e79(0xa4)]?.['segmentId']&&isPendingSegmentId(_0xc284bc[_0x217e79(0x18a)][_0x217e79(0xa4)][_0x217e79(0x185)])&&delete _0xc284bc[_0x217e79(0x18a)]['goal'];for(const _0x4a57d0 of _0xc284bc[_0x217e79(0x18a)][_0x217e79(0xe3)]||[]){_0x4a57d0[_0x217e79(0x88)]?.['segmentId']&&isPendingSegmentId(_0x4a57d0['entryCriteria'][_0x217e79(0x185)])&&delete _0x4a57d0['entryCriteria'];_0x4a57d0['milestone']?.['segmentId']&&isPendingSegmentId(_0x4a57d0[_0x217e79(0xce)][_0x217e79(0x185)])&&delete _0x4a57d0[_0x217e79(0xce)];_0x4a57d0[_0x217e79(0x152)]&&(_0x4a57d0[_0x217e79(0x152)]=_0x4a57d0['exitCriterias']['filter'](_0x1a0025=>!_0x1a0025[_0x217e79(0x185)]||!isPendingSegmentId(_0x1a0025[_0x217e79(0x185)])));if(_0x4a57d0[_0x217e79(0xd4)])for(const _0x302bf2 of Object[_0x217e79(0x188)](_0x4a57d0[_0x217e79(0xd4)])){const _0x5c4c6d=_0x4a57d0[_0x217e79(0xd4)][_0x302bf2];_0x5c4c6d['type']===_0x217e79(0x9a)&&_0x5c4c6d[_0x217e79(0x11c)]&&isPendingActivationId(_0x5c4c6d[_0x217e79(0x11c)])&&(_0x5c4c6d[_0x217e79(0x11c)]='');if(_0x5c4c6d[_0x217e79(0xd0)]===_0x217e79(0xff)&&_0x5c4c6d[_0x217e79(0x146)])for(const _0xc51ea0 of _0x5c4c6d[_0x217e79(0x146)]){_0xc51ea0[_0x217e79(0x185)]&&isPendingSegmentId(_0xc51ea0['segmentId'])&&(_0xc51ea0[_0x217e79(0x185)]='');}_0x5c4c6d[_0x217e79(0xd0)]===_0x217e79(0xac)&&stripWaitStepPendingIds(_0x5c4c6d);}}}function resolvePendingIdsInRequest(_0x503a49,_0x4c87dd,_0x386c54,_0x5d6aa1,_0x4fb358,_0x55fe93){const _0x586dc9=a159_0x1187c8,_0x4bb3b5=(_0x296105,_0x5afac7)=>{if(!isPendingSegmentId(_0x296105))return _0x296105;const _0x3d8e49=extractPendingSegmentName(_0x296105),_0xe89225=_0x5d6aa1['get'](_0x3d8e49);return!_0xe89225&&_0x55fe93['logWarning']?.('Warning:\x20Could\x20not\x20resolve\x20embedded\x20segment\x20\x27'+_0x3d8e49+'\x27\x20for\x20'+_0x5afac7),_0xe89225;};if(_0x503a49['attributes'][_0x586dc9(0xa4)]?.[_0x586dc9(0x185)]&&isPendingSegmentId(_0x503a49['attributes'][_0x586dc9(0xa4)][_0x586dc9(0x185)])){const _0x4add7f=_0x4bb3b5(_0x503a49['attributes']['goal'][_0x586dc9(0x185)],_0x586dc9(0xf4));_0x4add7f&&(_0x503a49[_0x586dc9(0x18a)][_0x586dc9(0xa4)][_0x586dc9(0x185)]=_0x4add7f);}for(const _0x271be2 of _0x503a49['attributes'][_0x586dc9(0xe3)]||[]){const _0x22b28d=_0x386c54[_0x586dc9(0x16e)](_0x271be2['name'][_0x586dc9(0x128)]());_0x22b28d&&(_0x271be2['id']=_0x22b28d);if(_0x271be2[_0x586dc9(0x88)]?.[_0x586dc9(0x185)]&&isPendingSegmentId(_0x271be2[_0x586dc9(0x88)][_0x586dc9(0x185)])){const _0x9de45a=_0x4bb3b5(_0x271be2[_0x586dc9(0x88)][_0x586dc9(0x185)],_0x586dc9(0x125)+_0x271be2[_0x586dc9(0xa5)]+_0x586dc9(0xde));_0x9de45a&&(_0x271be2[_0x586dc9(0x88)]['segmentId']=_0x9de45a);}if(_0x271be2[_0x586dc9(0x152)])for(const _0x10c9e3 of _0x271be2[_0x586dc9(0x152)]){if(_0x10c9e3[_0x586dc9(0x185)]&&isPendingSegmentId(_0x10c9e3[_0x586dc9(0x185)])){const _0xacf616=_0x4bb3b5(_0x10c9e3[_0x586dc9(0x185)],_0x586dc9(0x125)+_0x271be2[_0x586dc9(0xa5)]+'\x27\x20exit\x20criteria');_0xacf616&&(_0x10c9e3[_0x586dc9(0x185)]=_0xacf616);}}if(_0x271be2[_0x586dc9(0xce)]?.[_0x586dc9(0x185)]&&isPendingSegmentId(_0x271be2[_0x586dc9(0xce)][_0x586dc9(0x185)])){const _0x2124d3=_0x4bb3b5(_0x271be2['milestone'][_0x586dc9(0x185)],_0x586dc9(0x125)+_0x271be2[_0x586dc9(0xa5)]+'\x27\x20milestone');_0x2124d3&&(_0x271be2[_0x586dc9(0xce)][_0x586dc9(0x185)]=_0x2124d3);}if(_0x271be2['steps']){const _0x4ff22a=_0xbab69d=>_0x4c87dd[_0x586dc9(0x18a)][_0x586dc9(0xe3)]?.[_0x586dc9(0x127)](_0x5ce862=>_0x5ce862[_0x586dc9(0xa5)][_0x586dc9(0x128)]()===_0x271be2[_0x586dc9(0xa5)][_0x586dc9(0x128)]())?.[_0x586dc9(0xd4)]?.[_0xbab69d];for(const _0x2f4cca of Object[_0x586dc9(0x188)](_0x271be2[_0x586dc9(0xd4)])){const _0xf0afae=_0x271be2[_0x586dc9(0xd4)][_0x2f4cca],_0x5635cf=_0x4ff22a(_0x2f4cca);if(_0xf0afae[_0x586dc9(0xd0)]===_0x586dc9(0x9a)&&_0xf0afae[_0x586dc9(0x11c)]&&(isPendingActivationId(_0xf0afae[_0x586dc9(0x11c)])||_0xf0afae[_0x586dc9(0x11c)]==='')){if(_0x5635cf?.[_0x586dc9(0x11c)]&&isPendingActivationId(_0x5635cf[_0x586dc9(0x11c)])){const _0x8167a8=extractPendingActivationName(_0x5635cf[_0x586dc9(0x11c)]),_0xd04b72=_0x4fb358['get'](_0x8167a8);_0xd04b72&&(_0xf0afae[_0x586dc9(0x11c)]=_0xd04b72);}}if(_0xf0afae['type']===_0x586dc9(0xff)&&_0xf0afae[_0x586dc9(0x146)]&&_0x5635cf?.[_0x586dc9(0x146)])for(let _0x42a5e6=0x0;_0x42a5e6<_0xf0afae['branches'][_0x586dc9(0x136)];_0x42a5e6++){const _0x25ad93=_0xf0afae[_0x586dc9(0x146)][_0x42a5e6],_0x53c96b=_0x5635cf[_0x586dc9(0x146)][_0x42a5e6];if(_0x53c96b?.[_0x586dc9(0x185)]&&isPendingSegmentId(_0x53c96b[_0x586dc9(0x185)])){const _0x53712c=_0x4bb3b5(_0x53c96b[_0x586dc9(0x185)],'stage\x20\x27'+_0x271be2[_0x586dc9(0xa5)]+_0x586dc9(0x13f)+(_0x25ad93['name']||_0x42a5e6)+'\x27');_0x53712c&&(_0x25ad93[_0x586dc9(0x185)]=_0x53712c);}}_0xf0afae[_0x586dc9(0xd0)]==='WaitStep'&&_0x5635cf?.['type']==='WaitStep'&&resolveWaitStepPendingIds(_0xf0afae,_0x5635cf,_0x4bb3b5,_0x271be2[_0x586dc9(0xa5)]);}}}}
|
|
1
|
+
const a159_0x34a518=a159_0x2ae9;(function(_0x2b1f20,_0x36d0dc){const _0x3ce985=a159_0x2ae9,_0x478e21=_0x2b1f20();while(!![]){try{const _0x302f15=parseInt(_0x3ce985(0x1a9))/0x1*(parseInt(_0x3ce985(0x16e))/0x2)+parseInt(_0x3ce985(0x19b))/0x3+-parseInt(_0x3ce985(0x10c))/0x4+parseInt(_0x3ce985(0x1d1))/0x5*(-parseInt(_0x3ce985(0x1b3))/0x6)+-parseInt(_0x3ce985(0x112))/0x7*(-parseInt(_0x3ce985(0x145))/0x8)+parseInt(_0x3ce985(0x139))/0x9*(parseInt(_0x3ce985(0x166))/0xa)+-parseInt(_0x3ce985(0x18e))/0xb;if(_0x302f15===_0x36d0dc)break;else _0x478e21['push'](_0x478e21['shift']());}catch(_0xf780ee){_0x478e21['push'](_0x478e21['shift']());}}}(a159_0x2781,0xe6afd));import{createHash}from'crypto';import{Logger}from'../../utils/logger/index.js';const logger=Logger['of'](a159_0x34a518(0x1a1));export const PENDING_SEGMENT_PREFIX=a159_0x34a518(0x172);export const PENDING_ACTIVATION_PREFIX='__pending_act_';export function createPendingSegmentId(_0x6136cf){return''+PENDING_SEGMENT_PREFIX+_0x6136cf+'__';}export function isPendingSegmentId(_0x1c6e6b){const _0x43b9aa=a159_0x34a518;return _0x1c6e6b[_0x43b9aa(0x1ec)](PENDING_SEGMENT_PREFIX)&&!_0x1c6e6b[_0x43b9aa(0x1ec)](PENDING_ACTIVATION_PREFIX);}export function extractPendingSegmentName(_0x5075bb){const _0x128a11=a159_0x34a518;return _0x5075bb[_0x128a11(0x12f)](/^__pending_(.+)__$/,'$1');}export function createPendingActivationId(_0x5a0f77){return''+PENDING_ACTIVATION_PREFIX+_0x5a0f77+'__';}export function isPendingActivationId(_0x1e60cf){const _0x2fd0e2=a159_0x34a518;return _0x1e60cf[_0x2fd0e2(0x1ec)](PENDING_ACTIVATION_PREFIX);}export function extractPendingActivationName(_0x223364){const _0x49f9f6=a159_0x34a518;return _0x223364[_0x49f9f6(0x12f)](/^__pending_act_(.+)__$/,'$1');}export function generateDeterministicJourneySegmentName(_0xe38a24,_0x42fbc1){const _0x403f13=a159_0x34a518,_0x3f6524=_0xe38a24+'::'+(_0x42fbc1[_0x403f13(0x183)]()||'segment'),_0x374916=createHash('sha1')['update'](_0x3f6524)[_0x403f13(0x16c)]('hex')[_0x403f13(0x1c0)](0x0,0xc);return'journey_entry_criteria_'+_0x374916;}export function ensureJourneyDefaults(_0x21c943){const _0x43ef35=a159_0x34a518;!_0x21c943[_0x43ef35(0x1a4)]&&(_0x21c943[_0x43ef35(0x1a4)]=''),!_0x21c943[_0x43ef35(0x196)]&&(_0x21c943[_0x43ef35(0x196)]=_0x43ef35(0x16b));}export function injectExistingStageIds(_0x1f5115,_0x19053c){const _0x57ae70=a159_0x34a518,_0x13b6d8=new Map(_0x19053c[_0x57ae70(0x155)](_0x341cb4=>[_0x341cb4[_0x57ae70(0x17f)],_0x341cb4['id']]));for(const _0xca5705 of _0x1f5115){if(!_0xca5705['id']){const _0xa00e10=_0x13b6d8[_0x57ae70(0x197)](_0xca5705[_0x57ae70(0x17f)]);_0xa00e10&&(_0xca5705['id']=_0xa00e10);}}}export function resolveTDFolderPath(_0x36593a,_0x17bae2,_0x49c72b){const _0x3b2b82=a159_0x34a518;if(!_0x17bae2)return _0x36593a;if(_0x36593a===_0x49c72b||_0x36593a[_0x3b2b82(0x1ec)](_0x49c72b+'/'))return _0x36593a;return _0x36593a?_0x49c72b+'/'+_0x36593a:_0x49c72b;}export function addFoldersToCreate(_0x226902,_0x5977b2,_0x5bfd4f){const _0x43ecf6=a159_0x34a518;if(!_0x226902)return;if(_0x5977b2['has'](_0x226902))return;const _0x24a939=_0x226902[_0x43ecf6(0x167)]('/');let _0x5d379b='';for(const _0x321de3 of _0x24a939){_0x5d379b=_0x5d379b?_0x5d379b+'/'+_0x321de3:_0x321de3,!_0x5977b2[_0x43ecf6(0x1c5)](_0x5d379b)&&_0x5bfd4f[_0x43ecf6(0x15f)](_0x5d379b);}}export function sortFoldersByDepth(_0x32f6e9){const _0x2c67e3=a159_0x34a518;return[..._0x32f6e9][_0x2c67e3(0x143)]((_0x2319a5,_0x2bd8ce)=>{const _0x3a3d5d=_0x2c67e3,_0x4d0af7=(_0x2319a5[_0x3a3d5d(0x194)](/\//g)||[])[_0x3a3d5d(0x116)],_0x5d0fbf=(_0x2bd8ce[_0x3a3d5d(0x194)](/\//g)||[])[_0x3a3d5d(0x116)];return _0x4d0af7-_0x5d0fbf;});}import*as a159_0xb9525d from'yaml';import{readFileSync}from'fs';import a159_0x4930b8 from'path';import{isJourneyDef,parseYamlString as a159_0x1e2933,toYamlString as a159_0x3e2fec,normalizeJourneyDef,hasMultipleVersions,journeyResponseToDef,collectSegmentIdsFromJourneyApi}from'./journey-yaml.js';import{SEGMENT_KIND_JOURNEY,generateJourneyLocalName,sanitizeYamlKey,createJumpTargetCache,resolveJumpTarget,buildMergedJourneyDef,buildLocalRuleToNameMappingFromJourney,collectSegmentUsageCounts}from'./journey-utils.js';import{activationResponseToDef,segmentToYamlString,segmentWithActivationsToYaml,parseSegmentYamlFile,normalizeChildSegmentYaml,apiRuleToYaml,yamlRuleToApi,serializeExpandedRule,collectSegmentRefsFromRule,resolveRuleSegmentRefs,resolveRuleSegmentIds,journeyActivationStepToYaml}from'./child-segment-yaml.js';import{generateDiff,formatDiffWithColors,hasChanges}from'../../utils/diff.js';import{batchAsync}from'../../utils/async.js';import{buildFolderMaps}from'./resolution-context.js';import{SDKError,ErrorCode,isHttp400Error,getErrorMessage}from'../errors.js';import{readPushRecovery,saveSegmentToPushRecovery,deletePushRecovery}from'./push-recovery.js';import{validateSegmentDef,formatValidationResult}from'./yaml-validator.js';import{validateJourneyDef}from'./journey-validator.js';function stableStringify(_0x1154b4){const _0xf8fc56=a159_0x34a518;if(Array['isArray'](_0x1154b4))return'['+_0x1154b4[_0xf8fc56(0x155)](_0x323239=>stableStringify(_0x323239))[_0xf8fc56(0x1cb)](',')+']';if(_0x1154b4&&typeof _0x1154b4==='object'){const _0x3fa6c9=_0x1154b4,_0x498346=Object['keys'](_0x3fa6c9)[_0xf8fc56(0x143)](),_0x28ed64=_0x498346[_0xf8fc56(0x155)](_0x2bc4d3=>'\x22'+_0x2bc4d3+'\x22:'+stableStringify(_0x3fa6c9[_0x2bc4d3]));return'{'+_0x28ed64[_0xf8fc56(0x1cb)](',')+'}';}const _0x25e668=JSON[_0xf8fc56(0x1d9)](_0x1154b4);return _0x25e668===undefined?_0xf8fc56(0x154):_0x25e668;}function activationSignature(_0x38bf23){const _0x1a7d4f=a159_0x34a518,_0x4e1e6c={'connection':_0x38bf23[_0x1a7d4f(0x129)],..._0x38bf23[_0x1a7d4f(0x12e)]!==undefined&&{'all_columns':_0x38bf23[_0x1a7d4f(0x12e)]},..._0x38bf23[_0x1a7d4f(0x1bf)]!==undefined&&{'columns':_0x38bf23['columns']},..._0x38bf23[_0x1a7d4f(0x1c7)]!==undefined&&{'behavior':_0x38bf23[_0x1a7d4f(0x1c7)]},..._0x38bf23['schedule']!==undefined&&{'schedule':_0x38bf23[_0x1a7d4f(0x11f)]},..._0x38bf23[_0x1a7d4f(0x142)]!==undefined&&{'notification':_0x38bf23[_0x1a7d4f(0x142)]},..._0x38bf23[_0x1a7d4f(0x1c3)]!==undefined&&{'connector_config':_0x38bf23[_0x1a7d4f(0x1c3)]},..._0x38bf23[_0x1a7d4f(0x1af)]!==undefined&&{'activation_template_id':_0x38bf23['activation_template_id']}};return stableStringify(_0x4e1e6c);}async function fetchSegment(_0x5d4d5f,_0xaa60be,_0x87c600,_0x342799){const _0x4059e3=a159_0x34a518,_0x3096e9=_0x342799?.['find'](_0x435f95=>_0x435f95['id']===_0x87c600);if(_0x3096e9)return _0x3096e9;try{return await _0x5d4d5f[_0x4059e3(0x163)][_0x4059e3(0x1b8)](_0xaa60be,_0x87c600);}catch(_0x44717b){logger['debug'](_0x4059e3(0x137)+_0x87c600+_0x4059e3(0x1de)+_0x44717b);try{return await _0x5d4d5f[_0x4059e3(0x163)]['getSegmentEntity'](_0x87c600);}catch(_0x4468d8){return logger['debug']('getSegmentEntity\x20also\x20failed\x20for\x20'+_0x87c600+':\x20'+_0x4468d8),null;}}}function a159_0x2ae9(_0x32f5d6,_0x2e8cca){_0x32f5d6=_0x32f5d6-0x10c;const _0x2781a7=a159_0x2781();let _0x2ae9b9=_0x2781a7[_0x32f5d6];return _0x2ae9b9;}function recoverSegmentIdsFromPushRecovery(_0x2b7b2f,_0x4e8111,_0x1ded2c){const _0x4ff8dc=a159_0x34a518,_0x4d07e3=readPushRecovery(_0x2b7b2f[_0x4ff8dc(0x206)]);if(_0x4d07e3?.['journeyName']===_0x2b7b2f[_0x4ff8dc(0x124)][_0x4ff8dc(0x17f)])for(const [_0x1cea4a,_0x468360]of Object[_0x4ff8dc(0x147)](_0x4d07e3[_0x4ff8dc(0x115)])){const _0x20fd89=generateDeterministicJourneySegmentName(_0x2b7b2f[_0x4ff8dc(0x124)][_0x4ff8dc(0x17f)],_0x1cea4a);_0x468360[_0x4ff8dc(0x1c8)]===_0x20fd89&&(_0x4e8111[_0x4ff8dc(0x148)](_0x1cea4a,_0x468360['segmentId']),_0x1ded2c[_0x4ff8dc(0x148)](_0x1cea4a,_0x468360[_0x4ff8dc(0x12d)]));}}async function createOrRecoverEmbeddedSegment(_0x421f29,_0x34a30b,_0x32a424,_0x3bf5d8){const _0xc0bf59=a159_0x34a518;let _0x40ef96;try{_0x40ef96=await _0x421f29[_0xc0bf59(0x163)][_0xc0bf59(0x1b0)]({'name':_0x32a424[_0xc0bf59(0x192)],'description':_0x32a424[_0xc0bf59(0x1a4)],'journeyId':_0x32a424['journeyId'],'rule':_0x3bf5d8(_0x32a424[_0xc0bf59(0x1d6)],!![]),'countPopulation':!![],'parentFolderId':_0x32a424[_0xc0bf59(0x202)],'audienceId':_0x32a424[_0xc0bf59(0x1db)]});}catch(_0x512e00){const _0xb4b6c3=_0x512e00 instanceof Error&&_0x512e00[_0xc0bf59(0x18f)][_0xc0bf59(0x150)](_0xc0bf59(0x186));if(_0xb4b6c3){const _0x40f5b3=readPushRecovery(_0x34a30b[_0xc0bf59(0x206)]),_0x1a774c=_0x40f5b3?.['journeyName']===_0x34a30b['yamlConfig']['name']?_0x40f5b3[_0xc0bf59(0x115)][_0x32a424[_0xc0bf59(0x120)]]:undefined;if(_0x1a774c?.['uniqueServerName']===_0x32a424['uniqueSegmentName'])await _0x421f29[_0xc0bf59(0x163)][_0xc0bf59(0x1f6)](_0x32a424[_0xc0bf59(0x1db)],_0x1a774c[_0xc0bf59(0x12d)],{'description':_0x32a424['description'],'rule':_0x3bf5d8(_0x32a424['resolvedRule'],!![]),'countPopulation':!![]}),_0x40ef96=_0x1a774c[_0xc0bf59(0x12d)];else throw new SDKError(ErrorCode[_0xc0bf59(0x189)],_0xc0bf59(0x15d)+_0x32a424[_0xc0bf59(0x120)]+_0xc0bf59(0x118)+(_0xc0bf59(0x1ae)+_0x34a30b[_0xc0bf59(0x206)][_0xc0bf59(0x12f)](/([^/]+)$/,_0xc0bf59(0x20c))+')\x20')+_0xc0bf59(0x125),_0x512e00);}else throw _0x512e00;}return saveSegmentToPushRecovery(_0x34a30b[_0xc0bf59(0x206)],_0x34a30b[_0xc0bf59(0x124)][_0xc0bf59(0x17f)],_0x32a424['localName'],{'segmentId':_0x40ef96,'uniqueServerName':_0x32a424[_0xc0bf59(0x192)],'createdAt':new Date()[_0xc0bf59(0x175)]()}),_0x40ef96;}export async function prepareSegmentFiles(_0x4e593e,_0xe2db5a,_0x5703cb,_0x418a38,_0x4dff4f){const _0x327cb4=a159_0x34a518,{activationDefToCreateRequest:_0x382832}=await import(_0x327cb4(0x11e)),_0xf36d24=[],_0x5f27bb=new Set();for(const {yamlConfig:_0x16dc16,folderPath:_0x5ecbe6,sourcePath:_0x22c3cb}of _0x4e593e){const _0x180909=resolveTDFolderPath(_0x5ecbe6,_0x418a38,_0x4dff4f),_0x1b1ae2=_0x180909+':'+_0x16dc16[_0x327cb4(0x17f)],_0x13b23b=_0xe2db5a[_0x327cb4(0x1c2)][_0x327cb4(0x197)](_0x1b1ae2),_0x442b4b=_0x13b23b?_0xe2db5a[_0x327cb4(0x15a)][_0x327cb4(0x197)](_0x13b23b['id'])||[]:[];addFoldersToCreate(_0x180909,_0xe2db5a[_0x327cb4(0x16d)],_0x5f27bb);const _0x3da693=calculateActivationActions(_0x16dc16[_0x327cb4(0x126)]||[],_0x442b4b,_0xe2db5a[_0x327cb4(0x15b)],_0xe2db5a[_0x327cb4(0x1da)]);for(const _0x24d9e8 of _0x3da693){(_0x24d9e8[_0x327cb4(0x152)]===_0x327cb4(0x1a3)||_0x24d9e8['type']===_0x327cb4(0x1d7))&&_0x24d9e8[_0x327cb4(0x19d)]&&(_0x24d9e8[_0x327cb4(0x20b)]=await _0x382832(_0x24d9e8[_0x327cb4(0x19d)],_0x5703cb));}const _0xd4aeb1=calculateSegmentDiff(_0x16dc16,_0x13b23b,_0x442b4b,_0xe2db5a['idToEmailMap'],_0xe2db5a[_0x327cb4(0x1da)]);_0xf36d24['push']({'relativePath':_0x16dc16[_0x327cb4(0x17f)],'absolutePath':_0x22c3cb,'yamlConfig':_0x16dc16,'folderPath':_0x180909,'existingSegment':_0x13b23b,'existingActivations':_0x442b4b,'isNew':_0xd4aeb1[_0x327cb4(0x164)],'hasChanges':_0xd4aeb1[_0x327cb4(0x1f9)],'diff':_0xd4aeb1[_0x327cb4(0x1ef)],'activationActions':_0x3da693});}return{'segmentFiles':_0xf36d24,'foldersToCreate':_0x5f27bb};}export async function prepareJourneyFiles(_0x5edfb6,_0x35815e,_0x39bc3c,_0x47978e){const _0x20a7ab=a159_0x34a518,_0x72a0d1=[],_0x134764=new Set();for(const {yamlConfig:_0x37bab9,folderPath:_0x487480,sourcePath:_0x320dc6}of _0x5edfb6){const _0x2d7870=resolveTDFolderPath(_0x487480,_0x39bc3c,_0x47978e),_0x53db0b=_0x2d7870+':'+_0x37bab9[_0x20a7ab(0x17f)],_0x4f0c7a=_0x35815e[_0x20a7ab(0x1ab)][_0x20a7ab(0x197)](_0x53db0b);let _0x37df15,_0x2d6067;if(_0x4f0c7a&&_0x4f0c7a[_0x20a7ab(0x116)]>0x0){const _0x3fe335=buildLocalExpandedRuleMappings(_0x37bab9),{createYamlContext:_0x200139,prefetchJourneySegments:_0x3c4138}=createPushYamlContextForBundle(_0x35815e[_0x20a7ab(0x1fd)],_0x35815e[_0x20a7ab(0x1db)],_0x35815e[_0x20a7ab(0x117)],_0x3fe335,_0x35815e[_0x20a7ab(0x15b)],_0x35815e[_0x20a7ab(0x1da)],_0x35815e[_0x20a7ab(0x1a2)],_0x35815e[_0x20a7ab(0x207)]);await _0x3c4138(_0x4f0c7a[_0x20a7ab(0x155)](_0x59bc50=>_0x59bc50['id']));const _0x2263e1=await _0x35815e['deps'][_0x20a7ab(0x113)][_0x20a7ab(0x1fa)](_0x4f0c7a[0x0][_0x20a7ab(0x1e1)]),_0x3169e1=hasMultipleVersions(_0x37bab9),_0x3dc8b6=async _0x40f92a=>{const _0xb58e3d=_0x20a7ab,_0xd54d76=_0x35815e[_0xb58e3d(0x207)]?.[_0xb58e3d(0x197)](_0x40f92a);if(_0xd54d76)return _0xd54d76;return _0x35815e[_0xb58e3d(0x14a)]({'journeyId':_0x40f92a,'journeyName':_0x37bab9[_0xb58e3d(0x17f)],'isMultiVersion':_0x4f0c7a[_0xb58e3d(0x116)]>0x1});};if(_0x3169e1&&_0x4f0c7a[_0x20a7ab(0x116)]>0x1){const _0x4525ff=[];for(const _0x3f5475 of _0x4f0c7a){const _0x336ed6=_0x3f5475[_0x20a7ab(0x162)]||0x1;_0x35815e[_0x20a7ab(0x165)]?.[_0x20a7ab(0x1d7)](_0x20a7ab(0x193)+_0x37bab9[_0x20a7ab(0x17f)]+'\x20v'+_0x336ed6);const _0x271507=await _0x3dc8b6(_0x3f5475['id']),_0x1112f6=_0x200139(_0x3f5475['id']),_0x3ca49d=await journeyResponseToDef(_0x271507,_0x1112f6);_0x4525ff['push']({'item':_0x3f5475,'yaml':_0x3ca49d});}const _0x5ec5c2=buildLocalRuleToNameMappingFromJourney(_0x37bab9);_0x2d6067=buildMergedJourneyDef(_0x4525ff,_0x5ec5c2,_0x2263e1);const _0x432f71=Math['max'](..._0x4525ff[_0x20a7ab(0x155)](_0x377987=>_0x377987[_0x20a7ab(0x11b)][_0x20a7ab(0x162)]||0x0)),_0x1873f7=_0x4f0c7a[_0x20a7ab(0x1f8)](_0x4d93f4=>(_0x4d93f4[_0x20a7ab(0x162)]||0x0)===_0x432f71);_0x1873f7&&(_0x35815e[_0x20a7ab(0x165)]?.[_0x20a7ab(0x1d7)]('Fetching\x20'+_0x37bab9[_0x20a7ab(0x17f)]+'\x20v'+_0x432f71),_0x37df15=await _0x3dc8b6(_0x1873f7['id']));}else{const _0xedcee5=_0x4f0c7a[_0x4f0c7a['length']-0x1];_0x35815e[_0x20a7ab(0x165)]?.['update'](_0x20a7ab(0x193)+_0x37bab9['name']),_0x37df15=await _0x3dc8b6(_0xedcee5['id']);const _0x44e378=_0x200139(_0xedcee5['id']),_0x54d308=await journeyResponseToDef(_0x37df15,_0x44e378),_0x2ee6df=buildLocalRuleToNameMappingFromJourney(_0x37bab9);_0x2d6067=buildMergedJourneyDef([{'item':_0xedcee5,'yaml':_0x54d308}],_0x2ee6df,_0x2263e1);}}addFoldersToCreate(_0x2d7870,_0x35815e['folderPathToId'],_0x134764);const _0x57225a=calculateJourneyDiff(_0x37bab9,_0x2d6067);_0x72a0d1[_0x20a7ab(0x1eb)]({'relativePath':_0x37bab9[_0x20a7ab(0x17f)],'absolutePath':_0x320dc6,'yamlConfig':_0x37bab9,'folderPath':_0x2d7870,'existingJourney':_0x37df15,'isNew':_0x57225a['isNew'],'hasChanges':_0x57225a['hasChanges'],'diff':_0x57225a[_0x20a7ab(0x1ef)]});}return{'journeyFiles':_0x72a0d1,'foldersToCreate':_0x134764};}export function calculateActivationActions(_0x2d1ff6,_0x5074dd,_0x7c55ff,_0x274fa5){const _0x50930e=a159_0x34a518,_0x7f05a9=[],_0xe00cd9=new Map();for(const _0x4de2c9 of _0x5074dd){_0xe00cd9[_0x50930e(0x148)](_0x4de2c9['name'],_0x4de2c9);}const _0x8bf0c7=new Map();for(const _0x594611 of _0x2d1ff6){_0x8bf0c7[_0x50930e(0x148)](_0x594611[_0x50930e(0x17f)],_0x594611);}for(const _0x398e0f of _0x2d1ff6){const _0x4cc0b9=_0xe00cd9[_0x50930e(0x197)](_0x398e0f['name']);if(!_0x4cc0b9)_0x7f05a9[_0x50930e(0x1eb)]({'type':_0x50930e(0x1a3),'name':_0x398e0f['name'],'yamlActivation':_0x398e0f});else{const _0x1bfe7a=activationResponseToDef(_0x4cc0b9,_0x7c55ff,_0x274fa5),_0x51b060=a159_0xb9525d[_0x50930e(0x1d9)](_0x1bfe7a),_0x3a5817=a159_0xb9525d['stringify'](_0x398e0f);_0x51b060!==_0x3a5817&&_0x7f05a9[_0x50930e(0x1eb)]({'type':'update','name':_0x398e0f['name'],'yamlActivation':_0x398e0f,'existingActivation':_0x4cc0b9});}}for(const _0x2b6295 of _0x5074dd){!_0x8bf0c7[_0x50930e(0x1c5)](_0x2b6295[_0x50930e(0x17f)])&&_0x7f05a9[_0x50930e(0x1eb)]({'type':'delete','name':_0x2b6295[_0x50930e(0x17f)],'existingActivation':_0x2b6295});}return _0x7f05a9;}function calculateYamlDiff(_0x27deaf,_0x330dfa){if(_0x330dfa){const _0x440d14=generateDiff(_0x330dfa,_0x27deaf),_0x5b0751=hasChanges(_0x440d14);return{'isNew':![],'hasChanges':_0x5b0751,'diff':_0x5b0751?formatDiffWithColors(_0x440d14):undefined};}const _0x12de49=generateDiff('',_0x27deaf);return{'isNew':!![],'hasChanges':![],'diff':formatDiffWithColors(_0x12de49)};}export function calculateSegmentDiff(_0x195396,_0x9a681b,_0x17cb8b,_0x5f2393,_0x133407){const _0x1b3248=segmentToYamlString(_0x195396),_0x182d7e=_0x9a681b?segmentToYamlString(segmentWithActivationsToYaml(_0x9a681b,_0x17cb8b,undefined,_0x5f2393,_0x133407)):undefined;return calculateYamlDiff(_0x1b3248,_0x182d7e);}export function calculateJourneyDiff(_0x483208,_0x2f03e8){const _0x6615f=normalizeJourneyDef(_0x483208,_0x483208),_0x156464=a159_0x3e2fec(_0x6615f),_0x2a2435=_0x2f03e8?a159_0x3e2fec(normalizeJourneyDef(_0x2f03e8,_0x483208)):undefined;return calculateYamlDiff(_0x156464,_0x2a2435);}export function findSegmentsToDelete(_0x5fca2a,_0x4ce35b,_0x10592e,_0x3b2a26,_0x48cfcd){const _0x4de5e5=a159_0x34a518,_0x4c508e=new Set();for(const {yamlConfig:_0xca26be,folderPath:_0x4742e1}of _0x4ce35b){_0x4c508e[_0x4de5e5(0x15f)](_0x4742e1+':'+_0xca26be[_0x4de5e5(0x17f)]);}return _0x5fca2a[_0x4de5e5(0x1fc)](_0x5ac496=>{const _0xfda5e9=_0x4de5e5,_0x161166=_0x5ac496[_0xfda5e9(0x208)]?_0x10592e[_0xfda5e9(0x197)](_0x5ac496[_0xfda5e9(0x208)][_0xfda5e9(0x168)]())||'':'',_0x3365ba=_0x161166+':'+_0x5ac496['name'];if(_0x4c508e[_0xfda5e9(0x1c5)](_0x3365ba))return![];if(_0x48cfcd)return _0x161166===_0x3b2a26||_0x161166[_0xfda5e9(0x1ec)](_0x3b2a26+'/');return!![];});}export function findJourneysToDelete(_0x29bd27,_0x1139d2,_0x484ebb,_0x4ec412,_0x2ced3f){const _0x331e0d=a159_0x34a518,_0x5093e6=new Set();for(const {yamlConfig:_0x1be87c,folderPath:_0x4ec799}of _0x1139d2){_0x5093e6[_0x331e0d(0x15f)](_0x4ec799+':'+_0x1be87c[_0x331e0d(0x17f)]);}return _0x29bd27[_0x331e0d(0x1fc)](_0x195820=>{const _0x330160=_0x331e0d,_0x2755c6=_0x195820[_0x330160(0x202)]?_0x484ebb[_0x330160(0x197)](_0x195820['folderId'])||'':'',_0xf4b62b=_0x2755c6+':'+_0x195820['journeyBundleName'];if(_0x5093e6['has'](_0xf4b62b))return![];if(_0x2ced3f)return _0x2755c6===_0x4ec412||_0x2755c6[_0x330160(0x1ec)](_0x4ec412+'/');return!![];});}function a159_0x2781(){const _0x37f600=['exitCriterias','tdx.sdk.push-workflow','activationStepsById','create','description','deleteSegment','onProgress','parentSegmentFolder','\x20journey\x20from\x20file:\x20','1232788DKYTFH','Updated\x20activation\x20\x27','journeyBundlesByFolderAndName','\x27\x20exit\x20criteria','effectiveFolderId','Delete\x20the\x20push\x20recovery\x20file\x20(','activation_template_id','createJourneySegment','entryCriteria','user','54lSKDrq','):\x20','activation_creating','journeyId','\x20segment\x20from\x20file:\x20','getSegment','reduce','milestone','branches','logInfo','journeyStages','max','columns','slice','logWarning','segmentByFolderAndName','connector_config','waitStep','has','Created\x20folder\x20\x27','behavior','uniqueServerName','Deleted\x20segment\x20\x27','waitStepUnit','join','Failed\x20to\x20fetch\x20referenced\x20segment\x20','updated','goal','\x20(referenced\x20in\x20embedded\x20segment\x20\x27','results','59095tQzHka','relationships','Creating\x20activation\x20\x27','withProgress','kind','resolvedRule','update','resolveJourneyId','stringify','connectionIdToNameMap','parentId','stages','day',',\x20falling\x20back\x20to\x20getSegmentEntity:\x20','./journey-yaml.js','embedded_activation_creating','journeyBundleId','all','debug','conditionSegmentId','\x27\x20entry\x20criteria','activationParams','goal\x20criteria','conditionTimeoutDuration','NOT_FOUND','deleteActivation','push','startsWith','data','Define\x20it\x20in\x20the\x20journey\x27s\x20\x27activations\x27\x20section\x20or\x20use\x20an\x20existing\x20activation\x20ID.','diff','conditionTimeoutUnit','Condition','getActivation','WaitStep','some','createdSegmentIds','updateSegmentById','parseDocument','find','hasChanges','getLatestJourneyId','segment_deleted','filter','deps','journeyActivationStepId','Creating\x20folder\x20\x27','activation_created','Matched\x20server\x20segment\x20\x27','folderId','journey_updating','resolveSegment','idToName','absolutePath','journeyById','segmentFolderId','listActivations','steps','validatedRequest','.$1.push-recovery.json','\x0a\x20\x20','run_after_journey_refresh','verbose','2047016gwYOXJ','flatMap','unchanged','relative','existingJourney','createActivation','148309zuakbx','journey','Updated\x20segment\x20\x27','segments','length','existingSegments','\x27\x20already\x20exists\x20on\x20server\x20but\x20cannot\x20be\x20found.\x20','\x27\x20decision\x20point\x20branch\x20\x27','utf-8','item','createdSegmentId','waitStepType','./child-segment-yaml.js','schedule','localName','Segment\x20not\x20found:\x20','keys','created','yamlConfig','and\x20the\x20server\x20segment,\x20then\x20retry.','activations','action','journeyBundleName','connection','embedded_segment_created','\x27...','INTERNAL','segmentId','all_columns','replace','logSuccess','segment_updating','with','Cannot\x20create\x20embedded\x20activation\x20without\x20journey\x20context','folder_created','Warning:\x20Could\x20not\x20resolve\x20embedded\x20segment\x20\x27','\x27\x20wait\x20condition','getSegment\x20failed\x20for\x20','activation_deleted','1494sGEFGc','Segment\x20not\x20found','\x20(referenced\x20in\x20journey\x20','conditions','stage\x20\x27','Journey\x20\x27','segmentNameToId','\x27\x20for\x20','deleted','notification','sort','activationContext','136DdjCwV','Updating\x20segment\x20\x27','entries','set','valid','fetchJourney','list','ACTIVATION_UPDATE_ERROR','entry_criteria','Stage\x20\x27','folder','includes','SEGMENT_NOT_FOUND','type','segment_updated','null','map','errors','skipSegments','journey_creating','JOURNEY_SYNTAX_ERROR','activationsBySegmentId','idToEmailMap','JOURNEY_UPDATE_ERROR','Embedded\x20segment\x20\x27','parse','add','\x20error(s)','\x27\x20from\x20file:\x20','versionNumber','segment','isNew','progress','24500dLQSrf','split','toString','existingSegment','Failed\x20to\x20','draft','digest','folderPathToId','2sZWtYG','journeys','\x20activation\x20\x27','delete','__pending_','DecisionPoint','Deleting\x20activation\x20\x27','toISOString','../../utils/async.js','dirname','values','\x27\x20to\x20local\x20\x27','toLowerCase','\x27\x20not\x20found\x20in\x20journey\x20\x27','index','Updating\x20activation\x20\x27','parentFolder','name','Created\x20segment\x20\x27','Entry\x20criteria:\x20','segment_created','trim',').\x20','rule','Name\x20has\x20already\x20been\x20taken','embedded_segment_creating','getJourney','SEGMENT_UPDATE_ERROR','logDeleted','Cannot\x20create\x20embedded\x20segment\x20for\x20existing\x20journey\x20without\x20journey\x20ID','existingActivation','attributes','18820879hqyLGA','message','activationActions','Failed\x20to\x20sync\x20activations\x20for\x20segment\x20\x27','uniqueSegmentName','Fetching\x20','match','\x27\x20by\x20rule\x20content','state','get','Duration','journeyActivationNameToId','size','3823020EZIEdc','from','yamlActivation','rootFolderId','folderPath'];a159_0x2781=function(){return _0x37f600;};return a159_0x2781();}export function buildSegmentLookupMap(_0x58bfbd,_0x28197c){const _0x4f98d5=a159_0x34a518,_0x3df20a=new Map();for(const _0x4816d3 of _0x58bfbd){const _0x11174b=_0x4816d3[_0x4f98d5(0x208)]?_0x28197c[_0x4f98d5(0x197)](_0x4816d3['segmentFolderId'][_0x4f98d5(0x168)]())||'':'',_0x50925c=_0x11174b+':'+_0x4816d3['name'];_0x3df20a[_0x4f98d5(0x148)](_0x50925c,_0x4816d3);}return _0x3df20a;}export function buildSegmentNameToIdMap(_0x4a5247){const _0xa236d3=a159_0x34a518,_0x52ae20=new Map();for(const _0x3a3605 of _0x4a5247){_0x52ae20['set'](_0x3a3605[_0xa236d3(0x17f)],_0x3a3605['id']);}return _0x52ae20;}export function buildJourneyBundleLookupMap(_0x56b62b,_0x58b5a0){const _0x2f0819=a159_0x34a518,_0x3aa68a=new Map();for(const _0xc83904 of _0x56b62b){const _0x1027bb=_0xc83904[_0x2f0819(0x202)]?_0x58b5a0['get'](_0xc83904[_0x2f0819(0x202)])||'':'',_0x358699=_0x1027bb+':'+_0xc83904[_0x2f0819(0x128)];!_0x3aa68a[_0x2f0819(0x1c5)](_0x358699)&&_0x3aa68a[_0x2f0819(0x148)](_0x358699,[]),_0x3aa68a['get'](_0x358699)[_0x2f0819(0x1eb)](_0xc83904);}for(const _0x36e205 of _0x3aa68a[_0x2f0819(0x178)]()){_0x36e205[_0x2f0819(0x143)]((_0x4ef664,_0x36c710)=>(_0x4ef664[_0x2f0819(0x162)]||0x0)-(_0x36c710[_0x2f0819(0x162)]||0x0));}return _0x3aa68a;}export function collectFoldersToCreate(_0x296a1b,_0x1ca209){const _0x4dd6d0=a159_0x34a518,_0x5caad5=new Set();for(const _0x1f6052 of _0x296a1b){if(!_0x1f6052)continue;if(_0x1ca209['has'](_0x1f6052))continue;const _0x39dc65=_0x1f6052[_0x4dd6d0(0x167)]('/');let _0x4ca07f='';for(const _0x5392ad of _0x39dc65){_0x4ca07f=_0x4ca07f?_0x4ca07f+'/'+_0x5392ad:_0x5392ad,!_0x1ca209[_0x4dd6d0(0x1c5)](_0x4ca07f)&&_0x5caad5['add'](_0x4ca07f);}}return _0x5caad5;}export function parseAndClassifyYamlFiles(_0x5707c4,_0x56335c,_0x5e94ac){const _0x724cf2=a159_0x34a518,_0x90cad0=[],_0x16623d=[];for(const _0x320c20 of _0x5707c4){const _0xe0d983=a159_0x4930b8[_0x724cf2(0x10f)](_0x56335c,a159_0x4930b8[_0x724cf2(0x177)](_0x320c20)),_0x3356a2=_0xe0d983==='.'?'':_0xe0d983[_0x724cf2(0x12f)](/\\/g,'/'),_0x90c0ae=readFileSync(_0x320c20,_0x724cf2(0x11a)),_0x196e2e=a159_0xb9525d[_0x724cf2(0x15e)](_0x90c0ae);if(isJourneyDef(_0x196e2e,_0x320c20)){const _0x166c1e=a159_0x1e2933(_0x90c0ae);_0x16623d[_0x724cf2(0x1eb)]({'yamlConfig':_0x166c1e,'folderPath':_0x3356a2,'sourcePath':_0x320c20});}else{if(!_0x5e94ac?.[_0x724cf2(0x157)]){const _0x4f0a36=parseSegmentYamlFile(_0x90c0ae),_0x35d65f=normalizeChildSegmentYaml(_0x4f0a36);_0x90cad0['push']({'yamlConfig':_0x35d65f,'folderPath':_0x3356a2,'sourcePath':_0x320c20});}}}return{'segments':_0x90cad0,'journeys':_0x16623d};}export function validateParsedFiles(_0x264626,_0x6a6478){const _0x24d07d=a159_0x34a518,_0x114028=[];for(const {yamlConfig:_0xf5acf2,sourcePath:_0x1a151b}of _0x264626['segments']){const _0x53eccb=readFileSync(_0x1a151b,_0x24d07d(0x11a)),_0x23bf4f=a159_0xb9525d[_0x24d07d(0x1f7)](_0x53eccb),_0x50d910=validateSegmentDef(_0xf5acf2,{'source':_0x53eccb,'document':_0x23bf4f},{'skipSchema':!![]});if(!_0x50d910[_0x24d07d(0x149)]){const _0x34f354=a159_0x4930b8[_0x24d07d(0x10f)](_0x6a6478,_0x1a151b);_0x114028[_0x24d07d(0x1eb)]({'filePath':_0x34f354,'source':_0x53eccb,'result':_0x50d910,'isJourney':![]});}}for(const {yamlConfig:_0xc75101,sourcePath:_0x71e95c}of _0x264626['journeys']){const _0x1c8b58=readFileSync(_0x71e95c,_0x24d07d(0x11a)),_0x3d3c2d=a159_0xb9525d[_0x24d07d(0x1f7)](_0x1c8b58),_0x1dc19d=validateJourneyDef(_0xc75101,{'source':_0x1c8b58,'document':_0x3d3c2d},{'skipSchema':!![]});if(!_0x1dc19d[_0x24d07d(0x149)]){const _0x499815=a159_0x4930b8['relative'](_0x6a6478,_0x71e95c);_0x114028['push']({'filePath':_0x499815,'source':_0x1c8b58,'result':_0x1dc19d,'isJourney':!![]});}}return _0x114028;}export function formatValidationErrors(_0x1cf9e1){const _0x12434c=a159_0x34a518,_0xbbe672=[];for(const {filePath:_0x14354b,source:_0x30d594,result:_0x4cf857,isJourney:_0x337bd5}of _0x1cf9e1){const _0x2692ba=_0x337bd5?'journey':_0x12434c(0x163);_0xbbe672[_0x12434c(0x1eb)]('\x0a'+_0x14354b+'\x20('+_0x2692ba+_0x12434c(0x1b4)+_0x4cf857[_0x12434c(0x156)]['length']+_0x12434c(0x160)),_0xbbe672['push'](formatValidationResult(_0x4cf857,_0x30d594,_0x14354b));}return _0xbbe672['join']('\x0a');}export function buildLocalExpandedRuleMappings(_0x5588a6){const _0x3d0a6b=a159_0x34a518,_0x24c331=new Set(),_0x1d476a=new Map(),_0x413fc3=collectSegmentUsageCounts(_0x5588a6);if(_0x5588a6[_0x3d0a6b(0x115)])for(const [_0x251a9a,_0xa1a2d7]of Object[_0x3d0a6b(0x147)](_0x5588a6['segments'])){_0x24c331['add'](_0x251a9a);if(_0xa1a2d7[_0x3d0a6b(0x185)]){const _0x1e9845=yamlRuleToApi(_0xa1a2d7[_0x3d0a6b(0x185)]),_0x18bfed=apiRuleToYaml(_0x1e9845);_0x1d476a[_0x3d0a6b(0x148)](_0x251a9a,_0x18bfed);}}const _0x39befb=new Map();let _0x29911b=0x0;for(const [_0x401f68,_0x11bc81]of _0x1d476a){const _0x2ea3af=serializeExpandedRule(_0x11bc81,_0x1d476a),_0x302de6=_0x39befb[_0x3d0a6b(0x197)](_0x2ea3af)||[];_0x302de6[_0x3d0a6b(0x1eb)]({'name':_0x401f68,'index':_0x29911b}),_0x39befb['set'](_0x2ea3af,_0x302de6),_0x29911b++;}const _0x164127=new Map();for(const [_0x14979c,_0x39d85c]of _0x39befb){const _0x576f34=_0x39d85c['slice']()[_0x3d0a6b(0x143)]((_0x310a6b,_0xa2720a)=>{const _0x527b83=_0x3d0a6b,_0x51769d=_0x413fc3[_0x527b83(0x197)](_0x310a6b['name'])||0x0,_0x5c6956=_0x413fc3[_0x527b83(0x197)](_0xa2720a[_0x527b83(0x17f)])||0x0;if(_0x51769d!==_0x5c6956)return _0x5c6956-_0x51769d;return _0x310a6b[_0x527b83(0x17c)]-_0xa2720a['index'];})[_0x3d0a6b(0x155)](_0xc6152e=>_0xc6152e['name']),_0xba8e88=[];for(const _0x36a6a3 of _0x576f34){const _0x3ca1a2=_0x413fc3[_0x3d0a6b(0x197)](_0x36a6a3)||0x0,_0xeb60b4=Math[_0x3d0a6b(0x1be)](_0x3ca1a2,0x1);for(let _0x10d4cb=0x0;_0x10d4cb<_0xeb60b4;_0x10d4cb++){_0xba8e88['push'](_0x36a6a3);}}_0x164127[_0x3d0a6b(0x148)](_0x14979c,_0xba8e88);}return{'existingLocalSegmentNames':_0x24c331,'localSegmentRules':_0x1d476a,'localExpandedRuleToNames':_0x164127};}export function createSegmentIdResolver(_0x529a4b,_0x2cff07){return async _0x30a902=>{const _0x188dff=a159_0x2ae9,_0x20f9b7=_0x529a4b[_0x188dff(0x197)](_0x30a902);if(!_0x20f9b7)throw new SDKError(ErrorCode[_0x188dff(0x151)],_0x188dff(0x121)+_0x30a902+_0x188dff(0x1cf)+_0x2cff07+'\x27)');return _0x20f9b7;};}export function extractRootFolderId(_0x203a82){const _0x17d840=a159_0x34a518;return _0x203a82[_0x17d840(0x1d2)]?.[_0x17d840(0x1a7)]?.[_0x17d840(0x1ed)]?.['id']||_0x203a82['relationships']?.[_0x17d840(0x17e)]?.[_0x17d840(0x1ed)]?.['id'];}export function buildConnectionMaps(_0x1619ce){const _0x430afb=a159_0x34a518,_0x552b1a=new Map(),_0x1b9fb4=new Map(),_0x1fea94=new Map();for(const _0xb2966 of _0x1619ce){_0x552b1a[_0x430afb(0x148)](_0xb2966[_0x430afb(0x17f)],parseInt(_0xb2966['id'],0xa)),_0x1b9fb4[_0x430afb(0x148)](_0xb2966['id'],_0xb2966[_0x430afb(0x17f)]),_0x1fea94[_0x430afb(0x148)](_0xb2966[_0x430afb(0x17f)],_0xb2966['type']);}return{'nameToId':_0x552b1a,'idToName':_0x1b9fb4,'nameToType':_0x1fea94};}export function calculatePushStats(_0x2e12b6,_0x499108,_0x1af619,_0x24b4c4,_0x44ccd2,_0x3d29d6,_0x3e281f){const _0x412d0c=a159_0x34a518,_0x2cee87=_0x2e12b6[_0x412d0c(0x1fc)](_0x4bf3e1=>_0x4bf3e1['isNew']),_0x5e22a7=_0x2e12b6['filter'](_0x1d05ee=>!_0x1d05ee[_0x412d0c(0x164)]&&_0x1d05ee['hasChanges']),_0x57c929=_0x2e12b6['filter'](_0x4a370c=>!_0x4a370c[_0x412d0c(0x164)]&&!_0x4a370c[_0x412d0c(0x1f9)]),_0x5293b0=_0x3d29d6?_0x24b4c4:[],_0x2fcf36=_0x499108[_0x412d0c(0x1fc)](_0x186ead=>_0x186ead['isNew']),_0x53985e=_0x499108[_0x412d0c(0x1fc)](_0x3a04a3=>!_0x3a04a3[_0x412d0c(0x164)]&&_0x3a04a3['hasChanges']),_0x220cf8=_0x499108[_0x412d0c(0x1fc)](_0x587e56=>!_0x587e56[_0x412d0c(0x164)]&&!_0x587e56[_0x412d0c(0x1f9)]),_0x373601=_0x3d29d6?_0x44ccd2:[],_0x2d8fbd=_0x2e12b6[_0x412d0c(0x10d)](_0x1df999=>_0x1df999[_0x412d0c(0x190)]),_0x1e5977=_0x2d8fbd[_0x412d0c(0x1fc)](_0x3f825b=>_0x3f825b[_0x412d0c(0x152)]===_0x412d0c(0x1a3)),_0x1c669b=_0x2d8fbd[_0x412d0c(0x1fc)](_0x2f099b=>_0x2f099b[_0x412d0c(0x152)]==='update'),_0x4b5837=_0x2d8fbd[_0x412d0c(0x1fc)](_0x2dcf93=>_0x2dcf93[_0x412d0c(0x152)]==='delete'),_0x25e2ff=Array[_0x412d0c(0x19c)](_0x1af619)['sort'](),_0x503393=_0x3e281f?![]:_0x2cee87['length']>0x0||_0x5e22a7['length']>0x0||_0x5293b0[_0x412d0c(0x116)]>0x0,_0x1ba823=_0x2fcf36[_0x412d0c(0x116)]>0x0||_0x53985e[_0x412d0c(0x116)]>0x0||_0x373601[_0x412d0c(0x116)]>0x0,_0xd28255=_0x3e281f?![]:_0x2d8fbd[_0x412d0c(0x116)]>0x0,_0x106959=_0x25e2ff[_0x412d0c(0x116)]>0x0;return{'segments':{'new':_0x2cee87,'changed':_0x5e22a7,'unchanged':_0x57c929,'toDelete':_0x5293b0},'journeys':{'new':_0x2fcf36,'changed':_0x53985e,'unchanged':_0x220cf8,'toDelete':_0x373601},'activations':{'all':_0x2d8fbd,'toCreate':_0x1e5977,'toUpdate':_0x1c669b,'toDelete':_0x4b5837},'folders':{'toCreate':_0x25e2ff},'counts':{'segments':{'new':_0x2cee87['length'],'changed':_0x5e22a7[_0x412d0c(0x116)],'unchanged':_0x57c929[_0x412d0c(0x116)],'toDelete':_0x5293b0[_0x412d0c(0x116)]},'journeys':{'new':_0x2fcf36[_0x412d0c(0x116)],'changed':_0x53985e[_0x412d0c(0x116)],'unchanged':_0x220cf8[_0x412d0c(0x116)],'toDelete':_0x373601[_0x412d0c(0x116)]},'activations':{'create':_0x1e5977['length'],'update':_0x1c669b[_0x412d0c(0x116)],'delete':_0x4b5837[_0x412d0c(0x116)]},'folders':_0x25e2ff[_0x412d0c(0x116)]},'hasChanges':_0x503393||_0x1ba823||_0xd28255||_0x106959};}export async function buildPushExecutionContext(_0xa14563,_0xd4a49e,_0x50ee23,_0x384a40,_0x3c584f,_0x1ee596){const _0x2d5357=a159_0x34a518,_0x1f24d2=extractRootFolderId(_0x50ee23),{pathToId:_0x4e04b0,idToPath:_0x11955d}=buildFolderMaps(_0x3c584f),_0x466f80=buildSegmentNameToIdMap(_0x384a40),_0x2859d6=new Map(),{batchAsync:_0x3a9724}=await import(_0x2d5357(0x176)),[_0x3da6ad,_0x1f8f82]=await Promise[_0x2d5357(0x1e2)]([_0xa14563[_0x2d5357(0x1b2)]['buildUserMaps'](),_0xa14563['connection'][_0x2d5357(0x14b)](),((async()=>{const _0x10365e=_0x2d5357;!_0x1ee596&&_0x384a40[_0x10365e(0x116)]>0x0&&await _0x3a9724(_0x384a40,async _0x31bca7=>{const _0x1af3e9=_0x10365e,_0x31dea2=await _0xa14563[_0x1af3e9(0x163)][_0x1af3e9(0x209)](_0xd4a49e,_0x31bca7['id']);_0x2859d6['set'](_0x31bca7['id'],_0x31dea2);});})())]),{emailToId:_0x221b6e,idToEmail:_0x251649}=_0x3da6ad,_0x299ae2=buildConnectionMaps(_0x1f8f82);return{'rootFolderId':_0x1f24d2,'folderPathToId':_0x4e04b0,'folderIdToPath':_0x11955d,'segmentNameToId':_0x466f80,'activationsBySegmentId':_0x2859d6,'emailToIdMap':_0x221b6e,'idToEmailMap':_0x251649,'connectionNameToIdMap':_0x299ae2['nameToId'],'connectionIdToNameMap':_0x299ae2[_0x2d5357(0x205)],'connectionNameToTypeMap':_0x299ae2['nameToType']};}export function createPushYamlContextForBundle(_0x3a6795,_0x2feda8,_0x2c8816,_0x50dcea,_0xdbc8ae,_0x7a7d70,_0x56efd1,_0x34770c){const {existingLocalSegmentNames:_0x2ad87c,localExpandedRuleToNames:_0xc76099}=_0x50dcea,_0xc8e1f0=new Set(),_0x286350=new Map(),_0xc0fe48=new Map(),_0xbf5c44=new Map(),_0x2db5ac=createJumpTargetCache(),_0x489b7f=new Map(),_0x220f5b=new Map(),_0x51a960=new Set();let _0x5248b5;const _0x3f83fa=_0x298e0a=>{const _0x71ed76={'resolveSegment':async _0x377cc3=>{const _0x44175d=a159_0x2ae9,_0x29e88c=_0xbf5c44[_0x44175d(0x197)](_0x377cc3);if(_0x29e88c!==undefined)return{'name':_0x29e88c,'isJourneyLocal':!![]};try{const _0x1149c5=await fetchSegment(_0x3a6795,_0x2feda8,_0x377cc3,_0x2c8816);if(!_0x1149c5)throw new Error(_0x44175d(0x13a));const _0x429cd9=generateJourneyLocalName(_0x1149c5[_0x44175d(0x17f)]),_0x156570=_0x1149c5[_0x44175d(0x1d5)]===SEGMENT_KIND_JOURNEY&&_0x429cd9!==undefined;let _0x3b8fbe=_0x1149c5[_0x44175d(0x17f)],_0x26e587;if(_0x156570&&_0x1149c5[_0x44175d(0x185)]){const _0x5e03d6=apiRuleToYaml(_0x1149c5['rule']);_0x220f5b[_0x44175d(0x148)](_0x377cc3,_0x5e03d6);const _0x25a437=async _0xb7a035=>{const _0x2be817=_0x44175d,_0x2a70c0=collectSegmentRefsFromRule(_0xb7a035);for(const _0x356a2b of _0x2a70c0){if(!_0x220f5b['has'](_0x356a2b))try{const _0x23bcb6=await fetchSegment(_0x3a6795,_0x2feda8,_0x356a2b,_0x2c8816);if(_0x23bcb6?.[_0x2be817(0x185)]){const _0x47d382=apiRuleToYaml(_0x23bcb6[_0x2be817(0x185)]);_0x220f5b[_0x2be817(0x148)](_0x356a2b,_0x47d382),await _0x25a437(_0x47d382);}}catch(_0x3147e9){logger[_0x2be817(0x1e3)](_0x2be817(0x1cc)+_0x356a2b+':\x20'+_0x3147e9);}}};await _0x25a437(_0x5e03d6);const _0x4cc2ae=serializeExpandedRule(_0x5e03d6,_0x220f5b),_0x43cee8=_0xc76099['get'](_0x4cc2ae);if(_0x43cee8&&_0x43cee8[_0x44175d(0x116)]>0x0){const _0x353d2e=_0x286350[_0x44175d(0x197)](_0x4cc2ae)||0x0,_0x52d9ea=_0x43cee8[_0x353d2e]||_0x43cee8[_0x43cee8['length']-0x1];_0x286350[_0x44175d(0x148)](_0x4cc2ae,_0x353d2e+0x1),_0x3b8fbe=_0x52d9ea,_0xc8e1f0[_0x44175d(0x15f)](_0x3b8fbe),_0xbf5c44[_0x44175d(0x148)](_0x377cc3,_0x3b8fbe);const _0x88dc3d=await resolveRuleSegmentRefs(_0x5e03d6,async _0x5457e4=>{const _0xade1cd=_0x44175d,_0x405e6b=_0xbf5c44[_0xade1cd(0x197)](_0x5457e4);if(_0x405e6b)return _0x405e6b;const _0x2ab62b=await _0x5248b5['resolveSegment'](_0x5457e4);return _0x2ab62b['name'];});_0x26e587={'description':_0x1149c5[_0x44175d(0x1a4)],'rule':_0x88dc3d};}else{const _0xdc6123=_0x489b7f[_0x44175d(0x197)](_0x4cc2ae);if(_0xdc6123)_0x3b8fbe=_0xdc6123,_0xbf5c44[_0x44175d(0x148)](_0x377cc3,_0x3b8fbe);else{if(_0x429cd9){let _0x41e9aa=_0x429cd9,_0x42c299=0x2;while(_0xc8e1f0[_0x44175d(0x1c5)](_0x41e9aa)||_0x2ad87c[_0x44175d(0x1c5)](_0x41e9aa)){_0x41e9aa=_0x429cd9+'_'+_0x42c299,_0x42c299++;}_0xc8e1f0[_0x44175d(0x15f)](_0x41e9aa),_0x3b8fbe=_0x41e9aa;}_0xbf5c44[_0x44175d(0x148)](_0x377cc3,_0x3b8fbe),_0x489b7f[_0x44175d(0x148)](_0x4cc2ae,_0x3b8fbe);const _0x3fb064=await resolveRuleSegmentRefs(_0x5e03d6,async _0x46451c=>{const _0x23ec18=_0x44175d,_0x5df218=_0xbf5c44[_0x23ec18(0x197)](_0x46451c);if(_0x5df218)return _0x5df218;const _0x59e05f=await _0x5248b5[_0x23ec18(0x204)](_0x46451c);return _0x59e05f[_0x23ec18(0x17f)];});_0x26e587={'description':_0x1149c5[_0x44175d(0x1a4)],'rule':_0x3fb064};}}}return{'name':_0x3b8fbe,'isJourneyLocal':_0x156570,'definition':_0x26e587};}catch(_0x59c6c5){return logger[_0x44175d(0x1e3)]('Failed\x20to\x20resolve\x20segment\x20'+_0x377cc3+':\x20'+_0x59c6c5),{'name':_0x377cc3,'isJourneyLocal':![]};}},'resolveActivation':async _0x584719=>{const _0x26ac49=a159_0x2ae9,_0x492091=_0xc0fe48[_0x26ac49(0x197)](_0x584719);if(_0x492091!==undefined)return{'name':_0x492091,'isJourneyLocal':!![]};try{let _0x52340c=_0x56efd1?.[_0x26ac49(0x197)](_0x584719);!_0x52340c&&(_0x52340c=await _0x3a6795[_0x26ac49(0x113)][_0x26ac49(0x1f2)](_0x298e0a,_0x584719));const _0xd79454=_0x52340c[_0x26ac49(0x18d)][_0x26ac49(0x1e6)]['name']||_0x584719,_0x336b14=sanitizeYamlKey(_0xd79454)||'activation_'+_0x584719,_0x3b1e44=_0x336b14;_0xc0fe48[_0x26ac49(0x148)](_0x584719,_0x3b1e44);const _0x1c3d91=journeyActivationStepToYaml(_0x52340c,_0xdbc8ae,_0x7a7d70);return{'name':_0x3b1e44,'isJourneyLocal':!![],'definition':_0x1c3d91};}catch(_0x34d162){return logger['debug']('Failed\x20to\x20resolve\x20activation\x20'+_0x584719+':\x20'+_0x34d162),{'name':_0x584719,'isJourneyLocal':![]};}},'resolveJumpTarget':(_0x6a083a,_0x41da75)=>resolveJumpTarget(_0x6a083a,_0x41da75,_0x2db5ac,async _0x4d87ac=>{const _0x2ffcb0=a159_0x2ae9,_0x25610c=_0x34770c?.[_0x2ffcb0(0x197)](_0x4d87ac);if(_0x25610c)return _0x25610c;return _0x3a6795[_0x2ffcb0(0x113)][_0x2ffcb0(0x188)](_0x4d87ac);})};return _0x5248b5=_0x71ed76,_0x71ed76;},_0x3b472e=async _0x139d60=>{const _0xb06fad=a159_0x2ae9,{collectSegmentIdsFromJourneyApi:_0x2e8bf8}=await import(_0xb06fad(0x1df)),{batchAsync:_0x2a08db}=await import(_0xb06fad(0x176)),_0x3ad36a=new Set();for(const _0x1755ce of _0x139d60){let _0x105303=_0x34770c?.[_0xb06fad(0x197)](_0x1755ce);!_0x105303&&(_0x105303=await _0x3a6795[_0xb06fad(0x113)]['getJourney'](_0x1755ce));const _0x4e6b9e=_0x2e8bf8(_0x105303);for(const _0x2ef5eb of _0x4e6b9e){_0x3ad36a[_0xb06fad(0x15f)](_0x2ef5eb);}}let _0x107e68=Array[_0xb06fad(0x19c)](_0x3ad36a);while(_0x107e68[_0xb06fad(0x116)]>0x0){const _0x370157=_0x107e68[_0xb06fad(0x1fc)](_0x39b261=>!_0x51a960[_0xb06fad(0x1c5)](_0x39b261));if(_0x370157[_0xb06fad(0x116)]===0x0)break;const _0x2248ef=await _0x2a08db(_0x370157,async _0x286cef=>{const _0x1f803b=_0xb06fad;_0x51a960[_0x1f803b(0x15f)](_0x286cef);const _0x2bc4a5=await fetchSegment(_0x3a6795,_0x2feda8,_0x286cef,_0x2c8816);if(!_0x2bc4a5)return null;return{'segmentId':_0x286cef,'segment':_0x2bc4a5};},0xa),_0x34fe67=new Set();for(const _0x274a37 of _0x2248ef){if(!_0x274a37?.[_0xb06fad(0x163)]?.[_0xb06fad(0x185)])continue;const _0x5c7e48=apiRuleToYaml(_0x274a37[_0xb06fad(0x163)][_0xb06fad(0x185)]);_0x220f5b['set'](_0x274a37[_0xb06fad(0x12d)],_0x5c7e48);const _0x58f685=collectSegmentRefsFromRule(_0x5c7e48);for(const _0x341eaa of _0x58f685){!_0x51a960[_0xb06fad(0x1c5)](_0x341eaa)&&_0x34fe67[_0xb06fad(0x15f)](_0x341eaa);}}_0x107e68=Array[_0xb06fad(0x19c)](_0x34fe67);}};return{'createYamlContext':_0x3f83fa,'prefetchJourneySegments':_0x3b472e};}export async function executePushSegments(_0x26856e,_0x6e2aa8,_0x1261da,_0x5791a8,_0xc2dd1b){const _0x51d0c9=a159_0x34a518,{segmentDefToCreateRequest:_0x1221a6,segmentDefToUpdateRequest:_0xdeee81}=await import(_0x51d0c9(0x11e)),_0x35a60=_0x1261da[_0x51d0c9(0x16d)],_0x52827d=0x5,_0x4fbfb5=async _0x2d84bc=>{const _0x5e48d9=_0x51d0c9,_0x31fa91=_0x2d84bc['folderPath']?_0x35a60[_0x5e48d9(0x197)](_0x2d84bc['folderPath']):undefined;let _0x30918b;const _0x6c4d37={'created':0x0,'updated':0x0,'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};let _0x543d72=_0x2d84bc[_0x5e48d9(0x124)];if(_0x2d84bc[_0x5e48d9(0x124)][_0x5e48d9(0x185)]){const _0x55c9d4=createSegmentIdResolver(_0x1261da['segmentNameToId'],_0x2d84bc[_0x5e48d9(0x124)][_0x5e48d9(0x17f)]),_0x21f1dd=await resolveRuleSegmentIds(_0x2d84bc['yamlConfig'][_0x5e48d9(0x185)],_0x55c9d4);_0x543d72={..._0x2d84bc['yamlConfig'],'rule':_0x21f1dd};}try{if(_0x2d84bc['isNew']){_0xc2dd1b[_0x5e48d9(0x1a6)]?.({'type':'segment_creating','name':_0x2d84bc[_0x5e48d9(0x124)][_0x5e48d9(0x17f)]});const _0x955548=_0x1221a6(_0x543d72,_0x31fa91),_0x1dfd4c=await _0xc2dd1b['withProgress']('Creating\x20segment\x20\x27'+_0x2d84bc[_0x5e48d9(0x124)]['name']+_0x5e48d9(0x12b),()=>_0x26856e[_0x5e48d9(0x163)]['createSegment'](_0x5791a8[_0x5e48d9(0x1db)],_0x955548));_0x30918b=_0x1dfd4c[_0x5e48d9(0x1ed)]['id'],_0x1261da[_0x5e48d9(0x13f)][_0x5e48d9(0x148)](_0x2d84bc[_0x5e48d9(0x124)][_0x5e48d9(0x17f)],_0x30918b),_0x6c4d37[_0x5e48d9(0x11c)]={'name':_0x2d84bc['yamlConfig']['name'],'id':_0x30918b},_0xc2dd1b[_0x5e48d9(0x1a6)]?.({'type':_0x5e48d9(0x182),'name':_0x2d84bc[_0x5e48d9(0x124)][_0x5e48d9(0x17f)],'segmentId':_0x30918b}),_0xc2dd1b[_0x5e48d9(0x130)]?.(_0x5e48d9(0x180)+_0x2d84bc['yamlConfig'][_0x5e48d9(0x17f)]+'\x27'),_0x6c4d37[_0x5e48d9(0x123)]=0x1;}else{if(_0x2d84bc[_0x5e48d9(0x1f9)]){_0xc2dd1b[_0x5e48d9(0x1a6)]?.({'type':_0x5e48d9(0x131),'name':_0x2d84bc[_0x5e48d9(0x124)]['name']});const _0x50221b=_0xdeee81(_0x543d72);_0x31fa91!==_0x2d84bc[_0x5e48d9(0x169)]?.['segmentFolderId']&&(_0x50221b['segmentFolderId']=_0x31fa91?parseInt(_0x31fa91,0xa):undefined),await _0xc2dd1b[_0x5e48d9(0x1d4)](_0x5e48d9(0x146)+_0x2d84bc[_0x5e48d9(0x124)][_0x5e48d9(0x17f)]+_0x5e48d9(0x12b),()=>_0x26856e[_0x5e48d9(0x163)][_0x5e48d9(0x1f6)](_0x5791a8[_0x5e48d9(0x1db)],_0x2d84bc['existingSegment']['id'],_0x50221b)),_0x30918b=_0x2d84bc['existingSegment']['id'],_0xc2dd1b[_0x5e48d9(0x1a6)]?.({'type':_0x5e48d9(0x153),'name':_0x2d84bc[_0x5e48d9(0x124)]['name']}),_0xc2dd1b[_0x5e48d9(0x130)]?.(_0x5e48d9(0x114)+_0x2d84bc[_0x5e48d9(0x124)][_0x5e48d9(0x17f)]+'\x27'),_0x6c4d37['updated']=0x1;}else _0x30918b=_0x2d84bc[_0x5e48d9(0x169)]['id'];}}catch(_0x8884ec){const _0x27d629=isHttp400Error(_0x8884ec),_0x5e707d=_0x27d629?ErrorCode['SEGMENT_SYNTAX_ERROR']:ErrorCode[_0x5e48d9(0x189)],_0x537e7b=getErrorMessage(_0x8884ec);throw new SDKError(_0x5e707d,_0x5e48d9(0x16a)+(_0x2d84bc[_0x5e48d9(0x164)]?_0x5e48d9(0x1a3):_0x5e48d9(0x1d7))+_0x5e48d9(0x1b7)+_0x2d84bc['absolutePath']+'\x0a\x20\x20'+_0x537e7b,_0x8884ec);}try{const _0x2cc918=await syncActivationsForSegment(_0x26856e,_0x5791a8['parentId'],_0x30918b,_0x2d84bc[_0x5e48d9(0x124)][_0x5e48d9(0x17f)],_0x2d84bc[_0x5e48d9(0x190)],_0xc2dd1b,_0x2d84bc[_0x5e48d9(0x206)]);_0x6c4d37['activations']=_0x2cc918;}catch(_0x39b8f9){if(_0x39b8f9 instanceof SDKError)throw _0x39b8f9;throw new SDKError(ErrorCode[_0x5e48d9(0x14c)],_0x5e48d9(0x191)+_0x2d84bc[_0x5e48d9(0x124)]['name']+'\x27\x20from\x20file:\x20'+_0x2d84bc['absolutePath']+'\x0a\x20\x20'+getErrorMessage(_0x39b8f9),_0x39b8f9);}return _0x6c4d37;},_0xd70414=await batchAsync(_0x6e2aa8,_0x4fbfb5,_0x52827d),_0x3feb06={'created':0x0,'updated':0x0,'deleted':0x0,'createdSegmentIds':new Map(),'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};for(const _0xe36169 of _0xd70414){_0x3feb06[_0x51d0c9(0x123)]+=_0xe36169[_0x51d0c9(0x123)],_0x3feb06['updated']+=_0xe36169[_0x51d0c9(0x1cd)],_0xe36169[_0x51d0c9(0x11c)]&&_0x3feb06[_0x51d0c9(0x1f5)][_0x51d0c9(0x148)](_0xe36169[_0x51d0c9(0x11c)][_0x51d0c9(0x17f)],_0xe36169[_0x51d0c9(0x11c)]['id']),_0x3feb06[_0x51d0c9(0x126)][_0x51d0c9(0x123)]+=_0xe36169['activations'][_0x51d0c9(0x123)],_0x3feb06[_0x51d0c9(0x126)][_0x51d0c9(0x1cd)]+=_0xe36169[_0x51d0c9(0x126)][_0x51d0c9(0x1cd)],_0x3feb06[_0x51d0c9(0x126)]['deleted']+=_0xe36169[_0x51d0c9(0x126)][_0x51d0c9(0x141)];}return _0x3feb06;}async function syncActivationsForSegment(_0x51a454,_0x44852e,_0x53ca19,_0xe872f8,_0x5b9b90,_0x14fe73,_0x375735){const _0x270724=a159_0x34a518,_0x7b2ac0={'created':0x0,'updated':0x0,'deleted':0x0};for(const _0x5b5fd3 of _0x5b9b90){try{if(_0x5b5fd3['type']===_0x270724(0x1a3)&&_0x5b5fd3[_0x270724(0x20b)])_0x14fe73['onProgress']?.({'type':_0x270724(0x1b5),'segmentName':_0xe872f8,'activationName':_0x5b5fd3[_0x270724(0x17f)]}),await _0x14fe73[_0x270724(0x1d4)](_0x270724(0x1d3)+_0x5b5fd3[_0x270724(0x17f)]+_0x270724(0x12b),()=>_0x51a454[_0x270724(0x163)][_0x270724(0x111)](_0x44852e,_0x53ca19,_0x5b5fd3[_0x270724(0x20b)])),_0x14fe73[_0x270724(0x1a6)]?.({'type':_0x270724(0x200),'segmentName':_0xe872f8,'activationName':_0x5b5fd3[_0x270724(0x17f)]}),_0x14fe73[_0x270724(0x130)]?.('Created\x20activation\x20\x27'+_0x5b5fd3[_0x270724(0x17f)]+'\x27'),_0x7b2ac0[_0x270724(0x123)]++;else{if(_0x5b5fd3[_0x270724(0x152)]===_0x270724(0x1d7)&&_0x5b5fd3[_0x270724(0x20b)]&&_0x5b5fd3['existingActivation'])_0x14fe73['onProgress']?.({'type':'activation_updating','segmentName':_0xe872f8,'activationName':_0x5b5fd3[_0x270724(0x17f)]}),await _0x14fe73[_0x270724(0x1d4)](_0x270724(0x17d)+_0x5b5fd3[_0x270724(0x17f)]+'\x27...',()=>_0x51a454[_0x270724(0x163)]['updateActivation'](_0x44852e,_0x53ca19,_0x5b5fd3['existingActivation']['id'],_0x5b5fd3[_0x270724(0x20b)])),_0x14fe73['onProgress']?.({'type':'activation_updated','segmentName':_0xe872f8,'activationName':_0x5b5fd3[_0x270724(0x17f)]}),_0x14fe73[_0x270724(0x130)]?.(_0x270724(0x1aa)+_0x5b5fd3['name']+'\x27'),_0x7b2ac0['updated']++;else _0x5b5fd3[_0x270724(0x152)]===_0x270724(0x171)&&_0x5b5fd3['existingActivation']&&(_0x14fe73[_0x270724(0x1a6)]?.({'type':'activation_deleting','segmentName':_0xe872f8,'activationName':_0x5b5fd3['name']}),await _0x14fe73['withProgress'](_0x270724(0x174)+_0x5b5fd3['name']+'\x27...',()=>_0x51a454[_0x270724(0x163)][_0x270724(0x1ea)](_0x44852e,_0x53ca19,_0x5b5fd3[_0x270724(0x18c)]['id'])),_0x14fe73['onProgress']?.({'type':_0x270724(0x138),'segmentName':_0xe872f8,'activationName':_0x5b5fd3[_0x270724(0x17f)]}),_0x14fe73[_0x270724(0x18a)]?.('Deleted\x20activation\x20\x27'+_0x5b5fd3[_0x270724(0x17f)]+'\x27'),_0x7b2ac0['deleted']++);}}catch(_0x49dc7f){const _0x1ad56a=isHttp400Error(_0x49dc7f),_0x2408d8=_0x1ad56a?ErrorCode['ACTIVATION_SYNTAX_ERROR']:ErrorCode['ACTIVATION_UPDATE_ERROR'],_0x44f3ea=getErrorMessage(_0x49dc7f);throw new SDKError(_0x2408d8,_0x270724(0x16a)+_0x5b5fd3[_0x270724(0x152)]+_0x270724(0x170)+_0x5b5fd3[_0x270724(0x17f)]+_0x270724(0x161)+_0x375735+_0x270724(0x20d)+_0x44f3ea,_0x49dc7f);}}return _0x7b2ac0;}export async function executePushFolders(_0x5c8809,_0x56c8a7,_0x17bf9d,_0x352ba2,_0x8ebfb2){const _0x3f5ce5=a159_0x34a518,_0x70f73e=new Map(_0x17bf9d),_0x24a1bb=sortFoldersByDepth(_0x56c8a7);for(const _0x2745df of _0x24a1bb){const _0x5bbd21=_0x2745df[_0x3f5ce5(0x167)]('/'),_0x1e2756=_0x5bbd21[_0x5bbd21[_0x3f5ce5(0x116)]-0x1],_0xa2ab51=_0x5bbd21['slice'](0x0,-0x1)['join']('/'),_0x47e288=_0x70f73e[_0x3f5ce5(0x197)](_0xa2ab51);_0x8ebfb2[_0x3f5ce5(0x1a6)]?.({'type':'folder_creating','folder':_0x2745df});const _0x5c503b={'name':_0x1e2756,'parentFolderId':_0x47e288},_0x573185=await _0x8ebfb2['withProgress'](_0x3f5ce5(0x1ff)+_0x2745df+_0x3f5ce5(0x12b),()=>_0x5c8809[_0x3f5ce5(0x163)]['createFolder'](_0x352ba2['parentId'],_0x5c503b));_0x70f73e['set'](_0x2745df,_0x573185[_0x3f5ce5(0x1ed)]['id']),_0x8ebfb2[_0x3f5ce5(0x1a6)]?.({'type':_0x3f5ce5(0x134),'folder':_0x2745df,'folderId':_0x573185[_0x3f5ce5(0x1ed)]['id']}),_0x8ebfb2[_0x3f5ce5(0x1bc)]?.(_0x3f5ce5(0x1c6)+_0x2745df+'\x27');}return _0x70f73e;}export async function executePushSegmentDeletions(_0x3281b0,_0x478541,_0x26c8dc){const _0x53eea2=a159_0x34a518;if(_0x478541[_0x53eea2(0x116)]===0x0)return 0x0;const {batchAsync:_0x340193}=await import(_0x53eea2(0x176)),_0x22773a=0x5,_0x3edfad=await _0x340193(_0x478541,async _0x37c607=>{const _0x34ce83=_0x53eea2;return _0x26c8dc['onProgress']?.({'type':'segment_deleting','name':_0x37c607['name']}),await _0x3281b0[_0x34ce83(0x163)][_0x34ce83(0x1a5)](_0x37c607['id']),_0x26c8dc[_0x34ce83(0x1a6)]?.({'type':_0x34ce83(0x1fb),'name':_0x37c607[_0x34ce83(0x17f)]}),_0x26c8dc[_0x34ce83(0x18a)]?.(_0x34ce83(0x1c9)+_0x37c607[_0x34ce83(0x17f)]+'\x27'),0x1;},_0x22773a);return _0x3edfad[_0x53eea2(0x1b9)]((_0x4db6c8,_0x48c05c)=>_0x4db6c8+_0x48c05c,0x0);}export async function executePushJourneys(_0x45c351,_0x49c271,_0x295703,_0x233b1c,_0x1eb3b0){const _0x3d6286=a159_0x34a518,{journeyDefToRequest:_0x499b4f}=await import('./journey-yaml.js'),{activationDefToCreateRequest:_0x558fff,yamlRuleToApi:_0x19360f,validateSegmentRule:_0x11c323}=await import('./child-segment-yaml.js'),_0x8cb18={'results':[],'created':0x0,'updated':0x0,'embeddedSegmentNameToId':new Map()},_0x42b513=new Map(_0x295703['segmentNameToId']),_0x68c83b=0x5;for(let _0x4d1e7f=0x0;_0x4d1e7f<_0x49c271[_0x3d6286(0x116)];_0x4d1e7f+=_0x68c83b){const _0x547335=_0x49c271[_0x3d6286(0x1c0)](_0x4d1e7f,_0x4d1e7f+_0x68c83b),_0x1c1f58=await Promise['all'](_0x547335['map'](async _0xfb8c1a=>{const _0x38f03d=_0x3d6286;if(!_0xfb8c1a['isNew']&&!_0xfb8c1a[_0x38f03d(0x1f9)])return{'action':_0x38f03d(0x10e),'name':_0xfb8c1a[_0x38f03d(0x124)][_0x38f03d(0x17f)],'journeyId':_0xfb8c1a[_0x38f03d(0x110)]?.['id']};const _0x2c3640=_0xfb8c1a['folderPath']?_0x295703[_0x38f03d(0x16d)][_0x38f03d(0x197)](_0xfb8c1a[_0x38f03d(0x19f)]):undefined;_0x1eb3b0[_0x38f03d(0x1a6)]?.({'type':_0xfb8c1a['isNew']?_0x38f03d(0x158):_0x38f03d(0x203),'name':_0xfb8c1a[_0x38f03d(0x124)][_0x38f03d(0x17f)]});try{const _0x1d24e5=await executeSingleJourneyPush(_0x45c351,_0xfb8c1a,{..._0x295703,'segmentNameToId':_0x42b513},{'parentId':_0x233b1c['parentId'],'rootFolderId':_0x233b1c[_0x38f03d(0x19e)],'folderId':_0x2c3640,'verbose':_0x233b1c[_0x38f03d(0x20f)]},_0x1eb3b0,{'journeyDefToRequest':_0x499b4f,'activationDefToCreateRequest':_0x558fff,'yamlRuleToApi':_0x19360f,'validateSegmentRule':_0x11c323});for(const [_0x3afd32,_0x1f005c]of _0x1d24e5['embeddedSegmentNameToId']){_0x42b513[_0x38f03d(0x148)](_0x3afd32,_0x1f005c),_0x8cb18['embeddedSegmentNameToId'][_0x38f03d(0x148)](_0x3afd32,_0x1f005c);}if(_0x1d24e5[_0x38f03d(0x127)]===_0x38f03d(0x123))_0x1eb3b0[_0x38f03d(0x1a6)]?.({'type':'journey_created','name':_0xfb8c1a[_0x38f03d(0x124)][_0x38f03d(0x17f)],'journeyId':_0x1d24e5[_0x38f03d(0x1b6)]}),_0x1eb3b0[_0x38f03d(0x130)]?.('Created\x20journey\x20\x27'+_0xfb8c1a[_0x38f03d(0x124)][_0x38f03d(0x17f)]+'\x27'),_0x8cb18[_0x38f03d(0x123)]++;else _0x1d24e5[_0x38f03d(0x127)]===_0x38f03d(0x1cd)&&(_0x1eb3b0[_0x38f03d(0x1a6)]?.({'type':'journey_updated','name':_0xfb8c1a['yamlConfig'][_0x38f03d(0x17f)]}),_0x1eb3b0[_0x38f03d(0x130)]?.('Updated\x20journey\x20\x27'+_0xfb8c1a[_0x38f03d(0x124)][_0x38f03d(0x17f)]+'\x27'),_0x8cb18[_0x38f03d(0x1cd)]++);return{'action':_0x1d24e5[_0x38f03d(0x127)],'name':_0xfb8c1a[_0x38f03d(0x124)]['name'],'journeyId':_0x1d24e5['journeyId']};}catch(_0x33326a){const _0x1d62bd=isHttp400Error(_0x33326a),_0x2b943c=_0x1d62bd?ErrorCode[_0x38f03d(0x159)]:ErrorCode[_0x38f03d(0x15c)],_0x33bda3=getErrorMessage(_0x33326a);throw new SDKError(_0x2b943c,'Failed\x20to\x20'+(_0xfb8c1a[_0x38f03d(0x164)]?_0x38f03d(0x1a3):'update')+_0x38f03d(0x1a8)+_0xfb8c1a[_0x38f03d(0x206)]+_0x38f03d(0x20d)+_0x33bda3,_0x33326a);}}));_0x8cb18[_0x3d6286(0x1d0)][_0x3d6286(0x1eb)](..._0x1c1f58);}return _0x8cb18;}async function matchExistingJourneySegments(_0x2e1da6,_0x36a1e9,_0x39b463,_0x2f7325,_0x2b3cf7){const _0xa04630=a159_0x34a518;if(!_0x36a1e9['existingJourney']||!_0x36a1e9[_0xa04630(0x124)][_0xa04630(0x115)])return;const _0x1e597b=new Map(),_0x4cc1c8=new Set();for(const _0x48c231 of Object[_0xa04630(0x122)](_0x36a1e9[_0xa04630(0x124)]['segments'])){const _0x3aa716=generateDeterministicJourneySegmentName(_0x36a1e9['yamlConfig'][_0xa04630(0x17f)],_0x48c231);_0x1e597b[_0xa04630(0x148)](_0x3aa716,_0x48c231),_0x4cc1c8[_0xa04630(0x15f)](_0x48c231);}const _0x74e446=[],_0xc5cd02=collectSegmentIdsFromJourneyApi(_0x36a1e9[_0xa04630(0x110)]);for(const _0x100731 of _0xc5cd02){const _0x8ecb13=await fetchSegment(_0x2e1da6,_0x39b463,_0x100731,_0x2f7325);if(!_0x8ecb13?.[_0xa04630(0x17f)])continue;const _0x4cdfbe=_0x1e597b['get'](_0x8ecb13[_0xa04630(0x17f)]);_0x4cdfbe?(_0x2b3cf7[_0xa04630(0x148)](_0x4cdfbe,_0x100731),_0x4cc1c8[_0xa04630(0x171)](_0x4cdfbe)):_0x74e446[_0xa04630(0x1eb)]({'id':_0x100731,'seg':_0x8ecb13});}if(_0x4cc1c8[_0xa04630(0x19a)]>0x0&&_0x74e446['length']>0x0){const {localExpandedRuleToNames:_0x1ef071}=buildLocalExpandedRuleMappings(_0x36a1e9[_0xa04630(0x124)]),_0xfb101c=new Map();for(const {id:_0x5ae34e,seg:_0x241ad7}of _0x74e446){if(_0x241ad7[_0xa04630(0x185)]){const _0x30ba18=apiRuleToYaml(_0x241ad7[_0xa04630(0x185)]);_0xfb101c[_0xa04630(0x148)](_0x5ae34e,_0x30ba18);}}for(const {id:_0xb246a2,seg:_0x5ae9dc}of _0x74e446){if(!_0x5ae9dc['rule'])continue;const _0x2ac0e4=_0xfb101c['get'](_0xb246a2);if(!_0x2ac0e4)continue;const _0xf8e7ce=serializeExpandedRule(_0x2ac0e4,_0xfb101c),_0x233ea8=_0x1ef071['get'](_0xf8e7ce);if(_0x233ea8){const _0x530d0a=_0x233ea8[_0xa04630(0x1f8)](_0x340fc9=>_0x4cc1c8[_0xa04630(0x1c5)](_0x340fc9));_0x530d0a&&(_0x2b3cf7[_0xa04630(0x148)](_0x530d0a,_0xb246a2),_0x4cc1c8[_0xa04630(0x171)](_0x530d0a),logger[_0xa04630(0x1e3)](_0xa04630(0x201)+_0x5ae9dc[_0xa04630(0x17f)]+_0xa04630(0x179)+_0x530d0a+_0xa04630(0x195)));}}}}async function executeSingleJourneyPush(_0x323f6a,_0x5baa5,_0x3a74b2,_0x3faae5,_0x286262,_0x2a4e4){const _0x2fbf79=a159_0x34a518,{journeyDefToRequest:_0x7af9b9,activationDefToCreateRequest:_0x1ebaa6,yamlRuleToApi:_0xcfabce,validateSegmentRule:_0x1d13e6}=_0x2a4e4,_0x2b71b=new Map(),_0x271866=new Map();recoverSegmentIdsFromPushRecovery(_0x5baa5,_0x2b71b,_0x3a74b2['segmentNameToId']);const _0x327584=new Map(),_0x46a99f=new Map(),_0x4098d2=new Map();let _0x4d40b2;const _0x571cd9=async()=>{const _0x1a26a9=a159_0x2ae9;if(_0x4d40b2)return;_0x4d40b2=new Map();if(!_0x5baa5[_0x1a26a9(0x110)])return;const _0x3d7516=await _0x323f6a[_0x1a26a9(0x113)][_0x1a26a9(0x209)](_0x5baa5[_0x1a26a9(0x110)]['id']);for(const _0x4ca843 of _0x3d7516){const _0x2b26ad=journeyActivationStepToYaml(_0x4ca843,_0x3a74b2[_0x1a26a9(0x15b)],_0x3a74b2[_0x1a26a9(0x1da)]),_0x3c402a=activationSignature(_0x2b26ad);!_0x4d40b2[_0x1a26a9(0x1c5)](_0x3c402a)&&_0x4d40b2[_0x1a26a9(0x148)](_0x3c402a,_0x4ca843['id']),_0x2b26ad[_0x1a26a9(0x17f)]&&_0x271866[_0x1a26a9(0x148)](_0x2b26ad['name'],_0x4ca843['id']);}};await matchExistingJourneySegments(_0x323f6a,_0x5baa5,_0x3faae5[_0x2fbf79(0x1db)],_0x3a74b2[_0x2fbf79(0x117)],_0x3a74b2['segmentNameToId']);const _0x46937c={'resolveSegmentId':async _0x33dab2=>{const _0x47a927=_0x2fbf79,_0x187272=_0x3a74b2[_0x47a927(0x13f)][_0x47a927(0x197)](_0x33dab2);if(!_0x187272)throw new SDKError(ErrorCode[_0x47a927(0x151)],_0x47a927(0x121)+_0x33dab2+'\x20(referenced\x20in\x20journey\x20'+_0x5baa5['yamlConfig'][_0x47a927(0x17f)]+')');return _0x187272;},'resolveEmbeddedSegmentId':async(_0x32abb2,_0x3ef799)=>{const _0x4927b0=_0x2fbf79,_0x391fb6=_0x3a74b2[_0x4927b0(0x13f)][_0x4927b0(0x197)](_0x32abb2);if(_0x391fb6)return _0x391fb6;const _0x2eaa4d=_0x3a74b2[_0x4927b0(0x117)][_0x4927b0(0x1f8)](_0x2563d8=>_0x2563d8['name']===_0x32abb2);if(_0x2eaa4d)return _0x3a74b2[_0x4927b0(0x13f)][_0x4927b0(0x148)](_0x32abb2,_0x2eaa4d['id']),_0x2eaa4d['id'];if(_0x5baa5[_0x4927b0(0x164)]){const {stageName:_0xdc641a,criteriaName:_0x1aa525}=findSegmentCriteriaLocation(_0x5baa5[_0x4927b0(0x124)],_0x32abb2);return _0x1d13e6(_0x32abb2,_0x3ef799[_0x4927b0(0x185)]),_0x46a99f[_0x4927b0(0x148)](_0x32abb2,{'definition':_0x3ef799,'stageName':_0xdc641a,'criteriaName':_0x1aa525}),createPendingSegmentId(_0x32abb2);}const _0x499994=_0x5baa5[_0x4927b0(0x110)]?.['id'];if(!_0x499994)throw new SDKError(ErrorCode[_0x4927b0(0x12c)],_0x4927b0(0x18b));const _0x597990=_0x327584['get'](_0x32abb2);if(_0x597990)return _0x597990;const _0x2b5396=((async()=>{const _0x12b1dd=_0x4927b0;_0x1d13e6(_0x32abb2,_0x3ef799[_0x12b1dd(0x185)]);const _0x529d47=generateDeterministicJourneySegmentName(_0x5baa5[_0x12b1dd(0x124)][_0x12b1dd(0x17f)],_0x32abb2),_0x4ddd7d=_0x3a74b2[_0x12b1dd(0x117)][_0x12b1dd(0x1f8)](_0x3e5247=>_0x3e5247[_0x12b1dd(0x17f)]===_0x529d47),_0x3d9109=createSegmentIdResolver(_0x3a74b2['segmentNameToId'],_0x32abb2),_0x59820b=await resolveRuleSegmentIds(_0x3ef799['rule'],_0x3d9109);let _0x365e12;return _0x4ddd7d?(await _0x323f6a[_0x12b1dd(0x163)][_0x12b1dd(0x1f6)](_0x3faae5['parentId'],_0x4ddd7d['id'],{'description':_0x3ef799[_0x12b1dd(0x1a4)]||_0x12b1dd(0x181)+_0x32abb2,'rule':_0xcfabce(_0x59820b),'countPopulation':!![]}),_0x365e12=_0x4ddd7d['id'],saveSegmentToPushRecovery(_0x5baa5[_0x12b1dd(0x206)],_0x5baa5[_0x12b1dd(0x124)][_0x12b1dd(0x17f)],_0x32abb2,{'segmentId':_0x365e12,'uniqueServerName':_0x529d47,'createdAt':new Date()['toISOString']()})):_0x365e12=await createOrRecoverEmbeddedSegment(_0x323f6a,_0x5baa5,{'localName':_0x32abb2,'uniqueSegmentName':_0x529d47,'description':_0x3ef799[_0x12b1dd(0x1a4)]||_0x12b1dd(0x181)+_0x32abb2,'journeyId':_0x499994,'resolvedRule':_0x59820b,'parentId':_0x3faae5[_0x12b1dd(0x1db)],'folderId':_0x3faae5[_0x12b1dd(0x19e)]||''},_0xcfabce),_0x3a74b2[_0x12b1dd(0x13f)][_0x12b1dd(0x148)](_0x32abb2,_0x365e12),_0x2b71b[_0x12b1dd(0x148)](_0x32abb2,_0x365e12),_0x365e12;})());_0x327584['set'](_0x32abb2,_0x2b5396);try{return await _0x2b5396;}finally{_0x327584[_0x4927b0(0x171)](_0x32abb2);}},'resolveActivationId':async _0x4d451c=>{const _0x5c7fb7=_0x2fbf79,_0x30cec5=_0x271866[_0x5c7fb7(0x197)](_0x4d451c);if(_0x30cec5)return _0x30cec5;if(_0x5baa5[_0x5c7fb7(0x110)]){await _0x571cd9();const _0x49da9e=_0x271866[_0x5c7fb7(0x197)](_0x4d451c);if(_0x49da9e)return _0x49da9e;}throw new SDKError(ErrorCode['NOT_FOUND'],'Activation\x20not\x20found:\x20'+_0x4d451c+_0x5c7fb7(0x13b)+_0x5baa5[_0x5c7fb7(0x124)][_0x5c7fb7(0x17f)]+_0x5c7fb7(0x184)+_0x5c7fb7(0x1ee));},'resolveEmbeddedActivationId':async(_0x3f67e9,_0x2790d6)=>{const _0x36fbc3=_0x2fbf79,_0x19ee02=_0x271866['get'](_0x3f67e9);if(_0x19ee02)return _0x19ee02;if(_0x5baa5['isNew'])return _0x4098d2[_0x36fbc3(0x148)](_0x3f67e9,_0x2790d6),createPendingActivationId(_0x3f67e9);if(_0x5baa5[_0x36fbc3(0x110)]){await _0x571cd9();const _0xe6ed46=_0x271866[_0x36fbc3(0x197)](_0x2790d6[_0x36fbc3(0x17f)]);if(_0xe6ed46)return _0x271866['set'](_0x3f67e9,_0xe6ed46),_0xe6ed46;const _0x1d720f=activationSignature(_0x2790d6),_0x5b932f=_0x4d40b2?.['get'](_0x1d720f);if(_0x5b932f)return _0x271866['set'](_0x3f67e9,_0x5b932f),_0x5b932f;const _0x57673a=await _0x1ebaa6(_0x2790d6,_0x3a74b2[_0x36fbc3(0x144)]),_0x3ef2a7={..._0x57673a,..._0x2790d6['run_after_journey_refresh']!==undefined&&{'runAfterJourneyRefresh':_0x2790d6[_0x36fbc3(0x20e)]}},_0x494229=await _0x323f6a['journey'][_0x36fbc3(0x111)](_0x5baa5['existingJourney']['id'],_0x3ef2a7);return _0x271866[_0x36fbc3(0x148)](_0x3f67e9,_0x494229['id']),_0x494229['id'];}throw new SDKError(ErrorCode[_0x36fbc3(0x12c)],_0x36fbc3(0x133));},'resolveJourneyId':async _0x3102c0=>{const _0x257b47=_0x2fbf79;try{return await _0x323f6a[_0x257b47(0x113)][_0x257b47(0x1d8)](_0x3faae5[_0x257b47(0x1db)],_0x3102c0);}catch(_0x405942){throw new SDKError(ErrorCode[_0x257b47(0x1e9)],_0x257b47(0x13e)+_0x3102c0+'\x27\x20not\x20found\x20in\x20parent\x20segment\x20(referenced\x20in\x20jump\x20step\x20of\x20\x27'+_0x5baa5[_0x257b47(0x124)][_0x257b47(0x17f)]+'\x27)',_0x405942);}},'resolveStageId':async(_0x1b9dde,_0x56f733)=>{const _0x448ab7=_0x2fbf79,_0x227f5a=await _0x323f6a[_0x448ab7(0x113)][_0x448ab7(0x188)](_0x1b9dde),_0x1b639f=_0x227f5a[_0x448ab7(0x18d)][_0x448ab7(0x1bd)]['find'](_0x567c2e=>_0x567c2e[_0x448ab7(0x17f)][_0x448ab7(0x17a)]()===_0x56f733[_0x448ab7(0x17a)]());if(!_0x1b639f?.['id'])throw new SDKError(ErrorCode[_0x448ab7(0x1e9)],_0x448ab7(0x14e)+_0x56f733+_0x448ab7(0x17b)+(_0x227f5a[_0x448ab7(0x18d)][_0x448ab7(0x128)]||_0x227f5a['attributes']['name'])+'\x27');return _0x1b639f['id'];}},_0x1dda79=await _0x7af9b9(_0x5baa5['yamlConfig'],_0x3faae5[_0x2fbf79(0x1db)],_0x46937c),_0x1e15b1=_0x3faae5['folderId']||_0x3faae5[_0x2fbf79(0x19e)];_0x1e15b1&&(_0x1dda79[_0x2fbf79(0x1d2)]={'parentFolder':{'data':{'id':_0x1e15b1,'type':_0x2fbf79(0x14f)}}});if(_0x5baa5[_0x2fbf79(0x164)]){if(_0x46a99f[_0x2fbf79(0x19a)]>0x0||_0x4098d2[_0x2fbf79(0x19a)]>0x0)return await executeThreeStepJourneyCreate(_0x323f6a,_0x5baa5,_0x1dda79,{'pendingEmbeddedSegments':_0x46a99f,'pendingEmbeddedActivations':_0x4098d2,'embeddedSegmentNameToId':_0x2b71b,'journeyActivationNameToId':_0x271866},{..._0x3faae5,'effectiveFolderId':_0x1e15b1},_0x3a74b2,_0x286262,_0x2a4e4);else{ensureJourneyDefaults(_0x1dda79['attributes']);const _0x24a261=await _0x323f6a[_0x2fbf79(0x113)][_0x2fbf79(0x1a3)](_0x1dda79);return deletePushRecovery(_0x5baa5[_0x2fbf79(0x206)]),{'action':'created','journeyId':_0x24a261['id'],'embeddedSegmentNameToId':_0x2b71b};}}else{if(_0x5baa5[_0x2fbf79(0x1f9)]&&_0x5baa5[_0x2fbf79(0x110)]){_0x1dda79['id']=_0x5baa5[_0x2fbf79(0x110)]['id'];const _0x582808=_0x1dda79[_0x2fbf79(0x18d)];_0x5baa5[_0x2fbf79(0x110)][_0x2fbf79(0x18d)]?.[_0x2fbf79(0x128)]&&(_0x582808['journeyBundleName']=_0x5baa5[_0x2fbf79(0x110)][_0x2fbf79(0x18d)]['journeyBundleName']);const _0x386fea=_0x5baa5[_0x2fbf79(0x110)]['attributes']?.[_0x2fbf79(0x1bd)];return _0x386fea&&_0x1dda79[_0x2fbf79(0x18d)][_0x2fbf79(0x1bd)]&&injectExistingStageIds(_0x1dda79[_0x2fbf79(0x18d)][_0x2fbf79(0x1bd)],_0x386fea),ensureJourneyDefaults(_0x582808),await _0x323f6a[_0x2fbf79(0x113)][_0x2fbf79(0x1d7)](_0x5baa5[_0x2fbf79(0x110)]['id'],_0x1dda79),deletePushRecovery(_0x5baa5[_0x2fbf79(0x206)]),{'action':_0x2fbf79(0x1cd),'journeyId':_0x5baa5['existingJourney']['id'],'embeddedSegmentNameToId':_0x2b71b};}}return deletePushRecovery(_0x5baa5[_0x2fbf79(0x206)]),{'action':_0x2fbf79(0x10e),'journeyId':_0x5baa5[_0x2fbf79(0x110)]?.['id'],'embeddedSegmentNameToId':_0x2b71b};}function findSegmentCriteriaLocation(_0x13b664,_0x458699){const _0x4a26c0=a159_0x34a518,_0x5e26c9=_0x13b664[_0x4a26c0(0x1dc)]||_0x13b664[_0x4a26c0(0x16f)]?.[0x0]?.[_0x4a26c0(0x1dc)]||[];let _0x230044='entry',_0x2b199f=_0x458699;const _0x4dbc27=_0x13b664[_0x4a26c0(0x1ce)]||_0x13b664[_0x4a26c0(0x16f)]?.[0x0]?.[_0x4a26c0(0x1ce)];if(_0x4dbc27?.[_0x4a26c0(0x163)]===_0x458699)return{'stageName':_0x4a26c0(0x1ce),'criteriaName':_0x4dbc27[_0x4a26c0(0x17f)]||_0x458699};_0x351095:for(const _0x5d3ffa of _0x5e26c9){if(_0x5d3ffa[_0x4a26c0(0x14d)]?.[_0x4a26c0(0x163)]===_0x458699){_0x230044=_0x5d3ffa['name'],_0x2b199f=_0x5d3ffa['entry_criteria'][_0x4a26c0(0x17f)]||_0x458699;break;}if(_0x5d3ffa[_0x4a26c0(0x20a)])for(const _0x502617 of _0x5d3ffa[_0x4a26c0(0x20a)]){if(_0x502617[_0x4a26c0(0x152)]==='decision_point'&&_0x502617[_0x4a26c0(0x132)]?.['branches'])for(const _0x209e98 of _0x502617[_0x4a26c0(0x132)][_0x4a26c0(0x1bb)]){if(_0x209e98[_0x4a26c0(0x163)]===_0x458699){_0x230044=_0x5d3ffa[_0x4a26c0(0x17f)],_0x2b199f=_0x209e98['name']||_0x458699;break _0x351095;}}}}return{'stageName':_0x230044,'criteriaName':_0x2b199f};}async function executeThreeStepJourneyCreate(_0x1b6469,_0x171a49,_0x5e4f55,_0x407ec7,_0x2d0de3,_0x34acef,_0x399906,_0x29639b){const _0x34aa12=a159_0x34a518,{activationDefToCreateRequest:_0x14024f,yamlRuleToApi:_0x977746}=_0x29639b,{pendingEmbeddedSegments:_0xc85fe,pendingEmbeddedActivations:_0x56f0b7,embeddedSegmentNameToId:_0x3d57ad}=_0x407ec7,_0xb3d53c=JSON[_0x34aa12(0x15e)](JSON['stringify'](_0x5e4f55));ensureJourneyDefaults(_0xb3d53c[_0x34aa12(0x18d)]),stripPendingIds(_0xb3d53c);const _0x5a18af=await _0x1b6469['journey'][_0x34aa12(0x1a3)](_0xb3d53c),_0x11790d=_0x5a18af['id'],_0x1c158c=new Map();for(const _0x21f54e of _0x5a18af['attributes'][_0x34aa12(0x1bd)]){_0x1c158c[_0x34aa12(0x148)](_0x21f54e[_0x34aa12(0x17f)][_0x34aa12(0x17a)](),_0x21f54e['id']);}recoverSegmentIdsFromPushRecovery(_0x171a49,_0x3d57ad,_0x34acef[_0x34aa12(0x13f)]);for(const [_0x3f0393,{definition:_0x444f51}]of _0xc85fe){if(_0x3d57ad[_0x34aa12(0x1c5)](_0x3f0393)){_0x399906[_0x34aa12(0x1a6)]?.({'type':_0x34aa12(0x12a),'journeyName':_0x171a49[_0x34aa12(0x124)][_0x34aa12(0x17f)],'segmentName':_0x3f0393});continue;}const _0x2548d9=generateDeterministicJourneySegmentName(_0x171a49[_0x34aa12(0x124)][_0x34aa12(0x17f)],_0x3f0393);_0x399906[_0x34aa12(0x1a6)]?.({'type':_0x34aa12(0x187),'journeyName':_0x171a49[_0x34aa12(0x124)]['name'],'segmentName':_0x3f0393});const _0xcf4be4=createSegmentIdResolver(_0x34acef[_0x34aa12(0x13f)],_0x3f0393),_0x1a3f09=await resolveRuleSegmentIds(_0x444f51[_0x34aa12(0x185)],_0xcf4be4),_0x294c40=await createOrRecoverEmbeddedSegment(_0x1b6469,_0x171a49,{'localName':_0x3f0393,'uniqueSegmentName':_0x2548d9,'description':_0x444f51[_0x34aa12(0x1a4)]||_0x34aa12(0x181)+_0x3f0393,'journeyId':_0x11790d,'resolvedRule':_0x1a3f09,'parentId':_0x2d0de3[_0x34aa12(0x1db)],'folderId':_0x2d0de3[_0x34aa12(0x1ad)]||''},_0x977746);_0x3d57ad['set'](_0x3f0393,_0x294c40),_0x34acef['segmentNameToId'][_0x34aa12(0x148)](_0x3f0393,_0x294c40),_0x399906[_0x34aa12(0x1a6)]?.({'type':'embedded_segment_created','journeyName':_0x171a49['yamlConfig'][_0x34aa12(0x17f)],'segmentName':_0x3f0393});}const _0x4e8551=new Map();for(const [_0x2d65f5,_0x1d256c]of _0x56f0b7){_0x399906[_0x34aa12(0x1a6)]?.({'type':_0x34aa12(0x1e0),'journeyName':_0x171a49[_0x34aa12(0x124)][_0x34aa12(0x17f)],'activationName':_0x2d65f5});const _0x3a8c22=await _0x14024f(_0x1d256c,_0x34acef[_0x34aa12(0x144)]),_0x3d2ed8={..._0x3a8c22,..._0x1d256c['run_after_journey_refresh']!==undefined&&{'runAfterJourneyRefresh':_0x1d256c['run_after_journey_refresh']}},_0x51fc09=await _0x1b6469[_0x34aa12(0x113)][_0x34aa12(0x111)](_0x11790d,_0x3d2ed8);_0x4e8551['set'](_0x2d65f5,_0x51fc09['id']),_0x407ec7[_0x34aa12(0x199)][_0x34aa12(0x148)](_0x2d65f5,_0x51fc09['id']),_0x399906[_0x34aa12(0x1a6)]?.({'type':'embedded_activation_created','journeyName':_0x171a49[_0x34aa12(0x124)][_0x34aa12(0x17f)],'activationName':_0x2d65f5});}const _0x2f4434=JSON[_0x34aa12(0x15e)](JSON[_0x34aa12(0x1d9)](_0x5e4f55));return _0x2f4434['id']=_0x11790d,ensureJourneyDefaults(_0x2f4434['attributes']),resolvePendingIdsInRequest(_0x2f4434,_0x5e4f55,_0x1c158c,_0x3d57ad,_0x4e8551,_0x399906),await _0x1b6469['journey'][_0x34aa12(0x1d7)](_0x11790d,_0x2f4434),deletePushRecovery(_0x171a49[_0x34aa12(0x206)]),{'action':'created','journeyId':_0x11790d,'embeddedSegmentNameToId':_0x3d57ad};}export function stripWaitStepPendingIds(_0x475f60){const _0x5c8431=a159_0x34a518,_0x1314c5=_0x475f60['conditionSegmentId']&&isPendingSegmentId(_0x475f60[_0x5c8431(0x1e4)]),_0x17434f=_0x475f60[_0x5c8431(0x13c)]?.[_0x5c8431(0x1f4)](_0x5d06e5=>_0x5d06e5[_0x5c8431(0x12d)]&&isPendingSegmentId(_0x5d06e5[_0x5c8431(0x12d)]));(_0x1314c5||_0x17434f)&&(_0x475f60['waitStepType']=_0x5c8431(0x198),_0x475f60[_0x5c8431(0x1c4)]=0x1,_0x475f60[_0x5c8431(0x1ca)]=_0x5c8431(0x1dd),delete _0x475f60[_0x5c8431(0x1e4)],delete _0x475f60[_0x5c8431(0x1e8)],delete _0x475f60[_0x5c8431(0x1f0)],delete _0x475f60[_0x5c8431(0x13c)]);}export function resolveWaitStepPendingIds(_0xa030d7,_0x41bcd9,_0x15cb4e,_0x2e94f1){const _0x290dc7=a159_0x34a518;if(_0x41bcd9[_0x290dc7(0x1e4)]&&isPendingSegmentId(_0x41bcd9[_0x290dc7(0x1e4)])){const _0x27f92d=_0x15cb4e(_0x41bcd9['conditionSegmentId'],_0x290dc7(0x13d)+_0x2e94f1+'\x27\x20wait\x20condition');_0x27f92d&&(_0xa030d7[_0x290dc7(0x11d)]=_0x290dc7(0x1f1),_0xa030d7[_0x290dc7(0x1e4)]=_0x27f92d,delete _0xa030d7[_0x290dc7(0x1c4)],delete _0xa030d7[_0x290dc7(0x1ca)],_0x41bcd9[_0x290dc7(0x1e8)]!==undefined&&(_0xa030d7['conditionTimeoutDuration']=_0x41bcd9[_0x290dc7(0x1e8)]),_0x41bcd9[_0x290dc7(0x1f0)]&&(_0xa030d7[_0x290dc7(0x1f0)]=_0x41bcd9['conditionTimeoutUnit']));}if(_0x41bcd9['conditions']){const _0x442896=_0x41bcd9[_0x290dc7(0x13c)][_0x290dc7(0x1f4)](_0x549450=>_0x549450[_0x290dc7(0x12d)]&&isPendingSegmentId(_0x549450[_0x290dc7(0x12d)]));if(_0x442896){const _0x2961bc=_0x41bcd9[_0x290dc7(0x13c)][_0x290dc7(0x155)](_0x2b6b8e=>{const _0x435d2a=_0x290dc7;if(_0x2b6b8e['segmentId']&&isPendingSegmentId(_0x2b6b8e[_0x435d2a(0x12d)])){const _0x4443f9=_0x15cb4e(_0x2b6b8e[_0x435d2a(0x12d)],_0x435d2a(0x13d)+_0x2e94f1+_0x435d2a(0x136));return{..._0x2b6b8e,'segmentId':_0x4443f9||_0x2b6b8e['segmentId']};}return{..._0x2b6b8e};});_0xa030d7[_0x290dc7(0x11d)]=_0x290dc7(0x1f1),_0xa030d7['conditions']=_0x2961bc,delete _0xa030d7['waitStep'],delete _0xa030d7[_0x290dc7(0x1ca)],delete _0xa030d7['conditionSegmentId'],delete _0xa030d7[_0x290dc7(0x1e8)],delete _0xa030d7[_0x290dc7(0x1f0)];}}}function stripPendingIds(_0x33ca86){const _0x1acd12=a159_0x34a518;_0x33ca86['attributes']['goal']?.[_0x1acd12(0x12d)]&&isPendingSegmentId(_0x33ca86[_0x1acd12(0x18d)][_0x1acd12(0x1ce)][_0x1acd12(0x12d)])&&delete _0x33ca86[_0x1acd12(0x18d)]['goal'];for(const _0x10bc88 of _0x33ca86[_0x1acd12(0x18d)][_0x1acd12(0x1bd)]||[]){_0x10bc88[_0x1acd12(0x1b1)]?.['segmentId']&&isPendingSegmentId(_0x10bc88[_0x1acd12(0x1b1)][_0x1acd12(0x12d)])&&delete _0x10bc88[_0x1acd12(0x1b1)];_0x10bc88[_0x1acd12(0x1ba)]?.[_0x1acd12(0x12d)]&&isPendingSegmentId(_0x10bc88[_0x1acd12(0x1ba)][_0x1acd12(0x12d)])&&delete _0x10bc88[_0x1acd12(0x1ba)];_0x10bc88[_0x1acd12(0x1a0)]&&(_0x10bc88[_0x1acd12(0x1a0)]=_0x10bc88[_0x1acd12(0x1a0)][_0x1acd12(0x1fc)](_0x3a680f=>!_0x3a680f['segmentId']||!isPendingSegmentId(_0x3a680f['segmentId'])));if(_0x10bc88[_0x1acd12(0x20a)])for(const _0x4808a0 of Object[_0x1acd12(0x122)](_0x10bc88[_0x1acd12(0x20a)])){const _0x3af3d3=_0x10bc88[_0x1acd12(0x20a)][_0x4808a0];_0x3af3d3[_0x1acd12(0x152)]==='Activation'&&_0x3af3d3['journeyActivationStepId']&&isPendingActivationId(_0x3af3d3[_0x1acd12(0x1fe)])&&(_0x3af3d3['journeyActivationStepId']='');if(_0x3af3d3[_0x1acd12(0x152)]===_0x1acd12(0x173)&&_0x3af3d3[_0x1acd12(0x1bb)])for(const _0x521bdf of _0x3af3d3[_0x1acd12(0x1bb)]){_0x521bdf[_0x1acd12(0x12d)]&&isPendingSegmentId(_0x521bdf[_0x1acd12(0x12d)])&&(_0x521bdf['segmentId']='');}_0x3af3d3[_0x1acd12(0x152)]==='WaitStep'&&stripWaitStepPendingIds(_0x3af3d3);}}}function resolvePendingIdsInRequest(_0x37dd43,_0x580773,_0x34e2f1,_0x1cc9b9,_0x41807b,_0x4220e2){const _0x441675=a159_0x34a518,_0x3b5ac1=(_0x120ade,_0x1eb0fc)=>{const _0x2e6cd0=a159_0x2ae9;if(!isPendingSegmentId(_0x120ade))return _0x120ade;const _0x413bd0=extractPendingSegmentName(_0x120ade),_0x1704e9=_0x1cc9b9[_0x2e6cd0(0x197)](_0x413bd0);return!_0x1704e9&&_0x4220e2[_0x2e6cd0(0x1c1)]?.(_0x2e6cd0(0x135)+_0x413bd0+_0x2e6cd0(0x140)+_0x1eb0fc),_0x1704e9;};if(_0x37dd43[_0x441675(0x18d)][_0x441675(0x1ce)]?.[_0x441675(0x12d)]&&isPendingSegmentId(_0x37dd43[_0x441675(0x18d)][_0x441675(0x1ce)][_0x441675(0x12d)])){const _0x5bb4ed=_0x3b5ac1(_0x37dd43[_0x441675(0x18d)][_0x441675(0x1ce)][_0x441675(0x12d)],_0x441675(0x1e7));_0x5bb4ed&&(_0x37dd43[_0x441675(0x18d)][_0x441675(0x1ce)][_0x441675(0x12d)]=_0x5bb4ed);}for(const _0x495a04 of _0x37dd43[_0x441675(0x18d)]['journeyStages']||[]){const _0x40886f=_0x34e2f1[_0x441675(0x197)](_0x495a04['name']['toLowerCase']());_0x40886f&&(_0x495a04['id']=_0x40886f);if(_0x495a04[_0x441675(0x1b1)]?.[_0x441675(0x12d)]&&isPendingSegmentId(_0x495a04[_0x441675(0x1b1)][_0x441675(0x12d)])){const _0x42f22b=_0x3b5ac1(_0x495a04[_0x441675(0x1b1)]['segmentId'],'stage\x20\x27'+_0x495a04[_0x441675(0x17f)]+_0x441675(0x1e5));_0x42f22b&&(_0x495a04[_0x441675(0x1b1)][_0x441675(0x12d)]=_0x42f22b);}if(_0x495a04['exitCriterias'])for(const _0x1c18e9 of _0x495a04[_0x441675(0x1a0)]){if(_0x1c18e9[_0x441675(0x12d)]&&isPendingSegmentId(_0x1c18e9[_0x441675(0x12d)])){const _0x5a5009=_0x3b5ac1(_0x1c18e9[_0x441675(0x12d)],'stage\x20\x27'+_0x495a04[_0x441675(0x17f)]+_0x441675(0x1ac));_0x5a5009&&(_0x1c18e9['segmentId']=_0x5a5009);}}if(_0x495a04[_0x441675(0x1ba)]?.[_0x441675(0x12d)]&&isPendingSegmentId(_0x495a04[_0x441675(0x1ba)]['segmentId'])){const _0x52d964=_0x3b5ac1(_0x495a04[_0x441675(0x1ba)]['segmentId'],_0x441675(0x13d)+_0x495a04[_0x441675(0x17f)]+'\x27\x20milestone');_0x52d964&&(_0x495a04[_0x441675(0x1ba)]['segmentId']=_0x52d964);}if(_0x495a04[_0x441675(0x20a)]){const _0x52d00d=_0x566a28=>_0x580773['attributes'][_0x441675(0x1bd)]?.[_0x441675(0x1f8)](_0x277899=>_0x277899[_0x441675(0x17f)][_0x441675(0x17a)]()===_0x495a04['name'][_0x441675(0x17a)]())?.['steps']?.[_0x566a28];for(const _0x183ad1 of Object[_0x441675(0x122)](_0x495a04['steps'])){const _0x576310=_0x495a04[_0x441675(0x20a)][_0x183ad1],_0x3a6cc1=_0x52d00d(_0x183ad1);if(_0x576310[_0x441675(0x152)]==='Activation'&&_0x576310[_0x441675(0x1fe)]&&(isPendingActivationId(_0x576310[_0x441675(0x1fe)])||_0x576310[_0x441675(0x1fe)]==='')){if(_0x3a6cc1?.[_0x441675(0x1fe)]&&isPendingActivationId(_0x3a6cc1[_0x441675(0x1fe)])){const _0x26c2b6=extractPendingActivationName(_0x3a6cc1[_0x441675(0x1fe)]),_0x871734=_0x41807b[_0x441675(0x197)](_0x26c2b6);_0x871734&&(_0x576310[_0x441675(0x1fe)]=_0x871734);}}if(_0x576310['type']==='DecisionPoint'&&_0x576310[_0x441675(0x1bb)]&&_0x3a6cc1?.[_0x441675(0x1bb)])for(let _0x150f36=0x0;_0x150f36<_0x576310[_0x441675(0x1bb)][_0x441675(0x116)];_0x150f36++){const _0x2438f7=_0x576310[_0x441675(0x1bb)][_0x150f36],_0x36a46e=_0x3a6cc1[_0x441675(0x1bb)][_0x150f36];if(_0x36a46e?.[_0x441675(0x12d)]&&isPendingSegmentId(_0x36a46e['segmentId'])){const _0x24741a=_0x3b5ac1(_0x36a46e[_0x441675(0x12d)],_0x441675(0x13d)+_0x495a04[_0x441675(0x17f)]+_0x441675(0x119)+(_0x2438f7[_0x441675(0x17f)]||_0x150f36)+'\x27');_0x24741a&&(_0x2438f7[_0x441675(0x12d)]=_0x24741a);}}_0x576310[_0x441675(0x152)]===_0x441675(0x1f3)&&_0x3a6cc1?.['type']===_0x441675(0x1f3)&&resolveWaitStepPendingIds(_0x576310,_0x3a6cc1,_0x3b5ac1,_0x495a04['name']);}}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x5aee85,_0x5b6af7){const _0x84a64f=a160_0x45ba,_0x59ce85=_0x5aee85();while(!![]){try{const _0x727e80=parseInt(_0x84a64f(0x17b))/0x1+-parseInt(_0x84a64f(0x188))/0x2*(parseInt(_0x84a64f(0x180))/0x3)+-parseInt(_0x84a64f(0x17f))/0x4*(-parseInt(_0x84a64f(0x186))/0x5)+-parseInt(_0x84a64f(0x182))/0x6+parseInt(_0x84a64f(0x185))/0x7+parseInt(_0x84a64f(0x18a))/0x8*(parseInt(_0x84a64f(0x17e))/0x9)+-parseInt(_0x84a64f(0x184))/0xa;if(_0x727e80===_0x5b6af7)break;else _0x59ce85['push'](_0x59ce85['shift']());}catch(_0x1fa79a){_0x59ce85['push'](_0x59ce85['shift']());}}}(a160_0x1495,0xb6336));function a160_0x1495(){const _0xfc4063=['506192sDqDcR','827865gzxkJL','set','has','153xlvZdy','12ikWqaA','348rLiZKh','name','2763798aHcUIa','add','14763890xhZIdu','7949228uqdbhG','931995mWthkH','get','15776oqazrE','parentFolderId'];a160_0x1495=function(){return _0xfc4063;};return a160_0x1495();}export function buildFolderIdToPathMap(_0x4c1a9e){const _0x2c33ae=a160_0x45ba,_0x257fb0=new Map(),_0x382411=new Map();for(const _0x10a48a of _0x4c1a9e){_0x382411[_0x2c33ae(0x17c)](_0x10a48a['id'],_0x10a48a);}const _0x128ade=new Set();for(const _0x51d871 of _0x4c1a9e){!_0x51d871['parentFolderId']&&_0x128ade[_0x2c33ae(0x183)](_0x51d871['id']);}function _0xbb2929(_0x59a4b4){const _0x427a34=_0x2c33ae;if(_0x257fb0[_0x427a34(0x17d)](_0x59a4b4['id']))return _0x257fb0[_0x427a34(0x187)](_0x59a4b4['id']);if(_0x128ade['has'](_0x59a4b4['id']))return _0x257fb0[_0x427a34(0x17c)](_0x59a4b4['id'],''),'';if(_0x59a4b4[_0x427a34(0x189)]){const _0x2f207b=_0x382411[_0x427a34(0x187)](_0x59a4b4['parentFolderId']);if(_0x2f207b){const _0x31b51b=_0xbb2929(_0x2f207b),_0x3010af=_0x31b51b?_0x31b51b+'/'+_0x59a4b4[_0x427a34(0x181)]:_0x59a4b4[_0x427a34(0x181)];return _0x257fb0['set'](_0x59a4b4['id'],_0x3010af),_0x3010af;}}const _0x80d25f=_0x59a4b4['name'];return _0x257fb0[_0x427a34(0x17c)](_0x59a4b4['id'],_0x80d25f),_0x80d25f;}for(const _0x1898ed of _0x4c1a9e){_0xbb2929(_0x1898ed);}return _0x257fb0;}function a160_0x45ba(_0x3c478e,_0x4d744b){_0x3c478e=_0x3c478e-0x17b;const _0x149501=a160_0x1495();let _0x45ba6e=_0x149501[_0x3c478e];return _0x45ba6e;}export function buildFolderPathToIdMap(_0x256ca0){const _0xdba2f2=a160_0x45ba,_0x35fabf=new Map(),_0x51ade1=new Map();for(const _0x5bb3ff of _0x256ca0){_0x51ade1[_0xdba2f2(0x17c)](_0x5bb3ff['id'],_0x5bb3ff);}const _0x5aa115=new Set();for(const _0x2a5bc4 of _0x256ca0){!_0x2a5bc4[_0xdba2f2(0x189)]&&_0x5aa115[_0xdba2f2(0x183)](_0x2a5bc4['id']);}function _0xe87db9(_0x3de98c){const _0x44a970=_0xdba2f2;if(_0x5aa115[_0x44a970(0x17d)](_0x3de98c['id']))return'';if(_0x3de98c[_0x44a970(0x189)]){const _0x4f7f27=_0x51ade1[_0x44a970(0x187)](_0x3de98c[_0x44a970(0x189)]);if(_0x4f7f27){const _0x14f967=_0xe87db9(_0x4f7f27);return _0x14f967?_0x14f967+'/'+_0x3de98c['name']:_0x3de98c[_0x44a970(0x181)];}}return _0x3de98c['name'];}for(const _0x6e50c0 of _0x256ca0){const _0x5de20b=_0xe87db9(_0x6e50c0);_0x35fabf[_0xdba2f2(0x17c)](_0x5de20b,_0x6e50c0['id']);}return _0x35fabf;}export function buildFolderMaps(_0x26d8c3){const _0x1f4252=a160_0x45ba,_0x34fc90=buildFolderIdToPathMap(_0x26d8c3),_0x3760fd=new Map();for(const [_0x231bc0,_0x122212]of _0x34fc90){_0x3760fd[_0x1f4252(0x17c)](_0x122212,_0x231bc0);}return{'idToPath':_0x34fc90,'pathToId':_0x3760fd};}export function getFolderPath(_0x177ca2,_0x5ad105){if(!_0x177ca2)return'';return _0x5ad105['get'](_0x177ca2)??'';}
|