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
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=24)}({14:function(e,t,r){"use strict";r.d(t,"a",(function(){return i}));var o=r(8),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})}})}))}},24:function(e,t,r){"use strict";r.r(t);var o=r(14);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))}()},8: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"!=typeof console&&console&&console[e]&&(r[e]=n(console,e));return r}()),i.url&&(i.uri=i.url,delete i.url),!i.uri&&""!==i.uri)throw new Error("options.uri is a required argument");if("string"!=typeof i.uri)throw new Error("options.uri must be a string");for(var u=["proxy","_redirectsFollowed","maxRedirects","followRedirect"],c=0;c<u.length;c++)if(i[u[c]])throw new Error("options."+u[c]+" is not supported");if(i.callback=a,i.method=i.method||"GET",i.headers=i.headers||{},i.body=i.body||null,i.timeout=i.timeout||t.DEFAULT_TIMEOUT,i.headers.host)throw new Error("Options.headers.host is not supported");i.json&&(i.headers.accept=i.headers.accept||"application/json","GET"!==i.method&&(i.headers["content-type"]="application/json"),"boolean"!=typeof i.json?i.body=JSON.stringify(i.json):"string"!=typeof i.body&&(i.body=JSON.stringify(i.body)));var d=function(e){var t=[];for(var r in e)e.hasOwnProperty(r)&&t.push(encodeURIComponent(r)+"="+encodeURIComponent(e[r]));return t.join("&")};if(i.qs){var l="string"==typeof i.qs?i.qs:d(i.qs);-1!==i.uri.indexOf("?")?i.uri=i.uri+"&"+l:i.uri=i.uri+"?"+l}if(i.form){if("string"==typeof i.form)throw"form name unsupported";if("POST"===i.method){var f=(i.encoding||"application/x-www-form-urlencoded").toLowerCase();switch(i.headers["content-type"]=f,f){case"application/x-www-form-urlencoded":i.body=d(i.form).replace(/%20/g,"+");break;case"multipart/form-data":var p=function(e){var t={};t.boundry="-------------------------------"+Math.floor(1e9*Math.random());var r=[];for(var o in e)e.hasOwnProperty(o)&&r.push("--"+t.boundry+'\nContent-Disposition: form-data; name="'+o+'"\n\n'+e[o]+"\n");return r.push("--"+t.boundry+"--"),t.body=r.join(""),t.length=t.body.length,t.type="multipart/form-data; boundary="+t.boundry,t}(i.form);i.body=p.body,i.headers["content-type"]=p.type;break;default:throw new Error("unsupported encoding:"+f)}}}return i.onResponse=i.onResponse||o,!0===i.onResponse&&(i.onResponse=a,i.callback=o),!i.headers.authorization&&i.auth&&(i.headers.authorization="Basic "+function(e){var t,r,o,n,i,a,s,u,c="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",d=0,l=0,f="",p=[];if(!e)return e;do{t=e.charCodeAt(d++),r=e.charCodeAt(d++),o=e.charCodeAt(d++),n=(u=t<<16|r<<8|o)>>18&63,i=u>>12&63,a=u>>6&63,s=63&u,p[l++]=c.charAt(n)+c.charAt(i)+c.charAt(a)+c.charAt(s)}while(d<e.length);switch(f=p.join(""),e.length%3){case 1:f=f.slice(0,-2)+"==";break;case 2:f=f.slice(0,-1)+"="}return f}(i.auth.username+":"+i.auth.password)),function(o){var n=new e,i=!1,a=function(e){var t,r=/^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+))?)?/;try{t=location.href}catch(e){(t=document.createElement("a")).href="",t=t.href}var o=r.exec(t.toLowerCase())||[],n=r.exec(e.toLowerCase());return!(!n||n[1]==o[1]&&n[2]==o[2]&&(n[3]||("http:"===n[1]?80:443))==(o[3]||("http:"===o[1]?80:443)))}(o.uri),s="withCredentials"in n;if(r+=1,n.seq_id=r,n.id=r+": "+o.method+" "+o.uri,n._id=n.id,a&&!s){var u=new Error("Browser does not support cross-origin request: "+o.uri);return u.cors="unsupported",o.callback(u,n)}n.timeoutTimer=setTimeout((function(){i=!0;var e=new Error("ETIMEDOUT");return e.code="ETIMEDOUT",e.duration=o.timeout,t.log.error("Timeout",{id:n._id,milliseconds:o.timeout}),o.callback(e,n)}),o.timeout);var c={response:!1,loading:!1,end:!1};return n.onreadystatechange=function(r){if(i)return t.log.debug("Ignoring timed out state change",{state:n.readyState,id:n.id});if(t.log.debug("State change",{state:n.readyState,id:n.id,timed_out:i}),n.readyState===e.OPENED)for(var a in t.log.debug("Request started",{id:n.id}),o.headers)n.setRequestHeader(a,o.headers[a]);else n.readyState===e.HEADERS_RECEIVED?d():n.readyState===e.LOADING?(d(),l()):n.readyState===e.DONE&&(d(),l(),function(){if(c.end)return;if(c.end=!0,t.log.debug("Request done",{id:n.id}),n.body=n.responseText,o.json)try{n.body=JSON.parse(n.responseText)}catch(e){return o.callback(e,n)}o.callback(null,n,n.body)}())},n.open(o.method,o.uri,!0),a&&(n.withCredentials=!!o.withCredentials),n.send(o.body),n;function d(){if(!c.response){if(c.response=!0,t.log.debug("Got response",{id:n.id,status:n.status}),clearTimeout(n.timeoutTimer),n.statusCode=n.status,a&&0==n.statusCode){var e=new Error("CORS request rejected: "+o.uri);return e.cors="rejected",c.loading=!0,c.end=!0,o.callback(e,n)}o.onResponse(null,n)}}function l(){c.loading||(c.loading=!0,t.log.debug("Response body loading",{id:n.id}))}}(i)}t.log={trace:o,debug:o,info:o,warn:o,error:o};var r=0;function o(){}function n(e,t){return function(r,o){return"object"==typeof o&&(r+=" "+JSON.stringify(o)),e[t].call(e,r)}}return t.withCredentials=!1,t.DEFAULT_TIMEOUT=18e4,t.defaults=function(e,r){var o=function(t){return function(r,o){for(var n in r="string"==typeof r?{uri:r}:JSON.parse(JSON.stringify(r)),e)void 0===r[n]&&(r[n]=e[n]);return t(r,o)}},n=o(t);return n.get=o(t.get),n.post=o(t.post),n.put=o(t.put),n.head=o(t.head),n},["get","put","post","head"].forEach((function(e){var r=e.toUpperCase();t[e.toLowerCase()]=function(e){"string"==typeof e?e={method:r,uri:e}:(e=JSON.parse(JSON.stringify(e))).method=r;var o=[e].concat(Array.prototype.slice.apply(arguments,[1]));return t.apply(this,o)}})),t.couch=function(e,r){return"string"==typeof e&&(e={uri:e}),e.json=!0,e.body&&(e.json=e.body),delete e.body,r=r||o,t(e,(function(e,t,o){if(e)return r(e,t,o);if((t.statusCode<200||t.statusCode>299)&&o.error){for(var n in e=new Error("CouchDB error: "+(o.error.reason||o.error.error)),o)e[n]=o[n];return r(e,t,o)}return r(e,t,o)}))},t})?o.apply(t,n):o)||(e.exports=i)}}); |