@treasuredata/tdx 2026.4.11 → 2026.4.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bin.js +1 -1
- package/dist/build-info.json +3 -3
- package/dist/cli-categories.js +1 -1
- package/dist/cli.js +1 -1
- package/dist/commands/activations.js +1 -1
- package/dist/commands/agent-command.js +1 -1
- package/dist/commands/agent-test-command.js +1 -1
- package/dist/commands/api-command.js +1 -1
- package/dist/commands/auth-command.js +1 -1
- package/dist/commands/cas-command.js +1 -1
- package/dist/commands/cas-segment-command.js +1 -1
- package/dist/commands/chat-command.js +1 -1
- package/dist/commands/claude-command.js +1 -1
- package/dist/commands/claude-statusline-command.js +1 -1
- package/dist/commands/claude-usage-command.js +1 -1
- package/dist/commands/command.js +1 -1
- package/dist/commands/connection-command.js +1 -1
- package/dist/commands/databases.js +1 -1
- package/dist/commands/delivery-command.js +1 -1
- package/dist/commands/describe.js +1 -1
- package/dist/commands/engage-campaign-pull-command.js +1 -1
- package/dist/commands/engage-campaign-push-command.js +1 -1
- package/dist/commands/engage-campaign-validate-command.js +1 -1
- package/dist/commands/engage-command.js +1 -1
- package/dist/commands/engage-template-pull-command.js +1 -1
- package/dist/commands/engage-template-push-command.js +1 -1
- package/dist/commands/engage-template-validate-command.js +1 -1
- package/dist/commands/job-command.js +1 -1
- package/dist/commands/journey-command.js +1 -1
- package/dist/commands/journey-validate-command.js +1 -1
- package/dist/commands/llm-command.js +1 -1
- package/dist/commands/mcp-command.js +1 -1
- package/dist/commands/parent-segment-command.js +1 -1
- package/dist/commands/policy-command.js +1 -1
- package/dist/commands/profile-command.js +1 -1
- package/dist/commands/profiles-command.js +1 -1
- package/dist/commands/query-command.js +1 -1
- package/dist/commands/schedule-command.js +1 -1
- package/dist/commands/segment-command.js +1 -1
- package/dist/commands/segment-create-command.js +1 -1
- package/dist/commands/segment-fields-command.js +1 -1
- package/dist/commands/segment-pull-command.js +1 -1
- package/dist/commands/segment-push-command.js +1 -1
- package/dist/commands/segment-update-command.js +1 -1
- package/dist/commands/segment-use-command.js +1 -1
- package/dist/commands/segment-validate-command.js +1 -1
- package/dist/commands/segments.js +1 -1
- package/dist/commands/show.js +1 -1
- package/dist/commands/status-command.js +1 -1
- package/dist/commands/tables.js +1 -1
- package/dist/commands/unset-command.js +1 -1
- package/dist/commands/upgrade-command.js +1 -1
- package/dist/commands/use-command.js +1 -1
- package/dist/commands/user-command.js +1 -1
- package/dist/commands/work-command.js +1 -1
- package/dist/commands/workflow-command.js +1 -1
- package/dist/core/auth.js +1 -1
- package/dist/core/command-output.js +1 -1
- package/dist/core/config.js +1 -1
- package/dist/core/connection-cache.js +1 -1
- package/dist/core/constants.js +1 -1
- package/dist/core/credential-cache.js +1 -1
- package/dist/core/global-context.js +1 -1
- package/dist/core/keychain.js +1 -1
- package/dist/core/oauth-keychain.js +1 -1
- package/dist/core/oauth.js +1 -1
- package/dist/core/profile.d.ts +1 -0
- package/dist/core/profile.d.ts.map +1 -1
- package/dist/core/profile.js +1 -1
- package/dist/core/profile.js.map +1 -1
- package/dist/core/project-config.js +1 -1
- package/dist/core/session.js +1 -1
- package/dist/core/user-cache.js +1 -1
- package/dist/core/version.js +1 -1
- package/dist/index.js +1 -1
- package/dist/mcp/server.js +1 -1
- package/dist/mcp/tools/index.js +1 -1
- package/dist/mcp/tools/tdx-run.js +1 -1
- package/dist/mcp/tools/tdx-search.js +1 -1
- package/dist/mcp/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.js +1 -1
- package/dist/sdk/cas/cas-audience-yaml.js +1 -1
- package/dist/sdk/cas/cas-segment-yaml.js +1 -1
- package/dist/sdk/cas/index.js +1 -1
- package/dist/sdk/cas/pull-workflow.js +1 -1
- package/dist/sdk/cas/push-workflow.js +1 -1
- package/dist/sdk/client/cdp-api-client.js +1 -1
- package/dist/sdk/client/delivery-api-client.js +1 -1
- package/dist/sdk/client/endpoints.js +1 -1
- package/dist/sdk/client/engage-api-client.js +1 -1
- package/dist/sdk/client/http-client.js +1 -1
- package/dist/sdk/client/llm-api-client.js +1 -1
- package/dist/sdk/client/oauth-refresh.js +1 -1
- package/dist/sdk/client/rate-limiter.js +1 -1
- package/dist/sdk/client/td-api-client.js +1 -1
- package/dist/sdk/client/trino-api-client.js +1 -1
- package/dist/sdk/client/workflow-client.js +1 -1
- package/dist/sdk/connection-validator.js +1 -1
- package/dist/sdk/connection.js +1 -1
- package/dist/sdk/delivery.js +1 -1
- package/dist/sdk/engage/campaign-pull.js +1 -1
- package/dist/sdk/engage/campaign-push.js +1 -1
- package/dist/sdk/engage/campaign-validator.js +1 -1
- package/dist/sdk/engage/campaign-yaml.js +1 -1
- package/dist/sdk/engage/template-pull.js +1 -1
- package/dist/sdk/engage/template-push.js +1 -1
- package/dist/sdk/engage/template-validator.js +1 -1
- package/dist/sdk/engage/template-yaml.js +1 -1
- package/dist/sdk/engage/types/campaign-def.js +1 -1
- package/dist/sdk/engage/types/campaign-schema.js +1 -1
- package/dist/sdk/engage/types/template-schema.js +1 -1
- package/dist/sdk/engage.js +1 -1
- package/dist/sdk/errors.js +1 -1
- package/dist/sdk/index.js +1 -1
- package/dist/sdk/io/index.js +1 -1
- package/dist/sdk/io/node-filesystem.js +1 -1
- package/dist/sdk/job.js +1 -1
- package/dist/sdk/journey.d.ts +6 -0
- package/dist/sdk/journey.d.ts.map +1 -1
- package/dist/sdk/journey.js +1 -1
- package/dist/sdk/journey.js.map +1 -1
- package/dist/sdk/llm/chat-cache.js +1 -1
- package/dist/sdk/llm/index.js +1 -1
- package/dist/sdk/llm/llm-backup-utils.js +1 -1
- package/dist/sdk/llm/model-factors.js +1 -1
- package/dist/sdk/personalization.js +1 -1
- package/dist/sdk/policy.js +1 -1
- package/dist/sdk/query/index.js +1 -1
- package/dist/sdk/query/sql-parser.js +1 -1
- package/dist/sdk/realtime.js +1 -1
- package/dist/sdk/schedule.js +1 -1
- package/dist/sdk/segment/child-segment-yaml.js +1 -1
- package/dist/sdk/segment/fields-display.js +1 -1
- package/dist/sdk/segment/file-discovery.js +1 -1
- package/dist/sdk/segment/journey-utils.js +1 -1
- package/dist/sdk/segment/journey-validator.js +1 -1
- package/dist/sdk/segment/journey-yaml.js +1 -1
- package/dist/sdk/segment/parent-segment-preview.js +1 -1
- package/dist/sdk/segment/parent-segment-yaml.js +1 -1
- package/dist/sdk/segment/pull-workflow.js +1 -1
- package/dist/sdk/segment/push-recovery.js +1 -1
- package/dist/sdk/segment/push-workflow.js +1 -1
- package/dist/sdk/segment/resolution-context.js +1 -1
- package/dist/sdk/segment/segment-path-parser.js +1 -1
- package/dist/sdk/segment/segment-ref-parser.js +1 -1
- package/dist/sdk/segment/segment-validator.js +1 -1
- package/dist/sdk/segment/target-resolution.js +1 -1
- package/dist/sdk/segment/tdx-config.js +1 -1
- package/dist/sdk/segment/types/activation-schema.js +1 -1
- package/dist/sdk/segment/types/journey-def.js +1 -1
- package/dist/sdk/segment/types/journey-schema.js +1 -1
- package/dist/sdk/segment/types/segment-def.js +1 -1
- package/dist/sdk/segment/types/segment-schema.js +1 -1
- package/dist/sdk/segment/validate-files.js +1 -1
- package/dist/sdk/segment/yaml-validator.js +1 -1
- package/dist/sdk/segment.js +1 -1
- package/dist/sdk/types/index.js +1 -1
- package/dist/sdk/types/progress.js +1 -1
- package/dist/sdk/types/workspace.d.ts +2 -0
- package/dist/sdk/types/workspace.d.ts.map +1 -1
- package/dist/sdk/types/workspace.js +1 -1
- package/dist/sdk/user.js +1 -1
- package/dist/sdk/util/format-detector.js +1 -1
- package/dist/sdk/util/formatters.js +1 -1
- package/dist/sdk/util/index.js +1 -1
- package/dist/sdk/util/paginate.js +1 -1
- package/dist/sdk/util/tree-formatter.js +1 -1
- package/dist/sdk/workflow/archive-validation.js +1 -1
- package/dist/sdk/workflow/clone-workflow.js +1 -1
- package/dist/sdk/workflow/index.js +1 -1
- package/dist/sdk/workflow/pull-workflow.js +1 -1
- package/dist/sdk/workflow/push-workflow.js +1 -1
- package/dist/sdk/workflow/tdx-config.js +1 -1
- package/dist/sdk/workflow/workflow-utils.js +1 -1
- package/dist/sdk/workspace/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.d.ts.map +1 -1
- package/dist/sdk/workspace/index.js +1 -1
- package/dist/sdk/workspace/index.js.map +1 -1
- package/dist/sdk/workspace/templates.d.ts.map +1 -1
- package/dist/sdk/workspace/templates.js +1 -1
- package/dist/sdk/workspace/templates.js.map +1 -1
- package/dist/sdk/workspace/weekly.js +1 -1
- package/dist/sdk/workspace/wikilinks.js +1 -1
- package/dist/test-utils/command-runner.js +1 -1
- package/dist/test-utils/factories.js +1 -1
- package/dist/test-utils/fixtures.js +1 -1
- package/dist/test-utils/http-mock.js +1 -1
- package/dist/test-utils/index.js +1 -1
- package/dist/utils/async.js +1 -1
- package/dist/utils/colors.js +1 -1
- package/dist/utils/diff.js +1 -1
- package/dist/utils/file-permissions.js +1 -1
- package/dist/utils/file-reader.js +1 -1
- package/dist/utils/github-releases.js +1 -1
- package/dist/utils/global-cache.js +1 -1
- package/dist/utils/json-loader.js +1 -1
- package/dist/utils/local-cache.js +1 -1
- package/dist/utils/logger/formatters/default-formatter.js +1 -1
- package/dist/utils/logger/formatters/index.js +1 -1
- package/dist/utils/logger/handlers/console-handler.js +1 -1
- package/dist/utils/logger/handlers/file-handler.js +1 -1
- package/dist/utils/logger/handlers/index.js +1 -1
- package/dist/utils/logger/handlers/null-handler.js +1 -1
- package/dist/utils/logger/index.js +1 -1
- package/dist/utils/logger/logger.js +1 -1
- package/dist/utils/logger/types.js +1 -1
- package/dist/utils/option-validation.js +1 -1
- package/dist/utils/process.js +1 -1
- package/dist/utils/prompt.js +1 -1
- package/dist/utils/spinner.js +1 -1
- package/dist/utils/sse-parser.js +1 -1
- package/dist/utils/string-utils.js +1 -1
- package/dist/utils/table-ref-parser.js +1 -1
- package/dist/utils/tdx-logger.js +1 -1
- package/dist/utils/version-check.js +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
function a152_0x22ad(){const _0x15a29b=['Cannot\x20create\x20embedded\x20activation\x20without\x20journey\x20context','activation_updating','Created\x20activation\x20\x27','Embedded\x20segment\x20\x27','folderId','logInfo','updateSegmentById','update','max','add','Created\x20journey\x20\x27','columns','Deleted\x20segment\x20\x27','set','valid','Fetching\x20','slice','journey_updated','Segment\x20not\x20found:\x20','null','Define\x20it\x20in\x20the\x20journey\x27s\x20\x27activations\x27\x20section\x20or\x20use\x20an\x20existing\x20activation\x20ID.','unchanged','Creating\x20folder\x20\x27','18tScjrf','journeyActivationNameToId','__pending_act_','\x27\x20not\x20found\x20in\x20parent\x20segment\x20(referenced\x20in\x20jump\x20step\x20of\x20\x27','Stage\x20\x27','./child-segment-yaml.js','segmentFolderId','1207194fJAXAn','\x27\x20exit\x20criteria','resolvedRule','SEGMENT_UPDATE_ERROR','getSegment','Deleting\x20activation\x20\x27','yamlConfig','Deleted\x20activation\x20\x27','Warning:\x20Could\x20not\x20resolve\x20embedded\x20segment\x20\x27','notification','activations','relative','.$1.push-recovery.json','values','sha1','connector_config','embedded_activation_created','digest','onProgress','from','Failed\x20to\x20','diff','getSegmentEntity\x20also\x20failed\x20for\x20','find','isArray','\x27\x20by\x20rule\x20content','absolutePath','createFolder','\x27\x20already\x20exists\x20on\x20server\x20but\x20cannot\x20be\x20found.\x20','state','get','rootFolderId','embeddedSegmentNameToId','\x20segment\x20from\x20file:\x20','progress','nameToId','WaitStep','2946oeHEOj','deps','validatedRequest','length','day','\x27\x20entry\x20criteria','resolveSegment','Failed\x20to\x20fetch\x20referenced\x20segment\x20','stringify','segments','Created\x20segment\x20\x27','startsWith','\x0a\x20\x20','\x27\x20for\x20','folder','\x20error(s)','NOT_FOUND','and\x20the\x20server\x20segment,\x20then\x20retry.','Updated\x20segment\x20\x27','existingJourney','../../utils/async.js','Delete\x20the\x20push\x20recovery\x20file\x20(','segment_created','debug','uniqueSegmentName','segmentId','toString','folderPath','description','resolveJourneyId','waitStepUnit','activation_template_id','getJourney','match','delete','run_after_journey_refresh','results','updated','replace','stage\x20\x27','data','index','split','segment_updated','create','draft','Updated\x20activation\x20\x27','created','\x20(referenced\x20in\x20embedded\x20segment\x20\x27','Segment\x20not\x20found','journey_entry_criteria_','existingSegments','Duration','journey_updating','createSegment','milestone','waitStepType','filter','embedded_segment_created','ACTIVATION_UPDATE_ERROR','Created\x20folder\x20\x27','exitCriterias','fetchJourney','Failed\x20to\x20resolve\x20segment\x20','\x27\x20to\x20local\x20\x27','segment_creating','includes','\x20(referenced\x20in\x20journey\x20','verbose','logSuccess','):\x20','all_columns','activation_deleting','rule','size','dirname','buildUserMaps','6682iYwDSU','\x20activation\x20\x27','getActivation','activation_','embedded_segment_creating','journeyBundleId','Creating\x20activation\x20\x27','segment_deleted','segment_deleting','2430976gpXivg','entry_criteria','message','goal','Matched\x20server\x20segment\x20\x27','journeyStages','idToEmailMap','entryCriteria','connection','list','stages',').\x20','journey_creating','134140Szpimt','folderPathToId','branches','attributes','has','join','nameToType','waitStep','hasChanges','getLatestJourneyId','journey','entry','reduce','conditionTimeoutDuration','journeyId','conditions','activationParams','hex','\x27...','\x27\x20decision\x20point\x20branch\x20\x27','existingSegment','action','ACTIVATION_SYNTAX_ERROR','activationContext','connectionIdToNameMap','utf-8','./journey-yaml.js','32680PXNOHl','isNew','item','keys','Updated\x20journey\x20\x27','existingActivation','parentFolder','segmentByFolderAndName','sort','activationsBySegmentId','journeyBundleName','versionNumber','createActivation','type','logDeleted','Creating\x20segment\x20\x27','createdSegmentId','entries','142NUjWHf','decision_point','map','DecisionPoint','journeyById','name','journeyName','conditionTimeoutUnit','logWarning','276616FUNDnv','638JZHvcU','INTERNAL','activationActions','schedule','deleted','with','tdx.sdk.push-workflow','\x27\x20from\x20file:\x20','localName','parentId','errors','relationships','activation_updated','goal\x20criteria','activation_creating','some','Condition','Cannot\x20create\x20embedded\x20segment\x20for\x20existing\x20journey\x20without\x20journey\x20ID','Failed\x20to\x20sync\x20activations\x20for\x20segment\x20\x27','steps','segmentNameToId','SEGMENT_NOT_FOUND','toLowerCase','folder_creating','journeys','getSegmentEntity','parse','parseDocument','conditionSegmentId','kind','withProgress','parentSegmentFolder',',\x20falling\x20back\x20to\x20getSegmentEntity:\x20','2611EZShxT','Failed\x20to\x20resolve\x20activation\x20','updateActivation','Activation','idToName','all','push','JOURNEY_UPDATE_ERROR','JOURNEY_SYNTAX_ERROR','journeyActivationStepId','segment'];a152_0x22ad=function(){return _0x15a29b;};return a152_0x22ad();}const a152_0x525fdb=a152_0x400d;(function(_0x1acbe5,_0x4f3b3b){const _0x2df4d4=a152_0x400d,_0x30883c=_0x1acbe5();while(!![]){try{const _0x4d5ec2=-parseInt(_0x2df4d4(0x18b))/0x1*(-parseInt(_0x2df4d4(0x148))/0x2)+parseInt(_0x2df4d4(0xd6))/0x3+-parseInt(_0x2df4d4(0x194))/0x4+-parseInt(_0x2df4d4(0x179))/0x5+parseInt(_0x2df4d4(0xfb))/0x6*(-parseInt(_0x2df4d4(0xad))/0x7)+-parseInt(_0x2df4d4(0x151))/0x8*(parseInt(_0x2df4d4(0xcf))/0x9)+parseInt(_0x2df4d4(0x15e))/0xa*(parseInt(_0x2df4d4(0x195))/0xb);if(_0x4d5ec2===_0x4f3b3b)break;else _0x30883c['push'](_0x30883c['shift']());}catch(_0x4b60fc){_0x30883c['push'](_0x30883c['shift']());}}}(a152_0x22ad,0xc071f));import{createHash}from'crypto';import{Logger}from'../../utils/logger/index.js';const logger=Logger['of'](a152_0x525fdb(0x19b));export const PENDING_SEGMENT_PREFIX='__pending_';export const PENDING_ACTIVATION_PREFIX=a152_0x525fdb(0xd1);export function createPendingSegmentId(_0x50fc5b){return''+PENDING_SEGMENT_PREFIX+_0x50fc5b+'__';}export function isPendingSegmentId(_0x1878b1){const _0xdc9f55=a152_0x525fdb;return _0x1878b1[_0xdc9f55(0x106)](PENDING_SEGMENT_PREFIX)&&!_0x1878b1['startsWith'](PENDING_ACTIVATION_PREFIX);}export function extractPendingSegmentName(_0x4b572d){const _0x3219b1=a152_0x525fdb;return _0x4b572d[_0x3219b1(0x121)](/^__pending_(.+)__$/,'$1');}export function createPendingActivationId(_0x18b3f6){return''+PENDING_ACTIVATION_PREFIX+_0x18b3f6+'__';}export function isPendingActivationId(_0x3b8ea8){const _0x3bda69=a152_0x525fdb;return _0x3b8ea8[_0x3bda69(0x106)](PENDING_ACTIVATION_PREFIX);}export function extractPendingActivationName(_0x2d814d){const _0xfcea45=a152_0x525fdb;return _0x2d814d[_0xfcea45(0x121)](/^__pending_act_(.+)__$/,'$1');}export function generateDeterministicJourneySegmentName(_0x4e6956,_0x21e17f){const _0x27d88d=a152_0x525fdb,_0x1304c4=_0x4e6956+'::'+(_0x21e17f['trim']()||_0x27d88d(0xb7)),_0x3cbcfe=createHash(_0x27d88d(0xe4))['update'](_0x1304c4)[_0x27d88d(0xe7)](_0x27d88d(0x16f))[_0x27d88d(0xc8)](0x0,0xc);return _0x27d88d(0x12d)+_0x3cbcfe;}export function ensureJourneyDefaults(_0x3e5be5){const _0x44bd92=a152_0x525fdb;!_0x3e5be5[_0x44bd92(0x117)]&&(_0x3e5be5[_0x44bd92(0x117)]=''),!_0x3e5be5[_0x44bd92(0xf3)]&&(_0x3e5be5['state']=_0x44bd92(0x128));}export function injectExistingStageIds(_0x4e8c7c,_0x3d2e3c){const _0x223ac8=a152_0x525fdb,_0x16485f=new Map(_0x3d2e3c[_0x223ac8(0x18d)](_0x1efc69=>[_0x1efc69[_0x223ac8(0x190)],_0x1efc69['id']]));for(const _0x455e6a of _0x4e8c7c){if(!_0x455e6a['id']){const _0x25c437=_0x16485f[_0x223ac8(0xf4)](_0x455e6a[_0x223ac8(0x190)]);_0x25c437&&(_0x455e6a['id']=_0x25c437);}}}export function resolveTDFolderPath(_0x3925a1,_0x5068ea,_0x33f121){if(!_0x5068ea)return _0x3925a1;if(_0x3925a1===_0x33f121||_0x3925a1['startsWith'](_0x33f121+'/'))return _0x3925a1;return _0x3925a1?_0x33f121+'/'+_0x3925a1:_0x33f121;}export function addFoldersToCreate(_0x528e4f,_0x4941f4,_0x5d292d){const _0x395a91=a152_0x525fdb;if(!_0x528e4f)return;if(_0x4941f4['has'](_0x528e4f))return;const _0x51a659=_0x528e4f[_0x395a91(0x125)]('/');let _0x769215='';for(const _0x2cf4ac of _0x51a659){_0x769215=_0x769215?_0x769215+'/'+_0x2cf4ac:_0x2cf4ac,!_0x4941f4[_0x395a91(0x162)](_0x769215)&&_0x5d292d[_0x395a91(0xc1)](_0x769215);}}export function sortFoldersByDepth(_0x477e57){const _0x11564c=a152_0x525fdb;return[..._0x477e57][_0x11564c(0x181)]((_0x3b8317,_0x531d6f)=>{const _0x3a6e67=_0x11564c,_0x17d962=(_0x3b8317[_0x3a6e67(0x11c)](/\//g)||[])[_0x3a6e67(0xfe)],_0x254768=(_0x531d6f[_0x3a6e67(0x11c)](/\//g)||[])['length'];return _0x17d962-_0x254768;});}import*as a152_0x1a922d from'yaml';import{readFileSync}from'fs';import a152_0x2423ed from'path';import{isJourneyDef,parseYamlString as a152_0xd896e,toYamlString as a152_0x859add,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(_0xaa0b7c){const _0x13b07a=a152_0x525fdb;if(Array[_0x13b07a(0xee)](_0xaa0b7c))return'['+_0xaa0b7c[_0x13b07a(0x18d)](_0xd02b49=>stableStringify(_0xd02b49))[_0x13b07a(0x163)](',')+']';if(_0xaa0b7c&&typeof _0xaa0b7c==='object'){const _0xcef41f=_0xaa0b7c,_0x4e980a=Object['keys'](_0xcef41f)[_0x13b07a(0x181)](),_0x1abde5=_0x4e980a[_0x13b07a(0x18d)](_0x4e83de=>'\x22'+_0x4e83de+'\x22:'+stableStringify(_0xcef41f[_0x4e83de]));return'{'+_0x1abde5['join'](',')+'}';}const _0x57718c=JSON[_0x13b07a(0x103)](_0xaa0b7c);return _0x57718c===undefined?_0x13b07a(0xcb):_0x57718c;}function activationSignature(_0x3addc9){const _0x49b1f4=a152_0x525fdb,_0x5528ad={'connection':_0x3addc9['connection'],..._0x3addc9['all_columns']!==undefined&&{'all_columns':_0x3addc9[_0x49b1f4(0x142)]},..._0x3addc9[_0x49b1f4(0xc3)]!==undefined&&{'columns':_0x3addc9[_0x49b1f4(0xc3)]},..._0x3addc9['behavior']!==undefined&&{'behavior':_0x3addc9['behavior']},..._0x3addc9['schedule']!==undefined&&{'schedule':_0x3addc9[_0x49b1f4(0x198)]},..._0x3addc9['notification']!==undefined&&{'notification':_0x3addc9[_0x49b1f4(0xdf)]},..._0x3addc9[_0x49b1f4(0xe5)]!==undefined&&{'connector_config':_0x3addc9[_0x49b1f4(0xe5)]},..._0x3addc9[_0x49b1f4(0x11a)]!==undefined&&{'activation_template_id':_0x3addc9['activation_template_id']}};return stableStringify(_0x5528ad);}async function fetchSegment(_0x1cc173,_0x30a5b8,_0x1c036b,_0x305f74){const _0x29737c=a152_0x525fdb,_0xafa256=_0x305f74?.[_0x29737c(0xed)](_0x18b682=>_0x18b682['id']===_0x1c036b);if(_0xafa256)return _0xafa256;try{return await _0x1cc173[_0x29737c(0xb7)][_0x29737c(0xda)](_0x30a5b8,_0x1c036b);}catch(_0x5289f4){logger[_0x29737c(0x112)]('getSegment\x20failed\x20for\x20'+_0x1c036b+_0x29737c(0xac)+_0x5289f4);try{return await _0x1cc173['segment'][_0x29737c(0xa5)](_0x1c036b);}catch(_0x2d508d){return logger['debug'](_0x29737c(0xec)+_0x1c036b+':\x20'+_0x2d508d),null;}}}function recoverSegmentIdsFromPushRecovery(_0x4e456d,_0x59b0ac,_0x2573b9){const _0x5a3132=a152_0x525fdb,_0x1ad69d=readPushRecovery(_0x4e456d[_0x5a3132(0xf0)]);if(_0x1ad69d?.[_0x5a3132(0x191)]===_0x4e456d[_0x5a3132(0xdc)]['name'])for(const [_0x339bf3,_0x24b12e]of Object[_0x5a3132(0x18a)](_0x1ad69d[_0x5a3132(0x104)])){const _0x37dfa7=generateDeterministicJourneySegmentName(_0x4e456d['yamlConfig']['name'],_0x339bf3);_0x24b12e['uniqueServerName']===_0x37dfa7&&(_0x59b0ac[_0x5a3132(0xc5)](_0x339bf3,_0x24b12e[_0x5a3132(0x114)]),_0x2573b9[_0x5a3132(0xc5)](_0x339bf3,_0x24b12e['segmentId']));}}async function createOrRecoverEmbeddedSegment(_0x165395,_0x24e802,_0x771181,_0x3e6d60){const _0x4b794e=a152_0x525fdb;let _0x11c1c8;try{_0x11c1c8=await _0x165395[_0x4b794e(0xb7)]['createJourneySegment']({'name':_0x771181[_0x4b794e(0x113)],'description':_0x771181[_0x4b794e(0x117)],'journeyId':_0x771181[_0x4b794e(0x16c)],'rule':_0x3e6d60(_0x771181['resolvedRule'],!![]),'countPopulation':!![],'parentFolderId':_0x771181[_0x4b794e(0xbc)],'audienceId':_0x771181[_0x4b794e(0x19e)]});}catch(_0x58bfc8){const _0xd0f74=_0x58bfc8 instanceof Error&&_0x58bfc8[_0x4b794e(0x153)][_0x4b794e(0x13d)]('Name\x20has\x20already\x20been\x20taken');if(_0xd0f74){const _0x91a5b=readPushRecovery(_0x24e802[_0x4b794e(0xf0)]),_0x5dc728=_0x91a5b?.[_0x4b794e(0x191)]===_0x24e802['yamlConfig']['name']?_0x91a5b[_0x4b794e(0x104)][_0x771181[_0x4b794e(0x19d)]]:undefined;if(_0x5dc728?.['uniqueServerName']===_0x771181[_0x4b794e(0x113)])await _0x165395[_0x4b794e(0xb7)][_0x4b794e(0xbe)](_0x771181['parentId'],_0x5dc728[_0x4b794e(0x114)],{'description':_0x771181['description'],'rule':_0x3e6d60(_0x771181[_0x4b794e(0xd8)],!![]),'countPopulation':!![]}),_0x11c1c8=_0x5dc728[_0x4b794e(0x114)];else throw new SDKError(ErrorCode['SEGMENT_UPDATE_ERROR'],_0x4b794e(0xbb)+_0x771181[_0x4b794e(0x19d)]+_0x4b794e(0xf2)+(_0x4b794e(0x110)+_0x24e802[_0x4b794e(0xf0)][_0x4b794e(0x121)](/([^/]+)$/,_0x4b794e(0xe2))+')\x20')+_0x4b794e(0x10c),_0x58bfc8);}else throw _0x58bfc8;}return saveSegmentToPushRecovery(_0x24e802['absolutePath'],_0x24e802[_0x4b794e(0xdc)]['name'],_0x771181[_0x4b794e(0x19d)],{'segmentId':_0x11c1c8,'uniqueServerName':_0x771181[_0x4b794e(0x113)],'createdAt':new Date()['toISOString']()}),_0x11c1c8;}export async function prepareSegmentFiles(_0x54938f,_0x2e8352,_0x1fb0ad,_0x240cbb,_0x122080){const _0x118cb6=a152_0x525fdb,{activationDefToCreateRequest:_0x51118b}=await import(_0x118cb6(0xd4)),_0x1cce3e=[],_0x1a9b4c=new Set();for(const {yamlConfig:_0x36dfb3,folderPath:_0x5f2c93,sourcePath:_0x168ae4}of _0x54938f){const _0x2bace5=resolveTDFolderPath(_0x5f2c93,_0x240cbb,_0x122080),_0x353595=_0x2bace5+':'+_0x36dfb3[_0x118cb6(0x190)],_0x52ade8=_0x2e8352[_0x118cb6(0x180)][_0x118cb6(0xf4)](_0x353595),_0xbaa474=_0x52ade8?_0x2e8352[_0x118cb6(0x182)][_0x118cb6(0xf4)](_0x52ade8['id'])||[]:[];addFoldersToCreate(_0x2bace5,_0x2e8352[_0x118cb6(0x15f)],_0x1a9b4c);const _0x22408a=calculateActivationActions(_0x36dfb3['activations']||[],_0xbaa474,_0x2e8352[_0x118cb6(0x157)],_0x2e8352[_0x118cb6(0x176)]);for(const _0x5a7b6c of _0x22408a){(_0x5a7b6c['type']==='create'||_0x5a7b6c[_0x118cb6(0x186)]===_0x118cb6(0xbf))&&_0x5a7b6c['yamlActivation']&&(_0x5a7b6c['validatedRequest']=await _0x51118b(_0x5a7b6c['yamlActivation'],_0x1fb0ad));}const _0x501ede=calculateSegmentDiff(_0x36dfb3,_0x52ade8,_0xbaa474,_0x2e8352[_0x118cb6(0x157)],_0x2e8352[_0x118cb6(0x176)]);_0x1cce3e[_0x118cb6(0xb3)]({'relativePath':_0x36dfb3[_0x118cb6(0x190)],'absolutePath':_0x168ae4,'yamlConfig':_0x36dfb3,'folderPath':_0x2bace5,'existingSegment':_0x52ade8,'existingActivations':_0xbaa474,'isNew':_0x501ede[_0x118cb6(0x17a)],'hasChanges':_0x501ede[_0x118cb6(0x166)],'diff':_0x501ede[_0x118cb6(0xeb)],'activationActions':_0x22408a});}return{'segmentFiles':_0x1cce3e,'foldersToCreate':_0x1a9b4c};}export async function prepareJourneyFiles(_0x29601c,_0x5cbbca,_0x20a66c,_0x4b8249){const _0x361aff=a152_0x525fdb,_0x26c5ca=[],_0x5d2901=new Set();for(const {yamlConfig:_0x1c31df,folderPath:_0x478868,sourcePath:_0x4d32b9}of _0x29601c){const _0x501d72=resolveTDFolderPath(_0x478868,_0x20a66c,_0x4b8249),_0x31ac80=_0x501d72+':'+_0x1c31df[_0x361aff(0x190)],_0x499761=_0x5cbbca['journeyBundlesByFolderAndName'][_0x361aff(0xf4)](_0x31ac80);let _0x117b51,_0x4993fb;if(_0x499761&&_0x499761[_0x361aff(0xfe)]>0x0){const _0x490a48=buildLocalExpandedRuleMappings(_0x1c31df),{createYamlContext:_0x75fdb8,prefetchJourneySegments:_0x36c726}=createPushYamlContextForBundle(_0x5cbbca[_0x361aff(0xfc)],_0x5cbbca['parentId'],_0x5cbbca[_0x361aff(0x12e)],_0x490a48,_0x5cbbca[_0x361aff(0x157)],_0x5cbbca[_0x361aff(0x176)],_0x5cbbca['activationStepsById'],_0x5cbbca[_0x361aff(0x18f)]);await _0x36c726(_0x499761[_0x361aff(0x18d)](_0x3d4386=>_0x3d4386['id']));const _0x364e74=await _0x5cbbca['deps'][_0x361aff(0x168)][_0x361aff(0x167)](_0x499761[0x0][_0x361aff(0x14d)]),_0x1086fc=hasMultipleVersions(_0x1c31df),_0x16dedd=async _0x2de905=>{const _0xf16127=_0x361aff,_0x412a8c=_0x5cbbca[_0xf16127(0x18f)]?.[_0xf16127(0xf4)](_0x2de905);if(_0x412a8c)return _0x412a8c;return _0x5cbbca[_0xf16127(0x139)]({'journeyId':_0x2de905,'journeyName':_0x1c31df[_0xf16127(0x190)],'isMultiVersion':_0x499761[_0xf16127(0xfe)]>0x1});};if(_0x1086fc&&_0x499761[_0x361aff(0xfe)]>0x1){const _0x2f18a5=[];for(const _0x8058a1 of _0x499761){const _0x8ace65=_0x8058a1[_0x361aff(0x184)]||0x1;_0x5cbbca[_0x361aff(0xf8)]?.['update'](_0x361aff(0xc7)+_0x1c31df[_0x361aff(0x190)]+'\x20v'+_0x8ace65);const _0x39e842=await _0x16dedd(_0x8058a1['id']),_0x3736fd=_0x75fdb8(_0x8058a1['id']),_0x29cf15=await journeyResponseToDef(_0x39e842,_0x3736fd);_0x2f18a5[_0x361aff(0xb3)]({'item':_0x8058a1,'yaml':_0x29cf15});}const _0x2e8cb6=buildLocalRuleToNameMappingFromJourney(_0x1c31df);_0x4993fb=buildMergedJourneyDef(_0x2f18a5,_0x2e8cb6,_0x364e74);const _0x303195=Math[_0x361aff(0xc0)](..._0x2f18a5[_0x361aff(0x18d)](_0x20bc5e=>_0x20bc5e[_0x361aff(0x17b)][_0x361aff(0x184)]||0x0)),_0xef1f88=_0x499761[_0x361aff(0xed)](_0x3181d2=>(_0x3181d2[_0x361aff(0x184)]||0x0)===_0x303195);_0xef1f88&&(_0x5cbbca[_0x361aff(0xf8)]?.[_0x361aff(0xbf)]('Fetching\x20'+_0x1c31df[_0x361aff(0x190)]+'\x20v'+_0x303195),_0x117b51=await _0x16dedd(_0xef1f88['id']));}else{const _0x3a1645=_0x499761[_0x499761[_0x361aff(0xfe)]-0x1];_0x5cbbca[_0x361aff(0xf8)]?.[_0x361aff(0xbf)](_0x361aff(0xc7)+_0x1c31df[_0x361aff(0x190)]),_0x117b51=await _0x16dedd(_0x3a1645['id']);const _0x47e27f=_0x75fdb8(_0x3a1645['id']),_0x5a0bd5=await journeyResponseToDef(_0x117b51,_0x47e27f),_0x5bdd8c=buildLocalRuleToNameMappingFromJourney(_0x1c31df);_0x4993fb=buildMergedJourneyDef([{'item':_0x3a1645,'yaml':_0x5a0bd5}],_0x5bdd8c,_0x364e74);}}addFoldersToCreate(_0x501d72,_0x5cbbca[_0x361aff(0x15f)],_0x5d2901);const _0x2ca8d3=calculateJourneyDiff(_0x1c31df,_0x4993fb);_0x26c5ca[_0x361aff(0xb3)]({'relativePath':_0x1c31df['name'],'absolutePath':_0x4d32b9,'yamlConfig':_0x1c31df,'folderPath':_0x501d72,'existingJourney':_0x117b51,'isNew':_0x2ca8d3[_0x361aff(0x17a)],'hasChanges':_0x2ca8d3[_0x361aff(0x166)],'diff':_0x2ca8d3[_0x361aff(0xeb)]});}return{'journeyFiles':_0x26c5ca,'foldersToCreate':_0x5d2901};}export function calculateActivationActions(_0x1cd19d,_0x4f7321,_0x21c556,_0x13860a){const _0x56b536=a152_0x525fdb,_0x102873=[],_0x4c8bdc=new Map();for(const _0x125958 of _0x4f7321){_0x4c8bdc[_0x56b536(0xc5)](_0x125958['name'],_0x125958);}const _0x5e93d6=new Map();for(const _0xcba4af of _0x1cd19d){_0x5e93d6[_0x56b536(0xc5)](_0xcba4af['name'],_0xcba4af);}for(const _0x5948ac of _0x1cd19d){const _0x2e0253=_0x4c8bdc[_0x56b536(0xf4)](_0x5948ac[_0x56b536(0x190)]);if(!_0x2e0253)_0x102873[_0x56b536(0xb3)]({'type':_0x56b536(0x127),'name':_0x5948ac[_0x56b536(0x190)],'yamlActivation':_0x5948ac});else{const _0x399581=activationResponseToDef(_0x2e0253,_0x21c556,_0x13860a),_0x5b31f3=a152_0x1a922d[_0x56b536(0x103)](_0x399581),_0x56a427=a152_0x1a922d['stringify'](_0x5948ac);_0x5b31f3!==_0x56a427&&_0x102873[_0x56b536(0xb3)]({'type':_0x56b536(0xbf),'name':_0x5948ac[_0x56b536(0x190)],'yamlActivation':_0x5948ac,'existingActivation':_0x2e0253});}}for(const _0x119e7d of _0x4f7321){!_0x5e93d6['has'](_0x119e7d[_0x56b536(0x190)])&&_0x102873[_0x56b536(0xb3)]({'type':'delete','name':_0x119e7d[_0x56b536(0x190)],'existingActivation':_0x119e7d});}return _0x102873;}function a152_0x400d(_0x467411,_0x114365){_0x467411=_0x467411-0xa5;const _0x22ad27=a152_0x22ad();let _0x400ddc=_0x22ad27[_0x467411];return _0x400ddc;}function calculateYamlDiff(_0x523cf0,_0x576195){if(_0x576195){const _0x1774f2=generateDiff(_0x576195,_0x523cf0),_0x4981b6=hasChanges(_0x1774f2);return{'isNew':![],'hasChanges':_0x4981b6,'diff':_0x4981b6?formatDiffWithColors(_0x1774f2):undefined};}const _0x3c1f31=generateDiff('',_0x523cf0);return{'isNew':!![],'hasChanges':![],'diff':formatDiffWithColors(_0x3c1f31)};}export function calculateSegmentDiff(_0x424c36,_0x39dee2,_0xe304f6,_0xeb5033,_0xea2589){const _0x52e832=segmentToYamlString(_0x424c36),_0x247ce9=_0x39dee2?segmentToYamlString(segmentWithActivationsToYaml(_0x39dee2,_0xe304f6,undefined,_0xeb5033,_0xea2589)):undefined;return calculateYamlDiff(_0x52e832,_0x247ce9);}export function calculateJourneyDiff(_0x43e42f,_0x2f7e1c){const _0x1262b4=normalizeJourneyDef(_0x43e42f,_0x43e42f),_0x3dd0f7=a152_0x859add(_0x1262b4),_0x158e51=_0x2f7e1c?a152_0x859add(normalizeJourneyDef(_0x2f7e1c,_0x43e42f)):undefined;return calculateYamlDiff(_0x3dd0f7,_0x158e51);}export function findSegmentsToDelete(_0x3621da,_0x3084bc,_0x5ce1ba,_0x3ed292,_0x179dea){const _0x384cd1=a152_0x525fdb,_0x15d545=new Set();for(const {yamlConfig:_0x326d36,folderPath:_0x4a91e6}of _0x3084bc){_0x15d545[_0x384cd1(0xc1)](_0x4a91e6+':'+_0x326d36['name']);}return _0x3621da[_0x384cd1(0x134)](_0x2f793f=>{const _0x140a73=_0x384cd1,_0x391584=_0x2f793f[_0x140a73(0xd5)]?_0x5ce1ba[_0x140a73(0xf4)](_0x2f793f['segmentFolderId'][_0x140a73(0x115)]())||'':'',_0x3eb8d1=_0x391584+':'+_0x2f793f['name'];if(_0x15d545['has'](_0x3eb8d1))return![];if(_0x179dea)return _0x391584===_0x3ed292||_0x391584['startsWith'](_0x3ed292+'/');return!![];});}export function findJourneysToDelete(_0x485d92,_0x3630dd,_0x597cb0,_0x4272ee,_0xe76f7){const _0x3b9b4b=a152_0x525fdb,_0xa4320b=new Set();for(const {yamlConfig:_0x14c529,folderPath:_0x15c346}of _0x3630dd){_0xa4320b[_0x3b9b4b(0xc1)](_0x15c346+':'+_0x14c529[_0x3b9b4b(0x190)]);}return _0x485d92['filter'](_0x5a4ea9=>{const _0x37af42=_0x3b9b4b,_0x49beb0=_0x5a4ea9[_0x37af42(0xbc)]?_0x597cb0[_0x37af42(0xf4)](_0x5a4ea9[_0x37af42(0xbc)])||'':'',_0x4c5d11=_0x49beb0+':'+_0x5a4ea9['journeyBundleName'];if(_0xa4320b[_0x37af42(0x162)](_0x4c5d11))return![];if(_0xe76f7)return _0x49beb0===_0x4272ee||_0x49beb0[_0x37af42(0x106)](_0x4272ee+'/');return!![];});}export function buildSegmentLookupMap(_0x5410c7,_0x3b7cae){const _0xf3356e=a152_0x525fdb,_0x51eb58=new Map();for(const _0x3ba01c of _0x5410c7){const _0x5de639=_0x3ba01c[_0xf3356e(0xd5)]?_0x3b7cae['get'](_0x3ba01c['segmentFolderId']['toString']())||'':'',_0x4fd985=_0x5de639+':'+_0x3ba01c[_0xf3356e(0x190)];_0x51eb58[_0xf3356e(0xc5)](_0x4fd985,_0x3ba01c);}return _0x51eb58;}export function buildSegmentNameToIdMap(_0x160c3f){const _0x16475b=a152_0x525fdb,_0xc8e3b3=new Map();for(const _0x34f233 of _0x160c3f){_0xc8e3b3[_0x16475b(0xc5)](_0x34f233[_0x16475b(0x190)],_0x34f233['id']);}return _0xc8e3b3;}export function buildJourneyBundleLookupMap(_0x4f0b9e,_0x3a0e9f){const _0x122dec=a152_0x525fdb,_0x67b88a=new Map();for(const _0x2d29af of _0x4f0b9e){const _0x1335bd=_0x2d29af[_0x122dec(0xbc)]?_0x3a0e9f[_0x122dec(0xf4)](_0x2d29af['folderId'])||'':'',_0x125a94=_0x1335bd+':'+_0x2d29af[_0x122dec(0x183)];!_0x67b88a['has'](_0x125a94)&&_0x67b88a['set'](_0x125a94,[]),_0x67b88a[_0x122dec(0xf4)](_0x125a94)[_0x122dec(0xb3)](_0x2d29af);}for(const _0x34250e of _0x67b88a[_0x122dec(0xe3)]()){_0x34250e[_0x122dec(0x181)]((_0xd2c941,_0x223725)=>(_0xd2c941[_0x122dec(0x184)]||0x0)-(_0x223725['versionNumber']||0x0));}return _0x67b88a;}export function collectFoldersToCreate(_0x59ccf1,_0x29bfbc){const _0xb5d0ca=a152_0x525fdb,_0x4fb658=new Set();for(const _0x97c7 of _0x59ccf1){if(!_0x97c7)continue;if(_0x29bfbc[_0xb5d0ca(0x162)](_0x97c7))continue;const _0x26c16e=_0x97c7['split']('/');let _0x3fd2f3='';for(const _0x428cbc of _0x26c16e){_0x3fd2f3=_0x3fd2f3?_0x3fd2f3+'/'+_0x428cbc:_0x428cbc,!_0x29bfbc[_0xb5d0ca(0x162)](_0x3fd2f3)&&_0x4fb658[_0xb5d0ca(0xc1)](_0x3fd2f3);}}return _0x4fb658;}export function parseAndClassifyYamlFiles(_0x1d7a78,_0x50469e,_0x5822cf){const _0x2eed87=a152_0x525fdb,_0x3dc6b4=[],_0x2d60cd=[];for(const _0x430701 of _0x1d7a78){const _0x141ffd=a152_0x2423ed[_0x2eed87(0xe1)](_0x50469e,a152_0x2423ed[_0x2eed87(0x146)](_0x430701)),_0x2136d3=_0x141ffd==='.'?'':_0x141ffd[_0x2eed87(0x121)](/\\/g,'/'),_0x1522d2=readFileSync(_0x430701,_0x2eed87(0x177)),_0x516878=a152_0x1a922d[_0x2eed87(0xa6)](_0x1522d2);if(isJourneyDef(_0x516878)){const _0x21a502=a152_0xd896e(_0x1522d2);_0x2d60cd[_0x2eed87(0xb3)]({'yamlConfig':_0x21a502,'folderPath':_0x2136d3,'sourcePath':_0x430701});}else{if(!_0x5822cf?.['skipSegments']){const _0x576db5=parseSegmentYamlFile(_0x1522d2),_0x249750=normalizeChildSegmentYaml(_0x576db5);_0x3dc6b4[_0x2eed87(0xb3)]({'yamlConfig':_0x249750,'folderPath':_0x2136d3,'sourcePath':_0x430701});}}}return{'segments':_0x3dc6b4,'journeys':_0x2d60cd};}export function validateParsedFiles(_0x3f74d3,_0x43fcf5){const _0x2a118d=a152_0x525fdb,_0x28cedb=[];for(const {yamlConfig:_0x3dd09e,sourcePath:_0x366d93}of _0x3f74d3[_0x2a118d(0x104)]){const _0x27738=readFileSync(_0x366d93,'utf-8'),_0x26b9db=a152_0x1a922d[_0x2a118d(0xa7)](_0x27738),_0x192048=validateSegmentDef(_0x3dd09e,{'source':_0x27738,'document':_0x26b9db},{'skipSchema':!![]});if(!_0x192048[_0x2a118d(0xc6)]){const _0x3b25e8=a152_0x2423ed[_0x2a118d(0xe1)](_0x43fcf5,_0x366d93);_0x28cedb[_0x2a118d(0xb3)]({'filePath':_0x3b25e8,'source':_0x27738,'result':_0x192048,'isJourney':![]});}}for(const {yamlConfig:_0x199753,sourcePath:_0x322b06}of _0x3f74d3['journeys']){const _0x2bf669=readFileSync(_0x322b06,_0x2a118d(0x177)),_0x895aa2=a152_0x1a922d[_0x2a118d(0xa7)](_0x2bf669),_0x470d97=validateJourneyDef(_0x199753,{'source':_0x2bf669,'document':_0x895aa2},{'skipSchema':!![]});if(!_0x470d97[_0x2a118d(0xc6)]){const _0x11954d=a152_0x2423ed[_0x2a118d(0xe1)](_0x43fcf5,_0x322b06);_0x28cedb[_0x2a118d(0xb3)]({'filePath':_0x11954d,'source':_0x2bf669,'result':_0x470d97,'isJourney':!![]});}}return _0x28cedb;}export function formatValidationErrors(_0x258295){const _0x360c35=a152_0x525fdb,_0x49e406=[];for(const {filePath:_0x27cf28,source:_0x3c9312,result:_0x140401,isJourney:_0x43b86c}of _0x258295){const _0x5ade46=_0x43b86c?_0x360c35(0x168):'segment';_0x49e406['push']('\x0a'+_0x27cf28+'\x20('+_0x5ade46+_0x360c35(0x141)+_0x140401[_0x360c35(0x19f)][_0x360c35(0xfe)]+_0x360c35(0x10a)),_0x49e406[_0x360c35(0xb3)](formatValidationResult(_0x140401,_0x3c9312,_0x27cf28));}return _0x49e406['join']('\x0a');}export function buildLocalExpandedRuleMappings(_0x407f6f){const _0x31bee7=a152_0x525fdb,_0xdf358=new Set(),_0x390b14=new Map(),_0x5e6950=collectSegmentUsageCounts(_0x407f6f);if(_0x407f6f[_0x31bee7(0x104)])for(const [_0x156b6e,_0x3c3d6b]of Object[_0x31bee7(0x18a)](_0x407f6f[_0x31bee7(0x104)])){_0xdf358['add'](_0x156b6e);if(_0x3c3d6b[_0x31bee7(0x144)]){const _0x220d4e=yamlRuleToApi(_0x3c3d6b['rule']),_0x530897=apiRuleToYaml(_0x220d4e);_0x390b14[_0x31bee7(0xc5)](_0x156b6e,_0x530897);}}const _0x688f58=new Map();let _0x145f73=0x0;for(const [_0x4577fa,_0x35e16d]of _0x390b14){const _0x36a379=serializeExpandedRule(_0x35e16d,_0x390b14),_0x369148=_0x688f58['get'](_0x36a379)||[];_0x369148['push']({'name':_0x4577fa,'index':_0x145f73}),_0x688f58['set'](_0x36a379,_0x369148),_0x145f73++;}const _0x1c4e2b=new Map();for(const [_0x42039,_0x488a20]of _0x688f58){const _0x2587cc=_0x488a20[_0x31bee7(0xc8)]()[_0x31bee7(0x181)]((_0x5e6ae5,_0x196739)=>{const _0x27dec1=_0x31bee7,_0x5bb555=_0x5e6950['get'](_0x5e6ae5[_0x27dec1(0x190)])||0x0,_0x5723ae=_0x5e6950[_0x27dec1(0xf4)](_0x196739['name'])||0x0;if(_0x5bb555!==_0x5723ae)return _0x5723ae-_0x5bb555;return _0x5e6ae5[_0x27dec1(0x124)]-_0x196739[_0x27dec1(0x124)];})[_0x31bee7(0x18d)](_0xcab2ec=>_0xcab2ec[_0x31bee7(0x190)]),_0x51979d=[];for(const _0x4b1cfc of _0x2587cc){const _0x7cc8d4=_0x5e6950[_0x31bee7(0xf4)](_0x4b1cfc)||0x0,_0x957b6e=Math[_0x31bee7(0xc0)](_0x7cc8d4,0x1);for(let _0x3f26dc=0x0;_0x3f26dc<_0x957b6e;_0x3f26dc++){_0x51979d[_0x31bee7(0xb3)](_0x4b1cfc);}}_0x1c4e2b[_0x31bee7(0xc5)](_0x42039,_0x51979d);}return{'existingLocalSegmentNames':_0xdf358,'localSegmentRules':_0x390b14,'localExpandedRuleToNames':_0x1c4e2b};}export function createSegmentIdResolver(_0x580c6a,_0x80d369){return async _0x5cb84c=>{const _0x56a299=a152_0x400d,_0x2d0e4d=_0x580c6a[_0x56a299(0xf4)](_0x5cb84c);if(!_0x2d0e4d)throw new SDKError(ErrorCode[_0x56a299(0x1aa)],_0x56a299(0xca)+_0x5cb84c+_0x56a299(0x12b)+_0x80d369+'\x27)');return _0x2d0e4d;};}export function extractRootFolderId(_0x13206e){const _0x104507=a152_0x525fdb;return _0x13206e[_0x104507(0x1a0)]?.[_0x104507(0xab)]?.[_0x104507(0x123)]?.['id']||_0x13206e[_0x104507(0x1a0)]?.[_0x104507(0x17f)]?.[_0x104507(0x123)]?.['id'];}export function buildConnectionMaps(_0x587d19){const _0x15e2e7=a152_0x525fdb,_0x7d4204=new Map(),_0x4a3112=new Map(),_0x53c709=new Map();for(const _0x34fbae of _0x587d19){_0x7d4204['set'](_0x34fbae[_0x15e2e7(0x190)],parseInt(_0x34fbae['id'],0xa)),_0x4a3112[_0x15e2e7(0xc5)](_0x34fbae['id'],_0x34fbae[_0x15e2e7(0x190)]),_0x53c709[_0x15e2e7(0xc5)](_0x34fbae['name'],_0x34fbae[_0x15e2e7(0x186)]);}return{'nameToId':_0x7d4204,'idToName':_0x4a3112,'nameToType':_0x53c709};}export function calculatePushStats(_0x208823,_0x5b7a25,_0x45d0b8,_0x56da48,_0x2dbc19,_0x1e2ada,_0x38de2b){const _0x2205ac=a152_0x525fdb,_0x29d299=_0x208823[_0x2205ac(0x134)](_0x3a15db=>_0x3a15db[_0x2205ac(0x17a)]),_0x119ec5=_0x208823['filter'](_0x273519=>!_0x273519['isNew']&&_0x273519['hasChanges']),_0xc5d414=_0x208823[_0x2205ac(0x134)](_0x447138=>!_0x447138[_0x2205ac(0x17a)]&&!_0x447138[_0x2205ac(0x166)]),_0x14bb5a=_0x1e2ada?_0x56da48:[],_0x41667b=_0x5b7a25[_0x2205ac(0x134)](_0x1bbec3=>_0x1bbec3[_0x2205ac(0x17a)]),_0x3adf61=_0x5b7a25['filter'](_0x15bf36=>!_0x15bf36[_0x2205ac(0x17a)]&&_0x15bf36[_0x2205ac(0x166)]),_0x3f6810=_0x5b7a25[_0x2205ac(0x134)](_0x723ad=>!_0x723ad[_0x2205ac(0x17a)]&&!_0x723ad[_0x2205ac(0x166)]),_0x2e017d=_0x1e2ada?_0x2dbc19:[],_0x35e39b=_0x208823['flatMap'](_0x4cd8ca=>_0x4cd8ca[_0x2205ac(0x197)]),_0x56179d=_0x35e39b[_0x2205ac(0x134)](_0x5c7035=>_0x5c7035[_0x2205ac(0x186)]===_0x2205ac(0x127)),_0x2ec5ec=_0x35e39b[_0x2205ac(0x134)](_0x2a3414=>_0x2a3414[_0x2205ac(0x186)]===_0x2205ac(0xbf)),_0x52bed5=_0x35e39b[_0x2205ac(0x134)](_0x4040f4=>_0x4040f4[_0x2205ac(0x186)]==='delete'),_0x3effc5=Array[_0x2205ac(0xe9)](_0x45d0b8)['sort'](),_0x449d28=_0x38de2b?![]:_0x29d299[_0x2205ac(0xfe)]>0x0||_0x119ec5[_0x2205ac(0xfe)]>0x0||_0x14bb5a[_0x2205ac(0xfe)]>0x0,_0x1bc684=_0x41667b[_0x2205ac(0xfe)]>0x0||_0x3adf61['length']>0x0||_0x2e017d[_0x2205ac(0xfe)]>0x0,_0x473b3b=_0x38de2b?![]:_0x35e39b[_0x2205ac(0xfe)]>0x0,_0xc74a09=_0x3effc5[_0x2205ac(0xfe)]>0x0;return{'segments':{'new':_0x29d299,'changed':_0x119ec5,'unchanged':_0xc5d414,'toDelete':_0x14bb5a},'journeys':{'new':_0x41667b,'changed':_0x3adf61,'unchanged':_0x3f6810,'toDelete':_0x2e017d},'activations':{'all':_0x35e39b,'toCreate':_0x56179d,'toUpdate':_0x2ec5ec,'toDelete':_0x52bed5},'folders':{'toCreate':_0x3effc5},'counts':{'segments':{'new':_0x29d299['length'],'changed':_0x119ec5[_0x2205ac(0xfe)],'unchanged':_0xc5d414[_0x2205ac(0xfe)],'toDelete':_0x14bb5a[_0x2205ac(0xfe)]},'journeys':{'new':_0x41667b[_0x2205ac(0xfe)],'changed':_0x3adf61['length'],'unchanged':_0x3f6810[_0x2205ac(0xfe)],'toDelete':_0x2e017d[_0x2205ac(0xfe)]},'activations':{'create':_0x56179d[_0x2205ac(0xfe)],'update':_0x2ec5ec['length'],'delete':_0x52bed5[_0x2205ac(0xfe)]},'folders':_0x3effc5['length']},'hasChanges':_0x449d28||_0x1bc684||_0x473b3b||_0xc74a09};}export async function buildPushExecutionContext(_0x5754d9,_0x6a51b4,_0x135868,_0x3a53f3,_0x155920,_0x4d53fa){const _0x1f7bb5=a152_0x525fdb,_0x49efa3=extractRootFolderId(_0x135868),{pathToId:_0x3e9e6d,idToPath:_0x152699}=buildFolderMaps(_0x155920),_0x51909c=buildSegmentNameToIdMap(_0x3a53f3),_0x4ffa4=new Map(),{batchAsync:_0x5b17b2}=await import('../../utils/async.js'),[_0x3c572b,_0x5db74c]=await Promise[_0x1f7bb5(0xb2)]([_0x5754d9['user'][_0x1f7bb5(0x147)](),_0x5754d9[_0x1f7bb5(0x159)][_0x1f7bb5(0x15a)](),((async()=>{const _0x148165=_0x1f7bb5;!_0x4d53fa&&_0x3a53f3[_0x148165(0xfe)]>0x0&&await _0x5b17b2(_0x3a53f3,async _0x38d285=>{const _0x2ef60d=await _0x5754d9['segment']['listActivations'](_0x6a51b4,_0x38d285['id']);_0x4ffa4['set'](_0x38d285['id'],_0x2ef60d);});})())]),{emailToId:_0x2f285f,idToEmail:_0x428482}=_0x3c572b,_0x428dda=buildConnectionMaps(_0x5db74c);return{'rootFolderId':_0x49efa3,'folderPathToId':_0x3e9e6d,'folderIdToPath':_0x152699,'segmentNameToId':_0x51909c,'activationsBySegmentId':_0x4ffa4,'emailToIdMap':_0x2f285f,'idToEmailMap':_0x428482,'connectionNameToIdMap':_0x428dda[_0x1f7bb5(0xf9)],'connectionIdToNameMap':_0x428dda[_0x1f7bb5(0xb1)],'connectionNameToTypeMap':_0x428dda[_0x1f7bb5(0x164)]};}export function createPushYamlContextForBundle(_0x34ce8d,_0x4f51f3,_0x2915d7,_0x48265,_0x5541d3,_0x485aeb,_0x3a4005,_0x5b7221){const {existingLocalSegmentNames:_0x4c3a40,localExpandedRuleToNames:_0x34c2c2}=_0x48265,_0x2e3872=new Set(),_0x1a7215=new Map(),_0x230f42=new Map(),_0x3bf967=new Map(),_0x469ba3=createJumpTargetCache(),_0x4f4d9b=new Map(),_0x20d7a0=new Map(),_0x7123cd=new Set();let _0x562047;const _0x379173=_0x3c1c8d=>{const _0x3b039e={'resolveSegment':async _0x359413=>{const _0xa15f82=a152_0x400d,_0x5932ba=_0x3bf967[_0xa15f82(0xf4)](_0x359413);if(_0x5932ba!==undefined)return{'name':_0x5932ba,'isJourneyLocal':!![]};try{const _0x5d80fa=await fetchSegment(_0x34ce8d,_0x4f51f3,_0x359413,_0x2915d7);if(!_0x5d80fa)throw new Error(_0xa15f82(0x12c));const _0x362b19=generateJourneyLocalName(_0x5d80fa[_0xa15f82(0x190)]),_0x2140d9=_0x5d80fa[_0xa15f82(0xa9)]===SEGMENT_KIND_JOURNEY&&_0x362b19!==undefined;let _0x51309f=_0x5d80fa[_0xa15f82(0x190)],_0x42a583;if(_0x2140d9&&_0x5d80fa['rule']){const _0x1c95c1=apiRuleToYaml(_0x5d80fa[_0xa15f82(0x144)]);_0x20d7a0['set'](_0x359413,_0x1c95c1);const _0x287467=async _0x16c5db=>{const _0x23951c=_0xa15f82,_0x5e7b3d=collectSegmentRefsFromRule(_0x16c5db);for(const _0x49443b of _0x5e7b3d){if(!_0x20d7a0[_0x23951c(0x162)](_0x49443b))try{const _0x206d4b=await fetchSegment(_0x34ce8d,_0x4f51f3,_0x49443b,_0x2915d7);if(_0x206d4b?.[_0x23951c(0x144)]){const _0x587430=apiRuleToYaml(_0x206d4b[_0x23951c(0x144)]);_0x20d7a0[_0x23951c(0xc5)](_0x49443b,_0x587430),await _0x287467(_0x587430);}}catch(_0x5bd314){logger['debug'](_0x23951c(0x102)+_0x49443b+':\x20'+_0x5bd314);}}};await _0x287467(_0x1c95c1);const _0x96ceb4=serializeExpandedRule(_0x1c95c1,_0x20d7a0),_0x47a7db=_0x34c2c2[_0xa15f82(0xf4)](_0x96ceb4);if(_0x47a7db&&_0x47a7db['length']>0x0){const _0x3d39e4=_0x1a7215[_0xa15f82(0xf4)](_0x96ceb4)||0x0,_0x333eb6=_0x47a7db[_0x3d39e4]||_0x47a7db[_0x47a7db[_0xa15f82(0xfe)]-0x1];_0x1a7215['set'](_0x96ceb4,_0x3d39e4+0x1),_0x51309f=_0x333eb6,_0x2e3872[_0xa15f82(0xc1)](_0x51309f),_0x3bf967[_0xa15f82(0xc5)](_0x359413,_0x51309f);const _0x1540fc=await resolveRuleSegmentRefs(_0x1c95c1,async _0x55d3aa=>{const _0x1034bb=_0xa15f82,_0x344921=_0x3bf967[_0x1034bb(0xf4)](_0x55d3aa);if(_0x344921)return _0x344921;const _0x29a495=await _0x562047['resolveSegment'](_0x55d3aa);return _0x29a495[_0x1034bb(0x190)];});_0x42a583={'description':_0x5d80fa['description'],'rule':_0x1540fc};}else{const _0x3974fb=_0x4f4d9b['get'](_0x96ceb4);if(_0x3974fb)_0x51309f=_0x3974fb,_0x3bf967[_0xa15f82(0xc5)](_0x359413,_0x51309f);else{if(_0x362b19){let _0x4a4405=_0x362b19,_0x22a3ee=0x2;while(_0x2e3872[_0xa15f82(0x162)](_0x4a4405)||_0x4c3a40[_0xa15f82(0x162)](_0x4a4405)){_0x4a4405=_0x362b19+'_'+_0x22a3ee,_0x22a3ee++;}_0x2e3872[_0xa15f82(0xc1)](_0x4a4405),_0x51309f=_0x4a4405;}_0x3bf967[_0xa15f82(0xc5)](_0x359413,_0x51309f),_0x4f4d9b[_0xa15f82(0xc5)](_0x96ceb4,_0x51309f);const _0x55cb2b=await resolveRuleSegmentRefs(_0x1c95c1,async _0x6bc220=>{const _0x1b0216=_0xa15f82,_0x3709a9=_0x3bf967['get'](_0x6bc220);if(_0x3709a9)return _0x3709a9;const _0x2015a8=await _0x562047[_0x1b0216(0x101)](_0x6bc220);return _0x2015a8[_0x1b0216(0x190)];});_0x42a583={'description':_0x5d80fa[_0xa15f82(0x117)],'rule':_0x55cb2b};}}}return{'name':_0x51309f,'isJourneyLocal':_0x2140d9,'definition':_0x42a583};}catch(_0x3cb70e){return logger['debug'](_0xa15f82(0x13a)+_0x359413+':\x20'+_0x3cb70e),{'name':_0x359413,'isJourneyLocal':![]};}},'resolveActivation':async _0x5a3bcd=>{const _0x31806c=a152_0x400d,_0x1eac16=_0x230f42['get'](_0x5a3bcd);if(_0x1eac16!==undefined)return{'name':_0x1eac16,'isJourneyLocal':!![]};try{let _0x45c97b=_0x3a4005?.[_0x31806c(0xf4)](_0x5a3bcd);!_0x45c97b&&(_0x45c97b=await _0x34ce8d['journey'][_0x31806c(0x14a)](_0x3c1c8d,_0x5a3bcd));const _0x5e5d38=_0x45c97b['attributes'][_0x31806c(0x16e)][_0x31806c(0x190)]||_0x5a3bcd,_0x3dd496=sanitizeYamlKey(_0x5e5d38)||_0x31806c(0x14b)+_0x5a3bcd,_0x34d565=_0x3dd496;_0x230f42[_0x31806c(0xc5)](_0x5a3bcd,_0x34d565);const _0x14dd1e=journeyActivationStepToYaml(_0x45c97b,_0x5541d3,_0x485aeb);return{'name':_0x34d565,'isJourneyLocal':!![],'definition':_0x14dd1e};}catch(_0x22ce73){return logger[_0x31806c(0x112)](_0x31806c(0xae)+_0x5a3bcd+':\x20'+_0x22ce73),{'name':_0x5a3bcd,'isJourneyLocal':![]};}},'resolveJumpTarget':(_0xf6db73,_0x2659f9)=>resolveJumpTarget(_0xf6db73,_0x2659f9,_0x469ba3,async _0x534cd3=>{const _0x3beb3d=a152_0x400d,_0x55562e=_0x5b7221?.['get'](_0x534cd3);if(_0x55562e)return _0x55562e;return _0x34ce8d[_0x3beb3d(0x168)]['getJourney'](_0x534cd3);})};return _0x562047=_0x3b039e,_0x3b039e;},_0x4f47ff=async _0x57c2cc=>{const _0x468db4=a152_0x400d,{collectSegmentIdsFromJourneyApi:_0x4507b0}=await import(_0x468db4(0x178)),{batchAsync:_0x29652f}=await import(_0x468db4(0x10f)),_0x38faab=new Set();for(const _0x331d07 of _0x57c2cc){let _0x5b8adf=_0x5b7221?.[_0x468db4(0xf4)](_0x331d07);!_0x5b8adf&&(_0x5b8adf=await _0x34ce8d[_0x468db4(0x168)][_0x468db4(0x11b)](_0x331d07));const _0x1147e5=_0x4507b0(_0x5b8adf);for(const _0x310ff2 of _0x1147e5){_0x38faab[_0x468db4(0xc1)](_0x310ff2);}}let _0x48f5ef=Array[_0x468db4(0xe9)](_0x38faab);while(_0x48f5ef[_0x468db4(0xfe)]>0x0){const _0xf0d1fd=_0x48f5ef[_0x468db4(0x134)](_0xe86eb6=>!_0x7123cd[_0x468db4(0x162)](_0xe86eb6));if(_0xf0d1fd[_0x468db4(0xfe)]===0x0)break;const _0x4cc079=await _0x29652f(_0xf0d1fd,async _0xd5e87=>{const _0x57edf4=_0x468db4;_0x7123cd[_0x57edf4(0xc1)](_0xd5e87);const _0x4fadd8=await fetchSegment(_0x34ce8d,_0x4f51f3,_0xd5e87,_0x2915d7);if(!_0x4fadd8)return null;return{'segmentId':_0xd5e87,'segment':_0x4fadd8};},0xa),_0x4b34c7=new Set();for(const _0x540399 of _0x4cc079){if(!_0x540399?.[_0x468db4(0xb7)]?.['rule'])continue;const _0x2153f8=apiRuleToYaml(_0x540399['segment'][_0x468db4(0x144)]);_0x20d7a0[_0x468db4(0xc5)](_0x540399[_0x468db4(0x114)],_0x2153f8);const _0xf67c73=collectSegmentRefsFromRule(_0x2153f8);for(const _0x1e3fda of _0xf67c73){!_0x7123cd[_0x468db4(0x162)](_0x1e3fda)&&_0x4b34c7['add'](_0x1e3fda);}}_0x48f5ef=Array['from'](_0x4b34c7);}};return{'createYamlContext':_0x379173,'prefetchJourneySegments':_0x4f47ff};}export async function executePushSegments(_0x1c83c0,_0x292277,_0x5b3246,_0x1d6cd7,_0x113c80){const _0x2cfc76=a152_0x525fdb,{segmentDefToCreateRequest:_0x356fa7,segmentDefToUpdateRequest:_0x3a8411}=await import(_0x2cfc76(0xd4)),_0x59ce29=_0x5b3246[_0x2cfc76(0x15f)],_0xd62f96=0x5,_0x580374=async _0x1359c9=>{const _0x1328c1=_0x2cfc76,_0x15d8c2=_0x1359c9['folderPath']?_0x59ce29['get'](_0x1359c9[_0x1328c1(0x116)]):undefined;let _0x80843f;const _0x20aa1={'created':0x0,'updated':0x0,'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};let _0x30ff27=_0x1359c9[_0x1328c1(0xdc)];if(_0x1359c9['yamlConfig']['rule']){const _0x45726f=createSegmentIdResolver(_0x5b3246['segmentNameToId'],_0x1359c9[_0x1328c1(0xdc)]['name']),_0x1bbacc=await resolveRuleSegmentIds(_0x1359c9[_0x1328c1(0xdc)][_0x1328c1(0x144)],_0x45726f);_0x30ff27={..._0x1359c9[_0x1328c1(0xdc)],'rule':_0x1bbacc};}try{if(_0x1359c9[_0x1328c1(0x17a)]){_0x113c80[_0x1328c1(0xe8)]?.({'type':_0x1328c1(0x13c),'name':_0x1359c9[_0x1328c1(0xdc)][_0x1328c1(0x190)]});const _0x25eced=_0x356fa7(_0x30ff27,_0x15d8c2),_0x34e67f=await _0x113c80[_0x1328c1(0xaa)](_0x1328c1(0x188)+_0x1359c9[_0x1328c1(0xdc)][_0x1328c1(0x190)]+'\x27...',()=>_0x1c83c0[_0x1328c1(0xb7)][_0x1328c1(0x131)](_0x1d6cd7[_0x1328c1(0x19e)],_0x25eced));_0x80843f=_0x34e67f[_0x1328c1(0x123)]['id'],_0x5b3246[_0x1328c1(0x1a9)][_0x1328c1(0xc5)](_0x1359c9['yamlConfig'][_0x1328c1(0x190)],_0x80843f),_0x20aa1['createdSegmentId']={'name':_0x1359c9['yamlConfig']['name'],'id':_0x80843f},_0x113c80[_0x1328c1(0xe8)]?.({'type':_0x1328c1(0x111),'name':_0x1359c9[_0x1328c1(0xdc)][_0x1328c1(0x190)],'segmentId':_0x80843f}),_0x113c80['logSuccess']?.(_0x1328c1(0x105)+_0x1359c9['yamlConfig'][_0x1328c1(0x190)]+'\x27'),_0x20aa1['created']=0x1;}else{if(_0x1359c9['hasChanges']){_0x113c80[_0x1328c1(0xe8)]?.({'type':'segment_updating','name':_0x1359c9['yamlConfig']['name']});const _0x1b1e1=_0x3a8411(_0x30ff27);_0x15d8c2!==_0x1359c9[_0x1328c1(0x172)]?.['segmentFolderId']&&(_0x1b1e1['segmentFolderId']=_0x15d8c2?parseInt(_0x15d8c2,0xa):undefined),await _0x113c80['withProgress']('Updating\x20segment\x20\x27'+_0x1359c9[_0x1328c1(0xdc)][_0x1328c1(0x190)]+_0x1328c1(0x170),()=>_0x1c83c0[_0x1328c1(0xb7)]['updateSegmentById'](_0x1d6cd7[_0x1328c1(0x19e)],_0x1359c9[_0x1328c1(0x172)]['id'],_0x1b1e1)),_0x80843f=_0x1359c9[_0x1328c1(0x172)]['id'],_0x113c80[_0x1328c1(0xe8)]?.({'type':_0x1328c1(0x126),'name':_0x1359c9[_0x1328c1(0xdc)][_0x1328c1(0x190)]}),_0x113c80[_0x1328c1(0x140)]?.(_0x1328c1(0x10d)+_0x1359c9[_0x1328c1(0xdc)]['name']+'\x27'),_0x20aa1[_0x1328c1(0x120)]=0x1;}else _0x80843f=_0x1359c9[_0x1328c1(0x172)]['id'];}}catch(_0x4723da){const _0x13eeaa=isHttp400Error(_0x4723da),_0x556daa=_0x13eeaa?ErrorCode['SEGMENT_SYNTAX_ERROR']:ErrorCode[_0x1328c1(0xd9)],_0x3a30e5=getErrorMessage(_0x4723da);throw new SDKError(_0x556daa,_0x1328c1(0xea)+(_0x1359c9['isNew']?_0x1328c1(0x127):_0x1328c1(0xbf))+_0x1328c1(0xf7)+_0x1359c9[_0x1328c1(0xf0)]+_0x1328c1(0x107)+_0x3a30e5,_0x4723da);}try{const _0x50012d=await syncActivationsForSegment(_0x1c83c0,_0x1d6cd7[_0x1328c1(0x19e)],_0x80843f,_0x1359c9[_0x1328c1(0xdc)][_0x1328c1(0x190)],_0x1359c9[_0x1328c1(0x197)],_0x113c80,_0x1359c9[_0x1328c1(0xf0)]);_0x20aa1[_0x1328c1(0xe0)]=_0x50012d;}catch(_0x5a01d7){if(_0x5a01d7 instanceof SDKError)throw _0x5a01d7;throw new SDKError(ErrorCode[_0x1328c1(0x136)],_0x1328c1(0x1a7)+_0x1359c9[_0x1328c1(0xdc)][_0x1328c1(0x190)]+'\x27\x20from\x20file:\x20'+_0x1359c9[_0x1328c1(0xf0)]+_0x1328c1(0x107)+getErrorMessage(_0x5a01d7),_0x5a01d7);}return _0x20aa1;},_0x44e9df=await batchAsync(_0x292277,_0x580374,_0xd62f96),_0x3f9a77={'created':0x0,'updated':0x0,'deleted':0x0,'createdSegmentIds':new Map(),'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};for(const _0x4e2e42 of _0x44e9df){_0x3f9a77[_0x2cfc76(0x12a)]+=_0x4e2e42[_0x2cfc76(0x12a)],_0x3f9a77['updated']+=_0x4e2e42[_0x2cfc76(0x120)],_0x4e2e42[_0x2cfc76(0x189)]&&_0x3f9a77['createdSegmentIds'][_0x2cfc76(0xc5)](_0x4e2e42['createdSegmentId'][_0x2cfc76(0x190)],_0x4e2e42['createdSegmentId']['id']),_0x3f9a77['activations'][_0x2cfc76(0x12a)]+=_0x4e2e42['activations'][_0x2cfc76(0x12a)],_0x3f9a77[_0x2cfc76(0xe0)][_0x2cfc76(0x120)]+=_0x4e2e42['activations'][_0x2cfc76(0x120)],_0x3f9a77[_0x2cfc76(0xe0)][_0x2cfc76(0x199)]+=_0x4e2e42['activations'][_0x2cfc76(0x199)];}return _0x3f9a77;}async function syncActivationsForSegment(_0x35150e,_0x288232,_0x36e2d9,_0x1faeec,_0xcd0890,_0x2623a7,_0x239b57){const _0x419b2b=a152_0x525fdb,_0x209e44={'created':0x0,'updated':0x0,'deleted':0x0};for(const _0x55e76c of _0xcd0890){try{if(_0x55e76c[_0x419b2b(0x186)]===_0x419b2b(0x127)&&_0x55e76c[_0x419b2b(0xfd)])_0x2623a7[_0x419b2b(0xe8)]?.({'type':_0x419b2b(0x1a3),'segmentName':_0x1faeec,'activationName':_0x55e76c[_0x419b2b(0x190)]}),await _0x2623a7[_0x419b2b(0xaa)](_0x419b2b(0x14e)+_0x55e76c[_0x419b2b(0x190)]+'\x27...',()=>_0x35150e['segment'][_0x419b2b(0x185)](_0x288232,_0x36e2d9,_0x55e76c['validatedRequest'])),_0x2623a7[_0x419b2b(0xe8)]?.({'type':'activation_created','segmentName':_0x1faeec,'activationName':_0x55e76c[_0x419b2b(0x190)]}),_0x2623a7['logSuccess']?.(_0x419b2b(0xba)+_0x55e76c[_0x419b2b(0x190)]+'\x27'),_0x209e44[_0x419b2b(0x12a)]++;else{if(_0x55e76c[_0x419b2b(0x186)]===_0x419b2b(0xbf)&&_0x55e76c[_0x419b2b(0xfd)]&&_0x55e76c['existingActivation'])_0x2623a7['onProgress']?.({'type':_0x419b2b(0xb9),'segmentName':_0x1faeec,'activationName':_0x55e76c[_0x419b2b(0x190)]}),await _0x2623a7[_0x419b2b(0xaa)]('Updating\x20activation\x20\x27'+_0x55e76c[_0x419b2b(0x190)]+'\x27...',()=>_0x35150e[_0x419b2b(0xb7)][_0x419b2b(0xaf)](_0x288232,_0x36e2d9,_0x55e76c[_0x419b2b(0x17e)]['id'],_0x55e76c['validatedRequest'])),_0x2623a7['onProgress']?.({'type':_0x419b2b(0x1a1),'segmentName':_0x1faeec,'activationName':_0x55e76c[_0x419b2b(0x190)]}),_0x2623a7[_0x419b2b(0x140)]?.(_0x419b2b(0x129)+_0x55e76c[_0x419b2b(0x190)]+'\x27'),_0x209e44['updated']++;else _0x55e76c['type']==='delete'&&_0x55e76c[_0x419b2b(0x17e)]&&(_0x2623a7[_0x419b2b(0xe8)]?.({'type':_0x419b2b(0x143),'segmentName':_0x1faeec,'activationName':_0x55e76c[_0x419b2b(0x190)]}),await _0x2623a7['withProgress'](_0x419b2b(0xdb)+_0x55e76c['name']+_0x419b2b(0x170),()=>_0x35150e[_0x419b2b(0xb7)]['deleteActivation'](_0x288232,_0x36e2d9,_0x55e76c['existingActivation']['id'])),_0x2623a7[_0x419b2b(0xe8)]?.({'type':'activation_deleted','segmentName':_0x1faeec,'activationName':_0x55e76c[_0x419b2b(0x190)]}),_0x2623a7[_0x419b2b(0x187)]?.(_0x419b2b(0xdd)+_0x55e76c['name']+'\x27'),_0x209e44['deleted']++);}}catch(_0x1bd3b3){const _0x52cb67=isHttp400Error(_0x1bd3b3),_0x2eaf6c=_0x52cb67?ErrorCode[_0x419b2b(0x174)]:ErrorCode[_0x419b2b(0x136)],_0x402ecb=getErrorMessage(_0x1bd3b3);throw new SDKError(_0x2eaf6c,_0x419b2b(0xea)+_0x55e76c[_0x419b2b(0x186)]+_0x419b2b(0x149)+_0x55e76c[_0x419b2b(0x190)]+_0x419b2b(0x19c)+_0x239b57+_0x419b2b(0x107)+_0x402ecb,_0x1bd3b3);}}return _0x209e44;}export async function executePushFolders(_0x1b028a,_0x496341,_0xb73fb7,_0x24f296,_0x50884e){const _0x4ef1de=a152_0x525fdb,_0x3c9611=new Map(_0xb73fb7),_0x4cc7bf=sortFoldersByDepth(_0x496341);for(const _0x5864f9 of _0x4cc7bf){const _0x1047db=_0x5864f9[_0x4ef1de(0x125)]('/'),_0x4c88bb=_0x1047db[_0x1047db[_0x4ef1de(0xfe)]-0x1],_0x386b32=_0x1047db[_0x4ef1de(0xc8)](0x0,-0x1)['join']('/'),_0x5862c7=_0x3c9611[_0x4ef1de(0xf4)](_0x386b32);_0x50884e[_0x4ef1de(0xe8)]?.({'type':_0x4ef1de(0x1ac),'folder':_0x5864f9});const _0x2920e9={'name':_0x4c88bb,'parentFolderId':_0x5862c7},_0x1ac0f1=await _0x50884e[_0x4ef1de(0xaa)](_0x4ef1de(0xce)+_0x5864f9+_0x4ef1de(0x170),()=>_0x1b028a[_0x4ef1de(0xb7)][_0x4ef1de(0xf1)](_0x24f296[_0x4ef1de(0x19e)],_0x2920e9));_0x3c9611[_0x4ef1de(0xc5)](_0x5864f9,_0x1ac0f1[_0x4ef1de(0x123)]['id']),_0x50884e[_0x4ef1de(0xe8)]?.({'type':'folder_created','folder':_0x5864f9,'folderId':_0x1ac0f1[_0x4ef1de(0x123)]['id']}),_0x50884e[_0x4ef1de(0xbd)]?.(_0x4ef1de(0x137)+_0x5864f9+'\x27');}return _0x3c9611;}export async function executePushSegmentDeletions(_0x53ca3b,_0x73dcd1,_0x4c2f8e){const _0x1ba601=a152_0x525fdb;if(_0x73dcd1[_0x1ba601(0xfe)]===0x0)return 0x0;const {batchAsync:_0x1b6296}=await import(_0x1ba601(0x10f)),_0x43c4cf=0x5,_0x829ec5=await _0x1b6296(_0x73dcd1,async _0x15f059=>{const _0x3368c9=_0x1ba601;return _0x4c2f8e[_0x3368c9(0xe8)]?.({'type':_0x3368c9(0x150),'name':_0x15f059[_0x3368c9(0x190)]}),await _0x53ca3b[_0x3368c9(0xb7)]['deleteSegment'](_0x15f059['id']),_0x4c2f8e[_0x3368c9(0xe8)]?.({'type':_0x3368c9(0x14f),'name':_0x15f059[_0x3368c9(0x190)]}),_0x4c2f8e[_0x3368c9(0x187)]?.(_0x3368c9(0xc4)+_0x15f059['name']+'\x27'),0x1;},_0x43c4cf);return _0x829ec5[_0x1ba601(0x16a)]((_0x65f2a9,_0x4cb31b)=>_0x65f2a9+_0x4cb31b,0x0);}export async function executePushJourneys(_0xf118f8,_0x16e824,_0x2a5858,_0x5ba602,_0x123ad5){const _0x242e6b=a152_0x525fdb,{journeyDefToRequest:_0x2730d9}=await import('./journey-yaml.js'),{activationDefToCreateRequest:_0x15ac92,yamlRuleToApi:_0x3efd62,validateSegmentRule:_0x5e827c}=await import(_0x242e6b(0xd4)),_0xba8deb={'results':[],'created':0x0,'updated':0x0,'embeddedSegmentNameToId':new Map()},_0x3e6119=new Map(_0x2a5858[_0x242e6b(0x1a9)]),_0x1a8c17=0x5;for(let _0x1a6530=0x0;_0x1a6530<_0x16e824[_0x242e6b(0xfe)];_0x1a6530+=_0x1a8c17){const _0x3b6e4f=_0x16e824[_0x242e6b(0xc8)](_0x1a6530,_0x1a6530+_0x1a8c17),_0x175c68=await Promise[_0x242e6b(0xb2)](_0x3b6e4f[_0x242e6b(0x18d)](async _0x1aff24=>{const _0x4bb4cb=_0x242e6b;if(!_0x1aff24[_0x4bb4cb(0x17a)]&&!_0x1aff24[_0x4bb4cb(0x166)])return{'action':_0x4bb4cb(0xcd),'name':_0x1aff24[_0x4bb4cb(0xdc)][_0x4bb4cb(0x190)],'journeyId':_0x1aff24[_0x4bb4cb(0x10e)]?.['id']};const _0x1169c0=_0x1aff24[_0x4bb4cb(0x116)]?_0x2a5858[_0x4bb4cb(0x15f)][_0x4bb4cb(0xf4)](_0x1aff24[_0x4bb4cb(0x116)]):undefined;_0x123ad5[_0x4bb4cb(0xe8)]?.({'type':_0x1aff24[_0x4bb4cb(0x17a)]?_0x4bb4cb(0x15d):_0x4bb4cb(0x130),'name':_0x1aff24[_0x4bb4cb(0xdc)][_0x4bb4cb(0x190)]});try{const _0x288b12=await executeSingleJourneyPush(_0xf118f8,_0x1aff24,{..._0x2a5858,'segmentNameToId':_0x3e6119},{'parentId':_0x5ba602['parentId'],'rootFolderId':_0x5ba602[_0x4bb4cb(0xf5)],'folderId':_0x1169c0,'verbose':_0x5ba602[_0x4bb4cb(0x13f)]},_0x123ad5,{'journeyDefToRequest':_0x2730d9,'activationDefToCreateRequest':_0x15ac92,'yamlRuleToApi':_0x3efd62,'validateSegmentRule':_0x5e827c});for(const [_0x47293a,_0xa96ec6]of _0x288b12[_0x4bb4cb(0xf6)]){_0x3e6119[_0x4bb4cb(0xc5)](_0x47293a,_0xa96ec6),_0xba8deb['embeddedSegmentNameToId'][_0x4bb4cb(0xc5)](_0x47293a,_0xa96ec6);}if(_0x288b12[_0x4bb4cb(0x173)]==='created')_0x123ad5[_0x4bb4cb(0xe8)]?.({'type':'journey_created','name':_0x1aff24[_0x4bb4cb(0xdc)][_0x4bb4cb(0x190)],'journeyId':_0x288b12[_0x4bb4cb(0x16c)]}),_0x123ad5[_0x4bb4cb(0x140)]?.(_0x4bb4cb(0xc2)+_0x1aff24[_0x4bb4cb(0xdc)][_0x4bb4cb(0x190)]+'\x27'),_0xba8deb[_0x4bb4cb(0x12a)]++;else _0x288b12['action']===_0x4bb4cb(0x120)&&(_0x123ad5[_0x4bb4cb(0xe8)]?.({'type':_0x4bb4cb(0xc9),'name':_0x1aff24[_0x4bb4cb(0xdc)]['name']}),_0x123ad5['logSuccess']?.(_0x4bb4cb(0x17d)+_0x1aff24[_0x4bb4cb(0xdc)][_0x4bb4cb(0x190)]+'\x27'),_0xba8deb[_0x4bb4cb(0x120)]++);return{'action':_0x288b12[_0x4bb4cb(0x173)],'name':_0x1aff24[_0x4bb4cb(0xdc)][_0x4bb4cb(0x190)],'journeyId':_0x288b12[_0x4bb4cb(0x16c)]};}catch(_0xea3a5e){const _0x4e810c=isHttp400Error(_0xea3a5e),_0x4efee9=_0x4e810c?ErrorCode[_0x4bb4cb(0xb5)]:ErrorCode[_0x4bb4cb(0xb4)],_0x3fcbfb=getErrorMessage(_0xea3a5e);throw new SDKError(_0x4efee9,_0x4bb4cb(0xea)+(_0x1aff24[_0x4bb4cb(0x17a)]?'create':'update')+'\x20journey\x20from\x20file:\x20'+_0x1aff24[_0x4bb4cb(0xf0)]+_0x4bb4cb(0x107)+_0x3fcbfb,_0xea3a5e);}}));_0xba8deb[_0x242e6b(0x11f)][_0x242e6b(0xb3)](..._0x175c68);}return _0xba8deb;}async function matchExistingJourneySegments(_0x3a876f,_0x4c4b81,_0x75f9a4,_0x1c2298,_0x15c054){const _0x71de6e=a152_0x525fdb;if(!_0x4c4b81[_0x71de6e(0x10e)]||!_0x4c4b81[_0x71de6e(0xdc)][_0x71de6e(0x104)])return;const _0x5c489b=new Map(),_0x51e8d8=new Set();for(const _0x48f1c0 of Object[_0x71de6e(0x17c)](_0x4c4b81[_0x71de6e(0xdc)]['segments'])){const _0x3620b1=generateDeterministicJourneySegmentName(_0x4c4b81['yamlConfig'][_0x71de6e(0x190)],_0x48f1c0);_0x5c489b['set'](_0x3620b1,_0x48f1c0),_0x51e8d8[_0x71de6e(0xc1)](_0x48f1c0);}const _0x5a8d8d=[],_0x2d564f=collectSegmentIdsFromJourneyApi(_0x4c4b81['existingJourney']);for(const _0x120d08 of _0x2d564f){const _0xf27583=await fetchSegment(_0x3a876f,_0x75f9a4,_0x120d08,_0x1c2298);if(!_0xf27583?.[_0x71de6e(0x190)])continue;const _0x49a4be=_0x5c489b[_0x71de6e(0xf4)](_0xf27583[_0x71de6e(0x190)]);_0x49a4be?(_0x15c054[_0x71de6e(0xc5)](_0x49a4be,_0x120d08),_0x51e8d8[_0x71de6e(0x11d)](_0x49a4be)):_0x5a8d8d[_0x71de6e(0xb3)]({'id':_0x120d08,'seg':_0xf27583});}if(_0x51e8d8['size']>0x0&&_0x5a8d8d['length']>0x0){const {localExpandedRuleToNames:_0x4a2724}=buildLocalExpandedRuleMappings(_0x4c4b81[_0x71de6e(0xdc)]),_0x11f5f6=new Map();for(const {id:_0x56cb3a,seg:_0x24bde3}of _0x5a8d8d){if(_0x24bde3[_0x71de6e(0x144)]){const _0x30989c=apiRuleToYaml(_0x24bde3[_0x71de6e(0x144)]);_0x11f5f6[_0x71de6e(0xc5)](_0x56cb3a,_0x30989c);}}for(const {id:_0x29dda4,seg:_0x568598}of _0x5a8d8d){if(!_0x568598['rule'])continue;const _0x9cde08=_0x11f5f6[_0x71de6e(0xf4)](_0x29dda4);if(!_0x9cde08)continue;const _0xe0a51b=serializeExpandedRule(_0x9cde08,_0x11f5f6),_0x4675a9=_0x4a2724['get'](_0xe0a51b);if(_0x4675a9){const _0x1c55ab=_0x4675a9[_0x71de6e(0xed)](_0x3faae8=>_0x51e8d8[_0x71de6e(0x162)](_0x3faae8));_0x1c55ab&&(_0x15c054[_0x71de6e(0xc5)](_0x1c55ab,_0x29dda4),_0x51e8d8[_0x71de6e(0x11d)](_0x1c55ab),logger[_0x71de6e(0x112)](_0x71de6e(0x155)+_0x568598['name']+_0x71de6e(0x13b)+_0x1c55ab+_0x71de6e(0xef)));}}}}async function executeSingleJourneyPush(_0x5903f6,_0x467548,_0x15d346,_0x129050,_0x16052f,_0x1d8c4e){const _0x469f8a=a152_0x525fdb,{journeyDefToRequest:_0x318c12,activationDefToCreateRequest:_0x28e070,yamlRuleToApi:_0x54eb55,validateSegmentRule:_0x2108a7}=_0x1d8c4e,_0x516741=new Map(),_0x5620f8=new Map();recoverSegmentIdsFromPushRecovery(_0x467548,_0x516741,_0x15d346[_0x469f8a(0x1a9)]);const _0x4e74d7=new Map(),_0x44e290=new Map(),_0x5e0f73=new Map();let _0x2c72fa;const _0x5e6c82=async()=>{const _0x3fbc13=_0x469f8a;if(_0x2c72fa)return;_0x2c72fa=new Map();if(!_0x467548['existingJourney'])return;const _0x157878=await _0x5903f6['journey']['listActivations'](_0x467548[_0x3fbc13(0x10e)]['id']);for(const _0x5a1b2c of _0x157878){const _0x19c06d=journeyActivationStepToYaml(_0x5a1b2c,_0x15d346[_0x3fbc13(0x157)],_0x15d346[_0x3fbc13(0x176)]),_0x58ba16=activationSignature(_0x19c06d);!_0x2c72fa[_0x3fbc13(0x162)](_0x58ba16)&&_0x2c72fa['set'](_0x58ba16,_0x5a1b2c['id']),_0x19c06d[_0x3fbc13(0x190)]&&_0x5620f8[_0x3fbc13(0xc5)](_0x19c06d['name'],_0x5a1b2c['id']);}};await matchExistingJourneySegments(_0x5903f6,_0x467548,_0x129050[_0x469f8a(0x19e)],_0x15d346[_0x469f8a(0x12e)],_0x15d346[_0x469f8a(0x1a9)]);const _0x1eb98b={'resolveSegmentId':async _0x3a92da=>{const _0x53116c=_0x469f8a,_0x3d9a47=_0x15d346['segmentNameToId']['get'](_0x3a92da);if(!_0x3d9a47)throw new SDKError(ErrorCode[_0x53116c(0x1aa)],'Segment\x20not\x20found:\x20'+_0x3a92da+_0x53116c(0x13e)+_0x467548[_0x53116c(0xdc)][_0x53116c(0x190)]+')');return _0x3d9a47;},'resolveEmbeddedSegmentId':async(_0x31a517,_0x889020)=>{const _0x376fe5=_0x469f8a,_0xf1eb38=_0x15d346['segmentNameToId'][_0x376fe5(0xf4)](_0x31a517);if(_0xf1eb38)return _0xf1eb38;const _0x102704=_0x15d346['existingSegments'][_0x376fe5(0xed)](_0x21207f=>_0x21207f['name']===_0x31a517);if(_0x102704)return _0x15d346[_0x376fe5(0x1a9)][_0x376fe5(0xc5)](_0x31a517,_0x102704['id']),_0x102704['id'];if(_0x467548[_0x376fe5(0x17a)]){const {stageName:_0x4a27ed,criteriaName:_0x5781ee}=findSegmentCriteriaLocation(_0x467548['yamlConfig'],_0x31a517);return _0x2108a7(_0x31a517,_0x889020['rule']),_0x44e290[_0x376fe5(0xc5)](_0x31a517,{'definition':_0x889020,'stageName':_0x4a27ed,'criteriaName':_0x5781ee}),createPendingSegmentId(_0x31a517);}const _0x44d913=_0x467548[_0x376fe5(0x10e)]?.['id'];if(!_0x44d913)throw new SDKError(ErrorCode[_0x376fe5(0x196)],_0x376fe5(0x1a6));const _0x907e27=_0x4e74d7[_0x376fe5(0xf4)](_0x31a517);if(_0x907e27)return _0x907e27;const _0x23ef0d=((async()=>{const _0xa1f2e7=_0x376fe5;_0x2108a7(_0x31a517,_0x889020[_0xa1f2e7(0x144)]);const _0xe129e1=generateDeterministicJourneySegmentName(_0x467548[_0xa1f2e7(0xdc)][_0xa1f2e7(0x190)],_0x31a517),_0x40efb3=_0x15d346[_0xa1f2e7(0x12e)][_0xa1f2e7(0xed)](_0x101fb4=>_0x101fb4[_0xa1f2e7(0x190)]===_0xe129e1),_0x18d82c=createSegmentIdResolver(_0x15d346[_0xa1f2e7(0x1a9)],_0x31a517),_0x289929=await resolveRuleSegmentIds(_0x889020[_0xa1f2e7(0x144)],_0x18d82c);let _0x507023;return _0x40efb3?(await _0x5903f6[_0xa1f2e7(0xb7)][_0xa1f2e7(0xbe)](_0x129050['parentId'],_0x40efb3['id'],{'description':_0x889020['description']||'Entry\x20criteria:\x20'+_0x31a517,'rule':_0x54eb55(_0x289929),'countPopulation':!![]}),_0x507023=_0x40efb3['id'],saveSegmentToPushRecovery(_0x467548[_0xa1f2e7(0xf0)],_0x467548[_0xa1f2e7(0xdc)][_0xa1f2e7(0x190)],_0x31a517,{'segmentId':_0x507023,'uniqueServerName':_0xe129e1,'createdAt':new Date()['toISOString']()})):_0x507023=await createOrRecoverEmbeddedSegment(_0x5903f6,_0x467548,{'localName':_0x31a517,'uniqueSegmentName':_0xe129e1,'description':_0x889020[_0xa1f2e7(0x117)]||'Entry\x20criteria:\x20'+_0x31a517,'journeyId':_0x44d913,'resolvedRule':_0x289929,'parentId':_0x129050[_0xa1f2e7(0x19e)],'folderId':_0x129050['rootFolderId']||''},_0x54eb55),_0x15d346[_0xa1f2e7(0x1a9)][_0xa1f2e7(0xc5)](_0x31a517,_0x507023),_0x516741[_0xa1f2e7(0xc5)](_0x31a517,_0x507023),_0x507023;})());_0x4e74d7['set'](_0x31a517,_0x23ef0d);try{return await _0x23ef0d;}finally{_0x4e74d7[_0x376fe5(0x11d)](_0x31a517);}},'resolveActivationId':async _0x5701db=>{const _0x2392cd=_0x469f8a,_0x5c31fb=_0x5620f8[_0x2392cd(0xf4)](_0x5701db);if(_0x5c31fb)return _0x5c31fb;if(_0x467548[_0x2392cd(0x10e)]){await _0x5e6c82();const _0x3f87a4=_0x5620f8['get'](_0x5701db);if(_0x3f87a4)return _0x3f87a4;}throw new SDKError(ErrorCode[_0x2392cd(0x10b)],'Activation\x20not\x20found:\x20'+_0x5701db+_0x2392cd(0x13e)+_0x467548[_0x2392cd(0xdc)][_0x2392cd(0x190)]+_0x2392cd(0x15c)+_0x2392cd(0xcc));},'resolveEmbeddedActivationId':async(_0x97d036,_0x234e2f)=>{const _0x418aba=_0x469f8a,_0x1d9d3a=_0x5620f8[_0x418aba(0xf4)](_0x97d036);if(_0x1d9d3a)return _0x1d9d3a;if(_0x467548[_0x418aba(0x17a)])return _0x5e0f73[_0x418aba(0xc5)](_0x97d036,_0x234e2f),createPendingActivationId(_0x97d036);if(_0x467548[_0x418aba(0x10e)]){await _0x5e6c82();const _0x358235=_0x5620f8['get'](_0x234e2f[_0x418aba(0x190)]);if(_0x358235)return _0x5620f8[_0x418aba(0xc5)](_0x97d036,_0x358235),_0x358235;const _0x39e9af=activationSignature(_0x234e2f),_0xd8081c=_0x2c72fa?.['get'](_0x39e9af);if(_0xd8081c)return _0x5620f8[_0x418aba(0xc5)](_0x97d036,_0xd8081c),_0xd8081c;const _0x1f48fd=await _0x28e070(_0x234e2f,_0x15d346[_0x418aba(0x175)]),_0x12403a={..._0x1f48fd,..._0x234e2f['run_after_journey_refresh']!==undefined&&{'runAfterJourneyRefresh':_0x234e2f[_0x418aba(0x11e)]}},_0x371223=await _0x5903f6[_0x418aba(0x168)][_0x418aba(0x185)](_0x467548[_0x418aba(0x10e)]['id'],_0x12403a);return _0x5620f8['set'](_0x97d036,_0x371223['id']),_0x371223['id'];}throw new SDKError(ErrorCode[_0x418aba(0x196)],_0x418aba(0xb8));},'resolveJourneyId':async _0x3c4668=>{const _0x284fc0=_0x469f8a;try{return await _0x5903f6[_0x284fc0(0x168)][_0x284fc0(0x118)](_0x129050[_0x284fc0(0x19e)],_0x3c4668);}catch(_0x3110bb){throw new SDKError(ErrorCode[_0x284fc0(0x10b)],'Journey\x20\x27'+_0x3c4668+_0x284fc0(0xd2)+_0x467548['yamlConfig']['name']+'\x27)',_0x3110bb);}},'resolveStageId':async(_0x1dc5cd,_0x146524)=>{const _0x3f9ae8=_0x469f8a,_0xbc7c8a=await _0x5903f6[_0x3f9ae8(0x168)][_0x3f9ae8(0x11b)](_0x1dc5cd),_0x3fdc3d=_0xbc7c8a['attributes'][_0x3f9ae8(0x156)][_0x3f9ae8(0xed)](_0x419808=>_0x419808['name'][_0x3f9ae8(0x1ab)]()===_0x146524[_0x3f9ae8(0x1ab)]());if(!_0x3fdc3d?.['id'])throw new SDKError(ErrorCode[_0x3f9ae8(0x10b)],_0x3f9ae8(0xd3)+_0x146524+'\x27\x20not\x20found\x20in\x20journey\x20\x27'+(_0xbc7c8a[_0x3f9ae8(0x161)][_0x3f9ae8(0x183)]||_0xbc7c8a[_0x3f9ae8(0x161)][_0x3f9ae8(0x190)])+'\x27');return _0x3fdc3d['id'];}},_0x4922bf=await _0x318c12(_0x467548[_0x469f8a(0xdc)],_0x129050[_0x469f8a(0x19e)],_0x1eb98b),_0x5b21f3=_0x129050[_0x469f8a(0xbc)]||_0x129050[_0x469f8a(0xf5)];_0x5b21f3&&(_0x4922bf['relationships']={'parentFolder':{'data':{'id':_0x5b21f3,'type':_0x469f8a(0x109)}}});if(_0x467548['isNew']){if(_0x44e290[_0x469f8a(0x145)]>0x0||_0x5e0f73[_0x469f8a(0x145)]>0x0)return await executeThreeStepJourneyCreate(_0x5903f6,_0x467548,_0x4922bf,{'pendingEmbeddedSegments':_0x44e290,'pendingEmbeddedActivations':_0x5e0f73,'embeddedSegmentNameToId':_0x516741,'journeyActivationNameToId':_0x5620f8},{..._0x129050,'effectiveFolderId':_0x5b21f3},_0x15d346,_0x16052f,_0x1d8c4e);else{ensureJourneyDefaults(_0x4922bf[_0x469f8a(0x161)]);const _0x24a04e=await _0x5903f6[_0x469f8a(0x168)][_0x469f8a(0x127)](_0x4922bf);return deletePushRecovery(_0x467548['absolutePath']),{'action':_0x469f8a(0x12a),'journeyId':_0x24a04e['id'],'embeddedSegmentNameToId':_0x516741};}}else{if(_0x467548[_0x469f8a(0x166)]&&_0x467548['existingJourney']){_0x4922bf['id']=_0x467548[_0x469f8a(0x10e)]['id'];const _0x4e75b0=_0x4922bf['attributes'];_0x467548[_0x469f8a(0x10e)][_0x469f8a(0x161)]?.[_0x469f8a(0x183)]&&(_0x4e75b0[_0x469f8a(0x183)]=_0x467548[_0x469f8a(0x10e)][_0x469f8a(0x161)][_0x469f8a(0x183)]);const _0x2e6022=_0x467548[_0x469f8a(0x10e)]['attributes']?.[_0x469f8a(0x156)];return _0x2e6022&&_0x4922bf[_0x469f8a(0x161)][_0x469f8a(0x156)]&&injectExistingStageIds(_0x4922bf['attributes'][_0x469f8a(0x156)],_0x2e6022),ensureJourneyDefaults(_0x4e75b0),await _0x5903f6[_0x469f8a(0x168)]['update'](_0x467548[_0x469f8a(0x10e)]['id'],_0x4922bf),deletePushRecovery(_0x467548[_0x469f8a(0xf0)]),{'action':_0x469f8a(0x120),'journeyId':_0x467548['existingJourney']['id'],'embeddedSegmentNameToId':_0x516741};}}return deletePushRecovery(_0x467548['absolutePath']),{'action':_0x469f8a(0xcd),'journeyId':_0x467548['existingJourney']?.['id'],'embeddedSegmentNameToId':_0x516741};}function findSegmentCriteriaLocation(_0x34e716,_0x4df592){const _0x2e940e=a152_0x525fdb,_0x1aa9c9=_0x34e716[_0x2e940e(0x15b)]||_0x34e716[_0x2e940e(0x1ad)]?.[0x0]?.[_0x2e940e(0x15b)]||[];let _0x25c1e7=_0x2e940e(0x169),_0x5631a4=_0x4df592;const _0x2b54ca=_0x34e716[_0x2e940e(0x154)]||_0x34e716[_0x2e940e(0x1ad)]?.[0x0]?.[_0x2e940e(0x154)];if(_0x2b54ca?.[_0x2e940e(0xb7)]===_0x4df592)return{'stageName':_0x2e940e(0x154),'criteriaName':_0x2b54ca[_0x2e940e(0x190)]||_0x4df592};_0x108da2:for(const _0x4e6db3 of _0x1aa9c9){if(_0x4e6db3[_0x2e940e(0x152)]?.[_0x2e940e(0xb7)]===_0x4df592){_0x25c1e7=_0x4e6db3[_0x2e940e(0x190)],_0x5631a4=_0x4e6db3[_0x2e940e(0x152)][_0x2e940e(0x190)]||_0x4df592;break;}if(_0x4e6db3[_0x2e940e(0x1a8)])for(const _0x1593ae of _0x4e6db3[_0x2e940e(0x1a8)]){if(_0x1593ae[_0x2e940e(0x186)]===_0x2e940e(0x18c)&&_0x1593ae[_0x2e940e(0x19a)]?.[_0x2e940e(0x160)])for(const _0x1b4112 of _0x1593ae['with'][_0x2e940e(0x160)]){if(_0x1b4112[_0x2e940e(0xb7)]===_0x4df592){_0x25c1e7=_0x4e6db3['name'],_0x5631a4=_0x1b4112[_0x2e940e(0x190)]||_0x4df592;break _0x108da2;}}}}return{'stageName':_0x25c1e7,'criteriaName':_0x5631a4};}async function executeThreeStepJourneyCreate(_0x7b108a,_0x2f83c5,_0x2850bb,_0x306f5c,_0x45aa22,_0x3df3c5,_0x1bf3e9,_0x512dd5){const _0x294213=a152_0x525fdb,{activationDefToCreateRequest:_0x2d6fad,yamlRuleToApi:_0x1c5f4f}=_0x512dd5,{pendingEmbeddedSegments:_0x4a288f,pendingEmbeddedActivations:_0x1b945c,embeddedSegmentNameToId:_0xb54548}=_0x306f5c,_0x39011b=JSON[_0x294213(0xa6)](JSON[_0x294213(0x103)](_0x2850bb));ensureJourneyDefaults(_0x39011b[_0x294213(0x161)]),stripPendingIds(_0x39011b);const _0x4cb85a=await _0x7b108a['journey'][_0x294213(0x127)](_0x39011b),_0x4cb932=_0x4cb85a['id'],_0x1691ad=new Map();for(const _0x23d987 of _0x4cb85a['attributes'][_0x294213(0x156)]){_0x1691ad[_0x294213(0xc5)](_0x23d987[_0x294213(0x190)][_0x294213(0x1ab)](),_0x23d987['id']);}recoverSegmentIdsFromPushRecovery(_0x2f83c5,_0xb54548,_0x3df3c5[_0x294213(0x1a9)]);for(const [_0x38db56,{definition:_0x1044dc}]of _0x4a288f){if(_0xb54548[_0x294213(0x162)](_0x38db56)){_0x1bf3e9['onProgress']?.({'type':_0x294213(0x135),'journeyName':_0x2f83c5['yamlConfig'][_0x294213(0x190)],'segmentName':_0x38db56});continue;}const _0xaeb214=generateDeterministicJourneySegmentName(_0x2f83c5[_0x294213(0xdc)][_0x294213(0x190)],_0x38db56);_0x1bf3e9[_0x294213(0xe8)]?.({'type':_0x294213(0x14c),'journeyName':_0x2f83c5[_0x294213(0xdc)]['name'],'segmentName':_0x38db56});const _0x19d6c1=createSegmentIdResolver(_0x3df3c5['segmentNameToId'],_0x38db56),_0x5afd72=await resolveRuleSegmentIds(_0x1044dc[_0x294213(0x144)],_0x19d6c1),_0x3456ea=await createOrRecoverEmbeddedSegment(_0x7b108a,_0x2f83c5,{'localName':_0x38db56,'uniqueSegmentName':_0xaeb214,'description':_0x1044dc[_0x294213(0x117)]||'Entry\x20criteria:\x20'+_0x38db56,'journeyId':_0x4cb932,'resolvedRule':_0x5afd72,'parentId':_0x45aa22[_0x294213(0x19e)],'folderId':_0x45aa22['effectiveFolderId']||''},_0x1c5f4f);_0xb54548[_0x294213(0xc5)](_0x38db56,_0x3456ea),_0x3df3c5['segmentNameToId'][_0x294213(0xc5)](_0x38db56,_0x3456ea),_0x1bf3e9[_0x294213(0xe8)]?.({'type':'embedded_segment_created','journeyName':_0x2f83c5[_0x294213(0xdc)][_0x294213(0x190)],'segmentName':_0x38db56});}const _0x35f241=new Map();for(const [_0x204d9c,_0x272c9a]of _0x1b945c){_0x1bf3e9[_0x294213(0xe8)]?.({'type':'embedded_activation_creating','journeyName':_0x2f83c5[_0x294213(0xdc)]['name'],'activationName':_0x204d9c});const _0x559ae0=await _0x2d6fad(_0x272c9a,_0x3df3c5['activationContext']),_0x443eba={..._0x559ae0,..._0x272c9a[_0x294213(0x11e)]!==undefined&&{'runAfterJourneyRefresh':_0x272c9a['run_after_journey_refresh']}},_0xd31223=await _0x7b108a['journey'][_0x294213(0x185)](_0x4cb932,_0x443eba);_0x35f241['set'](_0x204d9c,_0xd31223['id']),_0x306f5c[_0x294213(0xd0)][_0x294213(0xc5)](_0x204d9c,_0xd31223['id']),_0x1bf3e9[_0x294213(0xe8)]?.({'type':_0x294213(0xe6),'journeyName':_0x2f83c5[_0x294213(0xdc)]['name'],'activationName':_0x204d9c});}const _0x197cd9=JSON[_0x294213(0xa6)](JSON[_0x294213(0x103)](_0x2850bb));return _0x197cd9['id']=_0x4cb932,ensureJourneyDefaults(_0x197cd9[_0x294213(0x161)]),resolvePendingIdsInRequest(_0x197cd9,_0x2850bb,_0x1691ad,_0xb54548,_0x35f241,_0x1bf3e9),await _0x7b108a[_0x294213(0x168)][_0x294213(0xbf)](_0x4cb932,_0x197cd9),deletePushRecovery(_0x2f83c5['absolutePath']),{'action':'created','journeyId':_0x4cb932,'embeddedSegmentNameToId':_0xb54548};}export function stripWaitStepPendingIds(_0x44d027){const _0x4d7779=a152_0x525fdb,_0x26d5c1=_0x44d027[_0x4d7779(0xa8)]&&isPendingSegmentId(_0x44d027[_0x4d7779(0xa8)]),_0x125134=_0x44d027[_0x4d7779(0x16d)]?.[_0x4d7779(0x1a4)](_0x5de2ee=>_0x5de2ee[_0x4d7779(0x114)]&&isPendingSegmentId(_0x5de2ee[_0x4d7779(0x114)]));(_0x26d5c1||_0x125134)&&(_0x44d027[_0x4d7779(0x133)]=_0x4d7779(0x12f),_0x44d027[_0x4d7779(0x165)]=0x1,_0x44d027[_0x4d7779(0x119)]=_0x4d7779(0xff),delete _0x44d027[_0x4d7779(0xa8)],delete _0x44d027['conditionTimeoutDuration'],delete _0x44d027[_0x4d7779(0x192)],delete _0x44d027[_0x4d7779(0x16d)]);}export function resolveWaitStepPendingIds(_0x936b18,_0xb41c2b,_0x4da0dc,_0x378b70){const _0x5c99e9=a152_0x525fdb;if(_0xb41c2b[_0x5c99e9(0xa8)]&&isPendingSegmentId(_0xb41c2b[_0x5c99e9(0xa8)])){const _0x45d9c4=_0x4da0dc(_0xb41c2b[_0x5c99e9(0xa8)],_0x5c99e9(0x122)+_0x378b70+'\x27\x20wait\x20condition');_0x45d9c4&&(_0x936b18[_0x5c99e9(0x133)]=_0x5c99e9(0x1a5),_0x936b18[_0x5c99e9(0xa8)]=_0x45d9c4,delete _0x936b18[_0x5c99e9(0x165)],delete _0x936b18[_0x5c99e9(0x119)],_0xb41c2b[_0x5c99e9(0x16b)]!==undefined&&(_0x936b18[_0x5c99e9(0x16b)]=_0xb41c2b['conditionTimeoutDuration']),_0xb41c2b['conditionTimeoutUnit']&&(_0x936b18[_0x5c99e9(0x192)]=_0xb41c2b[_0x5c99e9(0x192)]));}if(_0xb41c2b[_0x5c99e9(0x16d)]){const _0xa6d041=_0xb41c2b[_0x5c99e9(0x16d)]['some'](_0x59b156=>_0x59b156[_0x5c99e9(0x114)]&&isPendingSegmentId(_0x59b156[_0x5c99e9(0x114)]));if(_0xa6d041){const _0xc8698e=_0xb41c2b[_0x5c99e9(0x16d)]['map'](_0x20c1d2=>{const _0x8b9b6f=_0x5c99e9;if(_0x20c1d2[_0x8b9b6f(0x114)]&&isPendingSegmentId(_0x20c1d2['segmentId'])){const _0x50a8ab=_0x4da0dc(_0x20c1d2[_0x8b9b6f(0x114)],_0x8b9b6f(0x122)+_0x378b70+'\x27\x20wait\x20condition');return{..._0x20c1d2,'segmentId':_0x50a8ab||_0x20c1d2['segmentId']};}return{..._0x20c1d2};});_0x936b18['waitStepType']='Condition',_0x936b18[_0x5c99e9(0x16d)]=_0xc8698e,delete _0x936b18[_0x5c99e9(0x165)],delete _0x936b18[_0x5c99e9(0x119)],delete _0x936b18[_0x5c99e9(0xa8)],delete _0x936b18[_0x5c99e9(0x16b)],delete _0x936b18['conditionTimeoutUnit'];}}}function stripPendingIds(_0x4b485b){const _0x15496e=a152_0x525fdb;_0x4b485b[_0x15496e(0x161)][_0x15496e(0x154)]?.[_0x15496e(0x114)]&&isPendingSegmentId(_0x4b485b[_0x15496e(0x161)][_0x15496e(0x154)][_0x15496e(0x114)])&&delete _0x4b485b[_0x15496e(0x161)][_0x15496e(0x154)];for(const _0x2c9e1d of _0x4b485b[_0x15496e(0x161)][_0x15496e(0x156)]||[]){_0x2c9e1d[_0x15496e(0x158)]?.['segmentId']&&isPendingSegmentId(_0x2c9e1d['entryCriteria'][_0x15496e(0x114)])&&delete _0x2c9e1d[_0x15496e(0x158)];_0x2c9e1d['milestone']?.['segmentId']&&isPendingSegmentId(_0x2c9e1d[_0x15496e(0x132)]['segmentId'])&&delete _0x2c9e1d[_0x15496e(0x132)];_0x2c9e1d[_0x15496e(0x138)]&&(_0x2c9e1d[_0x15496e(0x138)]=_0x2c9e1d[_0x15496e(0x138)]['filter'](_0x1fe251=>!_0x1fe251['segmentId']||!isPendingSegmentId(_0x1fe251['segmentId'])));if(_0x2c9e1d['steps'])for(const _0x31c754 of Object[_0x15496e(0x17c)](_0x2c9e1d['steps'])){const _0x58a490=_0x2c9e1d[_0x15496e(0x1a8)][_0x31c754];_0x58a490['type']===_0x15496e(0xb0)&&_0x58a490[_0x15496e(0xb6)]&&isPendingActivationId(_0x58a490[_0x15496e(0xb6)])&&(_0x58a490[_0x15496e(0xb6)]='');if(_0x58a490[_0x15496e(0x186)]===_0x15496e(0x18e)&&_0x58a490['branches'])for(const _0x33df16 of _0x58a490['branches']){_0x33df16[_0x15496e(0x114)]&&isPendingSegmentId(_0x33df16['segmentId'])&&(_0x33df16[_0x15496e(0x114)]='');}_0x58a490[_0x15496e(0x186)]===_0x15496e(0xfa)&&stripWaitStepPendingIds(_0x58a490);}}}function resolvePendingIdsInRequest(_0x1491a0,_0x18614c,_0x343311,_0x13c6b4,_0x588c70,_0x16302d){const _0x30f7fc=a152_0x525fdb,_0x216d4b=(_0x500eab,_0x1e3ac8)=>{const _0x1bfb11=a152_0x400d;if(!isPendingSegmentId(_0x500eab))return _0x500eab;const _0x49ee70=extractPendingSegmentName(_0x500eab),_0x4cfb3a=_0x13c6b4['get'](_0x49ee70);return!_0x4cfb3a&&_0x16302d[_0x1bfb11(0x193)]?.(_0x1bfb11(0xde)+_0x49ee70+_0x1bfb11(0x108)+_0x1e3ac8),_0x4cfb3a;};if(_0x1491a0[_0x30f7fc(0x161)][_0x30f7fc(0x154)]?.[_0x30f7fc(0x114)]&&isPendingSegmentId(_0x1491a0[_0x30f7fc(0x161)][_0x30f7fc(0x154)][_0x30f7fc(0x114)])){const _0x4c39cb=_0x216d4b(_0x1491a0[_0x30f7fc(0x161)]['goal'][_0x30f7fc(0x114)],_0x30f7fc(0x1a2));_0x4c39cb&&(_0x1491a0[_0x30f7fc(0x161)][_0x30f7fc(0x154)]['segmentId']=_0x4c39cb);}for(const _0x117352 of _0x1491a0[_0x30f7fc(0x161)][_0x30f7fc(0x156)]||[]){const _0x2ef858=_0x343311[_0x30f7fc(0xf4)](_0x117352[_0x30f7fc(0x190)][_0x30f7fc(0x1ab)]());_0x2ef858&&(_0x117352['id']=_0x2ef858);if(_0x117352[_0x30f7fc(0x158)]?.[_0x30f7fc(0x114)]&&isPendingSegmentId(_0x117352['entryCriteria'][_0x30f7fc(0x114)])){const _0x3378af=_0x216d4b(_0x117352[_0x30f7fc(0x158)][_0x30f7fc(0x114)],'stage\x20\x27'+_0x117352[_0x30f7fc(0x190)]+_0x30f7fc(0x100));_0x3378af&&(_0x117352[_0x30f7fc(0x158)]['segmentId']=_0x3378af);}if(_0x117352['exitCriterias'])for(const _0x3675b5 of _0x117352['exitCriterias']){if(_0x3675b5['segmentId']&&isPendingSegmentId(_0x3675b5['segmentId'])){const _0x49f47b=_0x216d4b(_0x3675b5['segmentId'],'stage\x20\x27'+_0x117352[_0x30f7fc(0x190)]+_0x30f7fc(0xd7));_0x49f47b&&(_0x3675b5[_0x30f7fc(0x114)]=_0x49f47b);}}if(_0x117352[_0x30f7fc(0x132)]?.[_0x30f7fc(0x114)]&&isPendingSegmentId(_0x117352[_0x30f7fc(0x132)][_0x30f7fc(0x114)])){const _0x10c89c=_0x216d4b(_0x117352[_0x30f7fc(0x132)][_0x30f7fc(0x114)],_0x30f7fc(0x122)+_0x117352[_0x30f7fc(0x190)]+'\x27\x20milestone');_0x10c89c&&(_0x117352[_0x30f7fc(0x132)]['segmentId']=_0x10c89c);}if(_0x117352[_0x30f7fc(0x1a8)]){const _0x35d219=_0x5cf1f2=>_0x18614c[_0x30f7fc(0x161)]['journeyStages']?.[_0x30f7fc(0xed)](_0x488a2=>_0x488a2['name'][_0x30f7fc(0x1ab)]()===_0x117352[_0x30f7fc(0x190)][_0x30f7fc(0x1ab)]())?.[_0x30f7fc(0x1a8)]?.[_0x5cf1f2];for(const _0xa7a807 of Object[_0x30f7fc(0x17c)](_0x117352['steps'])){const _0x1cb726=_0x117352[_0x30f7fc(0x1a8)][_0xa7a807],_0x55802b=_0x35d219(_0xa7a807);if(_0x1cb726[_0x30f7fc(0x186)]===_0x30f7fc(0xb0)&&_0x1cb726[_0x30f7fc(0xb6)]&&(isPendingActivationId(_0x1cb726[_0x30f7fc(0xb6)])||_0x1cb726['journeyActivationStepId']==='')){if(_0x55802b?.['journeyActivationStepId']&&isPendingActivationId(_0x55802b[_0x30f7fc(0xb6)])){const _0x36b5fa=extractPendingActivationName(_0x55802b['journeyActivationStepId']),_0x5ac497=_0x588c70['get'](_0x36b5fa);_0x5ac497&&(_0x1cb726[_0x30f7fc(0xb6)]=_0x5ac497);}}if(_0x1cb726[_0x30f7fc(0x186)]==='DecisionPoint'&&_0x1cb726[_0x30f7fc(0x160)]&&_0x55802b?.[_0x30f7fc(0x160)])for(let _0x5716f6=0x0;_0x5716f6<_0x1cb726[_0x30f7fc(0x160)][_0x30f7fc(0xfe)];_0x5716f6++){const _0x5a5eeb=_0x1cb726[_0x30f7fc(0x160)][_0x5716f6],_0x358a18=_0x55802b['branches'][_0x5716f6];if(_0x358a18?.[_0x30f7fc(0x114)]&&isPendingSegmentId(_0x358a18[_0x30f7fc(0x114)])){const _0x548ad5=_0x216d4b(_0x358a18[_0x30f7fc(0x114)],'stage\x20\x27'+_0x117352[_0x30f7fc(0x190)]+_0x30f7fc(0x171)+(_0x5a5eeb[_0x30f7fc(0x190)]||_0x5716f6)+'\x27');_0x548ad5&&(_0x5a5eeb[_0x30f7fc(0x114)]=_0x548ad5);}}_0x1cb726['type']===_0x30f7fc(0xfa)&&_0x55802b?.[_0x30f7fc(0x186)]===_0x30f7fc(0xfa)&&resolveWaitStepPendingIds(_0x1cb726,_0x55802b,_0x216d4b,_0x117352[_0x30f7fc(0x190)]);}}}}
|
|
1
|
+
const a152_0xfcf5ee=a152_0x558f;(function(_0x4fc1cb,_0x3c68dc){const _0x6f1454=a152_0x558f,_0x448e39=_0x4fc1cb();while(!![]){try{const _0x38dc77=parseInt(_0x6f1454(0x204))/0x1*(parseInt(_0x6f1454(0x205))/0x2)+-parseInt(_0x6f1454(0x2ae))/0x3*(-parseInt(_0x6f1454(0x290))/0x4)+parseInt(_0x6f1454(0x254))/0x5+parseInt(_0x6f1454(0x2c8))/0x6*(parseInt(_0x6f1454(0x298))/0x7)+parseInt(_0x6f1454(0x275))/0x8*(parseInt(_0x6f1454(0x2a8))/0x9)+-parseInt(_0x6f1454(0x273))/0xa+-parseInt(_0x6f1454(0x2b0))/0xb*(parseInt(_0x6f1454(0x243))/0xc);if(_0x38dc77===_0x3c68dc)break;else _0x448e39['push'](_0x448e39['shift']());}catch(_0x577f9b){_0x448e39['push'](_0x448e39['shift']());}}}(a152_0x2821,0xf2b74));import{createHash}from'crypto';import{Logger}from'../../utils/logger/index.js';const logger=Logger['of']('tdx.sdk.push-workflow');export const PENDING_SEGMENT_PREFIX='__pending_';export const PENDING_ACTIVATION_PREFIX=a152_0xfcf5ee(0x288);export function createPendingSegmentId(_0x152b60){return''+PENDING_SEGMENT_PREFIX+_0x152b60+'__';}export function isPendingSegmentId(_0x5b31d4){const _0x3b29b0=a152_0xfcf5ee;return _0x5b31d4[_0x3b29b0(0x257)](PENDING_SEGMENT_PREFIX)&&!_0x5b31d4['startsWith'](PENDING_ACTIVATION_PREFIX);}export function extractPendingSegmentName(_0x46a1db){const _0x1f1a8f=a152_0xfcf5ee;return _0x46a1db[_0x1f1a8f(0x2c1)](/^__pending_(.+)__$/,'$1');}export function createPendingActivationId(_0x24ebb){return''+PENDING_ACTIVATION_PREFIX+_0x24ebb+'__';}export function isPendingActivationId(_0x40d39b){return _0x40d39b['startsWith'](PENDING_ACTIVATION_PREFIX);}export function extractPendingActivationName(_0x4ddaa8){const _0x5b3f25=a152_0xfcf5ee;return _0x4ddaa8[_0x5b3f25(0x2c1)](/^__pending_act_(.+)__$/,'$1');}export function generateDeterministicJourneySegmentName(_0x585794,_0x454eca){const _0x19089c=a152_0xfcf5ee,_0x603307=_0x585794+'::'+(_0x454eca['trim']()||_0x19089c(0x210)),_0x1743ef=createHash(_0x19089c(0x21c))[_0x19089c(0x238)](_0x603307)['digest'](_0x19089c(0x28f))['slice'](0x0,0xc);return _0x19089c(0x260)+_0x1743ef;}export function ensureJourneyDefaults(_0x561190){const _0x755f48=a152_0xfcf5ee;!_0x561190[_0x755f48(0x224)]&&(_0x561190[_0x755f48(0x224)]=''),!_0x561190[_0x755f48(0x289)]&&(_0x561190[_0x755f48(0x289)]=_0x755f48(0x2cf));}export function injectExistingStageIds(_0x4eb5e9,_0x537158){const _0x34f91c=a152_0xfcf5ee,_0x444626=new Map(_0x537158['map'](_0x19b3ae=>[_0x19b3ae['name'],_0x19b3ae['id']]));for(const _0x41f3c8 of _0x4eb5e9){if(!_0x41f3c8['id']){const _0xb159af=_0x444626[_0x34f91c(0x29d)](_0x41f3c8[_0x34f91c(0x228)]);_0xb159af&&(_0x41f3c8['id']=_0xb159af);}}}export function resolveTDFolderPath(_0x272ccd,_0x4ee817,_0x73fa24){if(!_0x4ee817)return _0x272ccd;if(_0x272ccd===_0x73fa24||_0x272ccd['startsWith'](_0x73fa24+'/'))return _0x272ccd;return _0x272ccd?_0x73fa24+'/'+_0x272ccd:_0x73fa24;}export function addFoldersToCreate(_0x41afcd,_0x13afeb,_0x446382){const _0x49ed13=a152_0xfcf5ee;if(!_0x41afcd)return;if(_0x13afeb['has'](_0x41afcd))return;const _0x30ec17=_0x41afcd[_0x49ed13(0x208)]('/');let _0x1710ed='';for(const _0x5dd0a1 of _0x30ec17){_0x1710ed=_0x1710ed?_0x1710ed+'/'+_0x5dd0a1:_0x5dd0a1,!_0x13afeb['has'](_0x1710ed)&&_0x446382[_0x49ed13(0x231)](_0x1710ed);}}export function sortFoldersByDepth(_0x315be7){const _0x3e9de3=a152_0xfcf5ee;return[..._0x315be7][_0x3e9de3(0x26f)]((_0x465405,_0x2398f3)=>{const _0x1470f3=_0x3e9de3,_0x4475c6=(_0x465405[_0x1470f3(0x20f)](/\//g)||[])[_0x1470f3(0x221)],_0x409d5e=(_0x2398f3[_0x1470f3(0x20f)](/\//g)||[])['length'];return _0x4475c6-_0x409d5e;});}import*as a152_0x13ed94 from'yaml';import{readFileSync}from'fs';import a152_0x4085cb from'path';import{isJourneyDef,parseYamlString as a152_0x1dedcf,toYamlString as a152_0x3cd3f6,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';function a152_0x558f(_0x3e1da6,_0x4dd0af){_0x3e1da6=_0x3e1da6-0x1d8;const _0x28215b=a152_0x2821();let _0x558f25=_0x28215b[_0x3e1da6];return _0x558f25;}import{validateSegmentDef,formatValidationResult}from'./yaml-validator.js';import{validateJourneyDef}from'./journey-validator.js';function stableStringify(_0x313c53){const _0x2bc93a=a152_0xfcf5ee;if(Array[_0x2bc93a(0x213)](_0x313c53))return'['+_0x313c53[_0x2bc93a(0x232)](_0x1be040=>stableStringify(_0x1be040))['join'](',')+']';if(_0x313c53&&typeof _0x313c53===_0x2bc93a(0x1f9)){const _0x736836=_0x313c53,_0x2f1073=Object[_0x2bc93a(0x259)](_0x736836)[_0x2bc93a(0x26f)](),_0x56f6d0=_0x2f1073[_0x2bc93a(0x232)](_0x1b7f7b=>'\x22'+_0x1b7f7b+'\x22:'+stableStringify(_0x736836[_0x1b7f7b]));return'{'+_0x56f6d0[_0x2bc93a(0x1fb)](',')+'}';}const _0x47ee70=JSON[_0x2bc93a(0x1f7)](_0x313c53);return _0x47ee70===undefined?_0x2bc93a(0x248):_0x47ee70;}function activationSignature(_0x2f5d67){const _0xe2dddd=a152_0xfcf5ee,_0x21137f={'connection':_0x2f5d67[_0xe2dddd(0x2b3)],..._0x2f5d67['all_columns']!==undefined&&{'all_columns':_0x2f5d67[_0xe2dddd(0x271)]},..._0x2f5d67[_0xe2dddd(0x2d9)]!==undefined&&{'columns':_0x2f5d67[_0xe2dddd(0x2d9)]},..._0x2f5d67[_0xe2dddd(0x2c3)]!==undefined&&{'behavior':_0x2f5d67[_0xe2dddd(0x2c3)]},..._0x2f5d67[_0xe2dddd(0x1d9)]!==undefined&&{'schedule':_0x2f5d67['schedule']},..._0x2f5d67['notification']!==undefined&&{'notification':_0x2f5d67['notification']},..._0x2f5d67[_0xe2dddd(0x1ec)]!==undefined&&{'connector_config':_0x2f5d67[_0xe2dddd(0x1ec)]},..._0x2f5d67[_0xe2dddd(0x1f4)]!==undefined&&{'activation_template_id':_0x2f5d67['activation_template_id']}};return stableStringify(_0x21137f);}async function fetchSegment(_0x4f9c4e,_0xb5ddfd,_0xd1d1a0,_0x4193a5){const _0x272cec=a152_0xfcf5ee,_0x54e4f0=_0x4193a5?.['find'](_0x9a418e=>_0x9a418e['id']===_0xd1d1a0);if(_0x54e4f0)return _0x54e4f0;try{return await _0x4f9c4e[_0x272cec(0x210)]['getSegment'](_0xb5ddfd,_0xd1d1a0);}catch(_0x10b69c){logger['debug'](_0x272cec(0x268)+_0xd1d1a0+_0x272cec(0x2d1)+_0x10b69c);try{return await _0x4f9c4e[_0x272cec(0x210)][_0x272cec(0x217)](_0xd1d1a0);}catch(_0x22272d){return logger[_0x272cec(0x2cc)]('getSegmentEntity\x20also\x20failed\x20for\x20'+_0xd1d1a0+':\x20'+_0x22272d),null;}}}function recoverSegmentIdsFromPushRecovery(_0x1598c0,_0x53cf17,_0x24563e){const _0x45bd76=a152_0xfcf5ee,_0x2d0e88=readPushRecovery(_0x1598c0['absolutePath']);if(_0x2d0e88?.[_0x45bd76(0x29f)]===_0x1598c0[_0x45bd76(0x29e)][_0x45bd76(0x228)])for(const [_0x488acb,_0x2e31ae]of Object['entries'](_0x2d0e88['segments'])){const _0x417164=generateDeterministicJourneySegmentName(_0x1598c0['yamlConfig']['name'],_0x488acb);_0x2e31ae[_0x45bd76(0x23a)]===_0x417164&&(_0x53cf17[_0x45bd76(0x25b)](_0x488acb,_0x2e31ae[_0x45bd76(0x1eb)]),_0x24563e['set'](_0x488acb,_0x2e31ae[_0x45bd76(0x1eb)]));}}async function createOrRecoverEmbeddedSegment(_0x37386b,_0xf4c6f8,_0x2daf10,_0x5610bc){const _0x31866b=a152_0xfcf5ee;let _0x501808;try{_0x501808=await _0x37386b[_0x31866b(0x210)][_0x31866b(0x28c)]({'name':_0x2daf10['uniqueSegmentName'],'description':_0x2daf10[_0x31866b(0x224)],'journeyId':_0x2daf10['journeyId'],'rule':_0x5610bc(_0x2daf10[_0x31866b(0x2aa)],!![]),'countPopulation':!![],'parentFolderId':_0x2daf10[_0x31866b(0x234)],'audienceId':_0x2daf10[_0x31866b(0x2bc)]});}catch(_0x1997d4){const _0x268d2a=_0x1997d4 instanceof Error&&_0x1997d4[_0x31866b(0x2a3)][_0x31866b(0x1e8)]('Name\x20has\x20already\x20been\x20taken');if(_0x268d2a){const _0x509df6=readPushRecovery(_0xf4c6f8[_0x31866b(0x2b8)]),_0x341c39=_0x509df6?.[_0x31866b(0x29f)]===_0xf4c6f8[_0x31866b(0x29e)][_0x31866b(0x228)]?_0x509df6[_0x31866b(0x21b)][_0x2daf10[_0x31866b(0x237)]]:undefined;if(_0x341c39?.[_0x31866b(0x23a)]===_0x2daf10['uniqueSegmentName'])await _0x37386b[_0x31866b(0x210)][_0x31866b(0x2da)](_0x2daf10[_0x31866b(0x2bc)],_0x341c39[_0x31866b(0x1eb)],{'description':_0x2daf10[_0x31866b(0x224)],'rule':_0x5610bc(_0x2daf10[_0x31866b(0x2aa)],!![]),'countPopulation':!![]}),_0x501808=_0x341c39[_0x31866b(0x1eb)];else throw new SDKError(ErrorCode[_0x31866b(0x1e5)],'Embedded\x20segment\x20\x27'+_0x2daf10['localName']+_0x31866b(0x2a0)+(_0x31866b(0x2d0)+_0xf4c6f8['absolutePath']['replace'](/([^/]+)$/,'.$1.push-recovery.json')+')\x20')+'and\x20the\x20server\x20segment,\x20then\x20retry.',_0x1997d4);}else throw _0x1997d4;}return saveSegmentToPushRecovery(_0xf4c6f8['absolutePath'],_0xf4c6f8['yamlConfig'][_0x31866b(0x228)],_0x2daf10['localName'],{'segmentId':_0x501808,'uniqueServerName':_0x2daf10[_0x31866b(0x253)],'createdAt':new Date()[_0x31866b(0x218)]()}),_0x501808;}export async function prepareSegmentFiles(_0x427ab6,_0x5b5065,_0x3c6e4b,_0x437e3b,_0x590e04){const _0x2cdf7a=a152_0xfcf5ee,{activationDefToCreateRequest:_0x5420fb}=await import(_0x2cdf7a(0x29c)),_0x45a86d=[],_0x4395c7=new Set();for(const {yamlConfig:_0x35488a,folderPath:_0x4533b4,sourcePath:_0x2a672c}of _0x427ab6){const _0x293ebb=resolveTDFolderPath(_0x4533b4,_0x437e3b,_0x590e04),_0x412253=_0x293ebb+':'+_0x35488a[_0x2cdf7a(0x228)],_0x26e433=_0x5b5065['segmentByFolderAndName'][_0x2cdf7a(0x29d)](_0x412253),_0x3ef61f=_0x26e433?_0x5b5065[_0x2cdf7a(0x1dd)][_0x2cdf7a(0x29d)](_0x26e433['id'])||[]:[];addFoldersToCreate(_0x293ebb,_0x5b5065[_0x2cdf7a(0x216)],_0x4395c7);const _0x2876bb=calculateActivationActions(_0x35488a[_0x2cdf7a(0x2c2)]||[],_0x3ef61f,_0x5b5065[_0x2cdf7a(0x239)],_0x5b5065[_0x2cdf7a(0x2bf)]);for(const _0x231332 of _0x2876bb){(_0x231332['type']===_0x2cdf7a(0x2ba)||_0x231332[_0x2cdf7a(0x287)]===_0x2cdf7a(0x238))&&_0x231332[_0x2cdf7a(0x295)]&&(_0x231332['validatedRequest']=await _0x5420fb(_0x231332[_0x2cdf7a(0x295)],_0x3c6e4b));}const _0x28a514=calculateSegmentDiff(_0x35488a,_0x26e433,_0x3ef61f,_0x5b5065[_0x2cdf7a(0x239)],_0x5b5065[_0x2cdf7a(0x2bf)]);_0x45a86d['push']({'relativePath':_0x35488a['name'],'absolutePath':_0x2a672c,'yamlConfig':_0x35488a,'folderPath':_0x293ebb,'existingSegment':_0x26e433,'existingActivations':_0x3ef61f,'isNew':_0x28a514['isNew'],'hasChanges':_0x28a514[_0x2cdf7a(0x2c6)],'diff':_0x28a514[_0x2cdf7a(0x2d5)],'activationActions':_0x2876bb});}return{'segmentFiles':_0x45a86d,'foldersToCreate':_0x4395c7};}export async function prepareJourneyFiles(_0x5cf0cf,_0x134df1,_0x347990,_0x24181e){const _0x381769=a152_0xfcf5ee,_0x33acb9=[],_0x643a04=new Set();for(const {yamlConfig:_0x2fb261,folderPath:_0x335091,sourcePath:_0x5daf0a}of _0x5cf0cf){const _0x32a67c=resolveTDFolderPath(_0x335091,_0x347990,_0x24181e),_0x56b33d=_0x32a67c+':'+_0x2fb261['name'],_0x583f0c=_0x134df1[_0x381769(0x206)][_0x381769(0x29d)](_0x56b33d);let _0x29ec97,_0x3ca754;if(_0x583f0c&&_0x583f0c[_0x381769(0x221)]>0x0){const _0x1c872d=buildLocalExpandedRuleMappings(_0x2fb261),{createYamlContext:_0x392f80,prefetchJourneySegments:_0x416fa1}=createPushYamlContextForBundle(_0x134df1['deps'],_0x134df1[_0x381769(0x2bc)],_0x134df1[_0x381769(0x2d6)],_0x1c872d,_0x134df1[_0x381769(0x239)],_0x134df1['connectionIdToNameMap'],_0x134df1[_0x381769(0x27e)],_0x134df1['journeyById']);await _0x416fa1(_0x583f0c['map'](_0x54b9c6=>_0x54b9c6['id']));const _0x5b87a3=await _0x134df1[_0x381769(0x245)][_0x381769(0x1ef)][_0x381769(0x1fa)](_0x583f0c[0x0][_0x381769(0x25c)]),_0xcb2d62=hasMultipleVersions(_0x2fb261),_0x3db100=async _0x22cd37=>{const _0x2d04cc=_0x381769,_0x2138e9=_0x134df1[_0x2d04cc(0x297)]?.['get'](_0x22cd37);if(_0x2138e9)return _0x2138e9;return _0x134df1[_0x2d04cc(0x26c)]({'journeyId':_0x22cd37,'journeyName':_0x2fb261[_0x2d04cc(0x228)],'isMultiVersion':_0x583f0c[_0x2d04cc(0x221)]>0x1});};if(_0xcb2d62&&_0x583f0c[_0x381769(0x221)]>0x1){const _0x23c70e=[];for(const _0x45c72d of _0x583f0c){const _0x1034b7=_0x45c72d[_0x381769(0x22a)]||0x1;_0x134df1[_0x381769(0x256)]?.[_0x381769(0x238)](_0x381769(0x20b)+_0x2fb261[_0x381769(0x228)]+'\x20v'+_0x1034b7);const _0x2917a5=await _0x3db100(_0x45c72d['id']),_0x1d2dee=_0x392f80(_0x45c72d['id']),_0x1f5611=await journeyResponseToDef(_0x2917a5,_0x1d2dee);_0x23c70e[_0x381769(0x272)]({'item':_0x45c72d,'yaml':_0x1f5611});}const _0x311cee=buildLocalRuleToNameMappingFromJourney(_0x2fb261);_0x3ca754=buildMergedJourneyDef(_0x23c70e,_0x311cee,_0x5b87a3);const _0x3d9aac=Math[_0x381769(0x1e7)](..._0x23c70e['map'](_0x496bd8=>_0x496bd8['item'][_0x381769(0x22a)]||0x0)),_0x4718d1=_0x583f0c[_0x381769(0x240)](_0x3710b9=>(_0x3710b9[_0x381769(0x22a)]||0x0)===_0x3d9aac);_0x4718d1&&(_0x134df1[_0x381769(0x256)]?.[_0x381769(0x238)](_0x381769(0x20b)+_0x2fb261[_0x381769(0x228)]+'\x20v'+_0x3d9aac),_0x29ec97=await _0x3db100(_0x4718d1['id']));}else{const _0x38cec6=_0x583f0c[_0x583f0c['length']-0x1];_0x134df1[_0x381769(0x256)]?.[_0x381769(0x238)](_0x381769(0x20b)+_0x2fb261[_0x381769(0x228)]),_0x29ec97=await _0x3db100(_0x38cec6['id']);const _0x46362f=_0x392f80(_0x38cec6['id']),_0x5d5cfb=await journeyResponseToDef(_0x29ec97,_0x46362f),_0x5c2f32=buildLocalRuleToNameMappingFromJourney(_0x2fb261);_0x3ca754=buildMergedJourneyDef([{'item':_0x38cec6,'yaml':_0x5d5cfb}],_0x5c2f32,_0x5b87a3);}}addFoldersToCreate(_0x32a67c,_0x134df1[_0x381769(0x216)],_0x643a04);const _0x1d7c76=calculateJourneyDiff(_0x2fb261,_0x3ca754);_0x33acb9[_0x381769(0x272)]({'relativePath':_0x2fb261[_0x381769(0x228)],'absolutePath':_0x5daf0a,'yamlConfig':_0x2fb261,'folderPath':_0x32a67c,'existingJourney':_0x29ec97,'isNew':_0x1d7c76['isNew'],'hasChanges':_0x1d7c76['hasChanges'],'diff':_0x1d7c76['diff']});}return{'journeyFiles':_0x33acb9,'foldersToCreate':_0x643a04};}export function calculateActivationActions(_0x2f45b9,_0x253529,_0x306d53,_0x2577dd){const _0x11f0ae=a152_0xfcf5ee,_0x5df51f=[],_0x1f78c7=new Map();for(const _0xd5ff3e of _0x253529){_0x1f78c7[_0x11f0ae(0x25b)](_0xd5ff3e['name'],_0xd5ff3e);}const _0x32be90=new Map();for(const _0x6b04fc of _0x2f45b9){_0x32be90[_0x11f0ae(0x25b)](_0x6b04fc[_0x11f0ae(0x228)],_0x6b04fc);}for(const _0x14e49b of _0x2f45b9){const _0x2e216d=_0x1f78c7['get'](_0x14e49b[_0x11f0ae(0x228)]);if(!_0x2e216d)_0x5df51f[_0x11f0ae(0x272)]({'type':'create','name':_0x14e49b[_0x11f0ae(0x228)],'yamlActivation':_0x14e49b});else{const _0x3f8cc4=activationResponseToDef(_0x2e216d,_0x306d53,_0x2577dd),_0x45de60=a152_0x13ed94[_0x11f0ae(0x1f7)](_0x3f8cc4),_0x37bf18=a152_0x13ed94[_0x11f0ae(0x1f7)](_0x14e49b);_0x45de60!==_0x37bf18&&_0x5df51f[_0x11f0ae(0x272)]({'type':_0x11f0ae(0x238),'name':_0x14e49b['name'],'yamlActivation':_0x14e49b,'existingActivation':_0x2e216d});}}for(const _0x4df1e9 of _0x253529){!_0x32be90[_0x11f0ae(0x283)](_0x4df1e9[_0x11f0ae(0x228)])&&_0x5df51f[_0x11f0ae(0x272)]({'type':_0x11f0ae(0x2c7),'name':_0x4df1e9[_0x11f0ae(0x228)],'existingActivation':_0x4df1e9});}return _0x5df51f;}function calculateYamlDiff(_0x19e942,_0x2fd6be){if(_0x2fd6be){const _0x3ad9de=generateDiff(_0x2fd6be,_0x19e942),_0x8eba1c=hasChanges(_0x3ad9de);return{'isNew':![],'hasChanges':_0x8eba1c,'diff':_0x8eba1c?formatDiffWithColors(_0x3ad9de):undefined};}const _0x2ecd53=generateDiff('',_0x19e942);return{'isNew':!![],'hasChanges':![],'diff':formatDiffWithColors(_0x2ecd53)};}export function calculateSegmentDiff(_0x261032,_0x578733,_0x2cc445,_0x4b7b26,_0x1a8e06){const _0x576fb7=segmentToYamlString(_0x261032),_0x59b546=_0x578733?segmentToYamlString(segmentWithActivationsToYaml(_0x578733,_0x2cc445,undefined,_0x4b7b26,_0x1a8e06)):undefined;return calculateYamlDiff(_0x576fb7,_0x59b546);}export function calculateJourneyDiff(_0x2e7301,_0x554805){const _0x2b800c=normalizeJourneyDef(_0x2e7301,_0x2e7301),_0x46cb0f=a152_0x3cd3f6(_0x2b800c),_0x10ccb8=_0x554805?a152_0x3cd3f6(normalizeJourneyDef(_0x554805,_0x2e7301)):undefined;return calculateYamlDiff(_0x46cb0f,_0x10ccb8);}export function findSegmentsToDelete(_0x3469be,_0xb6ceee,_0x13eff8,_0x826213,_0x3cf05e){const _0x619fe8=a152_0xfcf5ee,_0x11eaf4=new Set();for(const {yamlConfig:_0x279a0a,folderPath:_0x558bca}of _0xb6ceee){_0x11eaf4['add'](_0x558bca+':'+_0x279a0a['name']);}return _0x3469be[_0x619fe8(0x263)](_0x352782=>{const _0x5c9ebb=_0x619fe8,_0x183b14=_0x352782[_0x5c9ebb(0x22f)]?_0x13eff8[_0x5c9ebb(0x29d)](_0x352782[_0x5c9ebb(0x22f)]['toString']())||'':'',_0x5ccdc1=_0x183b14+':'+_0x352782[_0x5c9ebb(0x228)];if(_0x11eaf4[_0x5c9ebb(0x283)](_0x5ccdc1))return![];if(_0x3cf05e)return _0x183b14===_0x826213||_0x183b14[_0x5c9ebb(0x257)](_0x826213+'/');return!![];});}export function findJourneysToDelete(_0x3a2e62,_0x1d76dc,_0x3e8a37,_0x26caff,_0xd0967a){const _0x2f3d96=a152_0xfcf5ee,_0x32e445=new Set();for(const {yamlConfig:_0x25aaa1,folderPath:_0x28d01c}of _0x1d76dc){_0x32e445[_0x2f3d96(0x231)](_0x28d01c+':'+_0x25aaa1[_0x2f3d96(0x228)]);}return _0x3a2e62['filter'](_0x524766=>{const _0x38ed68=_0x2f3d96,_0x4f8ecc=_0x524766[_0x38ed68(0x234)]?_0x3e8a37[_0x38ed68(0x29d)](_0x524766[_0x38ed68(0x234)])||'':'',_0x5c7e5d=_0x4f8ecc+':'+_0x524766[_0x38ed68(0x2d4)];if(_0x32e445[_0x38ed68(0x283)](_0x5c7e5d))return![];if(_0xd0967a)return _0x4f8ecc===_0x26caff||_0x4f8ecc[_0x38ed68(0x257)](_0x26caff+'/');return!![];});}export function buildSegmentLookupMap(_0x2feafb,_0x32f196){const _0x290d0f=a152_0xfcf5ee,_0x485c79=new Map();for(const _0x5e6d9e of _0x2feafb){const _0x2a5b8d=_0x5e6d9e[_0x290d0f(0x22f)]?_0x32f196['get'](_0x5e6d9e[_0x290d0f(0x22f)][_0x290d0f(0x249)]())||'':'',_0x2a5b76=_0x2a5b8d+':'+_0x5e6d9e[_0x290d0f(0x228)];_0x485c79['set'](_0x2a5b76,_0x5e6d9e);}return _0x485c79;}export function buildSegmentNameToIdMap(_0x124a87){const _0x25451b=a152_0xfcf5ee,_0x1501fb=new Map();for(const _0x2c28d5 of _0x124a87){_0x1501fb['set'](_0x2c28d5[_0x25451b(0x228)],_0x2c28d5['id']);}return _0x1501fb;}export function buildJourneyBundleLookupMap(_0x2c9eb7,_0x1742eb){const _0xa0ad86=a152_0xfcf5ee,_0x5c4687=new Map();for(const _0x278762 of _0x2c9eb7){const _0x5b1434=_0x278762[_0xa0ad86(0x234)]?_0x1742eb[_0xa0ad86(0x29d)](_0x278762[_0xa0ad86(0x234)])||'':'',_0x2f73d0=_0x5b1434+':'+_0x278762[_0xa0ad86(0x2d4)];!_0x5c4687[_0xa0ad86(0x283)](_0x2f73d0)&&_0x5c4687[_0xa0ad86(0x25b)](_0x2f73d0,[]),_0x5c4687[_0xa0ad86(0x29d)](_0x2f73d0)[_0xa0ad86(0x272)](_0x278762);}for(const _0x334b8f of _0x5c4687[_0xa0ad86(0x2ab)]()){_0x334b8f[_0xa0ad86(0x26f)]((_0x5ec7c3,_0x312bf0)=>(_0x5ec7c3[_0xa0ad86(0x22a)]||0x0)-(_0x312bf0[_0xa0ad86(0x22a)]||0x0));}return _0x5c4687;}export function collectFoldersToCreate(_0x4908bf,_0x1a28c9){const _0x2d5bac=a152_0xfcf5ee,_0x50dde2=new Set();for(const _0x380137 of _0x4908bf){if(!_0x380137)continue;if(_0x1a28c9[_0x2d5bac(0x283)](_0x380137))continue;const _0x5a2b74=_0x380137[_0x2d5bac(0x208)]('/');let _0x48f8cc='';for(const _0x26aada of _0x5a2b74){_0x48f8cc=_0x48f8cc?_0x48f8cc+'/'+_0x26aada:_0x26aada,!_0x1a28c9[_0x2d5bac(0x283)](_0x48f8cc)&&_0x50dde2[_0x2d5bac(0x231)](_0x48f8cc);}}return _0x50dde2;}export function parseAndClassifyYamlFiles(_0x169163,_0x585ec1,_0x812b5a){const _0x235632=a152_0xfcf5ee,_0x21236c=[],_0x62dd25=[];for(const _0x251bb7 of _0x169163){const _0x1ab21e=a152_0x4085cb[_0x235632(0x264)](_0x585ec1,a152_0x4085cb[_0x235632(0x2b2)](_0x251bb7)),_0x5538eb=_0x1ab21e==='.'?'':_0x1ab21e[_0x235632(0x2c1)](/\\/g,'/'),_0x48bd84=readFileSync(_0x251bb7,_0x235632(0x2ac)),_0x42a30d=a152_0x13ed94['parse'](_0x48bd84);if(isJourneyDef(_0x42a30d)){const _0x1a7d64=a152_0x1dedcf(_0x48bd84);_0x62dd25[_0x235632(0x272)]({'yamlConfig':_0x1a7d64,'folderPath':_0x5538eb,'sourcePath':_0x251bb7});}else{if(!_0x812b5a?.[_0x235632(0x2b4)]){const _0x28d770=parseSegmentYamlFile(_0x48bd84),_0x2e13c8=normalizeChildSegmentYaml(_0x28d770);_0x21236c[_0x235632(0x272)]({'yamlConfig':_0x2e13c8,'folderPath':_0x5538eb,'sourcePath':_0x251bb7});}}}return{'segments':_0x21236c,'journeys':_0x62dd25};}export function validateParsedFiles(_0x42f6ac,_0x5b8038){const _0x182d75=a152_0xfcf5ee,_0x363df7=[];for(const {yamlConfig:_0x66b281,sourcePath:_0x56c402}of _0x42f6ac['segments']){const _0x225f02=readFileSync(_0x56c402,_0x182d75(0x2ac)),_0x2ad7a0=a152_0x13ed94['parseDocument'](_0x225f02),_0x517482=validateSegmentDef(_0x66b281,{'source':_0x225f02,'document':_0x2ad7a0},{'skipSchema':!![]});if(!_0x517482[_0x182d75(0x2a6)]){const _0x566f5b=a152_0x4085cb[_0x182d75(0x264)](_0x5b8038,_0x56c402);_0x363df7[_0x182d75(0x272)]({'filePath':_0x566f5b,'source':_0x225f02,'result':_0x517482,'isJourney':![]});}}for(const {yamlConfig:_0xe64be8,sourcePath:_0x49ecbc}of _0x42f6ac[_0x182d75(0x230)]){const _0xc6d832=readFileSync(_0x49ecbc,'utf-8'),_0xe532e9=a152_0x13ed94[_0x182d75(0x1d8)](_0xc6d832),_0x471b0b=validateJourneyDef(_0xe64be8,{'source':_0xc6d832,'document':_0xe532e9},{'skipSchema':!![]});if(!_0x471b0b[_0x182d75(0x2a6)]){const _0xdd21b0=a152_0x4085cb[_0x182d75(0x264)](_0x5b8038,_0x49ecbc);_0x363df7[_0x182d75(0x272)]({'filePath':_0xdd21b0,'source':_0xc6d832,'result':_0x471b0b,'isJourney':!![]});}}return _0x363df7;}export function formatValidationErrors(_0x673f05){const _0x32a567=a152_0xfcf5ee,_0x411784=[];for(const {filePath:_0x23e038,source:_0xb2969e,result:_0x48a000,isJourney:_0x152332}of _0x673f05){const _0xa017a9=_0x152332?_0x32a567(0x1ef):_0x32a567(0x210);_0x411784[_0x32a567(0x272)]('\x0a'+_0x23e038+'\x20('+_0xa017a9+_0x32a567(0x200)+_0x48a000[_0x32a567(0x2be)][_0x32a567(0x221)]+_0x32a567(0x209)),_0x411784[_0x32a567(0x272)](formatValidationResult(_0x48a000,_0xb2969e,_0x23e038));}return _0x411784[_0x32a567(0x1fb)]('\x0a');}export function buildLocalExpandedRuleMappings(_0x2184c8){const _0x21ea13=a152_0xfcf5ee,_0x56f80c=new Set(),_0x1a4211=new Map(),_0x1c30ee=collectSegmentUsageCounts(_0x2184c8);if(_0x2184c8[_0x21ea13(0x21b)])for(const [_0x4fb848,_0x29235e]of Object[_0x21ea13(0x27f)](_0x2184c8[_0x21ea13(0x21b)])){_0x56f80c['add'](_0x4fb848);if(_0x29235e[_0x21ea13(0x278)]){const _0x4e53ec=yamlRuleToApi(_0x29235e[_0x21ea13(0x278)]),_0x1dec25=apiRuleToYaml(_0x4e53ec);_0x1a4211[_0x21ea13(0x25b)](_0x4fb848,_0x1dec25);}}const _0x43f8c4=new Map();let _0x1ff054=0x0;for(const [_0x5ba4dc,_0x250fbc]of _0x1a4211){const _0xb5c1e7=serializeExpandedRule(_0x250fbc,_0x1a4211),_0x4e0ea6=_0x43f8c4[_0x21ea13(0x29d)](_0xb5c1e7)||[];_0x4e0ea6[_0x21ea13(0x272)]({'name':_0x5ba4dc,'index':_0x1ff054}),_0x43f8c4[_0x21ea13(0x25b)](_0xb5c1e7,_0x4e0ea6),_0x1ff054++;}const _0x4e2688=new Map();for(const [_0x570bf5,_0x1c7204]of _0x43f8c4){const _0x5c21c5=_0x1c7204[_0x21ea13(0x299)]()['sort']((_0x101f6a,_0x1f5385)=>{const _0x1a3a31=_0x21ea13,_0x4cdcba=_0x1c30ee[_0x1a3a31(0x29d)](_0x101f6a['name'])||0x0,_0x4f3ddd=_0x1c30ee['get'](_0x1f5385['name'])||0x0;if(_0x4cdcba!==_0x4f3ddd)return _0x4f3ddd-_0x4cdcba;return _0x101f6a['index']-_0x1f5385['index'];})[_0x21ea13(0x232)](_0x152dd4=>_0x152dd4[_0x21ea13(0x228)]),_0xe25c9e=[];for(const _0x3ddae9 of _0x5c21c5){const _0x325573=_0x1c30ee['get'](_0x3ddae9)||0x0,_0x563132=Math[_0x21ea13(0x1e7)](_0x325573,0x1);for(let _0x4e7256=0x0;_0x4e7256<_0x563132;_0x4e7256++){_0xe25c9e[_0x21ea13(0x272)](_0x3ddae9);}}_0x4e2688[_0x21ea13(0x25b)](_0x570bf5,_0xe25c9e);}return{'existingLocalSegmentNames':_0x56f80c,'localSegmentRules':_0x1a4211,'localExpandedRuleToNames':_0x4e2688};}export function createSegmentIdResolver(_0x3f9d28,_0x1368cf){return async _0xfecc62=>{const _0x335c3c=a152_0x558f,_0x7b8243=_0x3f9d28[_0x335c3c(0x29d)](_0xfecc62);if(!_0x7b8243)throw new SDKError(ErrorCode['SEGMENT_NOT_FOUND'],_0x335c3c(0x21e)+_0xfecc62+'\x20(referenced\x20in\x20embedded\x20segment\x20\x27'+_0x1368cf+'\x27)');return _0x7b8243;};}export function extractRootFolderId(_0x172c32){const _0x3c572e=a152_0xfcf5ee;return _0x172c32['relationships']?.[_0x3c572e(0x22b)]?.[_0x3c572e(0x227)]?.['id']||_0x172c32[_0x3c572e(0x1df)]?.[_0x3c572e(0x2ad)]?.[_0x3c572e(0x227)]?.['id'];}export function buildConnectionMaps(_0x5e1df3){const _0x1f94ce=a152_0xfcf5ee,_0x1272b2=new Map(),_0x131f3e=new Map(),_0x1529e5=new Map();for(const _0x2d7848 of _0x5e1df3){_0x1272b2[_0x1f94ce(0x25b)](_0x2d7848[_0x1f94ce(0x228)],parseInt(_0x2d7848['id'],0xa)),_0x131f3e[_0x1f94ce(0x25b)](_0x2d7848['id'],_0x2d7848[_0x1f94ce(0x228)]),_0x1529e5[_0x1f94ce(0x25b)](_0x2d7848[_0x1f94ce(0x228)],_0x2d7848[_0x1f94ce(0x287)]);}return{'nameToId':_0x1272b2,'idToName':_0x131f3e,'nameToType':_0x1529e5};}export function calculatePushStats(_0x5f2926,_0x3738cc,_0x51695e,_0x266a33,_0x2deb70,_0x3ccc97,_0x1d4794){const _0x5ed940=a152_0xfcf5ee,_0x1d43d9=_0x5f2926[_0x5ed940(0x263)](_0x5993b5=>_0x5993b5[_0x5ed940(0x201)]),_0x39c507=_0x5f2926[_0x5ed940(0x263)](_0x4d5575=>!_0x4d5575[_0x5ed940(0x201)]&&_0x4d5575[_0x5ed940(0x2c6)]),_0x55a56b=_0x5f2926[_0x5ed940(0x263)](_0x7fe8b2=>!_0x7fe8b2[_0x5ed940(0x201)]&&!_0x7fe8b2[_0x5ed940(0x2c6)]),_0x27ebaa=_0x3ccc97?_0x266a33:[],_0x368ff4=_0x3738cc['filter'](_0x280e37=>_0x280e37[_0x5ed940(0x201)]),_0x1a81f8=_0x3738cc[_0x5ed940(0x263)](_0x28ee87=>!_0x28ee87['isNew']&&_0x28ee87['hasChanges']),_0x2f4f1a=_0x3738cc[_0x5ed940(0x263)](_0x44dec4=>!_0x44dec4[_0x5ed940(0x201)]&&!_0x44dec4[_0x5ed940(0x2c6)]),_0x43f815=_0x3ccc97?_0x2deb70:[],_0x583620=_0x5f2926['flatMap'](_0x3e16ad=>_0x3e16ad['activationActions']),_0x274900=_0x583620[_0x5ed940(0x263)](_0x1919a8=>_0x1919a8[_0x5ed940(0x287)]===_0x5ed940(0x2ba)),_0x2d33a3=_0x583620[_0x5ed940(0x263)](_0x1875aa=>_0x1875aa[_0x5ed940(0x287)]===_0x5ed940(0x238)),_0x47606d=_0x583620[_0x5ed940(0x263)](_0x2b3188=>_0x2b3188[_0x5ed940(0x287)]===_0x5ed940(0x2c7)),_0x27d32d=Array[_0x5ed940(0x1fc)](_0x51695e)[_0x5ed940(0x26f)](),_0xb21e39=_0x1d4794?![]:_0x1d43d9['length']>0x0||_0x39c507[_0x5ed940(0x221)]>0x0||_0x27ebaa[_0x5ed940(0x221)]>0x0,_0x2b7396=_0x368ff4['length']>0x0||_0x1a81f8[_0x5ed940(0x221)]>0x0||_0x43f815[_0x5ed940(0x221)]>0x0,_0x2a86b7=_0x1d4794?![]:_0x583620['length']>0x0,_0x54ebd8=_0x27d32d[_0x5ed940(0x221)]>0x0;return{'segments':{'new':_0x1d43d9,'changed':_0x39c507,'unchanged':_0x55a56b,'toDelete':_0x27ebaa},'journeys':{'new':_0x368ff4,'changed':_0x1a81f8,'unchanged':_0x2f4f1a,'toDelete':_0x43f815},'activations':{'all':_0x583620,'toCreate':_0x274900,'toUpdate':_0x2d33a3,'toDelete':_0x47606d},'folders':{'toCreate':_0x27d32d},'counts':{'segments':{'new':_0x1d43d9['length'],'changed':_0x39c507[_0x5ed940(0x221)],'unchanged':_0x55a56b[_0x5ed940(0x221)],'toDelete':_0x27ebaa[_0x5ed940(0x221)]},'journeys':{'new':_0x368ff4['length'],'changed':_0x1a81f8[_0x5ed940(0x221)],'unchanged':_0x2f4f1a[_0x5ed940(0x221)],'toDelete':_0x43f815[_0x5ed940(0x221)]},'activations':{'create':_0x274900['length'],'update':_0x2d33a3['length'],'delete':_0x47606d['length']},'folders':_0x27d32d[_0x5ed940(0x221)]},'hasChanges':_0xb21e39||_0x2b7396||_0x2a86b7||_0x54ebd8};}export async function buildPushExecutionContext(_0x3688a7,_0x31c91f,_0x512f26,_0x21aff8,_0x1b83b7,_0x39dccc){const _0x2ca59d=a152_0xfcf5ee,_0x36ef80=extractRootFolderId(_0x512f26),{pathToId:_0xc67e3d,idToPath:_0xbbbb79}=buildFolderMaps(_0x1b83b7),_0x2160b5=buildSegmentNameToIdMap(_0x21aff8),_0x510f74=new Map(),{batchAsync:_0x2fc373}=await import(_0x2ca59d(0x23d)),[_0x550161,_0x391c62]=await Promise[_0x2ca59d(0x26d)]([_0x3688a7['user']['buildUserMaps'](),_0x3688a7['connection'][_0x2ca59d(0x203)](),((async()=>{const _0x1153c2=_0x2ca59d;!_0x39dccc&&_0x21aff8[_0x1153c2(0x221)]>0x0&&await _0x2fc373(_0x21aff8,async _0x2acc92=>{const _0x22214a=_0x1153c2,_0x23563b=await _0x3688a7[_0x22214a(0x210)][_0x22214a(0x21f)](_0x31c91f,_0x2acc92['id']);_0x510f74[_0x22214a(0x25b)](_0x2acc92['id'],_0x23563b);});})())]),{emailToId:_0xf25753,idToEmail:_0xbaf910}=_0x550161,_0x530e98=buildConnectionMaps(_0x391c62);return{'rootFolderId':_0x36ef80,'folderPathToId':_0xc67e3d,'folderIdToPath':_0xbbbb79,'segmentNameToId':_0x2160b5,'activationsBySegmentId':_0x510f74,'emailToIdMap':_0xf25753,'idToEmailMap':_0xbaf910,'connectionNameToIdMap':_0x530e98[_0x2ca59d(0x2c9)],'connectionIdToNameMap':_0x530e98[_0x2ca59d(0x296)],'connectionNameToTypeMap':_0x530e98[_0x2ca59d(0x1da)]};}export function createPushYamlContextForBundle(_0x196406,_0x4abf85,_0x22d25a,_0x6881d5,_0x2e531f,_0x36fe95,_0x261f56,_0x320a29){const {existingLocalSegmentNames:_0x595d1b,localExpandedRuleToNames:_0x17bf99}=_0x6881d5,_0x3ba238=new Set(),_0x2c31e3=new Map(),_0x1ba6c1=new Map(),_0x3392c9=new Map(),_0x15a1a6=createJumpTargetCache(),_0x59a389=new Map(),_0x33109a=new Map(),_0x14e1ed=new Set();let _0x3d4576;const _0x3e7ca2=_0x14b0b8=>{const _0x4f4fda={'resolveSegment':async _0x5c2663=>{const _0x4703ec=a152_0x558f,_0x4b15fa=_0x3392c9[_0x4703ec(0x29d)](_0x5c2663);if(_0x4b15fa!==undefined)return{'name':_0x4b15fa,'isJourneyLocal':!![]};try{const _0x49bd62=await fetchSegment(_0x196406,_0x4abf85,_0x5c2663,_0x22d25a);if(!_0x49bd62)throw new Error(_0x4703ec(0x1f6));const _0x35569a=generateJourneyLocalName(_0x49bd62[_0x4703ec(0x228)]),_0x4758e2=_0x49bd62[_0x4703ec(0x1ed)]===SEGMENT_KIND_JOURNEY&&_0x35569a!==undefined;let _0x4da4a4=_0x49bd62[_0x4703ec(0x228)],_0xaa1ea1;if(_0x4758e2&&_0x49bd62['rule']){const _0x436a7d=apiRuleToYaml(_0x49bd62[_0x4703ec(0x278)]);_0x33109a['set'](_0x5c2663,_0x436a7d);const _0xa1b56=async _0x4f30e7=>{const _0x2ed6a0=_0x4703ec,_0x55a409=collectSegmentRefsFromRule(_0x4f30e7);for(const _0x5e48a7 of _0x55a409){if(!_0x33109a[_0x2ed6a0(0x283)](_0x5e48a7))try{const _0x3a8b29=await fetchSegment(_0x196406,_0x4abf85,_0x5e48a7,_0x22d25a);if(_0x3a8b29?.[_0x2ed6a0(0x278)]){const _0x3beb10=apiRuleToYaml(_0x3a8b29[_0x2ed6a0(0x278)]);_0x33109a[_0x2ed6a0(0x25b)](_0x5e48a7,_0x3beb10),await _0xa1b56(_0x3beb10);}}catch(_0x3bf49a){logger[_0x2ed6a0(0x2cc)](_0x2ed6a0(0x266)+_0x5e48a7+':\x20'+_0x3bf49a);}}};await _0xa1b56(_0x436a7d);const _0x3a4a9c=serializeExpandedRule(_0x436a7d,_0x33109a),_0xfda448=_0x17bf99[_0x4703ec(0x29d)](_0x3a4a9c);if(_0xfda448&&_0xfda448[_0x4703ec(0x221)]>0x0){const _0x230b19=_0x2c31e3[_0x4703ec(0x29d)](_0x3a4a9c)||0x0,_0x188368=_0xfda448[_0x230b19]||_0xfda448[_0xfda448[_0x4703ec(0x221)]-0x1];_0x2c31e3[_0x4703ec(0x25b)](_0x3a4a9c,_0x230b19+0x1),_0x4da4a4=_0x188368,_0x3ba238[_0x4703ec(0x231)](_0x4da4a4),_0x3392c9['set'](_0x5c2663,_0x4da4a4);const _0x2a0e21=await resolveRuleSegmentRefs(_0x436a7d,async _0x170e0a=>{const _0x43cd9b=_0x4703ec,_0x3d19fe=_0x3392c9[_0x43cd9b(0x29d)](_0x170e0a);if(_0x3d19fe)return _0x3d19fe;const _0x11b3d4=await _0x3d4576[_0x43cd9b(0x242)](_0x170e0a);return _0x11b3d4[_0x43cd9b(0x228)];});_0xaa1ea1={'description':_0x49bd62[_0x4703ec(0x224)],'rule':_0x2a0e21};}else{const _0x48df4d=_0x59a389['get'](_0x3a4a9c);if(_0x48df4d)_0x4da4a4=_0x48df4d,_0x3392c9[_0x4703ec(0x25b)](_0x5c2663,_0x4da4a4);else{if(_0x35569a){let _0x4c4b4d=_0x35569a,_0x513ff4=0x2;while(_0x3ba238[_0x4703ec(0x283)](_0x4c4b4d)||_0x595d1b[_0x4703ec(0x283)](_0x4c4b4d)){_0x4c4b4d=_0x35569a+'_'+_0x513ff4,_0x513ff4++;}_0x3ba238[_0x4703ec(0x231)](_0x4c4b4d),_0x4da4a4=_0x4c4b4d;}_0x3392c9['set'](_0x5c2663,_0x4da4a4),_0x59a389[_0x4703ec(0x25b)](_0x3a4a9c,_0x4da4a4);const _0x13a7b3=await resolveRuleSegmentRefs(_0x436a7d,async _0x395b69=>{const _0x179d26=_0x4703ec,_0x3841af=_0x3392c9['get'](_0x395b69);if(_0x3841af)return _0x3841af;const _0x163b62=await _0x3d4576['resolveSegment'](_0x395b69);return _0x163b62[_0x179d26(0x228)];});_0xaa1ea1={'description':_0x49bd62[_0x4703ec(0x224)],'rule':_0x13a7b3};}}}return{'name':_0x4da4a4,'isJourneyLocal':_0x4758e2,'definition':_0xaa1ea1};}catch(_0x1734c5){return logger[_0x4703ec(0x2cc)]('Failed\x20to\x20resolve\x20segment\x20'+_0x5c2663+':\x20'+_0x1734c5),{'name':_0x5c2663,'isJourneyLocal':![]};}},'resolveActivation':async _0x3848e4=>{const _0x125de8=a152_0x558f,_0x354b99=_0x1ba6c1['get'](_0x3848e4);if(_0x354b99!==undefined)return{'name':_0x354b99,'isJourneyLocal':!![]};try{let _0x481cc8=_0x261f56?.[_0x125de8(0x29d)](_0x3848e4);!_0x481cc8&&(_0x481cc8=await _0x196406[_0x125de8(0x1ef)]['getActivation'](_0x14b0b8,_0x3848e4));const _0x43b748=_0x481cc8['attributes'][_0x125de8(0x1f1)][_0x125de8(0x228)]||_0x3848e4,_0x4e2181=sanitizeYamlKey(_0x43b748)||_0x125de8(0x284)+_0x3848e4,_0x731368=_0x4e2181;_0x1ba6c1[_0x125de8(0x25b)](_0x3848e4,_0x731368);const _0x20591f=journeyActivationStepToYaml(_0x481cc8,_0x2e531f,_0x36fe95);return{'name':_0x731368,'isJourneyLocal':!![],'definition':_0x20591f};}catch(_0x133440){return logger[_0x125de8(0x2cc)](_0x125de8(0x212)+_0x3848e4+':\x20'+_0x133440),{'name':_0x3848e4,'isJourneyLocal':![]};}},'resolveJumpTarget':(_0x3d212d,_0x5805e)=>resolveJumpTarget(_0x3d212d,_0x5805e,_0x15a1a6,async _0x6c8d24=>{const _0x39adc3=a152_0x558f,_0x4cd3cc=_0x320a29?.[_0x39adc3(0x29d)](_0x6c8d24);if(_0x4cd3cc)return _0x4cd3cc;return _0x196406[_0x39adc3(0x1ef)]['getJourney'](_0x6c8d24);})};return _0x3d4576=_0x4f4fda,_0x4f4fda;},_0x20e878=async _0x200e01=>{const _0x7d0637=a152_0x558f,{collectSegmentIdsFromJourneyApi:_0x4b2036}=await import(_0x7d0637(0x25a)),{batchAsync:_0x27ca03}=await import('../../utils/async.js'),_0x10ba78=new Set();for(const _0x4e9c78 of _0x200e01){let _0x430bc2=_0x320a29?.[_0x7d0637(0x29d)](_0x4e9c78);!_0x430bc2&&(_0x430bc2=await _0x196406[_0x7d0637(0x1ef)]['getJourney'](_0x4e9c78));const _0x1a14a1=_0x4b2036(_0x430bc2);for(const _0x238983 of _0x1a14a1){_0x10ba78[_0x7d0637(0x231)](_0x238983);}}let _0x5d4c61=Array[_0x7d0637(0x1fc)](_0x10ba78);while(_0x5d4c61[_0x7d0637(0x221)]>0x0){const _0x13242c=_0x5d4c61['filter'](_0xd9bb37=>!_0x14e1ed[_0x7d0637(0x283)](_0xd9bb37));if(_0x13242c[_0x7d0637(0x221)]===0x0)break;const _0x158834=await _0x27ca03(_0x13242c,async _0xed6103=>{const _0x46a287=_0x7d0637;_0x14e1ed[_0x46a287(0x231)](_0xed6103);const _0x2bacff=await fetchSegment(_0x196406,_0x4abf85,_0xed6103,_0x22d25a);if(!_0x2bacff)return null;return{'segmentId':_0xed6103,'segment':_0x2bacff};},0xa),_0x3a03e2=new Set();for(const _0x3a2c9e of _0x158834){if(!_0x3a2c9e?.[_0x7d0637(0x210)]?.[_0x7d0637(0x278)])continue;const _0x66dade=apiRuleToYaml(_0x3a2c9e[_0x7d0637(0x210)][_0x7d0637(0x278)]);_0x33109a['set'](_0x3a2c9e[_0x7d0637(0x1eb)],_0x66dade);const _0x3499ab=collectSegmentRefsFromRule(_0x66dade);for(const _0x40a33b of _0x3499ab){!_0x14e1ed[_0x7d0637(0x283)](_0x40a33b)&&_0x3a03e2[_0x7d0637(0x231)](_0x40a33b);}}_0x5d4c61=Array[_0x7d0637(0x1fc)](_0x3a03e2);}};return{'createYamlContext':_0x3e7ca2,'prefetchJourneySegments':_0x20e878};}export async function executePushSegments(_0x48098e,_0x5ec59e,_0x5bac55,_0x2e4799,_0x3c4791){const _0x11ef36=a152_0xfcf5ee,{segmentDefToCreateRequest:_0x46660d,segmentDefToUpdateRequest:_0x4a23f8}=await import(_0x11ef36(0x29c)),_0x5b1292=_0x5bac55[_0x11ef36(0x216)],_0x236eaa=0x5,_0x995bfd=async _0x299db7=>{const _0x19890b=_0x11ef36,_0x275751=_0x299db7[_0x19890b(0x294)]?_0x5b1292['get'](_0x299db7[_0x19890b(0x294)]):undefined;let _0x1505aa;const _0x2d9a01={'created':0x0,'updated':0x0,'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};let _0x10b864=_0x299db7[_0x19890b(0x29e)];if(_0x299db7['yamlConfig'][_0x19890b(0x278)]){const _0x2b66b4=createSegmentIdResolver(_0x5bac55[_0x19890b(0x1e0)],_0x299db7['yamlConfig'][_0x19890b(0x228)]),_0x2636bf=await resolveRuleSegmentIds(_0x299db7[_0x19890b(0x29e)][_0x19890b(0x278)],_0x2b66b4);_0x10b864={..._0x299db7[_0x19890b(0x29e)],'rule':_0x2636bf};}try{if(_0x299db7[_0x19890b(0x201)]){_0x3c4791[_0x19890b(0x20e)]?.({'type':_0x19890b(0x25d),'name':_0x299db7['yamlConfig'][_0x19890b(0x228)]});const _0xec16c8=_0x46660d(_0x10b864,_0x275751),_0x4e8c59=await _0x3c4791[_0x19890b(0x2c5)](_0x19890b(0x2c0)+_0x299db7[_0x19890b(0x29e)][_0x19890b(0x228)]+_0x19890b(0x2ca),()=>_0x48098e[_0x19890b(0x210)][_0x19890b(0x247)](_0x2e4799['parentId'],_0xec16c8));_0x1505aa=_0x4e8c59[_0x19890b(0x227)]['id'],_0x5bac55[_0x19890b(0x1e0)][_0x19890b(0x25b)](_0x299db7[_0x19890b(0x29e)][_0x19890b(0x228)],_0x1505aa),_0x2d9a01[_0x19890b(0x255)]={'name':_0x299db7['yamlConfig'][_0x19890b(0x228)],'id':_0x1505aa},_0x3c4791[_0x19890b(0x20e)]?.({'type':_0x19890b(0x25e),'name':_0x299db7[_0x19890b(0x29e)][_0x19890b(0x228)],'segmentId':_0x1505aa}),_0x3c4791[_0x19890b(0x250)]?.(_0x19890b(0x1de)+_0x299db7[_0x19890b(0x29e)]['name']+'\x27'),_0x2d9a01[_0x19890b(0x28e)]=0x1;}else{if(_0x299db7[_0x19890b(0x2c6)]){_0x3c4791[_0x19890b(0x20e)]?.({'type':_0x19890b(0x23c),'name':_0x299db7[_0x19890b(0x29e)]['name']});const _0x47c9e0=_0x4a23f8(_0x10b864);_0x275751!==_0x299db7[_0x19890b(0x2af)]?.['segmentFolderId']&&(_0x47c9e0[_0x19890b(0x22f)]=_0x275751?parseInt(_0x275751,0xa):undefined),await _0x3c4791[_0x19890b(0x2c5)](_0x19890b(0x236)+_0x299db7[_0x19890b(0x29e)][_0x19890b(0x228)]+_0x19890b(0x2ca),()=>_0x48098e[_0x19890b(0x210)][_0x19890b(0x2da)](_0x2e4799[_0x19890b(0x2bc)],_0x299db7[_0x19890b(0x2af)]['id'],_0x47c9e0)),_0x1505aa=_0x299db7[_0x19890b(0x2af)]['id'],_0x3c4791[_0x19890b(0x20e)]?.({'type':'segment_updated','name':_0x299db7[_0x19890b(0x29e)][_0x19890b(0x228)]}),_0x3c4791[_0x19890b(0x250)]?.(_0x19890b(0x2a2)+_0x299db7[_0x19890b(0x29e)][_0x19890b(0x228)]+'\x27'),_0x2d9a01[_0x19890b(0x2dc)]=0x1;}else _0x1505aa=_0x299db7[_0x19890b(0x2af)]['id'];}}catch(_0x1268b7){const _0x3e1315=isHttp400Error(_0x1268b7),_0x56bb8f=_0x3e1315?ErrorCode[_0x19890b(0x267)]:ErrorCode[_0x19890b(0x1e5)],_0x47972d=getErrorMessage(_0x1268b7);throw new SDKError(_0x56bb8f,_0x19890b(0x281)+(_0x299db7['isNew']?_0x19890b(0x2ba):_0x19890b(0x238))+_0x19890b(0x293)+_0x299db7[_0x19890b(0x2b8)]+_0x19890b(0x1db)+_0x47972d,_0x1268b7);}try{const _0xb792e5=await syncActivationsForSegment(_0x48098e,_0x2e4799['parentId'],_0x1505aa,_0x299db7[_0x19890b(0x29e)][_0x19890b(0x228)],_0x299db7[_0x19890b(0x22e)],_0x3c4791,_0x299db7[_0x19890b(0x2b8)]);_0x2d9a01[_0x19890b(0x2c2)]=_0xb792e5;}catch(_0x9df35a){if(_0x9df35a instanceof SDKError)throw _0x9df35a;throw new SDKError(ErrorCode['ACTIVATION_UPDATE_ERROR'],_0x19890b(0x225)+_0x299db7[_0x19890b(0x29e)][_0x19890b(0x228)]+'\x27\x20from\x20file:\x20'+_0x299db7[_0x19890b(0x2b8)]+_0x19890b(0x1db)+getErrorMessage(_0x9df35a),_0x9df35a);}return _0x2d9a01;},_0xa17a55=await batchAsync(_0x5ec59e,_0x995bfd,_0x236eaa),_0x59d42d={'created':0x0,'updated':0x0,'deleted':0x0,'createdSegmentIds':new Map(),'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};for(const _0x21cdea of _0xa17a55){_0x59d42d['created']+=_0x21cdea[_0x11ef36(0x28e)],_0x59d42d[_0x11ef36(0x2dc)]+=_0x21cdea[_0x11ef36(0x2dc)],_0x21cdea[_0x11ef36(0x255)]&&_0x59d42d[_0x11ef36(0x252)][_0x11ef36(0x25b)](_0x21cdea[_0x11ef36(0x255)][_0x11ef36(0x228)],_0x21cdea[_0x11ef36(0x255)]['id']),_0x59d42d[_0x11ef36(0x2c2)]['created']+=_0x21cdea[_0x11ef36(0x2c2)][_0x11ef36(0x28e)],_0x59d42d[_0x11ef36(0x2c2)][_0x11ef36(0x2dc)]+=_0x21cdea[_0x11ef36(0x2c2)][_0x11ef36(0x2dc)],_0x59d42d[_0x11ef36(0x2c2)]['deleted']+=_0x21cdea['activations'][_0x11ef36(0x26b)];}return _0x59d42d;}async function syncActivationsForSegment(_0x1005cb,_0x33e7ce,_0x9c531c,_0x3c884e,_0x734894,_0x425042,_0x366124){const _0x404ee5=a152_0xfcf5ee,_0x227f2d={'created':0x0,'updated':0x0,'deleted':0x0};for(const _0x232b14 of _0x734894){try{if(_0x232b14[_0x404ee5(0x287)]==='create'&&_0x232b14[_0x404ee5(0x2cd)])_0x425042[_0x404ee5(0x20e)]?.({'type':_0x404ee5(0x20c),'segmentName':_0x3c884e,'activationName':_0x232b14['name']}),await _0x425042['withProgress'](_0x404ee5(0x1e9)+_0x232b14[_0x404ee5(0x228)]+_0x404ee5(0x2ca),()=>_0x1005cb[_0x404ee5(0x210)]['createActivation'](_0x33e7ce,_0x9c531c,_0x232b14[_0x404ee5(0x2cd)])),_0x425042[_0x404ee5(0x20e)]?.({'type':_0x404ee5(0x286),'segmentName':_0x3c884e,'activationName':_0x232b14[_0x404ee5(0x228)]}),_0x425042[_0x404ee5(0x250)]?.('Created\x20activation\x20\x27'+_0x232b14['name']+'\x27'),_0x227f2d[_0x404ee5(0x28e)]++;else{if(_0x232b14[_0x404ee5(0x287)]===_0x404ee5(0x238)&&_0x232b14[_0x404ee5(0x2cd)]&&_0x232b14[_0x404ee5(0x220)])_0x425042['onProgress']?.({'type':'activation_updating','segmentName':_0x3c884e,'activationName':_0x232b14[_0x404ee5(0x228)]}),await _0x425042[_0x404ee5(0x2c5)](_0x404ee5(0x274)+_0x232b14[_0x404ee5(0x228)]+_0x404ee5(0x2ca),()=>_0x1005cb['segment'][_0x404ee5(0x20a)](_0x33e7ce,_0x9c531c,_0x232b14[_0x404ee5(0x220)]['id'],_0x232b14[_0x404ee5(0x2cd)])),_0x425042[_0x404ee5(0x20e)]?.({'type':_0x404ee5(0x277),'segmentName':_0x3c884e,'activationName':_0x232b14[_0x404ee5(0x228)]}),_0x425042[_0x404ee5(0x250)]?.('Updated\x20activation\x20\x27'+_0x232b14[_0x404ee5(0x228)]+'\x27'),_0x227f2d['updated']++;else _0x232b14['type']===_0x404ee5(0x2c7)&&_0x232b14[_0x404ee5(0x220)]&&(_0x425042[_0x404ee5(0x20e)]?.({'type':_0x404ee5(0x26e),'segmentName':_0x3c884e,'activationName':_0x232b14[_0x404ee5(0x228)]}),await _0x425042[_0x404ee5(0x2c5)]('Deleting\x20activation\x20\x27'+_0x232b14[_0x404ee5(0x228)]+_0x404ee5(0x2ca),()=>_0x1005cb['segment'][_0x404ee5(0x2de)](_0x33e7ce,_0x9c531c,_0x232b14[_0x404ee5(0x220)]['id'])),_0x425042['onProgress']?.({'type':'activation_deleted','segmentName':_0x3c884e,'activationName':_0x232b14[_0x404ee5(0x228)]}),_0x425042[_0x404ee5(0x2d2)]?.(_0x404ee5(0x292)+_0x232b14['name']+'\x27'),_0x227f2d[_0x404ee5(0x26b)]++);}}catch(_0x1df12d){const _0x243f72=isHttp400Error(_0x1df12d),_0x58883c=_0x243f72?ErrorCode[_0x404ee5(0x1e3)]:ErrorCode[_0x404ee5(0x1ea)],_0x2484ce=getErrorMessage(_0x1df12d);throw new SDKError(_0x58883c,'Failed\x20to\x20'+_0x232b14[_0x404ee5(0x287)]+_0x404ee5(0x233)+_0x232b14[_0x404ee5(0x228)]+_0x404ee5(0x214)+_0x366124+'\x0a\x20\x20'+_0x2484ce,_0x1df12d);}}return _0x227f2d;}export async function executePushFolders(_0xaf549f,_0x19f8c9,_0x5c4385,_0x19b89e,_0x41cfa0){const _0x47ecf3=a152_0xfcf5ee,_0xe2ce3f=new Map(_0x5c4385),_0xfafd8b=sortFoldersByDepth(_0x19f8c9);for(const _0xcc6967 of _0xfafd8b){const _0xedc532=_0xcc6967[_0x47ecf3(0x208)]('/'),_0x5d85ce=_0xedc532[_0xedc532[_0x47ecf3(0x221)]-0x1],_0xc6c405=_0xedc532[_0x47ecf3(0x299)](0x0,-0x1)[_0x47ecf3(0x1fb)]('/'),_0x4dd107=_0xe2ce3f['get'](_0xc6c405);_0x41cfa0[_0x47ecf3(0x20e)]?.({'type':_0x47ecf3(0x1f2),'folder':_0xcc6967});const _0x151338={'name':_0x5d85ce,'parentFolderId':_0x4dd107},_0x319ab3=await _0x41cfa0[_0x47ecf3(0x2c5)](_0x47ecf3(0x2a9)+_0xcc6967+_0x47ecf3(0x2ca),()=>_0xaf549f['segment']['createFolder'](_0x19b89e['parentId'],_0x151338));_0xe2ce3f[_0x47ecf3(0x25b)](_0xcc6967,_0x319ab3[_0x47ecf3(0x227)]['id']),_0x41cfa0[_0x47ecf3(0x20e)]?.({'type':'folder_created','folder':_0xcc6967,'folderId':_0x319ab3[_0x47ecf3(0x227)]['id']}),_0x41cfa0[_0x47ecf3(0x258)]?.(_0x47ecf3(0x1e2)+_0xcc6967+'\x27');}return _0xe2ce3f;}export async function executePushSegmentDeletions(_0x2956a9,_0x243c7c,_0x47e8a0){const _0x566bee=a152_0xfcf5ee;if(_0x243c7c['length']===0x0)return 0x0;const {batchAsync:_0x3a68d2}=await import(_0x566bee(0x23d)),_0x5f1e5e=0x5,_0xc46570=await _0x3a68d2(_0x243c7c,async _0x28763b=>{const _0x5ac78e=_0x566bee;return _0x47e8a0[_0x5ac78e(0x20e)]?.({'type':_0x5ac78e(0x2a1),'name':_0x28763b[_0x5ac78e(0x228)]}),await _0x2956a9['segment'][_0x5ac78e(0x22c)](_0x28763b['id']),_0x47e8a0[_0x5ac78e(0x20e)]?.({'type':_0x5ac78e(0x2bd),'name':_0x28763b[_0x5ac78e(0x228)]}),_0x47e8a0['logDeleted']?.(_0x5ac78e(0x2a5)+_0x28763b['name']+'\x27'),0x1;},_0x5f1e5e);return _0xc46570[_0x566bee(0x27a)]((_0x2f889a,_0x3f33f3)=>_0x2f889a+_0x3f33f3,0x0);}export async function executePushJourneys(_0x3c3388,_0x1a7832,_0x4a64f4,_0x36f317,_0x184109){const _0x5cf60e=a152_0xfcf5ee,{journeyDefToRequest:_0x39b388}=await import(_0x5cf60e(0x25a)),{activationDefToCreateRequest:_0x42ab69,yamlRuleToApi:_0x44d394,validateSegmentRule:_0x3218a4}=await import(_0x5cf60e(0x29c)),_0x4c8d2b={'results':[],'created':0x0,'updated':0x0,'embeddedSegmentNameToId':new Map()},_0x1b086e=new Map(_0x4a64f4[_0x5cf60e(0x1e0)]),_0x3da2b1=0x5;for(let _0x15bd8e=0x0;_0x15bd8e<_0x1a7832[_0x5cf60e(0x221)];_0x15bd8e+=_0x3da2b1){const _0x173e79=_0x1a7832[_0x5cf60e(0x299)](_0x15bd8e,_0x15bd8e+_0x3da2b1),_0x4e918c=await Promise[_0x5cf60e(0x26d)](_0x173e79['map'](async _0x299fa1=>{const _0x44a907=_0x5cf60e;if(!_0x299fa1[_0x44a907(0x201)]&&!_0x299fa1[_0x44a907(0x2c6)])return{'action':_0x44a907(0x1fd),'name':_0x299fa1[_0x44a907(0x29e)][_0x44a907(0x228)],'journeyId':_0x299fa1[_0x44a907(0x2d8)]?.['id']};const _0x271167=_0x299fa1[_0x44a907(0x294)]?_0x4a64f4['folderPathToId'][_0x44a907(0x29d)](_0x299fa1[_0x44a907(0x294)]):undefined;_0x184109[_0x44a907(0x20e)]?.({'type':_0x299fa1['isNew']?_0x44a907(0x1ff):_0x44a907(0x2a4),'name':_0x299fa1[_0x44a907(0x29e)][_0x44a907(0x228)]});try{const _0xf3d0c8=await executeSingleJourneyPush(_0x3c3388,_0x299fa1,{..._0x4a64f4,'segmentNameToId':_0x1b086e},{'parentId':_0x36f317[_0x44a907(0x2bc)],'rootFolderId':_0x36f317[_0x44a907(0x207)],'folderId':_0x271167,'verbose':_0x36f317[_0x44a907(0x22d)]},_0x184109,{'journeyDefToRequest':_0x39b388,'activationDefToCreateRequest':_0x42ab69,'yamlRuleToApi':_0x44d394,'validateSegmentRule':_0x3218a4});for(const [_0x52c47a,_0x1c2fe5]of _0xf3d0c8[_0x44a907(0x219)]){_0x1b086e[_0x44a907(0x25b)](_0x52c47a,_0x1c2fe5),_0x4c8d2b[_0x44a907(0x219)][_0x44a907(0x25b)](_0x52c47a,_0x1c2fe5);}if(_0xf3d0c8[_0x44a907(0x25f)]===_0x44a907(0x28e))_0x184109['onProgress']?.({'type':_0x44a907(0x1e6),'name':_0x299fa1['yamlConfig'][_0x44a907(0x228)],'journeyId':_0xf3d0c8['journeyId']}),_0x184109[_0x44a907(0x250)]?.('Created\x20journey\x20\x27'+_0x299fa1[_0x44a907(0x29e)][_0x44a907(0x228)]+'\x27'),_0x4c8d2b[_0x44a907(0x28e)]++;else _0xf3d0c8['action']==='updated'&&(_0x184109['onProgress']?.({'type':'journey_updated','name':_0x299fa1[_0x44a907(0x29e)][_0x44a907(0x228)]}),_0x184109['logSuccess']?.(_0x44a907(0x2cb)+_0x299fa1[_0x44a907(0x29e)][_0x44a907(0x228)]+'\x27'),_0x4c8d2b[_0x44a907(0x2dc)]++);return{'action':_0xf3d0c8[_0x44a907(0x25f)],'name':_0x299fa1['yamlConfig']['name'],'journeyId':_0xf3d0c8[_0x44a907(0x280)]};}catch(_0x17c59b){const _0x18da2d=isHttp400Error(_0x17c59b),_0x4b3a22=_0x18da2d?ErrorCode[_0x44a907(0x2b1)]:ErrorCode[_0x44a907(0x2b6)],_0xdb04e8=getErrorMessage(_0x17c59b);throw new SDKError(_0x4b3a22,_0x44a907(0x281)+(_0x299fa1[_0x44a907(0x201)]?_0x44a907(0x2ba):_0x44a907(0x238))+_0x44a907(0x223)+_0x299fa1[_0x44a907(0x2b8)]+_0x44a907(0x1db)+_0xdb04e8,_0x17c59b);}}));_0x4c8d2b[_0x5cf60e(0x2b5)]['push'](..._0x4e918c);}return _0x4c8d2b;}function a152_0x2821(){const _0x5a33a5=['startsWith','logInfo','keys','./journey-yaml.js','set','journeyBundleId','segment_creating','segment_created','action','journey_entry_criteria_','embedded_activation_creating','logWarning','filter','relative','folder','Failed\x20to\x20fetch\x20referenced\x20segment\x20','SEGMENT_SYNTAX_ERROR','getSegment\x20failed\x20for\x20','stage\x20\x27','goal','deleted','fetchJourney','all','activation_deleting','sort','\x20(referenced\x20in\x20journey\x20','all_columns','push','12521570oSHSFg','Updating\x20activation\x20\x27','104rGlIOc','\x27\x20for\x20','activation_updated','rule','WaitStep','reduce','\x27\x20decision\x20point\x20branch\x20\x27',').\x20','Condition','activationStepsById','entries','journeyId','Failed\x20to\x20','entry','has','activation_','waitStepUnit','activation_created','type','__pending_act_','state','\x27\x20wait\x20condition','run_after_journey_refresh','createJourneySegment','Journey\x20\x27','created','hex','4lZrETA','Stage\x20\x27','Deleted\x20activation\x20\x27','\x20segment\x20from\x20file:\x20','folderPath','yamlActivation','idToName','journeyById','10003oxAyxZ','slice','some','Warning:\x20Could\x20not\x20resolve\x20embedded\x20segment\x20\x27','./child-segment-yaml.js','get','yamlConfig','journeyName','\x27\x20already\x20exists\x20on\x20server\x20but\x20cannot\x20be\x20found.\x20','segment_deleting','Updated\x20segment\x20\x27','message','journey_updating','Deleted\x20segment\x20\x27','valid','exitCriterias','708678ihOYwn','Creating\x20folder\x20\x27','resolvedRule','values','utf-8','parentFolder','376302TWorwo','existingSegment','1629122oRiTny','JOURNEY_SYNTAX_ERROR','dirname','connection','skipSegments','results','JOURNEY_UPDATE_ERROR','journeyStages','absolutePath','entryCriteria','create','attributes','parentId','segment_deleted','errors','connectionIdToNameMap','Creating\x20segment\x20\x27','replace','activations','behavior','effectiveFolderId','withProgress','hasChanges','delete','3954zPcJwy','nameToId','\x27...','Updated\x20journey\x20\x27','debug','validatedRequest','activationContext','draft','Delete\x20the\x20push\x20recovery\x20file\x20(',',\x20falling\x20back\x20to\x20getSegmentEntity:\x20','logDeleted','\x27\x20by\x20rule\x20content','journeyBundleName','diff','existingSegments','steps','existingJourney','columns','updateSegmentById','conditionTimeoutDuration','updated','conditions','deleteActivation','parseDocument','schedule','nameToType','\x0a\x20\x20','\x27\x20not\x20found\x20in\x20journey\x20\x27','activationsBySegmentId','Created\x20segment\x20\x27','relationships','segmentNameToId','waitStepType','Created\x20folder\x20\x27','ACTIVATION_SYNTAX_ERROR','Matched\x20server\x20segment\x20\x27','SEGMENT_UPDATE_ERROR','journey_created','max','includes','Creating\x20activation\x20\x27','ACTIVATION_UPDATE_ERROR','segmentId','connector_config','kind','parse','journey','journeyActivationNameToId','activationParams','folder_creating','decision_point','activation_template_id','entry_criteria','Segment\x20not\x20found','stringify','Entry\x20criteria:\x20','object','getLatestJourneyId','join','from','unchanged','INTERNAL','journey_creating','):\x20','isNew','\x27\x20entry\x20criteria','list','593CMAptw','142htcWtE','journeyBundlesByFolderAndName','rootFolderId','split','\x20error(s)','updateActivation','Fetching\x20','activation_creating','toLowerCase','onProgress','match','segment','size','Failed\x20to\x20resolve\x20activation\x20','isArray','\x27\x20from\x20file:\x20','journeyActivationStepId','folderPathToId','getSegmentEntity','toISOString','embeddedSegmentNameToId','Activation','segments','sha1','NOT_FOUND','Segment\x20not\x20found:\x20','listActivations','existingActivation','length','embedded_segment_created','\x20journey\x20from\x20file:\x20','description','Failed\x20to\x20sync\x20activations\x20for\x20segment\x20\x27','conditionTimeoutUnit','data','name','waitStep','versionNumber','parentSegmentFolder','deleteSegment','verbose','activationActions','segmentFolderId','journeys','add','map','\x20activation\x20\x27','folderId','\x27\x20to\x20local\x20\x27','Updating\x20segment\x20\x27','localName','update','idToEmailMap','uniqueServerName','getJourney','segment_updating','../../utils/async.js','branches','DecisionPoint','find','Activation\x20not\x20found:\x20','resolveSegment','132FSisfZ','SEGMENT_NOT_FOUND','deps','conditionSegmentId','createSegment','null','toString','Cannot\x20create\x20embedded\x20activation\x20without\x20journey\x20context','createActivation','\x27\x20not\x20found\x20in\x20parent\x20segment\x20(referenced\x20in\x20jump\x20step\x20of\x20\x27','Duration','milestone','stages','logSuccess','Define\x20it\x20in\x20the\x20journey\x27s\x20\x27activations\x27\x20section\x20or\x20use\x20an\x20existing\x20activation\x20ID.','createdSegmentIds','uniqueSegmentName','8712745HfpQMg','createdSegmentId','progress'];a152_0x2821=function(){return _0x5a33a5;};return a152_0x2821();}async function matchExistingJourneySegments(_0x2f8670,_0x1dc256,_0x15154f,_0x2da0ae,_0x36c25a){const _0x1c3d70=a152_0xfcf5ee;if(!_0x1dc256[_0x1c3d70(0x2d8)]||!_0x1dc256[_0x1c3d70(0x29e)][_0x1c3d70(0x21b)])return;const _0xafaa2f=new Map(),_0x2f16a0=new Set();for(const _0x479073 of Object[_0x1c3d70(0x259)](_0x1dc256[_0x1c3d70(0x29e)][_0x1c3d70(0x21b)])){const _0xb3646b=generateDeterministicJourneySegmentName(_0x1dc256[_0x1c3d70(0x29e)][_0x1c3d70(0x228)],_0x479073);_0xafaa2f['set'](_0xb3646b,_0x479073),_0x2f16a0[_0x1c3d70(0x231)](_0x479073);}const _0x535d51=[],_0x1cd723=collectSegmentIdsFromJourneyApi(_0x1dc256[_0x1c3d70(0x2d8)]);for(const _0x2fa81c of _0x1cd723){const _0x13e7ed=await fetchSegment(_0x2f8670,_0x15154f,_0x2fa81c,_0x2da0ae);if(!_0x13e7ed?.[_0x1c3d70(0x228)])continue;const _0x1a5f56=_0xafaa2f['get'](_0x13e7ed[_0x1c3d70(0x228)]);_0x1a5f56?(_0x36c25a[_0x1c3d70(0x25b)](_0x1a5f56,_0x2fa81c),_0x2f16a0[_0x1c3d70(0x2c7)](_0x1a5f56)):_0x535d51[_0x1c3d70(0x272)]({'id':_0x2fa81c,'seg':_0x13e7ed});}if(_0x2f16a0[_0x1c3d70(0x211)]>0x0&&_0x535d51['length']>0x0){const {localExpandedRuleToNames:_0x569b22}=buildLocalExpandedRuleMappings(_0x1dc256[_0x1c3d70(0x29e)]),_0x47c591=new Map();for(const {id:_0x429907,seg:_0x5c75d7}of _0x535d51){if(_0x5c75d7[_0x1c3d70(0x278)]){const _0x3313c7=apiRuleToYaml(_0x5c75d7[_0x1c3d70(0x278)]);_0x47c591[_0x1c3d70(0x25b)](_0x429907,_0x3313c7);}}for(const {id:_0x4d9041,seg:_0x49c0c0}of _0x535d51){if(!_0x49c0c0[_0x1c3d70(0x278)])continue;const _0x24cfa2=_0x47c591[_0x1c3d70(0x29d)](_0x4d9041);if(!_0x24cfa2)continue;const _0x5714e4=serializeExpandedRule(_0x24cfa2,_0x47c591),_0x379cfd=_0x569b22['get'](_0x5714e4);if(_0x379cfd){const _0x45adfe=_0x379cfd[_0x1c3d70(0x240)](_0x158214=>_0x2f16a0[_0x1c3d70(0x283)](_0x158214));_0x45adfe&&(_0x36c25a[_0x1c3d70(0x25b)](_0x45adfe,_0x4d9041),_0x2f16a0['delete'](_0x45adfe),logger[_0x1c3d70(0x2cc)](_0x1c3d70(0x1e4)+_0x49c0c0[_0x1c3d70(0x228)]+_0x1c3d70(0x235)+_0x45adfe+_0x1c3d70(0x2d3)));}}}}async function executeSingleJourneyPush(_0x3d63e2,_0x4b7f73,_0x34fdc0,_0xebc06f,_0x3964cc,_0x548429){const _0x5b6ca1=a152_0xfcf5ee,{journeyDefToRequest:_0x1c9166,activationDefToCreateRequest:_0x322b6c,yamlRuleToApi:_0x14473a,validateSegmentRule:_0x25b43e}=_0x548429,_0x4efa2f=new Map(),_0x10df48=new Map();recoverSegmentIdsFromPushRecovery(_0x4b7f73,_0x4efa2f,_0x34fdc0[_0x5b6ca1(0x1e0)]);const _0xc50bf5=new Map(),_0x2fb2b4=new Map(),_0x3767b6=new Map();let _0x3afbed;const _0x2b1b07=async()=>{const _0x1bf767=_0x5b6ca1;if(_0x3afbed)return;_0x3afbed=new Map();if(!_0x4b7f73['existingJourney'])return;const _0x42d193=await _0x3d63e2[_0x1bf767(0x1ef)][_0x1bf767(0x21f)](_0x4b7f73[_0x1bf767(0x2d8)]['id']);for(const _0x462cd0 of _0x42d193){const _0x3854c0=journeyActivationStepToYaml(_0x462cd0,_0x34fdc0[_0x1bf767(0x239)],_0x34fdc0['connectionIdToNameMap']),_0x48826b=activationSignature(_0x3854c0);!_0x3afbed[_0x1bf767(0x283)](_0x48826b)&&_0x3afbed[_0x1bf767(0x25b)](_0x48826b,_0x462cd0['id']),_0x3854c0[_0x1bf767(0x228)]&&_0x10df48[_0x1bf767(0x25b)](_0x3854c0[_0x1bf767(0x228)],_0x462cd0['id']);}};await matchExistingJourneySegments(_0x3d63e2,_0x4b7f73,_0xebc06f[_0x5b6ca1(0x2bc)],_0x34fdc0['existingSegments'],_0x34fdc0[_0x5b6ca1(0x1e0)]);const _0x59f123={'resolveSegmentId':async _0x2979a8=>{const _0xd94c62=_0x5b6ca1,_0x16df86=_0x34fdc0[_0xd94c62(0x1e0)][_0xd94c62(0x29d)](_0x2979a8);if(!_0x16df86)throw new SDKError(ErrorCode[_0xd94c62(0x244)],_0xd94c62(0x21e)+_0x2979a8+_0xd94c62(0x270)+_0x4b7f73[_0xd94c62(0x29e)][_0xd94c62(0x228)]+')');return _0x16df86;},'resolveEmbeddedSegmentId':async(_0x173571,_0x4ec2be)=>{const _0x599d87=_0x5b6ca1,_0x5181be=_0x34fdc0[_0x599d87(0x1e0)][_0x599d87(0x29d)](_0x173571);if(_0x5181be)return _0x5181be;const _0xd26448=_0x34fdc0[_0x599d87(0x2d6)][_0x599d87(0x240)](_0x5d58dd=>_0x5d58dd[_0x599d87(0x228)]===_0x173571);if(_0xd26448)return _0x34fdc0[_0x599d87(0x1e0)][_0x599d87(0x25b)](_0x173571,_0xd26448['id']),_0xd26448['id'];if(_0x4b7f73[_0x599d87(0x201)]){const {stageName:_0x4071b7,criteriaName:_0x1848aa}=findSegmentCriteriaLocation(_0x4b7f73[_0x599d87(0x29e)],_0x173571);return _0x25b43e(_0x173571,_0x4ec2be[_0x599d87(0x278)]),_0x2fb2b4[_0x599d87(0x25b)](_0x173571,{'definition':_0x4ec2be,'stageName':_0x4071b7,'criteriaName':_0x1848aa}),createPendingSegmentId(_0x173571);}const _0x4bb6e3=_0x4b7f73[_0x599d87(0x2d8)]?.['id'];if(!_0x4bb6e3)throw new SDKError(ErrorCode[_0x599d87(0x1fe)],'Cannot\x20create\x20embedded\x20segment\x20for\x20existing\x20journey\x20without\x20journey\x20ID');const _0xf9adb0=_0xc50bf5[_0x599d87(0x29d)](_0x173571);if(_0xf9adb0)return _0xf9adb0;const _0x101a44=((async()=>{const _0x46aa15=_0x599d87;_0x25b43e(_0x173571,_0x4ec2be[_0x46aa15(0x278)]);const _0x14544d=generateDeterministicJourneySegmentName(_0x4b7f73['yamlConfig'][_0x46aa15(0x228)],_0x173571),_0xd812b0=_0x34fdc0[_0x46aa15(0x2d6)][_0x46aa15(0x240)](_0x28dc79=>_0x28dc79['name']===_0x14544d),_0x53b5d9=createSegmentIdResolver(_0x34fdc0[_0x46aa15(0x1e0)],_0x173571),_0x155028=await resolveRuleSegmentIds(_0x4ec2be[_0x46aa15(0x278)],_0x53b5d9);let _0x592ba4;return _0xd812b0?(await _0x3d63e2[_0x46aa15(0x210)]['updateSegmentById'](_0xebc06f[_0x46aa15(0x2bc)],_0xd812b0['id'],{'description':_0x4ec2be[_0x46aa15(0x224)]||_0x46aa15(0x1f8)+_0x173571,'rule':_0x14473a(_0x155028),'countPopulation':!![]}),_0x592ba4=_0xd812b0['id'],saveSegmentToPushRecovery(_0x4b7f73[_0x46aa15(0x2b8)],_0x4b7f73['yamlConfig'][_0x46aa15(0x228)],_0x173571,{'segmentId':_0x592ba4,'uniqueServerName':_0x14544d,'createdAt':new Date()[_0x46aa15(0x218)]()})):_0x592ba4=await createOrRecoverEmbeddedSegment(_0x3d63e2,_0x4b7f73,{'localName':_0x173571,'uniqueSegmentName':_0x14544d,'description':_0x4ec2be[_0x46aa15(0x224)]||'Entry\x20criteria:\x20'+_0x173571,'journeyId':_0x4bb6e3,'resolvedRule':_0x155028,'parentId':_0xebc06f['parentId'],'folderId':_0xebc06f[_0x46aa15(0x207)]||''},_0x14473a),_0x34fdc0[_0x46aa15(0x1e0)][_0x46aa15(0x25b)](_0x173571,_0x592ba4),_0x4efa2f[_0x46aa15(0x25b)](_0x173571,_0x592ba4),_0x592ba4;})());_0xc50bf5[_0x599d87(0x25b)](_0x173571,_0x101a44);try{return await _0x101a44;}finally{_0xc50bf5[_0x599d87(0x2c7)](_0x173571);}},'resolveActivationId':async _0x839431=>{const _0x28890c=_0x5b6ca1,_0x476b01=_0x10df48[_0x28890c(0x29d)](_0x839431);if(_0x476b01)return _0x476b01;if(_0x4b7f73[_0x28890c(0x2d8)]){await _0x2b1b07();const _0x42fffd=_0x10df48[_0x28890c(0x29d)](_0x839431);if(_0x42fffd)return _0x42fffd;}throw new SDKError(ErrorCode['NOT_FOUND'],_0x28890c(0x241)+_0x839431+'\x20(referenced\x20in\x20journey\x20'+_0x4b7f73[_0x28890c(0x29e)][_0x28890c(0x228)]+_0x28890c(0x27c)+_0x28890c(0x251));},'resolveEmbeddedActivationId':async(_0x3d77b8,_0x5e64f6)=>{const _0x2a674c=_0x5b6ca1,_0x130ad0=_0x10df48['get'](_0x3d77b8);if(_0x130ad0)return _0x130ad0;if(_0x4b7f73[_0x2a674c(0x201)])return _0x3767b6['set'](_0x3d77b8,_0x5e64f6),createPendingActivationId(_0x3d77b8);if(_0x4b7f73[_0x2a674c(0x2d8)]){await _0x2b1b07();const _0x2e181d=_0x10df48[_0x2a674c(0x29d)](_0x5e64f6[_0x2a674c(0x228)]);if(_0x2e181d)return _0x10df48['set'](_0x3d77b8,_0x2e181d),_0x2e181d;const _0x118e65=activationSignature(_0x5e64f6),_0x1d2386=_0x3afbed?.[_0x2a674c(0x29d)](_0x118e65);if(_0x1d2386)return _0x10df48[_0x2a674c(0x25b)](_0x3d77b8,_0x1d2386),_0x1d2386;const _0x357359=await _0x322b6c(_0x5e64f6,_0x34fdc0[_0x2a674c(0x2ce)]),_0x441893={..._0x357359,..._0x5e64f6[_0x2a674c(0x28b)]!==undefined&&{'runAfterJourneyRefresh':_0x5e64f6['run_after_journey_refresh']}},_0x24628d=await _0x3d63e2[_0x2a674c(0x1ef)][_0x2a674c(0x24b)](_0x4b7f73[_0x2a674c(0x2d8)]['id'],_0x441893);return _0x10df48[_0x2a674c(0x25b)](_0x3d77b8,_0x24628d['id']),_0x24628d['id'];}throw new SDKError(ErrorCode[_0x2a674c(0x1fe)],_0x2a674c(0x24a));},'resolveJourneyId':async _0xe6adc1=>{const _0xe5db8e=_0x5b6ca1;try{return await _0x3d63e2['journey']['resolveJourneyId'](_0xebc06f[_0xe5db8e(0x2bc)],_0xe6adc1);}catch(_0x570757){throw new SDKError(ErrorCode['NOT_FOUND'],_0xe5db8e(0x28d)+_0xe6adc1+_0xe5db8e(0x24c)+_0x4b7f73['yamlConfig'][_0xe5db8e(0x228)]+'\x27)',_0x570757);}},'resolveStageId':async(_0x4cd150,_0x448a98)=>{const _0x25ecc0=_0x5b6ca1,_0x27f783=await _0x3d63e2[_0x25ecc0(0x1ef)][_0x25ecc0(0x23b)](_0x4cd150),_0x493870=_0x27f783[_0x25ecc0(0x2bb)][_0x25ecc0(0x2b7)][_0x25ecc0(0x240)](_0x3c6e5f=>_0x3c6e5f[_0x25ecc0(0x228)][_0x25ecc0(0x20d)]()===_0x448a98[_0x25ecc0(0x20d)]());if(!_0x493870?.['id'])throw new SDKError(ErrorCode[_0x25ecc0(0x21d)],_0x25ecc0(0x291)+_0x448a98+_0x25ecc0(0x1dc)+(_0x27f783['attributes'][_0x25ecc0(0x2d4)]||_0x27f783[_0x25ecc0(0x2bb)][_0x25ecc0(0x228)])+'\x27');return _0x493870['id'];}},_0xa930b8=await _0x1c9166(_0x4b7f73[_0x5b6ca1(0x29e)],_0xebc06f[_0x5b6ca1(0x2bc)],_0x59f123),_0x3c51ef=_0xebc06f[_0x5b6ca1(0x234)]||_0xebc06f[_0x5b6ca1(0x207)];_0x3c51ef&&(_0xa930b8[_0x5b6ca1(0x1df)]={'parentFolder':{'data':{'id':_0x3c51ef,'type':_0x5b6ca1(0x265)}}});if(_0x4b7f73['isNew']){if(_0x2fb2b4['size']>0x0||_0x3767b6['size']>0x0)return await executeThreeStepJourneyCreate(_0x3d63e2,_0x4b7f73,_0xa930b8,{'pendingEmbeddedSegments':_0x2fb2b4,'pendingEmbeddedActivations':_0x3767b6,'embeddedSegmentNameToId':_0x4efa2f,'journeyActivationNameToId':_0x10df48},{..._0xebc06f,'effectiveFolderId':_0x3c51ef},_0x34fdc0,_0x3964cc,_0x548429);else{ensureJourneyDefaults(_0xa930b8[_0x5b6ca1(0x2bb)]);const _0x1c301a=await _0x3d63e2['journey'][_0x5b6ca1(0x2ba)](_0xa930b8);return deletePushRecovery(_0x4b7f73[_0x5b6ca1(0x2b8)]),{'action':_0x5b6ca1(0x28e),'journeyId':_0x1c301a['id'],'embeddedSegmentNameToId':_0x4efa2f};}}else{if(_0x4b7f73[_0x5b6ca1(0x2c6)]&&_0x4b7f73['existingJourney']){_0xa930b8['id']=_0x4b7f73['existingJourney']['id'];const _0x45fd9b=_0xa930b8[_0x5b6ca1(0x2bb)];_0x4b7f73['existingJourney'][_0x5b6ca1(0x2bb)]?.[_0x5b6ca1(0x2d4)]&&(_0x45fd9b[_0x5b6ca1(0x2d4)]=_0x4b7f73['existingJourney']['attributes'][_0x5b6ca1(0x2d4)]);const _0x588001=_0x4b7f73[_0x5b6ca1(0x2d8)][_0x5b6ca1(0x2bb)]?.['journeyStages'];return _0x588001&&_0xa930b8[_0x5b6ca1(0x2bb)][_0x5b6ca1(0x2b7)]&&injectExistingStageIds(_0xa930b8[_0x5b6ca1(0x2bb)][_0x5b6ca1(0x2b7)],_0x588001),ensureJourneyDefaults(_0x45fd9b),await _0x3d63e2['journey']['update'](_0x4b7f73[_0x5b6ca1(0x2d8)]['id'],_0xa930b8),deletePushRecovery(_0x4b7f73['absolutePath']),{'action':'updated','journeyId':_0x4b7f73[_0x5b6ca1(0x2d8)]['id'],'embeddedSegmentNameToId':_0x4efa2f};}}return deletePushRecovery(_0x4b7f73[_0x5b6ca1(0x2b8)]),{'action':_0x5b6ca1(0x1fd),'journeyId':_0x4b7f73[_0x5b6ca1(0x2d8)]?.['id'],'embeddedSegmentNameToId':_0x4efa2f};}function findSegmentCriteriaLocation(_0x2d2279,_0x16e83b){const _0x30be87=a152_0xfcf5ee,_0xca94bf=_0x2d2279[_0x30be87(0x24f)]||_0x2d2279['journeys']?.[0x0]?.[_0x30be87(0x24f)]||[];let _0x5d364d=_0x30be87(0x282),_0x595545=_0x16e83b;const _0x4496b1=_0x2d2279[_0x30be87(0x26a)]||_0x2d2279[_0x30be87(0x230)]?.[0x0]?.[_0x30be87(0x26a)];if(_0x4496b1?.[_0x30be87(0x210)]===_0x16e83b)return{'stageName':_0x30be87(0x26a),'criteriaName':_0x4496b1['name']||_0x16e83b};_0x4cadb8:for(const _0x3a7d9b of _0xca94bf){if(_0x3a7d9b[_0x30be87(0x1f5)]?.[_0x30be87(0x210)]===_0x16e83b){_0x5d364d=_0x3a7d9b[_0x30be87(0x228)],_0x595545=_0x3a7d9b[_0x30be87(0x1f5)]['name']||_0x16e83b;break;}if(_0x3a7d9b[_0x30be87(0x2d7)])for(const _0x3f12bb of _0x3a7d9b[_0x30be87(0x2d7)]){if(_0x3f12bb[_0x30be87(0x287)]===_0x30be87(0x1f3)&&_0x3f12bb['with']?.[_0x30be87(0x23e)])for(const _0x18f54c of _0x3f12bb['with'][_0x30be87(0x23e)]){if(_0x18f54c[_0x30be87(0x210)]===_0x16e83b){_0x5d364d=_0x3a7d9b[_0x30be87(0x228)],_0x595545=_0x18f54c[_0x30be87(0x228)]||_0x16e83b;break _0x4cadb8;}}}}return{'stageName':_0x5d364d,'criteriaName':_0x595545};}async function executeThreeStepJourneyCreate(_0x200019,_0x3600a2,_0x31e2db,_0x572c6c,_0x4894d5,_0x45e2fc,_0x2b3b8b,_0x2f40e7){const _0x1a36b2=a152_0xfcf5ee,{activationDefToCreateRequest:_0x97caaf,yamlRuleToApi:_0x17bc8b}=_0x2f40e7,{pendingEmbeddedSegments:_0x33e35a,pendingEmbeddedActivations:_0x119dcb,embeddedSegmentNameToId:_0x39a764}=_0x572c6c,_0x348be7=JSON[_0x1a36b2(0x1ee)](JSON['stringify'](_0x31e2db));ensureJourneyDefaults(_0x348be7['attributes']),stripPendingIds(_0x348be7);const _0x16c674=await _0x200019[_0x1a36b2(0x1ef)][_0x1a36b2(0x2ba)](_0x348be7),_0x480225=_0x16c674['id'],_0x4773e4=new Map();for(const _0x129d2a of _0x16c674[_0x1a36b2(0x2bb)][_0x1a36b2(0x2b7)]){_0x4773e4['set'](_0x129d2a[_0x1a36b2(0x228)][_0x1a36b2(0x20d)](),_0x129d2a['id']);}recoverSegmentIdsFromPushRecovery(_0x3600a2,_0x39a764,_0x45e2fc['segmentNameToId']);for(const [_0x1275de,{definition:_0x1422e4}]of _0x33e35a){if(_0x39a764['has'](_0x1275de)){_0x2b3b8b[_0x1a36b2(0x20e)]?.({'type':_0x1a36b2(0x222),'journeyName':_0x3600a2[_0x1a36b2(0x29e)][_0x1a36b2(0x228)],'segmentName':_0x1275de});continue;}const _0x419829=generateDeterministicJourneySegmentName(_0x3600a2[_0x1a36b2(0x29e)][_0x1a36b2(0x228)],_0x1275de);_0x2b3b8b[_0x1a36b2(0x20e)]?.({'type':'embedded_segment_creating','journeyName':_0x3600a2[_0x1a36b2(0x29e)][_0x1a36b2(0x228)],'segmentName':_0x1275de});const _0x1ab0d5=createSegmentIdResolver(_0x45e2fc[_0x1a36b2(0x1e0)],_0x1275de),_0x2e1578=await resolveRuleSegmentIds(_0x1422e4[_0x1a36b2(0x278)],_0x1ab0d5),_0x3e50ec=await createOrRecoverEmbeddedSegment(_0x200019,_0x3600a2,{'localName':_0x1275de,'uniqueSegmentName':_0x419829,'description':_0x1422e4['description']||'Entry\x20criteria:\x20'+_0x1275de,'journeyId':_0x480225,'resolvedRule':_0x2e1578,'parentId':_0x4894d5[_0x1a36b2(0x2bc)],'folderId':_0x4894d5[_0x1a36b2(0x2c4)]||''},_0x17bc8b);_0x39a764[_0x1a36b2(0x25b)](_0x1275de,_0x3e50ec),_0x45e2fc[_0x1a36b2(0x1e0)][_0x1a36b2(0x25b)](_0x1275de,_0x3e50ec),_0x2b3b8b[_0x1a36b2(0x20e)]?.({'type':_0x1a36b2(0x222),'journeyName':_0x3600a2[_0x1a36b2(0x29e)][_0x1a36b2(0x228)],'segmentName':_0x1275de});}const _0x14a126=new Map();for(const [_0x215c20,_0x557f17]of _0x119dcb){_0x2b3b8b[_0x1a36b2(0x20e)]?.({'type':_0x1a36b2(0x261),'journeyName':_0x3600a2[_0x1a36b2(0x29e)]['name'],'activationName':_0x215c20});const _0x37e59c=await _0x97caaf(_0x557f17,_0x45e2fc[_0x1a36b2(0x2ce)]),_0x29c954={..._0x37e59c,..._0x557f17[_0x1a36b2(0x28b)]!==undefined&&{'runAfterJourneyRefresh':_0x557f17[_0x1a36b2(0x28b)]}},_0x481dbd=await _0x200019['journey'][_0x1a36b2(0x24b)](_0x480225,_0x29c954);_0x14a126[_0x1a36b2(0x25b)](_0x215c20,_0x481dbd['id']),_0x572c6c[_0x1a36b2(0x1f0)][_0x1a36b2(0x25b)](_0x215c20,_0x481dbd['id']),_0x2b3b8b['onProgress']?.({'type':'embedded_activation_created','journeyName':_0x3600a2[_0x1a36b2(0x29e)][_0x1a36b2(0x228)],'activationName':_0x215c20});}const _0x51c08a=JSON[_0x1a36b2(0x1ee)](JSON['stringify'](_0x31e2db));return _0x51c08a['id']=_0x480225,ensureJourneyDefaults(_0x51c08a[_0x1a36b2(0x2bb)]),resolvePendingIdsInRequest(_0x51c08a,_0x31e2db,_0x4773e4,_0x39a764,_0x14a126,_0x2b3b8b),await _0x200019['journey'][_0x1a36b2(0x238)](_0x480225,_0x51c08a),deletePushRecovery(_0x3600a2['absolutePath']),{'action':_0x1a36b2(0x28e),'journeyId':_0x480225,'embeddedSegmentNameToId':_0x39a764};}export function stripWaitStepPendingIds(_0x920cc){const _0x2bf0fc=a152_0xfcf5ee,_0x5e28f5=_0x920cc[_0x2bf0fc(0x246)]&&isPendingSegmentId(_0x920cc['conditionSegmentId']),_0x1e49f9=_0x920cc[_0x2bf0fc(0x2dd)]?.[_0x2bf0fc(0x29a)](_0x12e913=>_0x12e913['segmentId']&&isPendingSegmentId(_0x12e913[_0x2bf0fc(0x1eb)]));(_0x5e28f5||_0x1e49f9)&&(_0x920cc[_0x2bf0fc(0x1e1)]=_0x2bf0fc(0x24d),_0x920cc['waitStep']=0x1,_0x920cc[_0x2bf0fc(0x285)]='day',delete _0x920cc[_0x2bf0fc(0x246)],delete _0x920cc[_0x2bf0fc(0x2db)],delete _0x920cc[_0x2bf0fc(0x226)],delete _0x920cc[_0x2bf0fc(0x2dd)]);}export function resolveWaitStepPendingIds(_0x39ecdb,_0x17a2d1,_0x438afa,_0x183951){const _0x541c10=a152_0xfcf5ee;if(_0x17a2d1[_0x541c10(0x246)]&&isPendingSegmentId(_0x17a2d1['conditionSegmentId'])){const _0x417657=_0x438afa(_0x17a2d1[_0x541c10(0x246)],_0x541c10(0x269)+_0x183951+'\x27\x20wait\x20condition');_0x417657&&(_0x39ecdb[_0x541c10(0x1e1)]=_0x541c10(0x27d),_0x39ecdb[_0x541c10(0x246)]=_0x417657,delete _0x39ecdb['waitStep'],delete _0x39ecdb[_0x541c10(0x285)],_0x17a2d1[_0x541c10(0x2db)]!==undefined&&(_0x39ecdb[_0x541c10(0x2db)]=_0x17a2d1[_0x541c10(0x2db)]),_0x17a2d1[_0x541c10(0x226)]&&(_0x39ecdb[_0x541c10(0x226)]=_0x17a2d1['conditionTimeoutUnit']));}if(_0x17a2d1[_0x541c10(0x2dd)]){const _0xc24851=_0x17a2d1[_0x541c10(0x2dd)][_0x541c10(0x29a)](_0x4cb1a6=>_0x4cb1a6[_0x541c10(0x1eb)]&&isPendingSegmentId(_0x4cb1a6[_0x541c10(0x1eb)]));if(_0xc24851){const _0x1f1e36=_0x17a2d1[_0x541c10(0x2dd)][_0x541c10(0x232)](_0x1be101=>{const _0x1a2d04=_0x541c10;if(_0x1be101[_0x1a2d04(0x1eb)]&&isPendingSegmentId(_0x1be101[_0x1a2d04(0x1eb)])){const _0x4485aa=_0x438afa(_0x1be101[_0x1a2d04(0x1eb)],'stage\x20\x27'+_0x183951+_0x1a2d04(0x28a));return{..._0x1be101,'segmentId':_0x4485aa||_0x1be101[_0x1a2d04(0x1eb)]};}return{..._0x1be101};});_0x39ecdb[_0x541c10(0x1e1)]=_0x541c10(0x27d),_0x39ecdb[_0x541c10(0x2dd)]=_0x1f1e36,delete _0x39ecdb[_0x541c10(0x229)],delete _0x39ecdb['waitStepUnit'],delete _0x39ecdb['conditionSegmentId'],delete _0x39ecdb[_0x541c10(0x2db)],delete _0x39ecdb['conditionTimeoutUnit'];}}}function stripPendingIds(_0x20eb0c){const _0x3692cd=a152_0xfcf5ee;_0x20eb0c[_0x3692cd(0x2bb)]['goal']?.[_0x3692cd(0x1eb)]&&isPendingSegmentId(_0x20eb0c['attributes'][_0x3692cd(0x26a)][_0x3692cd(0x1eb)])&&delete _0x20eb0c['attributes'][_0x3692cd(0x26a)];for(const _0x3d9121 of _0x20eb0c[_0x3692cd(0x2bb)][_0x3692cd(0x2b7)]||[]){_0x3d9121[_0x3692cd(0x2b9)]?.['segmentId']&&isPendingSegmentId(_0x3d9121[_0x3692cd(0x2b9)]['segmentId'])&&delete _0x3d9121[_0x3692cd(0x2b9)];_0x3d9121[_0x3692cd(0x24e)]?.[_0x3692cd(0x1eb)]&&isPendingSegmentId(_0x3d9121['milestone'][_0x3692cd(0x1eb)])&&delete _0x3d9121['milestone'];_0x3d9121[_0x3692cd(0x2a7)]&&(_0x3d9121['exitCriterias']=_0x3d9121[_0x3692cd(0x2a7)][_0x3692cd(0x263)](_0x9d6aae=>!_0x9d6aae[_0x3692cd(0x1eb)]||!isPendingSegmentId(_0x9d6aae[_0x3692cd(0x1eb)])));if(_0x3d9121[_0x3692cd(0x2d7)])for(const _0xa33cb6 of Object[_0x3692cd(0x259)](_0x3d9121[_0x3692cd(0x2d7)])){const _0x4aee00=_0x3d9121['steps'][_0xa33cb6];_0x4aee00['type']===_0x3692cd(0x21a)&&_0x4aee00[_0x3692cd(0x215)]&&isPendingActivationId(_0x4aee00[_0x3692cd(0x215)])&&(_0x4aee00[_0x3692cd(0x215)]='');if(_0x4aee00[_0x3692cd(0x287)]===_0x3692cd(0x23f)&&_0x4aee00[_0x3692cd(0x23e)])for(const _0x27488b of _0x4aee00[_0x3692cd(0x23e)]){_0x27488b[_0x3692cd(0x1eb)]&&isPendingSegmentId(_0x27488b[_0x3692cd(0x1eb)])&&(_0x27488b['segmentId']='');}_0x4aee00[_0x3692cd(0x287)]===_0x3692cd(0x279)&&stripWaitStepPendingIds(_0x4aee00);}}}function resolvePendingIdsInRequest(_0x1193e9,_0x3d5f99,_0x4d26bd,_0x17b037,_0x3919a4,_0x136d04){const _0x215e12=a152_0xfcf5ee,_0x5dc05c=(_0x49588d,_0x4d61d6)=>{const _0x46827d=a152_0x558f;if(!isPendingSegmentId(_0x49588d))return _0x49588d;const _0x2c6e6c=extractPendingSegmentName(_0x49588d),_0x252609=_0x17b037['get'](_0x2c6e6c);return!_0x252609&&_0x136d04[_0x46827d(0x262)]?.(_0x46827d(0x29b)+_0x2c6e6c+_0x46827d(0x276)+_0x4d61d6),_0x252609;};if(_0x1193e9[_0x215e12(0x2bb)][_0x215e12(0x26a)]?.['segmentId']&&isPendingSegmentId(_0x1193e9[_0x215e12(0x2bb)][_0x215e12(0x26a)][_0x215e12(0x1eb)])){const _0x51e42c=_0x5dc05c(_0x1193e9[_0x215e12(0x2bb)][_0x215e12(0x26a)][_0x215e12(0x1eb)],'goal\x20criteria');_0x51e42c&&(_0x1193e9[_0x215e12(0x2bb)][_0x215e12(0x26a)][_0x215e12(0x1eb)]=_0x51e42c);}for(const _0x2315f1 of _0x1193e9['attributes'][_0x215e12(0x2b7)]||[]){const _0x23d671=_0x4d26bd[_0x215e12(0x29d)](_0x2315f1[_0x215e12(0x228)]['toLowerCase']());_0x23d671&&(_0x2315f1['id']=_0x23d671);if(_0x2315f1[_0x215e12(0x2b9)]?.[_0x215e12(0x1eb)]&&isPendingSegmentId(_0x2315f1[_0x215e12(0x2b9)][_0x215e12(0x1eb)])){const _0x4d2e1c=_0x5dc05c(_0x2315f1['entryCriteria'][_0x215e12(0x1eb)],_0x215e12(0x269)+_0x2315f1[_0x215e12(0x228)]+_0x215e12(0x202));_0x4d2e1c&&(_0x2315f1[_0x215e12(0x2b9)][_0x215e12(0x1eb)]=_0x4d2e1c);}if(_0x2315f1[_0x215e12(0x2a7)])for(const _0x49cc03 of _0x2315f1[_0x215e12(0x2a7)]){if(_0x49cc03['segmentId']&&isPendingSegmentId(_0x49cc03[_0x215e12(0x1eb)])){const _0xba5da4=_0x5dc05c(_0x49cc03['segmentId'],_0x215e12(0x269)+_0x2315f1['name']+'\x27\x20exit\x20criteria');_0xba5da4&&(_0x49cc03[_0x215e12(0x1eb)]=_0xba5da4);}}if(_0x2315f1[_0x215e12(0x24e)]?.[_0x215e12(0x1eb)]&&isPendingSegmentId(_0x2315f1[_0x215e12(0x24e)][_0x215e12(0x1eb)])){const _0x3e43d9=_0x5dc05c(_0x2315f1[_0x215e12(0x24e)][_0x215e12(0x1eb)],_0x215e12(0x269)+_0x2315f1['name']+'\x27\x20milestone');_0x3e43d9&&(_0x2315f1['milestone']['segmentId']=_0x3e43d9);}if(_0x2315f1[_0x215e12(0x2d7)]){const _0x36451f=_0x251f27=>_0x3d5f99[_0x215e12(0x2bb)]['journeyStages']?.[_0x215e12(0x240)](_0x4a0eea=>_0x4a0eea[_0x215e12(0x228)][_0x215e12(0x20d)]()===_0x2315f1[_0x215e12(0x228)]['toLowerCase']())?.[_0x215e12(0x2d7)]?.[_0x251f27];for(const _0x2ba0d8 of Object[_0x215e12(0x259)](_0x2315f1['steps'])){const _0xbfa900=_0x2315f1[_0x215e12(0x2d7)][_0x2ba0d8],_0x1358a7=_0x36451f(_0x2ba0d8);if(_0xbfa900[_0x215e12(0x287)]===_0x215e12(0x21a)&&_0xbfa900['journeyActivationStepId']&&(isPendingActivationId(_0xbfa900['journeyActivationStepId'])||_0xbfa900['journeyActivationStepId']==='')){if(_0x1358a7?.['journeyActivationStepId']&&isPendingActivationId(_0x1358a7[_0x215e12(0x215)])){const _0x4b1cd8=extractPendingActivationName(_0x1358a7[_0x215e12(0x215)]),_0x406f00=_0x3919a4[_0x215e12(0x29d)](_0x4b1cd8);_0x406f00&&(_0xbfa900['journeyActivationStepId']=_0x406f00);}}if(_0xbfa900[_0x215e12(0x287)]==='DecisionPoint'&&_0xbfa900[_0x215e12(0x23e)]&&_0x1358a7?.[_0x215e12(0x23e)])for(let _0x16b9c5=0x0;_0x16b9c5<_0xbfa900[_0x215e12(0x23e)][_0x215e12(0x221)];_0x16b9c5++){const _0x12b3e1=_0xbfa900[_0x215e12(0x23e)][_0x16b9c5],_0xbcfc1c=_0x1358a7[_0x215e12(0x23e)][_0x16b9c5];if(_0xbcfc1c?.['segmentId']&&isPendingSegmentId(_0xbcfc1c[_0x215e12(0x1eb)])){const _0x1f71bd=_0x5dc05c(_0xbcfc1c['segmentId'],'stage\x20\x27'+_0x2315f1['name']+_0x215e12(0x27b)+(_0x12b3e1[_0x215e12(0x228)]||_0x16b9c5)+'\x27');_0x1f71bd&&(_0x12b3e1[_0x215e12(0x1eb)]=_0x1f71bd);}}_0xbfa900[_0x215e12(0x287)]===_0x215e12(0x279)&&_0x1358a7?.[_0x215e12(0x287)]===_0x215e12(0x279)&&resolveWaitStepPendingIds(_0xbfa900,_0x1358a7,_0x5dc05c,_0x2315f1[_0x215e12(0x228)]);}}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x1ca830,_0x2c353d){const _0x19076e=a153_0x2a48,_0x33712d=_0x1ca830();while(!![]){try{const _0x4000d7=-parseInt(_0x19076e(0xff))/0x1+-parseInt(_0x19076e(0xfb))/0x2*(parseInt(_0x19076e(0x101))/0x3)+-parseInt(_0x19076e(0xf9))/0x4+-parseInt(_0x19076e(0xf7))/0x5+-parseInt(_0x19076e(0xf8))/0x6+parseInt(_0x19076e(0xfa))/0x7*(parseInt(_0x19076e(0x102))/0x8)+parseInt(_0x19076e(0xf4))/0x9*(parseInt(_0x19076e(0xf5))/0xa);if(_0x4000d7===_0x2c353d)break;else _0x33712d['push'](_0x33712d['shift']());}catch(_0x5dea87){_0x33712d['push'](_0x33712d['shift']());}}}(a153_0x1839,0xcda16));export function buildFolderIdToPathMap(_0x236fe1){const _0x564728=a153_0x2a48,_0x12e8eb=new Map(),_0x577b32=new Map();for(const _0xf936ff of _0x236fe1){_0x577b32['set'](_0xf936ff['id'],_0xf936ff);}const _0x3d8b22=new Set();for(const _0x572a00 of _0x236fe1){!_0x572a00[_0x564728(0xfc)]&&_0x3d8b22['add'](_0x572a00['id']);}function _0x380556(_0x27ac4d){const _0x44a40b=_0x564728;if(_0x12e8eb[_0x44a40b(0x100)](_0x27ac4d['id']))return _0x12e8eb[_0x44a40b(0xfe)](_0x27ac4d['id']);if(_0x3d8b22[_0x44a40b(0x100)](_0x27ac4d['id']))return _0x12e8eb[_0x44a40b(0x103)](_0x27ac4d['id'],''),'';if(_0x27ac4d[_0x44a40b(0xfc)]){const _0x168721=_0x577b32['get'](_0x27ac4d[_0x44a40b(0xfc)]);if(_0x168721){const _0xe0f32a=_0x380556(_0x168721),_0x3513ec=_0xe0f32a?_0xe0f32a+'/'+_0x27ac4d[_0x44a40b(0xf6)]:_0x27ac4d[_0x44a40b(0xf6)];return _0x12e8eb[_0x44a40b(0x103)](_0x27ac4d['id'],_0x3513ec),_0x3513ec;}}const _0x2d0984=_0x27ac4d[_0x44a40b(0xf6)];return _0x12e8eb['set'](_0x27ac4d['id'],_0x2d0984),_0x2d0984;}for(const _0x3fe089 of _0x236fe1){_0x380556(_0x3fe089);}return _0x12e8eb;}export function buildFolderPathToIdMap(_0x2f4d45){const _0x32ea16=a153_0x2a48,_0xac19d4=new Map(),_0x168718=new Map();for(const _0x38f300 of _0x2f4d45){_0x168718[_0x32ea16(0x103)](_0x38f300['id'],_0x38f300);}const _0xef6796=new Set();for(const _0x33e0ae of _0x2f4d45){!_0x33e0ae[_0x32ea16(0xfc)]&&_0xef6796[_0x32ea16(0xfd)](_0x33e0ae['id']);}function _0x20f703(_0x5b8fc0){const _0xe8c840=_0x32ea16;if(_0xef6796[_0xe8c840(0x100)](_0x5b8fc0['id']))return'';if(_0x5b8fc0[_0xe8c840(0xfc)]){const _0x37bd2c=_0x168718['get'](_0x5b8fc0['parentFolderId']);if(_0x37bd2c){const _0x110e73=_0x20f703(_0x37bd2c);return _0x110e73?_0x110e73+'/'+_0x5b8fc0[_0xe8c840(0xf6)]:_0x5b8fc0[_0xe8c840(0xf6)];}}return _0x5b8fc0[_0xe8c840(0xf6)];}for(const _0x18a3ac of _0x2f4d45){const _0x4d9300=_0x20f703(_0x18a3ac);_0xac19d4['set'](_0x4d9300,_0x18a3ac['id']);}return _0xac19d4;}export function buildFolderMaps(_0x2db34f){const _0x481864=a153_0x2a48,_0x52d192=buildFolderIdToPathMap(_0x2db34f),_0x4985c2=new Map();for(const [_0x94aa88,_0xf8babe]of _0x52d192){_0x4985c2[_0x481864(0x103)](_0xf8babe,_0x94aa88);}return{'idToPath':_0x52d192,'pathToId':_0x4985c2};}function a153_0x2a48(_0x1b7f81,_0x366335){_0x1b7f81=_0x1b7f81-0xf4;const _0x18392b=a153_0x1839();let _0x2a4838=_0x18392b[_0x1b7f81];return _0x2a4838;}function a153_0x1839(){const _0x2bb67d=['2mwQWOp','parentFolderId','add','get','1151384oMJONu','has','2184303YjcSON','72TJesPW','set','163431ZyXcpG','1910jiGSxI','name','1190155dncpLN','1531080sgUIHs','1313416HnUQoe','58289GWhvSo'];a153_0x1839=function(){return _0x2bb67d;};return a153_0x1839();}export function getFolderPath(_0x6657af,_0x4b4826){if(!_0x6657af)return'';return _0x4b4826['get'](_0x6657af)??'';}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x2b0c4f,_0x14f2ce){const _0x5d412a=a154_0x2f9d,_0x56b587=_0x2b0c4f();while(!![]){try{const _0x1bba6e=-parseInt(_0x5d412a(0x16a))/0x1*(-parseInt(_0x5d412a(0x159))/0x2)+parseInt(_0x5d412a(0x14b))/0x3+parseInt(_0x5d412a(0x14a))/0x4+-parseInt(_0x5d412a(0x147))/0x5+-parseInt(_0x5d412a(0x171))/0x6+parseInt(_0x5d412a(0x144))/0x7+-parseInt(_0x5d412a(0x148))/0x8;if(_0x1bba6e===_0x14f2ce)break;else _0x56b587['push'](_0x56b587['shift']());}catch(_0x2d5dc7){_0x56b587['push'](_0x56b587['shift']());}}}(a154_0x4707,0xee461));import a154_0x523f68 from'path';import{parse as a154_0x4291b7}from'yaml';import{nodeFileSystem}from'../io/node-filesystem.js';function a154_0x2f9d(_0x1691a1,_0x4620d6){_0x1691a1=_0x1691a1-0x144;const _0x470704=a154_0x4707();let _0x2f9dbe=_0x470704[_0x1691a1];return _0x2f9dbe;}export function parsePath(_0x48d4aa){const _0x267601=a154_0x2f9d;if(!_0x48d4aa||_0x48d4aa[_0x267601(0x149)]()==='')throw new Error('Path\x20cannot\x20be\x20empty');const _0xbe83d2=_0x48d4aa[_0x267601(0x149)]();if(_0xbe83d2==='/')return{'segments':[],'isAbsolute':!![],'raw':_0x48d4aa};const _0x15d936=_0xbe83d2[_0x267601(0x15c)]('/')?_0xbe83d2[_0x267601(0x14e)](0x1):_0xbe83d2,_0x424938=_0x15d936[_0x267601(0x15b)]('/')[_0x267601(0x173)](_0x48bc9e=>_0x48bc9e!=='');if(_0x424938['length']===0x0)throw new Error(_0x267601(0x154));const _0x426378=_0xbe83d2[_0x267601(0x15c)]('/')||!isRelativePathSegment(_0x424938[0x0]);for(const _0x4d4a7e of _0x424938){validatePathSegment(_0x4d4a7e);}return{'segments':_0x424938,'isAbsolute':_0x426378,'raw':_0x48d4aa};}function isRelativePathSegment(_0x2b7d9c){return _0x2b7d9c==='.'||_0x2b7d9c==='..';}function validatePathSegment(_0x2bafc1){const _0x8dfe77=a154_0x2f9d;if(_0x2bafc1==='')throw new Error(_0x8dfe77(0x174));if(_0x2bafc1==='.'||_0x2bafc1==='..')return;if(/[\x00-\x1F\x7F]/['test'](_0x2bafc1))throw new Error(_0x8dfe77(0x14c)+_0x2bafc1);if(_0x2bafc1!==_0x2bafc1['trim']()){}}export function validatePath(_0x1c3399){const _0x246a87=a154_0x2f9d;if(_0x1c3399[_0x246a87(0x160)]['length']===0x0&&!_0x1c3399['isAbsolute'])throw new Error(_0x246a87(0x157));if(_0x1c3399[_0x246a87(0x145)]){if(_0x1c3399[_0x246a87(0x160)][0x0]==='..')throw new Error(_0x246a87(0x158));let _0x20a5d9=0x0;for(const _0x1be556 of _0x1c3399[_0x246a87(0x160)]){if(_0x1be556==='..'){if(_0x20a5d9===0x0)throw new Error(_0x246a87(0x14d));_0x20a5d9--;}else _0x1be556!=='.'&&_0x20a5d9++;}}}export function joinPaths(_0x58beab,_0x3a3cfe){const _0xcf628c=a154_0x2f9d;if(!_0x58beab||_0x58beab==='/')return _0x3a3cfe;if(!_0x3a3cfe||_0x3a3cfe==='.')return _0x58beab;if(_0x3a3cfe[_0xcf628c(0x15c)]('/'))return _0x3a3cfe;const _0x12bb0b=parsePath(_0x58beab),_0x528432=parsePath(_0x3a3cfe),_0xc08347=[..._0x12bb0b[_0xcf628c(0x160)]];for(const _0x409fd8 of _0x528432['segments']){if(_0x409fd8==='.')continue;else{if(_0x409fd8==='..'){if(_0xc08347['length']===0x0)throw new Error(_0xcf628c(0x16f));_0xc08347['pop']();}else _0xc08347[_0xcf628c(0x15a)](_0x409fd8);}}const _0x54c4d4=_0xc08347[_0xcf628c(0x164)]('/');return _0x12bb0b[_0xcf628c(0x152)][_0xcf628c(0x15c)]('/')?'/'+_0x54c4d4:_0x54c4d4;}export function normalizePath(_0x42394e){const _0x2f589f=a154_0x2f9d,_0x36bb7a=parsePath(_0x42394e),_0x5390c4=[];for(const _0x1c4332 of _0x36bb7a[_0x2f589f(0x160)]){if(_0x1c4332==='.')continue;else{if(_0x1c4332==='..'){if(_0x5390c4[_0x2f589f(0x167)]===0x0){if(_0x36bb7a[_0x2f589f(0x145)])throw new Error(_0x2f589f(0x16f));_0x5390c4[_0x2f589f(0x15a)]('..');}else _0x5390c4[_0x5390c4['length']-0x1]==='..'?_0x5390c4[_0x2f589f(0x15a)]('..'):_0x5390c4[_0x2f589f(0x146)]();}else _0x5390c4['push'](_0x1c4332);}}if(_0x5390c4[_0x2f589f(0x167)]===0x0)return _0x36bb7a[_0x2f589f(0x145)]?'/':'.';const _0x23fd50=_0x5390c4[_0x2f589f(0x164)]('/');return _0x36bb7a[_0x2f589f(0x152)][_0x2f589f(0x15c)]('/')?'/'+_0x23fd50:_0x23fd50;}function a154_0x4707(){const _0x40a77b=['segment','Cannot\x20navigate\x20above\x20root','File\x20not\x20found:\x20','9271110QredUt','parent_segment','filter','Path\x20segment\x20cannot\x20be\x20empty','12663910scHbnA','isAbsolute','pop','4645235HXRvjX','3885032Inhkmx','trim','1818044HweMxg','253254wexgpg','Path\x20segment\x20contains\x20invalid\x20control\x20characters:\x20','Path\x20attempts\x20to\x20navigate\x20above\x20root','substring','relative','No\x20tdx.json\x20found\x20for\x20file:\x20','type','raw','Invalid\x20YAML:\x20missing\x20name\x20field\x20in\x20','Path\x20must\x20contain\x20at\x20least\x20one\x20segment','replace','name','Relative\x20path\x20cannot\x20be\x20empty','Absolute\x20path\x20cannot\x20start\x20with\x20\x22..\x22','2YBWCie','push','split','startsWith','journey','readFile','.yaml','segments','.yml','exists','slice','join','root','Cannot\x20split\x20empty\x20path','length','parse','endsWith','1587771NkGhdY','tdx.json','dirname','Hint:\x20Run\x20`tdx\x20sg\x20pull\x20\x22Parent\x20Segment\x20Name\x22`\x20first\x20to\x20create\x20a\x20project\x20directory,\x20then\x20work\x20within\x20that\x20directory.'];a154_0x4707=function(){return _0x40a77b;};return a154_0x4707();}export function getParentPath(_0x611d85){const _0xa1447d=a154_0x2f9d,_0x218ccb=parsePath(_0x611d85);if(_0x218ccb[_0xa1447d(0x160)]['length']<=0x1)return'/';const _0x1b78cc=_0x218ccb[_0xa1447d(0x160)]['slice'](0x0,-0x1)[_0xa1447d(0x164)]('/');return _0x218ccb[_0xa1447d(0x152)][_0xa1447d(0x15c)]('/')?'/'+_0x1b78cc:_0x1b78cc;}export function getBaseName(_0x31eee1){const _0x45a032=a154_0x2f9d,_0x9f070b=parsePath(_0x31eee1);return _0x9f070b[_0x45a032(0x160)][_0x9f070b['segments'][_0x45a032(0x167)]-0x1]||'';}export function isChildPath(_0x4dae19,_0x523f79){const _0x8a6646=a154_0x2f9d,_0x314bc7=parsePath(_0x4dae19),_0x415e67=parsePath(_0x523f79);if(_0x314bc7[_0x8a6646(0x160)]['length']<=_0x415e67['segments'][_0x8a6646(0x167)])return![];for(let _0x2f5418=0x0;_0x2f5418<_0x415e67[_0x8a6646(0x160)][_0x8a6646(0x167)];_0x2f5418++){if(_0x314bc7[_0x8a6646(0x160)][_0x2f5418]!==_0x415e67[_0x8a6646(0x160)][_0x2f5418])return![];}return!![];}export function splitPath(_0x5a2bba){const _0x4e4ca8=a154_0x2f9d,_0x1357c8=parsePath(_0x5a2bba);if(_0x1357c8[_0x4e4ca8(0x160)][_0x4e4ca8(0x167)]===0x0)throw new Error(_0x4e4ca8(0x166));if(_0x1357c8[_0x4e4ca8(0x160)][_0x4e4ca8(0x167)]===0x1)return{'parent':_0x1357c8[_0x4e4ca8(0x160)][0x0]};return{'parent':_0x1357c8[_0x4e4ca8(0x160)][0x0],'child':_0x1357c8[_0x4e4ca8(0x160)][_0x4e4ca8(0x163)](0x1)[_0x4e4ca8(0x164)]('/')};}export function isYamlFilePath(_0x57bdb9){const _0x4db794=a154_0x2f9d;return _0x57bdb9['endsWith'](_0x4db794(0x161))||_0x57bdb9[_0x4db794(0x169)](_0x4db794(0x15f));}export async function resolveYamlFilePath(_0x1927ae,_0x7409b1=nodeFileSystem){const _0x47e382=a154_0x2f9d,_0x211837=a154_0x523f68['resolve'](_0x1927ae);if(!await _0x7409b1[_0x47e382(0x162)](_0x211837))throw new Error(_0x47e382(0x170)+_0x1927ae);let _0x56ad31=a154_0x523f68[_0x47e382(0x16c)](_0x211837),_0x426427=null,_0x4aacd3=null;const _0x4cda30=a154_0x523f68[_0x47e382(0x168)](_0x56ad31)[_0x47e382(0x165)];while(_0x56ad31!==_0x4cda30){const _0x58950f=a154_0x523f68['join'](_0x56ad31,_0x47e382(0x16b));if(await _0x7409b1[_0x47e382(0x162)](_0x58950f)){_0x426427=_0x58950f,_0x4aacd3=_0x56ad31;break;}_0x56ad31=a154_0x523f68[_0x47e382(0x16c)](_0x56ad31);}if(!_0x426427||!_0x4aacd3)throw new Error(_0x47e382(0x150)+_0x1927ae+'\x0a'+_0x47e382(0x16d));const _0x9609b6=await _0x7409b1['readFile'](_0x426427),_0x352bd5=JSON[_0x47e382(0x168)](_0x9609b6),_0x5d264a=_0x352bd5[_0x47e382(0x172)];if(!_0x5d264a)throw new Error('Invalid\x20tdx.json:\x20missing\x20parent_segment\x20field');const _0x3693ba=await _0x7409b1[_0x47e382(0x15e)](_0x211837),_0x5db8cc=a154_0x4291b7(_0x3693ba),_0x35c57b=_0x5db8cc[_0x47e382(0x156)];if(!_0x35c57b)throw new Error(_0x47e382(0x153)+_0x1927ae);const _0x4b4b2f=_0x5db8cc[_0x47e382(0x151)]===_0x47e382(0x15d)?_0x47e382(0x15d):_0x47e382(0x16e),_0x281319=a154_0x523f68[_0x47e382(0x14f)](_0x4aacd3,_0x211837),_0x17457f=a154_0x523f68[_0x47e382(0x16c)](_0x281319),_0x62611c=_0x17457f==='.'?'':_0x17457f[_0x47e382(0x155)](/\\/g,'/'),_0x410429=_0x62611c?_0x5d264a+'/'+_0x62611c+'/'+_0x35c57b:_0x5d264a+'/'+_0x35c57b;return{'parentSegment':_0x5d264a,'segmentName':_0x35c57b,'folderPath':_0x62611c,'fullPath':_0x410429,'resourceType':_0x4b4b2f,'content':_0x3693ba};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x2f7095,_0x16b2bf){const _0x582cba=a155_0x1bdc,_0x1d2910=_0x2f7095();while(!![]){try{const _0x16359b=parseInt(_0x582cba(0xea))/0x1*(parseInt(_0x582cba(0xf0))/0x2)+-parseInt(_0x582cba(0xf7))/0x3+parseInt(_0x582cba(0xf5))/0x4*(-parseInt(_0x582cba(0xeb))/0x5)+-parseInt(_0x582cba(0xf3))/0x6*(-parseInt(_0x582cba(0xf8))/0x7)+parseInt(_0x582cba(0xec))/0x8*(parseInt(_0x582cba(0xf4))/0x9)+parseInt(_0x582cba(0xee))/0xa+-parseInt(_0x582cba(0xf2))/0xb;if(_0x16359b===_0x16b2bf)break;else _0x1d2910['push'](_0x1d2910['shift']());}catch(_0x352b93){_0x1d2910['push'](_0x1d2910['shift']());}}}(a155_0xe30e,0xdc638));function a155_0x1bdc(_0x50670d,_0x2a9f8e){_0x50670d=_0x50670d-0xea;const _0xe30e7b=a155_0xe30e();let _0x1bdce3=_0xe30e7b[_0x50670d];return _0x1bdce3;}function a155_0xe30e(){const _0x20bc10=['36GHLvSW','Invalid\x20segment\x20reference\x20format:\x20','5347276aVUkmz','1118094RTeZOL','27yIWrVU','617380dudptd','indexOf','3185436HAoUMc','49OZuUEV','13290hbzvNd','30dEHVaY','3372784nzORwW','substring','5682530dKMItX','.\x20Child\x20name\x20cannot\x20be\x20empty'];a155_0xe30e=function(){return _0x20bc10;};return a155_0xe30e();}export function parseSegmentRef(_0x3711df){const _0x31f310=a155_0x1bdc,_0x512287=_0x3711df[_0x31f310(0xf6)]('/');if(_0x512287===-0x1)return{'parentId':_0x3711df};if(_0x512287===0x0)throw new Error(_0x31f310(0xf1)+_0x3711df+'.\x20Parent\x20name\x20cannot\x20be\x20empty');const _0x4ececf=_0x3711df[_0x31f310(0xed)](0x0,_0x512287),_0x9d7f09=_0x3711df['substring'](_0x512287+0x1);if(_0x9d7f09==='')throw new Error(_0x31f310(0xf1)+_0x3711df+_0x31f310(0xef));return{'parentId':_0x4ececf,'childId':_0x9d7f09};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x1e78d4,_0x506e4f){const _0x4b1754=a156_0x5af1,_0x3e6926=_0x1e78d4();while(!![]){try{const _0xf9cb07=parseInt(_0x4b1754(0xf5))/0x1*(parseInt(_0x4b1754(0xe2))/0x2)+parseInt(_0x4b1754(0x107))/0x3*(parseInt(_0x4b1754(0xf7))/0x4)+parseInt(_0x4b1754(0xeb))/0x5*(parseInt(_0x4b1754(0xc6))/0x6)+-parseInt(_0x4b1754(0xf2))/0x7*(parseInt(_0x4b1754(0xd6))/0x8)+-parseInt(_0x4b1754(0xc0))/0x9+-parseInt(_0x4b1754(0x106))/0xa+-parseInt(_0x4b1754(0xcb))/0xb*(-parseInt(_0x4b1754(0xe7))/0xc);if(_0xf9cb07===_0x506e4f)break;else _0x3e6926['push'](_0x3e6926['shift']());}catch(_0x1fe984){_0x3e6926['push'](_0x3e6926['shift']());}}}(a156_0xca02,0x96da2));import{SegmentDefSchema,RuleDefSchema}from'./types/segment-schema.js';import{formatZodPath,flattenZodIssues,getLocationFromPath,pathToArray}from'./yaml-validator.js';export function validateSegmentDef(_0x489c18,_0x257e6c={},_0x2bf42f={}){const _0x15020b=a156_0x5af1;if(_0x2bf42f[_0x15020b(0x109)])return runSemanticChecks(_0x489c18,_0x257e6c);const _0x2322c3=SegmentDefSchema['safeParse'](_0x489c18);if(_0x2322c3[_0x15020b(0x102)])return runSemanticChecks(_0x2322c3['data'],_0x257e6c);return zodErrorsToValidationResult(_0x2322c3[_0x15020b(0xd2)],_0x257e6c);}export function validateRuleDef(_0x89ae7a,_0x14fea0,_0x1c7871){const _0x320d73=a156_0x5af1;if(!_0x89ae7a)return[];const _0x4e64d4=RuleDefSchema[_0x320d73(0xc9)](_0x89ae7a);if(_0x4e64d4[_0x320d73(0x102)])return checkRule(_0x4e64d4[_0x320d73(0xda)],_0x14fea0,_0x1c7871);const _0xe2dcec=flattenZodIssues(_0x4e64d4[_0x320d73(0xd2)][_0x320d73(0xe1)]);return _0xe2dcec['map'](_0x1a82d3=>{const _0x53eceb=_0x320d73,_0x394aa1=formatZodPath(_0x1a82d3['path']),_0x487743=_0x394aa1?_0x14fea0+'.'+_0x394aa1:_0x14fea0,_0x584a1a=mapZodIssueToCode(_0x1a82d3,_0x394aa1),_0x58bff2=getLocationFromPath(_0x1c7871['document'],_0x1c7871['source'],pathToArray(_0x487743));return{'level':'error','path':_0x487743,'code':_0x584a1a,'message':_0x1a82d3[_0x53eceb(0xd8)],..._0x58bff2&&{'location':_0x58bff2}};});}function a156_0xca02(){const _0x3c344f=['\x27\x20with\x20behavior\x20source\x20may\x20cause\x20unexpected\x20behavior.\x20','custom','map','level','1844208GPPsBl','the\x20condition\x20queries\x20the\x20master\x20table\x20instead.\x20','path','Use\x20\x27attribute:\x20\x22\x22\x27\x20with\x20\x27filter.type:\x20And\x27\x20containing\x20\x27type:\x20Column\x27\x20conditions.','231965lTOBTW','name','MISSING_SEGMENT_REFERENCE','requires\x20a\x20nested\x20\x27filter\x27.\x20Without\x20filter,\x20the\x20source\x20is\x20silently\x20ignored\x20and\x20','condition\x20groups\x20correctly.\x20Segment\x20execution\x20is\x20unaffected.\x20For\x20same-attribute\x20Or\x20','.filter','Behavior','4226089YCERME','.operator.value','INVALID_RULE_TYPE','2nRFZfd','match','642152rIPMHa','MISSING_OPERATOR_VALUE','And','MISSING_CONDITIONS','\x20condition\x20group:\x20Console\x20UI\x20SQL\x20preview\x20does\x20not\x20display\x20nested\x20','\x20condition\x20cannot\x20have\x20an\x20empty\x20conditions\x20array','.attribute','MISSING_BETWEEN_BOUNDS','Attribute\x20\x27','conditions,\x20consider\x20using\x20\x27In\x27\x20operator:\x20operator:\x20{\x20type:\x20In,\x20value:\x20[\x22val1\x22,\x20\x22val2\x22]\x20}','\x27\x20with\x20attribute\x20\x27','success','.source','code','endsWith','9285710mLUJvV','6JDpWEz','length','skipSchema','1786869LEQpGt','.operator.type','invalid_value','MISSING_NAME','description','attribute','66ZFwebn','Value','EMPTY_CONDITIONS','safeParse','conditions','22sKyyQk','.conditions[','Behavior\x20source\x20\x27','Rule\x20conditions\x20array\x20cannot\x20be\x20empty.\x20Add\x20at\x20least\x20one\x20condition.','MISSING_TIME_UNIT','filter','aggregation','error','validationCode','BEHAVIOR_SOURCE_WITH_ATTRIBUTE','arrayMatching','8oRRlkb','BEHAVIOR_SOURCE_MISSING_FILTER','message','document','data','.conditions','type','rule','push','source','INVALID_OPERATOR_TYPE','issues','1209962BYVCRw'];a156_0xca02=function(){return _0x3c344f;};return a156_0xca02();}function zodErrorsToValidationResult(_0x454e33,_0x2fff73){const _0x240dd2=a156_0x5af1,_0x591bf1=flattenZodIssues(_0x454e33[_0x240dd2(0xe1)]),_0x4b52e3=_0x591bf1[_0x240dd2(0xe5)](_0x4d7155=>{const _0xdd28ac=_0x240dd2,_0x52c846=formatZodPath(_0x4d7155[_0xdd28ac(0xe9)]),_0x54ca56=mapZodIssueToCode(_0x4d7155,_0x52c846),_0x2354d7=getLocationFromPath(_0x2fff73[_0xdd28ac(0xd9)],_0x2fff73[_0xdd28ac(0xdf)],_0x4d7155[_0xdd28ac(0xe9)][_0xdd28ac(0xe5)](_0x1c0ad8=>typeof _0x1c0ad8==='symbol'?String(_0x1c0ad8):_0x1c0ad8));return{'level':'error','path':_0x52c846,'code':_0x54ca56,'message':_0x4d7155[_0xdd28ac(0xd8)],..._0x2354d7&&{'location':_0x2354d7}};});return{'valid':![],'errors':_0x4b52e3,'warnings':[]};}function mapZodIssueToCode(_0x1bbdfb,_0x387391){const _0xed6d60=a156_0x5af1,_0x2a42c7=_0x1bbdfb[_0xed6d60(0x104)]===_0xed6d60(0xe4)?_0x1bbdfb['params']:undefined;if(_0x387391===_0xed6d60(0xec))return _0xed6d60(0xc3);if(_0x387391==='rule.type'||_0x387391[_0xed6d60(0x105)]('.type')){if(_0x1bbdfb[_0xed6d60(0x104)]===_0xed6d60(0xc2)){if(_0x387391==='rule.type'||_0x387391[_0xed6d60(0xf6)](/\.conditions\[\d+\]\.type$/))return _0xed6d60(0xf4);}}if(_0x387391['endsWith'](_0xed6d60(0xc1)))return _0xed6d60(0xe0);if(_0x387391[_0xed6d60(0x105)](_0xed6d60(0xf3)))return _0xed6d60(0xf8);if(_0x2a42c7?.['validationCode']==='MISSING_BETWEEN_BOUNDS')return _0xed6d60(0xfe);if(_0x2a42c7?.[_0xed6d60(0xd3)]===_0xed6d60(0xcf))return _0xed6d60(0xcf);if(_0x387391[_0xed6d60(0x105)](_0xed6d60(0xdb))||_0x387391===_0xed6d60(0xca))return _0xed6d60(0xfa);if(_0x387391['includes'](_0xed6d60(0xd5)))return'INVALID_ARRAY_MATCHING';if(_0x387391[_0xed6d60(0x105)]('.segment'))return _0xed6d60(0xed);return'SEGMENT_SCHEMA_ERROR';}function runSemanticChecks(_0x383f53,_0x218a61){const _0x145d91=a156_0x5af1,_0xa2180=[];_0x383f53[_0x145d91(0xdd)]&&_0xa2180[_0x145d91(0xde)](...checkRule(_0x383f53[_0x145d91(0xdd)],_0x145d91(0xdd),_0x218a61));const _0x4d95df=_0xa2180['filter'](_0x55b466=>_0x55b466[_0x145d91(0xe6)]===_0x145d91(0xd2)),_0x19c7c8=_0xa2180[_0x145d91(0xd0)](_0x35c8df=>_0x35c8df['level']==='warning');return{'valid':_0x4d95df[_0x145d91(0x108)]===0x0,'errors':_0x4d95df,'warnings':_0x19c7c8};}function checkRule(_0x37973b,_0x5cfd7a,_0x241737){const _0x483440=a156_0x5af1,_0x199868=[];if(_0x37973b[_0x483440(0xca)]['length']===0x0)return _0x199868[_0x483440(0xde)]({'level':_0x483440(0xd2),'path':_0x5cfd7a+'.conditions','code':_0x483440(0xc8),'message':_0x483440(0xce),'location':getLocationFromPath(_0x241737[_0x483440(0xd9)],_0x241737['source'],pathToArray(_0x5cfd7a+'.conditions'))}),_0x199868;return _0x199868[_0x483440(0xde)](...checkConditions(_0x37973b[_0x483440(0xca)],_0x5cfd7a,_0x241737)),_0x199868;}function checkConditions(_0x5c94c9,_0x14d467,_0x3c4d1d){const _0x46bf3a=a156_0x5af1,_0x1c82cd=[];for(let _0x301a5c=0x0;_0x301a5c<_0x5c94c9[_0x46bf3a(0x108)];_0x301a5c++){const _0xf85bac=_0x5c94c9[_0x301a5c],_0x144686=_0x14d467+_0x46bf3a(0xcc)+_0x301a5c+']';_0x1c82cd[_0x46bf3a(0xde)](...checkCondition(_0xf85bac,_0x144686,_0x3c4d1d));}return _0x1c82cd;}function a156_0x5af1(_0x1ed7d9,_0x5db82d){_0x1ed7d9=_0x1ed7d9-0xc0;const _0xca02a8=a156_0xca02();let _0x5af15d=_0xca02a8[_0x1ed7d9];return _0x5af15d;}function checkCondition(_0x308683,_0x2976bb,_0x48f8ec){const _0x58064e=a156_0x5af1,_0x54fa71=[];if(_0x308683['type']===_0x58064e(0xf9)||_0x308683[_0x58064e(0xdc)]==='Or'){if(_0x308683['conditions'][_0x58064e(0x108)]===0x0)_0x54fa71[_0x58064e(0xde)]({'level':_0x58064e(0xd2),'path':_0x2976bb+_0x58064e(0xdb),'code':_0x58064e(0xc8),'message':_0x308683[_0x58064e(0xdc)]+_0x58064e(0xfc),'location':getLocationFromPath(_0x48f8ec[_0x58064e(0xd9)],_0x48f8ec[_0x58064e(0xdf)],pathToArray(_0x2976bb+_0x58064e(0xdb)))});else{const _0x13d16c=_0x308683[_0x58064e(0xc4)]!==undefined;!_0x13d16c&&_0x54fa71['push']({'level':'warning','path':_0x2976bb,'code':'NESTED_CONDITION_GROUP','message':_0x308683[_0x58064e(0xdc)]+_0x58064e(0xfb)+_0x58064e(0xef)+_0x58064e(0x100),'location':getLocationFromPath(_0x48f8ec[_0x58064e(0xd9)],_0x48f8ec['source'],pathToArray(_0x2976bb))}),_0x54fa71[_0x58064e(0xde)](...checkConditions(_0x308683['conditions'],_0x2976bb,_0x48f8ec));}return _0x54fa71;}if(_0x308683[_0x58064e(0xdc)]===_0x58064e(0xc7)||_0x308683[_0x58064e(0xdc)]===_0x58064e(0xf1)){const _0x5e2beb=_0x308683,_0x16e687=_0x5e2beb[_0x58064e(0xdf)],_0x5e0612=_0x5e2beb[_0x58064e(0xd1)],_0x1c2147=_0x16e687||_0x5e0612;(!_0x5e2beb[_0x58064e(0xc5)]||_0x5e2beb[_0x58064e(0xc5)]==='')&&(!_0x1c2147&&_0x54fa71[_0x58064e(0xde)]({'level':'error','path':_0x2976bb+_0x58064e(0xfd),'code':'EMPTY_ATTRIBUTE','message':'Attribute\x20name\x20cannot\x20be\x20empty','location':getLocationFromPath(_0x48f8ec[_0x58064e(0xd9)],_0x48f8ec[_0x58064e(0xdf)],pathToArray(_0x2976bb+_0x58064e(0xfd)))}));_0x5e2beb[_0x58064e(0xd0)]&&_0x54fa71[_0x58064e(0xde)](...checkRule(_0x5e2beb[_0x58064e(0xd0)],_0x2976bb+_0x58064e(0xf0),_0x48f8ec));if(_0x5e2beb[_0x58064e(0xdf)]){const _0x57d419=_0x5e2beb[_0x58064e(0xc5)]&&_0x5e2beb['attribute']!=='';_0x57d419&&!_0x5e2beb[_0x58064e(0xd0)]&&_0x54fa71[_0x58064e(0xde)]({'level':_0x58064e(0xd2),'path':_0x2976bb+'.source','code':_0x58064e(0xd7),'message':_0x58064e(0xcd)+_0x5e2beb[_0x58064e(0xdf)]+_0x58064e(0x101)+_0x5e2beb[_0x58064e(0xc5)]+'\x27\x20'+_0x58064e(0xee)+_0x58064e(0xe8)+_0x58064e(0xea),'location':getLocationFromPath(_0x48f8ec[_0x58064e(0xd9)],_0x48f8ec[_0x58064e(0xdf)],pathToArray(_0x2976bb+_0x58064e(0x103)))}),_0x57d419&&_0x5e2beb['filter']&&_0x54fa71[_0x58064e(0xde)]({'level':'warning','path':_0x2976bb+'.attribute','code':_0x58064e(0xd4),'message':_0x58064e(0xff)+_0x5e2beb[_0x58064e(0xc5)]+_0x58064e(0xe3)+'For\x20behavior\x20aggregations,\x20use\x20\x27attribute:\x20\x22\x22\x27\x20with\x20Column\x20conditions\x20in\x20filter.','location':getLocationFromPath(_0x48f8ec['document'],_0x48f8ec[_0x58064e(0xdf)],pathToArray(_0x2976bb+_0x58064e(0xfd)))});}}return _0x54fa71;}
|