UNPKG

dodex-vertx

Version:

A java asynchronous server for Dodex and Dodex-mess

6 lines 2.96 MB
(()=>{var Mo=Object.create;var is=Object.defineProperty;var Io=Object.getOwnPropertyDescriptor;var Ao=Object.getOwnPropertyNames;var wo=Object.getPrototypeOf,xo=Object.prototype.hasOwnProperty;var v0=(i,e)=>()=>(e||i((e={exports:{}}).exports,e),e.exports);var Lo=(i,e,n,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let t of Ao(e))!xo.call(i,t)&&t!==n&&is(i,t,{get:()=>e[t],enumerable:!(s=Io(e,t))||s.enumerable});return i};var z0=(i,e,n)=>(n=i!=null?Mo(wo(i)):{},Lo(e||!i||!i.__esModule?is(n,"default",{value:i,enumerable:!0}):n,i));var ss=v0((Wn,Bn)=>{(function(i,e){typeof Wn=="object"&&typeof Bn<"u"?Bn.exports=e():typeof define=="function"&&define.amd?define(e):(i=typeof globalThis<"u"?globalThis:i||self).dodexBundle=e()})(Wn,(function(){"use strict";let i=null,e=null,n=0,s="",t=null,u=document.querySelector(".dodex--open"),b=null,d=null,M=null,k=!1,R=0,D=null,P=0,T=null,A=0,w=0,$=!1,L=null,x=null,p=0,c=0,f=z=>{w=z-1,R=w,T.rollBack(d[w],w)},l=function(z){let S=document.body,E=document.documentElement;z.ctrlKey&&T.mess!==null?T.mess&&T.mess.popup(M,T,d):T.private!=="none"&&T.input!==null&&(document.querySelector("#dodexInput")!==null&&document.querySelector("#dodexInput").style&&document.querySelector("#dodexInput").style.opacity==="1"?(document.querySelector("#dodexInput").style.opacity="0",setTimeout((()=>{document.querySelector("#dodexInput").style.display="none"}),500),S.scrollTop=0,E.scrollTop=0):T.input&&(T.input(M,T,d),setTimeout((()=>{document.querySelector("#dodexInput").style.opacity="1"}),500),document.querySelector("#dodexInput").style.display="block"))},a=z=>{n=z.clientY,k=!0},h=()=>{A=0,k=!1},g=()=>{A=0,k=!1},C=z=>{k&&A>0&&A%8==0||(k&&d[w]!==void 0&&(w<D&&n<z.clientY?(w==26&&(w=27,R=w),T.rollAhead(d[w],w),w=n<z.clientY&&w<D-1?w+=1:w,A+=1):(w==26&&(w=25,R=w),w>-1&&(d[w].removeAttribute("style"),d[w].style.setProperty("top",i*w*-1+"px"),T.removeClass(d[w].querySelector(".face"),"remove-tab"),w=w>0?w-=1:0,A+=1,R=w,P=A))),n=z.clientY)},r=(z=>{switch(!0){case z.indexOf("edge")>-1:return"edge";case(z.indexOf("opr")>-1&&!!window.opr):return"opera";case(z.indexOf("chrome")>-1&&!!window.chrome):return"chrome";case z.indexOf("trident")>-1:return"ie";case z.indexOf("firefox")>-1:case typeof InstallTrigger<"u":return"firefox";case z.indexOf("safari")>-1:return"safari";case z.indexOf("YaBrowser")>-1:return"YaBrowser";default:return"other"}})(window.navigator.userAgent.toLowerCase()),o={init(z){return T=m,M=this,u||(u=document.querySelector(".dodex--open")),u.onmousedown=S=>{this.openDodex(S)},new Promise((S=>{T.setSize(z),T.setPosition(z),T.setPrivate(z),T.setComm(z),this.addContent(S)})).then((S=>{let E=document.querySelector(".top--dodex");return E&&E.style.setProperty("display","none"),S})).catch((S=>{throw`The widget doDex did not load correctly: ${S}`}))},addContent(z){s.match(/js$/i)?T.loadJs(s,z):s.match(/json$/i)?T.loadJson(s,z):m.addElements({},z)},setContentFile(z){s=z},addCard(z){if(D>52)return;var S;p===0&&z!==void 0&&z.cards&&(p=Object.keys?(S=z.cards,Object.keys(S).length):(function(W){var U=0;for(var _ in W)W.hasOwnProperty(_)&&++U;return U})(z.cards)),c+=1;let E=d.length+1,B=T.addBaseCard(E,t);if(T.addCardFrontFace(E,z,B),T.addCardBackFace(E,z,B),c===p&&r==="firefox"){let W=d.length;for(let U=0;U<W;U++)T.rollAhead(d[U],U);setTimeout((()=>{for(let U=W-1;U>=0;U--)f(U+1)}))}D+=1},openDodex(){let z=document.querySelector(".top--dodex");$?(z.classList.add("minus-thousand"),T.removeClass(z,"plus-thousand"),z.style.setProperty("top",T.getTop(i)),setTimeout((()=>{z.style.setProperty("display","none")}),500),L&&z.style.setProperty("left",L),$=!1):(z.style.setProperty("display","block"),T.removeClass(z,"minus-thousand"),z.classList.add("plus-thousand"),z.style.setProperty("top",T.getTop(i)),L&&z.style.setProperty("left",L),$=!0)}},m={setSize(z){typeof z=="object"&&typeof z.width=="number"&&typeof z.height=="number"&&(i=z.height,e=z.width)},setPosition(z){typeof z=="object"&&typeof z.left=="string"&&typeof z.top=="string"&&z.left.includes("%")&&z.top.includes("px")&&(z.left!=="50%"||z.top!=="100px")&&(L=z.left,x=z.top)},setPrivate(z){this.private="none",this.replace=!1,this.input=null,typeof z=="object"&&(this.private=z.private||this.private,this.replace=z.replace||this.replace,this.input=z.input||this.input,typeof this.private=="string"&&typeof this.replace=="boolean"&&typeof this.input=="function"||this.input&&console.warn("Initialization parameters may be incorrect"))},setComm(z){this.handle="ace",this.server="localhost:3087",this.mess=null,typeof z=="object"&&(this.server=z.server||this.server,this.mess=z.mess||this.mess,typeof this.server=="string"&&typeof this.mess=="object"||this.mess&&console.warn("Initialization parameters may be incorrect"))},rollAhead(z,S){(S=S!==void 0?S:w)!==26&&((z.getAttribute("style")===null||z.getAttribute("style").indexOf("rotateX")<0)&&z.setAttribute("style",`opacity:1;transform: rotateX(-190deg); z-index:${S};/*top:${i*S*-1}px; transition: transform 1s cubic-bezier(.47,.03,.47,1);*/`),z.style.setProperty("top",i*S*-1+"px")),R=S,P=S+1},rollBack(z,S){S!=26&&(z.removeAttribute("style"),z.style.setProperty("top",i*S*-1+"px"))},removeClass(z,S,E){E!==void 0&&(z=document.querySelector(E));let B=new RegExp(`(?:^|\\s)${S}(?!\\S)`,"g");z.className=z.className.replace(B,"")},setDials(z){let S=e-70,E=i+175,B=i+75;t.setAttribute("style",`width:${e}px; height: ${i}px;`),z[0].setAttribute("style",`transform: translate(${S}px, ${E}px) rotate(90deg)`),z[1].setAttribute("style",`transform: translate(-100px, ${B}px) rotate(-90deg)`),z.forEach((W=>{W.onmousedown=a,W.onmouseup=h,W.onmouseout=g,W.onmousemove=C,W.ondblclick=l}))},currentClickedElement(z){let S=z&&z.target?z.target:null,E;if(S===null)return null;S.className.split(" ").forEach((B=>{let W=B.indexOf("front")>-1?"front":B;switch(W=B.indexOf("back")>-1?"back":W,W){case"front":{let U=B.substring(5,B.length);if(isNaN(U))return;U=Number(U);let _=d[U-1].getAttribute("style"),Z=U;if(_&&_.indexOf("z-index")>-1){for(let O=P;O>=Z;O--)f(O);return}if(r==="firefox"&&_&&_.indexOf("z-index")>-1)return;for(let O=R;O<U-1;O++)T.rollAhead(d[O],O);P=U,(O=>{w=O-1,R=w,T.rollAhead(d[w])})(U)}break;case"back":if(E=B.substring(4,B.length),isNaN(E))break;E!=27&&f(E)}}))},getStyleValue(z,S,E){let B=null;B=typeof z=="string"?document.querySelector(z):z;let W=window.getComputedStyle(B);if(E){let U=W.getPropertyValue(S).replace(/[^\d]/g,"");try{if(isNaN(U))throw{message:"Style is not a Number"}}catch(_){console.error(_.message,U)}return Number(isNaN(U)?0:U)}return W},addElements(z,S){let E=document.querySelector("body"),B=document.createElement("div");this.createAttribute(B,"class","top--dodex"),E.appendChild(B),E=B,B=document.createElement("div"),this.createAttribute(B,"class","dodex"),E.appendChild(B),t=B,t.onmousedown=W=>{this.currentClickedElement(W,this)},i||e||(i=this.getStyleValue(t,"height",!0),e=this.getStyleValue(t,"width",!0)),t.style.setProperty("--cardwidth",e+"px"),t.style.setProperty("--cardheight",i+"px"),B=document.createElement("div"),this.createAttribute(B,"class","dial"),t.appendChild(B),B=document.createElement("div"),this.createAttribute(B,"class","dial"),t.appendChild(B),b=document.querySelectorAll(".dial"),this.setDials(b);for(let W=1;W<=27;W++){let U=T.addBaseCard(W,t);T.addCardFrontFace(W,z,U),T.addCardBackFace(W,z,U)}if(d=Array.prototype.slice.call(t.querySelectorAll(".card")),D=d!==void 0?d.length:0,r==="firefox"){let W=d.length;for(let U=0;U<W;U++)T.rollAhead(d[U],U);setTimeout((()=>{for(let U=W-1;U>=0;U--)f(U+1);d[26].classList.add("rotate-195"),d[26].style.setProperty("top",26*i*-1+"px")}))}else d[26].classList.add("rotate-195"),d[26].style.setProperty("top",26*i*-1+"px"),z.cards&&z.cards[27]&&B.insertAdjacentHTML("beforeend",z.cards.card27.back.content);v(M,d).then((function(){T.linkClickHandler(),d[26].ondblclick=l;let W=document.querySelector("body");r==="firefox"&&W.classList.add("dodex-body")})),S()},linkClickHandler(){document.querySelector(".dodex").querySelectorAll("a").forEach((z=>{z.onclick=S=>{M.openDodex(S)}}))},addBaseCard(z,S){let E=document.createElement("div");this.createAttribute(E,"class",`card card${z} speed`),S.appendChild(E);let B=document.querySelector(`.card.card${z}`);return E.style.setProperty("top",i*(z-1)*-1+"px"),B},addCardFrontFace(z,S,E){let B=document.createElement("div"),W=`front${z}`;this.createAttribute(B,"class",`${W} face shadow1 shaft`),E.appendChild(B);let U=`card${z}`;if(S.cards&&S.cards[U]){let _=I(S.cards[U].front.content);B.insertAdjacentHTML("beforeend",_),S.cards[U].front.content&&B.classList.add("green-tab");let Z=S.cards[U].tab;Z?(Z=Z.length>3?Z.substring(0,3):Z,B.style.setProperty("--tab",`"${Z}"`)):B.style.setProperty("--tab",`"${z}"`)}else B.style.setProperty("--tab",`"${z}"`);return U},addCardBackFace(z,S,E){let B=String.fromCharCode(z+64);z>26&&(B="");let W=`card${z}`,U=document.createElement("div");if(this.createAttribute(U,"class",`back${z} face shadow2`),E.appendChild(U),this.addContent(U,B),S.cards&&S.cards[W]){var _=I(S.cards[W].back.content);U.insertAdjacentHTML("beforeend",_)}d&&d.push(E)},createAttribute(z,S,E){let B=document.createAttribute(S);B.value=E,z.setAttributeNode(B)},addContent(z,S){let E=document.createTextNode(S);z.appendChild(E)},getTop:z=>x||(z<220?100:z<300?150:z<500?300:z<700?500:600)+"px",loadJson(z,S){let E=new XMLHttpRequest;E.onreadystatechange=function(){if(this.status===404)throw`JSON file not found:${z}`;if(this.readyState===4&&this.status===200&&this.response)try{m.addElements(JSON.parse(this.response),S)}catch(B){console.error("Possible file not found: ",B),m.addElements({},S)}},E.open("GET",z),E.send()},loadJs(z,S){new Promise((E=>{let B=document.createElement("script");B.type="text/javascript",B.src=z,B.onload=()=>{typeof dodexContent<"u"?m.addElements(dodexContent,S):m.addElements({},S),E()},B.onerror=()=>{m.addElements({},S),E()},document.head.appendChild(B)}))}};window.doDex=o;let v=function(z,S){return new Promise((function(E){indexedDB.open("dodex",2).onsuccess=function(B){let W=B.target.result,U;try{U=W.transaction("cards","readonly")}catch{return W.close(),indexedDB.deleteDatabase("dodex"),void E()}var _=U.objectStore("cards").getAll();_.onsuccess=function(){let Z=_.result.sort((function(O,y){return Number(O.idx.replace("card",""))>Number(y.idx.replace("card",""))?1:-1}));for(let O in Z){let y=Number(Z[O].idx.replace("card",""));(function(F,j){let G={cards:{}};G.cards=F,F.type==="append"&&j<S.length||j<=27||j<S.length?(F.type==="replace"&&(document.querySelector(".front"+j).innerHTML="",document.querySelector(".back"+j).innerHTML=""),(function(X,e1,o1,c1){let r1=c1[o1-1].querySelector(".front"+o1),m1=c1[o1-1].querySelector(".back"+o1),v1;X.cards&&X.cards[e1]&&(X.cards[e1].front&&X.cards[e1].front.content&&X.cards[e1].front.content.length>0&&(v1=I(X.cards[e1].front.content),r1.insertAdjacentHTML("beforeend",v1),r1.classList.add("green-tab")),X.cards[e1].back&&X.cards[e1].back.content&&X.cards[e1].back.content.length>0&&(v1=I(X.cards[e1].back.content),m1.insertAdjacentHTML("beforeend",v1)))})(G,F.idx,j,S)):z.addCard(G)})(Z[O],y)}W.close(),E()}}}))};function I(z){let S="",E={};if(z!=null||z!=""){let B=JSON.stringify(z);B.trimLeft().substring(0,1)==="["&&(E=JSON.parse(B))}if(E.constructor===Array)for(let B in E)S+=E[B]+" ";return S===""?z:S}return o}))});var os=v0((Hn,Vn)=>{(function(i,e){typeof Hn=="object"&&typeof Vn<"u"?Vn.exports=e():typeof define=="function"&&define.amd?define(e):(i=typeof globalThis<"u"?globalThis:i||self).inputBundle=e()})(Hn,(function(){"use strict";let i,e,n,s,t=function(P){var T=P.transaction("cards","readonly").objectStore("cards").getAll();T.onsuccess=function(){let A=T.result.sort((function(w,$){return Number(w.idx.replace("card",""))>Number($.idx.replace("card",""))?1:-1}));for(let w=0;w<A.length;w++){let $=Number(A[w].idx.replace("card",""));(function(L,x){let p={cards:{}};p.cards=L,L.type==="append"&&x<s.length||x<=27||x<s.length?(L.type==="replace"&&(document.querySelector(".front"+x).innerHTML="",document.querySelector(".back"+x).innerHTML=""),k(p,L.idx,x,s)):e.addCard(p)})(A[w],$)}n.linkClickHandler(),P.close()}};function u(P,T,A){function w($,L){let x,p=document.querySelectorAll("[name=type]"),c=(L!==void 0?L:$.target.files)[0],f=c.type.match("javascript$"),l=c.type.match("json$"),a=new FileReader;for(var h in p)if(p[h].checked){x=p[h].value;break}l||f?(a.onload=g=>{let C,r=g.target.result;if(f&&r.match(`^[ | | ]*return.*{`)?C=new Function('"use strict"; '+r)():l&&(C=JSON.parse(r)),C===void 0)throw"Content is not a valid Object";x==="edit"?(C=(function(o){let m=document.getElementById("jsoneditor"),v={};m&&(m.style["z-index"]=-1,v={name:"dodex",mode:"code",modes:["code","form","text","view","preview","tree"],onError:function(z){alert(z.toString())},onModeChange:function(z){let S=document.querySelector("table.jsoneditor-tree");S?S.style.backgroundColor="#fcfee6":z==="preview"&&(document.querySelector("pre.jsoneditor-preview").style.backgroundColor="#fcfee6")}});let I=null;window.JSONEditor&&(window.jsonEditor||(I=new window.JSONEditor(m,v),window.jsonEditor=I),window.jsonEditor.set(o),window.jsonEditor.refresh())})(C),document.querySelector("#savefile").setAttribute("style","opacity:1; margin-left: 5px;"),document.querySelector("#jsoneditor").style["z-index"]=1008):(function(o,m){return new Promise((function(v,I){var z,S,E,B,W=indexedDB.open("dodex",2),U=!1;W.onupgradeneeded=function(){z=W.result,U=!0,E=z.createObjectStore("cards",{keyPath:"idx",autoIncrement:!1})},W.onsuccess=function(_){z=_.target.result;for(let O=52;O>0;O--)if(m.cards["card"+O]){B=O;break}if(o==="replace"||U){S=z.transaction("cards","readwrite"),E=S.objectStore("cards");for(let O in m.cards){let y={};if(m.cards[O].front){let F=m.cards[O].front.content,j=R(F);m.cards[O].front.content=j===""?F:j}if(m.cards[O].back){let F=m.cards[O].back.content,j=R(F);m.cards[O].back.content=j===""?F:j}y[O]=m.cards[O],y.idx=O,y.type=o,E.put(y).onsuccess=function(F){M===0&&(b=F.target.result,M=1),d=F.target.result,document.querySelector("#results").innerHTML=`Processed Cards: ${b} ~ ${d}`,"card"+B==O&&v(z)}}}else if(o==="append")for(let O in m.cards)Z(O,d,v);function Z(O,y,F){return(function(j){return new Promise((function(G,X){var e1,o1,c1=indexedDB.open("dodex",2);c1.onsuccess=function(r1){e1=c1.result,o1=e1.transaction(["cards"],"readonly");var m1=o1.objectStore("cards").get(j);m1.onsuccess=function(){var v1=m1.result;v1!==void 0?G(v1):X(`Record ${j} not found`)}},c1.onerror=function(r1){X(r1)}}))})(O).then((function(j){if(S=z.transaction("cards","readwrite"),E=S.objectStore("cards"),m.cards[O].front){let G=m.cards[O].front.content,X=R(G);j[O].front.content+=X===""?G:X}if(m.cards[O].back){let G=m.cards[O].back.content,X=R(G);j[O].back.content+=X===""?G:X}m.cards[O].tab&&(j[O].tab=m.cards[O].tab),E.put(j).onsuccess=function(G){M===0&&(b=G.target.result,M=1),y=G.target.result,document.querySelector("#results").innerHTML=`Processed Cards: ${b} ~ ${y}`,"card"+B==O&&F(z)}}))}},W.onerror=function(_){console.error("Error",_.target)}}))})(x,C).then(t)},a.readAsText(c,"UTF8")):console.warn("Content File must be js or json")}if(e=P,s=A,n=T,i===void 0&&(i=(function($){let L=document.querySelector("body"),x=document.createElement("div"),p=document.createElement("div");D(x,"id","dodexInput"),D(p,"id","results"),D(x,"class","content-input"),L.insertBefore(x,document.querySelector(".top--dodex"));let c=x;x=document.createElement("div");let f=document.createElement("a");D(f,"title","Close"),D(f,"class","close"),f.innerHTML="X",f.onclick=function(){var E=document.body,B=document.documentElement;E.scrollTop=0,B.scrollTop=0,(function(W){try{W.value=null}catch{}W.value&&W.parentNode.replaceChild(W.cloneNode(!0),W)})(document.querySelector("#files")),document.querySelector("#dodexInput").style.opacity=0,setTimeout((()=>{document.querySelector("#dodexInput").style.display="none"}),500),window.jsonEditor&&(window.jsonEditor.destroy(),window.jsonEditor=null,document.querySelector("#jsoneditor").style["z-index"]=-1),document.querySelector("#savefile")&&(document.querySelector("#savefile").style.opacity=0)};let l=document.createElement("h5");l.innerHTML="Dodex Private Content Input",D(x,"class","input"),x.appendChild(f),x.appendChild(l);let a=document.createElement("p"),h=document.createElement("p"),g=document.createElement("br");f=document.createElement("a"),x.appendChild(f);let C=document.createElement("label");D(C,"for","files"),x.appendChild(C),C.innerHTML="Click to Select or Drag & Drop a file on Button",x.appendChild(a);let r=document.createElement("input");if(D(r,"id","files"),D(r,"type","file"),D(r,"name","files[]"),D(r,"size","1"),x.appendChild(r),x.appendChild(h),$.private==="full"||$.private==="partial"){let E=document.createElement("div");if($.replace===!0){var o=document.createElement("label"),m=document.createTextNode("Replace"),v=document.createElement("input");v.type="radio",v.name="type",v.value="replace",v.checked=!0,o.appendChild(v),o.appendChild(m),E.appendChild(o)}var I=document.createElement("label"),z=document.createTextNode("Append"),S=document.createElement("input");if(S.type="radio",S.name="type",S.value="append",D(S,"style","margin-left: 5px;"),$.replace===!1&&(S.checked=!0),I.appendChild(S),I.appendChild(z),E.appendChild(I),window.JSONEditor){let U=document.createElement("label"),_=document.createTextNode("Edit"),Z=document.createElement("input");Z.type="radio",Z.name="type",Z.value="edit",D(Z,"style","margin-left: 5px;"),U.appendChild(Z),U.appendChild(_),E.appendChild(U);let O=document.createElement("label"),y=document.createElement("input");y.type="button",y.name="button1",y.value="Save",y.id="savefile",D(y,"style","opacity:0;"),y.addEventListener("click",(F=>{let j=document.createElement("a");j.href="data:application/octet-stream,"+encodeURIComponent(window.jsonEditor.getText()),j.download=document.querySelector("#files").value,j.click(),window.jsonEditor.refresh()}),!1),O.appendChild(y),E.appendChild(O)}let B=document.createElement("label"),W=document.createElement("input");D(W,"style","margin-left: 5px;"),W.type="button",W.name="button2",W.value="Remove Private Data",W.id="removedb",W.addEventListener("click",(U=>{(function(_){if(confirm("Are you sure?")){var Z=indexedDB.deleteDatabase(_);Z.onsuccess=function(){if(s)for(let O in s){let y=Number(O)+1;try{s[O].querySelector(".front"+y).innerHTML="",s[O].querySelector(".back"+y).innerHTML="",window.dodexContent&&window.dodexContent.cards&&k(window.dodexContent,"card"+y,y,s)}catch(F){console.error(F)}}console.warn("Removal accomplished")},Z.onerror=function(O){console.error("Removal failed-",O)},Z.onblocked=function(O){console.error("Removal blocked-",O)}}})("dodex")}),!1),B.appendChild(W),E.appendChild(B),x.appendChild(E)}return x.appendChild(g),x.appendChild(p),a=document.createElement("p"),x.appendChild(a),c.appendChild(x),f})(n),document.querySelector("#files").addEventListener("change",w,!1)),!(window.File&&window.FileReader&&window.FileList))throw"The File APIs are not fully supported in this browser.";i.click(),window.__karma__!==void 0&&(window.handleFileSelect=w)}let b,d,M=0;function k(P,T,A,w){let $=w[A-1].querySelector(".front"+A),L=w[A-1].querySelector(".back"+A);P.cards&&P.cards[T]&&(P.cards[T].front&&P.cards[T].front.content&&P.cards[T].front.content.length>0&&($.insertAdjacentHTML("beforeend",P.cards[T].front.content),$.classList.add("green-tab")),P.cards[T].back&&P.cards[T].back.content&&P.cards[T].back.content.length>0&&L.insertAdjacentHTML("beforeend",P.cards[T].back.content))}function R(P){let T="";if(P.constructor===Array)for(let A in P)T+=P[A]+" ";return T}function D(P,T,A){let w=document.createAttribute(T);w.value=A,P.setAttributeNode(w)}return window.doDexInput=u,u}))});var rs=v0((Gn,Zn)=>{(function(i,e){typeof Gn=="object"&&typeof Zn<"u"?Zn.exports=e():typeof define=="function"&&define.amd?define(e):(i=typeof globalThis<"u"?globalThis:i||self).messBundle=e()})(Gn,(function(){"use strict";let i=[128512,128516,127818,127812,127871,127843,127856,127829,127828,127839,128704,128142,128506,9200,128377,128218,128049,128042,128057,128036,128512,128515,128516,128513,128518,128517,129315,128514,128578,128579,128521,128522,128519,129312,128526,129299,129488,127808,127958,127773,128511,9749,9875,9918,9969,9971,9973,127752,127774,127797,127921,127922,128051,128692],e,n,s,t,u=Math.floor(53*Math.random())+0,b=0,d=null,M=null,k=[],R="Broadcast",D="Private Message",P=()=>{if(d)return;u=Math.floor(53*Math.random())+0,A.server=s.server;let a=s.handle;s.handle.includes("-:-")||(a=s.handle+String.fromCodePoint(i[u])),s.mess.getUUID(a).then((function(h){if(typeof h=="string")console.error(h);else{let g=window.btoa(h.comm.id);M=h.comm.id,s.mess.webSocket({handle:h.comm.handle,id:g}),document.querySelector(".handle").innerHTML=d,document.querySelector(".dodex-comm").classList.toggle("pop-show")}}))},T=()=>{A.socket.close(1e3),document.querySelector(".handle").innerHTML="",document.querySelector(".chat-box").innerHTML="",b=0,d=null,M=null,k=[];let a=document.querySelector("#dodexComm");a.querySelector('a[name="private"]').innerHTML=D,a.classList.toggle("pop-show");let h=document.body,g=document.documentElement;h.scrollTop=0,g.scrollTop=0},A={popup(a,h,g){n=a,t=g,s=h,e===void 0&&(e=(function(){let C=document.querySelector("body"),r=document.createElement("div");p(r,"id","dodexComm"),p(r,"class","dodex-comm"),C.insertBefore(r,document.querySelector(".top--dodex"));let o=r,m=document.createElement("div");p(m,"id","menu"),p(m,"class","menu");let v=document.createElement("p");p(v,"class","welcome"),v.innerHTML=`<h1 style="font-size: 14px;"> <svg height="18" width="17" style="font-family: 'Open Sans', sans-serif;"> <text x="3" y="18" fill="#059">O</text><text x="0" y="15" fill="#059">D</text></svg> doDex Messaging <span class="handle"></span></h1>`,m.appendChild(v),v=document.createElement("p"),(function(S){let E=document.createElement("img");p(E,"src","../images/more_horiz.png"),p(E,"class","image-horiz");let B=document.createElement("div");p(B,"class","mess-dropdown"),B.appendChild(E);let W=document.createElement("div");p(W,"id","commDropdown"),p(W,"class","dropdown-content");let U=document.createElement("a");p(U,"href","#"),U.innerHTML="Clear Log",W.appendChild(U),U=document.createElement("a"),p(U,"href","#"),U.innerHTML="Change Handle",W.appendChild(U),U=document.createElement("a"),p(U,"href","#"),p(U,"name","private"),U.innerHTML="Private Message",W.appendChild(U),U=document.createElement("a"),p(U,"href","#"),p(U,"name","credentials"),U.innerHTML="Grab Credentials",W.appendChild(U),U=document.createElement("a"),p(U,"href","#"),U.innerHTML="Exit",W.appendChild(U),B.appendChild(W),S.appendChild(B),E.onclick=()=>{document.querySelector("#commDropdown").classList.toggle("show")},window.onclick=Z=>{if(!Z.target.matches(".image-horiz")){var O,y=document.querySelectorAll(".dropdown-content");for(O=0;O<y.length;O++){var F=y[O];F.classList.contains("show")&&F.classList.remove("show")}}};let _=W.querySelectorAll("a");for(let Z in _)switch(_[Z].innerHTML){case"Clear Log":_[Z].onclick=O=>(document.querySelector("#chatbox").innerHTML="",O.preventDefault(),!1);break;case"Change Handle":_[Z].onclick=O=>{indexedDB.deleteDatabase("dodex-comm").onsuccess=()=>{document.querySelector(".user-msg").textContent=";removeuser!!",w(),T(),s.mess.popup(n,s,t)}};break;case"Private Message":case"Broadcast":_[Z].onclick=O=>{let y=document.querySelector("#dodexComm").querySelector(".private");return y!==null&&(y.classList.toggle("show"),O.target.innerHTML===D?O.target.innerHTML=R:(O.target.innerHTML=D,k=[],x(document.querySelector("#dodexComm").querySelector("select")))),O.preventDefault(),!1};break;case"Grab Credentials":_[Z].onclick=O=>{let y=document.createElement("input");y.setAttribute("type","text"),O.target.appendChild(y),y.value=d+"-:-"+M,y.select(),y.setSelectionRange(0,99999),navigator.clipboard.writeText(y.value).then((()=>{O.target.removeChild(y)}))};break;case"Exit":_[Z].onclick=T}})(v),m.appendChild(v),o.appendChild(m),r=document.createElement("div"),p(r,"id","chatbox"),p(r,"class","chat-box"),o.appendChild(r);let I=document.createElement("a");p(I,"id","dodexComm"),o.appendChild(I);let z=document.createElement("input");return p(z,"id","inputsend"),p(z,"value","Send"),p(z,"class","input-send"),p(z,"type","button"),o.appendChild(z),r=document.createElement("div"),p(r,"contenteditable","true"),p(r,"id","usermsg"),p(r,"class","user-msg"),o.appendChild(r),r.addEventListener("keydown",(function(S){return!(String.fromCharCode(S.button).toLowerCase()=="s"&&S.ctrlKey||S.key==19)||(w(),S.preventDefault(),!1)})),I})(),e.onclick=P),new Promise((function(C){var r=indexedDB.open("dodex-comm");r.onupgradeneeded=function(){r.result.createObjectStore("comm",{keyPath:"idx",autoIncrement:!1})},r.onsuccess=o=>{$("comm",o.target.result).then((function(m){o.target.result.close(),C(m)}))},r.onerror=o=>{console.warn(o)}})).then((function(C){typeof C=="string"?((function(){let r=document.querySelector("body"),o=document.createElement("div");p(o,"id","commHandle"),p(o,"class","comm-handle"),r.insertBefore(o,document.querySelector(".top--dodex"));let m=o,v=document.createElement("div");p(v,"id","menuHandle"),p(v,"class","menu");let I=document.createElement("p");p(I,"class","welcome"),I.innerHTML=`<h1 class="handle" style="font-size: 14px;"> Enter your chat handle</h1>`,v.appendChild(I),I=document.createElement("p"),p(I,"class","close-handle");let z=document.createElement("a");p(z,"id","closeHandle"),z.innerHTML="Exit",z.onclick=()=>{document.querySelector("#commHandle").classList.toggle("pop-show")},I.appendChild(z),v.appendChild(I),m.appendChild(v),z=document.createElement("a"),p(z,"id","handleComm"),m.appendChild(z);let S=document.createElement("br");m.appendChild(S);let E=document.createElement("input");p(E,"id","inputHandle"),p(E,"value","Save"),p(E,"class","input-save"),p(E,"type","button"),E.onclick=L,m.appendChild(E),o=document.createElement("input"),p(o,"id","handlemsg"),p(o,"type","text"),p(o,"class","handle-msg"),m.appendChild(o),o.addEventListener("keydown",(function(B){return!(String.fromCharCode(B.key).toLowerCase()=="s"&&B.ctrlKey||B.key==19)||(L(),B.preventDefault(),!1)}))})(),document.querySelector("#commHandle").classList.toggle("pop-show")):e.click()}))},socket:null,server:"localhost:3087",getUUID:a=>(function(h){return new Promise((function(g){let C,r,o,m=indexedDB.open("dodex-comm");m.onupgradeneeded=function(){C=m.result,o=C.createObjectStore("comm",{keyPath:"idx",autoIncrement:!1})},m.onsuccess=function(v){C=v.target.result,$("comm",C).then((function(I){if(typeof I!="string")return C.close(),void g(I);r=C.transaction("comm","readwrite"),o=r.objectStore("comm");let z=(function(B,W,U){let _=W&&U||0;typeof B=="string"&&(W=B==="binary"?new Array(16):null,B=null);let Z=(B=B||{}).random||(B.rng||l)();if(Z[6]=15&Z[6]|64,Z[8]=63&Z[8]|128,W)for(var O=0;O<16;++O)W[_+O]=Z[O];for(let y=0;y<256;++y)f[y]=(y+256).toString(16).substring(1);return W||(function(y,F){let j=F||0,G=f;return[G[y[j++]],G[y[j++]],G[y[j++]],G[y[j++]],"-",G[y[j++]],G[y[j++]],"-",G[y[j++]],G[y[j++]],"-",G[y[j++]],G[y[j++]],"-",G[y[j++]],G[y[j++]],G[y[j++]],G[y[j++]],G[y[j++]],G[y[j++]]].join("")})(Z)})(),S={},E=h.split("-:-");E.length===2&&(h=E[0],z=E[1]),S.comm={handle:h,id:z},S.idx="comm",o.put(S).onsuccess=function(){$("comm",C).then((function(B){C.close(),g(B)}))}}))},m.onerror=function(v){console.error("Error",v.target)}}))})(a),webSocket(a){if(!(a&&a.handle&&a.id))throw new Error("Must supply 'handle' and 'id' for WebSocket");{d=a.handle;let h="ws://";window.location.protocol==="https:"&&(h="wss://"),this.socket=new WebSocket(h+this.server+"/dodex?handle="+d+"&id="+encodeURIComponent(a.id))}return this.socket.onerror=h=>{console.error(h)},this.socket.onopen=()=>{document.querySelector(".input-send").onclick=w},this.socket.onmessage=h=>{let g=new Date,C=c(g.getHours()),r=c(g.getMinutes()),o=document.querySelector(".chat-box"),m=(function(v){let I=v.split("connected:");return I.length<2?v:((function(z){let S=document.querySelector("#dodexComm");S.querySelector(".private")!==null&&S.removeChild(S.querySelector(".private"));let E=document.createElement("select");p(E,"class","private"),p(E,"multiple","true");let B=z.length;for(let W=0;W<B;W++){let U=document.createElement("option");p(U,"value",z[W].name),U.innerHTML=z[W].name,E.appendChild(U),S.appendChild(E)}E.addEventListener("change",(W=>{k=(function(U){let _=[],Z;var O=U.options.length;for(let y=0;y<O;y++)Z=U.options[y],Z.selected&&_.push(Z.value);return _})(W.target)}))})(JSON.parse(I[1])),"connected")})(h.data);o.innerHTML+=`${C}:${r} ${m}<br>`,(o.scrollTop>b||b===0)&&(b=o.scrollTop,o.scrollTop=o.scrollHeight)},this.socket.onclose=h=>{d=null,h.code!==1e3&&console.warn("Closed",h.code)},this.socket}};function w(){let a=document.querySelector("#dodexComm").querySelector(".user-msg");var h=a.innerHTML;if(h.length>1){let g=(function(C){return document.querySelector("#dodexComm").querySelector('a[name="private"]').innerHTML===R?C+";users!!"+JSON.stringify(k):C})(h);A.socket.send(g),a.innerHTML=""}}function $(a,h){return new Promise((function(g,C){h.objectStoreNames.length===0&&g(`Store ${a} not found`);var r=h.transaction(["comm"],"readonly").objectStore("comm").get(a);r.onsuccess=function(){var o=r.result;g(o!==void 0?o:`Record ${a} not found`)},r.onerror=function(o){C(`Record ${a} not found : ${o}`)}}))}function L(){let a=document.querySelector(".handle-msg");s.handle=a.value,a.value.length<4||(a.value="",document.querySelector("#commHandle").classList.toggle("pop-show"),e.click())}function x(a){var h=a.options.length;for(let g=0;g<h;g++)a.options[g].selected=!1}function p(a,h,g){let C=document.createAttribute(h);C.value=g,a.setAttributeNode(C)}function c(a){return a<10&&(a="0"+a),a}window.doDexMess=A;let f=[];function l(){return Math.random().toString().substring(2,18).toString(10).split("").map((a=>parseInt(a)))}return A}))});var ls=v0((M0,Kn)=>{((i,e)=>{typeof M0=="object"&&typeof Kn=="object"?Kn.exports=e():typeof define=="function"&&define.amd?define([],e):typeof M0=="object"?M0.JSONEditor=e():i.JSONEditor=e()})(self,function(){return e={6545:function(s,t,u){u.d(t,{t:function(){return D}});var b=u(1925),d=u(6237),M=u(3057);function k(P){return(k=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(T){return typeof T}:function(T){return T&&typeof Symbol=="function"&&T.constructor===Symbol&&T!==Symbol.prototype?"symbol":typeof T})(P)}function R(P,T){for(var A=0;A<T.length;A++){var w=T[A];w.enumerable=w.enumerable||!1,w.configurable=!0,"value"in w&&(w.writable=!0),Object.defineProperty(P,($=>($=((L,x)=>{if(k(L)!="object"||!L)return L;var p=L[Symbol.toPrimitive];if(p===void 0)return(x==="string"?String:Number)(L);if(k(p=p.call(L,x||"default"))!="object")return p;throw new TypeError("@@toPrimitive must return a primitive value.")})($,"string"),k($)=="symbol"?$:$+""))(w.key),w)}}var D=(()=>{function P($,p){if(!(this instanceof P))throw new TypeError("Cannot call a class as a function");this.dom={};var x=this,f=this.dom,p=(this.anchor=void 0,this.items=$,this.eventListeners={},this.selection=void 0,this.onClose=p?p.close:void 0,this.limitHeight=!!p&&p.limitHeight,document.createElement("div")),c=(p.className="jsoneditor-contextmenu-root",f.root=p,document.createElement("div")),p=(c.className="jsoneditor-contextmenu",f.menu=c,p.appendChild(c),document.createElement("ul")),c=(p.className="jsoneditor-menu",c.appendChild(p),f.list=p,f.items=[],document.createElement("button")),f=(c.type="button",f.focusButton=c,document.createElement("li"));f.style.overflow="hidden",f.style.height="0",f.appendChild(c),p.appendChild(f),(function l(a,h,g){g.forEach(function(C){var r,o,m,v,I,z;C.type==="separator"?((I=document.createElement("div")).className="jsoneditor-separator",(o=document.createElement("li")).appendChild(I),a.appendChild(o)):(r={},I=document.createElement("li"),a.appendChild(I),(o=document.createElement("button")).type="button",o.className=C.className,r.button=o,C.title&&(o.title=C.title),C.click&&(o.onclick=function(S){S.preventDefault(),x.hide(),C.click()}),I.appendChild(o),C.submenu?((v=document.createElement("div")).className="jsoneditor-icon",o.appendChild(v),(v=document.createElement("div")).className="jsoneditor-text"+(C.click?"":" jsoneditor-right-margin"),v.appendChild(document.createTextNode(C.text)),o.appendChild(v),(m=C.click?(o.className+=" jsoneditor-default",(v=document.createElement("button")).type="button",(r.buttonExpand=v).className="jsoneditor-expand",(z=document.createElement("div")).className="jsoneditor-expand",v.appendChild(z),I.appendChild(v),C.submenuTitle&&(v.title=C.submenuTitle),v):((z=document.createElement("div")).className="jsoneditor-expand",o.appendChild(z),o)).onclick=function(S){S.preventDefault(),x._onExpandItem(r),m.focus()},r.subItems=v=[],z=document.createElement("ul"),(r.ul=z).className="jsoneditor-menu",z.style.height="0",I.appendChild(z),l(z,v,C.submenu)):((I=document.createElement("div")).className="jsoneditor-icon",o.appendChild(I),(z=document.createElement("div")).className="jsoneditor-text",z.appendChild(document.createTextNode((0,M.Tl)(C.text))),o.appendChild(z)),h.push(r))})})(p,this.dom.items,$),this.maxHeight=0,$.forEach(function(l){l=24*($.length+(l.submenu?l.submenu.length:0)),x.maxHeight=Math.max(x.maxHeight,l)})}return T=P,(A=[{key:"_getVisibleButtons",value:function(){var $=[],L=this;return this.dom.items.forEach(function(x){$.push(x.button),x.buttonExpand&&$.push(x.buttonExpand),x.subItems&&x===L.expandedItem&&x.subItems.forEach(function(p){$.push(p.button),p.buttonExpand&&$.push(p.buttonExpand)})}),$}},{key:"show",value:function($,h,x){this.hide();var p=!0,f=$.parentNode,c=$.getBoundingClientRect(),f=f.getBoundingClientRect(),l=h.getBoundingClientRect(),a=this,h=(this.dom.absoluteAnchor=(0,b.p)($,h,function(){a.hide()}),c.bottom+this.maxHeight<l.bottom||c.top-this.maxHeight>l.top&&(p=!1),x?0:c.top-f.top);p?(x=$.offsetHeight,this.dom.menu.style.left="0",this.dom.menu.style.top=h+x+"px",this.dom.menu.style.bottom=""):(this.dom.menu.style.left="0",this.dom.menu.style.top="",this.dom.menu.style.bottom="0px"),this.limitHeight&&(f=p?l.bottom-c.bottom-10:c.top-l.top-10,this.dom.list.style.maxHeight=f+"px",this.dom.list.style.overflowY="auto"),this.dom.absoluteAnchor.appendChild(this.dom.root),this.selection=(0,d.getSelection)(),this.anchor=$,setTimeout(function(){a.dom.focusButton.focus()},0),P.visibleMenu&&P.visibleMenu.hide(),P.visibleMenu=this}},{key:"hide",value:function(){this.dom.absoluteAnchor&&(this.dom.absoluteAnchor.destroy(),delete this.dom.absoluteAnchor),this.dom.root.parentNode&&(this.dom.root.parentNode.removeChild(this.dom.root),this.onClose)&&this.onClose(),P.visibleMenu===this&&(P.visibleMenu=void 0)}},{key:"_onExpandItem",value:function($){var L,x=this,p=$===this.expandedItem,c=this.expandedItem;c&&(c.ul.style.height="0",c.ul.style.padding="",setTimeout(function(){x.expandedItem!==c&&(c.ul.style.display="",d.removeClassName)(c.ul.parentNode,"jsoneditor-selected")},300),this.expandedItem=void 0),p||((L=$.ul).style.display="block",setTimeout(function(){if(x.expandedItem===$){for(var f=0,l=0;l<L.childNodes.length;l++)f+=L.childNodes[l].clientHeight;L.style.height=f+"px",L.style.padding="5px 10px"}},0),(0,d.addClassName)(L.parentNode,"jsoneditor-selected"),this.expandedItem=$)}},{key:"_onKeyDown",value:function($){var L,x,p,c,f=$.target,l=$.which,a=!1;l===27?(this.selection&&(0,d.setSelection)(this.selection),this.anchor&&this.anchor.focus(),this.hide(),a=!0):l===9?$.shiftKey?(x=(L=this._getVisibleButtons()).indexOf(f))===0&&(L[L.length-1].focus(),a=!0):(x=(L=this._getVisibleButtons()).indexOf(f))===L.length-1&&(L[0].focus(),a=!0):l===37?(f.className==="jsoneditor-expand"&&(x=(L=this._getVisibleButtons()).indexOf(f),p=L[x-1])&&p.focus(),a=!0):l===38?(x=(L=this._getVisibleButtons()).indexOf(f),(p=(p=(p=L[x-1])&&p.className==="jsoneditor-expand"?L[x-2]:p)||L[L.length-1])&&p.focus(),a=!0):l===39?(x=(L=this._getVisibleButtons()).indexOf(f),(c=L[x+1])&&c.className==="jsoneditor-expand"&&c.focus(),a=!0):l===40&&(x=(L=this._getVisibleButtons()).indexOf(f),(c=(c=(c=L[x+1])&&c.className==="jsoneditor-expand"?L[x+2]:c)||L[0])&&(c.focus(),a=!0),a=!0),a&&($.stopPropagation(),$.preventDefault())}}])&&R(T.prototype,A),w&&R(T,w),Object.defineProperty(T,"prototype",{writable:!1}),T;var T,A,w})();D.visibleMenu=void 0},2115:function(s,t,u){function b(k){return(b=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(R){return typeof R}:function(R){return R&&typeof Symbol=="function"&&R.constructor===Symbol&&R!==Symbol.prototype?"symbol":typeof R})(k)}function d(k,R){for(var D=0;D<R.length;D++){var P=R[D];P.enumerable=P.enumerable||!1,P.configurable=!0,"value"in P&&(P.writable=!0),Object.defineProperty(k,(T=>(T=((A,w)=>{if(b(A)!="object"||!A)return A;var $=A[Symbol.toPrimitive];if($===void 0)return(w==="string"?String:Number)(A);if(b($=$.call(A,w||"default"))!="object")return $;throw new TypeError("@@toPrimitive must return a primitive value.")})(T,"string"),b(T)=="symbol"?T:T+""))(P.key),P)}}u.d(t,{N:function(){return M}});var M=(()=>{function k(A){if(!(this instanceof k))throw new TypeError("Cannot call a class as a function");this.errorTableVisible=A.errorTableVisible,this.onToggleVisibility=A.onToggleVisibility,this.onFocusLine=A.onFocusLine||function(){},this.onChangeHeight=A.onChangeHeight,this.dom={};var A=document.createElement("div"),w=(A.className="jsoneditor-validation-errors-container",this.dom.validationErrorsContainer=A,document.createElement("div")),A=(w.style.display="none",w.className="jsoneditor-additional-errors fadein",w.textContent="Scroll for more \u25BF",this.dom.additionalErrorsIndication=w,A.appendChild(w),document.createElement("span")),w=(A.className="jsoneditor-validation-error-icon",A.style.display="none",this.dom.validationErrorIcon=A,document.createElement("span"));w.className="jsoneditor-validation-error-count",w.style.display="none",this.dom.validationErrorCount=w,this.dom.parseErrorIndication=document.createElement("span"),this.dom.parseErrorIndication.className="jsoneditor-parse-error-icon",this.dom.parseErrorIndication.style.display="none"}return R=k,(D=[{key:"getErrorTable",value:function(){return this.dom.validationErrorsContainer}},{key:"getErrorCounter",value:function(){return this.dom.validationErrorCount}},{key:"getWarningIcon",value:function(){return this.dom.validationErrorIcon}},{key:"getErrorIcon",value:function(){return this.dom.parseErrorIndication}},{key:"toggleTableVisibility",value:function(){this.errorTableVisible=!this.errorTableVisible,this.onToggleVisibility(this.errorTableVisible)}},{key:"setErrors",value:function(T,A){var w,$,L=this,x=(this.dom.validationErrors&&(this.dom.validationErrors.parentNode.removeChild(this.dom.validationErrors),this.dom.validationErrors=null,this.dom.additionalErrorsIndication.style.display="none"),this.errorTableVisible&&0<T.length?((x=document.createElement("div")).className="jsoneditor-validation-errors",($=document.createElement("table")).className="jsoneditor-text-errors",x.appendChild($),w=document.createElement("tbody"),$.appendChild(w),T.forEach(function(p){isNaN(p.line)?p.dataPath&&(f=A.find(function(h){return h.path===p.dataPath}))&&(c=f.line+1):c=p.line;var c,f=document.createElement("tr"),l=(f.className=isNaN(c)?"":"jump-to-line",p.type==="error"?f.className+=" parse-error":f.className+=" validation-error",document.createElement("td")),a=document.createElement("button"),a=(a.className="jsoneditor-schema-error",l.appendChild(a),f.appendChild(l),document.createElement("td"));a.style="white-space: nowrap;",a.textContent=isNaN(c)?"":"Ln "+c,f.appendChild(a),typeof p=="string"?((l=document.createElement("td")).colSpan=2,(a=document.createElement("pre")).appendChild(document.createTextNode(p)),l.appendChild(a),f.appendChild(l)):((a=document.createElement("td")).appendChild(document.createTextNode(p.dataPath||"")),f.appendChild(a),l=document.createElement("td"),(a=document.createElement("pre")).appendChild(document.createTextNode(p.message.replace(/<br>/gi,` `))),l.appendChild(a),f.appendChild(l)),f.onclick=function(){L.onFocusLine(c)},w.appendChild(f)}),this.dom.validationErrors=x,this.dom.validationErrorsContainer.appendChild(x),this.dom.additionalErrorsIndication.title=T.length+" errors total",this.dom.validationErrorsContainer.clientHeight<this.dom.validationErrorsContainer.scrollHeight?(this.dom.additionalErrorsIndication.style.display="block",this.dom.validationErrorsContainer.onscroll=function(){L.dom.additionalErrorsIndication.style.display=0<L.dom.validationErrorsContainer.clientHeight&&L.dom.validationErrorsContainer.scrollTop===0?"block":"none"}):this.dom.validationErrorsContainer.onscroll=void 0,$=this.dom.validationErrorsContainer.clientHeight+(this.dom.statusBar?this.dom.statusBar.clientHeight:0),this.onChangeHeight($)):this.onChangeHeight(0),T.filter(function(p){return p.type!=="error"}).length);0<x?(this.dom.validationErrorCount.style.display="inline",this.dom.validationErrorCount.innerText=x,this.dom.validationErrorCount.onclick=this.toggleTableVisibility.bind(this),this.dom.validationErrorIcon.style.display="inline",this.dom.validationErrorIcon.title=x+" schema validation error(s) found",this.dom.validationErrorIcon.onclick=this.toggleTableVisibility.bind(this)):(this.dom.validationErrorCount.style.display="none",this.dom.validationErrorIcon.style.display="none"),T.some(function(p){return p.type==="error"})?($=T[0].line,this.dom.parseErrorIndication.style.display="block",this.dom.parseErrorIndication.title=isNaN($)?"parse error - check that the json is valid":"parse error on line "+$,this.dom.parseErrorIndication.onclick=this.toggleTableVisibility.bind(this)):this.dom.parseErrorIndication.style.display="none"}}])&&d(R.prototype,D),P&&d(R,P),Object.defineProperty(R,"prototype",{writable:!1}),R;var R,D,P})()},2877:function(s,t,u){function b(k){return(b=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(R){return typeof R}:function(R){return R&&typeof Symbol=="function"&&R.constructor===Symbol&&R!==Symbol.prototype?"symbol":typeof R})(k)}function d(k,R){for(var D=0;D<R.length;D++){var P=R[D];P.enumerable=P.enumerable||!1,P.configurable=!0,"value"in P&&(P.writable=!0),Object.defineProperty(k,(T=>(T=((A,w)=>{if(b(A)!="object"||!A)return A;var $=A[Symbol.toPrimitive];if($===void 0)return(w==="string"?String:Number)(A);if(b($=$.call(A,w||"default"))!="object")return $;throw new TypeError("@@toPrimitive must return a primitive value.")})(T,"string"),b(T)=="symbol"?T:T+""))(P.key),P)}}u.d(t,{$:function(){return M}});var M=(()=>{function k(T){if(!(this instanceof k))throw new TypeError("Cannot call a class as a function");if(this.target=T.target||null,!this.target)throw new Error('FocusTracker constructor called without a "target" to track.');this.onFocus=typeof T.onFocus=="function"?T.onFocus:null,this.onBlur=typeof T.onBlur=="function"?T.onBlur:null,this._onClick=this._onEvent.bind(this),this._onKeyUp=function(A){A.which!==9&&A.keyCode!==9||this._onEvent(A)}.bind(this),this._onBlur=this._onEvent.bind(this),this.focusFlag=!1,this.firstEventFlag=!0,(this.onFocus||this.onBlur)&&(document.addEventListener("click",this._onClick),document.addEventListener("keyup",this._onKeyUp),document.addEventListener("blur",this._onBlur))}return R=k,(D=[{key:"destroy",value:function(){document.removeEventListener("click",this._onClick),document.removeEventListener("keyup",this._onKeyUp),document.removeEventListener("blur",this._onBlur),this._onEvent({target:document.body})}},{key:"_onEvent",value:function(T){T=T.target,T=T===this.target||!(!this.target.contains(T)&&!this.target.contains(document.activeElement)),T?this.focusFlag||(this.onFocus&&this.onFocus({type:"focus",target:this.target}),this.focusFlag=!0):(this.focusFlag||this.firstEventFlag)&&(this.onBlur&&this.onBlur({type:"blur",target:this.target}),this.focusFlag=!1,this.firstEventFlag)&&(this.firstEventFlag=!1)}}])&&d(R.prototype,D),P&&d(R,P),Object.defineProperty(R,"prototype",{writable:!1}),R;var R,D,P})()},1346:function(s,t,u){var b=u(7413),d=u(1746),M=u(5633).treeModeMixins,k=u(1948).textModeMixins,R=u(7483).previewModeMixins,$=u(6237),D=$.clear,P=$.extend,T=$.getInnerText,A=$.getInternetExplorerVersion,w=$.parse,$=u(2870).tryRequireAjv,L=u(5609).showTransformModal,x=u(2915).showSortModal,p=$();function c(f,l,a){if(!(this instanceof c))throw new Error('JSONEditor constructor called without "new".');var h=A();if(h!==-1&&h<9)throw new Error("Unsupported browser, IE9 or newer required. Please install the newest version of your browser.");l&&(l.error&&(console.warn('Option "error" has been renamed to "onError"'),l.onError=l.error,delete l.error),l.change&&(console.warn('Option "change" has been renamed to "onChange"'),l.onChange=l.change,delete l.change),l.editable&&(console.warn('Option "editable" has been renamed to "onEditable"'),l.onEditable=l.editable,delete l.editable),l.onChangeJSON&&(l.mode==="text"||l.mode==="code"||l.modes&&(l.modes.indexOf("text")!==-1||l.modes.indexOf("code")!==-1))&&console.warn('Option "onChangeJSON" is not applicable to modes "text" and "code". Use "onChangeText" or "onChange" instead.'),l)&&Object.keys(l).forEach(function(g){c.VALID_OPTIONS.indexOf(g)===-1&&console.warn('Unknown option "'+g+'". This option will be ignored')}),arguments.length&&this._create(f,l,a)}typeof Promise>"u"&&console.error("Promise undefined. Please load a Promise polyfill in the browser in order to use JSONEditor"),c.modes={},c.prototype.DEBOUNCE_INTERVAL=150,c.VALID_OPTIONS=["ajv","schema","schemaRefs","templates","ace","theme","autocomplete","onChange","onChangeJSON","onChangeText","onExpand","onEditable","onError","onEvent","onModeChange","onNodeName","onValidate","onCreateMenu","onSelectionChange","onTextSelectionChange","onClassName","onFocus","onBlur","colorPicker","onColorPicker","timestampTag","timestampFormat","escapeUnicode","history","search","mode","modes","name","indentation","sortObjectKeys","navigationBar","statusBar","mainMenuBar","languages","language","enableSort","enableTransform","limitDragging","maxVisibleChilds","onValidationError","modalAnchor","popupAnchor","createQuery","executeQuery","queryDescription","allowSchemaSuggestions","showErrorTable"],c.prototype._create=function(f,l,a){this.container=f,this.options=l||{},this.json=a||{},f=this.options.mode||this.options.modes&&this.options.modes[0]||"tree",this.setMode(f)},c.prototype.destroy=function(){},c.prototype.set=function(f){this.json=f},c.prototype.get=function(){return this.json},c.prototype.setText=function(f){this.json=w(f)},c.prototype.getText=function(){return JSON.stringify(this.json)},c.prototype.setName=function(f){this.options||(this.options={}),this.options.name=f},c.prototype.getName=function(){return this.options&&this.options.name},c.prototype.setMode=function(f){if(f!==this.options.mode||!this.create){var l=this.container,a=P({},this.options),h=a.mode,g=c.modes[a.mode=f];if(!g)throw new Error('Unknown mode "'+a.mode+'"');var C=g.data==="text",r=this.getName(),o=this[C?"getText":"get"]();if(this.destroy(),D(this),P(this,g.mixin),this.create(l,a),this.setName(r),this[C?"setText":"set"](o),typeof g.load=="function")try{g.load.call(this)}catch(m){console.error(m)}if(typeof a.onModeChange=="function"&&f!==h)try{a.onModeChange(f,h)}catch(m){console.error(m)}}},c.prototype.getMode=function(){return this.options.mode},c.prototype._onError=function(f){this.options&&typeof this.options.onError=="function"?this.options.onError(f):window.alert(f.toString())},c.prototype.setSchema=function(f,l){if(f){var a;try{this.options.ajv?a=this.options.ajv:((a=p({allErrors:!0,verbose:!0,schemaId:"auto",$data:!0})).addMetaSchema(u(5207)),a.addMetaSchema(u(6801)))}catch{console.warn("Failed to create an instance of Ajv, JSON Schema validation is not available. Please use a JSONEditor bundle including Ajv, or pass an instance of Ajv as via the configuration option `ajv`.")}if(a){if(l){for(var h in l)a.removeSchema(h),l[h]&&a.addSchema(l[h],h);this.options.schemaRefs=l}this.validateSchema=a.compile(f),this.options.schema=f,this.options.schemaRefs=l,this.validate()}}else this.validateSchema=null,this.options.schema=null,this.options.schemaRefs=null,this.validate();this.refresh(),typeof this._onSchemaChange=="function"&&this._onSchemaChange(f,l)},c.prototype.validate=function(){return Promise.resolve([])},c.prototype.refresh=function(){},(c.registerMode=function(f){var l;if(Array.isArray(f))for(g=0;g<f.length;g++)c.registerMode(f[g]);else{if(!("mode"in f))throw new Error('Property "mode" missing');if(!("mixin"in f))throw new Error('Property "mixin" missing');if(!("data"in f))throw new Error('Property "data" missing');var a=f.mode;if(a in c.modes)throw new Error('Mode "'+a+'" already registered');if(typeof f.mixin.create!="function")throw new Error('Required function "create" missing on mixin');for(var h=["setMode","registerMode","modes"],g=0;g<h.length;g++)if((l=h[g])in f.mixin)throw new Error('Reserved property "'+l+'" not allowed in mixin');c.modes[a]=f}})(M),c.registerMode(k),c.registerMode(R),c.ace=b,c.Ajv=p,c.VanillaPicker=d,c.showTransformModal=L,c.showSortModal=x,c.getInnerText=T,s.exports=c.default=c},1389:function(s,t,u){u.d(t,{n:function(){return R}});var b=u(6545),d=u(3057);function M(D){return(M=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(P){return typeof P}:function(P){return P&&typeof Symbol=="function"&&P.constructor===Symbol&&P!==Symbol.prototype?"symbol":typeof P})(D)}function k(D,P){for(var T=0;T<P.length;T++){var A=P[T];A.enumerable=A.enumerable||!1,A.configurable=!0,"value"in A&&(A.writable=!0),Object.defineProperty(D,(w=>(w=(($,L)=>{if(M($)!="object"||!$)return $;var x=$[Symbol.toPrimitive];if(x===void 0)return(L==="string"?String:Number)($);if(M(x=x.call($,L||