wisski-cloud-distillery/internal/component/static/dist/control/index.dbb01556.js
2022-11-16 13:07:10 +01:00

1 line
No EOL
9 KiB
JavaScript

function t(t){return t&&t.__esModule?t.default:t}const e=t=>{const e=document.getElementsByTagName("h"+t);Array.from(e).forEach((t=>{void 0!==t.id&&""!==t.id&&t.appendChild((t=>{const e=document.createElement("a");return e.className="header-link",e.href="#"+t,e.innerHTML="#",e})(t.id))}))};new Array(6).fill(0).forEach(((t,n)=>e(n+1)));const n=document.getElementsByClassName("remote-action");Array.from(n).forEach((t=>{const e=t.getAttribute("data-action"),n=t.getAttribute("data-param"),r=function(){const e=parseInt(t.getAttribute("data-buffer")??"",10)??0;return isFinite(e)&&e>0?e:0}();t.addEventListener("click",(function(t){t.preventDefault();const i=document.createElement("div");i.className="modal-terminal",document.body.append(i);const s=document.createElement("pre"),o=function(t,e,n){let r=null;const i=[],s=()=>{o.paintedFrames++,t.innerText=i.join("\n"),e.scrollTop=e.scrollHeight,r=null},o=(t,e)=>{if(i.push(t),0!==n&&i.length>n&&i.splice(0,i.length-n),null!==r&&(o.missedFrames++,window.cancelAnimationFrame(r)),e)return s();r=window.requestAnimationFrame(s)};return o.paintedFrames=0,o.missedFrames=0,o}(s,i,r);i.append(s);const a=document.createElement("button");a.className="pure-button pure-button-success",a.append("Close"),a.addEventListener("click",(function(t){t.preventDefault(),i.parentNode?.removeChild(i)}));const u=window.onbeforeunload;window.onbeforeunload=()=>"A remote session is in progress. Are you sure you want to leave?";let c=!1;const d=function(){c||(c=!0,window.onbeforeunload=u,i.append(a))};var l,h;o("Connecting ...",!0),(l=t=>{o("Connected",!0),t.send(e),"string"==typeof n&&t.send(n)},h=t=>{o(t)},new Promise(((t,e)=>{const n=new WebSocket(location.href.replace("http","ws"));n.onclose=t,n.onerror=e,n.onmessage=t=>h(t.data),n.onopen=()=>l(n)}))).then((()=>{o("Connection closed.",!0),d()})).catch((()=>{o("Connection errored.",!0),d()}))}))}));var r={};r=function(){var t=1e3,e=6e4,n=36e5,r="millisecond",i="second",s="minute",o="hour",a="day",u="week",c="month",d="quarter",l="year",h="date",f="Invalid Date",m=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,p=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,$={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_")},y=function(t,e,n){var r=String(t);return!r||r.length>=e?t:""+Array(e+1-r.length).join(n)+t},g={s:y,z:function(t){var e=-t.utcOffset(),n=Math.abs(e),r=Math.floor(n/60),i=n%60;return(e<=0?"+":"-")+y(r,2,"0")+":"+y(i,2,"0")},m:function t(e,n){if(e.date()<n.date())return-t(n,e);var r=12*(n.year()-e.year())+(n.month()-e.month()),i=e.clone().add(r,c),s=n-i<0,o=e.clone().add(r+(s?-1:1),c);return+(-(r+(n-i)/(s?i-o:o-i))||0)},a:function(t){return t<0?Math.ceil(t)||0:Math.floor(t)},p:function(t){return{M:c,y:l,w:u,d:a,D:h,h:o,m:s,s:i,ms:r,Q:d}[t]||String(t||"").toLowerCase().replace(/s$/,"")},u:function(t){return void 0===t}},v="en",M={};M[v]=$;var w=function(t){return t instanceof O},D=function t(e,n,r){var i;if(!e)return v;if("string"==typeof e){var s=e.toLowerCase();M[s]&&(i=s),n&&(M[s]=n,i=s);var o=e.split("-");if(!i&&o.length>1)return t(o[0])}else{var a=e.name;M[a]=e,i=a}return!r&&i&&(v=i),i||!r&&v},S=function(t,e){if(w(t))return t.clone();var n="object"==typeof e?e:{};return n.date=t,n.args=arguments,new O(n)},b=g;b.l=D,b.i=w,b.w=function(t,e){return S(t,{locale:e.$L,utc:e.$u,x:e.$x,$offset:e.$offset})};var O=function(){function $(t){this.$L=D(t.locale,null,!0),this.parse(t)}var y=$.prototype;return y.parse=function(t){this.$d=function(t){var e=t.date,n=t.utc;if(null===e)return new Date(NaN);if(b.u(e))return new Date;if(e instanceof Date)return new Date(e);if("string"==typeof e&&!/Z$/i.test(e)){var r=e.match(m);if(r){var i=r[2]-1||0,s=(r[7]||"0").substring(0,3);return n?new Date(Date.UTC(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,s)):new Date(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,s)}}return new Date(e)}(t),this.$x=t.x||{},this.init()},y.init=function(){var t=this.$d;this.$y=t.getFullYear(),this.$M=t.getMonth(),this.$D=t.getDate(),this.$W=t.getDay(),this.$H=t.getHours(),this.$m=t.getMinutes(),this.$s=t.getSeconds(),this.$ms=t.getMilliseconds()},y.$utils=function(){return b},y.isValid=function(){return!(this.$d.toString()===f)},y.isSame=function(t,e){var n=S(t);return this.startOf(e)<=n&&n<=this.endOf(e)},y.isAfter=function(t,e){return S(t)<this.startOf(e)},y.isBefore=function(t,e){return this.endOf(e)<S(t)},y.$g=function(t,e,n){return b.u(t)?this[e]:this.set(n,t)},y.unix=function(){return Math.floor(this.valueOf()/1e3)},y.valueOf=function(){return this.$d.getTime()},y.startOf=function(t,e){var n=this,r=!!b.u(e)||e,d=b.p(t),f=function(t,e){var i=b.w(n.$u?Date.UTC(n.$y,e,t):new Date(n.$y,e,t),n);return r?i:i.endOf(a)},m=function(t,e){return b.w(n.toDate()[t].apply(n.toDate("s"),(r?[0,0,0,0]:[23,59,59,999]).slice(e)),n)},p=this.$W,$=this.$M,y=this.$D,g="set"+(this.$u?"UTC":"");switch(d){case l:return r?f(1,0):f(31,11);case c:return r?f(1,$):f(0,$+1);case u:var v=this.$locale().weekStart||0,M=(p<v?p+7:p)-v;return f(r?y-M:y+(6-M),$);case a:case h:return m(g+"Hours",0);case o:return m(g+"Minutes",1);case s:return m(g+"Seconds",2);case i:return m(g+"Milliseconds",3);default:return this.clone()}},y.endOf=function(t){return this.startOf(t,!1)},y.$set=function(t,e){var n,u=b.p(t),d="set"+(this.$u?"UTC":""),f=(n={},n[a]=d+"Date",n[h]=d+"Date",n[c]=d+"Month",n[l]=d+"FullYear",n[o]=d+"Hours",n[s]=d+"Minutes",n[i]=d+"Seconds",n[r]=d+"Milliseconds",n)[u],m=u===a?this.$D+(e-this.$W):e;if(u===c||u===l){var p=this.clone().set(h,1);p.$d[f](m),p.init(),this.$d=p.set(h,Math.min(this.$D,p.daysInMonth())).$d}else f&&this.$d[f](m);return this.init(),this},y.set=function(t,e){return this.clone().$set(t,e)},y.get=function(t){return this[b.p(t)]()},y.add=function(r,d){var h,f=this;r=Number(r);var m=b.p(d),p=function(t){var e=S(f);return b.w(e.date(e.date()+Math.round(t*r)),f)};if(m===c)return this.set(c,this.$M+r);if(m===l)return this.set(l,this.$y+r);if(m===a)return p(1);if(m===u)return p(7);var $=(h={},h[s]=e,h[o]=n,h[i]=t,h)[m]||1,y=this.$d.getTime()+r*$;return b.w(y,this)},y.subtract=function(t,e){return this.add(-1*t,e)},y.format=function(t){var e=this,n=this.$locale();if(!this.isValid())return n.invalidDate||f;var r=t||"YYYY-MM-DDTHH:mm:ssZ",i=b.z(this),s=this.$H,o=this.$m,a=this.$M,u=n.weekdays,c=n.months,d=function(t,n,i,s){return t&&(t[n]||t(e,r))||i[n].slice(0,s)},l=function(t){return b.s(s%12||12,t,"0")},h=n.meridiem||function(t,e,n){var r=t<12?"AM":"PM";return n?r.toLowerCase():r},m={YY:String(this.$y).slice(-2),YYYY:this.$y,M:a+1,MM:b.s(a+1,2,"0"),MMM:d(n.monthsShort,a,c,3),MMMM:d(c,a),D:this.$D,DD:b.s(this.$D,2,"0"),d:String(this.$W),dd:d(n.weekdaysMin,this.$W,u,2),ddd:d(n.weekdaysShort,this.$W,u,3),dddd:u[this.$W],H:String(s),HH:b.s(s,2,"0"),h:l(1),hh:l(2),a:h(s,o,!0),A:h(s,o,!1),m:String(o),mm:b.s(o,2,"0"),s:String(this.$s),ss:b.s(this.$s,2,"0"),SSS:b.s(this.$ms,3,"0"),Z:i};return r.replace(p,(function(t,e){return e||m[t]||i.replace(":","")}))},y.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},y.diff=function(r,h,f){var m,p=b.p(h),$=S(r),y=($.utcOffset()-this.utcOffset())*e,g=this-$,v=b.m(this,$);return v=(m={},m[l]=v/12,m[c]=v,m[d]=v/3,m[u]=(g-y)/6048e5,m[a]=(g-y)/864e5,m[o]=g/n,m[s]=g/e,m[i]=g/t,m)[p]||g,f?v:b.a(v)},y.daysInMonth=function(){return this.endOf(c).$D},y.$locale=function(){return M[this.$L]},y.locale=function(t,e){if(!t)return this.$L;var n=this.clone(),r=D(t,e,!0);return r&&(n.$L=r),n},y.clone=function(){return b.w(this.$d,this)},y.toDate=function(){return new Date(this.valueOf())},y.toJSON=function(){return this.isValid()?this.toISOString():null},y.toISOString=function(){return this.$d.toISOString()},y.toString=function(){return this.$d.toUTCString()},$}(),T=O.prototype;return S.prototype=T,[["$ms",r],["$s",i],["$m",s],["$H",o],["$W",a],["$M",c],["$y",l],["$D",h]].forEach((function(t){T[t[1]]=function(e){return this.$g(e,t[0],t[1])}})),S.extend=function(t,e){return t.$i||(t(e,O,S),t.$i=!0),S},S.locale=D,S.isDayjs=w,S.unix=function(t){return S(1e3*t)},S.en=M[v],S.Ls=M,S.p={},S}();const i={date:e=>t(r)(e.innerText).format("YYYY-MM-DD HH:mm:ss ([UTC]Z)"),path:t=>{const e=t.innerText.split("/");return e[e.length-1]},pathbuilders:()=>{const t=window.pathbuilders,e=document.createElement("span");let n=!1;if(Object.keys(t).forEach((r=>{n=!0;const i=r+".xml",o=t[r];e.append(s(i,r,o,"application/xml")),e.append(document.createTextNode(" "))})),!n)return"(none)";const r=document.createElement("small");return r.append(document.createTextNode("(click to download)")),e.append(r),e}},s=(t,e,n,r)=>{const i=new Blob([n],{type:r??"text/plain"}),s=document.createElement("a");return s.target="_blank",s.download=t,s.href=URL.createObjectURL(i),s.append(document.createTextNode(e)),s};Object.keys(i).forEach((t=>{const e=i[t];document.querySelectorAll("code."+t).forEach((t=>{const n=e(t);if("string"==typeof n)return t.innerHTML="",void t.appendChild(document.createTextNode(n));t.parentNode.replaceChild(n,t)}))}));