mirror of
https://github.com/pezkuwichain/pezkuwi-mobile-app.git
synced 2026-05-30 04:11:02 +00:00
1 line
12 KiB
Plaintext
1 line
12 KiB
Plaintext
{"dependencies":[{"name":"react","data":{"asyncType":null,"isESMImport":true,"locs":[{"start":{"line":3,"column":0,"index":15},"end":{"line":3,"column":31,"index":46}}],"key":"RtGiGa+/H7VrI7GDQDLhO1UbpU8=","exportNames":["*"],"imports":1}},{"name":"./NavigationBuilderContext.js","data":{"asyncType":null,"isESMImport":true,"locs":[{"start":{"line":4,"column":0,"index":47},"end":{"line":4,"column":73,"index":120}}],"key":"vvb+tbs8cGp9hlTxgL5PZCjRz5E=","exportNames":["*"],"imports":1}},{"name":"./NavigationRouteContext.js","data":{"asyncType":null,"isESMImport":true,"locs":[{"start":{"line":5,"column":0,"index":121},"end":{"line":5,"column":69,"index":190}}],"key":"AWXnpGNA5UkH1qQUM7hLv2L9KzI=","exportNames":["*"],"imports":1}}],"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 function _interopNamespace(e) {\n if (e && e.__esModule) return e;\n var n = {};\n if (e) Object.keys(e).forEach(function (k) {\n var d = Object.getOwnPropertyDescriptor(e, k);\n Object.defineProperty(n, k, d.get ? d : {\n enumerable: true,\n get: function () {\n return e[k];\n }\n });\n });\n n.default = e;\n return n;\n }\n Object.defineProperty(exports, \"shouldPreventRemove\", {\n enumerable: true,\n get: function () {\n return shouldPreventRemove;\n }\n });\n exports.useOnPreventRemove = useOnPreventRemove;\n var _react = require(_dependencyMap[0], \"react\");\n var React = _interopNamespace(_react);\n var _NavigationBuilderContextJs = require(_dependencyMap[1], \"./NavigationBuilderContext.js\");\n var _NavigationRouteContextJs = require(_dependencyMap[2], \"./NavigationRouteContext.js\");\n const VISITED_ROUTE_KEYS = Symbol('VISITED_ROUTE_KEYS');\n const shouldPreventRemove = (emitter, beforeRemoveListeners, currentRoutes, nextRoutes, action) => {\n const nextRouteKeys = nextRoutes.map(route => route.key);\n\n // Call these in reverse order so last screens handle the event first\n const removedRoutes = currentRoutes.filter(route => !nextRouteKeys.includes(route.key)).reverse();\n const visitedRouteKeys =\n // @ts-expect-error: add this property to mark that we've already emitted this action\n action[VISITED_ROUTE_KEYS] ?? new Set();\n const beforeRemoveAction = Object.assign({}, action, {\n [VISITED_ROUTE_KEYS]: visitedRouteKeys\n });\n for (const route of removedRoutes) {\n if (visitedRouteKeys.has(route.key)) {\n // Skip if we've already emitted this action for this screen\n continue;\n }\n\n // First, we need to check if any child screens want to prevent it\n const isPrevented = beforeRemoveListeners[route.key]?.(beforeRemoveAction);\n if (isPrevented) {\n return true;\n }\n visitedRouteKeys.add(route.key);\n const event = emitter.emit({\n type: 'beforeRemove',\n target: route.key,\n data: {\n action: beforeRemoveAction\n },\n canPreventDefault: true\n });\n if (event.defaultPrevented) {\n return true;\n }\n }\n return false;\n };\n function useOnPreventRemove({\n getState,\n emitter,\n beforeRemoveListeners\n }) {\n const {\n addKeyedListener\n } = React.useContext(_NavigationBuilderContextJs.NavigationBuilderContext);\n const route = React.useContext(_NavigationRouteContextJs.NavigationRouteContext);\n const routeKey = route?.key;\n React.useEffect(() => {\n if (routeKey) {\n return addKeyedListener?.('beforeRemove', routeKey, action => {\n const state = getState();\n return shouldPreventRemove(emitter, beforeRemoveListeners, state.routes, [], action);\n });\n }\n }, [addKeyedListener, beforeRemoveListeners, emitter, getState, routeKey]);\n }\n});","lineCount":90,"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,1,13],[7,11,1,13,"_interopNamespace"],[7,29,1,13,"e"],[7,30,1,13],[8,4,1,13],[8,8,1,13,"e"],[8,9,1,13],[8,13,1,13,"e"],[8,14,1,13],[8,15,1,13,"__esModule"],[8,25,1,13],[8,34,1,13,"e"],[8,35,1,13],[9,4,1,13],[9,8,1,13,"n"],[9,9,1,13],[10,4,1,13],[10,8,1,13,"e"],[10,9,1,13],[10,11,1,13,"Object"],[10,17,1,13],[10,18,1,13,"keys"],[10,22,1,13],[10,23,1,13,"e"],[10,24,1,13],[10,26,1,13,"forEach"],[10,33,1,13],[10,44,1,13,"k"],[10,45,1,13],[11,6,1,13],[11,10,1,13,"d"],[11,11,1,13],[11,14,1,13,"Object"],[11,20,1,13],[11,21,1,13,"getOwnPropertyDescriptor"],[11,45,1,13],[11,46,1,13,"e"],[11,47,1,13],[11,49,1,13,"k"],[11,50,1,13],[12,6,1,13,"Object"],[12,12,1,13],[12,13,1,13,"defineProperty"],[12,27,1,13],[12,28,1,13,"n"],[12,29,1,13],[12,31,1,13,"k"],[12,32,1,13],[12,34,1,13,"d"],[12,35,1,13],[12,36,1,13,"get"],[12,39,1,13],[12,42,1,13,"d"],[12,43,1,13],[13,8,1,13,"enumerable"],[13,18,1,13],[14,8,1,13,"get"],[14,11,1,13],[14,22,1,13,"get"],[14,23,1,13],[15,10,1,13],[15,17,1,13,"e"],[15,18,1,13],[15,19,1,13,"k"],[15,20,1,13],[16,8,1,13],[17,6,1,13],[18,4,1,13],[19,4,1,13,"n"],[19,5,1,13],[19,6,1,13,"default"],[19,13,1,13],[19,16,1,13,"e"],[19,17,1,13],[20,4,1,13],[20,11,1,13,"n"],[20,12,1,13],[21,2,1,13],[22,2,7,0,"Object"],[22,8,7,0],[22,9,7,0,"defineProperty"],[22,23,7,0],[22,24,7,0,"exports"],[22,31,7,0],[23,4,7,0,"enumerable"],[23,14,7,0],[24,4,7,0,"get"],[24,7,7,0],[24,18,7,0,"get"],[24,19,7,0],[25,6,7,0],[25,13,7,0,"shouldPreventRemove"],[25,32,7,0],[26,4,7,0],[27,2,7,0],[28,2,45,0,"exports"],[28,9,45,0],[28,10,45,0,"useOnPreventRemove"],[28,28,45,0],[28,31,45,0,"useOnPreventRemove"],[28,49,45,0],[29,2,3,0],[29,6,3,0,"_react"],[29,12,3,0],[29,15,3,0,"require"],[29,22,3,0],[29,23,3,0,"_dependencyMap"],[29,37,3,0],[30,2,3,0],[30,6,3,0,"React"],[30,11,3,0],[30,14,3,0,"_interopNamespace"],[30,31,3,0],[30,32,3,0,"_react"],[30,38,3,0],[31,2,4,0],[31,6,4,0,"_NavigationBuilderContextJs"],[31,33,4,0],[31,36,4,0,"require"],[31,43,4,0],[31,44,4,0,"_dependencyMap"],[31,58,4,0],[32,2,5,0],[32,6,5,0,"_NavigationRouteContextJs"],[32,31,5,0],[32,34,5,0,"require"],[32,41,5,0],[32,42,5,0,"_dependencyMap"],[32,56,5,0],[33,2,6,0],[33,8,6,6,"VISITED_ROUTE_KEYS"],[33,26,6,24],[33,29,6,27,"Symbol"],[33,35,6,33],[33,36,6,34],[33,56,6,54],[33,57,6,55],[34,2,7,7],[34,8,7,13,"shouldPreventRemove"],[34,27,7,32],[34,30,7,35,"shouldPreventRemove"],[34,31,7,36,"emitter"],[34,38,7,43],[34,40,7,45,"beforeRemoveListeners"],[34,61,7,66],[34,63,7,68,"currentRoutes"],[34,76,7,81],[34,78,7,83,"nextRoutes"],[34,88,7,93],[34,90,7,95,"action"],[34,96,7,101],[34,101,7,106],[35,4,8,2],[35,10,8,8,"nextRouteKeys"],[35,23,8,21],[35,26,8,24,"nextRoutes"],[35,36,8,34],[35,37,8,35,"map"],[35,40,8,38],[35,41,8,39,"route"],[35,46,8,44],[35,50,8,48,"route"],[35,55,8,53],[35,56,8,54,"key"],[35,59,8,57],[35,60,8,58],[37,4,10,2],[38,4,11,2],[38,10,11,8,"removedRoutes"],[38,23,11,21],[38,26,11,24,"currentRoutes"],[38,39,11,37],[38,40,11,38,"filter"],[38,46,11,44],[38,47,11,45,"route"],[38,52,11,50],[38,56,11,54],[38,57,11,55,"nextRouteKeys"],[38,70,11,68],[38,71,11,69,"includes"],[38,79,11,77],[38,80,11,78,"route"],[38,85,11,83],[38,86,11,84,"key"],[38,89,11,87],[38,90,11,88],[38,91,11,89],[38,92,11,90,"reverse"],[38,99,11,97],[38,100,11,98],[38,101,11,99],[39,4,12,2],[39,10,12,8,"visitedRouteKeys"],[39,26,12,24],[40,4,13,2],[41,4,14,2,"action"],[41,10,14,8],[41,11,14,9,"VISITED_ROUTE_KEYS"],[41,29,14,27],[41,30,14,28],[41,34,14,32],[41,38,14,36,"Set"],[41,41,14,39],[41,42,14,40],[41,43,14,41],[42,4,15,2],[42,10,15,8,"beforeRemoveAction"],[42,28,15,26],[42,31,15,26,"Object"],[42,37,15,26],[42,38,15,26,"assign"],[42,44,15,26],[42,49,16,7,"action"],[42,55,16,13],[43,6,17,4],[43,7,17,5,"VISITED_ROUTE_KEYS"],[43,25,17,23],[43,28,17,26,"visitedRouteKeys"],[44,4,17,42],[44,6,18,3],[45,4,19,2],[45,9,19,7],[45,15,19,13,"route"],[45,20,19,18],[45,24,19,22,"removedRoutes"],[45,37,19,35],[45,39,19,37],[46,6,20,4],[46,10,20,8,"visitedRouteKeys"],[46,26,20,24],[46,27,20,25,"has"],[46,30,20,28],[46,31,20,29,"route"],[46,36,20,34],[46,37,20,35,"key"],[46,40,20,38],[46,41,20,39],[46,43,20,41],[47,8,21,6],[48,8,22,6],[49,6,23,4],[51,6,25,4],[52,6,26,4],[52,12,26,10,"isPrevented"],[52,23,26,21],[52,26,26,24,"beforeRemoveListeners"],[52,47,26,45],[52,48,26,46,"route"],[52,53,26,51],[52,54,26,52,"key"],[52,57,26,55],[52,58,26,56],[52,61,26,59,"beforeRemoveAction"],[52,79,26,77],[52,80,26,78],[53,6,27,4],[53,10,27,8,"isPrevented"],[53,21,27,19],[53,23,27,21],[54,8,28,6],[54,15,28,13],[54,19,28,17],[55,6,29,4],[56,6,30,4,"visitedRouteKeys"],[56,22,30,20],[56,23,30,21,"add"],[56,26,30,24],[56,27,30,25,"route"],[56,32,30,30],[56,33,30,31,"key"],[56,36,30,34],[56,37,30,35],[57,6,31,4],[57,12,31,10,"event"],[57,17,31,15],[57,20,31,18,"emitter"],[57,27,31,25],[57,28,31,26,"emit"],[57,32,31,30],[57,33,31,31],[58,8,32,6,"type"],[58,12,32,10],[58,14,32,12],[58,28,32,26],[59,8,33,6,"target"],[59,14,33,12],[59,16,33,14,"route"],[59,21,33,19],[59,22,33,20,"key"],[59,25,33,23],[60,8,34,6,"data"],[60,12,34,10],[60,14,34,12],[61,10,35,8,"action"],[61,16,35,14],[61,18,35,16,"beforeRemoveAction"],[62,8,36,6],[62,9,36,7],[63,8,37,6,"canPreventDefault"],[63,25,37,23],[63,27,37,25],[64,6,38,4],[64,7,38,5],[64,8,38,6],[65,6,39,4],[65,10,39,8,"event"],[65,15,39,13],[65,16,39,14,"defaultPrevented"],[65,32,39,30],[65,34,39,32],[66,8,40,6],[66,15,40,13],[66,19,40,17],[67,6,41,4],[68,4,42,2],[69,4,43,2],[69,11,43,9],[69,16,43,14],[70,2,44,0],[70,3,44,1],[71,2,45,7],[71,11,45,16,"useOnPreventRemove"],[71,29,45,34,"useOnPreventRemove"],[71,30,45,35],[72,4,46,2,"getState"],[72,12,46,10],[73,4,47,2,"emitter"],[73,11,47,9],[74,4,48,2,"beforeRemoveListeners"],[75,2,49,0],[75,3,49,1],[75,5,49,3],[76,4,50,2],[76,10,50,8],[77,6,51,4,"addKeyedListener"],[78,4,52,2],[78,5,52,3],[78,8,52,6,"React"],[78,13,52,11],[78,14,52,12,"useContext"],[78,24,52,22],[78,25,52,23,"NavigationBuilderContext"],[78,52,52,47],[78,53,52,47,"NavigationBuilderContext"],[78,77,52,47],[78,78,52,48],[79,4,53,2],[79,10,53,8,"route"],[79,15,53,13],[79,18,53,16,"React"],[79,23,53,21],[79,24,53,22,"useContext"],[79,34,53,32],[79,35,53,33,"NavigationRouteContext"],[79,60,53,55],[79,61,53,55,"NavigationRouteContext"],[79,83,53,55],[79,84,53,56],[80,4,54,2],[80,10,54,8,"routeKey"],[80,18,54,16],[80,21,54,19,"route"],[80,26,54,24],[80,28,54,26,"key"],[80,31,54,29],[81,4,55,2,"React"],[81,9,55,7],[81,10,55,8,"useEffect"],[81,19,55,17],[81,20,55,18],[81,26,55,24],[82,6,56,4],[82,10,56,8,"routeKey"],[82,18,56,16],[82,20,56,18],[83,8,57,6],[83,15,57,13,"addKeyedListener"],[83,31,57,29],[83,34,57,32],[83,48,57,46],[83,50,57,48,"routeKey"],[83,58,57,56],[83,60,57,58,"action"],[83,66,57,64],[83,70,57,68],[84,10,58,8],[84,16,58,14,"state"],[84,21,58,19],[84,24,58,22,"getState"],[84,32,58,30],[84,33,58,31],[84,34,58,32],[85,10,59,8],[85,17,59,15,"shouldPreventRemove"],[85,36,59,34],[85,37,59,35,"emitter"],[85,44,59,42],[85,46,59,44,"beforeRemoveListeners"],[85,67,59,65],[85,69,59,67,"state"],[85,74,59,72],[85,75,59,73,"routes"],[85,81,59,79],[85,83,59,81],[85,85,59,83],[85,87,59,85,"action"],[85,93,59,91],[85,94,59,92],[86,8,60,6],[86,9,60,7],[86,10,60,8],[87,6,61,4],[88,4,62,2],[88,5,62,3],[88,7,62,5],[88,8,62,6,"addKeyedListener"],[88,24,62,22],[88,26,62,24,"beforeRemoveListeners"],[88,47,62,45],[88,49,62,47,"emitter"],[88,56,62,54],[88,58,62,56,"getState"],[88,66,62,64],[88,68,62,66,"routeKey"],[88,76,62,74],[88,77,62,75],[88,78,62,76],[89,2,63,0],[90,0,63,1],[90,3]],"functionMap":{"names":["<global>","shouldPreventRemove","nextRoutes.map$argument_0","currentRoutes.filter$argument_0","useOnPreventRemove","React.useEffect$argument_0","addKeyedListener$argument_2"],"mappings":"AAA;mCCM;uCCC,kBD;6CEG,2CF;CDiC;OIC;kBCU;0DCE;ODG;GDE;CJC"},"hasCjsExports":false},"type":"js/module"}]} |