UNPKG

@tindtechnologies/universalviewer

Version:

The Universal Viewer is a community-developed open source project on a mission to help you share your 📚📜📰📽️📻🗿 with the 🌎

2 lines (1 loc) 2.04 kB
var s=function(r,i,e,a){return new(e||(e=Promise))(function(u,n){function l(t){try{o(a.next(t))}catch(f){n(f)}}function c(t){try{o(a.throw(t))}catch(f){n(f)}}function o(t){t.done?u(t.value):new e(function(f){f(t.value)}).then(l,c)}o((a=a.apply(r,i||[])).next())})},h=function(r,i){var e={label:0,sent:function(){if(n[0]&1)throw n[1];return n[1]},trys:[],ops:[]},a,u,n,l;return l={next:c(0),throw:c(1),return:c(2)},typeof Symbol=="function"&&(l[Symbol.iterator]=function(){return this}),l;function c(t){return function(f){return o([t,f])}}function o(t){if(a)throw new TypeError("Generator is already executing.");for(;e;)try{if(a=1,u&&(n=t[0]&2?u.return:t[0]?u.throw||((n=u.return)&&n.call(u),0):u.next)&&!(n=n.call(u,t[1])).done)return n;switch(u=0,n&&(t=[t[0]&2,n.value]),t[0]){case 0:case 1:n=t;break;case 4:return e.label++,{value:t[1],done:!1};case 5:e.label++,u=t[1],t=[0];continue;case 7:t=e.ops.pop(),e.trys.pop();continue;default:if(n=e.trys,!(n=n.length>0&&n[n.length-1])&&(t[0]===6||t[0]===2)){e=0;continue}if(t[0]===3&&(!n||t[1]>n[0]&&t[1]<n[3])){e.label=t[1];break}if(t[0]===6&&e.label<n[1]){e.label=n[1],n=t;break}if(n&&e.label<n[2]){e.label=n[2],e.ops.push(t);break}n[2]&&e.ops.pop(),e.trys.pop();continue}t=i.call(r,e)}catch(f){t=[6,f],u=0}finally{a=n=0}if(t[0]&5)throw t[1];return{value:t[0]?t[1]:void 0,done:!0}}},v=void 0,b=function(r,i){return i.closest(r)!==null},w=function(r){var i;return typeof r=="string"&&r.length>0?(i={"ion-color":!0},i["ion-color-"+r]=!0,i):void 0},y=function(r){if(r!==void 0){var i=Array.isArray(r)?r:r.split(" ");return i.filter(function(e){return e!=null}).map(function(e){return e.trim()}).filter(function(e){return e!==""})}return[]},_=function(r){var i={};return y(r).forEach(function(e){return i[e]=!0}),i},d=/^[a-z][a-z0-9+\-.]*:/,g=function(r,i,e){return s(v,void 0,void 0,function(){var a;return h(this,function(u){return r!=null&&r[0]!=="#"&&!d.test(r)&&(a=document.querySelector("ion-router"),a)?(i?.preventDefault(),[2,a.push(r,e)]):[2,!1]})})};export{b as a,w as b,_ as c,g as d};