{"dependencies":[{"name":"@react-navigation/core","data":{"asyncType":null,"isESMImport":true,"locs":[{"start":{"line":3,"column":0,"index":15},"end":{"line":3,"column":196,"index":211}}],"key":"Wm75LgE4xYscVWo0KoLFlflJQCo=","exportNames":["*"],"imports":1}},{"name":"react","data":{"asyncType":null,"isESMImport":true,"locs":[{"start":{"line":4,"column":0,"index":212},"end":{"line":4,"column":31,"index":243}}],"key":"RtGiGa+/H7VrI7GDQDLhO1UbpU8=","exportNames":["*"],"imports":1}},{"name":"./LinkingContext.js","data":{"asyncType":null,"isESMImport":true,"locs":[{"start":{"line":5,"column":0,"index":244},"end":{"line":5,"column":53,"index":297}}],"key":"r/0Yvi+HouDAqn4vN4m4I6AMfEI=","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 exports.useLinkBuilder = useLinkBuilder;\n var _reactNavigationCore = require(_dependencyMap[0], \"@react-navigation/core\");\n var _react = require(_dependencyMap[1], \"react\");\n var React = _interopNamespace(_react);\n var _LinkingContextJs = require(_dependencyMap[2], \"./LinkingContext.js\");\n /**\n * Helpers to build href or action based on the linking options.\n *\n * @returns `buildHref` to build an `href` for screen and `buildAction` to build an action from an `href`.\n */\n function useLinkBuilder() {\n var _options$getPathFromS, _options$getStateFrom, _options$getActionFro;\n var navigation = React.useContext(_reactNavigationCore.NavigationHelpersContext);\n var route = React.useContext(_reactNavigationCore.NavigationRouteContext);\n var _React$useContext = React.useContext(_LinkingContextJs.LinkingContext),\n options = _React$useContext.options;\n var focusedRouteState = (0, _reactNavigationCore.useStateForPath)();\n var getPathFromStateHelper = (_options$getPathFromS = options == null ? void 0 : options.getPathFromState) != null ? _options$getPathFromS : _reactNavigationCore.getPathFromState;\n var getStateFromPathHelper = (_options$getStateFrom = options == null ? void 0 : options.getStateFromPath) != null ? _options$getStateFrom : _reactNavigationCore.getStateFromPath;\n var getActionFromStateHelper = (_options$getActionFro = options == null ? void 0 : options.getActionFromState) != null ? _options$getActionFro : _reactNavigationCore.getActionFromState;\n var buildHref = React.useCallback(function (name, params) {\n var _findFocusedRoute;\n if ((options == null ? void 0 : options.enabled) === false) {\n return undefined;\n }\n\n // Check that we're inside:\n // - navigator's context\n // - route context of the navigator (could be a screen, tab, etc.)\n // - route matches the state for path (from the screen's context)\n // This ensures that we're inside a screen\n var isScreen = navigation && route != null && route.key && focusedRouteState ? route.key === ((_findFocusedRoute = (0, _reactNavigationCore.findFocusedRoute)(focusedRouteState)) == null ? void 0 : _findFocusedRoute.key) && navigation.getState().routes.some(function (r) {\n return r.key === route.key;\n }) : false;\n var stateForRoute = {\n routes: [{\n name: name,\n params: params\n }]\n };\n var _constructState = function constructState(state) {\n if (state) {\n var _route = state.routes[0];\n\n // If we're inside a screen and at the innermost route\n // We need to replace the state with the provided one\n // This assumes that we're navigating to a sibling route\n if (isScreen && !_route.state) {\n return stateForRoute;\n }\n\n // Otherwise, dive into the nested state of the route\n return {\n routes: [Object.assign({}, _route, {\n state: _constructState(_route.state)\n })]\n };\n }\n\n // Once there is no more nested state, we're at the innermost route\n // We can add a state based on provided parameters\n // This assumes that we're navigating to a child of this route\n // In this case, the helper is used in a navigator for its routes\n return stateForRoute;\n };\n var state = _constructState(focusedRouteState);\n var path = getPathFromStateHelper(state, options == null ? void 0 : options.config);\n return path;\n }, [options == null ? void 0 : options.enabled, options == null ? void 0 : options.config, route == null ? void 0 : route.key, navigation, focusedRouteState, getPathFromStateHelper]);\n var buildAction = React.useCallback(function (href) {\n if (!href.startsWith('/')) {\n throw new Error(`The href must start with '/' (${href}).`);\n }\n var state = getStateFromPathHelper(href, options == null ? void 0 : options.config);\n if (state) {\n var action = getActionFromStateHelper(state, options == null ? void 0 : options.config);\n return action != null ? action : _reactNavigationCore.CommonActions.reset(state);\n } else {\n throw new Error('Failed to parse the href to a navigation state.');\n }\n }, [options == null ? void 0 : options.config, getStateFromPathHelper, getActionFromStateHelper]);\n return {\n buildHref: buildHref,\n buildAction: buildAction\n };\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,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,11,0,"exports"],[22,9,11,0],[22,10,11,0,"useLinkBuilder"],[22,24,11,0],[22,27,11,0,"useLinkBuilder"],[22,41,11,0],[23,2,3,0],[23,6,3,0,"_reactNavigationCore"],[23,26,3,0],[23,29,3,0,"require"],[23,36,3,0],[23,37,3,0,"_dependencyMap"],[23,51,3,0],[24,2,4,0],[24,6,4,0,"_react"],[24,12,4,0],[24,15,4,0,"require"],[24,22,4,0],[24,23,4,0,"_dependencyMap"],[24,37,4,0],[25,2,4,0],[25,6,4,0,"React"],[25,11,4,0],[25,14,4,0,"_interopNamespace"],[25,31,4,0],[25,32,4,0,"_react"],[25,38,4,0],[26,2,5,0],[26,6,5,0,"_LinkingContextJs"],[26,23,5,0],[26,26,5,0,"require"],[26,33,5,0],[26,34,5,0,"_dependencyMap"],[26,48,5,0],[27,2,6,0],[28,0,7,0],[29,0,8,0],[30,0,9,0],[31,0,10,0],[32,2,11,7],[32,11,11,16,"useLinkBuilder"],[32,25,11,30,"useLinkBuilder"],[32,26,11,30],[32,28,11,33],[33,4,11,33],[33,8,11,33,"_options$getPathFromS"],[33,29,11,33],[33,31,11,33,"_options$getStateFrom"],[33,52,11,33],[33,54,11,33,"_options$getActionFro"],[33,75,11,33],[34,4,12,2],[34,8,12,8,"navigation"],[34,18,12,18],[34,21,12,21,"React"],[34,26,12,26],[34,27,12,27,"useContext"],[34,37,12,37],[34,38,12,38,"NavigationHelpersContext"],[34,58,12,62],[34,59,12,62,"NavigationHelpersContext"],[34,83,12,62],[34,84,12,63],[35,4,13,2],[35,8,13,8,"route"],[35,13,13,13],[35,16,13,16,"React"],[35,21,13,21],[35,22,13,22,"useContext"],[35,32,13,32],[35,33,13,33,"NavigationRouteContext"],[35,53,13,55],[35,54,13,55,"NavigationRouteContext"],[35,76,13,55],[35,77,13,56],[36,4,14,2],[36,8,14,2,"_React$useContext"],[36,25,14,2],[36,28,16,6,"React"],[36,33,16,11],[36,34,16,12,"useContext"],[36,44,16,22],[36,45,16,23,"LinkingContext"],[36,62,16,37],[36,63,16,37,"LinkingContext"],[36,77,16,37],[36,78,16,38],[37,6,15,4,"options"],[37,13,15,11],[37,16,15,11,"_React$useContext"],[37,33,15,11],[37,34,15,4,"options"],[37,41,15,11],[38,4,17,2],[38,8,17,8,"focusedRouteState"],[38,25,17,25],[38,28,17,28],[38,32,17,28,"useStateForPath"],[38,52,17,43],[38,53,17,43,"useStateForPath"],[38,68,17,43],[38,70,17,44],[38,71,17,45],[39,4,18,2],[39,8,18,8,"getPathFromStateHelper"],[39,30,18,30],[39,34,18,30,"_options$getPathFromS"],[39,55,18,30],[39,58,18,33,"options"],[39,65,18,40],[39,85,18,33,"options"],[39,92,18,40],[39,93,18,42,"getPathFromState"],[39,109,18,58],[39,121,18,58,"_options$getPathFromS"],[39,142,18,58],[39,145,18,62,"getPathFromState"],[39,165,18,78],[39,166,18,78,"getPathFromState"],[39,182,18,78],[40,4,19,2],[40,8,19,8,"getStateFromPathHelper"],[40,30,19,30],[40,34,19,30,"_options$getStateFrom"],[40,55,19,30],[40,58,19,33,"options"],[40,65,19,40],[40,85,19,33,"options"],[40,92,19,40],[40,93,19,42,"getStateFromPath"],[40,109,19,58],[40,121,19,58,"_options$getStateFrom"],[40,142,19,58],[40,145,19,62,"getStateFromPath"],[40,165,19,78],[40,166,19,78,"getStateFromPath"],[40,182,19,78],[41,4,20,2],[41,8,20,8,"getActionFromStateHelper"],[41,32,20,32],[41,36,20,32,"_options$getActionFro"],[41,57,20,32],[41,60,20,35,"options"],[41,67,20,42],[41,87,20,35,"options"],[41,94,20,42],[41,95,20,44,"getActionFromState"],[41,113,20,62],[41,125,20,62,"_options$getActionFro"],[41,146,20,62],[41,149,20,66,"getActionFromState"],[41,169,20,84],[41,170,20,84,"getActionFromState"],[41,188,20,84],[42,4,21,2],[42,8,21,8,"buildHref"],[42,17,21,17],[42,20,21,20,"React"],[42,25,21,25],[42,26,21,26,"useCallback"],[42,37,21,37],[42,38,21,38],[42,48,21,39,"name"],[42,52,21,43],[42,54,21,45,"params"],[42,60,21,51],[42,62,21,56],[43,6,21,56],[43,10,21,56,"_findFocusedRoute"],[43,27,21,56],[44,6,22,4],[44,10,22,8],[44,11,22,8,"options"],[44,18,22,15],[44,38,22,8,"options"],[44,45,22,15],[44,46,22,17,"enabled"],[44,53,22,24],[44,59,22,29],[44,64,22,34],[44,66,22,36],[45,8,23,6],[45,15,23,13,"undefined"],[45,24,23,22],[46,6,24,4],[48,6,26,4],[49,6,27,4],[50,6,28,4],[51,6,29,4],[52,6,30,4],[53,6,31,4],[53,10,31,10,"isScreen"],[53,18,31,18],[53,21,31,21,"navigation"],[53,31,31,31],[53,35,31,35,"route"],[53,40,31,40],[53,52,31,35,"route"],[53,57,31,40],[53,58,31,42,"key"],[53,61,31,45],[53,65,31,49,"focusedRouteState"],[53,82,31,66],[53,85,31,69,"route"],[53,90,31,74],[53,91,31,75,"key"],[53,94,31,78],[53,101,31,78,"_findFocusedRoute"],[53,118,31,78],[53,121,31,83],[53,125,31,83,"findFocusedRoute"],[53,145,31,99],[53,146,31,99,"findFocusedRoute"],[53,162,31,99],[53,164,31,100,"focusedRouteState"],[53,181,31,117],[53,182,31,118],[53,203,31,83,"_findFocusedRoute"],[53,220,31,83],[53,221,31,120,"key"],[53,224,31,123],[53,229,31,127,"navigation"],[53,239,31,137],[53,240,31,138,"getState"],[53,248,31,146],[53,249,31,147],[53,250,31,148],[53,251,31,149,"routes"],[53,257,31,155],[53,258,31,156,"some"],[53,262,31,160],[53,263,31,161],[53,273,31,161,"r"],[53,274,31,162],[54,8,31,162],[54,15,31,166,"r"],[54,16,31,167],[54,17,31,168,"key"],[54,20,31,171],[54,25,31,176,"route"],[54,30,31,181],[54,31,31,182,"key"],[54,34,31,185],[55,6,31,185],[55,8,31,186],[55,11,31,189],[55,16,31,194],[56,6,32,4],[56,10,32,10,"stateForRoute"],[56,23,32,23],[56,26,32,26],[57,8,33,6,"routes"],[57,14,33,12],[57,16,33,14],[57,17,33,15],[58,10,34,8,"name"],[58,14,34,12],[58,16,34,8,"name"],[58,20,34,12],[59,10,35,8,"params"],[59,16,35,14],[59,18,35,8,"params"],[60,8,36,6],[60,9,36,7],[61,6,37,4],[61,7,37,5],[62,6,38,4],[62,10,38,10,"constructState"],[62,25,38,24],[62,28,38,27],[62,37,38,10,"constructState"],[62,51,38,24,"constructState"],[62,52,38,27,"state"],[62,57,38,32],[62,59,38,36],[63,8,39,6],[63,12,39,10,"state"],[63,17,39,15],[63,19,39,17],[64,10,40,8],[64,14,40,14,"route"],[64,20,40,19],[64,23,40,22,"state"],[64,28,40,27],[64,29,40,28,"routes"],[64,35,40,34],[64,36,40,35],[64,37,40,36],[64,38,40,37],[66,10,42,8],[67,10,43,8],[68,10,44,8],[69,10,45,8],[69,14,45,12,"isScreen"],[69,22,45,20],[69,26,45,24],[69,27,45,25,"route"],[69,33,45,30],[69,34,45,31,"state"],[69,39,45,36],[69,41,45,38],[70,12,46,10],[70,19,46,17,"stateForRoute"],[70,32,46,30],[71,10,47,8],[73,10,49,8],[74,10,50,8],[74,17,50,15],[75,12,51,10,"routes"],[75,18,51,16],[75,20,51,18],[75,21,51,18,"Object"],[75,27,51,18],[75,28,51,18,"assign"],[75,34,51,18],[75,39,52,15,"route"],[75,45,52,20],[76,14,53,12,"state"],[76,19,53,17],[76,21,53,19,"constructState"],[76,36,53,33],[76,37,53,34,"route"],[76,43,53,39],[76,44,53,40,"state"],[76,49,53,45],[77,12,53,46],[78,10,55,8],[78,11,55,9],[79,8,56,6],[81,8,58,6],[82,8,59,6],[83,8,60,6],[84,8,61,6],[85,8,62,6],[85,15,62,13,"stateForRoute"],[85,28,62,26],[86,6,63,4],[86,7,63,5],[87,6,64,4],[87,10,64,10,"state"],[87,15,64,15],[87,18,64,18,"constructState"],[87,33,64,32],[87,34,64,33,"focusedRouteState"],[87,51,64,50],[87,52,64,51],[88,6,65,4],[88,10,65,10,"path"],[88,14,65,14],[88,17,65,17,"getPathFromStateHelper"],[88,39,65,39],[88,40,65,40,"state"],[88,45,65,45],[88,47,65,47,"options"],[88,54,65,54],[88,74,65,47,"options"],[88,81,65,54],[88,82,65,56,"config"],[88,88,65,62],[88,89,65,63],[89,6,66,4],[89,13,66,11,"path"],[89,17,66,15],[90,4,67,2],[90,5,67,3],[90,7,67,5],[90,8,67,6,"options"],[90,15,67,13],[90,35,67,6,"options"],[90,42,67,13],[90,43,67,15,"enabled"],[90,50,67,22],[90,52,67,24,"options"],[90,59,67,31],[90,79,67,24,"options"],[90,86,67,31],[90,87,67,33,"config"],[90,93,67,39],[90,95,67,41,"route"],[90,100,67,46],[90,120,67,41,"route"],[90,125,67,46],[90,126,67,48,"key"],[90,129,67,51],[90,131,67,53,"navigation"],[90,141,67,63],[90,143,67,65,"focusedRouteState"],[90,160,67,82],[90,162,67,84,"getPathFromStateHelper"],[90,184,67,106],[90,185,67,107],[90,186,67,108],[91,4,68,2],[91,8,68,8,"buildAction"],[91,19,68,19],[91,22,68,22,"React"],[91,27,68,27],[91,28,68,28,"useCallback"],[91,39,68,39],[91,40,68,40],[91,50,68,40,"href"],[91,54,68,44],[91,56,68,48],[92,6,69,4],[92,10,69,8],[92,11,69,9,"href"],[92,15,69,13],[92,16,69,14,"startsWith"],[92,26,69,24],[92,27,69,25],[92,30,69,28],[92,31,69,29],[92,33,69,31],[93,8,70,6],[93,14,70,12],[93,18,70,16,"Error"],[93,23,70,21],[93,24,70,22],[93,57,70,55,"href"],[93,61,70,59],[93,65,70,63],[93,66,70,64],[94,6,71,4],[95,6,72,4],[95,10,72,10,"state"],[95,15,72,15],[95,18,72,18,"getStateFromPathHelper"],[95,40,72,40],[95,41,72,41,"href"],[95,45,72,45],[95,47,72,47,"options"],[95,54,72,54],[95,74,72,47,"options"],[95,81,72,54],[95,82,72,56,"config"],[95,88,72,62],[95,89,72,63],[96,6,73,4],[96,10,73,8,"state"],[96,15,73,13],[96,17,73,15],[97,8,74,6],[97,12,74,12,"action"],[97,18,74,18],[97,21,74,21,"getActionFromStateHelper"],[97,45,74,45],[97,46,74,46,"state"],[97,51,74,51],[97,53,74,53,"options"],[97,60,74,60],[97,80,74,53,"options"],[97,87,74,60],[97,88,74,62,"config"],[97,94,74,68],[97,95,74,69],[98,8,75,6],[98,15,75,13,"action"],[98,21,75,19],[98,32,75,13,"action"],[98,38,75,19],[98,41,75,23,"CommonActions"],[98,61,75,36],[98,62,75,36,"CommonActions"],[98,75,75,36],[98,76,75,37,"reset"],[98,81,75,42],[98,82,75,43,"state"],[98,87,75,48],[98,88,75,49],[99,6,76,4],[99,7,76,5],[99,13,76,11],[100,8,77,6],[100,14,77,12],[100,18,77,16,"Error"],[100,23,77,21],[100,24,77,22],[100,73,77,71],[100,74,77,72],[101,6,78,4],[102,4,79,2],[102,5,79,3],[102,7,79,5],[102,8,79,6,"options"],[102,15,79,13],[102,35,79,6,"options"],[102,42,79,13],[102,43,79,15,"config"],[102,49,79,21],[102,51,79,23,"getStateFromPathHelper"],[102,73,79,45],[102,75,79,47,"getActionFromStateHelper"],[102,99,79,71],[102,100,79,72],[102,101,79,73],[103,4,80,2],[103,11,80,9],[104,6,81,4,"buildHref"],[104,15,81,13],[104,17,81,4,"buildHref"],[104,26,81,13],[105,6,82,4,"buildAction"],[105,17,82,15],[105,19,82,4,"buildAction"],[106,4,83,2],[106,5,83,3],[107,2,84,0],[108,0,84,1],[108,3]],"functionMap":{"names":["","useLinkBuilder","buildHref","navigation.getState.routes.some$argument_0","constructState","buildAction"],"mappings":"AAA;OCU;sCCU;iKCU,wBD;2BEO;KFyB;GDI;wCIC;GJW;CDK"},"hasCjsExports":false},"type":"js/module"}]}