You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1 line
9.4 KiB

!function(e){var t={};function r(o){if(t[o])return t[o].exports;var n=t[o]={i:o,l:!1,exports:{}};return e[o].call(n.exports,n,n.exports,r),n.l=!0,n.exports}r.m=e,r.c=t,r.d=function(e,t,o){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:o})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var o=Object.create(null);if(r.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var n in e)r.d(o,n,function(t){return e[t]}.bind(null,n));return o},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=1420)}({1420:function(e,t,r){"use strict";r.r(t);var o=r(227);function n(){document.cookie="riot_mobile_redirect_to_guide=false;path=/;max-age=14400",window.location.href="../"}function i(e){e="<h2>Error loading Riot</h2><p>".concat(e,"</p><p>").concat("If this is unexpected, please contact your system administrator or technical support representative.","</p>");const t=document.getElementsByClassName("mx_HomePage_container"),r=document.getElementsByClassName("mx_HomePage_errorContainer");for(const e of t)e.innerHTML="";for(const t of r)t.style.display="block",t.innerHTML=e}!async function(){document.getElementById("back_to_riot_button").onclick=n;let e=await Object(o.a)("..");const t=e.default_server_config,r=e.default_server_name,a=e.default_hs_url,s=e.default_is_url,u=[t,r,a].filter(e=>!!e);if(u.length>1)return i("Invalid configuration: can only specify one of default_server_config, default_server_name, or default_hs_url.");if(u.length<1)return i("Invalid configuration: no default server specified.");let c="",d="";if(t&&t["m.homeserver"]&&(c=t["m.homeserver"].base_url,t["m.identity_server"]&&(d=t["m.identity_server"].base_url)),r)try{const e=await fetch("https://".concat(r,"/.well-known/matrix/client")),t=await e.json();t&&t["m.homeserver"]&&(c=t["m.homeserver"].base_url,t["m.identity_server"]&&(d=t["m.identity_server"].base_url))}catch(e){return console.error(e),i("Unable to fetch homeserver configuration")}if(a&&(c=a,d=s),!c)return i("Unable to locate homeserver");c&&!c.endsWith("/")&&(c+="/"),d&&!d.endsWith("/")&&(d+="/"),"https://matrix.org/"!==c&&(document.getElementById("configure_riot_button").href="https://riot.im/config/config?hs_url="+encodeURIComponent(c)+"&is_url="+encodeURIComponent(d),document.getElementById("step1_heading").innerHTML="1: Install the app",document.getElementById("step2_container").style.display="block",document.getElementById("hs_url").innerText=c,d&&(document.getElementById("custom_is").style.display="block",document.getElementById("is_url").style.display="block",document.getElementById("is_url").innerText=d))}()},227:function(e,t,r){"use strict";r.d(t,"a",(function(){return i}));var o=r(56),n=r.n(o);async function i(e=""){""===e||e.endsWith("/")||(e+="/");const t=a("".concat(e,"config.").concat(document.domain,".json")),r=a(e+"config.json");try{const e=await t;if(0===Object.keys(e).length)throw new Error;return e}catch(e){return await r}}function a(e){return new Promise((function(t,r){n()({method:"GET",url:e,qs:{cachebuster:Date.now()}},(e,o,n)=>{try{if(e||o.status<200||o.status>=300)return o&&(404==o.status||0==o.status&&""==n)&&t({}),void r({err:e,response:o});t(JSON.parse(n))}catch(e){r({err:e})}})}))}},56:function(e,t,r){var o,n,i;n=[],void 0===(i="function"==typeof(o=function(){var e=XMLHttpRequest;if(!e)throw new Error("missing XMLHttpRequest");function t(i,a){if("function"!=typeof a)throw new Error("Bad callback given: "+a);if(!i)throw new Error("No options given");var s=i.onResponse;if((i="string"==typeof i?{uri:i}:JSON.parse(JSON.stringify(i))).onResponse=s,i.verbose&&(t.log=function(){var e,t,r={},i=["trace","debug","info","warn","error"];for(t=0;t<i.length;t++)r[e=i[t]]=o,"undefined"!=