mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-18 20:47:54 +00:00
1 line
89 KiB
JSON
1 line
89 KiB
JSON
{"ast":null,"code":"import _asyncToGenerator from \"C:/Users/eudes.inacio/GabineteDigital/gabinete-digital-fo/node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js\";\nimport { r as registerInstance, e as createEvent, h, i as getElement, H as Host } from './index-7a8b7a1c.js';\nimport { b as getIonMode, c as config } from './ionic-global-63a97a32.js';\nimport { g as getTimeGivenProgression } from './cubic-bezier-eea9a7a9.js';\nimport { m as assert } from './helpers-1457892a.js';\nimport { l as lifecycle, t as transition, s as setPageHidden, d as LIFECYCLE_WILL_UNLOAD, b as LIFECYCLE_WILL_LEAVE, c as LIFECYCLE_DID_LEAVE } from './index-a7711c1e.js';\nimport { a as attachComponent } from './framework-delegate-94e770cc.js';\nconst VIEW_STATE_NEW = 1;\nconst VIEW_STATE_ATTACHED = 2;\nconst VIEW_STATE_DESTROYED = 3;\nclass ViewController {\n constructor(component, params) {\n this.component = component;\n this.params = params;\n this.state = VIEW_STATE_NEW;\n }\n init(container) {\n var _this = this;\n return _asyncToGenerator(function* () {\n _this.state = VIEW_STATE_ATTACHED;\n if (!_this.element) {\n const component = _this.component;\n _this.element = yield attachComponent(_this.delegate, container, component, ['ion-page', 'ion-page-invisible'], _this.params);\n }\n })();\n }\n /**\n * DOM WRITE\n */\n _destroy() {\n assert(this.state !== VIEW_STATE_DESTROYED, 'view state must be ATTACHED');\n const element = this.element;\n if (element) {\n if (this.delegate) {\n this.delegate.removeViewFromDom(element.parentElement, element);\n } else {\n element.remove();\n }\n }\n this.nav = undefined;\n this.state = VIEW_STATE_DESTROYED;\n }\n}\nconst matches = (view, id, params) => {\n if (!view) {\n return false;\n }\n if (view.component !== id) {\n return false;\n }\n const currentParams = view.params;\n if (currentParams === params) {\n return true;\n }\n if (!currentParams && !params) {\n return true;\n }\n if (!currentParams || !params) {\n return false;\n }\n const keysA = Object.keys(currentParams);\n const keysB = Object.keys(params);\n if (keysA.length !== keysB.length) {\n return false;\n }\n // Test for A's keys different from B.\n for (const key of keysA) {\n if (currentParams[key] !== params[key]) {\n return false;\n }\n }\n return true;\n};\nconst convertToView = (page, params) => {\n if (!page) {\n return null;\n }\n if (page instanceof ViewController) {\n return page;\n }\n return new ViewController(page, params);\n};\nconst convertToViews = pages => {\n return pages.map(page => {\n if (page instanceof ViewController) {\n return page;\n }\n if ('component' in page) {\n /**\n * TODO Ionic 6:\n * Consider switching to just using `undefined` here\n * as well as on the public interfaces and on\n * `NavComponentWithProps`. Previously `pages` was\n * of type `any[]` so TypeScript did not catch this.\n */\n return convertToView(page.component, page.componentProps === null ? undefined : page.componentProps);\n }\n return convertToView(page, undefined);\n }).filter(v => v !== null);\n};\nconst navCss = \":host{left:0;right:0;top:0;bottom:0;position:absolute;contain:layout size style;overflow:hidden;z-index:0}\";\nconst Nav = class {\n constructor(hostRef) {\n registerInstance(this, hostRef);\n this.ionNavWillLoad = createEvent(this, \"ionNavWillLoad\", 7);\n this.ionNavWillChange = createEvent(this, \"ionNavWillChange\", 3);\n this.ionNavDidChange = createEvent(this, \"ionNavDidChange\", 3);\n this.transInstr = [];\n this.animationEnabled = true;\n this.useRouter = false;\n this.isTransitioning = false;\n this.destroyed = false;\n this.views = [];\n /**\n * If `true`, the nav should animate the transition of components.\n */\n this.animated = true;\n }\n swipeGestureChanged() {\n if (this.gesture) {\n this.gesture.enable(this.swipeGesture === true);\n }\n }\n rootChanged() {\n if (this.root !== undefined) {\n if (!this.useRouter) {\n this.setRoot(this.root, this.rootParams);\n }\n }\n }\n componentWillLoad() {\n this.useRouter = !!document.querySelector('ion-router') && !this.el.closest('[no-router]');\n if (this.swipeGesture === undefined) {\n const mode = getIonMode(this);\n this.swipeGesture = config.getBoolean('swipeBackEnabled', mode === 'ios');\n }\n this.ionNavWillLoad.emit();\n }\n componentDidLoad() {\n var _this2 = this;\n return _asyncToGenerator(function* () {\n _this2.rootChanged();\n _this2.gesture = (yield import('./swipe-back-1bbd08e0.js')).createSwipeBackGesture(_this2.el, _this2.canStart.bind(_this2), _this2.onStart.bind(_this2), _this2.onMove.bind(_this2), _this2.onEnd.bind(_this2));\n _this2.swipeGestureChanged();\n })();\n }\n disconnectedCallback() {\n for (const view of this.views) {\n lifecycle(view.element, LIFECYCLE_WILL_UNLOAD);\n view._destroy();\n }\n if (this.gesture) {\n this.gesture.destroy();\n this.gesture = undefined;\n }\n // release swipe back gesture and transition\n this.transInstr.length = this.views.length = 0;\n this.destroyed = true;\n }\n /**\n * Push a new component onto the current navigation stack. Pass any additional\n * information along as an object. This additional information is accessible\n * through NavParams.\n *\n * @param component The component to push onto the navigation stack.\n * @param componentProps Any properties of the component.\n * @param opts The navigation options.\n * @param done The transition complete function.\n */\n push(component, componentProps, opts, done) {\n return this.queueTrns({\n insertStart: -1,\n insertViews: [{\n component,\n componentProps\n }],\n opts\n }, done);\n }\n /**\n * Inserts a component into the navigation stack at the specified index.\n * This is useful to add a component at any point in the navigation stack.\n *\n * @param insertIndex The index to insert the component at in the stack.\n * @param component The component to insert into the navigation stack.\n * @param componentProps Any properties of the component.\n * @param opts The navigation options.\n * @param done The transition complete function.\n */\n insert(insertIndex, component, componentProps, opts, done) {\n return this.queueTrns({\n insertStart: insertIndex,\n insertViews: [{\n component,\n componentProps\n }],\n opts\n }, done);\n }\n /**\n * Inserts an array of components into the navigation stack at the specified index.\n * The last component in the array will become instantiated as a view, and animate\n * in to become the active view.\n *\n * @param insertIndex The index to insert the components at in the stack.\n * @param insertComponents The components to insert into the navigation stack.\n * @param opts The navigation options.\n * @param done The transition complete function.\n */\n insertPages(insertIndex, insertComponents, opts, done) {\n return this.queueTrns({\n insertStart: insertIndex,\n insertViews: insertComponents,\n opts\n }, done);\n }\n /**\n * Pop a component off of the navigation stack. Navigates back from the current\n * component.\n *\n * @param opts The navigation options.\n * @param done The transition complete function.\n */\n pop(opts, done) {\n return this.queueTrns({\n removeStart: -1,\n removeCount: 1,\n opts\n }, done);\n }\n /**\n * Pop to a specific index in the navigation stack.\n *\n * @param indexOrViewCtrl The index or view controller to pop to.\n * @param opts The navigation options.\n * @param done The transition complete function.\n */\n popTo(indexOrViewCtrl, opts, done) {\n const tiConfig = {\n removeStart: -1,\n removeCount: -1,\n opts\n };\n if (typeof indexOrViewCtrl === 'object' && indexOrViewCtrl.component) {\n tiConfig.removeView = indexOrViewCtrl;\n tiConfig.removeStart = 1;\n } else if (typeof indexOrViewCtrl === 'number') {\n tiConfig.removeStart = indexOrViewCtrl + 1;\n }\n return this.queueTrns(tiConfig, done);\n }\n /**\n * Navigate back to the root of the stack, no matter how far back that is.\n *\n * @param opts The navigation options.\n * @param done The transition complete function.\n */\n popToRoot(opts, done) {\n return this.queueTrns({\n removeStart: 1,\n removeCount: -1,\n opts\n }, done);\n }\n /**\n * Removes a component from the navigation stack at the specified index.\n *\n * @param startIndex The number to begin removal at.\n * @param removeCount The number of components to remove.\n * @param opts The navigation options.\n * @param done The transition complete function.\n */\n removeIndex(startIndex, removeCount = 1, opts, done) {\n return this.queueTrns({\n removeStart: startIndex,\n removeCount,\n opts\n }, done);\n }\n /**\n * Set the root for the current navigation stack to a component.\n *\n * @param component The component to set as the root of the navigation stack.\n * @param componentProps Any properties of the component.\n * @param opts The navigation options.\n * @param done The transition complete function.\n */\n setRoot(component, componentProps, opts, done) {\n return this.setPages([{\n component,\n componentProps\n }], opts, done);\n }\n /**\n * Set the views of the current navigation stack and navigate to the last view.\n * By default animations are disabled, but they can be enabled by passing options\n * to the navigation controller. Navigation parameters can also be passed to the\n * individual pages in the array.\n *\n * @param views The list of views to set as the navigation stack.\n * @param opts The navigation options.\n * @param done The transition complete function.\n */\n setPages(views, opts, done) {\n if (opts == null) {\n opts = {};\n }\n // if animation wasn't set to true then default it to NOT animate\n if (opts.animated !== true) {\n opts.animated = false;\n }\n return this.queueTrns({\n insertStart: 0,\n insertViews: views,\n removeStart: 0,\n removeCount: -1,\n opts\n }, done);\n }\n /** @internal */\n setRouteId(id, params, direction, animation) {\n const active = this.getActiveSync();\n if (matches(active, id, params)) {\n return Promise.resolve({\n changed: false,\n element: active.element\n });\n }\n let resolve;\n const promise = new Promise(r => resolve = r);\n let finish;\n const commonOpts = {\n updateURL: false,\n viewIsReady: enteringEl => {\n let mark;\n const p = new Promise(r => mark = r);\n resolve({\n changed: true,\n element: enteringEl,\n markVisible: function () {\n var _ref = _asyncToGenerator(function* () {\n mark();\n yield finish;\n });\n return function markVisible() {\n return _ref.apply(this, arguments);\n };\n }()\n });\n return p;\n }\n };\n if (direction === 'root') {\n finish = this.setRoot(id, params, commonOpts);\n } else {\n const viewController = this.views.find(v => matches(v, id, params));\n if (viewController) {\n finish = this.popTo(viewController, Object.assign(Object.assign({}, commonOpts), {\n direction: 'back',\n animationBuilder: animation\n }));\n } else if (direction === 'forward') {\n finish = this.push(id, params, Object.assign(Object.assign({}, commonOpts), {\n animationBuilder: animation\n }));\n } else if (direction === 'back') {\n finish = this.setRoot(id, params, Object.assign(Object.assign({}, commonOpts), {\n direction: 'back',\n animated: true,\n animationBuilder: animation\n }));\n }\n }\n return promise;\n }\n /** @internal */\n getRouteId() {\n var _this3 = this;\n return _asyncToGenerator(function* () {\n const active = _this3.getActiveSync();\n return active ? {\n id: active.element.tagName,\n params: active.params,\n element: active.element\n } : undefined;\n })();\n }\n /**\n * Get the active view.\n */\n getActive() {\n return Promise.resolve(this.getActiveSync());\n }\n /**\n * Get the view at the specified index.\n *\n * @param index The index of the view.\n */\n getByIndex(index) {\n return Promise.resolve(this.views[index]);\n }\n /**\n * Returns `true` if the current view can go back.\n *\n * @param view The view to check.\n */\n canGoBack(view) {\n return Promise.resolve(this.canGoBackSync(view));\n }\n /**\n * Get the previous view.\n *\n * @param view The view to get.\n */\n getPrevious(view) {\n return Promise.resolve(this.getPreviousSync(view));\n }\n getLength() {\n return this.views.length;\n }\n getActiveSync() {\n return this.views[this.views.length - 1];\n }\n canGoBackSync(view = this.getActiveSync()) {\n return !!(view && this.getPreviousSync(view));\n }\n getPreviousSync(view = this.getActiveSync()) {\n if (!view) {\n return undefined;\n }\n const views = this.views;\n const index = views.indexOf(view);\n return index > 0 ? views[index - 1] : undefined;\n }\n // _queueTrns() adds a navigation stack change to the queue and schedules it to run:\n // 1. _nextTrns(): consumes the next transition in the queue\n // 2. _viewInit(): initializes enteringView if required\n // 3. _viewTest(): ensures canLeave/canEnter Returns `true`, so the operation can continue\n // 4. _postViewInit(): add/remove the views from the navigation stack\n // 5. _transitionInit(): initializes the visual transition if required and schedules it to run\n // 6. _viewAttachToDOM(): attaches the enteringView to the DOM\n // 7. _transitionStart(): called once the transition actually starts, it initializes the Animation underneath.\n // 8. _transitionFinish(): called once the transition finishes\n // 9. _cleanup(): syncs the navigation internal state with the DOM. For example it removes the pages from the DOM or hides/show them.\n queueTrns(ti, done) {\n var _this4 = this;\n return _asyncToGenerator(function* () {\n if (_this4.isTransitioning && ti.opts != null && ti.opts.skipIfBusy) {\n return Promise.resolve(false);\n }\n const promise = new Promise((resolve, reject) => {\n ti.resolve = resolve;\n ti.reject = reject;\n });\n ti.done = done;\n /**\n * If using router, check to see if navigation hooks\n * will allow us to perform this transition. This\n * is required in order for hooks to work with\n * the ion-back-button or swipe to go back.\n */\n if (ti.opts && ti.opts.updateURL !== false && _this4.useRouter) {\n const router = document.querySelector('ion-router');\n if (router) {\n const canTransition = yield router.canTransition();\n if (canTransition === false) {\n return Promise.resolve(false);\n } else if (typeof canTransition === 'string') {\n router.push(canTransition, ti.opts.direction || 'back');\n return Promise.resolve(false);\n }\n }\n }\n // Normalize empty\n if (ti.insertViews && ti.insertViews.length === 0) {\n ti.insertViews = undefined;\n }\n // Enqueue transition instruction\n _this4.transInstr.push(ti);\n // if there isn't a transition already happening\n // then this will kick off this transition\n _this4.nextTrns();\n return promise;\n })();\n }\n success(result, ti) {\n if (this.destroyed) {\n this.fireError('nav controller was destroyed', ti);\n return;\n }\n if (ti.done) {\n ti.done(result.hasCompleted, result.requiresTransition, result.enteringView, result.leavingView, result.direction);\n }\n ti.resolve(result.hasCompleted);\n if (ti.opts.updateURL !== false && this.useRouter) {\n const router = document.querySelector('ion-router');\n if (router) {\n const direction = result.direction === 'back' ? 'back' : 'forward';\n router.navChanged(direction);\n }\n }\n }\n failed(rejectReason, ti) {\n if (this.destroyed) {\n this.fireError('nav controller was destroyed', ti);\n return;\n }\n this.transInstr.length = 0;\n this.fireError(rejectReason, ti);\n }\n fireError(rejectReason, ti) {\n if (ti.done) {\n ti.done(false, false, rejectReason);\n }\n if (ti.reject && !this.destroyed) {\n ti.reject(rejectReason);\n } else {\n ti.resolve(false);\n }\n }\n nextTrns() {\n // this is the framework's bread 'n butta function\n // only one transition is allowed at any given time\n if (this.isTransitioning) {\n return false;\n }\n // there is no transition happening right now\n // get the next instruction\n const ti = this.transInstr.shift();\n if (!ti) {\n return false;\n }\n this.runTransition(ti);\n return true;\n }\n runTransition(ti) {\n var _this5 = this;\n return _asyncToGenerator(function* () {\n try {\n // set that this nav is actively transitioning\n _this5.ionNavWillChange.emit();\n _this5.isTransitioning = true;\n _this5.prepareTI(ti);\n const leavingView = _this5.getActiveSync();\n const enteringView = _this5.getEnteringView(ti, leavingView);\n if (!leavingView && !enteringView) {\n throw new Error('no views in the stack to be removed');\n }\n if (enteringView && enteringView.state === VIEW_STATE_NEW) {\n yield enteringView.init(_this5.el);\n }\n _this5.postViewInit(enteringView, leavingView, ti);\n // Needs transition?\n const requiresTransition = (ti.enteringRequiresTransition || ti.leavingRequiresTransition) && enteringView !== leavingView;\n if (requiresTransition && ti.opts && leavingView) {\n const isBackDirection = ti.opts.direction === 'back';\n /**\n * If heading back, use the entering page's animation\n * unless otherwise specified by the developer.\n */\n if (isBackDirection) {\n ti.opts.animationBuilder = ti.opts.animationBuilder || enteringView && enteringView.animationBuilder;\n }\n leavingView.animationBuilder = ti.opts.animationBuilder;\n }\n const result = requiresTransition ? yield _this5.transition(enteringView, leavingView, ti) : {\n // transition is not required, so we are already done!\n // they're inserting/removing the views somewhere in the middle or\n // beginning, so visually nothing needs to animate/transition\n // resolve immediately because there's no animation that's happening\n hasCompleted: true,\n requiresTransition: false\n };\n _this5.success(result, ti);\n _this5.ionNavDidChange.emit();\n } catch (rejectReason) {\n _this5.failed(rejectReason, ti);\n }\n _this5.isTransitioning = false;\n _this5.nextTrns();\n })();\n }\n prepareTI(ti) {\n const viewsLength = this.views.length;\n ti.opts = ti.opts || {};\n if (ti.opts.delegate === undefined) {\n ti.opts.delegate = this.delegate;\n }\n if (ti.removeView !== undefined) {\n assert(ti.removeStart !== undefined, 'removeView needs removeStart');\n assert(ti.removeCount !== undefined, 'removeView needs removeCount');\n const index = this.views.indexOf(ti.removeView);\n if (index < 0) {\n throw new Error('removeView was not found');\n }\n ti.removeStart += index;\n }\n if (ti.removeStart !== undefined) {\n if (ti.removeStart < 0) {\n ti.removeStart = viewsLength - 1;\n }\n if (ti.removeCount < 0) {\n ti.removeCount = viewsLength - ti.removeStart;\n }\n ti.leavingRequiresTransition = ti.removeCount > 0 && ti.removeStart + ti.removeCount === viewsLength;\n }\n if (ti.insertViews) {\n // allow -1 to be passed in to auto push it on the end\n // and clean up the index if it's larger then the size of the stack\n if (ti.insertStart < 0 || ti.insertStart > viewsLength) {\n ti.insertStart = viewsLength;\n }\n ti.enteringRequiresTransition = ti.insertStart === viewsLength;\n }\n const insertViews = ti.insertViews;\n if (!insertViews) {\n return;\n }\n assert(insertViews.length > 0, 'length can not be zero');\n const viewControllers = convertToViews(insertViews);\n if (viewControllers.length === 0) {\n throw new Error('invalid views to insert');\n }\n // Check all the inserted view are correct\n for (const view of viewControllers) {\n view.delegate = ti.opts.delegate;\n const nav = view.nav;\n if (nav && nav !== this) {\n throw new Error('inserted view was already inserted');\n }\n if (view.state === VIEW_STATE_DESTROYED) {\n throw new Error('inserted view was already destroyed');\n }\n }\n ti.insertViews = viewControllers;\n }\n getEnteringView(ti, leavingView) {\n const insertViews = ti.insertViews;\n if (insertViews !== undefined) {\n // grab the very last view of the views to be inserted\n // and initialize it as the new entering view\n return insertViews[insertViews.length - 1];\n }\n const removeStart = ti.removeStart;\n if (removeStart !== undefined) {\n const views = this.views;\n const removeEnd = removeStart + ti.removeCount;\n for (let i = views.length - 1; i >= 0; i--) {\n const view = views[i];\n if ((i < removeStart || i >= removeEnd) && view !== leavingView) {\n return view;\n }\n }\n }\n return undefined;\n }\n postViewInit(enteringView, leavingView, ti) {\n assert(leavingView || enteringView, 'Both leavingView and enteringView are null');\n assert(ti.resolve, 'resolve must be valid');\n assert(ti.reject, 'reject must be valid');\n const opts = ti.opts;\n const insertViews = ti.insertViews;\n const removeStart = ti.removeStart;\n const removeCount = ti.removeCount;\n let destroyQueue;\n // there are views to remove\n if (removeStart !== undefined && removeCount !== undefined) {\n assert(removeStart >= 0, 'removeStart can not be negative');\n assert(removeCount >= 0, 'removeCount can not be negative');\n destroyQueue = [];\n for (let i = 0; i < removeCount; i++) {\n const view = this.views[i + removeStart];\n if (view && view !== enteringView && view !== leavingView) {\n destroyQueue.push(view);\n }\n }\n // default the direction to \"back\"\n opts.direction = opts.direction || 'back';\n }\n const finalBalance = this.views.length + (insertViews !== undefined ? insertViews.length : 0) - (removeCount !== undefined ? removeCount : 0);\n assert(finalBalance >= 0, 'final balance can not be negative');\n if (finalBalance === 0) {\n console.warn(`You can't remove all the pages in the navigation stack. nav.pop() is probably called too many times.`, this, this.el);\n throw new Error('navigation stack needs at least one root page');\n }\n // At this point the transition can not be rejected, any throw should be an error\n // there are views to insert\n if (insertViews) {\n // add the views to the\n let insertIndex = ti.insertStart;\n for (const view of insertViews) {\n this.insertViewAt(view, insertIndex);\n insertIndex++;\n }\n if (ti.enteringRequiresTransition) {\n // default to forward if not already set\n opts.direction = opts.direction || 'forward';\n }\n }\n // if the views to be removed are in the beginning or middle\n // and there is not a view that needs to visually transition out\n // then just destroy them and don't transition anything\n // batch all of lifecycles together\n // let's make sure, callbacks are zoned\n if (destroyQueue && destroyQueue.length > 0) {\n for (const view of destroyQueue) {\n lifecycle(view.element, LIFECYCLE_WILL_LEAVE);\n lifecycle(view.element, LIFECYCLE_DID_LEAVE);\n lifecycle(view.element, LIFECYCLE_WILL_UNLOAD);\n }\n // once all lifecycle events has been delivered, we can safely detroy the views\n for (const view of destroyQueue) {\n this.destroyView(view);\n }\n }\n }\n transition(enteringView, leavingView, ti) {\n var _this6 = this;\n return _asyncToGenerator(function* () {\n // we should animate (duration > 0) if the pushed page is not the first one (startup)\n // or if it is a portal (modal, actionsheet, etc.)\n const opts = ti.opts;\n const progressCallback = opts.progressAnimation ? ani => _this6.sbAni = ani : undefined;\n const mode = getIonMode(_this6);\n const enteringEl = enteringView.element;\n const leavingEl = leavingView && leavingView.element;\n const animationOpts = Object.assign(Object.assign({\n mode,\n showGoBack: _this6.canGoBackSync(enteringView),\n baseEl: _this6.el,\n progressCallback,\n animated: _this6.animated && config.getBoolean('animated', true),\n enteringEl,\n leavingEl\n }, opts), {\n animationBuilder: opts.animationBuilder || _this6.animation || config.get('navAnimation')\n });\n const {\n hasCompleted\n } = yield transition(animationOpts);\n return _this6.transitionFinish(hasCompleted, enteringView, leavingView, opts);\n })();\n }\n transitionFinish(hasCompleted, enteringView, leavingView, opts) {\n const cleanupView = hasCompleted ? enteringView : leavingView;\n if (cleanupView) {\n this.cleanup(cleanupView);\n }\n return {\n hasCompleted,\n requiresTransition: true,\n enteringView,\n leavingView,\n direction: opts.direction\n };\n }\n insertViewAt(view, index) {\n const views = this.views;\n const existingIndex = views.indexOf(view);\n if (existingIndex > -1) {\n // this view is already in the stack!!\n // move it to its new location\n assert(view.nav === this, 'view is not part of the nav');\n views.splice(index, 0, views.splice(existingIndex, 1)[0]);\n } else {\n assert(!view.nav, 'nav is used');\n // this is a new view to add to the stack\n // create the new entering view\n view.nav = this;\n // insert the entering view into the correct index in the stack\n views.splice(index, 0, view);\n }\n }\n removeView(view) {\n assert(view.state === VIEW_STATE_ATTACHED || view.state === VIEW_STATE_DESTROYED, 'view state should be loaded or destroyed');\n const views = this.views;\n const index = views.indexOf(view);\n assert(index > -1, 'view must be part of the stack');\n if (index >= 0) {\n views.splice(index, 1);\n }\n }\n destroyView(view) {\n view._destroy();\n this.removeView(view);\n }\n /**\n * DOM WRITE\n */\n cleanup(activeView) {\n // ok, cleanup time!! Destroy all of the views that are\n // INACTIVE and come after the active view\n // only do this if the views exist, though\n if (this.destroyed) {\n return;\n }\n const views = this.views;\n const activeViewIndex = views.indexOf(activeView);\n for (let i = views.length - 1; i >= 0; i--) {\n const view = views[i];\n /**\n * When inserting multiple views via insertPages\n * the last page will be transitioned to, but the\n * others will not be. As a result, a DOM element\n * will only be created for the last page inserted.\n * As a result, it is possible to have views in the\n * stack that do not have `view.element` yet.\n */\n const element = view.element;\n if (element) {\n if (i > activeViewIndex) {\n // this view comes after the active view\n // let's unload it\n lifecycle(element, LIFECYCLE_WILL_UNLOAD);\n this.destroyView(view);\n } else if (i < activeViewIndex) {\n // this view comes before the active view\n // and it is not a portal then ensure it is hidden\n setPageHidden(element, true);\n }\n }\n }\n }\n canStart() {\n return !!this.swipeGesture && !this.isTransitioning && this.transInstr.length === 0 && this.animationEnabled && this.canGoBackSync();\n }\n onStart() {\n this.queueTrns({\n removeStart: -1,\n removeCount: 1,\n opts: {\n direction: 'back',\n progressAnimation: true\n }\n }, undefined);\n }\n onMove(stepValue) {\n if (this.sbAni) {\n this.sbAni.progressStep(stepValue);\n }\n }\n onEnd(shouldComplete, stepValue, dur) {\n if (this.sbAni) {\n this.animationEnabled = false;\n this.sbAni.onFinish(() => {\n this.animationEnabled = true;\n }, {\n oneTimeCallback: true\n });\n // Account for rounding errors in JS\n let newStepValue = shouldComplete ? -0.001 : 0.001;\n /**\n * Animation will be reversed here, so need to\n * reverse the easing curve as well\n *\n * Additionally, we need to account for the time relative\n * to the new easing curve, as `stepValue` is going to be given\n * in terms of a linear curve.\n */\n if (!shouldComplete) {\n this.sbAni.easing('cubic-bezier(1, 0, 0.68, 0.28)');\n newStepValue += getTimeGivenProgression([0, 0], [1, 0], [0.68, 0.28], [1, 1], stepValue)[0];\n } else {\n newStepValue += getTimeGivenProgression([0, 0], [0.32, 0.72], [0, 1], [1, 1], stepValue)[0];\n }\n this.sbAni.progressEnd(shouldComplete ? 1 : 0, newStepValue, dur);\n }\n }\n render() {\n return h(\"slot\", null);\n }\n get el() {\n return getElement(this);\n }\n static get watchers() {\n return {\n \"swipeGesture\": [\"swipeGestureChanged\"],\n \"root\": [\"rootChanged\"]\n };\n }\n};\nNav.style = navCss;\nconst navLink = (el, routerDirection, component, componentProps, routerAnimation) => {\n const nav = el.closest('ion-nav');\n if (nav) {\n if (routerDirection === 'forward') {\n if (component !== undefined) {\n return nav.push(component, componentProps, {\n skipIfBusy: true,\n animationBuilder: routerAnimation\n });\n }\n } else if (routerDirection === 'root') {\n if (component !== undefined) {\n return nav.setRoot(component, componentProps, {\n skipIfBusy: true,\n animationBuilder: routerAnimation\n });\n }\n } else if (routerDirection === 'back') {\n return nav.pop({\n skipIfBusy: true,\n animationBuilder: routerAnimation\n });\n }\n }\n return Promise.resolve(false);\n};\nconst NavLink = class {\n constructor(hostRef) {\n registerInstance(this, hostRef);\n /**\n * The transition direction when navigating to another page.\n */\n this.routerDirection = 'forward';\n this.onClick = () => {\n return navLink(this.el, this.routerDirection, this.component, this.componentProps, this.routerAnimation);\n };\n }\n render() {\n return h(Host, {\n onClick: this.onClick\n });\n }\n get el() {\n return getElement(this);\n }\n};\nexport { Nav as ion_nav, NavLink as ion_nav_link };","map":{"version":3,"names":["r","registerInstance","e","createEvent","h","i","getElement","H","Host","b","getIonMode","c","config","g","getTimeGivenProgression","m","assert","l","lifecycle","t","transition","s","setPageHidden","d","LIFECYCLE_WILL_UNLOAD","LIFECYCLE_WILL_LEAVE","LIFECYCLE_DID_LEAVE","a","attachComponent","VIEW_STATE_NEW","VIEW_STATE_ATTACHED","VIEW_STATE_DESTROYED","ViewController","constructor","component","params","state","init","container","_this","_asyncToGenerator","element","delegate","_destroy","removeViewFromDom","parentElement","remove","nav","undefined","matches","view","id","currentParams","keysA","Object","keys","keysB","length","key","convertToView","page","convertToViews","pages","map","componentProps","filter","v","navCss","Nav","hostRef","ionNavWillLoad","ionNavWillChange","ionNavDidChange","transInstr","animationEnabled","useRouter","isTransitioning","destroyed","views","animated","swipeGestureChanged","gesture","enable","swipeGesture","rootChanged","root","setRoot","rootParams","componentWillLoad","document","querySelector","el","closest","mode","getBoolean","emit","componentDidLoad","_this2","createSwipeBackGesture","canStart","bind","onStart","onMove","onEnd","disconnectedCallback","destroy","push","opts","done","queueTrns","insertStart","insertViews","insert","insertIndex","insertPages","insertComponents","pop","removeStart","removeCount","popTo","indexOrViewCtrl","tiConfig","removeView","popToRoot","removeIndex","startIndex","setPages","setRouteId","direction","animation","active","getActiveSync","Promise","resolve","changed","promise","finish","commonOpts","updateURL","viewIsReady","enteringEl","mark","p","markVisible","_ref","apply","arguments","viewController","find","assign","animationBuilder","getRouteId","_this3","tagName","getActive","getByIndex","index","canGoBack","canGoBackSync","getPrevious","getPreviousSync","getLength","indexOf","ti","_this4","skipIfBusy","reject","router","canTransition","nextTrns","success","result","fireError","hasCompleted","requiresTransition","enteringView","leavingView","navChanged","failed","rejectReason","shift","runTransition","_this5","prepareTI","getEnteringView","Error","postViewInit","enteringRequiresTransition","leavingRequiresTransition","isBackDirection","viewsLength","viewControllers","removeEnd","destroyQueue","finalBalance","console","warn","insertViewAt","destroyView","_this6","progressCallback","progressAnimation","ani","sbAni","leavingEl","animationOpts","showGoBack","baseEl","get","transitionFinish","cleanupView","cleanup","existingIndex","splice","activeView","activeViewIndex","stepValue","progressStep","shouldComplete","dur","onFinish","oneTimeCallback","newStepValue","easing","progressEnd","render","watchers","style","navLink","routerDirection","routerAnimation","NavLink","onClick","ion_nav","ion_nav_link"],"sources":["C:/Users/eudes.inacio/GabineteDigital/gabinete-digital-fo/node_modules/@ionic/core/dist/esm/ion-nav_2.entry.js"],"sourcesContent":["import { r as registerInstance, e as createEvent, h, i as getElement, H as Host } from './index-7a8b7a1c.js';\nimport { b as getIonMode, c as config } from './ionic-global-63a97a32.js';\nimport { g as getTimeGivenProgression } from './cubic-bezier-eea9a7a9.js';\nimport { m as assert } from './helpers-1457892a.js';\nimport { l as lifecycle, t as transition, s as setPageHidden, d as LIFECYCLE_WILL_UNLOAD, b as LIFECYCLE_WILL_LEAVE, c as LIFECYCLE_DID_LEAVE } from './index-a7711c1e.js';\nimport { a as attachComponent } from './framework-delegate-94e770cc.js';\n\nconst VIEW_STATE_NEW = 1;\nconst VIEW_STATE_ATTACHED = 2;\nconst VIEW_STATE_DESTROYED = 3;\nclass ViewController {\n constructor(component, params) {\n this.component = component;\n this.params = params;\n this.state = VIEW_STATE_NEW;\n }\n async init(container) {\n this.state = VIEW_STATE_ATTACHED;\n if (!this.element) {\n const component = this.component;\n this.element = await attachComponent(this.delegate, container, component, ['ion-page', 'ion-page-invisible'], this.params);\n }\n }\n /**\n * DOM WRITE\n */\n _destroy() {\n assert(this.state !== VIEW_STATE_DESTROYED, 'view state must be ATTACHED');\n const element = this.element;\n if (element) {\n if (this.delegate) {\n this.delegate.removeViewFromDom(element.parentElement, element);\n }\n else {\n element.remove();\n }\n }\n this.nav = undefined;\n this.state = VIEW_STATE_DESTROYED;\n }\n}\nconst matches = (view, id, params) => {\n if (!view) {\n return false;\n }\n if (view.component !== id) {\n return false;\n }\n const currentParams = view.params;\n if (currentParams === params) {\n return true;\n }\n if (!currentParams && !params) {\n return true;\n }\n if (!currentParams || !params) {\n return false;\n }\n const keysA = Object.keys(currentParams);\n const keysB = Object.keys(params);\n if (keysA.length !== keysB.length) {\n return false;\n }\n // Test for A's keys different from B.\n for (const key of keysA) {\n if (currentParams[key] !== params[key]) {\n return false;\n }\n }\n return true;\n};\nconst convertToView = (page, params) => {\n if (!page) {\n return null;\n }\n if (page instanceof ViewController) {\n return page;\n }\n return new ViewController(page, params);\n};\nconst convertToViews = (pages) => {\n return pages.map(page => {\n if (page instanceof ViewController) {\n return page;\n }\n if ('component' in page) {\n /**\n * TODO Ionic 6:\n * Consider switching to just using `undefined` here\n * as well as on the public interfaces and on\n * `NavComponentWithProps`. Previously `pages` was\n * of type `any[]` so TypeScript did not catch this.\n */\n return convertToView(page.component, (page.componentProps === null) ? undefined : page.componentProps);\n }\n return convertToView(page, undefined);\n }).filter(v => v !== null);\n};\n\nconst navCss = \":host{left:0;right:0;top:0;bottom:0;position:absolute;contain:layout size style;overflow:hidden;z-index:0}\";\n\nconst Nav = class {\n constructor(hostRef) {\n registerInstance(this, hostRef);\n this.ionNavWillLoad = createEvent(this, \"ionNavWillLoad\", 7);\n this.ionNavWillChange = createEvent(this, \"ionNavWillChange\", 3);\n this.ionNavDidChange = createEvent(this, \"ionNavDidChange\", 3);\n this.transInstr = [];\n this.animationEnabled = true;\n this.useRouter = false;\n this.isTransitioning = false;\n this.destroyed = false;\n this.views = [];\n /**\n * If `true`, the nav should animate the transition of components.\n */\n this.animated = true;\n }\n swipeGestureChanged() {\n if (this.gesture) {\n this.gesture.enable(this.swipeGesture === true);\n }\n }\n rootChanged() {\n if (this.root !== undefined) {\n if (!this.useRouter) {\n this.setRoot(this.root, this.rootParams);\n }\n }\n }\n componentWillLoad() {\n this.useRouter =\n !!document.querySelector('ion-router') &&\n !this.el.closest('[no-router]');\n if (this.swipeGesture === undefined) {\n const mode = getIonMode(this);\n this.swipeGesture = config.getBoolean('swipeBackEnabled', mode === 'ios');\n }\n this.ionNavWillLoad.emit();\n }\n async componentDidLoad() {\n this.rootChanged();\n this.gesture = (await import('./swipe-back-1bbd08e0.js')).createSwipeBackGesture(this.el, this.canStart.bind(this), this.onStart.bind(this), this.onMove.bind(this), this.onEnd.bind(this));\n this.swipeGestureChanged();\n }\n disconnectedCallback() {\n for (const view of this.views) {\n lifecycle(view.element, LIFECYCLE_WILL_UNLOAD);\n view._destroy();\n }\n if (this.gesture) {\n this.gesture.destroy();\n this.gesture = undefined;\n }\n // release swipe back gesture and transition\n this.transInstr.length = this.views.length = 0;\n this.destroyed = true;\n }\n /**\n * Push a new component onto the current navigation stack. Pass any additional\n * information along as an object. This additional information is accessible\n * through NavParams.\n *\n * @param component The component to push onto the navigation stack.\n * @param componentProps Any properties of the component.\n * @param opts The navigation options.\n * @param done The transition complete function.\n */\n push(component, componentProps, opts, done) {\n return this.queueTrns({\n insertStart: -1,\n insertViews: [{ component, componentProps }],\n opts\n }, done);\n }\n /**\n * Inserts a component into the navigation stack at the specified index.\n * This is useful to add a component at any point in the navigation stack.\n *\n * @param insertIndex The index to insert the component at in the stack.\n * @param component The component to insert into the navigation stack.\n * @param componentProps Any properties of the component.\n * @param opts The navigation options.\n * @param done The transition complete function.\n */\n insert(insertIndex, component, componentProps, opts, done) {\n return this.queueTrns({\n insertStart: insertIndex,\n insertViews: [{ component, componentProps }],\n opts\n }, done);\n }\n /**\n * Inserts an array of components into the navigation stack at the specified index.\n * The last component in the array will become instantiated as a view, and animate\n * in to become the active view.\n *\n * @param insertIndex The index to insert the components at in the stack.\n * @param insertComponents The components to insert into the navigation stack.\n * @param opts The navigation options.\n * @param done The transition complete function.\n */\n insertPages(insertIndex, insertComponents, opts, done) {\n return this.queueTrns({\n insertStart: insertIndex,\n insertViews: insertComponents,\n opts\n }, done);\n }\n /**\n * Pop a component off of the navigation stack. Navigates back from the current\n * component.\n *\n * @param opts The navigation options.\n * @param done The transition complete function.\n */\n pop(opts, done) {\n return this.queueTrns({\n removeStart: -1,\n removeCount: 1,\n opts\n }, done);\n }\n /**\n * Pop to a specific index in the navigation stack.\n *\n * @param indexOrViewCtrl The index or view controller to pop to.\n * @param opts The navigation options.\n * @param done The transition complete function.\n */\n popTo(indexOrViewCtrl, opts, done) {\n const tiConfig = {\n removeStart: -1,\n removeCount: -1,\n opts\n };\n if (typeof indexOrViewCtrl === 'object' && indexOrViewCtrl.component) {\n tiConfig.removeView = indexOrViewCtrl;\n tiConfig.removeStart = 1;\n }\n else if (typeof indexOrViewCtrl === 'number') {\n tiConfig.removeStart = indexOrViewCtrl + 1;\n }\n return this.queueTrns(tiConfig, done);\n }\n /**\n * Navigate back to the root of the stack, no matter how far back that is.\n *\n * @param opts The navigation options.\n * @param done The transition complete function.\n */\n popToRoot(opts, done) {\n return this.queueTrns({\n removeStart: 1,\n removeCount: -1,\n opts\n }, done);\n }\n /**\n * Removes a component from the navigation stack at the specified index.\n *\n * @param startIndex The number to begin removal at.\n * @param removeCount The number of components to remove.\n * @param opts The navigation options.\n * @param done The transition complete function.\n */\n removeIndex(startIndex, removeCount = 1, opts, done) {\n return this.queueTrns({\n removeStart: startIndex,\n removeCount,\n opts\n }, done);\n }\n /**\n * Set the root for the current navigation stack to a component.\n *\n * @param component The component to set as the root of the navigation stack.\n * @param componentProps Any properties of the component.\n * @param opts The navigation options.\n * @param done The transition complete function.\n */\n setRoot(component, componentProps, opts, done) {\n return this.setPages([{ component, componentProps }], opts, done);\n }\n /**\n * Set the views of the current navigation stack and navigate to the last view.\n * By default animations are disabled, but they can be enabled by passing options\n * to the navigation controller. Navigation parameters can also be passed to the\n * individual pages in the array.\n *\n * @param views The list of views to set as the navigation stack.\n * @param opts The navigation options.\n * @param done The transition complete function.\n */\n setPages(views, opts, done) {\n if (opts == null) {\n opts = {};\n }\n // if animation wasn't set to true then default it to NOT animate\n if (opts.animated !== true) {\n opts.animated = false;\n }\n return this.queueTrns({\n insertStart: 0,\n insertViews: views,\n removeStart: 0,\n removeCount: -1,\n opts\n }, done);\n }\n /** @internal */\n setRouteId(id, params, direction, animation) {\n const active = this.getActiveSync();\n if (matches(active, id, params)) {\n return Promise.resolve({\n changed: false,\n element: active.element\n });\n }\n let resolve;\n const promise = new Promise(r => (resolve = r));\n let finish;\n const commonOpts = {\n updateURL: false,\n viewIsReady: enteringEl => {\n let mark;\n const p = new Promise(r => (mark = r));\n resolve({\n changed: true,\n element: enteringEl,\n markVisible: async () => {\n mark();\n await finish;\n }\n });\n return p;\n }\n };\n if (direction === 'root') {\n finish = this.setRoot(id, params, commonOpts);\n }\n else {\n const viewController = this.views.find(v => matches(v, id, params));\n if (viewController) {\n finish = this.popTo(viewController, Object.assign(Object.assign({}, commonOpts), { direction: 'back', animationBuilder: animation }));\n }\n else if (direction === 'forward') {\n finish = this.push(id, params, Object.assign(Object.assign({}, commonOpts), { animationBuilder: animation }));\n }\n else if (direction === 'back') {\n finish = this.setRoot(id, params, Object.assign(Object.assign({}, commonOpts), { direction: 'back', animated: true, animationBuilder: animation }));\n }\n }\n return promise;\n }\n /** @internal */\n async getRouteId() {\n const active = this.getActiveSync();\n return active\n ? {\n id: active.element.tagName,\n params: active.params,\n element: active.element\n }\n : undefined;\n }\n /**\n * Get the active view.\n */\n getActive() {\n return Promise.resolve(this.getActiveSync());\n }\n /**\n * Get the view at the specified index.\n *\n * @param index The index of the view.\n */\n getByIndex(index) {\n return Promise.resolve(this.views[index]);\n }\n /**\n * Returns `true` if the current view can go back.\n *\n * @param view The view to check.\n */\n canGoBack(view) {\n return Promise.resolve(this.canGoBackSync(view));\n }\n /**\n * Get the previous view.\n *\n * @param view The view to get.\n */\n getPrevious(view) {\n return Promise.resolve(this.getPreviousSync(view));\n }\n getLength() {\n return this.views.length;\n }\n getActiveSync() {\n return this.views[this.views.length - 1];\n }\n canGoBackSync(view = this.getActiveSync()) {\n return !!(view && this.getPreviousSync(view));\n }\n getPreviousSync(view = this.getActiveSync()) {\n if (!view) {\n return undefined;\n }\n const views = this.views;\n const index = views.indexOf(view);\n return index > 0 ? views[index - 1] : undefined;\n }\n // _queueTrns() adds a navigation stack change to the queue and schedules it to run:\n // 1. _nextTrns(): consumes the next transition in the queue\n // 2. _viewInit(): initializes enteringView if required\n // 3. _viewTest(): ensures canLeave/canEnter Returns `true`, so the operation can continue\n // 4. _postViewInit(): add/remove the views from the navigation stack\n // 5. _transitionInit(): initializes the visual transition if required and schedules it to run\n // 6. _viewAttachToDOM(): attaches the enteringView to the DOM\n // 7. _transitionStart(): called once the transition actually starts, it initializes the Animation underneath.\n // 8. _transitionFinish(): called once the transition finishes\n // 9. _cleanup(): syncs the navigation internal state with the DOM. For example it removes the pages from the DOM or hides/show them.\n async queueTrns(ti, done) {\n if (this.isTransitioning && ti.opts != null && ti.opts.skipIfBusy) {\n return Promise.resolve(false);\n }\n const promise = new Promise((resolve, reject) => {\n ti.resolve = resolve;\n ti.reject = reject;\n });\n ti.done = done;\n /**\n * If using router, check to see if navigation hooks\n * will allow us to perform this transition. This\n * is required in order for hooks to work with\n * the ion-back-button or swipe to go back.\n */\n if (ti.opts && ti.opts.updateURL !== false && this.useRouter) {\n const router = document.querySelector('ion-router');\n if (router) {\n const canTransition = await router.canTransition();\n if (canTransition === false) {\n return Promise.resolve(false);\n }\n else if (typeof canTransition === 'string') {\n router.push(canTransition, ti.opts.direction || 'back');\n return Promise.resolve(false);\n }\n }\n }\n // Normalize empty\n if (ti.insertViews && ti.insertViews.length === 0) {\n ti.insertViews = undefined;\n }\n // Enqueue transition instruction\n this.transInstr.push(ti);\n // if there isn't a transition already happening\n // then this will kick off this transition\n this.nextTrns();\n return promise;\n }\n success(result, ti) {\n if (this.destroyed) {\n this.fireError('nav controller was destroyed', ti);\n return;\n }\n if (ti.done) {\n ti.done(result.hasCompleted, result.requiresTransition, result.enteringView, result.leavingView, result.direction);\n }\n ti.resolve(result.hasCompleted);\n if (ti.opts.updateURL !== false && this.useRouter) {\n const router = document.querySelector('ion-router');\n if (router) {\n const direction = result.direction === 'back' ? 'back' : 'forward';\n router.navChanged(direction);\n }\n }\n }\n failed(rejectReason, ti) {\n if (this.destroyed) {\n this.fireError('nav controller was destroyed', ti);\n return;\n }\n this.transInstr.length = 0;\n this.fireError(rejectReason, ti);\n }\n fireError(rejectReason, ti) {\n if (ti.done) {\n ti.done(false, false, rejectReason);\n }\n if (ti.reject && !this.destroyed) {\n ti.reject(rejectReason);\n }\n else {\n ti.resolve(false);\n }\n }\n nextTrns() {\n // this is the framework's bread 'n butta function\n // only one transition is allowed at any given time\n if (this.isTransitioning) {\n return false;\n }\n // there is no transition happening right now\n // get the next instruction\n const ti = this.transInstr.shift();\n if (!ti) {\n return false;\n }\n this.runTransition(ti);\n return true;\n }\n async runTransition(ti) {\n try {\n // set that this nav is actively transitioning\n this.ionNavWillChange.emit();\n this.isTransitioning = true;\n this.prepareTI(ti);\n const leavingView = this.getActiveSync();\n const enteringView = this.getEnteringView(ti, leavingView);\n if (!leavingView && !enteringView) {\n throw new Error('no views in the stack to be removed');\n }\n if (enteringView && enteringView.state === VIEW_STATE_NEW) {\n await enteringView.init(this.el);\n }\n this.postViewInit(enteringView, leavingView, ti);\n // Needs transition?\n const requiresTransition = (ti.enteringRequiresTransition || ti.leavingRequiresTransition) &&\n enteringView !== leavingView;\n if (requiresTransition && ti.opts && leavingView) {\n const isBackDirection = ti.opts.direction === 'back';\n /**\n * If heading back, use the entering page's animation\n * unless otherwise specified by the developer.\n */\n if (isBackDirection) {\n ti.opts.animationBuilder = ti.opts.animationBuilder || (enteringView && enteringView.animationBuilder);\n }\n leavingView.animationBuilder = ti.opts.animationBuilder;\n }\n const result = requiresTransition\n ? await this.transition(enteringView, leavingView, ti)\n : {\n // transition is not required, so we are already done!\n // they're inserting/removing the views somewhere in the middle or\n // beginning, so visually nothing needs to animate/transition\n // resolve immediately because there's no animation that's happening\n hasCompleted: true,\n requiresTransition: false\n };\n this.success(result, ti);\n this.ionNavDidChange.emit();\n }\n catch (rejectReason) {\n this.failed(rejectReason, ti);\n }\n this.isTransitioning = false;\n this.nextTrns();\n }\n prepareTI(ti) {\n const viewsLength = this.views.length;\n ti.opts = ti.opts || {};\n if (ti.opts.delegate === undefined) {\n ti.opts.delegate = this.delegate;\n }\n if (ti.removeView !== undefined) {\n assert(ti.removeStart !== undefined, 'removeView needs removeStart');\n assert(ti.removeCount !== undefined, 'removeView needs removeCount');\n const index = this.views.indexOf(ti.removeView);\n if (index < 0) {\n throw new Error('removeView was not found');\n }\n ti.removeStart += index;\n }\n if (ti.removeStart !== undefined) {\n if (ti.removeStart < 0) {\n ti.removeStart = viewsLength - 1;\n }\n if (ti.removeCount < 0) {\n ti.removeCount = viewsLength - ti.removeStart;\n }\n ti.leavingRequiresTransition =\n ti.removeCount > 0 && ti.removeStart + ti.removeCount === viewsLength;\n }\n if (ti.insertViews) {\n // allow -1 to be passed in to auto push it on the end\n // and clean up the index if it's larger then the size of the stack\n if (ti.insertStart < 0 || ti.insertStart > viewsLength) {\n ti.insertStart = viewsLength;\n }\n ti.enteringRequiresTransition = ti.insertStart === viewsLength;\n }\n const insertViews = ti.insertViews;\n if (!insertViews) {\n return;\n }\n assert(insertViews.length > 0, 'length can not be zero');\n const viewControllers = convertToViews(insertViews);\n if (viewControllers.length === 0) {\n throw new Error('invalid views to insert');\n }\n // Check all the inserted view are correct\n for (const view of viewControllers) {\n view.delegate = ti.opts.delegate;\n const nav = view.nav;\n if (nav && nav !== this) {\n throw new Error('inserted view was already inserted');\n }\n if (view.state === VIEW_STATE_DESTROYED) {\n throw new Error('inserted view was already destroyed');\n }\n }\n ti.insertViews = viewControllers;\n }\n getEnteringView(ti, leavingView) {\n const insertViews = ti.insertViews;\n if (insertViews !== undefined) {\n // grab the very last view of the views to be inserted\n // and initialize it as the new entering view\n return insertViews[insertViews.length - 1];\n }\n const removeStart = ti.removeStart;\n if (removeStart !== undefined) {\n const views = this.views;\n const removeEnd = removeStart + ti.removeCount;\n for (let i = views.length - 1; i >= 0; i--) {\n const view = views[i];\n if ((i < removeStart || i >= removeEnd) && view !== leavingView) {\n return view;\n }\n }\n }\n return undefined;\n }\n postViewInit(enteringView, leavingView, ti) {\n assert(leavingView || enteringView, 'Both leavingView and enteringView are null');\n assert(ti.resolve, 'resolve must be valid');\n assert(ti.reject, 'reject must be valid');\n const opts = ti.opts;\n const insertViews = ti.insertViews;\n const removeStart = ti.removeStart;\n const removeCount = ti.removeCount;\n let destroyQueue;\n // there are views to remove\n if (removeStart !== undefined && removeCount !== undefined) {\n assert(removeStart >= 0, 'removeStart can not be negative');\n assert(removeCount >= 0, 'removeCount can not be negative');\n destroyQueue = [];\n for (let i = 0; i < removeCount; i++) {\n const view = this.views[i + removeStart];\n if (view && view !== enteringView && view !== leavingView) {\n destroyQueue.push(view);\n }\n }\n // default the direction to \"back\"\n opts.direction = opts.direction || 'back';\n }\n const finalBalance = this.views.length +\n (insertViews !== undefined ? insertViews.length : 0) -\n (removeCount !== undefined ? removeCount : 0);\n assert(finalBalance >= 0, 'final balance can not be negative');\n if (finalBalance === 0) {\n console.warn(`You can't remove all the pages in the navigation stack. nav.pop() is probably called too many times.`, this, this.el);\n throw new Error('navigation stack needs at least one root page');\n }\n // At this point the transition can not be rejected, any throw should be an error\n // there are views to insert\n if (insertViews) {\n // add the views to the\n let insertIndex = ti.insertStart;\n for (const view of insertViews) {\n this.insertViewAt(view, insertIndex);\n insertIndex++;\n }\n if (ti.enteringRequiresTransition) {\n // default to forward if not already set\n opts.direction = opts.direction || 'forward';\n }\n }\n // if the views to be removed are in the beginning or middle\n // and there is not a view that needs to visually transition out\n // then just destroy them and don't transition anything\n // batch all of lifecycles together\n // let's make sure, callbacks are zoned\n if (destroyQueue && destroyQueue.length > 0) {\n for (const view of destroyQueue) {\n lifecycle(view.element, LIFECYCLE_WILL_LEAVE);\n lifecycle(view.element, LIFECYCLE_DID_LEAVE);\n lifecycle(view.element, LIFECYCLE_WILL_UNLOAD);\n }\n // once all lifecycle events has been delivered, we can safely detroy the views\n for (const view of destroyQueue) {\n this.destroyView(view);\n }\n }\n }\n async transition(enteringView, leavingView, ti) {\n // we should animate (duration > 0) if the pushed page is not the first one (startup)\n // or if it is a portal (modal, actionsheet, etc.)\n const opts = ti.opts;\n const progressCallback = opts.progressAnimation\n ? (ani) => this.sbAni = ani\n : undefined;\n const mode = getIonMode(this);\n const enteringEl = enteringView.element;\n const leavingEl = leavingView && leavingView.element;\n const animationOpts = Object.assign(Object.assign({ mode, showGoBack: this.canGoBackSync(enteringView), baseEl: this.el, progressCallback, animated: this.animated && config.getBoolean('animated', true), enteringEl,\n leavingEl }, opts), { animationBuilder: opts.animationBuilder || this.animation || config.get('navAnimation') });\n const { hasCompleted } = await transition(animationOpts);\n return this.transitionFinish(hasCompleted, enteringView, leavingView, opts);\n }\n transitionFinish(hasCompleted, enteringView, leavingView, opts) {\n const cleanupView = hasCompleted ? enteringView : leavingView;\n if (cleanupView) {\n this.cleanup(cleanupView);\n }\n return {\n hasCompleted,\n requiresTransition: true,\n enteringView,\n leavingView,\n direction: opts.direction\n };\n }\n insertViewAt(view, index) {\n const views = this.views;\n const existingIndex = views.indexOf(view);\n if (existingIndex > -1) {\n // this view is already in the stack!!\n // move it to its new location\n assert(view.nav === this, 'view is not part of the nav');\n views.splice(index, 0, views.splice(existingIndex, 1)[0]);\n }\n else {\n assert(!view.nav, 'nav is used');\n // this is a new view to add to the stack\n // create the new entering view\n view.nav = this;\n // insert the entering view into the correct index in the stack\n views.splice(index, 0, view);\n }\n }\n removeView(view) {\n assert(view.state === VIEW_STATE_ATTACHED || view.state === VIEW_STATE_DESTROYED, 'view state should be loaded or destroyed');\n const views = this.views;\n const index = views.indexOf(view);\n assert(index > -1, 'view must be part of the stack');\n if (index >= 0) {\n views.splice(index, 1);\n }\n }\n destroyView(view) {\n view._destroy();\n this.removeView(view);\n }\n /**\n * DOM WRITE\n */\n cleanup(activeView) {\n // ok, cleanup time!! Destroy all of the views that are\n // INACTIVE and come after the active view\n // only do this if the views exist, though\n if (this.destroyed) {\n return;\n }\n const views = this.views;\n const activeViewIndex = views.indexOf(activeView);\n for (let i = views.length - 1; i >= 0; i--) {\n const view = views[i];\n /**\n * When inserting multiple views via insertPages\n * the last page will be transitioned to, but the\n * others will not be. As a result, a DOM element\n * will only be created for the last page inserted.\n * As a result, it is possible to have views in the\n * stack that do not have `view.element` yet.\n */\n const element = view.element;\n if (element) {\n if (i > activeViewIndex) {\n // this view comes after the active view\n // let's unload it\n lifecycle(element, LIFECYCLE_WILL_UNLOAD);\n this.destroyView(view);\n }\n else if (i < activeViewIndex) {\n // this view comes before the active view\n // and it is not a portal then ensure it is hidden\n setPageHidden(element, true);\n }\n }\n }\n }\n canStart() {\n return (!!this.swipeGesture &&\n !this.isTransitioning &&\n this.transInstr.length === 0 &&\n this.animationEnabled &&\n this.canGoBackSync());\n }\n onStart() {\n this.queueTrns({\n removeStart: -1,\n removeCount: 1,\n opts: {\n direction: 'back',\n progressAnimation: true\n }\n }, undefined);\n }\n onMove(stepValue) {\n if (this.sbAni) {\n this.sbAni.progressStep(stepValue);\n }\n }\n onEnd(shouldComplete, stepValue, dur) {\n if (this.sbAni) {\n this.animationEnabled = false;\n this.sbAni.onFinish(() => {\n this.animationEnabled = true;\n }, { oneTimeCallback: true });\n // Account for rounding errors in JS\n let newStepValue = (shouldComplete) ? -0.001 : 0.001;\n /**\n * Animation will be reversed here, so need to\n * reverse the easing curve as well\n *\n * Additionally, we need to account for the time relative\n * to the new easing curve, as `stepValue` is going to be given\n * in terms of a linear curve.\n */\n if (!shouldComplete) {\n this.sbAni.easing('cubic-bezier(1, 0, 0.68, 0.28)');\n newStepValue += getTimeGivenProgression([0, 0], [1, 0], [0.68, 0.28], [1, 1], stepValue)[0];\n }\n else {\n newStepValue += getTimeGivenProgression([0, 0], [0.32, 0.72], [0, 1], [1, 1], stepValue)[0];\n }\n this.sbAni.progressEnd(shouldComplete ? 1 : 0, newStepValue, dur);\n }\n }\n render() {\n return (h(\"slot\", null));\n }\n get el() { return getElement(this); }\n static get watchers() { return {\n \"swipeGesture\": [\"swipeGestureChanged\"],\n \"root\": [\"rootChanged\"]\n }; }\n};\nNav.style = navCss;\n\nconst navLink = (el, routerDirection, component, componentProps, routerAnimation) => {\n const nav = el.closest('ion-nav');\n if (nav) {\n if (routerDirection === 'forward') {\n if (component !== undefined) {\n return nav.push(component, componentProps, { skipIfBusy: true, animationBuilder: routerAnimation });\n }\n }\n else if (routerDirection === 'root') {\n if (component !== undefined) {\n return nav.setRoot(component, componentProps, { skipIfBusy: true, animationBuilder: routerAnimation });\n }\n }\n else if (routerDirection === 'back') {\n return nav.pop({ skipIfBusy: true, animationBuilder: routerAnimation });\n }\n }\n return Promise.resolve(false);\n};\n\nconst NavLink = class {\n constructor(hostRef) {\n registerInstance(this, hostRef);\n /**\n * The transition direction when navigating to another page.\n */\n this.routerDirection = 'forward';\n this.onClick = () => {\n return navLink(this.el, this.routerDirection, this.component, this.componentProps, this.routerAnimation);\n };\n }\n render() {\n return (h(Host, { onClick: this.onClick }));\n }\n get el() { return getElement(this); }\n};\n\nexport { Nav as ion_nav, NavLink as ion_nav_link };\n"],"mappings":";AAAA,SAASA,CAAC,IAAIC,gBAAgB,EAAEC,CAAC,IAAIC,WAAW,EAAEC,CAAC,EAAEC,CAAC,IAAIC,UAAU,EAAEC,CAAC,IAAIC,IAAI,QAAQ,qBAAqB;AAC5G,SAASC,CAAC,IAAIC,UAAU,EAAEC,CAAC,IAAIC,MAAM,QAAQ,4BAA4B;AACzE,SAASC,CAAC,IAAIC,uBAAuB,QAAQ,4BAA4B;AACzE,SAASC,CAAC,IAAIC,MAAM,QAAQ,uBAAuB;AACnD,SAASC,CAAC,IAAIC,SAAS,EAAEC,CAAC,IAAIC,UAAU,EAAEC,CAAC,IAAIC,aAAa,EAAEC,CAAC,IAAIC,qBAAqB,EAAEf,CAAC,IAAIgB,oBAAoB,EAAEd,CAAC,IAAIe,mBAAmB,QAAQ,qBAAqB;AAC1K,SAASC,CAAC,IAAIC,eAAe,QAAQ,kCAAkC;AAEvE,MAAMC,cAAc,GAAG,CAAC;AACxB,MAAMC,mBAAmB,GAAG,CAAC;AAC7B,MAAMC,oBAAoB,GAAG,CAAC;AAC9B,MAAMC,cAAc,CAAC;EACnBC,WAAWA,CAACC,SAAS,EAAEC,MAAM,EAAE;IAC7B,IAAI,CAACD,SAAS,GAAGA,SAAS;IAC1B,IAAI,CAACC,MAAM,GAAGA,MAAM;IACpB,IAAI,CAACC,KAAK,GAAGP,cAAc;EAC7B;EACMQ,IAAIA,CAACC,SAAS,EAAE;IAAA,IAAAC,KAAA;IAAA,OAAAC,iBAAA;MACpBD,KAAI,CAACH,KAAK,GAA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