UNPKG

@huluvu424242/honey-slideshow

Version:

Text to Speech component wich is reading texts from DOM elements.

1 lines 2.4 kB
import{j as i,B as a}from"./p-4a369965.js";const n="ionViewWillLeave",e="ionViewDidLeave",o="ionViewWillUnload",s=a=>new Promise((n,e)=>{i(()=>{t(a),r(a).then(i=>{i.animation&&i.animation.destroy(),c(a),n(i)},i=>{c(a),e(i)})})}),t=i=>{const a=i.enteringEl,n=i.leavingEl;f(a,n,i.direction),i.showGoBack?a.classList.add("can-go-back"):a.classList.remove("can-go-back"),g(a,!1),n&&g(n,!1)},r=async i=>{const n=await l(i);return n&&a.isBrowser?w(n,i):d(i)},c=i=>{const a=i.leavingEl;i.enteringEl.classList.remove("ion-page-invisible"),void 0!==a&&a.classList.remove("ion-page-invisible")},l=async i=>{if(i.leavingEl&&i.animated&&0!==i.duration)return i.animationBuilder?i.animationBuilder:"ios"===i.mode?(await __sc_import_honey_slideshow("./p-41668298.js")).iosTransitionAnimation:(await __sc_import_honey_slideshow("./p-24cfb6c5.js")).mdTransitionAnimation},w=async(i,a)=>{await p(a,!0);const n=i(a.baseEl,a);v(a.enteringEl,a.leavingEl);const e=await u(n,a);return a.progressCallback&&a.progressCallback(void 0),e&&b(a.enteringEl,a.leavingEl),{hasCompleted:e,animation:n}},d=async i=>{const a=i.enteringEl,n=i.leavingEl;return await p(i,!1),v(a,n),b(a,n),{hasCompleted:!0}},p=async(i,a)=>{const n=(void 0!==i.deepWait?i.deepWait:a)?[_(i.enteringEl),_(i.leavingEl)]:[y(i.enteringEl),y(i.leavingEl)];await Promise.all(n),await m(i.viewIsReady,i.enteringEl)},m=async(i,a)=>{i&&await i(a)},u=(i,a)=>{const n=a.progressCallback,e=new Promise(a=>{i.onFinish(i=>a(1===i))});return n?(i.progressStart(!0),n(i)):i.play(),e},v=(i,a)=>{h(a,"ionViewWillLeave"),h(i,"ionViewWillEnter")},b=(i,a)=>{h(i,"ionViewDidEnter"),h(a,"ionViewDidLeave")},h=(i,a)=>{if(i){const n=new CustomEvent(a,{bubbles:!1,cancelable:!1});i.dispatchEvent(n)}},y=i=>i&&i.componentOnReady?i.componentOnReady():Promise.resolve(),_=async i=>{const a=i;if(a){if(null!=a.componentOnReady&&null!=await a.componentOnReady())return;await Promise.all(Array.from(a.children).map(_))}},g=(i,a)=>{a?(i.setAttribute("aria-hidden","true"),i.classList.add("ion-page-hidden")):(i.hidden=!1,i.removeAttribute("aria-hidden"),i.classList.remove("ion-page-hidden"))},f=(i,a,n)=>{void 0!==i&&(i.style.zIndex="back"===n?"99":"101"),void 0!==a&&(a.style.zIndex="100")},V=i=>{if(i.classList.contains("ion-page"))return i;return i.querySelector(":scope > .ion-page, :scope > ion-nav, :scope > ion-tabs")||i};export{o as L,n as a,e as b,_ as d,V as g,h as l,g as s,s as t}