From 81fc215eb6314a96bcb654c4fe5b7efe9617ca09 Mon Sep 17 00:00:00 2001 From: michaelsboost Date: Mon, 5 Aug 2024 16:30:11 -0500 Subject: [PATCH] performance improvements --- go/.DS_Store | Bin 10244 -> 6148 bytes go/dist/App.js | 80 ++++++++++++++++++++++----------------------- go/dist/App.js.map | 6 ++-- go/index.html | 2 +- go/src/App.js | 44 +++++++++++++++++++------ 5 files changed, 78 insertions(+), 54 deletions(-) diff --git a/go/.DS_Store b/go/.DS_Store index 580e2be0112b37f27928324ba8eac318ab9548e7..04f3b3040bda60d48ded5af5005e15471ff15500 100644 GIT binary patch delta 105 zcmZn(XfcprU|?W$DortDU=RQ@Ie-{Mvv5r;6q~50$jGrVU^g=($7UXZ^Gur=Wpo%9 rvvY6=G6R(WfdDs(44dP5<}d>QbNUb9 literal 10244 zcmeHMYitx%6h3EKV1^EK3gzKS*@dbo6xvc+sGw|LXn8i>z9`6cc4wp`vomF8b_-Ut z>Mte4S2V_`iNBPnm>4zqi2g7r`okZB4~+4LQDcm+MB^`ic<$U;Qns{^fFN;ha_^aY z?m2hv`R+OQF#`bDoYiUpVgMjgW>k@>I7?#fERRb8J&#sfOaslRkk;a>rW78Bb~ z^sKN4qOpL+13JnnwNOH?N|dW&aK%8bPW)IP7Z2ztr(7K{xO`ynW(;m9=)ax%kNM(& zaZbZBL?A?9JOb?QUJM!-;DR^y{+=2#4cDuw`5c9!;we+7iPOXq@wUXEJ)H1VFY7j| z&JI@VvTZY!e^ygHhCZBB%3Ey9Qw>XZd<8?(Nn~fQVQKbovz@gx*Vj$(22m2Fq%wbG zq;XYkRji?A^?|C`NaM z&jbk^RRw#{tD za+69~S~b&IQ}y&F(@Yq5>clH`(~fPL9ky$*ZnpP%`aX}fjce-bcWuXO@jL4?sDCb{ zWL>>er%sKW-b!7&<;=P<38f=5=Pg)t?b7O1jW;!K*tqp%sZuseE|=%_<_yax^~esY#lRyzNxNTe^DGWKQ-Z@*G0ioCCd zk(i{sF7DLm{ab8}X=;8;WMSkQQQX1!EsjnlXUj_>H%N*qcDZCI@1jaxAt|oZwTIR} zu39VCiHat5n`%loIjcclBPyGu-WvK+{IqJS#`Z_ zL%Nk8()vi7DE7O9s-tfkrqwsE(JqSq5-DW8eT{Dk;eR>o_1U7{0R1+0Wt*bD=-4voMe zcoLq2*Weg@0H47(@B{n|e<7lPQ*bJlU^!M`6l1sum*O&9jw^62wqhG@z)swOJ8>5# zQNs*cID~sKhxgzp-iP<&1NbODhL7VD_$)q;FW_N(72n2p@LhZlKfy2XOFV_&;V<|r z{wAO>T__jk2y=y~5EB*)l|qBCT8InnLZ{Fx4Dg`~`Q4>IZ(6`tiB1+=!Pjr$$k~G{ zddsct8#i4!!F6gT3#ZxTbLP&Au^3x(Q`2c@Qo9GUR_odjVc1gE3eknMrEal zqEYg7>#L}WL8b9VSyqZEE_vI{6;y?w(%eGbuqYERmcO5ZZ{bJy9sVYNpNX?^J}$u; zY`}Ho-CMB(6WE2_kKWX6OWxhC$-%B+aC37^Yp?B&yQ> z%w+cXJGBnIB%?x(%Ib5BX=^a138Qf`{em+?84S@|(=-Z|PKP=y_s7QSE8q?qpAFV! zMB)5Km&fBgqzRcKvdV$|Xq!xSPAA}}EWMZ6`(zW=vP{QrMK z{jecKAVlEGM*xdk6Rpi;NB-JVXcGI@9-}-!nI$GS%BinH#Th>WsKP$SUr(9I1{XsA dIUevvIrY^^##bkLiGBuz_y6$z|3AO~{{s|30~7!N diff --git a/go/dist/App.js b/go/dist/App.js index e1bede69..f95ccd6d 100644 --- a/go/dist/App.js +++ b/go/dist/App.js @@ -1,4 +1,4 @@ -(()=>{var ae=(t=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(t,{get:(s,r)=>(typeof require<"u"?require:s)[r]}):t)(function(t){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+t+'" is not supported')});function X(t,s,r=[]){function o(i,n){return typeof i!="object"||i===null?i:new Proxy(i,{set(c,a,p){let l=[...n,a],x=c[a],j=Reflect.set(c,a,o(p,l));return x!==p&&s(l,x,p),j},get(c,a){let p=c[a];return typeof p=="object"&&p!==null?o(p,[...n,a]):p}})}return o(t,r)}var P={name:"kodeWeave",author:{name:"Michael Schwartz",href:"https://michaelsboost.com/",src:"imgs/author.jpg"},version:"1.2",url:"https://michaelsboost.com/kodeWeave/",license:"https://github.com/michaelsboost/kodeWeave/blob/main/LICENSE"},le={name:"App name",version:.01,title:"An attractive title",description:"The most attractive description ever!",author:"kodeWeave",url:"https://michaelsboost.com/",meta:"",libraries:[],html_pre_processor:"html",css_pre_processor:"css",javascript_pre_processor:"javascript",html:"",css:"",javascript:"",logo:"data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWxvbmU9Im5vIj8+CjxzdmcKICAgeG1sbnM6ZGM9Imh0dHA6Ly9wdXJsLm9yZy9kYy9lbGVtZW50cy8xLjEvIgogICB4bWxuczpjYz0iaHR0cDovL2NyZWF0aXZlY29tbW9ucy5vcmcvbnMjIgogICB4bWxuczpyZGY9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkvMDIvMjItcmRmLXN5bnRheC1ucyMiCiAgIHhtbG5zOnN2Zz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciCiAgIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIKICAgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiCiAgIHZpZXdCb3g9IjAgMCA1MTEuOTk5OTkgNTExLjk5OTk5IgogICBoZWlnaHQ9IjUxMiIKICAgd2lkdGg9IjUxMiIKICAgdmVyc2lvbj0iMS4xIgogICBpZD0ic3ZnNDE5MCI+CiAgPG1ldGFkYXRhCiAgICAgaWQ9Im1ldGFkYXRhNDE5NiI+CiAgICA8cmRmOlJERj4KICAgICAgPGNjOldvcmsKICAgICAgICAgcmRmOmFib3V0PSIiPgogICAgICAgIDxkYz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EwLjA2MDE5MSAtMzUuMDY0MTMsLTI1Ljk1MDI3NiAtMzkuOTA2MTIsLTI2Ljg1ODkzNCAtMi45NDE1NCwtMC41NTIwMSAtMy45NzUxOSwtMC4yNDY3ODggLTUuOTE3NjYsMS43NDIyMDEgLTEuMjk1NjQsMS4zMjY2NDggLTIwLjM1MDEyLDMyLjM0ODMwMyAtNDIuMzQwNDgsNjguOTM1NzIzIC0yMS45OTAzNiwzNi41ODc0IC00MS4wNjUzOSw2Ny45OTE2NyAtNDIuMzg2NjUsNjkuNzg3MDIgLTIuNjE5NTQsMy41NTkzNyAtNi43MzI4MSw2LjA5MzA2IC04LjczNDYzLDUuMzc4MzggLTAuOTk5NDcsLTAuMzU2ODMgLTEuMjY2NjUsLTE4LjE3MDM1IC0xLjI2NjY1LC04NC40NDM5NCAwLC00OS41MTMxOTYgLTAuMzc4NjQsLTg0LjIxOTIyNiAtMC45MjM2LC04NC41NTYxMzggLTAuMTE5ODQsLTAuMDc0MSAtMC41MzYwMSwtMC4xMDI0NDYgLTEuMTg3NDgsLTAuMDkyMzggeiIKICAgICAgIGlkPSJwYXRoNDI2MCIgLz4KICA8L2c+Cjwvc3ZnPgo=",console:!1,dark:!0,diffing:!1,module:!0,autorun:!0,pwa:!1,activePanel:"html",columns:!0,columnsRight:!0},ce={searchLibKey:null,librarySuggestions:null,iframeSize:null,activePanel:"html",selectedSize:"none",compiledJSX:null,menuDialog:null,settings:null,libraries:null,safeRender:null,demos:null},d=function(){let t="h-4 w-4",s="h-3 w-3",r="h-4 w-4",o="h-3 w-3",i="h-3 -mt-1";return{logo:`{var ae=(t=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(t,{get:(s,r)=>(typeof require<"u"?require:s)[r]}):t)(function(t){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+t+'" is not supported')});function X(t,s,r=[]){function o(i,n){return typeof i!="object"||i===null?i:new Proxy(i,{set(c,a,p){let l=[...n,a],x=c[a],M=Reflect.set(c,a,o(p,l));return x!==p&&s(l,x,p),M},get(c,a){let p=c[a];return typeof p=="object"&&p!==null?o(p,[...n,a]):p}})}return o(t,r)}var H={name:"kodeWeave",author:{name:"Michael Schwartz",href:"https://michaelsboost.com/",src:"imgs/author.jpg"},version:"1.2",url:"https://michaelsboost.com/kodeWeave/",license:"https://github.com/michaelsboost/kodeWeave/blob/main/LICENSE"},le={name:"App name",version:.01,title:"An attractive title",description:"The most attractive description ever!",author:"kodeWeave",url:"https://michaelsboost.com/",meta:"",libraries:[],html_pre_processor:"html",css_pre_processor:"css",javascript_pre_processor:"javascript",html:"",css:"",javascript:"",logo:"data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWxvbmU9Im5vIj8+CjxzdmcKICAgeG1sbnM6ZGM9Imh0dHA6Ly9wdXJsLm9yZy9kYy9lbGVtZW50cy8xLjEvIgogICB4bWxuczpjYz0iaHR0cDovL2NyZWF0aXZlY29tbW9ucy5vcmcvbnMjIgogICB4bWxuczpyZGY9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkvMDIvMjItcmRmLXN5bnRheC1ucyMiCiAgIHhtbG5zOnN2Zz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciCiAgIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIKICAgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiCiAgIHZpZXdCb3g9IjAgMCA1MTEuOTk5OTkgNTExLjk5OTk5IgogICBoZWlnaHQ9IjUxMiIKICAgd2lkdGg9IjUxMiIKICAgdmVyc2lvbj0iMS4xIgogICBpZD0ic3ZnNDE5MCI+CiAgPG1ldGFkYXRhCiAgICAgaWQ9Im1ldGFkYXRhNDE5NiI+CiAgICA8cmRmOlJERj4KICAgICAgPGNjOldvcmsKICAgICAgICAgcmRmOmFib3V0PSIiPgogICAgICAgIDxkYzpmb3JtYXQ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MSAtMzUuMDY0MTMsLTI1Ljk1MDI3NiAtMzkuOTA2MTIsLTI2Ljg1ODkzNCAtMi45NDE1NCwtMC41NTIwMSAtMy45NzUxOSwtMC4yNDY3ODggLTUuOTE3NjYsMS43NDIyMDEgLTEuMjk1NjQsMS4zMjY2NDggLTIwLjM1MDEyLDMyLjM0ODMwMyAtNDIuMzQwNDgsNjguOTM1NzIzIC0yMS45OTAzNiwzNi41ODc0IC00MS4wNjUzOSw2Ny45OTE2NyAtNDIuMzg2NjUsNjkuNzg3MDIgLTIuNjE5NTQsMy41NTkzNyAtNi43MzI4MSw2LjA5MzA2IC04LjczNDYzLDUuMzc4MzggLTAuOTk5NDcsLTAuMzU2ODMgLTEuMjY2NjUsLTE4LjE3MDM1IC0xLjI2NjY1LC04NC40NDM5NCAwLC00OS41MTMxOTYgLTAuMzc4NjQsLTg0LjIxOTIyNiAtMC45MjM2LC04NC41NTYxMzggLTAuMTE5ODQsLTAuMDc0MSAtMC41MzYwMSwtMC4xMDI0NDYgLTEuMTg3NDgsLTAuMDkyMzggeiIKICAgICAgIGlkPSJwYXRoNDI2MCIgLz4KICA8L2c+Cjwvc3ZnPgo=",console:!1,dark:!0,diffing:!1,module:!0,autorun:!0,pwa:!1,activePanel:"html",columns:!0,columnsRight:!0},ce={searchLibKey:null,librarySuggestions:null,iframeSize:null,activePanel:"html",selectedSize:"none",compiledJSX:null,menuDialog:null,settings:null,libraries:null,safeRender:null,demos:null},d=function(){let t="h-4 w-4",s="h-3 w-3",r="h-4 w-4",o="h-3 w-3",i="h-3 -mt-1";return{logo:` `,cursor:` - `}}(),e=X(le,(t,s,r)=>{let i=document.getElementById("iframe").contentWindow.document;if(s!==r&&(localStorage.setItem("kodeWeave",JSON.stringify(e)),k.render("#app"),t.toString()==="activePanel"&&(e.activePanel==="html"&&setActiveEditor(editorManager.htmlEditor),e.activePanel==="css"&&setActiveEditor(editorManager.cssEditor),e.activePanel==="javascript"&&setActiveEditor(editorManager.javascriptEditor)),!k.initialRender)){let n=["title","description","author","meta","libraries","html","css","console","dark"],c=["html_pre_processor","css_pre_processor","javascript_pre_processor","javascript"],a=t.toString();if(n.includes(a)&&(e.autorun&&(e.diffing?y():a!=="css"&&y(!0)),a==="html"&&editorManager.htmlEditor.state.doc.toString()!==e.html&&dispatchChanges(editorManager.htmlEditor,e.html),a==="css"||a==="console")){let p=` + `}}(),e=X(le,(t,s,r)=>{let i=document.getElementById("iframe").contentWindow.document;if(s!==r){if(localStorage.setItem("kodeWeave",JSON.stringify(e)),j.render("#app"),t.toString()==="activePanel"){if(!window.editorManager)return;e.activePanel==="html"&&setActiveEditor(editorManager.htmlEditor),e.activePanel==="css"&&setActiveEditor(editorManager.cssEditor),e.activePanel==="javascript"&&setActiveEditor(editorManager.javascriptEditor)}if(!j.initialRender){let n=["title","description","author","meta","libraries","html","css","console","dark"],c=["html_pre_processor","css_pre_processor","javascript_pre_processor","javascript"],a=t.toString();if(n.includes(a)){if(e.autorun&&(e.diffing?y():a!=="css"&&y(!0)),a==="html"){if(!window.editorManager)return;window.editorManager.htmlEditor.state.doc.toString()!==e.html&&dispatchChanges(editorManager.htmlEditor,e.html)}if(a==="css"||a==="console"){let p=` .wrapper_yOR7u { ${e.console?"":"display: none!important;"} left: 0!important; width: 100%!important; @@ -183,7 +183,7 @@ background: inherit!important; } - ${e.css}`;i.getElementById("cuxjju3ew").textContent=p,a==="css"&&editorManager.cssEditor.state.doc.toString()!==e.css&&dispatchChanges(editorManager.cssEditor,e.css)}if(c.includes(a)){if(a==="javascript"&&(y(!0),editorManager.jsEditor.state.doc.toString()!==e.javascript))return dispatchChanges(editorManager.jsEditor,e.javascript),!1;(a==="html_pre_processor"||a==="css_pre_processor"||a==="javascript_pre_processor")&&y(!0)}a==="dark"&&(k.render("#app"),document.documentElement.setAttribute("data-theme",e.dark?"dark":"light"),document.querySelector("meta[name=apple-mobile-web-app-status-bar-style]").setAttribute("content",e.dark?"black-translucent":"default"),document.querySelector("meta[name=theme-color]").setAttribute("content",e.dark?"#13171f":"#ffffff"),document.querySelector("meta[name=msapplication-navbutton-color]").setAttribute("content",e.dark?"#13171f":"#ffffff"))}}),g=X(ce,(t,s,r)=>{s!==r&&k.render("#app")});window.project=e;window.data=g;function pe(){let t="w-full";return`
    + ${e.css}`;if(i.getElementById("cuxjju3ew").textContent=p,!window.editorManager)return;a==="css"&&editorManager.cssEditor.state.doc.toString()!==e.css&&dispatchChanges(editorManager.cssEditor,e.css)}}if(c.includes(a)){if(a==="javascript"){if(y(!0),!window.editorManager)return;if(window.editorManager.jsEditor.state.doc.toString()!==e.javascript)return dispatchChanges(editorManager.jsEditor,e.javascript),!1}(a==="html_pre_processor"||a==="css_pre_processor"||a==="javascript_pre_processor")&&y(!0)}a==="dark"&&(j.render("#app"),document.documentElement.setAttribute("data-theme",e.dark?"dark":"light"),document.querySelector("meta[name=apple-mobile-web-app-status-bar-style]").setAttribute("content",e.dark?"black-translucent":"default"),document.querySelector("meta[name=theme-color]").setAttribute("content",e.dark?"#13171f":"#ffffff"),document.querySelector("meta[name=msapplication-navbutton-color]").setAttribute("content",e.dark?"#13171f":"#ffffff"))}}}),g=X(ce,(t,s,r)=>{s!==r&&j.render("#app")});window.project=e;window.data=g;function pe(){let t="w-full";return`
    • - `,x="grid grid-rows-1 items-center bg-transparent border-0 focus-within:shadow-none",j="flex flex-col justify-between h-full",h="grid h-full items-center",f="capitalize text-center mt-4",L=["javascript","typescript","react","vue","preact","angular","alpine","solid","stimulus","mithril","hyperapp","aurelia","lit"],$="";for(let w of L)$+=``;let Z=` + `;let T=`

      @@ -940,7 +940,7 @@

      -
      `,T=` +
      `,z=`
      ${pe()} @@ -1025,11 +1025,11 @@ ${a} ${p} ${l} - ${Z} -
      `,S=document.querySelector(t);if(!S)return;let M=new DOMParser().parseFromString(T,"text/html");if(M.body.innerHTML.trim()===T.trim())return;if(k.initialRender)return S.innerHTML=T,y(!0),k.initialRender=!1,!1;let D=S.firstElementChild,z=M.body.firstElementChild;J(D,z)}},q={render({large:t,title:s="Are you sure you want to proceed?",content:r,CloseLabel:o,ConfirmLabel:i,onLoad:n,onConfirm:c}){let a="text-lg font-thin m-0",p="text-xs w-auto px-3 py-2 m-0 capitalize rounded-md",j=`
      + ${T} +
      `,S=document.querySelector(t);if(!S)return;let k=new DOMParser().parseFromString(z,"text/html");if(k.body.innerHTML.trim()===z.trim())return;if(j.initialRender)return S.innerHTML=z,y(!0),j.initialRender=!1,!1;let O=S.firstElementChild,N=k.body.firstElementChild;J(O,N)}},q={render({large:t,title:s="Are you sure you want to proceed?",content:r,CloseLabel:o,ConfirmLabel:i,onLoad:n,onClose:c,onConfirm:a}){let p="text-lg font-thin m-0",l="text-xs w-auto px-3 py-2 m-0 capitalize rounded-md",f=`
      -

      ${s}

      -
      `,h=document.createElement("dialog");h.open=!0,h.innerHTML=j,document.body.appendChild(h),n&&typeof n=="function"&&n();let f=h.querySelector("header button"),L=h.querySelector("footer button:first-child"),$=h.querySelector("footer button:last-child");f.onclick=()=>document.body.removeChild(h),L.onclick=()=>document.body.removeChild(h),$.onclick=function(){c&&typeof c=="function"&&c(),document.body.removeChild(h)}}};function ue(){let t="border-0 bg-transparent py-1";return`
      + `,h=document.createElement("dialog");h.open=!0,h.innerHTML=f,document.body.appendChild(h),n&&typeof n=="function"&&n();let L=h.querySelector("header button"),$=h.querySelector("footer button:first-child"),T=h.querySelector("footer button:last-child");L.onclick=function(){c&&typeof c=="function"&&c(),document.body.removeChild(h)},$.onclick=function(){c&&typeof c=="function"&&c(),document.body.removeChild(h)},T.onclick=function(){a&&typeof a=="function"&&a(),document.body.removeChild(h)}}};function ue(){let t="border-0 bg-transparent py-1";return`
      ${o.description}

      - `).join("")}}).catch(s=>{console.error("Error fetching data:",s)})}function B(t){let s=document.querySelector(`script[src="${t}"]`);s&&s.remove()}function V(t){t.forEach(s=>{let r=document.querySelector(`script[src="${s}"]`);r&&r.remove()})}async function _(t){return new Promise((s,r)=>{if(document.querySelector(`script[src="${t}"]`)){s();return}let i=document.createElement("script");i.src=t,i.onload=s,i.onerror=()=>r(new Error(`Failed to load script: ${t}`)),document.body.appendChild(i)})}async function W(t){return Promise.all(t.map(_))}async function b(t,s){let r={html:{markdown:"libraries/preprocessors/marked.min.js",jade:"libraries/preprocessors/jade.js",pug:"libraries/preprocessors/pug.js"},css:{sass:"libraries/preprocessors/sass.sync.min.js",less:"libraries/preprocessors/less.min.js",stylus:"libraries/preprocessors/stylus.min.js"},javascript:{typescript:"libraries/preprocessors/typescript.min.js",babel:"libraries/preprocessors/babel.min.js",jsxtypescript:["libraries/preprocessors/typescript.min.js","libraries/preprocessors/babel.min.js"]}},o={html:e.html_pre_processor,css:e.css_pre_processor,javascript:e.javascript_pre_processor};try{let i=s!=="html"||s!=="css"||s!=="javascript",n=i?r[t][s]:null;if(o[t]&&i){let c=r[t][o[t]];Array.isArray(c)?V(c):B(c),Array.isArray(n)?await W(n):n&&await _(n)}t==="html"?(e.html_pre_processor=s,window.editorManager.setMode(e.html_pre_processor==="html"?"html":s,editorManager.htmlEditor)):t==="css"?(e.css_pre_processor=s,window.editorManager.setMode(e.css_pre_processor==="css"?"css":s,editorManager.cssEditor)):t==="javascript"&&(e.javascript_pre_processor=s,window.editorManager.setMode(e.javascript_pre_processor==="javascript"?"javascript":s,editorManager.jsEditor))}catch(i){console.error("Error setting preprocessor:",i)}}async function K(){await Promise.all([b("html",e.html_pre_processor),b("css",e.css_pre_processor),b("javascript",e.javascript_pre_processor)]),dispatchChanges(editorManager.htmlEditor,e.html),dispatchChanges(editorManager.cssEditor,e.css),dispatchChanges(editorManager.jsEditor,e.javascript),y(!0)}async function ee(){await W(["libraries/js-beautify/beautify.min.js","libraries/js-beautify/beautify-css.min.js","libraries/js-beautify/beautify-html.min.js"])}async function te(){V(["libraries/js-beautify/beautify.min.js","libraries/js-beautify/beautify-css.min.js","libraries/js-beautify/beautify-html.min.js"])}async function fe(){await ee();let t;switch(e.activePanel){case"html":t=html_beautify(e.html,{indent_size:2,max_preserve_newlines:1}),dispatchChanges(editorManager.htmlEditor,t);break;case"css":t=css_beautify(e.css,{indent_size:2,max_preserve_newlines:1}),e.css=t,dispatchChanges(editorManager.cssEditor,t);break;case"javascript":t=beautify(e.javascript,{indent_size:2,max_preserve_newlines:1}),e.javascript=t,dispatchChanges(editorManager.jsEditor,t);break;default:t="Unknown editor panel."}await te()}function be(){let t="";for(;!/^[a-zA-Z]/.test(t);)t=Math.random().toString(36).substr(2,9);return t}function ve(t){g.selectedSize=t,R()}function we(){let t=document.getElementById("previewElm").firstElementChild;if(t.style.width==="100%")return!1;let s=parseInt(t.style.width),r=parseInt(t.style.height);[s,r]=[r,s];let o=previewElm.clientWidth,i=previewElm.clientHeight,n=Math.min(o/s,i/r);t.style.width=`${s}px`,t.style.height=`${r}px`,t.style.transform=`scale(${n})`,t.style.marginTop=`-${r/2}px`,t.style.marginLeft=`-${s/2}px`,g.selectedSize=s+"x"+r}function se(){let t=document.getElementById("previewElm").firstElementChild;if(t.style.width==="100%")return!1;let s=parseInt(t.style.width),r=parseInt(t.style.height),o=previewElm.clientWidth,i=previewElm.clientHeight,n=Math.min(o/s,i/r);t.style.width=`${s}px`,t.style.height=`${r}px`,t.style.transform=`scale(${n})`,t.style.marginTop=`-${r/2}px`,t.style.marginLeft=`-${s/2}px`}var G;function R(){if(g.selectedSize==="none"){let t=document.getElementById("iframe");g.iframeSize=`${t.clientWidth}px x ${t.clientHeight}px`;let s=document.getElementById("iframeClientSize");s.classList.contains("hidden")&&(G&&clearTimeout(G),s.classList.remove("hidden","opacity-0"),s.classList.add("opacity-100"),G=setTimeout(()=>{s.classList.remove("opacity-100"),s.classList.add("opacity-0"),setTimeout(()=>{s.classList.add("hidden")},300)},2e3))}else se()}async function A(t){try{if(t==="html")switch(e.html_pre_processor){case"markdown":return marked.parse(e.html);case"jade":return jade.render(e.html,{pretty:!0});case"pug":let s=document.getElementById("appScript");return s.hasAttribute("type")&&s.getAttribute("type")==="module"?(console.error("Cannot import pug as script is a module!"),!1):ae("pug").compile(e.html)({name:this.name});default:return e.html}if(t==="css")switch(e.css_pre_processor){case"stylus":return stylus.render(e.css);case"less":return new Promise((s,r)=>{less.render(e.css,(o,i)=>o?r(o):s(i.css))});case"sass":return new Promise((s,r)=>{Sass.compile(e.css,o=>o.status===0?s(o.text):r(new Error(o.message)))});default:return e.css}if(t==="javascript")switch(e.javascript_pre_processor){case"babel":return typeof Babel>"u"&&await _("libraries/preprocessors/babel.min.js"),Babel.transform(e.javascript,{presets:["env","react"]}).code;case"typescript":return ts.transpileModule(e.javascript,{compilerOptions:{module:ts.ModuleKind.CommonJS}}).outputText;case"jsxtypescript":let s=ts.transpileModule(e.javascript,{compilerOptions:{module:ts.ModuleKind.CommonJS,target:ts.ScriptTarget.ES5,jsx:ts.JsxEmit.React}}).outputText;return g.compiledJSX=Babel.transform(s,{presets:["env","react"]}).code,g.compiledJSX;default:return e.javascript}}catch(s){console.error("Error compiling code:",s)}}async function ye(t){let s=t.target.files[0];if(s)try{let r=await xe(s);e.logo=r}catch(r){console.error("Error converting image to base64:",r)}}function xe(t){return new Promise((s,r)=>{let o=new FileReader;o.readAsDataURL(t),o.onload=()=>s(o.result),o.onerror=i=>r(i)})}function je(t){function s(o){return o.charAt(0).toUpperCase()+o.slice(1)}let r=s(t);b("html","html"),b("css","css"),t!=="typescript"&&b("javascript","javascript"),(t==="typescript"||t==="angular")&&b("javascript","typescript"),e.name=`${r} name`,e.version=.01,e.title=`A Cool ${r} App`,e.description=`A modern ${r} application!`,e.author="kodeWeave",e.url="https://michaelsboost.com/",e.diffing=!1,e.module=!0,t==="angular"&&(e.module=!1),e.pwa=!1,t==="javascript"&&(e.meta="",e.libraries=["https://cdnjs.cloudflare.com/ajax/libs/picocss/2.0.6/pico.min.css","https://michaelsboost.com/TailwindCSSMod/tailwind-mod.min.js"],e.html=`
      + `).join("")}}).catch(s=>{console.error("Error fetching data:",s)})}function R(t){let s=document.querySelector(`script[src="${t}"]`);s&&s.remove()}function V(t){t.forEach(s=>{let r=document.querySelector(`script[src="${s}"]`);r&&r.remove()})}async function D(t){return new Promise((s,r)=>{if(document.querySelector(`script[src="${t}"]`)){s();return}let i=document.createElement("script");i.src=t,i.onload=s,i.onerror=()=>r(new Error(`Failed to load script: ${t}`)),document.body.appendChild(i)})}async function Z(t){return Promise.all(t.map(D))}async function b(t,s){let r={html:{markdown:"libraries/preprocessors/marked.min.js",jade:"libraries/preprocessors/jade.js",pug:"libraries/preprocessors/pug.js"},css:{sass:"libraries/preprocessors/sass.sync.min.js",less:"libraries/preprocessors/less.min.js",stylus:"libraries/preprocessors/stylus.min.js"},javascript:{typescript:"libraries/preprocessors/typescript.min.js",babel:"libraries/preprocessors/babel.min.js",jsxtypescript:["libraries/preprocessors/typescript.min.js","libraries/preprocessors/babel.min.js"]}},o={html:e.html_pre_processor,css:e.css_pre_processor,javascript:e.javascript_pre_processor};try{let i=s!=="html"||s!=="css"||s!=="javascript",n=i?r[t][s]:null;if(o[t]&&i){let c=r[t][o[t]];Array.isArray(c)?V(c):R(c),Array.isArray(n)?await Z(n):n&&await D(n)}if(t==="html")e.html_pre_processor=s;else if(t==="css")e.css_pre_processor=s;else if(t==="javascript"){if(e.javascript_pre_processor=s,!window.editorManager||!window.editorManager.jsEditor)return;window.editorManager.setMode(e.javascript_pre_processor==="javascript"?"javascript":s,editorManager.jsEditor)}}catch(i){console.error("Error setting preprocessor:",i)}}async function K(){await Promise.all([b("html",e.html_pre_processor),b("css",e.css_pre_processor),b("javascript",e.javascript_pre_processor)]),window.editorManager&&(dispatchChanges(editorManager.htmlEditor,e.html),dispatchChanges(editorManager.cssEditor,e.css),dispatchChanges(editorManager.jsEditor,e.javascript),y(!0))}async function ee(){await Z(["libraries/js-beautify/beautify.min.js","libraries/js-beautify/beautify-css.min.js","libraries/js-beautify/beautify-html.min.js"])}async function te(){V(["libraries/js-beautify/beautify.min.js","libraries/js-beautify/beautify-css.min.js","libraries/js-beautify/beautify-html.min.js"])}async function fe(){await ee();let t;switch(e.activePanel){case"html":t=html_beautify(e.html,{indent_size:2,max_preserve_newlines:1}),dispatchChanges(editorManager.htmlEditor,t);break;case"css":t=css_beautify(e.css,{indent_size:2,max_preserve_newlines:1}),e.css=t,dispatchChanges(editorManager.cssEditor,t);break;case"javascript":t=beautify(e.javascript,{indent_size:2,max_preserve_newlines:1}),e.javascript=t,dispatchChanges(editorManager.jsEditor,t);break;default:t="Unknown editor panel."}await te()}function be(){let t="";for(;!/^[a-zA-Z]/.test(t);)t=Math.random().toString(36).substr(2,9);return t}function ve(t){g.selectedSize=t,W()}function we(){let t=document.getElementById("previewElm").firstElementChild;if(t.style.width==="100%")return!1;let s=parseInt(t.style.width),r=parseInt(t.style.height);[s,r]=[r,s];let o=previewElm.clientWidth,i=previewElm.clientHeight,n=Math.min(o/s,i/r);t.style.width=`${s}px`,t.style.height=`${r}px`,t.style.transform=`scale(${n})`,t.style.marginTop=`-${r/2}px`,t.style.marginLeft=`-${s/2}px`,g.selectedSize=s+"x"+r}function se(){let t=document.getElementById("previewElm").firstElementChild;if(t.style.width==="100%")return!1;let s=parseInt(t.style.width),r=parseInt(t.style.height),o=previewElm.clientWidth,i=previewElm.clientHeight,n=Math.min(o/s,i/r);t.style.width=`${s}px`,t.style.height=`${r}px`,t.style.transform=`scale(${n})`,t.style.marginTop=`-${r/2}px`,t.style.marginLeft=`-${s/2}px`}var G;function W(){if(g.selectedSize==="none"){let t=document.getElementById("iframe");g.iframeSize=`${t.clientWidth}px x ${t.clientHeight}px`;let s=document.getElementById("iframeClientSize");s.classList.contains("hidden")&&(G&&clearTimeout(G),s.classList.remove("hidden","opacity-0"),s.classList.add("opacity-100"),G=setTimeout(()=>{s.classList.remove("opacity-100"),s.classList.add("opacity-0"),setTimeout(()=>{s.classList.add("hidden")},300)},2e3))}else se()}async function A(t){try{if(t==="html")switch(e.html_pre_processor){case"markdown":return marked.parse(e.html);case"jade":return jade.render(e.html,{pretty:!0});case"pug":let s=document.getElementById("appScript");return s.hasAttribute("type")&&s.getAttribute("type")==="module"?(console.error("Cannot import pug as script is a module!"),!1):ae("pug").compile(e.html)({name:this.name});default:return e.html}if(t==="css")switch(e.css_pre_processor){case"stylus":return stylus.render(e.css);case"less":return new Promise((s,r)=>{less.render(e.css,(o,i)=>o?r(o):s(i.css))});case"sass":return new Promise((s,r)=>{Sass.compile(e.css,o=>o.status===0?s(o.text):r(new Error(o.message)))});default:return e.css}if(t==="javascript")switch(e.javascript_pre_processor){case"babel":return typeof Babel>"u"&&await D("libraries/preprocessors/babel.min.js"),Babel.transform(e.javascript,{presets:["env","react"]}).code;case"typescript":return ts.transpileModule(e.javascript,{compilerOptions:{module:ts.ModuleKind.CommonJS}}).outputText;case"jsxtypescript":let s=ts.transpileModule(e.javascript,{compilerOptions:{module:ts.ModuleKind.CommonJS,target:ts.ScriptTarget.ES5,jsx:ts.JsxEmit.React}}).outputText;return g.compiledJSX=Babel.transform(s,{presets:["env","react"]}).code,g.compiledJSX;default:return e.javascript}}catch(s){console.error("Error compiling code:",s)}}async function ye(t){let s=t.target.files[0];if(s)try{let r=await xe(s);e.logo=r}catch(r){console.error("Error converting image to base64:",r)}}function xe(t){return new Promise((s,r)=>{let o=new FileReader;o.readAsDataURL(t),o.onload=()=>s(o.result),o.onerror=i=>r(i)})}function je(t){function s(o){return o.charAt(0).toUpperCase()+o.slice(1)}let r=s(t);b("html","html"),b("css","css"),t!=="typescript"&&b("javascript","javascript"),(t==="typescript"||t==="angular")&&b("javascript","typescript"),e.name=`${r} name`,e.version=.01,e.title=`A Cool ${r} App`,e.description=`A modern ${r} application!`,e.author="kodeWeave",e.url="https://michaelsboost.com/",e.diffing=!1,e.module=!0,t==="angular"&&(e.module=!1),e.pwa=!1,t==="javascript"&&(e.meta="",e.libraries=["https://cdnjs.cloudflare.com/ajax/libs/picocss/2.0.6/pico.min.css","https://michaelsboost.com/TailwindCSSMod/tailwind-mod.min.js"],e.html=`

      \u{1F44B} Hello, ${r}! \u{1F30E}

      Counter: 0

      \n
      \n \\`;\n}\n\nrender(html\\`<\\${App} />\\`, document.getElementById('root'));`;\n }\n if (name === 'angularold') {\n project.meta = ``;\n project.libraries = [\n \"https://ajax.googleapis.com/ajax/libs/angularjs/1.8.2/angular.min.js\",\n \"https://cdnjs.cloudflare.com/ajax/libs/picocss/2.0.6/pico.min.css\",\n \"https://michaelsboost.com/TailwindCSSMod/tailwind-mod.min.js\"\n ];\n project.html = `
      \n

      \uD83D\uDC4B Hello, ${capitalizedTitle}! \uD83C\uDF0E

      \n

      Counter: {{counter}}

      \n \n +\n \n
      `;\n project.css = ``;\n project.javascript = `angular.module('myApp', [])\n .controller('MainController', function($scope) {\n $scope.counter = 0;\n $scope.incrementCounter = function() {\n $scope.counter++;\n };\n });`;\n }\n if (name === 'angular') {\n project.meta = ``;\n project.libraries = [\n \"https://cdnjs.cloudflare.com/ajax/libs/rxjs/6.6.3/rxjs.umd.min.js\",\n \"https://cdnjs.cloudflare.com/ajax/libs/core-js/2.5.7/core.js\",\n \"https://unpkg.com/@angular/core@11.0.5/bundles/core.umd.js\",\n \"https://cdnjs.cloudflare.com/ajax/libs/zone.js/0.10.3/zone.min.js\",\n \"https://unpkg.com/@angular/common@11.0.5/bundles/common.umd.js\",\n \"https://unpkg.com/@angular/compiler@11.0.5/bundles/compiler.umd.js\",\n \"https://unpkg.com/@angular/platform-browser@11.0.5/bundles/platform-browser.umd.js\",\n \"https://unpkg.com/@angular/platform-browser-dynamic@11.0.5/bundles/platform-browser-dynamic.umd.js\",\n \"https://cdnjs.cloudflare.com/ajax/libs/picocss/2.0.6/pico.min.css\",\n \"https://michaelsboost.com/TailwindCSSMod/tailwind-mod.min.js\"\n ];\n project.html = `Loading...`;\n project.css = ``;\n project.javascript = `const { Component, NgModule, enableProdMode } = ng.core;\nconst { BrowserModule } = ng.platformBrowser;\nconst { platformBrowserDynamic } = ng.platformBrowserDynamic;\n\nenableProdMode();\n\n@Component({\n selector: 'app-root',\n template: \\`\n
      \n

      \uD83D\uDC4B Hello, ${capitalizedTitle}! \uD83C\uDF0E

      \n

      Counter: {{ counter }}

      \n \n +\n \n
      \n \\`,\n})\nclass AppComponent {\n counter = 0;\n \n incrementCounter() {\n this.counter++;\n }\n}\n\n@NgModule({\n declarations: [AppComponent],\n imports: [BrowserModule],\n bootstrap: [AppComponent]\n})\nclass AppModule {}\n\nplatformBrowserDynamic().bootstrapModule(AppModule);`;\n }\n if (name === 'alpine') {\n project.meta = ``;\n project.libraries = [\n \"https://cdnjs.cloudflare.com/ajax/libs/picocss/2.0.6/pico.min.css\",\n \"https://michaelsboost.com/TailwindCSSMod/tailwind-mod.min.js\"\n ];\n project.html = `
      \n
      \n

      \uD83D\uDC4B Hello, ${capitalizedTitle}! \uD83C\uDF0E

      \n

      Counter:

      \n \n +\n \n
      \n
      `;\n project.css = ``;\n project.javascript = ``;\n project.diffing = true;\n }\n if (name === 'solid') {\n project.meta = ``;\n project.libraries = [\n \"https://cdnjs.cloudflare.com/ajax/libs/picocss/2.0.6/pico.min.css\",\n \"https://michaelsboost.com/TailwindCSSMod/tailwind-mod.min.js\"\n ];\n project.html = `
      `;\n project.css = ``;\n project.javascript = `import { createSignal } from \"https://cdn.skypack.dev/solid-js@1.2.6\";\nimport { render } from \"https://cdn.skypack.dev/solid-js@1.2.6/web\";\nimport html from \"https://cdn.skypack.dev/solid-js@1.2.6/html\";\n\nfunction Counter() {\n const [count, setCount] = createSignal(0);\n const increment = () => setCount(count() + 1);\n\n return html\\`\n
      \n

      \uD83D\uDC4B Hello, ${capitalizedTitle}! \uD83C\uDF0E

      \n

      Counter: \\${count}

      \n \n
      \n \\`;\n}\n\nrender(Counter, document.getElementById(\"root\"));`;\n }\n if (name === 'stimulus') {\n project.meta = \"\";\n project.libraries = [\n \"https://cdn.jsdelivr.net/npm/@hotwired/stimulus@3.1.0/dist/stimulus.umd.js\",\n \"https://cdn.jsdelivr.net/npm/@hotwired/stimulus-loading@1.0.0/dist/stimulus-loading.umd.js\",\n \"https://cdnjs.cloudflare.com/ajax/libs/picocss/2.0.6/pico.min.css\",\n \"https://michaelsboost.com/TailwindCSSMod/tailwind-mod.min.js\"\n ];\n project.html = `
      \n

      \uD83D\uDC4B Hello, ${capitalizedTitle}! \uD83C\uDF0E

      \n

      Counter: 0

      \n counter#increment\"\n class=\"px-4 py-2 bg-blue-500 text-white rounded hover:bg-blue-700 transition\"\n >\n +\n \n
      `;\n project.css = ``;\n project.javascript = `const application = Stimulus.Application.start();\n\napplication.register('counter', class extends Stimulus.Controller {\n static targets = ['output'];\n\n initialize() {\n this.counter = 0;\n }\n\n increment() {\n this.counter += 1;\n this.outputTarget.textContent = this.counter;\n }\n});`;\n }\n if (name === 'mithril') {\n project.meta = \"\";\n project.libraries = [\n \"https://cdn.jsdelivr.net/npm/mithril@2.0.4/mithril.min.js\",\n \"https://cdnjs.cloudflare.com/ajax/libs/picocss/2.0.6/pico.min.css\",\n \"https://michaelsboost.com/TailwindCSSMod/tailwind-mod.min.js\"\n ];\n project.html = `
      `;\n project.css = ``;\n project.javascript = `import htm from 'https://unpkg.com/htm?module'\nconst html = htm.bind(m)\n\nconst app = () => {\n let count = 0\n \n return {\n view: () => html\\`\n
      \n

      \uD83D\uDC4B Hello, Mithril! \uD83C\uDF0E

      \n

      Counter: \\${count}

      \n \n
      \\`\n }\n}\n\nm.mount(document.getElementById('root'), app)`;\n }\n if (name === 'hyperapp') {\n project.meta = ``;\n project.libraries = [\n \"https://cdnjs.cloudflare.com/ajax/libs/picocss/2.0.6/pico.min.css\",\n \"https://michaelsboost.com/TailwindCSSMod/tailwind-mod.min.js\"\n ];\n project.html = `

      `;\n project.css = ``;\n project.javascript = `import { app } from 'https://unpkg.com/hyperapp';\nimport html from 'https://unpkg.com/hyperlit';\n\napp({\n init: 0,\n view: count => html\\`\n
      \n

      \uD83D\uDC4B Hello, Hyperapp! \uD83C\uDF0E

      \n

      Counter: \\${count}

      \n \n
      \\`,\n node: document.getElementById('root')\n})`;\n }\n if (name === 'aurelia') {\n project.meta = '';\n project.libraries = [\n \"https://cdnjs.cloudflare.com/ajax/libs/picocss/2.0.6/pico.min.css\",\n \"https://michaelsboost.com/TailwindCSSMod/tailwind-mod.min.js\"\n ];\n project.html = ``;\n project.css = ``;\n project.javascript = `class App {\n static $view() {\n return document.querySelector('#root');\n }\n constructor() {\n this.message = '${capitalizedTitle}';\n this.counter = 0;\n }\n incrementCounter() {\n this.counter++;\n document.getElementById('counter').textContent = this.counter;\n }\n}\n\nau.start({ root: App });`;\n }\n if (name === 'lit') {\n project.meta = \"\";\n project.libraries = [\n \"https://cdnjs.cloudflare.com/ajax/libs/picocss/2.0.6/pico.min.css\"\n ];\n project.html = ``;\n project.css = ``;\n project.javascript = `import {LitElement, html} from 'https://cdn.jsdelivr.net/gh/lit/dist@2/core/lit-core.min.js';\n \nclass MyElement extends LitElement {\n static properties = {\n counter: { type: Number }\n };\n\n constructor() {\n super();\n this.counter = 0;\n }\n\n incrementCounter() {\n this.counter++;\n }\n\n render() {\n return html\\`\n
      \n

      \uD83D\uDC4B Hello, ${capitalizedTitle}! \uD83C\uDF0E

      \n

      Counter: \\${this.counter}

      \n \n
      \n \\`;\n }\n}\ncustomElements.define('my-element', MyElement);`;\n }\n\n dispatchChanges(editorManager.htmlEditor, project.html);\n dispatchChanges(editorManager.cssEditor, project.css);\n dispatchChanges(editorManager.jsEditor, project.javascript);\n if (name === 'react') setPreprocessor('javascript', 'babel');\n data.demos = false;\n renderPreview(true);\n}\nfunction importJSON(obj) {\n if (obj === null) return;\n project.obj = {};\n data.safeRender = null;\n setPreprocessor('html', obj.html_pre_processor);\n setPreprocessor('css', obj.css_pre_processor);\n setPreprocessor('javascript', obj.javascript_pre_processor);\n project.name = obj.name;\n project.version = obj.version;\n project.title = obj.title;\n project.description = obj.description;\n project.author = obj.author;\n project.url = obj.url;\n project.logo = obj.logo;\n project.console = obj.console;\n project.dark = obj.dark;\n project.diffing = obj.diffing;\n project.module = obj.module;\n project.autorun = obj.autorun;\n project.pwa = obj.pwa;\n project.activePanel = obj.activePanel;\n project.columns = obj.columns;\n project.columnsRight = obj.columnsRight;\n \n project.meta = obj.meta;\n project.libraries = obj.libraries;\n project.html = obj.html;\n project.css = obj.css;\n project.javascript = obj.javascript;\n data.safeRender = true;\n\n // Dispatch changes to editors\n dispatchChanges(editorManager.htmlEditor, project.html);\n dispatchChanges(editorManager.cssEditor, project.css);\n dispatchChanges(editorManager.jsEditor, project.javascript);\n renderPreview(true);\n}\nfunction importProject() {\n Modal.render({\n title: \"Are you sure you want to load a new project?\",\n content: `
      All current data will be lost.
      `,\n onConfirm: function() {\n const input = document.createElement('input');\n input.type = 'file';\n input.accept = '.json';\n\n input.addEventListener('change', (event) => {\n const file = event.target.files[0];\n \n if (!file) {\n console.error('No file selected.');\n return;\n }\n \n const reader = new FileReader();\n \n reader.onload = event => {\n try {\n importJSON(JSON.parse(event.target.result));\n } catch (error) {\n console.error('Error parsing JSON file:', error);\n }\n };\n \n reader.readAsText(file);\n input.remove();\n });\n \n input.click();\n }\n });\n}\n\nfunction getFileNameAndType(url) {\n // Extract the file name with extension from the URL\n const fileName = url.substring(url.lastIndexOf('/') + 1);\n \n // Extract the file extension\n const fileExtension = fileName.split('.').pop().toLowerCase();\n \n // Map file extensions to MIME types\n const mimeTypes = {\n 'jpeg': 'image/jpeg',\n 'jpg': 'image/jpeg',\n 'png': 'image/png',\n 'gif': 'image/gif',\n 'bmp': 'image/bmp',\n 'webp': 'image/webp',\n 'svg': 'image/svg+xml',\n 'mp3': 'audio/mpeg',\n 'wav': 'audio/wav',\n 'ogg': 'audio/ogg',\n 'mp4': 'video/mp4',\n 'webm': 'video/webm',\n 'ogv': 'video/ogg'\n };\n \n // Get the MIME type based on the file extension\n const fileType = mimeTypes[fileExtension] || 'application/octet-stream';\n \n return {\n fileName,\n fileType\n };\n}\nfunction fetchResources(obj) {\n try {\n const doc = new DOMParser().parseFromString(obj.html, 'text/html');\n const body = doc.body;\n\n const imageUrls = [];\n const audioUrls = [];\n const vectors = [];\n const videoUrls = [];\n\n // Extract image URLs\n body.querySelectorAll('img').forEach(img => {\n if (img.hasAttribute('src')) {\n imageUrls.push(img.getAttribute('src'));\n img.src = `imgs/${getFileNameAndType(img.getAttribute('src')).fileName}`;\n }\n });\n\n // Extract audio URLs\n body.querySelectorAll('audio').forEach(audio => {\n audio.querySelectorAll('source').forEach(source => {\n if (source.hasAttribute('src')) {\n audioUrls.push(source.getAttribute('src'));\n source.src = `audios/${getFileNameAndType(source.getAttribute('src')).fileName}`;\n }\n });\n });\n\n // Extract vectors\n body.querySelectorAll('svg').forEach(svg => {\n vectors.push(svg.outerHTML);\n });\n\n // Extract video URLs\n body.querySelectorAll('video').forEach(video => {\n video.querySelectorAll('source').forEach(source => {\n if (source.hasAttribute('src')) {\n videoUrls.push(source.getAttribute('src'));\n source.src = `vids/${getFileNameAndType(source.getAttribute('src')).fileName}`;\n }\n });\n });\n\n return {\n imageUrls,\n audioUrls,\n vectors,\n videoUrls\n };\n } catch (error) {\n console.error('Error fetching resources:', error);\n return null; // Or handle the error in an appropriate way\n }\n}\nasync function getBase64Media(mediaUrl) {\n const response = await fetch(mediaUrl);\n const blob = await response.blob();\n return new Promise((resolve, reject) => {\n const reader = new FileReader();\n reader.onloadend = () => resolve(reader.result.split(',')[1]);\n reader.onerror = reject;\n reader.readAsDataURL(blob);\n });\n}\nasync function downloadJSON() {\n try {\n await loadScript(\"libraries/jszip/FileSaver.min.js\");\n let blob = new Blob([JSON.stringify(project, null, 2)], {type: \"application/json\"});\n saveAs(blob, `${project.name.split(' ').join('').toLowerCase()}-kodeWeave.json`);\n\n } catch (error) {\n console.error('Error:', error);\n } finally {\n // Clean up scripts after use\n removeScript(\"libraries/jszip/FileSaver.min.js\");\n }\n}\nasync function downloadProject() {\n try {\n await loadScripts([\n \"libraries/jszip/jszip.min.js\",\n \"libraries/jszip/FileSaver.min.js\"\n ]);\n \n let { imageUrls, audioUrls, vectors, videoUrls } = fetchResources(project);\n\n // Extract srcset URLs\n const iframe = document.getElementById('iframe');\n if (!iframe) return;\n\n const idoc = iframe.contentDocument || iframe.contentWindow.document;\n const srcsetUrls = idoc.querySelectorAll('img[srcset]').forEach(img => {\n img.srcset.split(',').forEach(srcset => {\n const url = srcset.trim().split(' ')[0];\n imageUrls.push(url);\n });\n });\n\n function extractBackgroundImageUrls(css) {\n const urls = [];\n const regex = /background-image\\s*:\\s*url\\(([^)]+)\\)/g;\n let match;\n while ((match = regex.exec(css)) !== null) {\n let url = match[1].replace(/['\"]/g, \"\"); // Remove quotes around URLs\n if (!url.startsWith(\"data:\")) {\n urls.push(url);\n }\n }\n return urls;\n }\n \n // Extract background-image URLs from project CSS\n const backgroundUrls = extractBackgroundImageUrls(await compileCode('css'));\n imageUrls = imageUrls.concat(backgroundUrls); // Add to image URLs to download\n\n const zip = new JSZip();\n\n // Project file\n zip.file(`${project.name.split(' ').join('').toLowerCase()}-kodeWeave.json`, JSON.stringify(project, null, 2));\n\n function checkCSSDependencies() {\n if (project.css.trim() !== '') {\n return `\n \"postcss\": \"^8.4.6\",\n \"autoprefixer\": \"^10.4.2\",\n \"cssnano\": \"^5.0.12\"`;\n }\n return '';\n }\n \n function checkJSDependencies() {\n if (project.javascript_pre_processor === 'babel' || project.javascript_pre_processor === 'jsxtypescript') {\n return `,\n \"@babel/core\": \"^7.15.5\",\n \"@babel/preset-env\": \"^7.15.6\",\n \"@babel/preset-react\": \"^7.14.5\",\n \"rollup-plugin-babel\": \"^4.4.0\"`;\n }\n if (project.javascript_pre_processor === 'typescript' || project.javascript_pre_processor === 'jsxtypescript') {\n return `,\n \"rollup-plugin-typescript2\": \"^0.31.1\",\n \"typescript\": \"^4.4.3\"`;\n }\n return '';\n }\n \n // Nodejs Package JSON\n let nodeStr = `{\n \"name\": \"${project.name.toLowerCase().split(' ').join('')}\",\n \"version\": \"${project.version}\",\n \"type\": \"module\",\n \"scripts\": {\n ${project.css.trim() !== '' ? `\"build:css\": \"postcss src/styles.css -o dist/styles.min.css\",\n ` : ''}\"build:js\": \"rollup -c && terser dist/script.js -o dist/script.min.js\",\n \"build\": \"${project.css.trim() !== '' ? 'npm run build:css && ' : ''}npm run build:js\",\n \"serve\": \"http-server -c-1 -p 8081\"\n },\n \"devDependencies\": {\n \"rollup\": \"^2.79.1\",\n \"rollup-plugin-terser\": \"^7.0.2\",\n \"terser\": \"^5.10.0\",\n \"http-server\": \"^14.1.1\"${checkCSSDependencies()}${checkJSDependencies()}\n }\n}`;\n zip.file(\"package.json\", nodeStr);\n \n // Rollup Configuration\n let rollupPlugins = `import { terser } from 'rollup-plugin-terser';\n`;\n \n if (project.javascript_pre_processor === 'babel' || project.javascript_pre_processor === 'jsxtypescript') {\n rollupPlugins += `import babel from 'rollup-plugin-babel';\n`;\n }\n \n if (project.javascript_pre_processor === 'typescript' || project.javascript_pre_processor === 'jsxtypescript') {\n rollupPlugins += `import typescript from 'rollup-plugin-typescript2';\n`;\n }\n \n let rollupStr = `${rollupPlugins}\nexport default {\n ${project.javascript_pre_processor === 'typescript' || project.javascript_pre_processor === 'jsxtypescript' ? \"input: 'src/script.ts', // entry point for your TypeScript\" : \"input: 'src/script.js', // entry point to your Javascript\"}\n output: {\n file: 'dist/script.js',\n format: ${project.module ? \"'es'\" : \"'iife'\"}, // Immediately Invoked Function Expression, suitable for \n `;\n const swjs = `// Service worker code\nimportScripts('https://storage.googleapis.com/workbox-cdn/releases/6.4.1/workbox-sw.js');\n\nconst { registerRoute } = workbox.routing;\nconst { CacheFirst } = workbox.strategies;\n\nconst cacheName = '${project.name.split(' ').join('')}-cache';\n\nworkbox.routing.registerRoute(\n({ request }) => request.destination === 'script' ||\n request.destination === 'style' ||\n request.destination === 'document' ||\n request.destination === 'image' ||\n request.destination === 'font' ||\n request.destination === 'audio' ||\n request.destination === 'video',\nnew CacheFirst({\ncacheName: cacheName,\nplugins: [\n// Any additional plugins can be added here\n],\n})\n);`\n zip.file(\"dist/sw.js\", swjs);\n }\n\n // Iterate over each library\n let scriptTags = '';\n let cssTags = '';\n project.libraries.forEach(library => {\n if (library.endsWith('.js')) {\n scriptTags += `\\n `;\n } else if (library.endsWith('.css')) {\n cssTags += `\\n `;\n } else {\n // Assuming it's a Google font\n cssTags += `\\n `;\n }\n });\n \n // Add index.html\n const indexHtmlContentCompiled = `\n\n \n ${project.title}\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n ${cssTags}${project.css ? '' : ''}\n ${project.meta ? `${project.meta}\\n ` : ''}\n ${scriptTags ? scriptTags : ''}\n \n \n\n${await compileCode('html')}\n\n${project.javascript ? '' : ''}\n${(project.pwa ? swinit : '')}\n \n`;\n if (project.html_pre_processor === 'html') zip.file('src/index.html', project.html);\n if (project.html_pre_processor === 'html') zip.file('index.html', indexHtmlContentCompiled);\n if (project.html_pre_processor === 'markdown') zip.file('src/index.md', project.html);\n if (project.html_pre_processor === 'markdown') zip.file('index.html', indexHtmlContentCompiled);\n if (project.html_pre_processor === 'pug') zip.file('src/index.pug', project.html);\n if (project.html_pre_processor === 'pug') zip.file('index.html', indexHtmlContentCompiled);\n if (project.html_pre_processor === 'jade') zip.file('src/index.jade', project.html);\n if (project.html_pre_processor === 'jade') zip.file('index.html', indexHtmlContentCompiled);\n\n // Create a folder \"imgs\" and add images inside it with their correct MIME types\n if (audioUrls.length > 0) {\n const audioFolder = zip.folder('audios');\n try {\n for (const audioUrl of audioUrls) {\n const base64Audio = await getBase64Media(audioUrl);\n audioFolder.file(audioUrl.substring(audioUrl.lastIndexOf('/') + 1), base64Audio, { base64: true });\n }\n } catch (error) {\n console.error('Error adding audio to ZIP:', error);\n return;\n }\n }\n if (imageUrls.length > 0) {\n const imgFolder = zip.folder('imgs');\n try {\n // Convert each image URL to Base64 and add to ZIP folder\n for (const imageUrl of imageUrls) {\n const base64Image = await getBase64Media(imageUrl);\n imgFolder.file(imageUrl.substring(imageUrl.lastIndexOf('/') + 1), base64Image, { base64: true });\n }\n } catch (error) {\n console.error('Error adding images to ZIP:', error);\n return; // Exit method or handle error as needed\n }\n }\n if (vectors.length > 0) {\n const svgFolder = zip.folder('svgs');\n try {\n // Convert each SVG to a file inside the 'svgs' folder\n vectors.forEach((svg, index) => {\n svgFolder.file(`vector-${index + 1}.svg`, svg);\n });\n } catch (error) {\n console.error('Error adding images to ZIP:', error);\n return; // Exit method or handle error as needed\n }\n }\n if (videoUrls.length > 0) {\n const videoFolder = zip.folder('vids');\n try {\n for (const videoUrl of videoUrls) {\n const base64Video = await getBase64Media(videoUrl);\n videoFolder.file(videoUrl.substring(videoUrl.lastIndexOf('/') + 1), base64Video, { base64: true });\n }\n } catch (error) {\n console.error('Error adding videos to ZIP:', error);\n return;\n }\n }\n\n // Generate the ZIP file\n const blob = await zip.generateAsync({ type: 'blob' });\n saveAs(blob, `${project.name.toLowerCase().split(' ').join('')}.zip`);\n \n // Clear all arrays after saving\n imageUrls.length = audioUrls.length = videoUrls.length = 0;\n } catch (error) {\n console.error('Error:', error);\n } finally {\n // Clean up scripts after use\n const scriptsToRemove = [\n 'libraries/jszip/FileSaver.min.js',\n 'libraries/jszip/jszip.min.js'\n ];\n\n removeScripts(scriptsToRemove);\n }\n}\nasync function share() {\n try {\n // Compile code if necessary\n const javascriptCode = project.javascript_pre_processor === 'jsxtypescript'\n ? data.compiledJSX\n : project.javascript;\n\n let jsPreprocessor = null;\n if (project.javascript_pre_processor === 'jsxtypescript' || project.javascript_pre_processor === 'javascript') {\n jsPreprocessor = \"none\";\n } else {\n jsPreprocessor = project.javascript_pre_processor;\n }\n\n const shareProject = {\n title: project.title,\n description: project.description,\n head: project.meta,\n html: project.html,\n html_pre_processor: project.html_pre_processor === \"html\" ? \"none\" : \"\",\n css: project.css,\n css_pre_processor: project.css_pre_processor === \"css\" ? \"none\" : \"\",\n css_external: project.libraries.filter(lib => lib.endsWith('.css')).join(';'),\n css_starter: \"neither\",\n css_prefix: \"neither\",\n js_module: project.module,\n js: javascriptCode,\n js_pre_processor: jsPreprocessor,\n js_external: project.libraries.filter(lib => lib.endsWith('.js')).join(';'),\n editors: '111',\n layout: 'left'\n };\n\n // Stringify the JSON object and escape quotes\n const JSONstring = JSON.stringify(shareProject)\n .replace(/\"/g, \""\")\n .replace(/'/g, \"'\");\n\n // Create form element\n const form = `\n
      \n \n \n
      `;\n\n // Append form to the document body and submit\n document.body.insertAdjacentHTML('beforeend', form);\n document.querySelector('form').submit();\n document.querySelector('form').remove();\n } catch (error) {\n console.error('Error sharing project:', error);\n }\n}\n\nasync function screenshot() {\n const iframe = document.getElementById('iframe');\n const iframeDocument = iframe.contentDocument || iframe.contentWindow.document;\n\n try {\n await loadScripts([\n \"libraries/html2canvas/html2canvas.min.js\",\n \"libraries/jszip/FileSaver.min.js\"\n ]);\n \n html2canvas(iframeDocument.documentElement).then(canvas => {\n const context = canvas.getContext('2d');\n const videoElements = iframeDocument.getElementsByTagName('video');\n\n // Draw video elements\n Array.from(videoElements).forEach(video => {\n const { currentTime, paused, volume } = video;\n\n // Set volume to 0 for the screenshot process\n video.volume = 0;\n\n // Draw the video frame\n if (!paused) video.pause();\n context.drawImage(video, video.offsetLeft, video.offsetTop, video.clientWidth, video.clientHeight);\n\n // Restore the original volume and playback state\n video.volume = volume;\n video.currentTime = currentTime;\n if (!paused) video.play();\n });\n\n // Convert canvas to Blob\n canvas.toBlob(blob => {\n // Save the Blob using FileSaver.js\n saveAs(blob, 'screenshot.png');\n }, 'image/png');\n }).catch(error => {\n console.error('Error taking screenshot:', error);\n });\n } catch (error) {\n console.error('Error:', error);\n } finally {\n // Clean up scripts after use\n removeScript(\"../libraries/html2canvas/html2canvas.min.js\");\n removeScript(\"../libraries/jszip/FileSaver.min.js\");\n }\n}\nasync function renderPreview(forceRun = false) {\n if (!forceRun && !project.autorun) return;\n if (!data.safeRender) return;\n\n let scriptTags = '';\n let cssTags = '';\n project.libraries.forEach(library => {\n if (library.endsWith('.js')) {\n scriptTags += `\\n `;\n } else if (library.endsWith('.css')) {\n cssTags += `\\n `;\n } else {\n cssTags += `\\n `;\n }\n });\n\n const javascriptCode = await compileCode('javascript');\n const cssCode = await compileCode('css');\n\n function jsScript() {\n if (project.javascript_pre_processor === 'babel') {\n return `\n `\n } else {\n return ``\n }\n }\n const consoleCSS = `\n .wrapper_yOR7u {\n ${project.console ? '' : 'display: none!important;'}\n left: 0!important; width: 100%!important; \n border-radius: 15px 15px 0 0!important; \n z-index: 99999999;\n } \n .btn_yOR7u {\n cursor: pointer; \n background: inherit; \n padding: 0 0.5rem; \n margin: inherit; \n margin-right: 0px; \n border: inherit; \n color: #fff!important; \n } \n .nav_yOR7u {\n padding-bottom: 14px!important;\n } \n .line_yOR7u {\n background: inherit!important;\n }`\n const iframeSrc = `\n \n ${project.title}\n \n \n \n \n ${project.meta ? project.meta : ''}\n ${cssTags}\n \n \n \n \n ${await compileCode('html')}\n ${scriptTags ? scriptTags : ''}\n ${project.css_pre_processor === 'less' ? '' : ''}\n \n `;\n\n const iframe = document.getElementById('iframe');\n if (!iframe) return;\n\n const parser = new DOMParser();\n const doc = parser.parseFromString(iframeSrc, 'text/html');\n const idoc = iframe.contentDocument || iframe.contentWindow.document;\n\n if (App.initialRender) {\n setPreprocessor('html', project.html_pre_processor);\n setPreprocessor('css', project.css_pre_processor);\n setPreprocessor('js', project.javascript_pre_processor);\n iframe.setAttribute('srcdoc', iframeSrc);\n iframe.onload = () => {\n // Initialize script within the iframe\n const idoc = iframe.contentDocument || iframe.contentWindow.document;\n const script = idoc.createElement('script');\n script.type = project.module ? 'module' : 'text/javascript';\n script.textContent = javascriptCode;\n idoc.body.appendChild(script);\n };\n App.initialRender = false;\n previousJavaScriptCode = javascriptCode;\n return false;\n }\n\n if (project.diffing || !forceRun) {\n diffNodes(idoc.documentElement, doc.documentElement);\n return false;\n }\n \n iframe.setAttribute('srcdoc', iframeSrc);\n iframe.onload = () => {\n // Initialize script within the iframe\n const idoc = iframe.contentDocument || iframe.contentWindow.document;\n const script = idoc.createElement('script');\n script.type = project.module ? 'module' : 'text/javascript';\n script.textContent = javascriptCode;\n idoc.body.appendChild(script);\n };\n}\n\n// Make functions available in global space\nwindow.Modal = Modal;\nwindow.emptyStorage = emptyStorage;\nwindow.addLibrary = addLibrary;\nwindow.fetchSuggestions = fetchSuggestions;\nwindow.setPreprocessor = setPreprocessor;\nwindow.initializePreprocessors = initializePreprocessors;\nwindow.loadBeautifyLibraries = loadBeautifyLibraries\nwindow.removeBeautifyLibraries = removeBeautifyLibraries;\nwindow.tidy = tidy;\nwindow.generateId = generateId;\nwindow.resizeCanvas = resizeCanvas;\nwindow.rotateCanvas = rotateCanvas;\nwindow.defineScale = defineScale;\nwindow.getIFrameClientSize = getIFrameClientSize;\nwindow.handleLogoChange = handleLogoChange;\nwindow.newProject = newProject;\nwindow.importProject = importProject;\nwindow.downloadJSON = downloadJSON;\nwindow.downloadProject = downloadProject;\nwindow.share = share;\nwindow.screenshot = screenshot;\nwindow.renderPreview = renderPreview;\n\n// Diffing algorithm to update ui when changes occur\nfunction diffNodes(oldNode, newNode) {\n if (!oldNode || !newNode) {\n return;\n }\n\n // Check for data-ignore attribute\n if (oldNode.hasAttribute && oldNode.hasAttribute('data-ignore') || \n newNode.hasAttribute && newNode.hasAttribute('data-ignore')) {\n return;\n }\n\n // Check if nodes are iframe elements\n if (oldNode.nodeName === 'IFRAME' && newNode.nodeName === 'IFRAME') {\n const acceptableIframeAttributes = ['id', 'title', 'class', 'style', 'sandbox'];\n // Compare acceptable attributes only\n acceptableIframeAttributes.forEach(attr => {\n if (oldNode.getAttribute(attr) !== newNode.getAttribute(attr)) {\n oldNode.setAttribute(attr, newNode.getAttribute(attr));\n }\n });\n\n const oldSrcdoc = oldNode.getAttribute('srcdoc');\n const newSrcdoc = newNode.getAttribute('srcdoc');\n // Ignore srcdoc attribute if it hasn't changed\n if (oldSrcdoc === newSrcdoc) return;\n return;\n }\n\n // If nodes are different types, replace the old node\n if (oldNode.nodeName !== newNode.nodeName) {\n oldNode.replaceWith(newNode.cloneNode(true));\n // console.log('Different node names:', oldNode, newNode);\n return;\n }\n\n // Diff the attributes of the nodes\n if (oldNode.nodeType === Node.ELEMENT_NODE && newNode.nodeType === Node.ELEMENT_NODE) {\n const oldAttributes = Array.from(oldNode.attributes);\n const newAttributes = Array.from(newNode.attributes);\n\n // Remove old attributes not present in the new node\n oldAttributes.forEach(attr => {\n if (!newNode.hasAttribute(attr.name)) {\n oldNode.removeAttribute(attr.name);\n }\n });\n\n // Add or update attributes from the new node\n newAttributes.forEach(attr => {\n if (oldNode.getAttribute(attr.name) !== attr.value) {\n oldNode.setAttribute(attr.name, attr.value);\n }\n });\n }\n\n const oldChildren = Array.from(oldNode.childNodes);\n const newChildren = Array.from(newNode.childNodes);\n\n // Update or remove existing child nodes\n oldChildren.forEach((oldChild, index) => {\n const newChild = newChildren[index];\n if (!newChild) {\n oldNode.removeChild(oldChild);\n return;\n }\n // Special handling for elements\n if (oldNode.tagName === 'TITLE' || oldNode.tagName === 'STYLE' && oldNode.textContent !== newNode.textContent) {\n oldNode.textContent = newNode.textContent;\n } else if (oldChild.nodeType === Node.TEXT_NODE && oldChild.nodeValue !== newChild.nodeValue) {\n oldChild.nodeValue = newChild.nodeValue;\n }\n diffNodes(oldChild, newChild);\n });\n\n // Add new child nodes\n newChildren.slice(oldChildren.length).forEach(newChild => {\n oldNode.appendChild(newChild.cloneNode(true));\n });\n}\n\n// Once dom has loaded init functions\ndocument.addEventListener('DOMContentLoaded', function() {\n window.onload = () => {\n App.render('#app');\n initEditors();\n initializePreprocessors();\n getIFrameClientSize();\n data.safeRender = true;\n renderPreview(true);\n\n if (localStorage.getItem('kodeWeave')) {\n setTimeout(function() {\n importJSON(JSON.parse(localStorage.getItem('kodeWeave')));\n }, 100);\n }\n }\n window.onresize = () => getIFrameClientSize();\n});"], - "mappings": "gQACA,SAASA,EAASC,EAAQC,EAAUC,EAAO,CAAC,EAAG,CAC7C,SAASC,EAAYH,EAAQE,EAAM,CACjC,OAAI,OAAOF,GAAW,UAAYA,IAAW,KACpCA,EAGF,IAAI,MAAMA,EAAQ,CACvB,IAAII,EAAKC,EA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,EAAc,MAAM,KAAKP,EAAQ,UAAU,EAC3CQ,EAAc,MAAM,KAAKP,EAAQ,UAAU,EAGjDM,EAAY,QAAQ,CAACE,EAAUtL,IAAU,CACvC,IAAMuL,EAAWF,EAAYrL,CAAK,EAClC,GAAI,CAACuL,EAAU,CACbV,EAAQ,YAAYS,CAAQ,EAC5B,MACF,CAEIT,EAAQ,UAAY,SAAWA,EAAQ,UAAY,SAAWA,EAAQ,cAAgBC,EAAQ,YAChGD,EAAQ,YAAcC,EAAQ,YACrBQ,EAAS,WAAa,KAAK,WAAaA,EAAS,YAAcC,EAAS,YACjFD,EAAS,UAAYC,EAAS,WAEhCzK,EAAUwK,EAAUC,CAAQ,CAC9B,CAAC,EAGDF,EAAY,MAAMD,EAAY,MAAM,EAAE,QAAQG,GAAY,CACxDV,EAAQ,YAAYU,EAAS,UAAU,EAAI,CAAC,CAC9C,CAAC,CACH,CAGA,SAAS,iBAAiB,mBAAoB,UAAW,CACvD,OAAO,OAAS,IAAM,CACpBnN,EAAI,OAAO,MAAM,EACjB,YAAY,EACZyF,EAAwB,EACxBQ,EAAoB,EACpB3F,EAAK,WAAa,GAClBF,EAAc,EAAI,EAEd,aAAa,QAAQ,WAAW,GAClC,WAAW,UAAW,CACpBiH,GAAW,KAAK,MAAM,aAAa,QAAQ,WAAW,CAAC,CAAC,CAC1D,EAAG,GAAG,CAEV,EACA,OAAO,SAAW,IAAMpB,EAAoB,CAC9C,CAAC", - "names": ["onChange", "target", "callback", "path", "createProxy", "obj", "property", "value", "fullPath", "oldValue", "result", "app", "p", "d", "icons", "SidebarIconCSS", "navIconCSS", "modalIconCSS", "panelIconCSS", "previewIconCSS", "project", "newValue", "doc", "App", "diffArr", "initRun", "string", "renderPreview", "consoleCSS", "data", "LeftMenubar", "buttonSize", "PreviewMenu", "buttonClass", "selectClass", "selectStyle", "sizeOptions", "previewSize", "group", "option", "canTidyShow", "container", "size", "viewportWidth", "viewportHeight", "previewElm", "width", "height", "menuDialog", "settingsHTML", "library", "index", "librariesDialog", "buttonContentClass", "imageContentClass", "textContentClass", "frameworks", "buttonHTML", "name", "demosDialog", "html", "editorNav", "element", "currentDoc", "newDoc", "diffNodes", "Modal", "large", "title", "content", "CloseLabel", "ConfirmLabel", "onLoad", "onConfirm", "hClass", "modal", "timesBtn", "closeBtn", "confirmBtn", "emptyStorage", "c", "names", "registrations", "registration", "addLibrary", "url", "renderLibraries", "fetchSuggestions", "key", "response", "item", "suggestions", "error", "removeScript", "src", "script", "removeScripts", "scripts", "loadScript", "scriptUrl", "resolve", "reject", "scriptElement", "loadScripts", "srcArray", "setPreprocessor", "editor", "scriptMap", "currentPreprocessors", "scriptSrcCondition", "scriptSrc", "currentScriptSrc", "initializePreprocessors", "loadBeautifyLibraries", "removeBeautifyLibraries", "tidy", "formattedCode", "generateId", "id", "resizeCanvas", "getIFrameClientSize", "rotateCanvas", "iframe", "scale", "defineScale", "fadeTimeout", "compileCode", "detect", "appScript", "err", "output", "handleLogoChange", "event", "file", "base64String", "fileToBase64", "reader", "newProject", "capitalizeFirstLetter", "capitalizedTitle", "importJSON", "importProject", "input", "getFileNameAndType", "fileName", "fileExtension", "fileType", "fetchResources", "body", "imageUrls", "audioUrls", "vectors", "videoUrls", "img", "audio", "source", "svg", "video", "getBase64Media", "mediaUrl", "blob", "downloadJSON", "downloadProject", "extractBackgroundImageUrls", "css", "urls", "regex", "match", "checkCSSDependencies", "checkJSDependencies", "minifyCSS", "cssCode", "srcsetUrls", "srcset", "backgroundUrls", "zip", "nodeStr", "rollupPlugins", "rollupStr", "babelStr", "licenseStr", "READMEStr", "base64Logo", "logoType", "logoFileName", "sizes", "canvas", "ctx", "base64Image", "minifiedCSS", "minifyJS", "jsCode", "minifiedJS", "swinit", "swjs", "scriptTags", "cssTags", "indexHtmlContentCompiled", "audioFolder", "audioUrl", "base64Audio", "imgFolder", "imageUrl", "svgFolder", "videoFolder", "videoUrl", "base64Video", "share", "javascriptCode", "jsPreprocessor", "shareProject", "lib", "form", "screenshot", "iframeDocument", "context", "videoElements", "currentTime", "paused", "volume", "forceRun", "jsScript", "iframeSrc", "idoc", "oldNode", "newNode", "attr", "oldSrcdoc", "newSrcdoc", "oldAttributes", "newAttributes", "oldChildren", "newChildren", "oldChild", "newChild"] + "sourcesContent": ["// Function for reactive state management\nfunction onChange(target, callback, path = []) {\n function createProxy(target, path) {\n if (typeof target !== 'object' || target === null) {\n return target;\n }\n\n return new Proxy(target, {\n set(obj, property, value) {\n const fullPath = [...path, property];\n const oldValue = obj[property];\n const result = Reflect.set(obj, property, createProxy(value, fullPath));\n\n if (oldValue !== value) {\n callback(fullPath, oldValue, value);\n }\n\n return result;\n },\n get(obj, property) {\n const value = obj[property];\n if (typeof value === 'object' && value !== null) {\n return createProxy(value, [...path, property]);\n }\n return value;\n }\n });\n }\n\n return createProxy(target, path);\n}\n\n// Keep project and data in the global scope\nlet app = {\n name: 'kodeWeave',\n author: {\n name: 'Michael Schwartz',\n href: 'https://michaelsboost.com/',\n src: 'imgs/author.jpg'\n },\n version: '1.2',\n url: 'https://michaelsboost.com/kodeWeave/',\n license: 'https://github.com/michaelsboost/kodeWeave/blob/main/LICENSE'\n}\nlet p = {\n name: \"App name\",\n version: 0.01,\n title: \"An attractive title\",\n description: \"The most attractive description ever!\",\n author: \"kodeWeave\",\n url: \"https://michaelsboost.com/\",\n meta: \"\",\n libraries: [],\n html_pre_processor: \"html\",\n css_pre_processor: \"css\",\n javascript_pre_processor: \"javascript\",\n html: ``,\n css: ``,\n javascript: ``,\n logo: \"data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWxvbmU9Im5vIj8+CjxzdmcKICAgeG1sbnM6ZGM9Imh0dHA6Ly9wdXJsLm9yZy9kYy9lbGVtZW50cy8xLjEvIgogICB4bWxuczpjYz0iaHR0cDovL2NyZWF0aXZlY29tbW9ucy5vcmcvbnMjIgogICB4bWxuczpyZGY9Imh0dHA6Ly93d3cudz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YXRoNDI2MCIgLz4KICA8L2c+Cjwvc3ZnPgo=\",\n console: false,\n dark: true,\n diffing: false,\n module: true,\n autorun: true,\n pwa: false,\n activePanel: 'html',\n columns: true,\n columnsRight: true\n};\nlet d = {\n searchLibKey: null,\n librarySuggestions: null,\n iframeSize: null,\n activePanel: 'html',\n selectedSize: 'none',\n compiledJSX: null,\n menuDialog: null,\n settings: null,\n libraries: null,\n safeRender: null,\n demos: null\n};\nconst icons = (function() {\n const SidebarIconCSS = \"h-4 w-4\";\n const navIconCSS = \"h-3 w-3\";\n const modalIconCSS = \"h-4 w-4\";\n const panelIconCSS = \"h-3 w-3\";\n const previewIconCSS = \"h-3 -mt-1\";\n\n return {\n logo: `<svg\n class=\"${SidebarIconCSS}\" \n xmlns:dc=\"http://purl.org/dc/elements/1.1/\"\n xmlns:cc=\"http://creativecommons.org/ns#\"\n xmlns:rdf=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#\"\n xmlns:svg=\"http://www.w3.org/2000/svg\"\n xmlns=\"http://www.w3.org/2000/svg\"\n xmlns:xlink=\"http://www.w3.org/1999/xlink\"\n viewBox=\"0 0 511.99999 511.99999\"\n height=\"512\"\n width=\"512\"\n version=\"1.1\"\n id=\"svg4190\">\n <metadata\n id=\"metadata4196\">\n <rdf:RDF>\n <cc:Work\n rdf:about=\"\">\n <dc:format>image/svg+xml</dc:format>\n <dc:type\n rdf:resource=\"http://purl.org/dc/dcmitype/StillImage\" />\n <dc:title></dc:title>\n </cc:Work>\n </rdf:RDF>\n </metadata>\n <defs\n id=\"defs4194\">\n <linearGradient\n id=\"linearGradient4276\">\n <stop\n id=\"stop4278\"\n offset=\"0\"\n style=\"stop-color:#fd5d92;stop-opacity:1\" />\n <stop\n id=\"stop4280\"\n offset=\"1\"\n style=\"stop-color:#ff0000;stop-opacity:1\" />\n </linearGradient>\n <linearGradient\n gradientUnits=\"userSpaceOnUse\"\n y2=\"257.3125\"\n x2=\"0.13404165\"\n y1=\"257.3125\"\n x1=\"511.71875\"\n id=\"linearGradient4282\"\n xlink:href=\"#linearGradient4276\" />\n </defs>\n <g\n id=\"g4284\">\n <circle\n style=\"opacity:1;fill:url(#linearGradient4282);fill-opacity:1;stroke:none;stroke-width:12;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:72, 72;stroke-dashoffset:0;stroke-opacity:1\"\n id=\"path4270\"\n cx=\"256\"\n cy=\"256\"\n r=\"256\" />\n <path\n style=\"opacity:1;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:12;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:72, 72;stroke-dashoffset:0;stroke-opacity:1\"\n d=\"m 251.06068,58.678272 c -4.56032,0.07035 -20.76061,2.041945 -29.29792,3.655984 -28.34391,5.35862 -66.88081,22.619814 -73.03699,32.719061 -1.89755,3.112935 -1.94616,7.147013 -1.94616,160.817023 0,152.2588 0.0671,157.72464 1.89998,160.73121 5.20599,8.53989 36.72003,23.70934 63.45133,30.54134 9.76572,2.49593 34.33509,6.3448 38.50754,6.03169 2.00388,-0.15036 2.03203,-0.97469 2.28921,-73.09324 0.14558,-40.83759 0.65643,-73.33414 1.16109,-73.83896 1.37751,-1.37795 7.34739,1.88473 10.35752,5.66215 1.46202,1.83468 13.79755,20.65528 27.41774,41.81943 51.44452,79.93847 50.46511,78.47798 53.30494,79.19094 3.32478,0.83474 12.56708,-3.78947 27.57606,-13.78583 14.24338,-9.48646 23.8855,-17.7831 34.81972,-29.96717 11.29502,-12.58615 14.83039,-17.41785 14.83039,-20.25308 0,-1.22009 -14.9706,-24.54033 -33.40133,-52.02846 -18.37057,-27.39837 -34.10107,-51.16876 -34.95828,-52.82696 -0.85723,-1.6582 -1.55693,-4.07335 -1.55693,-5.36519 0,-1.32123 12.48959,-22.29487 28.54584,-47.94352 44.48315,-71.05856 41.93833,-66.29178 38.83081,-72.84247 -2.55755,-5.39136 -15.36262,-19.65809 -26.13129,-29.11587 -11.45459,-10.060191 -35.06413,-25.950276 -39.90612,-26.858934 -2.94154,-0.55201 -3.97519,-0.246788 -5.91766,1.742201 -1.29564,1.326648 -20.35012,32.348303 -42.34048,68.935723 -21.99036,36.5874 -41.06539,67.99167 -42.38665,69.78702 -2.61954,3.55937 -6.73281,6.09306 -8.73463,5.37838 -0.99947,-0.35683 -1.26665,-18.17035 -1.26665,-84.44394 0,-49.513196 -0.37864,-84.219226 -0.9236,-84.556138 -0.11984,-0.0741 -0.53601,-0.102446 -1.18748,-0.09238 z\"\n id=\"path4260\" />\n </g>\n </svg>`,\n twitterfill: `<svg class=\"${SidebarIconCSS}\" fill=\"currentColor\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 512 512\">\n <path d=\"M389.2 48h70.6L305.6 224.2 487 464H345L233.7 318.6 106.5 464H35.8L200.7 275.5 26.8 48H172.4L272.9 180.9 389.2 48zM364.4 421.8h39.1L151.1 88h-42L364.4 421.8z\"/>\n </svg>`,\n twitter: `<svg class=\"${SidebarIconCSS}\" fill=\"none\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"1.5\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\">\n <defs\n id=\"defs2\"><clipPath\n clipPathUnits=\"userSpaceOnUse\"\n id=\"clipPath7\"><path\n style=\"display:none;fill:#2a34ff;fill-opacity:1;stroke:none;stroke-width:0;stroke-linecap:butt;stroke-linejoin:miter;stroke-dasharray:none;stroke-opacity:1\"\n d=\"M 2.7194315,3.6106111 H 8.5920036 L 21.280954,20.389389 h -5.727371 z\"\n id=\"path7\" /><path\n id=\"lpe_path-effect7\"\n style=\"fill:#2a34ff;fill-opacity:1;stroke:none;stroke-width:0;stroke-linecap:butt;stroke-linejoin:miter;stroke-dasharray:none;stroke-opacity:1\"\n class=\"powerclip\"\n d=\"M -2.8448815,-3.9722732 H 26.113213 V 27.972273 H -2.8448815 Z M 2.7194315,3.6106111 15.553583,20.389389 h 5.727371 L 8.5920036,3.6106111 Z\" /></clipPath><clipPath\n clipPathUnits=\"userSpaceOnUse\"\n id=\"clipPath11\"><rect\n style=\"fill:#ff2a2a;fill-opacity:1;stroke:none;stroke-width:1.5;stroke-linecap:butt;stroke-linejoin:miter;stroke-dasharray:none;stroke-opacity:1\"\n id=\"rect11\"\n width=\"21.586601\"\n height=\"18.278778\"\n x=\"1.2021173\"\n y=\"2.8606112\" /></clipPath></defs><g\n style=\"fill:none;stroke:currentColor;stroke-width:1.5\"\n id=\"g2\"\n transform=\"translate(-0.04613684)\"><g\n id=\"g8\"\n clip-path=\"url(#clipPath11)\"><path\n d=\"M 2.7194315,3.6106111 H 8.5920036 L 21.280954,20.389389 h -5.727371 z\"\n id=\"path2-8\" /><path\n d=\"M 20.541589,1.5132639 19.650846,2.5619375 18.760104,3.6106111 17.869362,4.6592848 16.978619,5.7079584 16.087877,6.756632 15.197135,7.8053056 14.306392,8.8539793 13.41565,9.9026529 12.524908,10.951326 11.634165,12 10.743423,13.048674 9.852681,14.097347 8.961938,15.146021 8.071196,16.194695 7.1804539,17.243368 6.2897116,18.292042 5.3989693,19.340715 4.5082269,20.389389 3.6174846,21.438063 2.7267423,22.486736\"\n id=\"path4\"\n clip-path=\"url(#clipPath7)\" /></g></g>\n </svg>`,\n heart: `<svg class=\"w-3\" fill=\"currentColor\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 512 512\">\n <path d=\"M47.6 300.4L228.3 469.1c7.5 7 17.4 10.9 27.7 10.9s20.2-3.9 27.7-10.9L464.4 300.4c30.4-28.3 47.6-68 47.6-109.5v-5.8c0-69.9-50.5-129.5-119.4-141C347 36.5 300.6 51.4 268 84L256 96 244 84c-32.6-32.6-79-47.5-124.6-39.9C50.5 55.6 0 115.2 0 185.1v5.8c0 41.5 17.2 81.2 47.6 109.5z\" />\n </svg>`,\n html: `<svg class=\"${SidebarIconCSS}\" xmlns=\"http://www.w3.org/2000/svg\" fill=\"currentColor\" viewBox=\"0 0 384 512\">\n <path \n d=\"M0 32l34.9 395.8L191.5 480l157.6-52.2L384 32H0zm308.2 127.9H124.4l4.1 49.4h175.6l-13.6 148.4-97.9 27v.3h-1.1l-98.7-27.3-6-75.8h47.7L138 320l53.5 14.5 53.7-14.5 6-62.2H84.3L71.5 112.2h241.1l-4.4 47.7z\"/>\n </svg>`,\n css: `<svg class=\"${SidebarIconCSS}\" xmlns=\"http://www.w3.org/2000/svg\" fill=\"currentColor\" viewBox=\"0 0 512 512\">\n <path \n d=\"M480 32l-64 368-223.3 80L0 400l19.6-94.8h82l-8 40.6L210 390.2l134.1-44.4 18.8-97.1H29.5l16-82h333.7l10.5-52.7H56.3l16.3-82H480z\"/>\n </svg>`,\n javascript: `<svg class=\"${SidebarIconCSS}\" xmlns=\"http://www.w3.org/2000/svg\" fill=\"currentColor\" viewBox=\"0 0 448 512\">\n <path \n d=\"M0 32v448h448V32H0zm243.8 349.4c0 43.6-25.6 63.5-62.9 63.5-33.7 0-53.2-17.4-63.2-38.5l34.3-20.7c6.6 11.7 12.6 21.6 27.1 21.6 13.8 0 22.6-5.4 22.6-26.5V237.7h42.1v143.7zm99.6 63.5c-39.1 0-64.4-18.6-76.7-43l34.3-19.8c9 14.7 20.8 25.6 41.5 25.6 17.4 0 28.6-8.7 28.6-20.8 0-14.4-11.4-19.5-30.7-28l-10.5-4.5c-30.4-12.9-50.5-29.2-50.5-63.5 0-31.6 24.1-55.6 61.6-55.6 26.8 0 46 9.3 59.8 33.7L368 290c-7.2-12.9-15-18-27.1-18-12.3 0-20.1 7.8-20.1 18 0 12.6 7.8 17.7 25.9 25.6l10.5 4.5c35.8 15.3 55.9 31 55.9 66.2 0 37.8-29.8 58.6-69.7 58.6z\"/>\n </svg>`,\n columns: `<svg class=\"${SidebarIconCSS}\" xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" viewBox=\"0 0 24 24\" stroke-width=\"1.5\" stroke=\"currentColor\">\n <path stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 4.5v15m6-15v15m-10.875 0h15.75c.621 0 1.125-.504 1.125-1.125V5.625c0-.621-.504-1.125-1.125-1.125H4.125C3.504 4.5 3 5.004 3 5.625v12.75c0 .621.504 1.125 1.125 1.125Z\" />\n </svg>`,\n leftChev: `<svg class=\"${SidebarIconCSS}\" xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" viewBox=\"0 0 24 24\" stroke-width=\"1.5\" stroke=\"currentColor\">\n <path stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M15.75 19.5 8.25 12l7.5-7.5\" />\n </svg>`,\n rightChev: `<svg class=\"${SidebarIconCSS}\" xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" viewBox=\"0 0 24 24\" stroke-width=\"1.5\" stroke=\"currentColor\">\n <path stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"m8.25 4.5 7.5 7.5-7.5 7.5\" />\n </svg>`,\n console: `<svg class=\"${SidebarIconCSS}\" fill=\"none\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"1.5\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\">\n <path d=\"m 12,18.340203 h 8.757019\" />\n <path d=\"M 3.3316546,18.340203 10.159567,11.778315 3.2429806,5.6597968\" />\n </svg>`,\n play: `<svg class=\"${SidebarIconCSS}\" xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" viewBox=\"0 0 24 24\" stroke-width=\"1.5\" stroke=\"currentColor\">\n <path stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M5.25 5.653c0-.856.917-1.398 1.667-.986l11.54 6.347a1.125 1.125 0 0 1 0 1.972l-11.54 6.347a1.125 1.125 0 0 1-1.667-.986V5.653Z\" />\n </svg>`,\n camera: `<svg class=\"${SidebarIconCSS}\" xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" viewBox=\"0 0 24 24\" stroke-width=\"1.5\" stroke=\"currentColor\">\n <path stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M6.827 6.175A2.31 2.31 0 0 1 5.186 7.23c-.38.054-.757.112-1.134.175C2.999 7.58 2.25 8.507 2.25 9.574V18a2.25 2.25 0 0 0 2.25 2.25h15A2.25 2.25 0 0 0 21.75 18V9.574c0-1.067-.75-1.994-1.802-2.169a47.865 47.865 0 0 0-1.134-.175 2.31 2.31 0 0 1-1.64-1.055l-.822-1.316a2.192 2.192 0 0 0-1.736-1.039 48.774 48.774 0 0 0-5.232 0 2.192 2.192 0 0 0-1.736 1.039l-.821 1.316Z\" />\n <path stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M16.5 12.75a4.5 4.5 0 1 1-9 0 4.5 4.5 0 0 1 9 0ZM18.75 10.5h.008v.008h-.008V10.5Z\" />\n </svg>`,\n cog: `<svg class=\"${SidebarIconCSS}\" xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" viewBox=\"0 0 24 24\" stroke-width=\"1.5\" stroke=\"currentColor\">\n <path stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9.594 3.94c.09-.542.56-.94 1.11-.94h2.593c.55 0 1.02.398 1.11.94l.213 1.281c.063.374.313.686.645.87.074.04.147.083.22.127.325.196.72.257 1.075.124l1.217-.456a1.125 1.125 0 0 1 1.37.49l1.296 2.247a1.125 1.125 0 0 1-.26 1.431l-1.003.827c-.293.241-.438.613-.43.992a7.723 7.723 0 0 1 0 .255c-.008.378.137.75.43.991l1.004.827c.424.35.534.955.26 1.43l-1.298 2.247a1.125 1.125 0 0 1-1.369.491l-1.217-.456c-.355-.133-.75-.072-1.076.124a6.47 6.47 0 0 1-.22.128c-.331.183-.581.495-.644.869l-.213 1.281c-.09.543-.56.94-1.11.94h-2.594c-.55 0-1.019-.398-1.11-.94l-.213-1.281c-.062-.374-.312-.686-.644-.87a6.52 6.52 0 0 1-.22-.127c-.325-.196-.72-.257-1.076-.124l-1.217.456a1.125 1.125 0 0 1-1.369-.49l-1.297-2.247a1.125 1.125 0 0 1 .26-1.431l1.004-.827c.292-.24.437-.613.43-.991a6.932 6.932 0 0 1 0-.255c.007-.38-.138-.751-.43-.992l-1.004-.827a1.125 1.125 0 0 1-.26-1.43l1.297-2.247a1.125 1.125 0 0 1 1.37-.491l1.216.456c.356.133.751.072 1.076-.124.072-.044.146-.086.22-.128.332-.183.582-.495.644-.869l.214-1.28Z\" />\n <path stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M15 12a3 3 0 1 1-6 0 3 3 0 0 1 6 0Z\" />\n </svg>`,\n tidy: `<svg class=\"${previewIconCSS}\" fill=\"currentColor\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 576 512\">\n <path d=\"M566.6 54.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0l-192 192-34.7-34.7c-4.2-4.2-10-6.6-16-6.6c-12.5 0-22.6 10.1-22.6 22.6l0 29.1L364.3 320l29.1 0c12.5 0 22.6-10.1 22.6-22.6c0-6-2.4-11.8-6.6-16l-34.7-34.7 192-192zM341.1 353.4L222.6 234.9c-42.7-3.7-85.2 11.7-115.8 42.3l-8 8C76.5 307.5 64 337.7 64 369.2c0 6.8 7.1 11.2 13.2 8.2l51.1-25.5c5-2.5 9.5 4.1 5.4 7.9L7.3 473.4C2.7 477.6 0 483.6 0 489.9C0 502.1 9.9 512 22.1 512l173.3 0c38.8 0 75.9-15.4 103.4-42.8c30.6-30.6 45.9-73.1 42.3-115.8z\"/>\n </svg>`,\n rotate: `<svg class=\"${previewIconCSS}\" fill=\"currentColor\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 512 512\">\n <path d=\"M463.5 224H472c13.3 0 24-10.7 24-24V72c0-9.7-5.8-18.5-14.8-22.2s-19.3-1.7-26.2 5.2L413.4 96.6c-87.6-86.5-228.7-86.2-315.8 1c-87.5 87.5-87.5 229.3 0 316.8s229.3 87.5 316.8 0c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0c-62.5 62.5-163.8 62.5-226.3 0s-62.5-163.8 0-226.3c62.2-62.2 162.7-62.5 225.3-1L327 183c-6.9 6.9-8.9 17.2-5.2 26.2s12.5 14.8 22.2 14.8H463.5z\" />\n </svg>`,\n times: `<svg class=\"${modalIconCSS}\" xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" viewBox=\"0 0 24 24\" stroke-width=\"1.5\" stroke=\"currentColor\">\n <path stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M6 18 18 6M6 6l12 12\" />\n </svg>`,\n file: `<svg class=\"h-3 -mt-1\" fill=\"currentColor\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 384 512\">\n <path d=\"M0 64C0 28.7 28.7 0 64 0H224V128c0 17.7 14.3 32 32 32H384V448c0 35.3-28.7 64-64 64H64c-35.3 0-64-28.7-64-64V64zm384 64H256V0L384 128z\" />\n </svg>`,\n import: `<svg class=\"h-3 -mt-1 transform origin-center scale-125\" fill=\"currentColor\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 512 512\">\n <path d=\"M128 64c0-35.3 28.7-64 64-64H352V128c0 17.7 14.3 32 32 32H512V448c0 35.3-28.7 64-64 64H192c-35.3 0-64-28.7-64-64V336H302.1l-39 39c-9.4 9.4-9.4 24.6 0 33.9s24.6 9.4 33.9 0l80-80c9.4-9.4 9.4-24.6 0-33.9l-80-80c-9.4-9.4-24.6-9.4-33.9 0s-9.4 24.6 0 33.9l39 39H128V64zm0 224v48H24c-13.3 0-24-10.7-24-24s10.7-24 24-24H128zM512 128H384V0L512 128z\" />\n </svg>`,\n download: `<svg class=\"h-3 -mt-1 transform origin-center scale-125\" fill=\"currentColor\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 512 512\">\n <path d=\"M288 32c0-17.7-14.3-32-32-32s-32 14.3-32 32V274.7l-73.4-73.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3l128 128c12.5 12.5 32.8 12.5 45.3 0l128-128c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L288 274.7V32zM64 352c-35.3 0-64 28.7-64 64v32c0 35.3 28.7 64 64 64H448c35.3 0 64-28.7 64-64V416c0-35.3-28.7-64-64-64H346.5l-45.3 45.3c-25 25-65.5 25-90.5 0L165.5 352H64zm368 56a24 24 0 1 1 0 48 24 24 0 1 1 0-48z\" />\n </svg>`,\n codepen: `<svg class=\"h-3 -mt-1 transform origin-center scale-125\" fill=\"currentColor\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 512 512\">\n <path d=\"M502.285 159.704l-234-156c-7.987-4.915-16.511-4.96-24.571 0l-234 156C3.714 163.703 0 170.847 0 177.989v155.999c0 7.143 3.714 14.286 9.715 18.286l234 156.022c7.987 4.915 16.511 4.96 24.571 0l234-156.022c6-3.999 9.715-11.143 9.715-18.286V177.989c-.001-7.142-3.715-14.286-9.716-18.285zM278 63.131l172.286 114.858-76.857 51.429L278 165.703V63.131zm-44 0v102.572l-95.429 63.715-76.857-51.429L234 63.131zM44 219.132l55.143 36.857L44 292.846v-73.714zm190 229.715L61.714 333.989l76.857-51.429L234 346.275v102.572zm22-140.858l-77.715-52 77.715-52 77.715 52-77.715 52zm22 140.858V346.275l95.429-63.715 76.857 51.429L278 448.847zm190-156.001l-55.143-36.857L468 219.132v73.714z\" />\n </svg>`,\n trash: `<svg class=\"${panelIconCSS}\" xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" viewBox=\"0 0 24 24\" stroke-width=\"1.5\" stroke=\"currentColor\">\n <path stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"m14.74 9-.346 9m-4.788 0L9.26 9m9.968-3.21c.342.052.682.107 1.022.166m-1.022-.165L18.16 19.673a2.25 2.25 0 0 1-2.244 2.077H8.084a2.25 2.25 0 0 1-2.244-2.077L4.772 5.79m14.456 0a48.108 48.108 0 0 0-3.478-.397m-12 .562c.34-.059.68-.114 1.022-.165m0 0a48.11 48.11 0 0 1 3.478-.397m7.5 0v-.916c0-1.18-.91-2.164-2.09-2.201a51.964 51.964 0 0 0-3.32 0c-1.18.037-2.09 1.022-2.09 2.201v.916m7.5 0a48.667 48.667 0 0 0-7.5 0\" />\n </svg>`,\n undo: `<svg class=\"${navIconCSS}\" xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" viewBox=\"0 0 24 24\" stroke-width=\"1.5\" stroke=\"currentColor\">\n <path stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"m7.49 12-3.75 3.75m0 0 3.75 3.75m-3.75-3.75h16.5V4.499\" />\n </svg>`,\n redo: `<svg class=\"${navIconCSS}\" xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" viewBox=\"0 0 24 24\" stroke-width=\"1.5\" stroke=\"currentColor\">\n <path stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"m16.49 12 3.75 3.75m0 0-3.75 3.75m3.75-3.75H3.74V4.499\" />\n </svg>`,\n cut: `<svg class=\"${navIconCSS}\" xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" viewBox=\"0 0 24 24\" stroke-width=\"1.5\" stroke=\"currentColor\">\n <path stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"m7.848 8.25 1.536.887M7.848 8.25a3 3 0 1 1-5.196-3 3 3 0 0 1 5.196 3Zm1.536.887a2.165 2.165 0 0 1 1.083 1.839c.005.351.054.695.14 1.024M9.384 9.137l2.077 1.199M7.848 15.75l1.536-.887m-1.536.887a3 3 0 1 1-5.196 3 3 3 0 0 1 5.196-3Zm1.536-.887a2.165 2.165 0 0 0 1.083-1.838c.005-.352.054-.695.14-1.025m-1.223 2.863 2.077-1.199m0-3.328a4.323 4.323 0 0 1 2.068-1.379l5.325-1.628a4.5 4.5 0 0 1 2.48-.044l.803.215-7.794 4.5m-2.882-1.664A4.33 4.33 0 0 0 10.607 12m3.736 0 7.794 4.5-.802.215a4.5 4.5 0 0 1-2.48-.043l-5.326-1.629a4.324 4.324 0 0 1-2.068-1.379M14.343 12l-2.882 1.664\" />\n </svg>`,\n copy: `<svg class=\"${navIconCSS}\" xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" viewBox=\"0 0 24 24\" stroke-width=\"1.5\" stroke=\"currentColor\">\n <path stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M15.666 3.888A2.25 2.25 0 0 0 13.5 2.25h-3c-1.03 0-1.9.693-2.166 1.638m7.332 0c.055.194.084.4.084.612v0a.75.75 0 0 1-.75.75H9a.75.75 0 0 1-.75-.75v0c0-.212.03-.418.084-.612m7.332 0c.646.049 1.288.11 1.927.184 1.1.128 1.907 1.077 1.907 2.185V19.5a2.25 2.25 0 0 1-2.25 2.25H6.75A2.25 2.25 0 0 1 4.5 19.5V6.257c0-1.108.806-2.057 1.907-2.185a48.208 48.208 0 0 1 1.927-.184\" />\n </svg>`,\n paste: `<svg class=\"${navIconCSS}\" xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" viewBox=\"0 0 24 24\" stroke-width=\"1.5\" stroke=\"currentColor\">\n <path stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M8.25 7.5V6.108c0-1.135.845-2.098 1.976-2.192.373-.03.748-.057 1.123-.08M15.75 18H18a2.25 2.25 0 0 0 2.25-2.25V6.108c0-1.135-.845-2.098-1.976-2.192a48.424 48.424 0 0 0-1.123-.08M15.75 18.75v-1.875a3.375 3.375 0 0 0-3.375-3.375h-1.5a1.125 1.125 0 0 1-1.125-1.125v-1.5A3.375 3.375 0 0 0 6.375 7.5H5.25m11.9-3.664A2.251 2.251 0 0 0 15 2.25h-1.5a2.251 2.251 0 0 0-2.15 1.586m5.8 0c.065.21.1.433.1.664v.75h-6V4.5c0-.231.035-.454.1-.664M6.75 7.5H4.875c-.621 0-1.125.504-1.125 1.125v12c0 .621.504 1.125 1.125 1.125h9.75c.621 0 1.125-.504 1.125-1.125V16.5a9 9 0 0 0-9-9Z\" />\n </svg>`,\n indent: `<svg class=\"${navIconCSS}\" xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" viewBox=\"0 0 24 24\" stroke-width=\"1.5\" stroke=\"currentColor\">\n <path stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M17.25 8.25 21 12m0 0-3.75 3.75M21 12H3\" />\n </svg>`,\n outdent: `<svg class=\"${navIconCSS}\" xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" viewBox=\"0 0 24 24\" stroke-width=\"1.5\" stroke=\"currentColor\">\n <path stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M6.75 15.75 3 12m0 0 3.75-3.75M3 12h18\" />\n </svg>`,\n search: `<svg class=\"${navIconCSS}\" xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" viewBox=\"0 0 24 24\" stroke-width=\"1.5\" stroke=\"currentColor\">\n <path stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"m21 21-5.197-5.197m0 0A7.5 7.5 0 1 0 5.196 5.196a7.5 7.5 0 0 0 10.607 10.607Z\" />\n </svg>`,\n goto: `<svg class=\"${navIconCSS}\" xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" viewBox=\"0 0 24 24\" stroke-width=\"1.5\" stroke=\"currentColor\">\n <path stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M19.5 14.25v-2.625a3.375 3.375 0 0 0-3.375-3.375h-1.5A1.125 1.125 0 0 1 13.5 7.125v-1.5a3.375 3.375 0 0 0-3.375-3.375H8.25m5.231 13.481L15 17.25m-4.5-15H5.625c-.621 0-1.125.504-1.125 1.125v16.5c0 .621.504 1.125 1.125 1.125h12.75c.621 0 1.125-.504 1.125-1.125V11.25a9 9 0 0 0-9-9Zm3.75 11.625a2.625 2.625 0 1 1-5.25 0 2.625 2.625 0 0 1 5.25 0Z\" />\n </svg>`,\n comment: `<svg class=\"${navIconCSS}\" xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" viewBox=\"0 0 24 24\" stroke-width=\"1.5\" stroke=\"currentColor\">\n <path stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M2.25 12.76c0 1.6 1.123 2.994 2.707 3.227 1.087.16 2.185.283 3.293.369V21l4.076-4.076a1.526 1.526 0 0 1 1.037-.443 48.282 48.282 0 0 0 5.68-.494c1.584-.233 2.707-1.626 2.707-3.228V6.741c0-1.602-1.123-2.995-2.707-3.228A48.394 48.394 0 0 0 12 3c-2.392 0-4.744.175-7.043.513C3.373 3.746 2.25 5.14 2.25 6.741v6.018Z\" />\n </svg>`,\n fold: `<svg class=\"${SidebarIconCSS}\" xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" viewBox=\"0 0 24 24\" stroke-width=\"1.5\" stroke=\"currentColor\">\n <path stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"m8.25 4.5 7.5 7.5-7.5 7.5\" />\n </svg>`,\n unfold: `<svg class=\"${SidebarIconCSS}\" xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" viewBox=\"0 0 24 24\" stroke-width=\"1.5\" stroke=\"currentColor\">\n <path stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"m19.5 8.25-7.5 7.5-7.5-7.5\" />\n </svg>`,\n cursor: `<svg class=\"${SidebarIconCSS}\" xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" viewBox=\"0 0 24 24\" stroke-width=\"1.5\" stroke=\"currentColor\">\n <path stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M15.042 21.672 13.684 16.6m0 0-2.51 2.225.569-9.47 5.227 7.917-3.286-.672ZM12 2.25V4.5m5.834.166-1.591 1.591M20.25 10.5H18M7.757 14.743l-1.59 1.59M6 10.5H3.75m4.007-4.243-1.59-1.59\" />\n </svg>`\n };\n})();\n\n// Reactive objects\nconst project = onChange(p, (property, oldValue, newValue) => {\n const iframe = document.getElementById('iframe');\n const doc = iframe.contentWindow.document;\n if (oldValue !== newValue) {\n localStorage.setItem('kodeWeave', JSON.stringify(project));\n App.render('#app');\n if (property.toString() === 'activePanel') {\n if (!window.editorManager) return;\n if (project.activePanel === 'html') setActiveEditor(editorManager.htmlEditor)\n if (project.activePanel === 'css') setActiveEditor(editorManager.cssEditor)\n if (project.activePanel === 'javascript') setActiveEditor(editorManager.javascriptEditor)\n }\n if (!App.initialRender) {\n const diffArr = ['title', 'description', 'author', 'meta', 'libraries', 'html', 'css', 'console', 'dark'];\n const initRun = ['html_pre_processor', 'css_pre_processor', 'javascript_pre_processor', 'javascript'];\n const string = property.toString();\n // diff nodes\n if (diffArr.includes(string)) {\n if (project.autorun) {\n if (project.diffing) {\n renderPreview();\n } else {\n if (string !== 'css') {\n renderPreview(true);\n }\n }\n }\n if (string === 'html') {\n if (!window.editorManager) return;\n if (window.editorManager.htmlEditor.state.doc.toString() !== project.html) {\n dispatchChanges(editorManager.htmlEditor, project.html);\n }\n }\n if (string === 'css' || string === 'console') {\n let consoleCSS = `\n .wrapper_yOR7u {\n ${project.console ? '' : 'display: none!important;'}\n left: 0!important; width: 100%!important; \n border-radius: 15px 15px 0 0!important; \n z-index: 99999999;\n } \n .btn_yOR7u {\n cursor: pointer; \n background: inherit; \n padding: 0 0.5rem; \n margin: inherit; \n margin-right: 0px; \n border: inherit; \n color: #fff!important; \n } \n .nav_yOR7u {\n padding-bottom: 14px!important;\n } \n .line_yOR7u {\n background: inherit!important;\n }\n \n ${project.css}`\n doc.getElementById('cuxjju3ew').textContent = consoleCSS;\n \n if (!window.editorManager) return;\n if (string === 'css' && editorManager.cssEditor.state.doc.toString() !== project.css) {\n dispatchChanges(editorManager.cssEditor, project.css);\n }\n }\n }\n // render right away\n if (initRun.includes(string)) {\n if (string === 'javascript') {\n renderPreview(true);\n if (!window.editorManager) return;\n if (window.editorManager.jsEditor.state.doc.toString() !== project.javascript) {\n dispatchChanges(editorManager.jsEditor, project.javascript);\n return false;\n }\n }\n\n if (string === 'html_pre_processor' || string === 'css_pre_processor' || string === 'javascript_pre_processor') {\n renderPreview(true);\n }\n }\n if (string === \"dark\") {\n App.render('#app');\n document.documentElement.setAttribute('data-theme', project.dark ? 'dark' : 'light');\n document.querySelector('meta[name=apple-mobile-web-app-status-bar-style]').setAttribute('content', project.dark ? 'black-translucent' : 'default');\n document.querySelector('meta[name=theme-color]').setAttribute('content', project.dark ? '#13171f' : '#ffffff');\n document.querySelector('meta[name=msapplication-navbutton-color]').setAttribute('content', project.dark ? '#13171f' : '#ffffff');\n }\n }\n }\n});\nconst data = onChange(d, (property, oldValue, newValue) => {\n // Only render if the actual value has changed\n if (oldValue !== newValue) App.render('#app');\n});\nwindow.project = project;\nwindow.data = data;\n\n// Components\nfunction LeftMenubar() {\n const buttonSize = \"w-full\";\n\n return `<ul class=\"p-0 m-0\">\n <li class=\"list-none m-0\">\n <button\n aria-label=\"toggle menu\"\n name=\"toggle menu\"\n class=\"${buttonSize} text-sm border-0 px-0 py-3 rounded-md bg-transparent\"\n style=\"color: unset;\"\n onclick=\"data.menuDialog = true\"\n >\n ${icons.logo}\n </button>\n </li>\n <li class=\"list-none m-0\">\n <a\n aria-label=\"toggle html\"\n name=\"toggle html\"\n class=\"${buttonSize} text-sm border-0 px-4 py-3 rounded-md bg-transparent\"\n style=\"color: unset;\"\n role=\"button\"\n href=\"https://twitter.com/kodeweave_app\"\n >\n ${icons.twitter}\n </a>\n </li>\n <li class=\"list-none m-0\">\n <a\n href=\"https://michaelsboost.com/donate/\"\n aria-label=\"Donation helps developer maintence\"\n target=\"_blank\"\n role=\"button\"\n class=\"${buttonSize} text-sm border-0 px-4 py-3 rounded-md bg-transparent text-red-400\"\n >\n ${icons.heart}\n </a>\n </li>\n</ul>\n<ul class=\"p-0 m-0\">\n <li class=\"list-none m-0\">\n <hr />\n </li>\n <li class=\"list-none m-0\">\n <button\n aria-label=\"toggle html\"\n name=\"toggle html\"\n class=\"${buttonSize} text-sm border-0 px-0 py-3 rounded-md bg-transparent ${project.activePanel === 'html' ? 'text-blue-500' : ''}\"\n ${project.activePanel === 'html' ? '' : 'style=\"color: unset;\"'}\n onclick=\"setActiveEditor(htmlEditor); project.activePanel = project.activePanel === 'html' ? null : 'html'; defineScale();\"\n >\n ${icons.html}\n </button>\n </li>\n <li class=\"list-none m-0\">\n <button\n aria-label=\"toggle css\"\n name=\"toggle css\"\n class=\"${buttonSize} text-sm border-0 px-0 py-3 rounded-md bg-transparent ${project.activePanel === 'css' ? 'text-blue-500' : ''}\"\n ${project.activePanel === 'css' ? '' : 'style=\"color: unset;\"'}\n onclick=\"setActiveEditor(cssEditor); project.activePanel = project.activePanel === 'css' ? null : 'css'; defineScale();\"\n >\n ${icons.css}\n </button>\n </li>\n <li class=\"list-none m-0\">\n <button\n aria-label=\"toggle javascript\"\n name=\"toggle javascript\"\n class=\"${buttonSize} text-sm border-0 px-0 py-3 rounded-md bg-transparent ${project.activePanel === 'javascript' ? 'text-blue-500' : ''}\"\n ${project.activePanel === 'javascript' ? '' : 'style=\"color: unset;\"'}\n onclick=\"setActiveEditor(jsEditor); project.activePanel = project.activePanel === 'javascript' ? null : 'javascript'; defineScale();\"\n >\n ${icons.javascript}\n </button>\n </li>\n <li class=\"list-none m-0\">\n <hr />\n </li>\n</ul>\n<ul class=\"p-0 m-0\">\n <li class=\"list-none m-0\">\n <button\n aria-label=\"toggle console\"\n name=\"toggle console\"\n class=\"${buttonSize} text-sm border-0 px-0 py-3 rounded-md bg-transparent ${project.console ? 'text-green-500' : ''}\"\n onclick=\"project.console = !project.console;\"\n >\n ${icons.console}\n </button>\n </li>\n <li class=\"list-none m-0\">\n <button\n aria-label=\"full page screenshot\"\n name=\"full page screenshot\"\n class=\"${buttonSize} text-sm border-0 px-0 py-3 rounded-md bg-transparent\"\n style=\"color: unset;\"\n onclick=\"screenshot()\"\n >\n ${icons.camera}\n </button>\n </li>\n <li class=\"list-none m-0\">\n <button\n aria-label=\"settings button\"\n name=\"settings\"\n class=\"${buttonSize} text-sm border-0 px-4 py-3 rounded-md bg-transparent -mt-1\"\n style=\"color: unset;\"\n onclick=\"data.settings = !data.settings\"\n >\n ${icons.cog}\n </button>\n </li>\n</ul>`;\n}\nfunction PreviewMenu() {\n const buttonClass = 'border-0 bg-transparent text-sm';\n const selectClass = 'mx-0 my-2 w-auto rounded-md capitalize text-[.6rem]';\n const selectStyle = 'padding: 0.5rem;';\n\n const sizeOptions = {\n Phones: {\n '320x480': 'iPhone 3GS',\n '375x667': 'iPhone 6/7/8',\n '414x736': 'iPhone 6/7/8 Plus',\n '375x812': 'iPhone X/XS/11 Pro',\n '414x896': 'iPhone XR/XS Max/11/11 Pro Max',\n '360x640': 'Samsung Galaxy S5',\n '360x740': 'Samsung Galaxy S8+',\n '1440x3200': 'Samsung Galaxy S21 Ultra',\n '1080x2340': 'Google Pixel 5',\n '1080x2400': 'OnePlus 8 Pro',\n '1440x3200': 'Xiaomi Mi 11 Ultra',\n '1644x3840': 'Sony Xperia 1 III'\n },\n Tablets: {\n '2048x2732': 'iPad Pro 12.9\" (3rd/4th Gen)',\n '2388x1668': 'iPad Pro 11\" (1st/2nd/3rd Gen)',\n '2736x1824': 'Microsoft Surface Pro 7',\n '2800x1752': 'Samsung Galaxy Tab S7+',\n '2560x1600': 'Huawei MatePad Pro',\n '2000x1200': 'Lenovo Tab P11 Pro',\n '1920x1200': 'Amazon Fire HD 10',\n '1536x2048': 'iPad Air (3rd Gen)',\n '1620x2160': 'iPad Air (4th Gen)',\n '1620x2160': 'iPad 10.2\" (8th Gen)',\n '1668x2224': 'iPad Pro 11\" (2021)'\n },\n Desktops: {\n '3840x2160': '4K UHD (3840x2160)',\n '2560x1440': 'WQHD (2560x1440)',\n '1920x1080': 'Full HD (1920x1080)',\n '1366x768': 'Laptop (1366x768)',\n '3440x1440': 'UltraWide QHD (3440x1440)',\n '5120x2880': '5K Retina (5120x2880)',\n '1280x800': 'MacBook (1280x800)',\n '2560x1600': 'MacBook Pro (2560x1600)',\n '2880x1800': 'MacBook Pro Retina (2880x1800)'\n }\n };\n\n const previewSize = `<label for=\"selectedSize\" aria-label=\"resize canvas\" class=\"mx-2\">\n <select id=\"selectedSize\" onchange=\"resizeCanvas(this.value)\" class=\"${selectClass}\" style=\"${selectStyle}\">\n <option value=\"none\">Select Size</option>\n ${Object.keys(sizeOptions).map(group => `\n <optgroup label=\"${group}\">\n ${Object.keys(sizeOptions[group]).map(option => `\n <option value=\"${option}\">${sizeOptions[group][option]}</option>\n `).join('')}\n </optgroup>\n `).join('')}\n </select>\n </label>`;\n\n function canTidyShow() {\n if (!project.activePanel) return 'hidden'\n if (project.activePanel) {\n if (project.activePanel === 'html') {\n if (project.html_pre_processor !== 'html') {\n return 'hidden'\n }\n }\n if (project.activePanel === 'css') {\n if (project.css_pre_processor !== 'css') {\n return 'hidden'\n }\n }\n if (project.activePanel === 'javascript') {\n if (project.javascript_pre_processor !== 'javascript') {\n return 'hidden'\n }\n }\n }\n }\n\n return `<div class=\"flex justify-between items-center overflow-auto\">\n ${previewSize}\n\n <span>\n <button \n aria-label=\"rotate canvas\"\n name=\"rotate canvas\" \n class=\"${buttonClass} ${data.selectedSize === 'none' ? 'hidden' : ''}\"\n style=\"color: unset;\"\n onclick=\"rotateCanvas()\">\n ${icons.rotate}\n </button>\n\n <span class=\"${project.activePanel ? '' : 'hidden'}\">\n <button\n aria-label=\"change view\"\n name=\"change view\"\n class=\"${buttonClass} hidden sm:inline-block\"\n style=\"color: unset; ${project.columns ? '' : 'transform: rotate(90deg);'}\"\n onclick=\"project.columns = !project.columns;\"\n >\n ${icons.columns}\n </button>\n <button\n aria-label=\"toggle columns left or right\"\n name=\"toggle columns left or right\"\n class=\"${buttonClass} hidden ${project.activePanel ? `${project.columns ? '' : 'sm:inline-block'}` : ''}\"\n style=\"color: unset;\"\n onclick=\"project.columnsRight = !project.columnsRight;\"\n >\n ${project.columnsRight ? icons.leftChev : icons.rightChev}\n </button>\n </span>\n\n <button \n aria-label=\"tidy code\"\n name=\"tidy code\"\n class=\"${buttonClass} ${canTidyShow()}\"\n style=\"color: unset;\"\n onclick=\"tidy()\">\n ${icons.tidy}\n </button>\n\n <button\n aria-label=\"run preview\"\n name=\"run preview\"\n class=\"${buttonClass} ${project.autorun ? 'hidden' : ''}\"\n style=\"color: unset;\"\n onclick=\"renderPreview(true)\"\n >\n ${icons.play}\n </button>\n </span>\n</div>`;\n}\nconst App = {\n initialRender: true,\n render(container) {\n // Calculate zoom transform based on viewport size and iframe size\n const size = data.selectedSize;\n let viewportWidth, viewportHeight;\n const previewElm = document.getElementById('previewElm');\n if (document.getElementById('previewElm')) {\n viewportWidth = previewElm.clientWidth;\n viewportHeight = previewElm.clientHeight;\n }\n let [width, height] = size.split('x').map(Number);\n\n let menuDialog = `<ul class=\"py-4 px-0\">\n <li class=\"list-none\">\n <div class=\"items-center text-center\">\n <div>\n <a \n aria-label=\"project homepage\"\n name=\"project homepage\"\n target=\"_blank\" \n href=\"${app.url}\">\n <img \n alt=\"logo\"\n class=\"my-4 w-24 m-auto\"\n src=\"../imgs/logo.svg\"\n loading=\"lazy\" />\n </a>\n <div class=\"text-2xl\">\n About ${app.name}\n </div>\n <div class=\"my-2 text-xs\">\n Version ${app.version}\n </div>\n <a \n target=\"_blank\" \n class=\"text-sm underline mb-2 text-blue-500\" \n href=\"${app.license}\">\n Open Source License\n </a>\n </div>\n </div>\n </li>\n <li class=\"p-0 list-none\">\n <hr />\n </li>\n <li class=\"p-0 list-none -mt-2\">\n <button \n class=\"w-full flex gap-2 text-sm capitalize border-0 p-2 rounded-md bg-transparent\" \n style=\"color: unset;\" \n onclick=\"data.menuDialog = null; data.demos = true;\">\n <svg class=\"h-5 w-5\" xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" viewBox=\"0 0 24 24\" stroke-width=\"1.5\" stroke=\"currentColor\">\n <path stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M19.5 14.25v-2.625a3.375 3.375 0 0 0-3.375-3.375h-1.5A1.125 1.125 0 0 1 13.5 7.125v-1.5a3.375 3.375 0 0 0-3.375-3.375H8.25m2.25 0H5.625c-.621 0-1.125.504-1.125 1.125v17.25c0 .621.504 1.125 1.125 1.125h12.75c.621 0 1.125-.504 1.125-1.125V11.25a9 9 0 0 0-9-9Z\" />\n </svg>\n <span>new project</span>\n </button>\n </li>\n <li class=\"p-0 list-none\">\n <button \n class=\"w-full flex gap-2 text-sm capitalize border-0 p-2 rounded-md bg-transparent\" \n style=\"color: unset;\" \n onclick=\"data.menuDialog = null; importProject()\">\n <svg class=\"h-5 w-5\" xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" viewBox=\"0 0 24 24\" stroke-width=\"1.5\" stroke=\"currentColor\">\n <path stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M19.5 14.25v-2.625a3.375 3.375 0 0 0-3.375-3.375h-1.5A1.125 1.125 0 0 1 13.5 7.125v-1.5a3.375 3.375 0 0 0-3.375-3.375H8.25m6.75 12-3-3m0 0-3 3m3-3v6m-1.5-15H5.625c-.621 0-1.125.504-1.125 1.125v17.25c0 .621.504 1.125 1.125 1.125h12.75c.621 0 1.125-.504 1.125-1.125V11.25a9 9 0 0 0-9-9Z\" />\n </svg>\n <span>import project</span>\n </button>\n </li>\n <li class=\"p-0 list-none\">\n <button \n class=\"w-full flex gap-2 text-sm capitalize border-0 p-2 rounded-md bg-transparent\" \n style=\"color: unset;\" \n onclick=\"data.menuDialog = null; downloadJSON()\">\n <svg class=\"h-5 w-5\" xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" viewBox=\"0 0 24 24\" stroke-width=\"1.5\" stroke=\"currentColor\">\n <path stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 8.25H7.5a2.25 2.25 0 0 0-2.25 2.25v9a2.25 2.25 0 0 0 2.25 2.25h9a2.25 2.25 0 0 0 2.25-2.25v-9a2.25 2.25 0 0 0-2.25-2.25H15M9 12l3 3m0 0 3-3m-3 3V2.25\" />\n </svg>\n <span>download json</span>\n </button>\n </li>\n <li class=\"p-0 list-none\">\n <button \n class=\"w-full flex gap-2 text-sm capitalize border-0 p-2 rounded-md bg-transparent\" \n style=\"color: unset;\" \n onclick=\"data.menuDialog = null; downloadProject()\">\n <svg class=\"h-5 w-5\" xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" viewBox=\"0 0 24 24\" stroke-width=\"1.5\" stroke=\"currentColor\">\n <path stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M3 16.5v2.25A2.25 2.25 0 0 0 5.25 21h13.5A2.25 2.25 0 0 0 21 18.75V16.5M16.5 12 12 16.5m0 0L7.5 12m4.5 4.5V3\" />\n </svg>\n <span>download zip</span>\n </button>\n </li>\n <li class=\"p-0 list-none\">\n <button \n class=\"w-full flex gap-2 text-sm capitalize border-0 p-2 rounded-md bg-transparent\" \n style=\"color: unset;\" \n onclick=\"data.menuDialog = null; share()\">\n <svg class=\"h-5 w-5\" xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" viewBox=\"0 0 24 24\" stroke-width=\"1.5\" stroke=\"currentColor\">\n <path stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M7.217 10.907a2.25 2.25 0 1 0 0 2.186m0-2.186c.18.324.283.696.283 1.093s-.103.77-.283 1.093m0-2.186 9.566-5.314m-9.566 7.5 9.566 5.314m0 0a2.25 2.25 0 1 0 3.935 2.186 2.25 2.25 0 0 0-3.935-2.186Zm0-12.814a2.25 2.25 0 1 0 3.933-2.185 2.25 2.25 0 0 0-3.933 2.185Z\" />\n </svg>\n <span>share to codepen</span>\n </button>\n </li>\n <li class=\"p-0 list-none\">\n <button \n aria-label=\"Empty storage saved from kodeWeave\"\n name=\"Empty storage saved from kodeWeave\"\n class=\"w-full flex gap-2 text-sm capitalize border-0 p-2 rounded-md bg-transparent\" \n style=\"color: unset;\" \n onclick=\"emptyStorage()\">\n <svg class=\"h-5 w-5\" fill=\"currentColor\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 576 512\">\n <path d=\"M566.6 54.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0l-192 192-34.7-34.7c-4.2-4.2-10-6.6-16-6.6c-12.5 0-22.6 10.1-22.6 22.6l0 29.1L364.3 320l29.1 0c12.5 0 22.6-10.1 22.6-22.6c0-6-2.4-11.8-6.6-16l-34.7-34.7 192-192zM341.1 353.4L222.6 234.9c-42.7-3.7-85.2 11.7-115.8 42.3l-8 8C76.5 307.5 64 337.7 64 369.2c0 6.8 7.1 11.2 13.2 8.2l51.1-25.5c5-2.5 9.5 4.1 5.4 7.9L7.3 473.4C2.7 477.6 0 483.6 0 489.9C0 502.1 9.9 512 22.1 512l173.3 0c38.8 0 75.9-15.4 103.4-42.8c30.6-30.6 45.9-73.1 42.3-115.8z\"/>\n </svg>\n <span>empty storage</span>\n </button>\n </li>\n </ul>`;\n menuDialog = `<dialog ${data.menuDialog ? 'open' : ''}>\n <article class=\"rounded-md\">\n <header class=\"flex justify-between items-center\">\n <h1 class=\"text-lg font-thin m-0 capitalize\">\n file menu\n </h1>\n <button \n class=\"text-xs w-auto px-3 py-2 m-0 capitalize rounded-md bg-transparent border-0\" \n style=\"color: unset;\" \n aria-label=\"Close\"\n onclick=\"data.menuDialog = null\">\n ${icons.times}\n </button>\n </header>\n <main class=\"font-thin\">\n ${menuDialog}\n </main>\n <footer>\n <button \n class=\"text-xs w-auto px-3 py-2 m-0 capitalize rounded-md bg-transparent border ${project.dark ? 'border-gray-600' : 'border-gray-200'}\" \n style=\"color: unset;\" \n aria-label=\"Close\" \n onclick=\"data.menuDialog = null\">\n close\n </button>\n </footer>\n </article>\n </dialog>`;\n\n let settingsHTML = `<ul class=\"px-0\">\n <li class=\"list-none\">\n <div class=\"mb-2\">\n <input \n id=\"pjqgd1wka\"\n type=\"file\" \n name=\"project logo\" \n class=\"hidden\"\n onchange=\"handleLogoChange(event)\"\n />\n <label \n for=\"pjqgd1wka\"\n class=\"mb-2 flex justify-between items-center cursor-pointer\">\n <span>Project logo:</span>\n\n <img \n id=\"projectLogo\"\n class=\"w-8\"\n alt=\"Project Logo\"\n src=\"${project.logo}\"\n loading=\"lazy\">\n </label>\n </div>\n </li>\n <li class=\"list-none\">\n <nav class=\"flex justify-between mt-5 items-center\">\n <label \n for=\"o14tigo4m\"\n class=\"mb-2 flex justify-between items-center cursor-pointer\">\n <span>Dark:</span>\n </label>\n\n <input \n id=\"o14tigo4m\"\n class=\"m-0\"\n type=\"checkbox\" \n role=\"switch\"\n name=\"toggle css reset\"\n onchange=\"project.dark = this.checked;\"\n ${project.dark ? 'checked' : ''}\n />\n </nav>\n </li>\n <li class=\"list-none\">\n <nav class=\"flex justify-between mt-5 items-center\">\n <label \n for=\"k6tw02ec9\"\n class=\"mb-2 flex justify-between items-center cursor-pointer\">\n <span>Diffing:</span>\n </label>\n\n <input \n id=\"k6tw02ec9\"\n class=\"m-0\"\n type=\"checkbox\" \n role=\"switch\"\n name=\"toggle module\"\n onchange=\"project.diffing = this.checked;\"\n ${project.diffing ? 'checked' : ''}\n />\n </nav>\n </li>\n <li class=\"list-none\">\n <nav class=\"flex justify-between mt-5 items-center\">\n <label \n for=\"ep0b8bd4c\"\n class=\"mb-2 flex justify-between items-center cursor-pointer\">\n <span>Module:</span>\n </label>\n\n <input \n id=\"ep0b8bd4c\"\n class=\"m-0\"\n type=\"checkbox\" \n role=\"switch\"\n name=\"toggle module\"\n onchange=\"project.module = this.checked;\"\n ${project.module ? 'checked' : ''}\n />\n </nav>\n </li>\n <li class=\"list-none\">\n <nav class=\"flex justify-between mt-5 items-center\">\n <label \n for=\"if2s51d22\"\n class=\"mb-2 flex justify-between items-center cursor-pointer\">\n <span>Auto run:</span>\n </label>\n\n <input \n id=\"if2s51d22\"\n class=\"m-0\"\n type=\"checkbox\" \n role=\"switch\"\n name=\"toggle auto run\"\n onchange=\"project.autorun = this.checked;\"\n ${project.autorun ? 'checked' : ''}\n />\n </nav>\n </li>\n <li class=\"list-none\">\n <nav class=\"flex justify-between mt-5 items-center\">\n <label \n for=\"osbpm2k0q\"\n class=\"mb-2 flex justify-between items-center cursor-pointer\">\n <span>PWA:</span>\n </label>\n\n <input \n id=\"osbpm2k0q\"\n class=\"m-0\"\n type=\"checkbox\" \n role=\"switch\"\n name=\"export project as a pwa\"\n onchange=\"project.pwa = this.checked\"\n ${project.pwa ? 'checked' : ''}\n />\n </nav>\n </li>\n <li class=\"p-0 list-none\">\n <hr />\n </li>\n <li class=\"list-none\">\n <nav class=\"flex justifu-between -mt-3 items-center\">\n <label \n for=\"wl7i1adq7\"\n class=\"m-0 flex justify-between items-center cursor-pointer\">\n <span>Libraries:</span>\n </label>\n\n <button\n aria-label=\"search libraries\"\n name=\"search libraries\"\n class=\"bg-transparent border-0 focus-within:shadow-none\"\n style=\"color: unset;\"\n onclick=\"data.libraries = true; searchInput.focus();\">\n ${icons.search}\n </button>\n </nav>\n\n <div id=\"librariesBox\">\n ${project.libraries.map((library, index) => `\n <nav class=\"flex justify-between py-2\" data-index=\"${index}\">\n <input \n type=\"text\" \n placeholder=\"https://cdnjs.cloudflare.com/ajax/libs/Sortable/1.15.2/Sortable.min.js\" \n data=\"library\" \n class=\"w-full pl-3 pr-0 rounded-md rounded-r-none focus:shadow-none\"\n style=\"margin-bottom: 0;\"\n value=\"${library}\" \n oninput=\"project.libraries[${index}] = this.value; renderPreview(true);\" />\n <button \n aria-label=\"delete library\"\n name=\"delete library\"\n class=\"px-3 py-[15px] h-full border-0 rounded-md rounded-l-none\"\n onclick=\"project.libraries.splice(${index}, 1); renderPreview(true);\">\n ${icons.trash}\n </button>\n </nav>\n `).join('')}\n </div>\n <button \n aria-label=\"add another library or framework\" \n name=\"add another library or framework\" \n onclick=\"project.libraries.push('')\" \n class=\"capitalize py-2 w-full items-center rounded-md\">\n <span class=\"text-[.75rem]\">\n Add another\n </span>\n </button>\n </li>\n <li class=\"p-0 list-none\">\n <hr />\n </li>\n <!--\n <li class=\"list-none\">\n <nav class=\"flex justify-between mt-5 items-center\">\n <div class=\"mb-2\">\n HTML:\n </div>\n\n <select \n aria-label=\"html preprocessor\"\n name=\"html preprocessor\"\n onchange=\"setPreprocessor('html', this.value);\" \n class=\"w-auto my-0 text-[.75rem]\">\n <option value=\"html\" ${project.html_pre_processor === 'html' ? 'selected' : ''}>HTML</option>\n <option value=\"markdown\" ${project.html_pre_processor === 'markdown' ? 'selected' : ''}>Markdown</option>\n <option value=\"pug\" ${project.html_pre_processor === 'pug' ? 'selected' : ''}>Pug</option>\n </select>\n </nav>\n </li>\n <li class=\"p-0 list-none\">\n <hr />\n </li>\n <li class=\"list-none\">\n <nav class=\"flex justify-between mt-5 items-center\">\n <div class=\"mb-2\">\n CSS:\n </div>\n\n <select \n aria-label=\"css preprocessor\"\n name=\"css preprocessor\"\n onchange=\"setPreprocessor('css', this.value);\" \n class=\"w-auto my-0 text-[.75rem]\">\n <option value=\"css\" ${project.css_pre_processor === 'css' ? 'selected' : ''}>CSS</option>\n <option value=\"sass\" ${project.css_pre_processor === 'sass' ? 'selected' : ''}>Sass</option>\n <option value=\"less\" ${project.css_pre_processor === 'less' ? 'selected' : ''}>LESS</option>\n <option value=\"stylus\" ${project.css_pre_processor === 'stylus' ? 'selected' : ''}>Stylus</option>\n </select>\n </nav>\n </li>\n -->\n <li class=\"p-0 list-none\">\n <hr />\n </li>\n <li class=\"list-none\">\n <nav class=\"flex justify-between mt-5 items-center\">\n <div class=\"mb-2\">\n JS:\n </div>\n\n <select \n aria-label=\"javascript preprocessor\"\n name=\"javascript preprocessor\"\n onchange=\"setPreprocessor('javascript', this.value);\" \n class=\"w-auto my-0 text-[.75rem]\">\n <option value=\"javascript\" ${project.javascript_pre_processor === 'javascript' ? 'selected' : ''}>Javascript</option>\n <option value=\"babel\" ${project.javascript_pre_processor === 'babel' ? 'selected' : ''}>Babel (JSX / ES6)</option>\n <option value=\"typescript\" ${project.javascript_pre_processor === 'typescript' ? 'selected' : ''}>Typescript</option>\n <option value=\"jsxtypescript\" ${project.javascript_pre_processor === 'jsxtypescript' ? 'selected' : ''}>JSX + Typescript</option>\n </select>\n </nav>\n </li>\n <li class=\"p-0 list-none\">\n <hr />\n </li>\n <li class=\"list-none\">\n <div class=\"mb-2\">\n Project name:\n </div>\n <input \n type=\"text\" \n name=\"project name\"\n placeholder=\"Project name\" \n class=\"p-2 rounded-md w-full\" \n value=\"${project.name}\"\n oninput=\"project.name = this.value;\"\n />\n </li>\n <li class=\"p-0 list-none\">\n <hr />\n </li>\n <li class=\"list-none\">\n <div class=\"mb-2\">\n Project version:\n </div>\n <input \n type=\"number\" \n min=\"0\"\n step=\"0.01\"\n name=\"project version\"\n placeholder=\"Project version\" \n class=\"p-2 rounded-md w-full\" \n value=\"${project.version}\"\n oninput=\"project.version = this.value;\"\n />\n </li>\n <li class=\"p-0 list-none\">\n <hr />\n </li>\n <li class=\"list-none\">\n <div class=\"mb-2\">\n Project title:\n </div>\n <input \n type=\"text\" \n name=\"project title\"\n placeholder=\"Project title\"\n class=\"p-2 rounded-md w-full\" \n value=\"${project.title}\"\n oninput=\"project.title = this.value;\"\n />\n </li>\n <li class=\"p-0 list-none\">\n <hr />\n </li>\n <li class=\"list-none\">\n <div class=\"mb-2\">\n Project description:\n </div>\n <textarea \n name=\"project description\"\n placeholder=\"Project description\" \n class=\"p-2 rounded-md w-full resize-vertical h-56\"\n oninput=\"project.description = this.value;\"\n >${project.description}</textarea>\n </li>\n <li class=\"p-0 list-none\">\n <hr />\n </li>\n <li class=\"list-none\">\n <div class=\"mb-2\">\n Project author:\n </div>\n <input \n type=\"text\" \n name=\"project author\"\n placeholder=\"Project author\" \n class=\"p-2 rounded-md w-full\" \n value=\"${project.author}\"\n oninput=\"project.author = this.value;\"\n />\n </li>\n <li class=\"p-0 list-none\">\n <hr />\n </li>\n <li class=\"list-none\">\n <div class=\"mb-2\">\n Project url:\n </div>\n <input \n type=\"text\" \n name=\"project url\"\n placeholder=\"Project url\" \n class=\"p-2 rounded-md w-full\" \n value=\"${project.url}\"\n oninput=\"project.url = this.value;\"\n />\n </li>\n <li class=\"p-0 list-none\">\n <hr />\n </li>\n <li class=\"list-none\">\n <div class=\"my-2\">\n HTML before closing head tag:\n </div>\n <textarea \n placeholder=\"HTML before closing </head> tag\" \n class=\"p-2 rounded-md w-full resize-vertical h-56\"\n oninput=\"project.meta = this.value;\"\n >${project.meta}</textarea>\n </li>\n</ul>`;\n settingsHTML = `<dialog ${data.settings ? 'open' : ''}>\n <article class=\"rounded-md\">\n <header class=\"flex justify-between items-center\">\n <h1 class=\"text-lg font-thin m-0 capitalize\">\n settings\n </h1>\n <button \n class=\"text-xs w-auto px-3 py-2 m-0 capitalize rounded-md bg-transparent border-0\" \n style=\"color: unset;\" \n aria-label=\"Close\"\n onclick=\"data.settings = null\">\n ${icons.times}\n </button>\n </header>\n <main class=\"font-thin\">\n ${settingsHTML}\n </main>\n <footer>\n <button \n class=\"text-xs w-auto px-3 py-2 m-0 capitalize rounded-md bg-transparent border ${project.dark ? 'border-gray-600' : 'border-gray-200'}\" \n style=\"color: unset;\" \n aria-label=\"Close\" \n onclick=\"data.settings = null\">\n close\n </button>\n </footer>\n </article>\n </dialog>`;\n\n let librariesDialog = `<dialog ${data.libraries ? 'open' : ''}>\n <article class=\"rounded-md\">\n <header class=\"flex justify-between items-center\">\n <h1 class=\"text-lg font-thin m-0\">\n Search for resources (JQuery, Bootstrap, Foundation...)\n </h1>\n <button \n class=\"text-xs w-auto px-3 py-2 m-0 capitalize rounded-md bg-transparent border-0\" \n style=\"color: unset;\" \n aria-label=\"Close\"\n onclick=\"data.libraries = null; data.searchLibKey = null; searchInput.value = null;\">\n ${icons.times}\n </button>\n </header>\n <main class=\"font-thin\">\n <div class=\"p-4\">\n <input \n id=\"searchInput\" \n type=\"search\" \n placeholder=\"Search for resources (JQuery, Bootstrap, Foundation...)\" \n class=\"w-full p-3 rounded-full bg-[#1c212c]\" \n oninput=\"this.value ? data.searchLibKey = this.value : data.searchLibKey = null; data.searchLibKey ? fetchSuggestions(data.searchLibKey) : ''\" />\n \n <div class=\"relative px-4 capitalize h-auto max-h-64 overflow-auto\">\n ${data.librarySuggestions && data.searchLibKey ? data.librarySuggestions : ''}\n </div>\n </div>\n </main>\n <footer>\n <button \n class=\"text-xs w-auto px-3 py-2 m-0 capitalize rounded-md bg-transparent border ${project.dark ? 'border-gray-600' : 'border-gray-200'}\" \n style=\"color: unset;\" \n aria-label=\"Close\" \n onclick=\"data.libraries = null; data.searchLibKey = null; searchInput.value = null;\">\n close\n </button>\n </footer>\n </article>\n </dialog>`;\n const buttonClass = \"grid grid-rows-1 items-center bg-transparent border-0 focus-within:shadow-none\";\n const buttonContentClass = \"flex flex-col justify-between h-full\";\n const imageContentClass = \"grid h-full items-center\";\n const textContentClass = \"capitalize text-center mt-4\";\n \n const frameworks = [\n \"javascript\",\n \"typescript\",\n \"react\",\n \"vue\",\n \"preact\",\n \"angular\",\n \"alpine\",\n \"solid\",\n \"stimulus\",\n \"mithril\",\n \"hyperapp\",\n \"aurelia\",\n \"lit\"\n ]\n \n let buttonHTML = \"\";\n for (const name of frameworks) {\n buttonHTML += `<button\n aria-label=\"new ${name} project\"\n name=\"new ${name} project\"\n class=\"${buttonClass}\"\n style=\"color: unset;\"\n onclick=\"newProject('${name}')\">\n <div class=\"${buttonContentClass}\">\n <div class=\"${imageContentClass}\">\n <img width=\"256\" height=\"256\" src=\"imgs/frameworks/${name}.svg\" alt=\"${name}\" />\n </div>\n <div class=\"${textContentClass}\">\n ${name}\n </div>\n </div>\n </button>`;\n }\n\n let demosDialog = `<dialog ${data.demos ? 'open' : ''}>\n <article class=\"rounded-md\">\n <header class=\"flex justify-between items-center\">\n <h1 class=\"text-lg font-thin m-0\">\n Are you sure you want to start a new project?\n </h1>\n <button \n class=\"text-xs w-auto px-3 py-2 m-0 capitalize rounded-md bg-transparent border-0\" \n style=\"color: unset;\" \n aria-label=\"Close\"\n onclick=\"data.demos = null;\">\n ${icons.times}\n </button>\n </header>\n <main class=\"font-thin\">\n <div class=\"p-4 text-center\">All current data will be lost.</div>\n <div class=\"p-4 relative h-80 overflow-auto\">\n <div class=\"grid grid-cols-2 sm:grid-cols-4 gap-4\">\n ${buttonHTML}\n </div>\n </div>\n </main>\n <footer>\n <button \n class=\"text-xs w-auto px-3 py-2 m-0 capitalize rounded-md bg-transparent border ${project.dark ? 'border-gray-600' : 'border-gray-200'}\" \n style=\"color: unset;\" \n aria-label=\"Close\" \n onclick=\"data.demos = null;\">\n close\n </button>\n </footer>\n </article>\n </dialog>`;\n \n const html = `\n <div>\n <div class=\"absolute inset-y-0 left-0 flex flex-col text-center justify-between px-2 py-4 overflow-auto no-scrollbar\">\n ${LeftMenubar()}\n </div>\n \n <!-- flexbox for panels and preview -->\n <div class=\"flex flex-col flex-col-reverse sm:flex-row absolute inset-y-0 right-0 left-16 bottom-0 overflow-hidden\">\n <div class=\"relative w-full h-full border-0 border-x border-solid overflow-auto p-4 ${project.dark ? \"border-gray-800\" : \"border-gray-200\"}\">\n <nav class=\"absolute inset-0 flex flex-col ${project.columns ? 'flex-col' : `sm:flex-row ${project.columnsRight ? 'sm:flex-row-reverse' : ''}`}\">\n <div class=\"flex-grow w-full flex flex-col\">\n <div class=\"flex-none border-0 border-b border-solid ${project.dark ? \"border-gray-800\" : \"border-gray-200\"}\">\n ${PreviewMenu()}\n </div>\n <div class=\"flex-grow overflow-hidden\">\n <div id=\"previewElm\" class=\"relative grid grid-cols-1 align-center items-center w-full h-full\">\n <iframe\n id=\"iframe\"\n title=\"${project.title}\"\n class=\"bg-white ${data.selectedSize !== 'none' ? `border border-solid ${project.dark ? \"border-gray-800\" : \"border-gray-200\"} shadow-2xl shadow-blue-500` : ''}\"\n style=\"${data.selectedSize === 'none' ? 'width: 100%; height: 100%' : `\n width: ${width}px;\n height: ${height}px;\n transform: scale(${Math.min(viewportWidth / width, viewportHeight / height)});\n position: absolute;\n top: 50%;\n left: 50%;\n margin-top: -${height / 2}px;\n margin-left: -${width / 2}px;`}\"\n allow=\"accelerometer *; bluetooth *; camera *; encrypted-media *; display-capture *; geolocation *; gyroscope *; microphone *; midi *; clipboard-read *; clipboard-write *; web-share *; serial *; xr-spatial-tracking *\"\n allowfullscreen=\"true\"\n allowpaymentrequest=\"true\"\n allowtransparency=\"true\"\n sandbox=\"allow-downloads allow-forms allow-modals allow-pointer-lock allow-popups-to-escape-sandbox allow-popups allow-presentation allow-same-origin allow-scripts allow-top-navigation-by-user-activation\"\n loading=\"lazy\"\n ></iframe>\n\n <span \n id=\"iframeClientSize\" \n class=\"hidden opacity-0 transition-opacity duration-300 absolute top-0 right-0 ${project.dark ? 'bg-gray-800' : 'bg-gray-200'} p-1 text-xs\">\n ${data.iframeSize}\n </span>\n </div>\n </div>\n </div>\n <div class=\"relative flex-grow w-full ${project.columns ? 'h-1/4' : '2xl:w-1/2 h-1/4 sm:h-full sm:border-solid sm:border-0 lg:border-r '+project.dark ? \"border-gray-800\" : \"border-gray-200\"+''} ${project.activePanel ? '' : 'hidden'}\">\n <div class=\"absolute inset-0 flex flex-col justify-between\">\n <div class=\"flex-grow overflow-auto ${project.columns ? `border-0 border-t border-solid ${project.dark ? \"border-gray-800\" : \"border-gray-200\"}` : ''}\">\n <div class=\"h-full ${project.activePanel === 'html' ? '' : 'hidden'}\">\n <div \n data-ignore\n class=\"h-full\"\n aria-label=\"html editor\"\n name=\"html editor\"\n id=\"htmlEditor\"></div>\n </div>\n <div class=\"h-full ${project.activePanel === 'css' ? '' : 'hidden'}\">\n <div \n data-ignore\n class=\"h-full\"\n aria-label=\"css editor\"\n name=\"css editor\"\n id=\"cssEditor\"></div>\n </div>\n <div class=\"h-full ${project.activePanel === 'javascript' ? '' : 'hidden'}\">\n <div \n data-ignore\n class=\"h-full\"\n aria-label=\"javascript editor\"\n name=\"javascript editor\"\n id=\"jsEditor\"></div>\n </div>\n </div>\n <div class=\"flex-none overflow-auto border-0 border-t border-solid ${project.dark ? \"border-gray-800\" : \"border-gray-200\"}\">\n ${editorNav()}\n </div>\n </div>\n </div>\n </nav>\n </div>\n </div>\n\n ${menuDialog}\n ${settingsHTML}\n ${librariesDialog}\n ${demosDialog}\n </div>`\n \n const element = document.querySelector(container);\n if (!element) return;\n\n // Create a new temporary element to compare\n const parser = new DOMParser();\n const doc = parser.parseFromString(html, 'text/html');\n if (doc.body.innerHTML.trim() === html.trim()) return;\n if (App.initialRender) {\n element.innerHTML = html;\n renderPreview(true);\n App.initialRender = false;\n return false;\n }\n\n // Compare and update only the changed parts\n const currentDoc = element.firstElementChild;\n const newDoc = doc.body.firstElementChild;\n diffNodes(currentDoc, newDoc);\n }\n}\nconst Modal = {\n render({\n large,\n title = \"Are you sure you want to proceed?\",\n content,\n CloseLabel,\n ConfirmLabel,\n onLoad,\n onClose,\n onConfirm\n }) {\n // if (!options) return false;\n const hClass = \"text-lg font-thin m-0\";\n const buttonClass = \"text-xs w-auto px-3 py-2 m-0 capitalize rounded-md\";\n const svgClass = \"w-3\";\n const times = `<svg class=\"${svgClass}\" viewBox=\"0 0 384 512\">\n <path \n fill=\"currentColor\" \n d=\"M342.6 150.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L192 210.7 86.6 105.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L146.7 256 41.4 361.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L192 301.3 297.4 406.6c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L237.3 256 342.6 150.6z\"/>\n </svg>`;\n\n const html = `<article class=\"${large ? 'flex flex-col h-3/4' : ''} rounded-md\">\n <header class=\"${large ? 'flex-none' : ''} flex justify-between items-center\">\n <h1 class=\"${hClass}\">${title}</h1>\n <button class=\"${buttonClass} bg-transparent border-0\" style=\"color: unset;\" aria-label=\"Close\">\n ${times}\n </button>\n </header>\n <main class=\"font-thin ${large ? 'flex-grow' : ''}\">\n ${content ? content : ''}\n </main>\n <footer ${large ? 'class=\"flex-none\"' : ''}>\n <button class=\"${buttonClass} bg-transparent border ${project.dark ? 'border-gray-600' : 'border-gray-200'}\" style=\"color: unset;\" aria-label=\"Close\" onclick=\"this.closest('dialog').close()\">${CloseLabel ? CloseLabel : 'close'}</button>\n ${onConfirm ? `<button class=\"${buttonClass}\" aria-label=\"Confirm\">${ConfirmLabel ? ConfirmLabel : 'confirm'}</button>` : ''}\n </footer>\n </article>`;\n\n const modal = document.createElement('dialog');\n modal.open = true;\n modal.innerHTML = html;\n\n document.body.appendChild(modal);\n if (onLoad && typeof onLoad === 'function') {\n onLoad();\n }\n\n const timesBtn = modal.querySelector('header button');\n const closeBtn = modal.querySelector('footer button:first-child');\n const confirmBtn = modal.querySelector('footer button:last-child');\n\n // Confirm handler function\n timesBtn.onclick = function() {\n if (onClose && typeof onClose === 'function') {\n onClose();\n }\n document.body.removeChild(modal);\n }\n closeBtn.onclick = function() {\n if (onClose && typeof onClose === 'function') {\n onClose();\n }\n document.body.removeChild(modal);\n }\n confirmBtn.onclick = function() {\n if (onConfirm && typeof onConfirm === 'function') {\n onConfirm();\n }\n document.body.removeChild(modal);\n }\n }\n}\nfunction editorNav() {\n const buttonClass = \"border-0 bg-transparent py-1\";\n\n return `<div class=\"flex justify-between\">\n <button\n aria-label=\"indent\"\n name=\"indent\"\n class=\"${buttonClass}\"\n style=\"color: unset;\"\n onclick=\"editorCommand('indent', getActiveEditor())\">\n ${icons.indent}\n </button>\n <button\n aria-label=\"outdent\"\n name=\"outdent\"\n class=\"${buttonClass}\"\n style=\"color: unset;\"\n onclick=\"editorCommand('outdent', getActiveEditor())\">\n ${icons.outdent}\n </button>\n <button\n aria-label=\"undo\"\n name=\"undo\"\n class=\"${buttonClass}\"\n style=\"color: unset;\"\n onclick=\"editorCommand('undo', getActiveEditor())\">\n ${icons.undo}\n </button>\n <button\n aria-label=\"redo\"\n name=\"redo\"\n class=\"${buttonClass}\"\n style=\"color: unset;\"\n onclick=\"editorCommand('redo', getActiveEditor())\">\n ${icons.redo}\n </button>\n <button\n aria-label=\"search\"\n name=\"search\"\n class=\"${buttonClass}\"\n style=\"color: unset;\"\n onclick=\"editorCommand('search', getActiveEditor())\">\n ${icons.search}\n </button>\n <button\n aria-label=\"goto line\"\n name=\"goto line\"\n class=\"${buttonClass}\"\n style=\"color: unset;\"\n onclick=\"editorCommand('goto', getActiveEditor())\">\n ${icons.goto}\n </button>\n </div>\n\n <div class=\"flex justify-between\">\n <button\n aria-label=\"comment\"\n name=\"comment\"\n class=\"${buttonClass}\"\n style=\"color: unset;\"\n onclick=\"editorCommand('toggleComment', getActiveEditor())\">\n ${icons.comment}\n </button>\n <button\n aria-label=\"fold\"\n name=\"fold\"\n class=\"${buttonClass}\"\n style=\"color: unset;\"\n onclick=\"editorCommand('foldAll', getActiveEditor())\">\n ${icons.fold}\n </button>\n <button\n aria-label=\"unfold\"\n name=\"unfold\"\n class=\"${buttonClass}\"\n style=\"color: unset;\"\n onclick=\"editorCommand('unfoldAll', getActiveEditor())\">\n ${icons.unfold}\n </button>\n <button\n aria-label=\"cut\"\n name=\"cut\"\n class=\"${buttonClass}\"\n style=\"color: unset;\"\n onclick=\"editorCommand('cut', getActiveEditor())\">\n ${icons.cut}\n </button>\n <button\n aria-label=\"copy\"\n name=\"copy\"\n class=\"${buttonClass}\"\n style=\"color: unset;\"\n onclick=\"editorCommand('copy', getActiveEditor())\">\n ${icons.copy}\n </button>\n <button\n aria-label=\"paste\"\n name=\"paste\"\n class=\"${buttonClass}\"\n style=\"color: unset;\"\n onclick=\"editorCommand('paste', getActiveEditor())\">\n ${icons.paste}\n </button>\n <button\n aria-label=\"select all\"\n name=\"select all\"\n class=\"${buttonClass}\"\n style=\"color: unset;\"\n onclick=\"editorCommand('selectAll', getActiveEditor())\">\n ${icons.cursor}\n </button>\n </div>`;\n}\nfunction emptyStorage() {\n // Clear local storage\n localStorage.removeItem('kodeWeave');\n\n // Clear session storage\n sessionStorage.clear();\n\n // Clear cookies\n document.cookie.split(\";\").forEach(function(c) {\n document.cookie = c.trim().split(\"=\")[0] + '=;expires=Thu, 01 Jan 1970 00:00:00 UTC;path=/';\n });\n\n // Clear service worker caches\n if ('caches' in window) {\n caches.keys().then(function(names) {\n for (let name of names) caches.delete(name)\n });\n }\n\n // Unregister all service workers\n if ('serviceWorker' in navigator) {\n navigator.serviceWorker.getRegistrations().then(function(registrations) {\n for (let registration of registrations) registration.unregister()\n });\n }\n\n console.log('All saved data, cookies, and service worker caches have been cleared.');\n location.reload();\n}\n\n// editor functions\nconst addLibrary = url => {\n if (!url) {\n project.libraries.push('');\n document.getElementById('librariesBox').innerHTML = renderLibraries();\n return false;\n }\n\n if (!project.libraries.includes(url)) {\n project.libraries.push(url);\n } else {\n console.error(`Library already exists: ${url}`);\n }\n\n if (document.getElementById('librariesBox')) {\n document.getElementById('librariesBox').innerHTML = renderLibraries();\n }\n};\nfunction renderLibraries() {\n return project.libraries.map((library, index) => `\n <nav class=\"flex justify-between py-2\" data-index=\"${index}\">\n <input \n type=\"text\" \n placeholder=\"https://cdnjs.cloudflare.com/ajax/libs/Sortable/1.15.2/Sortable.min.js\" \n data=\"library\" \n class=\"w-full pl-3 pr-0 rounded-md rounded-r-none focus:shadow-none\"\n style=\"margin-bottom: 0;\"\n value=\"${library}\" \n oninput=\"project.libraries[${index}] = this.value\" />\n <button \n aria-label=\"delete library\"\n name=\"delete library\"\n class=\"px-3 py-[15px] h-full border-0 rounded-md rounded-l-none\"\n onclick=\"project.libraries.splice(${index}, 1);\">\n ${icons.trash}\n </button>\n </nav>\n `).join('')\n}\nfunction fetchSuggestions(key) {\n fetch(\n `https://api.cdnjs.com/libraries?search=${key}&fields=filename,description,version`\n )\n .then(response => {\n if (!response.ok) {\n throw new Error(\"Network response was not ok\");\n }\n return response.json();\n })\n .then(item => {\n if (item && item.results && item.results.length > 0) {\n const suggestions = item.results.map(result => result);\n\n data.librarySuggestions = suggestions.map(result => {\n return `\n <section \n class=\"cursor-pointer\"\n onclick=\"\n if (!project.libraries.includes('${result.latest}')) project.libraries.push('${result.latest}'); \n data.libraries = null;\n data.searchLibKey = null;\n data.librarySuggestions = null;\n searchInput.value = null;\n \">\n <div class=\"flex justify-between mb-2 font-bold text-1xl\">\n <span class=\"font-bold\">${result.name}</span>\n <span class=\"font-bold\">${result.version}</span>\n </div>\n <div class=\"text-sm font-thin\">${result.description}<br><hr></div>\n </section>`;\n }).join('');\n }\n })\n .catch(error => {\n console.error(\"Error fetching data:\", error);\n });\n}\nfunction removeScript(src) {\n const script = document.querySelector(`script[src=\"${src}\"]`);\n if (script) script.remove();\n}\nfunction removeScripts(scripts) {\n scripts.forEach(src => {\n const script = document.querySelector(`script[src=\"${src}\"]`);\n if (script) script.remove();\n });\n}\nasync function loadScript(scriptUrl) {\n return new Promise((resolve, reject) => {\n // Check if the script is already loaded\n const existingScript = document.querySelector(`script[src=\"${scriptUrl}\"]`);\n if (existingScript) {\n resolve(); // If the script is already present, resolve immediately\n return;\n }\n\n // Create a new script element if not present\n const scriptElement = document.createElement('script');\n scriptElement.src = scriptUrl;\n scriptElement.onload = resolve; // Resolve when the script is successfully loaded\n scriptElement.onerror = () => reject(new Error(`Failed to load script: ${scriptUrl}`)); // Reject on error\n document.body.appendChild(scriptElement); // Append the script to the body\n });\n}\nasync function loadScripts(srcArray) {\n return Promise.all(srcArray.map(loadScript));\n}\nasync function setPreprocessor(editor, value) {\n const scriptMap = {\n html: {\n markdown: \"libraries/preprocessors/marked.min.js\",\n jade: \"libraries/preprocessors/jade.js\",\n pug: \"libraries/preprocessors/pug.js\"\n },\n css: {\n sass: \"libraries/preprocessors/sass.sync.min.js\",\n less: \"libraries/preprocessors/less.min.js\",\n stylus: \"libraries/preprocessors/stylus.min.js\"\n },\n javascript: {\n typescript: \"libraries/preprocessors/typescript.min.js\",\n babel: \"libraries/preprocessors/babel.min.js\",\n jsxtypescript: [\n \"libraries/preprocessors/typescript.min.js\",\n \"libraries/preprocessors/babel.min.js\"\n ]\n }\n };\n\n const currentPreprocessors = {\n html: project.html_pre_processor,\n css: project.css_pre_processor,\n javascript: project.javascript_pre_processor\n };\n\n try {\n const scriptSrcCondition = (value !== 'html' || value !== 'css' || value !== 'javascript');\n const scriptSrc = scriptSrcCondition ? scriptMap[editor][value] : null;\n\n // Remove the current preprocessor scripts\n if (currentPreprocessors[editor] && scriptSrcCondition) {\n const currentScriptSrc = scriptMap[editor][currentPreprocessors[editor]];\n Array.isArray(currentScriptSrc) ? removeScripts(currentScriptSrc) : removeScript(currentScriptSrc)\n\n // Load the new preprocessor scripts\n if (Array.isArray(scriptSrc)) {\n await loadScripts(scriptSrc);\n } else if (scriptSrc) {\n await loadScript(scriptSrc);\n }\n }\n\n // Set the new preprocessor\n if (editor === 'html') {\n project.html_pre_processor = value;\n // if (!window.editorManager || !window.editorManager.htmlEditor) return;\n // window.editorManager.setMode(project.html_pre_processor === 'html' ? 'html' : value, editorManager.htmlEditor);\n } else if (editor === 'css') {\n project.css_pre_processor = value;\n // if (!window.editorManager || !window.editorManager.cssEditor) return;\n // window.editorManager.setMode(project.css_pre_processor === 'css' ? 'css' : value, editorManager.cssEditor);\n } else if (editor === 'javascript') {\n project.javascript_pre_processor = value;\n if (!window.editorManager || !window.editorManager.jsEditor) return;\n window.editorManager.setMode(project.javascript_pre_processor === 'javascript' ? 'javascript' : value, editorManager.jsEditor);\n }\n } catch (error) {\n console.error('Error setting preprocessor:', error);\n }\n}\nasync function initializePreprocessors() {\n await Promise.all([\n setPreprocessor('html', project.html_pre_processor),\n setPreprocessor('css', project.css_pre_processor),\n setPreprocessor('javascript', project.javascript_pre_processor)\n ]);\n \n if (!window.editorManager) return;\n dispatchChanges(editorManager.htmlEditor, project.html);\n dispatchChanges(editorManager.cssEditor, project.css);\n dispatchChanges(editorManager.jsEditor, project.javascript);\n renderPreview(true);\n}\nasync function loadBeautifyLibraries() {\n const beautifyLibraries = [\n \"libraries/js-beautify/beautify.min.js\",\n \"libraries/js-beautify/beautify-css.min.js\",\n \"libraries/js-beautify/beautify-html.min.js\"\n ];\n await loadScripts(beautifyLibraries);\n}\nasync function removeBeautifyLibraries() {\n const beautifyLibraries = [\n \"libraries/js-beautify/beautify.min.js\",\n \"libraries/js-beautify/beautify-css.min.js\",\n \"libraries/js-beautify/beautify-html.min.js\"\n ];\n removeScripts(beautifyLibraries);\n}\nasync function tidy() {\n await loadBeautifyLibraries();\n\n let formattedCode;\n switch (project.activePanel) {\n case 'html':\n formattedCode = html_beautify(project.html, {\n indent_size: 2,\n max_preserve_newlines: 1\n });\n dispatchChanges(editorManager.htmlEditor, formattedCode);\n break;\n case 'css':\n formattedCode = css_beautify(project.css, {\n indent_size: 2,\n max_preserve_newlines: 1\n });\n project.css = formattedCode;\n dispatchChanges(editorManager.cssEditor, formattedCode);\n break;\n case 'javascript':\n formattedCode = beautify(project.javascript, {\n indent_size: 2,\n max_preserve_newlines: 1\n });\n project.javascript = formattedCode;\n dispatchChanges(editorManager.jsEditor, formattedCode);\n break;\n default:\n formattedCode = 'Unknown editor panel.';\n }\n\n await removeBeautifyLibraries();\n}\n\n// iframe functions\nfunction generateId() {\n let id = '';\n while (!/^[a-zA-Z]/.test(id)) {\n id = Math.random().toString(36).substr(2, 9);\n }\n return id;\n}\nfunction resizeCanvas(size) {\n data.selectedSize = size;\n getIFrameClientSize();\n}\nfunction rotateCanvas() {\n const iframe = document.getElementById('previewElm').firstElementChild;\n if (iframe.style.width === '100%') return false;\n\n // Extract current width and height\n let width = parseInt(iframe.style.width);\n let height = parseInt(iframe.style.height);\n\n // Swap width and height\n [width, height] = [height, width];\n\n // Calculate the new transform scale\n const viewportWidth = previewElm.clientWidth;\n const viewportHeight = previewElm.clientHeight;\n const scale = Math.min(viewportWidth / width, viewportHeight / height);\n\n // Apply the new styles\n iframe.style.width = `${width}px`;\n iframe.style.height = `${height}px`;\n iframe.style.transform = `scale(${scale})`;\n iframe.style.marginTop = `-${height / 2}px`;\n iframe.style.marginLeft = `-${width / 2}px`;\n data.selectedSize = width+'x'+height;\n}\nfunction defineScale() {\n const iframe = document.getElementById('previewElm').firstElementChild;\n if (iframe.style.width === '100%') return false;\n\n // Extract current width and height\n let width = parseInt(iframe.style.width);\n let height = parseInt(iframe.style.height);\n\n // Calculate the new transform scale\n const viewportWidth = previewElm.clientWidth;\n const viewportHeight = previewElm.clientHeight;\n const scale = Math.min(viewportWidth / width, viewportHeight / height);\n\n // Apply the new styles\n iframe.style.width = `${width}px`;\n iframe.style.height = `${height}px`;\n iframe.style.transform = `scale(${scale})`;\n iframe.style.marginTop = `-${height / 2}px`;\n iframe.style.marginLeft = `-${width / 2}px`;\n}\nlet fadeTimeout;\nfunction getIFrameClientSize() {\n if (data.selectedSize === 'none') {\n const iframe = document.getElementById('iframe');\n data.iframeSize = `${iframe.clientWidth}px x ${iframe.clientHeight}px`;\n const element = document.getElementById('iframeClientSize');\n \n if (element.classList.contains('hidden')) {\n // Clear existing timeout to prevent multiple calls\n if (fadeTimeout) clearTimeout(fadeTimeout);\n \n // Remove hidden and add opacity-100 to show the element\n element.classList.remove('hidden', 'opacity-0');\n element.classList.add('opacity-100');\n \n // Set a timeout to handle fade-out\n fadeTimeout = setTimeout(() => {\n element.classList.remove('opacity-100');\n element.classList.add('opacity-0');\n \n // Add hidden class after fade-out\n setTimeout(() => {\n element.classList.add('hidden');\n }, 300); // Match the duration of the opacity transition\n }, 2000); // Show duration\n }\n } else {\n defineScale();\n }\n}\nasync function compileCode(detect) {\n try {\n if (detect === 'html') {\n switch (project.html_pre_processor) {\n case 'markdown':\n return marked.parse(project.html);\n case 'jade':\n return jade.render(project.html, { pretty: true });\n case 'pug':\n const appScript = document.getElementById('appScript');\n if (appScript.hasAttribute('type') && appScript.getAttribute('type') === 'module') {\n // import pug from 'libraries/preprocessors/pug.js';\n console.error('Cannot import pug as script is a module!');\n return false;\n }\n\n const pug = require(\"pug\");\n return pug.compile(project.html)({name: this.name });\n default:\n return project.html;\n }\n }\n\n if (detect === 'css') {\n switch (project.css_pre_processor) {\n case 'stylus':\n return stylus.render(project.css);\n case 'less':\n return new Promise((resolve, reject) => {\n less.render(project.css, (err, output) => err ? reject(err) : resolve(output.css));\n });\n case 'sass':\n return new Promise((resolve, reject) => {\n Sass.compile(project.css, result => result.status === 0 ? resolve(result.text) : reject(new Error(result.message)));\n });\n default:\n return project.css;\n }\n }\n\n if (detect === 'javascript') {\n switch (project.javascript_pre_processor) {\n case 'babel':\n if (typeof Babel === 'undefined') {\n await loadScript(\"libraries/preprocessors/babel.min.js\");\n }\n return Babel.transform(project.javascript, { presets: ['env', 'react'] }).code;\n case 'typescript':\n return ts.transpileModule(project.javascript, { compilerOptions: { module: ts.ModuleKind.CommonJS } }).outputText;\n case 'jsxtypescript':\n const result = ts.transpileModule(project.javascript, {\n compilerOptions: { module: ts.ModuleKind.CommonJS, target: ts.ScriptTarget.ES5, jsx: ts.JsxEmit.React }\n }).outputText;\n data.compiledJSX = Babel.transform(result, {\n presets: ['env', 'react']\n }).code;\n return data.compiledJSX;\n default:\n return project.javascript;\n }\n }\n } catch (error) {\n console.error('Error compiling code:', error);\n }\n}\n\n// save functions\nasync function handleLogoChange(event) {\n const file = event.target.files[0];\n if (!file) return; // If no file selected, return\n\n try {\n // Convert file to base64 string\n const base64String = await fileToBase64(file);\n // Update project.logo with base64String\n project.logo = base64String;\n } catch (error) {\n console.error('Error converting image to base64:', error);\n }\n}\nfunction fileToBase64(file) {\n return new Promise((resolve, reject) => {\n const reader = new FileReader();\n reader.readAsDataURL(file);\n reader.onload = () => resolve(reader.result);\n reader.onerror = error => reject(error);\n });\n}\n\nfunction newProject(name) {\n function capitalizeFirstLetter(string) {\n return string.charAt(0).toUpperCase() + string.slice(1);\n }\n const capitalizedTitle = capitalizeFirstLetter(name);\n setPreprocessor('html', 'html');\n setPreprocessor('css', 'css');\n if (name !== \"typescript\") setPreprocessor('javascript', 'javascript');\n if (name === \"typescript\" || name === \"angular\") setPreprocessor('javascript', 'typescript');\n project.name = `${capitalizedTitle} name`;\n project.version = 0.01;\n project.title = `A Cool ${capitalizedTitle} App`;\n project.description = `A modern ${capitalizedTitle} application!`;\n project.author = \"kodeWeave\";\n project.url = \"https://michaelsboost.com/\";\n project.diffing = false;\n project.module = true;\n if (name === 'angular') project.module = false;\n project.pwa = false;\n\n if (name === 'javascript') {\n project.meta = \"\";\n project.libraries = [\n \"https://cdnjs.cloudflare.com/ajax/libs/picocss/2.0.6/pico.min.css\",\n \"https://michaelsboost.com/TailwindCSSMod/tailwind-mod.min.js\"\n ];\n project.html = `<div class=\"flex flex-col items-center justify-center absolute inset-0\">\n <h1 class=\"text-3xl font-thin mb-4\">\uD83D\uDC4B Hello, ${capitalizedTitle}! \uD83C\uDF0E</h1>\n <p class=\"text-xl mb-4\">Counter: <span id=\"counter\" class=\"font-mono\">0</span></p>\n <button id=\"incrementButton\" class=\"px-4 py-2 bg-blue-500 text-white rounded hover:bg-blue-700 transition\">\n +\n </button>\n</div>`;\n project.css = ``;\n project.javascript = `let counter = 0;\nconst counterElement = document.getElementById('counter');\nconst incrementButton = document.getElementById('incrementButton');\n\nincrementButton.addEventListener('click', function() {\n counter++;\n counterElement.textContent = counter;\n});`;\n }\n if (name === 'typescript') {\n project.meta = \"\";\n project.libraries = [\n \"https://cdnjs.cloudflare.com/ajax/libs/picocss/2.0.6/pico.min.css\",\n \"https://michaelsboost.com/TailwindCSSMod/tailwind-mod.min.js\"\n ];\n project.html = `<div class=\"flex flex-col items-center justify-center absolute inset-0\">\n <h1 class=\"text-3xl font-thin mb-4\">\uD83D\uDC4B Hello, ${capitalizedTitle}! \uD83C\uDF0E</h1>\n <p class=\"text-xl mb-4\">Counter: <span id=\"counter\" class=\"font-mono\">0</span></p>\n <button id=\"incrementButton\" class=\"px-4 py-2 bg-blue-500 text-white rounded hover:bg-blue-700 transition\">\n +\n </button>\n</div>`;\n project.css = ``;\n project.javascript = `let counter: number = 0;\nconst counterElement: HTMLElement | null = document.getElementById('counter');\nconst incrementButton: HTMLElement | null = document.getElementById('incrementButton');\n\nif (counterElement && incrementButton) {\n incrementButton.addEventListener('click', function() {\n counter++;\n counterElement.textContent = counter.toString();\n });\n}`;\n }\n if (name === 'react') {\n project.meta = \"\";\n project.libraries = [\n \"https://unpkg.com/react@latest/umd/react.development.js\",\n \"https://unpkg.com/react-dom@latest/umd/react-dom.development.js\",\n \"https://cdnjs.cloudflare.com/ajax/libs/picocss/2.0.6/pico.min.css\",\n \"https://michaelsboost.com/TailwindCSSMod/tailwind-mod.min.js\"\n ];\n project.html = `<div id=\"root\"></div>`;\n project.css = ``;\n project.javascript = `/** @jsxRuntime classic */\n/** @jsx React.createElement */\nconst { useState } = React;\n\nfunction App() {\n const [counter, setCounter] = useState(0);\n\n return (\n <div className=\"flex flex-col items-center justify-center absolute inset-0\">\n <h1 className=\"text-3xl font-thin mb-4\">\uD83D\uDC4B Hello, ${capitalizedTitle}! \uD83C\uDF0E</h1>\n <p className=\"text-xl mb-4\">Counter: <span id=\"counter\" className=\"font-mono\">{counter}</span></p>\n <button\n id=\"incrementButton\"\n className=\"px-4 py-2 bg-blue-500 text-white rounded hover:bg-blue-700 transition\"\n onClick={() => setCounter(counter + 1)}\n >\n +\n </button>\n </div>\n );\n}\n\nconst root = ReactDOM.createRoot(document.getElementById('root'));\nroot.render(<App />);`;\n }\n if (name === 'vue') {\n project.meta = \"\";\n project.libraries = [\n \"https://cdnjs.cloudflare.com/ajax/libs/vue/3.2.37/vue.global.prod.min.js\",\n \"https://cdnjs.cloudflare.com/ajax/libs/picocss/2.0.6/pico.min.css\",\n \"https://michaelsboost.com/TailwindCSSMod/tailwind-mod.min.js\"\n ];\n project.html = `<div id=\"root\"></div>`;\n project.css = ``;\n project.javascript = `const App = {\n data() {\n return {\n counter: 0,\n message: '\uD83D\uDC4B Hello, ${capitalizedTitle}! \uD83C\uDF0E'\n };\n },\n methods: {\n incrementCounter() {\n this.counter++;\n }\n },\n template: \\`\n <div class=\"flex flex-col items-center justify-center absolute inset-0\">\n <h1 class=\"text-3xl font-thin mb-4\">{{ message }}</h1>\n <p class=\"text-xl mb-4\">Counter: <span id=\"counter\" class=\"font-mono\">{{ counter }}</span></p>\n <button\n id=\"incrementButton\"\n class=\"px-4 py-2 bg-blue-500 text-white rounded hover:bg-blue-700 transition\"\n @click=\"incrementCounter\"\n >\n +\n </button>\n </div>\n \\`\n };\n \n const app = Vue.createApp(App);\n app.mount('#root');`;\n }\n if (name === 'preact') {\n project.meta = `<script src=\"https://cdn.jsdelivr.net/npm/alpinejs@3.14.1/dist/cdn.min.js\" defer></script>`;\n project.libraries = [\n \"https://unpkg.com/preact@latest/dist/preact.min.js\",\n \"https://cdnjs.cloudflare.com/ajax/libs/picocss/2.0.6/pico.min.css\",\n \"https://michaelsboost.com/TailwindCSSMod/tailwind-mod.min.js\"\n ];\n project.html = `<div id=\"root\"></div>`;\n project.css = ``;\n project.javascript = `/** @jsx h */\nimport { html, render, useState, useEffect } from 'https://unpkg.com/htm@3.1.1/preact/standalone.module.js';\n\nfunction App() {\n const [counter, setCounter] = useState(0);\n\n return html\\`\n <div class=\"flex flex-col items-center justify-center absolute inset-0\">\n <h1 class=\"text-3xl font-thin mb-4\">\uD83D\uDC4B Hello, ${capitalizedTitle}! \uD83C\uDF0E</h1>\n <p class=\"text-xl mb-4\">Counter: <span id=\"counter\" class=\"font-mono\">\\${counter}</span></p>\n <button\n id=\"incrementButton\"\n class=\"px-4 py-2 bg-blue-500 text-white rounded hover:bg-blue-700 transition\"\n onClick=\\${() => setCounter(counter + 1)}\n >\n +\n </button>\n </div>\n \\`;\n}\n\nrender(html\\`<\\${App} />\\`, document.getElementById('root'));`;\n }\n if (name === 'angularold') {\n project.meta = ``;\n project.libraries = [\n \"https://ajax.googleapis.com/ajax/libs/angularjs/1.8.2/angular.min.js\",\n \"https://cdnjs.cloudflare.com/ajax/libs/picocss/2.0.6/pico.min.css\",\n \"https://michaelsboost.com/TailwindCSSMod/tailwind-mod.min.js\"\n ];\n project.html = `<div ng-app=\"myApp\" ng-controller=\"MainController\" class=\"flex flex-col items-center justify-center absolute inset-0\">\n <h1 class=\"text-3xl font-thin mb-4\">\uD83D\uDC4B Hello, ${capitalizedTitle}! \uD83C\uDF0E</h1>\n <p class=\"text-xl mb-4\">Counter: <span id=\"counter\" class=\"font-mono\">{{counter}}</span></p>\n <button\n id=\"incrementButton\"\n class=\"px-4 py-2 bg-blue-500 text-white rounded hover:bg-blue-700 transition\"\n ng-click=\"incrementCounter()\"\n >\n +\n </button>\n </div>`;\n project.css = ``;\n project.javascript = `angular.module('myApp', [])\n .controller('MainController', function($scope) {\n $scope.counter = 0;\n $scope.incrementCounter = function() {\n $scope.counter++;\n };\n });`;\n }\n if (name === 'angular') {\n project.meta = ``;\n project.libraries = [\n \"https://cdnjs.cloudflare.com/ajax/libs/rxjs/6.6.3/rxjs.umd.min.js\",\n \"https://cdnjs.cloudflare.com/ajax/libs/core-js/2.5.7/core.js\",\n \"https://unpkg.com/@angular/core@11.0.5/bundles/core.umd.js\",\n \"https://cdnjs.cloudflare.com/ajax/libs/zone.js/0.10.3/zone.min.js\",\n \"https://unpkg.com/@angular/common@11.0.5/bundles/common.umd.js\",\n \"https://unpkg.com/@angular/compiler@11.0.5/bundles/compiler.umd.js\",\n \"https://unpkg.com/@angular/platform-browser@11.0.5/bundles/platform-browser.umd.js\",\n \"https://unpkg.com/@angular/platform-browser-dynamic@11.0.5/bundles/platform-browser-dynamic.umd.js\",\n \"https://cdnjs.cloudflare.com/ajax/libs/picocss/2.0.6/pico.min.css\",\n \"https://michaelsboost.com/TailwindCSSMod/tailwind-mod.min.js\"\n ];\n project.html = `<app-root>Loading...</app-root>`;\n project.css = ``;\n project.javascript = `const { Component, NgModule, enableProdMode } = ng.core;\nconst { BrowserModule } = ng.platformBrowser;\nconst { platformBrowserDynamic } = ng.platformBrowserDynamic;\n\nenableProdMode();\n\n@Component({\n selector: 'app-root',\n template: \\`\n <div class=\"flex flex-col items-center justify-center absolute inset-0\">\n <h1 class=\"text-3xl font-thin mb-4\">\uD83D\uDC4B Hello, ${capitalizedTitle}! \uD83C\uDF0E</h1>\n <p class=\"text-xl mb-4\">Counter: <span id=\"counter\" class=\"font-mono\">{{ counter }}</span></p>\n <button\n id=\"incrementButton\"\n class=\"px-4 py-2 bg-blue-500 text-white rounded hover:bg-blue-700 transition\"\n (click)=\"incrementCounter()\"\n >\n +\n </button>\n </div>\n \\`,\n})\nclass AppComponent {\n counter = 0;\n \n incrementCounter() {\n this.counter++;\n }\n}\n\n@NgModule({\n declarations: [AppComponent],\n imports: [BrowserModule],\n bootstrap: [AppComponent]\n})\nclass AppModule {}\n\nplatformBrowserDynamic().bootstrapModule(AppModule);`;\n }\n if (name === 'alpine') {\n project.meta = `<script src=\"https://cdn.jsdelivr.net/npm/alpinejs@3.14.1/dist/cdn.min.js\" defer></script>`;\n project.libraries = [\n \"https://cdnjs.cloudflare.com/ajax/libs/picocss/2.0.6/pico.min.css\",\n \"https://michaelsboost.com/TailwindCSSMod/tailwind-mod.min.js\"\n ];\n project.html = `<div x-data=\"{ counter: 0 }\" class=\"flex flex-col items-center justify-center absolute inset-0\">\n <div class=\"flex flex-col items-center justify-center absolute inset-0\">\n <h1 class=\"text-3xl font-thin mb-4\">\uD83D\uDC4B Hello, ${capitalizedTitle}! \uD83C\uDF0E</h1>\n <p class=\"text-xl mb-4\">Counter: <span class=\"font-mono\" x-text=\"counter\"></span></p>\n <button\n class=\"px-4 py-2 bg-blue-500 text-white rounded hover:bg-blue-700 transition\"\n x-on:click=\"counter++\"\n >\n +\n </button>\n </div>\n</div>`;\n project.css = ``;\n project.javascript = ``;\n project.diffing = true;\n }\n if (name === 'solid') {\n project.meta = ``;\n project.libraries = [\n \"https://cdnjs.cloudflare.com/ajax/libs/picocss/2.0.6/pico.min.css\",\n \"https://michaelsboost.com/TailwindCSSMod/tailwind-mod.min.js\"\n ];\n project.html = `<div id=\"root\"></div>`;\n project.css = ``;\n project.javascript = `import { createSignal } from \"https://cdn.skypack.dev/solid-js@1.2.6\";\nimport { render } from \"https://cdn.skypack.dev/solid-js@1.2.6/web\";\nimport html from \"https://cdn.skypack.dev/solid-js@1.2.6/html\";\n\nfunction Counter() {\n const [count, setCount] = createSignal(0);\n const increment = () => setCount(count() + 1);\n\n return html\\`\n <div class=\"flex flex-col items-center justify-center absolute inset-0\">\n <h1 class=\"text-3xl font-thin mb-4\">\uD83D\uDC4B Hello, ${capitalizedTitle}! \uD83C\uDF0E</h1>\n <p class=\"text-xl mb-4\">Counter: <span class=\"font-mono\">\\${count}</span></p>\n <button type=\"button\" onClick=\\${increment}>\n +\n </button>\n </div>\n \\`;\n}\n\nrender(Counter, document.getElementById(\"root\"));`;\n }\n if (name === 'stimulus') {\n project.meta = \"\";\n project.libraries = [\n \"https://cdn.jsdelivr.net/npm/@hotwired/stimulus@3.1.0/dist/stimulus.umd.js\",\n \"https://cdn.jsdelivr.net/npm/@hotwired/stimulus-loading@1.0.0/dist/stimulus-loading.umd.js\",\n \"https://cdnjs.cloudflare.com/ajax/libs/picocss/2.0.6/pico.min.css\",\n \"https://michaelsboost.com/TailwindCSSMod/tailwind-mod.min.js\"\n ];\n project.html = `<div data-controller=\"counter\" class=\"flex flex-col items-center justify-center absolute inset-0\">\n <h1 class=\"text-3xl font-thin mb-4\">\uD83D\uDC4B Hello, ${capitalizedTitle}! \uD83C\uDF0E</h1>\n <p class=\"text-xl mb-4\">Counter: <span data-counter-target=\"output\" class=\"font-mono\">0</span></p>\n <button\n data-action=\"click->counter#increment\"\n class=\"px-4 py-2 bg-blue-500 text-white rounded hover:bg-blue-700 transition\"\n >\n +\n </button>\n</div>`;\n project.css = ``;\n project.javascript = `const application = Stimulus.Application.start();\n\napplication.register('counter', class extends Stimulus.Controller {\n static targets = ['output'];\n\n initialize() {\n this.counter = 0;\n }\n\n increment() {\n this.counter += 1;\n this.outputTarget.textContent = this.counter;\n }\n});`;\n }\n if (name === 'mithril') {\n project.meta = \"\";\n project.libraries = [\n \"https://cdn.jsdelivr.net/npm/mithril@2.0.4/mithril.min.js\",\n \"https://cdnjs.cloudflare.com/ajax/libs/picocss/2.0.6/pico.min.css\",\n \"https://michaelsboost.com/TailwindCSSMod/tailwind-mod.min.js\"\n ];\n project.html = `<div id=\"root\"></div>`;\n project.css = ``;\n project.javascript = `import htm from 'https://unpkg.com/htm?module'\nconst html = htm.bind(m)\n\nconst app = () => {\n let count = 0\n \n return {\n view: () => html\\`\n <div class=\"flex flex-col items-center justify-center absolute inset-0\">\n <h1 class=\"text-3xl font-thin mb-4\">\uD83D\uDC4B Hello, Mithril! \uD83C\uDF0E</h1>\n <p class=\"text-xl mb-4\">Counter: <span class=\"font-mono\">\\${count}</span></p>\n <button onclick=\\${() => count++}>+</button>\n </div>\\`\n }\n}\n\nm.mount(document.getElementById('root'), app)`;\n }\n if (name === 'hyperapp') {\n project.meta = `<script src=\"https://unpkg.com/hyperapp@0.16.0\"></script>`;\n project.libraries = [\n \"https://cdnjs.cloudflare.com/ajax/libs/picocss/2.0.6/pico.min.css\",\n \"https://michaelsboost.com/TailwindCSSMod/tailwind-mod.min.js\"\n ];\n project.html = `<h1 id=\"root\"></h1>`;\n project.css = ``;\n project.javascript = `import { app } from 'https://unpkg.com/hyperapp';\nimport html from 'https://unpkg.com/hyperlit';\n\napp({\n init: 0,\n view: count => html\\`\n <div class=\"flex flex-col items-center justify-center absolute inset-0\">\n <h1 class=\"text-3xl font-thin mb-4\">\uD83D\uDC4B Hello, Hyperapp! \uD83C\uDF0E</h1>\n <p class=\"text-xl mb-4\">Counter: <span class=\"font-mono\">\\${count}</span></p>\n <button onclick=\\${count => count + 1}>+</button>\n </div>\\`,\n node: document.getElementById('root')\n})`;\n }\n if (name === 'aurelia') {\n project.meta = '<script src=\"https://cdn.jsdelivr.net/npm/aurelia-script@1.4.0\"></script>';\n project.libraries = [\n \"https://cdnjs.cloudflare.com/ajax/libs/picocss/2.0.6/pico.min.css\",\n \"https://michaelsboost.com/TailwindCSSMod/tailwind-mod.min.js\"\n ];\n project.html = `<template id=\"root\">\n <div class=\"flex flex-col items-center justify-center absolute inset-0\">\n <h1 class=\"text-3xl font-thin mb-4\">\uD83D\uDC4B Hello, ${capitalizedTitle}! \uD83C\uDF0E</h1>\n <p class=\"text-xl mb-4\">Counter: <span id=\"counter\" class=\"font-mono\">0</span></p>\n <button \n class=\"px-4 py-2 bg-blue-500 text-white rounded hover:bg-blue-700 transition\"\n click.delegate=\"incrementCounter()\">\n +\n </button>\n </div>\n</template>`;\n project.css = ``;\n project.javascript = `class App {\n static $view() {\n return document.querySelector('#root');\n }\n constructor() {\n this.message = '${capitalizedTitle}';\n this.counter = 0;\n }\n incrementCounter() {\n this.counter++;\n document.getElementById('counter').textContent = this.counter;\n }\n}\n\nau.start({ root: App });`;\n }\n if (name === 'lit') {\n project.meta = \"\";\n project.libraries = [\n \"https://cdnjs.cloudflare.com/ajax/libs/picocss/2.0.6/pico.min.css\"\n ];\n project.html = `<my-element></my-element>`;\n project.css = ``;\n project.javascript = `import {LitElement, html} from 'https://cdn.jsdelivr.net/gh/lit/dist@2/core/lit-core.min.js';\n \nclass MyElement extends LitElement {\n static properties = {\n counter: { type: Number }\n };\n\n constructor() {\n super();\n this.counter = 0;\n }\n\n incrementCounter() {\n this.counter++;\n }\n\n render() {\n return html\\`\n <main>\n <h1>\uD83D\uDC4B Hello, ${capitalizedTitle}! \uD83C\uDF0E</h1>\n <p>Counter: \\${this.counter}</p>\n <button @click=\"\\${this.incrementCounter}\">\n +\n </button>\n </main>\n \\`;\n }\n}\ncustomElements.define('my-element', MyElement);`;\n }\n\n dispatchChanges(editorManager.htmlEditor, project.html);\n dispatchChanges(editorManager.cssEditor, project.css);\n dispatchChanges(editorManager.jsEditor, project.javascript);\n if (name === 'react') setPreprocessor('javascript', 'babel');\n data.demos = false;\n renderPreview(true);\n}\nfunction importJSON(obj) {\n if (obj === null) return;\n project.obj = {};\n data.safeRender = null;\n setPreprocessor('html', obj.html_pre_processor);\n setPreprocessor('css', obj.css_pre_processor);\n setPreprocessor('javascript', obj.javascript_pre_processor);\n project.name = obj.name;\n project.version = obj.version;\n project.title = obj.title;\n project.description = obj.description;\n project.author = obj.author;\n project.url = obj.url;\n project.logo = obj.logo;\n project.console = obj.console;\n project.dark = obj.dark;\n project.diffing = obj.diffing;\n project.module = obj.module;\n project.autorun = obj.autorun;\n project.pwa = obj.pwa;\n project.activePanel = obj.activePanel;\n project.columns = obj.columns;\n project.columnsRight = obj.columnsRight;\n \n project.meta = obj.meta;\n project.libraries = obj.libraries;\n project.html = obj.html;\n project.css = obj.css;\n project.javascript = obj.javascript;\n data.safeRender = true;\n\n // Dispatch changes to editors\n if (window.editorManager) {\n dispatchChanges(editorManager.htmlEditor, project.html);\n dispatchChanges(editorManager.cssEditor, project.css);\n dispatchChanges(editorManager.jsEditor, project.javascript);\n }\n renderPreview(true);\n}\nfunction importProject() {\n Modal.render({\n title: \"Are you sure you want to load a new project?\",\n content: `<div class=\"p-4 text-center\">All current data will be lost.</div>`,\n onClose: function () {\n data.menuDialog = true;\n },\n onConfirm: function() {\n const input = document.createElement('input');\n input.type = 'file';\n input.accept = '.json';\n\n input.addEventListener('change', (event) => {\n const file = event.target.files[0];\n \n if (!file) {\n console.error('No file selected.');\n return;\n }\n \n const reader = new FileReader();\n \n reader.onload = event => {\n try {\n importJSON(JSON.parse(event.target.result));\n } catch (error) {\n console.error('Error parsing JSON file:', error);\n }\n };\n \n reader.readAsText(file);\n input.remove();\n });\n \n input.click();\n }\n });\n}\n\nfunction getFileNameAndType(url) {\n // Extract the file name with extension from the URL\n const fileName = url.substring(url.lastIndexOf('/') + 1);\n \n // Extract the file extension\n const fileExtension = fileName.split('.').pop().toLowerCase();\n \n // Map file extensions to MIME types\n const mimeTypes = {\n 'jpeg': 'image/jpeg',\n 'jpg': 'image/jpeg',\n 'png': 'image/png',\n 'gif': 'image/gif',\n 'bmp': 'image/bmp',\n 'webp': 'image/webp',\n 'svg': 'image/svg+xml',\n 'mp3': 'audio/mpeg',\n 'wav': 'audio/wav',\n 'ogg': 'audio/ogg',\n 'mp4': 'video/mp4',\n 'webm': 'video/webm',\n 'ogv': 'video/ogg'\n };\n \n // Get the MIME type based on the file extension\n const fileType = mimeTypes[fileExtension] || 'application/octet-stream';\n \n return {\n fileName,\n fileType\n };\n}\nfunction fetchResources(obj) {\n try {\n const doc = new DOMParser().parseFromString(obj.html, 'text/html');\n const body = doc.body;\n\n const imageUrls = [];\n const audioUrls = [];\n const vectors = [];\n const videoUrls = [];\n\n // Extract image URLs\n body.querySelectorAll('img').forEach(img => {\n if (img.hasAttribute('src')) {\n imageUrls.push(img.getAttribute('src'));\n img.src = `imgs/${getFileNameAndType(img.getAttribute('src')).fileName}`;\n }\n });\n\n // Extract audio URLs\n body.querySelectorAll('audio').forEach(audio => {\n audio.querySelectorAll('source').forEach(source => {\n if (source.hasAttribute('src')) {\n audioUrls.push(source.getAttribute('src'));\n source.src = `audios/${getFileNameAndType(source.getAttribute('src')).fileName}`;\n }\n });\n });\n\n // Extract vectors\n body.querySelectorAll('svg').forEach(svg => {\n vectors.push(svg.outerHTML);\n });\n\n // Extract video URLs\n body.querySelectorAll('video').forEach(video => {\n video.querySelectorAll('source').forEach(source => {\n if (source.hasAttribute('src')) {\n videoUrls.push(source.getAttribute('src'));\n source.src = `vids/${getFileNameAndType(source.getAttribute('src')).fileName}`;\n }\n });\n });\n\n return {\n imageUrls,\n audioUrls,\n vectors,\n videoUrls\n };\n } catch (error) {\n console.error('Error fetching resources:', error);\n return null; // Or handle the error in an appropriate way\n }\n}\nasync function getBase64Media(mediaUrl) {\n const response = await fetch(mediaUrl);\n const blob = await response.blob();\n return new Promise((resolve, reject) => {\n const reader = new FileReader();\n reader.onloadend = () => resolve(reader.result.split(',')[1]);\n reader.onerror = reject;\n reader.readAsDataURL(blob);\n });\n}\nasync function downloadJSON() {\n try {\n await loadScript(\"libraries/jszip/FileSaver.min.js\");\n let blob = new Blob([JSON.stringify(project, null, 2)], {type: \"application/json\"});\n saveAs(blob, `${project.name.split(' ').join('').toLowerCase()}-kodeWeave.json`);\n\n } catch (error) {\n console.error('Error:', error);\n } finally {\n // Clean up scripts after use\n removeScript(\"libraries/jszip/FileSaver.min.js\");\n }\n}\nasync function downloadProject() {\n try {\n await loadScripts([\n \"libraries/jszip/jszip.min.js\",\n \"libraries/jszip/FileSaver.min.js\"\n ]);\n \n let { imageUrls, audioUrls, vectors, videoUrls } = fetchResources(project);\n\n // Extract srcset URLs\n const iframe = document.getElementById('iframe');\n if (!iframe) return;\n\n const idoc = iframe.contentDocument || iframe.contentWindow.document;\n const srcsetUrls = idoc.querySelectorAll('img[srcset]').forEach(img => {\n img.srcset.split(',').forEach(srcset => {\n const url = srcset.trim().split(' ')[0];\n imageUrls.push(url);\n });\n });\n\n function extractBackgroundImageUrls(css) {\n const urls = [];\n const regex = /background-image\\s*:\\s*url\\(([^)]+)\\)/g;\n let match;\n while ((match = regex.exec(css)) !== null) {\n let url = match[1].replace(/['\"]/g, \"\"); // Remove quotes around URLs\n if (!url.startsWith(\"data:\")) {\n urls.push(url);\n }\n }\n return urls;\n }\n \n // Extract background-image URLs from project CSS\n const backgroundUrls = extractBackgroundImageUrls(await compileCode('css'));\n imageUrls = imageUrls.concat(backgroundUrls); // Add to image URLs to download\n\n const zip = new JSZip();\n\n // Project file\n zip.file(`${project.name.split(' ').join('').toLowerCase()}-kodeWeave.json`, JSON.stringify(project, null, 2));\n\n function checkCSSDependencies() {\n if (project.css.trim() !== '') {\n return `\n \"postcss\": \"^8.4.6\",\n \"autoprefixer\": \"^10.4.2\",\n \"cssnano\": \"^5.0.12\"`;\n }\n return '';\n }\n \n function checkJSDependencies() {\n if (project.javascript_pre_processor === 'babel' || project.javascript_pre_processor === 'jsxtypescript') {\n return `,\n \"@babel/core\": \"^7.15.5\",\n \"@babel/preset-env\": \"^7.15.6\",\n \"@babel/preset-react\": \"^7.14.5\",\n \"rollup-plugin-babel\": \"^4.4.0\"`;\n }\n if (project.javascript_pre_processor === 'typescript' || project.javascript_pre_processor === 'jsxtypescript') {\n return `,\n \"rollup-plugin-typescript2\": \"^0.31.1\",\n \"typescript\": \"^4.4.3\"`;\n }\n return '';\n }\n \n // Nodejs Package JSON\n let nodeStr = `{\n \"name\": \"${project.name.toLowerCase().split(' ').join('')}\",\n \"version\": \"${project.version}\",\n \"type\": \"module\",\n \"scripts\": {\n ${project.css.trim() !== '' ? `\"build:css\": \"postcss src/styles.css -o dist/styles.min.css\",\n ` : ''}\"build:js\": \"rollup -c && terser dist/script.js -o dist/script.min.js\",\n \"build\": \"${project.css.trim() !== '' ? 'npm run build:css && ' : ''}npm run build:js\",\n \"serve\": \"http-server -c-1 -p 8081\"\n },\n \"devDependencies\": {\n \"rollup\": \"^2.79.1\",\n \"rollup-plugin-terser\": \"^7.0.2\",\n \"terser\": \"^5.10.0\",\n \"http-server\": \"^14.1.1\"${checkCSSDependencies()}${checkJSDependencies()}\n }\n}`;\n zip.file(\"package.json\", nodeStr);\n \n // Rollup Configuration\n let rollupPlugins = `import { terser } from 'rollup-plugin-terser';\n`;\n \n if (project.javascript_pre_processor === 'babel' || project.javascript_pre_processor === 'jsxtypescript') {\n rollupPlugins += `import babel from 'rollup-plugin-babel';\n`;\n }\n \n if (project.javascript_pre_processor === 'typescript' || project.javascript_pre_processor === 'jsxtypescript') {\n rollupPlugins += `import typescript from 'rollup-plugin-typescript2';\n`;\n }\n \n let rollupStr = `${rollupPlugins}\nexport default {\n ${project.javascript_pre_processor === 'typescript' || project.javascript_pre_processor === 'jsxtypescript' ? \"input: 'src/script.ts', // entry point for your TypeScript\" : \"input: 'src/script.js', // entry point to your Javascript\"}\n output: {\n file: 'dist/script.js',\n format: ${project.module ? \"'es'\" : \"'iife'\"}, // Immediately Invoked Function Expression, suitable for <script> tags\n name: '${project.name.toLowerCase().split(' ').join('')}'\n },\n plugins: [\n ${project.javascript_pre_processor === 'typescript' || project.javascript_pre_processor === 'jsxtypescript' ? 'typescript(),' : ''}\n ${project.javascript_pre_processor === 'babel' || project.javascript_pre_processor === 'jsxtypescript' ? 'babel({ exclude: \"node_modules/**\" }),' : ''}\n terser() // minifies the JavaScript\n ]\n};`;\n zip.file(\"rollup.config.js\", rollupStr);\n \n // PostCSS Configuration\n if (project.css.trim() !== '') {\n let postcssStr = `module.exports = {\n plugins: [\n require('autoprefixer'), // adds vendor prefixes\n require('cssnano') // minifies the CSS\n ]\n};`;\n zip.file(\"postcss.config.js\", postcssStr);\n }\n \n // Babel Configuration\n if (project.javascript_pre_processor === 'babel' || project.javascript_pre_processor === 'jsxtypescript') {\n let babelStr = `{\n \"presets\": [\n \"@babel/preset-env\",\n ${project.javascript_pre_processor === 'jsxtypescript' ? `\"@babel/preset-typescript\",` : ''}\n \"@babel/preset-react\"\n ]\n}`;\n zip.file(\"babel.config.json\", babelStr);\n }\n \n // TypeScript Configuration\n if (project.javascript_pre_processor === 'typescript' || project.javascript_pre_processor === 'jsxtypescript') {\n let tsconfig = `{\n \"compilerOptions\": {\n \"target\": \"ES5\",\n \"module\": \"ESNext\",\n \"moduleResolution\": \"Node\",\n \"jsx\": \"react\",\n \"allowJs\": true,\n \"checkJs\": false,\n \"outDir\": \"./dist\",\n \"strict\": true\n },\n \"include\": [\"src/**/*\"]\n}`;\n zip.file(\"tsconfig.json\", tsconfig);\n } \n\n let licenseStr = `The MIT License (MIT)\nCopyright (c) ${new Date().getFullYear()} ${project.author}\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.`;\n zip.file(\"LICENSE.md\", licenseStr);\n\n let READMEStr = `# ${project.name}\n\nA Weave created on [kodeWeave](https://michaelsboost.com/kodeWeave/go)\n\n${project.description}`;\n zip.file(\"README.md\", READMEStr);\n\n // Always include the original logo\n if (project.logo) {\n try {\n let base64Logo = '';\n \n if (project.logo.startsWith('data:')) {\n // If logo is already a data URL, extract base64 part\n base64Logo = project.logo; // Get the base64 part\n } else {\n // Otherwise fetch and convert to base64\n base64Logo = await getBase64Media(project.logo);\n }\n \n // Determine file extension based on MIME type\n let logoType;\n if (project.logo.startsWith('data:image/png')) {\n logoType = 'png';\n } else if (project.logo.startsWith('data:image/jpeg')) {\n logoType = 'jpeg';\n } else if (project.logo.startsWith('data:image/svg+xml')) {\n logoType = 'svg';\n } else {\n console.error('Unsupported logo MIME type:', project.logo);\n return; // Exit or handle error appropriately\n }\n \n const logoFileName = `logo.${logoType}`;\n zip.folder('imgs').file(logoFileName, base64Logo.split(\",\")[1], { base64: true });\n \n // Add icons to manifest.json based on image sizes\n const sizes = ['192x192', '256x256', '384x384', '512x512'];\n const icons = sizes.map(size => ({\n \"src\": `../imgs/logo-${size}.png`,\n \"sizes\": size,\n \"type\": \"image/png\",\n \"purpose\": \"any\"\n }));\n for (const size of sizes) {\n const canvas = document.createElement('canvas');\n canvas.width = parseInt(size.split('x')[0]);\n canvas.height = parseInt(size.split('x')[1]);\n const ctx = canvas.getContext('2d');\n\n // Draw logo on canvas at the desired size\n const img = new Image();\n img.src = base64Logo;\n img.onload = function() {\n ctx.drawImage(img, 0, 0, canvas.width, canvas.height);\n const base64Image = canvas.toDataURL('image/png').replace(/^data:image\\/(png|jpg);base64,/, '');\n zip.folder('imgs').file(`logo-${size}.png`, base64Image, { base64: true });\n };\n\n // Clean up canvas element\n canvas.remove();\n }\n \n zip.file(`dist/manifest.json`, JSON.stringify({\n \"theme_color\": \"#13171f\",\n \"background_color\": \"#13171f\",\n \"display\": \"standalone\",\n \"start_url\": \"./index.html\",\n \"lang\": \"en-US\",\n \"name\": project.name,\n \"short_name\": project.name,\n \"description\": project.description,\n \"icons\": icons\n }, null, 2));\n \n } catch (error) {\n console.error('Error adding logo to ZIP:', error);\n return; // Exit method or handle error as needed\n }\n }\n\n function minifyCSS(cssCode) {\n let input = cssCode;\n const output = input\n .replace(/\\/\\*.*\\*\\/|\\/\\*[\\s\\S]*?\\*\\/|\\n|\\t|\\v|\\s{2,}/g, '')\n .replace(/\\s*\\{\\s*/g, '{')\n .replace(/\\s*\\}\\s*/g, '}')\n .replace(/\\s*\\:\\s*/g, ':')\n .replace(/\\s*\\;\\s*/g, ';')\n .replace(/\\s*\\,\\s*/g, ',')\n .replace(/\\s*\\~\\s*/g, '~')\n .replace(/\\s*\\>\\s*/g, '>')\n .replace(/\\s*\\+\\s*/g, '+')\n .replace(/\\s*\\!\\s*/g, ' !');\n return output;\n }\n\n // let minifiedLESS = minifyCSS(iframe.contentDocument.getElementById('aeoibrfa1').textContent);\n let minifiedCSS = minifyCSS(await compileCode('css'));\n\n // Add style.css\n if (project.css_pre_processor === 'css') zip.file('src/style.css', project.css);\n if (project.css_pre_processor === 'css') zip.file('dist/style.css', project.css);\n if (project.css_pre_processor === 'stylus') zip.file('src/style.styl', project.css);\n if (project.css_pre_processor === 'stylus') zip.file('dist/style.css', minifiedCSS);\n if (project.css_pre_processor === 'less') zip.file('src/style.less', project.css);\n if (project.css_pre_processor === 'less') zip.file('dist/style.css', iframe.contentDocument.getElementById('aeoibrfa1').textContent);\n if (project.css_pre_processor === 'sass') zip.file('src/style.scss', project.css);\n if (project.css_pre_processor === 'sass') zip.file('dist/style.css', minifiedCSS);\n\n async function minifyJS(jsCode) {\n // detect if terser exists\n if (!document.querySelector(\"script[src='libraries/terser/bundle.min.js']\")) {\n await loadScript(\"libraries/terser/bundle.min.js\");\n }\n return Terser.minify(jsCode);\n }\n\n let minifiedJS = await minifyJS(await compileCode('javascript'));\n minifiedJS = minifiedJS.code;\n\n // Add script.js\n if (project.javascript_pre_processor === 'javascript') zip.file('src/script.js', project.javascript);\n if (project.javascript_pre_processor === 'javascript') zip.file('dist/script.js', project.javascript);\n if (project.javascript_pre_processor === 'babel') zip.file('src/script.js', project.javascript);\n if (project.javascript_pre_processor === 'babel') zip.file('dist/script.js', minifiedJS);\n if (project.javascript_pre_processor === 'typescript') zip.file('src/script.ts', project.javascript);\n if (project.javascript_pre_processor === 'typescript') zip.file('dist/script.js', minifiedJS);\n if (project.javascript_pre_processor === 'jsxtypescript') zip.file('src/script.ts', project.javascript);\n if (project.javascript_pre_processor === 'jsxtypescript') zip.file('dist/script.js', minifiedJS);\n\n // if pwa is enabled\n let swinit = '';\n if (project.pwa) {\n swinit = `\n <script src=\"https://storage.googleapis.com/workbox-cdn/releases/6.4.1/workbox-sw.js\"></script>\n <script>\n // service worker for progressive web app\n if ('serviceWorker' in navigator) {\n window.addEventListener('load', () => {\n navigator.serviceWorker.register('./dist/sw.js')\n })\n }\n </script>`;\n const swjs = `// Service worker code\nimportScripts('https://storage.googleapis.com/workbox-cdn/releases/6.4.1/workbox-sw.js');\n\nconst { registerRoute } = workbox.routing;\nconst { CacheFirst } = workbox.strategies;\n\nconst cacheName = '${project.name.split(' ').join('')}-cache';\n\nworkbox.routing.registerRoute(\n({ request }) => request.destination === 'script' ||\n request.destination === 'style' ||\n request.destination === 'document' ||\n request.destination === 'image' ||\n request.destination === 'font' ||\n request.destination === 'audio' ||\n request.destination === 'video',\nnew CacheFirst({\ncacheName: cacheName,\nplugins: [\n// Any additional plugins can be added here\n],\n})\n);`\n zip.file(\"dist/sw.js\", swjs);\n }\n\n // Iterate over each library\n let scriptTags = '';\n let cssTags = '';\n project.libraries.forEach(library => {\n if (library.endsWith('.js')) {\n scriptTags += `<script src=\"${library}\"></script>\\n `;\n } else if (library.endsWith('.css')) {\n cssTags += `<link rel=\"stylesheet\" href=\"${library}\">\\n `;\n } else {\n // Assuming it's a Google font\n cssTags += `<link href=\"${library}\" rel=\"stylesheet\">\\n `;\n }\n });\n \n // Add index.html\n const indexHtmlContentCompiled = `<!DOCTYPE html>\n<html lang=\"en\" data-theme=\"${project.dark ? 'dark' : 'light'}\">\n <head>\n <title>${project.title}\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n ${cssTags}${project.css ? '' : ''}\n ${project.meta ? `${project.meta}\\n ` : ''}\n ${scriptTags ? scriptTags : ''}\n \n \n\n${await compileCode('html')}\n\n${project.javascript ? '' : ''}\n${(project.pwa ? swinit : '')}\n \n`;\n if (project.html_pre_processor === 'html') zip.file('src/index.html', project.html);\n if (project.html_pre_processor === 'html') zip.file('index.html', indexHtmlContentCompiled);\n if (project.html_pre_processor === 'markdown') zip.file('src/index.md', project.html);\n if (project.html_pre_processor === 'markdown') zip.file('index.html', indexHtmlContentCompiled);\n if (project.html_pre_processor === 'pug') zip.file('src/index.pug', project.html);\n if (project.html_pre_processor === 'pug') zip.file('index.html', indexHtmlContentCompiled);\n if (project.html_pre_processor === 'jade') zip.file('src/index.jade', project.html);\n if (project.html_pre_processor === 'jade') zip.file('index.html', indexHtmlContentCompiled);\n\n // Create a folder \"imgs\" and add images inside it with their correct MIME types\n if (audioUrls.length > 0) {\n const audioFolder = zip.folder('audios');\n try {\n for (const audioUrl of audioUrls) {\n const base64Audio = await getBase64Media(audioUrl);\n audioFolder.file(audioUrl.substring(audioUrl.lastIndexOf('/') + 1), base64Audio, { base64: true });\n }\n } catch (error) {\n console.error('Error adding audio to ZIP:', error);\n return;\n }\n }\n if (imageUrls.length > 0) {\n const imgFolder = zip.folder('imgs');\n try {\n // Convert each image URL to Base64 and add to ZIP folder\n for (const imageUrl of imageUrls) {\n const base64Image = await getBase64Media(imageUrl);\n imgFolder.file(imageUrl.substring(imageUrl.lastIndexOf('/') + 1), base64Image, { base64: true });\n }\n } catch (error) {\n console.error('Error adding images to ZIP:', error);\n return; // Exit method or handle error as needed\n }\n }\n if (vectors.length > 0) {\n const svgFolder = zip.folder('svgs');\n try {\n // Convert each SVG to a file inside the 'svgs' folder\n vectors.forEach((svg, index) => {\n svgFolder.file(`vector-${index + 1}.svg`, svg);\n });\n } catch (error) {\n console.error('Error adding images to ZIP:', error);\n return; // Exit method or handle error as needed\n }\n }\n if (videoUrls.length > 0) {\n const videoFolder = zip.folder('vids');\n try {\n for (const videoUrl of videoUrls) {\n const base64Video = await getBase64Media(videoUrl);\n videoFolder.file(videoUrl.substring(videoUrl.lastIndexOf('/') + 1), base64Video, { base64: true });\n }\n } catch (error) {\n console.error('Error adding videos to ZIP:', error);\n return;\n }\n }\n\n // Generate the ZIP file\n const blob = await zip.generateAsync({ type: 'blob' });\n saveAs(blob, `${project.name.toLowerCase().split(' ').join('')}.zip`);\n \n // Clear all arrays after saving\n imageUrls.length = audioUrls.length = videoUrls.length = 0;\n } catch (error) {\n console.error('Error:', error);\n } finally {\n // Clean up scripts after use\n const scriptsToRemove = [\n 'libraries/jszip/FileSaver.min.js',\n 'libraries/jszip/jszip.min.js'\n ];\n\n removeScripts(scriptsToRemove);\n }\n}\nasync function share() {\n try {\n // Compile code if necessary\n const javascriptCode = project.javascript_pre_processor === 'jsxtypescript'\n ? data.compiledJSX\n : project.javascript;\n\n let jsPreprocessor = null;\n if (project.javascript_pre_processor === 'jsxtypescript' || project.javascript_pre_processor === 'javascript') {\n jsPreprocessor = \"none\";\n } else {\n jsPreprocessor = project.javascript_pre_processor;\n }\n\n const shareProject = {\n title: project.title,\n description: project.description,\n head: project.meta,\n html: project.html,\n html_pre_processor: project.html_pre_processor === \"html\" ? \"none\" : \"\",\n css: project.css,\n css_pre_processor: project.css_pre_processor === \"css\" ? \"none\" : \"\",\n css_external: project.libraries.filter(lib => lib.endsWith('.css')).join(';'),\n css_starter: \"neither\",\n css_prefix: \"neither\",\n js_module: project.module,\n js: javascriptCode,\n js_pre_processor: jsPreprocessor,\n js_external: project.libraries.filter(lib => lib.endsWith('.js')).join(';'),\n editors: '111',\n layout: 'left'\n };\n\n // Stringify the JSON object and escape quotes\n const JSONstring = JSON.stringify(shareProject)\n .replace(/\"/g, \""\")\n .replace(/'/g, \"'\");\n\n // Create form element\n const form = `\n
      \n \n \n
      `;\n\n // Append form to the document body and submit\n document.body.insertAdjacentHTML('beforeend', form);\n document.querySelector('form').submit();\n document.querySelector('form').remove();\n } catch (error) {\n console.error('Error sharing project:', error);\n }\n}\n\nasync function screenshot() {\n const iframe = document.getElementById('iframe');\n const iframeDocument = iframe.contentDocument || iframe.contentWindow.document;\n\n try {\n await loadScripts([\n \"libraries/html2canvas/html2canvas.min.js\",\n \"libraries/jszip/FileSaver.min.js\"\n ]);\n \n html2canvas(iframeDocument.documentElement).then(canvas => {\n const context = canvas.getContext('2d');\n const videoElements = iframeDocument.getElementsByTagName('video');\n\n // Draw video elements\n Array.from(videoElements).forEach(video => {\n const { currentTime, paused, volume } = video;\n\n // Set volume to 0 for the screenshot process\n video.volume = 0;\n\n // Draw the video frame\n if (!paused) video.pause();\n context.drawImage(video, video.offsetLeft, video.offsetTop, video.clientWidth, video.clientHeight);\n\n // Restore the original volume and playback state\n video.volume = volume;\n video.currentTime = currentTime;\n if (!paused) video.play();\n });\n\n // Convert canvas to Blob\n canvas.toBlob(blob => {\n // Save the Blob using FileSaver.js\n saveAs(blob, 'screenshot.png');\n }, 'image/png');\n }).catch(error => {\n console.error('Error taking screenshot:', error);\n });\n } catch (error) {\n console.error('Error:', error);\n } finally {\n // Clean up scripts after use\n removeScript(\"../libraries/html2canvas/html2canvas.min.js\");\n removeScript(\"../libraries/jszip/FileSaver.min.js\");\n }\n}\nasync function renderPreview(forceRun = false) {\n if (!forceRun && !project.autorun) return;\n if (!data.safeRender) return;\n\n let scriptTags = '';\n let cssTags = '';\n project.libraries.forEach(library => {\n if (library.endsWith('.js')) {\n scriptTags += `\\n `;\n } else if (library.endsWith('.css')) {\n cssTags += `\\n `;\n } else {\n cssTags += `\\n `;\n }\n });\n\n const javascriptCode = await compileCode('javascript');\n const cssCode = await compileCode('css');\n\n function jsScript() {\n if (project.javascript_pre_processor === 'babel') {\n return `\n `\n } else {\n return ``\n }\n }\n const consoleCSS = `\n .wrapper_yOR7u {\n ${project.console ? '' : 'display: none!important;'}\n left: 0!important; width: 100%!important; \n border-radius: 15px 15px 0 0!important; \n z-index: 99999999;\n } \n .btn_yOR7u {\n cursor: pointer; \n background: inherit; \n padding: 0 0.5rem; \n margin: inherit; \n margin-right: 0px; \n border: inherit; \n color: #fff!important; \n } \n .nav_yOR7u {\n padding-bottom: 14px!important;\n } \n .line_yOR7u {\n background: inherit!important;\n }`\n const iframeSrc = `\n \n ${project.title}\n \n \n \n \n ${project.meta ? project.meta : ''}\n ${cssTags}\n \n \n \n \n ${await compileCode('html')}\n ${scriptTags ? scriptTags : ''}\n ${project.css_pre_processor === 'less' ? '' : ''}\n \n `;\n\n const iframe = document.getElementById('iframe');\n if (!iframe) return;\n\n const parser = new DOMParser();\n const doc = parser.parseFromString(iframeSrc, 'text/html');\n const idoc = iframe.contentDocument || iframe.contentWindow.document;\n\n if (App.initialRender) {\n setPreprocessor('html', project.html_pre_processor);\n setPreprocessor('css', project.css_pre_processor);\n setPreprocessor('js', project.javascript_pre_processor);\n iframe.setAttribute('srcdoc', iframeSrc);\n iframe.onload = () => {\n // Initialize script within the iframe\n const idoc = iframe.contentDocument || iframe.contentWindow.document;\n const script = idoc.createElement('script');\n script.type = project.module ? 'module' : 'text/javascript';\n script.textContent = javascriptCode;\n idoc.body.appendChild(script);\n };\n App.initialRender = false;\n previousJavaScriptCode = javascriptCode;\n return false;\n }\n\n if (project.diffing || !forceRun) {\n diffNodes(idoc.documentElement, doc.documentElement);\n return false;\n }\n \n iframe.setAttribute('srcdoc', iframeSrc);\n iframe.onload = () => {\n // Initialize script within the iframe\n const idoc = iframe.contentDocument || iframe.contentWindow.document;\n const script = idoc.createElement('script');\n script.type = project.module ? 'module' : 'text/javascript';\n script.textContent = javascriptCode;\n idoc.body.appendChild(script);\n };\n}\n\n// Make functions available in global space\nwindow.Modal = Modal;\nwindow.emptyStorage = emptyStorage;\nwindow.addLibrary = addLibrary;\nwindow.fetchSuggestions = fetchSuggestions;\nwindow.setPreprocessor = setPreprocessor;\nwindow.initializePreprocessors = initializePreprocessors;\nwindow.loadBeautifyLibraries = loadBeautifyLibraries\nwindow.removeBeautifyLibraries = removeBeautifyLibraries;\nwindow.tidy = tidy;\nwindow.generateId = generateId;\nwindow.resizeCanvas = resizeCanvas;\nwindow.rotateCanvas = rotateCanvas;\nwindow.defineScale = defineScale;\nwindow.getIFrameClientSize = getIFrameClientSize;\nwindow.handleLogoChange = handleLogoChange;\nwindow.newProject = newProject;\nwindow.importProject = importProject;\nwindow.downloadJSON = downloadJSON;\nwindow.downloadProject = downloadProject;\nwindow.share = share;\nwindow.screenshot = screenshot;\nwindow.renderPreview = renderPreview;\n\n// Diffing algorithm to update ui when changes occur\nfunction diffNodes(oldNode, newNode) {\n if (!oldNode || !newNode) {\n return;\n }\n\n // Check for data-ignore attribute\n if (oldNode.hasAttribute && oldNode.hasAttribute('data-ignore') || \n newNode.hasAttribute && newNode.hasAttribute('data-ignore')) {\n return;\n }\n\n // Check if nodes are iframe elements\n if (oldNode.nodeName === 'IFRAME' && newNode.nodeName === 'IFRAME') {\n const acceptableIframeAttributes = ['id', 'title', 'class', 'style', 'sandbox'];\n // Compare acceptable attributes only\n acceptableIframeAttributes.forEach(attr => {\n if (oldNode.getAttribute(attr) !== newNode.getAttribute(attr)) {\n oldNode.setAttribute(attr, newNode.getAttribute(attr));\n }\n });\n\n const oldSrcdoc = oldNode.getAttribute('srcdoc');\n const newSrcdoc = newNode.getAttribute('srcdoc');\n // Ignore srcdoc attribute if it hasn't changed\n if (oldSrcdoc === newSrcdoc) return;\n return;\n }\n\n // If nodes are different types, replace the old node\n if (oldNode.nodeName !== newNode.nodeName) {\n oldNode.replaceWith(newNode.cloneNode(true));\n // console.log('Different node names:', oldNode, newNode);\n return;\n }\n\n // Diff the attributes of the nodes\n if (oldNode.nodeType === Node.ELEMENT_NODE && newNode.nodeType === Node.ELEMENT_NODE) {\n const oldAttributes = Array.from(oldNode.attributes);\n const newAttributes = Array.from(newNode.attributes);\n\n // Remove old attributes not present in the new node\n oldAttributes.forEach(attr => {\n if (!newNode.hasAttribute(attr.name)) {\n oldNode.removeAttribute(attr.name);\n }\n });\n\n // Add or update attributes from the new node\n newAttributes.forEach(attr => {\n if (oldNode.getAttribute(attr.name) !== attr.value) {\n oldNode.setAttribute(attr.name, attr.value);\n }\n });\n }\n\n const oldChildren = Array.from(oldNode.childNodes);\n const newChildren = Array.from(newNode.childNodes);\n\n // Update or remove existing child nodes\n oldChildren.forEach((oldChild, index) => {\n const newChild = newChildren[index];\n if (!newChild) {\n oldNode.removeChild(oldChild);\n return;\n }\n // Special handling for elements\n if (oldNode.tagName === 'TITLE' || oldNode.tagName === 'STYLE' && oldNode.textContent !== newNode.textContent) {\n oldNode.textContent = newNode.textContent;\n } else if (oldChild.nodeType === Node.TEXT_NODE && oldChild.nodeValue !== newChild.nodeValue) {\n oldChild.nodeValue = newChild.nodeValue;\n }\n diffNodes(oldChild, newChild);\n });\n\n // Add new child nodes\n newChildren.slice(oldChildren.length).forEach(newChild => {\n oldNode.appendChild(newChild.cloneNode(true));\n });\n}\n\n// Once dom has loaded init functions\ndocument.addEventListener('DOMContentLoaded', function() {\n window.onload = () => {\n App.render('#app');\n initializePreprocessors();\n if (window.initEditors) initEditors();\n getIFrameClientSize();\n data.safeRender = true;\n renderPreview(true);\n\n if (localStorage.getItem('kodeWeave')) {\n setTimeout(function() {\n importJSON(JSON.parse(localStorage.getItem('kodeWeave')));\n }, 100);\n }\n }\n window.onresize = () => getIFrameClientSize();\n});"], + "mappings": "gQACA,SAASA,EAASC,EAAQC,EAAUC,EAAO,CAAC,EAAG,CAC7C,SAASC,EAAYH,EAAQE,EAAM,CACjC,OAAI,OAAOF,GAAW,UAAYA,IAAW,KACpCA,EAGF,IAAI,MAAMA,EAAQ,CACvB,IAAII,EAAKC,EAAUC,EAAO,CACxB,IAAMC,EAAW,CAAC,GAAGL,EAAMG,CAAQ,EAC7BG,EAAWJ,EAAIC,CAAQ,EACvBI,EAAS,QA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", "navIconCSS", "modalIconCSS", "panelIconCSS", "previewIconCSS", "project", "newValue", "doc", "App", "diffArr", "initRun", "string", "renderPreview", "consoleCSS", "data", "LeftMenubar", "buttonSize", "PreviewMenu", "buttonClass", "selectClass", "selectStyle", "sizeOptions", "previewSize", "group", "option", "canTidyShow", "container", "size", "viewportWidth", "viewportHeight", "previewElm", "width", "height", "menuDialog", "settingsHTML", "library", "index", "librariesDialog", "buttonContentClass", "imageContentClass", "textContentClass", "frameworks", "buttonHTML", "name", "demosDialog", "html", "editorNav", "element", "currentDoc", "newDoc", "diffNodes", "Modal", "large", "title", "content", "CloseLabel", "ConfirmLabel", "onLoad", "onClose", "onConfirm", "hClass", "modal", "timesBtn", "closeBtn", "confirmBtn", "emptyStorage", "c", "names", "registrations", "registration", "addLibrary", "url", "renderLibraries", "fetchSuggestions", "key", "response", "item", "suggestions", "error", "removeScript", "src", "script", "removeScripts", "scripts", "loadScript", "scriptUrl", "resolve", "reject", "scriptElement", "loadScripts", "srcArray", "setPreprocessor", "editor", "scriptMap", "currentPreprocessors", "scriptSrcCondition", "scriptSrc", "currentScriptSrc", "initializePreprocessors", "loadBeautifyLibraries", "removeBeautifyLibraries", "tidy", "formattedCode", "generateId", "id", "resizeCanvas", "getIFrameClientSize", "rotateCanvas", "iframe", "scale", "defineScale", "fadeTimeout", "compileCode", "detect", "appScript", "err", "output", "handleLogoChange", "event", "file", "base64String", "fileToBase64", "reader", "newProject", "capitalizeFirstLetter", "capitalizedTitle", "importJSON", "importProject", "input", "getFileNameAndType", "fileName", "fileExtension", "fileType", "fetchResources", "body", "imageUrls", "audioUrls", "vectors", "videoUrls", "img", "audio", "source", "svg", "video", "getBase64Media", "mediaUrl", "blob", "downloadJSON", "downloadProject", "extractBackgroundImageUrls", "css", "urls", "regex", "match", "checkCSSDependencies", "checkJSDependencies", "minifyCSS", "cssCode", "srcsetUrls", "srcset", "backgroundUrls", "zip", "nodeStr", "rollupPlugins", "rollupStr", "babelStr", "licenseStr", "READMEStr", "base64Logo", "logoType", "logoFileName", "sizes", "canvas", "ctx", "base64Image", "minifiedCSS", "minifyJS", "jsCode", "minifiedJS", "swinit", "swjs", "scriptTags", "cssTags", "indexHtmlContentCompiled", "audioFolder", "audioUrl", "base64Audio", "imgFolder", "imageUrl", "svgFolder", "videoFolder", "videoUrl", "base64Video", "share", "javascriptCode", "jsPreprocessor", "shareProject", "lib", "form", "screenshot", "iframeDocument", "context", "videoElements", "currentTime", "paused", "volume", "forceRun", "jsScript", "iframeSrc", "idoc", "oldNode", "newNode", "attr", "oldSrcdoc", "newSrcdoc", "oldAttributes", "newAttributes", "oldChildren", "newChildren", "oldChild", "newChild"] } diff --git a/go/index.html b/go/index.html index 54b2a204..60c1fc0a 100644 --- a/go/index.html +++ b/go/index.html @@ -41,8 +41,8 @@ <h2 class="text-[#ffffff00]">kodeWeave is your on the go coding playground! Desi <!-- Load Application Script --> <!-- <script id="appScript" src="src/App.js"></script> --> - <script src="dist/editor.js"></script> <script id="appScript" src="dist/App.js"></script> + <script src="dist/editor.js"></script> <script src="https://storage.googleapis.com/workbox-cdn/releases/6.4.1/workbox-sw.js"></script> <script> // service worker for progressive web app diff --git a/go/src/App.js b/go/src/App.js index f335494d..d51378b6 100644 --- a/go/src/App.js +++ b/go/src/App.js @@ -297,6 +297,7 @@ const project = onChange(p, (property, oldValue, newValue) => { localStorage.setItem('kodeWeave', JSON.stringify(project)); App.render('#app'); if (property.toString() === 'activePanel') { + if (!window.editorManager) return; if (project.activePanel === 'html') setActiveEditor(editorManager.htmlEditor) if (project.activePanel === 'css') setActiveEditor(editorManager.cssEditor) if (project.activePanel === 'javascript') setActiveEditor(editorManager.javascriptEditor) @@ -317,7 +318,8 @@ const project = onChange(p, (property, oldValue, newValue) => { } } if (string === 'html') { - if (editorManager.htmlEditor.state.doc.toString() !== project.html) { + if (!window.editorManager) return; + if (window.editorManager.htmlEditor.state.doc.toString() !== project.html) { dispatchChanges(editorManager.htmlEditor, project.html); } } @@ -348,6 +350,7 @@ const project = onChange(p, (property, oldValue, newValue) => { ${project.css}` doc.getElementById('cuxjju3ew').textContent = consoleCSS; + if (!window.editorManager) return; if (string === 'css' && editorManager.cssEditor.state.doc.toString() !== project.css) { dispatchChanges(editorManager.cssEditor, project.css); } @@ -357,7 +360,8 @@ const project = onChange(p, (property, oldValue, newValue) => { if (initRun.includes(string)) { if (string === 'javascript') { renderPreview(true); - if (editorManager.jsEditor.state.doc.toString() !== project.javascript) { + if (!window.editorManager) return; + if (window.editorManager.jsEditor.state.doc.toString() !== project.javascript) { dispatchChanges(editorManager.jsEditor, project.javascript); return false; } @@ -1382,6 +1386,7 @@ const Modal = { CloseLabel, ConfirmLabel, onLoad, + onClose, onConfirm }) { // if (!options) return false; @@ -1424,8 +1429,18 @@ const Modal = { const confirmBtn = modal.querySelector('footer button:last-child'); // Confirm handler function - timesBtn.onclick = () => document.body.removeChild(modal); - closeBtn.onclick = () => document.body.removeChild(modal); + timesBtn.onclick = function() { + if (onClose && typeof onClose === 'function') { + onClose(); + } + document.body.removeChild(modal); + } + closeBtn.onclick = function() { + if (onClose && typeof onClose === 'function') { + onClose(); + } + document.body.removeChild(modal); + } confirmBtn.onclick = function() { if (onConfirm && typeof onConfirm === 'function') { onConfirm(); @@ -1732,12 +1747,15 @@ async function setPreprocessor(editor, value) { // Set the new preprocessor if (editor === 'html') { project.html_pre_processor = value; - window.editorManager.setMode(project.html_pre_processor === 'html' ? 'html' : value, editorManager.htmlEditor); + // if (!window.editorManager || !window.editorManager.htmlEditor) return; + // window.editorManager.setMode(project.html_pre_processor === 'html' ? 'html' : value, editorManager.htmlEditor); } else if (editor === 'css') { project.css_pre_processor = value; - window.editorManager.setMode(project.css_pre_processor === 'css' ? 'css' : value, editorManager.cssEditor); + // if (!window.editorManager || !window.editorManager.cssEditor) return; + // window.editorManager.setMode(project.css_pre_processor === 'css' ? 'css' : value, editorManager.cssEditor); } else if (editor === 'javascript') { project.javascript_pre_processor = value; + if (!window.editorManager || !window.editorManager.jsEditor) return; window.editorManager.setMode(project.javascript_pre_processor === 'javascript' ? 'javascript' : value, editorManager.jsEditor); } } catch (error) { @@ -1751,6 +1769,7 @@ async function initializePreprocessors() { setPreprocessor('javascript', project.javascript_pre_processor) ]); + if (!window.editorManager) return; dispatchChanges(editorManager.htmlEditor, project.html); dispatchChanges(editorManager.cssEditor, project.css); dispatchChanges(editorManager.jsEditor, project.javascript); @@ -2483,15 +2502,20 @@ function importJSON(obj) { data.safeRender = true; // Dispatch changes to editors - dispatchChanges(editorManager.htmlEditor, project.html); - dispatchChanges(editorManager.cssEditor, project.css); - dispatchChanges(editorManager.jsEditor, project.javascript); + if (window.editorManager) { + dispatchChanges(editorManager.htmlEditor, project.html); + dispatchChanges(editorManager.cssEditor, project.css); + dispatchChanges(editorManager.jsEditor, project.javascript); + } renderPreview(true); } function importProject() { Modal.render({ title: "Are you sure you want to load a new project?", content: `<div class="p-4 text-center">All current data will be lost.</div>`, + onClose: function () { + data.menuDialog = true; + }, onConfirm: function() { const input = document.createElement('input'); input.type = 'file'; @@ -3435,8 +3459,8 @@ function diffNodes(oldNode, newNode) { document.addEventListener('DOMContentLoaded', function() { window.onload = () => { App.render('#app'); - initEditors(); initializePreprocessors(); + if (window.initEditors) initEditors(); getIFrameClientSize(); data.safeRender = true; renderPreview(true);