javascript:{(()=>{class e{get width(){return this._81-this._y}get height(){return this._91-this._z}get _l8(){return null==this._y}get _66(){return Math.max(0,this._y)}get _76(){return Math.max(0,this._z)}get _m8(){return Math.max(0,this._81)-this._66}get _n8(){return Math.max(0,this._91)-this._76}constructor(t=null,e=null,i=null,s=null){this._y=t,this._z=e,this._81=i,this._91=s}_j1(t,e,i){return this._Z1(t-i,e-i)._Z1(t+i,e+i),this}_Z1(t,e){return null==this._y&&(this._81=this._y=t,this._91=this._z=e),this._y=Math.min(this._y,Math.floor(t)),this._z=Math.min(this._z,Math.floor(e)),this._81=Math.max(this._81,Math.ceil(t)),this._91=Math.max(this._91,Math.ceil(e)),this}_O3(t){return this._Z1(t._y,t._z)._Z1(t._81,t._91)}clear(){this._81=this._y=null,this._91=this._z=null}_V(){return new e(this._y,this._z,this._81,this._91)}_h2(t){return Math.max(0,Math.min(this._y,t))}_i2(t){return Math.max(0,Math.min(this._z,t))}_H2(t){return Math.max(0,Math.min(this._81,t))-this._h2(t)}_I2(t){return Math.max(0,Math.min(this._91,t))-this._i2(t)}}class h{static _3(t=null,e=null){var i=document.createElement("canvas");return null!=t&&(i.width=t,i.height=e),i}static _w(t){return t.getContext("2d",{willReadFrequently:!0})}static _j2(t,e,i=h._K2(t)){var s=h._w(t),_=i._h2(t.width),a=i._i2(t.height),r=i._H2(t.width),n=i._I2(t.height);s.clearRect(_,a,r,n),s.save(),s.globalAlpha=1,h._I1(s),s.fillStyle=e._n(),s.beginPath(),s.fillRect(_,a,r,n),s.restore()}static _02(t,e){var i=e._h2(t.width),s=e._i2(t.height),_=e._H2(t.width),a=e._I2(t.height);h._w(t).clearRect(i,s,_,a)}static _M(t){var e=h._3(t.width,t.height);return h._w(e).drawImage(t,0,0),e}static _J2(t,e){var i,s=e._h2(t.width),_=e._i2(t.height),a=e._H2(t.width),r=e._I2(t.height);return 0==a||0==r?null:(i=h._3(a,r),h._w(i).drawImage(t,s,_,a,r,0,0,a,r),i)}static _k2(t,e){e.width=t.width,e.height=t.height,h._w(e).drawImage(t,0,0)}static _K2(t){return null==t?null:new e(0,0,t.width,t.height)}static _d3(t,e,i=null){null==i&&(i=h._K2(t));var s=h._w(e);s.clearRect(i._66,i._76,i._m8,i._n8),h._I1(s),h._C(t,e,i)}static _C(t,e,i){var s=i._h2(e.width),_=i._i2(e.height),a=i._H2(e.width),r=i._I2(e.height);0!=a&&0!=r&&h._w(e).drawImage(t,s,_,a,r,s,_,a,r)}static _e3(t,e,i){var s=h._w(t).getImageData(e,i,1,1).data;return new _(s[0],s[1],s[2],s[3])}static _86(t,e,i){return 0<=e&&e{t.stopPropagation()}),this}_S4(){return this._l1("click")}_T3(){return this._l1("pointermove")}_6(t,e){return this._1({width:this.m_1(t),height:this.m_1(e)})}_m(t,e){return this._1({left:this.m_1(t),top:this.m_1(e)})}_D(t){return this._1({position:t})}_r(){return this._D("absolute")}m_1(t){return"number"==typeof t?t+"px":t}static _j(t){return o(document.createElementNS("http://www.w3.org/2000/svg",t))}static _4(t,e){for(var i in e)t.setAttribute(i,e[i])}static _9(){return n._f()._1({display:"flex"})}static _f(){return n._3("div")}}function o(t){return new n(t)}class c{static _e6(t){return t.deltaY}static _f6(e){return["user-select"].some(t=>t==e)?["","-moz-","-webkit-","-ms-"]:[""]}static get _x8(){if(null==c.m_0){let e=navigator.userAgent.toLowerCase(),t=["apple","android"];c.m_0=t.some(t=>-1!=e.indexOf(t))}return c.m_0}static get _y8(){return c._x8?.7:.3}static get _z8(){return["apple"].some(t=>-1!=navigator.userAgent.toLowerCase().indexOf(t))}}class i{constructor(){this.m_0=new Array}add(t){this.m_0.push(t)}remove(e){this.m_0=this.m_0.filter(t=>t!=e)}_d(t=null){for(var e of this.m_0)e(t)}}class l{static _g6(t,e){globalThis[t]=e,l.m_0.push(t)}static getData(t){return globalThis[t]}static clear(){for(var t of[...l.m_0])l._g6(t,null)}static set _W(t){l._g6("canvas98",t)}static get _W(){return l.getData("canvas98")}}l.m_0=[];class m{static _b1(i){return new Promise(t=>{let e=new Image;e.onload=()=>{t(e)},e.src=i})}}class s{constructor(){this.canvas=h._3(),this._c1=h._3(),this.background=_._N4,this.opacity=1}_6(t,e){var i=h._M(this.canvas),s=h._3();return s.width=t,s.height=e,h._j2(s,this.background),h._d3(i,s),this._31(s),{undo:()=>{this._31(i)},redo:()=>{this._31(s)}}}_31(t){h._k2(t,this.canvas),h._k2(this.canvas,this._c1)}_U3(t,e){h._l2(this.canvas,t,e),h._l2(this._c1,t,e)}_V3(t){t(this)}_W3(t){t(this)}_E(){this._N2=!0,this._t&&this._t._E()}}class t{get _A8(){return this.m_0()}constructor(t,e=()=>r._S3,i=1,s=t=>t){this.name=t,this.m_0=e,this._R2=i,this.m_1=s}_A1(t){return this.m_1(t)}}t._h6=new t("default"),t._i6=new t("maker",()=>"darken",.5);class u{static _K1(e){return new Promise(t=>{setTimeout(()=>{t()},e)})}}class d{get $(){return this.m_0}get _8(){return this.$._2.textContent}constructor(t,e){this.m_0=n._3("style"),null!=t&&this._p(t,e)}_p(t,e){return this.$._8(this._8+d._C8(t,e)),this}static _B8(t){var e,i=new d;for(e of t)i.$._8(i._8+e._8);return i}static _C8(t,e){var i,s=t+"{";for(i in e)for(var _ of c._f6(i))s+=_+i+":"+e[i]+";";return s+="}"}}class g{static get _j6(){return"--canvas98SelectedColor"}static get _k6(){return g._q(g._j6)}static get _R(){return"canvas98MenuItemSelected"}static get _o2(){return"canvas98MenuItemParent"}static get _j3(){return"--canvas98DefaultColor"}static get _X(){return g._q(g._j3)}static get _l6(){return"--canvas98HighlightedBackground"}static get _V4(){return g._q(g._l6)}static get _a1(){return"--canvas98MenuBackground"}static get _L1(){return g._q(g._a1)}static get _n1(){return"--canvas98MenuColor"}static get _W4(){return"--canvas98PageBackground"}static get _M1(){return g._q(g._n1)}static _q(t){return"var("+t+")"}static get _J(){return"--canvas98MenuDefaultBackground"}static get _S(){return"var(--canvas98Shadow)"}}class v{constructor(t=0,e=0){this.x=t,this.y=e}_X4(t){this.x=t.x,this.y=t.y}set(t,e){return this.x=t,this.y=e,this}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}_V(){return new v(this.x,this.y)}rotate(t){var e=this.x*Math.cos(t)-this.y*Math.sin(t),i=this.x*Math.sin(t)+this.y*Math.cos(t);return this.x=e,this.y=i,this}scale(t){return this.x*=t,this.y*=t,this}_S2(t,e){return this.x+=t.x*e,this.y+=t.y*e,this}add(t){return this._S2(t,1)}_p2(t){return this._S2(t,-1)}_m6(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this}static _Z3(t,e){return Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2))}}class w{static get _F(){return"50px"}static get style(){return(new d)._p(".canvas98MenuItem",{margin:0,"list-style":"none","text-align":"center",cursor:"pointer","user-select":"none",background:g._q(g._a1),color:g._q(g._n1),position:"relative",display:"flex","align-items":"center","justify-content":"center"})._p(".canvas98MenuItem:hover",{[g._a1]:g._V4,[g._n1]:g._X})._p(".canvas98MenuItemSelected",{[g._a1]:g._V4,[g._n1]:g._k6})._p(".canvas98MenuItemSelected:hover",{[g._a1]:g._V4,[g._n1]:g._k6})._p(".canvas98MenuItem.material-icons",{width:w._F,height:w._F,"font-size":"26px"})._p(".canvas98VerticalMenu .canvas98MenuItem",{width:w._F,height:"45px"})}static _m2(t,e){for(var i of e)i._7=!1;t._7=!0}get _m1(){return this.m_2}get _h3(){return this.m_3}get _i3(){return this.m_4}get _2(){return this.$._2}get $(){return this.m_1}get _T4(){return this.m_0}set _7(t){t?this.$._a(g._R):this.$._32(g._R),null!=this._T4&&(this._T4._U4=this._7),this._m1._d()}get _7(){return this.$._d6(g._R)}constructor(t=n._3("li")){this.m_2=new i,this.m_3=new i,this.m_4=new i,this.m_1=t._a("canvas98MenuItem").click(()=>{(this._7?this._i3:this._h3)._d()})}static _O2(){return n._j("svg")._4({width:"47",height:"47",viewBox:"-25, -25, 50, 50"})._1({"vertical-align":"middle"})}_k(t,e){return this.$._a("material-icons")._4({title:e})._8(t),this}_P2(){return this.m_0=new p,this.m_0._U4=!1,w._O2()._r()._1({bottom:0,right:0}).append(this._T4.$)._0(this.$),this}static _X3(){return n._3("ul")._a(g._o2)}}(class extends w{});class p{get $(){return this.m_0}set _U4(t){this.m_1=t,this.m_0._5(t)}get _U4(){return this.m_1}constructor(){this.m_0=n._j("polygon")._4({points:"20, 20 13, 20 20, 13",fill:g._M1})}}class f{static _p5(t){var e={layers:[]};return e.layers=t.map(t=>f._s3(t)),JSON.stringify(e)}static _s3(t){return{data:t.canvas.toDataURL(),background:t.background._n(),opacity:t.opacity,blendingMode:t.blendingMode}}static _g4(i){return new Promise(async t=>{var e=i.layers.map(i=>m._b1(i.data).then(t=>{var e=new s;return e._31(h._M(t)),e.background=f._77(i.background),e.opacity=null==i.opacity?1:i.opacity,e.blendingMode=i.blendingMode,e}));t(await Promise.all(e))})}static _77(t){var e;return null!=t&&(e=t.match(/^rgba\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\,\s*(\d+)\s*\)$/i))?new _(parseInt(e[1]),parseInt(e[2]),parseInt(e[3]),Math.round(255*parseFloat(e[4]))):_._N4}}(class extends s{});class y{get $(){return this.m_7}get _2(){return this.$._2}constructor(t,e){this.m_2=[],this.m_0=new S("%E3%82%A2%E3%83%AB%E3%83%90%E3%83%A0"),this._G=e,this._N=t,this.m_h(),this.m_f()}async m_f(){var t,e=await this._N._W6();e.reverse();for(t of e){var i=await this._N._q9(t);this.add(i)}}m_g(){return(new d)._p(".canvas98MenuItem:disabled",{opacity:.2,[g._a1]:g._q(g._J),[g._n1]:g._q(g._j3),cursor:"default"})._p(".canvas98FileItem",{"box-shadow":g._S})._p(".canvas98FileItem:hover",{"box-shadow":"0px 0px 8px "+_._a6._n(.5)}).$}m_h(){this.m_7=this.m_i();var t=this.m_g(),e=(this.$.append(t),n._9()._6("calc(100% - 300px)","calc(100% - 300px)")._1({background:"yellow","flex-direction":"column",position:"absolute"})._0(this.$)),i=n._9()._1({background:g._q(g._J),"box-shadow":g._S,"z-index":1,"flex-direction":"column"})._0(e);this.m_j(i),this.m_1=n._9()._0(i),this.m_3=n._3("div")._6("100%","100%")._1({background:_._b6._n(),position:"relative"})._0(e),this.m_0.$._0(this.m_3)}m_i(){return class{static _3(){let e=n._3("div")._1({position:"fixed",background:"rgba(0, 0, 0, 0.5)",display:"flex","justify-content":"center","align-items":"center"})._m(0,0)._6("100%","100%").click(t=>{t.target==e._2&&e.remove()});return e}}._3()._4({id:"canvas98AlbumDialog"})}m_j(t){var e=new x;e._K6=()=>{this.m_p()},e._L6=t=>{this.m_t(t)},e._M6=async()=>{var t=await this.m_s();this.m_4("%E3%81%AF%E3%81%A3%E3%81%A1%E3%82%83%E3%82%93%E3%82%A2%E3%83%AB%E3%83%90%E3%83%A0%E3%83%87%E3%83%BC%E3%82%BF.html",t)},e._N6=async t=>{await this.m_l(t)},e._O6=()=>{this.m_k()},e._q3=async()=>{for(var t of this.m_0._t9)t._q3(),await u._K1(1e3)},e.$._0(t),this.$.click(()=>{e._k9()})}async m_k(){if(confirm("%E4%BD%9C%E5%93%81%E3%82%92%E3%81%99%E3%81%B9%E3%81%A6%E5%89%8A%E9%99%A4%E3%81%97%E3%81%BE%E3%81%99%E3%80%82%E3%82%88%E3%82%8D%E3%81%97%E3%81%84%E3%81%A7%E3%81%99%E3%81%8B%EF%BC%9F")&&confirm("%E3%81%93%E3%81%AE%E6%93%8D%E4%BD%9C%E3%81%AF%E5%8F%96%E3%82%8A%E6%B6%88%E3%81%9B%E3%81%BE%E3%81%9B%E3%82%93%E3%80%82%E3%82%A2%E3%83%AB%E3%83%90%E3%83%A0%E3%81%AE%E4%BD%9C%E5%93%81%E3%83%87%E3%83%BC%E3%82%BF%E3%81%AF%E3%81%99%E3%81%B9%E3%81%A6%E5%A4%B1%E3%82%8F%E3%82%8C%E3%81%BE%E3%81%99%E3%80%82%E7%B6%9A%E8%A1%8C%E3%81%97%E3%81%BE%E3%81%99%E3%81%8B%EF%BC%9F")){for(var t of await this._N._W6())await this._N.remove(t);this.m_0._w9()}}m_4(t,e){var i=document.createElement("a");i.href=e,i.download=t,i.click()}async m_l(t){0==this.m_1._2.childElementCount&&(this.m_0._84._0(this.m_1).click(()=>{this.m_5(this.m_0)}),this.m_2.push(this.m_0)),await this.m_m(t)}m_5(t){S._x9(this.m_2,t)}async m_m(t){let e=new S(t.name);e._84._0(this.m_1).click(()=>{this.m_5(e)}),this.m_2.push(e),this.m_5(e),e.$._0(this.m_3);var i,s=await this.m_8(t);for(i of b._J6(s).reverse())await this.m_n(i,e)}async m_8(t){return new Promise(e=>{let i=new FileReader;i.onload=()=>{var t=i.result;e(t)},i.readAsText(t)})}async m_n(e,t){var i=await m._b1(e.thumbnail),s=(await u._K1(0),new M(e.dateTime,i));s._n9(),this._G._r4(s._t2,async()=>{await this.m_c(e.content)}),s._t2.click(()=>{this.m_a(e.content)}),s._U6=async()=>{var t=await this._N.add(e.content,e.dateTime,e.thumbnail);this.m_d(t),this.m_6(t),this.m_0._u9()},t.add(s)}m_9(){return null!=this._G.ui.$._2.querySelector("#canvas98LayerButton")}async%20m_a(t){let%20e=await%20this._j5._g4(JSON.parse(t));1e,e[0]),this.m_b())}m_b(){this.$.remove()}async%20m_c(t){let%20e=await%20this._j5._g4(JSON.parse(t));1this.m_o(e),e[0]),this.m_b())}m_o(t){var%20e=this._G.layers.layers,i=e[0].canvas,s=t[0].canvas;if(s.width!=i.width||s.height!=i.height)for(var%20_%20of%20t)_._6(i.width,i.height);return%20e.concat(t)}async%20m_d(t){var%20e=await%20m._b1(t.thumbnail);this._N._X6(t.id,t.dateTime,this.m_q(e))}get%20_j5(){var%20t=this._G._33._u5;return%20t||f}async%20m_p(){var%20t=this._j5._p5(this._G.layers.layers),e=await%20this._N.add(t,new%20Date,this._G.layers._P.toDataURL());this._N._X6(e.id,e.dateTime,this.m_r(this._G.layers._P)),this.m_6(e)}m_q(t){return%20h._M(t).toDataURL()}m_r(t){var%20e=Math.min(t.width,150)/t.width,i=Math.min(t.height,150)/t.height,s=Math.min(e,i),_=h._M(t);return%20this._G._43._u2(_,s).toDataURL()}async%20m_s(){return%20new%20Promise(async%20t=>{var%20e=await%20this._N._p9(),i=new%20Blob([b._I6(e)],{type:"text/html"});t(URL.createObjectURL(i))})}async%20m_t(t){var%20e,i=await%20this.m_8(t);for(e%20of%20b._J6(i)){var%20s=await%20this._N.add(e.content,e.dateTime,e.thumbnail);this.m_d(s),this.m_6(s)}}m_e(s){return%20new%20Promise(async%20t=>{var%20e=await%20m._b1(s.thumbnail),i=new%20M(s.dateTime,e);this._G._r4(i._t2,async()=>{var%20t=await%20this._N.get(s.id);await%20this.m_c(t.content)}),i._t2.click(async()=>{var%20t=await%20this._N.get(s.id);await%20this.m_a(t.content)}),i._R6=()=>{confirm("%E4%BD%9C%E5%93%81%E3%82%92%E5%89%8A%E9%99%A4%E3%81%97%E3%81%BE%E3%81%99%E3%80%82%E3%82%88%E3%82%8D%E3%81%97%E3%81%84%E3%81%A7%E3%81%99%E3%81%8B%EF%BC%9F")&&(this._N.remove(s.id),i._S6())},i._T6=()=>{this.m_u(s.id,s.dateTime)},i._q3=async()=>{var%20t=(await%20this._N.get(s.id)).thumbnail;this.m_4(M._V6(s.dateTime)+".png",t)},t(i)})}async%20m_u(t,e){var%20i=await%20this._N.get(t),s="data:text/html,"+b._I6([{id:t,content:i.content,dateTime:i.dateTime,thumbnail:i.thumbnail}]);this.m_4("%E3%81%AF%E3%81%A3%E3%81%A1%E3%82%83%E3%82%93%E4%BD%9C%E5%93%81%E3%83%87%E3%83%BC%E3%82%BF_"+M._V6(e)+".html",s)}async%20add(t){var%20e=await%20this.m_e(t);this.m_0.add(e)}async%20m_6(t){var%20e=await%20this.m_e(t);this.m_0._v9(e)}}class%20b{static%20_I6(t){var%20e,i=n._3("div"),s=n._3("div")._0(i),_=n._3("div")._0(s)._1({position:"absolute",left:0,top:0,"overflow-y":"scroll",display:"flex","flex-wrap":"wrap",background:"#FFFFEE",width:"100%",height:"100%"});for(e%20of%20t){var%20a=new%20Image;a.src=e.thumbnail,a.title=e.dateTime.toLocaleString(),o(a)._0(_)._1({margin:"5px","box-shadow":"2px%202px%204px%20rgba(0,%200,%200,%200.1)","object-fit":"scale-down"})._4({canvas98Content:e.content})}return%20n._3("div")._0(s)._1({visibility:"hidden"})._a("signature")._8(b._j9(t)),i._2.innerHTML}static%20_j9(t){var%20e=new%20I(32);return%20e._r9(["This%20is%20an%20exported%20album%20file%20of%20canvas98."].concat(t.map(t=>t.content)).reduce((t,e)=>t+e)),e._s9()}static%20_J6(t){var%20e,i=[];for(e%20of%20o(t)._2.querySelectorAll("img")){var%20s,_=e.getAttribute("canvas98Content");null!=_&&(s={id:null,content:_,dateTime:new%20Date(e.title),thumbnail:e.src},i.push(s))}return%20i}}(class{static%20async%20run(t){await%20u._K1(0);var%20e=globalThis.canvas98Loaded;e&&(await%20e,t())}}).run(()=>class%20s{static%20async%20run(){console.log("album");var%20t,e,i=l._W;s._B1||(t=await%20k._o9(),e=new%20y(t,i),i.ui.$.append(e._2))}static%20get%20_B1(){return%20null!=document.getElementById("canvas98AlbumDialog")}}.run());class%20x{get%20$(){return%20this.m_1}constructor(){this.m_2=()=>{},this._K6=()=>{},this._L6=t=>{},this._M6=()=>{},this._N6=async%20t=>{},this._q3=()=>{},this._O6=()=>{};var%20t=n._3("div")._1({background:g._q(g._J),"z-index":1,display:"flex","justify-content":"space-between"}),e=(this.m_1=t,n._3("button")._8("save")._1({width:"50px",height:"50px",border:"0",outline:"0"})._a("canvas98MenuItem%20material-icons").on("click",t=>{e.disabled||(this._K6(),e.disabled=!0)})._4({title:"%E4%BF%9D%E5%AD%98"})._2);t.append(e),this.m_3(t)}m_3(t){var%20e=n._3("div")._1({position:"relative"})._0(t),i=(n._3("div")._8("more_vert")._1({width:"50px",height:"50px",padding:"0"})._a("canvas98MenuItem%20material-icons")._0(e).click(t=>{i=!i,s._5(i),t.stopPropagation()}),!1),s=(this.m_2=()=>{i=!1,s._5(i)},n._3("div")._1({position:"absolute",right:"0",width:"300px","box-shadow":g._S})._0(e)._5(i)),_=(this.m_4(s),n._3("label")._0(s)),a=n._3("input")._4({type:"file",accept:"text/html",multiple:"multiple"})._1({width:0,height:0,overflow:"hidden",position:"absolute"})._0(_).on("change",()=>{for(var%20t%20of%20a.files)this._L6(t)})._2;this.m_0("%E3%82%A4%E3%83%B3%E3%83%9D%E3%83%BC%E3%83%88")._0(_),this.m_0("%E3%82%A8%E3%82%AF%E3%82%B9%E3%83%9D%E3%83%BC%E3%83%88")._0(s).click(()=>{this._M6()}),this.m_0("%E3%81%99%E3%81%B9%E3%81%A6%E7%94%BB%E5%83%8F%E3%81%A8%E3%81%97%E3%81%A6%E4%BF%9D%E5%AD%98")._0(s).click(()=>{this._q3()}),this.m_0("%E3%81%99%E3%81%B9%E3%81%A6%E5%89%8A%E9%99%A4")._0(s).click(()=>{this._O6()})}m_0(t){return%20n._3("div")._a("canvas98MenuItem")._1({"font-size":"16px",height:"50px","justify-content":"flex-start","padding-left":"20px"})._8(t)}m_4(t){var%20e=n._3("label")._0(t),i=n._3("input")._4({type:"file",accept:"text/html",multiple:"multiple"})._1({width:0,height:0,overflow:"hidden",position:"absolute"})._0(e).on("change",async()=>{for(var%20t%20of%20i.files)await%20this._N6(t)})._2;n._3("div")._0(e)._a("canvas98MenuItem")._1({"font-size":"16px",height:"50px","justify-content":"flex-start","padding-left":"20px"})._8("%E9%96%8B%E3%81%8F")}_k9(){this.m_2()}}class%20M{get%20$(){return%20this.m_0}get%20_k5(){return%20this.m_1}get%20_l9(){return%20this.m_2}get%20_m9(){return%20this.m_3}get%20_t2(){return%20this.m_4}constructor(t,e){this._P6=150,this._Q6=150,this._R6=()=>{},this._S6=()=>{},this._T6=()=>{},this._U6=()=>{},this._q3=()=>{};var%20i=n._3("div")._1({margin:"10px",position:"relative",overflow:"hidden",padding:0,"border-radius":"5px"})._a("canvas98FileItem"),s=(this.m_0=i,n._3("div")._1({width:this._P6+"px",height:this._Q6+"px",overflow:"hidden",display:"flex","justify-content":"center","align-items":"center",cursor:"pointer"})._0(i)._4({title:t.toLocaleString()})),_=(this.m_4=s,e),a=Math.min(this._P6/_.width,this._Q6/_.height);_.style.transform="scale("+a+")",s.append(_),this.m_5()}m_5(){var%20t=n._3("div")._0(this.$)._1({display:"flex","justify-content":"flex-end",background:g._q(g._J)}),e=n._3("a")._0(t)._a("canvas98MenuItem%20material-icons")._1({"font-size":"16px",width:"40px",height:"40px","border-radius":"20px",padding:"0","text-decoration":"none"})._8("save_alt")._4({title:"%E3%83%95%E3%82%A1%E3%82%A4%E3%83%AB%E3%81%AB%E4%BF%9D%E5%AD%98"}).click(()=>{this._T6()});this.m_2=e,this.m_1=n._3("div")._1({width:"40px",height:"40px","border-radius":"20px",padding:"0"})._a("canvas98MenuItem%20material-icons")._8("delete")._4({title:"%E5%89%8A%E9%99%A4"}).click(t=>{this._R6(),t.stopPropagation()})._0(t),this.m_3=n._3("div")._1({width:"40px",height:"40px","border-radius":"20px",padding:"0",display:"none"})._a("canvas98MenuItem%20material-icons")._8("unarchive")._4({title:"%E3%82%A2%E3%83%AB%E3%83%90%E3%83%A0%E3%81%AB%E8%BF%BD%E5%8A%A0"}).click(t=>{this._U6(),t.stopPropagation()})._0(t)}static%20_V6(t){var%20e="";return(e+=t.getFullYear()+"-")+(t.getMonth()+1+"-")+(t.getDate()+"%20")+(t.getHours()+"-")+(t.getMinutes()+"-")+t.getSeconds()}_n9(){this._k5._1({display:"none"}),this._l9._1({display:"none"}),this._m9._1({display:""})}}class%20k{static%20_o9(){return%20new%20Promise((t,e)=>{let%20i=new%20k(()=>{t(i)})})}constructor(e=()=>{}){this.m_1="works",this.m_2="thumbnails_150",this.m_0=null;var%20i=window.indexedDB.open("canvas98Works2",1);i.onerror=()=>{console.log("error")},i.onupgradeneeded=t=>{console.log("upgrade"),this.m_0=i.result,this.m_0.objectStoreNames.contains(this.m_1)||this.m_0.createObjectStore(this.m_1,{keyPath:"id",autoIncrement:!0}),this.m_0.objectStoreNames.contains(this.m_2)||this.m_0.createObjectStore(this.m_2,{keyPath:"id"})},i.onsuccess=t=>{console.log("success"),this.m_0=i.result,console.log(this.m_0.objectStoreNames),e()}}add(s,_,a){return%20new%20Promise(e=>{var%20i={content:s,dateTime:_,thumbnail:a},t=this.m_0.transaction([this.m_1],"readwrite").objectStore(this.m_1).add(i);t.onsuccess=t=>{e({id:t.target.result,content:i.content,dateTime:i.dateTime,thumbnail:a})},t.onerror=t=>{console.log("error")}})}get(t){return%20new%20Promise(e=>{var%20i=this.m_0.transaction([this.m_1]).objectStore(this.m_1).get(t);i.onsuccess=t=>{e(i.result)}})}_p9(){return%20new%20Promise(t=>{let%20e=this.m_0.transaction([this.m_1]).objectStore(this.m_1).getAll();e.onsuccess=()=>{t(e.result)}})}_W6(){return%20new%20Promise(e=>{var%20i=this.m_0.transaction([this.m_2]).objectStore(this.m_2).getAllKeys();i.onsuccess=t=>{e(i.result.map(t=>t))}})}remove(t){var%20e=this.m_0.transaction([this.m_1,this.m_2],"readwrite");e.objectStore(this.m_1).delete(t),e.objectStore(this.m_2).delete(t)}_X6(t,e,i){var%20s={id:t,dateTime:e,thumbnail:i};this.m_0.transaction([this.m_2],"readwrite").objectStore(this.m_2).add(s)}_q9(t){return%20new%20Promise(e=>{var%20i=this.m_0.transaction([this.m_2]).objectStore(this.m_2).get(t);i.onsuccess=t=>{e(i.result)}})}}class%20I{get%20length(){return%20this.values.length}constructor(e){this.values=[];for(let%20t=this.index=0;t{this.m_0=0,this.m_1._8(t)._4({title:t})});this.m_1=e,this.m_4=n._9()._6("100%","100%")._m(0,0)._1({"flex-wrap":"wrap","align-items":"flex-start","overflow-y":"auto","-webkit-overflow-scrolling":"touch",position:"absolute",outline:"none"})._4({tabindex:0}).on("keydown",t=>{"ArrowDown"==t.key&&this.$._2.scrollBy(0,30),"ArrowUp"==t.key&&this.$._2.scrollBy(0,-30)}),this.m_6()}m_6(){var%20i=!1,s=null;this.$._h(t=>{s=t.offsetY,i=!0})._o(t=>{var%20e;i&&(e=t.offsetY-s,this.$._2.scrollBy(0,-e),s=t.offsetY)})._b(t=>{i=!1})}m_7(t){return%20n._3("div")._a("canvas98MenuItem")._6(240,50)._1({"font-size":"16px"})._8(t)._4({title:t})}_u9(){this.m_0++,this.m_1._8(this.m_3+"%20("+this.m_0+")")._4({title:this.m_3+"%20("+this.m_0+")"})}add(t){this.$._2.appendChild(t.$._2),this.m_5(t)}m_5(t){t._S6=()=>{this.remove(t)},this.m_2.add(t)}remove(t){t.$.remove(),this.m_2.delete(t)}_v9(t){this.$._2.insertBefore(t.$._2,this.$._2.firstChild),this.m_5(t)}_w9(){for(var%20t%20of[...this.m_2.values()])this.remove(t)}static%20_x9(t,e){this.m_9(t),e.$._5(!0),this.m_8(t,e._84)}static%20m_8(t,e){for(var%20i%20of%20t)i._84._32(g._R);e._a(g._R)}static%20m_9(t){for(var%20e%20of%20t)e.$._5(!1)}}})();}