h5p-theme-picker 0.0.8 → 0.0.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(()=>{"use strict";var e={463(e,t,n){n.d(t,{A:()=>a});var r=n(601),i=n.n(r),o=n(314),s=n.n(o)()(i());s.push([e.id,".h5p-theme-picker-color-selector{display:flex;flex-direction:column;gap:1rem;.sp-container.hue .sp-picker-container{height:183px;width:1rem;.sp-top{height:calc(100% - 10px);.sp-top-inner{.sp-color{display:none}.sp-hue{right:auto}}}}.h5p-theme-picker-color-selector-title{color:var(--h5p-theme-picker-color-text);font-weight:700}.h5p-theme-picker-color-selector-grid{align-items:center;display:grid;font-size:.875rem;font-weight:700;gap:1rem;grid-template-columns:auto 1fr;.h5p-theme-picker-color-selector-label{width:fit-content}}&.display-none{display:none}}",""]);const a=s},223(e,t,n){n.d(t,{A:()=>a});var r=n(601),i=n.n(r),o=n(314),s=n.n(o)()(i());s.push([e.id,".h5p-theme-picker-color-picker{.h5p-theme-picker-color-picker-button{aspect-ratio:1;background-color:#fff;border:1px solid var(--h5p-theme-picker-color-stroke);border-radius:2px;cursor:pointer;height:2.5rem;padding:.5rem;.h5p-theme-picker-color-picker-preview{aspect-ratio:1;border:1px solid var(--h5p-theme-picker-color-stroke);border-radius:2px;box-sizing:border-box;height:100%;transition:background-color .2s}}&:hover .h5p-theme-picker-color-picker-button{border-color:var(--h5p-theme-picker-color-stroke-diff10l)}.h5p-theme-picker-color-picker-popover{border:1px solid var(--h5p-theme-picker-color-stroke);inset:auto;left:anchor(left);padding:.5rem;position:absolute;top:anchor(bottom);.h5p-theme-picker-color-picker-slider{appearance:none;-webkit-appearance:none;border-radius:3px;height:1rem;outline:none;&::-webkit-slider-thumb{-webkit-appearance:none;appearance:none;background:#fff;border:1px solid var(--h5p-theme-picker-color-stroke);border-radius:2px;box-shadow:0 0 3px rgba(0,0,0,.2);cursor:pointer;height:1.5rem;width:.75rem}&:focus-visible{&::-webkit-slider-thumb{outline:2px solid #000}}&.hue{background:linear-gradient(90deg,red,#ff0,#0f0,#0ff,#00f,#f0f,red)}&.opacity{background:linear-gradient(90deg,transparent,#000)}}}&.alternative{.h5p-theme-picker-color-picker-button{anchor-name:--color-picker-alternative}.h5p-theme-picker-color-picker-popover{position-anchor:--color-picker-alternative}}.h5p-theme-picker-color-picker-input{cursor:pointer;height:2.5rem;opacity:0;position:absolute;width:2.5rem}}",""]);const a=s},624(e,t,n){n.d(t,{A:()=>a});var r=n(601),i=n.n(r),o=n(314),s=n.n(o)()(i());s.push([e.id,":host{display:block}.h5p-theme-picker{--h5p-theme-spacing-xl-primary-small:calc(var(--h5p-theme-spacing-xl-primary-medium)*0.8);--h5p-theme-spacing-primary-small:calc(var(--h5p-theme-spacing-primary-medium)*0.8);--h5p-theme-spacing-secondary-small:calc(var(--h5p-theme-spacing-secondary-medium)*0.8);--h5p-theme-spacing-third-small:calc(var(--h5p-theme-spacing-third-medium)*0.8);--h5p-theme-spacing-fourth-small:calc(var(--h5p-theme-spacing-fourth-medium)*0.8);--h5p-theme-spacing-fifth-small:calc(var(--h5p-theme-spacing-fifth-medium)*0.8);--h5p-theme-font-size-xxl-small:calc(var(--h5p-theme-font-size-xxl-medium)*1);--h5p-theme-font-size-xl-small:calc(var(--h5p-theme-font-size-xl-medium)*1);--h5p-theme-font-size-l-small:calc(var(--h5p-theme-font-size-l-medium)*1);--h5p-theme-font-size-m-small:calc(var(--h5p-theme-font-size-m-medium)*1);--h5p-theme-font-size-s-small:calc(var(--h5p-theme-font-size-s-medium)*1);--h5p-theme-spacing-xl-primary-medium:calc(var(--h5p-theme-spacing-xl-primary-large)*0.8);--h5p-theme-spacing-primary-medium:calc(var(--h5p-theme-spacing-primary-large)*0.8);--h5p-theme-spacing-secondary-medium:calc(var(--h5p-theme-spacing-secondary-large)*0.8);--h5p-theme-spacing-third-medium:calc(var(--h5p-theme-spacing-third-large)*0.8);--h5p-theme-spacing-fourth-medium:calc(var(--h5p-theme-spacing-fourth-large)*0.8);--h5p-theme-spacing-fifth-medium:calc(var(--h5p-theme-spacing-fifth-large)*0.8);--h5p-theme-font-size-xxl-medium:calc(var(--h5p-theme-font-size-xxl-large)*0.9);--h5p-theme-font-size-xl-medium:calc(var(--h5p-theme-font-size-xl-large)*0.9);--h5p-theme-font-size-l-medium:calc(var(--h5p-theme-font-size-l-large)*0.9);--h5p-theme-font-size-m-medium:calc(var(--h5p-theme-font-size-m-large)*0.9);--h5p-theme-font-size-s-medium:calc(var(--h5p-theme-font-size-s-large)*0.9);--h5p-theme-spacing-xl-primary-large:3rem;--h5p-theme-spacing-primary-large:2rem;--h5p-theme-spacing-secondary-large:1.5rem;--h5p-theme-spacing-third-large:1rem;--h5p-theme-spacing-fourth-large:0.65rem;--h5p-theme-spacing-fifth-large:0.5rem;--h5p-theme-font-size-xxl-large:1.5rem;--h5p-theme-font-size-xl-large:1.25rem;--h5p-theme-font-size-l-large:1.125rem;--h5p-theme-font-size-m-large:1rem;--h5p-theme-font-size-s-large:0.85rem;--h5p-theme-picker-color-background:#fff;--h5p-theme-picker-color-text:#61686b;--h5p-theme-picker-color-stroke:#dfe2ec;--h5p-theme-picker-color-stroke-diff10l:color-mix(in hsl,var(--h5p-theme-picker-color-stroke) 90%,#000);background:var(--h5p-theme-picker-color-background);container-name:theme-picker;container-type:inline-size;display:flex;flex-direction:column;font-family:sans-serif;gap:2rem;padding:.5rem;.h5p-theme-picker-details{display:grid;gap:1rem;&:not(.open){grid-template-columns:1fr}&.open{grid-template-columns:minmax(0,320px) 1fr}}}@container theme-picker (width < 640px){.h5p-theme-picker .h5p-theme-picker-details.open{grid-template-columns:1fr}}",""]);const a=s},220(e,t,n){n.d(t,{A:()=>a});var r=n(601),i=n.n(r),o=n(314),s=n.n(o)()(i());s.push([e.id,'.h5p-theme-picker-preview{container-name:h5p-theme-picker-preview;container-type:inline-size;display:flex;flex-direction:column;gap:.5rem;.h5p-theme-picker-preview-label{color:var(--h5p-theme-picker-color-text);font-size:.875rem;font-weight:700;&:before{content:"\\1f441";margin-right:.5rem}&:after{color:#000;content:attr(data-theme-name);margin-left:.5rem}}.h5p-theme-picker-preview-mockup{--zoom-min:0;--zoom-max:3;--zoom-divider:300px;--zoom-factor:clamp(var(--zoom-min),calc(100cqw/var(--zoom-divider)),var(--zoom-max));border:1px solid var(--h5p-theme-picker-color-stroke);display:flex;flex-direction:column;max-width:calc(var(--zoom-max)*var(--zoom-divider));.h5p-theme-picker-preview-mockup-blank{background-color:var(--h5p-theme-alternative-base);border-radius:var(--h5p-theme-border-radius-small,.25rem);height:calc(var(--zoom-factor)*var(--h5p-theme-font-size-s, .85rem))}.h5p-theme-picker-preview-mockup-bar{position:relative;&:before{background-color:var(--h5p-theme-text-primary);content:"";height:.25rem;left:50%;position:absolute;top:50%;transform:translate(-50%,-50%);width:100%}}.h5p-theme-picker-preview-mockup-main{background-color:var(--h5p-theme-background);display:grid;gap:calc(var(--zoom-factor)*var(--h5p-theme-spacing-s, 1rem));grid-template-columns:40fr 60fr;padding:calc(var(--zoom-factor)*var(--h5p-theme-spacing-s, 1rem));.h5p-theme-picker-preview-mockup-box{background-color:var(--h5p-theme-ui-base);border-radius:var(--h5p-theme-border-radius-small,.25rem);display:grid;flex-direction:column;gap:calc(var(--zoom-factor)*var(--h5p-theme-spacing-xxs, .5rem));padding:calc(var(--zoom-factor)*var(--h5p-theme-spacing-xs, .65rem));&.multi-choice{.h5p-theme-picker-preview-mockup-inner-main{display:flex;flex-direction:column;gap:calc(var(--zoom-factor)*.5*var(--h5p-theme-spacing-xxs, .5rem));.h5p-theme-picker-preview-mockup-bar{margin-bottom:calc(var(--zoom-factor)*var(--h5p-theme-spacing-xxs, .5rem));width:50%}}}&.drag-text{.h5p-theme-picker-preview-mockup-inner-main{border-radius:var(--h5p-theme-border-radius-small,.25rem);display:grid;gap:calc(var(--zoom-factor)*.5*var(--h5p-theme-spacing-xxs, .5rem));grid-template-columns:1fr auto;.h5p-theme-picker-preview-mockup-text-container{background-color:var(--h5p-theme-alternative-light);display:flex;flex-direction:column;gap:calc(var(--zoom-factor)*.25*var(--h5p-theme-spacing-xxs, .5rem));padding:calc(var(--zoom-factor)*var(--h5p-theme-spacing-xxs, .5rem));.h5p-theme-picker-preview-mockup-text-row{display:grid;gap:calc(var(--zoom-factor)*var(--h5p-theme-spacing-xxs, .5rem));&:nth-child(n){grid-template-columns:35fr 65fr}&:nth-child(2n){grid-template-columns:65fr 35fr}.h5p-theme-picker-preview-mockup-blank{background-color:var(--h5p-theme-alternative-dark)}.h5p-theme-picker-preview-mockup-bar{height:calc(var(--zoom-factor)*var(--h5p-theme-font-size-s, .85rem))}}}.h5p-theme-picker-preview-mockup-draggable-container{display:flex;flex-direction:column;gap:calc(var(--zoom-factor)*.5*var(--h5p-theme-spacing-xxs, .5rem))}}}}}.h5p-theme-picker-preview-mockup-footer{background-color:var(--h5p-theme-ui-base);display:flex;flex-direction:row;gap:calc(var(--zoom-factor)*var(--h5p-theme-spacing-s, 1rem));justify-content:space-between;padding:calc(var(--zoom-factor)*var(--h5p-theme-spacing-s, 1rem))}.h5p-theme-picker-preview-mockup-button{aspect-ratio:2;border-radius:var(--h5p-theme-border-radius-medium,.375rem);height:calc(var(--zoom-factor)*var(--h5p-theme-font-size-m, 1rem));position:relative;&:before{content:"";height:.25rem;left:50%;position:absolute;top:50%;transform:translate(-50%,-50%);width:50%}&.main{background-color:var(--h5p-theme-main-cta-base);&:before{background-color:var(--h5p-theme-contrast-cta)}}&.secondary{background-color:var(--h5p-theme-secondary-cta-base);&:before{background-color:var(--h5p-theme-secondary-contrast-cta)}}}.h5p-theme-picker-preview-mockup-draggable{aspect-ratio:2;background-color:var(--h5p-theme-alternative-base);border-radius:var(--h5p-theme-border-radius-medium,.375rem);height:calc(var(--zoom-factor)*var(--h5p-theme-font-size-m, 1rem));position:relative;&:before{align-items:center;background-color:var(--h5p-theme-main-cta-base);border-bottom-left-radius:var(--h5p-theme-border-radius-medium,.375rem);border-top-left-radius:var(--h5p-theme-border-radius-medium,.375rem);color:var(--h5p-theme-contrast-cta);content:"\\283f";display:flex;font-size:var(--h5p-theme-font-size-m);font-weight:700;height:100%;justify-content:center;left:0;transform:translateY(-50%);width:var(--h5p-theme-font-size-m,1rem)}&:after,&:before{position:absolute;top:50%}&:after{background-color:var(--h5p-theme-text-primary);content:"";height:.25rem;left:calc(50% + var(--h5p-theme-font-size-m, 1rem)*.5);transform:translate(-50%,-50%);width:50%}}}}@supports ((-moz-appearance:none) or (not (width:1cqw))){@container h5p-theme-picker-preview (width < 300px){.h5p-theme-picker-preview .h5p-theme-picker-preview-mockup{--zoom-factor:0.5}}@container h5p-theme-picker-preview (width >= 300px){.h5p-theme-picker-preview .h5p-theme-picker-preview-mockup{--zoom-factor:1}}@container h5p-theme-picker-preview (width >= 450px){.h5p-theme-picker-preview .h5p-theme-picker-preview-mockup{--zoom-factor:1.5}}@container h5p-theme-picker-preview (width >= 600px){.h5p-theme-picker-preview .h5p-theme-picker-preview-mockup{--zoom-factor:2}}@container h5p-theme-picker-preview (width >= 750px){.h5p-theme-picker-preview .h5p-theme-picker-preview-mockup{--zoom-factor:2.5}}@container h5p-theme-picker-preview (width >= 900px){.h5p-theme-picker-preview .h5p-theme-picker-preview-mockup{--zoom-factor:3}}}',""]);const a=s},665(e,t,n){n.d(t,{A:()=>a});var r=n(601),i=n.n(r),o=n(314),s=n.n(o)()(i());s.push([e.id,'.h5p-theme-picker-selector-box{align-items:center;display:grid;gap:1rem;grid-template-columns:auto 1fr;width:max-content;.h5p-theme-picker-label{color:var(--h5p-theme-picker-color-text);font-size:.875rem;font-weight:700}.h5p-theme-picker-select{appearance:base-select;background:#fff;background-size:auto;border:1px solid var(--h5p-theme-picker-color-stroke);border-radius:0;box-shadow:inset 0 0 5px 0 rgba(0,0,0,.12);box-sizing:border-box;color:var(--h5p-theme-picker-color-text);cursor:pointer;font-size:.875rem;line-height:normal;max-width:none;min-height:auto;padding:.85rem 1rem;&:active,&:focus,&:hover{border-color:var(--h5p-theme-picker-color-stroke);box-shadow:inset 0 0 5px 0 rgba(0,0,0,.12);color:var(--h5p-theme-picker-color-text)}&::picker(select){appearance:base-select}&::picker-icon{display:none}&:open::picker(select){border:1px solid #d0d0d1;border-top:none;box-shadow:inset 0 0 5px 0 rgba(0,0,0,.12)}option{background-color:var(--background-color,#fff);color:#636b6f;height:3rem;margin:2px;padding:.25rem;transition:box-shadow .1s ease-in-out;white-space:nowrap;&:checked,&:hover{box-shadow:0 0 0 2px #000,inset 0 0 0 2px #000}&::checkmark{display:none}}&.theme{option{font-weight:600;&:after{aspect-ratio:1.5;background-color:var(--color,#000);border-radius:1rem;color:var(--background-color,#fff);content:"\\2013";display:inline-grid;font-weight:700;height:1.25rem;line-height:1;margin-left:auto;place-items:center}}}}}@container theme-picker (width <= 320px){.h5p-theme-picker-selector-box{grid-template-columns:auto}}',""]);const a=s},314(e){e.exports=function(e){var t=[];return t.toString=function(){return this.map(function(t){var n="",r=void 0!==t[5];return t[4]&&(n+="@supports (".concat(t[4],") {")),t[2]&&(n+="@media ".concat(t[2]," {")),r&&(n+="@layer".concat(t[5].length>0?" ".concat(t[5]):""," {")),n+=e(t),r&&(n+="}"),t[2]&&(n+="}"),t[4]&&(n+="}"),n}).join("")},t.i=function(e,n,r,i,o){"string"==typeof e&&(e=[[null,e,void 0]]);var s={};if(r)for(var a=0;a<this.length;a++){var l=this[a][0];null!=l&&(s[l]=!0)}for(var c=0;c<e.length;c++){var h=[].concat(e[c]);r&&s[h[0]]||(void 0!==o&&(void 0===h[5]||(h[1]="@layer".concat(h[5].length>0?" ".concat(h[5]):""," {").concat(h[1],"}")),h[5]=o),n&&(h[2]?(h[1]="@media ".concat(h[2]," {").concat(h[1],"}"),h[2]=n):h[2]=n),i&&(h[4]?(h[1]="@supports (".concat(h[4],") {").concat(h[1],"}"),h[4]=i):h[4]="".concat(i)),t.push(h))}},t}},601(e){e.exports=function(e){return e[1]}},72(e){var t=[];function n(e){for(var n=-1,r=0;r<t.length;r++)if(t[r].identifier===e){n=r;break}return n}function r(e,r){for(var o={},s=[],a=0;a<e.length;a++){var l=e[a],c=r.base?l[0]+r.base:l[0],h=o[c]||0,u="".concat(c," ").concat(h);o[c]=h+1;var p=n(u),d={css:l[1],media:l[2],sourceMap:l[3],supports:l[4],layer:l[5]};if(-1!==p)t[p].references++,t[p].updater(d);else{var m=i(d,r);r.byIndex=a,t.splice(a,0,{identifier:u,updater:m,references:1})}s.push(u)}return s}function i(e,t){var n=t.domAPI(t);n.update(e);return function(t){if(t){if(t.css===e.css&&t.media===e.media&&t.sourceMap===e.sourceMap&&t.supports===e.supports&&t.layer===e.layer)return;n.update(e=t)}else n.remove()}}e.exports=function(e,i){var o=r(e=e||[],i=i||{});return function(e){e=e||[];for(var s=0;s<o.length;s++){var a=n(o[s]);t[a].references--}for(var l=r(e,i),c=0;c<o.length;c++){var h=n(o[c]);0===t[h].references&&(t[h].updater(),t.splice(h,1))}o=l}}},659(e){var t={};e.exports=function(e,n){var r=function(e){if(void 0===t[e]){var n=document.querySelector(e);if(window.HTMLIFrameElement&&n instanceof window.HTMLIFrameElement)try{n=n.contentDocument.head}catch(e){n=null}t[e]=n}return t[e]}(e);if(!r)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");r.appendChild(n)}},540(e){e.exports=function(e){var t=document.createElement("style");return e.setAttributes(t,e.attributes),e.insert(t,e.options),t}},56(e,t,n){e.exports=function(e){var t=n.nc;t&&e.setAttribute("nonce",t)}},825(e){e.exports=function(e){if("undefined"==typeof document)return{update:function(){},remove:function(){}};var t=e.insertStyleElement(e);return{update:function(n){!function(e,t,n){var r="";n.supports&&(r+="@supports (".concat(n.supports,") {")),n.media&&(r+="@media ".concat(n.media," {"));var i=void 0!==n.layer;i&&(r+="@layer".concat(n.layer.length>0?" ".concat(n.layer):""," {")),r+=n.css,i&&(r+="}"),n.media&&(r+="}"),n.supports&&(r+="}");var o=n.sourceMap;o&&"undefined"!=typeof btoa&&(r+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(o))))," */")),t.styleTagTransform(r,e,t.options)}(t,e,n)},remove:function(){!function(e){if(null===e.parentNode)return!1;e.parentNode.removeChild(e)}(t)}}}},113(e){e.exports=function(e,t){if(t.styleSheet)t.styleSheet.cssText=e;else{for(;t.firstChild;)t.removeChild(t.firstChild);t.appendChild(document.createTextNode(e))}}}},t={};function n(r){var i=t[r];if(void 0!==i)return i.exports;var o=t[r]={id:r,exports:{}};return e[r](o,o.exports,n),o.exports}n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.nc=void 0;var r=n(72),i=n.n(r),o=n(825),s=n.n(o),a=n(659),l=n.n(a),c=n(56),h=n.n(c),u=n(540),p=n.n(u),d=n(113),m=n.n(d),f=n(624),g={};g.styleTagTransform=m(),g.setAttributes=h(),g.insert=l().bind(null,"head"),g.domAPI=s(),g.insertStyleElement=p();i()(f.A,g);f.A&&f.A.locals&&f.A.locals;const b={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]};for(const e in b)Object.freeze(b[e]);const k=Object.freeze(b),y=Object.create(null);for(const e in k)Object.hasOwn(k,e)&&(y[k[e]]=e);const v={to:{},get:{}};function S(e,t,n){return Math.min(Math.max(t,e),n)}function w(e){const t=Math.round(e).toString(16).toUpperCase();return t.length<2?"0"+t:t}v.get=function(e){let t,n;switch(e.slice(0,3).toLowerCase()){case"hsl":t=v.get.hsl(e),n="hsl";break;case"hwb":t=v.get.hwb(e),n="hwb";break;default:t=v.get.rgb(e),n="rgb"}return t?{model:n,value:t}:null},v.get.rgb=function(e){if(!e)return null;let t,n,r,i=[0,0,0,1];if(t=e.match(/^#([a-f\d]{6})([a-f\d]{2})?$/i)){for(r=t[2],t=t[1],n=0;n<3;n++){const e=2*n;i[n]=Number.parseInt(t.slice(e,e+2),16)}r&&(i[3]=Number.parseInt(r,16)/255)}else if(t=e.match(/^#([a-f\d]{3,4})$/i)){for(t=t[1],r=t[3],n=0;n<3;n++)i[n]=Number.parseInt(t[n]+t[n],16);r&&(i[3]=Number.parseInt(r+r,16)/255)}else if(t=e.match(/^rgba?\(\s*([+-]?(?:\d*\.)?\d+(?:e\d+)?)(?=[\s,])\s*(?:,\s*)?([+-]?(?:\d*\.)?\d+(?:e\d+)?)(?=[\s,])\s*(?:,\s*)?([+-]?(?:\d*\.)?\d+(?:e\d+)?)\s*(?:[\s,|/]\s*([+-]?(?:\d*\.)?\d+(?:e\d+)?)(%?)\s*)?\)$/i)){for(n=0;n<3;n++)i[n]=Number.parseFloat(t[n+1]);t[4]&&(i[3]=t[5]?.01*Number.parseFloat(t[4]):Number.parseFloat(t[4]))}else{if(!(t=e.match(/^rgba?\(\s*([+-]?[\d.]+)%\s*,?\s*([+-]?[\d.]+)%\s*,?\s*([+-]?[\d.]+)%\s*(?:[\s,|/]\s*([+-]?[\d.]+)(%?)\s*)?\)$/i)))return(t=e.toLowerCase().match(/^(\w+)$/))?"transparent"===t[1]?[0,0,0,0]:Object.hasOwn(k,t[1])?(i=k[t[1]].slice(),i[3]=1,i):null:null;for(n=0;n<3;n++)i[n]=Math.round(2.55*Number.parseFloat(t[n+1]));t[4]&&(i[3]=t[5]?.01*Number.parseFloat(t[4]):Number.parseFloat(t[4]))}for(n=0;n<3;n++)i[n]=S(i[n],0,255);return i[3]=S(i[3],0,1),i},v.get.hsl=function(e){if(!e)return null;const t=e.match(/^hsla?\(\s*([+-]?(?:\d{0,3}\.)?\d+)(?:deg)?\s*,?\s*([+-]?[\d.]+)%\s*,?\s*([+-]?[\d.]+)%\s*(?:[,|/]\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:e[+-]?\d+)?)\s*)?\)$/i);if(t){const e=Number.parseFloat(t[4]);return[(Number.parseFloat(t[1])%360+360)%360,S(Number.parseFloat(t[2]),0,100),S(Number.parseFloat(t[3]),0,100),S(Number.isNaN(e)?1:e,0,1)]}return null},v.get.hwb=function(e){if(!e)return null;const t=e.match(/^hwb\(\s*([+-]?\d{0,3}(?:\.\d+)?)(?:deg)?\s*[\s,]\s*([+-]?[\d.]+)%\s*[\s,]\s*([+-]?[\d.]+)%\s*(?:[\s,]\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:e[+-]?\d+)?)\s*)?\)$/i);if(t){const e=Number.parseFloat(t[4]);return[(Number.parseFloat(t[1])%360+360)%360,S(Number.parseFloat(t[2]),0,100),S(Number.parseFloat(t[3]),0,100),S(Number.isNaN(e)?1:e,0,1)]}return null},v.to.hex=function(...e){return"#"+w(e[0])+w(e[1])+w(e[2])+(e[3]<1?w(Math.round(255*e[3])):"")},v.to.rgb=function(...e){return e.length<4||1===e[3]?"rgb("+Math.round(e[0])+", "+Math.round(e[1])+", "+Math.round(e[2])+")":"rgba("+Math.round(e[0])+", "+Math.round(e[1])+", "+Math.round(e[2])+", "+e[3]+")"},v.to.rgb.percent=function(...e){const t=Math.round(e[0]/255*100),n=Math.round(e[1]/255*100),r=Math.round(e[2]/255*100);return e.length<4||1===e[3]?"rgb("+t+"%, "+n+"%, "+r+"%)":"rgba("+t+"%, "+n+"%, "+r+"%, "+e[3]+")"},v.to.hsl=function(...e){return e.length<4||1===e[3]?"hsl("+e[0]+", "+e[1]+"%, "+e[2]+"%)":"hsla("+e[0]+", "+e[1]+"%, "+e[2]+"%, "+e[3]+")"},v.to.hwb=function(...e){let t="";return e.length>=4&&1!==e[3]&&(t=", "+e[3]),"hwb("+e[0]+", "+e[1]+"%, "+e[2]+"%"+t+")"},v.to.keyword=function(...e){return y[e.slice(0,3)]};const x=v,C={};for(const e of Object.keys(k))C[k[e]]=e;const A={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"},hsv:{channels:3,labels:"hsv"},hwb:{channels:3,labels:"hwb"},cmyk:{channels:4,labels:"cmyk"},xyz:{channels:3,labels:"xyz"},lab:{channels:3,labels:"lab"},oklab:{channels:3,labels:["okl","oka","okb"]},lch:{channels:3,labels:"lch"},oklch:{channels:3,labels:["okl","okc","okh"]},hex:{channels:1,labels:["hex"]},keyword:{channels:1,labels:["keyword"]},ansi16:{channels:1,labels:["ansi16"]},ansi256:{channels:1,labels:["ansi256"]},hcg:{channels:3,labels:["h","c","g"]},apple:{channels:3,labels:["r16","g16","b16"]},gray:{channels:1,labels:["gray"]}},_=A,T=(6/29)**3;function L(e){const t=e>.0031308?1.055*e**(1/2.4)-.055:12.92*e;return Math.min(Math.max(0,t),1)}function E(e){return e>.04045?((e+.055)/1.055)**2.4:e/12.92}for(const e of Object.keys(A)){if(!("channels"in A[e]))throw new Error("missing channels property: "+e);if(!("labels"in A[e]))throw new Error("missing channel labels property: "+e);if(A[e].labels.length!==A[e].channels)throw new Error("channel and label counts mismatch: "+e);const{channels:t,labels:n}=A[e];delete A[e].channels,delete A[e].labels,Object.defineProperty(A[e],"channels",{value:t}),Object.defineProperty(A[e],"labels",{value:n})}function O(e,t){return(e[0]-t[0])**2+(e[1]-t[1])**2+(e[2]-t[2])**2}function P(e){const t=function(){const e={},t=Object.keys(_);for(let{length:n}=t,r=0;r<n;r++)e[t[r]]={distance:-1,parent:null};return e}(),n=[e];for(t[e].distance=0;n.length>0;){const e=n.pop(),r=Object.keys(_[e]);for(let{length:i}=r,o=0;o<i;o++){const i=r[o],s=t[i];-1===s.distance&&(s.distance=t[e].distance+1,s.parent=e,n.unshift(i))}}return t}function D(e,t){return function(n){return t(e(n))}}function F(e,t){const n=[t[e].parent,e];let r=_[t[e].parent][e],i=t[e].parent;for(;t[i].parent;)n.unshift(t[i].parent),r=D(_[t[i].parent][i],r),i=t[i].parent;return r.conversion=n,r}A.rgb.hsl=function(e){const t=e[0]/255,n=e[1]/255,r=e[2]/255,i=Math.min(t,n,r),o=Math.max(t,n,r),s=o-i;let a,l;switch(o){case i:a=0;break;case t:a=(n-r)/s;break;case n:a=2+(r-t)/s;break;case r:a=4+(t-n)/s}a=Math.min(60*a,360),a<0&&(a+=360);const c=(i+o)/2;return l=o===i?0:c<=.5?s/(o+i):s/(2-o-i),[a,100*l,100*c]},A.rgb.hsv=function(e){let t,n,r,i,o;const s=e[0]/255,a=e[1]/255,l=e[2]/255,c=Math.max(s,a,l),h=c-Math.min(s,a,l),u=function(e){return(c-e)/6/h+.5};if(0===h)i=0,o=0;else{switch(o=h/c,t=u(s),n=u(a),r=u(l),c){case s:i=r-n;break;case a:i=1/3+t-r;break;case l:i=2/3+n-t}i<0?i+=1:i>1&&(i-=1)}return[360*i,100*o,100*c]},A.rgb.hwb=function(e){const t=e[0],n=e[1];let r=e[2];const i=A.rgb.hsl(e)[0],o=1/255*Math.min(t,Math.min(n,r));return r=1-1/255*Math.max(t,Math.max(n,r)),[i,100*o,100*r]},A.rgb.oklab=function(e){const t=E(e[0]/255),n=E(e[1]/255),r=E(e[2]/255),i=Math.cbrt(.4122214708*t+.5363325363*n+.0514459929*r),o=Math.cbrt(.2119034982*t+.6806995451*n+.1073969566*r),s=Math.cbrt(.0883024619*t+.2817188376*n+.6299787005*r);return[100*(.2104542553*i+.793617785*o-.0040720468*s),100*(1.9779984951*i-2.428592205*o+.4505937099*s),100*(.0259040371*i+.7827717662*o-.808675766*s)]},A.rgb.cmyk=function(e){const t=e[0]/255,n=e[1]/255,r=e[2]/255,i=Math.min(1-t,1-n,1-r);return[100*((1-t-i)/(1-i)||0),100*((1-n-i)/(1-i)||0),100*((1-r-i)/(1-i)||0),100*i]},A.rgb.keyword=function(e){const t=C[e];if(t)return t;let n,r=Number.POSITIVE_INFINITY;for(const t of Object.keys(k)){const i=O(e,k[t]);i<r&&(r=i,n=t)}return n},A.keyword.rgb=function(e){return[...k[e]]},A.rgb.xyz=function(e){const t=E(e[0]/255),n=E(e[1]/255),r=E(e[2]/255);return[100*(.4124564*t+.3575761*n+.1804375*r),100*(.2126729*t+.7151522*n+.072175*r),100*(.0193339*t+.119192*n+.9503041*r)]},A.rgb.lab=function(e){const t=A.rgb.xyz(e);let n=t[0],r=t[1],i=t[2];n/=95.047,r/=100,i/=108.883,n=n>T?n**(1/3):7.787*n+16/116,r=r>T?r**(1/3):7.787*r+16/116,i=i>T?i**(1/3):7.787*i+16/116;return[116*r-16,500*(n-r),200*(r-i)]},A.hsl.rgb=function(e){const t=e[0]/360,n=e[1]/100,r=e[2]/100;let i,o;if(0===n)return o=255*r,[o,o,o];const s=r<.5?r*(1+n):r+n-r*n,a=2*r-s,l=[0,0,0];for(let e=0;e<3;e++)i=t+1/3*-(e-1),i<0&&i++,i>1&&i--,o=6*i<1?a+6*(s-a)*i:2*i<1?s:3*i<2?a+(s-a)*(2/3-i)*6:a,l[e]=255*o;return l},A.hsl.hsv=function(e){const t=e[0];let n=e[1]/100,r=e[2]/100,i=n;const o=Math.max(r,.01);r*=2,n*=r<=1?r:2-r,i*=o<=1?o:2-o;return[t,100*(0===r?2*i/(o+i):2*n/(r+n)),100*((r+n)/2)]},A.hsv.rgb=function(e){const t=e[0]/60,n=e[1]/100;let r=e[2]/100;const i=Math.floor(t)%6,o=t-Math.floor(t),s=255*r*(1-n),a=255*r*(1-n*o),l=255*r*(1-n*(1-o));switch(r*=255,i){case 0:return[r,l,s];case 1:return[a,r,s];case 2:return[s,r,l];case 3:return[s,a,r];case 4:return[l,s,r];case 5:return[r,s,a]}},A.hsv.hsl=function(e){const t=e[0],n=e[1]/100,r=e[2]/100,i=Math.max(r,.01);let o,s;s=(2-n)*r;const a=(2-n)*i;return o=n*i,o/=a<=1?a:2-a,o=o||0,s/=2,[t,100*o,100*s]},A.hwb.rgb=function(e){const t=e[0]/360;let n=e[1]/100,r=e[2]/100;const i=n+r;let o;i>1&&(n/=i,r/=i);const s=Math.floor(6*t),a=1-r;o=6*t-s,1&s&&(o=1-o);const l=n+o*(a-n);let c,h,u;switch(s){default:case 6:case 0:c=a,h=l,u=n;break;case 1:c=l,h=a,u=n;break;case 2:c=n,h=a,u=l;break;case 3:c=n,h=l,u=a;break;case 4:c=l,h=n,u=a;break;case 5:c=a,h=n,u=l}return[255*c,255*h,255*u]},A.cmyk.rgb=function(e){const t=e[0]/100,n=e[1]/100,r=e[2]/100,i=e[3]/100;return[255*(1-Math.min(1,t*(1-i)+i)),255*(1-Math.min(1,n*(1-i)+i)),255*(1-Math.min(1,r*(1-i)+i))]},A.xyz.rgb=function(e){const t=e[0]/100,n=e[1]/100,r=e[2]/100;let i,o,s;return i=3.2404542*t+-1.5371385*n+-.4985314*r,o=-.969266*t+1.8760108*n+.041556*r,s=.0556434*t+-.2040259*n+1.0572252*r,i=L(i),o=L(o),s=L(s),[255*i,255*o,255*s]},A.xyz.lab=function(e){let t=e[0],n=e[1],r=e[2];t/=95.047,n/=100,r/=108.883,t=t>T?t**(1/3):7.787*t+16/116,n=n>T?n**(1/3):7.787*n+16/116,r=r>T?r**(1/3):7.787*r+16/116;return[116*n-16,500*(t-n),200*(n-r)]},A.xyz.oklab=function(e){const t=e[0]/100,n=e[1]/100,r=e[2]/100,i=Math.cbrt(.8189330101*t+.3618667424*n-.1288597137*r),o=Math.cbrt(.0329845436*t+.9293118715*n+.0361456387*r),s=Math.cbrt(.0482003018*t+.2643662691*n+.633851707*r);return[100*(.2104542553*i+.793617785*o-.0040720468*s),100*(1.9779984951*i-2.428592205*o+.4505937099*s),100*(.0259040371*i+.7827717662*o-.808675766*s)]},A.oklab.oklch=function(e){return A.lab.lch(e)},A.oklab.xyz=function(e){const t=e[0]/100,n=e[1]/100,r=e[2]/100,i=(.999999998*t+.396337792*n+.215803758*r)**3,o=(1.000000008*t-.105561342*n-.063854175*r)**3,s=(1.000000055*t-.089484182*n-1.291485538*r)**3;return[100*(1.227013851*i-.55779998*o+.281256149*s),100*(-.040580178*i+1.11225687*o-.071676679*s),100*(-.076381285*i-.421481978*o+1.58616322*s)]},A.oklab.rgb=function(e){const t=e[0]/100,n=e[1]/100,r=e[2]/100,i=(t+.3963377774*n+.2158037573*r)**3,o=(t-.1055613458*n-.0638541728*r)**3,s=(t-.0894841775*n-1.291485548*r)**3;return[255*L(4.0767416621*i-3.3077115913*o+.2309699292*s),255*L(-1.2684380046*i+2.6097574011*o-.3413193965*s),255*L(-.0041960863*i-.7034186147*o+1.707614701*s)]},A.oklch.oklab=function(e){return A.lch.lab(e)},A.lab.xyz=function(e){let t,n,r;n=(e[0]+16)/116,t=e[1]/500+n,r=n-e[2]/200;const i=n**3,o=t**3,s=r**3;return n=i>T?i:(n-16/116)/7.787,t=o>T?o:(t-16/116)/7.787,r=s>T?s:(r-16/116)/7.787,t*=95.047,n*=100,r*=108.883,[t,n,r]},A.lab.lch=function(e){const t=e[0],n=e[1],r=e[2];let i;i=360*Math.atan2(r,n)/2/Math.PI,i<0&&(i+=360);return[t,Math.sqrt(n*n+r*r),i]},A.lch.lab=function(e){const t=e[0],n=e[1],r=e[2]/360*2*Math.PI;return[t,n*Math.cos(r),n*Math.sin(r)]},A.rgb.ansi16=function(e,t=null){const[n,r,i]=e;let o=null===t?A.rgb.hsv(e)[2]:t;if(o=Math.round(o/50),0===o)return 30;let s=30+(Math.round(i/255)<<2|Math.round(r/255)<<1|Math.round(n/255));return 2===o&&(s+=60),s},A.hsv.ansi16=function(e){return A.rgb.ansi16(A.hsv.rgb(e),e[2])},A.rgb.ansi256=function(e){const t=e[0],n=e[1],r=e[2];if(t>>4==n>>4&&n>>4==r>>4)return t<8?16:t>248?231:Math.round((t-8)/247*24)+232;return 16+36*Math.round(t/255*5)+6*Math.round(n/255*5)+Math.round(r/255*5)},A.ansi16.rgb=function(e){let t=(e=e[0])%10;if(0===t||7===t)return e>50&&(t+=3.5),t=t/10.5*255,[t,t,t];const n=.5*(Math.trunc(e>50)+1);return[(1&t)*n*255,(t>>1&1)*n*255,(t>>2&1)*n*255]},A.ansi256.rgb=function(e){if((e=e[0])>=232){const t=10*(e-232)+8;return[t,t,t]}let t;e-=16;return[Math.floor(e/36)/5*255,Math.floor((t=e%36)/6)/5*255,t%6/5*255]},A.rgb.hex=function(e){const t=(((255&Math.round(e[0]))<<16)+((255&Math.round(e[1]))<<8)+(255&Math.round(e[2]))).toString(16).toUpperCase();return"000000".slice(t.length)+t},A.hex.rgb=function(e){const t=e.toString(16).match(/[a-f\d]{6}|[a-f\d]{3}/i);if(!t)return[0,0,0];let n=t[0];3===t[0].length&&(n=[...n].map(e=>e+e).join(""));const r=Number.parseInt(n,16);return[r>>16&255,r>>8&255,255&r]},A.rgb.hcg=function(e){const t=e[0]/255,n=e[1]/255,r=e[2]/255,i=Math.max(Math.max(t,n),r),o=Math.min(Math.min(t,n),r),s=i-o;let a;return a=s<=0?0:i===t?(n-r)/s%6:i===n?2+(r-t)/s:4+(t-n)/s,a/=6,a%=1,[360*a,100*s,100*(s<1?o/(1-s):0)]},A.hsl.hcg=function(e){const t=e[1]/100,n=e[2]/100,r=n<.5?2*t*n:2*t*(1-n);let i=0;return r<1&&(i=(n-.5*r)/(1-r)),[e[0],100*r,100*i]},A.hsv.hcg=function(e){const t=e[1]/100,n=e[2]/100,r=t*n;let i=0;return r<1&&(i=(n-r)/(1-r)),[e[0],100*r,100*i]},A.hcg.rgb=function(e){const t=e[0]/360,n=e[1]/100,r=e[2]/100;if(0===n)return[255*r,255*r,255*r];const i=[0,0,0],o=t%1*6,s=o%1,a=1-s;let l=0;switch(Math.floor(o)){case 0:i[0]=1,i[1]=s,i[2]=0;break;case 1:i[0]=a,i[1]=1,i[2]=0;break;case 2:i[0]=0,i[1]=1,i[2]=s;break;case 3:i[0]=0,i[1]=a,i[2]=1;break;case 4:i[0]=s,i[1]=0,i[2]=1;break;default:i[0]=1,i[1]=0,i[2]=a}return l=(1-n)*r,[255*(n*i[0]+l),255*(n*i[1]+l),255*(n*i[2]+l)]},A.hcg.hsv=function(e){const t=e[1]/100,n=t+e[2]/100*(1-t);let r=0;return n>0&&(r=t/n),[e[0],100*r,100*n]},A.hcg.hsl=function(e){const t=e[1]/100,n=e[2]/100*(1-t)+.5*t;let r=0;return n>0&&n<.5?r=t/(2*n):n>=.5&&n<1&&(r=t/(2*(1-n))),[e[0],100*r,100*n]},A.hcg.hwb=function(e){const t=e[1]/100,n=t+e[2]/100*(1-t);return[e[0],100*(n-t),100*(1-n)]},A.hwb.hcg=function(e){const t=e[1]/100,n=1-e[2]/100,r=n-t;let i=0;return r<1&&(i=(n-r)/(1-r)),[e[0],100*r,100*i]},A.apple.rgb=function(e){return[e[0]/65535*255,e[1]/65535*255,e[2]/65535*255]},A.rgb.apple=function(e){return[e[0]/255*65535,e[1]/255*65535,e[2]/255*65535]},A.gray.rgb=function(e){return[e[0]/100*255,e[0]/100*255,e[0]/100*255]},A.gray.hsl=function(e){return[0,0,e[0]]},A.gray.hsv=A.gray.hsl,A.gray.hwb=function(e){return[0,100,e[0]]},A.gray.cmyk=function(e){return[0,0,0,e[0]]},A.gray.lab=function(e){return[e[0],0,0]},A.gray.hex=function(e){const t=255&Math.round(e[0]/100*255),n=((t<<16)+(t<<8)+t).toString(16).toUpperCase();return"000000".slice(n.length)+n},A.rgb.gray=function(e){return[(e[0]+e[1]+e[2])/3/255*100]};const M=function(e){const t=P(e),n={},r=Object.keys(t);for(let{length:e}=r,i=0;i<e;i++){const e=r[i];null!==t[e].parent&&(n[e]=F(e,t))}return n},z={},j=Object.keys(_);function I(e){const t=function(...t){const n=t[0];return null==n?n:(n.length>1&&(t=n),e(t))};return"conversion"in e&&(t.conversion=e.conversion),t}function N(e){const t=function(...t){const n=t[0];if(null==n)return n;n.length>1&&(t=n);const r=e(t);if("object"==typeof r)for(let{length:e}=r,t=0;t<e;t++)r[t]=Math.round(r[t]);return r};return"conversion"in e&&(t.conversion=e.conversion),t}for(const e of j){z[e]={},Object.defineProperty(z[e],"channels",{value:_[e].channels}),Object.defineProperty(z[e],"labels",{value:_[e].labels});const t=M(e),n=Object.keys(t);for(const r of n){const n=t[r];z[e][r]=N(n),z[e][r].raw=I(n)}}const R=z,B=["keyword","gray","hex"],$={};for(const e of Object.keys(R))$[[...R[e].labels].sort().join("")]=e;const U={};function W(e,t){if(!(this instanceof W))return new W(e,t);if(t&&t in B&&(t=null),t&&!(t in R))throw new Error("Unknown model: "+t);let n,r;if(null==e)this.model="rgb",this.color=[0,0,0],this.valpha=1;else if(e instanceof W)this.model=e.model,this.color=[...e.color],this.valpha=e.valpha;else if("string"==typeof e){const t=x.get(e);if(null===t)throw new Error("Unable to parse color from string: "+e);this.model=t.model,r=R[this.model].channels,this.color=t.value.slice(0,r),this.valpha="number"==typeof t.value[r]?t.value[r]:1}else if(e.length>0){this.model=t||"rgb",r=R[this.model].channels;const n=Array.prototype.slice.call(e,0,r);this.color=Q(n,r),this.valpha="number"==typeof e[r]?e[r]:1}else if("number"==typeof e)this.model="rgb",this.color=[e>>16&255,e>>8&255,255&e],this.valpha=1;else{this.valpha=1;const t=Object.keys(e);"alpha"in e&&(t.splice(t.indexOf("alpha"),1),this.valpha="number"==typeof e.alpha?e.alpha:0);const r=t.sort().join("");if(!(r in $))throw new Error("Unable to parse color from object: "+JSON.stringify(e));this.model=$[r];const{labels:i}=R[this.model],o=[];for(n=0;n<i.length;n++)o.push(e[i[n]]);this.color=Q(o)}if(U[this.model])for(r=R[this.model].channels,n=0;n<r;n++){const e=U[this.model][n];e&&(this.color[n]=e(this.color[n]))}this.valpha=Math.max(0,Math.min(1,this.valpha)),Object.freeze&&Object.freeze(this)}W.prototype={toString(){return this.string()},toJSON(){return this[this.model]()},string(e){let t=this.model in x.to?this:this.rgb();t=t.round("number"==typeof e?e:1);const n=1===t.valpha?t.color:[...t.color,this.valpha];return x.to[t.model](...n)},percentString(e){const t=this.rgb().round("number"==typeof e?e:1),n=1===t.valpha?t.color:[...t.color,this.valpha];return x.to.rgb.percent(...n)},array(){return 1===this.valpha?[...this.color]:[...this.color,this.valpha]},object(){const e={},{channels:t}=R[this.model],{labels:n}=R[this.model];for(let r=0;r<t;r++)e[n[r]]=this.color[r];return 1!==this.valpha&&(e.alpha=this.valpha),e},unitArray(){const e=this.rgb().color;return e[0]/=255,e[1]/=255,e[2]/=255,1!==this.valpha&&e.push(this.valpha),e},unitObject(){const e=this.rgb().object();return e.r/=255,e.g/=255,e.b/=255,1!==this.valpha&&(e.alpha=this.valpha),e},round(e){return e=Math.max(e||0,0),new W([...this.color.map(V(e)),this.valpha],this.model)},alpha(e){return void 0!==e?new W([...this.color,Math.max(0,Math.min(1,e))],this.model):this.valpha},red:H("rgb",0,q(255)),green:H("rgb",1,q(255)),blue:H("rgb",2,q(255)),hue:H(["hsl","hsv","hsl","hwb","hcg"],0,e=>(e%360+360)%360),saturationl:H("hsl",1,q(100)),lightness:H("hsl",2,q(100)),saturationv:H("hsv",1,q(100)),value:H("hsv",2,q(100)),chroma:H("hcg",1,q(100)),gray:H("hcg",2,q(100)),white:H("hwb",1,q(100)),wblack:H("hwb",2,q(100)),cyan:H("cmyk",0,q(100)),magenta:H("cmyk",1,q(100)),yellow:H("cmyk",2,q(100)),black:H("cmyk",3,q(100)),x:H("xyz",0,q(95.047)),y:H("xyz",1,q(100)),z:H("xyz",2,q(108.833)),l:H("lab",0,q(100)),a:H("lab",1),b:H("lab",2),keyword(e){return void 0!==e?new W(e):R[this.model].keyword(this.color)},hex(e){return void 0!==e?new W(e):x.to.hex(...this.rgb().round().color)},hexa(e){if(void 0!==e)return new W(e);const t=this.rgb().round().color;let n=Math.round(255*this.valpha).toString(16).toUpperCase();return 1===n.length&&(n="0"+n),x.to.hex(...t)+n},rgbNumber(){const e=this.rgb().color;return(255&e[0])<<16|(255&e[1])<<8|255&e[2]},luminosity(){const e=this.rgb().color,t=[];for(const[n,r]of e.entries()){const e=r/255;t[n]=e<=.04045?e/12.92:((e+.055)/1.055)**2.4}return.2126*t[0]+.7152*t[1]+.0722*t[2]},contrast(e){const t=this.luminosity(),n=e.luminosity();return t>n?(t+.05)/(n+.05):(n+.05)/(t+.05)},level(e){const t=this.contrast(e);return t>=7?"AAA":t>=4.5?"AA":""},isDark(){const e=this.rgb().color;return(2126*e[0]+7152*e[1]+722*e[2])/1e4<128},isLight(){return!this.isDark()},negate(){const e=this.rgb();for(let t=0;t<3;t++)e.color[t]=255-e.color[t];return e},lighten(e){const t=this.hsl();return t.color[2]+=t.color[2]*e,t},darken(e){const t=this.hsl();return t.color[2]-=t.color[2]*e,t},saturate(e){const t=this.hsl();return t.color[1]+=t.color[1]*e,t},desaturate(e){const t=this.hsl();return t.color[1]-=t.color[1]*e,t},whiten(e){const t=this.hwb();return t.color[1]+=t.color[1]*e,t},blacken(e){const t=this.hwb();return t.color[2]+=t.color[2]*e,t},grayscale(){const e=this.rgb().color,t=.3*e[0]+.59*e[1]+.11*e[2];return W.rgb(t,t,t)},fade(e){return this.alpha(this.valpha-this.valpha*e)},opaquer(e){return this.alpha(this.valpha+this.valpha*e)},rotate(e){const t=this.hsl();let n=t.color[0];return n=(n+e)%360,n=n<0?360+n:n,t.color[0]=n,t},mix(e,t){if(!e||!e.rgb)throw new Error('Argument to "mix" was not a Color instance, but rather an instance of '+typeof e);const n=e.rgb(),r=this.rgb(),i=void 0===t?.5:t,o=2*i-1,s=n.alpha()-r.alpha(),a=((o*s===-1?o:(o+s)/(1+o*s))+1)/2,l=1-a;return W.rgb(a*n.red()+l*r.red(),a*n.green()+l*r.green(),a*n.blue()+l*r.blue(),n.alpha()*i+r.alpha()*(1-i))}};for(const e of Object.keys(R)){if(B.includes(e))continue;const{channels:t}=R[e];W.prototype[e]=function(...t){return this.model===e?new W(this):t.length>0?new W(t,e):new W([...(n=R[this.model][e].raw(this.color),Array.isArray(n)?n:[n]),this.valpha],e);var n},W[e]=function(...n){let r=n[0];return"number"==typeof r&&(r=Q(n,t)),new W(r,e)}}function V(e){return function(t){return function(e,t){return Number(e.toFixed(t))}(t,e)}}function H(e,t,n){e=Array.isArray(e)?e:[e];for(const r of e)(U[r]||=[])[t]=n;return e=e[0],function(r){let i;return void 0!==r?(n&&(r=n(r)),i=this[e](),i.color[t]=r,i):(i=this[e]().color[t],n&&(i=n(i)),i)}}function q(e){return function(t){return Math.max(0,Math.min(e,t))}}function Q(e,t){for(let n=0;n<t;n++)"number"!=typeof e[n]&&(e[n]=0);return e}const G=W,K=["--h5p-theme-main-cta-base","--h5p-theme-main-cta-light","--h5p-theme-main-cta-dark","--h5p-theme-contrast-cta","--h5p-theme-contrast-cta-light","--h5p-theme-contrast-cta-white","--h5p-theme-contrast-cta-dark","--h5p-theme-secondary-cta-base","--h5p-theme-secondary-cta-light","--h5p-theme-secondary-cta-dark","--h5p-theme-secondary-contrast-cta","--h5p-theme-secondary-contrast-cta-hover","--h5p-theme-background","--h5p-theme-alternative-base","--h5p-theme-alternative-light","--h5p-theme-alternative-dark","--h5p-theme-alternative-darker"],Y={"--h5p-theme-stroke-1":"#101729","--h5p-theme-stroke-2":"#354054","--h5p-theme-stroke-3":"#737373","--h5p-theme-ui-base":"#ffffff","--h5p-theme-text-primary":"#101729","--h5p-theme-text-secondary":"#354054","--h5p-theme-text-third":"#737373","--h5p-theme-feedback-correct-main":"#256D1D","--h5p-theme-feedback-correct-secondary":"#f3fcf0","--h5p-theme-feedback-correct-third":"#cff1c2","--h5p-theme-feedback-incorrect-main":"#a13236","--h5p-theme-feedback-incorrect-secondary":"#faf0f4","--h5p-theme-feedback-incorrect-third":"#f6dce7","--h5p-theme-feedback-neutral-main":"#E6C81D","--h5p-theme-feedback-neutral-secondary":"#5E4817","--h5p-theme-feedback-neutral-third":"#F0EBCB"},J=(e,t,n,r,i)=>{let o=1e3,s=e,a=Number.POSITIVE_INFINITY,l=s.contrast(t);for(;o>0;){const e=s.lightness()+i*r;if(e<0||e>100)break;const l=Math.max(0,Math.min(e,100));if(s=s.lightness(l),a=Math.abs(s.contrast(t)-n),a<.01)break;o--}return l=s.contrast(t),{color:s,contrast:l}},X=(e,t)=>{t=(t%360+360)%360;return G(e).hue(t).hex()},Z=(e,t)=>{const n=G(e);return n.lightness(n.lightness()*t).hex()},ee=(e,t=90,n="#ffffff")=>{const r=(1-Math.max(0,Math.min(100,t))/100)*G(e).alpha(),i=G(e).rgb().array().map(e=>e/255),o=G(n).rgb().array().map(e=>e/255),s=[0,1,2].map(e=>{const t=te(i[e]),n=te(o[e]),s=t*r+n*(1-r);return Math.round(255*Math.max(0,Math.min(1,(a=s)<=.0031308?12.92*a:1.055*a**(1/2.4)-.055)));var a});return G.rgb(s[0],s[1],s[2]).hex()},te=e=>e<=.04045?e/12.92:((e+.055)/1.055)**2.4,ne=(e,t,n={})=>{const r=n.targetContrast??4.6,i=n.lightenOnly??!1,o=n.lightnessAdjustmentStep||.1,s=G(e),a=G(t),l=J(s,a,r,o,1);if(i)return l.color.hex();const c=J(s,a,r,o,-1);return c.contrast>l.contrast?c.color.hex():l.color.hex()},re=e=>G.hsl(e,60,96).hex(),ie=e=>G(e).hsl().array()[0],oe=(e,t,n,r)=>{const i=(e=>{const t=ne(e,"#ffffff");return{"--h5p-theme-main-cta-base":e,"--h5p-theme-main-cta-light":Z(e,1.1),"--h5p-theme-main-cta-dark":Z(e,.9),"--h5p-theme-contrast-cta":ne(e,e),"--h5p-theme-contrast-cta-light":ee(e,90),"--h5p-theme-contrast-cta-white":t,"--h5p-theme-contrast-cta-dark":ne(e,"#282836")}})(e),o=((e,t)=>({"--h5p-theme-secondary-cta-base":e,"--h5p-theme-secondary-cta-light":Z(e,1.1),"--h5p-theme-secondary-cta-dark":Z(e,.9),"--h5p-theme-secondary-contrast-cta":ne(e,e,{lightenOnly:!0}),"--h5p-theme-secondary-contrast-cta-hover":ne(e,t)}))(t,i["--h5p-theme-contrast-cta-white"]);return{"--h5p-theme-background":r,"--h5p-theme-alternative-base":re(n),"--h5p-theme-alternative-light":X("#f8f9fe",n),"--h5p-theme-alternative-dark":X("#dcdffa",n),"--h5p-theme-alternative-darker":X("#ced1ee",n),...i,...o,...Y}};var se=n(223),ae={};ae.styleTagTransform=m(),ae.setAttributes=h(),ae.insert=l().bind(null,"head"),ae.domAPI=s(),ae.insertStyleElement=p();i()(se.A,ae);se.A&&se.A.locals&&se.A.locals;class le extends HTMLElement{static get observedAttributes(){return["default-color","button-label","type"]}constructor(e={},t={}){super(),this.params={...e,defaultColor:this.getAttribute("default-color")??e.defaultColor??"#000000",buttonLabel:this.getAttribute("button-label")??e.buttonLabel,type:this.getAttribute("type")??e.type??"color"},this.callbacks=t,this.callbacks.onChange=this.callbacks.onChange||(()=>{}),this.input=null,this.button=null,this.preview=null,this.dom=null,this.value=this.params.defaultColor,this.handleInput=this.handleInput.bind(this),this.handleButtonClick=this.handleButtonClick.bind(this),this.updateDOM(this.params)}handleInput(e){const t=e.target.value;this.value=t,this.preview.style.setProperty("background-color",t),this.callbacks.onChange({id:this.params.id,color:t})}handleButtonClick(e){e.preventDefault(),this.input?.click()}cleanupListeners(){this.input?.removeEventListener("input",this.handleInput),this.button?.removeEventListener("click",this.handleButtonClick)}connectedCallback(){this.render()}disconnectedCallback(){cleanupListeners()}getValue(){return this.value}attributeChangedCallback(e,t,n){if(t===n)return;this.params[{"default-color":"defaultColor","button-label":"buttonLabel",type:"type"}[e]??e]=n,this.updateDOM({...this.params,defaultColor:this.getAttribute("default-color")??this.params.defaultColor??"#000000",buttonLabel:this.getAttribute("button-label")??this.params.buttonLabel,type:this.getAttribute("type")??this.params.type??"color"}),this.render()}updateDOM(e={}){this.cleanupListeners();const{dom:t,input:n,button:r,preview:i}=this.buildDOM(e);this.dom=t,this.input=n,this.button=r,this.preview=i}render(){this.replaceChildren(this.dom)}buildDOM(e={}){const t=document.createElement("div");t.classList.add("h5p-theme-picker-color-picker",e.id);let n=null,r=null,i=null,o=null;if("color"===e.type&&(n=document.createElement("input"),n.type="color",n.id=e.uuid,n.classList.add("h5p-theme-picker-color-picker-input"),n.setAttribute("tabindex","-1"),n.value=e.defaultColor,n.addEventListener("input",this.handleInput),t.append(n)),r=document.createElement("button"),r.classList.add("h5p-theme-picker-color-picker-button"),r.setAttribute("type","button"),r.setAttribute("aria-label",e.buttonLabel),"color"===e.type?r.addEventListener("click",this.handleButtonClick):"hue"===e.type&&r.setAttribute("popovertarget",`popover-${e.uuid}`),t.append(r),i=document.createElement("div"),i.classList.add("h5p-theme-picker-color-picker-preview"),i.style.setProperty("background-color",e.defaultColor),r.append(i),"hue"===e.type){o=document.createElement("dialog"),o.id=`popover-${e.uuid}`,o.setAttribute("popover",""),o.classList.add("h5p-theme-picker-color-picker-popover"),t.append(o);const n=document.createElement("input");n.id=e.uuid,n.classList.add("h5p-theme-picker-color-picker-slider","hue"),n.type="range",n.min=0,n.max=360,n.value=0,n.addEventListener("input",t=>{const n=parseFloat(t.target.value),r=re(n),o=(e=>{const t=ie(e);return G.hsl(t,60,85).hex()})(r);i.style.setProperty("background-color",o),this.callbacks.onChange({id:e.id,color:r})}),o.append(n)}return{dom:t,input:n,button:r,preview:i}}}customElements.get("h5p-theme-picker-color-picker")||customElements.define("h5p-theme-picker-color-picker",le);const ce=(e,...t)=>{const n=document.createElement(e);return t.length>0&&n.classList.add(...t),n},he=(e,t,n={})=>{e.dispatchEvent(new CustomEvent(t,{detail:n,bubbles:!1,composed:!1}))},ue=e=>Boolean(e)&&"object"==typeof e&&!Array.isArray(e);var pe=n(463),de={};de.styleTagTransform=m(),de.setAttributes=h(),de.insert=l().bind(null,"head"),de.domAPI=s(),de.insertStyleElement=p();i()(pe.A,de);pe.A&&pe.A.locals&&pe.A.locals;class me extends HTMLElement{constructor(e={}){super(),this.translations=e.translations||{},this.dom=document.createElement("div"),this.dom.classList.add("h5p-theme-picker-color-selector");const t=document.createElement("div");t.classList.add("h5p-theme-picker-color-selector-title"),t.innerText=this.translate("color_selector_title"),this.dom.append(t),this.grid=document.createElement("div"),this.grid.classList.add("h5p-theme-picker-color-selector-grid"),this.dom.append(this.grid),this.pickerButtons={},this.pickerButtons.buttons=this.addPicker("buttons",{defaultColor:e.customColorButtons,buttonLabel:this.translate("color_selector_buttons_button_aria")},"color_selector_buttons_label"),this.pickerButtons.navigation=this.addPicker("navigation",{defaultColor:e.customColorNavigation,buttonLabel:this.translate("color_selector_navigation_button_aria")},"color_selector_navigation_label"),this.pickerButtons.alternative=this.addPicker("alternative",{type:"hue",defaultColor:e.customColorAlternative,buttonLabel:this.translate("color_selector_alternative_button_aria")},"color_selector_alternative_label"),this.pickerButtons.background=this.addPicker("background",{defaultColor:e.customColorBackground,buttonLabel:this.translate("color_selector_background_button_aria")},"color_selector_background_label")}translate(e){return"function"==typeof this.translations?.get?this.translations.get(e)??e:e}addPicker(e,t,n){const r=crypto.randomUUID(),i=new le({id:e,uuid:r,...t},{onChange:e=>he(this,"change",e)});this.grid.append(i);const o=document.createElement("label");return o.classList.add("h5p-theme-picker-color-selector-picker-label"),o.setAttribute("for",r),o.innerText=this.translate(n),this.grid.append(o),i}getValues(){return{"--h5p-theme-main-cta-base":this.pickerButtons.buttons.getValue(),"--h5p-theme-secondary-cta-base":this.pickerButtons.navigation.getValue(),"--h5p-theme-alternative-base":this.pickerButtons.alternative.getValue(),"--h5p-theme-background":this.pickerButtons.background.getValue()}}connectedCallback(){this.render()}toggleVisibility(e){this.dom.classList.toggle("display-none",!e)}render(){this.contains(this.dom)||this.append(this.dom)}}customElements.get("h5p-theme-picker-color-selector")||customElements.define("h5p-theme-picker-color-selector",me);var fe=n(220),ge={};ge.styleTagTransform=m(),ge.setAttributes=h(),ge.insert=l().bind(null,"head"),ge.domAPI=s(),ge.insertStyleElement=p();i()(fe.A,ge);fe.A&&fe.A.locals&&fe.A.locals;const be=new Set(["--h5p-theme-main-cta-base","--h5p-theme-contrast-cta","--h5p-theme-secondary-cta-base","--h5p-theme-secondary-contrast-cta","--h5p-theme-alternative-base","--h5p-theme-alternative-dark","--h5p-theme-alternative-light","--h5p-theme-background","--h5p-theme-ui-base","--h5p-theme-text-primary","--h5p-theme-spacing-xl","--h5p-theme-spacing-l","--h5p-theme-spacing-m","--h5p-theme-spacing-s","--h5p-theme-spacing-xs","--h5p-theme-spacing-xxs","--h5p-theme-font-size-xxl","--h5p-theme-font-size-xl","--h5p-theme-font-size-l","--h5p-theme-font-size-m","--h5p-theme-font-size-s","--h5p-theme-scaling"]),ke=()=>{const e=ce("div","h5p-theme-picker-preview-mockup"),t=ce("div","h5p-theme-picker-preview-mockup-main");return t.append(ye()),t.append(Se()),e.append(t),e.append(xe()),e},ye=()=>{const e=ce("div","h5p-theme-picker-preview-mockup-box","multi-choice"),t=ce("div","h5p-theme-picker-preview-mockup-inner-main");return t.append(ce("div","h5p-theme-picker-preview-mockup-bar")),t.append(ce("div","h5p-theme-picker-preview-mockup-blank")),t.append(ce("div","h5p-theme-picker-preview-mockup-blank")),t.append(ce("div","h5p-theme-picker-preview-mockup-blank")),e.append(t),e.append(ve()),e},ve=()=>{const e=ce("div","h5p-theme-picker-preview-mockup-inner-footer");return e.append(ce("div","h5p-theme-picker-preview-mockup-button","main")),e},Se=()=>{const e=ce("div","h5p-theme-picker-preview-mockup-box","drag-text"),t=ce("div","h5p-theme-picker-preview-mockup-inner-main"),n=ce("div","h5p-theme-picker-preview-mockup-text-container");n.append(we("h5p-theme-picker-preview-mockup-blank","h5p-theme-picker-preview-mockup-bar")),n.append(we("h5p-theme-picker-preview-mockup-bar","h5p-theme-picker-preview-mockup-blank")),n.append(we("h5p-theme-picker-preview-mockup-blank","h5p-theme-picker-preview-mockup-bar"));const r=ce("div","h5p-theme-picker-preview-mockup-draggable-container");return r.append(ce("div","h5p-theme-picker-preview-mockup-draggable")),r.append(ce("div","h5p-theme-picker-preview-mockup-draggable")),r.append(ce("div","h5p-theme-picker-preview-mockup-draggable")),t.append(n),t.append(r),e.append(t),e.append(ve()),e},we=(e,t)=>{const n=ce("div","h5p-theme-picker-preview-mockup-text-row");return n.append(ce("div",e)),n.append(ce("div",t)),n},xe=()=>{const e=ce("div","h5p-theme-picker-preview-mockup-footer");return e.append(ce("div","h5p-theme-picker-preview-mockup-button","secondary")),e.append(ce("div","h5p-theme-picker-preview-mockup-button","secondary")),e};class Ce extends HTMLElement{static get observedAttributes(){return["theme-name"]}constructor(e={}){super();const{dom:t,label:n}=((e={})=>{const t=ce("div","h5p-theme-picker-preview"),n=ce("div","h5p-theme-picker-preview-label"),r="function"==typeof e?.translations?.get?e.translations.get("preview_preview_label_prefix")??"preview_preview_label_prefix":"preview_preview_label_prefix";return n.textContent=r,t.append(n),t.append(ke()),{dom:t,label:n}})(e);this.dom=t,this.label=n}connectedCallback(){this.render()}attributeChangedCallback(e,t,n){t!==n&&"theme-name"===e&&(null==n?this.label.removeAttribute("data-theme-name"):this.label.setAttribute("data-theme-name",n))}setValues(e={},t){"string"==typeof t?this.setAttribute("theme-name",t):null==t&&this.removeAttribute("theme-name"),Object.entries(e).forEach(([e,t])=>{be.has(e)&&this.style.setProperty(e,t)})}render(){this.contains(this.dom)||this.append(this.dom)}}customElements.get("h5p-theme-picker-preview")||customElements.define("h5p-theme-picker-preview",Ce);var Ae=n(665),_e={};_e.styleTagTransform=m(),_e.setAttributes=h(),_e.insert=l().bind(null,"head"),_e.domAPI=s(),_e.insertStyleElement=p();i()(Ae.A,_e);Ae.A&&Ae.A.locals&&Ae.A.locals;class Te extends HTMLElement{constructor(e={}){super(),e.labelTheme=e.translations?.get("selector_theme_label")??this.getAttribute("label-theme")??"Theme",e.labelDensity=e.translations?.get("selector_density_label")??this.getAttribute("label-density")??"Density",e.densityAllowed=e.densityAllowed??(!this.hasAttribute("density-allowed")||"true"===this.getAttribute("density-allowed")),this.handleThemeChange=this.handleThemeChange.bind(this),this.handleDensityChange=this.handleDensityChange.bind(this),this.handleThemePointerEnter=this.handleThemePointerEnter.bind(this),this.handleThemePointerLeave=this.handleThemePointerLeave.bind(this),this.handleDensityPointerEnter=this.handleDensityPointerEnter.bind(this),this.handleDensityPointerLeave=this.handleDensityPointerLeave.bind(this);const{dom:t,selectTheme:n,selectDensity:r}=(e=>{const t=document.createElement("div");t.classList.add("h5p-theme-picker-selector-box");const n=crypto.randomUUID(),r=`selectTheme-${n}`,i=`selectDensity-${n}`,o=document.createElement("label");o.classList.add("h5p-theme-picker-label"),o.setAttribute("for",r),o.innerText=e.labelTheme,t.append(o);const s=document.createElement("select");if(s.id=r,s.classList.add("h5p-theme-picker-select","theme"),t.append(s),!e.densityAllowed)return{dom:t,selectTheme:s,selectDensity:null};const a=document.createElement("label");a.classList.add("h5p-theme-picker-label"),a.setAttribute("for",i),a.innerText=e.labelDensity,t.append(a);const l=document.createElement("select");return l.id=i,l.classList.add("h5p-theme-picker-select","density"),t.append(l),{dom:t,selectTheme:s,selectDensity:l}})(e);this.dom=t,this.selectTheme=n,this.selectDensity=r??{}}connectedCallback(){this.render(),this.bindChangeEvents()}disconnectedCallback(){this.unbindChangeEvents(),this.unbindOptionEvents()}setThemeOptions(e=new Map){this.themeOptions=e,this.renderOptions(this.selectTheme,e,(e,t)=>{e.style.setProperty("--background-color",t.backgroundColor),e.style.setProperty("--color",t.color)})}setDensityOptions(e=new Map){this.densityOptions=e,this.selectDensity.getAttribute&&this.renderOptions(this.selectDensity,e)}renderOptions(e,t,n=null){e&&(this.unbindOptionEvents(),e.innerHTML="",t.forEach((t,r)=>{const i=document.createElement("option");i.value=r,i.textContent=t.label,n?.(i,t),e.append(i)}),this.bindOptionEvents())}setActiveTheme(e){this.selectTheme.value=e}setActiveDensity(e){this.selectDensity.value=e}getActiveTheme(){return this.selectTheme.value}getActiveDensity(){return this.selectDensity.value??"large"}handleThemeChange(e){he(this,"theme-change",{key:e.target.value})}handleDensityChange(e){he(this,"density-change",{key:e.target.value})}handleThemePointerEnter(e){he(this,"theme-preview",{key:e.target.value})}handleThemePointerLeave(){he(this,"theme-preview-reset")}handleDensityPointerEnter(e){he(this,"density-preview",{key:e.target.value})}handleDensityPointerLeave(){he(this,"density-preview-reset")}unbindChangeEvents(){this.selectTheme.removeEventListener("change",this.handleThemeChange),this.selectDensity?.removeEventListener?.("change",this.handleDensityChange)}unbindOptionEvents(){this.selectTheme.querySelectorAll("option").forEach(e=>{e.removeEventListener("pointerenter",this.handleThemePointerEnter),e.removeEventListener("pointerleave",this.handleThemePointerLeave)}),this.selectDensity?.querySelectorAll?.("option").forEach(e=>{e.removeEventListener("pointerenter",this.handleDensityPointerEnter),e.removeEventListener("pointerleave",this.handleDensityPointerLeave)})}bindChangeEvents(){this.selectTheme.addEventListener("change",this.handleThemeChange),this.selectDensity?.addEventListener?.("change",this.handleDensityChange)}bindOptionEvents(){this.selectTheme.querySelectorAll("option").forEach(e=>{e.addEventListener("pointerenter",this.handleThemePointerEnter),e.addEventListener("pointerleave",this.handleThemePointerLeave)}),this.selectDensity?.querySelectorAll?.("option").forEach(e=>{e.addEventListener("pointerenter",this.handleDensityPointerEnter),e.addEventListener("pointerleave",this.handleDensityPointerLeave)})}render(){this.contains(this.dom)||this.append(this.dom)}}customElements.get("h5p-theme-picker-selector")||customElements.define("h5p-theme-picker-selector",Te);const Le=JSON.parse('{"themes":{"daylight":{"label":"Daylight (default)","subLabel":"WCAG 2.0 AA","backgroundColor":"rgb(249, 251, 255)","color":"rgb(0, 111, 191)","values":{"--h5p-theme-ui-base":"#FFFFFF","--h5p-theme-text-primary":"#101729","--h5p-theme-text-secondary":"#354054","--h5p-theme-text-third":"#737373","--h5p-theme-stroke-1":"#C7D7EF","--h5p-theme-stroke-2":"#E7EDF6","--h5p-theme-stroke-3":"#F6F7FA","--h5p-theme-feedback-correct-main":"#256D1D","--h5p-theme-feedback-correct-secondary":"#f3fcf0","--h5p-theme-feedback-correct-third":"#cff1c2","--h5p-theme-feedback-incorrect-main":"#a13236","--h5p-theme-feedback-incorrect-secondary":"#faf0f4","--h5p-theme-feedback-incorrect-third":"#f6dce7","--h5p-theme-feedback-neutral-main":"#E6C81D","--h5p-theme-feedback-neutral-secondary":"#5E4817","--h5p-theme-feedback-neutral-third":"#F0EBCB","--h5p-theme-main-cta-base":"#006FBF","--h5p-theme-secondary-cta-base":"#202122","--h5p-theme-alternative-base":"#F1F5FB","--h5p-theme-background":"#F9FBFF","--h5p-theme-focus":"#006FBF","--h5p-theme-main-cta-light":"#007CD6","--h5p-theme-main-cta-dark":"#005FA3","--h5p-theme-contrast-cta":"#EBF7FF","--h5p-theme-contrast-cta-white":"#006FBF","--h5p-theme-contrast-cta-light":"color-mix(in srgb, var(--h5p-theme-main-cta-base), transparent 90%)","--h5p-theme-contrast-cta-dark":"#0597FF","--h5p-theme-secondary-cta-light":"#222324","--h5p-theme-secondary-cta-dark":"#1F1F20","--h5p-theme-secondary-contrast-cta":"#E3E9F1","--h5p-theme-secondary-contrast-cta-hover":"#FFFFFF","--h5p-theme-alternative-light":"#F7F9FD","--h5p-theme-alternative-dark":"#DBE5F5","--h5p-theme-alternative-darker":"#C7D7EF"}},"lavender":{"label":"Lavender","subLabel":"WCAG 2.0 AA","backgroundColor":"rgb(243, 238, 250)","color":"rgb(131, 77, 213)","values":{"--h5p-theme-ui-base":"#FFFFFF","--h5p-theme-text-primary":"#101729","--h5p-theme-text-secondary":"#1b1346","--h5p-theme-text-third":"#737373","--h5p-theme-stroke-1":"#ead8f6","--h5p-theme-stroke-2":"#E7EDF6","--h5p-theme-stroke-3":"#F6F7FA","--h5p-theme-feedback-correct-main":"#256D1D","--h5p-theme-feedback-correct-secondary":"#f3fcf0","--h5p-theme-feedback-correct-third":"#cff1c2","--h5p-theme-feedback-incorrect-main":"#a13236","--h5p-theme-feedback-incorrect-secondary":"#faf0f4","--h5p-theme-feedback-incorrect-third":"#f6dce7","--h5p-theme-feedback-neutral-main":"#E6C81D","--h5p-theme-feedback-neutral-secondary":"#5E4817","--h5p-theme-feedback-neutral-third":"#F0EBCB","--h5p-theme-main-cta-base":"#834DD5","--h5p-theme-secondary-cta-base":"#000000","--h5p-theme-alternative-base":"#f3edff","--h5p-theme-background":"#F3EEFA","--h5p-theme-focus":"#F1EBFA","--h5p-theme-main-cta-light":"#8347DD","--h5p-theme-main-cta-dark":"#692EC2","--h5p-theme-contrast-cta":"#ffffff","--h5p-theme-contrast-cta-white":"#834DD5","--h5p-theme-contrast-cta-light":"color-mix(in srgb, var(--h5p-theme-main-cta-base), transparent 90%)","--h5p-theme-contrast-cta-dark":"#A983E2","--h5p-theme-secondary-cta-light":"#333333","--h5p-theme-secondary-cta-dark":"#311B50","--h5p-theme-secondary-contrast-cta":"#F3F1F5","--h5p-theme-secondary-contrast-cta-hover":"#ffffff","--h5p-theme-alternative-light":"#f8f5ff","--h5p-theme-alternative-dark":"#e8d9ff","--h5p-theme-alternative-darker":"#ddc7ff"}},"mint":{"label":"Mint","subLabel":"WCAG 2.0 AA","backgroundColor":"rgb(252, 249, 242)","color":"rgb(23, 148, 139)","values":{"--h5p-theme-ui-base":"#FFFFFF","--h5p-theme-text-primary":"#101729","--h5p-theme-text-secondary":"#05252e","--h5p-theme-text-third":"#737373","--h5p-theme-stroke-1":"#cceae8","--h5p-theme-stroke-2":"#E7EDF6","--h5p-theme-stroke-3":"#F6F7FA","--h5p-theme-feedback-correct-main":"#256D1D","--h5p-theme-feedback-correct-secondary":"#f3fcf0","--h5p-theme-feedback-correct-third":"#cff1c2","--h5p-theme-feedback-incorrect-main":"#a13236","--h5p-theme-feedback-incorrect-secondary":"#faf0f4","--h5p-theme-feedback-incorrect-third":"#f6dce7","--h5p-theme-feedback-neutral-main":"#E6C81D","--h5p-theme-feedback-neutral-secondary":"#5E4817","--h5p-theme-feedback-neutral-third":"#F0EBCB","--h5p-theme-main-cta-base":"#17948b","--h5p-theme-secondary-cta-base":"#000000","--h5p-theme-alternative-base":"#FAF4E6","--h5p-theme-background":"#FCF9F2","--h5p-theme-focus":"#F1EBFA","--h5p-theme-main-cta-light":"#00B2A0","--h5p-theme-main-cta-dark":"#004D45","--h5p-theme-contrast-cta":"#ffffff","--h5p-theme-contrast-cta-white":"#17948b","--h5p-theme-contrast-cta-light":"color-mix(in srgb, var(--h5p-theme-main-cta-base), transparent 90%)","--h5p-theme-contrast-cta-dark":"#1AA89E","--h5p-theme-secondary-cta-light":"#333333","--h5p-theme-secondary-cta-dark":"#311B50","--h5p-theme-secondary-contrast-cta":"#F3F1F5","--h5p-theme-secondary-contrast-cta-hover":"#ffffff","--h5p-theme-alternative-light":"#FCF9F2","--h5p-theme-alternative-dark":"#F2E3BF","--h5p-theme-alternative-darker":"#EEDAAA"}},"sunset":{"label":"Sunset","subLabel":"WCAG 2.0 AA","backgroundColor":"rgb(255, 242, 237)","color":"rgb(214, 58, 10)","values":{"--h5p-theme-ui-base":"#FFFFFF","--h5p-theme-text-primary":"#101729","--h5p-theme-text-secondary":"#2c0f03","--h5p-theme-text-third":"#737373","--h5p-theme-stroke-1":"#f2dbd4","--h5p-theme-stroke-2":"#E7EDF6","--h5p-theme-stroke-3":"#F6F7FA","--h5p-theme-feedback-correct-main":"#256D1D","--h5p-theme-feedback-correct-secondary":"#f3fcf0","--h5p-theme-feedback-correct-third":"#cff1c2","--h5p-theme-feedback-incorrect-main":"#a13236","--h5p-theme-feedback-incorrect-secondary":"#faf0f4","--h5p-theme-feedback-incorrect-third":"#f6dce7","--h5p-theme-feedback-neutral-main":"#E6C81D","--h5p-theme-feedback-neutral-secondary":"#5E4817","--h5p-theme-feedback-neutral-third":"#F0EBCB","--h5p-theme-main-cta-base":"#D63A0A","--h5p-theme-secondary-cta-base":"#172326","--h5p-theme-alternative-base":"#FFF2ED","--h5p-theme-background":"#FFF2ED","--h5p-theme-focus":"#F1EBFA","--h5p-theme-main-cta-light":"#F5511F","--h5p-theme-main-cta-dark":"#AF320B","--h5p-theme-contrast-cta":"#ffffff","--h5p-theme-contrast-cta-white":"#D63A0A","--h5p-theme-contrast-cta-light":"color-mix(in srgb, var(--h5p-theme-main-cta-base), transparent 90%)","--h5p-theme-contrast-cta-dark":"#F66437","--h5p-theme-secondary-cta-light":"#263A3F","--h5p-theme-secondary-cta-dark":"#121A1D","--h5p-theme-secondary-contrast-cta":"#F3F1F5","--h5p-theme-secondary-contrast-cta-hover":"#ffffff","--h5p-theme-alternative-light":"#FDF8F7","--h5p-theme-alternative-dark":"#F2DBD4","--h5p-theme-alternative-darker":"#FFCFBA"}},"custom":{"label":"Custom Theme","subLabel":"Define a custom theme","backgroundColor":"rgb(249, 251, 255)","color":"rgb(0, 111, 191)","values":{}}},"densities":{"large":{"label":"Wide (default)","values":{"--h5p-theme-spacing-xl":"var(--h5p-theme-spacing-xl-primary-large)","--h5p-theme-spacing-l":"var(--h5p-theme-spacing-primary-large)","--h5p-theme-spacing-m":"var(--h5p-theme-spacing-secondary-large)","--h5p-theme-spacing-s":"var(--h5p-theme-spacing-third-large)","--h5p-theme-spacing-xs":"var(--h5p-theme-spacing-fourth-large)","--h5p-theme-spacing-xxs":"var(--h5p-theme-spacing-fifth-large)","--h5p-theme-font-size-xxl":"var(--h5p-theme-font-size-xxl-large)","--h5p-theme-font-size-xl":"var(--h5p-theme-font-size-xl-large)","--h5p-theme-font-size-l":"var(--h5p-theme-font-size-l-large)","--h5p-theme-font-size-m":"var(--h5p-theme-font-size-m-large)","--h5p-theme-font-size-s":"var(--h5p-theme-font-size-s-large)","--h5p-theme-scaling":"1"}},"medium":{"label":"Medium","values":{"--h5p-theme-spacing-xl":"var(--h5p-theme-spacing-xl-primary-medium)","--h5p-theme-spacing-l":"var(--h5p-theme-spacing-primary-medium)","--h5p-theme-spacing-m":"var(--h5p-theme-spacing-secondary-medium)","--h5p-theme-spacing-s":"var(--h5p-theme-spacing-third-medium)","--h5p-theme-spacing-xs":"var(--h5p-theme-spacing-fourth-medium)","--h5p-theme-spacing-xxs":"var(--h5p-theme-spacing-fifth-medium)","--h5p-theme-font-size-xxl":"var(--h5p-theme-font-size-xxl-medium)","--h5p-theme-font-size-xl":"var(--h5p-theme-font-size-xl-medium)","--h5p-theme-font-size-l":"var(--h5p-theme-font-size-l-medium)","--h5p-theme-font-size-m":"var(--h5p-theme-font-size-m-medium)","--h5p-theme-font-size-s":"var(--h5p-theme-font-size-s-medium)","--h5p-theme-scaling":"0.8"}},"small":{"label":"Compact","values":{"--h5p-theme-spacing-xl":"var(--h5p-theme-spacing-xl-primary-small)","--h5p-theme-spacing-l":"var(--h5p-theme-spacing-primary-small)","--h5p-theme-spacing-m":"var(--h5p-theme-spacing-secondary-small)","--h5p-theme-spacing-s":"var(--h5p-theme-spacing-third-small)","--h5p-theme-spacing-xs":"var(--h5p-theme-spacing-fourth-small)","--h5p-theme-spacing-xxs":"var(--h5p-theme-spacing-fifth-small)","--h5p-theme-font-size-xxl":"var(--h5p-theme-font-size-xxl-small)","--h5p-theme-font-size-xl":"var(--h5p-theme-font-size-xl-small)","--h5p-theme-font-size-l":"var(--h5p-theme-font-size-l-small)","--h5p-theme-font-size-m":"var(--h5p-theme-font-size-m-small)","--h5p-theme-font-size-s":"var(--h5p-theme-font-size-s-small)","--h5p-theme-scaling":"0.6"}}}}'),Ee=e=>{if(!e)return{};if("object"==typeof e&&!Array.isArray(e))return e;if("string"==typeof e)try{const t=JSON.parse(e);return t&&"object"==typeof t&&!Array.isArray(t)?t:{}}catch(e){return{}}return{}},Oe=e=>{const t={},n=Pe();for(const[r,i]of Object.entries(e)){if(!r)continue;if(!ue(i))continue;if(!ue(i.values))continue;const e={};for(const[t,r]of Object.entries(i.values))"string"==typeof r&&n.has(t)&&(e[t]=r);if(!K.every(t=>t in e))continue;const o="string"==typeof i.backgroundColor?i.backgroundColor:"#ffffff",s="string"==typeof i.color?i.color:ne(o,o),a="string"==typeof i.label?i.label:De(r),l="string"==typeof i.subLabel?i.subLabel:"";t[r]={backgroundColor:o,color:s,label:a,subLabel:l,values:e}}return t},Pe=()=>{const e=new Set,t=Le?.themes??{},n=Object.values(t)[0];if(!n?.values||"object"!=typeof n.values)return e;for(const t of Object.keys(n.values))e.add(t);return e},De=(e="")=>`${e.charAt(0).toUpperCase()}${e.slice(1).toLowerCase()}`,Fe=(e,t,n)=>{const r=new Map;for(const[i,o]of Object.entries(e)){const e={...o,values:{...o.values||{}}},s=`${n}${i}`;"function"==typeof t?.has&&"function"==typeof t?.get&&t.has(s)&&(e.label=t.get(s)),r.set(i,e)}return r};class Me{constructor(e={}){const{translations:t,presetThemesAllowed:n,customThemesAllowed:r,customPresets:i}=((e={})=>{const t=e&&"object"==typeof e&&!Array.isArray(e)?e:{},{translations:n,presetThemesAllowed:r=!0,customThemesAllowed:i=!0,customPresets:o={}}=t,s=Ee(o),a=Oe(s),l=Object.keys(a).length>0;let c=i;return c||r||l||(c=!0),{translations:n,presetThemesAllowed:r,customThemesAllowed:c,customPresets:a}})(e);this.options={},this.options.theme=Fe(Le.themes,t,"selector_theme_value_"),n||(this.options.theme=new Map([...this.options.theme].filter(([e])=>"custom"===e)));for(const[e,t]of Object.entries(i))this.options.theme.set(e,t);const o=this.options.theme.get("custom");this.options.theme.delete("custom"),r&&o&&this.options.theme.set("custom",o),this.options.density=Fe(Le.densities,t,"selector_density_value_")}getThemeOptions(){return this.options.theme}getDensityOptions(){return this.options.density}}const ze=JSON.parse('{"en":{"selector_theme_label":"Theme","selector_theme_value_daylight":"Daylight (default)","selector_theme_value_lavender":"Lavender","selector_theme_value_mint":"Mint","selector_theme_value_sunset":"Sunset","selector_theme_value_custom":"Custom Theme","selector_density_label":"Density","selector_density_value_large":"Wide (default)","selector_density_value_medium":"Medium","selector_density_value_small":"Compact","color_selector_title":"Define theme colors","color_selector_buttons_label":"Buttons","color_selector_buttons_button_aria":"Pick main color, e.g. for buttons","color_selector_navigation_label":"Navigation","color_selector_navigation_button_aria":"Pick secondary color for navigation buttons","color_selector_alternative_label":"Alternative","color_selector_alternative_button_aria":"Pick alternative hue as contrast to main color","color_selector_background_label":"Background","color_selector_background_button_aria":"Pick color for the background","preview_preview_label_prefix":"Preview:"},"de":{"selector_theme_label":"Theme","selector_theme_value_daylight":"Tageslicht (Vorgabe)","selector_theme_value_lavender":"Lavendel","selector_theme_value_mint":"Minze","selector_theme_value_sunset":"Sonnenuntergang","selector_theme_value_custom":"Eigenes Theme","selector_density_label":"Dichte","selector_density_value_large":"Weit (Vorgabe)","selector_density_value_medium":"Medium","selector_density_value_small":"Kompakt","color_selector_title":"Lege Theme-Farben fest","color_selector_buttons_label":"Buttons","color_selector_buttons_button_aria":"Wähle die Hauptfarbe, zum Beispiel für Buttons","color_selector_navigation_label":"Navigation","color_selector_navigation_button_aria":"Wähle die Nebenfarbe für Navigationsbuttons","color_selector_alternative_label":"Alternativ","color_selector_alternative_button_aria":"Wähle den Alternativfarbton als Kontrast zur Hauptfarbe","color_selector_background_label":"Hintergrund","color_selector_background_button_aria":"Wähle die Farbe für den Hintergrund","preview_preview_label_prefix":"Vorschau:"}}'),je="en";class Ie{constructor(e=je,t={}){const n=(e=>{if("string"!=typeof e)return je;const t=e.toLowerCase();return ze[t]?t:je})(e),r=(e=>{const t=new Set(Object.keys(ze[je]||{})),n={};for(const[r,i]of Object.entries(e))t.has(r)&&"string"==typeof i&&(n[r]=i);return n})((e=>{if(!e)return{};if("object"==typeof e&&!Array.isArray(e))return e;if("string"==typeof e)try{const t=JSON.parse(e);return t&&"object"==typeof t&&!Array.isArray(t)?t:{}}catch(e){return{}}return{}})(t)),i=ze[n]??{},o={...ze[je]??{},...i,...r};var s;this.translations=new Map((s=o,Object.keys(s||{}).map(e=>[e,s[e]])))}get(e){return"string"==typeof e&&this.has(e)?this.translations.get(e):`Missing translation for key: ${e}`}has(e){return this.translations.has(e)}}var Ne=Object.defineProperty,Re=Object.defineProperties,Be=Object.getOwnPropertyDescriptors,$e=Object.getOwnPropertySymbols,Ue=Object.prototype.hasOwnProperty,We=Object.prototype.propertyIsEnumerable,Ve=(e,t,n)=>t in e?Ne(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,He=(e,t)=>{for(var n in t||(t={}))Ue.call(t,n)&&Ve(e,n,t[n]);if($e)for(var n of $e(t))We.call(t,n)&&Ve(e,n,t[n]);return e},qe=(e,t)=>Re(e,Be(t)),Qe=(e,t,n)=>new Promise((r,i)=>{var o=e=>{try{a(n.next(e))}catch(e){i(e)}},s=e=>{try{a(n.throw(e))}catch(e){i(e)}},a=e=>e.done?r(e.value):Promise.resolve(e.value).then(o,s);a((n=n.apply(e,t)).next())});const Ge=Math.min,Ke=Math.max,Ye=Math.round,Je=Math.floor,Xe=e=>({x:e,y:e});function Ze(e){return"number"!=typeof e?function(e){return He({top:0,right:0,bottom:0,left:0},e)}(e):{top:e,right:e,bottom:e,left:e}}function et(e){const{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function tt(){return"undefined"!=typeof window}function nt(e){return ot(e)?(e.nodeName||"").toLowerCase():"#document"}function rt(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function it(e){var t;return null==(t=(ot(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function ot(e){return!!tt()&&(e instanceof Node||e instanceof rt(e).Node)}function st(e){return!!tt()&&(e instanceof Element||e instanceof rt(e).Element)}function at(e){return!!tt()&&(e instanceof HTMLElement||e instanceof rt(e).HTMLElement)}function lt(e){return!(!tt()||"undefined"==typeof ShadowRoot)&&(e instanceof ShadowRoot||e instanceof rt(e).ShadowRoot)}const ct=new Set(["inline","contents"]);function ht(e){const{overflow:t,overflowX:n,overflowY:r,display:i}=wt(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!ct.has(i)}const ut=new Set(["table","td","th"]);function pt(e){return ut.has(nt(e))}const dt=[":popover-open",":modal"];function mt(e){return dt.some(t=>{try{return e.matches(t)}catch(e){return!1}})}const ft=["transform","translate","scale","rotate","perspective"],gt=["transform","translate","scale","rotate","perspective","filter"],bt=["paint","layout","strict","content"];function kt(e){const t=yt(),n=st(e)?wt(e):e;return ft.some(e=>!!n[e]&&"none"!==n[e])||!!n.containerType&&"normal"!==n.containerType||!t&&!!n.backdropFilter&&"none"!==n.backdropFilter||!t&&!!n.filter&&"none"!==n.filter||gt.some(e=>(n.willChange||"").includes(e))||bt.some(e=>(n.contain||"").includes(e))}function yt(){return!("undefined"==typeof CSS||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}const vt=new Set(["html","body","#document"]);function St(e){return vt.has(nt(e))}function wt(e){return rt(e).getComputedStyle(e)}function xt(e){return st(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Ct(e){if("html"===nt(e))return e;const t=e.assignedSlot||e.parentNode||lt(e)&&e.host||it(e);return lt(t)?t.host:t}function At(e){const t=Ct(e);return St(t)?e.ownerDocument?e.ownerDocument.body:e.body:at(t)&&ht(t)?t:At(t)}function _t(e,t,n){var r;void 0===t&&(t=[]),void 0===n&&(n=!0);const i=At(e),o=i===(null==(r=e.ownerDocument)?void 0:r.body),s=rt(i);if(o){const e=Tt(s);return t.concat(s,s.visualViewport||[],ht(i)?i:[],e&&n?_t(e):[])}return t.concat(i,_t(i,[],n))}function Tt(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Lt(e){const t=wt(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const i=at(e),o=i?e.offsetWidth:n,s=i?e.offsetHeight:r,a=Ye(n)!==o||Ye(r)!==s;return a&&(n=o,r=s),{width:n,height:r,$:a}}function Et(e){return st(e)?e:e.contextElement}function Ot(e){const t=Et(e);if(!at(t))return Xe(1);const n=t.getBoundingClientRect(),{width:r,height:i,$:o}=Lt(t);let s=(o?Ye(n.width):n.width)/r,a=(o?Ye(n.height):n.height)/i;return(!s||!Number.isFinite(s))&&(s=1),(!a||!Number.isFinite(a))&&(a=1),{x:s,y:a}}const Pt=Xe(0);function Dt(e){const t=rt(e);return yt()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:Pt}function Ft(e,t,n,r){void 0===t&&(t=!1),void 0===n&&(n=!1);const i=e.getBoundingClientRect(),o=Et(e);let s=Xe(1);t&&(r?st(r)&&(s=Ot(r)):s=Ot(e));const a=function(e,t,n){return void 0===t&&(t=!1),!(!n||t&&n!==rt(e))&&t}(o,n,r)?Dt(o):Xe(0);let l=(i.left+a.x)/s.x,c=(i.top+a.y)/s.y,h=i.width/s.x,u=i.height/s.y;if(o){const e=rt(o),t=r&&st(r)?rt(r):r;let n=e,i=Tt(n);for(;i&&r&&t!==n;){const e=Ot(i),t=i.getBoundingClientRect(),r=wt(i),o=t.left+(i.clientLeft+parseFloat(r.paddingLeft))*e.x,s=t.top+(i.clientTop+parseFloat(r.paddingTop))*e.y;l*=e.x,c*=e.y,h*=e.x,u*=e.y,l+=o,c+=s,n=rt(i),i=Tt(n)}}return et({width:h,height:u,x:l,y:c})}function Mt(e,t){const n=xt(e).scrollLeft;return t?t.left+n:Ft(it(e)).left+n}function zt(e,t){const n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-Mt(e,n),y:n.top+t.scrollTop}}const jt=new Set(["absolute","fixed"]);function It(e,t,n){let r;if("viewport"===t)r=function(e,t){const n=rt(e),r=it(e),i=n.visualViewport;let o=r.clientWidth,s=r.clientHeight,a=0,l=0;if(i){o=i.width,s=i.height;const e=yt();(!e||e&&"fixed"===t)&&(a=i.offsetLeft,l=i.offsetTop)}const c=Mt(r);if(c<=0){const e=r.ownerDocument,t=e.body,n=getComputedStyle(t),i="CSS1Compat"===e.compatMode&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,s=Math.abs(r.clientWidth-t.clientWidth-i);s<=25&&(o-=s)}else c<=25&&(o+=c);return{width:o,height:s,x:a,y:l}}(e,n);else if("document"===t)r=function(e){const t=it(e),n=xt(e),r=e.ownerDocument.body,i=Ke(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),o=Ke(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let s=-n.scrollLeft+Mt(e);const a=-n.scrollTop;return"rtl"===wt(r).direction&&(s+=Ke(t.clientWidth,r.clientWidth)-i),{width:i,height:o,x:s,y:a}}(it(e));else if(st(t))r=function(e,t){const n=Ft(e,!0,"fixed"===t),r=n.top+e.clientTop,i=n.left+e.clientLeft,o=at(e)?Ot(e):Xe(1);return{width:e.clientWidth*o.x,height:e.clientHeight*o.y,x:i*o.x,y:r*o.y}}(t,n);else{const n=Dt(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return et(r)}function Nt(e,t){const n=Ct(e);return!(n===t||!st(n)||St(n))&&("fixed"===wt(n).position||Nt(n,t))}function Rt(e,t){const n=t.get(e);if(n)return n;let r=_t(e,[],!1).filter(e=>st(e)&&"body"!==nt(e)),i=null;const o="fixed"===wt(e).position;let s=o?Ct(e):e;for(;st(s)&&!St(s);){const t=wt(s),n=kt(s);!n&&"fixed"===t.position&&(i=null),(o?!n&&!i:!n&&"static"===t.position&&i&&jt.has(i.position)||ht(s)&&!n&&Nt(e,s))?r=r.filter(e=>e!==s):i=t,s=Ct(s)}return t.set(e,r),r}function Bt(e,t,n){const r=at(t),i=it(t),o="fixed"===n,s=Ft(e,!0,o,t);let a={scrollLeft:0,scrollTop:0};const l=Xe(0);function c(){l.x=Mt(i)}if(r||!r&&!o)if(("body"!==nt(t)||ht(i))&&(a=xt(t)),r){const e=Ft(t,!0,o,t);l.x=e.x+t.clientLeft,l.y=e.y+t.clientTop}else i&&c();o&&!r&&i&&c();const h=!i||r||o?Xe(0):zt(i,a);return{x:s.left+a.scrollLeft-l.x-h.x,y:s.top+a.scrollTop-l.y-h.y,width:s.width,height:s.height}}function $t(e){return"static"===wt(e).position}function Ut(e,t){if(!at(e)||"fixed"===wt(e).position)return null;if(t)return t(e);let n=e.offsetParent;return it(e)===n&&(n=n.ownerDocument.body),n}function Wt(e,t){const n=rt(e);if(mt(e))return n;if(!at(e)){let t=Ct(e);for(;t&&!St(t);){if(st(t)&&!$t(t))return t;t=Ct(t)}return n}let r=Ut(e,t);for(;r&&pt(r)&&$t(r);)r=Ut(r,t);return r&&St(r)&&$t(r)&&!kt(r)?n:r||function(e){let t=Ct(e);for(;at(t)&&!St(t);){if(kt(t))return t;if(mt(t))return null;t=Ct(t)}return null}(e)||n}const Vt={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e;const o="fixed"===i,s=it(r),a=!!t&&mt(t.floating);if(r===s||a&&o)return n;let l={scrollLeft:0,scrollTop:0},c=Xe(1);const h=Xe(0),u=at(r);if((u||!u&&!o)&&(("body"!==nt(r)||ht(s))&&(l=xt(r)),at(r))){const e=Ft(r);c=Ot(r),h.x=e.x+r.clientLeft,h.y=e.y+r.clientTop}const p=!s||u||o?Xe(0):zt(s,l);return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-l.scrollLeft*c.x+h.x+p.x,y:n.y*c.y-l.scrollTop*c.y+h.y+p.y}},getDocumentElement:it,getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e;const o=[..."clippingAncestors"===n?mt(t)?[]:Rt(t,this._c):[].concat(n),r],s=o[0],a=o.reduce((e,n)=>{const r=It(t,n,i);return e.top=Ke(r.top,e.top),e.right=Ge(r.right,e.right),e.bottom=Ge(r.bottom,e.bottom),e.left=Ke(r.left,e.left),e},It(t,s,i));return{width:a.right-a.left,height:a.bottom-a.top,x:a.left,y:a.top}},getOffsetParent:Wt,getElementRects:function(e){return Qe(this,null,function*(){const t=this.getOffsetParent||Wt,n=this.getDimensions,r=yield n(e.floating);return{reference:Bt(e.reference,yield t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}})},getClientRects:function(e){return Array.from(e.getClientRects())},getDimensions:function(e){const{width:t,height:n}=Lt(e);return{width:t,height:n}},getScale:Ot,isElement:st,isRTL:function(e){return"rtl"===wt(e).direction}};function Ht(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function qt(e,t,n,r){void 0===r&&(r={});const{ancestorScroll:i=!0,ancestorResize:o=!0,elementResize:s="function"==typeof ResizeObserver,layoutShift:a="function"==typeof IntersectionObserver,animationFrame:l=!1}=r,c=Et(e),h=i||o?[...c?_t(c):[],..._t(t)]:[];h.forEach(e=>{i&&e.addEventListener("scroll",n,{passive:!0}),o&&e.addEventListener("resize",n)});const u=c&&a?function(e,t){let n,r=null;const i=it(e);function o(){var e;clearTimeout(n),null==(e=r)||e.disconnect(),r=null}return function s(a,l){void 0===a&&(a=!1),void 0===l&&(l=1),o();const c=e.getBoundingClientRect(),{left:h,top:u,width:p,height:d}=c;if(a||t(),!p||!d)return;const m={rootMargin:-Je(u)+"px "+-Je(i.clientWidth-(h+p))+"px "+-Je(i.clientHeight-(u+d))+"px "+-Je(h)+"px",threshold:Ke(0,Ge(1,l))||1};let f=!0;function g(t){const r=t[0].intersectionRatio;if(r!==l){if(!f)return s();r?s(!1,r):n=setTimeout(()=>{s(!1,1e-7)},1e3)}1===r&&!Ht(c,e.getBoundingClientRect())&&s(),f=!1}try{r=new IntersectionObserver(g,qe(He({},m),{root:i.ownerDocument}))}catch(e){r=new IntersectionObserver(g,m)}r.observe(e)}(!0),o}(c,n):null;let p=-1,d=null;s&&(d=new ResizeObserver(e=>{let[r]=e;r&&r.target===c&&d&&(d.unobserve(t),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{var e;null==(e=d)||e.observe(t)})),n()}),c&&!l&&d.observe(c),d.observe(t));let m,f=l?Ft(e):null;return l&&function t(){const r=Ft(e);f&&!Ht(f,r)&&n(),f=r,m=requestAnimationFrame(t)}(),n(),()=>{var e;h.forEach(e=>{i&&e.removeEventListener("scroll",n),o&&e.removeEventListener("resize",n)}),null==u||u(),null==(e=d)||e.disconnect(),d=null,l&&cancelAnimationFrame(m)}}const Qt=function(e,t){return Qe(this,null,function*(){var n;void 0===t&&(t={});const{x:r,y:i,platform:o,rects:s,elements:a,strategy:l}=e,{boundary:c="clippingAncestors",rootBoundary:h="viewport",elementContext:u="floating",altBoundary:p=!1,padding:d=0}=function(e,t){return"function"==typeof e?e(t):e}(t,e),m=Ze(d),f=a[p?"floating"===u?"reference":"floating":u],g=et(yield o.getClippingRect({element:null==(n=yield null==o.isElement?void 0:o.isElement(f))||n?f:f.contextElement||(yield null==o.getDocumentElement?void 0:o.getDocumentElement(a.floating)),boundary:c,rootBoundary:h,strategy:l})),b="floating"===u?{x:r,y:i,width:s.floating.width,height:s.floating.height}:s.reference,k=yield null==o.getOffsetParent?void 0:o.getOffsetParent(a.floating),y=(yield null==o.isElement?void 0:o.isElement(k))&&(yield null==o.getScale?void 0:o.getScale(k))||{x:1,y:1},v=et(o.convertOffsetParentRelativeRectToViewportRelativeRect?yield o.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:b,offsetParent:k,strategy:l}):b);return{top:(g.top-v.top+m.top)/y.y,bottom:(v.bottom-g.bottom+m.bottom)/y.y,left:(g.left-v.left+m.left)/y.x,right:(v.right-g.right+m.right)/y.x}})};let Gt=null;class Kt{static createItem(e){return{prev:null,next:null,data:e}}constructor(){this.head=null,this.tail=null,this.cursor=null}createItem(e){return Kt.createItem(e)}allocateCursor(e,t){let n;return null!==Gt?(n=Gt,Gt=Gt.cursor,n.prev=e,n.next=t,n.cursor=this.cursor):n={prev:e,next:t,cursor:this.cursor},this.cursor=n,n}releaseCursor(){const{cursor:e}=this;this.cursor=e.cursor,e.prev=null,e.next=null,e.cursor=Gt,Gt=e}updateCursors(e,t,n,r){let{cursor:i}=this;for(;null!==i;)i.prev===e&&(i.prev=t),i.next===n&&(i.next=r),i=i.cursor}*[Symbol.iterator](){for(let e=this.head;null!==e;e=e.next)yield e.data}get size(){let e=0;for(let t=this.head;null!==t;t=t.next)e++;return e}get isEmpty(){return null===this.head}get first(){return this.head&&this.head.data}get last(){return this.tail&&this.tail.data}fromArray(e){let t=null;this.head=null;for(let n of e){const e=Kt.createItem(n);null!==t?t.next=e:this.head=e,e.prev=t,t=e}return this.tail=t,this}toArray(){return[...this]}toJSON(){return[...this]}forEach(e,t=this){const n=this.allocateCursor(null,this.head);for(;null!==n.next;){const r=n.next;n.next=r.next,e.call(t,r.data,r,this)}this.releaseCursor()}forEachRight(e,t=this){const n=this.allocateCursor(this.tail,null);for(;null!==n.prev;){const r=n.prev;n.prev=r.prev,e.call(t,r.data,r,this)}this.releaseCursor()}reduce(e,t,n=this){let r,i=this.allocateCursor(null,this.head),o=t;for(;null!==i.next;)r=i.next,i.next=r.next,o=e.call(n,o,r.data,r,this);return this.releaseCursor(),o}reduceRight(e,t,n=this){let r,i=this.allocateCursor(this.tail,null),o=t;for(;null!==i.prev;)r=i.prev,i.prev=r.prev,o=e.call(n,o,r.data,r,this);return this.releaseCursor(),o}some(e,t=this){for(let n=this.head;null!==n;n=n.next)if(e.call(t,n.data,n,this))return!0;return!1}map(e,t=this){const n=new Kt;for(let r=this.head;null!==r;r=r.next)n.appendData(e.call(t,r.data,r,this));return n}filter(e,t=this){const n=new Kt;for(let r=this.head;null!==r;r=r.next)e.call(t,r.data,r,this)&&n.appendData(r.data);return n}nextUntil(e,t,n=this){if(null===e)return;const r=this.allocateCursor(null,e);for(;null!==r.next;){const e=r.next;if(r.next=e.next,t.call(n,e.data,e,this))break}this.releaseCursor()}prevUntil(e,t,n=this){if(null===e)return;const r=this.allocateCursor(e,null);for(;null!==r.prev;){const e=r.prev;if(r.prev=e.prev,t.call(n,e.data,e,this))break}this.releaseCursor()}clear(){this.head=null,this.tail=null}copy(){const e=new Kt;for(let t of this)e.appendData(t);return e}prepend(e){return this.updateCursors(null,e,this.head,e),null!==this.head?(this.head.prev=e,e.next=this.head):this.tail=e,this.head=e,this}prependData(e){return this.prepend(Kt.createItem(e))}append(e){return this.insert(e)}appendData(e){return this.insert(Kt.createItem(e))}insert(e,t=null){if(null!==t)if(this.updateCursors(t.prev,e,t,e),null===t.prev){if(this.head!==t)throw new Error("before doesn't belong to list");this.head=e,t.prev=e,e.next=t,this.updateCursors(null,e)}else t.prev.next=e,e.prev=t.prev,t.prev=e,e.next=t;else this.updateCursors(this.tail,e,null,e),null!==this.tail?(this.tail.next=e,e.prev=this.tail):this.head=e,this.tail=e;return this}insertData(e,t){return this.insert(Kt.createItem(e),t)}remove(e){if(this.updateCursors(e,e.prev,e,e.next),null!==e.prev)e.prev.next=e.next;else{if(this.head!==e)throw new Error("item doesn't belong to list");this.head=e.next}if(null!==e.next)e.next.prev=e.prev;else{if(this.tail!==e)throw new Error("item doesn't belong to list");this.tail=e.prev}return e.prev=null,e.next=null,e}push(e){this.insert(Kt.createItem(e))}pop(){return null!==this.tail?this.remove(this.tail):null}unshift(e){this.prepend(Kt.createItem(e))}shift(){return null!==this.head?this.remove(this.head):null}prependList(e){return this.insertList(e,this.head)}appendList(e){return this.insertList(e)}insertList(e,t){return null===e.head||(null!=t?(this.updateCursors(t.prev,e.tail,t,e.head),null!==t.prev?(t.prev.next=e.head,e.head.prev=t.prev):this.head=e.head,t.prev=e.tail,e.tail.next=t):(this.updateCursors(this.tail,e.tail,null,e.head),null!==this.tail?(this.tail.next=e.head,e.head.prev=this.tail):this.head=e.head,this.tail=e.tail),e.head=null,e.tail=null),this}replace(e,t){"head"in t?this.insertList(t,e):this.insert(t,e),this.remove(e)}}function Yt(e){const t={};for(const n of Object.keys(e)){let r=e[n];r&&(Array.isArray(r)||r instanceof Kt?r=r.map(Yt):r.constructor===Object&&(r=Yt(r))),t[n]=r}return t}const Jt=10,Xt=11,Zt=12,en=13,tn=15,nn=16,rn=17,on=18,sn=19,an=21,ln=22,cn=23,hn=24,un=25;function pn(e){return e>=48&&e<=57}function dn(e){return pn(e)||e>=65&&e<=70||e>=97&&e<=102}function mn(e){return e>=65&&e<=90}function fn(e){return function(e){return mn(e)||function(e){return e>=97&&e<=122}(e)}(e)||function(e){return e>=128}(e)||95===e}function gn(e){return fn(e)||pn(e)||45===e}function bn(e){return e>=0&&e<=8||11===e||e>=14&&e<=31||127===e}function kn(e){return 10===e||13===e||12===e}function yn(e){return kn(e)||32===e||9===e}function vn(e,t){return!(92!==e||kn(t)||0===t)}function Sn(e,t,n){return 45===e?fn(t)||45===t||vn(t,n):!!fn(e)||92===e&&vn(e,t)}function wn(e,t,n){return 43===e||45===e?pn(t)?2:46===t&&pn(n)?3:0:46===e?pn(t)?2:0:pn(e)?1:0}function xn(e){return 65279===e||65534===e?1:0}const Cn=new Array(128),An=130;for(let e=0;e<Cn.length;e++)Cn[e]=(yn(e)?An:pn(e)&&131)||fn(e)&&132||bn(e)&&133||e||128;function _n(e){return e<128?Cn[e]:132}function Tn(e,t){return t<e.length?e.charCodeAt(t):0}function Ln(e,t,n){return 13===n&&10===Tn(e,t+1)?2:1}function En(e,t,n){let r=e.charCodeAt(t);return mn(r)&&(r|=32),r===n}function On(e,t,n,r){if(n-t!==r.length||t<0||n>e.length)return!1;for(let i=t;i<n;i++){const n=r.charCodeAt(i-t);let o=e.charCodeAt(i);if(mn(o)&&(o|=32),o!==n)return!1}return!0}function Pn(e,t){for(;t<e.length&&yn(e.charCodeAt(t));t++);return t}function Dn(e,t){for(;t<e.length&&pn(e.charCodeAt(t));t++);return t}function Fn(e,t){if(dn(Tn(e,(t+=2)-1))){for(const n=Math.min(e.length,t+5);t<n&&dn(Tn(e,t));t++);const n=Tn(e,t);yn(n)&&(t+=Ln(e,t,n))}return t}function Mn(e,t){for(;t<e.length;t++){const n=e.charCodeAt(t);if(!gn(n)){if(vn(n,Tn(e,t+1))){t=Fn(e,t)-1;continue}break}}return t}function zn(e,t){let n=e.charCodeAt(t);if((43===n||45===n)&&(n=e.charCodeAt(t+=1)),pn(n)&&(t=Dn(e,t+1),n=e.charCodeAt(t)),46===n&&pn(e.charCodeAt(t+1))&&(t=Dn(e,t+=2)),En(e,t,101)){let r=0;n=e.charCodeAt(t+1),(45===n||43===n)&&(r=1,n=e.charCodeAt(t+2)),pn(n)&&(t=Dn(e,t+1+r+1))}return t}function jn(e,t){for(;t<e.length;t++){const n=e.charCodeAt(t);if(41===n){t++;break}vn(n,Tn(e,t+1))&&(t=Fn(e,t))}return t}function In(e){if(1===e.length&&!dn(e.charCodeAt(0)))return e[0];let t=parseInt(e,16);return(0===t||t>=55296&&t<=57343||t>1114111)&&(t=65533),String.fromCodePoint(t)}const Nn=["EOF-token","ident-token","function-token","at-keyword-token","hash-token","string-token","bad-string-token","url-token","bad-url-token","delim-token","number-token","percentage-token","dimension-token","whitespace-token","CDO-token","CDC-token","colon-token","semicolon-token","comma-token","[-token","]-token","(-token",")-token","{-token","}-token","comment-token"];function Rn(e=null,t){return null===e||e.length<t?new Uint32Array(Math.max(t+1024,16384)):e}function Bn(e){const t=e.source,n=t.length,r=t.length>0?xn(t.charCodeAt(0)):0,i=Rn(e.lines,n),o=Rn(e.columns,n);let s=e.startLine,a=e.startColumn;for(let e=r;e<n;e++){const r=t.charCodeAt(e);i[e]=s,o[e]=a++,(10===r||13===r||12===r)&&(13===r&&e+1<n&&10===t.charCodeAt(e+1)&&(e++,i[e]=s,o[e]=a),s++,a=1)}i[n]=s,o[n]=a,e.lines=i,e.columns=o,e.computed=!0}class $n{constructor(e,t,n,r){this.setSource(e,t,n,r),this.lines=null,this.columns=null}setSource(e="",t=0,n=1,r=1){this.source=e,this.startOffset=t,this.startLine=n,this.startColumn=r,this.computed=!1}getLocation(e,t){return this.computed||Bn(this),{source:t,offset:this.startOffset+e,line:this.lines[e],column:this.columns[e]}}getLocationRange(e,t,n){return this.computed||Bn(this),{source:n,start:{offset:this.startOffset+e,line:this.lines[e],column:this.columns[e]},end:{offset:this.startOffset+t,line:this.lines[t],column:this.columns[t]}}}}const Un=16777215,Wn=24,Vn=new Uint8Array(32);function Hn(e){return 0!==Vn[e]}Vn[2]=ln,Vn[an]=ln,Vn[sn]=20,Vn[cn]=hn;class qn{constructor(e,t){this.setSource(e,t)}reset(){this.eof=!1,this.tokenIndex=-1,this.tokenType=0,this.tokenStart=this.firstCharOffset,this.tokenEnd=this.firstCharOffset}setSource(e="",t=()=>{}){const n=(e=String(e||"")).length,r=Rn(this.offsetAndType,e.length+1),i=Rn(this.balance,e.length+1);let o=0,s=-1,a=0,l=e.length;this.offsetAndType=null,this.balance=null,i.fill(0),t(e,(e,t,n)=>{const c=o++;if(r[c]=e<<Wn|n,-1===s&&(s=t),i[c]=l,e===a){const e=i[l];i[l]=c,l=e,a=Vn[r[e]>>Wn]}else Hn(e)&&(l=c,a=Vn[e])}),r[o]=0|n,i[o]=o;for(let e=0;e<o;e++){const t=i[e];if(t<=e){const n=i[t];n!==e&&(i[e]=n)}else t>o&&(i[e]=o)}this.source=e,this.firstCharOffset=-1===s?0:s,this.tokenCount=o,this.offsetAndType=r,this.balance=i,this.reset(),this.next()}lookupType(e){return(e+=this.tokenIndex)<this.tokenCount?this.offsetAndType[e]>>Wn:0}lookupTypeNonSC(e){for(let t=this.tokenIndex;t<this.tokenCount;t++){const n=this.offsetAndType[t]>>Wn;if(n!==en&&n!==un&&0===e--)return n}return 0}lookupOffset(e){return(e+=this.tokenIndex)<this.tokenCount?this.offsetAndType[e-1]&Un:this.source.length}lookupOffsetNonSC(e){for(let t=this.tokenIndex;t<this.tokenCount;t++){const n=this.offsetAndType[t]>>Wn;if(n!==en&&n!==un&&0===e--)return t-this.tokenIndex}return 0}lookupValue(e,t){return(e+=this.tokenIndex)<this.tokenCount&&On(this.source,this.offsetAndType[e-1]&Un,this.offsetAndType[e]&Un,t)}getTokenStart(e){return e===this.tokenIndex?this.tokenStart:e>0?e<this.tokenCount?this.offsetAndType[e-1]&Un:this.offsetAndType[this.tokenCount]&Un:this.firstCharOffset}substrToCursor(e){return this.source.substring(e,this.tokenStart)}isBalanceEdge(e){return this.balance[this.tokenIndex]<e}isDelim(e,t){return t?9===this.lookupType(t)&&this.source.charCodeAt(this.lookupOffset(t))===e:9===this.tokenType&&this.source.charCodeAt(this.tokenStart)===e}skip(e){let t=this.tokenIndex+e;t<this.tokenCount?(this.tokenIndex=t,this.tokenStart=this.offsetAndType[t-1]&Un,t=this.offsetAndType[t],this.tokenType=t>>Wn,this.tokenEnd=t&Un):(this.tokenIndex=this.tokenCount,this.next())}next(){let e=this.tokenIndex+1;e<this.tokenCount?(this.tokenIndex=e,this.tokenStart=this.tokenEnd,e=this.offsetAndType[e],this.tokenType=e>>Wn,this.tokenEnd=e&Un):(this.eof=!0,this.tokenIndex=this.tokenCount,this.tokenType=0,this.tokenStart=this.tokenEnd=this.source.length)}skipSC(){for(;this.tokenType===en||this.tokenType===un;)this.next()}skipUntilBalanced(e,t){let n=e,r=0,i=0;e:for(;n<this.tokenCount&&(r=this.balance[n],!(r<e));n++)switch(i=n>0?this.offsetAndType[n-1]&Un:this.firstCharOffset,t(this.source.charCodeAt(i))){case 1:break e;case 2:n++;break e;default:Hn(this.offsetAndType[n]>>Wn)&&(n=r)}this.skip(n-this.tokenIndex)}forEachToken(e){for(let t=0,n=this.firstCharOffset;t<this.tokenCount;t++){const r=n,i=this.offsetAndType[t],o=i&Un;n=o,e(i>>Wn,r,o,t)}}dump(){const e=new Array(this.tokenCount);return this.forEachToken((t,n,r,i)=>{e[i]={idx:i,type:Nn[t],chunk:this.source.substring(n,r),balance:this.balance[i]}}),e}}function Qn(e,t){function n(t){return t<s?e.charCodeAt(t):0}function r(){return c=zn(e,c),Sn(n(c),n(c+1),n(c+2))?(a=Zt,void(c=Mn(e,c))):37===n(c)?(a=Xt,void c++):void(a=Jt)}function i(){const t=c;return c=Mn(e,c),On(e,t,c,"url")&&40===n(c)?(c=Pn(e,c+1),34===n(c)||39===n(c)?(a=2,void(c=t+4)):void function(){for(a=7,c=Pn(e,c);c<e.length;c++){const t=e.charCodeAt(c);switch(_n(t)){case 41:return void c++;case An:return c=Pn(e,c),41===n(c)||c>=e.length?void(c<e.length&&c++):(c=jn(e,c),void(a=8));case 34:case 39:case 40:case 133:return c=jn(e,c),void(a=8);case 92:if(vn(t,n(c+1))){c=Fn(e,c)-1;break}return c=jn(e,c),void(a=8)}}}()):40===n(c)?(a=2,void c++):void(a=1)}function o(t){for(t||(t=n(c++)),a=5;c<e.length;c++){const r=e.charCodeAt(c);switch(_n(r)){case t:return void c++;case An:if(kn(r))return c+=Ln(e,c,r),void(a=6);break;case 92:if(c===e.length-1)break;const i=n(c+1);kn(i)?c+=Ln(e,c+1,i):vn(r,i)&&(c=Fn(e,c)-1)}}}const s=(e=String(e||"")).length;let a,l=xn(n(0)),c=l;for(;c<s;){const s=e.charCodeAt(c);switch(_n(s)){case An:a=en,c=Pn(e,c+1);break;case 34:o();break;case 35:gn(n(c+1))||vn(n(c+1),n(c+2))?(a=4,c=Mn(e,c+1)):(a=9,c++);break;case 39:o();break;case 40:a=an,c++;break;case 41:a=ln,c++;break;case 43:wn(s,n(c+1),n(c+2))?r():(a=9,c++);break;case 44:a=on,c++;break;case 45:wn(s,n(c+1),n(c+2))?r():45===n(c+1)&&62===n(c+2)?(a=tn,c+=3):Sn(s,n(c+1),n(c+2))?i():(a=9,c++);break;case 46:wn(s,n(c+1),n(c+2))?r():(a=9,c++);break;case 47:42===n(c+1)?(a=un,c=e.indexOf("*/",c+2),c=-1===c?e.length:c+2):(a=9,c++);break;case 58:a=nn,c++;break;case 59:a=rn,c++;break;case 60:33===n(c+1)&&45===n(c+2)&&45===n(c+3)?(a=14,c+=4):(a=9,c++);break;case 64:Sn(n(c+1),n(c+2),n(c+3))?(a=3,c=Mn(e,c+1)):(a=9,c++);break;case 91:a=sn,c++;break;case 92:vn(s,n(c+1))?i():(a=9,c++);break;case 93:a=20,c++;break;case 123:a=cn,c++;break;case 125:a=hn,c++;break;case 131:r();break;case 132:i();break;default:a=9,c++}t(a,l,l=c)}}function Gn(e){const t=e.length,n=e.charCodeAt(0),r=34===n||39===n?1:0,i=1===r&&t>1&&e.charCodeAt(t-1)===n?t-2:t-1;let o="";for(let n=r;n<=i;n++){let r=e.charCodeAt(n);if(92===r){if(n===i){n!==t-1&&(o=e.substr(n+1));break}if(r=e.charCodeAt(++n),vn(92,r)){const t=n-1,r=Fn(e,t);n=r-1,o+=In(e.substring(t+1,r))}else 13===r&&10===e.charCodeAt(n+1)&&n++}else o+=e[n]}return o}const{hasOwnProperty:Kn}=Object.prototype,Yn=function(){};function Jn(e){return"function"==typeof e?e:Yn}function Xn(e,t){return function(n,r,i){n.type===t&&e.call(this,n,r,i)}}function Zn(e,t){const n=t.structure,r=[];for(const e in n){if(!1===Kn.call(n,e))continue;let t=n[e];const i={name:e,type:!1,nullable:!1};Array.isArray(t)||(t=[t]);for(const e of t)null===e?i.nullable=!0:"string"==typeof e?i.type="node":Array.isArray(e)&&(i.type="list");i.type&&r.push(i)}return r.length?{context:t.walkContext,fields:r}:null}function er(e,t){const n=e.fields.slice(),r=e.context,i="string"==typeof r;return t&&n.reverse(),function(e,o,s,a){let l;i&&(l=o[r],o[r]=e);for(const r of n){const n=e[r.name];if(!r.nullable||n)if("list"===r.type){if(t?n.reduceRight(a,!1):n.reduce(a,!1))return!0}else if(s(n))return!0}i&&(o[r]=l)}}function tr({StyleSheet:e,Atrule:t,Rule:n,Block:r,DeclarationList:i}){return{Atrule:{StyleSheet:e,Atrule:t,Rule:n,Block:r},Rule:{StyleSheet:e,Atrule:t,Rule:n,Block:r},Declaration:{StyleSheet:e,Atrule:t,Rule:n,Block:r,DeclarationList:i}}}const nr=43,rr=45,ir=110,or=!0;function sr(e,t){let n=this.tokenStart+e;const r=this.charCodeAt(n);for((r===nr||r===rr)&&(t&&this.error("Number sign is not allowed"),n++);n<this.tokenEnd;n++)pn(this.charCodeAt(n))||this.error("Integer is expected",n)}function ar(e){return sr.call(this,0,e)}function lr(e,t){if(!this.cmpChar(this.tokenStart+e,t)){let n="";switch(t){case ir:n="N is expected";break;case rr:n="HyphenMinus is expected"}this.error(n,this.tokenStart+e)}}function cr(){let e=0,t=0,n=this.tokenType;for(;n===en||n===un;)n=this.lookupType(++e);if(n!==Jt){if(!this.isDelim(nr,e)&&!this.isDelim(rr,e))return null;t=this.isDelim(nr,e)?nr:rr;do{n=this.lookupType(++e)}while(n===en||n===un);n!==Jt&&(this.skip(e),ar.call(this,or))}return e>0&&this.skip(e),0===t&&(n=this.charCodeAt(this.tokenStart),n!==nr&&n!==rr&&this.error("Number sign is expected")),ar.call(this,0!==t),t===rr?"-"+this.consume(Jt):this.consume(Jt)}const hr={a:[String,null],b:[String,null]};function ur(){const e=this.tokenStart;let t=null,n=null;if(this.tokenType===Jt)ar.call(this,false),n=this.consume(Jt);else if(1===this.tokenType&&this.cmpChar(this.tokenStart,rr))switch(t="-1",lr.call(this,1,ir),this.tokenEnd-this.tokenStart){case 2:this.next(),n=cr.call(this);break;case 3:lr.call(this,2,rr),this.next(),this.skipSC(),ar.call(this,or),n="-"+this.consume(Jt);break;default:lr.call(this,2,rr),sr.call(this,3,or),this.next(),n=this.substrToCursor(e+2)}else if(1===this.tokenType||this.isDelim(nr)&&1===this.lookupType(1)){let r=0;switch(t="1",this.isDelim(nr)&&(r=1,this.next()),lr.call(this,0,ir),this.tokenEnd-this.tokenStart){case 1:this.next(),n=cr.call(this);break;case 2:lr.call(this,1,rr),this.next(),this.skipSC(),ar.call(this,or),n="-"+this.consume(Jt);break;default:lr.call(this,1,rr),sr.call(this,2,or),this.next(),n=this.substrToCursor(e+r+1)}}else if(this.tokenType===Zt){const r=this.charCodeAt(this.tokenStart),i=r===nr||r===rr;let o=this.tokenStart+i;for(;o<this.tokenEnd&&pn(this.charCodeAt(o));o++);o===this.tokenStart+i&&this.error("Integer is expected",this.tokenStart+i),lr.call(this,o-this.tokenStart,ir),t=this.substring(e,o),o+1===this.tokenEnd?(this.next(),n=cr.call(this)):(lr.call(this,o-this.tokenStart+1,rr),o+2===this.tokenEnd?(this.next(),this.skipSC(),ar.call(this,or),n="-"+this.consume(Jt)):(sr.call(this,o-this.tokenStart+2,or),this.next(),n=this.substrToCursor(o+1)))}else this.error();return null!==t&&t.charCodeAt(0)===nr&&(t=t.substr(1)),null!==n&&n.charCodeAt(0)===nr&&(n=n.substr(1)),{type:"AnPlusB",loc:this.getLocation(e,this.tokenStart),a:t,b:n}}function pr(e){if(e.a){const t=("+1"===e.a||"1"===e.a?"n":"-1"===e.a&&"-n")||e.a+"n";if(e.b){const n="-"===e.b[0]||"+"===e.b[0]?e.b:"+"+e.b;this.tokenize(t+n)}else this.tokenize(t)}else this.tokenize(e.b)}const dr=Object.freeze(Object.defineProperty({__proto__:null,generate:pr,name:"AnPlusB",parse:ur,structure:hr},Symbol.toStringTag,{value:"Module"}));function mr(){return this.Raw(this.consumeUntilLeftCurlyBracketOrSemicolon,!0)}function fr(){for(let e,t=1;e=this.lookupType(t);t++){if(e===hn)return!0;if(e===cn||3===e)return!1}return!1}const gr={name:String,prelude:["AtrulePrelude","Raw",null],block:["Block",null]};function br(e=!1){const t=this.tokenStart;let n,r,i=null,o=null;switch(this.eat(3),n=this.substrToCursor(t+1),r=n.toLowerCase(),this.skipSC(),!1===this.eof&&this.tokenType!==cn&&this.tokenType!==rn&&(i=this.parseAtrulePrelude?this.parseWithFallback(this.AtrulePrelude.bind(this,n,e),mr):mr.call(this,this.tokenIndex),this.skipSC()),this.tokenType){case rn:this.next();break;case cn:o=hasOwnProperty.call(this.atrule,r)&&"function"==typeof this.atrule[r].block?this.atrule[r].block.call(this,e):this.Block(fr.call(this))}return{type:"Atrule",loc:this.getLocation(t,this.tokenStart),name:n,prelude:i,block:o}}function kr(e){this.token(3,"@"+e.name),null!==e.prelude&&this.node(e.prelude),e.block?this.node(e.block):this.token(rn,";")}const yr=Object.freeze(Object.defineProperty({__proto__:null,generate:kr,name:"Atrule",parse:br,structure:gr,walkContext:"atrule"},Symbol.toStringTag,{value:"Module"}));function vr(e){let t=null;return null!==e&&(e=e.toLowerCase()),this.skipSC(),t=hasOwnProperty.call(this.atrule,e)&&"function"==typeof this.atrule[e].prelude?this.atrule[e].prelude.call(this):this.readSequence(this.scope.AtrulePrelude),this.skipSC(),!0!==this.eof&&this.tokenType!==cn&&this.tokenType!==rn&&this.error("Semicolon or block is expected"),{type:"AtrulePrelude",loc:this.getLocationFromList(t),children:t}}function Sr(e){this.children(e)}const wr=Object.freeze(Object.defineProperty({__proto__:null,generate:Sr,name:"AtrulePrelude",parse:vr,structure:{children:[[]]},walkContext:"atrulePrelude"},Symbol.toStringTag,{value:"Module"}));function xr(){this.eof&&this.error("Unexpected end of input");const e=this.tokenStart;let t=!1;return this.isDelim(42)?(t=!0,this.next()):this.isDelim(124)||this.eat(1),this.isDelim(124)?61!==this.charCodeAt(this.tokenStart+1)?(this.next(),this.eat(1)):t&&this.error("Identifier is expected",this.tokenEnd):t&&this.error("Vertical line is expected"),{type:"Identifier",loc:this.getLocation(e,this.tokenStart),name:this.substrToCursor(e)}}function Cr(){const e=this.tokenStart,t=this.charCodeAt(e);return 61!==t&&126!==t&&94!==t&&36!==t&&42!==t&&124!==t&&this.error("Attribute selector (=, ~=, ^=, $=, *=, |=) is expected"),this.next(),61!==t&&(this.isDelim(61)||this.error("Equal sign is expected"),this.next()),this.substrToCursor(e)}const Ar={name:"Identifier",matcher:[String,null],value:["String","Identifier",null],flags:[String,null]};function _r(){const e=this.tokenStart;let t,n=null,r=null,i=null;return this.eat(sn),this.skipSC(),t=xr.call(this),this.skipSC(),20!==this.tokenType&&(1!==this.tokenType&&(n=Cr.call(this),this.skipSC(),r=5===this.tokenType?this.String():this.Identifier(),this.skipSC()),1===this.tokenType&&(i=this.consume(1),this.skipSC())),this.eat(20),{type:"AttributeSelector",loc:this.getLocation(e,this.tokenStart),name:t,matcher:n,value:r,flags:i}}function Tr(e){this.token(9,"["),this.node(e.name),null!==e.matcher&&(this.tokenize(e.matcher),this.node(e.value)),null!==e.flags&&this.token(1,e.flags),this.token(9,"]")}const Lr=Object.freeze(Object.defineProperty({__proto__:null,generate:Tr,name:"AttributeSelector",parse:_r,structure:Ar},Symbol.toStringTag,{value:"Module"}));function Er(){return this.Raw(null,!0)}function Or(){return this.parseWithFallback(this.Rule,Er)}function Pr(){return this.Raw(this.consumeUntilSemicolonIncluded,!0)}function Dr(){if(this.tokenType===rn)return Pr.call(this,this.tokenIndex);const e=this.parseWithFallback(this.Declaration,Pr);return this.tokenType===rn&&this.next(),e}function Fr(e){const t=e?Dr:Or,n=this.tokenStart;let r=this.createList();this.eat(cn);e:for(;!this.eof;)switch(this.tokenType){case hn:break e;case en:case un:this.next();break;case 3:r.push(this.parseWithFallback(this.Atrule.bind(this,e),Er));break;default:e&&this.isDelim(38)?r.push(Or.call(this)):r.push(t.call(this))}return this.eof||this.eat(hn),{type:"Block",loc:this.getLocation(n,this.tokenStart),children:r}}function Mr(e){this.token(cn,"{"),this.children(e,e=>{"Declaration"===e.type&&this.token(rn,";")}),this.token(hn,"}")}const zr=Object.freeze(Object.defineProperty({__proto__:null,generate:Mr,name:"Block",parse:Fr,structure:{children:[["Atrule","Rule","Declaration"]]},walkContext:"block"},Symbol.toStringTag,{value:"Module"}));function jr(e,t){const n=this.tokenStart;let r=null;return this.eat(sn),r=e.call(this,t),this.eof||this.eat(20),{type:"Brackets",loc:this.getLocation(n,this.tokenStart),children:r}}function Ir(e){this.token(9,"["),this.children(e),this.token(9,"]")}const Nr=Object.freeze(Object.defineProperty({__proto__:null,generate:Ir,name:"Brackets",parse:jr,structure:{children:[[]]}},Symbol.toStringTag,{value:"Module"}));function Rr(){const e=this.tokenStart;return this.eat(tn),{type:"CDC",loc:this.getLocation(e,this.tokenStart)}}function Br(){this.token(tn,"--\x3e")}const $r=Object.freeze(Object.defineProperty({__proto__:null,generate:Br,name:"CDC",parse:Rr,structure:[]},Symbol.toStringTag,{value:"Module"}));function Ur(){const e=this.tokenStart;return this.eat(14),{type:"CDO",loc:this.getLocation(e,this.tokenStart)}}function Wr(){this.token(14,"\x3c!--")}const Vr=Object.freeze(Object.defineProperty({__proto__:null,generate:Wr,name:"CDO",parse:Ur,structure:[]},Symbol.toStringTag,{value:"Module"})),Hr={name:String};function qr(){return this.eatDelim(46),{type:"ClassSelector",loc:this.getLocation(this.tokenStart-1,this.tokenEnd),name:this.consume(1)}}function Qr(e){this.token(9,"."),this.token(1,e.name)}const Gr=Object.freeze(Object.defineProperty({__proto__:null,generate:Qr,name:"ClassSelector",parse:qr,structure:Hr},Symbol.toStringTag,{value:"Module"})),Kr={name:String};function Yr(){const e=this.tokenStart;let t;switch(this.tokenType){case en:t=" ";break;case 9:switch(this.charCodeAt(this.tokenStart)){case 62:case 43:case 126:this.next();break;case 47:this.next(),this.eatIdent("deep"),this.eatDelim(47);break;default:this.error("Combinator is expected")}t=this.substrToCursor(e)}return{type:"Combinator",loc:this.getLocation(e,this.tokenStart),name:t}}function Jr(e){this.tokenize(e.name)}const Xr=Object.freeze(Object.defineProperty({__proto__:null,generate:Jr,name:"Combinator",parse:Yr,structure:Kr},Symbol.toStringTag,{value:"Module"})),Zr={value:String};function ei(){const e=this.tokenStart;let t=this.tokenEnd;return this.eat(un),t-e+2>=2&&42===this.charCodeAt(t-2)&&47===this.charCodeAt(t-1)&&(t-=2),{type:"Comment",loc:this.getLocation(e,this.tokenStart),value:this.substring(e+2,t)}}function ti(e){this.token(un,"/*"+e.value+"*/")}const ni=Object.freeze(Object.defineProperty({__proto__:null,generate:ti,name:"Comment",parse:ei,structure:Zr},Symbol.toStringTag,{value:"Module"})),ri=new Set([nn,ln,0]),ii={kind:String,children:[["Identifier","Feature","FeatureFunction","FeatureRange","SupportsDeclaration"]]};function oi(e){return 1===this.lookupTypeNonSC(1)&&ri.has(this.lookupTypeNonSC(2))?this.Feature(e):this.FeatureRange(e)}const si={media:oi,container:oi,supports(){return this.SupportsDeclaration()}};function ai(e="media"){const t=this.createList();e:for(;!this.eof;)switch(this.tokenType){case un:case en:this.next();continue;case 1:t.push(this.Identifier());break;case an:{let n=this.parseWithFallback(()=>si[e].call(this,e),()=>null);n||(n=this.parseWithFallback(()=>{this.eat(an);const t=this.Condition(e);return this.eat(ln),t},()=>this.GeneralEnclosed(e))),t.push(n);break}case 2:{let n=this.parseWithFallback(()=>this.FeatureFunction(e),()=>null);n||(n=this.GeneralEnclosed(e)),t.push(n);break}default:break e}return t.isEmpty&&this.error("Condition is expected"),{type:"Condition",loc:this.getLocationFromList(t),kind:e,children:t}}function li(e){e.children.forEach(e=>{"Condition"===e.type?(this.token(an,"("),this.node(e),this.token(ln,")")):this.node(e)})}const ci=Object.freeze(Object.defineProperty({__proto__:null,generate:li,name:"Condition",parse:ai,structure:ii},Symbol.toStringTag,{value:"Module"}));function hi(){return this.Raw(this.consumeUntilExclamationMarkOrSemicolon,!0)}function ui(){return this.Raw(this.consumeUntilExclamationMarkOrSemicolon,!1)}function pi(){const e=this.tokenIndex,t=this.Value();return"Raw"!==t.type&&!1===this.eof&&this.tokenType!==rn&&!1===this.isDelim(33)&&!1===this.isBalanceEdge(e)&&this.error(),t}const di={important:[Boolean,String],property:String,value:["Value","Raw"]};function mi(){const e=this.tokenStart,t=this.tokenIndex,n=gi.call(this),r=function(e,t){return t=t||0,e.length-t>=2&&45===e.charCodeAt(t)&&45===e.charCodeAt(t+1)}(n),i=r?this.parseCustomProperty:this.parseValue,o=r?ui:hi;let s,a=!1;this.skipSC(),this.eat(nn);const l=this.tokenIndex;if(r||this.skipSC(),s=i?this.parseWithFallback(pi,o):o.call(this,this.tokenIndex),r&&"Value"===s.type&&s.children.isEmpty)for(let e=l-this.tokenIndex;e<=0;e++)if(this.lookupType(e)===en){s.children.appendData({type:"WhiteSpace",loc:null,value:" "});break}return this.isDelim(33)&&(a=bi.call(this),this.skipSC()),!1===this.eof&&this.tokenType!==rn&&!1===this.isBalanceEdge(t)&&this.error(),{type:"Declaration",loc:this.getLocation(e,this.tokenStart),important:a,property:n,value:s}}function fi(e){this.token(1,e.property),this.token(nn,":"),this.node(e.value),e.important&&(this.token(9,"!"),this.token(1,!0===e.important?"important":e.important))}function gi(){const e=this.tokenStart;if(9===this.tokenType)switch(this.charCodeAt(this.tokenStart)){case 42:case 36:case 43:case 35:case 38:this.next();break;case 47:this.next(),this.isDelim(47)&&this.next()}return 4===this.tokenType?this.eat(4):this.eat(1),this.substrToCursor(e)}function bi(){this.eat(9),this.skipSC();const e=this.consume(1);return"important"===e||e}const ki=Object.freeze(Object.defineProperty({__proto__:null,generate:fi,name:"Declaration",parse:mi,structure:di,walkContext:"declaration"},Symbol.toStringTag,{value:"Module"}));function yi(){return this.Raw(this.consumeUntilSemicolonIncluded,!0)}function vi(){const e=this.createList();for(;!this.eof;)switch(this.tokenType){case en:case un:case rn:this.next();break;case 3:e.push(this.parseWithFallback(this.Atrule.bind(this,!0),yi));break;default:this.isDelim(38)?e.push(this.parseWithFallback(this.Rule,yi)):e.push(this.parseWithFallback(this.Declaration,yi))}return{type:"DeclarationList",loc:this.getLocationFromList(e),children:e}}function Si(e){this.children(e,e=>{"Declaration"===e.type&&this.token(rn,";")})}const wi=Object.freeze(Object.defineProperty({__proto__:null,generate:Si,name:"DeclarationList",parse:vi,structure:{children:[["Declaration","Atrule","Rule"]]}},Symbol.toStringTag,{value:"Module"})),xi={value:String,unit:String};function Ci(){const e=this.tokenStart,t=this.consumeNumber(Zt);return{type:"Dimension",loc:this.getLocation(e,this.tokenStart),value:t,unit:this.substring(e+t.length,this.tokenStart)}}function Ai(e){this.token(Zt,e.value+e.unit)}const _i=Object.freeze(Object.defineProperty({__proto__:null,generate:Ai,name:"Dimension",parse:Ci,structure:xi},Symbol.toStringTag,{value:"Module"})),Ti={kind:String,name:String,value:["Identifier","Number","Dimension","Ratio","Function",null]};function Li(e){const t=this.tokenStart;let n,r=null;if(this.eat(an),this.skipSC(),n=this.consume(1),this.skipSC(),this.tokenType!==ln){switch(this.eat(nn),this.skipSC(),this.tokenType){case Jt:r=9===this.lookupNonWSType(1)?this.Ratio():this.Number();break;case Zt:r=this.Dimension();break;case 1:r=this.Identifier();break;case 2:r=this.parseWithFallback(()=>{const e=this.Function(this.readSequence,this.scope.Value);return this.skipSC(),this.isDelim(47)&&this.error(),e},()=>this.Ratio());break;default:this.error("Number, dimension, ratio or identifier is expected")}this.skipSC()}return this.eof||this.eat(ln),{type:"Feature",loc:this.getLocation(t,this.tokenStart),kind:e,name:n,value:r}}function Ei(e){this.token(an,"("),this.token(1,e.name),null!==e.value&&(this.token(nn,":"),this.node(e.value)),this.token(ln,")")}const Oi=Object.freeze(Object.defineProperty({__proto__:null,generate:Ei,name:"Feature",parse:Li,structure:Ti},Symbol.toStringTag,{value:"Module"})),Pi={kind:String,feature:String,value:["Declaration","Selector"]};function Di(e,t){const n=(this.features[e]||{})[t];return"function"!=typeof n&&this.error(`Unknown feature ${t}()`),n}function Fi(e="unknown"){const t=this.tokenStart,n=this.consumeFunctionName(),r=Di.call(this,e,n.toLowerCase());this.skipSC();const i=this.parseWithFallback(()=>{const e=this.tokenIndex,t=r.call(this);return!1===this.eof&&!1===this.isBalanceEdge(e)&&this.error(),t},()=>this.Raw(null,!1));return this.eof||this.eat(ln),{type:"FeatureFunction",loc:this.getLocation(t,this.tokenStart),kind:e,feature:n,value:i}}function Mi(e){this.token(2,e.feature+"("),this.node(e.value),this.token(ln,")")}const zi=Object.freeze(Object.defineProperty({__proto__:null,generate:Mi,name:"FeatureFunction",parse:Fi,structure:Pi},Symbol.toStringTag,{value:"Module"})),ji={kind:String,left:["Identifier","Number","Dimension","Ratio","Function"],leftComparison:String,middle:["Identifier","Number","Dimension","Ratio","Function"],rightComparison:[String,null],right:["Identifier","Number","Dimension","Ratio","Function",null]};function Ii(){switch(this.skipSC(),this.tokenType){case Jt:return this.isDelim(47,this.lookupOffsetNonSC(1))?this.Ratio():this.Number();case Zt:return this.Dimension();case 1:return this.Identifier();case 2:return this.parseWithFallback(()=>{const e=this.Function(this.readSequence,this.scope.Value);return this.skipSC(),this.isDelim(47)&&this.error(),e},()=>this.Ratio());default:this.error("Number, dimension, ratio or identifier is expected")}}function Ni(e){if(this.skipSC(),this.isDelim(60)||this.isDelim(62)){const e=this.source[this.tokenStart];return this.next(),this.isDelim(61)?(this.next(),e+"="):e}if(this.isDelim(61))return"=";this.error(`Expected ${e?'":", ':""}"<", ">", "=" or ")"`)}function Ri(e="unknown"){const t=this.tokenStart;this.skipSC(),this.eat(an);const n=Ii.call(this),r=Ni.call(this,"Identifier"===n.type),i=Ii.call(this);let o=null,s=null;return this.lookupNonWSType(0)!==ln&&(o=Ni.call(this),s=Ii.call(this)),this.skipSC(),this.eat(ln),{type:"FeatureRange",loc:this.getLocation(t,this.tokenStart),kind:e,left:n,leftComparison:r,middle:i,rightComparison:o,right:s}}function Bi(e){this.token(an,"("),this.node(e.left),this.tokenize(e.leftComparison),this.node(e.middle),e.right&&(this.tokenize(e.rightComparison),this.node(e.right)),this.token(ln,")")}const $i=Object.freeze(Object.defineProperty({__proto__:null,generate:Bi,name:"FeatureRange",parse:Ri,structure:ji},Symbol.toStringTag,{value:"Module"})),Ui={name:String,children:[[]]};function Wi(e,t){const n=this.tokenStart,r=this.consumeFunctionName(),i=r.toLowerCase();let o;return o=t.hasOwnProperty(i)?t[i].call(this,t):e.call(this,t),this.eof||this.eat(ln),{type:"Function",loc:this.getLocation(n,this.tokenStart),name:r,children:o}}function Vi(e){this.token(2,e.name+"("),this.children(e),this.token(ln,")")}const Hi=Object.freeze(Object.defineProperty({__proto__:null,generate:Vi,name:"Function",parse:Wi,structure:Ui,walkContext:"function"},Symbol.toStringTag,{value:"Module"})),qi={kind:String,function:[String,null],children:[[]]};function Qi(e){const t=this.tokenStart;let n=null;2===this.tokenType?n=this.consumeFunctionName():this.eat(an);const r=this.parseWithFallback(()=>{const e=this.tokenIndex,t=this.readSequence(this.scope.Value);return!1===this.eof&&!1===this.isBalanceEdge(e)&&this.error(),t},()=>this.createSingleNodeList(this.Raw(null,!1)));return this.eof||this.eat(ln),{type:"GeneralEnclosed",loc:this.getLocation(t,this.tokenStart),kind:e,function:n,children:r}}function Gi(e){e.function?this.token(2,e.function+"("):this.token(an,"("),this.children(e),this.token(ln,")")}const Ki=Object.freeze(Object.defineProperty({__proto__:null,generate:Gi,name:"GeneralEnclosed",parse:Qi,structure:qi},Symbol.toStringTag,{value:"Module"})),Yi={value:String};function Ji(){const e=this.tokenStart;return this.eat(4),{type:"Hash",loc:this.getLocation(e,this.tokenStart),value:this.substrToCursor(e+1)}}function Xi(e){this.token(4,"#"+e.value)}const Zi=Object.freeze(Object.defineProperty({__proto__:null,generate:Xi,name:"Hash",parse:Ji,structure:Yi,xxx:"XXX"},Symbol.toStringTag,{value:"Module"})),eo={name:String};function to(){return{type:"Identifier",loc:this.getLocation(this.tokenStart,this.tokenEnd),name:this.consume(1)}}function no(e){this.token(1,e.name)}const ro=Object.freeze(Object.defineProperty({__proto__:null,generate:no,name:"Identifier",parse:to,structure:eo},Symbol.toStringTag,{value:"Module"})),io={name:String};function oo(){const e=this.tokenStart;return this.eat(4),{type:"IdSelector",loc:this.getLocation(e,this.tokenStart),name:this.substrToCursor(e+1)}}function so(e){this.token(9,"#"+e.name)}const ao=Object.freeze(Object.defineProperty({__proto__:null,generate:so,name:"IdSelector",parse:oo,structure:io},Symbol.toStringTag,{value:"Module"})),lo={name:String};function co(){let e=this.tokenStart,t=this.consume(1);for(;this.isDelim(46);)this.eat(9),t+="."+this.consume(1);return{type:"Layer",loc:this.getLocation(e,this.tokenStart),name:t}}function ho(e){this.tokenize(e.name)}const uo=Object.freeze(Object.defineProperty({__proto__:null,generate:ho,name:"Layer",parse:co,structure:lo},Symbol.toStringTag,{value:"Module"}));function po(){const e=this.createList();for(this.skipSC();!this.eof&&(e.push(this.Layer()),this.lookupTypeNonSC(0)===on);)this.skipSC(),this.next(),this.skipSC();return{type:"LayerList",loc:this.getLocationFromList(e),children:e}}function mo(e){this.children(e,()=>this.token(on,","))}const fo=Object.freeze(Object.defineProperty({__proto__:null,generate:mo,name:"LayerList",parse:po,structure:{children:[["Layer"]]}},Symbol.toStringTag,{value:"Module"})),go={modifier:[String,null],mediaType:[String,null],condition:["Condition",null]};function bo(){const e=this.tokenStart;let t=null,n=null,r=null;if(this.skipSC(),1===this.tokenType&&this.lookupTypeNonSC(1)!==an){const e=this.consume(1),i=e.toLowerCase();switch("not"===i||"only"===i?(this.skipSC(),t=i,n=this.consume(1)):n=e,this.lookupTypeNonSC(0)){case 1:this.skipSC(),this.eatIdent("and"),r=this.Condition("media");break;case cn:case rn:case on:case 0:break;default:this.error("Identifier or parenthesis is expected")}}else switch(this.tokenType){case 1:case an:case 2:r=this.Condition("media");break;case cn:case rn:case 0:break;default:this.error("Identifier or parenthesis is expected")}return{type:"MediaQuery",loc:this.getLocation(e,this.tokenStart),modifier:t,mediaType:n,condition:r}}function ko(e){e.mediaType?(e.modifier&&this.token(1,e.modifier),this.token(1,e.mediaType),e.condition&&(this.token(1,"and"),this.node(e.condition))):e.condition&&this.node(e.condition)}const yo=Object.freeze(Object.defineProperty({__proto__:null,generate:ko,name:"MediaQuery",parse:bo,structure:go},Symbol.toStringTag,{value:"Module"}));function vo(){const e=this.createList();for(this.skipSC();!this.eof&&(e.push(this.MediaQuery()),this.tokenType===on);)this.next();return{type:"MediaQueryList",loc:this.getLocationFromList(e),children:e}}function So(e){this.children(e,()=>this.token(on,","))}const wo=Object.freeze(Object.defineProperty({__proto__:null,generate:So,name:"MediaQueryList",parse:vo,structure:{children:[["MediaQuery"]]}},Symbol.toStringTag,{value:"Module"}));function xo(){const e=this.tokenStart;return this.eatDelim(38),{type:"NestingSelector",loc:this.getLocation(e,this.tokenStart)}}function Co(){this.token(9,"&")}const Ao=Object.freeze(Object.defineProperty({__proto__:null,generate:Co,name:"NestingSelector",parse:xo,structure:{}},Symbol.toStringTag,{value:"Module"}));function _o(){this.skipSC();const e=this.tokenStart;let t,n=e,r=null;return t=this.lookupValue(0,"odd")||this.lookupValue(0,"even")?this.Identifier():this.AnPlusB(),n=this.tokenStart,this.skipSC(),this.lookupValue(0,"of")&&(this.next(),r=this.SelectorList(),n=this.tokenStart),{type:"Nth",loc:this.getLocation(e,n),nth:t,selector:r}}function To(e){this.node(e.nth),null!==e.selector&&(this.token(1,"of"),this.node(e.selector))}const Lo=Object.freeze(Object.defineProperty({__proto__:null,generate:To,name:"Nth",parse:_o,structure:{nth:["AnPlusB","Identifier"],selector:["SelectorList",null]}},Symbol.toStringTag,{value:"Module"})),Eo={value:String};function Oo(){return{type:"Number",loc:this.getLocation(this.tokenStart,this.tokenEnd),value:this.consume(Jt)}}function Po(e){this.token(Jt,e.value)}const Do=Object.freeze(Object.defineProperty({__proto__:null,generate:Po,name:"Number",parse:Oo,structure:Eo},Symbol.toStringTag,{value:"Module"})),Fo={value:String};function Mo(){const e=this.tokenStart;return this.next(),{type:"Operator",loc:this.getLocation(e,this.tokenStart),value:this.substrToCursor(e)}}function zo(e){this.tokenize(e.value)}const jo=Object.freeze(Object.defineProperty({__proto__:null,generate:zo,name:"Operator",parse:Mo,structure:Fo},Symbol.toStringTag,{value:"Module"}));function Io(e,t){const n=this.tokenStart;let r=null;return this.eat(an),r=e.call(this,t),this.eof||this.eat(ln),{type:"Parentheses",loc:this.getLocation(n,this.tokenStart),children:r}}function No(e){this.token(an,"("),this.children(e),this.token(ln,")")}const Ro=Object.freeze(Object.defineProperty({__proto__:null,generate:No,name:"Parentheses",parse:Io,structure:{children:[[]]}},Symbol.toStringTag,{value:"Module"})),Bo={value:String};function $o(){return{type:"Percentage",loc:this.getLocation(this.tokenStart,this.tokenEnd),value:this.consumeNumber(Xt)}}function Uo(e){this.token(Xt,e.value+"%")}const Wo=Object.freeze(Object.defineProperty({__proto__:null,generate:Uo,name:"Percentage",parse:$o,structure:Bo},Symbol.toStringTag,{value:"Module"})),Vo={name:String,children:[["Raw"],null]};function Ho(){const e=this.tokenStart;let t,n,r=null;return this.eat(nn),2===this.tokenType?(t=this.consumeFunctionName(),n=t.toLowerCase(),this.lookupNonWSType(0)==ln?r=this.createList():hasOwnProperty.call(this.pseudo,n)?(this.skipSC(),r=this.pseudo[n].call(this),this.skipSC()):(r=this.createList(),r.push(this.Raw(null,!1))),this.eat(ln)):t=this.consume(1),{type:"PseudoClassSelector",loc:this.getLocation(e,this.tokenStart),name:t,children:r}}function qo(e){this.token(nn,":"),null===e.children?this.token(1,e.name):(this.token(2,e.name+"("),this.children(e),this.token(ln,")"))}const Qo=Object.freeze(Object.defineProperty({__proto__:null,generate:qo,name:"PseudoClassSelector",parse:Ho,structure:Vo,walkContext:"function"},Symbol.toStringTag,{value:"Module"})),Go={name:String,children:[["Raw"],null]};function Ko(){const e=this.tokenStart;let t,n,r=null;return this.eat(nn),this.eat(nn),2===this.tokenType?(t=this.consumeFunctionName(),n=t.toLowerCase(),this.lookupNonWSType(0)==ln?r=this.createList():hasOwnProperty.call(this.pseudo,n)?(this.skipSC(),r=this.pseudo[n].call(this),this.skipSC()):(r=this.createList(),r.push(this.Raw(null,!1))),this.eat(ln)):t=this.consume(1),{type:"PseudoElementSelector",loc:this.getLocation(e,this.tokenStart),name:t,children:r}}function Yo(e){this.token(nn,":"),this.token(nn,":"),null===e.children?this.token(1,e.name):(this.token(2,e.name+"("),this.children(e),this.token(ln,")"))}const Jo=Object.freeze(Object.defineProperty({__proto__:null,generate:Yo,name:"PseudoElementSelector",parse:Ko,structure:Go,walkContext:"function"},Symbol.toStringTag,{value:"Module"}));function Xo(){switch(this.skipSC(),this.tokenType){case Jt:return this.Number();case 2:return this.Function(this.readSequence,this.scope.Value);default:this.error("Number of function is expected")}}function Zo(){const e=this.tokenStart,t=Xo.call(this);let n=null;return this.skipSC(),this.isDelim(47)&&(this.eatDelim(47),n=Xo.call(this)),{type:"Ratio",loc:this.getLocation(e,this.tokenStart),left:t,right:n}}function es(e){this.node(e.left),this.token(9,"/"),e.right?this.node(e.right):this.node(Jt,1)}const ts=Object.freeze(Object.defineProperty({__proto__:null,generate:es,name:"Ratio",parse:Zo,structure:{left:["Number","Function"],right:["Number","Function",null]}},Symbol.toStringTag,{value:"Module"}));function ns(){return this.tokenIndex>0&&this.lookupType(-1)===en?this.tokenIndex>1?this.getTokenStart(this.tokenIndex-1):this.firstCharOffset:this.tokenStart}const rs={value:String};function is(e,t){const n=this.getTokenStart(this.tokenIndex);let r;return this.skipUntilBalanced(this.tokenIndex,e||this.consumeUntilBalanceEnd),r=t&&this.tokenStart>n?ns.call(this):this.tokenStart,{type:"Raw",loc:this.getLocation(n,r),value:this.substring(n,r)}}function os(e){this.tokenize(e.value)}const ss=Object.freeze(Object.defineProperty({__proto__:null,generate:os,name:"Raw",parse:is,structure:rs},Symbol.toStringTag,{value:"Module"}));function as(){return this.Raw(this.consumeUntilLeftCurlyBracket,!0)}function ls(){const e=this.SelectorList();return"Raw"!==e.type&&!1===this.eof&&this.tokenType!==cn&&this.error(),e}function cs(){const e=this.tokenIndex,t=this.tokenStart;let n,r;return n=this.parseRulePrelude?this.parseWithFallback(ls,as):as.call(this,e),r=this.Block(!0),{type:"Rule",loc:this.getLocation(t,this.tokenStart),prelude:n,block:r}}function hs(e){this.node(e.prelude),this.node(e.block)}const us=Object.freeze(Object.defineProperty({__proto__:null,generate:hs,name:"Rule",parse:cs,structure:{prelude:["SelectorList","Raw"],block:["Block"]},walkContext:"rule"},Symbol.toStringTag,{value:"Module"}));function ps(){let e=null,t=null;this.skipSC();const n=this.tokenStart;return this.tokenType===an&&(this.next(),this.skipSC(),e=this.parseWithFallback(this.SelectorList,()=>this.Raw(!1,!0)),this.skipSC(),this.eat(ln)),1===this.lookupNonWSType(0)&&(this.skipSC(),this.eatIdent("to"),this.skipSC(),this.eat(an),this.skipSC(),t=this.parseWithFallback(this.SelectorList,()=>this.Raw(!1,!0)),this.skipSC(),this.eat(ln)),{type:"Scope",loc:this.getLocation(n,this.tokenStart),root:e,limit:t}}function ds(e){e.root&&(this.token(an,"("),this.node(e.root),this.token(ln,")")),e.limit&&(this.token(1,"to"),this.token(an,"("),this.node(e.limit),this.token(ln,")"))}const ms=Object.freeze(Object.defineProperty({__proto__:null,generate:ds,name:"Scope",parse:ps,structure:{root:["SelectorList","Raw",null],limit:["SelectorList","Raw",null]}},Symbol.toStringTag,{value:"Module"}));function fs(){const e=this.readSequence(this.scope.Selector);return null===this.getFirstListNode(e)&&this.error("Selector is expected"),{type:"Selector",loc:this.getLocationFromList(e),children:e}}function gs(e){this.children(e)}const bs=Object.freeze(Object.defineProperty({__proto__:null,generate:gs,name:"Selector",parse:fs,structure:{children:[["TypeSelector","IdSelector","ClassSelector","AttributeSelector","PseudoClassSelector","PseudoElementSelector","Combinator"]]}},Symbol.toStringTag,{value:"Module"}));function ks(){const e=this.createList();for(;!this.eof&&(e.push(this.Selector()),this.tokenType===on);)this.next();return{type:"SelectorList",loc:this.getLocationFromList(e),children:e}}function ys(e){this.children(e,()=>this.token(on,","))}const vs=Object.freeze(Object.defineProperty({__proto__:null,generate:ys,name:"SelectorList",parse:ks,structure:{children:[["Selector","Raw"]]},walkContext:"selector"},Symbol.toStringTag,{value:"Module"})),Ss={value:String};function ws(){return{type:"String",loc:this.getLocation(this.tokenStart,this.tokenEnd),value:Gn(this.consume(5))}}function xs(e){this.token(5,function(e){let t="",n=!1;for(let r=0;r<e.length;r++){const i=e.charCodeAt(r);0!==i?i<=31||127===i?(t+="\\"+i.toString(16),n=!0):34===i||92===i?(t+="\\"+e.charAt(r),n=!1):(n&&(dn(i)||yn(i))&&(t+=" "),t+=e.charAt(r),n=!1):t+="�"}return'"'+t+'"'}(e.value))}const Cs=Object.freeze(Object.defineProperty({__proto__:null,generate:xs,name:"String",parse:ws,structure:Ss},Symbol.toStringTag,{value:"Module"}));function As(){return this.Raw(null,!1)}function _s(){const e=this.tokenStart,t=this.createList();let n;for(;!this.eof;){switch(this.tokenType){case en:this.next();continue;case un:if(33!==this.charCodeAt(this.tokenStart+2)){this.next();continue}n=this.Comment();break;case 14:n=this.CDO();break;case tn:n=this.CDC();break;case 3:n=this.parseWithFallback(this.Atrule,As);break;default:n=this.parseWithFallback(this.Rule,As)}t.push(n)}return{type:"StyleSheet",loc:this.getLocation(e,this.tokenStart),children:t}}function Ts(e){this.children(e)}const Ls=Object.freeze(Object.defineProperty({__proto__:null,generate:Ts,name:"StyleSheet",parse:_s,structure:{children:[["Comment","CDO","CDC","Atrule","Rule","Raw"]]},walkContext:"stylesheet"},Symbol.toStringTag,{value:"Module"}));function Es(){const e=this.tokenStart;this.eat(an),this.skipSC();const t=this.Declaration();return this.eof||this.eat(ln),{type:"SupportsDeclaration",loc:this.getLocation(e,this.tokenStart),declaration:t}}function Os(e){this.token(an,"("),this.node(e.declaration),this.token(ln,")")}const Ps=Object.freeze(Object.defineProperty({__proto__:null,generate:Os,name:"SupportsDeclaration",parse:Es,structure:{declaration:"Declaration"}},Symbol.toStringTag,{value:"Module"}));function Ds(){1!==this.tokenType&&!1===this.isDelim(42)&&this.error("Identifier or asterisk is expected"),this.next()}const Fs={name:String};function Ms(){const e=this.tokenStart;return this.isDelim(124)?(this.next(),Ds.call(this)):(Ds.call(this),this.isDelim(124)&&(this.next(),Ds.call(this))),{type:"TypeSelector",loc:this.getLocation(e,this.tokenStart),name:this.substrToCursor(e)}}function zs(e){this.tokenize(e.name)}const js=Object.freeze(Object.defineProperty({__proto__:null,generate:zs,name:"TypeSelector",parse:Ms,structure:Fs},Symbol.toStringTag,{value:"Module"}));function Is(e,t){let n=0;for(let r=this.tokenStart+e;r<this.tokenEnd;r++){const i=this.charCodeAt(r);if(45===i&&t&&0!==n)return Is.call(this,e+n+1,!1),-1;dn(i)||this.error(t&&0!==n?"Hyphen minus"+(n<6?" or hex digit":"")+" is expected":n<6?"Hex digit is expected":"Unexpected input",r),++n>6&&this.error("Too many hex digits",r)}return this.next(),n}function Ns(e){let t=0;for(;this.isDelim(63);)++t>e&&this.error("Too many question marks"),this.next()}function Rs(e){this.charCodeAt(this.tokenStart)!==e&&this.error((43===e?"Plus sign":"Hyphen minus")+" is expected")}function Bs(){let e=0;switch(this.tokenType){case Jt:if(e=Is.call(this,1,!0),this.isDelim(63)){Ns.call(this,6-e);break}if(this.tokenType===Zt||this.tokenType===Jt){Rs.call(this,45),Is.call(this,1,!1);break}break;case Zt:e=Is.call(this,1,!0),e>0&&Ns.call(this,6-e);break;default:if(this.eatDelim(43),1===this.tokenType){e=Is.call(this,0,!0),e>0&&Ns.call(this,6-e);break}if(this.isDelim(63)){this.next(),Ns.call(this,5);break}this.error("Hex digit or question mark is expected")}}const $s={value:String};function Us(){const e=this.tokenStart;return this.eatIdent("u"),Bs.call(this),{type:"UnicodeRange",loc:this.getLocation(e,this.tokenStart),value:this.substrToCursor(e)}}function Ws(e){this.tokenize(e.value)}const Vs=Object.freeze(Object.defineProperty({__proto__:null,generate:Ws,name:"UnicodeRange",parse:Us,structure:$s},Symbol.toStringTag,{value:"Module"})),Hs={value:String};function qs(){const e=this.tokenStart;let t;switch(this.tokenType){case 7:t=function(e){const t=e.length;let n=4,r=41===e.charCodeAt(t-1)?t-2:t-1,i="";for(;n<r&&yn(e.charCodeAt(n));)n++;for(;n<r&&yn(e.charCodeAt(r));)r--;for(let o=n;o<=r;o++){let n=e.charCodeAt(o);if(92===n){if(o===r){o!==t-1&&(i=e.substr(o+1));break}if(n=e.charCodeAt(++o),vn(92,n)){const t=o-1,n=Fn(e,t);o=n-1,i+=In(e.substring(t+1,n))}else 13===n&&10===e.charCodeAt(o+1)&&o++}else i+=e[o]}return i}(this.consume(7));break;case 2:this.cmpStr(this.tokenStart,this.tokenEnd,"url(")||this.error("Function name must be `url`"),this.eat(2),this.skipSC(),t=Gn(this.consume(5)),this.skipSC(),this.eof||this.eat(ln);break;default:this.error("Url or Function is expected")}return{type:"Url",loc:this.getLocation(e,this.tokenStart),value:t}}function Qs(e){this.token(7,function(e){let t="",n=!1;for(let r=0;r<e.length;r++){const i=e.charCodeAt(r);0!==i?i<=31||127===i?(t+="\\"+i.toString(16),n=!0):32===i||92===i||34===i||39===i||40===i||41===i?(t+="\\"+e.charAt(r),n=!1):(n&&dn(i)&&(t+=" "),t+=e.charAt(r),n=!1):t+="�"}return"url("+t+")"}(e.value))}const Gs=Object.freeze(Object.defineProperty({__proto__:null,generate:Qs,name:"Url",parse:qs,structure:Hs},Symbol.toStringTag,{value:"Module"}));function Ks(){const e=this.tokenStart,t=this.readSequence(this.scope.Value);return{type:"Value",loc:this.getLocation(e,this.tokenStart),children:t}}function Ys(e){this.children(e)}const Js=Object.freeze(Object.defineProperty({__proto__:null,generate:Ys,name:"Value",parse:Ks,structure:{children:[[]]}},Symbol.toStringTag,{value:"Module"})),Xs=Object.freeze({type:"WhiteSpace",loc:null,value:" "}),Zs={value:String};function ea(){return this.eat(en),Xs}function ta(e){this.token(en,e.value)}const na=Object.freeze(Object.defineProperty({__proto__:null,generate:ta,name:"WhiteSpace",parse:ea,structure:Zs},Symbol.toStringTag,{value:"Module"})),ra=function(e){const t=function(e){const t={};for(const n in e.node)if(Kn.call(e.node,n)){const r=e.node[n];if(!r.structure)throw new Error("Missed `structure` field in `"+n+"` node type definition");t[n]=Zn(0,r)}return t}(e),n={},r={},i=Symbol("break-walk"),o=Symbol("skip-node");for(const e in t)Kn.call(t,e)&&null!==t[e]&&(n[e]=er(t[e],!1),r[e]=er(t[e],!0));const s=tr(n),a=tr(r),l=function(e,l){function c(e,t,n){const r=h.call(m,e,t,n);return r===i||r!==o&&!!(p.hasOwnProperty(e.type)&&p[e.type](e,m,c,d)||u.call(m,e,t,n)===i)}let h=Yn,u=Yn,p=n,d=(e,t,n,r)=>e||c(t,n,r);const m={break:i,skip:o,root:e,stylesheet:null,atrule:null,atrulePrelude:null,rule:null,selector:null,block:null,declaration:null,function:null};if("function"==typeof l)h=l;else if(l&&(h=Jn(l.enter),u=Jn(l.leave),l.reverse&&(p=r),l.visit)){if(s.hasOwnProperty(l.visit))p=l.reverse?a[l.visit]:s[l.visit];else if(!t.hasOwnProperty(l.visit))throw new Error("Bad value `"+l.visit+"` for `visit` option (should be: "+Object.keys(t).sort().join(", ")+")");h=Xn(h,l.visit),u=Xn(u,l.visit)}if(h===Yn&&u===Yn)throw new Error("Neither `enter` nor `leave` walker handler is set or both aren't a function");c(e)};return l.break=i,l.skip=o,l.find=function(e,t){let n=null;return l(e,function(e,r,o){if(t.call(this,e,r,o))return n=e,i}),n},l.findLast=function(e,t){let n=null;return l(e,{reverse:!0,enter(e,r,o){if(t.call(this,e,r,o))return n=e,i}}),n},l.findAll=function(e,t){const n=[];return l(e,function(e,r,i){t.call(this,e,r,i)&&n.push(e)}),n},l}({node:Object.freeze(Object.defineProperty({__proto__:null,AnPlusB:dr,Atrule:yr,AtrulePrelude:wr,AttributeSelector:Lr,Block:zr,Brackets:Nr,CDC:$r,CDO:Vr,ClassSelector:Gr,Combinator:Xr,Comment:ni,Condition:ci,Declaration:ki,DeclarationList:wi,Dimension:_i,Feature:Oi,FeatureFunction:zi,FeatureRange:$i,Function:Hi,GeneralEnclosed:Ki,Hash:Zi,IdSelector:ao,Identifier:ro,Layer:uo,LayerList:fo,MediaQuery:yo,MediaQueryList:wo,NestingSelector:Ao,Nth:Lo,Number:Do,Operator:jo,Parentheses:Ro,Percentage:Wo,PseudoClassSelector:Qo,PseudoElementSelector:Jo,Ratio:ts,Raw:ss,Rule:us,Scope:ms,Selector:bs,SelectorList:vs,String:Cs,StyleSheet:Ls,SupportsDeclaration:Ps,TypeSelector:js,UnicodeRange:Vs,Url:Gs,Value:Js,WhiteSpace:na},Symbol.toStringTag,{value:"Module"}))}),ia=["left","right","top","bottom","inset-block-start","inset-block-end","inset-inline-start","inset-inline-end","inset-block","inset-inline","inset"];function oa(e){return ia.includes(e)}const sa=["margin-block-start","margin-block-end","margin-block","margin-inline-start","margin-inline-end","margin-inline","margin-bottom","margin-left","margin-right","margin-top","margin"];const aa=["width","height","min-width","min-height","max-width","max-height","block-size","inline-size","min-block-size","min-inline-size","max-block-size","max-inline-size"];function la(e){return aa.includes(e)}const ca=["justify-self","align-self","place-self"];const ha=[...ia,...sa,...aa,...ca,"position-anchor","position-area"],ua=[...aa,...ia,...sa];function pa(e){return ua.includes(e)}const da=["top","left","right","bottom","start","end","self-start","self-end","center","inside","outside"];function ma(e){return da.includes(e)}const fa=["width","height","block","inline","self-block","self-inline"];const ga=new Set(["Atrule","Selector","Declaration"]);const ba=(e,t)=>{if(9===e&&(e=t),"string"==typeof e){const t=e.charCodeAt(0);return t>127?32768:t<<8}return e},ka=[[1,1],[1,2],[1,7],[1,8],[1,"-"],[1,Jt],[1,Xt],[1,Zt],[1,tn],[1,an],[3,1],[3,2],[3,7],[3,8],[3,"-"],[3,Jt],[3,Xt],[3,Zt],[3,tn],[4,1],[4,2],[4,7],[4,8],[4,"-"],[4,Jt],[4,Xt],[4,Zt],[4,tn],[Zt,1],[Zt,2],[Zt,7],[Zt,8],[Zt,"-"],[Zt,Jt],[Zt,Xt],[Zt,Zt],[Zt,tn],["#",1],["#",2],["#",7],["#",8],["#","-"],["#",Jt],["#",Xt],["#",Zt],["#",tn],["-",1],["-",2],["-",7],["-",8],["-","-"],["-",Jt],["-",Xt],["-",Zt],["-",tn],[Jt,1],[Jt,2],[Jt,7],[Jt,8],[Jt,Jt],[Jt,Xt],[Jt,Zt],[Jt,"%"],[Jt,tn],["@",1],["@",2],["@",7],["@",8],["@","-"],["@",tn],[".",Jt],[".",Xt],[".",Zt],["+",Jt],["+",Xt],["+",Zt],["/","*"]],ya=ka.concat([[1,4],[Zt,4],[4,4],[3,an],[3,5],[3,nn],[Xt,Xt],[Xt,Zt],[Xt,2],[Xt,"-"],[ln,1],[ln,2],[ln,Xt],[ln,Zt],[ln,4],[ln,"-"]]);function va(e){const t=new Set(e.map(([e,t])=>ba(e)<<16|ba(t)));return function(e,n,r){const i=ba(n,r),o=r.charCodeAt(0);return(45===o&&1!==n&&2!==n&&n!==tn||43===o?t.has(e<<16|o<<8):t.has(e<<16|i))&&this.emit(" ",en,!0),i}}const Sa=va(ka),wa=va(ya),xa=Object.freeze(Object.defineProperty({__proto__:null,safe:wa,spec:Sa},Symbol.toStringTag,{value:"Module"}));function Ca(e,t){if("function"==typeof t){let n=null;return void e.children.forEach(e=>{null!==n&&t.call(this,n),this.node(e),n=e})}e.children.forEach(this.node,this)}function Aa(e){Qn(e,(t,n,r)=>{this.token(t,e.slice(n,r))})}const _a=function(e){const t=new Map;for(let[n,r]of Object.entries(e.node))"function"==typeof(r.generate||r)&&t.set(n,r.generate||r);return function(e,n){let r="",i=0,o={node(e){if(!t.has(e.type))throw new Error("Unknown node type: "+e.type);t.get(e.type).call(s,e)},tokenBefore:wa,token(e,t){i=this.tokenBefore(i,e,t),this.emit(t,e,!1),9===e&&92===t.charCodeAt(0)&&this.emit("\n",en,!0)},emit(e){r+=e},result:()=>r};n&&("function"==typeof n.decorator&&(o=n.decorator(o)),n.sourceMap&&(o=function(e){const t=new SourceMapGenerator,n={line:1,column:0},r={line:0,column:0},i={line:1,column:0},o={generated:i};let s=1,a=0,l=!1;const c=e.node;e.node=function(e){if(e.loc&&e.loc.start&&ga.has(e.type)){const c=e.loc.start.line,h=e.loc.start.column-1;(r.line!==c||r.column!==h)&&(r.line=c,r.column=h,n.line=s,n.column=a,l&&(l=!1,(n.line!==i.line||n.column!==i.column)&&t.addMapping(o)),l=!0,t.addMapping({source:e.loc.source,original:r,generated:n}))}c.call(this,e),l&&ga.has(e.type)&&(i.line=s,i.column=a)};const h=e.emit;e.emit=function(e,t,n){for(let t=0;t<e.length;t++)10===e.charCodeAt(t)?(s++,a=0):a++;h(e,t,n)};const u=e.result;return e.result=function(){return l&&t.addMapping(o),{css:u(),map:t}},e}(o)),n.mode in xa&&(o.tokenBefore=xa[n.mode]));const s={node:e=>o.node(e),children:Ca,token:(e,t)=>o.token(e,t),tokenize:Aa};return o.node(e),o.result()}}({node:Object.freeze(Object.defineProperty({__proto__:null,AnPlusB:pr,Atrule:kr,AtrulePrelude:Sr,AttributeSelector:Tr,Block:Mr,Brackets:Ir,CDC:Br,CDO:Wr,ClassSelector:Qr,Combinator:Jr,Comment:ti,Condition:li,Declaration:fi,DeclarationList:Si,Dimension:Ai,Feature:Ei,FeatureFunction:Mi,FeatureRange:Bi,Function:Vi,GeneralEnclosed:Gi,Hash:Xi,IdSelector:so,Identifier:no,Layer:ho,LayerList:mo,MediaQuery:ko,MediaQueryList:So,NestingSelector:Co,Nth:To,Number:Po,Operator:zo,Parentheses:No,Percentage:Uo,PseudoClassSelector:qo,PseudoElementSelector:Yo,Ratio:es,Raw:os,Rule:hs,Scope:ds,Selector:gs,SelectorList:ys,String:xs,StyleSheet:Ts,SupportsDeclaration:Os,TypeSelector:zs,UnicodeRange:Ws,Url:Qs,Value:Ys,WhiteSpace:ta},Symbol.toStringTag,{value:"Module"}))});const Ta=" ";function La({source:e,line:t,column:n,baseLine:r,baseColumn:i},o){function s(e,t){return a.slice(e,t).map((t,n)=>String(e+n+1).padStart(h)+" |"+t).join("\n")}const a=("\n".repeat(Math.max(r-1,0))+" ".repeat(Math.max(i-1,0))+e).split(/\r\n?|\n|\f/),l=Math.max(1,t-o)-1,c=Math.min(t+o,a.length+1),h=Math.max(4,String(c).length)+1;let u=0;(n+=3*(a[t-1].substr(0,n-1).match(/\t/g)||[]).length)>100&&(u=n-60+3,n=58);for(let e=l;e<=c;e++)e>=0&&e<a.length&&(a[e]=a[e].replace(/\t/g,Ta),a[e]=(u>0&&a[e].length>u?"…":"")+a[e].substr(u,98)+(a[e].length>u+100-1?"…":""));return[s(l,t),new Array(n+h+2).join("-")+"^",s(t,c)].filter(Boolean).join("\n").replace(/^(\s+\d+\s+\|\n)+/,"").replace(/\n(\s+\d+\s+\|)+$/,"")}function Ea(e,t,n,r,i,o=1,s=1){return Object.assign(function(e,t){const n=Object.create(SyntaxError.prototype),r=new Error;return Object.assign(n,{name:e,message:t,get stack(){return(r.stack||"").replace(/^(.+\n){1,3}/,`${e}: ${t}\n`)}})}("SyntaxError",e),{source:t,offset:n,line:r,column:i,sourceFragment:e=>La({source:t,line:r,column:i,baseLine:o,baseColumn:s},isNaN(e)?0:e),get formattedMessage(){return`Parse error: ${e}\n`+La({source:t,line:r,column:i,baseLine:o,baseColumn:s},2)}})}function Oa(e){const t=this.createList();let n=!1;const r={recognizer:e};for(;!this.eof;){switch(this.tokenType){case un:this.next();continue;case en:n=!0,this.next();continue}let i=e.getNode.call(this,r);if(void 0===i)break;n&&(e.onWhiteSpace&&e.onWhiteSpace.call(this,i,t,r),n=!1),t.push(i)}return n&&e.onWhiteSpace&&e.onWhiteSpace.call(this,null,t,r),t}const Pa=()=>{};function Da(e){return function(){return this[e]()}}function Fa(e){const t=Object.create(null);for(const n of Object.keys(e)){const r=e[n],i=r.parse||r;i&&(t[n]=i)}return t}function Ma(e){switch(this.tokenType){case 4:return this.Hash();case on:return this.Operator();case an:return this.Parentheses(this.readSequence,e.recognizer);case sn:return this.Brackets(this.readSequence,e.recognizer);case 5:return this.String();case Zt:return this.Dimension();case Xt:return this.Percentage();case Jt:return this.Number();case 2:return this.cmpStr(this.tokenStart,this.tokenEnd,"url(")?this.Url():this.Function(this.readSequence,e.recognizer);case 7:return this.Url();case 1:return this.cmpChar(this.tokenStart,117)&&this.cmpChar(this.tokenStart+1,43)?this.UnicodeRange():this.Identifier();case 9:{const e=this.charCodeAt(this.tokenStart);if(47===e||42===e||43===e||45===e)return this.Operator();35===e&&this.error("Hex or identifier is expected",this.tokenStart+1);break}}}const za={getNode:Ma};const ja={onWhiteSpace:function(e,t){null!==t.last&&"Combinator"!==t.last.type&&null!==e&&"Combinator"!==e.type&&t.push({type:"Combinator",loc:null,name:" "})},getNode:function(){switch(this.tokenType){case sn:return this.AttributeSelector();case 4:return this.IdSelector();case nn:return this.lookupType(1)===nn?this.PseudoElementSelector():this.PseudoClassSelector();case 1:return this.TypeSelector();case Jt:case Xt:return this.Percentage();case Zt:46===this.charCodeAt(this.tokenStart)&&this.error("Identifier is expected",this.tokenStart+1);break;case 9:switch(this.charCodeAt(this.tokenStart)){case 43:case 62:case 126:case 47:return this.Combinator();case 46:return this.ClassSelector();case 42:case 124:return this.TypeSelector();case 35:return this.IdSelector();case 38:return this.NestingSelector()}}}};function Ia(e){return null!==e&&"Operator"===e.type&&("-"===e.value[e.value.length-1]||"+"===e.value[e.value.length-1])}const Na={getNode:Ma,onWhiteSpace(e,t){Ia(e)&&(e.value=" "+e.value),Ia(t.last)&&(t.last.value+=" ")},expression:function(){return this.createSingleNodeList(this.Raw(null,!1))},var:function(){const e=this.createList();if(this.skipSC(),e.push(this.Identifier()),this.skipSC(),this.tokenType===on){e.push(this.Operator());const t=this.tokenIndex,n=this.parseCustomProperty?this.Value(null):this.Raw(this.consumeUntilExclamationMarkOrSemicolon,!1);if("Value"===n.type&&n.children.isEmpty)for(let e=t-this.tokenIndex;e<=0;e++)if(this.lookupType(e)===en){n.children.appendData({type:"WhiteSpace",loc:null,value:" "});break}e.push(n)}return e}},Ra=Object.freeze(Object.defineProperty({__proto__:null,AtrulePrelude:za,Selector:ja,Value:Na},Symbol.toStringTag,{value:"Module"})),Ba=new Set(["none","and","not","or"]),$a={parse:{prelude(){const e=this.createList();if(1===this.tokenType){const t=this.substring(this.tokenStart,this.tokenEnd);Ba.has(t.toLowerCase())||e.push(this.Identifier())}return e.push(this.Condition("container")),e},block(e=!1){return this.Block(e)}}},Ua={parse:{prelude:null,block(){return this.Block(!0)}}};function Wa(e,t){return this.parseWithFallback(()=>{try{return e.call(this)}finally{this.skipSC(),this.lookupNonWSType(0)!==ln&&this.error()}},t||(()=>this.Raw(null,!0)))}const Va={layer(){this.skipSC();const e=this.createList(),t=Wa.call(this,this.Layer);return("Raw"!==t.type||""!==t.value)&&e.push(t),e},supports(){this.skipSC();const e=this.createList(),t=Wa.call(this,this.Declaration,()=>Wa.call(this,()=>this.Condition("supports")));return("Raw"!==t.type||""!==t.value)&&e.push(t),e}},Ha={container:$a,"font-face":Ua,import:{parse:{prelude(){const e=this.createList();switch(this.tokenType){case 5:e.push(this.String());break;case 7:case 2:e.push(this.Url());break;default:this.error("String or url() is expected")}return this.skipSC(),1===this.tokenType&&this.cmpStr(this.tokenStart,this.tokenEnd,"layer")?e.push(this.Identifier()):2===this.tokenType&&this.cmpStr(this.tokenStart,this.tokenEnd,"layer(")&&e.push(this.Function(null,Va)),this.skipSC(),2===this.tokenType&&this.cmpStr(this.tokenStart,this.tokenEnd,"supports(")&&e.push(this.Function(null,Va)),(1===this.lookupNonWSType(0)||this.lookupNonWSType(0)===an)&&e.push(this.MediaQueryList()),e},block:null}},layer:{parse:{prelude(){return this.createSingleNodeList(this.LayerList())},block(){return this.Block(!1)}}},media:{parse:{prelude(){return this.createSingleNodeList(this.MediaQueryList())},block(e=!1){return this.Block(e)}}},nest:{parse:{prelude(){return this.createSingleNodeList(this.SelectorList())},block(){return this.Block(!0)}}},page:{parse:{prelude(){return this.createSingleNodeList(this.SelectorList())},block(){return this.Block(!0)}}},scope:{parse:{prelude(){return this.createSingleNodeList(this.Scope())},block(e=!1){return this.Block(e)}}},"starting-style":{parse:{prelude:null,block(e=!1){return this.Block(e)}}},supports:{parse:{prelude(){return this.createSingleNodeList(this.Condition("supports"))},block(e=!1){return this.Block(e)}}}};const qa={parse(){return this.createSingleNodeList(this.SelectorList())}},Qa={parse(){return this.createSingleNodeList(this.Selector())}},Ga={parse(){return this.createSingleNodeList(this.Identifier())}},Ka={parse:function(){const e=this.createList();this.skipSC();e:for(;!this.eof;){switch(this.tokenType){case 1:e.push(this.Identifier());break;case 5:e.push(this.String());break;case on:e.push(this.Operator());break;case ln:break e;default:this.error("Identifier, string or comma is expected")}this.skipSC()}return e}},Ya={parse(){return this.createSingleNodeList(this.Nth())}},Ja={dir:Ga,has:qa,lang:Ka,matches:qa,is:qa,"-moz-any":qa,"-webkit-any":qa,where:qa,not:qa,"nth-child":Ya,"nth-last-child":Ya,"nth-last-of-type":Ya,"nth-of-type":Ya,slotted:Qa,host:Qa,"host-context":Qa},Xa=Object.freeze(Object.defineProperty({__proto__:null,AnPlusB:ur,Atrule:br,AtrulePrelude:vr,AttributeSelector:_r,Block:Fr,Brackets:jr,CDC:Rr,CDO:Ur,ClassSelector:qr,Combinator:Yr,Comment:ei,Condition:ai,Declaration:mi,DeclarationList:vi,Dimension:Ci,Feature:Li,FeatureFunction:Fi,FeatureRange:Ri,Function:Wi,GeneralEnclosed:Qi,Hash:Ji,IdSelector:oo,Identifier:to,Layer:co,LayerList:po,MediaQuery:bo,MediaQueryList:vo,NestingSelector:xo,Nth:_o,Number:Oo,Operator:Mo,Parentheses:Io,Percentage:$o,PseudoClassSelector:Ho,PseudoElementSelector:Ko,Ratio:Zo,Raw:is,Rule:cs,Scope:ps,Selector:fs,SelectorList:ks,String:ws,StyleSheet:_s,SupportsDeclaration:Es,TypeSelector:Ms,UnicodeRange:Us,Url:qs,Value:Ks,WhiteSpace:ea},Symbol.toStringTag,{value:"Module"})),Za=function(e){let t="",n="<unknown>",r=!1,i=Pa,o=!1;const s=new $n,a=Object.assign(new qn,function(e){const t={context:Object.create(null),features:Object.assign(Object.create(null),e.features),scope:Object.assign(Object.create(null),e.scope),atrule:Fa(e.atrule),pseudo:Fa(e.pseudo),node:Fa(e.node)};for(const[n,r]of Object.entries(e.parseContext))switch(typeof r){case"function":t.context[n]=r;break;case"string":t.context[n]=Da(r)}return He(He({config:t},t),t.node)}(e||{}),{parseAtrulePrelude:!0,parseRulePrelude:!0,parseValue:!0,parseCustomProperty:!1,readSequence:Oa,consumeUntilBalanceEnd:()=>0,consumeUntilLeftCurlyBracket:e=>123===e?1:0,consumeUntilLeftCurlyBracketOrSemicolon:e=>123===e||59===e?1:0,consumeUntilExclamationMarkOrSemicolon:e=>33===e||59===e?1:0,consumeUntilSemicolonIncluded:e=>59===e?2:0,createList:()=>new Kt,createSingleNodeList:e=>(new Kt).appendData(e),getFirstListNode:e=>e&&e.first,getLastListNode:e=>e&&e.last,parseWithFallback(e,t){const n=this.tokenIndex;try{return e.call(this)}catch(e){if(o)throw e;this.skip(n-this.tokenIndex);const r=t.call(this);return o=!0,i(e,r),o=!1,r}},lookupNonWSType(e){let t;do{if(t=this.lookupType(e++),t!==en&&t!==un)return t}while(0!==t);return 0},charCodeAt:e=>e>=0&&e<t.length?t.charCodeAt(e):0,substring:(e,n)=>t.substring(e,n),substrToCursor(e){return this.source.substring(e,this.tokenStart)},cmpChar:(e,n)=>En(t,e,n),cmpStr:(e,n,r)=>On(t,e,n,r),consume(e){const t=this.tokenStart;return this.eat(e),this.substrToCursor(t)},consumeFunctionName(){const e=t.substring(this.tokenStart,this.tokenEnd-1);return this.eat(2),e},consumeNumber(e){const n=t.substring(this.tokenStart,zn(t,this.tokenStart));return this.eat(e),n},eat(e){if(this.tokenType!==e){const t=Nn[e].slice(0,-6).replace(/-/g," ").replace(/^./,e=>e.toUpperCase());let n=`${/[[\](){}]/.test(t)?`"${t}"`:t} is expected`,r=this.tokenStart;switch(e){case 1:2===this.tokenType||7===this.tokenType?(r=this.tokenEnd-1,n="Identifier is expected but function found"):n="Identifier is expected";break;case 4:this.isDelim(35)&&(this.next(),r++,n="Name is expected");break;case Xt:this.tokenType===Jt&&(r=this.tokenEnd,n="Percent sign is expected")}this.error(n,r)}this.next()},eatIdent(e){(1!==this.tokenType||!1===this.lookupValue(0,e))&&this.error(`Identifier "${e}" is expected`),this.next()},eatDelim(e){this.isDelim(e)||this.error(`Delim "${String.fromCharCode(e)}" is expected`),this.next()},getLocation:(e,t)=>r?s.getLocationRange(e,t,n):null,getLocationFromList(e){if(r){const t=this.getFirstListNode(e),r=this.getLastListNode(e);return s.getLocationRange(null!==t?t.loc.start.offset-s.startOffset:this.tokenStart,null!==r?r.loc.end.offset-s.startOffset:this.tokenStart,n)}return null},error(e,n){const r=void 0!==n&&n<t.length?s.getLocation(n):this.eof?s.getLocation(function(e,t){for(;t>=0&&yn(e.charCodeAt(t));t--);return t+1}(t,t.length-1)):s.getLocation(this.tokenStart);throw new Ea(e||"Unexpected input",t,r.offset,r.line,r.column,s.startLine,s.startColumn)}});return Object.assign(function(e,l){t=e,l=l||{},a.setSource(t,Qn),s.setSource(t,l.offset,l.line,l.column),n=l.filename||"<unknown>",r=!!l.positions,i="function"==typeof l.onParseError?l.onParseError:Pa,o=!1,a.parseAtrulePrelude=!("parseAtrulePrelude"in l)||!!l.parseAtrulePrelude,a.parseRulePrelude=!("parseRulePrelude"in l)||!!l.parseRulePrelude,a.parseValue=!("parseValue"in l)||!!l.parseValue,a.parseCustomProperty="parseCustomProperty"in l&&!!l.parseCustomProperty;const{context:c="default",onComment:h}=l;if(!(c in a.context))throw new Error("Unknown context `"+c+"`");"function"==typeof h&&a.forEachToken((e,n,r)=>{if(e===un){const e=a.getLocation(n,r),i=On(t,r-2,r,"*/")?t.slice(n+2,r-2):t.slice(n+2,r);h(i,e)}});const u=a.context[c].call(a,l);return a.eof||a.error(),u},{SyntaxError:Ea,config:a.config})}({parseContext:{default:"StyleSheet",stylesheet:"StyleSheet",atrule:"Atrule",atrulePrelude(e){return this.AtrulePrelude(e.atrule?String(e.atrule):null)},mediaQueryList:"MediaQueryList",mediaQuery:"MediaQuery",condition(e){return this.Condition(e.kind)},rule:"Rule",selectorList:"SelectorList",selector:"Selector",block(){return this.Block(!0)},declarationList:"DeclarationList",declaration:"Declaration",value:"Value"},features:{supports:{selector(){return this.Selector()}},container:{style(){return this.Declaration()}}},scope:Ra,atrule:Ha,pseudo:Ja,node:Xa});let el=(e=21)=>{let t="",n=0|e;for(;n--;)t+="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"[64*Math.random()|0];return t};const tl=el(),nl=new Set;function rl(e){return!(!e||"Function"!==e.type||"anchor"!==e.name)}function il(e,t=!1){return Za(e,{parseAtrulePrelude:!1,parseCustomProperty:!0,onParseError:e=>{t&&nl.add(e)}})}function ol(e){return _a(e,{mode:"spec"})}function sl(e){return"Declaration"===e.type}function al(e){return e?e.children.map(e=>{var t;let n;"PseudoElementSelector"===(null==(t=e.children.last)?void 0:t.type)&&(n=ol((e=Yt(e)).children.last),e.children.pop());const r=ol(e);return{selector:r+(null!=n?n:""),elementPart:r,pseudoElementPart:n}}).toArray():[]}const ll=[...ha,"anchor-scope","anchor-name"].reduce((e,t)=>(e[t]=`--${t}-${tl}`,e),{});function cl(e,t){return sl(e)&&ll[e.property]&&t?(t.children.appendData(qe(He({},e),{property:ll[e.property]})),{updated:!0}):{updated:!1}}function hl(e,t){if(!sl(e)||!t||!["inset","inset-block","inset-inline"].includes(e.property))return{updated:!1};const n=(n,r)=>{r&&t.children.appendData(qe(He({},e),{property:n,value:{type:"Value",children:(new Kt).fromArray([r])}}))};if("inset"===e.property){const t=e.value.children.toArray(),[r,i,o,s]=(()=>{switch(t.length){case 1:return[t[0],t[0],t[0],t[0]];case 2:return[t[0],t[1],t[0],t[1]];case 3:return[t[0],t[1],t[2],t[1]];case 4:return[t[0],t[1],t[2],t[3]];default:return[]}})();n("top",r),n("right",i),n("bottom",o),n("left",s)}else if("inset-block"===e.property){const t=e.value.children.toArray(),[r,i]=(()=>{switch(t.length){case 1:return[t[0],t[0]];case 2:return[t[0],t[1]];default:return[]}})();n("inset-block-start",r),n("inset-block-end",i)}else if("inset-inline"===e.property){const t=e.value.children.toArray(),[r,i]=(()=>{switch(t.length){case 1:return[t[0],t[0]];case 2:return[t[0],t[1]];default:return[]}})();n("inset-inline-start",r),n("inset-inline-end",i)}return{updated:!0}}var ul=(e=>(e.All="all",e.None="none",e))(ul||{});function pl(e,t){var n;return t=null!=(n=ll[t])?n:t,(e instanceof HTMLElement?getComputedStyle(e):e.computedStyle).getPropertyValue(t).trim()}function dl(e,t,n){return pl(e,t)===n}function ml(e,{selector:t,pseudoElementPart:n}){const r=getComputedStyle(e,n),i=document.createElement("div"),o=document.createElement("style");i.id=`fake-pseudo-element-${el()}`;for(const e of Array.from(r)){const t=r.getPropertyValue(e);i.style.setProperty(e,t)}o.textContent+=`#${i.id}${n} { content: ${r.content}; }`,o.textContent+=`${t} { display: none !important; }`,document.head.append(o);const s="::before"===n?"afterbegin":"beforeend";return e.insertAdjacentElement(s,i),{fakePseudoElement:i,sheet:o,computedStyle:r}}function fl(e){let t=function(e){let t=e;for(;t;){if(dl(t,"overflow","scroll"))return t;t=t.parentElement}return t}(e);return t===document.documentElement&&(t=null),null!=t?t:{scrollTop:0,scrollLeft:0}}function gl(e,t){const n=pl(e,"anchor-scope");return n===t||"all"===n}const bl=e=>Qe(null,null,function*(){var t,n,r;let i=yield null==(t=Vt.getOffsetParent)?void 0:t.call(Vt,e);return(yield null==(n=Vt.isElement)?void 0:n.call(Vt,i))||(i=(yield null==(r=Vt.getDocumentElement)?void 0:r.call(Vt,e))||window.document.documentElement),i}),kl=(e,t)=>e.flatMap(e=>[...e.querySelectorAll(t)]),yl="InvalidMimeType";const vl='[style*="anchor"]',Sl='[style*="position-area"]';function wl(e){return Qe(this,null,function*(){var t,n;const r=null!=(t=e.elements)?t:kl(e.roots,"link, style"),i=[];r.filter(e=>e instanceof HTMLElement).forEach(e=>{if("link"===e.tagName.toLowerCase()){const t=function(e){const t=new URL(e.href,document.baseURI);if(function(e){return!("text/css"!==e.type&&"stylesheet"!==e.rel||!e.href)}(e)&&t.origin===location.origin)return t}(e);t&&i.push({el:e,url:t})}"style"===e.tagName.toLowerCase()&&i.push({el:e,css:e.innerHTML})});const o=function(e){const t=e?e.filter(e=>e instanceof HTMLElement&&(e.matches(vl)||e.matches(Sl))):Array.from(document.querySelectorAll([vl,Sl].join(","))),n=[];return t.filter(e=>e instanceof HTMLElement).forEach(e=>{const t=el(12),r="data-has-inline-styles";e.setAttribute(r,t);const i=`[${r}="${t}"] { ${e.getAttribute("style")} }`;n.push({el:e,css:i})}),n}(e.excludeInlineStyles?null!=(n=e.elements)?n:[]:void 0);return yield function(e){return Qe(this,null,function*(){return(yield Promise.all(e.map(e=>Qe(null,null,function*(){var t;if(!e.url)return e;if(null!=(t=e.el)&&t.disabled)return null;try{const t=yield fetch(e.url.toString()),n=t.headers.get("content-type");if(null==n||!n.startsWith("text/css")){const t=new Error(`Error loading ${e.url}: expected content-type "text/css", got "${n}".`);throw t.name=yl,t}const r=yield t.text();return qe(He({},e),{css:r})}catch(e){if(e instanceof Error&&e.name===yl)return null;throw e}})))).filter(e=>null!==e)})}([...i,...o])})}let xl=(e=21)=>{let t="",n=crypto.getRandomValues(new Uint8Array(e|=0));for(;e--;)t+="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"[63&n[e]];return t};const Cl="--pa-cascade-property",Al="data-anchor-position-wrapper",_l="data-pa-wrapper-for-",Tl="POLYFILL-POSITION-AREA",Ll=["left","center","right","span-left","span-right","x-start","x-end","span-x-start","span-x-end","self-x-start","self-x-end","span-self-x-start","span-self-x-end","span-all","top","bottom","span-top","span-bottom","y-start","y-end","span-y-start","span-y-end","self-y-start","self-y-end","span-self-y-start","span-self-y-end","block-start","block-end","span-block-start","span-block-end","inline-start","inline-end","span-inline-start","span-inline-end","self-block-start","self-block-end","span-self-block-start","span-self-block-end","self-inline-start","self-inline-end","span-self-inline-start","span-self-inline-end","start","end","span-start","span-end","self-start","self-end","span-self-start","span-self-end"];function El(e){return Ll.includes(e)}const Ol={left:[0,1,"Irrelevant"],center:[1,2,"Irrelevant"],right:[2,3,"Irrelevant"],"span-left":[0,2,"Irrelevant"],"span-right":[1,3,"Irrelevant"],"x-start":[0,1,"Physical"],"x-end":[2,3,"Physical"],"span-x-start":[0,2,"Physical"],"span-x-end":[1,3,"Physical"],"self-x-start":[0,1,"PhysicalSelf"],"self-x-end":[2,3,"PhysicalSelf"],"span-self-x-start":[0,2,"PhysicalSelf"],"span-self-x-end":[1,3,"PhysicalSelf"],"span-all":[0,3,"Irrelevant"],top:[0,1,"Irrelevant"],bottom:[2,3,"Irrelevant"],"span-top":[0,2,"Irrelevant"],"span-bottom":[1,3,"Irrelevant"],"y-start":[0,1,"Physical"],"y-end":[2,3,"Physical"],"span-y-start":[0,2,"Physical"],"span-y-end":[1,3,"Physical"],"self-y-start":[0,1,"PhysicalSelf"],"self-y-end":[2,3,"PhysicalSelf"],"span-self-y-start":[0,2,"PhysicalSelf"],"span-self-y-end":[1,3,"PhysicalSelf"],"block-start":[0,1,"Logical"],"block-end":[2,3,"Logical"],"span-block-start":[0,2,"Logical"],"span-block-end":[1,3,"Logical"],"inline-start":[0,1,"Logical"],"inline-end":[2,3,"Logical"],"span-inline-start":[0,2,"Logical"],"span-inline-end":[1,3,"Logical"],"self-block-start":[0,1,"LogicalSelf"],"self-block-end":[2,3,"LogicalSelf"],"span-self-block-start":[0,2,"LogicalSelf"],"span-self-block-end":[1,3,"LogicalSelf"],"self-inline-start":[0,1,"LogicalSelf"],"self-inline-end":[2,3,"LogicalSelf"],"span-self-inline-start":[0,2,"LogicalSelf"],"span-self-inline-end":[1,3,"LogicalSelf"],start:[0,1,"Logical"],end:[2,3,"Logical"],"span-start":[0,2,"Logical"],"span-end":[1,3,"Logical"],"self-start":[0,1,"LogicalSelf"],"self-end":[2,3,"LogicalSelf"],"span-self-start":[0,2,"LogicalSelf"],"span-self-end":[1,3,"LogicalSelf"]},Pl=["start","center","end","span-start","span-end","span-all"],Dl=["self-start","center","self-end","span-self-start","span-self-end","span-all"],Fl=["block","top","bottom","y"],Ml=["inline","left","right","x"];function zl(e){const t=e.split("-");for(const e of t){if(Fl.includes(e))return"block";if(Ml.includes(e))return"inline"}return"ambiguous"}function jl(e,t){return t[0].includes(e[0])&&t[1].includes(e[1])||t[0].includes(e[1])&&t[1].includes(e[0])}const Il=[[["left","center","right","span-left","span-right","x-start","x-end","span-x-start","span-x-end","self-x-start","self-x-end","span-self-x-start","span-self-x-end","span-all"],["top","center","bottom","span-top","span-bottom","y-start","y-end","span-y-start","span-y-end","self-y-start","self-y-end","span-self-y-start","span-self-y-end","span-all"]],[["block-start","center","block-end","span-block-start","span-block-end","span-all"],["inline-start","center","inline-end","span-inline-start","span-inline-end","span-all"]],[["self-block-start","center","self-block-end","span-self-block-start","span-self-block-end","span-all"],["self-inline-start","center","self-inline-end","span-self-inline-start","span-self-inline-end","span-all"]],[Pl,Pl],[Dl,Dl]];const Nl=e=>{const t=getComputedStyle(e);return{writingMode:t.writingMode,direction:t.direction}},Rl=e=>e.reverse().map(e=>3-e),Bl=(e,t)=>"Irrelevant"===e?t:e,$l=(e,t)=>Qe(null,[e,t],function*({block:e,inline:t},n){const r=Bl(e[2],t[2]),i=yield((e,t)=>Qe(null,null,function*(){const n=yield bl(e);switch(t){case"Logical":case"Physical":return Nl(n);case"LogicalSelf":case"PhysicalSelf":return Nl(e);default:return null}}))(n,r),o={block:[e[0],e[1]],inline:[t[0],t[1]]};if(i){if("rtl"===i.direction&&(o.inline=Rl(o.inline)),i.writingMode.startsWith("vertical")){const e=o.block;o.block=o.inline,o.inline=e}if(i.writingMode.startsWith("sideways")){const e=o.block;o.block=o.inline,o.inline=e,i.writingMode.endsWith("lr")&&(o.block=Rl(o.block))}i.writingMode.endsWith("rl")&&(o.inline=Rl(o.inline))}return o});function Ul([e,t]){return 0===e&&3===t?"center":0===e?"end":3===t?"start":"center"}function Wl(e){if(!function(e){return"Declaration"===e.type&&"position-area"===e.property}(e))return;const t=function(e){const t=e.value.children.toArray().map(({name:e})=>e);return 1===t.length&&("ambiguous"===zl(t[0])?t.push(t[0]):t.push("span-all")),t}(e);if(!function(e){for(const t of Il)if(jl(e,t))return!0;return!1}(t))return;const n={};switch(zl(t[0])){case"block":n.block=t[0],n.inline=t[1];break;case"inline":n.inline=t[0],n.block=t[1];break;case"ambiguous":"block"==zl(t[1])?(n.block=t[1],n.inline=t[0]):(n.inline=t[1],n.block=t[0])}return{values:n,grid:{block:Ol[n.block],inline:Ol[n.inline]},selectorUUID:`--pa-declaration-${xl(12)}`}}function Vl(e,t){["justify-self","align-self"].forEach(e=>{t.children.appendData({type:"Declaration",property:e,value:{type:"Raw",value:`var(--pa-value-${e})`},important:!1})}),t.children.appendData({type:"Declaration",property:Cl,value:{type:"Raw",value:e.selectorUUID},important:!1})}function Hl(e,t){var n,r;let i;if((null==(n=e.parentElement)?void 0:n.tagName)===Tl)i=e.parentElement;else{i=document.createElement(Tl),i.style.display="grid",i.style.position="absolute";const t=getComputedStyle(e).pointerEvents;i.style.pointerEvents="none",e.style.pointerEvents=t,["top","left","right","bottom"].forEach(e=>{i.style.setProperty(e,`var(--pa-value-${e})`)}),null==(r=e.parentElement)||r.insertBefore(i,e),i.appendChild(e)}return i.setAttribute(`${_l}${t}`,""),i}function ql(e,t,n){return Qe(this,null,function*(){const r=`--pa-target-${xl(12)}`,i=yield $l(t.grid,e),o=(({block:e,inline:t})=>{const n=[0,"top","bottom",0],r=[0,"left","right",0];return{block:[n[e[0]],n[e[1]]],inline:[r[t[0]],r[t[1]]]}})(i),s=Bl(t.grid.block[2],t.grid.inline[2]),a=["LogicalSelf","PhysicalSelf"].includes(s)?i:t.grid;return{insets:o,alignments:{block:Ul([a.block[0],a.block[1]]),inline:Ul([a.inline[0],a.inline[1]])},targetUUID:r,targetEl:e,anchorEl:n,wrapperEl:Hl(e,r),values:t.values,grid:t.grid,selectorUUID:t.selectorUUID}})}function Ql(e,t){return`\n [${Al}="${t}"][${_l}${e}] {\n --pa-value-top: var(${e}-top);\n --pa-value-left: var(${e}-left);\n --pa-value-right: var(${e}-right);\n --pa-value-bottom: var(${e}-bottom);\n --pa-value-justify-self: var(${e}-justify-self);\n --pa-value-align-self: var(${e}-align-self);\n }\n `.replaceAll("\n","")}const Gl=["normal","most-width","most-height","most-block-size","most-inline-size"],Kl=["flip-block","flip-inline","flip-start"];function Yl(e,t){const n=document.querySelector(e);if(n){let e=function(e){const t={};return ha.forEach(n=>{const r=pl(e,`--${n}-${tl}`);r&&(t[n]=r)}),t}(n);return t.forEach(t=>{e=nc(e,t)}),e}}function Jl(e,t){let n=e.declarations;return t.forEach(e=>{n=nc(n,e)}),n}const Xl={"flip-block":{top:"bottom",bottom:"top","inset-block-start":"inset-block-end","inset-block-end":"inset-block-start","margin-top":"margin-bottom","margin-bottom":"margin-top"},"flip-inline":{left:"right",right:"left","inset-inline-start":"inset-inline-end","inset-inline-end":"inset-inline-start","margin-left":"margin-right","margin-right":"margin-left"},"flip-start":{left:"top",right:"bottom",top:"left",bottom:"right","inset-block-start":"inset-block-end","inset-block-end":"inset-block-start","inset-inline-start":"inset-inline-end","inset-inline-end":"inset-inline-start","inset-block":"inset-inline","inset-inline":"inset-block"}},Zl={"flip-block":{top:"bottom",bottom:"top",start:"end",end:"start","self-end":"self-start","self-start":"self-end"},"flip-inline":{left:"right",right:"left",start:"end",end:"start","self-end":"self-start","self-start":"self-end"},"flip-start":{top:"left",left:"top",right:"bottom",bottom:"right"}},ec={"flip-block":{top:"bottom",bottom:"top",start:"end",end:"start"},"flip-inline":{left:"right",right:"left",start:"end",end:"start"},"flip-start":{}};const tc=(e,t)=>{var n;return(null==(n=il(`#id{${e}: ${t};}`).children.first)?void 0:n.block.children.first).value};function nc(e,t){const n={};return Object.entries(e).forEach(([e,r])=>{const i=e,o=tc(i,r),s=function(e,t){return Xl[t][e]||e}(i,t);s!==i&&(null!=n[i]||(n[i]="revert")),ra(o,{visit:"Function",enter(e){rl(e)&&e.children.forEach(e=>{yc(e)&&ma(e.name)&&(e.name=function(e,t){return Zl[t][e]||e}(e.name,t))})}}),"position-area"===i&&o.children.forEach(e=>{yc(e)&&El(e.name)&&(e.name=function(e,t){if("flip-start"===t)return e;{const n=ec[t];return e.split("-").map(e=>n[e]||e).join("-")}}(e.name,t))}),i.startsWith("margin")&&function(e,t,n){if("margin"===e){const[e,r,i,o]=t.children.toArray();"flip-block"===n?o?t.children.fromArray([i,r,e,o]):i&&t.children.fromArray([i,r,e]):"flip-inline"===n&&o&&t.children.fromArray([e,o,i,r])}else if("margin-block"===e){const[e,r]=t.children.toArray();"flip-block"===n&&r&&t.children.fromArray([r,e])}else if("margin-inline"===e){const[e,r]=t.children.toArray();"flip-inline"===n&&r&&t.children.fromArray([r,e])}}(i,o,t),n[s]=ol(o)}),n}function rc(e){const t=function(e){return e.toArray().reduce((e,t)=>"Operator"===t.type&&","===t.value?(e.push([]),e):("Identifier"===t.type&&e[e.length-1].push(t),e),[[]])}(e),n=[];return t.forEach(e=>{const t={atRules:[],tactics:[],positionAreas:[]};e.forEach(e=>{!function(e){return Kl.includes(e)}(e.name)?e.name.startsWith("--")?t.atRules.push(e.name):El(e.name)&&t.positionAreas.push(e.name):t.tactics.push(e.name)}),t.positionAreas.length?n.push({positionArea:t.positionAreas[0],type:"position-area"}):t.atRules.length&&t.tactics.length?n.push({tactics:t.tactics,atRule:t.atRules[0],type:"at-rule-with-try-tactic"}):t.atRules.length?n.push({atRule:t.atRules[0],type:"at-rule"}):t.tactics.length&&n.push({tactics:t.tactics,type:"try-tactic"})}),n}function ic(e){if(function(e){return"Declaration"===e.type&&"position-try"===e.property}(e)&&e.value.children.first){const t=Yt(e);let n;const r=t.value.children.first.name;r&&function(e){return Gl.includes(e)}(r)&&(n=r,t.value.children.shift());return{order:n,options:rc(t.value.children)}}return{}}function oc(e){const{order:t,options:n}=ic(e);if(t||n)return{order:t,options:n};const{order:r}=function(e){return function(e){return"Declaration"===e.type&&"position-try-order"===e.property}(e)&&e.value.children.first?{order:e.value.children.first.name}:{}}(e),i=function(e){return function(e){return"Declaration"===e.type&&"position-try-fallbacks"===e.property}(e)&&e.value.children.first?rc(e.value.children):[]}(e);return r||i?{order:r,options:i}:{}}function sc(e){return oa(e.property)||function(e){return sa.includes(e)}(e.property)||la(e.property)||function(e){return ca.includes(e)}(e.property)||["position-anchor","position-area"].includes(e.property)}function ac(e){var t,n;if(function(e){return"Atrule"===e.type&&"position-try"===e.name}(e)&&null!=(t=e.prelude)&&t.value&&null!=(n=e.block)&&n.children){const t=e.prelude.value,n=e.block.children.filter(e=>function(e){return"Declaration"===e.type}(e)&&sc(e));return{name:t,tryBlock:{uuid:`${t}-try-${el(12)}`,declarations:Object.fromEntries(n.map(e=>[e.property,ol(e.value)]))}}}return{}}function lc(e){return!(!e||e!==e.window)}function cc(e){return!(!e||!function(e){return dl(e,"position","fixed")}(e)&&!dl(e,"position","absolute"))}function hc(e,t){return e.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_FOLLOWING}function uc(e){return Qe(this,null,function*(){if(!["absolute","fixed"].includes(pl(e,"position")))return yield function(e){return Qe(this,null,function*(){return yield Vt.getOffsetParent(e)})}(e);let t=e.parentElement;for(;t;){if(!dl(t,"position","static")&&dl(t,"display","block"))return t;t=t.parentElement}return window})}function pc(e,t,n,r){return Qe(this,null,function*(){const i=yield uc(e),o=yield uc(n);if(!function(e,t){return!(!e||e===t)&&(lc(e)?e.document.contains(t):e.contains(t))}(o,e)&&!lc(o)||i===o&&cc(e)&&!hc(e,n))return!1;if(i!==o){let e;const t=[];for(e=i;e&&e!==o&&e!==window;)t.push(e),e=yield uc(e);const r=t[t.length-1];if(r instanceof HTMLElement&&cc(r)&&!hc(r,n))return!1}{let t=e.parentElement;for(;t;){if(dl(t,"content-visibility","hidden"))return!1;t=t.parentElement}}return!(t&&r&&dc(e,t,r)!==dc(n,t,r))})}function dc(e,t,n){for(;!e.matches(n)||!gl(e,t);){if(!e.parentElement)return null;e=e.parentElement}return e}function mc(e,t,n,r,i){return Qe(this,null,function*(){if(!(e instanceof HTMLElement&&n.length&&cc(e)))return null;const o=n.flatMap(e=>function(e,t){const{elementPart:n,pseudoElementPart:r}=e,i=[];if(r&&"::before"!==r&&"::after"!==r)return i;const o=kl(t.roots,n);if(!r)return i.push(...o),i;for(const t of o){const{fakePseudoElement:n,sheet:r,computedStyle:o}=ml(t,e),s=n.getBoundingClientRect(),{scrollY:a,scrollX:l}=globalThis,c=fl(t);i.push({fakePseudoElement:n,computedStyle:o,removeFakePseudoElement(){n.remove(),r.remove()},contextElement:t,getBoundingClientRect(){const{scrollY:e,scrollX:t}=globalThis,{scrollTop:n,scrollLeft:r}=c;return DOMRect.fromRect({y:s.y+(a-e)+(c.scrollTop-n),x:s.x+(l-t)+(c.scrollLeft-r),width:s.width,height:s.height})}})}return i}(e,i)).filter(e=>function(e,t){const n=pl(e,"anchor-name");return t?n.split(",").map(e=>e.trim()).includes(t):!n}(e,t)),s=r.map(e=>e.selector).join(",")||null;for(let n=o.length-1;n>=0;n--){const r=o[n],i="fakePseudoElement"in r;if(yield pc(i?r.fakePseudoElement:r,t,e,s))return i&&r.removeFakePseudoElement(),r}return null})}function fc(e){return"Declaration"===e.type&&"anchor-name"===e.property}function gc(e){return"Declaration"===e.type&&"anchor-scope"===e.property}function bc(e){return!(!e||"Function"!==e.type||"anchor-size"!==e.name)}function kc(e){return!(!e||"Function"!==e.type||"var"!==e.name)}function yc(e){return!("Identifier"!==e.type||!e.name)}function vc(e,t){let n,r,i,o,s="",a=!1;const l=[];e.children.toArray().forEach(e=>{a?s=`${s}${ol(e)}`:"Operator"!==e.type||","!==e.value?l.push(e):a=!0});let[c,h]=l;if(h||(h=c,c=void 0),c&&(yc(c)&&c.name.startsWith("--")?n=c.name:kc(c)&&c.children.first&&(o=c.children.first.name)),h)if(rl(e)){if(yc(h)&&ma(h.name))r=h.name;else if(function(e){return!("Percentage"!==e.type||!e.value)}(h)){const e=Number(h.value);r=Number.isNaN(e)?void 0:e}}else bc(e)&&yc(h)&&function(e){return fa.includes(e)}(h.name)&&(i=h.name);const u=`--anchor-${el(12)}`;return Object.assign(e,{type:"Raw",value:`var(${u})`,children:null}),Reflect.deleteProperty(e,"name"),{anchorName:n,anchorSide:r,anchorSize:i,fallbackValue:s,customPropName:o,uuid:u}}function Sc(e){return e.value.children.map(({name:e})=>e)}let wc={},xc={},Cc={},Ac={},_c={};function Tc(e,t){var n;if((rl(e)||bc(e))&&t){if(t.property.startsWith("--")){const r=ol(t.value),i=vc(e);return Ac[i.uuid]=r,Cc[t.property]=[...null!=(n=Cc[t.property])?n:[],i],{changed:!0}}if(rl(e)&&oa(t.property)||bc(e)&&pa(t.property)){const n=vc(e);return{prop:t.property,data:n,changed:!0}}}return{}}function Lc(e,t,n){return Qe(this,null,function*(){let r=null==t?void 0:t.anchorName;const i=null==t?void 0:t.customPropName;if(e&&!r){const t=pl(e,"position-anchor");t?r=t:i&&(r=pl(e,i))}const o=r&&wc[r]||[],s=r&&xc[ul.All]||[],a=r&&xc[r]||[];return yield mc(e,r||null,o,[...s,...a],{roots:n.roots})})}function Ec(e,t){return Qe(this,null,function*(){var n,r,i,o,s,a,l,c,h,u,p;const d={},m={};wc={},xc={},Cc={},Ac={},_c={};const{fallbackTargets:f,validPositions:g}=function(e){const t={},n={},r={};for(const n of e){const e=il(n.css);ra(e,{visit:"Atrule",enter(e){const{name:n,tryBlock:r}=ac(e);n&&r&&(t[n]=r)}})}for(const i of e){let e=!1;const o=new Set,s=il(i.css);ra(s,{visit:"Declaration",enter(i){var s;const a=al(null==(s=this.rule)?void 0:s.prelude);if(!a.length)return;const{order:l,options:c}=oc(i),h={};l&&(h.order=l),a.forEach(({selector:i})=>{var s;null==c||c.forEach(r=>{var s;let a;if("at-rule"===r.type)a=r.atRule;else if("try-tactic"===r.type){a=`${i}-${r.tactics.join("-")}`;const e=Yl(i,r.tactics);e&&(t[a]={uuid:`${i}-${r.tactics.join("-")}-try-${el(12)}`,declarations:e})}else if("at-rule-with-try-tactic"===r.type){a=`${i}-${r.atRule}-${r.tactics.join("-")}`;const e=Jl(t[r.atRule],r.tactics);e&&(t[a]={uuid:`${i}-${r.atRule}-${r.tactics.join("-")}-try-${el(12)}`,declarations:e})}if(a&&t[a]){const r=`[data-anchor-polyfill="${t[a].uuid}"]`;null!=n[r]||(n[r]=[]),n[r].push(i),o.has(a)||(null!=h.fallbacks||(h.fallbacks=[]),h.fallbacks.push(t[a]),o.add(a),null==(s=this.stylesheet)||s.children.prependData({type:"Rule",prelude:{type:"Raw",value:r},block:{type:"Block",children:(new Kt).fromArray(Object.entries(t[a].declarations).map(([e,t])=>({type:"Declaration",important:!0,property:e,value:{type:"Raw",value:t}})))}}),e=!0)}}),Object.keys(h).length>0&&(r[i]?(h.order&&(r[i].order=h.order),h.fallbacks&&(null!=(s=r[i]).fallbacks||(s.fallbacks=[]),r[i].fallbacks.push(...h.fallbacks))):r[i]=h)})}}),e&&(i.css=ol(s),i.changed=!0)}return{fallbackTargets:n,validPositions:r}}(e);for(const t of e){let e=!1;const n=il(t.css);ra(n,function(t){var n,r,i,o;const s=al(null==(n=this.rule)?void 0:n.prelude);if(fc(t)&&s.length)for(const e of Sc(t))null!=wc[e]||(wc[e]=[]),wc[e].push(...s);if(gc(t)&&s.length)for(const e of Sc(t))null!=xc[e]||(xc[e]=[]),xc[e].push(...s);const{prop:a,data:l,changed:c}=Tc(t,this.declaration);if(a&&l&&s.length)for(const{selector:e}of s)d[e]=qe(He({},d[e]),{[a]:[...null!=(i=null==(r=d[e])?void 0:r[a])?i:[],l]});let h;if(this.block&&(h=Wl(t),h)){Vl(h,this.block);for(const{selector:e}of s)m[e]=[...null!=(o=m[e])?o:[],h]}(c||h)&&(e=!0)}),e&&(t.css=ol(n),t.changed=!0)}const b=new Set(Object.keys(Cc)),k={},y=e=>{var t,n,r,i,o;const s=[],a=new Set(null!=(n=null==(t=k[e])?void 0:t.names)?n:[]);for(;a.size>0;)for(const e of a)s.push(...null!=(r=Cc[e])?r:[]),a.delete(e),null!=(o=null==(i=k[e])?void 0:i.names)&&o.length&&k[e].names.forEach(e=>a.add(e));return s};for(;b.size>0;){const t=[];for(const n of e){let e=!1;const r=il(n.css);ra(r,{visit:"Function",enter(n){var r,i;const o=null==(r=this.rule)?void 0:r.prelude,s=this.declaration,a=null==s?void 0:s.property;if(!1===(null==o?void 0:o.children.isEmpty)&&kc(n)&&s&&a&&n.children.first&&b.has(n.children.first.name)&&a.startsWith("--")){const r=n.children.first,o=null!=(i=Cc[r.name])?i:[],l=y(r.name);if(!o.length&&!l.length)return;const c=`${r.name}-anchor-${el(12)}`,h=ol(s.value);Ac[c]=h,k[a]||(k[a]={names:[],uuids:[]});const u=k[a];u.names.includes(r.name)||u.names.push(r.name),u.uuids.push(c),t.push(a),r.name=c,e=!0}}}),e&&(n.css=ol(r),n.changed=!0)}b.clear(),t.forEach(e=>b.add(e))}for(const t of e){let e=!1;const n=il(t.css);ra(n,{visit:"Function",enter(t){var n,r,i,o,s,a,l;const c=null==(n=this.rule)?void 0:n.prelude,h=this.declaration,u=null==h?void 0:h.property;if(!1===(null==c?void 0:c.children.isEmpty)&&kc(t)&&h&&u&&t.children.first&&(oa(u)||la(u))){const n=t.children.first,h=null!=(r=Cc[n.name])?r:[],p=y(n.name);if(!h.length&&!p.length)return;const m=`${u}-${el(12)}`;if(p.length){const e=new Set([n.name]);for(;e.size>0;)for(const t of e){const n=k[t];if(null!=(i=null==n?void 0:n.names)&&i.length&&null!=(o=null==n?void 0:n.uuids)&&o.length)for(const e of n.names)for(const t of n.uuids)_c[t]=qe(He({},_c[t]),{[m]:`${e}-${m}`});e.delete(t),null!=(s=null==n?void 0:n.names)&&s.length&&n.names.forEach(t=>e.add(t))}}const f=al(c);for(const e of[...h,...p]){const t=He({},e),n=`--anchor-${el(12)}-${u}`,r=t.uuid;t.uuid=n;for(const{selector:e}of f)d[e]=qe(He({},d[e]),{[u]:[...null!=(l=null==(a=d[e])?void 0:a[u])?l:[],t]});_c[r]=qe(He({},_c[r]),{[m]:n})}n.name=`${n.name}-${m}`,e=!0}}}),e&&(t.css=ol(n),t.changed=!0)}if(Object.keys(_c).length>0)for(const t of e){let e=!1;const n=il(t.css);ra(n,{visit:"Function",enter(t){var n,r,i,o;if(kc(t)&&null!=(r=null==(n=t.children.first)?void 0:n.name)&&r.startsWith("--")&&null!=(o=null==(i=this.declaration)?void 0:i.property)&&o.startsWith("--")&&this.block){const n=t.children.first,r=_c[n.name];if(r)for(const[t,i]of Object.entries(r))this.block.children.appendData({type:"Declaration",important:!1,property:`${this.declaration.property}-${t}`,value:{type:"Raw",value:ol(this.declaration.value).replace(`var(${n.name})`,`var(${i})`)}}),e=!0;Ac[n.name]&&(this.declaration.value={type:"Raw",value:Ac[n.name]},e=!0)}}}),e&&(t.css=ol(n),t.changed=!0)}const v=new Map;for(const[e,c]of Object.entries(d)){let h;h=e.startsWith("[data-anchor-polyfill=")&&null!=(n=f[e])&&n.length?kl(t.roots,f[e].join(",")):kl(t.roots,e);for(const[n,u]of Object.entries(c))for(const c of u)for(const u of h){const h=yield Lc(u,c,{roots:t.roots}),p=`--anchor-${el(12)}`;v.set(u,qe(He({},null!=(r=v.get(u))?r:{}),{[c.uuid]:p})),u.setAttribute("style",`${c.uuid}: var(${p}); ${null!=(i=u.getAttribute("style"))?i:""}`),g[e]=qe(He({},g[e]),{declarations:qe(He({},null==(o=g[e])?void 0:o.declarations),{[n]:[...null!=(l=null==(a=null==(s=g[e])?void 0:s.declarations)?void 0:a[n])?l:[],qe(He({},c),{anchorEl:h,targetEl:u,uuid:p})]})})}}const S={el:document.createElement("link"),changed:!1,created:!0,css:""};e.push(S);for(const[e,n]of Object.entries(m)){const r=kl(t.roots,e);for(const i of r){const r=yield Lc(i,null,{roots:t.roots});for(const t of n){const n=yield ql(i,t,r);S.css+=Ql(n.targetUUID,t.selectorUUID),S.changed=!0,g[e]=qe(He({},g[e]),{declarations:qe(He({},null==(c=g[e])?void 0:c.declarations),{"position-area":[...null!=(p=null==(u=null==(h=g[e])?void 0:h.declarations)?void 0:u["position-area"])?p:[],n]})})}}}return{rules:g,inlineStyles:v,anchorScopes:xc}})}const Oc=["as","blocking","crossorigin","disabled","fetchpriority","href","hreflang","integrity","referrerpolicy","rel","type"];function Pc(e,t,n=!1){const r=[];for(const{el:i,css:o,changed:s,created:a=!1}of e){const e={el:i,css:o,changed:!1};if(s)if("style"===i.tagName.toLowerCase())i.innerHTML=o;else if(i instanceof HTMLLinkElement){const t=document.createElement("style");t.textContent=o;for(const e of i.getAttributeNames())if(!e.startsWith("on")&&!Oc.includes(e)){const n=i.getAttribute(e);null!==n&&t.setAttribute(e,n)}i.hasAttribute("href")&&t.setAttribute("data-original-href",i.getAttribute("href")),a?(t.setAttribute("data-generated-by-polyfill","true"),document.head.insertAdjacentElement("beforeend",t)):(i.insertAdjacentElement("beforebegin",t),i.remove()),e.el=t}else if(i.hasAttribute("data-has-inline-styles")){const e=i.getAttribute("data-has-inline-styles");if(e){const n=`[data-has-inline-styles="${e}"]{`;let r=o.slice(n.length,-1);const s=null==t?void 0:t.get(i);if(s)for(const[e,t]of Object.entries(s))r=`${e}: var(${t}); ${r}`;i.setAttribute("style",r)}}n&&i.hasAttribute("data-has-inline-styles")&&i.removeAttribute("data-has-inline-styles"),r.push(e)}return r}const Dc=qe(He({},Vt),{_c:new Map}),Fc=e=>{switch(e){case"top":case"bottom":case"inset-block-start":case"inset-block-end":return"y";case"left":case"right":case"inset-inline-start":case"inset-inline-end":return"x"}return null},Mc=e=>"inline"===pl(e,"display"),zc=(e,t)=>("x"===t?["border-left-width","border-right-width"]:["border-top-width","border-bottom-width"]).reduce((t,n)=>t+parseInt(pl(e,n),10),0)||0,jc=(e,t)=>parseInt(pl(e,`margin-${t}`),10)||0,Ic=e=>({top:jc(e,"top"),right:jc(e,"right"),bottom:jc(e,"bottom"),left:jc(e,"left")}),Nc=e=>Qe(null,[e],function*({targetEl:e,targetProperty:t,anchorRect:n,anchorSide:r,anchorSize:i,fallback:o=null}){var s;if(!i&&void 0===r||!e||!n)return o;if(i){if(!pa(t))return o;let r;switch(i){case"width":case"height":r=i;break;default:{let t=!1;const n=pl(e,"writing-mode");t=n.startsWith("vertical-")||n.startsWith("sideways-"),r=((e,t)=>{let n;switch(e){case"block":case"self-block":n=t?"width":"height";break;case"inline":case"self-inline":n=t?"height":"width"}return n})(i,t)}}return r?`${n[r]}px`:o}if(void 0!==r){let i,a;const l=Fc(t);if(!oa(t)||!l||oa(r)&&l!==Fc(r))return o;const c=["top","left","inset-block-start","inset-inline-start"],h=["bottom","right","inset-block-end","inset-inline-end"];switch(r){case"left":case"top":i=0;break;case"right":case"bottom":i=100;break;case"center":i=50;break;case"inside":i=c.includes(t)?0:100;break;case"outside":i=c.includes(t)?100:0;break;default:if(e){i=((e,t)=>{let n;switch(e){case"start":case"self-start":n=0;break;case"end":case"self-end":n=100;break;default:"number"==typeof e&&!Number.isNaN(e)&&(n=e)}if(void 0!==n)return t?100-n:n})(r,(yield null==(s=Vt.isRTL)?void 0:s.call(Vt,e))||!1)}}const u="number"==typeof i&&!Number.isNaN(i),p=(e=>{switch(e){case"x":return"width";case"y":return"height"}return null})(l);if(u&&p){h.includes(t)&&(a=yield bl(e));let r=n[l]+n[p]*(i/100);switch(t){case"bottom":case"inset-block-end":{if(!a)break;let e=a.clientHeight;if(0===e&&Mc(a)){const t=zc(a,l);e=a.offsetHeight-t}r=e-r;break}case"right":case"inset-inline-end":{if(!a)break;let e=a.clientWidth;if(0===e&&Mc(a)){const t=zc(a,l);e=a.offsetWidth-t}r=e-r;break}}return`${r}px`}}return o}),Rc=e=>"wrapperEl"in e,Bc=e=>"uuid"in e;function $c(e,t=!1){return Qe(this,null,function*(){const n=document.documentElement;for(const[r,i]of Object.entries(e))for(const e of i){const i=e.anchorEl,o=e.targetEl;if(i&&o)if(Rc(e)){const r=e.wrapperEl,s=(e,t,n)=>Qe(null,null,function*(){return 0===e?"0px":yield Nc({targetEl:r,targetProperty:t,anchorRect:n,anchorSide:e})});qt(i,r,()=>Qe(null,null,function*(){const t=pl(o,Cl);r.setAttribute(Al,t);const a=yield Vt.getElementRects({reference:i,floating:r,strategy:"absolute"}),l=e.insets,c=yield s(l.block[0],"top",a.reference),h=yield s(l.block[1],"bottom",a.reference),u=yield s(l.inline[0],"left",a.reference),p=yield s(l.inline[1],"right",a.reference);n.style.setProperty(`${e.targetUUID}-top`,c||null),n.style.setProperty(`${e.targetUUID}-left`,u||null),n.style.setProperty(`${e.targetUUID}-right`,p||null),n.style.setProperty(`${e.targetUUID}-bottom`,h||null),n.style.setProperty(`${e.targetUUID}-justify-self`,e.alignments.inline),n.style.setProperty(`${e.targetUUID}-align-self`,e.alignments.block)}),{animationFrame:t})}else qt(i,o,()=>Qe(null,null,function*(){const t=yield Vt.getElementRects({reference:i,floating:o,strategy:"absolute"}),s=yield Nc({targetEl:o,targetProperty:r,anchorRect:t.reference,anchorSide:e.anchorSide,anchorSize:e.anchorSize,fallback:e.fallbackValue});n.style.setProperty(e.uuid,s)}),{animationFrame:t});else if(Bc(e)){const t=yield Nc({targetProperty:r,anchorSide:e.anchorSide,anchorSize:e.anchorSize,fallback:e.fallbackValue});n.style.setProperty(e.uuid,t)}}})}function Uc(e,t){return Qe(this,null,function*(){const n=yield Vt.getElementRects({reference:e,floating:e,strategy:"absolute"});return yield Qt({x:e.offsetLeft,y:e.offsetTop,platform:Dc,rects:n,elements:{floating:e,reference:t},strategy:"absolute"},{padding:Ic(e)})})}function Wc(e,t,n=!1){return Qe(this,null,function*(){if(!t.length)return;const r=document.querySelectorAll(e);for(const e of r){let r=!1;const i=yield bl(e);qt({},e,()=>Qe(null,null,function*(){if(r)return;r=!0,e.removeAttribute("data-anchor-polyfill");const n=yield Uc(e,i);if(Object.values(n).every(e=>e<=0))return e.removeAttribute("data-anchor-polyfill-last-successful"),void(r=!1);for(const[n,{uuid:o}]of t.entries()){e.setAttribute("data-anchor-polyfill",o);const s=yield Uc(e,i);if(Object.values(s).every(e=>e<=0)){e.setAttribute("data-anchor-polyfill-last-successful",o),r=!1;break}if(n===t.length-1){const t=e.getAttribute("data-anchor-polyfill-last-successful");t?e.setAttribute("data-anchor-polyfill",t):e.removeAttribute("data-anchor-polyfill"),r=!1;break}}}),{animationFrame:n,layoutShift:!1})}})}function Vc(e){return Qe(this,null,function*(){const t=function(e={}){const t="boolean"==typeof e?{useAnimationFrame:e}:e,n=void 0===t.useAnimationFrame?!!window.UPDATE_ANCHOR_ON_ANIMATION_FRAME:t.useAnimationFrame;return Array.isArray(t.elements)||(t.elements=void 0),(!Array.isArray(t.roots)||0===t.roots.length)&&(t.roots=[document]),Object.assign(t,{useAnimationFrame:n})}(null!=e?e:window.ANCHOR_POSITIONING_POLYFILL_OPTIONS);let n,r=yield wl(t),i={};nl.clear();try{(function(e){for(const t of e){let e=!1;const n=il(t.css,!0);ra(n,{visit:"Declaration",enter(t){var n;const r=null==(n=this.rule)?void 0:n.block,{updated:i}=hl(t,r),{updated:o}=cl(t,r);(o||i)&&(e=!0)}}),e&&(t.css=ol(n),t.changed=!0)}return e.some(e=>!0===e.changed)})(r)&&(r=Pc(r));const e=yield Ec(r,{roots:t.roots});i=e.rules,n=e.inlineStyles}catch(e){throw nl.size>0&&nl.forEach(e=>{}),e}return Object.values(i).length&&(Pc(r,n,!0),yield function(e,t=!1){return Qe(this,null,function*(){var n,r;for(const r of Object.values(e))yield $c(null!=(n=r.declarations)?n:{},t);for(const[n,i]of Object.entries(e))yield Wc(n,null!=(r=i.fallbacks)?r:[],t)})}(i,t.useAnimationFrame)),i})}let Hc=!1;const qc=(e,t,n)=>{if(!e.hasAttribute(t))return n;const r=e.getAttribute(t);return""===r||"true"===r};class Qc extends HTMLElement{constructor(e={}){super(),this.params={...e},Hc||(Vc(),Hc=!0),this.bindHandlers(),this.isEventsBound=!1,this.initialize(e)}initialize(e={}){const t=this.resolveConfig(e);this.translations=new Ie(t.language,t.customTranslations),this.selectorOptions=new Me({translations:this.translations,presetThemesAllowed:t.presetThemesAllowed,customThemesAllowed:t.customThemesAllowed,customPresets:t.customPresets});const n=this.initColors();this.initDensity();const r=((e={})=>{const t=ce("div","h5p-theme-picker"),n=ce("div","h5p-theme-picker-details"),r=new Te({translations:e.translations,densityAllowed:e.densityAllowed}),i=new me({translations:e.translations,customColorButtons:e.customColorButtons,customColorNavigation:e.customColorNavigation,customColorAlternative:e.customColorAlternative,customColorBackground:e.customColorBackground}),o=new Ce({translations:e.translations});return t.append(r,n),n.append(i,o),{dom:t,selector:r,colorSelector:i,preview:o,details:n}})({translations:this.translations,customColorButtons:this.selectedThemeColors["--h5p-theme-main-cta-base"],customColorNavigation:this.selectedThemeColors["--h5p-theme-secondary-cta-base"],customColorAlternative:this.selectedThemeColors["--h5p-theme-alternative-base"],customColorBackground:this.selectedThemeColors["--h5p-theme-background"],densityAllowed:t.densityAllowed}),{dom:i,selector:o,colorSelector:s,preview:a,details:l}=r;this.dom=i,this.selector=o,this.colorSelector=s,this.preview=a,this.details=l,this.initComponents(n)}resolveConfig(e={}){return{language:this.getAttribute("language")||e.language,customTranslations:this.getAttribute("translations")??e.translations??{},customPresets:this.getAttribute("custom-presets")??e.customPresets??{},presetThemesAllowed:qc(this,"preset-themes-allowed",e.presetThemesAllowed??!0),customThemesAllowed:qc(this,"custom-themes-allowed",e.customThemesAllowed??!0),densityAllowed:qc(this,"density-allowed",e.densityAllowed??!0)}}initColors(){const e=this.selectorOptions.getThemeOptions().entries().next().value;if(!e)throw new Error("ThemePicker: No theme options available.");const[t,n]=e;let r;return this.params.theme=this.params.theme||this.getAttribute("theme-name")||t,this.params.theme&&this.selectorOptions.getThemeOptions().has(this.params.theme)?r=this.selectorOptions.getThemeOptions().get(this.params.theme):(r=n,this.params.theme=t),"custom"===this.params.theme?this.selectedThemeColors=oe(this.getAttribute("custom-color-buttons")||n.values["--h5p-theme-main-cta-base"],this.getAttribute("custom-color-navigation")||n.values["--h5p-theme-secondary-cta-base"],ie(this.getAttribute("custom-color-alternative")||n.values["--h5p-theme-alternative-base"]),this.getAttribute("custom-color-background")||n.values["--h5p-theme-background"]):this.selectedThemeColors=r.values,r}initDensity(){const e=this.selectorOptions.getDensityOptions().entries().next().value;if(!e)throw new Error("ThemePicker: no density options available.");const[t]=e;this.params.density=this.params.density||this.getAttribute("density")||t,"wide"===this.params.density?this.params.density="large":"compact"===this.params.density?this.params.density="small":this.selectorOptions.getDensityOptions().has(this.params.density)||(this.params.density=t)}initComponents(e){this.selector.setThemeOptions(this.selectorOptions.getThemeOptions()),this.selector.setDensityOptions(this.selectorOptions.getDensityOptions()),this.selector.setActiveTheme(this.params.theme),this.selectedDensity=this.params.density,this.selector.setActiveDensity(this.params.density),this.applyPreviewState({themeValues:this.selectedThemeColors,themeLabel:e.label,densityKey:this.selectedDensity}),this.colorSelector.toggleVisibility("custom"===this.params.theme),this.details.classList.toggle("open","custom"===this.params.theme)}getThemeValuesByKey(e){if("custom"===e){const e=this.colorSelector.getValues();return oe(e["--h5p-theme-main-cta-base"],e["--h5p-theme-secondary-cta-base"],ie(e["--h5p-theme-alternative-base"]),e["--h5p-theme-background"])}return this.selectorOptions.getThemeOptions().get(e)?.values??{}}applyPreviewState({themeValues:e=this.selectedThemeColors,themeLabel:t,densityKey:n=this.selectedDensity}={}){this.preview.setValues(e,t),this.preview.setValues(this.selectorOptions.getDensityOptions().get(n)?.values??{})}connectedCallback(){this.render(),this.isEventsBound||this.bindEvents()}disconnectedCallback(){this.isEventsBound&&this.unbindEvents()}handleThemeChange(e){const t=e?.detail?.key;if(!t||!this.selectorOptions.getThemeOptions().has(t))return;const n=this.getThemeValuesByKey(t);this.selectedThemeColors=n,this.applyPreviewState({themeValues:this.selectedThemeColors,themeLabel:this.selectorOptions.getThemeOptions().get(t)?.label,densityKey:this.selectedDensity}),this.colorSelector.toggleVisibility("custom"===t),this.details.classList.toggle("open","custom"===t),this.dispatchChangeEvent()}handleThemePreview(e){const t=e?.detail?.key;t&&this.applyPreviewState({themeValues:this.getThemeValuesByKey(t),themeLabel:this.selectorOptions.getThemeOptions().get(t)?.label,densityKey:this.selectedDensity})}handleThemePreviewReset(){this.applyPreviewState()}handleDensityChange(e){const t=e?.detail?.key;t&&this.selectorOptions.getDensityOptions().has(t)&&(this.selectedDensity=t,this.applyPreviewState({densityKey:t}),this.dispatchChangeEvent())}handleDensityPreview(e){const t=e?.detail?.key;t&&this.applyPreviewState({densityKey:t})}handleDensityPreviewReset(){this.applyPreviewState()}handleColorChange(e){if(!e?.detail?.id||!e?.detail?.color)return;const{id:t,color:n}=e.detail,r={buttons:this.selectedThemeColors["--h5p-theme-main-cta-base"],navigation:this.selectedThemeColors["--h5p-theme-secondary-cta-base"],alternative:this.selectedThemeColors["--h5p-theme-alternative-base"],background:this.selectedThemeColors["--h5p-theme-background"]};r[t]=n,this.selectedThemeColors=oe(r.buttons,r.navigation,ie(r.alternative),r.background),this.applyPreviewState(),this.dispatchChangeEvent()}bindHandlers(){this.handleThemeChange=this.handleThemeChange.bind(this),this.handleThemePreview=this.handleThemePreview.bind(this),this.handleThemePreviewReset=this.handleThemePreviewReset.bind(this),this.handleDensityChange=this.handleDensityChange.bind(this),this.handleDensityPreview=this.handleDensityPreview.bind(this),this.handleDensityPreviewReset=this.handleDensityPreviewReset.bind(this),this.handleColorChange=this.handleColorChange.bind(this)}unbindEvents(){this.selector.removeEventListener("theme-change",this.handleThemeChange),this.selector.removeEventListener("theme-preview",this.handleThemePreview),this.selector.removeEventListener("theme-preview-reset",this.handleThemePreviewReset),this.selector.removeEventListener("density-change",this.handleDensityChange),this.selector.removeEventListener("density-preview",this.handleDensityPreview),this.selector.removeEventListener("density-preview-reset",this.handleDensityPreviewReset),this.colorSelector.removeEventListener("change",this.handleColorChange),this.isEventsBound=!1}bindEvents(){this.selector.addEventListener("theme-change",this.handleThemeChange),this.selector.addEventListener("theme-preview",this.handleThemePreview),this.selector.addEventListener("theme-preview-reset",this.handleThemePreviewReset),this.selector.addEventListener("density-change",this.handleDensityChange),this.selector.addEventListener("density-preview",this.handleDensityPreview),this.selector.addEventListener("density-preview-reset",this.handleDensityPreviewReset),this.colorSelector.addEventListener("change",this.handleColorChange),this.isEventsBound=!0}dispatchChangeEvent(){this.dispatchEvent(new CustomEvent("theme-change",{detail:this.getValue(),bubbles:!0,composed:!0}))}getValue(){return{theme:this.selector.getActiveTheme(),data:{colors:this.selectedThemeColors,density:this.selectedDensity}}}render(){this.contains(this.dom)||this.append(this.dom)}}customElements.get("h5p-theme-picker")||customElements.define("h5p-theme-picker",Qc)})();
|
|
1
|
+
(()=>{"use strict";var e={463(e,t,n){n.d(t,{A:()=>a});var r=n(601),i=n.n(r),o=n(314),s=n.n(o)()(i());s.push([e.id,".h5p-theme-picker-color-selector{display:flex;flex-direction:column;gap:1rem;.sp-container.hue .sp-picker-container{height:183px;width:1rem;.sp-top{height:calc(100% - 10px);.sp-top-inner{.sp-color{display:none}.sp-hue{right:auto}}}}.h5p-theme-picker-color-selector-title{color:var(--h5p-theme-picker-color-text);font-weight:700}.h5p-theme-picker-color-selector-grid{align-items:center;display:grid;font-size:.875rem;font-weight:700;gap:1rem;grid-template-columns:auto 1fr;.h5p-theme-picker-color-selector-label{width:fit-content}}&.display-none{display:none}}",""]);const a=s},223(e,t,n){n.d(t,{A:()=>a});var r=n(601),i=n.n(r),o=n(314),s=n.n(o)()(i());s.push([e.id,".h5p-theme-picker-color-picker{.h5p-theme-picker-color-picker-button{aspect-ratio:1;background-color:#fff;border:1px solid var(--h5p-theme-picker-color-stroke);border-radius:2px;cursor:pointer;height:2.5rem;padding:.5rem;.h5p-theme-picker-color-picker-preview{aspect-ratio:1;border:1px solid var(--h5p-theme-picker-color-stroke);border-radius:2px;box-sizing:border-box;height:100%;transition:background-color .2s}}&:hover .h5p-theme-picker-color-picker-button{border-color:var(--h5p-theme-picker-color-stroke-diff10l)}.h5p-theme-picker-color-picker-popover{border:1px solid var(--h5p-theme-picker-color-stroke);inset:auto;left:anchor(left);padding:.5rem;position:absolute;top:anchor(bottom);.h5p-theme-picker-color-picker-slider{appearance:none;-webkit-appearance:none;border-radius:3px;height:1rem;outline:none;&::-webkit-slider-thumb{-webkit-appearance:none;appearance:none;background:#fff;border:1px solid var(--h5p-theme-picker-color-stroke);border-radius:2px;box-shadow:0 0 3px rgba(0,0,0,.2);cursor:pointer;height:1.5rem;width:.75rem}&:focus-visible{&::-webkit-slider-thumb{outline:2px solid #000}}&.hue{background:linear-gradient(90deg,red,#ff0,#0f0,#0ff,#00f,#f0f,red)}&.opacity{background:linear-gradient(90deg,transparent,#000)}}}&.alternative{.h5p-theme-picker-color-picker-button{anchor-name:--color-picker-alternative}.h5p-theme-picker-color-picker-popover{position-anchor:--color-picker-alternative}}.h5p-theme-picker-color-picker-input{cursor:pointer;height:2.5rem;opacity:0;position:absolute;width:2.5rem}}",""]);const a=s},624(e,t,n){n.d(t,{A:()=>a});var r=n(601),i=n.n(r),o=n(314),s=n.n(o)()(i());s.push([e.id,":host{display:block}.h5p-theme-picker{--h5p-theme-spacing-xl-primary-small:calc(var(--h5p-theme-spacing-xl-primary-medium)*0.8);--h5p-theme-spacing-primary-small:calc(var(--h5p-theme-spacing-primary-medium)*0.8);--h5p-theme-spacing-secondary-small:calc(var(--h5p-theme-spacing-secondary-medium)*0.8);--h5p-theme-spacing-third-small:calc(var(--h5p-theme-spacing-third-medium)*0.8);--h5p-theme-spacing-fourth-small:calc(var(--h5p-theme-spacing-fourth-medium)*0.8);--h5p-theme-spacing-fifth-small:calc(var(--h5p-theme-spacing-fifth-medium)*0.8);--h5p-theme-font-size-xxl-small:calc(var(--h5p-theme-font-size-xxl-medium)*1);--h5p-theme-font-size-xl-small:calc(var(--h5p-theme-font-size-xl-medium)*1);--h5p-theme-font-size-l-small:calc(var(--h5p-theme-font-size-l-medium)*1);--h5p-theme-font-size-m-small:calc(var(--h5p-theme-font-size-m-medium)*1);--h5p-theme-font-size-s-small:calc(var(--h5p-theme-font-size-s-medium)*1);--h5p-theme-spacing-xl-primary-medium:calc(var(--h5p-theme-spacing-xl-primary-large)*0.8);--h5p-theme-spacing-primary-medium:calc(var(--h5p-theme-spacing-primary-large)*0.8);--h5p-theme-spacing-secondary-medium:calc(var(--h5p-theme-spacing-secondary-large)*0.8);--h5p-theme-spacing-third-medium:calc(var(--h5p-theme-spacing-third-large)*0.8);--h5p-theme-spacing-fourth-medium:calc(var(--h5p-theme-spacing-fourth-large)*0.8);--h5p-theme-spacing-fifth-medium:calc(var(--h5p-theme-spacing-fifth-large)*0.8);--h5p-theme-font-size-xxl-medium:calc(var(--h5p-theme-font-size-xxl-large)*0.9);--h5p-theme-font-size-xl-medium:calc(var(--h5p-theme-font-size-xl-large)*0.9);--h5p-theme-font-size-l-medium:calc(var(--h5p-theme-font-size-l-large)*0.9);--h5p-theme-font-size-m-medium:calc(var(--h5p-theme-font-size-m-large)*0.9);--h5p-theme-font-size-s-medium:calc(var(--h5p-theme-font-size-s-large)*0.9);--h5p-theme-spacing-xl-primary-large:3rem;--h5p-theme-spacing-primary-large:2rem;--h5p-theme-spacing-secondary-large:1.5rem;--h5p-theme-spacing-third-large:1rem;--h5p-theme-spacing-fourth-large:0.65rem;--h5p-theme-spacing-fifth-large:0.5rem;--h5p-theme-font-size-xxl-large:1.5rem;--h5p-theme-font-size-xl-large:1.25rem;--h5p-theme-font-size-l-large:1.125rem;--h5p-theme-font-size-m-large:1rem;--h5p-theme-font-size-s-large:0.85rem;--h5p-theme-picker-color-background:#fff;--h5p-theme-picker-color-text:#61686b;--h5p-theme-picker-color-stroke:#dfe2ec;--h5p-theme-picker-color-stroke-diff10l:color-mix(in hsl,var(--h5p-theme-picker-color-stroke) 90%,#000);background:var(--h5p-theme-picker-color-background);container-name:theme-picker;container-type:inline-size;display:flex;flex-direction:column;font-family:sans-serif;gap:2rem;padding:.5rem;.h5p-theme-picker-details{display:grid;gap:1rem;&:not(.open){grid-template-columns:1fr}&.open{grid-template-columns:minmax(0,320px) 1fr}}}@container theme-picker (width < 640px){.h5p-theme-picker .h5p-theme-picker-details.open{grid-template-columns:1fr}}",""]);const a=s},220(e,t,n){n.d(t,{A:()=>a});var r=n(601),i=n.n(r),o=n(314),s=n.n(o)()(i());s.push([e.id,'.h5p-theme-picker-preview{container-name:h5p-theme-picker-preview;container-type:inline-size;display:flex;flex-direction:column;gap:.5rem;.h5p-theme-picker-preview-label{color:var(--h5p-theme-picker-color-text);font-size:.875rem;font-weight:700;&:before{content:"\\1f441";margin-right:.5rem}&:after{color:#000;content:attr(data-theme-name);margin-left:.5rem}}.h5p-theme-picker-preview-mockup{--zoom-min:0;--zoom-max:3;--zoom-divider:300px;--zoom-factor:clamp(var(--zoom-min),calc(100cqw/var(--zoom-divider)),var(--zoom-max));border:1px solid var(--h5p-theme-picker-color-stroke);display:flex;flex-direction:column;max-width:calc(var(--zoom-max)*var(--zoom-divider));.h5p-theme-picker-preview-mockup-blank{background-color:var(--h5p-theme-alternative-base);border-radius:var(--h5p-theme-border-radius-small,.25rem);height:calc(var(--zoom-factor)*var(--h5p-theme-font-size-s, .85rem))}.h5p-theme-picker-preview-mockup-bar{position:relative;&:before{background-color:var(--h5p-theme-text-primary);content:"";height:.25rem;left:50%;position:absolute;top:50%;transform:translate(-50%,-50%);width:100%}}.h5p-theme-picker-preview-mockup-main{background-color:var(--h5p-theme-background);display:grid;gap:calc(var(--zoom-factor)*var(--h5p-theme-spacing-s, 1rem));grid-template-columns:40fr 60fr;padding:calc(var(--zoom-factor)*var(--h5p-theme-spacing-s, 1rem));.h5p-theme-picker-preview-mockup-box{background-color:var(--h5p-theme-ui-base);border-radius:var(--h5p-theme-border-radius-small,.25rem);display:grid;flex-direction:column;gap:calc(var(--zoom-factor)*var(--h5p-theme-spacing-xxs, .5rem));padding:calc(var(--zoom-factor)*var(--h5p-theme-spacing-xs, .65rem));&.multi-choice{.h5p-theme-picker-preview-mockup-inner-main{display:flex;flex-direction:column;gap:calc(var(--zoom-factor)*.5*var(--h5p-theme-spacing-xxs, .5rem));.h5p-theme-picker-preview-mockup-bar{margin-bottom:calc(var(--zoom-factor)*var(--h5p-theme-spacing-xxs, .5rem));width:50%}}}&.drag-text{.h5p-theme-picker-preview-mockup-inner-main{border-radius:var(--h5p-theme-border-radius-small,.25rem);display:grid;gap:calc(var(--zoom-factor)*.5*var(--h5p-theme-spacing-xxs, .5rem));grid-template-columns:1fr auto;.h5p-theme-picker-preview-mockup-text-container{background-color:var(--h5p-theme-alternative-light);display:flex;flex-direction:column;gap:calc(var(--zoom-factor)*.25*var(--h5p-theme-spacing-xxs, .5rem));padding:calc(var(--zoom-factor)*var(--h5p-theme-spacing-xxs, .5rem));.h5p-theme-picker-preview-mockup-text-row{display:grid;gap:calc(var(--zoom-factor)*var(--h5p-theme-spacing-xxs, .5rem));&:nth-child(n){grid-template-columns:35fr 65fr}&:nth-child(2n){grid-template-columns:65fr 35fr}.h5p-theme-picker-preview-mockup-blank{background-color:var(--h5p-theme-alternative-dark)}.h5p-theme-picker-preview-mockup-bar{height:calc(var(--zoom-factor)*var(--h5p-theme-font-size-s, .85rem))}}}.h5p-theme-picker-preview-mockup-draggable-container{display:flex;flex-direction:column;gap:calc(var(--zoom-factor)*.5*var(--h5p-theme-spacing-xxs, .5rem))}}}}}.h5p-theme-picker-preview-mockup-footer{background-color:var(--h5p-theme-ui-base);display:flex;flex-direction:row;gap:calc(var(--zoom-factor)*var(--h5p-theme-spacing-s, 1rem));justify-content:space-between;padding:calc(var(--zoom-factor)*var(--h5p-theme-spacing-s, 1rem))}.h5p-theme-picker-preview-mockup-button{aspect-ratio:2;border-radius:var(--h5p-theme-border-radius-medium,.375rem);height:calc(var(--zoom-factor)*var(--h5p-theme-font-size-m, 1rem));position:relative;&:before{content:"";height:.25rem;left:50%;position:absolute;top:50%;transform:translate(-50%,-50%);width:50%}&.main{background-color:var(--h5p-theme-main-cta-base);&:before{background-color:var(--h5p-theme-contrast-cta)}}&.secondary{background-color:var(--h5p-theme-secondary-cta-base);&:before{background-color:var(--h5p-theme-secondary-contrast-cta)}}}.h5p-theme-picker-preview-mockup-draggable{aspect-ratio:2;background-color:var(--h5p-theme-alternative-base);border-radius:var(--h5p-theme-border-radius-medium,.375rem);height:calc(var(--zoom-factor)*var(--h5p-theme-font-size-m, 1rem));position:relative;&:before{align-items:center;background-color:var(--h5p-theme-main-cta-base);border-bottom-left-radius:var(--h5p-theme-border-radius-medium,.375rem);border-top-left-radius:var(--h5p-theme-border-radius-medium,.375rem);color:var(--h5p-theme-contrast-cta);content:"\\283f";display:flex;font-size:var(--h5p-theme-font-size-m);font-weight:700;height:100%;justify-content:center;left:0;transform:translateY(-50%);width:var(--h5p-theme-font-size-m,1rem)}&:after,&:before{position:absolute;top:50%}&:after{background-color:var(--h5p-theme-text-primary);content:"";height:.25rem;left:calc(50% + var(--h5p-theme-font-size-m, 1rem)*.5);transform:translate(-50%,-50%);width:50%}}}}@supports ((-moz-appearance:none) or (not (width:1cqw))){@container h5p-theme-picker-preview (width < 300px){.h5p-theme-picker-preview .h5p-theme-picker-preview-mockup{--zoom-factor:0.5}}@container h5p-theme-picker-preview (width >= 300px){.h5p-theme-picker-preview .h5p-theme-picker-preview-mockup{--zoom-factor:1}}@container h5p-theme-picker-preview (width >= 450px){.h5p-theme-picker-preview .h5p-theme-picker-preview-mockup{--zoom-factor:1.5}}@container h5p-theme-picker-preview (width >= 600px){.h5p-theme-picker-preview .h5p-theme-picker-preview-mockup{--zoom-factor:2}}@container h5p-theme-picker-preview (width >= 750px){.h5p-theme-picker-preview .h5p-theme-picker-preview-mockup{--zoom-factor:2.5}}@container h5p-theme-picker-preview (width >= 900px){.h5p-theme-picker-preview .h5p-theme-picker-preview-mockup{--zoom-factor:3}}}',""]);const a=s},665(e,t,n){n.d(t,{A:()=>a});var r=n(601),i=n.n(r),o=n(314),s=n.n(o)()(i());s.push([e.id,'.h5p-theme-picker-selector-box{align-items:center;display:grid;gap:1rem;grid-template-columns:auto 1fr;width:max-content;.h5p-theme-picker-label{color:var(--h5p-theme-picker-color-text);font-size:.875rem;font-weight:700}.h5p-theme-picker-select{appearance:base-select;background:#fff;background-size:auto;border:1px solid var(--h5p-theme-picker-color-stroke);border-radius:0;box-shadow:inset 0 0 5px 0 rgba(0,0,0,.12);box-sizing:border-box;color:var(--h5p-theme-picker-color-text);cursor:pointer;font-size:.875rem;line-height:normal;max-width:none;min-height:auto;padding:.85rem 1rem;&:active,&:focus,&:hover{border-color:var(--h5p-theme-picker-color-stroke);box-shadow:inset 0 0 5px 0 rgba(0,0,0,.12);color:var(--h5p-theme-picker-color-text)}&::picker(select){appearance:base-select}&::picker-icon{display:none}&:open::picker(select){border:1px solid #d0d0d1;border-top:none;box-shadow:inset 0 0 5px 0 rgba(0,0,0,.12)}option{background-color:var(--background-color,#fff);color:#636b6f;height:3rem;margin:2px;padding:.25rem;transition:box-shadow .1s ease-in-out;white-space:nowrap;&:checked,&:hover{box-shadow:0 0 0 2px #000,inset 0 0 0 2px #000}&::checkmark{display:none}}&.theme{option{font-weight:600;&:after{aspect-ratio:1.5;background-color:var(--color,#000);border-radius:1rem;color:var(--background-color,#fff);content:"\\2013";display:inline-grid;font-weight:700;height:1.25rem;line-height:1;margin-left:auto;place-items:center}}}}}@container theme-picker (width <= 320px){.h5p-theme-picker-selector-box{grid-template-columns:auto}}',""]);const a=s},314(e){e.exports=function(e){var t=[];return t.toString=function(){return this.map(function(t){var n="",r=void 0!==t[5];return t[4]&&(n+="@supports (".concat(t[4],") {")),t[2]&&(n+="@media ".concat(t[2]," {")),r&&(n+="@layer".concat(t[5].length>0?" ".concat(t[5]):""," {")),n+=e(t),r&&(n+="}"),t[2]&&(n+="}"),t[4]&&(n+="}"),n}).join("")},t.i=function(e,n,r,i,o){"string"==typeof e&&(e=[[null,e,void 0]]);var s={};if(r)for(var a=0;a<this.length;a++){var l=this[a][0];null!=l&&(s[l]=!0)}for(var c=0;c<e.length;c++){var h=[].concat(e[c]);r&&s[h[0]]||(void 0!==o&&(void 0===h[5]||(h[1]="@layer".concat(h[5].length>0?" ".concat(h[5]):""," {").concat(h[1],"}")),h[5]=o),n&&(h[2]?(h[1]="@media ".concat(h[2]," {").concat(h[1],"}"),h[2]=n):h[2]=n),i&&(h[4]?(h[1]="@supports (".concat(h[4],") {").concat(h[1],"}"),h[4]=i):h[4]="".concat(i)),t.push(h))}},t}},601(e){e.exports=function(e){return e[1]}},72(e){var t=[];function n(e){for(var n=-1,r=0;r<t.length;r++)if(t[r].identifier===e){n=r;break}return n}function r(e,r){for(var o={},s=[],a=0;a<e.length;a++){var l=e[a],c=r.base?l[0]+r.base:l[0],h=o[c]||0,u="".concat(c," ").concat(h);o[c]=h+1;var p=n(u),d={css:l[1],media:l[2],sourceMap:l[3],supports:l[4],layer:l[5]};if(-1!==p)t[p].references++,t[p].updater(d);else{var m=i(d,r);r.byIndex=a,t.splice(a,0,{identifier:u,updater:m,references:1})}s.push(u)}return s}function i(e,t){var n=t.domAPI(t);n.update(e);return function(t){if(t){if(t.css===e.css&&t.media===e.media&&t.sourceMap===e.sourceMap&&t.supports===e.supports&&t.layer===e.layer)return;n.update(e=t)}else n.remove()}}e.exports=function(e,i){var o=r(e=e||[],i=i||{});return function(e){e=e||[];for(var s=0;s<o.length;s++){var a=n(o[s]);t[a].references--}for(var l=r(e,i),c=0;c<o.length;c++){var h=n(o[c]);0===t[h].references&&(t[h].updater(),t.splice(h,1))}o=l}}},659(e){var t={};e.exports=function(e,n){var r=function(e){if(void 0===t[e]){var n=document.querySelector(e);if(window.HTMLIFrameElement&&n instanceof window.HTMLIFrameElement)try{n=n.contentDocument.head}catch(e){n=null}t[e]=n}return t[e]}(e);if(!r)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");r.appendChild(n)}},540(e){e.exports=function(e){var t=document.createElement("style");return e.setAttributes(t,e.attributes),e.insert(t,e.options),t}},56(e,t,n){e.exports=function(e){var t=n.nc;t&&e.setAttribute("nonce",t)}},825(e){e.exports=function(e){if("undefined"==typeof document)return{update:function(){},remove:function(){}};var t=e.insertStyleElement(e);return{update:function(n){!function(e,t,n){var r="";n.supports&&(r+="@supports (".concat(n.supports,") {")),n.media&&(r+="@media ".concat(n.media," {"));var i=void 0!==n.layer;i&&(r+="@layer".concat(n.layer.length>0?" ".concat(n.layer):""," {")),r+=n.css,i&&(r+="}"),n.media&&(r+="}"),n.supports&&(r+="}");var o=n.sourceMap;o&&"undefined"!=typeof btoa&&(r+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(o))))," */")),t.styleTagTransform(r,e,t.options)}(t,e,n)},remove:function(){!function(e){if(null===e.parentNode)return!1;e.parentNode.removeChild(e)}(t)}}}},113(e){e.exports=function(e,t){if(t.styleSheet)t.styleSheet.cssText=e;else{for(;t.firstChild;)t.removeChild(t.firstChild);t.appendChild(document.createTextNode(e))}}}},t={};function n(r){var i=t[r];if(void 0!==i)return i.exports;var o=t[r]={id:r,exports:{}};return e[r](o,o.exports,n),o.exports}n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.nc=void 0;var r=n(72),i=n.n(r),o=n(825),s=n.n(o),a=n(659),l=n.n(a),c=n(56),h=n.n(c),u=n(540),p=n.n(u),d=n(113),m=n.n(d),f=n(624),g={};g.styleTagTransform=m(),g.setAttributes=h(),g.insert=l().bind(null,"head"),g.domAPI=s(),g.insertStyleElement=p();i()(f.A,g);f.A&&f.A.locals&&f.A.locals;const b={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]};for(const e in b)Object.freeze(b[e]);const k=Object.freeze(b),y=Object.create(null);for(const e in k)Object.hasOwn(k,e)&&(y[k[e]]=e);const v={to:{},get:{}};function S(e,t,n){return Math.min(Math.max(t,e),n)}function w(e){const t=Math.round(e).toString(16).toUpperCase();return t.length<2?"0"+t:t}v.get=function(e){let t,n;switch(e.slice(0,3).toLowerCase()){case"hsl":t=v.get.hsl(e),n="hsl";break;case"hwb":t=v.get.hwb(e),n="hwb";break;default:t=v.get.rgb(e),n="rgb"}return t?{model:n,value:t}:null},v.get.rgb=function(e){if(!e)return null;let t,n,r,i=[0,0,0,1];if(t=e.match(/^#([a-f\d]{6})([a-f\d]{2})?$/i)){for(r=t[2],t=t[1],n=0;n<3;n++){const e=2*n;i[n]=Number.parseInt(t.slice(e,e+2),16)}r&&(i[3]=Number.parseInt(r,16)/255)}else if(t=e.match(/^#([a-f\d]{3,4})$/i)){for(t=t[1],r=t[3],n=0;n<3;n++)i[n]=Number.parseInt(t[n]+t[n],16);r&&(i[3]=Number.parseInt(r+r,16)/255)}else if(t=e.match(/^rgba?\(\s*([+-]?(?:\d*\.)?\d+(?:e\d+)?)(?=[\s,])\s*(?:,\s*)?([+-]?(?:\d*\.)?\d+(?:e\d+)?)(?=[\s,])\s*(?:,\s*)?([+-]?(?:\d*\.)?\d+(?:e\d+)?)\s*(?:[\s,|/]\s*([+-]?(?:\d*\.)?\d+(?:e\d+)?)(%?)\s*)?\)$/i)){for(n=0;n<3;n++)i[n]=Number.parseFloat(t[n+1]);t[4]&&(i[3]=t[5]?.01*Number.parseFloat(t[4]):Number.parseFloat(t[4]))}else{if(!(t=e.match(/^rgba?\(\s*([+-]?[\d.]+)%\s*,?\s*([+-]?[\d.]+)%\s*,?\s*([+-]?[\d.]+)%\s*(?:[\s,|/]\s*([+-]?[\d.]+)(%?)\s*)?\)$/i)))return(t=e.toLowerCase().match(/^(\w+)$/))?"transparent"===t[1]?[0,0,0,0]:Object.hasOwn(k,t[1])?(i=k[t[1]].slice(),i[3]=1,i):null:null;for(n=0;n<3;n++)i[n]=Math.round(2.55*Number.parseFloat(t[n+1]));t[4]&&(i[3]=t[5]?.01*Number.parseFloat(t[4]):Number.parseFloat(t[4]))}for(n=0;n<3;n++)i[n]=S(i[n],0,255);return i[3]=S(i[3],0,1),i},v.get.hsl=function(e){if(!e)return null;const t=e.match(/^hsla?\(\s*([+-]?(?:\d{0,3}\.)?\d+)(?:deg)?\s*,?\s*([+-]?[\d.]+)%\s*,?\s*([+-]?[\d.]+)%\s*(?:[,|/]\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:e[+-]?\d+)?)\s*)?\)$/i);if(t){const e=Number.parseFloat(t[4]);return[(Number.parseFloat(t[1])%360+360)%360,S(Number.parseFloat(t[2]),0,100),S(Number.parseFloat(t[3]),0,100),S(Number.isNaN(e)?1:e,0,1)]}return null},v.get.hwb=function(e){if(!e)return null;const t=e.match(/^hwb\(\s*([+-]?\d{0,3}(?:\.\d+)?)(?:deg)?\s*[\s,]\s*([+-]?[\d.]+)%\s*[\s,]\s*([+-]?[\d.]+)%\s*(?:[\s,]\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:e[+-]?\d+)?)\s*)?\)$/i);if(t){const e=Number.parseFloat(t[4]);return[(Number.parseFloat(t[1])%360+360)%360,S(Number.parseFloat(t[2]),0,100),S(Number.parseFloat(t[3]),0,100),S(Number.isNaN(e)?1:e,0,1)]}return null},v.to.hex=function(...e){return"#"+w(e[0])+w(e[1])+w(e[2])+(e[3]<1?w(Math.round(255*e[3])):"")},v.to.rgb=function(...e){return e.length<4||1===e[3]?"rgb("+Math.round(e[0])+", "+Math.round(e[1])+", "+Math.round(e[2])+")":"rgba("+Math.round(e[0])+", "+Math.round(e[1])+", "+Math.round(e[2])+", "+e[3]+")"},v.to.rgb.percent=function(...e){const t=Math.round(e[0]/255*100),n=Math.round(e[1]/255*100),r=Math.round(e[2]/255*100);return e.length<4||1===e[3]?"rgb("+t+"%, "+n+"%, "+r+"%)":"rgba("+t+"%, "+n+"%, "+r+"%, "+e[3]+")"},v.to.hsl=function(...e){return e.length<4||1===e[3]?"hsl("+e[0]+", "+e[1]+"%, "+e[2]+"%)":"hsla("+e[0]+", "+e[1]+"%, "+e[2]+"%, "+e[3]+")"},v.to.hwb=function(...e){let t="";return e.length>=4&&1!==e[3]&&(t=", "+e[3]),"hwb("+e[0]+", "+e[1]+"%, "+e[2]+"%"+t+")"},v.to.keyword=function(...e){return y[e.slice(0,3)]};const x=v,C={};for(const e of Object.keys(k))C[k[e]]=e;const A={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"},hsv:{channels:3,labels:"hsv"},hwb:{channels:3,labels:"hwb"},cmyk:{channels:4,labels:"cmyk"},xyz:{channels:3,labels:"xyz"},lab:{channels:3,labels:"lab"},oklab:{channels:3,labels:["okl","oka","okb"]},lch:{channels:3,labels:"lch"},oklch:{channels:3,labels:["okl","okc","okh"]},hex:{channels:1,labels:["hex"]},keyword:{channels:1,labels:["keyword"]},ansi16:{channels:1,labels:["ansi16"]},ansi256:{channels:1,labels:["ansi256"]},hcg:{channels:3,labels:["h","c","g"]},apple:{channels:3,labels:["r16","g16","b16"]},gray:{channels:1,labels:["gray"]}},_=A,T=(6/29)**3;function L(e){const t=e>.0031308?1.055*e**(1/2.4)-.055:12.92*e;return Math.min(Math.max(0,t),1)}function E(e){return e>.04045?((e+.055)/1.055)**2.4:e/12.92}for(const e of Object.keys(A)){if(!("channels"in A[e]))throw new Error("missing channels property: "+e);if(!("labels"in A[e]))throw new Error("missing channel labels property: "+e);if(A[e].labels.length!==A[e].channels)throw new Error("channel and label counts mismatch: "+e);const{channels:t,labels:n}=A[e];delete A[e].channels,delete A[e].labels,Object.defineProperty(A[e],"channels",{value:t}),Object.defineProperty(A[e],"labels",{value:n})}function O(e,t){return(e[0]-t[0])**2+(e[1]-t[1])**2+(e[2]-t[2])**2}function P(e){const t=function(){const e={},t=Object.keys(_);for(let{length:n}=t,r=0;r<n;r++)e[t[r]]={distance:-1,parent:null};return e}(),n=[e];for(t[e].distance=0;n.length>0;){const e=n.pop(),r=Object.keys(_[e]);for(let{length:i}=r,o=0;o<i;o++){const i=r[o],s=t[i];-1===s.distance&&(s.distance=t[e].distance+1,s.parent=e,n.unshift(i))}}return t}function D(e,t){return function(n){return t(e(n))}}function F(e,t){const n=[t[e].parent,e];let r=_[t[e].parent][e],i=t[e].parent;for(;t[i].parent;)n.unshift(t[i].parent),r=D(_[t[i].parent][i],r),i=t[i].parent;return r.conversion=n,r}A.rgb.hsl=function(e){const t=e[0]/255,n=e[1]/255,r=e[2]/255,i=Math.min(t,n,r),o=Math.max(t,n,r),s=o-i;let a,l;switch(o){case i:a=0;break;case t:a=(n-r)/s;break;case n:a=2+(r-t)/s;break;case r:a=4+(t-n)/s}a=Math.min(60*a,360),a<0&&(a+=360);const c=(i+o)/2;return l=o===i?0:c<=.5?s/(o+i):s/(2-o-i),[a,100*l,100*c]},A.rgb.hsv=function(e){let t,n,r,i,o;const s=e[0]/255,a=e[1]/255,l=e[2]/255,c=Math.max(s,a,l),h=c-Math.min(s,a,l),u=function(e){return(c-e)/6/h+.5};if(0===h)i=0,o=0;else{switch(o=h/c,t=u(s),n=u(a),r=u(l),c){case s:i=r-n;break;case a:i=1/3+t-r;break;case l:i=2/3+n-t}i<0?i+=1:i>1&&(i-=1)}return[360*i,100*o,100*c]},A.rgb.hwb=function(e){const t=e[0],n=e[1];let r=e[2];const i=A.rgb.hsl(e)[0],o=1/255*Math.min(t,Math.min(n,r));return r=1-1/255*Math.max(t,Math.max(n,r)),[i,100*o,100*r]},A.rgb.oklab=function(e){const t=E(e[0]/255),n=E(e[1]/255),r=E(e[2]/255),i=Math.cbrt(.4122214708*t+.5363325363*n+.0514459929*r),o=Math.cbrt(.2119034982*t+.6806995451*n+.1073969566*r),s=Math.cbrt(.0883024619*t+.2817188376*n+.6299787005*r);return[100*(.2104542553*i+.793617785*o-.0040720468*s),100*(1.9779984951*i-2.428592205*o+.4505937099*s),100*(.0259040371*i+.7827717662*o-.808675766*s)]},A.rgb.cmyk=function(e){const t=e[0]/255,n=e[1]/255,r=e[2]/255,i=Math.min(1-t,1-n,1-r);return[100*((1-t-i)/(1-i)||0),100*((1-n-i)/(1-i)||0),100*((1-r-i)/(1-i)||0),100*i]},A.rgb.keyword=function(e){const t=C[e];if(t)return t;let n,r=Number.POSITIVE_INFINITY;for(const t of Object.keys(k)){const i=O(e,k[t]);i<r&&(r=i,n=t)}return n},A.keyword.rgb=function(e){return[...k[e]]},A.rgb.xyz=function(e){const t=E(e[0]/255),n=E(e[1]/255),r=E(e[2]/255);return[100*(.4124564*t+.3575761*n+.1804375*r),100*(.2126729*t+.7151522*n+.072175*r),100*(.0193339*t+.119192*n+.9503041*r)]},A.rgb.lab=function(e){const t=A.rgb.xyz(e);let n=t[0],r=t[1],i=t[2];n/=95.047,r/=100,i/=108.883,n=n>T?n**(1/3):7.787*n+16/116,r=r>T?r**(1/3):7.787*r+16/116,i=i>T?i**(1/3):7.787*i+16/116;return[116*r-16,500*(n-r),200*(r-i)]},A.hsl.rgb=function(e){const t=e[0]/360,n=e[1]/100,r=e[2]/100;let i,o;if(0===n)return o=255*r,[o,o,o];const s=r<.5?r*(1+n):r+n-r*n,a=2*r-s,l=[0,0,0];for(let e=0;e<3;e++)i=t+1/3*-(e-1),i<0&&i++,i>1&&i--,o=6*i<1?a+6*(s-a)*i:2*i<1?s:3*i<2?a+(s-a)*(2/3-i)*6:a,l[e]=255*o;return l},A.hsl.hsv=function(e){const t=e[0];let n=e[1]/100,r=e[2]/100,i=n;const o=Math.max(r,.01);r*=2,n*=r<=1?r:2-r,i*=o<=1?o:2-o;return[t,100*(0===r?2*i/(o+i):2*n/(r+n)),100*((r+n)/2)]},A.hsv.rgb=function(e){const t=e[0]/60,n=e[1]/100;let r=e[2]/100;const i=Math.floor(t)%6,o=t-Math.floor(t),s=255*r*(1-n),a=255*r*(1-n*o),l=255*r*(1-n*(1-o));switch(r*=255,i){case 0:return[r,l,s];case 1:return[a,r,s];case 2:return[s,r,l];case 3:return[s,a,r];case 4:return[l,s,r];case 5:return[r,s,a]}},A.hsv.hsl=function(e){const t=e[0],n=e[1]/100,r=e[2]/100,i=Math.max(r,.01);let o,s;s=(2-n)*r;const a=(2-n)*i;return o=n*i,o/=a<=1?a:2-a,o=o||0,s/=2,[t,100*o,100*s]},A.hwb.rgb=function(e){const t=e[0]/360;let n=e[1]/100,r=e[2]/100;const i=n+r;let o;i>1&&(n/=i,r/=i);const s=Math.floor(6*t),a=1-r;o=6*t-s,1&s&&(o=1-o);const l=n+o*(a-n);let c,h,u;switch(s){default:case 6:case 0:c=a,h=l,u=n;break;case 1:c=l,h=a,u=n;break;case 2:c=n,h=a,u=l;break;case 3:c=n,h=l,u=a;break;case 4:c=l,h=n,u=a;break;case 5:c=a,h=n,u=l}return[255*c,255*h,255*u]},A.cmyk.rgb=function(e){const t=e[0]/100,n=e[1]/100,r=e[2]/100,i=e[3]/100;return[255*(1-Math.min(1,t*(1-i)+i)),255*(1-Math.min(1,n*(1-i)+i)),255*(1-Math.min(1,r*(1-i)+i))]},A.xyz.rgb=function(e){const t=e[0]/100,n=e[1]/100,r=e[2]/100;let i,o,s;return i=3.2404542*t+-1.5371385*n+-.4985314*r,o=-.969266*t+1.8760108*n+.041556*r,s=.0556434*t+-.2040259*n+1.0572252*r,i=L(i),o=L(o),s=L(s),[255*i,255*o,255*s]},A.xyz.lab=function(e){let t=e[0],n=e[1],r=e[2];t/=95.047,n/=100,r/=108.883,t=t>T?t**(1/3):7.787*t+16/116,n=n>T?n**(1/3):7.787*n+16/116,r=r>T?r**(1/3):7.787*r+16/116;return[116*n-16,500*(t-n),200*(n-r)]},A.xyz.oklab=function(e){const t=e[0]/100,n=e[1]/100,r=e[2]/100,i=Math.cbrt(.8189330101*t+.3618667424*n-.1288597137*r),o=Math.cbrt(.0329845436*t+.9293118715*n+.0361456387*r),s=Math.cbrt(.0482003018*t+.2643662691*n+.633851707*r);return[100*(.2104542553*i+.793617785*o-.0040720468*s),100*(1.9779984951*i-2.428592205*o+.4505937099*s),100*(.0259040371*i+.7827717662*o-.808675766*s)]},A.oklab.oklch=function(e){return A.lab.lch(e)},A.oklab.xyz=function(e){const t=e[0]/100,n=e[1]/100,r=e[2]/100,i=(.999999998*t+.396337792*n+.215803758*r)**3,o=(1.000000008*t-.105561342*n-.063854175*r)**3,s=(1.000000055*t-.089484182*n-1.291485538*r)**3;return[100*(1.227013851*i-.55779998*o+.281256149*s),100*(-.040580178*i+1.11225687*o-.071676679*s),100*(-.076381285*i-.421481978*o+1.58616322*s)]},A.oklab.rgb=function(e){const t=e[0]/100,n=e[1]/100,r=e[2]/100,i=(t+.3963377774*n+.2158037573*r)**3,o=(t-.1055613458*n-.0638541728*r)**3,s=(t-.0894841775*n-1.291485548*r)**3;return[255*L(4.0767416621*i-3.3077115913*o+.2309699292*s),255*L(-1.2684380046*i+2.6097574011*o-.3413193965*s),255*L(-.0041960863*i-.7034186147*o+1.707614701*s)]},A.oklch.oklab=function(e){return A.lch.lab(e)},A.lab.xyz=function(e){let t,n,r;n=(e[0]+16)/116,t=e[1]/500+n,r=n-e[2]/200;const i=n**3,o=t**3,s=r**3;return n=i>T?i:(n-16/116)/7.787,t=o>T?o:(t-16/116)/7.787,r=s>T?s:(r-16/116)/7.787,t*=95.047,n*=100,r*=108.883,[t,n,r]},A.lab.lch=function(e){const t=e[0],n=e[1],r=e[2];let i;i=360*Math.atan2(r,n)/2/Math.PI,i<0&&(i+=360);return[t,Math.sqrt(n*n+r*r),i]},A.lch.lab=function(e){const t=e[0],n=e[1],r=e[2]/360*2*Math.PI;return[t,n*Math.cos(r),n*Math.sin(r)]},A.rgb.ansi16=function(e,t=null){const[n,r,i]=e;let o=null===t?A.rgb.hsv(e)[2]:t;if(o=Math.round(o/50),0===o)return 30;let s=30+(Math.round(i/255)<<2|Math.round(r/255)<<1|Math.round(n/255));return 2===o&&(s+=60),s},A.hsv.ansi16=function(e){return A.rgb.ansi16(A.hsv.rgb(e),e[2])},A.rgb.ansi256=function(e){const t=e[0],n=e[1],r=e[2];if(t>>4==n>>4&&n>>4==r>>4)return t<8?16:t>248?231:Math.round((t-8)/247*24)+232;return 16+36*Math.round(t/255*5)+6*Math.round(n/255*5)+Math.round(r/255*5)},A.ansi16.rgb=function(e){let t=(e=e[0])%10;if(0===t||7===t)return e>50&&(t+=3.5),t=t/10.5*255,[t,t,t];const n=.5*(Math.trunc(e>50)+1);return[(1&t)*n*255,(t>>1&1)*n*255,(t>>2&1)*n*255]},A.ansi256.rgb=function(e){if((e=e[0])>=232){const t=10*(e-232)+8;return[t,t,t]}let t;e-=16;return[Math.floor(e/36)/5*255,Math.floor((t=e%36)/6)/5*255,t%6/5*255]},A.rgb.hex=function(e){const t=(((255&Math.round(e[0]))<<16)+((255&Math.round(e[1]))<<8)+(255&Math.round(e[2]))).toString(16).toUpperCase();return"000000".slice(t.length)+t},A.hex.rgb=function(e){const t=e.toString(16).match(/[a-f\d]{6}|[a-f\d]{3}/i);if(!t)return[0,0,0];let n=t[0];3===t[0].length&&(n=[...n].map(e=>e+e).join(""));const r=Number.parseInt(n,16);return[r>>16&255,r>>8&255,255&r]},A.rgb.hcg=function(e){const t=e[0]/255,n=e[1]/255,r=e[2]/255,i=Math.max(Math.max(t,n),r),o=Math.min(Math.min(t,n),r),s=i-o;let a;return a=s<=0?0:i===t?(n-r)/s%6:i===n?2+(r-t)/s:4+(t-n)/s,a/=6,a%=1,[360*a,100*s,100*(s<1?o/(1-s):0)]},A.hsl.hcg=function(e){const t=e[1]/100,n=e[2]/100,r=n<.5?2*t*n:2*t*(1-n);let i=0;return r<1&&(i=(n-.5*r)/(1-r)),[e[0],100*r,100*i]},A.hsv.hcg=function(e){const t=e[1]/100,n=e[2]/100,r=t*n;let i=0;return r<1&&(i=(n-r)/(1-r)),[e[0],100*r,100*i]},A.hcg.rgb=function(e){const t=e[0]/360,n=e[1]/100,r=e[2]/100;if(0===n)return[255*r,255*r,255*r];const i=[0,0,0],o=t%1*6,s=o%1,a=1-s;let l=0;switch(Math.floor(o)){case 0:i[0]=1,i[1]=s,i[2]=0;break;case 1:i[0]=a,i[1]=1,i[2]=0;break;case 2:i[0]=0,i[1]=1,i[2]=s;break;case 3:i[0]=0,i[1]=a,i[2]=1;break;case 4:i[0]=s,i[1]=0,i[2]=1;break;default:i[0]=1,i[1]=0,i[2]=a}return l=(1-n)*r,[255*(n*i[0]+l),255*(n*i[1]+l),255*(n*i[2]+l)]},A.hcg.hsv=function(e){const t=e[1]/100,n=t+e[2]/100*(1-t);let r=0;return n>0&&(r=t/n),[e[0],100*r,100*n]},A.hcg.hsl=function(e){const t=e[1]/100,n=e[2]/100*(1-t)+.5*t;let r=0;return n>0&&n<.5?r=t/(2*n):n>=.5&&n<1&&(r=t/(2*(1-n))),[e[0],100*r,100*n]},A.hcg.hwb=function(e){const t=e[1]/100,n=t+e[2]/100*(1-t);return[e[0],100*(n-t),100*(1-n)]},A.hwb.hcg=function(e){const t=e[1]/100,n=1-e[2]/100,r=n-t;let i=0;return r<1&&(i=(n-r)/(1-r)),[e[0],100*r,100*i]},A.apple.rgb=function(e){return[e[0]/65535*255,e[1]/65535*255,e[2]/65535*255]},A.rgb.apple=function(e){return[e[0]/255*65535,e[1]/255*65535,e[2]/255*65535]},A.gray.rgb=function(e){return[e[0]/100*255,e[0]/100*255,e[0]/100*255]},A.gray.hsl=function(e){return[0,0,e[0]]},A.gray.hsv=A.gray.hsl,A.gray.hwb=function(e){return[0,100,e[0]]},A.gray.cmyk=function(e){return[0,0,0,e[0]]},A.gray.lab=function(e){return[e[0],0,0]},A.gray.hex=function(e){const t=255&Math.round(e[0]/100*255),n=((t<<16)+(t<<8)+t).toString(16).toUpperCase();return"000000".slice(n.length)+n},A.rgb.gray=function(e){return[(e[0]+e[1]+e[2])/3/255*100]};const M=function(e){const t=P(e),n={},r=Object.keys(t);for(let{length:e}=r,i=0;i<e;i++){const e=r[i];null!==t[e].parent&&(n[e]=F(e,t))}return n},z={},j=Object.keys(_);function I(e){const t=function(...t){const n=t[0];return null==n?n:(n.length>1&&(t=n),e(t))};return"conversion"in e&&(t.conversion=e.conversion),t}function N(e){const t=function(...t){const n=t[0];if(null==n)return n;n.length>1&&(t=n);const r=e(t);if("object"==typeof r)for(let{length:e}=r,t=0;t<e;t++)r[t]=Math.round(r[t]);return r};return"conversion"in e&&(t.conversion=e.conversion),t}for(const e of j){z[e]={},Object.defineProperty(z[e],"channels",{value:_[e].channels}),Object.defineProperty(z[e],"labels",{value:_[e].labels});const t=M(e),n=Object.keys(t);for(const r of n){const n=t[r];z[e][r]=N(n),z[e][r].raw=I(n)}}const R=z,B=["keyword","gray","hex"],$={};for(const e of Object.keys(R))$[[...R[e].labels].sort().join("")]=e;const U={};function W(e,t){if(!(this instanceof W))return new W(e,t);if(t&&t in B&&(t=null),t&&!(t in R))throw new Error("Unknown model: "+t);let n,r;if(null==e)this.model="rgb",this.color=[0,0,0],this.valpha=1;else if(e instanceof W)this.model=e.model,this.color=[...e.color],this.valpha=e.valpha;else if("string"==typeof e){const t=x.get(e);if(null===t)throw new Error("Unable to parse color from string: "+e);this.model=t.model,r=R[this.model].channels,this.color=t.value.slice(0,r),this.valpha="number"==typeof t.value[r]?t.value[r]:1}else if(e.length>0){this.model=t||"rgb",r=R[this.model].channels;const n=Array.prototype.slice.call(e,0,r);this.color=Q(n,r),this.valpha="number"==typeof e[r]?e[r]:1}else if("number"==typeof e)this.model="rgb",this.color=[e>>16&255,e>>8&255,255&e],this.valpha=1;else{this.valpha=1;const t=Object.keys(e);"alpha"in e&&(t.splice(t.indexOf("alpha"),1),this.valpha="number"==typeof e.alpha?e.alpha:0);const r=t.sort().join("");if(!(r in $))throw new Error("Unable to parse color from object: "+JSON.stringify(e));this.model=$[r];const{labels:i}=R[this.model],o=[];for(n=0;n<i.length;n++)o.push(e[i[n]]);this.color=Q(o)}if(U[this.model])for(r=R[this.model].channels,n=0;n<r;n++){const e=U[this.model][n];e&&(this.color[n]=e(this.color[n]))}this.valpha=Math.max(0,Math.min(1,this.valpha)),Object.freeze&&Object.freeze(this)}W.prototype={toString(){return this.string()},toJSON(){return this[this.model]()},string(e){let t=this.model in x.to?this:this.rgb();t=t.round("number"==typeof e?e:1);const n=1===t.valpha?t.color:[...t.color,this.valpha];return x.to[t.model](...n)},percentString(e){const t=this.rgb().round("number"==typeof e?e:1),n=1===t.valpha?t.color:[...t.color,this.valpha];return x.to.rgb.percent(...n)},array(){return 1===this.valpha?[...this.color]:[...this.color,this.valpha]},object(){const e={},{channels:t}=R[this.model],{labels:n}=R[this.model];for(let r=0;r<t;r++)e[n[r]]=this.color[r];return 1!==this.valpha&&(e.alpha=this.valpha),e},unitArray(){const e=this.rgb().color;return e[0]/=255,e[1]/=255,e[2]/=255,1!==this.valpha&&e.push(this.valpha),e},unitObject(){const e=this.rgb().object();return e.r/=255,e.g/=255,e.b/=255,1!==this.valpha&&(e.alpha=this.valpha),e},round(e){return e=Math.max(e||0,0),new W([...this.color.map(V(e)),this.valpha],this.model)},alpha(e){return void 0!==e?new W([...this.color,Math.max(0,Math.min(1,e))],this.model):this.valpha},red:H("rgb",0,q(255)),green:H("rgb",1,q(255)),blue:H("rgb",2,q(255)),hue:H(["hsl","hsv","hsl","hwb","hcg"],0,e=>(e%360+360)%360),saturationl:H("hsl",1,q(100)),lightness:H("hsl",2,q(100)),saturationv:H("hsv",1,q(100)),value:H("hsv",2,q(100)),chroma:H("hcg",1,q(100)),gray:H("hcg",2,q(100)),white:H("hwb",1,q(100)),wblack:H("hwb",2,q(100)),cyan:H("cmyk",0,q(100)),magenta:H("cmyk",1,q(100)),yellow:H("cmyk",2,q(100)),black:H("cmyk",3,q(100)),x:H("xyz",0,q(95.047)),y:H("xyz",1,q(100)),z:H("xyz",2,q(108.833)),l:H("lab",0,q(100)),a:H("lab",1),b:H("lab",2),keyword(e){return void 0!==e?new W(e):R[this.model].keyword(this.color)},hex(e){return void 0!==e?new W(e):x.to.hex(...this.rgb().round().color)},hexa(e){if(void 0!==e)return new W(e);const t=this.rgb().round().color;let n=Math.round(255*this.valpha).toString(16).toUpperCase();return 1===n.length&&(n="0"+n),x.to.hex(...t)+n},rgbNumber(){const e=this.rgb().color;return(255&e[0])<<16|(255&e[1])<<8|255&e[2]},luminosity(){const e=this.rgb().color,t=[];for(const[n,r]of e.entries()){const e=r/255;t[n]=e<=.04045?e/12.92:((e+.055)/1.055)**2.4}return.2126*t[0]+.7152*t[1]+.0722*t[2]},contrast(e){const t=this.luminosity(),n=e.luminosity();return t>n?(t+.05)/(n+.05):(n+.05)/(t+.05)},level(e){const t=this.contrast(e);return t>=7?"AAA":t>=4.5?"AA":""},isDark(){const e=this.rgb().color;return(2126*e[0]+7152*e[1]+722*e[2])/1e4<128},isLight(){return!this.isDark()},negate(){const e=this.rgb();for(let t=0;t<3;t++)e.color[t]=255-e.color[t];return e},lighten(e){const t=this.hsl();return t.color[2]+=t.color[2]*e,t},darken(e){const t=this.hsl();return t.color[2]-=t.color[2]*e,t},saturate(e){const t=this.hsl();return t.color[1]+=t.color[1]*e,t},desaturate(e){const t=this.hsl();return t.color[1]-=t.color[1]*e,t},whiten(e){const t=this.hwb();return t.color[1]+=t.color[1]*e,t},blacken(e){const t=this.hwb();return t.color[2]+=t.color[2]*e,t},grayscale(){const e=this.rgb().color,t=.3*e[0]+.59*e[1]+.11*e[2];return W.rgb(t,t,t)},fade(e){return this.alpha(this.valpha-this.valpha*e)},opaquer(e){return this.alpha(this.valpha+this.valpha*e)},rotate(e){const t=this.hsl();let n=t.color[0];return n=(n+e)%360,n=n<0?360+n:n,t.color[0]=n,t},mix(e,t){if(!e||!e.rgb)throw new Error('Argument to "mix" was not a Color instance, but rather an instance of '+typeof e);const n=e.rgb(),r=this.rgb(),i=void 0===t?.5:t,o=2*i-1,s=n.alpha()-r.alpha(),a=((o*s===-1?o:(o+s)/(1+o*s))+1)/2,l=1-a;return W.rgb(a*n.red()+l*r.red(),a*n.green()+l*r.green(),a*n.blue()+l*r.blue(),n.alpha()*i+r.alpha()*(1-i))}};for(const e of Object.keys(R)){if(B.includes(e))continue;const{channels:t}=R[e];W.prototype[e]=function(...t){return this.model===e?new W(this):t.length>0?new W(t,e):new W([...(n=R[this.model][e].raw(this.color),Array.isArray(n)?n:[n]),this.valpha],e);var n},W[e]=function(...n){let r=n[0];return"number"==typeof r&&(r=Q(n,t)),new W(r,e)}}function V(e){return function(t){return function(e,t){return Number(e.toFixed(t))}(t,e)}}function H(e,t,n){e=Array.isArray(e)?e:[e];for(const r of e)(U[r]||=[])[t]=n;return e=e[0],function(r){let i;return void 0!==r?(n&&(r=n(r)),i=this[e](),i.color[t]=r,i):(i=this[e]().color[t],n&&(i=n(i)),i)}}function q(e){return function(t){return Math.max(0,Math.min(e,t))}}function Q(e,t){for(let n=0;n<t;n++)"number"!=typeof e[n]&&(e[n]=0);return e}const G=W,K=["--h5p-theme-main-cta-base","--h5p-theme-main-cta-light","--h5p-theme-main-cta-dark","--h5p-theme-contrast-cta","--h5p-theme-contrast-cta-light","--h5p-theme-contrast-cta-white","--h5p-theme-contrast-cta-dark","--h5p-theme-secondary-cta-base","--h5p-theme-secondary-cta-light","--h5p-theme-secondary-cta-dark","--h5p-theme-secondary-contrast-cta","--h5p-theme-secondary-contrast-cta-hover","--h5p-theme-background","--h5p-theme-alternative-base","--h5p-theme-alternative-light","--h5p-theme-alternative-dark","--h5p-theme-alternative-darker"],Y={"--h5p-theme-stroke-1":"#101729","--h5p-theme-stroke-2":"#354054","--h5p-theme-stroke-3":"#737373","--h5p-theme-ui-base":"#ffffff","--h5p-theme-text-primary":"#101729","--h5p-theme-text-secondary":"#354054","--h5p-theme-text-third":"#737373","--h5p-theme-feedback-correct-main":"#256D1D","--h5p-theme-feedback-correct-secondary":"#f3fcf0","--h5p-theme-feedback-correct-third":"#cff1c2","--h5p-theme-feedback-incorrect-main":"#a13236","--h5p-theme-feedback-incorrect-secondary":"#faf0f4","--h5p-theme-feedback-incorrect-third":"#f6dce7","--h5p-theme-feedback-neutral-main":"#E6C81D","--h5p-theme-feedback-neutral-secondary":"#5E4817","--h5p-theme-feedback-neutral-third":"#F0EBCB"},J=(e,t,n,r,i)=>{let o=1e3,s=e,a=Number.POSITIVE_INFINITY,l=s.contrast(t);for(;o>0;){const e=s.lightness()+i*r;if(e<0||e>100)break;const l=Math.max(0,Math.min(e,100));if(s=s.lightness(l),a=Math.abs(s.contrast(t)-n),a<.01)break;o--}return l=s.contrast(t),{color:s,contrast:l}},X=(e,t)=>{t=(t%360+360)%360;return G(e).hue(t).hex()},Z=(e,t)=>{const n=G(e);return n.lightness(n.lightness()*t).hex()},ee=(e,t=90,n="#ffffff")=>{const r=(1-Math.max(0,Math.min(100,t))/100)*G(e).alpha(),i=G(e).rgb().array().map(e=>e/255),o=G(n).rgb().array().map(e=>e/255),s=[0,1,2].map(e=>{const t=te(i[e]),n=te(o[e]),s=t*r+n*(1-r);return Math.round(255*Math.max(0,Math.min(1,(a=s)<=.0031308?12.92*a:1.055*a**(1/2.4)-.055)));var a});return G.rgb(s[0],s[1],s[2]).hex()},te=e=>e<=.04045?e/12.92:((e+.055)/1.055)**2.4,ne=(e,t,n={})=>{const r=n.targetContrast??4.6,i=n.lightnessAdjustmentStep||.1,o=G(e),s=G(t),a=J(o,s,r,i,1),l=J(o,s,r,i,-1);return l.contrast>a.contrast?l.color.hex():a.color.hex()},re=e=>G.hsl(e,60,96).hex(),ie=e=>G(e).hsl().array()[0],oe=(e,t,n,r)=>{const i=(e=>{const t=ne(e,"#ffffff");return{"--h5p-theme-main-cta-base":e,"--h5p-theme-main-cta-light":Z(e,1.1),"--h5p-theme-main-cta-dark":Z(e,.9),"--h5p-theme-contrast-cta":ne(e,e),"--h5p-theme-contrast-cta-light":ee(e,90),"--h5p-theme-contrast-cta-white":t,"--h5p-theme-contrast-cta-dark":ne(e,"#282836")}})(e),o=((e,t)=>({"--h5p-theme-secondary-cta-base":e,"--h5p-theme-secondary-cta-light":Z(e,1.1),"--h5p-theme-secondary-cta-dark":Z(e,.9),"--h5p-theme-secondary-contrast-cta":ne(e,e),"--h5p-theme-secondary-contrast-cta-hover":ne(e,t)}))(t,i["--h5p-theme-contrast-cta-white"]);return{"--h5p-theme-background":r,"--h5p-theme-alternative-base":re(n),"--h5p-theme-alternative-light":X("#f8f9fe",n),"--h5p-theme-alternative-dark":X("#dcdffa",n),"--h5p-theme-alternative-darker":X("#ced1ee",n),...i,...o,...Y}};var se=n(223),ae={};ae.styleTagTransform=m(),ae.setAttributes=h(),ae.insert=l().bind(null,"head"),ae.domAPI=s(),ae.insertStyleElement=p();i()(se.A,ae);se.A&&se.A.locals&&se.A.locals;class le extends HTMLElement{static get observedAttributes(){return["default-color","button-label","type"]}constructor(e={},t={}){super(),this.params={...e,defaultColor:this.getAttribute("default-color")??e.defaultColor??"#000000",buttonLabel:this.getAttribute("button-label")??e.buttonLabel,type:this.getAttribute("type")??e.type??"color"},this.callbacks=t,this.callbacks.onChange=this.callbacks.onChange||(()=>{}),this.input=null,this.button=null,this.preview=null,this.dom=null,this.value=this.params.defaultColor,this.handleInput=this.handleInput.bind(this),this.handleButtonClick=this.handleButtonClick.bind(this),this.updateDOM(this.params)}handleInput(e){const t=e.target.value;this.value=t,this.preview.style.setProperty("background-color",t),this.callbacks.onChange({id:this.params.id,color:t})}handleButtonClick(e){e.preventDefault(),this.input?.click()}cleanupListeners(){this.input?.removeEventListener("input",this.handleInput),this.button?.removeEventListener("click",this.handleButtonClick)}connectedCallback(){this.render()}disconnectedCallback(){cleanupListeners()}getValue(){return this.value}attributeChangedCallback(e,t,n){if(t===n)return;this.params[{"default-color":"defaultColor","button-label":"buttonLabel",type:"type"}[e]??e]=n,this.updateDOM({...this.params,defaultColor:this.getAttribute("default-color")??this.params.defaultColor??"#000000",buttonLabel:this.getAttribute("button-label")??this.params.buttonLabel,type:this.getAttribute("type")??this.params.type??"color"}),this.render()}updateDOM(e={}){this.cleanupListeners();const{dom:t,input:n,button:r,preview:i}=this.buildDOM(e);this.dom=t,this.input=n,this.button=r,this.preview=i}render(){this.replaceChildren(this.dom)}buildDOM(e={}){const t=document.createElement("div");t.classList.add("h5p-theme-picker-color-picker",e.id);let n=null,r=null,i=null,o=null;if("color"===e.type&&(n=document.createElement("input"),n.type="color",n.id=e.uuid,n.classList.add("h5p-theme-picker-color-picker-input"),n.setAttribute("tabindex","-1"),n.value=e.defaultColor,n.addEventListener("input",this.handleInput),t.append(n)),r=document.createElement("button"),r.classList.add("h5p-theme-picker-color-picker-button"),r.setAttribute("type","button"),r.setAttribute("aria-label",e.buttonLabel),"color"===e.type?r.addEventListener("click",this.handleButtonClick):"hue"===e.type&&r.setAttribute("popovertarget",`popover-${e.uuid}`),t.append(r),i=document.createElement("div"),i.classList.add("h5p-theme-picker-color-picker-preview"),i.style.setProperty("background-color",e.defaultColor),r.append(i),"hue"===e.type){o=document.createElement("dialog"),o.id=`popover-${e.uuid}`,o.setAttribute("popover",""),o.classList.add("h5p-theme-picker-color-picker-popover"),t.append(o);const n=document.createElement("input");n.id=e.uuid,n.classList.add("h5p-theme-picker-color-picker-slider","hue"),n.type="range",n.min=0,n.max=360,n.value=0,n.addEventListener("input",t=>{const n=parseFloat(t.target.value),r=re(n),o=(e=>{const t=ie(e);return G.hsl(t,60,85).hex()})(r);i.style.setProperty("background-color",o),this.callbacks.onChange({id:e.id,color:r})}),o.append(n)}return{dom:t,input:n,button:r,preview:i}}}customElements.get("h5p-theme-picker-color-picker")||customElements.define("h5p-theme-picker-color-picker",le);const ce=(e,...t)=>{const n=document.createElement(e);return t.length>0&&n.classList.add(...t),n},he=(e,t,n={})=>{e.dispatchEvent(new CustomEvent(t,{detail:n,bubbles:!1,composed:!1}))},ue=e=>Boolean(e)&&"object"==typeof e&&!Array.isArray(e);var pe=n(463),de={};de.styleTagTransform=m(),de.setAttributes=h(),de.insert=l().bind(null,"head"),de.domAPI=s(),de.insertStyleElement=p();i()(pe.A,de);pe.A&&pe.A.locals&&pe.A.locals;class me extends HTMLElement{constructor(e={}){super(),this.translations=e.translations||{},this.dom=document.createElement("div"),this.dom.classList.add("h5p-theme-picker-color-selector");const t=document.createElement("div");t.classList.add("h5p-theme-picker-color-selector-title"),t.innerText=this.translate("color_selector_title"),this.dom.append(t),this.grid=document.createElement("div"),this.grid.classList.add("h5p-theme-picker-color-selector-grid"),this.dom.append(this.grid),this.pickerButtons={},this.pickerButtons.buttons=this.addPicker("buttons",{defaultColor:e.customColorButtons,buttonLabel:this.translate("color_selector_buttons_button_aria")},"color_selector_buttons_label"),this.pickerButtons.navigation=this.addPicker("navigation",{defaultColor:e.customColorNavigation,buttonLabel:this.translate("color_selector_navigation_button_aria")},"color_selector_navigation_label"),this.pickerButtons.alternative=this.addPicker("alternative",{type:"hue",defaultColor:e.customColorAlternative,buttonLabel:this.translate("color_selector_alternative_button_aria")},"color_selector_alternative_label"),this.pickerButtons.background=this.addPicker("background",{defaultColor:e.customColorBackground,buttonLabel:this.translate("color_selector_background_button_aria")},"color_selector_background_label")}translate(e){return"function"==typeof this.translations?.get?this.translations.get(e)??e:e}addPicker(e,t,n){const r=crypto.randomUUID(),i=new le({id:e,uuid:r,...t},{onChange:e=>he(this,"change",e)});this.grid.append(i);const o=document.createElement("label");return o.classList.add("h5p-theme-picker-color-selector-picker-label"),o.setAttribute("for",r),o.innerText=this.translate(n),this.grid.append(o),i}getValues(){return{"--h5p-theme-main-cta-base":this.pickerButtons.buttons.getValue(),"--h5p-theme-secondary-cta-base":this.pickerButtons.navigation.getValue(),"--h5p-theme-alternative-base":this.pickerButtons.alternative.getValue(),"--h5p-theme-background":this.pickerButtons.background.getValue()}}connectedCallback(){this.render()}toggleVisibility(e){this.dom.classList.toggle("display-none",!e)}render(){this.contains(this.dom)||this.append(this.dom)}}customElements.get("h5p-theme-picker-color-selector")||customElements.define("h5p-theme-picker-color-selector",me);var fe=n(220),ge={};ge.styleTagTransform=m(),ge.setAttributes=h(),ge.insert=l().bind(null,"head"),ge.domAPI=s(),ge.insertStyleElement=p();i()(fe.A,ge);fe.A&&fe.A.locals&&fe.A.locals;const be=new Set(["--h5p-theme-main-cta-base","--h5p-theme-contrast-cta","--h5p-theme-secondary-cta-base","--h5p-theme-secondary-contrast-cta","--h5p-theme-alternative-base","--h5p-theme-alternative-dark","--h5p-theme-alternative-light","--h5p-theme-background","--h5p-theme-ui-base","--h5p-theme-text-primary","--h5p-theme-spacing-xl","--h5p-theme-spacing-l","--h5p-theme-spacing-m","--h5p-theme-spacing-s","--h5p-theme-spacing-xs","--h5p-theme-spacing-xxs","--h5p-theme-font-size-xxl","--h5p-theme-font-size-xl","--h5p-theme-font-size-l","--h5p-theme-font-size-m","--h5p-theme-font-size-s","--h5p-theme-scaling"]),ke=()=>{const e=ce("div","h5p-theme-picker-preview-mockup"),t=ce("div","h5p-theme-picker-preview-mockup-main");return t.append(ye()),t.append(Se()),e.append(t),e.append(xe()),e},ye=()=>{const e=ce("div","h5p-theme-picker-preview-mockup-box","multi-choice"),t=ce("div","h5p-theme-picker-preview-mockup-inner-main");return t.append(ce("div","h5p-theme-picker-preview-mockup-bar")),t.append(ce("div","h5p-theme-picker-preview-mockup-blank")),t.append(ce("div","h5p-theme-picker-preview-mockup-blank")),t.append(ce("div","h5p-theme-picker-preview-mockup-blank")),e.append(t),e.append(ve()),e},ve=()=>{const e=ce("div","h5p-theme-picker-preview-mockup-inner-footer");return e.append(ce("div","h5p-theme-picker-preview-mockup-button","main")),e},Se=()=>{const e=ce("div","h5p-theme-picker-preview-mockup-box","drag-text"),t=ce("div","h5p-theme-picker-preview-mockup-inner-main"),n=ce("div","h5p-theme-picker-preview-mockup-text-container");n.append(we("h5p-theme-picker-preview-mockup-blank","h5p-theme-picker-preview-mockup-bar")),n.append(we("h5p-theme-picker-preview-mockup-bar","h5p-theme-picker-preview-mockup-blank")),n.append(we("h5p-theme-picker-preview-mockup-blank","h5p-theme-picker-preview-mockup-bar"));const r=ce("div","h5p-theme-picker-preview-mockup-draggable-container");return r.append(ce("div","h5p-theme-picker-preview-mockup-draggable")),r.append(ce("div","h5p-theme-picker-preview-mockup-draggable")),r.append(ce("div","h5p-theme-picker-preview-mockup-draggable")),t.append(n),t.append(r),e.append(t),e.append(ve()),e},we=(e,t)=>{const n=ce("div","h5p-theme-picker-preview-mockup-text-row");return n.append(ce("div",e)),n.append(ce("div",t)),n},xe=()=>{const e=ce("div","h5p-theme-picker-preview-mockup-footer");return e.append(ce("div","h5p-theme-picker-preview-mockup-button","secondary")),e.append(ce("div","h5p-theme-picker-preview-mockup-button","secondary")),e};class Ce extends HTMLElement{static get observedAttributes(){return["theme-name"]}constructor(e={}){super();const{dom:t,label:n}=((e={})=>{const t=ce("div","h5p-theme-picker-preview"),n=ce("div","h5p-theme-picker-preview-label"),r="function"==typeof e?.translations?.get?e.translations.get("preview_preview_label_prefix")??"preview_preview_label_prefix":"preview_preview_label_prefix";return n.textContent=r,t.append(n),t.append(ke()),{dom:t,label:n}})(e);this.dom=t,this.label=n}connectedCallback(){this.render()}attributeChangedCallback(e,t,n){t!==n&&"theme-name"===e&&(null==n?this.label.removeAttribute("data-theme-name"):this.label.setAttribute("data-theme-name",n))}setValues(e={},t){"string"==typeof t?this.setAttribute("theme-name",t):null==t&&this.removeAttribute("theme-name"),Object.entries(e).forEach(([e,t])=>{be.has(e)&&this.style.setProperty(e,t)})}render(){this.contains(this.dom)||this.append(this.dom)}}customElements.get("h5p-theme-picker-preview")||customElements.define("h5p-theme-picker-preview",Ce);var Ae=n(665),_e={};_e.styleTagTransform=m(),_e.setAttributes=h(),_e.insert=l().bind(null,"head"),_e.domAPI=s(),_e.insertStyleElement=p();i()(Ae.A,_e);Ae.A&&Ae.A.locals&&Ae.A.locals;class Te extends HTMLElement{constructor(e={}){super(),e.labelTheme=e.translations?.get("selector_theme_label")??this.getAttribute("label-theme")??"Theme",e.labelDensity=e.translations?.get("selector_density_label")??this.getAttribute("label-density")??"Density",e.densityAllowed=e.densityAllowed??(!this.hasAttribute("density-allowed")||"true"===this.getAttribute("density-allowed")),this.handleThemeChange=this.handleThemeChange.bind(this),this.handleDensityChange=this.handleDensityChange.bind(this),this.handleThemePointerEnter=this.handleThemePointerEnter.bind(this),this.handleThemePointerLeave=this.handleThemePointerLeave.bind(this),this.handleDensityPointerEnter=this.handleDensityPointerEnter.bind(this),this.handleDensityPointerLeave=this.handleDensityPointerLeave.bind(this);const{dom:t,selectTheme:n,selectDensity:r}=(e=>{const t=document.createElement("div");t.classList.add("h5p-theme-picker-selector-box");const n=crypto.randomUUID(),r=`selectTheme-${n}`,i=`selectDensity-${n}`,o=document.createElement("label");o.classList.add("h5p-theme-picker-label"),o.setAttribute("for",r),o.innerText=e.labelTheme,t.append(o);const s=document.createElement("select");if(s.id=r,s.classList.add("h5p-theme-picker-select","theme"),t.append(s),!e.densityAllowed)return{dom:t,selectTheme:s,selectDensity:null};const a=document.createElement("label");a.classList.add("h5p-theme-picker-label"),a.setAttribute("for",i),a.innerText=e.labelDensity,t.append(a);const l=document.createElement("select");return l.id=i,l.classList.add("h5p-theme-picker-select","density"),t.append(l),{dom:t,selectTheme:s,selectDensity:l}})(e);this.dom=t,this.selectTheme=n,this.selectDensity=r??{}}connectedCallback(){this.render(),this.bindChangeEvents()}disconnectedCallback(){this.unbindChangeEvents(),this.unbindOptionEvents()}setThemeOptions(e=new Map){this.themeOptions=e,this.renderOptions(this.selectTheme,e,(e,t)=>{e.style.setProperty("--background-color",t.backgroundColor),e.style.setProperty("--color",t.color)})}setDensityOptions(e=new Map){this.densityOptions=e,this.selectDensity.getAttribute&&this.renderOptions(this.selectDensity,e)}renderOptions(e,t,n=null){e&&(this.unbindOptionEvents(),e.innerHTML="",t.forEach((t,r)=>{const i=document.createElement("option");i.value=r,i.textContent=t.label,n?.(i,t),e.append(i)}),this.bindOptionEvents())}setActiveTheme(e){this.selectTheme.value=e}setActiveDensity(e){this.selectDensity.value=e}getActiveTheme(){return this.selectTheme.value}getActiveDensity(){return this.selectDensity.value??"large"}handleThemeChange(e){he(this,"theme-change",{key:e.target.value})}handleDensityChange(e){he(this,"density-change",{key:e.target.value})}handleThemePointerEnter(e){he(this,"theme-preview",{key:e.target.value})}handleThemePointerLeave(){he(this,"theme-preview-reset")}handleDensityPointerEnter(e){he(this,"density-preview",{key:e.target.value})}handleDensityPointerLeave(){he(this,"density-preview-reset")}unbindChangeEvents(){this.selectTheme.removeEventListener("change",this.handleThemeChange),this.selectDensity?.removeEventListener?.("change",this.handleDensityChange)}unbindOptionEvents(){this.selectTheme.querySelectorAll("option").forEach(e=>{e.removeEventListener("pointerenter",this.handleThemePointerEnter),e.removeEventListener("pointerleave",this.handleThemePointerLeave)}),this.selectDensity?.querySelectorAll?.("option").forEach(e=>{e.removeEventListener("pointerenter",this.handleDensityPointerEnter),e.removeEventListener("pointerleave",this.handleDensityPointerLeave)})}bindChangeEvents(){this.selectTheme.addEventListener("change",this.handleThemeChange),this.selectDensity?.addEventListener?.("change",this.handleDensityChange)}bindOptionEvents(){this.selectTheme.querySelectorAll("option").forEach(e=>{e.addEventListener("pointerenter",this.handleThemePointerEnter),e.addEventListener("pointerleave",this.handleThemePointerLeave)}),this.selectDensity?.querySelectorAll?.("option").forEach(e=>{e.addEventListener("pointerenter",this.handleDensityPointerEnter),e.addEventListener("pointerleave",this.handleDensityPointerLeave)})}render(){this.contains(this.dom)||this.append(this.dom)}}customElements.get("h5p-theme-picker-selector")||customElements.define("h5p-theme-picker-selector",Te);const Le=JSON.parse('{"themes":{"daylight":{"label":"Daylight (default)","subLabel":"WCAG 2.0 AA","backgroundColor":"rgb(249, 251, 255)","color":"rgb(0, 111, 191)","values":{"--h5p-theme-ui-base":"#FFFFFF","--h5p-theme-text-primary":"#101729","--h5p-theme-text-secondary":"#354054","--h5p-theme-text-third":"#737373","--h5p-theme-stroke-1":"#C7D7EF","--h5p-theme-stroke-2":"#E7EDF6","--h5p-theme-stroke-3":"#F6F7FA","--h5p-theme-feedback-correct-main":"#256D1D","--h5p-theme-feedback-correct-secondary":"#f3fcf0","--h5p-theme-feedback-correct-third":"#cff1c2","--h5p-theme-feedback-incorrect-main":"#a13236","--h5p-theme-feedback-incorrect-secondary":"#faf0f4","--h5p-theme-feedback-incorrect-third":"#f6dce7","--h5p-theme-feedback-neutral-main":"#E6C81D","--h5p-theme-feedback-neutral-secondary":"#5E4817","--h5p-theme-feedback-neutral-third":"#F0EBCB","--h5p-theme-main-cta-base":"#006FBF","--h5p-theme-secondary-cta-base":"#202122","--h5p-theme-alternative-base":"#F1F5FB","--h5p-theme-background":"#F9FBFF","--h5p-theme-focus":"#006FBF","--h5p-theme-main-cta-light":"#007CD6","--h5p-theme-main-cta-dark":"#005FA3","--h5p-theme-contrast-cta":"#EBF7FF","--h5p-theme-contrast-cta-white":"#006FBF","--h5p-theme-contrast-cta-light":"color-mix(in srgb, var(--h5p-theme-main-cta-base), transparent 90%)","--h5p-theme-contrast-cta-dark":"#0597FF","--h5p-theme-secondary-cta-light":"#222324","--h5p-theme-secondary-cta-dark":"#1F1F20","--h5p-theme-secondary-contrast-cta":"#E3E9F1","--h5p-theme-secondary-contrast-cta-hover":"#FFFFFF","--h5p-theme-alternative-light":"#F7F9FD","--h5p-theme-alternative-dark":"#DBE5F5","--h5p-theme-alternative-darker":"#C7D7EF"}},"lavender":{"label":"Lavender","subLabel":"WCAG 2.0 AA","backgroundColor":"rgb(243, 238, 250)","color":"rgb(131, 77, 213)","values":{"--h5p-theme-ui-base":"#FFFFFF","--h5p-theme-text-primary":"#101729","--h5p-theme-text-secondary":"#1b1346","--h5p-theme-text-third":"#737373","--h5p-theme-stroke-1":"#ead8f6","--h5p-theme-stroke-2":"#E7EDF6","--h5p-theme-stroke-3":"#F6F7FA","--h5p-theme-feedback-correct-main":"#256D1D","--h5p-theme-feedback-correct-secondary":"#f3fcf0","--h5p-theme-feedback-correct-third":"#cff1c2","--h5p-theme-feedback-incorrect-main":"#a13236","--h5p-theme-feedback-incorrect-secondary":"#faf0f4","--h5p-theme-feedback-incorrect-third":"#f6dce7","--h5p-theme-feedback-neutral-main":"#E6C81D","--h5p-theme-feedback-neutral-secondary":"#5E4817","--h5p-theme-feedback-neutral-third":"#F0EBCB","--h5p-theme-main-cta-base":"#834DD5","--h5p-theme-secondary-cta-base":"#000000","--h5p-theme-alternative-base":"#f3edff","--h5p-theme-background":"#F3EEFA","--h5p-theme-focus":"#F1EBFA","--h5p-theme-main-cta-light":"#8347DD","--h5p-theme-main-cta-dark":"#692EC2","--h5p-theme-contrast-cta":"#ffffff","--h5p-theme-contrast-cta-white":"#834DD5","--h5p-theme-contrast-cta-light":"color-mix(in srgb, var(--h5p-theme-main-cta-base), transparent 90%)","--h5p-theme-contrast-cta-dark":"#A983E2","--h5p-theme-secondary-cta-light":"#333333","--h5p-theme-secondary-cta-dark":"#311B50","--h5p-theme-secondary-contrast-cta":"#F3F1F5","--h5p-theme-secondary-contrast-cta-hover":"#ffffff","--h5p-theme-alternative-light":"#f8f5ff","--h5p-theme-alternative-dark":"#e8d9ff","--h5p-theme-alternative-darker":"#ddc7ff"}},"mint":{"label":"Mint","subLabel":"WCAG 2.0 AA","backgroundColor":"rgb(252, 249, 242)","color":"rgb(23, 148, 139)","values":{"--h5p-theme-ui-base":"#FFFFFF","--h5p-theme-text-primary":"#101729","--h5p-theme-text-secondary":"#05252e","--h5p-theme-text-third":"#737373","--h5p-theme-stroke-1":"#cceae8","--h5p-theme-stroke-2":"#E7EDF6","--h5p-theme-stroke-3":"#F6F7FA","--h5p-theme-feedback-correct-main":"#256D1D","--h5p-theme-feedback-correct-secondary":"#f3fcf0","--h5p-theme-feedback-correct-third":"#cff1c2","--h5p-theme-feedback-incorrect-main":"#a13236","--h5p-theme-feedback-incorrect-secondary":"#faf0f4","--h5p-theme-feedback-incorrect-third":"#f6dce7","--h5p-theme-feedback-neutral-main":"#E6C81D","--h5p-theme-feedback-neutral-secondary":"#5E4817","--h5p-theme-feedback-neutral-third":"#F0EBCB","--h5p-theme-main-cta-base":"#17948b","--h5p-theme-secondary-cta-base":"#000000","--h5p-theme-alternative-base":"#FAF4E6","--h5p-theme-background":"#FCF9F2","--h5p-theme-focus":"#F1EBFA","--h5p-theme-main-cta-light":"#00B2A0","--h5p-theme-main-cta-dark":"#004D45","--h5p-theme-contrast-cta":"#ffffff","--h5p-theme-contrast-cta-white":"#17948b","--h5p-theme-contrast-cta-light":"color-mix(in srgb, var(--h5p-theme-main-cta-base), transparent 90%)","--h5p-theme-contrast-cta-dark":"#1AA89E","--h5p-theme-secondary-cta-light":"#333333","--h5p-theme-secondary-cta-dark":"#311B50","--h5p-theme-secondary-contrast-cta":"#F3F1F5","--h5p-theme-secondary-contrast-cta-hover":"#ffffff","--h5p-theme-alternative-light":"#FCF9F2","--h5p-theme-alternative-dark":"#F2E3BF","--h5p-theme-alternative-darker":"#EEDAAA"}},"sunset":{"label":"Sunset","subLabel":"WCAG 2.0 AA","backgroundColor":"rgb(255, 242, 237)","color":"rgb(214, 58, 10)","values":{"--h5p-theme-ui-base":"#FFFFFF","--h5p-theme-text-primary":"#101729","--h5p-theme-text-secondary":"#2c0f03","--h5p-theme-text-third":"#737373","--h5p-theme-stroke-1":"#f2dbd4","--h5p-theme-stroke-2":"#E7EDF6","--h5p-theme-stroke-3":"#F6F7FA","--h5p-theme-feedback-correct-main":"#256D1D","--h5p-theme-feedback-correct-secondary":"#f3fcf0","--h5p-theme-feedback-correct-third":"#cff1c2","--h5p-theme-feedback-incorrect-main":"#a13236","--h5p-theme-feedback-incorrect-secondary":"#faf0f4","--h5p-theme-feedback-incorrect-third":"#f6dce7","--h5p-theme-feedback-neutral-main":"#E6C81D","--h5p-theme-feedback-neutral-secondary":"#5E4817","--h5p-theme-feedback-neutral-third":"#F0EBCB","--h5p-theme-main-cta-base":"#D63A0A","--h5p-theme-secondary-cta-base":"#172326","--h5p-theme-alternative-base":"#FFF2ED","--h5p-theme-background":"#FFF2ED","--h5p-theme-focus":"#F1EBFA","--h5p-theme-main-cta-light":"#F5511F","--h5p-theme-main-cta-dark":"#AF320B","--h5p-theme-contrast-cta":"#ffffff","--h5p-theme-contrast-cta-white":"#D63A0A","--h5p-theme-contrast-cta-light":"color-mix(in srgb, var(--h5p-theme-main-cta-base), transparent 90%)","--h5p-theme-contrast-cta-dark":"#F66437","--h5p-theme-secondary-cta-light":"#263A3F","--h5p-theme-secondary-cta-dark":"#121A1D","--h5p-theme-secondary-contrast-cta":"#F3F1F5","--h5p-theme-secondary-contrast-cta-hover":"#ffffff","--h5p-theme-alternative-light":"#FDF8F7","--h5p-theme-alternative-dark":"#F2DBD4","--h5p-theme-alternative-darker":"#FFCFBA"}},"custom":{"label":"Custom Theme","subLabel":"Define a custom theme","backgroundColor":"rgb(249, 251, 255)","color":"rgb(0, 111, 191)","values":{}}},"densities":{"large":{"label":"Wide (default)","values":{"--h5p-theme-spacing-xl":"var(--h5p-theme-spacing-xl-primary-large)","--h5p-theme-spacing-l":"var(--h5p-theme-spacing-primary-large)","--h5p-theme-spacing-m":"var(--h5p-theme-spacing-secondary-large)","--h5p-theme-spacing-s":"var(--h5p-theme-spacing-third-large)","--h5p-theme-spacing-xs":"var(--h5p-theme-spacing-fourth-large)","--h5p-theme-spacing-xxs":"var(--h5p-theme-spacing-fifth-large)","--h5p-theme-font-size-xxl":"var(--h5p-theme-font-size-xxl-large)","--h5p-theme-font-size-xl":"var(--h5p-theme-font-size-xl-large)","--h5p-theme-font-size-l":"var(--h5p-theme-font-size-l-large)","--h5p-theme-font-size-m":"var(--h5p-theme-font-size-m-large)","--h5p-theme-font-size-s":"var(--h5p-theme-font-size-s-large)","--h5p-theme-scaling":"1"}},"medium":{"label":"Medium","values":{"--h5p-theme-spacing-xl":"var(--h5p-theme-spacing-xl-primary-medium)","--h5p-theme-spacing-l":"var(--h5p-theme-spacing-primary-medium)","--h5p-theme-spacing-m":"var(--h5p-theme-spacing-secondary-medium)","--h5p-theme-spacing-s":"var(--h5p-theme-spacing-third-medium)","--h5p-theme-spacing-xs":"var(--h5p-theme-spacing-fourth-medium)","--h5p-theme-spacing-xxs":"var(--h5p-theme-spacing-fifth-medium)","--h5p-theme-font-size-xxl":"var(--h5p-theme-font-size-xxl-medium)","--h5p-theme-font-size-xl":"var(--h5p-theme-font-size-xl-medium)","--h5p-theme-font-size-l":"var(--h5p-theme-font-size-l-medium)","--h5p-theme-font-size-m":"var(--h5p-theme-font-size-m-medium)","--h5p-theme-font-size-s":"var(--h5p-theme-font-size-s-medium)","--h5p-theme-scaling":"0.8"}},"small":{"label":"Compact","values":{"--h5p-theme-spacing-xl":"var(--h5p-theme-spacing-xl-primary-small)","--h5p-theme-spacing-l":"var(--h5p-theme-spacing-primary-small)","--h5p-theme-spacing-m":"var(--h5p-theme-spacing-secondary-small)","--h5p-theme-spacing-s":"var(--h5p-theme-spacing-third-small)","--h5p-theme-spacing-xs":"var(--h5p-theme-spacing-fourth-small)","--h5p-theme-spacing-xxs":"var(--h5p-theme-spacing-fifth-small)","--h5p-theme-font-size-xxl":"var(--h5p-theme-font-size-xxl-small)","--h5p-theme-font-size-xl":"var(--h5p-theme-font-size-xl-small)","--h5p-theme-font-size-l":"var(--h5p-theme-font-size-l-small)","--h5p-theme-font-size-m":"var(--h5p-theme-font-size-m-small)","--h5p-theme-font-size-s":"var(--h5p-theme-font-size-s-small)","--h5p-theme-scaling":"0.6"}}}}'),Ee=e=>{if(!e)return{};if("object"==typeof e&&!Array.isArray(e))return e;if("string"==typeof e)try{const t=JSON.parse(e);return t&&"object"==typeof t&&!Array.isArray(t)?t:{}}catch(e){return{}}return{}},Oe=e=>{const t={},n=Pe();for(const[r,i]of Object.entries(e)){if(!r)continue;if(!ue(i))continue;if(!ue(i.values))continue;const e={};for(const[t,r]of Object.entries(i.values))"string"==typeof r&&n.has(t)&&(e[t]=r);if(!K.every(t=>t in e))continue;const o="string"==typeof i.backgroundColor?i.backgroundColor:"#ffffff",s="string"==typeof i.color?i.color:ne(o,o),a="string"==typeof i.label?i.label:De(r),l="string"==typeof i.subLabel?i.subLabel:"";t[r]={backgroundColor:o,color:s,label:a,subLabel:l,values:e}}return t},Pe=()=>{const e=new Set,t=Le?.themes??{},n=Object.values(t)[0];if(!n?.values||"object"!=typeof n.values)return e;for(const t of Object.keys(n.values))e.add(t);return e},De=(e="")=>`${e.charAt(0).toUpperCase()}${e.slice(1).toLowerCase()}`,Fe=(e,t,n)=>{const r=new Map;for(const[i,o]of Object.entries(e)){const e={...o,values:{...o.values||{}}},s=`${n}${i}`;"function"==typeof t?.has&&"function"==typeof t?.get&&t.has(s)&&(e.label=t.get(s)),r.set(i,e)}return r};class Me{constructor(e={}){const{translations:t,presetThemesAllowed:n,customThemesAllowed:r,customPresets:i}=((e={})=>{const t=e&&"object"==typeof e&&!Array.isArray(e)?e:{},{translations:n,presetThemesAllowed:r=!0,customThemesAllowed:i=!0,customPresets:o={}}=t,s=Ee(o),a=Oe(s),l=Object.keys(a).length>0;let c=i;return c||r||l||(c=!0),{translations:n,presetThemesAllowed:r,customThemesAllowed:c,customPresets:a}})(e);this.options={},this.options.theme=Fe(Le.themes,t,"selector_theme_value_"),n||(this.options.theme=new Map([...this.options.theme].filter(([e])=>"custom"===e)));for(const[e,t]of Object.entries(i))this.options.theme.set(e,t);const o=this.options.theme.get("custom");this.options.theme.delete("custom"),r&&o&&this.options.theme.set("custom",o),this.options.density=Fe(Le.densities,t,"selector_density_value_")}getThemeOptions(){return this.options.theme}getDensityOptions(){return this.options.density}}const ze=JSON.parse('{"en":{"selector_theme_label":"Theme","selector_theme_value_daylight":"Daylight (default)","selector_theme_value_lavender":"Lavender","selector_theme_value_mint":"Mint","selector_theme_value_sunset":"Sunset","selector_theme_value_custom":"Custom Theme","selector_density_label":"Density","selector_density_value_large":"Wide (default)","selector_density_value_medium":"Medium","selector_density_value_small":"Compact","color_selector_title":"Define theme colors","color_selector_buttons_label":"Buttons","color_selector_buttons_button_aria":"Pick main color, e.g. for buttons","color_selector_navigation_label":"Navigation","color_selector_navigation_button_aria":"Pick secondary color for navigation buttons","color_selector_alternative_label":"Alternative","color_selector_alternative_button_aria":"Pick alternative hue as contrast to main color","color_selector_background_label":"Background","color_selector_background_button_aria":"Pick color for the background","preview_preview_label_prefix":"Preview:"},"de":{"selector_theme_label":"Theme","selector_theme_value_daylight":"Tageslicht (Vorgabe)","selector_theme_value_lavender":"Lavendel","selector_theme_value_mint":"Minze","selector_theme_value_sunset":"Sonnenuntergang","selector_theme_value_custom":"Eigenes Theme","selector_density_label":"Dichte","selector_density_value_large":"Weit (Vorgabe)","selector_density_value_medium":"Medium","selector_density_value_small":"Kompakt","color_selector_title":"Lege Theme-Farben fest","color_selector_buttons_label":"Buttons","color_selector_buttons_button_aria":"Wähle die Hauptfarbe, zum Beispiel für Buttons","color_selector_navigation_label":"Navigation","color_selector_navigation_button_aria":"Wähle die Nebenfarbe für Navigationsbuttons","color_selector_alternative_label":"Alternativ","color_selector_alternative_button_aria":"Wähle den Alternativfarbton als Kontrast zur Hauptfarbe","color_selector_background_label":"Hintergrund","color_selector_background_button_aria":"Wähle die Farbe für den Hintergrund","preview_preview_label_prefix":"Vorschau:"}}'),je="en";class Ie{constructor(e=je,t={}){const n=(e=>{if("string"!=typeof e)return je;const t=e.toLowerCase();return ze[t]?t:je})(e),r=(e=>{const t=new Set(Object.keys(ze[je]||{})),n={};for(const[r,i]of Object.entries(e))t.has(r)&&"string"==typeof i&&(n[r]=i);return n})((e=>{if(!e)return{};if("object"==typeof e&&!Array.isArray(e))return e;if("string"==typeof e)try{const t=JSON.parse(e);return t&&"object"==typeof t&&!Array.isArray(t)?t:{}}catch(e){return{}}return{}})(t)),i=ze[n]??{},o={...ze[je]??{},...i,...r};var s;this.translations=new Map((s=o,Object.keys(s||{}).map(e=>[e,s[e]])))}get(e){return"string"==typeof e&&this.has(e)?this.translations.get(e):`Missing translation for key: ${e}`}has(e){return this.translations.has(e)}}var Ne=Object.defineProperty,Re=Object.defineProperties,Be=Object.getOwnPropertyDescriptors,$e=Object.getOwnPropertySymbols,Ue=Object.prototype.hasOwnProperty,We=Object.prototype.propertyIsEnumerable,Ve=(e,t,n)=>t in e?Ne(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,He=(e,t)=>{for(var n in t||(t={}))Ue.call(t,n)&&Ve(e,n,t[n]);if($e)for(var n of $e(t))We.call(t,n)&&Ve(e,n,t[n]);return e},qe=(e,t)=>Re(e,Be(t)),Qe=(e,t,n)=>new Promise((r,i)=>{var o=e=>{try{a(n.next(e))}catch(e){i(e)}},s=e=>{try{a(n.throw(e))}catch(e){i(e)}},a=e=>e.done?r(e.value):Promise.resolve(e.value).then(o,s);a((n=n.apply(e,t)).next())});const Ge=Math.min,Ke=Math.max,Ye=Math.round,Je=Math.floor,Xe=e=>({x:e,y:e});function Ze(e){return"number"!=typeof e?function(e){return He({top:0,right:0,bottom:0,left:0},e)}(e):{top:e,right:e,bottom:e,left:e}}function et(e){const{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function tt(){return"undefined"!=typeof window}function nt(e){return ot(e)?(e.nodeName||"").toLowerCase():"#document"}function rt(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function it(e){var t;return null==(t=(ot(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function ot(e){return!!tt()&&(e instanceof Node||e instanceof rt(e).Node)}function st(e){return!!tt()&&(e instanceof Element||e instanceof rt(e).Element)}function at(e){return!!tt()&&(e instanceof HTMLElement||e instanceof rt(e).HTMLElement)}function lt(e){return!(!tt()||"undefined"==typeof ShadowRoot)&&(e instanceof ShadowRoot||e instanceof rt(e).ShadowRoot)}const ct=new Set(["inline","contents"]);function ht(e){const{overflow:t,overflowX:n,overflowY:r,display:i}=wt(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!ct.has(i)}const ut=new Set(["table","td","th"]);function pt(e){return ut.has(nt(e))}const dt=[":popover-open",":modal"];function mt(e){return dt.some(t=>{try{return e.matches(t)}catch(e){return!1}})}const ft=["transform","translate","scale","rotate","perspective"],gt=["transform","translate","scale","rotate","perspective","filter"],bt=["paint","layout","strict","content"];function kt(e){const t=yt(),n=st(e)?wt(e):e;return ft.some(e=>!!n[e]&&"none"!==n[e])||!!n.containerType&&"normal"!==n.containerType||!t&&!!n.backdropFilter&&"none"!==n.backdropFilter||!t&&!!n.filter&&"none"!==n.filter||gt.some(e=>(n.willChange||"").includes(e))||bt.some(e=>(n.contain||"").includes(e))}function yt(){return!("undefined"==typeof CSS||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}const vt=new Set(["html","body","#document"]);function St(e){return vt.has(nt(e))}function wt(e){return rt(e).getComputedStyle(e)}function xt(e){return st(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Ct(e){if("html"===nt(e))return e;const t=e.assignedSlot||e.parentNode||lt(e)&&e.host||it(e);return lt(t)?t.host:t}function At(e){const t=Ct(e);return St(t)?e.ownerDocument?e.ownerDocument.body:e.body:at(t)&&ht(t)?t:At(t)}function _t(e,t,n){var r;void 0===t&&(t=[]),void 0===n&&(n=!0);const i=At(e),o=i===(null==(r=e.ownerDocument)?void 0:r.body),s=rt(i);if(o){const e=Tt(s);return t.concat(s,s.visualViewport||[],ht(i)?i:[],e&&n?_t(e):[])}return t.concat(i,_t(i,[],n))}function Tt(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Lt(e){const t=wt(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const i=at(e),o=i?e.offsetWidth:n,s=i?e.offsetHeight:r,a=Ye(n)!==o||Ye(r)!==s;return a&&(n=o,r=s),{width:n,height:r,$:a}}function Et(e){return st(e)?e:e.contextElement}function Ot(e){const t=Et(e);if(!at(t))return Xe(1);const n=t.getBoundingClientRect(),{width:r,height:i,$:o}=Lt(t);let s=(o?Ye(n.width):n.width)/r,a=(o?Ye(n.height):n.height)/i;return(!s||!Number.isFinite(s))&&(s=1),(!a||!Number.isFinite(a))&&(a=1),{x:s,y:a}}const Pt=Xe(0);function Dt(e){const t=rt(e);return yt()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:Pt}function Ft(e,t,n,r){void 0===t&&(t=!1),void 0===n&&(n=!1);const i=e.getBoundingClientRect(),o=Et(e);let s=Xe(1);t&&(r?st(r)&&(s=Ot(r)):s=Ot(e));const a=function(e,t,n){return void 0===t&&(t=!1),!(!n||t&&n!==rt(e))&&t}(o,n,r)?Dt(o):Xe(0);let l=(i.left+a.x)/s.x,c=(i.top+a.y)/s.y,h=i.width/s.x,u=i.height/s.y;if(o){const e=rt(o),t=r&&st(r)?rt(r):r;let n=e,i=Tt(n);for(;i&&r&&t!==n;){const e=Ot(i),t=i.getBoundingClientRect(),r=wt(i),o=t.left+(i.clientLeft+parseFloat(r.paddingLeft))*e.x,s=t.top+(i.clientTop+parseFloat(r.paddingTop))*e.y;l*=e.x,c*=e.y,h*=e.x,u*=e.y,l+=o,c+=s,n=rt(i),i=Tt(n)}}return et({width:h,height:u,x:l,y:c})}function Mt(e,t){const n=xt(e).scrollLeft;return t?t.left+n:Ft(it(e)).left+n}function zt(e,t){const n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-Mt(e,n),y:n.top+t.scrollTop}}const jt=new Set(["absolute","fixed"]);function It(e,t,n){let r;if("viewport"===t)r=function(e,t){const n=rt(e),r=it(e),i=n.visualViewport;let o=r.clientWidth,s=r.clientHeight,a=0,l=0;if(i){o=i.width,s=i.height;const e=yt();(!e||e&&"fixed"===t)&&(a=i.offsetLeft,l=i.offsetTop)}const c=Mt(r);if(c<=0){const e=r.ownerDocument,t=e.body,n=getComputedStyle(t),i="CSS1Compat"===e.compatMode&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,s=Math.abs(r.clientWidth-t.clientWidth-i);s<=25&&(o-=s)}else c<=25&&(o+=c);return{width:o,height:s,x:a,y:l}}(e,n);else if("document"===t)r=function(e){const t=it(e),n=xt(e),r=e.ownerDocument.body,i=Ke(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),o=Ke(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let s=-n.scrollLeft+Mt(e);const a=-n.scrollTop;return"rtl"===wt(r).direction&&(s+=Ke(t.clientWidth,r.clientWidth)-i),{width:i,height:o,x:s,y:a}}(it(e));else if(st(t))r=function(e,t){const n=Ft(e,!0,"fixed"===t),r=n.top+e.clientTop,i=n.left+e.clientLeft,o=at(e)?Ot(e):Xe(1);return{width:e.clientWidth*o.x,height:e.clientHeight*o.y,x:i*o.x,y:r*o.y}}(t,n);else{const n=Dt(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return et(r)}function Nt(e,t){const n=Ct(e);return!(n===t||!st(n)||St(n))&&("fixed"===wt(n).position||Nt(n,t))}function Rt(e,t){const n=t.get(e);if(n)return n;let r=_t(e,[],!1).filter(e=>st(e)&&"body"!==nt(e)),i=null;const o="fixed"===wt(e).position;let s=o?Ct(e):e;for(;st(s)&&!St(s);){const t=wt(s),n=kt(s);!n&&"fixed"===t.position&&(i=null),(o?!n&&!i:!n&&"static"===t.position&&i&&jt.has(i.position)||ht(s)&&!n&&Nt(e,s))?r=r.filter(e=>e!==s):i=t,s=Ct(s)}return t.set(e,r),r}function Bt(e,t,n){const r=at(t),i=it(t),o="fixed"===n,s=Ft(e,!0,o,t);let a={scrollLeft:0,scrollTop:0};const l=Xe(0);function c(){l.x=Mt(i)}if(r||!r&&!o)if(("body"!==nt(t)||ht(i))&&(a=xt(t)),r){const e=Ft(t,!0,o,t);l.x=e.x+t.clientLeft,l.y=e.y+t.clientTop}else i&&c();o&&!r&&i&&c();const h=!i||r||o?Xe(0):zt(i,a);return{x:s.left+a.scrollLeft-l.x-h.x,y:s.top+a.scrollTop-l.y-h.y,width:s.width,height:s.height}}function $t(e){return"static"===wt(e).position}function Ut(e,t){if(!at(e)||"fixed"===wt(e).position)return null;if(t)return t(e);let n=e.offsetParent;return it(e)===n&&(n=n.ownerDocument.body),n}function Wt(e,t){const n=rt(e);if(mt(e))return n;if(!at(e)){let t=Ct(e);for(;t&&!St(t);){if(st(t)&&!$t(t))return t;t=Ct(t)}return n}let r=Ut(e,t);for(;r&&pt(r)&&$t(r);)r=Ut(r,t);return r&&St(r)&&$t(r)&&!kt(r)?n:r||function(e){let t=Ct(e);for(;at(t)&&!St(t);){if(kt(t))return t;if(mt(t))return null;t=Ct(t)}return null}(e)||n}const Vt={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e;const o="fixed"===i,s=it(r),a=!!t&&mt(t.floating);if(r===s||a&&o)return n;let l={scrollLeft:0,scrollTop:0},c=Xe(1);const h=Xe(0),u=at(r);if((u||!u&&!o)&&(("body"!==nt(r)||ht(s))&&(l=xt(r)),at(r))){const e=Ft(r);c=Ot(r),h.x=e.x+r.clientLeft,h.y=e.y+r.clientTop}const p=!s||u||o?Xe(0):zt(s,l);return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-l.scrollLeft*c.x+h.x+p.x,y:n.y*c.y-l.scrollTop*c.y+h.y+p.y}},getDocumentElement:it,getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e;const o=[..."clippingAncestors"===n?mt(t)?[]:Rt(t,this._c):[].concat(n),r],s=o[0],a=o.reduce((e,n)=>{const r=It(t,n,i);return e.top=Ke(r.top,e.top),e.right=Ge(r.right,e.right),e.bottom=Ge(r.bottom,e.bottom),e.left=Ke(r.left,e.left),e},It(t,s,i));return{width:a.right-a.left,height:a.bottom-a.top,x:a.left,y:a.top}},getOffsetParent:Wt,getElementRects:function(e){return Qe(this,null,function*(){const t=this.getOffsetParent||Wt,n=this.getDimensions,r=yield n(e.floating);return{reference:Bt(e.reference,yield t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}})},getClientRects:function(e){return Array.from(e.getClientRects())},getDimensions:function(e){const{width:t,height:n}=Lt(e);return{width:t,height:n}},getScale:Ot,isElement:st,isRTL:function(e){return"rtl"===wt(e).direction}};function Ht(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function qt(e,t,n,r){void 0===r&&(r={});const{ancestorScroll:i=!0,ancestorResize:o=!0,elementResize:s="function"==typeof ResizeObserver,layoutShift:a="function"==typeof IntersectionObserver,animationFrame:l=!1}=r,c=Et(e),h=i||o?[...c?_t(c):[],..._t(t)]:[];h.forEach(e=>{i&&e.addEventListener("scroll",n,{passive:!0}),o&&e.addEventListener("resize",n)});const u=c&&a?function(e,t){let n,r=null;const i=it(e);function o(){var e;clearTimeout(n),null==(e=r)||e.disconnect(),r=null}return function s(a,l){void 0===a&&(a=!1),void 0===l&&(l=1),o();const c=e.getBoundingClientRect(),{left:h,top:u,width:p,height:d}=c;if(a||t(),!p||!d)return;const m={rootMargin:-Je(u)+"px "+-Je(i.clientWidth-(h+p))+"px "+-Je(i.clientHeight-(u+d))+"px "+-Je(h)+"px",threshold:Ke(0,Ge(1,l))||1};let f=!0;function g(t){const r=t[0].intersectionRatio;if(r!==l){if(!f)return s();r?s(!1,r):n=setTimeout(()=>{s(!1,1e-7)},1e3)}1===r&&!Ht(c,e.getBoundingClientRect())&&s(),f=!1}try{r=new IntersectionObserver(g,qe(He({},m),{root:i.ownerDocument}))}catch(e){r=new IntersectionObserver(g,m)}r.observe(e)}(!0),o}(c,n):null;let p=-1,d=null;s&&(d=new ResizeObserver(e=>{let[r]=e;r&&r.target===c&&d&&(d.unobserve(t),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{var e;null==(e=d)||e.observe(t)})),n()}),c&&!l&&d.observe(c),d.observe(t));let m,f=l?Ft(e):null;return l&&function t(){const r=Ft(e);f&&!Ht(f,r)&&n(),f=r,m=requestAnimationFrame(t)}(),n(),()=>{var e;h.forEach(e=>{i&&e.removeEventListener("scroll",n),o&&e.removeEventListener("resize",n)}),null==u||u(),null==(e=d)||e.disconnect(),d=null,l&&cancelAnimationFrame(m)}}const Qt=function(e,t){return Qe(this,null,function*(){var n;void 0===t&&(t={});const{x:r,y:i,platform:o,rects:s,elements:a,strategy:l}=e,{boundary:c="clippingAncestors",rootBoundary:h="viewport",elementContext:u="floating",altBoundary:p=!1,padding:d=0}=function(e,t){return"function"==typeof e?e(t):e}(t,e),m=Ze(d),f=a[p?"floating"===u?"reference":"floating":u],g=et(yield o.getClippingRect({element:null==(n=yield null==o.isElement?void 0:o.isElement(f))||n?f:f.contextElement||(yield null==o.getDocumentElement?void 0:o.getDocumentElement(a.floating)),boundary:c,rootBoundary:h,strategy:l})),b="floating"===u?{x:r,y:i,width:s.floating.width,height:s.floating.height}:s.reference,k=yield null==o.getOffsetParent?void 0:o.getOffsetParent(a.floating),y=(yield null==o.isElement?void 0:o.isElement(k))&&(yield null==o.getScale?void 0:o.getScale(k))||{x:1,y:1},v=et(o.convertOffsetParentRelativeRectToViewportRelativeRect?yield o.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:b,offsetParent:k,strategy:l}):b);return{top:(g.top-v.top+m.top)/y.y,bottom:(v.bottom-g.bottom+m.bottom)/y.y,left:(g.left-v.left+m.left)/y.x,right:(v.right-g.right+m.right)/y.x}})};let Gt=null;class Kt{static createItem(e){return{prev:null,next:null,data:e}}constructor(){this.head=null,this.tail=null,this.cursor=null}createItem(e){return Kt.createItem(e)}allocateCursor(e,t){let n;return null!==Gt?(n=Gt,Gt=Gt.cursor,n.prev=e,n.next=t,n.cursor=this.cursor):n={prev:e,next:t,cursor:this.cursor},this.cursor=n,n}releaseCursor(){const{cursor:e}=this;this.cursor=e.cursor,e.prev=null,e.next=null,e.cursor=Gt,Gt=e}updateCursors(e,t,n,r){let{cursor:i}=this;for(;null!==i;)i.prev===e&&(i.prev=t),i.next===n&&(i.next=r),i=i.cursor}*[Symbol.iterator](){for(let e=this.head;null!==e;e=e.next)yield e.data}get size(){let e=0;for(let t=this.head;null!==t;t=t.next)e++;return e}get isEmpty(){return null===this.head}get first(){return this.head&&this.head.data}get last(){return this.tail&&this.tail.data}fromArray(e){let t=null;this.head=null;for(let n of e){const e=Kt.createItem(n);null!==t?t.next=e:this.head=e,e.prev=t,t=e}return this.tail=t,this}toArray(){return[...this]}toJSON(){return[...this]}forEach(e,t=this){const n=this.allocateCursor(null,this.head);for(;null!==n.next;){const r=n.next;n.next=r.next,e.call(t,r.data,r,this)}this.releaseCursor()}forEachRight(e,t=this){const n=this.allocateCursor(this.tail,null);for(;null!==n.prev;){const r=n.prev;n.prev=r.prev,e.call(t,r.data,r,this)}this.releaseCursor()}reduce(e,t,n=this){let r,i=this.allocateCursor(null,this.head),o=t;for(;null!==i.next;)r=i.next,i.next=r.next,o=e.call(n,o,r.data,r,this);return this.releaseCursor(),o}reduceRight(e,t,n=this){let r,i=this.allocateCursor(this.tail,null),o=t;for(;null!==i.prev;)r=i.prev,i.prev=r.prev,o=e.call(n,o,r.data,r,this);return this.releaseCursor(),o}some(e,t=this){for(let n=this.head;null!==n;n=n.next)if(e.call(t,n.data,n,this))return!0;return!1}map(e,t=this){const n=new Kt;for(let r=this.head;null!==r;r=r.next)n.appendData(e.call(t,r.data,r,this));return n}filter(e,t=this){const n=new Kt;for(let r=this.head;null!==r;r=r.next)e.call(t,r.data,r,this)&&n.appendData(r.data);return n}nextUntil(e,t,n=this){if(null===e)return;const r=this.allocateCursor(null,e);for(;null!==r.next;){const e=r.next;if(r.next=e.next,t.call(n,e.data,e,this))break}this.releaseCursor()}prevUntil(e,t,n=this){if(null===e)return;const r=this.allocateCursor(e,null);for(;null!==r.prev;){const e=r.prev;if(r.prev=e.prev,t.call(n,e.data,e,this))break}this.releaseCursor()}clear(){this.head=null,this.tail=null}copy(){const e=new Kt;for(let t of this)e.appendData(t);return e}prepend(e){return this.updateCursors(null,e,this.head,e),null!==this.head?(this.head.prev=e,e.next=this.head):this.tail=e,this.head=e,this}prependData(e){return this.prepend(Kt.createItem(e))}append(e){return this.insert(e)}appendData(e){return this.insert(Kt.createItem(e))}insert(e,t=null){if(null!==t)if(this.updateCursors(t.prev,e,t,e),null===t.prev){if(this.head!==t)throw new Error("before doesn't belong to list");this.head=e,t.prev=e,e.next=t,this.updateCursors(null,e)}else t.prev.next=e,e.prev=t.prev,t.prev=e,e.next=t;else this.updateCursors(this.tail,e,null,e),null!==this.tail?(this.tail.next=e,e.prev=this.tail):this.head=e,this.tail=e;return this}insertData(e,t){return this.insert(Kt.createItem(e),t)}remove(e){if(this.updateCursors(e,e.prev,e,e.next),null!==e.prev)e.prev.next=e.next;else{if(this.head!==e)throw new Error("item doesn't belong to list");this.head=e.next}if(null!==e.next)e.next.prev=e.prev;else{if(this.tail!==e)throw new Error("item doesn't belong to list");this.tail=e.prev}return e.prev=null,e.next=null,e}push(e){this.insert(Kt.createItem(e))}pop(){return null!==this.tail?this.remove(this.tail):null}unshift(e){this.prepend(Kt.createItem(e))}shift(){return null!==this.head?this.remove(this.head):null}prependList(e){return this.insertList(e,this.head)}appendList(e){return this.insertList(e)}insertList(e,t){return null===e.head||(null!=t?(this.updateCursors(t.prev,e.tail,t,e.head),null!==t.prev?(t.prev.next=e.head,e.head.prev=t.prev):this.head=e.head,t.prev=e.tail,e.tail.next=t):(this.updateCursors(this.tail,e.tail,null,e.head),null!==this.tail?(this.tail.next=e.head,e.head.prev=this.tail):this.head=e.head,this.tail=e.tail),e.head=null,e.tail=null),this}replace(e,t){"head"in t?this.insertList(t,e):this.insert(t,e),this.remove(e)}}function Yt(e){const t={};for(const n of Object.keys(e)){let r=e[n];r&&(Array.isArray(r)||r instanceof Kt?r=r.map(Yt):r.constructor===Object&&(r=Yt(r))),t[n]=r}return t}const Jt=10,Xt=11,Zt=12,en=13,tn=15,nn=16,rn=17,on=18,sn=19,an=21,ln=22,cn=23,hn=24,un=25;function pn(e){return e>=48&&e<=57}function dn(e){return pn(e)||e>=65&&e<=70||e>=97&&e<=102}function mn(e){return e>=65&&e<=90}function fn(e){return function(e){return mn(e)||function(e){return e>=97&&e<=122}(e)}(e)||function(e){return e>=128}(e)||95===e}function gn(e){return fn(e)||pn(e)||45===e}function bn(e){return e>=0&&e<=8||11===e||e>=14&&e<=31||127===e}function kn(e){return 10===e||13===e||12===e}function yn(e){return kn(e)||32===e||9===e}function vn(e,t){return!(92!==e||kn(t)||0===t)}function Sn(e,t,n){return 45===e?fn(t)||45===t||vn(t,n):!!fn(e)||92===e&&vn(e,t)}function wn(e,t,n){return 43===e||45===e?pn(t)?2:46===t&&pn(n)?3:0:46===e?pn(t)?2:0:pn(e)?1:0}function xn(e){return 65279===e||65534===e?1:0}const Cn=new Array(128),An=130;for(let e=0;e<Cn.length;e++)Cn[e]=(yn(e)?An:pn(e)&&131)||fn(e)&&132||bn(e)&&133||e||128;function _n(e){return e<128?Cn[e]:132}function Tn(e,t){return t<e.length?e.charCodeAt(t):0}function Ln(e,t,n){return 13===n&&10===Tn(e,t+1)?2:1}function En(e,t,n){let r=e.charCodeAt(t);return mn(r)&&(r|=32),r===n}function On(e,t,n,r){if(n-t!==r.length||t<0||n>e.length)return!1;for(let i=t;i<n;i++){const n=r.charCodeAt(i-t);let o=e.charCodeAt(i);if(mn(o)&&(o|=32),o!==n)return!1}return!0}function Pn(e,t){for(;t<e.length&&yn(e.charCodeAt(t));t++);return t}function Dn(e,t){for(;t<e.length&&pn(e.charCodeAt(t));t++);return t}function Fn(e,t){if(dn(Tn(e,(t+=2)-1))){for(const n=Math.min(e.length,t+5);t<n&&dn(Tn(e,t));t++);const n=Tn(e,t);yn(n)&&(t+=Ln(e,t,n))}return t}function Mn(e,t){for(;t<e.length;t++){const n=e.charCodeAt(t);if(!gn(n)){if(vn(n,Tn(e,t+1))){t=Fn(e,t)-1;continue}break}}return t}function zn(e,t){let n=e.charCodeAt(t);if((43===n||45===n)&&(n=e.charCodeAt(t+=1)),pn(n)&&(t=Dn(e,t+1),n=e.charCodeAt(t)),46===n&&pn(e.charCodeAt(t+1))&&(t=Dn(e,t+=2)),En(e,t,101)){let r=0;n=e.charCodeAt(t+1),(45===n||43===n)&&(r=1,n=e.charCodeAt(t+2)),pn(n)&&(t=Dn(e,t+1+r+1))}return t}function jn(e,t){for(;t<e.length;t++){const n=e.charCodeAt(t);if(41===n){t++;break}vn(n,Tn(e,t+1))&&(t=Fn(e,t))}return t}function In(e){if(1===e.length&&!dn(e.charCodeAt(0)))return e[0];let t=parseInt(e,16);return(0===t||t>=55296&&t<=57343||t>1114111)&&(t=65533),String.fromCodePoint(t)}const Nn=["EOF-token","ident-token","function-token","at-keyword-token","hash-token","string-token","bad-string-token","url-token","bad-url-token","delim-token","number-token","percentage-token","dimension-token","whitespace-token","CDO-token","CDC-token","colon-token","semicolon-token","comma-token","[-token","]-token","(-token",")-token","{-token","}-token","comment-token"];function Rn(e=null,t){return null===e||e.length<t?new Uint32Array(Math.max(t+1024,16384)):e}function Bn(e){const t=e.source,n=t.length,r=t.length>0?xn(t.charCodeAt(0)):0,i=Rn(e.lines,n),o=Rn(e.columns,n);let s=e.startLine,a=e.startColumn;for(let e=r;e<n;e++){const r=t.charCodeAt(e);i[e]=s,o[e]=a++,(10===r||13===r||12===r)&&(13===r&&e+1<n&&10===t.charCodeAt(e+1)&&(e++,i[e]=s,o[e]=a),s++,a=1)}i[n]=s,o[n]=a,e.lines=i,e.columns=o,e.computed=!0}class $n{constructor(e,t,n,r){this.setSource(e,t,n,r),this.lines=null,this.columns=null}setSource(e="",t=0,n=1,r=1){this.source=e,this.startOffset=t,this.startLine=n,this.startColumn=r,this.computed=!1}getLocation(e,t){return this.computed||Bn(this),{source:t,offset:this.startOffset+e,line:this.lines[e],column:this.columns[e]}}getLocationRange(e,t,n){return this.computed||Bn(this),{source:n,start:{offset:this.startOffset+e,line:this.lines[e],column:this.columns[e]},end:{offset:this.startOffset+t,line:this.lines[t],column:this.columns[t]}}}}const Un=16777215,Wn=24,Vn=new Uint8Array(32);function Hn(e){return 0!==Vn[e]}Vn[2]=ln,Vn[an]=ln,Vn[sn]=20,Vn[cn]=hn;class qn{constructor(e,t){this.setSource(e,t)}reset(){this.eof=!1,this.tokenIndex=-1,this.tokenType=0,this.tokenStart=this.firstCharOffset,this.tokenEnd=this.firstCharOffset}setSource(e="",t=()=>{}){const n=(e=String(e||"")).length,r=Rn(this.offsetAndType,e.length+1),i=Rn(this.balance,e.length+1);let o=0,s=-1,a=0,l=e.length;this.offsetAndType=null,this.balance=null,i.fill(0),t(e,(e,t,n)=>{const c=o++;if(r[c]=e<<Wn|n,-1===s&&(s=t),i[c]=l,e===a){const e=i[l];i[l]=c,l=e,a=Vn[r[e]>>Wn]}else Hn(e)&&(l=c,a=Vn[e])}),r[o]=0|n,i[o]=o;for(let e=0;e<o;e++){const t=i[e];if(t<=e){const n=i[t];n!==e&&(i[e]=n)}else t>o&&(i[e]=o)}this.source=e,this.firstCharOffset=-1===s?0:s,this.tokenCount=o,this.offsetAndType=r,this.balance=i,this.reset(),this.next()}lookupType(e){return(e+=this.tokenIndex)<this.tokenCount?this.offsetAndType[e]>>Wn:0}lookupTypeNonSC(e){for(let t=this.tokenIndex;t<this.tokenCount;t++){const n=this.offsetAndType[t]>>Wn;if(n!==en&&n!==un&&0===e--)return n}return 0}lookupOffset(e){return(e+=this.tokenIndex)<this.tokenCount?this.offsetAndType[e-1]&Un:this.source.length}lookupOffsetNonSC(e){for(let t=this.tokenIndex;t<this.tokenCount;t++){const n=this.offsetAndType[t]>>Wn;if(n!==en&&n!==un&&0===e--)return t-this.tokenIndex}return 0}lookupValue(e,t){return(e+=this.tokenIndex)<this.tokenCount&&On(this.source,this.offsetAndType[e-1]&Un,this.offsetAndType[e]&Un,t)}getTokenStart(e){return e===this.tokenIndex?this.tokenStart:e>0?e<this.tokenCount?this.offsetAndType[e-1]&Un:this.offsetAndType[this.tokenCount]&Un:this.firstCharOffset}substrToCursor(e){return this.source.substring(e,this.tokenStart)}isBalanceEdge(e){return this.balance[this.tokenIndex]<e}isDelim(e,t){return t?9===this.lookupType(t)&&this.source.charCodeAt(this.lookupOffset(t))===e:9===this.tokenType&&this.source.charCodeAt(this.tokenStart)===e}skip(e){let t=this.tokenIndex+e;t<this.tokenCount?(this.tokenIndex=t,this.tokenStart=this.offsetAndType[t-1]&Un,t=this.offsetAndType[t],this.tokenType=t>>Wn,this.tokenEnd=t&Un):(this.tokenIndex=this.tokenCount,this.next())}next(){let e=this.tokenIndex+1;e<this.tokenCount?(this.tokenIndex=e,this.tokenStart=this.tokenEnd,e=this.offsetAndType[e],this.tokenType=e>>Wn,this.tokenEnd=e&Un):(this.eof=!0,this.tokenIndex=this.tokenCount,this.tokenType=0,this.tokenStart=this.tokenEnd=this.source.length)}skipSC(){for(;this.tokenType===en||this.tokenType===un;)this.next()}skipUntilBalanced(e,t){let n=e,r=0,i=0;e:for(;n<this.tokenCount&&(r=this.balance[n],!(r<e));n++)switch(i=n>0?this.offsetAndType[n-1]&Un:this.firstCharOffset,t(this.source.charCodeAt(i))){case 1:break e;case 2:n++;break e;default:Hn(this.offsetAndType[n]>>Wn)&&(n=r)}this.skip(n-this.tokenIndex)}forEachToken(e){for(let t=0,n=this.firstCharOffset;t<this.tokenCount;t++){const r=n,i=this.offsetAndType[t],o=i&Un;n=o,e(i>>Wn,r,o,t)}}dump(){const e=new Array(this.tokenCount);return this.forEachToken((t,n,r,i)=>{e[i]={idx:i,type:Nn[t],chunk:this.source.substring(n,r),balance:this.balance[i]}}),e}}function Qn(e,t){function n(t){return t<s?e.charCodeAt(t):0}function r(){return c=zn(e,c),Sn(n(c),n(c+1),n(c+2))?(a=Zt,void(c=Mn(e,c))):37===n(c)?(a=Xt,void c++):void(a=Jt)}function i(){const t=c;return c=Mn(e,c),On(e,t,c,"url")&&40===n(c)?(c=Pn(e,c+1),34===n(c)||39===n(c)?(a=2,void(c=t+4)):void function(){for(a=7,c=Pn(e,c);c<e.length;c++){const t=e.charCodeAt(c);switch(_n(t)){case 41:return void c++;case An:return c=Pn(e,c),41===n(c)||c>=e.length?void(c<e.length&&c++):(c=jn(e,c),void(a=8));case 34:case 39:case 40:case 133:return c=jn(e,c),void(a=8);case 92:if(vn(t,n(c+1))){c=Fn(e,c)-1;break}return c=jn(e,c),void(a=8)}}}()):40===n(c)?(a=2,void c++):void(a=1)}function o(t){for(t||(t=n(c++)),a=5;c<e.length;c++){const r=e.charCodeAt(c);switch(_n(r)){case t:return void c++;case An:if(kn(r))return c+=Ln(e,c,r),void(a=6);break;case 92:if(c===e.length-1)break;const i=n(c+1);kn(i)?c+=Ln(e,c+1,i):vn(r,i)&&(c=Fn(e,c)-1)}}}const s=(e=String(e||"")).length;let a,l=xn(n(0)),c=l;for(;c<s;){const s=e.charCodeAt(c);switch(_n(s)){case An:a=en,c=Pn(e,c+1);break;case 34:o();break;case 35:gn(n(c+1))||vn(n(c+1),n(c+2))?(a=4,c=Mn(e,c+1)):(a=9,c++);break;case 39:o();break;case 40:a=an,c++;break;case 41:a=ln,c++;break;case 43:wn(s,n(c+1),n(c+2))?r():(a=9,c++);break;case 44:a=on,c++;break;case 45:wn(s,n(c+1),n(c+2))?r():45===n(c+1)&&62===n(c+2)?(a=tn,c+=3):Sn(s,n(c+1),n(c+2))?i():(a=9,c++);break;case 46:wn(s,n(c+1),n(c+2))?r():(a=9,c++);break;case 47:42===n(c+1)?(a=un,c=e.indexOf("*/",c+2),c=-1===c?e.length:c+2):(a=9,c++);break;case 58:a=nn,c++;break;case 59:a=rn,c++;break;case 60:33===n(c+1)&&45===n(c+2)&&45===n(c+3)?(a=14,c+=4):(a=9,c++);break;case 64:Sn(n(c+1),n(c+2),n(c+3))?(a=3,c=Mn(e,c+1)):(a=9,c++);break;case 91:a=sn,c++;break;case 92:vn(s,n(c+1))?i():(a=9,c++);break;case 93:a=20,c++;break;case 123:a=cn,c++;break;case 125:a=hn,c++;break;case 131:r();break;case 132:i();break;default:a=9,c++}t(a,l,l=c)}}function Gn(e){const t=e.length,n=e.charCodeAt(0),r=34===n||39===n?1:0,i=1===r&&t>1&&e.charCodeAt(t-1)===n?t-2:t-1;let o="";for(let n=r;n<=i;n++){let r=e.charCodeAt(n);if(92===r){if(n===i){n!==t-1&&(o=e.substr(n+1));break}if(r=e.charCodeAt(++n),vn(92,r)){const t=n-1,r=Fn(e,t);n=r-1,o+=In(e.substring(t+1,r))}else 13===r&&10===e.charCodeAt(n+1)&&n++}else o+=e[n]}return o}const{hasOwnProperty:Kn}=Object.prototype,Yn=function(){};function Jn(e){return"function"==typeof e?e:Yn}function Xn(e,t){return function(n,r,i){n.type===t&&e.call(this,n,r,i)}}function Zn(e,t){const n=t.structure,r=[];for(const e in n){if(!1===Kn.call(n,e))continue;let t=n[e];const i={name:e,type:!1,nullable:!1};Array.isArray(t)||(t=[t]);for(const e of t)null===e?i.nullable=!0:"string"==typeof e?i.type="node":Array.isArray(e)&&(i.type="list");i.type&&r.push(i)}return r.length?{context:t.walkContext,fields:r}:null}function er(e,t){const n=e.fields.slice(),r=e.context,i="string"==typeof r;return t&&n.reverse(),function(e,o,s,a){let l;i&&(l=o[r],o[r]=e);for(const r of n){const n=e[r.name];if(!r.nullable||n)if("list"===r.type){if(t?n.reduceRight(a,!1):n.reduce(a,!1))return!0}else if(s(n))return!0}i&&(o[r]=l)}}function tr({StyleSheet:e,Atrule:t,Rule:n,Block:r,DeclarationList:i}){return{Atrule:{StyleSheet:e,Atrule:t,Rule:n,Block:r},Rule:{StyleSheet:e,Atrule:t,Rule:n,Block:r},Declaration:{StyleSheet:e,Atrule:t,Rule:n,Block:r,DeclarationList:i}}}const nr=43,rr=45,ir=110,or=!0;function sr(e,t){let n=this.tokenStart+e;const r=this.charCodeAt(n);for((r===nr||r===rr)&&(t&&this.error("Number sign is not allowed"),n++);n<this.tokenEnd;n++)pn(this.charCodeAt(n))||this.error("Integer is expected",n)}function ar(e){return sr.call(this,0,e)}function lr(e,t){if(!this.cmpChar(this.tokenStart+e,t)){let n="";switch(t){case ir:n="N is expected";break;case rr:n="HyphenMinus is expected"}this.error(n,this.tokenStart+e)}}function cr(){let e=0,t=0,n=this.tokenType;for(;n===en||n===un;)n=this.lookupType(++e);if(n!==Jt){if(!this.isDelim(nr,e)&&!this.isDelim(rr,e))return null;t=this.isDelim(nr,e)?nr:rr;do{n=this.lookupType(++e)}while(n===en||n===un);n!==Jt&&(this.skip(e),ar.call(this,or))}return e>0&&this.skip(e),0===t&&(n=this.charCodeAt(this.tokenStart),n!==nr&&n!==rr&&this.error("Number sign is expected")),ar.call(this,0!==t),t===rr?"-"+this.consume(Jt):this.consume(Jt)}const hr={a:[String,null],b:[String,null]};function ur(){const e=this.tokenStart;let t=null,n=null;if(this.tokenType===Jt)ar.call(this,false),n=this.consume(Jt);else if(1===this.tokenType&&this.cmpChar(this.tokenStart,rr))switch(t="-1",lr.call(this,1,ir),this.tokenEnd-this.tokenStart){case 2:this.next(),n=cr.call(this);break;case 3:lr.call(this,2,rr),this.next(),this.skipSC(),ar.call(this,or),n="-"+this.consume(Jt);break;default:lr.call(this,2,rr),sr.call(this,3,or),this.next(),n=this.substrToCursor(e+2)}else if(1===this.tokenType||this.isDelim(nr)&&1===this.lookupType(1)){let r=0;switch(t="1",this.isDelim(nr)&&(r=1,this.next()),lr.call(this,0,ir),this.tokenEnd-this.tokenStart){case 1:this.next(),n=cr.call(this);break;case 2:lr.call(this,1,rr),this.next(),this.skipSC(),ar.call(this,or),n="-"+this.consume(Jt);break;default:lr.call(this,1,rr),sr.call(this,2,or),this.next(),n=this.substrToCursor(e+r+1)}}else if(this.tokenType===Zt){const r=this.charCodeAt(this.tokenStart),i=r===nr||r===rr;let o=this.tokenStart+i;for(;o<this.tokenEnd&&pn(this.charCodeAt(o));o++);o===this.tokenStart+i&&this.error("Integer is expected",this.tokenStart+i),lr.call(this,o-this.tokenStart,ir),t=this.substring(e,o),o+1===this.tokenEnd?(this.next(),n=cr.call(this)):(lr.call(this,o-this.tokenStart+1,rr),o+2===this.tokenEnd?(this.next(),this.skipSC(),ar.call(this,or),n="-"+this.consume(Jt)):(sr.call(this,o-this.tokenStart+2,or),this.next(),n=this.substrToCursor(o+1)))}else this.error();return null!==t&&t.charCodeAt(0)===nr&&(t=t.substr(1)),null!==n&&n.charCodeAt(0)===nr&&(n=n.substr(1)),{type:"AnPlusB",loc:this.getLocation(e,this.tokenStart),a:t,b:n}}function pr(e){if(e.a){const t=("+1"===e.a||"1"===e.a?"n":"-1"===e.a&&"-n")||e.a+"n";if(e.b){const n="-"===e.b[0]||"+"===e.b[0]?e.b:"+"+e.b;this.tokenize(t+n)}else this.tokenize(t)}else this.tokenize(e.b)}const dr=Object.freeze(Object.defineProperty({__proto__:null,generate:pr,name:"AnPlusB",parse:ur,structure:hr},Symbol.toStringTag,{value:"Module"}));function mr(){return this.Raw(this.consumeUntilLeftCurlyBracketOrSemicolon,!0)}function fr(){for(let e,t=1;e=this.lookupType(t);t++){if(e===hn)return!0;if(e===cn||3===e)return!1}return!1}const gr={name:String,prelude:["AtrulePrelude","Raw",null],block:["Block",null]};function br(e=!1){const t=this.tokenStart;let n,r,i=null,o=null;switch(this.eat(3),n=this.substrToCursor(t+1),r=n.toLowerCase(),this.skipSC(),!1===this.eof&&this.tokenType!==cn&&this.tokenType!==rn&&(i=this.parseAtrulePrelude?this.parseWithFallback(this.AtrulePrelude.bind(this,n,e),mr):mr.call(this,this.tokenIndex),this.skipSC()),this.tokenType){case rn:this.next();break;case cn:o=hasOwnProperty.call(this.atrule,r)&&"function"==typeof this.atrule[r].block?this.atrule[r].block.call(this,e):this.Block(fr.call(this))}return{type:"Atrule",loc:this.getLocation(t,this.tokenStart),name:n,prelude:i,block:o}}function kr(e){this.token(3,"@"+e.name),null!==e.prelude&&this.node(e.prelude),e.block?this.node(e.block):this.token(rn,";")}const yr=Object.freeze(Object.defineProperty({__proto__:null,generate:kr,name:"Atrule",parse:br,structure:gr,walkContext:"atrule"},Symbol.toStringTag,{value:"Module"}));function vr(e){let t=null;return null!==e&&(e=e.toLowerCase()),this.skipSC(),t=hasOwnProperty.call(this.atrule,e)&&"function"==typeof this.atrule[e].prelude?this.atrule[e].prelude.call(this):this.readSequence(this.scope.AtrulePrelude),this.skipSC(),!0!==this.eof&&this.tokenType!==cn&&this.tokenType!==rn&&this.error("Semicolon or block is expected"),{type:"AtrulePrelude",loc:this.getLocationFromList(t),children:t}}function Sr(e){this.children(e)}const wr=Object.freeze(Object.defineProperty({__proto__:null,generate:Sr,name:"AtrulePrelude",parse:vr,structure:{children:[[]]},walkContext:"atrulePrelude"},Symbol.toStringTag,{value:"Module"}));function xr(){this.eof&&this.error("Unexpected end of input");const e=this.tokenStart;let t=!1;return this.isDelim(42)?(t=!0,this.next()):this.isDelim(124)||this.eat(1),this.isDelim(124)?61!==this.charCodeAt(this.tokenStart+1)?(this.next(),this.eat(1)):t&&this.error("Identifier is expected",this.tokenEnd):t&&this.error("Vertical line is expected"),{type:"Identifier",loc:this.getLocation(e,this.tokenStart),name:this.substrToCursor(e)}}function Cr(){const e=this.tokenStart,t=this.charCodeAt(e);return 61!==t&&126!==t&&94!==t&&36!==t&&42!==t&&124!==t&&this.error("Attribute selector (=, ~=, ^=, $=, *=, |=) is expected"),this.next(),61!==t&&(this.isDelim(61)||this.error("Equal sign is expected"),this.next()),this.substrToCursor(e)}const Ar={name:"Identifier",matcher:[String,null],value:["String","Identifier",null],flags:[String,null]};function _r(){const e=this.tokenStart;let t,n=null,r=null,i=null;return this.eat(sn),this.skipSC(),t=xr.call(this),this.skipSC(),20!==this.tokenType&&(1!==this.tokenType&&(n=Cr.call(this),this.skipSC(),r=5===this.tokenType?this.String():this.Identifier(),this.skipSC()),1===this.tokenType&&(i=this.consume(1),this.skipSC())),this.eat(20),{type:"AttributeSelector",loc:this.getLocation(e,this.tokenStart),name:t,matcher:n,value:r,flags:i}}function Tr(e){this.token(9,"["),this.node(e.name),null!==e.matcher&&(this.tokenize(e.matcher),this.node(e.value)),null!==e.flags&&this.token(1,e.flags),this.token(9,"]")}const Lr=Object.freeze(Object.defineProperty({__proto__:null,generate:Tr,name:"AttributeSelector",parse:_r,structure:Ar},Symbol.toStringTag,{value:"Module"}));function Er(){return this.Raw(null,!0)}function Or(){return this.parseWithFallback(this.Rule,Er)}function Pr(){return this.Raw(this.consumeUntilSemicolonIncluded,!0)}function Dr(){if(this.tokenType===rn)return Pr.call(this,this.tokenIndex);const e=this.parseWithFallback(this.Declaration,Pr);return this.tokenType===rn&&this.next(),e}function Fr(e){const t=e?Dr:Or,n=this.tokenStart;let r=this.createList();this.eat(cn);e:for(;!this.eof;)switch(this.tokenType){case hn:break e;case en:case un:this.next();break;case 3:r.push(this.parseWithFallback(this.Atrule.bind(this,e),Er));break;default:e&&this.isDelim(38)?r.push(Or.call(this)):r.push(t.call(this))}return this.eof||this.eat(hn),{type:"Block",loc:this.getLocation(n,this.tokenStart),children:r}}function Mr(e){this.token(cn,"{"),this.children(e,e=>{"Declaration"===e.type&&this.token(rn,";")}),this.token(hn,"}")}const zr=Object.freeze(Object.defineProperty({__proto__:null,generate:Mr,name:"Block",parse:Fr,structure:{children:[["Atrule","Rule","Declaration"]]},walkContext:"block"},Symbol.toStringTag,{value:"Module"}));function jr(e,t){const n=this.tokenStart;let r=null;return this.eat(sn),r=e.call(this,t),this.eof||this.eat(20),{type:"Brackets",loc:this.getLocation(n,this.tokenStart),children:r}}function Ir(e){this.token(9,"["),this.children(e),this.token(9,"]")}const Nr=Object.freeze(Object.defineProperty({__proto__:null,generate:Ir,name:"Brackets",parse:jr,structure:{children:[[]]}},Symbol.toStringTag,{value:"Module"}));function Rr(){const e=this.tokenStart;return this.eat(tn),{type:"CDC",loc:this.getLocation(e,this.tokenStart)}}function Br(){this.token(tn,"--\x3e")}const $r=Object.freeze(Object.defineProperty({__proto__:null,generate:Br,name:"CDC",parse:Rr,structure:[]},Symbol.toStringTag,{value:"Module"}));function Ur(){const e=this.tokenStart;return this.eat(14),{type:"CDO",loc:this.getLocation(e,this.tokenStart)}}function Wr(){this.token(14,"\x3c!--")}const Vr=Object.freeze(Object.defineProperty({__proto__:null,generate:Wr,name:"CDO",parse:Ur,structure:[]},Symbol.toStringTag,{value:"Module"})),Hr={name:String};function qr(){return this.eatDelim(46),{type:"ClassSelector",loc:this.getLocation(this.tokenStart-1,this.tokenEnd),name:this.consume(1)}}function Qr(e){this.token(9,"."),this.token(1,e.name)}const Gr=Object.freeze(Object.defineProperty({__proto__:null,generate:Qr,name:"ClassSelector",parse:qr,structure:Hr},Symbol.toStringTag,{value:"Module"})),Kr={name:String};function Yr(){const e=this.tokenStart;let t;switch(this.tokenType){case en:t=" ";break;case 9:switch(this.charCodeAt(this.tokenStart)){case 62:case 43:case 126:this.next();break;case 47:this.next(),this.eatIdent("deep"),this.eatDelim(47);break;default:this.error("Combinator is expected")}t=this.substrToCursor(e)}return{type:"Combinator",loc:this.getLocation(e,this.tokenStart),name:t}}function Jr(e){this.tokenize(e.name)}const Xr=Object.freeze(Object.defineProperty({__proto__:null,generate:Jr,name:"Combinator",parse:Yr,structure:Kr},Symbol.toStringTag,{value:"Module"})),Zr={value:String};function ei(){const e=this.tokenStart;let t=this.tokenEnd;return this.eat(un),t-e+2>=2&&42===this.charCodeAt(t-2)&&47===this.charCodeAt(t-1)&&(t-=2),{type:"Comment",loc:this.getLocation(e,this.tokenStart),value:this.substring(e+2,t)}}function ti(e){this.token(un,"/*"+e.value+"*/")}const ni=Object.freeze(Object.defineProperty({__proto__:null,generate:ti,name:"Comment",parse:ei,structure:Zr},Symbol.toStringTag,{value:"Module"})),ri=new Set([nn,ln,0]),ii={kind:String,children:[["Identifier","Feature","FeatureFunction","FeatureRange","SupportsDeclaration"]]};function oi(e){return 1===this.lookupTypeNonSC(1)&&ri.has(this.lookupTypeNonSC(2))?this.Feature(e):this.FeatureRange(e)}const si={media:oi,container:oi,supports(){return this.SupportsDeclaration()}};function ai(e="media"){const t=this.createList();e:for(;!this.eof;)switch(this.tokenType){case un:case en:this.next();continue;case 1:t.push(this.Identifier());break;case an:{let n=this.parseWithFallback(()=>si[e].call(this,e),()=>null);n||(n=this.parseWithFallback(()=>{this.eat(an);const t=this.Condition(e);return this.eat(ln),t},()=>this.GeneralEnclosed(e))),t.push(n);break}case 2:{let n=this.parseWithFallback(()=>this.FeatureFunction(e),()=>null);n||(n=this.GeneralEnclosed(e)),t.push(n);break}default:break e}return t.isEmpty&&this.error("Condition is expected"),{type:"Condition",loc:this.getLocationFromList(t),kind:e,children:t}}function li(e){e.children.forEach(e=>{"Condition"===e.type?(this.token(an,"("),this.node(e),this.token(ln,")")):this.node(e)})}const ci=Object.freeze(Object.defineProperty({__proto__:null,generate:li,name:"Condition",parse:ai,structure:ii},Symbol.toStringTag,{value:"Module"}));function hi(){return this.Raw(this.consumeUntilExclamationMarkOrSemicolon,!0)}function ui(){return this.Raw(this.consumeUntilExclamationMarkOrSemicolon,!1)}function pi(){const e=this.tokenIndex,t=this.Value();return"Raw"!==t.type&&!1===this.eof&&this.tokenType!==rn&&!1===this.isDelim(33)&&!1===this.isBalanceEdge(e)&&this.error(),t}const di={important:[Boolean,String],property:String,value:["Value","Raw"]};function mi(){const e=this.tokenStart,t=this.tokenIndex,n=gi.call(this),r=function(e,t){return t=t||0,e.length-t>=2&&45===e.charCodeAt(t)&&45===e.charCodeAt(t+1)}(n),i=r?this.parseCustomProperty:this.parseValue,o=r?ui:hi;let s,a=!1;this.skipSC(),this.eat(nn);const l=this.tokenIndex;if(r||this.skipSC(),s=i?this.parseWithFallback(pi,o):o.call(this,this.tokenIndex),r&&"Value"===s.type&&s.children.isEmpty)for(let e=l-this.tokenIndex;e<=0;e++)if(this.lookupType(e)===en){s.children.appendData({type:"WhiteSpace",loc:null,value:" "});break}return this.isDelim(33)&&(a=bi.call(this),this.skipSC()),!1===this.eof&&this.tokenType!==rn&&!1===this.isBalanceEdge(t)&&this.error(),{type:"Declaration",loc:this.getLocation(e,this.tokenStart),important:a,property:n,value:s}}function fi(e){this.token(1,e.property),this.token(nn,":"),this.node(e.value),e.important&&(this.token(9,"!"),this.token(1,!0===e.important?"important":e.important))}function gi(){const e=this.tokenStart;if(9===this.tokenType)switch(this.charCodeAt(this.tokenStart)){case 42:case 36:case 43:case 35:case 38:this.next();break;case 47:this.next(),this.isDelim(47)&&this.next()}return 4===this.tokenType?this.eat(4):this.eat(1),this.substrToCursor(e)}function bi(){this.eat(9),this.skipSC();const e=this.consume(1);return"important"===e||e}const ki=Object.freeze(Object.defineProperty({__proto__:null,generate:fi,name:"Declaration",parse:mi,structure:di,walkContext:"declaration"},Symbol.toStringTag,{value:"Module"}));function yi(){return this.Raw(this.consumeUntilSemicolonIncluded,!0)}function vi(){const e=this.createList();for(;!this.eof;)switch(this.tokenType){case en:case un:case rn:this.next();break;case 3:e.push(this.parseWithFallback(this.Atrule.bind(this,!0),yi));break;default:this.isDelim(38)?e.push(this.parseWithFallback(this.Rule,yi)):e.push(this.parseWithFallback(this.Declaration,yi))}return{type:"DeclarationList",loc:this.getLocationFromList(e),children:e}}function Si(e){this.children(e,e=>{"Declaration"===e.type&&this.token(rn,";")})}const wi=Object.freeze(Object.defineProperty({__proto__:null,generate:Si,name:"DeclarationList",parse:vi,structure:{children:[["Declaration","Atrule","Rule"]]}},Symbol.toStringTag,{value:"Module"})),xi={value:String,unit:String};function Ci(){const e=this.tokenStart,t=this.consumeNumber(Zt);return{type:"Dimension",loc:this.getLocation(e,this.tokenStart),value:t,unit:this.substring(e+t.length,this.tokenStart)}}function Ai(e){this.token(Zt,e.value+e.unit)}const _i=Object.freeze(Object.defineProperty({__proto__:null,generate:Ai,name:"Dimension",parse:Ci,structure:xi},Symbol.toStringTag,{value:"Module"})),Ti={kind:String,name:String,value:["Identifier","Number","Dimension","Ratio","Function",null]};function Li(e){const t=this.tokenStart;let n,r=null;if(this.eat(an),this.skipSC(),n=this.consume(1),this.skipSC(),this.tokenType!==ln){switch(this.eat(nn),this.skipSC(),this.tokenType){case Jt:r=9===this.lookupNonWSType(1)?this.Ratio():this.Number();break;case Zt:r=this.Dimension();break;case 1:r=this.Identifier();break;case 2:r=this.parseWithFallback(()=>{const e=this.Function(this.readSequence,this.scope.Value);return this.skipSC(),this.isDelim(47)&&this.error(),e},()=>this.Ratio());break;default:this.error("Number, dimension, ratio or identifier is expected")}this.skipSC()}return this.eof||this.eat(ln),{type:"Feature",loc:this.getLocation(t,this.tokenStart),kind:e,name:n,value:r}}function Ei(e){this.token(an,"("),this.token(1,e.name),null!==e.value&&(this.token(nn,":"),this.node(e.value)),this.token(ln,")")}const Oi=Object.freeze(Object.defineProperty({__proto__:null,generate:Ei,name:"Feature",parse:Li,structure:Ti},Symbol.toStringTag,{value:"Module"})),Pi={kind:String,feature:String,value:["Declaration","Selector"]};function Di(e,t){const n=(this.features[e]||{})[t];return"function"!=typeof n&&this.error(`Unknown feature ${t}()`),n}function Fi(e="unknown"){const t=this.tokenStart,n=this.consumeFunctionName(),r=Di.call(this,e,n.toLowerCase());this.skipSC();const i=this.parseWithFallback(()=>{const e=this.tokenIndex,t=r.call(this);return!1===this.eof&&!1===this.isBalanceEdge(e)&&this.error(),t},()=>this.Raw(null,!1));return this.eof||this.eat(ln),{type:"FeatureFunction",loc:this.getLocation(t,this.tokenStart),kind:e,feature:n,value:i}}function Mi(e){this.token(2,e.feature+"("),this.node(e.value),this.token(ln,")")}const zi=Object.freeze(Object.defineProperty({__proto__:null,generate:Mi,name:"FeatureFunction",parse:Fi,structure:Pi},Symbol.toStringTag,{value:"Module"})),ji={kind:String,left:["Identifier","Number","Dimension","Ratio","Function"],leftComparison:String,middle:["Identifier","Number","Dimension","Ratio","Function"],rightComparison:[String,null],right:["Identifier","Number","Dimension","Ratio","Function",null]};function Ii(){switch(this.skipSC(),this.tokenType){case Jt:return this.isDelim(47,this.lookupOffsetNonSC(1))?this.Ratio():this.Number();case Zt:return this.Dimension();case 1:return this.Identifier();case 2:return this.parseWithFallback(()=>{const e=this.Function(this.readSequence,this.scope.Value);return this.skipSC(),this.isDelim(47)&&this.error(),e},()=>this.Ratio());default:this.error("Number, dimension, ratio or identifier is expected")}}function Ni(e){if(this.skipSC(),this.isDelim(60)||this.isDelim(62)){const e=this.source[this.tokenStart];return this.next(),this.isDelim(61)?(this.next(),e+"="):e}if(this.isDelim(61))return"=";this.error(`Expected ${e?'":", ':""}"<", ">", "=" or ")"`)}function Ri(e="unknown"){const t=this.tokenStart;this.skipSC(),this.eat(an);const n=Ii.call(this),r=Ni.call(this,"Identifier"===n.type),i=Ii.call(this);let o=null,s=null;return this.lookupNonWSType(0)!==ln&&(o=Ni.call(this),s=Ii.call(this)),this.skipSC(),this.eat(ln),{type:"FeatureRange",loc:this.getLocation(t,this.tokenStart),kind:e,left:n,leftComparison:r,middle:i,rightComparison:o,right:s}}function Bi(e){this.token(an,"("),this.node(e.left),this.tokenize(e.leftComparison),this.node(e.middle),e.right&&(this.tokenize(e.rightComparison),this.node(e.right)),this.token(ln,")")}const $i=Object.freeze(Object.defineProperty({__proto__:null,generate:Bi,name:"FeatureRange",parse:Ri,structure:ji},Symbol.toStringTag,{value:"Module"})),Ui={name:String,children:[[]]};function Wi(e,t){const n=this.tokenStart,r=this.consumeFunctionName(),i=r.toLowerCase();let o;return o=t.hasOwnProperty(i)?t[i].call(this,t):e.call(this,t),this.eof||this.eat(ln),{type:"Function",loc:this.getLocation(n,this.tokenStart),name:r,children:o}}function Vi(e){this.token(2,e.name+"("),this.children(e),this.token(ln,")")}const Hi=Object.freeze(Object.defineProperty({__proto__:null,generate:Vi,name:"Function",parse:Wi,structure:Ui,walkContext:"function"},Symbol.toStringTag,{value:"Module"})),qi={kind:String,function:[String,null],children:[[]]};function Qi(e){const t=this.tokenStart;let n=null;2===this.tokenType?n=this.consumeFunctionName():this.eat(an);const r=this.parseWithFallback(()=>{const e=this.tokenIndex,t=this.readSequence(this.scope.Value);return!1===this.eof&&!1===this.isBalanceEdge(e)&&this.error(),t},()=>this.createSingleNodeList(this.Raw(null,!1)));return this.eof||this.eat(ln),{type:"GeneralEnclosed",loc:this.getLocation(t,this.tokenStart),kind:e,function:n,children:r}}function Gi(e){e.function?this.token(2,e.function+"("):this.token(an,"("),this.children(e),this.token(ln,")")}const Ki=Object.freeze(Object.defineProperty({__proto__:null,generate:Gi,name:"GeneralEnclosed",parse:Qi,structure:qi},Symbol.toStringTag,{value:"Module"})),Yi={value:String};function Ji(){const e=this.tokenStart;return this.eat(4),{type:"Hash",loc:this.getLocation(e,this.tokenStart),value:this.substrToCursor(e+1)}}function Xi(e){this.token(4,"#"+e.value)}const Zi=Object.freeze(Object.defineProperty({__proto__:null,generate:Xi,name:"Hash",parse:Ji,structure:Yi,xxx:"XXX"},Symbol.toStringTag,{value:"Module"})),eo={name:String};function to(){return{type:"Identifier",loc:this.getLocation(this.tokenStart,this.tokenEnd),name:this.consume(1)}}function no(e){this.token(1,e.name)}const ro=Object.freeze(Object.defineProperty({__proto__:null,generate:no,name:"Identifier",parse:to,structure:eo},Symbol.toStringTag,{value:"Module"})),io={name:String};function oo(){const e=this.tokenStart;return this.eat(4),{type:"IdSelector",loc:this.getLocation(e,this.tokenStart),name:this.substrToCursor(e+1)}}function so(e){this.token(9,"#"+e.name)}const ao=Object.freeze(Object.defineProperty({__proto__:null,generate:so,name:"IdSelector",parse:oo,structure:io},Symbol.toStringTag,{value:"Module"})),lo={name:String};function co(){let e=this.tokenStart,t=this.consume(1);for(;this.isDelim(46);)this.eat(9),t+="."+this.consume(1);return{type:"Layer",loc:this.getLocation(e,this.tokenStart),name:t}}function ho(e){this.tokenize(e.name)}const uo=Object.freeze(Object.defineProperty({__proto__:null,generate:ho,name:"Layer",parse:co,structure:lo},Symbol.toStringTag,{value:"Module"}));function po(){const e=this.createList();for(this.skipSC();!this.eof&&(e.push(this.Layer()),this.lookupTypeNonSC(0)===on);)this.skipSC(),this.next(),this.skipSC();return{type:"LayerList",loc:this.getLocationFromList(e),children:e}}function mo(e){this.children(e,()=>this.token(on,","))}const fo=Object.freeze(Object.defineProperty({__proto__:null,generate:mo,name:"LayerList",parse:po,structure:{children:[["Layer"]]}},Symbol.toStringTag,{value:"Module"})),go={modifier:[String,null],mediaType:[String,null],condition:["Condition",null]};function bo(){const e=this.tokenStart;let t=null,n=null,r=null;if(this.skipSC(),1===this.tokenType&&this.lookupTypeNonSC(1)!==an){const e=this.consume(1),i=e.toLowerCase();switch("not"===i||"only"===i?(this.skipSC(),t=i,n=this.consume(1)):n=e,this.lookupTypeNonSC(0)){case 1:this.skipSC(),this.eatIdent("and"),r=this.Condition("media");break;case cn:case rn:case on:case 0:break;default:this.error("Identifier or parenthesis is expected")}}else switch(this.tokenType){case 1:case an:case 2:r=this.Condition("media");break;case cn:case rn:case 0:break;default:this.error("Identifier or parenthesis is expected")}return{type:"MediaQuery",loc:this.getLocation(e,this.tokenStart),modifier:t,mediaType:n,condition:r}}function ko(e){e.mediaType?(e.modifier&&this.token(1,e.modifier),this.token(1,e.mediaType),e.condition&&(this.token(1,"and"),this.node(e.condition))):e.condition&&this.node(e.condition)}const yo=Object.freeze(Object.defineProperty({__proto__:null,generate:ko,name:"MediaQuery",parse:bo,structure:go},Symbol.toStringTag,{value:"Module"}));function vo(){const e=this.createList();for(this.skipSC();!this.eof&&(e.push(this.MediaQuery()),this.tokenType===on);)this.next();return{type:"MediaQueryList",loc:this.getLocationFromList(e),children:e}}function So(e){this.children(e,()=>this.token(on,","))}const wo=Object.freeze(Object.defineProperty({__proto__:null,generate:So,name:"MediaQueryList",parse:vo,structure:{children:[["MediaQuery"]]}},Symbol.toStringTag,{value:"Module"}));function xo(){const e=this.tokenStart;return this.eatDelim(38),{type:"NestingSelector",loc:this.getLocation(e,this.tokenStart)}}function Co(){this.token(9,"&")}const Ao=Object.freeze(Object.defineProperty({__proto__:null,generate:Co,name:"NestingSelector",parse:xo,structure:{}},Symbol.toStringTag,{value:"Module"}));function _o(){this.skipSC();const e=this.tokenStart;let t,n=e,r=null;return t=this.lookupValue(0,"odd")||this.lookupValue(0,"even")?this.Identifier():this.AnPlusB(),n=this.tokenStart,this.skipSC(),this.lookupValue(0,"of")&&(this.next(),r=this.SelectorList(),n=this.tokenStart),{type:"Nth",loc:this.getLocation(e,n),nth:t,selector:r}}function To(e){this.node(e.nth),null!==e.selector&&(this.token(1,"of"),this.node(e.selector))}const Lo=Object.freeze(Object.defineProperty({__proto__:null,generate:To,name:"Nth",parse:_o,structure:{nth:["AnPlusB","Identifier"],selector:["SelectorList",null]}},Symbol.toStringTag,{value:"Module"})),Eo={value:String};function Oo(){return{type:"Number",loc:this.getLocation(this.tokenStart,this.tokenEnd),value:this.consume(Jt)}}function Po(e){this.token(Jt,e.value)}const Do=Object.freeze(Object.defineProperty({__proto__:null,generate:Po,name:"Number",parse:Oo,structure:Eo},Symbol.toStringTag,{value:"Module"})),Fo={value:String};function Mo(){const e=this.tokenStart;return this.next(),{type:"Operator",loc:this.getLocation(e,this.tokenStart),value:this.substrToCursor(e)}}function zo(e){this.tokenize(e.value)}const jo=Object.freeze(Object.defineProperty({__proto__:null,generate:zo,name:"Operator",parse:Mo,structure:Fo},Symbol.toStringTag,{value:"Module"}));function Io(e,t){const n=this.tokenStart;let r=null;return this.eat(an),r=e.call(this,t),this.eof||this.eat(ln),{type:"Parentheses",loc:this.getLocation(n,this.tokenStart),children:r}}function No(e){this.token(an,"("),this.children(e),this.token(ln,")")}const Ro=Object.freeze(Object.defineProperty({__proto__:null,generate:No,name:"Parentheses",parse:Io,structure:{children:[[]]}},Symbol.toStringTag,{value:"Module"})),Bo={value:String};function $o(){return{type:"Percentage",loc:this.getLocation(this.tokenStart,this.tokenEnd),value:this.consumeNumber(Xt)}}function Uo(e){this.token(Xt,e.value+"%")}const Wo=Object.freeze(Object.defineProperty({__proto__:null,generate:Uo,name:"Percentage",parse:$o,structure:Bo},Symbol.toStringTag,{value:"Module"})),Vo={name:String,children:[["Raw"],null]};function Ho(){const e=this.tokenStart;let t,n,r=null;return this.eat(nn),2===this.tokenType?(t=this.consumeFunctionName(),n=t.toLowerCase(),this.lookupNonWSType(0)==ln?r=this.createList():hasOwnProperty.call(this.pseudo,n)?(this.skipSC(),r=this.pseudo[n].call(this),this.skipSC()):(r=this.createList(),r.push(this.Raw(null,!1))),this.eat(ln)):t=this.consume(1),{type:"PseudoClassSelector",loc:this.getLocation(e,this.tokenStart),name:t,children:r}}function qo(e){this.token(nn,":"),null===e.children?this.token(1,e.name):(this.token(2,e.name+"("),this.children(e),this.token(ln,")"))}const Qo=Object.freeze(Object.defineProperty({__proto__:null,generate:qo,name:"PseudoClassSelector",parse:Ho,structure:Vo,walkContext:"function"},Symbol.toStringTag,{value:"Module"})),Go={name:String,children:[["Raw"],null]};function Ko(){const e=this.tokenStart;let t,n,r=null;return this.eat(nn),this.eat(nn),2===this.tokenType?(t=this.consumeFunctionName(),n=t.toLowerCase(),this.lookupNonWSType(0)==ln?r=this.createList():hasOwnProperty.call(this.pseudo,n)?(this.skipSC(),r=this.pseudo[n].call(this),this.skipSC()):(r=this.createList(),r.push(this.Raw(null,!1))),this.eat(ln)):t=this.consume(1),{type:"PseudoElementSelector",loc:this.getLocation(e,this.tokenStart),name:t,children:r}}function Yo(e){this.token(nn,":"),this.token(nn,":"),null===e.children?this.token(1,e.name):(this.token(2,e.name+"("),this.children(e),this.token(ln,")"))}const Jo=Object.freeze(Object.defineProperty({__proto__:null,generate:Yo,name:"PseudoElementSelector",parse:Ko,structure:Go,walkContext:"function"},Symbol.toStringTag,{value:"Module"}));function Xo(){switch(this.skipSC(),this.tokenType){case Jt:return this.Number();case 2:return this.Function(this.readSequence,this.scope.Value);default:this.error("Number of function is expected")}}function Zo(){const e=this.tokenStart,t=Xo.call(this);let n=null;return this.skipSC(),this.isDelim(47)&&(this.eatDelim(47),n=Xo.call(this)),{type:"Ratio",loc:this.getLocation(e,this.tokenStart),left:t,right:n}}function es(e){this.node(e.left),this.token(9,"/"),e.right?this.node(e.right):this.node(Jt,1)}const ts=Object.freeze(Object.defineProperty({__proto__:null,generate:es,name:"Ratio",parse:Zo,structure:{left:["Number","Function"],right:["Number","Function",null]}},Symbol.toStringTag,{value:"Module"}));function ns(){return this.tokenIndex>0&&this.lookupType(-1)===en?this.tokenIndex>1?this.getTokenStart(this.tokenIndex-1):this.firstCharOffset:this.tokenStart}const rs={value:String};function is(e,t){const n=this.getTokenStart(this.tokenIndex);let r;return this.skipUntilBalanced(this.tokenIndex,e||this.consumeUntilBalanceEnd),r=t&&this.tokenStart>n?ns.call(this):this.tokenStart,{type:"Raw",loc:this.getLocation(n,r),value:this.substring(n,r)}}function os(e){this.tokenize(e.value)}const ss=Object.freeze(Object.defineProperty({__proto__:null,generate:os,name:"Raw",parse:is,structure:rs},Symbol.toStringTag,{value:"Module"}));function as(){return this.Raw(this.consumeUntilLeftCurlyBracket,!0)}function ls(){const e=this.SelectorList();return"Raw"!==e.type&&!1===this.eof&&this.tokenType!==cn&&this.error(),e}function cs(){const e=this.tokenIndex,t=this.tokenStart;let n,r;return n=this.parseRulePrelude?this.parseWithFallback(ls,as):as.call(this,e),r=this.Block(!0),{type:"Rule",loc:this.getLocation(t,this.tokenStart),prelude:n,block:r}}function hs(e){this.node(e.prelude),this.node(e.block)}const us=Object.freeze(Object.defineProperty({__proto__:null,generate:hs,name:"Rule",parse:cs,structure:{prelude:["SelectorList","Raw"],block:["Block"]},walkContext:"rule"},Symbol.toStringTag,{value:"Module"}));function ps(){let e=null,t=null;this.skipSC();const n=this.tokenStart;return this.tokenType===an&&(this.next(),this.skipSC(),e=this.parseWithFallback(this.SelectorList,()=>this.Raw(!1,!0)),this.skipSC(),this.eat(ln)),1===this.lookupNonWSType(0)&&(this.skipSC(),this.eatIdent("to"),this.skipSC(),this.eat(an),this.skipSC(),t=this.parseWithFallback(this.SelectorList,()=>this.Raw(!1,!0)),this.skipSC(),this.eat(ln)),{type:"Scope",loc:this.getLocation(n,this.tokenStart),root:e,limit:t}}function ds(e){e.root&&(this.token(an,"("),this.node(e.root),this.token(ln,")")),e.limit&&(this.token(1,"to"),this.token(an,"("),this.node(e.limit),this.token(ln,")"))}const ms=Object.freeze(Object.defineProperty({__proto__:null,generate:ds,name:"Scope",parse:ps,structure:{root:["SelectorList","Raw",null],limit:["SelectorList","Raw",null]}},Symbol.toStringTag,{value:"Module"}));function fs(){const e=this.readSequence(this.scope.Selector);return null===this.getFirstListNode(e)&&this.error("Selector is expected"),{type:"Selector",loc:this.getLocationFromList(e),children:e}}function gs(e){this.children(e)}const bs=Object.freeze(Object.defineProperty({__proto__:null,generate:gs,name:"Selector",parse:fs,structure:{children:[["TypeSelector","IdSelector","ClassSelector","AttributeSelector","PseudoClassSelector","PseudoElementSelector","Combinator"]]}},Symbol.toStringTag,{value:"Module"}));function ks(){const e=this.createList();for(;!this.eof&&(e.push(this.Selector()),this.tokenType===on);)this.next();return{type:"SelectorList",loc:this.getLocationFromList(e),children:e}}function ys(e){this.children(e,()=>this.token(on,","))}const vs=Object.freeze(Object.defineProperty({__proto__:null,generate:ys,name:"SelectorList",parse:ks,structure:{children:[["Selector","Raw"]]},walkContext:"selector"},Symbol.toStringTag,{value:"Module"})),Ss={value:String};function ws(){return{type:"String",loc:this.getLocation(this.tokenStart,this.tokenEnd),value:Gn(this.consume(5))}}function xs(e){this.token(5,function(e){let t="",n=!1;for(let r=0;r<e.length;r++){const i=e.charCodeAt(r);0!==i?i<=31||127===i?(t+="\\"+i.toString(16),n=!0):34===i||92===i?(t+="\\"+e.charAt(r),n=!1):(n&&(dn(i)||yn(i))&&(t+=" "),t+=e.charAt(r),n=!1):t+="�"}return'"'+t+'"'}(e.value))}const Cs=Object.freeze(Object.defineProperty({__proto__:null,generate:xs,name:"String",parse:ws,structure:Ss},Symbol.toStringTag,{value:"Module"}));function As(){return this.Raw(null,!1)}function _s(){const e=this.tokenStart,t=this.createList();let n;for(;!this.eof;){switch(this.tokenType){case en:this.next();continue;case un:if(33!==this.charCodeAt(this.tokenStart+2)){this.next();continue}n=this.Comment();break;case 14:n=this.CDO();break;case tn:n=this.CDC();break;case 3:n=this.parseWithFallback(this.Atrule,As);break;default:n=this.parseWithFallback(this.Rule,As)}t.push(n)}return{type:"StyleSheet",loc:this.getLocation(e,this.tokenStart),children:t}}function Ts(e){this.children(e)}const Ls=Object.freeze(Object.defineProperty({__proto__:null,generate:Ts,name:"StyleSheet",parse:_s,structure:{children:[["Comment","CDO","CDC","Atrule","Rule","Raw"]]},walkContext:"stylesheet"},Symbol.toStringTag,{value:"Module"}));function Es(){const e=this.tokenStart;this.eat(an),this.skipSC();const t=this.Declaration();return this.eof||this.eat(ln),{type:"SupportsDeclaration",loc:this.getLocation(e,this.tokenStart),declaration:t}}function Os(e){this.token(an,"("),this.node(e.declaration),this.token(ln,")")}const Ps=Object.freeze(Object.defineProperty({__proto__:null,generate:Os,name:"SupportsDeclaration",parse:Es,structure:{declaration:"Declaration"}},Symbol.toStringTag,{value:"Module"}));function Ds(){1!==this.tokenType&&!1===this.isDelim(42)&&this.error("Identifier or asterisk is expected"),this.next()}const Fs={name:String};function Ms(){const e=this.tokenStart;return this.isDelim(124)?(this.next(),Ds.call(this)):(Ds.call(this),this.isDelim(124)&&(this.next(),Ds.call(this))),{type:"TypeSelector",loc:this.getLocation(e,this.tokenStart),name:this.substrToCursor(e)}}function zs(e){this.tokenize(e.name)}const js=Object.freeze(Object.defineProperty({__proto__:null,generate:zs,name:"TypeSelector",parse:Ms,structure:Fs},Symbol.toStringTag,{value:"Module"}));function Is(e,t){let n=0;for(let r=this.tokenStart+e;r<this.tokenEnd;r++){const i=this.charCodeAt(r);if(45===i&&t&&0!==n)return Is.call(this,e+n+1,!1),-1;dn(i)||this.error(t&&0!==n?"Hyphen minus"+(n<6?" or hex digit":"")+" is expected":n<6?"Hex digit is expected":"Unexpected input",r),++n>6&&this.error("Too many hex digits",r)}return this.next(),n}function Ns(e){let t=0;for(;this.isDelim(63);)++t>e&&this.error("Too many question marks"),this.next()}function Rs(e){this.charCodeAt(this.tokenStart)!==e&&this.error((43===e?"Plus sign":"Hyphen minus")+" is expected")}function Bs(){let e=0;switch(this.tokenType){case Jt:if(e=Is.call(this,1,!0),this.isDelim(63)){Ns.call(this,6-e);break}if(this.tokenType===Zt||this.tokenType===Jt){Rs.call(this,45),Is.call(this,1,!1);break}break;case Zt:e=Is.call(this,1,!0),e>0&&Ns.call(this,6-e);break;default:if(this.eatDelim(43),1===this.tokenType){e=Is.call(this,0,!0),e>0&&Ns.call(this,6-e);break}if(this.isDelim(63)){this.next(),Ns.call(this,5);break}this.error("Hex digit or question mark is expected")}}const $s={value:String};function Us(){const e=this.tokenStart;return this.eatIdent("u"),Bs.call(this),{type:"UnicodeRange",loc:this.getLocation(e,this.tokenStart),value:this.substrToCursor(e)}}function Ws(e){this.tokenize(e.value)}const Vs=Object.freeze(Object.defineProperty({__proto__:null,generate:Ws,name:"UnicodeRange",parse:Us,structure:$s},Symbol.toStringTag,{value:"Module"})),Hs={value:String};function qs(){const e=this.tokenStart;let t;switch(this.tokenType){case 7:t=function(e){const t=e.length;let n=4,r=41===e.charCodeAt(t-1)?t-2:t-1,i="";for(;n<r&&yn(e.charCodeAt(n));)n++;for(;n<r&&yn(e.charCodeAt(r));)r--;for(let o=n;o<=r;o++){let n=e.charCodeAt(o);if(92===n){if(o===r){o!==t-1&&(i=e.substr(o+1));break}if(n=e.charCodeAt(++o),vn(92,n)){const t=o-1,n=Fn(e,t);o=n-1,i+=In(e.substring(t+1,n))}else 13===n&&10===e.charCodeAt(o+1)&&o++}else i+=e[o]}return i}(this.consume(7));break;case 2:this.cmpStr(this.tokenStart,this.tokenEnd,"url(")||this.error("Function name must be `url`"),this.eat(2),this.skipSC(),t=Gn(this.consume(5)),this.skipSC(),this.eof||this.eat(ln);break;default:this.error("Url or Function is expected")}return{type:"Url",loc:this.getLocation(e,this.tokenStart),value:t}}function Qs(e){this.token(7,function(e){let t="",n=!1;for(let r=0;r<e.length;r++){const i=e.charCodeAt(r);0!==i?i<=31||127===i?(t+="\\"+i.toString(16),n=!0):32===i||92===i||34===i||39===i||40===i||41===i?(t+="\\"+e.charAt(r),n=!1):(n&&dn(i)&&(t+=" "),t+=e.charAt(r),n=!1):t+="�"}return"url("+t+")"}(e.value))}const Gs=Object.freeze(Object.defineProperty({__proto__:null,generate:Qs,name:"Url",parse:qs,structure:Hs},Symbol.toStringTag,{value:"Module"}));function Ks(){const e=this.tokenStart,t=this.readSequence(this.scope.Value);return{type:"Value",loc:this.getLocation(e,this.tokenStart),children:t}}function Ys(e){this.children(e)}const Js=Object.freeze(Object.defineProperty({__proto__:null,generate:Ys,name:"Value",parse:Ks,structure:{children:[[]]}},Symbol.toStringTag,{value:"Module"})),Xs=Object.freeze({type:"WhiteSpace",loc:null,value:" "}),Zs={value:String};function ea(){return this.eat(en),Xs}function ta(e){this.token(en,e.value)}const na=Object.freeze(Object.defineProperty({__proto__:null,generate:ta,name:"WhiteSpace",parse:ea,structure:Zs},Symbol.toStringTag,{value:"Module"})),ra=function(e){const t=function(e){const t={};for(const n in e.node)if(Kn.call(e.node,n)){const r=e.node[n];if(!r.structure)throw new Error("Missed `structure` field in `"+n+"` node type definition");t[n]=Zn(0,r)}return t}(e),n={},r={},i=Symbol("break-walk"),o=Symbol("skip-node");for(const e in t)Kn.call(t,e)&&null!==t[e]&&(n[e]=er(t[e],!1),r[e]=er(t[e],!0));const s=tr(n),a=tr(r),l=function(e,l){function c(e,t,n){const r=h.call(m,e,t,n);return r===i||r!==o&&!!(p.hasOwnProperty(e.type)&&p[e.type](e,m,c,d)||u.call(m,e,t,n)===i)}let h=Yn,u=Yn,p=n,d=(e,t,n,r)=>e||c(t,n,r);const m={break:i,skip:o,root:e,stylesheet:null,atrule:null,atrulePrelude:null,rule:null,selector:null,block:null,declaration:null,function:null};if("function"==typeof l)h=l;else if(l&&(h=Jn(l.enter),u=Jn(l.leave),l.reverse&&(p=r),l.visit)){if(s.hasOwnProperty(l.visit))p=l.reverse?a[l.visit]:s[l.visit];else if(!t.hasOwnProperty(l.visit))throw new Error("Bad value `"+l.visit+"` for `visit` option (should be: "+Object.keys(t).sort().join(", ")+")");h=Xn(h,l.visit),u=Xn(u,l.visit)}if(h===Yn&&u===Yn)throw new Error("Neither `enter` nor `leave` walker handler is set or both aren't a function");c(e)};return l.break=i,l.skip=o,l.find=function(e,t){let n=null;return l(e,function(e,r,o){if(t.call(this,e,r,o))return n=e,i}),n},l.findLast=function(e,t){let n=null;return l(e,{reverse:!0,enter(e,r,o){if(t.call(this,e,r,o))return n=e,i}}),n},l.findAll=function(e,t){const n=[];return l(e,function(e,r,i){t.call(this,e,r,i)&&n.push(e)}),n},l}({node:Object.freeze(Object.defineProperty({__proto__:null,AnPlusB:dr,Atrule:yr,AtrulePrelude:wr,AttributeSelector:Lr,Block:zr,Brackets:Nr,CDC:$r,CDO:Vr,ClassSelector:Gr,Combinator:Xr,Comment:ni,Condition:ci,Declaration:ki,DeclarationList:wi,Dimension:_i,Feature:Oi,FeatureFunction:zi,FeatureRange:$i,Function:Hi,GeneralEnclosed:Ki,Hash:Zi,IdSelector:ao,Identifier:ro,Layer:uo,LayerList:fo,MediaQuery:yo,MediaQueryList:wo,NestingSelector:Ao,Nth:Lo,Number:Do,Operator:jo,Parentheses:Ro,Percentage:Wo,PseudoClassSelector:Qo,PseudoElementSelector:Jo,Ratio:ts,Raw:ss,Rule:us,Scope:ms,Selector:bs,SelectorList:vs,String:Cs,StyleSheet:Ls,SupportsDeclaration:Ps,TypeSelector:js,UnicodeRange:Vs,Url:Gs,Value:Js,WhiteSpace:na},Symbol.toStringTag,{value:"Module"}))}),ia=["left","right","top","bottom","inset-block-start","inset-block-end","inset-inline-start","inset-inline-end","inset-block","inset-inline","inset"];function oa(e){return ia.includes(e)}const sa=["margin-block-start","margin-block-end","margin-block","margin-inline-start","margin-inline-end","margin-inline","margin-bottom","margin-left","margin-right","margin-top","margin"];const aa=["width","height","min-width","min-height","max-width","max-height","block-size","inline-size","min-block-size","min-inline-size","max-block-size","max-inline-size"];function la(e){return aa.includes(e)}const ca=["justify-self","align-self","place-self"];const ha=[...ia,...sa,...aa,...ca,"position-anchor","position-area"],ua=[...aa,...ia,...sa];function pa(e){return ua.includes(e)}const da=["top","left","right","bottom","start","end","self-start","self-end","center","inside","outside"];function ma(e){return da.includes(e)}const fa=["width","height","block","inline","self-block","self-inline"];const ga=new Set(["Atrule","Selector","Declaration"]);const ba=(e,t)=>{if(9===e&&(e=t),"string"==typeof e){const t=e.charCodeAt(0);return t>127?32768:t<<8}return e},ka=[[1,1],[1,2],[1,7],[1,8],[1,"-"],[1,Jt],[1,Xt],[1,Zt],[1,tn],[1,an],[3,1],[3,2],[3,7],[3,8],[3,"-"],[3,Jt],[3,Xt],[3,Zt],[3,tn],[4,1],[4,2],[4,7],[4,8],[4,"-"],[4,Jt],[4,Xt],[4,Zt],[4,tn],[Zt,1],[Zt,2],[Zt,7],[Zt,8],[Zt,"-"],[Zt,Jt],[Zt,Xt],[Zt,Zt],[Zt,tn],["#",1],["#",2],["#",7],["#",8],["#","-"],["#",Jt],["#",Xt],["#",Zt],["#",tn],["-",1],["-",2],["-",7],["-",8],["-","-"],["-",Jt],["-",Xt],["-",Zt],["-",tn],[Jt,1],[Jt,2],[Jt,7],[Jt,8],[Jt,Jt],[Jt,Xt],[Jt,Zt],[Jt,"%"],[Jt,tn],["@",1],["@",2],["@",7],["@",8],["@","-"],["@",tn],[".",Jt],[".",Xt],[".",Zt],["+",Jt],["+",Xt],["+",Zt],["/","*"]],ya=ka.concat([[1,4],[Zt,4],[4,4],[3,an],[3,5],[3,nn],[Xt,Xt],[Xt,Zt],[Xt,2],[Xt,"-"],[ln,1],[ln,2],[ln,Xt],[ln,Zt],[ln,4],[ln,"-"]]);function va(e){const t=new Set(e.map(([e,t])=>ba(e)<<16|ba(t)));return function(e,n,r){const i=ba(n,r),o=r.charCodeAt(0);return(45===o&&1!==n&&2!==n&&n!==tn||43===o?t.has(e<<16|o<<8):t.has(e<<16|i))&&this.emit(" ",en,!0),i}}const Sa=va(ka),wa=va(ya),xa=Object.freeze(Object.defineProperty({__proto__:null,safe:wa,spec:Sa},Symbol.toStringTag,{value:"Module"}));function Ca(e,t){if("function"==typeof t){let n=null;return void e.children.forEach(e=>{null!==n&&t.call(this,n),this.node(e),n=e})}e.children.forEach(this.node,this)}function Aa(e){Qn(e,(t,n,r)=>{this.token(t,e.slice(n,r))})}const _a=function(e){const t=new Map;for(let[n,r]of Object.entries(e.node))"function"==typeof(r.generate||r)&&t.set(n,r.generate||r);return function(e,n){let r="",i=0,o={node(e){if(!t.has(e.type))throw new Error("Unknown node type: "+e.type);t.get(e.type).call(s,e)},tokenBefore:wa,token(e,t){i=this.tokenBefore(i,e,t),this.emit(t,e,!1),9===e&&92===t.charCodeAt(0)&&this.emit("\n",en,!0)},emit(e){r+=e},result:()=>r};n&&("function"==typeof n.decorator&&(o=n.decorator(o)),n.sourceMap&&(o=function(e){const t=new SourceMapGenerator,n={line:1,column:0},r={line:0,column:0},i={line:1,column:0},o={generated:i};let s=1,a=0,l=!1;const c=e.node;e.node=function(e){if(e.loc&&e.loc.start&&ga.has(e.type)){const c=e.loc.start.line,h=e.loc.start.column-1;(r.line!==c||r.column!==h)&&(r.line=c,r.column=h,n.line=s,n.column=a,l&&(l=!1,(n.line!==i.line||n.column!==i.column)&&t.addMapping(o)),l=!0,t.addMapping({source:e.loc.source,original:r,generated:n}))}c.call(this,e),l&&ga.has(e.type)&&(i.line=s,i.column=a)};const h=e.emit;e.emit=function(e,t,n){for(let t=0;t<e.length;t++)10===e.charCodeAt(t)?(s++,a=0):a++;h(e,t,n)};const u=e.result;return e.result=function(){return l&&t.addMapping(o),{css:u(),map:t}},e}(o)),n.mode in xa&&(o.tokenBefore=xa[n.mode]));const s={node:e=>o.node(e),children:Ca,token:(e,t)=>o.token(e,t),tokenize:Aa};return o.node(e),o.result()}}({node:Object.freeze(Object.defineProperty({__proto__:null,AnPlusB:pr,Atrule:kr,AtrulePrelude:Sr,AttributeSelector:Tr,Block:Mr,Brackets:Ir,CDC:Br,CDO:Wr,ClassSelector:Qr,Combinator:Jr,Comment:ti,Condition:li,Declaration:fi,DeclarationList:Si,Dimension:Ai,Feature:Ei,FeatureFunction:Mi,FeatureRange:Bi,Function:Vi,GeneralEnclosed:Gi,Hash:Xi,IdSelector:so,Identifier:no,Layer:ho,LayerList:mo,MediaQuery:ko,MediaQueryList:So,NestingSelector:Co,Nth:To,Number:Po,Operator:zo,Parentheses:No,Percentage:Uo,PseudoClassSelector:qo,PseudoElementSelector:Yo,Ratio:es,Raw:os,Rule:hs,Scope:ds,Selector:gs,SelectorList:ys,String:xs,StyleSheet:Ts,SupportsDeclaration:Os,TypeSelector:zs,UnicodeRange:Ws,Url:Qs,Value:Ys,WhiteSpace:ta},Symbol.toStringTag,{value:"Module"}))});const Ta=" ";function La({source:e,line:t,column:n,baseLine:r,baseColumn:i},o){function s(e,t){return a.slice(e,t).map((t,n)=>String(e+n+1).padStart(h)+" |"+t).join("\n")}const a=("\n".repeat(Math.max(r-1,0))+" ".repeat(Math.max(i-1,0))+e).split(/\r\n?|\n|\f/),l=Math.max(1,t-o)-1,c=Math.min(t+o,a.length+1),h=Math.max(4,String(c).length)+1;let u=0;(n+=3*(a[t-1].substr(0,n-1).match(/\t/g)||[]).length)>100&&(u=n-60+3,n=58);for(let e=l;e<=c;e++)e>=0&&e<a.length&&(a[e]=a[e].replace(/\t/g,Ta),a[e]=(u>0&&a[e].length>u?"…":"")+a[e].substr(u,98)+(a[e].length>u+100-1?"…":""));return[s(l,t),new Array(n+h+2).join("-")+"^",s(t,c)].filter(Boolean).join("\n").replace(/^(\s+\d+\s+\|\n)+/,"").replace(/\n(\s+\d+\s+\|)+$/,"")}function Ea(e,t,n,r,i,o=1,s=1){return Object.assign(function(e,t){const n=Object.create(SyntaxError.prototype),r=new Error;return Object.assign(n,{name:e,message:t,get stack(){return(r.stack||"").replace(/^(.+\n){1,3}/,`${e}: ${t}\n`)}})}("SyntaxError",e),{source:t,offset:n,line:r,column:i,sourceFragment:e=>La({source:t,line:r,column:i,baseLine:o,baseColumn:s},isNaN(e)?0:e),get formattedMessage(){return`Parse error: ${e}\n`+La({source:t,line:r,column:i,baseLine:o,baseColumn:s},2)}})}function Oa(e){const t=this.createList();let n=!1;const r={recognizer:e};for(;!this.eof;){switch(this.tokenType){case un:this.next();continue;case en:n=!0,this.next();continue}let i=e.getNode.call(this,r);if(void 0===i)break;n&&(e.onWhiteSpace&&e.onWhiteSpace.call(this,i,t,r),n=!1),t.push(i)}return n&&e.onWhiteSpace&&e.onWhiteSpace.call(this,null,t,r),t}const Pa=()=>{};function Da(e){return function(){return this[e]()}}function Fa(e){const t=Object.create(null);for(const n of Object.keys(e)){const r=e[n],i=r.parse||r;i&&(t[n]=i)}return t}function Ma(e){switch(this.tokenType){case 4:return this.Hash();case on:return this.Operator();case an:return this.Parentheses(this.readSequence,e.recognizer);case sn:return this.Brackets(this.readSequence,e.recognizer);case 5:return this.String();case Zt:return this.Dimension();case Xt:return this.Percentage();case Jt:return this.Number();case 2:return this.cmpStr(this.tokenStart,this.tokenEnd,"url(")?this.Url():this.Function(this.readSequence,e.recognizer);case 7:return this.Url();case 1:return this.cmpChar(this.tokenStart,117)&&this.cmpChar(this.tokenStart+1,43)?this.UnicodeRange():this.Identifier();case 9:{const e=this.charCodeAt(this.tokenStart);if(47===e||42===e||43===e||45===e)return this.Operator();35===e&&this.error("Hex or identifier is expected",this.tokenStart+1);break}}}const za={getNode:Ma};const ja={onWhiteSpace:function(e,t){null!==t.last&&"Combinator"!==t.last.type&&null!==e&&"Combinator"!==e.type&&t.push({type:"Combinator",loc:null,name:" "})},getNode:function(){switch(this.tokenType){case sn:return this.AttributeSelector();case 4:return this.IdSelector();case nn:return this.lookupType(1)===nn?this.PseudoElementSelector():this.PseudoClassSelector();case 1:return this.TypeSelector();case Jt:case Xt:return this.Percentage();case Zt:46===this.charCodeAt(this.tokenStart)&&this.error("Identifier is expected",this.tokenStart+1);break;case 9:switch(this.charCodeAt(this.tokenStart)){case 43:case 62:case 126:case 47:return this.Combinator();case 46:return this.ClassSelector();case 42:case 124:return this.TypeSelector();case 35:return this.IdSelector();case 38:return this.NestingSelector()}}}};function Ia(e){return null!==e&&"Operator"===e.type&&("-"===e.value[e.value.length-1]||"+"===e.value[e.value.length-1])}const Na={getNode:Ma,onWhiteSpace(e,t){Ia(e)&&(e.value=" "+e.value),Ia(t.last)&&(t.last.value+=" ")},expression:function(){return this.createSingleNodeList(this.Raw(null,!1))},var:function(){const e=this.createList();if(this.skipSC(),e.push(this.Identifier()),this.skipSC(),this.tokenType===on){e.push(this.Operator());const t=this.tokenIndex,n=this.parseCustomProperty?this.Value(null):this.Raw(this.consumeUntilExclamationMarkOrSemicolon,!1);if("Value"===n.type&&n.children.isEmpty)for(let e=t-this.tokenIndex;e<=0;e++)if(this.lookupType(e)===en){n.children.appendData({type:"WhiteSpace",loc:null,value:" "});break}e.push(n)}return e}},Ra=Object.freeze(Object.defineProperty({__proto__:null,AtrulePrelude:za,Selector:ja,Value:Na},Symbol.toStringTag,{value:"Module"})),Ba=new Set(["none","and","not","or"]),$a={parse:{prelude(){const e=this.createList();if(1===this.tokenType){const t=this.substring(this.tokenStart,this.tokenEnd);Ba.has(t.toLowerCase())||e.push(this.Identifier())}return e.push(this.Condition("container")),e},block(e=!1){return this.Block(e)}}},Ua={parse:{prelude:null,block(){return this.Block(!0)}}};function Wa(e,t){return this.parseWithFallback(()=>{try{return e.call(this)}finally{this.skipSC(),this.lookupNonWSType(0)!==ln&&this.error()}},t||(()=>this.Raw(null,!0)))}const Va={layer(){this.skipSC();const e=this.createList(),t=Wa.call(this,this.Layer);return("Raw"!==t.type||""!==t.value)&&e.push(t),e},supports(){this.skipSC();const e=this.createList(),t=Wa.call(this,this.Declaration,()=>Wa.call(this,()=>this.Condition("supports")));return("Raw"!==t.type||""!==t.value)&&e.push(t),e}},Ha={container:$a,"font-face":Ua,import:{parse:{prelude(){const e=this.createList();switch(this.tokenType){case 5:e.push(this.String());break;case 7:case 2:e.push(this.Url());break;default:this.error("String or url() is expected")}return this.skipSC(),1===this.tokenType&&this.cmpStr(this.tokenStart,this.tokenEnd,"layer")?e.push(this.Identifier()):2===this.tokenType&&this.cmpStr(this.tokenStart,this.tokenEnd,"layer(")&&e.push(this.Function(null,Va)),this.skipSC(),2===this.tokenType&&this.cmpStr(this.tokenStart,this.tokenEnd,"supports(")&&e.push(this.Function(null,Va)),(1===this.lookupNonWSType(0)||this.lookupNonWSType(0)===an)&&e.push(this.MediaQueryList()),e},block:null}},layer:{parse:{prelude(){return this.createSingleNodeList(this.LayerList())},block(){return this.Block(!1)}}},media:{parse:{prelude(){return this.createSingleNodeList(this.MediaQueryList())},block(e=!1){return this.Block(e)}}},nest:{parse:{prelude(){return this.createSingleNodeList(this.SelectorList())},block(){return this.Block(!0)}}},page:{parse:{prelude(){return this.createSingleNodeList(this.SelectorList())},block(){return this.Block(!0)}}},scope:{parse:{prelude(){return this.createSingleNodeList(this.Scope())},block(e=!1){return this.Block(e)}}},"starting-style":{parse:{prelude:null,block(e=!1){return this.Block(e)}}},supports:{parse:{prelude(){return this.createSingleNodeList(this.Condition("supports"))},block(e=!1){return this.Block(e)}}}};const qa={parse(){return this.createSingleNodeList(this.SelectorList())}},Qa={parse(){return this.createSingleNodeList(this.Selector())}},Ga={parse(){return this.createSingleNodeList(this.Identifier())}},Ka={parse:function(){const e=this.createList();this.skipSC();e:for(;!this.eof;){switch(this.tokenType){case 1:e.push(this.Identifier());break;case 5:e.push(this.String());break;case on:e.push(this.Operator());break;case ln:break e;default:this.error("Identifier, string or comma is expected")}this.skipSC()}return e}},Ya={parse(){return this.createSingleNodeList(this.Nth())}},Ja={dir:Ga,has:qa,lang:Ka,matches:qa,is:qa,"-moz-any":qa,"-webkit-any":qa,where:qa,not:qa,"nth-child":Ya,"nth-last-child":Ya,"nth-last-of-type":Ya,"nth-of-type":Ya,slotted:Qa,host:Qa,"host-context":Qa},Xa=Object.freeze(Object.defineProperty({__proto__:null,AnPlusB:ur,Atrule:br,AtrulePrelude:vr,AttributeSelector:_r,Block:Fr,Brackets:jr,CDC:Rr,CDO:Ur,ClassSelector:qr,Combinator:Yr,Comment:ei,Condition:ai,Declaration:mi,DeclarationList:vi,Dimension:Ci,Feature:Li,FeatureFunction:Fi,FeatureRange:Ri,Function:Wi,GeneralEnclosed:Qi,Hash:Ji,IdSelector:oo,Identifier:to,Layer:co,LayerList:po,MediaQuery:bo,MediaQueryList:vo,NestingSelector:xo,Nth:_o,Number:Oo,Operator:Mo,Parentheses:Io,Percentage:$o,PseudoClassSelector:Ho,PseudoElementSelector:Ko,Ratio:Zo,Raw:is,Rule:cs,Scope:ps,Selector:fs,SelectorList:ks,String:ws,StyleSheet:_s,SupportsDeclaration:Es,TypeSelector:Ms,UnicodeRange:Us,Url:qs,Value:Ks,WhiteSpace:ea},Symbol.toStringTag,{value:"Module"})),Za=function(e){let t="",n="<unknown>",r=!1,i=Pa,o=!1;const s=new $n,a=Object.assign(new qn,function(e){const t={context:Object.create(null),features:Object.assign(Object.create(null),e.features),scope:Object.assign(Object.create(null),e.scope),atrule:Fa(e.atrule),pseudo:Fa(e.pseudo),node:Fa(e.node)};for(const[n,r]of Object.entries(e.parseContext))switch(typeof r){case"function":t.context[n]=r;break;case"string":t.context[n]=Da(r)}return He(He({config:t},t),t.node)}(e||{}),{parseAtrulePrelude:!0,parseRulePrelude:!0,parseValue:!0,parseCustomProperty:!1,readSequence:Oa,consumeUntilBalanceEnd:()=>0,consumeUntilLeftCurlyBracket:e=>123===e?1:0,consumeUntilLeftCurlyBracketOrSemicolon:e=>123===e||59===e?1:0,consumeUntilExclamationMarkOrSemicolon:e=>33===e||59===e?1:0,consumeUntilSemicolonIncluded:e=>59===e?2:0,createList:()=>new Kt,createSingleNodeList:e=>(new Kt).appendData(e),getFirstListNode:e=>e&&e.first,getLastListNode:e=>e&&e.last,parseWithFallback(e,t){const n=this.tokenIndex;try{return e.call(this)}catch(e){if(o)throw e;this.skip(n-this.tokenIndex);const r=t.call(this);return o=!0,i(e,r),o=!1,r}},lookupNonWSType(e){let t;do{if(t=this.lookupType(e++),t!==en&&t!==un)return t}while(0!==t);return 0},charCodeAt:e=>e>=0&&e<t.length?t.charCodeAt(e):0,substring:(e,n)=>t.substring(e,n),substrToCursor(e){return this.source.substring(e,this.tokenStart)},cmpChar:(e,n)=>En(t,e,n),cmpStr:(e,n,r)=>On(t,e,n,r),consume(e){const t=this.tokenStart;return this.eat(e),this.substrToCursor(t)},consumeFunctionName(){const e=t.substring(this.tokenStart,this.tokenEnd-1);return this.eat(2),e},consumeNumber(e){const n=t.substring(this.tokenStart,zn(t,this.tokenStart));return this.eat(e),n},eat(e){if(this.tokenType!==e){const t=Nn[e].slice(0,-6).replace(/-/g," ").replace(/^./,e=>e.toUpperCase());let n=`${/[[\](){}]/.test(t)?`"${t}"`:t} is expected`,r=this.tokenStart;switch(e){case 1:2===this.tokenType||7===this.tokenType?(r=this.tokenEnd-1,n="Identifier is expected but function found"):n="Identifier is expected";break;case 4:this.isDelim(35)&&(this.next(),r++,n="Name is expected");break;case Xt:this.tokenType===Jt&&(r=this.tokenEnd,n="Percent sign is expected")}this.error(n,r)}this.next()},eatIdent(e){(1!==this.tokenType||!1===this.lookupValue(0,e))&&this.error(`Identifier "${e}" is expected`),this.next()},eatDelim(e){this.isDelim(e)||this.error(`Delim "${String.fromCharCode(e)}" is expected`),this.next()},getLocation:(e,t)=>r?s.getLocationRange(e,t,n):null,getLocationFromList(e){if(r){const t=this.getFirstListNode(e),r=this.getLastListNode(e);return s.getLocationRange(null!==t?t.loc.start.offset-s.startOffset:this.tokenStart,null!==r?r.loc.end.offset-s.startOffset:this.tokenStart,n)}return null},error(e,n){const r=void 0!==n&&n<t.length?s.getLocation(n):this.eof?s.getLocation(function(e,t){for(;t>=0&&yn(e.charCodeAt(t));t--);return t+1}(t,t.length-1)):s.getLocation(this.tokenStart);throw new Ea(e||"Unexpected input",t,r.offset,r.line,r.column,s.startLine,s.startColumn)}});return Object.assign(function(e,l){t=e,l=l||{},a.setSource(t,Qn),s.setSource(t,l.offset,l.line,l.column),n=l.filename||"<unknown>",r=!!l.positions,i="function"==typeof l.onParseError?l.onParseError:Pa,o=!1,a.parseAtrulePrelude=!("parseAtrulePrelude"in l)||!!l.parseAtrulePrelude,a.parseRulePrelude=!("parseRulePrelude"in l)||!!l.parseRulePrelude,a.parseValue=!("parseValue"in l)||!!l.parseValue,a.parseCustomProperty="parseCustomProperty"in l&&!!l.parseCustomProperty;const{context:c="default",onComment:h}=l;if(!(c in a.context))throw new Error("Unknown context `"+c+"`");"function"==typeof h&&a.forEachToken((e,n,r)=>{if(e===un){const e=a.getLocation(n,r),i=On(t,r-2,r,"*/")?t.slice(n+2,r-2):t.slice(n+2,r);h(i,e)}});const u=a.context[c].call(a,l);return a.eof||a.error(),u},{SyntaxError:Ea,config:a.config})}({parseContext:{default:"StyleSheet",stylesheet:"StyleSheet",atrule:"Atrule",atrulePrelude(e){return this.AtrulePrelude(e.atrule?String(e.atrule):null)},mediaQueryList:"MediaQueryList",mediaQuery:"MediaQuery",condition(e){return this.Condition(e.kind)},rule:"Rule",selectorList:"SelectorList",selector:"Selector",block(){return this.Block(!0)},declarationList:"DeclarationList",declaration:"Declaration",value:"Value"},features:{supports:{selector(){return this.Selector()}},container:{style(){return this.Declaration()}}},scope:Ra,atrule:Ha,pseudo:Ja,node:Xa});let el=(e=21)=>{let t="",n=0|e;for(;n--;)t+="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"[64*Math.random()|0];return t};const tl=el(),nl=new Set;function rl(e){return!(!e||"Function"!==e.type||"anchor"!==e.name)}function il(e,t=!1){return Za(e,{parseAtrulePrelude:!1,parseCustomProperty:!0,onParseError:e=>{t&&nl.add(e)}})}function ol(e){return _a(e,{mode:"spec"})}function sl(e){return"Declaration"===e.type}function al(e){return e?e.children.map(e=>{var t;let n;"PseudoElementSelector"===(null==(t=e.children.last)?void 0:t.type)&&(n=ol((e=Yt(e)).children.last),e.children.pop());const r=ol(e);return{selector:r+(null!=n?n:""),elementPart:r,pseudoElementPart:n}}).toArray():[]}const ll=[...ha,"anchor-scope","anchor-name"].reduce((e,t)=>(e[t]=`--${t}-${tl}`,e),{});function cl(e,t){return sl(e)&&ll[e.property]&&t?(t.children.appendData(qe(He({},e),{property:ll[e.property]})),{updated:!0}):{updated:!1}}function hl(e,t){if(!sl(e)||!t||!["inset","inset-block","inset-inline"].includes(e.property))return{updated:!1};const n=(n,r)=>{r&&t.children.appendData(qe(He({},e),{property:n,value:{type:"Value",children:(new Kt).fromArray([r])}}))};if("inset"===e.property){const t=e.value.children.toArray(),[r,i,o,s]=(()=>{switch(t.length){case 1:return[t[0],t[0],t[0],t[0]];case 2:return[t[0],t[1],t[0],t[1]];case 3:return[t[0],t[1],t[2],t[1]];case 4:return[t[0],t[1],t[2],t[3]];default:return[]}})();n("top",r),n("right",i),n("bottom",o),n("left",s)}else if("inset-block"===e.property){const t=e.value.children.toArray(),[r,i]=(()=>{switch(t.length){case 1:return[t[0],t[0]];case 2:return[t[0],t[1]];default:return[]}})();n("inset-block-start",r),n("inset-block-end",i)}else if("inset-inline"===e.property){const t=e.value.children.toArray(),[r,i]=(()=>{switch(t.length){case 1:return[t[0],t[0]];case 2:return[t[0],t[1]];default:return[]}})();n("inset-inline-start",r),n("inset-inline-end",i)}return{updated:!0}}var ul=(e=>(e.All="all",e.None="none",e))(ul||{});function pl(e,t){var n;return t=null!=(n=ll[t])?n:t,(e instanceof HTMLElement?getComputedStyle(e):e.computedStyle).getPropertyValue(t).trim()}function dl(e,t,n){return pl(e,t)===n}function ml(e,{selector:t,pseudoElementPart:n}){const r=getComputedStyle(e,n),i=document.createElement("div"),o=document.createElement("style");i.id=`fake-pseudo-element-${el()}`;for(const e of Array.from(r)){const t=r.getPropertyValue(e);i.style.setProperty(e,t)}o.textContent+=`#${i.id}${n} { content: ${r.content}; }`,o.textContent+=`${t} { display: none !important; }`,document.head.append(o);const s="::before"===n?"afterbegin":"beforeend";return e.insertAdjacentElement(s,i),{fakePseudoElement:i,sheet:o,computedStyle:r}}function fl(e){let t=function(e){let t=e;for(;t;){if(dl(t,"overflow","scroll"))return t;t=t.parentElement}return t}(e);return t===document.documentElement&&(t=null),null!=t?t:{scrollTop:0,scrollLeft:0}}function gl(e,t){const n=pl(e,"anchor-scope");return n===t||"all"===n}const bl=e=>Qe(null,null,function*(){var t,n,r;let i=yield null==(t=Vt.getOffsetParent)?void 0:t.call(Vt,e);return(yield null==(n=Vt.isElement)?void 0:n.call(Vt,i))||(i=(yield null==(r=Vt.getDocumentElement)?void 0:r.call(Vt,e))||window.document.documentElement),i}),kl=(e,t)=>e.flatMap(e=>[...e.querySelectorAll(t)]),yl="InvalidMimeType";const vl='[style*="anchor"]',Sl='[style*="position-area"]';function wl(e){return Qe(this,null,function*(){var t,n;const r=null!=(t=e.elements)?t:kl(e.roots,"link, style"),i=[];r.filter(e=>e instanceof HTMLElement).forEach(e=>{if("link"===e.tagName.toLowerCase()){const t=function(e){const t=new URL(e.href,document.baseURI);if(function(e){return!("text/css"!==e.type&&"stylesheet"!==e.rel||!e.href)}(e)&&t.origin===location.origin)return t}(e);t&&i.push({el:e,url:t})}"style"===e.tagName.toLowerCase()&&i.push({el:e,css:e.innerHTML})});const o=function(e){const t=e?e.filter(e=>e instanceof HTMLElement&&(e.matches(vl)||e.matches(Sl))):Array.from(document.querySelectorAll([vl,Sl].join(","))),n=[];return t.filter(e=>e instanceof HTMLElement).forEach(e=>{const t=el(12),r="data-has-inline-styles";e.setAttribute(r,t);const i=`[${r}="${t}"] { ${e.getAttribute("style")} }`;n.push({el:e,css:i})}),n}(e.excludeInlineStyles?null!=(n=e.elements)?n:[]:void 0);return yield function(e){return Qe(this,null,function*(){return(yield Promise.all(e.map(e=>Qe(null,null,function*(){var t;if(!e.url)return e;if(null!=(t=e.el)&&t.disabled)return null;try{const t=yield fetch(e.url.toString()),n=t.headers.get("content-type");if(null==n||!n.startsWith("text/css")){const t=new Error(`Error loading ${e.url}: expected content-type "text/css", got "${n}".`);throw t.name=yl,t}const r=yield t.text();return qe(He({},e),{css:r})}catch(e){if(e instanceof Error&&e.name===yl)return null;throw e}})))).filter(e=>null!==e)})}([...i,...o])})}let xl=(e=21)=>{let t="",n=crypto.getRandomValues(new Uint8Array(e|=0));for(;e--;)t+="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"[63&n[e]];return t};const Cl="--pa-cascade-property",Al="data-anchor-position-wrapper",_l="data-pa-wrapper-for-",Tl="POLYFILL-POSITION-AREA",Ll=["left","center","right","span-left","span-right","x-start","x-end","span-x-start","span-x-end","self-x-start","self-x-end","span-self-x-start","span-self-x-end","span-all","top","bottom","span-top","span-bottom","y-start","y-end","span-y-start","span-y-end","self-y-start","self-y-end","span-self-y-start","span-self-y-end","block-start","block-end","span-block-start","span-block-end","inline-start","inline-end","span-inline-start","span-inline-end","self-block-start","self-block-end","span-self-block-start","span-self-block-end","self-inline-start","self-inline-end","span-self-inline-start","span-self-inline-end","start","end","span-start","span-end","self-start","self-end","span-self-start","span-self-end"];function El(e){return Ll.includes(e)}const Ol={left:[0,1,"Irrelevant"],center:[1,2,"Irrelevant"],right:[2,3,"Irrelevant"],"span-left":[0,2,"Irrelevant"],"span-right":[1,3,"Irrelevant"],"x-start":[0,1,"Physical"],"x-end":[2,3,"Physical"],"span-x-start":[0,2,"Physical"],"span-x-end":[1,3,"Physical"],"self-x-start":[0,1,"PhysicalSelf"],"self-x-end":[2,3,"PhysicalSelf"],"span-self-x-start":[0,2,"PhysicalSelf"],"span-self-x-end":[1,3,"PhysicalSelf"],"span-all":[0,3,"Irrelevant"],top:[0,1,"Irrelevant"],bottom:[2,3,"Irrelevant"],"span-top":[0,2,"Irrelevant"],"span-bottom":[1,3,"Irrelevant"],"y-start":[0,1,"Physical"],"y-end":[2,3,"Physical"],"span-y-start":[0,2,"Physical"],"span-y-end":[1,3,"Physical"],"self-y-start":[0,1,"PhysicalSelf"],"self-y-end":[2,3,"PhysicalSelf"],"span-self-y-start":[0,2,"PhysicalSelf"],"span-self-y-end":[1,3,"PhysicalSelf"],"block-start":[0,1,"Logical"],"block-end":[2,3,"Logical"],"span-block-start":[0,2,"Logical"],"span-block-end":[1,3,"Logical"],"inline-start":[0,1,"Logical"],"inline-end":[2,3,"Logical"],"span-inline-start":[0,2,"Logical"],"span-inline-end":[1,3,"Logical"],"self-block-start":[0,1,"LogicalSelf"],"self-block-end":[2,3,"LogicalSelf"],"span-self-block-start":[0,2,"LogicalSelf"],"span-self-block-end":[1,3,"LogicalSelf"],"self-inline-start":[0,1,"LogicalSelf"],"self-inline-end":[2,3,"LogicalSelf"],"span-self-inline-start":[0,2,"LogicalSelf"],"span-self-inline-end":[1,3,"LogicalSelf"],start:[0,1,"Logical"],end:[2,3,"Logical"],"span-start":[0,2,"Logical"],"span-end":[1,3,"Logical"],"self-start":[0,1,"LogicalSelf"],"self-end":[2,3,"LogicalSelf"],"span-self-start":[0,2,"LogicalSelf"],"span-self-end":[1,3,"LogicalSelf"]},Pl=["start","center","end","span-start","span-end","span-all"],Dl=["self-start","center","self-end","span-self-start","span-self-end","span-all"],Fl=["block","top","bottom","y"],Ml=["inline","left","right","x"];function zl(e){const t=e.split("-");for(const e of t){if(Fl.includes(e))return"block";if(Ml.includes(e))return"inline"}return"ambiguous"}function jl(e,t){return t[0].includes(e[0])&&t[1].includes(e[1])||t[0].includes(e[1])&&t[1].includes(e[0])}const Il=[[["left","center","right","span-left","span-right","x-start","x-end","span-x-start","span-x-end","self-x-start","self-x-end","span-self-x-start","span-self-x-end","span-all"],["top","center","bottom","span-top","span-bottom","y-start","y-end","span-y-start","span-y-end","self-y-start","self-y-end","span-self-y-start","span-self-y-end","span-all"]],[["block-start","center","block-end","span-block-start","span-block-end","span-all"],["inline-start","center","inline-end","span-inline-start","span-inline-end","span-all"]],[["self-block-start","center","self-block-end","span-self-block-start","span-self-block-end","span-all"],["self-inline-start","center","self-inline-end","span-self-inline-start","span-self-inline-end","span-all"]],[Pl,Pl],[Dl,Dl]];const Nl=e=>{const t=getComputedStyle(e);return{writingMode:t.writingMode,direction:t.direction}},Rl=e=>e.reverse().map(e=>3-e),Bl=(e,t)=>"Irrelevant"===e?t:e,$l=(e,t)=>Qe(null,[e,t],function*({block:e,inline:t},n){const r=Bl(e[2],t[2]),i=yield((e,t)=>Qe(null,null,function*(){const n=yield bl(e);switch(t){case"Logical":case"Physical":return Nl(n);case"LogicalSelf":case"PhysicalSelf":return Nl(e);default:return null}}))(n,r),o={block:[e[0],e[1]],inline:[t[0],t[1]]};if(i){if("rtl"===i.direction&&(o.inline=Rl(o.inline)),i.writingMode.startsWith("vertical")){const e=o.block;o.block=o.inline,o.inline=e}if(i.writingMode.startsWith("sideways")){const e=o.block;o.block=o.inline,o.inline=e,i.writingMode.endsWith("lr")&&(o.block=Rl(o.block))}i.writingMode.endsWith("rl")&&(o.inline=Rl(o.inline))}return o});function Ul([e,t]){return 0===e&&3===t?"center":0===e?"end":3===t?"start":"center"}function Wl(e){if(!function(e){return"Declaration"===e.type&&"position-area"===e.property}(e))return;const t=function(e){const t=e.value.children.toArray().map(({name:e})=>e);return 1===t.length&&("ambiguous"===zl(t[0])?t.push(t[0]):t.push("span-all")),t}(e);if(!function(e){for(const t of Il)if(jl(e,t))return!0;return!1}(t))return;const n={};switch(zl(t[0])){case"block":n.block=t[0],n.inline=t[1];break;case"inline":n.inline=t[0],n.block=t[1];break;case"ambiguous":"block"==zl(t[1])?(n.block=t[1],n.inline=t[0]):(n.inline=t[1],n.block=t[0])}return{values:n,grid:{block:Ol[n.block],inline:Ol[n.inline]},selectorUUID:`--pa-declaration-${xl(12)}`}}function Vl(e,t){["justify-self","align-self"].forEach(e=>{t.children.appendData({type:"Declaration",property:e,value:{type:"Raw",value:`var(--pa-value-${e})`},important:!1})}),t.children.appendData({type:"Declaration",property:Cl,value:{type:"Raw",value:e.selectorUUID},important:!1})}function Hl(e,t){var n,r;let i;if((null==(n=e.parentElement)?void 0:n.tagName)===Tl)i=e.parentElement;else{i=document.createElement(Tl),i.style.display="grid",i.style.position="absolute";const t=getComputedStyle(e).pointerEvents;i.style.pointerEvents="none",e.style.pointerEvents=t,["top","left","right","bottom"].forEach(e=>{i.style.setProperty(e,`var(--pa-value-${e})`)}),null==(r=e.parentElement)||r.insertBefore(i,e),i.appendChild(e)}return i.setAttribute(`${_l}${t}`,""),i}function ql(e,t,n){return Qe(this,null,function*(){const r=`--pa-target-${xl(12)}`,i=yield $l(t.grid,e),o=(({block:e,inline:t})=>{const n=[0,"top","bottom",0],r=[0,"left","right",0];return{block:[n[e[0]],n[e[1]]],inline:[r[t[0]],r[t[1]]]}})(i),s=Bl(t.grid.block[2],t.grid.inline[2]),a=["LogicalSelf","PhysicalSelf"].includes(s)?i:t.grid;return{insets:o,alignments:{block:Ul([a.block[0],a.block[1]]),inline:Ul([a.inline[0],a.inline[1]])},targetUUID:r,targetEl:e,anchorEl:n,wrapperEl:Hl(e,r),values:t.values,grid:t.grid,selectorUUID:t.selectorUUID}})}function Ql(e,t){return`\n [${Al}="${t}"][${_l}${e}] {\n --pa-value-top: var(${e}-top);\n --pa-value-left: var(${e}-left);\n --pa-value-right: var(${e}-right);\n --pa-value-bottom: var(${e}-bottom);\n --pa-value-justify-self: var(${e}-justify-self);\n --pa-value-align-self: var(${e}-align-self);\n }\n `.replaceAll("\n","")}const Gl=["normal","most-width","most-height","most-block-size","most-inline-size"],Kl=["flip-block","flip-inline","flip-start"];function Yl(e,t){const n=document.querySelector(e);if(n){let e=function(e){const t={};return ha.forEach(n=>{const r=pl(e,`--${n}-${tl}`);r&&(t[n]=r)}),t}(n);return t.forEach(t=>{e=nc(e,t)}),e}}function Jl(e,t){let n=e.declarations;return t.forEach(e=>{n=nc(n,e)}),n}const Xl={"flip-block":{top:"bottom",bottom:"top","inset-block-start":"inset-block-end","inset-block-end":"inset-block-start","margin-top":"margin-bottom","margin-bottom":"margin-top"},"flip-inline":{left:"right",right:"left","inset-inline-start":"inset-inline-end","inset-inline-end":"inset-inline-start","margin-left":"margin-right","margin-right":"margin-left"},"flip-start":{left:"top",right:"bottom",top:"left",bottom:"right","inset-block-start":"inset-block-end","inset-block-end":"inset-block-start","inset-inline-start":"inset-inline-end","inset-inline-end":"inset-inline-start","inset-block":"inset-inline","inset-inline":"inset-block"}},Zl={"flip-block":{top:"bottom",bottom:"top",start:"end",end:"start","self-end":"self-start","self-start":"self-end"},"flip-inline":{left:"right",right:"left",start:"end",end:"start","self-end":"self-start","self-start":"self-end"},"flip-start":{top:"left",left:"top",right:"bottom",bottom:"right"}},ec={"flip-block":{top:"bottom",bottom:"top",start:"end",end:"start"},"flip-inline":{left:"right",right:"left",start:"end",end:"start"},"flip-start":{}};const tc=(e,t)=>{var n;return(null==(n=il(`#id{${e}: ${t};}`).children.first)?void 0:n.block.children.first).value};function nc(e,t){const n={};return Object.entries(e).forEach(([e,r])=>{const i=e,o=tc(i,r),s=function(e,t){return Xl[t][e]||e}(i,t);s!==i&&(null!=n[i]||(n[i]="revert")),ra(o,{visit:"Function",enter(e){rl(e)&&e.children.forEach(e=>{yc(e)&&ma(e.name)&&(e.name=function(e,t){return Zl[t][e]||e}(e.name,t))})}}),"position-area"===i&&o.children.forEach(e=>{yc(e)&&El(e.name)&&(e.name=function(e,t){if("flip-start"===t)return e;{const n=ec[t];return e.split("-").map(e=>n[e]||e).join("-")}}(e.name,t))}),i.startsWith("margin")&&function(e,t,n){if("margin"===e){const[e,r,i,o]=t.children.toArray();"flip-block"===n?o?t.children.fromArray([i,r,e,o]):i&&t.children.fromArray([i,r,e]):"flip-inline"===n&&o&&t.children.fromArray([e,o,i,r])}else if("margin-block"===e){const[e,r]=t.children.toArray();"flip-block"===n&&r&&t.children.fromArray([r,e])}else if("margin-inline"===e){const[e,r]=t.children.toArray();"flip-inline"===n&&r&&t.children.fromArray([r,e])}}(i,o,t),n[s]=ol(o)}),n}function rc(e){const t=function(e){return e.toArray().reduce((e,t)=>"Operator"===t.type&&","===t.value?(e.push([]),e):("Identifier"===t.type&&e[e.length-1].push(t),e),[[]])}(e),n=[];return t.forEach(e=>{const t={atRules:[],tactics:[],positionAreas:[]};e.forEach(e=>{!function(e){return Kl.includes(e)}(e.name)?e.name.startsWith("--")?t.atRules.push(e.name):El(e.name)&&t.positionAreas.push(e.name):t.tactics.push(e.name)}),t.positionAreas.length?n.push({positionArea:t.positionAreas[0],type:"position-area"}):t.atRules.length&&t.tactics.length?n.push({tactics:t.tactics,atRule:t.atRules[0],type:"at-rule-with-try-tactic"}):t.atRules.length?n.push({atRule:t.atRules[0],type:"at-rule"}):t.tactics.length&&n.push({tactics:t.tactics,type:"try-tactic"})}),n}function ic(e){if(function(e){return"Declaration"===e.type&&"position-try"===e.property}(e)&&e.value.children.first){const t=Yt(e);let n;const r=t.value.children.first.name;r&&function(e){return Gl.includes(e)}(r)&&(n=r,t.value.children.shift());return{order:n,options:rc(t.value.children)}}return{}}function oc(e){const{order:t,options:n}=ic(e);if(t||n)return{order:t,options:n};const{order:r}=function(e){return function(e){return"Declaration"===e.type&&"position-try-order"===e.property}(e)&&e.value.children.first?{order:e.value.children.first.name}:{}}(e),i=function(e){return function(e){return"Declaration"===e.type&&"position-try-fallbacks"===e.property}(e)&&e.value.children.first?rc(e.value.children):[]}(e);return r||i?{order:r,options:i}:{}}function sc(e){return oa(e.property)||function(e){return sa.includes(e)}(e.property)||la(e.property)||function(e){return ca.includes(e)}(e.property)||["position-anchor","position-area"].includes(e.property)}function ac(e){var t,n;if(function(e){return"Atrule"===e.type&&"position-try"===e.name}(e)&&null!=(t=e.prelude)&&t.value&&null!=(n=e.block)&&n.children){const t=e.prelude.value,n=e.block.children.filter(e=>function(e){return"Declaration"===e.type}(e)&&sc(e));return{name:t,tryBlock:{uuid:`${t}-try-${el(12)}`,declarations:Object.fromEntries(n.map(e=>[e.property,ol(e.value)]))}}}return{}}function lc(e){return!(!e||e!==e.window)}function cc(e){return!(!e||!function(e){return dl(e,"position","fixed")}(e)&&!dl(e,"position","absolute"))}function hc(e,t){return e.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_FOLLOWING}function uc(e){return Qe(this,null,function*(){if(!["absolute","fixed"].includes(pl(e,"position")))return yield function(e){return Qe(this,null,function*(){return yield Vt.getOffsetParent(e)})}(e);let t=e.parentElement;for(;t;){if(!dl(t,"position","static")&&dl(t,"display","block"))return t;t=t.parentElement}return window})}function pc(e,t,n,r){return Qe(this,null,function*(){const i=yield uc(e),o=yield uc(n);if(!function(e,t){return!(!e||e===t)&&(lc(e)?e.document.contains(t):e.contains(t))}(o,e)&&!lc(o)||i===o&&cc(e)&&!hc(e,n))return!1;if(i!==o){let e;const t=[];for(e=i;e&&e!==o&&e!==window;)t.push(e),e=yield uc(e);const r=t[t.length-1];if(r instanceof HTMLElement&&cc(r)&&!hc(r,n))return!1}{let t=e.parentElement;for(;t;){if(dl(t,"content-visibility","hidden"))return!1;t=t.parentElement}}return!(t&&r&&dc(e,t,r)!==dc(n,t,r))})}function dc(e,t,n){for(;!e.matches(n)||!gl(e,t);){if(!e.parentElement)return null;e=e.parentElement}return e}function mc(e,t,n,r,i){return Qe(this,null,function*(){if(!(e instanceof HTMLElement&&n.length&&cc(e)))return null;const o=n.flatMap(e=>function(e,t){const{elementPart:n,pseudoElementPart:r}=e,i=[];if(r&&"::before"!==r&&"::after"!==r)return i;const o=kl(t.roots,n);if(!r)return i.push(...o),i;for(const t of o){const{fakePseudoElement:n,sheet:r,computedStyle:o}=ml(t,e),s=n.getBoundingClientRect(),{scrollY:a,scrollX:l}=globalThis,c=fl(t);i.push({fakePseudoElement:n,computedStyle:o,removeFakePseudoElement(){n.remove(),r.remove()},contextElement:t,getBoundingClientRect(){const{scrollY:e,scrollX:t}=globalThis,{scrollTop:n,scrollLeft:r}=c;return DOMRect.fromRect({y:s.y+(a-e)+(c.scrollTop-n),x:s.x+(l-t)+(c.scrollLeft-r),width:s.width,height:s.height})}})}return i}(e,i)).filter(e=>function(e,t){const n=pl(e,"anchor-name");return t?n.split(",").map(e=>e.trim()).includes(t):!n}(e,t)),s=r.map(e=>e.selector).join(",")||null;for(let n=o.length-1;n>=0;n--){const r=o[n],i="fakePseudoElement"in r;if(yield pc(i?r.fakePseudoElement:r,t,e,s))return i&&r.removeFakePseudoElement(),r}return null})}function fc(e){return"Declaration"===e.type&&"anchor-name"===e.property}function gc(e){return"Declaration"===e.type&&"anchor-scope"===e.property}function bc(e){return!(!e||"Function"!==e.type||"anchor-size"!==e.name)}function kc(e){return!(!e||"Function"!==e.type||"var"!==e.name)}function yc(e){return!("Identifier"!==e.type||!e.name)}function vc(e,t){let n,r,i,o,s="",a=!1;const l=[];e.children.toArray().forEach(e=>{a?s=`${s}${ol(e)}`:"Operator"!==e.type||","!==e.value?l.push(e):a=!0});let[c,h]=l;if(h||(h=c,c=void 0),c&&(yc(c)&&c.name.startsWith("--")?n=c.name:kc(c)&&c.children.first&&(o=c.children.first.name)),h)if(rl(e)){if(yc(h)&&ma(h.name))r=h.name;else if(function(e){return!("Percentage"!==e.type||!e.value)}(h)){const e=Number(h.value);r=Number.isNaN(e)?void 0:e}}else bc(e)&&yc(h)&&function(e){return fa.includes(e)}(h.name)&&(i=h.name);const u=`--anchor-${el(12)}`;return Object.assign(e,{type:"Raw",value:`var(${u})`,children:null}),Reflect.deleteProperty(e,"name"),{anchorName:n,anchorSide:r,anchorSize:i,fallbackValue:s,customPropName:o,uuid:u}}function Sc(e){return e.value.children.map(({name:e})=>e)}let wc={},xc={},Cc={},Ac={},_c={};function Tc(e,t){var n;if((rl(e)||bc(e))&&t){if(t.property.startsWith("--")){const r=ol(t.value),i=vc(e);return Ac[i.uuid]=r,Cc[t.property]=[...null!=(n=Cc[t.property])?n:[],i],{changed:!0}}if(rl(e)&&oa(t.property)||bc(e)&&pa(t.property)){const n=vc(e);return{prop:t.property,data:n,changed:!0}}}return{}}function Lc(e,t,n){return Qe(this,null,function*(){let r=null==t?void 0:t.anchorName;const i=null==t?void 0:t.customPropName;if(e&&!r){const t=pl(e,"position-anchor");t?r=t:i&&(r=pl(e,i))}const o=r&&wc[r]||[],s=r&&xc[ul.All]||[],a=r&&xc[r]||[];return yield mc(e,r||null,o,[...s,...a],{roots:n.roots})})}function Ec(e,t){return Qe(this,null,function*(){var n,r,i,o,s,a,l,c,h,u,p;const d={},m={};wc={},xc={},Cc={},Ac={},_c={};const{fallbackTargets:f,validPositions:g}=function(e){const t={},n={},r={};for(const n of e){const e=il(n.css);ra(e,{visit:"Atrule",enter(e){const{name:n,tryBlock:r}=ac(e);n&&r&&(t[n]=r)}})}for(const i of e){let e=!1;const o=new Set,s=il(i.css);ra(s,{visit:"Declaration",enter(i){var s;const a=al(null==(s=this.rule)?void 0:s.prelude);if(!a.length)return;const{order:l,options:c}=oc(i),h={};l&&(h.order=l),a.forEach(({selector:i})=>{var s;null==c||c.forEach(r=>{var s;let a;if("at-rule"===r.type)a=r.atRule;else if("try-tactic"===r.type){a=`${i}-${r.tactics.join("-")}`;const e=Yl(i,r.tactics);e&&(t[a]={uuid:`${i}-${r.tactics.join("-")}-try-${el(12)}`,declarations:e})}else if("at-rule-with-try-tactic"===r.type){a=`${i}-${r.atRule}-${r.tactics.join("-")}`;const e=Jl(t[r.atRule],r.tactics);e&&(t[a]={uuid:`${i}-${r.atRule}-${r.tactics.join("-")}-try-${el(12)}`,declarations:e})}if(a&&t[a]){const r=`[data-anchor-polyfill="${t[a].uuid}"]`;null!=n[r]||(n[r]=[]),n[r].push(i),o.has(a)||(null!=h.fallbacks||(h.fallbacks=[]),h.fallbacks.push(t[a]),o.add(a),null==(s=this.stylesheet)||s.children.prependData({type:"Rule",prelude:{type:"Raw",value:r},block:{type:"Block",children:(new Kt).fromArray(Object.entries(t[a].declarations).map(([e,t])=>({type:"Declaration",important:!0,property:e,value:{type:"Raw",value:t}})))}}),e=!0)}}),Object.keys(h).length>0&&(r[i]?(h.order&&(r[i].order=h.order),h.fallbacks&&(null!=(s=r[i]).fallbacks||(s.fallbacks=[]),r[i].fallbacks.push(...h.fallbacks))):r[i]=h)})}}),e&&(i.css=ol(s),i.changed=!0)}return{fallbackTargets:n,validPositions:r}}(e);for(const t of e){let e=!1;const n=il(t.css);ra(n,function(t){var n,r,i,o;const s=al(null==(n=this.rule)?void 0:n.prelude);if(fc(t)&&s.length)for(const e of Sc(t))null!=wc[e]||(wc[e]=[]),wc[e].push(...s);if(gc(t)&&s.length)for(const e of Sc(t))null!=xc[e]||(xc[e]=[]),xc[e].push(...s);const{prop:a,data:l,changed:c}=Tc(t,this.declaration);if(a&&l&&s.length)for(const{selector:e}of s)d[e]=qe(He({},d[e]),{[a]:[...null!=(i=null==(r=d[e])?void 0:r[a])?i:[],l]});let h;if(this.block&&(h=Wl(t),h)){Vl(h,this.block);for(const{selector:e}of s)m[e]=[...null!=(o=m[e])?o:[],h]}(c||h)&&(e=!0)}),e&&(t.css=ol(n),t.changed=!0)}const b=new Set(Object.keys(Cc)),k={},y=e=>{var t,n,r,i,o;const s=[],a=new Set(null!=(n=null==(t=k[e])?void 0:t.names)?n:[]);for(;a.size>0;)for(const e of a)s.push(...null!=(r=Cc[e])?r:[]),a.delete(e),null!=(o=null==(i=k[e])?void 0:i.names)&&o.length&&k[e].names.forEach(e=>a.add(e));return s};for(;b.size>0;){const t=[];for(const n of e){let e=!1;const r=il(n.css);ra(r,{visit:"Function",enter(n){var r,i;const o=null==(r=this.rule)?void 0:r.prelude,s=this.declaration,a=null==s?void 0:s.property;if(!1===(null==o?void 0:o.children.isEmpty)&&kc(n)&&s&&a&&n.children.first&&b.has(n.children.first.name)&&a.startsWith("--")){const r=n.children.first,o=null!=(i=Cc[r.name])?i:[],l=y(r.name);if(!o.length&&!l.length)return;const c=`${r.name}-anchor-${el(12)}`,h=ol(s.value);Ac[c]=h,k[a]||(k[a]={names:[],uuids:[]});const u=k[a];u.names.includes(r.name)||u.names.push(r.name),u.uuids.push(c),t.push(a),r.name=c,e=!0}}}),e&&(n.css=ol(r),n.changed=!0)}b.clear(),t.forEach(e=>b.add(e))}for(const t of e){let e=!1;const n=il(t.css);ra(n,{visit:"Function",enter(t){var n,r,i,o,s,a,l;const c=null==(n=this.rule)?void 0:n.prelude,h=this.declaration,u=null==h?void 0:h.property;if(!1===(null==c?void 0:c.children.isEmpty)&&kc(t)&&h&&u&&t.children.first&&(oa(u)||la(u))){const n=t.children.first,h=null!=(r=Cc[n.name])?r:[],p=y(n.name);if(!h.length&&!p.length)return;const m=`${u}-${el(12)}`;if(p.length){const e=new Set([n.name]);for(;e.size>0;)for(const t of e){const n=k[t];if(null!=(i=null==n?void 0:n.names)&&i.length&&null!=(o=null==n?void 0:n.uuids)&&o.length)for(const e of n.names)for(const t of n.uuids)_c[t]=qe(He({},_c[t]),{[m]:`${e}-${m}`});e.delete(t),null!=(s=null==n?void 0:n.names)&&s.length&&n.names.forEach(t=>e.add(t))}}const f=al(c);for(const e of[...h,...p]){const t=He({},e),n=`--anchor-${el(12)}-${u}`,r=t.uuid;t.uuid=n;for(const{selector:e}of f)d[e]=qe(He({},d[e]),{[u]:[...null!=(l=null==(a=d[e])?void 0:a[u])?l:[],t]});_c[r]=qe(He({},_c[r]),{[m]:n})}n.name=`${n.name}-${m}`,e=!0}}}),e&&(t.css=ol(n),t.changed=!0)}if(Object.keys(_c).length>0)for(const t of e){let e=!1;const n=il(t.css);ra(n,{visit:"Function",enter(t){var n,r,i,o;if(kc(t)&&null!=(r=null==(n=t.children.first)?void 0:n.name)&&r.startsWith("--")&&null!=(o=null==(i=this.declaration)?void 0:i.property)&&o.startsWith("--")&&this.block){const n=t.children.first,r=_c[n.name];if(r)for(const[t,i]of Object.entries(r))this.block.children.appendData({type:"Declaration",important:!1,property:`${this.declaration.property}-${t}`,value:{type:"Raw",value:ol(this.declaration.value).replace(`var(${n.name})`,`var(${i})`)}}),e=!0;Ac[n.name]&&(this.declaration.value={type:"Raw",value:Ac[n.name]},e=!0)}}}),e&&(t.css=ol(n),t.changed=!0)}const v=new Map;for(const[e,c]of Object.entries(d)){let h;h=e.startsWith("[data-anchor-polyfill=")&&null!=(n=f[e])&&n.length?kl(t.roots,f[e].join(",")):kl(t.roots,e);for(const[n,u]of Object.entries(c))for(const c of u)for(const u of h){const h=yield Lc(u,c,{roots:t.roots}),p=`--anchor-${el(12)}`;v.set(u,qe(He({},null!=(r=v.get(u))?r:{}),{[c.uuid]:p})),u.setAttribute("style",`${c.uuid}: var(${p}); ${null!=(i=u.getAttribute("style"))?i:""}`),g[e]=qe(He({},g[e]),{declarations:qe(He({},null==(o=g[e])?void 0:o.declarations),{[n]:[...null!=(l=null==(a=null==(s=g[e])?void 0:s.declarations)?void 0:a[n])?l:[],qe(He({},c),{anchorEl:h,targetEl:u,uuid:p})]})})}}const S={el:document.createElement("link"),changed:!1,created:!0,css:""};e.push(S);for(const[e,n]of Object.entries(m)){const r=kl(t.roots,e);for(const i of r){const r=yield Lc(i,null,{roots:t.roots});for(const t of n){const n=yield ql(i,t,r);S.css+=Ql(n.targetUUID,t.selectorUUID),S.changed=!0,g[e]=qe(He({},g[e]),{declarations:qe(He({},null==(c=g[e])?void 0:c.declarations),{"position-area":[...null!=(p=null==(u=null==(h=g[e])?void 0:h.declarations)?void 0:u["position-area"])?p:[],n]})})}}}return{rules:g,inlineStyles:v,anchorScopes:xc}})}const Oc=["as","blocking","crossorigin","disabled","fetchpriority","href","hreflang","integrity","referrerpolicy","rel","type"];function Pc(e,t,n=!1){const r=[];for(const{el:i,css:o,changed:s,created:a=!1}of e){const e={el:i,css:o,changed:!1};if(s)if("style"===i.tagName.toLowerCase())i.innerHTML=o;else if(i instanceof HTMLLinkElement){const t=document.createElement("style");t.textContent=o;for(const e of i.getAttributeNames())if(!e.startsWith("on")&&!Oc.includes(e)){const n=i.getAttribute(e);null!==n&&t.setAttribute(e,n)}i.hasAttribute("href")&&t.setAttribute("data-original-href",i.getAttribute("href")),a?(t.setAttribute("data-generated-by-polyfill","true"),document.head.insertAdjacentElement("beforeend",t)):(i.insertAdjacentElement("beforebegin",t),i.remove()),e.el=t}else if(i.hasAttribute("data-has-inline-styles")){const e=i.getAttribute("data-has-inline-styles");if(e){const n=`[data-has-inline-styles="${e}"]{`;let r=o.slice(n.length,-1);const s=null==t?void 0:t.get(i);if(s)for(const[e,t]of Object.entries(s))r=`${e}: var(${t}); ${r}`;i.setAttribute("style",r)}}n&&i.hasAttribute("data-has-inline-styles")&&i.removeAttribute("data-has-inline-styles"),r.push(e)}return r}const Dc=qe(He({},Vt),{_c:new Map}),Fc=e=>{switch(e){case"top":case"bottom":case"inset-block-start":case"inset-block-end":return"y";case"left":case"right":case"inset-inline-start":case"inset-inline-end":return"x"}return null},Mc=e=>"inline"===pl(e,"display"),zc=(e,t)=>("x"===t?["border-left-width","border-right-width"]:["border-top-width","border-bottom-width"]).reduce((t,n)=>t+parseInt(pl(e,n),10),0)||0,jc=(e,t)=>parseInt(pl(e,`margin-${t}`),10)||0,Ic=e=>({top:jc(e,"top"),right:jc(e,"right"),bottom:jc(e,"bottom"),left:jc(e,"left")}),Nc=e=>Qe(null,[e],function*({targetEl:e,targetProperty:t,anchorRect:n,anchorSide:r,anchorSize:i,fallback:o=null}){var s;if(!i&&void 0===r||!e||!n)return o;if(i){if(!pa(t))return o;let r;switch(i){case"width":case"height":r=i;break;default:{let t=!1;const n=pl(e,"writing-mode");t=n.startsWith("vertical-")||n.startsWith("sideways-"),r=((e,t)=>{let n;switch(e){case"block":case"self-block":n=t?"width":"height";break;case"inline":case"self-inline":n=t?"height":"width"}return n})(i,t)}}return r?`${n[r]}px`:o}if(void 0!==r){let i,a;const l=Fc(t);if(!oa(t)||!l||oa(r)&&l!==Fc(r))return o;const c=["top","left","inset-block-start","inset-inline-start"],h=["bottom","right","inset-block-end","inset-inline-end"];switch(r){case"left":case"top":i=0;break;case"right":case"bottom":i=100;break;case"center":i=50;break;case"inside":i=c.includes(t)?0:100;break;case"outside":i=c.includes(t)?100:0;break;default:if(e){i=((e,t)=>{let n;switch(e){case"start":case"self-start":n=0;break;case"end":case"self-end":n=100;break;default:"number"==typeof e&&!Number.isNaN(e)&&(n=e)}if(void 0!==n)return t?100-n:n})(r,(yield null==(s=Vt.isRTL)?void 0:s.call(Vt,e))||!1)}}const u="number"==typeof i&&!Number.isNaN(i),p=(e=>{switch(e){case"x":return"width";case"y":return"height"}return null})(l);if(u&&p){h.includes(t)&&(a=yield bl(e));let r=n[l]+n[p]*(i/100);switch(t){case"bottom":case"inset-block-end":{if(!a)break;let e=a.clientHeight;if(0===e&&Mc(a)){const t=zc(a,l);e=a.offsetHeight-t}r=e-r;break}case"right":case"inset-inline-end":{if(!a)break;let e=a.clientWidth;if(0===e&&Mc(a)){const t=zc(a,l);e=a.offsetWidth-t}r=e-r;break}}return`${r}px`}}return o}),Rc=e=>"wrapperEl"in e,Bc=e=>"uuid"in e;function $c(e,t=!1){return Qe(this,null,function*(){const n=document.documentElement;for(const[r,i]of Object.entries(e))for(const e of i){const i=e.anchorEl,o=e.targetEl;if(i&&o)if(Rc(e)){const r=e.wrapperEl,s=(e,t,n)=>Qe(null,null,function*(){return 0===e?"0px":yield Nc({targetEl:r,targetProperty:t,anchorRect:n,anchorSide:e})});qt(i,r,()=>Qe(null,null,function*(){const t=pl(o,Cl);r.setAttribute(Al,t);const a=yield Vt.getElementRects({reference:i,floating:r,strategy:"absolute"}),l=e.insets,c=yield s(l.block[0],"top",a.reference),h=yield s(l.block[1],"bottom",a.reference),u=yield s(l.inline[0],"left",a.reference),p=yield s(l.inline[1],"right",a.reference);n.style.setProperty(`${e.targetUUID}-top`,c||null),n.style.setProperty(`${e.targetUUID}-left`,u||null),n.style.setProperty(`${e.targetUUID}-right`,p||null),n.style.setProperty(`${e.targetUUID}-bottom`,h||null),n.style.setProperty(`${e.targetUUID}-justify-self`,e.alignments.inline),n.style.setProperty(`${e.targetUUID}-align-self`,e.alignments.block)}),{animationFrame:t})}else qt(i,o,()=>Qe(null,null,function*(){const t=yield Vt.getElementRects({reference:i,floating:o,strategy:"absolute"}),s=yield Nc({targetEl:o,targetProperty:r,anchorRect:t.reference,anchorSide:e.anchorSide,anchorSize:e.anchorSize,fallback:e.fallbackValue});n.style.setProperty(e.uuid,s)}),{animationFrame:t});else if(Bc(e)){const t=yield Nc({targetProperty:r,anchorSide:e.anchorSide,anchorSize:e.anchorSize,fallback:e.fallbackValue});n.style.setProperty(e.uuid,t)}}})}function Uc(e,t){return Qe(this,null,function*(){const n=yield Vt.getElementRects({reference:e,floating:e,strategy:"absolute"});return yield Qt({x:e.offsetLeft,y:e.offsetTop,platform:Dc,rects:n,elements:{floating:e,reference:t},strategy:"absolute"},{padding:Ic(e)})})}function Wc(e,t,n=!1){return Qe(this,null,function*(){if(!t.length)return;const r=document.querySelectorAll(e);for(const e of r){let r=!1;const i=yield bl(e);qt({},e,()=>Qe(null,null,function*(){if(r)return;r=!0,e.removeAttribute("data-anchor-polyfill");const n=yield Uc(e,i);if(Object.values(n).every(e=>e<=0))return e.removeAttribute("data-anchor-polyfill-last-successful"),void(r=!1);for(const[n,{uuid:o}]of t.entries()){e.setAttribute("data-anchor-polyfill",o);const s=yield Uc(e,i);if(Object.values(s).every(e=>e<=0)){e.setAttribute("data-anchor-polyfill-last-successful",o),r=!1;break}if(n===t.length-1){const t=e.getAttribute("data-anchor-polyfill-last-successful");t?e.setAttribute("data-anchor-polyfill",t):e.removeAttribute("data-anchor-polyfill"),r=!1;break}}}),{animationFrame:n,layoutShift:!1})}})}function Vc(e){return Qe(this,null,function*(){const t=function(e={}){const t="boolean"==typeof e?{useAnimationFrame:e}:e,n=void 0===t.useAnimationFrame?!!window.UPDATE_ANCHOR_ON_ANIMATION_FRAME:t.useAnimationFrame;return Array.isArray(t.elements)||(t.elements=void 0),(!Array.isArray(t.roots)||0===t.roots.length)&&(t.roots=[document]),Object.assign(t,{useAnimationFrame:n})}(null!=e?e:window.ANCHOR_POSITIONING_POLYFILL_OPTIONS);let n,r=yield wl(t),i={};nl.clear();try{(function(e){for(const t of e){let e=!1;const n=il(t.css,!0);ra(n,{visit:"Declaration",enter(t){var n;const r=null==(n=this.rule)?void 0:n.block,{updated:i}=hl(t,r),{updated:o}=cl(t,r);(o||i)&&(e=!0)}}),e&&(t.css=ol(n),t.changed=!0)}return e.some(e=>!0===e.changed)})(r)&&(r=Pc(r));const e=yield Ec(r,{roots:t.roots});i=e.rules,n=e.inlineStyles}catch(e){throw nl.size>0&&nl.forEach(e=>{}),e}return Object.values(i).length&&(Pc(r,n,!0),yield function(e,t=!1){return Qe(this,null,function*(){var n,r;for(const r of Object.values(e))yield $c(null!=(n=r.declarations)?n:{},t);for(const[n,i]of Object.entries(e))yield Wc(n,null!=(r=i.fallbacks)?r:[],t)})}(i,t.useAnimationFrame)),i})}let Hc=!1;const qc=(e,t,n)=>{if(!e.hasAttribute(t))return n;const r=e.getAttribute(t);return""===r||"true"===r};class Qc extends HTMLElement{constructor(e={}){super(),this.params={...e},Hc||(Vc(),Hc=!0),this.bindHandlers(),this.isEventsBound=!1,this.initialize(e)}initialize(e={}){const t=this.resolveConfig(e);this.translations=new Ie(t.language,t.customTranslations),this.selectorOptions=new Me({translations:this.translations,presetThemesAllowed:t.presetThemesAllowed,customThemesAllowed:t.customThemesAllowed,customPresets:t.customPresets});const n=this.initColors();this.initDensity();const r=((e={})=>{const t=ce("div","h5p-theme-picker"),n=ce("div","h5p-theme-picker-details"),r=new Te({translations:e.translations,densityAllowed:e.densityAllowed}),i=new me({translations:e.translations,customColorButtons:e.customColorButtons,customColorNavigation:e.customColorNavigation,customColorAlternative:e.customColorAlternative,customColorBackground:e.customColorBackground}),o=new Ce({translations:e.translations});return t.append(r,n),n.append(i,o),{dom:t,selector:r,colorSelector:i,preview:o,details:n}})({translations:this.translations,customColorButtons:this.selectedThemeColors["--h5p-theme-main-cta-base"],customColorNavigation:this.selectedThemeColors["--h5p-theme-secondary-cta-base"],customColorAlternative:this.selectedThemeColors["--h5p-theme-alternative-base"],customColorBackground:this.selectedThemeColors["--h5p-theme-background"],densityAllowed:t.densityAllowed}),{dom:i,selector:o,colorSelector:s,preview:a,details:l}=r;this.dom=i,this.selector=o,this.colorSelector=s,this.preview=a,this.details=l,this.initComponents(n)}resolveConfig(e={}){return{language:this.getAttribute("language")||e.language,customTranslations:this.getAttribute("translations")??e.translations??{},customPresets:this.getAttribute("custom-presets")??e.customPresets??{},presetThemesAllowed:qc(this,"preset-themes-allowed",e.presetThemesAllowed??!0),customThemesAllowed:qc(this,"custom-themes-allowed",e.customThemesAllowed??!0),densityAllowed:qc(this,"density-allowed",e.densityAllowed??!0)}}initColors(){const e=this.selectorOptions.getThemeOptions().entries().next().value;if(!e)throw new Error("ThemePicker: No theme options available.");const[t,n]=e;let r;return this.params.theme=this.params.theme||this.getAttribute("theme-name")||t,this.params.theme&&this.selectorOptions.getThemeOptions().has(this.params.theme)?r=this.selectorOptions.getThemeOptions().get(this.params.theme):(r=n,this.params.theme=t),"custom"===this.params.theme?this.selectedThemeColors=oe(this.getAttribute("custom-color-buttons")||n.values["--h5p-theme-main-cta-base"],this.getAttribute("custom-color-navigation")||n.values["--h5p-theme-secondary-cta-base"],ie(this.getAttribute("custom-color-alternative")||n.values["--h5p-theme-alternative-base"]),this.getAttribute("custom-color-background")||n.values["--h5p-theme-background"]):this.selectedThemeColors=r.values,r}initDensity(){const e=this.selectorOptions.getDensityOptions().entries().next().value;if(!e)throw new Error("ThemePicker: no density options available.");const[t]=e;this.params.density=this.params.density||this.getAttribute("density")||t,"wide"===this.params.density?this.params.density="large":"compact"===this.params.density?this.params.density="small":this.selectorOptions.getDensityOptions().has(this.params.density)||(this.params.density=t)}initComponents(e){this.selector.setThemeOptions(this.selectorOptions.getThemeOptions()),this.selector.setDensityOptions(this.selectorOptions.getDensityOptions()),this.selector.setActiveTheme(this.params.theme),this.selectedDensity=this.params.density,this.selector.setActiveDensity(this.params.density),this.applyPreviewState({themeValues:this.selectedThemeColors,themeLabel:e.label,densityKey:this.selectedDensity}),this.colorSelector.toggleVisibility("custom"===this.params.theme),this.details.classList.toggle("open","custom"===this.params.theme)}getThemeValuesByKey(e){if("custom"===e){const e=this.colorSelector.getValues();return oe(e["--h5p-theme-main-cta-base"],e["--h5p-theme-secondary-cta-base"],ie(e["--h5p-theme-alternative-base"]),e["--h5p-theme-background"])}return this.selectorOptions.getThemeOptions().get(e)?.values??{}}applyPreviewState({themeValues:e=this.selectedThemeColors,themeLabel:t,densityKey:n=this.selectedDensity}={}){this.preview.setValues(e,t),this.preview.setValues(this.selectorOptions.getDensityOptions().get(n)?.values??{})}connectedCallback(){this.render(),this.isEventsBound||this.bindEvents()}disconnectedCallback(){this.isEventsBound&&this.unbindEvents()}handleThemeChange(e){const t=e?.detail?.key;if(!t||!this.selectorOptions.getThemeOptions().has(t))return;const n=this.getThemeValuesByKey(t);this.selectedThemeColors=n,this.applyPreviewState({themeValues:this.selectedThemeColors,themeLabel:this.selectorOptions.getThemeOptions().get(t)?.label,densityKey:this.selectedDensity}),this.colorSelector.toggleVisibility("custom"===t),this.details.classList.toggle("open","custom"===t),this.dispatchChangeEvent()}handleThemePreview(e){const t=e?.detail?.key;t&&this.applyPreviewState({themeValues:this.getThemeValuesByKey(t),themeLabel:this.selectorOptions.getThemeOptions().get(t)?.label,densityKey:this.selectedDensity})}handleThemePreviewReset(){this.applyPreviewState()}handleDensityChange(e){const t=e?.detail?.key;t&&this.selectorOptions.getDensityOptions().has(t)&&(this.selectedDensity=t,this.applyPreviewState({densityKey:t}),this.dispatchChangeEvent())}handleDensityPreview(e){const t=e?.detail?.key;t&&this.applyPreviewState({densityKey:t})}handleDensityPreviewReset(){this.applyPreviewState()}handleColorChange(e){if(!e?.detail?.id||!e?.detail?.color)return;const{id:t,color:n}=e.detail,r={buttons:this.selectedThemeColors["--h5p-theme-main-cta-base"],navigation:this.selectedThemeColors["--h5p-theme-secondary-cta-base"],alternative:this.selectedThemeColors["--h5p-theme-alternative-base"],background:this.selectedThemeColors["--h5p-theme-background"]};r[t]=n,this.selectedThemeColors=oe(r.buttons,r.navigation,ie(r.alternative),r.background),this.applyPreviewState(),this.dispatchChangeEvent()}bindHandlers(){this.handleThemeChange=this.handleThemeChange.bind(this),this.handleThemePreview=this.handleThemePreview.bind(this),this.handleThemePreviewReset=this.handleThemePreviewReset.bind(this),this.handleDensityChange=this.handleDensityChange.bind(this),this.handleDensityPreview=this.handleDensityPreview.bind(this),this.handleDensityPreviewReset=this.handleDensityPreviewReset.bind(this),this.handleColorChange=this.handleColorChange.bind(this)}unbindEvents(){this.selector.removeEventListener("theme-change",this.handleThemeChange),this.selector.removeEventListener("theme-preview",this.handleThemePreview),this.selector.removeEventListener("theme-preview-reset",this.handleThemePreviewReset),this.selector.removeEventListener("density-change",this.handleDensityChange),this.selector.removeEventListener("density-preview",this.handleDensityPreview),this.selector.removeEventListener("density-preview-reset",this.handleDensityPreviewReset),this.colorSelector.removeEventListener("change",this.handleColorChange),this.isEventsBound=!1}bindEvents(){this.selector.addEventListener("theme-change",this.handleThemeChange),this.selector.addEventListener("theme-preview",this.handleThemePreview),this.selector.addEventListener("theme-preview-reset",this.handleThemePreviewReset),this.selector.addEventListener("density-change",this.handleDensityChange),this.selector.addEventListener("density-preview",this.handleDensityPreview),this.selector.addEventListener("density-preview-reset",this.handleDensityPreviewReset),this.colorSelector.addEventListener("change",this.handleColorChange),this.isEventsBound=!0}dispatchChangeEvent(){this.dispatchEvent(new CustomEvent("theme-change",{detail:this.getValue(),bubbles:!0,composed:!0}))}getValue(){return{theme:this.selector.getActiveTheme(),data:{colors:this.selectedThemeColors,density:this.selectedDensity}}}render(){this.contains(this.dom)||this.append(this.dom)}}customElements.get("h5p-theme-picker")||customElements.define("h5p-theme-picker",Qc)})();
|