ui/ui.min.js

2 lines
2.3 KiB
JavaScript
Raw Normal View History

(()=>{const o={version:"1.0.0",files:{"frameworks/Bootstrap.js":"mrgoatzb","frameworks/State.js":"mrgokg8d","utilities/HTTP.js":"mrg6t8zm","utilities/MouseMover.js":"mrg6t8zm","utilities/VirtualScroll.js":"mrg6t8zn","components/API.js":"mrggjm8m","components/AutoForm.js":"mrgoatz5","components/Dialog.js":"mrggjm8m","components/List.js":"mrge46xl","components/Modal.js":"mrg6uq6a","components/Nav.js":"mrg6uq7g","components/Resizer.js":"mrghfzrh","components/Toast.js":"mrghiycy","components/form/ColorPicker.js":"mrgn837c","components/form/DatePicker.js":"mrgn837c","components/form/IconPicker.js":"mrgoatz5","components/form/TagsInput.js":"mrgn837b"}},t=document.currentScript;if(!t||"loading"!==document.readyState)throw new Error("ui.js must be loaded by a normal <script> while the document is parsing");const s=(t?.getAttribute("components")||"").split(",").map(o=>o.trim()).filter(Boolean),e={HTTP:{path:"utilities/HTTP.js"},VirtualScroll:{path:"utilities/VirtualScroll.js"},MouseMover:{path:"utilities/MouseMover.js"},API:{path:"components/API.js",needs:["Toast"]},AutoForm:{path:"components/AutoForm.js",needs:["Toast"]},List:{path:"components/List.js",needs:["VirtualScroll"]},Modal:{path:"components/Modal.js"},Dialog:{path:"components/Dialog.js",needs:["Modal"]},Toast:{path:"components/Toast.js"},Nav:{path:"components/Nav.js"},Resizer:{path:"components/Resizer.js"},DatePicker:{path:"components/form/DatePicker.js",needs:["AutoForm"]},ColorPicker:{path:"components/form/ColorPicker.js",needs:["AutoForm"]},IconPicker:{path:"components/form/IconPicker.js",needs:["AutoForm"]},TagsInput:{path:"components/form/TagsInput.js",needs:["AutoForm"]}};if(!t.hasAttribute("components"))throw new Error('ui.js requires components="..."');const r=new URL(".",t.src),n=/(?:^|\/)ui\.min\.js$/.test(new URL(t.src).pathname),m=t=>document.write(`<script src="${(t=>{const s=n?t.replace(/\.js$/,".min.js"):t,e=new URL(s,r),m=o.files[t];return m&&e.searchParams.set("v",m),e.href})(t)}"><\/script>`);globalThis.Component||m("frameworks/State.js"),globalThis.bootstrap||m("frameworks/Bootstrap.js"),["HTTP","VirtualScroll","MouseMover"].forEach(o=>m(e[o].path));const a=new Set(["HTTP","VirtualScroll","MouseMover"]),i=o=>{if(a.has(o))return;a.add(o);const t=e[o]||{path:"components/"+o.split(".").join("/")+".js"};(t.needs||[]).forEach(i),m(t.path)};s.forEach(i)})();