@rcarls/rc-common 0.4.2 → 0.5.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 +15 -0
- package/dist/rc-common.js +135 -98
- package/dist/rc-common.umd.cjs +9 -9
- package/dist/types/ItemsCollectionController.d.ts +19 -0
- package/dist/types/KeyboardNavigationDirective.d.ts +4 -6
- package/package.json +1 -1
- /package/dist/types/{snapUtils.test.d.ts → snapUtils.unit.test.d.ts} +0 -0
package/dist/rc-common.umd.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(function(v,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):(v=typeof globalThis<"u"?globalThis:v||self,Et(v["rc-common"]={},v.lit,v.directive_js,v.asyncDirective_js,v.decorators_js))})(this,(function(v,Et,Ne,$t,Po){"use strict";let Oo=0;class Do{constructor(t,n){this._activeItem=null,this._activeIndex=-1,this._itemCounter=0,this._opts=n,this._instanceId=`rc-adc-${++Oo}`,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"})}}}class Io{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._onPointerDown=i=>{const s=i.target;if(!s)return;const r=s.closest("li[data-value]");if(!r||r.getAttribute("role")!=="option"||r.parentElement!==this._ul)return;i.preventDefault(),i.stopPropagation();const l=this.optionForElement(r);l&&this._onActivate(l)},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._optionsInitialized||this._bootstrapFromDom()}hostDisconnected(){this._host.removeEventListener("pointerdown",this._onPointerDown)}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)}}class Ro 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!==Ne.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 Mo=$t.directive(Ro);class Fo extends $t.AsyncDirective{constructor(t){if(super(t),this._options={},t.type!==Ne.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),typeof i=="boolean"?this._options={}:this._options={...i}}disconnected(){const t=this._element?.deref();t!=null&&t instanceof HTMLElement&&t.removeEventListener("keydown",this._keyDownHandle)}reconnected(){this._init()}}const jo=$t.directive(Fo);class zo extends $t.AsyncDirective{constructor(t){if(super(t),this._activePointerId=null,t.type!==Ne.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 $o=$t.directive(zo);class We{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 No{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 We(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 Rn(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 We(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 Rn(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 Mn={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"},Ho={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"},Fn=CSS.supports("position-try-fallbacks: flip-block")&&CSS.supports("min-width: anchor-size(width)");let jn=null,He=null;function Bo(){return Fn?Promise.resolve(null):(He||(He=Promise.resolve().then(()=>Yp).then(e=>(jn=e.default,jn)).catch(()=>null)),He)}let Uo=0;class Vo{constructor(t,n){this._styleEl=null,this._adoptedSheet=null,this._opts=n,this._uid=`rc-anchor-${++Uo}`,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(),Fn||this._applyPolyfillOrFallback()}async _applyPolyfillOrFallback(){const t=await Bo(),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=Mn[i],o=Ho[i],h=Mn[o],u=r?`
|
|
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?`
|
|
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 Xo{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 Yo{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 qo{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 Go{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 Ko{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 Qo(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 zn(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 $n(e,t){return e.querySelector(t)}function Nn(e,t){return Array.from(e.querySelectorAll(t))}function Jo(e,t){if(Nn(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 Zo{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=$n(this._host,this._options.selector);return this._child=n,n||this._options.onMissing?.(this._host),n!==t&&this._options.onChange?.(n,t),n}}var tl=Object.defineProperty,el=(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&&tl(t,n,s),s};function nl(e){class t extends e{constructor(){super(...arguments),this._items=[]}get items(){return this._items.map(i=>i.deref()).filter(i=>zn(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 el([Po.state()],t.prototype,"_lastFocused"),t}function il(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 sl(e,t,n){return n===t?0:Math.min(Math.max((e-t)/(n-t),0),1)}function rl(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 ol(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 ll(e,t){return e.length===0?-1:t>0?e.length-1:0}var al=Object.defineProperty,cl=Object.defineProperties,hl=Object.getOwnPropertyDescriptors,Wn=Object.getOwnPropertySymbols,ul=Object.prototype.hasOwnProperty,fl=Object.prototype.propertyIsEnumerable,Hn=(e,t,n)=>t in e?al(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,U=(e,t)=>{for(var n in t||(t={}))ul.call(t,n)&&Hn(e,n,t[n]);if(Wn)for(var n of Wn(t))fl.call(t,n)&&Hn(e,n,t[n]);return e},J=(e,t)=>cl(e,hl(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 Be=Math.min,Nt=Math.max,me=Math.round,ge=Math.floor,mt=e=>({x:e,y:e});function dl(e,t){return typeof e=="function"?e(t):e}function pl(e){return U({top:0,right:0,bottom:0,left:0},e)}function ml(e){return typeof e!="number"?pl(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 gl(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}=dl(t,e),p=ml(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 Wt(e){return Bn(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=(Bn(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Bn(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 Un(e){return!ye()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof et(e).ShadowRoot}const _l=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)&&!_l.has(s)}const yl=new Set(["table","td","th"]);function bl(e){return yl.has(Wt(e))}const kl=[":popover-open",":modal"];function be(e){return kl.some(t=>{try{return e.matches(t)}catch{return!1}})}const Sl=["transform","translate","scale","rotate","perspective"],vl=["transform","translate","scale","rotate","perspective","filter"],wl=["paint","layout","strict","content"];function Ue(e){const t=Ve(),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)||vl.some(i=>(n.willChange||"").includes(i))||wl.some(i=>(n.contain||"").includes(i))}function Cl(e){let t=Ct(e);for(;_t(t)&&!Ht(t);){if(Ue(t))return t;if(be(t))return null;t=Ct(t)}return null}function Ve(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const xl=new Set(["html","body","#document"]);function Ht(e){return xl.has(Wt(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(Wt(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Un(e)&&e.host||gt(e);return Un(t)?t.host:t}function Vn(e){const t=Ct(e);return Ht(t)?e.ownerDocument?e.ownerDocument.body:e.body:_t(t)&&ie(t)?t:Vn(t)}function se(e,t,n){var i;t===void 0&&(t=[]),n===void 0&&(n=!0);const s=Vn(e),r=s===((i=e.ownerDocument)==null?void 0:i.body),l=et(s);if(r){const c=Xe(l);return t.concat(l,l.visualViewport||[],ie(s)?s:[],c&&n?se(c):[])}return t.concat(s,se(s,[],n))}function Xe(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Xn(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 Ye(e){return at(e)?e:e.contextElement}function Bt(e){const t=Ye(e);if(!_t(t))return mt(1);const n=t.getBoundingClientRect(),{width:i,height:s,$:r}=Xn(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 Ll=mt(0);function Yn(e){const t=et(e);return!Ve()||!t.visualViewport?Ll:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Al(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=Ye(e);let l=mt(1);t&&(i?at(i)&&(l=Bt(i)):l=Bt(e));const c=Al(r,n,i)?Yn(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=Xe(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=Xe(p)}}return _e({width:h,height:u,x:a,y:o})}function Se(e,t){const n=ke(e).scrollLeft;return t?t.left+n:Pt(gt(e)).left+n}function qn(e,t){const n=e.getBoundingClientRect(),i=n.left+t.scrollLeft-Se(e,n),s=n.top+t.scrollTop;return{x:i,y:s}}function Tl(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)&&((Wt(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?qn(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 El(e){return Array.from(e.getClientRects())}function Pl(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+Se(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 Gn=25;function Ol(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=Ve();(!h||h&&t==="fixed")&&(c=s.offsetLeft,a=s.offsetTop)}const o=Se(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<=Gn&&(r-=p)}else o<=Gn&&(r+=o);return{width:r,height:l,x:c,y:a}}const Dl=new Set(["absolute","fixed"]);function Il(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 Kn(e,t,n){let i;if(t==="viewport")i=Ol(e,n);else if(t==="document")i=Pl(gt(e));else if(at(t))i=Il(t,n);else{const s=Yn(e);i={x:t.x-s.x,y:t.y-s.y,width:t.width,height:t.height}}return _e(i)}function Qn(e,t){const n=Ct(e);return n===t||!at(n)||Ht(n)?!1:ct(n).position==="fixed"||Qn(n,t)}function Rl(e,t){const n=t.get(e);if(n)return n;let i=se(e,[],!1).filter(c=>at(c)&&Wt(c)!=="body"),s=null;const r=ct(e).position==="fixed";let l=r?Ct(e):e;for(;at(l)&&!Ht(l);){const c=ct(l),a=Ue(l);!a&&c.position==="fixed"&&(s=null),(r?!a&&!s:!a&&c.position==="static"&&s&&Dl.has(s.position)||ie(l)&&!a&&Qn(e,l))?i=i.filter(o=>o!==l):s=c,l=Ct(l)}return t.set(e,i),i}function Ml(e){let{element:t,boundary:n,rootBoundary:i,strategy:s}=e;const r=[...n==="clippingAncestors"?be(t)?[]:Rl(t,this._c):[].concat(n),i],l=r[0],c=r.reduce((a,o)=>{const h=Kn(t,o,s);return a.top=Nt(h.top,a.top),a.right=Be(h.right,a.right),a.bottom=Be(h.bottom,a.bottom),a.left=Nt(h.left,a.left),a},Kn(t,l,s));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}function Fl(e){const{width:t,height:n}=Xn(e);return{width:t,height:n}}function jl(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=Se(s)}if(i||!i&&!r)if((Wt(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?qn(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 qe(e){return ct(e).position==="static"}function Jn(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 Zn(e,t){const n=et(e);if(be(e))return n;if(!_t(e)){let s=Ct(e);for(;s&&!Ht(s);){if(at(s)&&!qe(s))return s;s=Ct(s)}return n}let i=Jn(e,t);for(;i&&bl(i)&&qe(i);)i=Jn(i,t);return i&&Ht(i)&&qe(i)&&!Ue(i)?n:i||Cl(e)||n}const zl=function(e){return P(this,null,function*(){const t=this.getOffsetParent||Zn,n=this.getDimensions,i=yield n(e.floating);return{reference:jl(e.reference,yield t(e.floating),e.strategy),floating:{x:0,y:0,width:i.width,height:i.height}}})};function $l(e){return ct(e).direction==="rtl"}const nt={convertOffsetParentRelativeRectToViewportRelativeRect:Tl,getDocumentElement:gt,getClippingRect:Ml,getOffsetParent:Zn,getElementRects:zl,getClientRects:El,getDimensions:Fl,getScale:Bt,isElement:at,isRTL:$l};function ti(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Nl(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,Be(1,a))||1};let C=!0;function T(pt){const S=pt[0].intersectionRatio;if(S!==a){if(!C)return l();S?l(!1,S):i=setTimeout(()=>{l(!1,1e-7)},1e3)}S===1&&!ti(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 Ge(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=Ye(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?Nl(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&&!ti(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=gl,{hasOwnProperty:Ke}=Object.prototype,re=function(){};function ei(e){return typeof e=="function"?e:re}function ni(e,t){return function(n,i,s){n.type===t&&e.call(this,n,i,s)}}function Hl(e,t){const n=t.structure,i=[];for(const s in n){if(Ke.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 Bl(e){const t={};for(const n in e.node)if(Ke.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]=Hl(n,i)}return t}function ii(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 si({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 Ul(e){const t=Bl(e),n={},i={},s=Symbol("break-walk"),r=Symbol("skip-node");for(const o in t)Ke.call(t,o)&&t[o]!==null&&(n[o]=ii(t[o],!1),i[o]=ii(t[o],!0));const l=si(n),c=si(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=ei(h.enter),d=ei(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=ni(f,h.visit),d=ni(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,Vl=6,Y=7,ht=8,A=9,k=10,$=11,x=12,N=13,ve=14,it=15,q=16,Z=17,ut=18,Ut=19,oe=20,O=21,b=22,ft=23,Vt=24,G=25,Xl=0;function st(e){return e>=48&&e<=57}function Xt(e){return st(e)||e>=65&&e<=70||e>=97&&e<=102}function Qe(e){return e>=65&&e<=90}function Yl(e){return e>=97&&e<=122}function ql(e){return Qe(e)||Yl(e)}function Gl(e){return e>=128}function we(e){return ql(e)||Gl(e)||e===95}function ri(e){return we(e)||st(e)||e===45}function Kl(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===Xl)}function Je(e,t,n){return e===45?we(t)||t===45||yt(t,n):we(e)?!0:e===92?yt(e,t):!1}function Ze(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 oi(e){return e===65279||e===65534?1:0}const tn=new Array(128),Ql=128,xe=130,li=131,en=132,ai=133;for(let e=0;e<tn.length;e++)tn[e]=Ot(e)&&xe||st(e)&&li||we(e)&&en||Kl(e)&&ai||e||Ql;function nn(e){return e<128?tn[e]:en}function Yt(e,t){return t<e.length?e.charCodeAt(t):0}function sn(e,t,n){return n===13&&Yt(e,t+1)===10?2:1}function ci(e,t,n){let i=e.charCodeAt(t);return Qe(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(Qe(l)&&(l=l|32),l!==r)return!1}return!0}function Jl(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 rn(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+=sn(e,t,n))}return t}function Te(e,t){for(;t<e.length;t++){const n=e.charCodeAt(t);if(!ri(n)){if(yt(n,Yt(e,t+1))){t=qt(e,t)-1;continue}break}}return t}function hi(e,t){let n=e.charCodeAt(t);if((n===43||n===45)&&(n=e.charCodeAt(t+=1)),st(n)&&(t=rn(e,t+1),n=e.charCodeAt(t)),n===46&&st(e.charCodeAt(t+1))&&(t+=2,t=rn(e,t)),ci(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=rn(e,t+1+i+1))}return t}function on(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 ui(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 fi=["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"],Zl=16*1024;function Ee(e=null,t){return e===null||e.length<t?new Uint32Array(Math.max(t+1024,Zl)):e}const di=10,ta=12,pi=13;function mi(e){const t=e.source,n=t.length,i=t.length>0?oi(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===di||o===pi||o===ta)&&(o===pi&&a+1<n&&t.charCodeAt(a+1)===di&&(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 ea{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||mi(this),{source:n,offset:this.startOffset+t,line:this.lines[t],column:this.columns[t]}}getLocationRange(t,n,i){return this.computed||mi(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 gi(e){return Dt[e]!==0}class na{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 gi(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:gi(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:fi[n],chunk:this.source.substring(i,s),balance:this.balance[r]}}),t}}function _i(e,t){function n(u){return u<c?e.charCodeAt(u):0}function i(){if(o=hi(e,o),Je(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(nn(f)){case u:o++;return;case xe:if(Ce(f)){o+=sn(e,o,f),h=Vl;return}break;case 92:if(o===e.length-1)break;const d=n(o+1);Ce(d)?o+=sn(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(nn(u)){case 41:o++;return;case xe:if(o=Ae(e,o),n(o)===41||o>=e.length){o<e.length&&o++;return}o=on(e,o),h=ht;return;case 34:case 39:case 40:case ai:o=on(e,o),h=ht;return;case 92:if(yt(u,n(o+1))){o=qt(e,o)-1;break}o=on(e,o),h=ht;return}}}e=String(e||"");const c=e.length;let a=oi(n(0)),o=a,h;for(;o<c;){const u=e.charCodeAt(o);switch(nn(u)){case xe:h=N,o=Ae(e,o+1);break;case 34:r();break;case 35:ri(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:Ze(u,n(o+1),n(o+2))?i():(h=A,o++);break;case 44:h=ut,o++;break;case 45:Ze(u,n(o+1),n(o+2))?i():n(o+1)===45&&n(o+2)===62?(h=it,o=o+3):Je(u,n(o+1),n(o+2))?s():(h=A,o++);break;case 46:Ze(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=ve,o=o+4):(h=A,o++);break;case 64:Je(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 li:i();break;case en:s();break;default:h=A,o++}t(h,a,a=o)}}const St=43,rt=45,Pe=110,It=!0,ia=!1;function Oe(e,t){let n=this.tokenStart+e;const i=this.charCodeAt(n);for((i===St||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 ln(){let e=0,t=0,n=this.tokenType;for(;n===N||n===G;)n=this.lookupType(++e);if(n!==k)if(this.isDelim(St,e)||this.isDelim(rt,e)){t=this.isDelim(St,e)?St: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!==St&&n!==rt&&this.error("Number sign is expected")),Gt.call(this,t!==0),t===rt?"-"+this.consume(k):this.consume(k)}const sa="AnPlusB",ra={a:[String,null],b:[String,null]};function yi(){const e=this.tokenStart;let t=null,n=null;if(this.tokenType===k)Gt.call(this,ia),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=ln.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(St)&&this.lookupType(1)===m){let i=0;switch(t="1",this.isDelim(St)&&(i=1,this.next()),Lt.call(this,0,Pe),this.tokenEnd-this.tokenStart){case 1:this.next(),n=ln.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===St||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=ln.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)===St&&(t=t.substr(1)),n!==null&&n.charCodeAt(0)===St&&(n=n.substr(1)),{type:"AnPlusB",loc:this.getLocation(e,this.tokenStart),a:t,b:n}}function bi(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 oa=Object.freeze(Object.defineProperty({__proto__:null,generate:bi,name:sa,parse:yi,structure:ra},Symbol.toStringTag,{value:"Module"}));function ki(){return this.Raw(this.consumeUntilLeftCurlyBracketOrSemicolon,!0)}function la(){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 aa="Atrule",ca="atrule",ha={name:String,prelude:["AtrulePrelude","Raw",null],block:["Block",null]};function Si(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),ki):s=ki.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(la.call(this));break}return{type:"Atrule",loc:this.getLocation(t,this.tokenStart),name:n,prelude:s,block:r}}function vi(e){this.token(B,"@"+e.name),e.prelude!==null&&this.node(e.prelude),e.block?this.node(e.block):this.token(Z,";")}const ua=Object.freeze(Object.defineProperty({__proto__:null,generate:vi,name:aa,parse:Si,structure:ha,walkContext:ca},Symbol.toStringTag,{value:"Module"})),fa="AtrulePrelude",da="atrulePrelude",pa={children:[[]]};function wi(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 Ci(e){this.children(e)}const ma=Object.freeze(Object.defineProperty({__proto__:null,generate:Ci,name:fa,parse:wi,structure:pa,walkContext:da},Symbol.toStringTag,{value:"Module"})),ga=36,xi=42,De=61,_a=94,an=124,ya=126;function ba(){this.eof&&this.error("Unexpected end of input");const e=this.tokenStart;let t=!1;return this.isDelim(xi)?(t=!0,this.next()):this.isDelim(an)||this.eat(m),this.isDelim(an)?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 ka(){const e=this.tokenStart,t=this.charCodeAt(e);return t!==De&&t!==ya&&t!==_a&&t!==ga&&t!==xi&&t!==an&&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",va={name:"Identifier",matcher:[String,null],value:["String","Identifier",null],flags:[String,null]};function Li(){const e=this.tokenStart;let t,n=null,i=null,s=null;return this.eat(Ut),this.skipSC(),t=ba.call(this),this.skipSC(),this.tokenType!==oe&&(this.tokenType!==m&&(n=ka.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 Ai(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 wa=Object.freeze(Object.defineProperty({__proto__:null,generate:Ai,name:Sa,parse:Li,structure:va},Symbol.toStringTag,{value:"Module"})),Ca=38;function Ti(){return this.Raw(null,!0)}function Ei(){return this.parseWithFallback(this.Rule,Ti)}function Pi(){return this.Raw(this.consumeUntilSemicolonIncluded,!0)}function xa(){if(this.tokenType===Z)return Pi.call(this,this.tokenIndex);const e=this.parseWithFallback(this.Declaration,Pi);return this.tokenType===Z&&this.next(),e}const La="Block",Aa="block",Ta={children:[["Atrule","Rule","Declaration"]]};function Oi(e){const t=e?xa:Ei,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),Ti));break;default:e&&this.isDelim(Ca)?i.push(Ei.call(this)):i.push(t.call(this))}return this.eof||this.eat(Vt),{type:"Block",loc:this.getLocation(n,this.tokenStart),children:i}}function Di(e){this.token(ft,"{"),this.children(e,t=>{t.type==="Declaration"&&this.token(Z,";")}),this.token(Vt,"}")}const Ea=Object.freeze(Object.defineProperty({__proto__:null,generate:Di,name:La,parse:Oi,structure:Ta,walkContext:Aa},Symbol.toStringTag,{value:"Module"})),Pa="Brackets",Oa={children:[[]]};function Ii(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 Ri(e){this.token(A,"["),this.children(e),this.token(A,"]")}const Da=Object.freeze(Object.defineProperty({__proto__:null,generate:Ri,name:Pa,parse:Ii,structure:Oa},Symbol.toStringTag,{value:"Module"})),Ia="CDC",Ra=[];function Mi(){const e=this.tokenStart;return this.eat(it),{type:"CDC",loc:this.getLocation(e,this.tokenStart)}}function Fi(){this.token(it,"-->")}const Ma=Object.freeze(Object.defineProperty({__proto__:null,generate:Fi,name:Ia,parse:Mi,structure:Ra},Symbol.toStringTag,{value:"Module"})),Fa="CDO",ja=[];function ji(){const e=this.tokenStart;return this.eat(ve),{type:"CDO",loc:this.getLocation(e,this.tokenStart)}}function zi(){this.token(ve,"<!--")}const za=Object.freeze(Object.defineProperty({__proto__:null,generate:zi,name:Fa,parse:ji,structure:ja},Symbol.toStringTag,{value:"Module"})),$a=46,Na="ClassSelector",Wa={name:String};function $i(){return this.eatDelim($a),{type:"ClassSelector",loc:this.getLocation(this.tokenStart-1,this.tokenEnd),name:this.consume(m)}}function Ni(e){this.token(A,"."),this.token(m,e.name)}const Ha=Object.freeze(Object.defineProperty({__proto__:null,generate:Ni,name:Na,parse:$i,structure:Wa},Symbol.toStringTag,{value:"Module"})),Ba=43,Wi=47,Ua=62,Va=126,Xa="Combinator",Ya={name:String};function Hi(){const e=this.tokenStart;let t;switch(this.tokenType){case N:t=" ";break;case A:switch(this.charCodeAt(this.tokenStart)){case Ua:case Ba:case Va:this.next();break;case Wi:this.next(),this.eatIdent("deep"),this.eatDelim(Wi);break;default:this.error("Combinator is expected")}t=this.substrToCursor(e);break}return{type:"Combinator",loc:this.getLocation(e,this.tokenStart),name:t}}function Bi(e){this.tokenize(e.name)}const qa=Object.freeze(Object.defineProperty({__proto__:null,generate:Bi,name:Xa,parse:Hi,structure:Ya},Symbol.toStringTag,{value:"Module"})),Ga=42,Ka=47,Qa="Comment",Ja={value:String};function Ui(){const e=this.tokenStart;let t=this.tokenEnd;return this.eat(G),t-e+2>=2&&this.charCodeAt(t-2)===Ga&&this.charCodeAt(t-1)===Ka&&(t-=2),{type:"Comment",loc:this.getLocation(e,this.tokenStart),value:this.substring(e+2,t)}}function Vi(e){this.token(G,"/*"+e.value+"*/")}const Za=Object.freeze(Object.defineProperty({__proto__:null,generate:Vi,name:Qa,parse:Ui,structure:Ja},Symbol.toStringTag,{value:"Module"})),tc=new Set([q,b,xt]),ec="Condition",nc={kind:String,children:[["Identifier","Feature","FeatureFunction","FeatureRange","SupportsDeclaration"]]};function Xi(e){return this.lookupTypeNonSC(1)===m&&tc.has(this.lookupTypeNonSC(2))?this.Feature(e):this.FeatureRange(e)}const ic={media:Xi,container:Xi,supports(){return this.SupportsDeclaration()}};function Yi(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(()=>ic[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 qi(e){e.children.forEach(t=>{t.type==="Condition"?(this.token(O,"("),this.node(t),this.token(b,")")):this.node(t)})}const sc=Object.freeze(Object.defineProperty({__proto__:null,generate:qi,name:ec,parse:Yi,structure:nc},Symbol.toStringTag,{value:"Module"})),Gi=45;function rc(e,t){return t=t||0,e.length-t>=2&&e.charCodeAt(t)===Gi&&e.charCodeAt(t+1)===Gi}const Ki=33,oc=35,lc=36,ac=38,cc=42,hc=43,Qi=47;function uc(){return this.Raw(this.consumeUntilExclamationMarkOrSemicolon,!0)}function fc(){return this.Raw(this.consumeUntilExclamationMarkOrSemicolon,!1)}function dc(){const e=this.tokenIndex,t=this.Value();return t.type!=="Raw"&&this.eof===!1&&this.tokenType!==Z&&this.isDelim(Ki)===!1&&this.isBalanceEdge(e)===!1&&this.error(),t}const pc="Declaration",mc="declaration",gc={important:[Boolean,String],property:String,value:["Value","Raw"]};function Ji(){const e=this.tokenStart,t=this.tokenIndex,n=_c.call(this),i=rc(n),s=i?this.parseCustomProperty:this.parseValue,r=i?fc:uc;let l=!1,c;this.skipSC(),this.eat(q);const a=this.tokenIndex;if(i||this.skipSC(),s?c=this.parseWithFallback(dc,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(Ki)&&(l=yc.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 Zi(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 _c(){const e=this.tokenStart;if(this.tokenType===A)switch(this.charCodeAt(this.tokenStart)){case cc:case lc:case hc:case oc:case ac:this.next();break;case Qi:this.next(),this.isDelim(Qi)&&this.next();break}return this.tokenType===I?this.eat(I):this.eat(m),this.substrToCursor(e)}function yc(){this.eat(A),this.skipSC();const e=this.consume(m);return e==="important"?!0:e}const bc=Object.freeze(Object.defineProperty({__proto__:null,generate:Zi,name:pc,parse:Ji,structure:gc,walkContext:mc},Symbol.toStringTag,{value:"Module"})),kc=38;function cn(){return this.Raw(this.consumeUntilSemicolonIncluded,!0)}const Sc="DeclarationList",vc={children:[["Declaration","Atrule","Rule"]]};function ts(){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),cn));break;default:this.isDelim(kc)?e.push(this.parseWithFallback(this.Rule,cn)):e.push(this.parseWithFallback(this.Declaration,cn))}return{type:"DeclarationList",loc:this.getLocationFromList(e),children:e}}function es(e){this.children(e,t=>{t.type==="Declaration"&&this.token(Z,";")})}const wc=Object.freeze(Object.defineProperty({__proto__:null,generate:es,name:Sc,parse:ts,structure:vc},Symbol.toStringTag,{value:"Module"})),Cc="Dimension",xc={value:String,unit:String};function ns(){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 is(e){this.token(x,e.value+e.unit)}const Lc=Object.freeze(Object.defineProperty({__proto__:null,generate:is,name:Cc,parse:ns,structure:xc},Symbol.toStringTag,{value:"Module"})),Ac=47,Tc="Feature",Ec={kind:String,name:String,value:["Identifier","Number","Dimension","Ratio","Function",null]};function ss(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(Ac)&&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 rs(e){this.token(O,"("),this.token(m,e.name),e.value!==null&&(this.token(q,":"),this.node(e.value)),this.token(b,")")}const Pc=Object.freeze(Object.defineProperty({__proto__:null,generate:rs,name:Tc,parse:ss,structure:Ec},Symbol.toStringTag,{value:"Module"})),Oc="FeatureFunction",Dc={kind:String,feature:String,value:["Declaration","Selector"]};function Ic(e,t){const n=(this.features[e]||{})[t];return typeof n!="function"&&this.error(`Unknown feature ${t}()`),n}function os(e="unknown"){const t=this.tokenStart,n=this.consumeFunctionName(),i=Ic.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 ls(e){this.token(w,e.feature+"("),this.node(e.value),this.token(b,")")}const Rc=Object.freeze(Object.defineProperty({__proto__:null,generate:ls,name:Oc,parse:os,structure:Dc},Symbol.toStringTag,{value:"Module"})),as=47,Mc=60,cs=61,Fc=62,jc="FeatureRange",zc={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 hn(){switch(this.skipSC(),this.tokenType){case k:return this.isDelim(as,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(as)&&this.error(),e},()=>this.Ratio());default:this.error("Number, dimension, ratio or identifier is expected")}}function hs(e){if(this.skipSC(),this.isDelim(Mc)||this.isDelim(Fc)){const t=this.source[this.tokenStart];return this.next(),this.isDelim(cs)?(this.next(),t+"="):t}if(this.isDelim(cs))return"=";this.error(`Expected ${e?'":", ':""}"<", ">", "=" or ")"`)}function us(e="unknown"){const t=this.tokenStart;this.skipSC(),this.eat(O);const n=hn.call(this),i=hs.call(this,n.type==="Identifier"),s=hn.call(this);let r=null,l=null;return this.lookupNonWSType(0)!==b&&(r=hs.call(this),l=hn.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 fs(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 $c=Object.freeze(Object.defineProperty({__proto__:null,generate:fs,name:jc,parse:us,structure:zc},Symbol.toStringTag,{value:"Module"})),Nc="Function",Wc="function",Hc={name:String,children:[[]]};function ds(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 ps(e){this.token(w,e.name+"("),this.children(e),this.token(b,")")}const Bc=Object.freeze(Object.defineProperty({__proto__:null,generate:ps,name:Nc,parse:ds,structure:Hc,walkContext:Wc},Symbol.toStringTag,{value:"Module"})),Uc="GeneralEnclosed",Vc={kind:String,function:[String,null],children:[[]]};function ms(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 gs(e){e.function?this.token(w,e.function+"("):this.token(O,"("),this.children(e),this.token(b,")")}const Xc=Object.freeze(Object.defineProperty({__proto__:null,generate:gs,name:Uc,parse:ms,structure:Vc},Symbol.toStringTag,{value:"Module"})),Yc="XXX",qc="Hash",Gc={value:String};function _s(){const e=this.tokenStart;return this.eat(I),{type:"Hash",loc:this.getLocation(e,this.tokenStart),value:this.substrToCursor(e+1)}}function ys(e){this.token(I,"#"+e.value)}const Kc=Object.freeze(Object.defineProperty({__proto__:null,generate:ys,name:qc,parse:_s,structure:Gc,xxx:Yc},Symbol.toStringTag,{value:"Module"})),Qc="Identifier",Jc={name:String};function bs(){return{type:"Identifier",loc:this.getLocation(this.tokenStart,this.tokenEnd),name:this.consume(m)}}function ks(e){this.token(m,e.name)}const Zc=Object.freeze(Object.defineProperty({__proto__:null,generate:ks,name:Qc,parse:bs,structure:Jc},Symbol.toStringTag,{value:"Module"})),th="IdSelector",eh={name:String};function Ss(){const e=this.tokenStart;return this.eat(I),{type:"IdSelector",loc:this.getLocation(e,this.tokenStart),name:this.substrToCursor(e+1)}}function vs(e){this.token(A,"#"+e.name)}const nh=Object.freeze(Object.defineProperty({__proto__:null,generate:vs,name:th,parse:Ss,structure:eh},Symbol.toStringTag,{value:"Module"})),ih=46,sh="Layer",rh={name:String};function ws(){let e=this.tokenStart,t=this.consume(m);for(;this.isDelim(ih);)this.eat(A),t+="."+this.consume(m);return{type:"Layer",loc:this.getLocation(e,this.tokenStart),name:t}}function Cs(e){this.tokenize(e.name)}const oh=Object.freeze(Object.defineProperty({__proto__:null,generate:Cs,name:sh,parse:ws,structure:rh},Symbol.toStringTag,{value:"Module"})),lh="LayerList",ah={children:[["Layer"]]};function xs(){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 Ls(e){this.children(e,()=>this.token(ut,","))}const ch=Object.freeze(Object.defineProperty({__proto__:null,generate:Ls,name:lh,parse:xs,structure:ah},Symbol.toStringTag,{value:"Module"})),hh="MediaQuery",uh={modifier:[String,null],mediaType:[String,null],condition:["Condition",null]};function As(){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 Ts(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 fh=Object.freeze(Object.defineProperty({__proto__:null,generate:Ts,name:hh,parse:As,structure:uh},Symbol.toStringTag,{value:"Module"})),dh="MediaQueryList",ph={children:[["MediaQuery"]]};function Es(){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 Ps(e){this.children(e,()=>this.token(ut,","))}const mh=Object.freeze(Object.defineProperty({__proto__:null,generate:Ps,name:dh,parse:Es,structure:ph},Symbol.toStringTag,{value:"Module"})),gh=38,_h="NestingSelector",yh={};function Os(){const e=this.tokenStart;return this.eatDelim(gh),{type:"NestingSelector",loc:this.getLocation(e,this.tokenStart)}}function Ds(){this.token(A,"&")}const bh=Object.freeze(Object.defineProperty({__proto__:null,generate:Ds,name:_h,parse:Os,structure:yh},Symbol.toStringTag,{value:"Module"})),kh="Nth",Sh={nth:["AnPlusB","Identifier"],selector:["SelectorList",null]};function Is(){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 Rs(e){this.node(e.nth),e.selector!==null&&(this.token(m,"of"),this.node(e.selector))}const vh=Object.freeze(Object.defineProperty({__proto__:null,generate:Rs,name:kh,parse:Is,structure:Sh},Symbol.toStringTag,{value:"Module"})),wh="Number",Ch={value:String};function Ms(){return{type:"Number",loc:this.getLocation(this.tokenStart,this.tokenEnd),value:this.consume(k)}}function Fs(e){this.token(k,e.value)}const xh=Object.freeze(Object.defineProperty({__proto__:null,generate:Fs,name:wh,parse:Ms,structure:Ch},Symbol.toStringTag,{value:"Module"})),Lh="Operator",Ah={value:String};function js(){const e=this.tokenStart;return this.next(),{type:"Operator",loc:this.getLocation(e,this.tokenStart),value:this.substrToCursor(e)}}function zs(e){this.tokenize(e.value)}const Th=Object.freeze(Object.defineProperty({__proto__:null,generate:zs,name:Lh,parse:js,structure:Ah},Symbol.toStringTag,{value:"Module"})),Eh="Parentheses",Ph={children:[[]]};function $s(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 Ns(e){this.token(O,"("),this.children(e),this.token(b,")")}const Oh=Object.freeze(Object.defineProperty({__proto__:null,generate:Ns,name:Eh,parse:$s,structure:Ph},Symbol.toStringTag,{value:"Module"})),Dh="Percentage",Ih={value:String};function Ws(){return{type:"Percentage",loc:this.getLocation(this.tokenStart,this.tokenEnd),value:this.consumeNumber($)}}function Hs(e){this.token($,e.value+"%")}const Rh=Object.freeze(Object.defineProperty({__proto__:null,generate:Hs,name:Dh,parse:Ws,structure:Ih},Symbol.toStringTag,{value:"Module"})),Mh="PseudoClassSelector",Fh="function",jh={name:String,children:[["Raw"],null]};function Bs(){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 Us(e){this.token(q,":"),e.children===null?this.token(m,e.name):(this.token(w,e.name+"("),this.children(e),this.token(b,")"))}const zh=Object.freeze(Object.defineProperty({__proto__:null,generate:Us,name:Mh,parse:Bs,structure:jh,walkContext:Fh},Symbol.toStringTag,{value:"Module"})),$h="PseudoElementSelector",Nh="function",Wh={name:String,children:[["Raw"],null]};function Vs(){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 Xs(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 Hh=Object.freeze(Object.defineProperty({__proto__:null,generate:Xs,name:$h,parse:Vs,structure:Wh,walkContext:Nh},Symbol.toStringTag,{value:"Module"})),Ys=47;function qs(){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 Bh="Ratio",Uh={left:["Number","Function"],right:["Number","Function",null]};function Gs(){const e=this.tokenStart,t=qs.call(this);let n=null;return this.skipSC(),this.isDelim(Ys)&&(this.eatDelim(Ys),n=qs.call(this)),{type:"Ratio",loc:this.getLocation(e,this.tokenStart),left:t,right:n}}function Ks(e){this.node(e.left),this.token(A,"/"),e.right?this.node(e.right):this.node(k,1)}const Vh=Object.freeze(Object.defineProperty({__proto__:null,generate:Ks,name:Bh,parse:Gs,structure:Uh},Symbol.toStringTag,{value:"Module"}));function Xh(){return this.tokenIndex>0&&this.lookupType(-1)===N?this.tokenIndex>1?this.getTokenStart(this.tokenIndex-1):this.firstCharOffset:this.tokenStart}const Yh="Raw",qh={value:String};function Qs(e,t){const n=this.getTokenStart(this.tokenIndex);let i;return this.skipUntilBalanced(this.tokenIndex,e||this.consumeUntilBalanceEnd),t&&this.tokenStart>n?i=Xh.call(this):i=this.tokenStart,{type:"Raw",loc:this.getLocation(n,i),value:this.substring(n,i)}}function Js(e){this.tokenize(e.value)}const Gh=Object.freeze(Object.defineProperty({__proto__:null,generate:Js,name:Yh,parse:Qs,structure:qh},Symbol.toStringTag,{value:"Module"}));function Zs(){return this.Raw(this.consumeUntilLeftCurlyBracket,!0)}function Kh(){const e=this.SelectorList();return e.type!=="Raw"&&this.eof===!1&&this.tokenType!==ft&&this.error(),e}const Qh="Rule",Jh="rule",Zh={prelude:["SelectorList","Raw"],block:["Block"]};function tr(){const e=this.tokenIndex,t=this.tokenStart;let n,i;return this.parseRulePrelude?n=this.parseWithFallback(Kh,Zs):n=Zs.call(this,e),i=this.Block(!0),{type:"Rule",loc:this.getLocation(t,this.tokenStart),prelude:n,block:i}}function er(e){this.node(e.prelude),this.node(e.block)}const tu=Object.freeze(Object.defineProperty({__proto__:null,generate:er,name:Qh,parse:tr,structure:Zh,walkContext:Jh},Symbol.toStringTag,{value:"Module"})),eu="Scope",nu={root:["SelectorList","Raw",null],limit:["SelectorList","Raw",null]};function nr(){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 ir(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 iu=Object.freeze(Object.defineProperty({__proto__:null,generate:ir,name:eu,parse:nr,structure:nu},Symbol.toStringTag,{value:"Module"})),su="Selector",ru={children:[["TypeSelector","IdSelector","ClassSelector","AttributeSelector","PseudoClassSelector","PseudoElementSelector","Combinator"]]};function sr(){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 rr(e){this.children(e)}const ou=Object.freeze(Object.defineProperty({__proto__:null,generate:rr,name:su,parse:sr,structure:ru},Symbol.toStringTag,{value:"Module"})),lu="SelectorList",au="selector",cu={children:[["Selector","Raw"]]};function or(){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 lr(e){this.children(e,()=>this.token(ut,","))}const hu=Object.freeze(Object.defineProperty({__proto__:null,generate:lr,name:lu,parse:or,structure:cu,walkContext:au},Symbol.toStringTag,{value:"Module"})),un=92,ar=34,uu=39;function cr(e){const t=e.length,n=e.charCodeAt(0),i=n===ar||n===uu?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===un){if(l===s){l!==t-1&&(r=e.substr(l+1));break}if(c=e.charCodeAt(++l),yt(un,c)){const a=l-1,o=qt(e,a);l=o-1,r+=ui(e.substring(a+1,o))}else c===13&&e.charCodeAt(l+1)===10&&l++}else r+=e[l]}return r}function fu(e,t){const n=ar;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===un?(i+="\\"+e.charAt(r),s=!1):(s&&(Xt(l)||Ot(l))&&(i+=" "),i+=e.charAt(r),s=!1)}return'"'+i+'"'}const du="String",pu={value:String};function hr(){return{type:"String",loc:this.getLocation(this.tokenStart,this.tokenEnd),value:cr(this.consume(wt))}}function ur(e){this.token(wt,fu(e.value))}const mu=Object.freeze(Object.defineProperty({__proto__:null,generate:ur,name:du,parse:hr,structure:pu},Symbol.toStringTag,{value:"Module"})),gu=33;function fr(){return this.Raw(null,!1)}const _u="StyleSheet",yu="stylesheet",bu={children:[["Comment","CDO","CDC","Atrule","Rule","Raw"]]};function dr(){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)!==gu){this.next();continue}n=this.Comment();break;case ve:n=this.CDO();break;case it:n=this.CDC();break;case B:n=this.parseWithFallback(this.Atrule,fr);break;default:n=this.parseWithFallback(this.Rule,fr)}t.push(n)}return{type:"StyleSheet",loc:this.getLocation(e,this.tokenStart),children:t}}function pr(e){this.children(e)}const ku=Object.freeze(Object.defineProperty({__proto__:null,generate:pr,name:_u,parse:dr,structure:bu,walkContext:yu},Symbol.toStringTag,{value:"Module"})),Su="SupportsDeclaration",vu={declaration:"Declaration"};function mr(){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 gr(e){this.token(O,"("),this.node(e.declaration),this.token(b,")")}const wu=Object.freeze(Object.defineProperty({__proto__:null,generate:gr,name:Su,parse:mr,structure:vu},Symbol.toStringTag,{value:"Module"})),Cu=42,_r=124;function fn(){this.tokenType!==m&&this.isDelim(Cu)===!1&&this.error("Identifier or asterisk is expected"),this.next()}const xu="TypeSelector",Lu={name:String};function yr(){const e=this.tokenStart;return this.isDelim(_r)?(this.next(),fn.call(this)):(fn.call(this),this.isDelim(_r)&&(this.next(),fn.call(this))),{type:"TypeSelector",loc:this.getLocation(e,this.tokenStart),name:this.substrToCursor(e)}}function br(e){this.tokenize(e.name)}const Au=Object.freeze(Object.defineProperty({__proto__:null,generate:br,name:xu,parse:yr,structure:Lu},Symbol.toStringTag,{value:"Module"})),kr=43,Sr=45,dn=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===Sr&&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(dn);)++t>e&&this.error("Too many question marks"),this.next()}function Tu(e){this.charCodeAt(this.tokenStart)!==e&&this.error((e===kr?"Plus sign":"Hyphen minus")+" is expected")}function Eu(){let e=0;switch(this.tokenType){case k:if(e=le.call(this,1,!0),this.isDelim(dn)){Ie.call(this,6-e);break}if(this.tokenType===x||this.tokenType===k){Tu.call(this,Sr),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(kr),this.tokenType===m){e=le.call(this,0,!0),e>0&&Ie.call(this,6-e);break}if(this.isDelim(dn)){this.next(),Ie.call(this,5);break}this.error("Hex digit or question mark is expected")}}const Pu="UnicodeRange",Ou={value:String};function vr(){const e=this.tokenStart;return this.eatIdent("u"),Eu.call(this),{type:"UnicodeRange",loc:this.getLocation(e,this.tokenStart),value:this.substrToCursor(e)}}function wr(e){this.tokenize(e.value)}const Du=Object.freeze(Object.defineProperty({__proto__:null,generate:wr,name:Pu,parse:vr,structure:Ou},Symbol.toStringTag,{value:"Module"})),Iu=32,pn=92,Ru=34,Mu=39,Fu=40,Cr=41;function ju(e){const t=e.length;let n=4,i=e.charCodeAt(t-1)===Cr?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===pn){if(r===i){r!==t-1&&(s=e.substr(r+1));break}if(l=e.charCodeAt(++r),yt(pn,l)){const c=r-1,a=qt(e,c);r=a-1,s+=ui(e.substring(c+1,a))}else l===13&&e.charCodeAt(r+1)===10&&r++}else s+=e[r]}return s}function zu(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===Iu||s===pn||s===Ru||s===Mu||s===Fu||s===Cr?(t+="\\"+e.charAt(i),n=!1):(n&&Xt(s)&&(t+=" "),t+=e.charAt(i),n=!1)}return"url("+t+")"}const $u="Url",Nu={value:String};function xr(){const e=this.tokenStart;let t;switch(this.tokenType){case Y:t=ju(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=cr(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 Lr(e){this.token(Y,zu(e.value))}const Wu=Object.freeze(Object.defineProperty({__proto__:null,generate:Lr,name:$u,parse:xr,structure:Nu},Symbol.toStringTag,{value:"Module"})),Hu="Value",Bu={children:[[]]};function Ar(){const e=this.tokenStart,t=this.readSequence(this.scope.Value);return{type:"Value",loc:this.getLocation(e,this.tokenStart),children:t}}function Tr(e){this.children(e)}const Uu=Object.freeze(Object.defineProperty({__proto__:null,generate:Tr,name:Hu,parse:Ar,structure:Bu},Symbol.toStringTag,{value:"Module"})),Vu=Object.freeze({type:"WhiteSpace",loc:null,value:" "}),Xu="WhiteSpace",Yu={value:String};function Er(){return this.eat(N),Vu}function Pr(e){this.token(N,e.value)}const qu=Object.freeze(Object.defineProperty({__proto__:null,generate:Pr,name:Xu,parse:Er,structure:Yu},Symbol.toStringTag,{value:"Module"})),Gu=Object.freeze(Object.defineProperty({__proto__:null,AnPlusB:oa,Atrule:ua,AtrulePrelude:ma,AttributeSelector:wa,Block:Ea,Brackets:Da,CDC:Ma,CDO:za,ClassSelector:Ha,Combinator:qa,Comment:Za,Condition:sc,Declaration:bc,DeclarationList:wc,Dimension:Lc,Feature:Pc,FeatureFunction:Rc,FeatureRange:$c,Function:Bc,GeneralEnclosed:Xc,Hash:Kc,IdSelector:nh,Identifier:Zc,Layer:oh,LayerList:ch,MediaQuery:fh,MediaQueryList:mh,NestingSelector:bh,Nth:vh,Number:xh,Operator:Th,Parentheses:Oh,Percentage:Rh,PseudoClassSelector:zh,PseudoElementSelector:Hh,Ratio:Vh,Raw:Gh,Rule:tu,Scope:iu,Selector:ou,SelectorList:hu,String:mu,StyleSheet:ku,SupportsDeclaration:wu,TypeSelector:Au,UnicodeRange:Du,Url:Wu,Value:Uu,WhiteSpace:qu},Symbol.toStringTag,{value:"Module"})),Ku={node:Gu},At=Ul(Ku),mn=["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 mn.includes(e)}const gn=["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 Qu(e){return gn.includes(e)}const _n=["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 Or(e){return _n.includes(e)}const Dr=["justify-self","align-self","place-self"];function Ju(e){return Dr.includes(e)}const Ir=[...mn,...gn,..._n,...Dr,"position-anchor","position-area"],Zu=[..._n,...mn,...gn];function Rr(e){return Zu.includes(e)}const tf=["top","left","right","bottom","start","end","self-start","self-end","center","inside","outside"];function Mr(e){return tf.includes(e)}const ef=["width","height","block","inline","self-block","self-inline"];function nf(e){return ef.includes(e)}const Fr=new Set(["Atrule","Selector","Declaration"]);function sf(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&&Fr.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&&Fr.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 rf=43,of=45,yn=(e,t)=>{if(e===A&&(e=t),typeof e=="string"){const n=e.charCodeAt(0);return n>127?32768:n<<8}return e},jr=[[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],["/","*"]],lf=jr.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 zr(e){const t=new Set(e.map(([n,i])=>yn(n)<<16|yn(i)));return function(n,i,s){const r=yn(i,s),l=s.charCodeAt(0);return(l===of&&i!==m&&i!==w&&i!==it||l===rf?t.has(n<<16|l<<8):t.has(n<<16|r))&&this.emit(" ",N,!0),r}}const af=zr(jr),$r=zr(lf),Nr=Object.freeze(Object.defineProperty({__proto__:null,safe:$r,spec:af},Symbol.toStringTag,{value:"Module"})),cf=92;function hf(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 uf(e){_i(e,(t,n,i)=>{this.token(t,e.slice(n,i))})}function ff(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:$r,token(a,o){r=this.tokenBefore(r,a,o),this.emit(o,a,!1),a===A&&o.charCodeAt(0)===cf&&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
|
|
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=rf(l)),i.mode in Wr&&(l.tokenBefore=Wr[i.mode]));const c={node:a=>l.node(a),children:uf,token:(a,o)=>l.token(a,o),tokenize:ff};return l.node(n),l.result()}}const pf=Object.freeze(Object.defineProperty({__proto__:null,AnPlusB:vi,Atrule:Ci,AtrulePrelude:Li,AttributeSelector:Ei,Block:Ri,Brackets:Fi,CDC:zi,CDO:Ni,ClassSelector:Wi,Combinator:Vi,Comment:Yi,Condition:Ki,Declaration:es,DeclarationList:is,Dimension:rs,Feature:ls,FeatureFunction:cs,FeatureRange:ps,Function:gs,GeneralEnclosed:ys,Hash:ks,IdSelector:Cs,Identifier:Ss,Layer:Ls,LayerList:Ts,MediaQuery:Ps,MediaQueryList:Ds,NestingSelector:Rs,Nth:Fs,Number:zs,Operator:Ns,Parentheses:Ws,Percentage:Us,PseudoClassSelector:Xs,PseudoElementSelector:qs,Ratio:Js,Raw:tr,Rule:ir,Scope:rr,Selector:lr,SelectorList:cr,String:dr,StyleSheet:gr,SupportsDeclaration:yr,TypeSelector:vr,UnicodeRange:xr,Url:Tr,Value:Pr,WhiteSpace:Dr},Symbol.toStringTag,{value:"Module"})),mf={node:pf},gf=df(mf);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 _f(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,Br=60,Ur=" ";function Vr({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
|
-
`+Br({source:t,line:i,column:s,baseLine:r,baseColumn:l},2)}})}function _f(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 Vr=()=>{},yf=33,bf=35,kn=59,Xr=123,Yr=0;function kf(e){return function(){return this[e]()}}function Sn(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:Sn(e.atrule),pseudo:Sn(e.pseudo),node:Sn(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]=kf(i);break}return U(U({config:t},t),t.node)}function vf(e){let t="",n="<unknown>",i=!1,s=Vr,r=!1;const l=new ea,c=Object.assign(new na,Sf(e||{}),{parseAtrulePrelude:!0,parseRulePrelude:!0,parseValue:!0,parseCustomProperty:!1,readSequence:_f,consumeUntilBalanceEnd:()=>0,consumeUntilLeftCurlyBracket(a){return a===Xr?1:0},consumeUntilLeftCurlyBracketOrSemicolon(a){return a===Xr||a===kn?1:0},consumeUntilExclamationMarkOrSemicolon(a){return a===yf||a===kn?1:0},consumeUntilSemicolonIncluded(a){return a===kn?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!==Yr);return Yr},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 ci(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,hi(t,this.tokenStart));return this.eat(a),o},eat(a){if(this.tokenType!==a){const o=fi[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(bf)&&(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(Jl(t,t.length-1)):l.getLocation(this.tokenStart);throw new Ur(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,_i),l.setSource(t,o.offset,o.line,o.column),n=o.filename||"<unknown>",i=!!o.positions,s=typeof o.onParseError=="function"?o.onParseError:Vr,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:Ur,config:c.config})}const wf=35,Cf=42,qr=43,xf=45,Lf=47,Af=117;function Gr(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,Af)&&this.cmpChar(this.tokenStart+1,qr)?this.UnicodeRange():this.Identifier();case A:{const t=this.charCodeAt(this.tokenStart);if(t===Lf||t===Cf||t===qr||t===xf)return this.Operator();t===wf&&this.error("Hex or identifier is expected",this.tokenStart+1);break}}}const Tf={getNode:Gr},Ef=35,Pf=38,Of=42,Df=43,If=47,Kr=46,Rf=62,Mf=124,Ff=126;function jf(e,t){t.last!==null&&t.last.type!=="Combinator"&&e!==null&&e.type!=="Combinator"&&t.push({type:"Combinator",loc:null,name:" "})}function zf(){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)===Kr&&this.error("Identifier is expected",this.tokenStart+1);break;case A:{switch(this.charCodeAt(this.tokenStart)){case Df:case Rf:case Ff:case If:return this.Combinator();case Kr:return this.ClassSelector();case Of:case Mf:return this.TypeSelector();case Ef:return this.IdSelector();case Pf:return this.NestingSelector()}break}}}const $f={onWhiteSpace:jf,getNode:zf};function Nf(){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 Qr(e){return e!==null&&e.type==="Operator"&&(e.value[e.value.length-1]==="-"||e.value[e.value.length-1]==="+")}const Hf={getNode:Gr,onWhiteSpace(e,t){Qr(e)&&(e.value=" "+e.value),Qr(t.last)&&(t.last.value+=" ")},expression:Nf,var:Wf},Bf=Object.freeze(Object.defineProperty({__proto__:null,AtrulePrelude:Tf,Selector:$f,Value:Hf},Symbol.toStringTag,{value:"Module"})),Uf=new Set(["none","and","not","or"]),Vf={parse:{prelude(){const e=this.createList();if(this.tokenType===m){const t=this.substring(this.tokenStart,this.tokenEnd);Uf.has(t.toLowerCase())||e.push(this.Identifier())}return e.push(this.Condition("container")),e},block(e=!1){return this.Block(e)}}},Xf={parse:{prelude:null,block(){return this.Block(!0)}}};function vn(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 Jr={layer(){this.skipSC();const e=this.createList(),t=vn.call(this,this.Layer);return(t.type!=="Raw"||t.value!=="")&&e.push(t),e},supports(){this.skipSC();const e=this.createList(),t=vn.call(this,this.Declaration,()=>vn.call(this,()=>this.Condition("supports")));return(t.type!=="Raw"||t.value!=="")&&e.push(t),e}},Yf={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,Jr)),this.skipSC(),this.tokenType===w&&this.cmpStr(this.tokenStart,this.tokenEnd,"supports(")&&e.push(this.Function(null,Jr)),(this.lookupNonWSType(0)===m||this.lookupNonWSType(0)===O)&&e.push(this.MediaQueryList()),e},block:null}},qf={parse:{prelude(){return this.createSingleNodeList(this.LayerList())},block(){return this.Block(!1)}}},Gf={parse:{prelude(){return this.createSingleNodeList(this.MediaQueryList())},block(e=!1){return this.Block(e)}}},Kf={parse:{prelude(){return this.createSingleNodeList(this.SelectorList())},block(){return this.Block(!0)}}},Qf={parse:{prelude(){return this.createSingleNodeList(this.SelectorList())},block(){return this.Block(!0)}}},Jf={parse:{prelude(){return this.createSingleNodeList(this.Scope())},block(e=!1){return this.Block(e)}}},Zf={parse:{prelude:null,block(e=!1){return this.Block(e)}}},td={parse:{prelude(){return this.createSingleNodeList(this.Condition("supports"))},block(e=!1){return this.Block(e)}}},ed={container:Vf,"font-face":Xf,import:Yf,layer:qf,media:Gf,nest:Kf,page:Qf,scope:Jf,"starting-style":Zf,supports:td};function nd(){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())}},wn={parse(){return this.createSingleNodeList(this.Selector())}},id={parse(){return this.createSingleNodeList(this.Identifier())}},sd={parse:nd},Re={parse(){return this.createSingleNodeList(this.Nth())}},rd={dir:id,has:Rt,lang:sd,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:wn,host:wn,"host-context":wn},od=Object.freeze(Object.defineProperty({__proto__:null,AnPlusB:yi,Atrule:Si,AtrulePrelude:wi,AttributeSelector:Li,Block:Oi,Brackets:Ii,CDC:Mi,CDO:ji,ClassSelector:$i,Combinator:Hi,Comment:Ui,Condition:Yi,Declaration:Ji,DeclarationList:ts,Dimension:ns,Feature:ss,FeatureFunction:os,FeatureRange:us,Function:ds,GeneralEnclosed:ms,Hash:_s,IdSelector:Ss,Identifier:bs,Layer:ws,LayerList:xs,MediaQuery:As,MediaQueryList:Es,NestingSelector:Os,Nth:Is,Number:Ms,Operator:js,Parentheses:$s,Percentage:Ws,PseudoClassSelector:Bs,PseudoElementSelector:Vs,Ratio:Gs,Raw:Qs,Rule:tr,Scope:nr,Selector:sr,SelectorList:or,String:hr,StyleSheet:dr,SupportsDeclaration:mr,TypeSelector:yr,UnicodeRange:vr,Url:xr,Value:Ar,WhiteSpace:Er},Symbol.toStringTag,{value:"Module"})),ld={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:Bf,atrule:ed,pseudo:rd,node:od},ad=vf(ld);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 cd="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict",dt=(e=21)=>{let t="",n=e|0;for(;n--;)t+=cd[Math.random()*64|0];return t};const Zr=dt(),ce=new Set;function Fe(e){return!!(e&&e.type==="Function"&&e.name==="anchor")}function Tt(e,t=!1){return ad(e,{parseAtrulePrelude:!1,parseCustomProperty:!0,onParseError:n=>{t&&ce.add(n)}})}function tt(e){return mf(e,{mode:"spec"})}function hd(e){return e.type==="Declaration"}function ud(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 Cn(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 fd(){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 dd(){ce.clear()}const xn=[...Ir,"anchor-scope","anchor-name"].reduce((e,t)=>(e[t]=`--${t}-${Zr}`,e),{});function pd(e,t){return hd(e)&&xn[e.property]&&t?(t.children.appendData(J(U({},e),{property:xn[e.property]})),{updated:!0}):{}}function md(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}=pd(s,l);c&&(n=!0)}}),n&&(t.css=tt(i),t.changed=!0)}return e.some(t=>t.changed===!0)}var to=(e=>(e.All="all",e.None="none",e))(to||{});function ot(e,t){var n;return t=(n=xn[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 gd(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 _d(e){let t=e;for(;t;){if(Qt(t,"overflow","scroll"))return t;t=t.parentElement}return t}function yd(e){let t=_d(e);return t===document.documentElement&&(t=null),t??{scrollTop:0,scrollLeft:0}}function bd(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}=gd(l,e),h=c.getBoundingClientRect(),{scrollY:u,scrollX:f}=globalThis,d=yd(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 kd(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 Ln=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)]),eo="InvalidMimeType";function vd(e){return!!((e.type==="text/css"||e.rel==="stylesheet")&&e.href)}function wd(e){const t=new URL(e.href,document.baseURI);if(vd(e)&&t.origin===location.origin)return t}function Cd(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=eo,l}const r=yield i.text();return J(U({},t),{css:r})}catch(i){if(i instanceof Error&&i.name===eo)return console.warn(i),null;throw i}})))).filter(t=>t!==null)})}const no='[style*="anchor"]',io='[style*="position-area"]';function xd(e){const t=e?e.filter(i=>i instanceof HTMLElement&&(i.matches(no)||i.matches(io))):Array.from(document.querySelectorAll([no,io].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 Ld(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=wd(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=xd(r);return yield Cd([...s,...l])})}const Ad="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";let so=(e=21)=>{let t="",n=crypto.getRandomValues(new Uint8Array(e|=0));for(;e--;)t+=Ad[n[e]&63];return t};const ro="--pa-cascade-property",oo="data-anchor-position-wrapper",lo="data-pa-wrapper-for-",ao="POLYFILL-POSITION-AREA",Td=["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 co(e){return Td.includes(e)}const ho={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"]},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"],Pd=["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"],Od=["block-start","center","block-end","span-block-start","span-block-end","span-all"],Dd=["inline-start","center","inline-end","span-inline-start","span-inline-end","span-all"],Id=["self-block-start","center","self-block-end","span-self-block-start","span-self-block-end","span-all"],Rd=["self-inline-start","center","self-inline-end","span-self-inline-start","span-self-inline-end","span-all"],uo=["start","center","end","span-start","span-end","span-all"],fo=["self-start","center","self-end","span-self-start","span-self-end","span-all"],Md=["block","top","bottom","y"],Fd=["inline","left","right","x"];function An(e){const t=e.split("-");for(const n of t){if(Md.includes(n))return"block";if(Fd.includes(n))return"inline"}return"ambiguous"}function jd(e,t){return t[0].includes(e[0])&&t[1].includes(e[1])||t[0].includes(e[1])&&t[1].includes(e[0])}const zd=[[Ed,Pd],[Od,Dd],[Id,Rd],[uo,uo],[fo,fo]];function $d(e){for(const t of zd)if(jd(e,t))return!0;return!1}const po=e=>{const t=getComputedStyle(e);return{writingMode:t.writingMode,direction:t.direction}},Nd=(e,t)=>P(null,null,function*(){const n=yield Ln(e);switch(t){case"Logical":case"Physical":return po(n);case"LogicalSelf":case"PhysicalSelf":return po(e);default:return null}}),Tn=e=>e.reverse().map(t=>3-t),mo=(e,t)=>e==="Irrelevant"?t:e,Wd=(e,t)=>P(null,[e,t],function*({block:n,inline:i},s){const r=mo(n[2],i[2]),l=yield Nd(s,r),c={block:[n[0],n[1]],inline:[i[0],i[1]]};if(l){if(l.direction==="rtl"&&(c.inline=Tn(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=Tn(c.block))}l.writingMode.endsWith("rl")&&(c.inline=Tn(c.inline))}return c}),Hd=({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 go([e,t]){return e===0&&t===3?"center":e===0?"end":t===3?"start":"center"}function Bd(e){return e.type==="Declaration"&&e.property==="position-area"}function Ud(e){const t=e.value.children.toArray().map(({name:n})=>n);return t.length===1&&(An(t[0])==="ambiguous"?t.push(t[0]):t.push("span-all")),t}function Vd(e){if(!Bd(e))return;const t=Ud(e);if(!$d(t))return;const n={};switch(An(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":An(t[1])=="block"?(n.block=t[1],n.inline=t[0]):(n.inline=t[1],n.block=t[0]);break}const i={block:ho[n.block],inline:ho[n.inline]},s=`--pa-declaration-${so(12)}`;return{values:n,grid:i,selectorUUID:s}}function Xd(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:ro,value:{type:"Raw",value:e.selectorUUID},important:!1})}function Yd(e,t){var n,i;let s;if(((n=e.parentElement)==null?void 0:n.tagName)===ao)s=e.parentElement;else{s=document.createElement(ao),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(`${lo}${t}`,""),s}function qd(e,t,n){return P(this,null,function*(){const i=`--pa-target-${so(12)}`,s=yield Wd(t.grid,e),r=Hd(s),l=mo(t.grid.block[2],t.grid.inline[2]),c=["LogicalSelf","PhysicalSelf"].includes(l)?s:t.grid,a={block:go([c.block[0],c.block[1]]),inline:go([c.inline[0],c.inline[1]])};return{insets:r,alignments:a,targetUUID:i,targetEl:e,anchorEl:n,wrapperEl:Yd(e,i),values:t.values,grid:t.grid,selectorUUID:t.selectorUUID}})}function Gd(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+=(Ur.length-1)*(o[t-1].substr(0,n-1).match(/\t/g)||[]).length,n>vn&&(d=n-Br+3,n=Br-2);for(let p=h;p<=u;p++)p>=0&&p<o.length&&(o[p]=o[p].replace(/\t/g,Ur),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 Xr(e,t,n,i,s,r=1,l=1){return Object.assign(_f("SyntaxError",e),{source:t,offset:n,line:i,column:s,sourceFragment(c){return Vr({source:t,line:i,column:s,baseLine:r,baseColumn:l},isNaN(c)?0:c)},get formattedMessage(){return`Parse error: ${e}
|
|
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
|
+
[${ao}="${t}"][${co}${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 Kd=["normal","most-width","most-height","most-block-size","most-inline-size"],Qd=["flip-block","flip-inline","flip-start"];function Jd(e){return e.type==="Declaration"}function Zd(e){return e.type==="Declaration"&&e.property==="position-try-fallbacks"}function tp(e){return e.type==="Declaration"&&e.property==="position-try-order"}function ep(e){return e.type==="Declaration"&&e.property==="position-try"}function np(e){return e.type==="Atrule"&&e.name==="position-try"}function ip(e){return Qd.includes(e)}function sp(e){return Kd.includes(e)}function rp(e,t){const n=document.querySelector(e);if(n){let i=lp(n);return t.forEach(s=>{i=_o(i,s)}),i}}function op(e,t){let n=e.declarations;return t.forEach(i=>{n=_o(n,i)}),n}function lp(e){const t={};return Ir.forEach(n=>{const i=ot(e,`--${n}-${Zr}`);i&&(t[n]=i)}),t}const ap={"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"}},cp={"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"}},hp={"flip-block":{top:"bottom",bottom:"top",start:"end",end:"start"},"flip-inline":{left:"right",right:"left",start:"end",end:"start"},"flip-start":{}};function up(e,t){return ap[t][e]||e}function fp(e,t){return cp[t][e]||e}function dp(e,t){if(t==="flip-start")return e;{const n=hp[t];return e.split("-").map(i=>n[i]||i).join("-")}}function pp(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 mp=(e,t)=>{var n;return((n=Tt(`#id{${e}: ${t};}`).children.first)==null?void 0:n.block.children.first).value};function _o(e,t){const n={};return Object.entries(e).forEach(([i,s])=>{const r=i,l=mp(r,s),c=up(r,t);c!==r&&(n[r]!=null||(n[r]="revert")),At(l,{visit:"Function",enter(a){Fe(a)&&a.children.forEach(o=>{ue(o)&&Mr(o.name)&&(o.name=fp(o.name,t))})}}),r==="position-area"&&l.children.forEach(a=>{ue(a)&&co(a.name)&&(a.name=dp(a.name,t))}),r.startsWith("margin")&&pp(r,l,t),n[c]=tt(l)}),n}function yo(e){const t=ud(e),n=[];return t.forEach(i=>{const s={atRules:[],tactics:[],positionAreas:[]};i.forEach(r=>{ip(r.name)?s.tactics.push(r.name):r.name.startsWith("--")?s.atRules.push(r.name):co(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 gp(e){return Zd(e)&&e.value.children.first?yo(e.value.children):[]}function _p(e){if(ep(e)&&e.value.children.first){const t=Me(e);let n;const i=t.value.children.first.name;i&&sp(i)&&(n=i,t.value.children.shift());const s=yo(t.value.children);return{order:n,options:s}}return{}}function yp(e){return tp(e)&&e.value.children.first?{order:e.value.children.first.name}:{}}function bp(e){const{order:t,options:n}=_p(e);if(t||n)return{order:t,options:n};const{order:i}=yp(e),s=gp(e);return i||s?{order:i,options:s}:{}}function kp(e){return ae(e.property)||Qu(e.property)||Or(e.property)||Ju(e.property)||["position-anchor","position-area"].includes(e.property)}function Sp(e){var t,n;if(np(e)&&(t=e.prelude)!=null&&t.value&&(n=e.block)!=null&&n.children){const i=e.prelude.value,s=e.block.children.filter(l=>Jd(l)&&kp(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 vp(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=Cn(h);if(!u.length)return;const{order:f,options:d}=bp(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=rp(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=op(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,S])=>({type:"Declaration",important:!0,property:pt,value:{type:"Raw",value:S}})))}}),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 wp(e,t){return!e||e===t?!1:bo(e)?e.document.contains(t):e.contains(t)}function bo(e){return!!(e&&e===e.window)}function Cp(e){return Qt(e,"position","fixed")}function En(e){return!!(e&&(Cp(e)||Qt(e,"position","absolute")))}function ko(e,t){return e.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_FOLLOWING}function xp(e){return P(this,null,function*(){return yield nt.getOffsetParent(e)})}function Pn(e){return P(this,null,function*(){if(!["absolute","fixed"].includes(ot(e,"position")))return yield xp(e);let t=e.parentElement;for(;t;){if(!Qt(t,"position","static")&&Qt(t,"display","block"))return t;t=t.parentElement}return window})}function Lp(e,t,n,i){return P(this,null,function*(){const s=yield Pn(e),r=yield Pn(n);if(!(wp(r,e)||bo(r))||s===r&&!(!En(e)||ko(e,n)))return!1;if(s!==r){let l;const c=[];for(l=s;l&&l!==r&&l!==window;)c.push(l),l=yield Pn(l);const a=c[c.length-1];if(a instanceof HTMLElement&&!(!En(a)||ko(a,n)))return!1}{let l=e.parentElement;for(;l;){if(Qt(l,"content-visibility","hidden"))return!1;l=l.parentElement}}return!(t&&i&&So(e,t,i)!==So(n,t,i))})}function So(e,t,n){for(;!(e.matches(n)&&Sd(e,t));){if(!e.parentElement)return null;e=e.parentElement}return e}function Ap(e,t,n,i,s){return P(this,null,function*(){if(!(e instanceof HTMLElement&&n.length&&En(e)))return null;const r=n.flatMap(c=>bd(c,s)).filter(c=>kd(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 Lp(o?a.fakePseudoElement:a,t,e,l))return o&&a.removeFakePseudoElement(),a}return null})}function Tp(e){return e.type==="Declaration"&&e.property==="anchor-name"}function Ep(e){return e.type==="Declaration"&&e.property==="anchor-scope"}function On(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 Pp(e){return!!(e.type==="Percentage"&&e.value)}function vo(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)&&Mr(h.name))i=h.name;else if(Pp(h)){const f=Number(h.value);i=Number.isNaN(f)?void 0:f}}else On(e)&&ue(h)&&nf(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 wo(e){return e.value.children.map(({name:t})=>t)}let fe={},Mt={},Ft={},de={},jt={};function Op(){fe={},Mt={},Ft={},de={},jt={}}function Dp(e,t){var n;if((Fe(e)||On(e))&&t){if(t.property.startsWith("--")){const i=tt(t.value),s=vo(e);return de[s.uuid]=i,Ft[t.property]=[...(n=Ft[t.property])!=null?n:[],s],{changed:!0}}if(Fe(e)&&ae(t.property)||On(e)&&Rr(t.property)){const i=vo(e);return{prop:t.property,data:i,changed:!0}}}return{}}function Co(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[to.All]||[]:[],c=i?Mt[i]||[]:[];return yield Ap(e,i||null,r,[...l,...c],{roots:n.roots})})}function Ip(e,t){return P(this,null,function*(){var n,i,s,r,l,c,a,o,h,u,f;const d={},p={};Op();const{fallbackTargets:g,validPositions:y}=vp(e);for(const S of e){let M=!1;const W=Tt(S.css);At(W,function(E){var H,F,D,V;const R=(H=this.rule)==null?void 0:H.prelude,j=Cn(R);if(Tp(E)&&j.length)for(const z of wo(E))fe[z]!=null||(fe[z]=[]),fe[z].push(...j);if(Ep(E)&&j.length)for(const z of wo(E))Mt[z]!=null||(Mt[z]=[]),Mt[z].push(...j);const{prop:Q,data:vt,changed:zt}=Dp(E,this.declaration);if(Q&&vt&&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:[],vt]});let X;if(this.block&&(X=Vd(E),X)){Xd(X,this.block);for(const{selector:z}of j)p[z]=[...(V=p[z])!=null?V:[],X]}(zt||X)&&(M=!0)}),M&&(S.css=tt(W),S.changed=!0)}const _=new Set(Object.keys(Ft)),L={},C=S=>{var M,W,E,H,F;const D=[],V=new Set((W=(M=L[S])==null?void 0:M.names)!=null?W:[]);for(;V.size>0;)for(const R of V)D.push(...(E=Ft[R])!=null?E:[]),V.delete(R),(F=(H=L[R])==null?void 0:H.names)!=null&&F.length&&L[R].names.forEach(j=>V.add(j));return D};for(;_.size>0;){const S=[];for(const M of e){let W=!1;const E=Tt(M.css);At(E,{visit:"Function",enter(H){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(H)&&R&&j&&H.children.first&&_.has(H.children.first.name)&&j.startsWith("--")){const Q=H.children.first,vt=(D=Ft[Q.name])!=null?D:[],zt=C(Q.name);if(!(vt.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),S.push(j),Q.name=X,W=!0}}}),W&&(M.css=tt(E),M.changed=!0)}_.clear(),S.forEach(M=>_.add(M))}for(const S of e){let M=!1;const W=Tt(S.css);At(W,{visit:"Function",enter(E){var H,F,D,V,R,j,Q;const vt=(H=this.rule)==null?void 0:H.prelude,zt=this.declaration,X=zt?.property;if(vt?.children.isEmpty===!1&&je(E)&&zt&&X&&E.children.first&&(ae(X)||Or(X))){const z=E.children.first,Jt=(F=Ft[z.name])!=null?F:[],In=C(z.name);if(!(Jt.length||In.length))return;const $e=`${X}-${dt(12)}`;if(In.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]),{[$e]:`${ee}-${$e}`});Zt.delete(te),(R=lt?.names)!=null&&R.length&<.names.forEach(ee=>Zt.add(ee))}}const qp=Cn(vt);for(const Zt of[...Jt,...In]){const te=U({},Zt),lt=`--anchor-${dt(12)}-${X}`,ee=te.uuid;te.uuid=lt;for(const{selector:ne}of qp)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]),{[$e]:lt})}z.name=`${z.name}-${$e}`,M=!0}}}),M&&(S.css=tt(W),S.changed=!0)}if(Object.keys(jt).length>0)for(const S of e){let M=!1;const W=Tt(S.css);At(W,{visit:"Function",enter(E){var H,F,D,V;if(je(E)&&(F=(H=E.children.first)==null?void 0:H.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,vt]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(${vt})`)}}),M=!0;de[R.name]&&(this.declaration.value={type:"Raw",value:de[R.name]},M=!0)}}}),M&&(S.css=tt(W),S.changed=!0)}const T=new Map;for(const[S,M]of Object.entries(d)){let W;S.startsWith("[data-anchor-polyfill=")&&(n=g[S])!=null&&n.length?W=he(t.roots,g[S].join(",")):W=he(t.roots,S);for(const[E,H]of Object.entries(M))for(const F of H)for(const D of W){const V=yield Co(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[S]=J(U({},y[S]),{declarations:J(U({},(r=y[S])==null?void 0:r.declarations),{[E]:[...(a=(c=(l=y[S])==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[S,M]of Object.entries(p)){const W=he(t.roots,S);for(const E of W){const H=yield Co(E,null,{roots:t.roots});for(const F of M){const D=yield qd(E,F,H);pt.css+=Gd(D.targetUUID,F.selectorUUID),pt.changed=!0,y[S]=J(U({},y[S]),{declarations:J(U({},(o=y[S])==null?void 0:o.declarations),{"position-area":[...(f=(u=(h=y[S])==null?void 0:h.declarations)==null?void 0:u["position-area"])!=null?f:[],D]})})}}}return{rules:y,inlineStyles:T,anchorScopes:Mt}})}const Rp=["as","blocking","crossorigin","disabled","fetchpriority","href","hreflang","integrity","referrerpolicy","rel","type"];function xo(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")&&!Rp.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 Mp=J(U({},nt),{_c:new Map}),Fp=(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},jp=(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},Lo=e=>{switch(e){case"top":case"bottom":return"y";case"left":case"right":return"x"}return null},zp=e=>{switch(e){case"x":return"width";case"y":return"height"}return null},Ao=e=>ot(e,"display")==="inline",To=(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,$p=e=>({top:ze(e,"top"),right:ze(e,"right"),bottom:ze(e,"bottom"),left:ze(e,"left")}),Dn=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(!Rr(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=jp(r,o)}}return a?`${i[a]}px`:l}if(s!==void 0){let a,o;const h=Lo(n);if(!(ae(n)&&h&&(!ae(s)||h===Lo(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=Fp(s,p)}}const f=typeof a=="number"&&!Number.isNaN(a),d=zp(h);if(f&&d){(n==="bottom"||n==="right")&&(o=yield Ln(t));let p=i[h]+i[d]*(a/100);switch(n){case"bottom":{if(!o)break;let g=o.clientHeight;if(g===0&&Ao(o)){const y=To(o,h);g=o.offsetHeight-y}p=g-p;break}case"right":{if(!o)break;let g=o.clientWidth;if(g===0&&Ao(o)){const y=To(o,h);g=o.offsetWidth-y}p=g-p;break}}return`${p}px`}}return l}),Np=e=>"wrapperEl"in e,Wp=e=>"uuid"in e;function Hp(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(Np(r)){const a=r.wrapperEl,o=(h,u,f)=>P(null,null,function*(){return h===0?"0px":yield Dn({targetEl:a,targetProperty:u,anchorRect:f,anchorSide:h})});Ge(l,a,()=>P(null,null,function*(){const h=ot(c,ro);a.setAttribute(oo,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 Ge(l,c,()=>P(null,null,function*(){const a=yield nt.getElementRects({reference:l,floating:c,strategy:"absolute"}),o=yield Dn({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 Dn({targetProperty:i,anchorSide:r.anchorSide,anchorSize:r.anchorSize,fallback:r.fallbackValue});n.style.setProperty(r.uuid,a)}}})}function Eo(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:Mp,rects:n,elements:{floating:e,reference:t},strategy:"absolute"},{padding:$p(e)})})}function Bp(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 Ln(s);Ge({},s,()=>P(null,null,function*(){if(r)return;r=!0,s.removeAttribute("data-anchor-polyfill");const c=yield Eo(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 Eo(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 Up(e,t=!1){return P(this,null,function*(){var n,i;for(const s of Object.values(e))yield Hp((n=s.declarations)!=null?n:{},t);for(const[s,r]of Object.entries(e))yield Bp(s,(i=r.fallbacks)!=null?i:[],t)})}function Vp(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 Xp(e){return P(this,null,function*(){const t=Vp(e??window.ANCHOR_POSITIONING_POLYFILL_OPTIONS);let n=yield Ld(t),i={},s;dd();try{md(n)&&(n=xo(n));const r=yield Ip(n,{roots:t.roots});i=r.rules,s=r.inlineStyles}catch(r){throw fd(),r}return Object.values(i).length&&(xo(n,s,!0),yield Up(i,t.useAnimationFrame)),i})}const Yp=Object.freeze(Object.defineProperty({__proto__:null,default:Xp},Symbol.toStringTag,{value:"Module"}));v.ActiveDescendantController=Do,v.AnchorController=Vo,v.DragController=No,v.DragGestureController=We,v.ItemsCollectionController=Io,v.MutationObserverController=Yo,v.NativeChildController=Zo,v.NavigationIndicatorController=qo,v.RafScheduler=Go,v.ResizeController=Wo,v.RovingTabIndexMixin=nl,v.ScrollObserverController=Xo,v.TypeaheadController=Ko,v.findExtremeSnapIndex=ll,v.findNearestScrollAncestor=Qo,v.findNearestSnapIndex=rl,v.findNextSnapIndex=ol,v.getDirectChild=$n,v.getDirectChildren=Nn,v.isFocusable=zn,v.keyInteraction=Mo,v.keyNavigation=jo,v.mouseMove=$o,v.pinElementBox=Rn,v.snapToStep=il,v.valueToPercent=sl,v.warnMissingDirectChild=Jo,Object.defineProperty(v,Symbol.toStringTag,{value:"Module"})}));
|
|
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"})}));
|