mirror of
https://github.com/pezkuwichain/pezkuwi-mobile-app.git
synced 2026-05-30 15:41:01 +00:00
1 line
15 KiB
Plaintext
1 line
15 KiB
Plaintext
{"dependencies":[],"output":[{"data":{"code":"__d(function (global, require, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) {\n \"use strict\";\n\n Object.defineProperty(exports, '__esModule', {\n value: true\n });\n exports.getActionFromState = getActionFromState;\n function getActionFromState(state, options) {\n // Create a normalized configs object which will be easier to use\n const normalizedConfig = options ? createNormalizedConfigItem(options) : {};\n const routes = state.index != null ? state.routes.slice(0, state.index + 1) : state.routes;\n if (routes.length === 0) {\n return undefined;\n }\n if (!(routes.length === 1 && routes[0].key === undefined || routes.length === 2 && routes[0].key === undefined && routes[0].name === normalizedConfig?.initialRouteName && routes[1].key === undefined)) {\n return {\n type: 'RESET',\n payload: state\n };\n }\n const route = state.routes[state.index ?? state.routes.length - 1];\n let current = route?.state;\n let config = normalizedConfig?.screens?.[route?.name];\n let params = Object.assign({}, route.params);\n const payload = route ? {\n name: route.name,\n path: route.path,\n params\n } : undefined;\n\n // If the screen contains a navigator, pop other screens to navigate to it\n // This avoid pushing multiple instances of navigators onto a stack\n //\n // For example:\n // - RootStack\n // - BottomTabs\n // - SomeScreen\n //\n // In this case, if deep linking to `BottomTabs`, we should pop `SomeScreen`\n // Otherwise, we'll end up with 2 instances of `BottomTabs` in the stack\n //\n // There are 2 ways we can detect if a screen contains a navigator:\n // - The route contains nested state in `route.state`\n // - Nested screens are defined in the config\n if (payload && config?.screens && Object.keys(config.screens).length) {\n payload.pop = true;\n }\n while (current) {\n if (current.routes.length === 0) {\n return undefined;\n }\n const routes = current.index != null ? current.routes.slice(0, current.index + 1) : current.routes;\n const route = routes[routes.length - 1];\n\n // Explicitly set to override existing value when merging params\n Object.assign(params, {\n initial: undefined,\n screen: undefined,\n params: undefined,\n state: undefined\n });\n if (routes.length === 1 && routes[0].key === undefined) {\n params.initial = true;\n params.screen = route.name;\n } else if (routes.length === 2 && routes[0].key === undefined && routes[0].name === config?.initialRouteName && routes[1].key === undefined) {\n params.initial = false;\n params.screen = route.name;\n } else {\n params.state = current;\n break;\n }\n if (route.state) {\n params.params = Object.assign({}, route.params);\n params.pop = true;\n params = params.params;\n } else {\n params.path = route.path;\n params.params = route.params;\n }\n current = route.state;\n config = config?.screens?.[route.name];\n if (config?.screens && Object.keys(config.screens).length) {\n params.pop = true;\n }\n }\n if (payload?.params.screen || payload?.params.state) {\n payload.pop = true;\n }\n if (!payload) {\n return;\n }\n\n // Try to construct payload for a `NAVIGATE` action from the state\n // This lets us preserve the navigation state and not lose it\n return {\n type: 'NAVIGATE',\n payload\n };\n }\n const createNormalizedConfigItem = config => typeof config === 'object' && config != null ? {\n initialRouteName: config.initialRouteName,\n screens: config.screens != null ? createNormalizedConfigs(config.screens) : undefined\n } : {};\n const createNormalizedConfigs = options => Object.entries(options).reduce((acc, [k, v]) => {\n acc[k] = createNormalizedConfigItem(v);\n return acc;\n }, {});\n});","lineCount":108,"map":[[2,2,1,0],[2,14,1,12],[4,2,1,13,"Object"],[4,8,1,13],[4,9,1,13,"defineProperty"],[4,23,1,13],[4,24,1,13,"exports"],[4,31,1,13],[5,4,1,13,"value"],[5,9,1,13],[6,2,1,13],[7,2,3,0,"exports"],[7,9,3,0],[7,10,3,0,"getActionFromState"],[7,28,3,0],[7,31,3,0,"getActionFromState"],[7,49,3,0],[8,2,3,7],[8,11,3,16,"getActionFromState"],[8,29,3,34,"getActionFromState"],[8,30,3,35,"state"],[8,35,3,40],[8,37,3,42,"options"],[8,44,3,49],[8,46,3,51],[9,4,4,2],[10,4,5,2],[10,10,5,8,"normalizedConfig"],[10,26,5,24],[10,29,5,27,"options"],[10,36,5,34],[10,39,5,37,"createNormalizedConfigItem"],[10,65,5,63],[10,66,5,64,"options"],[10,73,5,71],[10,74,5,72],[10,77,5,75],[10,78,5,76],[10,79,5,77],[11,4,6,2],[11,10,6,8,"routes"],[11,16,6,14],[11,19,6,17,"state"],[11,24,6,22],[11,25,6,23,"index"],[11,30,6,28],[11,34,6,32],[11,38,6,36],[11,41,6,39,"state"],[11,46,6,44],[11,47,6,45,"routes"],[11,53,6,51],[11,54,6,52,"slice"],[11,59,6,57],[11,60,6,58],[11,61,6,59],[11,63,6,61,"state"],[11,68,6,66],[11,69,6,67,"index"],[11,74,6,72],[11,77,6,75],[11,78,6,76],[11,79,6,77],[11,82,6,80,"state"],[11,87,6,85],[11,88,6,86,"routes"],[11,94,6,92],[12,4,7,2],[12,8,7,6,"routes"],[12,14,7,12],[12,15,7,13,"length"],[12,21,7,19],[12,26,7,24],[12,27,7,25],[12,29,7,27],[13,6,8,4],[13,13,8,11,"undefined"],[13,22,8,20],[14,4,9,2],[15,4,10,2],[15,8,10,6],[15,10,10,8,"routes"],[15,16,10,14],[15,17,10,15,"length"],[15,23,10,21],[15,28,10,26],[15,29,10,27],[15,33,10,31,"routes"],[15,39,10,37],[15,40,10,38],[15,41,10,39],[15,42,10,40],[15,43,10,41,"key"],[15,46,10,44],[15,51,10,49,"undefined"],[15,60,10,58],[15,64,10,62,"routes"],[15,70,10,68],[15,71,10,69,"length"],[15,77,10,75],[15,82,10,80],[15,83,10,81],[15,87,10,85,"routes"],[15,93,10,91],[15,94,10,92],[15,95,10,93],[15,96,10,94],[15,97,10,95,"key"],[15,100,10,98],[15,105,10,103,"undefined"],[15,114,10,112],[15,118,10,116,"routes"],[15,124,10,122],[15,125,10,123],[15,126,10,124],[15,127,10,125],[15,128,10,126,"name"],[15,132,10,130],[15,137,10,135,"normalizedConfig"],[15,153,10,151],[15,155,10,153,"initialRouteName"],[15,171,10,169],[15,175,10,173,"routes"],[15,181,10,179],[15,182,10,180],[15,183,10,181],[15,184,10,182],[15,185,10,183,"key"],[15,188,10,186],[15,193,10,191,"undefined"],[15,202,10,200],[15,203,10,201],[15,205,10,203],[16,6,11,4],[16,13,11,11],[17,8,12,6,"type"],[17,12,12,10],[17,14,12,12],[17,21,12,19],[18,8,13,6,"payload"],[18,15,13,13],[18,17,13,15,"state"],[19,6,14,4],[19,7,14,5],[20,4,15,2],[21,4,16,2],[21,10,16,8,"route"],[21,15,16,13],[21,18,16,16,"state"],[21,23,16,21],[21,24,16,22,"routes"],[21,30,16,28],[21,31,16,29,"state"],[21,36,16,34],[21,37,16,35,"index"],[21,42,16,40],[21,46,16,44,"state"],[21,51,16,49],[21,52,16,50,"routes"],[21,58,16,56],[21,59,16,57,"length"],[21,65,16,63],[21,68,16,66],[21,69,16,67],[21,70,16,68],[22,4,17,2],[22,8,17,6,"current"],[22,15,17,13],[22,18,17,16,"route"],[22,23,17,21],[22,25,17,23,"state"],[22,30,17,28],[23,4,18,2],[23,8,18,6,"config"],[23,14,18,12],[23,17,18,15,"normalizedConfig"],[23,33,18,31],[23,35,18,33,"screens"],[23,42,18,40],[23,45,18,43,"route"],[23,50,18,48],[23,52,18,50,"name"],[23,56,18,54],[23,57,18,55],[24,4,19,2],[24,8,19,6,"params"],[24,14,19,12],[24,17,19,12,"Object"],[24,23,19,12],[24,24,19,12,"assign"],[24,30,19,12],[24,35,20,7,"route"],[24,40,20,12],[24,41,20,13,"params"],[24,47,20,19],[24,48,21,3],[25,4,22,2],[25,10,22,8,"payload"],[25,17,22,15],[25,20,22,18,"route"],[25,25,22,23],[25,28,22,26],[26,6,23,4,"name"],[26,10,23,8],[26,12,23,10,"route"],[26,17,23,15],[26,18,23,16,"name"],[26,22,23,20],[27,6,24,4,"path"],[27,10,24,8],[27,12,24,10,"route"],[27,17,24,15],[27,18,24,16,"path"],[27,22,24,20],[28,6,25,4,"params"],[29,4,26,2],[29,5,26,3],[29,8,26,6,"undefined"],[29,17,26,15],[31,4,28,2],[32,4,29,2],[33,4,30,2],[34,4,31,2],[35,4,32,2],[36,4,33,2],[37,4,34,2],[38,4,35,2],[39,4,36,2],[40,4,37,2],[41,4,38,2],[42,4,39,2],[43,4,40,2],[44,4,41,2],[45,4,42,2],[45,8,42,6,"payload"],[45,15,42,13],[45,19,42,17,"config"],[45,25,42,23],[45,27,42,25,"screens"],[45,34,42,32],[45,38,42,36,"Object"],[45,44,42,42],[45,45,42,43,"keys"],[45,49,42,47],[45,50,42,48,"config"],[45,56,42,54],[45,57,42,55,"screens"],[45,64,42,62],[45,65,42,63],[45,66,42,64,"length"],[45,72,42,70],[45,74,42,72],[46,6,43,4,"payload"],[46,13,43,11],[46,14,43,12,"pop"],[46,17,43,15],[46,20,43,18],[46,24,43,22],[47,4,44,2],[48,4,45,2],[48,11,45,9,"current"],[48,18,45,16],[48,20,45,18],[49,6,46,4],[49,10,46,8,"current"],[49,17,46,15],[49,18,46,16,"routes"],[49,24,46,22],[49,25,46,23,"length"],[49,31,46,29],[49,36,46,34],[49,37,46,35],[49,39,46,37],[50,8,47,6],[50,15,47,13,"undefined"],[50,24,47,22],[51,6,48,4],[52,6,49,4],[52,12,49,10,"routes"],[52,18,49,16],[52,21,49,19,"current"],[52,28,49,26],[52,29,49,27,"index"],[52,34,49,32],[52,38,49,36],[52,42,49,40],[52,45,49,43,"current"],[52,52,49,50],[52,53,49,51,"routes"],[52,59,49,57],[52,60,49,58,"slice"],[52,65,49,63],[52,66,49,64],[52,67,49,65],[52,69,49,67,"current"],[52,76,49,74],[52,77,49,75,"index"],[52,82,49,80],[52,85,49,83],[52,86,49,84],[52,87,49,85],[52,90,49,88,"current"],[52,97,49,95],[52,98,49,96,"routes"],[52,104,49,102],[53,6,50,4],[53,12,50,10,"route"],[53,17,50,15],[53,20,50,18,"routes"],[53,26,50,24],[53,27,50,25,"routes"],[53,33,50,31],[53,34,50,32,"length"],[53,40,50,38],[53,43,50,41],[53,44,50,42],[53,45,50,43],[55,6,52,4],[56,6,53,4,"Object"],[56,12,53,10],[56,13,53,11,"assign"],[56,19,53,17],[56,20,53,18,"params"],[56,26,53,24],[56,28,53,26],[57,8,54,6,"initial"],[57,15,54,13],[57,17,54,15,"undefined"],[57,26,54,24],[58,8,55,6,"screen"],[58,14,55,12],[58,16,55,14,"undefined"],[58,25,55,23],[59,8,56,6,"params"],[59,14,56,12],[59,16,56,14,"undefined"],[59,25,56,23],[60,8,57,6,"state"],[60,13,57,11],[60,15,57,13,"undefined"],[61,6,58,4],[61,7,58,5],[61,8,58,6],[62,6,59,4],[62,10,59,8,"routes"],[62,16,59,14],[62,17,59,15,"length"],[62,23,59,21],[62,28,59,26],[62,29,59,27],[62,33,59,31,"routes"],[62,39,59,37],[62,40,59,38],[62,41,59,39],[62,42,59,40],[62,43,59,41,"key"],[62,46,59,44],[62,51,59,49,"undefined"],[62,60,59,58],[62,62,59,60],[63,8,60,6,"params"],[63,14,60,12],[63,15,60,13,"initial"],[63,22,60,20],[63,25,60,23],[63,29,60,27],[64,8,61,6,"params"],[64,14,61,12],[64,15,61,13,"screen"],[64,21,61,19],[64,24,61,22,"route"],[64,29,61,27],[64,30,61,28,"name"],[64,34,61,32],[65,6,62,4],[65,7,62,5],[65,13,62,11],[65,17,62,15,"routes"],[65,23,62,21],[65,24,62,22,"length"],[65,30,62,28],[65,35,62,33],[65,36,62,34],[65,40,62,38,"routes"],[65,46,62,44],[65,47,62,45],[65,48,62,46],[65,49,62,47],[65,50,62,48,"key"],[65,53,62,51],[65,58,62,56,"undefined"],[65,67,62,65],[65,71,62,69,"routes"],[65,77,62,75],[65,78,62,76],[65,79,62,77],[65,80,62,78],[65,81,62,79,"name"],[65,85,62,83],[65,90,62,88,"config"],[65,96,62,94],[65,98,62,96,"initialRouteName"],[65,114,62,112],[65,118,62,116,"routes"],[65,124,62,122],[65,125,62,123],[65,126,62,124],[65,127,62,125],[65,128,62,126,"key"],[65,131,62,129],[65,136,62,134,"undefined"],[65,145,62,143],[65,147,62,145],[66,8,63,6,"params"],[66,14,63,12],[66,15,63,13,"initial"],[66,22,63,20],[66,25,63,23],[66,30,63,28],[67,8,64,6,"params"],[67,14,64,12],[67,15,64,13,"screen"],[67,21,64,19],[67,24,64,22,"route"],[67,29,64,27],[67,30,64,28,"name"],[67,34,64,32],[68,6,65,4],[68,7,65,5],[68,13,65,11],[69,8,66,6,"params"],[69,14,66,12],[69,15,66,13,"state"],[69,20,66,18],[69,23,66,21,"current"],[69,30,66,28],[70,8,67,6],[71,6,68,4],[72,6,69,4],[72,10,69,8,"route"],[72,15,69,13],[72,16,69,14,"state"],[72,21,69,19],[72,23,69,21],[73,8,70,6,"params"],[73,14,70,12],[73,15,70,13,"params"],[73,21,70,19],[73,24,70,19,"Object"],[73,30,70,19],[73,31,70,19,"assign"],[73,37,70,19],[73,42,71,11,"route"],[73,47,71,16],[73,48,71,17,"params"],[73,54,71,23],[73,55,72,7],[74,8,73,6,"params"],[74,14,73,12],[74,15,73,13,"pop"],[74,18,73,16],[74,21,73,19],[74,25,73,23],[75,8,74,6,"params"],[75,14,74,12],[75,17,74,15,"params"],[75,23,74,21],[75,24,74,22,"params"],[75,30,74,28],[76,6,75,4],[76,7,75,5],[76,13,75,11],[77,8,76,6,"params"],[77,14,76,12],[77,15,76,13,"path"],[77,19,76,17],[77,22,76,20,"route"],[77,27,76,25],[77,28,76,26,"path"],[77,32,76,30],[78,8,77,6,"params"],[78,14,77,12],[78,15,77,13,"params"],[78,21,77,19],[78,24,77,22,"route"],[78,29,77,27],[78,30,77,28,"params"],[78,36,77,34],[79,6,78,4],[80,6,79,4,"current"],[80,13,79,11],[80,16,79,14,"route"],[80,21,79,19],[80,22,79,20,"state"],[80,27,79,25],[81,6,80,4,"config"],[81,12,80,10],[81,15,80,13,"config"],[81,21,80,19],[81,23,80,21,"screens"],[81,30,80,28],[81,33,80,31,"route"],[81,38,80,36],[81,39,80,37,"name"],[81,43,80,41],[81,44,80,42],[82,6,81,4],[82,10,81,8,"config"],[82,16,81,14],[82,18,81,16,"screens"],[82,25,81,23],[82,29,81,27,"Object"],[82,35,81,33],[82,36,81,34,"keys"],[82,40,81,38],[82,41,81,39,"config"],[82,47,81,45],[82,48,81,46,"screens"],[82,55,81,53],[82,56,81,54],[82,57,81,55,"length"],[82,63,81,61],[82,65,81,63],[83,8,82,6,"params"],[83,14,82,12],[83,15,82,13,"pop"],[83,18,82,16],[83,21,82,19],[83,25,82,23],[84,6,83,4],[85,4,84,2],[86,4,85,2],[86,8,85,6,"payload"],[86,15,85,13],[86,17,85,15,"params"],[86,23,85,21],[86,24,85,22,"screen"],[86,30,85,28],[86,34,85,32,"payload"],[86,41,85,39],[86,43,85,41,"params"],[86,49,85,47],[86,50,85,48,"state"],[86,55,85,53],[86,57,85,55],[87,6,86,4,"payload"],[87,13,86,11],[87,14,86,12,"pop"],[87,17,86,15],[87,20,86,18],[87,24,86,22],[88,4,87,2],[89,4,88,2],[89,8,88,6],[89,9,88,7,"payload"],[89,16,88,14],[89,18,88,16],[90,6,89,4],[91,4,90,2],[93,4,92,2],[94,4,93,2],[95,4,94,2],[95,11,94,9],[96,6,95,4,"type"],[96,10,95,8],[96,12,95,10],[96,22,95,20],[97,6,96,4,"payload"],[98,4,97,2],[98,5,97,3],[99,2,98,0],[100,2,99,0],[100,8,99,6,"createNormalizedConfigItem"],[100,34,99,32],[100,37,99,35,"config"],[100,43,99,41],[100,47,99,45],[100,54,99,52,"config"],[100,60,99,58],[100,65,99,63],[100,73,99,71],[100,77,99,75,"config"],[100,83,99,81],[100,87,99,85],[100,91,99,89],[100,94,99,92],[101,4,100,2,"initialRouteName"],[101,20,100,18],[101,22,100,20,"config"],[101,28,100,26],[101,29,100,27,"initialRouteName"],[101,45,100,43],[102,4,101,2,"screens"],[102,11,101,9],[102,13,101,11,"config"],[102,19,101,17],[102,20,101,18,"screens"],[102,27,101,25],[102,31,101,29],[102,35,101,33],[102,38,101,36,"createNormalizedConfigs"],[102,61,101,59],[102,62,101,60,"config"],[102,68,101,66],[102,69,101,67,"screens"],[102,76,101,74],[102,77,101,75],[102,80,101,78,"undefined"],[103,2,102,0],[103,3,102,1],[103,6,102,4],[103,7,102,5],[103,8,102,6],[104,2,103,0],[104,8,103,6,"createNormalizedConfigs"],[104,31,103,29],[104,34,103,32,"options"],[104,41,103,39],[104,45,103,43,"Object"],[104,51,103,49],[104,52,103,50,"entries"],[104,59,103,57],[104,60,103,58,"options"],[104,67,103,65],[104,68,103,66],[104,69,103,67,"reduce"],[104,75,103,73],[104,76,103,74],[104,77,103,75,"acc"],[104,80,103,78],[104,82,103,80],[104,83,103,81,"k"],[104,84,103,82],[104,86,103,84,"v"],[104,87,103,85],[104,88,103,86],[104,93,103,91],[105,4,104,2,"acc"],[105,7,104,5],[105,8,104,6,"k"],[105,9,104,7],[105,10,104,8],[105,13,104,11,"createNormalizedConfigItem"],[105,39,104,37],[105,40,104,38,"v"],[105,41,104,39],[105,42,104,40],[106,4,105,2],[106,11,105,9,"acc"],[106,14,105,12],[107,2,106,0],[107,3,106,1],[107,5,106,3],[107,6,106,4],[107,7,106,5],[107,8,106,6],[108,0,106,7],[108,3]],"functionMap":{"names":["<global>","getActionFromState","createNormalizedConfigItem","createNormalizedConfigs","Object.entries.reduce$argument_0"],"mappings":"AAA;OCE;CD+F;mCEC;MFG;gCGC,0CC;CDG,KH"},"hasCjsExports":false},"type":"js/module"}]} |