@rcarls/rc-common 0.5.0 → 0.6.0
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/CHANGELOG.md +20 -0
- package/README.md +45 -4
- package/dist/rc-common.js +311 -175
- package/dist/rc-common.umd.cjs +9 -9
- package/dist/types/AnchorController.d.ts +48 -1
- package/dist/types/RovingTabIndexMixin.d.ts +1 -1
- package/dist/types/clickDelegate.d.ts +116 -0
- package/dist/types/index.d.ts +21 -20
- package/package.json +1 -1
- package/dist/types/DragGestureController.test.d.ts +0 -1
- package/dist/types/KeyboardInteractionDirective.test.d.ts +0 -1
- package/dist/types/KeyboardNavigationDirective.test.d.ts +0 -1
- package/dist/types/MouseMoveDirective.test.d.ts +0 -1
- package/dist/types/MutationObserverController.test.d.ts +0 -1
- package/dist/types/RafScheduler.test.d.ts +0 -1
- package/dist/types/ScrollObserverController.test.d.ts +0 -1
- package/dist/types/TypeaheadController.test.d.ts +0 -1
- package/dist/types/isFocusable.test.d.ts +0 -1
- package/dist/types/nativeChild.test.d.ts +0 -1
- package/dist/types/snapUtils.unit.test.d.ts +0 -1
package/dist/rc-common.umd.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(function(S,Et){typeof exports=="object"&&typeof module<"u"?Et(exports,require("lit"),require("lit/directive.js"),require("lit/async-directive.js"),require("lit/decorators.js")):typeof define=="function"&&define.amd?define(["exports","lit","lit/directive.js","lit/async-directive.js","lit/decorators.js"],Et):(S=typeof globalThis<"u"?globalThis:S||self,Et(S["rc-common"]={},S.lit,S.litDirective,S.litAsyncDirective,S.litDecorators))})(this,(function(S,Et,He,$t,Do){"use strict";let Io=0;class Ro{constructor(t,n){this._activeItem=null,this._activeIndex=-1,this._itemCounter=0,this._opts=n,this._instanceId=`rc-adc-${++Io}`,t.addController(this)}hostConnected(){}hostDisconnected(){this.clear()}get activeItem(){return this._activeItem}get activeIndex(){return this._activeIndex}navigate(t){const n=this._opts.items();if(n.length===0)return;const i=this._opts.wrap??!0;let s=this._activeIndex<0?t>0?-1:n.length:this._activeIndex;const r=n.length;let l=0;do if(s+=t,i?s=(s%r+r)%r:s=Math.max(0,Math.min(r-1,s)),l++,!this._isSkipped(n[s]))break;while(l<r);this._setActive(n[s]??null,s)}navigateToFirst(){const t=this._opts.items(),n=t.findIndex(i=>!this._isSkipped(i));n>=0&&this._setActive(t[n],n)}navigateToLast(){const t=this._opts.items();let n=-1;for(let i=t.length-1;i>=0;i--)if(!this._isSkipped(t[i])){n=i;break}n>=0&&this._setActive(t[n],n)}navigateTo(t){const i=this._opts.items()[t];i&&!this._isSkipped(i)&&this._setActive(i,t)}navigateToItem(t){const i=this._opts.items().indexOf(t);i>=0&&!this._isSkipped(t)&&this._setActive(t,i)}clear(){this._activeItem?.removeAttribute("data-active"),this._activeItem=null,this._activeIndex=-1;const t=this._opts.host();t&&t.removeAttribute("aria-activedescendant")}_isSkipped(t){return!t||t.hidden||t.getAttribute("aria-disabled")==="true"?!0:this._opts.isSkipped?.(t)??!1}_setActive(t,n){this._activeItem?.removeAttribute("data-active"),this._activeItem=t,this._activeIndex=n;const i=this._opts.host();if(i){if(!t){i.removeAttribute("aria-activedescendant");return}t.id||(t.id=`${this._instanceId}-${++this._itemCounter}`),i.setAttribute("aria-activedescendant",t.id),t.setAttribute("data-active",""),t.scrollIntoView({block:"nearest"})}}}const $e=class $e{constructor(t,n){this._ul=null,this._options=[],this._liElements=[],this._createLi=null,this._createOption=null,this._selectedValues=new Set,this._filterText="",this._filterStrategy="contains",this._checkmark=!1,this._optionsInitialized=!1,this._pendingTouchActivation=null,this._onPointerDown=i=>{const s=i,r=this._resolveOptionLi(s.target);if(r){if(s.pointerType==="touch"){if(this._pendingTouchActivation)return;this._pendingTouchActivation={pointerId:s.pointerId,li:r,startX:s.clientX,startY:s.clientY};return}this._activateLi(r,s)}},this._onPointerMove=i=>{const s=this._pendingTouchActivation,r=i;if(!s||r.pointerId!==s.pointerId)return;Math.hypot(r.clientX-s.startX,r.clientY-s.startY)>$e._TOUCH_TAP_THRESHOLD&&(this._pendingTouchActivation=null)},this._onPointerUp=i=>{const s=this._pendingTouchActivation,r=i;!s||r.pointerId!==s.pointerId||(this._pendingTouchActivation=null,this._activateLi(s.li,r))},this._onPointerCancel=i=>{const s=i;this._pendingTouchActivation?.pointerId===s.pointerId&&(this._pendingTouchActivation=null)},this._host=t,this._idPrefix=n.idPrefix,this._onInitFromDom=n.onInitFromDom,this._onActivate=n.onActivate,t.addController(this)}hostConnected(){this._host.addEventListener("pointerdown",this._onPointerDown),this._host.addEventListener("pointermove",this._onPointerMove),this._host.addEventListener("pointerup",this._onPointerUp),this._host.addEventListener("pointercancel",this._onPointerCancel),this._optionsInitialized||this._bootstrapFromDom()}hostDisconnected(){this._host.removeEventListener("pointerdown",this._onPointerDown),this._host.removeEventListener("pointermove",this._onPointerMove),this._host.removeEventListener("pointerup",this._onPointerUp),this._host.removeEventListener("pointercancel",this._onPointerCancel),this._pendingTouchActivation=null}get allOptions(){return this._options}get selectedValues(){return[...this._selectedValues]}get filterText(){return this._filterText}isSelected(t){return this._selectedValues.has(t)}optionForElement(t){if(t===this._createLi)return this._createOption;const n=this._liElements.indexOf(t);return n===-1?null:this._options[n]??null}get navigableItems(){const t=[];for(let n=0;n<this._liElements.length;n++){const i=this._liElements[n];this._options[n]?.disabled||i.hidden||t.push(i)}return this._createLi!==null&&t.push(this._createLi),t}set checkmark(t){this._checkmark!==t&&(this._checkmark=t,this._syncCheckmarks())}setOptions(t){this._optionsInitialized=!0,this._options=[...t],this._ensureContainer(),this._syncOptionsToDom()}appendOption(t){this._optionsInitialized=!0,this._options=[...this._options,t],this._ensureContainer();const n=this._createLiElement(t,this._options.length-1);this._liElements.push(n),this._createLi?this._ul.insertBefore(n,this._createLi):this._ul.appendChild(n),this._applyFilterToLi(n,t)}setSelectedValues(t){const n=new Set(this._options.filter(i=>i.kind==="action").map(i=>i.value));this._createOption&&n.add(this._createOption.value),this._selectedValues=new Set(t.filter(i=>!n.has(i))),this._syncSelectedToDom()}filterOptions(t,n="contains"){this._filterText=t,this._filterStrategy=n,this._syncFilterToDom()}clearFilter(){this._filterText="",this._syncFilterToDom()}setCreateOption(t){if(t===null){this._createLi?.remove(),this._createLi=null,this._createOption=null;return}const n=t.trim();if(this._createOption={kind:"action",action:"create",value:`create:${n}`,label:`Create "${n}"`,data:{text:n}},!this._createLi){this._ensureContainer();const i=document.createElement("li");i.setAttribute("id",`${this._idPrefix}-create`),i.setAttribute("role","option"),i.setAttribute("aria-selected","false"),i.setAttribute("part","option create-option"),this._checkmark&&this._ensureCheckmark(i),this._ul.appendChild(i),this._createLi=i}this._createLi.setAttribute("data-value",this._createOption.value),this._createLi.setAttribute("data-kind","action"),this._createLi.setAttribute("data-action",this._createOption.action),this._setLabelText(this._createLi,this._createOption.label)}_ensureContainer(){if(this._ul)return this._ul;let t=this._host.querySelector(":scope > ul");return t||(t=document.createElement("ul"),this._host.appendChild(t)),t.setAttribute("role","presentation"),t.setAttribute("aria-hidden","true"),this._ul=t,t}_bootstrapFromDom(){const t=this._host.querySelector(":scope > ul");if(!t)return;this._ul=t,t.setAttribute("role","presentation"),t.setAttribute("aria-hidden","true");const n=Array.from(t.querySelectorAll(":scope > li"));if(n.length===0)return;const i=[];for(let s=0;s<n.length;s++){const r=n[s],l=r.getAttribute("data-value")??r.getAttribute("value")??r.textContent?.trim()??"",c=r.textContent?.trim()??"",a=r.hasAttribute("disabled")||r.getAttribute("aria-disabled")==="true";i.push({value:l,label:c,disabled:a}),r.setAttribute("role","option"),r.setAttribute("id",`${this._idPrefix}-${s}`),r.setAttribute("part","option"),r.setAttribute("data-value",l),r.setAttribute("aria-selected",this._selectedValues.has(l)?"true":"false"),r.setAttribute("aria-disabled",a?"true":"false"),this._checkmark&&this._ensureCheckmark(r)}this._options=i,this._liElements=n,this._onInitFromDom?.(i)}_syncOptionsToDom(){const t=this._ensureContainer();for(const n of this._liElements)n.remove();this._liElements=[];for(let n=0;n<this._options.length;n++){const i=this._createLiElement(this._options[n],n);this._liElements.push(i),t.appendChild(i)}this._createLi&&t.appendChild(this._createLi),this._syncFilterToDom()}_createLiElement(t,n){const i=document.createElement("li");return i.setAttribute("role","option"),i.setAttribute("id",`${this._idPrefix}-${n}`),i.setAttribute("part","option"),i.setAttribute("data-value",t.value),i.setAttribute("data-kind",t.kind??"option"),t.kind==="action"?i.setAttribute("data-action",t.action):i.removeAttribute("data-action"),i.setAttribute("aria-selected",this._selectedValues.has(t.value)?"true":"false"),i.setAttribute("aria-disabled",t.disabled?"true":"false"),this._checkmark&&this._ensureCheckmark(i),this._setLabelText(i,t.label),i}_setLabelText(t,n){for(const i of t.childNodes)if(i.nodeType===Node.TEXT_NODE){i.textContent=n;return}t.appendChild(document.createTextNode(n))}_ensureCheckmark(t){if(t.querySelector('[part="option-checkmark"]'))return;const n=document.createElement("span");n.setAttribute("part","option-checkmark"),n.setAttribute("aria-hidden","true"),n.textContent="✓",t.insertBefore(n,t.firstChild)}_removeCheckmark(t){t.querySelector('[part="option-checkmark"]')?.remove()}_syncCheckmarks(){const t=this._createLi?[...this._liElements,this._createLi]:[...this._liElements];for(const n of t)this._checkmark?this._ensureCheckmark(n):this._removeCheckmark(n)}_syncSelectedToDom(){for(let t=0;t<this._liElements.length;t++){const n=this._options[t];n&&this._liElements[t].setAttribute("aria-selected",this._selectedValues.has(n.value)?"true":"false")}}_syncFilterToDom(){for(let t=0;t<this._liElements.length;t++){const n=this._options[t];n&&this._applyFilterToLi(this._liElements[t],n)}}_applyFilterToLi(t,n){t.hidden=!this._isVisible(n)}_isVisible(t){if(!this._filterText)return!0;const n=t.label.toLowerCase(),i=this._filterText.toLowerCase();return typeof this._filterStrategy=="function"?this._filterStrategy(n,i):this._filterStrategy==="contains"?n.includes(i):n.startsWith(i)}_resolveOptionLi(t){if(!t)return null;const n=t.closest("li[data-value]");return!n||n.getAttribute("role")!=="option"||n.parentElement!==this._ul?null:n}_activateLi(t,n){n.preventDefault(),n.stopPropagation();const i=this.optionForElement(t);i&&this._onActivate(i)}};$e._TOUCH_TAP_THRESHOLD=10;let We=$e;class Mo extends $t.AsyncDirective{constructor(t){if(super(t),this._options={},this._isPointerFocus=!1,this._onPointerdown=()=>{this._isPointerFocus=!0,this._target?.removeAttribute("data-interaction-mode")},this._onFocusin=()=>{this._isPointerFocus?this._isPointerFocus=!1:this._target?.setAttribute("data-interaction-mode","keyboard")},this._onKeydown=()=>{this._target?.setAttribute("data-interaction-mode","keyboard")},t.type!==He.PartType.ELEMENT)throw new Error("The `keyInteraction` directive must be used on an element.")}get _target(){return this._options.attributeTarget??this._element?.deref()}_init(){const t=this._element?.deref();t instanceof HTMLElement&&(t.addEventListener("pointerdown",this._onPointerdown,{capture:!0}),t.addEventListener("focusin",this._onFocusin),t.addEventListener("keydown",this._onKeydown))}render(t){return Et.nothing}update(t,[n]){this.isConnected&&this._element?.deref()===void 0&&(this._element=new WeakRef(t.element),this._init()),this._options=n??{}}disconnected(){const t=this._element?.deref();t instanceof HTMLElement&&(t.removeEventListener("pointerdown",this._onPointerdown,{capture:!0}),t.removeEventListener("focusin",this._onFocusin),t.removeEventListener("keydown",this._onKeydown))}reconnected(){this._init()}}const Fo=$t.directive(Mo);class jo extends $t.AsyncDirective{constructor(t){if(super(t),this._options={},t.type!==He.PartType.ELEMENT)throw new Error("The `keyNavigation` directive must be used on an element.")}get navigationAxis(){if(this._options.navigationAxis)return this._options.navigationAxis;switch(this._element?.deref()?.role){case"slider":case"tablist":case"toolbar":case"menubar":return this._element?.deref()?.ariaOrientation==="vertical"?"vertical":"horizontal";case"separator":return this._element?.deref()?.ariaOrientation==="vertical"?"horizontal":"vertical";default:return this._element?.deref()?.ariaOrientation==="horizontal"?"horizontal":"vertical"}}_normalizeKey(t){switch(t){case"Up":return"ArrowUp";case"Down":return"ArrowDown";case"Left":return"ArrowLeft";case"Right":return"ArrowRight";default:return t}}_onKeydown(t){const n=this._normalizeKey(t.key),i=this.navigationAxis,s=this._element?.deref(),r=i==="horizontal"&&s!=null&&getComputedStyle(s).direction==="rtl",l=i==="horizontal"?r?"ArrowLeft":"ArrowRight":"ArrowDown",c=i==="horizontal"?r?"ArrowRight":"ArrowLeft":"ArrowUp",a=i==="horizontal"?"ArrowDown":"ArrowRight",o=i==="horizontal"?"ArrowUp":"ArrowLeft";let h;this._options.handleNavAxis!==!1&&(n===l?h=t.shiftKey?"next-large":"next":n===c?h=t.shiftKey?"prev-large":"prev":n==="Home"?h="start":n==="End"&&(h="end")),!h&&this._options.handleOpenAxis&&(n===a?h="open-to-first":n===o&&(h="open-to-last")),h||(n==="Enter"?h=this._options.handleActivate?"activate":"toggle":n===" "&&this._options.handleActivate?h="activate":n==="Escape"&&this._options.handleEscape&&(h="escape")),h!=null&&(this._callback(h),t.stopPropagation(),t.preventDefault())}_init(){const t=this._element?.deref();t!=null&&t instanceof HTMLElement&&(this._keyDownHandle=this._onKeydown.bind(this),t.addEventListener("keydown",this._keyDownHandle))}render(t,n){return Et.nothing}update(t,[n,i]){this.isConnected&&this._element?.deref()===void 0&&(this._element=new WeakRef(t.element),this._init()),this._callback=n.bind(t.options?.host??t.element),this._options={...i}}disconnected(){const t=this._element?.deref();t!=null&&t instanceof HTMLElement&&t.removeEventListener("keydown",this._keyDownHandle)}reconnected(){this._init()}}const zo=$t.directive(jo);class $o extends $t.AsyncDirective{constructor(t){if(super(t),this._activePointerId=null,t.type!==He.PartType.ELEMENT)throw new Error("The `mouseMove` directive must be used on an element.");this._pointerDownHandle=this._onPointerDown.bind(this),this._pointerMoveHandle=this._onPointerMove.bind(this),this._pointerEndHandle=this._onPointerEnd.bind(this)}_onPointerDown(t){if(this._activePointerId!==null)return;t.preventDefault();const n=t.currentTarget;this._activePointerId=t.pointerId,this._capturePointer(n,t.pointerId),n.addEventListener("pointermove",this._pointerMoveHandle),n.addEventListener("pointerup",this._pointerEndHandle),n.addEventListener("pointercancel",this._pointerEndHandle),n.addEventListener("lostpointercapture",this._pointerEndHandle),n.focus()}_onPointerMove(t){t.pointerId===this._activePointerId&&(t.preventDefault(),this._callback(t))}_onPointerEnd(t){if(t.pointerId!==this._activePointerId)return;t.preventDefault();const n=t.currentTarget;this._releasePointer(n,t.pointerId),this._removePointerCycleListeners(n),this._activePointerId=null}_init(){const t=this._element?.deref();t&&(t.removeEventListener("pointerdown",this._pointerDownHandle),t.addEventListener("pointerdown",this._pointerDownHandle))}_removePointerCycleListeners(t){t.removeEventListener("pointermove",this._pointerMoveHandle),t.removeEventListener("pointerup",this._pointerEndHandle),t.removeEventListener("pointercancel",this._pointerEndHandle),t.removeEventListener("lostpointercapture",this._pointerEndHandle)}_capturePointer(t,n){try{t.setPointerCapture(n)}catch{}}_releasePointer(t,n){try{t.hasPointerCapture(n)&&t.releasePointerCapture(n)}catch{}}render(t){return Et.nothing}update(t,[n]){if(this._callback=n.bind(t.options?.host??t.element),!this.isConnected||!(t.element instanceof HTMLElement))return;const i=this._element?.deref();i!==t.element&&(i?.removeEventListener("pointerdown",this._pointerDownHandle),i&&this._removePointerCycleListeners(i),this._activePointerId=null,this._element=new WeakRef(t.element),this._init())}disconnected(){const t=this._element?.deref();t&&(t.removeEventListener("pointerdown",this._pointerDownHandle),this._removePointerCycleListeners(t),this._activePointerId=null)}reconnected(){this._init()}}const No=$t.directive($o);class Be{constructor(t,n){this._$target=null,this._pointerId=null,this._startX=0,this._startY=0,this._startTime=0,this._samples=[],this._activated=!1,this._rejected=!1,this._onPointerDown=i=>{if(this._pointerId!==null||!i.isPrimary&&i.pointerId!==1||i.pointerType==="mouse"&&i.button!==0||this._options.canStart?.(i)===!1)return;this._pointerId=i.pointerId,this._startX=i.clientX,this._startY=i.clientY,this._startTime=i.timeStamp,this._samples=[{x:i.clientX,y:i.clientY,time:i.timeStamp}],this._activated=!1,this._rejected=!1;const s=this._$target;s&&(s.addEventListener("pointermove",this._onPointerMove),s.addEventListener("pointerup",this._onPointerUp),s.addEventListener("pointercancel",this._onPointerCancel),s.addEventListener("lostpointercapture",this._onLostPointerCapture),this._options.activation==="immediate"&&this._activate(i))},this._onPointerMove=i=>{i.pointerId!==this._pointerId||this._rejected||(this._recordSample(i),!(!this._activated&&!this._resolveIntent(i))&&(this._options.onMove?.(this._detail(i)),this._options.preventDefault&&i.preventDefault()))},this._onPointerUp=i=>{i.pointerId===this._pointerId&&(this._recordSample(i),this._activated&&this._options.onEnd?.(this._detail(i)),this._finish())},this._onPointerCancel=i=>{this._cancel(i)},this._onLostPointerCapture=i=>{i.pointerId===this._pointerId&&this._cancel(i)},this._options={axis:"both",activation:"immediate",activationDistance:8,axisLockRatio:1.25,velocityWindow:100,minVelocityDuration:8,capture:!1,stopPropagation:!1,preventDefault:!0,focusOnStart:!1,...n},t.addController(this)}setOptions(t){Object.assign(this._options,t),this._bindTarget()}hostConnected(){this._bindTarget()}hostUpdated(){this._bindTarget()}hostDisconnected(){this._unbindTarget()}_resolveTarget(){const t=typeof this._options.target=="function"?this._options.target():this._options.target;return t instanceof HTMLElement?t:null}_bindTarget(){const t=this._resolveTarget();t!==this._$target&&(this._unbindTarget(),this._$target=t,this._$target?.addEventListener("pointerdown",this._onPointerDown,{capture:this._options.capture}))}_unbindTarget(){this._$target&&(this._$target.removeEventListener("pointerdown",this._onPointerDown,{capture:this._options.capture}),this._removeCycleListeners(this._$target),this._reset(),this._$target=null)}_resolveIntent(t){const n=t.clientX-this._startX,i=t.clientY-this._startY;if(Math.hypot(n,i)<this._options.activationDistance)return!1;const{axis:r,axisLockRatio:l}=this._options,c=Math.abs(n),a=Math.abs(i);return r==="x"&&c<a*l||r==="y"&&a<c*l?(this._rejected=!0,this._finish(),!1):(this._activate(t),!0)}_activate(t){const n=this._$target;!n||this._activated||(this._activated=!0,this._capturePointer(n,t.pointerId),this._options.focusOnStart&&n.focus(),this._options.stopPropagation&&t.stopPropagation(),this._options.preventDefault&&t.preventDefault(),this._options.onStart?.(this._detail(t)))}_cancel(t){t.pointerId===this._pointerId&&(this._activated&&this._options.onCancel?.(this._detail(t)),this._finish())}_finish(){const t=this._$target,n=this._pointerId;t&&(this._removeCycleListeners(t),n!==null&&this._releasePointer(t,n)),this._reset()}_removeCycleListeners(t){t.removeEventListener("pointermove",this._onPointerMove),t.removeEventListener("pointerup",this._onPointerUp),t.removeEventListener("pointercancel",this._onPointerCancel),t.removeEventListener("lostpointercapture",this._onLostPointerCapture)}_recordSample(t){this._samples.push({x:t.clientX,y:t.clientY,time:t.timeStamp});const n=t.timeStamp-this._options.velocityWindow;for(;this._samples.length>2&&this._samples[0].time<n;)this._samples.shift()}_detail(t){const n=this._samples[0],i=this._samples.at(-1)??n,s=i.time-n.time,r=s>=this._options.minVelocityDuration;return{event:t,pointerId:t.pointerId,pointerType:t.pointerType,startX:this._startX,startY:this._startY,x:t.clientX,y:t.clientY,deltaX:t.clientX-this._startX,deltaY:t.clientY-this._startY,duration:Math.max(0,t.timeStamp-this._startTime),velocityX:r?(i.x-n.x)/s*1e3:0,velocityY:r?(i.y-n.y)/s*1e3:0}}_capturePointer(t,n){try{t.setPointerCapture(n)}catch(i){if(!(i instanceof DOMException)||i.name!=="NotFoundError")throw i}}_releasePointer(t,n){try{t.hasPointerCapture(n)&&t.releasePointerCapture(n)}catch{}}_reset(){this._pointerId=null,this._samples=[],this._activated=!1,this._rejected=!1}}class Ho{constructor(t,n){this._dragging=!1,this._startLeft=0,this._startTop=0,this._opts={axis:"both",step:4,disabled:!1,handle:null,bounds:"viewport",...n},this._onKeyDown=this._handleKeyDown.bind(this),this._gesture=new Be(t,{target:()=>this._handle(),axis:this._opts.axis,canStart:i=>this._canStartGesture(i),onStart:i=>this._startDrag(i),onMove:i=>this._moveDrag(i),onEnd:()=>this._finishDrag(),onCancel:()=>this._finishDrag()}),t.addController(this)}setOptions(t){const n=this._handle();Object.assign(this._opts,t),this._gesture.setOptions({axis:this._opts.axis,target:()=>this._handle()});const i=this._handle();n!==i&&(this._detachFrom(n),this._attachTo(i))}hostConnected(){this._attachTo(this._handle())}hostDisconnected(){this._detachFrom(this._handle())}_handle(){return this._opts.handle??this._opts.target}_target(){return this._opts.target}_attachTo(t){t.addEventListener("keydown",this._onKeyDown),t.hasAttribute("tabindex")||t.setAttribute("tabindex","0")}_detachFrom(t){t.removeEventListener("keydown",this._onKeyDown)}_canStartGesture(t){return this._opts.disabled?!1:!t.target.closest('button, [role="button"], a')}_startDrag(t){const n=this._target(),i=n.getBoundingClientRect();getComputedStyle(n).position==="static"&&(n.style.position="fixed"),n.style.translate="none",n.style.inset="auto",n.style.margin="0",n.style.left=`${i.left}px`,n.style.top=`${i.top}px`,this._startLeft=i.left,this._startTop=i.top,this._dragging=!0}_moveDrag(t){if(!this._dragging)return;const n=this._target(),{axis:i}=this._opts,[s,r,l,c]=this._boundsRect(),a=i!=="y"?Math.min(Math.max(this._startLeft+t.deltaX,s),l-n.offsetWidth):parseFloat(n.style.left)||0,o=i!=="x"?Math.min(Math.max(this._startTop+t.deltaY,r),c-n.offsetHeight):parseFloat(n.style.top)||0;n.style.left=`${a}px`,n.style.top=`${o}px`}_finishDrag(){this._dragging&&(this._dragging=!1)}_handleKeyDown(t){if(this._opts.disabled||t.currentTarget!==t.target)return;const{axis:n}=this._opts,i=t.shiftKey?this._opts.step*10:this._opts.step;let s=0,r=0;switch(t.key){case"ArrowLeft":if(n==="y")return;s=-i;break;case"ArrowRight":if(n==="y")return;s=i;break;case"ArrowUp":if(n==="x")return;r=-i;break;case"ArrowDown":if(n==="x")return;r=i;break;default:return}const l=this._target();if(getComputedStyle(l).position==="static"){const d=l.getBoundingClientRect();l.style.position="fixed",l.style.translate="none",l.style.left=`${d.left}px`,l.style.top=`${d.top}px`}const[c,a,o,h]=this._boundsRect(),u=parseFloat(l.style.left)||0,f=parseFloat(l.style.top)||0;l.style.left=`${Math.min(Math.max(u+s,c),o-l.offsetWidth)}px`,l.style.top=`${Math.min(Math.max(f+r,a),h-l.offsetHeight)}px`,t.preventDefault(),t.stopPropagation()}_boundsRect(){const{bounds:t}=this._opts;if(!t||t==="viewport")return[0,0,window.innerWidth,window.innerHeight];if(t==="parent"){const i=this._opts.target.parentElement;if(!i)return[0,0,window.innerWidth,window.innerHeight];const s=i.getBoundingClientRect();return[s.left,s.top,s.right,s.bottom]}const n=t.getBoundingClientRect();return[n.left,n.top,n.right,n.bottom]}}function Fn(e){const t=e.getBoundingClientRect();return getComputedStyle(e).position==="static"&&(e.style.position="fixed"),e.style.translate="none",e.style.inset="auto",e.style.margin="0",e.style.boxSizing="border-box",e.style.left=`${t.left}px`,e.style.top=`${t.top}px`,e.style.width=`${t.width}px`,e.style.height=`${t.height}px`,t}class Wo{constructor(t,n){this._resizing=null,this._startW=0,this._startH=0,this._startLeft=0,this._startTop=0,this._lastDeltaX=0,this._lastDeltaY=0,this._velocityX=0,this._velocityY=0,this._pendingEdge=null,this._effectiveMinW=0,this._effectiveMinH=0,this._effectiveMaxW=1/0,this._effectiveMaxH=1/0,this._cornerBtn=null,this._opts={direction:"none",threshold:8,step:4,disabled:!1,minWidth:100,minHeight:60,handle:null,origin:"",bounds:"viewport",...n},this._onPointerMove=this._handlePointerMove.bind(this),this._onPointerLeave=this._handlePointerLeave.bind(this),this._onKeyDown=this._handleKeyDown.bind(this),this._gesture=new Be(t,{target:()=>this._handle()??this._target(),capture:!0,stopPropagation:!0,canStart:i=>this._canStartGesture(i),onStart:i=>this._startGestureResize(i),onMove:i=>this._moveGestureResize(i),onEnd:i=>this._endGestureResize(i),onCancel:()=>this._cancelResize()}),t.addController(this)}setOptions(t){const n=this._opts.handle;Object.assign(this._opts,t),this._gesture.setOptions({target:()=>this._handle()??this._target()}),n!==this._opts.handle&&(this._detachFromHandle(n),this._attachToHandle(this._opts.handle))}hostConnected(){if(this._opts.direction==="none")return;if(this._opts.handle){this._attachToHandle(this._opts.handle);return}const t=this._target();t.addEventListener("pointermove",this._onPointerMove),t.addEventListener("pointerleave",this._onPointerLeave),this._injectCornerButton()}hostDisconnected(){if(this._opts.handle){this._detachFromHandle(this._opts.handle);return}const t=this._target();t.removeEventListener("pointermove",this._onPointerMove),t.removeEventListener("pointerleave",this._onPointerLeave),this._removeCornerButton()}_target(){return this._opts.target}_handle(){return this._opts.handle}_attachToHandle(t){!t||this._opts.direction==="none"||(t.addEventListener("keydown",this._onKeyDown),t.style.cursor=this._edgeCursor(this._handleEdge()),t.style.touchAction="none",t.hasAttribute("tabindex")||t.setAttribute("tabindex","0"))}_detachFromHandle(t){t&&t.removeEventListener("keydown",this._onKeyDown)}_injectCornerButton(){if(this._opts.handle)return;const t=this._target();getComputedStyle(t).position==="static"&&(t.style.position="relative");const n=document.createElement("button");n.setAttribute("data-rc-resize-corner",""),n.setAttribute("aria-label","Resize"),n.type="button",Object.assign(n.style,{position:"absolute",bottom:"0",right:"0",width:"12px",height:"12px",padding:"0",border:"none",background:"transparent",cursor:this._cornerCursor(),zIndex:"1"}),n.addEventListener("keydown",this._onKeyDown),t.appendChild(n),this._cornerBtn=n}_removeCornerButton(){this._cornerBtn&&(this._cornerBtn.removeEventListener("keydown",this._onKeyDown),this._cornerBtn.remove(),this._cornerBtn=null)}_cornerCursor(){switch(this._opts.direction){case"both":return"se-resize";case"horizontal":return"ew-resize";case"vertical":return"ns-resize";default:return"default"}}_edgeCursor(t){return{n:"n-resize",s:"s-resize",e:"e-resize",w:"w-resize",ne:"ne-resize",nw:"nw-resize",se:"se-resize",sw:"sw-resize"}[t]}_handleEdge(){return this._edgeForOrigin(this._opts.origin)??this._defaultHandleEdge()}_defaultHandleEdge(){switch(this._opts.direction){case"both":return"se";case"horizontal":return"e";case"vertical":return"s";default:return"se"}}_edgeForOrigin(t){if(!t)return null;const n=t.includes("top"),i=t.includes("bottom"),s=t.includes("left"),r=t.includes("right");if(this._opts.direction==="vertical")return n?"n":i?"s":null;if(this._opts.direction==="horizontal")return s?"w":r?"e":null;if(this._opts.direction==="both"){if(n&&s)return"nw";if(n&&r)return"ne";if(i&&s)return"sw";if(i&&r)return"se";if(n)return"n";if(i)return"s";if(s)return"w";if(r)return"e"}return null}_edgeAllowsPointer(t,n){const{threshold:i}=this._opts,s=this._target().getBoundingClientRect(),r=n.clientX,l=n.clientY,c=r>=s.right-i&&r<=s.right+i,a=r>=s.left-i&&r<=s.left+i,o=l>=s.bottom-i&&l<=s.bottom+i,h=l>=s.top-i&&l<=s.top+i,u=r>=s.left&&r<=s.right,f=l>=s.top&&l<=s.bottom;switch(t){case"n":return h&&u;case"s":return o&&u;case"e":return c&&f;case"w":return a&&f;case"ne":return h&&c;case"nw":return h&&a;case"se":return o&&c;case"sw":return o&&a}}_detectEdge(t){const{direction:n,threshold:i}=this._opts;if(n==="none")return null;const s=this._edgeForOrigin(this._opts.origin);if(s)return this._edgeAllowsPointer(s,t)?s:null;const r=this._target().getBoundingClientRect(),l=t.clientX,c=t.clientY,a=l>=r.right-i&&l<=r.right+i,o=l>=r.left-i&&l<=r.left+i,h=c>=r.bottom-i&&c<=r.bottom+i,u=c>=r.top-i&&c<=r.top+i,f=l>=r.left&&l<=r.right,d=c>=r.top&&c<=r.bottom;if(n==="both"){if(a&&h)return"se";if(o&&h)return"sw";if(a&&u)return"ne";if(o&&u)return"nw";if(a&&d)return"e";if(o&&d)return"w";if(h&&f)return"s";if(u&&f)return"n"}if(n==="horizontal"){if(a&&d)return"e";if(o&&d)return"w"}if(n==="vertical"){if(h&&f)return"s";if(u&&f)return"n"}return null}_pinPosition(t){return Fn(t)}_canStartGesture(t){if(this._opts.disabled)return!1;const i=this._handle()?this._handleEdge():this._detectEdge(t);return this._pendingEdge=i,i!==null}_startGestureResize(t){this._pendingEdge&&(this._velocityX=0,this._velocityY=0,this._startResize(this._pendingEdge))}_moveGestureResize(t){this._resizing&&(this._lastDeltaX=t.deltaX,this._lastDeltaY=t.deltaY,this._velocityX=t.velocityX,this._velocityY=t.velocityY,this._applyDelta(this._resizing,t.deltaX,t.deltaY),this._opts.onResize?.(this._lifecycleDetail("pointer")))}_endGestureResize(t){this._velocityX=t.velocityX,this._velocityY=t.velocityY,this._finishResize("pointer")}_startResize(t){const n=this._target(),i=this._pinPosition(n);this._startW=i.width,this._startH=i.height,this._startLeft=i.left,this._startTop=i.top,this._lastDeltaX=0,this._lastDeltaY=0,this._resizing=t,this._computeEffectiveExtents(n),this._opts.onResizeStart?.(this._lifecycleDetail("pointer"))}_computeEffectiveExtents(t){const n=getComputedStyle(t);this._effectiveMinW=Math.max(this._opts.minWidth,parseFloat(n.minWidth)||0),this._effectiveMinH=Math.max(this._opts.minHeight,parseFloat(n.minHeight)||0),this._effectiveMaxW=Math.min(this._opts.maxWidth??1/0,parseFloat(n.maxWidth)||1/0),this._effectiveMaxH=Math.min(this._opts.maxHeight??1/0,parseFloat(n.maxHeight)||1/0)}_lifecycleDetail(t){const n=this._target();return{edge:this._resizing??this._handleEdge(),inputType:t,startWidth:this._startW,startHeight:this._startH,width:n.getBoundingClientRect().width,height:n.getBoundingClientRect().height,deltaX:this._lastDeltaX,deltaY:this._lastDeltaY,velocityX:t==="pointer"?this._velocityX:0,velocityY:t==="pointer"?this._velocityY:0}}_handlePointerMove(t){if(this._resizing||this._opts.handle)return;const n=this._detectEdge(t),i=this._target();i.style.cursor=n?this._edgeCursor(n):""}_finishResize(t){if(!this._resizing)return;const n=this._lifecycleDetail(t);this._resizing=null,this._pendingEdge=null,this._opts.onResizeEnd?.(n)}_cancelResize(){this._resizing=null,this._pendingEdge=null}_handlePointerLeave(t){this._resizing||(this._target().style.cursor="")}_handleKeyDown(t){if(this._opts.disabled)return;const{direction:n}=this._opts,i=t.key==="ArrowRight"||t.key==="ArrowLeft",s=t.key==="ArrowDown"||t.key==="ArrowUp";if(i&&n==="vertical"||s&&n==="horizontal"||!i&&!s)return;t.preventDefault(),t.stopPropagation();const r=this._target(),l=this._pinPosition(r),c=this._keyboardEdge(t.key);if(!c)return;this._resizing=c,this._startW=l.width,this._startH=l.height,this._startLeft=l.left,this._startTop=l.top;const a=t.shiftKey?this._opts.step*10:this._opts.step;this._computeEffectiveExtents(r);const o=t.key==="ArrowRight"?a:t.key==="ArrowLeft"?-a:0,h=t.key==="ArrowDown"?a:t.key==="ArrowUp"?-a:0;this._lastDeltaX=o,this._lastDeltaY=h,this._applyDelta(c,o,h),this._opts.onResize?.(this._lifecycleDetail("keyboard")),this._finishResize("keyboard")}_keyboardEdge(t){const n=this._edgeForOrigin(this._opts.origin);return n||(t==="ArrowRight"||t==="ArrowLeft"?this._opts.direction==="both"||this._opts.direction==="horizontal"?"e":null:(t==="ArrowDown"||t==="ArrowUp")&&(this._opts.direction==="both"||this._opts.direction==="vertical")?"s":null)}_applyDelta(t,n,i){const s=this._target(),[r,l,c,a]=this._boundsRect(),o=this._effectiveMinW,h=this._effectiveMinH,u=this._effectiveMaxW,f=this._effectiveMaxH;if(t==="e"||t==="se"||t==="ne"){const d=Math.min(u,c-this._startLeft);s.style.width=`${Math.min(Math.max(this._startW+n,o),d)}px`}if(t==="w"||t==="sw"||t==="nw"){const d=this._startLeft+this._startW,p=Math.min(Math.max(this._startLeft+n,r,d-u),d-o);s.style.left=`${p}px`,s.style.width=`${d-p}px`}if(t==="s"||t==="se"||t==="sw"){const d=Math.min(f,a-this._startTop);s.style.height=`${Math.min(Math.max(this._startH+i,h),d)}px`}if(t==="n"||t==="ne"||t==="nw"){const d=this._startTop+this._startH,p=Math.min(Math.max(this._startTop+i,l,d-f),d-h);s.style.top=`${p}px`,s.style.height=`${d-p}px`}}_boundsRect(){const{bounds:t}=this._opts;if(!t||t==="viewport")return[0,0,window.innerWidth,window.innerHeight];if(t==="parent"){const i=this._opts.target.parentElement;if(!i)return[0,0,window.innerWidth,window.innerHeight];const s=i.getBoundingClientRect();return[s.left,s.top,s.right,s.bottom]}const n=t.getBoundingClientRect();return[n.left,n.top,n.right,n.bottom]}}function pe(e,t){const n=`${t}px`;switch(e){case"top":return`position-area: top; margin-bottom: ${n};`;case"top-start":return`bottom: anchor(top); top: auto; left: anchor(left); right: auto; margin-bottom: ${n};`;case"top-end":return`bottom: anchor(top); top: auto; left: auto; right: anchor(right); margin-bottom: ${n};`;case"bottom":return`position-area: bottom; margin-top: ${n};`;case"bottom-start":return`top: anchor(bottom); bottom: auto; left: anchor(left); right: auto; margin-top: ${n};`;case"bottom-end":return`top: anchor(bottom); bottom: auto; left: auto; right: anchor(right); margin-top: ${n};`;case"left":return`position-area: left; margin-right: ${n};`;case"left-start":return`top: anchor(top); bottom: auto; right: anchor(left); left: auto; margin-right: ${n};`;case"left-end":return`top: auto; bottom: anchor(bottom); right: anchor(left); left: auto; margin-right: ${n};`;case"right":return`position-area: right; margin-left: ${n};`;case"right-start":return`top: anchor(top); bottom: auto; left: anchor(right); right: auto; margin-left: ${n};`;case"right-end":return`top: auto; bottom: anchor(bottom); left: anchor(right); right: auto; margin-left: ${n};`}}const jn={top:"bottom","top-start":"bottom-start","top-end":"bottom-end",bottom:"top","bottom-start":"top-start","bottom-end":"top-end",left:"right","left-start":"right-start","left-end":"right-end",right:"left","right-start":"left-start","right-end":"left-end"},Bo={top:"top","top-start":"top-end","top-end":"top-start",bottom:"bottom","bottom-start":"bottom-end","bottom-end":"bottom-start",left:"left","left-start":"left-end","left-end":"left-start",right:"right","right-start":"right-end","right-end":"right-start"},zn=CSS.supports("position-try-fallbacks: flip-block")&&CSS.supports("min-width: anchor-size(width)");let $n=null,Ue=null;function Uo(){return zn?Promise.resolve(null):(Ue||(Ue=Promise.resolve().then(()=>qp).then(e=>($n=e.default,$n)).catch(()=>null)),Ue)}let Vo=0;class Xo{constructor(t,n){this._styleEl=null,this._adoptedSheet=null,this._opts=n,this._uid=`rc-anchor-${++Vo}`,t.addController(this)}setOptions(t){Object.assign(this._opts,t),this._applyAndPolyfill()}update(){this._applyAndPolyfill()}hostConnected(){this._applyAndPolyfill()}hostDisconnected(){this._cleanup()}_anchor(){const{anchor:t}=this._opts;return typeof t=="function"?t():t}_floating(){const{floating:t}=this._opts;return typeof t=="function"?t():t}_shadowHost(){const{shadowHost:t}=this._opts;return typeof t=="function"?t():t??null}_applyAndPolyfill(){this._apply(),zn||this._applyPolyfillOrFallback()}async _applyPolyfillOrFallback(){const t=await Uo(),n=this._shadowHost();t?await t({roots:n?[n]:void 0,useAnimationFrame:!1}):this._positionFallback()}_apply(){if(this._opts.disabled){this._cleanup();return}const t=this._anchor(),n=this._floating();if(!t||!n)return;const i=this._opts.placement??"bottom-start",s=this._opts.offset??4,r=this._opts.flip??!0,l=`--${this._uid}`,c=this._uid;t.style.setProperty("anchor-name",l),n.setAttribute("data-rc-anchor",c);const a=jn[i],o=Bo[i],h=jn[o],u=r?`
|
|
1
|
+
(function(k,Et){typeof exports=="object"&&typeof module<"u"?Et(exports,require("lit"),require("lit/directive.js"),require("lit/async-directive.js"),require("lit/decorators.js")):typeof define=="function"&&define.amd?define(["exports","lit","lit/directive.js","lit/async-directive.js","lit/decorators.js"],Et):(k=typeof globalThis<"u"?globalThis:k||self,Et(k["rc-common"]={},k.lit,k.litDirective,k.litAsyncDirective,k.litDecorators))})(this,(function(k,Et,He,zt,Mo){"use strict";let Fo=0;class jo{constructor(t,n){this._activeItem=null,this._activeIndex=-1,this._itemCounter=0,this._opts=n,this._instanceId=`rc-adc-${++Fo}`,t.addController(this)}hostConnected(){}hostDisconnected(){this.clear()}get activeItem(){return this._activeItem}get activeIndex(){return this._activeIndex}navigate(t){const n=this._opts.items();if(n.length===0)return;const i=this._opts.wrap??!0;let s=this._activeIndex<0?t>0?-1:n.length:this._activeIndex;const r=n.length;let l=0;do if(s+=t,i?s=(s%r+r)%r:s=Math.max(0,Math.min(r-1,s)),l++,!this._isSkipped(n[s]))break;while(l<r);this._setActive(n[s]??null,s)}navigateToFirst(){const t=this._opts.items(),n=t.findIndex(i=>!this._isSkipped(i));n>=0&&this._setActive(t[n],n)}navigateToLast(){const t=this._opts.items();let n=-1;for(let i=t.length-1;i>=0;i--)if(!this._isSkipped(t[i])){n=i;break}n>=0&&this._setActive(t[n],n)}navigateTo(t){const i=this._opts.items()[t];i&&!this._isSkipped(i)&&this._setActive(i,t)}navigateToItem(t){const i=this._opts.items().indexOf(t);i>=0&&!this._isSkipped(t)&&this._setActive(t,i)}clear(){this._activeItem?.removeAttribute("data-active"),this._activeItem=null,this._activeIndex=-1;const t=this._opts.host();t&&t.removeAttribute("aria-activedescendant")}_isSkipped(t){return!t||t.hidden||t.getAttribute("aria-disabled")==="true"?!0:this._opts.isSkipped?.(t)??!1}_setActive(t,n){this._activeItem?.removeAttribute("data-active"),this._activeItem=t,this._activeIndex=n;const i=this._opts.host();if(i){if(!t){i.removeAttribute("aria-activedescendant");return}t.id||(t.id=`${this._instanceId}-${++this._itemCounter}`),i.setAttribute("aria-activedescendant",t.id),t.setAttribute("data-active",""),t.scrollIntoView({block:"nearest"})}}}const Fn='a[href], button, input, select, textarea, summary, [role="button"], [role="link"], [contenteditable]:not([contenteditable="false"]), [tabindex]:not([tabindex="-1"])';function jn(e,t,n={}){const i=n.interactiveSelector??Fn;for(const s of e.composedPath()){if(s===t)return!1;if(s instanceof Element&&s.matches(i))return!0}return!1}function $n(e,t,n,i={}){return!n||i.disabled||e.defaultPrevented||e.button!==0||e.altKey||e.ctrlKey||e.metaKey||e.shiftKey||jn(e,t,i)?!1:(e.preventDefault(),n.click(),!0)}class $o{constructor(t,n){this._handleClick=i=>{$n(i,this._host,this._options.target(),{interactiveSelector:this._options.interactiveSelector,disabled:this._options.disabled?.()})},this._host=t,this._options=n,t.addController(this)}hostConnected(){this._host.addEventListener("click",this._handleClick)}hostDisconnected(){this._host.removeEventListener("click",this._handleClick)}}const ze=class ze{constructor(t,n){this._ul=null,this._options=[],this._liElements=[],this._createLi=null,this._createOption=null,this._selectedValues=new Set,this._filterText="",this._filterStrategy="contains",this._checkmark=!1,this._optionsInitialized=!1,this._pendingTouchActivation=null,this._onPointerDown=i=>{const s=i,r=this._resolveOptionLi(s.target);if(r){if(s.pointerType==="touch"){if(this._pendingTouchActivation)return;this._pendingTouchActivation={pointerId:s.pointerId,li:r,startX:s.clientX,startY:s.clientY};return}this._activateLi(r,s)}},this._onPointerMove=i=>{const s=this._pendingTouchActivation,r=i;if(!s||r.pointerId!==s.pointerId)return;Math.hypot(r.clientX-s.startX,r.clientY-s.startY)>ze._TOUCH_TAP_THRESHOLD&&(this._pendingTouchActivation=null)},this._onPointerUp=i=>{const s=this._pendingTouchActivation,r=i;!s||r.pointerId!==s.pointerId||(this._pendingTouchActivation=null,this._activateLi(s.li,r))},this._onPointerCancel=i=>{const s=i;this._pendingTouchActivation?.pointerId===s.pointerId&&(this._pendingTouchActivation=null)},this._host=t,this._idPrefix=n.idPrefix,this._onInitFromDom=n.onInitFromDom,this._onActivate=n.onActivate,t.addController(this)}hostConnected(){this._host.addEventListener("pointerdown",this._onPointerDown),this._host.addEventListener("pointermove",this._onPointerMove),this._host.addEventListener("pointerup",this._onPointerUp),this._host.addEventListener("pointercancel",this._onPointerCancel),this._optionsInitialized||this._bootstrapFromDom()}hostDisconnected(){this._host.removeEventListener("pointerdown",this._onPointerDown),this._host.removeEventListener("pointermove",this._onPointerMove),this._host.removeEventListener("pointerup",this._onPointerUp),this._host.removeEventListener("pointercancel",this._onPointerCancel),this._pendingTouchActivation=null}get allOptions(){return this._options}get selectedValues(){return[...this._selectedValues]}get filterText(){return this._filterText}isSelected(t){return this._selectedValues.has(t)}optionForElement(t){if(t===this._createLi)return this._createOption;const n=this._liElements.indexOf(t);return n===-1?null:this._options[n]??null}get navigableItems(){const t=[];for(let n=0;n<this._liElements.length;n++){const i=this._liElements[n];this._options[n]?.disabled||i.hidden||t.push(i)}return this._createLi!==null&&t.push(this._createLi),t}set checkmark(t){this._checkmark!==t&&(this._checkmark=t,this._syncCheckmarks())}setOptions(t){this._optionsInitialized=!0,this._options=[...t],this._ensureContainer(),this._syncOptionsToDom()}appendOption(t){this._optionsInitialized=!0,this._options=[...this._options,t],this._ensureContainer();const n=this._createLiElement(t,this._options.length-1);this._liElements.push(n),this._createLi?this._ul.insertBefore(n,this._createLi):this._ul.appendChild(n),this._applyFilterToLi(n,t)}setSelectedValues(t){const n=new Set(this._options.filter(i=>i.kind==="action").map(i=>i.value));this._createOption&&n.add(this._createOption.value),this._selectedValues=new Set(t.filter(i=>!n.has(i))),this._syncSelectedToDom()}filterOptions(t,n="contains"){this._filterText=t,this._filterStrategy=n,this._syncFilterToDom()}clearFilter(){this._filterText="",this._syncFilterToDom()}setCreateOption(t){if(t===null){this._createLi?.remove(),this._createLi=null,this._createOption=null;return}const n=t.trim();if(this._createOption={kind:"action",action:"create",value:`create:${n}`,label:`Create "${n}"`,data:{text:n}},!this._createLi){this._ensureContainer();const i=document.createElement("li");i.setAttribute("id",`${this._idPrefix}-create`),i.setAttribute("role","option"),i.setAttribute("aria-selected","false"),i.setAttribute("part","option create-option"),this._checkmark&&this._ensureCheckmark(i),this._ul.appendChild(i),this._createLi=i}this._createLi.setAttribute("data-value",this._createOption.value),this._createLi.setAttribute("data-kind","action"),this._createLi.setAttribute("data-action",this._createOption.action),this._setLabelText(this._createLi,this._createOption.label)}_ensureContainer(){if(this._ul)return this._ul;let t=this._host.querySelector(":scope > ul");return t||(t=document.createElement("ul"),this._host.appendChild(t)),t.setAttribute("role","presentation"),t.setAttribute("aria-hidden","true"),this._ul=t,t}_bootstrapFromDom(){const t=this._host.querySelector(":scope > ul");if(!t)return;this._ul=t,t.setAttribute("role","presentation"),t.setAttribute("aria-hidden","true");const n=Array.from(t.querySelectorAll(":scope > li"));if(n.length===0)return;const i=[];for(let s=0;s<n.length;s++){const r=n[s],l=r.getAttribute("data-value")??r.getAttribute("value")??r.textContent?.trim()??"",c=r.textContent?.trim()??"",a=r.hasAttribute("disabled")||r.getAttribute("aria-disabled")==="true";i.push({value:l,label:c,disabled:a}),r.setAttribute("role","option"),r.setAttribute("id",`${this._idPrefix}-${s}`),r.setAttribute("part","option"),r.setAttribute("data-value",l),r.setAttribute("aria-selected",this._selectedValues.has(l)?"true":"false"),r.setAttribute("aria-disabled",a?"true":"false"),this._checkmark&&this._ensureCheckmark(r)}this._options=i,this._liElements=n,this._onInitFromDom?.(i)}_syncOptionsToDom(){const t=this._ensureContainer();for(const n of this._liElements)n.remove();this._liElements=[];for(let n=0;n<this._options.length;n++){const i=this._createLiElement(this._options[n],n);this._liElements.push(i),t.appendChild(i)}this._createLi&&t.appendChild(this._createLi),this._syncFilterToDom()}_createLiElement(t,n){const i=document.createElement("li");return i.setAttribute("role","option"),i.setAttribute("id",`${this._idPrefix}-${n}`),i.setAttribute("part","option"),i.setAttribute("data-value",t.value),i.setAttribute("data-kind",t.kind??"option"),t.kind==="action"?i.setAttribute("data-action",t.action):i.removeAttribute("data-action"),i.setAttribute("aria-selected",this._selectedValues.has(t.value)?"true":"false"),i.setAttribute("aria-disabled",t.disabled?"true":"false"),this._checkmark&&this._ensureCheckmark(i),this._setLabelText(i,t.label),i}_setLabelText(t,n){for(const i of t.childNodes)if(i.nodeType===Node.TEXT_NODE){i.textContent=n;return}t.appendChild(document.createTextNode(n))}_ensureCheckmark(t){if(t.querySelector('[part="option-checkmark"]'))return;const n=document.createElement("span");n.setAttribute("part","option-checkmark"),n.setAttribute("aria-hidden","true"),n.textContent="✓",t.insertBefore(n,t.firstChild)}_removeCheckmark(t){t.querySelector('[part="option-checkmark"]')?.remove()}_syncCheckmarks(){const t=this._createLi?[...this._liElements,this._createLi]:[...this._liElements];for(const n of t)this._checkmark?this._ensureCheckmark(n):this._removeCheckmark(n)}_syncSelectedToDom(){for(let t=0;t<this._liElements.length;t++){const n=this._options[t];n&&this._liElements[t].setAttribute("aria-selected",this._selectedValues.has(n.value)?"true":"false")}}_syncFilterToDom(){for(let t=0;t<this._liElements.length;t++){const n=this._options[t];n&&this._applyFilterToLi(this._liElements[t],n)}}_applyFilterToLi(t,n){t.hidden=!this._isVisible(n)}_isVisible(t){if(!this._filterText)return!0;const n=t.label.toLowerCase(),i=this._filterText.toLowerCase();return typeof this._filterStrategy=="function"?this._filterStrategy(n,i):this._filterStrategy==="contains"?n.includes(i):n.startsWith(i)}_resolveOptionLi(t){if(!t)return null;const n=t.closest("li[data-value]");return!n||n.getAttribute("role")!=="option"||n.parentElement!==this._ul?null:n}_activateLi(t,n){n.preventDefault(),n.stopPropagation();const i=this.optionForElement(t);i&&this._onActivate(i)}};ze._TOUCH_TAP_THRESHOLD=10;let We=ze;class zo extends zt.AsyncDirective{constructor(t){if(super(t),this._options={},this._isPointerFocus=!1,this._onPointerdown=()=>{this._isPointerFocus=!0,this._target?.removeAttribute("data-interaction-mode")},this._onFocusin=()=>{this._isPointerFocus?this._isPointerFocus=!1:this._target?.setAttribute("data-interaction-mode","keyboard")},this._onKeydown=()=>{this._target?.setAttribute("data-interaction-mode","keyboard")},t.type!==He.PartType.ELEMENT)throw new Error("The `keyInteraction` directive must be used on an element.")}get _target(){return this._options.attributeTarget??this._element?.deref()}_init(){const t=this._element?.deref();t instanceof HTMLElement&&(t.addEventListener("pointerdown",this._onPointerdown,{capture:!0}),t.addEventListener("focusin",this._onFocusin),t.addEventListener("keydown",this._onKeydown))}render(t){return Et.nothing}update(t,[n]){this.isConnected&&this._element?.deref()===void 0&&(this._element=new WeakRef(t.element),this._init()),this._options=n??{}}disconnected(){const t=this._element?.deref();t instanceof HTMLElement&&(t.removeEventListener("pointerdown",this._onPointerdown,{capture:!0}),t.removeEventListener("focusin",this._onFocusin),t.removeEventListener("keydown",this._onKeydown))}reconnected(){this._init()}}const No=zt.directive(zo);class Ho extends zt.AsyncDirective{constructor(t){if(super(t),this._options={},t.type!==He.PartType.ELEMENT)throw new Error("The `keyNavigation` directive must be used on an element.")}get navigationAxis(){if(this._options.navigationAxis)return this._options.navigationAxis;switch(this._element?.deref()?.role){case"slider":case"tablist":case"toolbar":case"menubar":return this._element?.deref()?.ariaOrientation==="vertical"?"vertical":"horizontal";case"separator":return this._element?.deref()?.ariaOrientation==="vertical"?"horizontal":"vertical";default:return this._element?.deref()?.ariaOrientation==="horizontal"?"horizontal":"vertical"}}_normalizeKey(t){switch(t){case"Up":return"ArrowUp";case"Down":return"ArrowDown";case"Left":return"ArrowLeft";case"Right":return"ArrowRight";default:return t}}_onKeydown(t){const n=this._normalizeKey(t.key),i=this.navigationAxis,s=this._element?.deref(),r=i==="horizontal"&&s!=null&&getComputedStyle(s).direction==="rtl",l=i==="horizontal"?r?"ArrowLeft":"ArrowRight":"ArrowDown",c=i==="horizontal"?r?"ArrowRight":"ArrowLeft":"ArrowUp",a=i==="horizontal"?"ArrowDown":"ArrowRight",o=i==="horizontal"?"ArrowUp":"ArrowLeft";let h;this._options.handleNavAxis!==!1&&(n===l?h=t.shiftKey?"next-large":"next":n===c?h=t.shiftKey?"prev-large":"prev":n==="Home"?h="start":n==="End"&&(h="end")),!h&&this._options.handleOpenAxis&&(n===a?h="open-to-first":n===o&&(h="open-to-last")),h||(n==="Enter"?h=this._options.handleActivate?"activate":"toggle":n===" "&&this._options.handleActivate?h="activate":n==="Escape"&&this._options.handleEscape&&(h="escape")),h!=null&&(this._callback(h),t.stopPropagation(),t.preventDefault())}_init(){const t=this._element?.deref();t!=null&&t instanceof HTMLElement&&(this._keyDownHandle=this._onKeydown.bind(this),t.addEventListener("keydown",this._keyDownHandle))}render(t,n){return Et.nothing}update(t,[n,i]){this.isConnected&&this._element?.deref()===void 0&&(this._element=new WeakRef(t.element),this._init()),this._callback=n.bind(t.options?.host??t.element),this._options={...i}}disconnected(){const t=this._element?.deref();t!=null&&t instanceof HTMLElement&&t.removeEventListener("keydown",this._keyDownHandle)}reconnected(){this._init()}}const Wo=zt.directive(Ho);class Bo extends zt.AsyncDirective{constructor(t){if(super(t),this._activePointerId=null,t.type!==He.PartType.ELEMENT)throw new Error("The `mouseMove` directive must be used on an element.");this._pointerDownHandle=this._onPointerDown.bind(this),this._pointerMoveHandle=this._onPointerMove.bind(this),this._pointerEndHandle=this._onPointerEnd.bind(this)}_onPointerDown(t){if(this._activePointerId!==null)return;t.preventDefault();const n=t.currentTarget;this._activePointerId=t.pointerId,this._capturePointer(n,t.pointerId),n.addEventListener("pointermove",this._pointerMoveHandle),n.addEventListener("pointerup",this._pointerEndHandle),n.addEventListener("pointercancel",this._pointerEndHandle),n.addEventListener("lostpointercapture",this._pointerEndHandle),n.focus()}_onPointerMove(t){t.pointerId===this._activePointerId&&(t.preventDefault(),this._callback(t))}_onPointerEnd(t){if(t.pointerId!==this._activePointerId)return;t.preventDefault();const n=t.currentTarget;this._releasePointer(n,t.pointerId),this._removePointerCycleListeners(n),this._activePointerId=null}_init(){const t=this._element?.deref();t&&(t.removeEventListener("pointerdown",this._pointerDownHandle),t.addEventListener("pointerdown",this._pointerDownHandle))}_removePointerCycleListeners(t){t.removeEventListener("pointermove",this._pointerMoveHandle),t.removeEventListener("pointerup",this._pointerEndHandle),t.removeEventListener("pointercancel",this._pointerEndHandle),t.removeEventListener("lostpointercapture",this._pointerEndHandle)}_capturePointer(t,n){try{t.setPointerCapture(n)}catch{}}_releasePointer(t,n){try{t.hasPointerCapture(n)&&t.releasePointerCapture(n)}catch{}}render(t){return Et.nothing}update(t,[n]){if(this._callback=n.bind(t.options?.host??t.element),!this.isConnected||!(t.element instanceof HTMLElement))return;const i=this._element?.deref();i!==t.element&&(i?.removeEventListener("pointerdown",this._pointerDownHandle),i&&this._removePointerCycleListeners(i),this._activePointerId=null,this._element=new WeakRef(t.element),this._init())}disconnected(){const t=this._element?.deref();t&&(t.removeEventListener("pointerdown",this._pointerDownHandle),this._removePointerCycleListeners(t),this._activePointerId=null)}reconnected(){this._init()}}const Uo=zt.directive(Bo);class Be{constructor(t,n){this._$target=null,this._pointerId=null,this._startX=0,this._startY=0,this._startTime=0,this._samples=[],this._activated=!1,this._rejected=!1,this._onPointerDown=i=>{if(this._pointerId!==null||!i.isPrimary&&i.pointerId!==1||i.pointerType==="mouse"&&i.button!==0||this._options.canStart?.(i)===!1)return;this._pointerId=i.pointerId,this._startX=i.clientX,this._startY=i.clientY,this._startTime=i.timeStamp,this._samples=[{x:i.clientX,y:i.clientY,time:i.timeStamp}],this._activated=!1,this._rejected=!1;const s=this._$target;s&&(s.addEventListener("pointermove",this._onPointerMove),s.addEventListener("pointerup",this._onPointerUp),s.addEventListener("pointercancel",this._onPointerCancel),s.addEventListener("lostpointercapture",this._onLostPointerCapture),this._options.activation==="immediate"&&this._activate(i))},this._onPointerMove=i=>{i.pointerId!==this._pointerId||this._rejected||(this._recordSample(i),!(!this._activated&&!this._resolveIntent(i))&&(this._options.onMove?.(this._detail(i)),this._options.preventDefault&&i.preventDefault()))},this._onPointerUp=i=>{i.pointerId===this._pointerId&&(this._recordSample(i),this._activated&&this._options.onEnd?.(this._detail(i)),this._finish())},this._onPointerCancel=i=>{this._cancel(i)},this._onLostPointerCapture=i=>{i.pointerId===this._pointerId&&this._cancel(i)},this._options={axis:"both",activation:"immediate",activationDistance:8,axisLockRatio:1.25,velocityWindow:100,minVelocityDuration:8,capture:!1,stopPropagation:!1,preventDefault:!0,focusOnStart:!1,...n},t.addController(this)}setOptions(t){Object.assign(this._options,t),this._bindTarget()}hostConnected(){this._bindTarget()}hostUpdated(){this._bindTarget()}hostDisconnected(){this._unbindTarget()}_resolveTarget(){const t=typeof this._options.target=="function"?this._options.target():this._options.target;return t instanceof HTMLElement?t:null}_bindTarget(){const t=this._resolveTarget();t!==this._$target&&(this._unbindTarget(),this._$target=t,this._$target?.addEventListener("pointerdown",this._onPointerDown,{capture:this._options.capture}))}_unbindTarget(){this._$target&&(this._$target.removeEventListener("pointerdown",this._onPointerDown,{capture:this._options.capture}),this._removeCycleListeners(this._$target),this._reset(),this._$target=null)}_resolveIntent(t){const n=t.clientX-this._startX,i=t.clientY-this._startY;if(Math.hypot(n,i)<this._options.activationDistance)return!1;const{axis:r,axisLockRatio:l}=this._options,c=Math.abs(n),a=Math.abs(i);return r==="x"&&c<a*l||r==="y"&&a<c*l?(this._rejected=!0,this._finish(),!1):(this._activate(t),!0)}_activate(t){const n=this._$target;!n||this._activated||(this._activated=!0,this._capturePointer(n,t.pointerId),this._options.focusOnStart&&n.focus(),this._options.stopPropagation&&t.stopPropagation(),this._options.preventDefault&&t.preventDefault(),this._options.onStart?.(this._detail(t)))}_cancel(t){t.pointerId===this._pointerId&&(this._activated&&this._options.onCancel?.(this._detail(t)),this._finish())}_finish(){const t=this._$target,n=this._pointerId;t&&(this._removeCycleListeners(t),n!==null&&this._releasePointer(t,n)),this._reset()}_removeCycleListeners(t){t.removeEventListener("pointermove",this._onPointerMove),t.removeEventListener("pointerup",this._onPointerUp),t.removeEventListener("pointercancel",this._onPointerCancel),t.removeEventListener("lostpointercapture",this._onLostPointerCapture)}_recordSample(t){this._samples.push({x:t.clientX,y:t.clientY,time:t.timeStamp});const n=t.timeStamp-this._options.velocityWindow;for(;this._samples.length>2&&this._samples[0].time<n;)this._samples.shift()}_detail(t){const n=this._samples[0],i=this._samples.at(-1)??n,s=i.time-n.time,r=s>=this._options.minVelocityDuration;return{event:t,pointerId:t.pointerId,pointerType:t.pointerType,startX:this._startX,startY:this._startY,x:t.clientX,y:t.clientY,deltaX:t.clientX-this._startX,deltaY:t.clientY-this._startY,duration:Math.max(0,t.timeStamp-this._startTime),velocityX:r?(i.x-n.x)/s*1e3:0,velocityY:r?(i.y-n.y)/s*1e3:0}}_capturePointer(t,n){try{t.setPointerCapture(n)}catch(i){if(!(i instanceof DOMException)||i.name!=="NotFoundError")throw i}}_releasePointer(t,n){try{t.hasPointerCapture(n)&&t.releasePointerCapture(n)}catch{}}_reset(){this._pointerId=null,this._samples=[],this._activated=!1,this._rejected=!1}}class Vo{constructor(t,n){this._dragging=!1,this._startLeft=0,this._startTop=0,this._opts={axis:"both",step:4,disabled:!1,handle:null,bounds:"viewport",...n},this._onKeyDown=this._handleKeyDown.bind(this),this._gesture=new Be(t,{target:()=>this._handle(),axis:this._opts.axis,canStart:i=>this._canStartGesture(i),onStart:i=>this._startDrag(i),onMove:i=>this._moveDrag(i),onEnd:()=>this._finishDrag(),onCancel:()=>this._finishDrag()}),t.addController(this)}setOptions(t){const n=this._handle();Object.assign(this._opts,t),this._gesture.setOptions({axis:this._opts.axis,target:()=>this._handle()});const i=this._handle();n!==i&&(this._detachFrom(n),this._attachTo(i))}hostConnected(){this._attachTo(this._handle())}hostDisconnected(){this._detachFrom(this._handle())}_handle(){return this._opts.handle??this._opts.target}_target(){return this._opts.target}_attachTo(t){t.addEventListener("keydown",this._onKeyDown),t.hasAttribute("tabindex")||t.setAttribute("tabindex","0")}_detachFrom(t){t.removeEventListener("keydown",this._onKeyDown)}_canStartGesture(t){return this._opts.disabled?!1:!t.target.closest('button, [role="button"], a')}_startDrag(t){const n=this._target(),i=n.getBoundingClientRect();getComputedStyle(n).position==="static"&&(n.style.position="fixed"),n.style.translate="none",n.style.inset="auto",n.style.margin="0",n.style.left=`${i.left}px`,n.style.top=`${i.top}px`,this._startLeft=i.left,this._startTop=i.top,this._dragging=!0}_moveDrag(t){if(!this._dragging)return;const n=this._target(),{axis:i}=this._opts,[s,r,l,c]=this._boundsRect(),a=i!=="y"?Math.min(Math.max(this._startLeft+t.deltaX,s),l-n.offsetWidth):parseFloat(n.style.left)||0,o=i!=="x"?Math.min(Math.max(this._startTop+t.deltaY,r),c-n.offsetHeight):parseFloat(n.style.top)||0;n.style.left=`${a}px`,n.style.top=`${o}px`}_finishDrag(){this._dragging&&(this._dragging=!1)}_handleKeyDown(t){if(this._opts.disabled||t.currentTarget!==t.target)return;const{axis:n}=this._opts,i=t.shiftKey?this._opts.step*10:this._opts.step;let s=0,r=0;switch(t.key){case"ArrowLeft":if(n==="y")return;s=-i;break;case"ArrowRight":if(n==="y")return;s=i;break;case"ArrowUp":if(n==="x")return;r=-i;break;case"ArrowDown":if(n==="x")return;r=i;break;default:return}const l=this._target();if(getComputedStyle(l).position==="static"){const d=l.getBoundingClientRect();l.style.position="fixed",l.style.translate="none",l.style.left=`${d.left}px`,l.style.top=`${d.top}px`}const[c,a,o,h]=this._boundsRect(),u=parseFloat(l.style.left)||0,f=parseFloat(l.style.top)||0;l.style.left=`${Math.min(Math.max(u+s,c),o-l.offsetWidth)}px`,l.style.top=`${Math.min(Math.max(f+r,a),h-l.offsetHeight)}px`,t.preventDefault(),t.stopPropagation()}_boundsRect(){const{bounds:t}=this._opts;if(!t||t==="viewport")return[0,0,window.innerWidth,window.innerHeight];if(t==="parent"){const i=this._opts.target.parentElement;if(!i)return[0,0,window.innerWidth,window.innerHeight];const s=i.getBoundingClientRect();return[s.left,s.top,s.right,s.bottom]}const n=t.getBoundingClientRect();return[n.left,n.top,n.right,n.bottom]}}function zn(e){const t=e.getBoundingClientRect(),n=e.offsetParent,i=n?t.left-n.getBoundingClientRect().left-n.clientLeft+n.scrollLeft:t.left,s=n?t.top-n.getBoundingClientRect().top-n.clientTop+n.scrollTop:t.top;return getComputedStyle(e).position==="static"&&(e.style.position="fixed"),e.style.translate="none",e.style.inset="auto",e.style.margin="0",e.style.boxSizing="border-box",e.style.left=`${i}px`,e.style.top=`${s}px`,e.style.width=`${t.width}px`,e.style.height=`${t.height}px`,t}class Xo{constructor(t,n){this._resizing=null,this._startW=0,this._startH=0,this._startLeft=0,this._startTop=0,this._lastDeltaX=0,this._lastDeltaY=0,this._velocityX=0,this._velocityY=0,this._pendingEdge=null,this._effectiveMinW=0,this._effectiveMinH=0,this._effectiveMaxW=1/0,this._effectiveMaxH=1/0,this._cornerBtn=null,this._opts={direction:"none",threshold:8,step:4,disabled:!1,minWidth:100,minHeight:60,handle:null,origin:"",bounds:"viewport",...n},this._onPointerMove=this._handlePointerMove.bind(this),this._onPointerLeave=this._handlePointerLeave.bind(this),this._onKeyDown=this._handleKeyDown.bind(this),this._gesture=new Be(t,{target:()=>this._handle()??this._target(),capture:!0,stopPropagation:!0,canStart:i=>this._canStartGesture(i),onStart:i=>this._startGestureResize(i),onMove:i=>this._moveGestureResize(i),onEnd:i=>this._endGestureResize(i),onCancel:()=>this._cancelResize()}),t.addController(this)}setOptions(t){const n=this._opts.handle;Object.assign(this._opts,t),this._gesture.setOptions({target:()=>this._handle()??this._target()}),n!==this._opts.handle&&(this._detachFromHandle(n),this._attachToHandle(this._opts.handle))}hostConnected(){if(this._opts.direction==="none")return;if(this._opts.handle){this._attachToHandle(this._opts.handle);return}const t=this._target();t.addEventListener("pointermove",this._onPointerMove),t.addEventListener("pointerleave",this._onPointerLeave),this._injectCornerButton()}hostDisconnected(){if(this._opts.handle){this._detachFromHandle(this._opts.handle);return}const t=this._target();t.removeEventListener("pointermove",this._onPointerMove),t.removeEventListener("pointerleave",this._onPointerLeave),this._removeCornerButton()}_target(){return this._opts.target}_handle(){return this._opts.handle}_attachToHandle(t){!t||this._opts.direction==="none"||(t.addEventListener("keydown",this._onKeyDown),t.style.cursor=this._edgeCursor(this._handleEdge()),t.style.touchAction="none",t.hasAttribute("tabindex")||t.setAttribute("tabindex","0"))}_detachFromHandle(t){t&&t.removeEventListener("keydown",this._onKeyDown)}_injectCornerButton(){if(this._opts.handle)return;const t=this._target();getComputedStyle(t).position==="static"&&(t.style.position="relative");const n=document.createElement("button");n.setAttribute("data-rc-resize-corner",""),n.setAttribute("aria-label","Resize"),n.type="button",Object.assign(n.style,{position:"absolute",bottom:"0",right:"0",width:"12px",height:"12px",padding:"0",border:"none",background:"transparent",cursor:this._cornerCursor(),zIndex:"1"}),n.addEventListener("keydown",this._onKeyDown),t.appendChild(n),this._cornerBtn=n}_removeCornerButton(){this._cornerBtn&&(this._cornerBtn.removeEventListener("keydown",this._onKeyDown),this._cornerBtn.remove(),this._cornerBtn=null)}_cornerCursor(){switch(this._opts.direction){case"both":return"se-resize";case"horizontal":return"ew-resize";case"vertical":return"ns-resize";default:return"default"}}_edgeCursor(t){return{n:"n-resize",s:"s-resize",e:"e-resize",w:"w-resize",ne:"ne-resize",nw:"nw-resize",se:"se-resize",sw:"sw-resize"}[t]}_handleEdge(){return this._edgeForOrigin(this._opts.origin)??this._defaultHandleEdge()}_defaultHandleEdge(){switch(this._opts.direction){case"both":return"se";case"horizontal":return"e";case"vertical":return"s";default:return"se"}}_edgeForOrigin(t){if(!t)return null;const n=t.includes("top"),i=t.includes("bottom"),s=t.includes("left"),r=t.includes("right");if(this._opts.direction==="vertical")return n?"n":i?"s":null;if(this._opts.direction==="horizontal")return s?"w":r?"e":null;if(this._opts.direction==="both"){if(n&&s)return"nw";if(n&&r)return"ne";if(i&&s)return"sw";if(i&&r)return"se";if(n)return"n";if(i)return"s";if(s)return"w";if(r)return"e"}return null}_edgeAllowsPointer(t,n){const{threshold:i}=this._opts,s=this._target().getBoundingClientRect(),r=n.clientX,l=n.clientY,c=r>=s.right-i&&r<=s.right+i,a=r>=s.left-i&&r<=s.left+i,o=l>=s.bottom-i&&l<=s.bottom+i,h=l>=s.top-i&&l<=s.top+i,u=r>=s.left&&r<=s.right,f=l>=s.top&&l<=s.bottom;switch(t){case"n":return h&&u;case"s":return o&&u;case"e":return c&&f;case"w":return a&&f;case"ne":return h&&c;case"nw":return h&&a;case"se":return o&&c;case"sw":return o&&a}}_detectEdge(t){const{direction:n,threshold:i}=this._opts;if(n==="none")return null;const s=this._edgeForOrigin(this._opts.origin);if(s)return this._edgeAllowsPointer(s,t)?s:null;const r=this._target().getBoundingClientRect(),l=t.clientX,c=t.clientY,a=l>=r.right-i&&l<=r.right+i,o=l>=r.left-i&&l<=r.left+i,h=c>=r.bottom-i&&c<=r.bottom+i,u=c>=r.top-i&&c<=r.top+i,f=l>=r.left&&l<=r.right,d=c>=r.top&&c<=r.bottom;if(n==="both"){if(a&&h)return"se";if(o&&h)return"sw";if(a&&u)return"ne";if(o&&u)return"nw";if(a&&d)return"e";if(o&&d)return"w";if(h&&f)return"s";if(u&&f)return"n"}if(n==="horizontal"){if(a&&d)return"e";if(o&&d)return"w"}if(n==="vertical"){if(h&&f)return"s";if(u&&f)return"n"}return null}_pinPosition(t){return zn(t)}_canStartGesture(t){if(this._opts.disabled)return!1;const i=this._handle()?this._handleEdge():this._detectEdge(t);return this._pendingEdge=i,i!==null}_startGestureResize(t){this._pendingEdge&&(this._velocityX=0,this._velocityY=0,this._startResize(this._pendingEdge))}_moveGestureResize(t){this._resizing&&(this._lastDeltaX=t.deltaX,this._lastDeltaY=t.deltaY,this._velocityX=t.velocityX,this._velocityY=t.velocityY,this._applyDelta(this._resizing,t.deltaX,t.deltaY),this._opts.onResize?.(this._lifecycleDetail("pointer")))}_endGestureResize(t){this._velocityX=t.velocityX,this._velocityY=t.velocityY,this._finishResize("pointer")}_startResize(t){const n=this._target(),i=this._pinPosition(n);this._startW=i.width,this._startH=i.height,this._startLeft=Number.parseFloat(n.style.left),this._startTop=Number.parseFloat(n.style.top),this._lastDeltaX=0,this._lastDeltaY=0,this._resizing=t,this._computeEffectiveExtents(n),this._opts.onResizeStart?.(this._lifecycleDetail("pointer"))}_computeEffectiveExtents(t){const n=getComputedStyle(t);this._effectiveMinW=Math.max(this._opts.minWidth,parseFloat(n.minWidth)||0),this._effectiveMinH=Math.max(this._opts.minHeight,parseFloat(n.minHeight)||0),this._effectiveMaxW=Math.min(this._opts.maxWidth??1/0,parseFloat(n.maxWidth)||1/0),this._effectiveMaxH=Math.min(this._opts.maxHeight??1/0,parseFloat(n.maxHeight)||1/0)}_lifecycleDetail(t){const n=this._target();return{edge:this._resizing??this._handleEdge(),inputType:t,startWidth:this._startW,startHeight:this._startH,width:n.getBoundingClientRect().width,height:n.getBoundingClientRect().height,deltaX:this._lastDeltaX,deltaY:this._lastDeltaY,velocityX:t==="pointer"?this._velocityX:0,velocityY:t==="pointer"?this._velocityY:0}}_handlePointerMove(t){if(this._resizing||this._opts.handle)return;const n=this._detectEdge(t),i=this._target();i.style.cursor=n?this._edgeCursor(n):""}_finishResize(t){if(!this._resizing)return;const n=this._lifecycleDetail(t);this._resizing=null,this._pendingEdge=null,this._opts.onResizeEnd?.(n)}_cancelResize(){this._resizing=null,this._pendingEdge=null}_handlePointerLeave(t){this._resizing||(this._target().style.cursor="")}_handleKeyDown(t){if(this._opts.disabled)return;const{direction:n}=this._opts,i=t.key==="ArrowRight"||t.key==="ArrowLeft",s=t.key==="ArrowDown"||t.key==="ArrowUp";if(i&&n==="vertical"||s&&n==="horizontal"||!i&&!s)return;t.preventDefault(),t.stopPropagation();const r=this._target(),l=this._pinPosition(r),c=this._keyboardEdge(t.key);if(!c)return;this._resizing=c,this._startW=l.width,this._startH=l.height,this._startLeft=l.left,this._startTop=l.top;const a=t.shiftKey?this._opts.step*10:this._opts.step;this._computeEffectiveExtents(r);const o=t.key==="ArrowRight"?a:t.key==="ArrowLeft"?-a:0,h=t.key==="ArrowDown"?a:t.key==="ArrowUp"?-a:0;this._lastDeltaX=o,this._lastDeltaY=h,this._applyDelta(c,o,h),this._opts.onResize?.(this._lifecycleDetail("keyboard")),this._finishResize("keyboard")}_keyboardEdge(t){const n=this._edgeForOrigin(this._opts.origin);return n||(t==="ArrowRight"||t==="ArrowLeft"?this._opts.direction==="both"||this._opts.direction==="horizontal"?"e":null:(t==="ArrowDown"||t==="ArrowUp")&&(this._opts.direction==="both"||this._opts.direction==="vertical")?"s":null)}_applyDelta(t,n,i){const s=this._target(),[r,l,c,a]=this._boundsRect(),o=this._effectiveMinW,h=this._effectiveMinH,u=this._effectiveMaxW,f=this._effectiveMaxH;if(t==="e"||t==="se"||t==="ne"){const d=Math.min(u,c-this._startLeft);s.style.width=`${Math.min(Math.max(this._startW+n,o),d)}px`}if(t==="w"||t==="sw"||t==="nw"){const d=this._startLeft+this._startW,p=Math.min(Math.max(this._startLeft+n,r,d-u),d-o);s.style.left=`${p}px`,s.style.width=`${d-p}px`}if(t==="s"||t==="se"||t==="sw"){const d=Math.min(f,a-this._startTop);s.style.height=`${Math.min(Math.max(this._startH+i,h),d)}px`}if(t==="n"||t==="ne"||t==="nw"){const d=this._startTop+this._startH,p=Math.min(Math.max(this._startTop+i,l,d-f),d-h);s.style.top=`${p}px`,s.style.height=`${d-p}px`}}_boundsRect(){const{bounds:t}=this._opts;if(!t||t==="viewport")return[0,0,window.innerWidth,window.innerHeight];if(t==="parent"){const i=this._opts.target.parentElement;if(!i)return[0,0,window.innerWidth,window.innerHeight];const s=i.getBoundingClientRect();return[s.left,s.top,s.right,s.bottom]}const n=t.getBoundingClientRect();return[n.left,n.top,n.right,n.bottom]}}function pe(e,t){const n=`${t}px`;switch(e){case"top":return`position-area: top; margin-bottom: ${n};`;case"top-start":return`bottom: anchor(top); top: auto; left: anchor(left); right: auto; margin-bottom: ${n};`;case"top-end":return`bottom: anchor(top); top: auto; left: auto; right: anchor(right); margin-bottom: ${n};`;case"bottom":return`position-area: bottom; margin-top: ${n};`;case"bottom-start":return`top: anchor(bottom); bottom: auto; left: anchor(left); right: auto; margin-top: ${n};`;case"bottom-end":return`top: anchor(bottom); bottom: auto; left: auto; right: anchor(right); margin-top: ${n};`;case"left":return`position-area: left; margin-right: ${n};`;case"left-start":return`top: anchor(top); bottom: auto; right: anchor(left); left: auto; margin-right: ${n};`;case"left-end":return`top: auto; bottom: anchor(bottom); right: anchor(left); left: auto; margin-right: ${n};`;case"right":return`position-area: right; margin-left: ${n};`;case"right-start":return`top: anchor(top); bottom: auto; left: anchor(right); right: auto; margin-left: ${n};`;case"right-end":return`top: auto; bottom: anchor(bottom); left: anchor(right); right: auto; margin-left: ${n};`}}const Nn={top:"bottom","top-start":"bottom-start","top-end":"bottom-end",bottom:"top","bottom-start":"top-start","bottom-end":"top-end",left:"right","left-start":"right-start","left-end":"right-end",right:"left","right-start":"left-start","right-end":"left-end"},Yo={top:"top","top-start":"top-end","top-end":"top-start",bottom:"bottom","bottom-start":"bottom-end","bottom-end":"bottom-start",left:"left","left-start":"left-end","left-end":"left-start",right:"right","right-start":"right-end","right-end":"right-start"},Hn=typeof CSS<"u"&&CSS.supports("position-try-fallbacks: flip-block")&&CSS.supports("min-width: anchor-size(width)");let Wn=null,Ue=null;function qo(){return Hn?Promise.resolve(null):(Ue||(Ue=Promise.resolve().then(()=>Jp).then(e=>(Wn=e.default,Wn)).catch(()=>null)),Ue)}let Go=0;class Ko{constructor(t,n){this._styleEl=null,this._adoptedSheet=null,this._connected=!1,this._clampLoopActive=!1,this._clampFrame=null,this._appliedDx=0,this._appliedDy=0,this._opts=n,this._uid=`rc-anchor-${++Go}`,t.addController(this)}setOptions(t){Object.assign(this._opts,t),this._applyAndPolyfill()}update(){this._applyAndPolyfill()}hostConnected(){this._connected=!0,this._applyAndPolyfill()}hostDisconnected(){this._connected=!1,this._cleanup()}_anchor(){const{anchor:t}=this._opts;return typeof t=="function"?t():t}_floating(){const{floating:t}=this._opts;return typeof t=="function"?t():t}_shadowHost(){const{shadowHost:t}=this._opts;return typeof t=="function"?t():t??null}_applyAndPolyfill(){!this._connected||!this._apply()||(Hn?this._scheduleClamp():this._applyPolyfillOrFallback().then(()=>{this._connected&&!this._opts.disabled&&this._scheduleClamp()}))}_scheduleClamp(){if(this._clampLoopActive||!this._connected||this._opts.disabled)return;this._clampLoopActive=!0;const t=()=>{if(this._clampFrame=null,!this._connected||this._opts.disabled){this._stopClampLoop();return}const n=this._floating();if(!n){this._stopClampLoop();return}const i=n.getBoundingClientRect();if(!(i.width>0||i.height>0)){this._stopClampLoop();return}this._clampToViewport(),this._clampFrame=requestAnimationFrame(t)};this._clampFrame=requestAnimationFrame(t)}_stopClampLoop(){this._clampFrame!==null&&(cancelAnimationFrame(this._clampFrame),this._clampFrame=null),this._clampLoopActive=!1}_clampToViewport(){const t=this._floating();if(!t)return;const n=4,i=t.getBoundingClientRect();if(i.width===0&&i.height===0)return;const s=t.ownerDocument.defaultView;if(!s)return;const r=s.innerWidth,l=s.innerHeight,c=i.left-this._appliedDx,a=i.right-this._appliedDx,o=i.top-this._appliedDy,h=i.bottom-this._appliedDy;let u=0,f=0;a>r-n&&(u=r-n-a),c+u<n&&(u=n-c),h>l-n&&(f=l-n-h),o+f<n&&(f=n-o),this._appliedDx=u,this._appliedDy=f,t.style.translate=u||f?`${u}px ${f}px`:""}async _applyPolyfillOrFallback(){const t=await qo();if(!this._connected||this._opts.disabled)return;const n=this._shadowHost();t?await t({roots:n?[n]:void 0,useAnimationFrame:!1}):this._positionFallback()}_apply(){if(this._opts.disabled)return this._cleanup(),!1;const t=this._anchor(),n=this._floating();if(!t||!n)return this._stopClampLoop(),!1;const i=this._opts.placement??"bottom-start",s=this._opts.offset??4,r=this._opts.flip??!0,l=`--${this._uid}`,c=this._uid;t.style.setProperty("anchor-name",l),n.setAttribute("data-rc-anchor",c);const a=Nn[i],o=Yo[i],h=Nn[o],u=r?`
|
|
2
2
|
@position-try --${c}-end { ${pe(o,s)} }
|
|
3
3
|
@position-try --${c}-flip { ${pe(a,s)} }
|
|
4
4
|
@position-try --${c}-both { ${pe(h,s)} }
|
|
@@ -12,14 +12,14 @@
|
|
|
12
12
|
${pe(i,s)}
|
|
13
13
|
${f}
|
|
14
14
|
}
|
|
15
|
-
`;this._injectStyles(d)}_injectStyles(t){const n=this._shadowHost();n?.shadowRoot?(this._adoptedSheet||(this._adoptedSheet=new CSSStyleSheet,n.shadowRoot.adoptedStyleSheets=[...n.shadowRoot.adoptedStyleSheets,this._adoptedSheet]),this._adoptedSheet.replaceSync(t)):(this._styleEl?.remove(),this._styleEl=document.createElement("style"),this._styleEl.setAttribute("data-rc-anchor-style",this._uid),this._styleEl.textContent=t,document.head.appendChild(this._styleEl))}_positionFallback(){const t=this._anchor(),n=this._floating();if(!t||!n)return;const i=this._opts.placement??"bottom-start",s=this._opts.offset??4,r=t.getBoundingClientRect(),l=window.innerWidth,c=window.innerHeight;n.style.position="fixed",n.style.boxSizing="border-box",n.style.minWidth=`${r.width}px`;const a=i.startsWith("bottom")||i==="bottom",o=c-r.bottom;a&&o<120&&r.top>o?(n.style.top="",n.style.bottom=`${c-r.top+s}px`):(n.style.bottom="",n.style.top=`${r.bottom+s}px`);const u=i.endsWith("-end"),f=n.offsetWidth||parseFloat(getComputedStyle(n).minWidth)||0;let d=u?r.right-f:r.left;d+f>l-4&&(d=r.right-f),d=Math.max(4,Math.min(d,l-f-4)),n.style.left=`${d}px`}_cleanup(){const t=this._anchor(),n=this._floating();t&&t.style.removeProperty("anchor-name"),n&&n.removeAttribute("data-rc-anchor"),this._styleEl?.remove(),this._styleEl=null;const i=this._shadowHost();i?.shadowRoot&&this._adoptedSheet&&(i.shadowRoot.adoptedStyleSheets=i.shadowRoot.adoptedStyleSheets.filter(s=>s!==this._adoptedSheet),this._adoptedSheet=null)}}class Yo{constructor(t,n){this._attached=null,this._scrolled=!1,this._onScroll=()=>this._evaluate(),this._host=t,this._opts=n,t.addController(this)}get scrolled(){return this._scrolled}setOptions(t){this._detach(),Object.assign(this._opts,t),this._attach()}hostConnected(){this._attach()}hostDisconnected(){this._detach()}_resolveTarget(){const{target:t}=this._opts;return typeof t=="function"?t():t??null}_attach(){if(this._opts.disabled||this._attached)return;const t=this._resolveTarget();t&&(this._attached=t,t.addEventListener("scroll",this._onScroll,{passive:!0}),this._evaluate())}_detach(){this._attached?.removeEventListener("scroll",this._onScroll),this._attached=null,this._lastScrollTop=void 0}_scrollTop(){const t=this._attached;return t instanceof Element?t.scrollTop:t instanceof Document?t.scrollingElement?.scrollTop??0:t?.scrollY??0}_evaluate(){if(!this._attached)return;const t=this._scrollTop(),n=t-(this._lastScrollTop??t);this._lastScrollTop=t,this._opts.onScroll?.(t,n);const i=t>(this._opts.threshold??4);i!==this._scrolled&&(this._scrolled=i,this._opts.onChange?.(i,t),this._host.requestUpdate())}}class qo{constructor(t,n){this._attached=null,this._observer=null,this._options=n,t.addController(this)}setOptions(t){this._detach(),Object.assign(this._options,t),this._attach()}hostConnected(){this._attach()}hostDisconnected(){this._detach()}_resolveTarget(){const{target:t}=this._options;return typeof t=="function"?t():t??null}_attach(){if(this._options.disabled||this._attached)return;const t=this._resolveTarget();t&&(this._observer??=new MutationObserver(this._options.callback),this._observer.observe(t,this._options.observerOptions??{childList:!0}),this._attached=t)}_detach(){this._observer?.disconnect(),this._attached=null}}class Go{constructor(t,n){this._frame=0,this._links=[],this._host=t,this._options=n,t.addController(this)}hostConnected(){this.sync()}hostDisconnected(){this._mutationObserver?.disconnect(),this._resizeObserver?.disconnect(),this._mutationObserver=void 0,this._resizeObserver=void 0,this._frame&&cancelAnimationFrame(this._frame),this._frame=0}sync(){this._collectLinks(),this._observeLinks(),this.update()}update(){this._frame&&cancelAnimationFrame(this._frame),this._frame=requestAnimationFrame(()=>{this._frame=0,this._positionIndicator()})}_collectLinks(){const n=this._options.slot()?.assignedElements({flatten:!0})??[],i=new Set;for(const s of n)s instanceof HTMLAnchorElement&&i.add(s),s.querySelectorAll("a").forEach(r=>i.add(r));this._links=Array.from(i)}_observeLinks(){this._mutationObserver?.disconnect(),this._resizeObserver?.disconnect(),this._mutationObserver=new MutationObserver(()=>{this._collectLinks(),this._observeLinks(),this.update()}),this._resizeObserver=new ResizeObserver(()=>this.update()),this._resizeObserver.observe(this._host);for(const t of this._links){this._mutationObserver.observe(t,{attributes:!0,attributeFilter:["aria-current","class","data-active"],childList:!0,subtree:!0}),this._resizeObserver.observe(t);const n=this._targetFor(t);n&&n!==t&&this._resizeObserver.observe(n)}}_activeLink(){const t=this._options.activeSelector().trim();if(t){const n=this._links.find(i=>i.matches(t));if(n)return n}return this._links.find(n=>{const i=n.getAttribute("aria-current");return i!==null&&i!==""&&i!=="false"})??null}_targetFor(t){const n=this._options.indicatorTargetSelector().trim();if(n){const i=t.matches(n)?t:t.querySelector(n);if(i)return i}return t.querySelector("[data-rc-navigation-indicator]")??t.querySelector("[data-rc-navigation-icon]")??t}_positionIndicator(){const t=this._options.container(),n=this._options.indicator(),i=this._activeLink();if(this._host.toggleAttribute("has-active",!!i),!t||!n||!i){n?.toggleAttribute("hidden",!0);return}const s=this._targetFor(i),r=t.getBoundingClientRect(),l=s.getBoundingClientRect();if(!l.width||!l.height){n.toggleAttribute("hidden",!0);return}n.toggleAttribute("hidden",!1),n.style.inlineSize=`${l.width}px`,n.style.blockSize=`${l.height}px`,n.style.transform=`translate(${l.left-r.left}px, ${l.top-r.top}px)`}}class Ko{constructor(t){this._callback=null,this._frame=0,t?.addController(this)}get pending(){return this._frame!==0}schedule(t){this._callback=t,!this._frame&&(this._frame=requestAnimationFrame(n=>{const i=this._callback;this._frame=0,this._callback=null,i?.(n)}))}cancel(){this._frame&&(cancelAnimationFrame(this._frame),this._frame=0,this._callback=null)}hostDisconnected(){this.cancel()}}class Qo{constructor(t){this._buffer="",this._timer=0,this._options=t}get buffer(){return this._buffer}reset(){this._buffer="",this._clearTimer()}handleKeydown(t){return t.key.length!==1||t.altKey||t.ctrlKey||t.metaKey?!1:(this.search(t.key),t.preventDefault(),!0)}search(t){this._buffer+=t.toLocaleLowerCase(),this._scheduleReset();const n=this._options.items();if(!n.length)return null;const i=this._options.startIndex?.()??0,s=n.length;for(let r=1;r<=s;r+=1){const l=(i+r)%s,c=n[l];if(this._options.text(c).trim().toLocaleLowerCase().startsWith(this._buffer))return this._options.onMatch(c,l),c}return null}_scheduleReset(){this._clearTimer(),this._timer=window.setTimeout(()=>this.reset(),this._options.timeout??500)}_clearTimer(){this._timer&&(window.clearTimeout(this._timer),this._timer=0)}}function Jo(e){let t=e.parentElement;for(;t&&t!==document.documentElement;){const{overflow:n,overflowY:i}=getComputedStyle(t);if(/auto|scroll/.test(i)||/auto|scroll/.test(n))return t;t=t.parentElement}return document.scrollingElement??document.documentElement}function Nn(e){return e==null||e.hasAttribute("disabled")?!1:!!((e instanceof HTMLAnchorElement||e instanceof HTMLAreaElement)&&e.hasAttribute("href")||e instanceof HTMLButtonElement||e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement||e instanceof HTMLSelectElement||e.hasAttribute("tabindex")||e.shadowRoot?.delegatesFocus===!0)}function Hn(e,t){return e.querySelector(t)}function Wn(e,t){return Array.from(e.querySelectorAll(t))}function Zo(e,t){if(Wn(e,t.selector).length>=(t.minimum??1))return!1;const n=t.hostName??e.localName,i=t.childDescription??t.selector.replace(":scope > ",""),s=t.message??`[${n}] No direct child ${i} found. Place ${i} inside <${n}>.`;return console.warn(s,e),!0}class tl{constructor(t,n){this._observer=null,this._child=null,this._host=t,this._options=n,t.addController(this)}get child(){return this._child}hostConnected(){if(this.sync(),!this._options.observe)return;this._observer??=new MutationObserver(()=>this.sync());const t=this._options.observe===!0?{childList:!0}:this._options.observe;this._observer.observe(this._host,t)}hostDisconnected(){this._observer?.disconnect(),this._child=null}sync(){const t=this._child,n=Hn(this._host,this._options.selector);return this._child=n,n||this._options.onMissing?.(this._host),n!==t&&this._options.onChange?.(n,t),n}}var el=Object.defineProperty,nl=(e,t,n,i)=>{for(var s=void 0,r=e.length-1,l;r>=0;r--)(l=e[r])&&(s=l(t,n,s)||s);return s&&el(t,n,s),s};function il(e){class t extends e{constructor(){super(...arguments),this._items=[]}get items(){return this._items.map(i=>i.deref()).filter(i=>Nn(i))}get firstItem(){return this.items.at(0)}get lastItem(){return this.items.at(-1)}get nextItem(){const i=this._lastFocused?this.items.indexOf(this._lastFocused):0;return this.items.at((i+1)%this.items.length)}get previousItem(){const i=this._lastFocused?this.items.indexOf(this._lastFocused):0;return this.items.at((i-1)%this.items.length)}focusItem(i){i?.focus()}focusItemAt(i){this.focusItem(this.items.at(i))}focusFirst(){this.focusItem(this.firstItem)}focusLast(){this.focusItem(this.lastItem)}_collectItems(i){return i.assignedElements()}_handleItemFocus(i){const s=i.composedPath().find(r=>this.items.includes(r));s!=null&&(this._lastFocused=s,this.items.forEach(r=>r.setAttribute("tabindex","-1")),s.setAttribute("tabindex","0"))}_onSlotChange(i){const s=this._items;this._items=this._collectItems(i.currentTarget).map(r=>new WeakRef(r)),queueMicrotask(()=>{this.isConnected&&(s.forEach(r=>r.deref()?.removeAttribute("tabindex")),this._initItems())})}_initItems(){this._items.forEach(s=>s.deref()?.setAttribute("tabindex","-1"));const i=this.items[0];i&&i.setAttribute("tabindex","0")}}return nl([Do.state()],t.prototype,"_lastFocused"),t}function sl(e,t,n,i){const s=Math.min(Math.max(e,t),n);if(i<=0)return s;const r=Math.round((s-t)/i)*i+t;return Math.min(Math.max(r,t),n)}function rl(e,t,n){return n===t?0:Math.min(Math.max((e-t)/(n-t),0),1)}function ol(e,t){let n=-1,i=1/0;return e.forEach((s,r)=>{const l=Math.abs(s-t);Number.isFinite(s)&&l<i&&(n=r,i=l)}),n}function ll(e,t,n){if(n>0){const i=e.findIndex(s=>Number.isFinite(s)&&s>t);return i>=0?i:e.length-1}for(let i=e.length-1;i>=0;i-=1)if(Number.isFinite(e[i])&&e[i]<t)return i;return e.length>0?0:-1}function al(e,t){return e.length===0?-1:t>0?e.length-1:0}var cl=Object.defineProperty,hl=Object.defineProperties,ul=Object.getOwnPropertyDescriptors,Bn=Object.getOwnPropertySymbols,fl=Object.prototype.hasOwnProperty,dl=Object.prototype.propertyIsEnumerable,Un=(e,t,n)=>t in e?cl(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,U=(e,t)=>{for(var n in t||(t={}))fl.call(t,n)&&Un(e,n,t[n]);if(Bn)for(var n of Bn(t))dl.call(t,n)&&Un(e,n,t[n]);return e},J=(e,t)=>hl(e,ul(t)),P=(e,t,n)=>new Promise((i,s)=>{var r=a=>{try{c(n.next(a))}catch(o){s(o)}},l=a=>{try{c(n.throw(a))}catch(o){s(o)}},c=a=>a.done?i(a.value):Promise.resolve(a.value).then(r,l);c((n=n.apply(e,t)).next())});const Ve=Math.min,Nt=Math.max,me=Math.round,ge=Math.floor,mt=e=>({x:e,y:e});function pl(e,t){return typeof e=="function"?e(t):e}function ml(e){return U({top:0,right:0,bottom:0,left:0},e)}function gl(e){return typeof e!="number"?ml(e):{top:e,right:e,bottom:e,left:e}}function _e(e){const{x:t,y:n,width:i,height:s}=e;return{width:i,height:s,top:n,left:t,right:t+i,bottom:n+s,x:t,y:n}}function _l(e,t){return P(this,null,function*(){var n;t===void 0&&(t={});const{x:i,y:s,platform:r,rects:l,elements:c,strategy:a}=e,{boundary:o="clippingAncestors",rootBoundary:h="viewport",elementContext:u="floating",altBoundary:f=!1,padding:d=0}=pl(t,e),p=gl(d),g=c[f?u==="floating"?"reference":"floating":u],y=_e(yield r.getClippingRect({element:(n=yield r.isElement==null?void 0:r.isElement(g))==null||n?g:g.contextElement||(yield r.getDocumentElement==null?void 0:r.getDocumentElement(c.floating)),boundary:o,rootBoundary:h,strategy:a})),_=u==="floating"?{x:i,y:s,width:l.floating.width,height:l.floating.height}:l.reference,L=yield r.getOffsetParent==null?void 0:r.getOffsetParent(c.floating),C=(yield r.isElement==null?void 0:r.isElement(L))?(yield r.getScale==null?void 0:r.getScale(L))||{x:1,y:1}:{x:1,y:1},T=_e(r.convertOffsetParentRelativeRectToViewportRelativeRect?yield r.convertOffsetParentRelativeRectToViewportRelativeRect({elements:c,rect:_,offsetParent:L,strategy:a}):_);return{top:(y.top-T.top+p.top)/C.y,bottom:(T.bottom-y.bottom+p.bottom)/C.y,left:(y.left-T.left+p.left)/C.x,right:(T.right-y.right+p.right)/C.x}})}function ye(){return typeof window<"u"}function Ht(e){return Vn(e)?(e.nodeName||"").toLowerCase():"#document"}function et(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function gt(e){var t;return(t=(Vn(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Vn(e){return ye()?e instanceof Node||e instanceof et(e).Node:!1}function at(e){return ye()?e instanceof Element||e instanceof et(e).Element:!1}function _t(e){return ye()?e instanceof HTMLElement||e instanceof et(e).HTMLElement:!1}function Xn(e){return!ye()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof et(e).ShadowRoot}const yl=new Set(["inline","contents"]);function ie(e){const{overflow:t,overflowX:n,overflowY:i,display:s}=ct(e);return/auto|scroll|overlay|hidden|clip/.test(t+i+n)&&!yl.has(s)}const bl=new Set(["table","td","th"]);function kl(e){return bl.has(Ht(e))}const vl=[":popover-open",":modal"];function be(e){return vl.some(t=>{try{return e.matches(t)}catch{return!1}})}const Sl=["transform","translate","scale","rotate","perspective"],wl=["transform","translate","scale","rotate","perspective","filter"],Cl=["paint","layout","strict","content"];function Xe(e){const t=Ye(),n=at(e)?ct(e):e;return Sl.some(i=>n[i]?n[i]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||wl.some(i=>(n.willChange||"").includes(i))||Cl.some(i=>(n.contain||"").includes(i))}function xl(e){let t=Ct(e);for(;_t(t)&&!Wt(t);){if(Xe(t))return t;if(be(t))return null;t=Ct(t)}return null}function Ye(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const Ll=new Set(["html","body","#document"]);function Wt(e){return Ll.has(Ht(e))}function ct(e){return et(e).getComputedStyle(e)}function ke(e){return at(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Ct(e){if(Ht(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Xn(e)&&e.host||gt(e);return Xn(t)?t.host:t}function Yn(e){const t=Ct(e);return Wt(t)?e.ownerDocument?e.ownerDocument.body:e.body:_t(t)&&ie(t)?t:Yn(t)}function se(e,t,n){var i;t===void 0&&(t=[]),n===void 0&&(n=!0);const s=Yn(e),r=s===((i=e.ownerDocument)==null?void 0:i.body),l=et(s);if(r){const c=qe(l);return t.concat(l,l.visualViewport||[],ie(s)?s:[],c&&n?se(c):[])}return t.concat(s,se(s,[],n))}function qe(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function qn(e){const t=ct(e);let n=parseFloat(t.width)||0,i=parseFloat(t.height)||0;const s=_t(e),r=s?e.offsetWidth:n,l=s?e.offsetHeight:i,c=me(n)!==r||me(i)!==l;return c&&(n=r,i=l),{width:n,height:i,$:c}}function Ge(e){return at(e)?e:e.contextElement}function Bt(e){const t=Ge(e);if(!_t(t))return mt(1);const n=t.getBoundingClientRect(),{width:i,height:s,$:r}=qn(t);let l=(r?me(n.width):n.width)/i,c=(r?me(n.height):n.height)/s;return(!l||!Number.isFinite(l))&&(l=1),(!c||!Number.isFinite(c))&&(c=1),{x:l,y:c}}const Al=mt(0);function Gn(e){const t=et(e);return!Ye()||!t.visualViewport?Al:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Tl(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==et(e)?!1:t}function Pt(e,t,n,i){t===void 0&&(t=!1),n===void 0&&(n=!1);const s=e.getBoundingClientRect(),r=Ge(e);let l=mt(1);t&&(i?at(i)&&(l=Bt(i)):l=Bt(e));const c=Tl(r,n,i)?Gn(r):mt(0);let a=(s.left+c.x)/l.x,o=(s.top+c.y)/l.y,h=s.width/l.x,u=s.height/l.y;if(r){const f=et(r),d=i&&at(i)?et(i):i;let p=f,g=qe(p);for(;g&&i&&d!==p;){const y=Bt(g),_=g.getBoundingClientRect(),L=ct(g),C=_.left+(g.clientLeft+parseFloat(L.paddingLeft))*y.x,T=_.top+(g.clientTop+parseFloat(L.paddingTop))*y.y;a*=y.x,o*=y.y,h*=y.x,u*=y.y,a+=C,o+=T,p=et(g),g=qe(p)}}return _e({width:h,height:u,x:a,y:o})}function ve(e,t){const n=ke(e).scrollLeft;return t?t.left+n:Pt(gt(e)).left+n}function Kn(e,t){const n=e.getBoundingClientRect(),i=n.left+t.scrollLeft-ve(e,n),s=n.top+t.scrollTop;return{x:i,y:s}}function El(e){let{elements:t,rect:n,offsetParent:i,strategy:s}=e;const r=s==="fixed",l=gt(i),c=t?be(t.floating):!1;if(i===l||c&&r)return n;let a={scrollLeft:0,scrollTop:0},o=mt(1);const h=mt(0),u=_t(i);if((u||!u&&!r)&&((Ht(i)!=="body"||ie(l))&&(a=ke(i)),_t(i))){const d=Pt(i);o=Bt(i),h.x=d.x+i.clientLeft,h.y=d.y+i.clientTop}const f=l&&!u&&!r?Kn(l,a):mt(0);return{width:n.width*o.x,height:n.height*o.y,x:n.x*o.x-a.scrollLeft*o.x+h.x+f.x,y:n.y*o.y-a.scrollTop*o.y+h.y+f.y}}function Pl(e){return Array.from(e.getClientRects())}function Ol(e){const t=gt(e),n=ke(e),i=e.ownerDocument.body,s=Nt(t.scrollWidth,t.clientWidth,i.scrollWidth,i.clientWidth),r=Nt(t.scrollHeight,t.clientHeight,i.scrollHeight,i.clientHeight);let l=-n.scrollLeft+ve(e);const c=-n.scrollTop;return ct(i).direction==="rtl"&&(l+=Nt(t.clientWidth,i.clientWidth)-s),{width:s,height:r,x:l,y:c}}const Qn=25;function Dl(e,t){const n=et(e),i=gt(e),s=n.visualViewport;let r=i.clientWidth,l=i.clientHeight,c=0,a=0;if(s){r=s.width,l=s.height;const h=Ye();(!h||h&&t==="fixed")&&(c=s.offsetLeft,a=s.offsetTop)}const o=ve(i);if(o<=0){const h=i.ownerDocument,u=h.body,f=getComputedStyle(u),d=h.compatMode==="CSS1Compat"&&parseFloat(f.marginLeft)+parseFloat(f.marginRight)||0,p=Math.abs(i.clientWidth-u.clientWidth-d);p<=Qn&&(r-=p)}else o<=Qn&&(r+=o);return{width:r,height:l,x:c,y:a}}const Il=new Set(["absolute","fixed"]);function Rl(e,t){const n=Pt(e,!0,t==="fixed"),i=n.top+e.clientTop,s=n.left+e.clientLeft,r=_t(e)?Bt(e):mt(1),l=e.clientWidth*r.x,c=e.clientHeight*r.y,a=s*r.x,o=i*r.y;return{width:l,height:c,x:a,y:o}}function Jn(e,t,n){let i;if(t==="viewport")i=Dl(e,n);else if(t==="document")i=Ol(gt(e));else if(at(t))i=Rl(t,n);else{const s=Gn(e);i={x:t.x-s.x,y:t.y-s.y,width:t.width,height:t.height}}return _e(i)}function Zn(e,t){const n=Ct(e);return n===t||!at(n)||Wt(n)?!1:ct(n).position==="fixed"||Zn(n,t)}function Ml(e,t){const n=t.get(e);if(n)return n;let i=se(e,[],!1).filter(c=>at(c)&&Ht(c)!=="body"),s=null;const r=ct(e).position==="fixed";let l=r?Ct(e):e;for(;at(l)&&!Wt(l);){const c=ct(l),a=Xe(l);!a&&c.position==="fixed"&&(s=null),(r?!a&&!s:!a&&c.position==="static"&&s&&Il.has(s.position)||ie(l)&&!a&&Zn(e,l))?i=i.filter(o=>o!==l):s=c,l=Ct(l)}return t.set(e,i),i}function Fl(e){let{element:t,boundary:n,rootBoundary:i,strategy:s}=e;const r=[...n==="clippingAncestors"?be(t)?[]:Ml(t,this._c):[].concat(n),i],l=r[0],c=r.reduce((a,o)=>{const h=Jn(t,o,s);return a.top=Nt(h.top,a.top),a.right=Ve(h.right,a.right),a.bottom=Ve(h.bottom,a.bottom),a.left=Nt(h.left,a.left),a},Jn(t,l,s));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}function jl(e){const{width:t,height:n}=qn(e);return{width:t,height:n}}function zl(e,t,n){const i=_t(t),s=gt(t),r=n==="fixed",l=Pt(e,!0,r,t);let c={scrollLeft:0,scrollTop:0};const a=mt(0);function o(){a.x=ve(s)}if(i||!i&&!r)if((Ht(t)!=="body"||ie(s))&&(c=ke(t)),i){const d=Pt(t,!0,r,t);a.x=d.x+t.clientLeft,a.y=d.y+t.clientTop}else s&&o();r&&!i&&s&&o();const h=s&&!i&&!r?Kn(s,c):mt(0),u=l.left+c.scrollLeft-a.x-h.x,f=l.top+c.scrollTop-a.y-h.y;return{x:u,y:f,width:l.width,height:l.height}}function Ke(e){return ct(e).position==="static"}function ti(e,t){if(!_t(e)||ct(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return gt(e)===n&&(n=n.ownerDocument.body),n}function ei(e,t){const n=et(e);if(be(e))return n;if(!_t(e)){let s=Ct(e);for(;s&&!Wt(s);){if(at(s)&&!Ke(s))return s;s=Ct(s)}return n}let i=ti(e,t);for(;i&&kl(i)&&Ke(i);)i=ti(i,t);return i&&Wt(i)&&Ke(i)&&!Xe(i)?n:i||xl(e)||n}const $l=function(e){return P(this,null,function*(){const t=this.getOffsetParent||ei,n=this.getDimensions,i=yield n(e.floating);return{reference:zl(e.reference,yield t(e.floating),e.strategy),floating:{x:0,y:0,width:i.width,height:i.height}}})};function Nl(e){return ct(e).direction==="rtl"}const nt={convertOffsetParentRelativeRectToViewportRelativeRect:El,getDocumentElement:gt,getClippingRect:Fl,getOffsetParent:ei,getElementRects:$l,getClientRects:Pl,getDimensions:jl,getScale:Bt,isElement:at,isRTL:Nl};function ni(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Hl(e,t){let n=null,i;const s=gt(e);function r(){var c;clearTimeout(i),(c=n)==null||c.disconnect(),n=null}function l(c,a){c===void 0&&(c=!1),a===void 0&&(a=1),r();const o=e.getBoundingClientRect(),{left:h,top:u,width:f,height:d}=o;if(c||t(),!f||!d)return;const p=ge(u),g=ge(s.clientWidth-(h+f)),y=ge(s.clientHeight-(u+d)),_=ge(h),L={rootMargin:-p+"px "+-g+"px "+-y+"px "+-_+"px",threshold:Nt(0,Ve(1,a))||1};let C=!0;function T(pt){const v=pt[0].intersectionRatio;if(v!==a){if(!C)return l();v?l(!1,v):i=setTimeout(()=>{l(!1,1e-7)},1e3)}v===1&&!ni(o,e.getBoundingClientRect())&&l(),C=!1}try{n=new IntersectionObserver(T,J(U({},L),{root:s.ownerDocument}))}catch{n=new IntersectionObserver(T,L)}n.observe(e)}return l(!0),r}function Qe(e,t,n,i){i===void 0&&(i={});const{ancestorScroll:s=!0,ancestorResize:r=!0,elementResize:l=typeof ResizeObserver=="function",layoutShift:c=typeof IntersectionObserver=="function",animationFrame:a=!1}=i,o=Ge(e),h=s||r?[...o?se(o):[],...se(t)]:[];h.forEach(_=>{s&&_.addEventListener("scroll",n,{passive:!0}),r&&_.addEventListener("resize",n)});const u=o&&c?Hl(o,n):null;let f=-1,d=null;l&&(d=new ResizeObserver(_=>{let[L]=_;L&&L.target===o&&d&&(d.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var C;(C=d)==null||C.observe(t)})),n()}),o&&!a&&d.observe(o),d.observe(t));let p,g=a?Pt(e):null;a&&y();function y(){const _=Pt(e);g&&!ni(g,_)&&n(),g=_,p=requestAnimationFrame(y)}return n(),()=>{var _;h.forEach(L=>{s&&L.removeEventListener("scroll",n),r&&L.removeEventListener("resize",n)}),u?.(),(_=d)==null||_.disconnect(),d=null,a&&cancelAnimationFrame(p)}}const Wl=_l,{hasOwnProperty:Je}=Object.prototype,re=function(){};function ii(e){return typeof e=="function"?e:re}function si(e,t){return function(n,i,s){n.type===t&&e.call(this,n,i,s)}}function Bl(e,t){const n=t.structure,i=[];for(const s in n){if(Je.call(n,s)===!1)continue;let r=n[s];const l={name:s,type:!1,nullable:!1};Array.isArray(r)||(r=[r]);for(const c of r)c===null?l.nullable=!0:typeof c=="string"?l.type="node":Array.isArray(c)&&(l.type="list");l.type&&i.push(l)}return i.length?{context:t.walkContext,fields:i}:null}function Ul(e){const t={};for(const n in e.node)if(Je.call(e.node,n)){const i=e.node[n];if(!i.structure)throw new Error("Missed `structure` field in `"+n+"` node type definition");t[n]=Bl(n,i)}return t}function ri(e,t){const n=e.fields.slice(),i=e.context,s=typeof i=="string";return t&&n.reverse(),function(r,l,c,a){let o;s&&(o=l[i],l[i]=r);for(const h of n){const u=r[h.name];if(!h.nullable||u){if(h.type==="list"){if(t?u.reduceRight(a,!1):u.reduce(a,!1))return!0}else if(c(u))return!0}}s&&(l[i]=o)}}function oi({StyleSheet:e,Atrule:t,Rule:n,Block:i,DeclarationList:s}){return{Atrule:{StyleSheet:e,Atrule:t,Rule:n,Block:i},Rule:{StyleSheet:e,Atrule:t,Rule:n,Block:i},Declaration:{StyleSheet:e,Atrule:t,Rule:n,Block:i,DeclarationList:s}}}function Vl(e){const t=Ul(e),n={},i={},s=Symbol("break-walk"),r=Symbol("skip-node");for(const o in t)Je.call(t,o)&&t[o]!==null&&(n[o]=ri(t[o],!1),i[o]=ri(t[o],!0));const l=oi(n),c=oi(i),a=function(o,h){function u(_,L,C){const T=f.call(y,_,L,C);return T===s?!0:T===r?!1:!!(p.hasOwnProperty(_.type)&&p[_.type](_,y,u,g)||d.call(y,_,L,C)===s)}let f=re,d=re,p=n,g=(_,L,C,T)=>_||u(L,C,T);const y={break:s,skip:r,root:o,stylesheet:null,atrule:null,atrulePrelude:null,rule:null,selector:null,block:null,declaration:null,function:null};if(typeof h=="function")f=h;else if(h&&(f=ii(h.enter),d=ii(h.leave),h.reverse&&(p=i),h.visit)){if(l.hasOwnProperty(h.visit))p=h.reverse?c[h.visit]:l[h.visit];else if(!t.hasOwnProperty(h.visit))throw new Error("Bad value `"+h.visit+"` for `visit` option (should be: "+Object.keys(t).sort().join(", ")+")");f=si(f,h.visit),d=si(d,h.visit)}if(f===re&&d===re)throw new Error("Neither `enter` nor `leave` walker handler is set or both aren't a function");u(o)};return a.break=s,a.skip=r,a.find=function(o,h){let u=null;return a(o,function(f,d,p){if(h.call(this,f,d,p))return u=f,s}),u},a.findLast=function(o,h){let u=null;return a(o,{reverse:!0,enter(f,d,p){if(h.call(this,f,d,p))return u=f,s}}),u},a.findAll=function(o,h){const u=[];return a(o,function(f,d,p){h.call(this,f,d,p)&&u.push(f)}),u},a}const xt=0,m=1,w=2,B=3,I=4,wt=5,Xl=6,Y=7,ht=8,A=9,k=10,$=11,x=12,N=13,Se=14,it=15,q=16,Z=17,ut=18,Ut=19,oe=20,O=21,b=22,ft=23,Vt=24,G=25,Yl=0;function st(e){return e>=48&&e<=57}function Xt(e){return st(e)||e>=65&&e<=70||e>=97&&e<=102}function Ze(e){return e>=65&&e<=90}function ql(e){return e>=97&&e<=122}function Gl(e){return Ze(e)||ql(e)}function Kl(e){return e>=128}function we(e){return Gl(e)||Kl(e)||e===95}function li(e){return we(e)||st(e)||e===45}function Ql(e){return e>=0&&e<=8||e===11||e>=14&&e<=31||e===127}function Ce(e){return e===10||e===13||e===12}function Ot(e){return Ce(e)||e===32||e===9}function yt(e,t){return!(e!==92||Ce(t)||t===Yl)}function tn(e,t,n){return e===45?we(t)||t===45||yt(t,n):we(e)?!0:e===92?yt(e,t):!1}function en(e,t,n){return e===43||e===45?st(t)?2:t===46&&st(n)?3:0:e===46?st(t)?2:0:st(e)?1:0}function ai(e){return e===65279||e===65534?1:0}const nn=new Array(128),Jl=128,xe=130,ci=131,sn=132,hi=133;for(let e=0;e<nn.length;e++)nn[e]=Ot(e)&&xe||st(e)&&ci||we(e)&&sn||Ql(e)&&hi||e||Jl;function rn(e){return e<128?nn[e]:sn}function Yt(e,t){return t<e.length?e.charCodeAt(t):0}function on(e,t,n){return n===13&&Yt(e,t+1)===10?2:1}function ui(e,t,n){let i=e.charCodeAt(t);return Ze(i)&&(i=i|32),i===n}function Le(e,t,n,i){if(n-t!==i.length||t<0||n>e.length)return!1;for(let s=t;s<n;s++){const r=i.charCodeAt(s-t);let l=e.charCodeAt(s);if(Ze(l)&&(l=l|32),l!==r)return!1}return!0}function Zl(e,t){for(;t>=0&&Ot(e.charCodeAt(t));t--);return t+1}function Ae(e,t){for(;t<e.length&&Ot(e.charCodeAt(t));t++);return t}function ln(e,t){for(;t<e.length&&st(e.charCodeAt(t));t++);return t}function qt(e,t){if(t+=2,Xt(Yt(e,t-1))){for(const i=Math.min(e.length,t+5);t<i&&Xt(Yt(e,t));t++);const n=Yt(e,t);Ot(n)&&(t+=on(e,t,n))}return t}function Te(e,t){for(;t<e.length;t++){const n=e.charCodeAt(t);if(!li(n)){if(yt(n,Yt(e,t+1))){t=qt(e,t)-1;continue}break}}return t}function fi(e,t){let n=e.charCodeAt(t);if((n===43||n===45)&&(n=e.charCodeAt(t+=1)),st(n)&&(t=ln(e,t+1),n=e.charCodeAt(t)),n===46&&st(e.charCodeAt(t+1))&&(t+=2,t=ln(e,t)),ui(e,t,101)){let i=0;n=e.charCodeAt(t+1),(n===45||n===43)&&(i=1,n=e.charCodeAt(t+2)),st(n)&&(t=ln(e,t+1+i+1))}return t}function an(e,t){for(;t<e.length;t++){const n=e.charCodeAt(t);if(n===41){t++;break}yt(n,Yt(e,t+1))&&(t=qt(e,t))}return t}function di(e){if(e.length===1&&!Xt(e.charCodeAt(0)))return e[0];let t=parseInt(e,16);return(t===0||t>=55296&&t<=57343||t>1114111)&&(t=65533),String.fromCodePoint(t)}const pi=["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"],ta=16*1024;function Ee(e=null,t){return e===null||e.length<t?new Uint32Array(Math.max(t+1024,ta)):e}const mi=10,ea=12,gi=13;function _i(e){const t=e.source,n=t.length,i=t.length>0?ai(t.charCodeAt(0)):0,s=Ee(e.lines,n),r=Ee(e.columns,n);let l=e.startLine,c=e.startColumn;for(let a=i;a<n;a++){const o=t.charCodeAt(a);s[a]=l,r[a]=c++,(o===mi||o===gi||o===ea)&&(o===gi&&a+1<n&&t.charCodeAt(a+1)===mi&&(a++,s[a]=l,r[a]=c),l++,c=1)}s[n]=l,r[n]=c,e.lines=s,e.columns=r,e.computed=!0}class na{constructor(t,n,i,s){this.setSource(t,n,i,s),this.lines=null,this.columns=null}setSource(t="",n=0,i=1,s=1){this.source=t,this.startOffset=n,this.startLine=i,this.startColumn=s,this.computed=!1}getLocation(t,n){return this.computed||_i(this),{source:n,offset:this.startOffset+t,line:this.lines[t],column:this.columns[t]}}getLocationRange(t,n,i){return this.computed||_i(this),{source:i,start:{offset:this.startOffset+t,line:this.lines[t],column:this.columns[t]},end:{offset:this.startOffset+n,line:this.lines[n],column:this.columns[n]}}}}const bt=16777215,kt=24,Dt=new Uint8Array(32);Dt[w]=b,Dt[O]=b,Dt[Ut]=oe,Dt[ft]=Vt;function yi(e){return Dt[e]!==0}class ia{constructor(t,n){this.setSource(t,n)}reset(){this.eof=!1,this.tokenIndex=-1,this.tokenType=0,this.tokenStart=this.firstCharOffset,this.tokenEnd=this.firstCharOffset}setSource(t="",n=()=>{}){t=String(t||"");const i=t.length,s=Ee(this.offsetAndType,t.length+1),r=Ee(this.balance,t.length+1);let l=0,c=-1,a=0,o=t.length;this.offsetAndType=null,this.balance=null,r.fill(0),n(t,(h,u,f)=>{const d=l++;if(s[d]=h<<kt|f,c===-1&&(c=u),r[d]=o,h===a){const p=r[o];r[o]=d,o=p,a=Dt[s[p]>>kt]}else yi(h)&&(o=d,a=Dt[h])}),s[l]=xt<<kt|i,r[l]=l;for(let h=0;h<l;h++){const u=r[h];if(u<=h){const f=r[u];f!==h&&(r[h]=f)}else u>l&&(r[h]=l)}this.source=t,this.firstCharOffset=c===-1?0:c,this.tokenCount=l,this.offsetAndType=s,this.balance=r,this.reset(),this.next()}lookupType(t){return t+=this.tokenIndex,t<this.tokenCount?this.offsetAndType[t]>>kt:xt}lookupTypeNonSC(t){for(let n=this.tokenIndex;n<this.tokenCount;n++){const i=this.offsetAndType[n]>>kt;if(i!==N&&i!==G&&t--===0)return i}return xt}lookupOffset(t){return t+=this.tokenIndex,t<this.tokenCount?this.offsetAndType[t-1]&bt:this.source.length}lookupOffsetNonSC(t){for(let n=this.tokenIndex;n<this.tokenCount;n++){const i=this.offsetAndType[n]>>kt;if(i!==N&&i!==G&&t--===0)return n-this.tokenIndex}return xt}lookupValue(t,n){return t+=this.tokenIndex,t<this.tokenCount?Le(this.source,this.offsetAndType[t-1]&bt,this.offsetAndType[t]&bt,n):!1}getTokenStart(t){return t===this.tokenIndex?this.tokenStart:t>0?t<this.tokenCount?this.offsetAndType[t-1]&bt:this.offsetAndType[this.tokenCount]&bt:this.firstCharOffset}substrToCursor(t){return this.source.substring(t,this.tokenStart)}isBalanceEdge(t){return this.balance[this.tokenIndex]<t}isDelim(t,n){return n?this.lookupType(n)===A&&this.source.charCodeAt(this.lookupOffset(n))===t:this.tokenType===A&&this.source.charCodeAt(this.tokenStart)===t}skip(t){let n=this.tokenIndex+t;n<this.tokenCount?(this.tokenIndex=n,this.tokenStart=this.offsetAndType[n-1]&bt,n=this.offsetAndType[n],this.tokenType=n>>kt,this.tokenEnd=n&bt):(this.tokenIndex=this.tokenCount,this.next())}next(){let t=this.tokenIndex+1;t<this.tokenCount?(this.tokenIndex=t,this.tokenStart=this.tokenEnd,t=this.offsetAndType[t],this.tokenType=t>>kt,this.tokenEnd=t&bt):(this.eof=!0,this.tokenIndex=this.tokenCount,this.tokenType=xt,this.tokenStart=this.tokenEnd=this.source.length)}skipSC(){for(;this.tokenType===N||this.tokenType===G;)this.next()}skipUntilBalanced(t,n){let i=t,s=0,r=0;t:for(;i<this.tokenCount;i++){if(s=this.balance[i],s<t)break t;switch(r=i>0?this.offsetAndType[i-1]&bt:this.firstCharOffset,n(this.source.charCodeAt(r))){case 1:break t;case 2:i++;break t;default:yi(this.offsetAndType[i]>>kt)&&(i=s)}}this.skip(i-this.tokenIndex)}forEachToken(t){for(let n=0,i=this.firstCharOffset;n<this.tokenCount;n++){const s=i,r=this.offsetAndType[n],l=r&bt,c=r>>kt;i=l,t(c,s,l,n)}}dump(){const t=new Array(this.tokenCount);return this.forEachToken((n,i,s,r)=>{t[r]={idx:r,type:pi[n],chunk:this.source.substring(i,s),balance:this.balance[r]}}),t}}function bi(e,t){function n(u){return u<c?e.charCodeAt(u):0}function i(){if(o=fi(e,o),tn(n(o),n(o+1),n(o+2))){h=x,o=Te(e,o);return}if(n(o)===37){h=$,o++;return}h=k}function s(){const u=o;if(o=Te(e,o),Le(e,u,o,"url")&&n(o)===40){if(o=Ae(e,o+1),n(o)===34||n(o)===39){h=w,o=u+4;return}l();return}if(n(o)===40){h=w,o++;return}h=m}function r(u){for(u||(u=n(o++)),h=wt;o<e.length;o++){const f=e.charCodeAt(o);switch(rn(f)){case u:o++;return;case xe:if(Ce(f)){o+=on(e,o,f),h=Xl;return}break;case 92:if(o===e.length-1)break;const d=n(o+1);Ce(d)?o+=on(e,o+1,d):yt(f,d)&&(o=qt(e,o)-1);break}}}function l(){for(h=Y,o=Ae(e,o);o<e.length;o++){const u=e.charCodeAt(o);switch(rn(u)){case 41:o++;return;case xe:if(o=Ae(e,o),n(o)===41||o>=e.length){o<e.length&&o++;return}o=an(e,o),h=ht;return;case 34:case 39:case 40:case hi:o=an(e,o),h=ht;return;case 92:if(yt(u,n(o+1))){o=qt(e,o)-1;break}o=an(e,o),h=ht;return}}}e=String(e||"");const c=e.length;let a=ai(n(0)),o=a,h;for(;o<c;){const u=e.charCodeAt(o);switch(rn(u)){case xe:h=N,o=Ae(e,o+1);break;case 34:r();break;case 35:li(n(o+1))||yt(n(o+1),n(o+2))?(h=I,o=Te(e,o+1)):(h=A,o++);break;case 39:r();break;case 40:h=O,o++;break;case 41:h=b,o++;break;case 43:en(u,n(o+1),n(o+2))?i():(h=A,o++);break;case 44:h=ut,o++;break;case 45:en(u,n(o+1),n(o+2))?i():n(o+1)===45&&n(o+2)===62?(h=it,o=o+3):tn(u,n(o+1),n(o+2))?s():(h=A,o++);break;case 46:en(u,n(o+1),n(o+2))?i():(h=A,o++);break;case 47:n(o+1)===42?(h=G,o=e.indexOf("*/",o+2),o=o===-1?e.length:o+2):(h=A,o++);break;case 58:h=q,o++;break;case 59:h=Z,o++;break;case 60:n(o+1)===33&&n(o+2)===45&&n(o+3)===45?(h=Se,o=o+4):(h=A,o++);break;case 64:tn(n(o+1),n(o+2),n(o+3))?(h=B,o=Te(e,o+1)):(h=A,o++);break;case 91:h=Ut,o++;break;case 92:yt(u,n(o+1))?s():(h=A,o++);break;case 93:h=oe,o++;break;case 123:h=ft,o++;break;case 125:h=Vt,o++;break;case ci:i();break;case sn:s();break;default:h=A,o++}t(h,a,a=o)}}const vt=43,rt=45,Pe=110,It=!0,sa=!1;function Oe(e,t){let n=this.tokenStart+e;const i=this.charCodeAt(n);for((i===vt||i===rt)&&(t&&this.error("Number sign is not allowed"),n++);n<this.tokenEnd;n++)st(this.charCodeAt(n))||this.error("Integer is expected",n)}function Gt(e){return Oe.call(this,0,e)}function Lt(e,t){if(!this.cmpChar(this.tokenStart+e,t)){let n="";switch(t){case Pe:n="N is expected";break;case rt:n="HyphenMinus is expected";break}this.error(n,this.tokenStart+e)}}function cn(){let e=0,t=0,n=this.tokenType;for(;n===N||n===G;)n=this.lookupType(++e);if(n!==k)if(this.isDelim(vt,e)||this.isDelim(rt,e)){t=this.isDelim(vt,e)?vt:rt;do n=this.lookupType(++e);while(n===N||n===G);n!==k&&(this.skip(e),Gt.call(this,It))}else return null;return e>0&&this.skip(e),t===0&&(n=this.charCodeAt(this.tokenStart),n!==vt&&n!==rt&&this.error("Number sign is expected")),Gt.call(this,t!==0),t===rt?"-"+this.consume(k):this.consume(k)}const ra="AnPlusB",oa={a:[String,null],b:[String,null]};function ki(){const e=this.tokenStart;let t=null,n=null;if(this.tokenType===k)Gt.call(this,sa),n=this.consume(k);else if(this.tokenType===m&&this.cmpChar(this.tokenStart,rt))switch(t="-1",Lt.call(this,1,Pe),this.tokenEnd-this.tokenStart){case 2:this.next(),n=cn.call(this);break;case 3:Lt.call(this,2,rt),this.next(),this.skipSC(),Gt.call(this,It),n="-"+this.consume(k);break;default:Lt.call(this,2,rt),Oe.call(this,3,It),this.next(),n=this.substrToCursor(e+2)}else if(this.tokenType===m||this.isDelim(vt)&&this.lookupType(1)===m){let i=0;switch(t="1",this.isDelim(vt)&&(i=1,this.next()),Lt.call(this,0,Pe),this.tokenEnd-this.tokenStart){case 1:this.next(),n=cn.call(this);break;case 2:Lt.call(this,1,rt),this.next(),this.skipSC(),Gt.call(this,It),n="-"+this.consume(k);break;default:Lt.call(this,1,rt),Oe.call(this,2,It),this.next(),n=this.substrToCursor(e+i+1)}}else if(this.tokenType===x){const i=this.charCodeAt(this.tokenStart),s=i===vt||i===rt;let r=this.tokenStart+s;for(;r<this.tokenEnd&&st(this.charCodeAt(r));r++);r===this.tokenStart+s&&this.error("Integer is expected",this.tokenStart+s),Lt.call(this,r-this.tokenStart,Pe),t=this.substring(e,r),r+1===this.tokenEnd?(this.next(),n=cn.call(this)):(Lt.call(this,r-this.tokenStart+1,rt),r+2===this.tokenEnd?(this.next(),this.skipSC(),Gt.call(this,It),n="-"+this.consume(k)):(Oe.call(this,r-this.tokenStart+2,It),this.next(),n=this.substrToCursor(r+1)))}else this.error();return t!==null&&t.charCodeAt(0)===vt&&(t=t.substr(1)),n!==null&&n.charCodeAt(0)===vt&&(n=n.substr(1)),{type:"AnPlusB",loc:this.getLocation(e,this.tokenStart),a:t,b:n}}function vi(e){if(e.a){const t=e.a==="+1"&&"n"||e.a==="1"&&"n"||e.a==="-1"&&"-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 la=Object.freeze(Object.defineProperty({__proto__:null,generate:vi,name:ra,parse:ki,structure:oa},Symbol.toStringTag,{value:"Module"}));function Si(){return this.Raw(this.consumeUntilLeftCurlyBracketOrSemicolon,!0)}function aa(){for(let e=1,t;t=this.lookupType(e);e++){if(t===Vt)return!0;if(t===ft||t===B)return!1}return!1}const ca="Atrule",ha="atrule",ua={name:String,prelude:["AtrulePrelude","Raw",null],block:["Block",null]};function wi(e=!1){const t=this.tokenStart;let n,i,s=null,r=null;switch(this.eat(B),n=this.substrToCursor(t+1),i=n.toLowerCase(),this.skipSC(),this.eof===!1&&this.tokenType!==ft&&this.tokenType!==Z&&(this.parseAtrulePrelude?s=this.parseWithFallback(this.AtrulePrelude.bind(this,n,e),Si):s=Si.call(this,this.tokenIndex),this.skipSC()),this.tokenType){case Z:this.next();break;case ft:hasOwnProperty.call(this.atrule,i)&&typeof this.atrule[i].block=="function"?r=this.atrule[i].block.call(this,e):r=this.Block(aa.call(this));break}return{type:"Atrule",loc:this.getLocation(t,this.tokenStart),name:n,prelude:s,block:r}}function Ci(e){this.token(B,"@"+e.name),e.prelude!==null&&this.node(e.prelude),e.block?this.node(e.block):this.token(Z,";")}const fa=Object.freeze(Object.defineProperty({__proto__:null,generate:Ci,name:ca,parse:wi,structure:ua,walkContext:ha},Symbol.toStringTag,{value:"Module"})),da="AtrulePrelude",pa="atrulePrelude",ma={children:[[]]};function xi(e){let t=null;return e!==null&&(e=e.toLowerCase()),this.skipSC(),hasOwnProperty.call(this.atrule,e)&&typeof this.atrule[e].prelude=="function"?t=this.atrule[e].prelude.call(this):t=this.readSequence(this.scope.AtrulePrelude),this.skipSC(),this.eof!==!0&&this.tokenType!==ft&&this.tokenType!==Z&&this.error("Semicolon or block is expected"),{type:"AtrulePrelude",loc:this.getLocationFromList(t),children:t}}function Li(e){this.children(e)}const ga=Object.freeze(Object.defineProperty({__proto__:null,generate:Li,name:da,parse:xi,structure:ma,walkContext:pa},Symbol.toStringTag,{value:"Module"})),_a=36,Ai=42,De=61,ya=94,hn=124,ba=126;function ka(){this.eof&&this.error("Unexpected end of input");const e=this.tokenStart;let t=!1;return this.isDelim(Ai)?(t=!0,this.next()):this.isDelim(hn)||this.eat(m),this.isDelim(hn)?this.charCodeAt(this.tokenStart+1)!==De?(this.next(),this.eat(m)):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 va(){const e=this.tokenStart,t=this.charCodeAt(e);return t!==De&&t!==ba&&t!==ya&&t!==_a&&t!==Ai&&t!==hn&&this.error("Attribute selector (=, ~=, ^=, $=, *=, |=) is expected"),this.next(),t!==De&&(this.isDelim(De)||this.error("Equal sign is expected"),this.next()),this.substrToCursor(e)}const Sa="AttributeSelector",wa={name:"Identifier",matcher:[String,null],value:["String","Identifier",null],flags:[String,null]};function Ti(){const e=this.tokenStart;let t,n=null,i=null,s=null;return this.eat(Ut),this.skipSC(),t=ka.call(this),this.skipSC(),this.tokenType!==oe&&(this.tokenType!==m&&(n=va.call(this),this.skipSC(),i=this.tokenType===wt?this.String():this.Identifier(),this.skipSC()),this.tokenType===m&&(s=this.consume(m),this.skipSC())),this.eat(oe),{type:"AttributeSelector",loc:this.getLocation(e,this.tokenStart),name:t,matcher:n,value:i,flags:s}}function Ei(e){this.token(A,"["),this.node(e.name),e.matcher!==null&&(this.tokenize(e.matcher),this.node(e.value)),e.flags!==null&&this.token(m,e.flags),this.token(A,"]")}const Ca=Object.freeze(Object.defineProperty({__proto__:null,generate:Ei,name:Sa,parse:Ti,structure:wa},Symbol.toStringTag,{value:"Module"})),xa=38;function Pi(){return this.Raw(null,!0)}function Oi(){return this.parseWithFallback(this.Rule,Pi)}function Di(){return this.Raw(this.consumeUntilSemicolonIncluded,!0)}function La(){if(this.tokenType===Z)return Di.call(this,this.tokenIndex);const e=this.parseWithFallback(this.Declaration,Di);return this.tokenType===Z&&this.next(),e}const Aa="Block",Ta="block",Ea={children:[["Atrule","Rule","Declaration"]]};function Ii(e){const t=e?La:Oi,n=this.tokenStart;let i=this.createList();this.eat(ft);t:for(;!this.eof;)switch(this.tokenType){case Vt:break t;case N:case G:this.next();break;case B:i.push(this.parseWithFallback(this.Atrule.bind(this,e),Pi));break;default:e&&this.isDelim(xa)?i.push(Oi.call(this)):i.push(t.call(this))}return this.eof||this.eat(Vt),{type:"Block",loc:this.getLocation(n,this.tokenStart),children:i}}function Ri(e){this.token(ft,"{"),this.children(e,t=>{t.type==="Declaration"&&this.token(Z,";")}),this.token(Vt,"}")}const Pa=Object.freeze(Object.defineProperty({__proto__:null,generate:Ri,name:Aa,parse:Ii,structure:Ea,walkContext:Ta},Symbol.toStringTag,{value:"Module"})),Oa="Brackets",Da={children:[[]]};function Mi(e,t){const n=this.tokenStart;let i=null;return this.eat(Ut),i=e.call(this,t),this.eof||this.eat(oe),{type:"Brackets",loc:this.getLocation(n,this.tokenStart),children:i}}function Fi(e){this.token(A,"["),this.children(e),this.token(A,"]")}const Ia=Object.freeze(Object.defineProperty({__proto__:null,generate:Fi,name:Oa,parse:Mi,structure:Da},Symbol.toStringTag,{value:"Module"})),Ra="CDC",Ma=[];function ji(){const e=this.tokenStart;return this.eat(it),{type:"CDC",loc:this.getLocation(e,this.tokenStart)}}function zi(){this.token(it,"-->")}const Fa=Object.freeze(Object.defineProperty({__proto__:null,generate:zi,name:Ra,parse:ji,structure:Ma},Symbol.toStringTag,{value:"Module"})),ja="CDO",za=[];function $i(){const e=this.tokenStart;return this.eat(Se),{type:"CDO",loc:this.getLocation(e,this.tokenStart)}}function Ni(){this.token(Se,"<!--")}const $a=Object.freeze(Object.defineProperty({__proto__:null,generate:Ni,name:ja,parse:$i,structure:za},Symbol.toStringTag,{value:"Module"})),Na=46,Ha="ClassSelector",Wa={name:String};function Hi(){return this.eatDelim(Na),{type:"ClassSelector",loc:this.getLocation(this.tokenStart-1,this.tokenEnd),name:this.consume(m)}}function Wi(e){this.token(A,"."),this.token(m,e.name)}const Ba=Object.freeze(Object.defineProperty({__proto__:null,generate:Wi,name:Ha,parse:Hi,structure:Wa},Symbol.toStringTag,{value:"Module"})),Ua=43,Bi=47,Va=62,Xa=126,Ya="Combinator",qa={name:String};function Ui(){const e=this.tokenStart;let t;switch(this.tokenType){case N:t=" ";break;case A:switch(this.charCodeAt(this.tokenStart)){case Va:case Ua:case Xa:this.next();break;case Bi:this.next(),this.eatIdent("deep"),this.eatDelim(Bi);break;default:this.error("Combinator is expected")}t=this.substrToCursor(e);break}return{type:"Combinator",loc:this.getLocation(e,this.tokenStart),name:t}}function Vi(e){this.tokenize(e.name)}const Ga=Object.freeze(Object.defineProperty({__proto__:null,generate:Vi,name:Ya,parse:Ui,structure:qa},Symbol.toStringTag,{value:"Module"})),Ka=42,Qa=47,Ja="Comment",Za={value:String};function Xi(){const e=this.tokenStart;let t=this.tokenEnd;return this.eat(G),t-e+2>=2&&this.charCodeAt(t-2)===Ka&&this.charCodeAt(t-1)===Qa&&(t-=2),{type:"Comment",loc:this.getLocation(e,this.tokenStart),value:this.substring(e+2,t)}}function Yi(e){this.token(G,"/*"+e.value+"*/")}const tc=Object.freeze(Object.defineProperty({__proto__:null,generate:Yi,name:Ja,parse:Xi,structure:Za},Symbol.toStringTag,{value:"Module"})),ec=new Set([q,b,xt]),nc="Condition",ic={kind:String,children:[["Identifier","Feature","FeatureFunction","FeatureRange","SupportsDeclaration"]]};function qi(e){return this.lookupTypeNonSC(1)===m&&ec.has(this.lookupTypeNonSC(2))?this.Feature(e):this.FeatureRange(e)}const sc={media:qi,container:qi,supports(){return this.SupportsDeclaration()}};function Gi(e="media"){const t=this.createList();t:for(;!this.eof;)switch(this.tokenType){case G:case N:this.next();continue;case m:t.push(this.Identifier());break;case O:{let n=this.parseWithFallback(()=>sc[e].call(this,e),()=>null);n||(n=this.parseWithFallback(()=>{this.eat(O);const i=this.Condition(e);return this.eat(b),i},()=>this.GeneralEnclosed(e))),t.push(n);break}case w:{let n=this.parseWithFallback(()=>this.FeatureFunction(e),()=>null);n||(n=this.GeneralEnclosed(e)),t.push(n);break}default:break t}return t.isEmpty&&this.error("Condition is expected"),{type:"Condition",loc:this.getLocationFromList(t),kind:e,children:t}}function Ki(e){e.children.forEach(t=>{t.type==="Condition"?(this.token(O,"("),this.node(t),this.token(b,")")):this.node(t)})}const rc=Object.freeze(Object.defineProperty({__proto__:null,generate:Ki,name:nc,parse:Gi,structure:ic},Symbol.toStringTag,{value:"Module"})),Qi=45;function oc(e,t){return t=t||0,e.length-t>=2&&e.charCodeAt(t)===Qi&&e.charCodeAt(t+1)===Qi}const Ji=33,lc=35,ac=36,cc=38,hc=42,uc=43,Zi=47;function fc(){return this.Raw(this.consumeUntilExclamationMarkOrSemicolon,!0)}function dc(){return this.Raw(this.consumeUntilExclamationMarkOrSemicolon,!1)}function pc(){const e=this.tokenIndex,t=this.Value();return t.type!=="Raw"&&this.eof===!1&&this.tokenType!==Z&&this.isDelim(Ji)===!1&&this.isBalanceEdge(e)===!1&&this.error(),t}const mc="Declaration",gc="declaration",_c={important:[Boolean,String],property:String,value:["Value","Raw"]};function ts(){const e=this.tokenStart,t=this.tokenIndex,n=yc.call(this),i=oc(n),s=i?this.parseCustomProperty:this.parseValue,r=i?dc:fc;let l=!1,c;this.skipSC(),this.eat(q);const a=this.tokenIndex;if(i||this.skipSC(),s?c=this.parseWithFallback(pc,r):c=r.call(this,this.tokenIndex),i&&c.type==="Value"&&c.children.isEmpty){for(let o=a-this.tokenIndex;o<=0;o++)if(this.lookupType(o)===N){c.children.appendData({type:"WhiteSpace",loc:null,value:" "});break}}return this.isDelim(Ji)&&(l=bc.call(this),this.skipSC()),this.eof===!1&&this.tokenType!==Z&&this.isBalanceEdge(t)===!1&&this.error(),{type:"Declaration",loc:this.getLocation(e,this.tokenStart),important:l,property:n,value:c}}function es(e){this.token(m,e.property),this.token(q,":"),this.node(e.value),e.important&&(this.token(A,"!"),this.token(m,e.important===!0?"important":e.important))}function yc(){const e=this.tokenStart;if(this.tokenType===A)switch(this.charCodeAt(this.tokenStart)){case hc:case ac:case uc:case lc:case cc:this.next();break;case Zi:this.next(),this.isDelim(Zi)&&this.next();break}return this.tokenType===I?this.eat(I):this.eat(m),this.substrToCursor(e)}function bc(){this.eat(A),this.skipSC();const e=this.consume(m);return e==="important"?!0:e}const kc=Object.freeze(Object.defineProperty({__proto__:null,generate:es,name:mc,parse:ts,structure:_c,walkContext:gc},Symbol.toStringTag,{value:"Module"})),vc=38;function un(){return this.Raw(this.consumeUntilSemicolonIncluded,!0)}const Sc="DeclarationList",wc={children:[["Declaration","Atrule","Rule"]]};function ns(){const e=this.createList();for(;!this.eof;)switch(this.tokenType){case N:case G:case Z:this.next();break;case B:e.push(this.parseWithFallback(this.Atrule.bind(this,!0),un));break;default:this.isDelim(vc)?e.push(this.parseWithFallback(this.Rule,un)):e.push(this.parseWithFallback(this.Declaration,un))}return{type:"DeclarationList",loc:this.getLocationFromList(e),children:e}}function is(e){this.children(e,t=>{t.type==="Declaration"&&this.token(Z,";")})}const Cc=Object.freeze(Object.defineProperty({__proto__:null,generate:is,name:Sc,parse:ns,structure:wc},Symbol.toStringTag,{value:"Module"})),xc="Dimension",Lc={value:String,unit:String};function ss(){const e=this.tokenStart,t=this.consumeNumber(x);return{type:"Dimension",loc:this.getLocation(e,this.tokenStart),value:t,unit:this.substring(e+t.length,this.tokenStart)}}function rs(e){this.token(x,e.value+e.unit)}const Ac=Object.freeze(Object.defineProperty({__proto__:null,generate:rs,name:xc,parse:ss,structure:Lc},Symbol.toStringTag,{value:"Module"})),Tc=47,Ec="Feature",Pc={kind:String,name:String,value:["Identifier","Number","Dimension","Ratio","Function",null]};function os(e){const t=this.tokenStart;let n,i=null;if(this.eat(O),this.skipSC(),n=this.consume(m),this.skipSC(),this.tokenType!==b){switch(this.eat(q),this.skipSC(),this.tokenType){case k:this.lookupNonWSType(1)===A?i=this.Ratio():i=this.Number();break;case x:i=this.Dimension();break;case m:i=this.Identifier();break;case w:i=this.parseWithFallback(()=>{const s=this.Function(this.readSequence,this.scope.Value);return this.skipSC(),this.isDelim(Tc)&&this.error(),s},()=>this.Ratio());break;default:this.error("Number, dimension, ratio or identifier is expected")}this.skipSC()}return this.eof||this.eat(b),{type:"Feature",loc:this.getLocation(t,this.tokenStart),kind:e,name:n,value:i}}function ls(e){this.token(O,"("),this.token(m,e.name),e.value!==null&&(this.token(q,":"),this.node(e.value)),this.token(b,")")}const Oc=Object.freeze(Object.defineProperty({__proto__:null,generate:ls,name:Ec,parse:os,structure:Pc},Symbol.toStringTag,{value:"Module"})),Dc="FeatureFunction",Ic={kind:String,feature:String,value:["Declaration","Selector"]};function Rc(e,t){const n=(this.features[e]||{})[t];return typeof n!="function"&&this.error(`Unknown feature ${t}()`),n}function as(e="unknown"){const t=this.tokenStart,n=this.consumeFunctionName(),i=Rc.call(this,e,n.toLowerCase());this.skipSC();const s=this.parseWithFallback(()=>{const r=this.tokenIndex,l=i.call(this);return this.eof===!1&&this.isBalanceEdge(r)===!1&&this.error(),l},()=>this.Raw(null,!1));return this.eof||this.eat(b),{type:"FeatureFunction",loc:this.getLocation(t,this.tokenStart),kind:e,feature:n,value:s}}function cs(e){this.token(w,e.feature+"("),this.node(e.value),this.token(b,")")}const Mc=Object.freeze(Object.defineProperty({__proto__:null,generate:cs,name:Dc,parse:as,structure:Ic},Symbol.toStringTag,{value:"Module"})),hs=47,Fc=60,us=61,jc=62,zc="FeatureRange",$c={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 fn(){switch(this.skipSC(),this.tokenType){case k:return this.isDelim(hs,this.lookupOffsetNonSC(1))?this.Ratio():this.Number();case x:return this.Dimension();case m:return this.Identifier();case w:return this.parseWithFallback(()=>{const e=this.Function(this.readSequence,this.scope.Value);return this.skipSC(),this.isDelim(hs)&&this.error(),e},()=>this.Ratio());default:this.error("Number, dimension, ratio or identifier is expected")}}function fs(e){if(this.skipSC(),this.isDelim(Fc)||this.isDelim(jc)){const t=this.source[this.tokenStart];return this.next(),this.isDelim(us)?(this.next(),t+"="):t}if(this.isDelim(us))return"=";this.error(`Expected ${e?'":", ':""}"<", ">", "=" or ")"`)}function ds(e="unknown"){const t=this.tokenStart;this.skipSC(),this.eat(O);const n=fn.call(this),i=fs.call(this,n.type==="Identifier"),s=fn.call(this);let r=null,l=null;return this.lookupNonWSType(0)!==b&&(r=fs.call(this),l=fn.call(this)),this.skipSC(),this.eat(b),{type:"FeatureRange",loc:this.getLocation(t,this.tokenStart),kind:e,left:n,leftComparison:i,middle:s,rightComparison:r,right:l}}function ps(e){this.token(O,"("),this.node(e.left),this.tokenize(e.leftComparison),this.node(e.middle),e.right&&(this.tokenize(e.rightComparison),this.node(e.right)),this.token(b,")")}const Nc=Object.freeze(Object.defineProperty({__proto__:null,generate:ps,name:zc,parse:ds,structure:$c},Symbol.toStringTag,{value:"Module"})),Hc="Function",Wc="function",Bc={name:String,children:[[]]};function ms(e,t){const n=this.tokenStart,i=this.consumeFunctionName(),s=i.toLowerCase();let r;return r=t.hasOwnProperty(s)?t[s].call(this,t):e.call(this,t),this.eof||this.eat(b),{type:"Function",loc:this.getLocation(n,this.tokenStart),name:i,children:r}}function gs(e){this.token(w,e.name+"("),this.children(e),this.token(b,")")}const Uc=Object.freeze(Object.defineProperty({__proto__:null,generate:gs,name:Hc,parse:ms,structure:Bc,walkContext:Wc},Symbol.toStringTag,{value:"Module"})),Vc="GeneralEnclosed",Xc={kind:String,function:[String,null],children:[[]]};function _s(e){const t=this.tokenStart;let n=null;this.tokenType===w?n=this.consumeFunctionName():this.eat(O);const i=this.parseWithFallback(()=>{const s=this.tokenIndex,r=this.readSequence(this.scope.Value);return this.eof===!1&&this.isBalanceEdge(s)===!1&&this.error(),r},()=>this.createSingleNodeList(this.Raw(null,!1)));return this.eof||this.eat(b),{type:"GeneralEnclosed",loc:this.getLocation(t,this.tokenStart),kind:e,function:n,children:i}}function ys(e){e.function?this.token(w,e.function+"("):this.token(O,"("),this.children(e),this.token(b,")")}const Yc=Object.freeze(Object.defineProperty({__proto__:null,generate:ys,name:Vc,parse:_s,structure:Xc},Symbol.toStringTag,{value:"Module"})),qc="XXX",Gc="Hash",Kc={value:String};function bs(){const e=this.tokenStart;return this.eat(I),{type:"Hash",loc:this.getLocation(e,this.tokenStart),value:this.substrToCursor(e+1)}}function ks(e){this.token(I,"#"+e.value)}const Qc=Object.freeze(Object.defineProperty({__proto__:null,generate:ks,name:Gc,parse:bs,structure:Kc,xxx:qc},Symbol.toStringTag,{value:"Module"})),Jc="Identifier",Zc={name:String};function vs(){return{type:"Identifier",loc:this.getLocation(this.tokenStart,this.tokenEnd),name:this.consume(m)}}function Ss(e){this.token(m,e.name)}const th=Object.freeze(Object.defineProperty({__proto__:null,generate:Ss,name:Jc,parse:vs,structure:Zc},Symbol.toStringTag,{value:"Module"})),eh="IdSelector",nh={name:String};function ws(){const e=this.tokenStart;return this.eat(I),{type:"IdSelector",loc:this.getLocation(e,this.tokenStart),name:this.substrToCursor(e+1)}}function Cs(e){this.token(A,"#"+e.name)}const ih=Object.freeze(Object.defineProperty({__proto__:null,generate:Cs,name:eh,parse:ws,structure:nh},Symbol.toStringTag,{value:"Module"})),sh=46,rh="Layer",oh={name:String};function xs(){let e=this.tokenStart,t=this.consume(m);for(;this.isDelim(sh);)this.eat(A),t+="."+this.consume(m);return{type:"Layer",loc:this.getLocation(e,this.tokenStart),name:t}}function Ls(e){this.tokenize(e.name)}const lh=Object.freeze(Object.defineProperty({__proto__:null,generate:Ls,name:rh,parse:xs,structure:oh},Symbol.toStringTag,{value:"Module"})),ah="LayerList",ch={children:[["Layer"]]};function As(){const e=this.createList();for(this.skipSC();!this.eof&&(e.push(this.Layer()),this.lookupTypeNonSC(0)===ut);)this.skipSC(),this.next(),this.skipSC();return{type:"LayerList",loc:this.getLocationFromList(e),children:e}}function Ts(e){this.children(e,()=>this.token(ut,","))}const hh=Object.freeze(Object.defineProperty({__proto__:null,generate:Ts,name:ah,parse:As,structure:ch},Symbol.toStringTag,{value:"Module"})),uh="MediaQuery",fh={modifier:[String,null],mediaType:[String,null],condition:["Condition",null]};function Es(){const e=this.tokenStart;let t=null,n=null,i=null;if(this.skipSC(),this.tokenType===m&&this.lookupTypeNonSC(1)!==O){const s=this.consume(m),r=s.toLowerCase();switch(r==="not"||r==="only"?(this.skipSC(),t=r,n=this.consume(m)):n=s,this.lookupTypeNonSC(0)){case m:{this.skipSC(),this.eatIdent("and"),i=this.Condition("media");break}case ft:case Z:case ut:case xt:break;default:this.error("Identifier or parenthesis is expected")}}else switch(this.tokenType){case m:case O:case w:{i=this.Condition("media");break}case ft:case Z:case xt:break;default:this.error("Identifier or parenthesis is expected")}return{type:"MediaQuery",loc:this.getLocation(e,this.tokenStart),modifier:t,mediaType:n,condition:i}}function Ps(e){e.mediaType?(e.modifier&&this.token(m,e.modifier),this.token(m,e.mediaType),e.condition&&(this.token(m,"and"),this.node(e.condition))):e.condition&&this.node(e.condition)}const dh=Object.freeze(Object.defineProperty({__proto__:null,generate:Ps,name:uh,parse:Es,structure:fh},Symbol.toStringTag,{value:"Module"})),ph="MediaQueryList",mh={children:[["MediaQuery"]]};function Os(){const e=this.createList();for(this.skipSC();!this.eof&&(e.push(this.MediaQuery()),this.tokenType===ut);)this.next();return{type:"MediaQueryList",loc:this.getLocationFromList(e),children:e}}function Ds(e){this.children(e,()=>this.token(ut,","))}const gh=Object.freeze(Object.defineProperty({__proto__:null,generate:Ds,name:ph,parse:Os,structure:mh},Symbol.toStringTag,{value:"Module"})),_h=38,yh="NestingSelector",bh={};function Is(){const e=this.tokenStart;return this.eatDelim(_h),{type:"NestingSelector",loc:this.getLocation(e,this.tokenStart)}}function Rs(){this.token(A,"&")}const kh=Object.freeze(Object.defineProperty({__proto__:null,generate:Rs,name:yh,parse:Is,structure:bh},Symbol.toStringTag,{value:"Module"})),vh="Nth",Sh={nth:["AnPlusB","Identifier"],selector:["SelectorList",null]};function Ms(){this.skipSC();const e=this.tokenStart;let t=e,n=null,i;return this.lookupValue(0,"odd")||this.lookupValue(0,"even")?i=this.Identifier():i=this.AnPlusB(),t=this.tokenStart,this.skipSC(),this.lookupValue(0,"of")&&(this.next(),n=this.SelectorList(),t=this.tokenStart),{type:"Nth",loc:this.getLocation(e,t),nth:i,selector:n}}function Fs(e){this.node(e.nth),e.selector!==null&&(this.token(m,"of"),this.node(e.selector))}const wh=Object.freeze(Object.defineProperty({__proto__:null,generate:Fs,name:vh,parse:Ms,structure:Sh},Symbol.toStringTag,{value:"Module"})),Ch="Number",xh={value:String};function js(){return{type:"Number",loc:this.getLocation(this.tokenStart,this.tokenEnd),value:this.consume(k)}}function zs(e){this.token(k,e.value)}const Lh=Object.freeze(Object.defineProperty({__proto__:null,generate:zs,name:Ch,parse:js,structure:xh},Symbol.toStringTag,{value:"Module"})),Ah="Operator",Th={value:String};function $s(){const e=this.tokenStart;return this.next(),{type:"Operator",loc:this.getLocation(e,this.tokenStart),value:this.substrToCursor(e)}}function Ns(e){this.tokenize(e.value)}const Eh=Object.freeze(Object.defineProperty({__proto__:null,generate:Ns,name:Ah,parse:$s,structure:Th},Symbol.toStringTag,{value:"Module"})),Ph="Parentheses",Oh={children:[[]]};function Hs(e,t){const n=this.tokenStart;let i=null;return this.eat(O),i=e.call(this,t),this.eof||this.eat(b),{type:"Parentheses",loc:this.getLocation(n,this.tokenStart),children:i}}function Ws(e){this.token(O,"("),this.children(e),this.token(b,")")}const Dh=Object.freeze(Object.defineProperty({__proto__:null,generate:Ws,name:Ph,parse:Hs,structure:Oh},Symbol.toStringTag,{value:"Module"})),Ih="Percentage",Rh={value:String};function Bs(){return{type:"Percentage",loc:this.getLocation(this.tokenStart,this.tokenEnd),value:this.consumeNumber($)}}function Us(e){this.token($,e.value+"%")}const Mh=Object.freeze(Object.defineProperty({__proto__:null,generate:Us,name:Ih,parse:Bs,structure:Rh},Symbol.toStringTag,{value:"Module"})),Fh="PseudoClassSelector",jh="function",zh={name:String,children:[["Raw"],null]};function Vs(){const e=this.tokenStart;let t=null,n,i;return this.eat(q),this.tokenType===w?(n=this.consumeFunctionName(),i=n.toLowerCase(),this.lookupNonWSType(0)==b?t=this.createList():hasOwnProperty.call(this.pseudo,i)?(this.skipSC(),t=this.pseudo[i].call(this),this.skipSC()):(t=this.createList(),t.push(this.Raw(null,!1))),this.eat(b)):n=this.consume(m),{type:"PseudoClassSelector",loc:this.getLocation(e,this.tokenStart),name:n,children:t}}function Xs(e){this.token(q,":"),e.children===null?this.token(m,e.name):(this.token(w,e.name+"("),this.children(e),this.token(b,")"))}const $h=Object.freeze(Object.defineProperty({__proto__:null,generate:Xs,name:Fh,parse:Vs,structure:zh,walkContext:jh},Symbol.toStringTag,{value:"Module"})),Nh="PseudoElementSelector",Hh="function",Wh={name:String,children:[["Raw"],null]};function Ys(){const e=this.tokenStart;let t=null,n,i;return this.eat(q),this.eat(q),this.tokenType===w?(n=this.consumeFunctionName(),i=n.toLowerCase(),this.lookupNonWSType(0)==b?t=this.createList():hasOwnProperty.call(this.pseudo,i)?(this.skipSC(),t=this.pseudo[i].call(this),this.skipSC()):(t=this.createList(),t.push(this.Raw(null,!1))),this.eat(b)):n=this.consume(m),{type:"PseudoElementSelector",loc:this.getLocation(e,this.tokenStart),name:n,children:t}}function qs(e){this.token(q,":"),this.token(q,":"),e.children===null?this.token(m,e.name):(this.token(w,e.name+"("),this.children(e),this.token(b,")"))}const Bh=Object.freeze(Object.defineProperty({__proto__:null,generate:qs,name:Nh,parse:Ys,structure:Wh,walkContext:Hh},Symbol.toStringTag,{value:"Module"})),Gs=47;function Ks(){switch(this.skipSC(),this.tokenType){case k:return this.Number();case w:return this.Function(this.readSequence,this.scope.Value);default:this.error("Number of function is expected")}}const Uh="Ratio",Vh={left:["Number","Function"],right:["Number","Function",null]};function Qs(){const e=this.tokenStart,t=Ks.call(this);let n=null;return this.skipSC(),this.isDelim(Gs)&&(this.eatDelim(Gs),n=Ks.call(this)),{type:"Ratio",loc:this.getLocation(e,this.tokenStart),left:t,right:n}}function Js(e){this.node(e.left),this.token(A,"/"),e.right?this.node(e.right):this.node(k,1)}const Xh=Object.freeze(Object.defineProperty({__proto__:null,generate:Js,name:Uh,parse:Qs,structure:Vh},Symbol.toStringTag,{value:"Module"}));function Yh(){return this.tokenIndex>0&&this.lookupType(-1)===N?this.tokenIndex>1?this.getTokenStart(this.tokenIndex-1):this.firstCharOffset:this.tokenStart}const qh="Raw",Gh={value:String};function Zs(e,t){const n=this.getTokenStart(this.tokenIndex);let i;return this.skipUntilBalanced(this.tokenIndex,e||this.consumeUntilBalanceEnd),t&&this.tokenStart>n?i=Yh.call(this):i=this.tokenStart,{type:"Raw",loc:this.getLocation(n,i),value:this.substring(n,i)}}function tr(e){this.tokenize(e.value)}const Kh=Object.freeze(Object.defineProperty({__proto__:null,generate:tr,name:qh,parse:Zs,structure:Gh},Symbol.toStringTag,{value:"Module"}));function er(){return this.Raw(this.consumeUntilLeftCurlyBracket,!0)}function Qh(){const e=this.SelectorList();return e.type!=="Raw"&&this.eof===!1&&this.tokenType!==ft&&this.error(),e}const Jh="Rule",Zh="rule",tu={prelude:["SelectorList","Raw"],block:["Block"]};function nr(){const e=this.tokenIndex,t=this.tokenStart;let n,i;return this.parseRulePrelude?n=this.parseWithFallback(Qh,er):n=er.call(this,e),i=this.Block(!0),{type:"Rule",loc:this.getLocation(t,this.tokenStart),prelude:n,block:i}}function ir(e){this.node(e.prelude),this.node(e.block)}const eu=Object.freeze(Object.defineProperty({__proto__:null,generate:ir,name:Jh,parse:nr,structure:tu,walkContext:Zh},Symbol.toStringTag,{value:"Module"})),nu="Scope",iu={root:["SelectorList","Raw",null],limit:["SelectorList","Raw",null]};function sr(){let e=null,t=null;this.skipSC();const n=this.tokenStart;return this.tokenType===O&&(this.next(),this.skipSC(),e=this.parseWithFallback(this.SelectorList,()=>this.Raw(!1,!0)),this.skipSC(),this.eat(b)),this.lookupNonWSType(0)===m&&(this.skipSC(),this.eatIdent("to"),this.skipSC(),this.eat(O),this.skipSC(),t=this.parseWithFallback(this.SelectorList,()=>this.Raw(!1,!0)),this.skipSC(),this.eat(b)),{type:"Scope",loc:this.getLocation(n,this.tokenStart),root:e,limit:t}}function rr(e){e.root&&(this.token(O,"("),this.node(e.root),this.token(b,")")),e.limit&&(this.token(m,"to"),this.token(O,"("),this.node(e.limit),this.token(b,")"))}const su=Object.freeze(Object.defineProperty({__proto__:null,generate:rr,name:nu,parse:sr,structure:iu},Symbol.toStringTag,{value:"Module"})),ru="Selector",ou={children:[["TypeSelector","IdSelector","ClassSelector","AttributeSelector","PseudoClassSelector","PseudoElementSelector","Combinator"]]};function or(){const e=this.readSequence(this.scope.Selector);return this.getFirstListNode(e)===null&&this.error("Selector is expected"),{type:"Selector",loc:this.getLocationFromList(e),children:e}}function lr(e){this.children(e)}const lu=Object.freeze(Object.defineProperty({__proto__:null,generate:lr,name:ru,parse:or,structure:ou},Symbol.toStringTag,{value:"Module"})),au="SelectorList",cu="selector",hu={children:[["Selector","Raw"]]};function ar(){const e=this.createList();for(;!this.eof;){if(e.push(this.Selector()),this.tokenType===ut){this.next();continue}break}return{type:"SelectorList",loc:this.getLocationFromList(e),children:e}}function cr(e){this.children(e,()=>this.token(ut,","))}const uu=Object.freeze(Object.defineProperty({__proto__:null,generate:cr,name:au,parse:ar,structure:hu,walkContext:cu},Symbol.toStringTag,{value:"Module"})),dn=92,hr=34,fu=39;function ur(e){const t=e.length,n=e.charCodeAt(0),i=n===hr||n===fu?1:0,s=i===1&&t>1&&e.charCodeAt(t-1)===n?t-2:t-1;let r="";for(let l=i;l<=s;l++){let c=e.charCodeAt(l);if(c===dn){if(l===s){l!==t-1&&(r=e.substr(l+1));break}if(c=e.charCodeAt(++l),yt(dn,c)){const a=l-1,o=qt(e,a);l=o-1,r+=di(e.substring(a+1,o))}else c===13&&e.charCodeAt(l+1)===10&&l++}else r+=e[l]}return r}function du(e,t){const n=hr;let i="",s=!1;for(let r=0;r<e.length;r++){const l=e.charCodeAt(r);if(l===0){i+="�";continue}if(l<=31||l===127){i+="\\"+l.toString(16),s=!0;continue}l===n||l===dn?(i+="\\"+e.charAt(r),s=!1):(s&&(Xt(l)||Ot(l))&&(i+=" "),i+=e.charAt(r),s=!1)}return'"'+i+'"'}const pu="String",mu={value:String};function fr(){return{type:"String",loc:this.getLocation(this.tokenStart,this.tokenEnd),value:ur(this.consume(wt))}}function dr(e){this.token(wt,du(e.value))}const gu=Object.freeze(Object.defineProperty({__proto__:null,generate:dr,name:pu,parse:fr,structure:mu},Symbol.toStringTag,{value:"Module"})),_u=33;function pr(){return this.Raw(null,!1)}const yu="StyleSheet",bu="stylesheet",ku={children:[["Comment","CDO","CDC","Atrule","Rule","Raw"]]};function mr(){const e=this.tokenStart,t=this.createList();let n;for(;!this.eof;){switch(this.tokenType){case N:this.next();continue;case G:if(this.charCodeAt(this.tokenStart+2)!==_u){this.next();continue}n=this.Comment();break;case Se:n=this.CDO();break;case it:n=this.CDC();break;case B:n=this.parseWithFallback(this.Atrule,pr);break;default:n=this.parseWithFallback(this.Rule,pr)}t.push(n)}return{type:"StyleSheet",loc:this.getLocation(e,this.tokenStart),children:t}}function gr(e){this.children(e)}const vu=Object.freeze(Object.defineProperty({__proto__:null,generate:gr,name:yu,parse:mr,structure:ku,walkContext:bu},Symbol.toStringTag,{value:"Module"})),Su="SupportsDeclaration",wu={declaration:"Declaration"};function _r(){const e=this.tokenStart;this.eat(O),this.skipSC();const t=this.Declaration();return this.eof||this.eat(b),{type:"SupportsDeclaration",loc:this.getLocation(e,this.tokenStart),declaration:t}}function yr(e){this.token(O,"("),this.node(e.declaration),this.token(b,")")}const Cu=Object.freeze(Object.defineProperty({__proto__:null,generate:yr,name:Su,parse:_r,structure:wu},Symbol.toStringTag,{value:"Module"})),xu=42,br=124;function pn(){this.tokenType!==m&&this.isDelim(xu)===!1&&this.error("Identifier or asterisk is expected"),this.next()}const Lu="TypeSelector",Au={name:String};function kr(){const e=this.tokenStart;return this.isDelim(br)?(this.next(),pn.call(this)):(pn.call(this),this.isDelim(br)&&(this.next(),pn.call(this))),{type:"TypeSelector",loc:this.getLocation(e,this.tokenStart),name:this.substrToCursor(e)}}function vr(e){this.tokenize(e.name)}const Tu=Object.freeze(Object.defineProperty({__proto__:null,generate:vr,name:Lu,parse:kr,structure:Au},Symbol.toStringTag,{value:"Module"})),Sr=43,wr=45,mn=63;function le(e,t){let n=0;for(let i=this.tokenStart+e;i<this.tokenEnd;i++){const s=this.charCodeAt(i);if(s===wr&&t&&n!==0)return le.call(this,e+n+1,!1),-1;Xt(s)||this.error(t&&n!==0?"Hyphen minus"+(n<6?" or hex digit":"")+" is expected":n<6?"Hex digit is expected":"Unexpected input",i),++n>6&&this.error("Too many hex digits",i)}return this.next(),n}function Ie(e){let t=0;for(;this.isDelim(mn);)++t>e&&this.error("Too many question marks"),this.next()}function Eu(e){this.charCodeAt(this.tokenStart)!==e&&this.error((e===Sr?"Plus sign":"Hyphen minus")+" is expected")}function Pu(){let e=0;switch(this.tokenType){case k:if(e=le.call(this,1,!0),this.isDelim(mn)){Ie.call(this,6-e);break}if(this.tokenType===x||this.tokenType===k){Eu.call(this,wr),le.call(this,1,!1);break}break;case x:e=le.call(this,1,!0),e>0&&Ie.call(this,6-e);break;default:if(this.eatDelim(Sr),this.tokenType===m){e=le.call(this,0,!0),e>0&&Ie.call(this,6-e);break}if(this.isDelim(mn)){this.next(),Ie.call(this,5);break}this.error("Hex digit or question mark is expected")}}const Ou="UnicodeRange",Du={value:String};function Cr(){const e=this.tokenStart;return this.eatIdent("u"),Pu.call(this),{type:"UnicodeRange",loc:this.getLocation(e,this.tokenStart),value:this.substrToCursor(e)}}function xr(e){this.tokenize(e.value)}const Iu=Object.freeze(Object.defineProperty({__proto__:null,generate:xr,name:Ou,parse:Cr,structure:Du},Symbol.toStringTag,{value:"Module"})),Ru=32,gn=92,Mu=34,Fu=39,ju=40,Lr=41;function zu(e){const t=e.length;let n=4,i=e.charCodeAt(t-1)===Lr?t-2:t-1,s="";for(;n<i&&Ot(e.charCodeAt(n));)n++;for(;n<i&&Ot(e.charCodeAt(i));)i--;for(let r=n;r<=i;r++){let l=e.charCodeAt(r);if(l===gn){if(r===i){r!==t-1&&(s=e.substr(r+1));break}if(l=e.charCodeAt(++r),yt(gn,l)){const c=r-1,a=qt(e,c);r=a-1,s+=di(e.substring(c+1,a))}else l===13&&e.charCodeAt(r+1)===10&&r++}else s+=e[r]}return s}function $u(e){let t="",n=!1;for(let i=0;i<e.length;i++){const s=e.charCodeAt(i);if(s===0){t+="�";continue}if(s<=31||s===127){t+="\\"+s.toString(16),n=!0;continue}s===Ru||s===gn||s===Mu||s===Fu||s===ju||s===Lr?(t+="\\"+e.charAt(i),n=!1):(n&&Xt(s)&&(t+=" "),t+=e.charAt(i),n=!1)}return"url("+t+")"}const Nu="Url",Hu={value:String};function Ar(){const e=this.tokenStart;let t;switch(this.tokenType){case Y:t=zu(this.consume(Y));break;case w:this.cmpStr(this.tokenStart,this.tokenEnd,"url(")||this.error("Function name must be `url`"),this.eat(w),this.skipSC(),t=ur(this.consume(wt)),this.skipSC(),this.eof||this.eat(b);break;default:this.error("Url or Function is expected")}return{type:"Url",loc:this.getLocation(e,this.tokenStart),value:t}}function Tr(e){this.token(Y,$u(e.value))}const Wu=Object.freeze(Object.defineProperty({__proto__:null,generate:Tr,name:Nu,parse:Ar,structure:Hu},Symbol.toStringTag,{value:"Module"})),Bu="Value",Uu={children:[[]]};function Er(){const e=this.tokenStart,t=this.readSequence(this.scope.Value);return{type:"Value",loc:this.getLocation(e,this.tokenStart),children:t}}function Pr(e){this.children(e)}const Vu=Object.freeze(Object.defineProperty({__proto__:null,generate:Pr,name:Bu,parse:Er,structure:Uu},Symbol.toStringTag,{value:"Module"})),Xu=Object.freeze({type:"WhiteSpace",loc:null,value:" "}),Yu="WhiteSpace",qu={value:String};function Or(){return this.eat(N),Xu}function Dr(e){this.token(N,e.value)}const Gu=Object.freeze(Object.defineProperty({__proto__:null,generate:Dr,name:Yu,parse:Or,structure:qu},Symbol.toStringTag,{value:"Module"})),Ku=Object.freeze(Object.defineProperty({__proto__:null,AnPlusB:la,Atrule:fa,AtrulePrelude:ga,AttributeSelector:Ca,Block:Pa,Brackets:Ia,CDC:Fa,CDO:$a,ClassSelector:Ba,Combinator:Ga,Comment:tc,Condition:rc,Declaration:kc,DeclarationList:Cc,Dimension:Ac,Feature:Oc,FeatureFunction:Mc,FeatureRange:Nc,Function:Uc,GeneralEnclosed:Yc,Hash:Qc,IdSelector:ih,Identifier:th,Layer:lh,LayerList:hh,MediaQuery:dh,MediaQueryList:gh,NestingSelector:kh,Nth:wh,Number:Lh,Operator:Eh,Parentheses:Dh,Percentage:Mh,PseudoClassSelector:$h,PseudoElementSelector:Bh,Ratio:Xh,Raw:Kh,Rule:eu,Scope:su,Selector:lu,SelectorList:uu,String:gu,StyleSheet:vu,SupportsDeclaration:Cu,TypeSelector:Tu,UnicodeRange:Iu,Url:Wu,Value:Vu,WhiteSpace:Gu},Symbol.toStringTag,{value:"Module"})),Qu={node:Ku},At=Vl(Qu),_n=["left","right","top","bottom","inset-block-start","inset-block-end","inset-inline-start","inset-inline-end","inset-block","inset-inline","inset"];function ae(e){return _n.includes(e)}const yn=["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"];function Ju(e){return yn.includes(e)}const bn=["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 Ir(e){return bn.includes(e)}const Rr=["justify-self","align-self","place-self"];function Zu(e){return Rr.includes(e)}const Mr=[..._n,...yn,...bn,...Rr,"position-anchor","position-area"],tf=[...bn,..._n,...yn];function Fr(e){return tf.includes(e)}const ef=["top","left","right","bottom","start","end","self-start","self-end","center","inside","outside"];function jr(e){return ef.includes(e)}const nf=["width","height","block","inline","self-block","self-inline"];function sf(e){return nf.includes(e)}const zr=new Set(["Atrule","Selector","Declaration"]);function rf(e){const t=new SourceMapGenerator,n={line:1,column:0},i={line:0,column:0},s={line:1,column:0},r={generated:s};let l=1,c=0,a=!1;const o=e.node;e.node=function(f){if(f.loc&&f.loc.start&&zr.has(f.type)){const d=f.loc.start.line,p=f.loc.start.column-1;(i.line!==d||i.column!==p)&&(i.line=d,i.column=p,n.line=l,n.column=c,a&&(a=!1,(n.line!==s.line||n.column!==s.column)&&t.addMapping(r)),a=!0,t.addMapping({source:f.loc.source,original:i,generated:n}))}o.call(this,f),a&&zr.has(f.type)&&(s.line=l,s.column=c)};const h=e.emit;e.emit=function(f,d,p){for(let g=0;g<f.length;g++)f.charCodeAt(g)===10?(l++,c=0):c++;h(f,d,p)};const u=e.result;return e.result=function(){return a&&t.addMapping(r),{css:u(),map:t}},e}const of=43,lf=45,kn=(e,t)=>{if(e===A&&(e=t),typeof e=="string"){const n=e.charCodeAt(0);return n>127?32768:n<<8}return e},$r=[[m,m],[m,w],[m,Y],[m,ht],[m,"-"],[m,k],[m,$],[m,x],[m,it],[m,O],[B,m],[B,w],[B,Y],[B,ht],[B,"-"],[B,k],[B,$],[B,x],[B,it],[I,m],[I,w],[I,Y],[I,ht],[I,"-"],[I,k],[I,$],[I,x],[I,it],[x,m],[x,w],[x,Y],[x,ht],[x,"-"],[x,k],[x,$],[x,x],[x,it],["#",m],["#",w],["#",Y],["#",ht],["#","-"],["#",k],["#",$],["#",x],["#",it],["-",m],["-",w],["-",Y],["-",ht],["-","-"],["-",k],["-",$],["-",x],["-",it],[k,m],[k,w],[k,Y],[k,ht],[k,k],[k,$],[k,x],[k,"%"],[k,it],["@",m],["@",w],["@",Y],["@",ht],["@","-"],["@",it],[".",k],[".",$],[".",x],["+",k],["+",$],["+",x],["/","*"]],af=$r.concat([[m,I],[x,I],[I,I],[B,O],[B,wt],[B,q],[$,$],[$,x],[$,w],[$,"-"],[b,m],[b,w],[b,$],[b,x],[b,I],[b,"-"]]);function Nr(e){const t=new Set(e.map(([n,i])=>kn(n)<<16|kn(i)));return function(n,i,s){const r=kn(i,s),l=s.charCodeAt(0);return(l===lf&&i!==m&&i!==w&&i!==it||l===of?t.has(n<<16|l<<8):t.has(n<<16|r))&&this.emit(" ",N,!0),r}}const cf=Nr($r),Hr=Nr(af),Wr=Object.freeze(Object.defineProperty({__proto__:null,safe:Hr,spec:cf},Symbol.toStringTag,{value:"Module"})),hf=92;function uf(e,t){if(typeof t=="function"){let n=null;e.children.forEach(i=>{n!==null&&t.call(this,n),this.node(i),n=i});return}e.children.forEach(this.node,this)}function ff(e){bi(e,(t,n,i)=>{this.token(t,e.slice(n,i))})}function df(e){const t=new Map;for(let[n,i]of Object.entries(e.node))typeof(i.generate||i)=="function"&&t.set(n,i.generate||i);return function(n,i){let s="",r=0,l={node(a){if(t.has(a.type))t.get(a.type).call(c,a);else throw new Error("Unknown node type: "+a.type)},tokenBefore:Hr,token(a,o){r=this.tokenBefore(r,a,o),this.emit(o,a,!1),a===A&&o.charCodeAt(0)===hf&&this.emit(`
|
|
16
|
-
`,N,!0)},emit(a){s+=a},result(){return s}};i&&(typeof i.decorator=="function"&&(l=i.decorator(l)),i.sourceMap&&(l=
|
|
17
|
-
`)}})}const vn=100,
|
|
15
|
+
`;return this._injectStyles(d),!0}_injectStyles(t){const n=this._shadowHost();if(n?.shadowRoot)this._adoptedSheet||(this._adoptedSheet=new CSSStyleSheet,n.shadowRoot.adoptedStyleSheets=[...n.shadowRoot.adoptedStyleSheets,this._adoptedSheet]),this._adoptedSheet.replaceSync(t);else{this._styleEl?.remove();const i=this._floating()?.ownerDocument??this._anchor()?.ownerDocument;if(!i)return;this._styleEl=i.createElement("style"),this._styleEl.setAttribute("data-rc-anchor-style",this._uid),this._styleEl.textContent=t,i.head.appendChild(this._styleEl)}}_positionFallback(){const t=this._anchor(),n=this._floating();if(!t||!n)return;const i=this._opts.placement??"bottom-start",s=this._opts.offset??4,r=this._opts.flip??!0,l=4,c=t.getBoundingClientRect(),a=t.ownerDocument.defaultView;if(!a)return;const o=a.innerWidth,h=a.innerHeight;n.style.position="fixed",n.style.boxSizing="border-box",n.style.minWidth=`${c.width}px`,n.style.top="",n.style.bottom="",n.style.left="",n.style.right="";const u=n.offsetWidth||c.width,f=n.offsetHeight||0,d=i.split("-")[0],p=i.endsWith("-start")?"start":i.endsWith("-end")?"end":"center";let g=d;if(d==="top"||d==="bottom"){const y=h-c.bottom,_=c.top;r&&(d==="bottom"&&y<f+s&&_>y?g="top":d==="top"&&_<f+s&&y>_&&(g="bottom")),g==="top"?n.style.bottom=`${h-c.top+s}px`:n.style.top=`${c.bottom+s}px`;let S=p==="end"?c.right-u:p==="start"?c.left:c.left+c.width/2-u/2;S=Math.max(l,Math.min(S,o-u-l)),n.style.left=`${S}px`}else{const y=o-c.right,_=c.left;r&&(d==="right"&&y<u+s&&_>y?g="left":d==="left"&&_<u+s&&y>_&&(g="right")),g==="left"?n.style.right=`${o-c.left+s}px`:n.style.left=`${c.right+s}px`;let S=p==="end"?c.bottom-f:p==="start"?c.top:c.top+c.height/2-f/2;S=Math.max(l,Math.min(S,h-f-l)),n.style.top=`${S}px`}}_cleanup(){this._stopClampLoop(),this._appliedDx=0,this._appliedDy=0;const t=this._anchor(),n=this._floating();t&&t.style.removeProperty("anchor-name"),n&&(n.removeAttribute("data-rc-anchor"),n.style.translate=""),this._styleEl?.remove(),this._styleEl=null;const i=this._shadowHost();i?.shadowRoot&&this._adoptedSheet&&(i.shadowRoot.adoptedStyleSheets=i.shadowRoot.adoptedStyleSheets.filter(s=>s!==this._adoptedSheet),this._adoptedSheet=null)}}class Qo{constructor(t,n){this._attached=null,this._scrolled=!1,this._onScroll=()=>this._evaluate(),this._host=t,this._opts=n,t.addController(this)}get scrolled(){return this._scrolled}setOptions(t){this._detach(),Object.assign(this._opts,t),this._attach()}hostConnected(){this._attach()}hostDisconnected(){this._detach()}_resolveTarget(){const{target:t}=this._opts;return typeof t=="function"?t():t??null}_attach(){if(this._opts.disabled||this._attached)return;const t=this._resolveTarget();t&&(this._attached=t,t.addEventListener("scroll",this._onScroll,{passive:!0}),this._evaluate())}_detach(){this._attached?.removeEventListener("scroll",this._onScroll),this._attached=null,this._lastScrollTop=void 0}_scrollTop(){const t=this._attached;return t instanceof Element?t.scrollTop:t instanceof Document?t.scrollingElement?.scrollTop??0:t?.scrollY??0}_evaluate(){if(!this._attached)return;const t=this._scrollTop(),n=t-(this._lastScrollTop??t);this._lastScrollTop=t,this._opts.onScroll?.(t,n);const i=t>(this._opts.threshold??4);i!==this._scrolled&&(this._scrolled=i,this._opts.onChange?.(i,t),this._host.requestUpdate())}}class Jo{constructor(t,n){this._attached=null,this._observer=null,this._options=n,t.addController(this)}setOptions(t){this._detach(),Object.assign(this._options,t),this._attach()}hostConnected(){this._attach()}hostDisconnected(){this._detach()}_resolveTarget(){const{target:t}=this._options;return typeof t=="function"?t():t??null}_attach(){if(this._options.disabled||this._attached)return;const t=this._resolveTarget();t&&(this._observer??=new MutationObserver(this._options.callback),this._observer.observe(t,this._options.observerOptions??{childList:!0}),this._attached=t)}_detach(){this._observer?.disconnect(),this._attached=null}}class Zo{constructor(t,n){this._frame=0,this._links=[],this._host=t,this._options=n,t.addController(this)}hostConnected(){this.sync()}hostDisconnected(){this._mutationObserver?.disconnect(),this._resizeObserver?.disconnect(),this._mutationObserver=void 0,this._resizeObserver=void 0,this._frame&&cancelAnimationFrame(this._frame),this._frame=0}sync(){this._collectLinks(),this._observeLinks(),this.update()}update(){this._frame&&cancelAnimationFrame(this._frame),this._frame=requestAnimationFrame(()=>{this._frame=0,this._positionIndicator()})}_collectLinks(){const n=this._options.slot()?.assignedElements({flatten:!0})??[],i=new Set;for(const s of n)s instanceof HTMLAnchorElement&&i.add(s),s.querySelectorAll("a").forEach(r=>i.add(r));this._links=Array.from(i)}_observeLinks(){this._mutationObserver?.disconnect(),this._resizeObserver?.disconnect(),this._mutationObserver=new MutationObserver(()=>{this._collectLinks(),this._observeLinks(),this.update()}),this._resizeObserver=new ResizeObserver(()=>this.update()),this._resizeObserver.observe(this._host);for(const t of this._links){this._mutationObserver.observe(t,{attributes:!0,attributeFilter:["aria-current","class","data-active"],childList:!0,subtree:!0}),this._resizeObserver.observe(t);const n=this._targetFor(t);n&&n!==t&&this._resizeObserver.observe(n)}}_activeLink(){const t=this._options.activeSelector().trim();if(t){const n=this._links.find(i=>i.matches(t));if(n)return n}return this._links.find(n=>{const i=n.getAttribute("aria-current");return i!==null&&i!==""&&i!=="false"})??null}_targetFor(t){const n=this._options.indicatorTargetSelector().trim();if(n){const i=t.matches(n)?t:t.querySelector(n);if(i)return i}return t.querySelector("[data-rc-navigation-indicator]")??t.querySelector("[data-rc-navigation-icon]")??t}_positionIndicator(){const t=this._options.container(),n=this._options.indicator(),i=this._activeLink();if(this._host.toggleAttribute("has-active",!!i),!t||!n||!i){n?.toggleAttribute("hidden",!0);return}const s=this._targetFor(i),r=t.getBoundingClientRect(),l=s.getBoundingClientRect();if(!l.width||!l.height){n.toggleAttribute("hidden",!0);return}n.toggleAttribute("hidden",!1),n.style.inlineSize=`${l.width}px`,n.style.blockSize=`${l.height}px`,n.style.transform=`translate(${l.left-r.left}px, ${l.top-r.top}px)`}}class tl{constructor(t){this._callback=null,this._frame=0,t?.addController(this)}get pending(){return this._frame!==0}schedule(t){this._callback=t,!this._frame&&(this._frame=requestAnimationFrame(n=>{const i=this._callback;this._frame=0,this._callback=null,i?.(n)}))}cancel(){this._frame&&(cancelAnimationFrame(this._frame),this._frame=0,this._callback=null)}hostDisconnected(){this.cancel()}}class el{constructor(t){this._buffer="",this._timer=0,this._options=t}get buffer(){return this._buffer}reset(){this._buffer="",this._clearTimer()}handleKeydown(t){return t.key.length!==1||t.altKey||t.ctrlKey||t.metaKey?!1:(this.search(t.key),t.preventDefault(),!0)}search(t){this._buffer+=t.toLocaleLowerCase(),this._scheduleReset();const n=this._options.items();if(!n.length)return null;const i=this._options.startIndex?.()??0,s=n.length;for(let r=1;r<=s;r+=1){const l=(i+r)%s,c=n[l];if(this._options.text(c).trim().toLocaleLowerCase().startsWith(this._buffer))return this._options.onMatch(c,l),c}return null}_scheduleReset(){this._clearTimer(),this._timer=window.setTimeout(()=>this.reset(),this._options.timeout??500)}_clearTimer(){this._timer&&(window.clearTimeout(this._timer),this._timer=0)}}function nl(e){let t=e.parentElement;for(;t&&t!==document.documentElement;){const{overflow:n,overflowY:i}=getComputedStyle(t);if(/auto|scroll/.test(i)||/auto|scroll/.test(n))return t;t=t.parentElement}return document.scrollingElement??document.documentElement}function Bn(e){return e==null||e.hasAttribute("disabled")?!1:!!((e instanceof HTMLAnchorElement||e instanceof HTMLAreaElement)&&e.hasAttribute("href")||e instanceof HTMLButtonElement||e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement||e instanceof HTMLSelectElement||e.hasAttribute("tabindex")||e.shadowRoot?.delegatesFocus===!0)}function Un(e,t){return e.querySelector(t)}function Vn(e,t){return Array.from(e.querySelectorAll(t))}function il(e,t){if(Vn(e,t.selector).length>=(t.minimum??1))return!1;const n=t.hostName??e.localName,i=t.childDescription??t.selector.replace(":scope > ",""),s=t.message??`[${n}] No direct child ${i} found. Place ${i} inside <${n}>.`;return console.warn(s,e),!0}class sl{constructor(t,n){this._observer=null,this._child=null,this._host=t,this._options=n,t.addController(this)}get child(){return this._child}hostConnected(){if(this.sync(),!this._options.observe)return;this._observer??=new MutationObserver(()=>this.sync());const t=this._options.observe===!0?{childList:!0}:this._options.observe;this._observer.observe(this._host,t)}hostDisconnected(){this._observer?.disconnect(),this._child=null}sync(){const t=this._child,n=Un(this._host,this._options.selector);return this._child=n,n||this._options.onMissing?.(this._host),n!==t&&this._options.onChange?.(n,t),n}}var rl=Object.defineProperty,ol=(e,t,n,i)=>{for(var s=void 0,r=e.length-1,l;r>=0;r--)(l=e[r])&&(s=l(t,n,s)||s);return s&&rl(t,n,s),s};function ll(e){class t extends e{constructor(){super(...arguments),this._items=[]}get items(){return this._items.map(i=>i.deref()).filter(i=>Bn(i))}get firstItem(){return this.items.at(0)}get lastItem(){return this.items.at(-1)}get nextItem(){const i=this._lastFocused?this.items.indexOf(this._lastFocused):0;return this.items.at((i+1)%this.items.length)}get previousItem(){const i=this._lastFocused?this.items.indexOf(this._lastFocused):0;return this.items.at((i-1)%this.items.length)}focusItem(i){i?.focus()}focusItemAt(i){this.focusItem(this.items.at(i))}focusFirst(){this.focusItem(this.firstItem)}focusLast(){this.focusItem(this.lastItem)}_collectItems(i){return i.assignedElements()}_handleItemFocus(i){const s=i.composedPath().find(r=>this.items.includes(r));s!=null&&(this._lastFocused=s,this.items.forEach(r=>r.setAttribute("tabindex","-1")),s.setAttribute("tabindex","0"))}_onSlotChange(i){const s=this._items;this._items=this._collectItems(i.currentTarget).map(r=>new WeakRef(r)),queueMicrotask(()=>{this.isConnected&&(s.forEach(r=>r.deref()?.removeAttribute("tabindex")),this._initItems())})}_initItems(){this._items.forEach(s=>s.deref()?.setAttribute("tabindex","-1"));const i=this.items[0];i&&i.setAttribute("tabindex","0")}}return ol([Mo.state()],t.prototype,"_lastFocused"),t}function al(e,t,n,i){const s=Math.min(Math.max(e,t),n);if(i<=0)return s;const r=Math.round((s-t)/i)*i+t;return Math.min(Math.max(r,t),n)}function cl(e,t,n){return n===t?0:Math.min(Math.max((e-t)/(n-t),0),1)}function hl(e,t){let n=-1,i=1/0;return e.forEach((s,r)=>{const l=Math.abs(s-t);Number.isFinite(s)&&l<i&&(n=r,i=l)}),n}function ul(e,t,n){if(n>0){const i=e.findIndex(s=>Number.isFinite(s)&&s>t);return i>=0?i:e.length-1}for(let i=e.length-1;i>=0;i-=1)if(Number.isFinite(e[i])&&e[i]<t)return i;return e.length>0?0:-1}function fl(e,t){return e.length===0?-1:t>0?e.length-1:0}var dl=Object.defineProperty,pl=Object.defineProperties,ml=Object.getOwnPropertyDescriptors,Xn=Object.getOwnPropertySymbols,gl=Object.prototype.hasOwnProperty,_l=Object.prototype.propertyIsEnumerable,Yn=(e,t,n)=>t in e?dl(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,U=(e,t)=>{for(var n in t||(t={}))gl.call(t,n)&&Yn(e,n,t[n]);if(Xn)for(var n of Xn(t))_l.call(t,n)&&Yn(e,n,t[n]);return e},J=(e,t)=>pl(e,ml(t)),P=(e,t,n)=>new Promise((i,s)=>{var r=a=>{try{c(n.next(a))}catch(o){s(o)}},l=a=>{try{c(n.throw(a))}catch(o){s(o)}},c=a=>a.done?i(a.value):Promise.resolve(a.value).then(r,l);c((n=n.apply(e,t)).next())});const Ve=Math.min,Nt=Math.max,me=Math.round,ge=Math.floor,mt=e=>({x:e,y:e});function yl(e,t){return typeof e=="function"?e(t):e}function bl(e){return U({top:0,right:0,bottom:0,left:0},e)}function kl(e){return typeof e!="number"?bl(e):{top:e,right:e,bottom:e,left:e}}function _e(e){const{x:t,y:n,width:i,height:s}=e;return{width:i,height:s,top:n,left:t,right:t+i,bottom:n+s,x:t,y:n}}function vl(e,t){return P(this,null,function*(){var n;t===void 0&&(t={});const{x:i,y:s,platform:r,rects:l,elements:c,strategy:a}=e,{boundary:o="clippingAncestors",rootBoundary:h="viewport",elementContext:u="floating",altBoundary:f=!1,padding:d=0}=yl(t,e),p=kl(d),g=c[f?u==="floating"?"reference":"floating":u],y=_e(yield r.getClippingRect({element:(n=yield r.isElement==null?void 0:r.isElement(g))==null||n?g:g.contextElement||(yield r.getDocumentElement==null?void 0:r.getDocumentElement(c.floating)),boundary:o,rootBoundary:h,strategy:a})),_=u==="floating"?{x:i,y:s,width:l.floating.width,height:l.floating.height}:l.reference,S=yield r.getOffsetParent==null?void 0:r.getOffsetParent(c.floating),x=(yield r.isElement==null?void 0:r.isElement(S))?(yield r.getScale==null?void 0:r.getScale(S))||{x:1,y:1}:{x:1,y:1},A=_e(r.convertOffsetParentRelativeRectToViewportRelativeRect?yield r.convertOffsetParentRelativeRectToViewportRelativeRect({elements:c,rect:_,offsetParent:S,strategy:a}):_);return{top:(y.top-A.top+p.top)/x.y,bottom:(A.bottom-y.bottom+p.bottom)/x.y,left:(y.left-A.left+p.left)/x.x,right:(A.right-y.right+p.right)/x.x}})}function ye(){return typeof window<"u"}function Ht(e){return qn(e)?(e.nodeName||"").toLowerCase():"#document"}function et(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function gt(e){var t;return(t=(qn(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function qn(e){return ye()?e instanceof Node||e instanceof et(e).Node:!1}function at(e){return ye()?e instanceof Element||e instanceof et(e).Element:!1}function _t(e){return ye()?e instanceof HTMLElement||e instanceof et(e).HTMLElement:!1}function Gn(e){return!ye()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof et(e).ShadowRoot}const Sl=new Set(["inline","contents"]);function ie(e){const{overflow:t,overflowX:n,overflowY:i,display:s}=ct(e);return/auto|scroll|overlay|hidden|clip/.test(t+i+n)&&!Sl.has(s)}const wl=new Set(["table","td","th"]);function Cl(e){return wl.has(Ht(e))}const xl=[":popover-open",":modal"];function be(e){return xl.some(t=>{try{return e.matches(t)}catch{return!1}})}const Ll=["transform","translate","scale","rotate","perspective"],Tl=["transform","translate","scale","rotate","perspective","filter"],Al=["paint","layout","strict","content"];function Xe(e){const t=Ye(),n=at(e)?ct(e):e;return Ll.some(i=>n[i]?n[i]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||Tl.some(i=>(n.willChange||"").includes(i))||Al.some(i=>(n.contain||"").includes(i))}function El(e){let t=Ct(e);for(;_t(t)&&!Wt(t);){if(Xe(t))return t;if(be(t))return null;t=Ct(t)}return null}function Ye(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const Pl=new Set(["html","body","#document"]);function Wt(e){return Pl.has(Ht(e))}function ct(e){return et(e).getComputedStyle(e)}function ke(e){return at(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Ct(e){if(Ht(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Gn(e)&&e.host||gt(e);return Gn(t)?t.host:t}function Kn(e){const t=Ct(e);return Wt(t)?e.ownerDocument?e.ownerDocument.body:e.body:_t(t)&&ie(t)?t:Kn(t)}function se(e,t,n){var i;t===void 0&&(t=[]),n===void 0&&(n=!0);const s=Kn(e),r=s===((i=e.ownerDocument)==null?void 0:i.body),l=et(s);if(r){const c=qe(l);return t.concat(l,l.visualViewport||[],ie(s)?s:[],c&&n?se(c):[])}return t.concat(s,se(s,[],n))}function qe(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Qn(e){const t=ct(e);let n=parseFloat(t.width)||0,i=parseFloat(t.height)||0;const s=_t(e),r=s?e.offsetWidth:n,l=s?e.offsetHeight:i,c=me(n)!==r||me(i)!==l;return c&&(n=r,i=l),{width:n,height:i,$:c}}function Ge(e){return at(e)?e:e.contextElement}function Bt(e){const t=Ge(e);if(!_t(t))return mt(1);const n=t.getBoundingClientRect(),{width:i,height:s,$:r}=Qn(t);let l=(r?me(n.width):n.width)/i,c=(r?me(n.height):n.height)/s;return(!l||!Number.isFinite(l))&&(l=1),(!c||!Number.isFinite(c))&&(c=1),{x:l,y:c}}const Ol=mt(0);function Jn(e){const t=et(e);return!Ye()||!t.visualViewport?Ol:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Dl(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==et(e)?!1:t}function Pt(e,t,n,i){t===void 0&&(t=!1),n===void 0&&(n=!1);const s=e.getBoundingClientRect(),r=Ge(e);let l=mt(1);t&&(i?at(i)&&(l=Bt(i)):l=Bt(e));const c=Dl(r,n,i)?Jn(r):mt(0);let a=(s.left+c.x)/l.x,o=(s.top+c.y)/l.y,h=s.width/l.x,u=s.height/l.y;if(r){const f=et(r),d=i&&at(i)?et(i):i;let p=f,g=qe(p);for(;g&&i&&d!==p;){const y=Bt(g),_=g.getBoundingClientRect(),S=ct(g),x=_.left+(g.clientLeft+parseFloat(S.paddingLeft))*y.x,A=_.top+(g.clientTop+parseFloat(S.paddingTop))*y.y;a*=y.x,o*=y.y,h*=y.x,u*=y.y,a+=x,o+=A,p=et(g),g=qe(p)}}return _e({width:h,height:u,x:a,y:o})}function ve(e,t){const n=ke(e).scrollLeft;return t?t.left+n:Pt(gt(e)).left+n}function Zn(e,t){const n=e.getBoundingClientRect(),i=n.left+t.scrollLeft-ve(e,n),s=n.top+t.scrollTop;return{x:i,y:s}}function Il(e){let{elements:t,rect:n,offsetParent:i,strategy:s}=e;const r=s==="fixed",l=gt(i),c=t?be(t.floating):!1;if(i===l||c&&r)return n;let a={scrollLeft:0,scrollTop:0},o=mt(1);const h=mt(0),u=_t(i);if((u||!u&&!r)&&((Ht(i)!=="body"||ie(l))&&(a=ke(i)),_t(i))){const d=Pt(i);o=Bt(i),h.x=d.x+i.clientLeft,h.y=d.y+i.clientTop}const f=l&&!u&&!r?Zn(l,a):mt(0);return{width:n.width*o.x,height:n.height*o.y,x:n.x*o.x-a.scrollLeft*o.x+h.x+f.x,y:n.y*o.y-a.scrollTop*o.y+h.y+f.y}}function Rl(e){return Array.from(e.getClientRects())}function Ml(e){const t=gt(e),n=ke(e),i=e.ownerDocument.body,s=Nt(t.scrollWidth,t.clientWidth,i.scrollWidth,i.clientWidth),r=Nt(t.scrollHeight,t.clientHeight,i.scrollHeight,i.clientHeight);let l=-n.scrollLeft+ve(e);const c=-n.scrollTop;return ct(i).direction==="rtl"&&(l+=Nt(t.clientWidth,i.clientWidth)-s),{width:s,height:r,x:l,y:c}}const ti=25;function Fl(e,t){const n=et(e),i=gt(e),s=n.visualViewport;let r=i.clientWidth,l=i.clientHeight,c=0,a=0;if(s){r=s.width,l=s.height;const h=Ye();(!h||h&&t==="fixed")&&(c=s.offsetLeft,a=s.offsetTop)}const o=ve(i);if(o<=0){const h=i.ownerDocument,u=h.body,f=getComputedStyle(u),d=h.compatMode==="CSS1Compat"&&parseFloat(f.marginLeft)+parseFloat(f.marginRight)||0,p=Math.abs(i.clientWidth-u.clientWidth-d);p<=ti&&(r-=p)}else o<=ti&&(r+=o);return{width:r,height:l,x:c,y:a}}const jl=new Set(["absolute","fixed"]);function $l(e,t){const n=Pt(e,!0,t==="fixed"),i=n.top+e.clientTop,s=n.left+e.clientLeft,r=_t(e)?Bt(e):mt(1),l=e.clientWidth*r.x,c=e.clientHeight*r.y,a=s*r.x,o=i*r.y;return{width:l,height:c,x:a,y:o}}function ei(e,t,n){let i;if(t==="viewport")i=Fl(e,n);else if(t==="document")i=Ml(gt(e));else if(at(t))i=$l(t,n);else{const s=Jn(e);i={x:t.x-s.x,y:t.y-s.y,width:t.width,height:t.height}}return _e(i)}function ni(e,t){const n=Ct(e);return n===t||!at(n)||Wt(n)?!1:ct(n).position==="fixed"||ni(n,t)}function zl(e,t){const n=t.get(e);if(n)return n;let i=se(e,[],!1).filter(c=>at(c)&&Ht(c)!=="body"),s=null;const r=ct(e).position==="fixed";let l=r?Ct(e):e;for(;at(l)&&!Wt(l);){const c=ct(l),a=Xe(l);!a&&c.position==="fixed"&&(s=null),(r?!a&&!s:!a&&c.position==="static"&&s&&jl.has(s.position)||ie(l)&&!a&&ni(e,l))?i=i.filter(o=>o!==l):s=c,l=Ct(l)}return t.set(e,i),i}function Nl(e){let{element:t,boundary:n,rootBoundary:i,strategy:s}=e;const r=[...n==="clippingAncestors"?be(t)?[]:zl(t,this._c):[].concat(n),i],l=r[0],c=r.reduce((a,o)=>{const h=ei(t,o,s);return a.top=Nt(h.top,a.top),a.right=Ve(h.right,a.right),a.bottom=Ve(h.bottom,a.bottom),a.left=Nt(h.left,a.left),a},ei(t,l,s));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}function Hl(e){const{width:t,height:n}=Qn(e);return{width:t,height:n}}function Wl(e,t,n){const i=_t(t),s=gt(t),r=n==="fixed",l=Pt(e,!0,r,t);let c={scrollLeft:0,scrollTop:0};const a=mt(0);function o(){a.x=ve(s)}if(i||!i&&!r)if((Ht(t)!=="body"||ie(s))&&(c=ke(t)),i){const d=Pt(t,!0,r,t);a.x=d.x+t.clientLeft,a.y=d.y+t.clientTop}else s&&o();r&&!i&&s&&o();const h=s&&!i&&!r?Zn(s,c):mt(0),u=l.left+c.scrollLeft-a.x-h.x,f=l.top+c.scrollTop-a.y-h.y;return{x:u,y:f,width:l.width,height:l.height}}function Ke(e){return ct(e).position==="static"}function ii(e,t){if(!_t(e)||ct(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return gt(e)===n&&(n=n.ownerDocument.body),n}function si(e,t){const n=et(e);if(be(e))return n;if(!_t(e)){let s=Ct(e);for(;s&&!Wt(s);){if(at(s)&&!Ke(s))return s;s=Ct(s)}return n}let i=ii(e,t);for(;i&&Cl(i)&&Ke(i);)i=ii(i,t);return i&&Wt(i)&&Ke(i)&&!Xe(i)?n:i||El(e)||n}const Bl=function(e){return P(this,null,function*(){const t=this.getOffsetParent||si,n=this.getDimensions,i=yield n(e.floating);return{reference:Wl(e.reference,yield t(e.floating),e.strategy),floating:{x:0,y:0,width:i.width,height:i.height}}})};function Ul(e){return ct(e).direction==="rtl"}const nt={convertOffsetParentRelativeRectToViewportRelativeRect:Il,getDocumentElement:gt,getClippingRect:Nl,getOffsetParent:si,getElementRects:Bl,getClientRects:Rl,getDimensions:Hl,getScale:Bt,isElement:at,isRTL:Ul};function ri(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Vl(e,t){let n=null,i;const s=gt(e);function r(){var c;clearTimeout(i),(c=n)==null||c.disconnect(),n=null}function l(c,a){c===void 0&&(c=!1),a===void 0&&(a=1),r();const o=e.getBoundingClientRect(),{left:h,top:u,width:f,height:d}=o;if(c||t(),!f||!d)return;const p=ge(u),g=ge(s.clientWidth-(h+f)),y=ge(s.clientHeight-(u+d)),_=ge(h),S={rootMargin:-p+"px "+-g+"px "+-y+"px "+-_+"px",threshold:Nt(0,Ve(1,a))||1};let x=!0;function A(pt){const w=pt[0].intersectionRatio;if(w!==a){if(!x)return l();w?l(!1,w):i=setTimeout(()=>{l(!1,1e-7)},1e3)}w===1&&!ri(o,e.getBoundingClientRect())&&l(),x=!1}try{n=new IntersectionObserver(A,J(U({},S),{root:s.ownerDocument}))}catch{n=new IntersectionObserver(A,S)}n.observe(e)}return l(!0),r}function Qe(e,t,n,i){i===void 0&&(i={});const{ancestorScroll:s=!0,ancestorResize:r=!0,elementResize:l=typeof ResizeObserver=="function",layoutShift:c=typeof IntersectionObserver=="function",animationFrame:a=!1}=i,o=Ge(e),h=s||r?[...o?se(o):[],...se(t)]:[];h.forEach(_=>{s&&_.addEventListener("scroll",n,{passive:!0}),r&&_.addEventListener("resize",n)});const u=o&&c?Vl(o,n):null;let f=-1,d=null;l&&(d=new ResizeObserver(_=>{let[S]=_;S&&S.target===o&&d&&(d.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var x;(x=d)==null||x.observe(t)})),n()}),o&&!a&&d.observe(o),d.observe(t));let p,g=a?Pt(e):null;a&&y();function y(){const _=Pt(e);g&&!ri(g,_)&&n(),g=_,p=requestAnimationFrame(y)}return n(),()=>{var _;h.forEach(S=>{s&&S.removeEventListener("scroll",n),r&&S.removeEventListener("resize",n)}),u?.(),(_=d)==null||_.disconnect(),d=null,a&&cancelAnimationFrame(p)}}const Xl=vl,{hasOwnProperty:Je}=Object.prototype,re=function(){};function oi(e){return typeof e=="function"?e:re}function li(e,t){return function(n,i,s){n.type===t&&e.call(this,n,i,s)}}function Yl(e,t){const n=t.structure,i=[];for(const s in n){if(Je.call(n,s)===!1)continue;let r=n[s];const l={name:s,type:!1,nullable:!1};Array.isArray(r)||(r=[r]);for(const c of r)c===null?l.nullable=!0:typeof c=="string"?l.type="node":Array.isArray(c)&&(l.type="list");l.type&&i.push(l)}return i.length?{context:t.walkContext,fields:i}:null}function ql(e){const t={};for(const n in e.node)if(Je.call(e.node,n)){const i=e.node[n];if(!i.structure)throw new Error("Missed `structure` field in `"+n+"` node type definition");t[n]=Yl(n,i)}return t}function ai(e,t){const n=e.fields.slice(),i=e.context,s=typeof i=="string";return t&&n.reverse(),function(r,l,c,a){let o;s&&(o=l[i],l[i]=r);for(const h of n){const u=r[h.name];if(!h.nullable||u){if(h.type==="list"){if(t?u.reduceRight(a,!1):u.reduce(a,!1))return!0}else if(c(u))return!0}}s&&(l[i]=o)}}function ci({StyleSheet:e,Atrule:t,Rule:n,Block:i,DeclarationList:s}){return{Atrule:{StyleSheet:e,Atrule:t,Rule:n,Block:i},Rule:{StyleSheet:e,Atrule:t,Rule:n,Block:i},Declaration:{StyleSheet:e,Atrule:t,Rule:n,Block:i,DeclarationList:s}}}function Gl(e){const t=ql(e),n={},i={},s=Symbol("break-walk"),r=Symbol("skip-node");for(const o in t)Je.call(t,o)&&t[o]!==null&&(n[o]=ai(t[o],!1),i[o]=ai(t[o],!0));const l=ci(n),c=ci(i),a=function(o,h){function u(_,S,x){const A=f.call(y,_,S,x);return A===s?!0:A===r?!1:!!(p.hasOwnProperty(_.type)&&p[_.type](_,y,u,g)||d.call(y,_,S,x)===s)}let f=re,d=re,p=n,g=(_,S,x,A)=>_||u(S,x,A);const y={break:s,skip:r,root:o,stylesheet:null,atrule:null,atrulePrelude:null,rule:null,selector:null,block:null,declaration:null,function:null};if(typeof h=="function")f=h;else if(h&&(f=oi(h.enter),d=oi(h.leave),h.reverse&&(p=i),h.visit)){if(l.hasOwnProperty(h.visit))p=h.reverse?c[h.visit]:l[h.visit];else if(!t.hasOwnProperty(h.visit))throw new Error("Bad value `"+h.visit+"` for `visit` option (should be: "+Object.keys(t).sort().join(", ")+")");f=li(f,h.visit),d=li(d,h.visit)}if(f===re&&d===re)throw new Error("Neither `enter` nor `leave` walker handler is set or both aren't a function");u(o)};return a.break=s,a.skip=r,a.find=function(o,h){let u=null;return a(o,function(f,d,p){if(h.call(this,f,d,p))return u=f,s}),u},a.findLast=function(o,h){let u=null;return a(o,{reverse:!0,enter(f,d,p){if(h.call(this,f,d,p))return u=f,s}}),u},a.findAll=function(o,h){const u=[];return a(o,function(f,d,p){h.call(this,f,d,p)&&u.push(f)}),u},a}const xt=0,m=1,C=2,B=3,I=4,wt=5,Kl=6,Y=7,ht=8,T=9,v=10,z=11,L=12,N=13,Se=14,it=15,q=16,Z=17,ut=18,Ut=19,oe=20,O=21,b=22,ft=23,Vt=24,G=25,Ql=0;function st(e){return e>=48&&e<=57}function Xt(e){return st(e)||e>=65&&e<=70||e>=97&&e<=102}function Ze(e){return e>=65&&e<=90}function Jl(e){return e>=97&&e<=122}function Zl(e){return Ze(e)||Jl(e)}function ta(e){return e>=128}function we(e){return Zl(e)||ta(e)||e===95}function hi(e){return we(e)||st(e)||e===45}function ea(e){return e>=0&&e<=8||e===11||e>=14&&e<=31||e===127}function Ce(e){return e===10||e===13||e===12}function Ot(e){return Ce(e)||e===32||e===9}function yt(e,t){return!(e!==92||Ce(t)||t===Ql)}function tn(e,t,n){return e===45?we(t)||t===45||yt(t,n):we(e)?!0:e===92?yt(e,t):!1}function en(e,t,n){return e===43||e===45?st(t)?2:t===46&&st(n)?3:0:e===46?st(t)?2:0:st(e)?1:0}function ui(e){return e===65279||e===65534?1:0}const nn=new Array(128),na=128,xe=130,fi=131,sn=132,di=133;for(let e=0;e<nn.length;e++)nn[e]=Ot(e)&&xe||st(e)&&fi||we(e)&&sn||ea(e)&&di||e||na;function rn(e){return e<128?nn[e]:sn}function Yt(e,t){return t<e.length?e.charCodeAt(t):0}function on(e,t,n){return n===13&&Yt(e,t+1)===10?2:1}function pi(e,t,n){let i=e.charCodeAt(t);return Ze(i)&&(i=i|32),i===n}function Le(e,t,n,i){if(n-t!==i.length||t<0||n>e.length)return!1;for(let s=t;s<n;s++){const r=i.charCodeAt(s-t);let l=e.charCodeAt(s);if(Ze(l)&&(l=l|32),l!==r)return!1}return!0}function ia(e,t){for(;t>=0&&Ot(e.charCodeAt(t));t--);return t+1}function Te(e,t){for(;t<e.length&&Ot(e.charCodeAt(t));t++);return t}function ln(e,t){for(;t<e.length&&st(e.charCodeAt(t));t++);return t}function qt(e,t){if(t+=2,Xt(Yt(e,t-1))){for(const i=Math.min(e.length,t+5);t<i&&Xt(Yt(e,t));t++);const n=Yt(e,t);Ot(n)&&(t+=on(e,t,n))}return t}function Ae(e,t){for(;t<e.length;t++){const n=e.charCodeAt(t);if(!hi(n)){if(yt(n,Yt(e,t+1))){t=qt(e,t)-1;continue}break}}return t}function mi(e,t){let n=e.charCodeAt(t);if((n===43||n===45)&&(n=e.charCodeAt(t+=1)),st(n)&&(t=ln(e,t+1),n=e.charCodeAt(t)),n===46&&st(e.charCodeAt(t+1))&&(t+=2,t=ln(e,t)),pi(e,t,101)){let i=0;n=e.charCodeAt(t+1),(n===45||n===43)&&(i=1,n=e.charCodeAt(t+2)),st(n)&&(t=ln(e,t+1+i+1))}return t}function an(e,t){for(;t<e.length;t++){const n=e.charCodeAt(t);if(n===41){t++;break}yt(n,Yt(e,t+1))&&(t=qt(e,t))}return t}function gi(e){if(e.length===1&&!Xt(e.charCodeAt(0)))return e[0];let t=parseInt(e,16);return(t===0||t>=55296&&t<=57343||t>1114111)&&(t=65533),String.fromCodePoint(t)}const _i=["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"],sa=16*1024;function Ee(e=null,t){return e===null||e.length<t?new Uint32Array(Math.max(t+1024,sa)):e}const yi=10,ra=12,bi=13;function ki(e){const t=e.source,n=t.length,i=t.length>0?ui(t.charCodeAt(0)):0,s=Ee(e.lines,n),r=Ee(e.columns,n);let l=e.startLine,c=e.startColumn;for(let a=i;a<n;a++){const o=t.charCodeAt(a);s[a]=l,r[a]=c++,(o===yi||o===bi||o===ra)&&(o===bi&&a+1<n&&t.charCodeAt(a+1)===yi&&(a++,s[a]=l,r[a]=c),l++,c=1)}s[n]=l,r[n]=c,e.lines=s,e.columns=r,e.computed=!0}class oa{constructor(t,n,i,s){this.setSource(t,n,i,s),this.lines=null,this.columns=null}setSource(t="",n=0,i=1,s=1){this.source=t,this.startOffset=n,this.startLine=i,this.startColumn=s,this.computed=!1}getLocation(t,n){return this.computed||ki(this),{source:n,offset:this.startOffset+t,line:this.lines[t],column:this.columns[t]}}getLocationRange(t,n,i){return this.computed||ki(this),{source:i,start:{offset:this.startOffset+t,line:this.lines[t],column:this.columns[t]},end:{offset:this.startOffset+n,line:this.lines[n],column:this.columns[n]}}}}const bt=16777215,kt=24,Dt=new Uint8Array(32);Dt[C]=b,Dt[O]=b,Dt[Ut]=oe,Dt[ft]=Vt;function vi(e){return Dt[e]!==0}class la{constructor(t,n){this.setSource(t,n)}reset(){this.eof=!1,this.tokenIndex=-1,this.tokenType=0,this.tokenStart=this.firstCharOffset,this.tokenEnd=this.firstCharOffset}setSource(t="",n=()=>{}){t=String(t||"");const i=t.length,s=Ee(this.offsetAndType,t.length+1),r=Ee(this.balance,t.length+1);let l=0,c=-1,a=0,o=t.length;this.offsetAndType=null,this.balance=null,r.fill(0),n(t,(h,u,f)=>{const d=l++;if(s[d]=h<<kt|f,c===-1&&(c=u),r[d]=o,h===a){const p=r[o];r[o]=d,o=p,a=Dt[s[p]>>kt]}else vi(h)&&(o=d,a=Dt[h])}),s[l]=xt<<kt|i,r[l]=l;for(let h=0;h<l;h++){const u=r[h];if(u<=h){const f=r[u];f!==h&&(r[h]=f)}else u>l&&(r[h]=l)}this.source=t,this.firstCharOffset=c===-1?0:c,this.tokenCount=l,this.offsetAndType=s,this.balance=r,this.reset(),this.next()}lookupType(t){return t+=this.tokenIndex,t<this.tokenCount?this.offsetAndType[t]>>kt:xt}lookupTypeNonSC(t){for(let n=this.tokenIndex;n<this.tokenCount;n++){const i=this.offsetAndType[n]>>kt;if(i!==N&&i!==G&&t--===0)return i}return xt}lookupOffset(t){return t+=this.tokenIndex,t<this.tokenCount?this.offsetAndType[t-1]&bt:this.source.length}lookupOffsetNonSC(t){for(let n=this.tokenIndex;n<this.tokenCount;n++){const i=this.offsetAndType[n]>>kt;if(i!==N&&i!==G&&t--===0)return n-this.tokenIndex}return xt}lookupValue(t,n){return t+=this.tokenIndex,t<this.tokenCount?Le(this.source,this.offsetAndType[t-1]&bt,this.offsetAndType[t]&bt,n):!1}getTokenStart(t){return t===this.tokenIndex?this.tokenStart:t>0?t<this.tokenCount?this.offsetAndType[t-1]&bt:this.offsetAndType[this.tokenCount]&bt:this.firstCharOffset}substrToCursor(t){return this.source.substring(t,this.tokenStart)}isBalanceEdge(t){return this.balance[this.tokenIndex]<t}isDelim(t,n){return n?this.lookupType(n)===T&&this.source.charCodeAt(this.lookupOffset(n))===t:this.tokenType===T&&this.source.charCodeAt(this.tokenStart)===t}skip(t){let n=this.tokenIndex+t;n<this.tokenCount?(this.tokenIndex=n,this.tokenStart=this.offsetAndType[n-1]&bt,n=this.offsetAndType[n],this.tokenType=n>>kt,this.tokenEnd=n&bt):(this.tokenIndex=this.tokenCount,this.next())}next(){let t=this.tokenIndex+1;t<this.tokenCount?(this.tokenIndex=t,this.tokenStart=this.tokenEnd,t=this.offsetAndType[t],this.tokenType=t>>kt,this.tokenEnd=t&bt):(this.eof=!0,this.tokenIndex=this.tokenCount,this.tokenType=xt,this.tokenStart=this.tokenEnd=this.source.length)}skipSC(){for(;this.tokenType===N||this.tokenType===G;)this.next()}skipUntilBalanced(t,n){let i=t,s=0,r=0;t:for(;i<this.tokenCount;i++){if(s=this.balance[i],s<t)break t;switch(r=i>0?this.offsetAndType[i-1]&bt:this.firstCharOffset,n(this.source.charCodeAt(r))){case 1:break t;case 2:i++;break t;default:vi(this.offsetAndType[i]>>kt)&&(i=s)}}this.skip(i-this.tokenIndex)}forEachToken(t){for(let n=0,i=this.firstCharOffset;n<this.tokenCount;n++){const s=i,r=this.offsetAndType[n],l=r&bt,c=r>>kt;i=l,t(c,s,l,n)}}dump(){const t=new Array(this.tokenCount);return this.forEachToken((n,i,s,r)=>{t[r]={idx:r,type:_i[n],chunk:this.source.substring(i,s),balance:this.balance[r]}}),t}}function Si(e,t){function n(u){return u<c?e.charCodeAt(u):0}function i(){if(o=mi(e,o),tn(n(o),n(o+1),n(o+2))){h=L,o=Ae(e,o);return}if(n(o)===37){h=z,o++;return}h=v}function s(){const u=o;if(o=Ae(e,o),Le(e,u,o,"url")&&n(o)===40){if(o=Te(e,o+1),n(o)===34||n(o)===39){h=C,o=u+4;return}l();return}if(n(o)===40){h=C,o++;return}h=m}function r(u){for(u||(u=n(o++)),h=wt;o<e.length;o++){const f=e.charCodeAt(o);switch(rn(f)){case u:o++;return;case xe:if(Ce(f)){o+=on(e,o,f),h=Kl;return}break;case 92:if(o===e.length-1)break;const d=n(o+1);Ce(d)?o+=on(e,o+1,d):yt(f,d)&&(o=qt(e,o)-1);break}}}function l(){for(h=Y,o=Te(e,o);o<e.length;o++){const u=e.charCodeAt(o);switch(rn(u)){case 41:o++;return;case xe:if(o=Te(e,o),n(o)===41||o>=e.length){o<e.length&&o++;return}o=an(e,o),h=ht;return;case 34:case 39:case 40:case di:o=an(e,o),h=ht;return;case 92:if(yt(u,n(o+1))){o=qt(e,o)-1;break}o=an(e,o),h=ht;return}}}e=String(e||"");const c=e.length;let a=ui(n(0)),o=a,h;for(;o<c;){const u=e.charCodeAt(o);switch(rn(u)){case xe:h=N,o=Te(e,o+1);break;case 34:r();break;case 35:hi(n(o+1))||yt(n(o+1),n(o+2))?(h=I,o=Ae(e,o+1)):(h=T,o++);break;case 39:r();break;case 40:h=O,o++;break;case 41:h=b,o++;break;case 43:en(u,n(o+1),n(o+2))?i():(h=T,o++);break;case 44:h=ut,o++;break;case 45:en(u,n(o+1),n(o+2))?i():n(o+1)===45&&n(o+2)===62?(h=it,o=o+3):tn(u,n(o+1),n(o+2))?s():(h=T,o++);break;case 46:en(u,n(o+1),n(o+2))?i():(h=T,o++);break;case 47:n(o+1)===42?(h=G,o=e.indexOf("*/",o+2),o=o===-1?e.length:o+2):(h=T,o++);break;case 58:h=q,o++;break;case 59:h=Z,o++;break;case 60:n(o+1)===33&&n(o+2)===45&&n(o+3)===45?(h=Se,o=o+4):(h=T,o++);break;case 64:tn(n(o+1),n(o+2),n(o+3))?(h=B,o=Ae(e,o+1)):(h=T,o++);break;case 91:h=Ut,o++;break;case 92:yt(u,n(o+1))?s():(h=T,o++);break;case 93:h=oe,o++;break;case 123:h=ft,o++;break;case 125:h=Vt,o++;break;case fi:i();break;case sn:s();break;default:h=T,o++}t(h,a,a=o)}}const vt=43,rt=45,Pe=110,It=!0,aa=!1;function Oe(e,t){let n=this.tokenStart+e;const i=this.charCodeAt(n);for((i===vt||i===rt)&&(t&&this.error("Number sign is not allowed"),n++);n<this.tokenEnd;n++)st(this.charCodeAt(n))||this.error("Integer is expected",n)}function Gt(e){return Oe.call(this,0,e)}function Lt(e,t){if(!this.cmpChar(this.tokenStart+e,t)){let n="";switch(t){case Pe:n="N is expected";break;case rt:n="HyphenMinus is expected";break}this.error(n,this.tokenStart+e)}}function cn(){let e=0,t=0,n=this.tokenType;for(;n===N||n===G;)n=this.lookupType(++e);if(n!==v)if(this.isDelim(vt,e)||this.isDelim(rt,e)){t=this.isDelim(vt,e)?vt:rt;do n=this.lookupType(++e);while(n===N||n===G);n!==v&&(this.skip(e),Gt.call(this,It))}else return null;return e>0&&this.skip(e),t===0&&(n=this.charCodeAt(this.tokenStart),n!==vt&&n!==rt&&this.error("Number sign is expected")),Gt.call(this,t!==0),t===rt?"-"+this.consume(v):this.consume(v)}const ca="AnPlusB",ha={a:[String,null],b:[String,null]};function wi(){const e=this.tokenStart;let t=null,n=null;if(this.tokenType===v)Gt.call(this,aa),n=this.consume(v);else if(this.tokenType===m&&this.cmpChar(this.tokenStart,rt))switch(t="-1",Lt.call(this,1,Pe),this.tokenEnd-this.tokenStart){case 2:this.next(),n=cn.call(this);break;case 3:Lt.call(this,2,rt),this.next(),this.skipSC(),Gt.call(this,It),n="-"+this.consume(v);break;default:Lt.call(this,2,rt),Oe.call(this,3,It),this.next(),n=this.substrToCursor(e+2)}else if(this.tokenType===m||this.isDelim(vt)&&this.lookupType(1)===m){let i=0;switch(t="1",this.isDelim(vt)&&(i=1,this.next()),Lt.call(this,0,Pe),this.tokenEnd-this.tokenStart){case 1:this.next(),n=cn.call(this);break;case 2:Lt.call(this,1,rt),this.next(),this.skipSC(),Gt.call(this,It),n="-"+this.consume(v);break;default:Lt.call(this,1,rt),Oe.call(this,2,It),this.next(),n=this.substrToCursor(e+i+1)}}else if(this.tokenType===L){const i=this.charCodeAt(this.tokenStart),s=i===vt||i===rt;let r=this.tokenStart+s;for(;r<this.tokenEnd&&st(this.charCodeAt(r));r++);r===this.tokenStart+s&&this.error("Integer is expected",this.tokenStart+s),Lt.call(this,r-this.tokenStart,Pe),t=this.substring(e,r),r+1===this.tokenEnd?(this.next(),n=cn.call(this)):(Lt.call(this,r-this.tokenStart+1,rt),r+2===this.tokenEnd?(this.next(),this.skipSC(),Gt.call(this,It),n="-"+this.consume(v)):(Oe.call(this,r-this.tokenStart+2,It),this.next(),n=this.substrToCursor(r+1)))}else this.error();return t!==null&&t.charCodeAt(0)===vt&&(t=t.substr(1)),n!==null&&n.charCodeAt(0)===vt&&(n=n.substr(1)),{type:"AnPlusB",loc:this.getLocation(e,this.tokenStart),a:t,b:n}}function Ci(e){if(e.a){const t=e.a==="+1"&&"n"||e.a==="1"&&"n"||e.a==="-1"&&"-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 ua=Object.freeze(Object.defineProperty({__proto__:null,generate:Ci,name:ca,parse:wi,structure:ha},Symbol.toStringTag,{value:"Module"}));function xi(){return this.Raw(this.consumeUntilLeftCurlyBracketOrSemicolon,!0)}function fa(){for(let e=1,t;t=this.lookupType(e);e++){if(t===Vt)return!0;if(t===ft||t===B)return!1}return!1}const da="Atrule",pa="atrule",ma={name:String,prelude:["AtrulePrelude","Raw",null],block:["Block",null]};function Li(e=!1){const t=this.tokenStart;let n,i,s=null,r=null;switch(this.eat(B),n=this.substrToCursor(t+1),i=n.toLowerCase(),this.skipSC(),this.eof===!1&&this.tokenType!==ft&&this.tokenType!==Z&&(this.parseAtrulePrelude?s=this.parseWithFallback(this.AtrulePrelude.bind(this,n,e),xi):s=xi.call(this,this.tokenIndex),this.skipSC()),this.tokenType){case Z:this.next();break;case ft:hasOwnProperty.call(this.atrule,i)&&typeof this.atrule[i].block=="function"?r=this.atrule[i].block.call(this,e):r=this.Block(fa.call(this));break}return{type:"Atrule",loc:this.getLocation(t,this.tokenStart),name:n,prelude:s,block:r}}function Ti(e){this.token(B,"@"+e.name),e.prelude!==null&&this.node(e.prelude),e.block?this.node(e.block):this.token(Z,";")}const ga=Object.freeze(Object.defineProperty({__proto__:null,generate:Ti,name:da,parse:Li,structure:ma,walkContext:pa},Symbol.toStringTag,{value:"Module"})),_a="AtrulePrelude",ya="atrulePrelude",ba={children:[[]]};function Ai(e){let t=null;return e!==null&&(e=e.toLowerCase()),this.skipSC(),hasOwnProperty.call(this.atrule,e)&&typeof this.atrule[e].prelude=="function"?t=this.atrule[e].prelude.call(this):t=this.readSequence(this.scope.AtrulePrelude),this.skipSC(),this.eof!==!0&&this.tokenType!==ft&&this.tokenType!==Z&&this.error("Semicolon or block is expected"),{type:"AtrulePrelude",loc:this.getLocationFromList(t),children:t}}function Ei(e){this.children(e)}const ka=Object.freeze(Object.defineProperty({__proto__:null,generate:Ei,name:_a,parse:Ai,structure:ba,walkContext:ya},Symbol.toStringTag,{value:"Module"})),va=36,Pi=42,De=61,Sa=94,hn=124,wa=126;function Ca(){this.eof&&this.error("Unexpected end of input");const e=this.tokenStart;let t=!1;return this.isDelim(Pi)?(t=!0,this.next()):this.isDelim(hn)||this.eat(m),this.isDelim(hn)?this.charCodeAt(this.tokenStart+1)!==De?(this.next(),this.eat(m)):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 xa(){const e=this.tokenStart,t=this.charCodeAt(e);return t!==De&&t!==wa&&t!==Sa&&t!==va&&t!==Pi&&t!==hn&&this.error("Attribute selector (=, ~=, ^=, $=, *=, |=) is expected"),this.next(),t!==De&&(this.isDelim(De)||this.error("Equal sign is expected"),this.next()),this.substrToCursor(e)}const La="AttributeSelector",Ta={name:"Identifier",matcher:[String,null],value:["String","Identifier",null],flags:[String,null]};function Oi(){const e=this.tokenStart;let t,n=null,i=null,s=null;return this.eat(Ut),this.skipSC(),t=Ca.call(this),this.skipSC(),this.tokenType!==oe&&(this.tokenType!==m&&(n=xa.call(this),this.skipSC(),i=this.tokenType===wt?this.String():this.Identifier(),this.skipSC()),this.tokenType===m&&(s=this.consume(m),this.skipSC())),this.eat(oe),{type:"AttributeSelector",loc:this.getLocation(e,this.tokenStart),name:t,matcher:n,value:i,flags:s}}function Di(e){this.token(T,"["),this.node(e.name),e.matcher!==null&&(this.tokenize(e.matcher),this.node(e.value)),e.flags!==null&&this.token(m,e.flags),this.token(T,"]")}const Aa=Object.freeze(Object.defineProperty({__proto__:null,generate:Di,name:La,parse:Oi,structure:Ta},Symbol.toStringTag,{value:"Module"})),Ea=38;function Ii(){return this.Raw(null,!0)}function Ri(){return this.parseWithFallback(this.Rule,Ii)}function Mi(){return this.Raw(this.consumeUntilSemicolonIncluded,!0)}function Pa(){if(this.tokenType===Z)return Mi.call(this,this.tokenIndex);const e=this.parseWithFallback(this.Declaration,Mi);return this.tokenType===Z&&this.next(),e}const Oa="Block",Da="block",Ia={children:[["Atrule","Rule","Declaration"]]};function Fi(e){const t=e?Pa:Ri,n=this.tokenStart;let i=this.createList();this.eat(ft);t:for(;!this.eof;)switch(this.tokenType){case Vt:break t;case N:case G:this.next();break;case B:i.push(this.parseWithFallback(this.Atrule.bind(this,e),Ii));break;default:e&&this.isDelim(Ea)?i.push(Ri.call(this)):i.push(t.call(this))}return this.eof||this.eat(Vt),{type:"Block",loc:this.getLocation(n,this.tokenStart),children:i}}function ji(e){this.token(ft,"{"),this.children(e,t=>{t.type==="Declaration"&&this.token(Z,";")}),this.token(Vt,"}")}const Ra=Object.freeze(Object.defineProperty({__proto__:null,generate:ji,name:Oa,parse:Fi,structure:Ia,walkContext:Da},Symbol.toStringTag,{value:"Module"})),Ma="Brackets",Fa={children:[[]]};function $i(e,t){const n=this.tokenStart;let i=null;return this.eat(Ut),i=e.call(this,t),this.eof||this.eat(oe),{type:"Brackets",loc:this.getLocation(n,this.tokenStart),children:i}}function zi(e){this.token(T,"["),this.children(e),this.token(T,"]")}const ja=Object.freeze(Object.defineProperty({__proto__:null,generate:zi,name:Ma,parse:$i,structure:Fa},Symbol.toStringTag,{value:"Module"})),$a="CDC",za=[];function Ni(){const e=this.tokenStart;return this.eat(it),{type:"CDC",loc:this.getLocation(e,this.tokenStart)}}function Hi(){this.token(it,"-->")}const Na=Object.freeze(Object.defineProperty({__proto__:null,generate:Hi,name:$a,parse:Ni,structure:za},Symbol.toStringTag,{value:"Module"})),Ha="CDO",Wa=[];function Wi(){const e=this.tokenStart;return this.eat(Se),{type:"CDO",loc:this.getLocation(e,this.tokenStart)}}function Bi(){this.token(Se,"<!--")}const Ba=Object.freeze(Object.defineProperty({__proto__:null,generate:Bi,name:Ha,parse:Wi,structure:Wa},Symbol.toStringTag,{value:"Module"})),Ua=46,Va="ClassSelector",Xa={name:String};function Ui(){return this.eatDelim(Ua),{type:"ClassSelector",loc:this.getLocation(this.tokenStart-1,this.tokenEnd),name:this.consume(m)}}function Vi(e){this.token(T,"."),this.token(m,e.name)}const Ya=Object.freeze(Object.defineProperty({__proto__:null,generate:Vi,name:Va,parse:Ui,structure:Xa},Symbol.toStringTag,{value:"Module"})),qa=43,Xi=47,Ga=62,Ka=126,Qa="Combinator",Ja={name:String};function Yi(){const e=this.tokenStart;let t;switch(this.tokenType){case N:t=" ";break;case T:switch(this.charCodeAt(this.tokenStart)){case Ga:case qa:case Ka:this.next();break;case Xi:this.next(),this.eatIdent("deep"),this.eatDelim(Xi);break;default:this.error("Combinator is expected")}t=this.substrToCursor(e);break}return{type:"Combinator",loc:this.getLocation(e,this.tokenStart),name:t}}function qi(e){this.tokenize(e.name)}const Za=Object.freeze(Object.defineProperty({__proto__:null,generate:qi,name:Qa,parse:Yi,structure:Ja},Symbol.toStringTag,{value:"Module"})),tc=42,ec=47,nc="Comment",ic={value:String};function Gi(){const e=this.tokenStart;let t=this.tokenEnd;return this.eat(G),t-e+2>=2&&this.charCodeAt(t-2)===tc&&this.charCodeAt(t-1)===ec&&(t-=2),{type:"Comment",loc:this.getLocation(e,this.tokenStart),value:this.substring(e+2,t)}}function Ki(e){this.token(G,"/*"+e.value+"*/")}const sc=Object.freeze(Object.defineProperty({__proto__:null,generate:Ki,name:nc,parse:Gi,structure:ic},Symbol.toStringTag,{value:"Module"})),rc=new Set([q,b,xt]),oc="Condition",lc={kind:String,children:[["Identifier","Feature","FeatureFunction","FeatureRange","SupportsDeclaration"]]};function Qi(e){return this.lookupTypeNonSC(1)===m&&rc.has(this.lookupTypeNonSC(2))?this.Feature(e):this.FeatureRange(e)}const ac={media:Qi,container:Qi,supports(){return this.SupportsDeclaration()}};function Ji(e="media"){const t=this.createList();t:for(;!this.eof;)switch(this.tokenType){case G:case N:this.next();continue;case m:t.push(this.Identifier());break;case O:{let n=this.parseWithFallback(()=>ac[e].call(this,e),()=>null);n||(n=this.parseWithFallback(()=>{this.eat(O);const i=this.Condition(e);return this.eat(b),i},()=>this.GeneralEnclosed(e))),t.push(n);break}case C:{let n=this.parseWithFallback(()=>this.FeatureFunction(e),()=>null);n||(n=this.GeneralEnclosed(e)),t.push(n);break}default:break t}return t.isEmpty&&this.error("Condition is expected"),{type:"Condition",loc:this.getLocationFromList(t),kind:e,children:t}}function Zi(e){e.children.forEach(t=>{t.type==="Condition"?(this.token(O,"("),this.node(t),this.token(b,")")):this.node(t)})}const cc=Object.freeze(Object.defineProperty({__proto__:null,generate:Zi,name:oc,parse:Ji,structure:lc},Symbol.toStringTag,{value:"Module"})),ts=45;function hc(e,t){return t=t||0,e.length-t>=2&&e.charCodeAt(t)===ts&&e.charCodeAt(t+1)===ts}const es=33,uc=35,fc=36,dc=38,pc=42,mc=43,ns=47;function gc(){return this.Raw(this.consumeUntilExclamationMarkOrSemicolon,!0)}function _c(){return this.Raw(this.consumeUntilExclamationMarkOrSemicolon,!1)}function yc(){const e=this.tokenIndex,t=this.Value();return t.type!=="Raw"&&this.eof===!1&&this.tokenType!==Z&&this.isDelim(es)===!1&&this.isBalanceEdge(e)===!1&&this.error(),t}const bc="Declaration",kc="declaration",vc={important:[Boolean,String],property:String,value:["Value","Raw"]};function is(){const e=this.tokenStart,t=this.tokenIndex,n=Sc.call(this),i=hc(n),s=i?this.parseCustomProperty:this.parseValue,r=i?_c:gc;let l=!1,c;this.skipSC(),this.eat(q);const a=this.tokenIndex;if(i||this.skipSC(),s?c=this.parseWithFallback(yc,r):c=r.call(this,this.tokenIndex),i&&c.type==="Value"&&c.children.isEmpty){for(let o=a-this.tokenIndex;o<=0;o++)if(this.lookupType(o)===N){c.children.appendData({type:"WhiteSpace",loc:null,value:" "});break}}return this.isDelim(es)&&(l=wc.call(this),this.skipSC()),this.eof===!1&&this.tokenType!==Z&&this.isBalanceEdge(t)===!1&&this.error(),{type:"Declaration",loc:this.getLocation(e,this.tokenStart),important:l,property:n,value:c}}function ss(e){this.token(m,e.property),this.token(q,":"),this.node(e.value),e.important&&(this.token(T,"!"),this.token(m,e.important===!0?"important":e.important))}function Sc(){const e=this.tokenStart;if(this.tokenType===T)switch(this.charCodeAt(this.tokenStart)){case pc:case fc:case mc:case uc:case dc:this.next();break;case ns:this.next(),this.isDelim(ns)&&this.next();break}return this.tokenType===I?this.eat(I):this.eat(m),this.substrToCursor(e)}function wc(){this.eat(T),this.skipSC();const e=this.consume(m);return e==="important"?!0:e}const Cc=Object.freeze(Object.defineProperty({__proto__:null,generate:ss,name:bc,parse:is,structure:vc,walkContext:kc},Symbol.toStringTag,{value:"Module"})),xc=38;function un(){return this.Raw(this.consumeUntilSemicolonIncluded,!0)}const Lc="DeclarationList",Tc={children:[["Declaration","Atrule","Rule"]]};function rs(){const e=this.createList();for(;!this.eof;)switch(this.tokenType){case N:case G:case Z:this.next();break;case B:e.push(this.parseWithFallback(this.Atrule.bind(this,!0),un));break;default:this.isDelim(xc)?e.push(this.parseWithFallback(this.Rule,un)):e.push(this.parseWithFallback(this.Declaration,un))}return{type:"DeclarationList",loc:this.getLocationFromList(e),children:e}}function os(e){this.children(e,t=>{t.type==="Declaration"&&this.token(Z,";")})}const Ac=Object.freeze(Object.defineProperty({__proto__:null,generate:os,name:Lc,parse:rs,structure:Tc},Symbol.toStringTag,{value:"Module"})),Ec="Dimension",Pc={value:String,unit:String};function ls(){const e=this.tokenStart,t=this.consumeNumber(L);return{type:"Dimension",loc:this.getLocation(e,this.tokenStart),value:t,unit:this.substring(e+t.length,this.tokenStart)}}function as(e){this.token(L,e.value+e.unit)}const Oc=Object.freeze(Object.defineProperty({__proto__:null,generate:as,name:Ec,parse:ls,structure:Pc},Symbol.toStringTag,{value:"Module"})),Dc=47,Ic="Feature",Rc={kind:String,name:String,value:["Identifier","Number","Dimension","Ratio","Function",null]};function cs(e){const t=this.tokenStart;let n,i=null;if(this.eat(O),this.skipSC(),n=this.consume(m),this.skipSC(),this.tokenType!==b){switch(this.eat(q),this.skipSC(),this.tokenType){case v:this.lookupNonWSType(1)===T?i=this.Ratio():i=this.Number();break;case L:i=this.Dimension();break;case m:i=this.Identifier();break;case C:i=this.parseWithFallback(()=>{const s=this.Function(this.readSequence,this.scope.Value);return this.skipSC(),this.isDelim(Dc)&&this.error(),s},()=>this.Ratio());break;default:this.error("Number, dimension, ratio or identifier is expected")}this.skipSC()}return this.eof||this.eat(b),{type:"Feature",loc:this.getLocation(t,this.tokenStart),kind:e,name:n,value:i}}function hs(e){this.token(O,"("),this.token(m,e.name),e.value!==null&&(this.token(q,":"),this.node(e.value)),this.token(b,")")}const Mc=Object.freeze(Object.defineProperty({__proto__:null,generate:hs,name:Ic,parse:cs,structure:Rc},Symbol.toStringTag,{value:"Module"})),Fc="FeatureFunction",jc={kind:String,feature:String,value:["Declaration","Selector"]};function $c(e,t){const n=(this.features[e]||{})[t];return typeof n!="function"&&this.error(`Unknown feature ${t}()`),n}function us(e="unknown"){const t=this.tokenStart,n=this.consumeFunctionName(),i=$c.call(this,e,n.toLowerCase());this.skipSC();const s=this.parseWithFallback(()=>{const r=this.tokenIndex,l=i.call(this);return this.eof===!1&&this.isBalanceEdge(r)===!1&&this.error(),l},()=>this.Raw(null,!1));return this.eof||this.eat(b),{type:"FeatureFunction",loc:this.getLocation(t,this.tokenStart),kind:e,feature:n,value:s}}function fs(e){this.token(C,e.feature+"("),this.node(e.value),this.token(b,")")}const zc=Object.freeze(Object.defineProperty({__proto__:null,generate:fs,name:Fc,parse:us,structure:jc},Symbol.toStringTag,{value:"Module"})),ds=47,Nc=60,ps=61,Hc=62,Wc="FeatureRange",Bc={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 fn(){switch(this.skipSC(),this.tokenType){case v:return this.isDelim(ds,this.lookupOffsetNonSC(1))?this.Ratio():this.Number();case L:return this.Dimension();case m:return this.Identifier();case C:return this.parseWithFallback(()=>{const e=this.Function(this.readSequence,this.scope.Value);return this.skipSC(),this.isDelim(ds)&&this.error(),e},()=>this.Ratio());default:this.error("Number, dimension, ratio or identifier is expected")}}function ms(e){if(this.skipSC(),this.isDelim(Nc)||this.isDelim(Hc)){const t=this.source[this.tokenStart];return this.next(),this.isDelim(ps)?(this.next(),t+"="):t}if(this.isDelim(ps))return"=";this.error(`Expected ${e?'":", ':""}"<", ">", "=" or ")"`)}function gs(e="unknown"){const t=this.tokenStart;this.skipSC(),this.eat(O);const n=fn.call(this),i=ms.call(this,n.type==="Identifier"),s=fn.call(this);let r=null,l=null;return this.lookupNonWSType(0)!==b&&(r=ms.call(this),l=fn.call(this)),this.skipSC(),this.eat(b),{type:"FeatureRange",loc:this.getLocation(t,this.tokenStart),kind:e,left:n,leftComparison:i,middle:s,rightComparison:r,right:l}}function _s(e){this.token(O,"("),this.node(e.left),this.tokenize(e.leftComparison),this.node(e.middle),e.right&&(this.tokenize(e.rightComparison),this.node(e.right)),this.token(b,")")}const Uc=Object.freeze(Object.defineProperty({__proto__:null,generate:_s,name:Wc,parse:gs,structure:Bc},Symbol.toStringTag,{value:"Module"})),Vc="Function",Xc="function",Yc={name:String,children:[[]]};function ys(e,t){const n=this.tokenStart,i=this.consumeFunctionName(),s=i.toLowerCase();let r;return r=t.hasOwnProperty(s)?t[s].call(this,t):e.call(this,t),this.eof||this.eat(b),{type:"Function",loc:this.getLocation(n,this.tokenStart),name:i,children:r}}function bs(e){this.token(C,e.name+"("),this.children(e),this.token(b,")")}const qc=Object.freeze(Object.defineProperty({__proto__:null,generate:bs,name:Vc,parse:ys,structure:Yc,walkContext:Xc},Symbol.toStringTag,{value:"Module"})),Gc="GeneralEnclosed",Kc={kind:String,function:[String,null],children:[[]]};function ks(e){const t=this.tokenStart;let n=null;this.tokenType===C?n=this.consumeFunctionName():this.eat(O);const i=this.parseWithFallback(()=>{const s=this.tokenIndex,r=this.readSequence(this.scope.Value);return this.eof===!1&&this.isBalanceEdge(s)===!1&&this.error(),r},()=>this.createSingleNodeList(this.Raw(null,!1)));return this.eof||this.eat(b),{type:"GeneralEnclosed",loc:this.getLocation(t,this.tokenStart),kind:e,function:n,children:i}}function vs(e){e.function?this.token(C,e.function+"("):this.token(O,"("),this.children(e),this.token(b,")")}const Qc=Object.freeze(Object.defineProperty({__proto__:null,generate:vs,name:Gc,parse:ks,structure:Kc},Symbol.toStringTag,{value:"Module"})),Jc="XXX",Zc="Hash",th={value:String};function Ss(){const e=this.tokenStart;return this.eat(I),{type:"Hash",loc:this.getLocation(e,this.tokenStart),value:this.substrToCursor(e+1)}}function ws(e){this.token(I,"#"+e.value)}const eh=Object.freeze(Object.defineProperty({__proto__:null,generate:ws,name:Zc,parse:Ss,structure:th,xxx:Jc},Symbol.toStringTag,{value:"Module"})),nh="Identifier",ih={name:String};function Cs(){return{type:"Identifier",loc:this.getLocation(this.tokenStart,this.tokenEnd),name:this.consume(m)}}function xs(e){this.token(m,e.name)}const sh=Object.freeze(Object.defineProperty({__proto__:null,generate:xs,name:nh,parse:Cs,structure:ih},Symbol.toStringTag,{value:"Module"})),rh="IdSelector",oh={name:String};function Ls(){const e=this.tokenStart;return this.eat(I),{type:"IdSelector",loc:this.getLocation(e,this.tokenStart),name:this.substrToCursor(e+1)}}function Ts(e){this.token(T,"#"+e.name)}const lh=Object.freeze(Object.defineProperty({__proto__:null,generate:Ts,name:rh,parse:Ls,structure:oh},Symbol.toStringTag,{value:"Module"})),ah=46,ch="Layer",hh={name:String};function As(){let e=this.tokenStart,t=this.consume(m);for(;this.isDelim(ah);)this.eat(T),t+="."+this.consume(m);return{type:"Layer",loc:this.getLocation(e,this.tokenStart),name:t}}function Es(e){this.tokenize(e.name)}const uh=Object.freeze(Object.defineProperty({__proto__:null,generate:Es,name:ch,parse:As,structure:hh},Symbol.toStringTag,{value:"Module"})),fh="LayerList",dh={children:[["Layer"]]};function Ps(){const e=this.createList();for(this.skipSC();!this.eof&&(e.push(this.Layer()),this.lookupTypeNonSC(0)===ut);)this.skipSC(),this.next(),this.skipSC();return{type:"LayerList",loc:this.getLocationFromList(e),children:e}}function Os(e){this.children(e,()=>this.token(ut,","))}const ph=Object.freeze(Object.defineProperty({__proto__:null,generate:Os,name:fh,parse:Ps,structure:dh},Symbol.toStringTag,{value:"Module"})),mh="MediaQuery",gh={modifier:[String,null],mediaType:[String,null],condition:["Condition",null]};function Ds(){const e=this.tokenStart;let t=null,n=null,i=null;if(this.skipSC(),this.tokenType===m&&this.lookupTypeNonSC(1)!==O){const s=this.consume(m),r=s.toLowerCase();switch(r==="not"||r==="only"?(this.skipSC(),t=r,n=this.consume(m)):n=s,this.lookupTypeNonSC(0)){case m:{this.skipSC(),this.eatIdent("and"),i=this.Condition("media");break}case ft:case Z:case ut:case xt:break;default:this.error("Identifier or parenthesis is expected")}}else switch(this.tokenType){case m:case O:case C:{i=this.Condition("media");break}case ft:case Z:case xt:break;default:this.error("Identifier or parenthesis is expected")}return{type:"MediaQuery",loc:this.getLocation(e,this.tokenStart),modifier:t,mediaType:n,condition:i}}function Is(e){e.mediaType?(e.modifier&&this.token(m,e.modifier),this.token(m,e.mediaType),e.condition&&(this.token(m,"and"),this.node(e.condition))):e.condition&&this.node(e.condition)}const _h=Object.freeze(Object.defineProperty({__proto__:null,generate:Is,name:mh,parse:Ds,structure:gh},Symbol.toStringTag,{value:"Module"})),yh="MediaQueryList",bh={children:[["MediaQuery"]]};function Rs(){const e=this.createList();for(this.skipSC();!this.eof&&(e.push(this.MediaQuery()),this.tokenType===ut);)this.next();return{type:"MediaQueryList",loc:this.getLocationFromList(e),children:e}}function Ms(e){this.children(e,()=>this.token(ut,","))}const kh=Object.freeze(Object.defineProperty({__proto__:null,generate:Ms,name:yh,parse:Rs,structure:bh},Symbol.toStringTag,{value:"Module"})),vh=38,Sh="NestingSelector",wh={};function Fs(){const e=this.tokenStart;return this.eatDelim(vh),{type:"NestingSelector",loc:this.getLocation(e,this.tokenStart)}}function js(){this.token(T,"&")}const Ch=Object.freeze(Object.defineProperty({__proto__:null,generate:js,name:Sh,parse:Fs,structure:wh},Symbol.toStringTag,{value:"Module"})),xh="Nth",Lh={nth:["AnPlusB","Identifier"],selector:["SelectorList",null]};function $s(){this.skipSC();const e=this.tokenStart;let t=e,n=null,i;return this.lookupValue(0,"odd")||this.lookupValue(0,"even")?i=this.Identifier():i=this.AnPlusB(),t=this.tokenStart,this.skipSC(),this.lookupValue(0,"of")&&(this.next(),n=this.SelectorList(),t=this.tokenStart),{type:"Nth",loc:this.getLocation(e,t),nth:i,selector:n}}function zs(e){this.node(e.nth),e.selector!==null&&(this.token(m,"of"),this.node(e.selector))}const Th=Object.freeze(Object.defineProperty({__proto__:null,generate:zs,name:xh,parse:$s,structure:Lh},Symbol.toStringTag,{value:"Module"})),Ah="Number",Eh={value:String};function Ns(){return{type:"Number",loc:this.getLocation(this.tokenStart,this.tokenEnd),value:this.consume(v)}}function Hs(e){this.token(v,e.value)}const Ph=Object.freeze(Object.defineProperty({__proto__:null,generate:Hs,name:Ah,parse:Ns,structure:Eh},Symbol.toStringTag,{value:"Module"})),Oh="Operator",Dh={value:String};function Ws(){const e=this.tokenStart;return this.next(),{type:"Operator",loc:this.getLocation(e,this.tokenStart),value:this.substrToCursor(e)}}function Bs(e){this.tokenize(e.value)}const Ih=Object.freeze(Object.defineProperty({__proto__:null,generate:Bs,name:Oh,parse:Ws,structure:Dh},Symbol.toStringTag,{value:"Module"})),Rh="Parentheses",Mh={children:[[]]};function Us(e,t){const n=this.tokenStart;let i=null;return this.eat(O),i=e.call(this,t),this.eof||this.eat(b),{type:"Parentheses",loc:this.getLocation(n,this.tokenStart),children:i}}function Vs(e){this.token(O,"("),this.children(e),this.token(b,")")}const Fh=Object.freeze(Object.defineProperty({__proto__:null,generate:Vs,name:Rh,parse:Us,structure:Mh},Symbol.toStringTag,{value:"Module"})),jh="Percentage",$h={value:String};function Xs(){return{type:"Percentage",loc:this.getLocation(this.tokenStart,this.tokenEnd),value:this.consumeNumber(z)}}function Ys(e){this.token(z,e.value+"%")}const zh=Object.freeze(Object.defineProperty({__proto__:null,generate:Ys,name:jh,parse:Xs,structure:$h},Symbol.toStringTag,{value:"Module"})),Nh="PseudoClassSelector",Hh="function",Wh={name:String,children:[["Raw"],null]};function qs(){const e=this.tokenStart;let t=null,n,i;return this.eat(q),this.tokenType===C?(n=this.consumeFunctionName(),i=n.toLowerCase(),this.lookupNonWSType(0)==b?t=this.createList():hasOwnProperty.call(this.pseudo,i)?(this.skipSC(),t=this.pseudo[i].call(this),this.skipSC()):(t=this.createList(),t.push(this.Raw(null,!1))),this.eat(b)):n=this.consume(m),{type:"PseudoClassSelector",loc:this.getLocation(e,this.tokenStart),name:n,children:t}}function Gs(e){this.token(q,":"),e.children===null?this.token(m,e.name):(this.token(C,e.name+"("),this.children(e),this.token(b,")"))}const Bh=Object.freeze(Object.defineProperty({__proto__:null,generate:Gs,name:Nh,parse:qs,structure:Wh,walkContext:Hh},Symbol.toStringTag,{value:"Module"})),Uh="PseudoElementSelector",Vh="function",Xh={name:String,children:[["Raw"],null]};function Ks(){const e=this.tokenStart;let t=null,n,i;return this.eat(q),this.eat(q),this.tokenType===C?(n=this.consumeFunctionName(),i=n.toLowerCase(),this.lookupNonWSType(0)==b?t=this.createList():hasOwnProperty.call(this.pseudo,i)?(this.skipSC(),t=this.pseudo[i].call(this),this.skipSC()):(t=this.createList(),t.push(this.Raw(null,!1))),this.eat(b)):n=this.consume(m),{type:"PseudoElementSelector",loc:this.getLocation(e,this.tokenStart),name:n,children:t}}function Qs(e){this.token(q,":"),this.token(q,":"),e.children===null?this.token(m,e.name):(this.token(C,e.name+"("),this.children(e),this.token(b,")"))}const Yh=Object.freeze(Object.defineProperty({__proto__:null,generate:Qs,name:Uh,parse:Ks,structure:Xh,walkContext:Vh},Symbol.toStringTag,{value:"Module"})),Js=47;function Zs(){switch(this.skipSC(),this.tokenType){case v:return this.Number();case C:return this.Function(this.readSequence,this.scope.Value);default:this.error("Number of function is expected")}}const qh="Ratio",Gh={left:["Number","Function"],right:["Number","Function",null]};function tr(){const e=this.tokenStart,t=Zs.call(this);let n=null;return this.skipSC(),this.isDelim(Js)&&(this.eatDelim(Js),n=Zs.call(this)),{type:"Ratio",loc:this.getLocation(e,this.tokenStart),left:t,right:n}}function er(e){this.node(e.left),this.token(T,"/"),e.right?this.node(e.right):this.node(v,1)}const Kh=Object.freeze(Object.defineProperty({__proto__:null,generate:er,name:qh,parse:tr,structure:Gh},Symbol.toStringTag,{value:"Module"}));function Qh(){return this.tokenIndex>0&&this.lookupType(-1)===N?this.tokenIndex>1?this.getTokenStart(this.tokenIndex-1):this.firstCharOffset:this.tokenStart}const Jh="Raw",Zh={value:String};function nr(e,t){const n=this.getTokenStart(this.tokenIndex);let i;return this.skipUntilBalanced(this.tokenIndex,e||this.consumeUntilBalanceEnd),t&&this.tokenStart>n?i=Qh.call(this):i=this.tokenStart,{type:"Raw",loc:this.getLocation(n,i),value:this.substring(n,i)}}function ir(e){this.tokenize(e.value)}const tu=Object.freeze(Object.defineProperty({__proto__:null,generate:ir,name:Jh,parse:nr,structure:Zh},Symbol.toStringTag,{value:"Module"}));function sr(){return this.Raw(this.consumeUntilLeftCurlyBracket,!0)}function eu(){const e=this.SelectorList();return e.type!=="Raw"&&this.eof===!1&&this.tokenType!==ft&&this.error(),e}const nu="Rule",iu="rule",su={prelude:["SelectorList","Raw"],block:["Block"]};function rr(){const e=this.tokenIndex,t=this.tokenStart;let n,i;return this.parseRulePrelude?n=this.parseWithFallback(eu,sr):n=sr.call(this,e),i=this.Block(!0),{type:"Rule",loc:this.getLocation(t,this.tokenStart),prelude:n,block:i}}function or(e){this.node(e.prelude),this.node(e.block)}const ru=Object.freeze(Object.defineProperty({__proto__:null,generate:or,name:nu,parse:rr,structure:su,walkContext:iu},Symbol.toStringTag,{value:"Module"})),ou="Scope",lu={root:["SelectorList","Raw",null],limit:["SelectorList","Raw",null]};function lr(){let e=null,t=null;this.skipSC();const n=this.tokenStart;return this.tokenType===O&&(this.next(),this.skipSC(),e=this.parseWithFallback(this.SelectorList,()=>this.Raw(!1,!0)),this.skipSC(),this.eat(b)),this.lookupNonWSType(0)===m&&(this.skipSC(),this.eatIdent("to"),this.skipSC(),this.eat(O),this.skipSC(),t=this.parseWithFallback(this.SelectorList,()=>this.Raw(!1,!0)),this.skipSC(),this.eat(b)),{type:"Scope",loc:this.getLocation(n,this.tokenStart),root:e,limit:t}}function ar(e){e.root&&(this.token(O,"("),this.node(e.root),this.token(b,")")),e.limit&&(this.token(m,"to"),this.token(O,"("),this.node(e.limit),this.token(b,")"))}const au=Object.freeze(Object.defineProperty({__proto__:null,generate:ar,name:ou,parse:lr,structure:lu},Symbol.toStringTag,{value:"Module"})),cu="Selector",hu={children:[["TypeSelector","IdSelector","ClassSelector","AttributeSelector","PseudoClassSelector","PseudoElementSelector","Combinator"]]};function cr(){const e=this.readSequence(this.scope.Selector);return this.getFirstListNode(e)===null&&this.error("Selector is expected"),{type:"Selector",loc:this.getLocationFromList(e),children:e}}function hr(e){this.children(e)}const uu=Object.freeze(Object.defineProperty({__proto__:null,generate:hr,name:cu,parse:cr,structure:hu},Symbol.toStringTag,{value:"Module"})),fu="SelectorList",du="selector",pu={children:[["Selector","Raw"]]};function ur(){const e=this.createList();for(;!this.eof;){if(e.push(this.Selector()),this.tokenType===ut){this.next();continue}break}return{type:"SelectorList",loc:this.getLocationFromList(e),children:e}}function fr(e){this.children(e,()=>this.token(ut,","))}const mu=Object.freeze(Object.defineProperty({__proto__:null,generate:fr,name:fu,parse:ur,structure:pu,walkContext:du},Symbol.toStringTag,{value:"Module"})),dn=92,dr=34,gu=39;function pr(e){const t=e.length,n=e.charCodeAt(0),i=n===dr||n===gu?1:0,s=i===1&&t>1&&e.charCodeAt(t-1)===n?t-2:t-1;let r="";for(let l=i;l<=s;l++){let c=e.charCodeAt(l);if(c===dn){if(l===s){l!==t-1&&(r=e.substr(l+1));break}if(c=e.charCodeAt(++l),yt(dn,c)){const a=l-1,o=qt(e,a);l=o-1,r+=gi(e.substring(a+1,o))}else c===13&&e.charCodeAt(l+1)===10&&l++}else r+=e[l]}return r}function _u(e,t){const n=dr;let i="",s=!1;for(let r=0;r<e.length;r++){const l=e.charCodeAt(r);if(l===0){i+="�";continue}if(l<=31||l===127){i+="\\"+l.toString(16),s=!0;continue}l===n||l===dn?(i+="\\"+e.charAt(r),s=!1):(s&&(Xt(l)||Ot(l))&&(i+=" "),i+=e.charAt(r),s=!1)}return'"'+i+'"'}const yu="String",bu={value:String};function mr(){return{type:"String",loc:this.getLocation(this.tokenStart,this.tokenEnd),value:pr(this.consume(wt))}}function gr(e){this.token(wt,_u(e.value))}const ku=Object.freeze(Object.defineProperty({__proto__:null,generate:gr,name:yu,parse:mr,structure:bu},Symbol.toStringTag,{value:"Module"})),vu=33;function _r(){return this.Raw(null,!1)}const Su="StyleSheet",wu="stylesheet",Cu={children:[["Comment","CDO","CDC","Atrule","Rule","Raw"]]};function yr(){const e=this.tokenStart,t=this.createList();let n;for(;!this.eof;){switch(this.tokenType){case N:this.next();continue;case G:if(this.charCodeAt(this.tokenStart+2)!==vu){this.next();continue}n=this.Comment();break;case Se:n=this.CDO();break;case it:n=this.CDC();break;case B:n=this.parseWithFallback(this.Atrule,_r);break;default:n=this.parseWithFallback(this.Rule,_r)}t.push(n)}return{type:"StyleSheet",loc:this.getLocation(e,this.tokenStart),children:t}}function br(e){this.children(e)}const xu=Object.freeze(Object.defineProperty({__proto__:null,generate:br,name:Su,parse:yr,structure:Cu,walkContext:wu},Symbol.toStringTag,{value:"Module"})),Lu="SupportsDeclaration",Tu={declaration:"Declaration"};function kr(){const e=this.tokenStart;this.eat(O),this.skipSC();const t=this.Declaration();return this.eof||this.eat(b),{type:"SupportsDeclaration",loc:this.getLocation(e,this.tokenStart),declaration:t}}function vr(e){this.token(O,"("),this.node(e.declaration),this.token(b,")")}const Au=Object.freeze(Object.defineProperty({__proto__:null,generate:vr,name:Lu,parse:kr,structure:Tu},Symbol.toStringTag,{value:"Module"})),Eu=42,Sr=124;function pn(){this.tokenType!==m&&this.isDelim(Eu)===!1&&this.error("Identifier or asterisk is expected"),this.next()}const Pu="TypeSelector",Ou={name:String};function wr(){const e=this.tokenStart;return this.isDelim(Sr)?(this.next(),pn.call(this)):(pn.call(this),this.isDelim(Sr)&&(this.next(),pn.call(this))),{type:"TypeSelector",loc:this.getLocation(e,this.tokenStart),name:this.substrToCursor(e)}}function Cr(e){this.tokenize(e.name)}const Du=Object.freeze(Object.defineProperty({__proto__:null,generate:Cr,name:Pu,parse:wr,structure:Ou},Symbol.toStringTag,{value:"Module"})),xr=43,Lr=45,mn=63;function le(e,t){let n=0;for(let i=this.tokenStart+e;i<this.tokenEnd;i++){const s=this.charCodeAt(i);if(s===Lr&&t&&n!==0)return le.call(this,e+n+1,!1),-1;Xt(s)||this.error(t&&n!==0?"Hyphen minus"+(n<6?" or hex digit":"")+" is expected":n<6?"Hex digit is expected":"Unexpected input",i),++n>6&&this.error("Too many hex digits",i)}return this.next(),n}function Ie(e){let t=0;for(;this.isDelim(mn);)++t>e&&this.error("Too many question marks"),this.next()}function Iu(e){this.charCodeAt(this.tokenStart)!==e&&this.error((e===xr?"Plus sign":"Hyphen minus")+" is expected")}function Ru(){let e=0;switch(this.tokenType){case v:if(e=le.call(this,1,!0),this.isDelim(mn)){Ie.call(this,6-e);break}if(this.tokenType===L||this.tokenType===v){Iu.call(this,Lr),le.call(this,1,!1);break}break;case L:e=le.call(this,1,!0),e>0&&Ie.call(this,6-e);break;default:if(this.eatDelim(xr),this.tokenType===m){e=le.call(this,0,!0),e>0&&Ie.call(this,6-e);break}if(this.isDelim(mn)){this.next(),Ie.call(this,5);break}this.error("Hex digit or question mark is expected")}}const Mu="UnicodeRange",Fu={value:String};function Tr(){const e=this.tokenStart;return this.eatIdent("u"),Ru.call(this),{type:"UnicodeRange",loc:this.getLocation(e,this.tokenStart),value:this.substrToCursor(e)}}function Ar(e){this.tokenize(e.value)}const ju=Object.freeze(Object.defineProperty({__proto__:null,generate:Ar,name:Mu,parse:Tr,structure:Fu},Symbol.toStringTag,{value:"Module"})),$u=32,gn=92,zu=34,Nu=39,Hu=40,Er=41;function Wu(e){const t=e.length;let n=4,i=e.charCodeAt(t-1)===Er?t-2:t-1,s="";for(;n<i&&Ot(e.charCodeAt(n));)n++;for(;n<i&&Ot(e.charCodeAt(i));)i--;for(let r=n;r<=i;r++){let l=e.charCodeAt(r);if(l===gn){if(r===i){r!==t-1&&(s=e.substr(r+1));break}if(l=e.charCodeAt(++r),yt(gn,l)){const c=r-1,a=qt(e,c);r=a-1,s+=gi(e.substring(c+1,a))}else l===13&&e.charCodeAt(r+1)===10&&r++}else s+=e[r]}return s}function Bu(e){let t="",n=!1;for(let i=0;i<e.length;i++){const s=e.charCodeAt(i);if(s===0){t+="�";continue}if(s<=31||s===127){t+="\\"+s.toString(16),n=!0;continue}s===$u||s===gn||s===zu||s===Nu||s===Hu||s===Er?(t+="\\"+e.charAt(i),n=!1):(n&&Xt(s)&&(t+=" "),t+=e.charAt(i),n=!1)}return"url("+t+")"}const Uu="Url",Vu={value:String};function Pr(){const e=this.tokenStart;let t;switch(this.tokenType){case Y:t=Wu(this.consume(Y));break;case C:this.cmpStr(this.tokenStart,this.tokenEnd,"url(")||this.error("Function name must be `url`"),this.eat(C),this.skipSC(),t=pr(this.consume(wt)),this.skipSC(),this.eof||this.eat(b);break;default:this.error("Url or Function is expected")}return{type:"Url",loc:this.getLocation(e,this.tokenStart),value:t}}function Or(e){this.token(Y,Bu(e.value))}const Xu=Object.freeze(Object.defineProperty({__proto__:null,generate:Or,name:Uu,parse:Pr,structure:Vu},Symbol.toStringTag,{value:"Module"})),Yu="Value",qu={children:[[]]};function Dr(){const e=this.tokenStart,t=this.readSequence(this.scope.Value);return{type:"Value",loc:this.getLocation(e,this.tokenStart),children:t}}function Ir(e){this.children(e)}const Gu=Object.freeze(Object.defineProperty({__proto__:null,generate:Ir,name:Yu,parse:Dr,structure:qu},Symbol.toStringTag,{value:"Module"})),Ku=Object.freeze({type:"WhiteSpace",loc:null,value:" "}),Qu="WhiteSpace",Ju={value:String};function Rr(){return this.eat(N),Ku}function Mr(e){this.token(N,e.value)}const Zu=Object.freeze(Object.defineProperty({__proto__:null,generate:Mr,name:Qu,parse:Rr,structure:Ju},Symbol.toStringTag,{value:"Module"})),tf=Object.freeze(Object.defineProperty({__proto__:null,AnPlusB:ua,Atrule:ga,AtrulePrelude:ka,AttributeSelector:Aa,Block:Ra,Brackets:ja,CDC:Na,CDO:Ba,ClassSelector:Ya,Combinator:Za,Comment:sc,Condition:cc,Declaration:Cc,DeclarationList:Ac,Dimension:Oc,Feature:Mc,FeatureFunction:zc,FeatureRange:Uc,Function:qc,GeneralEnclosed:Qc,Hash:eh,IdSelector:lh,Identifier:sh,Layer:uh,LayerList:ph,MediaQuery:_h,MediaQueryList:kh,NestingSelector:Ch,Nth:Th,Number:Ph,Operator:Ih,Parentheses:Fh,Percentage:zh,PseudoClassSelector:Bh,PseudoElementSelector:Yh,Ratio:Kh,Raw:tu,Rule:ru,Scope:au,Selector:uu,SelectorList:mu,String:ku,StyleSheet:xu,SupportsDeclaration:Au,TypeSelector:Du,UnicodeRange:ju,Url:Xu,Value:Gu,WhiteSpace:Zu},Symbol.toStringTag,{value:"Module"})),ef={node:tf},Tt=Gl(ef),_n=["left","right","top","bottom","inset-block-start","inset-block-end","inset-inline-start","inset-inline-end","inset-block","inset-inline","inset"];function ae(e){return _n.includes(e)}const yn=["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"];function nf(e){return yn.includes(e)}const bn=["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 Fr(e){return bn.includes(e)}const jr=["justify-self","align-self","place-self"];function sf(e){return jr.includes(e)}const $r=[..._n,...yn,...bn,...jr,"position-anchor","position-area"],rf=[...bn,..._n,...yn];function zr(e){return rf.includes(e)}const of=["top","left","right","bottom","start","end","self-start","self-end","center","inside","outside"];function Nr(e){return of.includes(e)}const lf=["width","height","block","inline","self-block","self-inline"];function af(e){return lf.includes(e)}const Hr=new Set(["Atrule","Selector","Declaration"]);function cf(e){const t=new SourceMapGenerator,n={line:1,column:0},i={line:0,column:0},s={line:1,column:0},r={generated:s};let l=1,c=0,a=!1;const o=e.node;e.node=function(f){if(f.loc&&f.loc.start&&Hr.has(f.type)){const d=f.loc.start.line,p=f.loc.start.column-1;(i.line!==d||i.column!==p)&&(i.line=d,i.column=p,n.line=l,n.column=c,a&&(a=!1,(n.line!==s.line||n.column!==s.column)&&t.addMapping(r)),a=!0,t.addMapping({source:f.loc.source,original:i,generated:n}))}o.call(this,f),a&&Hr.has(f.type)&&(s.line=l,s.column=c)};const h=e.emit;e.emit=function(f,d,p){for(let g=0;g<f.length;g++)f.charCodeAt(g)===10?(l++,c=0):c++;h(f,d,p)};const u=e.result;return e.result=function(){return a&&t.addMapping(r),{css:u(),map:t}},e}const hf=43,uf=45,kn=(e,t)=>{if(e===T&&(e=t),typeof e=="string"){const n=e.charCodeAt(0);return n>127?32768:n<<8}return e},Wr=[[m,m],[m,C],[m,Y],[m,ht],[m,"-"],[m,v],[m,z],[m,L],[m,it],[m,O],[B,m],[B,C],[B,Y],[B,ht],[B,"-"],[B,v],[B,z],[B,L],[B,it],[I,m],[I,C],[I,Y],[I,ht],[I,"-"],[I,v],[I,z],[I,L],[I,it],[L,m],[L,C],[L,Y],[L,ht],[L,"-"],[L,v],[L,z],[L,L],[L,it],["#",m],["#",C],["#",Y],["#",ht],["#","-"],["#",v],["#",z],["#",L],["#",it],["-",m],["-",C],["-",Y],["-",ht],["-","-"],["-",v],["-",z],["-",L],["-",it],[v,m],[v,C],[v,Y],[v,ht],[v,v],[v,z],[v,L],[v,"%"],[v,it],["@",m],["@",C],["@",Y],["@",ht],["@","-"],["@",it],[".",v],[".",z],[".",L],["+",v],["+",z],["+",L],["/","*"]],ff=Wr.concat([[m,I],[L,I],[I,I],[B,O],[B,wt],[B,q],[z,z],[z,L],[z,C],[z,"-"],[b,m],[b,C],[b,z],[b,L],[b,I],[b,"-"]]);function Br(e){const t=new Set(e.map(([n,i])=>kn(n)<<16|kn(i)));return function(n,i,s){const r=kn(i,s),l=s.charCodeAt(0);return(l===uf&&i!==m&&i!==C&&i!==it||l===hf?t.has(n<<16|l<<8):t.has(n<<16|r))&&this.emit(" ",N,!0),r}}const df=Br(Wr),Ur=Br(ff),Vr=Object.freeze(Object.defineProperty({__proto__:null,safe:Ur,spec:df},Symbol.toStringTag,{value:"Module"})),pf=92;function mf(e,t){if(typeof t=="function"){let n=null;e.children.forEach(i=>{n!==null&&t.call(this,n),this.node(i),n=i});return}e.children.forEach(this.node,this)}function gf(e){Si(e,(t,n,i)=>{this.token(t,e.slice(n,i))})}function _f(e){const t=new Map;for(let[n,i]of Object.entries(e.node))typeof(i.generate||i)=="function"&&t.set(n,i.generate||i);return function(n,i){let s="",r=0,l={node(a){if(t.has(a.type))t.get(a.type).call(c,a);else throw new Error("Unknown node type: "+a.type)},tokenBefore:Ur,token(a,o){r=this.tokenBefore(r,a,o),this.emit(o,a,!1),a===T&&o.charCodeAt(0)===pf&&this.emit(`
|
|
16
|
+
`,N,!0)},emit(a){s+=a},result(){return s}};i&&(typeof i.decorator=="function"&&(l=i.decorator(l)),i.sourceMap&&(l=cf(l)),i.mode in Vr&&(l.tokenBefore=Vr[i.mode]));const c={node:a=>l.node(a),children:mf,token:(a,o)=>l.token(a,o),tokenize:gf};return l.node(n),l.result()}}const yf=Object.freeze(Object.defineProperty({__proto__:null,AnPlusB:Ci,Atrule:Ti,AtrulePrelude:Ei,AttributeSelector:Di,Block:ji,Brackets:zi,CDC:Hi,CDO:Bi,ClassSelector:Vi,Combinator:qi,Comment:Ki,Condition:Zi,Declaration:ss,DeclarationList:os,Dimension:as,Feature:hs,FeatureFunction:fs,FeatureRange:_s,Function:bs,GeneralEnclosed:vs,Hash:ws,IdSelector:Ts,Identifier:xs,Layer:Es,LayerList:Os,MediaQuery:Is,MediaQueryList:Ms,NestingSelector:js,Nth:zs,Number:Hs,Operator:Bs,Parentheses:Vs,Percentage:Ys,PseudoClassSelector:Gs,PseudoElementSelector:Qs,Ratio:er,Raw:ir,Rule:or,Scope:ar,Selector:hr,SelectorList:fr,String:gr,StyleSheet:br,SupportsDeclaration:vr,TypeSelector:Cr,UnicodeRange:Ar,Url:Or,Value:Ir,WhiteSpace:Mr},Symbol.toStringTag,{value:"Module"})),bf={node:yf},kf=_f(bf);let Kt=null;class K{static createItem(t){return{prev:null,next:null,data:t}}constructor(){this.head=null,this.tail=null,this.cursor=null}createItem(t){return K.createItem(t)}allocateCursor(t,n){let i;return Kt!==null?(i=Kt,Kt=Kt.cursor,i.prev=t,i.next=n,i.cursor=this.cursor):i={prev:t,next:n,cursor:this.cursor},this.cursor=i,i}releaseCursor(){const{cursor:t}=this;this.cursor=t.cursor,t.prev=null,t.next=null,t.cursor=Kt,Kt=t}updateCursors(t,n,i,s){let{cursor:r}=this;for(;r!==null;)r.prev===t&&(r.prev=n),r.next===i&&(r.next=s),r=r.cursor}*[Symbol.iterator](){for(let t=this.head;t!==null;t=t.next)yield t.data}get size(){let t=0;for(let n=this.head;n!==null;n=n.next)t++;return t}get isEmpty(){return this.head===null}get first(){return this.head&&this.head.data}get last(){return this.tail&&this.tail.data}fromArray(t){let n=null;this.head=null;for(let i of t){const s=K.createItem(i);n!==null?n.next=s:this.head=s,s.prev=n,n=s}return this.tail=n,this}toArray(){return[...this]}toJSON(){return[...this]}forEach(t,n=this){const i=this.allocateCursor(null,this.head);for(;i.next!==null;){const s=i.next;i.next=s.next,t.call(n,s.data,s,this)}this.releaseCursor()}forEachRight(t,n=this){const i=this.allocateCursor(this.tail,null);for(;i.prev!==null;){const s=i.prev;i.prev=s.prev,t.call(n,s.data,s,this)}this.releaseCursor()}reduce(t,n,i=this){let s=this.allocateCursor(null,this.head),r=n,l;for(;s.next!==null;)l=s.next,s.next=l.next,r=t.call(i,r,l.data,l,this);return this.releaseCursor(),r}reduceRight(t,n,i=this){let s=this.allocateCursor(this.tail,null),r=n,l;for(;s.prev!==null;)l=s.prev,s.prev=l.prev,r=t.call(i,r,l.data,l,this);return this.releaseCursor(),r}some(t,n=this){for(let i=this.head;i!==null;i=i.next)if(t.call(n,i.data,i,this))return!0;return!1}map(t,n=this){const i=new K;for(let s=this.head;s!==null;s=s.next)i.appendData(t.call(n,s.data,s,this));return i}filter(t,n=this){const i=new K;for(let s=this.head;s!==null;s=s.next)t.call(n,s.data,s,this)&&i.appendData(s.data);return i}nextUntil(t,n,i=this){if(t===null)return;const s=this.allocateCursor(null,t);for(;s.next!==null;){const r=s.next;if(s.next=r.next,n.call(i,r.data,r,this))break}this.releaseCursor()}prevUntil(t,n,i=this){if(t===null)return;const s=this.allocateCursor(t,null);for(;s.prev!==null;){const r=s.prev;if(s.prev=r.prev,n.call(i,r.data,r,this))break}this.releaseCursor()}clear(){this.head=null,this.tail=null}copy(){const t=new K;for(let n of this)t.appendData(n);return t}prepend(t){return this.updateCursors(null,t,this.head,t),this.head!==null?(this.head.prev=t,t.next=this.head):this.tail=t,this.head=t,this}prependData(t){return this.prepend(K.createItem(t))}append(t){return this.insert(t)}appendData(t){return this.insert(K.createItem(t))}insert(t,n=null){if(n!==null)if(this.updateCursors(n.prev,t,n,t),n.prev===null){if(this.head!==n)throw new Error("before doesn't belong to list");this.head=t,n.prev=t,t.next=n,this.updateCursors(null,t)}else n.prev.next=t,t.prev=n.prev,n.prev=t,t.next=n;else this.updateCursors(this.tail,t,null,t),this.tail!==null?(this.tail.next=t,t.prev=this.tail):this.head=t,this.tail=t;return this}insertData(t,n){return this.insert(K.createItem(t),n)}remove(t){if(this.updateCursors(t,t.prev,t,t.next),t.prev!==null)t.prev.next=t.next;else{if(this.head!==t)throw new Error("item doesn't belong to list");this.head=t.next}if(t.next!==null)t.next.prev=t.prev;else{if(this.tail!==t)throw new Error("item doesn't belong to list");this.tail=t.prev}return t.prev=null,t.next=null,t}push(t){this.insert(K.createItem(t))}pop(){return this.tail!==null?this.remove(this.tail):null}unshift(t){this.prepend(K.createItem(t))}shift(){return this.head!==null?this.remove(this.head):null}prependList(t){return this.insertList(t,this.head)}appendList(t){return this.insertList(t)}insertList(t,n){return t.head===null?this:(n!=null?(this.updateCursors(n.prev,t.tail,n,t.head),n.prev!==null?(n.prev.next=t.head,t.head.prev=n.prev):this.head=t.head,n.prev=t.tail,t.tail.next=n):(this.updateCursors(this.tail,t.tail,null,t.head),this.tail!==null?(this.tail.next=t.head,t.head.prev=this.tail):this.head=t.head,this.tail=t.tail),t.head=null,t.tail=null,this)}replace(t,n){"head"in n?this.insertList(n,t):this.insert(n,t),this.remove(t)}}function vf(e,t){const n=Object.create(SyntaxError.prototype),i=new Error;return Object.assign(n,{name:e,message:t,get stack(){return(i.stack||"").replace(/^(.+\n){1,3}/,`${e}: ${t}
|
|
17
|
+
`)}})}const vn=100,Xr=60,Yr=" ";function qr({source:e,line:t,column:n,baseLine:i,baseColumn:s},r){function l(p,g){return o.slice(p,g).map((y,_)=>String(p+_+1).padStart(f)+" |"+y).join(`
|
|
18
18
|
`)}const c=`
|
|
19
|
-
`.repeat(Math.max(i-1,0)),a=" ".repeat(Math.max(s-1,0)),o=(c+a+e).split(/\r\n?|\n|\f/),h=Math.max(1,t-r)-1,u=Math.min(t+r,o.length+1),f=Math.max(4,String(u).length)+1;let d=0;n+=(
|
|
20
|
-
`).replace(/^(\s+\d+\s+\|\n)+/,"").replace(/\n(\s+\d+\s+\|)+$/,"")}function
|
|
21
|
-
`+Vr({source:t,line:i,column:s,baseLine:r,baseColumn:l},2)}})}function yf(e){const t=this.createList();let n=!1;const i={recognizer:e};for(;!this.eof;){switch(this.tokenType){case G:this.next();continue;case N:n=!0,this.next();continue}let s=e.getNode.call(this,i);if(s===void 0)break;n&&(e.onWhiteSpace&&e.onWhiteSpace.call(this,s,t,i),n=!1),t.push(s)}return n&&e.onWhiteSpace&&e.onWhiteSpace.call(this,null,t,i),t}const Yr=()=>{},bf=33,kf=35,Sn=59,qr=123,Gr=0;function vf(e){return function(){return this[e]()}}function wn(e){const t=Object.create(null);for(const n of Object.keys(e)){const i=e[n],s=i.parse||i;s&&(t[n]=s)}return t}function Sf(e){const t={context:Object.create(null),features:Object.assign(Object.create(null),e.features),scope:Object.assign(Object.create(null),e.scope),atrule:wn(e.atrule),pseudo:wn(e.pseudo),node:wn(e.node)};for(const[n,i]of Object.entries(e.parseContext))switch(typeof i){case"function":t.context[n]=i;break;case"string":t.context[n]=vf(i);break}return U(U({config:t},t),t.node)}function wf(e){let t="",n="<unknown>",i=!1,s=Yr,r=!1;const l=new na,c=Object.assign(new ia,Sf(e||{}),{parseAtrulePrelude:!0,parseRulePrelude:!0,parseValue:!0,parseCustomProperty:!1,readSequence:yf,consumeUntilBalanceEnd:()=>0,consumeUntilLeftCurlyBracket(a){return a===qr?1:0},consumeUntilLeftCurlyBracketOrSemicolon(a){return a===qr||a===Sn?1:0},consumeUntilExclamationMarkOrSemicolon(a){return a===bf||a===Sn?1:0},consumeUntilSemicolonIncluded(a){return a===Sn?2:0},createList(){return new K},createSingleNodeList(a){return new K().appendData(a)},getFirstListNode(a){return a&&a.first},getLastListNode(a){return a&&a.last},parseWithFallback(a,o){const h=this.tokenIndex;try{return a.call(this)}catch(u){if(r)throw u;this.skip(h-this.tokenIndex);const f=o.call(this);return r=!0,s(u,f),r=!1,f}},lookupNonWSType(a){let o;do if(o=this.lookupType(a++),o!==N&&o!==G)return o;while(o!==Gr);return Gr},charCodeAt(a){return a>=0&&a<t.length?t.charCodeAt(a):0},substring(a,o){return t.substring(a,o)},substrToCursor(a){return this.source.substring(a,this.tokenStart)},cmpChar(a,o){return ui(t,a,o)},cmpStr(a,o,h){return Le(t,a,o,h)},consume(a){const o=this.tokenStart;return this.eat(a),this.substrToCursor(o)},consumeFunctionName(){const a=t.substring(this.tokenStart,this.tokenEnd-1);return this.eat(w),a},consumeNumber(a){const o=t.substring(this.tokenStart,fi(t,this.tokenStart));return this.eat(a),o},eat(a){if(this.tokenType!==a){const o=pi[a].slice(0,-6).replace(/-/g," ").replace(/^./,f=>f.toUpperCase());let h=`${/[[\](){}]/.test(o)?`"${o}"`:o} is expected`,u=this.tokenStart;switch(a){case m:this.tokenType===w||this.tokenType===Y?(u=this.tokenEnd-1,h="Identifier is expected but function found"):h="Identifier is expected";break;case I:this.isDelim(kf)&&(this.next(),u++,h="Name is expected");break;case $:this.tokenType===k&&(u=this.tokenEnd,h="Percent sign is expected");break}this.error(h,u)}this.next()},eatIdent(a){(this.tokenType!==m||this.lookupValue(0,a)===!1)&&this.error(`Identifier "${a}" is expected`),this.next()},eatDelim(a){this.isDelim(a)||this.error(`Delim "${String.fromCharCode(a)}" is expected`),this.next()},getLocation(a,o){return i?l.getLocationRange(a,o,n):null},getLocationFromList(a){if(i){const o=this.getFirstListNode(a),h=this.getLastListNode(a);return l.getLocationRange(o!==null?o.loc.start.offset-l.startOffset:this.tokenStart,h!==null?h.loc.end.offset-l.startOffset:this.tokenStart,n)}return null},error(a,o){const h=typeof o<"u"&&o<t.length?l.getLocation(o):this.eof?l.getLocation(Zl(t,t.length-1)):l.getLocation(this.tokenStart);throw new Xr(a||"Unexpected input",t,h.offset,h.line,h.column,l.startLine,l.startColumn)}});return Object.assign(function(a,o){t=a,o=o||{},c.setSource(t,bi),l.setSource(t,o.offset,o.line,o.column),n=o.filename||"<unknown>",i=!!o.positions,s=typeof o.onParseError=="function"?o.onParseError:Yr,r=!1,c.parseAtrulePrelude="parseAtrulePrelude"in o?!!o.parseAtrulePrelude:!0,c.parseRulePrelude="parseRulePrelude"in o?!!o.parseRulePrelude:!0,c.parseValue="parseValue"in o?!!o.parseValue:!0,c.parseCustomProperty="parseCustomProperty"in o?!!o.parseCustomProperty:!1;const{context:h="default",onComment:u}=o;if(!(h in c.context))throw new Error("Unknown context `"+h+"`");typeof u=="function"&&c.forEachToken((d,p,g)=>{if(d===G){const y=c.getLocation(p,g),_=Le(t,g-2,g,"*/")?t.slice(p+2,g-2):t.slice(p+2,g);u(_,y)}});const f=c.context[h].call(c,o);return c.eof||c.error(),f},{SyntaxError:Xr,config:c.config})}const Cf=35,xf=42,Kr=43,Lf=45,Af=47,Tf=117;function Qr(e){switch(this.tokenType){case I:return this.Hash();case ut:return this.Operator();case O:return this.Parentheses(this.readSequence,e.recognizer);case Ut:return this.Brackets(this.readSequence,e.recognizer);case wt:return this.String();case x:return this.Dimension();case $:return this.Percentage();case k:return this.Number();case w:return this.cmpStr(this.tokenStart,this.tokenEnd,"url(")?this.Url():this.Function(this.readSequence,e.recognizer);case Y:return this.Url();case m:return this.cmpChar(this.tokenStart,Tf)&&this.cmpChar(this.tokenStart+1,Kr)?this.UnicodeRange():this.Identifier();case A:{const t=this.charCodeAt(this.tokenStart);if(t===Af||t===xf||t===Kr||t===Lf)return this.Operator();t===Cf&&this.error("Hex or identifier is expected",this.tokenStart+1);break}}}const Ef={getNode:Qr},Pf=35,Of=38,Df=42,If=43,Rf=47,Jr=46,Mf=62,Ff=124,jf=126;function zf(e,t){t.last!==null&&t.last.type!=="Combinator"&&e!==null&&e.type!=="Combinator"&&t.push({type:"Combinator",loc:null,name:" "})}function $f(){switch(this.tokenType){case Ut:return this.AttributeSelector();case I:return this.IdSelector();case q:return this.lookupType(1)===q?this.PseudoElementSelector():this.PseudoClassSelector();case m:return this.TypeSelector();case k:case $:return this.Percentage();case x:this.charCodeAt(this.tokenStart)===Jr&&this.error("Identifier is expected",this.tokenStart+1);break;case A:{switch(this.charCodeAt(this.tokenStart)){case If:case Mf:case jf:case Rf:return this.Combinator();case Jr:return this.ClassSelector();case Df:case Ff:return this.TypeSelector();case Pf:return this.IdSelector();case Of:return this.NestingSelector()}break}}}const Nf={onWhiteSpace:zf,getNode:$f};function Hf(){return this.createSingleNodeList(this.Raw(null,!1))}function Wf(){const e=this.createList();if(this.skipSC(),e.push(this.Identifier()),this.skipSC(),this.tokenType===ut){e.push(this.Operator());const t=this.tokenIndex,n=this.parseCustomProperty?this.Value(null):this.Raw(this.consumeUntilExclamationMarkOrSemicolon,!1);if(n.type==="Value"&&n.children.isEmpty){for(let i=t-this.tokenIndex;i<=0;i++)if(this.lookupType(i)===N){n.children.appendData({type:"WhiteSpace",loc:null,value:" "});break}}e.push(n)}return e}function Zr(e){return e!==null&&e.type==="Operator"&&(e.value[e.value.length-1]==="-"||e.value[e.value.length-1]==="+")}const Bf={getNode:Qr,onWhiteSpace(e,t){Zr(e)&&(e.value=" "+e.value),Zr(t.last)&&(t.last.value+=" ")},expression:Hf,var:Wf},Uf=Object.freeze(Object.defineProperty({__proto__:null,AtrulePrelude:Ef,Selector:Nf,Value:Bf},Symbol.toStringTag,{value:"Module"})),Vf=new Set(["none","and","not","or"]),Xf={parse:{prelude(){const e=this.createList();if(this.tokenType===m){const t=this.substring(this.tokenStart,this.tokenEnd);Vf.has(t.toLowerCase())||e.push(this.Identifier())}return e.push(this.Condition("container")),e},block(e=!1){return this.Block(e)}}},Yf={parse:{prelude:null,block(){return this.Block(!0)}}};function Cn(e,t){return this.parseWithFallback(()=>{try{return e.call(this)}finally{this.skipSC(),this.lookupNonWSType(0)!==b&&this.error()}},t||(()=>this.Raw(null,!0)))}const to={layer(){this.skipSC();const e=this.createList(),t=Cn.call(this,this.Layer);return(t.type!=="Raw"||t.value!=="")&&e.push(t),e},supports(){this.skipSC();const e=this.createList(),t=Cn.call(this,this.Declaration,()=>Cn.call(this,()=>this.Condition("supports")));return(t.type!=="Raw"||t.value!=="")&&e.push(t),e}},qf={parse:{prelude(){const e=this.createList();switch(this.tokenType){case wt:e.push(this.String());break;case Y:case w:e.push(this.Url());break;default:this.error("String or url() is expected")}return this.skipSC(),this.tokenType===m&&this.cmpStr(this.tokenStart,this.tokenEnd,"layer")?e.push(this.Identifier()):this.tokenType===w&&this.cmpStr(this.tokenStart,this.tokenEnd,"layer(")&&e.push(this.Function(null,to)),this.skipSC(),this.tokenType===w&&this.cmpStr(this.tokenStart,this.tokenEnd,"supports(")&&e.push(this.Function(null,to)),(this.lookupNonWSType(0)===m||this.lookupNonWSType(0)===O)&&e.push(this.MediaQueryList()),e},block:null}},Gf={parse:{prelude(){return this.createSingleNodeList(this.LayerList())},block(){return this.Block(!1)}}},Kf={parse:{prelude(){return this.createSingleNodeList(this.MediaQueryList())},block(e=!1){return this.Block(e)}}},Qf={parse:{prelude(){return this.createSingleNodeList(this.SelectorList())},block(){return this.Block(!0)}}},Jf={parse:{prelude(){return this.createSingleNodeList(this.SelectorList())},block(){return this.Block(!0)}}},Zf={parse:{prelude(){return this.createSingleNodeList(this.Scope())},block(e=!1){return this.Block(e)}}},td={parse:{prelude:null,block(e=!1){return this.Block(e)}}},ed={parse:{prelude(){return this.createSingleNodeList(this.Condition("supports"))},block(e=!1){return this.Block(e)}}},nd={container:Xf,"font-face":Yf,import:qf,layer:Gf,media:Kf,nest:Qf,page:Jf,scope:Zf,"starting-style":td,supports:ed};function id(){const e=this.createList();this.skipSC();t:for(;!this.eof;){switch(this.tokenType){case m:e.push(this.Identifier());break;case wt:e.push(this.String());break;case ut:e.push(this.Operator());break;case b:break t;default:this.error("Identifier, string or comma is expected")}this.skipSC()}return e}const Rt={parse(){return this.createSingleNodeList(this.SelectorList())}},xn={parse(){return this.createSingleNodeList(this.Selector())}},sd={parse(){return this.createSingleNodeList(this.Identifier())}},rd={parse:id},Re={parse(){return this.createSingleNodeList(this.Nth())}},od={dir:sd,has:Rt,lang:rd,matches:Rt,is:Rt,"-moz-any":Rt,"-webkit-any":Rt,where:Rt,not:Rt,"nth-child":Re,"nth-last-child":Re,"nth-last-of-type":Re,"nth-of-type":Re,slotted:xn,host:xn,"host-context":xn},ld=Object.freeze(Object.defineProperty({__proto__:null,AnPlusB:ki,Atrule:wi,AtrulePrelude:xi,AttributeSelector:Ti,Block:Ii,Brackets:Mi,CDC:ji,CDO:$i,ClassSelector:Hi,Combinator:Ui,Comment:Xi,Condition:Gi,Declaration:ts,DeclarationList:ns,Dimension:ss,Feature:os,FeatureFunction:as,FeatureRange:ds,Function:ms,GeneralEnclosed:_s,Hash:bs,IdSelector:ws,Identifier:vs,Layer:xs,LayerList:As,MediaQuery:Es,MediaQueryList:Os,NestingSelector:Is,Nth:Ms,Number:js,Operator:$s,Parentheses:Hs,Percentage:Bs,PseudoClassSelector:Vs,PseudoElementSelector:Ys,Ratio:Qs,Raw:Zs,Rule:nr,Scope:sr,Selector:or,SelectorList:ar,String:fr,StyleSheet:mr,SupportsDeclaration:_r,TypeSelector:kr,UnicodeRange:Cr,Url:Ar,Value:Er,WhiteSpace:Or},Symbol.toStringTag,{value:"Module"})),ad={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:Uf,atrule:nd,pseudo:od,node:ld},cd=wf(ad);function Me(e){const t={};for(const n of Object.keys(e)){let i=e[n];i&&(Array.isArray(i)||i instanceof K?i=i.map(Me):i.constructor===Object&&(i=Me(i))),t[n]=i}return t}let hd="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict",dt=(e=21)=>{let t="",n=e|0;for(;n--;)t+=hd[Math.random()*64|0];return t};const eo=dt(),ce=new Set;function Fe(e){return!!(e&&e.type==="Function"&&e.name==="anchor")}function Tt(e,t=!1){return cd(e,{parseAtrulePrelude:!1,parseCustomProperty:!0,onParseError:n=>{t&&ce.add(n)}})}function tt(e){return gf(e,{mode:"spec"})}function ud(e){return e.type==="Declaration"}function fd(e){return e.toArray().reduce((t,n)=>n.type==="Operator"&&n.value===","?(t.push([]),t):(n.type==="Identifier"&&t[t.length-1].push(n),t),[[]])}function Ln(e){return e?e.children.map(t=>{var n;let i;((n=t.children.last)==null?void 0:n.type)==="PseudoElementSelector"&&(t=Me(t),i=tt(t.children.last),t.children.pop());const s=tt(t);return{selector:s+(i??""),elementPart:s,pseudoElementPart:i}}).toArray():[]}function dd(){ce.size>0&&(console.group(`The CSS anchor positioning polyfill was not applied due to ${ce.size===1?"a CSS parse error":"CSS parse errors"}.`),ce.forEach(e=>{console.warn(e.formattedMessage)}),console.groupEnd())}function pd(){ce.clear()}const An=[...Mr,"anchor-scope","anchor-name"].reduce((e,t)=>(e[t]=`--${t}-${eo}`,e),{});function md(e,t){return ud(e)&&An[e.property]&&t?(t.children.appendData(J(U({},e),{property:An[e.property]})),{updated:!0}):{}}function gd(e){for(const t of e){let n=!1;const i=Tt(t.css,!0);At(i,{visit:"Declaration",enter(s){var r;const l=(r=this.rule)==null?void 0:r.block,{updated:c}=md(s,l);c&&(n=!0)}}),n&&(t.css=tt(i),t.changed=!0)}return e.some(t=>t.changed===!0)}var no=(e=>(e.All="all",e.None="none",e))(no||{});function ot(e,t){var n;return t=(n=An[t])!=null?n:t,(e instanceof HTMLElement?getComputedStyle(e):e.computedStyle).getPropertyValue(t).trim()}function Qt(e,t,n){return ot(e,t)===n}function _d(e,{selector:t,pseudoElementPart:n}){const i=getComputedStyle(e,n),s=document.createElement("div"),r=document.createElement("style");s.id=`fake-pseudo-element-${dt()}`;for(const c of Array.from(i)){const a=i.getPropertyValue(c);s.style.setProperty(c,a)}r.textContent+=`#${s.id}${n} { content: ${i.content}; }`,r.textContent+=`${t} { display: none !important; }`,document.head.append(r);const l=n==="::before"?"afterbegin":"beforeend";return e.insertAdjacentElement(l,s),{fakePseudoElement:s,sheet:r,computedStyle:i}}function yd(e){let t=e;for(;t;){if(Qt(t,"overflow","scroll"))return t;t=t.parentElement}return t}function bd(e){let t=yd(e);return t===document.documentElement&&(t=null),t??{scrollTop:0,scrollLeft:0}}function kd(e,t){const{elementPart:n,pseudoElementPart:i}=e,s=[];if(i&&!(i==="::before"||i==="::after"))return s;const r=he(t.roots,n);if(!i)return s.push(...r),s;for(const l of r){const{fakePseudoElement:c,sheet:a,computedStyle:o}=_d(l,e),h=c.getBoundingClientRect(),{scrollY:u,scrollX:f}=globalThis,d=bd(l);s.push({fakePseudoElement:c,computedStyle:o,removeFakePseudoElement(){c.remove(),a.remove()},contextElement:l,getBoundingClientRect(){const{scrollY:p,scrollX:g}=globalThis,{scrollTop:y,scrollLeft:_}=d;return DOMRect.fromRect({y:h.y+(u-p)+(d.scrollTop-y),x:h.x+(f-g)+(d.scrollLeft-_),width:h.width,height:h.height})}})}return s}function vd(e,t){const n=ot(e,"anchor-name");return t?n.split(",").map(i=>i.trim()).includes(t):!n}function Sd(e,t){const n=ot(e,"anchor-scope");return n===t||n==="all"}const Tn=e=>P(null,null,function*(){var t,n,i;let s=yield(t=nt.getOffsetParent)==null?void 0:t.call(nt,e);return(yield(n=nt.isElement)==null?void 0:n.call(nt,s))||(s=(yield(i=nt.getDocumentElement)==null?void 0:i.call(nt,e))||window.document.documentElement),s}),he=(e,t)=>e.flatMap(n=>[...n.querySelectorAll(t)]),io="InvalidMimeType";function wd(e){return!!((e.type==="text/css"||e.rel==="stylesheet")&&e.href)}function Cd(e){const t=new URL(e.href,document.baseURI);if(wd(e)&&t.origin===location.origin)return t}function xd(e){return P(this,null,function*(){return(yield Promise.all(e.map(t=>P(null,null,function*(){var n;if(!t.url)return t;if((n=t.el)!=null&&n.disabled)return null;try{const i=yield fetch(t.url.toString()),s=i.headers.get("content-type");if(!(s!=null&&s.startsWith("text/css"))){const l=new Error(`Error loading ${t.url}: expected content-type "text/css", got "${s}".`);throw l.name=io,l}const r=yield i.text();return J(U({},t),{css:r})}catch(i){if(i instanceof Error&&i.name===io)return console.warn(i),null;throw i}})))).filter(t=>t!==null)})}const so='[style*="anchor"]',ro='[style*="position-area"]';function Ld(e){const t=e?e.filter(i=>i instanceof HTMLElement&&(i.matches(so)||i.matches(ro))):Array.from(document.querySelectorAll([so,ro].join(","))),n=[];return t.filter(i=>i instanceof HTMLElement).forEach(i=>{const s=dt(12),r="data-has-inline-styles";i.setAttribute(r,s);const l=i.getAttribute("style"),c=`[${r}="${s}"] { ${l} }`;n.push({el:i,css:c})}),n}function Ad(e){return P(this,null,function*(){var t,n;const i=(t=e.elements)!=null?t:he(e.roots,"link, style"),s=[];i.filter(c=>c instanceof HTMLElement).forEach(c=>{if(c.tagName.toLowerCase()==="link"){const a=Cd(c);a&&s.push({el:c,url:a})}c.tagName.toLowerCase()==="style"&&s.push({el:c,css:c.innerHTML})});const r=e.excludeInlineStyles?(n=e.elements)!=null?n:[]:void 0,l=Ld(r);return yield xd([...s,...l])})}const Td="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";let oo=(e=21)=>{let t="",n=crypto.getRandomValues(new Uint8Array(e|=0));for(;e--;)t+=Td[n[e]&63];return t};const lo="--pa-cascade-property",ao="data-anchor-position-wrapper",co="data-pa-wrapper-for-",ho="POLYFILL-POSITION-AREA",Ed=["left","center","right","span-left","span-right","x-start","x-end","span-x-start","span-x-end","x-self-start","x-self-end","span-x-self-start","span-x-self-end","span-all","top","bottom","span-top","span-bottom","y-start","y-end","span-y-start","span-y-end","y-self-start","y-self-end","span-y-self-start","span-y-self-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 uo(e){return Ed.includes(e)}const fo={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"],"x-self-start":[0,1,"PhysicalSelf"],"x-self-end":[2,3,"PhysicalSelf"],"span-x-self-start":[0,2,"PhysicalSelf"],"span-x-self-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"],"y-self-start":[0,1,"PhysicalSelf"],"y-self-end":[2,3,"PhysicalSelf"],"span-y-self-start":[0,2,"PhysicalSelf"],"span-y-self-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"]},Pd=["left","center","right","span-left","span-right","x-start","x-end","span-x-start","span-x-end","x-self-start","x-self-end","span-x-self-start","span-x-self-end","span-all"],Od=["top","center","bottom","span-top","span-bottom","y-start","y-end","span-y-start","span-y-end","y-self-start","y-self-end","span-y-self-start","span-y-self-end","span-all"],Dd=["block-start","center","block-end","span-block-start","span-block-end","span-all"],Id=["inline-start","center","inline-end","span-inline-start","span-inline-end","span-all"],Rd=["self-block-start","center","self-block-end","span-self-block-start","span-self-block-end","span-all"],Md=["self-inline-start","center","self-inline-end","span-self-inline-start","span-self-inline-end","span-all"],po=["start","center","end","span-start","span-end","span-all"],mo=["self-start","center","self-end","span-self-start","span-self-end","span-all"],Fd=["block","top","bottom","y"],jd=["inline","left","right","x"];function En(e){const t=e.split("-");for(const n of t){if(Fd.includes(n))return"block";if(jd.includes(n))return"inline"}return"ambiguous"}function zd(e,t){return t[0].includes(e[0])&&t[1].includes(e[1])||t[0].includes(e[1])&&t[1].includes(e[0])}const $d=[[Pd,Od],[Dd,Id],[Rd,Md],[po,po],[mo,mo]];function Nd(e){for(const t of $d)if(zd(e,t))return!0;return!1}const go=e=>{const t=getComputedStyle(e);return{writingMode:t.writingMode,direction:t.direction}},Hd=(e,t)=>P(null,null,function*(){const n=yield Tn(e);switch(t){case"Logical":case"Physical":return go(n);case"LogicalSelf":case"PhysicalSelf":return go(e);default:return null}}),Pn=e=>e.reverse().map(t=>3-t),_o=(e,t)=>e==="Irrelevant"?t:e,Wd=(e,t)=>P(null,[e,t],function*({block:n,inline:i},s){const r=_o(n[2],i[2]),l=yield Hd(s,r),c={block:[n[0],n[1]],inline:[i[0],i[1]]};if(l){if(l.direction==="rtl"&&(c.inline=Pn(c.inline)),l.writingMode.startsWith("vertical")){const a=c.block;c.block=c.inline,c.inline=a}if(l.writingMode.startsWith("sideways")){const a=c.block;c.block=c.inline,c.inline=a,l.writingMode.endsWith("lr")&&(c.block=Pn(c.block))}l.writingMode.endsWith("rl")&&(c.inline=Pn(c.inline))}return c}),Bd=({block:e,inline:t})=>{const n=[0,"top","bottom",0],i=[0,"left","right",0];return{block:[n[e[0]],n[e[1]]],inline:[i[t[0]],i[t[1]]]}};function yo([e,t]){return e===0&&t===3?"center":e===0?"end":t===3?"start":"center"}function Ud(e){return e.type==="Declaration"&&e.property==="position-area"}function Vd(e){const t=e.value.children.toArray().map(({name:n})=>n);return t.length===1&&(En(t[0])==="ambiguous"?t.push(t[0]):t.push("span-all")),t}function Xd(e){if(!Ud(e))return;const t=Vd(e);if(!Nd(t))return;const n={};switch(En(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":En(t[1])=="block"?(n.block=t[1],n.inline=t[0]):(n.inline=t[1],n.block=t[0]);break}const i={block:fo[n.block],inline:fo[n.inline]},s=`--pa-declaration-${oo(12)}`;return{values:n,grid:i,selectorUUID:s}}function Yd(e,t){["justify-self","align-self"].forEach(n=>{t.children.appendData({type:"Declaration",property:n,value:{type:"Raw",value:`var(--pa-value-${n})`},important:!1})}),t.children.appendData({type:"Declaration",property:lo,value:{type:"Raw",value:e.selectorUUID},important:!1})}function qd(e,t){var n,i;let s;if(((n=e.parentElement)==null?void 0:n.tagName)===ho)s=e.parentElement;else{s=document.createElement(ho),s.style.display="grid",s.style.position="absolute";const r=getComputedStyle(e).pointerEvents;s.style.pointerEvents="none",e.style.pointerEvents=r,["top","left","right","bottom"].forEach(l=>{s.style.setProperty(l,`var(--pa-value-${l})`)}),(i=e.parentElement)==null||i.insertBefore(s,e),s.appendChild(e)}return s.setAttribute(`${co}${t}`,""),s}function Gd(e,t,n){return P(this,null,function*(){const i=`--pa-target-${oo(12)}`,s=yield Wd(t.grid,e),r=Bd(s),l=_o(t.grid.block[2],t.grid.inline[2]),c=["LogicalSelf","PhysicalSelf"].includes(l)?s:t.grid,a={block:yo([c.block[0],c.block[1]]),inline:yo([c.inline[0],c.inline[1]])};return{insets:r,alignments:a,targetUUID:i,targetEl:e,anchorEl:n,wrapperEl:qd(e,i),values:t.values,grid:t.grid,selectorUUID:t.selectorUUID}})}function Kd(e,t){return`
|
|
22
|
-
[${
|
|
19
|
+
`.repeat(Math.max(i-1,0)),a=" ".repeat(Math.max(s-1,0)),o=(c+a+e).split(/\r\n?|\n|\f/),h=Math.max(1,t-r)-1,u=Math.min(t+r,o.length+1),f=Math.max(4,String(u).length)+1;let d=0;n+=(Yr.length-1)*(o[t-1].substr(0,n-1).match(/\t/g)||[]).length,n>vn&&(d=n-Xr+3,n=Xr-2);for(let p=h;p<=u;p++)p>=0&&p<o.length&&(o[p]=o[p].replace(/\t/g,Yr),o[p]=(d>0&&o[p].length>d?"…":"")+o[p].substr(d,vn-2)+(o[p].length>d+vn-1?"…":""));return[l(h,t),new Array(n+f+2).join("-")+"^",l(t,u)].filter(Boolean).join(`
|
|
20
|
+
`).replace(/^(\s+\d+\s+\|\n)+/,"").replace(/\n(\s+\d+\s+\|)+$/,"")}function Gr(e,t,n,i,s,r=1,l=1){return Object.assign(vf("SyntaxError",e),{source:t,offset:n,line:i,column:s,sourceFragment(c){return qr({source:t,line:i,column:s,baseLine:r,baseColumn:l},isNaN(c)?0:c)},get formattedMessage(){return`Parse error: ${e}
|
|
21
|
+
`+qr({source:t,line:i,column:s,baseLine:r,baseColumn:l},2)}})}function Sf(e){const t=this.createList();let n=!1;const i={recognizer:e};for(;!this.eof;){switch(this.tokenType){case G:this.next();continue;case N:n=!0,this.next();continue}let s=e.getNode.call(this,i);if(s===void 0)break;n&&(e.onWhiteSpace&&e.onWhiteSpace.call(this,s,t,i),n=!1),t.push(s)}return n&&e.onWhiteSpace&&e.onWhiteSpace.call(this,null,t,i),t}const Kr=()=>{},wf=33,Cf=35,Sn=59,Qr=123,Jr=0;function xf(e){return function(){return this[e]()}}function wn(e){const t=Object.create(null);for(const n of Object.keys(e)){const i=e[n],s=i.parse||i;s&&(t[n]=s)}return t}function Lf(e){const t={context:Object.create(null),features:Object.assign(Object.create(null),e.features),scope:Object.assign(Object.create(null),e.scope),atrule:wn(e.atrule),pseudo:wn(e.pseudo),node:wn(e.node)};for(const[n,i]of Object.entries(e.parseContext))switch(typeof i){case"function":t.context[n]=i;break;case"string":t.context[n]=xf(i);break}return U(U({config:t},t),t.node)}function Tf(e){let t="",n="<unknown>",i=!1,s=Kr,r=!1;const l=new oa,c=Object.assign(new la,Lf(e||{}),{parseAtrulePrelude:!0,parseRulePrelude:!0,parseValue:!0,parseCustomProperty:!1,readSequence:Sf,consumeUntilBalanceEnd:()=>0,consumeUntilLeftCurlyBracket(a){return a===Qr?1:0},consumeUntilLeftCurlyBracketOrSemicolon(a){return a===Qr||a===Sn?1:0},consumeUntilExclamationMarkOrSemicolon(a){return a===wf||a===Sn?1:0},consumeUntilSemicolonIncluded(a){return a===Sn?2:0},createList(){return new K},createSingleNodeList(a){return new K().appendData(a)},getFirstListNode(a){return a&&a.first},getLastListNode(a){return a&&a.last},parseWithFallback(a,o){const h=this.tokenIndex;try{return a.call(this)}catch(u){if(r)throw u;this.skip(h-this.tokenIndex);const f=o.call(this);return r=!0,s(u,f),r=!1,f}},lookupNonWSType(a){let o;do if(o=this.lookupType(a++),o!==N&&o!==G)return o;while(o!==Jr);return Jr},charCodeAt(a){return a>=0&&a<t.length?t.charCodeAt(a):0},substring(a,o){return t.substring(a,o)},substrToCursor(a){return this.source.substring(a,this.tokenStart)},cmpChar(a,o){return pi(t,a,o)},cmpStr(a,o,h){return Le(t,a,o,h)},consume(a){const o=this.tokenStart;return this.eat(a),this.substrToCursor(o)},consumeFunctionName(){const a=t.substring(this.tokenStart,this.tokenEnd-1);return this.eat(C),a},consumeNumber(a){const o=t.substring(this.tokenStart,mi(t,this.tokenStart));return this.eat(a),o},eat(a){if(this.tokenType!==a){const o=_i[a].slice(0,-6).replace(/-/g," ").replace(/^./,f=>f.toUpperCase());let h=`${/[[\](){}]/.test(o)?`"${o}"`:o} is expected`,u=this.tokenStart;switch(a){case m:this.tokenType===C||this.tokenType===Y?(u=this.tokenEnd-1,h="Identifier is expected but function found"):h="Identifier is expected";break;case I:this.isDelim(Cf)&&(this.next(),u++,h="Name is expected");break;case z:this.tokenType===v&&(u=this.tokenEnd,h="Percent sign is expected");break}this.error(h,u)}this.next()},eatIdent(a){(this.tokenType!==m||this.lookupValue(0,a)===!1)&&this.error(`Identifier "${a}" is expected`),this.next()},eatDelim(a){this.isDelim(a)||this.error(`Delim "${String.fromCharCode(a)}" is expected`),this.next()},getLocation(a,o){return i?l.getLocationRange(a,o,n):null},getLocationFromList(a){if(i){const o=this.getFirstListNode(a),h=this.getLastListNode(a);return l.getLocationRange(o!==null?o.loc.start.offset-l.startOffset:this.tokenStart,h!==null?h.loc.end.offset-l.startOffset:this.tokenStart,n)}return null},error(a,o){const h=typeof o<"u"&&o<t.length?l.getLocation(o):this.eof?l.getLocation(ia(t,t.length-1)):l.getLocation(this.tokenStart);throw new Gr(a||"Unexpected input",t,h.offset,h.line,h.column,l.startLine,l.startColumn)}});return Object.assign(function(a,o){t=a,o=o||{},c.setSource(t,Si),l.setSource(t,o.offset,o.line,o.column),n=o.filename||"<unknown>",i=!!o.positions,s=typeof o.onParseError=="function"?o.onParseError:Kr,r=!1,c.parseAtrulePrelude="parseAtrulePrelude"in o?!!o.parseAtrulePrelude:!0,c.parseRulePrelude="parseRulePrelude"in o?!!o.parseRulePrelude:!0,c.parseValue="parseValue"in o?!!o.parseValue:!0,c.parseCustomProperty="parseCustomProperty"in o?!!o.parseCustomProperty:!1;const{context:h="default",onComment:u}=o;if(!(h in c.context))throw new Error("Unknown context `"+h+"`");typeof u=="function"&&c.forEachToken((d,p,g)=>{if(d===G){const y=c.getLocation(p,g),_=Le(t,g-2,g,"*/")?t.slice(p+2,g-2):t.slice(p+2,g);u(_,y)}});const f=c.context[h].call(c,o);return c.eof||c.error(),f},{SyntaxError:Gr,config:c.config})}const Af=35,Ef=42,Zr=43,Pf=45,Of=47,Df=117;function to(e){switch(this.tokenType){case I:return this.Hash();case ut:return this.Operator();case O:return this.Parentheses(this.readSequence,e.recognizer);case Ut:return this.Brackets(this.readSequence,e.recognizer);case wt:return this.String();case L:return this.Dimension();case z:return this.Percentage();case v:return this.Number();case C:return this.cmpStr(this.tokenStart,this.tokenEnd,"url(")?this.Url():this.Function(this.readSequence,e.recognizer);case Y:return this.Url();case m:return this.cmpChar(this.tokenStart,Df)&&this.cmpChar(this.tokenStart+1,Zr)?this.UnicodeRange():this.Identifier();case T:{const t=this.charCodeAt(this.tokenStart);if(t===Of||t===Ef||t===Zr||t===Pf)return this.Operator();t===Af&&this.error("Hex or identifier is expected",this.tokenStart+1);break}}}const If={getNode:to},Rf=35,Mf=38,Ff=42,jf=43,$f=47,eo=46,zf=62,Nf=124,Hf=126;function Wf(e,t){t.last!==null&&t.last.type!=="Combinator"&&e!==null&&e.type!=="Combinator"&&t.push({type:"Combinator",loc:null,name:" "})}function Bf(){switch(this.tokenType){case Ut:return this.AttributeSelector();case I:return this.IdSelector();case q:return this.lookupType(1)===q?this.PseudoElementSelector():this.PseudoClassSelector();case m:return this.TypeSelector();case v:case z:return this.Percentage();case L:this.charCodeAt(this.tokenStart)===eo&&this.error("Identifier is expected",this.tokenStart+1);break;case T:{switch(this.charCodeAt(this.tokenStart)){case jf:case zf:case Hf:case $f:return this.Combinator();case eo:return this.ClassSelector();case Ff:case Nf:return this.TypeSelector();case Rf:return this.IdSelector();case Mf:return this.NestingSelector()}break}}}const Uf={onWhiteSpace:Wf,getNode:Bf};function Vf(){return this.createSingleNodeList(this.Raw(null,!1))}function Xf(){const e=this.createList();if(this.skipSC(),e.push(this.Identifier()),this.skipSC(),this.tokenType===ut){e.push(this.Operator());const t=this.tokenIndex,n=this.parseCustomProperty?this.Value(null):this.Raw(this.consumeUntilExclamationMarkOrSemicolon,!1);if(n.type==="Value"&&n.children.isEmpty){for(let i=t-this.tokenIndex;i<=0;i++)if(this.lookupType(i)===N){n.children.appendData({type:"WhiteSpace",loc:null,value:" "});break}}e.push(n)}return e}function no(e){return e!==null&&e.type==="Operator"&&(e.value[e.value.length-1]==="-"||e.value[e.value.length-1]==="+")}const Yf={getNode:to,onWhiteSpace(e,t){no(e)&&(e.value=" "+e.value),no(t.last)&&(t.last.value+=" ")},expression:Vf,var:Xf},qf=Object.freeze(Object.defineProperty({__proto__:null,AtrulePrelude:If,Selector:Uf,Value:Yf},Symbol.toStringTag,{value:"Module"})),Gf=new Set(["none","and","not","or"]),Kf={parse:{prelude(){const e=this.createList();if(this.tokenType===m){const t=this.substring(this.tokenStart,this.tokenEnd);Gf.has(t.toLowerCase())||e.push(this.Identifier())}return e.push(this.Condition("container")),e},block(e=!1){return this.Block(e)}}},Qf={parse:{prelude:null,block(){return this.Block(!0)}}};function Cn(e,t){return this.parseWithFallback(()=>{try{return e.call(this)}finally{this.skipSC(),this.lookupNonWSType(0)!==b&&this.error()}},t||(()=>this.Raw(null,!0)))}const io={layer(){this.skipSC();const e=this.createList(),t=Cn.call(this,this.Layer);return(t.type!=="Raw"||t.value!=="")&&e.push(t),e},supports(){this.skipSC();const e=this.createList(),t=Cn.call(this,this.Declaration,()=>Cn.call(this,()=>this.Condition("supports")));return(t.type!=="Raw"||t.value!=="")&&e.push(t),e}},Jf={parse:{prelude(){const e=this.createList();switch(this.tokenType){case wt:e.push(this.String());break;case Y:case C:e.push(this.Url());break;default:this.error("String or url() is expected")}return this.skipSC(),this.tokenType===m&&this.cmpStr(this.tokenStart,this.tokenEnd,"layer")?e.push(this.Identifier()):this.tokenType===C&&this.cmpStr(this.tokenStart,this.tokenEnd,"layer(")&&e.push(this.Function(null,io)),this.skipSC(),this.tokenType===C&&this.cmpStr(this.tokenStart,this.tokenEnd,"supports(")&&e.push(this.Function(null,io)),(this.lookupNonWSType(0)===m||this.lookupNonWSType(0)===O)&&e.push(this.MediaQueryList()),e},block:null}},Zf={parse:{prelude(){return this.createSingleNodeList(this.LayerList())},block(){return this.Block(!1)}}},td={parse:{prelude(){return this.createSingleNodeList(this.MediaQueryList())},block(e=!1){return this.Block(e)}}},ed={parse:{prelude(){return this.createSingleNodeList(this.SelectorList())},block(){return this.Block(!0)}}},nd={parse:{prelude(){return this.createSingleNodeList(this.SelectorList())},block(){return this.Block(!0)}}},id={parse:{prelude(){return this.createSingleNodeList(this.Scope())},block(e=!1){return this.Block(e)}}},sd={parse:{prelude:null,block(e=!1){return this.Block(e)}}},rd={parse:{prelude(){return this.createSingleNodeList(this.Condition("supports"))},block(e=!1){return this.Block(e)}}},od={container:Kf,"font-face":Qf,import:Jf,layer:Zf,media:td,nest:ed,page:nd,scope:id,"starting-style":sd,supports:rd};function ld(){const e=this.createList();this.skipSC();t:for(;!this.eof;){switch(this.tokenType){case m:e.push(this.Identifier());break;case wt:e.push(this.String());break;case ut:e.push(this.Operator());break;case b:break t;default:this.error("Identifier, string or comma is expected")}this.skipSC()}return e}const Rt={parse(){return this.createSingleNodeList(this.SelectorList())}},xn={parse(){return this.createSingleNodeList(this.Selector())}},ad={parse(){return this.createSingleNodeList(this.Identifier())}},cd={parse:ld},Re={parse(){return this.createSingleNodeList(this.Nth())}},hd={dir:ad,has:Rt,lang:cd,matches:Rt,is:Rt,"-moz-any":Rt,"-webkit-any":Rt,where:Rt,not:Rt,"nth-child":Re,"nth-last-child":Re,"nth-last-of-type":Re,"nth-of-type":Re,slotted:xn,host:xn,"host-context":xn},ud=Object.freeze(Object.defineProperty({__proto__:null,AnPlusB:wi,Atrule:Li,AtrulePrelude:Ai,AttributeSelector:Oi,Block:Fi,Brackets:$i,CDC:Ni,CDO:Wi,ClassSelector:Ui,Combinator:Yi,Comment:Gi,Condition:Ji,Declaration:is,DeclarationList:rs,Dimension:ls,Feature:cs,FeatureFunction:us,FeatureRange:gs,Function:ys,GeneralEnclosed:ks,Hash:Ss,IdSelector:Ls,Identifier:Cs,Layer:As,LayerList:Ps,MediaQuery:Ds,MediaQueryList:Rs,NestingSelector:Fs,Nth:$s,Number:Ns,Operator:Ws,Parentheses:Us,Percentage:Xs,PseudoClassSelector:qs,PseudoElementSelector:Ks,Ratio:tr,Raw:nr,Rule:rr,Scope:lr,Selector:cr,SelectorList:ur,String:mr,StyleSheet:yr,SupportsDeclaration:kr,TypeSelector:wr,UnicodeRange:Tr,Url:Pr,Value:Dr,WhiteSpace:Rr},Symbol.toStringTag,{value:"Module"})),fd={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:qf,atrule:od,pseudo:hd,node:ud},dd=Tf(fd);function Me(e){const t={};for(const n of Object.keys(e)){let i=e[n];i&&(Array.isArray(i)||i instanceof K?i=i.map(Me):i.constructor===Object&&(i=Me(i))),t[n]=i}return t}let pd="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict",dt=(e=21)=>{let t="",n=e|0;for(;n--;)t+=pd[Math.random()*64|0];return t};const so=dt(),ce=new Set;function Fe(e){return!!(e&&e.type==="Function"&&e.name==="anchor")}function At(e,t=!1){return dd(e,{parseAtrulePrelude:!1,parseCustomProperty:!0,onParseError:n=>{t&&ce.add(n)}})}function tt(e){return kf(e,{mode:"spec"})}function md(e){return e.type==="Declaration"}function gd(e){return e.toArray().reduce((t,n)=>n.type==="Operator"&&n.value===","?(t.push([]),t):(n.type==="Identifier"&&t[t.length-1].push(n),t),[[]])}function Ln(e){return e?e.children.map(t=>{var n;let i;((n=t.children.last)==null?void 0:n.type)==="PseudoElementSelector"&&(t=Me(t),i=tt(t.children.last),t.children.pop());const s=tt(t);return{selector:s+(i??""),elementPart:s,pseudoElementPart:i}}).toArray():[]}function _d(){ce.size>0&&(console.group(`The CSS anchor positioning polyfill was not applied due to ${ce.size===1?"a CSS parse error":"CSS parse errors"}.`),ce.forEach(e=>{console.warn(e.formattedMessage)}),console.groupEnd())}function yd(){ce.clear()}const Tn=[...$r,"anchor-scope","anchor-name"].reduce((e,t)=>(e[t]=`--${t}-${so}`,e),{});function bd(e,t){return md(e)&&Tn[e.property]&&t?(t.children.appendData(J(U({},e),{property:Tn[e.property]})),{updated:!0}):{}}function kd(e){for(const t of e){let n=!1;const i=At(t.css,!0);Tt(i,{visit:"Declaration",enter(s){var r;const l=(r=this.rule)==null?void 0:r.block,{updated:c}=bd(s,l);c&&(n=!0)}}),n&&(t.css=tt(i),t.changed=!0)}return e.some(t=>t.changed===!0)}var ro=(e=>(e.All="all",e.None="none",e))(ro||{});function ot(e,t){var n;return t=(n=Tn[t])!=null?n:t,(e instanceof HTMLElement?getComputedStyle(e):e.computedStyle).getPropertyValue(t).trim()}function Qt(e,t,n){return ot(e,t)===n}function vd(e,{selector:t,pseudoElementPart:n}){const i=getComputedStyle(e,n),s=document.createElement("div"),r=document.createElement("style");s.id=`fake-pseudo-element-${dt()}`;for(const c of Array.from(i)){const a=i.getPropertyValue(c);s.style.setProperty(c,a)}r.textContent+=`#${s.id}${n} { content: ${i.content}; }`,r.textContent+=`${t} { display: none !important; }`,document.head.append(r);const l=n==="::before"?"afterbegin":"beforeend";return e.insertAdjacentElement(l,s),{fakePseudoElement:s,sheet:r,computedStyle:i}}function Sd(e){let t=e;for(;t;){if(Qt(t,"overflow","scroll"))return t;t=t.parentElement}return t}function wd(e){let t=Sd(e);return t===document.documentElement&&(t=null),t??{scrollTop:0,scrollLeft:0}}function Cd(e,t){const{elementPart:n,pseudoElementPart:i}=e,s=[];if(i&&!(i==="::before"||i==="::after"))return s;const r=he(t.roots,n);if(!i)return s.push(...r),s;for(const l of r){const{fakePseudoElement:c,sheet:a,computedStyle:o}=vd(l,e),h=c.getBoundingClientRect(),{scrollY:u,scrollX:f}=globalThis,d=wd(l);s.push({fakePseudoElement:c,computedStyle:o,removeFakePseudoElement(){c.remove(),a.remove()},contextElement:l,getBoundingClientRect(){const{scrollY:p,scrollX:g}=globalThis,{scrollTop:y,scrollLeft:_}=d;return DOMRect.fromRect({y:h.y+(u-p)+(d.scrollTop-y),x:h.x+(f-g)+(d.scrollLeft-_),width:h.width,height:h.height})}})}return s}function xd(e,t){const n=ot(e,"anchor-name");return t?n.split(",").map(i=>i.trim()).includes(t):!n}function Ld(e,t){const n=ot(e,"anchor-scope");return n===t||n==="all"}const An=e=>P(null,null,function*(){var t,n,i;let s=yield(t=nt.getOffsetParent)==null?void 0:t.call(nt,e);return(yield(n=nt.isElement)==null?void 0:n.call(nt,s))||(s=(yield(i=nt.getDocumentElement)==null?void 0:i.call(nt,e))||window.document.documentElement),s}),he=(e,t)=>e.flatMap(n=>[...n.querySelectorAll(t)]),oo="InvalidMimeType";function Td(e){return!!((e.type==="text/css"||e.rel==="stylesheet")&&e.href)}function Ad(e){const t=new URL(e.href,document.baseURI);if(Td(e)&&t.origin===location.origin)return t}function Ed(e){return P(this,null,function*(){return(yield Promise.all(e.map(t=>P(null,null,function*(){var n;if(!t.url)return t;if((n=t.el)!=null&&n.disabled)return null;try{const i=yield fetch(t.url.toString()),s=i.headers.get("content-type");if(!(s!=null&&s.startsWith("text/css"))){const l=new Error(`Error loading ${t.url}: expected content-type "text/css", got "${s}".`);throw l.name=oo,l}const r=yield i.text();return J(U({},t),{css:r})}catch(i){if(i instanceof Error&&i.name===oo)return console.warn(i),null;throw i}})))).filter(t=>t!==null)})}const lo='[style*="anchor"]',ao='[style*="position-area"]';function Pd(e){const t=e?e.filter(i=>i instanceof HTMLElement&&(i.matches(lo)||i.matches(ao))):Array.from(document.querySelectorAll([lo,ao].join(","))),n=[];return t.filter(i=>i instanceof HTMLElement).forEach(i=>{const s=dt(12),r="data-has-inline-styles";i.setAttribute(r,s);const l=i.getAttribute("style"),c=`[${r}="${s}"] { ${l} }`;n.push({el:i,css:c})}),n}function Od(e){return P(this,null,function*(){var t,n;const i=(t=e.elements)!=null?t:he(e.roots,"link, style"),s=[];i.filter(c=>c instanceof HTMLElement).forEach(c=>{if(c.tagName.toLowerCase()==="link"){const a=Ad(c);a&&s.push({el:c,url:a})}c.tagName.toLowerCase()==="style"&&s.push({el:c,css:c.innerHTML})});const r=e.excludeInlineStyles?(n=e.elements)!=null?n:[]:void 0,l=Pd(r);return yield Ed([...s,...l])})}const Dd="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";let co=(e=21)=>{let t="",n=crypto.getRandomValues(new Uint8Array(e|=0));for(;e--;)t+=Dd[n[e]&63];return t};const ho="--pa-cascade-property",uo="data-anchor-position-wrapper",fo="data-pa-wrapper-for-",po="POLYFILL-POSITION-AREA",Id=["left","center","right","span-left","span-right","x-start","x-end","span-x-start","span-x-end","x-self-start","x-self-end","span-x-self-start","span-x-self-end","span-all","top","bottom","span-top","span-bottom","y-start","y-end","span-y-start","span-y-end","y-self-start","y-self-end","span-y-self-start","span-y-self-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 mo(e){return Id.includes(e)}const go={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"],"x-self-start":[0,1,"PhysicalSelf"],"x-self-end":[2,3,"PhysicalSelf"],"span-x-self-start":[0,2,"PhysicalSelf"],"span-x-self-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"],"y-self-start":[0,1,"PhysicalSelf"],"y-self-end":[2,3,"PhysicalSelf"],"span-y-self-start":[0,2,"PhysicalSelf"],"span-y-self-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"]},Rd=["left","center","right","span-left","span-right","x-start","x-end","span-x-start","span-x-end","x-self-start","x-self-end","span-x-self-start","span-x-self-end","span-all"],Md=["top","center","bottom","span-top","span-bottom","y-start","y-end","span-y-start","span-y-end","y-self-start","y-self-end","span-y-self-start","span-y-self-end","span-all"],Fd=["block-start","center","block-end","span-block-start","span-block-end","span-all"],jd=["inline-start","center","inline-end","span-inline-start","span-inline-end","span-all"],$d=["self-block-start","center","self-block-end","span-self-block-start","span-self-block-end","span-all"],zd=["self-inline-start","center","self-inline-end","span-self-inline-start","span-self-inline-end","span-all"],_o=["start","center","end","span-start","span-end","span-all"],yo=["self-start","center","self-end","span-self-start","span-self-end","span-all"],Nd=["block","top","bottom","y"],Hd=["inline","left","right","x"];function En(e){const t=e.split("-");for(const n of t){if(Nd.includes(n))return"block";if(Hd.includes(n))return"inline"}return"ambiguous"}function Wd(e,t){return t[0].includes(e[0])&&t[1].includes(e[1])||t[0].includes(e[1])&&t[1].includes(e[0])}const Bd=[[Rd,Md],[Fd,jd],[$d,zd],[_o,_o],[yo,yo]];function Ud(e){for(const t of Bd)if(Wd(e,t))return!0;return!1}const bo=e=>{const t=getComputedStyle(e);return{writingMode:t.writingMode,direction:t.direction}},Vd=(e,t)=>P(null,null,function*(){const n=yield An(e);switch(t){case"Logical":case"Physical":return bo(n);case"LogicalSelf":case"PhysicalSelf":return bo(e);default:return null}}),Pn=e=>e.reverse().map(t=>3-t),ko=(e,t)=>e==="Irrelevant"?t:e,Xd=(e,t)=>P(null,[e,t],function*({block:n,inline:i},s){const r=ko(n[2],i[2]),l=yield Vd(s,r),c={block:[n[0],n[1]],inline:[i[0],i[1]]};if(l){if(l.direction==="rtl"&&(c.inline=Pn(c.inline)),l.writingMode.startsWith("vertical")){const a=c.block;c.block=c.inline,c.inline=a}if(l.writingMode.startsWith("sideways")){const a=c.block;c.block=c.inline,c.inline=a,l.writingMode.endsWith("lr")&&(c.block=Pn(c.block))}l.writingMode.endsWith("rl")&&(c.inline=Pn(c.inline))}return c}),Yd=({block:e,inline:t})=>{const n=[0,"top","bottom",0],i=[0,"left","right",0];return{block:[n[e[0]],n[e[1]]],inline:[i[t[0]],i[t[1]]]}};function vo([e,t]){return e===0&&t===3?"center":e===0?"end":t===3?"start":"center"}function qd(e){return e.type==="Declaration"&&e.property==="position-area"}function Gd(e){const t=e.value.children.toArray().map(({name:n})=>n);return t.length===1&&(En(t[0])==="ambiguous"?t.push(t[0]):t.push("span-all")),t}function Kd(e){if(!qd(e))return;const t=Gd(e);if(!Ud(t))return;const n={};switch(En(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":En(t[1])=="block"?(n.block=t[1],n.inline=t[0]):(n.inline=t[1],n.block=t[0]);break}const i={block:go[n.block],inline:go[n.inline]},s=`--pa-declaration-${co(12)}`;return{values:n,grid:i,selectorUUID:s}}function Qd(e,t){["justify-self","align-self"].forEach(n=>{t.children.appendData({type:"Declaration",property:n,value:{type:"Raw",value:`var(--pa-value-${n})`},important:!1})}),t.children.appendData({type:"Declaration",property:ho,value:{type:"Raw",value:e.selectorUUID},important:!1})}function Jd(e,t){var n,i;let s;if(((n=e.parentElement)==null?void 0:n.tagName)===po)s=e.parentElement;else{s=document.createElement(po),s.style.display="grid",s.style.position="absolute";const r=getComputedStyle(e).pointerEvents;s.style.pointerEvents="none",e.style.pointerEvents=r,["top","left","right","bottom"].forEach(l=>{s.style.setProperty(l,`var(--pa-value-${l})`)}),(i=e.parentElement)==null||i.insertBefore(s,e),s.appendChild(e)}return s.setAttribute(`${fo}${t}`,""),s}function Zd(e,t,n){return P(this,null,function*(){const i=`--pa-target-${co(12)}`,s=yield Xd(t.grid,e),r=Yd(s),l=ko(t.grid.block[2],t.grid.inline[2]),c=["LogicalSelf","PhysicalSelf"].includes(l)?s:t.grid,a={block:vo([c.block[0],c.block[1]]),inline:vo([c.inline[0],c.inline[1]])};return{insets:r,alignments:a,targetUUID:i,targetEl:e,anchorEl:n,wrapperEl:Jd(e,i),values:t.values,grid:t.grid,selectorUUID:t.selectorUUID}})}function tp(e,t){return`
|
|
22
|
+
[${uo}="${t}"][${fo}${e}] {
|
|
23
23
|
--pa-value-top: var(${e}-top);
|
|
24
24
|
--pa-value-left: var(${e}-left);
|
|
25
25
|
--pa-value-right: var(${e}-right);
|
|
@@ -28,4 +28,4 @@
|
|
|
28
28
|
--pa-value-align-self: var(${e}-align-self);
|
|
29
29
|
}
|
|
30
30
|
`.replaceAll(`
|
|
31
|
-
`,"")}const Qd=["normal","most-width","most-height","most-block-size","most-inline-size"],Jd=["flip-block","flip-inline","flip-start"];function Zd(e){return e.type==="Declaration"}function tp(e){return e.type==="Declaration"&&e.property==="position-try-fallbacks"}function ep(e){return e.type==="Declaration"&&e.property==="position-try-order"}function np(e){return e.type==="Declaration"&&e.property==="position-try"}function ip(e){return e.type==="Atrule"&&e.name==="position-try"}function sp(e){return Jd.includes(e)}function rp(e){return Qd.includes(e)}function op(e,t){const n=document.querySelector(e);if(n){let i=ap(n);return t.forEach(s=>{i=bo(i,s)}),i}}function lp(e,t){let n=e.declarations;return t.forEach(i=>{n=bo(n,i)}),n}function ap(e){const t={};return Mr.forEach(n=>{const i=ot(e,`--${n}-${eo}`);i&&(t[n]=i)}),t}const cp={"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"}},hp={"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"}},up={"flip-block":{top:"bottom",bottom:"top",start:"end",end:"start"},"flip-inline":{left:"right",right:"left",start:"end",end:"start"},"flip-start":{}};function fp(e,t){return cp[t][e]||e}function dp(e,t){return hp[t][e]||e}function pp(e,t){if(t==="flip-start")return e;{const n=up[t];return e.split("-").map(i=>n[i]||i).join("-")}}function mp(e,t,n){if(e==="margin"){const[i,s,r,l]=t.children.toArray();n==="flip-block"?l?t.children.fromArray([r,s,i,l]):r&&t.children.fromArray([r,s,i]):n==="flip-inline"&&l&&t.children.fromArray([i,l,r,s])}else if(e==="margin-block"){const[i,s]=t.children.toArray();n==="flip-block"&&s&&t.children.fromArray([s,i])}else if(e==="margin-inline"){const[i,s]=t.children.toArray();n==="flip-inline"&&s&&t.children.fromArray([s,i])}}const gp=(e,t)=>{var n;return((n=Tt(`#id{${e}: ${t};}`).children.first)==null?void 0:n.block.children.first).value};function bo(e,t){const n={};return Object.entries(e).forEach(([i,s])=>{const r=i,l=gp(r,s),c=fp(r,t);c!==r&&(n[r]!=null||(n[r]="revert")),At(l,{visit:"Function",enter(a){Fe(a)&&a.children.forEach(o=>{ue(o)&&jr(o.name)&&(o.name=dp(o.name,t))})}}),r==="position-area"&&l.children.forEach(a=>{ue(a)&&uo(a.name)&&(a.name=pp(a.name,t))}),r.startsWith("margin")&&mp(r,l,t),n[c]=tt(l)}),n}function ko(e){const t=fd(e),n=[];return t.forEach(i=>{const s={atRules:[],tactics:[],positionAreas:[]};i.forEach(r=>{sp(r.name)?s.tactics.push(r.name):r.name.startsWith("--")?s.atRules.push(r.name):uo(r.name)&&s.positionAreas.push(r.name)}),s.positionAreas.length?n.push({positionArea:s.positionAreas[0],type:"position-area"}):s.atRules.length&&s.tactics.length?n.push({tactics:s.tactics,atRule:s.atRules[0],type:"at-rule-with-try-tactic"}):s.atRules.length?n.push({atRule:s.atRules[0],type:"at-rule"}):s.tactics.length&&n.push({tactics:s.tactics,type:"try-tactic"})}),n}function _p(e){return tp(e)&&e.value.children.first?ko(e.value.children):[]}function yp(e){if(np(e)&&e.value.children.first){const t=Me(e);let n;const i=t.value.children.first.name;i&&rp(i)&&(n=i,t.value.children.shift());const s=ko(t.value.children);return{order:n,options:s}}return{}}function bp(e){return ep(e)&&e.value.children.first?{order:e.value.children.first.name}:{}}function kp(e){const{order:t,options:n}=yp(e);if(t||n)return{order:t,options:n};const{order:i}=bp(e),s=_p(e);return i||s?{order:i,options:s}:{}}function vp(e){return ae(e.property)||Ju(e.property)||Ir(e.property)||Zu(e.property)||["position-anchor","position-area"].includes(e.property)}function Sp(e){var t,n;if(ip(e)&&(t=e.prelude)!=null&&t.value&&(n=e.block)!=null&&n.children){const i=e.prelude.value,s=e.block.children.filter(l=>Zd(l)&&vp(l)),r={uuid:`${i}-try-${dt(12)}`,declarations:Object.fromEntries(s.map(l=>[l.property,tt(l.value)]))};return{name:i,tryBlock:r}}return{}}function wp(e){const t={},n={},i={};for(const s of e){const r=Tt(s.css);At(r,{visit:"Atrule",enter(l){const{name:c,tryBlock:a}=Sp(l);c&&a&&(t[c]=a)}})}for(const s of e){let r=!1;const l=new Set,c=Tt(s.css);At(c,{visit:"Declaration",enter(a){var o;const h=(o=this.rule)==null?void 0:o.prelude,u=Ln(h);if(!u.length)return;const{order:f,options:d}=kp(a),p={};f&&(p.order=f),u.forEach(({selector:g})=>{var y;d?.forEach(_=>{var L;let C;if(_.type==="at-rule")C=_.atRule;else if(_.type==="try-tactic"){C=`${g}-${_.tactics.join("-")}`;const T=op(g,_.tactics);T&&(t[C]={uuid:`${g}-${_.tactics.join("-")}-try-${dt(12)}`,declarations:T})}else if(_.type==="at-rule-with-try-tactic"){C=`${g}-${_.atRule}-${_.tactics.join("-")}`;const T=t[_.atRule],pt=lp(T,_.tactics);pt&&(t[C]={uuid:`${g}-${_.atRule}-${_.tactics.join("-")}-try-${dt(12)}`,declarations:pt})}if(C&&t[C]){const T=`[data-anchor-polyfill="${t[C].uuid}"]`;n[T]!=null||(n[T]=[]),n[T].push(g),l.has(C)||(p.fallbacks!=null||(p.fallbacks=[]),p.fallbacks.push(t[C]),l.add(C),(L=this.stylesheet)==null||L.children.prependData({type:"Rule",prelude:{type:"Raw",value:T},block:{type:"Block",children:new K().fromArray(Object.entries(t[C].declarations).map(([pt,v])=>({type:"Declaration",important:!0,property:pt,value:{type:"Raw",value:v}})))}}),r=!0)}}),Object.keys(p).length>0&&(i[g]?(p.order&&(i[g].order=p.order),p.fallbacks&&((y=i[g]).fallbacks!=null||(y.fallbacks=[]),i[g].fallbacks.push(...p.fallbacks))):i[g]=p)})}}),r&&(s.css=tt(c),s.changed=!0)}return{fallbackTargets:n,validPositions:i}}function Cp(e,t){return!e||e===t?!1:vo(e)?e.document.contains(t):e.contains(t)}function vo(e){return!!(e&&e===e.window)}function xp(e){return Qt(e,"position","fixed")}function On(e){return!!(e&&(xp(e)||Qt(e,"position","absolute")))}function So(e,t){return e.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_FOLLOWING}function Lp(e){return P(this,null,function*(){return yield nt.getOffsetParent(e)})}function Dn(e){return P(this,null,function*(){if(!["absolute","fixed"].includes(ot(e,"position")))return yield Lp(e);let t=e.parentElement;for(;t;){if(!Qt(t,"position","static")&&Qt(t,"display","block"))return t;t=t.parentElement}return window})}function Ap(e,t,n,i){return P(this,null,function*(){const s=yield Dn(e),r=yield Dn(n);if(!(Cp(r,e)||vo(r))||s===r&&!(!On(e)||So(e,n)))return!1;if(s!==r){let l;const c=[];for(l=s;l&&l!==r&&l!==window;)c.push(l),l=yield Dn(l);const a=c[c.length-1];if(a instanceof HTMLElement&&!(!On(a)||So(a,n)))return!1}{let l=e.parentElement;for(;l;){if(Qt(l,"content-visibility","hidden"))return!1;l=l.parentElement}}return!(t&&i&&wo(e,t,i)!==wo(n,t,i))})}function wo(e,t,n){for(;!(e.matches(n)&&Sd(e,t));){if(!e.parentElement)return null;e=e.parentElement}return e}function Tp(e,t,n,i,s){return P(this,null,function*(){if(!(e instanceof HTMLElement&&n.length&&On(e)))return null;const r=n.flatMap(c=>kd(c,s)).filter(c=>vd(c,t)),l=i.map(c=>c.selector).join(",")||null;for(let c=r.length-1;c>=0;c--){const a=r[c],o="fakePseudoElement"in a;if(yield Ap(o?a.fakePseudoElement:a,t,e,l))return o&&a.removeFakePseudoElement(),a}return null})}function Ep(e){return e.type==="Declaration"&&e.property==="anchor-name"}function Pp(e){return e.type==="Declaration"&&e.property==="anchor-scope"}function In(e){return!!(e&&e.type==="Function"&&e.name==="anchor-size")}function je(e){return!!(e&&e.type==="Function"&&e.name==="var")}function ue(e){return!!(e.type==="Identifier"&&e.name)}function Op(e){return!!(e.type==="Percentage"&&e.value)}function Co(e,t){let n,i,s,r="",l=!1,c;const a=[];e.children.toArray().forEach(f=>{if(l){r=`${r}${tt(f)}`;return}if(f.type==="Operator"&&f.value===","){l=!0;return}a.push(f)});let[o,h]=a;if(h||(h=o,o=void 0),o&&(ue(o)&&o.name.startsWith("--")?n=o.name:je(o)&&o.children.first&&(c=o.children.first.name)),h)if(Fe(e)){if(ue(h)&&jr(h.name))i=h.name;else if(Op(h)){const f=Number(h.value);i=Number.isNaN(f)?void 0:f}}else In(e)&&ue(h)&&sf(h.name)&&(s=h.name);const u=`--anchor-${dt(12)}`;return Object.assign(e,{type:"Raw",value:`var(${u})`,children:null}),Reflect.deleteProperty(e,"name"),{anchorName:n,anchorSide:i,anchorSize:s,fallbackValue:r||"0px",customPropName:c,uuid:u}}function xo(e){return e.value.children.map(({name:t})=>t)}let fe={},Mt={},Ft={},de={},jt={};function Dp(){fe={},Mt={},Ft={},de={},jt={}}function Ip(e,t){var n;if((Fe(e)||In(e))&&t){if(t.property.startsWith("--")){const i=tt(t.value),s=Co(e);return de[s.uuid]=i,Ft[t.property]=[...(n=Ft[t.property])!=null?n:[],s],{changed:!0}}if(Fe(e)&&ae(t.property)||In(e)&&Fr(t.property)){const i=Co(e);return{prop:t.property,data:i,changed:!0}}}return{}}function Lo(e,t,n){return P(this,null,function*(){let i=t?.anchorName;const s=t?.customPropName;if(e&&!i){const a=ot(e,"position-anchor");a?i=a:s&&(i=ot(e,s))}const r=i?fe[i]||[]:[],l=i?Mt[no.All]||[]:[],c=i?Mt[i]||[]:[];return yield Tp(e,i||null,r,[...l,...c],{roots:n.roots})})}function Rp(e,t){return P(this,null,function*(){var n,i,s,r,l,c,a,o,h,u,f;const d={},p={};Dp();const{fallbackTargets:g,validPositions:y}=wp(e);for(const v of e){let M=!1;const H=Tt(v.css);At(H,function(E){var W,F,D,V;const R=(W=this.rule)==null?void 0:W.prelude,j=Ln(R);if(Ep(E)&&j.length)for(const z of xo(E))fe[z]!=null||(fe[z]=[]),fe[z].push(...j);if(Pp(E)&&j.length)for(const z of xo(E))Mt[z]!=null||(Mt[z]=[]),Mt[z].push(...j);const{prop:Q,data:St,changed:zt}=Ip(E,this.declaration);if(Q&&St&&j.length)for(const{selector:z}of j)d[z]=J(U({},d[z]),{[Q]:[...(D=(F=d[z])==null?void 0:F[Q])!=null?D:[],St]});let X;if(this.block&&(X=Xd(E),X)){Yd(X,this.block);for(const{selector:z}of j)p[z]=[...(V=p[z])!=null?V:[],X]}(zt||X)&&(M=!0)}),M&&(v.css=tt(H),v.changed=!0)}const _=new Set(Object.keys(Ft)),L={},C=v=>{var M,H,E,W,F;const D=[],V=new Set((H=(M=L[v])==null?void 0:M.names)!=null?H:[]);for(;V.size>0;)for(const R of V)D.push(...(E=Ft[R])!=null?E:[]),V.delete(R),(F=(W=L[R])==null?void 0:W.names)!=null&&F.length&&L[R].names.forEach(j=>V.add(j));return D};for(;_.size>0;){const v=[];for(const M of e){let H=!1;const E=Tt(M.css);At(E,{visit:"Function",enter(W){var F,D;const V=(F=this.rule)==null?void 0:F.prelude,R=this.declaration,j=R?.property;if(V?.children.isEmpty===!1&&je(W)&&R&&j&&W.children.first&&_.has(W.children.first.name)&&j.startsWith("--")){const Q=W.children.first,St=(D=Ft[Q.name])!=null?D:[],zt=C(Q.name);if(!(St.length||zt.length))return;const X=`${Q.name}-anchor-${dt(12)}`,z=tt(R.value);de[X]=z,L[j]||(L[j]={names:[],uuids:[]});const Jt=L[j];Jt.names.includes(Q.name)||Jt.names.push(Q.name),Jt.uuids.push(X),v.push(j),Q.name=X,H=!0}}}),H&&(M.css=tt(E),M.changed=!0)}_.clear(),v.forEach(M=>_.add(M))}for(const v of e){let M=!1;const H=Tt(v.css);At(H,{visit:"Function",enter(E){var W,F,D,V,R,j,Q;const St=(W=this.rule)==null?void 0:W.prelude,zt=this.declaration,X=zt?.property;if(St?.children.isEmpty===!1&&je(E)&&zt&&X&&E.children.first&&(ae(X)||Ir(X))){const z=E.children.first,Jt=(F=Ft[z.name])!=null?F:[],Mn=C(z.name);if(!(Jt.length||Mn.length))return;const Ne=`${X}-${dt(12)}`;if(Mn.length){const Zt=new Set([z.name]);for(;Zt.size>0;)for(const te of Zt){const lt=L[te];if((D=lt?.names)!=null&&D.length&&(V=lt?.uuids)!=null&&V.length)for(const ee of lt.names)for(const ne of lt.uuids)jt[ne]=J(U({},jt[ne]),{[Ne]:`${ee}-${Ne}`});Zt.delete(te),(R=lt?.names)!=null&&R.length&<.names.forEach(ee=>Zt.add(ee))}}const Gp=Ln(St);for(const Zt of[...Jt,...Mn]){const te=U({},Zt),lt=`--anchor-${dt(12)}-${X}`,ee=te.uuid;te.uuid=lt;for(const{selector:ne}of Gp)d[ne]=J(U({},d[ne]),{[X]:[...(Q=(j=d[ne])==null?void 0:j[X])!=null?Q:[],te]});jt[ee]=J(U({},jt[ee]),{[Ne]:lt})}z.name=`${z.name}-${Ne}`,M=!0}}}),M&&(v.css=tt(H),v.changed=!0)}if(Object.keys(jt).length>0)for(const v of e){let M=!1;const H=Tt(v.css);At(H,{visit:"Function",enter(E){var W,F,D,V;if(je(E)&&(F=(W=E.children.first)==null?void 0:W.name)!=null&&F.startsWith("--")&&(V=(D=this.declaration)==null?void 0:D.property)!=null&&V.startsWith("--")&&this.block){const R=E.children.first,j=jt[R.name];if(j)for(const[Q,St]of Object.entries(j))this.block.children.appendData({type:"Declaration",important:!1,property:`${this.declaration.property}-${Q}`,value:{type:"Raw",value:tt(this.declaration.value).replace(`var(${R.name})`,`var(${St})`)}}),M=!0;de[R.name]&&(this.declaration.value={type:"Raw",value:de[R.name]},M=!0)}}}),M&&(v.css=tt(H),v.changed=!0)}const T=new Map;for(const[v,M]of Object.entries(d)){let H;v.startsWith("[data-anchor-polyfill=")&&(n=g[v])!=null&&n.length?H=he(t.roots,g[v].join(",")):H=he(t.roots,v);for(const[E,W]of Object.entries(M))for(const F of W)for(const D of H){const V=yield Lo(D,F,{roots:t.roots}),R=`--anchor-${dt(12)}`;T.set(D,J(U({},(i=T.get(D))!=null?i:{}),{[F.uuid]:R})),D.setAttribute("style",`${F.uuid}: var(${R}); ${(s=D.getAttribute("style"))!=null?s:""}`),y[v]=J(U({},y[v]),{declarations:J(U({},(r=y[v])==null?void 0:r.declarations),{[E]:[...(a=(c=(l=y[v])==null?void 0:l.declarations)==null?void 0:c[E])!=null?a:[],J(U({},F),{anchorEl:V,targetEl:D,uuid:R})]})})}}const pt={el:document.createElement("link"),changed:!1,created:!0,css:""};e.push(pt);for(const[v,M]of Object.entries(p)){const H=he(t.roots,v);for(const E of H){const W=yield Lo(E,null,{roots:t.roots});for(const F of M){const D=yield Gd(E,F,W);pt.css+=Kd(D.targetUUID,F.selectorUUID),pt.changed=!0,y[v]=J(U({},y[v]),{declarations:J(U({},(o=y[v])==null?void 0:o.declarations),{"position-area":[...(f=(u=(h=y[v])==null?void 0:h.declarations)==null?void 0:u["position-area"])!=null?f:[],D]})})}}}return{rules:y,inlineStyles:T,anchorScopes:Mt}})}const Mp=["as","blocking","crossorigin","disabled","fetchpriority","href","hreflang","integrity","referrerpolicy","rel","type"];function Ao(e,t,n=!1){const i=[];for(const{el:s,css:r,changed:l,created:c=!1}of e){const a={el:s,css:r,changed:!1};if(l){if(s.tagName.toLowerCase()==="style")s.innerHTML=r;else if(s instanceof HTMLLinkElement){const o=document.createElement("style");o.textContent=r;for(const h of s.getAttributeNames())if(!h.startsWith("on")&&!Mp.includes(h)){const u=s.getAttribute(h);u!==null&&o.setAttribute(h,u)}s.hasAttribute("href")&&o.setAttribute("data-original-href",s.getAttribute("href")),c?(o.setAttribute("data-generated-by-polyfill","true"),document.head.insertAdjacentElement("beforeend",o)):(s.insertAdjacentElement("beforebegin",o),s.remove()),a.el=o}else if(s.hasAttribute("data-has-inline-styles")){const o=s.getAttribute("data-has-inline-styles");if(o){const h=`[data-has-inline-styles="${o}"]{`;let u=r.slice(h.length,-1);const f=t?.get(s);if(f)for(const[d,p]of Object.entries(f))u=`${d}: var(${p}); ${u}`;s.setAttribute("style",u)}}}n&&s.hasAttribute("data-has-inline-styles")&&s.removeAttribute("data-has-inline-styles"),i.push(a)}return i}const Fp=J(U({},nt),{_c:new Map}),jp=(e,t)=>{let n;switch(e){case"start":case"self-start":n=0;break;case"end":case"self-end":n=100;break;default:typeof e=="number"&&!Number.isNaN(e)&&(n=e)}if(n!==void 0)return t?100-n:n},zp=(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";break}return n},To=e=>{switch(e){case"top":case"bottom":return"y";case"left":case"right":return"x"}return null},$p=e=>{switch(e){case"x":return"width";case"y":return"height"}return null},Eo=e=>ot(e,"display")==="inline",Po=(e,t)=>(t==="x"?["border-left-width","border-right-width"]:["border-top-width","border-bottom-width"]).reduce((n,i)=>n+parseInt(ot(e,i),10),0)||0,ze=(e,t)=>parseInt(ot(e,`margin-${t}`),10)||0,Np=e=>({top:ze(e,"top"),right:ze(e,"right"),bottom:ze(e,"bottom"),left:ze(e,"left")}),Rn=e=>P(null,[e],function*({targetEl:t,targetProperty:n,anchorRect:i,anchorSide:s,anchorSize:r,fallback:l=null}){var c;if(!((r||s!==void 0)&&t&&i))return l;if(r){if(!Fr(n))return l;let a;switch(r){case"width":case"height":a=r;break;default:{let o=!1;const h=ot(t,"writing-mode");o=h.startsWith("vertical-")||h.startsWith("sideways-"),a=zp(r,o)}}return a?`${i[a]}px`:l}if(s!==void 0){let a,o;const h=To(n);if(!(ae(n)&&h&&(!ae(s)||h===To(s))))return l;const u=["top","left"];switch(s){case"left":case"top":a=0;break;case"right":case"bottom":a=100;break;case"center":a=50;break;case"inside":a=u.includes(n)?0:100;break;case"outside":a=u.includes(n)?100:0;break;default:if(t){const p=(yield(c=nt.isRTL)==null?void 0:c.call(nt,t))||!1;a=jp(s,p)}}const f=typeof a=="number"&&!Number.isNaN(a),d=$p(h);if(f&&d){(n==="bottom"||n==="right")&&(o=yield Tn(t));let p=i[h]+i[d]*(a/100);switch(n){case"bottom":{if(!o)break;let g=o.clientHeight;if(g===0&&Eo(o)){const y=Po(o,h);g=o.offsetHeight-y}p=g-p;break}case"right":{if(!o)break;let g=o.clientWidth;if(g===0&&Eo(o)){const y=Po(o,h);g=o.offsetWidth-y}p=g-p;break}}return`${p}px`}}return l}),Hp=e=>"wrapperEl"in e,Wp=e=>"uuid"in e;function Bp(e,t=!1){return P(this,null,function*(){const n=document.documentElement;for(const[i,s]of Object.entries(e))for(const r of s){const l=r.anchorEl,c=r.targetEl;if(l&&c)if(Hp(r)){const a=r.wrapperEl,o=(h,u,f)=>P(null,null,function*(){return h===0?"0px":yield Rn({targetEl:a,targetProperty:u,anchorRect:f,anchorSide:h})});Qe(l,a,()=>P(null,null,function*(){const h=ot(c,lo);a.setAttribute(ao,h);const u=yield nt.getElementRects({reference:l,floating:a,strategy:"absolute"}),f=r.insets,d=yield o(f.block[0],"top",u.reference),p=yield o(f.block[1],"bottom",u.reference),g=yield o(f.inline[0],"left",u.reference),y=yield o(f.inline[1],"right",u.reference);n.style.setProperty(`${r.targetUUID}-top`,d||null),n.style.setProperty(`${r.targetUUID}-left`,g||null),n.style.setProperty(`${r.targetUUID}-right`,y||null),n.style.setProperty(`${r.targetUUID}-bottom`,p||null),n.style.setProperty(`${r.targetUUID}-justify-self`,r.alignments.inline),n.style.setProperty(`${r.targetUUID}-align-self`,r.alignments.block)}),{animationFrame:t})}else Qe(l,c,()=>P(null,null,function*(){const a=yield nt.getElementRects({reference:l,floating:c,strategy:"absolute"}),o=yield Rn({targetEl:c,targetProperty:i,anchorRect:a.reference,anchorSide:r.anchorSide,anchorSize:r.anchorSize,fallback:r.fallbackValue});n.style.setProperty(r.uuid,o)}),{animationFrame:t});else if(Wp(r)){const a=yield Rn({targetProperty:i,anchorSide:r.anchorSide,anchorSize:r.anchorSize,fallback:r.fallbackValue});n.style.setProperty(r.uuid,a)}}})}function Oo(e,t){return P(this,null,function*(){const n=yield nt.getElementRects({reference:e,floating:e,strategy:"absolute"});return yield Wl({x:e.offsetLeft,y:e.offsetTop,platform:Fp,rects:n,elements:{floating:e,reference:t},strategy:"absolute"},{padding:Np(e)})})}function Up(e,t,n=!1){return P(this,null,function*(){if(!t.length)return;const i=document.querySelectorAll(e);for(const s of i){let r=!1;const l=yield Tn(s);Qe({},s,()=>P(null,null,function*(){if(r)return;r=!0,s.removeAttribute("data-anchor-polyfill");const c=yield Oo(s,l);if(Object.values(c).every(a=>a<=0)){s.removeAttribute("data-anchor-polyfill-last-successful"),r=!1;return}for(const[a,{uuid:o}]of t.entries()){s.setAttribute("data-anchor-polyfill",o);const h=yield Oo(s,l);if(Object.values(h).every(u=>u<=0)){s.setAttribute("data-anchor-polyfill-last-successful",o),r=!1;break}if(a===t.length-1){const u=s.getAttribute("data-anchor-polyfill-last-successful");u?s.setAttribute("data-anchor-polyfill",u):s.removeAttribute("data-anchor-polyfill"),r=!1;break}}}),{animationFrame:n,layoutShift:!1})}})}function Vp(e,t=!1){return P(this,null,function*(){var n,i;for(const s of Object.values(e))yield Bp((n=s.declarations)!=null?n:{},t);for(const[s,r]of Object.entries(e))yield Up(s,(i=r.fallbacks)!=null?i:[],t)})}function Xp(e={}){const t=typeof e=="boolean"?{useAnimationFrame:e}:e,n=t.useAnimationFrame===void 0?!!window.UPDATE_ANCHOR_ON_ANIMATION_FRAME:t.useAnimationFrame;return Array.isArray(t.elements)||(t.elements=void 0),(!Array.isArray(t.roots)||t.roots.length===0)&&(t.roots=[document]),Object.assign(t,{useAnimationFrame:n})}function Yp(e){return P(this,null,function*(){const t=Xp(e??window.ANCHOR_POSITIONING_POLYFILL_OPTIONS);let n=yield Ad(t),i={},s;pd();try{gd(n)&&(n=Ao(n));const r=yield Rp(n,{roots:t.roots});i=r.rules,s=r.inlineStyles}catch(r){throw dd(),r}return Object.values(i).length&&(Ao(n,s,!0),yield Vp(i,t.useAnimationFrame)),i})}const qp=Object.freeze(Object.defineProperty({__proto__:null,default:Yp},Symbol.toStringTag,{value:"Module"}));S.ActiveDescendantController=Ro,S.AnchorController=Xo,S.DragController=Ho,S.DragGestureController=Be,S.ItemsCollectionController=We,S.MutationObserverController=qo,S.NativeChildController=tl,S.NavigationIndicatorController=Go,S.RafScheduler=Ko,S.ResizeController=Wo,S.RovingTabIndexMixin=il,S.ScrollObserverController=Yo,S.TypeaheadController=Qo,S.findExtremeSnapIndex=al,S.findNearestScrollAncestor=Jo,S.findNearestSnapIndex=ol,S.findNextSnapIndex=ll,S.getDirectChild=Hn,S.getDirectChildren=Wn,S.isFocusable=Nn,S.keyInteraction=Fo,S.keyNavigation=zo,S.mouseMove=No,S.pinElementBox=Fn,S.snapToStep=sl,S.valueToPercent=rl,S.warnMissingDirectChild=Zo,Object.defineProperty(S,Symbol.toStringTag,{value:"Module"})}));
|
|
31
|
+
`,"")}const ep=["normal","most-width","most-height","most-block-size","most-inline-size"],np=["flip-block","flip-inline","flip-start"];function ip(e){return e.type==="Declaration"}function sp(e){return e.type==="Declaration"&&e.property==="position-try-fallbacks"}function rp(e){return e.type==="Declaration"&&e.property==="position-try-order"}function op(e){return e.type==="Declaration"&&e.property==="position-try"}function lp(e){return e.type==="Atrule"&&e.name==="position-try"}function ap(e){return np.includes(e)}function cp(e){return ep.includes(e)}function hp(e,t){const n=document.querySelector(e);if(n){let i=fp(n);return t.forEach(s=>{i=So(i,s)}),i}}function up(e,t){let n=e.declarations;return t.forEach(i=>{n=So(n,i)}),n}function fp(e){const t={};return $r.forEach(n=>{const i=ot(e,`--${n}-${so}`);i&&(t[n]=i)}),t}const dp={"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"}},pp={"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"}},mp={"flip-block":{top:"bottom",bottom:"top",start:"end",end:"start"},"flip-inline":{left:"right",right:"left",start:"end",end:"start"},"flip-start":{}};function gp(e,t){return dp[t][e]||e}function _p(e,t){return pp[t][e]||e}function yp(e,t){if(t==="flip-start")return e;{const n=mp[t];return e.split("-").map(i=>n[i]||i).join("-")}}function bp(e,t,n){if(e==="margin"){const[i,s,r,l]=t.children.toArray();n==="flip-block"?l?t.children.fromArray([r,s,i,l]):r&&t.children.fromArray([r,s,i]):n==="flip-inline"&&l&&t.children.fromArray([i,l,r,s])}else if(e==="margin-block"){const[i,s]=t.children.toArray();n==="flip-block"&&s&&t.children.fromArray([s,i])}else if(e==="margin-inline"){const[i,s]=t.children.toArray();n==="flip-inline"&&s&&t.children.fromArray([s,i])}}const kp=(e,t)=>{var n;return((n=At(`#id{${e}: ${t};}`).children.first)==null?void 0:n.block.children.first).value};function So(e,t){const n={};return Object.entries(e).forEach(([i,s])=>{const r=i,l=kp(r,s),c=gp(r,t);c!==r&&(n[r]!=null||(n[r]="revert")),Tt(l,{visit:"Function",enter(a){Fe(a)&&a.children.forEach(o=>{ue(o)&&Nr(o.name)&&(o.name=_p(o.name,t))})}}),r==="position-area"&&l.children.forEach(a=>{ue(a)&&mo(a.name)&&(a.name=yp(a.name,t))}),r.startsWith("margin")&&bp(r,l,t),n[c]=tt(l)}),n}function wo(e){const t=gd(e),n=[];return t.forEach(i=>{const s={atRules:[],tactics:[],positionAreas:[]};i.forEach(r=>{ap(r.name)?s.tactics.push(r.name):r.name.startsWith("--")?s.atRules.push(r.name):mo(r.name)&&s.positionAreas.push(r.name)}),s.positionAreas.length?n.push({positionArea:s.positionAreas[0],type:"position-area"}):s.atRules.length&&s.tactics.length?n.push({tactics:s.tactics,atRule:s.atRules[0],type:"at-rule-with-try-tactic"}):s.atRules.length?n.push({atRule:s.atRules[0],type:"at-rule"}):s.tactics.length&&n.push({tactics:s.tactics,type:"try-tactic"})}),n}function vp(e){return sp(e)&&e.value.children.first?wo(e.value.children):[]}function Sp(e){if(op(e)&&e.value.children.first){const t=Me(e);let n;const i=t.value.children.first.name;i&&cp(i)&&(n=i,t.value.children.shift());const s=wo(t.value.children);return{order:n,options:s}}return{}}function wp(e){return rp(e)&&e.value.children.first?{order:e.value.children.first.name}:{}}function Cp(e){const{order:t,options:n}=Sp(e);if(t||n)return{order:t,options:n};const{order:i}=wp(e),s=vp(e);return i||s?{order:i,options:s}:{}}function xp(e){return ae(e.property)||nf(e.property)||Fr(e.property)||sf(e.property)||["position-anchor","position-area"].includes(e.property)}function Lp(e){var t,n;if(lp(e)&&(t=e.prelude)!=null&&t.value&&(n=e.block)!=null&&n.children){const i=e.prelude.value,s=e.block.children.filter(l=>ip(l)&&xp(l)),r={uuid:`${i}-try-${dt(12)}`,declarations:Object.fromEntries(s.map(l=>[l.property,tt(l.value)]))};return{name:i,tryBlock:r}}return{}}function Tp(e){const t={},n={},i={};for(const s of e){const r=At(s.css);Tt(r,{visit:"Atrule",enter(l){const{name:c,tryBlock:a}=Lp(l);c&&a&&(t[c]=a)}})}for(const s of e){let r=!1;const l=new Set,c=At(s.css);Tt(c,{visit:"Declaration",enter(a){var o;const h=(o=this.rule)==null?void 0:o.prelude,u=Ln(h);if(!u.length)return;const{order:f,options:d}=Cp(a),p={};f&&(p.order=f),u.forEach(({selector:g})=>{var y;d?.forEach(_=>{var S;let x;if(_.type==="at-rule")x=_.atRule;else if(_.type==="try-tactic"){x=`${g}-${_.tactics.join("-")}`;const A=hp(g,_.tactics);A&&(t[x]={uuid:`${g}-${_.tactics.join("-")}-try-${dt(12)}`,declarations:A})}else if(_.type==="at-rule-with-try-tactic"){x=`${g}-${_.atRule}-${_.tactics.join("-")}`;const A=t[_.atRule],pt=up(A,_.tactics);pt&&(t[x]={uuid:`${g}-${_.atRule}-${_.tactics.join("-")}-try-${dt(12)}`,declarations:pt})}if(x&&t[x]){const A=`[data-anchor-polyfill="${t[x].uuid}"]`;n[A]!=null||(n[A]=[]),n[A].push(g),l.has(x)||(p.fallbacks!=null||(p.fallbacks=[]),p.fallbacks.push(t[x]),l.add(x),(S=this.stylesheet)==null||S.children.prependData({type:"Rule",prelude:{type:"Raw",value:A},block:{type:"Block",children:new K().fromArray(Object.entries(t[x].declarations).map(([pt,w])=>({type:"Declaration",important:!0,property:pt,value:{type:"Raw",value:w}})))}}),r=!0)}}),Object.keys(p).length>0&&(i[g]?(p.order&&(i[g].order=p.order),p.fallbacks&&((y=i[g]).fallbacks!=null||(y.fallbacks=[]),i[g].fallbacks.push(...p.fallbacks))):i[g]=p)})}}),r&&(s.css=tt(c),s.changed=!0)}return{fallbackTargets:n,validPositions:i}}function Ap(e,t){return!e||e===t?!1:Co(e)?e.document.contains(t):e.contains(t)}function Co(e){return!!(e&&e===e.window)}function Ep(e){return Qt(e,"position","fixed")}function On(e){return!!(e&&(Ep(e)||Qt(e,"position","absolute")))}function xo(e,t){return e.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_FOLLOWING}function Pp(e){return P(this,null,function*(){return yield nt.getOffsetParent(e)})}function Dn(e){return P(this,null,function*(){if(!["absolute","fixed"].includes(ot(e,"position")))return yield Pp(e);let t=e.parentElement;for(;t;){if(!Qt(t,"position","static")&&Qt(t,"display","block"))return t;t=t.parentElement}return window})}function Op(e,t,n,i){return P(this,null,function*(){const s=yield Dn(e),r=yield Dn(n);if(!(Ap(r,e)||Co(r))||s===r&&!(!On(e)||xo(e,n)))return!1;if(s!==r){let l;const c=[];for(l=s;l&&l!==r&&l!==window;)c.push(l),l=yield Dn(l);const a=c[c.length-1];if(a instanceof HTMLElement&&!(!On(a)||xo(a,n)))return!1}{let l=e.parentElement;for(;l;){if(Qt(l,"content-visibility","hidden"))return!1;l=l.parentElement}}return!(t&&i&&Lo(e,t,i)!==Lo(n,t,i))})}function Lo(e,t,n){for(;!(e.matches(n)&&Ld(e,t));){if(!e.parentElement)return null;e=e.parentElement}return e}function Dp(e,t,n,i,s){return P(this,null,function*(){if(!(e instanceof HTMLElement&&n.length&&On(e)))return null;const r=n.flatMap(c=>Cd(c,s)).filter(c=>xd(c,t)),l=i.map(c=>c.selector).join(",")||null;for(let c=r.length-1;c>=0;c--){const a=r[c],o="fakePseudoElement"in a;if(yield Op(o?a.fakePseudoElement:a,t,e,l))return o&&a.removeFakePseudoElement(),a}return null})}function Ip(e){return e.type==="Declaration"&&e.property==="anchor-name"}function Rp(e){return e.type==="Declaration"&&e.property==="anchor-scope"}function In(e){return!!(e&&e.type==="Function"&&e.name==="anchor-size")}function je(e){return!!(e&&e.type==="Function"&&e.name==="var")}function ue(e){return!!(e.type==="Identifier"&&e.name)}function Mp(e){return!!(e.type==="Percentage"&&e.value)}function To(e,t){let n,i,s,r="",l=!1,c;const a=[];e.children.toArray().forEach(f=>{if(l){r=`${r}${tt(f)}`;return}if(f.type==="Operator"&&f.value===","){l=!0;return}a.push(f)});let[o,h]=a;if(h||(h=o,o=void 0),o&&(ue(o)&&o.name.startsWith("--")?n=o.name:je(o)&&o.children.first&&(c=o.children.first.name)),h)if(Fe(e)){if(ue(h)&&Nr(h.name))i=h.name;else if(Mp(h)){const f=Number(h.value);i=Number.isNaN(f)?void 0:f}}else In(e)&&ue(h)&&af(h.name)&&(s=h.name);const u=`--anchor-${dt(12)}`;return Object.assign(e,{type:"Raw",value:`var(${u})`,children:null}),Reflect.deleteProperty(e,"name"),{anchorName:n,anchorSide:i,anchorSize:s,fallbackValue:r||"0px",customPropName:c,uuid:u}}function Ao(e){return e.value.children.map(({name:t})=>t)}let fe={},Mt={},Ft={},de={},jt={};function Fp(){fe={},Mt={},Ft={},de={},jt={}}function jp(e,t){var n;if((Fe(e)||In(e))&&t){if(t.property.startsWith("--")){const i=tt(t.value),s=To(e);return de[s.uuid]=i,Ft[t.property]=[...(n=Ft[t.property])!=null?n:[],s],{changed:!0}}if(Fe(e)&&ae(t.property)||In(e)&&zr(t.property)){const i=To(e);return{prop:t.property,data:i,changed:!0}}}return{}}function Eo(e,t,n){return P(this,null,function*(){let i=t?.anchorName;const s=t?.customPropName;if(e&&!i){const a=ot(e,"position-anchor");a?i=a:s&&(i=ot(e,s))}const r=i?fe[i]||[]:[],l=i?Mt[ro.All]||[]:[],c=i?Mt[i]||[]:[];return yield Dp(e,i||null,r,[...l,...c],{roots:n.roots})})}function $p(e,t){return P(this,null,function*(){var n,i,s,r,l,c,a,o,h,u,f;const d={},p={};Fp();const{fallbackTargets:g,validPositions:y}=Tp(e);for(const w of e){let M=!1;const H=At(w.css);Tt(H,function(E){var W,F,D,V;const R=(W=this.rule)==null?void 0:W.prelude,j=Ln(R);if(Ip(E)&&j.length)for(const $ of Ao(E))fe[$]!=null||(fe[$]=[]),fe[$].push(...j);if(Rp(E)&&j.length)for(const $ of Ao(E))Mt[$]!=null||(Mt[$]=[]),Mt[$].push(...j);const{prop:Q,data:St,changed:$t}=jp(E,this.declaration);if(Q&&St&&j.length)for(const{selector:$}of j)d[$]=J(U({},d[$]),{[Q]:[...(D=(F=d[$])==null?void 0:F[Q])!=null?D:[],St]});let X;if(this.block&&(X=Kd(E),X)){Qd(X,this.block);for(const{selector:$}of j)p[$]=[...(V=p[$])!=null?V:[],X]}($t||X)&&(M=!0)}),M&&(w.css=tt(H),w.changed=!0)}const _=new Set(Object.keys(Ft)),S={},x=w=>{var M,H,E,W,F;const D=[],V=new Set((H=(M=S[w])==null?void 0:M.names)!=null?H:[]);for(;V.size>0;)for(const R of V)D.push(...(E=Ft[R])!=null?E:[]),V.delete(R),(F=(W=S[R])==null?void 0:W.names)!=null&&F.length&&S[R].names.forEach(j=>V.add(j));return D};for(;_.size>0;){const w=[];for(const M of e){let H=!1;const E=At(M.css);Tt(E,{visit:"Function",enter(W){var F,D;const V=(F=this.rule)==null?void 0:F.prelude,R=this.declaration,j=R?.property;if(V?.children.isEmpty===!1&&je(W)&&R&&j&&W.children.first&&_.has(W.children.first.name)&&j.startsWith("--")){const Q=W.children.first,St=(D=Ft[Q.name])!=null?D:[],$t=x(Q.name);if(!(St.length||$t.length))return;const X=`${Q.name}-anchor-${dt(12)}`,$=tt(R.value);de[X]=$,S[j]||(S[j]={names:[],uuids:[]});const Jt=S[j];Jt.names.includes(Q.name)||Jt.names.push(Q.name),Jt.uuids.push(X),w.push(j),Q.name=X,H=!0}}}),H&&(M.css=tt(E),M.changed=!0)}_.clear(),w.forEach(M=>_.add(M))}for(const w of e){let M=!1;const H=At(w.css);Tt(H,{visit:"Function",enter(E){var W,F,D,V,R,j,Q;const St=(W=this.rule)==null?void 0:W.prelude,$t=this.declaration,X=$t?.property;if(St?.children.isEmpty===!1&&je(E)&&$t&&X&&E.children.first&&(ae(X)||Fr(X))){const $=E.children.first,Jt=(F=Ft[$.name])!=null?F:[],Mn=x($.name);if(!(Jt.length||Mn.length))return;const Ne=`${X}-${dt(12)}`;if(Mn.length){const Zt=new Set([$.name]);for(;Zt.size>0;)for(const te of Zt){const lt=S[te];if((D=lt?.names)!=null&&D.length&&(V=lt?.uuids)!=null&&V.length)for(const ee of lt.names)for(const ne of lt.uuids)jt[ne]=J(U({},jt[ne]),{[Ne]:`${ee}-${Ne}`});Zt.delete(te),(R=lt?.names)!=null&&R.length&<.names.forEach(ee=>Zt.add(ee))}}const Zp=Ln(St);for(const Zt of[...Jt,...Mn]){const te=U({},Zt),lt=`--anchor-${dt(12)}-${X}`,ee=te.uuid;te.uuid=lt;for(const{selector:ne}of Zp)d[ne]=J(U({},d[ne]),{[X]:[...(Q=(j=d[ne])==null?void 0:j[X])!=null?Q:[],te]});jt[ee]=J(U({},jt[ee]),{[Ne]:lt})}$.name=`${$.name}-${Ne}`,M=!0}}}),M&&(w.css=tt(H),w.changed=!0)}if(Object.keys(jt).length>0)for(const w of e){let M=!1;const H=At(w.css);Tt(H,{visit:"Function",enter(E){var W,F,D,V;if(je(E)&&(F=(W=E.children.first)==null?void 0:W.name)!=null&&F.startsWith("--")&&(V=(D=this.declaration)==null?void 0:D.property)!=null&&V.startsWith("--")&&this.block){const R=E.children.first,j=jt[R.name];if(j)for(const[Q,St]of Object.entries(j))this.block.children.appendData({type:"Declaration",important:!1,property:`${this.declaration.property}-${Q}`,value:{type:"Raw",value:tt(this.declaration.value).replace(`var(${R.name})`,`var(${St})`)}}),M=!0;de[R.name]&&(this.declaration.value={type:"Raw",value:de[R.name]},M=!0)}}}),M&&(w.css=tt(H),w.changed=!0)}const A=new Map;for(const[w,M]of Object.entries(d)){let H;w.startsWith("[data-anchor-polyfill=")&&(n=g[w])!=null&&n.length?H=he(t.roots,g[w].join(",")):H=he(t.roots,w);for(const[E,W]of Object.entries(M))for(const F of W)for(const D of H){const V=yield Eo(D,F,{roots:t.roots}),R=`--anchor-${dt(12)}`;A.set(D,J(U({},(i=A.get(D))!=null?i:{}),{[F.uuid]:R})),D.setAttribute("style",`${F.uuid}: var(${R}); ${(s=D.getAttribute("style"))!=null?s:""}`),y[w]=J(U({},y[w]),{declarations:J(U({},(r=y[w])==null?void 0:r.declarations),{[E]:[...(a=(c=(l=y[w])==null?void 0:l.declarations)==null?void 0:c[E])!=null?a:[],J(U({},F),{anchorEl:V,targetEl:D,uuid:R})]})})}}const pt={el:document.createElement("link"),changed:!1,created:!0,css:""};e.push(pt);for(const[w,M]of Object.entries(p)){const H=he(t.roots,w);for(const E of H){const W=yield Eo(E,null,{roots:t.roots});for(const F of M){const D=yield Zd(E,F,W);pt.css+=tp(D.targetUUID,F.selectorUUID),pt.changed=!0,y[w]=J(U({},y[w]),{declarations:J(U({},(o=y[w])==null?void 0:o.declarations),{"position-area":[...(f=(u=(h=y[w])==null?void 0:h.declarations)==null?void 0:u["position-area"])!=null?f:[],D]})})}}}return{rules:y,inlineStyles:A,anchorScopes:Mt}})}const zp=["as","blocking","crossorigin","disabled","fetchpriority","href","hreflang","integrity","referrerpolicy","rel","type"];function Po(e,t,n=!1){const i=[];for(const{el:s,css:r,changed:l,created:c=!1}of e){const a={el:s,css:r,changed:!1};if(l){if(s.tagName.toLowerCase()==="style")s.innerHTML=r;else if(s instanceof HTMLLinkElement){const o=document.createElement("style");o.textContent=r;for(const h of s.getAttributeNames())if(!h.startsWith("on")&&!zp.includes(h)){const u=s.getAttribute(h);u!==null&&o.setAttribute(h,u)}s.hasAttribute("href")&&o.setAttribute("data-original-href",s.getAttribute("href")),c?(o.setAttribute("data-generated-by-polyfill","true"),document.head.insertAdjacentElement("beforeend",o)):(s.insertAdjacentElement("beforebegin",o),s.remove()),a.el=o}else if(s.hasAttribute("data-has-inline-styles")){const o=s.getAttribute("data-has-inline-styles");if(o){const h=`[data-has-inline-styles="${o}"]{`;let u=r.slice(h.length,-1);const f=t?.get(s);if(f)for(const[d,p]of Object.entries(f))u=`${d}: var(${p}); ${u}`;s.setAttribute("style",u)}}}n&&s.hasAttribute("data-has-inline-styles")&&s.removeAttribute("data-has-inline-styles"),i.push(a)}return i}const Np=J(U({},nt),{_c:new Map}),Hp=(e,t)=>{let n;switch(e){case"start":case"self-start":n=0;break;case"end":case"self-end":n=100;break;default:typeof e=="number"&&!Number.isNaN(e)&&(n=e)}if(n!==void 0)return t?100-n:n},Wp=(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";break}return n},Oo=e=>{switch(e){case"top":case"bottom":return"y";case"left":case"right":return"x"}return null},Bp=e=>{switch(e){case"x":return"width";case"y":return"height"}return null},Do=e=>ot(e,"display")==="inline",Io=(e,t)=>(t==="x"?["border-left-width","border-right-width"]:["border-top-width","border-bottom-width"]).reduce((n,i)=>n+parseInt(ot(e,i),10),0)||0,$e=(e,t)=>parseInt(ot(e,`margin-${t}`),10)||0,Up=e=>({top:$e(e,"top"),right:$e(e,"right"),bottom:$e(e,"bottom"),left:$e(e,"left")}),Rn=e=>P(null,[e],function*({targetEl:t,targetProperty:n,anchorRect:i,anchorSide:s,anchorSize:r,fallback:l=null}){var c;if(!((r||s!==void 0)&&t&&i))return l;if(r){if(!zr(n))return l;let a;switch(r){case"width":case"height":a=r;break;default:{let o=!1;const h=ot(t,"writing-mode");o=h.startsWith("vertical-")||h.startsWith("sideways-"),a=Wp(r,o)}}return a?`${i[a]}px`:l}if(s!==void 0){let a,o;const h=Oo(n);if(!(ae(n)&&h&&(!ae(s)||h===Oo(s))))return l;const u=["top","left"];switch(s){case"left":case"top":a=0;break;case"right":case"bottom":a=100;break;case"center":a=50;break;case"inside":a=u.includes(n)?0:100;break;case"outside":a=u.includes(n)?100:0;break;default:if(t){const p=(yield(c=nt.isRTL)==null?void 0:c.call(nt,t))||!1;a=Hp(s,p)}}const f=typeof a=="number"&&!Number.isNaN(a),d=Bp(h);if(f&&d){(n==="bottom"||n==="right")&&(o=yield An(t));let p=i[h]+i[d]*(a/100);switch(n){case"bottom":{if(!o)break;let g=o.clientHeight;if(g===0&&Do(o)){const y=Io(o,h);g=o.offsetHeight-y}p=g-p;break}case"right":{if(!o)break;let g=o.clientWidth;if(g===0&&Do(o)){const y=Io(o,h);g=o.offsetWidth-y}p=g-p;break}}return`${p}px`}}return l}),Vp=e=>"wrapperEl"in e,Xp=e=>"uuid"in e;function Yp(e,t=!1){return P(this,null,function*(){const n=document.documentElement;for(const[i,s]of Object.entries(e))for(const r of s){const l=r.anchorEl,c=r.targetEl;if(l&&c)if(Vp(r)){const a=r.wrapperEl,o=(h,u,f)=>P(null,null,function*(){return h===0?"0px":yield Rn({targetEl:a,targetProperty:u,anchorRect:f,anchorSide:h})});Qe(l,a,()=>P(null,null,function*(){const h=ot(c,ho);a.setAttribute(uo,h);const u=yield nt.getElementRects({reference:l,floating:a,strategy:"absolute"}),f=r.insets,d=yield o(f.block[0],"top",u.reference),p=yield o(f.block[1],"bottom",u.reference),g=yield o(f.inline[0],"left",u.reference),y=yield o(f.inline[1],"right",u.reference);n.style.setProperty(`${r.targetUUID}-top`,d||null),n.style.setProperty(`${r.targetUUID}-left`,g||null),n.style.setProperty(`${r.targetUUID}-right`,y||null),n.style.setProperty(`${r.targetUUID}-bottom`,p||null),n.style.setProperty(`${r.targetUUID}-justify-self`,r.alignments.inline),n.style.setProperty(`${r.targetUUID}-align-self`,r.alignments.block)}),{animationFrame:t})}else Qe(l,c,()=>P(null,null,function*(){const a=yield nt.getElementRects({reference:l,floating:c,strategy:"absolute"}),o=yield Rn({targetEl:c,targetProperty:i,anchorRect:a.reference,anchorSide:r.anchorSide,anchorSize:r.anchorSize,fallback:r.fallbackValue});n.style.setProperty(r.uuid,o)}),{animationFrame:t});else if(Xp(r)){const a=yield Rn({targetProperty:i,anchorSide:r.anchorSide,anchorSize:r.anchorSize,fallback:r.fallbackValue});n.style.setProperty(r.uuid,a)}}})}function Ro(e,t){return P(this,null,function*(){const n=yield nt.getElementRects({reference:e,floating:e,strategy:"absolute"});return yield Xl({x:e.offsetLeft,y:e.offsetTop,platform:Np,rects:n,elements:{floating:e,reference:t},strategy:"absolute"},{padding:Up(e)})})}function qp(e,t,n=!1){return P(this,null,function*(){if(!t.length)return;const i=document.querySelectorAll(e);for(const s of i){let r=!1;const l=yield An(s);Qe({},s,()=>P(null,null,function*(){if(r)return;r=!0,s.removeAttribute("data-anchor-polyfill");const c=yield Ro(s,l);if(Object.values(c).every(a=>a<=0)){s.removeAttribute("data-anchor-polyfill-last-successful"),r=!1;return}for(const[a,{uuid:o}]of t.entries()){s.setAttribute("data-anchor-polyfill",o);const h=yield Ro(s,l);if(Object.values(h).every(u=>u<=0)){s.setAttribute("data-anchor-polyfill-last-successful",o),r=!1;break}if(a===t.length-1){const u=s.getAttribute("data-anchor-polyfill-last-successful");u?s.setAttribute("data-anchor-polyfill",u):s.removeAttribute("data-anchor-polyfill"),r=!1;break}}}),{animationFrame:n,layoutShift:!1})}})}function Gp(e,t=!1){return P(this,null,function*(){var n,i;for(const s of Object.values(e))yield Yp((n=s.declarations)!=null?n:{},t);for(const[s,r]of Object.entries(e))yield qp(s,(i=r.fallbacks)!=null?i:[],t)})}function Kp(e={}){const t=typeof e=="boolean"?{useAnimationFrame:e}:e,n=t.useAnimationFrame===void 0?!!window.UPDATE_ANCHOR_ON_ANIMATION_FRAME:t.useAnimationFrame;return Array.isArray(t.elements)||(t.elements=void 0),(!Array.isArray(t.roots)||t.roots.length===0)&&(t.roots=[document]),Object.assign(t,{useAnimationFrame:n})}function Qp(e){return P(this,null,function*(){const t=Kp(e??window.ANCHOR_POSITIONING_POLYFILL_OPTIONS);let n=yield Od(t),i={},s;yd();try{kd(n)&&(n=Po(n));const r=yield $p(n,{roots:t.roots});i=r.rules,s=r.inlineStyles}catch(r){throw _d(),r}return Object.values(i).length&&(Po(n,s,!0),yield Gp(i,t.useAnimationFrame)),i})}const Jp=Object.freeze(Object.defineProperty({__proto__:null,default:Qp},Symbol.toStringTag,{value:"Module"}));k.ActiveDescendantController=jo,k.AnchorController=Ko,k.ClickDelegateController=$o,k.DEFAULT_INTERACTIVE_SELECTOR=Fn,k.DragController=Vo,k.DragGestureController=Be,k.ItemsCollectionController=We,k.MutationObserverController=Jo,k.NativeChildController=sl,k.NavigationIndicatorController=Zo,k.RafScheduler=tl,k.ResizeController=Xo,k.RovingTabIndexMixin=ll,k.ScrollObserverController=Qo,k.TypeaheadController=el,k.delegateClickTo=$n,k.findExtremeSnapIndex=fl,k.findNearestScrollAncestor=nl,k.findNearestSnapIndex=hl,k.findNextSnapIndex=ul,k.getDirectChild=Un,k.getDirectChildren=Vn,k.isEventFromInteractiveDescendant=jn,k.isFocusable=Bn,k.keyInteraction=No,k.keyNavigation=Wo,k.mouseMove=Uo,k.pinElementBox=zn,k.snapToStep=al,k.valueToPercent=cl,k.warnMissingDirectChild=il,Object.defineProperty(k,Symbol.toStringTag,{value:"Module"})}));
|