UNPKG

@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 9.61 kB
"use strict";(self.webpackChunkUV=self.webpackChunkUV||[]).push([[7755],{3494:(n,e,t)=>{t.d(e,{m:()=>f});var r=t(6653),i=function(n,e,t,r){return new(t||(t=Promise))((function(i,o){function u(n){try{c(r.next(n))}catch(n){o(n)}}function a(n){try{c(r.throw(n))}catch(n){o(n)}}function c(n){n.done?i(n.value):new t((function(e){e(n.value)})).then(u,a)}c((r=r.apply(n,e||[])).next())}))},o=function(n,e){var t,r,i,o,u={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(o){return function(a){return function(o){if(t)throw new TypeError("Generator is already executing.");for(;u;)try{if(t=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return u.label++,{value:o[1],done:!1};case 5:u.label++,r=o[1],o=[0];continue;case 7:o=u.ops.pop(),u.trys.pop();continue;default:if(!((i=(i=u.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){u=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){u.label=o[1];break}if(6===o[0]&&u.label<i[1]){u.label=i[1],i=o;break}if(i&&u.label<i[2]){u.label=i[2],u.ops.push(o);break}i[2]&&u.ops.pop(),u.trys.pop();continue}o=e.call(n,u)}catch(n){o=[6,n],r=0}finally{t=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,a])}}},u=void 0,a=function(){return(0,r.c)().easing("cubic-bezier(0.0, 0.0, 0.2, 1)").duration(300)},c=function(n){var e,t,i=n.width+8,o=(0,r.c)(),u=(0,r.c)();return n.isEndSide?(e=i+"px",t="0px"):(e=-i+"px",t="0px"),o.addElement(n.menuInnerEl).fromTo("transform","translateX("+e+")","translateX("+t+")"),u.addElement(n.backdropEl).fromTo("opacity",.01,.32),a().addAnimation([o,u])},s=function(n){var e,t,i=n.width;n.isEndSide?(e=-i+"px",t=i+"px"):(e=i+"px",t=-i+"px");var o=(0,r.c)().addElement(n.menuInnerEl).fromTo("transform","translateX("+t+")","translateX(0px)"),u=(0,r.c)().addElement(n.contentEl).fromTo("transform","translateX(0px)","translateX("+e+")"),c=(0,r.c)().addElement(n.backdropEl).fromTo("opacity",.01,.32);return a().addAnimation([o,c,u])},l=function(n){var e=n.width*(n.isEndSide?-1:1)+"px",t=(0,r.c)().addElement(n.contentEl).fromTo("transform","translateX(0px)","translateX("+e+")");return a().addAnimation(t)},f=function(){var n=new Map,e=[],t=function(n){return i(u,void 0,void 0,(function(){var t,r;return o(this,(function(i){switch(i.label){case 0:return[4,v()];case 1:return i.sent(),"start"===n||"end"===n?(t=p((function(e){return e.side===n&&!e.disabled})))?[2,t]:[2,p((function(e){return e.side===n}))]:null!=n?[2,p((function(e){return e.menuId===n}))]:(r=p((function(n){return!n.disabled})))?[2,r]:[2,e.length>0?e[0].el:void 0]}}))}))},r=function(){return i(u,void 0,void 0,(function(){return o(this,(function(n){switch(n.label){case 0:return[4,v()];case 1:return n.sent(),[2,d()]}}))}))},a=function(e,t){n.set(e,t)},f=function(n){var t=n.side;e.filter((function(e){return e.side===t&&e!==n})).forEach((function(n){return n.disabled=!0}))},d=function(){return p((function(n){return n._isOpen}))},h=function(){return e.some((function(n){return n.isAnimating}))},p=function(n){var t=e.find(n);if(void 0!==t)return t.el},v=function(){return Promise.all(Array.from(document.querySelectorAll("ion-menu")).map((function(n){return n.componentOnReady()})))};return a("reveal",l),a("push",s),a("overlay",c),{registerAnimation:a,get:t,getMenus:function(){return i(u,void 0,void 0,(function(){return o(this,(function(n){switch(n.label){case 0:return[4,v()];case 1:return n.sent(),[2,e.map((function(n){return n.el}))]}}))}))},getOpen:r,isEnabled:function(n){return i(u,void 0,void 0,(function(){var e;return o(this,(function(r){switch(r.label){case 0:return[4,t(n)];case 1:return(e=r.sent())?[2,!e.disabled]:[2,!1]}}))}))},swipeGesture:function(n,e){return i(u,void 0,void 0,(function(){var r;return o(this,(function(i){switch(i.label){case 0:return[4,t(e)];case 1:return(r=i.sent())&&(r.swipeGesture=n),[2,r]}}))}))},isAnimating:function(){return i(u,void 0,void 0,(function(){return o(this,(function(n){switch(n.label){case 0:return[4,v()];case 1:return n.sent(),[2,h()]}}))}))},isOpen:function(n){return i(u,void 0,void 0,(function(){var e;return o(this,(function(i){switch(i.label){case 0:return null==n?[3,2]:[4,t(n)];case 1:return[2,void 0!==(e=i.sent())&&e.isOpen()];case 2:return[4,r()];case 3:return[2,void 0!==(e=i.sent())]}}))}))},enable:function(n,e){return i(u,void 0,void 0,(function(){var r;return o(this,(function(i){switch(i.label){case 0:return[4,t(e)];case 1:return(r=i.sent())&&(r.disabled=!n),[2,r]}}))}))},toggle:function(n){return i(u,void 0,void 0,(function(){var e;return o(this,(function(r){switch(r.label){case 0:return[4,t(n)];case 1:return(e=r.sent())?[2,e.toggle()]:[2,!1]}}))}))},close:function(n){return i(u,void 0,void 0,(function(){var e;return o(this,(function(i){switch(i.label){case 0:return[4,void 0!==n?t(n):r()];case 1:return void 0!==(e=i.sent())?[2,e.close()]:[2,!1]}}))}))},open:function(n){return i(u,void 0,void 0,(function(){var e;return o(this,(function(r){switch(r.label){case 0:return[4,t(n)];case 1:return(e=r.sent())?[2,e.open()]:[2,!1]}}))}))},_getOpenSync:d,_createAnimation:function(e,t){var r=n.get(e);if(!r)throw new Error("animation not registered");return r(t)},_register:function(n){e.indexOf(n)<0&&(n.disabled||f(n),e.push(n))},_unregister:function(n){var t=e.indexOf(n);t>-1&&e.splice(t,1)},_setOpen:function(n,e,t){return i(u,void 0,void 0,(function(){var i;return o(this,(function(o){switch(o.label){case 0:return h()?[2,!1]:e?[4,r()]:[3,3];case 1:return(i=o.sent())&&n.el!==i?[4,i.setOpen(!1,!1)]:[3,3];case 2:o.sent(),o.label=3;case 3:return[2,n._setOpen(e,t)]}}))}))},_setActiveMenu:f}}()},7755:(n,e,t)=>{t.r(e),t.d(e,{ion_menu_toggle:()=>u});var r=t(5873),i=t(3494),o=t(8579),u=function(){function n(n){var e=this;(0,r.r)(this,n),this.visible=!1,this.autoHide=!0,this.onClick=function(){return i.m.toggle(e.menu)}}return n.prototype.connectedCallback=function(){this.visibilityChanged()},n.prototype.visibilityChanged=function(){return n=this,e=void 0,r=function(){var n;return function(n,e){var t,r,i,o,u={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(o){return function(a){return function(o){if(t)throw new TypeError("Generator is already executing.");for(;u;)try{if(t=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return u.label++,{value:o[1],done:!1};case 5:u.label++,r=o[1],o=[0];continue;case 7:o=u.ops.pop(),u.trys.pop();continue;default:if(!((i=(i=u.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){u=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){u.label=o[1];break}if(6===o[0]&&u.label<i[1]){u.label=i[1],i=o;break}if(i&&u.label<i[2]){u.label=i[2],u.ops.push(o);break}i[2]&&u.ops.pop(),u.trys.pop();continue}o=e.call(n,u)}catch(n){o=[6,n],r=0}finally{t=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,a])}}}(this,(function(e){switch(e.label){case 0:return n=this,[4,(0,o.u)(this.menu)];case 1:return n.visible=e.sent(),[2]}}))},new((t=void 0)||(t=Promise))((function(i,o){function u(n){try{c(r.next(n))}catch(n){o(n)}}function a(n){try{c(r.throw(n))}catch(n){o(n)}}function c(n){n.done?i(n.value):new t((function(e){e(n.value)})).then(u,a)}c((r=r.apply(n,e||[])).next())}));var n,e,t,r},n.prototype.render=function(){var n,e=(0,r.f)(this),t=this.autoHide&&!this.visible;return(0,r.h)(r.H,{onClick:this.onClick,"aria-hidden":t?"true":null,class:(n={},n[e]=!0,n["menu-toggle-hidden"]=t,n)},(0,r.h)("slot",null))},Object.defineProperty(n,"style",{get:function(){return":host(.menu-toggle-hidden){display:none}"},enumerable:!0,configurable:!0}),n}()},8579:(n,e,t)=>{t.d(e,{u:()=>i});var r=t(3494),i=function(n){return e=void 0,t=void 0,o=function(){var e,t;return function(n,e){var t,r,i,o,u={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(o){return function(a){return function(o){if(t)throw new TypeError("Generator is already executing.");for(;u;)try{if(t=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return u.label++,{value:o[1],done:!1};case 5:u.label++,r=o[1],o=[0];continue;case 7:o=u.ops.pop(),u.trys.pop();continue;default:if(!((i=(i=u.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){u=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){u.label=o[1];break}if(6===o[0]&&u.label<i[1]){u.label=i[1],i=o;break}if(i&&u.label<i[2]){u.label=i[2],u.ops.push(o);break}i[2]&&u.ops.pop(),u.trys.pop();continue}o=e.call(n,u)}catch(n){o=[6,n],r=0}finally{t=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,a])}}}(this,(function(i){switch(i.label){case 0:return[4,r.m.get(n)];case 1:return e=i.sent(),(t=e)?[4,e.isActive()]:[3,3];case 2:t=i.sent(),i.label=3;case 3:return[2,!!t]}}))},new((i=void 0)||(i=Promise))((function(n,r){function u(n){try{c(o.next(n))}catch(n){r(n)}}function a(n){try{c(o.throw(n))}catch(n){r(n)}}function c(e){e.done?n(e.value):new i((function(n){n(e.value)})).then(u,a)}c((o=o.apply(e,t||[])).next())}));var e,t,i,o}}}]);