mirror of
https://github.com/pezkuwichain/pezkuwi-mobile-app.git
synced 2026-05-30 21:31: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 = {\n ...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":91,"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,29],[43,6,16,4],[43,9,16,7,"action"],[43,15,16,13],[44,6,17,4],[44,7,17,5,"VISITED_ROUTE_KEYS"],[44,25,17,23],[44,28,17,26,"visitedRouteKeys"],[45,4,18,2],[45,5,18,3],[46,4,19,2],[46,9,19,7],[46,15,19,13,"route"],[46,20,19,18],[46,24,19,22,"removedRoutes"],[46,37,19,35],[46,39,19,37],[47,6,20,4],[47,10,20,8,"visitedRouteKeys"],[47,26,20,24],[47,27,20,25,"has"],[47,30,20,28],[47,31,20,29,"route"],[47,36,20,34],[47,37,20,35,"key"],[47,40,20,38],[47,41,20,39],[47,43,20,41],[48,8,21,6],[49,8,22,6],[50,6,23,4],[52,6,25,4],[53,6,26,4],[53,12,26,10,"isPrevented"],[53,23,26,21],[53,26,26,24,"beforeRemoveListeners"],[53,47,26,45],[53,48,26,46,"route"],[53,53,26,51],[53,54,26,52,"key"],[53,57,26,55],[53,58,26,56],[53,61,26,59,"beforeRemoveAction"],[53,79,26,77],[53,80,26,78],[54,6,27,4],[54,10,27,8,"isPrevented"],[54,21,27,19],[54,23,27,21],[55,8,28,6],[55,15,28,13],[55,19,28,17],[56,6,29,4],[57,6,30,4,"visitedRouteKeys"],[57,22,30,20],[57,23,30,21,"add"],[57,26,30,24],[57,27,30,25,"route"],[57,32,30,30],[57,33,30,31,"key"],[57,36,30,34],[57,37,30,35],[58,6,31,4],[58,12,31,10,"event"],[58,17,31,15],[58,20,31,18,"emitter"],[58,27,31,25],[58,28,31,26,"emit"],[58,32,31,30],[58,33,31,31],[59,8,32,6,"type"],[59,12,32,10],[59,14,32,12],[59,28,32,26],[60,8,33,6,"target"],[60,14,33,12],[60,16,33,14,"route"],[60,21,33,19],[60,22,33,20,"key"],[60,25,33,23],[61,8,34,6,"data"],[61,12,34,10],[61,14,34,12],[62,10,35,8,"action"],[62,16,35,14],[62,18,35,16,"beforeRemoveAction"],[63,8,36,6],[63,9,36,7],[64,8,37,6,"canPreventDefault"],[64,25,37,23],[64,27,37,25],[65,6,38,4],[65,7,38,5],[65,8,38,6],[66,6,39,4],[66,10,39,8,"event"],[66,15,39,13],[66,16,39,14,"defaultPrevented"],[66,32,39,30],[66,34,39,32],[67,8,40,6],[67,15,40,13],[67,19,40,17],[68,6,41,4],[69,4,42,2],[70,4,43,2],[70,11,43,9],[70,16,43,14],[71,2,44,0],[71,3,44,1],[72,2,45,7],[72,11,45,16,"useOnPreventRemove"],[72,29,45,34,"useOnPreventRemove"],[72,30,45,35],[73,4,46,2,"getState"],[73,12,46,10],[74,4,47,2,"emitter"],[74,11,47,9],[75,4,48,2,"beforeRemoveListeners"],[76,2,49,0],[76,3,49,1],[76,5,49,3],[77,4,50,2],[77,10,50,8],[78,6,51,4,"addKeyedListener"],[79,4,52,2],[79,5,52,3],[79,8,52,6,"React"],[79,13,52,11],[79,14,52,12,"useContext"],[79,24,52,22],[79,25,52,23,"NavigationBuilderContext"],[79,52,52,47],[79,53,52,47,"NavigationBuilderContext"],[79,77,52,47],[79,78,52,48],[80,4,53,2],[80,10,53,8,"route"],[80,15,53,13],[80,18,53,16,"React"],[80,23,53,21],[80,24,53,22,"useContext"],[80,34,53,32],[80,35,53,33,"NavigationRouteContext"],[80,60,53,55],[80,61,53,55,"NavigationRouteContext"],[80,83,53,55],[80,84,53,56],[81,4,54,2],[81,10,54,8,"routeKey"],[81,18,54,16],[81,21,54,19,"route"],[81,26,54,24],[81,28,54,26,"key"],[81,31,54,29],[82,4,55,2,"React"],[82,9,55,7],[82,10,55,8,"useEffect"],[82,19,55,17],[82,20,55,18],[82,26,55,24],[83,6,56,4],[83,10,56,8,"routeKey"],[83,18,56,16],[83,20,56,18],[84,8,57,6],[84,15,57,13,"addKeyedListener"],[84,31,57,29],[84,34,57,32],[84,48,57,46],[84,50,57,48,"routeKey"],[84,58,57,56],[84,60,57,58,"action"],[84,66,57,64],[84,70,57,68],[85,10,58,8],[85,16,58,14,"state"],[85,21,58,19],[85,24,58,22,"getState"],[85,32,58,30],[85,33,58,31],[85,34,58,32],[86,10,59,8],[86,17,59,15,"shouldPreventRemove"],[86,36,59,34],[86,37,59,35,"emitter"],[86,44,59,42],[86,46,59,44,"beforeRemoveListeners"],[86,67,59,65],[86,69,59,67,"state"],[86,74,59,72],[86,75,59,73,"routes"],[86,81,59,79],[86,83,59,81],[86,85,59,83],[86,87,59,85,"action"],[86,93,59,91],[86,94,59,92],[87,8,60,6],[87,9,60,7],[87,10,60,8],[88,6,61,4],[89,4,62,2],[89,5,62,3],[89,7,62,5],[89,8,62,6,"addKeyedListener"],[89,24,62,22],[89,26,62,24,"beforeRemoveListeners"],[89,47,62,45],[89,49,62,47,"emitter"],[89,56,62,54],[89,58,62,56,"getState"],[89,66,62,64],[89,68,62,66,"routeKey"],[89,76,62,74],[89,77,62,75],[89,78,62,76],[90,2,63,0],[91,0,63,1],[91,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"}]} |