From 629ad71cfc8fca2609c1ba0090acfd2bcab2affd Mon Sep 17 00:00:00 2001 From: Code by Ben Date: Thu, 15 Aug 2024 14:06:52 +1000 Subject: [PATCH] fixed operating system breaking select list. --- assets/js/editor-artifact.js | 2 +- public/js/editor-artifact.min.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/assets/js/editor-artifact.js b/assets/js/editor-artifact.js index 862889ea..159ddc9b 100644 --- a/assets/js/editor-artifact.js +++ b/assets/js/editor-artifact.js @@ -139,8 +139,8 @@ import { clipValue, getElmById } from "./helper.mjs"; osv.classList.add("is-invalid"); osv.classList.remove("is-valid"); group = `Operating system`; + osv.textContent = `${group}`; } - osv.textContent = `${group}`; } /** * New tag or category label based on the selected option in the dropdown. diff --git a/public/js/editor-artifact.min.js b/public/js/editor-artifact.min.js index f1a2513b..daed76c2 100644 --- a/public/js/editor-artifact.min.js +++ b/public/js/editor-artifact.min.js @@ -1,2 +1,2 @@ /* editor-artifact.min.js © Defacto2 2024 */ -(()=>{function q(t,i,r){if(t==null)throw new Error("The year input element is null.");if(i==null)throw new Error("The month input element is null.");if(r==null)throw new Error("The day input element is null.");t.classList.remove("is-invalid","is-valid"),i.classList.remove("is-invalid","is-valid"),r.classList.remove("is-invalid","is-valid");let o=parseInt(t.value,10);isNaN(o)?t.value="0":t.value=o;let n=parseInt(i.value,10);isNaN(n)?i.value="0":i.value=n;let a=parseInt(r.value,10);isNaN(a)?r.value="0":r.value=a;let d=0,u=new Date().getFullYear(),W=o>=1980&&o<=u;o>d&&!W&&t.classList.add("is-invalid");let w=n>=1&&n<=12;n>d&&!w&&i.classList.add("is-invalid");let T=a>=1&&a<=31;a>d&&!T&&r.classList.add("is-invalid"),isNaN(o)&&(w||T)&&t.classList.add("is-invalid"),(n==d||isNaN(n))&&T&&i.classList.add("is-invalid")}function fe(t){return he(t,!0)}function ge(t){return he(t,!1)}function he(t,i){if(t==null)throw new Error("The repository URL element is null.");t.classList.remove("is-valid","is-invalid");let r=t.value.trim();if(r.length===0)return;if(i==!0&&r.startsWith("refs/")){t.classList.add("is-invalid");return}if(r.includes("://")){t.classList.add("is-invalid");return}let n=/[^A-Za-z0-9-._/]/g;r=r.replace(n,""),r=r.replaceAll("//","/");let a=/^\//;r=r.replace(a,""),t.value=r;let d=t.getAttribute("maxlength");if(d===null)throw new Error(`The maxlength attribute is required for ${t.id}.`);if(r.length>d){t.classList.add("is-invalid");return}}function b(t){if(t==null)throw new Error("The element of the releaser validator is null.");t.classList.remove("is-valid","is-invalid");let i=t.value.trim().toUpperCase();i=i.replace(/[^A-ZÀ-ÖØ-Þ0-9\-,& ]/g,""),t.value=i;let r=t.getAttribute("minlength"),o=t.getAttribute("maxlength"),n=t.getAttribute("required");if(r===null)throw new Error(`The minlength attribute is required for ${t.id}.`);if(o===null)throw new Error(`The maxlength attribute is required for ${t.id}.`);let a=document.getElementById("artifact-editor-releasers-error");if(a===null)throw new Error("The releasers error element is null.");let d=i.lengtho;if(n!=null&&d){t.classList.add("is-invalid"),t.id==="-1"&&a.classList.add("d-block");return}let u=i.length>0&&(i.lengtho);if(n==null&&u){t.classList.add("is-invalid");return}t.classList.remove("is-invalid"),a.classList.remove("d-block")}function Ee(t){if(t==null)throw new Error("The element of the releaser validator is null.");t.classList.remove("is-valid","is-invalid");let i=t.value.trim();i.length>0&&i.length!=11&&t.classList.add("is-invalid")}function V(t,i){if(t==null)throw new Error("The element of the number validator is null.");t.classList.remove("is-valid","is-invalid");let r=parseInt(t.value,10);isNaN(r)&&t.classList.add("is-invalid"),(r>i||r<0)&&t.classList.add("is-invalid")}async function B(t){let i=c(t);i.focus(),await navigator.clipboard.writeText(`${i.value}`).then(function(){console.log(`Copied ${be(i.value.length)} to the clipboard`)},function(r){console.error(`could not save any text to the clipboard: ${r}`)})}function c(t){let i=document.getElementById(t);if(i==null)throw new Error(`The ${t} for getElmById() element is null.`);return i}function be(t=0){let n=Math.pow(1e3,2),a=Math.pow(1e3,3);return t>a?`${(Math.round(t*100/a)/100).toFixed(2)} GB`:t>n?`${(Math.round(t*100/n)/100).toFixed(1)} MB`:t>1e3?`${(Math.round(t*100/1e3)/100).toFixed()} kB`:`${Math.round(t).toFixed()} bytes`}(()=>{"use strict";let t={backdrop:"static",keyboard:!1},i=new bootstrap.Modal("#artifact-editor-modal",t),r=new bootstrap.Modal("#asset-editor-modal",t),o=new bootstrap.Modal("#emulate-editor-modal",t),n=document.getElementsByName("artifact-editor-dataeditor");if(n.length>0)for(let e=0;e{r.hide(),o.hide(),i.show()});let a=document.getElementsByName("artifact-editor-fileeditor");if(a.length>0)for(let e=0;e{i.hide(),o.hide(),r.show()});let d=document.getElementsByName("artifact-editor-emueditor");if(d.length>0)for(let e=0;e{i.hide(),r.hide(),o.show()});let u=document.getElementById("emulate-run-program");if(u!==null){let e=document.getElementById("emulate-guess-program");if(e===null)throw new Error("The guess program input is missing.");u.addEventListener("input",()=>{if(u.value=u.value.toUpperCase(),u.value!==""){e.disabled=!0;return}e.disabled=!1})}if(c("artifact-editor-key-value")===null)throw new Error("The key value is missing.");let w=c("artifact-editor-key-label");if(w===null)throw new Error("The key label is missing.");if(w.addEventListener("click",()=>B("artifact-editor-key-value")),c("artifact-editor-unique-id-value")===null)throw new Error("The unique id value is missing.");let Z=c("artifact-editor-unique-id-label");if(Z===null)throw new Error("The unique id label is missing.");if(Z.addEventListener("click",()=>B("artifact-editor-unique-id-value")),c("artifact-editor-location-value")===null)throw new Error("The location value is missing.");let _=c("artifact-editor-location-label");if(_===null)throw new Error("The location label is missing.");if(_.addEventListener("click",()=>B("artifact-editor-location-value")),c("artifact-editor-templocation")!==null&&c("artifact-editor-templocation-label").addEventListener("click",()=>B("artifact-editor-templocation")),document.getElementById("artifact-editor-os-label")===null)throw new Error("The operating system label is missing.");let m=document.getElementById("artifact-editor-operating-system");if(m===null)throw new Error("The operating system input is missing.");m.addEventListener("input",R);let E=document.getElementById("artifact-editor-category");if(E===null)throw new Error("The category input is missing.");E.addEventListener("input",C),R(),C();function R(){let e=m.selectedIndex,l=m.options[e].parentNode.label;(typeof l>"u"||l=="")&&(m.classList.add("is-invalid"),m.classList.remove("is-valid"),l="Operating system"),m.textContent=`${l}`}function C(){E.selectedIndex==0&&(E.classList.remove("is-valid"),E.classList.add("is-invalid"))}let U=document.getElementsByName("prereset-classifications");if(U.length===0)throw new Error("The preset classifications are missing.");for(let e=0;e{P.preventDefault(),m.value=l,m.classList.remove("is-invalid"),E.value=M,E.classList.remove("is-invalid"),R(),C()})}let h=document.getElementById("artifact-editor-filename");if(h===null)throw new Error("The filename input is missing.");h.addEventListener("input",e=>{e.target.classList.remove("is-valid"),e.target.classList.remove("is-invalid"),e.target.value.trim().length===0&&e.target.classList.add("is-invalid")});let J=document.getElementById("artifact-editor-filename-reset");if(J===null)throw new Error("The filename reset is missing.");let Y=document.getElementsByName("artifact-editor-filename-undo");if(Y.length===0)throw new Error("The filename resetter is missing.");J.addEventListener("click",()=>{if(h.classList.remove("is-valid"),Y.length===0)throw new Error("The filename resetter is missing.");h.value=Y[0].value,h.classList.add("is-valid"),h.classList.remove("is-invalid"),h.value.trim().length===0&&h.classList.add("is-invalid")});let p=document.getElementById("artifact-editor-releaser-1");if(p===null)throw new Error("The releaser 1 input is missing.");p.addEventListener("input",e=>b(e.target));let L=document.getElementById("artifact-editor-releaser-2");if(L===null)throw new Error("The releaser 2 input is missing.");L.addEventListener("input",e=>b(e.target));let K=document.getElementById("artifact-editor-releaser-undo");if(K===null)throw new Error("The releasers reset is missing.");K.addEventListener("click",pe);function pe(){let e=p.getAttribute("data-reset-rel1");if(e===null)throw new Error("data-reset-rel1 attribute is required for artifact-editor-releaser-1.");p.value=e,b(p);let s=L.getAttribute("data-reset-rel2");if(s===null)throw new Error("data-reset-rel2 attribute is required for artifact-editor-releaser-2.");L.value=s,b(L)}let y=document.getElementById("artifact-editor-title");if(y===null)throw new Error("The title input is missing.");y.addEventListener("input",e=>{e.target.classList.remove("is-valid")});let Q=document.getElementById("artifact-editor-title-undo");if(Q===null)throw new Error("The title reset is missing.");let D=document.getElementsByName("artifact-editor-titleundo");if(D.length===0)throw new Error("The title resetter is missing.");Q.addEventListener("click",()=>{if(y.classList.remove("is-valid"),D.length===0)throw new Error("The title resetter is missing.");y.value=D[0].value,y.classList.add("is-valid")});let F=document.getElementById("artifact-editor-credit-text");if(F===null)throw new Error("The creator text input is missing.");F.addEventListener("input",e=>{e.target.classList.remove("is-valid")});let S=document.getElementById("artifact-editor-credit-ill");if(S===null)throw new Error("The creator illustrator input is missing.");S.addEventListener("input",e=>{e.target.classList.remove("is-valid")});let G=document.getElementById("artifact-editor-credit-prog");if(G===null)throw new Error("The creator programmer input is missing.");G.addEventListener("input",e=>{e.target.classList.remove("is-valid")});let j=document.getElementById("artifact-editor-credit-audio");if(j===null)throw new Error("The creator audio input is missing.");j.addEventListener("input",e=>{e.target.classList.remove("is-valid")});let z=document.getElementById("artifact-editor-credits-undo");if(z===null)throw new Error("The creator resetter is missing.");let X=document.getElementById("artifact-editor-credit-undo");if(X===null)throw new Error("The creator reset is missing.");X.addEventListener("click",()=>{if(z.length===0)throw new Error("The creator resetter is missing.");let e=z.value.split(";");if(e.length!=4)throw new Error("The creator resetter values are invalid.");let s=e[0],l=e[1],M=e[2],P=e[3];F.value=s,S.value=l,G.value=M,j.value=P});let x=document.getElementById("artifact-editor-comment");if(x===null)throw new Error("The comment input is missing.");x.addEventListener("input",e=>{e.target.classList.remove("is-valid")});let ee=document.getElementById("artifact-editor-comment-undo");if(ee===null)throw new Error("The comment reset is missing.");let te=document.getElementById("artifact-editor-comment-resetter");if(te===null)throw new Error("The comment resetter is missing.");ee.addEventListener("click",()=>{x.classList.remove("is-valid"),x.value=te.value});let ie=document.getElementById("artifact-editor-virustotal");if(ie===null)throw new Error("The virustotal input is missing.");ie.addEventListener("input",e=>{e.target.classList.remove("is-valid","is-invalid");let s=e.target.value.trim();s.length!=0&&(s.startsWith("https://www.virustotal.com/")||e.target.classList.add("is-invalid"))});let v=document.getElementById("artifact-editor-year");if(v===null)throw new Error("The year input is missing.");v.addEventListener("input",()=>{q(v,f,g)});let f=document.getElementById("artifact-editor-month");if(f===null)throw new Error("The month input is missing.");f.addEventListener("input",()=>{q(v,f,g)});let g=document.getElementById("artifact-editor-day");if(g===null)throw new Error("The day input is missing.");g.addEventListener("input",()=>{q(v,f,g)});let re=document.getElementById("artifact-editor-date-reset");if(re===null)throw new Error("The date reset is missing.");let ne=document.getElementById("artifact-editor-date-resetter");if(ne===null)throw new Error("The date resetter is missing.");re.addEventListener("click",()=>{v.classList.remove("is-invalid","is-valid"),f.classList.remove("is-invalid","is-valid"),g.classList.remove("is-invalid","is-valid");let s=ne.value.split("-");if(s.length!=3)throw new Error("The date resetter values are invalid.");v.value=s[0],f.value=s[1],g.value=s[2]});let se=document.getElementById("artifact-editor-date-lastmod");if(se!==null){let e=document.getElementById("artifact-editor-date-lastmodder");if(e===null)throw new Error("The date last modder input is missing.");se.addEventListener("click",()=>{v.classList.remove("is-invalid","is-valid"),f.classList.remove("is-invalid","is-valid"),g.classList.remove("is-invalid","is-valid");let l=e.value.split("-");if(l.length!=3)throw new Error("The date last modder values are invalid.");v.value=l[0],f.value=l[1],g.value=l[2]})}let ae=document.getElementById("artifact-editor-links-reset");if(ae===null)throw new Error("The links reset is missing.");let I=document.getElementById("artifact-editor-youtube"),oe=document.getElementById("artifact-editor-youtube-reset");if(I===null||oe===null)throw new Error("A YouTube input is missing.");let k=document.getElementById("artifact-editor-demozoo"),le=document.getElementById("artifact-editor-demozoo-reset");if(k===null||le===null)throw new Error("A Demozoo input is missing.");let N=document.getElementById("artifact-editor-pouet"),de=document.getElementById("artifact-editor-pouet-reset");if(N===null||de===null)throw new Error("A Pouet input is missing.");let $=document.getElementById("artifact-editor-16colors"),ce=document.getElementById("artifact-editor-16colors-reset");if($===null||ce===null)throw new Error("A 16colors input is missing.");let A=document.getElementById("artifact-editor-github"),ue=document.getElementById("artifact-editor-github-reset");if(A===null||ue===null)throw new Error("A GitHub input is missing.");let H=document.getElementById("artifact-editor-relations"),me=document.getElementById("artifact-editor-relations-reset");if(H===null||me===null)throw new Error("A relations input is missing.");let O=document.getElementById("artifact-editor-websites"),ve=document.getElementById("artifact-editor-websites-reset");if(O===null||ve===null)throw new Error("A websites input is missing.");ae.addEventListener("click",()=>{I.classList.remove("is-invalid","is-valid"),k.classList.remove("is-invalid","is-valid"),N.classList.remove("is-invalid","is-valid"),$.classList.remove("is-invalid","is-valid"),A.classList.remove("is-invalid","is-valid"),H.classList.remove("is-invalid","is-valid"),O.classList.remove("is-invalid","is-valid"),I.value=oe.value,k.value=le.value,N.value=de.value,$.value=ce.value,A.value=ue.value,H.value=me.value,O.value=ve.value});let Le=45e4,ye=2e5;I.addEventListener("input",e=>Ee(e.target)),k.addEventListener("input",e=>V(e.target,Le)),N.addEventListener("input",e=>V(e.target,ye)),$.addEventListener("input",e=>ge(e.target)),A.addEventListener("input",e=>fe(e.target))})();})(); +(()=>{function q(t,i,r){if(t==null)throw new Error("The year input element is null.");if(i==null)throw new Error("The month input element is null.");if(r==null)throw new Error("The day input element is null.");t.classList.remove("is-invalid","is-valid"),i.classList.remove("is-invalid","is-valid"),r.classList.remove("is-invalid","is-valid");let o=parseInt(t.value,10);isNaN(o)?t.value="0":t.value=o;let n=parseInt(i.value,10);isNaN(n)?i.value="0":i.value=n;let a=parseInt(r.value,10);isNaN(a)?r.value="0":r.value=a;let d=0,u=new Date().getFullYear(),W=o>=1980&&o<=u;o>d&&!W&&t.classList.add("is-invalid");let w=n>=1&&n<=12;n>d&&!w&&i.classList.add("is-invalid");let T=a>=1&&a<=31;a>d&&!T&&r.classList.add("is-invalid"),isNaN(o)&&(w||T)&&t.classList.add("is-invalid"),(n==d||isNaN(n))&&T&&i.classList.add("is-invalid")}function fe(t){return he(t,!0)}function ge(t){return he(t,!1)}function he(t,i){if(t==null)throw new Error("The repository URL element is null.");t.classList.remove("is-valid","is-invalid");let r=t.value.trim();if(r.length===0)return;if(i==!0&&r.startsWith("refs/")){t.classList.add("is-invalid");return}if(r.includes("://")){t.classList.add("is-invalid");return}let n=/[^A-Za-z0-9-._/]/g;r=r.replace(n,""),r=r.replaceAll("//","/");let a=/^\//;r=r.replace(a,""),t.value=r;let d=t.getAttribute("maxlength");if(d===null)throw new Error(`The maxlength attribute is required for ${t.id}.`);if(r.length>d){t.classList.add("is-invalid");return}}function b(t){if(t==null)throw new Error("The element of the releaser validator is null.");t.classList.remove("is-valid","is-invalid");let i=t.value.trim().toUpperCase();i=i.replace(/[^A-ZÀ-ÖØ-Þ0-9\-,& ]/g,""),t.value=i;let r=t.getAttribute("minlength"),o=t.getAttribute("maxlength"),n=t.getAttribute("required");if(r===null)throw new Error(`The minlength attribute is required for ${t.id}.`);if(o===null)throw new Error(`The maxlength attribute is required for ${t.id}.`);let a=document.getElementById("artifact-editor-releasers-error");if(a===null)throw new Error("The releasers error element is null.");let d=i.lengtho;if(n!=null&&d){t.classList.add("is-invalid"),t.id==="-1"&&a.classList.add("d-block");return}let u=i.length>0&&(i.lengtho);if(n==null&&u){t.classList.add("is-invalid");return}t.classList.remove("is-invalid"),a.classList.remove("d-block")}function Ee(t){if(t==null)throw new Error("The element of the releaser validator is null.");t.classList.remove("is-valid","is-invalid");let i=t.value.trim();i.length>0&&i.length!=11&&t.classList.add("is-invalid")}function V(t,i){if(t==null)throw new Error("The element of the number validator is null.");t.classList.remove("is-valid","is-invalid");let r=parseInt(t.value,10);isNaN(r)&&t.classList.add("is-invalid"),(r>i||r<0)&&t.classList.add("is-invalid")}async function B(t){let i=c(t);i.focus(),await navigator.clipboard.writeText(`${i.value}`).then(function(){console.log(`Copied ${be(i.value.length)} to the clipboard`)},function(r){console.error(`could not save any text to the clipboard: ${r}`)})}function c(t){let i=document.getElementById(t);if(i==null)throw new Error(`The ${t} for getElmById() element is null.`);return i}function be(t=0){let n=Math.pow(1e3,2),a=Math.pow(1e3,3);return t>a?`${(Math.round(t*100/a)/100).toFixed(2)} GB`:t>n?`${(Math.round(t*100/n)/100).toFixed(1)} MB`:t>1e3?`${(Math.round(t*100/1e3)/100).toFixed()} kB`:`${Math.round(t).toFixed()} bytes`}(()=>{"use strict";let t={backdrop:"static",keyboard:!1},i=new bootstrap.Modal("#artifact-editor-modal",t),r=new bootstrap.Modal("#asset-editor-modal",t),o=new bootstrap.Modal("#emulate-editor-modal",t),n=document.getElementsByName("artifact-editor-dataeditor");if(n.length>0)for(let e=0;e{r.hide(),o.hide(),i.show()});let a=document.getElementsByName("artifact-editor-fileeditor");if(a.length>0)for(let e=0;e{i.hide(),o.hide(),r.show()});let d=document.getElementsByName("artifact-editor-emueditor");if(d.length>0)for(let e=0;e{i.hide(),r.hide(),o.show()});let u=document.getElementById("emulate-run-program");if(u!==null){let e=document.getElementById("emulate-guess-program");if(e===null)throw new Error("The guess program input is missing.");u.addEventListener("input",()=>{if(u.value=u.value.toUpperCase(),u.value!==""){e.disabled=!0;return}e.disabled=!1})}if(c("artifact-editor-key-value")===null)throw new Error("The key value is missing.");let w=c("artifact-editor-key-label");if(w===null)throw new Error("The key label is missing.");if(w.addEventListener("click",()=>B("artifact-editor-key-value")),c("artifact-editor-unique-id-value")===null)throw new Error("The unique id value is missing.");let Z=c("artifact-editor-unique-id-label");if(Z===null)throw new Error("The unique id label is missing.");if(Z.addEventListener("click",()=>B("artifact-editor-unique-id-value")),c("artifact-editor-location-value")===null)throw new Error("The location value is missing.");let _=c("artifact-editor-location-label");if(_===null)throw new Error("The location label is missing.");if(_.addEventListener("click",()=>B("artifact-editor-location-value")),c("artifact-editor-templocation")!==null&&c("artifact-editor-templocation-label").addEventListener("click",()=>B("artifact-editor-templocation")),document.getElementById("artifact-editor-os-label")===null)throw new Error("The operating system label is missing.");let m=document.getElementById("artifact-editor-operating-system");if(m===null)throw new Error("The operating system input is missing.");m.addEventListener("input",R);let E=document.getElementById("artifact-editor-category");if(E===null)throw new Error("The category input is missing.");E.addEventListener("input",C),R(),C();function R(){let e=m.selectedIndex,l=m.options[e].parentNode.label;(typeof l>"u"||l=="")&&(m.classList.add("is-invalid"),m.classList.remove("is-valid"),l="Operating system",m.textContent=`${l}`)}function C(){E.selectedIndex==0&&(E.classList.remove("is-valid"),E.classList.add("is-invalid"))}let U=document.getElementsByName("prereset-classifications");if(U.length===0)throw new Error("The preset classifications are missing.");for(let e=0;e{P.preventDefault(),m.value=l,m.classList.remove("is-invalid"),E.value=M,E.classList.remove("is-invalid"),R(),C()})}let h=document.getElementById("artifact-editor-filename");if(h===null)throw new Error("The filename input is missing.");h.addEventListener("input",e=>{e.target.classList.remove("is-valid"),e.target.classList.remove("is-invalid"),e.target.value.trim().length===0&&e.target.classList.add("is-invalid")});let J=document.getElementById("artifact-editor-filename-reset");if(J===null)throw new Error("The filename reset is missing.");let Y=document.getElementsByName("artifact-editor-filename-undo");if(Y.length===0)throw new Error("The filename resetter is missing.");J.addEventListener("click",()=>{if(h.classList.remove("is-valid"),Y.length===0)throw new Error("The filename resetter is missing.");h.value=Y[0].value,h.classList.add("is-valid"),h.classList.remove("is-invalid"),h.value.trim().length===0&&h.classList.add("is-invalid")});let p=document.getElementById("artifact-editor-releaser-1");if(p===null)throw new Error("The releaser 1 input is missing.");p.addEventListener("input",e=>b(e.target));let L=document.getElementById("artifact-editor-releaser-2");if(L===null)throw new Error("The releaser 2 input is missing.");L.addEventListener("input",e=>b(e.target));let K=document.getElementById("artifact-editor-releaser-undo");if(K===null)throw new Error("The releasers reset is missing.");K.addEventListener("click",pe);function pe(){let e=p.getAttribute("data-reset-rel1");if(e===null)throw new Error("data-reset-rel1 attribute is required for artifact-editor-releaser-1.");p.value=e,b(p);let s=L.getAttribute("data-reset-rel2");if(s===null)throw new Error("data-reset-rel2 attribute is required for artifact-editor-releaser-2.");L.value=s,b(L)}let y=document.getElementById("artifact-editor-title");if(y===null)throw new Error("The title input is missing.");y.addEventListener("input",e=>{e.target.classList.remove("is-valid")});let Q=document.getElementById("artifact-editor-title-undo");if(Q===null)throw new Error("The title reset is missing.");let D=document.getElementsByName("artifact-editor-titleundo");if(D.length===0)throw new Error("The title resetter is missing.");Q.addEventListener("click",()=>{if(y.classList.remove("is-valid"),D.length===0)throw new Error("The title resetter is missing.");y.value=D[0].value,y.classList.add("is-valid")});let F=document.getElementById("artifact-editor-credit-text");if(F===null)throw new Error("The creator text input is missing.");F.addEventListener("input",e=>{e.target.classList.remove("is-valid")});let S=document.getElementById("artifact-editor-credit-ill");if(S===null)throw new Error("The creator illustrator input is missing.");S.addEventListener("input",e=>{e.target.classList.remove("is-valid")});let G=document.getElementById("artifact-editor-credit-prog");if(G===null)throw new Error("The creator programmer input is missing.");G.addEventListener("input",e=>{e.target.classList.remove("is-valid")});let j=document.getElementById("artifact-editor-credit-audio");if(j===null)throw new Error("The creator audio input is missing.");j.addEventListener("input",e=>{e.target.classList.remove("is-valid")});let z=document.getElementById("artifact-editor-credits-undo");if(z===null)throw new Error("The creator resetter is missing.");let X=document.getElementById("artifact-editor-credit-undo");if(X===null)throw new Error("The creator reset is missing.");X.addEventListener("click",()=>{if(z.length===0)throw new Error("The creator resetter is missing.");let e=z.value.split(";");if(e.length!=4)throw new Error("The creator resetter values are invalid.");let s=e[0],l=e[1],M=e[2],P=e[3];F.value=s,S.value=l,G.value=M,j.value=P});let x=document.getElementById("artifact-editor-comment");if(x===null)throw new Error("The comment input is missing.");x.addEventListener("input",e=>{e.target.classList.remove("is-valid")});let ee=document.getElementById("artifact-editor-comment-undo");if(ee===null)throw new Error("The comment reset is missing.");let te=document.getElementById("artifact-editor-comment-resetter");if(te===null)throw new Error("The comment resetter is missing.");ee.addEventListener("click",()=>{x.classList.remove("is-valid"),x.value=te.value});let ie=document.getElementById("artifact-editor-virustotal");if(ie===null)throw new Error("The virustotal input is missing.");ie.addEventListener("input",e=>{e.target.classList.remove("is-valid","is-invalid");let s=e.target.value.trim();s.length!=0&&(s.startsWith("https://www.virustotal.com/")||e.target.classList.add("is-invalid"))});let v=document.getElementById("artifact-editor-year");if(v===null)throw new Error("The year input is missing.");v.addEventListener("input",()=>{q(v,f,g)});let f=document.getElementById("artifact-editor-month");if(f===null)throw new Error("The month input is missing.");f.addEventListener("input",()=>{q(v,f,g)});let g=document.getElementById("artifact-editor-day");if(g===null)throw new Error("The day input is missing.");g.addEventListener("input",()=>{q(v,f,g)});let re=document.getElementById("artifact-editor-date-reset");if(re===null)throw new Error("The date reset is missing.");let ne=document.getElementById("artifact-editor-date-resetter");if(ne===null)throw new Error("The date resetter is missing.");re.addEventListener("click",()=>{v.classList.remove("is-invalid","is-valid"),f.classList.remove("is-invalid","is-valid"),g.classList.remove("is-invalid","is-valid");let s=ne.value.split("-");if(s.length!=3)throw new Error("The date resetter values are invalid.");v.value=s[0],f.value=s[1],g.value=s[2]});let se=document.getElementById("artifact-editor-date-lastmod");if(se!==null){let e=document.getElementById("artifact-editor-date-lastmodder");if(e===null)throw new Error("The date last modder input is missing.");se.addEventListener("click",()=>{v.classList.remove("is-invalid","is-valid"),f.classList.remove("is-invalid","is-valid"),g.classList.remove("is-invalid","is-valid");let l=e.value.split("-");if(l.length!=3)throw new Error("The date last modder values are invalid.");v.value=l[0],f.value=l[1],g.value=l[2]})}let ae=document.getElementById("artifact-editor-links-reset");if(ae===null)throw new Error("The links reset is missing.");let I=document.getElementById("artifact-editor-youtube"),oe=document.getElementById("artifact-editor-youtube-reset");if(I===null||oe===null)throw new Error("A YouTube input is missing.");let k=document.getElementById("artifact-editor-demozoo"),le=document.getElementById("artifact-editor-demozoo-reset");if(k===null||le===null)throw new Error("A Demozoo input is missing.");let N=document.getElementById("artifact-editor-pouet"),de=document.getElementById("artifact-editor-pouet-reset");if(N===null||de===null)throw new Error("A Pouet input is missing.");let $=document.getElementById("artifact-editor-16colors"),ce=document.getElementById("artifact-editor-16colors-reset");if($===null||ce===null)throw new Error("A 16colors input is missing.");let A=document.getElementById("artifact-editor-github"),ue=document.getElementById("artifact-editor-github-reset");if(A===null||ue===null)throw new Error("A GitHub input is missing.");let H=document.getElementById("artifact-editor-relations"),me=document.getElementById("artifact-editor-relations-reset");if(H===null||me===null)throw new Error("A relations input is missing.");let O=document.getElementById("artifact-editor-websites"),ve=document.getElementById("artifact-editor-websites-reset");if(O===null||ve===null)throw new Error("A websites input is missing.");ae.addEventListener("click",()=>{I.classList.remove("is-invalid","is-valid"),k.classList.remove("is-invalid","is-valid"),N.classList.remove("is-invalid","is-valid"),$.classList.remove("is-invalid","is-valid"),A.classList.remove("is-invalid","is-valid"),H.classList.remove("is-invalid","is-valid"),O.classList.remove("is-invalid","is-valid"),I.value=oe.value,k.value=le.value,N.value=de.value,$.value=ce.value,A.value=ue.value,H.value=me.value,O.value=ve.value});let Le=45e4,ye=2e5;I.addEventListener("input",e=>Ee(e.target)),k.addEventListener("input",e=>V(e.target,Le)),N.addEventListener("input",e=>V(e.target,ye)),$.addEventListener("input",e=>ge(e.target)),A.addEventListener("input",e=>fe(e.target))})();})();