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 14.7 kB
"use strict";(self.webpackChunkUV=self.webpackChunkUV||[]).push([[9023],{3494(n,t,e){e.d(t,{m:()=>d});var r=e(6653),o=function(n,t,e,r){return new(e||(e=Promise))((function(o,i){function a(n){try{c(r.next(n))}catch(n){i(n)}}function u(n){try{c(r.throw(n))}catch(n){i(n)}}function c(n){n.done?o(n.value):new e((function(t){t(n.value)})).then(a,u)}c((r=r.apply(n,t||[])).next())}))},i=function(n,t){var e,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(e)throw new TypeError("Generator is already executing.");for(;a;)try{if(e=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(n,a)}catch(n){i=[6,n],r=0}finally{e=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}},a=void 0,u=function(){return(0,r.c)().easing("cubic-bezier(0.0, 0.0, 0.2, 1)").duration(300)},c=function(n){var t,e,o=n.width+8,i=(0,r.c)(),a=(0,r.c)();return n.isEndSide?(t=o+"px",e="0px"):(t=-o+"px",e="0px"),i.addElement(n.menuInnerEl).fromTo("transform","translateX("+t+")","translateX("+e+")"),a.addElement(n.backdropEl).fromTo("opacity",.01,.32),u().addAnimation([i,a])},s=function(n){var t,e,o=n.width;n.isEndSide?(t=-o+"px",e=o+"px"):(t=o+"px",e=-o+"px");var i=(0,r.c)().addElement(n.menuInnerEl).fromTo("transform","translateX("+e+")","translateX(0px)"),a=(0,r.c)().addElement(n.contentEl).fromTo("transform","translateX(0px)","translateX("+t+")"),c=(0,r.c)().addElement(n.backdropEl).fromTo("opacity",.01,.32);return u().addAnimation([i,c,a])},l=function(n){var t=n.width*(n.isEndSide?-1:1)+"px",e=(0,r.c)().addElement(n.contentEl).fromTo("transform","translateX(0px)","translateX("+t+")");return u().addAnimation(e)},d=function(){var n=new Map,t=[],e=function(n){return o(a,void 0,void 0,(function(){var e,r;return i(this,(function(o){switch(o.label){case 0:return[4,b()];case 1:return o.sent(),"start"===n||"end"===n?(e=h((function(t){return t.side===n&&!t.disabled})))?[2,e]:[2,h((function(t){return t.side===n}))]:null!=n?[2,h((function(t){return t.menuId===n}))]:(r=h((function(n){return!n.disabled})))?[2,r]:[2,t.length>0?t[0].el:void 0]}}))}))},r=function(){return o(a,void 0,void 0,(function(){return i(this,(function(n){switch(n.label){case 0:return[4,b()];case 1:return n.sent(),[2,f()]}}))}))},u=function(t,e){n.set(t,e)},d=function(n){var e=n.side;t.filter((function(t){return t.side===e&&t!==n})).forEach((function(n){return n.disabled=!0}))},f=function(){return h((function(n){return n._isOpen}))},p=function(){return t.some((function(n){return n.isAnimating}))},h=function(n){var e=t.find(n);if(void 0!==e)return e.el},b=function(){return Promise.all(Array.from(document.querySelectorAll("ion-menu")).map((function(n){return n.componentOnReady()})))};return u("reveal",l),u("push",s),u("overlay",c),{registerAnimation:u,get:e,getMenus:function(){return o(a,void 0,void 0,(function(){return i(this,(function(n){switch(n.label){case 0:return[4,b()];case 1:return n.sent(),[2,t.map((function(n){return n.el}))]}}))}))},getOpen:r,isEnabled:function(n){return o(a,void 0,void 0,(function(){var t;return i(this,(function(r){switch(r.label){case 0:return[4,e(n)];case 1:return(t=r.sent())?[2,!t.disabled]:[2,!1]}}))}))},swipeGesture:function(n,t){return o(a,void 0,void 0,(function(){var r;return i(this,(function(o){switch(o.label){case 0:return[4,e(t)];case 1:return(r=o.sent())&&(r.swipeGesture=n),[2,r]}}))}))},isAnimating:function(){return o(a,void 0,void 0,(function(){return i(this,(function(n){switch(n.label){case 0:return[4,b()];case 1:return n.sent(),[2,p()]}}))}))},isOpen:function(n){return o(a,void 0,void 0,(function(){var t;return i(this,(function(o){switch(o.label){case 0:return null==n?[3,2]:[4,e(n)];case 1:return[2,void 0!==(t=o.sent())&&t.isOpen()];case 2:return[4,r()];case 3:return[2,void 0!==(t=o.sent())]}}))}))},enable:function(n,t){return o(a,void 0,void 0,(function(){var r;return i(this,(function(o){switch(o.label){case 0:return[4,e(t)];case 1:return(r=o.sent())&&(r.disabled=!n),[2,r]}}))}))},toggle:function(n){return o(a,void 0,void 0,(function(){var t;return i(this,(function(r){switch(r.label){case 0:return[4,e(n)];case 1:return(t=r.sent())?[2,t.toggle()]:[2,!1]}}))}))},close:function(n){return o(a,void 0,void 0,(function(){var t;return i(this,(function(o){switch(o.label){case 0:return[4,void 0!==n?e(n):r()];case 1:return void 0!==(t=o.sent())?[2,t.close()]:[2,!1]}}))}))},open:function(n){return o(a,void 0,void 0,(function(){var t;return i(this,(function(r){switch(r.label){case 0:return[4,e(n)];case 1:return(t=r.sent())?[2,t.open()]:[2,!1]}}))}))},_getOpenSync:f,_createAnimation:function(t,e){var r=n.get(t);if(!r)throw new Error("animation not registered");return r(e)},_register:function(n){t.indexOf(n)<0&&(n.disabled||d(n),t.push(n))},_unregister:function(n){var e=t.indexOf(n);e>-1&&t.splice(e,1)},_setOpen:function(n,t,e){return o(a,void 0,void 0,(function(){var o;return i(this,(function(i){switch(i.label){case 0:return p()?[2,!1]:t?[4,r()]:[3,3];case 1:return(o=i.sent())&&n.el!==o?[4,o.setOpen(!1,!1)]:[3,3];case 2:i.sent(),i.label=3;case 3:return[2,n._setOpen(t,e)]}}))}))},_setActiveMenu:d}}()},9023(n,t,e){e.r(t),e.d(t,{ion_menu_button:()=>s});var r=e(5873),o=e(636),i=e(3494),a=e(8579),u=function(n,t,e,r){return new(e||(e=Promise))((function(o,i){function a(n){try{c(r.next(n))}catch(n){i(n)}}function u(n){try{c(r.throw(n))}catch(n){i(n)}}function c(n){n.done?o(n.value):new e((function(t){t(n.value)})).then(a,u)}c((r=r.apply(n,t||[])).next())}))},c=function(n,t){var e,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(e)throw new TypeError("Generator is already executing.");for(;a;)try{if(e=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(n,a)}catch(n){i=[6,n],r=0}finally{e=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}},s=function(){function n(n){var t=this;(0,r.r)(this,n),this.visible=!1,this.disabled=!1,this.autoHide=!0,this.type="button",this.onClick=function(){return u(t,void 0,void 0,(function(){return c(this,(function(n){return[2,i.m.toggle(this.menu)]}))}))}}return n.prototype.componentDidLoad=function(){this.visibilityChanged()},n.prototype.visibilityChanged=function(){return u(this,void 0,void 0,(function(){var n;return c(this,(function(t){switch(t.label){case 0:return n=this,[4,(0,a.u)(this.menu)];case 1:return n.visible=t.sent(),[2]}}))}))},n.prototype.render=function(){var n,t=this.color,e=this.disabled,i=(0,r.f)(this),a=r.i.get("menuIcon","menu"),u=this.autoHide&&!this.visible,c={type:this.type};return(0,r.h)(r.H,{onClick:this.onClick,"aria-disabled":e?"true":null,"aria-hidden":u?"true":null,class:Object.assign(Object.assign((n={},n[i]=!0,n),(0,o.c)(t)),{button:!0,"menu-button-hidden":u,"menu-button-disabled":e,"ion-activatable":!0,"ion-focusable":!0})},(0,r.h)("button",Object.assign({},c,{disabled:e,class:"button-native"}),(0,r.h)("slot",null,(0,r.h)("ion-icon",{icon:a,mode:i,lazy:!1})),"md"===i&&(0,r.h)("ion-ripple-effect",{type:"unbounded"})))},Object.defineProperty(n,"style",{get:function(){return":host{--background:transparent;--color-focused:var(--color);--border-radius:initial;--padding-top:0;--padding-bottom:0;color:var(--color);text-align:center;text-decoration:none;text-overflow:ellipsis;text-transform:none;white-space:nowrap;-webkit-font-kerning:none;font-kerning:none}.button-native{border-radius:var(--border-radius);font-family:inherit;font-size:inherit;font-style:inherit;font-weight:inherit;letter-spacing:inherit;text-decoration:inherit;text-overflow:inherit;text-transform:inherit;text-align:inherit;white-space:inherit;color:inherit;margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;padding-left:var(--padding-start);padding-right:var(--padding-end);padding-top:var(--padding-top);padding-bottom:var(--padding-bottom);-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;display:-ms-flexbox;display:flex;position:relative;-ms-flex-flow:row nowrap;flex-flow:row nowrap;-ms-flex-negative:0;flex-shrink:0;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;width:100%;height:100%;border:0;outline:none;background:var(--background);line-height:1;cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;z-index:0;-webkit-appearance:none;-moz-appearance:none;appearance:none}@supports ((-webkit-margin-start:0) or (margin-inline-start:0)) or (-webkit-margin-start:0){.button-native{padding-left:unset;padding-right:unset;-webkit-padding-start:var(--padding-start);padding-inline-start:var(--padding-start);-webkit-padding-end:var(--padding-end);padding-inline-end:var(--padding-end)}}ion-icon{margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;padding-left:0;padding-right:0;padding-top:0;padding-bottom:0;pointer-events:none}:host(.menu-button-hidden){display:none}:host(.menu-button-disabled){cursor:default;opacity:.5;pointer-events:none}@media (any-hover:hover){:host(:hover) .button-native{background:var(--background-hover);color:var(--color-hover)}}:host(.ion-focused) .button-native{background:var(--background-focused);color:var(--color-focused)}:host(.ion-color) .button-native{color:var(--ion-color-base)}:host-context(ion-toolbar:not(.ion-color)){color:var(--ion-toolbar-color,var(--color))}:host{--background-focused:rgba(var(--ion-color-primary-rgb,56,128,255),0.1);--border-radius:4px;--color:var(--ion-color-primary,#3880ff);--padding-start:5px;--padding-end:5px;height:32px;font-size:31px}:host(.activated){opacity:.4}@media (any-hover:hover){:host(:hover){opacity:.6}}:host(.ion-color.ion-focused) .button-native{background:rgba(var(--ion-color-base-rgb),.1)}"},enumerable:!0,configurable:!0}),n}()},8579(n,t,e){e.d(t,{u:()=>o});var r=e(3494),o=function(n){return t=void 0,e=void 0,i=function(){var t,e;return function(n,t){var e,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(e)throw new TypeError("Generator is already executing.");for(;a;)try{if(e=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(n,a)}catch(n){i=[6,n],r=0}finally{e=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}}(this,(function(o){switch(o.label){case 0:return[4,r.m.get(n)];case 1:return t=o.sent(),(e=t)?[4,t.isActive()]:[3,3];case 2:e=o.sent(),o.label=3;case 3:return[2,!!e]}}))},new((o=void 0)||(o=Promise))((function(n,r){function a(n){try{c(i.next(n))}catch(n){r(n)}}function u(n){try{c(i.throw(n))}catch(n){r(n)}}function c(t){t.done?n(t.value):new o((function(n){n(t.value)})).then(a,u)}c((i=i.apply(t,e||[])).next())}));var t,e,o,i}},636(n,t,e){e.d(t,{c:()=>o,g:()=>i,h:()=>r,o:()=>u});var r=function(n,t){return null!==t.closest(n)},o=function(n){var t;return"string"==typeof n&&n.length>0?((t={"ion-color":!0})["ion-color-"+n]=!0,t):void 0},i=function(n){var t={};return function(n){return void 0!==n?(Array.isArray(n)?n:n.split(" ")).filter((function(n){return null!=n})).map((function(n){return n.trim()})).filter((function(n){return""!==n})):[]}(n).forEach((function(n){return t[n]=!0})),t},a=/^[a-z][a-z0-9+\-.]*:/,u=function(n,t,e){return r=void 0,o=void 0,u=function(){var r;return function(n,t){var e,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(e)throw new TypeError("Generator is already executing.");for(;a;)try{if(e=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(n,a)}catch(n){i=[6,n],r=0}finally{e=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}}(this,(function(o){return null!=n&&"#"!==n[0]&&!a.test(n)&&(r=document.querySelector("ion-router"))?(null!=t&&t.preventDefault(),[2,r.push(n,e)]):[2,!1]}))},new((i=void 0)||(i=Promise))((function(n,t){function e(n){try{c(u.next(n))}catch(n){t(n)}}function a(n){try{c(u.throw(n))}catch(n){t(n)}}function c(t){t.done?n(t.value):new i((function(n){n(t.value)})).then(e,a)}c((u=u.apply(r,o||[])).next())}));var r,o,i,u}}}]);