{"version":3,"names":["LIFECYCLE_WILL_ENTER","LIFECYCLE_DID_ENTER","LIFECYCLE_WILL_LEAVE","LIFECYCLE_DID_LEAVE","LIFECYCLE_WILL_UNLOAD","moveFocus","el","tabIndex","focus","isVisible","offsetParent","createFocusController","saveViewFocus","referenceEl","focusManagerEnabled","config","get","activeEl","document","activeElement","contains","setAttribute","LAST_FOCUS","setViewFocus","focusManagerPriorities","Array","isArray","lastFocus","querySelector","priority","content","headingOne","header","printIonWarning","iosTransitionAnimation","import","mdTransitionAnimation","focusController","transition","opts","Promise","resolve","reject","writeTask","beforeTransition","runTransition","then","result","animation","destroy","afterTransition","error","enteringEl","leavingEl","setZIndex","direction","showGoBack","classList","add","remove","setPageHidden","style","setProperty","async","animationBuilder","getAnimationBuilder","ani","Build","isBrowser","noAnimation","removeProperty","undefined","animated","duration","getAnimation","mode","waitForReady","trans","baseEl","fireWillEvents","didComplete","playTransition","progressCallback","fireDidEvents","hasCompleted","defaultDeep","deep","deepWait","all","deepReady","notifyViewReady","viewIsReady","promise","onFinish","currentStep","progressStart","play","lifecycle","eventName","ev","CustomEvent","bubbles","cancelable","dispatchEvent","waitForMount","raf","element","componentOnReady","stencilEl","__registerHost","waitForCustomElement","from","children","map","hidden","removeAttribute","zIndex","getIonPageElement","ionPage"],"sources":["node_modules/@ionic/core/dist/collection/components/nav/constants.js","node_modules/@ionic/core/dist/collection/utils/focus-controller/index.js","node_modules/@ionic/core/dist/collection/utils/transition/index.js"],"sourcesContent":["/*!\n * (C) Ionic http://ionicframework.com - MIT License\n */\nexport const LIFECYCLE_WILL_ENTER = 'ionViewWillEnter';\nexport const LIFECYCLE_DID_ENTER = 'ionViewDidEnter';\nexport const LIFECYCLE_WILL_LEAVE = 'ionViewWillLeave';\nexport const LIFECYCLE_DID_LEAVE = 'ionViewDidLeave';\nexport const LIFECYCLE_WILL_UNLOAD = 'ionViewWillUnload';\n","/*!\n * (C) Ionic http://ionicframework.com - MIT License\n */\nimport { config } from \"../../global/config\";\nimport { printIonWarning } from \"../logging/index\";\n/**\n * Moves focus to a specified element. Note that we do not remove the tabindex\n * because that can result in an unintentional blur. Non-focusables can't be\n * focused, so the body will get focused again.\n */\nconst moveFocus = (el) => {\n el.tabIndex = -1;\n el.focus();\n};\n/**\n * Elements that are hidden using `display: none` should not be focused even if\n * they are present in the DOM.\n */\nconst isVisible = (el) => {\n return el.offsetParent !== null;\n};\n/**\n * The focus controller allows us to manage focus within a view so assistive\n * technologies can inform users of changes to the navigation state. Traditional\n * native apps have a way of informing assistive technology about a navigation\n * state change. Mobile browsers have this too, but only when doing a full page\n * load. In a single page app we do not do that, so we need to build this\n * integration ourselves.\n */\nexport const createFocusController = () => {\n const saveViewFocus = (referenceEl) => {\n const focusManagerEnabled = config.get('focusManagerPriority', false);\n /**\n * When going back to a previously visited page focus should typically be moved\n * back to the element that was last focused when the user was on this view.\n */\n if (focusManagerEnabled) {\n const activeEl = document.activeElement;\n if (activeEl !== null && (referenceEl === null || referenceEl === void 0 ? void 0 : referenceEl.contains(activeEl))) {\n activeEl.setAttribute(LAST_FOCUS, 'true');\n }\n }\n };\n const setViewFocus = (referenceEl) => {\n const focusManagerPriorities = config.get('focusManagerPriority', false);\n /**\n * If the focused element is a descendant of the referenceEl then it's possible\n * that the app developer manually moved focus, so we do not want to override that.\n * This can happen with inputs the are focused when a view transitions in.\n */\n if (Array.isArray(focusManagerPriorities) && !referenceEl.contains(document.activeElement)) {\n /**\n * When going back to a previously visited view focus should always be moved back\n * to the element that the user was last focused on when they were on this view.\n */\n const lastFocus = referenceEl.querySelector(`[${LAST_FOCUS}]`);\n if (lastFocus && isVisible(lastFocus)) {\n moveFocus(lastFocus);\n return;\n }\n for (const priority of focusManagerPriorities) {\n /**\n * For each recognized case (excluding the default case) make sure to return\n * so that the fallback focus behavior does not run.\n *\n * We intentionally query for specific roles/semantic elements so that the\n * transition manager can work with both Ionic and non-Ionic UI components.\n *\n * If new selectors are added, be sure to remove the outline ring by adding\n * new selectors to rule in core.scss.\n */\n switch (priority) {\n case 'content':\n const content = referenceEl.querySelector('main, [role=\"main\"]');\n if (content && isVisible(content)) {\n moveFocus(content);\n return;\n }\n break;\n case 'heading':\n const headingOne = referenceEl.querySelector('h1, [role=\"heading\"][aria-level=\"1\"]');\n if (headingOne && isVisible(headingOne)) {\n moveFocus(headingOne);\n return;\n }\n break;\n case 'banner':\n const header = referenceEl.querySelector('header, [role=\"banner\"]');\n if (header && isVisible(header)) {\n moveFocus(header);\n return;\n }\n break;\n default:\n printIonWarning(`Unrecognized focus manager priority value ${priority}`);\n break;\n }\n }\n /**\n * If there is nothing to focus then focus the page so focus at least moves to\n * the correct view. The browser will then determine where within the page to\n * move focus to.\n */\n moveFocus(referenceEl);\n }\n };\n return {\n saveViewFocus,\n setViewFocus,\n };\n};\nconst LAST_FOCUS = 'ion-last-focus';\n","/*!\n * (C) Ionic http://ionicframework.com - MIT License\n */\nimport { config } from \"../../global/config\";\nimport { Build, writeTask } from \"@stencil/core\";\nimport { LIFECYCLE_DID_ENTER, LIFECYCLE_DID_LEAVE, LIFECYCLE_WILL_ENTER, LIFECYCLE_WILL_LEAVE, } from \"../../components/nav/constants\";\nimport { createFocusController } from \"../focus-controller\";\nimport { raf } from \"../helpers\";\nconst iosTransitionAnimation = () => import('./ios.transition');\nconst mdTransitionAnimation = () => import('./md.transition');\nconst focusController = createFocusController();\n// TODO(FW-2832): types\nexport const transition = (opts) => {\n return new Promise((resolve, reject) => {\n writeTask(() => {\n beforeTransition(opts);\n runTransition(opts).then((result) => {\n if (result.animation) {\n result.animation.destroy();\n }\n afterTransition(opts);\n resolve(result);\n }, (error) => {\n afterTransition(opts);\n reject(error);\n });\n });\n });\n};\nconst beforeTransition = (opts) => {\n const enteringEl = opts.enteringEl;\n const leavingEl = opts.leavingEl;\n focusController.saveViewFocus(leavingEl);\n setZIndex(enteringEl, leavingEl, opts.direction);\n if (opts.showGoBack) {\n enteringEl.classList.add('can-go-back');\n }\n else {\n enteringEl.classList.remove('can-go-back');\n }\n setPageHidden(enteringEl, false);\n /**\n * When transitioning, the page should not\n * respond to click events. This resolves small\n * issues like users double tapping the ion-back-button.\n * These pointer events are removed in `afterTransition`.\n */\n enteringEl.style.setProperty('pointer-events', 'none');\n if (leavingEl) {\n setPageHidden(leavingEl, false);\n leavingEl.style.setProperty('pointer-events', 'none');\n }\n};\nconst runTransition = async (opts) => {\n const animationBuilder = await getAnimationBuilder(opts);\n const ani = animationBuilder && Build.isBrowser ? animation(animationBuilder, opts) : noAnimation(opts); // fast path for no animation\n return ani;\n};\nconst afterTransition = (opts) => {\n const enteringEl = opts.enteringEl;\n const leavingEl = opts.leavingEl;\n enteringEl.classList.remove('ion-page-invisible');\n enteringEl.style.removeProperty('pointer-events');\n if (leavingEl !== undefined) {\n leavingEl.classList.remove('ion-page-invisible');\n leavingEl.style.removeProperty('pointer-events');\n }\n focusController.setViewFocus(enteringEl);\n};\nconst getAnimationBuilder = async (opts) => {\n if (!opts.leavingEl || !opts.animated || opts.duration === 0) {\n return undefined;\n }\n if (opts.animationBuilder) {\n return opts.animationBuilder;\n }\n const getAnimation = opts.mode === 'ios'\n ? (await iosTransitionAnimation()).iosTransitionAnimation\n : (await mdTransitionAnimation()).mdTransitionAnimation;\n return getAnimation;\n};\nconst animation = async (animationBuilder, opts) => {\n await waitForReady(opts, true);\n const trans = animationBuilder(opts.baseEl, opts);\n fireWillEvents(opts.enteringEl, opts.leavingEl);\n const didComplete = await playTransition(trans, opts);\n if (opts.progressCallback) {\n opts.progressCallback(undefined);\n }\n if (didComplete) {\n fireDidEvents(opts.enteringEl, opts.leavingEl);\n }\n return {\n hasCompleted: didComplete,\n animation: trans,\n };\n};\nconst noAnimation = async (opts) => {\n const enteringEl = opts.enteringEl;\n const leavingEl = opts.leavingEl;\n const focusManagerEnabled = config.get('focusManagerPriority', false);\n /**\n * If the focus manager is enabled then we need to wait for Ionic components to be\n * rendered otherwise the component to focus may not be focused because it is hidden.\n */\n await waitForReady(opts, focusManagerEnabled);\n fireWillEvents(enteringEl, leavingEl);\n fireDidEvents(enteringEl, leavingEl);\n return {\n hasCompleted: true,\n };\n};\nconst waitForReady = async (opts, defaultDeep) => {\n const deep = opts.deepWait !== undefined ? opts.deepWait : defaultDeep;\n if (deep) {\n await Promise.all([deepReady(opts.enteringEl), deepReady(opts.leavingEl)]);\n }\n await notifyViewReady(opts.viewIsReady, opts.enteringEl);\n};\nconst notifyViewReady = async (viewIsReady, enteringEl) => {\n if (viewIsReady) {\n await viewIsReady(enteringEl);\n }\n};\nconst playTransition = (trans, opts) => {\n const progressCallback = opts.progressCallback;\n const promise = new Promise((resolve) => {\n trans.onFinish((currentStep) => resolve(currentStep === 1));\n });\n // cool, let's do this, start the transition\n if (progressCallback) {\n // this is a swipe to go back, just get the transition progress ready\n // kick off the swipe animation start\n trans.progressStart(true);\n progressCallback(trans);\n }\n else {\n // only the top level transition should actually start \"play\"\n // kick it off and let it play through\n // ******** DOM WRITE ****************\n trans.play();\n }\n // create a callback for when the animation is done\n return promise;\n};\nconst fireWillEvents = (enteringEl, leavingEl) => {\n lifecycle(leavingEl, LIFECYCLE_WILL_LEAVE);\n lifecycle(enteringEl, LIFECYCLE_WILL_ENTER);\n};\nconst fireDidEvents = (enteringEl, leavingEl) => {\n lifecycle(enteringEl, LIFECYCLE_DID_ENTER);\n lifecycle(leavingEl, LIFECYCLE_DID_LEAVE);\n};\nexport const lifecycle = (el, eventName) => {\n if (el) {\n const ev = new CustomEvent(eventName, {\n bubbles: false,\n cancelable: false,\n });\n el.dispatchEvent(ev);\n }\n};\n/**\n * Wait two request animation frame loops.\n * This allows the framework implementations enough time to mount\n * the user-defined contents. This is often needed when using inline\n * modals and popovers that accept user components. For popover,\n * the contents must be mounted for the popover to be sized correctly.\n * For modals, the contents must be mounted for iOS to run the\n * transition correctly.\n *\n * On Angular and React, a single raf is enough time, but for Vue\n * we need to wait two rafs. As a result we are using two rafs for\n * all frameworks to ensure contents are mounted.\n */\nexport const waitForMount = () => {\n return new Promise((resolve) => raf(() => raf(() => resolve())));\n};\nexport const deepReady = async (el) => {\n const element = el;\n if (element) {\n if (element.componentOnReady != null) {\n // eslint-disable-next-line custom-rules/no-component-on-ready-method\n const stencilEl = await element.componentOnReady();\n if (stencilEl != null) {\n return;\n }\n /**\n * Custom elements in Stencil will have __registerHost.\n */\n }\n else if (element.__registerHost != null) {\n /**\n * Non-lazy loaded custom elements need to wait\n * one frame for component to be loaded.\n */\n const waitForCustomElement = new Promise((resolve) => raf(resolve));\n await waitForCustomElement;\n return;\n }\n await Promise.all(Array.from(element.children).map(deepReady));\n }\n};\nexport const setPageHidden = (el, hidden) => {\n if (hidden) {\n el.setAttribute('aria-hidden', 'true');\n el.classList.add('ion-page-hidden');\n }\n else {\n el.hidden = false;\n el.removeAttribute('aria-hidden');\n el.classList.remove('ion-page-hidden');\n }\n};\nconst setZIndex = (enteringEl, leavingEl, direction) => {\n if (enteringEl !== undefined) {\n enteringEl.style.zIndex = direction === 'back' ? '99' : '101';\n }\n if (leavingEl !== undefined) {\n leavingEl.style.zIndex = '100';\n }\n};\nexport const getIonPageElement = (element) => {\n if (element.classList.contains('ion-page')) {\n return element;\n }\n const ionPage = element.querySelector(':scope > .ion-page, :scope > ion-nav, :scope > ion-tabs');\n if (ionPage) {\n return ionPage;\n }\n // idk, return the original element so at least something animates and we don't have a null pointer\n return element;\n};\n"],"mappings":";;;GAGO,MAAMA,EAAuB,mBAC7B,MAAMC,EAAsB,kBACvB,MAACC,EAAuB,mBACxB,MAACC,EAAsB,kBACvB,MAACC,EAAwB;;;GCGrC,MAAMC,EAAaC,IACfA,EAAGC,UAAY,EACfD,EAAGE,OAAO,EAMd,MAAMC,EAAaH,GACRA,EAAGI,eAAiB,KAUxB,MAAMC,EAAwB,KACjC,MAAMC,EAAiBC,IACnB,MAAMC,EAAsBC,EAAOC,IAAI,uBAAwB,OAK/D,GAAIF,EAAqB,CACrB,MAAMG,EAAWC,SAASC,cAC1B,GAAIF,IAAa,OAASJ,IAAgB,MAA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