core-unsupported-browser.mjs 2.7 KB

12
  1. /*! third party licenses: dist/vendor.LICENSE.txt */
  2. import{F as l,X as d,bS as w,c5 as b,c7 as m,bO as f,bZ as s,aV as _}from"./core-common.mjs";import{s as c,a,b as u,c as p}from"./chunks/RedirectUnsupportedBrowsers-BjoWmJp7.mjs";import{n as h,W as v}from"./chunks/icons-TElqpmA8.mjs";import{l as B}from"./chunks/logger-7CwbMBAx.mjs";import"./chunks/index-PaKKd09k.mjs";import"./chunks/index-CiG5J8j_.mjs";B.debug("Supported browsers",{supportedBrowsers:c});const g={name:"UnsupportedBrowser",components:{Web:v,NcButton:l,NcEmptyContent:d},computed:{isMobile(){return/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)},filteredSupportedBrowsers(){return c.filter(e=>e?this.isMobile?this.isMobileBrowser(e):!this.isMobileBrowser(e):!1)},formattedBrowsersList(){const e={};return this.filteredSupportedBrowsers.forEach(r=>{const[o,t]=r.split(" ");(!e[o]||e[o]<parseFloat(t,10))&&(e[o]=parseFloat(t,10))}),Object.keys(e).map(r=>{var n,i;if(!((n=a[r])!=null&&n.browser))return null;const o=e[r],t=(i=a[r])==null?void 0:i.browser;return this.t("core","{name} version {version} and above",{name:t,version:o})}).filter(r=>r!==null)}},methods:{t:w,n:b,forceBrowsing(){u.setItem(p,!0);const e=new URLSearchParams(window.location.search);if(e.has("redirect_url")){let r=m.from(e.get("redirect_url"),"base64").toString()||"/";if(r=r.replace("index.php","").replace(f(),"").replace(/\/\//g,"/"),r.startsWith("/")){window.location=s(r);return}}window.location=s("/")},isMobileBrowser(e){return e=e.toLowerCase(),e.includes("and_")||e.includes("android")||e.includes("ios_")||e.includes("mobile")||e.includes("_mob")||e.includes("samsung")}}};var y=function(){var e=this,r=e._self._c;return r("div",{staticClass:"content-unsupported-browser guest-box"},[r("NcEmptyContent",{scopedSlots:e._u([{key:"icon",fn:function(){return[r("Web")]},proxy:!0},{key:"action",fn:function(){return[r("div",[r("h2",[e._v(" "+e._s(e.t("core","Your browser is not supported. Please upgrade to a newer version or a supported one."))+" ")]),r("NcButton",{staticClass:"content-unsupported-browser__continue",attrs:{type:"primary"},on:{click:e.forceBrowsing}},[e._v(" "+e._s(e.t("core","Continue with this unsupported browser"))+" ")])],1),r("ul",{staticClass:"content-unsupported-browser__list"},[r("h3",[e._v(e._s(e.t("core","Supported versions")))]),e._l(e.formattedBrowsersList,function(o){return r("li",{key:o},[e._v(" "+e._s(o)+" ")])})],2)]},proxy:!0}])},[e._v(" "+e._s(e.t("core","This browser is not supported"))+" ")])],1)},S=[],x=h(g,y,S,!1,null,"11a3392f");const C=x.exports;u.getItem(p)==="true"&&(window.location=s("/"));const O=new _({el:"#unsupported-browser",name:"UnsupportedBrowserRoot",render:e=>e(C)});export{O as default};