javascript:{(()=>{var o=class{static get _S3(){return"source-over"}};var r=class s{static m_0;static _g6(e,t){globalThis[e]=t,s.m_0.push(e)}static getData(e){return globalThis[e]}static clear(){for(var e of[...s.m_0])s._g6(e,null)}static set _W(e){s._g6("canvas98",e)}static get _W(){return s.getData("canvas98")}};r.m_0=[];var u=class s{m_0;m_1;_R2;name;static _h6=new s("default");static _i6=new s("maker",()=>"darken");get _A8(){return this.m_0()}constructor(e,t=()=>o._S3,i=1,_=a=>a){this.name=e,this.m_0=t,this._R2=i,this.m_1=_}_A1(e){return this.m_1(e)}};var l=class{pens=[];selectedPens=[];keys=[];isSmooth;correction},h=class s{static m_1;m_0;_w1;get _za(){return this.m_0}constructor(e){this.m_0=[];let t=null;try{t=JSON.parse(e??"")}catch{}t==null&&(t=new l),this._w1=t}_z7(){return JSON.stringify(this._w1)}_A7(e){let t="",i=this._w1;for(var _ of this.m_0)_.name==e&&(t=_.value);for(var a of i.keys)a.name==e&&(t=a.value);return t}_B7(e,t){this.m_0.push({name:e,value:t})}static _t4(){return s.m_1}};h.m_1=new h(window.localStorage.getItem("canvas98Settings"));var d={ZoomIn:"zoomIn",ZoomReset:"zoomReset",ZoomOut:"zoomOut"},c=class s{static bindInput(e){let t=document.createElement("input");return t.type="url",t.value=n[e],t.addEventListener("keydown",i=>{i.stopImmediatePropagation();let _=i.key.toLocaleLowerCase();switch(_){case"escape":case"tab":case"enter":return}n[e]=_,i.currentTarget.value=""}),t}static dialogHTML(){let e=document.createElement("dialog");e.style.padding="0",e.style.background="rgb(255, 255, 238)";let t=document.createElement("div");t.style.width="100%",t.style.height="100%",t.style.display="flex",t.style.padding="1em",t.style.flexFlow="column nowrap",t.style.gap=".5em",t.style.boxSizing="border-box";for(let i of Object.values(d)){let _=document.createElement("div");_.style.display="grid",_.style.gridTemplateColumns="1fr 1fr",_.innerHTML=`
${i}
`,_.append(s.bindInput(i)),t.append(_)}return e.append(t),e}static html(){let e=s.dialogHTML();e.addEventListener("click",_=>{_.target.tagName==="DIALOG"&&(e.close(),n.saveConfig())});let t=document.createElement("li");t.id="canvas98ExKeyConfig",t.innerHTML="\u30BA\u30FC\u30E0
\u8A2D \u5B9A",t.style.textAlign="center",t.style.fontSize=".8rem",t.style.userSelect="none",t.style.width="50px",t.addEventListener("click",()=>{e.showModal()});let i=document.createElement("div");return i.style.display="flex",i.style.alignItems="center",i.classList.add("canvas98MenuItem"),i.append(t),document.getElementById("canvas98Element")?.append(e),i}static mount(){if(document.getElementById("canvas98ExKeyConfig"))return;document.querySelectorAll("#canvas98HorizontalMainMenu .canvas98MenuItemParent")[1].append(s.html())}};var n=class s{static zoomOut="1";static zoomReset="2";static zoomIn="3";static saveConfig(){let e={shortcuts:{}};for(let t of Object.values(d))e.shortcuts[t]=s[t];window.localStorage.setItem("canvas98ZoomConfig",JSON.stringify(e))}static loadConfig(){let e=window.localStorage.canvas98ZoomConfig;if(!e)return;let t=JSON.parse(e);for(let[i,_]of Object.entries(t.shortcuts))s[i]=_}},m=class s{canvas98;constructor(e){this.canvas98=e,n.loadConfig(),this.canvas98._92.add(()=>{n.saveConfig()})}addZoomShortcut(){globalThis.Canvas98ZoomLoaded||(this.canvas98._53.add(e=>{var t=e.key.toLowerCase();switch(t){case n.zoomOut:this.canvas98._82._G5(2/3);break;case n.zoomReset:this.canvas98._82.scale=1;break;case n.zoomIn:this.canvas98._82._G5(1.5);break}}),globalThis.Canvas98ZoomLoaded=!0)}static run(){new s(r._W).addZoomShortcut(),c.mount()}};m.run();})();}