diff --git a/flake.nix b/flake.nix index d455510..24d7274 100644 --- a/flake.nix +++ b/flake.nix @@ -66,11 +66,11 @@ ## Fetch dependenies - HTMX_VERSION=2.0.3 - HYPERSCRIPT_VERSION=0.9.13 - CHOICES_DOT_JS_VERSION=11.0.2 - SVG_LOADER_VERISON=1.7.1 - SORTABLE_VERSION=1.15.6 + export HTMX_VERSION=2.0.3 + export HYPERSCRIPT_VERSION=0.9.13 + export CHOICES_DOT_JS_VERSION=11.0.2 + export SVG_LOADER_VERSION=1.7.1 + export SORTABLE_VERSION=1.15.6 if [ ! -f ./static/js/hyperscript.js ]; then curl -sL --verbose "https://unpkg.com/hyperscript.org@$HYPERSCRIPT_VERSION" > ./static/js/hyperscript.js @@ -89,11 +89,11 @@ fi if [ ! -f ./static/js/svg-loader.min.js ]; then - curl -sL --verbose "https://unpkg.com/external-svg-loader@$SVG_LOADER_VERSION/public/assets/scripts/svg-loader.min.js" > ./static/js/svg-loader.min.js + curl -sL --verbose "https://unpkg.com/external-svg-loader@$SVG_LOADER_VERSION/svg-loader.min.js" > ./static/js/svg-loader.min.js fi if [ ! -f ./static/js/Sortable.min.js ]; then - curl -sL --verbose "https://unpkg.com/sortablejs@$SVG_LOADER_VERSION/public/assets/scripts/Sortable.min.js" > ./static/js/Sortable.min.js + curl -sL --verbose "https://unpkg.com/sortablejs@$SORTABLE_VERSION/Sortable.min.js" > ./static/js/Sortable.min.js fi if [ ! -f ./static/css/choices.min.css ]; then diff --git a/static/css/styles.css b/static/css/styles.css index 4219b4c..d951243 100644 --- a/static/css/styles.css +++ b/static/css/styles.css @@ -1388,6 +1388,21 @@ html { text-align: right; } +.radio { + flex-shrink: 0; + --chkbg: var(--bc); + height: 1.5rem; + width: 1.5rem; + cursor: pointer; + -webkit-appearance: none; + -moz-appearance: none; + appearance: none; + border-radius: 9999px; + border-width: 1px; + border-color: var(--fallback-bc,oklch(var(--bc)/var(--tw-border-opacity))); + --tw-border-opacity: 0.2; +} + .range { height: 1.5rem; width: 100%; @@ -1405,6 +1420,21 @@ html { outline: none; } +.rating { + position: relative; + display: inline-flex; +} + +.rating :where(input) { + cursor: pointer; + border-radius: 0px; + animation: rating-pop var(--animation-input, 0.25s) ease-out; + height: 1.5rem; + width: 1.5rem; + background-color: var(--fallback-bc,oklch(var(--bc)/var(--tw-bg-opacity))); + --tw-bg-opacity: 1; +} + .select { display: inline-flex; cursor: pointer; @@ -1795,6 +1825,10 @@ input.tab:checked + .tab-content, margin-inline-start: calc(var(--border-btn) * -1); } +.join-item:focus { + isolation: isolate; +} + .link:focus { outline: 2px solid transparent; outline-offset: 2px; @@ -1895,6 +1929,32 @@ input.tab:checked + .tab-content, } } +.radio:focus { + box-shadow: none; +} + +.radio:focus-visible { + outline-style: solid; + outline-width: 2px; + outline-offset: 2px; + outline-color: var(--fallback-bc,oklch(var(--bc)/1)); +} + +.radio:checked, + .radio[aria-checked="true"] { + --tw-bg-opacity: 1; + background-color: var(--fallback-bc,oklch(var(--bc)/var(--tw-bg-opacity))); + background-image: none; + animation: radiomark var(--animation-input, 0.2s) ease-out; + box-shadow: 0 0 0 4px var(--fallback-b1,oklch(var(--b1)/1)) inset, + 0 0 0 4px var(--fallback-b1,oklch(var(--b1)/1)) inset; +} + +.radio:disabled { + cursor: not-allowed; + opacity: 0.2; +} + @keyframes radiomark { 0% { box-shadow: 0 0 0 12px var(--fallback-b1,oklch(var(--b1)/1)) inset, @@ -1971,6 +2031,39 @@ input.tab:checked + .tab-content, calc(var(--filler-size) * -1 - var(--filler-offset)) 0 0 var(--filler-size); } +.rating input { + -moz-appearance: none; + appearance: none; + -webkit-appearance: none; +} + +.rating .rating-hidden { + width: 0.5rem; + background-color: transparent; +} + +.rating input[type="radio"]:checked { + background-image: none; +} + +.rating input:checked ~ input, + .rating input[aria-checked="true"] ~ input { + --tw-bg-opacity: 0.2; +} + +.rating input:focus-visible { + transition-property: transform; + transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1); + transition-timing-function: cubic-bezier(0, 0, 0.2, 1); + transition-duration: 300ms; + transform: translateY(-0.125em); +} + +.rating input:active:focus { + animation: none; + transform: translateY(-0.125em); +} + @keyframes rating-pop { 0% { transform: translateY(-0.125em); @@ -2486,6 +2579,11 @@ input.tab:checked + .tab-content, display: none; } +.size-6 { + width: 1.5rem; + height: 1.5rem; +} + .h-12 { height: 3rem; } @@ -2975,6 +3073,10 @@ input.tab:checked + .tab-content, box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow); } +.outline { + outline-style: solid; +} + .filter { filter: var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow); } diff --git a/static/js/Sortable.min.js b/static/js/Sortable.min.js index 12bdc0d..95423a6 100644 --- a/static/js/Sortable.min.js +++ b/static/js/Sortable.min.js @@ -1 +1,2 @@ -{"error":"Invalid URL: /sortablejs@/public/assets/scripts/Sortable.min.js"} \ No newline at end of file +/*! Sortable 1.15.6 - MIT | git://github.com/SortableJS/Sortable.git */ +!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t=t||self).Sortable=e()}(this,function(){"use strict";function e(e,t){var n,o=Object.keys(e);return Object.getOwnPropertySymbols&&(n=Object.getOwnPropertySymbols(e),t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),o.push.apply(o,n)),o}function I(o){for(var t=1;tt.length)&&(e=t.length);for(var n=0,o=new Array(e);n"===e[0]&&(e=e.substring(1)),t))try{if(t.matches)return t.matches(e);if(t.msMatchesSelector)return t.msMatchesSelector(e);if(t.webkitMatchesSelector)return t.webkitMatchesSelector(e)}catch(t){return}}function g(t){return t.host&&t!==document&&t.host.nodeType?t.host:t.parentNode}function P(t,e,n,o){if(t){n=n||document;do{if(null!=e&&(">"!==e[0]||t.parentNode===n)&&f(t,e)||o&&t===n)return t}while(t!==n&&(t=g(t)))}return null}var m,v=/\s+/g;function k(t,e,n){var o;t&&e&&(t.classList?t.classList[n?"add":"remove"](e):(o=(" "+t.className+" ").replace(v," ").replace(" "+e+" "," "),t.className=(o+(n?" "+e:"")).replace(v," ")))}function R(t,e,n){var o=t&&t.style;if(o){if(void 0===n)return document.defaultView&&document.defaultView.getComputedStyle?n=document.defaultView.getComputedStyle(t,""):t.currentStyle&&(n=t.currentStyle),void 0===e?n:n[e];o[e=!(e in o||-1!==e.indexOf("webkit"))?"-webkit-"+e:e]=n+("string"==typeof n?"":"px")}}function b(t,e){var n="";if("string"==typeof t)n=t;else do{var o=R(t,"transform")}while(o&&"none"!==o&&(n=o+" "+n),!e&&(t=t.parentNode));var i=window.DOMMatrix||window.WebKitCSSMatrix||window.CSSMatrix||window.MSCSSMatrix;return i&&new i(n)}function D(t,e,n){if(t){var o=t.getElementsByTagName(e),i=0,r=o.length;if(n)for(;i=n.left-e&&i<=n.right+e,e=r>=n.top-e&&r<=n.bottom+e;return o&&e?a=t:void 0}}),a);if(e){var n,o={};for(n in t)t.hasOwnProperty(n)&&(o[n]=t[n]);o.target=o.rootEl=e,o.preventDefault=void 0,o.stopPropagation=void 0,e[K]._onDragOver(o)}}var i,r,a}function Ft(t){Z&&Z.parentNode[K]._isOutsideThisEl(t.target)}function jt(t,e){if(!t||!t.nodeType||1!==t.nodeType)throw"Sortable: `el` must be an HTMLElement, not ".concat({}.toString.call(t));this.el=t,this.options=e=a({},e),t[K]=this;var n,o,i={group:null,sort:!0,disabled:!1,store:null,handle:null,draggable:/^[uo]l$/i.test(t.nodeName)?">li":">*",swapThreshold:1,invertSwap:!1,invertedSwapThreshold:null,removeCloneOnHide:!0,direction:function(){return kt(t,this.options)},ghostClass:"sortable-ghost",chosenClass:"sortable-chosen",dragClass:"sortable-drag",ignore:"a, img",filter:null,preventOnFilter:!0,animation:0,easing:null,setData:function(t,e){t.setData("Text",e.textContent)},dropBubble:!1,dragoverBubble:!1,dataIdAttr:"data-id",delay:0,delayOnTouchOnly:!1,touchStartThreshold:(Number.parseInt?Number:window).parseInt(window.devicePixelRatio,10)||1,forceFallback:!1,fallbackClass:"sortable-fallback",fallbackOnBody:!1,fallbackTolerance:0,fallbackOffset:{x:0,y:0},supportPointer:!1!==jt.supportPointer&&"PointerEvent"in window&&(!u||c),emptyInsertThreshold:5};for(n in z.initializePlugins(this,t,i),i)n in e||(e[n]=i[n]);for(o in Rt(e),this)"_"===o.charAt(0)&&"function"==typeof this[o]&&(this[o]=this[o].bind(this));this.nativeDraggable=!e.forceFallback&&It,this.nativeDraggable&&(this.options.touchStartThreshold=1),e.supportPointer?h(t,"pointerdown",this._onTapStart):(h(t,"mousedown",this._onTapStart),h(t,"touchstart",this._onTapStart)),this.nativeDraggable&&(h(t,"dragover",this),h(t,"dragenter",this)),St.push(this.el),e.store&&e.store.get&&this.sort(e.store.get(this)||[]),a(this,A())}function Ht(t,e,n,o,i,r,a,l){var s,c,u=t[K],d=u.options.onMove;return!window.CustomEvent||y||w?(s=document.createEvent("Event")).initEvent("move",!0,!0):s=new CustomEvent("move",{bubbles:!0,cancelable:!0}),s.to=e,s.from=t,s.dragged=n,s.draggedRect=o,s.related=i||e,s.relatedRect=r||X(e),s.willInsertAfter=l,s.originalEvent=a,t.dispatchEvent(s),c=d?d.call(u,s,a):c}function Lt(t){t.draggable=!1}function Kt(){xt=!1}function Wt(t){return setTimeout(t,0)}function zt(t){return clearTimeout(t)}jt.prototype={constructor:jt,_isOutsideThisEl:function(t){this.el.contains(t)||t===this.el||(vt=null)},_getDirection:function(t,e){return"function"==typeof this.options.direction?this.options.direction.call(this,t,e,Z):this.options.direction},_onTapStart:function(e){if(e.cancelable){var n=this,o=this.el,t=this.options,i=t.preventOnFilter,r=e.type,a=e.touches&&e.touches[0]||e.pointerType&&"touch"===e.pointerType&&e,l=(a||e).target,s=e.target.shadowRoot&&(e.path&&e.path[0]||e.composedPath&&e.composedPath()[0])||l,c=t.filter;if(!function(t){Ot.length=0;var e=t.getElementsByTagName("input"),n=e.length;for(;n--;){var o=e[n];o.checked&&Ot.push(o)}}(o),!Z&&!(/mousedown|pointerdown/.test(r)&&0!==e.button||t.disabled)&&!s.isContentEditable&&(this.nativeDraggable||!u||!l||"SELECT"!==l.tagName.toUpperCase())&&!((l=P(l,t.draggable,o,!1))&&l.animated||et===l)){if(it=j(l),at=j(l,t.draggable),"function"==typeof c){if(c.call(this,e,l,this))return V({sortable:n,rootEl:s,name:"filter",targetEl:l,toEl:o,fromEl:o}),U("filter",n,{evt:e}),void(i&&e.preventDefault())}else if(c=c&&c.split(",").some(function(t){if(t=P(s,t.trim(),o,!1))return V({sortable:n,rootEl:t,name:"filter",targetEl:l,fromEl:o,toEl:o}),U("filter",n,{evt:e}),!0}))return void(i&&e.preventDefault());t.handle&&!P(s,t.handle,o,!1)||this._prepareDragStart(e,a,l)}}},_prepareDragStart:function(t,e,n){var o,i=this,r=i.el,a=i.options,l=r.ownerDocument;n&&!Z&&n.parentNode===r&&(o=X(n),J=r,$=(Z=n).parentNode,tt=Z.nextSibling,et=n,st=a.group,ut={target:jt.dragged=Z,clientX:(e||t).clientX,clientY:(e||t).clientY},ft=ut.clientX-o.left,gt=ut.clientY-o.top,this._lastX=(e||t).clientX,this._lastY=(e||t).clientY,Z.style["will-change"]="all",o=function(){U("delayEnded",i,{evt:t}),jt.eventCanceled?i._onDrop():(i._disableDelayedDragEvents(),!s&&i.nativeDraggable&&(Z.draggable=!0),i._triggerDragStart(t,e),V({sortable:i,name:"choose",originalEvent:t}),k(Z,a.chosenClass,!0))},a.ignore.split(",").forEach(function(t){D(Z,t.trim(),Lt)}),h(l,"dragover",Bt),h(l,"mousemove",Bt),h(l,"touchmove",Bt),a.supportPointer?(h(l,"pointerup",i._onDrop),this.nativeDraggable||h(l,"pointercancel",i._onDrop)):(h(l,"mouseup",i._onDrop),h(l,"touchend",i._onDrop),h(l,"touchcancel",i._onDrop)),s&&this.nativeDraggable&&(this.options.touchStartThreshold=4,Z.draggable=!0),U("delayStart",this,{evt:t}),!a.delay||a.delayOnTouchOnly&&!e||this.nativeDraggable&&(w||y)?o():jt.eventCanceled?this._onDrop():(a.supportPointer?(h(l,"pointerup",i._disableDelayedDrag),h(l,"pointercancel",i._disableDelayedDrag)):(h(l,"mouseup",i._disableDelayedDrag),h(l,"touchend",i._disableDelayedDrag),h(l,"touchcancel",i._disableDelayedDrag)),h(l,"mousemove",i._delayedDragTouchMoveHandler),h(l,"touchmove",i._delayedDragTouchMoveHandler),a.supportPointer&&h(l,"pointermove",i._delayedDragTouchMoveHandler),i._dragStartTimer=setTimeout(o,a.delay)))},_delayedDragTouchMoveHandler:function(t){t=t.touches?t.touches[0]:t;Math.max(Math.abs(t.clientX-this._lastX),Math.abs(t.clientY-this._lastY))>=Math.floor(this.options.touchStartThreshold/(this.nativeDraggable&&window.devicePixelRatio||1))&&this._disableDelayedDrag()},_disableDelayedDrag:function(){Z&&Lt(Z),clearTimeout(this._dragStartTimer),this._disableDelayedDragEvents()},_disableDelayedDragEvents:function(){var t=this.el.ownerDocument;p(t,"mouseup",this._disableDelayedDrag),p(t,"touchend",this._disableDelayedDrag),p(t,"touchcancel",this._disableDelayedDrag),p(t,"pointerup",this._disableDelayedDrag),p(t,"pointercancel",this._disableDelayedDrag),p(t,"mousemove",this._delayedDragTouchMoveHandler),p(t,"touchmove",this._delayedDragTouchMoveHandler),p(t,"pointermove",this._delayedDragTouchMoveHandler)},_triggerDragStart:function(t,e){e=e||"touch"==t.pointerType&&t,!this.nativeDraggable||e?this.options.supportPointer?h(document,"pointermove",this._onTouchMove):h(document,e?"touchmove":"mousemove",this._onTouchMove):(h(Z,"dragend",this),h(J,"dragstart",this._onDragStart));try{document.selection?Wt(function(){document.selection.empty()}):window.getSelection().removeAllRanges()}catch(t){}},_dragStarted:function(t,e){var n;Dt=!1,J&&Z?(U("dragStarted",this,{evt:e}),this.nativeDraggable&&h(document,"dragover",Ft),n=this.options,t||k(Z,n.dragClass,!1),k(Z,n.ghostClass,!0),jt.active=this,t&&this._appendGhost(),V({sortable:this,name:"start",originalEvent:e})):this._nulling()},_emulateDragOver:function(){if(dt){this._lastX=dt.clientX,this._lastY=dt.clientY,Xt();for(var t=document.elementFromPoint(dt.clientX,dt.clientY),e=t;t&&t.shadowRoot&&(t=t.shadowRoot.elementFromPoint(dt.clientX,dt.clientY))!==e;)e=t;if(Z.parentNode[K]._isOutsideThisEl(t),e)do{if(e[K])if(e[K]._onDragOver({clientX:dt.clientX,clientY:dt.clientY,target:t,rootEl:e})&&!this.options.dragoverBubble)break}while(e=g(t=e));Yt()}},_onTouchMove:function(t){if(ut){var e=this.options,n=e.fallbackTolerance,o=e.fallbackOffset,i=t.touches?t.touches[0]:t,r=Q&&b(Q,!0),a=Q&&r&&r.a,l=Q&&r&&r.d,e=At&&wt&&E(wt),a=(i.clientX-ut.clientX+o.x)/(a||1)+(e?e[0]-Tt[0]:0)/(a||1),l=(i.clientY-ut.clientY+o.y)/(l||1)+(e?e[1]-Tt[1]:0)/(l||1);if(!jt.active&&!Dt){if(n&&Math.max(Math.abs(i.clientX-this._lastX),Math.abs(i.clientY-this._lastY))E.right+10||S.clientY>x.bottom&&S.clientX>x.left:S.clientY>E.bottom+10||S.clientX>x.right&&S.clientY>x.top)||m.animated)){if(m&&(t=n,e=r,C=X(B((_=this).el,0,_.options,!0)),_=L(_.el,_.options,Q),e?t.clientX<_.left-10||t.clientY{"use strict";var t={701:t=>{let e=0;t.exports={incr:()=>++e,decr:()=>--e,curr:()=>e}},941:t=>{t.exports=(t,e,r="")=>{const n=/url\(['"]?#([\w:.-]+)['"]?\)/g,o=/#([\w:.-]+)/g;return e.match(n)&&(e=e.replace(n,(function(e,r){return t[r]?`url(#${t[r]})`:e}))),["href","xlink:href"].includes(r)&&e.match(o)&&(e=e.replace(o,(function(e,r){return t[r]?`#${t[r]}`:e}))),e}},905:t=>{t.exports=(t,e,r)=>{const n=new RegExp("([^\r\n,{}]+)(,(?=[^}]*{)|s*{)","g");return t.replace(n,(function(t,n,o){if(n.match(/^\s*(@media|@.*keyframes|to|from|@font-face|1?[0-9]?[0-9])/))return n+o;const a=n.match(/#(\w+)/);return a&&r[a[1]]&&(n=n.replace(a[0],`#${r[a[1]]}`)),(n=n.replace(/^(\s*)/,"$1"+e+" "))+o}))}},678:(t,e,r)=>{function n(t){return new Promise(((e,r)=>{t.oncomplete=t.onsuccess=()=>e(t.result),t.onabort=t.onerror=()=>r(t.error)}))}function o(t,e){const r=indexedDB.open(t);r.onupgradeneeded=()=>r.result.createObjectStore(e);const o=n(r);return(t,r)=>o.then((n=>r(n.transaction(e,t).objectStore(e))))}let a;function s(){return a||(a=o("keyval-store","keyval")),a}function i(t,e=s()){return e("readonly",(e=>n(e.get(t))))}function c(t,e,r=s()){return r("readwrite",(r=>(r.put(e,t),n(r.transaction))))}function u(t,e=s()){return e("readwrite",(e=>(t.forEach((t=>e.put(t[1],t[0]))),n(e.transaction))))}function l(t,e=s()){return e("readonly",(e=>Promise.all(t.map((t=>n(e.get(t)))))))}function d(t,e,r=s()){return r("readwrite",(r=>new Promise(((o,a)=>{r.get(t).onsuccess=function(){try{r.put(e(this.result),t),o(n(r.transaction))}catch(t){a(t)}}}))))}function f(t,e=s()){return e("readwrite",(e=>(e.delete(t),n(e.transaction))))}function h(t,e=s()){return e("readwrite",(e=>(t.forEach((t=>e.delete(t))),n(e.transaction))))}function b(t=s()){return t("readwrite",(t=>(t.clear(),n(t.transaction))))}function g(t,e){return t.openCursor().onsuccess=function(){this.result&&(e(this.result),this.result.continue())},n(t.transaction)}function p(t=s()){return t("readonly",(t=>{if(t.getAllKeys)return n(t.getAllKeys());const e=[];return g(t,(t=>e.push(t.key))).then((()=>e))}))}function y(t=s()){return t("readonly",(t=>{if(t.getAll)return n(t.getAll());const e=[];return g(t,(t=>e.push(t.value))).then((()=>e))}))}function m(t=s()){return t("readonly",(e=>{if(e.getAll&&e.getAllKeys)return Promise.all([n(e.getAllKeys()),n(e.getAll())]).then((([t,e])=>t.map(((t,r)=>[t,e[r]]))));const r=[];return t("readonly",(t=>g(t,(t=>r.push([t.key,t.value]))).then((()=>r))))}))}r.r(e),r.d(e,{clear:()=>b,createStore:()=>o,del:()=>f,delMany:()=>h,entries:()=>m,get:()=>i,getMany:()=>l,keys:()=>p,promisifyRequest:()=>n,set:()=>c,setMany:()=>u,update:()=>d,values:()=>y})}},e={};function r(n){var o=e[n];if(void 0!==o)return o.exports;var a=e[n]={exports:{}};return t[n](a,a.exports,r),a.exports}r.d=(t,e)=>{for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},(()=>{const{get:t,set:e,del:n,entries:o}=r(678),a=r(905),s=r(941),i=r(701),c=[],u={},l=(t,e,r)=>{const{enableJs:n,disableUniqueIds:o,disableCssScoping:l,spriteIconId:d}=e,f=!!d,h=(new DOMParser).parseFromString(r,"text/html"),b=f?h.getElementById(d):h.querySelector("svg"),g=(()=>{if(c.length)return c;for(const t in document.body)t.startsWith("on")&&c.push(t);return c.push("onbegin","onend","onrepeat"),c.push("onfocusin","onfocusout","onbounce","onfinish","onshow"),c})(),p=u[t.getAttribute("data-id")]||new Set,y=t.getAttribute("data-id")||`svg-loader_${i.incr()}`,m={};if(o||Array.from(b.querySelectorAll("[id]")).forEach((t=>{const e=t.getAttribute("id"),r=`${e}_${i.incr()}`;t.setAttribute("id",r),m[e]=r})),Array.from(b.querySelectorAll("*")).concat(b).forEach((e=>{if("script"===e.tagName){if(e.remove(),!n)return;{const r=document.createElement("script");r.appendChild(e.childNodes[0]),t.appendChild(r)}}const r=[];for(let t=0;te.removeAttribute(t))),"style"===e.tagName&&!l){let t=a(e.innerHTML,`[data-id="${y}"]`,m);t=s(m,t),t!==e.innerHTML&&(e.innerHTML=t)}})),t.innerHTML=d?b.outerHTML:b.innerHTML,!f)for(let e=0;e{const o=new URL(r.getAttribute("data-src"),globalThis.location),a=o.toString().replace(o.hash,""),s=o.hash.replace("#",""),i=r.getAttribute("data-cache"),c="enabled"===r.getAttribute("data-js"),u="disabled"===r.getAttribute("data-unique-ids"),b="disabled"===r.getAttribute("data-css-scoping"),g=await(async e=>{let r;try{r=await t(`loader_${e}`)}catch(t){}if(!r)try{r=localStorage.getItem(`loader_${e}`)}catch(t){}if(r)return r=JSON.parse(r),Date.now()h(r)),20);d[a]=!0,fetch(a).then((t=>{if(!t.ok)throw Error(`Request for '${a}' returned ${t.status} (${t.statusText})`);return t.text()})).then((t=>{const r=t.toLowerCase().trim();if(!(r.startsWith("{const o=parseInt(n,10),a=JSON.stringify({data:r,expiry:Date.now()+(Number.isNaN(o)?2592e6:1e3*o)});try{await e(`loader_${t}`,a)}catch(e){try{localStorage.setItem(`loader_${t}`,a)}catch(t){console.warn("Failed to set cache: ",t)}}})(a,t,i),f[a]=t,y(t)})).catch((t=>{console.error(t);const e=new CustomEvent("iconloaderror",{bubbles:!0,detail:t.toString()});r.dispatchEvent(e),r.getAttribute("oniconloaderror")&&Function("error",r.getAttribute("oniconloaderror"))(t)})).finally((()=>{delete d[a]}))}};let b;globalThis.IntersectionObserver&&(b=new IntersectionObserver((t=>{t.forEach((t=>{t.isIntersecting&&(h(t.target),b.unobserve(t.target))}))}),{rootMargin:"1200px"}));const g=[];function p(){Array.from(document.querySelectorAll("svg[data-src]:not([data-id])")).forEach((t=>{-1===g.indexOf(t)&&(g.push(t),"lazy"===t.getAttribute("data-loading")?b.observe(t):h(t))}))}let y=!1;if(globalThis.addEventListener){const m=setInterval((()=>{p()}),100);function v(){clearInterval(m),p(),y||(y=!0,new MutationObserver((t=>{t.some((t=>Array.from(t.addedNodes).some((t=>t.nodeType===Node.ELEMENT_NODE&&(t.getAttribute("data-src")&&!t.getAttribute("data-id")||t.querySelector("svg[data-src]:not([data-id])"))))))&&p(),t.forEach((t=>{"attributes"===t.type&&h(t.target)}))})).observe(document.documentElement,{attributeFilter:["data-src"],attributes:!0,childList:!0,subtree:!0}))}"interactive"===document.readyState?v():globalThis.addEventListener("DOMContentLoaded",(()=>{v()}))}globalThis.SVGLoader={},globalThis.SVGLoader.destroyCache=async()=>{try{const t=await o();for(const e of t)e[0].startsWith("loader_")&&await n(e[0])}catch(t){}Object.keys(localStorage).forEach((t=>{t.startsWith("loader_")&&localStorage.removeItem(t)}))}})()})(); +//# sourceMappingURL=svg-loader.min.js.map \ No newline at end of file