@tindtechnologies/universalviewer
Version:
The Universal Viewer is a community-developed open source project on a mission to help you share your 📚📜📰📽️📻🗿 with the 🌎
1 lines • 13.8 kB
JavaScript
"use strict";(self.webpackChunkUV=self.webpackChunkUV||[]).push([[704],{8882:(e,n,t)=>{t.d(n,{P:()=>i,g:()=>r});var i=function(e,n){this.x=e,this.y=n},r=function(e,n,t,i,r){var s=a(e.y,n.y,t.y,i.y,r);return o(e.x,n.x,t.x,i.x,s[0])},o=function(e,n,t,i,r){return r*(3*n*Math.pow(r-1,2)+r*(-3*t*r+3*t+i*r))-e*Math.pow(r-1,3)},a=function(e,n,t,i,r){return s((i-=r)-3*(t-=r)+3*(n-=r)-(e-=r),3*t-6*n+3*e,3*n-3*e,e).filter((function(e){return e>=0&&e<=1}))},s=function(e,n,t,i){if(0===e)return function(e,n,t){var i=n*n-4*e*t;return i<0?[]:[(-n+Math.sqrt(i))/(2*e),(-n-Math.sqrt(i))/(2*e)]}(n,t,i);var r=(3*(t/=e)-(n/=e)*n)/3,o=(2*n*n*n-9*n*t+27*(i/=e))/27;if(0===r)return[Math.pow(-o,1/3)];if(0===o)return[Math.sqrt(-r),-Math.sqrt(-r)];var a=Math.pow(o/2,2)+Math.pow(r/3,3);if(0===a)return[Math.pow(o/2,.5)-n/3];if(a>0)return[Math.pow(-o/2+Math.sqrt(a),1/3)-Math.pow(o/2+Math.sqrt(a),1/3)-n/3];var s=Math.sqrt(Math.pow(-r/3,3)),u=Math.acos(-o/(2*Math.sqrt(Math.pow(-r/3,3)))),c=2*Math.pow(s,1/3);return[c*Math.cos(u/3)-n/3,c*Math.cos((u+2*Math.PI)/3)-n/3,c*Math.cos((u+4*Math.PI)/3)-n/3]}},5721:(e,n,t)=>{t.d(n,{a:()=>i,d:()=>r});var i=function(e,n,t,i,r){return o=void 0,a=void 0,u=function(){var o;return function(e,n){var t,i,r,o,a={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(t)throw new TypeError("Generator is already executing.");for(;a;)try{if(t=1,i&&(r=2&o[0]?i.return:o[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,o[1])).done)return r;switch(i=0,r&&(o=[2&o[0],r.value]),o[0]){case 0:case 1:r=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,i=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((r=(r=a.trys).length>0&&r[r.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1]<r[3])){a.label=o[1];break}if(6===o[0]&&a.label<r[1]){a.label=r[1],r=o;break}if(r&&a.label<r[2]){a.label=r[2],a.ops.push(o);break}r[2]&&a.ops.pop(),a.trys.pop();continue}o=n.call(e,a)}catch(e){o=[6,e],i=0}finally{t=r=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}}(this,(function(a){switch(a.label){case 0:if(e)return[2,e.attachViewToDom(n,t,r,i)];if("string"!=typeof t&&!(t instanceof HTMLElement))throw new Error("framework delegate is missing");return o="string"==typeof t?n.ownerDocument&&n.ownerDocument.createElement(t):t,i&&i.forEach((function(e){return o.classList.add(e)})),r&&Object.assign(o,r),n.appendChild(o),o.componentOnReady?[4,o.componentOnReady()]:[3,2];case 1:a.sent(),a.label=2;case 2:return[2,o]}}))},new((s=void 0)||(s=Promise))((function(e,n){function t(e){try{r(u.next(e))}catch(e){n(e)}}function i(e){try{r(u.throw(e))}catch(e){n(e)}}function r(n){n.done?e(n.value):new s((function(e){e(n.value)})).then(t,i)}r((u=u.apply(o,a||[])).next())}));var o,a,s,u},r=function(e,n){if(n){if(e){var t=n.parentElement;return e.removeViewFromDom(t,n)}n.remove()}return Promise.resolve()}},1761:(e,n,t)=>{t.d(n,{L:()=>c,a:()=>s,b:()=>u,d:()=>C,g:()=>L,l:()=>k,s:()=>M,t:()=>l});var i=t(5873),r=function(e,n,t,i){return new(t||(t=Promise))((function(r,o){function a(e){try{u(i.next(e))}catch(e){o(e)}}function s(e){try{u(i.throw(e))}catch(e){o(e)}}function u(e){e.done?r(e.value):new t((function(n){n(e.value)})).then(a,s)}u((i=i.apply(e,n||[])).next())}))},o=function(e,n){var t,i,r,o,a={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(t)throw new TypeError("Generator is already executing.");for(;a;)try{if(t=1,i&&(r=2&o[0]?i.return:o[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,o[1])).done)return r;switch(i=0,r&&(o=[2&o[0],r.value]),o[0]){case 0:case 1:r=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,i=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((r=(r=a.trys).length>0&&r[r.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1]<r[3])){a.label=o[1];break}if(6===o[0]&&a.label<r[1]){a.label=r[1],r=o;break}if(r&&a.label<r[2]){a.label=r[2],a.ops.push(o);break}r[2]&&a.ops.pop(),a.trys.pop();continue}o=n.call(e,a)}catch(e){o=[6,e],i=0}finally{t=r=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}},a=void 0,s="ionViewWillLeave",u="ionViewDidLeave",c="ionViewWillUnload",l=function(e){return new Promise((function(n,t){(0,i.w)((function(){h(e),f(e).then((function(t){t.animation&&t.animation.destroy(),d(e),n(t)}),(function(n){d(e),t(n)}))}))}))},h=function(e){var n=e.enteringEl,t=e.leavingEl;x(n,t,e.direction),e.showGoBack?n.classList.add("can-go-back"):n.classList.remove("can-go-back"),M(n,!1),t&&M(t,!1)},f=function(e){return r(a,void 0,void 0,(function(){var n;return o(this,(function(t){switch(t.label){case 0:return[4,p(e)];case 1:return[2,(n=t.sent())?v(n,e):b(e)]}}))}))},d=function(e){var n=e.enteringEl,t=e.leavingEl;n.classList.remove("ion-page-invisible"),void 0!==t&&t.classList.remove("ion-page-invisible")},p=function(e){return r(a,void 0,void 0,(function(){var n;return o(this,(function(i){switch(i.label){case 0:return e.leavingEl&&e.animated&&0!==e.duration?e.animationBuilder?[2,e.animationBuilder]:"ios"!==e.mode?[3,2]:[4,Promise.all([t.e(6653),t.e(5480)]).then(t.bind(t,5480))]:[2,void 0];case 1:return n=i.sent().iosTransitionAnimation,[3,4];case 2:return[4,Promise.all([t.e(6653),t.e(3203)]).then(t.bind(t,3203))];case 3:n=i.sent().mdTransitionAnimation,i.label=4;case 4:return[2,n]}}))}))},v=function(e,n){return r(a,void 0,void 0,(function(){var i,r;return o(this,(function(o){switch(o.label){case 0:return[4,w(n,!0)];case 1:o.sent(),o.label=2;case 2:return o.trys.push([2,5,,6]),[4,t.e(1605).then(t.bind(t,1605))];case 3:return[4,o.sent().create(e,n.baseEl,n)];case 4:return i=o.sent(),[3,6];case 5:return o.sent(),i=e(n.baseEl,n),[3,6];case 6:return y(n.enteringEl,n.leavingEl),[4,g(i,n)];case 7:return r=o.sent(),n.progressCallback&&n.progressCallback(void 0),r&&E(n.enteringEl,n.leavingEl),[2,{hasCompleted:r,animation:i}]}}))}))},b=function(e){return r(a,void 0,void 0,(function(){var n,t;return o(this,(function(i){switch(i.label){case 0:return n=e.enteringEl,t=e.leavingEl,[4,w(e,!1)];case 1:return i.sent(),y(n,t),E(n,t),[2,{hasCompleted:!0}]}}))}))},w=function(e,n){return r(a,void 0,void 0,(function(){var t,i;return o(this,(function(r){switch(r.label){case 0:return t=void 0!==e.deepWait?e.deepWait:n,i=t?[C(e.enteringEl),C(e.leavingEl)]:[P(e.enteringEl),P(e.leavingEl)],[4,Promise.all(i)];case 1:return r.sent(),[4,m(e.viewIsReady,e.enteringEl)];case 2:return r.sent(),[2]}}))}))},m=function(e,n){return r(a,void 0,void 0,(function(){return o(this,(function(t){switch(t.label){case 0:return e?[4,e(n)]:[3,2];case 1:t.sent(),t.label=2;case 2:return[2]}}))}))},g=function(e,n){var t=n.progressCallback,i=new Promise((function(n){e.onFinish((function(t){"number"==typeof t?n(1===t):void 0!==e.hasCompleted&&n(e.hasCompleted)}))}));return t?(e.progressStart(!0),t(e)):e.play(),i},y=function(e,n){k(n,s),k(e,"ionViewWillEnter")},E=function(e,n){k(e,"ionViewDidEnter"),k(n,u)},k=function(e,n){if(e){var t=new CustomEvent(n,{bubbles:!1,cancelable:!1});e.dispatchEvent(t)}},P=function(e){return e&&e.componentOnReady?e.componentOnReady():Promise.resolve()},C=function(e){return r(a,void 0,void 0,(function(){var n;return o(this,(function(t){switch(t.label){case 0:return(n=e)?null==n.componentOnReady?[3,2]:[4,n.componentOnReady()]:[3,4];case 1:if(null!=t.sent())return[2];t.label=2;case 2:return[4,Promise.all(Array.from(n.children).map(C))];case 3:t.sent(),t.label=4;case 4:return[2]}}))}))},M=function(e,n){n?(e.setAttribute("aria-hidden","true"),e.classList.add("ion-page-hidden")):(e.hidden=!1,e.removeAttribute("aria-hidden"),e.classList.remove("ion-page-hidden"))},x=function(e,n,t){void 0!==e&&(e.style.zIndex="back"===t?"99":"101"),void 0!==n&&(n.style.zIndex="100")},L=function(e){return e.classList.contains("ion-page")?e:e.querySelector(":scope > .ion-page, :scope > ion-nav, :scope > ion-tabs")||e}},704:(e,n,t)=>{t.r(n),t.d(n,{ion_router_outlet:()=>c});var i=t(5873),r=t(5721),o=t(8882),a=t(1761),s=function(e,n,t,i){return new(t||(t=Promise))((function(r,o){function a(e){try{u(i.next(e))}catch(e){o(e)}}function s(e){try{u(i.throw(e))}catch(e){o(e)}}function u(e){e.done?r(e.value):new t((function(n){n(e.value)})).then(a,s)}u((i=i.apply(e,n||[])).next())}))},u=function(e,n){var t,i,r,o,a={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(t)throw new TypeError("Generator is already executing.");for(;a;)try{if(t=1,i&&(r=2&o[0]?i.return:o[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,o[1])).done)return r;switch(i=0,r&&(o=[2&o[0],r.value]),o[0]){case 0:case 1:r=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,i=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((r=(r=a.trys).length>0&&r[r.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1]<r[3])){a.label=o[1];break}if(6===o[0]&&a.label<r[1]){a.label=r[1],r=o;break}if(r&&a.label<r[2]){a.label=r[2],a.ops.push(o);break}r[2]&&a.ops.pop(),a.trys.pop();continue}o=n.call(e,a)}catch(e){o=[6,e],i=0}finally{t=r=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}},c=function(){function e(e){(0,i.r)(this,e),this.animationEnabled=!0,this.mode=(0,i.f)(this),this.animated=!0,this.ionNavWillLoad=(0,i.c)(this,"ionNavWillLoad",7),this.ionNavWillChange=(0,i.c)(this,"ionNavWillChange",3),this.ionNavDidChange=(0,i.c)(this,"ionNavDidChange",3)}return e.prototype.swipeHandlerChanged=function(){this.gesture&&this.gesture.setDisabled(void 0===this.swipeHandler)},e.prototype.connectedCallback=function(){return s(this,void 0,void 0,(function(){var e,n=this;return u(this,(function(i){switch(i.label){case 0:return e=this,[4,t.e(5857).then(t.bind(t,5857))];case 1:return e.gesture=i.sent().createSwipeBackGesture(this.el,(function(){return!!n.swipeHandler&&n.swipeHandler.canStart()&&n.animationEnabled}),(function(){return n.swipeHandler&&n.swipeHandler.onStart()}),(function(e){return n.ani&&n.ani.progressStep(e)}),(function(e,t,i){if(n.ani){n.animationEnabled=!1,n.ani.onFinish((function(){n.animationEnabled=!0,n.swipeHandler&&n.swipeHandler.onEnd(e)}),{oneTimeCallback:!0});var r=e?-.001:.001;e?r+=(0,o.g)(new o.P(0,0),new o.P(.32,.72),new o.P(0,1),new o.P(1,1),t):(n.ani.easing("cubic-bezier(1, 0, 0.68, 0.28)"),r+=(0,o.g)(new o.P(0,0),new o.P(1,0),new o.P(.68,.28),new o.P(1,1),t)),n.ani.progressEnd(e?1:0,r,i)}})),this.swipeHandlerChanged(),[2]}}))}))},e.prototype.componentWillLoad=function(){this.ionNavWillLoad.emit()},e.prototype.disconnectedCallback=function(){this.gesture&&(this.gesture.destroy(),this.gesture=void 0)},e.prototype.commit=function(e,n,t){return s(this,void 0,void 0,(function(){var i,r,o;return u(this,(function(a){switch(a.label){case 0:return[4,this.lock()];case 1:i=a.sent(),r=!1,a.label=2;case 2:return a.trys.push([2,4,,5]),[4,this.transition(e,n,t)];case 3:return r=a.sent(),[3,5];case 4:return o=a.sent(),console.error(o),[3,5];case 5:return i(),[2,r]}}))}))},e.prototype.setRouteId=function(e,n,t){return s(this,void 0,void 0,(function(){return u(this,(function(i){switch(i.label){case 0:return[4,this.setRoot(e,n,{duration:"root"===t?0:void 0,direction:"back"===t?"back":"forward"})];case 1:return[2,{changed:i.sent(),element:this.activeEl}]}}))}))},e.prototype.getRouteId=function(){return s(this,void 0,void 0,(function(){var e;return u(this,(function(n){return[2,(e=this.activeEl)?{id:e.tagName,element:e}:void 0]}))}))},e.prototype.setRoot=function(e,n,t){return s(this,void 0,void 0,(function(){var i,o;return u(this,(function(a){switch(a.label){case 0:return this.activeComponent===e?[2,!1]:(i=this.activeEl,[4,(0,r.a)(this.delegate,this.el,e,["ion-page","ion-page-invisible"],n)]);case 1:return o=a.sent(),this.activeComponent=e,this.activeEl=o,[4,this.commit(o,i,t)];case 2:return a.sent(),[4,(0,r.d)(this.delegate,i)];case 3:return a.sent(),[2,!0]}}))}))},e.prototype.transition=function(e,n,t){return void 0===t&&(t={}),s(this,void 0,void 0,(function(){var r,o,s,c,l,h=this;return u(this,(function(u){switch(u.label){case 0:return n===e?[2,!1]:(this.ionNavWillChange.emit(),o=(r=this).el,s=r.mode,c=this.animated&&i.i.getBoolean("animated",!0),l=this.animation||t.animationBuilder||i.i.get("navAnimation"),[4,(0,a.t)(Object.assign({mode:s,animated:c,animationBuilder:l,enteringEl:e,leavingEl:n,baseEl:o,progressCallback:t.progressAnimation?function(e){return h.ani=e}:void 0},t))]);case 1:return u.sent(),this.ionNavDidChange.emit(),[2,!0]}}))}))},e.prototype.lock=function(){return s(this,void 0,void 0,(function(){var e,n;return u(this,(function(t){switch(t.label){case 0:return e=this.waitPromise,this.waitPromise=new Promise((function(e){return n=e})),void 0===e?[3,2]:[4,e];case 1:t.sent(),t.label=2;case 2:return[2,n]}}))}))},e.prototype.render=function(){return(0,i.h)("slot",null)},Object.defineProperty(e.prototype,"el",{get:function(){return(0,i.d)(this)},enumerable:!0,configurable:!0}),Object.defineProperty(e,"watchers",{get:function(){return{swipeHandler:["swipeHandlerChanged"]}},enumerable:!0,configurable:!0}),Object.defineProperty(e,"style",{get:function(){return":host{left:0;right:0;top:0;bottom:0;position:absolute;contain:layout size style;overflow:hidden;z-index:0}"},enumerable:!0,configurable:!0}),e}()}}]);